@heigin/ui 0.1.0 → 0.2.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +25 -1
  2. package/dist/components/crm/agent-decision-tree.d.ts +82 -0
  3. package/dist/components/crm/agent-decision-tree.js +580 -0
  4. package/dist/components/crm/agent-decision-tree.module.js +113 -0
  5. package/dist/components/crm/agent-task-trail.d.ts +56 -0
  6. package/dist/components/crm/agent-task-trail.js +419 -0
  7. package/dist/components/crm/agent-thinking.d.ts +36 -0
  8. package/dist/components/crm/agent-thinking.js +443 -0
  9. package/dist/components/crm/agent-thinking.module.js +33 -0
  10. package/dist/components/crm/agent.module.js +81 -0
  11. package/dist/components/crm/crm.module.js +44 -4
  12. package/dist/components/crm/record-header.d.ts +2 -2
  13. package/dist/components/crm/workspace-switcher.d.ts +49 -0
  14. package/dist/components/crm/workspace-switcher.js +205 -0
  15. package/dist/components/ui/avatar.d.ts +9 -1
  16. package/dist/components/ui/avatar.js +61 -4
  17. package/dist/components/ui/avatar.module.js +4 -2
  18. package/dist/components/ui/breadcrumb.d.ts +10 -0
  19. package/dist/components/ui/breadcrumb.js +48 -0
  20. package/dist/components/ui/breadcrumb.module.js +19 -0
  21. package/dist/components/ui/heigin-mark.d.ts +11 -0
  22. package/dist/components/ui/heigin-mark.js +41 -0
  23. package/dist/components/ui/loader.d.ts +21 -0
  24. package/dist/components/ui/loader.js +45 -0
  25. package/dist/components/ui/pagination.d.ts +1 -2
  26. package/dist/components/ui/pagination.js +0 -1
  27. package/dist/components/ui/table.d.ts +9 -1
  28. package/dist/components/ui/table.js +136 -89
  29. package/dist/components/ui/table.module.js +13 -1
  30. package/dist/components/ui/thinking-orb.d.ts +27 -0
  31. package/dist/components/ui/thinking-orb.js +27 -0
  32. package/dist/components/ui/type-motion.d.ts +31 -0
  33. package/dist/components/ui/type-motion.js +394 -0
  34. package/dist/components/ui/type-motion.module.js +31 -0
  35. package/dist/index.d.ts +9 -0
  36. package/dist/index.js +10 -1
  37. package/dist/styles.css +1733 -8
  38. package/dist/tokens.css +1 -1
  39. package/dist/tokens.d.ts +2 -2
  40. package/dist/tokens.js +7 -6
  41. package/package.json +3 -2
