@actioneer/ads 0.2.4 → 0.3.1
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.
- package/components/ai-elements/chain-of-thought.d.ts +88 -6
- package/components/ai-elements/chain-of-thought.js +370 -107
- package/components/ai-elements/chart.d.ts +30 -0
- package/components/ai-elements/chart.js +303 -0
- package/components/ai-elements/index.d.ts +2 -0
- package/components/ai-elements/message.d.ts +12 -2
- package/components/ai-elements/message.js +133 -100
- package/components/ai-elements/research-activity.d.ts +62 -0
- package/components/ai-elements/research-activity.js +278 -0
- package/components/ai-elements/task.d.ts +7 -3
- package/components/ai-elements/task.js +84 -52
- package/components/ai-elements/tool.js +39 -35
- package/components/ai-elements/voice.d.ts +7 -1
- package/components/ai-elements/voice.js +234 -180
- package/components/alert.js +28 -16
- package/components/answer.d.ts +16 -0
- package/components/answer.js +273 -249
- package/components/assistant-ui/attachment.js +5 -1
- package/components/assistant-ui/composer-deep-research.js +44 -29
- package/components/assistant-ui/composer-harness.js +45 -27
- package/components/assistant-ui/composer.js +16 -16
- package/components/assistant-ui/index.d.ts +0 -1
- package/components/assistant-ui/message.d.ts +7 -0
- package/components/assistant-ui/message.js +36 -36
- package/components/assistant-ui/thread.js +1 -1
- package/components/brand-texture.d.ts +37 -0
- package/components/brand-texture.js +54 -0
- package/components/code-block.d.ts +42 -0
- package/components/code-block.js +235 -0
- package/components/drawer.d.ts +1 -1
- package/components/file-dropzone.d.ts +32 -0
- package/components/file-dropzone.js +134 -0
- package/components/index.d.ts +10 -0
- package/components/index.js +482 -433
- package/components/infinite-canvas.d.ts +50 -0
- package/components/infinite-canvas.js +215 -0
- package/components/page-header.d.ts +22 -0
- package/components/page-header.js +52 -0
- package/components/resizable-panel.d.ts +29 -0
- package/components/resizable-panel.js +102 -0
- package/components/reveal.d.ts +36 -0
- package/components/reveal.js +35 -0
- package/components/scroll-area.d.ts +19 -0
- package/components/scroll-area.js +57 -0
- package/components/setting-row.d.ts +35 -0
- package/components/setting-row.js +86 -0
- package/components/sidebar.js +131 -131
- package/components/stepper.d.ts +40 -0
- package/components/stepper.js +102 -0
- package/components/table.js +16 -15
- package/components/tabs.js +1 -1
- package/lib/icons.d.ts +12 -0
- package/lib/icons.js +98 -95
- package/lib/motion.d.ts +7 -3
- package/lib/motion.js +29 -27
- package/llms.txt +123 -28
- package/manifest.json +883 -68
- package/package.json +2 -2
- package/styles.css +179 -30
- package/theme.css +29 -17
- package/components/assistant-ui/smart-message-text.d.ts +0 -15
- package/components/assistant-ui/smart-message-text.js +0 -29
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as r, jsxs as
|
|
2
|
+
import { jsx as r, jsxs as h, Fragment as w } from "react/jsx-runtime";
|
|
3
3
|
import * as o from "react";
|
|
4
4
|
import { cva as x } from "class-variance-authority";
|
|
5
|
-
import { cn as
|
|
6
|
-
import { Button as
|
|
5
|
+
import { cn as i } from "../../lib/cn.js";
|
|
6
|
+
import { Button as f } from "../button.js";
|
|
7
7
|
import { Avatar as M } from "../avatar.js";
|
|
8
|
-
import { Tooltip as
|
|
8
|
+
import { Tooltip as b } from "../tooltip.js";
|
|
9
9
|
import { ChevronLeft as B, ChevronRight as R, Paperclip as A, Close as C } from "../../lib/icons.js";
|
|
10
10
|
const z = x("group flex w-full max-w-[95%] flex-col gap-2", {
|
|
11
11
|
variants: {
|
|
@@ -16,16 +16,16 @@ const z = x("group flex w-full max-w-[95%] flex-col gap-2", {
|
|
|
16
16
|
},
|
|
17
17
|
defaultVariants: { align: "start" }
|
|
18
18
|
}), k = o.forwardRef(
|
|
19
|
-
({ align: e, className: t, from:
|
|
19
|
+
({ align: e, className: t, from: a, ...s }, n) => /* @__PURE__ */ r(
|
|
20
20
|
"div",
|
|
21
21
|
{
|
|
22
22
|
ref: n,
|
|
23
|
-
className:
|
|
24
|
-
z({ align: e ??
|
|
25
|
-
|
|
23
|
+
className: i(
|
|
24
|
+
z({ align: e ?? "start" }),
|
|
25
|
+
a === "user" ? "is-user" : "is-assistant",
|
|
26
26
|
t
|
|
27
27
|
),
|
|
28
|
-
...
|
|
28
|
+
...s
|
|
29
29
|
}
|
|
30
30
|
)
|
|
31
31
|
);
|
|
@@ -43,34 +43,60 @@ const P = x(
|
|
|
43
43
|
flat: "w-fit group-[.is-user]:rounded-lg group-[.is-user]:bg-surface group-[.is-user]:px-3 group-[.is-user]:py-2 group-[.is-user]:text-foreground group-[.is-assistant]:text-foreground",
|
|
44
44
|
// Plain: no fill, radius, or padding. Pair `align="start"` with a
|
|
45
45
|
// user turn for the clean, left-aligned prompt treatment.
|
|
46
|
-
plain: "w-full text-foreground group-[.is-user]:text-lg"
|
|
46
|
+
plain: "w-full text-foreground group-[.is-user]:text-lg",
|
|
47
|
+
// Request: the user turn is a brief put forward for research, not a
|
|
48
|
+
// chat utterance — no fill, no rule, full width, set large and light
|
|
49
|
+
// so it leads the turn on size alone. The answer below is its body.
|
|
50
|
+
// `text-2xl` (26px) is the TOP of the type scale — the request must
|
|
51
|
+
// outrank every heading around it, including a `Heading level={1}`
|
|
52
|
+
// page title, or it stops reading as the thing being asked.
|
|
53
|
+
// `gap-4` sets the question-to-MessageMeta distance (16px): the
|
|
54
|
+
// parameters read as part of the request, and the thread's own
|
|
55
|
+
// turn gap (32px) is the larger break before the answer.
|
|
56
|
+
request: "w-full text-foreground group-[.is-user]:gap-4 group-[.is-user]:text-2xl group-[.is-user]:leading-snug"
|
|
47
57
|
}
|
|
48
58
|
},
|
|
49
|
-
defaultVariants: { variant: "
|
|
59
|
+
defaultVariants: { variant: "request" }
|
|
50
60
|
}
|
|
51
|
-
), T = o.forwardRef(({ children: e, className: t, variant:
|
|
61
|
+
), T = o.forwardRef(({ children: e, className: t, variant: a, ...s }, n) => /* @__PURE__ */ r(
|
|
52
62
|
"div",
|
|
53
63
|
{
|
|
54
64
|
ref: n,
|
|
55
|
-
className:
|
|
56
|
-
...
|
|
65
|
+
className: i(P({ variant: a }), t),
|
|
66
|
+
...s,
|
|
57
67
|
children: e
|
|
58
68
|
}
|
|
59
69
|
));
|
|
60
70
|
T.displayName = "MessageContent";
|
|
61
|
-
const j = o.forwardRef(
|
|
71
|
+
const j = o.forwardRef(
|
|
72
|
+
({ className: e, ...t }, a) => /* @__PURE__ */ r(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
ref: a,
|
|
76
|
+
"data-slot": "message-meta",
|
|
77
|
+
className: i(
|
|
78
|
+
"flex flex-wrap items-center gap-x-2 gap-y-1.5",
|
|
79
|
+
"text-xs font-normal leading-normal tracking-normal text-tertiary",
|
|
80
|
+
e
|
|
81
|
+
),
|
|
82
|
+
...t
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
);
|
|
86
|
+
j.displayName = "MessageMeta";
|
|
87
|
+
const V = o.forwardRef(({ src: e, name: t, className: a, ...s }, n) => /* @__PURE__ */ r(
|
|
62
88
|
M,
|
|
63
89
|
{
|
|
64
90
|
ref: n,
|
|
65
91
|
src: e,
|
|
66
92
|
name: t,
|
|
67
93
|
size: "sm",
|
|
68
|
-
className:
|
|
69
|
-
...
|
|
94
|
+
className: i("ring-2 ring-background", a),
|
|
95
|
+
...s
|
|
70
96
|
}
|
|
71
97
|
));
|
|
72
|
-
|
|
73
|
-
const
|
|
98
|
+
V.displayName = "MessageAvatar";
|
|
99
|
+
const S = i(
|
|
74
100
|
"size-full text-base leading-relaxed text-foreground",
|
|
75
101
|
"[&>*:first-child]:mt-0 [&>*:last-child]:mb-0",
|
|
76
102
|
"[&_p]:my-2",
|
|
@@ -81,64 +107,70 @@ const V = l(
|
|
|
81
107
|
"[&_a]:font-medium [&_a]:underline [&_a]:underline-offset-2",
|
|
82
108
|
"[&_code]:rounded-xs [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-xs [&_code]:tabular-nums",
|
|
83
109
|
"[&_pre]:my-3 [&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:bg-surface [&_pre]:p-3 [&_pre]:text-xs [&_pre_code]:bg-transparent [&_pre_code]:p-0",
|
|
84
|
-
|
|
85
|
-
|
|
110
|
+
// Markdown tables only. Scoped off `[data-slot=table]` so a composed ADS
|
|
111
|
+
// <Table> nested in a response keeps its own padding and per-column
|
|
112
|
+
// alignment — unscoped, these descendant rules silently beat it.
|
|
113
|
+
"[&_table:not([data-slot=table])]:my-3 [&_table:not([data-slot=table])]:w-full [&_table:not([data-slot=table])]:text-xs",
|
|
114
|
+
"[&_table:not([data-slot=table])_th]:px-2 [&_table:not([data-slot=table])_th]:py-1.5 [&_table:not([data-slot=table])_th]:text-left [&_table:not([data-slot=table])_th]:font-bold",
|
|
115
|
+
"[&_table:not([data-slot=table])_td]:px-2 [&_table:not([data-slot=table])_td]:py-1.5",
|
|
116
|
+
"[&_table:not([data-slot=table])_thead]:text-secondary"
|
|
117
|
+
), W = o.memo(
|
|
86
118
|
o.forwardRef(
|
|
87
|
-
({ className: e, children: t, ...
|
|
119
|
+
({ className: e, children: t, ...a }, s) => /* @__PURE__ */ r("div", { ref: s, className: i(S, e), ...a, children: t })
|
|
88
120
|
),
|
|
89
121
|
(e, t) => e.children === t.children
|
|
90
122
|
);
|
|
91
|
-
|
|
92
|
-
const
|
|
123
|
+
W.displayName = "MessageResponse";
|
|
124
|
+
const q = o.forwardRef(({ className: e, children: t, ...a }, s) => /* @__PURE__ */ r(
|
|
93
125
|
"div",
|
|
94
126
|
{
|
|
95
|
-
ref:
|
|
96
|
-
className:
|
|
97
|
-
...
|
|
127
|
+
ref: s,
|
|
128
|
+
className: i("flex items-center gap-1", e),
|
|
129
|
+
...a,
|
|
98
130
|
children: t
|
|
99
131
|
}
|
|
100
132
|
));
|
|
101
|
-
|
|
133
|
+
q.displayName = "MessageActions";
|
|
102
134
|
const E = o.forwardRef(
|
|
103
|
-
({ tooltip: e, children: t, label:
|
|
104
|
-
const c = /* @__PURE__ */ f
|
|
135
|
+
({ tooltip: e, children: t, label: a, variant: s = "ghost", size: n = "icon-sm", ...l }, d) => {
|
|
136
|
+
const c = /* @__PURE__ */ h(f, { ref: d, size: n, type: "button", variant: s, ...l, children: [
|
|
105
137
|
t,
|
|
106
|
-
/* @__PURE__ */ r("span", { className: "sr-only", children:
|
|
138
|
+
/* @__PURE__ */ r("span", { className: "sr-only", children: a || e })
|
|
107
139
|
] });
|
|
108
|
-
return e ? /* @__PURE__ */ r(
|
|
140
|
+
return e ? /* @__PURE__ */ r(b, { content: e, children: c }) : c;
|
|
109
141
|
}
|
|
110
142
|
);
|
|
111
143
|
E.displayName = "MessageAction";
|
|
112
|
-
const
|
|
113
|
-
const e = o.useContext(
|
|
144
|
+
const _ = o.createContext(null), g = () => {
|
|
145
|
+
const e = o.useContext(_);
|
|
114
146
|
if (!e)
|
|
115
147
|
throw new Error(
|
|
116
148
|
"MessageBranch components must be used within MessageBranch"
|
|
117
149
|
);
|
|
118
150
|
return e;
|
|
119
|
-
}, I = o.forwardRef(({ defaultBranch: e = 0, onBranchChange: t, className:
|
|
120
|
-
const [
|
|
151
|
+
}, I = o.forwardRef(({ defaultBranch: e = 0, onBranchChange: t, className: a, ...s }, n) => {
|
|
152
|
+
const [l, d] = o.useState(e), [c, m] = o.useState([]), p = (u) => {
|
|
121
153
|
d(u), t == null || t(u);
|
|
122
154
|
}, v = () => {
|
|
123
|
-
const u =
|
|
155
|
+
const u = l > 0 ? l - 1 : c.length - 1;
|
|
124
156
|
p(u);
|
|
125
157
|
}, y = () => {
|
|
126
|
-
const u =
|
|
158
|
+
const u = l < c.length - 1 ? l + 1 : 0;
|
|
127
159
|
p(u);
|
|
128
160
|
}, N = {
|
|
129
|
-
currentBranch:
|
|
161
|
+
currentBranch: l,
|
|
130
162
|
totalBranches: c.length,
|
|
131
163
|
goToPrevious: v,
|
|
132
164
|
goToNext: y,
|
|
133
165
|
branches: c,
|
|
134
166
|
setBranches: m
|
|
135
167
|
};
|
|
136
|
-
return /* @__PURE__ */ r(
|
|
168
|
+
return /* @__PURE__ */ r(_.Provider, { value: N, children: /* @__PURE__ */ r(
|
|
137
169
|
"div",
|
|
138
170
|
{
|
|
139
171
|
ref: n,
|
|
140
|
-
className:
|
|
141
|
-
...
|
|
172
|
+
className: i("grid w-full gap-2 [&>div]:pb-0", a),
|
|
173
|
+
...s
|
|
142
174
|
}
|
|
143
175
|
) });
|
|
144
176
|
});
|
|
@@ -147,17 +179,17 @@ const L = ({
|
|
|
147
179
|
children: e,
|
|
148
180
|
...t
|
|
149
181
|
}) => {
|
|
150
|
-
const { currentBranch:
|
|
182
|
+
const { currentBranch: a, setBranches: s, branches: n } = g(), l = o.Children.toArray(
|
|
151
183
|
e
|
|
152
184
|
);
|
|
153
185
|
return o.useEffect(() => {
|
|
154
|
-
n.length !==
|
|
155
|
-
}, [
|
|
186
|
+
n.length !== l.length && s(l);
|
|
187
|
+
}, [l, n, s]), /* @__PURE__ */ r(w, { children: l.map((d, c) => /* @__PURE__ */ r(
|
|
156
188
|
"div",
|
|
157
189
|
{
|
|
158
|
-
className:
|
|
190
|
+
className: i(
|
|
159
191
|
"grid gap-2 overflow-hidden [&>div]:pb-0",
|
|
160
|
-
c ===
|
|
192
|
+
c === a ? "block" : "hidden"
|
|
161
193
|
),
|
|
162
194
|
...t,
|
|
163
195
|
children: d
|
|
@@ -166,27 +198,27 @@ const L = ({
|
|
|
166
198
|
)) });
|
|
167
199
|
};
|
|
168
200
|
L.displayName = "MessageBranchContent";
|
|
169
|
-
const F = o.forwardRef(({ className: e, from: t, ...
|
|
201
|
+
const F = o.forwardRef(({ className: e, from: t, ...a }, s) => {
|
|
170
202
|
const { totalBranches: n } = g();
|
|
171
203
|
return n <= 1 ? null : /* @__PURE__ */ r(
|
|
172
204
|
"div",
|
|
173
205
|
{
|
|
174
|
-
ref:
|
|
175
|
-
className:
|
|
176
|
-
...
|
|
206
|
+
ref: s,
|
|
207
|
+
className: i("inline-flex items-center gap-0.5", e),
|
|
208
|
+
...a
|
|
177
209
|
}
|
|
178
210
|
);
|
|
179
211
|
});
|
|
180
212
|
F.displayName = "MessageBranchSelector";
|
|
181
|
-
const
|
|
182
|
-
const { goToPrevious:
|
|
213
|
+
const D = o.forwardRef(({ children: e, ...t }, a) => {
|
|
214
|
+
const { goToPrevious: s, totalBranches: n } = g();
|
|
183
215
|
return /* @__PURE__ */ r(
|
|
184
|
-
|
|
216
|
+
f,
|
|
185
217
|
{
|
|
186
|
-
ref:
|
|
218
|
+
ref: a,
|
|
187
219
|
"aria-label": "Previous branch",
|
|
188
220
|
disabled: n <= 1,
|
|
189
|
-
onClick:
|
|
221
|
+
onClick: s,
|
|
190
222
|
size: "icon-sm",
|
|
191
223
|
type: "button",
|
|
192
224
|
variant: "ghost",
|
|
@@ -195,16 +227,16 @@ const q = o.forwardRef(({ children: e, ...t }, s) => {
|
|
|
195
227
|
}
|
|
196
228
|
);
|
|
197
229
|
});
|
|
198
|
-
|
|
199
|
-
const
|
|
200
|
-
const { goToNext:
|
|
230
|
+
D.displayName = "MessageBranchPrevious";
|
|
231
|
+
const G = o.forwardRef(({ children: e, ...t }, a) => {
|
|
232
|
+
const { goToNext: s, totalBranches: n } = g();
|
|
201
233
|
return /* @__PURE__ */ r(
|
|
202
|
-
|
|
234
|
+
f,
|
|
203
235
|
{
|
|
204
|
-
ref:
|
|
236
|
+
ref: a,
|
|
205
237
|
"aria-label": "Next branch",
|
|
206
238
|
disabled: n <= 1,
|
|
207
|
-
onClick:
|
|
239
|
+
onClick: s,
|
|
208
240
|
size: "icon-sm",
|
|
209
241
|
type: "button",
|
|
210
242
|
variant: "ghost",
|
|
@@ -213,39 +245,39 @@ const D = o.forwardRef(({ children: e, ...t }, s) => {
|
|
|
213
245
|
}
|
|
214
246
|
);
|
|
215
247
|
});
|
|
216
|
-
|
|
217
|
-
const
|
|
218
|
-
const { currentBranch:
|
|
219
|
-
return /* @__PURE__ */
|
|
248
|
+
G.displayName = "MessageBranchNext";
|
|
249
|
+
const H = o.forwardRef(({ className: e, ...t }, a) => {
|
|
250
|
+
const { currentBranch: s, totalBranches: n } = g();
|
|
251
|
+
return /* @__PURE__ */ h(
|
|
220
252
|
"span",
|
|
221
253
|
{
|
|
222
|
-
ref:
|
|
223
|
-
className:
|
|
254
|
+
ref: a,
|
|
255
|
+
className: i(
|
|
224
256
|
"px-1.5 text-xs tabular-nums text-tertiary select-none",
|
|
225
257
|
e
|
|
226
258
|
),
|
|
227
259
|
...t,
|
|
228
260
|
children: [
|
|
229
|
-
|
|
261
|
+
s + 1,
|
|
230
262
|
" of ",
|
|
231
263
|
n
|
|
232
264
|
]
|
|
233
265
|
}
|
|
234
266
|
);
|
|
235
267
|
});
|
|
236
|
-
|
|
237
|
-
const
|
|
268
|
+
H.displayName = "MessageBranchPage";
|
|
269
|
+
const J = o.forwardRef(({ data: e, className: t, onRemove: a, ...s }, n) => {
|
|
238
270
|
var m;
|
|
239
|
-
const
|
|
240
|
-
return /* @__PURE__ */
|
|
271
|
+
const l = e.filename || "", d = !!((m = e.mediaType) != null && m.startsWith("image/") && e.url), c = l || (d ? "Image" : "Attachment");
|
|
272
|
+
return /* @__PURE__ */ h(
|
|
241
273
|
"div",
|
|
242
274
|
{
|
|
243
275
|
ref: n,
|
|
244
|
-
className:
|
|
276
|
+
className: i(
|
|
245
277
|
"group/attachment relative size-24 overflow-hidden rounded-lg bg-muted",
|
|
246
278
|
t
|
|
247
279
|
),
|
|
248
|
-
...
|
|
280
|
+
...s,
|
|
249
281
|
children: [
|
|
250
282
|
d ? /* @__PURE__ */ r(
|
|
251
283
|
"img",
|
|
@@ -254,17 +286,17 @@ const H = o.forwardRef(({ data: e, className: t, onRemove: s, ...a }, n) => {
|
|
|
254
286
|
className: "size-full object-cover",
|
|
255
287
|
src: e.url
|
|
256
288
|
}
|
|
257
|
-
) : /* @__PURE__ */ r(
|
|
258
|
-
|
|
259
|
-
|
|
289
|
+
) : /* @__PURE__ */ r(b, { content: c, children: /* @__PURE__ */ r("div", { className: "flex size-full items-center justify-center text-muted-foreground", children: /* @__PURE__ */ r(A, { className: "size-4" }) }) }),
|
|
290
|
+
a && /* @__PURE__ */ r(
|
|
291
|
+
f,
|
|
260
292
|
{
|
|
261
293
|
"aria-label": "Remove attachment",
|
|
262
|
-
className:
|
|
294
|
+
className: i(
|
|
263
295
|
"absolute top-1.5 right-1.5 size-6 rounded-full p-0 opacity-0 transition-opacity group-hover/attachment:opacity-100",
|
|
264
296
|
d && "bg-elevated/80 backdrop-blur-sm hover:bg-elevated"
|
|
265
297
|
),
|
|
266
298
|
onClick: (p) => {
|
|
267
|
-
p.stopPropagation(),
|
|
299
|
+
p.stopPropagation(), a();
|
|
268
300
|
},
|
|
269
301
|
size: "icon-xs",
|
|
270
302
|
type: "button",
|
|
@@ -276,47 +308,48 @@ const H = o.forwardRef(({ data: e, className: t, onRemove: s, ...a }, n) => {
|
|
|
276
308
|
}
|
|
277
309
|
);
|
|
278
310
|
});
|
|
279
|
-
|
|
280
|
-
const
|
|
311
|
+
J.displayName = "MessageAttachment";
|
|
312
|
+
const K = o.forwardRef(({ children: e, className: t, ...a }, s) => e ? /* @__PURE__ */ r(
|
|
281
313
|
"div",
|
|
282
314
|
{
|
|
283
|
-
ref:
|
|
284
|
-
className:
|
|
315
|
+
ref: s,
|
|
316
|
+
className: i(
|
|
285
317
|
"flex w-fit flex-wrap items-start gap-2 group-[.is-align-start]:mr-auto group-[.is-align-end]:ml-auto",
|
|
286
318
|
t
|
|
287
319
|
),
|
|
288
|
-
...
|
|
320
|
+
...a,
|
|
289
321
|
children: e
|
|
290
322
|
}
|
|
291
323
|
) : null);
|
|
292
|
-
|
|
293
|
-
const
|
|
324
|
+
K.displayName = "MessageAttachments";
|
|
325
|
+
const O = o.forwardRef(({ className: e, children: t, ...a }, s) => /* @__PURE__ */ r(
|
|
294
326
|
"div",
|
|
295
327
|
{
|
|
296
|
-
ref:
|
|
297
|
-
className:
|
|
328
|
+
ref: s,
|
|
329
|
+
className: i(
|
|
298
330
|
"mt-3 flex w-full items-center justify-between gap-4",
|
|
299
331
|
e
|
|
300
332
|
),
|
|
301
|
-
...
|
|
333
|
+
...a,
|
|
302
334
|
children: t
|
|
303
335
|
}
|
|
304
336
|
));
|
|
305
|
-
|
|
337
|
+
O.displayName = "MessageToolbar";
|
|
306
338
|
export {
|
|
307
339
|
k as Message,
|
|
308
340
|
E as MessageAction,
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
341
|
+
q as MessageActions,
|
|
342
|
+
J as MessageAttachment,
|
|
343
|
+
K as MessageAttachments,
|
|
344
|
+
V as MessageAvatar,
|
|
313
345
|
I as MessageBranch,
|
|
314
346
|
L as MessageBranchContent,
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
347
|
+
G as MessageBranchNext,
|
|
348
|
+
H as MessageBranchPage,
|
|
349
|
+
D as MessageBranchPrevious,
|
|
318
350
|
F as MessageBranchSelector,
|
|
319
351
|
T as MessageContent,
|
|
320
|
-
|
|
321
|
-
|
|
352
|
+
j as MessageMeta,
|
|
353
|
+
W as MessageResponse,
|
|
354
|
+
O as MessageToolbar
|
|
322
355
|
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type ResearchActivityStatus = "active" | "complete";
|
|
3
|
+
export interface ResearchActivityProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
4
|
+
status: ResearchActivityStatus;
|
|
5
|
+
/** Consumer-formatted elapsed or total time, for example `0:36`. */
|
|
6
|
+
elapsed: React.ReactNode;
|
|
7
|
+
sourceCount: number;
|
|
8
|
+
/** Consumer-formatted time to the first useful result. */
|
|
9
|
+
firstInsight?: React.ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* What the agent is doing right now, e.g. "Querying NPA movement". When
|
|
12
|
+
* provided, the active state renders as a single live line that morphs
|
|
13
|
+
* between steps — the trace stays behind a click instead of stacking above
|
|
14
|
+
* the answer. Without it, the active trace opens in full (legacy behavior).
|
|
15
|
+
*/
|
|
16
|
+
activity?: React.ReactNode;
|
|
17
|
+
/** Keys the live-line morph. Required when `activity` is not a string. */
|
|
18
|
+
activityKey?: string | number;
|
|
19
|
+
/** 1-based position of the current step — renders a quiet "3 of 7" before the elapsed time. */
|
|
20
|
+
stepIndex?: number;
|
|
21
|
+
/** Total planned steps; the counter renders only when both are provided. */
|
|
22
|
+
stepCount?: number;
|
|
23
|
+
/** Replaces the generated completed summary. */
|
|
24
|
+
summary?: React.ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Pin the summary/live line to the top of the scroll container while the
|
|
27
|
+
* trace beneath it scrolls. For long open traces, where the line would
|
|
28
|
+
* otherwise scroll away exactly when the run is still moving.
|
|
29
|
+
*/
|
|
30
|
+
sticky?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Show the disclosure chevron. Turn it off when the consumer controls `open`
|
|
33
|
+
* and the line is a status readout rather than a toggle — a chevron that
|
|
34
|
+
* does nothing is a false affordance.
|
|
35
|
+
*/
|
|
36
|
+
collapsible?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Where the summary/live line sits when the trace is open. `"bottom"` puts
|
|
39
|
+
* it directly beneath the steps — while running that is where the next step
|
|
40
|
+
* appears, and on completion it stays put rather than jumping back over the
|
|
41
|
+
* trace it just narrated. A CLOSED trace always shows its line at the top:
|
|
42
|
+
* it is then standing in for the whole trace, so it has to sit where the
|
|
43
|
+
* trace would be.
|
|
44
|
+
*
|
|
45
|
+
* Visual order only — the trigger stays before its content in the DOM.
|
|
46
|
+
*/
|
|
47
|
+
activityPlacement?: "top" | "bottom";
|
|
48
|
+
/** Controlled disclosure of the trace. */
|
|
49
|
+
open?: boolean;
|
|
50
|
+
/** Initial disclosure state. */
|
|
51
|
+
defaultOpen?: boolean;
|
|
52
|
+
onOpenChange?: (open: boolean) => void;
|
|
53
|
+
children: React.ReactNode;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Streaming research disclosure. With an `activity`, the run reads as a single
|
|
57
|
+
* live line — the current step morphing in place while the full trace waits
|
|
58
|
+
* one click away — and completion settles the same line into a source/timing
|
|
59
|
+
* summary. A reader's expand/collapse choice sticks across the transition.
|
|
60
|
+
* Without an `activity`, the active trace stays fully open (legacy behavior).
|
|
61
|
+
*/
|
|
62
|
+
export declare const ResearchActivity: React.ForwardRefExoticComponent<ResearchActivityProps & React.RefAttributes<HTMLDivElement>>;
|