Skip to content

Render Brunch's chat in the assistant panel from its plugin - #10105

Draft
kube wants to merge 2 commits into
claude/petrinaut-ai-own-uifrom
claude/brunch-own-ui
Draft

kube wants to merge 2 commits into
claude/petrinaut-ai-own-uifrom
claude/brunch-own-ui

Conversation

@kube

@kube kube commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Before this PR, the demo shell passed Brunch's chat to the editor through the aiAssistant prop, and the library drew it with its built-in chat. Brunch's tools, voice and Flue modules imported the library's chat types.

website.brunch now provides the assistant and renders the website's chat with Brunch's configuration. Title bar shows Brunch's Chat and Ledger tabs. Brunch imports the website chat's types, and nothing on the demo site uses the aiAssistant prop.

Links

Changes

  • website.brunch declares assistant and renders AssistantChat

    Shell builds Brunch's configuration with useBrunchAssistant and provides it in BrunchAssistantContext above <Petrinaut>.
    Ledger arrives as additionalTab, so the title bar shows tabs.

  • Empty-canvas prompt offers Voice through Brunch's start action

    Only while Brunch's configuration has Voice.

  • website.brunch takes document: "write"

    Chat's edits run through api.document.edit.

  • Brunch's host tools take the chat kit's execute parameters

    Reads use the document handle the tools were created with.
    Mutations run through edit.

  • Brunch's tools, voice and Flue modules import the chat kit's types
  • Demo shell passes no aiAssistant
  • BrunchAssistantContext is deprecated

    It bridges the shell's Brunch configuration into the plugin until Brunch's plugin builds it itself.

Test coverage

  • brunch-mutation-approval.in-editor.test.tsx:

    Brunch's approval card in the real editor, with the chat from Brunch's plugin.

  • voice-history-continuity.test.tsx, voice-browser-tools.test.tsx:

    Voice history and browser tools through the chat kit.

  • brunch-petrinaut-tools.test.ts:

    Host tools read the bound document and edit through edit.

  • local-storage-demo-app.test.tsx, local-storage-demo-app.draft-panel.test.tsx:

    Shell provides Brunch's configuration to its plugin.

  • ledger-refusal-presentation.integration.test.tsx:

    Ledger presents a refused edit, with the chat kit's executor.

How to test

  • Open Petrinaut preview on Vercel
  • Press ⌘K > Use Brunch
  • Bottom bar > Show AI assistant

    Expect Chat and Ledger tabs in title bar

  • Send Model a queue with arrivals and service

    Expect Brunch's reply and net changes

  • Select Ledger tab

    Expect ledger entries for the changes

  • Menu > User settings > Plugins

    Expect Brunch tagged Assistant

@kube kube self-assigned this Oct 19, 2026
@github-actions github-actions Bot added area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team area/tests New or updated tests area/apps labels Oct 19, 2026
@kube
kube added this pull request to stack #10107 October 19, 2026 22:04
@vercel

vercel Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hash Ready Ready Preview Oct 20, 2026 9:16pm UTC
petrinaut Ready Ready Preview Oct 20, 2026 9:16pm UTC
petrinaut-docs Ready Ready Preview Oct 20, 2026 9:16pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
hashdotdesign-tokens Ignored Ignored Preview Oct 20, 2026 9:16pm UTC

Request Review

@kube
kube force-pushed the claude/brunch-own-ui branch from 552f5a3 to fdde9cd Compare October 19, 2026 22:32
@kube
kube force-pushed the claude/brunch-own-ui branch from fdde9cd to 300ca74 Compare October 19, 2026 22:49
@kube
kube force-pushed the claude/brunch-own-ui branch from 300ca74 to 097dbf5 Compare October 20, 2026 11:28
@kube
kube force-pushed the claude/brunch-own-ui branch from 097dbf5 to dd5eeb5 Compare October 20, 2026 13:41
@kube
kube force-pushed the claude/brunch-own-ui branch from dd5eeb5 to 907a14f Compare October 20, 2026 15:53
@kube
kube force-pushed the claude/brunch-own-ui branch from 907a14f to 73e60fa Compare October 20, 2026 16:04
@kube
kube force-pushed the claude/brunch-own-ui branch from 73e60fa to f5e51a3 Compare October 20, 2026 16:08
@kube
kube force-pushed the claude/brunch-own-ui branch from f5e51a3 to 5810db1 Compare October 20, 2026 16:16
@kube
kube force-pushed the claude/brunch-own-ui branch from 5810db1 to e17ea07 Compare October 20, 2026 16:43
@kube
kube force-pushed the claude/brunch-own-ui branch from e17ea07 to 50af8f1 Compare October 20, 2026 17:08
kube added 2 commits October 20, 2026 23:09
It carries the demo shell's Brunch configuration into Brunch's plugin until the plugin builds it itself.

This branch was successfully deployed

3 active deployments
Preview – petrinaut-docs — 416e60d5 Deployed Oct 20, 2026 by vercel[bot]
Preview – hash — 416e60d5 Deployed Oct 20, 2026 by vercel[bot]
Preview – petrinaut — 416e60d5 Deployed Oct 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) area/tests New or updated tests type/eng > backend Owned by the @backend team

Development

Successfully merging this pull request may close these issues.

1 participant