@deepagents/react-genai 7.45.5 → 7.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +599 -529
- package/dist/index.js.map +1 -1
- package/dist/lib/chat/citation-order.d.ts +12 -0
- package/dist/lib/chat/citation-order.d.ts.map +1 -0
- package/dist/lib/chat/citations.d.ts +4 -3
- package/dist/lib/chat/citations.d.ts.map +1 -1
- package/dist/lib/chat/message-parts.d.ts.map +1 -1
- package/dist/lib/chat/trajectory/segments/index.d.ts.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 +4 -0
- 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
|
@@ -370,22 +370,31 @@ function Qt() {
|
|
|
370
370
|
return e;
|
|
371
371
|
}
|
|
372
372
|
//#endregion
|
|
373
|
+
//#region src/lib/chat/citation-order.ts
|
|
374
|
+
function $t(e, t) {
|
|
375
|
+
return t.map((t, n) => ({
|
|
376
|
+
citation: t,
|
|
377
|
+
order: n,
|
|
378
|
+
at: t.endIndex ?? e.length
|
|
379
|
+
})).sort((e, t) => e.at - t.at || e.order - t.order);
|
|
380
|
+
}
|
|
381
|
+
//#endregion
|
|
373
382
|
//#region src/lib/chat/citations.ts
|
|
374
|
-
function
|
|
383
|
+
function U(e) {
|
|
375
384
|
return (e ?? []).filter((e) => e.source.sourceType === "url");
|
|
376
385
|
}
|
|
377
386
|
function en(e) {
|
|
378
|
-
let t =
|
|
379
|
-
|
|
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
|
+
n.has(e) || n.set(e, {
|
|
380
389
|
url: e,
|
|
381
|
-
title:
|
|
382
|
-
})
|
|
390
|
+
title: t
|
|
391
|
+
});
|
|
383
392
|
};
|
|
384
|
-
for (let
|
|
385
|
-
if (
|
|
386
|
-
|
|
393
|
+
for (let n of e.parts) {
|
|
394
|
+
if (n.type === "text") for (let { citation: e } of $t(n.text, U(n.citations))) r(e.source.url, e.source.title);
|
|
395
|
+
n.type === "source-url" && !t.has(n.url) && r(n.url, n.title);
|
|
387
396
|
}
|
|
388
|
-
return n;
|
|
397
|
+
return [...n.values()];
|
|
389
398
|
}
|
|
390
399
|
function tn(e, t) {
|
|
391
400
|
let n = e.findIndex((e) => e.url === t);
|
|
@@ -426,17 +435,18 @@ function sn(e) {
|
|
|
426
435
|
}
|
|
427
436
|
//#endregion
|
|
428
437
|
//#region src/lib/components/text-shimmer.tsx
|
|
429
|
-
function
|
|
430
|
-
let t = O(
|
|
431
|
-
t[0] !== i || t[1] !==
|
|
432
|
-
let d;
|
|
433
|
-
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];
|
|
434
441
|
let f;
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
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,
|
|
438
448
|
children: n
|
|
439
|
-
}), 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;
|
|
440
450
|
}
|
|
441
451
|
//#endregion
|
|
442
452
|
//#region src/lib/chat/trajectory/compact-disclosure.tsx
|
|
@@ -678,7 +688,7 @@ function On(e) {
|
|
|
678
688
|
}, t), t[3] = i, t[4] = e), a = n.map(e), t[0] = i, t[1] = n, t[2] = a;
|
|
679
689
|
} else a = t[2];
|
|
680
690
|
let o;
|
|
681
|
-
return t[5] !== r || t[6] !== a ? (o = /* @__PURE__ */ M(
|
|
691
|
+
return t[5] !== r || t[6] !== a ? (o = /* @__PURE__ */ M(W, {
|
|
682
692
|
as: "span",
|
|
683
693
|
enabled: r,
|
|
684
694
|
className: "text-muted-foreground min-w-0 flex-1 truncate text-xs",
|
|
@@ -998,16 +1008,16 @@ var Jn = {
|
|
|
998
1008
|
EventLog: Pn,
|
|
999
1009
|
PerAdapter: Un
|
|
1000
1010
|
}, Yn = o(void 0), Xn = o(void 0);
|
|
1001
|
-
function
|
|
1011
|
+
function G() {
|
|
1002
1012
|
let e = l(Yn);
|
|
1003
1013
|
if (!e) throw Error("useMessagesContext must be used within <Messages>");
|
|
1004
1014
|
return e;
|
|
1005
1015
|
}
|
|
1006
|
-
function
|
|
1016
|
+
function K() {
|
|
1007
1017
|
let e = l(Yn), { status: t } = B();
|
|
1008
1018
|
return e?.status ?? t;
|
|
1009
1019
|
}
|
|
1010
|
-
function
|
|
1020
|
+
function q() {
|
|
1011
1021
|
let e = l(Xn);
|
|
1012
1022
|
if (!e) throw Error("useMessageItem must be used within <Messages.Item>");
|
|
1013
1023
|
return e;
|
|
@@ -1141,7 +1151,7 @@ function ir(e) {
|
|
|
1141
1151
|
...r
|
|
1142
1152
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1143
1153
|
}
|
|
1144
|
-
var
|
|
1154
|
+
var J = Object.assign(Qn, {
|
|
1145
1155
|
Header: $n,
|
|
1146
1156
|
Heading: er,
|
|
1147
1157
|
Title: tr,
|
|
@@ -1378,12 +1388,12 @@ function Rr(e) {
|
|
|
1378
1388
|
let h;
|
|
1379
1389
|
n[4] === i ? h = n[5] : (h = k("my-4", i), n[4] = i, n[5] = h);
|
|
1380
1390
|
let g;
|
|
1381
|
-
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, {
|
|
1382
1392
|
className: k(!p && "justify-end"),
|
|
1383
|
-
children: [p && /* @__PURE__ */ N(
|
|
1393
|
+
children: [p && /* @__PURE__ */ N(J.Heading, { children: [a && /* @__PURE__ */ M(J.Title, { children: a }), o && /* @__PURE__ */ M(J.Description, {
|
|
1384
1394
|
className: k(a && "mt-1"),
|
|
1385
1395
|
children: o
|
|
1386
|
-
})] }), m && /* @__PURE__ */ N(
|
|
1396
|
+
})] }), m && /* @__PURE__ */ N(J.Actions, {
|
|
1387
1397
|
"data-copy-exclude": "assistant-snapshot",
|
|
1388
1398
|
children: [
|
|
1389
1399
|
u && /* @__PURE__ */ M(pt, { className: Sr }),
|
|
@@ -1395,12 +1405,12 @@ function Rr(e) {
|
|
|
1395
1405
|
let _;
|
|
1396
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];
|
|
1397
1407
|
let v;
|
|
1398
|
-
n[15] === r ? v = n[16] : (v = /* @__PURE__ */ M(
|
|
1408
|
+
n[15] === r ? v = n[16] : (v = /* @__PURE__ */ M(J.Content, {
|
|
1399
1409
|
className: _,
|
|
1400
1410
|
children: r
|
|
1401
1411
|
}), n[15] = r, n[16] = v);
|
|
1402
1412
|
let y;
|
|
1403
|
-
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, {
|
|
1404
1414
|
"data-streamdown": "table-wrapper",
|
|
1405
1415
|
className: h,
|
|
1406
1416
|
children: [g, v]
|
|
@@ -1497,7 +1507,7 @@ var Br = class extends t.Component {
|
|
|
1497
1507
|
children: ["Failed to render content: ", this.state.error?.message]
|
|
1498
1508
|
}) : this.props.children;
|
|
1499
1509
|
}
|
|
1500
|
-
},
|
|
1510
|
+
}, Y = c((e) => {
|
|
1501
1511
|
let t = O(8), n, r;
|
|
1502
1512
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1503
1513
|
let i;
|
|
@@ -1509,7 +1519,7 @@ var Br = class extends t.Component {
|
|
|
1509
1519
|
...r
|
|
1510
1520
|
}) }), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1511
1521
|
});
|
|
1512
|
-
|
|
1522
|
+
Y.displayName = "Response";
|
|
1513
1523
|
//#endregion
|
|
1514
1524
|
//#region src/lib/ui/use-copy-feedback.ts
|
|
1515
1525
|
function Vr(e) {
|
|
@@ -1729,7 +1739,7 @@ function $r(e) {
|
|
|
1729
1739
|
let s;
|
|
1730
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);
|
|
1731
1741
|
let c;
|
|
1732
|
-
t[9] === s ? c = t[10] : (c = /* @__PURE__ */ M(
|
|
1742
|
+
t[9] === s ? c = t[10] : (c = /* @__PURE__ */ M(Y, {
|
|
1733
1743
|
className: "break-all",
|
|
1734
1744
|
children: s
|
|
1735
1745
|
}), t[9] = s, t[10] = c);
|
|
@@ -1757,7 +1767,7 @@ function ei(e) {
|
|
|
1757
1767
|
let o;
|
|
1758
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);
|
|
1759
1769
|
let s;
|
|
1760
|
-
t[7] === o ? s = t[8] : (s = /* @__PURE__ */ M(
|
|
1770
|
+
t[7] === o ? s = t[8] : (s = /* @__PURE__ */ M(Y, {
|
|
1761
1771
|
className: "break-all",
|
|
1762
1772
|
children: o
|
|
1763
1773
|
}), t[7] = o, t[8] = s);
|
|
@@ -1915,9 +1925,10 @@ function di({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1915
1925
|
//#endregion
|
|
1916
1926
|
//#region src/lib/copy/assistant-snapshot.tsx
|
|
1917
1927
|
function fi(e) {
|
|
1918
|
-
|
|
1928
|
+
let t = en(e), n = e.parts.filter(C).map((e) => $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");
|
|
1929
|
+
return t.length === 0 ? n : `${n}\n\n${t.map(({ url: e, title: t }, n) => `[${n + 1}] ${t ? `${t} — ` : ""}${e}`).join("\n")}`;
|
|
1919
1930
|
}
|
|
1920
|
-
function
|
|
1931
|
+
function X() {
|
|
1921
1932
|
return l(si);
|
|
1922
1933
|
}
|
|
1923
1934
|
function pi(e) {
|
|
@@ -2035,7 +2046,7 @@ function Ci(e) {
|
|
|
2035
2046
|
let a;
|
|
2036
2047
|
t[5] === i ? a = t[6] : (a = Si(i), t[5] = i, t[6] = a);
|
|
2037
2048
|
let o = a, s;
|
|
2038
|
-
return t[7] !== r || t[8] !== o ? (s = /* @__PURE__ */ M(
|
|
2049
|
+
return t[7] !== r || t[8] !== o ? (s = /* @__PURE__ */ M(Y, {
|
|
2039
2050
|
...o,
|
|
2040
2051
|
...r
|
|
2041
2052
|
}), t[7] = r, t[8] = o, t[9] = s) : s = t[9], s;
|
|
@@ -2202,10 +2213,7 @@ function ki(e) {
|
|
|
2202
2213
|
}
|
|
2203
2214
|
var Ai = "genai-citation";
|
|
2204
2215
|
function ji(e, t) {
|
|
2205
|
-
return t.
|
|
2206
|
-
at: t.endIndex ?? e.length,
|
|
2207
|
-
order: n
|
|
2208
|
-
})).sort((e, t) => t.at - e.at || t.order - e.order).reduce((e, { at: t, order: n }) => `${e.slice(0, t)}<${Ai} citation="${n}" />${e.slice(t)}`, e);
|
|
2216
|
+
return $t(e, t).reverse().reduce((e, { at: t, order: n }) => `${e.slice(0, t)}<${Ai} citation="${n}" />${e.slice(t)}`, e);
|
|
2209
2217
|
}
|
|
2210
2218
|
var Mi = o(null);
|
|
2211
2219
|
function Ni(e) {
|
|
@@ -2245,16 +2253,16 @@ var Pi = {
|
|
|
2245
2253
|
component: Ni
|
|
2246
2254
|
};
|
|
2247
2255
|
function Fi(e) {
|
|
2248
|
-
let t = O(27), { text: n, citations: r, elements: i, className: a } = e, { status: o } = B(), s =
|
|
2249
|
-
t[0] === r ? u = t[1] : (u =
|
|
2256
|
+
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;
|
|
2257
|
+
t[0] === r ? u = t[1] : (u = U(r), t[0] = r, t[1] = u);
|
|
2250
2258
|
let d = u, f;
|
|
2251
|
-
t[2] ===
|
|
2259
|
+
t[2] === l ? f = t[3] : (f = en(l), t[2] = l, t[3] = f);
|
|
2252
2260
|
let p;
|
|
2253
|
-
t[4] !==
|
|
2261
|
+
t[4] !== c || t[5] !== f || t[6] !== d ? (p = {
|
|
2254
2262
|
citations: d,
|
|
2255
2263
|
sources: f,
|
|
2256
|
-
HostCitation:
|
|
2257
|
-
}, t[4] =
|
|
2264
|
+
HostCitation: c
|
|
2265
|
+
}, t[4] = c, t[5] = f, t[6] = d, t[7] = p) : p = t[7];
|
|
2258
2266
|
let m = p, h = d.length > 0, g;
|
|
2259
2267
|
t[8] !== i || t[9] !== h ? (g = h ? [...i ?? [], Pi] : i, t[8] = i, t[9] = h, t[10] = g) : g = t[10];
|
|
2260
2268
|
let _ = g, v;
|
|
@@ -2288,7 +2296,7 @@ function Ii(e) {
|
|
|
2288
2296
|
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;
|
|
2289
2297
|
}
|
|
2290
2298
|
function Li() {
|
|
2291
|
-
let { debugMode: e } = z(), t =
|
|
2299
|
+
let { debugMode: e } = z(), t = X();
|
|
2292
2300
|
return !!e && !t;
|
|
2293
2301
|
}
|
|
2294
2302
|
//#endregion
|
|
@@ -2297,11 +2305,11 @@ function Ri(e) {
|
|
|
2297
2305
|
return !!e && e !== "output-available";
|
|
2298
2306
|
}
|
|
2299
2307
|
function zi(e) {
|
|
2300
|
-
let t = O(5), { label: n, part: r, state: i } = e, a =
|
|
2308
|
+
let t = O(5), { label: n, part: r, state: i } = e, a = X(), o;
|
|
2301
2309
|
return t[0] !== a || t[1] !== n || t[2] !== r || t[3] !== i ? (o = !a && !!n.actions && !!r && !Ri(i), t[0] = a, t[1] = n, t[2] = r, t[3] = i, t[4] = o) : o = t[4], o;
|
|
2302
2310
|
}
|
|
2303
2311
|
function Bi(e) {
|
|
2304
|
-
let t = O(
|
|
2312
|
+
let t = O(20), { label: n, part: r } = e, i = n.icon, a = n.actions, o;
|
|
2305
2313
|
t[0] !== n || t[1] !== r ? (o = {
|
|
2306
2314
|
label: n,
|
|
2307
2315
|
part: r,
|
|
@@ -2310,22 +2318,26 @@ function Bi(e) {
|
|
|
2310
2318
|
let s = zi(o), c;
|
|
2311
2319
|
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];
|
|
2312
2320
|
let l;
|
|
2313
|
-
t[6]
|
|
2321
|
+
t[6] !== n.kind || t[7] !== n.name || t[8] !== n.text ? (l = n.kind === "sentence" ? /* @__PURE__ */ M("span", {
|
|
2322
|
+
dir: "auto",
|
|
2323
|
+
className: "text-start",
|
|
2324
|
+
children: n.text
|
|
2325
|
+
}) : /* @__PURE__ */ M("span", {
|
|
2314
2326
|
className: "font-mono",
|
|
2315
2327
|
children: n.name
|
|
2316
|
-
}), t[6] = n.
|
|
2328
|
+
}), t[6] = n.kind, t[7] = n.name, t[8] = n.text, t[9] = l) : l = t[9];
|
|
2317
2329
|
let u;
|
|
2318
|
-
t[
|
|
2330
|
+
t[10] !== c || t[11] !== l ? (u = /* @__PURE__ */ N("div", {
|
|
2319
2331
|
className: "flex items-center gap-1.5",
|
|
2320
2332
|
children: [c, l]
|
|
2321
|
-
}), t[
|
|
2333
|
+
}), t[10] = c, t[11] = l, t[12] = u) : u = t[12];
|
|
2322
2334
|
let d;
|
|
2323
|
-
t[
|
|
2335
|
+
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];
|
|
2324
2336
|
let f;
|
|
2325
|
-
return t[
|
|
2337
|
+
return t[17] !== u || t[18] !== d ? (f = /* @__PURE__ */ N("div", {
|
|
2326
2338
|
className: "text-muted-foreground flex items-center justify-between gap-1.5 text-xs",
|
|
2327
2339
|
children: [u, d]
|
|
2328
|
-
}), t[
|
|
2340
|
+
}), t[17] = u, t[18] = d, t[19] = f) : f = t[19], f;
|
|
2329
2341
|
}
|
|
2330
2342
|
function Vi(e) {
|
|
2331
2343
|
let t = O(3), { name: n, value: r } = e, i;
|
|
@@ -2340,25 +2352,27 @@ function Vi(e) {
|
|
|
2340
2352
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2], i;
|
|
2341
2353
|
}
|
|
2342
2354
|
function Hi(e) {
|
|
2343
|
-
let t = O(
|
|
2355
|
+
let t = O(24), { label: n, state: r, part: i, children: a } = e, o = n.actions, s;
|
|
2344
2356
|
t[0] !== n || t[1] !== i || t[2] !== r ? (s = {
|
|
2345
2357
|
label: n,
|
|
2346
2358
|
part: i,
|
|
2347
2359
|
state: r
|
|
2348
2360
|
}, t[0] = n, t[1] = i, t[2] = r, t[3] = s) : s = t[3];
|
|
2349
|
-
let c = zi(s), l;
|
|
2350
|
-
t[4]
|
|
2351
|
-
|
|
2352
|
-
|
|
2361
|
+
let c = zi(s), l = n.kind === "sentence", u;
|
|
2362
|
+
t[4] !== a || t[5] !== l || t[6] !== n.args || t[7] !== n.name || t[8] !== n.text ? (u = l ? /* @__PURE__ */ M("span", {
|
|
2363
|
+
dir: "auto",
|
|
2364
|
+
className: "text-muted-foreground min-w-0 truncate text-start text-xs",
|
|
2365
|
+
children: n.text
|
|
2366
|
+
}) : /* @__PURE__ */ N("span", {
|
|
2353
2367
|
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-[',']",
|
|
2354
2368
|
children: [
|
|
2355
2369
|
n.name,
|
|
2356
2370
|
"(",
|
|
2357
2371
|
a,
|
|
2358
|
-
|
|
2372
|
+
n.args ? Object.entries(n.args).map(Ui) : "...",
|
|
2359
2373
|
")"
|
|
2360
2374
|
]
|
|
2361
|
-
}), t[
|
|
2375
|
+
}), t[4] = a, t[5] = l, t[6] = n.args, t[7] = n.name, t[8] = n.text, t[9] = u) : u = t[9];
|
|
2362
2376
|
let d;
|
|
2363
2377
|
t[10] !== o || t[11] !== i || t[12] !== c ? (d = c && o && i && /* @__PURE__ */ M("span", {
|
|
2364
2378
|
className: "shrink-0",
|
|
@@ -2370,15 +2384,16 @@ function Hi(e) {
|
|
|
2370
2384
|
children: [u, d]
|
|
2371
2385
|
}), t[14] = u, t[15] = d, t[16] = f) : f = t[16];
|
|
2372
2386
|
let p;
|
|
2373
|
-
t[17] !== n.detail || t[
|
|
2374
|
-
|
|
2387
|
+
t[17] !== l || t[18] !== n.detail || t[19] !== n.isError ? (p = n.detail && /* @__PURE__ */ M("span", {
|
|
2388
|
+
dir: l ? "auto" : void 0,
|
|
2389
|
+
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"),
|
|
2375
2390
|
children: n.detail
|
|
2376
|
-
}), t[17] = n.detail, t[
|
|
2391
|
+
}), t[17] = l, t[18] = n.detail, t[19] = n.isError, t[20] = p) : p = t[20];
|
|
2377
2392
|
let m;
|
|
2378
|
-
return t[
|
|
2393
|
+
return t[21] !== f || t[22] !== p ? (m = /* @__PURE__ */ N("span", {
|
|
2379
2394
|
className: "mb-2 flex flex-col gap-1",
|
|
2380
2395
|
children: [f, p]
|
|
2381
|
-
}), t[
|
|
2396
|
+
}), t[21] = f, t[22] = p, t[23] = m) : m = t[23], m;
|
|
2382
2397
|
}
|
|
2383
2398
|
function Ui(e) {
|
|
2384
2399
|
let [t, n] = e;
|
|
@@ -2420,7 +2435,7 @@ function Ki(e) {
|
|
|
2420
2435
|
}), t[0] = r.filename, t[1] = r.mediaType, t[2] = r.url, t[3] = i) : i = t[3], i;
|
|
2421
2436
|
}
|
|
2422
2437
|
function qi(e) {
|
|
2423
|
-
let t = O(9), { segment: n } = e, {
|
|
2438
|
+
let t = O(9), { segment: n } = e, { message: r } = q(), i;
|
|
2424
2439
|
t[0] === r ? i = t[1] : (i = en(r), t[0] = r, t[1] = i);
|
|
2425
2440
|
let a = i, o;
|
|
2426
2441
|
if (t[2] !== n.parts || t[3] !== a) {
|
|
@@ -2442,14 +2457,14 @@ function qi(e) {
|
|
|
2442
2457
|
return t[7] === o ? s = t[8] : (s = /* @__PURE__ */ M("span", { children: o }), t[7] = o, t[8] = s), s;
|
|
2443
2458
|
}
|
|
2444
2459
|
function Ji(e) {
|
|
2445
|
-
let t = O(3), { segment: n } = e, r =
|
|
2446
|
-
if (
|
|
2460
|
+
let t = O(3), { segment: n } = e, r = K();
|
|
2461
|
+
if (X()) return null;
|
|
2447
2462
|
let { part: i } = n;
|
|
2448
2463
|
if (i.type !== "reasoning") return null;
|
|
2449
2464
|
let a = r === "streaming", o;
|
|
2450
2465
|
return t[0] !== i.text || t[1] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
2451
2466
|
className: "text-muted-foreground text-xs",
|
|
2452
|
-
children: /* @__PURE__ */ M(
|
|
2467
|
+
children: /* @__PURE__ */ M(Y, {
|
|
2453
2468
|
animated: Ei,
|
|
2454
2469
|
isAnimating: a,
|
|
2455
2470
|
children: i.text
|
|
@@ -2471,7 +2486,7 @@ function Qi() {
|
|
|
2471
2486
|
return e;
|
|
2472
2487
|
}
|
|
2473
2488
|
function $i(e) {
|
|
2474
|
-
let t = O(29), { segment: n, children: r } = e, i = z(), a =
|
|
2489
|
+
let t = O(29), { segment: n, children: r } = e, i = z(), a = K(), { part: o } = n;
|
|
2475
2490
|
if (!S(o)) return null;
|
|
2476
2491
|
let s, c, l, u;
|
|
2477
2492
|
t[0] !== i.registry || t[1] !== a || t[2] !== o ? ({toolEntry: u} = gi(o, i.registry), c = _i(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]);
|
|
@@ -2545,7 +2560,7 @@ function ta(e) {
|
|
|
2545
2560
|
children: [o, s]
|
|
2546
2561
|
}), t[6] = a, t[7] = o, t[8] = c) : c = t[8], c;
|
|
2547
2562
|
}
|
|
2548
|
-
var
|
|
2563
|
+
var Z = {
|
|
2549
2564
|
Text: Gi,
|
|
2550
2565
|
File: Ki,
|
|
2551
2566
|
Source: qi,
|
|
@@ -2568,7 +2583,7 @@ function ia(e, t, n) {
|
|
|
2568
2583
|
return !!r && ra(r, n);
|
|
2569
2584
|
}
|
|
2570
2585
|
function aa(e) {
|
|
2571
|
-
let t = [], n = new Set(e.flatMap((e) => e.type === "text" ?
|
|
2586
|
+
let t = [], n = new Set(e.flatMap((e) => e.type === "text" ? U(e.citations).map(({ source: e }) => e.url) : []));
|
|
2572
2587
|
for (let r = 0; r < e.length; r++) {
|
|
2573
2588
|
let i = e[r], a = na(i);
|
|
2574
2589
|
if (a) t.push({
|
|
@@ -2609,13 +2624,13 @@ function aa(e) {
|
|
|
2609
2624
|
}
|
|
2610
2625
|
return t;
|
|
2611
2626
|
}
|
|
2612
|
-
function
|
|
2627
|
+
function oa(e, t) {
|
|
2613
2628
|
return e.kind === "text" || e.kind === "source" ? e.parts[0]?.idx ?? t : e.idx;
|
|
2614
2629
|
}
|
|
2615
2630
|
//#endregion
|
|
2616
2631
|
//#region src/lib/chat/trajectory/nested-trajectory.tsx
|
|
2617
|
-
function
|
|
2618
|
-
let n = `${
|
|
2632
|
+
function sa(e, t) {
|
|
2633
|
+
let n = `${oa(e, t)}:${e.kind}`;
|
|
2619
2634
|
if (e.kind === "text") return `${n}:${e.parts.map(({ part: e }) => e.type === "text" ? e.text : "").join("")}`;
|
|
2620
2635
|
if (e.kind === "reasoning" && e.part.type === "reasoning") return `${n}:${e.part.text}`;
|
|
2621
2636
|
if ((e.kind === "tool" || e.kind === "dynamic-tool") && w(e.part)) {
|
|
@@ -2624,36 +2639,36 @@ function oa(e, t) {
|
|
|
2624
2639
|
}
|
|
2625
2640
|
return e.kind === "file" && e.part.type === "file" ? `${n}:${e.part.url}:${e.part.mediaType}:${e.part.filename ?? ""}` : n;
|
|
2626
2641
|
}
|
|
2627
|
-
function
|
|
2642
|
+
function ca(e, t, n) {
|
|
2628
2643
|
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;
|
|
2629
2644
|
}
|
|
2630
|
-
var
|
|
2645
|
+
var la = c(function(e) {
|
|
2631
2646
|
let t = O(8), { segment: n } = e;
|
|
2632
2647
|
if (n.kind === "tool") {
|
|
2633
2648
|
let e;
|
|
2634
|
-
return t[0] === n ? e = t[1] : (e = /* @__PURE__ */ M(
|
|
2649
|
+
return t[0] === n ? e = t[1] : (e = /* @__PURE__ */ M(Z.Tool, { segment: n }), t[0] = n, t[1] = e), e;
|
|
2635
2650
|
}
|
|
2636
2651
|
if (n.kind === "reasoning") {
|
|
2637
2652
|
let e;
|
|
2638
|
-
return t[2] === n ? e = t[3] : (e = /* @__PURE__ */ M(
|
|
2653
|
+
return t[2] === n ? e = t[3] : (e = /* @__PURE__ */ M(Z.Reasoning, { segment: n }), t[2] = n, t[3] = e), e;
|
|
2639
2654
|
}
|
|
2640
2655
|
if (n.kind === "text") {
|
|
2641
2656
|
let e;
|
|
2642
|
-
return t[4] === n ? e = t[5] : (e = /* @__PURE__ */ M(
|
|
2657
|
+
return t[4] === n ? e = t[5] : (e = /* @__PURE__ */ M(Z.Text, {
|
|
2643
2658
|
segment: n,
|
|
2644
2659
|
className: "text-xs"
|
|
2645
2660
|
}), t[4] = n, t[5] = e), e;
|
|
2646
2661
|
}
|
|
2647
2662
|
if (n.kind === "file") {
|
|
2648
2663
|
let e;
|
|
2649
|
-
return t[6] === n ? e = t[7] : (e = /* @__PURE__ */ M(
|
|
2664
|
+
return t[6] === n ? e = t[7] : (e = /* @__PURE__ */ M(Z.File, { segment: n }), t[6] = n, t[7] = e), e;
|
|
2650
2665
|
}
|
|
2651
2666
|
return null;
|
|
2652
|
-
},
|
|
2653
|
-
function
|
|
2667
|
+
}, ua);
|
|
2668
|
+
function ua(e, t) {
|
|
2654
2669
|
return e.complete && t.complete && e.cacheKey === t.cacheKey;
|
|
2655
2670
|
}
|
|
2656
|
-
function
|
|
2671
|
+
function da(e) {
|
|
2657
2672
|
let t = O(11), { parts: n, className: r } = e, i;
|
|
2658
2673
|
t[0] === n ? i = t[1] : (i = aa(n), t[0] = n, t[1] = i);
|
|
2659
2674
|
let a = i;
|
|
@@ -2664,11 +2679,11 @@ function ua(e) {
|
|
|
2664
2679
|
if (t[4] !== a) {
|
|
2665
2680
|
let e;
|
|
2666
2681
|
t[6] === a.length ? e = t[7] : (e = (e, t) => {
|
|
2667
|
-
let n = `${
|
|
2668
|
-
return /* @__PURE__ */ M(
|
|
2682
|
+
let n = `${oa(e, t)}-${e.kind}`;
|
|
2683
|
+
return /* @__PURE__ */ M(la, {
|
|
2669
2684
|
segment: e,
|
|
2670
|
-
cacheKey:
|
|
2671
|
-
complete:
|
|
2685
|
+
cacheKey: sa(e, t),
|
|
2686
|
+
complete: ca(e, t, a.length)
|
|
2672
2687
|
}, n);
|
|
2673
2688
|
}, t[6] = a.length, t[7] = e), s = a.map(e), t[4] = a, t[5] = s;
|
|
2674
2689
|
} else s = t[5];
|
|
@@ -2700,13 +2715,13 @@ function Q(e) {
|
|
|
2700
2715
|
}
|
|
2701
2716
|
//#endregion
|
|
2702
2717
|
//#region src/lib/chat/trajectory/trajectories/message-actions.tsx
|
|
2703
|
-
function
|
|
2704
|
-
let { index: e } =
|
|
2718
|
+
function fa() {
|
|
2719
|
+
let { index: e } = q(), { messages: t } = G(), n = K();
|
|
2705
2720
|
return !(e === t.length - 1 && (n === "submitted" || n === "streaming" || n === "error"));
|
|
2706
2721
|
}
|
|
2707
|
-
function
|
|
2722
|
+
function pa(e) {
|
|
2708
2723
|
let t = O(5), { className: n, children: r } = e;
|
|
2709
|
-
if (!
|
|
2724
|
+
if (!fa() || i.toArray(r).length === 0) return null;
|
|
2710
2725
|
let a;
|
|
2711
2726
|
t[0] === n ? a = t[1] : (a = k("mt-1 flex items-center gap-0.5", n), t[0] = n, t[1] = a);
|
|
2712
2727
|
let o;
|
|
@@ -2716,8 +2731,8 @@ function fa(e) {
|
|
|
2716
2731
|
children: r
|
|
2717
2732
|
}), t[2] = r, t[3] = a, t[4] = o) : o = t[4], o;
|
|
2718
2733
|
}
|
|
2719
|
-
function
|
|
2720
|
-
let t = O(12), { className: n } = e, { message: r } =
|
|
2734
|
+
function ma(e) {
|
|
2735
|
+
let t = O(12), { className: n } = e, { message: r } = q(), [i, a] = Vr(), o = i ? "Copied" : "Copy message", s;
|
|
2721
2736
|
t[0] === n ? s = t[1] : (s = k("p-1.5", n), t[0] = n, t[1] = s);
|
|
2722
2737
|
let c;
|
|
2723
2738
|
t[2] !== a || t[3] !== r ? (c = () => void a(fi(r)), t[2] = a, t[3] = r, t[4] = c) : c = t[4];
|
|
@@ -2731,8 +2746,8 @@ function pa(e) {
|
|
|
2731
2746
|
icon: l
|
|
2732
2747
|
}), t[7] = o, t[8] = s, t[9] = c, t[10] = l, t[11] = u) : u = t[11], u;
|
|
2733
2748
|
}
|
|
2734
|
-
function
|
|
2735
|
-
let t = O(9), { className: n } = e, { message: r } =
|
|
2749
|
+
function ha(e) {
|
|
2750
|
+
let t = O(9), { className: n } = e, { message: r } = q(), { regenerate: i } = H(), a;
|
|
2736
2751
|
t[0] === n ? a = t[1] : (a = k("p-1.5", n), t[0] = n, t[1] = a);
|
|
2737
2752
|
let o;
|
|
2738
2753
|
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];
|
|
@@ -2746,8 +2761,8 @@ function ma(e) {
|
|
|
2746
2761
|
icon: s
|
|
2747
2762
|
}), t[6] = a, t[7] = o, t[8] = c) : c = t[8], c;
|
|
2748
2763
|
}
|
|
2749
|
-
function
|
|
2750
|
-
let t = O(12), { className: n } = e, { message: r } =
|
|
2764
|
+
function ga(e) {
|
|
2765
|
+
let t = O(12), { className: n } = e, { message: r } = q(), [i, a] = Vr(), o = i ? "Copied" : "Copy debug JSON", s;
|
|
2751
2766
|
t[0] === n ? s = t[1] : (s = k("p-1.5", n), t[0] = n, t[1] = s);
|
|
2752
2767
|
let c;
|
|
2753
2768
|
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];
|
|
@@ -2763,11 +2778,11 @@ function ha(e) {
|
|
|
2763
2778
|
}
|
|
2764
2779
|
//#endregion
|
|
2765
2780
|
//#region src/lib/chat/trajectory/trajectories/messages-error.tsx
|
|
2766
|
-
function
|
|
2781
|
+
function _a(e) {
|
|
2767
2782
|
let t = O(7), { onTryAgain: n, error: r } = e, i = r instanceof Error ? r.message : "An error occurred. Please try again.", a;
|
|
2768
2783
|
t[0] === i ? a = t[1] : (a = /* @__PURE__ */ M("div", {
|
|
2769
2784
|
className: "text-destructive text-sm",
|
|
2770
|
-
children: /* @__PURE__ */ M(
|
|
2785
|
+
children: /* @__PURE__ */ M(Y, {
|
|
2771
2786
|
mode: "static",
|
|
2772
2787
|
children: i
|
|
2773
2788
|
})
|
|
@@ -2789,18 +2804,18 @@ function ga(e) {
|
|
|
2789
2804
|
})
|
|
2790
2805
|
}), t[4] = a, t[5] = o, t[6] = s) : s = t[6], s;
|
|
2791
2806
|
}
|
|
2792
|
-
function
|
|
2807
|
+
function va(e) {
|
|
2793
2808
|
let t = O(3), { error: n, onRetry: r } = e;
|
|
2794
2809
|
if (!n || !r) return null;
|
|
2795
2810
|
let i;
|
|
2796
|
-
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(
|
|
2811
|
+
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(_a, {
|
|
2797
2812
|
onTryAgain: r,
|
|
2798
2813
|
error: n
|
|
2799
2814
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2], i;
|
|
2800
2815
|
}
|
|
2801
2816
|
//#endregion
|
|
2802
2817
|
//#region src/lib/chat/trajectory/trajectories/messages-shell.tsx
|
|
2803
|
-
function
|
|
2818
|
+
function ya(e) {
|
|
2804
2819
|
let t = O(15), { messages: n, className: r, elements: i, citation: a, status: o, children: s } = e, c;
|
|
2805
2820
|
t[0] !== a || t[1] !== i || t[2] !== n || t[3] !== o ? (c = {
|
|
2806
2821
|
messages: n,
|
|
@@ -2826,7 +2841,7 @@ function va(e) {
|
|
|
2826
2841
|
children: f
|
|
2827
2842
|
}), t[12] = f, t[13] = l, t[14] = p) : p = t[14], p;
|
|
2828
2843
|
}
|
|
2829
|
-
function
|
|
2844
|
+
function ba(e) {
|
|
2830
2845
|
let t = O(5), { className: n, children: r } = e, i;
|
|
2831
2846
|
t[0] === n ? i = t[1] : (i = k("flex flex-col gap-4", n), t[0] = n, t[1] = i);
|
|
2832
2847
|
let a;
|
|
@@ -2835,7 +2850,7 @@ function ya(e) {
|
|
|
2835
2850
|
children: r
|
|
2836
2851
|
}), t[2] = r, t[3] = i, t[4] = a) : a = t[4], a;
|
|
2837
2852
|
}
|
|
2838
|
-
function
|
|
2853
|
+
function xa(e) {
|
|
2839
2854
|
let t = O(9), { message: n, index: r, className: i, children: a } = e, o;
|
|
2840
2855
|
t[0] !== r || t[1] !== n ? (o = {
|
|
2841
2856
|
message: n,
|
|
@@ -2854,7 +2869,7 @@ function ba(e) {
|
|
|
2854
2869
|
}
|
|
2855
2870
|
//#endregion
|
|
2856
2871
|
//#region src/lib/components/PendingToolInput.tsx
|
|
2857
|
-
function
|
|
2872
|
+
function Sa() {
|
|
2858
2873
|
let e = O(5), { registry: t } = z(), n = H().messages, r;
|
|
2859
2874
|
if (e[0] !== n || e[1] !== t) {
|
|
2860
2875
|
bb0: {
|
|
@@ -2862,7 +2877,7 @@ function xa() {
|
|
|
2862
2877
|
r = null;
|
|
2863
2878
|
break bb0;
|
|
2864
2879
|
}
|
|
2865
|
-
let i = n.findLast(
|
|
2880
|
+
let i = n.findLast(Ca);
|
|
2866
2881
|
if (!i) {
|
|
2867
2882
|
r = null;
|
|
2868
2883
|
break bb0;
|
|
@@ -2881,12 +2896,12 @@ function xa() {
|
|
|
2881
2896
|
} else r = e[2];
|
|
2882
2897
|
return r;
|
|
2883
2898
|
}
|
|
2884
|
-
function
|
|
2899
|
+
function Ca(e) {
|
|
2885
2900
|
let { role: t } = e;
|
|
2886
2901
|
return t === "assistant";
|
|
2887
2902
|
}
|
|
2888
|
-
function
|
|
2889
|
-
let t = O(10), { children: n, className: i } = e, a =
|
|
2903
|
+
function wa(e) {
|
|
2904
|
+
let t = O(10), { children: n, className: i } = e, a = Sa(), o = a?.entry.component, s = a ? "hidden" : "visible", c;
|
|
2890
2905
|
t[0] !== n || t[1] !== s ? (c = /* @__PURE__ */ M(r, {
|
|
2891
2906
|
mode: s,
|
|
2892
2907
|
children: n
|
|
@@ -2901,7 +2916,7 @@ function Ca(e) {
|
|
|
2901
2916
|
}
|
|
2902
2917
|
//#endregion
|
|
2903
2918
|
//#region src/lib/chat/trajectory/trajectories/thinking-hint.ts
|
|
2904
|
-
function
|
|
2919
|
+
function Ta(e, t) {
|
|
2905
2920
|
if (e === "error" || e === "ready" || !t) return null;
|
|
2906
2921
|
if (t.role !== "assistant") return "Thinking...";
|
|
2907
2922
|
for (let e = t.parts.length - 1; e >= 0; e--) {
|
|
@@ -2930,7 +2945,7 @@ function wa(e, t) {
|
|
|
2930
2945
|
}
|
|
2931
2946
|
//#endregion
|
|
2932
2947
|
//#region src/lib/chat/trajectory/trajectories/timeline-dot.tsx
|
|
2933
|
-
function
|
|
2948
|
+
function Ea(e) {
|
|
2934
2949
|
let t = O(5), { isLast: n } = e, r = n !== void 0 && n, i;
|
|
2935
2950
|
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];
|
|
2936
2951
|
let a;
|
|
@@ -2943,7 +2958,7 @@ function Ta(e) {
|
|
|
2943
2958
|
}
|
|
2944
2959
|
//#endregion
|
|
2945
2960
|
//#region src/lib/chat/trajectory/trajectories/timeline-item.tsx
|
|
2946
|
-
function
|
|
2961
|
+
function Da(e) {
|
|
2947
2962
|
let t = O(6), { marker: n, children: r, className: i } = e, a;
|
|
2948
2963
|
t[0] === i ? a = t[1] : (a = k("relative z-0 flex gap-3 pl-5", i), t[0] = i, t[1] = a);
|
|
2949
2964
|
let o;
|
|
@@ -2954,20 +2969,20 @@ function Ea(e) {
|
|
|
2954
2969
|
}
|
|
2955
2970
|
//#endregion
|
|
2956
2971
|
//#region src/lib/chat/trajectory/trajectories/trajectory-thinking.tsx
|
|
2957
|
-
function
|
|
2958
|
-
let e = O(6), t =
|
|
2959
|
-
e[0] !== t || e[1] !== i ? (a =
|
|
2972
|
+
function Oa() {
|
|
2973
|
+
let e = O(6), t = K(), { messages: n } = G(), r = Sa(), i = n[n.length - 1], a;
|
|
2974
|
+
e[0] !== t || e[1] !== i ? (a = Ta(t, i), e[0] = t, e[1] = i, e[2] = a) : a = e[2];
|
|
2960
2975
|
let o = a;
|
|
2961
2976
|
if (!o || r) return null;
|
|
2962
2977
|
let s;
|
|
2963
|
-
e[3] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(
|
|
2978
|
+
e[3] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(Ea, { isLast: !0 }), e[3] = s) : s = e[3];
|
|
2964
2979
|
let c;
|
|
2965
|
-
return e[4] === o ? c = e[5] : (c = /* @__PURE__ */ M(
|
|
2980
|
+
return e[4] === o ? c = e[5] : (c = /* @__PURE__ */ M(Da, {
|
|
2966
2981
|
className: "mt-2",
|
|
2967
2982
|
marker: s,
|
|
2968
2983
|
children: /* @__PURE__ */ M("span", {
|
|
2969
2984
|
role: "status",
|
|
2970
|
-
children: /* @__PURE__ */ M(
|
|
2985
|
+
children: /* @__PURE__ */ M(W, {
|
|
2971
2986
|
as: "span",
|
|
2972
2987
|
className: "text-muted-foreground line-clamp-2 font-mono text-xs",
|
|
2973
2988
|
children: o
|
|
@@ -2983,7 +2998,7 @@ var $ = [
|
|
|
2983
2998
|
"reasoningTokens",
|
|
2984
2999
|
"cachedInputTokens",
|
|
2985
3000
|
"totalTokens"
|
|
2986
|
-
],
|
|
3001
|
+
], ka = {
|
|
2987
3002
|
inputTokens: [["inputTokens"], ["raw", "prompt_tokens"]],
|
|
2988
3003
|
outputTokens: [["outputTokens"], ["raw", "completion_tokens"]],
|
|
2989
3004
|
reasoningTokens: [
|
|
@@ -3007,7 +3022,7 @@ var $ = [
|
|
|
3007
3022
|
],
|
|
3008
3023
|
totalTokens: [["totalTokens"], ["raw", "total_tokens"]]
|
|
3009
3024
|
};
|
|
3010
|
-
function
|
|
3025
|
+
function Aa(e) {
|
|
3011
3026
|
if (typeof e == "number" && Number.isFinite(e) && e >= 0) return e;
|
|
3012
3027
|
if (typeof e == "string" && e.trim().length > 0) {
|
|
3013
3028
|
let t = Number(e);
|
|
@@ -3015,7 +3030,7 @@ function ka(e) {
|
|
|
3015
3030
|
}
|
|
3016
3031
|
return null;
|
|
3017
3032
|
}
|
|
3018
|
-
function
|
|
3033
|
+
function ja(e) {
|
|
3019
3034
|
if (!e || typeof e != "object") return null;
|
|
3020
3035
|
let t = {
|
|
3021
3036
|
inputTokens: null,
|
|
@@ -3024,8 +3039,8 @@ function Aa(e) {
|
|
|
3024
3039
|
cachedInputTokens: null,
|
|
3025
3040
|
totalTokens: null
|
|
3026
3041
|
};
|
|
3027
|
-
for (let n of $) for (let r of
|
|
3028
|
-
let i =
|
|
3042
|
+
for (let n of $) for (let r of ka[n]) {
|
|
3043
|
+
let i = Aa(Dt(e, r));
|
|
3029
3044
|
if (i !== null) {
|
|
3030
3045
|
t[n] = i;
|
|
3031
3046
|
break;
|
|
@@ -3033,10 +3048,10 @@ function Aa(e) {
|
|
|
3033
3048
|
}
|
|
3034
3049
|
return $.some((e) => t[e] !== null) ? t : null;
|
|
3035
3050
|
}
|
|
3036
|
-
function
|
|
3037
|
-
return D(e) ?
|
|
3051
|
+
function Ma(e) {
|
|
3052
|
+
return D(e) ? ja(e.totalUsage ?? e.usage) : null;
|
|
3038
3053
|
}
|
|
3039
|
-
function
|
|
3054
|
+
function Na(e, t) {
|
|
3040
3055
|
let n = {
|
|
3041
3056
|
inputTokens: null,
|
|
3042
3057
|
outputTokens: null,
|
|
@@ -3058,7 +3073,7 @@ function Ma(e, t) {
|
|
|
3058
3073
|
}
|
|
3059
3074
|
return $.some((e) => n[e] !== null) ? n : null;
|
|
3060
3075
|
}
|
|
3061
|
-
function
|
|
3076
|
+
function Pa(e) {
|
|
3062
3077
|
if (e.length === 0) return null;
|
|
3063
3078
|
let t = {
|
|
3064
3079
|
inputTokens: null,
|
|
@@ -3077,32 +3092,32 @@ function Na(e) {
|
|
|
3077
3092
|
}
|
|
3078
3093
|
return $.some((e) => t[e] !== null) ? t : null;
|
|
3079
3094
|
}
|
|
3080
|
-
function
|
|
3095
|
+
function Fa(e) {
|
|
3081
3096
|
let t = {}, n = [], r = null, i = null;
|
|
3082
3097
|
for (let a of e) {
|
|
3083
3098
|
if (a.role !== "assistant") continue;
|
|
3084
|
-
let e = D(a.metadata) ? a.metadata : void 0, o =
|
|
3099
|
+
let e = D(a.metadata) ? a.metadata : void 0, o = ja(e?.usage), s = ja(e?.totalUsage), c = o ?? (s ? Na(s, r) : null);
|
|
3085
3100
|
c && (t[a.id] = c, n.push(c)), s && (i = s, r = s);
|
|
3086
3101
|
}
|
|
3087
3102
|
return {
|
|
3088
3103
|
assistantUsageByMessageId: t,
|
|
3089
|
-
chatUsageSummary: i ??
|
|
3104
|
+
chatUsageSummary: i ?? Pa(n)
|
|
3090
3105
|
};
|
|
3091
3106
|
}
|
|
3092
|
-
function
|
|
3107
|
+
function Ia() {
|
|
3093
3108
|
let e = O(2), t = H(), n;
|
|
3094
|
-
return e[0] === t.messages ? n = e[1] : (n =
|
|
3109
|
+
return e[0] === t.messages ? n = e[1] : (n = Fa(t.messages), e[0] = t.messages, e[1] = n), n;
|
|
3095
3110
|
}
|
|
3096
|
-
function
|
|
3111
|
+
function La(e) {
|
|
3097
3112
|
return kt(e);
|
|
3098
3113
|
}
|
|
3099
|
-
function
|
|
3114
|
+
function Ra(e) {
|
|
3100
3115
|
let t = [`↑ ${Ot(e.inputTokens)}`, `↓ ${Ot(e.outputTokens)}`];
|
|
3101
3116
|
return e.totalTokens !== null && t.push(`· ${kt(e.totalTokens)} tokens`), e.cachedInputTokens !== null && e.cachedInputTokens > 0 && t.push(`(${Ot(e.cachedInputTokens)} cached)`), t.join(" ");
|
|
3102
3117
|
}
|
|
3103
3118
|
//#endregion
|
|
3104
3119
|
//#region src/lib/chat/zukhruf-chat-transport.ts
|
|
3105
|
-
var
|
|
3120
|
+
var za = "x-upload-filename", Ba = P.strictObject({
|
|
3106
3121
|
path: P.string().startsWith("/"),
|
|
3107
3122
|
name: P.string().min(1),
|
|
3108
3123
|
mediaType: P.enum([
|
|
@@ -3120,19 +3135,19 @@ var Ra = "x-upload-filename", za = P.strictObject({
|
|
|
3120
3135
|
]),
|
|
3121
3136
|
size: P.int().nonnegative(),
|
|
3122
3137
|
url: P.url()
|
|
3123
|
-
}),
|
|
3138
|
+
}), Va = class extends _ {
|
|
3124
3139
|
sessionsApi;
|
|
3125
3140
|
request;
|
|
3126
3141
|
constructor({ api: e, fetch: t = (e, t) => globalThis.fetch(e, t), tools: n = {}, elements: r = [] }) {
|
|
3127
|
-
let i =
|
|
3142
|
+
let i = Ga(e), a = r.map(se);
|
|
3128
3143
|
super({
|
|
3129
3144
|
api: i,
|
|
3130
3145
|
fetch: async (e, n) => {
|
|
3131
3146
|
let r = await t(e, n);
|
|
3132
3147
|
if ((n?.method ?? "GET").toUpperCase() !== "POST" || !r.ok) return r;
|
|
3133
3148
|
let i = await r.json();
|
|
3134
|
-
if (!
|
|
3135
|
-
let a =
|
|
3149
|
+
if (!Ka(i)) throw Error("Zukhruf returned an invalid accepted-turn response");
|
|
3150
|
+
let a = Ga(String(e)), o = decodeURIComponent(a.slice(a.lastIndexOf("/") + 1));
|
|
3136
3151
|
if (i.sessionId !== o) throw Error("Zukhruf returned a different session ID");
|
|
3137
3152
|
let s = n?.signal;
|
|
3138
3153
|
return s?.addEventListener("abort", () => {
|
|
@@ -3147,7 +3162,7 @@ var Ra = "x-upload-filename", za = P.strictObject({
|
|
|
3147
3162
|
let o = t[t.length - 1];
|
|
3148
3163
|
if (!o) throw Error("A message is required");
|
|
3149
3164
|
return {
|
|
3150
|
-
api:
|
|
3165
|
+
api: Ha(i, e),
|
|
3151
3166
|
body: {
|
|
3152
3167
|
sessionId: e,
|
|
3153
3168
|
message: o,
|
|
@@ -3158,50 +3173,50 @@ var Ra = "x-upload-filename", za = P.strictObject({
|
|
|
3158
3173
|
};
|
|
3159
3174
|
},
|
|
3160
3175
|
prepareReconnectToStreamRequest: ({ headers: e, id: t }) => ({
|
|
3161
|
-
api: `${
|
|
3176
|
+
api: `${Ha(i, t)}/stream`,
|
|
3162
3177
|
headers: e
|
|
3163
3178
|
})
|
|
3164
3179
|
}), this.sessionsApi = i, this.request = t;
|
|
3165
3180
|
}
|
|
3166
3181
|
async uploadFile(e, t) {
|
|
3167
|
-
let n = await this.request(`${
|
|
3182
|
+
let n = await this.request(`${Ha(this.sessionsApi, e)}/uploads`, {
|
|
3168
3183
|
method: "POST",
|
|
3169
3184
|
headers: {
|
|
3170
3185
|
"content-type": t.type,
|
|
3171
|
-
[
|
|
3186
|
+
[za]: encodeURIComponent(t.name)
|
|
3172
3187
|
},
|
|
3173
3188
|
body: t
|
|
3174
3189
|
});
|
|
3175
|
-
if (!n.ok) throw Error(await
|
|
3176
|
-
let r =
|
|
3190
|
+
if (!n.ok) throw Error(await Ua(n, t));
|
|
3191
|
+
let r = Ba.safeParse(await n.json());
|
|
3177
3192
|
if (!r.success) throw Error("Zukhruf returned an invalid upload response");
|
|
3178
3193
|
return r.data;
|
|
3179
3194
|
}
|
|
3180
3195
|
};
|
|
3181
|
-
function
|
|
3196
|
+
function Ha(e, t) {
|
|
3182
3197
|
return `${e}/${encodeURIComponent(t)}`;
|
|
3183
3198
|
}
|
|
3184
|
-
async function
|
|
3185
|
-
let n = `Uploading ${t.name} failed with HTTP ${e.status}`, r =
|
|
3199
|
+
async function Ua(e, t) {
|
|
3200
|
+
let n = `Uploading ${t.name} failed with HTTP ${e.status}`, r = Wa(await e.json().catch((e) => {
|
|
3186
3201
|
if (e instanceof SyntaxError) return null;
|
|
3187
3202
|
throw e;
|
|
3188
3203
|
}));
|
|
3189
3204
|
return r ? `${n}: ${r}` : n;
|
|
3190
3205
|
}
|
|
3191
|
-
function
|
|
3206
|
+
function Wa(e) {
|
|
3192
3207
|
if (typeof e != "object" || !e) return null;
|
|
3193
3208
|
let t = "cause" in e && typeof e.cause == "object" && e.cause !== null ? e.cause : null;
|
|
3194
3209
|
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;
|
|
3195
3210
|
}
|
|
3196
|
-
function
|
|
3211
|
+
function Ga(e) {
|
|
3197
3212
|
return e.replace(/\/$/, "");
|
|
3198
3213
|
}
|
|
3199
|
-
function
|
|
3214
|
+
function Ka(e) {
|
|
3200
3215
|
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";
|
|
3201
3216
|
}
|
|
3202
3217
|
//#endregion
|
|
3203
3218
|
//#region src/lib/chat/trajectory/trajectories/collapsible-disclosure.tsx
|
|
3204
|
-
function
|
|
3219
|
+
function qa(e) {
|
|
3205
3220
|
let t = O(24), { label: n, open: r, onOpenChange: i, children: a, className: o, triggerClassName: s, contentClassName: c, chevronClassName: l } = e, u;
|
|
3206
3221
|
t[0] === s ? u = t[1] : (u = k("flex items-center font-mono", s), t[0] = s, t[1] = u);
|
|
3207
3222
|
let d;
|
|
@@ -3235,19 +3250,19 @@ function Ka(e) {
|
|
|
3235
3250
|
}
|
|
3236
3251
|
//#endregion
|
|
3237
3252
|
//#region src/lib/chat/trajectory/trajectories/user-message.tsx
|
|
3238
|
-
function
|
|
3253
|
+
function Ja(e) {
|
|
3239
3254
|
let t = O(7), { metadata: n } = e;
|
|
3240
3255
|
if (!n) return null;
|
|
3241
3256
|
let r, i, a;
|
|
3242
3257
|
if (t[0] !== n) {
|
|
3243
3258
|
a = Symbol.for("react.early_return_sentinel");
|
|
3244
3259
|
bb0: {
|
|
3245
|
-
let e =
|
|
3260
|
+
let e = Ma(n);
|
|
3246
3261
|
if (!e) {
|
|
3247
3262
|
a = null;
|
|
3248
3263
|
break bb0;
|
|
3249
3264
|
}
|
|
3250
|
-
r = "text-muted-foreground mt-2 text-xs tabular-nums opacity-60", i =
|
|
3265
|
+
r = "text-muted-foreground mt-2 text-xs tabular-nums opacity-60", i = Ra(e);
|
|
3251
3266
|
}
|
|
3252
3267
|
t[0] = n, t[1] = r, t[2] = i, t[3] = a;
|
|
3253
3268
|
} else r = t[1], i = t[2], a = t[3];
|
|
@@ -3258,27 +3273,27 @@ function qa(e) {
|
|
|
3258
3273
|
children: i
|
|
3259
3274
|
}), t[4] = r, t[5] = i, t[6] = o) : o = t[6], o;
|
|
3260
3275
|
}
|
|
3261
|
-
function
|
|
3276
|
+
function Ya(e, t) {
|
|
3262
3277
|
return D(e.metadata) ? e.metadata[t] : void 0;
|
|
3263
3278
|
}
|
|
3264
|
-
function
|
|
3265
|
-
let t =
|
|
3279
|
+
function Xa(e) {
|
|
3280
|
+
let t = Ya(e, "reminders");
|
|
3266
3281
|
return Array.isArray(t) ? t.filter((e) => {
|
|
3267
3282
|
if (!e || typeof e != "object") return !1;
|
|
3268
3283
|
let t = e;
|
|
3269
3284
|
return typeof t.id == "string" && t.id.length > 0 && typeof t.text == "string" && t.text.trim().length > 0;
|
|
3270
3285
|
}) : [];
|
|
3271
3286
|
}
|
|
3272
|
-
function
|
|
3273
|
-
let t =
|
|
3287
|
+
function Za(e) {
|
|
3288
|
+
let t = Ya(e, "uploads");
|
|
3274
3289
|
return Array.isArray(t) ? t.flatMap((e) => {
|
|
3275
|
-
let t =
|
|
3290
|
+
let t = Ba.safeParse(e);
|
|
3276
3291
|
return t.success ? [t.data] : [];
|
|
3277
3292
|
}) : [];
|
|
3278
3293
|
}
|
|
3279
|
-
function
|
|
3294
|
+
function Qa(e) {
|
|
3280
3295
|
let t = O(7), { text: n } = e, [r, i] = g(!1), a;
|
|
3281
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = () => i(
|
|
3296
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = () => i($a), t[0] = a) : a = t[0];
|
|
3282
3297
|
let o = !r && "line-clamp-3", s;
|
|
3283
3298
|
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);
|
|
3284
3299
|
let c;
|
|
@@ -3290,21 +3305,21 @@ function Za(e) {
|
|
|
3290
3305
|
children: n
|
|
3291
3306
|
}) }), t[3] = r, t[4] = s, t[5] = n, t[6] = c) : c = t[6], c;
|
|
3292
3307
|
}
|
|
3293
|
-
function
|
|
3308
|
+
function $a(e) {
|
|
3294
3309
|
return !e;
|
|
3295
3310
|
}
|
|
3296
|
-
function
|
|
3311
|
+
function eo(e) {
|
|
3297
3312
|
let t = O(8), { reminders: n } = e, [r, i] = g(!1);
|
|
3298
3313
|
if (n.length === 0) return null;
|
|
3299
3314
|
let a = `${n.length} reminder${n.length === 1 ? "" : "s"} attached`, o;
|
|
3300
|
-
t[0] === n ? o = t[1] : (o = n.map(
|
|
3315
|
+
t[0] === n ? o = t[1] : (o = n.map(to), t[0] = n, t[1] = o);
|
|
3301
3316
|
let s;
|
|
3302
3317
|
t[2] === o ? s = t[3] : (s = /* @__PURE__ */ M("ul", {
|
|
3303
3318
|
className: "border-ink-12 text-muted-foreground space-y-1 border-l pl-3 text-xs",
|
|
3304
3319
|
children: o
|
|
3305
3320
|
}), t[2] = o, t[3] = s);
|
|
3306
3321
|
let c;
|
|
3307
|
-
return t[4] !== a || t[5] !== r || t[6] !== s ? (c = /* @__PURE__ */ M(
|
|
3322
|
+
return t[4] !== a || t[5] !== r || t[6] !== s ? (c = /* @__PURE__ */ M(qa, {
|
|
3308
3323
|
label: a,
|
|
3309
3324
|
open: r,
|
|
3310
3325
|
onOpenChange: i,
|
|
@@ -3315,10 +3330,10 @@ function $a(e) {
|
|
|
3315
3330
|
children: s
|
|
3316
3331
|
}), t[4] = a, t[5] = r, t[6] = s, t[7] = c) : c = t[7], c;
|
|
3317
3332
|
}
|
|
3318
|
-
function eo(e) {
|
|
3319
|
-
return /* @__PURE__ */ M(Za, { text: e.text }, e.id);
|
|
3320
|
-
}
|
|
3321
3333
|
function to(e) {
|
|
3334
|
+
return /* @__PURE__ */ M(Qa, { text: e.text }, e.id);
|
|
3335
|
+
}
|
|
3336
|
+
function no(e) {
|
|
3322
3337
|
let t = O(19), { upload: n } = e;
|
|
3323
3338
|
if (n.mediaType.startsWith("video/")) {
|
|
3324
3339
|
let e;
|
|
@@ -3384,17 +3399,17 @@ function to(e) {
|
|
|
3384
3399
|
})
|
|
3385
3400
|
}), t[16] = n.name, t[17] = n.url, t[18] = r) : r = t[18], r;
|
|
3386
3401
|
}
|
|
3387
|
-
function
|
|
3402
|
+
function ro(e) {
|
|
3388
3403
|
let t = O(13), { message: n } = e, r, i, a, o, s, c;
|
|
3389
3404
|
if (t[0] !== n) {
|
|
3390
3405
|
c = Symbol.for("react.early_return_sentinel");
|
|
3391
3406
|
bb0: {
|
|
3392
|
-
let e =
|
|
3407
|
+
let e = Za(n);
|
|
3393
3408
|
if (e.length === 0) {
|
|
3394
3409
|
c = null;
|
|
3395
3410
|
break bb0;
|
|
3396
3411
|
}
|
|
3397
|
-
r = fe, i = "list", a = "Attached files", o = "max-w-full gap-2 py-0", s = e.map(
|
|
3412
|
+
r = fe, i = "list", a = "Attached files", o = "max-w-full gap-2 py-0", s = e.map(io);
|
|
3398
3413
|
}
|
|
3399
3414
|
t[0] = n, t[1] = r, t[2] = i, t[3] = a, t[4] = o, t[5] = s, t[6] = c;
|
|
3400
3415
|
} else r = t[1], i = t[2], a = t[3], o = t[4], s = t[5], c = t[6];
|
|
@@ -3407,23 +3422,23 @@ function no(e) {
|
|
|
3407
3422
|
children: s
|
|
3408
3423
|
}), t[7] = r, t[8] = i, t[9] = a, t[10] = o, t[11] = s, t[12] = l) : l = t[12], l;
|
|
3409
3424
|
}
|
|
3410
|
-
function
|
|
3425
|
+
function io(e) {
|
|
3411
3426
|
return /* @__PURE__ */ M("div", {
|
|
3412
3427
|
role: "listitem",
|
|
3413
3428
|
"data-slot": "attachment",
|
|
3414
|
-
children: /* @__PURE__ */ M(
|
|
3429
|
+
children: /* @__PURE__ */ M(no, { upload: e })
|
|
3415
3430
|
}, e.path);
|
|
3416
3431
|
}
|
|
3417
|
-
function
|
|
3432
|
+
function ao(e) {
|
|
3418
3433
|
let t = O(10), { body: n, reminders: r, metadata: i } = e, a;
|
|
3419
3434
|
t[0] === n ? a = t[1] : (a = /* @__PURE__ */ M("div", {
|
|
3420
3435
|
className: "flex-1 space-y-3",
|
|
3421
3436
|
children: n
|
|
3422
3437
|
}), t[0] = n, t[1] = a);
|
|
3423
3438
|
let o;
|
|
3424
|
-
t[2] === r ? o = t[3] : (o = /* @__PURE__ */ M(
|
|
3439
|
+
t[2] === r ? o = t[3] : (o = /* @__PURE__ */ M(eo, { reminders: r }), t[2] = r, t[3] = o);
|
|
3425
3440
|
let s;
|
|
3426
|
-
t[4] === i ? s = t[5] : (s = i !== void 0 && /* @__PURE__ */ M(
|
|
3441
|
+
t[4] === i ? s = t[5] : (s = i !== void 0 && /* @__PURE__ */ M(Ja, { metadata: i }), t[4] = i, t[5] = s);
|
|
3427
3442
|
let c;
|
|
3428
3443
|
return t[6] !== a || t[7] !== o || t[8] !== s ? (c = /* @__PURE__ */ N("div", {
|
|
3429
3444
|
className: "bg-secondary flex max-w-[80%] flex-col gap-3 rounded-lg p-3",
|
|
@@ -3434,13 +3449,13 @@ function io(e) {
|
|
|
3434
3449
|
]
|
|
3435
3450
|
}), t[6] = a, t[7] = o, t[8] = s, t[9] = c) : c = t[9], c;
|
|
3436
3451
|
}
|
|
3437
|
-
function
|
|
3452
|
+
function oo(e) {
|
|
3438
3453
|
let t = O(28), { message: n } = e;
|
|
3439
|
-
|
|
3454
|
+
Ya(n, "reminders");
|
|
3440
3455
|
let r;
|
|
3441
3456
|
t[0] === n ? r = t[1] : (r = ee(n), t[0] = n, t[1] = r);
|
|
3442
3457
|
let i;
|
|
3443
|
-
t[2] === n ? i = t[3] : (i =
|
|
3458
|
+
t[2] === n ? i = t[3] : (i = Xa(n), t[2] = n, t[3] = i);
|
|
3444
3459
|
let a;
|
|
3445
3460
|
t[4] !== r || t[5] !== i ? (a = {
|
|
3446
3461
|
message: r,
|
|
@@ -3448,7 +3463,7 @@ function ao(e) {
|
|
|
3448
3463
|
}, t[4] = r, t[5] = i, t[6] = a) : a = t[6];
|
|
3449
3464
|
let { message: o, reminders: s } = a, c;
|
|
3450
3465
|
if (t[7] !== n) {
|
|
3451
|
-
let e =
|
|
3466
|
+
let e = Ya(n, "alias");
|
|
3452
3467
|
c = typeof e == "string" && e.trim().length > 0 ? e : void 0, t[7] = n, t[8] = c;
|
|
3453
3468
|
} else c = t[8];
|
|
3454
3469
|
let l = c;
|
|
@@ -3460,13 +3475,13 @@ function ao(e) {
|
|
|
3460
3475
|
children: l
|
|
3461
3476
|
}), t[9] = l, t[10] = e);
|
|
3462
3477
|
let n;
|
|
3463
|
-
return t[11] !== s || t[12] !== e ? (n = /* @__PURE__ */ M(
|
|
3478
|
+
return t[11] !== s || t[12] !== e ? (n = /* @__PURE__ */ M(ao, {
|
|
3464
3479
|
reminders: s,
|
|
3465
3480
|
body: e
|
|
3466
3481
|
}), t[11] = s, t[12] = e, t[13] = n) : n = t[13], n;
|
|
3467
3482
|
}
|
|
3468
3483
|
let u;
|
|
3469
|
-
t[14] === o ? u = t[15] : (u = /* @__PURE__ */ M(
|
|
3484
|
+
t[14] === o ? u = t[15] : (u = /* @__PURE__ */ M(ro, { message: o }), t[14] = o, t[15] = u);
|
|
3470
3485
|
let d = o.metadata, f;
|
|
3471
3486
|
if (t[16] !== o.id || t[17] !== o.parts) {
|
|
3472
3487
|
let e;
|
|
@@ -3477,7 +3492,7 @@ function ao(e) {
|
|
|
3477
3492
|
}, `${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;
|
|
3478
3493
|
} else f = t[18];
|
|
3479
3494
|
let p;
|
|
3480
|
-
t[21] !== o.metadata || t[22] !== s || t[23] !== f ? (p = /* @__PURE__ */ M(
|
|
3495
|
+
t[21] !== o.metadata || t[22] !== s || t[23] !== f ? (p = /* @__PURE__ */ M(ao, {
|
|
3481
3496
|
reminders: s,
|
|
3482
3497
|
metadata: d,
|
|
3483
3498
|
body: f
|
|
@@ -3488,11 +3503,11 @@ function ao(e) {
|
|
|
3488
3503
|
children: [u, p]
|
|
3489
3504
|
}), t[25] = u, t[26] = p, t[27] = m) : m = t[27], m;
|
|
3490
3505
|
}
|
|
3491
|
-
var
|
|
3492
|
-
let t = O(7), { className: n } = e, { message: r } =
|
|
3506
|
+
var so = c(function(e) {
|
|
3507
|
+
let t = O(7), { className: n } = e, { message: r } = q(), i;
|
|
3493
3508
|
t[0] === n ? i = t[1] : (i = k("flex justify-end", n), t[0] = n, t[1] = i);
|
|
3494
3509
|
let a;
|
|
3495
|
-
t[2] === r ? a = t[3] : (a = /* @__PURE__ */ M(
|
|
3510
|
+
t[2] === r ? a = t[3] : (a = /* @__PURE__ */ M(oo, { message: r }), t[2] = r, t[3] = a);
|
|
3496
3511
|
let o;
|
|
3497
3512
|
return t[4] !== i || t[5] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
3498
3513
|
className: i,
|
|
@@ -3501,20 +3516,20 @@ var oo = c(function(e) {
|
|
|
3501
3516
|
});
|
|
3502
3517
|
//#endregion
|
|
3503
3518
|
//#region src/lib/chat/trajectory/trajectories/compact-messages.tsx
|
|
3504
|
-
function
|
|
3519
|
+
function co(e) {
|
|
3505
3520
|
return e.kind === "tool" ? !mi(e.part) : e.kind === "dynamic-tool" || e.kind === "reasoning";
|
|
3506
3521
|
}
|
|
3507
|
-
function
|
|
3522
|
+
function lo(e, t) {
|
|
3508
3523
|
return e.kind === "tool" ? !0 : e.kind === "reasoning" || e.kind === "dynamic-tool" ? !!t : !1;
|
|
3509
3524
|
}
|
|
3510
|
-
function
|
|
3525
|
+
function uo(e) {
|
|
3511
3526
|
return e.kind === "text" && e.parts.some(({ part: e }) => e.type === "text" && !Wi(e));
|
|
3512
3527
|
}
|
|
3513
|
-
function
|
|
3528
|
+
function fo(e, t) {
|
|
3514
3529
|
let n = [];
|
|
3515
3530
|
for (let r = 0; r < e.length; r++) {
|
|
3516
3531
|
let i = e[r];
|
|
3517
|
-
if (!
|
|
3532
|
+
if (!co(i)) {
|
|
3518
3533
|
n.push({
|
|
3519
3534
|
kind: "segment",
|
|
3520
3535
|
segment: i,
|
|
@@ -3523,25 +3538,25 @@ function uo(e, t) {
|
|
|
3523
3538
|
continue;
|
|
3524
3539
|
}
|
|
3525
3540
|
let a = [], o = r;
|
|
3526
|
-
for (; r < e.length &&
|
|
3541
|
+
for (; r < e.length && co(e[r]);) {
|
|
3527
3542
|
let n = e[r];
|
|
3528
|
-
|
|
3543
|
+
lo(n, t) && a.push({ segment: n }), r++;
|
|
3529
3544
|
}
|
|
3530
3545
|
r--, a.length > 0 && n.push({
|
|
3531
3546
|
kind: "group",
|
|
3532
3547
|
items: a,
|
|
3533
|
-
hasLaterText: e.slice(r + 1).some((e) =>
|
|
3548
|
+
hasLaterText: e.slice(r + 1).some((e) => uo(e)),
|
|
3534
3549
|
firstIndex: o
|
|
3535
3550
|
});
|
|
3536
3551
|
}
|
|
3537
3552
|
return n;
|
|
3538
3553
|
}
|
|
3539
|
-
function
|
|
3554
|
+
function po(e) {
|
|
3540
3555
|
if (e.kind !== "tool" && e.kind !== "dynamic-tool") return;
|
|
3541
3556
|
let { part: t } = e;
|
|
3542
3557
|
return w(t) ? t.state : void 0;
|
|
3543
3558
|
}
|
|
3544
|
-
function
|
|
3559
|
+
function mo({ groupStatus: e, labelCount: t }) {
|
|
3545
3560
|
return e === "running" ? {
|
|
3546
3561
|
title: "text-info",
|
|
3547
3562
|
detail: "text-info/80",
|
|
@@ -3564,20 +3579,20 @@ function po({ groupStatus: e, labelCount: t }) {
|
|
|
3564
3579
|
chevron: "text-muted-foreground"
|
|
3565
3580
|
};
|
|
3566
3581
|
}
|
|
3567
|
-
function
|
|
3582
|
+
function ho(e) {
|
|
3568
3583
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
3569
3584
|
}
|
|
3570
|
-
function
|
|
3585
|
+
function go(e, t = 80) {
|
|
3571
3586
|
let n = e.replace(/\s+/g, " ").trim();
|
|
3572
3587
|
return n.length <= t ? n : `${n.slice(0, t - 3).trimEnd()}...`;
|
|
3573
3588
|
}
|
|
3574
|
-
function
|
|
3575
|
-
if (typeof e == "string") return
|
|
3589
|
+
function _o(e) {
|
|
3590
|
+
if (typeof e == "string") return go(e, 48);
|
|
3576
3591
|
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
3577
3592
|
if (Array.isArray(e)) return `${e.length} items`;
|
|
3578
3593
|
}
|
|
3579
|
-
function
|
|
3580
|
-
if (!
|
|
3594
|
+
function vo(e) {
|
|
3595
|
+
if (!ho(e)) return;
|
|
3581
3596
|
let t = [
|
|
3582
3597
|
"command",
|
|
3583
3598
|
"query",
|
|
@@ -3589,13 +3604,13 @@ function _o(e) {
|
|
|
3589
3604
|
"checks"
|
|
3590
3605
|
], n = [...t.filter((t) => t in e).map((t) => [t, e[t]]), ...Object.entries(e).filter(([e]) => !t.includes(e))], r = {};
|
|
3591
3606
|
for (let [e, t] of n) {
|
|
3592
|
-
let n =
|
|
3607
|
+
let n = _o(t);
|
|
3593
3608
|
if (n && (r[e] = n, Object.keys(r).length >= 2)) break;
|
|
3594
3609
|
}
|
|
3595
3610
|
return Object.keys(r).length > 0 ? r : void 0;
|
|
3596
3611
|
}
|
|
3597
|
-
function
|
|
3598
|
-
if (
|
|
3612
|
+
function yo(e) {
|
|
3613
|
+
if (ho(e)) for (let t of [
|
|
3599
3614
|
"reasoning",
|
|
3600
3615
|
"thoughts",
|
|
3601
3616
|
"thought",
|
|
@@ -3603,121 +3618,135 @@ function vo(e) {
|
|
|
3603
3618
|
"detail"
|
|
3604
3619
|
]) {
|
|
3605
3620
|
let n = e[t];
|
|
3606
|
-
if (typeof n == "string" && n.trim().length > 0) return
|
|
3621
|
+
if (typeof n == "string" && n.trim().length > 0) return go(n);
|
|
3607
3622
|
}
|
|
3608
3623
|
}
|
|
3609
|
-
function
|
|
3624
|
+
function bo(e) {
|
|
3610
3625
|
if (e.kind !== "reasoning") return;
|
|
3611
3626
|
let { part: t } = e;
|
|
3612
|
-
if (t.type === "reasoning") return
|
|
3627
|
+
if (t.type === "reasoning") return go(t.text, 96);
|
|
3613
3628
|
}
|
|
3614
|
-
function
|
|
3629
|
+
function xo(e, t) {
|
|
3615
3630
|
if (e.kind === "reasoning") return {
|
|
3631
|
+
form: "call",
|
|
3616
3632
|
kind: "reasoning",
|
|
3617
3633
|
name: "reasoning",
|
|
3618
|
-
detail:
|
|
3634
|
+
detail: bo(e)
|
|
3619
3635
|
};
|
|
3620
3636
|
if (e.kind === "dynamic-tool" && e.part.type === "dynamic-tool") {
|
|
3621
3637
|
let t = e.part;
|
|
3622
3638
|
return {
|
|
3639
|
+
form: "call",
|
|
3623
3640
|
kind: "dynamic-tool",
|
|
3624
3641
|
name: t.toolName || "Tool",
|
|
3625
|
-
args:
|
|
3626
|
-
detail:
|
|
3642
|
+
args: vo(t.input),
|
|
3643
|
+
detail: yo(t.input)
|
|
3627
3644
|
};
|
|
3628
3645
|
}
|
|
3629
3646
|
if (e.kind === "tool" && S(e.part)) {
|
|
3630
3647
|
let n = e.part, { toolEntry: r, toolKey: i } = gi(n, t), a = r?.label?.(n);
|
|
3631
|
-
return {
|
|
3648
|
+
return a?.kind === "sentence" ? {
|
|
3649
|
+
form: "sentence",
|
|
3650
|
+
kind: "tool",
|
|
3651
|
+
text: a.text,
|
|
3652
|
+
detail: a.detail,
|
|
3653
|
+
isError: a.isError
|
|
3654
|
+
} : {
|
|
3655
|
+
form: "call",
|
|
3632
3656
|
kind: "tool",
|
|
3633
3657
|
name: a?.name ?? i,
|
|
3634
|
-
args: a?.args ??
|
|
3635
|
-
detail: a?.detail ??
|
|
3658
|
+
args: a?.args ?? vo(n.input),
|
|
3659
|
+
detail: a?.detail ?? yo(n.input),
|
|
3636
3660
|
isError: a?.isError
|
|
3637
3661
|
};
|
|
3638
3662
|
}
|
|
3639
3663
|
return {
|
|
3664
|
+
form: "call",
|
|
3640
3665
|
kind: "tool",
|
|
3641
3666
|
name: "Step"
|
|
3642
3667
|
};
|
|
3643
3668
|
}
|
|
3644
|
-
function
|
|
3669
|
+
function So(e) {
|
|
3645
3670
|
if (!e) return;
|
|
3646
3671
|
let t = Object.entries(e).filter((e) => typeof e[1] == "string" && e[1].trim().length > 0);
|
|
3647
|
-
if (t.length !== 0) return t.slice(0, 2).map(([e, t]) => `${e}: ${
|
|
3672
|
+
if (t.length !== 0) return t.slice(0, 2).map(([e, t]) => `${e}: ${go(t, 36)}`).join(", ");
|
|
3648
3673
|
}
|
|
3649
|
-
function
|
|
3650
|
-
let t =
|
|
3674
|
+
function Co(e) {
|
|
3675
|
+
let t = So(e.args);
|
|
3651
3676
|
return t ? `${e.name}(${t})` : e.name;
|
|
3652
3677
|
}
|
|
3653
|
-
function
|
|
3678
|
+
function wo(e) {
|
|
3654
3679
|
return e === "output-available" || e === "output-error" || e === "output-denied";
|
|
3655
3680
|
}
|
|
3656
|
-
function
|
|
3657
|
-
return !!e && !
|
|
3681
|
+
function To(e) {
|
|
3682
|
+
return !!e && !wo(e);
|
|
3658
3683
|
}
|
|
3659
|
-
function
|
|
3684
|
+
function Eo(e, t) {
|
|
3660
3685
|
return rn(e, t);
|
|
3661
3686
|
}
|
|
3662
|
-
function
|
|
3663
|
-
return e.some(({ segment: e }) =>
|
|
3664
|
-
let t =
|
|
3687
|
+
function Do({ items: e, labels: t, status: n, hasLaterText: r }) {
|
|
3688
|
+
return e.some(({ segment: e }) => Eo(po(e), n)) ? "aborted" : !r && (n === "streaming" || n === "submitted") ? "running" : t.some((e) => e.isError) || e.some(({ segment: e }) => {
|
|
3689
|
+
let t = po(e);
|
|
3665
3690
|
return t === "output-error" || t === "output-denied";
|
|
3666
|
-
}) ? "error" : e.some(({ segment: e }) =>
|
|
3691
|
+
}) ? "error" : e.some(({ segment: e }) => To(po(e))) || !r && t.every((e) => e.kind === "reasoning") && (n === "streaming" || n === "submitted") ? "running" : "complete";
|
|
3667
3692
|
}
|
|
3668
|
-
function
|
|
3693
|
+
function Oo(e) {
|
|
3669
3694
|
return e && `${e[0].toUpperCase()}${e.slice(1)}`;
|
|
3670
3695
|
}
|
|
3671
|
-
function
|
|
3696
|
+
function ko(e) {
|
|
3672
3697
|
return e.filter((e) => e.kind !== "reasoning").length;
|
|
3673
3698
|
}
|
|
3674
|
-
function
|
|
3675
|
-
let n =
|
|
3699
|
+
function Ao(e, t) {
|
|
3700
|
+
let n = ko(e);
|
|
3676
3701
|
if (n !== 0) return `${t === "running" || t === "aborted" ? "running" : "ran"} ${n} ${n === 1 ? "tool" : "tools"}`;
|
|
3677
3702
|
}
|
|
3678
|
-
function
|
|
3679
|
-
let n =
|
|
3680
|
-
if (n) return
|
|
3703
|
+
function jo(e, t) {
|
|
3704
|
+
let n = Ao(e, t);
|
|
3705
|
+
if (n) return Oo(t === "error" ? `${n} with issues` : t === "aborted" ? `cancelled after ${n}` : n);
|
|
3706
|
+
}
|
|
3707
|
+
function Mo(e) {
|
|
3708
|
+
let t = e.findLast((e) => e.kind !== "reasoning");
|
|
3709
|
+
return t?.form === "sentence" ? t : void 0;
|
|
3681
3710
|
}
|
|
3682
|
-
function
|
|
3711
|
+
function No(e, t, n) {
|
|
3683
3712
|
let r = e.length === 1 ? e[0] : void 0;
|
|
3684
3713
|
if (t === "running") return n || (r?.kind === "reasoning" ? `Reasoning${r.detail ? ` ${r.detail}` : ""}` : e.every((e) => e.kind === "reasoning") ? "Reasoning" : "Working...");
|
|
3685
|
-
if (r) {
|
|
3686
|
-
let e =
|
|
3714
|
+
if (r?.form === "call") {
|
|
3715
|
+
let e = Co(r);
|
|
3687
3716
|
return t === "error" ? `Failed ${e}` : t === "aborted" ? `Cancelled ${e}` : r.kind === "reasoning" ? `Reasoned${r.detail ? ` ${r.detail}` : ""}` : `Called ${e}`;
|
|
3688
3717
|
}
|
|
3689
|
-
return e.every((e) => e.kind === "reasoning") ? "Reasoned" :
|
|
3718
|
+
return e.every((e) => e.kind === "reasoning") ? "Reasoned" : jo(e, t) ?? "Ran tools";
|
|
3690
3719
|
}
|
|
3691
|
-
function
|
|
3720
|
+
function Po(e, t) {
|
|
3692
3721
|
if (t !== "running") {
|
|
3693
3722
|
if (e.length === 1) {
|
|
3694
3723
|
let t = e[0];
|
|
3695
3724
|
return t.kind === "reasoning" ? void 0 : t.detail;
|
|
3696
3725
|
}
|
|
3697
|
-
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;
|
|
3726
|
+
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;
|
|
3698
3727
|
}
|
|
3699
3728
|
}
|
|
3700
|
-
function
|
|
3729
|
+
function Fo(e) {
|
|
3701
3730
|
let t;
|
|
3702
3731
|
for (let n = e.length - 1; n >= 0; n--) {
|
|
3703
3732
|
let r = e[n].segment;
|
|
3704
3733
|
if (r.kind === "dynamic-tool" && r.part.type === "dynamic-tool") {
|
|
3705
|
-
let e =
|
|
3734
|
+
let e = yo(r.part.input);
|
|
3706
3735
|
if (e) return e;
|
|
3707
3736
|
}
|
|
3708
3737
|
if (r.kind === "tool" && S(r.part)) {
|
|
3709
|
-
let e =
|
|
3738
|
+
let e = yo(r.part.input);
|
|
3710
3739
|
if (e) return e;
|
|
3711
3740
|
}
|
|
3712
|
-
r.kind === "reasoning" && (t ??=
|
|
3741
|
+
r.kind === "reasoning" && (t ??= bo(r));
|
|
3713
3742
|
}
|
|
3714
3743
|
return t;
|
|
3715
3744
|
}
|
|
3716
|
-
function
|
|
3717
|
-
return !e || e.role !== "assistant" ? !1 :
|
|
3745
|
+
function Io(e, t) {
|
|
3746
|
+
return !e || e.role !== "assistant" ? !1 : fo(aa(e.parts), t).some((e) => e.kind === "group" && !e.hasLaterText);
|
|
3718
3747
|
}
|
|
3719
|
-
function
|
|
3720
|
-
let e = O(8), { message: t } =
|
|
3748
|
+
function Lo() {
|
|
3749
|
+
let e = O(8), { message: t } = q(), { debugMode: n } = z(), r;
|
|
3721
3750
|
e[0] === t.parts ? r = e[1] : (r = aa(t.parts), e[0] = t.parts, e[1] = r);
|
|
3722
3751
|
let i = r, a;
|
|
3723
3752
|
if (e[2] !== n || e[3] !== t.id || e[4] !== i) {
|
|
@@ -3727,30 +3756,30 @@ function Fo() {
|
|
|
3727
3756
|
key: `${t.id}-${e.firstIndex}-group-${e.hasLaterText ? "past" : "current"}`
|
|
3728
3757
|
} : {
|
|
3729
3758
|
...e,
|
|
3730
|
-
key: `${t.id}-${
|
|
3731
|
-
}, e[6] = t.id, e[7] = r), a =
|
|
3759
|
+
key: `${t.id}-${oa(e.segment, e.segmentIndex)}-${e.segment.kind}`
|
|
3760
|
+
}, e[6] = t.id, e[7] = r), a = fo(i, n).map(r), e[2] = n, e[3] = t.id, e[4] = i, e[5] = a;
|
|
3732
3761
|
} else a = e[5];
|
|
3733
3762
|
return a;
|
|
3734
3763
|
}
|
|
3735
|
-
var
|
|
3736
|
-
function
|
|
3737
|
-
let e = l(
|
|
3764
|
+
var Ro = o(null);
|
|
3765
|
+
function zo() {
|
|
3766
|
+
let e = l(Ro);
|
|
3738
3767
|
if (!e) throw Error("CompactTrajectory group parts must be rendered within CompactTrajectory.Group");
|
|
3739
3768
|
return e;
|
|
3740
3769
|
}
|
|
3741
|
-
function
|
|
3742
|
-
let t = O(21), { group: n, children: r } = e, { registry: i } = z(), { message: a } =
|
|
3770
|
+
function Bo(e) {
|
|
3771
|
+
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;
|
|
3743
3772
|
if (t[0] !== n.hasLaterText || t[1] !== n.items || t[2] !== i || t[3] !== o) {
|
|
3744
3773
|
let e;
|
|
3745
3774
|
t[7] === i ? e = t[8] : (e = (e) => {
|
|
3746
3775
|
let { segment: t } = e;
|
|
3747
|
-
return
|
|
3748
|
-
}, t[7] = i, t[8] = e), u = n.items.map(e), l =
|
|
3776
|
+
return xo(t, i);
|
|
3777
|
+
}, t[7] = i, t[8] = e), u = n.items.map(e), l = Do({
|
|
3749
3778
|
items: n.items,
|
|
3750
3779
|
labels: u,
|
|
3751
3780
|
status: o,
|
|
3752
3781
|
hasLaterText: n.hasLaterText
|
|
3753
|
-
}), d =
|
|
3782
|
+
}), d = mo({
|
|
3754
3783
|
groupStatus: l,
|
|
3755
3784
|
labelCount: u.length
|
|
3756
3785
|
}), t[0] = n.hasLaterText, t[1] = n.items, t[2] = i, t[3] = o, t[4] = l, t[5] = u, t[6] = d;
|
|
@@ -3771,12 +3800,12 @@ function Ro(e) {
|
|
|
3771
3800
|
children: r
|
|
3772
3801
|
}), t[15] = r, t[16] = s, t[17] = m) : m = t[17];
|
|
3773
3802
|
let h;
|
|
3774
|
-
return t[18] !== p || t[19] !== m ? (h = /* @__PURE__ */ M(
|
|
3803
|
+
return t[18] !== p || t[19] !== m ? (h = /* @__PURE__ */ M(Ro, {
|
|
3775
3804
|
value: p,
|
|
3776
3805
|
children: m
|
|
3777
3806
|
}), t[18] = p, t[19] = m, t[20] = h) : h = t[20], h;
|
|
3778
3807
|
}
|
|
3779
|
-
function
|
|
3808
|
+
function Vo(e) {
|
|
3780
3809
|
let t = O(3), { children: n } = e, r;
|
|
3781
3810
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ M("button", {
|
|
3782
3811
|
type: "button",
|
|
@@ -3786,59 +3815,87 @@ function zo(e) {
|
|
|
3786
3815
|
return t[1] === n ? i = t[2] : (i = /* @__PURE__ */ M(L, {
|
|
3787
3816
|
render: r,
|
|
3788
3817
|
children: /* @__PURE__ */ M("span", {
|
|
3789
|
-
className: "min-w-0 flex-1 text-
|
|
3818
|
+
className: "min-w-0 flex-1 text-start text-sm",
|
|
3790
3819
|
children: n
|
|
3791
3820
|
})
|
|
3792
3821
|
}), t[1] = n, t[2] = i), i;
|
|
3793
3822
|
}
|
|
3794
|
-
function
|
|
3795
|
-
let e = O(
|
|
3796
|
-
e[0]
|
|
3797
|
-
let o = a
|
|
3798
|
-
|
|
3823
|
+
function Ho() {
|
|
3824
|
+
let e = O(20), { items: t, labels: n, groupStatus: r, tone: i } = zo(), a;
|
|
3825
|
+
e[0] === n ? a = e[1] : (a = Mo(n), e[0] = n, e[1] = a);
|
|
3826
|
+
let o = a;
|
|
3827
|
+
if (o) {
|
|
3828
|
+
let t = ko(n) - 1, a = t > 0 ? t : void 0, s;
|
|
3829
|
+
return e[2] !== r || e[3] !== o.detail || e[4] !== o.text || e[5] !== a || e[6] !== i ? (s = {
|
|
3830
|
+
title: o.text,
|
|
3831
|
+
more: a,
|
|
3832
|
+
detail: o.detail,
|
|
3833
|
+
isSentence: !0,
|
|
3834
|
+
tone: i,
|
|
3835
|
+
groupStatus: r
|
|
3836
|
+
}, e[2] = r, e[3] = o.detail, e[4] = o.text, e[5] = a, e[6] = i, e[7] = s) : s = e[7], s;
|
|
3837
|
+
}
|
|
3838
|
+
let s;
|
|
3839
|
+
e[8] !== r || e[9] !== t || e[10] !== n ? (s = No(n, r, Fo(t)), e[8] = r, e[9] = t, e[10] = n, e[11] = s) : s = e[11];
|
|
3799
3840
|
let c = s, l;
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3841
|
+
e[12] !== r || e[13] !== n ? (l = Po(n, r), e[12] = r, e[13] = n, e[14] = l) : l = e[14];
|
|
3842
|
+
let u = l, d;
|
|
3843
|
+
return e[15] !== u || e[16] !== r || e[17] !== c || e[18] !== i ? (d = {
|
|
3844
|
+
title: c,
|
|
3845
|
+
more: void 0,
|
|
3846
|
+
detail: u,
|
|
3847
|
+
isSentence: !1,
|
|
3803
3848
|
tone: i,
|
|
3804
3849
|
groupStatus: r
|
|
3805
|
-
}, e[
|
|
3850
|
+
}, e[15] = u, e[16] = r, e[17] = c, e[18] = i, e[19] = d) : d = e[19], d;
|
|
3806
3851
|
}
|
|
3807
|
-
function
|
|
3808
|
-
let t = O(
|
|
3809
|
-
t[0] ===
|
|
3810
|
-
let
|
|
3811
|
-
t[2] !==
|
|
3852
|
+
function Uo(e) {
|
|
3853
|
+
let t = O(14), { title: n, suffix: r, children: i } = e, a = Ho(), { 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;
|
|
3854
|
+
t[0] === f ? h = t[1] : (h = k("max-w-full min-w-0 truncate", f), t[0] = f, t[1] = h);
|
|
3855
|
+
let g;
|
|
3856
|
+
t[2] !== p || t[3] !== m || t[4] !== h || t[5] !== u ? (g = /* @__PURE__ */ M(W, {
|
|
3812
3857
|
as: "span",
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3858
|
+
dir: p,
|
|
3859
|
+
enabled: m,
|
|
3860
|
+
className: h,
|
|
3861
|
+
children: u
|
|
3862
|
+
}), t[2] = p, t[3] = m, t[4] = h, t[5] = u, t[6] = g) : g = t[6];
|
|
3863
|
+
let _;
|
|
3864
|
+
t[7] !== d || t[8] !== f ? (_ = d !== void 0 && /* @__PURE__ */ N("span", {
|
|
3865
|
+
dir: "ltr",
|
|
3866
|
+
className: k("shrink-0 tabular-nums", f),
|
|
3867
|
+
children: ["+", d]
|
|
3868
|
+
}), t[7] = d, t[8] = f, t[9] = _) : _ = t[9];
|
|
3869
|
+
let v;
|
|
3870
|
+
return t[10] !== i || t[11] !== g || t[12] !== _ ? (v = /* @__PURE__ */ N("span", {
|
|
3819
3871
|
className: "flex min-w-0 items-center gap-1.5",
|
|
3820
|
-
children: [
|
|
3821
|
-
|
|
3872
|
+
children: [
|
|
3873
|
+
g,
|
|
3874
|
+
_,
|
|
3875
|
+
i
|
|
3876
|
+
]
|
|
3877
|
+
}), t[10] = i, t[11] = g, t[12] = _, t[13] = v) : v = t[13], v;
|
|
3822
3878
|
}
|
|
3823
|
-
function
|
|
3824
|
-
let e = O(2), { tone: t } =
|
|
3879
|
+
function Wo() {
|
|
3880
|
+
let e = O(2), { tone: t } = zo(), n;
|
|
3825
3881
|
return e[0] === t.chevron ? n = e[1] : (n = /* @__PURE__ */ M(cn, { className: t.chevron }), e[0] = t.chevron, e[1] = n), n;
|
|
3826
3882
|
}
|
|
3827
|
-
function
|
|
3828
|
-
let t = O(
|
|
3883
|
+
function Go(e) {
|
|
3884
|
+
let t = O(6), { detail: n } = e, { title: r, detail: i, isSentence: a, tone: o } = Ho();
|
|
3829
3885
|
if (n === null) return null;
|
|
3830
|
-
let
|
|
3831
|
-
if (!
|
|
3832
|
-
let
|
|
3833
|
-
t[0] ===
|
|
3834
|
-
let
|
|
3835
|
-
return t[2] !==
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3886
|
+
let s = n ?? i;
|
|
3887
|
+
if (!s || s === r) return null;
|
|
3888
|
+
let c = n === void 0 && a ? "auto" : void 0, l;
|
|
3889
|
+
t[0] === o.detail ? l = t[1] : (l = k("block truncate text-start text-xs", o.detail), t[0] = o.detail, t[1] = l);
|
|
3890
|
+
let u;
|
|
3891
|
+
return t[2] !== s || t[3] !== c || t[4] !== l ? (u = /* @__PURE__ */ M("span", {
|
|
3892
|
+
dir: c,
|
|
3893
|
+
className: l,
|
|
3894
|
+
children: s
|
|
3895
|
+
}), t[2] = s, t[3] = c, t[4] = l, t[5] = u) : u = t[5], u;
|
|
3839
3896
|
}
|
|
3840
|
-
function
|
|
3841
|
-
let t = O(14), { children: n } = e, { items: r, messageId: i, groupStatus: a } =
|
|
3897
|
+
function Ko(e) {
|
|
3898
|
+
let t = O(14), { children: n } = e, { items: r, messageId: i, groupStatus: a } = zo(), o = a === "running", s;
|
|
3842
3899
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (s = {
|
|
3843
3900
|
initial: "instant",
|
|
3844
3901
|
resize: "instant"
|
|
@@ -3847,8 +3904,8 @@ function Wo(e) {
|
|
|
3847
3904
|
t[1] === d ? f = t[2] : (f = k("mt-2", d), t[1] = d, t[2] = f);
|
|
3848
3905
|
let p = o ? l : void 0, m;
|
|
3849
3906
|
t[3] !== n || t[4] !== r || t[5] !== i ? (m = n ?? r.map((e, t) => {
|
|
3850
|
-
let { segment: n } = e, r = `${i}-${
|
|
3851
|
-
return n.kind === "tool" ? /* @__PURE__ */ M(
|
|
3907
|
+
let { segment: n } = e, r = `${i}-${oa(n, t)}-${n.kind}`;
|
|
3908
|
+
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;
|
|
3852
3909
|
}), t[3] = n, t[4] = r, t[5] = i, t[6] = m) : m = t[6];
|
|
3853
3910
|
let h;
|
|
3854
3911
|
t[7] !== p || t[8] !== m ? (h = /* @__PURE__ */ M("div", {
|
|
@@ -3862,11 +3919,11 @@ function Wo(e) {
|
|
|
3862
3919
|
children: h
|
|
3863
3920
|
}), t[10] = u, t[11] = f, t[12] = h, t[13] = g) : g = t[13], g;
|
|
3864
3921
|
}
|
|
3865
|
-
function
|
|
3866
|
-
let t = O(19), { item: n, textClassName: r } = e, i = r === void 0 ? "my-4" : r, { elements: a } =
|
|
3922
|
+
function qo(e) {
|
|
3923
|
+
let t = O(19), { item: n, textClassName: r } = e, i = r === void 0 ? "my-4" : r, { elements: a } = G(), { segment: o } = n;
|
|
3867
3924
|
if (o.kind === "text") {
|
|
3868
3925
|
let e;
|
|
3869
|
-
t[0] === o.parts ? e = t[1] : (e = o.parts.filter(
|
|
3926
|
+
t[0] === o.parts ? e = t[1] : (e = o.parts.filter(Jo), t[0] = o.parts, t[1] = e);
|
|
3870
3927
|
let n = e;
|
|
3871
3928
|
if (n.length === 0) return null;
|
|
3872
3929
|
let r;
|
|
@@ -3875,7 +3932,7 @@ function Go(e) {
|
|
|
3875
3932
|
parts: n
|
|
3876
3933
|
}, t[2] = o, t[3] = n, t[4] = r) : r = t[4];
|
|
3877
3934
|
let s;
|
|
3878
|
-
return t[5] !== a || t[6] !== r || t[7] !== i ? (s = /* @__PURE__ */ M(
|
|
3935
|
+
return t[5] !== a || t[6] !== r || t[7] !== i ? (s = /* @__PURE__ */ M(Z.Text, {
|
|
3879
3936
|
segment: r,
|
|
3880
3937
|
elements: a,
|
|
3881
3938
|
className: i
|
|
@@ -3883,75 +3940,75 @@ function Go(e) {
|
|
|
3883
3940
|
}
|
|
3884
3941
|
if (o.kind === "file") {
|
|
3885
3942
|
let e;
|
|
3886
|
-
return t[9] === o ? e = t[10] : (e = /* @__PURE__ */ M(
|
|
3943
|
+
return t[9] === o ? e = t[10] : (e = /* @__PURE__ */ M(Z.File, { segment: o }), t[9] = o, t[10] = e), e;
|
|
3887
3944
|
}
|
|
3888
3945
|
if (o.kind === "source") {
|
|
3889
3946
|
let e;
|
|
3890
|
-
return t[11] === o ? e = t[12] : (e = /* @__PURE__ */ M(
|
|
3947
|
+
return t[11] === o ? e = t[12] : (e = /* @__PURE__ */ M(Z.Source, { segment: o }), t[11] = o, t[12] = e), e;
|
|
3891
3948
|
}
|
|
3892
3949
|
if (o.kind === "tool") {
|
|
3893
3950
|
let e;
|
|
3894
|
-
return t[13] === o ? e = t[14] : (e = /* @__PURE__ */ M(
|
|
3951
|
+
return t[13] === o ? e = t[14] : (e = /* @__PURE__ */ M(Z.Tool, { segment: o }), t[13] = o, t[14] = e), e;
|
|
3895
3952
|
}
|
|
3896
3953
|
if (o.kind === "reasoning") {
|
|
3897
3954
|
let e;
|
|
3898
|
-
return t[15] === o ? e = t[16] : (e = /* @__PURE__ */ M(
|
|
3955
|
+
return t[15] === o ? e = t[16] : (e = /* @__PURE__ */ M(Z.Reasoning, { segment: o }), t[15] = o, t[16] = e), e;
|
|
3899
3956
|
}
|
|
3900
3957
|
if (o.kind === "dynamic-tool") {
|
|
3901
3958
|
let e;
|
|
3902
|
-
return t[17] === o ? e = t[18] : (e = /* @__PURE__ */ M(
|
|
3959
|
+
return t[17] === o ? e = t[18] : (e = /* @__PURE__ */ M(Z.DynamicTool, { segment: o }), t[17] = o, t[18] = e), e;
|
|
3903
3960
|
}
|
|
3904
3961
|
return null;
|
|
3905
3962
|
}
|
|
3906
|
-
function
|
|
3963
|
+
function Jo(e) {
|
|
3907
3964
|
let { part: t } = e;
|
|
3908
3965
|
return !Wi(t);
|
|
3909
3966
|
}
|
|
3910
|
-
var
|
|
3911
|
-
Group:
|
|
3912
|
-
GroupTrigger:
|
|
3913
|
-
GroupTitle:
|
|
3914
|
-
GroupChevron:
|
|
3915
|
-
GroupDetail:
|
|
3916
|
-
GroupContent:
|
|
3917
|
-
Segment:
|
|
3967
|
+
var Yo = {
|
|
3968
|
+
Group: Bo,
|
|
3969
|
+
GroupTrigger: Vo,
|
|
3970
|
+
GroupTitle: Uo,
|
|
3971
|
+
GroupChevron: Wo,
|
|
3972
|
+
GroupDetail: Go,
|
|
3973
|
+
GroupContent: Ko,
|
|
3974
|
+
Segment: qo
|
|
3918
3975
|
};
|
|
3919
|
-
function
|
|
3920
|
-
let e = O(1), t =
|
|
3921
|
-
if (t !== "ready" && t !== "error" &&
|
|
3976
|
+
function Xo() {
|
|
3977
|
+
let e = O(1), t = K(), { messages: n } = G(), { debugMode: r } = z(), i = n[n.length - 1];
|
|
3978
|
+
if (t !== "ready" && t !== "error" && Io(i, r)) return null;
|
|
3922
3979
|
let a;
|
|
3923
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(
|
|
3980
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(Oa, {}), e[0] = a) : a = e[0], a;
|
|
3924
3981
|
}
|
|
3925
|
-
var
|
|
3926
|
-
Root:
|
|
3927
|
-
List:
|
|
3928
|
-
Item:
|
|
3929
|
-
UserBubble:
|
|
3982
|
+
var Zo = {
|
|
3983
|
+
Root: ya,
|
|
3984
|
+
List: ba,
|
|
3985
|
+
Item: xa,
|
|
3986
|
+
UserBubble: so,
|
|
3930
3987
|
AssistantContent: c(function(e) {
|
|
3931
|
-
let t = O(5), { className: n } = e, r =
|
|
3932
|
-
t[0] === r ? i = t[1] : (i = r.map(
|
|
3988
|
+
let t = O(5), { className: n } = e, r = Lo(), i;
|
|
3989
|
+
t[0] === r ? i = t[1] : (i = r.map(Qo), t[0] = r, t[1] = i);
|
|
3933
3990
|
let a;
|
|
3934
3991
|
return t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M("div", {
|
|
3935
3992
|
className: n,
|
|
3936
3993
|
children: i
|
|
3937
3994
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
3938
3995
|
}),
|
|
3939
|
-
Actions:
|
|
3940
|
-
CopyAction:
|
|
3941
|
-
RegenerateAction:
|
|
3942
|
-
CopyDebugJsonAction:
|
|
3943
|
-
Thinking:
|
|
3944
|
-
Error:
|
|
3996
|
+
Actions: pa,
|
|
3997
|
+
CopyAction: ma,
|
|
3998
|
+
RegenerateAction: ha,
|
|
3999
|
+
CopyDebugJsonAction: ga,
|
|
4000
|
+
Thinking: Xo,
|
|
4001
|
+
Error: va
|
|
3945
4002
|
};
|
|
3946
|
-
function
|
|
3947
|
-
return e.kind === "group" ? /* @__PURE__ */ N(
|
|
4003
|
+
function Qo(e) {
|
|
4004
|
+
return e.kind === "group" ? /* @__PURE__ */ N(Bo, {
|
|
3948
4005
|
group: e,
|
|
3949
|
-
children: [/* @__PURE__ */ N(
|
|
3950
|
-
}, e.key) : /* @__PURE__ */ M(
|
|
4006
|
+
children: [/* @__PURE__ */ N(Vo, { children: [/* @__PURE__ */ M(Uo, { children: /* @__PURE__ */ M(Wo, {}) }), /* @__PURE__ */ M(Go, {})] }), /* @__PURE__ */ M(Ko, {})]
|
|
4007
|
+
}, e.key) : /* @__PURE__ */ M(qo, { item: e }, e.key);
|
|
3951
4008
|
}
|
|
3952
4009
|
//#endregion
|
|
3953
4010
|
//#region src/lib/chat/trajectory/trajectories/messages.tsx
|
|
3954
|
-
function
|
|
4011
|
+
function $o(e) {
|
|
3955
4012
|
let t = O(8), { message: n, className: r } = e, i;
|
|
3956
4013
|
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);
|
|
3957
4014
|
let a;
|
|
@@ -3964,7 +4021,27 @@ function Zo(e) {
|
|
|
3964
4021
|
children: [a, o]
|
|
3965
4022
|
}), t[5] = i, t[6] = o, t[7] = s) : s = t[7], s;
|
|
3966
4023
|
}
|
|
3967
|
-
function
|
|
4024
|
+
function es(e) {
|
|
4025
|
+
let t = O(9), { name: n, args: r } = e, i;
|
|
4026
|
+
t[0] === r ? i = t[1] : (i = r ? Object.values(r)[0] : void 0, t[0] = r, t[1] = i);
|
|
4027
|
+
let a = i, o;
|
|
4028
|
+
t[2] === n ? o = t[3] : (o = /* @__PURE__ */ M("span", {
|
|
4029
|
+
className: "ms-2 font-mono",
|
|
4030
|
+
children: n
|
|
4031
|
+
}), t[2] = n, t[3] = o);
|
|
4032
|
+
let s;
|
|
4033
|
+
t[4] === a ? s = t[5] : (s = a && /* @__PURE__ */ N("span", {
|
|
4034
|
+
className: "truncate",
|
|
4035
|
+
children: [
|
|
4036
|
+
"(",
|
|
4037
|
+
a,
|
|
4038
|
+
")"
|
|
4039
|
+
]
|
|
4040
|
+
}), t[4] = a, t[5] = s);
|
|
4041
|
+
let c;
|
|
4042
|
+
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;
|
|
4043
|
+
}
|
|
4044
|
+
function ts(e) {
|
|
3968
4045
|
let t = O(15), { part: n } = e, r = z(), i, a;
|
|
3969
4046
|
if (t[0] !== r.registry || t[1] !== n) {
|
|
3970
4047
|
a = Symbol.for("react.early_return_sentinel");
|
|
@@ -3976,24 +4053,17 @@ function Qo(e) {
|
|
|
3976
4053
|
a = null;
|
|
3977
4054
|
break bb0;
|
|
3978
4055
|
}
|
|
3979
|
-
let r = t.icon
|
|
4056
|
+
let r = t.icon;
|
|
3980
4057
|
a = /* @__PURE__ */ N("div", {
|
|
3981
4058
|
className: "text-muted-foreground flex items-center text-xs",
|
|
3982
|
-
children: [
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
children: [
|
|
3991
|
-
"(",
|
|
3992
|
-
i,
|
|
3993
|
-
")"
|
|
3994
|
-
]
|
|
3995
|
-
})
|
|
3996
|
-
]
|
|
4059
|
+
children: [r && /* @__PURE__ */ M(r, { className: "size-3.5" }), t.kind === "sentence" ? /* @__PURE__ */ M("span", {
|
|
4060
|
+
dir: "auto",
|
|
4061
|
+
className: "ms-2 truncate text-start",
|
|
4062
|
+
children: t.text
|
|
4063
|
+
}) : /* @__PURE__ */ M(es, {
|
|
4064
|
+
name: t.name,
|
|
4065
|
+
args: t.args
|
|
4066
|
+
})]
|
|
3997
4067
|
});
|
|
3998
4068
|
break bb0;
|
|
3999
4069
|
}
|
|
@@ -4008,7 +4078,7 @@ function Qo(e) {
|
|
|
4008
4078
|
part: n
|
|
4009
4079
|
}), t[4] = o, t[5] = n, t[6] = s) : s = t[6];
|
|
4010
4080
|
let c;
|
|
4011
|
-
t[7] === o ? c = t[8] : (c = o?.isError && o.detail && /* @__PURE__ */ M(
|
|
4081
|
+
t[7] === o ? c = t[8] : (c = o?.isError && o.detail && /* @__PURE__ */ M($o, { message: o.detail }), t[7] = o, t[8] = c);
|
|
4012
4082
|
let l;
|
|
4013
4083
|
t[9] === n ? l = t[10] : (l = /* @__PURE__ */ M(Ii, { part: n }), t[9] = n, t[10] = l);
|
|
4014
4084
|
let u;
|
|
@@ -4018,9 +4088,9 @@ function Qo(e) {
|
|
|
4018
4088
|
l
|
|
4019
4089
|
] }), t[11] = s, t[12] = c, t[13] = l, t[14] = u) : u = t[14], u;
|
|
4020
4090
|
}
|
|
4021
|
-
function
|
|
4091
|
+
function ns(e) {
|
|
4022
4092
|
let t = O(5), { part: n } = e, [r, i] = g(!1), a;
|
|
4023
|
-
t[0] === n.text ? a = t[1] : (a = /* @__PURE__ */ M(
|
|
4093
|
+
t[0] === n.text ? a = t[1] : (a = /* @__PURE__ */ M(Y, {
|
|
4024
4094
|
mode: "static",
|
|
4025
4095
|
children: n.text
|
|
4026
4096
|
}), t[0] = n.text, t[1] = a);
|
|
@@ -4028,7 +4098,7 @@ function $o(e) {
|
|
|
4028
4098
|
return t[2] !== r || t[3] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
4029
4099
|
"data-copy-exclude": "assistant-snapshot",
|
|
4030
4100
|
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",
|
|
4031
|
-
children: /* @__PURE__ */ M(
|
|
4101
|
+
children: /* @__PURE__ */ M(qa, {
|
|
4032
4102
|
label: "Reasoning",
|
|
4033
4103
|
open: r,
|
|
4034
4104
|
onOpenChange: i,
|
|
@@ -4039,8 +4109,8 @@ function $o(e) {
|
|
|
4039
4109
|
})
|
|
4040
4110
|
}), t[2] = r, t[3] = a, t[4] = o) : o = t[4], o;
|
|
4041
4111
|
}
|
|
4042
|
-
function
|
|
4043
|
-
let t = O(16), { part: n } = e, { elements: r } =
|
|
4112
|
+
function rs(e) {
|
|
4113
|
+
let t = O(16), { part: n } = e, { elements: r } = G(), i = Li();
|
|
4044
4114
|
if (n.type === "text") {
|
|
4045
4115
|
if (Wi(n)) return null;
|
|
4046
4116
|
let e;
|
|
@@ -4056,11 +4126,11 @@ function es(e) {
|
|
|
4056
4126
|
}
|
|
4057
4127
|
if (S(n)) {
|
|
4058
4128
|
let e;
|
|
4059
|
-
return t[7] === n ? e = t[8] : (e = /* @__PURE__ */ M(
|
|
4129
|
+
return t[7] === n ? e = t[8] : (e = /* @__PURE__ */ M(ts, { part: n }), t[7] = n, t[8] = e), e;
|
|
4060
4130
|
}
|
|
4061
4131
|
if (n.type === "reasoning" && n.text) {
|
|
4062
4132
|
let e;
|
|
4063
|
-
return t[9] !== i || t[10] !== n ? (e = i ? /* @__PURE__ */ M(
|
|
4133
|
+
return t[9] !== i || t[10] !== n ? (e = i ? /* @__PURE__ */ M(ns, { part: n }) : null, t[9] = i, t[10] = n, t[11] = e) : e = t[11], e;
|
|
4064
4134
|
}
|
|
4065
4135
|
if (n.type === "file") {
|
|
4066
4136
|
let e;
|
|
@@ -4072,13 +4142,13 @@ function es(e) {
|
|
|
4072
4142
|
}
|
|
4073
4143
|
return null;
|
|
4074
4144
|
}
|
|
4075
|
-
var
|
|
4076
|
-
let t = O(10), { className: n } = e, { message: r } =
|
|
4145
|
+
var is = c(function(e) {
|
|
4146
|
+
let t = O(10), { className: n } = e, { message: r } = q(), i;
|
|
4077
4147
|
t[0] === n ? i = t[1] : (i = k("flex-1 space-y-3", n), t[0] = n, t[1] = i);
|
|
4078
4148
|
let a;
|
|
4079
4149
|
if (t[2] !== r.id || t[3] !== r.parts) {
|
|
4080
4150
|
let e;
|
|
4081
|
-
t[5] === r.id ? e = t[6] : (e = (e, t) => /* @__PURE__ */ M(
|
|
4151
|
+
t[5] === r.id ? e = t[6] : (e = (e, t) => /* @__PURE__ */ M(rs, { 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;
|
|
4082
4152
|
} else a = t[4];
|
|
4083
4153
|
let o;
|
|
4084
4154
|
return t[7] !== i || t[8] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
@@ -4086,13 +4156,13 @@ var ts = c(function(e) {
|
|
|
4086
4156
|
children: a
|
|
4087
4157
|
}), t[7] = i, t[8] = a, t[9] = o) : o = t[9], o;
|
|
4088
4158
|
});
|
|
4089
|
-
function
|
|
4159
|
+
function as(e) {
|
|
4090
4160
|
let t = O(9), { className: n, label: r } = e, i;
|
|
4091
|
-
t[0] === r ? i = t[1] : (i = r && r.split("\n").filter(
|
|
4161
|
+
t[0] === r ? i = t[1] : (i = r && r.split("\n").filter(os).pop() || "Thinking...", t[0] = r, t[1] = i);
|
|
4092
4162
|
let a = i, o;
|
|
4093
4163
|
t[2] === n ? o = t[3] : (o = k("flex items-start", n), t[2] = n, t[3] = o);
|
|
4094
4164
|
let s;
|
|
4095
|
-
t[4] === a ? s = t[5] : (s = /* @__PURE__ */ M(
|
|
4165
|
+
t[4] === a ? s = t[5] : (s = /* @__PURE__ */ M(W, {
|
|
4096
4166
|
className: "text-muted-foreground line-clamp-2 text-sm",
|
|
4097
4167
|
children: a
|
|
4098
4168
|
}), t[4] = a, t[5] = s);
|
|
@@ -4103,33 +4173,33 @@ function ns(e) {
|
|
|
4103
4173
|
children: s
|
|
4104
4174
|
}), t[6] = o, t[7] = s, t[8] = c) : c = t[8], c;
|
|
4105
4175
|
}
|
|
4106
|
-
function
|
|
4176
|
+
function os(e) {
|
|
4107
4177
|
return e.trim();
|
|
4108
4178
|
}
|
|
4109
|
-
function
|
|
4110
|
-
let e = O(5), t =
|
|
4111
|
-
e[0] !== t || e[1] !== r ? (i =
|
|
4179
|
+
function ss() {
|
|
4180
|
+
let e = O(5), t = K(), { messages: n } = G(), r = n[n.length - 1], i;
|
|
4181
|
+
e[0] !== t || e[1] !== r ? (i = Ta(t, r), e[0] = t, e[1] = r, e[2] = i) : i = e[2];
|
|
4112
4182
|
let a = i;
|
|
4113
4183
|
if (!a) return null;
|
|
4114
4184
|
let o;
|
|
4115
|
-
return e[3] === a ? o = e[4] : (o = /* @__PURE__ */ M(
|
|
4185
|
+
return e[3] === a ? o = e[4] : (o = /* @__PURE__ */ M(as, {
|
|
4116
4186
|
label: a,
|
|
4117
4187
|
className: "mt-2"
|
|
4118
4188
|
}), e[3] = a, e[4] = o), o;
|
|
4119
4189
|
}
|
|
4120
|
-
var
|
|
4121
|
-
Root:
|
|
4122
|
-
List:
|
|
4123
|
-
Item:
|
|
4124
|
-
UserBubble:
|
|
4125
|
-
AssistantContent:
|
|
4126
|
-
Thinking:
|
|
4127
|
-
Error:
|
|
4128
|
-
Actions:
|
|
4129
|
-
CopyAction:
|
|
4130
|
-
RegenerateAction:
|
|
4131
|
-
CopyDebugJsonAction:
|
|
4132
|
-
},
|
|
4190
|
+
var cs = {
|
|
4191
|
+
Root: ya,
|
|
4192
|
+
List: ba,
|
|
4193
|
+
Item: xa,
|
|
4194
|
+
UserBubble: so,
|
|
4195
|
+
AssistantContent: is,
|
|
4196
|
+
Thinking: ss,
|
|
4197
|
+
Error: va,
|
|
4198
|
+
Actions: pa,
|
|
4199
|
+
CopyAction: ma,
|
|
4200
|
+
RegenerateAction: ha,
|
|
4201
|
+
CopyDebugJsonAction: ga
|
|
4202
|
+
}, ls = {
|
|
4133
4203
|
braille: {
|
|
4134
4204
|
frames: [
|
|
4135
4205
|
"⠋",
|
|
@@ -4196,10 +4266,10 @@ var as = {
|
|
|
4196
4266
|
interval: 100
|
|
4197
4267
|
}
|
|
4198
4268
|
};
|
|
4199
|
-
function
|
|
4269
|
+
function us(e) {
|
|
4200
4270
|
let t = O(15), n, r, i;
|
|
4201
4271
|
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);
|
|
4202
|
-
let a = i === void 0 ? "braille" : i, o = St(), { frames: s, interval: c } =
|
|
4272
|
+
let a = i === void 0 ? "braille" : i, o = St(), { frames: s, interval: c } = ls[a], [l, u] = g(0), f, p;
|
|
4203
4273
|
t[4] !== o || t[5] !== s.length || t[6] !== c ? (f = () => {
|
|
4204
4274
|
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
4205
4275
|
let e = o.setInterval(() => {
|
|
@@ -4224,9 +4294,9 @@ function ss(e) {
|
|
|
4224
4294
|
}
|
|
4225
4295
|
//#endregion
|
|
4226
4296
|
//#region src/lib/chat/trajectory/trajectories/timeline.tsx
|
|
4227
|
-
function
|
|
4297
|
+
function ds(e) {
|
|
4228
4298
|
let t = O(11), { Icon: n, isLast: r, isLoading: i, aborted: a, state: o, isError: s } = e, c;
|
|
4229
|
-
t[0] !== n || t[1] !== a || t[2] !== s || t[3] !== i || t[4] !== o ? (c = i ? /* @__PURE__ */ M(
|
|
4299
|
+
t[0] !== n || t[1] !== a || t[2] !== s || t[3] !== i || t[4] !== o ? (c = i ? /* @__PURE__ */ M(us, { 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];
|
|
4230
4300
|
let l;
|
|
4231
4301
|
t[6] === r ? l = t[7] : (l = !r && /* @__PURE__ */ M("span", { className: "bg-border w-px flex-1" }), t[6] = r, t[7] = l);
|
|
4232
4302
|
let u;
|
|
@@ -4235,16 +4305,16 @@ function cs(e) {
|
|
|
4235
4305
|
children: [c, l]
|
|
4236
4306
|
}), t[8] = c, t[9] = l, t[10] = u) : u = t[10], u;
|
|
4237
4307
|
}
|
|
4238
|
-
function
|
|
4308
|
+
function fs(e) {
|
|
4239
4309
|
let t = O(15), { isLast: n, label: r, state: i, aborted: a, children: o } = e, s = l(Zi), 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;
|
|
4240
|
-
t[0] !== f || t[1] !== d || t[2] !== c?.isError || t[3] !== u || t[4] !== n || t[5] !== p ? (m = f ? /* @__PURE__ */ M(
|
|
4310
|
+
t[0] !== f || t[1] !== d || t[2] !== c?.isError || t[3] !== u || t[4] !== n || t[5] !== p ? (m = f ? /* @__PURE__ */ M(ds, {
|
|
4241
4311
|
Icon: f,
|
|
4242
4312
|
isLast: n,
|
|
4243
4313
|
isLoading: p,
|
|
4244
4314
|
aborted: d,
|
|
4245
4315
|
state: u,
|
|
4246
4316
|
isError: c?.isError ?? !1
|
|
4247
|
-
}) : /* @__PURE__ */ M(
|
|
4317
|
+
}) : /* @__PURE__ */ M(Ea, { 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];
|
|
4248
4318
|
let h = m, g = n ? "" : "pb-3.5", _;
|
|
4249
4319
|
t[7] === g ? _ = t[8] : (_ = k("min-w-0 flex-1", g), t[7] = g, t[8] = _);
|
|
4250
4320
|
let v;
|
|
@@ -4253,12 +4323,12 @@ function ls(e) {
|
|
|
4253
4323
|
children: o
|
|
4254
4324
|
}), t[9] = o, t[10] = _, t[11] = v) : v = t[11];
|
|
4255
4325
|
let y;
|
|
4256
|
-
return t[12] !== h || t[13] !== v ? (y = /* @__PURE__ */ M(
|
|
4326
|
+
return t[12] !== h || t[13] !== v ? (y = /* @__PURE__ */ M(Da, {
|
|
4257
4327
|
marker: h,
|
|
4258
4328
|
children: v
|
|
4259
4329
|
}), t[12] = h, t[13] = v, t[14] = y) : y = t[14], y;
|
|
4260
4330
|
}
|
|
4261
|
-
function
|
|
4331
|
+
function ps(e) {
|
|
4262
4332
|
let t = O(10), { label: n, state: r, part: i, defaultOpen: a, children: o } = e, s = a !== void 0 && a, c;
|
|
4263
4333
|
t[0] !== n || t[1] !== i || t[2] !== r ? (c = /* @__PURE__ */ M(L, {
|
|
4264
4334
|
className: "cursor-pointer",
|
|
@@ -4277,33 +4347,33 @@ function us(e) {
|
|
|
4277
4347
|
children: [c, l]
|
|
4278
4348
|
}), t[6] = s, t[7] = c, t[8] = l, t[9] = u) : u = t[9], u;
|
|
4279
4349
|
}
|
|
4280
|
-
var
|
|
4281
|
-
Item:
|
|
4282
|
-
Disclosure:
|
|
4283
|
-
},
|
|
4284
|
-
Root:
|
|
4285
|
-
List:
|
|
4286
|
-
Item:
|
|
4287
|
-
UserBubble:
|
|
4350
|
+
var ms = {
|
|
4351
|
+
Item: fs,
|
|
4352
|
+
Disclosure: ps
|
|
4353
|
+
}, hs = {
|
|
4354
|
+
Root: ya,
|
|
4355
|
+
List: ba,
|
|
4356
|
+
Item: xa,
|
|
4357
|
+
UserBubble: so,
|
|
4288
4358
|
AssistantContent: c(function(e) {
|
|
4289
|
-
let t = O(12), { className: n } = e, { message: r } =
|
|
4359
|
+
let t = O(12), { className: n } = e, { message: r } = q(), { elements: i } = G(), { debugMode: a } = z(), o = Li(), s = X(), c;
|
|
4290
4360
|
t[0] === r.parts ? c = t[1] : (c = aa(r.parts), t[0] = r.parts, t[1] = c);
|
|
4291
4361
|
let l = c, u;
|
|
4292
4362
|
t[2] !== a || t[3] !== i || t[4] !== s || t[5] !== r.id || t[6] !== l || t[7] !== o ? (u = l.map((e, t) => {
|
|
4293
|
-
let n = `${r.id}-${
|
|
4294
|
-
if (e.kind === "text") return /* @__PURE__ */ M(
|
|
4363
|
+
let n = `${r.id}-${oa(e, t)}-${e.kind}`;
|
|
4364
|
+
if (e.kind === "text") return /* @__PURE__ */ M(Z.Text, {
|
|
4295
4365
|
segment: e,
|
|
4296
4366
|
elements: i,
|
|
4297
4367
|
className: "my-4"
|
|
4298
4368
|
}, n);
|
|
4299
|
-
if (e.kind === "file") return /* @__PURE__ */ M(
|
|
4300
|
-
if (e.kind === "source") return /* @__PURE__ */ M(
|
|
4369
|
+
if (e.kind === "file") return /* @__PURE__ */ M(Z.File, { segment: e }, n);
|
|
4370
|
+
if (e.kind === "source") return /* @__PURE__ */ M(Z.Source, { segment: e }, n);
|
|
4301
4371
|
if (e.kind === "dynamic-tool") {
|
|
4302
4372
|
if (!o) return null;
|
|
4303
4373
|
let r = !ia(l, t, !0);
|
|
4304
|
-
return /* @__PURE__ */ M(
|
|
4374
|
+
return /* @__PURE__ */ M(ms.Item, {
|
|
4305
4375
|
isLast: r,
|
|
4306
|
-
children: /* @__PURE__ */ M(
|
|
4376
|
+
children: /* @__PURE__ */ M(Z.DynamicTool, { segment: e })
|
|
4307
4377
|
}, n);
|
|
4308
4378
|
}
|
|
4309
4379
|
if (e.kind === "reasoning") {
|
|
@@ -4313,22 +4383,22 @@ var ds = {
|
|
|
4313
4383
|
icon: Je,
|
|
4314
4384
|
args: { text: [...e.part.text].slice(0, 60).join("") }
|
|
4315
4385
|
};
|
|
4316
|
-
return /* @__PURE__ */ M(
|
|
4386
|
+
return /* @__PURE__ */ M(ms.Item, {
|
|
4317
4387
|
isLast: r,
|
|
4318
4388
|
label: i,
|
|
4319
|
-
children: /* @__PURE__ */ M(
|
|
4389
|
+
children: /* @__PURE__ */ M(ms.Disclosure, {
|
|
4320
4390
|
label: i,
|
|
4321
|
-
children: /* @__PURE__ */ M(
|
|
4391
|
+
children: /* @__PURE__ */ M(Z.Reasoning, { segment: e })
|
|
4322
4392
|
})
|
|
4323
4393
|
}, n);
|
|
4324
4394
|
}
|
|
4325
4395
|
if (e.kind === "tool") {
|
|
4326
4396
|
let r = !ia(l, t, a);
|
|
4327
|
-
return /* @__PURE__ */ M(
|
|
4397
|
+
return /* @__PURE__ */ M(Z.Tool, {
|
|
4328
4398
|
segment: e,
|
|
4329
|
-
children: /* @__PURE__ */ M(
|
|
4399
|
+
children: /* @__PURE__ */ M(ms.Item, {
|
|
4330
4400
|
isLast: r,
|
|
4331
|
-
children: /* @__PURE__ */ M(
|
|
4401
|
+
children: /* @__PURE__ */ M(Z.ToolDisclosure, {})
|
|
4332
4402
|
})
|
|
4333
4403
|
}, n);
|
|
4334
4404
|
}
|
|
@@ -4340,16 +4410,16 @@ var ds = {
|
|
|
4340
4410
|
children: u
|
|
4341
4411
|
}), t[9] = n, t[10] = u, t[11] = d) : d = t[11], d;
|
|
4342
4412
|
}),
|
|
4343
|
-
Actions:
|
|
4344
|
-
CopyAction:
|
|
4345
|
-
RegenerateAction:
|
|
4346
|
-
CopyDebugJsonAction:
|
|
4347
|
-
Thinking:
|
|
4348
|
-
Error:
|
|
4413
|
+
Actions: pa,
|
|
4414
|
+
CopyAction: ma,
|
|
4415
|
+
RegenerateAction: ha,
|
|
4416
|
+
CopyDebugJsonAction: ga,
|
|
4417
|
+
Thinking: Oa,
|
|
4418
|
+
Error: va
|
|
4349
4419
|
};
|
|
4350
4420
|
//#endregion
|
|
4351
4421
|
//#region src/lib/components/ChatComposer.tsx
|
|
4352
|
-
function
|
|
4422
|
+
function gs(e) {
|
|
4353
4423
|
let t = O(9), n, r;
|
|
4354
4424
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4355
4425
|
let { hasSubmitted: i } = V(), a;
|
|
@@ -4361,7 +4431,7 @@ function ps(e) {
|
|
|
4361
4431
|
...r
|
|
4362
4432
|
}), t[5] = i, t[6] = r, t[7] = a, t[8] = o) : o = t[8], o;
|
|
4363
4433
|
}
|
|
4364
|
-
function
|
|
4434
|
+
function _s(e) {
|
|
4365
4435
|
let t = O(8), n, r;
|
|
4366
4436
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4367
4437
|
let i;
|
|
@@ -4372,7 +4442,7 @@ function ms(e) {
|
|
|
4372
4442
|
...r
|
|
4373
4443
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4374
4444
|
}
|
|
4375
|
-
function
|
|
4445
|
+
function vs(e) {
|
|
4376
4446
|
let t = O(8), n, r;
|
|
4377
4447
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4378
4448
|
let i;
|
|
@@ -4383,7 +4453,7 @@ function hs(e) {
|
|
|
4383
4453
|
...r
|
|
4384
4454
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4385
4455
|
}
|
|
4386
|
-
function
|
|
4456
|
+
function ys(e) {
|
|
4387
4457
|
let t = O(8), n, r;
|
|
4388
4458
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4389
4459
|
let i;
|
|
@@ -4394,7 +4464,7 @@ function gs(e) {
|
|
|
4394
4464
|
...r
|
|
4395
4465
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4396
4466
|
}
|
|
4397
|
-
function
|
|
4467
|
+
function bs(e) {
|
|
4398
4468
|
let t = O(8), n, r;
|
|
4399
4469
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4400
4470
|
let i;
|
|
@@ -4405,7 +4475,7 @@ function _s(e) {
|
|
|
4405
4475
|
...r
|
|
4406
4476
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4407
4477
|
}
|
|
4408
|
-
function
|
|
4478
|
+
function xs(e) {
|
|
4409
4479
|
let t = O(8), n, r;
|
|
4410
4480
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4411
4481
|
let i;
|
|
@@ -4416,7 +4486,7 @@ function vs(e) {
|
|
|
4416
4486
|
...r
|
|
4417
4487
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4418
4488
|
}
|
|
4419
|
-
function
|
|
4489
|
+
function Ss(e) {
|
|
4420
4490
|
let t = O(3), n;
|
|
4421
4491
|
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];
|
|
4422
4492
|
let r;
|
|
@@ -4426,7 +4496,7 @@ function ys(e) {
|
|
|
4426
4496
|
...e
|
|
4427
4497
|
}), t[1] = e, t[2] = r), r;
|
|
4428
4498
|
}
|
|
4429
|
-
function
|
|
4499
|
+
function Cs() {
|
|
4430
4500
|
let e = O(6), { actions: t, meta: n } = Tt("ChatComposer.CommandButton"), r;
|
|
4431
4501
|
e[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ M(et, { className: "size-4" }), e[0] = r) : r = e[0];
|
|
4432
4502
|
let i = n.activePopup?.trigger === "/", a;
|
|
@@ -4442,7 +4512,7 @@ function bs() {
|
|
|
4442
4512
|
onClick: a
|
|
4443
4513
|
}), e[3] = i, e[4] = a, e[5] = o) : o = e[5], o;
|
|
4444
4514
|
}
|
|
4445
|
-
function
|
|
4515
|
+
function ws(e) {
|
|
4446
4516
|
switch (e) {
|
|
4447
4517
|
case "permission-denied": return "Allow microphone access to use dictation";
|
|
4448
4518
|
case "no-microphone": return "Connect a microphone to use dictation";
|
|
@@ -4451,17 +4521,17 @@ function xs(e) {
|
|
|
4451
4521
|
case "transcription-failed": return "Unable to transcribe audio";
|
|
4452
4522
|
}
|
|
4453
4523
|
}
|
|
4454
|
-
function
|
|
4524
|
+
function Ts(e) {
|
|
4455
4525
|
switch (e.status) {
|
|
4456
4526
|
case "unavailable": return e.reason === "blocked" ? "Allow microphone access in your browser settings to use dictation" : "Dictation is not available in this browser";
|
|
4457
4527
|
case "idle": return "Start dictation";
|
|
4458
4528
|
case "starting": return "Starting dictation";
|
|
4459
4529
|
case "recording": return "Stop dictation";
|
|
4460
4530
|
case "finishing": return "Transcribing…";
|
|
4461
|
-
case "failed": return
|
|
4531
|
+
case "failed": return ws(e.error.code);
|
|
4462
4532
|
}
|
|
4463
4533
|
}
|
|
4464
|
-
function
|
|
4534
|
+
function Es(e) {
|
|
4465
4535
|
switch (e.status) {
|
|
4466
4536
|
case "recording": return /* @__PURE__ */ M(nt, { className: "size-4 fill-current" });
|
|
4467
4537
|
case "starting":
|
|
@@ -4471,11 +4541,11 @@ function Cs(e) {
|
|
|
4471
4541
|
case "failed": return /* @__PURE__ */ M(Qe, { className: "size-4" });
|
|
4472
4542
|
}
|
|
4473
4543
|
}
|
|
4474
|
-
function
|
|
4544
|
+
function Ds() {
|
|
4475
4545
|
let e = O(20), { status: t } = B(), { state: n } = Et("ChatComposer.Dictate"), r;
|
|
4476
|
-
e[0] === n ? r = e[1] : (r =
|
|
4546
|
+
e[0] === n ? r = e[1] : (r = Ts(n), e[0] = n, e[1] = r);
|
|
4477
4547
|
let i = r, a = n.status === "starting" || n.status === "recording" || n.status === "finishing", o = t === "streaming" || t === "submitted", s;
|
|
4478
|
-
e[2] === n ? s = e[3] : (s =
|
|
4548
|
+
e[2] === n ? s = e[3] : (s = Es(n), e[2] = n, e[3] = s);
|
|
4479
4549
|
let c;
|
|
4480
4550
|
e[4] !== i || e[5] !== s ? (c = /* @__PURE__ */ M(Q, {
|
|
4481
4551
|
icon: s,
|
|
@@ -4505,22 +4575,22 @@ function ws() {
|
|
|
4505
4575
|
d
|
|
4506
4576
|
] }), e[16] = l, e[17] = u, e[18] = d, e[19] = f) : f = e[19], f;
|
|
4507
4577
|
}
|
|
4508
|
-
var
|
|
4509
|
-
Provider:
|
|
4510
|
-
Root:
|
|
4578
|
+
var Os = {
|
|
4579
|
+
Provider: gs,
|
|
4580
|
+
Root: _s,
|
|
4511
4581
|
Popup: R.Popup,
|
|
4512
|
-
Content:
|
|
4513
|
-
Attachments:
|
|
4514
|
-
Editor:
|
|
4582
|
+
Content: vs,
|
|
4583
|
+
Attachments: bs,
|
|
4584
|
+
Editor: ys,
|
|
4515
4585
|
Error: R.Error,
|
|
4516
|
-
Toolbar:
|
|
4517
|
-
CommandButton:
|
|
4518
|
-
AttachFiles:
|
|
4519
|
-
Dictate:
|
|
4586
|
+
Toolbar: xs,
|
|
4587
|
+
CommandButton: Cs,
|
|
4588
|
+
AttachFiles: Ss,
|
|
4589
|
+
Dictate: Ds
|
|
4520
4590
|
};
|
|
4521
4591
|
//#endregion
|
|
4522
4592
|
//#region src/lib/components/ChatTextarea.tsx
|
|
4523
|
-
function
|
|
4593
|
+
function ks(e) {
|
|
4524
4594
|
let t = O(10), n, r, i;
|
|
4525
4595
|
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);
|
|
4526
4596
|
let a;
|
|
@@ -4537,7 +4607,7 @@ function Es(e) {
|
|
|
4537
4607
|
}
|
|
4538
4608
|
//#endregion
|
|
4539
4609
|
//#region src/lib/components/queue.tsx
|
|
4540
|
-
function
|
|
4610
|
+
function As(e) {
|
|
4541
4611
|
let t = O(5), { children: n, className: r } = e, i;
|
|
4542
4612
|
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);
|
|
4543
4613
|
let a;
|
|
@@ -4546,7 +4616,7 @@ function Ds(e) {
|
|
|
4546
4616
|
children: n
|
|
4547
4617
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
4548
4618
|
}
|
|
4549
|
-
function
|
|
4619
|
+
function js(e) {
|
|
4550
4620
|
let t = O(5), { children: n, className: r } = e, i;
|
|
4551
4621
|
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);
|
|
4552
4622
|
let a;
|
|
@@ -4555,13 +4625,13 @@ function Os(e) {
|
|
|
4555
4625
|
children: n
|
|
4556
4626
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
4557
4627
|
}
|
|
4558
|
-
function
|
|
4628
|
+
function Ms(e) {
|
|
4559
4629
|
let t = O(4), { className: n } = e, r;
|
|
4560
4630
|
t[0] === n ? r = t[1] : (r = k("text-muted-foreground size-3.5 shrink-0", n), t[0] = n, t[1] = r);
|
|
4561
4631
|
let i;
|
|
4562
4632
|
return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ M(Ye, { className: r }), t[2] = r, t[3] = i), i;
|
|
4563
4633
|
}
|
|
4564
|
-
function
|
|
4634
|
+
function Ns(e) {
|
|
4565
4635
|
let t = O(7), { children: n, className: r } = e, i;
|
|
4566
4636
|
t[0] === r ? i = t[1] : (i = k("min-w-0 flex-1 truncate text-sm", r), t[0] = r, t[1] = i);
|
|
4567
4637
|
let a;
|
|
@@ -4572,7 +4642,7 @@ function As(e) {
|
|
|
4572
4642
|
children: a
|
|
4573
4643
|
}), t[4] = i, t[5] = a, t[6] = o) : o = t[6], o;
|
|
4574
4644
|
}
|
|
4575
|
-
function
|
|
4645
|
+
function Ps(e) {
|
|
4576
4646
|
let t = O(6), { onClick: n, className: r } = e, i;
|
|
4577
4647
|
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);
|
|
4578
4648
|
let a;
|
|
@@ -4586,13 +4656,13 @@ function js(e) {
|
|
|
4586
4656
|
children: a
|
|
4587
4657
|
}), t[3] = n, t[4] = i, t[5] = o) : o = t[5], o;
|
|
4588
4658
|
}
|
|
4589
|
-
var
|
|
4590
|
-
Root:
|
|
4591
|
-
Item:
|
|
4592
|
-
Icon:
|
|
4593
|
-
Text:
|
|
4594
|
-
Remove:
|
|
4595
|
-
},
|
|
4659
|
+
var Fs = {
|
|
4660
|
+
Root: As,
|
|
4661
|
+
Item: js,
|
|
4662
|
+
Icon: Ms,
|
|
4663
|
+
Text: Ns,
|
|
4664
|
+
Remove: Ps
|
|
4665
|
+
}, Is = {
|
|
4596
4666
|
normal: {
|
|
4597
4667
|
d: "m5 12 7-7 7 7",
|
|
4598
4668
|
translateY: 0
|
|
@@ -4606,7 +4676,7 @@ var Ms = {
|
|
|
4606
4676
|
],
|
|
4607
4677
|
transition: { duration: .4 }
|
|
4608
4678
|
}
|
|
4609
|
-
},
|
|
4679
|
+
}, Ls = {
|
|
4610
4680
|
normal: { d: "M12 19V5" },
|
|
4611
4681
|
animate: {
|
|
4612
4682
|
d: [
|
|
@@ -4616,7 +4686,7 @@ var Ms = {
|
|
|
4616
4686
|
],
|
|
4617
4687
|
transition: { duration: .4 }
|
|
4618
4688
|
}
|
|
4619
|
-
},
|
|
4689
|
+
}, Rs = (e) => {
|
|
4620
4690
|
let t = O(30), n, r, i, a, o, s;
|
|
4621
4691
|
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);
|
|
4622
4692
|
let c = s === void 0 ? 20 : s, l = ne(), u = h(!1), d;
|
|
@@ -4638,11 +4708,11 @@ var Ms = {
|
|
|
4638
4708
|
t[17] === l ? (y = t[18], b = t[19]) : (y = /* @__PURE__ */ M(A.path, {
|
|
4639
4709
|
animate: l,
|
|
4640
4710
|
d: "m5 12 7-7 7 7",
|
|
4641
|
-
variants:
|
|
4711
|
+
variants: Is
|
|
4642
4712
|
}), b = /* @__PURE__ */ M(A.path, {
|
|
4643
4713
|
animate: l,
|
|
4644
4714
|
d: "M12 19V5",
|
|
4645
|
-
variants:
|
|
4715
|
+
variants: Ls
|
|
4646
4716
|
}), t[17] = l, t[18] = y, t[19] = b);
|
|
4647
4717
|
let x;
|
|
4648
4718
|
t[20] !== c || t[21] !== y || t[22] !== b ? (x = /* @__PURE__ */ N("svg", {
|
|
@@ -4666,10 +4736,10 @@ var Ms = {
|
|
|
4666
4736
|
children: x
|
|
4667
4737
|
}), t[24] = m, t[25] = _, t[26] = a, t[27] = v, t[28] = x, t[29] = S) : S = t[29], S;
|
|
4668
4738
|
};
|
|
4669
|
-
|
|
4739
|
+
Rs.displayName = "ArrowUpIcon";
|
|
4670
4740
|
//#endregion
|
|
4671
4741
|
//#region src/lib/components/SubmitButton.tsx
|
|
4672
|
-
var
|
|
4742
|
+
var zs = {
|
|
4673
4743
|
duration: .15,
|
|
4674
4744
|
ease: [
|
|
4675
4745
|
0,
|
|
@@ -4677,7 +4747,7 @@ var Is = {
|
|
|
4677
4747
|
.2,
|
|
4678
4748
|
1
|
|
4679
4749
|
]
|
|
4680
|
-
},
|
|
4750
|
+
}, Bs = {
|
|
4681
4751
|
duration: .12,
|
|
4682
4752
|
ease: [
|
|
4683
4753
|
0,
|
|
@@ -4686,7 +4756,7 @@ var Is = {
|
|
|
4686
4756
|
1
|
|
4687
4757
|
]
|
|
4688
4758
|
};
|
|
4689
|
-
function
|
|
4759
|
+
function Vs(e) {
|
|
4690
4760
|
let t = O(40), n, r, i, a;
|
|
4691
4761
|
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);
|
|
4692
4762
|
let o = re(), s = a === "stop", c;
|
|
@@ -4726,7 +4796,7 @@ function Rs(e) {
|
|
|
4726
4796
|
scale: .7
|
|
4727
4797
|
}, t[21] = o, t[22] = v);
|
|
4728
4798
|
let y;
|
|
4729
|
-
t[23] === s ? y = t[24] : (y = M(s ?
|
|
4799
|
+
t[23] === s ? y = t[24] : (y = M(s ? Ws : Us, {}), t[23] = s, t[24] = y);
|
|
4730
4800
|
let b;
|
|
4731
4801
|
t[25] !== v || t[26] !== y || t[27] !== h || t[28] !== g ? (b = /* @__PURE__ */ M(te, {
|
|
4732
4802
|
initial: !1,
|
|
@@ -4734,7 +4804,7 @@ function Rs(e) {
|
|
|
4734
4804
|
initial: g,
|
|
4735
4805
|
animate: _,
|
|
4736
4806
|
exit: v,
|
|
4737
|
-
transition:
|
|
4807
|
+
transition: Bs,
|
|
4738
4808
|
className: "absolute flex items-center justify-center",
|
|
4739
4809
|
children: y
|
|
4740
4810
|
}, h)
|
|
@@ -4744,7 +4814,7 @@ function Rs(e) {
|
|
|
4744
4814
|
initial: c,
|
|
4745
4815
|
animate: l,
|
|
4746
4816
|
exit: u,
|
|
4747
|
-
transition:
|
|
4817
|
+
transition: zs,
|
|
4748
4818
|
whileHover: d,
|
|
4749
4819
|
whileTap: f,
|
|
4750
4820
|
"aria-label": p,
|
|
@@ -4754,7 +4824,7 @@ function Rs(e) {
|
|
|
4754
4824
|
children: b
|
|
4755
4825
|
}), 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;
|
|
4756
4826
|
}
|
|
4757
|
-
function
|
|
4827
|
+
function Hs(e) {
|
|
4758
4828
|
let t = O(2), { children: n } = e, r;
|
|
4759
4829
|
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M("svg", {
|
|
4760
4830
|
width: "20",
|
|
@@ -4765,13 +4835,13 @@ function zs(e) {
|
|
|
4765
4835
|
children: n
|
|
4766
4836
|
}), t[0] = n, t[1] = r), r;
|
|
4767
4837
|
}
|
|
4768
|
-
function
|
|
4838
|
+
function Us() {
|
|
4769
4839
|
let e = O(1), t;
|
|
4770
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
4840
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(Rs, {}), e[0] = t) : t = e[0], t;
|
|
4771
4841
|
}
|
|
4772
|
-
function
|
|
4842
|
+
function Ws() {
|
|
4773
4843
|
let e = O(1), t;
|
|
4774
|
-
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(Hs, { children: /* @__PURE__ */ M("rect", {
|
|
4775
4845
|
x: "5",
|
|
4776
4846
|
y: "5",
|
|
4777
4847
|
width: "10",
|
|
@@ -4781,9 +4851,9 @@ function Vs() {
|
|
|
4781
4851
|
}
|
|
4782
4852
|
//#endregion
|
|
4783
4853
|
//#region src/lib/components/tool-error.tsx
|
|
4784
|
-
function
|
|
4854
|
+
function Gs(e) {
|
|
4785
4855
|
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;
|
|
4786
|
-
t[0] === o.issues ? u = t[1] : (u = o.issues.map(
|
|
4856
|
+
t[0] === o.issues ? u = t[1] : (u = o.issues.map(Ks).join("\n"), t[0] = o.issues, t[1] = u);
|
|
4787
4857
|
let d = u, f;
|
|
4788
4858
|
t[2] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(Fe, { className: "size-5" }), t[2] = f) : f = t[2];
|
|
4789
4859
|
let p;
|
|
@@ -4851,71 +4921,71 @@ function Hs(e) {
|
|
|
4851
4921
|
]
|
|
4852
4922
|
}), t[21] = v, t[22] = S, t[23] = p, t[24] = C) : C = t[24], C;
|
|
4853
4923
|
}
|
|
4854
|
-
function
|
|
4924
|
+
function Ks(e) {
|
|
4855
4925
|
return `${e.path.join(".")}: ${e.message}`;
|
|
4856
4926
|
}
|
|
4857
4927
|
//#endregion
|
|
4858
4928
|
//#region src/lib/components/Tip/TipProvider.tsx
|
|
4859
|
-
var
|
|
4860
|
-
function Gs() {
|
|
4861
|
-
return l(Ws);
|
|
4862
|
-
}
|
|
4863
|
-
var Ks = "tips:history", qs = "tips:session";
|
|
4929
|
+
var qs = o("");
|
|
4864
4930
|
function Js() {
|
|
4931
|
+
return l(qs);
|
|
4932
|
+
}
|
|
4933
|
+
var Ys = "tips:history", Xs = "tips:session";
|
|
4934
|
+
function Zs() {
|
|
4865
4935
|
try {
|
|
4866
|
-
return JSON.parse(localStorage.getItem(
|
|
4936
|
+
return JSON.parse(localStorage.getItem(Ys) ?? "{}");
|
|
4867
4937
|
} catch (e) {
|
|
4868
|
-
if (
|
|
4938
|
+
if (ec(e)) return {};
|
|
4869
4939
|
throw e;
|
|
4870
4940
|
}
|
|
4871
4941
|
}
|
|
4872
|
-
function
|
|
4942
|
+
function Qs(e, t) {
|
|
4873
4943
|
try {
|
|
4874
|
-
let n =
|
|
4875
|
-
n[e] = t, localStorage.setItem(
|
|
4944
|
+
let n = Zs();
|
|
4945
|
+
n[e] = t, localStorage.setItem(Ys, JSON.stringify(n));
|
|
4876
4946
|
} catch (e) {
|
|
4877
|
-
if (!
|
|
4947
|
+
if (!ec(e)) throw e;
|
|
4878
4948
|
}
|
|
4879
4949
|
}
|
|
4880
|
-
function
|
|
4950
|
+
function $s(e) {
|
|
4881
4951
|
try {
|
|
4882
|
-
let t = localStorage.getItem(
|
|
4952
|
+
let t = localStorage.getItem(Xs), n = t ? JSON.parse(t) : {
|
|
4883
4953
|
id: "",
|
|
4884
4954
|
n: 0
|
|
4885
4955
|
};
|
|
4886
|
-
return n.id !== e && (n.id = e, n.n += 1, localStorage.setItem(
|
|
4956
|
+
return n.id !== e && (n.id = e, n.n += 1, localStorage.setItem(Xs, JSON.stringify(n))), n.n;
|
|
4887
4957
|
} catch (e) {
|
|
4888
|
-
if (
|
|
4958
|
+
if (ec(e)) return 0;
|
|
4889
4959
|
throw e;
|
|
4890
4960
|
}
|
|
4891
4961
|
}
|
|
4892
|
-
function
|
|
4962
|
+
function ec(e) {
|
|
4893
4963
|
return e instanceof SyntaxError || e instanceof DOMException && (e.name === "QuotaExceededError" || e.name === "SecurityError");
|
|
4894
4964
|
}
|
|
4895
|
-
function
|
|
4965
|
+
function tc(e, t, n) {
|
|
4896
4966
|
let r = n[e];
|
|
4897
4967
|
return r == null ? Infinity : t - r;
|
|
4898
4968
|
}
|
|
4899
|
-
async function
|
|
4900
|
-
let r =
|
|
4969
|
+
async function nc(e, t, n) {
|
|
4970
|
+
let r = Zs(), i = await Promise.all(e.map((e) => e.isRelevant(t))), a = e.filter((e, t) => i[t]);
|
|
4901
4971
|
if (a.length === 0) return null;
|
|
4902
|
-
let o = a.filter((e) =>
|
|
4903
|
-
s.sort((e, t) =>
|
|
4972
|
+
let o = a.filter((e) => tc(e.id, n, r) >= e.cooldownSessions), s = o.length > 0 ? o : a;
|
|
4973
|
+
s.sort((e, t) => tc(t.id, n, r) - tc(e.id, n, r));
|
|
4904
4974
|
let c = s[0], l = await c.content(t);
|
|
4905
4975
|
return {
|
|
4906
4976
|
id: c.id,
|
|
4907
4977
|
text: l
|
|
4908
4978
|
};
|
|
4909
4979
|
}
|
|
4910
|
-
function
|
|
4980
|
+
function rc(e) {
|
|
4911
4981
|
let t = O(13), { tips: n, streaming: r, chatId: i, context: a, children: o } = e, s;
|
|
4912
|
-
t[0] === i ? s = t[1] : (s = () =>
|
|
4982
|
+
t[0] === i ? s = t[1] : (s = () => $s(i), t[0] = i, t[1] = s);
|
|
4913
4983
|
let [c] = g(s), [l, u] = g(""), [p, m] = g(r), [_, v] = g(0);
|
|
4914
|
-
r !== p && (m(r), r && v(
|
|
4984
|
+
r !== p && (m(r), r && v(ic));
|
|
4915
4985
|
let y = h(!1), b;
|
|
4916
4986
|
t[2] !== a || t[3] !== c || t[4] !== n ? (b = () => {
|
|
4917
|
-
y.current || (y.current = !0,
|
|
4918
|
-
e && (u(e.text),
|
|
4987
|
+
y.current || (y.current = !0, nc(n, a, c).then((e) => {
|
|
4988
|
+
e && (u(e.text), Qs(e.id, c));
|
|
4919
4989
|
}).finally(() => {
|
|
4920
4990
|
y.current = !1;
|
|
4921
4991
|
}));
|
|
@@ -4927,17 +4997,17 @@ function ec(e) {
|
|
|
4927
4997
|
let C;
|
|
4928
4998
|
t[8] === _ ? C = t[9] : (C = [_], t[8] = _, t[9] = C), d(S, C);
|
|
4929
4999
|
let w;
|
|
4930
|
-
return t[10] !== o || t[11] !== l ? (w = /* @__PURE__ */ M(
|
|
5000
|
+
return t[10] !== o || t[11] !== l ? (w = /* @__PURE__ */ M(qs, {
|
|
4931
5001
|
value: l,
|
|
4932
5002
|
children: o
|
|
4933
5003
|
}), t[10] = o, t[11] = l, t[12] = w) : w = t[12], w;
|
|
4934
5004
|
}
|
|
4935
|
-
function
|
|
5005
|
+
function ic(e) {
|
|
4936
5006
|
return e + 1;
|
|
4937
5007
|
}
|
|
4938
|
-
function
|
|
5008
|
+
function ac(e) {
|
|
4939
5009
|
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;
|
|
4940
|
-
return t[0] !== i || t[1] !== r || t[2] !== s || t[3] !== c || t[4] !== n ? (l = /* @__PURE__ */ M(
|
|
5010
|
+
return t[0] !== i || t[1] !== r || t[2] !== s || t[3] !== c || t[4] !== n ? (l = /* @__PURE__ */ M(rc, {
|
|
4941
5011
|
tips: n,
|
|
4942
5012
|
streaming: s,
|
|
4943
5013
|
chatId: c,
|
|
@@ -4947,14 +5017,14 @@ function nc(e) {
|
|
|
4947
5017
|
}
|
|
4948
5018
|
//#endregion
|
|
4949
5019
|
//#region src/lib/components/Tip/TipLine.tsx
|
|
4950
|
-
var
|
|
4951
|
-
function
|
|
4952
|
-
let t = O(13), { className: n } = e, r = St(), i =
|
|
5020
|
+
var oc = 1.5;
|
|
5021
|
+
function sc(e) {
|
|
5022
|
+
let t = O(13), { className: n } = e, r = St(), i = Js(), [a, o] = g(i), [s, c] = g(!1);
|
|
4953
5023
|
i !== a && (o(i), i && c(!0));
|
|
4954
5024
|
let l, u;
|
|
4955
5025
|
t[0] !== r || t[1] !== s ? (l = () => {
|
|
4956
5026
|
if (!s) return;
|
|
4957
|
-
let e = r.setTimeout(() => c(!1),
|
|
5027
|
+
let e = r.setTimeout(() => c(!1), oc * 1e3);
|
|
4958
5028
|
return () => r.clearTimeout(e);
|
|
4959
5029
|
}, u = [r, s], t[0] = r, t[1] = s, t[2] = l, t[3] = u) : (l = t[2], u = t[3]), d(l, u);
|
|
4960
5030
|
let f;
|
|
@@ -4962,10 +5032,10 @@ function ic(e) {
|
|
|
4962
5032
|
let p;
|
|
4963
5033
|
t[6] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ M(Je, { className: "size-3 shrink-0" }), t[6] = p) : p = t[6];
|
|
4964
5034
|
let m;
|
|
4965
|
-
t[7] !== s || t[8] !== i ? (m = /* @__PURE__ */ N(
|
|
5035
|
+
t[7] !== s || t[8] !== i ? (m = /* @__PURE__ */ N(W, {
|
|
4966
5036
|
as: "span",
|
|
4967
5037
|
enabled: s,
|
|
4968
|
-
duration:
|
|
5038
|
+
duration: oc,
|
|
4969
5039
|
children: ["Tip: ", i]
|
|
4970
5040
|
}), t[7] = s, t[8] = i, t[9] = m) : m = t[9];
|
|
4971
5041
|
let h;
|
|
@@ -4976,7 +5046,7 @@ function ic(e) {
|
|
|
4976
5046
|
}
|
|
4977
5047
|
//#endregion
|
|
4978
5048
|
//#region src/lib/hooks/use-async-generator.ts
|
|
4979
|
-
function
|
|
5049
|
+
function cc() {
|
|
4980
5050
|
let [e, t] = g({
|
|
4981
5051
|
loading: !1,
|
|
4982
5052
|
error: null
|
|
@@ -5006,7 +5076,7 @@ function ac() {
|
|
|
5006
5076
|
}
|
|
5007
5077
|
//#endregion
|
|
5008
5078
|
//#region src/lib/hooks/use-auto-resize-textarea.ts
|
|
5009
|
-
function
|
|
5079
|
+
function lc(e) {
|
|
5010
5080
|
let t = O(16), { minHeight: n, maxHeight: r, value: i } = e, a = h(null), o;
|
|
5011
5081
|
t[0] !== r || t[1] !== n ? (o = (e) => {
|
|
5012
5082
|
let t = a.current;
|
|
@@ -5043,22 +5113,22 @@ function oc(e) {
|
|
|
5043
5113
|
}
|
|
5044
5114
|
//#endregion
|
|
5045
5115
|
//#region src/lib/hooks/use-keyboard.ts
|
|
5046
|
-
function
|
|
5116
|
+
function uc(e) {
|
|
5047
5117
|
let t = [];
|
|
5048
5118
|
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("+");
|
|
5049
5119
|
}
|
|
5050
|
-
function
|
|
5120
|
+
function dc(e) {
|
|
5051
5121
|
let t = O(4), { enabled: n, handlers: r } = e, i = n === void 0 || n, a, o;
|
|
5052
5122
|
t[0] !== i || t[1] !== r ? (a = () => {
|
|
5053
5123
|
if (!i) return;
|
|
5054
5124
|
let e = (e) => {
|
|
5055
|
-
let t =
|
|
5125
|
+
let t = uc(e), n = r[t];
|
|
5056
5126
|
n ||= r[e.key], n && (e.preventDefault(), e.stopPropagation(), n(e));
|
|
5057
5127
|
};
|
|
5058
5128
|
return document.addEventListener("keydown", e, !0), () => document.removeEventListener("keydown", e, !0);
|
|
5059
5129
|
}, o = [i, r], t[0] = i, t[1] = r, t[2] = a, t[3] = o) : (a = t[2], o = t[3]), d(a, o);
|
|
5060
5130
|
}
|
|
5061
5131
|
//#endregion
|
|
5062
|
-
export { Gt as AgentHeader, Zt as AgentProvider, Bt as AgentScrollArea, pi as AssistantSnapshot, ti as COPY_EXCLUSION_ATTRIBUTE, ni as COPY_EXCLUSION_MODES, Q as ChatActionButton, zt as ChatBot,
|
|
5132
|
+
export { Gt as AgentHeader, Zt as AgentProvider, Bt as AgentScrollArea, pi as AssistantSnapshot, ti as COPY_EXCLUSION_ATTRIBUTE, ni as COPY_EXCLUSION_MODES, Q as ChatActionButton, zt as ChatBot, Os as ChatComposer, Ft as ChatManager, ks as ChatTextarea, Zn as CitationPill, Ur as CodeBlock, Wr as CodeBlockCopyButton, Zo as CompactMessages, Yo as CompactTrajectory, ma as CopyAction, ga as CopyDebugJsonAction, Jn as IndexProgress, Ci as InteractiveResponse, Xn as MessageItemContext, Ja as MessageMetadata, Fs as MessageQueue, cs as Messages, pa as MessagesActions, Yn as MessagesContext, va as MessagesError, xa as MessagesItem, ba as MessagesList, ya as MessagesRoot, so as MessagesUserBubble, da as NestedTrajectory, wa as PendingToolInput, nn as ReadOnlyChatTransport, ha as RegenerateAction, Y as Response, Z as Segment, li as SnapshotRenderPortal, Vs as SubmitButton, W as TextShimmer, hs as TimelinedMessages, sc as TipLine, rc as TipProvider, qs as TipValueContext, ac as Tips, Vi as ToolArg, Gs as ToolError, oo as UserMessageContent, Va as ZukhrufChatTransport, tn as citationIndexOf, Nt as clearPrefill, oe as defineElements, fi as extractAssistantRawText, en as extractSourcesFromMessage, Ra as formatUsageBreakdown, La as formatUsageValue, pn as getIndexProgressEvents, oa as getSegmentKey, ii as hasCopyExclusion, _i as isActiveClientInputTool, Wi as isCommentaryTextPart, mi as isSubagentPart, an as isToolAborted, rn as isToolStateAborted, Ma as parseMetadataUsage, ja as parseUsage, Pt as persistedPromptOf, jt as readPrefill, oi as resolveCopyToClipboardStrategy, gi as resolveToolEntry, sn as serializeToolsRegistry, ai as shouldIncludeInCopyImage, hi as subagentDisplayName, U as urlCitationsOf, Sa as useActivePendingToolInput, z as useAgent, Lt as useAgentChatSetup, H as useAgentMessages, V as useAgentMeta, B as useAgentStatus, cc as useAsyncGenerator, lc as useAutoResizeTextarea, Qt as useChatManager, zo as useCompactGroup, di as useCopyElementAsImage, X as useIsAssistantSnapshotRender, on as useIsToolAborted, dc as useKeyboard, q as useMessageItem, G as useMessagesContext, K as useMessagesStatus, Ia as useNormalizedUsageTracking, Js as useTipValue, Qi as useToolSegment, Lo as useTrajectoryItems, ci as waitForNextPaint, Mt as writePrefill };
|
|
5063
5133
|
|
|
5064
5134
|
//# sourceMappingURL=index.js.map
|