feat(web-react,assistant): shared ChatComposer + relocate the assistant into agent-app#155
Conversation
Add ChatComposer: the auto-resizing message input every agent app hand-rolled (Enter sends / Shift+Enter newline, opt-in attach + drag-and-drop with pending-file chips, streaming Stop/Send toggle, a controls slot for the model/effort pills, Cmd/Ctrl+L focus). It styles only against the shared design tokens — no private --chat-* custom properties — so it themes correctly in any shell, replacing the off-theme inputs across the products. Add an optional priorityGroup to ModelPicker so a product can pin a labeled section (e.g. a tuner app's own fine-tuned models) above Recommended without duplicating those rows in the provider groups.
A /composer route renders ChatComposer across its states (model pill above, typed, streaming, attachments, footer placement) for visual review in light + dark. Alias web-react's lazy terminal import (and its @xterm deps) to a stub so the playground dev server starts without the terminal panel's runtime deps installed.
Relocate the portable assistant/copilot feature (dock, panel, history, reducer, transport client, persistence, hooks, proposal card) and rebuild its chat surface on web-react's own components, so the whole stack ships from one package and the dependency graph stays a DAG. - Transcript renders via AssistantTranscript (web-react ChatMessages) with adaptTranscript folding each turn's text/tool segments in emission order; the AgentTimeline build-timeline path is dropped. - Composer is ChatComposer with the ModelPicker in its controls slot; the catalog maps onto CatalogModel. - Provider marks render via web-react ProviderLogo; timeAgo is inlined. - The markdown renderer and per-tool detail renderers are injected props, so this subpath imports no @tangle-network/ui (Command Deck) or sandbox-ui. A shared test-setup registers @testing-library cleanup between tests (this repo doesn't run with globals), and the copied tests are conformed to the stricter tsconfig (noUncheckedIndexedAccess).
🤖 AI Code Review (ensemble)SummaryThis PR introduces a portable Issues Found1 total — 0 P1 (blocking) · 1 P2 (should fix) · 0 P3 (nice to have)
|
The chat components (ModelPicker, ChatMessages) consume CatalogModel, so a web-react consumer should import the type from here rather than the package root — avoids depending on the heavyweight root barrel just for the model type.
🤖 AI Code Review (ensemble)
SummaryThis PR introduces a portable, cross-host assistant surface ( Issues Found1 total — 0 P1 (blocking) · 1 P2 (should fix) · 0 P3 (nice to have)
useAssistantChat hook |
Part of a cross-repo effort to converge every chat surface onto agent-app's
chat components and delete the "Command Deck" chat (
@tangle-network/ui/chat).Addresses tangle-network/agent-dev-container#2715 (off-theme assistant composer)
and #1923 (four divergent chat inputs); those issues close in the downstream
agent-dev-container PR once this publishes.
What
web-react: addChatComposer— the auto-resizing message input every apphand-rolled (Enter sends / Shift+Enter newline, opt-in attach + drag-drop with
pending-file chips, streaming Stop/Send, a controls slot for the model/effort
pills, Cmd/Ctrl+L focus). It styles only against the shared design tokens — no
private
--chat-*custom properties — so it themes correctly in any shell (theroot cause of the off-theme assistant input).
ModelPickergains an optionalpriorityGroupprop so a product can pin a labeled section (e.g. a tuner app'sfine-tuned models) above Recommended.
./assistant: relocate the in-app assistant out of sandbox-ui and rebuild itschat surface on web-react's own components:
AssistantTranscript(web-reactChatMessages) viaadaptTranscript,folding each turn's text/tool segments in emission order; the AgentTimeline
build-timelinepath is droppedChatComposerwithModelPickerin its controls slotProviderLogo;timeAgoinlinedNet:
@tangle-network/agent-app/assistantimports no@tangle-network/ui(Command Deck) and no
@tangle-network/sandbox-ui— the dependency graph stays aDAG (sandbox-ui continues to never import agent-app).
Verification
pnpm typecheckcleanpnpm test— 2147 pass (incl. 211 assistant tests); copied tests conformed to thestricter tsconfig + a shared RTL-cleanup test-setup
ChatComposervisually verified against the design mockups (light + dark) in theplayground's new
/composerrouteDraft until the downstream sandbox-ui + agent-dev-container phases are validated
against this branch (linked locally), after which agent-app publishes.