@deepagents/react-genai 7.47.0 → 7.47.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +507 -503
- package/dist/index.js.map +1 -1
- package/dist/lib/copy/assistant-snapshot.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1511,7 +1511,7 @@ var Br = class extends t.Component {
|
|
|
1511
1511
|
let t = O(8), n, r;
|
|
1512
1512
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1513
1513
|
let i;
|
|
1514
|
-
t[3] === n ? i = t[4] : (i = k("size-full space-y-
|
|
1514
|
+
t[3] === n ? i = t[4] : (i = k("flex size-full flex-col gap-2 space-y-0 [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", n), t[3] = n, t[4] = i);
|
|
1515
1515
|
let a;
|
|
1516
1516
|
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ M(Br, { children: /* @__PURE__ */ M(zr, {
|
|
1517
1517
|
className: i,
|
|
@@ -1924,16 +1924,20 @@ function di({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1924
1924
|
}
|
|
1925
1925
|
//#endregion
|
|
1926
1926
|
//#region src/lib/copy/assistant-snapshot.tsx
|
|
1927
|
-
|
|
1928
|
-
|
|
1927
|
+
var fi = /<\/?[a-z][\w]*-[\w-]*(?:\s+[^\s"'>/=]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*\/?>/gi, pi = /(```[\s\S]*?```|`[^`\n]+`)/;
|
|
1928
|
+
function mi(e) {
|
|
1929
|
+
return e.split(pi).map((e, t) => t % 2 == 1 ? e : e.replace(fi, "\0").replace(/ \0(?= )/g, "").replaceAll("\0", "")).join("");
|
|
1930
|
+
}
|
|
1931
|
+
function hi(e) {
|
|
1932
|
+
let t = en(e), n = e.parts.filter(C).map((e) => mi($t(e.text, U(e.citations)).reverse().reduce((e, { at: n, citation: r }) => `${e.slice(0, n)}[${tn(t, r.source.url)}]${e.slice(n)}`, e.text))).join("\n");
|
|
1929
1933
|
return t.length === 0 ? n : `${n}\n\n${t.map(({ url: e, title: t }, n) => `[${n + 1}] ${t ? `${t} — ` : ""}${e}`).join("\n")}`;
|
|
1930
1934
|
}
|
|
1931
1935
|
function X() {
|
|
1932
1936
|
return l(si);
|
|
1933
1937
|
}
|
|
1934
|
-
function
|
|
1938
|
+
function gi(e) {
|
|
1935
1939
|
let t = O(30), { message: n, renderContent: r, className: i } = e, a = h(null), [o, s] = g(!1), c;
|
|
1936
|
-
t[0] === n ? c = t[1] : (c =
|
|
1940
|
+
t[0] === n ? c = t[1] : (c = hi(n), t[0] = n, t[1] = c);
|
|
1937
1941
|
let l = c, u;
|
|
1938
1942
|
t[2] === l ? u = t[3] : (u = {
|
|
1939
1943
|
elementRef: a,
|
|
@@ -1983,41 +1987,41 @@ function pi(e) {
|
|
|
1983
1987
|
}
|
|
1984
1988
|
//#endregion
|
|
1985
1989
|
//#region src/lib/tools/helpers.ts
|
|
1986
|
-
function
|
|
1990
|
+
function _i(e) {
|
|
1987
1991
|
return w(e) && e.toolMetadata?.kind === "subagent";
|
|
1988
1992
|
}
|
|
1989
|
-
function
|
|
1993
|
+
function vi(e) {
|
|
1990
1994
|
let t = e.toolMetadata?.displayName;
|
|
1991
1995
|
return typeof t == "string" ? t : "Subagent";
|
|
1992
1996
|
}
|
|
1993
|
-
function
|
|
1997
|
+
function yi(e, t) {
|
|
1994
1998
|
let n = y(e);
|
|
1995
1999
|
return {
|
|
1996
2000
|
toolKey: n,
|
|
1997
2001
|
toolEntry: t?.[n]
|
|
1998
2002
|
};
|
|
1999
2003
|
}
|
|
2000
|
-
function
|
|
2004
|
+
function bi(e, t) {
|
|
2001
2005
|
return e?.static === !1 && !!e?.requiresUserInput && t === "input-available";
|
|
2002
2006
|
}
|
|
2003
2007
|
//#endregion
|
|
2004
2008
|
//#region src/lib/chat/markdown-paragraph.tsx
|
|
2005
|
-
var
|
|
2006
|
-
function
|
|
2009
|
+
var xi = /* @__PURE__ */ new Set(/* @__PURE__ */ "a.abbr.b.bdi.bdo.br.cite.code.data.del.dfn.em.i.ins.kbd.mark.q.s.samp.small.span.strong.sub.sup.time.u.var.wbr".split("."));
|
|
2010
|
+
function Si(e) {
|
|
2007
2011
|
if (!n.isValidElement(e)) return !1;
|
|
2008
2012
|
let t = typeof e.type == "string" ? e.type : e.props.node?.tagName;
|
|
2009
|
-
return t === void 0 || !
|
|
2013
|
+
return t === void 0 || !xi.has(t);
|
|
2010
2014
|
}
|
|
2011
|
-
function
|
|
2015
|
+
function Ci(e) {
|
|
2012
2016
|
let t = O(6), { children: r, dir: i } = e, a = n.Children.toArray(r);
|
|
2013
|
-
if (!a.some(
|
|
2017
|
+
if (!a.some(Si)) {
|
|
2014
2018
|
let e;
|
|
2015
2019
|
return t[0] !== r || t[1] !== i ? (e = /* @__PURE__ */ M("p", {
|
|
2016
2020
|
dir: i,
|
|
2017
2021
|
children: r
|
|
2018
2022
|
}), t[0] = r, t[1] = i, t[2] = e) : e = t[2], e;
|
|
2019
2023
|
}
|
|
2020
|
-
if (a.every(
|
|
2024
|
+
if (a.every(Si)) return r;
|
|
2021
2025
|
let o;
|
|
2022
2026
|
return t[3] !== r || t[4] !== i ? (o = /* @__PURE__ */ M("div", {
|
|
2023
2027
|
dir: i,
|
|
@@ -2026,25 +2030,25 @@ function bi(e) {
|
|
|
2026
2030
|
}
|
|
2027
2031
|
//#endregion
|
|
2028
2032
|
//#region src/lib/components/InteractiveResponse.tsx
|
|
2029
|
-
var
|
|
2033
|
+
var wi = { p: ({ children: e, dir: t }) => /* @__PURE__ */ M(Ci, {
|
|
2030
2034
|
dir: t,
|
|
2031
2035
|
children: e
|
|
2032
2036
|
}) };
|
|
2033
|
-
function
|
|
2034
|
-
let t = { ...
|
|
2037
|
+
function Ti(e) {
|
|
2038
|
+
let t = { ...wi }, n = {};
|
|
2035
2039
|
for (let r of e) ae(r), t[r.name] = r.component, n[r.name] = r.allowedAttributes;
|
|
2036
2040
|
return {
|
|
2037
2041
|
components: t,
|
|
2038
2042
|
allowedTags: n
|
|
2039
2043
|
};
|
|
2040
2044
|
}
|
|
2041
|
-
function
|
|
2045
|
+
function Ei(e) {
|
|
2042
2046
|
let t = O(10), n, r;
|
|
2043
2047
|
t[0] === e ? (n = t[1], r = t[2]) : ({elements: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
2044
2048
|
let i;
|
|
2045
2049
|
t[3] === n ? i = t[4] : (i = n ?? [], t[3] = n, t[4] = i);
|
|
2046
2050
|
let a;
|
|
2047
|
-
t[5] === i ? a = t[6] : (a =
|
|
2051
|
+
t[5] === i ? a = t[6] : (a = Ti(i), t[5] = i, t[6] = a);
|
|
2048
2052
|
let o = a, s;
|
|
2049
2053
|
return t[7] !== r || t[8] !== o ? (s = /* @__PURE__ */ M(Y, {
|
|
2050
2054
|
...o,
|
|
@@ -2053,7 +2057,7 @@ function Ci(e) {
|
|
|
2053
2057
|
}
|
|
2054
2058
|
//#endregion
|
|
2055
2059
|
//#region src/lib/renderers/render-part.tsx
|
|
2056
|
-
function
|
|
2060
|
+
function Di(e) {
|
|
2057
2061
|
let t = O(22), { part: n } = e, { addToolApprovalResponse: r } = H();
|
|
2058
2062
|
if (n.state !== "approval-requested") return null;
|
|
2059
2063
|
let i;
|
|
@@ -2106,7 +2110,7 @@ function wi(e) {
|
|
|
2106
2110
|
children: [l, f]
|
|
2107
2111
|
}), t[18] = o, t[19] = l, t[20] = f, t[21] = p) : p = t[21], p;
|
|
2108
2112
|
}
|
|
2109
|
-
function
|
|
2113
|
+
function Oi(e) {
|
|
2110
2114
|
let t = O(25), { part: n } = e, { registry: r } = z();
|
|
2111
2115
|
if (n.input === void 0) {
|
|
2112
2116
|
let e;
|
|
@@ -2116,11 +2120,11 @@ function Ti(e) {
|
|
|
2116
2120
|
}) : /* @__PURE__ */ M(Xe, { className: "size-4 animate-spin" }), t[0] = n.errorText, t[1] = n.output, t[2] = n.state, t[3] = e) : e = t[3], e;
|
|
2117
2121
|
}
|
|
2118
2122
|
let i;
|
|
2119
|
-
t[4] === n ? i = t[5] : (i = /* @__PURE__ */ M(
|
|
2123
|
+
t[4] === n ? i = t[5] : (i = /* @__PURE__ */ M(Di, { part: n }), t[4] = n, t[5] = i);
|
|
2120
2124
|
let a = i;
|
|
2121
2125
|
if (!r) return a;
|
|
2122
2126
|
let o;
|
|
2123
|
-
t[6] !== n || t[7] !== r ? (o =
|
|
2127
|
+
t[6] !== n || t[7] !== r ? (o = yi(n, r), t[6] = n, t[7] = r, t[8] = o) : o = t[8];
|
|
2124
2128
|
let { toolEntry: s } = o;
|
|
2125
2129
|
if (s) {
|
|
2126
2130
|
let e = s.component, i;
|
|
@@ -2145,8 +2149,8 @@ function Ti(e) {
|
|
|
2145
2149
|
}
|
|
2146
2150
|
//#endregion
|
|
2147
2151
|
//#region src/lib/chat/message-parts.tsx
|
|
2148
|
-
var
|
|
2149
|
-
function
|
|
2152
|
+
var ki = { animation: "slideUp" };
|
|
2153
|
+
function Ai(e) {
|
|
2150
2154
|
let t = O(3), { filename: n, url: r } = e, i = n ?? "Attached image", a;
|
|
2151
2155
|
return t[0] !== i || t[1] !== r ? (a = /* @__PURE__ */ M("img", {
|
|
2152
2156
|
src: r,
|
|
@@ -2154,7 +2158,7 @@ function Di(e) {
|
|
|
2154
2158
|
className: "max-h-64 rounded-md border object-contain"
|
|
2155
2159
|
}), t[0] = i, t[1] = r, t[2] = a) : a = t[2], a;
|
|
2156
2160
|
}
|
|
2157
|
-
function
|
|
2161
|
+
function ji(e) {
|
|
2158
2162
|
let t = O(16), { filename: n, mediaType: r, url: i } = e, a = n || "Untitled", o;
|
|
2159
2163
|
t[0] !== r || t[1] !== a || t[2] !== i ? (o = i?.startsWith("data:") ? null : i && r.startsWith("video/") ? /* @__PURE__ */ M("video", {
|
|
2160
2164
|
controls: !0,
|
|
@@ -2200,24 +2204,24 @@ function Oi(e) {
|
|
|
2200
2204
|
children: [s, d]
|
|
2201
2205
|
}), t[13] = s, t[14] = d, t[15] = f) : f = t[15], f;
|
|
2202
2206
|
}
|
|
2203
|
-
function
|
|
2207
|
+
function Mi(e) {
|
|
2204
2208
|
let t = O(4), { filename: n, mediaType: r, url: i } = e, a;
|
|
2205
|
-
return t[0] !== n || t[1] !== r || t[2] !== i ? (a = r.split("/")[0] === "image" ? /* @__PURE__ */ M(
|
|
2209
|
+
return t[0] !== n || t[1] !== r || t[2] !== i ? (a = r.split("/")[0] === "image" ? /* @__PURE__ */ M(Ai, {
|
|
2206
2210
|
filename: n,
|
|
2207
2211
|
url: i
|
|
2208
|
-
}) : /* @__PURE__ */ M(
|
|
2212
|
+
}) : /* @__PURE__ */ M(ji, {
|
|
2209
2213
|
filename: n,
|
|
2210
2214
|
mediaType: r,
|
|
2211
2215
|
url: i
|
|
2212
2216
|
}), t[0] = n, t[1] = r, t[2] = i, t[3] = a) : a = t[3], a;
|
|
2213
2217
|
}
|
|
2214
|
-
var
|
|
2215
|
-
function
|
|
2216
|
-
return $t(e, t).reverse().reduce((e, { at: t, order: n }) => `${e.slice(0, t)}<${
|
|
2218
|
+
var Ni = "genai-citation";
|
|
2219
|
+
function Pi(e, t) {
|
|
2220
|
+
return $t(e, t).reverse().reduce((e, { at: t, order: n }) => `${e.slice(0, t)}<${Ni} citation="${n}" />${e.slice(t)}`, e);
|
|
2217
2221
|
}
|
|
2218
|
-
var
|
|
2219
|
-
function
|
|
2220
|
-
let t = O(16), n = l(
|
|
2222
|
+
var Fi = o(null);
|
|
2223
|
+
function Ii(e) {
|
|
2224
|
+
let t = O(16), n = l(Fi), r = n?.citations[Number(e.citation)];
|
|
2221
2225
|
if (!n || !r) return null;
|
|
2222
2226
|
let i;
|
|
2223
2227
|
t[0] !== r.source.url || t[1] !== n.sources ? (i = tn(n.sources, r.source.url), t[0] = r.source.url, t[1] = n.sources, t[2] = i) : i = t[2];
|
|
@@ -2247,12 +2251,12 @@ function Ni(e) {
|
|
|
2247
2251
|
children: s
|
|
2248
2252
|
}), t[12] = a, t[13] = o, t[14] = s, t[15] = c) : c = t[15], c;
|
|
2249
2253
|
}
|
|
2250
|
-
var
|
|
2251
|
-
name:
|
|
2254
|
+
var Li = {
|
|
2255
|
+
name: Ni,
|
|
2252
2256
|
allowedAttributes: ["citation"],
|
|
2253
|
-
component:
|
|
2257
|
+
component: Ii
|
|
2254
2258
|
};
|
|
2255
|
-
function
|
|
2259
|
+
function Ri(e) {
|
|
2256
2260
|
let t = O(27), { text: n, citations: r, elements: i, className: a } = e, { status: o } = B(), s = X(), { citation: c } = G(), { message: l } = q(), u;
|
|
2257
2261
|
t[0] === r ? u = t[1] : (u = U(r), t[0] = r, t[1] = u);
|
|
2258
2262
|
let d = u, f;
|
|
@@ -2264,15 +2268,15 @@ function Fi(e) {
|
|
|
2264
2268
|
HostCitation: c
|
|
2265
2269
|
}, t[4] = c, t[5] = f, t[6] = d, t[7] = p) : p = t[7];
|
|
2266
2270
|
let m = p, h = d.length > 0, g;
|
|
2267
|
-
t[8] !== i || t[9] !== h ? (g = h ? [...i ?? [],
|
|
2271
|
+
t[8] !== i || t[9] !== h ? (g = h ? [...i ?? [], Li] : i, t[8] = i, t[9] = h, t[10] = g) : g = t[10];
|
|
2268
2272
|
let _ = g, v;
|
|
2269
2273
|
t[11] === a ? v = t[12] : (v = k("text-sm", a), t[11] = a, t[12] = v);
|
|
2270
2274
|
let y = !s && o === "streaming", b;
|
|
2271
|
-
t[13] !== h || t[14] !== n || t[15] !== d ? (b = h ?
|
|
2275
|
+
t[13] !== h || t[14] !== n || t[15] !== d ? (b = h ? Pi(n, d) : n, t[13] = h, t[14] = n, t[15] = d, t[16] = b) : b = t[16];
|
|
2272
2276
|
let x;
|
|
2273
|
-
t[17] !== y || t[18] !== b || t[19] !== _ ? (x = /* @__PURE__ */ M(
|
|
2277
|
+
t[17] !== y || t[18] !== b || t[19] !== _ ? (x = /* @__PURE__ */ M(Ei, {
|
|
2274
2278
|
elements: _,
|
|
2275
|
-
animated:
|
|
2279
|
+
animated: ki,
|
|
2276
2280
|
isAnimating: y,
|
|
2277
2281
|
children: b
|
|
2278
2282
|
}), t[17] = y, t[18] = b, t[19] = _, t[20] = x) : x = t[20];
|
|
@@ -2282,40 +2286,40 @@ function Fi(e) {
|
|
|
2282
2286
|
children: x
|
|
2283
2287
|
}), t[21] = v, t[22] = x, t[23] = S) : S = t[23];
|
|
2284
2288
|
let C;
|
|
2285
|
-
return t[24] !== m || t[25] !== S ? (C = /* @__PURE__ */ M(
|
|
2289
|
+
return t[24] !== m || t[25] !== S ? (C = /* @__PURE__ */ M(Fi, {
|
|
2286
2290
|
value: m,
|
|
2287
2291
|
children: S
|
|
2288
2292
|
}), t[24] = m, t[25] = S, t[26] = C) : C = t[26], C;
|
|
2289
2293
|
}
|
|
2290
|
-
function
|
|
2291
|
-
let t = O(8), { part: n } = e, r =
|
|
2294
|
+
function zi(e) {
|
|
2295
|
+
let t = O(8), { part: n } = e, r = Bi(), i;
|
|
2292
2296
|
t[0] !== n || t[1] !== r ? (i = r && /* @__PURE__ */ M($r, { part: n }), t[0] = n, t[1] = r, t[2] = i) : i = t[2];
|
|
2293
2297
|
let a;
|
|
2294
|
-
t[3] === n ? a = t[4] : (a = /* @__PURE__ */ M(
|
|
2298
|
+
t[3] === n ? a = t[4] : (a = /* @__PURE__ */ M(Oi, { part: n }), t[3] = n, t[4] = a);
|
|
2295
2299
|
let o;
|
|
2296
2300
|
return t[5] !== i || t[6] !== a ? (o = /* @__PURE__ */ N(j, { children: [i, a] }), t[5] = i, t[6] = a, t[7] = o) : o = t[7], o;
|
|
2297
2301
|
}
|
|
2298
|
-
function
|
|
2302
|
+
function Bi() {
|
|
2299
2303
|
let { debugMode: e } = z(), t = X();
|
|
2300
2304
|
return !!e && !t;
|
|
2301
2305
|
}
|
|
2302
2306
|
//#endregion
|
|
2303
2307
|
//#region src/lib/chat/trajectory/tool-label.tsx
|
|
2304
|
-
function
|
|
2308
|
+
function Vi(e) {
|
|
2305
2309
|
return !!e && e !== "output-available";
|
|
2306
2310
|
}
|
|
2307
|
-
function
|
|
2311
|
+
function Hi(e) {
|
|
2308
2312
|
let t = O(5), { label: n, part: r, state: i } = e, a = X(), o;
|
|
2309
|
-
return t[0] !== a || t[1] !== n || t[2] !== r || t[3] !== i ? (o = !a && !!n.actions && !!r && !
|
|
2313
|
+
return t[0] !== a || t[1] !== n || t[2] !== r || t[3] !== i ? (o = !a && !!n.actions && !!r && !Vi(i), t[0] = a, t[1] = n, t[2] = r, t[3] = i, t[4] = o) : o = t[4], o;
|
|
2310
2314
|
}
|
|
2311
|
-
function
|
|
2315
|
+
function Ui(e) {
|
|
2312
2316
|
let t = O(20), { label: n, part: r } = e, i = n.icon, a = n.actions, o;
|
|
2313
2317
|
t[0] !== n || t[1] !== r ? (o = {
|
|
2314
2318
|
label: n,
|
|
2315
2319
|
part: r,
|
|
2316
2320
|
state: r.state
|
|
2317
2321
|
}, t[0] = n, t[1] = r, t[2] = o) : o = t[2];
|
|
2318
|
-
let s =
|
|
2322
|
+
let s = Hi(o), c;
|
|
2319
2323
|
t[3] !== i || t[4] !== n.isError ? (c = i && /* @__PURE__ */ M(i, { className: k("size-3.5", n.isError ? "text-destructive" : "text-muted-foreground") }), t[3] = i, t[4] = n.isError, t[5] = c) : c = t[5];
|
|
2320
2324
|
let l;
|
|
2321
2325
|
t[6] !== n.kind || t[7] !== n.name || t[8] !== n.text ? (l = n.kind === "sentence" ? /* @__PURE__ */ M("span", {
|
|
@@ -2339,7 +2343,7 @@ function Bi(e) {
|
|
|
2339
2343
|
children: [u, d]
|
|
2340
2344
|
}), t[17] = u, t[18] = d, t[19] = f) : f = t[19], f;
|
|
2341
2345
|
}
|
|
2342
|
-
function
|
|
2346
|
+
function Wi(e) {
|
|
2343
2347
|
let t = O(3), { name: n, value: r } = e, i;
|
|
2344
2348
|
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ N("span", {
|
|
2345
2349
|
"data-slot": "tool-arg",
|
|
@@ -2351,14 +2355,14 @@ function Vi(e) {
|
|
|
2351
2355
|
]
|
|
2352
2356
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2], i;
|
|
2353
2357
|
}
|
|
2354
|
-
function
|
|
2358
|
+
function Gi(e) {
|
|
2355
2359
|
let t = O(24), { label: n, state: r, part: i, children: a } = e, o = n.actions, s;
|
|
2356
2360
|
t[0] !== n || t[1] !== i || t[2] !== r ? (s = {
|
|
2357
2361
|
label: n,
|
|
2358
2362
|
part: i,
|
|
2359
2363
|
state: r
|
|
2360
2364
|
}, t[0] = n, t[1] = i, t[2] = r, t[3] = s) : s = t[3];
|
|
2361
|
-
let c =
|
|
2365
|
+
let c = Hi(s), l = n.kind === "sentence", u;
|
|
2362
2366
|
t[4] !== a || t[5] !== l || t[6] !== n.args || t[7] !== n.name || t[8] !== n.text ? (u = l ? /* @__PURE__ */ M("span", {
|
|
2363
2367
|
dir: "auto",
|
|
2364
2368
|
className: "text-muted-foreground min-w-0 truncate text-start text-xs",
|
|
@@ -2369,7 +2373,7 @@ function Hi(e) {
|
|
|
2369
2373
|
n.name,
|
|
2370
2374
|
"(",
|
|
2371
2375
|
a,
|
|
2372
|
-
n.args ? Object.entries(n.args).map(
|
|
2376
|
+
n.args ? Object.entries(n.args).map(Ki) : "...",
|
|
2373
2377
|
")"
|
|
2374
2378
|
]
|
|
2375
2379
|
}), t[4] = a, t[5] = l, t[6] = n.args, t[7] = n.name, t[8] = n.text, t[9] = u) : u = t[9];
|
|
@@ -2395,25 +2399,25 @@ function Hi(e) {
|
|
|
2395
2399
|
children: [f, p]
|
|
2396
2400
|
}), t[21] = f, t[22] = p, t[23] = m) : m = t[23], m;
|
|
2397
2401
|
}
|
|
2398
|
-
function
|
|
2402
|
+
function Ki(e) {
|
|
2399
2403
|
let [t, n] = e;
|
|
2400
|
-
return /* @__PURE__ */ M(
|
|
2404
|
+
return /* @__PURE__ */ M(Wi, {
|
|
2401
2405
|
name: t,
|
|
2402
2406
|
value: n
|
|
2403
2407
|
}, t);
|
|
2404
2408
|
}
|
|
2405
2409
|
//#endregion
|
|
2406
2410
|
//#region src/lib/chat/trajectory/segments/index.tsx
|
|
2407
|
-
function
|
|
2411
|
+
function qi(e) {
|
|
2408
2412
|
return e.type === "text" && e.providerMetadata?.openai?.phase === "commentary";
|
|
2409
2413
|
}
|
|
2410
|
-
function
|
|
2414
|
+
function Ji(e) {
|
|
2411
2415
|
let t = O(9), { segment: n, elements: r, className: i } = e, a;
|
|
2412
2416
|
if (t[0] !== i || t[1] !== r || t[2] !== n.parts) {
|
|
2413
2417
|
let e;
|
|
2414
2418
|
t[4] !== i || t[5] !== r ? (e = (e) => {
|
|
2415
2419
|
let { part: t, idx: n } = e;
|
|
2416
|
-
return t.type === "text" ? /* @__PURE__ */ M(
|
|
2420
|
+
return t.type === "text" ? /* @__PURE__ */ M(Ri, {
|
|
2417
2421
|
text: t.text,
|
|
2418
2422
|
citations: t.citations,
|
|
2419
2423
|
elements: r,
|
|
@@ -2424,17 +2428,17 @@ function Gi(e) {
|
|
|
2424
2428
|
let o;
|
|
2425
2429
|
return t[7] === a ? o = t[8] : (o = /* @__PURE__ */ M(j, { children: a }), t[7] = a, t[8] = o), o;
|
|
2426
2430
|
}
|
|
2427
|
-
function
|
|
2431
|
+
function Yi(e) {
|
|
2428
2432
|
let t = O(4), { segment: n } = e, { part: r } = n;
|
|
2429
2433
|
if (r.type !== "file") return null;
|
|
2430
2434
|
let i;
|
|
2431
|
-
return t[0] !== r.filename || t[1] !== r.mediaType || t[2] !== r.url ? (i = /* @__PURE__ */ M(
|
|
2435
|
+
return t[0] !== r.filename || t[1] !== r.mediaType || t[2] !== r.url ? (i = /* @__PURE__ */ M(Mi, {
|
|
2432
2436
|
filename: r.filename,
|
|
2433
2437
|
mediaType: r.mediaType,
|
|
2434
2438
|
url: r.url
|
|
2435
2439
|
}), t[0] = r.filename, t[1] = r.mediaType, t[2] = r.url, t[3] = i) : i = t[3], i;
|
|
2436
2440
|
}
|
|
2437
|
-
function
|
|
2441
|
+
function Xi(e) {
|
|
2438
2442
|
let t = O(9), { segment: n } = e, { message: r } = q(), i;
|
|
2439
2443
|
t[0] === r ? i = t[1] : (i = en(r), t[0] = r, t[1] = i);
|
|
2440
2444
|
let a = i, o;
|
|
@@ -2456,7 +2460,7 @@ function qi(e) {
|
|
|
2456
2460
|
let s;
|
|
2457
2461
|
return t[7] === o ? s = t[8] : (s = /* @__PURE__ */ M("span", { children: o }), t[7] = o, t[8] = s), s;
|
|
2458
2462
|
}
|
|
2459
|
-
function
|
|
2463
|
+
function Zi(e) {
|
|
2460
2464
|
let t = O(3), { segment: n } = e, r = K();
|
|
2461
2465
|
if (X()) return null;
|
|
2462
2466
|
let { part: i } = n;
|
|
@@ -2465,31 +2469,31 @@ function Ji(e) {
|
|
|
2465
2469
|
return t[0] !== i.text || t[1] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
2466
2470
|
className: "text-muted-foreground text-xs",
|
|
2467
2471
|
children: /* @__PURE__ */ M(Y, {
|
|
2468
|
-
animated:
|
|
2472
|
+
animated: ki,
|
|
2469
2473
|
isAnimating: a,
|
|
2470
2474
|
children: i.text
|
|
2471
2475
|
})
|
|
2472
2476
|
}), t[0] = i.text, t[1] = a, t[2] = o) : o = t[2], o;
|
|
2473
2477
|
}
|
|
2474
|
-
function
|
|
2478
|
+
function Qi(e) {
|
|
2475
2479
|
let t = O(2), { segment: n } = e;
|
|
2476
|
-
if (!
|
|
2480
|
+
if (!Bi()) return null;
|
|
2477
2481
|
let { part: r } = n;
|
|
2478
2482
|
if (r.type !== "dynamic-tool") return null;
|
|
2479
2483
|
let i;
|
|
2480
2484
|
return t[0] === r ? i = t[1] : (i = /* @__PURE__ */ M(ei, { part: r }), t[0] = r, t[1] = i), i;
|
|
2481
2485
|
}
|
|
2482
|
-
var
|
|
2483
|
-
function
|
|
2484
|
-
let e = l(
|
|
2486
|
+
var $i = o(null), ea = o(null);
|
|
2487
|
+
function ta() {
|
|
2488
|
+
let e = l($i);
|
|
2485
2489
|
if (!e) throw Error("Segment.Tool* parts must be rendered within Segment.Tool");
|
|
2486
2490
|
return e;
|
|
2487
2491
|
}
|
|
2488
|
-
function
|
|
2492
|
+
function na(e) {
|
|
2489
2493
|
let t = O(29), { segment: n, children: r } = e, i = z(), a = K(), { part: o } = n;
|
|
2490
2494
|
if (!S(o)) return null;
|
|
2491
2495
|
let s, c, l, u;
|
|
2492
|
-
t[0] !== i.registry || t[1] !== a || t[2] !== o ? ({toolEntry: u} =
|
|
2496
|
+
t[0] !== i.registry || t[1] !== a || t[2] !== o ? ({toolEntry: u} = yi(o, i.registry), c = bi(u, o.state), s = !c && an(o, a), l = u?.label?.(o), t[0] = i.registry, t[1] = a, t[2] = o, t[3] = s, t[4] = c, t[5] = l, t[6] = u) : (s = t[3], c = t[4], l = t[5], u = t[6]);
|
|
2493
2497
|
let d = l, f;
|
|
2494
2498
|
t[7] !== s || t[8] !== d || t[9] !== o ? (f = s ? {
|
|
2495
2499
|
...d ?? { name: y(o) },
|
|
@@ -2511,37 +2515,37 @@ function $i(e) {
|
|
|
2511
2515
|
aborted: s
|
|
2512
2516
|
}, t[17] = s, t[18] = p, t[19] = o.state, t[20] = g) : g = t[20];
|
|
2513
2517
|
let _;
|
|
2514
|
-
t[21] === r ? _ = t[22] : (_ = r ?? /* @__PURE__ */ M(
|
|
2518
|
+
t[21] === r ? _ = t[22] : (_ = r ?? /* @__PURE__ */ M(ia, {}), t[21] = r, t[22] = _);
|
|
2515
2519
|
let v;
|
|
2516
|
-
t[23] !== g || t[24] !== _ ? (v = /* @__PURE__ */ M(
|
|
2520
|
+
t[23] !== g || t[24] !== _ ? (v = /* @__PURE__ */ M(ea, {
|
|
2517
2521
|
value: g,
|
|
2518
2522
|
children: _
|
|
2519
2523
|
}), t[23] = g, t[24] = _, t[25] = v) : v = t[25];
|
|
2520
2524
|
let b;
|
|
2521
|
-
return t[26] !== h || t[27] !== v ? (b = /* @__PURE__ */ M(
|
|
2525
|
+
return t[26] !== h || t[27] !== v ? (b = /* @__PURE__ */ M($i, {
|
|
2522
2526
|
value: h,
|
|
2523
2527
|
children: v
|
|
2524
2528
|
}), t[26] = h, t[27] = v, t[28] = b) : b = t[28], b;
|
|
2525
2529
|
}
|
|
2526
|
-
function
|
|
2527
|
-
let e = O(2), { part: t, activeClientInput: n } =
|
|
2530
|
+
function ra() {
|
|
2531
|
+
let e = O(2), { part: t, activeClientInput: n } = ta();
|
|
2528
2532
|
if (n) return null;
|
|
2529
2533
|
let r;
|
|
2530
|
-
return e[0] === t ? r = e[1] : (r = /* @__PURE__ */ M(
|
|
2534
|
+
return e[0] === t ? r = e[1] : (r = /* @__PURE__ */ M(zi, { part: t }), e[0] = t, e[1] = r), r;
|
|
2531
2535
|
}
|
|
2532
|
-
function
|
|
2533
|
-
let t = O(9), { children: n } = e, { part: r, label: i, defaultOpen: a } =
|
|
2536
|
+
function ia(e) {
|
|
2537
|
+
let t = O(9), { children: n } = e, { part: r, label: i, defaultOpen: a } = ta();
|
|
2534
2538
|
if (!i) {
|
|
2535
2539
|
let e;
|
|
2536
2540
|
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ M("div", {
|
|
2537
2541
|
className: "min-w-0 flex-1",
|
|
2538
|
-
children: /* @__PURE__ */ M(
|
|
2542
|
+
children: /* @__PURE__ */ M(ra, {})
|
|
2539
2543
|
}), t[0] = e) : e = t[0], e;
|
|
2540
2544
|
}
|
|
2541
2545
|
let o;
|
|
2542
2546
|
t[1] !== n || t[2] !== i || t[3] !== r ? (o = /* @__PURE__ */ M(L, {
|
|
2543
2547
|
className: "cursor-pointer",
|
|
2544
|
-
children: /* @__PURE__ */ M(
|
|
2548
|
+
children: /* @__PURE__ */ M(Gi, {
|
|
2545
2549
|
label: i,
|
|
2546
2550
|
state: r.state,
|
|
2547
2551
|
part: r,
|
|
@@ -2551,7 +2555,7 @@ function ta(e) {
|
|
|
2551
2555
|
let s;
|
|
2552
2556
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(I, {
|
|
2553
2557
|
className: "mb-2",
|
|
2554
|
-
children: /* @__PURE__ */ M(
|
|
2558
|
+
children: /* @__PURE__ */ M(ra, {})
|
|
2555
2559
|
}), t[5] = s) : s = t[5];
|
|
2556
2560
|
let c;
|
|
2557
2561
|
return t[6] !== a || t[7] !== o ? (c = /* @__PURE__ */ N(F, {
|
|
@@ -2561,31 +2565,31 @@ function ta(e) {
|
|
|
2561
2565
|
}), t[6] = a, t[7] = o, t[8] = c) : c = t[8], c;
|
|
2562
2566
|
}
|
|
2563
2567
|
var Z = {
|
|
2564
|
-
Text:
|
|
2565
|
-
File:
|
|
2566
|
-
Source:
|
|
2567
|
-
Reasoning:
|
|
2568
|
-
DynamicTool:
|
|
2569
|
-
Tool:
|
|
2570
|
-
ToolDisclosure:
|
|
2571
|
-
ToolContent:
|
|
2568
|
+
Text: Ji,
|
|
2569
|
+
File: Yi,
|
|
2570
|
+
Source: Xi,
|
|
2571
|
+
Reasoning: Zi,
|
|
2572
|
+
DynamicTool: Qi,
|
|
2573
|
+
Tool: na,
|
|
2574
|
+
ToolDisclosure: ia,
|
|
2575
|
+
ToolContent: ra
|
|
2572
2576
|
};
|
|
2573
2577
|
//#endregion
|
|
2574
2578
|
//#region src/lib/chat/trajectory/trajectory-segments.ts
|
|
2575
|
-
function
|
|
2579
|
+
function aa(e) {
|
|
2576
2580
|
return S(e) ? "tool" : e.type === "dynamic-tool" ? "dynamic-tool" : e.type === "reasoning" && "text" in e && e.text ? "reasoning" : null;
|
|
2577
2581
|
}
|
|
2578
|
-
function
|
|
2582
|
+
function oa(e, t) {
|
|
2579
2583
|
return e.kind === "text" || e.kind === "file" || e.kind === "source" ? !1 : e.kind === "reasoning" || e.kind !== "dynamic-tool" || !!t;
|
|
2580
2584
|
}
|
|
2581
|
-
function
|
|
2585
|
+
function sa(e, t, n) {
|
|
2582
2586
|
let r = e[t + 1];
|
|
2583
|
-
return !!r &&
|
|
2587
|
+
return !!r && oa(r, n);
|
|
2584
2588
|
}
|
|
2585
|
-
function
|
|
2589
|
+
function ca(e) {
|
|
2586
2590
|
let t = [], n = new Set(e.flatMap((e) => e.type === "text" ? U(e.citations).map(({ source: e }) => e.url) : []));
|
|
2587
2591
|
for (let r = 0; r < e.length; r++) {
|
|
2588
|
-
let i = e[r], a =
|
|
2592
|
+
let i = e[r], a = aa(i);
|
|
2589
2593
|
if (a) t.push({
|
|
2590
2594
|
kind: a,
|
|
2591
2595
|
part: i,
|
|
@@ -2624,13 +2628,13 @@ function aa(e) {
|
|
|
2624
2628
|
}
|
|
2625
2629
|
return t;
|
|
2626
2630
|
}
|
|
2627
|
-
function
|
|
2631
|
+
function la(e, t) {
|
|
2628
2632
|
return e.kind === "text" || e.kind === "source" ? e.parts[0]?.idx ?? t : e.idx;
|
|
2629
2633
|
}
|
|
2630
2634
|
//#endregion
|
|
2631
2635
|
//#region src/lib/chat/trajectory/nested-trajectory.tsx
|
|
2632
|
-
function
|
|
2633
|
-
let n = `${
|
|
2636
|
+
function ua(e, t) {
|
|
2637
|
+
let n = `${la(e, t)}:${e.kind}`;
|
|
2634
2638
|
if (e.kind === "text") return `${n}:${e.parts.map(({ part: e }) => e.type === "text" ? e.text : "").join("")}`;
|
|
2635
2639
|
if (e.kind === "reasoning" && e.part.type === "reasoning") return `${n}:${e.part.text}`;
|
|
2636
2640
|
if ((e.kind === "tool" || e.kind === "dynamic-tool") && w(e.part)) {
|
|
@@ -2639,10 +2643,10 @@ function sa(e, t) {
|
|
|
2639
2643
|
}
|
|
2640
2644
|
return e.kind === "file" && e.part.type === "file" ? `${n}:${e.part.url}:${e.part.mediaType}:${e.part.filename ?? ""}` : n;
|
|
2641
2645
|
}
|
|
2642
|
-
function
|
|
2646
|
+
function da(e, t, n) {
|
|
2643
2647
|
return e.kind === "file" || e.kind === "source" ? !0 : e.kind === "tool" || e.kind === "dynamic-tool" ? w(e.part) ? e.part.state === "output-error" || e.part.state === "output-available" && e.part.preliminary !== !0 : !1 : t < n - 1;
|
|
2644
2648
|
}
|
|
2645
|
-
var
|
|
2649
|
+
var fa = c(function(e) {
|
|
2646
2650
|
let t = O(8), { segment: n } = e;
|
|
2647
2651
|
if (n.kind === "tool") {
|
|
2648
2652
|
let e;
|
|
@@ -2664,13 +2668,13 @@ var la = c(function(e) {
|
|
|
2664
2668
|
return t[6] === n ? e = t[7] : (e = /* @__PURE__ */ M(Z.File, { segment: n }), t[6] = n, t[7] = e), e;
|
|
2665
2669
|
}
|
|
2666
2670
|
return null;
|
|
2667
|
-
},
|
|
2668
|
-
function
|
|
2671
|
+
}, pa);
|
|
2672
|
+
function pa(e, t) {
|
|
2669
2673
|
return e.complete && t.complete && e.cacheKey === t.cacheKey;
|
|
2670
2674
|
}
|
|
2671
|
-
function
|
|
2675
|
+
function ma(e) {
|
|
2672
2676
|
let t = O(11), { parts: n, className: r } = e, i;
|
|
2673
|
-
t[0] === n ? i = t[1] : (i =
|
|
2677
|
+
t[0] === n ? i = t[1] : (i = ca(n), t[0] = n, t[1] = i);
|
|
2674
2678
|
let a = i;
|
|
2675
2679
|
if (a.length === 0) return null;
|
|
2676
2680
|
let o;
|
|
@@ -2679,11 +2683,11 @@ function da(e) {
|
|
|
2679
2683
|
if (t[4] !== a) {
|
|
2680
2684
|
let e;
|
|
2681
2685
|
t[6] === a.length ? e = t[7] : (e = (e, t) => {
|
|
2682
|
-
let n = `${
|
|
2683
|
-
return /* @__PURE__ */ M(
|
|
2686
|
+
let n = `${la(e, t)}-${e.kind}`;
|
|
2687
|
+
return /* @__PURE__ */ M(fa, {
|
|
2684
2688
|
segment: e,
|
|
2685
|
-
cacheKey:
|
|
2686
|
-
complete:
|
|
2689
|
+
cacheKey: ua(e, t),
|
|
2690
|
+
complete: da(e, t, a.length)
|
|
2687
2691
|
}, n);
|
|
2688
2692
|
}, t[6] = a.length, t[7] = e), s = a.map(e), t[4] = a, t[5] = s;
|
|
2689
2693
|
} else s = t[5];
|
|
@@ -2715,13 +2719,13 @@ function Q(e) {
|
|
|
2715
2719
|
}
|
|
2716
2720
|
//#endregion
|
|
2717
2721
|
//#region src/lib/chat/trajectory/trajectories/message-actions.tsx
|
|
2718
|
-
function
|
|
2722
|
+
function ha() {
|
|
2719
2723
|
let { index: e } = q(), { messages: t } = G(), n = K();
|
|
2720
2724
|
return !(e === t.length - 1 && (n === "submitted" || n === "streaming" || n === "error"));
|
|
2721
2725
|
}
|
|
2722
|
-
function
|
|
2726
|
+
function ga(e) {
|
|
2723
2727
|
let t = O(5), { className: n, children: r } = e;
|
|
2724
|
-
if (!
|
|
2728
|
+
if (!ha() || i.toArray(r).length === 0) return null;
|
|
2725
2729
|
let a;
|
|
2726
2730
|
t[0] === n ? a = t[1] : (a = k("mt-1 flex items-center gap-0.5", n), t[0] = n, t[1] = a);
|
|
2727
2731
|
let o;
|
|
@@ -2731,11 +2735,11 @@ function pa(e) {
|
|
|
2731
2735
|
children: r
|
|
2732
2736
|
}), t[2] = r, t[3] = a, t[4] = o) : o = t[4], o;
|
|
2733
2737
|
}
|
|
2734
|
-
function
|
|
2738
|
+
function _a(e) {
|
|
2735
2739
|
let t = O(12), { className: n } = e, { message: r } = q(), [i, a] = Vr(), o = i ? "Copied" : "Copy message", s;
|
|
2736
2740
|
t[0] === n ? s = t[1] : (s = k("p-1.5", n), t[0] = n, t[1] = s);
|
|
2737
2741
|
let c;
|
|
2738
|
-
t[2] !== a || t[3] !== r ? (c = () => void a(
|
|
2742
|
+
t[2] !== a || t[3] !== r ? (c = () => void a(hi(r)), t[2] = a, t[3] = r, t[4] = c) : c = t[4];
|
|
2739
2743
|
let l;
|
|
2740
2744
|
t[5] === i ? l = t[6] : (l = M(i ? Re : Ke, { className: "size-3.5" }), t[5] = i, t[6] = l);
|
|
2741
2745
|
let u;
|
|
@@ -2746,7 +2750,7 @@ function ma(e) {
|
|
|
2746
2750
|
icon: l
|
|
2747
2751
|
}), t[7] = o, t[8] = s, t[9] = c, t[10] = l, t[11] = u) : u = t[11], u;
|
|
2748
2752
|
}
|
|
2749
|
-
function
|
|
2753
|
+
function va(e) {
|
|
2750
2754
|
let t = O(9), { className: n } = e, { message: r } = q(), { regenerate: i } = H(), a;
|
|
2751
2755
|
t[0] === n ? a = t[1] : (a = k("p-1.5", n), t[0] = n, t[1] = a);
|
|
2752
2756
|
let o;
|
|
@@ -2761,7 +2765,7 @@ function ha(e) {
|
|
|
2761
2765
|
icon: s
|
|
2762
2766
|
}), t[6] = a, t[7] = o, t[8] = c) : c = t[8], c;
|
|
2763
2767
|
}
|
|
2764
|
-
function
|
|
2768
|
+
function ya(e) {
|
|
2765
2769
|
let t = O(12), { className: n } = e, { message: r } = q(), [i, a] = Vr(), o = i ? "Copied" : "Copy debug JSON", s;
|
|
2766
2770
|
t[0] === n ? s = t[1] : (s = k("p-1.5", n), t[0] = n, t[1] = s);
|
|
2767
2771
|
let c;
|
|
@@ -2778,7 +2782,7 @@ function ga(e) {
|
|
|
2778
2782
|
}
|
|
2779
2783
|
//#endregion
|
|
2780
2784
|
//#region src/lib/chat/trajectory/trajectories/messages-error.tsx
|
|
2781
|
-
function
|
|
2785
|
+
function ba(e) {
|
|
2782
2786
|
let t = O(7), { onTryAgain: n, error: r } = e, i = r instanceof Error ? r.message : "An error occurred. Please try again.", a;
|
|
2783
2787
|
t[0] === i ? a = t[1] : (a = /* @__PURE__ */ M("div", {
|
|
2784
2788
|
className: "text-destructive text-sm",
|
|
@@ -2804,18 +2808,18 @@ function _a(e) {
|
|
|
2804
2808
|
})
|
|
2805
2809
|
}), t[4] = a, t[5] = o, t[6] = s) : s = t[6], s;
|
|
2806
2810
|
}
|
|
2807
|
-
function
|
|
2811
|
+
function xa(e) {
|
|
2808
2812
|
let t = O(3), { error: n, onRetry: r } = e;
|
|
2809
2813
|
if (!n || !r) return null;
|
|
2810
2814
|
let i;
|
|
2811
|
-
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(
|
|
2815
|
+
return t[0] !== n || t[1] !== r ? (i = /* @__PURE__ */ M(ba, {
|
|
2812
2816
|
onTryAgain: r,
|
|
2813
2817
|
error: n
|
|
2814
2818
|
}), t[0] = n, t[1] = r, t[2] = i) : i = t[2], i;
|
|
2815
2819
|
}
|
|
2816
2820
|
//#endregion
|
|
2817
2821
|
//#region src/lib/chat/trajectory/trajectories/messages-shell.tsx
|
|
2818
|
-
function
|
|
2822
|
+
function Sa(e) {
|
|
2819
2823
|
let t = O(15), { messages: n, className: r, elements: i, citation: a, status: o, children: s } = e, c;
|
|
2820
2824
|
t[0] !== a || t[1] !== i || t[2] !== n || t[3] !== o ? (c = {
|
|
2821
2825
|
messages: n,
|
|
@@ -2841,7 +2845,7 @@ function ya(e) {
|
|
|
2841
2845
|
children: f
|
|
2842
2846
|
}), t[12] = f, t[13] = l, t[14] = p) : p = t[14], p;
|
|
2843
2847
|
}
|
|
2844
|
-
function
|
|
2848
|
+
function Ca(e) {
|
|
2845
2849
|
let t = O(5), { className: n, children: r } = e, i;
|
|
2846
2850
|
t[0] === n ? i = t[1] : (i = k("flex flex-col gap-4", n), t[0] = n, t[1] = i);
|
|
2847
2851
|
let a;
|
|
@@ -2850,7 +2854,7 @@ function ba(e) {
|
|
|
2850
2854
|
children: r
|
|
2851
2855
|
}), t[2] = r, t[3] = i, t[4] = a) : a = t[4], a;
|
|
2852
2856
|
}
|
|
2853
|
-
function
|
|
2857
|
+
function wa(e) {
|
|
2854
2858
|
let t = O(9), { message: n, index: r, className: i, children: a } = e, o;
|
|
2855
2859
|
t[0] !== r || t[1] !== n ? (o = {
|
|
2856
2860
|
message: n,
|
|
@@ -2869,7 +2873,7 @@ function xa(e) {
|
|
|
2869
2873
|
}
|
|
2870
2874
|
//#endregion
|
|
2871
2875
|
//#region src/lib/components/PendingToolInput.tsx
|
|
2872
|
-
function
|
|
2876
|
+
function Ta() {
|
|
2873
2877
|
let e = O(5), { registry: t } = z(), n = H().messages, r;
|
|
2874
2878
|
if (e[0] !== n || e[1] !== t) {
|
|
2875
2879
|
bb0: {
|
|
@@ -2877,7 +2881,7 @@ function Sa() {
|
|
|
2877
2881
|
r = null;
|
|
2878
2882
|
break bb0;
|
|
2879
2883
|
}
|
|
2880
|
-
let i = n.findLast(
|
|
2884
|
+
let i = n.findLast(Ea);
|
|
2881
2885
|
if (!i) {
|
|
2882
2886
|
r = null;
|
|
2883
2887
|
break bb0;
|
|
@@ -2896,12 +2900,12 @@ function Sa() {
|
|
|
2896
2900
|
} else r = e[2];
|
|
2897
2901
|
return r;
|
|
2898
2902
|
}
|
|
2899
|
-
function
|
|
2903
|
+
function Ea(e) {
|
|
2900
2904
|
let { role: t } = e;
|
|
2901
2905
|
return t === "assistant";
|
|
2902
2906
|
}
|
|
2903
|
-
function
|
|
2904
|
-
let t = O(10), { children: n, className: i } = e, a =
|
|
2907
|
+
function Da(e) {
|
|
2908
|
+
let t = O(10), { children: n, className: i } = e, a = Ta(), o = a?.entry.component, s = a ? "hidden" : "visible", c;
|
|
2905
2909
|
t[0] !== n || t[1] !== s ? (c = /* @__PURE__ */ M(r, {
|
|
2906
2910
|
mode: s,
|
|
2907
2911
|
children: n
|
|
@@ -2916,12 +2920,12 @@ function wa(e) {
|
|
|
2916
2920
|
}
|
|
2917
2921
|
//#endregion
|
|
2918
2922
|
//#region src/lib/chat/trajectory/trajectories/thinking-hint.ts
|
|
2919
|
-
function
|
|
2923
|
+
function Oa(e, t) {
|
|
2920
2924
|
if (e === "error" || e === "ready" || !t) return null;
|
|
2921
2925
|
if (t.role !== "assistant") return "Thinking...";
|
|
2922
2926
|
for (let e = t.parts.length - 1; e >= 0; e--) {
|
|
2923
2927
|
let n = t.parts[e];
|
|
2924
|
-
if (C(n) &&
|
|
2928
|
+
if (C(n) && qi(n) && n.text) return n.text;
|
|
2925
2929
|
}
|
|
2926
2930
|
for (let e = t.parts.length - 1; e >= 0; e--) {
|
|
2927
2931
|
let n = t.parts[e];
|
|
@@ -2945,7 +2949,7 @@ function Ta(e, t) {
|
|
|
2945
2949
|
}
|
|
2946
2950
|
//#endregion
|
|
2947
2951
|
//#region src/lib/chat/trajectory/trajectories/timeline-dot.tsx
|
|
2948
|
-
function
|
|
2952
|
+
function ka(e) {
|
|
2949
2953
|
let t = O(5), { isLast: n } = e, r = n !== void 0 && n, i;
|
|
2950
2954
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ M("span", { className: "bg-muted-foreground/50 z-10 mt-1 size-2 shrink-0 rounded-full" }), t[0] = i) : i = t[0];
|
|
2951
2955
|
let a;
|
|
@@ -2958,7 +2962,7 @@ function Ea(e) {
|
|
|
2958
2962
|
}
|
|
2959
2963
|
//#endregion
|
|
2960
2964
|
//#region src/lib/chat/trajectory/trajectories/timeline-item.tsx
|
|
2961
|
-
function
|
|
2965
|
+
function Aa(e) {
|
|
2962
2966
|
let t = O(6), { marker: n, children: r, className: i } = e, a;
|
|
2963
2967
|
t[0] === i ? a = t[1] : (a = k("relative z-0 flex gap-3 pl-5", i), t[0] = i, t[1] = a);
|
|
2964
2968
|
let o;
|
|
@@ -2969,15 +2973,15 @@ function Da(e) {
|
|
|
2969
2973
|
}
|
|
2970
2974
|
//#endregion
|
|
2971
2975
|
//#region src/lib/chat/trajectory/trajectories/trajectory-thinking.tsx
|
|
2972
|
-
function
|
|
2973
|
-
let e = O(6), t = K(), { messages: n } = G(), r =
|
|
2974
|
-
e[0] !== t || e[1] !== i ? (a =
|
|
2976
|
+
function ja() {
|
|
2977
|
+
let e = O(6), t = K(), { messages: n } = G(), r = Ta(), i = n[n.length - 1], a;
|
|
2978
|
+
e[0] !== t || e[1] !== i ? (a = Oa(t, i), e[0] = t, e[1] = i, e[2] = a) : a = e[2];
|
|
2975
2979
|
let o = a;
|
|
2976
2980
|
if (!o || r) return null;
|
|
2977
2981
|
let s;
|
|
2978
|
-
e[3] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(
|
|
2982
|
+
e[3] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ M(ka, { isLast: !0 }), e[3] = s) : s = e[3];
|
|
2979
2983
|
let c;
|
|
2980
|
-
return e[4] === o ? c = e[5] : (c = /* @__PURE__ */ M(
|
|
2984
|
+
return e[4] === o ? c = e[5] : (c = /* @__PURE__ */ M(Aa, {
|
|
2981
2985
|
className: "mt-2",
|
|
2982
2986
|
marker: s,
|
|
2983
2987
|
children: /* @__PURE__ */ M("span", {
|
|
@@ -2998,7 +3002,7 @@ var $ = [
|
|
|
2998
3002
|
"reasoningTokens",
|
|
2999
3003
|
"cachedInputTokens",
|
|
3000
3004
|
"totalTokens"
|
|
3001
|
-
],
|
|
3005
|
+
], Ma = {
|
|
3002
3006
|
inputTokens: [["inputTokens"], ["raw", "prompt_tokens"]],
|
|
3003
3007
|
outputTokens: [["outputTokens"], ["raw", "completion_tokens"]],
|
|
3004
3008
|
reasoningTokens: [
|
|
@@ -3022,7 +3026,7 @@ var $ = [
|
|
|
3022
3026
|
],
|
|
3023
3027
|
totalTokens: [["totalTokens"], ["raw", "total_tokens"]]
|
|
3024
3028
|
};
|
|
3025
|
-
function
|
|
3029
|
+
function Na(e) {
|
|
3026
3030
|
if (typeof e == "number" && Number.isFinite(e) && e >= 0) return e;
|
|
3027
3031
|
if (typeof e == "string" && e.trim().length > 0) {
|
|
3028
3032
|
let t = Number(e);
|
|
@@ -3030,7 +3034,7 @@ function Aa(e) {
|
|
|
3030
3034
|
}
|
|
3031
3035
|
return null;
|
|
3032
3036
|
}
|
|
3033
|
-
function
|
|
3037
|
+
function Pa(e) {
|
|
3034
3038
|
if (!e || typeof e != "object") return null;
|
|
3035
3039
|
let t = {
|
|
3036
3040
|
inputTokens: null,
|
|
@@ -3039,8 +3043,8 @@ function ja(e) {
|
|
|
3039
3043
|
cachedInputTokens: null,
|
|
3040
3044
|
totalTokens: null
|
|
3041
3045
|
};
|
|
3042
|
-
for (let n of $) for (let r of
|
|
3043
|
-
let i =
|
|
3046
|
+
for (let n of $) for (let r of Ma[n]) {
|
|
3047
|
+
let i = Na(Dt(e, r));
|
|
3044
3048
|
if (i !== null) {
|
|
3045
3049
|
t[n] = i;
|
|
3046
3050
|
break;
|
|
@@ -3048,10 +3052,10 @@ function ja(e) {
|
|
|
3048
3052
|
}
|
|
3049
3053
|
return $.some((e) => t[e] !== null) ? t : null;
|
|
3050
3054
|
}
|
|
3051
|
-
function
|
|
3052
|
-
return D(e) ?
|
|
3055
|
+
function Fa(e) {
|
|
3056
|
+
return D(e) ? Pa(e.totalUsage ?? e.usage) : null;
|
|
3053
3057
|
}
|
|
3054
|
-
function
|
|
3058
|
+
function Ia(e, t) {
|
|
3055
3059
|
let n = {
|
|
3056
3060
|
inputTokens: null,
|
|
3057
3061
|
outputTokens: null,
|
|
@@ -3073,7 +3077,7 @@ function Na(e, t) {
|
|
|
3073
3077
|
}
|
|
3074
3078
|
return $.some((e) => n[e] !== null) ? n : null;
|
|
3075
3079
|
}
|
|
3076
|
-
function
|
|
3080
|
+
function La(e) {
|
|
3077
3081
|
if (e.length === 0) return null;
|
|
3078
3082
|
let t = {
|
|
3079
3083
|
inputTokens: null,
|
|
@@ -3092,32 +3096,32 @@ function Pa(e) {
|
|
|
3092
3096
|
}
|
|
3093
3097
|
return $.some((e) => t[e] !== null) ? t : null;
|
|
3094
3098
|
}
|
|
3095
|
-
function
|
|
3099
|
+
function Ra(e) {
|
|
3096
3100
|
let t = {}, n = [], r = null, i = null;
|
|
3097
3101
|
for (let a of e) {
|
|
3098
3102
|
if (a.role !== "assistant") continue;
|
|
3099
|
-
let e = D(a.metadata) ? a.metadata : void 0, o =
|
|
3103
|
+
let e = D(a.metadata) ? a.metadata : void 0, o = Pa(e?.usage), s = Pa(e?.totalUsage), c = o ?? (s ? Ia(s, r) : null);
|
|
3100
3104
|
c && (t[a.id] = c, n.push(c)), s && (i = s, r = s);
|
|
3101
3105
|
}
|
|
3102
3106
|
return {
|
|
3103
3107
|
assistantUsageByMessageId: t,
|
|
3104
|
-
chatUsageSummary: i ??
|
|
3108
|
+
chatUsageSummary: i ?? La(n)
|
|
3105
3109
|
};
|
|
3106
3110
|
}
|
|
3107
|
-
function
|
|
3111
|
+
function za() {
|
|
3108
3112
|
let e = O(2), t = H(), n;
|
|
3109
|
-
return e[0] === t.messages ? n = e[1] : (n =
|
|
3113
|
+
return e[0] === t.messages ? n = e[1] : (n = Ra(t.messages), e[0] = t.messages, e[1] = n), n;
|
|
3110
3114
|
}
|
|
3111
|
-
function
|
|
3115
|
+
function Ba(e) {
|
|
3112
3116
|
return kt(e);
|
|
3113
3117
|
}
|
|
3114
|
-
function
|
|
3118
|
+
function Va(e) {
|
|
3115
3119
|
let t = [`↑ ${Ot(e.inputTokens)}`, `↓ ${Ot(e.outputTokens)}`];
|
|
3116
3120
|
return e.totalTokens !== null && t.push(`· ${kt(e.totalTokens)} tokens`), e.cachedInputTokens !== null && e.cachedInputTokens > 0 && t.push(`(${Ot(e.cachedInputTokens)} cached)`), t.join(" ");
|
|
3117
3121
|
}
|
|
3118
3122
|
//#endregion
|
|
3119
3123
|
//#region src/lib/chat/zukhruf-chat-transport.ts
|
|
3120
|
-
var
|
|
3124
|
+
var Ha = "x-upload-filename", Ua = P.strictObject({
|
|
3121
3125
|
path: P.string().startsWith("/"),
|
|
3122
3126
|
name: P.string().min(1),
|
|
3123
3127
|
mediaType: P.enum([
|
|
@@ -3135,19 +3139,19 @@ var za = "x-upload-filename", Ba = P.strictObject({
|
|
|
3135
3139
|
]),
|
|
3136
3140
|
size: P.int().nonnegative(),
|
|
3137
3141
|
url: P.url()
|
|
3138
|
-
}),
|
|
3142
|
+
}), Wa = class extends _ {
|
|
3139
3143
|
sessionsApi;
|
|
3140
3144
|
request;
|
|
3141
3145
|
constructor({ api: e, fetch: t = (e, t) => globalThis.fetch(e, t), tools: n = {}, elements: r = [] }) {
|
|
3142
|
-
let i =
|
|
3146
|
+
let i = Ja(e), a = r.map(se);
|
|
3143
3147
|
super({
|
|
3144
3148
|
api: i,
|
|
3145
3149
|
fetch: async (e, n) => {
|
|
3146
3150
|
let r = await t(e, n);
|
|
3147
3151
|
if ((n?.method ?? "GET").toUpperCase() !== "POST" || !r.ok) return r;
|
|
3148
3152
|
let i = await r.json();
|
|
3149
|
-
if (!
|
|
3150
|
-
let a =
|
|
3153
|
+
if (!Ya(i)) throw Error("Zukhruf returned an invalid accepted-turn response");
|
|
3154
|
+
let a = Ja(String(e)), o = decodeURIComponent(a.slice(a.lastIndexOf("/") + 1));
|
|
3151
3155
|
if (i.sessionId !== o) throw Error("Zukhruf returned a different session ID");
|
|
3152
3156
|
let s = n?.signal;
|
|
3153
3157
|
return s?.addEventListener("abort", () => {
|
|
@@ -3162,7 +3166,7 @@ var za = "x-upload-filename", Ba = P.strictObject({
|
|
|
3162
3166
|
let o = t[t.length - 1];
|
|
3163
3167
|
if (!o) throw Error("A message is required");
|
|
3164
3168
|
return {
|
|
3165
|
-
api:
|
|
3169
|
+
api: Ga(i, e),
|
|
3166
3170
|
body: {
|
|
3167
3171
|
sessionId: e,
|
|
3168
3172
|
message: o,
|
|
@@ -3173,50 +3177,50 @@ var za = "x-upload-filename", Ba = P.strictObject({
|
|
|
3173
3177
|
};
|
|
3174
3178
|
},
|
|
3175
3179
|
prepareReconnectToStreamRequest: ({ headers: e, id: t }) => ({
|
|
3176
|
-
api: `${
|
|
3180
|
+
api: `${Ga(i, t)}/stream`,
|
|
3177
3181
|
headers: e
|
|
3178
3182
|
})
|
|
3179
3183
|
}), this.sessionsApi = i, this.request = t;
|
|
3180
3184
|
}
|
|
3181
3185
|
async uploadFile(e, t) {
|
|
3182
|
-
let n = await this.request(`${
|
|
3186
|
+
let n = await this.request(`${Ga(this.sessionsApi, e)}/uploads`, {
|
|
3183
3187
|
method: "POST",
|
|
3184
3188
|
headers: {
|
|
3185
3189
|
"content-type": t.type,
|
|
3186
|
-
[
|
|
3190
|
+
[Ha]: encodeURIComponent(t.name)
|
|
3187
3191
|
},
|
|
3188
3192
|
body: t
|
|
3189
3193
|
});
|
|
3190
|
-
if (!n.ok) throw Error(await
|
|
3191
|
-
let r =
|
|
3194
|
+
if (!n.ok) throw Error(await Ka(n, t));
|
|
3195
|
+
let r = Ua.safeParse(await n.json());
|
|
3192
3196
|
if (!r.success) throw Error("Zukhruf returned an invalid upload response");
|
|
3193
3197
|
return r.data;
|
|
3194
3198
|
}
|
|
3195
3199
|
};
|
|
3196
|
-
function
|
|
3200
|
+
function Ga(e, t) {
|
|
3197
3201
|
return `${e}/${encodeURIComponent(t)}`;
|
|
3198
3202
|
}
|
|
3199
|
-
async function
|
|
3200
|
-
let n = `Uploading ${t.name} failed with HTTP ${e.status}`, r =
|
|
3203
|
+
async function Ka(e, t) {
|
|
3204
|
+
let n = `Uploading ${t.name} failed with HTTP ${e.status}`, r = qa(await e.json().catch((e) => {
|
|
3201
3205
|
if (e instanceof SyntaxError) return null;
|
|
3202
3206
|
throw e;
|
|
3203
3207
|
}));
|
|
3204
3208
|
return r ? `${n}: ${r}` : n;
|
|
3205
3209
|
}
|
|
3206
|
-
function
|
|
3210
|
+
function qa(e) {
|
|
3207
3211
|
if (typeof e != "object" || !e) return null;
|
|
3208
3212
|
let t = "cause" in e && typeof e.cause == "object" && e.cause !== null ? e.cause : null;
|
|
3209
3213
|
return [t && "code" in t && typeof t.code == "string" ? t.code : null, t && "detail" in t && typeof t.detail == "string" ? t.detail : "error" in e && typeof e.error == "string" ? e.error : null].filter((e) => e !== null).join(" — ") || null;
|
|
3210
3214
|
}
|
|
3211
|
-
function
|
|
3215
|
+
function Ja(e) {
|
|
3212
3216
|
return e.replace(/\/$/, "");
|
|
3213
3217
|
}
|
|
3214
|
-
function
|
|
3218
|
+
function Ya(e) {
|
|
3215
3219
|
return typeof e == "object" && !!e && "ok" in e && e.ok === !0 && "sessionId" in e && typeof e.sessionId == "string" && "turnId" in e && typeof e.turnId == "string";
|
|
3216
3220
|
}
|
|
3217
3221
|
//#endregion
|
|
3218
3222
|
//#region src/lib/chat/trajectory/trajectories/collapsible-disclosure.tsx
|
|
3219
|
-
function
|
|
3223
|
+
function Xa(e) {
|
|
3220
3224
|
let t = O(24), { label: n, open: r, onOpenChange: i, children: a, className: o, triggerClassName: s, contentClassName: c, chevronClassName: l } = e, u;
|
|
3221
3225
|
t[0] === s ? u = t[1] : (u = k("flex items-center font-mono", s), t[0] = s, t[1] = u);
|
|
3222
3226
|
let d;
|
|
@@ -3250,19 +3254,19 @@ function qa(e) {
|
|
|
3250
3254
|
}
|
|
3251
3255
|
//#endregion
|
|
3252
3256
|
//#region src/lib/chat/trajectory/trajectories/user-message.tsx
|
|
3253
|
-
function
|
|
3257
|
+
function Za(e) {
|
|
3254
3258
|
let t = O(7), { metadata: n } = e;
|
|
3255
3259
|
if (!n) return null;
|
|
3256
3260
|
let r, i, a;
|
|
3257
3261
|
if (t[0] !== n) {
|
|
3258
3262
|
a = Symbol.for("react.early_return_sentinel");
|
|
3259
3263
|
bb0: {
|
|
3260
|
-
let e =
|
|
3264
|
+
let e = Fa(n);
|
|
3261
3265
|
if (!e) {
|
|
3262
3266
|
a = null;
|
|
3263
3267
|
break bb0;
|
|
3264
3268
|
}
|
|
3265
|
-
r = "text-muted-foreground mt-2 text-xs tabular-nums opacity-60", i =
|
|
3269
|
+
r = "text-muted-foreground mt-2 text-xs tabular-nums opacity-60", i = Va(e);
|
|
3266
3270
|
}
|
|
3267
3271
|
t[0] = n, t[1] = r, t[2] = i, t[3] = a;
|
|
3268
3272
|
} else r = t[1], i = t[2], a = t[3];
|
|
@@ -3273,27 +3277,27 @@ function Ja(e) {
|
|
|
3273
3277
|
children: i
|
|
3274
3278
|
}), t[4] = r, t[5] = i, t[6] = o) : o = t[6], o;
|
|
3275
3279
|
}
|
|
3276
|
-
function
|
|
3280
|
+
function Qa(e, t) {
|
|
3277
3281
|
return D(e.metadata) ? e.metadata[t] : void 0;
|
|
3278
3282
|
}
|
|
3279
|
-
function
|
|
3280
|
-
let t =
|
|
3283
|
+
function $a(e) {
|
|
3284
|
+
let t = Qa(e, "reminders");
|
|
3281
3285
|
return Array.isArray(t) ? t.filter((e) => {
|
|
3282
3286
|
if (!e || typeof e != "object") return !1;
|
|
3283
3287
|
let t = e;
|
|
3284
3288
|
return typeof t.id == "string" && t.id.length > 0 && typeof t.text == "string" && t.text.trim().length > 0;
|
|
3285
3289
|
}) : [];
|
|
3286
3290
|
}
|
|
3287
|
-
function
|
|
3288
|
-
let t =
|
|
3291
|
+
function eo(e) {
|
|
3292
|
+
let t = Qa(e, "uploads");
|
|
3289
3293
|
return Array.isArray(t) ? t.flatMap((e) => {
|
|
3290
|
-
let t =
|
|
3294
|
+
let t = Ua.safeParse(e);
|
|
3291
3295
|
return t.success ? [t.data] : [];
|
|
3292
3296
|
}) : [];
|
|
3293
3297
|
}
|
|
3294
|
-
function
|
|
3298
|
+
function to(e) {
|
|
3295
3299
|
let t = O(7), { text: n } = e, [r, i] = g(!1), a;
|
|
3296
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = () => i(
|
|
3300
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = () => i(no), t[0] = a) : a = t[0];
|
|
3297
3301
|
let o = !r && "line-clamp-3", s;
|
|
3298
3302
|
t[1] === o ? s = t[2] : (s = k("hover:text-foreground w-full cursor-pointer text-left whitespace-pre-wrap", o), t[1] = o, t[2] = s);
|
|
3299
3303
|
let c;
|
|
@@ -3305,21 +3309,21 @@ function Qa(e) {
|
|
|
3305
3309
|
children: n
|
|
3306
3310
|
}) }), t[3] = r, t[4] = s, t[5] = n, t[6] = c) : c = t[6], c;
|
|
3307
3311
|
}
|
|
3308
|
-
function
|
|
3312
|
+
function no(e) {
|
|
3309
3313
|
return !e;
|
|
3310
3314
|
}
|
|
3311
|
-
function
|
|
3315
|
+
function ro(e) {
|
|
3312
3316
|
let t = O(8), { reminders: n } = e, [r, i] = g(!1);
|
|
3313
3317
|
if (n.length === 0) return null;
|
|
3314
3318
|
let a = `${n.length} reminder${n.length === 1 ? "" : "s"} attached`, o;
|
|
3315
|
-
t[0] === n ? o = t[1] : (o = n.map(
|
|
3319
|
+
t[0] === n ? o = t[1] : (o = n.map(io), t[0] = n, t[1] = o);
|
|
3316
3320
|
let s;
|
|
3317
3321
|
t[2] === o ? s = t[3] : (s = /* @__PURE__ */ M("ul", {
|
|
3318
3322
|
className: "border-ink-12 text-muted-foreground space-y-1 border-l pl-3 text-xs",
|
|
3319
3323
|
children: o
|
|
3320
3324
|
}), t[2] = o, t[3] = s);
|
|
3321
3325
|
let c;
|
|
3322
|
-
return t[4] !== a || t[5] !== r || t[6] !== s ? (c = /* @__PURE__ */ M(
|
|
3326
|
+
return t[4] !== a || t[5] !== r || t[6] !== s ? (c = /* @__PURE__ */ M(Xa, {
|
|
3323
3327
|
label: a,
|
|
3324
3328
|
open: r,
|
|
3325
3329
|
onOpenChange: i,
|
|
@@ -3330,10 +3334,10 @@ function eo(e) {
|
|
|
3330
3334
|
children: s
|
|
3331
3335
|
}), t[4] = a, t[5] = r, t[6] = s, t[7] = c) : c = t[7], c;
|
|
3332
3336
|
}
|
|
3333
|
-
function
|
|
3334
|
-
return /* @__PURE__ */ M(
|
|
3337
|
+
function io(e) {
|
|
3338
|
+
return /* @__PURE__ */ M(to, { text: e.text }, e.id);
|
|
3335
3339
|
}
|
|
3336
|
-
function
|
|
3340
|
+
function ao(e) {
|
|
3337
3341
|
let t = O(19), { upload: n } = e;
|
|
3338
3342
|
if (n.mediaType.startsWith("video/")) {
|
|
3339
3343
|
let e;
|
|
@@ -3399,17 +3403,17 @@ function no(e) {
|
|
|
3399
3403
|
})
|
|
3400
3404
|
}), t[16] = n.name, t[17] = n.url, t[18] = r) : r = t[18], r;
|
|
3401
3405
|
}
|
|
3402
|
-
function
|
|
3406
|
+
function oo(e) {
|
|
3403
3407
|
let t = O(13), { message: n } = e, r, i, a, o, s, c;
|
|
3404
3408
|
if (t[0] !== n) {
|
|
3405
3409
|
c = Symbol.for("react.early_return_sentinel");
|
|
3406
3410
|
bb0: {
|
|
3407
|
-
let e =
|
|
3411
|
+
let e = eo(n);
|
|
3408
3412
|
if (e.length === 0) {
|
|
3409
3413
|
c = null;
|
|
3410
3414
|
break bb0;
|
|
3411
3415
|
}
|
|
3412
|
-
r = fe, i = "list", a = "Attached files", o = "max-w-full gap-2 py-0", s = e.map(
|
|
3416
|
+
r = fe, i = "list", a = "Attached files", o = "max-w-full gap-2 py-0", s = e.map(so);
|
|
3413
3417
|
}
|
|
3414
3418
|
t[0] = n, t[1] = r, t[2] = i, t[3] = a, t[4] = o, t[5] = s, t[6] = c;
|
|
3415
3419
|
} else r = t[1], i = t[2], a = t[3], o = t[4], s = t[5], c = t[6];
|
|
@@ -3422,23 +3426,23 @@ function ro(e) {
|
|
|
3422
3426
|
children: s
|
|
3423
3427
|
}), t[7] = r, t[8] = i, t[9] = a, t[10] = o, t[11] = s, t[12] = l) : l = t[12], l;
|
|
3424
3428
|
}
|
|
3425
|
-
function
|
|
3429
|
+
function so(e) {
|
|
3426
3430
|
return /* @__PURE__ */ M("div", {
|
|
3427
3431
|
role: "listitem",
|
|
3428
3432
|
"data-slot": "attachment",
|
|
3429
|
-
children: /* @__PURE__ */ M(
|
|
3433
|
+
children: /* @__PURE__ */ M(ao, { upload: e })
|
|
3430
3434
|
}, e.path);
|
|
3431
3435
|
}
|
|
3432
|
-
function
|
|
3436
|
+
function co(e) {
|
|
3433
3437
|
let t = O(10), { body: n, reminders: r, metadata: i } = e, a;
|
|
3434
3438
|
t[0] === n ? a = t[1] : (a = /* @__PURE__ */ M("div", {
|
|
3435
3439
|
className: "flex-1 space-y-3",
|
|
3436
3440
|
children: n
|
|
3437
3441
|
}), t[0] = n, t[1] = a);
|
|
3438
3442
|
let o;
|
|
3439
|
-
t[2] === r ? o = t[3] : (o = /* @__PURE__ */ M(
|
|
3443
|
+
t[2] === r ? o = t[3] : (o = /* @__PURE__ */ M(ro, { reminders: r }), t[2] = r, t[3] = o);
|
|
3440
3444
|
let s;
|
|
3441
|
-
t[4] === i ? s = t[5] : (s = i !== void 0 && /* @__PURE__ */ M(
|
|
3445
|
+
t[4] === i ? s = t[5] : (s = i !== void 0 && /* @__PURE__ */ M(Za, { metadata: i }), t[4] = i, t[5] = s);
|
|
3442
3446
|
let c;
|
|
3443
3447
|
return t[6] !== a || t[7] !== o || t[8] !== s ? (c = /* @__PURE__ */ N("div", {
|
|
3444
3448
|
className: "bg-secondary flex max-w-[80%] flex-col gap-3 rounded-lg p-3",
|
|
@@ -3449,13 +3453,13 @@ function ao(e) {
|
|
|
3449
3453
|
]
|
|
3450
3454
|
}), t[6] = a, t[7] = o, t[8] = s, t[9] = c) : c = t[9], c;
|
|
3451
3455
|
}
|
|
3452
|
-
function
|
|
3456
|
+
function lo(e) {
|
|
3453
3457
|
let t = O(28), { message: n } = e;
|
|
3454
|
-
|
|
3458
|
+
Qa(n, "reminders");
|
|
3455
3459
|
let r;
|
|
3456
3460
|
t[0] === n ? r = t[1] : (r = ee(n), t[0] = n, t[1] = r);
|
|
3457
3461
|
let i;
|
|
3458
|
-
t[2] === n ? i = t[3] : (i =
|
|
3462
|
+
t[2] === n ? i = t[3] : (i = $a(n), t[2] = n, t[3] = i);
|
|
3459
3463
|
let a;
|
|
3460
3464
|
t[4] !== r || t[5] !== i ? (a = {
|
|
3461
3465
|
message: r,
|
|
@@ -3463,7 +3467,7 @@ function oo(e) {
|
|
|
3463
3467
|
}, t[4] = r, t[5] = i, t[6] = a) : a = t[6];
|
|
3464
3468
|
let { message: o, reminders: s } = a, c;
|
|
3465
3469
|
if (t[7] !== n) {
|
|
3466
|
-
let e =
|
|
3470
|
+
let e = Qa(n, "alias");
|
|
3467
3471
|
c = typeof e == "string" && e.trim().length > 0 ? e : void 0, t[7] = n, t[8] = c;
|
|
3468
3472
|
} else c = t[8];
|
|
3469
3473
|
let l = c;
|
|
@@ -3475,13 +3479,13 @@ function oo(e) {
|
|
|
3475
3479
|
children: l
|
|
3476
3480
|
}), t[9] = l, t[10] = e);
|
|
3477
3481
|
let n;
|
|
3478
|
-
return t[11] !== s || t[12] !== e ? (n = /* @__PURE__ */ M(
|
|
3482
|
+
return t[11] !== s || t[12] !== e ? (n = /* @__PURE__ */ M(co, {
|
|
3479
3483
|
reminders: s,
|
|
3480
3484
|
body: e
|
|
3481
3485
|
}), t[11] = s, t[12] = e, t[13] = n) : n = t[13], n;
|
|
3482
3486
|
}
|
|
3483
3487
|
let u;
|
|
3484
|
-
t[14] === o ? u = t[15] : (u = /* @__PURE__ */ M(
|
|
3488
|
+
t[14] === o ? u = t[15] : (u = /* @__PURE__ */ M(oo, { message: o }), t[14] = o, t[15] = u);
|
|
3485
3489
|
let d = o.metadata, f;
|
|
3486
3490
|
if (t[16] !== o.id || t[17] !== o.parts) {
|
|
3487
3491
|
let e;
|
|
@@ -3492,7 +3496,7 @@ function oo(e) {
|
|
|
3492
3496
|
}, `${o.id}-${t}-text`) : null, t[19] = o.id, t[20] = e), f = o.parts.map(e), t[16] = o.id, t[17] = o.parts, t[18] = f;
|
|
3493
3497
|
} else f = t[18];
|
|
3494
3498
|
let p;
|
|
3495
|
-
t[21] !== o.metadata || t[22] !== s || t[23] !== f ? (p = /* @__PURE__ */ M(
|
|
3499
|
+
t[21] !== o.metadata || t[22] !== s || t[23] !== f ? (p = /* @__PURE__ */ M(co, {
|
|
3496
3500
|
reminders: s,
|
|
3497
3501
|
metadata: d,
|
|
3498
3502
|
body: f
|
|
@@ -3503,11 +3507,11 @@ function oo(e) {
|
|
|
3503
3507
|
children: [u, p]
|
|
3504
3508
|
}), t[25] = u, t[26] = p, t[27] = m) : m = t[27], m;
|
|
3505
3509
|
}
|
|
3506
|
-
var
|
|
3510
|
+
var uo = c(function(e) {
|
|
3507
3511
|
let t = O(7), { className: n } = e, { message: r } = q(), i;
|
|
3508
3512
|
t[0] === n ? i = t[1] : (i = k("flex justify-end", n), t[0] = n, t[1] = i);
|
|
3509
3513
|
let a;
|
|
3510
|
-
t[2] === r ? a = t[3] : (a = /* @__PURE__ */ M(
|
|
3514
|
+
t[2] === r ? a = t[3] : (a = /* @__PURE__ */ M(lo, { message: r }), t[2] = r, t[3] = a);
|
|
3511
3515
|
let o;
|
|
3512
3516
|
return t[4] !== i || t[5] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
3513
3517
|
className: i,
|
|
@@ -3516,20 +3520,20 @@ var so = c(function(e) {
|
|
|
3516
3520
|
});
|
|
3517
3521
|
//#endregion
|
|
3518
3522
|
//#region src/lib/chat/trajectory/trajectories/compact-messages.tsx
|
|
3519
|
-
function
|
|
3520
|
-
return e.kind === "tool" ? !
|
|
3523
|
+
function fo(e) {
|
|
3524
|
+
return e.kind === "tool" ? !_i(e.part) : e.kind === "dynamic-tool" || e.kind === "reasoning";
|
|
3521
3525
|
}
|
|
3522
|
-
function
|
|
3526
|
+
function po(e, t) {
|
|
3523
3527
|
return e.kind === "tool" ? !0 : e.kind === "reasoning" || e.kind === "dynamic-tool" ? !!t : !1;
|
|
3524
3528
|
}
|
|
3525
|
-
function
|
|
3526
|
-
return e.kind === "text" && e.parts.some(({ part: e }) => e.type === "text" && !
|
|
3529
|
+
function mo(e) {
|
|
3530
|
+
return e.kind === "text" && e.parts.some(({ part: e }) => e.type === "text" && !qi(e));
|
|
3527
3531
|
}
|
|
3528
|
-
function
|
|
3532
|
+
function ho(e, t) {
|
|
3529
3533
|
let n = [];
|
|
3530
3534
|
for (let r = 0; r < e.length; r++) {
|
|
3531
3535
|
let i = e[r];
|
|
3532
|
-
if (!
|
|
3536
|
+
if (!fo(i)) {
|
|
3533
3537
|
n.push({
|
|
3534
3538
|
kind: "segment",
|
|
3535
3539
|
segment: i,
|
|
@@ -3538,25 +3542,25 @@ function fo(e, t) {
|
|
|
3538
3542
|
continue;
|
|
3539
3543
|
}
|
|
3540
3544
|
let a = [], o = r;
|
|
3541
|
-
for (; r < e.length &&
|
|
3545
|
+
for (; r < e.length && fo(e[r]);) {
|
|
3542
3546
|
let n = e[r];
|
|
3543
|
-
|
|
3547
|
+
po(n, t) && a.push({ segment: n }), r++;
|
|
3544
3548
|
}
|
|
3545
3549
|
r--, a.length > 0 && n.push({
|
|
3546
3550
|
kind: "group",
|
|
3547
3551
|
items: a,
|
|
3548
|
-
hasLaterText: e.slice(r + 1).some((e) =>
|
|
3552
|
+
hasLaterText: e.slice(r + 1).some((e) => mo(e)),
|
|
3549
3553
|
firstIndex: o
|
|
3550
3554
|
});
|
|
3551
3555
|
}
|
|
3552
3556
|
return n;
|
|
3553
3557
|
}
|
|
3554
|
-
function
|
|
3558
|
+
function go(e) {
|
|
3555
3559
|
if (e.kind !== "tool" && e.kind !== "dynamic-tool") return;
|
|
3556
3560
|
let { part: t } = e;
|
|
3557
3561
|
return w(t) ? t.state : void 0;
|
|
3558
3562
|
}
|
|
3559
|
-
function
|
|
3563
|
+
function _o({ groupStatus: e, labelCount: t }) {
|
|
3560
3564
|
return e === "running" ? {
|
|
3561
3565
|
title: "text-info",
|
|
3562
3566
|
detail: "text-info/80",
|
|
@@ -3579,20 +3583,20 @@ function mo({ groupStatus: e, labelCount: t }) {
|
|
|
3579
3583
|
chevron: "text-muted-foreground"
|
|
3580
3584
|
};
|
|
3581
3585
|
}
|
|
3582
|
-
function
|
|
3586
|
+
function vo(e) {
|
|
3583
3587
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
3584
3588
|
}
|
|
3585
|
-
function
|
|
3589
|
+
function yo(e, t = 80) {
|
|
3586
3590
|
let n = e.replace(/\s+/g, " ").trim();
|
|
3587
3591
|
return n.length <= t ? n : `${n.slice(0, t - 3).trimEnd()}...`;
|
|
3588
3592
|
}
|
|
3589
|
-
function
|
|
3590
|
-
if (typeof e == "string") return
|
|
3593
|
+
function bo(e) {
|
|
3594
|
+
if (typeof e == "string") return yo(e, 48);
|
|
3591
3595
|
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
3592
3596
|
if (Array.isArray(e)) return `${e.length} items`;
|
|
3593
3597
|
}
|
|
3594
|
-
function
|
|
3595
|
-
if (!
|
|
3598
|
+
function xo(e) {
|
|
3599
|
+
if (!vo(e)) return;
|
|
3596
3600
|
let t = [
|
|
3597
3601
|
"command",
|
|
3598
3602
|
"query",
|
|
@@ -3604,13 +3608,13 @@ function vo(e) {
|
|
|
3604
3608
|
"checks"
|
|
3605
3609
|
], n = [...t.filter((t) => t in e).map((t) => [t, e[t]]), ...Object.entries(e).filter(([e]) => !t.includes(e))], r = {};
|
|
3606
3610
|
for (let [e, t] of n) {
|
|
3607
|
-
let n =
|
|
3611
|
+
let n = bo(t);
|
|
3608
3612
|
if (n && (r[e] = n, Object.keys(r).length >= 2)) break;
|
|
3609
3613
|
}
|
|
3610
3614
|
return Object.keys(r).length > 0 ? r : void 0;
|
|
3611
3615
|
}
|
|
3612
|
-
function
|
|
3613
|
-
if (
|
|
3616
|
+
function So(e) {
|
|
3617
|
+
if (vo(e)) for (let t of [
|
|
3614
3618
|
"reasoning",
|
|
3615
3619
|
"thoughts",
|
|
3616
3620
|
"thought",
|
|
@@ -3618,20 +3622,20 @@ function yo(e) {
|
|
|
3618
3622
|
"detail"
|
|
3619
3623
|
]) {
|
|
3620
3624
|
let n = e[t];
|
|
3621
|
-
if (typeof n == "string" && n.trim().length > 0) return
|
|
3625
|
+
if (typeof n == "string" && n.trim().length > 0) return yo(n);
|
|
3622
3626
|
}
|
|
3623
3627
|
}
|
|
3624
|
-
function
|
|
3628
|
+
function Co(e) {
|
|
3625
3629
|
if (e.kind !== "reasoning") return;
|
|
3626
3630
|
let { part: t } = e;
|
|
3627
|
-
if (t.type === "reasoning") return
|
|
3631
|
+
if (t.type === "reasoning") return yo(t.text, 96);
|
|
3628
3632
|
}
|
|
3629
|
-
function
|
|
3633
|
+
function wo(e, t) {
|
|
3630
3634
|
if (e.kind === "reasoning") return {
|
|
3631
3635
|
form: "call",
|
|
3632
3636
|
kind: "reasoning",
|
|
3633
3637
|
name: "reasoning",
|
|
3634
|
-
detail:
|
|
3638
|
+
detail: Co(e)
|
|
3635
3639
|
};
|
|
3636
3640
|
if (e.kind === "dynamic-tool" && e.part.type === "dynamic-tool") {
|
|
3637
3641
|
let t = e.part;
|
|
@@ -3639,12 +3643,12 @@ function xo(e, t) {
|
|
|
3639
3643
|
form: "call",
|
|
3640
3644
|
kind: "dynamic-tool",
|
|
3641
3645
|
name: t.toolName || "Tool",
|
|
3642
|
-
args:
|
|
3643
|
-
detail:
|
|
3646
|
+
args: xo(t.input),
|
|
3647
|
+
detail: So(t.input)
|
|
3644
3648
|
};
|
|
3645
3649
|
}
|
|
3646
3650
|
if (e.kind === "tool" && S(e.part)) {
|
|
3647
|
-
let n = e.part, { toolEntry: r, toolKey: i } =
|
|
3651
|
+
let n = e.part, { toolEntry: r, toolKey: i } = yi(n, t), a = r?.label?.(n);
|
|
3648
3652
|
return a?.kind === "sentence" ? {
|
|
3649
3653
|
form: "sentence",
|
|
3650
3654
|
kind: "tool",
|
|
@@ -3655,8 +3659,8 @@ function xo(e, t) {
|
|
|
3655
3659
|
form: "call",
|
|
3656
3660
|
kind: "tool",
|
|
3657
3661
|
name: a?.name ?? i,
|
|
3658
|
-
args: a?.args ??
|
|
3659
|
-
detail: a?.detail ??
|
|
3662
|
+
args: a?.args ?? xo(n.input),
|
|
3663
|
+
detail: a?.detail ?? So(n.input),
|
|
3660
3664
|
isError: a?.isError
|
|
3661
3665
|
};
|
|
3662
3666
|
}
|
|
@@ -3666,58 +3670,58 @@ function xo(e, t) {
|
|
|
3666
3670
|
name: "Step"
|
|
3667
3671
|
};
|
|
3668
3672
|
}
|
|
3669
|
-
function
|
|
3673
|
+
function To(e) {
|
|
3670
3674
|
if (!e) return;
|
|
3671
3675
|
let t = Object.entries(e).filter((e) => typeof e[1] == "string" && e[1].trim().length > 0);
|
|
3672
|
-
if (t.length !== 0) return t.slice(0, 2).map(([e, t]) => `${e}: ${
|
|
3676
|
+
if (t.length !== 0) return t.slice(0, 2).map(([e, t]) => `${e}: ${yo(t, 36)}`).join(", ");
|
|
3673
3677
|
}
|
|
3674
|
-
function
|
|
3675
|
-
let t =
|
|
3678
|
+
function Eo(e) {
|
|
3679
|
+
let t = To(e.args);
|
|
3676
3680
|
return t ? `${e.name}(${t})` : e.name;
|
|
3677
3681
|
}
|
|
3678
|
-
function
|
|
3682
|
+
function Do(e) {
|
|
3679
3683
|
return e === "output-available" || e === "output-error" || e === "output-denied";
|
|
3680
3684
|
}
|
|
3681
|
-
function
|
|
3682
|
-
return !!e && !
|
|
3685
|
+
function Oo(e) {
|
|
3686
|
+
return !!e && !Do(e);
|
|
3683
3687
|
}
|
|
3684
|
-
function
|
|
3688
|
+
function ko(e, t) {
|
|
3685
3689
|
return rn(e, t);
|
|
3686
3690
|
}
|
|
3687
|
-
function
|
|
3688
|
-
return e.some(({ segment: e }) =>
|
|
3689
|
-
let t =
|
|
3691
|
+
function Ao({ items: e, labels: t, status: n, hasLaterText: r }) {
|
|
3692
|
+
return e.some(({ segment: e }) => ko(go(e), n)) ? "aborted" : !r && (n === "streaming" || n === "submitted") ? "running" : t.some((e) => e.isError) || e.some(({ segment: e }) => {
|
|
3693
|
+
let t = go(e);
|
|
3690
3694
|
return t === "output-error" || t === "output-denied";
|
|
3691
|
-
}) ? "error" : e.some(({ segment: e }) =>
|
|
3695
|
+
}) ? "error" : e.some(({ segment: e }) => Oo(go(e))) || !r && t.every((e) => e.kind === "reasoning") && (n === "streaming" || n === "submitted") ? "running" : "complete";
|
|
3692
3696
|
}
|
|
3693
|
-
function
|
|
3697
|
+
function jo(e) {
|
|
3694
3698
|
return e && `${e[0].toUpperCase()}${e.slice(1)}`;
|
|
3695
3699
|
}
|
|
3696
|
-
function
|
|
3700
|
+
function Mo(e) {
|
|
3697
3701
|
return e.filter((e) => e.kind !== "reasoning").length;
|
|
3698
3702
|
}
|
|
3699
|
-
function
|
|
3700
|
-
let n =
|
|
3703
|
+
function No(e, t) {
|
|
3704
|
+
let n = Mo(e);
|
|
3701
3705
|
if (n !== 0) return `${t === "running" || t === "aborted" ? "running" : "ran"} ${n} ${n === 1 ? "tool" : "tools"}`;
|
|
3702
3706
|
}
|
|
3703
|
-
function
|
|
3704
|
-
let n =
|
|
3705
|
-
if (n) return
|
|
3707
|
+
function Po(e, t) {
|
|
3708
|
+
let n = No(e, t);
|
|
3709
|
+
if (n) return jo(t === "error" ? `${n} with issues` : t === "aborted" ? `cancelled after ${n}` : n);
|
|
3706
3710
|
}
|
|
3707
|
-
function
|
|
3711
|
+
function Fo(e) {
|
|
3708
3712
|
let t = e.findLast((e) => e.kind !== "reasoning");
|
|
3709
3713
|
return t?.form === "sentence" ? t : void 0;
|
|
3710
3714
|
}
|
|
3711
|
-
function
|
|
3715
|
+
function Io(e, t, n) {
|
|
3712
3716
|
let r = e.length === 1 ? e[0] : void 0;
|
|
3713
3717
|
if (t === "running") return n || (r?.kind === "reasoning" ? `Reasoning${r.detail ? ` ${r.detail}` : ""}` : e.every((e) => e.kind === "reasoning") ? "Reasoning" : "Working...");
|
|
3714
3718
|
if (r?.form === "call") {
|
|
3715
|
-
let e =
|
|
3719
|
+
let e = Eo(r);
|
|
3716
3720
|
return t === "error" ? `Failed ${e}` : t === "aborted" ? `Cancelled ${e}` : r.kind === "reasoning" ? `Reasoned${r.detail ? ` ${r.detail}` : ""}` : `Called ${e}`;
|
|
3717
3721
|
}
|
|
3718
|
-
return e.every((e) => e.kind === "reasoning") ? "Reasoned" :
|
|
3722
|
+
return e.every((e) => e.kind === "reasoning") ? "Reasoned" : Po(e, t) ?? "Ran tools";
|
|
3719
3723
|
}
|
|
3720
|
-
function
|
|
3724
|
+
function Lo(e, t) {
|
|
3721
3725
|
if (t !== "running") {
|
|
3722
3726
|
if (e.length === 1) {
|
|
3723
3727
|
let t = e[0];
|
|
@@ -3726,28 +3730,28 @@ function Po(e, t) {
|
|
|
3726
3730
|
return Array.from(new Set([...e].sort((e, t) => e.kind === "reasoning" && t.kind !== "reasoning" ? 1 : e.kind !== "reasoning" && t.kind === "reasoning" ? -1 : 0).map((e) => e.form === "sentence" ? e.text : e.name))).slice(0, 3).join(", ") || void 0;
|
|
3727
3731
|
}
|
|
3728
3732
|
}
|
|
3729
|
-
function
|
|
3733
|
+
function Ro(e) {
|
|
3730
3734
|
let t;
|
|
3731
3735
|
for (let n = e.length - 1; n >= 0; n--) {
|
|
3732
3736
|
let r = e[n].segment;
|
|
3733
3737
|
if (r.kind === "dynamic-tool" && r.part.type === "dynamic-tool") {
|
|
3734
|
-
let e =
|
|
3738
|
+
let e = So(r.part.input);
|
|
3735
3739
|
if (e) return e;
|
|
3736
3740
|
}
|
|
3737
3741
|
if (r.kind === "tool" && S(r.part)) {
|
|
3738
|
-
let e =
|
|
3742
|
+
let e = So(r.part.input);
|
|
3739
3743
|
if (e) return e;
|
|
3740
3744
|
}
|
|
3741
|
-
r.kind === "reasoning" && (t ??=
|
|
3745
|
+
r.kind === "reasoning" && (t ??= Co(r));
|
|
3742
3746
|
}
|
|
3743
3747
|
return t;
|
|
3744
3748
|
}
|
|
3745
|
-
function
|
|
3746
|
-
return !e || e.role !== "assistant" ? !1 :
|
|
3749
|
+
function zo(e, t) {
|
|
3750
|
+
return !e || e.role !== "assistant" ? !1 : ho(ca(e.parts), t).some((e) => e.kind === "group" && !e.hasLaterText);
|
|
3747
3751
|
}
|
|
3748
|
-
function
|
|
3752
|
+
function Bo() {
|
|
3749
3753
|
let e = O(8), { message: t } = q(), { debugMode: n } = z(), r;
|
|
3750
|
-
e[0] === t.parts ? r = e[1] : (r =
|
|
3754
|
+
e[0] === t.parts ? r = e[1] : (r = ca(t.parts), e[0] = t.parts, e[1] = r);
|
|
3751
3755
|
let i = r, a;
|
|
3752
3756
|
if (e[2] !== n || e[3] !== t.id || e[4] !== i) {
|
|
3753
3757
|
let r;
|
|
@@ -3756,30 +3760,30 @@ function Lo() {
|
|
|
3756
3760
|
key: `${t.id}-${e.firstIndex}-group-${e.hasLaterText ? "past" : "current"}`
|
|
3757
3761
|
} : {
|
|
3758
3762
|
...e,
|
|
3759
|
-
key: `${t.id}-${
|
|
3760
|
-
}, e[6] = t.id, e[7] = r), a =
|
|
3763
|
+
key: `${t.id}-${la(e.segment, e.segmentIndex)}-${e.segment.kind}`
|
|
3764
|
+
}, e[6] = t.id, e[7] = r), a = ho(i, n).map(r), e[2] = n, e[3] = t.id, e[4] = i, e[5] = a;
|
|
3761
3765
|
} else a = e[5];
|
|
3762
3766
|
return a;
|
|
3763
3767
|
}
|
|
3764
|
-
var
|
|
3765
|
-
function
|
|
3766
|
-
let e = l(
|
|
3768
|
+
var Vo = o(null);
|
|
3769
|
+
function Ho() {
|
|
3770
|
+
let e = l(Vo);
|
|
3767
3771
|
if (!e) throw Error("CompactTrajectory group parts must be rendered within CompactTrajectory.Group");
|
|
3768
3772
|
return e;
|
|
3769
3773
|
}
|
|
3770
|
-
function
|
|
3774
|
+
function Uo(e) {
|
|
3771
3775
|
let t = O(21), { group: n, children: r } = e, { registry: i } = z(), { message: a } = q(), o = K(), [s, c] = g(!n.hasLaterText), l, u, d;
|
|
3772
3776
|
if (t[0] !== n.hasLaterText || t[1] !== n.items || t[2] !== i || t[3] !== o) {
|
|
3773
3777
|
let e;
|
|
3774
3778
|
t[7] === i ? e = t[8] : (e = (e) => {
|
|
3775
3779
|
let { segment: t } = e;
|
|
3776
|
-
return
|
|
3777
|
-
}, t[7] = i, t[8] = e), u = n.items.map(e), l =
|
|
3780
|
+
return wo(t, i);
|
|
3781
|
+
}, t[7] = i, t[8] = e), u = n.items.map(e), l = Ao({
|
|
3778
3782
|
items: n.items,
|
|
3779
3783
|
labels: u,
|
|
3780
3784
|
status: o,
|
|
3781
3785
|
hasLaterText: n.hasLaterText
|
|
3782
|
-
}), d =
|
|
3786
|
+
}), d = _o({
|
|
3783
3787
|
groupStatus: l,
|
|
3784
3788
|
labelCount: u.length
|
|
3785
3789
|
}), t[0] = n.hasLaterText, t[1] = n.items, t[2] = i, t[3] = o, t[4] = l, t[5] = u, t[6] = d;
|
|
@@ -3800,12 +3804,12 @@ function Bo(e) {
|
|
|
3800
3804
|
children: r
|
|
3801
3805
|
}), t[15] = r, t[16] = s, t[17] = m) : m = t[17];
|
|
3802
3806
|
let h;
|
|
3803
|
-
return t[18] !== p || t[19] !== m ? (h = /* @__PURE__ */ M(
|
|
3807
|
+
return t[18] !== p || t[19] !== m ? (h = /* @__PURE__ */ M(Vo, {
|
|
3804
3808
|
value: p,
|
|
3805
3809
|
children: m
|
|
3806
3810
|
}), t[18] = p, t[19] = m, t[20] = h) : h = t[20], h;
|
|
3807
3811
|
}
|
|
3808
|
-
function
|
|
3812
|
+
function Wo(e) {
|
|
3809
3813
|
let t = O(3), { children: n } = e, r;
|
|
3810
3814
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ M("button", {
|
|
3811
3815
|
type: "button",
|
|
@@ -3820,12 +3824,12 @@ function Vo(e) {
|
|
|
3820
3824
|
})
|
|
3821
3825
|
}), t[1] = n, t[2] = i), i;
|
|
3822
3826
|
}
|
|
3823
|
-
function
|
|
3824
|
-
let e = O(20), { items: t, labels: n, groupStatus: r, tone: i } =
|
|
3825
|
-
e[0] === n ? a = e[1] : (a =
|
|
3827
|
+
function Go() {
|
|
3828
|
+
let e = O(20), { items: t, labels: n, groupStatus: r, tone: i } = Ho(), a;
|
|
3829
|
+
e[0] === n ? a = e[1] : (a = Fo(n), e[0] = n, e[1] = a);
|
|
3826
3830
|
let o = a;
|
|
3827
3831
|
if (o) {
|
|
3828
|
-
let t =
|
|
3832
|
+
let t = Mo(n) - 1, a = t > 0 ? t : void 0, s;
|
|
3829
3833
|
return e[2] !== r || e[3] !== o.detail || e[4] !== o.text || e[5] !== a || e[6] !== i ? (s = {
|
|
3830
3834
|
title: o.text,
|
|
3831
3835
|
more: a,
|
|
@@ -3836,9 +3840,9 @@ function Ho() {
|
|
|
3836
3840
|
}, e[2] = r, e[3] = o.detail, e[4] = o.text, e[5] = a, e[6] = i, e[7] = s) : s = e[7], s;
|
|
3837
3841
|
}
|
|
3838
3842
|
let s;
|
|
3839
|
-
e[8] !== r || e[9] !== t || e[10] !== n ? (s =
|
|
3843
|
+
e[8] !== r || e[9] !== t || e[10] !== n ? (s = Io(n, r, Ro(t)), e[8] = r, e[9] = t, e[10] = n, e[11] = s) : s = e[11];
|
|
3840
3844
|
let c = s, l;
|
|
3841
|
-
e[12] !== r || e[13] !== n ? (l =
|
|
3845
|
+
e[12] !== r || e[13] !== n ? (l = Lo(n, r), e[12] = r, e[13] = n, e[14] = l) : l = e[14];
|
|
3842
3846
|
let u = l, d;
|
|
3843
3847
|
return e[15] !== u || e[16] !== r || e[17] !== c || e[18] !== i ? (d = {
|
|
3844
3848
|
title: c,
|
|
@@ -3849,8 +3853,8 @@ function Ho() {
|
|
|
3849
3853
|
groupStatus: r
|
|
3850
3854
|
}, e[15] = u, e[16] = r, e[17] = c, e[18] = i, e[19] = d) : d = e[19], d;
|
|
3851
3855
|
}
|
|
3852
|
-
function
|
|
3853
|
-
let t = O(14), { title: n, suffix: r, children: i } = e, a =
|
|
3856
|
+
function Ko(e) {
|
|
3857
|
+
let t = O(14), { title: n, suffix: r, children: i } = e, a = Go(), { tone: o, groupStatus: s } = a, c = n === void 0, l = n ?? a.title, u = r ? `${l} · ${r}` : l, d = c ? a.more : void 0, f = s === "running" ? "text-info" : o.title, p = c && a.isSentence ? "auto" : void 0, m = s === "running", h;
|
|
3854
3858
|
t[0] === f ? h = t[1] : (h = k("max-w-full min-w-0 truncate", f), t[0] = f, t[1] = h);
|
|
3855
3859
|
let g;
|
|
3856
3860
|
t[2] !== p || t[3] !== m || t[4] !== h || t[5] !== u ? (g = /* @__PURE__ */ M(W, {
|
|
@@ -3876,12 +3880,12 @@ function Uo(e) {
|
|
|
3876
3880
|
]
|
|
3877
3881
|
}), t[10] = i, t[11] = g, t[12] = _, t[13] = v) : v = t[13], v;
|
|
3878
3882
|
}
|
|
3879
|
-
function
|
|
3880
|
-
let e = O(2), { tone: t } =
|
|
3883
|
+
function qo() {
|
|
3884
|
+
let e = O(2), { tone: t } = Ho(), n;
|
|
3881
3885
|
return e[0] === t.chevron ? n = e[1] : (n = /* @__PURE__ */ M(cn, { className: t.chevron }), e[0] = t.chevron, e[1] = n), n;
|
|
3882
3886
|
}
|
|
3883
|
-
function
|
|
3884
|
-
let t = O(6), { detail: n } = e, { title: r, detail: i, isSentence: a, tone: o } =
|
|
3887
|
+
function Jo(e) {
|
|
3888
|
+
let t = O(6), { detail: n } = e, { title: r, detail: i, isSentence: a, tone: o } = Go();
|
|
3885
3889
|
if (n === null) return null;
|
|
3886
3890
|
let s = n ?? i;
|
|
3887
3891
|
if (!s || s === r) return null;
|
|
@@ -3894,8 +3898,8 @@ function Go(e) {
|
|
|
3894
3898
|
children: s
|
|
3895
3899
|
}), t[2] = s, t[3] = c, t[4] = l, t[5] = u) : u = t[5], u;
|
|
3896
3900
|
}
|
|
3897
|
-
function
|
|
3898
|
-
let t = O(14), { children: n } = e, { items: r, messageId: i, groupStatus: a } =
|
|
3901
|
+
function Yo(e) {
|
|
3902
|
+
let t = O(14), { children: n } = e, { items: r, messageId: i, groupStatus: a } = Ho(), o = a === "running", s;
|
|
3899
3903
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (s = {
|
|
3900
3904
|
initial: "instant",
|
|
3901
3905
|
resize: "instant"
|
|
@@ -3904,7 +3908,7 @@ function Ko(e) {
|
|
|
3904
3908
|
t[1] === d ? f = t[2] : (f = k("mt-2", d), t[1] = d, t[2] = f);
|
|
3905
3909
|
let p = o ? l : void 0, m;
|
|
3906
3910
|
t[3] !== n || t[4] !== r || t[5] !== i ? (m = n ?? r.map((e, t) => {
|
|
3907
|
-
let { segment: n } = e, r = `${i}-${
|
|
3911
|
+
let { segment: n } = e, r = `${i}-${la(n, t)}-${n.kind}`;
|
|
3908
3912
|
return n.kind === "tool" ? /* @__PURE__ */ M(Z.Tool, { segment: n }, r) : n.kind === "reasoning" ? /* @__PURE__ */ M(Z.Reasoning, { segment: n }, r) : n.kind === "dynamic-tool" ? /* @__PURE__ */ M(Z.DynamicTool, { segment: n }, r) : null;
|
|
3909
3913
|
}), t[3] = n, t[4] = r, t[5] = i, t[6] = m) : m = t[6];
|
|
3910
3914
|
let h;
|
|
@@ -3919,11 +3923,11 @@ function Ko(e) {
|
|
|
3919
3923
|
children: h
|
|
3920
3924
|
}), t[10] = u, t[11] = f, t[12] = h, t[13] = g) : g = t[13], g;
|
|
3921
3925
|
}
|
|
3922
|
-
function
|
|
3926
|
+
function Xo(e) {
|
|
3923
3927
|
let t = O(19), { item: n, textClassName: r } = e, i = r === void 0 ? "my-4" : r, { elements: a } = G(), { segment: o } = n;
|
|
3924
3928
|
if (o.kind === "text") {
|
|
3925
3929
|
let e;
|
|
3926
|
-
t[0] === o.parts ? e = t[1] : (e = o.parts.filter(
|
|
3930
|
+
t[0] === o.parts ? e = t[1] : (e = o.parts.filter(Zo), t[0] = o.parts, t[1] = e);
|
|
3927
3931
|
let n = e;
|
|
3928
3932
|
if (n.length === 0) return null;
|
|
3929
3933
|
let r;
|
|
@@ -3960,55 +3964,55 @@ function qo(e) {
|
|
|
3960
3964
|
}
|
|
3961
3965
|
return null;
|
|
3962
3966
|
}
|
|
3963
|
-
function
|
|
3967
|
+
function Zo(e) {
|
|
3964
3968
|
let { part: t } = e;
|
|
3965
|
-
return !
|
|
3966
|
-
}
|
|
3967
|
-
var
|
|
3968
|
-
Group:
|
|
3969
|
-
GroupTrigger:
|
|
3970
|
-
GroupTitle:
|
|
3971
|
-
GroupChevron:
|
|
3972
|
-
GroupDetail:
|
|
3973
|
-
GroupContent:
|
|
3974
|
-
Segment:
|
|
3969
|
+
return !qi(t);
|
|
3970
|
+
}
|
|
3971
|
+
var Qo = {
|
|
3972
|
+
Group: Uo,
|
|
3973
|
+
GroupTrigger: Wo,
|
|
3974
|
+
GroupTitle: Ko,
|
|
3975
|
+
GroupChevron: qo,
|
|
3976
|
+
GroupDetail: Jo,
|
|
3977
|
+
GroupContent: Yo,
|
|
3978
|
+
Segment: Xo
|
|
3975
3979
|
};
|
|
3976
|
-
function
|
|
3980
|
+
function $o() {
|
|
3977
3981
|
let e = O(1), t = K(), { messages: n } = G(), { debugMode: r } = z(), i = n[n.length - 1];
|
|
3978
|
-
if (t !== "ready" && t !== "error" &&
|
|
3982
|
+
if (t !== "ready" && t !== "error" && zo(i, r)) return null;
|
|
3979
3983
|
let a;
|
|
3980
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(
|
|
3984
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ M(ja, {}), e[0] = a) : a = e[0], a;
|
|
3981
3985
|
}
|
|
3982
|
-
var
|
|
3983
|
-
Root:
|
|
3984
|
-
List:
|
|
3985
|
-
Item:
|
|
3986
|
-
UserBubble:
|
|
3986
|
+
var es = {
|
|
3987
|
+
Root: Sa,
|
|
3988
|
+
List: Ca,
|
|
3989
|
+
Item: wa,
|
|
3990
|
+
UserBubble: uo,
|
|
3987
3991
|
AssistantContent: c(function(e) {
|
|
3988
|
-
let t = O(5), { className: n } = e, r =
|
|
3989
|
-
t[0] === r ? i = t[1] : (i = r.map(
|
|
3992
|
+
let t = O(5), { className: n } = e, r = Bo(), i;
|
|
3993
|
+
t[0] === r ? i = t[1] : (i = r.map(ts), t[0] = r, t[1] = i);
|
|
3990
3994
|
let a;
|
|
3991
3995
|
return t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ M("div", {
|
|
3992
3996
|
className: n,
|
|
3993
3997
|
children: i
|
|
3994
3998
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
3995
3999
|
}),
|
|
3996
|
-
Actions:
|
|
3997
|
-
CopyAction:
|
|
3998
|
-
RegenerateAction:
|
|
3999
|
-
CopyDebugJsonAction:
|
|
4000
|
-
Thinking:
|
|
4001
|
-
Error:
|
|
4000
|
+
Actions: ga,
|
|
4001
|
+
CopyAction: _a,
|
|
4002
|
+
RegenerateAction: va,
|
|
4003
|
+
CopyDebugJsonAction: ya,
|
|
4004
|
+
Thinking: $o,
|
|
4005
|
+
Error: xa
|
|
4002
4006
|
};
|
|
4003
|
-
function
|
|
4004
|
-
return e.kind === "group" ? /* @__PURE__ */ N(
|
|
4007
|
+
function ts(e) {
|
|
4008
|
+
return e.kind === "group" ? /* @__PURE__ */ N(Uo, {
|
|
4005
4009
|
group: e,
|
|
4006
|
-
children: [/* @__PURE__ */ N(
|
|
4007
|
-
}, e.key) : /* @__PURE__ */ M(
|
|
4010
|
+
children: [/* @__PURE__ */ N(Wo, { children: [/* @__PURE__ */ M(Ko, { children: /* @__PURE__ */ M(qo, {}) }), /* @__PURE__ */ M(Jo, {})] }), /* @__PURE__ */ M(Yo, {})]
|
|
4011
|
+
}, e.key) : /* @__PURE__ */ M(Xo, { item: e }, e.key);
|
|
4008
4012
|
}
|
|
4009
4013
|
//#endregion
|
|
4010
4014
|
//#region src/lib/chat/trajectory/trajectories/messages.tsx
|
|
4011
|
-
function
|
|
4015
|
+
function ns(e) {
|
|
4012
4016
|
let t = O(8), { message: n, className: r } = e, i;
|
|
4013
4017
|
t[0] === r ? i = t[1] : (i = k("text-destructive/90 bg-destructive/10 flex items-start gap-2 rounded-md px-3 py-2 text-sm", r), t[0] = r, t[1] = i);
|
|
4014
4018
|
let a;
|
|
@@ -4021,7 +4025,7 @@ function $o(e) {
|
|
|
4021
4025
|
children: [a, o]
|
|
4022
4026
|
}), t[5] = i, t[6] = o, t[7] = s) : s = t[7], s;
|
|
4023
4027
|
}
|
|
4024
|
-
function
|
|
4028
|
+
function rs(e) {
|
|
4025
4029
|
let t = O(9), { name: n, args: r } = e, i;
|
|
4026
4030
|
t[0] === r ? i = t[1] : (i = r ? Object.values(r)[0] : void 0, t[0] = r, t[1] = i);
|
|
4027
4031
|
let a = i, o;
|
|
@@ -4041,13 +4045,13 @@ function es(e) {
|
|
|
4041
4045
|
let c;
|
|
4042
4046
|
return t[6] !== o || t[7] !== s ? (c = /* @__PURE__ */ N(j, { children: [o, s] }), t[6] = o, t[7] = s, t[8] = c) : c = t[8], c;
|
|
4043
4047
|
}
|
|
4044
|
-
function
|
|
4048
|
+
function is(e) {
|
|
4045
4049
|
let t = O(15), { part: n } = e, r = z(), i, a;
|
|
4046
4050
|
if (t[0] !== r.registry || t[1] !== n) {
|
|
4047
4051
|
a = Symbol.for("react.early_return_sentinel");
|
|
4048
4052
|
bb0: {
|
|
4049
|
-
let { toolEntry: e } =
|
|
4050
|
-
if (e &&
|
|
4053
|
+
let { toolEntry: e } = yi(n, r.registry);
|
|
4054
|
+
if (e && bi(e, n.state)) {
|
|
4051
4055
|
let t = e.label?.(n);
|
|
4052
4056
|
if (!t) {
|
|
4053
4057
|
a = null;
|
|
@@ -4060,7 +4064,7 @@ function ts(e) {
|
|
|
4060
4064
|
dir: "auto",
|
|
4061
4065
|
className: "ms-2 truncate text-start",
|
|
4062
4066
|
children: t.text
|
|
4063
|
-
}) : /* @__PURE__ */ M(
|
|
4067
|
+
}) : /* @__PURE__ */ M(rs, {
|
|
4064
4068
|
name: t.name,
|
|
4065
4069
|
args: t.args
|
|
4066
4070
|
})]
|
|
@@ -4073,14 +4077,14 @@ function ts(e) {
|
|
|
4073
4077
|
} else i = t[2], a = t[3];
|
|
4074
4078
|
if (a !== Symbol.for("react.early_return_sentinel")) return a;
|
|
4075
4079
|
let o = i, s;
|
|
4076
|
-
t[4] !== o || t[5] !== n ? (s = o && /* @__PURE__ */ M(
|
|
4080
|
+
t[4] !== o || t[5] !== n ? (s = o && /* @__PURE__ */ M(Ui, {
|
|
4077
4081
|
label: o,
|
|
4078
4082
|
part: n
|
|
4079
4083
|
}), t[4] = o, t[5] = n, t[6] = s) : s = t[6];
|
|
4080
4084
|
let c;
|
|
4081
|
-
t[7] === o ? c = t[8] : (c = o?.isError && o.detail && /* @__PURE__ */ M(
|
|
4085
|
+
t[7] === o ? c = t[8] : (c = o?.isError && o.detail && /* @__PURE__ */ M(ns, { message: o.detail }), t[7] = o, t[8] = c);
|
|
4082
4086
|
let l;
|
|
4083
|
-
t[9] === n ? l = t[10] : (l = /* @__PURE__ */ M(
|
|
4087
|
+
t[9] === n ? l = t[10] : (l = /* @__PURE__ */ M(zi, { part: n }), t[9] = n, t[10] = l);
|
|
4084
4088
|
let u;
|
|
4085
4089
|
return t[11] !== s || t[12] !== c || t[13] !== l ? (u = /* @__PURE__ */ N(j, { children: [
|
|
4086
4090
|
s,
|
|
@@ -4088,7 +4092,7 @@ function ts(e) {
|
|
|
4088
4092
|
l
|
|
4089
4093
|
] }), t[11] = s, t[12] = c, t[13] = l, t[14] = u) : u = t[14], u;
|
|
4090
4094
|
}
|
|
4091
|
-
function
|
|
4095
|
+
function as(e) {
|
|
4092
4096
|
let t = O(5), { part: n } = e, [r, i] = g(!1), a;
|
|
4093
4097
|
t[0] === n.text ? a = t[1] : (a = /* @__PURE__ */ M(Y, {
|
|
4094
4098
|
mode: "static",
|
|
@@ -4098,7 +4102,7 @@ function ns(e) {
|
|
|
4098
4102
|
return t[2] !== r || t[3] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
4099
4103
|
"data-copy-exclude": "assistant-snapshot",
|
|
4100
4104
|
className: "bg-muted/30 prose max-w-auto prose-sm text-muted-foreground border-border mb-4 w-full min-w-full rounded-lg p-3",
|
|
4101
|
-
children: /* @__PURE__ */ M(
|
|
4105
|
+
children: /* @__PURE__ */ M(Xa, {
|
|
4102
4106
|
label: "Reasoning",
|
|
4103
4107
|
open: r,
|
|
4104
4108
|
onOpenChange: i,
|
|
@@ -4109,12 +4113,12 @@ function ns(e) {
|
|
|
4109
4113
|
})
|
|
4110
4114
|
}), t[2] = r, t[3] = a, t[4] = o) : o = t[4], o;
|
|
4111
4115
|
}
|
|
4112
|
-
function
|
|
4113
|
-
let t = O(16), { part: n } = e, { elements: r } = G(), i =
|
|
4116
|
+
function os(e) {
|
|
4117
|
+
let t = O(16), { part: n } = e, { elements: r } = G(), i = Bi();
|
|
4114
4118
|
if (n.type === "text") {
|
|
4115
|
-
if (
|
|
4119
|
+
if (qi(n)) return null;
|
|
4116
4120
|
let e;
|
|
4117
|
-
return t[0] !== r || t[1] !== n.citations || t[2] !== n.text ? (e = /* @__PURE__ */ M(
|
|
4121
|
+
return t[0] !== r || t[1] !== n.citations || t[2] !== n.text ? (e = /* @__PURE__ */ M(Ri, {
|
|
4118
4122
|
text: n.text,
|
|
4119
4123
|
citations: n.citations,
|
|
4120
4124
|
elements: r
|
|
@@ -4126,15 +4130,15 @@ function rs(e) {
|
|
|
4126
4130
|
}
|
|
4127
4131
|
if (S(n)) {
|
|
4128
4132
|
let e;
|
|
4129
|
-
return t[7] === n ? e = t[8] : (e = /* @__PURE__ */ M(
|
|
4133
|
+
return t[7] === n ? e = t[8] : (e = /* @__PURE__ */ M(is, { part: n }), t[7] = n, t[8] = e), e;
|
|
4130
4134
|
}
|
|
4131
4135
|
if (n.type === "reasoning" && n.text) {
|
|
4132
4136
|
let e;
|
|
4133
|
-
return t[9] !== i || t[10] !== n ? (e = i ? /* @__PURE__ */ M(
|
|
4137
|
+
return t[9] !== i || t[10] !== n ? (e = i ? /* @__PURE__ */ M(as, { part: n }) : null, t[9] = i, t[10] = n, t[11] = e) : e = t[11], e;
|
|
4134
4138
|
}
|
|
4135
4139
|
if (n.type === "file") {
|
|
4136
4140
|
let e;
|
|
4137
|
-
return t[12] !== n.filename || t[13] !== n.mediaType || t[14] !== n.url ? (e = /* @__PURE__ */ M(
|
|
4141
|
+
return t[12] !== n.filename || t[13] !== n.mediaType || t[14] !== n.url ? (e = /* @__PURE__ */ M(Mi, {
|
|
4138
4142
|
filename: n.filename,
|
|
4139
4143
|
mediaType: n.mediaType,
|
|
4140
4144
|
url: n.url
|
|
@@ -4142,13 +4146,13 @@ function rs(e) {
|
|
|
4142
4146
|
}
|
|
4143
4147
|
return null;
|
|
4144
4148
|
}
|
|
4145
|
-
var
|
|
4149
|
+
var ss = c(function(e) {
|
|
4146
4150
|
let t = O(10), { className: n } = e, { message: r } = q(), i;
|
|
4147
4151
|
t[0] === n ? i = t[1] : (i = k("flex-1 space-y-3", n), t[0] = n, t[1] = i);
|
|
4148
4152
|
let a;
|
|
4149
4153
|
if (t[2] !== r.id || t[3] !== r.parts) {
|
|
4150
4154
|
let e;
|
|
4151
|
-
t[5] === r.id ? e = t[6] : (e = (e, t) => /* @__PURE__ */ M(
|
|
4155
|
+
t[5] === r.id ? e = t[6] : (e = (e, t) => /* @__PURE__ */ M(os, { part: e }, `${r.id}-${t}`), t[5] = r.id, t[6] = e), a = r.parts.map(e), t[2] = r.id, t[3] = r.parts, t[4] = a;
|
|
4152
4156
|
} else a = t[4];
|
|
4153
4157
|
let o;
|
|
4154
4158
|
return t[7] !== i || t[8] !== a ? (o = /* @__PURE__ */ M("div", {
|
|
@@ -4156,9 +4160,9 @@ var is = c(function(e) {
|
|
|
4156
4160
|
children: a
|
|
4157
4161
|
}), t[7] = i, t[8] = a, t[9] = o) : o = t[9], o;
|
|
4158
4162
|
});
|
|
4159
|
-
function
|
|
4163
|
+
function cs(e) {
|
|
4160
4164
|
let t = O(9), { className: n, label: r } = e, i;
|
|
4161
|
-
t[0] === r ? i = t[1] : (i = r && r.split("\n").filter(
|
|
4165
|
+
t[0] === r ? i = t[1] : (i = r && r.split("\n").filter(ls).pop() || "Thinking...", t[0] = r, t[1] = i);
|
|
4162
4166
|
let a = i, o;
|
|
4163
4167
|
t[2] === n ? o = t[3] : (o = k("flex items-start", n), t[2] = n, t[3] = o);
|
|
4164
4168
|
let s;
|
|
@@ -4173,33 +4177,33 @@ function as(e) {
|
|
|
4173
4177
|
children: s
|
|
4174
4178
|
}), t[6] = o, t[7] = s, t[8] = c) : c = t[8], c;
|
|
4175
4179
|
}
|
|
4176
|
-
function
|
|
4180
|
+
function ls(e) {
|
|
4177
4181
|
return e.trim();
|
|
4178
4182
|
}
|
|
4179
|
-
function
|
|
4183
|
+
function us() {
|
|
4180
4184
|
let e = O(5), t = K(), { messages: n } = G(), r = n[n.length - 1], i;
|
|
4181
|
-
e[0] !== t || e[1] !== r ? (i =
|
|
4185
|
+
e[0] !== t || e[1] !== r ? (i = Oa(t, r), e[0] = t, e[1] = r, e[2] = i) : i = e[2];
|
|
4182
4186
|
let a = i;
|
|
4183
4187
|
if (!a) return null;
|
|
4184
4188
|
let o;
|
|
4185
|
-
return e[3] === a ? o = e[4] : (o = /* @__PURE__ */ M(
|
|
4189
|
+
return e[3] === a ? o = e[4] : (o = /* @__PURE__ */ M(cs, {
|
|
4186
4190
|
label: a,
|
|
4187
4191
|
className: "mt-2"
|
|
4188
4192
|
}), e[3] = a, e[4] = o), o;
|
|
4189
4193
|
}
|
|
4190
|
-
var
|
|
4191
|
-
Root:
|
|
4192
|
-
List:
|
|
4193
|
-
Item:
|
|
4194
|
-
UserBubble:
|
|
4195
|
-
AssistantContent:
|
|
4196
|
-
Thinking:
|
|
4197
|
-
Error:
|
|
4198
|
-
Actions:
|
|
4199
|
-
CopyAction:
|
|
4200
|
-
RegenerateAction:
|
|
4201
|
-
CopyDebugJsonAction:
|
|
4202
|
-
},
|
|
4194
|
+
var ds = {
|
|
4195
|
+
Root: Sa,
|
|
4196
|
+
List: Ca,
|
|
4197
|
+
Item: wa,
|
|
4198
|
+
UserBubble: uo,
|
|
4199
|
+
AssistantContent: ss,
|
|
4200
|
+
Thinking: us,
|
|
4201
|
+
Error: xa,
|
|
4202
|
+
Actions: ga,
|
|
4203
|
+
CopyAction: _a,
|
|
4204
|
+
RegenerateAction: va,
|
|
4205
|
+
CopyDebugJsonAction: ya
|
|
4206
|
+
}, fs = {
|
|
4203
4207
|
braille: {
|
|
4204
4208
|
frames: [
|
|
4205
4209
|
"⠋",
|
|
@@ -4266,10 +4270,10 @@ var cs = {
|
|
|
4266
4270
|
interval: 100
|
|
4267
4271
|
}
|
|
4268
4272
|
};
|
|
4269
|
-
function
|
|
4273
|
+
function ps(e) {
|
|
4270
4274
|
let t = O(15), n, r, i;
|
|
4271
4275
|
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({className: n, variant: i, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
4272
|
-
let a = i === void 0 ? "braille" : i, o = St(), { frames: s, interval: c } =
|
|
4276
|
+
let a = i === void 0 ? "braille" : i, o = St(), { frames: s, interval: c } = fs[a], [l, u] = g(0), f, p;
|
|
4273
4277
|
t[4] !== o || t[5] !== s.length || t[6] !== c ? (f = () => {
|
|
4274
4278
|
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
4275
4279
|
let e = o.setInterval(() => {
|
|
@@ -4294,9 +4298,9 @@ function us(e) {
|
|
|
4294
4298
|
}
|
|
4295
4299
|
//#endregion
|
|
4296
4300
|
//#region src/lib/chat/trajectory/trajectories/timeline.tsx
|
|
4297
|
-
function
|
|
4301
|
+
function ms(e) {
|
|
4298
4302
|
let t = O(11), { Icon: n, isLast: r, isLoading: i, aborted: a, state: o, isError: s } = e, c;
|
|
4299
|
-
t[0] !== n || t[1] !== a || t[2] !== s || t[3] !== i || t[4] !== o ? (c = i ? /* @__PURE__ */ M(
|
|
4303
|
+
t[0] !== n || t[1] !== a || t[2] !== s || t[3] !== i || t[4] !== o ? (c = i ? /* @__PURE__ */ M(ps, { className: "text-muted-foreground z-10 shrink-0 text-sm" }) : a ? /* @__PURE__ */ M(Ie, { className: "text-destructive z-10 size-3.5 shrink-0" }) : /* @__PURE__ */ M(n, { className: k("z-10 size-3.5 shrink-0", o === "output-error" || s ? "text-destructive" : "text-muted-foreground") }), t[0] = n, t[1] = a, t[2] = s, t[3] = i, t[4] = o, t[5] = c) : c = t[5];
|
|
4300
4304
|
let l;
|
|
4301
4305
|
t[6] === r ? l = t[7] : (l = !r && /* @__PURE__ */ M("span", { className: "bg-border w-px flex-1" }), t[6] = r, t[7] = l);
|
|
4302
4306
|
let u;
|
|
@@ -4305,16 +4309,16 @@ function ds(e) {
|
|
|
4305
4309
|
children: [c, l]
|
|
4306
4310
|
}), t[8] = c, t[9] = l, t[10] = u) : u = t[10], u;
|
|
4307
4311
|
}
|
|
4308
|
-
function
|
|
4309
|
-
let t = O(15), { isLast: n, label: r, state: i, aborted: a, children: o } = e, s = l(
|
|
4310
|
-
t[0] !== f || t[1] !== d || t[2] !== c?.isError || t[3] !== u || t[4] !== n || t[5] !== p ? (m = f ? /* @__PURE__ */ M(
|
|
4312
|
+
function hs(e) {
|
|
4313
|
+
let t = O(15), { isLast: n, label: r, state: i, aborted: a, children: o } = e, s = l(ea), c = r ?? s?.label, u = i ?? s?.state, d = a ?? s?.aborted ?? !1, f = c?.icon, p = !!u && !d && u !== "output-available" && u !== "output-error", m;
|
|
4314
|
+
t[0] !== f || t[1] !== d || t[2] !== c?.isError || t[3] !== u || t[4] !== n || t[5] !== p ? (m = f ? /* @__PURE__ */ M(ms, {
|
|
4311
4315
|
Icon: f,
|
|
4312
4316
|
isLast: n,
|
|
4313
4317
|
isLoading: p,
|
|
4314
4318
|
aborted: d,
|
|
4315
4319
|
state: u,
|
|
4316
4320
|
isError: c?.isError ?? !1
|
|
4317
|
-
}) : /* @__PURE__ */ M(
|
|
4321
|
+
}) : /* @__PURE__ */ M(ka, { isLast: n }), t[0] = f, t[1] = d, t[2] = c?.isError, t[3] = u, t[4] = n, t[5] = p, t[6] = m) : m = t[6];
|
|
4318
4322
|
let h = m, g = n ? "" : "pb-3.5", _;
|
|
4319
4323
|
t[7] === g ? _ = t[8] : (_ = k("min-w-0 flex-1", g), t[7] = g, t[8] = _);
|
|
4320
4324
|
let v;
|
|
@@ -4323,16 +4327,16 @@ function fs(e) {
|
|
|
4323
4327
|
children: o
|
|
4324
4328
|
}), t[9] = o, t[10] = _, t[11] = v) : v = t[11];
|
|
4325
4329
|
let y;
|
|
4326
|
-
return t[12] !== h || t[13] !== v ? (y = /* @__PURE__ */ M(
|
|
4330
|
+
return t[12] !== h || t[13] !== v ? (y = /* @__PURE__ */ M(Aa, {
|
|
4327
4331
|
marker: h,
|
|
4328
4332
|
children: v
|
|
4329
4333
|
}), t[12] = h, t[13] = v, t[14] = y) : y = t[14], y;
|
|
4330
4334
|
}
|
|
4331
|
-
function
|
|
4335
|
+
function gs(e) {
|
|
4332
4336
|
let t = O(10), { label: n, state: r, part: i, defaultOpen: a, children: o } = e, s = a !== void 0 && a, c;
|
|
4333
4337
|
t[0] !== n || t[1] !== i || t[2] !== r ? (c = /* @__PURE__ */ M(L, {
|
|
4334
4338
|
className: "cursor-pointer",
|
|
4335
|
-
children: /* @__PURE__ */ M(
|
|
4339
|
+
children: /* @__PURE__ */ M(Gi, {
|
|
4336
4340
|
label: n,
|
|
4337
4341
|
state: r,
|
|
4338
4342
|
part: i
|
|
@@ -4347,20 +4351,20 @@ function ps(e) {
|
|
|
4347
4351
|
children: [c, l]
|
|
4348
4352
|
}), t[6] = s, t[7] = c, t[8] = l, t[9] = u) : u = t[9], u;
|
|
4349
4353
|
}
|
|
4350
|
-
var
|
|
4351
|
-
Item:
|
|
4352
|
-
Disclosure:
|
|
4353
|
-
},
|
|
4354
|
-
Root:
|
|
4355
|
-
List:
|
|
4356
|
-
Item:
|
|
4357
|
-
UserBubble:
|
|
4354
|
+
var _s = {
|
|
4355
|
+
Item: hs,
|
|
4356
|
+
Disclosure: gs
|
|
4357
|
+
}, vs = {
|
|
4358
|
+
Root: Sa,
|
|
4359
|
+
List: Ca,
|
|
4360
|
+
Item: wa,
|
|
4361
|
+
UserBubble: uo,
|
|
4358
4362
|
AssistantContent: c(function(e) {
|
|
4359
|
-
let t = O(12), { className: n } = e, { message: r } = q(), { elements: i } = G(), { debugMode: a } = z(), o =
|
|
4360
|
-
t[0] === r.parts ? c = t[1] : (c =
|
|
4363
|
+
let t = O(12), { className: n } = e, { message: r } = q(), { elements: i } = G(), { debugMode: a } = z(), o = Bi(), s = X(), c;
|
|
4364
|
+
t[0] === r.parts ? c = t[1] : (c = ca(r.parts), t[0] = r.parts, t[1] = c);
|
|
4361
4365
|
let l = c, u;
|
|
4362
4366
|
t[2] !== a || t[3] !== i || t[4] !== s || t[5] !== r.id || t[6] !== l || t[7] !== o ? (u = l.map((e, t) => {
|
|
4363
|
-
let n = `${r.id}-${
|
|
4367
|
+
let n = `${r.id}-${la(e, t)}-${e.kind}`;
|
|
4364
4368
|
if (e.kind === "text") return /* @__PURE__ */ M(Z.Text, {
|
|
4365
4369
|
segment: e,
|
|
4366
4370
|
elements: i,
|
|
@@ -4370,33 +4374,33 @@ var ms = {
|
|
|
4370
4374
|
if (e.kind === "source") return /* @__PURE__ */ M(Z.Source, { segment: e }, n);
|
|
4371
4375
|
if (e.kind === "dynamic-tool") {
|
|
4372
4376
|
if (!o) return null;
|
|
4373
|
-
let r = !
|
|
4374
|
-
return /* @__PURE__ */ M(
|
|
4377
|
+
let r = !sa(l, t, !0);
|
|
4378
|
+
return /* @__PURE__ */ M(_s.Item, {
|
|
4375
4379
|
isLast: r,
|
|
4376
4380
|
children: /* @__PURE__ */ M(Z.DynamicTool, { segment: e })
|
|
4377
4381
|
}, n);
|
|
4378
4382
|
}
|
|
4379
4383
|
if (e.kind === "reasoning") {
|
|
4380
4384
|
if (s || e.part.type !== "reasoning") return null;
|
|
4381
|
-
let r = !
|
|
4385
|
+
let r = !sa(l, t, a), i = {
|
|
4382
4386
|
name: "Reasoning",
|
|
4383
4387
|
icon: Je,
|
|
4384
4388
|
args: { text: [...e.part.text].slice(0, 60).join("") }
|
|
4385
4389
|
};
|
|
4386
|
-
return /* @__PURE__ */ M(
|
|
4390
|
+
return /* @__PURE__ */ M(_s.Item, {
|
|
4387
4391
|
isLast: r,
|
|
4388
4392
|
label: i,
|
|
4389
|
-
children: /* @__PURE__ */ M(
|
|
4393
|
+
children: /* @__PURE__ */ M(_s.Disclosure, {
|
|
4390
4394
|
label: i,
|
|
4391
4395
|
children: /* @__PURE__ */ M(Z.Reasoning, { segment: e })
|
|
4392
4396
|
})
|
|
4393
4397
|
}, n);
|
|
4394
4398
|
}
|
|
4395
4399
|
if (e.kind === "tool") {
|
|
4396
|
-
let r = !
|
|
4400
|
+
let r = !sa(l, t, a);
|
|
4397
4401
|
return /* @__PURE__ */ M(Z.Tool, {
|
|
4398
4402
|
segment: e,
|
|
4399
|
-
children: /* @__PURE__ */ M(
|
|
4403
|
+
children: /* @__PURE__ */ M(_s.Item, {
|
|
4400
4404
|
isLast: r,
|
|
4401
4405
|
children: /* @__PURE__ */ M(Z.ToolDisclosure, {})
|
|
4402
4406
|
})
|
|
@@ -4410,16 +4414,16 @@ var ms = {
|
|
|
4410
4414
|
children: u
|
|
4411
4415
|
}), t[9] = n, t[10] = u, t[11] = d) : d = t[11], d;
|
|
4412
4416
|
}),
|
|
4413
|
-
Actions:
|
|
4414
|
-
CopyAction:
|
|
4415
|
-
RegenerateAction:
|
|
4416
|
-
CopyDebugJsonAction:
|
|
4417
|
-
Thinking:
|
|
4418
|
-
Error:
|
|
4417
|
+
Actions: ga,
|
|
4418
|
+
CopyAction: _a,
|
|
4419
|
+
RegenerateAction: va,
|
|
4420
|
+
CopyDebugJsonAction: ya,
|
|
4421
|
+
Thinking: ja,
|
|
4422
|
+
Error: xa
|
|
4419
4423
|
};
|
|
4420
4424
|
//#endregion
|
|
4421
4425
|
//#region src/lib/components/ChatComposer.tsx
|
|
4422
|
-
function
|
|
4426
|
+
function ys(e) {
|
|
4423
4427
|
let t = O(9), n, r;
|
|
4424
4428
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4425
4429
|
let { hasSubmitted: i } = V(), a;
|
|
@@ -4431,7 +4435,7 @@ function gs(e) {
|
|
|
4431
4435
|
...r
|
|
4432
4436
|
}), t[5] = i, t[6] = r, t[7] = a, t[8] = o) : o = t[8], o;
|
|
4433
4437
|
}
|
|
4434
|
-
function
|
|
4438
|
+
function bs(e) {
|
|
4435
4439
|
let t = O(8), n, r;
|
|
4436
4440
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4437
4441
|
let i;
|
|
@@ -4442,7 +4446,7 @@ function _s(e) {
|
|
|
4442
4446
|
...r
|
|
4443
4447
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4444
4448
|
}
|
|
4445
|
-
function
|
|
4449
|
+
function xs(e) {
|
|
4446
4450
|
let t = O(8), n, r;
|
|
4447
4451
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4448
4452
|
let i;
|
|
@@ -4453,7 +4457,7 @@ function vs(e) {
|
|
|
4453
4457
|
...r
|
|
4454
4458
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4455
4459
|
}
|
|
4456
|
-
function
|
|
4460
|
+
function Ss(e) {
|
|
4457
4461
|
let t = O(8), n, r;
|
|
4458
4462
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4459
4463
|
let i;
|
|
@@ -4464,7 +4468,7 @@ function ys(e) {
|
|
|
4464
4468
|
...r
|
|
4465
4469
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4466
4470
|
}
|
|
4467
|
-
function
|
|
4471
|
+
function Cs(e) {
|
|
4468
4472
|
let t = O(8), n, r;
|
|
4469
4473
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4470
4474
|
let i;
|
|
@@ -4475,7 +4479,7 @@ function bs(e) {
|
|
|
4475
4479
|
...r
|
|
4476
4480
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4477
4481
|
}
|
|
4478
|
-
function
|
|
4482
|
+
function ws(e) {
|
|
4479
4483
|
let t = O(8), n, r;
|
|
4480
4484
|
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
4481
4485
|
let i;
|
|
@@ -4486,7 +4490,7 @@ function xs(e) {
|
|
|
4486
4490
|
...r
|
|
4487
4491
|
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
4488
4492
|
}
|
|
4489
|
-
function
|
|
4493
|
+
function Ts(e) {
|
|
4490
4494
|
let t = O(3), n;
|
|
4491
4495
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ M(Q, { icon: /* @__PURE__ */ M($e, { className: "size-4" }) }), t[0] = n) : n = t[0];
|
|
4492
4496
|
let r;
|
|
@@ -4496,7 +4500,7 @@ function Ss(e) {
|
|
|
4496
4500
|
...e
|
|
4497
4501
|
}), t[1] = e, t[2] = r), r;
|
|
4498
4502
|
}
|
|
4499
|
-
function
|
|
4503
|
+
function Es() {
|
|
4500
4504
|
let e = O(6), { actions: t, meta: n } = Tt("ChatComposer.CommandButton"), r;
|
|
4501
4505
|
e[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ M(et, { className: "size-4" }), e[0] = r) : r = e[0];
|
|
4502
4506
|
let i = n.activePopup?.trigger === "/", a;
|
|
@@ -4512,7 +4516,7 @@ function Cs() {
|
|
|
4512
4516
|
onClick: a
|
|
4513
4517
|
}), e[3] = i, e[4] = a, e[5] = o) : o = e[5], o;
|
|
4514
4518
|
}
|
|
4515
|
-
function
|
|
4519
|
+
function Ds(e) {
|
|
4516
4520
|
switch (e) {
|
|
4517
4521
|
case "permission-denied": return "Allow microphone access to use dictation";
|
|
4518
4522
|
case "no-microphone": return "Connect a microphone to use dictation";
|
|
@@ -4521,17 +4525,17 @@ function ws(e) {
|
|
|
4521
4525
|
case "transcription-failed": return "Unable to transcribe audio";
|
|
4522
4526
|
}
|
|
4523
4527
|
}
|
|
4524
|
-
function
|
|
4528
|
+
function Os(e) {
|
|
4525
4529
|
switch (e.status) {
|
|
4526
4530
|
case "unavailable": return e.reason === "blocked" ? "Allow microphone access in your browser settings to use dictation" : "Dictation is not available in this browser";
|
|
4527
4531
|
case "idle": return "Start dictation";
|
|
4528
4532
|
case "starting": return "Starting dictation";
|
|
4529
4533
|
case "recording": return "Stop dictation";
|
|
4530
4534
|
case "finishing": return "Transcribing…";
|
|
4531
|
-
case "failed": return
|
|
4535
|
+
case "failed": return Ds(e.error.code);
|
|
4532
4536
|
}
|
|
4533
4537
|
}
|
|
4534
|
-
function
|
|
4538
|
+
function ks(e) {
|
|
4535
4539
|
switch (e.status) {
|
|
4536
4540
|
case "recording": return /* @__PURE__ */ M(nt, { className: "size-4 fill-current" });
|
|
4537
4541
|
case "starting":
|
|
@@ -4541,11 +4545,11 @@ function Es(e) {
|
|
|
4541
4545
|
case "failed": return /* @__PURE__ */ M(Qe, { className: "size-4" });
|
|
4542
4546
|
}
|
|
4543
4547
|
}
|
|
4544
|
-
function
|
|
4548
|
+
function As() {
|
|
4545
4549
|
let e = O(20), { status: t } = B(), { state: n } = Et("ChatComposer.Dictate"), r;
|
|
4546
|
-
e[0] === n ? r = e[1] : (r =
|
|
4550
|
+
e[0] === n ? r = e[1] : (r = Os(n), e[0] = n, e[1] = r);
|
|
4547
4551
|
let i = r, a = n.status === "starting" || n.status === "recording" || n.status === "finishing", o = t === "streaming" || t === "submitted", s;
|
|
4548
|
-
e[2] === n ? s = e[3] : (s =
|
|
4552
|
+
e[2] === n ? s = e[3] : (s = ks(n), e[2] = n, e[3] = s);
|
|
4549
4553
|
let c;
|
|
4550
4554
|
e[4] !== i || e[5] !== s ? (c = /* @__PURE__ */ M(Q, {
|
|
4551
4555
|
icon: s,
|
|
@@ -4575,22 +4579,22 @@ function Ds() {
|
|
|
4575
4579
|
d
|
|
4576
4580
|
] }), e[16] = l, e[17] = u, e[18] = d, e[19] = f) : f = e[19], f;
|
|
4577
4581
|
}
|
|
4578
|
-
var
|
|
4579
|
-
Provider:
|
|
4580
|
-
Root:
|
|
4582
|
+
var js = {
|
|
4583
|
+
Provider: ys,
|
|
4584
|
+
Root: bs,
|
|
4581
4585
|
Popup: R.Popup,
|
|
4582
|
-
Content:
|
|
4583
|
-
Attachments:
|
|
4584
|
-
Editor:
|
|
4586
|
+
Content: xs,
|
|
4587
|
+
Attachments: Cs,
|
|
4588
|
+
Editor: Ss,
|
|
4585
4589
|
Error: R.Error,
|
|
4586
|
-
Toolbar:
|
|
4587
|
-
CommandButton:
|
|
4588
|
-
AttachFiles:
|
|
4589
|
-
Dictate:
|
|
4590
|
+
Toolbar: ws,
|
|
4591
|
+
CommandButton: Es,
|
|
4592
|
+
AttachFiles: Ts,
|
|
4593
|
+
Dictate: As
|
|
4590
4594
|
};
|
|
4591
4595
|
//#endregion
|
|
4592
4596
|
//#region src/lib/components/ChatTextarea.tsx
|
|
4593
|
-
function
|
|
4597
|
+
function Ms(e) {
|
|
4594
4598
|
let t = O(10), n, r, i;
|
|
4595
4599
|
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({className: n, ref: i, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
4596
4600
|
let a;
|
|
@@ -4607,7 +4611,7 @@ function ks(e) {
|
|
|
4607
4611
|
}
|
|
4608
4612
|
//#endregion
|
|
4609
4613
|
//#region src/lib/components/queue.tsx
|
|
4610
|
-
function
|
|
4614
|
+
function Ns(e) {
|
|
4611
4615
|
let t = O(5), { children: n, className: r } = e, i;
|
|
4612
4616
|
t[0] === r ? i = t[1] : (i = k("border-border flex flex-col border-b px-2 py-1.5", r), t[0] = r, t[1] = i);
|
|
4613
4617
|
let a;
|
|
@@ -4616,7 +4620,7 @@ function As(e) {
|
|
|
4616
4620
|
children: n
|
|
4617
4621
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
4618
4622
|
}
|
|
4619
|
-
function
|
|
4623
|
+
function Ps(e) {
|
|
4620
4624
|
let t = O(5), { children: n, className: r } = e, i;
|
|
4621
4625
|
t[0] === r ? i = t[1] : (i = k("flex items-center gap-2 px-2 py-1.5", r), t[0] = r, t[1] = i);
|
|
4622
4626
|
let a;
|
|
@@ -4625,13 +4629,13 @@ function js(e) {
|
|
|
4625
4629
|
children: n
|
|
4626
4630
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
4627
4631
|
}
|
|
4628
|
-
function
|
|
4632
|
+
function Fs(e) {
|
|
4629
4633
|
let t = O(4), { className: n } = e, r;
|
|
4630
4634
|
t[0] === n ? r = t[1] : (r = k("text-muted-foreground size-3.5 shrink-0", n), t[0] = n, t[1] = r);
|
|
4631
4635
|
let i;
|
|
4632
4636
|
return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ M(Ye, { className: r }), t[2] = r, t[3] = i), i;
|
|
4633
4637
|
}
|
|
4634
|
-
function
|
|
4638
|
+
function Is(e) {
|
|
4635
4639
|
let t = O(7), { children: n, className: r } = e, i;
|
|
4636
4640
|
t[0] === r ? i = t[1] : (i = k("min-w-0 flex-1 truncate text-sm", r), t[0] = r, t[1] = i);
|
|
4637
4641
|
let a;
|
|
@@ -4642,7 +4646,7 @@ function Ns(e) {
|
|
|
4642
4646
|
children: a
|
|
4643
4647
|
}), t[4] = i, t[5] = a, t[6] = o) : o = t[6], o;
|
|
4644
4648
|
}
|
|
4645
|
-
function
|
|
4649
|
+
function Ls(e) {
|
|
4646
4650
|
let t = O(6), { onClick: n, className: r } = e, i;
|
|
4647
4651
|
t[0] === r ? i = t[1] : (i = k("text-muted-foreground hover:text-foreground shrink-0 rounded p-1 transition-colors", r), t[0] = r, t[1] = i);
|
|
4648
4652
|
let a;
|
|
@@ -4656,13 +4660,13 @@ function Ps(e) {
|
|
|
4656
4660
|
children: a
|
|
4657
4661
|
}), t[3] = n, t[4] = i, t[5] = o) : o = t[5], o;
|
|
4658
4662
|
}
|
|
4659
|
-
var
|
|
4660
|
-
Root:
|
|
4661
|
-
Item:
|
|
4662
|
-
Icon:
|
|
4663
|
-
Text:
|
|
4664
|
-
Remove:
|
|
4665
|
-
},
|
|
4663
|
+
var Rs = {
|
|
4664
|
+
Root: Ns,
|
|
4665
|
+
Item: Ps,
|
|
4666
|
+
Icon: Fs,
|
|
4667
|
+
Text: Is,
|
|
4668
|
+
Remove: Ls
|
|
4669
|
+
}, zs = {
|
|
4666
4670
|
normal: {
|
|
4667
4671
|
d: "m5 12 7-7 7 7",
|
|
4668
4672
|
translateY: 0
|
|
@@ -4676,7 +4680,7 @@ var Fs = {
|
|
|
4676
4680
|
],
|
|
4677
4681
|
transition: { duration: .4 }
|
|
4678
4682
|
}
|
|
4679
|
-
},
|
|
4683
|
+
}, Bs = {
|
|
4680
4684
|
normal: { d: "M12 19V5" },
|
|
4681
4685
|
animate: {
|
|
4682
4686
|
d: [
|
|
@@ -4686,7 +4690,7 @@ var Fs = {
|
|
|
4686
4690
|
],
|
|
4687
4691
|
transition: { duration: .4 }
|
|
4688
4692
|
}
|
|
4689
|
-
},
|
|
4693
|
+
}, Vs = (e) => {
|
|
4690
4694
|
let t = O(30), n, r, i, a, o, s;
|
|
4691
4695
|
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4], o = t[5], s = t[6]) : ({ref: o, onMouseEnter: r, onMouseLeave: i, className: n, size: s, ...a} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = o, t[6] = s);
|
|
4692
4696
|
let c = s === void 0 ? 20 : s, l = ne(), u = h(!1), d;
|
|
@@ -4708,11 +4712,11 @@ var Fs = {
|
|
|
4708
4712
|
t[17] === l ? (y = t[18], b = t[19]) : (y = /* @__PURE__ */ M(A.path, {
|
|
4709
4713
|
animate: l,
|
|
4710
4714
|
d: "m5 12 7-7 7 7",
|
|
4711
|
-
variants:
|
|
4715
|
+
variants: zs
|
|
4712
4716
|
}), b = /* @__PURE__ */ M(A.path, {
|
|
4713
4717
|
animate: l,
|
|
4714
4718
|
d: "M12 19V5",
|
|
4715
|
-
variants:
|
|
4719
|
+
variants: Bs
|
|
4716
4720
|
}), t[17] = l, t[18] = y, t[19] = b);
|
|
4717
4721
|
let x;
|
|
4718
4722
|
t[20] !== c || t[21] !== y || t[22] !== b ? (x = /* @__PURE__ */ N("svg", {
|
|
@@ -4736,10 +4740,10 @@ var Fs = {
|
|
|
4736
4740
|
children: x
|
|
4737
4741
|
}), t[24] = m, t[25] = _, t[26] = a, t[27] = v, t[28] = x, t[29] = S) : S = t[29], S;
|
|
4738
4742
|
};
|
|
4739
|
-
|
|
4743
|
+
Vs.displayName = "ArrowUpIcon";
|
|
4740
4744
|
//#endregion
|
|
4741
4745
|
//#region src/lib/components/SubmitButton.tsx
|
|
4742
|
-
var
|
|
4746
|
+
var Hs = {
|
|
4743
4747
|
duration: .15,
|
|
4744
4748
|
ease: [
|
|
4745
4749
|
0,
|
|
@@ -4747,7 +4751,7 @@ var zs = {
|
|
|
4747
4751
|
.2,
|
|
4748
4752
|
1
|
|
4749
4753
|
]
|
|
4750
|
-
},
|
|
4754
|
+
}, Us = {
|
|
4751
4755
|
duration: .12,
|
|
4752
4756
|
ease: [
|
|
4753
4757
|
0,
|
|
@@ -4756,7 +4760,7 @@ var zs = {
|
|
|
4756
4760
|
1
|
|
4757
4761
|
]
|
|
4758
4762
|
};
|
|
4759
|
-
function
|
|
4763
|
+
function Ws(e) {
|
|
4760
4764
|
let t = O(40), n, r, i, a;
|
|
4761
4765
|
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4]) : ({variant: a, className: n, disabled: r, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a);
|
|
4762
4766
|
let o = re(), s = a === "stop", c;
|
|
@@ -4796,7 +4800,7 @@ function Vs(e) {
|
|
|
4796
4800
|
scale: .7
|
|
4797
4801
|
}, t[21] = o, t[22] = v);
|
|
4798
4802
|
let y;
|
|
4799
|
-
t[23] === s ? y = t[24] : (y = M(s ?
|
|
4803
|
+
t[23] === s ? y = t[24] : (y = M(s ? qs : Ks, {}), t[23] = s, t[24] = y);
|
|
4800
4804
|
let b;
|
|
4801
4805
|
t[25] !== v || t[26] !== y || t[27] !== h || t[28] !== g ? (b = /* @__PURE__ */ M(te, {
|
|
4802
4806
|
initial: !1,
|
|
@@ -4804,7 +4808,7 @@ function Vs(e) {
|
|
|
4804
4808
|
initial: g,
|
|
4805
4809
|
animate: _,
|
|
4806
4810
|
exit: v,
|
|
4807
|
-
transition:
|
|
4811
|
+
transition: Us,
|
|
4808
4812
|
className: "absolute flex items-center justify-center",
|
|
4809
4813
|
children: y
|
|
4810
4814
|
}, h)
|
|
@@ -4814,7 +4818,7 @@ function Vs(e) {
|
|
|
4814
4818
|
initial: c,
|
|
4815
4819
|
animate: l,
|
|
4816
4820
|
exit: u,
|
|
4817
|
-
transition:
|
|
4821
|
+
transition: Hs,
|
|
4818
4822
|
whileHover: d,
|
|
4819
4823
|
whileTap: f,
|
|
4820
4824
|
"aria-label": p,
|
|
@@ -4824,7 +4828,7 @@ function Vs(e) {
|
|
|
4824
4828
|
children: b
|
|
4825
4829
|
}), t[30] = r, t[31] = i, t[32] = c, t[33] = b, t[34] = u, t[35] = d, t[36] = f, t[37] = p, t[38] = m, t[39] = x) : x = t[39], x;
|
|
4826
4830
|
}
|
|
4827
|
-
function
|
|
4831
|
+
function Gs(e) {
|
|
4828
4832
|
let t = O(2), { children: n } = e, r;
|
|
4829
4833
|
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ M("svg", {
|
|
4830
4834
|
width: "20",
|
|
@@ -4835,13 +4839,13 @@ function Hs(e) {
|
|
|
4835
4839
|
children: n
|
|
4836
4840
|
}), t[0] = n, t[1] = r), r;
|
|
4837
4841
|
}
|
|
4838
|
-
function
|
|
4842
|
+
function Ks() {
|
|
4839
4843
|
let e = O(1), t;
|
|
4840
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
4844
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(Vs, {}), e[0] = t) : t = e[0], t;
|
|
4841
4845
|
}
|
|
4842
|
-
function
|
|
4846
|
+
function qs() {
|
|
4843
4847
|
let e = O(1), t;
|
|
4844
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(
|
|
4848
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ M(Gs, { children: /* @__PURE__ */ M("rect", {
|
|
4845
4849
|
x: "5",
|
|
4846
4850
|
y: "5",
|
|
4847
4851
|
width: "10",
|
|
@@ -4851,9 +4855,9 @@ function Ws() {
|
|
|
4851
4855
|
}
|
|
4852
4856
|
//#endregion
|
|
4853
4857
|
//#region src/lib/components/tool-error.tsx
|
|
4854
|
-
function
|
|
4858
|
+
function Js(e) {
|
|
4855
4859
|
let t = O(25), { title: n, detail: r, detailLabel: i, part: a, error: o } = e, s = n === void 0 ? "Failed to render tool" : n, c = i === void 0 ? "View details" : i, l = H(), u;
|
|
4856
|
-
t[0] === o.issues ? u = t[1] : (u = o.issues.map(
|
|
4860
|
+
t[0] === o.issues ? u = t[1] : (u = o.issues.map(Ys).join("\n"), t[0] = o.issues, t[1] = u);
|
|
4857
4861
|
let d = u, f;
|
|
4858
4862
|
t[2] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ M(Fe, { className: "size-5" }), t[2] = f) : f = t[2];
|
|
4859
4863
|
let p;
|
|
@@ -4921,71 +4925,71 @@ function Gs(e) {
|
|
|
4921
4925
|
]
|
|
4922
4926
|
}), t[21] = v, t[22] = S, t[23] = p, t[24] = C) : C = t[24], C;
|
|
4923
4927
|
}
|
|
4924
|
-
function
|
|
4928
|
+
function Ys(e) {
|
|
4925
4929
|
return `${e.path.join(".")}: ${e.message}`;
|
|
4926
4930
|
}
|
|
4927
4931
|
//#endregion
|
|
4928
4932
|
//#region src/lib/components/Tip/TipProvider.tsx
|
|
4929
|
-
var
|
|
4930
|
-
function Js() {
|
|
4931
|
-
return l(qs);
|
|
4932
|
-
}
|
|
4933
|
-
var Ys = "tips:history", Xs = "tips:session";
|
|
4933
|
+
var Xs = o("");
|
|
4934
4934
|
function Zs() {
|
|
4935
|
+
return l(Xs);
|
|
4936
|
+
}
|
|
4937
|
+
var Qs = "tips:history", $s = "tips:session";
|
|
4938
|
+
function ec() {
|
|
4935
4939
|
try {
|
|
4936
|
-
return JSON.parse(localStorage.getItem(
|
|
4940
|
+
return JSON.parse(localStorage.getItem(Qs) ?? "{}");
|
|
4937
4941
|
} catch (e) {
|
|
4938
|
-
if (
|
|
4942
|
+
if (rc(e)) return {};
|
|
4939
4943
|
throw e;
|
|
4940
4944
|
}
|
|
4941
4945
|
}
|
|
4942
|
-
function
|
|
4946
|
+
function tc(e, t) {
|
|
4943
4947
|
try {
|
|
4944
|
-
let n =
|
|
4945
|
-
n[e] = t, localStorage.setItem(
|
|
4948
|
+
let n = ec();
|
|
4949
|
+
n[e] = t, localStorage.setItem(Qs, JSON.stringify(n));
|
|
4946
4950
|
} catch (e) {
|
|
4947
|
-
if (!
|
|
4951
|
+
if (!rc(e)) throw e;
|
|
4948
4952
|
}
|
|
4949
4953
|
}
|
|
4950
|
-
function
|
|
4954
|
+
function nc(e) {
|
|
4951
4955
|
try {
|
|
4952
|
-
let t = localStorage.getItem(
|
|
4956
|
+
let t = localStorage.getItem($s), n = t ? JSON.parse(t) : {
|
|
4953
4957
|
id: "",
|
|
4954
4958
|
n: 0
|
|
4955
4959
|
};
|
|
4956
|
-
return n.id !== e && (n.id = e, n.n += 1, localStorage.setItem(
|
|
4960
|
+
return n.id !== e && (n.id = e, n.n += 1, localStorage.setItem($s, JSON.stringify(n))), n.n;
|
|
4957
4961
|
} catch (e) {
|
|
4958
|
-
if (
|
|
4962
|
+
if (rc(e)) return 0;
|
|
4959
4963
|
throw e;
|
|
4960
4964
|
}
|
|
4961
4965
|
}
|
|
4962
|
-
function
|
|
4966
|
+
function rc(e) {
|
|
4963
4967
|
return e instanceof SyntaxError || e instanceof DOMException && (e.name === "QuotaExceededError" || e.name === "SecurityError");
|
|
4964
4968
|
}
|
|
4965
|
-
function
|
|
4969
|
+
function ic(e, t, n) {
|
|
4966
4970
|
let r = n[e];
|
|
4967
4971
|
return r == null ? Infinity : t - r;
|
|
4968
4972
|
}
|
|
4969
|
-
async function
|
|
4970
|
-
let r =
|
|
4973
|
+
async function ac(e, t, n) {
|
|
4974
|
+
let r = ec(), i = await Promise.all(e.map((e) => e.isRelevant(t))), a = e.filter((e, t) => i[t]);
|
|
4971
4975
|
if (a.length === 0) return null;
|
|
4972
|
-
let o = a.filter((e) =>
|
|
4973
|
-
s.sort((e, t) =>
|
|
4976
|
+
let o = a.filter((e) => ic(e.id, n, r) >= e.cooldownSessions), s = o.length > 0 ? o : a;
|
|
4977
|
+
s.sort((e, t) => ic(t.id, n, r) - ic(e.id, n, r));
|
|
4974
4978
|
let c = s[0], l = await c.content(t);
|
|
4975
4979
|
return {
|
|
4976
4980
|
id: c.id,
|
|
4977
4981
|
text: l
|
|
4978
4982
|
};
|
|
4979
4983
|
}
|
|
4980
|
-
function
|
|
4984
|
+
function oc(e) {
|
|
4981
4985
|
let t = O(13), { tips: n, streaming: r, chatId: i, context: a, children: o } = e, s;
|
|
4982
|
-
t[0] === i ? s = t[1] : (s = () =>
|
|
4986
|
+
t[0] === i ? s = t[1] : (s = () => nc(i), t[0] = i, t[1] = s);
|
|
4983
4987
|
let [c] = g(s), [l, u] = g(""), [p, m] = g(r), [_, v] = g(0);
|
|
4984
|
-
r !== p && (m(r), r && v(
|
|
4988
|
+
r !== p && (m(r), r && v(sc));
|
|
4985
4989
|
let y = h(!1), b;
|
|
4986
4990
|
t[2] !== a || t[3] !== c || t[4] !== n ? (b = () => {
|
|
4987
|
-
y.current || (y.current = !0,
|
|
4988
|
-
e && (u(e.text),
|
|
4991
|
+
y.current || (y.current = !0, ac(n, a, c).then((e) => {
|
|
4992
|
+
e && (u(e.text), tc(e.id, c));
|
|
4989
4993
|
}).finally(() => {
|
|
4990
4994
|
y.current = !1;
|
|
4991
4995
|
}));
|
|
@@ -4997,17 +5001,17 @@ function rc(e) {
|
|
|
4997
5001
|
let C;
|
|
4998
5002
|
t[8] === _ ? C = t[9] : (C = [_], t[8] = _, t[9] = C), d(S, C);
|
|
4999
5003
|
let w;
|
|
5000
|
-
return t[10] !== o || t[11] !== l ? (w = /* @__PURE__ */ M(
|
|
5004
|
+
return t[10] !== o || t[11] !== l ? (w = /* @__PURE__ */ M(Xs, {
|
|
5001
5005
|
value: l,
|
|
5002
5006
|
children: o
|
|
5003
5007
|
}), t[10] = o, t[11] = l, t[12] = w) : w = t[12], w;
|
|
5004
5008
|
}
|
|
5005
|
-
function
|
|
5009
|
+
function sc(e) {
|
|
5006
5010
|
return e + 1;
|
|
5007
5011
|
}
|
|
5008
|
-
function
|
|
5012
|
+
function cc(e) {
|
|
5009
5013
|
let t = O(6), { tips: n, context: r, children: i } = e, { chatId: a } = z(), { status: o } = B(), s = o === "streaming" || o === "submitted", c = a ?? "", l;
|
|
5010
|
-
return t[0] !== i || t[1] !== r || t[2] !== s || t[3] !== c || t[4] !== n ? (l = /* @__PURE__ */ M(
|
|
5014
|
+
return t[0] !== i || t[1] !== r || t[2] !== s || t[3] !== c || t[4] !== n ? (l = /* @__PURE__ */ M(oc, {
|
|
5011
5015
|
tips: n,
|
|
5012
5016
|
streaming: s,
|
|
5013
5017
|
chatId: c,
|
|
@@ -5017,14 +5021,14 @@ function ac(e) {
|
|
|
5017
5021
|
}
|
|
5018
5022
|
//#endregion
|
|
5019
5023
|
//#region src/lib/components/Tip/TipLine.tsx
|
|
5020
|
-
var
|
|
5021
|
-
function
|
|
5022
|
-
let t = O(13), { className: n } = e, r = St(), i =
|
|
5024
|
+
var lc = 1.5;
|
|
5025
|
+
function uc(e) {
|
|
5026
|
+
let t = O(13), { className: n } = e, r = St(), i = Zs(), [a, o] = g(i), [s, c] = g(!1);
|
|
5023
5027
|
i !== a && (o(i), i && c(!0));
|
|
5024
5028
|
let l, u;
|
|
5025
5029
|
t[0] !== r || t[1] !== s ? (l = () => {
|
|
5026
5030
|
if (!s) return;
|
|
5027
|
-
let e = r.setTimeout(() => c(!1),
|
|
5031
|
+
let e = r.setTimeout(() => c(!1), lc * 1e3);
|
|
5028
5032
|
return () => r.clearTimeout(e);
|
|
5029
5033
|
}, u = [r, s], t[0] = r, t[1] = s, t[2] = l, t[3] = u) : (l = t[2], u = t[3]), d(l, u);
|
|
5030
5034
|
let f;
|
|
@@ -5035,7 +5039,7 @@ function sc(e) {
|
|
|
5035
5039
|
t[7] !== s || t[8] !== i ? (m = /* @__PURE__ */ N(W, {
|
|
5036
5040
|
as: "span",
|
|
5037
5041
|
enabled: s,
|
|
5038
|
-
duration:
|
|
5042
|
+
duration: lc,
|
|
5039
5043
|
children: ["Tip: ", i]
|
|
5040
5044
|
}), t[7] = s, t[8] = i, t[9] = m) : m = t[9];
|
|
5041
5045
|
let h;
|
|
@@ -5046,7 +5050,7 @@ function sc(e) {
|
|
|
5046
5050
|
}
|
|
5047
5051
|
//#endregion
|
|
5048
5052
|
//#region src/lib/hooks/use-async-generator.ts
|
|
5049
|
-
function
|
|
5053
|
+
function dc() {
|
|
5050
5054
|
let [e, t] = g({
|
|
5051
5055
|
loading: !1,
|
|
5052
5056
|
error: null
|
|
@@ -5076,7 +5080,7 @@ function cc() {
|
|
|
5076
5080
|
}
|
|
5077
5081
|
//#endregion
|
|
5078
5082
|
//#region src/lib/hooks/use-auto-resize-textarea.ts
|
|
5079
|
-
function
|
|
5083
|
+
function fc(e) {
|
|
5080
5084
|
let t = O(16), { minHeight: n, maxHeight: r, value: i } = e, a = h(null), o;
|
|
5081
5085
|
t[0] !== r || t[1] !== n ? (o = (e) => {
|
|
5082
5086
|
let t = a.current;
|
|
@@ -5113,22 +5117,22 @@ function lc(e) {
|
|
|
5113
5117
|
}
|
|
5114
5118
|
//#endregion
|
|
5115
5119
|
//#region src/lib/hooks/use-keyboard.ts
|
|
5116
|
-
function
|
|
5120
|
+
function pc(e) {
|
|
5117
5121
|
let t = [];
|
|
5118
5122
|
return e.ctrlKey && t.push("ctrl"), e.metaKey && t.push("meta"), e.altKey && t.push("alt"), e.shiftKey && t.push("shift"), t.push(e.key.toLowerCase()), t.join("+");
|
|
5119
5123
|
}
|
|
5120
|
-
function
|
|
5124
|
+
function mc(e) {
|
|
5121
5125
|
let t = O(4), { enabled: n, handlers: r } = e, i = n === void 0 || n, a, o;
|
|
5122
5126
|
t[0] !== i || t[1] !== r ? (a = () => {
|
|
5123
5127
|
if (!i) return;
|
|
5124
5128
|
let e = (e) => {
|
|
5125
|
-
let t =
|
|
5129
|
+
let t = pc(e), n = r[t];
|
|
5126
5130
|
n ||= r[e.key], n && (e.preventDefault(), e.stopPropagation(), n(e));
|
|
5127
5131
|
};
|
|
5128
5132
|
return document.addEventListener("keydown", e, !0), () => document.removeEventListener("keydown", e, !0);
|
|
5129
5133
|
}, o = [i, r], t[0] = i, t[1] = r, t[2] = a, t[3] = o) : (a = t[2], o = t[3]), d(a, o);
|
|
5130
5134
|
}
|
|
5131
5135
|
//#endregion
|
|
5132
|
-
export { Gt as AgentHeader, Zt as AgentProvider, Bt as AgentScrollArea,
|
|
5136
|
+
export { Gt as AgentHeader, Zt as AgentProvider, Bt as AgentScrollArea, gi as AssistantSnapshot, ti as COPY_EXCLUSION_ATTRIBUTE, ni as COPY_EXCLUSION_MODES, Q as ChatActionButton, zt as ChatBot, js as ChatComposer, Ft as ChatManager, Ms as ChatTextarea, Zn as CitationPill, Ur as CodeBlock, Wr as CodeBlockCopyButton, es as CompactMessages, Qo as CompactTrajectory, _a as CopyAction, ya as CopyDebugJsonAction, Jn as IndexProgress, Ei as InteractiveResponse, Xn as MessageItemContext, Za as MessageMetadata, Rs as MessageQueue, ds as Messages, ga as MessagesActions, Yn as MessagesContext, xa as MessagesError, wa as MessagesItem, Ca as MessagesList, Sa as MessagesRoot, uo as MessagesUserBubble, ma as NestedTrajectory, Da as PendingToolInput, nn as ReadOnlyChatTransport, va as RegenerateAction, Y as Response, Z as Segment, li as SnapshotRenderPortal, Ws as SubmitButton, W as TextShimmer, vs as TimelinedMessages, uc as TipLine, oc as TipProvider, Xs as TipValueContext, cc as Tips, Wi as ToolArg, Js as ToolError, lo as UserMessageContent, Wa as ZukhrufChatTransport, tn as citationIndexOf, Nt as clearPrefill, oe as defineElements, hi as extractAssistantRawText, en as extractSourcesFromMessage, Va as formatUsageBreakdown, Ba as formatUsageValue, pn as getIndexProgressEvents, la as getSegmentKey, ii as hasCopyExclusion, bi as isActiveClientInputTool, qi as isCommentaryTextPart, _i as isSubagentPart, an as isToolAborted, rn as isToolStateAborted, Fa as parseMetadataUsage, Pa as parseUsage, Pt as persistedPromptOf, jt as readPrefill, oi as resolveCopyToClipboardStrategy, yi as resolveToolEntry, sn as serializeToolsRegistry, ai as shouldIncludeInCopyImage, vi as subagentDisplayName, U as urlCitationsOf, Ta as useActivePendingToolInput, z as useAgent, Lt as useAgentChatSetup, H as useAgentMessages, V as useAgentMeta, B as useAgentStatus, dc as useAsyncGenerator, fc as useAutoResizeTextarea, Qt as useChatManager, Ho as useCompactGroup, di as useCopyElementAsImage, X as useIsAssistantSnapshotRender, on as useIsToolAborted, mc as useKeyboard, q as useMessageItem, G as useMessagesContext, K as useMessagesStatus, za as useNormalizedUsageTracking, Zs as useTipValue, ta as useToolSegment, Bo as useTrajectoryItems, ci as waitForNextPaint, Mt as writePrefill };
|
|
5133
5137
|
|
|
5134
5138
|
//# sourceMappingURL=index.js.map
|