@actioneer/ads 0.5.1 → 0.5.3

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.
@@ -1,18 +1,18 @@
1
1
  "use client";
2
- import { jsxs as r, jsx as e, Fragment as P } from "react/jsx-runtime";
3
- import * as s from "react";
4
- import { MotionConfig as I, AnimatePresence as O, motion as ee } from "motion/react";
2
+ import { jsxs as r, jsx as e, Fragment as F } from "react/jsx-runtime";
3
+ import * as n from "react";
4
+ import { MotionConfig as O, AnimatePresence as ee, motion as M } from "motion/react";
5
5
  import { cva as te } from "class-variance-authority";
6
- import { Collapsible as re, CollapsibleTrigger as M, CollapsibleContent as ae } from "../collapsible.js";
6
+ import { Collapsible as re, CollapsibleTrigger as D, CollapsibleContent as ae } from "../collapsible.js";
7
7
  import { Spinner as T } from "../spinner.js";
8
- import { Sparkles as V, ChevronDown as B } from "../../lib/icons.js";
9
- import { EASE_OUT as D } from "../../lib/motion.js";
8
+ import { Sparkles as U, ChevronDown as V } from "../../lib/icons.js";
9
+ import { EASE_OUT as _, EASE_DISCLOSURE as ie } from "../../lib/motion.js";
10
10
  import { cn as l } from "../../lib/cn.js";
