Repository navigation
Conversation
A plugin's `assistants` entry names an assistant and a component that builds it with hooks and passes it to `usePetrinautAiAssistant`. The editor mounts the active assistant's component beside itself and shows the AI panel, its toggle and the empty-net prompt only while that assistant has passed a value. The active assistant is the one chosen in User settings, or the first installed; with several installed, User settings offers a selector and the palette a switch command for each other assistant. The deprecated `aiAssistant` prop is served as the first assistant.
The stock assistant and Brunch are assistant plugins, and the host passes them what only it owns through a demo assistant context: the open document and its handle, the repository's revision barrier, the stock history and the Voice preference. Brunch's session, tools, history, Ledger tab and Voice mode run inside its assistant component, which mounts only while Brunch is active. Petrinaut's User settings now hold the choice; the site's earlier stored choice and build default only order the assistants until the user picks one. The Voice toggle is a Brunch Labs settings group, and the palette switch comes from Petrinaut.
No host passes `slots` any more: the website's Labs rows are a Brunch settings group. Plugins add Labs groups through `settingsGroups`, and the settings tests that passed Labs content through `slots` install a plugin group instead.
The plugins usage manual gains the assistants place, its rules and an example, and loses the assistant contribution from what is not here yet. The user guide explains the AI assistant choice in User settings and the palette, the host props table marks `aiAssistant` deprecated, and the website README describes the stock and Brunch plugins and how they are ordered.
…across nets The canvas insets count the AI panel only while an assistant is showing, so an assistant that fails or passes `null` no longer leaves a gap that nothing can close. Brunch's Voice check runs in the Brunch plugin's component, keyed on Brunch being active: it re-checks on each switch to Brunch and keeps its answer when another document opens. The docs say that a conversation survives a switch only when its assistant keeps it, and the hook's comment says which fields apply once per conversation.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Contributor
Author
|
Superseded by #9914 (assistant plugins) in the rebuilt plugin API stack. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Before this PR, the AI panel's assistant came only from the
aiAssistantprop. The website built the stock assistant and Brunch in one host component and switched between them with its own Labs toggle and palette command, carried by the deprecatedslotsprop.Adds an assistants place to the plugin API. A plugin contributes an assistant whose component builds it with hooks and passes it to
usePetrinautAiAssistant, and the editor draws the AI panel from what the active assistant passes. No assistant hides the panel and every AI entry point, one is used as is, and several get a selector in User settings and a palette command each. The website's stock assistant and Brunch are plugins, Brunch's Voice toggle is a Brunch Labs group, andslotsis removed.Links
Changes
Library
assistantsentryusePetrinautActiveAssistantIdtells a plugin's other contributions which assistant is activeaiAssistantprop is served as the first assistant, labelled "AI"slotsprop and thePetrinautSlotstype are removedWebsite
Known issues
aiAssistantpropNext steps
Test coverage
plugin-assistants.test.tsx:plugin.test.ts:user-settings.test.tsx:editor-view.test.tsx:local-storage-demo-app.test.tsx:brunch-voice-setting.test.tsx:How to test
One assistant
Two assistants
VITE_BRUNCH_CHAT_ENDPOINT=/agents/chat yarn workspace @apps/petrinaut-website dev