laif-ds 0.1.98 → 0.2.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.
- package/dist/components/ui/chat-message.js +296 -122
- package/dist/components/ui/chat.js +150 -119
- package/dist/components/ui/dialog.js +45 -37
- package/dist/components/ui/message-input.js +1 -1
- package/dist/components/ui/message-list.js +21 -17
- package/dist/index.d.ts +12 -3
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { motion as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { Collapsible as
|
|
8
|
-
import { FilePreview as
|
|
9
|
-
import { MarkdownRenderer as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
|
|
2
|
+
import { jsxs as o, jsx as e, Fragment as C } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo as I, useState as B, useRef as M, useEffect as F, Suspense as w } from "react";
|
|
4
|
+
import { cva as W } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
5
|
+
import { motion as $ } from "framer-motion";
|
|
6
|
+
import { cn as l } from "../../lib/utils.js";
|
|
7
|
+
import { Collapsible as j, CollapsibleTrigger as L, CollapsibleContent as P } from "./collapsible.js";
|
|
8
|
+
import { FilePreview as V } from "./file-preview.js";
|
|
9
|
+
import { MarkdownRenderer as k } from "./markdown-renderer.js";
|
|
10
|
+
import E from "../../node_modules/lucide-react/dist/esm/icons/x.js";
|
|
11
|
+
import S from "../../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
12
|
+
import U from "../../node_modules/lucide-react/dist/esm/icons/pen.js";
|
|
13
|
+
import X from "../../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
|
|
14
|
+
import z from "../../node_modules/lucide-react/dist/esm/icons/ban.js";
|
|
15
|
+
import J from "../../node_modules/lucide-react/dist/esm/icons/code-xml.js";
|
|
16
|
+
import _ from "../../node_modules/lucide-react/dist/esm/icons/terminal.js";
|
|
17
|
+
import q from "../../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
|
|
18
|
+
const R = W(
|
|
16
19
|
"group/message relative break-words rounded-lg p-3 text-sm sm:max-w-[70%]",
|
|
17
20
|
{
|
|
18
21
|
variants: {
|
|
@@ -50,217 +53,388 @@ const x = C(
|
|
|
50
53
|
}
|
|
51
54
|
]
|
|
52
55
|
}
|
|
53
|
-
),
|
|
54
|
-
role:
|
|
55
|
-
content:
|
|
56
|
-
createdAt:
|
|
57
|
-
showTimeStamp:
|
|
58
|
-
animation:
|
|
59
|
-
actions:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
), fe = ({
|
|
57
|
+
role: i,
|
|
58
|
+
content: n,
|
|
59
|
+
createdAt: a,
|
|
60
|
+
showTimeStamp: f = !1,
|
|
61
|
+
animation: m = "scale",
|
|
62
|
+
actions: b,
|
|
63
|
+
onEdit: T,
|
|
64
|
+
experimental_attachments: O,
|
|
65
|
+
toolInvocations: h,
|
|
66
|
+
parts: N
|
|
63
67
|
}) => {
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
return new File([
|
|
67
|
-
}), [
|
|
68
|
+
const D = I(() => O?.map((r) => {
|
|
69
|
+
const s = G(r.url);
|
|
70
|
+
return new File([s], r.name ?? "Unknown");
|
|
71
|
+
}), [O]), d = i === "user", x = !d && T, [t, u] = B(!1), c = M(null);
|
|
72
|
+
F(() => {
|
|
73
|
+
if (t && c.current) {
|
|
74
|
+
c.current.focus();
|
|
75
|
+
const r = document.createRange(), s = window.getSelection();
|
|
76
|
+
r.selectNodeContents(c.current), r.collapse(!1), s?.removeAllRanges(), s?.addRange(r);
|
|
77
|
+
}
|
|
78
|
+
}, [t]);
|
|
79
|
+
const p = () => {
|
|
80
|
+
const r = c.current?.textContent || "";
|
|
81
|
+
r.trim() && r !== n && T?.(r.trim()), u(!1);
|
|
82
|
+
}, g = () => {
|
|
83
|
+
u(!1);
|
|
84
|
+
}, v = (r) => {
|
|
85
|
+
r.key === "Enter" && !r.shiftKey ? (r.preventDefault(), p()) : r.key === "Escape" && (r.preventDefault(), g());
|
|
86
|
+
}, y = a?.toLocaleTimeString("en-US", {
|
|
68
87
|
hour: "2-digit",
|
|
69
88
|
minute: "2-digit"
|
|
70
89
|
});
|
|
71
|
-
return
|
|
90
|
+
return d ? /* @__PURE__ */ o(
|
|
72
91
|
"div",
|
|
73
92
|
{
|
|
74
|
-
className:
|
|
93
|
+
className: l("flex flex-col", d ? "items-end" : "items-start"),
|
|
75
94
|
children: [
|
|
76
|
-
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
|
|
95
|
+
D ? /* @__PURE__ */ e("div", { className: "mb-1 flex flex-wrap gap-2", children: D.map((r, s) => /* @__PURE__ */ e(V, { file: r }, s)) }) : null,
|
|
96
|
+
/* @__PURE__ */ o(
|
|
97
|
+
"div",
|
|
79
98
|
{
|
|
80
|
-
|
|
81
|
-
|
|
99
|
+
className: l(
|
|
100
|
+
R({ isUser: d, animation: m }),
|
|
101
|
+
"group relative",
|
|
102
|
+
t && "border-d-primary border"
|
|
103
|
+
),
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ e(
|
|
106
|
+
"div",
|
|
107
|
+
{
|
|
108
|
+
ref: c,
|
|
109
|
+
contentEditable: t,
|
|
110
|
+
onKeyDown: t ? v : void 0,
|
|
111
|
+
className: l(
|
|
112
|
+
"focus:outline-none",
|
|
113
|
+
!t && "pointer-events-none"
|
|
114
|
+
),
|
|
115
|
+
suppressContentEditableWarning: !0,
|
|
116
|
+
children: /* @__PURE__ */ e(
|
|
117
|
+
w,
|
|
118
|
+
{
|
|
119
|
+
fallback: /* @__PURE__ */ e("div", { className: "text-d-secondary-foreground", children: "Caricamento..." }),
|
|
120
|
+
children: /* @__PURE__ */ e(k, { children: n })
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
x && /* @__PURE__ */ e("div", { className: "absolute -top-2 -right-2 flex gap-1", children: t ? /* @__PURE__ */ o(C, { children: [
|
|
126
|
+
/* @__PURE__ */ e(
|
|
127
|
+
"button",
|
|
128
|
+
{
|
|
129
|
+
onClick: g,
|
|
130
|
+
className: "bg-d-background border-d-border hover:bg-d-muted rounded-full border p-1 transition-colors",
|
|
131
|
+
title: "Cancel",
|
|
132
|
+
children: /* @__PURE__ */ e(E, { className: "h-3 w-3" })
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
/* @__PURE__ */ e(
|
|
136
|
+
"button",
|
|
137
|
+
{
|
|
138
|
+
onClick: p,
|
|
139
|
+
className: "bg-d-background border-d-border hover:bg-d-muted rounded-full border p-1 transition-colors",
|
|
140
|
+
title: "Save",
|
|
141
|
+
children: /* @__PURE__ */ e(S, { className: "h-3 w-3" })
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
] }) : /* @__PURE__ */ e(
|
|
145
|
+
"button",
|
|
146
|
+
{
|
|
147
|
+
onClick: () => u(!0),
|
|
148
|
+
className: "bg-d-background border-d-border hover:bg-d-muted rounded-full border p-1 opacity-0 transition-opacity group-hover:opacity-100",
|
|
149
|
+
title: "Edit message",
|
|
150
|
+
children: /* @__PURE__ */ e(U, { className: "h-3 w-3" })
|
|
151
|
+
}
|
|
152
|
+
) })
|
|
153
|
+
]
|
|
82
154
|
}
|
|
83
|
-
)
|
|
84
|
-
|
|
155
|
+
),
|
|
156
|
+
f && a ? /* @__PURE__ */ e(
|
|
85
157
|
"time",
|
|
86
158
|
{
|
|
87
|
-
dateTime:
|
|
88
|
-
className:
|
|
159
|
+
dateTime: a.toISOString(),
|
|
160
|
+
className: l(
|
|
89
161
|
"mt-1 block px-1 text-xs opacity-50",
|
|
90
|
-
|
|
162
|
+
m !== "none" && "animate-in fade-in-0 duration-500"
|
|
91
163
|
),
|
|
92
|
-
children:
|
|
164
|
+
children: y
|
|
93
165
|
}
|
|
94
166
|
) : null
|
|
95
167
|
]
|
|
96
168
|
}
|
|
97
|
-
) :
|
|
169
|
+
) : N && N.length > 0 ? N.map((r, s) => r.type === "text" ? /* @__PURE__ */ o(
|
|
98
170
|
"div",
|
|
99
171
|
{
|
|
100
|
-
className:
|
|
172
|
+
className: l(
|
|
101
173
|
"flex flex-col",
|
|
102
|
-
|
|
174
|
+
d ? "items-end" : "items-start"
|
|
103
175
|
),
|
|
104
176
|
children: [
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
177
|
+
/* @__PURE__ */ o(
|
|
178
|
+
"div",
|
|
179
|
+
{
|
|
180
|
+
className: l(
|
|
181
|
+
R({ isUser: d, animation: m }),
|
|
182
|
+
"group relative",
|
|
183
|
+
t && "border-d-primary border"
|
|
184
|
+
),
|
|
185
|
+
children: [
|
|
186
|
+
/* @__PURE__ */ e(
|
|
187
|
+
"div",
|
|
188
|
+
{
|
|
189
|
+
ref: c,
|
|
190
|
+
contentEditable: t,
|
|
191
|
+
onKeyDown: t ? v : void 0,
|
|
192
|
+
className: l(
|
|
193
|
+
"focus:outline-none",
|
|
194
|
+
!t && "pointer-events-none"
|
|
195
|
+
),
|
|
196
|
+
suppressContentEditableWarning: !0,
|
|
197
|
+
children: /* @__PURE__ */ e(
|
|
198
|
+
w,
|
|
199
|
+
{
|
|
200
|
+
fallback: /* @__PURE__ */ e("div", { className: "text-d-secondary-foreground", children: "Caricamento..." }),
|
|
201
|
+
children: /* @__PURE__ */ e(k, { children: r.text })
|
|
202
|
+
}
|
|
203
|
+
)
|
|
204
|
+
}
|
|
205
|
+
),
|
|
206
|
+
x && /* @__PURE__ */ e("div", { className: "absolute -top-2 -right-2 flex gap-1", children: t ? /* @__PURE__ */ o(C, { children: [
|
|
207
|
+
/* @__PURE__ */ e(
|
|
208
|
+
"button",
|
|
209
|
+
{
|
|
210
|
+
onClick: g,
|
|
211
|
+
className: "bg-d-background border-d-border hover:bg-d-muted rounded-full border p-1 transition-colors",
|
|
212
|
+
title: "Cancel",
|
|
213
|
+
children: /* @__PURE__ */ e(E, { className: "h-3 w-3" })
|
|
214
|
+
}
|
|
215
|
+
),
|
|
216
|
+
/* @__PURE__ */ e(
|
|
217
|
+
"button",
|
|
218
|
+
{
|
|
219
|
+
onClick: p,
|
|
220
|
+
className: "bg-d-background border-d-border hover:bg-d-muted rounded-full border p-1 transition-colors",
|
|
221
|
+
title: "Save",
|
|
222
|
+
children: /* @__PURE__ */ e(S, { className: "h-3 w-3" })
|
|
223
|
+
}
|
|
224
|
+
)
|
|
225
|
+
] }) : /* @__PURE__ */ e(
|
|
226
|
+
"button",
|
|
227
|
+
{
|
|
228
|
+
onClick: () => u(!0),
|
|
229
|
+
className: "bg-d-background border-d-border hover:bg-d-muted rounded-full border p-1 opacity-0 transition-opacity group-hover:opacity-100",
|
|
230
|
+
title: "Edit message",
|
|
231
|
+
children: /* @__PURE__ */ e(U, { className: "h-3 w-3" })
|
|
232
|
+
}
|
|
233
|
+
) }),
|
|
234
|
+
b && !t ? /* @__PURE__ */ e("div", { className: "bg-d-background text-d-foreground border-d-border absolute right-2 -bottom-4 flex space-x-1 rounded-lg border p-1 opacity-0 transition-opacity group-hover/message:opacity-100", children: b }) : null
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
),
|
|
238
|
+
f && a ? /* @__PURE__ */ e(
|
|
116
239
|
"time",
|
|
117
240
|
{
|
|
118
|
-
dateTime:
|
|
119
|
-
className:
|
|
241
|
+
dateTime: a.toISOString(),
|
|
242
|
+
className: l(
|
|
120
243
|
"mt-1 block px-1 text-xs opacity-50",
|
|
121
|
-
|
|
244
|
+
m !== "none" && "animate-in fade-in-0 duration-500"
|
|
122
245
|
),
|
|
123
|
-
children:
|
|
246
|
+
children: y
|
|
124
247
|
}
|
|
125
248
|
) : null
|
|
126
249
|
]
|
|
127
250
|
},
|
|
128
|
-
`text-${
|
|
129
|
-
) :
|
|
130
|
-
|
|
251
|
+
`text-${s}`
|
|
252
|
+
) : r.type === "reasoning" ? /* @__PURE__ */ e(H, { part: r }, `reasoning-${s}`) : r.type === "tool-invocation" ? /* @__PURE__ */ e(
|
|
253
|
+
K,
|
|
131
254
|
{
|
|
132
|
-
toolInvocations: [
|
|
255
|
+
toolInvocations: [r.toolInvocation]
|
|
133
256
|
},
|
|
134
|
-
`tool-${
|
|
135
|
-
) : null) :
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
257
|
+
`tool-${s}`
|
|
258
|
+
) : null) : h && h.length > 0 ? /* @__PURE__ */ e(K, { toolInvocations: h }) : /* @__PURE__ */ o("div", { className: l("flex flex-col", d ? "items-end" : "items-start"), children: [
|
|
259
|
+
/* @__PURE__ */ o(
|
|
260
|
+
"div",
|
|
261
|
+
{
|
|
262
|
+
className: l(
|
|
263
|
+
R({ isUser: d, animation: m }),
|
|
264
|
+
"group relative",
|
|
265
|
+
t && "border-d-primary border"
|
|
266
|
+
),
|
|
267
|
+
children: [
|
|
268
|
+
/* @__PURE__ */ e(
|
|
269
|
+
"div",
|
|
270
|
+
{
|
|
271
|
+
ref: c,
|
|
272
|
+
contentEditable: t,
|
|
273
|
+
onKeyDown: t ? v : void 0,
|
|
274
|
+
className: l(
|
|
275
|
+
"focus:outline-none",
|
|
276
|
+
!t && "pointer-events-none"
|
|
277
|
+
),
|
|
278
|
+
suppressContentEditableWarning: !0,
|
|
279
|
+
children: /* @__PURE__ */ e(
|
|
280
|
+
w,
|
|
281
|
+
{
|
|
282
|
+
fallback: /* @__PURE__ */ e("div", { className: "text-d-secondary-foreground", children: "Caricamento..." }),
|
|
283
|
+
children: /* @__PURE__ */ e(k, { children: n })
|
|
284
|
+
}
|
|
285
|
+
)
|
|
286
|
+
}
|
|
287
|
+
),
|
|
288
|
+
x && /* @__PURE__ */ e("div", { className: "absolute -top-2 -right-2 flex gap-1", children: t ? /* @__PURE__ */ o(C, { children: [
|
|
289
|
+
/* @__PURE__ */ e(
|
|
290
|
+
"button",
|
|
291
|
+
{
|
|
292
|
+
onClick: g,
|
|
293
|
+
className: "bg-d-background border-d-border hover:bg-d-muted rounded-full border p-1 transition-colors",
|
|
294
|
+
title: "Cancel",
|
|
295
|
+
children: /* @__PURE__ */ e(E, { className: "h-3 w-3" })
|
|
296
|
+
}
|
|
297
|
+
),
|
|
298
|
+
/* @__PURE__ */ e(
|
|
299
|
+
"button",
|
|
300
|
+
{
|
|
301
|
+
onClick: p,
|
|
302
|
+
className: "bg-d-background border-d-border hover:bg-d-muted rounded-full border p-1 transition-colors",
|
|
303
|
+
title: "Save",
|
|
304
|
+
children: /* @__PURE__ */ e(S, { className: "h-3 w-3" })
|
|
305
|
+
}
|
|
306
|
+
)
|
|
307
|
+
] }) : /* @__PURE__ */ e(
|
|
308
|
+
"button",
|
|
309
|
+
{
|
|
310
|
+
onClick: () => u(!0),
|
|
311
|
+
className: "bg-d-background border-d-border hover:bg-d-muted rounded-full border p-1 opacity-0 transition-opacity group-hover:opacity-100",
|
|
312
|
+
title: "Edit message",
|
|
313
|
+
children: /* @__PURE__ */ e(U, { className: "h-3 w-3" })
|
|
314
|
+
}
|
|
315
|
+
) }),
|
|
316
|
+
b && !t ? /* @__PURE__ */ e("div", { className: "bg-d-background text-foreground absolute right-2 -bottom-4 flex space-x-1 rounded-lg border p-1 opacity-0 transition-opacity group-hover/message:opacity-100", children: b }) : null
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
),
|
|
320
|
+
f && a ? /* @__PURE__ */ e(
|
|
147
321
|
"time",
|
|
148
322
|
{
|
|
149
|
-
dateTime:
|
|
150
|
-
className:
|
|
323
|
+
dateTime: a.toISOString(),
|
|
324
|
+
className: l(
|
|
151
325
|
"mt-1 block px-1 text-xs opacity-50",
|
|
152
|
-
|
|
326
|
+
m !== "none" && "animate-in fade-in-0 duration-500"
|
|
153
327
|
),
|
|
154
|
-
children:
|
|
328
|
+
children: y
|
|
155
329
|
}
|
|
156
330
|
) : null
|
|
157
331
|
] });
|
|
158
332
|
};
|
|
159
|
-
function
|
|
160
|
-
const
|
|
161
|
-
return new Uint8Array(
|
|
333
|
+
function G(i) {
|
|
334
|
+
const n = i.split(",")[1], a = Buffer.from(n, "base64");
|
|
335
|
+
return new Uint8Array(a);
|
|
162
336
|
}
|
|
163
|
-
const
|
|
164
|
-
const [
|
|
165
|
-
return /* @__PURE__ */ e("div", { className: "mb-2 flex flex-col items-start sm:max-w-[70%]", children: /* @__PURE__ */
|
|
166
|
-
|
|
337
|
+
const H = ({ part: i }) => {
|
|
338
|
+
const [n, a] = B(!1);
|
|
339
|
+
return /* @__PURE__ */ e("div", { className: "mb-2 flex flex-col items-start sm:max-w-[70%]", children: /* @__PURE__ */ o(
|
|
340
|
+
j,
|
|
167
341
|
{
|
|
168
|
-
open:
|
|
169
|
-
onOpenChange:
|
|
342
|
+
open: n,
|
|
343
|
+
onOpenChange: a,
|
|
170
344
|
className: "group bg-d-secondary/50 border-d-border w-full overflow-hidden rounded-lg",
|
|
171
345
|
children: [
|
|
172
|
-
/* @__PURE__ */ e("div", { className: "flex items-center p-2", children: /* @__PURE__ */ e(
|
|
173
|
-
/* @__PURE__ */ e(
|
|
346
|
+
/* @__PURE__ */ e("div", { className: "flex items-center p-2", children: /* @__PURE__ */ e(L, { asChild: !0, children: /* @__PURE__ */ o("button", { className: "text-d-secondary-foreground hover:text-d-foreground flex items-center gap-2 text-sm", children: [
|
|
347
|
+
/* @__PURE__ */ e(X, { className: "h-4 w-4 transition-transform group-data-[state=open]:rotate-90" }),
|
|
174
348
|
/* @__PURE__ */ e("span", { children: "Thinking" })
|
|
175
349
|
] }) }) }),
|
|
176
|
-
/* @__PURE__ */ e(
|
|
177
|
-
|
|
350
|
+
/* @__PURE__ */ e(P, { forceMount: !0, children: /* @__PURE__ */ e(
|
|
351
|
+
$.div,
|
|
178
352
|
{
|
|
179
353
|
initial: !1,
|
|
180
|
-
animate:
|
|
354
|
+
animate: n ? "open" : "closed",
|
|
181
355
|
variants: {
|
|
182
356
|
open: { height: "auto", opacity: 1 },
|
|
183
357
|
closed: { height: 0, opacity: 0 }
|
|
184
358
|
},
|
|
185
359
|
transition: { duration: 0.3, ease: [0.04, 0.62, 0.23, 0.98] },
|
|
186
360
|
className: "border-d-border border-t",
|
|
187
|
-
children: /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e("div", { className: "text-xs whitespace-pre-wrap", children:
|
|
361
|
+
children: /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e("div", { className: "text-xs whitespace-pre-wrap", children: i.reasoning }) })
|
|
188
362
|
}
|
|
189
363
|
) })
|
|
190
364
|
]
|
|
191
365
|
}
|
|
192
366
|
) });
|
|
193
367
|
};
|
|
194
|
-
function
|
|
195
|
-
toolInvocations:
|
|
368
|
+
function K({
|
|
369
|
+
toolInvocations: i
|
|
196
370
|
}) {
|
|
197
|
-
return
|
|
198
|
-
if (
|
|
199
|
-
return /* @__PURE__ */
|
|
371
|
+
return i?.length ? /* @__PURE__ */ e("div", { className: "flex flex-col items-start gap-2", children: i.map((n, a) => {
|
|
372
|
+
if (n.state === "result" && n.result.__cancelled === !0)
|
|
373
|
+
return /* @__PURE__ */ o(
|
|
200
374
|
"div",
|
|
201
375
|
{
|
|
202
376
|
className: "bg-d-secondary/50 text-d-secondary-foreground border-d-border flex items-center gap-2 rounded-lg border px-3 py-2 text-sm",
|
|
203
377
|
children: [
|
|
204
|
-
/* @__PURE__ */ e(
|
|
205
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ e(z, { className: "h-4 w-4" }),
|
|
379
|
+
/* @__PURE__ */ o("span", { children: [
|
|
206
380
|
"Cancelled",
|
|
207
381
|
" ",
|
|
208
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ o("span", { className: "font-mono", children: [
|
|
209
383
|
"`",
|
|
210
|
-
|
|
384
|
+
n.toolName,
|
|
211
385
|
"`"
|
|
212
386
|
] })
|
|
213
387
|
] })
|
|
214
388
|
]
|
|
215
389
|
},
|
|
216
|
-
|
|
390
|
+
a
|
|
217
391
|
);
|
|
218
|
-
switch (
|
|
392
|
+
switch (n.state) {
|
|
219
393
|
case "partial-call":
|
|
220
394
|
case "call":
|
|
221
|
-
return /* @__PURE__ */
|
|
395
|
+
return /* @__PURE__ */ o(
|
|
222
396
|
"div",
|
|
223
397
|
{
|
|
224
398
|
className: "bg-d-secondary/50 text-d-secondary-foreground border-d-border flex items-center gap-2 rounded-lg border px-3 py-2 text-sm",
|
|
225
399
|
children: [
|
|
226
|
-
/* @__PURE__ */ e(
|
|
227
|
-
/* @__PURE__ */
|
|
400
|
+
/* @__PURE__ */ e(_, { className: "h-4 w-4" }),
|
|
401
|
+
/* @__PURE__ */ o("span", { children: [
|
|
228
402
|
"Calling",
|
|
229
403
|
" ",
|
|
230
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ o("span", { className: "font-mono", children: [
|
|
231
405
|
"`",
|
|
232
|
-
|
|
406
|
+
n.toolName,
|
|
233
407
|
"`"
|
|
234
408
|
] }),
|
|
235
409
|
"..."
|
|
236
410
|
] }),
|
|
237
|
-
/* @__PURE__ */ e(
|
|
411
|
+
/* @__PURE__ */ e(q, { className: "h-3 w-3 animate-spin" })
|
|
238
412
|
]
|
|
239
413
|
},
|
|
240
|
-
|
|
414
|
+
a
|
|
241
415
|
);
|
|
242
416
|
case "result":
|
|
243
|
-
return /* @__PURE__ */
|
|
417
|
+
return /* @__PURE__ */ o(
|
|
244
418
|
"div",
|
|
245
419
|
{
|
|
246
420
|
className: "bg-d-secondary/50 border-d-border flex flex-col gap-1.5 rounded-lg border px-3 py-2 text-sm",
|
|
247
421
|
children: [
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
-
/* @__PURE__ */ e(
|
|
250
|
-
/* @__PURE__ */
|
|
422
|
+
/* @__PURE__ */ o("div", { className: "text-d-secondary-foreground flex items-center gap-2", children: [
|
|
423
|
+
/* @__PURE__ */ e(J, { className: "h-4 w-4" }),
|
|
424
|
+
/* @__PURE__ */ o("span", { children: [
|
|
251
425
|
"Result from",
|
|
252
426
|
" ",
|
|
253
|
-
/* @__PURE__ */
|
|
427
|
+
/* @__PURE__ */ o("span", { className: "font-mono", children: [
|
|
254
428
|
"`",
|
|
255
|
-
|
|
429
|
+
n.toolName,
|
|
256
430
|
"`"
|
|
257
431
|
] })
|
|
258
432
|
] })
|
|
259
433
|
] }),
|
|
260
|
-
/* @__PURE__ */ e("pre", { className: "text-d-foreground overflow-x-auto whitespace-pre-wrap", children: JSON.stringify(
|
|
434
|
+
/* @__PURE__ */ e("pre", { className: "text-d-foreground overflow-x-auto whitespace-pre-wrap", children: JSON.stringify(n.result, null, 2) })
|
|
261
435
|
]
|
|
262
436
|
},
|
|
263
|
-
|
|
437
|
+
a
|
|
264
438
|
);
|
|
265
439
|
default:
|
|
266
440
|
return null;
|
|
@@ -268,5 +442,5 @@ function y({
|
|
|
268
442
|
}) }) : null;
|
|
269
443
|
}
|
|
270
444
|
export {
|
|
271
|
-
|
|
445
|
+
fe as ChatMessage
|
|
272
446
|
};
|