@actioneer/ads 0.5.4 → 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 (91) 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.js +77 -77
  40. package/components/chip.js +3 -3
  41. package/components/code-block.d.ts +39 -17
  42. package/components/code-block.js +153 -104
  43. package/components/command-palette.js +27 -25
  44. package/components/connector-card.js +2 -2
  45. package/components/dropdown.js +65 -61
  46. package/components/empty-state.js +15 -15
  47. package/components/field.js +23 -23
  48. package/components/index.d.ts +4 -0
  49. package/components/index.js +523 -477
  50. package/components/infinite-canvas.js +60 -60
  51. package/components/kbd.js +6 -6
  52. package/components/link.js +6 -6
  53. package/components/modal.js +22 -20
  54. package/components/page-header.js +1 -1
  55. package/components/pagination.js +22 -22
  56. package/components/pixel-blast-svg.js +1 -1
  57. package/components/pixel-icon.d.ts +31 -0
  58. package/components/pixel-icon.js +733 -0
  59. package/components/popover.js +46 -42
  60. package/components/ripple.d.ts +29 -0
  61. package/components/ripple.js +17 -0
  62. package/components/segmented.js +24 -23
  63. package/components/select.js +71 -67
  64. package/components/selection-action-bar.js +22 -22
  65. package/components/sidebar.d.ts +11 -3
  66. package/components/sidebar.js +161 -148
  67. package/components/stepper.d.ts +2 -0
  68. package/components/stepper.js +80 -43
  69. package/components/table.d.ts +7 -0
  70. package/components/table.js +223 -155
  71. package/components/tabs.d.ts +3 -1
  72. package/components/tabs.js +165 -144
  73. package/components/textarea.js +10 -8
  74. package/components/toast.js +48 -46
  75. package/components/tooltip.js +61 -59
  76. package/components/tree.js +44 -41
  77. package/components/typography.d.ts +1 -1
  78. package/components/typography.js +25 -25
  79. package/components/viz-charts.js +133 -133
  80. package/fonts/aribau-grotesk-500.otf +0 -0
  81. package/fonts/aribau-grotesk-600.woff2 +0 -0
  82. package/fonts.css +6 -4
  83. package/lib/icons.d.ts +411 -402
  84. package/lib/icons.js +109 -107
  85. package/llms.txt +96 -8
  86. package/manifest.json +951 -54
  87. package/package.json +5 -5
  88. package/styles.css +206 -81
  89. package/theme.css +200 -77
  90. package/fonts/aribau-grotesk-400.otf +0 -0
  91. package/fonts/aribau-grotesk-700.otf +0 -0