@@ -0,0 +1,56 @@
1
+ import * as React from "react";
2
+ import { type LoaderVariant } from "../ui/loader.js";
3
+ export type AgentStepStatus = "done" | "active" | "pending" | "approval" | "waiting" | "declined";
4
+ export interface AgentSubstep {
5
+ label: React.ReactNode;
6
+ /** Right-aligned detail: a file, a diff count, a progress figure. */
7
+ meta?: React.ReactNode;
8
+ }
9
+ export interface AgentStepApproval {
10
+ /** What will happen if approved, in one or two sentences. */
11
+ description: React.ReactNode;
12
+ approveLabel?: string;
13
+ declineLabel?: string;
14
+ }
15
+ export interface AgentStep {
16
+ id: string;
17
+ label: string;
18
+ /** The service the step works in (a 12px mark). */
19
+ icon?: React.ReactNode;
20
+ /**
21
+ * `done`, `active` (running now), `pending` (not started), `approval` (will need a person),
22
+ * `waiting` (needs a person now) or `declined`.
23
+ */
24
+ status: AgentStepStatus;
25
+ /** What the agent is doing while the step is active, e.g. "Editing". */
26
+ activity?: string;
27
+ /** Elapsed seconds, or the final duration once done. */
28
+ seconds?: number;
29
+ /** When the active step started (ms since epoch). The timer then ticks on its own. */
30
+ startedAt?: number;
31
+ substeps?: AgentSubstep[];
32
+ /** Required when status is `approval` or `waiting`. */
33
+ approval?: AgentStepApproval;
34
+ }
35
+ export interface AgentTaskTrailProps {
36
+ title: string;
37
+ /** Who is working. Defaults to the HeiGin agent. */
38
+ agent?: {
39
+ name: string;
40
+ icon?: React.ReactNode;
41
+ };
42
+ steps: AgentStep[];
43
+ /** Indicator on the running step: the thinking orb (default) or a spinner. */
44
+ loader?: LoaderVariant;
45
+ /** Steps whose sub-steps start open. The running step is always open. */
46
+ defaultOpen?: string[];
47
+ /** Return a Promise to show a loading Approve button; a rejection keeps the step waiting and says so. */
48
+ onApprove?: (step: AgentStep) => void | Promise<void>;
49
+ onDecline?: (step: AgentStep) => void;
50
+ className?: string;
51
+ }
52
+ /**
53
+ * A live timeline of an agent working through a task: each step with its service, status and
54
+ * time, sub-steps on a branching rail, and an approval gate for steps that need a person.
55
+ */
56
+ export declare function AgentTaskTrail({ title, agent, steps, loader, defaultOpen, onApprove, onDecline, className, }: AgentTaskTrailProps): React.JSX.Element;
@@ -0,0 +1,419 @@
1
+ "use client";
2
+ "use client";
3
+ import { cn } from "../../lib/cn.js";
4
+ import { Button } from "../ui/button.js";
5
+ import { Loader } from "../ui/loader.js";
6
+ import { HeiGinMark } from "../ui/heigin-mark.js";
7
+ import { VisuallyHidden } from "../ui/visually-hidden.js";
8
+ import agent_module_default from "./agent.module.js";
9
+ import * as React from "react";
10
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
+ import { ChevronRight, ChevronUp } from "lucide-react";
12
+ //#region src/components/crm/agent-task-trail.tsx
13
+ var formatSeconds = (s) => s < 1 ? "<1s" : s < 60 ? `${Math.floor(s)}s` : `${Math.floor(s / 60)}m ${Math.floor(s % 60)}s`;
14
+ var STATUS_TEXT = {
15
+ done: "done",
16
+ active: "in progress",
17
+ pending: "not started",
18
+ approval: "will need your approval",
19
+ waiting: "needs your approval",
20
+ declined: "declined"
21
+ };
22
+ /** Wall-clock ms, ticking once a second while enabled. `null` until mounted, so SSR output is stable. */
23
+ function useNow(enabled) {
24
+ const [now, setNow] = React.useState(null);
25
+ React.useEffect(() => {
26
+ if (!enabled) return;
27
+ setNow(Date.now());
28
+ const id = window.setInterval(() => setNow(Date.now()), 1e3);
29
+ return () => window.clearInterval(id);
30
+ }, [enabled]);
31
+ return now;
32
+ }
33
+ function Node({ status, loader }) {
34
+ if (status === "active") return loader === "orb" ? /* @__PURE__ */ jsx(Loader, {
35
+ variant: "orb",
36
+ size: "sm",
37
+ orbState: "working",
38
+ label: null
39
+ }) : /* @__PURE__ */ jsx(Loader, {
40
+ variant: "spinner",
41
+ size: "sm",
42
+ label: null,
43
+ className: agent_module_default.nodeSpinner
44
+ });
45
+ if (status === "done") return /* @__PURE__ */ jsxs("svg", {
46
+ viewBox: "0 0 18 18",
47
+ className: agent_module_default.nodeDone,
48
+ "aria-hidden": "true",
49
+ children: [/* @__PURE__ */ jsx("circle", {
50
+ cx: "9",
51
+ cy: "9",
52
+ r: "9"
53
+ }), /* @__PURE__ */ jsx("path", { d: "M5.6 9.3l2.2 2.1 4.6-4.7" })]
54
+ });
55
+ if (status === "waiting") return /* @__PURE__ */ jsxs("svg", {
56
+ viewBox: "0 0 18 18",
57
+ className: agent_module_default.nodeWaiting,
58
+ "aria-hidden": "true",
59
+ children: [
60
+ /* @__PURE__ */ jsx("circle", {
61
+ cx: "9",
62
+ cy: "9",
63
+ r: "9"
64
+ }),
65
+ /* @__PURE__ */ jsx("rect", {
66
+ x: "6.2",
67
+ y: "5.6",
68
+ width: "1.9",
69
+ height: "6.8",
70
+ rx: ".6"
71
+ }),
72
+ /* @__PURE__ */ jsx("rect", {
73
+ x: "9.9",
74
+ y: "5.6",
75
+ width: "1.9",
76
+ height: "6.8",
77
+ rx: ".6"
78
+ })
79
+ ]
80
+ });
81
+ if (status === "declined") return /* @__PURE__ */ jsxs("svg", {
82
+ viewBox: "0 0 18 18",
83
+ className: agent_module_default.nodeDeclined,
84
+ "aria-hidden": "true",
85
+ children: [/* @__PURE__ */ jsx("circle", {
86
+ cx: "9",
87
+ cy: "9",
88
+ r: "9"
89
+ }), /* @__PURE__ */ jsx("path", { d: "M6.4 6.4l5.2 5.2M11.6 6.4l-5.2 5.2" })]
90
+ });
91
+ return /* @__PURE__ */ jsx("svg", {
92
+ viewBox: "0 0 18 18",
93
+ className: status === "approval" ? agent_module_default.nodeApproval : agent_module_default.nodePending,
94
+ "aria-hidden": "true",
95
+ children: /* @__PURE__ */ jsx("circle", {
96
+ cx: "9",
97
+ cy: "9",
98
+ r: "7.5"
99
+ })
100
+ });
101
+ }
102
+ /**
103
+ * A live timeline of an agent working through a task: each step with its service, status and
104
+ * time, sub-steps on a branching rail, and an approval gate for steps that need a person.
105
+ */
106
+ function AgentTaskTrail({ title, agent = { name: "HeiGin Agent" }, steps, loader = "orb", defaultOpen = [], onApprove, onDecline, className }) {
107
+ const headingId = React.useId();
108
+ const listRef = React.useRef(null);
109
+ const railRef = React.useRef(null);
110
+ const [open, setOpen] = React.useState(() => new Set(defaultOpen));
111
+ const [touched, setTouched] = React.useState(() => /* @__PURE__ */ new Set());
112
+ const [askHidden, setAskHidden] = React.useState(false);
113
+ const [pending, setPending] = React.useState(null);
114
+ const prev = React.useRef(/* @__PURE__ */ new Map());
115
+ const now = useNow(steps.some((s) => s.status === "active" && s.startedAt));
116
+ React.useEffect(() => {
117
+ setOpen((current) => {
118
+ let next = current;
119
+ for (const s of steps) {
120
+ const before = prev.current.get(s.id);
121
+ if (s.status === "active" && !next.has(s.id)) next = new Set(next).add(s.id);
122
+ if (before === "active" && s.status !== "active" && next.has(s.id) && !touched.has(s.id)) {
123
+ next = new Set(next);
124
+ next.delete(s.id);
125
+ }
126
+ }
127
+ return next;
128
+ });
129
+ for (const s of steps) prev.current.set(s.id, s.status);
130
+ }, [steps, touched]);
131
+ const doneCount = steps.filter((s) => s.status === "done").length;
132
+ const active = steps.find((s) => s.status === "active");
133
+ const waiting = steps.find((s) => s.status === "waiting");
134
+ const drawRail = React.useCallback(() => {
135
+ const list = listRef.current;
136
+ const svg = railRef.current;
137
+ if (!list || !svg) return;
138
+ const box = list.getBoundingClientRect();
139
+ const items = Array.from(list.querySelectorAll(":scope > ol > li"));
140
+ const pts = items.map((li) => {
141
+ const r = li.querySelector("[data-node]").getBoundingClientRect();
142
+ return {
143
+ top: r.top - box.top + 1,
144
+ bottom: r.bottom - box.top - 1,
145
+ x: r.left - box.left + r.width / 2
146
+ };
147
+ });
148
+ const SX = (pts[0]?.x ?? 10) + 13;
149
+ let on = "";
150
+ let off = "";
151
+ let dots = "";
152
+ items.forEach((li, i) => {
153
+ const p = pts[i];
154
+ const n = pts[i + 1];
155
+ if (!p) return;
156
+ const status = li.dataset.status;
157
+ const flowing = status === "done" || status === "active";
158
+ const wrap = li.querySelector("[data-subs]");
159
+ const wrapBox = wrap?.getBoundingClientRect();
160
+ const rows = wrap ? Array.from(wrap.querySelectorAll("[data-sub]")).map((r) => {
161
+ const b = r.getBoundingClientRect();
162
+ return b.top - box.top + b.height / 2;
163
+ }).filter((y) => wrapBox && y < wrapBox.bottom - box.top - 2) : [];
164
+ const first = rows[0];
165
+ const last = rows[rows.length - 1];
166
+ if (first !== void 0 && last !== void 0 && wrapBox && wrapBox.height > 6) {
167
+ const endY = n ? n.top - 1 : last + 8;
168
+ const into = `M${p.x} ${p.bottom + 2} C ${p.x} ${p.bottom + 10}, ${SX} ${first - 12}, ${SX} ${first - 4} L ${SX} ${last}`;
169
+ const rest = n ? `M${SX} ${last} C ${SX} ${last + 10}, ${p.x} ${endY - 12}, ${p.x} ${endY}` : "";
170
+ if (flowing) {
171
+ on += into;
172
+ if (status === "done") on += rest;
173
+ else off += rest;
174
+ } else off += into + rest;
175
+ rows.forEach((y, k) => {
176
+ const current = status === "active" && k === rows.length - 1;
177
+ dots += current ? `<circle class="${agent_module_default.dotRing}" cx="${SX}" cy="${y}" r="5"/><circle class="${agent_module_default.dotCurrent}" cx="${SX}" cy="${y}" r="2.6"/>` : `<circle class="${agent_module_default.dotDone}" cx="${SX}" cy="${y}" r="2.4"/>`;
178
+ });
179
+ } else if (n) {
180
+ const seg = `M${p.x} ${p.bottom + 2} L ${n.x} ${n.top - 1}`;
181
+ const next = items[i + 1]?.dataset.status;
182
+ if (status === "done" && next !== "pending" && next !== "approval") on += seg;
183
+ else off += seg;
184
+ }
185
+ });
186
+ svg.innerHTML = `<path class="${agent_module_default.railOff}" d="${off}"/><path class="${agent_module_default.railOn}" d="${on}"/>${dots}`;
187
+ }, []);
188
+ React.useLayoutEffect(() => {
189
+ let raf = 0;
190
+ const until = performance.now() + 650;
191
+ const loop = () => {
192
+ drawRail();
193
+ if (performance.now() < until) raf = requestAnimationFrame(loop);
194
+ };
195
+ loop();
196
+ return () => cancelAnimationFrame(raf);
197
+ }, [
198
+ drawRail,
199
+ steps,
200
+ open,
201
+ askHidden
202
+ ]);
203
+ React.useEffect(() => {
204
+ const list = listRef.current;
205
+ if (!list || typeof ResizeObserver === "undefined") return;
206
+ const ro = new ResizeObserver(() => drawRail());
207
+ ro.observe(list);
208
+ return () => ro.disconnect();
209
+ }, [drawRail]);
210
+ const toggle = (id) => {
211
+ setTouched((t) => new Set(t).add(id));
212
+ setOpen((o) => {
213
+ const next = new Set(o);
214
+ if (next.has(id)) next.delete(id);
215
+ else next.add(id);
216
+ return next;
217
+ });
218
+ };
219
+ const [failed, setFailed] = React.useState(null);
220
+ const approve = async (step) => {
221
+ setPending(step.id);
222
+ setFailed(null);
223
+ try {
224
+ await onApprove?.(step);
225
+ } catch {
226
+ setFailed(step.id);
227
+ } finally {
228
+ setPending(null);
229
+ }
230
+ };
231
+ const liveText = waiting ? `${waiting.label}: needs your approval` : active ? `${active.label}${active.activity ? `: ${active.activity}` : ""}` : doneCount === steps.length ? `${title}: all steps done` : "";
232
+ return /* @__PURE__ */ jsxs("section", {
233
+ className: cn(agent_module_default.trail, className),
234
+ "aria-labelledby": headingId,
235
+ children: [
236
+ /* @__PURE__ */ jsxs("header", {
237
+ className: agent_module_default.trailHead,
238
+ children: [
239
+ /* @__PURE__ */ jsx("h3", {
240
+ id: headingId,
241
+ className: agent_module_default.trailTitle,
242
+ children: title
243
+ }),
244
+ /* @__PURE__ */ jsxs("span", {
245
+ className: agent_module_default.agentChip,
246
+ children: [agent.icon ?? /* @__PURE__ */ jsx(HeiGinMark, { size: 14 }), agent.name]
247
+ }),
248
+ /* @__PURE__ */ jsxs("span", {
249
+ className: agent_module_default.count,
250
+ children: [
251
+ /* @__PURE__ */ jsx(VisuallyHidden, { children: "Steps done: " }),
252
+ doneCount,
253
+ "/",
254
+ steps.length
255
+ ]
256
+ })
257
+ ]
258
+ }),
259
+ /* @__PURE__ */ jsxs("div", {
260
+ ref: listRef,
261
+ className: agent_module_default.steps,
262
+ children: [/* @__PURE__ */ jsx("svg", {
263
+ ref: railRef,
264
+ className: agent_module_default.rail,
265
+ "aria-hidden": "true"
266
+ }), /* @__PURE__ */ jsx("ol", {
267
+ className: agent_module_default.stepList,
268
+ children: steps.map((step) => {
269
+ const subs = step.substeps ?? [];
270
+ const isOpen = (open.has(step.id) || step.status === "active") && subs.length > 0;
271
+ const expandable = step.status === "done" && subs.length > 0;
272
+ const seconds = step.status === "active" && step.startedAt && now !== null ? Math.max(0, (now - step.startedAt) / 1e3) : step.seconds;
273
+ const subsId = `${headingId}-${step.id}-subs`;
274
+ const rowInner = /* @__PURE__ */ jsxs(Fragment, { children: [
275
+ /* @__PURE__ */ jsx("span", {
276
+ className: agent_module_default.node,
277
+ "data-node": true,
278
+ children: /* @__PURE__ */ jsx(Node, {
279
+ status: step.status,
280
+ loader
281
+ })
282
+ }),
283
+ /* @__PURE__ */ jsx("span", {
284
+ className: agent_module_default.icon,
285
+ "aria-hidden": "true",
286
+ children: step.icon
287
+ }),
288
+ /* @__PURE__ */ jsxs("span", {
289
+ className: agent_module_default.label,
290
+ children: [
291
+ /* @__PURE__ */ jsx("span", { children: step.label }),
292
+ /* @__PURE__ */ jsxs(VisuallyHidden, { children: [", ", STATUS_TEXT[step.status]] }),
293
+ expandable && /* @__PURE__ */ jsx(ChevronRight, {
294
+ className: agent_module_default.chev,
295
+ strokeWidth: 1.6,
296
+ "aria-hidden": "true"
297
+ })
298
+ ]
299
+ }),
300
+ /* @__PURE__ */ jsxs("span", {
301
+ className: agent_module_default.end,
302
+ children: [
303
+ step.status === "active" && step.activity && /* @__PURE__ */ jsx("span", {
304
+ className: agent_module_default.activity,
305
+ "data-changed": "true",
306
+ children: step.activity
307
+ }, step.activity),
308
+ (step.status === "active" || step.status === "done") && seconds !== void 0 && /* @__PURE__ */ jsx("span", {
309
+ className: agent_module_default.time,
310
+ children: formatSeconds(seconds)
311
+ }),
312
+ step.status === "approval" && /* @__PURE__ */ jsx("span", {
313
+ className: agent_module_default.badge,
314
+ children: "Approval"
315
+ }),
316
+ step.status === "declined" && /* @__PURE__ */ jsx("span", {
317
+ className: agent_module_default.declinedText,
318
+ children: "Declined"
319
+ })
320
+ ]
321
+ })
322
+ ] });
323
+ return /* @__PURE__ */ jsxs("li", {
324
+ "data-status": step.status,
325
+ "data-open": isOpen,
326
+ children: [
327
+ expandable ? /* @__PURE__ */ jsx("button", {
328
+ type: "button",
329
+ className: agent_module_default.row,
330
+ "aria-expanded": isOpen,
331
+ "aria-controls": subsId,
332
+ onClick: () => toggle(step.id),
333
+ children: rowInner
334
+ }) : /* @__PURE__ */ jsxs("div", {
335
+ className: agent_module_default.row,
336
+ children: [rowInner, step.status === "waiting" && /* @__PURE__ */ jsxs("button", {
337
+ type: "button",
338
+ className: cn(agent_module_default.badge),
339
+ style: {
340
+ gridColumn: 4,
341
+ gridRow: 1
342
+ },
343
+ "aria-expanded": !askHidden,
344
+ "aria-controls": `${subsId}-ask`,
345
+ onClick: () => setAskHidden((h) => !h),
346
+ children: ["Needs you ", /* @__PURE__ */ jsx(ChevronUp, {
347
+ strokeWidth: 2,
348
+ "aria-hidden": "true"
349
+ })]
350
+ })]
351
+ }),
352
+ subs.length > 0 && /* @__PURE__ */ jsx("div", {
353
+ className: agent_module_default.collapse,
354
+ "data-open": isOpen,
355
+ "data-subs": true,
356
+ id: subsId,
357
+ children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("ul", {
358
+ className: agent_module_default.subs,
359
+ "aria-label": `${step.label} details`,
360
+ children: subs.map((sub, k) => /* @__PURE__ */ jsxs("li", {
361
+ className: agent_module_default.sub,
362
+ "data-sub": true,
363
+ "data-current": step.status === "active" && k === subs.length - 1,
364
+ children: [/* @__PURE__ */ jsx("span", { children: sub.label }), sub.meta !== void 0 && /* @__PURE__ */ jsx("span", {
365
+ className: agent_module_default.subMeta,
366
+ children: sub.meta
367
+ })]
368
+ }, k))
369
+ }) })
370
+ }),
371
+ step.status === "waiting" && step.approval && /* @__PURE__ */ jsx("div", {
372
+ className: agent_module_default.collapse,
373
+ "data-open": !askHidden,
374
+ id: `${subsId}-ask`,
375
+ children: /* @__PURE__ */ jsxs("div", { children: [
376
+ /* @__PURE__ */ jsx("p", {
377
+ className: agent_module_default.ask,
378
+ children: step.approval.description
379
+ }),
380
+ failed === step.id && /* @__PURE__ */ jsx("p", {
381
+ className: agent_module_default.askFailed,
382
+ role: "alert",
383
+ children: "That didn’t go through. Try approving again."
384
+ }),
385
+ /* @__PURE__ */ jsxs("div", {
386
+ className: agent_module_default.askActions,
387
+ children: [/* @__PURE__ */ jsx(Button, {
388
+ variant: "ghost",
389
+ size: "sm",
390
+ touch: false,
391
+ disabled: pending === step.id,
392
+ onClick: () => onDecline?.(step),
393
+ children: step.approval.declineLabel ?? "Decline"
394
+ }), /* @__PURE__ */ jsx(Button, {
395
+ variant: "secondary",
396
+ size: "sm",
397
+ touch: false,
398
+ loading: pending === step.id,
399
+ onClick: () => approve(step),
400
+ children: step.approval.approveLabel ?? "Approve"
401
+ })]
402
+ })
403
+ ] })
404
+ })
405
+ ]
406
+ }, step.id);
407
+ })
408
+ })]
409
+ }),
410
+ /* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx("span", {
411
+ role: "status",
412
+ "aria-live": "polite",
413
+ children: liveText
414
+ }) })
415
+ ]
416
+ });
417
+ }
418
+ //#endregion
419
+ export { AgentTaskTrail };
@@ -0,0 +1,36 @@
1
+ import * as React from "react";
2
+ import { type LoaderVariant } from "../ui/loader.js";
3
+ /** Silhouettes the dotted visual can take while a step runs. */
4
+ export type ThinkingShape = "tree" | "lens" | "globe" | "cube" | "ring";
5
+ export interface ThinkingStep {
6
+ id: string;
7
+ label: React.ReactNode;
8
+ /** The shape the visual morphs into when this step starts. Steps without one keep the last shape. */
9
+ shape?: ThinkingShape;
10
+ }
11
+ export interface AgentThinkingProps {
12
+ /** The request being worked on, shown above the thinking. */
13
+ prompt?: React.ReactNode;
14
+ /** What the agent has done so far, oldest first. The newest line is the current one. */
15
+ steps: ThinkingStep[];
16
+ status: "thinking" | "done";
17
+ /** When thinking started (ms since epoch). The timer then ticks on its own. */
18
+ startedAt?: number;
19
+ /** Elapsed or total seconds, when you track time yourself. */
20
+ seconds?: number;
21
+ /** Indicator beside "Thinking": the thinking orb (default) or a spinner. */
22
+ loader?: LoaderVariant;
23
+ /** Draw the dithered dot visual beside the steps. Default true. */
24
+ visual?: boolean;
25
+ /** Shows a stop button while thinking. */
26
+ onStop?: () => void;
27
+ /** The answer, shown once status is `done`. */
28
+ children?: React.ReactNode;
29
+ className?: string;
30
+ }
31
+ /**
32
+ * Shows an agent thinking: a timer with the thinking orb (or a spinner), each step as it happens,
33
+ * and a dithered dot visual that reshapes per step. When done, the steps fold into "Thought for Ns"
34
+ * and the answer takes their place.
35
+ */
36
+ export declare function AgentThinking({ prompt, steps, status, startedAt, seconds, loader, visual, onStop, children, className, }: AgentThinkingProps): React.JSX.Element;