@actioneer/ads 0.1.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 (231) hide show
  1. package/LICENSE +21 -0
  2. package/bin/ads-init.mjs +314 -0
  3. package/components/accordion.d.ts +13 -0
  4. package/components/accordion.js +91 -0
  5. package/components/agents-ui/agent-audio-visualizer-aura.d.ts +11 -0
  6. package/components/agents-ui/agent-audio-visualizer-aura.js +277 -0
  7. package/components/agents-ui/agent-audio-visualizer-wave.d.ts +12 -0
  8. package/components/agents-ui/agent-audio-visualizer-wave.js +203 -0
  9. package/components/agents-ui/react-shader-toy.d.ts +87 -0
  10. package/components/agents-ui/react-shader-toy.js +531 -0
  11. package/components/ai-elements/chain-of-thought.d.ts +30 -0
  12. package/components/ai-elements/chain-of-thought.js +182 -0
  13. package/components/ai-elements/index.d.ts +11 -0
  14. package/components/ai-elements/inline-citation.d.ts +44 -0
  15. package/components/ai-elements/inline-citation.js +314 -0
  16. package/components/ai-elements/message.d.ts +96 -0
  17. package/components/ai-elements/message.js +308 -0
  18. package/components/ai-elements/queue.d.ts +60 -0
  19. package/components/ai-elements/queue.js +193 -0
  20. package/components/ai-elements/reasoning.d.ts +26 -0
  21. package/components/ai-elements/reasoning.js +131 -0
  22. package/components/ai-elements/shimmer.d.ts +25 -0
  23. package/components/ai-elements/shimmer.js +44 -0
  24. package/components/ai-elements/speech-input.d.ts +16 -0
  25. package/components/ai-elements/speech-input.js +151 -0
  26. package/components/ai-elements/task-progress.d.ts +41 -0
  27. package/components/ai-elements/task-progress.js +211 -0
  28. package/components/ai-elements/task.d.ts +35 -0
  29. package/components/ai-elements/task.js +73 -0
  30. package/components/ai-elements/tool.d.ts +53 -0
  31. package/components/ai-elements/tool.js +116 -0
  32. package/components/ai-elements/voice.d.ts +74 -0
  33. package/components/ai-elements/voice.js +875 -0
  34. package/components/alert.d.ts +21 -0
  35. package/components/alert.js +76 -0
  36. package/components/answer.d.ts +984 -0
  37. package/components/answer.js +543 -0
  38. package/components/assistant-ui/action-bar.d.ts +3 -0
  39. package/components/assistant-ui/action-bar.js +57 -0
  40. package/components/assistant-ui/answer-tool-ui.d.ts +5 -0
  41. package/components/assistant-ui/answer-tool-ui.js +42 -0
  42. package/components/assistant-ui/attachment.d.ts +50 -0
  43. package/components/assistant-ui/attachment.js +353 -0
  44. package/components/assistant-ui/badge.d.ts +11 -0
  45. package/components/assistant-ui/badge.js +54 -0
  46. package/components/assistant-ui/branch-picker.d.ts +3 -0
  47. package/components/assistant-ui/branch-picker.js +36 -0
  48. package/components/assistant-ui/chain-of-thought.d.ts +46 -0
  49. package/components/assistant-ui/composer-add-context.d.ts +50 -0
  50. package/components/assistant-ui/composer-add-context.js +209 -0
  51. package/components/assistant-ui/composer-deep-research.d.ts +16 -0
  52. package/components/assistant-ui/composer-deep-research.js +38 -0
  53. package/components/assistant-ui/composer-harness.d.ts +18 -0
  54. package/components/assistant-ui/composer-harness.js +186 -0
  55. package/components/assistant-ui/composer-trigger-popover.d.ts +47 -0
  56. package/components/assistant-ui/composer-trigger-popover.js +147 -0
  57. package/components/assistant-ui/composer.d.ts +8 -0
  58. package/components/assistant-ui/composer.js +276 -0
  59. package/components/assistant-ui/directive-text.d.ts +16 -0
  60. package/components/assistant-ui/directive-text.js +40 -0
  61. package/components/assistant-ui/error.d.ts +6 -0
  62. package/components/assistant-ui/error.js +39 -0
  63. package/components/assistant-ui/file.d.ts +37 -0
  64. package/components/assistant-ui/file.js +159 -0
  65. package/components/assistant-ui/follow-up-suggestions.d.ts +7 -0
  66. package/components/assistant-ui/follow-up-suggestions.js +44 -0
  67. package/components/assistant-ui/image.d.ts +46 -0
  68. package/components/assistant-ui/image.js +351 -0
  69. package/components/assistant-ui/index.d.ts +28 -0
  70. package/components/assistant-ui/markdown-text.d.ts +1 -0
  71. package/components/assistant-ui/markdown-text.js +242 -0
  72. package/components/assistant-ui/message-timing.d.ts +25 -0
  73. package/components/assistant-ui/message-timing.js +56 -0
  74. package/components/assistant-ui/message.d.ts +4 -0
  75. package/components/assistant-ui/message.js +159 -0
  76. package/components/assistant-ui/primitives.d.ts +2 -0
  77. package/components/assistant-ui/quote.d.ts +37 -0
  78. package/components/assistant-ui/quote.js +150 -0
  79. package/components/assistant-ui/reasoning.d.ts +44 -0
  80. package/components/assistant-ui/reasoning.js +261 -0
  81. package/components/assistant-ui/selection-toolbar.d.ts +29 -0
  82. package/components/assistant-ui/selection-toolbar.js +91 -0
  83. package/components/assistant-ui/smart-message-text.d.ts +15 -0
  84. package/components/assistant-ui/smart-message-text.js +29 -0
  85. package/components/assistant-ui/sources.d.ts +17 -0
  86. package/components/assistant-ui/sources.js +121 -0
  87. package/components/assistant-ui/suggestions.d.ts +7 -0
  88. package/components/assistant-ui/suggestions.js +19 -0
  89. package/components/assistant-ui/thread-context.d.ts +37 -0
  90. package/components/assistant-ui/thread-context.js +8 -0
  91. package/components/assistant-ui/thread.d.ts +5 -0
  92. package/components/assistant-ui/thread.js +77 -0
  93. package/components/assistant-ui/tool-fallback.d.ts +36 -0
  94. package/components/assistant-ui/tool-fallback.js +428 -0
  95. package/components/assistant-ui/tool-group.d.ts +33 -0
  96. package/components/assistant-ui/tool-group.js +173 -0
  97. package/components/assistant-ui/tooltip-icon-button.d.ts +7 -0
  98. package/components/assistant-ui/tooltip-icon-button.js +31 -0
  99. package/components/assistant-ui/voice.d.ts +18 -0
  100. package/components/autocomplete.d.ts +18 -0
  101. package/components/autocomplete.js +162 -0
  102. package/components/avatar.d.ts +26 -0
  103. package/components/avatar.js +92 -0
  104. package/components/badge.d.ts +10 -0
  105. package/components/badge.js +83 -0
  106. package/components/brand-loader.d.ts +16 -0
  107. package/components/brand-loader.js +64 -0
  108. package/components/breadcrumbs.d.ts +8 -0
  109. package/components/breadcrumbs.js +58 -0
  110. package/components/button.d.ts +13 -0
  111. package/components/button.js +100 -0
  112. package/components/card.d.ts +19 -0
  113. package/components/card.js +82 -0
  114. package/components/carousel.d.ts +31 -0
  115. package/components/carousel.js +351 -0
  116. package/components/chart.d.ts +165 -0
  117. package/components/chart.js +841 -0
  118. package/components/checkbox.d.ts +13 -0
  119. package/components/checkbox.js +84 -0
  120. package/components/chip.d.ts +13 -0
  121. package/components/chip.js +112 -0
  122. package/components/collapsible.d.ts +5 -0
  123. package/components/collapsible.js +31 -0
  124. package/components/connector-card.d.ts +62 -0
  125. package/components/connector-card.js +154 -0
  126. package/components/divider.d.ts +23 -0
  127. package/components/divider.js +69 -0
  128. package/components/drawer.d.ts +45 -0
  129. package/components/drawer.js +234 -0
  130. package/components/dropdown.d.ts +33 -0
  131. package/components/dropdown.js +198 -0
  132. package/components/empty-state.d.ts +8 -0
  133. package/components/empty-state.js +30 -0
  134. package/components/field.d.ts +20 -0
  135. package/components/field.js +74 -0
  136. package/components/index.d.ts +56 -0
  137. package/components/index.js +444 -0
  138. package/components/input-field.d.ts +22 -0
  139. package/components/input-field.js +91 -0
  140. package/components/input.d.ts +8 -0
  141. package/components/input.js +61 -0
  142. package/components/kbd.d.ts +6 -0
  143. package/components/kbd.js +26 -0
  144. package/components/link.d.ts +14 -0
  145. package/components/link.js +72 -0
  146. package/components/modal.d.ts +18 -0
  147. package/components/modal.js +156 -0
  148. package/components/navbar.d.ts +15 -0
  149. package/components/navbar.js +68 -0
  150. package/components/number-field.d.ts +11 -0
  151. package/components/number-field.js +89 -0
  152. package/components/pagination.d.ts +28 -0
  153. package/components/pagination.js +179 -0
  154. package/components/panel.d.ts +14 -0
  155. package/components/panel.js +71 -0
  156. package/components/pixel-blast-svg.d.ts +22 -0
  157. package/components/pixel-blast-svg.js +154 -0
  158. package/components/popover.d.ts +20 -0
  159. package/components/popover.js +101 -0
  160. package/components/progress-circle.d.ts +11 -0
  161. package/components/progress-circle.js +75 -0
  162. package/components/progress.d.ts +22 -0
  163. package/components/progress.js +66 -0
  164. package/components/radio.d.ts +16 -0
  165. package/components/radio.js +101 -0
  166. package/components/segmented.d.ts +16 -0
  167. package/components/segmented.js +103 -0
  168. package/components/select.d.ts +28 -0
  169. package/components/select.js +180 -0
  170. package/components/selection-action-bar.d.ts +11 -0
  171. package/components/selection-action-bar.js +59 -0
  172. package/components/sidebar.d.ts +118 -0
  173. package/components/sidebar.js +375 -0
  174. package/components/skeleton.d.ts +6 -0
  175. package/components/skeleton.js +26 -0
  176. package/components/slider.d.ts +11 -0
  177. package/components/slider.js +62 -0
  178. package/components/spinner.d.ts +11 -0
  179. package/components/spinner.js +62 -0
  180. package/components/switch.d.ts +7 -0
  181. package/components/switch.js +61 -0
  182. package/components/table.d.ts +59 -0
  183. package/components/table.js +254 -0
  184. package/components/tabs.d.ts +29 -0
  185. package/components/tabs.js +371 -0
  186. package/components/textarea.d.ts +5 -0
  187. package/components/textarea.js +24 -0
  188. package/components/timeline.d.ts +7 -0
  189. package/components/timeline.js +47 -0
  190. package/components/toast.d.ts +74 -0
  191. package/components/toast.js +211 -0
  192. package/components/tooltip.d.ts +11 -0
  193. package/components/tooltip.js +143 -0
  194. package/components/tree.d.ts +42 -0
  195. package/components/tree.js +86 -0
  196. package/components/typography.d.ts +33 -0
  197. package/components/typography.js +65 -0
  198. package/components/ui/avatar.d.ts +11 -0
  199. package/components/ui/avatar.js +56 -0
  200. package/components/ui/button.d.ts +10 -0
  201. package/components/ui/button.js +57 -0
  202. package/components/ui/collapsible.d.ts +5 -0
  203. package/components/ui/collapsible.js +35 -0
  204. package/components/ui/dialog.d.ts +17 -0
  205. package/components/ui/dialog.js +93 -0
  206. package/components/ui/tabs.d.ts +22 -0
  207. package/components/ui/tooltip.d.ts +7 -0
  208. package/components/ui/tooltip.js +56 -0
  209. package/fonts/aribau-grotesk-400.otf +0 -0
  210. package/fonts/aribau-grotesk-700.otf +0 -0
  211. package/fonts.css +21 -0
  212. package/hooks/agents-ui/use-agent-audio-visualizer-aura.d.ts +8 -0
  213. package/hooks/agents-ui/use-agent-audio-visualizer-aura.js +62 -0
  214. package/hooks/agents-ui/use-agent-audio-visualizer-wave.d.ts +7 -0
  215. package/hooks/agents-ui/use-agent-audio-visualizer-wave.js +60 -0
  216. package/hooks/agents-ui/voice-visualizer-types.d.ts +9 -0
  217. package/lib/cn.d.ts +3 -0
  218. package/lib/cn.js +9 -0
  219. package/lib/icons.d.ts +378 -0
  220. package/lib/icons.js +119 -0
  221. package/lib/interactive.d.ts +24 -0
  222. package/lib/interactive.js +36 -0
  223. package/lib/motion.d.ts +58 -0
  224. package/lib/motion.js +70 -0
  225. package/lib/router.d.ts +3 -0
  226. package/lib/utils.d.ts +6 -0
  227. package/llms.txt +537 -0
  228. package/manifest.json +5085 -0
  229. package/package.json +60 -0
  230. package/styles.css +653 -0
  231. package/theme.css +273 -0
