@actioneer/ads 0.2.4 → 0.3.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 (57) hide show
  1. package/components/ai-elements/chain-of-thought.d.ts +64 -2
  2. package/components/ai-elements/chain-of-thought.js +319 -100
  3. package/components/ai-elements/chart.d.ts +30 -0
  4. package/components/ai-elements/chart.js +303 -0
  5. package/components/ai-elements/index.d.ts +2 -0
  6. package/components/ai-elements/message.d.ts +12 -2
  7. package/components/ai-elements/message.js +133 -100
  8. package/components/ai-elements/research-activity.d.ts +45 -0
  9. package/components/ai-elements/research-activity.js +260 -0
  10. package/components/ai-elements/tool.js +42 -38
  11. package/components/answer.d.ts +16 -0
  12. package/components/answer.js +273 -249
  13. package/components/assistant-ui/attachment.js +5 -1
  14. package/components/assistant-ui/composer-deep-research.js +44 -29
  15. package/components/assistant-ui/composer-harness.js +45 -27
  16. package/components/assistant-ui/composer.js +16 -16
  17. package/components/assistant-ui/index.d.ts +0 -1
  18. package/components/assistant-ui/message.d.ts +7 -0
  19. package/components/assistant-ui/message.js +36 -36
  20. package/components/assistant-ui/thread.js +1 -1
  21. package/components/brand-texture.d.ts +37 -0
  22. package/components/brand-texture.js +54 -0
  23. package/components/code-block.d.ts +36 -0
  24. package/components/code-block.js +136 -0
  25. package/components/drawer.d.ts +1 -1
  26. package/components/file-dropzone.d.ts +32 -0
  27. package/components/file-dropzone.js +134 -0
  28. package/components/index.d.ts +10 -0
  29. package/components/index.js +482 -433
  30. package/components/infinite-canvas.d.ts +50 -0
  31. package/components/infinite-canvas.js +215 -0
  32. package/components/page-header.d.ts +22 -0
  33. package/components/page-header.js +52 -0
  34. package/components/resizable-panel.d.ts +29 -0
  35. package/components/resizable-panel.js +102 -0
  36. package/components/reveal.d.ts +36 -0
  37. package/components/reveal.js +35 -0
  38. package/components/scroll-area.d.ts +19 -0
  39. package/components/scroll-area.js +57 -0
  40. package/components/setting-row.d.ts +35 -0
  41. package/components/setting-row.js +86 -0
  42. package/components/sidebar.js +131 -131
  43. package/components/stepper.d.ts +32 -0
  44. package/components/stepper.js +113 -0
  45. package/components/table.js +16 -15
  46. package/components/tabs.js +1 -1
  47. package/lib/icons.d.ts +12 -0
  48. package/lib/icons.js +98 -95
  49. package/lib/motion.d.ts +5 -3
  50. package/lib/motion.js +28 -27
  51. package/llms.txt +122 -28
  52. package/manifest.json +871 -73
  53. package/package.json +2 -2
  54. package/styles.css +71 -28
  55. package/theme.css +19 -15
  56. package/components/assistant-ui/smart-message-text.d.ts +0 -15
  57. package/components/assistant-ui/smart-message-text.js +0 -29
@@ -1,170 +1,180 @@
1
1
  "use client";
2
2
  import { jsxs as i, jsx as a } from "react/jsx-runtime";
3
- import * as x from "react";
4
- import { cva as E } from "class-variance-authority";
5
- import { z as t } from "zod/v4";
6
- import { Alert as L, AlertTitle as B, AlertDescription as $ } from "./alert.js";
7
- import { Badge as b } from "./badge.js";
8
- import { Button as O } from "./button.js";
9
- import { FollowUpSuggestion as V } from "./assistant-ui/follow-up-suggestions.js";
10
- import { AreaChart as _, BarChart as z, LineChart as M } from "./chart.js";
11
- import { Progress as P } from "./progress.js";
3
+ import * as u from "react";
4
+ import { cva as L } from "class-variance-authority";
5
+ import { z as e } from "zod/v4";
6
+ import { Alert as E, AlertTitle as B, AlertDescription as $ } from "./alert.js";
7
+ import { Badge as p } from "./badge.js";
8
+ import { Button as z } from "./button.js";
9
+ import { FollowUpSuggestion as O } from "./assistant-ui/follow-up-suggestions.js";
10
+ import { Source as P, SourceTitle as V } from "./assistant-ui/sources.js";
11
+ import { AreaChart as _, BarChart as M, LineChart as W } from "./chart.js";
12
+ import { Progress as I } from "./progress.js";
12
13
  import { cn as c } from "../lib/cn.js";
