PR: #521: feat(matter): Mira CCB + matter conversation panel [Story-2040] by @ankitmaheshwari-com
View PR →

Files changed

18 file(s), +1217 / -73 lines

Path Role + -
messages/en.jsonConfig+41-0
messages/hi.jsonConfig+41-0
src/components/matter-detail/brief/brief-mira-ccb.tsxComponent+47-0
src/components/matter-detail/brief/matter-brief-page.tsxComponent+35-0
src/components/matter-detail/brief/matter-brief-sections.tsxComponent+12-0
src/components/matter-detail/ccb/mira-control-bar.stories.tsxComponent+72-11
src/components/matter-detail/ccb/mira-control-bar.tsxComponent+136-62
src/components/matter-detail/ccb/mira-conversation-panel.stories.tsxComponent+123-0
src/components/matter-detail/ccb/mira-conversation-panel.tsxComponent+220-0
src/components/matter-detail/ccb/mira-descriptor.tsComponent+53-0
src/components/matter-detail/ccb/mira-matter-dock.stories.tsxComponent+35-0
src/components/matter-detail/ccb/mira-matter-dock.tsxComponent+64-0
src/components/matters/matter-shell-chrome.tsxComponent+15-0
src/lib/agents/atlas-rail-store.tsLibrary+51-0
src/lib/agents/atlas-rail.tsLibrary+31-0
src/lib/agents/mira-rail.tsLibrary+95-0
src/lib/agents/use-mira-command-rail.tsLibrary+74-0
src/lib/agents/use-mira-conversation-rail.tsLibrary+72-0

Story-2040: Mira in the app — the CCB + matter conversation panel

Mira is the head of one matter (RFD-AGT-007). She talks — a matter-scoped streaming chat that replaces Atlas's matter-facing surface (§5.2) — and she does — a scoped command that runs Vega's panel and lands a proposed frame edit for counsel to Confirm/Reject (§5.1). This story builds both app surfaces against the frozen §5.1/§5.2 contract, reusing every existing primitive: the agent-agnostic ACP substrate, the agent-agnostic broker WS rail, and — critically — the existing Brief frame ratify rail. No new ratify surface is introduced.

What landed

Acceptance criteria

ACWhere
Converse about a matter, replies stream inConversation panel + converse rail; Storybook MiraConversationPanel → Conversation / Streaming
Scoped command → proposed edit on the existing rail (Confirm/Reject)Brief gutter onMira → CCB → command rail → Brief invalidate → field provenance="proposed"
"Do it" escalation fires a commandsuggestedCommand tail → panel chip → useMiraCommandRail.run(scope, text)
No new ratify surface; Mira identity + avatar; i18n both localesCCB routes ratify to the Brief rail; mira-descriptor.ts; en + hi at parity
Storybook for panel + CCB states, incl. motion3 story files; Live + Motion (CCB), WithDoIt (panel), dock enter/exit

Files

FileChange
src/components/matter-detail/ccb/mira-descriptor.tsnew — localized Mira AgentDescriptor
src/components/matter-detail/ccb/mira-control-bar.tsxprototype → live (i18n, wired command, ratify via Brief rail)
src/components/matter-detail/ccb/mira-conversation-panel.tsxnew — view + rail-wired container (Do-it chip)
src/components/matter-detail/ccb/mira-matter-dock.tsxnew — floating "Ask Mira" + overlay drawer
src/components/matter-detail/ccb/*.stories.tsxCCB (rewritten), conversation panel (new), dock (new)
src/components/matter-detail/brief/brief-mira-ccb.tsxnew — Brief command entry (floating CCB + command rail)
src/components/matter-detail/brief/matter-brief-page.tsxwire onMira gutter → CCB; invalidate on proposed
src/components/matter-detail/brief/matter-brief-sections.tsxthread onMira to the editable fields
src/components/matters/matter-shell-chrome.tsxmount the Mira dock + live panel once for the matter subtree
src/lib/agents/mira-rail.tsnew — converse/command WS launch + query builders (§5.1/§5.2)
src/lib/agents/use-mira-conversation-rail.tsnew — the streaming converse hook
src/lib/agents/use-mira-command-rail.tsnew — the command hook (settle → Brief invalidate)
src/lib/agents/atlas-rail.tssuggestedCommand on the shared reducer (converse tail)
src/lib/agents/atlas-rail-store.tstwo Mira connections on the agent-agnostic machinery
messages/en.json, messages/hi.jsonnew Mira namespace (33 keys, at parity)

Verify

Broker readiness — the one unverified boundary (ADR-110)

Per ADR-110, broker readiness is kept separate from surface readiness, and this boundary is not provable live from this repo today: the broker's Mira intent:"converse"/"command" routing lands with the Atlas cutover (RFD Story-G), and the brain (pramaan-agents Stories A–D) is not yet on AgentCore staging. The RFD explicitly scoped Story-F to build against a stub. So: the app surfaces + rail are wired against the FROZEN §5.1/§5.2 input shape (mira block, current_frame/ documents broker-assembled per §5.1), and go live the moment the broker routes Mira. The seam to confirm is the outer WS client-message envelope (agentKey/kind), which mirrors the dock's buildDockChatLaunch convention pending the broker's Mira WebSocketClientMessage. Streamed-markdown replies render as whitespace-preserving text today (matching the Atlas dock's current behaviour); rich-markdown rendering is the shared live-rail follow-up.