11
- import { Shimmer as F } from "./shimmer.js";
12
- const ie = te("w-full", {
11
+ import { Shimmer as B } from "./shimmer.js";
12
+ const ne = te("w-full", {
13
13
  variants: {
14
14
  status: {
15
- active: "text-foreground",
15
+ active: "text-secondary",
16
16
  complete: "text-secondary"
17
17
  }
18
18
  }
@@ -26,54 +26,54 @@ const ie = te("w-full", {
26
26
  opacity: 1,
27
27
  transform: "translate3d(0, 0, 0)",
28
28
  filter: "blur(0px)",
29
- transition: { duration: 0.18, ease: D }
29
+ transition: { duration: 0.18, ease: _ }
30
30
  },
31
31
  exit: {
32
32
  opacity: 0,
33
33
  transform: "translate3d(0, -7px, 0)",
34
34
  filter: "blur(2px)",
35
- transition: { duration: 0.12, ease: D }
35
+ transition: { duration: 0.12, ease: _ }
36
36
  }
37
37
  };
38
- function K({
38
+ function C({
39
39
  elapsed: t,
40
- firstInsight: n,
41
- sourceCount: d
40
+ firstInsight: s,
41
+ sourceCount: p
42
42
  }) {
43
43
  return /* @__PURE__ */ r("span", { className: "flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1", children: [
44
44
  /* @__PURE__ */ r("span", { children: [
45
45
  "Researched ",
46
- d,
46
+ p,
47
47
  " ",
48
- d === 1 ? "source" : "sources"
48
+ p === 1 ? "source" : "sources"
49
49
  ] }),
50
50
  /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "text-tertiary", children: "·" }),
51
51
  /* @__PURE__ */ e("span", { className: "text-xs text-tertiary tabular-nums", children: t }),
52
- n != null && /* @__PURE__ */ r(P, { children: [
52
+ s != null && /* @__PURE__ */ r(F, { children: [
53
53
  /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "text-tertiary", children: "·" }),
54
54
  /* @__PURE__ */ r("span", { className: "text-xs text-tertiary", children: [
55
55
  "first insight",
56
56
  " ",
57
- /* @__PURE__ */ e("span", { className: "tabular-nums", children: n })
57
+ /* @__PURE__ */ e("span", { className: "tabular-nums", children: s })
58
58
  ] })
59
59
  ] })
60
60
  ] });
61
61
  }
62
- const ne = s.forwardRef(
62
+ const oe = n.forwardRef(
63
63
  ({
64
64
  status: t,
65
- elapsed: n,
66
- sourceCount: d,
67
- firstInsight: w,
68
- sticky: p = !1,
69
- collapsible: h = !0,
70
- activityPlacement: U = "top",
65
+ elapsed: s,
66
+ sourceCount: p,
67
+ firstInsight: R,
68
+ sticky: h = !1,
69
+ collapsible: x = !0,
70
+ activityPlacement: K = "top",
71
71
  activity: c,
72
- activityKey: _,
73
- stepIndex: R,
72
+ activityKey: P,
73
+ stepIndex: w,
74
74
  stepCount: S,
75
- summary: x,
76
- open: k,
75
+ summary: v,
76
+ open: E,
77
77
  defaultOpen: $ = !1,
78
78
  onOpenChange: a,
79
79
  children: q,
@@ -83,31 +83,31 @@ const ne = s.forwardRef(
83
83
  "aria-busy": Q,
84
84
  ...W
85
85
  }, X) => {
86
- const m = k !== void 0, i = c != null, [Y, y] = s.useState(
86
+ const d = E !== void 0, i = c != null, [Y, y] = n.useState(
87
87
  !i && t === "active" || $
88
- ), z = s.useRef(t), N = s.useRef(!1), E = s.useRef(null), b = s.useRef(null), g = m ? k : Y, v = !i && t === "active" || g, f = U === "bottom" && v;
89
- s.useLayoutEffect(() => {
88
+ ), k = n.useRef(t), b = n.useRef(!1), z = n.useRef(null), N = n.useRef(null), g = d ? E : Y, u = !i && t === "active" || g, f = K === "bottom" && u;
89
+ n.useLayoutEffect(() => {
90
90
  var L, j;
91
- const u = z.current;
92
- if (z.current = t, t === "active") {
93
- u !== "active" && (N.current = !1), u !== "active" && !i && !m && y(!0);
91
+ const m = k.current;
92
+ if (k.current = t, t === "active") {
93
+ m !== "active" && (b.current = !1), m !== "active" && !i && !d && y(!0);
94
94
  return;
95
95
  }
96
- if (u !== "active" || N.current && i) return;
96
+ if (m !== "active" || b.current && i) return;
97
97
  const A = document.activeElement;
98
- A && ((L = E.current) != null && L.contains(A)) && ((j = b.current) == null || j.focus()), m || y(!1), a == null || a(!1);
99
- }, [i, m, a, t]);
100
- const Z = s.useCallback(
101
- (u) => {
102
- !i && t !== "complete" || (N.current = !0, m || y(u), a == null || a(u));
98
+ A && ((L = z.current) != null && L.contains(A)) && ((j = N.current) == null || j.focus()), d || y(!1), a == null || a(!1);
99
+ }, [i, d, a, t]);
100
+ const Z = n.useCallback(
101
+ (m) => {
102
+ !i && t !== "complete" || (b.current = !0, d || y(m), a == null || a(m));
103
103
  },
104
- [i, m, a, t]
105
- ), o = t === "active", C = o ? `activity-${_ ?? (typeof c == "string" ? c : "current")}` : "summary";
104
+ [i, d, a, t]
105
+ ), o = t === "active", I = o ? `activity-${P ?? (typeof c == "string" ? c : "current")}` : "summary";
106
106
  return /* @__PURE__ */ r(
107
107
  re,
108
108
  {
109
109
  ref: X,
110
- open: v,
110
+ open: u,
111
111
  onOpenChange: Z,
112
112
  role: H ?? "region",
113
113
  "aria-label": J ?? "Research activity",
@@ -116,75 +116,75 @@ const ne = s.forwardRef(
116
116
  "data-slot": "research-activity",
117
117
  "data-status": t,
118
118
  className: l(
119
- ie({ status: t }),
119
+ ne({ status: t }),
120
120
  f && "flex flex-col",
121
121
  G
122
122
  ),
123
123
  children: [
124
124
  /* @__PURE__ */ e("span", { className: "sr-only", "aria-live": "polite", "aria-atomic": "true", children: o ? "Research in progress" : "Research complete" }),
125
- i ? /* @__PURE__ */ e(M, { asChild: !0, children: /* @__PURE__ */ r(
125
+ i ? /* @__PURE__ */ e(D, { asChild: !0, children: /* @__PURE__ */ r(
126
126
  "button",
127
127
  {
128
- ref: b,
128
+ ref: N,
129
129
  type: "button",
130
130
  "data-slot": "research-activity-trigger",
131
131
  className: l(
132
- "group/research-trigger flex min-h-9 w-full cursor-pointer items-center gap-2.5 rounded-sm py-1 text-left text-sm outline-none",
133
- "transition-[color,transform] duration-(--duration-fast) ease-out hover:text-primary active:scale-(--scale-press)",
132
+ "group/research-trigger flex min-h-9 w-full cursor-pointer items-center gap-2.5 rounded-sm py-1 text-left text-base outline-none",
133
+ "transition-colors duration-(--duration-fast) ease-out hover:text-primary",
134
134
  "focus-visible:ring-3 focus-visible:ring-ring motion-reduce:transition-none",
135
- p && "sticky z-10 bg-background",
136
- p && (f ? "bottom-0" : "top-0"),
135
+ h && "sticky z-10 bg-background",
136
+ h && (f ? "bottom-0" : "top-0"),
137
137
  f && "order-last mt-3"
138
138
  ),
139
139
  children: [
140
140
  /* @__PURE__ */ r("span", { className: "sr-only", children: [
141
- v ? "Collapse" : "Expand",
141
+ u ? "Collapse" : "Expand",
142
142
  " research activity:",
143
143
  " "
144
144
  ] }),
145
- /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "flex size-4 shrink-0 items-center justify-center", children: o ? /* @__PURE__ */ e(T, { size: "sm", color: "current", role: "presentation" }) : /* @__PURE__ */ e(V, { className: "size-4" }) }),
146
- /* @__PURE__ */ e(I, { reducedMotion: "user", children: /* @__PURE__ */ e("span", { className: "relative h-5 min-w-0 flex-1 overflow-hidden", children: /* @__PURE__ */ e(O, { initial: !1, children: /* @__PURE__ */ e(
147
- ee.span,
145
+ /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "flex size-4 shrink-0 items-center justify-center", children: o ? /* @__PURE__ */ e(T, { size: "sm", color: "current", role: "presentation" }) : /* @__PURE__ */ e(U, { className: "size-4" }) }),
146
+ /* @__PURE__ */ e(O, { reducedMotion: "user", children: /* @__PURE__ */ e("span", { className: "relative h-5 min-w-0 flex-1 overflow-hidden", children: /* @__PURE__ */ e(ee, { initial: !1, children: /* @__PURE__ */ e(
147
+ M.span,
148
148
  {
149
149
  variants: se,
150
150
  initial: "initial",
151
151
  animate: "animate",
152
152
  exit: "exit",
153
153
  className: "absolute inset-0 flex items-center truncate whitespace-nowrap",
154
- children: o ? typeof c == "string" ? /* @__PURE__ */ e(F, { as: "span", className: "truncate text-sm", children: c }) : c : x !== void 0 ? x : /* @__PURE__ */ e(
155
- K,
154
+ children: o ? typeof c == "string" ? /* @__PURE__ */ e(B, { as: "span", className: "truncate text-base", children: c }) : c : v !== void 0 ? v : /* @__PURE__ */ e(
155
+ C,
156
156
  {
157
- elapsed: n,
158
- firstInsight: w,
159
- sourceCount: d
157
+ elapsed: s,
158
+ firstInsight: R,
159
+ sourceCount: p
160
160
  }
161
161
  )
162
162
  },
163
- C
163
+ I
164
164
  ) }) }) }),
165
165
  o && /* @__PURE__ */ r("span", { className: l(
166
166
  "shrink-0 text-xs text-tertiary tabular-nums",
167
167
  // Reserve the caret slot (size-4 + gap-2) so trailing metadata
168
168
  // keeps the same right edge as sibling rows that show a caret.
169
- !h && "pe-6"
169
+ !x && "pe-6"
170
170
  ), children: [
171
- R != null && S != null && /* @__PURE__ */ r(P, { children: [
171
+ w != null && S != null && /* @__PURE__ */ r(F, { children: [
172
172
  /* @__PURE__ */ e("span", { className: "sr-only", children: "Step " }),
173
- R,
173
+ w,
174
174
  " of ",
175
175
  S,
176
176
  /* @__PURE__ */ e("span", { "aria-hidden": !0, children: " · " })
177
177
  ] }),
178
178
  /* @__PURE__ */ e("span", { className: "sr-only", children: "Elapsed " }),
179
- n
179
+ s
180
180
  ] }),
181
- h && /* @__PURE__ */ e(
182
- B,
181
+ x && /* @__PURE__ */ e(
182
+ V,
183
183
  {
184
184
  "aria-hidden": !0,
185
185
  className: l(
186
186
  "size-4 shrink-0 text-tertiary transition-transform duration-(--duration-normal) ease-out motion-reduce:transition-none",
187
- v && "rotate-180"
187
+ u && "rotate-180"
188
188
  )
189
189
  }
190
190
  )
@@ -205,28 +205,28 @@ const ne = s.forwardRef(
205
205
  "aria-hidden": !0
206
206
  }
207
207
  ),
208
- /* @__PURE__ */ e(F, { as: "span", className: "text-sm", children: "Researching…" }),
208
+ /* @__PURE__ */ e(B, { as: "span", className: "text-base", children: "Researching…" }),
209
209
  /* @__PURE__ */ r("span", { className: l(
210
210
  "ml-auto shrink-0 text-xs text-tertiary tabular-nums",
211
- !h && "pe-6"
211
+ !x && "pe-6"
212
212
  ), children: [
213
213
  /* @__PURE__ */ e("span", { className: "sr-only", children: "Elapsed " }),
214
- n
214
+ s
215
215
  ] })
216
216
  ]
217
217
  }
218
- ) : /* @__PURE__ */ e(M, { asChild: !0, children: /* @__PURE__ */ r(
218
+ ) : /* @__PURE__ */ e(D, { asChild: !0, children: /* @__PURE__ */ r(
219
219
  "button",
220
220
  {
221
- ref: b,
221
+ ref: N,
222
222
  type: "button",
223
223
  "data-slot": "research-activity-trigger",
224
224
  className: l(
225
- "group/research-trigger flex min-h-9 w-full cursor-pointer items-center gap-2 rounded-sm py-1 text-left text-sm outline-none",
226
- "transition-[color,transform] duration-(--duration-fast) ease-out hover:text-primary active:scale-(--scale-press)",
225
+ "group/research-trigger flex min-h-9 w-full cursor-pointer items-center gap-2 rounded-sm py-1 text-left text-base outline-none",
226
+ "transition-colors duration-(--duration-fast) ease-out hover:text-primary",
227
227
  "focus-visible:ring-3 focus-visible:ring-ring motion-reduce:transition-none",
228
- p && "sticky z-10 bg-background",
229
- p && (f ? "bottom-0" : "top-0"),
228
+ h && "sticky z-10 bg-background",
229
+ h && (f ? "bottom-0" : "top-0"),
230
230
  f && "order-last mt-3"
231
231
  ),
232
232
  children: [
@@ -235,17 +235,17 @@ const ne = s.forwardRef(
235
235
  " research activity:",
236
236
  " "
237
237
  ] }),
238
- /* @__PURE__ */ e(V, { "aria-hidden": !0, className: "size-4 shrink-0" }),
239
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1", children: x !== void 0 ? x : /* @__PURE__ */ e(
240
- K,
238
+ /* @__PURE__ */ e(U, { "aria-hidden": !0, className: "size-4 shrink-0" }),
239
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1", children: v !== void 0 ? v : /* @__PURE__ */ e(
240
+ C,
241
241
  {
242
- elapsed: n,
243
- firstInsight: w,
244
- sourceCount: d
242
+ elapsed: s,
243
+ firstInsight: R,
244
+ sourceCount: p
245
245
  }
246
246
  ) }),
247
- h && /* @__PURE__ */ e(
248
- B,
247
+ x && /* @__PURE__ */ e(
248
+ V,
249
249
  {
250
250
  "aria-hidden": !0,
251
251
  className: l(
@@ -257,22 +257,27 @@ const ne = s.forwardRef(
257
257
  ]
258
258
  }
259
259
  ) }),
260
- /* @__PURE__ */ e(
261
- ae,
260
+ /* @__PURE__ */ e(ae, { forceMount: !0, asChild: !0, "data-slot": "research-activity-content", children: /* @__PURE__ */ e(
261
+ M.div,
262
262
  {
263
- ref: E,
264
- forceMount: !0,
265
- "data-slot": "research-activity-content",
266
- className: "mt-3 overflow-hidden text-foreground outline-none data-[state=closed]:hidden",
267
- children: q
263
+ ref: z,
264
+ initial: !1,
265
+ animate: u ? "open" : "closed",
266
+ variants: {
267
+ open: { height: "auto", opacity: 1 },
268
+ closed: { height: 0, opacity: 0 }
269
+ },
270
+ transition: { duration: u ? 0.28 : 0.2, ease: ie },
271
+ className: "overflow-hidden text-secondary outline-none data-[state=closed]:pointer-events-none",
272
+ children: /* @__PURE__ */ e("div", { className: "ml-2 pt-3 [--tree-rail-lead:20px]", children: q })
268
273
  }
269
- )
274
+ ) })
270
275
  ]
271
276
  }
272
277
  );
273
278
  }
274
279
  );
275
- ne.displayName = "ResearchActivity";
280
+ oe.displayName = "ResearchActivity";
276
281
  export {
277
- ne as ResearchActivity
282
+ oe as ResearchActivity
278
283
  };
@@ -3,7 +3,7 @@ import { jsx as e, jsxs as o } from "react/jsx-runtime";
3
3
  import { createContext as m, useContext as d } from "react";
4
4
  import { motion as u } from "motion/react";
5
5
  import { EASE_DISCLOSURE as p } from "../../lib/motion.js";
6
- import { Collapsible as h, CollapsibleContent as f, CollapsibleTrigger as x } from "../collapsible.js";
6
+ import { Collapsible as h, CollapsibleContent as x, CollapsibleTrigger as f } from "../collapsible.js";
7
7
  import { Search as g, ChevronDown as N } from "../../lib/icons.js";
8
8
  import { cn as i } from "../../lib/cn.js";
9
9
  const l = m(!0), k = ({
@@ -24,7 +24,7 @@ const l = m(!0), k = ({
24
24
  k.displayName = "TaskItemFile";
25
25
  const v = ({ children: t, className: a, ...s }) => /* @__PURE__ */ e("div", { className: i("text-base text-secondary", a), ...s, children: t });
26
26
  v.displayName = "TaskItem";
27
- const T = ({
27
+ const y = ({
28
28
  defaultOpen: t = !0,
29
29
  className: a,
30
30
  open: s,
@@ -40,15 +40,15 @@ const T = ({
40
40
  children: /* @__PURE__ */ e(l.Provider, { value: s ?? t, children: n })
41
41
  }
42
42
  );
43
- T.displayName = "Task";
44
- const y = ({
43
+ y.displayName = "Task";
44
+ const T = ({
45
45
  children: t,
46
46
  className: a,
47
47
  title: s,
48
48
  icon: n,
49
49
  endContent: r,
50
50
  ...c
51
- }) => /* @__PURE__ */ e(x, { asChild: !0, className: i("group", a), ...c, children: t ?? /* @__PURE__ */ o(
51
+ }) => /* @__PURE__ */ e(f, { asChild: !0, className: i("group", a), ...c, children: t ?? /* @__PURE__ */ o(
52
52
  "button",
53
53
  {
54
54
  type: "button",
@@ -69,14 +69,14 @@ const y = ({
69
69
  ]
70
70
  }
71
71
  ) });
72
- y.displayName = "TaskTrigger";
72
+ T.displayName = "TaskTrigger";
73
73
  const b = ({
74
74
  children: t,
75
75
  className: a,
76
76
  ...s
77
77
  }) => {
78
78
  const n = d(l);
79
- return /* @__PURE__ */ e(f, { forceMount: !0, asChild: !0, ...s, children: /* @__PURE__ */ e(
79
+ return /* @__PURE__ */ e(x, { forceMount: !0, asChild: !0, ...s, children: /* @__PURE__ */ e(
80
80
  u.div,
81
81
  {
82
82
  initial: !1,
@@ -87,19 +87,19 @@ const b = ({
87
87
  },
88
88
  transition: { duration: n ? 0.28 : 0.2, ease: p },
89
89
  className: i(
90
- "overflow-hidden text-foreground outline-none",
90
+ "overflow-hidden text-secondary outline-none",
91
91
  "data-[state=closed]:pointer-events-none",
92
92
  a
93
93
  ),
94
- children: /* @__PURE__ */ e("div", { className: "mt-2 ml-2", children: t })
94
+ children: /* @__PURE__ */ e("div", { className: "mt-2 ml-2 [--tree-rail-lead:9px]", children: t })
95
95
  }
96
96
  ) });
97
97
  };
98
98
  b.displayName = "TaskContent";
99
99
  export {
100
- T as Task,
100
+ y as Task,
101
101
  b as TaskContent,
102
102
  v as TaskItem,
103
103
  k as TaskItemFile,
104
- y as TaskTrigger
104
+ T as TaskTrigger
105
105
  };
@@ -1,33 +1,33 @@
1
1
  "use client";
2
2
  import { jsx as o, jsxs as l } from "react/jsx-runtime";
3
- import { isValidElement as c } from "react";
3
+ import { isValidElement as d } from "react";
4
4
  import { Collapsible as u, CollapsibleTrigger as m, CollapsibleContent as p } from "../collapsible.js";
5
5
  import { Badge as f } from "../badge.js";
6
- import { Wrench as g, ChevronDown as h, CloseCircle as x, CheckCircle as b, Clock as N, CircleDashed as v } from "../../lib/icons.js";
7
- import { cn as n } from "../../lib/cn.js";
8
- const w = ({ className: e, ...t }) => /* @__PURE__ */ o(
6
+ import { Wrench as h, ChevronDown as x, CloseCircle as g, CheckCircle as b, Clock as N, CircleDashed as y } from "../../lib/icons.js";
7
+ import { cn as r } from "../../lib/cn.js";
8
+ const v = ({ className: e, ...t }) => /* @__PURE__ */ o(
9
9
  u,
10
10
  {
11
- className: n(
11
+ className: r(
12
12
  "not-prose group/tool w-full overflow-hidden rounded-xl bg-card",
13
13
  e
14
14
  ),
15
15
  ...t
16
16
  }
17
17
  );
18
- w.displayName = "Tool";
19
- const y = {
20
- "input-streaming": { label: "Pending", color: "default", icon: v },
18
+ v.displayName = "Tool";
19
+ const w = {
20
+ "input-streaming": { label: "Pending", color: "default", icon: y },
21
21
  "input-available": { label: "Running", color: "info", icon: N, pulse: !0 },
22
22
  "output-available": { label: "Completed", color: "success", icon: b },
23
- "output-error": { label: "Error", color: "danger", icon: x }
23
+ "output-error": { label: "Error", color: "danger", icon: g }
24
24
  }, C = ({ state: e }) => {
25
- const { label: t, color: r, icon: a, pulse: i } = y[e];
26
- return /* @__PURE__ */ l(f, { variant: "soft", color: r, children: [
25
+ const { label: t, color: n, icon: a, pulse: i } = w[e];
26
+ return /* @__PURE__ */ l(f, { variant: "soft", color: n, children: [
27
27
  /* @__PURE__ */ o(
28
28
  a,
29
29
  {
30
- className: n(
30
+ className: r(
31
31
  "size-3",
32
32
  i && "animate-pulse motion-reduce:animate-none"
33
33
  ),
@@ -43,13 +43,13 @@ function T(e) {
43
43
  const S = ({
44
44
  className: e,
45
45
  title: t,
46
- type: r,
46
+ type: n,
47
47
  state: a,
48
48
  ...i
49
49
  }) => /* @__PURE__ */ l(
50
50
  m,
51
51
  {
52
- className: n(
52
+ className: r(
53
53
  "group/tool-header flex w-full items-center justify-between gap-4 py-3 text-left transition-colors hover:text-primary motion-reduce:transition-none",
54
54
  "outline-none focus-visible:ring-3 focus-visible:ring-ring",
55
55
  e
@@ -57,12 +57,12 @@ const S = ({
57
57
  ...i,
58
58
  children: [
59
59
  /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
60
- /* @__PURE__ */ o(g, { className: "size-4 shrink-0 text-tertiary", "aria-hidden": !0 }),
61
- /* @__PURE__ */ o("span", { className: "font-medium text-base", children: t ?? T(r) }),
60
+ /* @__PURE__ */ o(h, { className: "size-4 shrink-0 text-tertiary", "aria-hidden": !0 }),
61
+ /* @__PURE__ */ o("span", { className: "font-medium text-base", children: t ?? T(n) }),
62
62
  /* @__PURE__ */ o(C, { state: a })
63
63
  ] }),
64
64
  /* @__PURE__ */ o(
65
- h,
65
+ x,
66
66
  {
67
67
  className: "size-4 shrink-0 text-tertiary transition-transform duration-(--duration-fast) ease-out group-data-[state=open]/tool-header:rotate-180 motion-reduce:transition-none",
68
68
  "aria-hidden": !0
@@ -75,8 +75,8 @@ S.displayName = "ToolHeader";
75
75
  const j = ({ className: e, ...t }) => /* @__PURE__ */ o(
76
76
  p,
77
77
  {
78
- className: n(
79
- "overflow-hidden text-foreground outline-none",
78
+ className: r(
79
+ "overflow-hidden text-secondary outline-none",
80
80
  "data-[state=closed]:pointer-events-none",
81
81
  e
82
82
  ),
@@ -90,29 +90,29 @@ const s = ({
90
90
  }) => /* @__PURE__ */ o(
91
91
  "pre",
92
92
  {
93
- className: n(
94
- "overflow-x-auto rounded-md bg-surface p-3 text-xs leading-relaxed text-foreground tabular-nums",
93
+ className: r(
94
+ "overflow-x-auto rounded-md bg-surface p-3 text-xs leading-relaxed text-secondary tabular-nums",
95
95
  t
96
96
  ),
97
97
  children: /* @__PURE__ */ o("code", { children: e })
98
98
  }
99
- ), d = ({ children: e }) => /* @__PURE__ */ o("h4", { className: "text-xs font-medium uppercase tracking-wide text-tertiary", children: e }), k = ({ className: e, input: t, ...r }) => /* @__PURE__ */ l("div", { className: n("space-y-2 overflow-hidden p-4", e), ...r, children: [
100
- /* @__PURE__ */ o(d, { children: "Parameters" }),
99
+ ), c = ({ children: e }) => /* @__PURE__ */ o("h4", { className: "text-xs font-medium uppercase tracking-wide text-tertiary", children: e }), k = ({ className: e, input: t, ...n }) => /* @__PURE__ */ l("div", { className: r("space-y-2 overflow-hidden p-4", e), ...n, children: [
100
+ /* @__PURE__ */ o(c, { children: "Parameters" }),
101
101
  /* @__PURE__ */ o(s, { code: JSON.stringify(t, null, 2) })
102
102
  ] });
103
103
  k.displayName = "ToolInput";
104
- const O = (e) => typeof e == "object" && e !== null && !c(e) ? /* @__PURE__ */ o(s, { code: JSON.stringify(e, null, 2) }) : typeof e == "string" ? /* @__PURE__ */ o("div", { className: "rounded-md bg-surface p-3 text-xs leading-relaxed text-foreground whitespace-pre-wrap", children: e }) : e, P = ({
104
+ const O = (e) => typeof e == "object" && e !== null && !d(e) ? /* @__PURE__ */ o(s, { code: JSON.stringify(e, null, 2) }) : typeof e == "string" ? /* @__PURE__ */ o("div", { className: "rounded-md bg-surface p-3 text-xs leading-relaxed text-secondary whitespace-pre-wrap", children: e }) : e, P = ({
105
105
  className: e,
106
106
  output: t,
107
- errorText: r,
107
+ errorText: n,
108
108
  ...a
109
- }) => t || r ? /* @__PURE__ */ l("div", { className: n("space-y-2 p-4", e), ...a, children: [
110
- /* @__PURE__ */ o(d, { children: r ? "Error" : "Result" }),
111
- r ? /* @__PURE__ */ o("div", { className: "rounded-md bg-danger-50 p-3 text-xs leading-relaxed text-danger-700 whitespace-pre-wrap", children: r }) : /* @__PURE__ */ o("div", { className: "overflow-x-auto text-xs text-foreground [&_table]:w-full", children: O(t) })
109
+ }) => t || n ? /* @__PURE__ */ l("div", { className: r("space-y-2 p-4", e), ...a, children: [
110
+ /* @__PURE__ */ o(c, { children: n ? "Error" : "Result" }),
111
+ n ? /* @__PURE__ */ o("div", { className: "rounded-md bg-danger-50 p-3 text-xs leading-relaxed text-danger-700 whitespace-pre-wrap", children: n }) : /* @__PURE__ */ o("div", { className: "overflow-x-auto text-xs text-secondary [&_table]:w-full", children: O(t) })
112
112
  ] }) : null;
113
113
  P.displayName = "ToolOutput";
114
114
  export {
115
- w as Tool,
115
+ v as Tool,
116
116
  j as ToolContent,
117
117
  S as ToolHeader,
118
118
  k as ToolInput,
@@ -0,0 +1,37 @@
1
+ import * as React from "react";
2
+ /**
3
+ * Transcript — the ADS conversation-transcript element (ported from the voice
4
+ * product's call panel). A props-driven turn list for reviewing a finished
5
+ * agent↔user exchange: agent turns sit left on a whisper fill, user turns sit
6
+ * right on a muted fill, each headed by an uppercase role label and an
7
+ * optional time.
8
+ *
9
+ * Sentiment scanning: pass `tone` on a user turn ("positive" | "negative")
10
+ * to tint that bubble with the semantic success/danger fill and prefix the
11
+ * role label with a square `rounded-dot` marker — reviewers jump straight to
12
+ * the reactions that mattered. The component renders tones; the CALLER owns
13
+ * the analysis (lexicon, model, or human tags). Agent turns stay neutral:
14
+ * the agent reads a script, so only the user's reaction carries signal.
15
+ *
16
+ * No runtime dependency — compose it under any transport, and place it as a
17
+ * SIBLING of `MessageResponse`, never inside it (prose wrapper clobbers
18
+ * composed components).
19
+ */
20
+ export type TranscriptTone = "positive" | "negative" | "neutral";
21
+ export interface TranscriptTurn {
22
+ id: string;
23
+ role: "agent" | "user";
24
+ text: string;
25
+ /** Short time label shown beside the role, e.g. "0:12". */
26
+ timeLabel?: string;
27
+ /** Sentiment tint — meaningful on user turns; ignored for agents. */
28
+ tone?: TranscriptTone;
29
+ }
30
+ export interface TranscriptProps extends React.HTMLAttributes<HTMLDivElement> {
31
+ turns: TranscriptTurn[];
32
+ /** Role heading overrides (defaults: Agent / User). */
33
+ agentLabel?: string;
34
+ userLabel?: string;
35
+ emptyMessage?: string;
36
+ }
37
+ export declare function Transcript({ turns, agentLabel, userLabel, emptyMessage, className, ...props }: TranscriptProps): React.JSX.Element;
@@ -0,0 +1,46 @@
1
+ "use client";
2
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
3
+ import { cn as t } from "../../lib/cn.js";
4
+ function g({
5
+ turns: i,
6
+ agentLabel: c = "Agent",
7
+ userLabel: o = "User",
8
+ emptyMessage: m = "No transcript captured yet.",
9
+ className: n,
10
+ ...d
11
+ }) {
12
+ return i.length === 0 ? /* @__PURE__ */ e("p", { className: t("text-sm text-muted-foreground", n), "data-slot": "transcript", ...d, children: m }) : /* @__PURE__ */ e("div", { className: t("space-y-3", n), "data-slot": "transcript", ...d, children: i.map((s) => {
13
+ const r = s.role === "user", a = r ? s.tone ?? "neutral" : "neutral";
14
+ return /* @__PURE__ */ e("div", { className: t("flex w-full", r ? "justify-end" : "justify-start"), children: /* @__PURE__ */ l(
15
+ "div",
16
+ {
17
+ className: t(
18
+ "max-w-[84%] rounded-lg px-3 py-2.5",
19
+ r ? "bg-muted" : "bg-muted/25",
20
+ a === "positive" && "bg-success-100/70",
21
+ a === "negative" && "bg-danger-100/70"
22
+ ),
23
+ children: [
24
+ /* @__PURE__ */ l("div", { className: t("mb-1 flex items-center gap-3", r && "justify-end"), children: [
25
+ a !== "neutral" && /* @__PURE__ */ e(
26
+ "span",
27
+ {
28
+ "aria-label": a === "positive" ? "Positive response" : "Negative response",
29
+ className: t(
30
+ "size-1.5 rounded-dot",
31
+ a === "positive" ? "bg-success-600" : "bg-danger-600"
32
+ )
33
+ }
34
+ ),
35
+ /* @__PURE__ */ e("p", { className: "text-xs font-medium uppercase text-muted-foreground", children: r ? o : c }),
36
+ s.timeLabel && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: s.timeLabel })
37
+ ] }),
38
+ /* @__PURE__ */ e("p", { className: t("whitespace-pre-wrap break-words text-sm leading-relaxed", r && "text-right"), children: s.text })
39
+ ]
40
+ }
41
+ ) }, s.id);
42
+ }) });
43
+ }
44
+ export {
45
+ g as Transcript
46
+ };