@actioneer/ads 0.5.3 → 0.5.5

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 (95) hide show
  1. package/components/accordion.js +15 -15
  2. package/components/agent-icon.d.ts +64 -0
  3. package/components/agent-icon.js +251 -0
  4. package/components/ai-elements/agent-trace.d.ts +8 -1
  5. package/components/ai-elements/agent-trace.js +164 -129
  6. package/components/ai-elements/chain-of-thought-icon.d.ts +42 -0
  7. package/components/ai-elements/chain-of-thought-icon.js +283 -0
  8. package/components/ai-elements/chain-of-thought.js +7 -7
  9. package/components/ai-elements/chart.js +38 -35
  10. package/components/ai-elements/index.d.ts +1 -0
  11. package/components/ai-elements/inline-citation.js +40 -40
  12. package/components/ai-elements/message.js +5 -5
  13. package/components/ai-elements/queue.js +1 -1
  14. package/components/ai-elements/research-activity.d.ts +2 -0
  15. package/components/ai-elements/research-activity.js +79 -81
  16. package/components/ai-elements/task-progress.js +2 -2
  17. package/components/ai-elements/tool.d.ts +4 -2
  18. package/components/ai-elements/tool.js +74 -54
  19. package/components/ai-elements/transcript.js +1 -1
  20. package/components/alert.js +1 -1
  21. package/components/answer.d.ts +2643 -311
  22. package/components/answer.js +1836 -425
  23. package/components/assistant-ui/answer-tool-ui.js +23 -28
  24. package/components/assistant-ui/chain-of-thought.d.ts +7 -2
  25. package/components/assistant-ui/composer-harness.js +20 -16
  26. package/components/assistant-ui/reasoning.js +35 -31
  27. package/components/assistant-ui/tool-fallback.js +125 -122
  28. package/components/assistant-ui/tool-group.d.ts +3 -1
  29. package/components/assistant-ui/tool-group.js +48 -43
  30. package/components/audio-waveform.js +14 -14
  31. package/components/autocomplete.js +52 -48
  32. package/components/avatar.js +58 -44
  33. package/components/badge.js +3 -3
  34. package/components/brand-texture.js +1 -1
  35. package/components/breadcrumbs.d.ts +27 -1
  36. package/components/breadcrumbs.js +94 -42
  37. package/components/button.js +15 -15
  38. package/components/carousel.js +10 -10
  39. package/components/chart.d.ts +14 -0
  40. package/components/chart.js +747 -614
  41. package/components/chip.js +3 -3
  42. package/components/code-block.d.ts +39 -17
  43. package/components/code-block.js +153 -104
  44. package/components/command-palette.js +27 -25
  45. package/components/connector-card.js +2 -2
  46. package/components/dropdown.js +65 -61
  47. package/components/empty-state.js +15 -15
  48. package/components/field.js +23 -23
  49. package/components/index.d.ts +5 -0
  50. package/components/index.js +523 -470
  51. package/components/infinite-canvas.js +60 -60
  52. package/components/kbd.js +6 -6
  53. package/components/link.js +6 -6
  54. package/components/modal.js +22 -20
  55. package/components/page-header.js +1 -1
  56. package/components/pagination.js +22 -22
  57. package/components/pixel-blast-svg.js +1 -1
  58. package/components/pixel-icon.d.ts +31 -0
  59. package/components/pixel-icon.js +733 -0
  60. package/components/popover.js +46 -42
  61. package/components/ripple.d.ts +29 -0
  62. package/components/ripple.js +17 -0
  63. package/components/segmented.js +24 -23
  64. package/components/select.js +71 -67
  65. package/components/selection-action-bar.js +22 -22
  66. package/components/sidebar.d.ts +11 -3
  67. package/components/sidebar.js +161 -148
  68. package/components/stepper.d.ts +2 -0
  69. package/components/stepper.js +80 -43
  70. package/components/table.d.ts +7 -0
  71. package/components/table.js +223 -155
  72. package/components/tabs.d.ts +3 -1
  73. package/components/tabs.js +165 -144
  74. package/components/textarea.js +10 -8
  75. package/components/toast.js +48 -46
  76. package/components/tooltip.js +61 -59
  77. package/components/tree.js +44 -41
  78. package/components/typography.d.ts +1 -1
  79. package/components/typography.js +25 -25
  80. package/components/viz-charts.d.ts +62 -0
  81. package/components/viz-charts.js +408 -0
  82. package/fonts/aribau-grotesk-500.otf +0 -0
  83. package/fonts/aribau-grotesk-600.woff2 +0 -0
  84. package/fonts.css +6 -4
  85. package/lib/icons.d.ts +411 -402
  86. package/lib/icons.js +109 -107
  87. package/lib/viz-format.d.ts +25 -0
  88. package/lib/viz-format.js +40 -0
  89. package/llms.txt +111 -8
  90. package/manifest.json +1096 -58
  91. package/package.json +5 -5
  92. package/styles.css +226 -96
  93. package/theme.css +220 -92
  94. package/fonts/aribau-grotesk-400.otf +0 -0
  95. package/fonts/aribau-grotesk-700.otf +0 -0
