AGENTS.md@packages/client-utils/src/minimal-chat · git:20261008.010c873 · 2026-10-08 · sha256 5479c15e4df3a50d
AGENTS.md@packages/client-utils/src/minimal-chat git:20261008.010c873A
Immutable. This exact content never changes and is served at /api/v1/blob/5479c15e4df3a50d.
# DOX — packages/client-utils/src/minimal-chat
Files in this directory. One row per source file.
| File | Purpose |
|------|---------|
| `index.ts` | Barrel for `./minimal-chat` subpath export. Re-exports `MinimalChatView`, `statusVisualsFor`, `extractInputPreview` from `MinimalChatView.js`; re-exports types `MinimalChatEntry`, `MinimalChatMeta`, `MinimalChatMode`, `MinimalChatStatus`, `MinimalChatViewProps` from `types.js`. Import path: `@blackbelt-technology/pi-dashboard-client-utils/minimal-chat`. |
| `MinimalChatView.tsx` | Shared subagent/agent timeline renderer. Exports `MinimalChatView` (props `MinimalChatViewProps`), `statusVisualsFor(status)` → `{ iconPath, colorClass }`, `extractInputPreview(toolName, input)` → preview string. Modes: `inline` (body `h-[60vh]`), `popout` (`h-full`), `row` (single-line, no body). Resolves `MarkdownContent`, `formatTokens`, `formatDuration`, `toolCallStep`, `thinkingBlock` via `useUiPrimitive`/`useUiPrimitiveOrNull`; falls back to inline renderers when primitive absent. Entry kinds: `tool`, `text`, `thinking`, `error`. Single source of truth replacing duplicated timeline UI in `SubagentDetailView` and `FlowAgentDetail`. Header renders `meta.cost` (pre-formatted string) between tokens and duration when present. See change: surface-flow-agent-cost. Optional `liveEntry` prop renders trailing `LiveEntry` (`data-testid=minimal-live-entry`, "in progress") after entries+footer; counts as body content → suppresses empty state. See change: stream-subagent-reasoning-and-stable-card. `LiveEntry` per mock: reasoning header + pulse dots (`motion-safe:` only), 13px `whitespace-pre-line` body, top fade mask, `plainTail` for writing; `expandLastThinking` opens newest thinking entry. |
| `live-tail-text.ts` | Streaming-tail text helpers: `plainTail(text)` strips heading/bullet/code/bold markers keeping line breaks; `currentSentence(text)` last sentence flattened (card ticker). See change: stream-subagent-reasoning-and-stable-card. |
| `types.ts` | Type contracts for `MinimalChatView`. Exports `MinimalChatMode` (`"inline" | "popout" | "row"`), `MinimalChatStatus` (`"pending" | "running" | "complete" | "error" | "blocked"`), `MinimalChatEntry` (discriminated union `tool | text | thinking | error`), `MinimalChatMeta` (`modelName?`, `tokens?`, `cost?` pre-formatted USD string, `durationMs?`; see change surface-flow-agent-cost), `MinimalChatViewProps`. Producer adapters map plugin-specific state into these structural types at shim boundary. Adds `MinimalChatLiveEntry` (`kind: thinking|text`, `text`) + `MinimalChatViewProps.liveEntry?`. See change: stream-subagent-reasoning-and-stable-card. |