reifyui 0.13.8 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -62,6 +62,7 @@ A production-grade surface for rendering and interacting with a live agent turn:
62
62
  | **Slides** (`reifyui/slides`) | `SlideView`, `SlideStage`, `EditorCanvas`, `Presentation`, `ElementView`, `themeVars` — render a JSON deck, edit it by direct manipulation, present it |
63
63
  | **Spreadsheet** | `SheetGrid`, `sheetToDelimited`, `sheetToAoA` — an AI-editable grid, extensible with your own column types |
64
64
  | **HarnessRouter** (`reifyui/harness`) | `configureKit`, `kitHarness`, `listSessions`, `readFile`, `writeFile`, `createResponse`, `streamTurn`, `turnsToMessages`, `fileToInputBlock` — the transport for apps served by a HarnessRouter console |
65
+ | **Agent chat** (`reifyui/agent-chat`) | `AgentConversation`, `AgentTurnView`, `AgentComposer`, `WorkingIndicator`, `StepRow`, `WorkGroup`, `TodoCard`, `reduceTurn`, `turnFromMessage`, `describeTool`, `motionFor` — an agent's turn the way Claude Code shows it: one live line, work folded to a past-tense line per run of calls, every call one click from its input and output |
65
66
  | **Icons / tool meta** | `Ic*` icon set, `toolMeta`, `humanize`, `summarizeSteps` |
66
67
  | **Auth (optional)** | `configureAuth`, `login`, `AuthForm`, `GoogleButton` — a thin JWT client for products with a `/v1/auth`-style backend; wired to nothing by default |
67
68
 
@@ -155,6 +156,7 @@ import 'reifyui/styles/sheet.css'; // spreadsheet grid
155
156
  import 'reifyui/styles/panels.css'; // panel + panel grid, stat tile, result table
156
157
  import 'reifyui/styles/tasks.css'; // task list
157
158
  import 'reifyui/styles/dialog.css'; // alert / confirm / prompt dialogs
159
+ import 'reifyui/styles/agent-chat.css'; // reifyui/agent-chat: the agent conversation
158
160
  ```
159
161
 
160
162
  Themes are CSS-variable files — load one, or switch at runtime by toggling which you apply. Override
@@ -192,6 +194,43 @@ import 'reifyui/styles/chat.css';
192
194
  message — with its files — and retries, instead of showing a turn that failed. Everything else it
193
195
  learns through `handlers`, which are the streaming dispatcher's own callbacks.
194
196
 
197
+ ## Agent chat
198
+
199
+ `reifyui/agent-chat` draws an agent's turn the way Claude Code does. Prose in full; the work
200
+ between two pieces of prose folded to one past-tense line ("Ran 3 commands, edited app.ts +12 −4"),
201
+ which opens to every call, each of which opens to its whole input and output (copyable, long output
202
+ behind "+N lines"); a plan card with the agent's latest todo list; and one live line at the bottom,
203
+ `[mark] 1m 4s · Running npm test`, where the mark is the harness's own logo, moving.
204
+
205
+ ```jsx
206
+ import { AgentConversation, AgentTurnView, AgentComposer, newTurn, reduceTurn, motionFor } from 'reifyui/agent-chat';
207
+ import 'reifyui/styles/agent-chat.css';
208
+
209
+ // The data: a Turn, folded from the Responses events as they arrive. `at` is the receive time;
210
+ // pass null for a replayed event and no duration is ever invented from it.
211
+ let turn = newTurn({ user: { text }, startedAt: Date.now() });
212
+ onEvent((ev) => { turn = reduceTurn(turn, ev, Date.now()); render(); });
213
+
214
+ <AgentConversation mode="page" running={turn.status === 'running'} followKey={turns.length}
215
+ composer={<AgentComposer value={v} onChange={setV} onSend={send} onStop={stop}
216
+ running={turn.status === 'running'} onAttachFiles={attach} />}>
217
+ {turns.map((t) => (
218
+ <AgentTurnView key={t.id} turn={t} renderMarkdown={(s) => <Markdown>{s}</Markdown>}
219
+ mark={<img src="/logos/claude.png" alt="" />} motion={motionFor('claude-code')} />
220
+ ))}
221
+ </AgentConversation>
222
+ ```
223
+
224
+ Every time shown is the difference between two observed moments: a call's duration needs its start
225
+ and its result to have been seen, the turn's clock counts from the send, and tokens appear only from
226
+ the response's own `usage`. `turnFromHistory` (a session's turns feed), `turnFromResponse` (a stored
227
+ response) and `turnFromMessage` (a `ChatMessages` blocks message, optionally timed by a clock turn)
228
+ build the same Turn from what a host already holds. `describeTool(name, args)` reads every harness's
229
+ tool vocabulary (Claude Code, Codex, Gemini CLI, Hermes, Goose, OpenCode, OpenHands, pi, Kimi …)
230
+ into a kind, a target, lines added and removed, and the plan. The package ships the motions, never
231
+ the logos: pass your mark as a node and `motionFor(base)` names a motion, or none for three dots.
232
+ All motion stops under `prefers-reduced-motion`.
233
+
195
234
  ## Slides
196
235
 
197
236
  A deck is JSON — a fixed 1920×1080 stage, and elements with absolute frames and stable ids. That