@deepagents/react-genai 7.43.4 → 7.44.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/dist/index.js +911 -875
- package/dist/index.js.map +1 -1
- package/dist/lib/chat/agent-context.d.ts.map +1 -1
- package/dist/lib/chat/chat-manager.d.ts +8 -1
- package/dist/lib/chat/chat-manager.d.ts.map +1 -1
- package/dist/lib/chat/markdown-paragraph.d.ts +2 -1
- package/dist/lib/chat/markdown-paragraph.d.ts.map +1 -1
- package/dist/lib/chat/trajectory/trajectories/user-message.d.ts.map +1 -1
- package/dist/lib/components/CitationPill.d.ts +4 -1
- package/dist/lib/components/CitationPill.d.ts.map +1 -1
- package/dist/lib/components/InteractiveResponse.d.ts.map +1 -1
- package/dist/lib/elements/Response.d.ts +1 -1
- package/dist/lib/elements/Response.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -10,44 +10,44 @@ import { useStickToBottom as ie } from "use-stick-to-bottom";
|
|
|
10
10
|
import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
11
11
|
import { assertNoReservedAttributes as ae, defineElements as oe, toDescriptor as se } from "@deepagents/elements";
|
|
12
12
|
import { z as P } from "zod";
|
|
13
|
-
import { Alert as ce, AlertDescription as le, AlertTitle as ue, Attachment as de, AttachmentGroup as fe, AttachmentMedia as pe, Badge as me, Button as he, Card as ge, CardAction as _e, CardContent as ve, CardDescription as ye, CardFooter as be, CardHeader as xe, CardTitle as Se, CodeBlock as Ce, CodeBlockActions as we, CodeBlockContent as Te, CodeBlockLine as Ee, Collapsible as F, CollapsibleContent as I, CollapsibleTrigger as L,
|
|
14
|
-
import { AlertCircle as
|
|
15
|
-
import { toString as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { Block as
|
|
20
|
-
import { unified as
|
|
21
|
-
import { SKIP as
|
|
22
|
-
import { TheButton as
|
|
23
|
-
import { createPortal as
|
|
24
|
-
import { Composer as R, PersistedPromptText as
|
|
25
|
-
import { get as
|
|
26
|
-
import { formatCompactNumber as
|
|
13
|
+
import { Alert as ce, AlertDescription as le, AlertTitle as ue, Attachment as de, AttachmentGroup as fe, AttachmentMedia as pe, Badge as me, Button as he, Card as ge, CardAction as _e, CardContent as ve, CardDescription as ye, CardFooter as be, CardHeader as xe, CardTitle as Se, CodeBlock as Ce, CodeBlockActions as we, CodeBlockContent as Te, CodeBlockLine as Ee, Collapsible as F, CollapsibleContent as I, CollapsibleTrigger as L, Popover as De, PopoverContent as Oe, PopoverDescription as ke, PopoverHeader as Ae, PopoverTitle as je, PopoverTrigger as Me, buttonVariants as Ne, useHighlightedCode as Pe } from "@zukhruf/shadcn";
|
|
14
|
+
import { AlertCircle as Fe, BanIcon as Ie, Braces as Le, Check as Re, CheckCircleIcon as ze, CheckIcon as Be, ChevronDown as Ve, ChevronDownIcon as He, ChevronRight as Ue, CircleIcon as We, ClockIcon as Ge, Copy as Ke, CopyIcon as qe, Lightbulb as Je, ListPlus as Ye, Loader as Xe, Loader2Icon as Ze, MicIcon as Qe, Paperclip as $e, Plus as et, RefreshCw as tt, SquareIcon as nt, Trash2 as rt, WrenchIcon as it, XCircleIcon as at, XIcon as ot } from "lucide-react";
|
|
15
|
+
import { toString as st } from "mdast-util-to-string";
|
|
16
|
+
import ct from "remark-directive";
|
|
17
|
+
import lt from "remark-gfm";
|
|
18
|
+
import ut from "remark-parse";
|
|
19
|
+
import { Block as dt, Streamdown as ft, TableCopyDropdown as pt, TableDownloadDropdown as mt, defaultRemarkPlugins as ht, detectTextDirection as gt, parseMarkdownIntoBlocks as _t } from "streamdown";
|
|
20
|
+
import { unified as vt } from "unified";
|
|
21
|
+
import { SKIP as yt, visit as bt } from "unist-util-visit";
|
|
22
|
+
import { TheButton as xt, useClock as St } from "@zukhruf/ui";
|
|
23
|
+
import { createPortal as Ct } from "react-dom";
|
|
24
|
+
import { Composer as R, PersistedPromptText as wt, useComposer as Tt, useComposerDictation as Et } from "@deepagents/react-input/browser";
|
|
25
|
+
import { get as Dt } from "lodash-es";
|
|
26
|
+
import { formatCompactNumber as Ot, formatNullableNumber as kt } from "@deepagents/react-formatters";
|
|
27
27
|
//#region src/lib/chat/prefill.ts
|
|
28
|
-
var
|
|
29
|
-
function
|
|
28
|
+
var At = "pending-chat-prefill";
|
|
29
|
+
function jt() {
|
|
30
30
|
try {
|
|
31
|
-
let e = sessionStorage.getItem(
|
|
31
|
+
let e = sessionStorage.getItem(At);
|
|
32
32
|
return e ? JSON.parse(e) : null;
|
|
33
33
|
} catch {
|
|
34
|
-
return sessionStorage.removeItem(
|
|
34
|
+
return sessionStorage.removeItem(At), null;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
sessionStorage.setItem(
|
|
37
|
+
function Mt(e) {
|
|
38
|
+
sessionStorage.setItem(At, JSON.stringify(e));
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
sessionStorage.removeItem(
|
|
40
|
+
function Nt() {
|
|
41
|
+
sessionStorage.removeItem(At);
|
|
42
42
|
}
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/lib/chat/chat-manager.ts
|
|
45
|
-
function
|
|
45
|
+
function Pt(e) {
|
|
46
46
|
let t = D(e.metadata) ? e.metadata.persistedPrompt : void 0;
|
|
47
47
|
if (typeof t != "string") throw Error(`Message ${e.id} has no persistedPrompt: send it with useAgent().submit.`);
|
|
48
48
|
return t;
|
|
49
49
|
}
|
|
50
|
-
var
|
|
50
|
+
var Ft = class {
|
|
51
51
|
chat;
|
|
52
52
|
uploadFile;
|
|
53
53
|
submissions = new v();
|
|
@@ -59,7 +59,10 @@ var kt = class {
|
|
|
59
59
|
this.chat = e;
|
|
60
60
|
}
|
|
61
61
|
initialize(e) {
|
|
62
|
-
|
|
62
|
+
let t = new AbortController();
|
|
63
|
+
return queueMicrotask(() => {
|
|
64
|
+
t.signal.aborted || this.consumePrefill(e);
|
|
65
|
+
}), () => t.abort();
|
|
63
66
|
}
|
|
64
67
|
submit(e) {
|
|
65
68
|
this.chat.clearError();
|
|
@@ -110,14 +113,14 @@ var kt = class {
|
|
|
110
113
|
}
|
|
111
114
|
resetChat(e) {
|
|
112
115
|
let t = crypto.randomUUID();
|
|
113
|
-
e &&
|
|
116
|
+
e && Mt({
|
|
114
117
|
prompt: e,
|
|
115
118
|
targetChatId: t
|
|
116
119
|
}), this.onResetChat(t);
|
|
117
120
|
}
|
|
118
121
|
consumePrefill(e) {
|
|
119
|
-
let t =
|
|
120
|
-
!t || t.targetChatId !== e || (
|
|
122
|
+
let t = jt();
|
|
123
|
+
!t || t.targetChatId !== e || (Nt(), this.submit({
|
|
121
124
|
prompt: t.prompt,
|
|
122
125
|
persistedPrompt: t.prompt
|
|
123
126
|
}));
|
|
@@ -144,7 +147,7 @@ var kt = class {
|
|
|
144
147
|
};
|
|
145
148
|
//#endregion
|
|
146
149
|
//#region src/lib/chat/client-tool-output.ts
|
|
147
|
-
async function
|
|
150
|
+
async function It(e, t, n) {
|
|
148
151
|
let r = t?.[n.toolName];
|
|
149
152
|
n.toolName.startsWith("render") && r?.static === !1 && r.requiresUserInput !== !0 && await e.addToolOutput({
|
|
150
153
|
toolCallId: n.toolCallId,
|
|
@@ -155,7 +158,7 @@ async function At(e, t, n) {
|
|
|
155
158
|
}
|
|
156
159
|
//#endregion
|
|
157
160
|
//#region src/lib/chat/chat.tsx
|
|
158
|
-
function
|
|
161
|
+
function Lt(t) {
|
|
159
162
|
let n = e({
|
|
160
163
|
id: t.chatId,
|
|
161
164
|
messages: t.initialMessages,
|
|
@@ -165,22 +168,22 @@ function jt(t) {
|
|
|
165
168
|
resume: t.resume,
|
|
166
169
|
onData: t.onData,
|
|
167
170
|
onFinish: t.onFinish,
|
|
168
|
-
sendAutomaticallyWhen:
|
|
171
|
+
sendAutomaticallyWhen: Rt,
|
|
169
172
|
onToolCall(e) {
|
|
170
173
|
let { toolCall: r } = e;
|
|
171
|
-
|
|
174
|
+
It(n, t.registry, r);
|
|
172
175
|
}
|
|
173
176
|
});
|
|
174
177
|
return n;
|
|
175
178
|
}
|
|
176
|
-
function
|
|
179
|
+
function Rt(e) {
|
|
177
180
|
return E(e) || T(e);
|
|
178
181
|
}
|
|
179
|
-
function
|
|
182
|
+
function zt(e) {
|
|
180
183
|
let t = O(2), n;
|
|
181
|
-
return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ M(
|
|
184
|
+
return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ M(Bt, { ...e }), t[0] = e, t[1] = n), n;
|
|
182
185
|
}
|
|
183
|
-
function
|
|
186
|
+
function Bt(e) {
|
|
184
187
|
let t = O(13), n;
|
|
185
188
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = { initial: "smooth" }, t[0] = n) : n = t[0];
|
|
186
189
|
let { scrollRef: r, contentRef: i } = ie(n), { hasSubmitted: a } = V(), o;
|
|
@@ -203,7 +206,7 @@ function Pt(e) {
|
|
|
203
206
|
children: l
|
|
204
207
|
}), t[9] = r, t[10] = o, t[11] = l, t[12] = u) : u = t[12], u;
|
|
205
208
|
}
|
|
206
|
-
function
|
|
209
|
+
function Vt(e) {
|
|
207
210
|
let t = O(12), { hasSubmitted: n } = V(), r;
|
|
208
211
|
t[0] !== n || t[1] !== e.className ? (r = k(n ? k("bg-background sticky top-0 z-10 shrink-0 space-y-1 backdrop-blur-md", e.className) : "relative flex justify-center py-4"), t[0] = n, t[1] = e.className, t[2] = r) : r = t[2];
|
|
209
212
|
let i;
|
|
@@ -232,8 +235,8 @@ function Ft(e) {
|
|
|
232
235
|
children: s
|
|
233
236
|
}), t[9] = r, t[10] = s, t[11] = c) : c = t[11], c;
|
|
234
237
|
}
|
|
235
|
-
|
|
236
|
-
function
|
|
238
|
+
Vt.displayName = "AgentHeader.Root";
|
|
239
|
+
function Ht(e) {
|
|
237
240
|
let t = O(6), { hasSubmitted: n } = V(), r;
|
|
238
241
|
t[0] !== n || t[1] !== e.children || t[2] !== e.icon ? (r = !n && /* @__PURE__ */ M(A.div, {
|
|
239
242
|
exit: { opacity: 0 },
|
|
@@ -249,8 +252,8 @@ function It(e) {
|
|
|
249
252
|
children: r
|
|
250
253
|
}), t[4] = r, t[5] = i), i;
|
|
251
254
|
}
|
|
252
|
-
|
|
253
|
-
function
|
|
255
|
+
Ht.displayName = "AgentHeader.Hero";
|
|
256
|
+
function Ut(e) {
|
|
254
257
|
let t = O(2), n;
|
|
255
258
|
return t[0] === e.children ? n = t[1] : (n = /* @__PURE__ */ M(A.h2, {
|
|
256
259
|
layout: "position",
|
|
@@ -258,8 +261,8 @@ function Lt(e) {
|
|
|
258
261
|
children: e.children
|
|
259
262
|
}), t[0] = e.children, t[1] = n), n;
|
|
260
263
|
}
|
|
261
|
-
|
|
262
|
-
function
|
|
264
|
+
Ut.displayName = "AgentHeader.Title";
|
|
265
|
+
function Wt(e) {
|
|
263
266
|
let t = O(5), { hasSubmitted: n } = V(), r;
|
|
264
267
|
t[0] !== n || t[1] !== e.children ? (r = n && !!e.children && /* @__PURE__ */ M(A.p, {
|
|
265
268
|
initial: { opacity: 0 },
|
|
@@ -271,15 +274,15 @@ function Rt(e) {
|
|
|
271
274
|
let i;
|
|
272
275
|
return t[3] === r ? i = t[4] : (i = /* @__PURE__ */ M(te, { children: r }), t[3] = r, t[4] = i), i;
|
|
273
276
|
}
|
|
274
|
-
|
|
275
|
-
var
|
|
276
|
-
Root:
|
|
277
|
-
Hero:
|
|
278
|
-
Title:
|
|
279
|
-
Description:
|
|
280
|
-
},
|
|
281
|
-
function
|
|
282
|
-
let p =
|
|
277
|
+
Wt.displayName = "AgentHeader.Description";
|
|
278
|
+
var Gt = {
|
|
279
|
+
Root: Vt,
|
|
280
|
+
Hero: Ht,
|
|
281
|
+
Title: Ut,
|
|
282
|
+
Description: Wt
|
|
283
|
+
}, Kt = o(void 0), qt = o("ready"), Jt = o(void 0), Yt = o(null), Xt = o(void 0);
|
|
284
|
+
function Zt({ chatId: e, children: t, skipInitialView: n, debugMode: r, registry: i, initialMessages: a, transport: o, resume: s, onData: c, onFinish: l, onResetChat: f }) {
|
|
285
|
+
let p = Lt({
|
|
283
286
|
chatId: e,
|
|
284
287
|
transport: o,
|
|
285
288
|
registry: i,
|
|
@@ -293,14 +296,12 @@ function Gt({ chatId: e, children: t, skipInitialView: n, debugMode: r, registry
|
|
|
293
296
|
}, [f]);
|
|
294
297
|
let x = u((e) => {
|
|
295
298
|
b.current(e);
|
|
296
|
-
}, []), [S] = g(() => new
|
|
299
|
+
}, []), [S] = g(() => new Ft({
|
|
297
300
|
chat: p,
|
|
298
301
|
uploadFile: o.uploadFile.bind(o),
|
|
299
302
|
onResetChat: x
|
|
300
303
|
}));
|
|
301
|
-
S.bind(p), d(() =>
|
|
302
|
-
S.initialize(e);
|
|
303
|
-
}, [S, e]);
|
|
304
|
+
S.bind(p), d(() => S.initialize(e), [S, e]);
|
|
304
305
|
let C = m(() => ({
|
|
305
306
|
clearChat: () => S.clearChat(),
|
|
306
307
|
resetChat: (e) => S.resetChat(e),
|
|
@@ -328,15 +329,15 @@ function Gt({ chatId: e, children: t, skipInitialView: n, debugMode: r, registry
|
|
|
328
329
|
p.error,
|
|
329
330
|
p.experimental_queuedMessages
|
|
330
331
|
]), E = !!n || p.messages.length > 0, D = m(() => ({ hasSubmitted: E }), [E]);
|
|
331
|
-
return /* @__PURE__ */ M(
|
|
332
|
+
return /* @__PURE__ */ M(Yt, {
|
|
332
333
|
value: S,
|
|
333
|
-
children: /* @__PURE__ */ M(
|
|
334
|
+
children: /* @__PURE__ */ M(Kt, {
|
|
334
335
|
value: w,
|
|
335
|
-
children: /* @__PURE__ */ M(
|
|
336
|
+
children: /* @__PURE__ */ M(qt, {
|
|
336
337
|
value: p.status,
|
|
337
|
-
children: /* @__PURE__ */ M(
|
|
338
|
+
children: /* @__PURE__ */ M(Jt, {
|
|
338
339
|
value: T,
|
|
339
|
-
children: /* @__PURE__ */ M(
|
|
340
|
+
children: /* @__PURE__ */ M(Xt, {
|
|
340
341
|
value: D,
|
|
341
342
|
children: t
|
|
342
343
|
})
|
|
@@ -346,31 +347,31 @@ function Gt({ chatId: e, children: t, skipInitialView: n, debugMode: r, registry
|
|
|
346
347
|
});
|
|
347
348
|
}
|
|
348
349
|
function z() {
|
|
349
|
-
let e = l(
|
|
350
|
+
let e = l(Kt);
|
|
350
351
|
if (e === void 0) throw Error("useAgent must be used within an AgentProvider");
|
|
351
352
|
return e;
|
|
352
353
|
}
|
|
353
354
|
function B() {
|
|
354
|
-
return { status: l(
|
|
355
|
+
return { status: l(qt) };
|
|
355
356
|
}
|
|
356
357
|
function V() {
|
|
357
|
-
let e = l(
|
|
358
|
+
let e = l(Xt);
|
|
358
359
|
if (e === void 0) throw Error("useAgentMeta must be used within an AgentProvider");
|
|
359
360
|
return e;
|
|
360
361
|
}
|
|
361
362
|
function H() {
|
|
362
|
-
let e = l(
|
|
363
|
+
let e = l(Jt);
|
|
363
364
|
if (e === void 0) throw Error("useAgentMessages must be used within an AgentProvider");
|
|
364
365
|
return e;
|
|
365
366
|
}
|
|
366
|
-
function
|
|
367
|
-
let e = l(
|
|
367
|
+
function Qt() {
|
|
368
|
+
let e = l(Yt);
|
|
368
369
|
if (!e) throw Error("useChatManager must be used within an AgentProvider");
|
|
369
370
|
return e;
|
|
370
371
|
}
|
|
371
372
|
//#endregion
|
|
372
373
|
//#region src/lib/chat/citations.ts
|
|
373
|
-
function
|
|
374
|
+
function $t(e) {
|
|
374
375
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
375
376
|
for (let r of e) for (let e of r.parts) e.type === "source-url" && (t.has(e.url) || (t.add(e.url), n.push({
|
|
376
377
|
url: e.url,
|
|
@@ -378,13 +379,13 @@ function qt(e) {
|
|
|
378
379
|
})));
|
|
379
380
|
return n;
|
|
380
381
|
}
|
|
381
|
-
function
|
|
382
|
+
function en(e, t) {
|
|
382
383
|
let n = e.findIndex((e) => e.url === t);
|
|
383
384
|
return n === -1 ? null : n + 1;
|
|
384
385
|
}
|
|
385
386
|
//#endregion
|
|
386
387
|
//#region src/lib/chat/read-only-transport.ts
|
|
387
|
-
var
|
|
388
|
+
var tn = class {
|
|
388
389
|
sendMessages() {
|
|
389
390
|
return Promise.reject(/* @__PURE__ */ Error("This chat is read-only: it has no transport to send messages through."));
|
|
390
391
|
}
|
|
@@ -394,19 +395,19 @@ var Yt = class {
|
|
|
394
395
|
};
|
|
395
396
|
//#endregion
|
|
396
397
|
//#region src/lib/chat/tool-abort.ts
|
|
397
|
-
function
|
|
398
|
+
function nn(e, t) {
|
|
398
399
|
return t === "streaming" || t === "submitted" ? !1 : e === "input-streaming" || e === "input-available";
|
|
399
400
|
}
|
|
400
|
-
function
|
|
401
|
-
return
|
|
401
|
+
function rn(e, t) {
|
|
402
|
+
return nn(e.state, t);
|
|
402
403
|
}
|
|
403
|
-
function
|
|
404
|
+
function an(e) {
|
|
404
405
|
let t = O(3), { status: n } = B(), r;
|
|
405
|
-
return t[0] !== e || t[1] !== n ? (r =
|
|
406
|
+
return t[0] !== e || t[1] !== n ? (r = rn(e, n), t[0] = e, t[1] = n, t[2] = r) : r = t[2], r;
|
|
406
407
|
}
|
|
407
408
|
//#endregion
|
|
408
409
|
//#region src/lib/chat/tools-schema.ts
|
|
409
|
-
function
|
|
410
|
+
function on(e) {
|
|
410
411
|
return Object.entries(e).reduce((e, [t, n]) => (n.static || (e[t] = {
|
|
411
412
|
inputSchema: P.toJSONSchema(n.inputSchema, {
|
|
412
413
|
io: "input",
|
|
@@ -431,31 +432,31 @@ function U(e) {
|
|
|
431
432
|
}
|
|
432
433
|
//#endregion
|
|
433
434
|
//#region src/lib/chat/trajectory/compact-disclosure.tsx
|
|
434
|
-
function
|
|
435
|
+
function sn(e) {
|
|
435
436
|
let t = O(4), { className: n } = e, r;
|
|
436
437
|
t[0] === n ? r = t[1] : (r = k("size-3.5 shrink-0 transition-transform group-data-[panel-open]:rotate-90", n), t[0] = n, t[1] = r);
|
|
437
438
|
let i;
|
|
438
|
-
return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ M(
|
|
439
|
+
return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ M(Ue, {
|
|
439
440
|
"aria-hidden": !0,
|
|
440
441
|
className: r
|
|
441
442
|
}), t[2] = r, t[3] = i), i;
|
|
442
443
|
}
|
|
443
|
-
function
|
|
444
|
+
function cn(e) {
|
|
444
445
|
return k("group hover:bg-muted/30 flex min-h-7 w-full gap-2 rounded-sm py-1 text-left transition-colors", e);
|
|
445
446
|
}
|
|
446
447
|
//#endregion
|
|
447
448
|
//#region src/lib/chat/trajectory/IndexProgressSegment.tsx
|
|
448
|
-
var
|
|
449
|
+
var ln = "data-text2sql-index-progress", un = {
|
|
449
450
|
initial: "instant",
|
|
450
451
|
resize: "instant"
|
|
451
452
|
};
|
|
452
|
-
function
|
|
453
|
-
return e.type ===
|
|
453
|
+
function dn(e) {
|
|
454
|
+
return e.type === ln;
|
|
454
455
|
}
|
|
455
|
-
function
|
|
456
|
-
return e.parts.filter(
|
|
456
|
+
function fn(e) {
|
|
457
|
+
return e.parts.filter(dn).map((e) => e.data);
|
|
457
458
|
}
|
|
458
|
-
function
|
|
459
|
+
function pn(e) {
|
|
459
460
|
let t = /* @__PURE__ */ new Map(), n = "running", r, i, a = (e, n) => {
|
|
460
461
|
let r = t.get(e) ?? {
|
|
461
462
|
name: e,
|
|
@@ -517,11 +518,11 @@ function sn(e) {
|
|
|
517
518
|
errorMessage: i
|
|
518
519
|
};
|
|
519
520
|
}
|
|
520
|
-
function
|
|
521
|
+
function mn(e) {
|
|
521
522
|
let t = O(2), n;
|
|
522
|
-
return t[0] === e ? n = t[1] : (n =
|
|
523
|
+
return t[0] === e ? n = t[1] : (n = pn(e), t[0] = e, t[1] = n), n;
|
|
523
524
|
}
|
|
524
|
-
function
|
|
525
|
+
function hn(e) {
|
|
525
526
|
let t = O(7), { status: n, resetKey: r, controlledOpen: i, onOpenChange: a } = e, o = `${r}:${n}`, [s, c] = g(null), l = i ?? (s?.key === o ? s.open : n === "running"), u;
|
|
526
527
|
t[0] !== i || t[1] !== o || t[2] !== a ? (u = (e) => {
|
|
527
528
|
i === void 0 && c({
|
|
@@ -535,20 +536,20 @@ function ln(e) {
|
|
|
535
536
|
handleOpenChange: d
|
|
536
537
|
}, t[4] = d, t[5] = l, t[6] = f) : f = t[6], f;
|
|
537
538
|
}
|
|
538
|
-
function
|
|
539
|
+
function gn(e, t) {
|
|
539
540
|
return e.length === 0 ? !0 : t.status !== "complete" || t.adapters.length === 0 ? !1 : t.adapters.every((e) => e.status === "cache-hit");
|
|
540
541
|
}
|
|
541
|
-
function
|
|
542
|
+
function _n(e) {
|
|
542
543
|
return e.filter((e) => e.type === "index:start").length;
|
|
543
544
|
}
|
|
544
|
-
function
|
|
545
|
+
function vn(e) {
|
|
545
546
|
return e.filter((e) => [
|
|
546
547
|
"adapter:start",
|
|
547
548
|
"adapter:cache-hit",
|
|
548
549
|
"adapter:cache-miss"
|
|
549
550
|
].includes(e.type)).length;
|
|
550
551
|
}
|
|
551
|
-
function
|
|
552
|
+
function yn(e) {
|
|
552
553
|
let t = (e.totalAdapters ?? e.adapters.length) > 1;
|
|
553
554
|
if (e.status === "error") {
|
|
554
555
|
let n = e.adapters.find((e) => e.status === "error");
|
|
@@ -564,7 +565,7 @@ function pn(e) {
|
|
|
564
565
|
}
|
|
565
566
|
return e.adapters.length === 0 || !t ? ["Schema indexed"] : ["Schema indexed", `${e.adapters.length} adapters`];
|
|
566
567
|
}
|
|
567
|
-
function
|
|
568
|
+
function bn(e) {
|
|
568
569
|
if (e.status === "error") return [
|
|
569
570
|
"Failed",
|
|
570
571
|
e.name,
|
|
@@ -588,18 +589,18 @@ function mn(e) {
|
|
|
588
589
|
"queued"
|
|
589
590
|
];
|
|
590
591
|
}
|
|
591
|
-
function
|
|
592
|
+
function xn(e) {
|
|
592
593
|
return ["Failed", e.errorMessage ?? "unknown error"];
|
|
593
594
|
}
|
|
594
|
-
var
|
|
595
|
-
function
|
|
596
|
-
let t = l(
|
|
595
|
+
var Sn = o(null);
|
|
596
|
+
function Cn(e) {
|
|
597
|
+
let t = l(Sn);
|
|
597
598
|
if (!t) throw Error(`<IndexProgress.${e}> must be used inside <IndexProgress.Root>`);
|
|
598
599
|
return t;
|
|
599
600
|
}
|
|
600
|
-
function
|
|
601
|
-
let t = O(21), { events: n, open: r, onOpenChange: i, children: a, className: o } = e, s =
|
|
602
|
-
t[0] === n ? l = t[1] : (l =
|
|
601
|
+
function wn(e) {
|
|
602
|
+
let t = O(21), { events: n, open: r, onOpenChange: i, children: a, className: o } = e, s = mn(n), c = s.status, l;
|
|
603
|
+
t[0] === n ? l = t[1] : (l = _n(n), t[0] = n, t[1] = l);
|
|
603
604
|
let u;
|
|
604
605
|
t[2] !== r || t[3] !== i || t[4] !== s.status || t[5] !== l ? (u = {
|
|
605
606
|
status: c,
|
|
@@ -607,8 +608,8 @@ function vn(e) {
|
|
|
607
608
|
controlledOpen: r,
|
|
608
609
|
onOpenChange: i
|
|
609
610
|
}, t[2] = r, t[3] = i, t[4] = s.status, t[5] = l, t[6] = u) : u = t[6];
|
|
610
|
-
let { isOpen: d, handleOpenChange: f } =
|
|
611
|
-
if (
|
|
611
|
+
let { isOpen: d, handleOpenChange: f } = hn(u);
|
|
612
|
+
if (gn(n, s)) return null;
|
|
612
613
|
let p;
|
|
613
614
|
t[7] !== n || t[8] !== s ? (p = {
|
|
614
615
|
state: s,
|
|
@@ -626,14 +627,14 @@ function vn(e) {
|
|
|
626
627
|
children: a
|
|
627
628
|
}), t[12] = a, t[13] = f, t[14] = d, t[15] = s.status, t[16] = h, t[17] = g) : g = t[17];
|
|
628
629
|
let _;
|
|
629
|
-
return t[18] !== p || t[19] !== g ? (_ = /* @__PURE__ */ M(
|
|
630
|
+
return t[18] !== p || t[19] !== g ? (_ = /* @__PURE__ */ M(Sn, {
|
|
630
631
|
value: p,
|
|
631
632
|
children: g
|
|
632
633
|
}), t[18] = p, t[19] = g, t[20] = _) : _ = t[20], _;
|
|
633
634
|
}
|
|
634
|
-
function
|
|
635
|
-
let t = O(13), { className: n } = e, { state: r } =
|
|
636
|
-
t[0] === n ? i = t[1] : (i =
|
|
635
|
+
function Tn(e) {
|
|
636
|
+
let t = O(13), { className: n } = e, { state: r } = Cn("Trigger"), i;
|
|
637
|
+
t[0] === n ? i = t[1] : (i = En(n), t[0] = n, t[1] = i);
|
|
637
638
|
let a;
|
|
638
639
|
t[2] === i ? a = t[3] : (a = /* @__PURE__ */ M("button", {
|
|
639
640
|
type: "button",
|
|
@@ -641,28 +642,28 @@ function yn(e) {
|
|
|
641
642
|
className: i
|
|
642
643
|
}), t[2] = i, t[3] = a);
|
|
643
644
|
let o;
|
|
644
|
-
t[4] === r ? o = t[5] : (o =
|
|
645
|
+
t[4] === r ? o = t[5] : (o = yn(r), t[4] = r, t[5] = o);
|
|
645
646
|
let s = r.status === "running", c;
|
|
646
|
-
t[6] !== o || t[7] !== s ? (c = /* @__PURE__ */ M(
|
|
647
|
+
t[6] !== o || t[7] !== s ? (c = /* @__PURE__ */ M(Dn, {
|
|
647
648
|
segments: o,
|
|
648
649
|
isRunning: s
|
|
649
650
|
}), t[6] = o, t[7] = s, t[8] = c) : c = t[8];
|
|
650
651
|
let l;
|
|
651
|
-
t[9] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ M(
|
|
652
|
+
t[9] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ M(kn, {}), t[9] = l) : l = t[9];
|
|
652
653
|
let u;
|
|
653
654
|
return t[10] !== a || t[11] !== c ? (u = /* @__PURE__ */ N(L, {
|
|
654
655
|
render: a,
|
|
655
656
|
children: [c, l]
|
|
656
657
|
}), t[10] = a, t[11] = c, t[12] = u) : u = t[12], u;
|
|
657
658
|
}
|
|
658
|
-
function
|
|
659
|
-
return
|
|
659
|
+
function En(e) {
|
|
660
|
+
return cn(k("items-baseline px-1", e));
|
|
660
661
|
}
|
|
661
|
-
function
|
|
662
|
+
function Dn(e) {
|
|
662
663
|
let t = O(8), { segments: n, isRunning: r } = e, i = n.length - 1, a;
|
|
663
664
|
if (t[0] !== i || t[1] !== n) {
|
|
664
665
|
let e;
|
|
665
|
-
t[3] === i ? e = t[4] : (e = (e, t) => /* @__PURE__ */ M(
|
|
666
|
+
t[3] === i ? e = t[4] : (e = (e, t) => /* @__PURE__ */ M(On, {
|
|
666
667
|
segment: e,
|
|
667
668
|
index: t,
|
|
668
669
|
isLast: t === i
|
|
@@ -676,7 +677,7 @@ function xn(e) {
|
|
|
676
677
|
children: a
|
|
677
678
|
}), t[5] = r, t[6] = a, t[7] = o) : o = t[7], o;
|
|
678
679
|
}
|
|
679
|
-
function
|
|
680
|
+
function On(e) {
|
|
680
681
|
let t = O(11), { segment: n, index: r, isLast: i } = e, o;
|
|
681
682
|
t[0] === r ? o = t[1] : (o = r > 0 && /* @__PURE__ */ M("span", {
|
|
682
683
|
"aria-hidden": !0,
|
|
@@ -693,11 +694,11 @@ function Sn(e) {
|
|
|
693
694
|
let d;
|
|
694
695
|
return t[8] !== o || t[9] !== u ? (d = /* @__PURE__ */ N(a, { children: [o, u] }), t[8] = o, t[9] = u, t[10] = d) : d = t[10], d;
|
|
695
696
|
}
|
|
696
|
-
function
|
|
697
|
+
function kn() {
|
|
697
698
|
let e = O(1), t;
|
|
698
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
699
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(sn, { className: "text-muted-foreground/60 size-3" }), e[0] = t) : t = e[0], t;
|
|
699
700
|
}
|
|
700
|
-
function
|
|
701
|
+
function An(e) {
|
|
701
702
|
let t = O(3), { className: n, children: r } = e, i;
|
|
702
703
|
return t[0] !== r || t[1] !== n ? (i = /* @__PURE__ */ M(I, {
|
|
703
704
|
"data-slot": "index-progress-content",
|
|
@@ -705,7 +706,7 @@ function wn(e) {
|
|
|
705
706
|
children: r
|
|
706
707
|
}), t[0] = r, t[1] = n, t[2] = i) : i = t[2], i;
|
|
707
708
|
}
|
|
708
|
-
function
|
|
709
|
+
function jn(e) {
|
|
709
710
|
let t = O(11), { event: n } = e, r;
|
|
710
711
|
t[0] === n.type ? r = t[1] : (r = /* @__PURE__ */ M("span", {
|
|
711
712
|
className: "text-muted-foreground/50 w-40 shrink-0 truncate",
|
|
@@ -735,7 +736,7 @@ function Tn(e) {
|
|
|
735
736
|
]
|
|
736
737
|
}), t[7] = r, t[8] = i, t[9] = a, t[10] = o) : o = t[10], o;
|
|
737
738
|
}
|
|
738
|
-
function
|
|
739
|
+
function Mn(e) {
|
|
739
740
|
let t = O(2), n;
|
|
740
741
|
if (t[0] !== e) {
|
|
741
742
|
let r = /* @__PURE__ */ new Map(), i = [];
|
|
@@ -750,25 +751,25 @@ function En(e) {
|
|
|
750
751
|
} else n = t[1];
|
|
751
752
|
return n;
|
|
752
753
|
}
|
|
753
|
-
function
|
|
754
|
-
let t = O(8), { className: n } = e, { events: r } =
|
|
754
|
+
function Nn(e) {
|
|
755
|
+
let t = O(8), { className: n } = e, { events: r } = Cn("EventLog"), i = Mn(r), a;
|
|
755
756
|
t[0] === n ? a = t[1] : (a = k("mt-2 ml-4 max-h-64 overflow-y-auto font-mono text-[11px]", n), t[0] = n, t[1] = a);
|
|
756
757
|
let o = a;
|
|
757
758
|
if (i.byAdapter.size <= 1) {
|
|
758
759
|
let e;
|
|
759
|
-
return t[2] !== o || t[3] !== r ? (e = /* @__PURE__ */ M(
|
|
760
|
+
return t[2] !== o || t[3] !== r ? (e = /* @__PURE__ */ M(Fn, {
|
|
760
761
|
events: r,
|
|
761
762
|
className: o
|
|
762
763
|
}), t[2] = o, t[3] = r, t[4] = e) : e = t[4], e;
|
|
763
764
|
}
|
|
764
765
|
let s;
|
|
765
|
-
return t[5] !== o || t[6] !== i ? (s = /* @__PURE__ */ M(
|
|
766
|
+
return t[5] !== o || t[6] !== i ? (s = /* @__PURE__ */ M(Ln, {
|
|
766
767
|
groupedEvents: i,
|
|
767
768
|
className: o
|
|
768
769
|
}), t[5] = o, t[6] = i, t[7] = s) : s = t[7], s;
|
|
769
770
|
}
|
|
770
|
-
function
|
|
771
|
-
let t = O(8), { className: n, contentClassName: r, children: i } = e, { scrollRef: a, contentRef: o } = ie(
|
|
771
|
+
function Pn(e) {
|
|
772
|
+
let t = O(8), { className: n, contentClassName: r, children: i } = e, { scrollRef: a, contentRef: o } = ie(un), s;
|
|
772
773
|
t[0] !== i || t[1] !== r || t[2] !== o ? (s = /* @__PURE__ */ M("div", {
|
|
773
774
|
ref: o,
|
|
774
775
|
"data-slot": "index-progress-event-log",
|
|
@@ -782,56 +783,56 @@ function On(e) {
|
|
|
782
783
|
children: s
|
|
783
784
|
}), t[4] = n, t[5] = a, t[6] = s, t[7] = c) : c = t[7], c;
|
|
784
785
|
}
|
|
785
|
-
function
|
|
786
|
+
function Fn(e) {
|
|
786
787
|
let t = O(7), { events: n, className: r } = e, i;
|
|
787
|
-
t[0] === n ? i = t[1] : (i = n.map(
|
|
788
|
+
t[0] === n ? i = t[1] : (i = n.map(In), t[0] = n, t[1] = i);
|
|
788
789
|
let a;
|
|
789
790
|
t[2] === i ? a = t[3] : (a = /* @__PURE__ */ M("ul", {
|
|
790
791
|
className: "space-y-0.5",
|
|
791
792
|
children: i
|
|
792
793
|
}), t[2] = i, t[3] = a);
|
|
793
794
|
let o;
|
|
794
|
-
return t[4] !== r || t[5] !== a ? (o = /* @__PURE__ */ M(
|
|
795
|
+
return t[4] !== r || t[5] !== a ? (o = /* @__PURE__ */ M(Pn, {
|
|
795
796
|
className: r,
|
|
796
797
|
children: a
|
|
797
798
|
}), t[4] = r, t[5] = a, t[6] = o) : o = t[6], o;
|
|
798
799
|
}
|
|
799
|
-
function
|
|
800
|
-
return /* @__PURE__ */ M(
|
|
800
|
+
function In(e, t) {
|
|
801
|
+
return /* @__PURE__ */ M(jn, { event: e }, `${e.type}-${t}`);
|
|
801
802
|
}
|
|
802
|
-
function
|
|
803
|
+
function Ln(e) {
|
|
803
804
|
let t = O(8), { groupedEvents: n, className: r } = e, i;
|
|
804
805
|
t[0] === n.globalEvents ? i = t[1] : (i = n.globalEvents.length > 0 && /* @__PURE__ */ M("ul", {
|
|
805
806
|
className: "space-y-0.5",
|
|
806
|
-
children: n.globalEvents.map(
|
|
807
|
+
children: n.globalEvents.map(zn)
|
|
807
808
|
}), t[0] = n.globalEvents, t[1] = i);
|
|
808
809
|
let a;
|
|
809
|
-
t[2] === n.byAdapter ? a = t[3] : (a = Array.from(n.byAdapter.entries()).map(
|
|
810
|
+
t[2] === n.byAdapter ? a = t[3] : (a = Array.from(n.byAdapter.entries()).map(Rn), t[2] = n.byAdapter, t[3] = a);
|
|
810
811
|
let o;
|
|
811
|
-
return t[4] !== r || t[5] !== i || t[6] !== a ? (o = /* @__PURE__ */ N(
|
|
812
|
+
return t[4] !== r || t[5] !== i || t[6] !== a ? (o = /* @__PURE__ */ N(Pn, {
|
|
812
813
|
className: r,
|
|
813
814
|
contentClassName: "space-y-2",
|
|
814
815
|
children: [i, a]
|
|
815
816
|
}), t[4] = r, t[5] = i, t[6] = a, t[7] = o) : o = t[7], o;
|
|
816
817
|
}
|
|
817
|
-
function
|
|
818
|
+
function Rn(e) {
|
|
818
819
|
let [t, n] = e;
|
|
819
|
-
return /* @__PURE__ */ M(
|
|
820
|
+
return /* @__PURE__ */ M(Bn, {
|
|
820
821
|
name: t,
|
|
821
822
|
events: n
|
|
822
823
|
}, t);
|
|
823
824
|
}
|
|
824
|
-
function
|
|
825
|
-
return /* @__PURE__ */ M(
|
|
825
|
+
function zn(e, t) {
|
|
826
|
+
return /* @__PURE__ */ M(jn, { event: e }, `${e.type}-${t}`);
|
|
826
827
|
}
|
|
827
|
-
function
|
|
828
|
+
function Bn(e) {
|
|
828
829
|
let t = O(9), { name: n, events: r } = e, i;
|
|
829
830
|
t[0] === n ? i = t[1] : (i = /* @__PURE__ */ M("div", {
|
|
830
831
|
className: "text-foreground/90",
|
|
831
832
|
children: n
|
|
832
833
|
}), t[0] = n, t[1] = i);
|
|
833
834
|
let a;
|
|
834
|
-
t[2] === r ? a = t[3] : (a = r.map(
|
|
835
|
+
t[2] === r ? a = t[3] : (a = r.map(Vn), t[2] = r, t[3] = a);
|
|
835
836
|
let o;
|
|
836
837
|
t[4] === a ? o = t[5] : (o = /* @__PURE__ */ M("ul", {
|
|
837
838
|
className: "space-y-0.5",
|
|
@@ -843,21 +844,21 @@ function Pn(e) {
|
|
|
843
844
|
children: [i, o]
|
|
844
845
|
}), t[6] = i, t[7] = o, t[8] = s) : s = t[8], s;
|
|
845
846
|
}
|
|
846
|
-
function
|
|
847
|
-
return /* @__PURE__ */ M(
|
|
847
|
+
function Vn(e, t) {
|
|
848
|
+
return /* @__PURE__ */ M(jn, { event: e }, `${e.type}-${t}`);
|
|
848
849
|
}
|
|
849
|
-
function
|
|
850
|
-
let t = O(22), { events: n, className: r, showCacheHits: i } = e, a = i !== void 0 && i, o =
|
|
851
|
-
t[0] === s.globalEvents ? c = t[1] : (c = s.globalEvents.filter(
|
|
850
|
+
function Hn(e) {
|
|
851
|
+
let t = O(22), { events: n, className: r, showCacheHits: i } = e, a = i !== void 0 && i, o = mn(n), s = Mn(n), c;
|
|
852
|
+
t[0] === s.globalEvents ? c = t[1] : (c = s.globalEvents.filter(Un), t[0] = s.globalEvents, t[1] = c);
|
|
852
853
|
let l = c;
|
|
853
|
-
if (n.length === 0 || !a &&
|
|
854
|
+
if (n.length === 0 || !a && gn(n, o)) return null;
|
|
854
855
|
if (o.adapters.length === 0) {
|
|
855
856
|
let e;
|
|
856
|
-
t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M(
|
|
857
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M(Tn, {}), t[2] = e) : e = t[2];
|
|
857
858
|
let i;
|
|
858
|
-
t[3] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ M(
|
|
859
|
+
t[3] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ M(An, { children: /* @__PURE__ */ M(Nn, {}) }), t[3] = i) : i = t[3];
|
|
859
860
|
let a;
|
|
860
|
-
return t[4] !== r || t[5] !== n ? (a = /* @__PURE__ */ N(
|
|
861
|
+
return t[4] !== r || t[5] !== n ? (a = /* @__PURE__ */ N(wn, {
|
|
861
862
|
events: n,
|
|
862
863
|
className: r,
|
|
863
864
|
children: [e, i]
|
|
@@ -868,13 +869,13 @@ function In(e) {
|
|
|
868
869
|
let f;
|
|
869
870
|
if (t[9] !== s.byAdapter || t[10] !== o.adapters) {
|
|
870
871
|
let e;
|
|
871
|
-
t[12] === s.byAdapter ? e = t[13] : (e = (e) => /* @__PURE__ */ M(
|
|
872
|
+
t[12] === s.byAdapter ? e = t[13] : (e = (e) => /* @__PURE__ */ M(Wn, {
|
|
872
873
|
adapter: e,
|
|
873
874
|
events: s.byAdapter.get(e.name) ?? []
|
|
874
875
|
}, e.name), t[12] = s.byAdapter, t[13] = e), f = o.adapters.map(e), t[9] = s.byAdapter, t[10] = o.adapters, t[11] = f;
|
|
875
876
|
} else f = t[11];
|
|
876
877
|
let p;
|
|
877
|
-
t[14] !== l || t[15] !== o ? (p = l.length > 0 && /* @__PURE__ */ M(
|
|
878
|
+
t[14] !== l || t[15] !== o ? (p = l.length > 0 && /* @__PURE__ */ M(Kn, {
|
|
878
879
|
state: o,
|
|
879
880
|
events: l
|
|
880
881
|
}), t[14] = l, t[15] = o, t[16] = p) : p = t[16];
|
|
@@ -886,32 +887,32 @@ function In(e) {
|
|
|
886
887
|
children: [f, p]
|
|
887
888
|
}), t[17] = o.status, t[18] = d, t[19] = f, t[20] = p, t[21] = m) : m = t[21], m;
|
|
888
889
|
}
|
|
889
|
-
function
|
|
890
|
+
function Un(e) {
|
|
890
891
|
return e.type === "index:error";
|
|
891
892
|
}
|
|
892
|
-
function
|
|
893
|
+
function Wn(e) {
|
|
893
894
|
let t = O(22), { adapter: n, events: r } = e, i = n.status, a;
|
|
894
|
-
t[0] === r ? a = t[1] : (a =
|
|
895
|
+
t[0] === r ? a = t[1] : (a = vn(r), t[0] = r, t[1] = a);
|
|
895
896
|
let o;
|
|
896
897
|
t[2] !== n.status || t[3] !== a ? (o = {
|
|
897
898
|
status: i,
|
|
898
899
|
resetKey: a
|
|
899
900
|
}, t[2] = n.status, t[3] = a, t[4] = o) : o = t[4];
|
|
900
|
-
let { isOpen: s, handleOpenChange: c } =
|
|
901
|
+
let { isOpen: s, handleOpenChange: c } = hn(o), l = n.status, u;
|
|
901
902
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ M("button", {
|
|
902
903
|
type: "button",
|
|
903
904
|
"data-slot": "index-progress-adapter-trigger",
|
|
904
|
-
className:
|
|
905
|
+
className: En()
|
|
905
906
|
}), t[5] = u) : u = t[5];
|
|
906
907
|
let d;
|
|
907
|
-
t[6] === n ? d = t[7] : (d =
|
|
908
|
+
t[6] === n ? d = t[7] : (d = bn(n), t[6] = n, t[7] = d);
|
|
908
909
|
let f = n.status === "running", p;
|
|
909
|
-
t[8] !== d || t[9] !== f ? (p = /* @__PURE__ */ M(
|
|
910
|
+
t[8] !== d || t[9] !== f ? (p = /* @__PURE__ */ M(Dn, {
|
|
910
911
|
segments: d,
|
|
911
912
|
isRunning: f
|
|
912
913
|
}), t[8] = d, t[9] = f, t[10] = p) : p = t[10];
|
|
913
914
|
let m;
|
|
914
|
-
t[11] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ M(
|
|
915
|
+
t[11] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ M(kn, {}), t[11] = m) : m = t[11];
|
|
915
916
|
let h;
|
|
916
917
|
t[12] === p ? h = t[13] : (h = /* @__PURE__ */ N(L, {
|
|
917
918
|
render: u,
|
|
@@ -920,7 +921,7 @@ function Rn(e) {
|
|
|
920
921
|
let g;
|
|
921
922
|
t[14] === r ? g = t[15] : (g = /* @__PURE__ */ M(I, {
|
|
922
923
|
"data-slot": "index-progress-adapter-content",
|
|
923
|
-
children: /* @__PURE__ */ M(
|
|
924
|
+
children: /* @__PURE__ */ M(Gn, { events: r })
|
|
924
925
|
}), t[14] = r, t[15] = g);
|
|
925
926
|
let _;
|
|
926
927
|
return t[16] !== n.status || t[17] !== c || t[18] !== s || t[19] !== h || t[20] !== g ? (_ = /* @__PURE__ */ N(F, {
|
|
@@ -932,36 +933,36 @@ function Rn(e) {
|
|
|
932
933
|
children: [h, g]
|
|
933
934
|
}), t[16] = n.status, t[17] = c, t[18] = s, t[19] = h, t[20] = g, t[21] = _) : _ = t[21], _;
|
|
934
935
|
}
|
|
935
|
-
function
|
|
936
|
+
function Gn(e) {
|
|
936
937
|
let t = O(2), { events: n } = e;
|
|
937
938
|
if (n.length === 0) return null;
|
|
938
939
|
let r;
|
|
939
|
-
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M(
|
|
940
|
+
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M(Fn, {
|
|
940
941
|
events: n,
|
|
941
942
|
className: "mt-2 ml-4 max-h-64 overflow-y-auto font-mono text-[11px]"
|
|
942
943
|
}), t[0] = n, t[1] = r), r;
|
|
943
944
|
}
|
|
944
|
-
function
|
|
945
|
+
function Kn(e) {
|
|
945
946
|
let t = O(20), { state: n, events: r } = e, i;
|
|
946
947
|
t[0] !== r.length || t[1] !== n.status ? (i = {
|
|
947
948
|
status: n.status,
|
|
948
949
|
resetKey: r.length
|
|
949
950
|
}, t[0] = r.length, t[1] = n.status, t[2] = i) : i = t[2];
|
|
950
|
-
let { isOpen: a, handleOpenChange: o } =
|
|
951
|
+
let { isOpen: a, handleOpenChange: o } = hn(i), s = n.status, c;
|
|
951
952
|
t[3] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ M("button", {
|
|
952
953
|
type: "button",
|
|
953
954
|
"data-slot": "index-progress-global-error-trigger",
|
|
954
|
-
className:
|
|
955
|
+
className: En()
|
|
955
956
|
}), t[3] = c) : c = t[3];
|
|
956
957
|
let l;
|
|
957
|
-
t[4] === n ? l = t[5] : (l =
|
|
958
|
+
t[4] === n ? l = t[5] : (l = xn(n), t[4] = n, t[5] = l);
|
|
958
959
|
let u = n.status === "running", d;
|
|
959
|
-
t[6] !== l || t[7] !== u ? (d = /* @__PURE__ */ M(
|
|
960
|
+
t[6] !== l || t[7] !== u ? (d = /* @__PURE__ */ M(Dn, {
|
|
960
961
|
segments: l,
|
|
961
962
|
isRunning: u
|
|
962
963
|
}), t[6] = l, t[7] = u, t[8] = d) : d = t[8];
|
|
963
964
|
let f;
|
|
964
|
-
t[9] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(
|
|
965
|
+
t[9] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(kn, {}), t[9] = f) : f = t[9];
|
|
965
966
|
let p;
|
|
966
967
|
t[10] === d ? p = t[11] : (p = /* @__PURE__ */ N(L, {
|
|
967
968
|
render: c,
|
|
@@ -970,7 +971,7 @@ function Bn(e) {
|
|
|
970
971
|
let m;
|
|
971
972
|
t[12] === r ? m = t[13] : (m = /* @__PURE__ */ M(I, {
|
|
972
973
|
"data-slot": "index-progress-global-error-content",
|
|
973
|
-
children: /* @__PURE__ */ M(
|
|
974
|
+
children: /* @__PURE__ */ M(Gn, { events: r })
|
|
974
975
|
}), t[12] = r, t[13] = m);
|
|
975
976
|
let h;
|
|
976
977
|
return t[14] !== o || t[15] !== a || t[16] !== n.status || t[17] !== p || t[18] !== m ? (h = /* @__PURE__ */ N(F, {
|
|
@@ -982,46 +983,69 @@ function Bn(e) {
|
|
|
982
983
|
children: [p, m]
|
|
983
984
|
}), t[14] = o, t[15] = a, t[16] = n.status, t[17] = p, t[18] = m, t[19] = h) : h = t[19], h;
|
|
984
985
|
}
|
|
985
|
-
var
|
|
986
|
-
Root:
|
|
987
|
-
Trigger:
|
|
988
|
-
Content:
|
|
989
|
-
EventLog:
|
|
990
|
-
PerAdapter:
|
|
991
|
-
},
|
|
986
|
+
var qn = {
|
|
987
|
+
Root: wn,
|
|
988
|
+
Trigger: Tn,
|
|
989
|
+
Content: An,
|
|
990
|
+
EventLog: Nn,
|
|
991
|
+
PerAdapter: Hn
|
|
992
|
+
}, Jn = o(void 0), Yn = o(void 0);
|
|
992
993
|
function W() {
|
|
993
|
-
let e = l(
|
|
994
|
+
let e = l(Jn);
|
|
994
995
|
if (!e) throw Error("useMessagesContext must be used within <Messages>");
|
|
995
996
|
return e;
|
|
996
997
|
}
|
|
997
998
|
function G() {
|
|
998
|
-
let e = l(
|
|
999
|
+
let e = l(Jn), { status: t } = B();
|
|
999
1000
|
return e?.status ?? t;
|
|
1000
1001
|
}
|
|
1001
1002
|
function K() {
|
|
1002
|
-
let e = l(
|
|
1003
|
+
let e = l(Yn);
|
|
1003
1004
|
if (!e) throw Error("useMessageItem must be used within <Messages.Item>");
|
|
1004
1005
|
return e;
|
|
1005
1006
|
}
|
|
1006
1007
|
//#endregion
|
|
1007
1008
|
//#region src/lib/components/CitationPill.tsx
|
|
1008
|
-
function
|
|
1009
|
-
let t = O(
|
|
1010
|
-
|
|
1009
|
+
function Xn(e) {
|
|
1010
|
+
let t = O(20), { source: n, index: r, children: i } = e, a = URL.parse(n.url)?.hostname ?? n.url, o = `Source ${r}`, s;
|
|
1011
|
+
t[0] !== r || t[1] !== o ? (s = /* @__PURE__ */ M(Me, {
|
|
1012
|
+
openOnHover: !0,
|
|
1013
|
+
"aria-label": o,
|
|
1014
|
+
className: "text-primary bg-primary/10 hover:bg-primary/20 focus-visible:ring-ring focus-visible:ring-offset-background inline-block rounded px-1 font-mono text-[10px] leading-tight transition-colors focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:outline-none",
|
|
1015
|
+
children: r
|
|
1016
|
+
}), t[0] = r, t[1] = o, t[2] = s) : s = t[2];
|
|
1017
|
+
let c = n.title ?? a, l;
|
|
1018
|
+
t[3] === c ? l = t[4] : (l = /* @__PURE__ */ M(je, { children: c }), t[3] = c, t[4] = l);
|
|
1019
|
+
let u;
|
|
1020
|
+
t[5] !== a || t[6] !== n.title ? (u = n.title ? /* @__PURE__ */ M(ke, { children: a }) : null, t[5] = a, t[6] = n.title, t[7] = u) : u = t[7];
|
|
1021
|
+
let d;
|
|
1022
|
+
t[8] !== l || t[9] !== u ? (d = /* @__PURE__ */ N(Ae, { children: [l, u] }), t[8] = l, t[9] = u, t[10] = d) : d = t[10];
|
|
1023
|
+
let f;
|
|
1024
|
+
t[11] === n.url ? f = t[12] : (f = /* @__PURE__ */ M("a", {
|
|
1025
|
+
href: n.url,
|
|
1026
|
+
target: "_blank",
|
|
1027
|
+
rel: "noopener noreferrer",
|
|
1028
|
+
className: "text-primary underline",
|
|
1029
|
+
children: "Open the source"
|
|
1030
|
+
}), t[11] = n.url, t[12] = f);
|
|
1031
|
+
let p;
|
|
1032
|
+
t[13] !== i || t[14] !== d || t[15] !== f ? (p = /* @__PURE__ */ N(Oe, {
|
|
1033
|
+
className: "w-72 gap-2 text-sm",
|
|
1034
|
+
children: [
|
|
1035
|
+
d,
|
|
1036
|
+
i,
|
|
1037
|
+
f
|
|
1038
|
+
]
|
|
1039
|
+
}), t[13] = i, t[14] = d, t[15] = f, t[16] = p) : p = t[16];
|
|
1040
|
+
let m;
|
|
1041
|
+
return t[17] !== s || t[18] !== p ? (m = /* @__PURE__ */ M("sup", {
|
|
1011
1042
|
className: "ml-0.5 inline-block",
|
|
1012
|
-
children: /* @__PURE__ */
|
|
1013
|
-
|
|
1014
|
-
target: "_blank",
|
|
1015
|
-
rel: "noopener noreferrer",
|
|
1016
|
-
title: i,
|
|
1017
|
-
className: "text-primary bg-primary/10 hover:bg-primary/20 focus-visible:ring-ring focus-visible:ring-offset-background inline-block rounded px-1 font-mono text-[10px] leading-tight no-underline transition-colors focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:outline-none",
|
|
1018
|
-
children: r
|
|
1019
|
-
})
|
|
1020
|
-
}), t[0] = r, t[1] = n.url, t[2] = i, t[3] = a) : a = t[3], a;
|
|
1043
|
+
children: /* @__PURE__ */ N(De, { children: [s, p] })
|
|
1044
|
+
}), t[17] = s, t[18] = p, t[19] = m) : m = t[19], m;
|
|
1021
1045
|
}
|
|
1022
1046
|
//#endregion
|
|
1023
1047
|
//#region src/lib/ui/TablePanel.tsx
|
|
1024
|
-
function
|
|
1048
|
+
function Zn(e) {
|
|
1025
1049
|
let t = O(10), n, r, i;
|
|
1026
1050
|
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({ref: i, className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
1027
1051
|
let a;
|
|
@@ -1035,8 +1059,8 @@ function Gn(e) {
|
|
|
1035
1059
|
...r
|
|
1036
1060
|
}), t[6] = r, t[7] = i, t[8] = a, t[9] = o) : o = t[9], o;
|
|
1037
1061
|
}
|
|
1038
|
-
|
|
1039
|
-
function
|
|
1062
|
+
Zn.displayName = "TablePanel.Root";
|
|
1063
|
+
function Qn(e) {
|
|
1040
1064
|
let t = O(8), n, r;
|
|
1041
1065
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1042
1066
|
let i;
|
|
@@ -1048,7 +1072,7 @@ function Kn(e) {
|
|
|
1048
1072
|
...r
|
|
1049
1073
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1050
1074
|
}
|
|
1051
|
-
function
|
|
1075
|
+
function $n(e) {
|
|
1052
1076
|
let t = O(8), n, r;
|
|
1053
1077
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1054
1078
|
let i;
|
|
@@ -1060,7 +1084,7 @@ function qn(e) {
|
|
|
1060
1084
|
...r
|
|
1061
1085
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1062
1086
|
}
|
|
1063
|
-
function
|
|
1087
|
+
function er(e) {
|
|
1064
1088
|
let t = O(8), n, r;
|
|
1065
1089
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1066
1090
|
let i;
|
|
@@ -1072,7 +1096,7 @@ function Jn(e) {
|
|
|
1072
1096
|
...r
|
|
1073
1097
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1074
1098
|
}
|
|
1075
|
-
function
|
|
1099
|
+
function tr(e) {
|
|
1076
1100
|
let t = O(8), n, r;
|
|
1077
1101
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1078
1102
|
let i;
|
|
@@ -1084,7 +1108,7 @@ function Yn(e) {
|
|
|
1084
1108
|
...r
|
|
1085
1109
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1086
1110
|
}
|
|
1087
|
-
function
|
|
1111
|
+
function nr(e) {
|
|
1088
1112
|
let t = O(8), n, r;
|
|
1089
1113
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1090
1114
|
let i;
|
|
@@ -1096,7 +1120,7 @@ function Xn(e) {
|
|
|
1096
1120
|
...r
|
|
1097
1121
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1098
1122
|
}
|
|
1099
|
-
function
|
|
1123
|
+
function rr(e) {
|
|
1100
1124
|
let t = O(8), n, r;
|
|
1101
1125
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1102
1126
|
let i;
|
|
@@ -1108,28 +1132,28 @@ function Zn(e) {
|
|
|
1108
1132
|
...r
|
|
1109
1133
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1110
1134
|
}
|
|
1111
|
-
var q = Object.assign(
|
|
1112
|
-
Header:
|
|
1113
|
-
Heading:
|
|
1114
|
-
Title:
|
|
1115
|
-
Description:
|
|
1116
|
-
Actions:
|
|
1117
|
-
Content:
|
|
1118
|
-
}),
|
|
1119
|
-
function
|
|
1120
|
-
return e.replace(
|
|
1121
|
-
}
|
|
1122
|
-
function
|
|
1135
|
+
var q = Object.assign(Zn, {
|
|
1136
|
+
Header: Qn,
|
|
1137
|
+
Heading: $n,
|
|
1138
|
+
Title: er,
|
|
1139
|
+
Description: tr,
|
|
1140
|
+
Actions: nr,
|
|
1141
|
+
Content: rr
|
|
1142
|
+
}), ir = /<\w[\w-]*(?:"(?:\\.|[^"])*"|[^>"])*>/g, ar = /\b([\w-]+)="((?:\\.|[^"])*)"/g;
|
|
1143
|
+
function or(e) {
|
|
1144
|
+
return e.replace(ir, (e) => e.replace(ar, (e, t, n) => `${t}="${n.replace(/\\"/g, """)}"`));
|
|
1145
|
+
}
|
|
1146
|
+
function sr(e, t) {
|
|
1123
1147
|
if (typeof e != "string") return e;
|
|
1124
|
-
let n =
|
|
1125
|
-
return n = n.replace(/\/>(\s*)</g, (e, t, n, r) => !t.includes("\n") &&
|
|
1148
|
+
let n = or(e).replace(/<(\w[\w-]*)((?:\s+[\w-]+="[^"]*")+)\s*(\/?>)/g, (e, t, n, r) => `<${t}${n.replace(/\s+/g, " ").replace(/"([^"]*)"/g, (e, t) => `"${t.replace(/\*/g, "*")}"`)}${r}`);
|
|
1149
|
+
return n = n.replace(/\/>(\s*)</g, (e, t, n, r) => !t.includes("\n") && lr(r, n) ? e : "/>\n\n<"), ur(n, t);
|
|
1126
1150
|
}
|
|
1127
|
-
var
|
|
1128
|
-
function
|
|
1151
|
+
var cr = /<\w[\w-]*(?:"(?:\\.|[^"])*"|[^>"])*>|<\/[\w-]+\s*>/g;
|
|
1152
|
+
function lr(e, t) {
|
|
1129
1153
|
let n = e.lastIndexOf("\n", t - 1) + 1, r = e.indexOf("\n", t);
|
|
1130
|
-
return e.slice(n, r < 0 ? e.length : r).replace(
|
|
1154
|
+
return e.slice(n, r < 0 ? e.length : r).replace(cr, "").trim() !== "";
|
|
1131
1155
|
}
|
|
1132
|
-
function
|
|
1156
|
+
function ur(e, t, n = !1) {
|
|
1133
1157
|
let r = t?.length ? new Set(t) : null, i = r ? (e) => r.has(e) : (e) => e.includes("-"), a = "", o = 0;
|
|
1134
1158
|
for (; o < e.length;) {
|
|
1135
1159
|
if (e[o] !== "<" || e[o + 1] === "/") {
|
|
@@ -1143,31 +1167,31 @@ function ir(e, t, n = !1) {
|
|
|
1143
1167
|
a += e[o++];
|
|
1144
1168
|
continue;
|
|
1145
1169
|
}
|
|
1146
|
-
let c =
|
|
1170
|
+
let c = dr(e, o);
|
|
1147
1171
|
if (c < 0) {
|
|
1148
1172
|
a += e[o++];
|
|
1149
1173
|
continue;
|
|
1150
1174
|
}
|
|
1151
1175
|
if (e[c - 1] === "/") {
|
|
1152
1176
|
let t = e.slice(o, c + 1);
|
|
1153
|
-
n ? a += "<div>" + t + "</div>" :
|
|
1177
|
+
n ? a += "<div>" + t + "</div>" : lr(e, o) ? a += "<span>" + t.slice(0, -2).trimEnd() + "></" + s + "></span>" : (a += t, e[c + 1] === "\n" && c + 2 < e.length && e[c + 2] !== "\n" && (a += "\n")), o = c + 1;
|
|
1154
1178
|
continue;
|
|
1155
1179
|
}
|
|
1156
|
-
let l =
|
|
1180
|
+
let l = fr(e, c + 1, s);
|
|
1157
1181
|
if (!l) {
|
|
1158
1182
|
if (n) {
|
|
1159
|
-
let n = e.slice(o, c + 1), r =
|
|
1183
|
+
let n = e.slice(o, c + 1), r = ur(e.slice(c + 1), t, !0);
|
|
1160
1184
|
return a += "<div>" + n + r + "</" + s + "></div>", a;
|
|
1161
1185
|
}
|
|
1162
1186
|
a += e.slice(o, c + 1), o = c + 1;
|
|
1163
1187
|
continue;
|
|
1164
1188
|
}
|
|
1165
|
-
let u = e.slice(o, c + 1), d = e.slice(c + 1, l.start), f = e.slice(l.start, l.end), p =
|
|
1166
|
-
n ? a += "<div>" + u + p + f + "</div>" : a =
|
|
1189
|
+
let u = e.slice(o, c + 1), d = e.slice(c + 1, l.start), f = e.slice(l.start, l.end), p = ur(d, t, !0);
|
|
1190
|
+
n ? a += "<div>" + u + p + f + "</div>" : a = pr(a) + "<div>" + u + p + f + "</div>", o = l.end;
|
|
1167
1191
|
}
|
|
1168
1192
|
return a;
|
|
1169
1193
|
}
|
|
1170
|
-
function
|
|
1194
|
+
function dr(e, t) {
|
|
1171
1195
|
let n = t + 1;
|
|
1172
1196
|
for (; n < e.length;) {
|
|
1173
1197
|
if (e[n] === "\"") for (n++; n < e.length && e[n] !== "\"";) n++;
|
|
@@ -1176,14 +1200,14 @@ function ar(e, t) {
|
|
|
1176
1200
|
}
|
|
1177
1201
|
return -1;
|
|
1178
1202
|
}
|
|
1179
|
-
function
|
|
1203
|
+
function fr(e, t, n) {
|
|
1180
1204
|
let r = 1, i = t, a = "<" + n, o = "</" + n;
|
|
1181
1205
|
for (; i < e.length;) {
|
|
1182
1206
|
let t = e.indexOf("<", i);
|
|
1183
1207
|
if (t < 0) return null;
|
|
1184
1208
|
if (e.startsWith(o, t) && !/[\w-]/.test(e[t + o.length] || "")) {
|
|
1185
1209
|
if (r--, r === 0) {
|
|
1186
|
-
let n =
|
|
1210
|
+
let n = dr(e, t);
|
|
1187
1211
|
return n < 0 ? null : {
|
|
1188
1212
|
start: t,
|
|
1189
1213
|
end: n + 1
|
|
@@ -1192,25 +1216,25 @@ function or(e, t, n) {
|
|
|
1192
1216
|
let n = e.indexOf(">", t + o.length);
|
|
1193
1217
|
i = n < 0 ? t + 1 : n + 1;
|
|
1194
1218
|
} else if (e.startsWith(a, t) && !/[\w-]/.test(e[t + a.length] || "")) {
|
|
1195
|
-
let n =
|
|
1219
|
+
let n = dr(e, t);
|
|
1196
1220
|
n >= 0 && e[n - 1] !== "/" && r++, i = n < 0 ? t + 1 : n + 1;
|
|
1197
1221
|
} else if (/[a-zA-Z/]/.test(e[t + 1] || "")) {
|
|
1198
|
-
let n =
|
|
1222
|
+
let n = dr(e, t);
|
|
1199
1223
|
i = n < 0 ? t + 1 : n + 1;
|
|
1200
1224
|
} else i = t + 1;
|
|
1201
1225
|
}
|
|
1202
1226
|
return null;
|
|
1203
1227
|
}
|
|
1204
|
-
function
|
|
1228
|
+
function pr(e) {
|
|
1205
1229
|
return e.length === 0 ? "\n\n" : e.endsWith("\n\n") ? e : e.endsWith("\n") ? e + "\n" : e + "\n\n";
|
|
1206
1230
|
}
|
|
1207
1231
|
//#endregion
|
|
1208
1232
|
//#region src/lib/elements/table-panel-extension.tsx
|
|
1209
|
-
var
|
|
1233
|
+
var mr = "response-table-panel", hr = ["title", "description"], gr = k(Ne({
|
|
1210
1234
|
variant: "ghost",
|
|
1211
1235
|
size: "icon-sm"
|
|
1212
|
-
})),
|
|
1213
|
-
let t =
|
|
1236
|
+
})), _r = vt().use(ut).use(lt).use(ct), vr = (e) => {
|
|
1237
|
+
let t = _t(e), n = xr(e);
|
|
1214
1238
|
if (n.length === 0) return t;
|
|
1215
1239
|
let r = 0, i = t.map((e) => {
|
|
1216
1240
|
let t = {
|
|
@@ -1225,49 +1249,49 @@ var cr = "response-table-panel", lr = ["title", "description"], ur = k(De({
|
|
|
1225
1249
|
}
|
|
1226
1250
|
return t.reduce((e, t, n) => (a.has(n) && e.length > 0 ? e[e.length - 1] += t : e.push(t), e), []);
|
|
1227
1251
|
};
|
|
1228
|
-
function
|
|
1252
|
+
function yr(e) {
|
|
1229
1253
|
return e?.type === "leafDirective" && "name" in e && e.name === "table";
|
|
1230
1254
|
}
|
|
1231
|
-
function
|
|
1255
|
+
function br(e, t) {
|
|
1232
1256
|
if (t === void 0) return;
|
|
1233
1257
|
let n = e[t - 1];
|
|
1234
|
-
return
|
|
1258
|
+
return yr(n) ? n : void 0;
|
|
1235
1259
|
}
|
|
1236
|
-
function
|
|
1260
|
+
function xr(e) {
|
|
1237
1261
|
let t = [];
|
|
1238
|
-
return
|
|
1262
|
+
return bt(_r.parse(e), "table", (e, n, r) => {
|
|
1239
1263
|
if (!r) return;
|
|
1240
|
-
let i =
|
|
1264
|
+
let i = br(r.children, n)?.position?.start.offset, a = e.position?.end.offset;
|
|
1241
1265
|
i !== void 0 && a !== void 0 && t.push({
|
|
1242
1266
|
start: i,
|
|
1243
1267
|
end: a
|
|
1244
1268
|
});
|
|
1245
1269
|
}), t;
|
|
1246
1270
|
}
|
|
1247
|
-
function
|
|
1271
|
+
function Sr(e, t) {
|
|
1248
1272
|
return e.attributes?.[t]?.trim() || void 0;
|
|
1249
1273
|
}
|
|
1250
|
-
function
|
|
1251
|
-
let t =
|
|
1252
|
-
if (
|
|
1274
|
+
function Cr(e) {
|
|
1275
|
+
let t = _r.parse(e), n = !1;
|
|
1276
|
+
if (bt(t, "leafDirective", (e, t, r) => {
|
|
1253
1277
|
let i = t === void 0 ? void 0 : r?.children[t + 1];
|
|
1254
1278
|
if (e.name !== "table" || i?.type !== "table") return;
|
|
1255
1279
|
n = !0;
|
|
1256
|
-
let a = [
|
|
1280
|
+
let a = [Sr(e, "title"), Sr(e, "description")].filter(Boolean).join(" ");
|
|
1257
1281
|
e.children = a ? [{
|
|
1258
1282
|
type: "text",
|
|
1259
1283
|
value: a
|
|
1260
1284
|
}] : [];
|
|
1261
|
-
}), n) return
|
|
1285
|
+
}), n) return gt(st(t, { includeHtml: !1 }));
|
|
1262
1286
|
}
|
|
1263
|
-
function
|
|
1287
|
+
function wr(e) {
|
|
1264
1288
|
let t = O(2), n;
|
|
1265
|
-
return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ M(
|
|
1289
|
+
return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ M(dt, { ...e }), t[0] = e, t[1] = n), n;
|
|
1266
1290
|
}
|
|
1267
|
-
function
|
|
1291
|
+
function Tr(e) {
|
|
1268
1292
|
function t(t) {
|
|
1269
1293
|
let n = O(6), r;
|
|
1270
|
-
n[0] !== t.content || n[1] !== t.dir ? (r =
|
|
1294
|
+
n[0] !== t.content || n[1] !== t.dir ? (r = Cr(t.content) ?? t.dir, n[0] = t.content, n[1] = t.dir, n[2] = r) : r = n[2];
|
|
1271
1295
|
let i = r, a;
|
|
1272
1296
|
return n[3] !== i || n[4] !== t ? (a = /* @__PURE__ */ M(e, {
|
|
1273
1297
|
...t,
|
|
@@ -1276,54 +1300,54 @@ function yr(e) {
|
|
|
1276
1300
|
}
|
|
1277
1301
|
return t.displayName = "DirectionAwareTableBlock", t;
|
|
1278
1302
|
}
|
|
1279
|
-
function
|
|
1280
|
-
let n = t &&
|
|
1303
|
+
function Er(e, t) {
|
|
1304
|
+
let n = t && Sr(t, "title"), r = t && Sr(t, "description"), i = {
|
|
1281
1305
|
...n ? { title: n } : {},
|
|
1282
1306
|
...r ? { description: r } : {}
|
|
1283
1307
|
};
|
|
1284
1308
|
return {
|
|
1285
1309
|
type: "tablePanel",
|
|
1286
1310
|
data: {
|
|
1287
|
-
hName:
|
|
1311
|
+
hName: mr,
|
|
1288
1312
|
...Object.keys(i).length > 0 ? { hProperties: i } : {}
|
|
1289
1313
|
},
|
|
1290
1314
|
children: [e]
|
|
1291
1315
|
};
|
|
1292
1316
|
}
|
|
1293
|
-
function
|
|
1317
|
+
function Dr() {
|
|
1294
1318
|
return (e) => {
|
|
1295
|
-
|
|
1319
|
+
bt(e, "table", (e, t, n) => {
|
|
1296
1320
|
if (t === void 0 || !n) return;
|
|
1297
|
-
let r =
|
|
1298
|
-
return n.children.splice(i, a,
|
|
1321
|
+
let r = br(n.children, t), i = r ? t - 1 : t, a = r ? 2 : 1;
|
|
1322
|
+
return n.children.splice(i, a, Er(e, r)), [yt, i + 1];
|
|
1299
1323
|
});
|
|
1300
1324
|
};
|
|
1301
1325
|
}
|
|
1302
|
-
var
|
|
1303
|
-
...Object.values(
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
],
|
|
1326
|
+
var Or = [
|
|
1327
|
+
...Object.values(ht),
|
|
1328
|
+
ct,
|
|
1329
|
+
Dr
|
|
1330
|
+
], kr = t.createContext({
|
|
1307
1331
|
actions: null,
|
|
1308
1332
|
controls: !0
|
|
1309
1333
|
});
|
|
1310
|
-
function
|
|
1334
|
+
function Ar(e, t) {
|
|
1311
1335
|
if (e === !1) return !1;
|
|
1312
1336
|
if (e === !0 || e === void 0) return !0;
|
|
1313
1337
|
let n = e.table;
|
|
1314
1338
|
return n === !1 ? !1 : n === !0 || n === void 0 || n[t] !== !1;
|
|
1315
1339
|
}
|
|
1316
|
-
function
|
|
1340
|
+
function jr(e) {
|
|
1317
1341
|
return e === !1 ? !1 : e === !0 || e === void 0 ? { table: !1 } : {
|
|
1318
1342
|
...e,
|
|
1319
1343
|
table: !1
|
|
1320
1344
|
};
|
|
1321
1345
|
}
|
|
1322
|
-
function
|
|
1323
|
-
let n = O(21), { children: r, className: i, title: a, description: o } = e, { actions: s, controls: c } = t.use(
|
|
1324
|
-
n[0] === c ? l = n[1] : (l =
|
|
1346
|
+
function Mr(e) {
|
|
1347
|
+
let n = O(21), { children: r, className: i, title: a, description: o } = e, { actions: s, controls: c } = t.use(kr), l;
|
|
1348
|
+
n[0] === c ? l = n[1] : (l = Ar(c, "copy"), n[0] = c, n[1] = l);
|
|
1325
1349
|
let u = l, d;
|
|
1326
|
-
n[2] === c ? d = n[3] : (d =
|
|
1350
|
+
n[2] === c ? d = n[3] : (d = Ar(c, "download"), n[2] = c, n[3] = d);
|
|
1327
1351
|
let f = d, p = !!(a || o), m = !!(u || f || s);
|
|
1328
1352
|
if (!r) return null;
|
|
1329
1353
|
let h;
|
|
@@ -1337,8 +1361,8 @@ function Er(e) {
|
|
|
1337
1361
|
})] }), m && /* @__PURE__ */ N(q.Actions, {
|
|
1338
1362
|
"data-copy-exclude": "assistant-snapshot",
|
|
1339
1363
|
children: [
|
|
1340
|
-
u && /* @__PURE__ */ M(
|
|
1341
|
-
f && /* @__PURE__ */ M(
|
|
1364
|
+
u && /* @__PURE__ */ M(pt, { className: gr }),
|
|
1365
|
+
f && /* @__PURE__ */ M(mt, { className: gr }),
|
|
1342
1366
|
s
|
|
1343
1367
|
]
|
|
1344
1368
|
})]
|
|
@@ -1357,31 +1381,31 @@ function Er(e) {
|
|
|
1357
1381
|
children: [g, v]
|
|
1358
1382
|
}), n[17] = h, n[18] = g, n[19] = v, n[20] = y) : y = n[20], y;
|
|
1359
1383
|
}
|
|
1360
|
-
function
|
|
1384
|
+
function Nr(e) {
|
|
1361
1385
|
let t = O(43), n, r, i, a, o, s, c, l, u, d;
|
|
1362
1386
|
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4], o = t[5], s = t[6], c = t[7], l = t[8], u = t[9], d = t[10]) : ({allowedTags: r, BlockComponent: n, children: i, components: a, controls: o, dir: s, mode: c, remarkPlugins: u, tableActions: d, ...l} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = o, t[6] = s, t[7] = c, t[8] = l, t[9] = u, t[10] = d);
|
|
1363
1387
|
let f;
|
|
1364
1388
|
bb0: {
|
|
1365
1389
|
if (!u) {
|
|
1366
|
-
f =
|
|
1390
|
+
f = Or;
|
|
1367
1391
|
break bb0;
|
|
1368
1392
|
}
|
|
1369
1393
|
let e;
|
|
1370
1394
|
t[11] === u ? e = t[12] : (e = [
|
|
1371
1395
|
...u,
|
|
1372
|
-
|
|
1373
|
-
|
|
1396
|
+
ct,
|
|
1397
|
+
Dr
|
|
1374
1398
|
], t[11] = u, t[12] = e), f = e;
|
|
1375
1399
|
}
|
|
1376
1400
|
let p = f, m;
|
|
1377
1401
|
t[13] === r ? m = t[14] : (m = {
|
|
1378
1402
|
...r,
|
|
1379
|
-
[
|
|
1403
|
+
[mr]: hr
|
|
1380
1404
|
}, t[13] = r, t[14] = m);
|
|
1381
1405
|
let h = m, g;
|
|
1382
1406
|
t[15] === a ? g = t[16] : (g = {
|
|
1383
1407
|
...a,
|
|
1384
|
-
[
|
|
1408
|
+
[mr]: Mr
|
|
1385
1409
|
}, t[15] = a, t[16] = g);
|
|
1386
1410
|
let _ = g, v;
|
|
1387
1411
|
t[17] !== o || t[18] !== d ? (v = {
|
|
@@ -1394,8 +1418,8 @@ function Dr(e) {
|
|
|
1394
1418
|
b = n;
|
|
1395
1419
|
break bb1;
|
|
1396
1420
|
}
|
|
1397
|
-
let e = n ??
|
|
1398
|
-
t[20] === e ? r = t[21] : (r =
|
|
1421
|
+
let e = n ?? wr, r;
|
|
1422
|
+
t[20] === e ? r = t[21] : (r = Tr(e), t[20] = e, t[21] = r), b = r;
|
|
1399
1423
|
}
|
|
1400
1424
|
let x = b, S;
|
|
1401
1425
|
bb2: {
|
|
@@ -1404,34 +1428,34 @@ function Dr(e) {
|
|
|
1404
1428
|
break bb2;
|
|
1405
1429
|
}
|
|
1406
1430
|
let e;
|
|
1407
|
-
t[22] !== i || t[23] !== s ? (e =
|
|
1431
|
+
t[22] !== i || t[23] !== s ? (e = Cr(i) ?? s, t[22] = i, t[23] = s, t[24] = e) : e = t[24], S = e;
|
|
1408
1432
|
}
|
|
1409
1433
|
let C = S, w;
|
|
1410
|
-
t[25] === o ? w = t[26] : (w =
|
|
1434
|
+
t[25] === o ? w = t[26] : (w = jr(o), t[25] = o, t[26] = w);
|
|
1411
1435
|
let T;
|
|
1412
|
-
t[27] !== i || t[28] !== h ? (T =
|
|
1436
|
+
t[27] !== i || t[28] !== h ? (T = sr(i, Object.keys(h)), t[27] = i, t[28] = h, t[29] = T) : T = t[29];
|
|
1413
1437
|
let E;
|
|
1414
|
-
t[30] !== c || t[31] !== l || t[32] !== C || t[33] !== w || t[34] !== T || t[35] !== h || t[36] !== x || t[37] !== _ || t[38] !== p ? (E = /* @__PURE__ */ M(
|
|
1438
|
+
t[30] !== c || t[31] !== l || t[32] !== C || t[33] !== w || t[34] !== T || t[35] !== h || t[36] !== x || t[37] !== _ || t[38] !== p ? (E = /* @__PURE__ */ M(ft, {
|
|
1415
1439
|
allowedTags: h,
|
|
1416
1440
|
BlockComponent: x,
|
|
1417
1441
|
components: _,
|
|
1418
1442
|
controls: w,
|
|
1419
1443
|
dir: C,
|
|
1420
1444
|
mode: c,
|
|
1421
|
-
parseMarkdownIntoBlocksFn:
|
|
1445
|
+
parseMarkdownIntoBlocksFn: vr,
|
|
1422
1446
|
remarkPlugins: p,
|
|
1423
1447
|
...l,
|
|
1424
1448
|
children: T
|
|
1425
1449
|
}), t[30] = c, t[31] = l, t[32] = C, t[33] = w, t[34] = T, t[35] = h, t[36] = x, t[37] = _, t[38] = p, t[39] = E) : E = t[39];
|
|
1426
1450
|
let D;
|
|
1427
|
-
return t[40] !== E || t[41] !== y ? (D = /* @__PURE__ */ M(
|
|
1451
|
+
return t[40] !== E || t[41] !== y ? (D = /* @__PURE__ */ M(kr, {
|
|
1428
1452
|
value: y,
|
|
1429
1453
|
children: E
|
|
1430
1454
|
}), t[40] = E, t[41] = y, t[42] = D) : D = t[42], D;
|
|
1431
1455
|
}
|
|
1432
1456
|
//#endregion
|
|
1433
1457
|
//#region src/lib/elements/Response.tsx
|
|
1434
|
-
var
|
|
1458
|
+
var Pr = class extends t.Component {
|
|
1435
1459
|
state = {
|
|
1436
1460
|
hasError: !1,
|
|
1437
1461
|
error: null
|
|
@@ -1454,16 +1478,17 @@ var Or = class extends t.Component {
|
|
|
1454
1478
|
let i;
|
|
1455
1479
|
t[3] === n ? i = t[4] : (i = k("size-full space-y-2 [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", n), t[3] = n, t[4] = i);
|
|
1456
1480
|
let a;
|
|
1457
|
-
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ M(
|
|
1481
|
+
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ M(Pr, { children: /* @__PURE__ */ M(Nr, {
|
|
1458
1482
|
className: i,
|
|
1483
|
+
dir: "auto",
|
|
1459
1484
|
...r
|
|
1460
1485
|
}) }), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1461
1486
|
});
|
|
1462
1487
|
J.displayName = "Response";
|
|
1463
1488
|
//#endregion
|
|
1464
1489
|
//#region src/lib/ui/use-copy-feedback.ts
|
|
1465
|
-
function
|
|
1466
|
-
let t = O(9), n = e === void 0 ? 2e3 : e, r =
|
|
1490
|
+
function Fr(e) {
|
|
1491
|
+
let t = O(9), n = e === void 0 ? 2e3 : e, r = St(), [i, a] = g(!1), o = h(null), s, c;
|
|
1467
1492
|
t[0] === r ? (s = t[1], c = t[2]) : (s = () => () => {
|
|
1468
1493
|
o.current && r.clearTimeout(o.current);
|
|
1469
1494
|
}, c = [r], t[0] = r, t[1] = s, t[2] = c), d(s, c);
|
|
@@ -1476,13 +1501,13 @@ function kr(e) {
|
|
|
1476
1501
|
}
|
|
1477
1502
|
//#endregion
|
|
1478
1503
|
//#region src/lib/elements/code-block.tsx
|
|
1479
|
-
var
|
|
1504
|
+
var Ir = o({ code: "" }), Lr = (e) => {
|
|
1480
1505
|
let t = O(24), n, r, i, a, o, s;
|
|
1481
1506
|
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4], o = t[5], s = t[6]) : ({code: r, language: i, showLineNumbers: o, wrap: s, children: n, ...a} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = o, t[6] = s);
|
|
1482
|
-
let c = o !== void 0 && o, l = s !== void 0 && s, u =
|
|
1507
|
+
let c = o !== void 0 && o, l = s !== void 0 && s, u = Pe(r, i), d;
|
|
1483
1508
|
t[7] === r ? d = t[8] : (d = { code: r }, t[7] = r, t[8] = d);
|
|
1484
1509
|
let f;
|
|
1485
|
-
t[9] === u ? f = t[10] : (f = u.map(
|
|
1510
|
+
t[9] === u ? f = t[10] : (f = u.map(zr), t[9] = u, t[10] = f);
|
|
1486
1511
|
let p;
|
|
1487
1512
|
t[11] !== c || t[12] !== f || t[13] !== l ? (p = /* @__PURE__ */ M(Te, {
|
|
1488
1513
|
lineNumbers: c,
|
|
@@ -1498,12 +1523,12 @@ var Ar = o({ code: "" }), jr = (e) => {
|
|
|
1498
1523
|
children: [p, m]
|
|
1499
1524
|
}), t[17] = a, t[18] = p, t[19] = m, t[20] = h) : h = t[20];
|
|
1500
1525
|
let g;
|
|
1501
|
-
return t[21] !== d || t[22] !== h ? (g = /* @__PURE__ */ M(
|
|
1526
|
+
return t[21] !== d || t[22] !== h ? (g = /* @__PURE__ */ M(Ir, {
|
|
1502
1527
|
value: d,
|
|
1503
1528
|
children: h
|
|
1504
1529
|
}), t[21] = d, t[22] = h, t[23] = g) : g = t[23], g;
|
|
1505
|
-
},
|
|
1506
|
-
let [o, s] =
|
|
1530
|
+
}, Rr = ({ onCopy: e, onError: t, timeout: n = 2e3, children: r, className: i, ...a }) => {
|
|
1531
|
+
let [o, s] = Fr(n), { code: c } = l(Ir), u = async () => {
|
|
1507
1532
|
if (typeof window > "u" || !navigator.clipboard.writeText) {
|
|
1508
1533
|
t?.(/* @__PURE__ */ Error("Clipboard API not available"));
|
|
1509
1534
|
return;
|
|
@@ -1513,7 +1538,7 @@ var Ar = o({ code: "" }), jr = (e) => {
|
|
|
1513
1538
|
} catch (e) {
|
|
1514
1539
|
t?.(e instanceof Error ? e : Error(String(e)));
|
|
1515
1540
|
}
|
|
1516
|
-
}, d = o ?
|
|
1541
|
+
}, d = o ? Be : qe;
|
|
1517
1542
|
return /* @__PURE__ */ M(he, {
|
|
1518
1543
|
className: k("shrink-0", i),
|
|
1519
1544
|
onClick: () => void u(),
|
|
@@ -1523,12 +1548,12 @@ var Ar = o({ code: "" }), jr = (e) => {
|
|
|
1523
1548
|
children: r ?? /* @__PURE__ */ M(d, {})
|
|
1524
1549
|
});
|
|
1525
1550
|
};
|
|
1526
|
-
function
|
|
1551
|
+
function zr(e, t) {
|
|
1527
1552
|
return /* @__PURE__ */ M(Ee, { children: e }, t);
|
|
1528
1553
|
}
|
|
1529
1554
|
//#endregion
|
|
1530
1555
|
//#region src/lib/elements/Tool.tsx
|
|
1531
|
-
var
|
|
1556
|
+
var Br = (e) => {
|
|
1532
1557
|
let t = O(8), n, r;
|
|
1533
1558
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1534
1559
|
let i;
|
|
@@ -1538,17 +1563,17 @@ var Pr = (e) => {
|
|
|
1538
1563
|
className: i,
|
|
1539
1564
|
...r
|
|
1540
1565
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1541
|
-
},
|
|
1566
|
+
}, Vr = (e) => /* @__PURE__ */ N(me, {
|
|
1542
1567
|
className: "gap-1.5 rounded-full text-xs",
|
|
1543
1568
|
variant: "secondary",
|
|
1544
1569
|
children: [{
|
|
1545
|
-
"input-streaming": /* @__PURE__ */ M(
|
|
1546
|
-
"input-available": /* @__PURE__ */ M(
|
|
1547
|
-
"approval-requested": /* @__PURE__ */ M(
|
|
1548
|
-
"approval-responded": /* @__PURE__ */ M(
|
|
1549
|
-
"output-available": /* @__PURE__ */ M(
|
|
1550
|
-
"output-error": /* @__PURE__ */ M(
|
|
1551
|
-
"output-denied": /* @__PURE__ */ M(
|
|
1570
|
+
"input-streaming": /* @__PURE__ */ M(We, { className: "size-4" }),
|
|
1571
|
+
"input-available": /* @__PURE__ */ M(Ge, { className: "size-4 animate-pulse" }),
|
|
1572
|
+
"approval-requested": /* @__PURE__ */ M(Ge, { className: "size-4 text-yellow-600" }),
|
|
1573
|
+
"approval-responded": /* @__PURE__ */ M(ze, { className: "size-4 text-blue-600" }),
|
|
1574
|
+
"output-available": /* @__PURE__ */ M(ze, { className: "size-4 text-green-600" }),
|
|
1575
|
+
"output-error": /* @__PURE__ */ M(at, { className: "size-4 text-red-600" }),
|
|
1576
|
+
"output-denied": /* @__PURE__ */ M(at, { className: "size-4 text-orange-600" })
|
|
1552
1577
|
}[e], {
|
|
1553
1578
|
"input-streaming": "Pending",
|
|
1554
1579
|
"input-available": "Running",
|
|
@@ -1558,13 +1583,13 @@ var Pr = (e) => {
|
|
|
1558
1583
|
"output-error": "Error",
|
|
1559
1584
|
"output-denied": "Denied"
|
|
1560
1585
|
}[e]]
|
|
1561
|
-
}),
|
|
1586
|
+
}), Hr = (e) => {
|
|
1562
1587
|
let t = O(23), n, r, i, a;
|
|
1563
1588
|
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4]) : ({className: n, title: a, part: r, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a);
|
|
1564
1589
|
let o;
|
|
1565
1590
|
t[5] === n ? o = t[6] : (o = k("group flex w-full items-center justify-between gap-4 p-3", n), t[5] = n, t[6] = o);
|
|
1566
1591
|
let s;
|
|
1567
|
-
t[7] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(
|
|
1592
|
+
t[7] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(it, { className: "text-muted-foreground size-4" }), t[7] = s) : s = t[7];
|
|
1568
1593
|
let c;
|
|
1569
1594
|
t[8] !== r || t[9] !== a ? (c = a ?? b(r), t[8] = r, t[9] = a, t[10] = c) : c = t[10];
|
|
1570
1595
|
let l;
|
|
@@ -1573,7 +1598,7 @@ var Pr = (e) => {
|
|
|
1573
1598
|
children: c
|
|
1574
1599
|
}), t[11] = c, t[12] = l);
|
|
1575
1600
|
let u;
|
|
1576
|
-
t[13] === r.state ? u = t[14] : (u =
|
|
1601
|
+
t[13] === r.state ? u = t[14] : (u = Vr(r.state), t[13] = r.state, t[14] = u);
|
|
1577
1602
|
let d;
|
|
1578
1603
|
t[15] !== l || t[16] !== u ? (d = /* @__PURE__ */ N("div", {
|
|
1579
1604
|
className: "flex items-center gap-2",
|
|
@@ -1584,14 +1609,14 @@ var Pr = (e) => {
|
|
|
1584
1609
|
]
|
|
1585
1610
|
}), t[15] = l, t[16] = u, t[17] = d) : d = t[17];
|
|
1586
1611
|
let f;
|
|
1587
|
-
t[18] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(
|
|
1612
|
+
t[18] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(He, { className: "text-muted-foreground size-4 transition-transform group-data-[panel-open]:rotate-180" }), t[18] = f) : f = t[18];
|
|
1588
1613
|
let p;
|
|
1589
1614
|
return t[19] !== i || t[20] !== o || t[21] !== d ? (p = /* @__PURE__ */ N(L, {
|
|
1590
1615
|
className: o,
|
|
1591
1616
|
...i,
|
|
1592
1617
|
children: [d, f]
|
|
1593
1618
|
}), t[19] = i, t[20] = o, t[21] = d, t[22] = p) : p = t[22], p;
|
|
1594
|
-
},
|
|
1619
|
+
}, Ur = (e) => {
|
|
1595
1620
|
let t = O(8), n, r;
|
|
1596
1621
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1597
1622
|
let i;
|
|
@@ -1601,7 +1626,7 @@ var Pr = (e) => {
|
|
|
1601
1626
|
className: i,
|
|
1602
1627
|
...r
|
|
1603
1628
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1604
|
-
},
|
|
1629
|
+
}, Wr = (e) => {
|
|
1605
1630
|
let t = O(15), n, r, i;
|
|
1606
1631
|
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({className: n, input: r, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
1607
1632
|
let a;
|
|
@@ -1616,7 +1641,7 @@ var Pr = (e) => {
|
|
|
1616
1641
|
let c;
|
|
1617
1642
|
t[9] === s ? c = t[10] : (c = /* @__PURE__ */ M("div", {
|
|
1618
1643
|
className: "bg-muted/50 rounded-md",
|
|
1619
|
-
children: /* @__PURE__ */ M(
|
|
1644
|
+
children: /* @__PURE__ */ M(Lr, {
|
|
1620
1645
|
code: s,
|
|
1621
1646
|
language: "json"
|
|
1622
1647
|
})
|
|
@@ -1627,7 +1652,7 @@ var Pr = (e) => {
|
|
|
1627
1652
|
...i,
|
|
1628
1653
|
children: [o, c]
|
|
1629
1654
|
}), t[11] = i, t[12] = a, t[13] = c, t[14] = l) : l = t[14], l;
|
|
1630
|
-
},
|
|
1655
|
+
}, Gr = (e) => {
|
|
1631
1656
|
let t = O(24), n, r, i, a;
|
|
1632
1657
|
if (t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4]) : ({className: n, output: i, errorText: r, ...a} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a), !(i || r)) return null;
|
|
1633
1658
|
let o;
|
|
@@ -1642,7 +1667,7 @@ var Pr = (e) => {
|
|
|
1642
1667
|
let d;
|
|
1643
1668
|
t[11] === r ? d = t[12] : (d = r && /* @__PURE__ */ M("div", { children: r }), t[11] = r, t[12] = d);
|
|
1644
1669
|
let f;
|
|
1645
|
-
t[13] === i ? f = t[14] : (f =
|
|
1670
|
+
t[13] === i ? f = t[14] : (f = Kr(i), t[13] = i, t[14] = f);
|
|
1646
1671
|
let p;
|
|
1647
1672
|
t[15] !== u || t[16] !== d || t[17] !== f ? (p = /* @__PURE__ */ N("div", {
|
|
1648
1673
|
className: u,
|
|
@@ -1655,27 +1680,27 @@ var Pr = (e) => {
|
|
|
1655
1680
|
children: [c, p]
|
|
1656
1681
|
}), t[19] = a, t[20] = o, t[21] = c, t[22] = p, t[23] = m) : m = t[23], m;
|
|
1657
1682
|
};
|
|
1658
|
-
function
|
|
1659
|
-
return typeof e == "string" ? /* @__PURE__ */ M(
|
|
1683
|
+
function Kr(e) {
|
|
1684
|
+
return typeof e == "string" ? /* @__PURE__ */ M(Lr, {
|
|
1660
1685
|
code: e,
|
|
1661
1686
|
language: "json"
|
|
1662
|
-
}) : s(e) ? /* @__PURE__ */ M("div", { children: e }) : typeof e == "object" ? /* @__PURE__ */ M(
|
|
1687
|
+
}) : s(e) ? /* @__PURE__ */ M("div", { children: e }) : typeof e == "object" ? /* @__PURE__ */ M(Lr, {
|
|
1663
1688
|
code: JSON.stringify(e, null, 2),
|
|
1664
1689
|
language: "json"
|
|
1665
1690
|
}) : typeof e == "number" || typeof e == "bigint" ? /* @__PURE__ */ M("div", { children: e }) : /* @__PURE__ */ M("div", {});
|
|
1666
1691
|
}
|
|
1667
1692
|
//#endregion
|
|
1668
1693
|
//#region src/lib/components/tool-debug.tsx
|
|
1669
|
-
function
|
|
1694
|
+
function qr(e) {
|
|
1670
1695
|
let t = O(20), { part: n } = e, r;
|
|
1671
1696
|
t[0] === n ? r = t[1] : (r = b(n), t[0] = n, t[1] = r);
|
|
1672
1697
|
let i = `Executing ${r}`, a;
|
|
1673
|
-
t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M(
|
|
1698
|
+
t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M(Hr, {
|
|
1674
1699
|
title: i,
|
|
1675
1700
|
part: n
|
|
1676
1701
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4];
|
|
1677
1702
|
let o;
|
|
1678
|
-
t[5] === n.input ? o = t[6] : (o = /* @__PURE__ */ M(
|
|
1703
|
+
t[5] === n.input ? o = t[6] : (o = /* @__PURE__ */ M(Wr, { input: n.input }), t[5] = n.input, t[6] = o);
|
|
1679
1704
|
let s;
|
|
1680
1705
|
t[7] === n.output ? s = t[8] : (s = typeof n.output == "string" ? n.output : JSON.stringify(n.output, null, 2), t[7] = n.output, t[8] = s);
|
|
1681
1706
|
let c;
|
|
@@ -1684,26 +1709,26 @@ function Vr(e) {
|
|
|
1684
1709
|
children: s
|
|
1685
1710
|
}), t[9] = s, t[10] = c);
|
|
1686
1711
|
let l;
|
|
1687
|
-
t[11] !== n.errorText || t[12] !== c ? (l = /* @__PURE__ */ M(
|
|
1712
|
+
t[11] !== n.errorText || t[12] !== c ? (l = /* @__PURE__ */ M(Gr, {
|
|
1688
1713
|
output: c,
|
|
1689
1714
|
errorText: n.errorText
|
|
1690
1715
|
}), t[11] = n.errorText, t[12] = c, t[13] = l) : l = t[13];
|
|
1691
1716
|
let u;
|
|
1692
|
-
t[14] !== o || t[15] !== l ? (u = /* @__PURE__ */ N(
|
|
1717
|
+
t[14] !== o || t[15] !== l ? (u = /* @__PURE__ */ N(Ur, { children: [o, l] }), t[14] = o, t[15] = l, t[16] = u) : u = t[16];
|
|
1693
1718
|
let d;
|
|
1694
|
-
return t[17] !== a || t[18] !== u ? (d = /* @__PURE__ */ N(
|
|
1719
|
+
return t[17] !== a || t[18] !== u ? (d = /* @__PURE__ */ N(Br, {
|
|
1695
1720
|
"data-copy-exclude": "assistant-snapshot",
|
|
1696
1721
|
children: [a, u]
|
|
1697
1722
|
}), t[17] = a, t[18] = u, t[19] = d) : d = t[19], d;
|
|
1698
1723
|
}
|
|
1699
|
-
function
|
|
1724
|
+
function Jr(e) {
|
|
1700
1725
|
let t = O(18), { part: n } = e, r = `Executing ${n.toolName}`, i;
|
|
1701
|
-
t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(
|
|
1726
|
+
t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(Hr, {
|
|
1702
1727
|
title: r,
|
|
1703
1728
|
part: n
|
|
1704
1729
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2];
|
|
1705
1730
|
let a;
|
|
1706
|
-
t[3] === n.input ? a = t[4] : (a = /* @__PURE__ */ M(
|
|
1731
|
+
t[3] === n.input ? a = t[4] : (a = /* @__PURE__ */ M(Wr, { input: n.input }), t[3] = n.input, t[4] = a);
|
|
1707
1732
|
let o;
|
|
1708
1733
|
t[5] === n.output ? o = t[6] : (o = typeof n.output == "string" ? n.output : JSON.stringify(n.output, null, 2), t[5] = n.output, t[6] = o);
|
|
1709
1734
|
let s;
|
|
@@ -1712,49 +1737,49 @@ function Hr(e) {
|
|
|
1712
1737
|
children: o
|
|
1713
1738
|
}), t[7] = o, t[8] = s);
|
|
1714
1739
|
let c;
|
|
1715
|
-
t[9] !== n.errorText || t[10] !== s ? (c = /* @__PURE__ */ M(
|
|
1740
|
+
t[9] !== n.errorText || t[10] !== s ? (c = /* @__PURE__ */ M(Gr, {
|
|
1716
1741
|
output: s,
|
|
1717
1742
|
errorText: n.errorText
|
|
1718
1743
|
}), t[9] = n.errorText, t[10] = s, t[11] = c) : c = t[11];
|
|
1719
1744
|
let l;
|
|
1720
|
-
t[12] !== a || t[13] !== c ? (l = /* @__PURE__ */ N(
|
|
1745
|
+
t[12] !== a || t[13] !== c ? (l = /* @__PURE__ */ N(Ur, { children: [a, c] }), t[12] = a, t[13] = c, t[14] = l) : l = t[14];
|
|
1721
1746
|
let u;
|
|
1722
|
-
return t[15] !== i || t[16] !== l ? (u = /* @__PURE__ */ N(
|
|
1747
|
+
return t[15] !== i || t[16] !== l ? (u = /* @__PURE__ */ N(Br, {
|
|
1723
1748
|
"data-copy-exclude": "assistant-snapshot",
|
|
1724
1749
|
children: [i, l]
|
|
1725
1750
|
}), t[15] = i, t[16] = l, t[17] = u) : u = t[17], u;
|
|
1726
1751
|
}
|
|
1727
1752
|
//#endregion
|
|
1728
1753
|
//#region src/lib/copy/copy-image.ts
|
|
1729
|
-
var
|
|
1754
|
+
var Yr = "data-copy-exclude", Xr = {
|
|
1730
1755
|
image: "image",
|
|
1731
1756
|
assistantSnapshot: "assistant-snapshot"
|
|
1732
1757
|
};
|
|
1733
|
-
function
|
|
1758
|
+
function Zr(e) {
|
|
1734
1759
|
return typeof e == "object" && !!e && "getAttribute" in e && typeof e.getAttribute == "function";
|
|
1735
1760
|
}
|
|
1736
|
-
function
|
|
1737
|
-
if (!
|
|
1738
|
-
let n = e.getAttribute(
|
|
1761
|
+
function Qr(e, t) {
|
|
1762
|
+
if (!Zr(e)) return !1;
|
|
1763
|
+
let n = e.getAttribute(Yr);
|
|
1739
1764
|
return n ? n.split(/\s+/).includes(t) : !1;
|
|
1740
1765
|
}
|
|
1741
|
-
function
|
|
1742
|
-
return !
|
|
1766
|
+
function $r(e, t) {
|
|
1767
|
+
return !Qr(e, t);
|
|
1743
1768
|
}
|
|
1744
|
-
function
|
|
1769
|
+
function ei({ clipboard: e, ClipboardItem: t }) {
|
|
1745
1770
|
return typeof e?.write == "function" && typeof t == "function" ? "image" : typeof e?.writeText == "function" ? "text" : "none";
|
|
1746
1771
|
}
|
|
1747
1772
|
//#endregion
|
|
1748
1773
|
//#region src/lib/copy/snapshot-context.ts
|
|
1749
|
-
var
|
|
1774
|
+
var ti = o(!1);
|
|
1750
1775
|
//#endregion
|
|
1751
1776
|
//#region src/lib/copy/snapshot-render.tsx
|
|
1752
|
-
function
|
|
1777
|
+
function ni() {
|
|
1753
1778
|
return new Promise((e) => {
|
|
1754
1779
|
requestAnimationFrame(() => e());
|
|
1755
1780
|
});
|
|
1756
1781
|
}
|
|
1757
|
-
function
|
|
1782
|
+
function ri(e) {
|
|
1758
1783
|
let t = O(9), { contentRef: n, children: r, width: i, padding: a, className: o } = e, s = i === void 0 ? 1120 : i, c = a === void 0 ? 24 : a, l = o === void 0 ? "bg-background text-foreground flex flex-col gap-3" : o;
|
|
1759
1784
|
if (typeof document > "u") return null;
|
|
1760
1785
|
let u;
|
|
@@ -1772,10 +1797,10 @@ function Zr(e) {
|
|
|
1772
1797
|
boxSizing: "border-box"
|
|
1773
1798
|
}, t[1] = c, t[2] = s, t[3] = d) : d = t[3];
|
|
1774
1799
|
let f;
|
|
1775
|
-
return t[4] !== r || t[5] !== l || t[6] !== n || t[7] !== d ? (f =
|
|
1800
|
+
return t[4] !== r || t[5] !== l || t[6] !== n || t[7] !== d ? (f = Ct(/* @__PURE__ */ M("div", {
|
|
1776
1801
|
"aria-hidden": "true",
|
|
1777
1802
|
style: u,
|
|
1778
|
-
children: /* @__PURE__ */ M(
|
|
1803
|
+
children: /* @__PURE__ */ M(ti, {
|
|
1779
1804
|
value: !0,
|
|
1780
1805
|
children: /* @__PURE__ */ M("div", {
|
|
1781
1806
|
ref: n,
|
|
@@ -1788,14 +1813,14 @@ function Zr(e) {
|
|
|
1788
1813
|
}
|
|
1789
1814
|
//#endregion
|
|
1790
1815
|
//#region src/lib/copy/use-copy-element-as-image.ts
|
|
1791
|
-
function
|
|
1816
|
+
function ii(e) {
|
|
1792
1817
|
let t = getComputedStyle(e).backgroundColor;
|
|
1793
1818
|
if (t !== "rgba(0, 0, 0, 0)") return t;
|
|
1794
1819
|
let n = getComputedStyle(document.body).backgroundColor;
|
|
1795
1820
|
return n === "rgba(0, 0, 0, 0)" ? void 0 : n;
|
|
1796
1821
|
}
|
|
1797
|
-
function
|
|
1798
|
-
let r =
|
|
1822
|
+
function ai({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
1823
|
+
let r = St(), [i, a] = g(!1), [o, s] = g(null), c = h(null), l = u(() => {
|
|
1799
1824
|
c.current !== null && (r.clearTimeout(c.current), c.current = null);
|
|
1800
1825
|
}, [r]), f = u((e) => {
|
|
1801
1826
|
l(), s(e), c.current = r.setTimeout(() => {
|
|
@@ -1811,9 +1836,9 @@ function $r({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1811
1836
|
}), !0), [n, f]), m = u(async () => {
|
|
1812
1837
|
if (!e.current) throw Error("Nothing is ready to copy yet.");
|
|
1813
1838
|
let { toBlob: n } = await import("html-to-image"), r = await n(e.current, {
|
|
1814
|
-
backgroundColor:
|
|
1839
|
+
backgroundColor: ii(e.current),
|
|
1815
1840
|
pixelRatio: 2,
|
|
1816
|
-
filter: (e) =>
|
|
1841
|
+
filter: (e) => $r(e, t)
|
|
1817
1842
|
});
|
|
1818
1843
|
if (!r) throw Error("Unable to render the image for copying.");
|
|
1819
1844
|
await navigator.clipboard.write([new ClipboardItem({ [r.type]: r })]), f({
|
|
@@ -1829,7 +1854,7 @@ function $r({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1829
1854
|
copy: u(async () => {
|
|
1830
1855
|
a(!0), s(null);
|
|
1831
1856
|
try {
|
|
1832
|
-
let e =
|
|
1857
|
+
let e = ei({
|
|
1833
1858
|
clipboard: typeof navigator > "u" ? void 0 : navigator.clipboard,
|
|
1834
1859
|
ClipboardItem: typeof window > "u" ? void 0 : window.ClipboardItem
|
|
1835
1860
|
});
|
|
@@ -1864,29 +1889,29 @@ function $r({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1864
1889
|
}
|
|
1865
1890
|
//#endregion
|
|
1866
1891
|
//#region src/lib/copy/assistant-snapshot.tsx
|
|
1867
|
-
function
|
|
1892
|
+
function oi(e) {
|
|
1868
1893
|
return e.parts.filter(C).map((e) => e.text).join("\n");
|
|
1869
1894
|
}
|
|
1870
1895
|
function Y() {
|
|
1871
|
-
return l(
|
|
1896
|
+
return l(ti);
|
|
1872
1897
|
}
|
|
1873
|
-
function
|
|
1898
|
+
function si(e) {
|
|
1874
1899
|
let t = O(30), { message: n, renderContent: r, className: i } = e, a = h(null), [o, s] = g(!1), c;
|
|
1875
|
-
t[0] === n ? c = t[1] : (c =
|
|
1900
|
+
t[0] === n ? c = t[1] : (c = oi(n), t[0] = n, t[1] = c);
|
|
1876
1901
|
let l = c, u;
|
|
1877
1902
|
t[2] === l ? u = t[3] : (u = {
|
|
1878
1903
|
elementRef: a,
|
|
1879
|
-
excludeMode:
|
|
1904
|
+
excludeMode: Xr.assistantSnapshot,
|
|
1880
1905
|
fallbackText: l
|
|
1881
1906
|
}, t[2] = l, t[3] = u);
|
|
1882
|
-
let { copy: d, feedback: f, isCopying: p } =
|
|
1907
|
+
let { copy: d, feedback: f, isCopying: p } = ai(u), m;
|
|
1883
1908
|
t[4] !== d || t[5] !== o ? (m = async () => {
|
|
1884
|
-
o || s(!0), await
|
|
1909
|
+
o || s(!0), await ni(), await d();
|
|
1885
1910
|
}, t[4] = d, t[5] = o, t[6] = m) : m = t[6];
|
|
1886
1911
|
let _ = m, v = "Copy snapshot";
|
|
1887
1912
|
p ? v = "Copying snapshot" : f?.kind === "success" && (v = f.mode === "image" ? "Copied snapshot" : "Copied text");
|
|
1888
1913
|
let y;
|
|
1889
|
-
t[7] !== r || t[8] !== o ? (y = o && /* @__PURE__ */ M(
|
|
1914
|
+
t[7] !== r || t[8] !== o ? (y = o && /* @__PURE__ */ M(ri, {
|
|
1890
1915
|
contentRef: a,
|
|
1891
1916
|
children: r()
|
|
1892
1917
|
}), t[7] = r, t[8] = o, t[9] = y) : y = t[9];
|
|
@@ -1900,9 +1925,9 @@ function ti(e) {
|
|
|
1900
1925
|
let S;
|
|
1901
1926
|
t[14] === _ ? S = t[15] : (S = () => void _(), t[14] = _, t[15] = S);
|
|
1902
1927
|
let C;
|
|
1903
|
-
t[16] === f?.kind ? C = t[17] : (C = f?.kind === "success" ? /* @__PURE__ */ M(
|
|
1928
|
+
t[16] === f?.kind ? C = t[17] : (C = f?.kind === "success" ? /* @__PURE__ */ M(Re, { className: "size-4" }) : /* @__PURE__ */ M(Ke, { className: "size-4" }), t[16] = f?.kind, t[17] = C);
|
|
1904
1929
|
let w;
|
|
1905
|
-
t[18] !== p || t[19] !== v || t[20] !== S || t[21] !== C ? (w = /* @__PURE__ */ M(
|
|
1930
|
+
t[18] !== p || t[19] !== v || t[20] !== S || t[21] !== C ? (w = /* @__PURE__ */ M(xt, {
|
|
1906
1931
|
type: "button",
|
|
1907
1932
|
size: "icon-sm",
|
|
1908
1933
|
variant: "ghost",
|
|
@@ -1922,59 +1947,68 @@ function ti(e) {
|
|
|
1922
1947
|
}
|
|
1923
1948
|
//#endregion
|
|
1924
1949
|
//#region src/lib/tools/helpers.ts
|
|
1925
|
-
function
|
|
1950
|
+
function ci(e) {
|
|
1926
1951
|
return w(e) && e.toolMetadata?.kind === "subagent";
|
|
1927
1952
|
}
|
|
1928
|
-
function
|
|
1953
|
+
function li(e) {
|
|
1929
1954
|
let t = e.toolMetadata?.displayName;
|
|
1930
1955
|
return typeof t == "string" ? t : "Subagent";
|
|
1931
1956
|
}
|
|
1932
|
-
function
|
|
1957
|
+
function ui(e, t) {
|
|
1933
1958
|
let n = y(e);
|
|
1934
1959
|
return {
|
|
1935
1960
|
toolKey: n,
|
|
1936
1961
|
toolEntry: t?.[n]
|
|
1937
1962
|
};
|
|
1938
1963
|
}
|
|
1939
|
-
function
|
|
1964
|
+
function di(e, t) {
|
|
1940
1965
|
return e?.static === !1 && !!e?.requiresUserInput && t === "input-available";
|
|
1941
1966
|
}
|
|
1942
1967
|
//#endregion
|
|
1943
1968
|
//#region src/lib/chat/markdown-paragraph.tsx
|
|
1944
|
-
var
|
|
1945
|
-
function
|
|
1969
|
+
var fi = /* @__PURE__ */ new Set(/* @__PURE__ */ "a.abbr.b.bdi.bdo.br.cite.code.data.del.dfn.em.i.ins.kbd.mark.q.s.samp.small.span.strong.sub.sup.time.u.var.wbr".split("."));
|
|
1970
|
+
function pi(e) {
|
|
1946
1971
|
if (!n.isValidElement(e)) return !1;
|
|
1947
1972
|
let t = typeof e.type == "string" ? e.type : e.props.node?.tagName;
|
|
1948
|
-
return t === void 0 || !
|
|
1973
|
+
return t === void 0 || !fi.has(t);
|
|
1949
1974
|
}
|
|
1950
|
-
function
|
|
1951
|
-
let t = O(
|
|
1952
|
-
if (!
|
|
1975
|
+
function mi(e) {
|
|
1976
|
+
let t = O(6), { children: r, dir: i } = e, a = n.Children.toArray(r);
|
|
1977
|
+
if (!a.some(pi)) {
|
|
1953
1978
|
let e;
|
|
1954
|
-
return t[0]
|
|
1979
|
+
return t[0] !== r || t[1] !== i ? (e = /* @__PURE__ */ M("p", {
|
|
1980
|
+
dir: i,
|
|
1981
|
+
children: r
|
|
1982
|
+
}), t[0] = r, t[1] = i, t[2] = e) : e = t[2], e;
|
|
1955
1983
|
}
|
|
1956
|
-
if (
|
|
1957
|
-
let
|
|
1958
|
-
return t[
|
|
1984
|
+
if (a.every(pi)) return r;
|
|
1985
|
+
let o;
|
|
1986
|
+
return t[3] !== r || t[4] !== i ? (o = /* @__PURE__ */ M("div", {
|
|
1987
|
+
dir: i,
|
|
1988
|
+
children: r
|
|
1989
|
+
}), t[3] = r, t[4] = i, t[5] = o) : o = t[5], o;
|
|
1959
1990
|
}
|
|
1960
1991
|
//#endregion
|
|
1961
1992
|
//#region src/lib/components/InteractiveResponse.tsx
|
|
1962
|
-
var
|
|
1963
|
-
|
|
1964
|
-
|
|
1993
|
+
var hi = { p: ({ children: e, dir: t }) => /* @__PURE__ */ M(mi, {
|
|
1994
|
+
dir: t,
|
|
1995
|
+
children: e
|
|
1996
|
+
}) };
|
|
1997
|
+
function gi(e) {
|
|
1998
|
+
let t = { ...hi }, n = {};
|
|
1965
1999
|
for (let r of e) ae(r), t[r.name] = r.component, n[r.name] = r.allowedAttributes;
|
|
1966
2000
|
return {
|
|
1967
2001
|
components: t,
|
|
1968
2002
|
allowedTags: n
|
|
1969
2003
|
};
|
|
1970
2004
|
}
|
|
1971
|
-
function
|
|
2005
|
+
function _i(e) {
|
|
1972
2006
|
let t = O(10), n, r;
|
|
1973
2007
|
t[0] === e ? (n = t[1], r = t[2]) : ({elements: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1974
2008
|
let i;
|
|
1975
2009
|
t[3] === n ? i = t[4] : (i = n ?? [], t[3] = n, t[4] = i);
|
|
1976
2010
|
let a;
|
|
1977
|
-
t[5] === i ? a = t[6] : (a =
|
|
2011
|
+
t[5] === i ? a = t[6] : (a = gi(i), t[5] = i, t[6] = a);
|
|
1978
2012
|
let o = a, s;
|
|
1979
2013
|
return t[7] !== r || t[8] !== o ? (s = /* @__PURE__ */ M(J, {
|
|
1980
2014
|
...o,
|
|
@@ -1983,7 +2017,7 @@ function di(e) {
|
|
|
1983
2017
|
}
|
|
1984
2018
|
//#endregion
|
|
1985
2019
|
//#region src/lib/renderers/render-part.tsx
|
|
1986
|
-
function
|
|
2020
|
+
function vi(e) {
|
|
1987
2021
|
let t = O(22), { part: n } = e, { addToolApprovalResponse: r } = H();
|
|
1988
2022
|
if (n.state !== "approval-requested") return null;
|
|
1989
2023
|
let i;
|
|
@@ -2036,21 +2070,21 @@ function fi(e) {
|
|
|
2036
2070
|
children: [l, f]
|
|
2037
2071
|
}), t[18] = o, t[19] = l, t[20] = f, t[21] = p) : p = t[21], p;
|
|
2038
2072
|
}
|
|
2039
|
-
function
|
|
2073
|
+
function yi(e) {
|
|
2040
2074
|
let t = O(25), { part: n } = e, { registry: r } = z();
|
|
2041
2075
|
if (n.input === void 0) {
|
|
2042
2076
|
let e;
|
|
2043
|
-
return t[0] !== n.errorText || t[1] !== n.output || t[2] !== n.state ? (e = n.state === "output-error" ? /* @__PURE__ */ M(
|
|
2077
|
+
return t[0] !== n.errorText || t[1] !== n.output || t[2] !== n.state ? (e = n.state === "output-error" ? /* @__PURE__ */ M(Gr, {
|
|
2044
2078
|
output: n.output,
|
|
2045
2079
|
errorText: n.errorText
|
|
2046
|
-
}) : /* @__PURE__ */ M(
|
|
2080
|
+
}) : /* @__PURE__ */ M(Xe, { className: "size-4 animate-spin" }), t[0] = n.errorText, t[1] = n.output, t[2] = n.state, t[3] = e) : e = t[3], e;
|
|
2047
2081
|
}
|
|
2048
2082
|
let i;
|
|
2049
|
-
t[4] === n ? i = t[5] : (i = /* @__PURE__ */ M(
|
|
2083
|
+
t[4] === n ? i = t[5] : (i = /* @__PURE__ */ M(vi, { part: n }), t[4] = n, t[5] = i);
|
|
2050
2084
|
let a = i;
|
|
2051
2085
|
if (!r) return a;
|
|
2052
2086
|
let o;
|
|
2053
|
-
t[6] !== n || t[7] !== r ? (o =
|
|
2087
|
+
t[6] !== n || t[7] !== r ? (o = ui(n, r), t[6] = n, t[7] = r, t[8] = o) : o = t[8];
|
|
2054
2088
|
let { toolEntry: s } = o;
|
|
2055
2089
|
if (s) {
|
|
2056
2090
|
let e = s.component, i;
|
|
@@ -2075,8 +2109,8 @@ function pi(e) {
|
|
|
2075
2109
|
}
|
|
2076
2110
|
//#endregion
|
|
2077
2111
|
//#region src/lib/chat/message-parts.tsx
|
|
2078
|
-
var
|
|
2079
|
-
function
|
|
2112
|
+
var bi = { animation: "slideUp" };
|
|
2113
|
+
function xi(e) {
|
|
2080
2114
|
let t = O(3), { filename: n, url: r } = e, i = n ?? "Attached image", a;
|
|
2081
2115
|
return t[0] !== i || t[1] !== r ? (a = /* @__PURE__ */ M("img", {
|
|
2082
2116
|
src: r,
|
|
@@ -2084,7 +2118,7 @@ function hi(e) {
|
|
|
2084
2118
|
className: "max-h-64 rounded-md border object-contain"
|
|
2085
2119
|
}), t[0] = i, t[1] = r, t[2] = a) : a = t[2], a;
|
|
2086
2120
|
}
|
|
2087
|
-
function
|
|
2121
|
+
function Si(e) {
|
|
2088
2122
|
let t = O(16), { filename: n, mediaType: r, url: i } = e, a = n || "Untitled", o;
|
|
2089
2123
|
t[0] !== r || t[1] !== a || t[2] !== i ? (o = i?.startsWith("data:") ? null : i && r.startsWith("video/") ? /* @__PURE__ */ M("video", {
|
|
2090
2124
|
controls: !0,
|
|
@@ -2130,24 +2164,24 @@ function gi(e) {
|
|
|
2130
2164
|
children: [s, d]
|
|
2131
2165
|
}), t[13] = s, t[14] = d, t[15] = f) : f = t[15], f;
|
|
2132
2166
|
}
|
|
2133
|
-
function
|
|
2167
|
+
function Ci(e) {
|
|
2134
2168
|
let t = O(4), { filename: n, mediaType: r, url: i } = e, a;
|
|
2135
|
-
return t[0] !== n || t[1] !== r || t[2] !== i ? (a = r.split("/")[0] === "image" ? /* @__PURE__ */ M(
|
|
2169
|
+
return t[0] !== n || t[1] !== r || t[2] !== i ? (a = r.split("/")[0] === "image" ? /* @__PURE__ */ M(xi, {
|
|
2136
2170
|
filename: n,
|
|
2137
2171
|
url: i
|
|
2138
|
-
}) : /* @__PURE__ */ M(
|
|
2172
|
+
}) : /* @__PURE__ */ M(Si, {
|
|
2139
2173
|
filename: n,
|
|
2140
2174
|
mediaType: r,
|
|
2141
2175
|
url: i
|
|
2142
2176
|
}), t[0] = n, t[1] = r, t[2] = i, t[3] = a) : a = t[3], a;
|
|
2143
2177
|
}
|
|
2144
|
-
function
|
|
2178
|
+
function wi(e) {
|
|
2145
2179
|
let t = O(9), { text: n, elements: r, className: i } = e, { status: a } = B(), o = Y(), s;
|
|
2146
2180
|
t[0] === i ? s = t[1] : (s = k("text-sm", i), t[0] = i, t[1] = s);
|
|
2147
2181
|
let c = !o && a === "streaming", l;
|
|
2148
|
-
t[2] !== r || t[3] !== c || t[4] !== n ? (l = /* @__PURE__ */ M(
|
|
2182
|
+
t[2] !== r || t[3] !== c || t[4] !== n ? (l = /* @__PURE__ */ M(_i, {
|
|
2149
2183
|
elements: r,
|
|
2150
|
-
animated:
|
|
2184
|
+
animated: bi,
|
|
2151
2185
|
isAnimating: c,
|
|
2152
2186
|
children: n
|
|
2153
2187
|
}), t[2] = r, t[3] = c, t[4] = n, t[5] = l) : l = t[5];
|
|
@@ -2157,35 +2191,35 @@ function vi(e) {
|
|
|
2157
2191
|
children: l
|
|
2158
2192
|
}), t[6] = s, t[7] = l, t[8] = u) : u = t[8], u;
|
|
2159
2193
|
}
|
|
2160
|
-
function
|
|
2161
|
-
let t = O(8), { part: n } = e, r =
|
|
2162
|
-
t[0] !== n || t[1] !== r ? (i = r && /* @__PURE__ */ M(
|
|
2194
|
+
function Ti(e) {
|
|
2195
|
+
let t = O(8), { part: n } = e, r = Ei(), i;
|
|
2196
|
+
t[0] !== n || t[1] !== r ? (i = r && /* @__PURE__ */ M(qr, { part: n }), t[0] = n, t[1] = r, t[2] = i) : i = t[2];
|
|
2163
2197
|
let a;
|
|
2164
|
-
t[3] === n ? a = t[4] : (a = /* @__PURE__ */ M(
|
|
2198
|
+
t[3] === n ? a = t[4] : (a = /* @__PURE__ */ M(yi, { part: n }), t[3] = n, t[4] = a);
|
|
2165
2199
|
let o;
|
|
2166
2200
|
return t[5] !== i || t[6] !== a ? (o = /* @__PURE__ */ N(j, { children: [i, a] }), t[5] = i, t[6] = a, t[7] = o) : o = t[7], o;
|
|
2167
2201
|
}
|
|
2168
|
-
function
|
|
2202
|
+
function Ei() {
|
|
2169
2203
|
let { debugMode: e } = z(), t = Y();
|
|
2170
2204
|
return !!e && !t;
|
|
2171
2205
|
}
|
|
2172
2206
|
//#endregion
|
|
2173
2207
|
//#region src/lib/chat/trajectory/tool-label.tsx
|
|
2174
|
-
function
|
|
2208
|
+
function Di(e) {
|
|
2175
2209
|
return !!e && e !== "output-available";
|
|
2176
2210
|
}
|
|
2177
|
-
function
|
|
2211
|
+
function Oi(e) {
|
|
2178
2212
|
let t = O(5), { label: n, part: r, state: i } = e, a = Y(), o;
|
|
2179
|
-
return t[0] !== a || t[1] !== n || t[2] !== r || t[3] !== i ? (o = !a && !!n.actions && !!r && !
|
|
2213
|
+
return t[0] !== a || t[1] !== n || t[2] !== r || t[3] !== i ? (o = !a && !!n.actions && !!r && !Di(i), t[0] = a, t[1] = n, t[2] = r, t[3] = i, t[4] = o) : o = t[4], o;
|
|
2180
2214
|
}
|
|
2181
|
-
function
|
|
2215
|
+
function ki(e) {
|
|
2182
2216
|
let t = O(18), { label: n, part: r } = e, i = n.icon, a = n.actions, o;
|
|
2183
2217
|
t[0] !== n || t[1] !== r ? (o = {
|
|
2184
2218
|
label: n,
|
|
2185
2219
|
part: r,
|
|
2186
2220
|
state: r.state
|
|
2187
2221
|
}, t[0] = n, t[1] = r, t[2] = o) : o = t[2];
|
|
2188
|
-
let s =
|
|
2222
|
+
let s = Oi(o), c;
|
|
2189
2223
|
t[3] !== i || t[4] !== n.isError ? (c = i && /* @__PURE__ */ M(i, { className: k("size-3.5", n.isError ? "text-destructive" : "text-muted-foreground") }), t[3] = i, t[4] = n.isError, t[5] = c) : c = t[5];
|
|
2190
2224
|
let l;
|
|
2191
2225
|
t[6] === n.name ? l = t[7] : (l = /* @__PURE__ */ M("span", {
|
|
@@ -2205,7 +2239,7 @@ function Ci(e) {
|
|
|
2205
2239
|
children: [u, d]
|
|
2206
2240
|
}), t[15] = u, t[16] = d, t[17] = f) : f = t[17], f;
|
|
2207
2241
|
}
|
|
2208
|
-
function
|
|
2242
|
+
function Ai(e) {
|
|
2209
2243
|
let t = O(3), { name: n, value: r } = e, i;
|
|
2210
2244
|
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ N("span", {
|
|
2211
2245
|
"data-slot": "tool-arg",
|
|
@@ -2217,15 +2251,15 @@ function wi(e) {
|
|
|
2217
2251
|
]
|
|
2218
2252
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2], i;
|
|
2219
2253
|
}
|
|
2220
|
-
function
|
|
2254
|
+
function ji(e) {
|
|
2221
2255
|
let t = O(23), { label: n, state: r, part: i, children: a } = e, o = n.actions, s;
|
|
2222
2256
|
t[0] !== n || t[1] !== i || t[2] !== r ? (s = {
|
|
2223
2257
|
label: n,
|
|
2224
2258
|
part: i,
|
|
2225
2259
|
state: r
|
|
2226
2260
|
}, t[0] = n, t[1] = i, t[2] = r, t[3] = s) : s = t[3];
|
|
2227
|
-
let c =
|
|
2228
|
-
t[4] === n.args ? l = t[5] : (l = n.args ? Object.entries(n.args).map(
|
|
2261
|
+
let c = Oi(s), l;
|
|
2262
|
+
t[4] === n.args ? l = t[5] : (l = n.args ? Object.entries(n.args).map(Mi) : "...", t[4] = n.args, t[5] = l);
|
|
2229
2263
|
let u;
|
|
2230
2264
|
t[6] !== a || t[7] !== n.name || t[8] !== l ? (u = /* @__PURE__ */ N("span", {
|
|
2231
2265
|
className: "text-muted-foreground min-w-0 truncate font-mono text-xs [&>[data-slot=tool-arg]+[data-slot=tool-arg]]:before:mr-1 [&>[data-slot=tool-arg]+[data-slot=tool-arg]]:before:content-[',']",
|
|
@@ -2258,25 +2292,25 @@ function Ti(e) {
|
|
|
2258
2292
|
children: [f, p]
|
|
2259
2293
|
}), t[20] = f, t[21] = p, t[22] = m) : m = t[22], m;
|
|
2260
2294
|
}
|
|
2261
|
-
function
|
|
2295
|
+
function Mi(e) {
|
|
2262
2296
|
let [t, n] = e;
|
|
2263
|
-
return /* @__PURE__ */ M(
|
|
2297
|
+
return /* @__PURE__ */ M(Ai, {
|
|
2264
2298
|
name: t,
|
|
2265
2299
|
value: n
|
|
2266
2300
|
}, t);
|
|
2267
2301
|
}
|
|
2268
2302
|
//#endregion
|
|
2269
2303
|
//#region src/lib/chat/trajectory/segments/index.tsx
|
|
2270
|
-
function
|
|
2304
|
+
function Ni(e) {
|
|
2271
2305
|
return e.type === "text" && e.providerMetadata?.openai?.phase === "commentary";
|
|
2272
2306
|
}
|
|
2273
|
-
function
|
|
2307
|
+
function Pi(e) {
|
|
2274
2308
|
let t = O(9), { segment: n, elements: r, className: i } = e, a;
|
|
2275
2309
|
if (t[0] !== i || t[1] !== r || t[2] !== n.parts) {
|
|
2276
2310
|
let e;
|
|
2277
2311
|
t[4] !== i || t[5] !== r ? (e = (e) => {
|
|
2278
2312
|
let { part: t, idx: n } = e;
|
|
2279
|
-
return t.type === "text" ? /* @__PURE__ */ M(
|
|
2313
|
+
return t.type === "text" ? /* @__PURE__ */ M(wi, {
|
|
2280
2314
|
text: t.text,
|
|
2281
2315
|
elements: r,
|
|
2282
2316
|
className: i
|
|
@@ -2286,27 +2320,27 @@ function Oi(e) {
|
|
|
2286
2320
|
let o;
|
|
2287
2321
|
return t[7] === a ? o = t[8] : (o = /* @__PURE__ */ M(j, { children: a }), t[7] = a, t[8] = o), o;
|
|
2288
2322
|
}
|
|
2289
|
-
function
|
|
2323
|
+
function Fi(e) {
|
|
2290
2324
|
let t = O(4), { segment: n } = e, { part: r } = n;
|
|
2291
2325
|
if (r.type !== "file") return null;
|
|
2292
2326
|
let i;
|
|
2293
|
-
return t[0] !== r.filename || t[1] !== r.mediaType || t[2] !== r.url ? (i = /* @__PURE__ */ M(
|
|
2327
|
+
return t[0] !== r.filename || t[1] !== r.mediaType || t[2] !== r.url ? (i = /* @__PURE__ */ M(Ci, {
|
|
2294
2328
|
filename: r.filename,
|
|
2295
2329
|
mediaType: r.mediaType,
|
|
2296
2330
|
url: r.url
|
|
2297
2331
|
}), t[0] = r.filename, t[1] = r.mediaType, t[2] = r.url, t[3] = i) : i = t[3], i;
|
|
2298
2332
|
}
|
|
2299
|
-
function
|
|
2333
|
+
function Ii(e) {
|
|
2300
2334
|
let t = O(9), { segment: n } = e, { messages: r } = H(), i;
|
|
2301
|
-
t[0] === r ? i = t[1] : (i =
|
|
2335
|
+
t[0] === r ? i = t[1] : (i = $t(r), t[0] = r, t[1] = i);
|
|
2302
2336
|
let a = i, o;
|
|
2303
2337
|
if (t[2] !== n.parts || t[3] !== a) {
|
|
2304
2338
|
let e;
|
|
2305
2339
|
t[5] === a ? e = t[6] : (e = (e) => {
|
|
2306
2340
|
let { part: t, idx: n } = e;
|
|
2307
2341
|
if (t.type !== "source-url") return null;
|
|
2308
|
-
let r =
|
|
2309
|
-
return r === null ? null : /* @__PURE__ */ M(
|
|
2342
|
+
let r = en(a, t.url);
|
|
2343
|
+
return r === null ? null : /* @__PURE__ */ M(Xn, {
|
|
2310
2344
|
source: {
|
|
2311
2345
|
url: t.url,
|
|
2312
2346
|
title: t.title
|
|
@@ -2318,7 +2352,7 @@ function Ai(e) {
|
|
|
2318
2352
|
let s;
|
|
2319
2353
|
return t[7] === o ? s = t[8] : (s = /* @__PURE__ */ M("span", { children: o }), t[7] = o, t[8] = s), s;
|
|
2320
2354
|
}
|
|
2321
|
-
function
|
|
2355
|
+
function Li(e) {
|
|
2322
2356
|
let t = O(3), { segment: n } = e, r = G();
|
|
2323
2357
|
if (Y()) return null;
|
|
2324
2358
|
let { part: i } = n;
|
|
@@ -2327,31 +2361,31 @@ function ji(e) {
|
|
|
2327
2361
|
return t[0] !== i.text || t[1] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
2328
2362
|
className: "text-muted-foreground text-xs",
|
|
2329
2363
|
children: /* @__PURE__ */ M(J, {
|
|
2330
|
-
animated:
|
|
2364
|
+
animated: bi,
|
|
2331
2365
|
isAnimating: a,
|
|
2332
2366
|
children: i.text
|
|
2333
2367
|
})
|
|
2334
2368
|
}), t[0] = i.text, t[1] = a, t[2] = o) : o = t[2], o;
|
|
2335
2369
|
}
|
|
2336
|
-
function
|
|
2370
|
+
function Ri(e) {
|
|
2337
2371
|
let t = O(2), { segment: n } = e;
|
|
2338
|
-
if (!
|
|
2372
|
+
if (!Ei()) return null;
|
|
2339
2373
|
let { part: r } = n;
|
|
2340
2374
|
if (r.type !== "dynamic-tool") return null;
|
|
2341
2375
|
let i;
|
|
2342
|
-
return t[0] === r ? i = t[1] : (i = /* @__PURE__ */ M(
|
|
2376
|
+
return t[0] === r ? i = t[1] : (i = /* @__PURE__ */ M(Jr, { part: r }), t[0] = r, t[1] = i), i;
|
|
2343
2377
|
}
|
|
2344
|
-
var
|
|
2345
|
-
function
|
|
2346
|
-
let e = l(
|
|
2378
|
+
var zi = o(null), Bi = o(null);
|
|
2379
|
+
function Vi() {
|
|
2380
|
+
let e = l(zi);
|
|
2347
2381
|
if (!e) throw Error("Segment.Tool* parts must be rendered within Segment.Tool");
|
|
2348
2382
|
return e;
|
|
2349
2383
|
}
|
|
2350
|
-
function
|
|
2384
|
+
function Hi(e) {
|
|
2351
2385
|
let t = O(29), { segment: n, children: r } = e, i = z(), a = G(), { part: o } = n;
|
|
2352
2386
|
if (!S(o)) return null;
|
|
2353
2387
|
let s, c, l, u;
|
|
2354
|
-
t[0] !== i.registry || t[1] !== a || t[2] !== o ? ({toolEntry: u} =
|
|
2388
|
+
t[0] !== i.registry || t[1] !== a || t[2] !== o ? ({toolEntry: u} = ui(o, i.registry), c = di(u, o.state), s = !c && rn(o, a), l = u?.label?.(o), t[0] = i.registry, t[1] = a, t[2] = o, t[3] = s, t[4] = c, t[5] = l, t[6] = u) : (s = t[3], c = t[4], l = t[5], u = t[6]);
|
|
2355
2389
|
let d = l, f;
|
|
2356
2390
|
t[7] !== s || t[8] !== d || t[9] !== o ? (f = s ? {
|
|
2357
2391
|
...d ?? { name: y(o) },
|
|
@@ -2373,37 +2407,37 @@ function Ii(e) {
|
|
|
2373
2407
|
aborted: s
|
|
2374
2408
|
}, t[17] = s, t[18] = p, t[19] = o.state, t[20] = g) : g = t[20];
|
|
2375
2409
|
let _;
|
|
2376
|
-
t[21] === r ? _ = t[22] : (_ = r ?? /* @__PURE__ */ M(
|
|
2410
|
+
t[21] === r ? _ = t[22] : (_ = r ?? /* @__PURE__ */ M(Wi, {}), t[21] = r, t[22] = _);
|
|
2377
2411
|
let v;
|
|
2378
|
-
t[23] !== g || t[24] !== _ ? (v = /* @__PURE__ */ M(
|
|
2412
|
+
t[23] !== g || t[24] !== _ ? (v = /* @__PURE__ */ M(Bi, {
|
|
2379
2413
|
value: g,
|
|
2380
2414
|
children: _
|
|
2381
2415
|
}), t[23] = g, t[24] = _, t[25] = v) : v = t[25];
|
|
2382
2416
|
let b;
|
|
2383
|
-
return t[26] !== h || t[27] !== v ? (b = /* @__PURE__ */ M(
|
|
2417
|
+
return t[26] !== h || t[27] !== v ? (b = /* @__PURE__ */ M(zi, {
|
|
2384
2418
|
value: h,
|
|
2385
2419
|
children: v
|
|
2386
2420
|
}), t[26] = h, t[27] = v, t[28] = b) : b = t[28], b;
|
|
2387
2421
|
}
|
|
2388
|
-
function
|
|
2389
|
-
let e = O(2), { part: t, activeClientInput: n } =
|
|
2422
|
+
function Ui() {
|
|
2423
|
+
let e = O(2), { part: t, activeClientInput: n } = Vi();
|
|
2390
2424
|
if (n) return null;
|
|
2391
2425
|
let r;
|
|
2392
|
-
return e[0] === t ? r = e[1] : (r = /* @__PURE__ */ M(
|
|
2426
|
+
return e[0] === t ? r = e[1] : (r = /* @__PURE__ */ M(Ti, { part: t }), e[0] = t, e[1] = r), r;
|
|
2393
2427
|
}
|
|
2394
|
-
function
|
|
2395
|
-
let t = O(9), { children: n } = e, { part: r, label: i, defaultOpen: a } =
|
|
2428
|
+
function Wi(e) {
|
|
2429
|
+
let t = O(9), { children: n } = e, { part: r, label: i, defaultOpen: a } = Vi();
|
|
2396
2430
|
if (!i) {
|
|
2397
2431
|
let e;
|
|
2398
2432
|
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M("div", {
|
|
2399
2433
|
className: "min-w-0 flex-1",
|
|
2400
|
-
children: /* @__PURE__ */ M(
|
|
2434
|
+
children: /* @__PURE__ */ M(Ui, {})
|
|
2401
2435
|
}), t[0] = e) : e = t[0], e;
|
|
2402
2436
|
}
|
|
2403
2437
|
let o;
|
|
2404
2438
|
t[1] !== n || t[2] !== i || t[3] !== r ? (o = /* @__PURE__ */ M(L, {
|
|
2405
2439
|
className: "cursor-pointer",
|
|
2406
|
-
children: /* @__PURE__ */ M(
|
|
2440
|
+
children: /* @__PURE__ */ M(ji, {
|
|
2407
2441
|
label: i,
|
|
2408
2442
|
state: r.state,
|
|
2409
2443
|
part: r,
|
|
@@ -2413,7 +2447,7 @@ function Ri(e) {
|
|
|
2413
2447
|
let s;
|
|
2414
2448
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(I, {
|
|
2415
2449
|
className: "mb-2",
|
|
2416
|
-
children: /* @__PURE__ */ M(
|
|
2450
|
+
children: /* @__PURE__ */ M(Ui, {})
|
|
2417
2451
|
}), t[5] = s) : s = t[5];
|
|
2418
2452
|
let c;
|
|
2419
2453
|
return t[6] !== a || t[7] !== o ? (c = /* @__PURE__ */ N(F, {
|
|
@@ -2423,31 +2457,31 @@ function Ri(e) {
|
|
|
2423
2457
|
}), t[6] = a, t[7] = o, t[8] = c) : c = t[8], c;
|
|
2424
2458
|
}
|
|
2425
2459
|
var X = {
|
|
2426
|
-
Text:
|
|
2427
|
-
File:
|
|
2428
|
-
Source:
|
|
2429
|
-
Reasoning:
|
|
2430
|
-
DynamicTool:
|
|
2431
|
-
Tool:
|
|
2432
|
-
ToolDisclosure:
|
|
2433
|
-
ToolContent:
|
|
2460
|
+
Text: Pi,
|
|
2461
|
+
File: Fi,
|
|
2462
|
+
Source: Ii,
|
|
2463
|
+
Reasoning: Li,
|
|
2464
|
+
DynamicTool: Ri,
|
|
2465
|
+
Tool: Hi,
|
|
2466
|
+
ToolDisclosure: Wi,
|
|
2467
|
+
ToolContent: Ui
|
|
2434
2468
|
};
|
|
2435
2469
|
//#endregion
|
|
2436
2470
|
//#region src/lib/chat/trajectory/trajectory-segments.ts
|
|
2437
|
-
function
|
|
2471
|
+
function Gi(e) {
|
|
2438
2472
|
return S(e) ? "tool" : e.type === "dynamic-tool" ? "dynamic-tool" : e.type === "reasoning" && "text" in e && e.text ? "reasoning" : null;
|
|
2439
2473
|
}
|
|
2440
|
-
function
|
|
2474
|
+
function Ki(e, t) {
|
|
2441
2475
|
return e.kind === "text" || e.kind === "file" || e.kind === "source" ? !1 : e.kind === "reasoning" || e.kind !== "dynamic-tool" || !!t;
|
|
2442
2476
|
}
|
|
2443
|
-
function
|
|
2477
|
+
function qi(e, t, n) {
|
|
2444
2478
|
let r = e[t + 1];
|
|
2445
|
-
return !!r &&
|
|
2479
|
+
return !!r && Ki(r, n);
|
|
2446
2480
|
}
|
|
2447
|
-
function
|
|
2481
|
+
function Ji(e) {
|
|
2448
2482
|
let t = [];
|
|
2449
2483
|
for (let n = 0; n < e.length; n++) {
|
|
2450
|
-
let r = e[n], i =
|
|
2484
|
+
let r = e[n], i = Gi(r);
|
|
2451
2485
|
if (i) t.push({
|
|
2452
2486
|
kind: i,
|
|
2453
2487
|
part: r,
|
|
@@ -2491,7 +2525,7 @@ function Z(e, t) {
|
|
|
2491
2525
|
}
|
|
2492
2526
|
//#endregion
|
|
2493
2527
|
//#region src/lib/chat/trajectory/nested-trajectory.tsx
|
|
2494
|
-
function
|
|
2528
|
+
function Yi(e, t) {
|
|
2495
2529
|
let n = `${Z(e, t)}:${e.kind}`;
|
|
2496
2530
|
if (e.kind === "text") return `${n}:${e.parts.map(({ part: e }) => e.type === "text" ? e.text : "").join("")}`;
|
|
2497
2531
|
if (e.kind === "reasoning" && e.part.type === "reasoning") return `${n}:${e.part.text}`;
|
|
@@ -2501,10 +2535,10 @@ function Ui(e, t) {
|
|
|
2501
2535
|
}
|
|
2502
2536
|
return e.kind === "file" && e.part.type === "file" ? `${n}:${e.part.url}:${e.part.mediaType}:${e.part.filename ?? ""}` : n;
|
|
2503
2537
|
}
|
|
2504
|
-
function
|
|
2538
|
+
function Xi(e, t, n) {
|
|
2505
2539
|
return e.kind === "file" || e.kind === "source" ? !0 : e.kind === "tool" || e.kind === "dynamic-tool" ? w(e.part) ? e.part.state === "output-error" || e.part.state === "output-available" && e.part.preliminary !== !0 : !1 : t < n - 1;
|
|
2506
2540
|
}
|
|
2507
|
-
var
|
|
2541
|
+
var Zi = c(function(e) {
|
|
2508
2542
|
let t = O(8), { segment: n } = e;
|
|
2509
2543
|
if (n.kind === "tool") {
|
|
2510
2544
|
let e;
|
|
@@ -2526,13 +2560,13 @@ var Gi = c(function(e) {
|
|
|
2526
2560
|
return t[6] === n ? e = t[7] : (e = /* @__PURE__ */ M(X.File, { segment: n }), t[6] = n, t[7] = e), e;
|
|
2527
2561
|
}
|
|
2528
2562
|
return null;
|
|
2529
|
-
},
|
|
2530
|
-
function
|
|
2563
|
+
}, Qi);
|
|
2564
|
+
function Qi(e, t) {
|
|
2531
2565
|
return e.complete && t.complete && e.cacheKey === t.cacheKey;
|
|
2532
2566
|
}
|
|
2533
|
-
function
|
|
2567
|
+
function $i(e) {
|
|
2534
2568
|
let t = O(11), { parts: n, className: r } = e, i;
|
|
2535
|
-
t[0] === n ? i = t[1] : (i =
|
|
2569
|
+
t[0] === n ? i = t[1] : (i = Ji(n), t[0] = n, t[1] = i);
|
|
2536
2570
|
let a = i;
|
|
2537
2571
|
if (a.length === 0) return null;
|
|
2538
2572
|
let o;
|
|
@@ -2542,10 +2576,10 @@ function qi(e) {
|
|
|
2542
2576
|
let e;
|
|
2543
2577
|
t[6] === a.length ? e = t[7] : (e = (e, t) => {
|
|
2544
2578
|
let n = `${Z(e, t)}-${e.kind}`;
|
|
2545
|
-
return /* @__PURE__ */ M(
|
|
2579
|
+
return /* @__PURE__ */ M(Zi, {
|
|
2546
2580
|
segment: e,
|
|
2547
|
-
cacheKey:
|
|
2548
|
-
complete:
|
|
2581
|
+
cacheKey: Yi(e, t),
|
|
2582
|
+
complete: Xi(e, t, a.length)
|
|
2549
2583
|
}, n);
|
|
2550
2584
|
}, t[6] = a.length, t[7] = e), s = a.map(e), t[4] = a, t[5] = s;
|
|
2551
2585
|
} else s = t[5];
|
|
@@ -2577,13 +2611,13 @@ function Q(e) {
|
|
|
2577
2611
|
}
|
|
2578
2612
|
//#endregion
|
|
2579
2613
|
//#region src/lib/chat/trajectory/trajectories/message-actions.tsx
|
|
2580
|
-
function
|
|
2614
|
+
function ea() {
|
|
2581
2615
|
let { index: e } = K(), { messages: t } = W(), n = G();
|
|
2582
2616
|
return !(e === t.length - 1 && (n === "submitted" || n === "streaming" || n === "error"));
|
|
2583
2617
|
}
|
|
2584
|
-
function
|
|
2618
|
+
function ta(e) {
|
|
2585
2619
|
let t = O(5), { className: n, children: r } = e;
|
|
2586
|
-
if (!
|
|
2620
|
+
if (!ea() || i.toArray(r).length === 0) return null;
|
|
2587
2621
|
let a;
|
|
2588
2622
|
t[0] === n ? a = t[1] : (a = k("mt-1 flex items-center gap-0.5", n), t[0] = n, t[1] = a);
|
|
2589
2623
|
let o;
|
|
@@ -2593,13 +2627,13 @@ function Yi(e) {
|
|
|
2593
2627
|
children: r
|
|
2594
2628
|
}), t[2] = r, t[3] = a, t[4] = o) : o = t[4], o;
|
|
2595
2629
|
}
|
|
2596
|
-
function
|
|
2597
|
-
let t = O(12), { className: n } = e, { message: r } = K(), [i, a] =
|
|
2630
|
+
function na(e) {
|
|
2631
|
+
let t = O(12), { className: n } = e, { message: r } = K(), [i, a] = Fr(), o = i ? "Copied" : "Copy message", s;
|
|
2598
2632
|
t[0] === n ? s = t[1] : (s = k("p-1.5", n), t[0] = n, t[1] = s);
|
|
2599
2633
|
let c;
|
|
2600
|
-
t[2] !== a || t[3] !== r ? (c = () => void a(
|
|
2634
|
+
t[2] !== a || t[3] !== r ? (c = () => void a(oi(r)), t[2] = a, t[3] = r, t[4] = c) : c = t[4];
|
|
2601
2635
|
let l;
|
|
2602
|
-
t[5] === i ? l = t[6] : (l = M(i ?
|
|
2636
|
+
t[5] === i ? l = t[6] : (l = M(i ? Re : Ke, { className: "size-3.5" }), t[5] = i, t[6] = l);
|
|
2603
2637
|
let u;
|
|
2604
2638
|
return t[7] !== o || t[8] !== s || t[9] !== c || t[10] !== l ? (u = /* @__PURE__ */ M(Q, {
|
|
2605
2639
|
"aria-label": o,
|
|
@@ -2608,13 +2642,13 @@ function Xi(e) {
|
|
|
2608
2642
|
icon: l
|
|
2609
2643
|
}), t[7] = o, t[8] = s, t[9] = c, t[10] = l, t[11] = u) : u = t[11], u;
|
|
2610
2644
|
}
|
|
2611
|
-
function
|
|
2645
|
+
function ra(e) {
|
|
2612
2646
|
let t = O(9), { className: n } = e, { message: r } = K(), { regenerate: i } = H(), a;
|
|
2613
2647
|
t[0] === n ? a = t[1] : (a = k("p-1.5", n), t[0] = n, t[1] = a);
|
|
2614
2648
|
let o;
|
|
2615
2649
|
t[2] !== r.id || t[3] !== i ? (o = () => void i({ messageId: r.id }), t[2] = r.id, t[3] = i, t[4] = o) : o = t[4];
|
|
2616
2650
|
let s;
|
|
2617
|
-
t[5] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(
|
|
2651
|
+
t[5] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(tt, { className: "size-3.5" }), t[5] = s) : s = t[5];
|
|
2618
2652
|
let c;
|
|
2619
2653
|
return t[6] !== a || t[7] !== o ? (c = /* @__PURE__ */ M(Q, {
|
|
2620
2654
|
"aria-label": "Regenerate response",
|
|
@@ -2623,13 +2657,13 @@ function Zi(e) {
|
|
|
2623
2657
|
icon: s
|
|
2624
2658
|
}), t[6] = a, t[7] = o, t[8] = c) : c = t[8], c;
|
|
2625
2659
|
}
|
|
2626
|
-
function
|
|
2627
|
-
let t = O(12), { className: n } = e, { message: r } = K(), [i, a] =
|
|
2660
|
+
function ia(e) {
|
|
2661
|
+
let t = O(12), { className: n } = e, { message: r } = K(), [i, a] = Fr(), o = i ? "Copied" : "Copy debug JSON", s;
|
|
2628
2662
|
t[0] === n ? s = t[1] : (s = k("p-1.5", n), t[0] = n, t[1] = s);
|
|
2629
2663
|
let c;
|
|
2630
2664
|
t[2] !== a || t[3] !== r ? (c = () => void a(JSON.stringify(r, null, 2)), t[2] = a, t[3] = r, t[4] = c) : c = t[4];
|
|
2631
2665
|
let l;
|
|
2632
|
-
t[5] === i ? l = t[6] : (l = M(i ?
|
|
2666
|
+
t[5] === i ? l = t[6] : (l = M(i ? Re : Le, { className: "size-3.5" }), t[5] = i, t[6] = l);
|
|
2633
2667
|
let u;
|
|
2634
2668
|
return t[7] !== o || t[8] !== s || t[9] !== c || t[10] !== l ? (u = /* @__PURE__ */ M(Q, {
|
|
2635
2669
|
"aria-label": o,
|
|
@@ -2640,7 +2674,7 @@ function Qi(e) {
|
|
|
2640
2674
|
}
|
|
2641
2675
|
//#endregion
|
|
2642
2676
|
//#region src/lib/chat/trajectory/trajectories/messages-error.tsx
|
|
2643
|
-
function
|
|
2677
|
+
function aa(e) {
|
|
2644
2678
|
let t = O(7), { onTryAgain: n, error: r } = e, i = r instanceof Error ? r.message : "An error occurred. Please try again.", a;
|
|
2645
2679
|
t[0] === i ? a = t[1] : (a = /* @__PURE__ */ M("div", {
|
|
2646
2680
|
className: "text-destructive text-sm",
|
|
@@ -2666,18 +2700,18 @@ function $i(e) {
|
|
|
2666
2700
|
})
|
|
2667
2701
|
}), t[4] = a, t[5] = o, t[6] = s) : s = t[6], s;
|
|
2668
2702
|
}
|
|
2669
|
-
function
|
|
2703
|
+
function oa(e) {
|
|
2670
2704
|
let t = O(3), { error: n, onRetry: r } = e;
|
|
2671
2705
|
if (!n || !r) return null;
|
|
2672
2706
|
let i;
|
|
2673
|
-
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(
|
|
2707
|
+
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(aa, {
|
|
2674
2708
|
onTryAgain: r,
|
|
2675
2709
|
error: n
|
|
2676
2710
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2], i;
|
|
2677
2711
|
}
|
|
2678
2712
|
//#endregion
|
|
2679
2713
|
//#region src/lib/chat/trajectory/trajectories/messages-shell.tsx
|
|
2680
|
-
function
|
|
2714
|
+
function sa(e) {
|
|
2681
2715
|
let t = O(14), { messages: n, className: r, elements: i, status: a, children: o } = e, s;
|
|
2682
2716
|
t[0] !== i || t[1] !== n || t[2] !== a ? (s = {
|
|
2683
2717
|
messages: n,
|
|
@@ -2697,12 +2731,12 @@ function ta(e) {
|
|
|
2697
2731
|
children: u
|
|
2698
2732
|
}), t[8] = l, t[9] = u, t[10] = d) : d = t[10];
|
|
2699
2733
|
let f;
|
|
2700
|
-
return t[11] !== d || t[12] !== c ? (f = /* @__PURE__ */ M(
|
|
2734
|
+
return t[11] !== d || t[12] !== c ? (f = /* @__PURE__ */ M(Jn, {
|
|
2701
2735
|
value: c,
|
|
2702
2736
|
children: d
|
|
2703
2737
|
}), t[11] = d, t[12] = c, t[13] = f) : f = t[13], f;
|
|
2704
2738
|
}
|
|
2705
|
-
function
|
|
2739
|
+
function ca(e) {
|
|
2706
2740
|
let t = O(5), { className: n, children: r } = e, i;
|
|
2707
2741
|
t[0] === n ? i = t[1] : (i = k("flex flex-col gap-4", n), t[0] = n, t[1] = i);
|
|
2708
2742
|
let a;
|
|
@@ -2711,7 +2745,7 @@ function na(e) {
|
|
|
2711
2745
|
children: r
|
|
2712
2746
|
}), t[2] = r, t[3] = i, t[4] = a) : a = t[4], a;
|
|
2713
2747
|
}
|
|
2714
|
-
function
|
|
2748
|
+
function la(e) {
|
|
2715
2749
|
let t = O(9), { message: n, index: r, className: i, children: a } = e, o;
|
|
2716
2750
|
t[0] !== r || t[1] !== n ? (o = {
|
|
2717
2751
|
message: n,
|
|
@@ -2723,14 +2757,14 @@ function ra(e) {
|
|
|
2723
2757
|
children: a
|
|
2724
2758
|
}), t[3] = a, t[4] = i, t[5] = c) : c = t[5];
|
|
2725
2759
|
let l;
|
|
2726
|
-
return t[6] !== c || t[7] !== s ? (l = /* @__PURE__ */ M(
|
|
2760
|
+
return t[6] !== c || t[7] !== s ? (l = /* @__PURE__ */ M(Yn, {
|
|
2727
2761
|
value: s,
|
|
2728
2762
|
children: c
|
|
2729
2763
|
}), t[6] = c, t[7] = s, t[8] = l) : l = t[8], l;
|
|
2730
2764
|
}
|
|
2731
2765
|
//#endregion
|
|
2732
2766
|
//#region src/lib/components/PendingToolInput.tsx
|
|
2733
|
-
function
|
|
2767
|
+
function ua() {
|
|
2734
2768
|
let e = O(5), { registry: t } = z(), n = H().messages, r;
|
|
2735
2769
|
if (e[0] !== n || e[1] !== t) {
|
|
2736
2770
|
bb0: {
|
|
@@ -2738,7 +2772,7 @@ function ia() {
|
|
|
2738
2772
|
r = null;
|
|
2739
2773
|
break bb0;
|
|
2740
2774
|
}
|
|
2741
|
-
let i = n.findLast(
|
|
2775
|
+
let i = n.findLast(da);
|
|
2742
2776
|
if (!i) {
|
|
2743
2777
|
r = null;
|
|
2744
2778
|
break bb0;
|
|
@@ -2757,12 +2791,12 @@ function ia() {
|
|
|
2757
2791
|
} else r = e[2];
|
|
2758
2792
|
return r;
|
|
2759
2793
|
}
|
|
2760
|
-
function
|
|
2794
|
+
function da(e) {
|
|
2761
2795
|
let { role: t } = e;
|
|
2762
2796
|
return t === "assistant";
|
|
2763
2797
|
}
|
|
2764
|
-
function
|
|
2765
|
-
let t = O(10), { children: n, className: i } = e, a =
|
|
2798
|
+
function fa(e) {
|
|
2799
|
+
let t = O(10), { children: n, className: i } = e, a = ua(), o = a?.entry.component, s = a ? "hidden" : "visible", c;
|
|
2766
2800
|
t[0] !== n || t[1] !== s ? (c = /* @__PURE__ */ M(r, {
|
|
2767
2801
|
mode: s,
|
|
2768
2802
|
children: n
|
|
@@ -2777,12 +2811,12 @@ function oa(e) {
|
|
|
2777
2811
|
}
|
|
2778
2812
|
//#endregion
|
|
2779
2813
|
//#region src/lib/chat/trajectory/trajectories/thinking-hint.ts
|
|
2780
|
-
function
|
|
2814
|
+
function pa(e, t) {
|
|
2781
2815
|
if (e === "error" || e === "ready" || !t) return null;
|
|
2782
2816
|
if (t.role !== "assistant") return "Thinking...";
|
|
2783
2817
|
for (let e = t.parts.length - 1; e >= 0; e--) {
|
|
2784
2818
|
let n = t.parts[e];
|
|
2785
|
-
if (C(n) &&
|
|
2819
|
+
if (C(n) && Ni(n) && n.text) return n.text;
|
|
2786
2820
|
}
|
|
2787
2821
|
for (let e = t.parts.length - 1; e >= 0; e--) {
|
|
2788
2822
|
let n = t.parts[e];
|
|
@@ -2806,7 +2840,7 @@ function sa(e, t) {
|
|
|
2806
2840
|
}
|
|
2807
2841
|
//#endregion
|
|
2808
2842
|
//#region src/lib/chat/trajectory/trajectories/timeline-dot.tsx
|
|
2809
|
-
function
|
|
2843
|
+
function ma(e) {
|
|
2810
2844
|
let t = O(5), { isLast: n } = e, r = n !== void 0 && n, i;
|
|
2811
2845
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ M("span", { className: "bg-muted-foreground/50 z-10 mt-1 size-2 shrink-0 rounded-full" }), t[0] = i) : i = t[0];
|
|
2812
2846
|
let a;
|
|
@@ -2819,7 +2853,7 @@ function ca(e) {
|
|
|
2819
2853
|
}
|
|
2820
2854
|
//#endregion
|
|
2821
2855
|
//#region src/lib/chat/trajectory/trajectories/timeline-item.tsx
|
|
2822
|
-
function
|
|
2856
|
+
function ha(e) {
|
|
2823
2857
|
let t = O(6), { marker: n, children: r, className: i } = e, a;
|
|
2824
2858
|
t[0] === i ? a = t[1] : (a = k("relative z-0 flex gap-3 pl-5", i), t[0] = i, t[1] = a);
|
|
2825
2859
|
let o;
|
|
@@ -2830,15 +2864,15 @@ function la(e) {
|
|
|
2830
2864
|
}
|
|
2831
2865
|
//#endregion
|
|
2832
2866
|
//#region src/lib/chat/trajectory/trajectories/trajectory-thinking.tsx
|
|
2833
|
-
function
|
|
2834
|
-
let e = O(6), t = G(), { messages: n } = W(), r =
|
|
2835
|
-
e[0] !== t || e[1] !== i ? (a =
|
|
2867
|
+
function ga() {
|
|
2868
|
+
let e = O(6), t = G(), { messages: n } = W(), r = ua(), i = n[n.length - 1], a;
|
|
2869
|
+
e[0] !== t || e[1] !== i ? (a = pa(t, i), e[0] = t, e[1] = i, e[2] = a) : a = e[2];
|
|
2836
2870
|
let o = a;
|
|
2837
2871
|
if (!o || r) return null;
|
|
2838
2872
|
let s;
|
|
2839
|
-
e[3] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(
|
|
2873
|
+
e[3] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(ma, { isLast: !0 }), e[3] = s) : s = e[3];
|
|
2840
2874
|
let c;
|
|
2841
|
-
return e[4] === o ? c = e[5] : (c = /* @__PURE__ */ M(
|
|
2875
|
+
return e[4] === o ? c = e[5] : (c = /* @__PURE__ */ M(ha, {
|
|
2842
2876
|
className: "mt-2",
|
|
2843
2877
|
marker: s,
|
|
2844
2878
|
children: /* @__PURE__ */ M("span", {
|
|
@@ -2859,7 +2893,7 @@ var $ = [
|
|
|
2859
2893
|
"reasoningTokens",
|
|
2860
2894
|
"cachedInputTokens",
|
|
2861
2895
|
"totalTokens"
|
|
2862
|
-
],
|
|
2896
|
+
], _a = {
|
|
2863
2897
|
inputTokens: [["inputTokens"], ["raw", "prompt_tokens"]],
|
|
2864
2898
|
outputTokens: [["outputTokens"], ["raw", "completion_tokens"]],
|
|
2865
2899
|
reasoningTokens: [
|
|
@@ -2883,7 +2917,7 @@ var $ = [
|
|
|
2883
2917
|
],
|
|
2884
2918
|
totalTokens: [["totalTokens"], ["raw", "total_tokens"]]
|
|
2885
2919
|
};
|
|
2886
|
-
function
|
|
2920
|
+
function va(e) {
|
|
2887
2921
|
if (typeof e == "number" && Number.isFinite(e) && e >= 0) return e;
|
|
2888
2922
|
if (typeof e == "string" && e.trim().length > 0) {
|
|
2889
2923
|
let t = Number(e);
|
|
@@ -2891,7 +2925,7 @@ function fa(e) {
|
|
|
2891
2925
|
}
|
|
2892
2926
|
return null;
|
|
2893
2927
|
}
|
|
2894
|
-
function
|
|
2928
|
+
function ya(e) {
|
|
2895
2929
|
if (!e || typeof e != "object") return null;
|
|
2896
2930
|
let t = {
|
|
2897
2931
|
inputTokens: null,
|
|
@@ -2900,8 +2934,8 @@ function pa(e) {
|
|
|
2900
2934
|
cachedInputTokens: null,
|
|
2901
2935
|
totalTokens: null
|
|
2902
2936
|
};
|
|
2903
|
-
for (let n of $) for (let r of
|
|
2904
|
-
let i =
|
|
2937
|
+
for (let n of $) for (let r of _a[n]) {
|
|
2938
|
+
let i = va(Dt(e, r));
|
|
2905
2939
|
if (i !== null) {
|
|
2906
2940
|
t[n] = i;
|
|
2907
2941
|
break;
|
|
@@ -2909,10 +2943,10 @@ function pa(e) {
|
|
|
2909
2943
|
}
|
|
2910
2944
|
return $.some((e) => t[e] !== null) ? t : null;
|
|
2911
2945
|
}
|
|
2912
|
-
function
|
|
2913
|
-
return D(e) ?
|
|
2946
|
+
function ba(e) {
|
|
2947
|
+
return D(e) ? ya(e.totalUsage ?? e.usage) : null;
|
|
2914
2948
|
}
|
|
2915
|
-
function
|
|
2949
|
+
function xa(e, t) {
|
|
2916
2950
|
let n = {
|
|
2917
2951
|
inputTokens: null,
|
|
2918
2952
|
outputTokens: null,
|
|
@@ -2934,7 +2968,7 @@ function ha(e, t) {
|
|
|
2934
2968
|
}
|
|
2935
2969
|
return $.some((e) => n[e] !== null) ? n : null;
|
|
2936
2970
|
}
|
|
2937
|
-
function
|
|
2971
|
+
function Sa(e) {
|
|
2938
2972
|
if (e.length === 0) return null;
|
|
2939
2973
|
let t = {
|
|
2940
2974
|
inputTokens: null,
|
|
@@ -2953,32 +2987,32 @@ function ga(e) {
|
|
|
2953
2987
|
}
|
|
2954
2988
|
return $.some((e) => t[e] !== null) ? t : null;
|
|
2955
2989
|
}
|
|
2956
|
-
function
|
|
2990
|
+
function Ca(e) {
|
|
2957
2991
|
let t = {}, n = [], r = null, i = null;
|
|
2958
2992
|
for (let a of e) {
|
|
2959
2993
|
if (a.role !== "assistant") continue;
|
|
2960
|
-
let e = D(a.metadata) ? a.metadata : void 0, o =
|
|
2994
|
+
let e = D(a.metadata) ? a.metadata : void 0, o = ya(e?.usage), s = ya(e?.totalUsage), c = o ?? (s ? xa(s, r) : null);
|
|
2961
2995
|
c && (t[a.id] = c, n.push(c)), s && (i = s, r = s);
|
|
2962
2996
|
}
|
|
2963
2997
|
return {
|
|
2964
2998
|
assistantUsageByMessageId: t,
|
|
2965
|
-
chatUsageSummary: i ??
|
|
2999
|
+
chatUsageSummary: i ?? Sa(n)
|
|
2966
3000
|
};
|
|
2967
3001
|
}
|
|
2968
|
-
function
|
|
3002
|
+
function wa() {
|
|
2969
3003
|
let e = O(2), t = H(), n;
|
|
2970
|
-
return e[0] === t.messages ? n = e[1] : (n =
|
|
3004
|
+
return e[0] === t.messages ? n = e[1] : (n = Ca(t.messages), e[0] = t.messages, e[1] = n), n;
|
|
2971
3005
|
}
|
|
2972
|
-
function
|
|
2973
|
-
return
|
|
3006
|
+
function Ta(e) {
|
|
3007
|
+
return kt(e);
|
|
2974
3008
|
}
|
|
2975
|
-
function
|
|
2976
|
-
let t = [`↑ ${
|
|
2977
|
-
return e.totalTokens !== null && t.push(`· ${
|
|
3009
|
+
function Ea(e) {
|
|
3010
|
+
let t = [`↑ ${Ot(e.inputTokens)}`, `↓ ${Ot(e.outputTokens)}`];
|
|
3011
|
+
return e.totalTokens !== null && t.push(`· ${kt(e.totalTokens)} tokens`), e.cachedInputTokens !== null && e.cachedInputTokens > 0 && t.push(`(${Ot(e.cachedInputTokens)} cached)`), t.join(" ");
|
|
2978
3012
|
}
|
|
2979
3013
|
//#endregion
|
|
2980
3014
|
//#region src/lib/chat/zukhruf-chat-transport.ts
|
|
2981
|
-
var
|
|
3015
|
+
var Da = "x-upload-filename", Oa = P.strictObject({
|
|
2982
3016
|
path: P.string().startsWith("/"),
|
|
2983
3017
|
name: P.string().min(1),
|
|
2984
3018
|
mediaType: P.enum([
|
|
@@ -2996,19 +3030,19 @@ var xa = "x-upload-filename", Sa = P.strictObject({
|
|
|
2996
3030
|
]),
|
|
2997
3031
|
size: P.int().nonnegative(),
|
|
2998
3032
|
url: P.url()
|
|
2999
|
-
}),
|
|
3033
|
+
}), ka = class extends _ {
|
|
3000
3034
|
sessionsApi;
|
|
3001
3035
|
request;
|
|
3002
3036
|
constructor({ api: e, fetch: t = (e, t) => globalThis.fetch(e, t), tools: n = {}, elements: r = [] }) {
|
|
3003
|
-
let i =
|
|
3037
|
+
let i = Na(e), a = r.map(se);
|
|
3004
3038
|
super({
|
|
3005
3039
|
api: i,
|
|
3006
3040
|
fetch: async (e, n) => {
|
|
3007
3041
|
let r = await t(e, n);
|
|
3008
3042
|
if ((n?.method ?? "GET").toUpperCase() !== "POST" || !r.ok) return r;
|
|
3009
3043
|
let i = await r.json();
|
|
3010
|
-
if (!
|
|
3011
|
-
let a =
|
|
3044
|
+
if (!Pa(i)) throw Error("Zukhruf returned an invalid accepted-turn response");
|
|
3045
|
+
let a = Na(String(e)), o = decodeURIComponent(a.slice(a.lastIndexOf("/") + 1));
|
|
3012
3046
|
if (i.sessionId !== o) throw Error("Zukhruf returned a different session ID");
|
|
3013
3047
|
let s = n?.signal;
|
|
3014
3048
|
return s?.addEventListener("abort", () => {
|
|
@@ -3023,7 +3057,7 @@ var xa = "x-upload-filename", Sa = P.strictObject({
|
|
|
3023
3057
|
let o = t[t.length - 1];
|
|
3024
3058
|
if (!o) throw Error("A message is required");
|
|
3025
3059
|
return {
|
|
3026
|
-
api:
|
|
3060
|
+
api: Aa(i, e),
|
|
3027
3061
|
body: {
|
|
3028
3062
|
sessionId: e,
|
|
3029
3063
|
message: o,
|
|
@@ -3034,50 +3068,50 @@ var xa = "x-upload-filename", Sa = P.strictObject({
|
|
|
3034
3068
|
};
|
|
3035
3069
|
},
|
|
3036
3070
|
prepareReconnectToStreamRequest: ({ headers: e, id: t }) => ({
|
|
3037
|
-
api: `${
|
|
3071
|
+
api: `${Aa(i, t)}/stream`,
|
|
3038
3072
|
headers: e
|
|
3039
3073
|
})
|
|
3040
3074
|
}), this.sessionsApi = i, this.request = t;
|
|
3041
3075
|
}
|
|
3042
3076
|
async uploadFile(e, t) {
|
|
3043
|
-
let n = await this.request(`${
|
|
3077
|
+
let n = await this.request(`${Aa(this.sessionsApi, e)}/uploads`, {
|
|
3044
3078
|
method: "POST",
|
|
3045
3079
|
headers: {
|
|
3046
3080
|
"content-type": t.type,
|
|
3047
|
-
[
|
|
3081
|
+
[Da]: encodeURIComponent(t.name)
|
|
3048
3082
|
},
|
|
3049
3083
|
body: t
|
|
3050
3084
|
});
|
|
3051
|
-
if (!n.ok) throw Error(await
|
|
3052
|
-
let r =
|
|
3085
|
+
if (!n.ok) throw Error(await ja(n, t));
|
|
3086
|
+
let r = Oa.safeParse(await n.json());
|
|
3053
3087
|
if (!r.success) throw Error("Zukhruf returned an invalid upload response");
|
|
3054
3088
|
return r.data;
|
|
3055
3089
|
}
|
|
3056
3090
|
};
|
|
3057
|
-
function
|
|
3091
|
+
function Aa(e, t) {
|
|
3058
3092
|
return `${e}/${encodeURIComponent(t)}`;
|
|
3059
3093
|
}
|
|
3060
|
-
async function
|
|
3061
|
-
let n = `Uploading ${t.name} failed with HTTP ${e.status}`, r =
|
|
3094
|
+
async function ja(e, t) {
|
|
3095
|
+
let n = `Uploading ${t.name} failed with HTTP ${e.status}`, r = Ma(await e.json().catch((e) => {
|
|
3062
3096
|
if (e instanceof SyntaxError) return null;
|
|
3063
3097
|
throw e;
|
|
3064
3098
|
}));
|
|
3065
3099
|
return r ? `${n}: ${r}` : n;
|
|
3066
3100
|
}
|
|
3067
|
-
function
|
|
3101
|
+
function Ma(e) {
|
|
3068
3102
|
if (typeof e != "object" || !e) return null;
|
|
3069
3103
|
let t = "cause" in e && typeof e.cause == "object" && e.cause !== null ? e.cause : null;
|
|
3070
3104
|
return [t && "code" in t && typeof t.code == "string" ? t.code : null, t && "detail" in t && typeof t.detail == "string" ? t.detail : "error" in e && typeof e.error == "string" ? e.error : null].filter((e) => e !== null).join(" — ") || null;
|
|
3071
3105
|
}
|
|
3072
|
-
function
|
|
3106
|
+
function Na(e) {
|
|
3073
3107
|
return e.replace(/\/$/, "");
|
|
3074
3108
|
}
|
|
3075
|
-
function
|
|
3109
|
+
function Pa(e) {
|
|
3076
3110
|
return typeof e == "object" && !!e && "ok" in e && e.ok === !0 && "sessionId" in e && typeof e.sessionId == "string" && "turnId" in e && typeof e.turnId == "string";
|
|
3077
3111
|
}
|
|
3078
3112
|
//#endregion
|
|
3079
3113
|
//#region src/lib/chat/trajectory/trajectories/collapsible-disclosure.tsx
|
|
3080
|
-
function
|
|
3114
|
+
function Fa(e) {
|
|
3081
3115
|
let t = O(24), { label: n, open: r, onOpenChange: i, children: a, className: o, triggerClassName: s, contentClassName: c, chevronClassName: l } = e, u;
|
|
3082
3116
|
t[0] === s ? u = t[1] : (u = k("flex items-center font-mono", s), t[0] = s, t[1] = u);
|
|
3083
3117
|
let d;
|
|
@@ -3088,7 +3122,7 @@ function ka(e) {
|
|
|
3088
3122
|
let f = r && "rotate-180", p;
|
|
3089
3123
|
t[4] !== l || t[5] !== f ? (p = k("size-4 transition-transform", l, f), t[4] = l, t[5] = f, t[6] = p) : p = t[6];
|
|
3090
3124
|
let m;
|
|
3091
|
-
t[7] === p ? m = t[8] : (m = /* @__PURE__ */ M(
|
|
3125
|
+
t[7] === p ? m = t[8] : (m = /* @__PURE__ */ M(Ve, { className: p }), t[7] = p, t[8] = m);
|
|
3092
3126
|
let h;
|
|
3093
3127
|
t[9] === n ? h = t[10] : (h = /* @__PURE__ */ M("span", { children: n }), t[9] = n, t[10] = h);
|
|
3094
3128
|
let g;
|
|
@@ -3111,19 +3145,19 @@ function ka(e) {
|
|
|
3111
3145
|
}
|
|
3112
3146
|
//#endregion
|
|
3113
3147
|
//#region src/lib/chat/trajectory/trajectories/user-message.tsx
|
|
3114
|
-
function
|
|
3148
|
+
function Ia(e) {
|
|
3115
3149
|
let t = O(7), { metadata: n } = e;
|
|
3116
3150
|
if (!n) return null;
|
|
3117
3151
|
let r, i, a;
|
|
3118
3152
|
if (t[0] !== n) {
|
|
3119
3153
|
a = Symbol.for("react.early_return_sentinel");
|
|
3120
3154
|
bb0: {
|
|
3121
|
-
let e =
|
|
3155
|
+
let e = ba(n);
|
|
3122
3156
|
if (!e) {
|
|
3123
3157
|
a = null;
|
|
3124
3158
|
break bb0;
|
|
3125
3159
|
}
|
|
3126
|
-
r = "text-muted-foreground mt-2 text-xs tabular-nums opacity-60", i =
|
|
3160
|
+
r = "text-muted-foreground mt-2 text-xs tabular-nums opacity-60", i = Ea(e);
|
|
3127
3161
|
}
|
|
3128
3162
|
t[0] = n, t[1] = r, t[2] = i, t[3] = a;
|
|
3129
3163
|
} else r = t[1], i = t[2], a = t[3];
|
|
@@ -3134,27 +3168,27 @@ function Aa(e) {
|
|
|
3134
3168
|
children: i
|
|
3135
3169
|
}), t[4] = r, t[5] = i, t[6] = o) : o = t[6], o;
|
|
3136
3170
|
}
|
|
3137
|
-
function
|
|
3171
|
+
function La(e, t) {
|
|
3138
3172
|
return D(e.metadata) ? e.metadata[t] : void 0;
|
|
3139
3173
|
}
|
|
3140
|
-
function
|
|
3141
|
-
let t =
|
|
3174
|
+
function Ra(e) {
|
|
3175
|
+
let t = La(e, "reminders");
|
|
3142
3176
|
return Array.isArray(t) ? t.filter((e) => {
|
|
3143
3177
|
if (!e || typeof e != "object") return !1;
|
|
3144
3178
|
let t = e;
|
|
3145
3179
|
return typeof t.id == "string" && t.id.length > 0 && typeof t.text == "string" && t.text.trim().length > 0;
|
|
3146
3180
|
}) : [];
|
|
3147
3181
|
}
|
|
3148
|
-
function
|
|
3149
|
-
let t =
|
|
3182
|
+
function za(e) {
|
|
3183
|
+
let t = La(e, "uploads");
|
|
3150
3184
|
return Array.isArray(t) ? t.flatMap((e) => {
|
|
3151
|
-
let t =
|
|
3185
|
+
let t = Oa.safeParse(e);
|
|
3152
3186
|
return t.success ? [t.data] : [];
|
|
3153
3187
|
}) : [];
|
|
3154
3188
|
}
|
|
3155
|
-
function
|
|
3189
|
+
function Ba(e) {
|
|
3156
3190
|
let t = O(7), { text: n } = e, [r, i] = g(!1), a;
|
|
3157
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = () => i(
|
|
3191
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = () => i(Va), t[0] = a) : a = t[0];
|
|
3158
3192
|
let o = !r && "line-clamp-3", s;
|
|
3159
3193
|
t[1] === o ? s = t[2] : (s = k("hover:text-foreground w-full cursor-pointer text-left whitespace-pre-wrap", o), t[1] = o, t[2] = s);
|
|
3160
3194
|
let c;
|
|
@@ -3166,21 +3200,21 @@ function Pa(e) {
|
|
|
3166
3200
|
children: n
|
|
3167
3201
|
}) }), t[3] = r, t[4] = s, t[5] = n, t[6] = c) : c = t[6], c;
|
|
3168
3202
|
}
|
|
3169
|
-
function
|
|
3203
|
+
function Va(e) {
|
|
3170
3204
|
return !e;
|
|
3171
3205
|
}
|
|
3172
|
-
function
|
|
3206
|
+
function Ha(e) {
|
|
3173
3207
|
let t = O(8), { reminders: n } = e, [r, i] = g(!1);
|
|
3174
3208
|
if (n.length === 0) return null;
|
|
3175
3209
|
let a = `${n.length} reminder${n.length === 1 ? "" : "s"} attached`, o;
|
|
3176
|
-
t[0] === n ? o = t[1] : (o = n.map(
|
|
3210
|
+
t[0] === n ? o = t[1] : (o = n.map(Ua), t[0] = n, t[1] = o);
|
|
3177
3211
|
let s;
|
|
3178
3212
|
t[2] === o ? s = t[3] : (s = /* @__PURE__ */ M("ul", {
|
|
3179
3213
|
className: "border-ink-12 text-muted-foreground space-y-1 border-l pl-3 text-xs",
|
|
3180
3214
|
children: o
|
|
3181
3215
|
}), t[2] = o, t[3] = s);
|
|
3182
3216
|
let c;
|
|
3183
|
-
return t[4] !== a || t[5] !== r || t[6] !== s ? (c = /* @__PURE__ */ M(
|
|
3217
|
+
return t[4] !== a || t[5] !== r || t[6] !== s ? (c = /* @__PURE__ */ M(Fa, {
|
|
3184
3218
|
label: a,
|
|
3185
3219
|
open: r,
|
|
3186
3220
|
onOpenChange: i,
|
|
@@ -3191,10 +3225,10 @@ function Ia(e) {
|
|
|
3191
3225
|
children: s
|
|
3192
3226
|
}), t[4] = a, t[5] = r, t[6] = s, t[7] = c) : c = t[7], c;
|
|
3193
3227
|
}
|
|
3194
|
-
function
|
|
3195
|
-
return /* @__PURE__ */ M(
|
|
3228
|
+
function Ua(e) {
|
|
3229
|
+
return /* @__PURE__ */ M(Ba, { text: e.text }, e.id);
|
|
3196
3230
|
}
|
|
3197
|
-
function
|
|
3231
|
+
function Wa(e) {
|
|
3198
3232
|
let t = O(19), { upload: n } = e;
|
|
3199
3233
|
if (n.mediaType.startsWith("video/")) {
|
|
3200
3234
|
let e;
|
|
@@ -3260,17 +3294,17 @@ function Ra(e) {
|
|
|
3260
3294
|
})
|
|
3261
3295
|
}), t[16] = n.name, t[17] = n.url, t[18] = r) : r = t[18], r;
|
|
3262
3296
|
}
|
|
3263
|
-
function
|
|
3297
|
+
function Ga(e) {
|
|
3264
3298
|
let t = O(13), { message: n } = e, r, i, a, o, s, c;
|
|
3265
3299
|
if (t[0] !== n) {
|
|
3266
3300
|
c = Symbol.for("react.early_return_sentinel");
|
|
3267
3301
|
bb0: {
|
|
3268
|
-
let e =
|
|
3302
|
+
let e = za(n);
|
|
3269
3303
|
if (e.length === 0) {
|
|
3270
3304
|
c = null;
|
|
3271
3305
|
break bb0;
|
|
3272
3306
|
}
|
|
3273
|
-
r = fe, i = "list", a = "Attached files", o = "max-w-full gap-2 py-0", s = e.map(
|
|
3307
|
+
r = fe, i = "list", a = "Attached files", o = "max-w-full gap-2 py-0", s = e.map(Ka);
|
|
3274
3308
|
}
|
|
3275
3309
|
t[0] = n, t[1] = r, t[2] = i, t[3] = a, t[4] = o, t[5] = s, t[6] = c;
|
|
3276
3310
|
} else r = t[1], i = t[2], a = t[3], o = t[4], s = t[5], c = t[6];
|
|
@@ -3283,23 +3317,23 @@ function za(e) {
|
|
|
3283
3317
|
children: s
|
|
3284
3318
|
}), t[7] = r, t[8] = i, t[9] = a, t[10] = o, t[11] = s, t[12] = l) : l = t[12], l;
|
|
3285
3319
|
}
|
|
3286
|
-
function
|
|
3320
|
+
function Ka(e) {
|
|
3287
3321
|
return /* @__PURE__ */ M("div", {
|
|
3288
3322
|
role: "listitem",
|
|
3289
3323
|
"data-slot": "attachment",
|
|
3290
|
-
children: /* @__PURE__ */ M(
|
|
3324
|
+
children: /* @__PURE__ */ M(Wa, { upload: e })
|
|
3291
3325
|
}, e.path);
|
|
3292
3326
|
}
|
|
3293
|
-
function
|
|
3327
|
+
function qa(e) {
|
|
3294
3328
|
let t = O(10), { body: n, reminders: r, metadata: i } = e, a;
|
|
3295
3329
|
t[0] === n ? a = t[1] : (a = /* @__PURE__ */ M("div", {
|
|
3296
3330
|
className: "flex-1 space-y-3",
|
|
3297
3331
|
children: n
|
|
3298
3332
|
}), t[0] = n, t[1] = a);
|
|
3299
3333
|
let o;
|
|
3300
|
-
t[2] === r ? o = t[3] : (o = /* @__PURE__ */ M(
|
|
3334
|
+
t[2] === r ? o = t[3] : (o = /* @__PURE__ */ M(Ha, { reminders: r }), t[2] = r, t[3] = o);
|
|
3301
3335
|
let s;
|
|
3302
|
-
t[4] === i ? s = t[5] : (s = i !== void 0 && /* @__PURE__ */ M(
|
|
3336
|
+
t[4] === i ? s = t[5] : (s = i !== void 0 && /* @__PURE__ */ M(Ia, { metadata: i }), t[4] = i, t[5] = s);
|
|
3303
3337
|
let c;
|
|
3304
3338
|
return t[6] !== a || t[7] !== o || t[8] !== s ? (c = /* @__PURE__ */ N("div", {
|
|
3305
3339
|
className: "bg-secondary flex max-w-[80%] flex-col gap-3 rounded-lg p-3",
|
|
@@ -3310,13 +3344,13 @@ function Va(e) {
|
|
|
3310
3344
|
]
|
|
3311
3345
|
}), t[6] = a, t[7] = o, t[8] = s, t[9] = c) : c = t[9], c;
|
|
3312
3346
|
}
|
|
3313
|
-
function
|
|
3347
|
+
function Ja(e) {
|
|
3314
3348
|
let t = O(28), { message: n } = e;
|
|
3315
|
-
|
|
3349
|
+
La(n, "reminders");
|
|
3316
3350
|
let r;
|
|
3317
3351
|
t[0] === n ? r = t[1] : (r = ee(n), t[0] = n, t[1] = r);
|
|
3318
3352
|
let i;
|
|
3319
|
-
t[2] === n ? i = t[3] : (i =
|
|
3353
|
+
t[2] === n ? i = t[3] : (i = Ra(n), t[2] = n, t[3] = i);
|
|
3320
3354
|
let a;
|
|
3321
3355
|
t[4] !== r || t[5] !== i ? (a = {
|
|
3322
3356
|
message: r,
|
|
@@ -3324,34 +3358,36 @@ function Ha(e) {
|
|
|
3324
3358
|
}, t[4] = r, t[5] = i, t[6] = a) : a = t[6];
|
|
3325
3359
|
let { message: o, reminders: s } = a, c;
|
|
3326
3360
|
if (t[7] !== n) {
|
|
3327
|
-
let e =
|
|
3361
|
+
let e = La(n, "alias");
|
|
3328
3362
|
c = typeof e == "string" && e.trim().length > 0 ? e : void 0, t[7] = n, t[8] = c;
|
|
3329
3363
|
} else c = t[8];
|
|
3330
3364
|
let l = c;
|
|
3331
3365
|
if (l) {
|
|
3332
3366
|
let e;
|
|
3333
3367
|
t[9] === l ? e = t[10] : (e = /* @__PURE__ */ M("div", {
|
|
3368
|
+
dir: "auto",
|
|
3334
3369
|
className: "text-sm whitespace-pre-wrap",
|
|
3335
3370
|
children: l
|
|
3336
3371
|
}), t[9] = l, t[10] = e);
|
|
3337
3372
|
let n;
|
|
3338
|
-
return t[11] !== s || t[12] !== e ? (n = /* @__PURE__ */ M(
|
|
3373
|
+
return t[11] !== s || t[12] !== e ? (n = /* @__PURE__ */ M(qa, {
|
|
3339
3374
|
reminders: s,
|
|
3340
3375
|
body: e
|
|
3341
3376
|
}), t[11] = s, t[12] = e, t[13] = n) : n = t[13], n;
|
|
3342
3377
|
}
|
|
3343
3378
|
let u;
|
|
3344
|
-
t[14] === o ? u = t[15] : (u = /* @__PURE__ */ M(
|
|
3379
|
+
t[14] === o ? u = t[15] : (u = /* @__PURE__ */ M(Ga, { message: o }), t[14] = o, t[15] = u);
|
|
3345
3380
|
let d = o.metadata, f;
|
|
3346
3381
|
if (t[16] !== o.id || t[17] !== o.parts) {
|
|
3347
3382
|
let e;
|
|
3348
3383
|
t[19] === o.id ? e = t[20] : (e = (e, t) => e.type === "text" ? /* @__PURE__ */ M("div", {
|
|
3384
|
+
dir: "auto",
|
|
3349
3385
|
className: "text-sm whitespace-pre-wrap",
|
|
3350
|
-
children: /* @__PURE__ */ M(
|
|
3386
|
+
children: /* @__PURE__ */ M(wt, { text: e.text })
|
|
3351
3387
|
}, `${o.id}-${t}-text`) : null, t[19] = o.id, t[20] = e), f = o.parts.map(e), t[16] = o.id, t[17] = o.parts, t[18] = f;
|
|
3352
3388
|
} else f = t[18];
|
|
3353
3389
|
let p;
|
|
3354
|
-
t[21] !== o.metadata || t[22] !== s || t[23] !== f ? (p = /* @__PURE__ */ M(
|
|
3390
|
+
t[21] !== o.metadata || t[22] !== s || t[23] !== f ? (p = /* @__PURE__ */ M(qa, {
|
|
3355
3391
|
reminders: s,
|
|
3356
3392
|
metadata: d,
|
|
3357
3393
|
body: f
|
|
@@ -3362,11 +3398,11 @@ function Ha(e) {
|
|
|
3362
3398
|
children: [u, p]
|
|
3363
3399
|
}), t[25] = u, t[26] = p, t[27] = m) : m = t[27], m;
|
|
3364
3400
|
}
|
|
3365
|
-
var
|
|
3401
|
+
var Ya = c(function(e) {
|
|
3366
3402
|
let t = O(7), { className: n } = e, { message: r } = K(), i;
|
|
3367
3403
|
t[0] === n ? i = t[1] : (i = k("flex justify-end", n), t[0] = n, t[1] = i);
|
|
3368
3404
|
let a;
|
|
3369
|
-
t[2] === r ? a = t[3] : (a = /* @__PURE__ */ M(
|
|
3405
|
+
t[2] === r ? a = t[3] : (a = /* @__PURE__ */ M(Ja, { message: r }), t[2] = r, t[3] = a);
|
|
3370
3406
|
let o;
|
|
3371
3407
|
return t[4] !== i || t[5] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
3372
3408
|
className: i,
|
|
@@ -3375,20 +3411,20 @@ var Ua = c(function(e) {
|
|
|
3375
3411
|
});
|
|
3376
3412
|
//#endregion
|
|
3377
3413
|
//#region src/lib/chat/trajectory/trajectories/compact-messages.tsx
|
|
3378
|
-
function
|
|
3379
|
-
return e.kind === "tool" ? !
|
|
3414
|
+
function Xa(e) {
|
|
3415
|
+
return e.kind === "tool" ? !ci(e.part) : e.kind === "dynamic-tool" || e.kind === "reasoning";
|
|
3380
3416
|
}
|
|
3381
|
-
function
|
|
3417
|
+
function Za(e, t) {
|
|
3382
3418
|
return e.kind === "tool" ? !0 : e.kind === "reasoning" || e.kind === "dynamic-tool" ? !!t : !1;
|
|
3383
3419
|
}
|
|
3384
|
-
function
|
|
3385
|
-
return e.kind === "text" && e.parts.some(({ part: e }) => e.type === "text" && !
|
|
3420
|
+
function Qa(e) {
|
|
3421
|
+
return e.kind === "text" && e.parts.some(({ part: e }) => e.type === "text" && !Ni(e));
|
|
3386
3422
|
}
|
|
3387
|
-
function
|
|
3423
|
+
function $a(e, t) {
|
|
3388
3424
|
let n = [];
|
|
3389
3425
|
for (let r = 0; r < e.length; r++) {
|
|
3390
3426
|
let i = e[r];
|
|
3391
|
-
if (!
|
|
3427
|
+
if (!Xa(i)) {
|
|
3392
3428
|
n.push({
|
|
3393
3429
|
kind: "segment",
|
|
3394
3430
|
segment: i,
|
|
@@ -3397,25 +3433,25 @@ function qa(e, t) {
|
|
|
3397
3433
|
continue;
|
|
3398
3434
|
}
|
|
3399
3435
|
let a = [], o = r;
|
|
3400
|
-
for (; r < e.length &&
|
|
3436
|
+
for (; r < e.length && Xa(e[r]);) {
|
|
3401
3437
|
let n = e[r];
|
|
3402
|
-
|
|
3438
|
+
Za(n, t) && a.push({ segment: n }), r++;
|
|
3403
3439
|
}
|
|
3404
3440
|
r--, a.length > 0 && n.push({
|
|
3405
3441
|
kind: "group",
|
|
3406
3442
|
items: a,
|
|
3407
|
-
hasLaterText: e.slice(r + 1).some((e) =>
|
|
3443
|
+
hasLaterText: e.slice(r + 1).some((e) => Qa(e)),
|
|
3408
3444
|
firstIndex: o
|
|
3409
3445
|
});
|
|
3410
3446
|
}
|
|
3411
3447
|
return n;
|
|
3412
3448
|
}
|
|
3413
|
-
function
|
|
3449
|
+
function eo(e) {
|
|
3414
3450
|
if (e.kind !== "tool" && e.kind !== "dynamic-tool") return;
|
|
3415
3451
|
let { part: t } = e;
|
|
3416
3452
|
return w(t) ? t.state : void 0;
|
|
3417
3453
|
}
|
|
3418
|
-
function
|
|
3454
|
+
function to({ groupStatus: e, labelCount: t }) {
|
|
3419
3455
|
return e === "running" ? {
|
|
3420
3456
|
title: "text-info",
|
|
3421
3457
|
detail: "text-info/80",
|
|
@@ -3438,20 +3474,20 @@ function Ya({ groupStatus: e, labelCount: t }) {
|
|
|
3438
3474
|
chevron: "text-muted-foreground"
|
|
3439
3475
|
};
|
|
3440
3476
|
}
|
|
3441
|
-
function
|
|
3477
|
+
function no(e) {
|
|
3442
3478
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
3443
3479
|
}
|
|
3444
|
-
function
|
|
3480
|
+
function ro(e, t = 80) {
|
|
3445
3481
|
let n = e.replace(/\s+/g, " ").trim();
|
|
3446
3482
|
return n.length <= t ? n : `${n.slice(0, t - 3).trimEnd()}...`;
|
|
3447
3483
|
}
|
|
3448
|
-
function
|
|
3449
|
-
if (typeof e == "string") return
|
|
3484
|
+
function io(e) {
|
|
3485
|
+
if (typeof e == "string") return ro(e, 48);
|
|
3450
3486
|
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
3451
3487
|
if (Array.isArray(e)) return `${e.length} items`;
|
|
3452
3488
|
}
|
|
3453
|
-
function
|
|
3454
|
-
if (!
|
|
3489
|
+
function ao(e) {
|
|
3490
|
+
if (!no(e)) return;
|
|
3455
3491
|
let t = [
|
|
3456
3492
|
"command",
|
|
3457
3493
|
"query",
|
|
@@ -3463,13 +3499,13 @@ function $a(e) {
|
|
|
3463
3499
|
"checks"
|
|
3464
3500
|
], n = [...t.filter((t) => t in e).map((t) => [t, e[t]]), ...Object.entries(e).filter(([e]) => !t.includes(e))], r = {};
|
|
3465
3501
|
for (let [e, t] of n) {
|
|
3466
|
-
let n =
|
|
3502
|
+
let n = io(t);
|
|
3467
3503
|
if (n && (r[e] = n, Object.keys(r).length >= 2)) break;
|
|
3468
3504
|
}
|
|
3469
3505
|
return Object.keys(r).length > 0 ? r : void 0;
|
|
3470
3506
|
}
|
|
3471
|
-
function
|
|
3472
|
-
if (
|
|
3507
|
+
function oo(e) {
|
|
3508
|
+
if (no(e)) for (let t of [
|
|
3473
3509
|
"reasoning",
|
|
3474
3510
|
"thoughts",
|
|
3475
3511
|
"thought",
|
|
@@ -3477,36 +3513,36 @@ function eo(e) {
|
|
|
3477
3513
|
"detail"
|
|
3478
3514
|
]) {
|
|
3479
3515
|
let n = e[t];
|
|
3480
|
-
if (typeof n == "string" && n.trim().length > 0) return
|
|
3516
|
+
if (typeof n == "string" && n.trim().length > 0) return ro(n);
|
|
3481
3517
|
}
|
|
3482
3518
|
}
|
|
3483
|
-
function
|
|
3519
|
+
function so(e) {
|
|
3484
3520
|
if (e.kind !== "reasoning") return;
|
|
3485
3521
|
let { part: t } = e;
|
|
3486
|
-
if (t.type === "reasoning") return
|
|
3522
|
+
if (t.type === "reasoning") return ro(t.text, 96);
|
|
3487
3523
|
}
|
|
3488
|
-
function
|
|
3524
|
+
function co(e, t) {
|
|
3489
3525
|
if (e.kind === "reasoning") return {
|
|
3490
3526
|
kind: "reasoning",
|
|
3491
3527
|
name: "reasoning",
|
|
3492
|
-
detail:
|
|
3528
|
+
detail: so(e)
|
|
3493
3529
|
};
|
|
3494
3530
|
if (e.kind === "dynamic-tool" && e.part.type === "dynamic-tool") {
|
|
3495
3531
|
let t = e.part;
|
|
3496
3532
|
return {
|
|
3497
3533
|
kind: "dynamic-tool",
|
|
3498
3534
|
name: t.toolName || "Tool",
|
|
3499
|
-
args:
|
|
3500
|
-
detail:
|
|
3535
|
+
args: ao(t.input),
|
|
3536
|
+
detail: oo(t.input)
|
|
3501
3537
|
};
|
|
3502
3538
|
}
|
|
3503
3539
|
if (e.kind === "tool" && S(e.part)) {
|
|
3504
|
-
let n = e.part, { toolEntry: r, toolKey: i } =
|
|
3540
|
+
let n = e.part, { toolEntry: r, toolKey: i } = ui(n, t), a = r?.label?.(n);
|
|
3505
3541
|
return {
|
|
3506
3542
|
kind: "tool",
|
|
3507
3543
|
name: a?.name ?? i,
|
|
3508
|
-
args: a?.args ??
|
|
3509
|
-
detail: a?.detail ??
|
|
3544
|
+
args: a?.args ?? ao(n.input),
|
|
3545
|
+
detail: a?.detail ?? oo(n.input),
|
|
3510
3546
|
isError: a?.isError
|
|
3511
3547
|
};
|
|
3512
3548
|
}
|
|
@@ -3515,54 +3551,54 @@ function no(e, t) {
|
|
|
3515
3551
|
name: "Step"
|
|
3516
3552
|
};
|
|
3517
3553
|
}
|
|
3518
|
-
function
|
|
3554
|
+
function lo(e) {
|
|
3519
3555
|
if (!e) return;
|
|
3520
3556
|
let t = Object.entries(e).filter((e) => typeof e[1] == "string" && e[1].trim().length > 0);
|
|
3521
|
-
if (t.length !== 0) return t.slice(0, 2).map(([e, t]) => `${e}: ${
|
|
3557
|
+
if (t.length !== 0) return t.slice(0, 2).map(([e, t]) => `${e}: ${ro(t, 36)}`).join(", ");
|
|
3522
3558
|
}
|
|
3523
|
-
function
|
|
3524
|
-
let t =
|
|
3559
|
+
function uo(e) {
|
|
3560
|
+
let t = lo(e.args);
|
|
3525
3561
|
return t ? `${e.name}(${t})` : e.name;
|
|
3526
3562
|
}
|
|
3527
|
-
function
|
|
3563
|
+
function fo(e) {
|
|
3528
3564
|
return e === "output-available" || e === "output-error" || e === "output-denied";
|
|
3529
3565
|
}
|
|
3530
|
-
function
|
|
3531
|
-
return !!e && !
|
|
3566
|
+
function po(e) {
|
|
3567
|
+
return !!e && !fo(e);
|
|
3532
3568
|
}
|
|
3533
|
-
function
|
|
3534
|
-
return
|
|
3569
|
+
function mo(e, t) {
|
|
3570
|
+
return nn(e, t);
|
|
3535
3571
|
}
|
|
3536
|
-
function
|
|
3537
|
-
return e.some(({ segment: e }) =>
|
|
3538
|
-
let t =
|
|
3572
|
+
function ho({ items: e, labels: t, status: n, hasLaterText: r }) {
|
|
3573
|
+
return e.some(({ segment: e }) => mo(eo(e), n)) ? "aborted" : !r && (n === "streaming" || n === "submitted") ? "running" : t.some((e) => e.isError) || e.some(({ segment: e }) => {
|
|
3574
|
+
let t = eo(e);
|
|
3539
3575
|
return t === "output-error" || t === "output-denied";
|
|
3540
|
-
}) ? "error" : e.some(({ segment: e }) =>
|
|
3576
|
+
}) ? "error" : e.some(({ segment: e }) => po(eo(e))) || !r && t.every((e) => e.kind === "reasoning") && (n === "streaming" || n === "submitted") ? "running" : "complete";
|
|
3541
3577
|
}
|
|
3542
|
-
function
|
|
3578
|
+
function go(e) {
|
|
3543
3579
|
return e && `${e[0].toUpperCase()}${e.slice(1)}`;
|
|
3544
3580
|
}
|
|
3545
|
-
function
|
|
3581
|
+
function _o(e) {
|
|
3546
3582
|
return e.filter((e) => e.kind !== "reasoning").length;
|
|
3547
3583
|
}
|
|
3548
|
-
function
|
|
3549
|
-
let n =
|
|
3584
|
+
function vo(e, t) {
|
|
3585
|
+
let n = _o(e);
|
|
3550
3586
|
if (n !== 0) return `${t === "running" || t === "aborted" ? "running" : "ran"} ${n} ${n === 1 ? "tool" : "tools"}`;
|
|
3551
3587
|
}
|
|
3552
|
-
function
|
|
3553
|
-
let n =
|
|
3554
|
-
if (n) return
|
|
3588
|
+
function yo(e, t) {
|
|
3589
|
+
let n = vo(e, t);
|
|
3590
|
+
if (n) return go(t === "error" ? `${n} with issues` : t === "aborted" ? `cancelled after ${n}` : n);
|
|
3555
3591
|
}
|
|
3556
|
-
function
|
|
3592
|
+
function bo(e, t, n) {
|
|
3557
3593
|
let r = e.length === 1 ? e[0] : void 0;
|
|
3558
3594
|
if (t === "running") return n || (r?.kind === "reasoning" ? `Reasoning${r.detail ? ` ${r.detail}` : ""}` : e.every((e) => e.kind === "reasoning") ? "Reasoning" : "Working...");
|
|
3559
3595
|
if (r) {
|
|
3560
|
-
let e =
|
|
3596
|
+
let e = uo(r);
|
|
3561
3597
|
return t === "error" ? `Failed ${e}` : t === "aborted" ? `Cancelled ${e}` : r.kind === "reasoning" ? `Reasoned${r.detail ? ` ${r.detail}` : ""}` : `Called ${e}`;
|
|
3562
3598
|
}
|
|
3563
|
-
return e.every((e) => e.kind === "reasoning") ? "Reasoned" :
|
|
3599
|
+
return e.every((e) => e.kind === "reasoning") ? "Reasoned" : yo(e, t) ?? "Ran tools";
|
|
3564
3600
|
}
|
|
3565
|
-
function
|
|
3601
|
+
function xo(e, t) {
|
|
3566
3602
|
if (t !== "running") {
|
|
3567
3603
|
if (e.length === 1) {
|
|
3568
3604
|
let t = e[0];
|
|
@@ -3571,28 +3607,28 @@ function ho(e, t) {
|
|
|
3571
3607
|
return Array.from(new Set([...e].sort((e, t) => e.kind === "reasoning" && t.kind !== "reasoning" ? 1 : e.kind !== "reasoning" && t.kind === "reasoning" ? -1 : 0).map((e) => e.name))).slice(0, 3).join(", ") || void 0;
|
|
3572
3608
|
}
|
|
3573
3609
|
}
|
|
3574
|
-
function
|
|
3610
|
+
function So(e) {
|
|
3575
3611
|
let t;
|
|
3576
3612
|
for (let n = e.length - 1; n >= 0; n--) {
|
|
3577
3613
|
let r = e[n].segment;
|
|
3578
3614
|
if (r.kind === "dynamic-tool" && r.part.type === "dynamic-tool") {
|
|
3579
|
-
let e =
|
|
3615
|
+
let e = oo(r.part.input);
|
|
3580
3616
|
if (e) return e;
|
|
3581
3617
|
}
|
|
3582
3618
|
if (r.kind === "tool" && S(r.part)) {
|
|
3583
|
-
let e =
|
|
3619
|
+
let e = oo(r.part.input);
|
|
3584
3620
|
if (e) return e;
|
|
3585
3621
|
}
|
|
3586
|
-
r.kind === "reasoning" && (t ??=
|
|
3622
|
+
r.kind === "reasoning" && (t ??= so(r));
|
|
3587
3623
|
}
|
|
3588
3624
|
return t;
|
|
3589
3625
|
}
|
|
3590
|
-
function
|
|
3591
|
-
return !e || e.role !== "assistant" ? !1 :
|
|
3626
|
+
function Co(e, t) {
|
|
3627
|
+
return !e || e.role !== "assistant" ? !1 : $a(Ji(e.parts), t).some((e) => e.kind === "group" && !e.hasLaterText);
|
|
3592
3628
|
}
|
|
3593
|
-
function
|
|
3629
|
+
function wo() {
|
|
3594
3630
|
let e = O(8), { message: t } = K(), { debugMode: n } = z(), r;
|
|
3595
|
-
e[0] === t.parts ? r = e[1] : (r =
|
|
3631
|
+
e[0] === t.parts ? r = e[1] : (r = Ji(t.parts), e[0] = t.parts, e[1] = r);
|
|
3596
3632
|
let i = r, a;
|
|
3597
3633
|
if (e[2] !== n || e[3] !== t.id || e[4] !== i) {
|
|
3598
3634
|
let r;
|
|
@@ -3602,29 +3638,29 @@ function vo() {
|
|
|
3602
3638
|
} : {
|
|
3603
3639
|
...e,
|
|
3604
3640
|
key: `${t.id}-${Z(e.segment, e.segmentIndex)}-${e.segment.kind}`
|
|
3605
|
-
}, e[6] = t.id, e[7] = r), a =
|
|
3641
|
+
}, e[6] = t.id, e[7] = r), a = $a(i, n).map(r), e[2] = n, e[3] = t.id, e[4] = i, e[5] = a;
|
|
3606
3642
|
} else a = e[5];
|
|
3607
3643
|
return a;
|
|
3608
3644
|
}
|
|
3609
|
-
var
|
|
3610
|
-
function
|
|
3611
|
-
let e = l(
|
|
3645
|
+
var To = o(null);
|
|
3646
|
+
function Eo() {
|
|
3647
|
+
let e = l(To);
|
|
3612
3648
|
if (!e) throw Error("CompactTrajectory group parts must be rendered within CompactTrajectory.Group");
|
|
3613
3649
|
return e;
|
|
3614
3650
|
}
|
|
3615
|
-
function
|
|
3651
|
+
function Do(e) {
|
|
3616
3652
|
let t = O(21), { group: n, children: r } = e, { registry: i } = z(), { message: a } = K(), o = G(), [s, c] = g(!n.hasLaterText), l, u, d;
|
|
3617
3653
|
if (t[0] !== n.hasLaterText || t[1] !== n.items || t[2] !== i || t[3] !== o) {
|
|
3618
3654
|
let e;
|
|
3619
3655
|
t[7] === i ? e = t[8] : (e = (e) => {
|
|
3620
3656
|
let { segment: t } = e;
|
|
3621
|
-
return
|
|
3622
|
-
}, t[7] = i, t[8] = e), u = n.items.map(e), l =
|
|
3657
|
+
return co(t, i);
|
|
3658
|
+
}, t[7] = i, t[8] = e), u = n.items.map(e), l = ho({
|
|
3623
3659
|
items: n.items,
|
|
3624
3660
|
labels: u,
|
|
3625
3661
|
status: o,
|
|
3626
3662
|
hasLaterText: n.hasLaterText
|
|
3627
|
-
}), d =
|
|
3663
|
+
}), d = to({
|
|
3628
3664
|
groupStatus: l,
|
|
3629
3665
|
labelCount: u.length
|
|
3630
3666
|
}), t[0] = n.hasLaterText, t[1] = n.items, t[2] = i, t[3] = o, t[4] = l, t[5] = u, t[6] = d;
|
|
@@ -3645,16 +3681,16 @@ function xo(e) {
|
|
|
3645
3681
|
children: r
|
|
3646
3682
|
}), t[15] = r, t[16] = s, t[17] = m) : m = t[17];
|
|
3647
3683
|
let h;
|
|
3648
|
-
return t[18] !== p || t[19] !== m ? (h = /* @__PURE__ */ M(
|
|
3684
|
+
return t[18] !== p || t[19] !== m ? (h = /* @__PURE__ */ M(To, {
|
|
3649
3685
|
value: p,
|
|
3650
3686
|
children: m
|
|
3651
3687
|
}), t[18] = p, t[19] = m, t[20] = h) : h = t[20], h;
|
|
3652
3688
|
}
|
|
3653
|
-
function
|
|
3689
|
+
function Oo(e) {
|
|
3654
3690
|
let t = O(3), { children: n } = e, r;
|
|
3655
3691
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ M("button", {
|
|
3656
3692
|
type: "button",
|
|
3657
|
-
className:
|
|
3693
|
+
className: cn("items-start")
|
|
3658
3694
|
}), t[0] = r) : r = t[0];
|
|
3659
3695
|
let i;
|
|
3660
3696
|
return t[1] === n ? i = t[2] : (i = /* @__PURE__ */ M(L, {
|
|
@@ -3665,11 +3701,11 @@ function So(e) {
|
|
|
3665
3701
|
})
|
|
3666
3702
|
}), t[1] = n, t[2] = i), i;
|
|
3667
3703
|
}
|
|
3668
|
-
function
|
|
3669
|
-
let e = O(12), { items: t, labels: n, groupStatus: r, tone: i } =
|
|
3670
|
-
e[0] !== r || e[1] !== t || e[2] !== n ? (a =
|
|
3704
|
+
function ko() {
|
|
3705
|
+
let e = O(12), { items: t, labels: n, groupStatus: r, tone: i } = Eo(), a;
|
|
3706
|
+
e[0] !== r || e[1] !== t || e[2] !== n ? (a = bo(n, r, So(t)), e[0] = r, e[1] = t, e[2] = n, e[3] = a) : a = e[3];
|
|
3671
3707
|
let o = a, s;
|
|
3672
|
-
e[4] !== r || e[5] !== n ? (s =
|
|
3708
|
+
e[4] !== r || e[5] !== n ? (s = xo(n, r), e[4] = r, e[5] = n, e[6] = s) : s = e[6];
|
|
3673
3709
|
let c = s, l;
|
|
3674
3710
|
return e[7] !== c || e[8] !== r || e[9] !== o || e[10] !== i ? (l = {
|
|
3675
3711
|
title: o,
|
|
@@ -3678,8 +3714,8 @@ function Co() {
|
|
|
3678
3714
|
groupStatus: r
|
|
3679
3715
|
}, e[7] = c, e[8] = r, e[9] = o, e[10] = i, e[11] = l) : l = e[11], l;
|
|
3680
3716
|
}
|
|
3681
|
-
function
|
|
3682
|
-
let t = O(9), { title: n, suffix: r, children: i } = e, { title: a, tone: o, groupStatus: s } =
|
|
3717
|
+
function Ao(e) {
|
|
3718
|
+
let t = O(9), { title: n, suffix: r, children: i } = e, { title: a, tone: o, groupStatus: s } = ko(), c = n ?? a, l = r ? `${c} · ${r}` : c, u = s === "running", d = s === "running" ? "text-info" : o.title, f;
|
|
3683
3719
|
t[0] === d ? f = t[1] : (f = k("max-w-full min-w-0 truncate", d), t[0] = d, t[1] = f);
|
|
3684
3720
|
let p;
|
|
3685
3721
|
t[2] !== u || t[3] !== f || t[4] !== l ? (p = /* @__PURE__ */ M(U, {
|
|
@@ -3694,12 +3730,12 @@ function wo(e) {
|
|
|
3694
3730
|
children: [p, i]
|
|
3695
3731
|
}), t[6] = i, t[7] = p, t[8] = m) : m = t[8], m;
|
|
3696
3732
|
}
|
|
3697
|
-
function
|
|
3698
|
-
let e = O(2), { tone: t } =
|
|
3699
|
-
return e[0] === t.chevron ? n = e[1] : (n = /* @__PURE__ */ M(
|
|
3733
|
+
function jo() {
|
|
3734
|
+
let e = O(2), { tone: t } = Eo(), n;
|
|
3735
|
+
return e[0] === t.chevron ? n = e[1] : (n = /* @__PURE__ */ M(sn, { className: t.chevron }), e[0] = t.chevron, e[1] = n), n;
|
|
3700
3736
|
}
|
|
3701
|
-
function
|
|
3702
|
-
let t = O(5), { detail: n } = e, { title: r, detail: i, tone: a } =
|
|
3737
|
+
function Mo(e) {
|
|
3738
|
+
let t = O(5), { detail: n } = e, { title: r, detail: i, tone: a } = ko();
|
|
3703
3739
|
if (n === null) return null;
|
|
3704
3740
|
let o = n ?? i;
|
|
3705
3741
|
if (!o || o === r) return null;
|
|
@@ -3711,8 +3747,8 @@ function Eo(e) {
|
|
|
3711
3747
|
children: o
|
|
3712
3748
|
}), t[2] = o, t[3] = s, t[4] = c) : c = t[4], c;
|
|
3713
3749
|
}
|
|
3714
|
-
function
|
|
3715
|
-
let t = O(14), { children: n } = e, { items: r, messageId: i, groupStatus: a } =
|
|
3750
|
+
function No(e) {
|
|
3751
|
+
let t = O(14), { children: n } = e, { items: r, messageId: i, groupStatus: a } = Eo(), o = a === "running", s;
|
|
3716
3752
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (s = {
|
|
3717
3753
|
initial: "instant",
|
|
3718
3754
|
resize: "instant"
|
|
@@ -3736,11 +3772,11 @@ function Do(e) {
|
|
|
3736
3772
|
children: h
|
|
3737
3773
|
}), t[10] = u, t[11] = f, t[12] = h, t[13] = g) : g = t[13], g;
|
|
3738
3774
|
}
|
|
3739
|
-
function
|
|
3775
|
+
function Po(e) {
|
|
3740
3776
|
let t = O(19), { item: n, textClassName: r } = e, i = r === void 0 ? "my-4" : r, { elements: a } = W(), { segment: o } = n;
|
|
3741
3777
|
if (o.kind === "text") {
|
|
3742
3778
|
let e;
|
|
3743
|
-
t[0] === o.parts ? e = t[1] : (e = o.parts.filter(
|
|
3779
|
+
t[0] === o.parts ? e = t[1] : (e = o.parts.filter(Fo), t[0] = o.parts, t[1] = e);
|
|
3744
3780
|
let n = e;
|
|
3745
3781
|
if (n.length === 0) return null;
|
|
3746
3782
|
let r;
|
|
@@ -3777,59 +3813,59 @@ function Oo(e) {
|
|
|
3777
3813
|
}
|
|
3778
3814
|
return null;
|
|
3779
3815
|
}
|
|
3780
|
-
function
|
|
3816
|
+
function Fo(e) {
|
|
3781
3817
|
let { part: t } = e;
|
|
3782
|
-
return !
|
|
3783
|
-
}
|
|
3784
|
-
var
|
|
3785
|
-
Group:
|
|
3786
|
-
GroupTrigger:
|
|
3787
|
-
GroupTitle:
|
|
3788
|
-
GroupChevron:
|
|
3789
|
-
GroupDetail:
|
|
3790
|
-
GroupContent:
|
|
3791
|
-
Segment:
|
|
3818
|
+
return !Ni(t);
|
|
3819
|
+
}
|
|
3820
|
+
var Io = {
|
|
3821
|
+
Group: Do,
|
|
3822
|
+
GroupTrigger: Oo,
|
|
3823
|
+
GroupTitle: Ao,
|
|
3824
|
+
GroupChevron: jo,
|
|
3825
|
+
GroupDetail: Mo,
|
|
3826
|
+
GroupContent: No,
|
|
3827
|
+
Segment: Po
|
|
3792
3828
|
};
|
|
3793
|
-
function
|
|
3829
|
+
function Lo() {
|
|
3794
3830
|
let e = O(1), t = G(), { messages: n } = W(), { debugMode: r } = z(), i = n[n.length - 1];
|
|
3795
|
-
if (t !== "ready" && t !== "error" &&
|
|
3831
|
+
if (t !== "ready" && t !== "error" && Co(i, r)) return null;
|
|
3796
3832
|
let a;
|
|
3797
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(
|
|
3833
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(ga, {}), e[0] = a) : a = e[0], a;
|
|
3798
3834
|
}
|
|
3799
|
-
var
|
|
3800
|
-
Root:
|
|
3801
|
-
List:
|
|
3802
|
-
Item:
|
|
3803
|
-
UserBubble:
|
|
3835
|
+
var Ro = {
|
|
3836
|
+
Root: sa,
|
|
3837
|
+
List: ca,
|
|
3838
|
+
Item: la,
|
|
3839
|
+
UserBubble: Ya,
|
|
3804
3840
|
AssistantContent: c(function(e) {
|
|
3805
|
-
let t = O(5), { className: n } = e, r =
|
|
3806
|
-
t[0] === r ? i = t[1] : (i = r.map(
|
|
3841
|
+
let t = O(5), { className: n } = e, r = wo(), i;
|
|
3842
|
+
t[0] === r ? i = t[1] : (i = r.map(zo), t[0] = r, t[1] = i);
|
|
3807
3843
|
let a;
|
|
3808
3844
|
return t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M("div", {
|
|
3809
3845
|
className: n,
|
|
3810
3846
|
children: i
|
|
3811
3847
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
3812
3848
|
}),
|
|
3813
|
-
Actions:
|
|
3814
|
-
CopyAction:
|
|
3815
|
-
RegenerateAction:
|
|
3816
|
-
CopyDebugJsonAction:
|
|
3817
|
-
Thinking:
|
|
3818
|
-
Error:
|
|
3849
|
+
Actions: ta,
|
|
3850
|
+
CopyAction: na,
|
|
3851
|
+
RegenerateAction: ra,
|
|
3852
|
+
CopyDebugJsonAction: ia,
|
|
3853
|
+
Thinking: Lo,
|
|
3854
|
+
Error: oa
|
|
3819
3855
|
};
|
|
3820
|
-
function
|
|
3821
|
-
return e.kind === "group" ? /* @__PURE__ */ N(
|
|
3856
|
+
function zo(e) {
|
|
3857
|
+
return e.kind === "group" ? /* @__PURE__ */ N(Do, {
|
|
3822
3858
|
group: e,
|
|
3823
|
-
children: [/* @__PURE__ */ N(
|
|
3824
|
-
}, e.key) : /* @__PURE__ */ M(
|
|
3859
|
+
children: [/* @__PURE__ */ N(Oo, { children: [/* @__PURE__ */ M(Ao, { children: /* @__PURE__ */ M(jo, {}) }), /* @__PURE__ */ M(Mo, {})] }), /* @__PURE__ */ M(No, {})]
|
|
3860
|
+
}, e.key) : /* @__PURE__ */ M(Po, { item: e }, e.key);
|
|
3825
3861
|
}
|
|
3826
3862
|
//#endregion
|
|
3827
3863
|
//#region src/lib/chat/trajectory/trajectories/messages.tsx
|
|
3828
|
-
function
|
|
3864
|
+
function Bo(e) {
|
|
3829
3865
|
let t = O(8), { message: n, className: r } = e, i;
|
|
3830
3866
|
t[0] === r ? i = t[1] : (i = k("text-destructive/90 bg-destructive/10 flex items-start gap-2 rounded-md px-3 py-2 text-sm", r), t[0] = r, t[1] = i);
|
|
3831
3867
|
let a;
|
|
3832
|
-
t[2] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(
|
|
3868
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(Fe, { className: "text-destructive mt-0.5 size-4 shrink-0" }), t[2] = a) : a = t[2];
|
|
3833
3869
|
let o;
|
|
3834
3870
|
t[3] === n ? o = t[4] : (o = /* @__PURE__ */ M("span", { children: n }), t[3] = n, t[4] = o);
|
|
3835
3871
|
let s;
|
|
@@ -3838,13 +3874,13 @@ function Po(e) {
|
|
|
3838
3874
|
children: [a, o]
|
|
3839
3875
|
}), t[5] = i, t[6] = o, t[7] = s) : s = t[7], s;
|
|
3840
3876
|
}
|
|
3841
|
-
function
|
|
3877
|
+
function Vo(e) {
|
|
3842
3878
|
let t = O(15), { part: n } = e, r = z(), i, a;
|
|
3843
3879
|
if (t[0] !== r.registry || t[1] !== n) {
|
|
3844
3880
|
a = Symbol.for("react.early_return_sentinel");
|
|
3845
3881
|
bb0: {
|
|
3846
|
-
let { toolEntry: e } =
|
|
3847
|
-
if (e &&
|
|
3882
|
+
let { toolEntry: e } = ui(n, r.registry);
|
|
3883
|
+
if (e && di(e, n.state)) {
|
|
3848
3884
|
let t = e.label?.(n);
|
|
3849
3885
|
if (!t) {
|
|
3850
3886
|
a = null;
|
|
@@ -3877,14 +3913,14 @@ function Fo(e) {
|
|
|
3877
3913
|
} else i = t[2], a = t[3];
|
|
3878
3914
|
if (a !== Symbol.for("react.early_return_sentinel")) return a;
|
|
3879
3915
|
let o = i, s;
|
|
3880
|
-
t[4] !== o || t[5] !== n ? (s = o && /* @__PURE__ */ M(
|
|
3916
|
+
t[4] !== o || t[5] !== n ? (s = o && /* @__PURE__ */ M(ki, {
|
|
3881
3917
|
label: o,
|
|
3882
3918
|
part: n
|
|
3883
3919
|
}), t[4] = o, t[5] = n, t[6] = s) : s = t[6];
|
|
3884
3920
|
let c;
|
|
3885
|
-
t[7] === o ? c = t[8] : (c = o?.isError && o.detail && /* @__PURE__ */ M(
|
|
3921
|
+
t[7] === o ? c = t[8] : (c = o?.isError && o.detail && /* @__PURE__ */ M(Bo, { message: o.detail }), t[7] = o, t[8] = c);
|
|
3886
3922
|
let l;
|
|
3887
|
-
t[9] === n ? l = t[10] : (l = /* @__PURE__ */ M(
|
|
3923
|
+
t[9] === n ? l = t[10] : (l = /* @__PURE__ */ M(Ti, { part: n }), t[9] = n, t[10] = l);
|
|
3888
3924
|
let u;
|
|
3889
3925
|
return t[11] !== s || t[12] !== c || t[13] !== l ? (u = /* @__PURE__ */ N(j, { children: [
|
|
3890
3926
|
s,
|
|
@@ -3892,7 +3928,7 @@ function Fo(e) {
|
|
|
3892
3928
|
l
|
|
3893
3929
|
] }), t[11] = s, t[12] = c, t[13] = l, t[14] = u) : u = t[14], u;
|
|
3894
3930
|
}
|
|
3895
|
-
function
|
|
3931
|
+
function Ho(e) {
|
|
3896
3932
|
let t = O(5), { part: n } = e, [r, i] = g(!1), a;
|
|
3897
3933
|
t[0] === n.text ? a = t[1] : (a = /* @__PURE__ */ M(J, {
|
|
3898
3934
|
mode: "static",
|
|
@@ -3902,7 +3938,7 @@ function Io(e) {
|
|
|
3902
3938
|
return t[2] !== r || t[3] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
3903
3939
|
"data-copy-exclude": "assistant-snapshot",
|
|
3904
3940
|
className: "bg-muted/30 prose max-w-auto prose-sm text-muted-foreground border-border mb-4 w-full min-w-full rounded-lg p-3",
|
|
3905
|
-
children: /* @__PURE__ */ M(
|
|
3941
|
+
children: /* @__PURE__ */ M(Fa, {
|
|
3906
3942
|
label: "Reasoning",
|
|
3907
3943
|
open: r,
|
|
3908
3944
|
onOpenChange: i,
|
|
@@ -3913,31 +3949,31 @@ function Io(e) {
|
|
|
3913
3949
|
})
|
|
3914
3950
|
}), t[2] = r, t[3] = a, t[4] = o) : o = t[4], o;
|
|
3915
3951
|
}
|
|
3916
|
-
function
|
|
3917
|
-
let t = O(15), { part: n } = e, { elements: r } = W(), i =
|
|
3952
|
+
function Uo(e) {
|
|
3953
|
+
let t = O(15), { part: n } = e, { elements: r } = W(), i = Ei();
|
|
3918
3954
|
if (n.type === "text") {
|
|
3919
|
-
if (
|
|
3955
|
+
if (Ni(n)) return null;
|
|
3920
3956
|
let e;
|
|
3921
|
-
return t[0] !== r || t[1] !== n.text ? (e = /* @__PURE__ */ M(
|
|
3957
|
+
return t[0] !== r || t[1] !== n.text ? (e = /* @__PURE__ */ M(wi, {
|
|
3922
3958
|
text: n.text,
|
|
3923
3959
|
elements: r
|
|
3924
3960
|
}), t[0] = r, t[1] = n.text, t[2] = e) : e = t[2], e;
|
|
3925
3961
|
}
|
|
3926
3962
|
if (n.type === "dynamic-tool") {
|
|
3927
3963
|
let e;
|
|
3928
|
-
return t[3] !== i || t[4] !== n ? (e = i ? /* @__PURE__ */ M(
|
|
3964
|
+
return t[3] !== i || t[4] !== n ? (e = i ? /* @__PURE__ */ M(Jr, { part: n }) : null, t[3] = i, t[4] = n, t[5] = e) : e = t[5], e;
|
|
3929
3965
|
}
|
|
3930
3966
|
if (S(n)) {
|
|
3931
3967
|
let e;
|
|
3932
|
-
return t[6] === n ? e = t[7] : (e = /* @__PURE__ */ M(
|
|
3968
|
+
return t[6] === n ? e = t[7] : (e = /* @__PURE__ */ M(Vo, { part: n }), t[6] = n, t[7] = e), e;
|
|
3933
3969
|
}
|
|
3934
3970
|
if (n.type === "reasoning" && n.text) {
|
|
3935
3971
|
let e;
|
|
3936
|
-
return t[8] !== i || t[9] !== n ? (e = i ? /* @__PURE__ */ M(
|
|
3972
|
+
return t[8] !== i || t[9] !== n ? (e = i ? /* @__PURE__ */ M(Ho, { part: n }) : null, t[8] = i, t[9] = n, t[10] = e) : e = t[10], e;
|
|
3937
3973
|
}
|
|
3938
3974
|
if (n.type === "file") {
|
|
3939
3975
|
let e;
|
|
3940
|
-
return t[11] !== n.filename || t[12] !== n.mediaType || t[13] !== n.url ? (e = /* @__PURE__ */ M(
|
|
3976
|
+
return t[11] !== n.filename || t[12] !== n.mediaType || t[13] !== n.url ? (e = /* @__PURE__ */ M(Ci, {
|
|
3941
3977
|
filename: n.filename,
|
|
3942
3978
|
mediaType: n.mediaType,
|
|
3943
3979
|
url: n.url
|
|
@@ -3945,13 +3981,13 @@ function Lo(e) {
|
|
|
3945
3981
|
}
|
|
3946
3982
|
return null;
|
|
3947
3983
|
}
|
|
3948
|
-
var
|
|
3984
|
+
var Wo = c(function(e) {
|
|
3949
3985
|
let t = O(10), { className: n } = e, { message: r } = K(), i;
|
|
3950
3986
|
t[0] === n ? i = t[1] : (i = k("flex-1 space-y-3", n), t[0] = n, t[1] = i);
|
|
3951
3987
|
let a;
|
|
3952
3988
|
if (t[2] !== r.id || t[3] !== r.parts) {
|
|
3953
3989
|
let e;
|
|
3954
|
-
t[5] === r.id ? e = t[6] : (e = (e, t) => /* @__PURE__ */ M(
|
|
3990
|
+
t[5] === r.id ? e = t[6] : (e = (e, t) => /* @__PURE__ */ M(Uo, { part: e }, `${r.id}-${t}`), t[5] = r.id, t[6] = e), a = r.parts.map(e), t[2] = r.id, t[3] = r.parts, t[4] = a;
|
|
3955
3991
|
} else a = t[4];
|
|
3956
3992
|
let o;
|
|
3957
3993
|
return t[7] !== i || t[8] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
@@ -3959,9 +3995,9 @@ var Ro = c(function(e) {
|
|
|
3959
3995
|
children: a
|
|
3960
3996
|
}), t[7] = i, t[8] = a, t[9] = o) : o = t[9], o;
|
|
3961
3997
|
});
|
|
3962
|
-
function
|
|
3998
|
+
function Go(e) {
|
|
3963
3999
|
let t = O(9), { className: n, label: r } = e, i;
|
|
3964
|
-
t[0] === r ? i = t[1] : (i = r && r.split("\n").filter(
|
|
4000
|
+
t[0] === r ? i = t[1] : (i = r && r.split("\n").filter(Ko).pop() || "Thinking...", t[0] = r, t[1] = i);
|
|
3965
4001
|
let a = i, o;
|
|
3966
4002
|
t[2] === n ? o = t[3] : (o = k("flex items-start", n), t[2] = n, t[3] = o);
|
|
3967
4003
|
let s;
|
|
@@ -3976,33 +4012,33 @@ function zo(e) {
|
|
|
3976
4012
|
children: s
|
|
3977
4013
|
}), t[6] = o, t[7] = s, t[8] = c) : c = t[8], c;
|
|
3978
4014
|
}
|
|
3979
|
-
function
|
|
4015
|
+
function Ko(e) {
|
|
3980
4016
|
return e.trim();
|
|
3981
4017
|
}
|
|
3982
|
-
function
|
|
4018
|
+
function qo() {
|
|
3983
4019
|
let e = O(5), t = G(), { messages: n } = W(), r = n[n.length - 1], i;
|
|
3984
|
-
e[0] !== t || e[1] !== r ? (i =
|
|
4020
|
+
e[0] !== t || e[1] !== r ? (i = pa(t, r), e[0] = t, e[1] = r, e[2] = i) : i = e[2];
|
|
3985
4021
|
let a = i;
|
|
3986
4022
|
if (!a) return null;
|
|
3987
4023
|
let o;
|
|
3988
|
-
return e[3] === a ? o = e[4] : (o = /* @__PURE__ */ M(
|
|
4024
|
+
return e[3] === a ? o = e[4] : (o = /* @__PURE__ */ M(Go, {
|
|
3989
4025
|
label: a,
|
|
3990
4026
|
className: "mt-2"
|
|
3991
4027
|
}), e[3] = a, e[4] = o), o;
|
|
3992
4028
|
}
|
|
3993
|
-
var
|
|
3994
|
-
Root:
|
|
3995
|
-
List:
|
|
3996
|
-
Item:
|
|
3997
|
-
UserBubble:
|
|
3998
|
-
AssistantContent:
|
|
3999
|
-
Thinking:
|
|
4000
|
-
Error:
|
|
4001
|
-
Actions:
|
|
4002
|
-
CopyAction:
|
|
4003
|
-
RegenerateAction:
|
|
4004
|
-
CopyDebugJsonAction:
|
|
4005
|
-
},
|
|
4029
|
+
var Jo = {
|
|
4030
|
+
Root: sa,
|
|
4031
|
+
List: ca,
|
|
4032
|
+
Item: la,
|
|
4033
|
+
UserBubble: Ya,
|
|
4034
|
+
AssistantContent: Wo,
|
|
4035
|
+
Thinking: qo,
|
|
4036
|
+
Error: oa,
|
|
4037
|
+
Actions: ta,
|
|
4038
|
+
CopyAction: na,
|
|
4039
|
+
RegenerateAction: ra,
|
|
4040
|
+
CopyDebugJsonAction: ia
|
|
4041
|
+
}, Yo = {
|
|
4006
4042
|
braille: {
|
|
4007
4043
|
frames: [
|
|
4008
4044
|
"⠋",
|
|
@@ -4069,10 +4105,10 @@ var Ho = {
|
|
|
4069
4105
|
interval: 100
|
|
4070
4106
|
}
|
|
4071
4107
|
};
|
|
4072
|
-
function
|
|
4108
|
+
function Xo(e) {
|
|
4073
4109
|
let t = O(15), n, r, i;
|
|
4074
4110
|
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({className: n, variant: i, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
4075
|
-
let a = i === void 0 ? "braille" : i, o =
|
|
4111
|
+
let a = i === void 0 ? "braille" : i, o = St(), { frames: s, interval: c } = Yo[a], [l, u] = g(0), f, p;
|
|
4076
4112
|
t[4] !== o || t[5] !== s.length || t[6] !== c ? (f = () => {
|
|
4077
4113
|
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
4078
4114
|
let e = o.setInterval(() => {
|
|
@@ -4097,9 +4133,9 @@ function Wo(e) {
|
|
|
4097
4133
|
}
|
|
4098
4134
|
//#endregion
|
|
4099
4135
|
//#region src/lib/chat/trajectory/trajectories/timeline.tsx
|
|
4100
|
-
function
|
|
4136
|
+
function Zo(e) {
|
|
4101
4137
|
let t = O(11), { Icon: n, isLast: r, isLoading: i, aborted: a, state: o, isError: s } = e, c;
|
|
4102
|
-
t[0] !== n || t[1] !== a || t[2] !== s || t[3] !== i || t[4] !== o ? (c = i ? /* @__PURE__ */ M(
|
|
4138
|
+
t[0] !== n || t[1] !== a || t[2] !== s || t[3] !== i || t[4] !== o ? (c = i ? /* @__PURE__ */ M(Xo, { className: "text-muted-foreground z-10 shrink-0 text-sm" }) : a ? /* @__PURE__ */ M(Ie, { className: "text-destructive z-10 size-3.5 shrink-0" }) : /* @__PURE__ */ M(n, { className: k("z-10 size-3.5 shrink-0", o === "output-error" || s ? "text-destructive" : "text-muted-foreground") }), t[0] = n, t[1] = a, t[2] = s, t[3] = i, t[4] = o, t[5] = c) : c = t[5];
|
|
4103
4139
|
let l;
|
|
4104
4140
|
t[6] === r ? l = t[7] : (l = !r && /* @__PURE__ */ M("span", { className: "bg-border w-px flex-1" }), t[6] = r, t[7] = l);
|
|
4105
4141
|
let u;
|
|
@@ -4108,16 +4144,16 @@ function Go(e) {
|
|
|
4108
4144
|
children: [c, l]
|
|
4109
4145
|
}), t[8] = c, t[9] = l, t[10] = u) : u = t[10], u;
|
|
4110
4146
|
}
|
|
4111
|
-
function
|
|
4112
|
-
let t = O(15), { isLast: n, label: r, state: i, aborted: a, children: o } = e, s = l(
|
|
4113
|
-
t[0] !== f || t[1] !== d || t[2] !== c?.isError || t[3] !== u || t[4] !== n || t[5] !== p ? (m = f ? /* @__PURE__ */ M(
|
|
4147
|
+
function Qo(e) {
|
|
4148
|
+
let t = O(15), { isLast: n, label: r, state: i, aborted: a, children: o } = e, s = l(Bi), c = r ?? s?.label, u = i ?? s?.state, d = a ?? s?.aborted ?? !1, f = c?.icon, p = !!u && !d && u !== "output-available" && u !== "output-error", m;
|
|
4149
|
+
t[0] !== f || t[1] !== d || t[2] !== c?.isError || t[3] !== u || t[4] !== n || t[5] !== p ? (m = f ? /* @__PURE__ */ M(Zo, {
|
|
4114
4150
|
Icon: f,
|
|
4115
4151
|
isLast: n,
|
|
4116
4152
|
isLoading: p,
|
|
4117
4153
|
aborted: d,
|
|
4118
4154
|
state: u,
|
|
4119
4155
|
isError: c?.isError ?? !1
|
|
4120
|
-
}) : /* @__PURE__ */ M(
|
|
4156
|
+
}) : /* @__PURE__ */ M(ma, { isLast: n }), t[0] = f, t[1] = d, t[2] = c?.isError, t[3] = u, t[4] = n, t[5] = p, t[6] = m) : m = t[6];
|
|
4121
4157
|
let h = m, g = n ? "" : "pb-3.5", _;
|
|
4122
4158
|
t[7] === g ? _ = t[8] : (_ = k("min-w-0 flex-1", g), t[7] = g, t[8] = _);
|
|
4123
4159
|
let v;
|
|
@@ -4126,16 +4162,16 @@ function Ko(e) {
|
|
|
4126
4162
|
children: o
|
|
4127
4163
|
}), t[9] = o, t[10] = _, t[11] = v) : v = t[11];
|
|
4128
4164
|
let y;
|
|
4129
|
-
return t[12] !== h || t[13] !== v ? (y = /* @__PURE__ */ M(
|
|
4165
|
+
return t[12] !== h || t[13] !== v ? (y = /* @__PURE__ */ M(ha, {
|
|
4130
4166
|
marker: h,
|
|
4131
4167
|
children: v
|
|
4132
4168
|
}), t[12] = h, t[13] = v, t[14] = y) : y = t[14], y;
|
|
4133
4169
|
}
|
|
4134
|
-
function
|
|
4170
|
+
function $o(e) {
|
|
4135
4171
|
let t = O(10), { label: n, state: r, part: i, defaultOpen: a, children: o } = e, s = a !== void 0 && a, c;
|
|
4136
4172
|
t[0] !== n || t[1] !== i || t[2] !== r ? (c = /* @__PURE__ */ M(L, {
|
|
4137
4173
|
className: "cursor-pointer",
|
|
4138
|
-
children: /* @__PURE__ */ M(
|
|
4174
|
+
children: /* @__PURE__ */ M(ji, {
|
|
4139
4175
|
label: n,
|
|
4140
4176
|
state: r,
|
|
4141
4177
|
part: i
|
|
@@ -4150,17 +4186,17 @@ function qo(e) {
|
|
|
4150
4186
|
children: [c, l]
|
|
4151
4187
|
}), t[6] = s, t[7] = c, t[8] = l, t[9] = u) : u = t[9], u;
|
|
4152
4188
|
}
|
|
4153
|
-
var
|
|
4154
|
-
Item:
|
|
4155
|
-
Disclosure:
|
|
4156
|
-
},
|
|
4157
|
-
Root:
|
|
4158
|
-
List:
|
|
4159
|
-
Item:
|
|
4160
|
-
UserBubble:
|
|
4189
|
+
var es = {
|
|
4190
|
+
Item: Qo,
|
|
4191
|
+
Disclosure: $o
|
|
4192
|
+
}, ts = {
|
|
4193
|
+
Root: sa,
|
|
4194
|
+
List: ca,
|
|
4195
|
+
Item: la,
|
|
4196
|
+
UserBubble: Ya,
|
|
4161
4197
|
AssistantContent: c(function(e) {
|
|
4162
|
-
let t = O(12), { className: n } = e, { message: r } = K(), { elements: i } = W(), { debugMode: a } = z(), o =
|
|
4163
|
-
t[0] === r.parts ? c = t[1] : (c =
|
|
4198
|
+
let t = O(12), { className: n } = e, { message: r } = K(), { elements: i } = W(), { debugMode: a } = z(), o = Ei(), s = Y(), c;
|
|
4199
|
+
t[0] === r.parts ? c = t[1] : (c = Ji(r.parts), t[0] = r.parts, t[1] = c);
|
|
4164
4200
|
let l = c, u;
|
|
4165
4201
|
t[2] !== a || t[3] !== i || t[4] !== s || t[5] !== r.id || t[6] !== l || t[7] !== o ? (u = l.map((e, t) => {
|
|
4166
4202
|
let n = `${r.id}-${Z(e, t)}-${e.kind}`;
|
|
@@ -4173,33 +4209,33 @@ var Jo = {
|
|
|
4173
4209
|
if (e.kind === "source") return /* @__PURE__ */ M(X.Source, { segment: e }, n);
|
|
4174
4210
|
if (e.kind === "dynamic-tool") {
|
|
4175
4211
|
if (!o) return null;
|
|
4176
|
-
let r = !
|
|
4177
|
-
return /* @__PURE__ */ M(
|
|
4212
|
+
let r = !qi(l, t, !0);
|
|
4213
|
+
return /* @__PURE__ */ M(es.Item, {
|
|
4178
4214
|
isLast: r,
|
|
4179
4215
|
children: /* @__PURE__ */ M(X.DynamicTool, { segment: e })
|
|
4180
4216
|
}, n);
|
|
4181
4217
|
}
|
|
4182
4218
|
if (e.kind === "reasoning") {
|
|
4183
4219
|
if (s || e.part.type !== "reasoning") return null;
|
|
4184
|
-
let r = !
|
|
4220
|
+
let r = !qi(l, t, a), i = {
|
|
4185
4221
|
name: "Reasoning",
|
|
4186
|
-
icon:
|
|
4222
|
+
icon: Je,
|
|
4187
4223
|
args: { text: [...e.part.text].slice(0, 60).join("") }
|
|
4188
4224
|
};
|
|
4189
|
-
return /* @__PURE__ */ M(
|
|
4225
|
+
return /* @__PURE__ */ M(es.Item, {
|
|
4190
4226
|
isLast: r,
|
|
4191
4227
|
label: i,
|
|
4192
|
-
children: /* @__PURE__ */ M(
|
|
4228
|
+
children: /* @__PURE__ */ M(es.Disclosure, {
|
|
4193
4229
|
label: i,
|
|
4194
4230
|
children: /* @__PURE__ */ M(X.Reasoning, { segment: e })
|
|
4195
4231
|
})
|
|
4196
4232
|
}, n);
|
|
4197
4233
|
}
|
|
4198
4234
|
if (e.kind === "tool") {
|
|
4199
|
-
let r = !
|
|
4235
|
+
let r = !qi(l, t, a);
|
|
4200
4236
|
return /* @__PURE__ */ M(X.Tool, {
|
|
4201
4237
|
segment: e,
|
|
4202
|
-
children: /* @__PURE__ */ M(
|
|
4238
|
+
children: /* @__PURE__ */ M(es.Item, {
|
|
4203
4239
|
isLast: r,
|
|
4204
4240
|
children: /* @__PURE__ */ M(X.ToolDisclosure, {})
|
|
4205
4241
|
})
|
|
@@ -4213,16 +4249,16 @@ var Jo = {
|
|
|
4213
4249
|
children: u
|
|
4214
4250
|
}), t[9] = n, t[10] = u, t[11] = d) : d = t[11], d;
|
|
4215
4251
|
}),
|
|
4216
|
-
Actions:
|
|
4217
|
-
CopyAction:
|
|
4218
|
-
RegenerateAction:
|
|
4219
|
-
CopyDebugJsonAction:
|
|
4220
|
-
Thinking:
|
|
4221
|
-
Error:
|
|
4252
|
+
Actions: ta,
|
|
4253
|
+
CopyAction: na,
|
|
4254
|
+
RegenerateAction: ra,
|
|
4255
|
+
CopyDebugJsonAction: ia,
|
|
4256
|
+
Thinking: ga,
|
|
4257
|
+
Error: oa
|
|
4222
4258
|
};
|
|
4223
4259
|
//#endregion
|
|
4224
4260
|
//#region src/lib/components/ChatComposer.tsx
|
|
4225
|
-
function
|
|
4261
|
+
function ns(e) {
|
|
4226
4262
|
let t = O(9), n, r;
|
|
4227
4263
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4228
4264
|
let { hasSubmitted: i } = V(), a;
|
|
@@ -4234,7 +4270,7 @@ function Xo(e) {
|
|
|
4234
4270
|
...r
|
|
4235
4271
|
}), t[5] = i, t[6] = r, t[7] = a, t[8] = o) : o = t[8], o;
|
|
4236
4272
|
}
|
|
4237
|
-
function
|
|
4273
|
+
function rs(e) {
|
|
4238
4274
|
let t = O(8), n, r;
|
|
4239
4275
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4240
4276
|
let i;
|
|
@@ -4245,7 +4281,7 @@ function Zo(e) {
|
|
|
4245
4281
|
...r
|
|
4246
4282
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4247
4283
|
}
|
|
4248
|
-
function
|
|
4284
|
+
function is(e) {
|
|
4249
4285
|
let t = O(8), n, r;
|
|
4250
4286
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4251
4287
|
let i;
|
|
@@ -4256,7 +4292,7 @@ function Qo(e) {
|
|
|
4256
4292
|
...r
|
|
4257
4293
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4258
4294
|
}
|
|
4259
|
-
function
|
|
4295
|
+
function as(e) {
|
|
4260
4296
|
let t = O(8), n, r;
|
|
4261
4297
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4262
4298
|
let i;
|
|
@@ -4267,7 +4303,7 @@ function $o(e) {
|
|
|
4267
4303
|
...r
|
|
4268
4304
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4269
4305
|
}
|
|
4270
|
-
function
|
|
4306
|
+
function os(e) {
|
|
4271
4307
|
let t = O(8), n, r;
|
|
4272
4308
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4273
4309
|
let i;
|
|
@@ -4278,7 +4314,7 @@ function es(e) {
|
|
|
4278
4314
|
...r
|
|
4279
4315
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4280
4316
|
}
|
|
4281
|
-
function
|
|
4317
|
+
function ss(e) {
|
|
4282
4318
|
let t = O(8), n, r;
|
|
4283
4319
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4284
4320
|
let i;
|
|
@@ -4289,9 +4325,9 @@ function ts(e) {
|
|
|
4289
4325
|
...r
|
|
4290
4326
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4291
4327
|
}
|
|
4292
|
-
function
|
|
4328
|
+
function cs(e) {
|
|
4293
4329
|
let t = O(3), n;
|
|
4294
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ M(Q, { icon: /* @__PURE__ */ M(
|
|
4330
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ M(Q, { icon: /* @__PURE__ */ M($e, { className: "size-4" }) }), t[0] = n) : n = t[0];
|
|
4295
4331
|
let r;
|
|
4296
4332
|
return t[1] === e ? r = t[2] : (r = /* @__PURE__ */ M(R.AttachFiles, {
|
|
4297
4333
|
"aria-label": "Attach files",
|
|
@@ -4299,9 +4335,9 @@ function ns(e) {
|
|
|
4299
4335
|
...e
|
|
4300
4336
|
}), t[1] = e, t[2] = r), r;
|
|
4301
4337
|
}
|
|
4302
|
-
function
|
|
4303
|
-
let e = O(6), { actions: t, meta: n } =
|
|
4304
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ M(
|
|
4338
|
+
function ls() {
|
|
4339
|
+
let e = O(6), { actions: t, meta: n } = Tt("ChatComposer.CommandButton"), r;
|
|
4340
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ M(et, { className: "size-4" }), e[0] = r) : r = e[0];
|
|
4305
4341
|
let i = n.activePopup?.trigger === "/", a;
|
|
4306
4342
|
e[1] === t ? a = e[2] : (a = (e) => {
|
|
4307
4343
|
e.stopPropagation(), t.toggleSlashMenu();
|
|
@@ -4315,7 +4351,7 @@ function rs() {
|
|
|
4315
4351
|
onClick: a
|
|
4316
4352
|
}), e[3] = i, e[4] = a, e[5] = o) : o = e[5], o;
|
|
4317
4353
|
}
|
|
4318
|
-
function
|
|
4354
|
+
function us(e) {
|
|
4319
4355
|
switch (e) {
|
|
4320
4356
|
case "permission-denied": return "Allow microphone access to use dictation";
|
|
4321
4357
|
case "no-microphone": return "Connect a microphone to use dictation";
|
|
@@ -4324,31 +4360,31 @@ function is(e) {
|
|
|
4324
4360
|
case "transcription-failed": return "Unable to transcribe audio";
|
|
4325
4361
|
}
|
|
4326
4362
|
}
|
|
4327
|
-
function
|
|
4363
|
+
function ds(e) {
|
|
4328
4364
|
switch (e.status) {
|
|
4329
4365
|
case "unavailable": return e.reason === "blocked" ? "Allow microphone access in your browser settings to use dictation" : "Dictation is not available in this browser";
|
|
4330
4366
|
case "idle": return "Start dictation";
|
|
4331
4367
|
case "starting": return "Starting dictation";
|
|
4332
4368
|
case "recording": return "Stop dictation";
|
|
4333
4369
|
case "finishing": return "Transcribing…";
|
|
4334
|
-
case "failed": return
|
|
4370
|
+
case "failed": return us(e.error.code);
|
|
4335
4371
|
}
|
|
4336
4372
|
}
|
|
4337
|
-
function
|
|
4373
|
+
function fs(e) {
|
|
4338
4374
|
switch (e.status) {
|
|
4339
|
-
case "recording": return /* @__PURE__ */ M(
|
|
4375
|
+
case "recording": return /* @__PURE__ */ M(nt, { className: "size-4 fill-current" });
|
|
4340
4376
|
case "starting":
|
|
4341
|
-
case "finishing": return /* @__PURE__ */ M(
|
|
4377
|
+
case "finishing": return /* @__PURE__ */ M(Ze, { className: "size-4 animate-spin" });
|
|
4342
4378
|
case "unavailable":
|
|
4343
4379
|
case "idle":
|
|
4344
|
-
case "failed": return /* @__PURE__ */ M(
|
|
4380
|
+
case "failed": return /* @__PURE__ */ M(Qe, { className: "size-4" });
|
|
4345
4381
|
}
|
|
4346
4382
|
}
|
|
4347
|
-
function
|
|
4348
|
-
let e = O(20), { status: t } = B(), { state: n } =
|
|
4349
|
-
e[0] === n ? r = e[1] : (r =
|
|
4383
|
+
function ps() {
|
|
4384
|
+
let e = O(20), { status: t } = B(), { state: n } = Et("ChatComposer.Dictate"), r;
|
|
4385
|
+
e[0] === n ? r = e[1] : (r = ds(n), e[0] = n, e[1] = r);
|
|
4350
4386
|
let i = r, a = n.status === "starting" || n.status === "recording" || n.status === "finishing", o = t === "streaming" || t === "submitted", s;
|
|
4351
|
-
e[2] === n ? s = e[3] : (s =
|
|
4387
|
+
e[2] === n ? s = e[3] : (s = fs(n), e[2] = n, e[3] = s);
|
|
4352
4388
|
let c;
|
|
4353
4389
|
e[4] !== i || e[5] !== s ? (c = /* @__PURE__ */ M(Q, {
|
|
4354
4390
|
icon: s,
|
|
@@ -4362,7 +4398,7 @@ function ss() {
|
|
|
4362
4398
|
}), e[7] = o, e[8] = c, e[9] = l) : l = e[9];
|
|
4363
4399
|
let u;
|
|
4364
4400
|
e[10] !== a || e[11] !== n.status ? (u = a ? /* @__PURE__ */ M(R.CancelDictation, { render: /* @__PURE__ */ M(Q, {
|
|
4365
|
-
icon: /* @__PURE__ */ M(
|
|
4401
|
+
icon: /* @__PURE__ */ M(ot, { className: "size-4" }),
|
|
4366
4402
|
"aria-label": n.status === "finishing" ? "Cancel transcription" : "Cancel dictation"
|
|
4367
4403
|
}) }) : null, e[10] = a, e[11] = n.status, e[12] = u) : u = e[12];
|
|
4368
4404
|
let d;
|
|
@@ -4378,22 +4414,22 @@ function ss() {
|
|
|
4378
4414
|
d
|
|
4379
4415
|
] }), e[16] = l, e[17] = u, e[18] = d, e[19] = f) : f = e[19], f;
|
|
4380
4416
|
}
|
|
4381
|
-
var
|
|
4382
|
-
Provider:
|
|
4383
|
-
Root:
|
|
4417
|
+
var ms = {
|
|
4418
|
+
Provider: ns,
|
|
4419
|
+
Root: rs,
|
|
4384
4420
|
Popup: R.Popup,
|
|
4385
|
-
Content:
|
|
4386
|
-
Attachments:
|
|
4387
|
-
Editor:
|
|
4421
|
+
Content: is,
|
|
4422
|
+
Attachments: os,
|
|
4423
|
+
Editor: as,
|
|
4388
4424
|
Error: R.Error,
|
|
4389
|
-
Toolbar:
|
|
4390
|
-
CommandButton:
|
|
4391
|
-
AttachFiles:
|
|
4392
|
-
Dictate:
|
|
4425
|
+
Toolbar: ss,
|
|
4426
|
+
CommandButton: ls,
|
|
4427
|
+
AttachFiles: cs,
|
|
4428
|
+
Dictate: ps
|
|
4393
4429
|
};
|
|
4394
4430
|
//#endregion
|
|
4395
4431
|
//#region src/lib/components/ChatTextarea.tsx
|
|
4396
|
-
function
|
|
4432
|
+
function hs(e) {
|
|
4397
4433
|
let t = O(10), n, r, i;
|
|
4398
4434
|
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({className: n, ref: i, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
4399
4435
|
let a;
|
|
@@ -4410,7 +4446,7 @@ function ls(e) {
|
|
|
4410
4446
|
}
|
|
4411
4447
|
//#endregion
|
|
4412
4448
|
//#region src/lib/components/queue.tsx
|
|
4413
|
-
function
|
|
4449
|
+
function gs(e) {
|
|
4414
4450
|
let t = O(5), { children: n, className: r } = e, i;
|
|
4415
4451
|
t[0] === r ? i = t[1] : (i = k("border-border flex flex-col border-b px-2 py-1.5", r), t[0] = r, t[1] = i);
|
|
4416
4452
|
let a;
|
|
@@ -4419,7 +4455,7 @@ function us(e) {
|
|
|
4419
4455
|
children: n
|
|
4420
4456
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
4421
4457
|
}
|
|
4422
|
-
function
|
|
4458
|
+
function _s(e) {
|
|
4423
4459
|
let t = O(5), { children: n, className: r } = e, i;
|
|
4424
4460
|
t[0] === r ? i = t[1] : (i = k("flex items-center gap-2 px-2 py-1.5", r), t[0] = r, t[1] = i);
|
|
4425
4461
|
let a;
|
|
@@ -4428,28 +4464,28 @@ function ds(e) {
|
|
|
4428
4464
|
children: n
|
|
4429
4465
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
4430
4466
|
}
|
|
4431
|
-
function
|
|
4467
|
+
function vs(e) {
|
|
4432
4468
|
let t = O(4), { className: n } = e, r;
|
|
4433
4469
|
t[0] === n ? r = t[1] : (r = k("text-muted-foreground size-3.5 shrink-0", n), t[0] = n, t[1] = r);
|
|
4434
4470
|
let i;
|
|
4435
|
-
return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ M(
|
|
4471
|
+
return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ M(Ye, { className: r }), t[2] = r, t[3] = i), i;
|
|
4436
4472
|
}
|
|
4437
|
-
function
|
|
4473
|
+
function ys(e) {
|
|
4438
4474
|
let t = O(7), { children: n, className: r } = e, i;
|
|
4439
4475
|
t[0] === r ? i = t[1] : (i = k("min-w-0 flex-1 truncate text-sm", r), t[0] = r, t[1] = i);
|
|
4440
4476
|
let a;
|
|
4441
|
-
t[2] === n ? a = t[3] : (a = typeof n == "string" ? /* @__PURE__ */ M(
|
|
4477
|
+
t[2] === n ? a = t[3] : (a = typeof n == "string" ? /* @__PURE__ */ M(wt, { text: n }) : n, t[2] = n, t[3] = a);
|
|
4442
4478
|
let o;
|
|
4443
4479
|
return t[4] !== i || t[5] !== a ? (o = /* @__PURE__ */ M("span", {
|
|
4444
4480
|
className: i,
|
|
4445
4481
|
children: a
|
|
4446
4482
|
}), t[4] = i, t[5] = a, t[6] = o) : o = t[6], o;
|
|
4447
4483
|
}
|
|
4448
|
-
function
|
|
4484
|
+
function bs(e) {
|
|
4449
4485
|
let t = O(6), { onClick: n, className: r } = e, i;
|
|
4450
4486
|
t[0] === r ? i = t[1] : (i = k("text-muted-foreground hover:text-foreground shrink-0 rounded p-1 transition-colors", r), t[0] = r, t[1] = i);
|
|
4451
4487
|
let a;
|
|
4452
|
-
t[2] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(
|
|
4488
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(rt, { className: "size-3.5" }), t[2] = a) : a = t[2];
|
|
4453
4489
|
let o;
|
|
4454
4490
|
return t[3] !== n || t[4] !== i ? (o = /* @__PURE__ */ M("button", {
|
|
4455
4491
|
type: "button",
|
|
@@ -4459,13 +4495,13 @@ function ms(e) {
|
|
|
4459
4495
|
children: a
|
|
4460
4496
|
}), t[3] = n, t[4] = i, t[5] = o) : o = t[5], o;
|
|
4461
4497
|
}
|
|
4462
|
-
var
|
|
4463
|
-
Root:
|
|
4464
|
-
Item:
|
|
4465
|
-
Icon:
|
|
4466
|
-
Text:
|
|
4467
|
-
Remove:
|
|
4468
|
-
},
|
|
4498
|
+
var xs = {
|
|
4499
|
+
Root: gs,
|
|
4500
|
+
Item: _s,
|
|
4501
|
+
Icon: vs,
|
|
4502
|
+
Text: ys,
|
|
4503
|
+
Remove: bs
|
|
4504
|
+
}, Ss = {
|
|
4469
4505
|
normal: {
|
|
4470
4506
|
d: "m5 12 7-7 7 7",
|
|
4471
4507
|
translateY: 0
|
|
@@ -4479,7 +4515,7 @@ var hs = {
|
|
|
4479
4515
|
],
|
|
4480
4516
|
transition: { duration: .4 }
|
|
4481
4517
|
}
|
|
4482
|
-
},
|
|
4518
|
+
}, Cs = {
|
|
4483
4519
|
normal: { d: "M12 19V5" },
|
|
4484
4520
|
animate: {
|
|
4485
4521
|
d: [
|
|
@@ -4489,7 +4525,7 @@ var hs = {
|
|
|
4489
4525
|
],
|
|
4490
4526
|
transition: { duration: .4 }
|
|
4491
4527
|
}
|
|
4492
|
-
},
|
|
4528
|
+
}, ws = (e) => {
|
|
4493
4529
|
let t = O(30), n, r, i, a, o, s;
|
|
4494
4530
|
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4], o = t[5], s = t[6]) : ({ref: o, onMouseEnter: r, onMouseLeave: i, className: n, size: s, ...a} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = o, t[6] = s);
|
|
4495
4531
|
let c = s === void 0 ? 20 : s, l = ne(), u = h(!1), d;
|
|
@@ -4511,11 +4547,11 @@ var hs = {
|
|
|
4511
4547
|
t[17] === l ? (y = t[18], b = t[19]) : (y = /* @__PURE__ */ M(A.path, {
|
|
4512
4548
|
animate: l,
|
|
4513
4549
|
d: "m5 12 7-7 7 7",
|
|
4514
|
-
variants:
|
|
4550
|
+
variants: Ss
|
|
4515
4551
|
}), b = /* @__PURE__ */ M(A.path, {
|
|
4516
4552
|
animate: l,
|
|
4517
4553
|
d: "M12 19V5",
|
|
4518
|
-
variants:
|
|
4554
|
+
variants: Cs
|
|
4519
4555
|
}), t[17] = l, t[18] = y, t[19] = b);
|
|
4520
4556
|
let x;
|
|
4521
4557
|
t[20] !== c || t[21] !== y || t[22] !== b ? (x = /* @__PURE__ */ N("svg", {
|
|
@@ -4539,10 +4575,10 @@ var hs = {
|
|
|
4539
4575
|
children: x
|
|
4540
4576
|
}), t[24] = m, t[25] = _, t[26] = a, t[27] = v, t[28] = x, t[29] = S) : S = t[29], S;
|
|
4541
4577
|
};
|
|
4542
|
-
|
|
4578
|
+
ws.displayName = "ArrowUpIcon";
|
|
4543
4579
|
//#endregion
|
|
4544
4580
|
//#region src/lib/components/SubmitButton.tsx
|
|
4545
|
-
var
|
|
4581
|
+
var Ts = {
|
|
4546
4582
|
duration: .15,
|
|
4547
4583
|
ease: [
|
|
4548
4584
|
0,
|
|
@@ -4550,7 +4586,7 @@ var ys = {
|
|
|
4550
4586
|
.2,
|
|
4551
4587
|
1
|
|
4552
4588
|
]
|
|
4553
|
-
},
|
|
4589
|
+
}, Es = {
|
|
4554
4590
|
duration: .12,
|
|
4555
4591
|
ease: [
|
|
4556
4592
|
0,
|
|
@@ -4559,7 +4595,7 @@ var ys = {
|
|
|
4559
4595
|
1
|
|
4560
4596
|
]
|
|
4561
4597
|
};
|
|
4562
|
-
function
|
|
4598
|
+
function Ds(e) {
|
|
4563
4599
|
let t = O(40), n, r, i, a;
|
|
4564
4600
|
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4]) : ({variant: a, className: n, disabled: r, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a);
|
|
4565
4601
|
let o = re(), s = a === "stop", c;
|
|
@@ -4599,7 +4635,7 @@ function xs(e) {
|
|
|
4599
4635
|
scale: .7
|
|
4600
4636
|
}, t[21] = o, t[22] = v);
|
|
4601
4637
|
let y;
|
|
4602
|
-
t[23] === s ? y = t[24] : (y = M(s ?
|
|
4638
|
+
t[23] === s ? y = t[24] : (y = M(s ? As : ks, {}), t[23] = s, t[24] = y);
|
|
4603
4639
|
let b;
|
|
4604
4640
|
t[25] !== v || t[26] !== y || t[27] !== h || t[28] !== g ? (b = /* @__PURE__ */ M(te, {
|
|
4605
4641
|
initial: !1,
|
|
@@ -4607,7 +4643,7 @@ function xs(e) {
|
|
|
4607
4643
|
initial: g,
|
|
4608
4644
|
animate: _,
|
|
4609
4645
|
exit: v,
|
|
4610
|
-
transition:
|
|
4646
|
+
transition: Es,
|
|
4611
4647
|
className: "absolute flex items-center justify-center",
|
|
4612
4648
|
children: y
|
|
4613
4649
|
}, h)
|
|
@@ -4617,7 +4653,7 @@ function xs(e) {
|
|
|
4617
4653
|
initial: c,
|
|
4618
4654
|
animate: l,
|
|
4619
4655
|
exit: u,
|
|
4620
|
-
transition:
|
|
4656
|
+
transition: Ts,
|
|
4621
4657
|
whileHover: d,
|
|
4622
4658
|
whileTap: f,
|
|
4623
4659
|
"aria-label": p,
|
|
@@ -4627,7 +4663,7 @@ function xs(e) {
|
|
|
4627
4663
|
children: b
|
|
4628
4664
|
}), t[30] = r, t[31] = i, t[32] = c, t[33] = b, t[34] = u, t[35] = d, t[36] = f, t[37] = p, t[38] = m, t[39] = x) : x = t[39], x;
|
|
4629
4665
|
}
|
|
4630
|
-
function
|
|
4666
|
+
function Os(e) {
|
|
4631
4667
|
let t = O(2), { children: n } = e, r;
|
|
4632
4668
|
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M("svg", {
|
|
4633
4669
|
width: "20",
|
|
@@ -4638,13 +4674,13 @@ function Ss(e) {
|
|
|
4638
4674
|
children: n
|
|
4639
4675
|
}), t[0] = n, t[1] = r), r;
|
|
4640
4676
|
}
|
|
4641
|
-
function
|
|
4677
|
+
function ks() {
|
|
4642
4678
|
let e = O(1), t;
|
|
4643
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
4679
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(ws, {}), e[0] = t) : t = e[0], t;
|
|
4644
4680
|
}
|
|
4645
|
-
function
|
|
4681
|
+
function As() {
|
|
4646
4682
|
let e = O(1), t;
|
|
4647
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
4683
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(Os, { children: /* @__PURE__ */ M("rect", {
|
|
4648
4684
|
x: "5",
|
|
4649
4685
|
y: "5",
|
|
4650
4686
|
width: "10",
|
|
@@ -4654,18 +4690,18 @@ function ws() {
|
|
|
4654
4690
|
}
|
|
4655
4691
|
//#endregion
|
|
4656
4692
|
//#region src/lib/components/tool-error.tsx
|
|
4657
|
-
function
|
|
4693
|
+
function js(e) {
|
|
4658
4694
|
let t = O(25), { title: n, detail: r, detailLabel: i, part: a, error: o } = e, s = n === void 0 ? "Failed to render tool" : n, c = i === void 0 ? "View details" : i, l = H(), u;
|
|
4659
|
-
t[0] === o.issues ? u = t[1] : (u = o.issues.map(
|
|
4695
|
+
t[0] === o.issues ? u = t[1] : (u = o.issues.map(Ms).join("\n"), t[0] = o.issues, t[1] = u);
|
|
4660
4696
|
let d = u, f;
|
|
4661
|
-
t[2] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(
|
|
4697
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(Fe, { className: "size-5" }), t[2] = f) : f = t[2];
|
|
4662
4698
|
let p;
|
|
4663
4699
|
t[3] === s ? p = t[4] : (p = /* @__PURE__ */ M(xe, { children: /* @__PURE__ */ N(Se, {
|
|
4664
4700
|
className: "text-destructive flex items-center gap-2",
|
|
4665
4701
|
children: [f, s]
|
|
4666
4702
|
}) }), t[3] = s, t[4] = p);
|
|
4667
4703
|
let m, h;
|
|
4668
|
-
t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ M(
|
|
4704
|
+
t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ M(Fe, { className: "size-4" }), h = /* @__PURE__ */ M(ue, { children: "Error" }), t[5] = m, t[6] = h) : (m = t[5], h = t[6]);
|
|
4669
4705
|
let g;
|
|
4670
4706
|
t[7] === d ? g = t[8] : (g = /* @__PURE__ */ N(ce, {
|
|
4671
4707
|
variant: "destructive",
|
|
@@ -4706,7 +4742,7 @@ function Ts(e) {
|
|
|
4706
4742
|
});
|
|
4707
4743
|
}, t[15] = l, t[16] = a, t[17] = y) : y = t[17];
|
|
4708
4744
|
let x;
|
|
4709
|
-
t[18] === Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ M(
|
|
4745
|
+
t[18] === Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ M(tt, { className: "size-4" }), t[18] = x) : x = t[18];
|
|
4710
4746
|
let S;
|
|
4711
4747
|
t[19] === y ? S = t[20] : (S = /* @__PURE__ */ M(be, { children: /* @__PURE__ */ N(he, {
|
|
4712
4748
|
variant: "outline",
|
|
@@ -4724,71 +4760,71 @@ function Ts(e) {
|
|
|
4724
4760
|
]
|
|
4725
4761
|
}), t[21] = v, t[22] = S, t[23] = p, t[24] = C) : C = t[24], C;
|
|
4726
4762
|
}
|
|
4727
|
-
function
|
|
4763
|
+
function Ms(e) {
|
|
4728
4764
|
return `${e.path.join(".")}: ${e.message}`;
|
|
4729
4765
|
}
|
|
4730
4766
|
//#endregion
|
|
4731
4767
|
//#region src/lib/components/Tip/TipProvider.tsx
|
|
4732
|
-
var
|
|
4733
|
-
function
|
|
4734
|
-
return l(
|
|
4768
|
+
var Ns = o("");
|
|
4769
|
+
function Ps() {
|
|
4770
|
+
return l(Ns);
|
|
4735
4771
|
}
|
|
4736
|
-
var
|
|
4737
|
-
function
|
|
4772
|
+
var Fs = "tips:history", Is = "tips:session";
|
|
4773
|
+
function Ls() {
|
|
4738
4774
|
try {
|
|
4739
|
-
return JSON.parse(localStorage.getItem(
|
|
4775
|
+
return JSON.parse(localStorage.getItem(Fs) ?? "{}");
|
|
4740
4776
|
} catch (e) {
|
|
4741
|
-
if (
|
|
4777
|
+
if (Bs(e)) return {};
|
|
4742
4778
|
throw e;
|
|
4743
4779
|
}
|
|
4744
4780
|
}
|
|
4745
|
-
function
|
|
4781
|
+
function Rs(e, t) {
|
|
4746
4782
|
try {
|
|
4747
|
-
let n =
|
|
4748
|
-
n[e] = t, localStorage.setItem(
|
|
4783
|
+
let n = Ls();
|
|
4784
|
+
n[e] = t, localStorage.setItem(Fs, JSON.stringify(n));
|
|
4749
4785
|
} catch (e) {
|
|
4750
|
-
if (!
|
|
4786
|
+
if (!Bs(e)) throw e;
|
|
4751
4787
|
}
|
|
4752
4788
|
}
|
|
4753
|
-
function
|
|
4789
|
+
function zs(e) {
|
|
4754
4790
|
try {
|
|
4755
|
-
let t = localStorage.getItem(
|
|
4791
|
+
let t = localStorage.getItem(Is), n = t ? JSON.parse(t) : {
|
|
4756
4792
|
id: "",
|
|
4757
4793
|
n: 0
|
|
4758
4794
|
};
|
|
4759
|
-
return n.id !== e && (n.id = e, n.n += 1, localStorage.setItem(
|
|
4795
|
+
return n.id !== e && (n.id = e, n.n += 1, localStorage.setItem(Is, JSON.stringify(n))), n.n;
|
|
4760
4796
|
} catch (e) {
|
|
4761
|
-
if (
|
|
4797
|
+
if (Bs(e)) return 0;
|
|
4762
4798
|
throw e;
|
|
4763
4799
|
}
|
|
4764
4800
|
}
|
|
4765
|
-
function
|
|
4801
|
+
function Bs(e) {
|
|
4766
4802
|
return e instanceof SyntaxError || e instanceof DOMException && (e.name === "QuotaExceededError" || e.name === "SecurityError");
|
|
4767
4803
|
}
|
|
4768
|
-
function
|
|
4804
|
+
function Vs(e, t, n) {
|
|
4769
4805
|
let r = n[e];
|
|
4770
4806
|
return r == null ? Infinity : t - r;
|
|
4771
4807
|
}
|
|
4772
|
-
async function
|
|
4773
|
-
let r =
|
|
4808
|
+
async function Hs(e, t, n) {
|
|
4809
|
+
let r = Ls(), i = await Promise.all(e.map((e) => e.isRelevant(t))), a = e.filter((e, t) => i[t]);
|
|
4774
4810
|
if (a.length === 0) return null;
|
|
4775
|
-
let o = a.filter((e) =>
|
|
4776
|
-
s.sort((e, t) =>
|
|
4811
|
+
let o = a.filter((e) => Vs(e.id, n, r) >= e.cooldownSessions), s = o.length > 0 ? o : a;
|
|
4812
|
+
s.sort((e, t) => Vs(t.id, n, r) - Vs(e.id, n, r));
|
|
4777
4813
|
let c = s[0], l = await c.content(t);
|
|
4778
4814
|
return {
|
|
4779
4815
|
id: c.id,
|
|
4780
4816
|
text: l
|
|
4781
4817
|
};
|
|
4782
4818
|
}
|
|
4783
|
-
function
|
|
4819
|
+
function Us(e) {
|
|
4784
4820
|
let t = O(13), { tips: n, streaming: r, chatId: i, context: a, children: o } = e, s;
|
|
4785
|
-
t[0] === i ? s = t[1] : (s = () =>
|
|
4821
|
+
t[0] === i ? s = t[1] : (s = () => zs(i), t[0] = i, t[1] = s);
|
|
4786
4822
|
let [c] = g(s), [l, u] = g(""), [p, m] = g(r), [_, v] = g(0);
|
|
4787
|
-
r !== p && (m(r), r && v(
|
|
4823
|
+
r !== p && (m(r), r && v(Ws));
|
|
4788
4824
|
let y = h(!1), b;
|
|
4789
4825
|
t[2] !== a || t[3] !== c || t[4] !== n ? (b = () => {
|
|
4790
|
-
y.current || (y.current = !0,
|
|
4791
|
-
e && (u(e.text),
|
|
4826
|
+
y.current || (y.current = !0, Hs(n, a, c).then((e) => {
|
|
4827
|
+
e && (u(e.text), Rs(e.id, c));
|
|
4792
4828
|
}).finally(() => {
|
|
4793
4829
|
y.current = !1;
|
|
4794
4830
|
}));
|
|
@@ -4800,17 +4836,17 @@ function Ls(e) {
|
|
|
4800
4836
|
let C;
|
|
4801
4837
|
t[8] === _ ? C = t[9] : (C = [_], t[8] = _, t[9] = C), d(S, C);
|
|
4802
4838
|
let w;
|
|
4803
|
-
return t[10] !== o || t[11] !== l ? (w = /* @__PURE__ */ M(
|
|
4839
|
+
return t[10] !== o || t[11] !== l ? (w = /* @__PURE__ */ M(Ns, {
|
|
4804
4840
|
value: l,
|
|
4805
4841
|
children: o
|
|
4806
4842
|
}), t[10] = o, t[11] = l, t[12] = w) : w = t[12], w;
|
|
4807
4843
|
}
|
|
4808
|
-
function
|
|
4844
|
+
function Ws(e) {
|
|
4809
4845
|
return e + 1;
|
|
4810
4846
|
}
|
|
4811
|
-
function
|
|
4847
|
+
function Gs(e) {
|
|
4812
4848
|
let t = O(6), { tips: n, context: r, children: i } = e, { chatId: a } = z(), { status: o } = B(), s = o === "streaming" || o === "submitted", c = a ?? "", l;
|
|
4813
|
-
return t[0] !== i || t[1] !== r || t[2] !== s || t[3] !== c || t[4] !== n ? (l = /* @__PURE__ */ M(
|
|
4849
|
+
return t[0] !== i || t[1] !== r || t[2] !== s || t[3] !== c || t[4] !== n ? (l = /* @__PURE__ */ M(Us, {
|
|
4814
4850
|
tips: n,
|
|
4815
4851
|
streaming: s,
|
|
4816
4852
|
chatId: c,
|
|
@@ -4820,25 +4856,25 @@ function zs(e) {
|
|
|
4820
4856
|
}
|
|
4821
4857
|
//#endregion
|
|
4822
4858
|
//#region src/lib/components/Tip/TipLine.tsx
|
|
4823
|
-
var
|
|
4824
|
-
function
|
|
4825
|
-
let t = O(13), { className: n } = e, r =
|
|
4859
|
+
var Ks = 1.5;
|
|
4860
|
+
function qs(e) {
|
|
4861
|
+
let t = O(13), { className: n } = e, r = St(), i = Ps(), [a, o] = g(i), [s, c] = g(!1);
|
|
4826
4862
|
i !== a && (o(i), i && c(!0));
|
|
4827
4863
|
let l, u;
|
|
4828
4864
|
t[0] !== r || t[1] !== s ? (l = () => {
|
|
4829
4865
|
if (!s) return;
|
|
4830
|
-
let e = r.setTimeout(() => c(!1),
|
|
4866
|
+
let e = r.setTimeout(() => c(!1), Ks * 1e3);
|
|
4831
4867
|
return () => r.clearTimeout(e);
|
|
4832
4868
|
}, u = [r, s], t[0] = r, t[1] = s, t[2] = l, t[3] = u) : (l = t[2], u = t[3]), d(l, u);
|
|
4833
4869
|
let f;
|
|
4834
4870
|
t[4] === n ? f = t[5] : (f = k("flex items-center justify-center gap-1.5 px-3 text-xs", n), t[4] = n, t[5] = f);
|
|
4835
4871
|
let p;
|
|
4836
|
-
t[6] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ M(
|
|
4872
|
+
t[6] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ M(Je, { className: "size-3 shrink-0" }), t[6] = p) : p = t[6];
|
|
4837
4873
|
let m;
|
|
4838
4874
|
t[7] !== s || t[8] !== i ? (m = /* @__PURE__ */ N(U, {
|
|
4839
4875
|
as: "span",
|
|
4840
4876
|
enabled: s,
|
|
4841
|
-
duration:
|
|
4877
|
+
duration: Ks,
|
|
4842
4878
|
children: ["Tip: ", i]
|
|
4843
4879
|
}), t[7] = s, t[8] = i, t[9] = m) : m = t[9];
|
|
4844
4880
|
let h;
|
|
@@ -4849,7 +4885,7 @@ function Vs(e) {
|
|
|
4849
4885
|
}
|
|
4850
4886
|
//#endregion
|
|
4851
4887
|
//#region src/lib/hooks/use-async-generator.ts
|
|
4852
|
-
function
|
|
4888
|
+
function Js() {
|
|
4853
4889
|
let [e, t] = g({
|
|
4854
4890
|
loading: !1,
|
|
4855
4891
|
error: null
|
|
@@ -4879,7 +4915,7 @@ function Hs() {
|
|
|
4879
4915
|
}
|
|
4880
4916
|
//#endregion
|
|
4881
4917
|
//#region src/lib/hooks/use-auto-resize-textarea.ts
|
|
4882
|
-
function
|
|
4918
|
+
function Ys(e) {
|
|
4883
4919
|
let t = O(16), { minHeight: n, maxHeight: r, value: i } = e, a = h(null), o;
|
|
4884
4920
|
t[0] !== r || t[1] !== n ? (o = (e) => {
|
|
4885
4921
|
let t = a.current;
|
|
@@ -4916,22 +4952,22 @@ function Us(e) {
|
|
|
4916
4952
|
}
|
|
4917
4953
|
//#endregion
|
|
4918
4954
|
//#region src/lib/hooks/use-keyboard.ts
|
|
4919
|
-
function
|
|
4955
|
+
function Xs(e) {
|
|
4920
4956
|
let t = [];
|
|
4921
4957
|
return e.ctrlKey && t.push("ctrl"), e.metaKey && t.push("meta"), e.altKey && t.push("alt"), e.shiftKey && t.push("shift"), t.push(e.key.toLowerCase()), t.join("+");
|
|
4922
4958
|
}
|
|
4923
|
-
function
|
|
4959
|
+
function Zs(e) {
|
|
4924
4960
|
let t = O(4), { enabled: n, handlers: r } = e, i = n === void 0 || n, a, o;
|
|
4925
4961
|
t[0] !== i || t[1] !== r ? (a = () => {
|
|
4926
4962
|
if (!i) return;
|
|
4927
4963
|
let e = (e) => {
|
|
4928
|
-
let t =
|
|
4964
|
+
let t = Xs(e), n = r[t];
|
|
4929
4965
|
n ||= r[e.key], n && (e.preventDefault(), e.stopPropagation(), n(e));
|
|
4930
4966
|
};
|
|
4931
4967
|
return document.addEventListener("keydown", e, !0), () => document.removeEventListener("keydown", e, !0);
|
|
4932
4968
|
}, o = [i, r], t[0] = i, t[1] = r, t[2] = a, t[3] = o) : (a = t[2], o = t[3]), d(a, o);
|
|
4933
4969
|
}
|
|
4934
4970
|
//#endregion
|
|
4935
|
-
export {
|
|
4971
|
+
export { Gt as AgentHeader, Zt as AgentProvider, Bt as AgentScrollArea, si as AssistantSnapshot, Yr as COPY_EXCLUSION_ATTRIBUTE, Xr as COPY_EXCLUSION_MODES, Q as ChatActionButton, zt as ChatBot, ms as ChatComposer, Ft as ChatManager, hs as ChatTextarea, Xn as CitationPill, Lr as CodeBlock, Rr as CodeBlockCopyButton, Ro as CompactMessages, Io as CompactTrajectory, na as CopyAction, ia as CopyDebugJsonAction, qn as IndexProgress, _i as InteractiveResponse, Yn as MessageItemContext, Ia as MessageMetadata, xs as MessageQueue, Jo as Messages, ta as MessagesActions, Jn as MessagesContext, oa as MessagesError, la as MessagesItem, ca as MessagesList, sa as MessagesRoot, Ya as MessagesUserBubble, $i as NestedTrajectory, fa as PendingToolInput, tn as ReadOnlyChatTransport, ra as RegenerateAction, J as Response, X as Segment, ri as SnapshotRenderPortal, Ds as SubmitButton, U as TextShimmer, ts as TimelinedMessages, qs as TipLine, Us as TipProvider, Ns as TipValueContext, Gs as Tips, Ai as ToolArg, js as ToolError, Ja as UserMessageContent, ka as ZukhrufChatTransport, en as citationIndexOf, Nt as clearPrefill, oe as defineElements, oi as extractAssistantRawText, $t as extractSourcesFromMessages, Ea as formatUsageBreakdown, Ta as formatUsageValue, fn as getIndexProgressEvents, Z as getSegmentKey, Qr as hasCopyExclusion, di as isActiveClientInputTool, Ni as isCommentaryTextPart, ci as isSubagentPart, rn as isToolAborted, nn as isToolStateAborted, ba as parseMetadataUsage, ya as parseUsage, Pt as persistedPromptOf, jt as readPrefill, ei as resolveCopyToClipboardStrategy, ui as resolveToolEntry, on as serializeToolsRegistry, $r as shouldIncludeInCopyImage, li as subagentDisplayName, ua as useActivePendingToolInput, z as useAgent, Lt as useAgentChatSetup, H as useAgentMessages, V as useAgentMeta, B as useAgentStatus, Js as useAsyncGenerator, Ys as useAutoResizeTextarea, Qt as useChatManager, Eo as useCompactGroup, ai as useCopyElementAsImage, Y as useIsAssistantSnapshotRender, an as useIsToolAborted, Zs as useKeyboard, K as useMessageItem, W as useMessagesContext, G as useMessagesStatus, wa as useNormalizedUsageTracking, Ps as useTipValue, Vi as useToolSegment, wo as useTrajectoryItems, ni as waitForNextPaint, Mt as writePrefill };
|
|
4936
4972
|
|
|
4937
4973
|
//# sourceMappingURL=index.js.map
|