@@ -1,42 +1,37 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as l } from "react/jsx-runtime";
3
- import * as a from "react";
4
- import { makeAssistantToolUI as c, useAssistantRuntime as i } from "@assistant-ui/react";
5
- import { ANSWER_TOOL_NAME as m, AnswerSpecSchema as d, AnswerRenderer as p } from "../answer.js";
6
- import { Alert as u, AlertTitle as h, AlertDescription as w } from "../alert.js";
7
- import { Skeleton as n } from "../skeleton.js";
8
- function A() {
9
- return /* @__PURE__ */ l("div", { className: "w-full max-w-2xl space-y-4", "aria-label": "Building answer", children: [
10
- /* @__PURE__ */ l("div", { className: "space-y-2", children: [
11
- /* @__PURE__ */ e(n, { className: "h-3 w-24" }),
12
- /* @__PURE__ */ e(n, { className: "h-7 w-4/5" }),
13
- /* @__PURE__ */ e(n, { className: "h-4 w-full" })
14
- ] }),
15
- /* @__PURE__ */ e(n, { className: "h-48 w-full rounded-2xl" })
16
- ] });
2
+ import { jsx as r, jsxs as s } from "react/jsx-runtime";
3
+ import * as i from "react";
4
+ import { makeAssistantToolUI as c, useAssistantRuntime as l } from "@assistant-ui/react";
5
+ import { ANSWER_TOOL_NAME as d, AnswerSpecSchema as p, AnswerSkeleton as a, ANSWER_KINDS as u, AnswerRenderer as m } from "../answer.js";
6
+ import { Alert as A, AlertTitle as f, AlertDescription as h } from "../alert.js";
7
+ function S(e) {
8
+ if (typeof e != "object" || e === null || !("kind" in e))
9
+ return;
10
+ const n = e.kind;
11
+ return u.includes(n) ? n : void 0;
17
12
  }
18
- function f({ spec: s }) {
19
- const r = i(), t = a.useCallback(
13
+ function w({ spec: e }) {
14
+ const n = l(), t = i.useCallback(
20
15
  (o) => {
21
- r.thread.append({
16
+ n.thread.append({
22
17
  role: "user",
23
18
  content: [{ type: "text", text: o.prompt ?? o.label }]
24
19
  });
25
20
  },
26
- [r]
21
+ [n]
27
22
  );
28
- return /* @__PURE__ */ e(p, { spec: s, onFollowUp: t });
23
+ return /* @__PURE__ */ r(m, { spec: e, onFollowUp: t, onOptionSelect: t });
29
24
  }
30
- const b = c({
31
- toolName: m,
32
- render: ({ args: s, status: r }) => {
33
- const t = d.safeParse(s);
34
- return t.success ? /* @__PURE__ */ e(f, { spec: t.data }) : r.type === "running" ? /* @__PURE__ */ e(A, {}) : /* @__PURE__ */ l(u, { variant: "danger", children: [
35
- /* @__PURE__ */ e(h, { children: "Unable to render this answer" }),
36
- /* @__PURE__ */ e(w, { children: "The tool response did not match the ADS AnswerSpec contract." })
25
+ const N = c({
26
+ toolName: d,
27
+ render: ({ args: e, status: n }) => {
28
+ const t = p.safeParse(e);
29
+ return t.success ? /* @__PURE__ */ r(w, { spec: t.data }) : n.type === "running" ? /* @__PURE__ */ r(a, { kind: S(e) }) : /* @__PURE__ */ s(A, { variant: "danger", children: [
30
+ /* @__PURE__ */ r(f, { children: "Unable to render this answer" }),
31
+ /* @__PURE__ */ r(h, { children: "The tool response did not match the ADS AnswerSpec contract." })
37
32
  ] });
38
33
  }
39
34
  });
40
35
  export {
41
- b as RenderAnswerToolUI
36
+ N as RenderAnswerToolUI
42
37
  };
@@ -1,5 +1,6 @@
1
1
  import { FC, PropsWithChildren } from 'react';
2
2
  import { VariantProps } from 'class-variance-authority';
3
+ import { ActiveChainOfThoughtState } from '../ai-elements/chain-of-thought-icon';
3
4
  import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../ui/collapsible';
4
5
  declare const chainOfThoughtVariants: (props?: ({
5
6
  variant?: "muted" | "outline" | "ghost" | null | undefined;
@@ -12,9 +13,13 @@ export type ChainOfThoughtRootProps = Omit<React.ComponentProps<typeof Collapsib
12
13
  * stays in sync. Must render inside a message scope.
13
14
  */
14
15
  declare function ChainOfThoughtRoot({ className, variant, children, ...props }: ChainOfThoughtRootProps): import("react").JSX.Element;
15
- declare function ChainOfThoughtTrigger({ active, className, children, ...props }: React.ComponentProps<typeof CollapsibleTrigger> & {
16
- /** Shimmer + spinner while the chain is streaming. Defaults to the scope's running status. */
16
+ declare function ChainOfThoughtTrigger({ active, stage, outcome, className, children, ...props }: React.ComponentProps<typeof CollapsibleTrigger> & {
17
+ /** Shimmer + animated stage icon while streaming. Defaults to the scope's running status. */
17
18
  active?: boolean;
19
+ /** Semantic stage shown while the chain is running. */
20
+ stage?: ActiveChainOfThoughtState;
21
+ /** Whole-chain state shown after the run settles. */
22
+ outcome?: "completed" | "paused" | "incomplete";
18
23
  }): import("react").JSX.Element;
19
24
  declare function ChainOfThoughtContent({ className, children, ...props }: React.ComponentProps<typeof CollapsibleContent>): import("react").JSX.Element;
20
25
  type ChainOfThoughtProps = PropsWithChildren<{
@@ -2,7 +2,7 @@
2
2
  var c = Object.defineProperty;
3
3
  var l = (r, t, o) => t in r ? c(r, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[t] = o;
4
4
  var p = (r, t, o) => l(r, typeof t != "symbol" ? t + "" : t, o);
5
- import { jsxs as m, jsx as e } from "react/jsx-runtime";
5
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
6
6
  import { useComposerRuntime as d, useComposer as u } from "@assistant-ui/react";
7
7
  import "clsx";
8
8
  import "tailwind-merge";
@@ -24,6 +24,9 @@ import "../stepper.js";
24
24
  import "../resizable-panel.js";
25
25
  import "react";
26
26
  import { Bolt as a, ChevronDown as f, CheckList as h, Sparkles as g } from "../../lib/icons.js";
27
+ import "react-dom";
28
+ import "motion/react";
29
+ import "../ripple.js";
27
30
  import "../input.js";
28
31
  import "../input-field.js";
29
32
  import "../textarea.js";
@@ -36,10 +39,8 @@ import "../autocomplete.js";
36
39
  import "../slider.js";
37
40
  import "../segmented.js";
38
41
  import "../modal.js";
39
- import "react-dom";
40
42
  import "../drawer.js";
41
43
  import "../popover.js";
42
- import "motion/react";
43
44
  import { Dropdown as b, DropdownTrigger as v, DropdownContent as y, DropdownLabel as x, DropdownItem as w } from "../dropdown.js";
44
45
  import "../toast.js";
45
46
  import "../answer.js";
@@ -58,6 +59,8 @@ import "../chip.js";
58
59
  import "../timeline.js";
59
60
  import "../alert.js";
60
61
  import "../pixel-blast-svg.js";
62
+ import "../pixel-icon.js";
63
+ import "../agent-icon.js";
61
64
  import "../brand-texture.js";
62
65
  import "../progress.js";
63
66
  import "../progress-circle.js";
@@ -73,6 +76,7 @@ import "../collapsible.js";
73
76
  import "../selection-action-bar.js";
74
77
  import "../ai-elements/agent-trace.js";
75
78
  import "../ai-elements/chain-of-thought.js";
79
+ import "../ai-elements/chain-of-thought-icon.js";
76
80
  import "../ai-elements/chart.js";
77
81
  import "../ai-elements/inline-citation.js";
78
82
  import "../ai-elements/message.js";
@@ -102,7 +106,7 @@ import "./quote.js";
102
106
  import "./sources.js";
103
107
  import "./tool-fallback.js";
104
108
  import "./tool-group.js";
105
- const n = "application/x-actioneer-harness", S = [
109
+ const m = "application/x-actioneer-harness", S = [
106
110
  {
107
111
  id: "investigate",
108
112
  label: "Data investigation",
@@ -122,16 +126,16 @@ const n = "application/x-actioneer-harness", S = [
122
126
  instructions: "Write a concise executive brief: lead with the decision or insight, use only decision-relevant evidence, and end with the recommended next action."
123
127
  }
124
128
  ];
125
- function gi() {
129
+ function xi() {
126
130
  const r = d(), t = u((i) => i.attachments), o = new Set(
127
- t.filter((i) => i.contentType === n).map((i) => i.name)
131
+ t.filter((i) => i.contentType === m).map((i) => i.name)
128
132
  ), s = (i) => {
129
133
  o.has(i.label) || r.addAttachment(
130
- new File([i.instructions], `${i.label}.harness`, { type: n })
134
+ new File([i.instructions], `${i.label}.harness`, { type: m })
131
135
  );
132
136
  };
133
- return /* @__PURE__ */ m(b, { children: [
134
- /* @__PURE__ */ e(v, { children: /* @__PURE__ */ m(
137
+ return /* @__PURE__ */ n(b, { children: [
138
+ /* @__PURE__ */ e(v, { children: /* @__PURE__ */ n(
135
139
  "button",
136
140
  {
137
141
  type: "button",
@@ -150,7 +154,7 @@ function gi() {
150
154
  ]
151
155
  }
152
156
  ) }),
153
- /* @__PURE__ */ m(y, { side: "top", align: "start", className: "w-56", autoFocusFirstItem: !1, children: [
157
+ /* @__PURE__ */ n(y, { side: "top", align: "start", className: "w-56", autoFocusFirstItem: !1, children: [
154
158
  /* @__PURE__ */ e(x, { children: "Add a harness" }),
155
159
  S.map((i) => /* @__PURE__ */ e(
156
160
  w,
@@ -165,16 +169,16 @@ function gi() {
165
169
  ] })
166
170
  ] });
167
171
  }
168
- class bi {
172
+ class wi {
169
173
  constructor() {
170
- p(this, "accept", n);
174
+ p(this, "accept", m);
171
175
  }
172
176
  async add(t) {
173
177
  return {
174
178
  id: t.file.name,
175
179
  type: "document",
176
180
  name: t.file.name.replace(/\.harness$/, "").replace(/-/g, " "),
177
- contentType: n,
181
+ contentType: m,
178
182
  file: t.file,
179
183
  status: { type: "requires-action", reason: "composer-send" }
180
184
  };
@@ -198,7 +202,7 @@ ${o}
198
202
  }
199
203
  }
200
204
  export {
201
- gi as ComposerHarness,
202
- n as HARNESS_MIME,
203
- bi as HarnessAttachmentAdapter
205
+ xi as ComposerHarness,
206
+ m as HARNESS_MIME,
207
+ wi as HarnessAttachmentAdapter
204
208
  };
@@ -1,12 +1,13 @@
1
1
  "use client";
2
2
  import { jsx as o, jsxs as d } from "react/jsx-runtime";
3
- import { createContext as _, memo as w, useRef as m, useState as E, useLayoutEffect as M, useCallback as G, useContext as T, useEffect as j } from "react";
3
+ import { createContext as _, memo as T, useRef as m, useState as E, useLayoutEffect as M, useCallback as G, useContext as w, useEffect as j } from "react";
4
4
  import { cva as D } from "class-variance-authority";
5
- import { Brain as F, ChevronDown as L } from "../../lib/icons.js";
6
- import { useScrollLock as U, useAuiState as V } from "@assistant-ui/react";
7
- import { MarkdownText as B } from "./markdown-text.js";
5
+ import { ChevronDown as F } from "../../lib/icons.js";
6
+ import { useScrollLock as L, useAuiState as U } from "@assistant-ui/react";
7
+ import { MarkdownText as V } from "./markdown-text.js";
8
8
  import { Collapsible as H, CollapsibleTrigger as $, CollapsibleContent as q } from "../ui/collapsible.js";
9
9
  import { cn as u } from "../../lib/cn.js";
10
+ import { TraceStateIcon as B } from "../ai-elements/chain-of-thought-icon.js";
10
11
  const J = 200, h = _(!1), K = D("aui-reasoning-root mb-4 w-full", {
11
12
  variants: {
12
13
  variant: {
@@ -19,7 +20,7 @@ const J = 200, h = _(!1), K = D("aui-reasoning-root mb-4 w-full", {
19
20
  variant: "outline"
20
21
  }
21
22
  });
22
- function C({
23
+ function k({
23
24
  className: r,
24
25
  variant: t,
25
26
  open: a,
@@ -29,13 +30,13 @@ function C({
29
30
  children: c,
30
31
  ...l
31
32
  }) {
32
- const s = m(null), f = m(i), [b, I] = E(null), v = U(s, J), g = a !== void 0, R = g ? a : b ?? n ?? f.current, S = n === !0 && R && (g || b === null), y = m(n);
33
+ const s = m(null), f = m(i), [b, z] = E(null), v = L(s, J), g = a !== void 0, R = g ? a : b ?? n ?? f.current, A = n === !0 && R && (g || b === null), y = m(n);
33
34
  M(() => {
34
35
  y.current !== n && (y.current = n, !g && b === null && v());
35
36
  }, [n, g, b, v]);
36
37
  const P = G(
37
38
  (N) => {
38
- v(), g || I(N), e == null || e(N);
39
+ v(), g || z(N), e == null || e(N);
39
40
  },
40
41
  [v, g, e]
41
42
  );
@@ -52,7 +53,7 @@ function C({
52
53
  K({ variant: t, className: r })
53
54
  ),
54
55
  ...l,
55
- children: /* @__PURE__ */ o(h.Provider, { value: S, children: c })
56
+ children: /* @__PURE__ */ o(h.Provider, { value: A, children: c })
56
57
  }
57
58
  );
58
59
  }
@@ -91,7 +92,7 @@ function x({
91
92
  }
92
93
  );
93
94
  }
94
- function k({
95
+ function C({
95
96
  active: r,
96
97
  duration: t,
97
98
  className: a,
@@ -109,10 +110,13 @@ function k({
109
110
  ...e,
110
111
  children: [
111
112
  /* @__PURE__ */ o(
112
- F,
113
+ B,
113
114
  {
114
115
  "data-slot": "reasoning-trigger-icon",
115
- className: "aui-reasoning-trigger-icon size-4 shrink-0"
116
+ stage: "thinking",
117
+ status: r ? "active" : "complete",
118
+ className: "aui-reasoning-trigger-icon size-4 shrink-0",
119
+ "aria-hidden": !0
116
120
  }
117
121
  ),
118
122
  /* @__PURE__ */ d(
@@ -141,7 +145,7 @@ function k({
141
145
  }
142
146
  ),
143
147
  /* @__PURE__ */ o(
144
- L,
148
+ F,
145
149
  {
146
150
  "data-slot": "reasoning-trigger-chevron",
147
151
  className: u(
@@ -156,12 +160,12 @@ function k({
156
160
  }
157
161
  );
158
162
  }
159
- function z({
163
+ function I({
160
164
  className: r,
161
165
  children: t,
162
166
  ...a
163
167
  }) {
164
- const e = T(h);
168
+ const e = w(h);
165
169
  return /* @__PURE__ */ d(
166
170
  q,
167
171
  {
@@ -181,12 +185,12 @@ function z({
181
185
  }
182
186
  );
183
187
  }
184
- function A({
188
+ function S({
185
189
  className: r,
186
190
  children: t,
187
191
  ...a
188
192
  }) {
189
- const e = T(h), i = m(null), n = m(null);
193
+ const e = w(h), i = m(null), n = m(null);
190
194
  return j(() => {
191
195
  if (!e) return;
192
196
  const c = i.current, l = n.current;
@@ -223,39 +227,39 @@ function A({
223
227
  }
224
228
  );
225
229
  }
226
- const Q = () => /* @__PURE__ */ o(B, {}), W = ({
230
+ const Q = () => /* @__PURE__ */ o(V, {}), W = ({
227
231
  children: r,
228
232
  startIndex: t,
229
233
  endIndex: a
230
234
  }) => {
231
- const e = V((i) => {
235
+ const e = U((i) => {
232
236
  var l, s;
233
237
  if (((l = i.message.status) == null ? void 0 : l.type) !== "running") return !1;
234
238
  const n = i.message.parts.length - 1;
235
239
  return n < 0 || ((s = i.message.parts[n]) == null ? void 0 : s.type) !== "reasoning" ? !1 : n >= t && n <= a;
236
240
  });
237
- return /* @__PURE__ */ d(C, { streaming: e, children: [
238
- /* @__PURE__ */ o(k, { active: e }),
239
- /* @__PURE__ */ o(z, { "aria-busy": e, children: /* @__PURE__ */ o(A, { children: r }) })
241
+ return /* @__PURE__ */ d(k, { streaming: e, children: [
242
+ /* @__PURE__ */ o(C, { active: e }),
243
+ /* @__PURE__ */ o(I, { "aria-busy": e, children: /* @__PURE__ */ o(S, { children: r }) })
240
244
  ] });
241
- }, p = w(
245
+ }, p = T(
242
246
  Q
243
247
  );
244
248
  p.displayName = "Reasoning";
245
- p.Root = C;
246
- p.Trigger = k;
247
- p.Content = z;
248
- p.Text = A;
249
+ p.Root = k;
250
+ p.Trigger = C;
251
+ p.Content = I;
252
+ p.Text = S;
249
253
  p.Fade = x;
250
- const X = w(W);
254
+ const X = T(W);
251
255
  X.displayName = "ReasoningGroup";
252
256
  export {
253
257
  p as Reasoning,
254
- z as ReasoningContent,
258
+ I as ReasoningContent,
255
259
  x as ReasoningFade,
256
260
  X as ReasoningGroup,
257
- C as ReasoningRoot,
258
- A as ReasoningText,
259
- k as ReasoningTrigger,
261
+ k as ReasoningRoot,
262
+ S as ReasoningText,
263
+ C as ReasoningTrigger,
260
264
  K as reasoningVariants
261
265
  };