reifyui 0.16.1 → 0.18.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.
@@ -65,10 +65,18 @@ export interface ToolDescription {
65
65
  diff: { added: number; removed: number } | null;
66
66
  todos: TodoEntry[] | null;
67
67
  }
68
- export function describeTool(name: string, args: unknown): ToolDescription;
68
+ /** The element a browser call acts on, as a page snapshot named its ref. */
69
+ export interface BrowserElement { role: string; name: string }
70
+ /** `opts.element`: for a browser call, the element its ref names (from browserElements). */
71
+ export function describeTool(name: string, args: unknown, opts?: { element?: BrowserElement | null }): ToolDescription;
69
72
  export function toolKind(name: string): ToolKind;
70
73
  export function toolLine(d: ToolDescription, state: 'running' | 'done'): string;
71
- export function summarizeCalls(calls: { name: string; args?: unknown }[]): string;
74
+ export function summarizeCalls(calls: { name: string; args?: unknown; element?: BrowserElement | null }[]): string;
75
+ /** The action a browser tool's name carries ("click" for mcp__plugs__browser_click), '' when the action
76
+ * is an argument (`browser`, `computer`), null when the tool is not a browser's. */
77
+ export function browserActOf(name: string): string | null;
78
+ /** {[call id]: element} for the browser calls whose ref an earlier snapshot in the same turn named. */
79
+ export function browserElements(items: TurnItem[] | null | undefined): Record<string, BrowserElement>;
72
80
  export function resultNote(kind: ToolKind, output: unknown): string;
73
81
  export function parseToolArgs(args: unknown): Record<string, unknown>;
74
82
  export function todosOf(args: Record<string, unknown>): TodoEntry[] | null;
@@ -110,10 +118,14 @@ export function WorkingIndicator(props: MarkProps & {
110
118
  export function CopyButton(props: { text: string; labels?: AgentLabels; label?: string }): ReactElement;
111
119
  export function DiffBadge(props: { diff: { added: number; removed: number } | null }): ReactElement | null;
112
120
  export function LinesBlock(props: { lines: { text: string; cls?: string }[]; limit?: number; labels?: AgentLabels; className?: string; numbered?: boolean }): ReactElement;
113
- export function StepRow(props: { item: ToolItem; labels?: AgentLabels; defaultOpen?: boolean }): ReactElement;
121
+ /** A call the host shows in a place of its own: a handler for the calls it opens (a browser step opens
122
+ * the browser beside the conversation), null for the rest, which unfold to their input and output. */
123
+ export type OpenStep = (item: ToolItem, d: ToolDescription) => (() => void) | null | undefined;
124
+ export function StepRow(props: { item: ToolItem; labels?: AgentLabels; defaultOpen?: boolean; element?: BrowserElement | null;
125
+ openStep?: OpenStep; active?: boolean }): ReactElement;
114
126
  export function ThinkingRow(props: { item: ThinkingItem; labels?: AgentLabels }): ReactElement;
115
127
  export function WorkGroup(props: MarkProps & { items: (ToolItem | ThinkingItem)[]; live?: boolean; liveLabel?: string; start?: number | null;
116
- labels?: AgentLabels; defaultOpen?: boolean }): ReactElement | null;
128
+ labels?: AgentLabels; defaultOpen?: boolean; elements?: Record<string, BrowserElement> | null; openStep?: OpenStep; activeStep?: string | null }): ReactElement | null;
117
129
  export function TodoCard(props: { todos: TodoEntry[] | null; labels?: AgentLabels; running?: boolean }): ReactElement | null;
118
130
  export function StreamingText(props: { text: string; active?: boolean; render?: (text: string) => ReactNode }): ReactElement;
119
131
  export function UserBubble(props: { user: TurnUser | null; renderFile?: (f: { name: string; src?: string }, i: number) => ReactNode; extra?: ReactNode }): ReactElement | null;
@@ -136,6 +148,10 @@ export interface AgentTurnViewProps extends MarkProps {
136
148
  describeIncomplete?: (i: { reason?: string; detail?: string }) => string;
137
149
  /** the epoch ms the live clock counts from, when it is not the turn's own startedAt */
138
150
  liveStart?: number | null;
151
+ /** calls the host opens in a place of its own (a browser step opens the browser), instead of unfolding */
152
+ openStep?: OpenStep;
153
+ /** the id of the call the host is showing now: its row stays marked */
154
+ activeStep?: string | null;
139
155
  }
140
156
  export function AgentTurnView(props: AgentTurnViewProps): ReactElement | null;
141
157
 
@@ -189,7 +205,15 @@ export interface AgentConversationProps extends MarkProps {
189
205
  }
190
206
  export function AgentConversation(props: AgentConversationProps): ReactElement;
191
207
 
