Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
a287b93 to
f6f307e
Compare
8f102fe to
00b60b0
Compare
f6f307e to
76e663d
Compare
00b60b0 to
5ebadbe
Compare
e7fc133 to
19ebd53
Compare
c6d099f to
3023386
Compare
19ebd53 to
2567041
Compare
2567041 to
458f3d4
Compare
PR SummaryHigh Risk Overview Hosts register assistants via manifest Tests and docs follow the plugin model (assistant probing, Reviewed by Cursor Bugbot for commit 15b91de. Bugbot is set up for automated code reviews on this repo. Configure here. |
The frame, header, tab strip, tabs, docking, focus and tab attention move out of the chat view into PetrinautAssistantWindow, which the chat draws around its transcript. The editor keeps the shown tab, start requests and focus requests above the chat, which reads them through usePetrinautAssistantWindow. PetrinautAssistantWindowPreview hosts a chat outside an editor for stories and tests.
Renames only: the AI panel, its chat view, tools, transports, voice session and the chat types move from the library to apps/petrinaut-website/src/main/app/plugins/_shared/chat. Imports are not updated here, so this commit does not build alone; the next commits adapt the library and the kit.
A plugin with `assistant: { label }` provides the editor's AI assistant; one with `assistant: { extends }` adds tabs and start actions to another plugin's. The provider resolves the active assistant once, from the stored `aiAssistantId` or the first running assistant, and User settings -> General -> AI assistant and the palette's switch commands change it. An extension whose parent is missing or off shows "Needs ..." in the Plugins section.
The library drops the `aiAssistant` prop, its chat types and stories, and the AI SDK and react-markdown dependencies, which move to the website with the chat kit.
`AssistantChat` takes the assistant plugin's `api` (document and experiments, write access) and holds it in a kit-owned context, so the chat reads the net, edits it, runs experiments and reports errors through the plugin api instead of the editor's internals. Refused edits come back as blocked tool output. Each chat renders its own Voice session. `executePetrinautAiMutation` and the automatic tools take `edit`. Core drops `createPetrinautAiWritableCallbacks`, which nothing uses any more.
`website.petrinaut-ai` renders the shared chat as its assistant view and keeps each document's transcript in this browser; the `/ai-experiments` route passes its scripted assistant as `website.ai-experiments-demo`. While Brunch is the selected assistant, the shell passes `website.brunch`, a bridge plugin that renders the Brunch chat and Ledger tab the shell still builds. Website imports of the chat kit come from `plugins/_shared/chat`, and the Brunch tools edit through the plugin api.
The website's unit and integration tests load a `matchMedia` shim for jsdom, the shared chat's components compile with the React Compiler under test, and the React Compiler lint rules apply to `plugins/_shared/chat`.
Adds the Assistant plugins and host-tools pages, the assistant window diagram, the assistant rows of the plugin usage manual and the demo site's assistant plugins, and points the README's AI section and the user guide at them. The user guide describes the AI assistant setting and the Needs chip. Pending @hashintel/petrinaut changesets whose subject moved to the website with the chat (Brunch, Voice, chat and tool UI) are deleted; mixed ones keep the part that stays in the library. The changelog's hand-written Unreleased block, which announced the same chat and Voice APIs, goes too.
The Brunch bridge offers Voice's start action in the empty-net prompt again while its chat has Voice mode. The assistant window leaves out a tab that reuses the chat tab's id or another tab's and reports it under that plugin's id, instead of throwing outside every plugin boundary. The chat tab falls back to the plugin's assistant label, as the user guide now says. The browser-storage helpers move to app/shared, so Petrinaut AI no longer imports from the demo shell. Review cleanups: one list of running assistants, one select style in User settings, the preview built on the standalone host, the auto-layout output in one helper, an empty test instance for the kit tests, type tests for the assistant manifest, and no dead exports, aliases, stale names or blank-line-only hunks. Docs: the user guide calls the stock assistant Petrinaut AI and describes assistants in the Plugins section; the plugin pages, diagrams and the AI-experiments, snapshot-diagnostics and testing notes describe the assistant runtime as built.
Assistant tab activity identities are strings, so the attention state keeps them as given. The user guide drops the removed host mutation check, the experiment chat page names the chat as the dispatcher, and the moved kit's comments name the chat rather than the library. The changesets name the added assistant API and the removed exports, and keep the release notes for the assistant window's clearance and auto-layout framing. The AI experiments demo names its plugin, the jsdom shim leaves matchMedia to the vitest setup, and new tests cover Petrinaut AI in the real editor and the canvas insets of a window whose assistant is off.
Petrinaut AI passes its saved transcript back through the plugin a commit after the chat's own state, so the first idle render after a fast tool continuation restored the step before it. The chat now applies the stored transcript only until it first reports one. The plugin test preloads the language server worker, whose cold import made diagnose() slow under load.
Summary
Before this PR, hosts passed the AI assistant through the
aiAssistantprop.@hashintel/petrinautrendered the chat itself: transcript, composer, tools and Voice. Website switched that one configuration object between the stock assistant and Brunch.This PR makes the assistant a plugin. A plugin declares
assistantin its manifest and returns its whole UI asassistant.view, which draws the library'sPetrinautAssistantWindowaround its transcript. Chat moves to the website'splugins/_shared/chat, where Petrinaut AI, Brunch and the AI experiments demo render it through the pluginapi. An editor without an assistant plugin shows no AI entry point.Links
Changes
Library
assistantprovides an assistant or extends oneapi.assistant.isActivetells a plugin whether its assistant is shownPetrinautAssistantWindowframes an assistant's viewaiAssistantprop and every chat export removedWebsite
plugins/_shared/chatAssistantChatreaches the editor only through the pluginapiwebsite.petrinaut-aipluginwebsite.brunchbridge plugin/ai-experimentspasses its scripted assistant as a pluginmessagesonly until it first reports a transcriptKnown issues
Next steps
"stock" | "brunch"presentation into its pluginsTest coverage
plugin-assistant.test.tsx:assistant-window.test.tsx,tab-attention.test.ts:plugin-statuses.test.ts,define-petrinaut-plugin.test.ts:user-settings.test.tsx,ai-cta-modal.test.tsx:petrinaut-ai/plugin.test.tsx:plugins/_shared/chat:How to test
Petrinaut AI
Build an SIR modelin promptAI experiments demo
run