@actioneer/ads 0.2.3 → 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 (70) hide show
  1. package/components/ai-elements/chain-of-thought.d.ts +88 -19
  2. package/components/ai-elements/chain-of-thought.js +358 -149
  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 -1
  6. package/components/ai-elements/message.d.ts +19 -4
  7. package/components/ai-elements/message.js +177 -130
  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/task-progress.js +69 -66
  11. package/components/ai-elements/tool.js +42 -38
  12. package/components/answer.d.ts +19 -0
  13. package/components/answer.js +363 -300
  14. package/components/assistant-ui/attachment.js +5 -1
  15. package/components/assistant-ui/composer-deep-research.js +44 -29
  16. package/components/assistant-ui/composer-harness.js +55 -38
  17. package/components/assistant-ui/composer.js +16 -16
  18. package/components/assistant-ui/index.d.ts +0 -1
  19. package/components/assistant-ui/message.d.ts +7 -0
  20. package/components/assistant-ui/message.js +64 -51
  21. package/components/assistant-ui/primitives.d.ts +1 -1
  22. package/components/assistant-ui/thread-context.d.ts +2 -0
  23. package/components/assistant-ui/thread.js +34 -32
  24. package/components/brand-texture.d.ts +37 -0
  25. package/components/brand-texture.js +54 -0
  26. package/components/chart.d.ts +64 -2
  27. package/components/chart.js +717 -456
  28. package/components/code-block.d.ts +36 -0
  29. package/components/code-block.js +136 -0
  30. package/components/command-palette.d.ts +43 -0
  31. package/components/command-palette.js +146 -0
  32. package/components/drawer.d.ts +1 -1
  33. package/components/file-dropzone.d.ts +32 -0
  34. package/components/file-dropzone.js +134 -0
  35. package/components/index.d.ts +11 -0
  36. package/components/index.js +480 -430
  37. package/components/infinite-canvas.d.ts +50 -0
  38. package/components/infinite-canvas.js +215 -0
  39. package/components/page-header.d.ts +22 -0
  40. package/components/page-header.js +52 -0
  41. package/components/resizable-panel.d.ts +29 -0
  42. package/components/resizable-panel.js +102 -0
  43. package/components/reveal.d.ts +36 -0
  44. package/components/reveal.js +35 -0
  45. package/components/scroll-area.d.ts +19 -0
  46. package/components/scroll-area.js +57 -0
  47. package/components/setting-row.d.ts +35 -0
  48. package/components/setting-row.js +86 -0
  49. package/components/sidebar.d.ts +4 -1
  50. package/components/sidebar.js +134 -132
  51. package/components/stepper.d.ts +32 -0
  52. package/components/stepper.js +113 -0
  53. package/components/table.js +16 -15
  54. package/components/tabs.js +1 -1
  55. package/hooks/agents-ui/voice-visualizer-types.js +1 -0
  56. package/lib/icons.d.ts +24 -0
  57. package/lib/icons.js +100 -110
  58. package/lib/motion.d.ts +5 -3
  59. package/lib/motion.js +46 -20
  60. package/lib/router.js +19 -0
  61. package/lib/utils.js +5 -0
  62. package/llms.txt +143 -39
  63. package/manifest.json +1232 -100
  64. package/package.json +2 -2
  65. package/styles.css +71 -28
  66. package/theme.css +19 -15
  67. package/components/ai-elements/reasoning.d.ts +0 -26
  68. package/components/ai-elements/reasoning.js +0 -131
  69. package/components/assistant-ui/smart-message-text.d.ts +0 -15
  70. package/components/assistant-ui/smart-message-text.js +0 -29
@@ -195,7 +195,11 @@ const V = (a) => {
195
195
  side: "top",
196
196
  children: /* @__PURE__ */ e(R, { className: "aui-attachment-remove-icon size-3 dark:stroke-[2.5px]" })
197
197
  }