192
- export interface ArtifactFile { key: string; name: string; url: string }
208
+ export interface ArtifactFile {
209
+ key: string; name: string; url: string;
210
+ /** where it sits in the workspace (files are grouped by its folder) */
211
+ path?: string;
212
+ /** bytes, when known */
213
+ size?: number;
214
+ /** the turn that made it (1-based), when known */
215
+ turn?: number;
216
+ }
193
217
  export interface ArtifactPanelProps {
194
218
  files: ArtifactFile[];
195
219
  /** the key of the file shown (default: the first) */
@@ -199,6 +223,8 @@ export interface ArtifactPanelProps {
199
223
  /** a drawer over the page from the right (a narrow screen) instead of a docked column */
200
224
  overlay?: boolean;
201
225
  label?: string;
226
+ /** the words for "made in turn n" in the file list (default "Turn n") */
227
+ turnLabel?: (n: number) => string;
202
228
  fetchFile?: (url: string) => Promise<Response>;
203
229
  renderMarkdown?: (text: string) => ReactNode;
204
230
  officePdfUrl?: (url: string) => string;
@@ -207,6 +233,13 @@ export interface ArtifactPanelProps {
207
233
  className?: string;
208
234
  }
209
235
  export function ArtifactPanel(props: ArtifactPanelProps): ReactElement | null;
236
+ /** The preview header's file name as a dropdown of every file (ArtifactPanel uses it). */
237
+ export function FileSwitcher(props: { files: Omit<ArtifactFile, 'url'>[]; current: string; onSelect?: (key: string) => void; label?: string;
238
+ turnLabel?: (n: number) => string }): ReactElement | null;
239
+ /** "epsilla-enterprise-subscr…store-v2.png": the start and the end of a long name. */
240
+ export function middleEllipsis(name: string, max?: number): string;
241
+ /** A name truncated in the middle at whatever width it is given: the end always shows. */
242
+ export function MidName(props: { name: string; className?: string }): ReactElement;
210
243
  export interface FileCardProps {
211
244
  name: string; origin?: string; bytes?: number;
212
245
  onPreview?: () => void; onDownload?: () => void;
@@ -223,4 +256,6 @@ export function FilePreview(props: {
223
256
  file: { url: string; name: string } | null; onClose?: () => void; fetchFile?: (url: string) => Promise<Response>;
224
257
  officePdfUrl?: (url: string) => string; renderMarkdown?: (text: string) => ReactNode;
225
258
  parseWorkbook?: ArtifactPanelProps['parseWorkbook']; onDownload?: (url: string, name: string) => void; title?: string; before?: ReactNode;
259
+ /** a control in the name's place in the header row (a file switcher) */
260
+ nameSlot?: ReactNode;
226
261
  }): ReactElement;
@@ -19,6 +19,9 @@ import {
19
19
  WorkingIndicator,
20
20
  WorkingMark,
21
21
  baseNameOf,
22
+ browserActOf,
23
+ browserElements,
24
+ bytesLabel,
22
25
  commandText,
23
26
  describeTool,
24
27
  diffOf,
@@ -47,7 +50,7 @@ import {
47
50
  useElapsed,
48
51
  useNow,
49
52
  useStickToBottom
50
- } from "./chunk-UP3CNKZR.js";
53
+ } from "./chunk-Y2MBOXQC.js";
51
54
  import "./chunk-QCISEB67.js";
52
55
  import "./chunk-PZ5AY32C.js";
53
56
 
@@ -109,8 +112,210 @@ function motionFor(base) {
109
112
  }
110
113
 
111
114
  // src/agent-chat/artifacts.jsx
112
- import React, { useEffect, useRef } from "react";
115
+ import React, { useEffect, useMemo, useRef, useState } from "react";
113
116
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
117
+ var FILTER_AT = 8;
118
+ function middleEllipsis(name, max = 40) {
119
+ const s = String(name || "");
120
+ if (s.length <= max) return s;
121
+ const tail = Math.min(Math.max(10, Math.floor(max * 0.45)), max - 4);
122
+ return `${s.slice(0, max - tail - 1)}\u2026${s.slice(-tail)}`;
123
+ }
124
+ function MidName(props) {
125
+ const { name, className } = props;
126
+ const s = String(name || "");
127
+ const cut = s.length > 16 ? s.length - Math.min(14, Math.floor(s.length / 2)) : s.length;
128
+ return /* @__PURE__ */ jsxs("span", { className: "uac-mid" + (className ? ` ${className}` : ""), children: [
129
+ /* @__PURE__ */ jsx("span", { className: "uac-mid-h", children: s.slice(0, cut) }),
130
+ cut < s.length ? /* @__PURE__ */ jsx("span", { className: "uac-mid-t", children: s.slice(cut) }) : null
131
+ ] });
132
+ }
133
+ function dirOf(path) {
134
+ const p = String(path || "");
135
+ const i = p.lastIndexOf("/");
136
+ return i > 0 ? p.slice(0, i) : "";
137
+ }
138
+ function Check() {
139
+ return /* @__PURE__ */ jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.4", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M5 12l5 5L20 7" }) });
140
+ }
141
+ function FileSwitcher(props) {
142
+ const { files, current, onSelect, label = "Files in this conversation", turnLabel = (n) => `Turn ${n}` } = props;
143
+ const [open, setOpen] = useState(false);
144
+ const [q, setQ] = useState("");
145
+ const [hi, setHi] = useState(0);
146
+ const root = useRef(null);
147
+ const list = useRef(null);
148
+ const input = useRef(null);
149
+ const btn = useRef(null);
150
+ const id = useRef(`uac-fs-${Math.random().toString(36).slice(2, 9)}`).current;
151
+ const cur = files.find((f) => f.key === current) || files[0];
152
+ const needle = q.trim().toLowerCase();
153
+ const shown = useMemo(() => files.filter((f) => !needle || String(f.path || f.name).toLowerCase().includes(needle)), [files, needle]);
154
+ const groups = useMemo(() => {
155
+ const by = /* @__PURE__ */ new Map();
156
+ for (const f of shown) {
157
+ const d = dirOf(f.path);
158
+ if (!by.has(d)) by.set(d, []);
159
+ by.get(d).push(f);
160
+ }
161
+ return [...by.entries()].sort((a, b) => a[0] === "" ? -1 : b[0] === "" ? 1 : 0);
162
+ }, [shown]);
163
+ const flat = groups.flatMap(([, fs]) => fs);
164
+ const grouped = groups.length > 1 || groups.length === 1 && groups[0][0] !== "";
165
+ const many = files.length > FILTER_AT;
166
+ useEffect(() => {
167
+ if (!open) return void 0;
168
+ setHi(Math.max(0, flat.findIndex((f) => f.key === (cur && cur.key))));
169
+ const t = setTimeout(() => {
170
+ if (many && input.current) input.current.focus();
171
+ else if (list.current) list.current.focus();
172
+ }, 0);
173
+ const away = (e) => {
174
+ if (root.current && !root.current.contains(e.target)) setOpen(false);
175
+ };
176
+ document.addEventListener("mousedown", away);
177
+ document.addEventListener("touchstart", away);
178
+ return () => {
179
+ clearTimeout(t);
180
+ document.removeEventListener("mousedown", away);
181
+ document.removeEventListener("touchstart", away);
182
+ };
183
+ }, [open]);
184
+ useEffect(() => {
185
+ setHi(0);
186
+ }, [needle]);
187
+ useEffect(() => {
188
+ if (!open || !list.current) return;
189
+ const el = list.current.querySelector(`[data-i="${hi}"]`);
190
+ if (el && el.scrollIntoView) el.scrollIntoView({ block: "nearest" });
191
+ }, [hi, open]);
192
+ if (!cur) return null;
193
+ const pick = (f) => {
194
+ setOpen(false);
195
+ setQ("");
196
+ if (f && onSelect) onSelect(f.key);
197
+ if (btn.current) btn.current.focus();
198
+ };
199
+ const keys = (e) => {
200
+ if (e.key === "ArrowDown") {
201
+ e.preventDefault();
202
+ setHi((i2) => Math.min(flat.length - 1, i2 + 1));
203
+ } else if (e.key === "ArrowUp") {
204
+ e.preventDefault();
205
+ setHi((i2) => Math.max(0, i2 - 1));
206
+ } else if (e.key === "Home") {
207
+ e.preventDefault();
208
+ setHi(0);
209
+ } else if (e.key === "End") {
210
+ e.preventDefault();
211
+ setHi(flat.length - 1);
212
+ } else if (e.key === "Enter") {
213
+ e.preventDefault();
214
+ pick(flat[hi]);
215
+ } else if (e.key === "Escape") {
216
+ e.preventDefault();
217
+ e.stopPropagation();
218
+ setOpen(false);
219
+ if (btn.current) btn.current.focus();
220
+ } else if (e.key === "Tab") setOpen(false);
221
+ };
222
+ const single = files.length < 2;
223
+ let i = -1;
224
+ return /* @__PURE__ */ jsxs("div", { ref: root, className: "uac-fs" + (open ? " is-open" : ""), children: [
225
+ /* @__PURE__ */ jsxs(
226
+ "button",
227
+ {
228
+ ref: btn,
229
+ type: "button",
230
+ className: "uac-fs-btn",
231
+ title: cur.path || cur.name,
232
+ disabled: single,
233
+ "aria-haspopup": single ? void 0 : "listbox",
234
+ "aria-expanded": single ? void 0 : open,
235
+ "aria-controls": single ? void 0 : id,
236
+ onClick: () => setOpen((v) => !v),
237
+ onKeyDown: (e) => {
238
+ if (!single && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
239
+ e.preventDefault();
240
+ setOpen(true);
241
+ }
242
+ },
243
+ children: [
244
+ /* @__PURE__ */ jsx(MidName, { name: cur.name, className: "uac-fs-name" }),
245
+ single ? null : /* @__PURE__ */ jsx("svg", { className: "uac-fs-chev", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M6 9l6 6 6-6" }) })
246
+ ]
247
+ }
248
+ ),
249
+ open ? /* @__PURE__ */ jsxs(Fragment, { children: [
250
+ /* @__PURE__ */ jsx("div", { className: "uac-fs-scrim", "aria-hidden": "true", onClick: () => setOpen(false) }),
251
+ /* @__PURE__ */ jsxs("div", { className: "uac-fs-pop", onKeyDown: keys, children: [
252
+ /* @__PURE__ */ jsxs("div", { className: "uac-fs-head", children: [
253
+ /* @__PURE__ */ jsx("span", { children: label }),
254
+ /* @__PURE__ */ jsx("span", { className: "uac-fs-count", children: files.length })
255
+ ] }),
256
+ many ? /* @__PURE__ */ jsx(
257
+ "input",
258
+ {
259
+ ref: input,
260
+ className: "uac-fs-q",
261
+ type: "search",
262
+ placeholder: "Find a file",
263
+ value: q,
264
+ autoComplete: "off",
265
+ spellCheck: false,
266
+ "aria-label": "Find a file",
267
+ "aria-controls": id,
268
+ onChange: (e) => setQ(e.target.value)
269
+ }
270
+ ) : null,
271
+ /* @__PURE__ */ jsxs(
272
+ "div",
273
+ {
274
+ ref: list,
275
+ id,
276
+ className: "uac-fs-list",
277
+ role: "listbox",
278
+ tabIndex: -1,
279
+ "aria-label": label,
280
+ "aria-activedescendant": flat[hi] ? `${id}-${hi}` : void 0,
281
+ children: [
282
+ groups.map(([dir, fs]) => /* @__PURE__ */ jsxs("div", { role: "group", "aria-label": dir || "Top level", children: [
283
+ grouped ? /* @__PURE__ */ jsx("div", { className: "uac-fs-dir", "aria-hidden": "true", children: dir || "Top level" }) : null,
284
+ fs.map((f) => {
285
+ i += 1;
286
+ const n = i;
287
+ const on = f.key === cur.key;
288
+ const meta = [f.size != null ? bytesLabel(f.size) : "", f.turn != null ? turnLabel(f.turn) : ""].filter(Boolean).join(" \xB7 ");
289
+ return /* @__PURE__ */ jsxs(
290
+ "div",
291
+ {
292
+ id: `${id}-${n}`,
293
+ "data-i": n,
294
+ role: "option",
295
+ "aria-selected": on,
296
+ className: "uac-fs-opt" + (on ? " is-on" : "") + (n === hi ? " is-hi" : ""),
297
+ title: f.path || f.name,
298
+ onMouseEnter: () => setHi(n),
299
+ onClick: () => pick(f),
300
+ children: [
301
+ /* @__PURE__ */ jsx(FileTypeIcon, { name: f.name, size: 16 }),
302
+ /* @__PURE__ */ jsx(MidName, { name: f.name, className: "uac-fs-on" }),
303
+ meta ? /* @__PURE__ */ jsx("span", { className: "uac-fs-meta", children: meta }) : null,
304
+ /* @__PURE__ */ jsx("span", { className: "uac-fs-ck", children: on ? /* @__PURE__ */ jsx(Check, {}) : null })
305
+ ]
306
+ },
307
+ f.key
308
+ );
309
+ })
310
+ ] }, dir || ".")),
311
+ !flat.length ? /* @__PURE__ */ jsx("div", { className: "uac-fs-none", children: "No file matches." }) : null
312
+ ]
313
+ }
314
+ )
315
+ ] })
316
+ ] }) : null
317
+ ] });
318
+ }
114
319
  function ArtifactPanel(props) {
115
320
  const {
116
321
  files = [],
@@ -119,6 +324,7 @@ function ArtifactPanel(props) {
119
324
  onClose,
120
325
  overlay = false,
121
326
  label = "Files in this conversation",
327
+ turnLabel,
122
328
  fetchFile,
123
329
  renderMarkdown,
124
330
  officePdfUrl,
@@ -136,7 +342,7 @@ function ArtifactPanel(props) {
136
342
  if (b) b.focus();
137
343
  }, 0);
138
344
  const key = (e) => {
139
- if (e.key === "Escape") {
345
+ if (e.key === "Escape" && !e.defaultPrevented) {
140
346
  e.stopPropagation();
141
347
  onClose && onClose();
142
348
  }
@@ -149,21 +355,7 @@ function ArtifactPanel(props) {
149
355
  };
150
356
  }, [overlay, !!cur]);
151
357
  if (!cur) return null;
152
- const switcher = files.length > 1 ? /* @__PURE__ */ jsx("nav", { className: "uac-art-files", "aria-label": label, children: files.map((f) => /* @__PURE__ */ jsxs(
153
- "button",
154
- {
155
- type: "button",
156
- className: "uac-art-file" + (f.key === cur.key ? " is-on" : ""),
157
- "aria-current": f.key === cur.key ? "true" : void 0,
158
- title: f.name,
159
- onClick: () => onSelect && onSelect(f.key),
160
- children: [
161
- /* @__PURE__ */ jsx(FileTypeIcon, { name: f.name, size: 14 }),
162
- /* @__PURE__ */ jsx("span", { children: f.name })
163
- ]
164
- },
165
- f.key
166
- )) }) : null;
358
+ const switcher = /* @__PURE__ */ jsx(FileSwitcher, { files, current: cur.key, onSelect, label, turnLabel });
167
359
  return /* @__PURE__ */ jsxs(Fragment, { children: [
168
360
  overlay ? /* @__PURE__ */ jsx("div", { className: "uac-art-scrim", "aria-hidden": "true", onClick: () => onClose && onClose() }) : null,
169
361
  /* @__PURE__ */ jsx(
@@ -179,7 +371,7 @@ function ArtifactPanel(props) {
179
371
  {
180
372
  file: { url: cur.url, name: cur.name },
181
373
  onClose,
182
- before: switcher,
374
+ nameSlot: switcher,
183
375
  fetchFile,
184
376
  renderMarkdown,
185
377
  officePdfUrl,
@@ -202,9 +394,11 @@ export {
202
394
  DiffBadge,
203
395
  FileCard,
204
396
  FilePreview,
397
+ FileSwitcher,
205
398
  LinesBlock,
206
399
  MARK_MOTIONS,
207
400
  MOTIONS,
401
+ MidName,
208
402
  StepRow,
209
403
  StreamingText,
210
404
  ThinkingRow,
@@ -215,6 +409,8 @@ export {
215
409
  WorkingIndicator,
216
410
  WorkingMark,
217
411
  baseNameOf,
412
+ browserActOf,
413
+ browserElements,
218
414
  commandText,
219
415
  describeTool,
220
416
  diffOf,
@@ -226,6 +422,7 @@ export {
226
422
  latestPlan,
227
423
  lineCount,
228
424
  liveState,
425
+ middleEllipsis,
229
426
  motionFor,
230
427
  newTurn,
231
428
  parseToolArgs,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/agent-chat/marks.js","../src/agent-chat/artifacts.jsx"],"sourcesContent":["// The working mark: each harness's own logo, moving the way that logo suggests.\n//\n// The package ships the MOTIONS (CSS keyframes in styles/agent-chat.css), never the logos: a\n// host passes its official mark as a node and names a motion. motionFor(base) is the house\n// choice for the harnesses we know, picked by looking at each mark:\n//\n// bloom the Claude starburst turns a quarter and breathes, like the CLI's ✻ ✽ ✶ spinner\n// sheen a light passes across the tile (Codex's prompt, Kimi's K, Kilo's grid)\n// glint brightens and swells, a spark catching light (Gemini)\n// flutter a quick wing beat, tilt and lift (Hermes, the messenger)\n// glide a bird's lift and settle (Goose)\n// blink the tile blinks shut and open, a terminal cursor (OpenCode)\n// flip a coin turning on its vertical axis (pi, omp)\n// swim a short wave from nose to tail (DeepSeek's whale)\n// spin a steady revolution, for round marks (Qwen, Grok, System One, OpenSquilla)\n// wave hands waving from the wrist (OpenHands)\n// dash a sprint forward and back (CheetahClaws)\n// scuttle a sideways skitter (ZeroClaw's crab)\n// equalize a level meter rising and falling (MiniMax's waveform)\n// bob a soft hop (robots and app tiles: Cline, Agent Zero, Qoder, nanobot)\n// pulse the default: scale and opacity breathing\n//\n// Every motion stops under prefers-reduced-motion; the mark then stands still and the line's\n// words alone say the work is going on.\n\nexport const MARK_MOTIONS = {\n 'claude-code': 'bloom', claude: 'bloom', anthropic: 'bloom',\n codex: 'sheen', openai: 'sheen',\n gemini: 'glint', 'gemini-cli': 'glint',\n hermes: 'flutter',\n goose: 'glide',\n opencode: 'blink',\n pi: 'flip', omp: 'flip',\n dsh: 'swim', deepseek: 'swim',\n qwen: 'spin', grok: 'spin', systemone: 'spin', opensquilla: 'spin',\n openhands: 'wave',\n cheetahclaws: 'dash',\n zeroclaw: 'scuttle',\n minimax: 'equalize',\n cline: 'bob', agentzero: 'bob', qoder: 'bob', nanobot: 'bob',\n kimi: 'sheen', kilo: 'sheen', jcode: 'pulse', mimo: 'pulse', aider: 'pulse',\n};\n\nexport const MOTIONS = ['bloom', 'sheen', 'glint', 'flutter', 'glide', 'blink', 'flip', 'swim', 'spin', 'wave',\n 'dash', 'scuttle', 'equalize', 'bob', 'pulse', 'dots'];\n\n/** The motion for a base harness id, 'pulse' for one we do not know. */\nexport function motionFor(base) {\n const k = String(base || '').toLowerCase().trim();\n return MARK_MOTIONS[k] || 'pulse';\n}\n","// The files a turn produced, opened beside the conversation instead of printed into it.\n//\n// In the conversation a file is a card (the package's FileCard: its kind, Copy, Download, and the\n// whole card opens it). Opened, it shows here: the file rendered (Markdown as a document, code\n// highlighted, images, PDFs, sheets), a switcher across every file the conversation made, Copy,\n// Download and Close. Docked, it is a column the host places beside the chat; `overlay` makes it a\n// drawer over the page from the right, which is what a narrow screen gets.\n//\n// Transport and rendering stay the host's, exactly as for FilePreview: `fetchFile` (with the\n// host's auth), `renderMarkdown`, `officePdfUrl`, `parseWorkbook`, `onDownload`.\nimport React, { useEffect, useRef } from 'react';\nimport { FilePreview } from '../components/FilePreview.jsx';\nimport { FileTypeIcon } from '../components/FileTypeIcon.jsx';\n\n/**\n * files: [{ key, name, url }] (key: stable id, e.g. the file id); active: the key shown.\n */\nexport function ArtifactPanel(props) {\n const {\n files = [], active, onSelect, onClose, overlay = false, label = 'Files in this conversation',\n fetchFile, renderMarkdown, officePdfUrl, parseWorkbook, onDownload, className,\n } = props;\n const ref = useRef(null);\n const cur = files.find((f) => f.key === active) || files[0] || null;\n // a drawer takes the focus and gives it back with Escape, like any dialog\n useEffect(() => {\n if (!overlay || !cur) return undefined;\n const back = document.activeElement;\n const t = setTimeout(() => { const b = ref.current && ref.current.querySelector('button'); if (b) b.focus(); }, 0);\n const key = (e) => { if (e.key === 'Escape') { e.stopPropagation(); onClose && onClose(); } };\n document.addEventListener('keydown', key);\n return () => { clearTimeout(t); document.removeEventListener('keydown', key); if (back && back.focus) back.focus(); };\n }, [overlay, !!cur]); // eslint-disable-line react-hooks/exhaustive-deps\n if (!cur) return null;\n const switcher = files.length > 1 ? (\n <nav className=\"uac-art-files\" aria-label={label}>\n {files.map((f) => (\n <button key={f.key} type=\"button\" className={'uac-art-file' + (f.key === cur.key ? ' is-on' : '')}\n aria-current={f.key === cur.key ? 'true' : undefined} title={f.name} onClick={() => onSelect && onSelect(f.key)}>\n <FileTypeIcon name={f.name} size={14} /><span>{f.name}</span>\n </button>\n ))}\n </nav>\n ) : null;\n return (\n <>\n {overlay ? <div className=\"uac-art-scrim\" aria-hidden=\"true\" onClick={() => onClose && onClose()} /> : null}\n <div ref={ref} className={'uac-art' + (overlay ? ' is-overlay' : '') + (className ? ` ${className}` : '')}\n role={overlay ? 'dialog' : undefined} aria-modal={overlay ? 'true' : undefined} aria-label={overlay ? `Preview of ${cur.name}` : undefined}>\n <FilePreview key={cur.key} file={{ url: cur.url, name: cur.name }} onClose={onClose} before={switcher}\n fetchFile={fetchFile} renderMarkdown={renderMarkdown} officePdfUrl={officePdfUrl} parseWorkbook={parseWorkbook} onDownload={onDownload} />\n </div>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBO,IAAM,eAAe;AAAA,EAC1B,eAAe;AAAA,EAAS,QAAQ;AAAA,EAAS,WAAW;AAAA,EACpD,OAAO;AAAA,EAAS,QAAQ;AAAA,EACxB,QAAQ;AAAA,EAAS,cAAc;AAAA,EAC/B,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU;AAAA,EACV,IAAI;AAAA,EAAQ,KAAK;AAAA,EACjB,KAAK;AAAA,EAAQ,UAAU;AAAA,EACvB,MAAM;AAAA,EAAQ,MAAM;AAAA,EAAQ,WAAW;AAAA,EAAQ,aAAa;AAAA,EAC5D,WAAW;AAAA,EACX,cAAc;AAAA,EACd,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EAAO,WAAW;AAAA,EAAO,OAAO;AAAA,EAAO,SAAS;AAAA,EACvD,MAAM;AAAA,EAAS,MAAM;AAAA,EAAS,OAAO;AAAA,EAAS,MAAM;AAAA,EAAS,OAAO;AACtE;AAEO,IAAM,UAAU;AAAA,EAAC;AAAA,EAAS;AAAA,EAAS;AAAA,EAAS;AAAA,EAAW;AAAA,EAAS;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAQ;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W,MAAM,SAAS,IAC9B,oBAAC,SAAI,WAAU,iBAAgB,cAAY,OACxC,gBAAM,IAAI,CAAC,MACV;AAAA,IAAC;AAAA;AAAA,MAAmB,MAAK;AAAA,MAAS,WAAW,kBAAkB,EAAE,QAAQ,IAAI,MAAM,WAAW;AAAA,MAC5F,gBAAc,EAAE,QAAQ,IAAI,MAAM,SAAS;AAAA,MAAW,OAAO,EAAE;AAAA,MAAM,SAAS,MAAM,YAAY,SAAS,EAAE,GAAG;AAAA,MAC9G;AAAA,4BAAC,gBAAa,MAAM,EAAE,MAAM,MAAM,IAAI;AAAA,QAAE,oBAAC,UAAM,YAAE,MAAK;AAAA;AAAA;AAAA,IAF3C,EAAE;AAAA,EAGf,CACD,GACH,IACE;AACJ,SACE,iCACG;AAAA,cAAU,oBAAC,SAAI,WAAU,iBAAgB,eAAY,QAAO,SAAS,MAAM,WAAW,QAAQ,GAAG,IAAK;AAAA,IACvG;AAAA,MAAC;AAAA;AAAA,QAAI;AAAA,QAAU,WAAW,aAAa,UAAU,gBAAgB,OAAO,YAAY,IAAI,SAAS,KAAK;AAAA,QACpG,MAAM,UAAU,WAAW;AAAA,QAAW,cAAY,UAAU,SAAS;AAAA,QAAW,cAAY,UAAU,cAAc,IAAI,IAAI,KAAK;AAAA,QACjI;AAAA,UAAC;AAAA;AAAA,YAA0B,MAAM,EAAE,KAAK,IAAI,KAAK,MAAM,IAAI,KAAK;AAAA,YAAG;AAAA,YAAkB,QAAQ;AAAA,YAC3F;AAAA,YAAsB;AAAA,YAAgC;AAAA,YAA4B;AAAA,YAA8B;AAAA;AAAA,UADhG,IAAI;AAAA,QACoH;AAAA;AAAA,IAC5I;AAAA,KACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../src/agent-chat/marks.js","../src/agent-chat/artifacts.jsx"],"sourcesContent":["// The working mark: each harness's own logo, moving the way that logo suggests.\n//\n// The package ships the MOTIONS (CSS keyframes in styles/agent-chat.css), never the logos: a\n// host passes its official mark as a node and names a motion. motionFor(base) is the house\n// choice for the harnesses we know, picked by looking at each mark:\n//\n// bloom the Claude starburst turns a quarter and breathes, like the CLI's ✻ ✽ ✶ spinner\n// sheen a light passes across the tile (Codex's prompt, Kimi's K, Kilo's grid)\n// glint brightens and swells, a spark catching light (Gemini)\n// flutter a quick wing beat, tilt and lift (Hermes, the messenger)\n// glide a bird's lift and settle (Goose)\n// blink the tile blinks shut and open, a terminal cursor (OpenCode)\n// flip a coin turning on its vertical axis (pi, omp)\n// swim a short wave from nose to tail (DeepSeek's whale)\n// spin a steady revolution, for round marks (Qwen, Grok, System One, OpenSquilla)\n// wave hands waving from the wrist (OpenHands)\n// dash a sprint forward and back (CheetahClaws)\n// scuttle a sideways skitter (ZeroClaw's crab)\n// equalize a level meter rising and falling (MiniMax's waveform)\n// bob a soft hop (robots and app tiles: Cline, Agent Zero, Qoder, nanobot)\n// pulse the default: scale and opacity breathing\n//\n// Every motion stops under prefers-reduced-motion; the mark then stands still and the line's\n// words alone say the work is going on.\n\nexport const MARK_MOTIONS = {\n 'claude-code': 'bloom', claude: 'bloom', anthropic: 'bloom',\n codex: 'sheen', openai: 'sheen',\n gemini: 'glint', 'gemini-cli': 'glint',\n hermes: 'flutter',\n goose: 'glide',\n opencode: 'blink',\n pi: 'flip', omp: 'flip',\n dsh: 'swim', deepseek: 'swim',\n qwen: 'spin', grok: 'spin', systemone: 'spin', opensquilla: 'spin',\n openhands: 'wave',\n cheetahclaws: 'dash',\n zeroclaw: 'scuttle',\n minimax: 'equalize',\n cline: 'bob', agentzero: 'bob', qoder: 'bob', nanobot: 'bob',\n kimi: 'sheen', kilo: 'sheen', jcode: 'pulse', mimo: 'pulse', aider: 'pulse',\n};\n\nexport const MOTIONS = ['bloom', 'sheen', 'glint', 'flutter', 'glide', 'blink', 'flip', 'swim', 'spin', 'wave',\n 'dash', 'scuttle', 'equalize', 'bob', 'pulse', 'dots'];\n\n/** The motion for a base harness id, 'pulse' for one we do not know. */\nexport function motionFor(base) {\n const k = String(base || '').toLowerCase().trim();\n return MARK_MOTIONS[k] || 'pulse';\n}\n","// The files a turn produced, opened beside the conversation instead of printed into it.\n//\n// In the conversation a file is a card (the package's FileCard: its kind, Copy, Download, and the\n// whole card opens it). Opened, it shows here, under ONE header row: the file's kind, its name as a\n// switcher (a dropdown of every file of the conversation, grouped by folder, filterable when there are\n// many, keyboard driven), then Copy, Download and Close. Below, the file rendered (Markdown as a\n// document, code highlighted, images, PDFs, sheets). Docked, it is a column the host places beside the\n// chat; `overlay` makes it a drawer over the page from the right, and on a phone the dropdown is a\n// sheet from the bottom.\n//\n// Transport and rendering stay the host's, exactly as for FilePreview: `fetchFile` (with the\n// host's auth), `renderMarkdown`, `officePdfUrl`, `parseWorkbook`, `onDownload`.\nimport React, { useEffect, useMemo, useRef, useState } from 'react';\nimport { FilePreview } from '../components/FilePreview.jsx';\nimport { FileTypeIcon } from '../components/FileTypeIcon.jsx';\nimport { bytesLabel } from '../format.js';\n\nconst FILTER_AT = 8; // more files than this, and the list opens with a filter box\n\n/** \"epsilla-enterprise-subscr…store-v2.png\": the start and the end, which is where names differ. */\nexport function middleEllipsis(name, max = 40) {\n const s = String(name || '');\n if (s.length <= max) return s;\n const tail = Math.min(Math.max(10, Math.floor(max * 0.45)), max - 4);\n return `${s.slice(0, max - tail - 1)}…${s.slice(-tail)}`;\n}\n\n/** A name that truncates in the MIDDLE at whatever width it gets: the start shrinks with an ellipsis,\n * the end (where similar names differ: \"-v2\", the extension) always shows. */\nexport function MidName(props) {\n const { name, className } = props;\n const s = String(name || '');\n const cut = s.length > 16 ? s.length - Math.min(14, Math.floor(s.length / 2)) : s.length;\n return (\n <span className={'uac-mid' + (className ? ` ${className}` : '')}>\n <span className=\"uac-mid-h\">{s.slice(0, cut)}</span>{cut < s.length ? <span className=\"uac-mid-t\">{s.slice(cut)}</span> : null}\n </span>\n );\n}\n\nfunction dirOf(path) {\n const p = String(path || '');\n const i = p.lastIndexOf('/');\n return i > 0 ? p.slice(0, i) : '';\n}\n\nfunction Check() {\n return (\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M5 12l5 5L20 7\" />\n </svg>\n );\n}\n\n/** The name in the header, as a dropdown of every file. `files`: [{key, name, path?, size?, turn?}]. */\nexport function FileSwitcher(props) {\n const { files, current, onSelect, label = 'Files in this conversation', turnLabel = (n) => `Turn ${n}` } = props;\n const [open, setOpen] = useState(false);\n const [q, setQ] = useState('');\n const [hi, setHi] = useState(0);\n const root = useRef(null);\n const list = useRef(null);\n const input = useRef(null);\n const btn = useRef(null);\n const id = useRef(`uac-fs-${Math.random().toString(36).slice(2, 9)}`).current;\n const cur = files.find((f) => f.key === current) || files[0];\n const needle = q.trim().toLowerCase();\n const shown = useMemo(() => files.filter((f) => !needle || String(f.path || f.name).toLowerCase().includes(needle)), [files, needle]);\n // by folder, in the order folders first appear; the root (no folder) first\n const groups = useMemo(() => {\n const by = new Map();\n for (const f of shown) {\n const d = dirOf(f.path);\n if (!by.has(d)) by.set(d, []);\n by.get(d).push(f);\n }\n return [...by.entries()].sort((a, b) => (a[0] === '' ? -1 : b[0] === '' ? 1 : 0));\n }, [shown]);\n const flat = groups.flatMap(([, fs]) => fs);\n const grouped = groups.length > 1 || (groups.length === 1 && groups[0][0] !== '');\n const many = files.length > FILTER_AT;\n\n useEffect(() => {\n if (!open) return undefined;\n setHi(Math.max(0, flat.findIndex((f) => f.key === (cur && cur.key))));\n const t = setTimeout(() => { if (many && input.current) input.current.focus(); else if (list.current) list.current.focus(); }, 0);\n const away = (e) => { if (root.current && !root.current.contains(e.target)) setOpen(false); };\n document.addEventListener('mousedown', away);\n document.addEventListener('touchstart', away);\n return () => { clearTimeout(t); document.removeEventListener('mousedown', away); document.removeEventListener('touchstart', away); };\n }, [open]); // eslint-disable-line react-hooks/exhaustive-deps\n useEffect(() => { setHi(0); }, [needle]);\n useEffect(() => {\n if (!open || !list.current) return;\n const el = list.current.querySelector(`[data-i=\"${hi}\"]`);\n if (el && el.scrollIntoView) el.scrollIntoView({ block: 'nearest' });\n }, [hi, open]);\n\n if (!cur) return null;\n const pick = (f) => { setOpen(false); setQ(''); if (f && onSelect) onSelect(f.key); if (btn.current) btn.current.focus(); };\n const keys = (e) => {\n if (e.key === 'ArrowDown') { e.preventDefault(); setHi((i) => Math.min(flat.length - 1, i + 1)); }\n else if (e.key === 'ArrowUp') { e.preventDefault(); setHi((i) => Math.max(0, i - 1)); }\n else if (e.key === 'Home') { e.preventDefault(); setHi(0); }\n else if (e.key === 'End') { e.preventDefault(); setHi(flat.length - 1); }\n else if (e.key === 'Enter') { e.preventDefault(); pick(flat[hi]); }\n else if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); setOpen(false); if (btn.current) btn.current.focus(); }\n else if (e.key === 'Tab') setOpen(false);\n };\n const single = files.length < 2;\n let i = -1;\n return (\n <div ref={root} className={'uac-fs' + (open ? ' is-open' : '')}>\n <button ref={btn} type=\"button\" className=\"uac-fs-btn\" title={cur.path || cur.name} disabled={single}\n aria-haspopup={single ? undefined : 'listbox'} aria-expanded={single ? undefined : open} aria-controls={single ? undefined : id}\n onClick={() => setOpen((v) => !v)}\n onKeyDown={(e) => { if (!single && (e.key === 'ArrowDown' || e.key === 'ArrowUp')) { e.preventDefault(); setOpen(true); } }}>\n <MidName name={cur.name} className=\"uac-fs-name\" />\n {single ? null : (\n <svg className=\"uac-fs-chev\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"M6 9l6 6 6-6\" /></svg>\n )}\n </button>\n {open ? (\n <>\n <div className=\"uac-fs-scrim\" aria-hidden=\"true\" onClick={() => setOpen(false)} />\n <div className=\"uac-fs-pop\" onKeyDown={keys}>\n <div className=\"uac-fs-head\"><span>{label}</span><span className=\"uac-fs-count\">{files.length}</span></div>\n {many ? (\n <input ref={input} className=\"uac-fs-q\" type=\"search\" placeholder=\"Find a file\" value={q} autoComplete=\"off\" spellCheck={false}\n aria-label=\"Find a file\" aria-controls={id} onChange={(e) => setQ(e.target.value)} />\n ) : null}\n <div ref={list} id={id} className=\"uac-fs-list\" role=\"listbox\" tabIndex={-1} aria-label={label}\n aria-activedescendant={flat[hi] ? `${id}-${hi}` : undefined}>\n {groups.map(([dir, fs]) => (\n <div key={dir || '.'} role=\"group\" aria-label={dir || 'Top level'}>\n {grouped ? <div className=\"uac-fs-dir\" aria-hidden=\"true\">{dir || 'Top level'}</div> : null}\n {fs.map((f) => {\n i += 1;\n const n = i;\n const on = f.key === cur.key;\n const meta = [f.size != null ? bytesLabel(f.size) : '', f.turn != null ? turnLabel(f.turn) : ''].filter(Boolean).join(' · ');\n return (\n <div key={f.key} id={`${id}-${n}`} data-i={n} role=\"option\" aria-selected={on}\n className={'uac-fs-opt' + (on ? ' is-on' : '') + (n === hi ? ' is-hi' : '')}\n title={f.path || f.name} onMouseEnter={() => setHi(n)} onClick={() => pick(f)}>\n <FileTypeIcon name={f.name} size={16} />\n <MidName name={f.name} className=\"uac-fs-on\" />\n {meta ? <span className=\"uac-fs-meta\">{meta}</span> : null}\n <span className=\"uac-fs-ck\">{on ? <Check /> : null}</span>\n </div>\n );\n })}\n </div>\n ))}\n {!flat.length ? <div className=\"uac-fs-none\">No file matches.</div> : null}\n </div>\n </div>\n </>\n ) : null}\n </div>\n );\n}\n\n/**\n * files: [{ key, name, url, path?, size?, turn? }] (key: stable id, e.g. the file id; path: where it\n * sits in the workspace, for folders; size in bytes and the turn that made it, when known).\n */\nexport function ArtifactPanel(props) {\n const {\n files = [], active, onSelect, onClose, overlay = false, label = 'Files in this conversation', turnLabel,\n fetchFile, renderMarkdown, officePdfUrl, parseWorkbook, onDownload, className,\n } = props;\n const ref = useRef(null);\n const cur = files.find((f) => f.key === active) || files[0] || null;\n // a drawer takes the focus and gives it back with Escape, like any dialog\n useEffect(() => {\n if (!overlay || !cur) return undefined;\n const back = document.activeElement;\n const t = setTimeout(() => { const b = ref.current && ref.current.querySelector('button'); if (b) b.focus(); }, 0);\n const key = (e) => { if (e.key === 'Escape' && !e.defaultPrevented) { e.stopPropagation(); onClose && onClose(); } };\n document.addEventListener('keydown', key);\n return () => { clearTimeout(t); document.removeEventListener('keydown', key); if (back && back.focus) back.focus(); };\n }, [overlay, !!cur]); // eslint-disable-line react-hooks/exhaustive-deps\n if (!cur) return null;\n const switcher = <FileSwitcher files={files} current={cur.key} onSelect={onSelect} label={label} turnLabel={turnLabel} />;\n return (\n <>\n {overlay ? <div className=\"uac-art-scrim\" aria-hidden=\"true\" onClick={() => onClose && onClose()} /> : null}\n <div ref={ref} className={'uac-art' + (overlay ? ' is-overlay' : '') + (className ? ` ${className}` : '')}\n role={overlay ? 'dialog' : undefined} aria-modal={overlay ? 'true' : undefined} aria-label={overlay ? `Preview of ${cur.name}` : undefined}>\n <FilePreview key={cur.key} file={{ url: cur.url, name: cur.name }} onClose={onClose} nameSlot={switcher}\n fetchFile={fetchFile} renderMarkdown={renderMarkdown} officePdfUrl={officePdfUrl} parseWorkbook={parseWorkbook} onDownload={onDownload} />\n </div>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBO,IAAM,eAAe;AAAA,EAC1B,eAAe;AAAA,EAAS,QAAQ;AAAA,EAAS,WAAW;AAAA,EACpD,OAAO;AAAA,EAAS,QAAQ;AAAA,EACxB,QAAQ;AAAA,EAAS,cAAc;AAAA,EAC/B,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU;AAAA,EACV,IAAI;AAAA,EAAQ,KAAK;AAAA,EACjB,KAAK;AAAA,EAAQ,UAAU;AAAA,EACvB,MAAM;AAAA,EAAQ,MAAM;AAAA,EAAQ,WAAW;AAAA,EAAQ,aAAa;AA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