@actioneer/ads 0.5.2 → 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.
- package/components/ai-elements/agent-trace.d.ts +6 -1
- package/components/ai-elements/agent-trace.js +150 -120
- package/components/ai-elements/chain-of-thought.d.ts +21 -5
- package/components/ai-elements/chain-of-thought.js +190 -140
- package/components/ai-elements/research-activity.js +100 -95
- package/components/ai-elements/task.js +11 -11
- package/components/ai-elements/tool.js +29 -29
- package/components/alert.js +7 -7
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/styles.css +26 -13
- package/theme.css +15 -10
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as r, jsx as e, Fragment as
|
|
3
|
-
import * as
|
|
4
|
-
import { MotionConfig as
|
|
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
|
|
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
|
|
9
|
-
import { EASE_OUT as
|
|
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
|
|
12
|
-
const
|
|
11
|
+
import { Shimmer as B } from "./shimmer.js";
|
|
12
|
+
const ne = te("w-full", {
|
|
13
13
|
variants: {
|
|
14
14
|
status: {
|
|
15
|
-
active: "text-
|
|
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:
|
|
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:
|
|
35
|
+
transition: { duration: 0.12, ease: _ }
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
function
|
|
38
|
+
function C({
|
|
39
39
|
elapsed: t,
|
|
40
|
-
firstInsight:
|
|
41
|
-
sourceCount:
|
|
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
|
-
|
|
46
|
+
p,
|
|
47
47
|
" ",
|
|
48
|
-
|
|
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
|
-
|
|
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:
|
|
57
|
+
/* @__PURE__ */ e("span", { className: "tabular-nums", children: s })
|
|
58
58
|
] })
|
|
59
59
|
] })
|
|
60
60
|
] });
|
|
61
61
|
}
|
|
62
|
-
const
|
|
62
|
+
const oe = n.forwardRef(
|
|
63
63
|
({
|
|
64
64
|
status: t,
|
|
65
|
-
elapsed:
|
|
66
|
-
sourceCount:
|
|
67
|
-
firstInsight:
|
|
68
|
-
sticky:
|
|
69
|
-
collapsible:
|
|
70
|
-
activityPlacement:
|
|
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:
|
|
72
|
+
activityKey: P,
|
|
73
|
+
stepIndex: w,
|
|
74
74
|
stepCount: S,
|
|
75
|
-
summary:
|
|
76
|
-
open:
|
|
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
|
|
86
|
+
const d = E !== void 0, i = c != null, [Y, y] = n.useState(
|
|
87
87
|
!i && t === "active" || $
|
|
88
|
-
),
|
|
89
|
-
|
|
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
|
|
92
|
-
if (
|
|
93
|
-
|
|
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 (
|
|
96
|
+
if (m !== "active" || b.current && i) return;
|
|
97
97
|
const A = document.activeElement;
|
|
98
|
-
A && ((L =
|
|
99
|
-
}, [i,
|
|
100
|
-
const Z =
|
|
101
|
-
(
|
|
102
|
-
!i && t !== "complete" || (
|
|
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,
|
|
105
|
-
), o = t === "active",
|
|
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:
|
|
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
|
-
|
|
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(
|
|
125
|
+
i ? /* @__PURE__ */ e(D, { asChild: !0, children: /* @__PURE__ */ r(
|
|
126
126
|
"button",
|
|
127
127
|
{
|
|
128
|
-
ref:
|
|
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-
|
|
133
|
-
"transition-
|
|
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
|
-
|
|
136
|
-
|
|
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
|
-
|
|
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(
|
|
146
|
-
/* @__PURE__ */ e(
|
|
147
|
-
|
|
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(
|
|
155
|
-
|
|
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:
|
|
158
|
-
firstInsight:
|
|
159
|
-
sourceCount:
|
|
157
|
+
elapsed: s,
|
|
158
|
+
firstInsight: R,
|
|
159
|
+
sourceCount: p
|
|
160
160
|
}
|
|
161
161
|
)
|
|
162
162
|
},
|
|
163
|
-
|
|
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
|
-
!
|
|
169
|
+
!x && "pe-6"
|
|
170
170
|
), children: [
|
|
171
|
-
|
|
171
|
+
w != null && S != null && /* @__PURE__ */ r(F, { children: [
|
|
172
172
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Step " }),
|
|
173
|
-
|
|
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
|
-
|
|
179
|
+
s
|
|
180
180
|
] }),
|
|
181
|
-
|
|
182
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
-
!
|
|
211
|
+
!x && "pe-6"
|
|
212
212
|
), children: [
|
|
213
213
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Elapsed " }),
|
|
214
|
-
|
|
214
|
+
s
|
|
215
215
|
] })
|
|
216
216
|
]
|
|
217
217
|
}
|
|
218
|
-
) : /* @__PURE__ */ e(
|
|
218
|
+
) : /* @__PURE__ */ e(D, { asChild: !0, children: /* @__PURE__ */ r(
|
|
219
219
|
"button",
|
|
220
220
|
{
|
|
221
|
-
ref:
|
|
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-
|
|
226
|
-
"transition-
|
|
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
|
-
|
|
229
|
-
|
|
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(
|
|
239
|
-
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1", children:
|
|
240
|
-
|
|
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:
|
|
243
|
-
firstInsight:
|
|
244
|
-
sourceCount:
|
|
242
|
+
elapsed: s,
|
|
243
|
+
firstInsight: R,
|
|
244
|
+
sourceCount: p
|
|
245
245
|
}
|
|
246
246
|
) }),
|
|
247
|
-
|
|
248
|
-
|
|
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
|
-
|
|
260
|
+
/* @__PURE__ */ e(ae, { forceMount: !0, asChild: !0, "data-slot": "research-activity-content", children: /* @__PURE__ */ e(
|
|
261
|
+
M.div,
|
|
262
262
|
{
|
|
263
|
-
ref:
|
|
264
|
-
|
|
265
|
-
"
|
|
266
|
-
|
|
267
|
-
|
|
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
|
-
|
|
280
|
+
oe.displayName = "ResearchActivity";
|
|
276
281
|
export {
|
|
277
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
44
|
-
const
|
|
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(
|
|
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
|
-
|
|
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(
|
|
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-
|
|
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
|
-
|
|
100
|
+
y as Task,
|
|
101
101
|
b as TaskContent,
|
|
102
102
|
v as TaskItem,
|
|
103
103
|
k as TaskItemFile,
|
|
104
|
-
|
|
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
|
|
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
|
|
7
|
-
import { cn as
|
|
8
|
-
const
|
|
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:
|
|
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
|
-
|
|
19
|
-
const
|
|
20
|
-
"input-streaming": { label: "Pending", color: "default", icon:
|
|
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:
|
|
23
|
+
"output-error": { label: "Error", color: "danger", icon: g }
|
|
24
24
|
}, C = ({ state: e }) => {
|
|
25
|
-
const { label: t, color:
|
|
26
|
-
return /* @__PURE__ */ l(f, { variant: "soft", color:
|
|
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:
|
|
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:
|
|
46
|
+
type: n,
|
|
47
47
|
state: a,
|
|
48
48
|
...i
|
|
49
49
|
}) => /* @__PURE__ */ l(
|
|
50
50
|
m,
|
|
51
51
|
{
|
|
52
|
-
className:
|
|
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(
|
|
61
|
-
/* @__PURE__ */ o("span", { className: "font-medium text-base", children: t ?? T(
|
|
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
|
-
|
|
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:
|
|
79
|
-
"overflow-hidden text-
|
|
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:
|
|
94
|
-
"overflow-x-auto rounded-md bg-surface p-3 text-xs leading-relaxed text-
|
|
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
|
-
),
|
|
100
|
-
/* @__PURE__ */ o(
|
|
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 && !
|
|
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:
|
|
107
|
+
errorText: n,
|
|
108
108
|
...a
|
|
109
|
-
}) => t ||
|
|
110
|
-
/* @__PURE__ */ o(
|
|
111
|
-
|
|
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
|
-
|
|
115
|
+
v as Tool,
|
|
116
116
|
j as ToolContent,
|
|
117
117
|
S as ToolHeader,
|
|
118
118
|
k as ToolInput,
|
package/components/alert.js
CHANGED
|
@@ -5,7 +5,7 @@ import { cva as u } from "class-variance-authority";
|
|
|
5
5
|
import { Info as l, WarningCircle as g, Warning as p, CheckCircle as x, Close as v } from "../lib/icons.js";
|
|
6
6
|
import { cn as n } from "../lib/cn.js";
|
|
7
7
|
const h = u(
|
|
8
|
-
"flex w-full items-start gap-4 rounded-2xl bg-muted
|
|
8
|
+
"flex w-full items-start gap-4 rounded-2xl bg-muted p-4",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
@@ -58,7 +58,7 @@ const h = u(
|
|
|
58
58
|
}
|
|
59
59
|
);
|
|
60
60
|
N.displayName = "Alert";
|
|
61
|
-
const
|
|
61
|
+
const b = i.forwardRef(({ className: t, ...r }, a) => /* @__PURE__ */ e(
|
|
62
62
|
"p",
|
|
63
63
|
{
|
|
64
64
|
ref: a,
|
|
@@ -66,8 +66,8 @@ const y = i.forwardRef(({ className: t, ...r }, a) => /* @__PURE__ */ e(
|
|
|
66
66
|
...r
|
|
67
67
|
}
|
|
68
68
|
));
|
|
69
|
-
|
|
70
|
-
const
|
|
69
|
+
b.displayName = "AlertTitle";
|
|
70
|
+
const y = i.forwardRef(({ className: t, ...r }, a) => (
|
|
71
71
|
// leading-normal (150%) — the description is the only part of an alert that
|
|
72
72
|
// regularly wraps, and the text-xs default (138%) sets multi-line copy too
|
|
73
73
|
// tight to scan.
|
|
@@ -80,9 +80,9 @@ const b = i.forwardRef(({ className: t, ...r }, a) => (
|
|
|
80
80
|
}
|
|
81
81
|
)
|
|
82
82
|
));
|
|
83
|
-
|
|
83
|
+
y.displayName = "AlertDescription";
|
|
84
84
|
export {
|
|
85
85
|
N as Alert,
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
y as AlertDescription,
|
|
87
|
+
b as AlertTitle
|
|
88
88
|
};
|
package/manifest.json
CHANGED