@deepagents/react-genai 7.46.0 → 7.47.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 +988 -921
- package/dist/index.js.map +1 -1
- package/dist/lib/chat/trajectory/tool-label.d.ts +1 -0
- package/dist/lib/chat/trajectory/tool-label.d.ts.map +1 -1
- package/dist/lib/chat/trajectory/trajectories/compact-messages.d.ts +14 -3
- package/dist/lib/chat/trajectory/trajectories/compact-messages.d.ts.map +1 -1
- package/dist/lib/chat/trajectory/trajectories/messages.d.ts.map +1 -1
- package/dist/lib/components/text-shimmer.d.ts +3 -1
- package/dist/lib/components/text-shimmer.d.ts.map +1 -1
- package/dist/lib/copy/assistant-snapshot.d.ts.map +1 -1
- package/dist/lib/tools/registry.d.ts +18 -3
- package/dist/lib/tools/registry.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -186,7 +186,7 @@ function zt(e) {
|
|
|
186
186
|
function Bt(e) {
|
|
187
187
|
let t = O(13), n;
|
|
188
188
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = { initial: "smooth" }, t[0] = n) : n = t[0];
|
|
189
|
-
let { scrollRef: r, contentRef: i } = ie(n), { hasSubmitted: a } =
|
|
189
|
+
let { scrollRef: r, contentRef: i } = ie(n), { hasSubmitted: a } = V(), o;
|
|
190
190
|
t[1] === e.className ? o = t[2] : (o = k("@container mx-auto h-full w-full overflow-y-auto", e.className), t[1] = e.className, t[2] = o);
|
|
191
191
|
let s = a ? "min-h-full" : "h-full justify-center", c;
|
|
192
192
|
t[3] === s ? c = t[4] : (c = k("relative mx-auto flex w-full flex-col", s), t[3] = s, t[4] = c);
|
|
@@ -207,7 +207,7 @@ function Bt(e) {
|
|
|
207
207
|
}), t[9] = r, t[10] = o, t[11] = l, t[12] = u) : u = t[12], u;
|
|
208
208
|
}
|
|
209
209
|
function Vt(e) {
|
|
210
|
-
let t = O(12), { hasSubmitted: n } =
|
|
210
|
+
let t = O(12), { hasSubmitted: n } = V(), r;
|
|
211
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];
|
|
212
212
|
let i;
|
|
213
213
|
t[3] === Symbol.for("react.memo_cache_sentinel") ? (i = { layout: {
|
|
@@ -237,7 +237,7 @@ function Vt(e) {
|
|
|
237
237
|
}
|
|
238
238
|
Vt.displayName = "AgentHeader.Root";
|
|
239
239
|
function Ht(e) {
|
|
240
|
-
let t = O(6), { hasSubmitted: n } =
|
|
240
|
+
let t = O(6), { hasSubmitted: n } = V(), r;
|
|
241
241
|
t[0] !== n || t[1] !== e.children || t[2] !== e.icon ? (r = !n && /* @__PURE__ */ M(A.div, {
|
|
242
242
|
exit: { opacity: 0 },
|
|
243
243
|
transition: { duration: .2 },
|
|
@@ -263,7 +263,7 @@ function Ut(e) {
|
|
|
263
263
|
}
|
|
264
264
|
Ut.displayName = "AgentHeader.Title";
|
|
265
265
|
function Wt(e) {
|
|
266
|
-
let t = O(5), { hasSubmitted: n } =
|
|
266
|
+
let t = O(5), { hasSubmitted: n } = V(), r;
|
|
267
267
|
t[0] !== n || t[1] !== e.children ? (r = n && !!e.children && /* @__PURE__ */ M(A.p, {
|
|
268
268
|
initial: { opacity: 0 },
|
|
269
269
|
animate: { opacity: 1 },
|
|
@@ -351,27 +351,27 @@ function z() {
|
|
|
351
351
|
if (e === void 0) throw Error("useAgent must be used within an AgentProvider");
|
|
352
352
|
return e;
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function B() {
|
|
355
355
|
return { status: l(qt) };
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function V() {
|
|
358
358
|
let e = l(Xt);
|
|
359
359
|
if (e === void 0) throw Error("useAgentMeta must be used within an AgentProvider");
|
|
360
360
|
return e;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function H() {
|
|
363
363
|
let e = l(Jt);
|
|
364
364
|
if (e === void 0) throw Error("useAgentMessages must be used within an AgentProvider");
|
|
365
365
|
return e;
|
|
366
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function Qt() {
|
|
368
368
|
let e = l(Yt);
|
|
369
369
|
if (!e) throw Error("useChatManager must be used within an AgentProvider");
|
|
370
370
|
return e;
|
|
371
371
|
}
|
|
372
372
|
//#endregion
|
|
373
373
|
//#region src/lib/chat/citation-order.ts
|
|
374
|
-
function
|
|
374
|
+
function $t(e, t) {
|
|
375
375
|
return t.map((t, n) => ({
|
|
376
376
|
citation: t,
|
|
377
377
|
order: n,
|
|
@@ -380,29 +380,29 @@ function en(e, t) {
|
|
|
380
380
|
}
|
|
381
381
|
//#endregion
|
|
382
382
|
//#region src/lib/chat/citations.ts
|
|
383
|
-
function
|
|
383
|
+
function U(e) {
|
|
384
384
|
return (e ?? []).filter((e) => e.source.sourceType === "url");
|
|
385
385
|
}
|
|
386
|
-
function
|
|
387
|
-
let t = new Set(e.parts.flatMap((e) => e.type === "text" ?
|
|
386
|
+
function en(e) {
|
|
387
|
+
let t = new Set(e.parts.flatMap((e) => e.type === "text" ? U(e.citations).map(({ source: e }) => e.url) : [])), n = /* @__PURE__ */ new Map(), r = (e, t) => {
|
|
388
388
|
n.has(e) || n.set(e, {
|
|
389
389
|
url: e,
|
|
390
390
|
title: t
|
|
391
391
|
});
|
|
392
392
|
};
|
|
393
393
|
for (let n of e.parts) {
|
|
394
|
-
if (n.type === "text") for (let { citation: e } of
|
|
394
|
+
if (n.type === "text") for (let { citation: e } of $t(n.text, U(n.citations))) r(e.source.url, e.source.title);
|
|
395
395
|
n.type === "source-url" && !t.has(n.url) && r(n.url, n.title);
|
|
396
396
|
}
|
|
397
397
|
return [...n.values()];
|
|
398
398
|
}
|
|
399
|
-
function
|
|
399
|
+
function tn(e, t) {
|
|
400
400
|
let n = e.findIndex((e) => e.url === t);
|
|
401
401
|
return n === -1 ? null : n + 1;
|
|
402
402
|
}
|
|
403
403
|
//#endregion
|
|
404
404
|
//#region src/lib/chat/read-only-transport.ts
|
|
405
|
-
var
|
|
405
|
+
var nn = class {
|
|
406
406
|
sendMessages() {
|
|
407
407
|
return Promise.reject(/* @__PURE__ */ Error("This chat is read-only: it has no transport to send messages through."));
|
|
408
408
|
}
|
|
@@ -412,19 +412,19 @@ var rn = class {
|
|
|
412
412
|
};
|
|
413
413
|
//#endregion
|
|
414
414
|
//#region src/lib/chat/tool-abort.ts
|
|
415
|
-
function
|
|
415
|
+
function rn(e, t) {
|
|
416
416
|
return t === "streaming" || t === "submitted" ? !1 : e === "input-streaming" || e === "input-available";
|
|
417
417
|
}
|
|
418
|
-
function
|
|
419
|
-
return
|
|
418
|
+
function an(e, t) {
|
|
419
|
+
return rn(e.state, t);
|
|
420
420
|
}
|
|
421
|
-
function
|
|
422
|
-
let t = O(3), { status: n } =
|
|
423
|
-
return t[0] !== e || t[1] !== n ? (r =
|
|
421
|
+
function on(e) {
|
|
422
|
+
let t = O(3), { status: n } = B(), r;
|
|
423
|
+
return t[0] !== e || t[1] !== n ? (r = an(e, n), t[0] = e, t[1] = n, t[2] = r) : r = t[2], r;
|
|
424
424
|
}
|
|
425
425
|
//#endregion
|
|
426
426
|
//#region src/lib/chat/tools-schema.ts
|
|
427
|
-
function
|
|
427
|
+
function sn(e) {
|
|
428
428
|
return Object.entries(e).reduce((e, [t, n]) => (n.static || (e[t] = {
|
|
429
429
|
inputSchema: P.toJSONSchema(n.inputSchema, {
|
|
430
430
|
io: "input",
|
|
@@ -435,21 +435,22 @@ function cn(e) {
|
|
|
435
435
|
}
|
|
436
436
|
//#endregion
|
|
437
437
|
//#region src/lib/components/text-shimmer.tsx
|
|
438
|
-
function
|
|
439
|
-
let t = O(
|
|
440
|
-
t[0] !== i || t[1] !==
|
|
441
|
-
let d;
|
|
442
|
-
t[3] !== a || t[4] !== c ? (d = c && a !== void 0 ? { animationDuration: `${a}s` } : void 0, t[3] = a, t[4] = c, t[5] = d) : d = t[5];
|
|
438
|
+
function W(e) {
|
|
439
|
+
let t = O(12), { children: n, as: r, className: i, dir: a, duration: o, enabled: s } = e, c = r === void 0 ? "p" : r, l = s === void 0 || s, u = l && "shimmer", d;
|
|
440
|
+
t[0] !== i || t[1] !== u ? (d = k(u, i), t[0] = i, t[1] = u, t[2] = d) : d = t[2];
|
|
443
441
|
let f;
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
442
|
+
t[3] !== o || t[4] !== l ? (f = l && o !== void 0 ? { animationDuration: `${o}s` } : void 0, t[3] = o, t[4] = l, t[5] = f) : f = t[5];
|
|
443
|
+
let p;
|
|
444
|
+
return t[6] !== c || t[7] !== n || t[8] !== a || t[9] !== d || t[10] !== f ? (p = /* @__PURE__ */ M(c, {
|
|
445
|
+
dir: a,
|
|
446
|
+
className: d,
|
|
447
|
+
style: f,
|
|
447
448
|
children: n
|
|
448
|
-
}), t[6] =
|
|
449
|
+
}), t[6] = c, t[7] = n, t[8] = a, t[9] = d, t[10] = f, t[11] = p) : p = t[11], p;
|
|
449
450
|
}
|
|
450
451
|
//#endregion
|
|
451
452
|
//#region src/lib/chat/trajectory/compact-disclosure.tsx
|
|
452
|
-
function
|
|
453
|
+
function cn(e) {
|
|
453
454
|
let t = O(4), { className: n } = e, r;
|
|
454
455
|
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);
|
|
455
456
|
let i;
|
|
@@ -458,22 +459,22 @@ function ln(e) {
|
|
|
458
459
|
className: r
|
|
459
460
|
}), t[2] = r, t[3] = i), i;
|
|
460
461
|
}
|
|
461
|
-
function
|
|
462
|
+
function ln(e) {
|
|
462
463
|
return k("group hover:bg-muted/30 flex min-h-7 w-full gap-2 rounded-sm py-1 text-left transition-colors", e);
|
|
463
464
|
}
|
|
464
465
|
//#endregion
|
|
465
466
|
//#region src/lib/chat/trajectory/IndexProgressSegment.tsx
|
|
466
|
-
var
|
|
467
|
+
var un = "data-text2sql-index-progress", dn = {
|
|
467
468
|
initial: "instant",
|
|
468
469
|
resize: "instant"
|
|
469
470
|
};
|
|
471
|
+
function fn(e) {
|
|
472
|
+
return e.type === un;
|
|
473
|
+
}
|
|
470
474
|
function pn(e) {
|
|
471
|
-
return e.
|
|
475
|
+
return e.parts.filter(fn).map((e) => e.data);
|
|
472
476
|
}
|
|
473
477
|
function mn(e) {
|
|
474
|
-
return e.parts.filter(pn).map((e) => e.data);
|
|
475
|
-
}
|
|
476
|
-
function hn(e) {
|
|
477
478
|
let t = /* @__PURE__ */ new Map(), n = "running", r, i, a = (e, n) => {
|
|
478
479
|
let r = t.get(e) ?? {
|
|
479
480
|
name: e,
|
|
@@ -535,11 +536,11 @@ function hn(e) {
|
|
|
535
536
|
errorMessage: i
|
|
536
537
|
};
|
|
537
538
|
}
|
|
538
|
-
function
|
|
539
|
+
function hn(e) {
|
|
539
540
|
let t = O(2), n;
|
|
540
|
-
return t[0] === e ? n = t[1] : (n =
|
|
541
|
+
return t[0] === e ? n = t[1] : (n = mn(e), t[0] = e, t[1] = n), n;
|
|
541
542
|
}
|
|
542
|
-
function
|
|
543
|
+
function gn(e) {
|
|
543
544
|
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;
|
|
544
545
|
t[0] !== i || t[1] !== o || t[2] !== a ? (u = (e) => {
|
|
545
546
|
i === void 0 && c({
|
|
@@ -553,20 +554,20 @@ function _n(e) {
|
|
|
553
554
|
handleOpenChange: d
|
|
554
555
|
}, t[4] = d, t[5] = l, t[6] = f) : f = t[6], f;
|
|
555
556
|
}
|
|
556
|
-
function
|
|
557
|
+
function _n(e, t) {
|
|
557
558
|
return e.length === 0 ? !0 : t.status !== "complete" || t.adapters.length === 0 ? !1 : t.adapters.every((e) => e.status === "cache-hit");
|
|
558
559
|
}
|
|
559
|
-
function
|
|
560
|
+
function vn(e) {
|
|
560
561
|
return e.filter((e) => e.type === "index:start").length;
|
|
561
562
|
}
|
|
562
|
-
function
|
|
563
|
+
function yn(e) {
|
|
563
564
|
return e.filter((e) => [
|
|
564
565
|
"adapter:start",
|
|
565
566
|
"adapter:cache-hit",
|
|
566
567
|
"adapter:cache-miss"
|
|
567
568
|
].includes(e.type)).length;
|
|
568
569
|
}
|
|
569
|
-
function
|
|
570
|
+
function bn(e) {
|
|
570
571
|
let t = (e.totalAdapters ?? e.adapters.length) > 1;
|
|
571
572
|
if (e.status === "error") {
|
|
572
573
|
let n = e.adapters.find((e) => e.status === "error");
|
|
@@ -582,7 +583,7 @@ function xn(e) {
|
|
|
582
583
|
}
|
|
583
584
|
return e.adapters.length === 0 || !t ? ["Schema indexed"] : ["Schema indexed", `${e.adapters.length} adapters`];
|
|
584
585
|
}
|
|
585
|
-
function
|
|
586
|
+
function xn(e) {
|
|
586
587
|
if (e.status === "error") return [
|
|
587
588
|
"Failed",
|
|
588
589
|
e.name,
|
|
@@ -606,18 +607,18 @@ function Sn(e) {
|
|
|
606
607
|
"queued"
|
|
607
608
|
];
|
|
608
609
|
}
|
|
609
|
-
function
|
|
610
|
+
function Sn(e) {
|
|
610
611
|
return ["Failed", e.errorMessage ?? "unknown error"];
|
|
611
612
|
}
|
|
612
|
-
var
|
|
613
|
-
function
|
|
614
|
-
let t = l(
|
|
613
|
+
var Cn = o(null);
|
|
614
|
+
function wn(e) {
|
|
615
|
+
let t = l(Cn);
|
|
615
616
|
if (!t) throw Error(`<IndexProgress.${e}> must be used inside <IndexProgress.Root>`);
|
|
616
617
|
return t;
|
|
617
618
|
}
|
|
618
|
-
function
|
|
619
|
-
let t = O(21), { events: n, open: r, onOpenChange: i, children: a, className: o } = e, s =
|
|
620
|
-
t[0] === n ? l = t[1] : (l =
|
|
619
|
+
function Tn(e) {
|
|
620
|
+
let t = O(21), { events: n, open: r, onOpenChange: i, children: a, className: o } = e, s = hn(n), c = s.status, l;
|
|
621
|
+
t[0] === n ? l = t[1] : (l = vn(n), t[0] = n, t[1] = l);
|
|
621
622
|
let u;
|
|
622
623
|
t[2] !== r || t[3] !== i || t[4] !== s.status || t[5] !== l ? (u = {
|
|
623
624
|
status: c,
|
|
@@ -625,8 +626,8 @@ function En(e) {
|
|
|
625
626
|
controlledOpen: r,
|
|
626
627
|
onOpenChange: i
|
|
627
628
|
}, t[2] = r, t[3] = i, t[4] = s.status, t[5] = l, t[6] = u) : u = t[6];
|
|
628
|
-
let { isOpen: d, handleOpenChange: f } =
|
|
629
|
-
if (
|
|
629
|
+
let { isOpen: d, handleOpenChange: f } = gn(u);
|
|
630
|
+
if (_n(n, s)) return null;
|
|
630
631
|
let p;
|
|
631
632
|
t[7] !== n || t[8] !== s ? (p = {
|
|
632
633
|
state: s,
|
|
@@ -644,14 +645,14 @@ function En(e) {
|
|
|
644
645
|
children: a
|
|
645
646
|
}), t[12] = a, t[13] = f, t[14] = d, t[15] = s.status, t[16] = h, t[17] = g) : g = t[17];
|
|
646
647
|
let _;
|
|
647
|
-
return t[18] !== p || t[19] !== g ? (_ = /* @__PURE__ */ M(
|
|
648
|
+
return t[18] !== p || t[19] !== g ? (_ = /* @__PURE__ */ M(Cn, {
|
|
648
649
|
value: p,
|
|
649
650
|
children: g
|
|
650
651
|
}), t[18] = p, t[19] = g, t[20] = _) : _ = t[20], _;
|
|
651
652
|
}
|
|
652
|
-
function
|
|
653
|
-
let t = O(13), { className: n } = e, { state: r } =
|
|
654
|
-
t[0] === n ? i = t[1] : (i =
|
|
653
|
+
function En(e) {
|
|
654
|
+
let t = O(13), { className: n } = e, { state: r } = wn("Trigger"), i;
|
|
655
|
+
t[0] === n ? i = t[1] : (i = Dn(n), t[0] = n, t[1] = i);
|
|
655
656
|
let a;
|
|
656
657
|
t[2] === i ? a = t[3] : (a = /* @__PURE__ */ M("button", {
|
|
657
658
|
type: "button",
|
|
@@ -659,42 +660,42 @@ function Dn(e) {
|
|
|
659
660
|
className: i
|
|
660
661
|
}), t[2] = i, t[3] = a);
|
|
661
662
|
let o;
|
|
662
|
-
t[4] === r ? o = t[5] : (o =
|
|
663
|
+
t[4] === r ? o = t[5] : (o = bn(r), t[4] = r, t[5] = o);
|
|
663
664
|
let s = r.status === "running", c;
|
|
664
|
-
t[6] !== o || t[7] !== s ? (c = /* @__PURE__ */ M(
|
|
665
|
+
t[6] !== o || t[7] !== s ? (c = /* @__PURE__ */ M(On, {
|
|
665
666
|
segments: o,
|
|
666
667
|
isRunning: s
|
|
667
668
|
}), t[6] = o, t[7] = s, t[8] = c) : c = t[8];
|
|
668
669
|
let l;
|
|
669
|
-
t[9] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ M(
|
|
670
|
+
t[9] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ M(An, {}), t[9] = l) : l = t[9];
|
|
670
671
|
let u;
|
|
671
672
|
return t[10] !== a || t[11] !== c ? (u = /* @__PURE__ */ N(L, {
|
|
672
673
|
render: a,
|
|
673
674
|
children: [c, l]
|
|
674
675
|
}), t[10] = a, t[11] = c, t[12] = u) : u = t[12], u;
|
|
675
676
|
}
|
|
676
|
-
function
|
|
677
|
-
return
|
|
677
|
+
function Dn(e) {
|
|
678
|
+
return ln(k("items-baseline px-1", e));
|
|
678
679
|
}
|
|
679
|
-
function
|
|
680
|
+
function On(e) {
|
|
680
681
|
let t = O(8), { segments: n, isRunning: r } = e, i = n.length - 1, a;
|
|
681
682
|
if (t[0] !== i || t[1] !== n) {
|
|
682
683
|
let e;
|
|
683
|
-
t[3] === i ? e = t[4] : (e = (e, t) => /* @__PURE__ */ M(
|
|
684
|
+
t[3] === i ? e = t[4] : (e = (e, t) => /* @__PURE__ */ M(kn, {
|
|
684
685
|
segment: e,
|
|
685
686
|
index: t,
|
|
686
687
|
isLast: t === i
|
|
687
688
|
}, t), t[3] = i, t[4] = e), a = n.map(e), t[0] = i, t[1] = n, t[2] = a;
|
|
688
689
|
} else a = t[2];
|
|
689
690
|
let o;
|
|
690
|
-
return t[5] !== r || t[6] !== a ? (o = /* @__PURE__ */ M(
|
|
691
|
+
return t[5] !== r || t[6] !== a ? (o = /* @__PURE__ */ M(W, {
|
|
691
692
|
as: "span",
|
|
692
693
|
enabled: r,
|
|
693
694
|
className: "text-muted-foreground min-w-0 flex-1 truncate text-xs",
|
|
694
695
|
children: a
|
|
695
696
|
}), t[5] = r, t[6] = a, t[7] = o) : o = t[7], o;
|
|
696
697
|
}
|
|
697
|
-
function
|
|
698
|
+
function kn(e) {
|
|
698
699
|
let t = O(11), { segment: n, index: r, isLast: i } = e, o;
|
|
699
700
|
t[0] === r ? o = t[1] : (o = r > 0 && /* @__PURE__ */ M("span", {
|
|
700
701
|
"aria-hidden": !0,
|
|
@@ -711,11 +712,11 @@ function An(e) {
|
|
|
711
712
|
let d;
|
|
712
713
|
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;
|
|
713
714
|
}
|
|
714
|
-
function
|
|
715
|
+
function An() {
|
|
715
716
|
let e = O(1), t;
|
|
716
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
717
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(cn, { className: "text-muted-foreground/60 size-3" }), e[0] = t) : t = e[0], t;
|
|
717
718
|
}
|
|
718
|
-
function
|
|
719
|
+
function jn(e) {
|
|
719
720
|
let t = O(3), { className: n, children: r } = e, i;
|
|
720
721
|
return t[0] !== r || t[1] !== n ? (i = /* @__PURE__ */ M(I, {
|
|
721
722
|
"data-slot": "index-progress-content",
|
|
@@ -723,7 +724,7 @@ function Mn(e) {
|
|
|
723
724
|
children: r
|
|
724
725
|
}), t[0] = r, t[1] = n, t[2] = i) : i = t[2], i;
|
|
725
726
|
}
|
|
726
|
-
function
|
|
727
|
+
function Mn(e) {
|
|
727
728
|
let t = O(11), { event: n } = e, r;
|
|
728
729
|
t[0] === n.type ? r = t[1] : (r = /* @__PURE__ */ M("span", {
|
|
729
730
|
className: "text-muted-foreground/50 w-40 shrink-0 truncate",
|
|
@@ -753,7 +754,7 @@ function Nn(e) {
|
|
|
753
754
|
]
|
|
754
755
|
}), t[7] = r, t[8] = i, t[9] = a, t[10] = o) : o = t[10], o;
|
|
755
756
|
}
|
|
756
|
-
function
|
|
757
|
+
function Nn(e) {
|
|
757
758
|
let t = O(2), n;
|
|
758
759
|
if (t[0] !== e) {
|
|
759
760
|
let r = /* @__PURE__ */ new Map(), i = [];
|
|
@@ -768,25 +769,25 @@ function Pn(e) {
|
|
|
768
769
|
} else n = t[1];
|
|
769
770
|
return n;
|
|
770
771
|
}
|
|
771
|
-
function
|
|
772
|
-
let t = O(8), { className: n } = e, { events: r } =
|
|
772
|
+
function Pn(e) {
|
|
773
|
+
let t = O(8), { className: n } = e, { events: r } = wn("EventLog"), i = Nn(r), a;
|
|
773
774
|
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);
|
|
774
775
|
let o = a;
|
|
775
776
|
if (i.byAdapter.size <= 1) {
|
|
776
777
|
let e;
|
|
777
|
-
return t[2] !== o || t[3] !== r ? (e = /* @__PURE__ */ M(
|
|
778
|
+
return t[2] !== o || t[3] !== r ? (e = /* @__PURE__ */ M(In, {
|
|
778
779
|
events: r,
|
|
779
780
|
className: o
|
|
780
781
|
}), t[2] = o, t[3] = r, t[4] = e) : e = t[4], e;
|
|
781
782
|
}
|
|
782
783
|
let s;
|
|
783
|
-
return t[5] !== o || t[6] !== i ? (s = /* @__PURE__ */ M(
|
|
784
|
+
return t[5] !== o || t[6] !== i ? (s = /* @__PURE__ */ M(Rn, {
|
|
784
785
|
groupedEvents: i,
|
|
785
786
|
className: o
|
|
786
787
|
}), t[5] = o, t[6] = i, t[7] = s) : s = t[7], s;
|
|
787
788
|
}
|
|
788
|
-
function
|
|
789
|
-
let t = O(8), { className: n, contentClassName: r, children: i } = e, { scrollRef: a, contentRef: o } = ie(
|
|
789
|
+
function Fn(e) {
|
|
790
|
+
let t = O(8), { className: n, contentClassName: r, children: i } = e, { scrollRef: a, contentRef: o } = ie(dn), s;
|
|
790
791
|
t[0] !== i || t[1] !== r || t[2] !== o ? (s = /* @__PURE__ */ M("div", {
|
|
791
792
|
ref: o,
|
|
792
793
|
"data-slot": "index-progress-event-log",
|
|
@@ -800,56 +801,56 @@ function In(e) {
|
|
|
800
801
|
children: s
|
|
801
802
|
}), t[4] = n, t[5] = a, t[6] = s, t[7] = c) : c = t[7], c;
|
|
802
803
|
}
|
|
803
|
-
function
|
|
804
|
+
function In(e) {
|
|
804
805
|
let t = O(7), { events: n, className: r } = e, i;
|
|
805
|
-
t[0] === n ? i = t[1] : (i = n.map(
|
|
806
|
+
t[0] === n ? i = t[1] : (i = n.map(Ln), t[0] = n, t[1] = i);
|
|
806
807
|
let a;
|
|
807
808
|
t[2] === i ? a = t[3] : (a = /* @__PURE__ */ M("ul", {
|
|
808
809
|
className: "space-y-0.5",
|
|
809
810
|
children: i
|
|
810
811
|
}), t[2] = i, t[3] = a);
|
|
811
812
|
let o;
|
|
812
|
-
return t[4] !== r || t[5] !== a ? (o = /* @__PURE__ */ M(
|
|
813
|
+
return t[4] !== r || t[5] !== a ? (o = /* @__PURE__ */ M(Fn, {
|
|
813
814
|
className: r,
|
|
814
815
|
children: a
|
|
815
816
|
}), t[4] = r, t[5] = a, t[6] = o) : o = t[6], o;
|
|
816
817
|
}
|
|
817
|
-
function
|
|
818
|
-
return /* @__PURE__ */ M(
|
|
818
|
+
function Ln(e, t) {
|
|
819
|
+
return /* @__PURE__ */ M(Mn, { event: e }, `${e.type}-${t}`);
|
|
819
820
|
}
|
|
820
|
-
function
|
|
821
|
+
function Rn(e) {
|
|
821
822
|
let t = O(8), { groupedEvents: n, className: r } = e, i;
|
|
822
823
|
t[0] === n.globalEvents ? i = t[1] : (i = n.globalEvents.length > 0 && /* @__PURE__ */ M("ul", {
|
|
823
824
|
className: "space-y-0.5",
|
|
824
|
-
children: n.globalEvents.map(
|
|
825
|
+
children: n.globalEvents.map(Bn)
|
|
825
826
|
}), t[0] = n.globalEvents, t[1] = i);
|
|
826
827
|
let a;
|
|
827
|
-
t[2] === n.byAdapter ? a = t[3] : (a = Array.from(n.byAdapter.entries()).map(
|
|
828
|
+
t[2] === n.byAdapter ? a = t[3] : (a = Array.from(n.byAdapter.entries()).map(zn), t[2] = n.byAdapter, t[3] = a);
|
|
828
829
|
let o;
|
|
829
|
-
return t[4] !== r || t[5] !== i || t[6] !== a ? (o = /* @__PURE__ */ N(
|
|
830
|
+
return t[4] !== r || t[5] !== i || t[6] !== a ? (o = /* @__PURE__ */ N(Fn, {
|
|
830
831
|
className: r,
|
|
831
832
|
contentClassName: "space-y-2",
|
|
832
833
|
children: [i, a]
|
|
833
834
|
}), t[4] = r, t[5] = i, t[6] = a, t[7] = o) : o = t[7], o;
|
|
834
835
|
}
|
|
835
|
-
function
|
|
836
|
+
function zn(e) {
|
|
836
837
|
let [t, n] = e;
|
|
837
|
-
return /* @__PURE__ */ M(
|
|
838
|
+
return /* @__PURE__ */ M(Vn, {
|
|
838
839
|
name: t,
|
|
839
840
|
events: n
|
|
840
841
|
}, t);
|
|
841
842
|
}
|
|
842
|
-
function
|
|
843
|
-
return /* @__PURE__ */ M(
|
|
843
|
+
function Bn(e, t) {
|
|
844
|
+
return /* @__PURE__ */ M(Mn, { event: e }, `${e.type}-${t}`);
|
|
844
845
|
}
|
|
845
|
-
function
|
|
846
|
+
function Vn(e) {
|
|
846
847
|
let t = O(9), { name: n, events: r } = e, i;
|
|
847
848
|
t[0] === n ? i = t[1] : (i = /* @__PURE__ */ M("div", {
|
|
848
849
|
className: "text-foreground/90",
|
|
849
850
|
children: n
|
|
850
851
|
}), t[0] = n, t[1] = i);
|
|
851
852
|
let a;
|
|
852
|
-
t[2] === r ? a = t[3] : (a = r.map(
|
|
853
|
+
t[2] === r ? a = t[3] : (a = r.map(Hn), t[2] = r, t[3] = a);
|
|
853
854
|
let o;
|
|
854
855
|
t[4] === a ? o = t[5] : (o = /* @__PURE__ */ M("ul", {
|
|
855
856
|
className: "space-y-0.5",
|
|
@@ -861,21 +862,21 @@ function Hn(e) {
|
|
|
861
862
|
children: [i, o]
|
|
862
863
|
}), t[6] = i, t[7] = o, t[8] = s) : s = t[8], s;
|
|
863
864
|
}
|
|
864
|
-
function
|
|
865
|
-
return /* @__PURE__ */ M(
|
|
865
|
+
function Hn(e, t) {
|
|
866
|
+
return /* @__PURE__ */ M(Mn, { event: e }, `${e.type}-${t}`);
|
|
866
867
|
}
|
|
867
|
-
function
|
|
868
|
-
let t = O(22), { events: n, className: r, showCacheHits: i } = e, a = i !== void 0 && i, o =
|
|
869
|
-
t[0] === s.globalEvents ? c = t[1] : (c = s.globalEvents.filter(
|
|
868
|
+
function Un(e) {
|
|
869
|
+
let t = O(22), { events: n, className: r, showCacheHits: i } = e, a = i !== void 0 && i, o = hn(n), s = Nn(n), c;
|
|
870
|
+
t[0] === s.globalEvents ? c = t[1] : (c = s.globalEvents.filter(Wn), t[0] = s.globalEvents, t[1] = c);
|
|
870
871
|
let l = c;
|
|
871
|
-
if (n.length === 0 || !a &&
|
|
872
|
+
if (n.length === 0 || !a && _n(n, o)) return null;
|
|
872
873
|
if (o.adapters.length === 0) {
|
|
873
874
|
let e;
|
|
874
|
-
t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M(
|
|
875
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M(En, {}), t[2] = e) : e = t[2];
|
|
875
876
|
let i;
|
|
876
|
-
t[3] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ M(
|
|
877
|
+
t[3] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ M(jn, { children: /* @__PURE__ */ M(Pn, {}) }), t[3] = i) : i = t[3];
|
|
877
878
|
let a;
|
|
878
|
-
return t[4] !== r || t[5] !== n ? (a = /* @__PURE__ */ N(
|
|
879
|
+
return t[4] !== r || t[5] !== n ? (a = /* @__PURE__ */ N(Tn, {
|
|
879
880
|
events: n,
|
|
880
881
|
className: r,
|
|
881
882
|
children: [e, i]
|
|
@@ -886,13 +887,13 @@ function Wn(e) {
|
|
|
886
887
|
let f;
|
|
887
888
|
if (t[9] !== s.byAdapter || t[10] !== o.adapters) {
|
|
888
889
|
let e;
|
|
889
|
-
t[12] === s.byAdapter ? e = t[13] : (e = (e) => /* @__PURE__ */ M(
|
|
890
|
+
t[12] === s.byAdapter ? e = t[13] : (e = (e) => /* @__PURE__ */ M(Gn, {
|
|
890
891
|
adapter: e,
|
|
891
892
|
events: s.byAdapter.get(e.name) ?? []
|
|
892
893
|
}, 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;
|
|
893
894
|
} else f = t[11];
|
|
894
895
|
let p;
|
|
895
|
-
t[14] !== l || t[15] !== o ? (p = l.length > 0 && /* @__PURE__ */ M(
|
|
896
|
+
t[14] !== l || t[15] !== o ? (p = l.length > 0 && /* @__PURE__ */ M(qn, {
|
|
896
897
|
state: o,
|
|
897
898
|
events: l
|
|
898
899
|
}), t[14] = l, t[15] = o, t[16] = p) : p = t[16];
|
|
@@ -904,32 +905,32 @@ function Wn(e) {
|
|
|
904
905
|
children: [f, p]
|
|
905
906
|
}), t[17] = o.status, t[18] = d, t[19] = f, t[20] = p, t[21] = m) : m = t[21], m;
|
|
906
907
|
}
|
|
907
|
-
function
|
|
908
|
+
function Wn(e) {
|
|
908
909
|
return e.type === "index:error";
|
|
909
910
|
}
|
|
910
|
-
function
|
|
911
|
+
function Gn(e) {
|
|
911
912
|
let t = O(22), { adapter: n, events: r } = e, i = n.status, a;
|
|
912
|
-
t[0] === r ? a = t[1] : (a =
|
|
913
|
+
t[0] === r ? a = t[1] : (a = yn(r), t[0] = r, t[1] = a);
|
|
913
914
|
let o;
|
|
914
915
|
t[2] !== n.status || t[3] !== a ? (o = {
|
|
915
916
|
status: i,
|
|
916
917
|
resetKey: a
|
|
917
918
|
}, t[2] = n.status, t[3] = a, t[4] = o) : o = t[4];
|
|
918
|
-
let { isOpen: s, handleOpenChange: c } =
|
|
919
|
+
let { isOpen: s, handleOpenChange: c } = gn(o), l = n.status, u;
|
|
919
920
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ M("button", {
|
|
920
921
|
type: "button",
|
|
921
922
|
"data-slot": "index-progress-adapter-trigger",
|
|
922
|
-
className:
|
|
923
|
+
className: Dn()
|
|
923
924
|
}), t[5] = u) : u = t[5];
|
|
924
925
|
let d;
|
|
925
|
-
t[6] === n ? d = t[7] : (d =
|
|
926
|
+
t[6] === n ? d = t[7] : (d = xn(n), t[6] = n, t[7] = d);
|
|
926
927
|
let f = n.status === "running", p;
|
|
927
|
-
t[8] !== d || t[9] !== f ? (p = /* @__PURE__ */ M(
|
|
928
|
+
t[8] !== d || t[9] !== f ? (p = /* @__PURE__ */ M(On, {
|
|
928
929
|
segments: d,
|
|
929
930
|
isRunning: f
|
|
930
931
|
}), t[8] = d, t[9] = f, t[10] = p) : p = t[10];
|
|
931
932
|
let m;
|
|
932
|
-
t[11] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ M(
|
|
933
|
+
t[11] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ M(An, {}), t[11] = m) : m = t[11];
|
|
933
934
|
let h;
|
|
934
935
|
t[12] === p ? h = t[13] : (h = /* @__PURE__ */ N(L, {
|
|
935
936
|
render: u,
|
|
@@ -938,7 +939,7 @@ function Kn(e) {
|
|
|
938
939
|
let g;
|
|
939
940
|
t[14] === r ? g = t[15] : (g = /* @__PURE__ */ M(I, {
|
|
940
941
|
"data-slot": "index-progress-adapter-content",
|
|
941
|
-
children: /* @__PURE__ */ M(
|
|
942
|
+
children: /* @__PURE__ */ M(Kn, { events: r })
|
|
942
943
|
}), t[14] = r, t[15] = g);
|
|
943
944
|
let _;
|
|
944
945
|
return t[16] !== n.status || t[17] !== c || t[18] !== s || t[19] !== h || t[20] !== g ? (_ = /* @__PURE__ */ N(F, {
|
|
@@ -950,36 +951,36 @@ function Kn(e) {
|
|
|
950
951
|
children: [h, g]
|
|
951
952
|
}), t[16] = n.status, t[17] = c, t[18] = s, t[19] = h, t[20] = g, t[21] = _) : _ = t[21], _;
|
|
952
953
|
}
|
|
953
|
-
function
|
|
954
|
+
function Kn(e) {
|
|
954
955
|
let t = O(2), { events: n } = e;
|
|
955
956
|
if (n.length === 0) return null;
|
|
956
957
|
let r;
|
|
957
|
-
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M(
|
|
958
|
+
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M(In, {
|
|
958
959
|
events: n,
|
|
959
960
|
className: "mt-2 ml-4 max-h-64 overflow-y-auto font-mono text-[11px]"
|
|
960
961
|
}), t[0] = n, t[1] = r), r;
|
|
961
962
|
}
|
|
962
|
-
function
|
|
963
|
+
function qn(e) {
|
|
963
964
|
let t = O(20), { state: n, events: r } = e, i;
|
|
964
965
|
t[0] !== r.length || t[1] !== n.status ? (i = {
|
|
965
966
|
status: n.status,
|
|
966
967
|
resetKey: r.length
|
|
967
968
|
}, t[0] = r.length, t[1] = n.status, t[2] = i) : i = t[2];
|
|
968
|
-
let { isOpen: a, handleOpenChange: o } =
|
|
969
|
+
let { isOpen: a, handleOpenChange: o } = gn(i), s = n.status, c;
|
|
969
970
|
t[3] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ M("button", {
|
|
970
971
|
type: "button",
|
|
971
972
|
"data-slot": "index-progress-global-error-trigger",
|
|
972
|
-
className:
|
|
973
|
+
className: Dn()
|
|
973
974
|
}), t[3] = c) : c = t[3];
|
|
974
975
|
let l;
|
|
975
|
-
t[4] === n ? l = t[5] : (l =
|
|
976
|
+
t[4] === n ? l = t[5] : (l = Sn(n), t[4] = n, t[5] = l);
|
|
976
977
|
let u = n.status === "running", d;
|
|
977
|
-
t[6] !== l || t[7] !== u ? (d = /* @__PURE__ */ M(
|
|
978
|
+
t[6] !== l || t[7] !== u ? (d = /* @__PURE__ */ M(On, {
|
|
978
979
|
segments: l,
|
|
979
980
|
isRunning: u
|
|
980
981
|
}), t[6] = l, t[7] = u, t[8] = d) : d = t[8];
|
|
981
982
|
let f;
|
|
982
|
-
t[9] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(
|
|
983
|
+
t[9] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(An, {}), t[9] = f) : f = t[9];
|
|
983
984
|
let p;
|
|
984
985
|
t[10] === d ? p = t[11] : (p = /* @__PURE__ */ N(L, {
|
|
985
986
|
render: c,
|
|
@@ -988,7 +989,7 @@ function Jn(e) {
|
|
|
988
989
|
let m;
|
|
989
990
|
t[12] === r ? m = t[13] : (m = /* @__PURE__ */ M(I, {
|
|
990
991
|
"data-slot": "index-progress-global-error-content",
|
|
991
|
-
children: /* @__PURE__ */ M(
|
|
992
|
+
children: /* @__PURE__ */ M(Kn, { events: r })
|
|
992
993
|
}), t[12] = r, t[13] = m);
|
|
993
994
|
let h;
|
|
994
995
|
return t[14] !== o || t[15] !== a || t[16] !== n.status || t[17] !== p || t[18] !== m ? (h = /* @__PURE__ */ N(F, {
|
|
@@ -1000,30 +1001,30 @@ function Jn(e) {
|
|
|
1000
1001
|
children: [p, m]
|
|
1001
1002
|
}), t[14] = o, t[15] = a, t[16] = n.status, t[17] = p, t[18] = m, t[19] = h) : h = t[19], h;
|
|
1002
1003
|
}
|
|
1003
|
-
var
|
|
1004
|
-
Root:
|
|
1005
|
-
Trigger:
|
|
1006
|
-
Content:
|
|
1007
|
-
EventLog:
|
|
1008
|
-
PerAdapter:
|
|
1009
|
-
},
|
|
1010
|
-
function
|
|
1011
|
-
let e = l(
|
|
1004
|
+
var Jn = {
|
|
1005
|
+
Root: Tn,
|
|
1006
|
+
Trigger: En,
|
|
1007
|
+
Content: jn,
|
|
1008
|
+
EventLog: Pn,
|
|
1009
|
+
PerAdapter: Un
|
|
1010
|
+
}, Yn = o(void 0), Xn = o(void 0);
|
|
1011
|
+
function G() {
|
|
1012
|
+
let e = l(Yn);
|
|
1012
1013
|
if (!e) throw Error("useMessagesContext must be used within <Messages>");
|
|
1013
1014
|
return e;
|
|
1014
1015
|
}
|
|
1015
|
-
function
|
|
1016
|
-
let e = l(
|
|
1016
|
+
function K() {
|
|
1017
|
+
let e = l(Yn), { status: t } = B();
|
|
1017
1018
|
return e?.status ?? t;
|
|
1018
1019
|
}
|
|
1019
|
-
function
|
|
1020
|
-
let e = l(
|
|
1020
|
+
function q() {
|
|
1021
|
+
let e = l(Xn);
|
|
1021
1022
|
if (!e) throw Error("useMessageItem must be used within <Messages.Item>");
|
|
1022
1023
|
return e;
|
|
1023
1024
|
}
|
|
1024
1025
|
//#endregion
|
|
1025
1026
|
//#region src/lib/components/CitationPill.tsx
|
|
1026
|
-
function
|
|
1027
|
+
function Zn({ source: e, index: t, labels: n = {
|
|
1027
1028
|
source: `Source ${t}`,
|
|
1028
1029
|
open: "Open the source"
|
|
1029
1030
|
}, children: r }) {
|
|
@@ -1063,7 +1064,7 @@ function Qn({ source: e, index: t, labels: n = {
|
|
|
1063
1064
|
}
|
|
1064
1065
|
//#endregion
|
|
1065
1066
|
//#region src/lib/ui/TablePanel.tsx
|
|
1066
|
-
function
|
|
1067
|
+
function Qn(e) {
|
|
1067
1068
|
let t = O(10), n, r, i;
|
|
1068
1069
|
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);
|
|
1069
1070
|
let a;
|
|
@@ -1077,8 +1078,8 @@ function $n(e) {
|
|
|
1077
1078
|
...r
|
|
1078
1079
|
}), t[6] = r, t[7] = i, t[8] = a, t[9] = o) : o = t[9], o;
|
|
1079
1080
|
}
|
|
1080
|
-
|
|
1081
|
-
function
|
|
1081
|
+
Qn.displayName = "TablePanel.Root";
|
|
1082
|
+
function $n(e) {
|
|
1082
1083
|
let t = O(8), n, r;
|
|
1083
1084
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1084
1085
|
let i;
|
|
@@ -1090,7 +1091,7 @@ function er(e) {
|
|
|
1090
1091
|
...r
|
|
1091
1092
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1092
1093
|
}
|
|
1093
|
-
function
|
|
1094
|
+
function er(e) {
|
|
1094
1095
|
let t = O(8), n, r;
|
|
1095
1096
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1096
1097
|
let i;
|
|
@@ -1102,7 +1103,7 @@ function tr(e) {
|
|
|
1102
1103
|
...r
|
|
1103
1104
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1104
1105
|
}
|
|
1105
|
-
function
|
|
1106
|
+
function tr(e) {
|
|
1106
1107
|
let t = O(8), n, r;
|
|
1107
1108
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1108
1109
|
let i;
|
|
@@ -1114,7 +1115,7 @@ function nr(e) {
|
|
|
1114
1115
|
...r
|
|
1115
1116
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1116
1117
|
}
|
|
1117
|
-
function
|
|
1118
|
+
function nr(e) {
|
|
1118
1119
|
let t = O(8), n, r;
|
|
1119
1120
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1120
1121
|
let i;
|
|
@@ -1126,7 +1127,7 @@ function rr(e) {
|
|
|
1126
1127
|
...r
|
|
1127
1128
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1128
1129
|
}
|
|
1129
|
-
function
|
|
1130
|
+
function rr(e) {
|
|
1130
1131
|
let t = O(8), n, r;
|
|
1131
1132
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1132
1133
|
let i;
|
|
@@ -1138,7 +1139,7 @@ function ir(e) {
|
|
|
1138
1139
|
...r
|
|
1139
1140
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1140
1141
|
}
|
|
1141
|
-
function
|
|
1142
|
+
function ir(e) {
|
|
1142
1143
|
let t = O(8), n, r;
|
|
1143
1144
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1144
1145
|
let i;
|
|
@@ -1150,40 +1151,40 @@ function ar(e) {
|
|
|
1150
1151
|
...r
|
|
1151
1152
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1152
1153
|
}
|
|
1153
|
-
var
|
|
1154
|
-
Header:
|
|
1155
|
-
Heading:
|
|
1156
|
-
Title:
|
|
1157
|
-
Description:
|
|
1158
|
-
Actions:
|
|
1159
|
-
Content:
|
|
1160
|
-
}),
|
|
1161
|
-
function
|
|
1162
|
-
return e.replace(
|
|
1163
|
-
}
|
|
1164
|
-
function
|
|
1154
|
+
var J = Object.assign(Qn, {
|
|
1155
|
+
Header: $n,
|
|
1156
|
+
Heading: er,
|
|
1157
|
+
Title: tr,
|
|
1158
|
+
Description: nr,
|
|
1159
|
+
Actions: rr,
|
|
1160
|
+
Content: ir
|
|
1161
|
+
}), ar = /<\w[\w-]*(?:"(?:\\.|[^"])*"|[^>"])*>/g, or = /\b([\w-]+)="((?:\\.|[^"])*)"/g;
|
|
1162
|
+
function sr(e) {
|
|
1163
|
+
return e.replace(ar, (e) => e.replace(or, (e, t, n) => `${t}="${n.replace(/\\"/g, """)}"`));
|
|
1164
|
+
}
|
|
1165
|
+
function cr(e, t) {
|
|
1165
1166
|
if (typeof e != "string") return e;
|
|
1166
|
-
let n =
|
|
1167
|
-
return n = n.replace(/\/>(\s*)</g, (e, t, n, r) => !t.includes("\n") &&
|
|
1167
|
+
let n = sr(hr(e, dr(t))).replace(/<(\w[\w-]*)((?:\s+[\w-]+="[^"]*")+)\s*(\/?>)/g, (e, t, n, r) => `<${t}${n.replace(/\s+/g, " ")}${r}`);
|
|
1168
|
+
return n = n.replace(/\/>(\s*)</g, (e, t, n, r) => !t.includes("\n") && ur(r, n) ? e : "/>\n\n<"), gr(n, t);
|
|
1168
1169
|
}
|
|
1169
|
-
var
|
|
1170
|
-
function
|
|
1170
|
+
var lr = /<\w[\w-]*(?:"(?:\\.|[^"])*"|[^>"])*>|<\/[\w-]+\s*>/g;
|
|
1171
|
+
function ur(e, t) {
|
|
1171
1172
|
let n = e.lastIndexOf("\n", t - 1) + 1, r = e.indexOf("\n", t);
|
|
1172
|
-
return e.slice(n, r < 0 ? e.length : r).replace(
|
|
1173
|
+
return e.slice(n, r < 0 ? e.length : r).replace(lr, "").trim() !== "";
|
|
1173
1174
|
}
|
|
1174
|
-
function
|
|
1175
|
+
function dr(e) {
|
|
1175
1176
|
let t = e?.length ? new Set(e) : null;
|
|
1176
1177
|
return t ? (e) => t.has(e) : (e) => e.includes("-");
|
|
1177
1178
|
}
|
|
1178
|
-
var
|
|
1179
|
-
function
|
|
1180
|
-
return e.replace(
|
|
1179
|
+
var fr = /<([\w-]+)((?:\s+[\w-]+=(?:[“”][^“”]*[“”]|[‘’][^‘’]*[‘’]|"[^"]*"|'[^']*'))+)\s*(\/?>)/g, pr = /([\w-]+)=(?:[“”]([^“”]*)[“”]|[‘’]([^‘’]*)[‘’])/g;
|
|
1180
|
+
function mr(e) {
|
|
1181
|
+
return e.replace(pr, (e, t, n, r) => `${t}="${(n ?? r ?? "").replace(/"/g, """)}"`);
|
|
1181
1182
|
}
|
|
1182
|
-
function
|
|
1183
|
-
return e.replace(
|
|
1183
|
+
function hr(e, t) {
|
|
1184
|
+
return e.replace(fr, (e, n, r, i) => t(n) ? `<${n}${mr(r)}${i}` : e);
|
|
1184
1185
|
}
|
|
1185
|
-
function
|
|
1186
|
-
let r =
|
|
1186
|
+
function gr(e, t, n = !1) {
|
|
1187
|
+
let r = dr(t), i = "", a = 0;
|
|
1187
1188
|
for (; a < e.length;) {
|
|
1188
1189
|
if (e[a] !== "<" || e[a + 1] === "/") {
|
|
1189
1190
|
i += e[a++];
|
|
@@ -1196,36 +1197,36 @@ function _r(e, t, n = !1) {
|
|
|
1196
1197
|
i += e[a++];
|
|
1197
1198
|
continue;
|
|
1198
1199
|
}
|
|
1199
|
-
let c =
|
|
1200
|
+
let c = _r(e, a);
|
|
1200
1201
|
if (c < 0) {
|
|
1201
1202
|
i += e[a++];
|
|
1202
1203
|
continue;
|
|
1203
1204
|
}
|
|
1204
1205
|
if (e[c - 1] === "/") {
|
|
1205
1206
|
let t = e.slice(a, c + 1);
|
|
1206
|
-
n ? i += "<div>" + t + "</div>" :
|
|
1207
|
+
n ? i += "<div>" + t + "</div>" : ur(e, a) ? i += "<span>" + t.slice(0, -2).trimEnd() + "></" + s + "></span>" : (i += t.slice(0, -2).trimEnd() + "></" + s + ">", e[c + 1] === "\n" && c + 2 < e.length && e[c + 2] !== "\n" && (i += "\n")), a = c + 1;
|
|
1207
1208
|
continue;
|
|
1208
1209
|
}
|
|
1209
|
-
let l =
|
|
1210
|
+
let l = vr(e, c + 1, s);
|
|
1210
1211
|
if (!l) {
|
|
1211
1212
|
if (n) {
|
|
1212
|
-
let n = e.slice(a, c + 1), r =
|
|
1213
|
+
let n = e.slice(a, c + 1), r = gr(e.slice(c + 1), t, !0);
|
|
1213
1214
|
return i += "<div>" + n + r + "</" + s + "></div>", i;
|
|
1214
1215
|
}
|
|
1215
1216
|
i += e.slice(a, c + 1), a = c + 1;
|
|
1216
1217
|
continue;
|
|
1217
1218
|
}
|
|
1218
|
-
let u = e.slice(a, c + 1), d = e.slice(c + 1, l.start), f = e.slice(l.start, l.end), p =
|
|
1219
|
+
let u = e.slice(a, c + 1), d = e.slice(c + 1, l.start), f = e.slice(l.start, l.end), p = gr(d, t, !0);
|
|
1219
1220
|
if (n) i += "<div>" + u + p + f + "</div>";
|
|
1220
1221
|
else {
|
|
1221
1222
|
let t = p.includes("\n") ? "\n" : "";
|
|
1222
|
-
i =
|
|
1223
|
+
i = yr(i) + "<div>" + t + u + p + f + t + "</div>", e[l.end] === "\n" && l.end + 1 < e.length && e[l.end + 1] !== "\n" && (i += "\n");
|
|
1223
1224
|
}
|
|
1224
1225
|
a = l.end;
|
|
1225
1226
|
}
|
|
1226
1227
|
return i;
|
|
1227
1228
|
}
|
|
1228
|
-
function
|
|
1229
|
+
function _r(e, t) {
|
|
1229
1230
|
let n = t + 1;
|
|
1230
1231
|
for (; n < e.length;) {
|
|
1231
1232
|
if (e[n] === "\"") for (n++; n < e.length && e[n] !== "\"";) n++;
|
|
@@ -1234,14 +1235,14 @@ function vr(e, t) {
|
|
|
1234
1235
|
}
|
|
1235
1236
|
return -1;
|
|
1236
1237
|
}
|
|
1237
|
-
function
|
|
1238
|
+
function vr(e, t, n) {
|
|
1238
1239
|
let r = 1, i = t, a = "<" + n, o = "</" + n;
|
|
1239
1240
|
for (; i < e.length;) {
|
|
1240
1241
|
let t = e.indexOf("<", i);
|
|
1241
1242
|
if (t < 0) return null;
|
|
1242
1243
|
if (e.startsWith(o, t) && !/[\w-]/.test(e[t + o.length] || "")) {
|
|
1243
1244
|
if (r--, r === 0) {
|
|
1244
|
-
let n =
|
|
1245
|
+
let n = _r(e, t);
|
|
1245
1246
|
return n < 0 ? null : {
|
|
1246
1247
|
start: t,
|
|
1247
1248
|
end: n + 1
|
|
@@ -1250,25 +1251,25 @@ function yr(e, t, n) {
|
|
|
1250
1251
|
let n = e.indexOf(">", t + o.length);
|
|
1251
1252
|
i = n < 0 ? t + 1 : n + 1;
|
|
1252
1253
|
} else if (e.startsWith(a, t) && !/[\w-]/.test(e[t + a.length] || "")) {
|
|
1253
|
-
let n =
|
|
1254
|
+
let n = _r(e, t);
|
|
1254
1255
|
n >= 0 && e[n - 1] !== "/" && r++, i = n < 0 ? t + 1 : n + 1;
|
|
1255
1256
|
} else if (/[a-zA-Z/]/.test(e[t + 1] || "")) {
|
|
1256
|
-
let n =
|
|
1257
|
+
let n = _r(e, t);
|
|
1257
1258
|
i = n < 0 ? t + 1 : n + 1;
|
|
1258
1259
|
} else i = t + 1;
|
|
1259
1260
|
}
|
|
1260
1261
|
return null;
|
|
1261
1262
|
}
|
|
1262
|
-
function
|
|
1263
|
+
function yr(e) {
|
|
1263
1264
|
return e.length === 0 ? "\n\n" : e.endsWith("\n\n") ? e : e.endsWith("\n") ? e + "\n" : e + "\n\n";
|
|
1264
1265
|
}
|
|
1265
1266
|
//#endregion
|
|
1266
1267
|
//#region src/lib/elements/table-panel-extension.tsx
|
|
1267
|
-
var
|
|
1268
|
+
var br = "response-table-panel", xr = ["title", "description"], Sr = k(Ne({
|
|
1268
1269
|
variant: "ghost",
|
|
1269
1270
|
size: "icon-sm"
|
|
1270
|
-
})),
|
|
1271
|
-
let t = _t(e), n =
|
|
1271
|
+
})), Cr = vt().use(ut).use(lt).use(ct), wr = (e) => {
|
|
1272
|
+
let t = _t(e), n = Dr(e);
|
|
1272
1273
|
if (n.length === 0) return t;
|
|
1273
1274
|
let r = 0, i = t.map((e) => {
|
|
1274
1275
|
let t = {
|
|
@@ -1283,49 +1284,49 @@ var xr = "response-table-panel", Sr = ["title", "description"], Cr = k(Ne({
|
|
|
1283
1284
|
}
|
|
1284
1285
|
return t.reduce((e, t, n) => (a.has(n) && e.length > 0 ? e[e.length - 1] += t : e.push(t), e), []);
|
|
1285
1286
|
};
|
|
1286
|
-
function
|
|
1287
|
+
function Tr(e) {
|
|
1287
1288
|
return e?.type === "leafDirective" && "name" in e && e.name === "table";
|
|
1288
1289
|
}
|
|
1289
|
-
function
|
|
1290
|
+
function Er(e, t) {
|
|
1290
1291
|
if (t === void 0) return;
|
|
1291
1292
|
let n = e[t - 1];
|
|
1292
|
-
return
|
|
1293
|
+
return Tr(n) ? n : void 0;
|
|
1293
1294
|
}
|
|
1294
|
-
function
|
|
1295
|
+
function Dr(e) {
|
|
1295
1296
|
let t = [];
|
|
1296
|
-
return bt(
|
|
1297
|
+
return bt(Cr.parse(e), "table", (e, n, r) => {
|
|
1297
1298
|
if (!r) return;
|
|
1298
|
-
let i =
|
|
1299
|
+
let i = Er(r.children, n)?.position?.start.offset, a = e.position?.end.offset;
|
|
1299
1300
|
i !== void 0 && a !== void 0 && t.push({
|
|
1300
1301
|
start: i,
|
|
1301
1302
|
end: a
|
|
1302
1303
|
});
|
|
1303
1304
|
}), t;
|
|
1304
1305
|
}
|
|
1305
|
-
function
|
|
1306
|
+
function Or(e, t) {
|
|
1306
1307
|
return e.attributes?.[t]?.trim() || void 0;
|
|
1307
1308
|
}
|
|
1308
|
-
function
|
|
1309
|
-
let t =
|
|
1309
|
+
function kr(e) {
|
|
1310
|
+
let t = Cr.parse(e), n = !1;
|
|
1310
1311
|
if (bt(t, "leafDirective", (e, t, r) => {
|
|
1311
1312
|
let i = t === void 0 ? void 0 : r?.children[t + 1];
|
|
1312
1313
|
if (e.name !== "table" || i?.type !== "table") return;
|
|
1313
1314
|
n = !0;
|
|
1314
|
-
let a = [
|
|
1315
|
+
let a = [Or(e, "title"), Or(e, "description")].filter(Boolean).join(" ");
|
|
1315
1316
|
e.children = a ? [{
|
|
1316
1317
|
type: "text",
|
|
1317
1318
|
value: a
|
|
1318
1319
|
}] : [];
|
|
1319
1320
|
}), n) return gt(st(t, { includeHtml: !1 }));
|
|
1320
1321
|
}
|
|
1321
|
-
function
|
|
1322
|
+
function Ar(e) {
|
|
1322
1323
|
let t = O(2), n;
|
|
1323
1324
|
return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ M(dt, { ...e }), t[0] = e, t[1] = n), n;
|
|
1324
1325
|
}
|
|
1325
|
-
function
|
|
1326
|
+
function jr(e) {
|
|
1326
1327
|
function t(t) {
|
|
1327
1328
|
let n = O(6), r;
|
|
1328
|
-
n[0] !== t.content || n[1] !== t.dir ? (r =
|
|
1329
|
+
n[0] !== t.content || n[1] !== t.dir ? (r = kr(t.content) ?? t.dir, n[0] = t.content, n[1] = t.dir, n[2] = r) : r = n[2];
|
|
1329
1330
|
let i = r, a;
|
|
1330
1331
|
return n[3] !== i || n[4] !== t ? (a = /* @__PURE__ */ M(e, {
|
|
1331
1332
|
...t,
|
|
@@ -1334,69 +1335,69 @@ function Mr(e) {
|
|
|
1334
1335
|
}
|
|
1335
1336
|
return t.displayName = "DirectionAwareTableBlock", t;
|
|
1336
1337
|
}
|
|
1337
|
-
function
|
|
1338
|
-
let n = t &&
|
|
1338
|
+
function Mr(e, t) {
|
|
1339
|
+
let n = t && Or(t, "title"), r = t && Or(t, "description"), i = {
|
|
1339
1340
|
...n ? { title: n } : {},
|
|
1340
1341
|
...r ? { description: r } : {}
|
|
1341
1342
|
};
|
|
1342
1343
|
return {
|
|
1343
1344
|
type: "tablePanel",
|
|
1344
1345
|
data: {
|
|
1345
|
-
hName:
|
|
1346
|
+
hName: br,
|
|
1346
1347
|
...Object.keys(i).length > 0 ? { hProperties: i } : {}
|
|
1347
1348
|
},
|
|
1348
1349
|
children: [e]
|
|
1349
1350
|
};
|
|
1350
1351
|
}
|
|
1351
|
-
function
|
|
1352
|
+
function Nr() {
|
|
1352
1353
|
return (e) => {
|
|
1353
1354
|
bt(e, "table", (e, t, n) => {
|
|
1354
1355
|
if (t === void 0 || !n) return;
|
|
1355
|
-
let r =
|
|
1356
|
-
return n.children.splice(i, a,
|
|
1356
|
+
let r = Er(n.children, t), i = r ? t - 1 : t, a = r ? 2 : 1;
|
|
1357
|
+
return n.children.splice(i, a, Mr(e, r)), [yt, i + 1];
|
|
1357
1358
|
});
|
|
1358
1359
|
};
|
|
1359
1360
|
}
|
|
1360
|
-
var
|
|
1361
|
+
var Pr = [
|
|
1361
1362
|
...Object.values(ht),
|
|
1362
1363
|
ct,
|
|
1363
|
-
|
|
1364
|
-
],
|
|
1364
|
+
Nr
|
|
1365
|
+
], Fr = t.createContext({
|
|
1365
1366
|
actions: null,
|
|
1366
1367
|
controls: !0
|
|
1367
1368
|
});
|
|
1368
|
-
function
|
|
1369
|
+
function Ir(e, t) {
|
|
1369
1370
|
if (e === !1) return !1;
|
|
1370
1371
|
if (e === !0 || e === void 0) return !0;
|
|
1371
1372
|
let n = e.table;
|
|
1372
1373
|
return n === !1 ? !1 : n === !0 || n === void 0 || n[t] !== !1;
|
|
1373
1374
|
}
|
|
1374
|
-
function
|
|
1375
|
+
function Lr(e) {
|
|
1375
1376
|
return e === !1 ? !1 : e === !0 || e === void 0 ? { table: !1 } : {
|
|
1376
1377
|
...e,
|
|
1377
1378
|
table: !1
|
|
1378
1379
|
};
|
|
1379
1380
|
}
|
|
1380
|
-
function
|
|
1381
|
-
let n = O(21), { children: r, className: i, title: a, description: o } = e, { actions: s, controls: c } = t.use(
|
|
1382
|
-
n[0] === c ? l = n[1] : (l =
|
|
1381
|
+
function Rr(e) {
|
|
1382
|
+
let n = O(21), { children: r, className: i, title: a, description: o } = e, { actions: s, controls: c } = t.use(Fr), l;
|
|
1383
|
+
n[0] === c ? l = n[1] : (l = Ir(c, "copy"), n[0] = c, n[1] = l);
|
|
1383
1384
|
let u = l, d;
|
|
1384
|
-
n[2] === c ? d = n[3] : (d =
|
|
1385
|
+
n[2] === c ? d = n[3] : (d = Ir(c, "download"), n[2] = c, n[3] = d);
|
|
1385
1386
|
let f = d, p = !!(a || o), m = !!(u || f || s);
|
|
1386
1387
|
if (!r) return null;
|
|
1387
1388
|
let h;
|
|
1388
1389
|
n[4] === i ? h = n[5] : (h = k("my-4", i), n[4] = i, n[5] = h);
|
|
1389
1390
|
let g;
|
|
1390
|
-
n[6] !== s || n[7] !== o || n[8] !== m || n[9] !== p || n[10] !== u || n[11] !== f || n[12] !== a ? (g = (p || m) && /* @__PURE__ */ N(
|
|
1391
|
+
n[6] !== s || n[7] !== o || n[8] !== m || n[9] !== p || n[10] !== u || n[11] !== f || n[12] !== a ? (g = (p || m) && /* @__PURE__ */ N(J.Header, {
|
|
1391
1392
|
className: k(!p && "justify-end"),
|
|
1392
|
-
children: [p && /* @__PURE__ */ N(
|
|
1393
|
+
children: [p && /* @__PURE__ */ N(J.Heading, { children: [a && /* @__PURE__ */ M(J.Title, { children: a }), o && /* @__PURE__ */ M(J.Description, {
|
|
1393
1394
|
className: k(a && "mt-1"),
|
|
1394
1395
|
children: o
|
|
1395
|
-
})] }), m && /* @__PURE__ */ N(
|
|
1396
|
+
})] }), m && /* @__PURE__ */ N(J.Actions, {
|
|
1396
1397
|
"data-copy-exclude": "assistant-snapshot",
|
|
1397
1398
|
children: [
|
|
1398
|
-
u && /* @__PURE__ */ M(pt, { className:
|
|
1399
|
-
f && /* @__PURE__ */ M(mt, { className:
|
|
1399
|
+
u && /* @__PURE__ */ M(pt, { className: Sr }),
|
|
1400
|
+
f && /* @__PURE__ */ M(mt, { className: Sr }),
|
|
1400
1401
|
s
|
|
1401
1402
|
]
|
|
1402
1403
|
})]
|
|
@@ -1404,42 +1405,42 @@ function zr(e) {
|
|
|
1404
1405
|
let _;
|
|
1405
1406
|
n[14] === Symbol.for("react.memo_cache_sentinel") ? (_ = k("overflow-hidden", "[&>[data-streamdown=table-wrapper]]:m-0 [&>[data-streamdown=table-wrapper]]:gap-0 [&>[data-streamdown=table-wrapper]]:rounded-none [&>[data-streamdown=table-wrapper]]:border-0 [&>[data-streamdown=table-wrapper]]:bg-transparent [&>[data-streamdown=table-wrapper]]:p-0", "[&>[data-streamdown=table-wrapper]>div:last-child]:rounded-none [&>[data-streamdown=table-wrapper]>div:last-child]:border-0", "[&_[data-streamdown=table]]:tabular-nums", "[&_[data-streamdown=table-header]]:bg-muted/30", "[&_[data-streamdown=table-header-cell]]:text-muted-foreground [&_[data-streamdown=table-header-cell]]:text-xs [&_[data-streamdown=table-header-cell]]:font-medium", "[&_[data-streamdown=table-cell]]:py-2", "[&_[data-streamdown=table-row]]:hover:bg-muted/30"), n[14] = _) : _ = n[14];
|
|
1406
1407
|
let v;
|
|
1407
|
-
n[15] === r ? v = n[16] : (v = /* @__PURE__ */ M(
|
|
1408
|
+
n[15] === r ? v = n[16] : (v = /* @__PURE__ */ M(J.Content, {
|
|
1408
1409
|
className: _,
|
|
1409
1410
|
children: r
|
|
1410
1411
|
}), n[15] = r, n[16] = v);
|
|
1411
1412
|
let y;
|
|
1412
|
-
return n[17] !== h || n[18] !== g || n[19] !== v ? (y = /* @__PURE__ */ N(
|
|
1413
|
+
return n[17] !== h || n[18] !== g || n[19] !== v ? (y = /* @__PURE__ */ N(J, {
|
|
1413
1414
|
"data-streamdown": "table-wrapper",
|
|
1414
1415
|
className: h,
|
|
1415
1416
|
children: [g, v]
|
|
1416
1417
|
}), n[17] = h, n[18] = g, n[19] = v, n[20] = y) : y = n[20], y;
|
|
1417
1418
|
}
|
|
1418
|
-
function
|
|
1419
|
+
function zr(e) {
|
|
1419
1420
|
let t = O(43), n, r, i, a, o, s, c, l, u, d;
|
|
1420
1421
|
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);
|
|
1421
1422
|
let f;
|
|
1422
1423
|
bb0: {
|
|
1423
1424
|
if (!u) {
|
|
1424
|
-
f =
|
|
1425
|
+
f = Pr;
|
|
1425
1426
|
break bb0;
|
|
1426
1427
|
}
|
|
1427
1428
|
let e;
|
|
1428
1429
|
t[11] === u ? e = t[12] : (e = [
|
|
1429
1430
|
...u,
|
|
1430
1431
|
ct,
|
|
1431
|
-
|
|
1432
|
+
Nr
|
|
1432
1433
|
], t[11] = u, t[12] = e), f = e;
|
|
1433
1434
|
}
|
|
1434
1435
|
let p = f, m;
|
|
1435
1436
|
t[13] === r ? m = t[14] : (m = {
|
|
1436
1437
|
...r,
|
|
1437
|
-
[
|
|
1438
|
+
[br]: xr
|
|
1438
1439
|
}, t[13] = r, t[14] = m);
|
|
1439
1440
|
let h = m, g;
|
|
1440
1441
|
t[15] === a ? g = t[16] : (g = {
|
|
1441
1442
|
...a,
|
|
1442
|
-
[
|
|
1443
|
+
[br]: Rr
|
|
1443
1444
|
}, t[15] = a, t[16] = g);
|
|
1444
1445
|
let _ = g, v;
|
|
1445
1446
|
t[17] !== o || t[18] !== d ? (v = {
|
|
@@ -1452,8 +1453,8 @@ function Br(e) {
|
|
|
1452
1453
|
b = n;
|
|
1453
1454
|
break bb1;
|
|
1454
1455
|
}
|
|
1455
|
-
let e = n ??
|
|
1456
|
-
t[20] === e ? r = t[21] : (r =
|
|
1456
|
+
let e = n ?? Ar, r;
|
|
1457
|
+
t[20] === e ? r = t[21] : (r = jr(e), t[20] = e, t[21] = r), b = r;
|
|
1457
1458
|
}
|
|
1458
1459
|
let x = b, S;
|
|
1459
1460
|
bb2: {
|
|
@@ -1462,12 +1463,12 @@ function Br(e) {
|
|
|
1462
1463
|
break bb2;
|
|
1463
1464
|
}
|
|
1464
1465
|
let e;
|
|
1465
|
-
t[22] !== i || t[23] !== s ? (e =
|
|
1466
|
+
t[22] !== i || t[23] !== s ? (e = kr(i) ?? s, t[22] = i, t[23] = s, t[24] = e) : e = t[24], S = e;
|
|
1466
1467
|
}
|
|
1467
1468
|
let C = S, w;
|
|
1468
|
-
t[25] === o ? w = t[26] : (w =
|
|
1469
|
+
t[25] === o ? w = t[26] : (w = Lr(o), t[25] = o, t[26] = w);
|
|
1469
1470
|
let T;
|
|
1470
|
-
t[27] !== i || t[28] !== h ? (T =
|
|
1471
|
+
t[27] !== i || t[28] !== h ? (T = cr(i, Object.keys(h)), t[27] = i, t[28] = h, t[29] = T) : T = t[29];
|
|
1471
1472
|
let E;
|
|
1472
1473
|
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, {
|
|
1473
1474
|
allowedTags: h,
|
|
@@ -1476,20 +1477,20 @@ function Br(e) {
|
|
|
1476
1477
|
controls: w,
|
|
1477
1478
|
dir: C,
|
|
1478
1479
|
mode: c,
|
|
1479
|
-
parseMarkdownIntoBlocksFn:
|
|
1480
|
+
parseMarkdownIntoBlocksFn: wr,
|
|
1480
1481
|
remarkPlugins: p,
|
|
1481
1482
|
...l,
|
|
1482
1483
|
children: T
|
|
1483
1484
|
}), 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];
|
|
1484
1485
|
let D;
|
|
1485
|
-
return t[40] !== E || t[41] !== y ? (D = /* @__PURE__ */ M(
|
|
1486
|
+
return t[40] !== E || t[41] !== y ? (D = /* @__PURE__ */ M(Fr, {
|
|
1486
1487
|
value: y,
|
|
1487
1488
|
children: E
|
|
1488
1489
|
}), t[40] = E, t[41] = y, t[42] = D) : D = t[42], D;
|
|
1489
1490
|
}
|
|
1490
1491
|
//#endregion
|
|
1491
1492
|
//#region src/lib/elements/Response.tsx
|
|
1492
|
-
var
|
|
1493
|
+
var Br = class extends t.Component {
|
|
1493
1494
|
state = {
|
|
1494
1495
|
hasError: !1,
|
|
1495
1496
|
error: null
|
|
@@ -1506,22 +1507,22 @@ var Vr = class extends t.Component {
|
|
|
1506
1507
|
children: ["Failed to render content: ", this.state.error?.message]
|
|
1507
1508
|
}) : this.props.children;
|
|
1508
1509
|
}
|
|
1509
|
-
},
|
|
1510
|
+
}, Y = c((e) => {
|
|
1510
1511
|
let t = O(8), n, r;
|
|
1511
1512
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1512
1513
|
let i;
|
|
1513
|
-
t[3] === n ? i = t[4] : (i = k("size-full space-y-
|
|
1514
|
+
t[3] === n ? i = t[4] : (i = k("flex size-full flex-col gap-2 space-y-0 [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", n), t[3] = n, t[4] = i);
|
|
1514
1515
|
let a;
|
|
1515
|
-
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ M(
|
|
1516
|
+
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ M(Br, { children: /* @__PURE__ */ M(zr, {
|
|
1516
1517
|
className: i,
|
|
1517
1518
|
dir: "auto",
|
|
1518
1519
|
...r
|
|
1519
1520
|
}) }), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1520
1521
|
});
|
|
1521
|
-
|
|
1522
|
+
Y.displayName = "Response";
|
|
1522
1523
|
//#endregion
|
|
1523
1524
|
//#region src/lib/ui/use-copy-feedback.ts
|
|
1524
|
-
function
|
|
1525
|
+
function Vr(e) {
|
|
1525
1526
|
let t = O(9), n = e === void 0 ? 2e3 : e, r = St(), [i, a] = g(!1), o = h(null), s, c;
|
|
1526
1527
|
t[0] === r ? (s = t[1], c = t[2]) : (s = () => () => {
|
|
1527
1528
|
o.current && r.clearTimeout(o.current);
|
|
@@ -1535,13 +1536,13 @@ function Hr(e) {
|
|
|
1535
1536
|
}
|
|
1536
1537
|
//#endregion
|
|
1537
1538
|
//#region src/lib/elements/code-block.tsx
|
|
1538
|
-
var
|
|
1539
|
+
var Hr = o({ code: "" }), Ur = (e) => {
|
|
1539
1540
|
let t = O(24), n, r, i, a, o, s;
|
|
1540
1541
|
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);
|
|
1541
1542
|
let c = o !== void 0 && o, l = s !== void 0 && s, u = Pe(r, i), d;
|
|
1542
1543
|
t[7] === r ? d = t[8] : (d = { code: r }, t[7] = r, t[8] = d);
|
|
1543
1544
|
let f;
|
|
1544
|
-
t[9] === u ? f = t[10] : (f = u.map(
|
|
1545
|
+
t[9] === u ? f = t[10] : (f = u.map(Gr), t[9] = u, t[10] = f);
|
|
1545
1546
|
let p;
|
|
1546
1547
|
t[11] !== c || t[12] !== f || t[13] !== l ? (p = /* @__PURE__ */ M(Te, {
|
|
1547
1548
|
lineNumbers: c,
|
|
@@ -1557,12 +1558,12 @@ var Ur = o({ code: "" }), Wr = (e) => {
|
|
|
1557
1558
|
children: [p, m]
|
|
1558
1559
|
}), t[17] = a, t[18] = p, t[19] = m, t[20] = h) : h = t[20];
|
|
1559
1560
|
let g;
|
|
1560
|
-
return t[21] !== d || t[22] !== h ? (g = /* @__PURE__ */ M(
|
|
1561
|
+
return t[21] !== d || t[22] !== h ? (g = /* @__PURE__ */ M(Hr, {
|
|
1561
1562
|
value: d,
|
|
1562
1563
|
children: h
|
|
1563
1564
|
}), t[21] = d, t[22] = h, t[23] = g) : g = t[23], g;
|
|
1564
|
-
},
|
|
1565
|
-
let [o, s] =
|
|
1565
|
+
}, Wr = ({ onCopy: e, onError: t, timeout: n = 2e3, children: r, className: i, ...a }) => {
|
|
1566
|
+
let [o, s] = Vr(n), { code: c } = l(Hr), u = async () => {
|
|
1566
1567
|
if (typeof window > "u" || !navigator.clipboard.writeText) {
|
|
1567
1568
|
t?.(/* @__PURE__ */ Error("Clipboard API not available"));
|
|
1568
1569
|
return;
|
|
@@ -1582,12 +1583,12 @@ var Ur = o({ code: "" }), Wr = (e) => {
|
|
|
1582
1583
|
children: r ?? /* @__PURE__ */ M(d, {})
|
|
1583
1584
|
});
|
|
1584
1585
|
};
|
|
1585
|
-
function
|
|
1586
|
+
function Gr(e, t) {
|
|
1586
1587
|
return /* @__PURE__ */ M(Ee, { children: e }, t);
|
|
1587
1588
|
}
|
|
1588
1589
|
//#endregion
|
|
1589
1590
|
//#region src/lib/elements/Tool.tsx
|
|
1590
|
-
var
|
|
1591
|
+
var Kr = (e) => {
|
|
1591
1592
|
let t = O(8), n, r;
|
|
1592
1593
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1593
1594
|
let i;
|
|
@@ -1597,7 +1598,7 @@ var qr = (e) => {
|
|
|
1597
1598
|
className: i,
|
|
1598
1599
|
...r
|
|
1599
1600
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1600
|
-
},
|
|
1601
|
+
}, qr = (e) => /* @__PURE__ */ N(me, {
|
|
1601
1602
|
className: "gap-1.5 rounded-full text-xs",
|
|
1602
1603
|
variant: "secondary",
|
|
1603
1604
|
children: [{
|
|
@@ -1617,7 +1618,7 @@ var qr = (e) => {
|
|
|
1617
1618
|
"output-error": "Error",
|
|
1618
1619
|
"output-denied": "Denied"
|
|
1619
1620
|
}[e]]
|
|
1620
|
-
}),
|
|
1621
|
+
}), Jr = (e) => {
|
|
1621
1622
|
let t = O(23), n, r, i, a;
|
|
1622
1623
|
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);
|
|
1623
1624
|
let o;
|
|
@@ -1632,7 +1633,7 @@ var qr = (e) => {
|
|
|
1632
1633
|
children: c
|
|
1633
1634
|
}), t[11] = c, t[12] = l);
|
|
1634
1635
|
let u;
|
|
1635
|
-
t[13] === r.state ? u = t[14] : (u =
|
|
1636
|
+
t[13] === r.state ? u = t[14] : (u = qr(r.state), t[13] = r.state, t[14] = u);
|
|
1636
1637
|
let d;
|
|
1637
1638
|
t[15] !== l || t[16] !== u ? (d = /* @__PURE__ */ N("div", {
|
|
1638
1639
|
className: "flex items-center gap-2",
|
|
@@ -1650,7 +1651,7 @@ var qr = (e) => {
|
|
|
1650
1651
|
...i,
|
|
1651
1652
|
children: [d, f]
|
|
1652
1653
|
}), t[19] = i, t[20] = o, t[21] = d, t[22] = p) : p = t[22], p;
|
|
1653
|
-
},
|
|
1654
|
+
}, Yr = (e) => {
|
|
1654
1655
|
let t = O(8), n, r;
|
|
1655
1656
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1656
1657
|
let i;
|
|
@@ -1660,7 +1661,7 @@ var qr = (e) => {
|
|
|
1660
1661
|
className: i,
|
|
1661
1662
|
...r
|
|
1662
1663
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1663
|
-
},
|
|
1664
|
+
}, Xr = (e) => {
|
|
1664
1665
|
let t = O(15), n, r, i;
|
|
1665
1666
|
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);
|
|
1666
1667
|
let a;
|
|
@@ -1675,7 +1676,7 @@ var qr = (e) => {
|
|
|
1675
1676
|
let c;
|
|
1676
1677
|
t[9] === s ? c = t[10] : (c = /* @__PURE__ */ M("div", {
|
|
1677
1678
|
className: "bg-muted/50 rounded-md",
|
|
1678
|
-
children: /* @__PURE__ */ M(
|
|
1679
|
+
children: /* @__PURE__ */ M(Ur, {
|
|
1679
1680
|
code: s,
|
|
1680
1681
|
language: "json"
|
|
1681
1682
|
})
|
|
@@ -1686,7 +1687,7 @@ var qr = (e) => {
|
|
|
1686
1687
|
...i,
|
|
1687
1688
|
children: [o, c]
|
|
1688
1689
|
}), t[11] = i, t[12] = a, t[13] = c, t[14] = l) : l = t[14], l;
|
|
1689
|
-
},
|
|
1690
|
+
}, Zr = (e) => {
|
|
1690
1691
|
let t = O(24), n, r, i, a;
|
|
1691
1692
|
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;
|
|
1692
1693
|
let o;
|
|
@@ -1701,7 +1702,7 @@ var qr = (e) => {
|
|
|
1701
1702
|
let d;
|
|
1702
1703
|
t[11] === r ? d = t[12] : (d = r && /* @__PURE__ */ M("div", { children: r }), t[11] = r, t[12] = d);
|
|
1703
1704
|
let f;
|
|
1704
|
-
t[13] === i ? f = t[14] : (f =
|
|
1705
|
+
t[13] === i ? f = t[14] : (f = Qr(i), t[13] = i, t[14] = f);
|
|
1705
1706
|
let p;
|
|
1706
1707
|
t[15] !== u || t[16] !== d || t[17] !== f ? (p = /* @__PURE__ */ N("div", {
|
|
1707
1708
|
className: u,
|
|
@@ -1714,106 +1715,106 @@ var qr = (e) => {
|
|
|
1714
1715
|
children: [c, p]
|
|
1715
1716
|
}), t[19] = a, t[20] = o, t[21] = c, t[22] = p, t[23] = m) : m = t[23], m;
|
|
1716
1717
|
};
|
|
1717
|
-
function
|
|
1718
|
-
return typeof e == "string" ? /* @__PURE__ */ M(
|
|
1718
|
+
function Qr(e) {
|
|
1719
|
+
return typeof e == "string" ? /* @__PURE__ */ M(Ur, {
|
|
1719
1720
|
code: e,
|
|
1720
1721
|
language: "json"
|
|
1721
|
-
}) : s(e) ? /* @__PURE__ */ M("div", { children: e }) : typeof e == "object" ? /* @__PURE__ */ M(
|
|
1722
|
+
}) : s(e) ? /* @__PURE__ */ M("div", { children: e }) : typeof e == "object" ? /* @__PURE__ */ M(Ur, {
|
|
1722
1723
|
code: JSON.stringify(e, null, 2),
|
|
1723
1724
|
language: "json"
|
|
1724
1725
|
}) : typeof e == "number" || typeof e == "bigint" ? /* @__PURE__ */ M("div", { children: e }) : /* @__PURE__ */ M("div", {});
|
|
1725
1726
|
}
|
|
1726
1727
|
//#endregion
|
|
1727
1728
|
//#region src/lib/components/tool-debug.tsx
|
|
1728
|
-
function
|
|
1729
|
+
function $r(e) {
|
|
1729
1730
|
let t = O(20), { part: n } = e, r;
|
|
1730
1731
|
t[0] === n ? r = t[1] : (r = b(n), t[0] = n, t[1] = r);
|
|
1731
1732
|
let i = `Executing ${r}`, a;
|
|
1732
|
-
t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M(
|
|
1733
|
+
t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M(Jr, {
|
|
1733
1734
|
title: i,
|
|
1734
1735
|
part: n
|
|
1735
1736
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4];
|
|
1736
1737
|
let o;
|
|
1737
|
-
t[5] === n.input ? o = t[6] : (o = /* @__PURE__ */ M(
|
|
1738
|
+
t[5] === n.input ? o = t[6] : (o = /* @__PURE__ */ M(Xr, { input: n.input }), t[5] = n.input, t[6] = o);
|
|
1738
1739
|
let s;
|
|
1739
1740
|
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);
|
|
1740
1741
|
let c;
|
|
1741
|
-
t[9] === s ? c = t[10] : (c = /* @__PURE__ */ M(
|
|
1742
|
+
t[9] === s ? c = t[10] : (c = /* @__PURE__ */ M(Y, {
|
|
1742
1743
|
className: "break-all",
|
|
1743
1744
|
children: s
|
|
1744
1745
|
}), t[9] = s, t[10] = c);
|
|
1745
1746
|
let l;
|
|
1746
|
-
t[11] !== n.errorText || t[12] !== c ? (l = /* @__PURE__ */ M(
|
|
1747
|
+
t[11] !== n.errorText || t[12] !== c ? (l = /* @__PURE__ */ M(Zr, {
|
|
1747
1748
|
output: c,
|
|
1748
1749
|
errorText: n.errorText
|
|
1749
1750
|
}), t[11] = n.errorText, t[12] = c, t[13] = l) : l = t[13];
|
|
1750
1751
|
let u;
|
|
1751
|
-
t[14] !== o || t[15] !== l ? (u = /* @__PURE__ */ N(
|
|
1752
|
+
t[14] !== o || t[15] !== l ? (u = /* @__PURE__ */ N(Yr, { children: [o, l] }), t[14] = o, t[15] = l, t[16] = u) : u = t[16];
|
|
1752
1753
|
let d;
|
|
1753
|
-
return t[17] !== a || t[18] !== u ? (d = /* @__PURE__ */ N(
|
|
1754
|
+
return t[17] !== a || t[18] !== u ? (d = /* @__PURE__ */ N(Kr, {
|
|
1754
1755
|
"data-copy-exclude": "assistant-snapshot",
|
|
1755
1756
|
children: [a, u]
|
|
1756
1757
|
}), t[17] = a, t[18] = u, t[19] = d) : d = t[19], d;
|
|
1757
1758
|
}
|
|
1758
|
-
function
|
|
1759
|
+
function ei(e) {
|
|
1759
1760
|
let t = O(18), { part: n } = e, r = `Executing ${n.toolName}`, i;
|
|
1760
|
-
t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(
|
|
1761
|
+
t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(Jr, {
|
|
1761
1762
|
title: r,
|
|
1762
1763
|
part: n
|
|
1763
1764
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2];
|
|
1764
1765
|
let a;
|
|
1765
|
-
t[3] === n.input ? a = t[4] : (a = /* @__PURE__ */ M(
|
|
1766
|
+
t[3] === n.input ? a = t[4] : (a = /* @__PURE__ */ M(Xr, { input: n.input }), t[3] = n.input, t[4] = a);
|
|
1766
1767
|
let o;
|
|
1767
1768
|
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);
|
|
1768
1769
|
let s;
|
|
1769
|
-
t[7] === o ? s = t[8] : (s = /* @__PURE__ */ M(
|
|
1770
|
+
t[7] === o ? s = t[8] : (s = /* @__PURE__ */ M(Y, {
|
|
1770
1771
|
className: "break-all",
|
|
1771
1772
|
children: o
|
|
1772
1773
|
}), t[7] = o, t[8] = s);
|
|
1773
1774
|
let c;
|
|
1774
|
-
t[9] !== n.errorText || t[10] !== s ? (c = /* @__PURE__ */ M(
|
|
1775
|
+
t[9] !== n.errorText || t[10] !== s ? (c = /* @__PURE__ */ M(Zr, {
|
|
1775
1776
|
output: s,
|
|
1776
1777
|
errorText: n.errorText
|
|
1777
1778
|
}), t[9] = n.errorText, t[10] = s, t[11] = c) : c = t[11];
|
|
1778
1779
|
let l;
|
|
1779
|
-
t[12] !== a || t[13] !== c ? (l = /* @__PURE__ */ N(
|
|
1780
|
+
t[12] !== a || t[13] !== c ? (l = /* @__PURE__ */ N(Yr, { children: [a, c] }), t[12] = a, t[13] = c, t[14] = l) : l = t[14];
|
|
1780
1781
|
let u;
|
|
1781
|
-
return t[15] !== i || t[16] !== l ? (u = /* @__PURE__ */ N(
|
|
1782
|
+
return t[15] !== i || t[16] !== l ? (u = /* @__PURE__ */ N(Kr, {
|
|
1782
1783
|
"data-copy-exclude": "assistant-snapshot",
|
|
1783
1784
|
children: [i, l]
|
|
1784
1785
|
}), t[15] = i, t[16] = l, t[17] = u) : u = t[17], u;
|
|
1785
1786
|
}
|
|
1786
1787
|
//#endregion
|
|
1787
1788
|
//#region src/lib/copy/copy-image.ts
|
|
1788
|
-
var
|
|
1789
|
+
var ti = "data-copy-exclude", ni = {
|
|
1789
1790
|
image: "image",
|
|
1790
1791
|
assistantSnapshot: "assistant-snapshot"
|
|
1791
1792
|
};
|
|
1792
|
-
function
|
|
1793
|
+
function ri(e) {
|
|
1793
1794
|
return typeof e == "object" && !!e && "getAttribute" in e && typeof e.getAttribute == "function";
|
|
1794
1795
|
}
|
|
1795
|
-
function
|
|
1796
|
-
if (!
|
|
1797
|
-
let n = e.getAttribute(
|
|
1796
|
+
function ii(e, t) {
|
|
1797
|
+
if (!ri(e)) return !1;
|
|
1798
|
+
let n = e.getAttribute(ti);
|
|
1798
1799
|
return n ? n.split(/\s+/).includes(t) : !1;
|
|
1799
1800
|
}
|
|
1800
|
-
function
|
|
1801
|
-
return !
|
|
1801
|
+
function ai(e, t) {
|
|
1802
|
+
return !ii(e, t);
|
|
1802
1803
|
}
|
|
1803
|
-
function
|
|
1804
|
+
function oi({ clipboard: e, ClipboardItem: t }) {
|
|
1804
1805
|
return typeof e?.write == "function" && typeof t == "function" ? "image" : typeof e?.writeText == "function" ? "text" : "none";
|
|
1805
1806
|
}
|
|
1806
1807
|
//#endregion
|
|
1807
1808
|
//#region src/lib/copy/snapshot-context.ts
|
|
1808
|
-
var
|
|
1809
|
+
var si = o(!1);
|
|
1809
1810
|
//#endregion
|
|
1810
1811
|
//#region src/lib/copy/snapshot-render.tsx
|
|
1811
|
-
function
|
|
1812
|
+
function ci() {
|
|
1812
1813
|
return new Promise((e) => {
|
|
1813
1814
|
requestAnimationFrame(() => e());
|
|
1814
1815
|
});
|
|
1815
1816
|
}
|
|
1816
|
-
function
|
|
1817
|
+
function li(e) {
|
|
1817
1818
|
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;
|
|
1818
1819
|
if (typeof document > "u") return null;
|
|
1819
1820
|
let u;
|
|
@@ -1834,7 +1835,7 @@ function ui(e) {
|
|
|
1834
1835
|
return t[4] !== r || t[5] !== l || t[6] !== n || t[7] !== d ? (f = Ct(/* @__PURE__ */ M("div", {
|
|
1835
1836
|
"aria-hidden": "true",
|
|
1836
1837
|
style: u,
|
|
1837
|
-
children: /* @__PURE__ */ M(
|
|
1838
|
+
children: /* @__PURE__ */ M(si, {
|
|
1838
1839
|
value: !0,
|
|
1839
1840
|
children: /* @__PURE__ */ M("div", {
|
|
1840
1841
|
ref: n,
|
|
@@ -1847,13 +1848,13 @@ function ui(e) {
|
|
|
1847
1848
|
}
|
|
1848
1849
|
//#endregion
|
|
1849
1850
|
//#region src/lib/copy/use-copy-element-as-image.ts
|
|
1850
|
-
function
|
|
1851
|
+
function ui(e) {
|
|
1851
1852
|
let t = getComputedStyle(e).backgroundColor;
|
|
1852
1853
|
if (t !== "rgba(0, 0, 0, 0)") return t;
|
|
1853
1854
|
let n = getComputedStyle(document.body).backgroundColor;
|
|
1854
1855
|
return n === "rgba(0, 0, 0, 0)" ? void 0 : n;
|
|
1855
1856
|
}
|
|
1856
|
-
function
|
|
1857
|
+
function di({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
1857
1858
|
let r = St(), [i, a] = g(!1), [o, s] = g(null), c = h(null), l = u(() => {
|
|
1858
1859
|
c.current !== null && (r.clearTimeout(c.current), c.current = null);
|
|
1859
1860
|
}, [r]), f = u((e) => {
|
|
@@ -1870,9 +1871,9 @@ function fi({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1870
1871
|
}), !0), [n, f]), m = u(async () => {
|
|
1871
1872
|
if (!e.current) throw Error("Nothing is ready to copy yet.");
|
|
1872
1873
|
let { toBlob: n } = await import("html-to-image"), r = await n(e.current, {
|
|
1873
|
-
backgroundColor:
|
|
1874
|
+
backgroundColor: ui(e.current),
|
|
1874
1875
|
pixelRatio: 2,
|
|
1875
|
-
filter: (e) =>
|
|
1876
|
+
filter: (e) => ai(e, t)
|
|
1876
1877
|
});
|
|
1877
1878
|
if (!r) throw Error("Unable to render the image for copying.");
|
|
1878
1879
|
await navigator.clipboard.write([new ClipboardItem({ [r.type]: r })]), f({
|
|
@@ -1888,7 +1889,7 @@ function fi({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1888
1889
|
copy: u(async () => {
|
|
1889
1890
|
a(!0), s(null);
|
|
1890
1891
|
try {
|
|
1891
|
-
let e =
|
|
1892
|
+
let e = oi({
|
|
1892
1893
|
clipboard: typeof navigator > "u" ? void 0 : navigator.clipboard,
|
|
1893
1894
|
ClipboardItem: typeof window > "u" ? void 0 : window.ClipboardItem
|
|
1894
1895
|
});
|
|
@@ -1923,30 +1924,34 @@ function fi({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1923
1924
|
}
|
|
1924
1925
|
//#endregion
|
|
1925
1926
|
//#region src/lib/copy/assistant-snapshot.tsx
|
|
1926
|
-
|
|
1927
|
-
|
|
1927
|
+
var fi = /<\/?[a-z][\w]*-[\w-]*(?:\s+[^\s"'>/=]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*\/?>/gi, pi = /(```[\s\S]*?```|`[^`\n]+`)/;
|
|
1928
|
+
function mi(e) {
|
|
1929
|
+
return e.split(pi).map((e, t) => t % 2 == 1 ? e : e.replace(fi, "\0").replace(/ \0(?= )/g, "").replaceAll("\0", "")).join("");
|
|
1930
|
+
}
|
|
1931
|
+
function hi(e) {
|
|
1932
|
+
let t = en(e), n = e.parts.filter(C).map((e) => mi($t(e.text, U(e.citations)).reverse().reduce((e, { at: n, citation: r }) => `${e.slice(0, n)}[${tn(t, r.source.url)}]${e.slice(n)}`, e.text))).join("\n");
|
|
1928
1933
|
return t.length === 0 ? n : `${n}\n\n${t.map(({ url: e, title: t }, n) => `[${n + 1}] ${t ? `${t} — ` : ""}${e}`).join("\n")}`;
|
|
1929
1934
|
}
|
|
1930
|
-
function
|
|
1931
|
-
return l(
|
|
1935
|
+
function X() {
|
|
1936
|
+
return l(si);
|
|
1932
1937
|
}
|
|
1933
|
-
function
|
|
1938
|
+
function gi(e) {
|
|
1934
1939
|
let t = O(30), { message: n, renderContent: r, className: i } = e, a = h(null), [o, s] = g(!1), c;
|
|
1935
|
-
t[0] === n ? c = t[1] : (c =
|
|
1940
|
+
t[0] === n ? c = t[1] : (c = hi(n), t[0] = n, t[1] = c);
|
|
1936
1941
|
let l = c, u;
|
|
1937
1942
|
t[2] === l ? u = t[3] : (u = {
|
|
1938
1943
|
elementRef: a,
|
|
1939
|
-
excludeMode:
|
|
1944
|
+
excludeMode: ni.assistantSnapshot,
|
|
1940
1945
|
fallbackText: l
|
|
1941
1946
|
}, t[2] = l, t[3] = u);
|
|
1942
|
-
let { copy: d, feedback: f, isCopying: p } =
|
|
1947
|
+
let { copy: d, feedback: f, isCopying: p } = di(u), m;
|
|
1943
1948
|
t[4] !== d || t[5] !== o ? (m = async () => {
|
|
1944
|
-
o || s(!0), await
|
|
1949
|
+
o || s(!0), await ci(), await d();
|
|
1945
1950
|
}, t[4] = d, t[5] = o, t[6] = m) : m = t[6];
|
|
1946
1951
|
let _ = m, v = "Copy snapshot";
|
|
1947
1952
|
p ? v = "Copying snapshot" : f?.kind === "success" && (v = f.mode === "image" ? "Copied snapshot" : "Copied text");
|
|
1948
1953
|
let y;
|
|
1949
|
-
t[7] !== r || t[8] !== o ? (y = o && /* @__PURE__ */ M(
|
|
1954
|
+
t[7] !== r || t[8] !== o ? (y = o && /* @__PURE__ */ M(li, {
|
|
1950
1955
|
contentRef: a,
|
|
1951
1956
|
children: r()
|
|
1952
1957
|
}), t[7] = r, t[8] = o, t[9] = y) : y = t[9];
|
|
@@ -1982,41 +1987,41 @@ function mi(e) {
|
|
|
1982
1987
|
}
|
|
1983
1988
|
//#endregion
|
|
1984
1989
|
//#region src/lib/tools/helpers.ts
|
|
1985
|
-
function
|
|
1990
|
+
function _i(e) {
|
|
1986
1991
|
return w(e) && e.toolMetadata?.kind === "subagent";
|
|
1987
1992
|
}
|
|
1988
|
-
function
|
|
1993
|
+
function vi(e) {
|
|
1989
1994
|
let t = e.toolMetadata?.displayName;
|
|
1990
1995
|
return typeof t == "string" ? t : "Subagent";
|
|
1991
1996
|
}
|
|
1992
|
-
function
|
|
1997
|
+
function yi(e, t) {
|
|
1993
1998
|
let n = y(e);
|
|
1994
1999
|
return {
|
|
1995
2000
|
toolKey: n,
|
|
1996
2001
|
toolEntry: t?.[n]
|
|
1997
2002
|
};
|
|
1998
2003
|
}
|
|
1999
|
-
function
|
|
2004
|
+
function bi(e, t) {
|
|
2000
2005
|
return e?.static === !1 && !!e?.requiresUserInput && t === "input-available";
|
|
2001
2006
|
}
|
|
2002
2007
|
//#endregion
|
|
2003
2008
|
//#region src/lib/chat/markdown-paragraph.tsx
|
|
2004
|
-
var
|
|
2005
|
-
function
|
|
2009
|
+
var xi = /* @__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("."));
|
|
2010
|
+
function Si(e) {
|
|
2006
2011
|
if (!n.isValidElement(e)) return !1;
|
|
2007
2012
|
let t = typeof e.type == "string" ? e.type : e.props.node?.tagName;
|
|
2008
|
-
return t === void 0 || !
|
|
2013
|
+
return t === void 0 || !xi.has(t);
|
|
2009
2014
|
}
|
|
2010
|
-
function
|
|
2015
|
+
function Ci(e) {
|
|
2011
2016
|
let t = O(6), { children: r, dir: i } = e, a = n.Children.toArray(r);
|
|
2012
|
-
if (!a.some(
|
|
2017
|
+
if (!a.some(Si)) {
|
|
2013
2018
|
let e;
|
|
2014
2019
|
return t[0] !== r || t[1] !== i ? (e = /* @__PURE__ */ M("p", {
|
|
2015
2020
|
dir: i,
|
|
2016
2021
|
children: r
|
|
2017
2022
|
}), t[0] = r, t[1] = i, t[2] = e) : e = t[2], e;
|
|
2018
2023
|
}
|
|
2019
|
-
if (a.every(
|
|
2024
|
+
if (a.every(Si)) return r;
|
|
2020
2025
|
let o;
|
|
2021
2026
|
return t[3] !== r || t[4] !== i ? (o = /* @__PURE__ */ M("div", {
|
|
2022
2027
|
dir: i,
|
|
@@ -2025,35 +2030,35 @@ function xi(e) {
|
|
|
2025
2030
|
}
|
|
2026
2031
|
//#endregion
|
|
2027
2032
|
//#region src/lib/components/InteractiveResponse.tsx
|
|
2028
|
-
var
|
|
2033
|
+
var wi = { p: ({ children: e, dir: t }) => /* @__PURE__ */ M(Ci, {
|
|
2029
2034
|
dir: t,
|
|
2030
2035
|
children: e
|
|
2031
2036
|
}) };
|
|
2032
|
-
function
|
|
2033
|
-
let t = { ...
|
|
2037
|
+
function Ti(e) {
|
|
2038
|
+
let t = { ...wi }, n = {};
|
|
2034
2039
|
for (let r of e) ae(r), t[r.name] = r.component, n[r.name] = r.allowedAttributes;
|
|
2035
2040
|
return {
|
|
2036
2041
|
components: t,
|
|
2037
2042
|
allowedTags: n
|
|
2038
2043
|
};
|
|
2039
2044
|
}
|
|
2040
|
-
function
|
|
2045
|
+
function Ei(e) {
|
|
2041
2046
|
let t = O(10), n, r;
|
|
2042
2047
|
t[0] === e ? (n = t[1], r = t[2]) : ({elements: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
2043
2048
|
let i;
|
|
2044
2049
|
t[3] === n ? i = t[4] : (i = n ?? [], t[3] = n, t[4] = i);
|
|
2045
2050
|
let a;
|
|
2046
|
-
t[5] === i ? a = t[6] : (a =
|
|
2051
|
+
t[5] === i ? a = t[6] : (a = Ti(i), t[5] = i, t[6] = a);
|
|
2047
2052
|
let o = a, s;
|
|
2048
|
-
return t[7] !== r || t[8] !== o ? (s = /* @__PURE__ */ M(
|
|
2053
|
+
return t[7] !== r || t[8] !== o ? (s = /* @__PURE__ */ M(Y, {
|
|
2049
2054
|
...o,
|
|
2050
2055
|
...r
|
|
2051
2056
|
}), t[7] = r, t[8] = o, t[9] = s) : s = t[9], s;
|
|
2052
2057
|
}
|
|
2053
2058
|
//#endregion
|
|
2054
2059
|
//#region src/lib/renderers/render-part.tsx
|
|
2055
|
-
function
|
|
2056
|
-
let t = O(22), { part: n } = e, { addToolApprovalResponse: r } =
|
|
2060
|
+
function Di(e) {
|
|
2061
|
+
let t = O(22), { part: n } = e, { addToolApprovalResponse: r } = H();
|
|
2057
2062
|
if (n.state !== "approval-requested") return null;
|
|
2058
2063
|
let i;
|
|
2059
2064
|
t[0] === n ? i = t[1] : (i = n.title ?? y(n), t[0] = n, t[1] = i);
|
|
@@ -2105,21 +2110,21 @@ function Ti(e) {
|
|
|
2105
2110
|
children: [l, f]
|
|
2106
2111
|
}), t[18] = o, t[19] = l, t[20] = f, t[21] = p) : p = t[21], p;
|
|
2107
2112
|
}
|
|
2108
|
-
function
|
|
2113
|
+
function Oi(e) {
|
|
2109
2114
|
let t = O(25), { part: n } = e, { registry: r } = z();
|
|
2110
2115
|
if (n.input === void 0) {
|
|
2111
2116
|
let e;
|
|
2112
|
-
return t[0] !== n.errorText || t[1] !== n.output || t[2] !== n.state ? (e = n.state === "output-error" ? /* @__PURE__ */ M(
|
|
2117
|
+
return t[0] !== n.errorText || t[1] !== n.output || t[2] !== n.state ? (e = n.state === "output-error" ? /* @__PURE__ */ M(Zr, {
|
|
2113
2118
|
output: n.output,
|
|
2114
2119
|
errorText: n.errorText
|
|
2115
2120
|
}) : /* @__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;
|
|
2116
2121
|
}
|
|
2117
2122
|
let i;
|
|
2118
|
-
t[4] === n ? i = t[5] : (i = /* @__PURE__ */ M(
|
|
2123
|
+
t[4] === n ? i = t[5] : (i = /* @__PURE__ */ M(Di, { part: n }), t[4] = n, t[5] = i);
|
|
2119
2124
|
let a = i;
|
|
2120
2125
|
if (!r) return a;
|
|
2121
2126
|
let o;
|
|
2122
|
-
t[6] !== n || t[7] !== r ? (o =
|
|
2127
|
+
t[6] !== n || t[7] !== r ? (o = yi(n, r), t[6] = n, t[7] = r, t[8] = o) : o = t[8];
|
|
2123
2128
|
let { toolEntry: s } = o;
|
|
2124
2129
|
if (s) {
|
|
2125
2130
|
let e = s.component, i;
|
|
@@ -2144,8 +2149,8 @@ function Ei(e) {
|
|
|
2144
2149
|
}
|
|
2145
2150
|
//#endregion
|
|
2146
2151
|
//#region src/lib/chat/message-parts.tsx
|
|
2147
|
-
var
|
|
2148
|
-
function
|
|
2152
|
+
var ki = { animation: "slideUp" };
|
|
2153
|
+
function Ai(e) {
|
|
2149
2154
|
let t = O(3), { filename: n, url: r } = e, i = n ?? "Attached image", a;
|
|
2150
2155
|
return t[0] !== i || t[1] !== r ? (a = /* @__PURE__ */ M("img", {
|
|
2151
2156
|
src: r,
|
|
@@ -2153,7 +2158,7 @@ function Oi(e) {
|
|
|
2153
2158
|
className: "max-h-64 rounded-md border object-contain"
|
|
2154
2159
|
}), t[0] = i, t[1] = r, t[2] = a) : a = t[2], a;
|
|
2155
2160
|
}
|
|
2156
|
-
function
|
|
2161
|
+
function ji(e) {
|
|
2157
2162
|
let t = O(16), { filename: n, mediaType: r, url: i } = e, a = n || "Untitled", o;
|
|
2158
2163
|
t[0] !== r || t[1] !== a || t[2] !== i ? (o = i?.startsWith("data:") ? null : i && r.startsWith("video/") ? /* @__PURE__ */ M("video", {
|
|
2159
2164
|
controls: !0,
|
|
@@ -2199,27 +2204,27 @@ function ki(e) {
|
|
|
2199
2204
|
children: [s, d]
|
|
2200
2205
|
}), t[13] = s, t[14] = d, t[15] = f) : f = t[15], f;
|
|
2201
2206
|
}
|
|
2202
|
-
function
|
|
2207
|
+
function Mi(e) {
|
|
2203
2208
|
let t = O(4), { filename: n, mediaType: r, url: i } = e, a;
|
|
2204
|
-
return t[0] !== n || t[1] !== r || t[2] !== i ? (a = r.split("/")[0] === "image" ? /* @__PURE__ */ M(
|
|
2209
|
+
return t[0] !== n || t[1] !== r || t[2] !== i ? (a = r.split("/")[0] === "image" ? /* @__PURE__ */ M(Ai, {
|
|
2205
2210
|
filename: n,
|
|
2206
2211
|
url: i
|
|
2207
|
-
}) : /* @__PURE__ */ M(
|
|
2212
|
+
}) : /* @__PURE__ */ M(ji, {
|
|
2208
2213
|
filename: n,
|
|
2209
2214
|
mediaType: r,
|
|
2210
2215
|
url: i
|
|
2211
2216
|
}), t[0] = n, t[1] = r, t[2] = i, t[3] = a) : a = t[3], a;
|
|
2212
2217
|
}
|
|
2213
|
-
var
|
|
2214
|
-
function
|
|
2215
|
-
return
|
|
2218
|
+
var Ni = "genai-citation";
|
|
2219
|
+
function Pi(e, t) {
|
|
2220
|
+
return $t(e, t).reverse().reduce((e, { at: t, order: n }) => `${e.slice(0, t)}<${Ni} citation="${n}" />${e.slice(t)}`, e);
|
|
2216
2221
|
}
|
|
2217
|
-
var
|
|
2218
|
-
function
|
|
2219
|
-
let t = O(16), n = l(
|
|
2222
|
+
var Fi = o(null);
|
|
2223
|
+
function Ii(e) {
|
|
2224
|
+
let t = O(16), n = l(Fi), r = n?.citations[Number(e.citation)];
|
|
2220
2225
|
if (!n || !r) return null;
|
|
2221
2226
|
let i;
|
|
2222
|
-
t[0] !== r.source.url || t[1] !== n.sources ? (i =
|
|
2227
|
+
t[0] !== r.source.url || t[1] !== n.sources ? (i = tn(n.sources, r.source.url), t[0] = r.source.url, t[1] = n.sources, t[2] = i) : i = t[2];
|
|
2223
2228
|
let a = i;
|
|
2224
2229
|
if (a === null) return null;
|
|
2225
2230
|
if (n.HostCitation) {
|
|
@@ -2240,22 +2245,22 @@ function Pi(e) {
|
|
|
2240
2245
|
children: r.citedText
|
|
2241
2246
|
}) : null, t[10] = r.citedText, t[11] = s);
|
|
2242
2247
|
let c;
|
|
2243
|
-
return t[12] !== a || t[13] !== o || t[14] !== s ? (c = /* @__PURE__ */ M(
|
|
2248
|
+
return t[12] !== a || t[13] !== o || t[14] !== s ? (c = /* @__PURE__ */ M(Zn, {
|
|
2244
2249
|
source: o,
|
|
2245
2250
|
index: a,
|
|
2246
2251
|
children: s
|
|
2247
2252
|
}), t[12] = a, t[13] = o, t[14] = s, t[15] = c) : c = t[15], c;
|
|
2248
2253
|
}
|
|
2249
|
-
var
|
|
2250
|
-
name:
|
|
2254
|
+
var Li = {
|
|
2255
|
+
name: Ni,
|
|
2251
2256
|
allowedAttributes: ["citation"],
|
|
2252
|
-
component:
|
|
2257
|
+
component: Ii
|
|
2253
2258
|
};
|
|
2254
|
-
function
|
|
2255
|
-
let t = O(27), { text: n, citations: r, elements: i, className: a } = e, { status: o } =
|
|
2256
|
-
t[0] === r ? u = t[1] : (u =
|
|
2259
|
+
function Ri(e) {
|
|
2260
|
+
let t = O(27), { text: n, citations: r, elements: i, className: a } = e, { status: o } = B(), s = X(), { citation: c } = G(), { message: l } = q(), u;
|
|
2261
|
+
t[0] === r ? u = t[1] : (u = U(r), t[0] = r, t[1] = u);
|
|
2257
2262
|
let d = u, f;
|
|
2258
|
-
t[2] === l ? f = t[3] : (f =
|
|
2263
|
+
t[2] === l ? f = t[3] : (f = en(l), t[2] = l, t[3] = f);
|
|
2259
2264
|
let p;
|
|
2260
2265
|
t[4] !== c || t[5] !== f || t[6] !== d ? (p = {
|
|
2261
2266
|
citations: d,
|
|
@@ -2263,15 +2268,15 @@ function Ii(e) {
|
|
|
2263
2268
|
HostCitation: c
|
|
2264
2269
|
}, t[4] = c, t[5] = f, t[6] = d, t[7] = p) : p = t[7];
|
|
2265
2270
|
let m = p, h = d.length > 0, g;
|
|
2266
|
-
t[8] !== i || t[9] !== h ? (g = h ? [...i ?? [],
|
|
2271
|
+
t[8] !== i || t[9] !== h ? (g = h ? [...i ?? [], Li] : i, t[8] = i, t[9] = h, t[10] = g) : g = t[10];
|
|
2267
2272
|
let _ = g, v;
|
|
2268
2273
|
t[11] === a ? v = t[12] : (v = k("text-sm", a), t[11] = a, t[12] = v);
|
|
2269
2274
|
let y = !s && o === "streaming", b;
|
|
2270
|
-
t[13] !== h || t[14] !== n || t[15] !== d ? (b = h ?
|
|
2275
|
+
t[13] !== h || t[14] !== n || t[15] !== d ? (b = h ? Pi(n, d) : n, t[13] = h, t[14] = n, t[15] = d, t[16] = b) : b = t[16];
|
|
2271
2276
|
let x;
|
|
2272
|
-
t[17] !== y || t[18] !== b || t[19] !== _ ? (x = /* @__PURE__ */ M(
|
|
2277
|
+
t[17] !== y || t[18] !== b || t[19] !== _ ? (x = /* @__PURE__ */ M(Ei, {
|
|
2273
2278
|
elements: _,
|
|
2274
|
-
animated:
|
|
2279
|
+
animated: ki,
|
|
2275
2280
|
isAnimating: y,
|
|
2276
2281
|
children: b
|
|
2277
2282
|
}), t[17] = y, t[18] = b, t[19] = _, t[20] = x) : x = t[20];
|
|
@@ -2281,60 +2286,64 @@ function Ii(e) {
|
|
|
2281
2286
|
children: x
|
|
2282
2287
|
}), t[21] = v, t[22] = x, t[23] = S) : S = t[23];
|
|
2283
2288
|
let C;
|
|
2284
|
-
return t[24] !== m || t[25] !== S ? (C = /* @__PURE__ */ M(
|
|
2289
|
+
return t[24] !== m || t[25] !== S ? (C = /* @__PURE__ */ M(Fi, {
|
|
2285
2290
|
value: m,
|
|
2286
2291
|
children: S
|
|
2287
2292
|
}), t[24] = m, t[25] = S, t[26] = C) : C = t[26], C;
|
|
2288
2293
|
}
|
|
2289
|
-
function
|
|
2290
|
-
let t = O(8), { part: n } = e, r =
|
|
2291
|
-
t[0] !== n || t[1] !== r ? (i = r && /* @__PURE__ */ M(
|
|
2294
|
+
function zi(e) {
|
|
2295
|
+
let t = O(8), { part: n } = e, r = Bi(), i;
|
|
2296
|
+
t[0] !== n || t[1] !== r ? (i = r && /* @__PURE__ */ M($r, { part: n }), t[0] = n, t[1] = r, t[2] = i) : i = t[2];
|
|
2292
2297
|
let a;
|
|
2293
|
-
t[3] === n ? a = t[4] : (a = /* @__PURE__ */ M(
|
|
2298
|
+
t[3] === n ? a = t[4] : (a = /* @__PURE__ */ M(Oi, { part: n }), t[3] = n, t[4] = a);
|
|
2294
2299
|
let o;
|
|
2295
2300
|
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;
|
|
2296
2301
|
}
|
|
2297
|
-
function
|
|
2298
|
-
let { debugMode: e } = z(), t =
|
|
2302
|
+
function Bi() {
|
|
2303
|
+
let { debugMode: e } = z(), t = X();
|
|
2299
2304
|
return !!e && !t;
|
|
2300
2305
|
}
|
|
2301
2306
|
//#endregion
|
|
2302
2307
|
//#region src/lib/chat/trajectory/tool-label.tsx
|
|
2303
|
-
function
|
|
2308
|
+
function Vi(e) {
|
|
2304
2309
|
return !!e && e !== "output-available";
|
|
2305
2310
|
}
|
|
2306
|
-
function
|
|
2307
|
-
let t = O(5), { label: n, part: r, state: i } = e, a =
|
|
2308
|
-
return t[0] !== a || t[1] !== n || t[2] !== r || t[3] !== i ? (o = !a && !!n.actions && !!r && !
|
|
2311
|
+
function Hi(e) {
|
|
2312
|
+
let t = O(5), { label: n, part: r, state: i } = e, a = X(), o;
|
|
2313
|
+
return t[0] !== a || t[1] !== n || t[2] !== r || t[3] !== i ? (o = !a && !!n.actions && !!r && !Vi(i), t[0] = a, t[1] = n, t[2] = r, t[3] = i, t[4] = o) : o = t[4], o;
|
|
2309
2314
|
}
|
|
2310
|
-
function
|
|
2311
|
-
let t = O(
|
|
2315
|
+
function Ui(e) {
|
|
2316
|
+
let t = O(20), { label: n, part: r } = e, i = n.icon, a = n.actions, o;
|
|
2312
2317
|
t[0] !== n || t[1] !== r ? (o = {
|
|
2313
2318
|
label: n,
|
|
2314
2319
|
part: r,
|
|
2315
2320
|
state: r.state
|
|
2316
2321
|
}, t[0] = n, t[1] = r, t[2] = o) : o = t[2];
|
|
2317
|
-
let s =
|
|
2322
|
+
let s = Hi(o), c;
|
|
2318
2323
|
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];
|
|
2319
2324
|
let l;
|
|
2320
|
-
t[6]
|
|
2325
|
+
t[6] !== n.kind || t[7] !== n.name || t[8] !== n.text ? (l = n.kind === "sentence" ? /* @__PURE__ */ M("span", {
|
|
2326
|
+
dir: "auto",
|
|
2327
|
+
className: "text-start",
|
|
2328
|
+
children: n.text
|
|
2329
|
+
}) : /* @__PURE__ */ M("span", {
|
|
2321
2330
|
className: "font-mono",
|
|
2322
2331
|
children: n.name
|
|
2323
|
-
}), t[6] = n.
|
|
2332
|
+
}), t[6] = n.kind, t[7] = n.name, t[8] = n.text, t[9] = l) : l = t[9];
|
|
2324
2333
|
let u;
|
|
2325
|
-
t[
|
|
2334
|
+
t[10] !== c || t[11] !== l ? (u = /* @__PURE__ */ N("div", {
|
|
2326
2335
|
className: "flex items-center gap-1.5",
|
|
2327
2336
|
children: [c, l]
|
|
2328
|
-
}), t[
|
|
2337
|
+
}), t[10] = c, t[11] = l, t[12] = u) : u = t[12];
|
|
2329
2338
|
let d;
|
|
2330
|
-
t[
|
|
2339
|
+
t[13] !== a || t[14] !== r || t[15] !== s ? (d = s && a && /* @__PURE__ */ M(a, { part: r }), t[13] = a, t[14] = r, t[15] = s, t[16] = d) : d = t[16];
|
|
2331
2340
|
let f;
|
|
2332
|
-
return t[
|
|
2341
|
+
return t[17] !== u || t[18] !== d ? (f = /* @__PURE__ */ N("div", {
|
|
2333
2342
|
className: "text-muted-foreground flex items-center justify-between gap-1.5 text-xs",
|
|
2334
2343
|
children: [u, d]
|
|
2335
|
-
}), t[
|
|
2344
|
+
}), t[17] = u, t[18] = d, t[19] = f) : f = t[19], f;
|
|
2336
2345
|
}
|
|
2337
|
-
function
|
|
2346
|
+
function Wi(e) {
|
|
2338
2347
|
let t = O(3), { name: n, value: r } = e, i;
|
|
2339
2348
|
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ N("span", {
|
|
2340
2349
|
"data-slot": "tool-arg",
|
|
@@ -2346,26 +2355,28 @@ function Hi(e) {
|
|
|
2346
2355
|
]
|
|
2347
2356
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2], i;
|
|
2348
2357
|
}
|
|
2349
|
-
function
|
|
2350
|
-
let t = O(
|
|
2358
|
+
function Gi(e) {
|
|
2359
|
+
let t = O(24), { label: n, state: r, part: i, children: a } = e, o = n.actions, s;
|
|
2351
2360
|
t[0] !== n || t[1] !== i || t[2] !== r ? (s = {
|
|
2352
2361
|
label: n,
|
|
2353
2362
|
part: i,
|
|
2354
2363
|
state: r
|
|
2355
2364
|
}, t[0] = n, t[1] = i, t[2] = r, t[3] = s) : s = t[3];
|
|
2356
|
-
let c =
|
|
2357
|
-
t[4]
|
|
2358
|
-
|
|
2359
|
-
|
|
2365
|
+
let c = Hi(s), l = n.kind === "sentence", u;
|
|
2366
|
+
t[4] !== a || t[5] !== l || t[6] !== n.args || t[7] !== n.name || t[8] !== n.text ? (u = l ? /* @__PURE__ */ M("span", {
|
|
2367
|
+
dir: "auto",
|
|
2368
|
+
className: "text-muted-foreground min-w-0 truncate text-start text-xs",
|
|
2369
|
+
children: n.text
|
|
2370
|
+
}) : /* @__PURE__ */ N("span", {
|
|
2360
2371
|
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-[',']",
|
|
2361
2372
|
children: [
|
|
2362
2373
|
n.name,
|
|
2363
2374
|
"(",
|
|
2364
2375
|
a,
|
|
2365
|
-
|
|
2376
|
+
n.args ? Object.entries(n.args).map(Ki) : "...",
|
|
2366
2377
|
")"
|
|
2367
2378
|
]
|
|
2368
|
-
}), t[
|
|
2379
|
+
}), t[4] = a, t[5] = l, t[6] = n.args, t[7] = n.name, t[8] = n.text, t[9] = u) : u = t[9];
|
|
2369
2380
|
let d;
|
|
2370
2381
|
t[10] !== o || t[11] !== i || t[12] !== c ? (d = c && o && i && /* @__PURE__ */ M("span", {
|
|
2371
2382
|
className: "shrink-0",
|
|
@@ -2377,35 +2388,36 @@ function Ui(e) {
|
|
|
2377
2388
|
children: [u, d]
|
|
2378
2389
|
}), t[14] = u, t[15] = d, t[16] = f) : f = t[16];
|
|
2379
2390
|
let p;
|
|
2380
|
-
t[17] !== n.detail || t[
|
|
2381
|
-
|
|
2391
|
+
t[17] !== l || t[18] !== n.detail || t[19] !== n.isError ? (p = n.detail && /* @__PURE__ */ M("span", {
|
|
2392
|
+
dir: l ? "auto" : void 0,
|
|
2393
|
+
className: k("line-clamp-3 text-start leading-relaxed whitespace-pre-wrap", l ? "text-xs" : "font-mono text-[10px]", n.isError ? "text-destructive/80" : "text-muted-foreground"),
|
|
2382
2394
|
children: n.detail
|
|
2383
|
-
}), t[17] = n.detail, t[
|
|
2395
|
+
}), t[17] = l, t[18] = n.detail, t[19] = n.isError, t[20] = p) : p = t[20];
|
|
2384
2396
|
let m;
|
|
2385
|
-
return t[
|
|
2397
|
+
return t[21] !== f || t[22] !== p ? (m = /* @__PURE__ */ N("span", {
|
|
2386
2398
|
className: "mb-2 flex flex-col gap-1",
|
|
2387
2399
|
children: [f, p]
|
|
2388
|
-
}), t[
|
|
2400
|
+
}), t[21] = f, t[22] = p, t[23] = m) : m = t[23], m;
|
|
2389
2401
|
}
|
|
2390
|
-
function
|
|
2402
|
+
function Ki(e) {
|
|
2391
2403
|
let [t, n] = e;
|
|
2392
|
-
return /* @__PURE__ */ M(
|
|
2404
|
+
return /* @__PURE__ */ M(Wi, {
|
|
2393
2405
|
name: t,
|
|
2394
2406
|
value: n
|
|
2395
2407
|
}, t);
|
|
2396
2408
|
}
|
|
2397
2409
|
//#endregion
|
|
2398
2410
|
//#region src/lib/chat/trajectory/segments/index.tsx
|
|
2399
|
-
function
|
|
2411
|
+
function qi(e) {
|
|
2400
2412
|
return e.type === "text" && e.providerMetadata?.openai?.phase === "commentary";
|
|
2401
2413
|
}
|
|
2402
|
-
function
|
|
2414
|
+
function Ji(e) {
|
|
2403
2415
|
let t = O(9), { segment: n, elements: r, className: i } = e, a;
|
|
2404
2416
|
if (t[0] !== i || t[1] !== r || t[2] !== n.parts) {
|
|
2405
2417
|
let e;
|
|
2406
2418
|
t[4] !== i || t[5] !== r ? (e = (e) => {
|
|
2407
2419
|
let { part: t, idx: n } = e;
|
|
2408
|
-
return t.type === "text" ? /* @__PURE__ */ M(
|
|
2420
|
+
return t.type === "text" ? /* @__PURE__ */ M(Ri, {
|
|
2409
2421
|
text: t.text,
|
|
2410
2422
|
citations: t.citations,
|
|
2411
2423
|
elements: r,
|
|
@@ -2416,27 +2428,27 @@ function Ki(e) {
|
|
|
2416
2428
|
let o;
|
|
2417
2429
|
return t[7] === a ? o = t[8] : (o = /* @__PURE__ */ M(j, { children: a }), t[7] = a, t[8] = o), o;
|
|
2418
2430
|
}
|
|
2419
|
-
function
|
|
2431
|
+
function Yi(e) {
|
|
2420
2432
|
let t = O(4), { segment: n } = e, { part: r } = n;
|
|
2421
2433
|
if (r.type !== "file") return null;
|
|
2422
2434
|
let i;
|
|
2423
|
-
return t[0] !== r.filename || t[1] !== r.mediaType || t[2] !== r.url ? (i = /* @__PURE__ */ M(
|
|
2435
|
+
return t[0] !== r.filename || t[1] !== r.mediaType || t[2] !== r.url ? (i = /* @__PURE__ */ M(Mi, {
|
|
2424
2436
|
filename: r.filename,
|
|
2425
2437
|
mediaType: r.mediaType,
|
|
2426
2438
|
url: r.url
|
|
2427
2439
|
}), t[0] = r.filename, t[1] = r.mediaType, t[2] = r.url, t[3] = i) : i = t[3], i;
|
|
2428
2440
|
}
|
|
2429
|
-
function
|
|
2430
|
-
let t = O(9), { segment: n } = e, { message: r } =
|
|
2431
|
-
t[0] === r ? i = t[1] : (i =
|
|
2441
|
+
function Xi(e) {
|
|
2442
|
+
let t = O(9), { segment: n } = e, { message: r } = q(), i;
|
|
2443
|
+
t[0] === r ? i = t[1] : (i = en(r), t[0] = r, t[1] = i);
|
|
2432
2444
|
let a = i, o;
|
|
2433
2445
|
if (t[2] !== n.parts || t[3] !== a) {
|
|
2434
2446
|
let e;
|
|
2435
2447
|
t[5] === a ? e = t[6] : (e = (e) => {
|
|
2436
2448
|
let { part: t, idx: n } = e;
|
|
2437
2449
|
if (t.type !== "source-url") return null;
|
|
2438
|
-
let r =
|
|
2439
|
-
return r === null ? null : /* @__PURE__ */ M(
|
|
2450
|
+
let r = tn(a, t.url);
|
|
2451
|
+
return r === null ? null : /* @__PURE__ */ M(Zn, {
|
|
2440
2452
|
source: {
|
|
2441
2453
|
url: t.url,
|
|
2442
2454
|
title: t.title
|
|
@@ -2448,40 +2460,40 @@ function Ji(e) {
|
|
|
2448
2460
|
let s;
|
|
2449
2461
|
return t[7] === o ? s = t[8] : (s = /* @__PURE__ */ M("span", { children: o }), t[7] = o, t[8] = s), s;
|
|
2450
2462
|
}
|
|
2451
|
-
function
|
|
2452
|
-
let t = O(3), { segment: n } = e, r =
|
|
2453
|
-
if (
|
|
2463
|
+
function Zi(e) {
|
|
2464
|
+
let t = O(3), { segment: n } = e, r = K();
|
|
2465
|
+
if (X()) return null;
|
|
2454
2466
|
let { part: i } = n;
|
|
2455
2467
|
if (i.type !== "reasoning") return null;
|
|
2456
2468
|
let a = r === "streaming", o;
|
|
2457
2469
|
return t[0] !== i.text || t[1] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
2458
2470
|
className: "text-muted-foreground text-xs",
|
|
2459
|
-
children: /* @__PURE__ */ M(
|
|
2460
|
-
animated:
|
|
2471
|
+
children: /* @__PURE__ */ M(Y, {
|
|
2472
|
+
animated: ki,
|
|
2461
2473
|
isAnimating: a,
|
|
2462
2474
|
children: i.text
|
|
2463
2475
|
})
|
|
2464
2476
|
}), t[0] = i.text, t[1] = a, t[2] = o) : o = t[2], o;
|
|
2465
2477
|
}
|
|
2466
|
-
function
|
|
2478
|
+
function Qi(e) {
|
|
2467
2479
|
let t = O(2), { segment: n } = e;
|
|
2468
|
-
if (!
|
|
2480
|
+
if (!Bi()) return null;
|
|
2469
2481
|
let { part: r } = n;
|
|
2470
2482
|
if (r.type !== "dynamic-tool") return null;
|
|
2471
2483
|
let i;
|
|
2472
|
-
return t[0] === r ? i = t[1] : (i = /* @__PURE__ */ M(
|
|
2484
|
+
return t[0] === r ? i = t[1] : (i = /* @__PURE__ */ M(ei, { part: r }), t[0] = r, t[1] = i), i;
|
|
2473
2485
|
}
|
|
2474
|
-
var
|
|
2475
|
-
function
|
|
2476
|
-
let e = l(
|
|
2486
|
+
var $i = o(null), ea = o(null);
|
|
2487
|
+
function ta() {
|
|
2488
|
+
let e = l($i);
|
|
2477
2489
|
if (!e) throw Error("Segment.Tool* parts must be rendered within Segment.Tool");
|
|
2478
2490
|
return e;
|
|
2479
2491
|
}
|
|
2480
|
-
function
|
|
2481
|
-
let t = O(29), { segment: n, children: r } = e, i = z(), a =
|
|
2492
|
+
function na(e) {
|
|
2493
|
+
let t = O(29), { segment: n, children: r } = e, i = z(), a = K(), { part: o } = n;
|
|
2482
2494
|
if (!S(o)) return null;
|
|
2483
2495
|
let s, c, l, u;
|
|
2484
|
-
t[0] !== i.registry || t[1] !== a || t[2] !== o ? ({toolEntry: u} =
|
|
2496
|
+
t[0] !== i.registry || t[1] !== a || t[2] !== o ? ({toolEntry: u} = yi(o, i.registry), c = bi(u, o.state), s = !c && an(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]);
|
|
2485
2497
|
let d = l, f;
|
|
2486
2498
|
t[7] !== s || t[8] !== d || t[9] !== o ? (f = s ? {
|
|
2487
2499
|
...d ?? { name: y(o) },
|
|
@@ -2503,37 +2515,37 @@ function ea(e) {
|
|
|
2503
2515
|
aborted: s
|
|
2504
2516
|
}, t[17] = s, t[18] = p, t[19] = o.state, t[20] = g) : g = t[20];
|
|
2505
2517
|
let _;
|
|
2506
|
-
t[21] === r ? _ = t[22] : (_ = r ?? /* @__PURE__ */ M(
|
|
2518
|
+
t[21] === r ? _ = t[22] : (_ = r ?? /* @__PURE__ */ M(ia, {}), t[21] = r, t[22] = _);
|
|
2507
2519
|
let v;
|
|
2508
|
-
t[23] !== g || t[24] !== _ ? (v = /* @__PURE__ */ M(
|
|
2520
|
+
t[23] !== g || t[24] !== _ ? (v = /* @__PURE__ */ M(ea, {
|
|
2509
2521
|
value: g,
|
|
2510
2522
|
children: _
|
|
2511
2523
|
}), t[23] = g, t[24] = _, t[25] = v) : v = t[25];
|
|
2512
2524
|
let b;
|
|
2513
|
-
return t[26] !== h || t[27] !== v ? (b = /* @__PURE__ */ M(
|
|
2525
|
+
return t[26] !== h || t[27] !== v ? (b = /* @__PURE__ */ M($i, {
|
|
2514
2526
|
value: h,
|
|
2515
2527
|
children: v
|
|
2516
2528
|
}), t[26] = h, t[27] = v, t[28] = b) : b = t[28], b;
|
|
2517
2529
|
}
|
|
2518
|
-
function
|
|
2519
|
-
let e = O(2), { part: t, activeClientInput: n } =
|
|
2530
|
+
function ra() {
|
|
2531
|
+
let e = O(2), { part: t, activeClientInput: n } = ta();
|
|
2520
2532
|
if (n) return null;
|
|
2521
2533
|
let r;
|
|
2522
|
-
return e[0] === t ? r = e[1] : (r = /* @__PURE__ */ M(
|
|
2534
|
+
return e[0] === t ? r = e[1] : (r = /* @__PURE__ */ M(zi, { part: t }), e[0] = t, e[1] = r), r;
|
|
2523
2535
|
}
|
|
2524
|
-
function
|
|
2525
|
-
let t = O(9), { children: n } = e, { part: r, label: i, defaultOpen: a } =
|
|
2536
|
+
function ia(e) {
|
|
2537
|
+
let t = O(9), { children: n } = e, { part: r, label: i, defaultOpen: a } = ta();
|
|
2526
2538
|
if (!i) {
|
|
2527
2539
|
let e;
|
|
2528
2540
|
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M("div", {
|
|
2529
2541
|
className: "min-w-0 flex-1",
|
|
2530
|
-
children: /* @__PURE__ */ M(
|
|
2542
|
+
children: /* @__PURE__ */ M(ra, {})
|
|
2531
2543
|
}), t[0] = e) : e = t[0], e;
|
|
2532
2544
|
}
|
|
2533
2545
|
let o;
|
|
2534
2546
|
t[1] !== n || t[2] !== i || t[3] !== r ? (o = /* @__PURE__ */ M(L, {
|
|
2535
2547
|
className: "cursor-pointer",
|
|
2536
|
-
children: /* @__PURE__ */ M(
|
|
2548
|
+
children: /* @__PURE__ */ M(Gi, {
|
|
2537
2549
|
label: i,
|
|
2538
2550
|
state: r.state,
|
|
2539
2551
|
part: r,
|
|
@@ -2543,7 +2555,7 @@ function na(e) {
|
|
|
2543
2555
|
let s;
|
|
2544
2556
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(I, {
|
|
2545
2557
|
className: "mb-2",
|
|
2546
|
-
children: /* @__PURE__ */ M(
|
|
2558
|
+
children: /* @__PURE__ */ M(ra, {})
|
|
2547
2559
|
}), t[5] = s) : s = t[5];
|
|
2548
2560
|
let c;
|
|
2549
2561
|
return t[6] !== a || t[7] !== o ? (c = /* @__PURE__ */ N(F, {
|
|
@@ -2552,32 +2564,32 @@ function na(e) {
|
|
|
2552
2564
|
children: [o, s]
|
|
2553
2565
|
}), t[6] = a, t[7] = o, t[8] = c) : c = t[8], c;
|
|
2554
2566
|
}
|
|
2555
|
-
var
|
|
2556
|
-
Text:
|
|
2557
|
-
File:
|
|
2558
|
-
Source:
|
|
2559
|
-
Reasoning:
|
|
2560
|
-
DynamicTool:
|
|
2561
|
-
Tool:
|
|
2562
|
-
ToolDisclosure:
|
|
2563
|
-
ToolContent:
|
|
2567
|
+
var Z = {
|
|
2568
|
+
Text: Ji,
|
|
2569
|
+
File: Yi,
|
|
2570
|
+
Source: Xi,
|
|
2571
|
+
Reasoning: Zi,
|
|
2572
|
+
DynamicTool: Qi,
|
|
2573
|
+
Tool: na,
|
|
2574
|
+
ToolDisclosure: ia,
|
|
2575
|
+
ToolContent: ra
|
|
2564
2576
|
};
|
|
2565
2577
|
//#endregion
|
|
2566
2578
|
//#region src/lib/chat/trajectory/trajectory-segments.ts
|
|
2567
|
-
function
|
|
2579
|
+
function aa(e) {
|
|
2568
2580
|
return S(e) ? "tool" : e.type === "dynamic-tool" ? "dynamic-tool" : e.type === "reasoning" && "text" in e && e.text ? "reasoning" : null;
|
|
2569
2581
|
}
|
|
2570
|
-
function
|
|
2582
|
+
function oa(e, t) {
|
|
2571
2583
|
return e.kind === "text" || e.kind === "file" || e.kind === "source" ? !1 : e.kind === "reasoning" || e.kind !== "dynamic-tool" || !!t;
|
|
2572
2584
|
}
|
|
2573
|
-
function
|
|
2585
|
+
function sa(e, t, n) {
|
|
2574
2586
|
let r = e[t + 1];
|
|
2575
|
-
return !!r &&
|
|
2587
|
+
return !!r && oa(r, n);
|
|
2576
2588
|
}
|
|
2577
|
-
function
|
|
2578
|
-
let t = [], n = new Set(e.flatMap((e) => e.type === "text" ?
|
|
2589
|
+
function ca(e) {
|
|
2590
|
+
let t = [], n = new Set(e.flatMap((e) => e.type === "text" ? U(e.citations).map(({ source: e }) => e.url) : []));
|
|
2579
2591
|
for (let r = 0; r < e.length; r++) {
|
|
2580
|
-
let i = e[r], a =
|
|
2592
|
+
let i = e[r], a = aa(i);
|
|
2581
2593
|
if (a) t.push({
|
|
2582
2594
|
kind: a,
|
|
2583
2595
|
part: i,
|
|
@@ -2616,13 +2628,13 @@ function oa(e) {
|
|
|
2616
2628
|
}
|
|
2617
2629
|
return t;
|
|
2618
2630
|
}
|
|
2619
|
-
function
|
|
2631
|
+
function la(e, t) {
|
|
2620
2632
|
return e.kind === "text" || e.kind === "source" ? e.parts[0]?.idx ?? t : e.idx;
|
|
2621
2633
|
}
|
|
2622
2634
|
//#endregion
|
|
2623
2635
|
//#region src/lib/chat/trajectory/nested-trajectory.tsx
|
|
2624
|
-
function
|
|
2625
|
-
let n = `${
|
|
2636
|
+
function ua(e, t) {
|
|
2637
|
+
let n = `${la(e, t)}:${e.kind}`;
|
|
2626
2638
|
if (e.kind === "text") return `${n}:${e.parts.map(({ part: e }) => e.type === "text" ? e.text : "").join("")}`;
|
|
2627
2639
|
if (e.kind === "reasoning" && e.part.type === "reasoning") return `${n}:${e.part.text}`;
|
|
2628
2640
|
if ((e.kind === "tool" || e.kind === "dynamic-tool") && w(e.part)) {
|
|
@@ -2631,38 +2643,38 @@ function sa(e, t) {
|
|
|
2631
2643
|
}
|
|
2632
2644
|
return e.kind === "file" && e.part.type === "file" ? `${n}:${e.part.url}:${e.part.mediaType}:${e.part.filename ?? ""}` : n;
|
|
2633
2645
|
}
|
|
2634
|
-
function
|
|
2646
|
+
function da(e, t, n) {
|
|
2635
2647
|
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;
|
|
2636
2648
|
}
|
|
2637
|
-
var
|
|
2649
|
+
var fa = c(function(e) {
|
|
2638
2650
|
let t = O(8), { segment: n } = e;
|
|
2639
2651
|
if (n.kind === "tool") {
|
|
2640
2652
|
let e;
|
|
2641
|
-
return t[0] === n ? e = t[1] : (e = /* @__PURE__ */ M(
|
|
2653
|
+
return t[0] === n ? e = t[1] : (e = /* @__PURE__ */ M(Z.Tool, { segment: n }), t[0] = n, t[1] = e), e;
|
|
2642
2654
|
}
|
|
2643
2655
|
if (n.kind === "reasoning") {
|
|
2644
2656
|
let e;
|
|
2645
|
-
return t[2] === n ? e = t[3] : (e = /* @__PURE__ */ M(
|
|
2657
|
+
return t[2] === n ? e = t[3] : (e = /* @__PURE__ */ M(Z.Reasoning, { segment: n }), t[2] = n, t[3] = e), e;
|
|
2646
2658
|
}
|
|
2647
2659
|
if (n.kind === "text") {
|
|
2648
2660
|
let e;
|
|
2649
|
-
return t[4] === n ? e = t[5] : (e = /* @__PURE__ */ M(
|
|
2661
|
+
return t[4] === n ? e = t[5] : (e = /* @__PURE__ */ M(Z.Text, {
|
|
2650
2662
|
segment: n,
|
|
2651
2663
|
className: "text-xs"
|
|
2652
2664
|
}), t[4] = n, t[5] = e), e;
|
|
2653
2665
|
}
|
|
2654
2666
|
if (n.kind === "file") {
|
|
2655
2667
|
let e;
|
|
2656
|
-
return t[6] === n ? e = t[7] : (e = /* @__PURE__ */ M(
|
|
2668
|
+
return t[6] === n ? e = t[7] : (e = /* @__PURE__ */ M(Z.File, { segment: n }), t[6] = n, t[7] = e), e;
|
|
2657
2669
|
}
|
|
2658
2670
|
return null;
|
|
2659
|
-
},
|
|
2660
|
-
function
|
|
2671
|
+
}, pa);
|
|
2672
|
+
function pa(e, t) {
|
|
2661
2673
|
return e.complete && t.complete && e.cacheKey === t.cacheKey;
|
|
2662
2674
|
}
|
|
2663
|
-
function
|
|
2675
|
+
function ma(e) {
|
|
2664
2676
|
let t = O(11), { parts: n, className: r } = e, i;
|
|
2665
|
-
t[0] === n ? i = t[1] : (i =
|
|
2677
|
+
t[0] === n ? i = t[1] : (i = ca(n), t[0] = n, t[1] = i);
|
|
2666
2678
|
let a = i;
|
|
2667
2679
|
if (a.length === 0) return null;
|
|
2668
2680
|
let o;
|
|
@@ -2671,11 +2683,11 @@ function da(e) {
|
|
|
2671
2683
|
if (t[4] !== a) {
|
|
2672
2684
|
let e;
|
|
2673
2685
|
t[6] === a.length ? e = t[7] : (e = (e, t) => {
|
|
2674
|
-
let n = `${
|
|
2675
|
-
return /* @__PURE__ */ M(
|
|
2686
|
+
let n = `${la(e, t)}-${e.kind}`;
|
|
2687
|
+
return /* @__PURE__ */ M(fa, {
|
|
2676
2688
|
segment: e,
|
|
2677
|
-
cacheKey:
|
|
2678
|
-
complete:
|
|
2689
|
+
cacheKey: ua(e, t),
|
|
2690
|
+
complete: da(e, t, a.length)
|
|
2679
2691
|
}, n);
|
|
2680
2692
|
}, t[6] = a.length, t[7] = e), s = a.map(e), t[4] = a, t[5] = s;
|
|
2681
2693
|
} else s = t[5];
|
|
@@ -2707,13 +2719,13 @@ function Q(e) {
|
|
|
2707
2719
|
}
|
|
2708
2720
|
//#endregion
|
|
2709
2721
|
//#region src/lib/chat/trajectory/trajectories/message-actions.tsx
|
|
2710
|
-
function
|
|
2711
|
-
let { index: e } =
|
|
2722
|
+
function ha() {
|
|
2723
|
+
let { index: e } = q(), { messages: t } = G(), n = K();
|
|
2712
2724
|
return !(e === t.length - 1 && (n === "submitted" || n === "streaming" || n === "error"));
|
|
2713
2725
|
}
|
|
2714
|
-
function
|
|
2726
|
+
function ga(e) {
|
|
2715
2727
|
let t = O(5), { className: n, children: r } = e;
|
|
2716
|
-
if (!
|
|
2728
|
+
if (!ha() || i.toArray(r).length === 0) return null;
|
|
2717
2729
|
let a;
|
|
2718
2730
|
t[0] === n ? a = t[1] : (a = k("mt-1 flex items-center gap-0.5", n), t[0] = n, t[1] = a);
|
|
2719
2731
|
let o;
|
|
@@ -2723,11 +2735,11 @@ function pa(e) {
|
|
|
2723
2735
|
children: r
|
|
2724
2736
|
}), t[2] = r, t[3] = a, t[4] = o) : o = t[4], o;
|
|
2725
2737
|
}
|
|
2726
|
-
function
|
|
2727
|
-
let t = O(12), { className: n } = e, { message: r } =
|
|
2738
|
+
function _a(e) {
|
|
2739
|
+
let t = O(12), { className: n } = e, { message: r } = q(), [i, a] = Vr(), o = i ? "Copied" : "Copy message", s;
|
|
2728
2740
|
t[0] === n ? s = t[1] : (s = k("p-1.5", n), t[0] = n, t[1] = s);
|
|
2729
2741
|
let c;
|
|
2730
|
-
t[2] !== a || t[3] !== r ? (c = () => void a(
|
|
2742
|
+
t[2] !== a || t[3] !== r ? (c = () => void a(hi(r)), t[2] = a, t[3] = r, t[4] = c) : c = t[4];
|
|
2731
2743
|
let l;
|
|
2732
2744
|
t[5] === i ? l = t[6] : (l = M(i ? Re : Ke, { className: "size-3.5" }), t[5] = i, t[6] = l);
|
|
2733
2745
|
let u;
|
|
@@ -2738,8 +2750,8 @@ function ma(e) {
|
|
|
2738
2750
|
icon: l
|
|
2739
2751
|
}), t[7] = o, t[8] = s, t[9] = c, t[10] = l, t[11] = u) : u = t[11], u;
|
|
2740
2752
|
}
|
|
2741
|
-
function
|
|
2742
|
-
let t = O(9), { className: n } = e, { message: r } =
|
|
2753
|
+
function va(e) {
|
|
2754
|
+
let t = O(9), { className: n } = e, { message: r } = q(), { regenerate: i } = H(), a;
|
|
2743
2755
|
t[0] === n ? a = t[1] : (a = k("p-1.5", n), t[0] = n, t[1] = a);
|
|
2744
2756
|
let o;
|
|
2745
2757
|
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];
|
|
@@ -2753,8 +2765,8 @@ function ha(e) {
|
|
|
2753
2765
|
icon: s
|
|
2754
2766
|
}), t[6] = a, t[7] = o, t[8] = c) : c = t[8], c;
|
|
2755
2767
|
}
|
|
2756
|
-
function
|
|
2757
|
-
let t = O(12), { className: n } = e, { message: r } =
|
|
2768
|
+
function ya(e) {
|
|
2769
|
+
let t = O(12), { className: n } = e, { message: r } = q(), [i, a] = Vr(), o = i ? "Copied" : "Copy debug JSON", s;
|
|
2758
2770
|
t[0] === n ? s = t[1] : (s = k("p-1.5", n), t[0] = n, t[1] = s);
|
|
2759
2771
|
let c;
|
|
2760
2772
|
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];
|
|
@@ -2770,11 +2782,11 @@ function ga(e) {
|
|
|
2770
2782
|
}
|
|
2771
2783
|
//#endregion
|
|
2772
2784
|
//#region src/lib/chat/trajectory/trajectories/messages-error.tsx
|
|
2773
|
-
function
|
|
2785
|
+
function ba(e) {
|
|
2774
2786
|
let t = O(7), { onTryAgain: n, error: r } = e, i = r instanceof Error ? r.message : "An error occurred. Please try again.", a;
|
|
2775
2787
|
t[0] === i ? a = t[1] : (a = /* @__PURE__ */ M("div", {
|
|
2776
2788
|
className: "text-destructive text-sm",
|
|
2777
|
-
children: /* @__PURE__ */ M(
|
|
2789
|
+
children: /* @__PURE__ */ M(Y, {
|
|
2778
2790
|
mode: "static",
|
|
2779
2791
|
children: i
|
|
2780
2792
|
})
|
|
@@ -2796,18 +2808,18 @@ function _a(e) {
|
|
|
2796
2808
|
})
|
|
2797
2809
|
}), t[4] = a, t[5] = o, t[6] = s) : s = t[6], s;
|
|
2798
2810
|
}
|
|
2799
|
-
function
|
|
2811
|
+
function xa(e) {
|
|
2800
2812
|
let t = O(3), { error: n, onRetry: r } = e;
|
|
2801
2813
|
if (!n || !r) return null;
|
|
2802
2814
|
let i;
|
|
2803
|
-
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(
|
|
2815
|
+
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(ba, {
|
|
2804
2816
|
onTryAgain: r,
|
|
2805
2817
|
error: n
|
|
2806
2818
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2], i;
|
|
2807
2819
|
}
|
|
2808
2820
|
//#endregion
|
|
2809
2821
|
//#region src/lib/chat/trajectory/trajectories/messages-shell.tsx
|
|
2810
|
-
function
|
|
2822
|
+
function Sa(e) {
|
|
2811
2823
|
let t = O(15), { messages: n, className: r, elements: i, citation: a, status: o, children: s } = e, c;
|
|
2812
2824
|
t[0] !== a || t[1] !== i || t[2] !== n || t[3] !== o ? (c = {
|
|
2813
2825
|
messages: n,
|
|
@@ -2828,12 +2840,12 @@ function ya(e) {
|
|
|
2828
2840
|
children: d
|
|
2829
2841
|
}), t[9] = u, t[10] = d, t[11] = f) : f = t[11];
|
|
2830
2842
|
let p;
|
|
2831
|
-
return t[12] !== f || t[13] !== l ? (p = /* @__PURE__ */ M(
|
|
2843
|
+
return t[12] !== f || t[13] !== l ? (p = /* @__PURE__ */ M(Yn, {
|
|
2832
2844
|
value: l,
|
|
2833
2845
|
children: f
|
|
2834
2846
|
}), t[12] = f, t[13] = l, t[14] = p) : p = t[14], p;
|
|
2835
2847
|
}
|
|
2836
|
-
function
|
|
2848
|
+
function Ca(e) {
|
|
2837
2849
|
let t = O(5), { className: n, children: r } = e, i;
|
|
2838
2850
|
t[0] === n ? i = t[1] : (i = k("flex flex-col gap-4", n), t[0] = n, t[1] = i);
|
|
2839
2851
|
let a;
|
|
@@ -2842,7 +2854,7 @@ function ba(e) {
|
|
|
2842
2854
|
children: r
|
|
2843
2855
|
}), t[2] = r, t[3] = i, t[4] = a) : a = t[4], a;
|
|
2844
2856
|
}
|
|
2845
|
-
function
|
|
2857
|
+
function wa(e) {
|
|
2846
2858
|
let t = O(9), { message: n, index: r, className: i, children: a } = e, o;
|
|
2847
2859
|
t[0] !== r || t[1] !== n ? (o = {
|
|
2848
2860
|
message: n,
|
|
@@ -2854,22 +2866,22 @@ function xa(e) {
|
|
|
2854
2866
|
children: a
|
|
2855
2867
|
}), t[3] = a, t[4] = i, t[5] = c) : c = t[5];
|
|
2856
2868
|
let l;
|
|
2857
|
-
return t[6] !== c || t[7] !== s ? (l = /* @__PURE__ */ M(
|
|
2869
|
+
return t[6] !== c || t[7] !== s ? (l = /* @__PURE__ */ M(Xn, {
|
|
2858
2870
|
value: s,
|
|
2859
2871
|
children: c
|
|
2860
2872
|
}), t[6] = c, t[7] = s, t[8] = l) : l = t[8], l;
|
|
2861
2873
|
}
|
|
2862
2874
|
//#endregion
|
|
2863
2875
|
//#region src/lib/components/PendingToolInput.tsx
|
|
2864
|
-
function
|
|
2865
|
-
let e = O(5), { registry: t } = z(), n =
|
|
2876
|
+
function Ta() {
|
|
2877
|
+
let e = O(5), { registry: t } = z(), n = H().messages, r;
|
|
2866
2878
|
if (e[0] !== n || e[1] !== t) {
|
|
2867
2879
|
bb0: {
|
|
2868
2880
|
if (!t) {
|
|
2869
2881
|
r = null;
|
|
2870
2882
|
break bb0;
|
|
2871
2883
|
}
|
|
2872
|
-
let i = n.findLast(
|
|
2884
|
+
let i = n.findLast(Ea);
|
|
2873
2885
|
if (!i) {
|
|
2874
2886
|
r = null;
|
|
2875
2887
|
break bb0;
|
|
@@ -2888,12 +2900,12 @@ function Sa() {
|
|
|
2888
2900
|
} else r = e[2];
|
|
2889
2901
|
return r;
|
|
2890
2902
|
}
|
|
2891
|
-
function
|
|
2903
|
+
function Ea(e) {
|
|
2892
2904
|
let { role: t } = e;
|
|
2893
2905
|
return t === "assistant";
|
|
2894
2906
|
}
|
|
2895
|
-
function
|
|
2896
|
-
let t = O(10), { children: n, className: i } = e, a =
|
|
2907
|
+
function Da(e) {
|
|
2908
|
+
let t = O(10), { children: n, className: i } = e, a = Ta(), o = a?.entry.component, s = a ? "hidden" : "visible", c;
|
|
2897
2909
|
t[0] !== n || t[1] !== s ? (c = /* @__PURE__ */ M(r, {
|
|
2898
2910
|
mode: s,
|
|
2899
2911
|
children: n
|
|
@@ -2908,12 +2920,12 @@ function wa(e) {
|
|
|
2908
2920
|
}
|
|
2909
2921
|
//#endregion
|
|
2910
2922
|
//#region src/lib/chat/trajectory/trajectories/thinking-hint.ts
|
|
2911
|
-
function
|
|
2923
|
+
function Oa(e, t) {
|
|
2912
2924
|
if (e === "error" || e === "ready" || !t) return null;
|
|
2913
2925
|
if (t.role !== "assistant") return "Thinking...";
|
|
2914
2926
|
for (let e = t.parts.length - 1; e >= 0; e--) {
|
|
2915
2927
|
let n = t.parts[e];
|
|
2916
|
-
if (C(n) &&
|
|
2928
|
+
if (C(n) && qi(n) && n.text) return n.text;
|
|
2917
2929
|
}
|
|
2918
2930
|
for (let e = t.parts.length - 1; e >= 0; e--) {
|
|
2919
2931
|
let n = t.parts[e];
|
|
@@ -2937,7 +2949,7 @@ function Ta(e, t) {
|
|
|
2937
2949
|
}
|
|
2938
2950
|
//#endregion
|
|
2939
2951
|
//#region src/lib/chat/trajectory/trajectories/timeline-dot.tsx
|
|
2940
|
-
function
|
|
2952
|
+
function ka(e) {
|
|
2941
2953
|
let t = O(5), { isLast: n } = e, r = n !== void 0 && n, i;
|
|
2942
2954
|
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];
|
|
2943
2955
|
let a;
|
|
@@ -2950,7 +2962,7 @@ function Ea(e) {
|
|
|
2950
2962
|
}
|
|
2951
2963
|
//#endregion
|
|
2952
2964
|
//#region src/lib/chat/trajectory/trajectories/timeline-item.tsx
|
|
2953
|
-
function
|
|
2965
|
+
function Aa(e) {
|
|
2954
2966
|
let t = O(6), { marker: n, children: r, className: i } = e, a;
|
|
2955
2967
|
t[0] === i ? a = t[1] : (a = k("relative z-0 flex gap-3 pl-5", i), t[0] = i, t[1] = a);
|
|
2956
2968
|
let o;
|
|
@@ -2961,20 +2973,20 @@ function Da(e) {
|
|
|
2961
2973
|
}
|
|
2962
2974
|
//#endregion
|
|
2963
2975
|
//#region src/lib/chat/trajectory/trajectories/trajectory-thinking.tsx
|
|
2964
|
-
function
|
|
2965
|
-
let e = O(6), t =
|
|
2966
|
-
e[0] !== t || e[1] !== i ? (a =
|
|
2976
|
+
function ja() {
|
|
2977
|
+
let e = O(6), t = K(), { messages: n } = G(), r = Ta(), i = n[n.length - 1], a;
|
|
2978
|
+
e[0] !== t || e[1] !== i ? (a = Oa(t, i), e[0] = t, e[1] = i, e[2] = a) : a = e[2];
|
|
2967
2979
|
let o = a;
|
|
2968
2980
|
if (!o || r) return null;
|
|
2969
2981
|
let s;
|
|
2970
|
-
e[3] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(
|
|
2982
|
+
e[3] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(ka, { isLast: !0 }), e[3] = s) : s = e[3];
|
|
2971
2983
|
let c;
|
|
2972
|
-
return e[4] === o ? c = e[5] : (c = /* @__PURE__ */ M(
|
|
2984
|
+
return e[4] === o ? c = e[5] : (c = /* @__PURE__ */ M(Aa, {
|
|
2973
2985
|
className: "mt-2",
|
|
2974
2986
|
marker: s,
|
|
2975
2987
|
children: /* @__PURE__ */ M("span", {
|
|
2976
2988
|
role: "status",
|
|
2977
|
-
children: /* @__PURE__ */ M(
|
|
2989
|
+
children: /* @__PURE__ */ M(W, {
|
|
2978
2990
|
as: "span",
|
|
2979
2991
|
className: "text-muted-foreground line-clamp-2 font-mono text-xs",
|
|
2980
2992
|
children: o
|
|
@@ -2990,7 +3002,7 @@ var $ = [
|
|
|
2990
3002
|
"reasoningTokens",
|
|
2991
3003
|
"cachedInputTokens",
|
|
2992
3004
|
"totalTokens"
|
|
2993
|
-
],
|
|
3005
|
+
], Ma = {
|
|
2994
3006
|
inputTokens: [["inputTokens"], ["raw", "prompt_tokens"]],
|
|
2995
3007
|
outputTokens: [["outputTokens"], ["raw", "completion_tokens"]],
|
|
2996
3008
|
reasoningTokens: [
|
|
@@ -3014,7 +3026,7 @@ var $ = [
|
|
|
3014
3026
|
],
|
|
3015
3027
|
totalTokens: [["totalTokens"], ["raw", "total_tokens"]]
|
|
3016
3028
|
};
|
|
3017
|
-
function
|
|
3029
|
+
function Na(e) {
|
|
3018
3030
|
if (typeof e == "number" && Number.isFinite(e) && e >= 0) return e;
|
|
3019
3031
|
if (typeof e == "string" && e.trim().length > 0) {
|
|
3020
3032
|
let t = Number(e);
|
|
@@ -3022,7 +3034,7 @@ function Aa(e) {
|
|
|
3022
3034
|
}
|
|
3023
3035
|
return null;
|
|
3024
3036
|
}
|
|
3025
|
-
function
|
|
3037
|
+
function Pa(e) {
|
|
3026
3038
|
if (!e || typeof e != "object") return null;
|
|
3027
3039
|
let t = {
|
|
3028
3040
|
inputTokens: null,
|
|
@@ -3031,8 +3043,8 @@ function ja(e) {
|
|
|
3031
3043
|
cachedInputTokens: null,
|
|
3032
3044
|
totalTokens: null
|
|
3033
3045
|
};
|
|
3034
|
-
for (let n of $) for (let r of
|
|
3035
|
-
let i =
|
|
3046
|
+
for (let n of $) for (let r of Ma[n]) {
|
|
3047
|
+
let i = Na(Dt(e, r));
|
|
3036
3048
|
if (i !== null) {
|
|
3037
3049
|
t[n] = i;
|
|
3038
3050
|
break;
|
|
@@ -3040,10 +3052,10 @@ function ja(e) {
|
|
|
3040
3052
|
}
|
|
3041
3053
|
return $.some((e) => t[e] !== null) ? t : null;
|
|
3042
3054
|
}
|
|
3043
|
-
function
|
|
3044
|
-
return D(e) ?
|
|
3055
|
+
function Fa(e) {
|
|
3056
|
+
return D(e) ? Pa(e.totalUsage ?? e.usage) : null;
|
|
3045
3057
|
}
|
|
3046
|
-
function
|
|
3058
|
+
function Ia(e, t) {
|
|
3047
3059
|
let n = {
|
|
3048
3060
|
inputTokens: null,
|
|
3049
3061
|
outputTokens: null,
|
|
@@ -3065,7 +3077,7 @@ function Na(e, t) {
|
|
|
3065
3077
|
}
|
|
3066
3078
|
return $.some((e) => n[e] !== null) ? n : null;
|
|
3067
3079
|
}
|
|
3068
|
-
function
|
|
3080
|
+
function La(e) {
|
|
3069
3081
|
if (e.length === 0) return null;
|
|
3070
3082
|
let t = {
|
|
3071
3083
|
inputTokens: null,
|
|
@@ -3084,32 +3096,32 @@ function Pa(e) {
|
|
|
3084
3096
|
}
|
|
3085
3097
|
return $.some((e) => t[e] !== null) ? t : null;
|
|
3086
3098
|
}
|
|
3087
|
-
function
|
|
3099
|
+
function Ra(e) {
|
|
3088
3100
|
let t = {}, n = [], r = null, i = null;
|
|
3089
3101
|
for (let a of e) {
|
|
3090
3102
|
if (a.role !== "assistant") continue;
|
|
3091
|
-
let e = D(a.metadata) ? a.metadata : void 0, o =
|
|
3103
|
+
let e = D(a.metadata) ? a.metadata : void 0, o = Pa(e?.usage), s = Pa(e?.totalUsage), c = o ?? (s ? Ia(s, r) : null);
|
|
3092
3104
|
c && (t[a.id] = c, n.push(c)), s && (i = s, r = s);
|
|
3093
3105
|
}
|
|
3094
3106
|
return {
|
|
3095
3107
|
assistantUsageByMessageId: t,
|
|
3096
|
-
chatUsageSummary: i ??
|
|
3108
|
+
chatUsageSummary: i ?? La(n)
|
|
3097
3109
|
};
|
|
3098
3110
|
}
|
|
3099
|
-
function
|
|
3100
|
-
let e = O(2), t =
|
|
3101
|
-
return e[0] === t.messages ? n = e[1] : (n =
|
|
3111
|
+
function za() {
|
|
3112
|
+
let e = O(2), t = H(), n;
|
|
3113
|
+
return e[0] === t.messages ? n = e[1] : (n = Ra(t.messages), e[0] = t.messages, e[1] = n), n;
|
|
3102
3114
|
}
|
|
3103
|
-
function
|
|
3115
|
+
function Ba(e) {
|
|
3104
3116
|
return kt(e);
|
|
3105
3117
|
}
|
|
3106
|
-
function
|
|
3118
|
+
function Va(e) {
|
|
3107
3119
|
let t = [`↑ ${Ot(e.inputTokens)}`, `↓ ${Ot(e.outputTokens)}`];
|
|
3108
3120
|
return e.totalTokens !== null && t.push(`· ${kt(e.totalTokens)} tokens`), e.cachedInputTokens !== null && e.cachedInputTokens > 0 && t.push(`(${Ot(e.cachedInputTokens)} cached)`), t.join(" ");
|
|
3109
3121
|
}
|
|
3110
3122
|
//#endregion
|
|
3111
3123
|
//#region src/lib/chat/zukhruf-chat-transport.ts
|
|
3112
|
-
var
|
|
3124
|
+
var Ha = "x-upload-filename", Ua = P.strictObject({
|
|
3113
3125
|
path: P.string().startsWith("/"),
|
|
3114
3126
|
name: P.string().min(1),
|
|
3115
3127
|
mediaType: P.enum([
|
|
@@ -3127,19 +3139,19 @@ var za = "x-upload-filename", Ba = P.strictObject({
|
|
|
3127
3139
|
]),
|
|
3128
3140
|
size: P.int().nonnegative(),
|
|
3129
3141
|
url: P.url()
|
|
3130
|
-
}),
|
|
3142
|
+
}), Wa = class extends _ {
|
|
3131
3143
|
sessionsApi;
|
|
3132
3144
|
request;
|
|
3133
3145
|
constructor({ api: e, fetch: t = (e, t) => globalThis.fetch(e, t), tools: n = {}, elements: r = [] }) {
|
|
3134
|
-
let i =
|
|
3146
|
+
let i = Ja(e), a = r.map(se);
|
|
3135
3147
|
super({
|
|
3136
3148
|
api: i,
|
|
3137
3149
|
fetch: async (e, n) => {
|
|
3138
3150
|
let r = await t(e, n);
|
|
3139
3151
|
if ((n?.method ?? "GET").toUpperCase() !== "POST" || !r.ok) return r;
|
|
3140
3152
|
let i = await r.json();
|
|
3141
|
-
if (!
|
|
3142
|
-
let a =
|
|
3153
|
+
if (!Ya(i)) throw Error("Zukhruf returned an invalid accepted-turn response");
|
|
3154
|
+
let a = Ja(String(e)), o = decodeURIComponent(a.slice(a.lastIndexOf("/") + 1));
|
|
3143
3155
|
if (i.sessionId !== o) throw Error("Zukhruf returned a different session ID");
|
|
3144
3156
|
let s = n?.signal;
|
|
3145
3157
|
return s?.addEventListener("abort", () => {
|
|
@@ -3154,7 +3166,7 @@ var za = "x-upload-filename", Ba = P.strictObject({
|
|
|
3154
3166
|
let o = t[t.length - 1];
|
|
3155
3167
|
if (!o) throw Error("A message is required");
|
|
3156
3168
|
return {
|
|
3157
|
-
api:
|
|
3169
|
+
api: Ga(i, e),
|
|
3158
3170
|
body: {
|
|
3159
3171
|
sessionId: e,
|
|
3160
3172
|
message: o,
|
|
@@ -3165,50 +3177,50 @@ var za = "x-upload-filename", Ba = P.strictObject({
|
|
|
3165
3177
|
};
|
|
3166
3178
|
},
|
|
3167
3179
|
prepareReconnectToStreamRequest: ({ headers: e, id: t }) => ({
|
|
3168
|
-
api: `${
|
|
3180
|
+
api: `${Ga(i, t)}/stream`,
|
|
3169
3181
|
headers: e
|
|
3170
3182
|
})
|
|
3171
3183
|
}), this.sessionsApi = i, this.request = t;
|
|
3172
3184
|
}
|
|
3173
3185
|
async uploadFile(e, t) {
|
|
3174
|
-
let n = await this.request(`${
|
|
3186
|
+
let n = await this.request(`${Ga(this.sessionsApi, e)}/uploads`, {
|
|
3175
3187
|
method: "POST",
|
|
3176
3188
|
headers: {
|
|
3177
3189
|
"content-type": t.type,
|
|
3178
|
-
[
|
|
3190
|
+
[Ha]: encodeURIComponent(t.name)
|
|
3179
3191
|
},
|
|
3180
3192
|
body: t
|
|
3181
3193
|
});
|
|
3182
|
-
if (!n.ok) throw Error(await
|
|
3183
|
-
let r =
|
|
3194
|
+
if (!n.ok) throw Error(await Ka(n, t));
|
|
3195
|
+
let r = Ua.safeParse(await n.json());
|
|
3184
3196
|
if (!r.success) throw Error("Zukhruf returned an invalid upload response");
|
|
3185
3197
|
return r.data;
|
|
3186
3198
|
}
|
|
3187
3199
|
};
|
|
3188
|
-
function
|
|
3200
|
+
function Ga(e, t) {
|
|
3189
3201
|
return `${e}/${encodeURIComponent(t)}`;
|
|
3190
3202
|
}
|
|
3191
|
-
async function
|
|
3192
|
-
let n = `Uploading ${t.name} failed with HTTP ${e.status}`, r =
|
|
3203
|
+
async function Ka(e, t) {
|
|
3204
|
+
let n = `Uploading ${t.name} failed with HTTP ${e.status}`, r = qa(await e.json().catch((e) => {
|
|
3193
3205
|
if (e instanceof SyntaxError) return null;
|
|
3194
3206
|
throw e;
|
|
3195
3207
|
}));
|
|
3196
3208
|
return r ? `${n}: ${r}` : n;
|
|
3197
3209
|
}
|
|
3198
|
-
function
|
|
3210
|
+
function qa(e) {
|
|
3199
3211
|
if (typeof e != "object" || !e) return null;
|
|
3200
3212
|
let t = "cause" in e && typeof e.cause == "object" && e.cause !== null ? e.cause : null;
|
|
3201
3213
|
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;
|
|
3202
3214
|
}
|
|
3203
|
-
function
|
|
3215
|
+
function Ja(e) {
|
|
3204
3216
|
return e.replace(/\/$/, "");
|
|
3205
3217
|
}
|
|
3206
|
-
function
|
|
3218
|
+
function Ya(e) {
|
|
3207
3219
|
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";
|
|
3208
3220
|
}
|
|
3209
3221
|
//#endregion
|
|
3210
3222
|
//#region src/lib/chat/trajectory/trajectories/collapsible-disclosure.tsx
|
|
3211
|
-
function
|
|
3223
|
+
function Xa(e) {
|
|
3212
3224
|
let t = O(24), { label: n, open: r, onOpenChange: i, children: a, className: o, triggerClassName: s, contentClassName: c, chevronClassName: l } = e, u;
|
|
3213
3225
|
t[0] === s ? u = t[1] : (u = k("flex items-center font-mono", s), t[0] = s, t[1] = u);
|
|
3214
3226
|
let d;
|
|
@@ -3242,19 +3254,19 @@ function qa(e) {
|
|
|
3242
3254
|
}
|
|
3243
3255
|
//#endregion
|
|
3244
3256
|
//#region src/lib/chat/trajectory/trajectories/user-message.tsx
|
|
3245
|
-
function
|
|
3257
|
+
function Za(e) {
|
|
3246
3258
|
let t = O(7), { metadata: n } = e;
|
|
3247
3259
|
if (!n) return null;
|
|
3248
3260
|
let r, i, a;
|
|
3249
3261
|
if (t[0] !== n) {
|
|
3250
3262
|
a = Symbol.for("react.early_return_sentinel");
|
|
3251
3263
|
bb0: {
|
|
3252
|
-
let e =
|
|
3264
|
+
let e = Fa(n);
|
|
3253
3265
|
if (!e) {
|
|
3254
3266
|
a = null;
|
|
3255
3267
|
break bb0;
|
|
3256
3268
|
}
|
|
3257
|
-
r = "text-muted-foreground mt-2 text-xs tabular-nums opacity-60", i =
|
|
3269
|
+
r = "text-muted-foreground mt-2 text-xs tabular-nums opacity-60", i = Va(e);
|
|
3258
3270
|
}
|
|
3259
3271
|
t[0] = n, t[1] = r, t[2] = i, t[3] = a;
|
|
3260
3272
|
} else r = t[1], i = t[2], a = t[3];
|
|
@@ -3265,27 +3277,27 @@ function Ja(e) {
|
|
|
3265
3277
|
children: i
|
|
3266
3278
|
}), t[4] = r, t[5] = i, t[6] = o) : o = t[6], o;
|
|
3267
3279
|
}
|
|
3268
|
-
function
|
|
3280
|
+
function Qa(e, t) {
|
|
3269
3281
|
return D(e.metadata) ? e.metadata[t] : void 0;
|
|
3270
3282
|
}
|
|
3271
|
-
function
|
|
3272
|
-
let t =
|
|
3283
|
+
function $a(e) {
|
|
3284
|
+
let t = Qa(e, "reminders");
|
|
3273
3285
|
return Array.isArray(t) ? t.filter((e) => {
|
|
3274
3286
|
if (!e || typeof e != "object") return !1;
|
|
3275
3287
|
let t = e;
|
|
3276
3288
|
return typeof t.id == "string" && t.id.length > 0 && typeof t.text == "string" && t.text.trim().length > 0;
|
|
3277
3289
|
}) : [];
|
|
3278
3290
|
}
|
|
3279
|
-
function
|
|
3280
|
-
let t =
|
|
3291
|
+
function eo(e) {
|
|
3292
|
+
let t = Qa(e, "uploads");
|
|
3281
3293
|
return Array.isArray(t) ? t.flatMap((e) => {
|
|
3282
|
-
let t =
|
|
3294
|
+
let t = Ua.safeParse(e);
|
|
3283
3295
|
return t.success ? [t.data] : [];
|
|
3284
3296
|
}) : [];
|
|
3285
3297
|
}
|
|
3286
|
-
function
|
|
3298
|
+
function to(e) {
|
|
3287
3299
|
let t = O(7), { text: n } = e, [r, i] = g(!1), a;
|
|
3288
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = () => i(
|
|
3300
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = () => i(no), t[0] = a) : a = t[0];
|
|
3289
3301
|
let o = !r && "line-clamp-3", s;
|
|
3290
3302
|
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);
|
|
3291
3303
|
let c;
|
|
@@ -3297,21 +3309,21 @@ function Qa(e) {
|
|
|
3297
3309
|
children: n
|
|
3298
3310
|
}) }), t[3] = r, t[4] = s, t[5] = n, t[6] = c) : c = t[6], c;
|
|
3299
3311
|
}
|
|
3300
|
-
function
|
|
3312
|
+
function no(e) {
|
|
3301
3313
|
return !e;
|
|
3302
3314
|
}
|
|
3303
|
-
function
|
|
3315
|
+
function ro(e) {
|
|
3304
3316
|
let t = O(8), { reminders: n } = e, [r, i] = g(!1);
|
|
3305
3317
|
if (n.length === 0) return null;
|
|
3306
3318
|
let a = `${n.length} reminder${n.length === 1 ? "" : "s"} attached`, o;
|
|
3307
|
-
t[0] === n ? o = t[1] : (o = n.map(
|
|
3319
|
+
t[0] === n ? o = t[1] : (o = n.map(io), t[0] = n, t[1] = o);
|
|
3308
3320
|
let s;
|
|
3309
3321
|
t[2] === o ? s = t[3] : (s = /* @__PURE__ */ M("ul", {
|
|
3310
3322
|
className: "border-ink-12 text-muted-foreground space-y-1 border-l pl-3 text-xs",
|
|
3311
3323
|
children: o
|
|
3312
3324
|
}), t[2] = o, t[3] = s);
|
|
3313
3325
|
let c;
|
|
3314
|
-
return t[4] !== a || t[5] !== r || t[6] !== s ? (c = /* @__PURE__ */ M(
|
|
3326
|
+
return t[4] !== a || t[5] !== r || t[6] !== s ? (c = /* @__PURE__ */ M(Xa, {
|
|
3315
3327
|
label: a,
|
|
3316
3328
|
open: r,
|
|
3317
3329
|
onOpenChange: i,
|
|
@@ -3322,10 +3334,10 @@ function eo(e) {
|
|
|
3322
3334
|
children: s
|
|
3323
3335
|
}), t[4] = a, t[5] = r, t[6] = s, t[7] = c) : c = t[7], c;
|
|
3324
3336
|
}
|
|
3325
|
-
function
|
|
3326
|
-
return /* @__PURE__ */ M(
|
|
3337
|
+
function io(e) {
|
|
3338
|
+
return /* @__PURE__ */ M(to, { text: e.text }, e.id);
|
|
3327
3339
|
}
|
|
3328
|
-
function
|
|
3340
|
+
function ao(e) {
|
|
3329
3341
|
let t = O(19), { upload: n } = e;
|
|
3330
3342
|
if (n.mediaType.startsWith("video/")) {
|
|
3331
3343
|
let e;
|
|
@@ -3391,17 +3403,17 @@ function no(e) {
|
|
|
3391
3403
|
})
|
|
3392
3404
|
}), t[16] = n.name, t[17] = n.url, t[18] = r) : r = t[18], r;
|
|
3393
3405
|
}
|
|
3394
|
-
function
|
|
3406
|
+
function oo(e) {
|
|
3395
3407
|
let t = O(13), { message: n } = e, r, i, a, o, s, c;
|
|
3396
3408
|
if (t[0] !== n) {
|
|
3397
3409
|
c = Symbol.for("react.early_return_sentinel");
|
|
3398
3410
|
bb0: {
|
|
3399
|
-
let e =
|
|
3411
|
+
let e = eo(n);
|
|
3400
3412
|
if (e.length === 0) {
|
|
3401
3413
|
c = null;
|
|
3402
3414
|
break bb0;
|
|
3403
3415
|
}
|
|
3404
|
-
r = fe, i = "list", a = "Attached files", o = "max-w-full gap-2 py-0", s = e.map(
|
|
3416
|
+
r = fe, i = "list", a = "Attached files", o = "max-w-full gap-2 py-0", s = e.map(so);
|
|
3405
3417
|
}
|
|
3406
3418
|
t[0] = n, t[1] = r, t[2] = i, t[3] = a, t[4] = o, t[5] = s, t[6] = c;
|
|
3407
3419
|
} else r = t[1], i = t[2], a = t[3], o = t[4], s = t[5], c = t[6];
|
|
@@ -3414,23 +3426,23 @@ function ro(e) {
|
|
|
3414
3426
|
children: s
|
|
3415
3427
|
}), t[7] = r, t[8] = i, t[9] = a, t[10] = o, t[11] = s, t[12] = l) : l = t[12], l;
|
|
3416
3428
|
}
|
|
3417
|
-
function
|
|
3429
|
+
function so(e) {
|
|
3418
3430
|
return /* @__PURE__ */ M("div", {
|
|
3419
3431
|
role: "listitem",
|
|
3420
3432
|
"data-slot": "attachment",
|
|
3421
|
-
children: /* @__PURE__ */ M(
|
|
3433
|
+
children: /* @__PURE__ */ M(ao, { upload: e })
|
|
3422
3434
|
}, e.path);
|
|
3423
3435
|
}
|
|
3424
|
-
function
|
|
3436
|
+
function co(e) {
|
|
3425
3437
|
let t = O(10), { body: n, reminders: r, metadata: i } = e, a;
|
|
3426
3438
|
t[0] === n ? a = t[1] : (a = /* @__PURE__ */ M("div", {
|
|
3427
3439
|
className: "flex-1 space-y-3",
|
|
3428
3440
|
children: n
|
|
3429
3441
|
}), t[0] = n, t[1] = a);
|
|
3430
3442
|
let o;
|
|
3431
|
-
t[2] === r ? o = t[3] : (o = /* @__PURE__ */ M(
|
|
3443
|
+
t[2] === r ? o = t[3] : (o = /* @__PURE__ */ M(ro, { reminders: r }), t[2] = r, t[3] = o);
|
|
3432
3444
|
let s;
|
|
3433
|
-
t[4] === i ? s = t[5] : (s = i !== void 0 && /* @__PURE__ */ M(
|
|
3445
|
+
t[4] === i ? s = t[5] : (s = i !== void 0 && /* @__PURE__ */ M(Za, { metadata: i }), t[4] = i, t[5] = s);
|
|
3434
3446
|
let c;
|
|
3435
3447
|
return t[6] !== a || t[7] !== o || t[8] !== s ? (c = /* @__PURE__ */ N("div", {
|
|
3436
3448
|
className: "bg-secondary flex max-w-[80%] flex-col gap-3 rounded-lg p-3",
|
|
@@ -3441,13 +3453,13 @@ function ao(e) {
|
|
|
3441
3453
|
]
|
|
3442
3454
|
}), t[6] = a, t[7] = o, t[8] = s, t[9] = c) : c = t[9], c;
|
|
3443
3455
|
}
|
|
3444
|
-
function
|
|
3456
|
+
function lo(e) {
|
|
3445
3457
|
let t = O(28), { message: n } = e;
|
|
3446
|
-
|
|
3458
|
+
Qa(n, "reminders");
|
|
3447
3459
|
let r;
|
|
3448
3460
|
t[0] === n ? r = t[1] : (r = ee(n), t[0] = n, t[1] = r);
|
|
3449
3461
|
let i;
|
|
3450
|
-
t[2] === n ? i = t[3] : (i =
|
|
3462
|
+
t[2] === n ? i = t[3] : (i = $a(n), t[2] = n, t[3] = i);
|
|
3451
3463
|
let a;
|
|
3452
3464
|
t[4] !== r || t[5] !== i ? (a = {
|
|
3453
3465
|
message: r,
|
|
@@ -3455,7 +3467,7 @@ function oo(e) {
|
|
|
3455
3467
|
}, t[4] = r, t[5] = i, t[6] = a) : a = t[6];
|
|
3456
3468
|
let { message: o, reminders: s } = a, c;
|
|
3457
3469
|
if (t[7] !== n) {
|
|
3458
|
-
let e =
|
|
3470
|
+
let e = Qa(n, "alias");
|
|
3459
3471
|
c = typeof e == "string" && e.trim().length > 0 ? e : void 0, t[7] = n, t[8] = c;
|
|
3460
3472
|
} else c = t[8];
|
|
3461
3473
|
let l = c;
|
|
@@ -3467,13 +3479,13 @@ function oo(e) {
|
|
|
3467
3479
|
children: l
|
|
3468
3480
|
}), t[9] = l, t[10] = e);
|
|
3469
3481
|
let n;
|
|
3470
|
-
return t[11] !== s || t[12] !== e ? (n = /* @__PURE__ */ M(
|
|
3482
|
+
return t[11] !== s || t[12] !== e ? (n = /* @__PURE__ */ M(co, {
|
|
3471
3483
|
reminders: s,
|
|
3472
3484
|
body: e
|
|
3473
3485
|
}), t[11] = s, t[12] = e, t[13] = n) : n = t[13], n;
|
|
3474
3486
|
}
|
|
3475
3487
|
let u;
|
|
3476
|
-
t[14] === o ? u = t[15] : (u = /* @__PURE__ */ M(
|
|
3488
|
+
t[14] === o ? u = t[15] : (u = /* @__PURE__ */ M(oo, { message: o }), t[14] = o, t[15] = u);
|
|
3477
3489
|
let d = o.metadata, f;
|
|
3478
3490
|
if (t[16] !== o.id || t[17] !== o.parts) {
|
|
3479
3491
|
let e;
|
|
@@ -3484,7 +3496,7 @@ function oo(e) {
|
|
|
3484
3496
|
}, `${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;
|
|
3485
3497
|
} else f = t[18];
|
|
3486
3498
|
let p;
|
|
3487
|
-
t[21] !== o.metadata || t[22] !== s || t[23] !== f ? (p = /* @__PURE__ */ M(
|
|
3499
|
+
t[21] !== o.metadata || t[22] !== s || t[23] !== f ? (p = /* @__PURE__ */ M(co, {
|
|
3488
3500
|
reminders: s,
|
|
3489
3501
|
metadata: d,
|
|
3490
3502
|
body: f
|
|
@@ -3495,11 +3507,11 @@ function oo(e) {
|
|
|
3495
3507
|
children: [u, p]
|
|
3496
3508
|
}), t[25] = u, t[26] = p, t[27] = m) : m = t[27], m;
|
|
3497
3509
|
}
|
|
3498
|
-
var
|
|
3499
|
-
let t = O(7), { className: n } = e, { message: r } =
|
|
3510
|
+
var uo = c(function(e) {
|
|
3511
|
+
let t = O(7), { className: n } = e, { message: r } = q(), i;
|
|
3500
3512
|
t[0] === n ? i = t[1] : (i = k("flex justify-end", n), t[0] = n, t[1] = i);
|
|
3501
3513
|
let a;
|
|
3502
|
-
t[2] === r ? a = t[3] : (a = /* @__PURE__ */ M(
|
|
3514
|
+
t[2] === r ? a = t[3] : (a = /* @__PURE__ */ M(lo, { message: r }), t[2] = r, t[3] = a);
|
|
3503
3515
|
let o;
|
|
3504
3516
|
return t[4] !== i || t[5] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
3505
3517
|
className: i,
|
|
@@ -3508,20 +3520,20 @@ var so = c(function(e) {
|
|
|
3508
3520
|
});
|
|
3509
3521
|
//#endregion
|
|
3510
3522
|
//#region src/lib/chat/trajectory/trajectories/compact-messages.tsx
|
|
3511
|
-
function
|
|
3512
|
-
return e.kind === "tool" ? !
|
|
3523
|
+
function fo(e) {
|
|
3524
|
+
return e.kind === "tool" ? !_i(e.part) : e.kind === "dynamic-tool" || e.kind === "reasoning";
|
|
3513
3525
|
}
|
|
3514
|
-
function
|
|
3526
|
+
function po(e, t) {
|
|
3515
3527
|
return e.kind === "tool" ? !0 : e.kind === "reasoning" || e.kind === "dynamic-tool" ? !!t : !1;
|
|
3516
3528
|
}
|
|
3517
|
-
function
|
|
3518
|
-
return e.kind === "text" && e.parts.some(({ part: e }) => e.type === "text" && !
|
|
3529
|
+
function mo(e) {
|
|
3530
|
+
return e.kind === "text" && e.parts.some(({ part: e }) => e.type === "text" && !qi(e));
|
|
3519
3531
|
}
|
|
3520
|
-
function
|
|
3532
|
+
function ho(e, t) {
|
|
3521
3533
|
let n = [];
|
|
3522
3534
|
for (let r = 0; r < e.length; r++) {
|
|
3523
3535
|
let i = e[r];
|
|
3524
|
-
if (!
|
|
3536
|
+
if (!fo(i)) {
|
|
3525
3537
|
n.push({
|
|
3526
3538
|
kind: "segment",
|
|
3527
3539
|
segment: i,
|
|
@@ -3530,25 +3542,25 @@ function fo(e, t) {
|
|
|
3530
3542
|
continue;
|
|
3531
3543
|
}
|
|
3532
3544
|
let a = [], o = r;
|
|
3533
|
-
for (; r < e.length &&
|
|
3545
|
+
for (; r < e.length && fo(e[r]);) {
|
|
3534
3546
|
let n = e[r];
|
|
3535
|
-
|
|
3547
|
+
po(n, t) && a.push({ segment: n }), r++;
|
|
3536
3548
|
}
|
|
3537
3549
|
r--, a.length > 0 && n.push({
|
|
3538
3550
|
kind: "group",
|
|
3539
3551
|
items: a,
|
|
3540
|
-
hasLaterText: e.slice(r + 1).some((e) =>
|
|
3552
|
+
hasLaterText: e.slice(r + 1).some((e) => mo(e)),
|
|
3541
3553
|
firstIndex: o
|
|
3542
3554
|
});
|
|
3543
3555
|
}
|
|
3544
3556
|
return n;
|
|
3545
3557
|
}
|
|
3546
|
-
function
|
|
3558
|
+
function go(e) {
|
|
3547
3559
|
if (e.kind !== "tool" && e.kind !== "dynamic-tool") return;
|
|
3548
3560
|
let { part: t } = e;
|
|
3549
3561
|
return w(t) ? t.state : void 0;
|
|
3550
3562
|
}
|
|
3551
|
-
function
|
|
3563
|
+
function _o({ groupStatus: e, labelCount: t }) {
|
|
3552
3564
|
return e === "running" ? {
|
|
3553
3565
|
title: "text-info",
|
|
3554
3566
|
detail: "text-info/80",
|
|
@@ -3571,20 +3583,20 @@ function mo({ groupStatus: e, labelCount: t }) {
|
|
|
3571
3583
|
chevron: "text-muted-foreground"
|
|
3572
3584
|
};
|
|
3573
3585
|
}
|
|
3574
|
-
function
|
|
3586
|
+
function vo(e) {
|
|
3575
3587
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
3576
3588
|
}
|
|
3577
|
-
function
|
|
3589
|
+
function yo(e, t = 80) {
|
|
3578
3590
|
let n = e.replace(/\s+/g, " ").trim();
|
|
3579
3591
|
return n.length <= t ? n : `${n.slice(0, t - 3).trimEnd()}...`;
|
|
3580
3592
|
}
|
|
3581
|
-
function
|
|
3582
|
-
if (typeof e == "string") return
|
|
3593
|
+
function bo(e) {
|
|
3594
|
+
if (typeof e == "string") return yo(e, 48);
|
|
3583
3595
|
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
3584
3596
|
if (Array.isArray(e)) return `${e.length} items`;
|
|
3585
3597
|
}
|
|
3586
|
-
function
|
|
3587
|
-
if (!
|
|
3598
|
+
function xo(e) {
|
|
3599
|
+
if (!vo(e)) return;
|
|
3588
3600
|
let t = [
|
|
3589
3601
|
"command",
|
|
3590
3602
|
"query",
|
|
@@ -3596,13 +3608,13 @@ function vo(e) {
|
|
|
3596
3608
|
"checks"
|
|
3597
3609
|
], n = [...t.filter((t) => t in e).map((t) => [t, e[t]]), ...Object.entries(e).filter(([e]) => !t.includes(e))], r = {};
|
|
3598
3610
|
for (let [e, t] of n) {
|
|
3599
|
-
let n =
|
|
3611
|
+
let n = bo(t);
|
|
3600
3612
|
if (n && (r[e] = n, Object.keys(r).length >= 2)) break;
|
|
3601
3613
|
}
|
|
3602
3614
|
return Object.keys(r).length > 0 ? r : void 0;
|
|
3603
3615
|
}
|
|
3604
|
-
function
|
|
3605
|
-
if (
|
|
3616
|
+
function So(e) {
|
|
3617
|
+
if (vo(e)) for (let t of [
|
|
3606
3618
|
"reasoning",
|
|
3607
3619
|
"thoughts",
|
|
3608
3620
|
"thought",
|
|
@@ -3610,122 +3622,136 @@ function yo(e) {
|
|
|
3610
3622
|
"detail"
|
|
3611
3623
|
]) {
|
|
3612
3624
|
let n = e[t];
|
|
3613
|
-
if (typeof n == "string" && n.trim().length > 0) return
|
|
3625
|
+
if (typeof n == "string" && n.trim().length > 0) return yo(n);
|
|
3614
3626
|
}
|
|
3615
3627
|
}
|
|
3616
|
-
function
|
|
3628
|
+
function Co(e) {
|
|
3617
3629
|
if (e.kind !== "reasoning") return;
|
|
3618
3630
|
let { part: t } = e;
|
|
3619
|
-
if (t.type === "reasoning") return
|
|
3631
|
+
if (t.type === "reasoning") return yo(t.text, 96);
|
|
3620
3632
|
}
|
|
3621
|
-
function
|
|
3633
|
+
function wo(e, t) {
|
|
3622
3634
|
if (e.kind === "reasoning") return {
|
|
3635
|
+
form: "call",
|
|
3623
3636
|
kind: "reasoning",
|
|
3624
3637
|
name: "reasoning",
|
|
3625
|
-
detail:
|
|
3638
|
+
detail: Co(e)
|
|
3626
3639
|
};
|
|
3627
3640
|
if (e.kind === "dynamic-tool" && e.part.type === "dynamic-tool") {
|
|
3628
3641
|
let t = e.part;
|
|
3629
3642
|
return {
|
|
3643
|
+
form: "call",
|
|
3630
3644
|
kind: "dynamic-tool",
|
|
3631
3645
|
name: t.toolName || "Tool",
|
|
3632
|
-
args:
|
|
3633
|
-
detail:
|
|
3646
|
+
args: xo(t.input),
|
|
3647
|
+
detail: So(t.input)
|
|
3634
3648
|
};
|
|
3635
3649
|
}
|
|
3636
3650
|
if (e.kind === "tool" && S(e.part)) {
|
|
3637
|
-
let n = e.part, { toolEntry: r, toolKey: i } =
|
|
3638
|
-
return {
|
|
3651
|
+
let n = e.part, { toolEntry: r, toolKey: i } = yi(n, t), a = r?.label?.(n);
|
|
3652
|
+
return a?.kind === "sentence" ? {
|
|
3653
|
+
form: "sentence",
|
|
3654
|
+
kind: "tool",
|
|
3655
|
+
text: a.text,
|
|
3656
|
+
detail: a.detail,
|
|
3657
|
+
isError: a.isError
|
|
3658
|
+
} : {
|
|
3659
|
+
form: "call",
|
|
3639
3660
|
kind: "tool",
|
|
3640
3661
|
name: a?.name ?? i,
|
|
3641
|
-
args: a?.args ??
|
|
3642
|
-
detail: a?.detail ??
|
|
3662
|
+
args: a?.args ?? xo(n.input),
|
|
3663
|
+
detail: a?.detail ?? So(n.input),
|
|
3643
3664
|
isError: a?.isError
|
|
3644
3665
|
};
|
|
3645
3666
|
}
|
|
3646
3667
|
return {
|
|
3668
|
+
form: "call",
|
|
3647
3669
|
kind: "tool",
|
|
3648
3670
|
name: "Step"
|
|
3649
3671
|
};
|
|
3650
3672
|
}
|
|
3651
|
-
function
|
|
3673
|
+
function To(e) {
|
|
3652
3674
|
if (!e) return;
|
|
3653
3675
|
let t = Object.entries(e).filter((e) => typeof e[1] == "string" && e[1].trim().length > 0);
|
|
3654
|
-
if (t.length !== 0) return t.slice(0, 2).map(([e, t]) => `${e}: ${
|
|
3676
|
+
if (t.length !== 0) return t.slice(0, 2).map(([e, t]) => `${e}: ${yo(t, 36)}`).join(", ");
|
|
3655
3677
|
}
|
|
3656
|
-
function
|
|
3657
|
-
let t =
|
|
3678
|
+
function Eo(e) {
|
|
3679
|
+
let t = To(e.args);
|
|
3658
3680
|
return t ? `${e.name}(${t})` : e.name;
|
|
3659
3681
|
}
|
|
3660
|
-
function
|
|
3682
|
+
function Do(e) {
|
|
3661
3683
|
return e === "output-available" || e === "output-error" || e === "output-denied";
|
|
3662
3684
|
}
|
|
3663
|
-
function
|
|
3664
|
-
return !!e && !
|
|
3685
|
+
function Oo(e) {
|
|
3686
|
+
return !!e && !Do(e);
|
|
3665
3687
|
}
|
|
3666
|
-
function
|
|
3667
|
-
return
|
|
3688
|
+
function ko(e, t) {
|
|
3689
|
+
return rn(e, t);
|
|
3668
3690
|
}
|
|
3669
|
-
function
|
|
3670
|
-
return e.some(({ segment: e }) =>
|
|
3671
|
-
let t =
|
|
3691
|
+
function Ao({ items: e, labels: t, status: n, hasLaterText: r }) {
|
|
3692
|
+
return e.some(({ segment: e }) => ko(go(e), n)) ? "aborted" : !r && (n === "streaming" || n === "submitted") ? "running" : t.some((e) => e.isError) || e.some(({ segment: e }) => {
|
|
3693
|
+
let t = go(e);
|
|
3672
3694
|
return t === "output-error" || t === "output-denied";
|
|
3673
|
-
}) ? "error" : e.some(({ segment: e }) =>
|
|
3695
|
+
}) ? "error" : e.some(({ segment: e }) => Oo(go(e))) || !r && t.every((e) => e.kind === "reasoning") && (n === "streaming" || n === "submitted") ? "running" : "complete";
|
|
3674
3696
|
}
|
|
3675
|
-
function
|
|
3697
|
+
function jo(e) {
|
|
3676
3698
|
return e && `${e[0].toUpperCase()}${e.slice(1)}`;
|
|
3677
3699
|
}
|
|
3678
|
-
function
|
|
3700
|
+
function Mo(e) {
|
|
3679
3701
|
return e.filter((e) => e.kind !== "reasoning").length;
|
|
3680
3702
|
}
|
|
3681
|
-
function
|
|
3682
|
-
let n =
|
|
3703
|
+
function No(e, t) {
|
|
3704
|
+
let n = Mo(e);
|
|
3683
3705
|
if (n !== 0) return `${t === "running" || t === "aborted" ? "running" : "ran"} ${n} ${n === 1 ? "tool" : "tools"}`;
|
|
3684
3706
|
}
|
|
3685
|
-
function
|
|
3686
|
-
let n =
|
|
3687
|
-
if (n) return
|
|
3707
|
+
function Po(e, t) {
|
|
3708
|
+
let n = No(e, t);
|
|
3709
|
+
if (n) return jo(t === "error" ? `${n} with issues` : t === "aborted" ? `cancelled after ${n}` : n);
|
|
3688
3710
|
}
|
|
3689
|
-
function
|
|
3711
|
+
function Fo(e) {
|
|
3712
|
+
let t = e.findLast((e) => e.kind !== "reasoning");
|
|
3713
|
+
return t?.form === "sentence" ? t : void 0;
|
|
3714
|
+
}
|
|
3715
|
+
function Io(e, t, n) {
|
|
3690
3716
|
let r = e.length === 1 ? e[0] : void 0;
|
|
3691
3717
|
if (t === "running") return n || (r?.kind === "reasoning" ? `Reasoning${r.detail ? ` ${r.detail}` : ""}` : e.every((e) => e.kind === "reasoning") ? "Reasoning" : "Working...");
|
|
3692
|
-
if (r) {
|
|
3693
|
-
let e =
|
|
3718
|
+
if (r?.form === "call") {
|
|
3719
|
+
let e = Eo(r);
|
|
3694
3720
|
return t === "error" ? `Failed ${e}` : t === "aborted" ? `Cancelled ${e}` : r.kind === "reasoning" ? `Reasoned${r.detail ? ` ${r.detail}` : ""}` : `Called ${e}`;
|
|
3695
3721
|
}
|
|
3696
|
-
return e.every((e) => e.kind === "reasoning") ? "Reasoned" :
|
|
3722
|
+
return e.every((e) => e.kind === "reasoning") ? "Reasoned" : Po(e, t) ?? "Ran tools";
|
|
3697
3723
|
}
|
|
3698
|
-
function
|
|
3724
|
+
function Lo(e, t) {
|
|
3699
3725
|
if (t !== "running") {
|
|
3700
3726
|
if (e.length === 1) {
|
|
3701
3727
|
let t = e[0];
|
|
3702
3728
|
return t.kind === "reasoning" ? void 0 : t.detail;
|
|
3703
3729
|
}
|
|
3704
|
-
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;
|
|
3730
|
+
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.form === "sentence" ? e.text : e.name))).slice(0, 3).join(", ") || void 0;
|
|
3705
3731
|
}
|
|
3706
3732
|
}
|
|
3707
|
-
function
|
|
3733
|
+
function Ro(e) {
|
|
3708
3734
|
let t;
|
|
3709
3735
|
for (let n = e.length - 1; n >= 0; n--) {
|
|
3710
3736
|
let r = e[n].segment;
|
|
3711
3737
|
if (r.kind === "dynamic-tool" && r.part.type === "dynamic-tool") {
|
|
3712
|
-
let e =
|
|
3738
|
+
let e = So(r.part.input);
|
|
3713
3739
|
if (e) return e;
|
|
3714
3740
|
}
|
|
3715
3741
|
if (r.kind === "tool" && S(r.part)) {
|
|
3716
|
-
let e =
|
|
3742
|
+
let e = So(r.part.input);
|
|
3717
3743
|
if (e) return e;
|
|
3718
3744
|
}
|
|
3719
|
-
r.kind === "reasoning" && (t ??=
|
|
3745
|
+
r.kind === "reasoning" && (t ??= Co(r));
|
|
3720
3746
|
}
|
|
3721
3747
|
return t;
|
|
3722
3748
|
}
|
|
3723
|
-
function
|
|
3724
|
-
return !e || e.role !== "assistant" ? !1 :
|
|
3749
|
+
function zo(e, t) {
|
|
3750
|
+
return !e || e.role !== "assistant" ? !1 : ho(ca(e.parts), t).some((e) => e.kind === "group" && !e.hasLaterText);
|
|
3725
3751
|
}
|
|
3726
|
-
function
|
|
3727
|
-
let e = O(8), { message: t } =
|
|
3728
|
-
e[0] === t.parts ? r = e[1] : (r =
|
|
3752
|
+
function Bo() {
|
|
3753
|
+
let e = O(8), { message: t } = q(), { debugMode: n } = z(), r;
|
|
3754
|
+
e[0] === t.parts ? r = e[1] : (r = ca(t.parts), e[0] = t.parts, e[1] = r);
|
|
3729
3755
|
let i = r, a;
|
|
3730
3756
|
if (e[2] !== n || e[3] !== t.id || e[4] !== i) {
|
|
3731
3757
|
let r;
|
|
@@ -3734,30 +3760,30 @@ function Io() {
|
|
|
3734
3760
|
key: `${t.id}-${e.firstIndex}-group-${e.hasLaterText ? "past" : "current"}`
|
|
3735
3761
|
} : {
|
|
3736
3762
|
...e,
|
|
3737
|
-
key: `${t.id}-${
|
|
3738
|
-
}, e[6] = t.id, e[7] = r), a =
|
|
3763
|
+
key: `${t.id}-${la(e.segment, e.segmentIndex)}-${e.segment.kind}`
|
|
3764
|
+
}, e[6] = t.id, e[7] = r), a = ho(i, n).map(r), e[2] = n, e[3] = t.id, e[4] = i, e[5] = a;
|
|
3739
3765
|
} else a = e[5];
|
|
3740
3766
|
return a;
|
|
3741
3767
|
}
|
|
3742
|
-
var
|
|
3743
|
-
function
|
|
3744
|
-
let e = l(
|
|
3768
|
+
var Vo = o(null);
|
|
3769
|
+
function Ho() {
|
|
3770
|
+
let e = l(Vo);
|
|
3745
3771
|
if (!e) throw Error("CompactTrajectory group parts must be rendered within CompactTrajectory.Group");
|
|
3746
3772
|
return e;
|
|
3747
3773
|
}
|
|
3748
|
-
function
|
|
3749
|
-
let t = O(21), { group: n, children: r } = e, { registry: i } = z(), { message: a } =
|
|
3774
|
+
function Uo(e) {
|
|
3775
|
+
let t = O(21), { group: n, children: r } = e, { registry: i } = z(), { message: a } = q(), o = K(), [s, c] = g(!n.hasLaterText), l, u, d;
|
|
3750
3776
|
if (t[0] !== n.hasLaterText || t[1] !== n.items || t[2] !== i || t[3] !== o) {
|
|
3751
3777
|
let e;
|
|
3752
3778
|
t[7] === i ? e = t[8] : (e = (e) => {
|
|
3753
3779
|
let { segment: t } = e;
|
|
3754
|
-
return
|
|
3755
|
-
}, t[7] = i, t[8] = e), u = n.items.map(e), l =
|
|
3780
|
+
return wo(t, i);
|
|
3781
|
+
}, t[7] = i, t[8] = e), u = n.items.map(e), l = Ao({
|
|
3756
3782
|
items: n.items,
|
|
3757
3783
|
labels: u,
|
|
3758
3784
|
status: o,
|
|
3759
3785
|
hasLaterText: n.hasLaterText
|
|
3760
|
-
}), d =
|
|
3786
|
+
}), d = _o({
|
|
3761
3787
|
groupStatus: l,
|
|
3762
3788
|
labelCount: u.length
|
|
3763
3789
|
}), t[0] = n.hasLaterText, t[1] = n.items, t[2] = i, t[3] = o, t[4] = l, t[5] = u, t[6] = d;
|
|
@@ -3778,74 +3804,102 @@ function zo(e) {
|
|
|
3778
3804
|
children: r
|
|
3779
3805
|
}), t[15] = r, t[16] = s, t[17] = m) : m = t[17];
|
|
3780
3806
|
let h;
|
|
3781
|
-
return t[18] !== p || t[19] !== m ? (h = /* @__PURE__ */ M(
|
|
3807
|
+
return t[18] !== p || t[19] !== m ? (h = /* @__PURE__ */ M(Vo, {
|
|
3782
3808
|
value: p,
|
|
3783
3809
|
children: m
|
|
3784
3810
|
}), t[18] = p, t[19] = m, t[20] = h) : h = t[20], h;
|
|
3785
3811
|
}
|
|
3786
|
-
function
|
|
3812
|
+
function Wo(e) {
|
|
3787
3813
|
let t = O(3), { children: n } = e, r;
|
|
3788
3814
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ M("button", {
|
|
3789
3815
|
type: "button",
|
|
3790
|
-
className:
|
|
3816
|
+
className: ln("items-start")
|
|
3791
3817
|
}), t[0] = r) : r = t[0];
|
|
3792
3818
|
let i;
|
|
3793
3819
|
return t[1] === n ? i = t[2] : (i = /* @__PURE__ */ M(L, {
|
|
3794
3820
|
render: r,
|
|
3795
3821
|
children: /* @__PURE__ */ M("span", {
|
|
3796
|
-
className: "min-w-0 flex-1 text-
|
|
3822
|
+
className: "min-w-0 flex-1 text-start text-sm",
|
|
3797
3823
|
children: n
|
|
3798
3824
|
})
|
|
3799
3825
|
}), t[1] = n, t[2] = i), i;
|
|
3800
3826
|
}
|
|
3801
|
-
function
|
|
3802
|
-
let e = O(
|
|
3803
|
-
e[0]
|
|
3804
|
-
let o = a
|
|
3805
|
-
|
|
3827
|
+
function Go() {
|
|
3828
|
+
let e = O(20), { items: t, labels: n, groupStatus: r, tone: i } = Ho(), a;
|
|
3829
|
+
e[0] === n ? a = e[1] : (a = Fo(n), e[0] = n, e[1] = a);
|
|
3830
|
+
let o = a;
|
|
3831
|
+
if (o) {
|
|
3832
|
+
let t = Mo(n) - 1, a = t > 0 ? t : void 0, s;
|
|
3833
|
+
return e[2] !== r || e[3] !== o.detail || e[4] !== o.text || e[5] !== a || e[6] !== i ? (s = {
|
|
3834
|
+
title: o.text,
|
|
3835
|
+
more: a,
|
|
3836
|
+
detail: o.detail,
|
|
3837
|
+
isSentence: !0,
|
|
3838
|
+
tone: i,
|
|
3839
|
+
groupStatus: r
|
|
3840
|
+
}, e[2] = r, e[3] = o.detail, e[4] = o.text, e[5] = a, e[6] = i, e[7] = s) : s = e[7], s;
|
|
3841
|
+
}
|
|
3842
|
+
let s;
|
|
3843
|
+
e[8] !== r || e[9] !== t || e[10] !== n ? (s = Io(n, r, Ro(t)), e[8] = r, e[9] = t, e[10] = n, e[11] = s) : s = e[11];
|
|
3806
3844
|
let c = s, l;
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3845
|
+
e[12] !== r || e[13] !== n ? (l = Lo(n, r), e[12] = r, e[13] = n, e[14] = l) : l = e[14];
|
|
3846
|
+
let u = l, d;
|
|
3847
|
+
return e[15] !== u || e[16] !== r || e[17] !== c || e[18] !== i ? (d = {
|
|
3848
|
+
title: c,
|
|
3849
|
+
more: void 0,
|
|
3850
|
+
detail: u,
|
|
3851
|
+
isSentence: !1,
|
|
3810
3852
|
tone: i,
|
|
3811
3853
|
groupStatus: r
|
|
3812
|
-
}, e[
|
|
3854
|
+
}, e[15] = u, e[16] = r, e[17] = c, e[18] = i, e[19] = d) : d = e[19], d;
|
|
3813
3855
|
}
|
|
3814
|
-
function
|
|
3815
|
-
let t = O(
|
|
3816
|
-
t[0] ===
|
|
3817
|
-
let
|
|
3818
|
-
t[2] !==
|
|
3856
|
+
function Ko(e) {
|
|
3857
|
+
let t = O(14), { title: n, suffix: r, children: i } = e, a = Go(), { tone: o, groupStatus: s } = a, c = n === void 0, l = n ?? a.title, u = r ? `${l} · ${r}` : l, d = c ? a.more : void 0, f = s === "running" ? "text-info" : o.title, p = c && a.isSentence ? "auto" : void 0, m = s === "running", h;
|
|
3858
|
+
t[0] === f ? h = t[1] : (h = k("max-w-full min-w-0 truncate", f), t[0] = f, t[1] = h);
|
|
3859
|
+
let g;
|
|
3860
|
+
t[2] !== p || t[3] !== m || t[4] !== h || t[5] !== u ? (g = /* @__PURE__ */ M(W, {
|
|
3819
3861
|
as: "span",
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3862
|
+
dir: p,
|
|
3863
|
+
enabled: m,
|
|
3864
|
+
className: h,
|
|
3865
|
+
children: u
|
|
3866
|
+
}), t[2] = p, t[3] = m, t[4] = h, t[5] = u, t[6] = g) : g = t[6];
|
|
3867
|
+
let _;
|
|
3868
|
+
t[7] !== d || t[8] !== f ? (_ = d !== void 0 && /* @__PURE__ */ N("span", {
|
|
3869
|
+
dir: "ltr",
|
|
3870
|
+
className: k("shrink-0 tabular-nums", f),
|
|
3871
|
+
children: ["+", d]
|
|
3872
|
+
}), t[7] = d, t[8] = f, t[9] = _) : _ = t[9];
|
|
3873
|
+
let v;
|
|
3874
|
+
return t[10] !== i || t[11] !== g || t[12] !== _ ? (v = /* @__PURE__ */ N("span", {
|
|
3826
3875
|
className: "flex min-w-0 items-center gap-1.5",
|
|
3827
|
-
children: [
|
|
3828
|
-
|
|
3876
|
+
children: [
|
|
3877
|
+
g,
|
|
3878
|
+
_,
|
|
3879
|
+
i
|
|
3880
|
+
]
|
|
3881
|
+
}), t[10] = i, t[11] = g, t[12] = _, t[13] = v) : v = t[13], v;
|
|
3829
3882
|
}
|
|
3830
|
-
function
|
|
3831
|
-
let e = O(2), { tone: t } =
|
|
3832
|
-
return e[0] === t.chevron ? n = e[1] : (n = /* @__PURE__ */ M(
|
|
3883
|
+
function qo() {
|
|
3884
|
+
let e = O(2), { tone: t } = Ho(), n;
|
|
3885
|
+
return e[0] === t.chevron ? n = e[1] : (n = /* @__PURE__ */ M(cn, { className: t.chevron }), e[0] = t.chevron, e[1] = n), n;
|
|
3833
3886
|
}
|
|
3834
|
-
function
|
|
3835
|
-
let t = O(
|
|
3887
|
+
function Jo(e) {
|
|
3888
|
+
let t = O(6), { detail: n } = e, { title: r, detail: i, isSentence: a, tone: o } = Go();
|
|
3836
3889
|
if (n === null) return null;
|
|
3837
|
-
let
|
|
3838
|
-
if (!
|
|
3839
|
-
let
|
|
3840
|
-
t[0] ===
|
|
3841
|
-
let
|
|
3842
|
-
return t[2] !==
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3890
|
+
let s = n ?? i;
|
|
3891
|
+
if (!s || s === r) return null;
|
|
3892
|
+
let c = n === void 0 && a ? "auto" : void 0, l;
|
|
3893
|
+
t[0] === o.detail ? l = t[1] : (l = k("block truncate text-start text-xs", o.detail), t[0] = o.detail, t[1] = l);
|
|
3894
|
+
let u;
|
|
3895
|
+
return t[2] !== s || t[3] !== c || t[4] !== l ? (u = /* @__PURE__ */ M("span", {
|
|
3896
|
+
dir: c,
|
|
3897
|
+
className: l,
|
|
3898
|
+
children: s
|
|
3899
|
+
}), t[2] = s, t[3] = c, t[4] = l, t[5] = u) : u = t[5], u;
|
|
3846
3900
|
}
|
|
3847
|
-
function
|
|
3848
|
-
let t = O(14), { children: n } = e, { items: r, messageId: i, groupStatus: a } =
|
|
3901
|
+
function Yo(e) {
|
|
3902
|
+
let t = O(14), { children: n } = e, { items: r, messageId: i, groupStatus: a } = Ho(), o = a === "running", s;
|
|
3849
3903
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (s = {
|
|
3850
3904
|
initial: "instant",
|
|
3851
3905
|
resize: "instant"
|
|
@@ -3854,8 +3908,8 @@ function Go(e) {
|
|
|
3854
3908
|
t[1] === d ? f = t[2] : (f = k("mt-2", d), t[1] = d, t[2] = f);
|
|
3855
3909
|
let p = o ? l : void 0, m;
|
|
3856
3910
|
t[3] !== n || t[4] !== r || t[5] !== i ? (m = n ?? r.map((e, t) => {
|
|
3857
|
-
let { segment: n } = e, r = `${i}-${
|
|
3858
|
-
return n.kind === "tool" ? /* @__PURE__ */ M(
|
|
3911
|
+
let { segment: n } = e, r = `${i}-${la(n, t)}-${n.kind}`;
|
|
3912
|
+
return n.kind === "tool" ? /* @__PURE__ */ M(Z.Tool, { segment: n }, r) : n.kind === "reasoning" ? /* @__PURE__ */ M(Z.Reasoning, { segment: n }, r) : n.kind === "dynamic-tool" ? /* @__PURE__ */ M(Z.DynamicTool, { segment: n }, r) : null;
|
|
3859
3913
|
}), t[3] = n, t[4] = r, t[5] = i, t[6] = m) : m = t[6];
|
|
3860
3914
|
let h;
|
|
3861
3915
|
t[7] !== p || t[8] !== m ? (h = /* @__PURE__ */ M("div", {
|
|
@@ -3869,11 +3923,11 @@ function Go(e) {
|
|
|
3869
3923
|
children: h
|
|
3870
3924
|
}), t[10] = u, t[11] = f, t[12] = h, t[13] = g) : g = t[13], g;
|
|
3871
3925
|
}
|
|
3872
|
-
function
|
|
3873
|
-
let t = O(19), { item: n, textClassName: r } = e, i = r === void 0 ? "my-4" : r, { elements: a } =
|
|
3926
|
+
function Xo(e) {
|
|
3927
|
+
let t = O(19), { item: n, textClassName: r } = e, i = r === void 0 ? "my-4" : r, { elements: a } = G(), { segment: o } = n;
|
|
3874
3928
|
if (o.kind === "text") {
|
|
3875
3929
|
let e;
|
|
3876
|
-
t[0] === o.parts ? e = t[1] : (e = o.parts.filter(
|
|
3930
|
+
t[0] === o.parts ? e = t[1] : (e = o.parts.filter(Zo), t[0] = o.parts, t[1] = e);
|
|
3877
3931
|
let n = e;
|
|
3878
3932
|
if (n.length === 0) return null;
|
|
3879
3933
|
let r;
|
|
@@ -3882,7 +3936,7 @@ function Ko(e) {
|
|
|
3882
3936
|
parts: n
|
|
3883
3937
|
}, t[2] = o, t[3] = n, t[4] = r) : r = t[4];
|
|
3884
3938
|
let s;
|
|
3885
|
-
return t[5] !== a || t[6] !== r || t[7] !== i ? (s = /* @__PURE__ */ M(
|
|
3939
|
+
return t[5] !== a || t[6] !== r || t[7] !== i ? (s = /* @__PURE__ */ M(Z.Text, {
|
|
3886
3940
|
segment: r,
|
|
3887
3941
|
elements: a,
|
|
3888
3942
|
className: i
|
|
@@ -3890,75 +3944,75 @@ function Ko(e) {
|
|
|
3890
3944
|
}
|
|
3891
3945
|
if (o.kind === "file") {
|
|
3892
3946
|
let e;
|
|
3893
|
-
return t[9] === o ? e = t[10] : (e = /* @__PURE__ */ M(
|
|
3947
|
+
return t[9] === o ? e = t[10] : (e = /* @__PURE__ */ M(Z.File, { segment: o }), t[9] = o, t[10] = e), e;
|
|
3894
3948
|
}
|
|
3895
3949
|
if (o.kind === "source") {
|
|
3896
3950
|
let e;
|
|
3897
|
-
return t[11] === o ? e = t[12] : (e = /* @__PURE__ */ M(
|
|
3951
|
+
return t[11] === o ? e = t[12] : (e = /* @__PURE__ */ M(Z.Source, { segment: o }), t[11] = o, t[12] = e), e;
|
|
3898
3952
|
}
|
|
3899
3953
|
if (o.kind === "tool") {
|
|
3900
3954
|
let e;
|
|
3901
|
-
return t[13] === o ? e = t[14] : (e = /* @__PURE__ */ M(
|
|
3955
|
+
return t[13] === o ? e = t[14] : (e = /* @__PURE__ */ M(Z.Tool, { segment: o }), t[13] = o, t[14] = e), e;
|
|
3902
3956
|
}
|
|
3903
3957
|
if (o.kind === "reasoning") {
|
|
3904
3958
|
let e;
|
|
3905
|
-
return t[15] === o ? e = t[16] : (e = /* @__PURE__ */ M(
|
|
3959
|
+
return t[15] === o ? e = t[16] : (e = /* @__PURE__ */ M(Z.Reasoning, { segment: o }), t[15] = o, t[16] = e), e;
|
|
3906
3960
|
}
|
|
3907
3961
|
if (o.kind === "dynamic-tool") {
|
|
3908
3962
|
let e;
|
|
3909
|
-
return t[17] === o ? e = t[18] : (e = /* @__PURE__ */ M(
|
|
3963
|
+
return t[17] === o ? e = t[18] : (e = /* @__PURE__ */ M(Z.DynamicTool, { segment: o }), t[17] = o, t[18] = e), e;
|
|
3910
3964
|
}
|
|
3911
3965
|
return null;
|
|
3912
3966
|
}
|
|
3913
|
-
function
|
|
3967
|
+
function Zo(e) {
|
|
3914
3968
|
let { part: t } = e;
|
|
3915
|
-
return !
|
|
3916
|
-
}
|
|
3917
|
-
var
|
|
3918
|
-
Group:
|
|
3919
|
-
GroupTrigger:
|
|
3920
|
-
GroupTitle:
|
|
3921
|
-
GroupChevron:
|
|
3922
|
-
GroupDetail:
|
|
3923
|
-
GroupContent:
|
|
3924
|
-
Segment:
|
|
3969
|
+
return !qi(t);
|
|
3970
|
+
}
|
|
3971
|
+
var Qo = {
|
|
3972
|
+
Group: Uo,
|
|
3973
|
+
GroupTrigger: Wo,
|
|
3974
|
+
GroupTitle: Ko,
|
|
3975
|
+
GroupChevron: qo,
|
|
3976
|
+
GroupDetail: Jo,
|
|
3977
|
+
GroupContent: Yo,
|
|
3978
|
+
Segment: Xo
|
|
3925
3979
|
};
|
|
3926
|
-
function
|
|
3927
|
-
let e = O(1), t =
|
|
3928
|
-
if (t !== "ready" && t !== "error" &&
|
|
3980
|
+
function $o() {
|
|
3981
|
+
let e = O(1), t = K(), { messages: n } = G(), { debugMode: r } = z(), i = n[n.length - 1];
|
|
3982
|
+
if (t !== "ready" && t !== "error" && zo(i, r)) return null;
|
|
3929
3983
|
let a;
|
|
3930
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(
|
|
3984
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(ja, {}), e[0] = a) : a = e[0], a;
|
|
3931
3985
|
}
|
|
3932
|
-
var
|
|
3933
|
-
Root:
|
|
3934
|
-
List:
|
|
3935
|
-
Item:
|
|
3936
|
-
UserBubble:
|
|
3986
|
+
var es = {
|
|
3987
|
+
Root: Sa,
|
|
3988
|
+
List: Ca,
|
|
3989
|
+
Item: wa,
|
|
3990
|
+
UserBubble: uo,
|
|
3937
3991
|
AssistantContent: c(function(e) {
|
|
3938
|
-
let t = O(5), { className: n } = e, r =
|
|
3939
|
-
t[0] === r ? i = t[1] : (i = r.map(
|
|
3992
|
+
let t = O(5), { className: n } = e, r = Bo(), i;
|
|
3993
|
+
t[0] === r ? i = t[1] : (i = r.map(ts), t[0] = r, t[1] = i);
|
|
3940
3994
|
let a;
|
|
3941
3995
|
return t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M("div", {
|
|
3942
3996
|
className: n,
|
|
3943
3997
|
children: i
|
|
3944
3998
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
3945
3999
|
}),
|
|
3946
|
-
Actions:
|
|
3947
|
-
CopyAction:
|
|
3948
|
-
RegenerateAction:
|
|
3949
|
-
CopyDebugJsonAction:
|
|
3950
|
-
Thinking:
|
|
3951
|
-
Error:
|
|
4000
|
+
Actions: ga,
|
|
4001
|
+
CopyAction: _a,
|
|
4002
|
+
RegenerateAction: va,
|
|
4003
|
+
CopyDebugJsonAction: ya,
|
|
4004
|
+
Thinking: $o,
|
|
4005
|
+
Error: xa
|
|
3952
4006
|
};
|
|
3953
|
-
function
|
|
3954
|
-
return e.kind === "group" ? /* @__PURE__ */ N(
|
|
4007
|
+
function ts(e) {
|
|
4008
|
+
return e.kind === "group" ? /* @__PURE__ */ N(Uo, {
|
|
3955
4009
|
group: e,
|
|
3956
|
-
children: [/* @__PURE__ */ N(
|
|
3957
|
-
}, e.key) : /* @__PURE__ */ M(
|
|
4010
|
+
children: [/* @__PURE__ */ N(Wo, { children: [/* @__PURE__ */ M(Ko, { children: /* @__PURE__ */ M(qo, {}) }), /* @__PURE__ */ M(Jo, {})] }), /* @__PURE__ */ M(Yo, {})]
|
|
4011
|
+
}, e.key) : /* @__PURE__ */ M(Xo, { item: e }, e.key);
|
|
3958
4012
|
}
|
|
3959
4013
|
//#endregion
|
|
3960
4014
|
//#region src/lib/chat/trajectory/trajectories/messages.tsx
|
|
3961
|
-
function
|
|
4015
|
+
function ns(e) {
|
|
3962
4016
|
let t = O(8), { message: n, className: r } = e, i;
|
|
3963
4017
|
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);
|
|
3964
4018
|
let a;
|
|
@@ -3971,36 +4025,49 @@ function Qo(e) {
|
|
|
3971
4025
|
children: [a, o]
|
|
3972
4026
|
}), t[5] = i, t[6] = o, t[7] = s) : s = t[7], s;
|
|
3973
4027
|
}
|
|
3974
|
-
function
|
|
4028
|
+
function rs(e) {
|
|
4029
|
+
let t = O(9), { name: n, args: r } = e, i;
|
|
4030
|
+
t[0] === r ? i = t[1] : (i = r ? Object.values(r)[0] : void 0, t[0] = r, t[1] = i);
|
|
4031
|
+
let a = i, o;
|
|
4032
|
+
t[2] === n ? o = t[3] : (o = /* @__PURE__ */ M("span", {
|
|
4033
|
+
className: "ms-2 font-mono",
|
|
4034
|
+
children: n
|
|
4035
|
+
}), t[2] = n, t[3] = o);
|
|
4036
|
+
let s;
|
|
4037
|
+
t[4] === a ? s = t[5] : (s = a && /* @__PURE__ */ N("span", {
|
|
4038
|
+
className: "truncate",
|
|
4039
|
+
children: [
|
|
4040
|
+
"(",
|
|
4041
|
+
a,
|
|
4042
|
+
")"
|
|
4043
|
+
]
|
|
4044
|
+
}), t[4] = a, t[5] = s);
|
|
4045
|
+
let c;
|
|
4046
|
+
return t[6] !== o || t[7] !== s ? (c = /* @__PURE__ */ N(j, { children: [o, s] }), t[6] = o, t[7] = s, t[8] = c) : c = t[8], c;
|
|
4047
|
+
}
|
|
4048
|
+
function is(e) {
|
|
3975
4049
|
let t = O(15), { part: n } = e, r = z(), i, a;
|
|
3976
4050
|
if (t[0] !== r.registry || t[1] !== n) {
|
|
3977
4051
|
a = Symbol.for("react.early_return_sentinel");
|
|
3978
4052
|
bb0: {
|
|
3979
|
-
let { toolEntry: e } =
|
|
3980
|
-
if (e &&
|
|
4053
|
+
let { toolEntry: e } = yi(n, r.registry);
|
|
4054
|
+
if (e && bi(e, n.state)) {
|
|
3981
4055
|
let t = e.label?.(n);
|
|
3982
4056
|
if (!t) {
|
|
3983
4057
|
a = null;
|
|
3984
4058
|
break bb0;
|
|
3985
4059
|
}
|
|
3986
|
-
let r = t.icon
|
|
4060
|
+
let r = t.icon;
|
|
3987
4061
|
a = /* @__PURE__ */ N("div", {
|
|
3988
4062
|
className: "text-muted-foreground flex items-center text-xs",
|
|
3989
|
-
children: [
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
children: [
|
|
3998
|
-
"(",
|
|
3999
|
-
i,
|
|
4000
|
-
")"
|
|
4001
|
-
]
|
|
4002
|
-
})
|
|
4003
|
-
]
|
|
4063
|
+
children: [r && /* @__PURE__ */ M(r, { className: "size-3.5" }), t.kind === "sentence" ? /* @__PURE__ */ M("span", {
|
|
4064
|
+
dir: "auto",
|
|
4065
|
+
className: "ms-2 truncate text-start",
|
|
4066
|
+
children: t.text
|
|
4067
|
+
}) : /* @__PURE__ */ M(rs, {
|
|
4068
|
+
name: t.name,
|
|
4069
|
+
args: t.args
|
|
4070
|
+
})]
|
|
4004
4071
|
});
|
|
4005
4072
|
break bb0;
|
|
4006
4073
|
}
|
|
@@ -4010,14 +4077,14 @@ function $o(e) {
|
|
|
4010
4077
|
} else i = t[2], a = t[3];
|
|
4011
4078
|
if (a !== Symbol.for("react.early_return_sentinel")) return a;
|
|
4012
4079
|
let o = i, s;
|
|
4013
|
-
t[4] !== o || t[5] !== n ? (s = o && /* @__PURE__ */ M(
|
|
4080
|
+
t[4] !== o || t[5] !== n ? (s = o && /* @__PURE__ */ M(Ui, {
|
|
4014
4081
|
label: o,
|
|
4015
4082
|
part: n
|
|
4016
4083
|
}), t[4] = o, t[5] = n, t[6] = s) : s = t[6];
|
|
4017
4084
|
let c;
|
|
4018
|
-
t[7] === o ? c = t[8] : (c = o?.isError && o.detail && /* @__PURE__ */ M(
|
|
4085
|
+
t[7] === o ? c = t[8] : (c = o?.isError && o.detail && /* @__PURE__ */ M(ns, { message: o.detail }), t[7] = o, t[8] = c);
|
|
4019
4086
|
let l;
|
|
4020
|
-
t[9] === n ? l = t[10] : (l = /* @__PURE__ */ M(
|
|
4087
|
+
t[9] === n ? l = t[10] : (l = /* @__PURE__ */ M(zi, { part: n }), t[9] = n, t[10] = l);
|
|
4021
4088
|
let u;
|
|
4022
4089
|
return t[11] !== s || t[12] !== c || t[13] !== l ? (u = /* @__PURE__ */ N(j, { children: [
|
|
4023
4090
|
s,
|
|
@@ -4025,9 +4092,9 @@ function $o(e) {
|
|
|
4025
4092
|
l
|
|
4026
4093
|
] }), t[11] = s, t[12] = c, t[13] = l, t[14] = u) : u = t[14], u;
|
|
4027
4094
|
}
|
|
4028
|
-
function
|
|
4095
|
+
function as(e) {
|
|
4029
4096
|
let t = O(5), { part: n } = e, [r, i] = g(!1), a;
|
|
4030
|
-
t[0] === n.text ? a = t[1] : (a = /* @__PURE__ */ M(
|
|
4097
|
+
t[0] === n.text ? a = t[1] : (a = /* @__PURE__ */ M(Y, {
|
|
4031
4098
|
mode: "static",
|
|
4032
4099
|
children: n.text
|
|
4033
4100
|
}), t[0] = n.text, t[1] = a);
|
|
@@ -4035,7 +4102,7 @@ function es(e) {
|
|
|
4035
4102
|
return t[2] !== r || t[3] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
4036
4103
|
"data-copy-exclude": "assistant-snapshot",
|
|
4037
4104
|
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",
|
|
4038
|
-
children: /* @__PURE__ */ M(
|
|
4105
|
+
children: /* @__PURE__ */ M(Xa, {
|
|
4039
4106
|
label: "Reasoning",
|
|
4040
4107
|
open: r,
|
|
4041
4108
|
onOpenChange: i,
|
|
@@ -4046,12 +4113,12 @@ function es(e) {
|
|
|
4046
4113
|
})
|
|
4047
4114
|
}), t[2] = r, t[3] = a, t[4] = o) : o = t[4], o;
|
|
4048
4115
|
}
|
|
4049
|
-
function
|
|
4050
|
-
let t = O(16), { part: n } = e, { elements: r } =
|
|
4116
|
+
function os(e) {
|
|
4117
|
+
let t = O(16), { part: n } = e, { elements: r } = G(), i = Bi();
|
|
4051
4118
|
if (n.type === "text") {
|
|
4052
|
-
if (
|
|
4119
|
+
if (qi(n)) return null;
|
|
4053
4120
|
let e;
|
|
4054
|
-
return t[0] !== r || t[1] !== n.citations || t[2] !== n.text ? (e = /* @__PURE__ */ M(
|
|
4121
|
+
return t[0] !== r || t[1] !== n.citations || t[2] !== n.text ? (e = /* @__PURE__ */ M(Ri, {
|
|
4055
4122
|
text: n.text,
|
|
4056
4123
|
citations: n.citations,
|
|
4057
4124
|
elements: r
|
|
@@ -4059,19 +4126,19 @@ function ts(e) {
|
|
|
4059
4126
|
}
|
|
4060
4127
|
if (n.type === "dynamic-tool") {
|
|
4061
4128
|
let e;
|
|
4062
|
-
return t[4] !== i || t[5] !== n ? (e = i ? /* @__PURE__ */ M(
|
|
4129
|
+
return t[4] !== i || t[5] !== n ? (e = i ? /* @__PURE__ */ M(ei, { part: n }) : null, t[4] = i, t[5] = n, t[6] = e) : e = t[6], e;
|
|
4063
4130
|
}
|
|
4064
4131
|
if (S(n)) {
|
|
4065
4132
|
let e;
|
|
4066
|
-
return t[7] === n ? e = t[8] : (e = /* @__PURE__ */ M(
|
|
4133
|
+
return t[7] === n ? e = t[8] : (e = /* @__PURE__ */ M(is, { part: n }), t[7] = n, t[8] = e), e;
|
|
4067
4134
|
}
|
|
4068
4135
|
if (n.type === "reasoning" && n.text) {
|
|
4069
4136
|
let e;
|
|
4070
|
-
return t[9] !== i || t[10] !== n ? (e = i ? /* @__PURE__ */ M(
|
|
4137
|
+
return t[9] !== i || t[10] !== n ? (e = i ? /* @__PURE__ */ M(as, { part: n }) : null, t[9] = i, t[10] = n, t[11] = e) : e = t[11], e;
|
|
4071
4138
|
}
|
|
4072
4139
|
if (n.type === "file") {
|
|
4073
4140
|
let e;
|
|
4074
|
-
return t[12] !== n.filename || t[13] !== n.mediaType || t[14] !== n.url ? (e = /* @__PURE__ */ M(
|
|
4141
|
+
return t[12] !== n.filename || t[13] !== n.mediaType || t[14] !== n.url ? (e = /* @__PURE__ */ M(Mi, {
|
|
4075
4142
|
filename: n.filename,
|
|
4076
4143
|
mediaType: n.mediaType,
|
|
4077
4144
|
url: n.url
|
|
@@ -4079,13 +4146,13 @@ function ts(e) {
|
|
|
4079
4146
|
}
|
|
4080
4147
|
return null;
|
|
4081
4148
|
}
|
|
4082
|
-
var
|
|
4083
|
-
let t = O(10), { className: n } = e, { message: r } =
|
|
4149
|
+
var ss = c(function(e) {
|
|
4150
|
+
let t = O(10), { className: n } = e, { message: r } = q(), i;
|
|
4084
4151
|
t[0] === n ? i = t[1] : (i = k("flex-1 space-y-3", n), t[0] = n, t[1] = i);
|
|
4085
4152
|
let a;
|
|
4086
4153
|
if (t[2] !== r.id || t[3] !== r.parts) {
|
|
4087
4154
|
let e;
|
|
4088
|
-
t[5] === r.id ? e = t[6] : (e = (e, t) => /* @__PURE__ */ M(
|
|
4155
|
+
t[5] === r.id ? e = t[6] : (e = (e, t) => /* @__PURE__ */ M(os, { 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;
|
|
4089
4156
|
} else a = t[4];
|
|
4090
4157
|
let o;
|
|
4091
4158
|
return t[7] !== i || t[8] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
@@ -4093,13 +4160,13 @@ var ns = c(function(e) {
|
|
|
4093
4160
|
children: a
|
|
4094
4161
|
}), t[7] = i, t[8] = a, t[9] = o) : o = t[9], o;
|
|
4095
4162
|
});
|
|
4096
|
-
function
|
|
4163
|
+
function cs(e) {
|
|
4097
4164
|
let t = O(9), { className: n, label: r } = e, i;
|
|
4098
|
-
t[0] === r ? i = t[1] : (i = r && r.split("\n").filter(
|
|
4165
|
+
t[0] === r ? i = t[1] : (i = r && r.split("\n").filter(ls).pop() || "Thinking...", t[0] = r, t[1] = i);
|
|
4099
4166
|
let a = i, o;
|
|
4100
4167
|
t[2] === n ? o = t[3] : (o = k("flex items-start", n), t[2] = n, t[3] = o);
|
|
4101
4168
|
let s;
|
|
4102
|
-
t[4] === a ? s = t[5] : (s = /* @__PURE__ */ M(
|
|
4169
|
+
t[4] === a ? s = t[5] : (s = /* @__PURE__ */ M(W, {
|
|
4103
4170
|
className: "text-muted-foreground line-clamp-2 text-sm",
|
|
4104
4171
|
children: a
|
|
4105
4172
|
}), t[4] = a, t[5] = s);
|
|
@@ -4110,33 +4177,33 @@ function rs(e) {
|
|
|
4110
4177
|
children: s
|
|
4111
4178
|
}), t[6] = o, t[7] = s, t[8] = c) : c = t[8], c;
|
|
4112
4179
|
}
|
|
4113
|
-
function
|
|
4180
|
+
function ls(e) {
|
|
4114
4181
|
return e.trim();
|
|
4115
4182
|
}
|
|
4116
|
-
function
|
|
4117
|
-
let e = O(5), t =
|
|
4118
|
-
e[0] !== t || e[1] !== r ? (i =
|
|
4183
|
+
function us() {
|
|
4184
|
+
let e = O(5), t = K(), { messages: n } = G(), r = n[n.length - 1], i;
|
|
4185
|
+
e[0] !== t || e[1] !== r ? (i = Oa(t, r), e[0] = t, e[1] = r, e[2] = i) : i = e[2];
|
|
4119
4186
|
let a = i;
|
|
4120
4187
|
if (!a) return null;
|
|
4121
4188
|
let o;
|
|
4122
|
-
return e[3] === a ? o = e[4] : (o = /* @__PURE__ */ M(
|
|
4189
|
+
return e[3] === a ? o = e[4] : (o = /* @__PURE__ */ M(cs, {
|
|
4123
4190
|
label: a,
|
|
4124
4191
|
className: "mt-2"
|
|
4125
4192
|
}), e[3] = a, e[4] = o), o;
|
|
4126
4193
|
}
|
|
4127
|
-
var
|
|
4128
|
-
Root:
|
|
4129
|
-
List:
|
|
4130
|
-
Item:
|
|
4131
|
-
UserBubble:
|
|
4132
|
-
AssistantContent:
|
|
4133
|
-
Thinking:
|
|
4134
|
-
Error:
|
|
4135
|
-
Actions:
|
|
4136
|
-
CopyAction:
|
|
4137
|
-
RegenerateAction:
|
|
4138
|
-
CopyDebugJsonAction:
|
|
4139
|
-
},
|
|
4194
|
+
var ds = {
|
|
4195
|
+
Root: Sa,
|
|
4196
|
+
List: Ca,
|
|
4197
|
+
Item: wa,
|
|
4198
|
+
UserBubble: uo,
|
|
4199
|
+
AssistantContent: ss,
|
|
4200
|
+
Thinking: us,
|
|
4201
|
+
Error: xa,
|
|
4202
|
+
Actions: ga,
|
|
4203
|
+
CopyAction: _a,
|
|
4204
|
+
RegenerateAction: va,
|
|
4205
|
+
CopyDebugJsonAction: ya
|
|
4206
|
+
}, fs = {
|
|
4140
4207
|
braille: {
|
|
4141
4208
|
frames: [
|
|
4142
4209
|
"⠋",
|
|
@@ -4203,10 +4270,10 @@ var os = {
|
|
|
4203
4270
|
interval: 100
|
|
4204
4271
|
}
|
|
4205
4272
|
};
|
|
4206
|
-
function
|
|
4273
|
+
function ps(e) {
|
|
4207
4274
|
let t = O(15), n, r, i;
|
|
4208
4275
|
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);
|
|
4209
|
-
let a = i === void 0 ? "braille" : i, o = St(), { frames: s, interval: c } =
|
|
4276
|
+
let a = i === void 0 ? "braille" : i, o = St(), { frames: s, interval: c } = fs[a], [l, u] = g(0), f, p;
|
|
4210
4277
|
t[4] !== o || t[5] !== s.length || t[6] !== c ? (f = () => {
|
|
4211
4278
|
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
4212
4279
|
let e = o.setInterval(() => {
|
|
@@ -4231,9 +4298,9 @@ function cs(e) {
|
|
|
4231
4298
|
}
|
|
4232
4299
|
//#endregion
|
|
4233
4300
|
//#region src/lib/chat/trajectory/trajectories/timeline.tsx
|
|
4234
|
-
function
|
|
4301
|
+
function ms(e) {
|
|
4235
4302
|
let t = O(11), { Icon: n, isLast: r, isLoading: i, aborted: a, state: o, isError: s } = e, c;
|
|
4236
|
-
t[0] !== n || t[1] !== a || t[2] !== s || t[3] !== i || t[4] !== o ? (c = i ? /* @__PURE__ */ M(
|
|
4303
|
+
t[0] !== n || t[1] !== a || t[2] !== s || t[3] !== i || t[4] !== o ? (c = i ? /* @__PURE__ */ M(ps, { 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];
|
|
4237
4304
|
let l;
|
|
4238
4305
|
t[6] === r ? l = t[7] : (l = !r && /* @__PURE__ */ M("span", { className: "bg-border w-px flex-1" }), t[6] = r, t[7] = l);
|
|
4239
4306
|
let u;
|
|
@@ -4242,16 +4309,16 @@ function ls(e) {
|
|
|
4242
4309
|
children: [c, l]
|
|
4243
4310
|
}), t[8] = c, t[9] = l, t[10] = u) : u = t[10], u;
|
|
4244
4311
|
}
|
|
4245
|
-
function
|
|
4246
|
-
let t = O(15), { isLast: n, label: r, state: i, aborted: a, children: o } = e, s = l(
|
|
4247
|
-
t[0] !== f || t[1] !== d || t[2] !== c?.isError || t[3] !== u || t[4] !== n || t[5] !== p ? (m = f ? /* @__PURE__ */ M(
|
|
4312
|
+
function hs(e) {
|
|
4313
|
+
let t = O(15), { isLast: n, label: r, state: i, aborted: a, children: o } = e, s = l(ea), 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;
|
|
4314
|
+
t[0] !== f || t[1] !== d || t[2] !== c?.isError || t[3] !== u || t[4] !== n || t[5] !== p ? (m = f ? /* @__PURE__ */ M(ms, {
|
|
4248
4315
|
Icon: f,
|
|
4249
4316
|
isLast: n,
|
|
4250
4317
|
isLoading: p,
|
|
4251
4318
|
aborted: d,
|
|
4252
4319
|
state: u,
|
|
4253
4320
|
isError: c?.isError ?? !1
|
|
4254
|
-
}) : /* @__PURE__ */ M(
|
|
4321
|
+
}) : /* @__PURE__ */ M(ka, { 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];
|
|
4255
4322
|
let h = m, g = n ? "" : "pb-3.5", _;
|
|
4256
4323
|
t[7] === g ? _ = t[8] : (_ = k("min-w-0 flex-1", g), t[7] = g, t[8] = _);
|
|
4257
4324
|
let v;
|
|
@@ -4260,16 +4327,16 @@ function us(e) {
|
|
|
4260
4327
|
children: o
|
|
4261
4328
|
}), t[9] = o, t[10] = _, t[11] = v) : v = t[11];
|
|
4262
4329
|
let y;
|
|
4263
|
-
return t[12] !== h || t[13] !== v ? (y = /* @__PURE__ */ M(
|
|
4330
|
+
return t[12] !== h || t[13] !== v ? (y = /* @__PURE__ */ M(Aa, {
|
|
4264
4331
|
marker: h,
|
|
4265
4332
|
children: v
|
|
4266
4333
|
}), t[12] = h, t[13] = v, t[14] = y) : y = t[14], y;
|
|
4267
4334
|
}
|
|
4268
|
-
function
|
|
4335
|
+
function gs(e) {
|
|
4269
4336
|
let t = O(10), { label: n, state: r, part: i, defaultOpen: a, children: o } = e, s = a !== void 0 && a, c;
|
|
4270
4337
|
t[0] !== n || t[1] !== i || t[2] !== r ? (c = /* @__PURE__ */ M(L, {
|
|
4271
4338
|
className: "cursor-pointer",
|
|
4272
|
-
children: /* @__PURE__ */ M(
|
|
4339
|
+
children: /* @__PURE__ */ M(Gi, {
|
|
4273
4340
|
label: n,
|
|
4274
4341
|
state: r,
|
|
4275
4342
|
part: i
|
|
@@ -4284,58 +4351,58 @@ function ds(e) {
|
|
|
4284
4351
|
children: [c, l]
|
|
4285
4352
|
}), t[6] = s, t[7] = c, t[8] = l, t[9] = u) : u = t[9], u;
|
|
4286
4353
|
}
|
|
4287
|
-
var
|
|
4288
|
-
Item:
|
|
4289
|
-
Disclosure:
|
|
4290
|
-
},
|
|
4291
|
-
Root:
|
|
4292
|
-
List:
|
|
4293
|
-
Item:
|
|
4294
|
-
UserBubble:
|
|
4354
|
+
var _s = {
|
|
4355
|
+
Item: hs,
|
|
4356
|
+
Disclosure: gs
|
|
4357
|
+
}, vs = {
|
|
4358
|
+
Root: Sa,
|
|
4359
|
+
List: Ca,
|
|
4360
|
+
Item: wa,
|
|
4361
|
+
UserBubble: uo,
|
|
4295
4362
|
AssistantContent: c(function(e) {
|
|
4296
|
-
let t = O(12), { className: n } = e, { message: r } =
|
|
4297
|
-
t[0] === r.parts ? c = t[1] : (c =
|
|
4363
|
+
let t = O(12), { className: n } = e, { message: r } = q(), { elements: i } = G(), { debugMode: a } = z(), o = Bi(), s = X(), c;
|
|
4364
|
+
t[0] === r.parts ? c = t[1] : (c = ca(r.parts), t[0] = r.parts, t[1] = c);
|
|
4298
4365
|
let l = c, u;
|
|
4299
4366
|
t[2] !== a || t[3] !== i || t[4] !== s || t[5] !== r.id || t[6] !== l || t[7] !== o ? (u = l.map((e, t) => {
|
|
4300
|
-
let n = `${r.id}-${
|
|
4301
|
-
if (e.kind === "text") return /* @__PURE__ */ M(
|
|
4367
|
+
let n = `${r.id}-${la(e, t)}-${e.kind}`;
|
|
4368
|
+
if (e.kind === "text") return /* @__PURE__ */ M(Z.Text, {
|
|
4302
4369
|
segment: e,
|
|
4303
4370
|
elements: i,
|
|
4304
4371
|
className: "my-4"
|
|
4305
4372
|
}, n);
|
|
4306
|
-
if (e.kind === "file") return /* @__PURE__ */ M(
|
|
4307
|
-
if (e.kind === "source") return /* @__PURE__ */ M(
|
|
4373
|
+
if (e.kind === "file") return /* @__PURE__ */ M(Z.File, { segment: e }, n);
|
|
4374
|
+
if (e.kind === "source") return /* @__PURE__ */ M(Z.Source, { segment: e }, n);
|
|
4308
4375
|
if (e.kind === "dynamic-tool") {
|
|
4309
4376
|
if (!o) return null;
|
|
4310
|
-
let r = !
|
|
4311
|
-
return /* @__PURE__ */ M(
|
|
4377
|
+
let r = !sa(l, t, !0);
|
|
4378
|
+
return /* @__PURE__ */ M(_s.Item, {
|
|
4312
4379
|
isLast: r,
|
|
4313
|
-
children: /* @__PURE__ */ M(
|
|
4380
|
+
children: /* @__PURE__ */ M(Z.DynamicTool, { segment: e })
|
|
4314
4381
|
}, n);
|
|
4315
4382
|
}
|
|
4316
4383
|
if (e.kind === "reasoning") {
|
|
4317
4384
|
if (s || e.part.type !== "reasoning") return null;
|
|
4318
|
-
let r = !
|
|
4385
|
+
let r = !sa(l, t, a), i = {
|
|
4319
4386
|
name: "Reasoning",
|
|
4320
4387
|
icon: Je,
|
|
4321
4388
|
args: { text: [...e.part.text].slice(0, 60).join("") }
|
|
4322
4389
|
};
|
|
4323
|
-
return /* @__PURE__ */ M(
|
|
4390
|
+
return /* @__PURE__ */ M(_s.Item, {
|
|
4324
4391
|
isLast: r,
|
|
4325
4392
|
label: i,
|
|
4326
|
-
children: /* @__PURE__ */ M(
|
|
4393
|
+
children: /* @__PURE__ */ M(_s.Disclosure, {
|
|
4327
4394
|
label: i,
|
|
4328
|
-
children: /* @__PURE__ */ M(
|
|
4395
|
+
children: /* @__PURE__ */ M(Z.Reasoning, { segment: e })
|
|
4329
4396
|
})
|
|
4330
4397
|
}, n);
|
|
4331
4398
|
}
|
|
4332
4399
|
if (e.kind === "tool") {
|
|
4333
|
-
let r = !
|
|
4334
|
-
return /* @__PURE__ */ M(
|
|
4400
|
+
let r = !sa(l, t, a);
|
|
4401
|
+
return /* @__PURE__ */ M(Z.Tool, {
|
|
4335
4402
|
segment: e,
|
|
4336
|
-
children: /* @__PURE__ */ M(
|
|
4403
|
+
children: /* @__PURE__ */ M(_s.Item, {
|
|
4337
4404
|
isLast: r,
|
|
4338
|
-
children: /* @__PURE__ */ M(
|
|
4405
|
+
children: /* @__PURE__ */ M(Z.ToolDisclosure, {})
|
|
4339
4406
|
})
|
|
4340
4407
|
}, n);
|
|
4341
4408
|
}
|
|
@@ -4347,19 +4414,19 @@ var fs = {
|
|
|
4347
4414
|
children: u
|
|
4348
4415
|
}), t[9] = n, t[10] = u, t[11] = d) : d = t[11], d;
|
|
4349
4416
|
}),
|
|
4350
|
-
Actions:
|
|
4351
|
-
CopyAction:
|
|
4352
|
-
RegenerateAction:
|
|
4353
|
-
CopyDebugJsonAction:
|
|
4354
|
-
Thinking:
|
|
4355
|
-
Error:
|
|
4417
|
+
Actions: ga,
|
|
4418
|
+
CopyAction: _a,
|
|
4419
|
+
RegenerateAction: va,
|
|
4420
|
+
CopyDebugJsonAction: ya,
|
|
4421
|
+
Thinking: ja,
|
|
4422
|
+
Error: xa
|
|
4356
4423
|
};
|
|
4357
4424
|
//#endregion
|
|
4358
4425
|
//#region src/lib/components/ChatComposer.tsx
|
|
4359
|
-
function
|
|
4426
|
+
function ys(e) {
|
|
4360
4427
|
let t = O(9), n, r;
|
|
4361
4428
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4362
|
-
let { hasSubmitted: i } =
|
|
4429
|
+
let { hasSubmitted: i } = V(), a;
|
|
4363
4430
|
t[3] === n ? a = t[4] : (a = k("bg-background sticky bottom-0 rounded-t-2xl border-0 **:data-[slot=composer-editor]:!min-h-15", n), t[3] = n, t[4] = a);
|
|
4364
4431
|
let o;
|
|
4365
4432
|
return t[5] !== i || t[6] !== r || t[7] !== a ? (o = /* @__PURE__ */ M(R.Root, {
|
|
@@ -4368,7 +4435,7 @@ function ms(e) {
|
|
|
4368
4435
|
...r
|
|
4369
4436
|
}), t[5] = i, t[6] = r, t[7] = a, t[8] = o) : o = t[8], o;
|
|
4370
4437
|
}
|
|
4371
|
-
function
|
|
4438
|
+
function bs(e) {
|
|
4372
4439
|
let t = O(8), n, r;
|
|
4373
4440
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4374
4441
|
let i;
|
|
@@ -4379,7 +4446,7 @@ function hs(e) {
|
|
|
4379
4446
|
...r
|
|
4380
4447
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4381
4448
|
}
|
|
4382
|
-
function
|
|
4449
|
+
function xs(e) {
|
|
4383
4450
|
let t = O(8), n, r;
|
|
4384
4451
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4385
4452
|
let i;
|
|
@@ -4390,7 +4457,7 @@ function gs(e) {
|
|
|
4390
4457
|
...r
|
|
4391
4458
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4392
4459
|
}
|
|
4393
|
-
function
|
|
4460
|
+
function Ss(e) {
|
|
4394
4461
|
let t = O(8), n, r;
|
|
4395
4462
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4396
4463
|
let i;
|
|
@@ -4401,7 +4468,7 @@ function _s(e) {
|
|
|
4401
4468
|
...r
|
|
4402
4469
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4403
4470
|
}
|
|
4404
|
-
function
|
|
4471
|
+
function Cs(e) {
|
|
4405
4472
|
let t = O(8), n, r;
|
|
4406
4473
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4407
4474
|
let i;
|
|
@@ -4412,7 +4479,7 @@ function vs(e) {
|
|
|
4412
4479
|
...r
|
|
4413
4480
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4414
4481
|
}
|
|
4415
|
-
function
|
|
4482
|
+
function ws(e) {
|
|
4416
4483
|
let t = O(8), n, r;
|
|
4417
4484
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4418
4485
|
let i;
|
|
@@ -4423,7 +4490,7 @@ function ys(e) {
|
|
|
4423
4490
|
...r
|
|
4424
4491
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4425
4492
|
}
|
|
4426
|
-
function
|
|
4493
|
+
function Ts(e) {
|
|
4427
4494
|
let t = O(3), n;
|
|
4428
4495
|
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];
|
|
4429
4496
|
let r;
|
|
@@ -4433,7 +4500,7 @@ function bs(e) {
|
|
|
4433
4500
|
...e
|
|
4434
4501
|
}), t[1] = e, t[2] = r), r;
|
|
4435
4502
|
}
|
|
4436
|
-
function
|
|
4503
|
+
function Es() {
|
|
4437
4504
|
let e = O(6), { actions: t, meta: n } = Tt("ChatComposer.CommandButton"), r;
|
|
4438
4505
|
e[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ M(et, { className: "size-4" }), e[0] = r) : r = e[0];
|
|
4439
4506
|
let i = n.activePopup?.trigger === "/", a;
|
|
@@ -4449,7 +4516,7 @@ function xs() {
|
|
|
4449
4516
|
onClick: a
|
|
4450
4517
|
}), e[3] = i, e[4] = a, e[5] = o) : o = e[5], o;
|
|
4451
4518
|
}
|
|
4452
|
-
function
|
|
4519
|
+
function Ds(e) {
|
|
4453
4520
|
switch (e) {
|
|
4454
4521
|
case "permission-denied": return "Allow microphone access to use dictation";
|
|
4455
4522
|
case "no-microphone": return "Connect a microphone to use dictation";
|
|
@@ -4458,17 +4525,17 @@ function Ss(e) {
|
|
|
4458
4525
|
case "transcription-failed": return "Unable to transcribe audio";
|
|
4459
4526
|
}
|
|
4460
4527
|
}
|
|
4461
|
-
function
|
|
4528
|
+
function Os(e) {
|
|
4462
4529
|
switch (e.status) {
|
|
4463
4530
|
case "unavailable": return e.reason === "blocked" ? "Allow microphone access in your browser settings to use dictation" : "Dictation is not available in this browser";
|
|
4464
4531
|
case "idle": return "Start dictation";
|
|
4465
4532
|
case "starting": return "Starting dictation";
|
|
4466
4533
|
case "recording": return "Stop dictation";
|
|
4467
4534
|
case "finishing": return "Transcribing…";
|
|
4468
|
-
case "failed": return
|
|
4535
|
+
case "failed": return Ds(e.error.code);
|
|
4469
4536
|
}
|
|
4470
4537
|
}
|
|
4471
|
-
function
|
|
4538
|
+
function ks(e) {
|
|
4472
4539
|
switch (e.status) {
|
|
4473
4540
|
case "recording": return /* @__PURE__ */ M(nt, { className: "size-4 fill-current" });
|
|
4474
4541
|
case "starting":
|
|
@@ -4478,11 +4545,11 @@ function ws(e) {
|
|
|
4478
4545
|
case "failed": return /* @__PURE__ */ M(Qe, { className: "size-4" });
|
|
4479
4546
|
}
|
|
4480
4547
|
}
|
|
4481
|
-
function
|
|
4482
|
-
let e = O(20), { status: t } =
|
|
4483
|
-
e[0] === n ? r = e[1] : (r =
|
|
4548
|
+
function As() {
|
|
4549
|
+
let e = O(20), { status: t } = B(), { state: n } = Et("ChatComposer.Dictate"), r;
|
|
4550
|
+
e[0] === n ? r = e[1] : (r = Os(n), e[0] = n, e[1] = r);
|
|
4484
4551
|
let i = r, a = n.status === "starting" || n.status === "recording" || n.status === "finishing", o = t === "streaming" || t === "submitted", s;
|
|
4485
|
-
e[2] === n ? s = e[3] : (s =
|
|
4552
|
+
e[2] === n ? s = e[3] : (s = ks(n), e[2] = n, e[3] = s);
|
|
4486
4553
|
let c;
|
|
4487
4554
|
e[4] !== i || e[5] !== s ? (c = /* @__PURE__ */ M(Q, {
|
|
4488
4555
|
icon: s,
|
|
@@ -4512,22 +4579,22 @@ function Ts() {
|
|
|
4512
4579
|
d
|
|
4513
4580
|
] }), e[16] = l, e[17] = u, e[18] = d, e[19] = f) : f = e[19], f;
|
|
4514
4581
|
}
|
|
4515
|
-
var
|
|
4516
|
-
Provider:
|
|
4517
|
-
Root:
|
|
4582
|
+
var js = {
|
|
4583
|
+
Provider: ys,
|
|
4584
|
+
Root: bs,
|
|
4518
4585
|
Popup: R.Popup,
|
|
4519
|
-
Content:
|
|
4520
|
-
Attachments:
|
|
4521
|
-
Editor:
|
|
4586
|
+
Content: xs,
|
|
4587
|
+
Attachments: Cs,
|
|
4588
|
+
Editor: Ss,
|
|
4522
4589
|
Error: R.Error,
|
|
4523
|
-
Toolbar:
|
|
4524
|
-
CommandButton:
|
|
4525
|
-
AttachFiles:
|
|
4526
|
-
Dictate:
|
|
4590
|
+
Toolbar: ws,
|
|
4591
|
+
CommandButton: Es,
|
|
4592
|
+
AttachFiles: Ts,
|
|
4593
|
+
Dictate: As
|
|
4527
4594
|
};
|
|
4528
4595
|
//#endregion
|
|
4529
4596
|
//#region src/lib/components/ChatTextarea.tsx
|
|
4530
|
-
function
|
|
4597
|
+
function Ms(e) {
|
|
4531
4598
|
let t = O(10), n, r, i;
|
|
4532
4599
|
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);
|
|
4533
4600
|
let a;
|
|
@@ -4544,7 +4611,7 @@ function Ds(e) {
|
|
|
4544
4611
|
}
|
|
4545
4612
|
//#endregion
|
|
4546
4613
|
//#region src/lib/components/queue.tsx
|
|
4547
|
-
function
|
|
4614
|
+
function Ns(e) {
|
|
4548
4615
|
let t = O(5), { children: n, className: r } = e, i;
|
|
4549
4616
|
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);
|
|
4550
4617
|
let a;
|
|
@@ -4553,7 +4620,7 @@ function Os(e) {
|
|
|
4553
4620
|
children: n
|
|
4554
4621
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
4555
4622
|
}
|
|
4556
|
-
function
|
|
4623
|
+
function Ps(e) {
|
|
4557
4624
|
let t = O(5), { children: n, className: r } = e, i;
|
|
4558
4625
|
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);
|
|
4559
4626
|
let a;
|
|
@@ -4562,13 +4629,13 @@ function ks(e) {
|
|
|
4562
4629
|
children: n
|
|
4563
4630
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
4564
4631
|
}
|
|
4565
|
-
function
|
|
4632
|
+
function Fs(e) {
|
|
4566
4633
|
let t = O(4), { className: n } = e, r;
|
|
4567
4634
|
t[0] === n ? r = t[1] : (r = k("text-muted-foreground size-3.5 shrink-0", n), t[0] = n, t[1] = r);
|
|
4568
4635
|
let i;
|
|
4569
4636
|
return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ M(Ye, { className: r }), t[2] = r, t[3] = i), i;
|
|
4570
4637
|
}
|
|
4571
|
-
function
|
|
4638
|
+
function Is(e) {
|
|
4572
4639
|
let t = O(7), { children: n, className: r } = e, i;
|
|
4573
4640
|
t[0] === r ? i = t[1] : (i = k("min-w-0 flex-1 truncate text-sm", r), t[0] = r, t[1] = i);
|
|
4574
4641
|
let a;
|
|
@@ -4579,7 +4646,7 @@ function js(e) {
|
|
|
4579
4646
|
children: a
|
|
4580
4647
|
}), t[4] = i, t[5] = a, t[6] = o) : o = t[6], o;
|
|
4581
4648
|
}
|
|
4582
|
-
function
|
|
4649
|
+
function Ls(e) {
|
|
4583
4650
|
let t = O(6), { onClick: n, className: r } = e, i;
|
|
4584
4651
|
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);
|
|
4585
4652
|
let a;
|
|
@@ -4593,13 +4660,13 @@ function Ms(e) {
|
|
|
4593
4660
|
children: a
|
|
4594
4661
|
}), t[3] = n, t[4] = i, t[5] = o) : o = t[5], o;
|
|
4595
4662
|
}
|
|
4596
|
-
var
|
|
4597
|
-
Root:
|
|
4598
|
-
Item:
|
|
4599
|
-
Icon:
|
|
4600
|
-
Text:
|
|
4601
|
-
Remove:
|
|
4602
|
-
},
|
|
4663
|
+
var Rs = {
|
|
4664
|
+
Root: Ns,
|
|
4665
|
+
Item: Ps,
|
|
4666
|
+
Icon: Fs,
|
|
4667
|
+
Text: Is,
|
|
4668
|
+
Remove: Ls
|
|
4669
|
+
}, zs = {
|
|
4603
4670
|
normal: {
|
|
4604
4671
|
d: "m5 12 7-7 7 7",
|
|
4605
4672
|
translateY: 0
|
|
@@ -4613,7 +4680,7 @@ var Ns = {
|
|
|
4613
4680
|
],
|
|
4614
4681
|
transition: { duration: .4 }
|
|
4615
4682
|
}
|
|
4616
|
-
},
|
|
4683
|
+
}, Bs = {
|
|
4617
4684
|
normal: { d: "M12 19V5" },
|
|
4618
4685
|
animate: {
|
|
4619
4686
|
d: [
|
|
@@ -4623,7 +4690,7 @@ var Ns = {
|
|
|
4623
4690
|
],
|
|
4624
4691
|
transition: { duration: .4 }
|
|
4625
4692
|
}
|
|
4626
|
-
},
|
|
4693
|
+
}, Vs = (e) => {
|
|
4627
4694
|
let t = O(30), n, r, i, a, o, s;
|
|
4628
4695
|
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);
|
|
4629
4696
|
let c = s === void 0 ? 20 : s, l = ne(), u = h(!1), d;
|
|
@@ -4645,11 +4712,11 @@ var Ns = {
|
|
|
4645
4712
|
t[17] === l ? (y = t[18], b = t[19]) : (y = /* @__PURE__ */ M(A.path, {
|
|
4646
4713
|
animate: l,
|
|
4647
4714
|
d: "m5 12 7-7 7 7",
|
|
4648
|
-
variants:
|
|
4715
|
+
variants: zs
|
|
4649
4716
|
}), b = /* @__PURE__ */ M(A.path, {
|
|
4650
4717
|
animate: l,
|
|
4651
4718
|
d: "M12 19V5",
|
|
4652
|
-
variants:
|
|
4719
|
+
variants: Bs
|
|
4653
4720
|
}), t[17] = l, t[18] = y, t[19] = b);
|
|
4654
4721
|
let x;
|
|
4655
4722
|
t[20] !== c || t[21] !== y || t[22] !== b ? (x = /* @__PURE__ */ N("svg", {
|
|
@@ -4673,10 +4740,10 @@ var Ns = {
|
|
|
4673
4740
|
children: x
|
|
4674
4741
|
}), t[24] = m, t[25] = _, t[26] = a, t[27] = v, t[28] = x, t[29] = S) : S = t[29], S;
|
|
4675
4742
|
};
|
|
4676
|
-
|
|
4743
|
+
Vs.displayName = "ArrowUpIcon";
|
|
4677
4744
|
//#endregion
|
|
4678
4745
|
//#region src/lib/components/SubmitButton.tsx
|
|
4679
|
-
var
|
|
4746
|
+
var Hs = {
|
|
4680
4747
|
duration: .15,
|
|
4681
4748
|
ease: [
|
|
4682
4749
|
0,
|
|
@@ -4684,7 +4751,7 @@ var Ls = {
|
|
|
4684
4751
|
.2,
|
|
4685
4752
|
1
|
|
4686
4753
|
]
|
|
4687
|
-
},
|
|
4754
|
+
}, Us = {
|
|
4688
4755
|
duration: .12,
|
|
4689
4756
|
ease: [
|
|
4690
4757
|
0,
|
|
@@ -4693,7 +4760,7 @@ var Ls = {
|
|
|
4693
4760
|
1
|
|
4694
4761
|
]
|
|
4695
4762
|
};
|
|
4696
|
-
function
|
|
4763
|
+
function Ws(e) {
|
|
4697
4764
|
let t = O(40), n, r, i, a;
|
|
4698
4765
|
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);
|
|
4699
4766
|
let o = re(), s = a === "stop", c;
|
|
@@ -4733,7 +4800,7 @@ function zs(e) {
|
|
|
4733
4800
|
scale: .7
|
|
4734
4801
|
}, t[21] = o, t[22] = v);
|
|
4735
4802
|
let y;
|
|
4736
|
-
t[23] === s ? y = t[24] : (y = M(s ?
|
|
4803
|
+
t[23] === s ? y = t[24] : (y = M(s ? qs : Ks, {}), t[23] = s, t[24] = y);
|
|
4737
4804
|
let b;
|
|
4738
4805
|
t[25] !== v || t[26] !== y || t[27] !== h || t[28] !== g ? (b = /* @__PURE__ */ M(te, {
|
|
4739
4806
|
initial: !1,
|
|
@@ -4741,7 +4808,7 @@ function zs(e) {
|
|
|
4741
4808
|
initial: g,
|
|
4742
4809
|
animate: _,
|
|
4743
4810
|
exit: v,
|
|
4744
|
-
transition:
|
|
4811
|
+
transition: Us,
|
|
4745
4812
|
className: "absolute flex items-center justify-center",
|
|
4746
4813
|
children: y
|
|
4747
4814
|
}, h)
|
|
@@ -4751,7 +4818,7 @@ function zs(e) {
|
|
|
4751
4818
|
initial: c,
|
|
4752
4819
|
animate: l,
|
|
4753
4820
|
exit: u,
|
|
4754
|
-
transition:
|
|
4821
|
+
transition: Hs,
|
|
4755
4822
|
whileHover: d,
|
|
4756
4823
|
whileTap: f,
|
|
4757
4824
|
"aria-label": p,
|
|
@@ -4761,7 +4828,7 @@ function zs(e) {
|
|
|
4761
4828
|
children: b
|
|
4762
4829
|
}), 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;
|
|
4763
4830
|
}
|
|
4764
|
-
function
|
|
4831
|
+
function Gs(e) {
|
|
4765
4832
|
let t = O(2), { children: n } = e, r;
|
|
4766
4833
|
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M("svg", {
|
|
4767
4834
|
width: "20",
|
|
@@ -4772,13 +4839,13 @@ function Bs(e) {
|
|
|
4772
4839
|
children: n
|
|
4773
4840
|
}), t[0] = n, t[1] = r), r;
|
|
4774
4841
|
}
|
|
4775
|
-
function
|
|
4842
|
+
function Ks() {
|
|
4776
4843
|
let e = O(1), t;
|
|
4777
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
4844
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(Vs, {}), e[0] = t) : t = e[0], t;
|
|
4778
4845
|
}
|
|
4779
|
-
function
|
|
4846
|
+
function qs() {
|
|
4780
4847
|
let e = O(1), t;
|
|
4781
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
4848
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(Gs, { children: /* @__PURE__ */ M("rect", {
|
|
4782
4849
|
x: "5",
|
|
4783
4850
|
y: "5",
|
|
4784
4851
|
width: "10",
|
|
@@ -4788,9 +4855,9 @@ function Hs() {
|
|
|
4788
4855
|
}
|
|
4789
4856
|
//#endregion
|
|
4790
4857
|
//#region src/lib/components/tool-error.tsx
|
|
4791
|
-
function
|
|
4792
|
-
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 =
|
|
4793
|
-
t[0] === o.issues ? u = t[1] : (u = o.issues.map(
|
|
4858
|
+
function Js(e) {
|
|
4859
|
+
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;
|
|
4860
|
+
t[0] === o.issues ? u = t[1] : (u = o.issues.map(Ys).join("\n"), t[0] = o.issues, t[1] = u);
|
|
4794
4861
|
let d = u, f;
|
|
4795
4862
|
t[2] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(Fe, { className: "size-5" }), t[2] = f) : f = t[2];
|
|
4796
4863
|
let p;
|
|
@@ -4858,71 +4925,71 @@ function Us(e) {
|
|
|
4858
4925
|
]
|
|
4859
4926
|
}), t[21] = v, t[22] = S, t[23] = p, t[24] = C) : C = t[24], C;
|
|
4860
4927
|
}
|
|
4861
|
-
function
|
|
4928
|
+
function Ys(e) {
|
|
4862
4929
|
return `${e.path.join(".")}: ${e.message}`;
|
|
4863
4930
|
}
|
|
4864
4931
|
//#endregion
|
|
4865
4932
|
//#region src/lib/components/Tip/TipProvider.tsx
|
|
4866
|
-
var
|
|
4867
|
-
function
|
|
4868
|
-
return l(
|
|
4933
|
+
var Xs = o("");
|
|
4934
|
+
function Zs() {
|
|
4935
|
+
return l(Xs);
|
|
4869
4936
|
}
|
|
4870
|
-
var
|
|
4871
|
-
function
|
|
4937
|
+
var Qs = "tips:history", $s = "tips:session";
|
|
4938
|
+
function ec() {
|
|
4872
4939
|
try {
|
|
4873
|
-
return JSON.parse(localStorage.getItem(
|
|
4940
|
+
return JSON.parse(localStorage.getItem(Qs) ?? "{}");
|
|
4874
4941
|
} catch (e) {
|
|
4875
|
-
if (
|
|
4942
|
+
if (rc(e)) return {};
|
|
4876
4943
|
throw e;
|
|
4877
4944
|
}
|
|
4878
4945
|
}
|
|
4879
|
-
function
|
|
4946
|
+
function tc(e, t) {
|
|
4880
4947
|
try {
|
|
4881
|
-
let n =
|
|
4882
|
-
n[e] = t, localStorage.setItem(
|
|
4948
|
+
let n = ec();
|
|
4949
|
+
n[e] = t, localStorage.setItem(Qs, JSON.stringify(n));
|
|
4883
4950
|
} catch (e) {
|
|
4884
|
-
if (!
|
|
4951
|
+
if (!rc(e)) throw e;
|
|
4885
4952
|
}
|
|
4886
4953
|
}
|
|
4887
|
-
function
|
|
4954
|
+
function nc(e) {
|
|
4888
4955
|
try {
|
|
4889
|
-
let t = localStorage.getItem(
|
|
4956
|
+
let t = localStorage.getItem($s), n = t ? JSON.parse(t) : {
|
|
4890
4957
|
id: "",
|
|
4891
4958
|
n: 0
|
|
4892
4959
|
};
|
|
4893
|
-
return n.id !== e && (n.id = e, n.n += 1, localStorage.setItem(
|
|
4960
|
+
return n.id !== e && (n.id = e, n.n += 1, localStorage.setItem($s, JSON.stringify(n))), n.n;
|
|
4894
4961
|
} catch (e) {
|
|
4895
|
-
if (
|
|
4962
|
+
if (rc(e)) return 0;
|
|
4896
4963
|
throw e;
|
|
4897
4964
|
}
|
|
4898
4965
|
}
|
|
4899
|
-
function
|
|
4966
|
+
function rc(e) {
|
|
4900
4967
|
return e instanceof SyntaxError || e instanceof DOMException && (e.name === "QuotaExceededError" || e.name === "SecurityError");
|
|
4901
4968
|
}
|
|
4902
|
-
function
|
|
4969
|
+
function ic(e, t, n) {
|
|
4903
4970
|
let r = n[e];
|
|
4904
4971
|
return r == null ? Infinity : t - r;
|
|
4905
4972
|
}
|
|
4906
|
-
async function
|
|
4907
|
-
let r =
|
|
4973
|
+
async function ac(e, t, n) {
|
|
4974
|
+
let r = ec(), i = await Promise.all(e.map((e) => e.isRelevant(t))), a = e.filter((e, t) => i[t]);
|
|
4908
4975
|
if (a.length === 0) return null;
|
|
4909
|
-
let o = a.filter((e) =>
|
|
4910
|
-
s.sort((e, t) =>
|
|
4976
|
+
let o = a.filter((e) => ic(e.id, n, r) >= e.cooldownSessions), s = o.length > 0 ? o : a;
|
|
4977
|
+
s.sort((e, t) => ic(t.id, n, r) - ic(e.id, n, r));
|
|
4911
4978
|
let c = s[0], l = await c.content(t);
|
|
4912
4979
|
return {
|
|
4913
4980
|
id: c.id,
|
|
4914
4981
|
text: l
|
|
4915
4982
|
};
|
|
4916
4983
|
}
|
|
4917
|
-
function
|
|
4984
|
+
function oc(e) {
|
|
4918
4985
|
let t = O(13), { tips: n, streaming: r, chatId: i, context: a, children: o } = e, s;
|
|
4919
|
-
t[0] === i ? s = t[1] : (s = () =>
|
|
4986
|
+
t[0] === i ? s = t[1] : (s = () => nc(i), t[0] = i, t[1] = s);
|
|
4920
4987
|
let [c] = g(s), [l, u] = g(""), [p, m] = g(r), [_, v] = g(0);
|
|
4921
|
-
r !== p && (m(r), r && v(
|
|
4988
|
+
r !== p && (m(r), r && v(sc));
|
|
4922
4989
|
let y = h(!1), b;
|
|
4923
4990
|
t[2] !== a || t[3] !== c || t[4] !== n ? (b = () => {
|
|
4924
|
-
y.current || (y.current = !0,
|
|
4925
|
-
e && (u(e.text),
|
|
4991
|
+
y.current || (y.current = !0, ac(n, a, c).then((e) => {
|
|
4992
|
+
e && (u(e.text), tc(e.id, c));
|
|
4926
4993
|
}).finally(() => {
|
|
4927
4994
|
y.current = !1;
|
|
4928
4995
|
}));
|
|
@@ -4934,17 +5001,17 @@ function tc(e) {
|
|
|
4934
5001
|
let C;
|
|
4935
5002
|
t[8] === _ ? C = t[9] : (C = [_], t[8] = _, t[9] = C), d(S, C);
|
|
4936
5003
|
let w;
|
|
4937
|
-
return t[10] !== o || t[11] !== l ? (w = /* @__PURE__ */ M(
|
|
5004
|
+
return t[10] !== o || t[11] !== l ? (w = /* @__PURE__ */ M(Xs, {
|
|
4938
5005
|
value: l,
|
|
4939
5006
|
children: o
|
|
4940
5007
|
}), t[10] = o, t[11] = l, t[12] = w) : w = t[12], w;
|
|
4941
5008
|
}
|
|
4942
|
-
function
|
|
5009
|
+
function sc(e) {
|
|
4943
5010
|
return e + 1;
|
|
4944
5011
|
}
|
|
4945
|
-
function
|
|
4946
|
-
let t = O(6), { tips: n, context: r, children: i } = e, { chatId: a } = z(), { status: o } =
|
|
4947
|
-
return t[0] !== i || t[1] !== r || t[2] !== s || t[3] !== c || t[4] !== n ? (l = /* @__PURE__ */ M(
|
|
5012
|
+
function cc(e) {
|
|
5013
|
+
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;
|
|
5014
|
+
return t[0] !== i || t[1] !== r || t[2] !== s || t[3] !== c || t[4] !== n ? (l = /* @__PURE__ */ M(oc, {
|
|
4948
5015
|
tips: n,
|
|
4949
5016
|
streaming: s,
|
|
4950
5017
|
chatId: c,
|
|
@@ -4954,14 +5021,14 @@ function rc(e) {
|
|
|
4954
5021
|
}
|
|
4955
5022
|
//#endregion
|
|
4956
5023
|
//#region src/lib/components/Tip/TipLine.tsx
|
|
4957
|
-
var
|
|
4958
|
-
function
|
|
4959
|
-
let t = O(13), { className: n } = e, r = St(), i =
|
|
5024
|
+
var lc = 1.5;
|
|
5025
|
+
function uc(e) {
|
|
5026
|
+
let t = O(13), { className: n } = e, r = St(), i = Zs(), [a, o] = g(i), [s, c] = g(!1);
|
|
4960
5027
|
i !== a && (o(i), i && c(!0));
|
|
4961
5028
|
let l, u;
|
|
4962
5029
|
t[0] !== r || t[1] !== s ? (l = () => {
|
|
4963
5030
|
if (!s) return;
|
|
4964
|
-
let e = r.setTimeout(() => c(!1),
|
|
5031
|
+
let e = r.setTimeout(() => c(!1), lc * 1e3);
|
|
4965
5032
|
return () => r.clearTimeout(e);
|
|
4966
5033
|
}, u = [r, s], t[0] = r, t[1] = s, t[2] = l, t[3] = u) : (l = t[2], u = t[3]), d(l, u);
|
|
4967
5034
|
let f;
|
|
@@ -4969,10 +5036,10 @@ function ac(e) {
|
|
|
4969
5036
|
let p;
|
|
4970
5037
|
t[6] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ M(Je, { className: "size-3 shrink-0" }), t[6] = p) : p = t[6];
|
|
4971
5038
|
let m;
|
|
4972
|
-
t[7] !== s || t[8] !== i ? (m = /* @__PURE__ */ N(
|
|
5039
|
+
t[7] !== s || t[8] !== i ? (m = /* @__PURE__ */ N(W, {
|
|
4973
5040
|
as: "span",
|
|
4974
5041
|
enabled: s,
|
|
4975
|
-
duration:
|
|
5042
|
+
duration: lc,
|
|
4976
5043
|
children: ["Tip: ", i]
|
|
4977
5044
|
}), t[7] = s, t[8] = i, t[9] = m) : m = t[9];
|
|
4978
5045
|
let h;
|
|
@@ -4983,7 +5050,7 @@ function ac(e) {
|
|
|
4983
5050
|
}
|
|
4984
5051
|
//#endregion
|
|
4985
5052
|
//#region src/lib/hooks/use-async-generator.ts
|
|
4986
|
-
function
|
|
5053
|
+
function dc() {
|
|
4987
5054
|
let [e, t] = g({
|
|
4988
5055
|
loading: !1,
|
|
4989
5056
|
error: null
|
|
@@ -5013,7 +5080,7 @@ function oc() {
|
|
|
5013
5080
|
}
|
|
5014
5081
|
//#endregion
|
|
5015
5082
|
//#region src/lib/hooks/use-auto-resize-textarea.ts
|
|
5016
|
-
function
|
|
5083
|
+
function fc(e) {
|
|
5017
5084
|
let t = O(16), { minHeight: n, maxHeight: r, value: i } = e, a = h(null), o;
|
|
5018
5085
|
t[0] !== r || t[1] !== n ? (o = (e) => {
|
|
5019
5086
|
let t = a.current;
|
|
@@ -5050,22 +5117,22 @@ function sc(e) {
|
|
|
5050
5117
|
}
|
|
5051
5118
|
//#endregion
|
|
5052
5119
|
//#region src/lib/hooks/use-keyboard.ts
|
|
5053
|
-
function
|
|
5120
|
+
function pc(e) {
|
|
5054
5121
|
let t = [];
|
|
5055
5122
|
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("+");
|
|
5056
5123
|
}
|
|
5057
|
-
function
|
|
5124
|
+
function mc(e) {
|
|
5058
5125
|
let t = O(4), { enabled: n, handlers: r } = e, i = n === void 0 || n, a, o;
|
|
5059
5126
|
t[0] !== i || t[1] !== r ? (a = () => {
|
|
5060
5127
|
if (!i) return;
|
|
5061
5128
|
let e = (e) => {
|
|
5062
|
-
let t =
|
|
5129
|
+
let t = pc(e), n = r[t];
|
|
5063
5130
|
n ||= r[e.key], n && (e.preventDefault(), e.stopPropagation(), n(e));
|
|
5064
5131
|
};
|
|
5065
5132
|
return document.addEventListener("keydown", e, !0), () => document.removeEventListener("keydown", e, !0);
|
|
5066
5133
|
}, o = [i, r], t[0] = i, t[1] = r, t[2] = a, t[3] = o) : (a = t[2], o = t[3]), d(a, o);
|
|
5067
5134
|
}
|
|
5068
5135
|
//#endregion
|
|
5069
|
-
export { Gt as AgentHeader, Zt as AgentProvider, Bt as AgentScrollArea,
|
|
5136
|
+
export { Gt as AgentHeader, Zt as AgentProvider, Bt as AgentScrollArea, gi as AssistantSnapshot, ti as COPY_EXCLUSION_ATTRIBUTE, ni as COPY_EXCLUSION_MODES, Q as ChatActionButton, zt as ChatBot, js as ChatComposer, Ft as ChatManager, Ms as ChatTextarea, Zn as CitationPill, Ur as CodeBlock, Wr as CodeBlockCopyButton, es as CompactMessages, Qo as CompactTrajectory, _a as CopyAction, ya as CopyDebugJsonAction, Jn as IndexProgress, Ei as InteractiveResponse, Xn as MessageItemContext, Za as MessageMetadata, Rs as MessageQueue, ds as Messages, ga as MessagesActions, Yn as MessagesContext, xa as MessagesError, wa as MessagesItem, Ca as MessagesList, Sa as MessagesRoot, uo as MessagesUserBubble, ma as NestedTrajectory, Da as PendingToolInput, nn as ReadOnlyChatTransport, va as RegenerateAction, Y as Response, Z as Segment, li as SnapshotRenderPortal, Ws as SubmitButton, W as TextShimmer, vs as TimelinedMessages, uc as TipLine, oc as TipProvider, Xs as TipValueContext, cc as Tips, Wi as ToolArg, Js as ToolError, lo as UserMessageContent, Wa as ZukhrufChatTransport, tn as citationIndexOf, Nt as clearPrefill, oe as defineElements, hi as extractAssistantRawText, en as extractSourcesFromMessage, Va as formatUsageBreakdown, Ba as formatUsageValue, pn as getIndexProgressEvents, la as getSegmentKey, ii as hasCopyExclusion, bi as isActiveClientInputTool, qi as isCommentaryTextPart, _i as isSubagentPart, an as isToolAborted, rn as isToolStateAborted, Fa as parseMetadataUsage, Pa as parseUsage, Pt as persistedPromptOf, jt as readPrefill, oi as resolveCopyToClipboardStrategy, yi as resolveToolEntry, sn as serializeToolsRegistry, ai as shouldIncludeInCopyImage, vi as subagentDisplayName, U as urlCitationsOf, Ta as useActivePendingToolInput, z as useAgent, Lt as useAgentChatSetup, H as useAgentMessages, V as useAgentMeta, B as useAgentStatus, dc as useAsyncGenerator, fc as useAutoResizeTextarea, Qt as useChatManager, Ho as useCompactGroup, di as useCopyElementAsImage, X as useIsAssistantSnapshotRender, on as useIsToolAborted, mc as useKeyboard, q as useMessageItem, G as useMessagesContext, K as useMessagesStatus, za as useNormalizedUsageTracking, Zs as useTipValue, ta as useToolSegment, Bo as useTrajectoryItems, ci as waitForNextPaint, Mt as writePrefill };
|
|
5070
5137
|
|
|
5071
5138
|
//# sourceMappingURL=index.js.map
|