@@ -1,24 +1,24 @@
1
1
  "use client";
2
2
  import { jsx as n, jsxs as h } from "react/jsx-runtime";
3
3
  import * as r from "react";
4
- import { ChevronDown as I } from "../lib/icons.js";
4
+ import { ChevronRight as A } from "../lib/icons.js";
5
5
  import { cn as c } from "../lib/cn.js";
6
6
  const b = r.createContext(
7
7
  null
8
8
  );
9
- function A(s) {
9
+ function N(s) {
10
10
  const e = r.useContext(b);
11
11
  if (!e)
12
12
  throw new Error(`<${s}> must be used within <Accordion>`);
13
13
  return e;
14
14
  }
15
- const N = r.forwardRef(
15
+ const w = r.forwardRef(
16
16
  ({ className: s, type: e = "single", defaultValue: t, children: u, ...f }, g) => {
17
17
  const d = r.useId(), [a, l] = r.useState(() => t === void 0 ? [] : Array.isArray(t) ? t : [t]), i = r.useCallback(
18
18
  (o) => {
19
19
  l((x) => {
20
20
  const p = x.includes(o);
21
- return e === "single" ? p ? [] : [o] : p ? x.filter((w) => w !== o) : [...x, o];
21
+ return e === "single" ? p ? [] : [o] : p ? x.filter((I) => I !== o) : [...x, o];
22
22
  });
23
23
  },
24
24
  [e]
@@ -37,9 +37,9 @@ const N = r.forwardRef(
37
37
  ) });
38
38
  }
39
39
  );
40
- N.displayName = "Accordion";
41
- const y = r.forwardRef(({ className: s, value: e, title: t, children: u, ...f }, g) => {
42
- const { openItems: d, toggle: a, baseId: l } = A("AccordionItem"), i = d.includes(e), m = `${l}-trigger-${e}`, o = `${l}-panel-${e}`;
40
+ w.displayName = "Accordion";
41
+ const C = r.forwardRef(({ className: s, value: e, title: t, children: u, ...f }, g) => {
42
+ const { openItems: d, toggle: a, baseId: l } = N("AccordionItem"), i = d.includes(e), m = `${l}-trigger-${e}`, o = `${l}-panel-${e}`;
43
43
  return /* @__PURE__ */ h("div", { ref: g, className: c(s), ...f, children: [
44
44
  /* @__PURE__ */ n("h3", { className: "flex", children: /* @__PURE__ */ h(
45
45
  "button",
@@ -50,22 +50,22 @@ const y = r.forwardRef(({ className: s, value: e, title: t, children: u, ...f },
50
50
  "aria-controls": o,
51
51
  onClick: () => a(e),
52
52
  className: c(
53
- "flex w-full items-center justify-between py-4 text-left font-medium",
53
+ "flex w-full items-center gap-2 py-4 text-left font-normal",
54
54
  "outline-none focus-visible:ring-3 focus-visible:ring-ring rounded-sm",
55
55
  "transition-colors hover:text-foreground"
56
56
  ),
57
57
  children: [
58
- t,
59
58
  /* @__PURE__ */ n(
60
- I,
59
+ A,
61
60
  {
62
61
  "aria-hidden": !0,
63
62
  className: c(
64
63
  "size-4 shrink-0 text-muted-foreground transition-transform duration-(--duration-normal) ease-out motion-reduce:transition-none",
65
- i && "rotate-180"
64
+ i && "rotate-90"
66
65
  )
67
66
  }
68
- )
67
+ ),
68
+ t
69
69
  ]
70
70
  }
71
71
  ) }),
@@ -84,8 +84,8 @@ const y = r.forwardRef(({ className: s, value: e, title: t, children: u, ...f },
84
84
  )
85
85
  ] });
86
86
  });
87
- y.displayName = "AccordionItem";
87
+ C.displayName = "AccordionItem";
88
88
  export {
89
- N as Accordion,
90
- y as AccordionItem
89
+ w as Accordion,
90
+ C as AccordionItem
91
91
  };
@@ -0,0 +1,64 @@
1
+ import * as React from "react";
2
+ /**
3
+ * AgentIcon — the "living agent" creative-icon family (the second special-icon
4
+ * tier alongside {@link PixelIcon}). 24 self-contained, dependency-free animated
5
+ * marks: a hatched tile field clipped to a silhouette, paired rectangular eyes,
6
+ * and four interaction states —
7
+ *
8
+ * • `default` — a slow breathing settle (idle, gently alive)
9
+ * • `thinking` — a cool focus scan crosses the shifting hatch as the eyes search
10
+ * • `acting` — a quick speaking size cadence (a.k.a. "speaking")
11
+ * • `sleep` — the silhouette floats, desaturates, and closes its eyes
12
+ *
13
+ * Left uncontrolled it is interactive: hover/focus → `thinking`, click → `acting`
14
+ * for 1.5s, then it settles. Pass `state` to drive it externally (an agent's live
15
+ * status), which turns the pointer interactions off unless `interactive` is set.
16
+ *
17
+ * These are EXPRESSIVE marks for unique moments (an agent avatar, a voice/thinking
18
+ * surface, an empty state) — not functional UI glyphs. For those use the Phosphor
19
+ * registry at `@/lib/icons` (principle 4). The whole thing is one SVG + injected
20
+ * CSS keyframes: no OGL/WebGL, no external dependency, safe in ADS and the product.
21
+ */
22
+ export type AgentIconName = "orb" | "heart" | "soft-square" | "hex" | "spark" | "clover-x" | "ripple" | "bloom" | "sun" | "pulse" | "triangle" | "quad-flower" | "hexagon" | "star" | "stack" | "butterfly" | "octagon" | "heart-drop" | "soft-scallop" | "arch" | "pentagon" | "diamond" | "leaf" | "dome";
23
+ export type AgentIconState = "default" | "thinking" | "acting" | "sleep";
24
+ interface AgentConfig {
25
+ id: AgentIconName;
26
+ name: string;
27
+ color: string;
28
+ eyeColor: string;
29
+ eyeY?: number;
30
+ shape: string;
31
+ }
32
+ /** The 24 agent forms. All eyes share the one ink tone (source override). */
33
+ export declare const AGENT_ICONS: readonly AgentConfig[];
34
+ /** Names in registry order (matches the source's 01–24 numbering). */
35
+ export declare const AGENT_ICON_NAMES: AgentIconName[];
36
+ export interface AgentIconProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
37
+ /** Which of the 24 agent forms to render. */
38
+ agent: AgentIconName;
39
+ /**
40
+ * Drive the state externally (an agent's live status). When set, pointer
41
+ * interactions are OFF unless `interactive` is also true.
42
+ */
43
+ state?: AgentIconState;
44
+ /**
45
+ * Force interactivity on/off. Defaults to interactive when `state` is
46
+ * uncontrolled, and static when `state` is provided.
47
+ */
48
+ interactive?: boolean;
49
+ /** Rendered size in px (square). Defaults to 40. */
50
+ size?: number;
51
+ /**
52
+ * Override the mark's base hue (any CSS hex). The five-tone hatch palette is
53
+ * re-derived from it, so the whole silhouette recolors. Defaults to the
54
+ * form's own registry color.
55
+ */
56
+ color?: string;
57
+ /**
58
+ * Eyes follow the cursor (the "Field Agent" greeter treatment). Tracks the
59
+ * pointer globally; disabled under reduced motion.
60
+ */
61
+ trackPointer?: boolean;
62
+ }
63
+ export declare const AgentIcon: React.ForwardRefExoticComponent<AgentIconProps & React.RefAttributes<HTMLSpanElement>>;
64
+ export {};
@@ -0,0 +1,251 @@
1
+ "use client";
2
+ import { jsx as H } from "react/jsx-runtime";
3
+ import * as i from "react";
4
+ import { cn as G } from "../lib/cn.js";
5
+ function x(e, t, g, l = -Math.PI / 2) {
6
+ const c = [], n = e * 2;
7
+ for (let o = 0; o < n; o += 1) {
8
+ const f = o % 2 === 0 ? t : g, m = l + Math.PI * o / e;
9
+ c.push(
10
+ `${(18 + Math.cos(m) * f).toFixed(2)},${(18 + Math.sin(m) * f).toFixed(2)}`
11
+ );
12
+ }
13
+ return c.join(" ");
14
+ }
15
+ function u(e, t, g) {
16
+ const l = (n, o) => Number.parseInt(n.slice(1), 16) >> o & 255, c = (n) => Math.round(l(e, n) + (l(t, n) - l(e, n)) * g);
17
+ return `#${[16, 8, 0].map((n) => c(n).toString(16).padStart(2, "0")).join("")}`;
18
+ }
19
+ function V(e) {
20
+ return [
21
+ u(e, "#16213f", 0.2),
22
+ u(e, "#ffffff", 0.04),
23
+ u(e, "#ffffff", 0.16),
24
+ u(e, "#ffffff", 0.3),
25
+ u(e, "#233055", 0.1)
26
+ ];
27
+ }
28
+ const X = [
29
+ { spacing: 2.15, strokeWidth: 1.38, phase: 0 },
30
+ { spacing: 2.65, strokeWidth: 1.72, phase: 0.38 },
31
+ { spacing: 3.1, strokeWidth: 1.78, phase: 0.72 },
32
+ { spacing: 3.65, strokeWidth: 2.2, phase: 1.06 }
33
+ ];
34
+ function W(e, t) {
35
+ const g = V(e.color), l = u(e.color, "#4fe6ff", 0.58), c = 7, n = 36 / c, o = 0.18, f = [...e.id].reduce((s, a) => s + a.charCodeAt(0), 0), m = g.flatMap(
36
+ (s, a) => X.map(
37
+ (d, y) => `
38
+ <pattern id="${t}-hatch-${a}-${y}" width="${d.spacing}" height="${d.spacing}" patternUnits="userSpaceOnUse" patternTransform="rotate(45) translate(${d.phase} 0)">
39
+ <rect width="${d.strokeWidth}" height="${d.spacing}" fill="${s}" />
40
+ </pattern>`
41
+ )
42
+ ).join(""), h = [];
43
+ for (let s = 0; s < c; s += 1)
44
+ for (let a = 0; a < c; a += 1) {
45
+ const d = (a * 3 + s * 5 + f) % g.length, y = (a + s * 2 + f) % X.length, b = Math.hypot(a - 3, s - 3) / Math.hypot(3, 3), k = Math.round(b * 620);
46
+ h.push(
47
+ `<rect class="agent-avatar__tile" x="${(a * n + o).toFixed(3)}" y="${(s * n + o).toFixed(3)}" width="${(n - o * 2).toFixed(3)}" height="${(n - o * 2).toFixed(3)}" rx="0.18" fill="url(#${t}-hatch-${d}-${y})" style="--agent-tile-delay: ${k}ms" />`
48
+ );
49
+ }
50
+ return `
51
+ <defs>
52
+ <clipPath id="${t}-shape" clipPathUnits="userSpaceOnUse">${e.shape}</clipPath>
53
+ ${m}
54
+ <pattern id="${t}-focus-hatch" width="2.3" height="2.3" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
55
+ <rect width="1.46" height="2.3" fill="${l}" />
56
+ </pattern>
57
+ </defs>
58
+ <g class="agent-avatar__field" clip-path="url(#${t}-shape)">${h.join("")}</g>
59
+ <rect class="agent-avatar__focus-scan" x="-8" y="1" width="7" height="34" rx="3.5" fill="url(#${t}-focus-hatch)" clip-path="url(#${t}-shape)" aria-hidden="true" />
60
+ `;
61
+ }
62
+ function Q(e) {
63
+ const t = e.eyeY ?? 13;
64
+ return `
65
+ <g class="agent-avatar__eyes" fill="${e.eyeColor}" aria-hidden="true">
66
+ <rect class="agent-avatar__eye agent-avatar__eye--left" x="12" y="${t}" width="4" height="7" rx="1" />
67
+ <rect class="agent-avatar__eye agent-avatar__eye--right" x="20" y="${t}" width="4" height="7" rx="1" />
68
+ </g>
69
+ `;
70
+ }
71
+ const Y = [
72
+ { id: "orb", name: "Orb", color: "#8b66f6", shape: '<circle cx="18" cy="18" r="15.5" />' },
73
+ { id: "heart", name: "Heart", color: "#ff4a3d", eyeY: 12.5, shape: '<path d="M18 33 5.3 20.6C-1.3 13.7 3.2 4 11.1 4c3.1 0 5.6 1.7 6.9 4.2C19.3 5.7 21.8 4 24.9 4c7.9 0 12.4 9.7 5.8 16.6Z" />' },
74
+ { id: "soft-square", name: "Soft square", color: "#3b94d2", shape: '<rect x="3" y="3" width="30" height="30" rx="8" />' },
75
+ { id: "hex", name: "Hex", color: "#f28aaa", shape: '<polygon points="10,3 26,3 34,18 26,33 10,33 2,18" />' },
76
+ { id: "spark", name: "Spark", color: "#9669ee", shape: '<path d="M18 1c3 8 9 14 17 17-8 3-14 9-17 17-3-8-9-14-17-17C9 15 15 9 18 1Z" />' },
77
+ { id: "clover-x", name: "Clover X", color: "#118a65", shape: '<path d="M18 11C14 3 7 2 4 6c-3 4 0 9 6 12-6 3-9 8-6 12 3 4 10 3 14-5 4 8 11 9 14 5 3-4 0-9-6-12 6-3 9-8 6-12-3-4-10-3-14 5Z" />' },
78
+ { id: "ripple", name: "Ripple", color: "#0d8d67", shape: `<polygon points="${x(10, 15.5, 13.8)}" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round" />` },
79
+ { id: "bloom", name: "Bloom", color: "#f29ab7", shape: '<circle cx="18" cy="9.5" r="6.8"/><circle cx="25.4" cy="13.8" r="6.8"/><circle cx="25.4" cy="22.2" r="6.8"/><circle cx="18" cy="26.5" r="6.8"/><circle cx="10.6" cy="22.2" r="6.8"/><circle cx="10.6" cy="13.8" r="6.8"/>' },
80
+ { id: "sun", name: "Sun", color: "#ffb51b", shape: `<polygon points="${x(10, 16, 12.2)}" />` },
81
+ { id: "pulse", name: "Pulse", color: "#ff6d27", shape: `<polygon points="${x(18, 16, 14.2)}" />` },
82
+ { id: "triangle", name: "Triangle", color: "#ffb317", eyeY: 14.5, shape: '<path d="M16.2 4.5a2.05 2.05 0 0 1 3.6 0l13.1 24.3A2.15 2.15 0 0 1 31 32H5a2.15 2.15 0 0 1-1.9-3.2Z" />' },
83
+ { id: "quad-flower", name: "Quad flower", color: "#3f96d6", shape: '<circle cx="11" cy="11" r="8"/><circle cx="25" cy="11" r="8"/><circle cx="11" cy="25" r="8"/><circle cx="25" cy="25" r="8"/>' },
84
+ { id: "hexagon", name: "Hexagon", color: "#3a92d1", shape: '<polygon points="18,2.5 32,10.5 32,25.5 18,33.5 4,25.5 4,10.5" />' },
85
+ { id: "star", name: "Star", color: "#ffb91c", eyeY: 14, shape: `<polygon points="${x(5, 16, 7.3)}" />` },
86
+ { id: "stack", name: "Stack", color: "#ff4a42", shape: '<rect x="4" y="3" width="28" height="11" rx="5.5"/><rect x="4" y="12.5" width="28" height="11" rx="5.5"/><rect x="4" y="22" width="28" height="11" rx="5.5"/>' },
87
+ { id: "butterfly", name: "Butterfly", color: "#ef91af", shape: '<path d="M18 18C18 8 13 3 4 3c0 9 3 14 11 15-8 1-11 6-11 15 9 0 14-5 14-15 0 10 5 15 14 15 0-9-3-14-11-15 8-1 11-6 11-15-9 0-14 5-14 15Z" />' },
88
+ { id: "octagon", name: "Octagon", color: "#128862", shape: '<polygon points="11,3 25,3 33,11 33,25 25,33 11,33 3,25 3,11" />' },
89
+ { id: "heart-drop", name: "Heart drop", color: "#f38dac", eyeY: 12.5, shape: '<path d="M18 34 5.8 21.4C-.8 14.6 3.1 4 11.2 4c3.2 0 5.6 1.7 6.8 4.3C19.2 5.7 21.6 4 24.8 4c8.1 0 12 10.6 5.4 17.4Z" />' },
90
+ { id: "soft-scallop", name: "Soft scallop", color: "#f19bb1", shape: `<polygon points="${x(12, 15.6, 14.4)}" stroke="currentColor" stroke-width="2" stroke-linejoin="round" />` },
91
+ { id: "arch", name: "Arch", color: "#0f8c65", shape: '<path d="M5 33V17C5 8.7 10.8 3 18 3s13 5.7 13 14v16Z" />' },
92
+ { id: "pentagon", name: "Pentagon", color: "#936af0", eyeY: 13.5, shape: '<polygon points="18,2 33,13 27,33 9,33 3,13" />' },
93
+ { id: "diamond", name: "Diamond", color: "#368fd0", shape: '<polygon points="18,2 34,18 18,34 2,18" />' },
94
+ { id: "leaf", name: "Leaf", color: "#ff7028", shape: '<path d="M4 32V18C4 10.3 10.3 4 18 4h14v14c0 7.7-6.3 14-14 14Z" />' },
95
+ { id: "dome", name: "Dome", color: "#ffb614", shape: '<path d="M4 33V18C4 9.7 10.7 3 19 3h1c7.2 0 13 5.8 13 13v17Z" />' }
96
+ ].map((e) => ({ ...e, eyeColor: "#171820" })), ne = Y.map((e) => e.id), Z = "ads-agent-icon-styles", J = `
97
+ .agent-avatar { display: inline-block; flex: none; color: var(--agent-color, #4565d5); line-height: 0; }
98
+ .agent-avatar__svg { display: block; width: 100%; height: 100%; overflow: visible; shape-rendering: geometricPrecision; }
99
+ .agent-avatar__character,
100
+ .agent-avatar__field,
101
+ .agent-avatar__eyes,
102
+ .agent-avatar__focus-scan { transform-box: fill-box; transform-origin: center; will-change: transform; }
103
+ .agent-avatar__focus-scan { opacity: 0; pointer-events: none; }
104
+ /* Tiles rest VISIBLE (opacity 1, scale 1 - no base hiding). The tile-assembly
105
+ intro is a pure-CSS mount animation: 'both' fill holds the collapsed 0%
106
+ frame through its stagger delay, then settles at the visible 100% frame.
107
+ If the animation never runs, the tile still shows its natural visible state,
108
+ so the mark can never be trapped invisible. */
109
+ .agent-avatar__tile { transform-box: fill-box; transform-origin: center; animation: ads-agent-tile-intro 620ms cubic-bezier(0.22, 0.72, 0.24, 1) both; animation-delay: var(--agent-tile-delay, 0ms); }
110
+ /* Field Agent pointer tracking: eyes ease toward the cursor; overrides the
111
+ state eye animation while the pointer is active. */
112
+ .agent-avatar.is-pointer-tracking .agent-avatar__eyes { animation: none !important; transform: translate(var(--agent-pointer-eye-x, 0), var(--agent-pointer-eye-y, 0)); transition: transform 70ms linear; }
113
+ .agent-avatar[data-agent-state="default"] .agent-avatar__character { animation: ads-agent-default-breathe 3.6s ease-in-out infinite; animation-delay: var(--agent-delay, 0s); }
114
+ .agent-avatar[data-agent-state="thinking"] .agent-avatar__field { animation: ads-agent-thinking-field 2.15s ease-in-out infinite, ads-agent-thinking-color 3.2s ease-in-out infinite; animation-delay: var(--agent-delay, 0s), var(--agent-delay, 0s); }
115
+ .agent-avatar[data-agent-state="thinking"] .agent-avatar__eyes { animation: ads-agent-thinking-eyes 1.65s cubic-bezier(0.65, 0, 0.35, 1) infinite; animation-delay: var(--agent-delay, 0s); }
116
+ .agent-avatar[data-agent-state="thinking"] .agent-avatar__focus-scan { animation: ads-agent-thinking-scan 2.15s cubic-bezier(0.45, 0, 0.2, 1) infinite; animation-delay: var(--agent-delay, 0s); }
117
+ .agent-avatar[data-agent-state="acting"] .agent-avatar__character { animation: ads-agent-acting-size 720ms cubic-bezier(0.33, 1, 0.68, 1) infinite; animation-delay: var(--agent-delay, 0s); }
118
+ .agent-avatar[data-agent-state="sleep"] .agent-avatar__character { animation: ads-agent-sleep-float 4.8s ease-in-out infinite; animation-delay: var(--agent-delay, 0s); }
119
+ .agent-avatar[data-agent-state="sleep"] .agent-avatar__field { animation: ads-agent-sleep-dim 4.8s ease-in-out infinite; animation-delay: var(--agent-delay, 0s); }
120
+ .agent-avatar[data-agent-state="sleep"] .agent-avatar__eyes { animation: ads-agent-sleep-eyes 4.8s ease-in-out infinite; animation-delay: var(--agent-delay, 0s); }
121
+ @keyframes ads-agent-default-breathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-0.45px) scale(1.018, 0.985); } }
122
+ @keyframes ads-agent-tile-intro { 0% { opacity: 0; transform: scale(0); } 100% { opacity: 1; transform: scale(1); } }
123
+ @keyframes ads-agent-thinking-field { 0%, 100% { transform: rotate(-1.6deg) scale(0.99); } 50% { transform: rotate(1.6deg) scale(1.025); } }
124
+ @keyframes ads-agent-thinking-color { 0%, 100% { filter: hue-rotate(-8deg) saturate(1.08) brightness(1); } 50% { filter: hue-rotate(24deg) saturate(1.48) brightness(1.13); } }
125
+ @keyframes ads-agent-thinking-scan { 0% { opacity: 0; transform: translateX(0); } 16% { opacity: 0.22; } 42% { opacity: 0.92; } 72% { opacity: 0.35; } 100% { opacity: 0; transform: translateX(51px); } }
126
+ @keyframes ads-agent-thinking-eyes { 0%, 18%, 100% { transform: translateX(-1.15px); } 48%, 68% { transform: translateX(1.15px); } }
127
+ @keyframes ads-agent-acting-size { 0%, 100% { transform: scale(1.1); } 28% { transform: scale(1.2); } 48% { transform: scale(1.125); } 72% { transform: scale(1.185); } }
128
+ @keyframes ads-agent-sleep-float { 0%, 100% { transform: translateY(0) rotate(-0.6deg); } 50% { transform: translateY(-1.25px) rotate(0.6deg); } }
129
+ @keyframes ads-agent-sleep-dim { 0%, 100% { opacity: 0.68; filter: saturate(0.52) brightness(1.04); } 50% { opacity: 0.82; filter: saturate(0.68) brightness(1.1); } }
130
+ @keyframes ads-agent-sleep-eyes { 0%, 100% { transform: translateY(1.7px) scaleY(0.18); } 50% { transform: translateY(2px) scaleY(0.14); } }
131
+ @keyframes ads-agent-cute-hello { 0%, 100% { transform: translateY(0) rotate(0) scale(1); } 16% { transform: translateY(0.8px) rotate(0) scale(1.05, 0.93); } 38% { transform: translateY(-2.4px) rotate(-4deg) scale(0.96, 1.07); } 56% { transform: translateY(-1.2px) rotate(3deg) scale(1.025, 0.985); } 74% { transform: translateY(0.25px) rotate(-1.2deg) scale(0.99, 1.015); } }
132
+ @keyframes ads-agent-cute-blink { 0%, 28%, 46%, 100% { transform: translateY(0) scaleY(1); } 36% { transform: translateY(2.7px) scaleY(0.16); } }
133
+ /* Hover greeting: the whole mark gives a quick playful "hello" wave and a
134
+ blink (the Field Agent greeter behaviour). Pure CSS on :hover; the
135
+ pointer-tracking rule above wins on the eyes when the pointer is active. */
136
+ @media (hover: hover) and (pointer: fine) {
137
+ .agent-avatar:hover .agent-avatar__svg { animation: ads-agent-cute-hello 680ms cubic-bezier(0.2, 0.82, 0.24, 1) both; }
138
+ .agent-avatar[data-agent-state="default"]:hover .agent-avatar__eyes { animation: ads-agent-cute-blink 680ms ease-in-out both; }
139
+ }
140
+ @media (prefers-reduced-motion: reduce) {
141
+ .agent-avatar__character,
142
+ .agent-avatar__field,
143
+ .agent-avatar__eyes,
144
+ .agent-avatar__focus-scan,
145
+ .agent-avatar__tile { animation: none !important; opacity: 1; transform: none; transition: none; }
146
+ }
147
+ `;
148
+ function K() {
149
+ i.useEffect(() => {
150
+ if (typeof document > "u" || document.getElementById(Z)) return;
151
+ const e = document.createElement("style");
152
+ e.id = Z, e.textContent = J, document.head.appendChild(e);
153
+ }, []);
154
+ }
155
+ const ee = i.forwardRef(
156
+ ({
157
+ agent: e,
158
+ state: t,
159
+ interactive: g,
160
+ size: l = 40,
161
+ color: c,
162
+ trackPointer: n,
163
+ className: o,
164
+ style: f,
165
+ ...m
166
+ }, h) => {
167
+ K();
168
+ const s = i.useMemo(
169
+ () => Y.find((r) => r.id === e) ?? Y[0],
170
+ [e]
171
+ ), a = i.useMemo(
172
+ () => c ? { ...s, color: c } : s,
173
+ [s, c]
174
+ ), d = i.useRef(null), y = i.useCallback(
175
+ (r) => {
176
+ d.current = r, typeof h == "function" ? h(r) : h && (h.current = r);
177
+ },
178
+ [h]
179
+ ), b = i.useId(), k = i.useMemo(
180
+ () => `agent-${a.id}-${b.replace(/[^a-zA-Z0-9]/g, "")}`,
181
+ [a.id, b]
182
+ ), S = t !== void 0, w = g ?? !S, [O, A] = i.useState("default"), $ = i.useRef(void 0), R = S ? t : O, z = i.useMemo(() => `-${([...a.id].reduce((M, C) => M + C.charCodeAt(0), 0) % 9 * 0.11).toFixed(2)}s`, [a.id]), L = i.useMemo(
183
+ () => `<g class="agent-avatar__character">${W(a, k)}${Q(
184
+ a
185
+ )}</g>`,
186
+ [a, k]
187
+ );
188
+ i.useEffect(() => () => window.clearTimeout($.current), []), i.useEffect(() => {
189
+ const r = d.current;
190
+ if (!n || !r || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
191
+ const M = 82, C = 1.55, B = 1.05;
192
+ let I = 0, E = 0, v = 0;
193
+ const U = () => {
194
+ v = 0;
195
+ const p = r.getBoundingClientRect(), N = I - (p.left + p.width / 2), F = E - (p.top + p.height / 2), _ = Math.hypot(N, F), P = Math.min(_ / M, 1), q = _ > 0 ? N / _ : 0, D = _ > 0 ? F / _ : 0;
196
+ r.style.setProperty("--agent-pointer-eye-x", `${(q * C * P).toFixed(3)}px`), r.style.setProperty("--agent-pointer-eye-y", `${(D * B * P).toFixed(3)}px`);
197
+ }, T = (p) => {
198
+ I = p.clientX, E = p.clientY, r.classList.add("is-pointer-tracking"), v || (v = requestAnimationFrame(U));
199
+ };
200
+ return window.addEventListener("pointermove", T, { passive: !0 }), () => {
201
+ window.removeEventListener("pointermove", T), v && cancelAnimationFrame(v), r.classList.remove("is-pointer-tracking"), r.style.removeProperty("--agent-pointer-eye-x"), r.style.removeProperty("--agent-pointer-eye-y");
202
+ };
203
+ }, [n]);
204
+ const j = w ? {
205
+ onClick: () => {
206
+ window.clearTimeout($.current), A("acting"), $.current = window.setTimeout(() => A("default"), 1500);
207
+ }
208
+ } : {};
209
+ return /* @__PURE__ */ H(
210
+ "span",
211
+ {
212
+ ref: y,
213
+ className: G(
214
+ "agent-avatar",
215
+ w && "cursor-pointer rounded-md outline-none focus-visible:ring-3 focus-visible:ring-ring",
216
+ o
217
+ ),
218
+ "data-agent-icon": a.id,
219
+ "data-agent-state": R,
220
+ role: "img",
221
+ "aria-label": `${a.name} agent icon`,
222
+ tabIndex: w ? 0 : void 0,
223
+ style: {
224
+ "--agent-color": a.color,
225
+ "--agent-delay": z,
226
+ width: l,
227
+ height: l,
228
+ ...f
229
+ },
230
+ ...j,
231
+ ...m,
232
+ children: /* @__PURE__ */ H(
233
+ "svg",
234
+ {
235
+ className: "agent-avatar__svg",
236
+ viewBox: "0 0 36 36",
237
+ focusable: "false",
238
+ "aria-hidden": "true",
239
+ dangerouslySetInnerHTML: { __html: L }
240
+ }
241
+ )
242
+ }
243
+ );
244
+ }
245
+ );
246
+ ee.displayName = "AgentIcon";
247
+ export {
248
+ Y as AGENT_ICONS,
249
+ ne as AGENT_ICON_NAMES,
250
+ ee as AgentIcon
251
+ };
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import { ActiveChainOfThoughtState } from './chain-of-thought-icon';
2
3
  import { ToolState } from './tool';
3
4
  /**
4
5
  * AgentTrace — the ENTIRE agent reasoning trace as one component, so any
@@ -48,8 +49,14 @@ export interface AgentTraceStep {
48
49
  group: string;
49
50
  /** Icon for the phase header (only the first step in a group needs it). */
50
51
  groupIcon?: ReactNode;
51
- /** The step's own leading icon. */
52
+ /** The step's own leading icon. Takes priority over `state` when both are set. */
52
53
  icon?: ReactNode;
54
+ /**
55
+ * The chain-of-thought stage this step represents — resolves to an
56
+ * animated `TraceStateIcon` when active and the same static semantic glyph
57
+ * when complete or errored. Step status never replaces the stage identity.
58
+ */
59
+ state?: ActiveChainOfThoughtState;
53
60
  label: string;
54
61
  /** Attribution — shown only when it differs from `mainAgent`. */
55
62
  agent?: string;