@@ -0,0 +1,543 @@
1
+ "use client";
2
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
3
+ import * as h from "react";
4
+ import { cva as E } from "class-variance-authority";
5
+ import { z as t } from "zod/v4";
6
+ import { Alert as B, AlertTitle as L, AlertDescription as $ } from "./alert.js";
7
+ import { Badge as g } from "./badge.js";
8
+ import { Button as D } from "./button.js";
9
+ import { FollowUpSuggestion as O } from "./assistant-ui/follow-up-suggestions.js";
10
+ import { AreaChart as V, BarChart as _, LineChart as z } from "./chart.js";
11
+ import { Progress as P } from "./progress.js";
12
+ 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.", x = t.enum([
14
+ "default",
15
+ "primary",
16
+ "success",
17
+ "warning",
18
+ "danger",
19
+ "info"
20
+ ]), M = t.object({
21
+ id: t.string().min(1),
22
+ label: t.string().min(1),
23
+ prompt: t.string().min(1).optional()
24
+ }), W = t.object({
25
+ id: t.string().min(1),
26
+ label: t.string().min(1),
27
+ description: t.string().optional()
28
+ }), b = t.object({
29
+ label: t.string().optional(),
30
+ text: t.string().min(1),
31
+ tone: x.optional()
32
+ }), p = {
33
+ eyebrow: t.string().optional(),
34
+ headline: t.string().min(1),
35
+ summary: t.string().optional(),
36
+ followUps: t.array(M).max(3).optional(),
37
+ sources: t.array(W).max(8).optional()
38
+ }, A = t.object({
39
+ value: t.string().min(1),
40
+ detail: t.string().optional(),
41
+ tone: x.optional()
42
+ }), F = t.object({
43
+ ...p,
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() })
48
+ ]),
49
+ rows: t.array(
50
+ t.object({
51
+ label: t.string().min(1),
52
+ values: t.tuple([A, A]),
53
+ delta: t.object({
54
+ value: t.string().min(1),
55
+ tone: x.optional()
56
+ }).optional()
57
+ })
58
+ ).min(1).max(8),
59
+ takeaway: b.optional()
60
+ }), v = t.enum([
61
+ "primary",
62
+ "success",
63
+ "warning",
64
+ "danger",
65
+ "info"
66
+ ]), H = t.discriminatedUnion("kind", [
67
+ t.object({
68
+ kind: t.literal("line"),
69
+ value: t.union([t.number(), t.string()]),
70
+ axis: t.enum(["x", "y"]).optional(),
71
+ label: t.string().optional(),
72
+ color: v.optional()
73
+ }),
74
+ t.object({
75
+ kind: t.literal("band"),
76
+ from: t.union([t.number(), t.string()]),
77
+ to: t.union([t.number(), t.string()]),
78
+ axis: t.enum(["x", "y"]).optional(),
79
+ label: t.string().optional(),
80
+ color: v.optional()
81
+ }),
82
+ t.object({
83
+ kind: t.literal("point"),
84
+ x: t.union([t.number(), t.string()]),
85
+ y: t.number(),
86
+ label: t.string().min(1),
87
+ description: t.string().optional(),
88
+ color: v.optional()
89
+ })
90
+ ]), q = t.record(
91
+ t.string(),
92
+ t.union([t.string(), t.number(), t.null()])
93
+ ), G = t.object({
94
+ ...p,
95
+ kind: t.literal("trend"),
96
+ metric: t.object({
97
+ label: t.string().min(1),
98
+ value: t.string().min(1),
99
+ change: t.string().optional(),
100
+ tone: x.optional()
101
+ }).optional(),
102
+ chart: t.object({
103
+ type: t.enum(["line", "area", "bar"]),
104
+ data: t.array(q).min(1).max(100),
105
+ categoryKey: t.string().min(1),
106
+ series: t.array(t.string().min(1)).min(1).max(4),
107
+ seriesLabels: t.record(t.string(), t.string()).optional(),
108
+ highlight: t.string().optional(),
109
+ unit: t.string().optional(),
110
+ annotations: t.array(H).max(8).optional()
111
+ }),
112
+ insight: b.optional()
113
+ }), J = t.object({
114
+ ...p,
115
+ kind: t.literal("status"),
116
+ overall: t.object({
117
+ label: t.string().min(1),
118
+ value: t.string().min(1),
119
+ tone: x.optional()
120
+ }).optional(),
121
+ items: t.array(
122
+ t.object({
123
+ label: t.string().min(1),
124
+ status: t.string().min(1),
125
+ detail: t.string().optional(),
126
+ meta: t.string().optional(),
127
+ tone: x.optional()
128
+ })
129
+ ).min(1).max(12),
130
+ recommendation: b.optional()
131
+ }), Q = t.object({
132
+ ...p,
133
+ kind: t.literal("breakdown"),
134
+ total: t.object({ label: t.string().min(1), value: t.string().min(1) }).optional(),
135
+ items: t.array(
136
+ t.object({
137
+ label: t.string().min(1),
138
+ value: t.string().min(1),
139
+ share: t.number().min(0).max(100),
140
+ detail: t.string().optional(),
141
+ tone: x.optional()
142
+ })
143
+ ).min(1).max(12),
144
+ insight: b.optional()
145
+ }), X = t.object({
146
+ ...p,
147
+ kind: t.literal("explanation"),
148
+ sections: t.array(
149
+ t.object({
150
+ title: t.string().min(1),
151
+ body: t.string().optional(),
152
+ bullets: t.array(t.string().min(1)).max(5).optional()
153
+ })
154
+ ).min(1).max(6),
155
+ takeaway: b.optional()
156
+ }), Y = t.discriminatedUnion("kind", [
157
+ F,
158
+ G,
159
+ J,
160
+ Q,
161
+ X
162
+ ]), ht = {
163
+ name: I,
164
+ description: K,
165
+ inputSchema: Y
166
+ }, N = E("font-semibold tabular-nums text-foreground", {
167
+ variants: {
168
+ tone: {
169
+ default: "text-foreground",
170
+ primary: "text-brand",
171
+ success: "text-success-700",
172
+ warning: "text-warning-700",
173
+ danger: "text-danger-700",
174
+ info: "text-info-700"
175
+ }
176
+ },
177
+ defaultVariants: { tone: "default" }
178
+ }), Z = new Intl.NumberFormat("en-US", {
179
+ notation: "compact",
180
+ maximumFractionDigits: 1
181
+ }), U = (a) => a === "success" || a === "warning" || a === "danger" || a === "info" ? a : "default", tt = (a) => a === "success" || a === "warning" || a === "danger" || a === "info" ? a : "primary";
182
+ function f({ spec: a }) {
183
+ return /* @__PURE__ */ i("div", { className: "space-y-2", children: [
184
+ a.eyebrow && /* @__PURE__ */ e("p", { className: "text-xs font-semibold uppercase tracking-wider text-tertiary", children: a.eyebrow }),
185
+ /* @__PURE__ */ e("h2", { className: "max-w-2xl text-xl font-bold leading-tight tracking-tight text-foreground", children: a.headline }),
186
+ a.summary && /* @__PURE__ */ e("p", { className: "max-w-2xl text-sm leading-6 text-secondary", children: a.summary })
187
+ ] });
188
+ }
189
+ function y({ signal: a }) {
190
+ return /* @__PURE__ */ i(B, { variant: U(a.tone), children: [
191
+ /* @__PURE__ */ e(L, { children: a.label ?? "Takeaway" }),
192
+ /* @__PURE__ */ e($, { children: a.text })
193
+ ] });
194
+ }
195
+ function w({
196
+ followUps: a,
197
+ sources: r,
198
+ onFollowUp: s,
199
+ onSourceSelect: o
200
+ }) {
201
+ return !(a != null && a.length) && !(r != null && r.length) ? null : /* @__PURE__ */ i("div", { className: "space-y-3 pt-1", children: [
202
+ !!(a != null && a.length) && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: a.map((l) => /* @__PURE__ */ e(
203
+ O,
204
+ {
205
+ type: "button",
206
+ disabled: !s,
207
+ onClick: () => s == null ? void 0 : s(l),
208
+ children: l.label
209
+ },
210
+ l.id
211
+ )) }),
212
+ !!(r != null && r.length) && /* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-1.5", children: [
213
+ /* @__PURE__ */ e("span", { className: "mr-1 text-xs font-medium text-tertiary", children: "Sources" }),
214
+ r.map(
215
+ (l) => o ? /* @__PURE__ */ e(
216
+ D,
217
+ {
218
+ type: "button",
219
+ size: "xs",
220
+ variant: "ghost",
221
+ title: l.description,
222
+ className: "h-6 rounded-full px-2 text-muted-foreground",
223
+ onClick: () => o(l),
224
+ children: l.label
225
+ },
226
+ l.id
227
+ ) : /* @__PURE__ */ e(g, { variant: "soft", title: l.description, children: l.label }, l.id)
228
+ )
229
+ ] })
230
+ ] });
231
+ }
232
+ const j = h.forwardRef(({ spec: a, onFollowUp: r, onSourceSelect: s, className: o, ...l }, d) => /* @__PURE__ */ i(
233
+ "div",
234
+ {
235
+ ref: d,
236
+ "data-answer-kind": a.kind,
237
+ className: c("w-full max-w-2xl space-y-5", o),
238
+ ...l,
239
+ children: [
240
+ /* @__PURE__ */ e(f, { spec: a }),
241
+ /* @__PURE__ */ e("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: [
242
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ i("tr", { children: [
243
+ /* @__PURE__ */ e("th", { className: "w-2/5 px-3 py-2 text-xs font-medium text-tertiary", children: "Measure" }),
244
+ a.subjects.map((n) => /* @__PURE__ */ i("th", { className: "px-3 py-2 align-bottom", children: [
245
+ /* @__PURE__ */ e("span", { className: "block text-sm font-semibold text-foreground", children: n.label }),
246
+ n.description && /* @__PURE__ */ e("span", { className: "mt-0.5 block text-xs font-normal text-tertiary", children: n.description })
247
+ ] }, n.label))
248
+ ] }) }),
249
+ /* @__PURE__ */ e("tbody", { children: a.rows.map((n) => /* @__PURE__ */ i("tr", { className: "[&>*]:bg-muted/60", children: [
250
+ /* @__PURE__ */ i("th", { className: "rounded-l-xl px-3 py-3 text-xs font-medium text-secondary", children: [
251
+ /* @__PURE__ */ e("span", { children: n.label }),
252
+ n.delta && /* @__PURE__ */ e(
253
+ "span",
254
+ {
255
+ className: c(
256
+ N({ tone: n.delta.tone }),
257
+ "ml-2 text-xs"
258
+ ),
259
+ children: n.delta.value
260
+ }
261
+ )
262
+ ] }),
263
+ n.values.map((m, u) => /* @__PURE__ */ i(
264
+ "td",
265
+ {
266
+ className: c(
267
+ "px-3 py-3 align-top last:rounded-r-xl",
268
+ N({ tone: m.tone })
269
+ ),
270
+ children: [
271
+ /* @__PURE__ */ e("span", { className: "block text-sm", children: m.value }),
272
+ m.detail && /* @__PURE__ */ e("span", { className: "mt-0.5 block text-xs font-normal text-tertiary", children: m.detail })
273
+ ]
274
+ },
275
+ `${n.label}-${a.subjects[u].label}`
276
+ ))
277
+ ] }, n.label)) })
278
+ ] }) }),
279
+ a.takeaway && /* @__PURE__ */ e(y, { signal: a.takeaway }),
280
+ /* @__PURE__ */ e(
281
+ w,
282
+ {
283
+ followUps: a.followUps,
284
+ sources: a.sources,
285
+ onFollowUp: r,
286
+ onSourceSelect: s
287
+ }
288
+ )
289
+ ]
290
+ }
291
+ ));
292
+ j.displayName = "ComparisonAnswer";
293
+ const S = h.forwardRef(
294
+ ({ spec: a, onFollowUp: r, onSourceSelect: s, className: o, ...l }, d) => {
295
+ const n = h.useMemo(
296
+ () => a.chart.unit ? (u) => `${Z.format(u)}${a.chart.unit}` : void 0,
297
+ [a.chart.unit]
298
+ ), m = {
299
+ data: a.chart.data,
300
+ categoryKey: a.chart.categoryKey,
301
+ series: a.chart.series,
302
+ seriesLabels: a.chart.seriesLabels,
303
+ highlight: a.chart.highlight,
304
+ annotations: a.chart.annotations,
305
+ formatValue: n,
306
+ height: 224
307
+ };
308
+ return /* @__PURE__ */ i(
309
+ "div",
310
+ {
311
+ ref: d,
312
+ "data-answer-kind": a.kind,
313
+ className: c("w-full max-w-2xl space-y-5", o),
314
+ ...l,
315
+ children: [
316
+ /* @__PURE__ */ i("div", { className: "flex flex-col justify-between gap-4 sm:flex-row sm:items-end", children: [
317
+ /* @__PURE__ */ e(f, { spec: a }),
318
+ a.metric && /* @__PURE__ */ i("div", { className: "shrink-0 rounded-xl bg-muted px-4 py-3 sm:text-right", children: [
319
+ /* @__PURE__ */ e("p", { className: "text-xs font-medium text-tertiary", children: a.metric.label }),
320
+ /* @__PURE__ */ e(
321
+ "p",
322
+ {
323
+ className: c(
324
+ N({ tone: a.metric.tone }),
325
+ "mt-1 text-2xl tracking-tight"
326
+ ),
327
+ children: a.metric.value
328
+ }
329
+ ),
330
+ a.metric.change && /* @__PURE__ */ e("p", { className: "mt-0.5 text-xs text-secondary", children: a.metric.change })
331
+ ] })
332
+ ] }),
333
+ /* @__PURE__ */ e("div", { className: "rounded-2xl bg-surface px-3 pb-2 pt-4 sm:px-4", children: a.chart.type === "area" ? /* @__PURE__ */ e(V, { ...m }) : a.chart.type === "bar" ? /* @__PURE__ */ e(_, { ...m }) : /* @__PURE__ */ e(z, { ...m }) }),
334
+ a.insight && /* @__PURE__ */ e(y, { signal: a.insight }),
335
+ /* @__PURE__ */ e(
336
+ w,
337
+ {
338
+ followUps: a.followUps,
339
+ sources: a.sources,
340
+ onFollowUp: r,
341
+ onSourceSelect: s
342
+ }
343
+ )
344
+ ]
345
+ }
346
+ );
347
+ }
348
+ );
349
+ S.displayName = "TrendAnswer";
350
+ const C = h.forwardRef(
351
+ ({ spec: a, onFollowUp: r, onSourceSelect: s, className: o, ...l }, d) => /* @__PURE__ */ i(
352
+ "div",
353
+ {
354
+ ref: d,
355
+ "data-answer-kind": a.kind,
356
+ className: c("w-full max-w-2xl space-y-5", o),
357
+ ...l,
358
+ children: [
359
+ /* @__PURE__ */ i("div", { className: "flex flex-col justify-between gap-3 sm:flex-row sm:items-start", children: [
360
+ /* @__PURE__ */ e(f, { spec: a }),
361
+ a.overall && /* @__PURE__ */ i(
362
+ g,
363
+ {
364
+ variant: "soft",
365
+ color: a.overall.tone ?? "default",
366
+ className: "self-start",
367
+ children: [
368
+ a.overall.label,
369
+ " · ",
370
+ a.overall.value
371
+ ]
372
+ }
373
+ )
374
+ ] }),
375
+ /* @__PURE__ */ e("ul", { className: "space-y-2", children: a.items.map((n) => /* @__PURE__ */ i(
376
+ "li",
377
+ {
378
+ className: "flex items-start justify-between gap-4 rounded-xl bg-surface px-4 py-3",
379
+ children: [
380
+ /* @__PURE__ */ i("div", { className: "min-w-0", children: [
381
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium text-foreground", children: n.label }),
382
+ n.detail && /* @__PURE__ */ e("p", { className: "mt-1 text-xs leading-5 text-secondary", children: n.detail })
383
+ ] }),
384
+ /* @__PURE__ */ i("div", { className: "shrink-0 text-right", children: [
385
+ /* @__PURE__ */ e(g, { variant: "dot", color: n.tone ?? "default", children: n.status }),
386
+ n.meta && /* @__PURE__ */ e("p", { className: "mt-1 text-xs tabular-nums text-tertiary", children: n.meta })
387
+ ] })
388
+ ]
389
+ },
390
+ n.label
391
+ )) }),
392
+ a.recommendation && /* @__PURE__ */ e(y, { signal: a.recommendation }),
393
+ /* @__PURE__ */ e(
394
+ w,
395
+ {
396
+ followUps: a.followUps,
397
+ sources: a.sources,
398
+ onFollowUp: r,
399
+ onSourceSelect: s
400
+ }
401
+ )
402
+ ]
403
+ }
404
+ )
405
+ );
406
+ C.displayName = "StatusAnswer";
407
+ const R = h.forwardRef(({ spec: a, onFollowUp: r, onSourceSelect: s, className: o, ...l }, d) => /* @__PURE__ */ i(
408
+ "div",
409
+ {
410
+ ref: d,
411
+ "data-answer-kind": a.kind,
412
+ className: c("w-full max-w-2xl space-y-5", o),
413
+ ...l,
414
+ children: [
415
+ /* @__PURE__ */ i("div", { className: "flex flex-col justify-between gap-3 sm:flex-row sm:items-end", children: [
416
+ /* @__PURE__ */ e(f, { spec: a }),
417
+ a.total && /* @__PURE__ */ i("div", { className: "shrink-0 sm:text-right", children: [
418
+ /* @__PURE__ */ e("p", { className: "text-xs font-medium text-tertiary", children: a.total.label }),
419
+ /* @__PURE__ */ e("p", { className: "mt-1 text-2xl font-semibold tabular-nums tracking-tight text-foreground", children: a.total.value })
420
+ ] })
421
+ ] }),
422
+ /* @__PURE__ */ e("ol", { className: "space-y-2", children: a.items.map((n, m) => /* @__PURE__ */ i("li", { className: "rounded-xl bg-surface px-4 py-3", children: [
423
+ /* @__PURE__ */ i("div", { className: "mb-2 flex items-start justify-between gap-4", children: [
424
+ /* @__PURE__ */ i("div", { className: "flex min-w-0 items-start gap-2.5", children: [
425
+ /* @__PURE__ */ e(g, { variant: "soft", className: "mt-0.5 tabular-nums", children: m + 1 }),
426
+ /* @__PURE__ */ i("div", { className: "min-w-0", children: [
427
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium text-foreground", children: n.label }),
428
+ n.detail && /* @__PURE__ */ e("p", { className: "mt-0.5 text-xs text-tertiary", children: n.detail })
429
+ ] })
430
+ ] }),
431
+ /* @__PURE__ */ i("div", { className: "shrink-0 text-right", children: [
432
+ /* @__PURE__ */ e("p", { className: c(N({ tone: n.tone }), "text-sm"), children: n.value }),
433
+ /* @__PURE__ */ i("p", { className: "mt-0.5 text-xs tabular-nums text-tertiary", children: [
434
+ n.share,
435
+ "%"
436
+ ] })
437
+ ] })
438
+ ] }),
439
+ /* @__PURE__ */ e(
440
+ P,
441
+ {
442
+ value: n.share,
443
+ size: "sm",
444
+ color: tt(n.tone),
445
+ label: `${n.label}: ${n.share}%`
446
+ }
447
+ )
448
+ ] }, n.label)) }),
449
+ a.insight && /* @__PURE__ */ e(y, { signal: a.insight }),
450
+ /* @__PURE__ */ e(
451
+ w,
452
+ {
453
+ followUps: a.followUps,
454
+ sources: a.sources,
455
+ onFollowUp: r,
456
+ onSourceSelect: s
457
+ }
458
+ )
459
+ ]
460
+ }
461
+ ));
462
+ R.displayName = "BreakdownAnswer";
463
+ const T = h.forwardRef(({ spec: a, onFollowUp: r, onSourceSelect: s, className: o, ...l }, d) => /* @__PURE__ */ i(
464
+ "div",
465
+ {
466
+ ref: d,
467
+ "data-answer-kind": a.kind,
468
+ className: c("w-full max-w-2xl space-y-5", o),
469
+ ...l,
470
+ children: [
471
+ /* @__PURE__ */ e(f, { spec: a }),
472
+ /* @__PURE__ */ e("ol", { className: "space-y-2", children: a.sections.map((n, m) => {
473
+ var u;
474
+ return /* @__PURE__ */ i("li", { className: "flex gap-3 rounded-xl bg-surface px-4 py-3.5", children: [
475
+ /* @__PURE__ */ e(g, { variant: "soft", className: "mt-0.5 h-fit tabular-nums", children: m + 1 }),
476
+ /* @__PURE__ */ i("div", { className: "min-w-0", children: [
477
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-foreground", children: n.title }),
478
+ n.body && /* @__PURE__ */ e("p", { className: "mt-1 text-sm leading-6 text-secondary", children: n.body }),
479
+ !!((u = n.bullets) != null && u.length) && /* @__PURE__ */ e("ul", { className: "mt-2 space-y-1.5", children: n.bullets.map((k) => /* @__PURE__ */ i("li", { className: "flex items-start gap-2 text-xs leading-5 text-secondary", children: [
480
+ /* @__PURE__ */ e(
481
+ "span",
482
+ {
483
+ "aria-hidden": !0,
484
+ className: "mt-2 size-1 shrink-0 rounded-dot bg-muted-foreground"
485
+ }
486
+ ),
487
+ /* @__PURE__ */ e("span", { children: k })
488
+ ] }, k)) })
489
+ ] })
490
+ ] }, n.title);
491
+ }) }),
492
+ a.takeaway && /* @__PURE__ */ e(y, { signal: a.takeaway }),
493
+ /* @__PURE__ */ e(
494
+ w,
495
+ {
496
+ followUps: a.followUps,
497
+ sources: a.sources,
498
+ onFollowUp: r,
499
+ onSourceSelect: s
500
+ }
501
+ )
502
+ ]
503
+ }
504
+ ));
505
+ T.displayName = "ExplanationAnswer";
506
+ const at = h.forwardRef(
507
+ ({ spec: a, ...r }, s) => {
508
+ switch (a.kind) {
509
+ case "comparison":
510
+ return /* @__PURE__ */ e(j, { ref: s, spec: a, ...r });
511
+ case "trend":
512
+ return /* @__PURE__ */ e(S, { ref: s, spec: a, ...r });
513
+ case "status":
514
+ return /* @__PURE__ */ e(C, { ref: s, spec: a, ...r });
515
+ case "breakdown":
516
+ return /* @__PURE__ */ e(R, { ref: s, spec: a, ...r });
517
+ case "explanation":
518
+ return /* @__PURE__ */ e(T, { ref: s, spec: a, ...r });
519
+ }
520
+ }
521
+ );
522
+ at.displayName = "AnswerRenderer";
523
+ export {
524
+ K as ANSWER_TOOL_DESCRIPTION,
525
+ I as ANSWER_TOOL_NAME,
526
+ M as AnswerFollowUpSchema,
527
+ at as AnswerRenderer,
528
+ b as AnswerSignalSchema,
529
+ W as AnswerSourceSchema,
530
+ Y as AnswerSpecSchema,
531
+ x as AnswerToneSchema,
532
+ R as BreakdownAnswer,
533
+ Q as BreakdownAnswerSchema,
534
+ j as ComparisonAnswer,
535
+ F as ComparisonAnswerSchema,
536
+ T as ExplanationAnswer,
537
+ X as ExplanationAnswerSchema,
538
+ C as StatusAnswer,
539
+ J as StatusAnswerSchema,
540
+ S as TrendAnswer,
541
+ G as TrendAnswerSchema,
542
+ ht as answerTool
543
+ };
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ export declare const AssistantActionBar: FC;
3
+ export declare const UserActionBar: FC;
@@ -0,0 +1,57 @@
1
+ "use client";
2
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
3
+ import { MessageTiming as s } from "./message-timing.js";
4
+ import { TooltipIconButton as i } from "./tooltip-icon-button.js";
5
+ import { ActionBarPrimitive as t, AuiIf as r, ActionBarMorePrimitive as a } from "@assistant-ui/react";
6
+ import { Check as d, Copy as l, Refresh as c, MoreHorizontal as m, Download as u, Pencil as h } from "../../lib/icons.js";
7
+ const C = () => /* @__PURE__ */ o(
8
+ t.Root,
9
+ {
10
+ hideWhenRunning: !0,
11
+ autohide: "not-last",
12
+ className: "aui-assistant-action-bar-root text-muted-foreground animate-in fade-in col-start-3 row-start-2 -ms-1 flex gap-1 duration-(--duration-normal)",
13
+ children: [
14
+ /* @__PURE__ */ e(t.Copy, { asChild: !0, children: /* @__PURE__ */ o(i, { tooltip: "Copy", children: [
15
+ /* @__PURE__ */ e(r, { condition: (n) => n.message.isCopied, children: /* @__PURE__ */ e(d, { className: "animate-in zoom-in-95 fade-in duration-(--duration-normal) ease-out motion-reduce:animate-none" }) }),
16
+ /* @__PURE__ */ e(r, { condition: (n) => !n.message.isCopied, children: /* @__PURE__ */ e(l, { className: "animate-in zoom-in-95 fade-in duration-(--duration-fast) ease-out motion-reduce:animate-none" }) })
17
+ ] }) }),
18
+ /* @__PURE__ */ e(t.Reload, { asChild: !0, children: /* @__PURE__ */ e(i, { tooltip: "Refresh", children: /* @__PURE__ */ e(c, {}) }) }),
19
+ /* @__PURE__ */ e(s, {}),
20
+ /* @__PURE__ */ o(a.Root, { children: [
21
+ /* @__PURE__ */ e(a.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
22
+ i,
23
+ {
24
+ tooltip: "More",
25
+ className: "data-[state=open]:bg-accent",
26
+ children: /* @__PURE__ */ e(m, {})
27
+ }
28
+ ) }),
29
+ /* @__PURE__ */ e(
30
+ a.Content,
31
+ {
32
+ side: "bottom",
33
+ align: "start",
34
+ sideOffset: 6,
35
+ className: "aui-action-bar-more-content bg-popover/95 text-popover-foreground data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:animate-out data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-xl border p-1.5 shadow-lg backdrop-blur-sm",
36
+ children: /* @__PURE__ */ e(t.ExportMarkdown, { asChild: !0, children: /* @__PURE__ */ o(a.Item, { className: "aui-action-bar-more-item hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground flex cursor-pointer items-center gap-2 rounded-lg px-2.5 py-1.5 text-xs outline-none select-none", children: [
37
+ /* @__PURE__ */ e(u, { className: "size-4" }),
38
+ "Export as Markdown"
39
+ ] }) })
40
+ }
41
+ )
42
+ ] })
43
+ ]
44
+ }
45
+ ), N = () => /* @__PURE__ */ e(
46
+ t.Root,
47
+ {
48
+ hideWhenRunning: !0,
49
+ autohide: "not-last",
50
+ className: "aui-user-action-bar-root flex flex-col items-end",
51
+ children: /* @__PURE__ */ e(t.Edit, { asChild: !0, children: /* @__PURE__ */ e(i, { tooltip: "Edit", className: "aui-user-action-edit", children: /* @__PURE__ */ e(h, {}) }) })
52
+ }
53
+ );
54
+ export {
55
+ C as AssistantActionBar,
56
+ N as UserActionBar
57
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Registers ADS's validated `render_answer` contract with assistant-ui.
3
+ * `Thread` mounts it by default; export remains public for custom shells.
4
+ */
5
+ export declare const RenderAnswerToolUI: import('@assistant-ui/react').AssistantToolUI;
@@ -0,0 +1,42 @@
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
+ ] });
17
+ }
18
+ function f({ spec: s }) {
19
+ const r = i(), t = a.useCallback(
20
+ (o) => {
21
+ r.thread.append({
22
+ role: "user",
23
+ content: [{ type: "text", text: o.prompt ?? o.label }]
24
+ });
25
+ },
26
+ [r]
27
+ );
28
+ return /* @__PURE__ */ e(p, { spec: s, onFollowUp: t });
29
+ }
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." })
37
+ ] });
38
+ }
39
+ });
40
+ export {
41
+ b as RenderAnswerToolUI
42
+ };