198
- ) }), we = () => /* @__PURE__ */ e("div", { className: "aui-user-message-attachments-end col-span-full col-start-1 row-start-1 flex w-full flex-row justify-end gap-2", children: /* @__PURE__ */ e(M.Attachments, { children: () => /* @__PURE__ */ e(I, {}) }) }), Ce = () => /* @__PURE__ */ e("div", { className: "aui-composer-attachments flex w-full flex-row items-center gap-2 overflow-x-auto empty:hidden", children: /* @__PURE__ */ e(T.Attachments, { children: () => /* @__PURE__ */ e(I, {}) }) }), ke = () => /* @__PURE__ */ e(T.AddAttachment, { asChild: !0, children: /* @__PURE__ */ e(
198
+ ) }), we = () => (
199
+ // Sits under the request as its parameters, so it reads left-to-right
200
+ // with the question rather than trailing off the right edge.
201
+ /* @__PURE__ */ e("div", { className: "aui-user-message-attachments-end mt-2.5 flex w-full flex-row flex-wrap justify-start gap-2 empty:hidden", children: /* @__PURE__ */ e(M.Attachments, { children: () => /* @__PURE__ */ e(I, {}) }) })
202
+ ), Ce = () => /* @__PURE__ */ e("div", { className: "aui-composer-attachments flex w-full flex-row items-center gap-2 overflow-x-auto empty:hidden", children: /* @__PURE__ */ e(T.Attachments, { children: () => /* @__PURE__ */ e(I, {}) }) }), ke = () => /* @__PURE__ */ e(T.AddAttachment, { asChild: !0, children: /* @__PURE__ */ e(
199
203
  g,
200
204
  {
201
205
  tooltip: "Add Attachment",
@@ -1,38 +1,53 @@
1
1
  "use client";
2
- import { jsxs as s, jsx as o } from "react/jsx-runtime";
3
- import { createContext as i, useContext as u } from "react";
2
+ import { jsxs as s, jsx as r } from "react/jsx-runtime";
3
+ import { createContext as u, useContext as a } from "react";
4
4
  import { Telescope as c } from "../../lib/icons.js";
5
- import { cn as f } from "../../lib/cn.js";
6
- const t = i(null);
7
- function x({
8
- value: r,
5
+ import { cn as n } from "../../lib/cn.js";
6
+ const t = u(null);
7
+ function p({
8
+ value: o,
9
9
  children: e
10
10
  }) {
11
- return /* @__PURE__ */ o(t.Provider, { value: r, children: e });
11
+ return /* @__PURE__ */ r(t.Provider, { value: o, children: e });
12
12
  }
13
- function a() {
14
- const r = u(t);
15
- if (!r) return null;
16
- const { enabled: e, setEnabled: n } = r;
17
- return /* @__PURE__ */ s(
18
- "button",
19
- {
20
- type: "button",
21
- "aria-pressed": e,
22
- onClick: () => n(!e),
23
- className: f(
24
- "flex h-7 shrink-0 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium outline-none transition-colors",
25
- "focus-visible:ring-3 focus-visible:ring-ring [&_svg]:size-4 [&_svg]:shrink-0",
26
- e ? "bg-info-50 text-info-700 hover:bg-info-100" : "text-muted-foreground hover:bg-muted-foreground/15 hover:text-foreground"
27
- ),
28
- children: [
29
- /* @__PURE__ */ o(c, {}),
30
- "Deep research"
31
- ]
32
- }
13
+ function x() {
14
+ const o = a(t);
15
+ if (!o) return null;
16
+ const { enabled: e, setEnabled: i } = o;
17
+ return (
18
+ // Toggle affordance: the trailing square state light says "this switches
19
+ // a mode on and off" — the counterpart to the harness menu's caret, so
20
+ // the trailing slot alone tells the reader how each pill interacts.
21
+ /* @__PURE__ */ s(
22
+ "button",
23
+ {
24
+ type: "button",
25
+ "aria-pressed": e,
26
+ onClick: () => i(!e),
27
+ className: n(
28
+ "flex h-7 shrink-0 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium outline-none transition-colors",
29
+ "focus-visible:ring-3 focus-visible:ring-ring",
30
+ e ? "bg-info-50 text-info-700 hover:bg-info-100" : "text-muted-foreground hover:bg-muted-foreground/15 hover:text-foreground"
31
+ ),
32
+ children: [
33
+ /* @__PURE__ */ r(c, { className: "size-4 shrink-0" }),
34
+ "Deep research",
35
+ /* @__PURE__ */ r(
36
+ "span",
37
+ {
38
+ "aria-hidden": !0,
39
+ className: n(
40
+ "size-1.5 shrink-0 rounded-dot transition-colors duration-(--duration-fast) ease-out motion-reduce:transition-none",
41
+ e ? "bg-info-600" : "bg-muted-foreground/40"
42
+ )
43
+ }
44
+ )
45
+ ]
46
+ }
47
+ )
33
48
  );
34
49
  }
35
50
  export {
36
- a as ComposerDeepResearch,
37
- x as DeepResearchProvider
51
+ x as ComposerDeepResearch,
52
+ p as DeepResearchProvider
38
53
  };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  var c = Object.defineProperty;
3
- var l = (e, t, o) => t in e ? c(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
4
- var p = (e, t, o) => l(e, typeof t != "symbol" ? t + "" : t, o);
5
- import { jsxs as m, jsx as r } from "react/jsx-runtime";
3
+ var l = (r, t, o) => t in r ? c(r, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[t] = o;
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";
6
6
  import { useComposerRuntime as d, useComposer as u } from "@assistant-ui/react";
7
7
  import "clsx";
8
8
  import "tailwind-merge";
@@ -10,11 +10,18 @@ import "../../lib/interactive.js";
10
10
  import "radix-ui";
11
11
  import "../button.js";
12
12
  import "../spinner.js";
13
+ import "../reveal.js";
13
14
  import "../field.js";
14
15
  import "../typography.js";
15
16
  import "../link.js";
16
17
  import "../divider.js";
17
18
  import "../kbd.js";
19
+ import "../code-block.js";
20
+ import "../setting-row.js";
21
+ import "../file-dropzone.js";
22
+ import "../scroll-area.js";
23
+ import "../stepper.js";
24
+ import "../resizable-panel.js";
18
25
  import "../input.js";
19
26
  import "../input-field.js";
20
27
  import "../textarea.js";
@@ -27,18 +34,20 @@ import "../autocomplete.js";
27
34
  import "../slider.js";
28
35
  import "../segmented.js";
29
36
  import "../modal.js";
30
- import "../drawer.js";
31
- import "../popover.js";
32
37
  import "react";
33
38
  import "react-dom";
39
+ import { Bolt as a, ChevronDown as f, CheckList as h, Sparkles as g } from "../../lib/icons.js";
40
+ import "../drawer.js";
41
+ import "../popover.js";
34
42
  import "motion/react";
35
- import { Dropdown as f, DropdownTrigger as h, DropdownContent as g, DropdownLabel as b, DropdownItem as v } from "../dropdown.js";
43
+ import { Dropdown as b, DropdownTrigger as v, DropdownContent as y, DropdownLabel as x, DropdownItem as w } from "../dropdown.js";
36
44
  import "../toast.js";
37
45
  import "../answer.js";
38
46
  import "../card.js";
39
47
  import "../carousel.js";
40
48
  import "../chart.js";
41
49
  import "../connector-card.js";
50
+ import "../infinite-canvas.js";
42
51
  import "../table.js";
43
52
  import "../tabs.js";
44
53
  import "../tree.js";
@@ -49,10 +58,12 @@ import "../chip.js";
49
58
  import "../timeline.js";
50
59
  import "../alert.js";
51
60
  import "../pixel-blast-svg.js";
61
+ import "../brand-texture.js";
52
62
  import "../progress.js";
53
63
  import "../progress-circle.js";
54
64
  import "../skeleton.js";
55
65
  import "../empty-state.js";
66
+ import "../page-header.js";
56
67
  import "../navbar.js";
57
68
  import "../breadcrumbs.js";
58
69
  import "../pagination.js";
@@ -61,10 +72,10 @@ import "../panel.js";
61
72
  import "../collapsible.js";
62
73
  import "../selection-action-bar.js";
63
74
  import "../ai-elements/chain-of-thought.js";
75
+ import "../ai-elements/chart.js";
64
76
  import "../ai-elements/inline-citation.js";
65
77
  import "../ai-elements/message.js";
66
- import { Bolt as s, CheckList as x, Sparkles as y } from "../../lib/icons.js";
67
- import "../ai-elements/reasoning.js";
78
+ import "../ai-elements/research-activity.js";
68
79
  import "../ai-elements/shimmer.js";
69
80
  import "../ai-elements/task.js";
70
81
  import "../ai-elements/task-progress.js";
@@ -73,73 +84,79 @@ import "../ai-elements/voice.js";
73
84
  import "./composer.js";
74
85
  import "./answer-tool-ui.js";
75
86
  import "./follow-up-suggestions.js";
76
- import "./composer-add-context.js";
77
- import "zustand/shallow";
87
+ import "./message.js";
88
+ import "./selection-toolbar.js";
78
89
  import "../ui/button.js";
79
- import "./tooltip-icon-button.js";
80
- import "./quote.js";
81
- import "./reasoning.js";
82
- import "./smart-message-text.js";
83
90
  import "./thread-context.js";
84
- import "./tool-fallback.js";
85
- import "./tool-group.js";
86
- import "./selection-toolbar.js";
91
+ import "./tooltip-icon-button.js";
92
+ import "./composer-add-context.js";
93
+ import "zustand/shallow";
87
94
  import "./composer-deep-research.js";
88
95
  import "./composer-trigger-popover.js";
89
96
  import "./directive-text.js";
90
97
  import "./file.js";
91
98
  import "./image.js";
92
99
  import "./markdown-text.js";
100
+ import "./quote.js";
93
101
  import "./sources.js";
94
- const n = "application/x-actioneer-harness", w = [
102
+ import "./tool-fallback.js";
103
+ import "./tool-group.js";
104
+ const n = "application/x-actioneer-harness", S = [
95
105
  {
96
106
  id: "investigate",
97
107
  label: "Data investigation",
98
- icon: /* @__PURE__ */ r(s, {}),
108
+ icon: /* @__PURE__ */ e(a, {}),
99
109
  instructions: "Investigate the question against the available context. State the conclusion first, identify the relevant sources, and clearly separate verified facts from assumptions."
100
110
  },
101
111
  {
102
112
  id: "metric",
103
113
  label: "Metric analysis",
104
- icon: /* @__PURE__ */ r(x, {}),
114
+ icon: /* @__PURE__ */ e(h, {}),
105
115
  instructions: "Define the metric, grain, population, and time window before calculating. Call out comparisons, denominator changes, and any data-quality caveats."
106
116
  },
107
117
  {
108
118
  id: "brief",
109
119
  label: "Executive brief",
110
- icon: /* @__PURE__ */ r(y, {}),
120
+ icon: /* @__PURE__ */ e(g, {}),
111
121
  instructions: "Write a concise executive brief: lead with the decision or insight, use only decision-relevant evidence, and end with the recommended next action."
112
122
  }
113
123
  ];
114
- function ri() {
115
- const e = d(), t = u((i) => i.attachments), o = new Set(
124
+ function hi() {
125
+ const r = d(), t = u((i) => i.attachments), o = new Set(
116
126
  t.filter((i) => i.contentType === n).map((i) => i.name)
117
- ), a = (i) => {
118
- o.has(i.label) || e.addAttachment(
127
+ ), s = (i) => {
128
+ o.has(i.label) || r.addAttachment(
119
129
  new File([i.instructions], `${i.label}.harness`, { type: n })
120
130
  );
121
131
  };
122
- return /* @__PURE__ */ m(f, { children: [
123
- /* @__PURE__ */ r(h, { children: /* @__PURE__ */ m(
132
+ return /* @__PURE__ */ m(b, { children: [
133
+ /* @__PURE__ */ e(v, { children: /* @__PURE__ */ m(
124
134
  "button",
125
135
  {
126
136
  type: "button",
127
- className: "flex h-7 shrink-0 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium text-muted-foreground outline-none transition-colors hover:bg-muted-foreground/15 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring [&_svg]:size-4 [&_svg]:shrink-0",
137
+ className: "group flex h-7 shrink-0 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium text-muted-foreground outline-none transition-colors hover:bg-muted-foreground/15 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring",
128
138
  "aria-label": "Add harness",
129
139
  children: [
130
- /* @__PURE__ */ r(s, {}),
131
- "Add harness"
140
+ /* @__PURE__ */ e(a, { className: "size-4 shrink-0" }),
141
+ "Add harness",
142
+ /* @__PURE__ */ e(
143
+ f,
144
+ {
145
+ "aria-hidden": !0,
146
+ className: "size-3.5 shrink-0 opacity-60 transition-transform duration-(--duration-fast) ease-out group-data-[state=open]:rotate-180 motion-reduce:transition-none"
147
+ }
148
+ )
132
149
  ]
133
150
  }
134
151
  ) }),
135
- /* @__PURE__ */ m(g, { side: "top", align: "start", className: "w-56", autoFocusFirstItem: !1, children: [
136
- /* @__PURE__ */ r(b, { children: "Add a harness" }),
137
- w.map((i) => /* @__PURE__ */ r(
138
- v,
152
+ /* @__PURE__ */ m(y, { side: "top", align: "start", className: "w-56", autoFocusFirstItem: !1, children: [
153
+ /* @__PURE__ */ e(x, { children: "Add a harness" }),
154
+ S.map((i) => /* @__PURE__ */ e(
155
+ w,
139
156
  {
140
157
  startContent: i.icon,
141
158
  disabled: o.has(i.label),
142
- onSelect: () => a(i),
159
+ onSelect: () => s(i),
143
160
  children: i.label
144
161
  },
145
162
  i.id
@@ -147,7 +164,7 @@ function ri() {
147
164
  ] })
148
165
  ] });
149
166
  }
150
- class ni {
167
+ class gi {
151
168
  constructor() {
152
169
  p(this, "accept", n);
153
170
  }
@@ -180,7 +197,7 @@ ${o}
180
197
  }
181
198
  }
182
199
  export {
183
- ri as ComposerHarness,
200
+ hi as ComposerHarness,
184
201
  n as HARNESS_MIME,
185
- ni as HarnessAttachmentAdapter
202
+ gi as HarnessAttachmentAdapter
186
203
  };
@@ -18,7 +18,7 @@ function G(i) {
18
18
  Math.max(Q, i.length * O)
19
19
  );
20
20
  }
21
- function J(i, t, p, x, T) {
21
+ function J(i, t, p, b, T) {
22
22
  if (t <= 0 || i.length === 0)
23
23
  return p(i), { promise: Promise.resolve(), cancel: () => {
24
24
  } };
@@ -28,7 +28,7 @@ function J(i, t, p, x, T) {
28
28
  o = d;
29
29
  let y = performance.now(), h = null;
30
30
  const n = (c) => {
31
- if (x()) {
31
+ if (b()) {
32
32
  d();
33
33
  return;
34
34
  }
@@ -52,7 +52,7 @@ function J(i, t, p, x, T) {
52
52
  };
53
53
  }
54
54
  const W = () => {
55
- const { setText: i } = q(), t = l.useContext(k), [p, x] = l.useState(
55
+ const { setText: i } = q(), t = l.useContext(k), [p, b] = l.useState(
56
56
  (t == null ? void 0 : t[0]) ?? "Send a message…"
57
57
  ), [T, w] = l.useState(!1), v = l.useRef(null), [o, z] = l.useState(null), d = l.useRef(!1), y = l.useCallback((n) => {
58
58
  v.current = n, z(n);
@@ -87,36 +87,36 @@ const W = () => {
87
87
  }
88
88
  u();
89
89
  }
90
- }, b = (r) => {
90
+ }, x = (r) => {
91
91
  (r.metaKey || r.ctrlKey) && !r.altKey && r.key.toLowerCase() === "a" && (r.preventDefault(), o.select());
92
92
  };
93
- return a(), o.addEventListener("beforeinput", C), o.addEventListener("input", a), o.addEventListener("focus", g), o.addEventListener("blur", g), o.addEventListener("keydown", b), () => {
94
- window.clearTimeout(n), o.removeEventListener("beforeinput", C), o.removeEventListener("input", a), o.removeEventListener("focus", g), o.removeEventListener("blur", g), o.removeEventListener("keydown", b);
93
+ return a(), o.addEventListener("beforeinput", C), o.addEventListener("input", a), o.addEventListener("focus", g), o.addEventListener("blur", g), o.addEventListener("keydown", x), () => {
94
+ window.clearTimeout(n), o.removeEventListener("beforeinput", C), o.removeEventListener("input", a), o.removeEventListener("focus", g), o.removeEventListener("blur", g), o.removeEventListener("keydown", x);
95
95
  };
96
96
  }, [o, i]), l.useEffect(() => {
97
97
  var C;
98
98
  if (!(t != null && t.length)) {
99
- x("Send a message…");
99
+ b("Send a message…");
100
100
  return;
101
101
  }
102
102
  if ((C = window.matchMedia) != null && C.call(window, "(prefers-reduced-motion: reduce)").matches) {
103
- x(t[0]);
103
+ b(t[0]);
104
104
  return;
105
105
  }
106
106
  let n = !1, c = 0, a, u;
107
- const g = (b) => new Promise((r) => {
108
- a = window.setTimeout(r, b);
107
+ const g = (x) => new Promise((r) => {
108
+ a = window.setTimeout(r, x);
109
109
  }), E = () => n;
110
110
  return (async () => {
111
111
  for (; !n; ) {
112
112
  for (; d.current && !n; ) await g(100);
113
113
  if (n) return;
114
- const b = t[c];
115
- x("");
114
+ const x = t[c];
115
+ b("");
116
116
  const { promise: r, cancel: m } = J(
117
- b,
118
- G(b),
119
117
  x,
118
+ G(x),
119
+ b,
120
120
  E,
121
121
  () => d.current
122
122
  );
@@ -136,7 +136,7 @@ const W = () => {
136
136
  "div",
137
137
  {
138
138
  "aria-hidden": !0,
139
- className: "pointer-events-none absolute inset-x-2.5 top-1 z-0 flex min-h-8 items-start overflow-hidden text-base leading-8 text-muted-foreground/80 group-focus-within/input:hidden",
139
+ className: "pointer-events-none absolute inset-x-2.5 top-1 z-0 line-clamp-2 max-h-(--composer-placeholder-max-h) overflow-hidden text-base text-muted-foreground/80 group-focus-within/input:hidden",
140
140
  children: /* @__PURE__ */ e("span", { children: p })
141
141
  }
142
142
  ),
@@ -145,7 +145,7 @@ const W = () => {
145
145
  {
146
146
  ref: y,
147
147
  placeholder: t != null && t.length ? "" : p,
148
- className: "aui-composer-input caret-primary placeholder:text-muted-foreground/80 relative z-10 max-h-32 min-h-10 w-full resize-none bg-transparent px-2.5 py-1 text-base text-foreground outline-none",
148
+ className: "aui-composer-input caret-primary placeholder:text-muted-foreground/80 relative z-10 max-h-32 min-h-14 w-full resize-none bg-transparent px-2.5 py-1 text-base text-foreground outline-none",
149
149
  rows: 1,
150
150
  autoFocus: !0,
151
151
  enterKeyHint: "send",
@@ -18,7 +18,6 @@ export * from './image';
18
18
  export * from './markdown-text';
19
19
  export * from './message-timing';
20
20
  export * from './quote';
21
- export * from './smart-message-text';
22
21
  export * from './sources';
23
22
  export * from './tool-fallback';
24
23
  export * from './tool-group';
@@ -1,4 +1,11 @@
1
1
  import { FC } from 'react';
2
2
  export declare const ThreadMessage: FC;
3
3
  export declare const AssistantMessage: FC;
4
+ /**
5
+ * Local modification (ADS): the user turn is a request put forward for
6
+ * research, not a chat utterance — so it leads its turn full-width behind a
7
+ * leading rail, set as the heading the answer below answers. No bubble, no
8
+ * right-hand column. The attachments it carried (context, harness) sit
9
+ * beneath the question as its parameters.
10
+ */
4
11
  export declare const UserMessage: FC;
@@ -1,61 +1,69 @@
1
1
  "use client";
2
- import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
+ import { jsxs as a, jsx as t } from "react/jsx-runtime";
3
3
  import { UserMessageAttachments as h } from "./attachment.js";
4
4
  import { AssistantActionBar as T, UserActionBar as x } from "./action-bar.js";
5
5
  import { BranchPicker as d } from "./branch-picker.js";
6
- import { EditComposer as _ } from "./composer.js";
7
- import { MessageError as A } from "./error.js";
8
- import { QuoteBlock as b } from "./quote.js";
9
- import { Reasoning as v, ReasoningRoot as y, ReasoningTrigger as w, ReasoningContent as R, ReasoningText as N } from "./reasoning.js";
10
- import { SmartMessageText as C } from "./smart-message-text.js";
6
+ import { EditComposer as v } from "./composer.js";
7
+ import { MessageError as b } from "./error.js";
8
+ import { QuoteBlock as A } from "./quote.js";
9
+ import { Reasoning as _, ReasoningRoot as y, ReasoningTrigger as w, ReasoningContent as R, ReasoningText as N } from "./reasoning.js";
10
+ import { MarkdownText as C } from "./markdown-text.js";
11
11
  import { ThreadComponentsContext as p } from "./thread-context.js";
12
- import { ToolFallback as B } from "./tool-fallback.js";
13
- import { ToolGroupRoot as k, ToolGroupTrigger as G, ToolGroupContent as M } from "./tool-group.js";
12
+ import { ToolFallback as k } from "./tool-fallback.js";
13
+ import { ToolGroupRoot as B, ToolGroupTrigger as M, ToolGroupContent as G } from "./tool-group.js";
14
+ import { createDirectiveText as I } from "./directive-text.js";
14
15
  import { cn as c } from "../../lib/cn.js";
15
- import { MessagePrimitive as n, groupPartByType as I, useAuiState as g } from "@assistant-ui/react";
16
+ import { At as O, FileText as E, Bolt as P, Table as U } from "../../lib/icons.js";
17
+ import { unstable_defaultDirectiveFormatter as F, MessagePrimitive as i, groupPartByType as j, useAuiState as g } from "@assistant-ui/react";
16
18
  import { useContext as f } from "react";
17
- const Y = () => {
18
- const { AssistantMessage: a = O } = f(p), i = g((o) => o.message.role);
19
- return g((o) => o.message.composer.isEditing) ? /* @__PURE__ */ t(_, {}) : i === "user" ? /* @__PURE__ */ t(E, {}) : /* @__PURE__ */ t(a, {});
20
- }, O = () => {
19
+ const H = I(
20
+ F,
21
+ {
22
+ iconMap: { table: U, skill: P, file: E },
23
+ fallbackIcon: O
24
+ }
25
+ ), nt = () => {
26
+ const { AssistantMessage: o = q } = f(p), n = g((s) => s.message.role);
27
+ return g((s) => s.message.composer.isEditing) ? /* @__PURE__ */ t(v, {}) : n === "user" ? /* @__PURE__ */ t(z, {}) : /* @__PURE__ */ t(o, {});
28
+ }, q = () => {
21
29
  const {
22
- AssistantAvatar: a,
23
- ToolFallback: i = B,
24
- ToolGroup: l,
25
- ReasoningGroup: o,
30
+ AssistantAvatar: o,
31
+ ToolFallback: n = k,
32
+ ToolGroup: u,
33
+ ReasoningGroup: s,
26
34
  ChainOfThoughtGroup: m
27
35
  } = f(p);
28
- return /* @__PURE__ */ s(
29
- n.Root,
36
+ return /* @__PURE__ */ a(
37
+ i.Root,
30
38
  {
31
39
  "data-slot": "aui_assistant-message-root",
32
40
  "data-role": "assistant",
33
41
  className: c(
34
42
  "fade-in slide-in-from-bottom-1 animate-in relative -mb-7.5 pb-7.5 duration-(--duration-fast) [contain-intrinsic-size:auto_200px] [content-visibility:auto]",
35
- a && "grid grid-cols-[2rem_minmax(0,1fr)] items-start gap-x-2"
43
+ o && "grid grid-cols-[2rem_minmax(0,1fr)] items-start gap-x-2"
36
44
  ),
37
45
  children: [
38
- a && /* @__PURE__ */ t(
46
+ o && /* @__PURE__ */ t(
39
47
  "div",
40
48
  {
41
49
  "data-slot": "aui_assistant-message-avatar",
42
50
  className: "col-start-1 row-start-1 mt-0.5 flex size-8 items-center justify-center",
43
- children: /* @__PURE__ */ t(a, {})
51
+ children: /* @__PURE__ */ t(o, {})
44
52
  }
45
53
  ),
46
- /* @__PURE__ */ s(
54
+ /* @__PURE__ */ a(
47
55
  "div",
48
56
  {
49
57
  "data-slot": "aui_assistant-message-content",
50
58
  className: c(
51
59
  "text-foreground px-2 leading-relaxed wrap-break-word",
52
- a && "col-start-2 row-start-1"
60
+ o && "col-start-2 row-start-1"
53
61
  ),
54
62
  children: [
55
63
  /* @__PURE__ */ t(
56
- n.GroupedParts,
64
+ i.GroupedParts,
57
65
  {
58
- groupBy: I({
66
+ groupBy: j({
59
67
  reasoning: ["group-chainOfThought", "group-reasoning"],
60
68
  "tool-call": ["group-chainOfThought", "group-tool"],
61
69
  "standalone-tool-call": []
@@ -65,31 +73,31 @@ const Y = () => {
65
73
  case "group-chainOfThought":
66
74
  return m ? /* @__PURE__ */ t(m, { group: e, children: r }) : /* @__PURE__ */ t("div", { "data-slot": "aui_chain-of-thought", children: r });
67
75
  case "group-tool":
68
- return l ? /* @__PURE__ */ t(l, { group: e, children: r }) : /* @__PURE__ */ s(k, { variant: "ghost", children: [
76
+ return u ? /* @__PURE__ */ t(u, { group: e, children: r }) : /* @__PURE__ */ a(B, { variant: "ghost", children: [
69
77
  /* @__PURE__ */ t(
70
- G,
78
+ M,
71
79
  {
72
80
  count: e.indices.length,
73
81
  active: e.status.type === "running"
74
82
  }
75
83
  ),
76
- /* @__PURE__ */ t(M, { children: r })
84
+ /* @__PURE__ */ t(G, { children: r })
77
85
  ] });
78
86
  case "group-reasoning": {
79
- if (o)
80
- return /* @__PURE__ */ t(o, { group: e, children: r });
81
- const u = e.status.type === "running";
82
- return /* @__PURE__ */ s(y, { streaming: u, children: [
83
- /* @__PURE__ */ t(w, { active: u }),
84
- /* @__PURE__ */ t(R, { "aria-busy": u, children: /* @__PURE__ */ t(N, { children: r }) })
87
+ if (s)
88
+ return /* @__PURE__ */ t(s, { group: e, children: r });
89
+ const l = e.status.type === "running";
90
+ return /* @__PURE__ */ a(y, { streaming: l, children: [
91
+ /* @__PURE__ */ t(w, { active: l }),
92
+ /* @__PURE__ */ t(R, { "aria-busy": l, children: /* @__PURE__ */ t(N, { children: r }) })
85
93
  ] });
86
94
  }
87
95
  case "text":
88
96
  return /* @__PURE__ */ t(C, {});
89
97
  case "reasoning":
90
- return /* @__PURE__ */ t(v, { ...e });
98
+ return /* @__PURE__ */ t(_, { ...e });
91
99
  case "tool-call":
92
- return e.toolUI ?? /* @__PURE__ */ t(i, { ...e });
100
+ return e.toolUI ?? /* @__PURE__ */ t(n, { ...e });
93
101
  case "data":
94
102
  return e.dataRendererUI;
95
103
  case "indicator":
@@ -108,18 +116,18 @@ const Y = () => {
108
116
  }
109
117
  }
110
118
  ),
111
- /* @__PURE__ */ t(A, {})
119
+ /* @__PURE__ */ t(b, {})
112
120
  ]
113
121
  }
114
122
  ),
115
- /* @__PURE__ */ s(
123
+ /* @__PURE__ */ a(
116
124
  "div",
117
125
  {
118
126
  "data-slot": "aui_assistant-message-footer",
119
127
  className: c(
120
128
  "ms-2 flex items-center",
121
129
  "min-h-7.5 pt-1.5",
122
- a && "col-start-2 row-start-2"
130
+ o && "col-start-2 row-start-2"
123
131
  ),
124
132
  children: [
125
133
  /* @__PURE__ */ t(d, {}),
@@ -130,30 +138,35 @@ const Y = () => {
130
138
  ]
131
139
  }
132
140
  );
133
- }, E = () => /* @__PURE__ */ s(
134
- n.Root,
141
+ }, z = () => /* @__PURE__ */ a(
142
+ i.Root,
135
143
  {
136
144
  "data-slot": "aui_user-message-root",
137
- className: "fade-in slide-in-from-bottom-1 animate-in grid auto-rows-auto grid-cols-[minmax(72px,1fr)_auto] content-start gap-y-2 px-2 duration-(--duration-fast) [contain-intrinsic-size:auto_200px] [content-visibility:auto] [&:where(>*)]:col-start-2",
145
+ className: "fade-in slide-in-from-bottom-1 animate-in flex w-full flex-col gap-2 px-2 duration-(--duration-fast) [contain-intrinsic-size:auto_200px] [content-visibility:auto]",
138
146
  "data-role": "user",
139
147
  children: [
140
- /* @__PURE__ */ t(h, {}),
141
- /* @__PURE__ */ s("div", { className: "aui-user-message-content-wrapper relative col-start-2 min-w-0", children: [
142
- /* @__PURE__ */ t("div", { className: "aui-user-message-content peer bg-muted text-foreground rounded-xl px-4 py-2 wrap-break-word empty:hidden", children: /* @__PURE__ */ t(n.Parts, { components: { Quote: b } }) }),
143
- /* @__PURE__ */ t("div", { className: "aui-user-action-bar-wrapper absolute start-0 top-1/2 -translate-x-full -translate-y-1/2 pe-2 peer-empty:hidden rtl:translate-x-full", children: /* @__PURE__ */ t(x, {}) })
148
+ /* @__PURE__ */ a("div", { className: "aui-user-message-content-wrapper group/user-request relative min-w-0", children: [
149
+ /* @__PURE__ */ t("div", { className: "aui-user-message-content peer text-foreground text-xl leading-snug wrap-break-word empty:hidden", children: /* @__PURE__ */ t(
150
+ i.Parts,
151
+ {
152
+ components: { Quote: A, Text: H }
153
+ }
154
+ ) }),
155
+ /* @__PURE__ */ t(h, {}),
156
+ /* @__PURE__ */ t("div", { className: "aui-user-action-bar-wrapper absolute end-0 top-0 opacity-0 transition-opacity duration-(--duration-fast) ease-out peer-empty:hidden group-hover/user-request:opacity-100 group-focus-within/user-request:opacity-100 motion-reduce:transition-none", children: /* @__PURE__ */ t(x, {}) })
144
157
  ] }),
145
158
  /* @__PURE__ */ t(
146
159
  d,
147
160
  {
148
161
  "data-slot": "aui_user-branch-picker",
149
- className: "col-span-full col-start-1 row-start-3 -me-1 justify-end"
162
+ className: "-ms-1 justify-start"
150
163
  }
151
164
  )
152
165
  ]
153
166
  }
154
167
  );
155
168
  export {
156
- O as AssistantMessage,
157
- Y as ThreadMessage,
158
- E as UserMessage
169
+ q as AssistantMessage,
170
+ nt as ThreadMessage,
171
+ z as UserMessage
159
172
  };
@@ -1,2 +1,2 @@
1
- export { AssistantRuntimeProvider, AttachmentPrimitive, CompositeAttachmentAdapter, ComposerPrimitive, MessagePrimitive, SelectionToolbarPrimitive, SimpleImageAttachmentAdapter, ThreadPrimitive, makeAssistantToolUI, useAssistantRuntime, useAuiState, useLocalRuntime, } from '@assistant-ui/react';
1
+ export { AssistantRuntimeProvider, AttachmentPrimitive, CompositeAttachmentAdapter, ComposerPrimitive, MessagePrimitive, SelectionToolbarPrimitive, SimpleImageAttachmentAdapter, ThreadPrimitive, makeAssistantToolUI, unstable_useSlashCommandAdapter, useAssistantRuntime, useAuiState, useComposer, useComposerRuntime, useLocalRuntime, } from '@assistant-ui/react';
2
2
  export type { ChatModelAdapter, LocalRuntimeOptions, ThreadMessageLike, ToolCallMessagePartProps, } from '@assistant-ui/react';
@@ -13,6 +13,8 @@ export type ThreadComponents = {
13
13
  /** Optional identity shown beside every assistant turn. */
14
14
  AssistantAvatar?: ComponentType | undefined;
15
15
  Welcome?: ComponentType | undefined;
16
+ /** Wraps the default Composer, e.g. with TaskProgressDock. */
17
+ ComposerDock?: ComponentType<PropsWithChildren> | undefined;
16
18
  /** Replaces the left-side composer controls (context, upload, harness). */
17
19
  ComposerAccessories?: ComponentType | undefined;
18
20
  ToolFallback?: ToolCallMessagePartComponent | undefined;