teodor-new-chat-ui 4.3.598 → 4.3.599
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.esm.js +158 -152
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +8 -8
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -178,14 +178,14 @@ const Es = (e) => {
|
|
|
178
178
|
return n;
|
|
179
179
|
};
|
|
180
180
|
return r(e, 0);
|
|
181
|
-
}, _s = Ne("AsyncFunction"),
|
|
181
|
+
}, _s = Ne("AsyncFunction"), vs = (e) => e && (Nt(e) || Ae(e)) && Ae(e.then) && Ae(e.catch), rn = ((e, t) => e ? setImmediate : t ? ((r, n) => (Qe.addEventListener("message", ({ source: s, data: a }) => {
|
|
182
182
|
s === Qe && a === r && n.length && n.shift()();
|
|
183
183
|
}, !1), (s) => {
|
|
184
184
|
n.push(s), Qe.postMessage(r, "*");
|
|
185
185
|
}))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(
|
|
186
186
|
typeof setImmediate == "function",
|
|
187
187
|
Ae(Qe.postMessage)
|
|
188
|
-
),
|
|
188
|
+
), Is = typeof queueMicrotask < "u" ? queueMicrotask.bind(Qe) : typeof process < "u" && process.nextTick || rn, Cs = (e) => e != null && Ae(e[Vt]), f = {
|
|
189
189
|
isArray: wt,
|
|
190
190
|
isArrayBuffer: Gr,
|
|
191
191
|
isBuffer: xt,
|
|
@@ -240,9 +240,9 @@ const Es = (e) => {
|
|
|
240
240
|
isSpecCompliantForm: ks,
|
|
241
241
|
toJSONObject: Es,
|
|
242
242
|
isAsyncFn: _s,
|
|
243
|
-
isThenable:
|
|
243
|
+
isThenable: vs,
|
|
244
244
|
setImmediate: rn,
|
|
245
|
-
asap:
|
|
245
|
+
asap: Is,
|
|
246
246
|
isIterable: Cs
|
|
247
247
|
};
|
|
248
248
|
function F(e, t, r, n, s) {
|
|
@@ -339,12 +339,12 @@ function Xt(e, t, r) {
|
|
|
339
339
|
return f.isArrayBuffer(h) || f.isTypedArray(h) ? d && typeof Blob == "function" ? new Blob([h]) : Buffer.from(h) : h;
|
|
340
340
|
}
|
|
341
341
|
function c(h, T, b) {
|
|
342
|
-
let
|
|
342
|
+
let v = h;
|
|
343
343
|
if (h && !b && typeof h == "object") {
|
|
344
344
|
if (f.endsWith(T, "{}"))
|
|
345
345
|
T = n ? T : T.slice(0, -2), h = JSON.stringify(h);
|
|
346
|
-
else if (f.isArray(h) && Ps(h) || (f.isFileList(h) || f.endsWith(T, "[]")) && (
|
|
347
|
-
return T = an(T),
|
|
346
|
+
else if (f.isArray(h) && Ps(h) || (f.isFileList(h) || f.endsWith(T, "[]")) && (v = f.toArray(h)))
|
|
347
|
+
return T = an(T), v.forEach(function(x, j) {
|
|
348
348
|
!(f.isUndefined(x) || x === null) && t.append(
|
|
349
349
|
// eslint-disable-next-line no-nested-ternary
|
|
350
350
|
o === !0 ? Rr([T], j, a) : o === null ? T : T + "[]",
|
|
@@ -363,14 +363,14 @@ function Xt(e, t, r) {
|
|
|
363
363
|
if (!f.isUndefined(h)) {
|
|
364
364
|
if (m.indexOf(h) !== -1)
|
|
365
365
|
throw Error("Circular reference detected in " + T.join("."));
|
|
366
|
-
m.push(h), f.forEach(h, function(
|
|
367
|
-
(!(f.isUndefined(
|
|
366
|
+
m.push(h), f.forEach(h, function(v, _) {
|
|
367
|
+
(!(f.isUndefined(v) || v === null) && s.call(
|
|
368
368
|
t,
|
|
369
|
-
|
|
369
|
+
v,
|
|
370
370
|
f.isString(_) ? _.trim() : _,
|
|
371
371
|
T,
|
|
372
372
|
S
|
|
373
|
-
)) === !0 && k(
|
|
373
|
+
)) === !0 && k(v, T ? T.concat(_) : [_]);
|
|
374
374
|
}), m.pop();
|
|
375
375
|
}
|
|
376
376
|
}
|
|
@@ -643,7 +643,7 @@ const Ws = f.toObjectSet([
|
|
|
643
643
|
s = o.indexOf(":"), r = o.substring(0, s).trim().toLowerCase(), n = o.substring(s + 1).trim(), !(!r || t[r] && Ws[r]) && (r === "set-cookie" ? t[r] ? t[r].push(n) : t[r] = [n] : t[r] = t[r] ? t[r] + ", " + n : n);
|
|
644
644
|
}), t;
|
|
645
645
|
}, _r = Symbol("internals");
|
|
646
|
-
function
|
|
646
|
+
function vt(e) {
|
|
647
647
|
return e && String(e).trim().toLowerCase();
|
|
648
648
|
}
|
|
649
649
|
function Mt(e) {
|
|
@@ -688,7 +688,7 @@ let Re = class {
|
|
|
688
688
|
set(t, r, n) {
|
|
689
689
|
const s = this;
|
|
690
690
|
function a(l, d, u) {
|
|
691
|
-
const c =
|
|
691
|
+
const c = vt(d);
|
|
692
692
|
if (!c)
|
|
693
693
|
throw new Error("header name must be a non-empty string");
|
|
694
694
|
const m = f.findKey(s, c);
|
|
@@ -712,7 +712,7 @@ let Re = class {
|
|
|
712
712
|
return this;
|
|
713
713
|
}
|
|
714
714
|
get(t, r) {
|
|
715
|
-
if (t =
|
|
715
|
+
if (t = vt(t), t) {
|
|
716
716
|
const n = f.findKey(this, t);
|
|
717
717
|
if (n) {
|
|
718
718
|
const s = this[n];
|
|
@@ -729,7 +729,7 @@ let Re = class {
|
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
731
|
has(t, r) {
|
|
732
|
-
if (t =
|
|
732
|
+
if (t = vt(t), t) {
|
|
733
733
|
const n = f.findKey(this, t);
|
|
734
734
|
return !!(n && this[n] !== void 0 && (!r || rr(this, this[n], n, r)));
|
|
735
735
|
}
|
|
@@ -739,7 +739,7 @@ let Re = class {
|
|
|
739
739
|
const n = this;
|
|
740
740
|
let s = !1;
|
|
741
741
|
function a(o) {
|
|
742
|
-
if (o =
|
|
742
|
+
if (o = vt(o), o) {
|
|
743
743
|
const l = f.findKey(n, o);
|
|
744
744
|
l && (!r || rr(n, n[l], l, r)) && (delete n[l], s = !0);
|
|
745
745
|
}
|
|
@@ -801,7 +801,7 @@ let Re = class {
|
|
|
801
801
|
accessors: {}
|
|
802
802
|
}).accessors, s = this.prototype;
|
|
803
803
|
function a(o) {
|
|
804
|
-
const l =
|
|
804
|
+
const l = vt(o);
|
|
805
805
|
n[l] || (Gs(s, o), n[l] = !0);
|
|
806
806
|
}
|
|
807
807
|
return f.isArray(t) ? t.forEach(a) : a(t), this;
|
|
@@ -895,14 +895,14 @@ const zt = (e, t, r = 3) => {
|
|
|
895
895
|
};
|
|
896
896
|
e(m);
|
|
897
897
|
}, r);
|
|
898
|
-
},
|
|
898
|
+
}, vr = (e, t) => {
|
|
899
899
|
const r = e != null;
|
|
900
900
|
return [(n) => t[0]({
|
|
901
901
|
lengthComputable: r,
|
|
902
902
|
total: e,
|
|
903
903
|
loaded: n
|
|
904
904
|
}), t[1]];
|
|
905
|
-
},
|
|
905
|
+
}, Ir = (e) => (...t) => f.asap(() => e(...t)), ta = ge.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (r) => (r = new URL(r, ge.origin), e.protocol === r.protocol && e.host === r.host && (t || e.port === r.port)))(
|
|
906
906
|
new URL(ge.origin),
|
|
907
907
|
ge.navigator && /(msie|trident)/i.test(ge.navigator.userAgent)
|
|
908
908
|
) : () => !0, ra = ge.hasStandardBrowserEnv ? (
|
|
@@ -1039,7 +1039,7 @@ const pn = (e) => {
|
|
|
1039
1039
|
}
|
|
1040
1040
|
let b = new XMLHttpRequest();
|
|
1041
1041
|
b.open(s.method.toUpperCase(), s.url, !0), b.timeout = s.timeout;
|
|
1042
|
-
function
|
|
1042
|
+
function v() {
|
|
1043
1043
|
if (!b)
|
|
1044
1044
|
return;
|
|
1045
1045
|
const x = Re.from(
|
|
@@ -1058,8 +1058,8 @@ const pn = (e) => {
|
|
|
1058
1058
|
n(z), T();
|
|
1059
1059
|
}, H), b = null;
|
|
1060
1060
|
}
|
|
1061
|
-
"onloadend" in b ? b.onloadend =
|
|
1062
|
-
!b || b.readyState !== 4 || b.status === 0 && !(b.responseURL && b.responseURL.indexOf("file:") === 0) || setTimeout(
|
|
1061
|
+
"onloadend" in b ? b.onloadend = v : b.onreadystatechange = function() {
|
|
1062
|
+
!b || b.readyState !== 4 || b.status === 0 && !(b.responseURL && b.responseURL.indexOf("file:") === 0) || setTimeout(v);
|
|
1063
1063
|
}, b.onabort = function() {
|
|
1064
1064
|
b && (n(new F("Request aborted", F.ECONNABORTED, e, b)), b = null);
|
|
1065
1065
|
}, b.onerror = function(j) {
|
|
@@ -1200,9 +1200,9 @@ const pn = (e) => {
|
|
|
1200
1200
|
};
|
|
1201
1201
|
s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((h) => {
|
|
1202
1202
|
!m[h] && (m[h] = (T, b) => {
|
|
1203
|
-
let
|
|
1204
|
-
if (
|
|
1205
|
-
return
|
|
1203
|
+
let v = T && T[h];
|
|
1204
|
+
if (v)
|
|
1205
|
+
return v.call(T);
|
|
1206
1206
|
throw new F(`Response type '${h}' is not supported`, F.ERR_NOT_SUPPORT, b);
|
|
1207
1207
|
});
|
|
1208
1208
|
});
|
|
@@ -1228,7 +1228,7 @@ const pn = (e) => {
|
|
|
1228
1228
|
let {
|
|
1229
1229
|
url: T,
|
|
1230
1230
|
method: b,
|
|
1231
|
-
data:
|
|
1231
|
+
data: v,
|
|
1232
1232
|
signal: _,
|
|
1233
1233
|
cancelToken: x,
|
|
1234
1234
|
timeout: j,
|
|
@@ -1246,18 +1246,18 @@ const pn = (e) => {
|
|
|
1246
1246
|
});
|
|
1247
1247
|
let ee;
|
|
1248
1248
|
try {
|
|
1249
|
-
if (O && u && b !== "get" && b !== "head" && (ee = await k(L,
|
|
1249
|
+
if (O && u && b !== "get" && b !== "head" && (ee = await k(L, v)) !== 0) {
|
|
1250
1250
|
let w = new r(T, {
|
|
1251
1251
|
method: "POST",
|
|
1252
|
-
body:
|
|
1252
|
+
body: v,
|
|
1253
1253
|
duplex: "half"
|
|
1254
1254
|
}), A;
|
|
1255
|
-
if (f.isFormData(
|
|
1256
|
-
const [g, R] =
|
|
1255
|
+
if (f.isFormData(v) && (A = w.headers.get("content-type")) && L.setContentType(A), w.body) {
|
|
1256
|
+
const [g, R] = vr(
|
|
1257
1257
|
ee,
|
|
1258
|
-
zt(
|
|
1258
|
+
zt(Ir(O))
|
|
1259
1259
|
);
|
|
1260
|
-
|
|
1260
|
+
v = Or(w.body, Pr, g, R);
|
|
1261
1261
|
}
|
|
1262
1262
|
}
|
|
1263
1263
|
f.isString(D) || (D = D ? "include" : "omit");
|
|
@@ -1266,37 +1266,37 @@ const pn = (e) => {
|
|
|
1266
1266
|
signal: G,
|
|
1267
1267
|
method: b.toUpperCase(),
|
|
1268
1268
|
headers: L.normalize().toJSON(),
|
|
1269
|
-
body:
|
|
1269
|
+
body: v,
|
|
1270
1270
|
duplex: "half",
|
|
1271
1271
|
credentials: J ? D : void 0
|
|
1272
1272
|
};
|
|
1273
1273
|
W = a && new r(T, he);
|
|
1274
|
-
let
|
|
1274
|
+
let I = await (a ? ne(W, Z) : ne(T, he));
|
|
1275
1275
|
const N = c && (z === "stream" || z === "response");
|
|
1276
1276
|
if (c && (H || N && V)) {
|
|
1277
1277
|
const w = {};
|
|
1278
1278
|
["status", "statusText", "headers"].forEach((C) => {
|
|
1279
|
-
w[C] =
|
|
1279
|
+
w[C] = I[C];
|
|
1280
1280
|
});
|
|
1281
|
-
const A = f.toFiniteNumber(
|
|
1281
|
+
const A = f.toFiniteNumber(I.headers.get("content-length")), [g, R] = H && vr(
|
|
1282
1282
|
A,
|
|
1283
|
-
zt(
|
|
1283
|
+
zt(Ir(H), !0)
|
|
1284
1284
|
) || [];
|
|
1285
|
-
|
|
1286
|
-
Or(
|
|
1285
|
+
I = new n(
|
|
1286
|
+
Or(I.body, Pr, g, () => {
|
|
1287
1287
|
R && R(), V && V();
|
|
1288
1288
|
}),
|
|
1289
1289
|
w
|
|
1290
1290
|
);
|
|
1291
1291
|
}
|
|
1292
1292
|
z = z || "text";
|
|
1293
|
-
let U = await m[f.findKey(m, z) || "text"](
|
|
1293
|
+
let U = await m[f.findKey(m, z) || "text"](I, h);
|
|
1294
1294
|
return !N && V && V(), await new Promise((w, A) => {
|
|
1295
1295
|
fn(w, A, {
|
|
1296
1296
|
data: U,
|
|
1297
|
-
headers: Re.from(
|
|
1298
|
-
status:
|
|
1299
|
-
statusText:
|
|
1297
|
+
headers: Re.from(I.headers),
|
|
1298
|
+
status: I.status,
|
|
1299
|
+
statusText: I.statusText,
|
|
1300
1300
|
config: h,
|
|
1301
1301
|
request: W
|
|
1302
1302
|
});
|
|
@@ -1987,7 +1987,7 @@ class Ra {
|
|
|
1987
1987
|
}
|
|
1988
1988
|
}
|
|
1989
1989
|
const ka = new Ra();
|
|
1990
|
-
var dr = { exports: {} },
|
|
1990
|
+
var dr = { exports: {} }, It = {};
|
|
1991
1991
|
/**
|
|
1992
1992
|
* @license React
|
|
1993
1993
|
* react-jsx-runtime.production.min.js
|
|
@@ -1999,7 +1999,7 @@ var dr = { exports: {} }, vt = {};
|
|
|
1999
1999
|
*/
|
|
2000
2000
|
var Mr;
|
|
2001
2001
|
function Ea() {
|
|
2002
|
-
if (Mr) return
|
|
2002
|
+
if (Mr) return It;
|
|
2003
2003
|
Mr = 1;
|
|
2004
2004
|
var e = Jr, t = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, s = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, a = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
2005
2005
|
function o(l, d, u) {
|
|
@@ -2009,7 +2009,7 @@ function Ea() {
|
|
|
2009
2009
|
if (l && l.defaultProps) for (c in d = l.defaultProps, d) m[c] === void 0 && (m[c] = d[c]);
|
|
2010
2010
|
return { $$typeof: t, type: l, key: S, ref: k, props: m, _owner: s.current };
|
|
2011
2011
|
}
|
|
2012
|
-
return
|
|
2012
|
+
return It.Fragment = r, It.jsx = o, It.jsxs = o, It;
|
|
2013
2013
|
}
|
|
2014
2014
|
var Ct = {};
|
|
2015
2015
|
/**
|
|
@@ -2031,7 +2031,7 @@ function _a() {
|
|
|
2031
2031
|
var p = h && i[h] || i[T];
|
|
2032
2032
|
return typeof p == "function" ? p : null;
|
|
2033
2033
|
}
|
|
2034
|
-
var
|
|
2034
|
+
var v = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
2035
2035
|
function _(i) {
|
|
2036
2036
|
{
|
|
2037
2037
|
for (var p = arguments.length, y = new Array(p > 1 ? p - 1 : 0), E = 1; E < p; E++)
|
|
@@ -2041,7 +2041,7 @@ function _a() {
|
|
|
2041
2041
|
}
|
|
2042
2042
|
function x(i, p, y) {
|
|
2043
2043
|
{
|
|
2044
|
-
var E =
|
|
2044
|
+
var E = v.ReactDebugCurrentFrame, P = E.getStackAddendum();
|
|
2045
2045
|
P !== "" && (p += "%s", y = y.concat([P]));
|
|
2046
2046
|
var Y = y.map(function(q) {
|
|
2047
2047
|
return String(q);
|
|
@@ -2113,14 +2113,14 @@ function _a() {
|
|
|
2113
2113
|
}
|
|
2114
2114
|
return null;
|
|
2115
2115
|
}
|
|
2116
|
-
var V = Object.assign, ee = 0, J, he,
|
|
2116
|
+
var V = Object.assign, ee = 0, J, he, I, N, U, w, A;
|
|
2117
2117
|
function g() {
|
|
2118
2118
|
}
|
|
2119
2119
|
g.__reactDisabledLog = !0;
|
|
2120
2120
|
function R() {
|
|
2121
2121
|
{
|
|
2122
2122
|
if (ee === 0) {
|
|
2123
|
-
J = console.log, he = console.info,
|
|
2123
|
+
J = console.log, he = console.info, I = console.warn, N = console.error, U = console.group, w = console.groupCollapsed, A = console.groupEnd;
|
|
2124
2124
|
var i = {
|
|
2125
2125
|
configurable: !0,
|
|
2126
2126
|
enumerable: !0,
|
|
@@ -2156,7 +2156,7 @@ function _a() {
|
|
|
2156
2156
|
value: he
|
|
2157
2157
|
}),
|
|
2158
2158
|
warn: V({}, i, {
|
|
2159
|
-
value:
|
|
2159
|
+
value: I
|
|
2160
2160
|
}),
|
|
2161
2161
|
error: V({}, i, {
|
|
2162
2162
|
value: N
|
|
@@ -2175,7 +2175,7 @@ function _a() {
|
|
|
2175
2175
|
ee < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
2176
2176
|
}
|
|
2177
2177
|
}
|
|
2178
|
-
var X =
|
|
2178
|
+
var X = v.ReactCurrentDispatcher, se;
|
|
2179
2179
|
function K(i, p, y) {
|
|
2180
2180
|
{
|
|
2181
2181
|
if (se === void 0)
|
|
@@ -2251,9 +2251,9 @@ function _a() {
|
|
|
2251
2251
|
if (re !== 1 || ce !== 1)
|
|
2252
2252
|
do
|
|
2253
2253
|
if (re--, ce--, ce < 0 || B[re] !== oe[ce]) {
|
|
2254
|
-
var
|
|
2254
|
+
var ve = `
|
|
2255
2255
|
` + B[re].replace(" at new ", " at ");
|
|
2256
|
-
return i.displayName &&
|
|
2256
|
+
return i.displayName && ve.includes("<anonymous>") && (ve = ve.replace("<anonymous>", i.displayName)), typeof i == "function" && ue.set(i, ve), ve;
|
|
2257
2257
|
}
|
|
2258
2258
|
while (re >= 1 && ce >= 0);
|
|
2259
2259
|
break;
|
|
@@ -2268,7 +2268,7 @@ function _a() {
|
|
|
2268
2268
|
function De(i, p, y) {
|
|
2269
2269
|
return Ue(i, !1);
|
|
2270
2270
|
}
|
|
2271
|
-
function
|
|
2271
|
+
function Ie(i) {
|
|
2272
2272
|
var p = i.prototype;
|
|
2273
2273
|
return !!(p && p.isReactComponent);
|
|
2274
2274
|
}
|
|
@@ -2276,7 +2276,7 @@ function _a() {
|
|
|
2276
2276
|
if (i == null)
|
|
2277
2277
|
return "";
|
|
2278
2278
|
if (typeof i == "function")
|
|
2279
|
-
return Ue(i,
|
|
2279
|
+
return Ue(i, Ie(i));
|
|
2280
2280
|
if (typeof i == "string")
|
|
2281
2281
|
return K(i);
|
|
2282
2282
|
switch (i) {
|
|
@@ -2301,7 +2301,7 @@ function _a() {
|
|
|
2301
2301
|
}
|
|
2302
2302
|
return "";
|
|
2303
2303
|
}
|
|
2304
|
-
var be = Object.prototype.hasOwnProperty, We = {}, Ce =
|
|
2304
|
+
var be = Object.prototype.hasOwnProperty, We = {}, Ce = v.ReactDebugCurrentFrame;
|
|
2305
2305
|
function Fe(i) {
|
|
2306
2306
|
if (i) {
|
|
2307
2307
|
var p = i._owner, y = te(i.type, i._source, p ? p.type : null);
|
|
@@ -2352,7 +2352,7 @@ function _a() {
|
|
|
2352
2352
|
if (Oe(i))
|
|
2353
2353
|
return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", st(i)), Je(i);
|
|
2354
2354
|
}
|
|
2355
|
-
var _e =
|
|
2355
|
+
var _e = v.ReactCurrentOwner, at = {
|
|
2356
2356
|
key: !0,
|
|
2357
2357
|
ref: !0,
|
|
2358
2358
|
__self: !0,
|
|
@@ -2446,7 +2446,7 @@ function _a() {
|
|
|
2446
2446
|
return He(i, B, oe, P, E, _e.current, q);
|
|
2447
2447
|
}
|
|
2448
2448
|
}
|
|
2449
|
-
var At =
|
|
2449
|
+
var At = v.ReactCurrentOwner, Rt = v.ReactDebugCurrentFrame;
|
|
2450
2450
|
function ze(i) {
|
|
2451
2451
|
if (i) {
|
|
2452
2452
|
var p = i._owner, y = te(i.type, i._source, p ? p.type : null);
|
|
@@ -2572,17 +2572,17 @@ Check the top-level render call using <` + y + ">.");
|
|
|
2572
2572
|
if (ce == null)
|
|
2573
2573
|
return ce;
|
|
2574
2574
|
if (q) {
|
|
2575
|
-
var
|
|
2576
|
-
if (
|
|
2575
|
+
var ve = p.children;
|
|
2576
|
+
if (ve !== void 0)
|
|
2577
2577
|
if (E)
|
|
2578
|
-
if (Me(
|
|
2579
|
-
for (var ft = 0; ft <
|
|
2580
|
-
ut(
|
|
2581
|
-
Object.freeze && Object.freeze(
|
|
2578
|
+
if (Me(ve)) {
|
|
2579
|
+
for (var ft = 0; ft < ve.length; ft++)
|
|
2580
|
+
ut(ve[ft], i);
|
|
2581
|
+
Object.freeze && Object.freeze(ve);
|
|
2582
2582
|
} else
|
|
2583
2583
|
_("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
2584
2584
|
else
|
|
2585
|
-
ut(
|
|
2585
|
+
ut(ve, i);
|
|
2586
2586
|
}
|
|
2587
2587
|
if (be.call(p, "key")) {
|
|
2588
2588
|
var Ge = W(i), we = Object.keys(p).filter(function(Bn) {
|
|
@@ -2613,7 +2613,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2613
2613
|
}
|
|
2614
2614
|
process.env.NODE_ENV === "production" ? dr.exports = Ea() : dr.exports = _a();
|
|
2615
2615
|
var xe = dr.exports;
|
|
2616
|
-
class
|
|
2616
|
+
class va {
|
|
2617
2617
|
constructor() {
|
|
2618
2618
|
// ---- Configuration ----
|
|
2619
2619
|
Tr(this, "_authBaseUrl", "");
|
|
@@ -2646,9 +2646,9 @@ class Ia {
|
|
|
2646
2646
|
return (t == null ? void 0 : t.users) ?? [];
|
|
2647
2647
|
}
|
|
2648
2648
|
}
|
|
2649
|
-
const
|
|
2649
|
+
const Ia = new va(), An = yt(null);
|
|
2650
2650
|
function Ca({ children: e, apiConfig: t }) {
|
|
2651
|
-
const r = nt, n =
|
|
2651
|
+
const r = nt, n = Ia;
|
|
2652
2652
|
if (t) {
|
|
2653
2653
|
const a = r.baseUrl, o = n.baseUrl, l = r.getAuthToken();
|
|
2654
2654
|
(t.baseUrl || t.chatBaseUrl) && (t.chatBaseUrl && t.chatBaseUrl !== a || t.baseUrl && !a.startsWith(t.baseUrl)) && r.updateConfig(t), (t.baseUrl || t.authBaseUrl) && (t.authBaseUrl && t.authBaseUrl !== o || t.baseUrl && !o.startsWith(t.baseUrl)) && n.updateConfig(t), t.apiKey !== void 0 && t.apiKey !== l && (r.updateConfig({ apiKey: t.apiKey }), n.updateConfig({ apiKey: t.apiKey }));
|
|
@@ -2767,7 +2767,7 @@ function Ua(e, t) {
|
|
|
2767
2767
|
...a,
|
|
2768
2768
|
step: Na(a, ["step"]) ?? 0,
|
|
2769
2769
|
source: Pt(a, ["source"]) ?? null
|
|
2770
|
-
},
|
|
2770
|
+
}, v = s.map((L) => ({
|
|
2771
2771
|
...L,
|
|
2772
2772
|
checkpointId: u ?? null
|
|
2773
2773
|
})), _ = (z = e.values) == null ? void 0 : z.interrupts, x = Array.isArray(e.interrupts) ? e.interrupts : Array.isArray(_) ? _ : [];
|
|
@@ -2776,7 +2776,7 @@ function Ua(e, t) {
|
|
|
2776
2776
|
checkpointNs: c ?? null,
|
|
2777
2777
|
createdAt: T,
|
|
2778
2778
|
parentId: m ?? null,
|
|
2779
|
-
messages:
|
|
2779
|
+
messages: v,
|
|
2780
2780
|
interrupt: Ba(
|
|
2781
2781
|
s,
|
|
2782
2782
|
x,
|
|
@@ -2883,13 +2883,13 @@ function $a(e) {
|
|
|
2883
2883
|
return !!e && typeof e == "object" && "data" in e;
|
|
2884
2884
|
}
|
|
2885
2885
|
function qa(e = {}) {
|
|
2886
|
-
const t = e.baseUrl || "", r = e.streamPath ?? "/stream", [n, s] = ie(e.token ?? null), a = Q(e.headers ?? {}), o = e.credentials ?? "include", [l, d] = ie(!1), [u, c] = ie(null), [m, S] = ie(""), [k, h] = ie(null), [T, b] = ie(0), [
|
|
2886
|
+
const t = e.baseUrl || "", r = e.streamPath ?? "/stream", [n, s] = ie(e.token ?? null), a = Q(e.headers ?? {}), o = e.credentials ?? "include", [l, d] = ie(!1), [u, c] = ie(null), [m, S] = ie(""), [k, h] = ie(null), [T, b] = ie(0), [v, _] = ie(!1), [x, j] = ie({}), [H, O] = ie(null), [z, L] = ie({}), D = Q(null), Z = Q(!0), ne = Q(0), G = Q(null), W = Q(null), V = Q(null), ee = Q(null), J = Q({
|
|
2887
2887
|
messageId: null,
|
|
2888
2888
|
lastSeq: null,
|
|
2889
2889
|
lastText: ""
|
|
2890
2890
|
}), he = M((w) => {
|
|
2891
2891
|
s(w);
|
|
2892
|
-
}, []),
|
|
2892
|
+
}, []), I = M(() => {
|
|
2893
2893
|
S(""), h(null), c(null), W.current = null, V.current = null, ee.current = null, j({}), O(null), L({}), J.current = {
|
|
2894
2894
|
messageId: null,
|
|
2895
2895
|
lastSeq: null,
|
|
@@ -2920,7 +2920,7 @@ function qa(e = {}) {
|
|
|
2920
2920
|
headers: {},
|
|
2921
2921
|
isStreaming: !0
|
|
2922
2922
|
}, (async () => {
|
|
2923
|
-
var K, fe, ue, pe, Ue, De,
|
|
2923
|
+
var K, fe, ue, pe, Ue, De, Ie, te, be, We, Ce, Fe, Be, Ve, Me, st, Oe, Je;
|
|
2924
2924
|
try {
|
|
2925
2925
|
let Ee = {};
|
|
2926
2926
|
try {
|
|
@@ -3052,7 +3052,7 @@ function qa(e = {}) {
|
|
|
3052
3052
|
console.debug("[use-chat] drop duplicate/out-of-order event", { seq: i, lastProcessedSeq: Ke, type: $.type });
|
|
3053
3053
|
continue;
|
|
3054
3054
|
}
|
|
3055
|
-
Ke > 0 && i > Ke + 1 && ((
|
|
3055
|
+
Ke > 0 && i > Ke + 1 && ((Ie = g == null ? void 0 : g.onGap) == null || Ie.call(g, { from: Ke, to: i })), Ke = i, ne.current = i, b(i);
|
|
3056
3056
|
}
|
|
3057
3057
|
if ($.type === "checkpoint")
|
|
3058
3058
|
W.current = $.checkpointId ?? null, V.current = $.checkpointNs ?? null, h($.checkpointId ?? null);
|
|
@@ -3229,10 +3229,10 @@ function qa(e = {}) {
|
|
|
3229
3229
|
streamedMessages: x,
|
|
3230
3230
|
lastCheckpointId: k,
|
|
3231
3231
|
lastSeq: T,
|
|
3232
|
-
connected:
|
|
3232
|
+
connected: v,
|
|
3233
3233
|
stream: U,
|
|
3234
3234
|
stop: N,
|
|
3235
|
-
clear:
|
|
3235
|
+
clear: I,
|
|
3236
3236
|
setToken: he,
|
|
3237
3237
|
values: z,
|
|
3238
3238
|
interrupt: () => Promise.resolve(),
|
|
@@ -3290,7 +3290,7 @@ function za({
|
|
|
3290
3290
|
onThreadChange: n,
|
|
3291
3291
|
onCurrentThreadDeleted: s
|
|
3292
3292
|
}) {
|
|
3293
|
-
const [a, o] = ie([]), [l, d] = ie(t), [u, c] = ie(!1), [m, S] = ie(null), [k, h] = ie([]), [T, b] = ie(!1), [,
|
|
3293
|
+
const [a, o] = ie([]), [l, d] = ie(t), [u, c] = ie(!1), [m, S] = ie(null), [k, h] = ie([]), [T, b] = ie(!1), [, v] = ie(null), [_, x] = ie(null), [j, H] = ie(!1), O = Q(l), z = Q(/* @__PURE__ */ new Map());
|
|
3294
3294
|
me(() => {
|
|
3295
3295
|
O.current = l;
|
|
3296
3296
|
}, [l]), me(() => {
|
|
@@ -3299,22 +3299,22 @@ function za({
|
|
|
3299
3299
|
const L = M(async () => {
|
|
3300
3300
|
c(!0), S(null);
|
|
3301
3301
|
try {
|
|
3302
|
-
const
|
|
3303
|
-
o(
|
|
3304
|
-
} catch (
|
|
3305
|
-
const N = String(
|
|
3302
|
+
const I = await e.listThreads();
|
|
3303
|
+
o(I ?? []);
|
|
3304
|
+
} catch (I) {
|
|
3305
|
+
const N = String(I);
|
|
3306
3306
|
S(N), r == null || r(N);
|
|
3307
3307
|
} finally {
|
|
3308
3308
|
c(!1);
|
|
3309
3309
|
}
|
|
3310
3310
|
}, [e, r]), D = M(async () => {
|
|
3311
|
-
b(!0),
|
|
3311
|
+
b(!0), v(null);
|
|
3312
3312
|
try {
|
|
3313
|
-
const
|
|
3314
|
-
h(
|
|
3315
|
-
} catch (
|
|
3316
|
-
const N = String(
|
|
3317
|
-
|
|
3313
|
+
const I = await e.listSharedThreads();
|
|
3314
|
+
h(I ?? []);
|
|
3315
|
+
} catch (I) {
|
|
3316
|
+
const N = String(I);
|
|
3317
|
+
v(N), r == null || r(N);
|
|
3318
3318
|
} finally {
|
|
3319
3319
|
b(!1);
|
|
3320
3320
|
}
|
|
@@ -3327,9 +3327,9 @@ function za({
|
|
|
3327
3327
|
n == null || n(l);
|
|
3328
3328
|
}, [l, n]);
|
|
3329
3329
|
const Z = M(
|
|
3330
|
-
async (
|
|
3330
|
+
async (I, N) => {
|
|
3331
3331
|
try {
|
|
3332
|
-
const U = N && typeof N == "object" ? { id: N.id, name: N.name ?? "" } : void 0, w = await e.createThread(
|
|
3332
|
+
const U = N && typeof N == "object" ? { id: N.id, name: N.name ?? "" } : void 0, w = await e.createThread(I, U);
|
|
3333
3333
|
return d(w.threadId), await L(), w.threadId;
|
|
3334
3334
|
} catch (U) {
|
|
3335
3335
|
const w = String(U);
|
|
@@ -3338,36 +3338,36 @@ function za({
|
|
|
3338
3338
|
},
|
|
3339
3339
|
[e, r, L]
|
|
3340
3340
|
), ne = M(
|
|
3341
|
-
async (
|
|
3341
|
+
async (I) => {
|
|
3342
3342
|
const N = a;
|
|
3343
|
-
o((w) => w.filter((A) => A.threadId !==
|
|
3343
|
+
o((w) => w.filter((A) => A.threadId !== I));
|
|
3344
3344
|
const U = new AbortController();
|
|
3345
|
-
z.current.set(
|
|
3345
|
+
z.current.set(I, U);
|
|
3346
3346
|
try {
|
|
3347
|
-
await e.deleteThread(
|
|
3347
|
+
await e.deleteThread(I), O.current === I && (d(null), s == null || s());
|
|
3348
3348
|
} catch (w) {
|
|
3349
3349
|
o(N);
|
|
3350
3350
|
const A = String(w);
|
|
3351
3351
|
r == null || r(A);
|
|
3352
3352
|
} finally {
|
|
3353
|
-
z.current.delete(
|
|
3353
|
+
z.current.delete(I);
|
|
3354
3354
|
}
|
|
3355
3355
|
},
|
|
3356
3356
|
[e, s, r, a]
|
|
3357
3357
|
), G = M(
|
|
3358
|
-
async (
|
|
3358
|
+
async (I, N) => {
|
|
3359
3359
|
try {
|
|
3360
|
-
await e.updateThread(
|
|
3360
|
+
await e.updateThread(I, N), await L();
|
|
3361
3361
|
} catch (U) {
|
|
3362
3362
|
r == null || r(String(U));
|
|
3363
3363
|
}
|
|
3364
3364
|
},
|
|
3365
3365
|
[e, r, L]
|
|
3366
3366
|
), W = M(
|
|
3367
|
-
async (
|
|
3367
|
+
async (I, N) => {
|
|
3368
3368
|
H(!0), x("Sharing thread…");
|
|
3369
3369
|
try {
|
|
3370
|
-
await e.shareThread(
|
|
3370
|
+
await e.shareThread(I, N), await D(), x("Shared successfully");
|
|
3371
3371
|
} catch (U) {
|
|
3372
3372
|
const w = Ka(U);
|
|
3373
3373
|
throw r == null || r(w), x(`Failed to share: ${w}`), new Error(w);
|
|
@@ -3377,9 +3377,9 @@ function za({
|
|
|
3377
3377
|
},
|
|
3378
3378
|
[e, r, D]
|
|
3379
3379
|
), V = M(
|
|
3380
|
-
async (
|
|
3380
|
+
async (I, N) => {
|
|
3381
3381
|
try {
|
|
3382
|
-
await e.unshareThread(
|
|
3382
|
+
await e.unshareThread(I, N), await D();
|
|
3383
3383
|
} catch (U) {
|
|
3384
3384
|
const w = String(U);
|
|
3385
3385
|
throw r == null || r(w), U;
|
|
@@ -3397,15 +3397,15 @@ function za({
|
|
|
3397
3397
|
unshareThread: V
|
|
3398
3398
|
}),
|
|
3399
3399
|
[Z, ne, G, L, D, W, V]
|
|
3400
|
-
), J = M((
|
|
3401
|
-
if (!(
|
|
3400
|
+
), J = M((I) => {
|
|
3401
|
+
if (!(I != null && I.threadId)) return;
|
|
3402
3402
|
const N = {
|
|
3403
|
-
threadId:
|
|
3404
|
-
title:
|
|
3405
|
-
project:
|
|
3406
|
-
createdAt:
|
|
3407
|
-
updatedAt:
|
|
3408
|
-
messageCount:
|
|
3403
|
+
threadId: I.threadId,
|
|
3404
|
+
title: I.title || `Thread ${I.threadId.slice(0, 8)}`,
|
|
3405
|
+
project: I.project,
|
|
3406
|
+
createdAt: I.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
3407
|
+
updatedAt: I.updatedAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
3408
|
+
messageCount: I.messageCount ?? 1
|
|
3409
3409
|
};
|
|
3410
3410
|
o((U) => {
|
|
3411
3411
|
let w = !1;
|
|
@@ -3455,7 +3455,7 @@ function Wa({
|
|
|
3455
3455
|
addThreadFromEvent: h,
|
|
3456
3456
|
shareInFlight: T,
|
|
3457
3457
|
shareStatus: b,
|
|
3458
|
-
clearShareStatus:
|
|
3458
|
+
clearShareStatus: v
|
|
3459
3459
|
} = za({
|
|
3460
3460
|
api: s,
|
|
3461
3461
|
initialThreadId: t,
|
|
@@ -3474,7 +3474,7 @@ function Wa({
|
|
|
3474
3474
|
actions: k,
|
|
3475
3475
|
shareInFlight: T,
|
|
3476
3476
|
shareStatus: b,
|
|
3477
|
-
clearShareStatus:
|
|
3477
|
+
clearShareStatus: v,
|
|
3478
3478
|
addThreadFromEvent: h
|
|
3479
3479
|
}),
|
|
3480
3480
|
[
|
|
@@ -3489,7 +3489,7 @@ function Wa({
|
|
|
3489
3489
|
k,
|
|
3490
3490
|
T,
|
|
3491
3491
|
b,
|
|
3492
|
-
|
|
3492
|
+
v,
|
|
3493
3493
|
h
|
|
3494
3494
|
]
|
|
3495
3495
|
);
|
|
@@ -3608,7 +3608,7 @@ function Xa(e) {
|
|
|
3608
3608
|
toolCallId: n ?? void 0
|
|
3609
3609
|
};
|
|
3610
3610
|
}
|
|
3611
|
-
function
|
|
3611
|
+
function vn(e) {
|
|
3612
3612
|
const t = e.artifact;
|
|
3613
3613
|
return !t || typeof t != "object" ? null : "metadata" in t && t.metadata ? t.metadata : {
|
|
3614
3614
|
id: t.id ?? e.id ?? `artifact-${Date.now()}`,
|
|
@@ -3619,7 +3619,7 @@ function In(e) {
|
|
|
3619
3619
|
};
|
|
3620
3620
|
}
|
|
3621
3621
|
function Ga(e, t) {
|
|
3622
|
-
const r =
|
|
3622
|
+
const r = vn(e);
|
|
3623
3623
|
if (!r) return e;
|
|
3624
3624
|
const n = {
|
|
3625
3625
|
...r,
|
|
@@ -3636,7 +3636,7 @@ function Ga(e, t) {
|
|
|
3636
3636
|
}
|
|
3637
3637
|
function Qa(e, t) {
|
|
3638
3638
|
return e.find((r) => {
|
|
3639
|
-
const n =
|
|
3639
|
+
const n = vn(r);
|
|
3640
3640
|
return (n == null ? void 0 : n.id) === t;
|
|
3641
3641
|
}) ?? null;
|
|
3642
3642
|
}
|
|
@@ -3818,7 +3818,7 @@ function Kr(e, t) {
|
|
|
3818
3818
|
function br(e) {
|
|
3819
3819
|
return e.call_id ?? e.id ?? null;
|
|
3820
3820
|
}
|
|
3821
|
-
function
|
|
3821
|
+
function In(e) {
|
|
3822
3822
|
return e.id ?? e.call_id ?? `tool-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
3823
3823
|
}
|
|
3824
3824
|
function Cn(e, t, r, n) {
|
|
@@ -3873,7 +3873,7 @@ function Sr(e, t) {
|
|
|
3873
3873
|
};
|
|
3874
3874
|
}
|
|
3875
3875
|
function oo(e, t) {
|
|
3876
|
-
const r = br(t), n = wr(e.messages, r), s = t.name ?? t.tool ?? void 0, a =
|
|
3876
|
+
const r = br(t), n = wr(e.messages, r), s = t.name ?? t.tool ?? void 0, a = In(t), o = {
|
|
3877
3877
|
type: t.type,
|
|
3878
3878
|
content: `Starting ${s ?? "tool"}...`,
|
|
3879
3879
|
seq: t.seq ?? null,
|
|
@@ -3915,7 +3915,7 @@ function io(e, t) {
|
|
|
3915
3915
|
return { ...e, messages: jt(e.messages, n, u) };
|
|
3916
3916
|
}
|
|
3917
3917
|
function co(e, t) {
|
|
3918
|
-
const r = br(t), n =
|
|
3918
|
+
const r = br(t), n = In(t);
|
|
3919
3919
|
let s = e.messages, a = wr(s, r);
|
|
3920
3920
|
if (a === -1) {
|
|
3921
3921
|
const h = t.name ?? t.tool ?? void 0;
|
|
@@ -3996,10 +3996,10 @@ function ho(e) {
|
|
|
3996
3996
|
const t = /* @__PURE__ */ new Map(), r = [], n = /* @__PURE__ */ new Map(), s = [];
|
|
3997
3997
|
for (let u = 0; u < e.length; u++) {
|
|
3998
3998
|
const c = e[u], m = c.checkpointId, S = m ?? `cp-${u}`, k = c.metadata ?? {}, h = typeof k.step == "number" ? k.step : null, T = typeof k.source == "string" ? k.source : null;
|
|
3999
|
-
let b = null,
|
|
3999
|
+
let b = null, v = null;
|
|
4000
4000
|
const _ = Array.isArray(c.messages) ? c.messages : [];
|
|
4001
4001
|
for (const O of _)
|
|
4002
|
-
O.role === "user" && (
|
|
4002
|
+
O.role === "user" && (v || (v = O), O.id && (b = O.id));
|
|
4003
4003
|
const x = c.next && c.next.length > 0 ? String(c.next[0]) : null, j = c.parentConfig ?? null, H = {
|
|
4004
4004
|
id: S,
|
|
4005
4005
|
step: h,
|
|
@@ -4011,8 +4011,8 @@ function ho(e) {
|
|
|
4011
4011
|
parentConfig: j,
|
|
4012
4012
|
userMessageId: b
|
|
4013
4013
|
};
|
|
4014
|
-
if (s.push(H), m && t.set(m, H), m &&
|
|
4015
|
-
const O = fo(
|
|
4014
|
+
if (s.push(H), m && t.set(m, H), m && v) {
|
|
4015
|
+
const O = fo(v);
|
|
4016
4016
|
O && n.set(m, O);
|
|
4017
4017
|
}
|
|
4018
4018
|
r.push({
|
|
@@ -4083,7 +4083,7 @@ function mo({
|
|
|
4083
4083
|
const [c, m] = ie(null), k = Le(
|
|
4084
4084
|
() => ht(c),
|
|
4085
4085
|
[c]
|
|
4086
|
-
).checkpoints, h = po(k), T = h.timeline, [b,
|
|
4086
|
+
).checkpoints, h = po(k), T = h.timeline, [b, v] = ie(!1), [_, x] = ie(!1), [j, H] = ie(null), O = Q(n), z = Q(null), L = Q(null), D = Q(null), Z = Q(null), ne = Q(null), G = Q(/* @__PURE__ */ new Map()), W = Q(null);
|
|
4087
4087
|
me(() => {
|
|
4088
4088
|
O.current = n;
|
|
4089
4089
|
}, [n]);
|
|
@@ -4118,7 +4118,7 @@ function mo({
|
|
|
4118
4118
|
W.current = K;
|
|
4119
4119
|
const fe = V({
|
|
4120
4120
|
threadId: R,
|
|
4121
|
-
setLoading:
|
|
4121
|
+
setLoading: v,
|
|
4122
4122
|
onStart: () => H(null),
|
|
4123
4123
|
handleError: (pe) => H(pe),
|
|
4124
4124
|
action: async (pe) => {
|
|
@@ -4133,7 +4133,7 @@ function mo({
|
|
|
4133
4133
|
);
|
|
4134
4134
|
return;
|
|
4135
4135
|
}
|
|
4136
|
-
const { checkpoints: De, latest:
|
|
4136
|
+
const { checkpoints: De, latest: Ie } = ht(Ue), te = C ? De.find((be) => be.checkpointId === C) ?? Ie : Ie;
|
|
4137
4137
|
t((te == null ? void 0 : te.messages) ?? [], {
|
|
4138
4138
|
checkpointId: (te == null ? void 0 : te.checkpointId) ?? null,
|
|
4139
4139
|
checkpointNs: (te == null ? void 0 : te.checkpointNs) ?? null,
|
|
@@ -4165,7 +4165,7 @@ function mo({
|
|
|
4165
4165
|
[ee]
|
|
4166
4166
|
), he = M((R) => {
|
|
4167
4167
|
L.current = R;
|
|
4168
|
-
}, []),
|
|
4168
|
+
}, []), I = M((R) => {
|
|
4169
4169
|
D.current = R;
|
|
4170
4170
|
}, []), N = M(
|
|
4171
4171
|
(R) => {
|
|
@@ -4256,7 +4256,7 @@ function mo({
|
|
|
4256
4256
|
J
|
|
4257
4257
|
]);
|
|
4258
4258
|
const g = M(() => {
|
|
4259
|
-
m(null),
|
|
4259
|
+
m(null), v(!1), x(!1), H(null), L.current = null, D.current = null, z.current = null, ne.current = null, Z.current = null;
|
|
4260
4260
|
}, []);
|
|
4261
4261
|
return {
|
|
4262
4262
|
threadCheckpoints: k,
|
|
@@ -4271,7 +4271,7 @@ function mo({
|
|
|
4271
4271
|
returnToLatest: A,
|
|
4272
4272
|
handleStateHistoryEvent: N,
|
|
4273
4273
|
markSkipNextLoad: he,
|
|
4274
|
-
markStreamPendingThread:
|
|
4274
|
+
markStreamPendingThread: I,
|
|
4275
4275
|
resetHistoryState: g,
|
|
4276
4276
|
clearState: g
|
|
4277
4277
|
};
|
|
@@ -4302,7 +4302,7 @@ function bo({
|
|
|
4302
4302
|
threadTimeline: h,
|
|
4303
4303
|
checkpointIndex: T,
|
|
4304
4304
|
isLoadingThread: b,
|
|
4305
|
-
isLoadingCheckpoint:
|
|
4305
|
+
isLoadingCheckpoint: v,
|
|
4306
4306
|
threadStateError: _,
|
|
4307
4307
|
loadThread: x,
|
|
4308
4308
|
navigateToCheckpoint: j,
|
|
@@ -4351,7 +4351,7 @@ function bo({
|
|
|
4351
4351
|
[S]
|
|
4352
4352
|
), he = M(async () => {
|
|
4353
4353
|
ne.current ? await ne.current() : (c([], {}), Z());
|
|
4354
|
-
}, [c, Z]),
|
|
4354
|
+
}, [c, Z]), I = Le(
|
|
4355
4355
|
() => ({
|
|
4356
4356
|
threadId: d,
|
|
4357
4357
|
messages: u.messages,
|
|
@@ -4366,7 +4366,7 @@ function bo({
|
|
|
4366
4366
|
metadata: ee,
|
|
4367
4367
|
values: u.values ?? {},
|
|
4368
4368
|
isLoading: b,
|
|
4369
|
-
isLoadingCheckpoint:
|
|
4369
|
+
isLoadingCheckpoint: v,
|
|
4370
4370
|
error: _,
|
|
4371
4371
|
loadOlder: async () => {
|
|
4372
4372
|
},
|
|
@@ -4409,7 +4409,7 @@ function bo({
|
|
|
4409
4409
|
T,
|
|
4410
4410
|
ee,
|
|
4411
4411
|
b,
|
|
4412
|
-
|
|
4412
|
+
v,
|
|
4413
4413
|
_,
|
|
4414
4414
|
c,
|
|
4415
4415
|
he,
|
|
@@ -4430,7 +4430,7 @@ function bo({
|
|
|
4430
4430
|
}),
|
|
4431
4431
|
[G, V]
|
|
4432
4432
|
);
|
|
4433
|
-
return /* @__PURE__ */ xe.jsx(Pn.Provider, { value: N, children: /* @__PURE__ */ xe.jsx(On.Provider, { value:
|
|
4433
|
+
return /* @__PURE__ */ xe.jsx(Pn.Provider, { value: N, children: /* @__PURE__ */ xe.jsx(On.Provider, { value: I, children: e }) });
|
|
4434
4434
|
}
|
|
4435
4435
|
function Wr(e, t) {
|
|
4436
4436
|
if (!e) return null;
|
|
@@ -4475,7 +4475,7 @@ function Ao({
|
|
|
4475
4475
|
onConnectionError: d,
|
|
4476
4476
|
onToolEnd: u
|
|
4477
4477
|
}) {
|
|
4478
|
-
const { chatApi: c, baseUrl: m } = yr(), S = m, { stream: k, stop: h, clear: T, isStreaming: b, error:
|
|
4478
|
+
const { chatApi: c, baseUrl: m } = yr(), S = m, { stream: k, stop: h, clear: T, isStreaming: b, error: v, connected: _ } = qa({ baseUrl: S }), [x, j] = ie(!1);
|
|
4479
4479
|
return me(() => {
|
|
4480
4480
|
j(b);
|
|
4481
4481
|
}, [b]), /* @__PURE__ */ xe.jsx(
|
|
@@ -4497,7 +4497,7 @@ function Ao({
|
|
|
4497
4497
|
Ro,
|
|
4498
4498
|
{
|
|
4499
4499
|
api: c,
|
|
4500
|
-
streamApi: { stream: k, stop: h, clear: T, isStreaming: b, error:
|
|
4500
|
+
streamApi: { stream: k, stop: h, clear: T, isStreaming: b, error: v, connected: _ },
|
|
4501
4501
|
onError: a,
|
|
4502
4502
|
onAuthError: o,
|
|
4503
4503
|
onConnectionError: d,
|
|
@@ -4524,7 +4524,7 @@ function Ro({
|
|
|
4524
4524
|
b !== void 0 && u();
|
|
4525
4525
|
}, [b, u]);
|
|
4526
4526
|
const {
|
|
4527
|
-
interrupt:
|
|
4527
|
+
interrupt: v,
|
|
4528
4528
|
checkpoint: _,
|
|
4529
4529
|
timelineCheckpoints: x,
|
|
4530
4530
|
handleStateHistoryEvent: j,
|
|
@@ -4584,12 +4584,12 @@ function Ro({
|
|
|
4584
4584
|
me(() => {
|
|
4585
4585
|
G(he);
|
|
4586
4586
|
}, [he, G]);
|
|
4587
|
-
const
|
|
4587
|
+
const I = M(async () => {
|
|
4588
4588
|
d(), u(), z(), k(null);
|
|
4589
4589
|
}, [u, z, k, d]);
|
|
4590
4590
|
me(() => {
|
|
4591
|
-
ne(
|
|
4592
|
-
}, [
|
|
4591
|
+
ne(I);
|
|
4592
|
+
}, [I, ne]);
|
|
4593
4593
|
const N = M(
|
|
4594
4594
|
async (w, A) => {
|
|
4595
4595
|
c && d();
|
|
@@ -4604,16 +4604,16 @@ function Ro({
|
|
|
4604
4604
|
}
|
|
4605
4605
|
let pe = null;
|
|
4606
4606
|
w.contentParts && w.contentParts.length > 0 && (pe = w.contentParts);
|
|
4607
|
-
const { contentParts: Ue, filesInfo: De } = pe ? { contentParts: pe, filesInfo: [] } : await Pa(C),
|
|
4608
|
-
X &&
|
|
4609
|
-
const te = A == null ? void 0 : A.originalMessageId, be = !!(A != null && A.edit && te), We = !fe &&
|
|
4607
|
+
const { contentParts: Ue, filesInfo: De } = pe ? { contentParts: pe, filesInfo: [] } : await Pa(C), Ie = [...Ue];
|
|
4608
|
+
X && Ie.push({ type: "text", text: R });
|
|
4609
|
+
const te = A == null ? void 0 : A.originalMessageId, be = !!(A != null && A.edit && te), We = !fe && Ie.length > 0;
|
|
4610
4610
|
let Ce = null;
|
|
4611
4611
|
if (We) {
|
|
4612
4612
|
const Oe = be ? te : `msg-${Date.now()}`;
|
|
4613
4613
|
Ce = Rn({
|
|
4614
4614
|
id: Oe,
|
|
4615
4615
|
role: "user",
|
|
4616
|
-
content:
|
|
4616
|
+
content: Ie,
|
|
4617
4617
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
4618
4618
|
}, "user"), be ? L(Ce, { editingMessageId: te }) : L(Ce);
|
|
4619
4619
|
}
|
|
@@ -4646,14 +4646,14 @@ function Ro({
|
|
|
4646
4646
|
messages: Z,
|
|
4647
4647
|
submit: N,
|
|
4648
4648
|
stop: d,
|
|
4649
|
-
interrupt:
|
|
4649
|
+
interrupt: v,
|
|
4650
4650
|
resume: () => Promise.resolve(),
|
|
4651
4651
|
goto: (w, A) => Promise.resolve(),
|
|
4652
4652
|
clearError: () => {
|
|
4653
4653
|
}
|
|
4654
4654
|
// TODO: Implement error clearing
|
|
4655
4655
|
}),
|
|
4656
|
-
[c, m, N, d,
|
|
4656
|
+
[c, m, N, d, v, S, Z]
|
|
4657
4657
|
);
|
|
4658
4658
|
return /* @__PURE__ */ xe.jsx(xn.Provider, { value: U, children: e });
|
|
4659
4659
|
}
|
|
@@ -4696,7 +4696,7 @@ function ti({
|
|
|
4696
4696
|
onThreadChange: u,
|
|
4697
4697
|
onToolEnd: c
|
|
4698
4698
|
}) {
|
|
4699
|
-
const m = Eo(t), S = Ot(l), k = Ot(d), h = Ot(o), T = Ot(u), b = Ot(c),
|
|
4699
|
+
const m = Eo(t), S = Ot(l), k = Ot(d), h = Ot(o), T = Ot(u), b = Ot(c), v = Le(
|
|
4700
4700
|
() => ({
|
|
4701
4701
|
initialThreadId: r,
|
|
4702
4702
|
initialCheckpointId: n,
|
|
@@ -4720,7 +4720,7 @@ function ti({
|
|
|
4720
4720
|
b
|
|
4721
4721
|
]
|
|
4722
4722
|
);
|
|
4723
|
-
return /* @__PURE__ */ xe.jsx(Ca, { apiConfig: m, children: /* @__PURE__ */ xe.jsx(Ao, { ...
|
|
4723
|
+
return /* @__PURE__ */ xe.jsx(Ca, { apiConfig: m, children: /* @__PURE__ */ xe.jsx(Ao, { ...v, children: e }) });
|
|
4724
4724
|
}
|
|
4725
4725
|
function Ot(e) {
|
|
4726
4726
|
const t = Q(e);
|
|
@@ -4766,7 +4766,7 @@ function _o() {
|
|
|
4766
4766
|
const e = {}, t = Un(), r = Fn();
|
|
4767
4767
|
return t && (e.baseUrl = t), r && (e.apiKey = r), e;
|
|
4768
4768
|
}
|
|
4769
|
-
function
|
|
4769
|
+
function vo() {
|
|
4770
4770
|
const e = _o(), t = nt.getAuthToken(), r = Un();
|
|
4771
4771
|
return {
|
|
4772
4772
|
apiBaseUrl: jn(
|
|
@@ -4786,7 +4786,7 @@ function Io() {
|
|
|
4786
4786
|
};
|
|
4787
4787
|
}
|
|
4788
4788
|
const Ln = pt.chatSettings;
|
|
4789
|
-
function
|
|
4789
|
+
function Io() {
|
|
4790
4790
|
try {
|
|
4791
4791
|
const e = localStorage.getItem(Ln);
|
|
4792
4792
|
return e ? JSON.parse(e) : {};
|
|
@@ -4806,7 +4806,7 @@ function Co(e) {
|
|
|
4806
4806
|
}
|
|
4807
4807
|
}
|
|
4808
4808
|
function ri() {
|
|
4809
|
-
const e =
|
|
4809
|
+
const e = vo(), t = Io(), r = nt.getAuthToken(), n = typeof t.apiBaseUrl == "string" ? t.apiBaseUrl : void 0;
|
|
4810
4810
|
return {
|
|
4811
4811
|
...e,
|
|
4812
4812
|
...t,
|
|
@@ -4826,6 +4826,11 @@ function ni(e) {
|
|
|
4826
4826
|
apiKey: e.apiKey ?? void 0
|
|
4827
4827
|
}), Co(e);
|
|
4828
4828
|
}
|
|
4829
|
+
function si(e) {
|
|
4830
|
+
if (!e || typeof e != "object") return !1;
|
|
4831
|
+
const t = e.type;
|
|
4832
|
+
return t === "tool.start" || t === "tool.end" || t === "tool.progress" || t === "artifact.update" || t === "messages/partial" || t === "thread_info" || t === "checkpoint" || t === "state_history" || t === "interrupt" || t === "heartbeat" || t === "error" || t === "metadata" || t === "values" || t === "updates" || t === "token" || t === "cancelled";
|
|
4833
|
+
}
|
|
4829
4834
|
export {
|
|
4830
4835
|
Ca as ApiProvider,
|
|
4831
4836
|
Aa as ChatApi,
|
|
@@ -4846,10 +4851,11 @@ export {
|
|
|
4846
4851
|
Sn as getChatToken,
|
|
4847
4852
|
ri as getCurrentSettings,
|
|
4848
4853
|
_o as getDefaultApiConfig,
|
|
4849
|
-
|
|
4854
|
+
vo as getDefaultChatSettings,
|
|
4850
4855
|
Te as httpClient,
|
|
4851
4856
|
$a as isEnvelope,
|
|
4852
|
-
|
|
4857
|
+
si as isStreamEvent,
|
|
4858
|
+
Io as loadStoredSettings,
|
|
4853
4859
|
Tn as onChatTokenChanged,
|
|
4854
4860
|
qt as post,
|
|
4855
4861
|
Pa as processAttachments,
|