13
- const I = "render_answer", K = "Render the final answer with one curated ADS template. Choose the semantic kind that best matches the answer and provide only validated data; the application owns the layout.", u = t.enum([
14
+ const K = "render_answer", H = "Render the final answer with one curated ADS template. Choose the semantic kind that best matches the answer and provide only validated data; the application owns the layout.", x = e.enum([
14
15
  "default",
15
16
  "primary",
16
17
  "success",
17
18
  "warning",
18
19
  "danger",
19
20
  "info"
20
- ]), W = t.object({
21
- id: t.string().min(1),
22
- label: t.string().min(1),
23
- prompt: t.string().min(1).optional()
24
- }), F = t.object({
25
- id: t.string().min(1),
26
- label: t.string().min(1),
27
- description: t.string().optional()
28
- }), p = t.object({
29
- label: t.string().optional(),
30
- text: t.string().min(1),
31
- tone: u.optional()
21
+ ]), F = e.object({
22
+ id: e.string().min(1),
23
+ label: e.string().min(1),
24
+ prompt: e.string().min(1).optional()
25
+ }), q = e.object({
26
+ id: e.string().min(1),
27
+ label: e.string().min(1),
28
+ description: e.string().optional(),
29
+ href: e.string().min(1).refine((t) => {
30
+ if (t.startsWith("/") || t.startsWith("#")) return !0;
31
+ try {
32
+ const r = new URL(t).protocol;
33
+ return r === "http:" || r === "https:";
34
+ } catch {
35
+ return !1;
36
+ }
37
+ }, "Source link must be HTTP(S) or app-relative").optional().describe("Destination opened in a new tab when the source is selected")
38
+ }), b = e.object({
39
+ label: e.string().optional(),
40
+ text: e.string().min(1),
41
+ tone: x.optional()
32
42
  }), f = {
33
- eyebrow: t.string().optional(),
34
- headline: t.string().min(1),
35
- summary: t.string().optional(),
36
- followUps: t.array(W).max(3).optional(),
37
- sources: t.array(F).max(8).optional()
38
- }, A = t.object({
39
- value: t.string().min(1),
40
- detail: t.string().optional(),
41
- tone: u.optional()
42
- }), H = t.object({
43
+ eyebrow: e.string().optional(),
44
+ headline: e.string().min(1),
45
+ summary: e.string().optional(),
46
+ followUps: e.array(F).max(3).optional(),
47
+ sources: e.array(q).max(8).optional()
48
+ }, A = e.object({
49
+ value: e.string().min(1),
50
+ detail: e.string().optional(),
51
+ tone: x.optional()
52
+ }), G = e.object({
43
53
  ...f,
44
- kind: t.literal("comparison"),
45
- subjects: t.tuple([
46
- t.object({ label: t.string().min(1), description: t.string().optional() }),
47
- t.object({ label: t.string().min(1), description: t.string().optional() })
54
+ kind: e.literal("comparison"),
55
+ subjects: e.tuple([
56
+ e.object({ label: e.string().min(1), description: e.string().optional() }),
57
+ e.object({ label: e.string().min(1), description: e.string().optional() })
48
58
  ]),
49
- rows: t.array(
50
- t.object({
51
- label: t.string().min(1),
52
- description: t.string().min(1).optional().describe("Methodology, grain, or scope shown beneath the measure"),
53
- values: t.tuple([A, A]),
54
- delta: t.object({
55
- value: t.string().min(1),
56
- tone: u.optional()
59
+ rows: e.array(
60
+ e.object({
61
+ label: e.string().min(1),
62
+ description: e.string().min(1).optional().describe("Methodology, grain, or scope shown beneath the measure"),
63
+ values: e.tuple([A, A]),
64
+ delta: e.object({
65
+ value: e.string().min(1),
66
+ tone: x.optional()
57
67
  }).optional()
58
68
  })
59
69
  ).min(1).max(8),
60
- takeaway: p.optional()
61
- }), k = t.enum([
70
+ takeaway: b.optional()
71
+ }), k = e.enum([
62
72
  "primary",
63
73
  "success",
64
74
  "warning",
65
75
  "danger",
66
76
  "info"
67
- ]), q = t.discriminatedUnion("kind", [
68
- t.object({
69
- kind: t.literal("line"),
70
- value: t.union([t.number(), t.string()]),
71
- axis: t.enum(["x", "y"]).optional(),
72
- label: t.string().optional(),
77
+ ]), J = e.discriminatedUnion("kind", [
78
+ e.object({
79
+ kind: e.literal("line"),
80
+ value: e.union([e.number(), e.string()]),
81
+ axis: e.enum(["x", "y"]).optional(),
82
+ label: e.string().optional(),
73
83
  color: k.optional()
74
84
  }),
75
- t.object({
76
- kind: t.literal("band"),
77
- from: t.union([t.number(), t.string()]),
78
- to: t.union([t.number(), t.string()]),
79
- axis: t.enum(["x", "y"]).optional(),
80
- label: t.string().optional(),
85
+ e.object({
86
+ kind: e.literal("band"),
87
+ from: e.union([e.number(), e.string()]),
88
+ to: e.union([e.number(), e.string()]),
89
+ axis: e.enum(["x", "y"]).optional(),
90
+ label: e.string().optional(),
81
91
  color: k.optional()
82
92
  }),
83
- t.object({
84
- kind: t.literal("point"),
85
- x: t.union([t.number(), t.string()]),
86
- y: t.number(),
87
- label: t.string().min(1),
88
- description: t.string().optional(),
93
+ e.object({
94
+ kind: e.literal("point"),
95
+ x: e.union([e.number(), e.string()]),
96
+ y: e.number(),
97
+ label: e.string().min(1),
98
+ description: e.string().optional(),
89
99
  color: k.optional()
90
100
  })
91
- ]), G = t.record(
92
- t.string(),
93
- t.union([t.string(), t.number(), t.null()])
94
- ), J = t.object({
101
+ ]), Q = e.record(
102
+ e.string(),
103
+ e.union([e.string(), e.number(), e.null()])
104
+ ), U = e.object({
95
105
  ...f,
96
- kind: t.literal("trend"),
97
- metric: t.object({
98
- label: t.string().min(1),
99
- value: t.string().min(1),
100
- change: t.string().optional(),
101
- tone: u.optional()
106
+ kind: e.literal("trend"),
107
+ metric: e.object({
108
+ label: e.string().min(1),
109
+ value: e.string().min(1),
110
+ change: e.string().optional(),
111
+ tone: x.optional()
102
112
  }).optional(),
103
- chart: t.object({
104
- type: t.enum(["line", "area", "bar"]),
105
- data: t.array(G).min(1).max(100),
106
- categoryKey: t.string().min(1),
107
- series: t.array(t.string().min(1)).min(1).max(4),
108
- seriesLabels: t.record(t.string(), t.string()).optional(),
109
- highlight: t.string().optional(),
110
- unit: t.string().optional(),
111
- annotations: t.array(q).max(8).optional()
113
+ chart: e.object({
114
+ type: e.enum(["line", "area", "bar"]),
115
+ data: e.array(Q).min(1).max(100),
116
+ categoryKey: e.string().min(1),
117
+ series: e.array(e.string().min(1)).min(1).max(4),
118
+ seriesLabels: e.record(e.string(), e.string()).optional(),
119
+ highlight: e.string().optional(),
120
+ unit: e.string().optional(),
121
+ annotations: e.array(J).max(8).optional()
112
122
  }),
113
- insight: p.optional()
114
- }), Q = t.object({
123
+ insight: b.optional()
124
+ }), X = e.object({
115
125
  ...f,
116
- kind: t.literal("status"),
117
- overall: t.object({
118
- label: t.string().min(1),
119
- value: t.string().min(1),
120
- tone: u.optional()
126
+ kind: e.literal("status"),
127
+ overall: e.object({
128
+ label: e.string().min(1),
129
+ value: e.string().min(1),
130
+ tone: x.optional()
121
131
  }).optional(),
122
- items: t.array(
123
- t.object({
124
- label: t.string().min(1),
125
- status: t.string().min(1),
126
- detail: t.string().optional(),
127
- meta: t.string().optional(),
128
- tone: u.optional()
132
+ items: e.array(
133
+ e.object({
134
+ label: e.string().min(1),
135
+ status: e.string().min(1),
136
+ detail: e.string().optional(),
137
+ meta: e.string().optional(),
138
+ tone: x.optional()
129
139
  })
130
140
  ).min(1).max(12),
131
- recommendation: p.optional()
132
- }), X = t.object({
141
+ recommendation: b.optional()
142
+ }), Y = e.object({
133
143
  ...f,
134
- kind: t.literal("breakdown"),
135
- total: t.object({ label: t.string().min(1), value: t.string().min(1) }).optional(),
136
- items: t.array(
137
- t.object({
138
- label: t.string().min(1),
139
- value: t.string().min(1),
140
- share: t.number().min(0).max(100),
141
- detail: t.string().optional(),
142
- tone: u.optional()
144
+ kind: e.literal("breakdown"),
145
+ total: e.object({ label: e.string().min(1), value: e.string().min(1) }).optional(),
146
+ items: e.array(
147
+ e.object({
148
+ label: e.string().min(1),
149
+ value: e.string().min(1),
150
+ share: e.number().min(0).max(100),
151
+ detail: e.string().optional(),
152
+ tone: x.optional()
143
153
  })
144
154
  ).min(1).max(12),
145
- insight: p.optional()
146
- }), Y = t.object({
155
+ insight: b.optional()
156
+ }), Z = e.object({
147
157
  ...f,
148
- kind: t.literal("explanation"),
149
- sections: t.array(
150
- t.object({
151
- title: t.string().min(1),
152
- body: t.string().optional(),
153
- bullets: t.array(t.string().min(1)).max(5).optional()
158
+ kind: e.literal("explanation"),
159
+ sections: e.array(
160
+ e.object({
161
+ title: e.string().min(1),
162
+ body: e.string().optional(),
163
+ bullets: e.array(e.string().min(1)).max(5).optional()
154
164
  })
155
165
  ).min(1).max(6),
156
- takeaway: p.optional()
157
- }), Z = t.discriminatedUnion("kind", [
158
- H,
159
- J,
160
- Q,
166
+ takeaway: b.optional()
167
+ }), ee = e.discriminatedUnion("kind", [
168
+ G,
169
+ U,
161
170
  X,
162
- Y
163
- ]), xt = {
164
- name: I,
165
- description: K,
166
- inputSchema: Z
167
- }, v = E("font-semibold tabular-nums text-foreground", {
171
+ Y,
172
+ Z
173
+ ]), pe = {
174
+ name: K,
175
+ description: H,
176
+ inputSchema: ee
177
+ }, v = L("font-semibold tabular-nums text-foreground", {
168
178
  variants: {
169
179
  tone: {
170
180
  default: "text-foreground",
@@ -176,45 +186,49 @@ const I = "render_answer", K = "Render the final answer with one curated ADS tem
176
186
  }
177
187
  },
178
188
  defaultVariants: { tone: "default" }
179
- }), U = new Intl.NumberFormat("en-US", {
189
+ }), te = new Intl.NumberFormat("en-US", {
180
190
  notation: "compact",
181
191
  maximumFractionDigits: 1
182
- }), tt = (e) => e === "success" || e === "warning" || e === "danger" || e === "info" ? e : "default", et = (e) => e === "success" || e === "warning" || e === "danger" || e === "info" ? e : "primary";
183
- function y({ spec: e }) {
192
+ }), ae = (t) => t === "success" || t === "warning" || t === "danger" || t === "info" ? t : "default", ne = (t) => t === "success" || t === "warning" || t === "danger" || t === "info" ? t : "primary";
193
+ function y({ spec: t }) {
184
194
  return /* @__PURE__ */ i("div", { className: "space-y-2", children: [
185
- e.eyebrow && /* @__PURE__ */ a("p", { className: "text-xs font-semibold uppercase tracking-wider text-tertiary", children: e.eyebrow }),
186
- /* @__PURE__ */ a("h2", { className: "max-w-2xl text-xl font-bold leading-tight tracking-tight text-foreground", children: e.headline }),
187
- e.summary && /* @__PURE__ */ a("p", { className: "max-w-2xl text-sm leading-6 text-secondary", children: e.summary })
195
+ t.eyebrow && /* @__PURE__ */ a("p", { className: "text-xs font-semibold uppercase tracking-wider text-tertiary", children: t.eyebrow }),
196
+ /* @__PURE__ */ a("h2", { className: "max-w-2xl text-xl font-bold leading-tight tracking-tight text-foreground", children: t.headline }),
197
+ t.summary && /* @__PURE__ */ a("p", { className: "max-w-2xl text-sm leading-6 text-secondary", children: t.summary })
188
198
  ] });
189
199
  }
190
- function w({ signal: e }) {
191
- return /* @__PURE__ */ i(L, { variant: tt(e.tone), children: [
192
- /* @__PURE__ */ a(B, { children: e.label ?? "Takeaway" }),
193
- /* @__PURE__ */ a($, { children: e.text })
200
+ function w({ signal: t }) {
201
+ return /* @__PURE__ */ i(E, { variant: ae(t.tone), children: [
202
+ /* @__PURE__ */ a(B, { children: t.label ?? "Takeaway" }),
203
+ /* @__PURE__ */ a($, { children: t.text })
194
204
  ] });
195
205
  }
196
206
  function N({
197
- followUps: e,
207
+ followUps: t,
198
208
  sources: r,
199
209
  onFollowUp: s,
200
210
  onSourceSelect: o
201
211
  }) {
202
- return !(e != null && e.length) && !(r != null && r.length) ? null : /* @__PURE__ */ i("div", { className: "space-y-3 pt-1", children: [
203
- !!(e != null && e.length) && /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2", children: e.map((l) => /* @__PURE__ */ a(
204
- V,
205
- {
206
- type: "button",
207
- disabled: !s,
208
- onClick: () => s == null ? void 0 : s(l),
209
- children: l.label
210
- },
211
- l.id
212
- )) }),
212
+ return !(t != null && t.length) && !(r != null && r.length) ? null : /* @__PURE__ */ i("div", { className: "space-y-3 pt-1", children: [
213
213
  !!(r != null && r.length) && /* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-1.5", children: [
214
214
  /* @__PURE__ */ a("span", { className: "mr-1 text-xs font-medium text-tertiary", children: "Sources" }),
215
215
  r.map(
216
- (l) => o ? /* @__PURE__ */ a(
217
- O,
216
+ (l) => l.href ? /* @__PURE__ */ i(
217
+ P,
218
+ {
219
+ href: l.href,
220
+ variant: "muted",
221
+ size: "sm",
222
+ title: l.description,
223
+ className: "h-6 rounded-full px-2",
224
+ children: [
225
+ /* @__PURE__ */ a(V, { children: l.label }),
226
+ /* @__PURE__ */ a("span", { className: "sr-only", children: " (opens in a new tab)" })
227
+ ]
228
+ },
229
+ l.id
230
+ ) : o ? /* @__PURE__ */ a(
231
+ z,
218
232
  {
219
233
  type: "button",
220
234
  size: "xs",
@@ -225,22 +239,32 @@ function N({
225
239
  children: l.label
226
240
  },
227
241
  l.id
228
- ) : /* @__PURE__ */ a(b, { variant: "soft", title: l.description, children: l.label }, l.id)
242
+ ) : /* @__PURE__ */ a(p, { variant: "soft", title: l.description, children: l.label }, l.id)
229
243
  )
230
- ] })
244
+ ] }),
245
+ !!(t != null && t.length) && /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2", children: t.map((l) => /* @__PURE__ */ a(
246
+ O,
247
+ {
248
+ type: "button",
249
+ disabled: !s,
250
+ onClick: () => s == null ? void 0 : s(l),
251
+ children: l.label
252
+ },
253
+ l.id
254
+ )) })
231
255
  ] });
232
256
  }
233
- const j = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
257
+ const j = u.forwardRef(({ spec: t, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
234
258
  "div",
235
259
  {
236
260
  ref: m,
237
- "data-answer-kind": e.kind,
261
+ "data-answer-kind": t.kind,
238
262
  className: c("w-full max-w-2xl space-y-5", o),
239
263
  ...l,
240
264
  children: [
241
- /* @__PURE__ */ a(y, { spec: e }),
265
+ /* @__PURE__ */ a(y, { spec: t }),
242
266
  /* @__PURE__ */ a("div", { className: "overflow-x-auto rounded-2xl bg-surface p-2", children: /* @__PURE__ */ i("table", { className: "w-full min-w-[32rem] border-separate border-spacing-y-1 text-left", children: [
243
- /* @__PURE__ */ a("caption", { className: "sr-only", children: e.headline }),
267
+ /* @__PURE__ */ a("caption", { className: "sr-only", children: t.headline }),
244
268
  /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ i("tr", { children: [
245
269
  /* @__PURE__ */ a(
246
270
  "th",
@@ -250,7 +274,7 @@ const j = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className:
250
274
  children: "Measure"
251
275
  }
252
276
  ),
253
- e.subjects.map((n) => /* @__PURE__ */ i(
277
+ t.subjects.map((n) => /* @__PURE__ */ i(
254
278
  "th",
255
279
  {
256
280
  scope: "col",
@@ -265,13 +289,13 @@ const j = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className:
265
289
  /* @__PURE__ */ i("th", { scope: "col", className: "px-3 py-2 align-bottom", children: [
266
290
  /* @__PURE__ */ a("span", { className: "block text-sm font-semibold text-foreground", children: "Difference" }),
267
291
  /* @__PURE__ */ i("span", { className: "mt-0.5 block text-xs font-normal text-tertiary", children: [
268
- e.subjects[1].label,
292
+ t.subjects[1].label,
269
293
  " − ",
270
- e.subjects[0].label
294
+ t.subjects[0].label
271
295
  ] })
272
296
  ] })
273
297
  ] }) }),
274
- /* @__PURE__ */ a("tbody", { children: e.rows.map((n) => {
298
+ /* @__PURE__ */ a("tbody", { children: t.rows.map((n) => {
275
299
  const d = n.values[0].detail === n.values[1].detail ? n.values[0].detail : void 0, h = n.description ?? d;
276
300
  return /* @__PURE__ */ i("tr", { className: "[&>*]:bg-muted/60", children: [
277
301
  /* @__PURE__ */ i(
@@ -300,7 +324,7 @@ const j = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className:
300
324
  }
301
325
  )
302
326
  },
303
- `${n.label}-${e.subjects[D].label}`
327
+ `${n.label}-${t.subjects[D].label}`
304
328
  )),
305
329
  /* @__PURE__ */ a("td", { className: "rounded-r-xl px-3 py-3 align-top", children: n.delta ? /* @__PURE__ */ a(
306
330
  "span",
@@ -315,12 +339,12 @@ const j = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className:
315
339
  ] }, n.label);
316
340
  }) })
317
341
  ] }) }),
318
- e.takeaway && /* @__PURE__ */ a(w, { signal: e.takeaway }),
342
+ t.takeaway && /* @__PURE__ */ a(w, { signal: t.takeaway }),
319
343
  /* @__PURE__ */ a(
320
344
  N,
321
345
  {
322
- followUps: e.followUps,
323
- sources: e.sources,
346
+ followUps: t.followUps,
347
+ sources: t.sources,
324
348
  onFollowUp: r,
325
349
  onSourceSelect: s
326
350
  }
@@ -329,18 +353,18 @@ const j = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className:
329
353
  }
330
354
  ));
331
355
  j.displayName = "ComparisonAnswer";
332
- const S = x.forwardRef(
333
- ({ spec: e, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => {
334
- const n = x.useMemo(
335
- () => e.chart.unit ? (h) => `${U.format(h)}${e.chart.unit}` : void 0,
336
- [e.chart.unit]
356
+ const S = u.forwardRef(
357
+ ({ spec: t, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => {
358
+ const n = u.useMemo(
359
+ () => t.chart.unit ? (h) => `${te.format(h)}${t.chart.unit}` : void 0,
360
+ [t.chart.unit]
337
361
  ), d = {
338
- data: e.chart.data,
339
- categoryKey: e.chart.categoryKey,
340
- series: e.chart.series,
341
- seriesLabels: e.chart.seriesLabels,
342
- highlight: e.chart.highlight,
343
- annotations: e.chart.annotations,
362
+ data: t.chart.data,
363
+ categoryKey: t.chart.categoryKey,
364
+ series: t.chart.series,
365
+ seriesLabels: t.chart.seriesLabels,
366
+ highlight: t.chart.highlight,
367
+ annotations: t.chart.annotations,
344
368
  formatValue: n,
345
369
  height: 224
346
370
  };
@@ -348,34 +372,34 @@ const S = x.forwardRef(
348
372
  "div",
349
373
  {
350
374
  ref: m,
351
- "data-answer-kind": e.kind,
375
+ "data-answer-kind": t.kind,
352
376
  className: c("w-full max-w-2xl space-y-5", o),
353
377
  ...l,
354
378
  children: [
355
379
  /* @__PURE__ */ i("div", { className: "flex flex-col justify-between gap-4 sm:flex-row sm:items-end", children: [
356
- /* @__PURE__ */ a(y, { spec: e }),
357
- e.metric && /* @__PURE__ */ i("div", { className: "shrink-0 rounded-xl bg-muted px-4 py-3 sm:text-right", children: [
358
- /* @__PURE__ */ a("p", { className: "text-xs font-medium text-tertiary", children: e.metric.label }),
380
+ /* @__PURE__ */ a(y, { spec: t }),
381
+ t.metric && /* @__PURE__ */ i("div", { className: "shrink-0 rounded-xl bg-muted px-4 py-3 text-left", children: [
382
+ /* @__PURE__ */ a("p", { className: "text-xs font-medium text-tertiary", children: t.metric.label }),
359
383
  /* @__PURE__ */ a(
360
384
  "p",
361
385
  {
362
386
  className: c(
363
- v({ tone: e.metric.tone }),
387
+ v({ tone: t.metric.tone }),
364
388
  "mt-1 text-2xl tracking-tight"
365
389
  ),
366
- children: e.metric.value
390
+ children: t.metric.value
367
391
  }
368
392
  ),
369
- e.metric.change && /* @__PURE__ */ a("p", { className: "mt-0.5 text-xs text-secondary", children: e.metric.change })
393
+ t.metric.change && /* @__PURE__ */ a("p", { className: "mt-0.5 text-xs text-secondary", children: t.metric.change })
370
394
  ] })
371
395
  ] }),
372
- /* @__PURE__ */ a("div", { className: "rounded-2xl bg-surface px-3 pb-2 pt-4 sm:px-4", children: e.chart.type === "area" ? /* @__PURE__ */ a(_, { ...d }) : e.chart.type === "bar" ? /* @__PURE__ */ a(z, { ...d }) : /* @__PURE__ */ a(M, { ...d }) }),
373
- e.insight && /* @__PURE__ */ a(w, { signal: e.insight }),
396
+ /* @__PURE__ */ a("div", { className: "rounded-2xl bg-surface px-3 pb-2 pt-4 sm:px-4", children: t.chart.type === "area" ? /* @__PURE__ */ a(_, { ...d }) : t.chart.type === "bar" ? /* @__PURE__ */ a(M, { ...d }) : /* @__PURE__ */ a(W, { ...d }) }),
397
+ t.insight && /* @__PURE__ */ a(w, { signal: t.insight }),
374
398
  /* @__PURE__ */ a(
375
399
  N,
376
400
  {
377
- followUps: e.followUps,
378
- sources: e.sources,
401
+ followUps: t.followUps,
402
+ sources: t.sources,
379
403
  onFollowUp: r,
380
404
  onSourceSelect: s
381
405
  }
@@ -386,32 +410,32 @@ const S = x.forwardRef(
386
410
  }
387
411
  );
388
412
  S.displayName = "TrendAnswer";
389
- const C = x.forwardRef(
390
- ({ spec: e, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
413
+ const C = u.forwardRef(
414
+ ({ spec: t, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
391
415
  "div",
392
416
  {
393
417
  ref: m,
394
- "data-answer-kind": e.kind,
418
+ "data-answer-kind": t.kind,
395
419
  className: c("w-full max-w-2xl space-y-5", o),
396
420
  ...l,
397
421
  children: [
398
422
  /* @__PURE__ */ i("div", { className: "flex flex-col justify-between gap-3 sm:flex-row sm:items-start", children: [
399
- /* @__PURE__ */ a(y, { spec: e }),
400
- e.overall && /* @__PURE__ */ i(
401
- b,
423
+ /* @__PURE__ */ a(y, { spec: t }),
424
+ t.overall && /* @__PURE__ */ i(
425
+ p,
402
426
  {
403
427
  variant: "soft",
404
- color: e.overall.tone ?? "default",
428
+ color: t.overall.tone ?? "default",
405
429
  className: "self-start",
406
430
  children: [
407
- e.overall.label,
431
+ t.overall.label,
408
432
  " · ",
409
- e.overall.value
433
+ t.overall.value
410
434
  ]
411
435
  }
412
436
  )
413
437
  ] }),
414
- /* @__PURE__ */ a("ul", { className: "space-y-2", children: e.items.map((n) => /* @__PURE__ */ i(
438
+ /* @__PURE__ */ a("ul", { className: "space-y-2", children: t.items.map((n) => /* @__PURE__ */ i(
415
439
  "li",
416
440
  {
417
441
  className: "flex items-start justify-between gap-4 rounded-xl bg-surface px-4 py-3",
@@ -421,19 +445,19 @@ const C = x.forwardRef(
421
445
  n.detail && /* @__PURE__ */ a("p", { className: "mt-1 text-xs leading-5 text-secondary", children: n.detail })
422
446
  ] }),
423
447
  /* @__PURE__ */ i("div", { className: "shrink-0 text-right", children: [
424
- /* @__PURE__ */ a(b, { variant: "dot", color: n.tone ?? "default", children: n.status }),
448
+ /* @__PURE__ */ a(p, { variant: "dot", color: n.tone ?? "default", children: n.status }),
425
449
  n.meta && /* @__PURE__ */ a("p", { className: "mt-1 text-xs tabular-nums text-tertiary", children: n.meta })
426
450
  ] })
427
451
  ]
428
452
  },
429
453
  n.label
430
454
  )) }),
431
- e.recommendation && /* @__PURE__ */ a(w, { signal: e.recommendation }),
455
+ t.recommendation && /* @__PURE__ */ a(w, { signal: t.recommendation }),
432
456
  /* @__PURE__ */ a(
433
457
  N,
434
458
  {
435
- followUps: e.followUps,
436
- sources: e.sources,
459
+ followUps: t.followUps,
460
+ sources: t.sources,
437
461
  onFollowUp: r,
438
462
  onSourceSelect: s
439
463
  }
@@ -443,25 +467,25 @@ const C = x.forwardRef(
443
467
  )
444
468
  );
445
469
  C.displayName = "StatusAnswer";
446
- const R = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
470
+ const T = u.forwardRef(({ spec: t, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
447
471
  "div",
448
472
  {
449
473
  ref: m,
450
- "data-answer-kind": e.kind,
474
+ "data-answer-kind": t.kind,
451
475
  className: c("w-full max-w-2xl space-y-5", o),
452
476
  ...l,
453
477
  children: [
454
478
  /* @__PURE__ */ i("div", { className: "flex flex-col justify-between gap-3 sm:flex-row sm:items-end", children: [
455
- /* @__PURE__ */ a(y, { spec: e }),
456
- e.total && /* @__PURE__ */ i("div", { className: "shrink-0 sm:text-right", children: [
457
- /* @__PURE__ */ a("p", { className: "text-xs font-medium text-tertiary", children: e.total.label }),
458
- /* @__PURE__ */ a("p", { className: "mt-1 text-2xl font-semibold tabular-nums tracking-tight text-foreground", children: e.total.value })
479
+ /* @__PURE__ */ a(y, { spec: t }),
480
+ t.total && /* @__PURE__ */ i("div", { className: "shrink-0 sm:text-right", children: [
481
+ /* @__PURE__ */ a("p", { className: "text-xs font-medium text-tertiary", children: t.total.label }),
482
+ /* @__PURE__ */ a("p", { className: "mt-1 text-2xl font-semibold tabular-nums tracking-tight text-foreground", children: t.total.value })
459
483
  ] })
460
484
  ] }),
461
- /* @__PURE__ */ a("ol", { className: "space-y-2", children: e.items.map((n, d) => /* @__PURE__ */ i("li", { className: "rounded-xl bg-surface px-4 py-3", children: [
485
+ /* @__PURE__ */ a("ol", { className: "space-y-2", children: t.items.map((n, d) => /* @__PURE__ */ i("li", { className: "rounded-xl bg-surface px-4 py-3", children: [
462
486
  /* @__PURE__ */ i("div", { className: "mb-2 flex items-start justify-between gap-4", children: [
463
487
  /* @__PURE__ */ i("div", { className: "flex min-w-0 items-start gap-2.5", children: [
464
- /* @__PURE__ */ a(b, { variant: "soft", className: "mt-0.5 tabular-nums", children: d + 1 }),
488
+ /* @__PURE__ */ a(p, { variant: "soft", className: "mt-0.5 tabular-nums", children: d + 1 }),
465
489
  /* @__PURE__ */ i("div", { className: "min-w-0", children: [
466
490
  /* @__PURE__ */ a("p", { className: "text-sm font-medium text-foreground", children: n.label }),
467
491
  n.detail && /* @__PURE__ */ a("p", { className: "mt-0.5 text-xs text-tertiary", children: n.detail })
@@ -476,21 +500,21 @@ const R = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className:
476
500
  ] })
477
501
  ] }),
478
502
  /* @__PURE__ */ a(
479
- P,
503
+ I,
480
504
  {
481
505
  value: n.share,
482
506
  size: "sm",
483
- color: et(n.tone),
507
+ color: ne(n.tone),
484
508
  label: `${n.label}: ${n.share}%`
485
509
  }
486
510
  )
487
511
  ] }, n.label)) }),
488
- e.insight && /* @__PURE__ */ a(w, { signal: e.insight }),
512
+ t.insight && /* @__PURE__ */ a(w, { signal: t.insight }),
489
513
  /* @__PURE__ */ a(
490
514
  N,
491
515
  {
492
- followUps: e.followUps,
493
- sources: e.sources,
516
+ followUps: t.followUps,
517
+ sources: t.sources,
494
518
  onFollowUp: r,
495
519
  onSourceSelect: s
496
520
  }
@@ -498,20 +522,20 @@ const R = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className:
498
522
  ]
499
523
  }
500
524
  ));
501
- R.displayName = "BreakdownAnswer";
502
- const T = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
525
+ T.displayName = "BreakdownAnswer";
526
+ const R = u.forwardRef(({ spec: t, onFollowUp: r, onSourceSelect: s, className: o, ...l }, m) => /* @__PURE__ */ i(
503
527
  "div",
504
528
  {
505
529
  ref: m,
506
- "data-answer-kind": e.kind,
530
+ "data-answer-kind": t.kind,
507
531
  className: c("w-full max-w-2xl space-y-5", o),
508
532
  ...l,
509
533
  children: [
510
- /* @__PURE__ */ a(y, { spec: e }),
511
- /* @__PURE__ */ a("ol", { className: "space-y-2", children: e.sections.map((n, d) => {
534
+ /* @__PURE__ */ a(y, { spec: t }),
535
+ /* @__PURE__ */ a("ol", { className: "space-y-2", children: t.sections.map((n, d) => {
512
536
  var h;
513
537
  return /* @__PURE__ */ i("li", { className: "flex gap-3 rounded-xl bg-surface px-4 py-3.5", children: [
514
- /* @__PURE__ */ a(b, { variant: "soft", className: "mt-0.5 h-fit tabular-nums", children: d + 1 }),
538
+ /* @__PURE__ */ a(p, { variant: "soft", className: "mt-0.5 h-fit tabular-nums", children: d + 1 }),
515
539
  /* @__PURE__ */ i("div", { className: "min-w-0", children: [
516
540
  /* @__PURE__ */ a("h3", { className: "text-sm font-semibold text-foreground", children: n.title }),
517
541
  n.body && /* @__PURE__ */ a("p", { className: "mt-1 text-sm leading-6 text-secondary", children: n.body }),
@@ -528,12 +552,12 @@ const T = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className:
528
552
  ] })
529
553
  ] }, n.title);
530
554
  }) }),
531
- e.takeaway && /* @__PURE__ */ a(w, { signal: e.takeaway }),
555
+ t.takeaway && /* @__PURE__ */ a(w, { signal: t.takeaway }),
532
556
  /* @__PURE__ */ a(
533
557
  N,
534
558
  {
535
- followUps: e.followUps,
536
- sources: e.sources,
559
+ followUps: t.followUps,
560
+ sources: t.sources,
537
561
  onFollowUp: r,
538
562
  onSourceSelect: s
539
563
  }
@@ -541,42 +565,42 @@ const T = x.forwardRef(({ spec: e, onFollowUp: r, onSourceSelect: s, className:
541
565
  ]
542
566
  }
543
567
  ));
544
- T.displayName = "ExplanationAnswer";
545
- const at = x.forwardRef(
546
- ({ spec: e, ...r }, s) => {
547
- switch (e.kind) {
568
+ R.displayName = "ExplanationAnswer";
569
+ const ie = u.forwardRef(
570
+ ({ spec: t, ...r }, s) => {
571
+ switch (t.kind) {
548
572
  case "comparison":
549
- return /* @__PURE__ */ a(j, { ref: s, spec: e, ...r });
573
+ return /* @__PURE__ */ a(j, { ref: s, spec: t, ...r });
550
574
  case "trend":
551
- return /* @__PURE__ */ a(S, { ref: s, spec: e, ...r });
575
+ return /* @__PURE__ */ a(S, { ref: s, spec: t, ...r });
552
576
  case "status":
553
- return /* @__PURE__ */ a(C, { ref: s, spec: e, ...r });
577
+ return /* @__PURE__ */ a(C, { ref: s, spec: t, ...r });
554
578
  case "breakdown":
555
- return /* @__PURE__ */ a(R, { ref: s, spec: e, ...r });
579
+ return /* @__PURE__ */ a(T, { ref: s, spec: t, ...r });
556
580
  case "explanation":
557
- return /* @__PURE__ */ a(T, { ref: s, spec: e, ...r });
581
+ return /* @__PURE__ */ a(R, { ref: s, spec: t, ...r });
558
582
  }
559
583
  }
560
584
  );
561
- at.displayName = "AnswerRenderer";
585
+ ie.displayName = "AnswerRenderer";
562
586
  export {
563
- K as ANSWER_TOOL_DESCRIPTION,
564
- I as ANSWER_TOOL_NAME,
565
- W as AnswerFollowUpSchema,
566
- at as AnswerRenderer,
567
- p as AnswerSignalSchema,
568
- F as AnswerSourceSchema,
569
- Z as AnswerSpecSchema,
570
- u as AnswerToneSchema,
571
- R as BreakdownAnswer,
572
- X as BreakdownAnswerSchema,
587
+ H as ANSWER_TOOL_DESCRIPTION,
588
+ K as ANSWER_TOOL_NAME,
589
+ F as AnswerFollowUpSchema,
590
+ ie as AnswerRenderer,
591
+ b as AnswerSignalSchema,
592
+ q as AnswerSourceSchema,
593
+ ee as AnswerSpecSchema,
594
+ x as AnswerToneSchema,
595
+ T as BreakdownAnswer,
596
+ Y as BreakdownAnswerSchema,
573
597
  j as ComparisonAnswer,
574
- H as ComparisonAnswerSchema,
575
- T as ExplanationAnswer,
576
- Y as ExplanationAnswerSchema,
598
+ G as ComparisonAnswerSchema,
599
+ R as ExplanationAnswer,
600
+ Z as ExplanationAnswerSchema,
577
601
  C as StatusAnswer,
578
- Q as StatusAnswerSchema,
602
+ X as StatusAnswerSchema,
579
603
  S as TrendAnswer,
580
- J as TrendAnswerSchema,
581
- xt as answerTool
604
+ U as TrendAnswerSchema,
605
+ pe as answerTool
582
606
  };