gci-chatbot-ai 1.0.7 → 1.0.9
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/gci-chatbot-ai.js +410 -409
- package/dist/gci-chatbot-ai.umd.cjs +10 -10
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/gci-chatbot-ai.js
CHANGED
|
@@ -98,8 +98,8 @@ function p(e, t, r) {
|
|
|
98
98
|
a._zod.traits.add(e), t(a, c);
|
|
99
99
|
const u = i.prototype, l = Object.keys(u);
|
|
100
100
|
for (let d = 0; d < l.length; d++) {
|
|
101
|
-
const
|
|
102
|
-
|
|
101
|
+
const _ = l[d];
|
|
102
|
+
_ in a || (a[_] = u[_].bind(a));
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
const o = (r == null ? void 0 : r.Parent) ?? Object;
|
|
@@ -244,7 +244,7 @@ function se(e, t, r) {
|
|
|
244
244
|
const n = new e._zod.constr(t ?? e._zod.def);
|
|
245
245
|
return (!t || r != null && r.parent) && (n._zod.parent = e), n;
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function b(e) {
|
|
248
248
|
const t = e;
|
|
249
249
|
if (!t)
|
|
250
250
|
return {};
|
|
@@ -861,18 +861,18 @@ const gs = {
|
|
|
861
861
|
else {
|
|
862
862
|
const s = (a, c, u) => {
|
|
863
863
|
let l = pe(a), d;
|
|
864
|
-
for (const
|
|
865
|
-
if (
|
|
866
|
-
if (!
|
|
864
|
+
for (const _ of c) {
|
|
865
|
+
if (_._zod.def.when) {
|
|
866
|
+
if (!_._zod.def.when(a))
|
|
867
867
|
continue;
|
|
868
868
|
} else if (l)
|
|
869
869
|
continue;
|
|
870
|
-
const h = a.issues.length,
|
|
871
|
-
if (
|
|
870
|
+
const h = a.issues.length, y = _._zod.check(a);
|
|
871
|
+
if (y instanceof Promise && (u == null ? void 0 : u.async) === !1)
|
|
872
872
|
throw new me();
|
|
873
|
-
if (d ||
|
|
873
|
+
if (d || y instanceof Promise)
|
|
874
874
|
d = (d ?? Promise.resolve()).then(async () => {
|
|
875
|
-
await
|
|
875
|
+
await y, a.issues.length !== h && (l || (l = pe(a, h)));
|
|
876
876
|
});
|
|
877
877
|
else {
|
|
878
878
|
if (a.issues.length === h)
|
|
@@ -1239,8 +1239,8 @@ function Fr(e, t, r, n, o, s) {
|
|
|
1239
1239
|
i.push(d);
|
|
1240
1240
|
continue;
|
|
1241
1241
|
}
|
|
1242
|
-
const
|
|
1243
|
-
|
|
1242
|
+
const _ = c.run({ value: t[d], issues: [] }, n);
|
|
1243
|
+
_ instanceof Promise ? e.push(_.then((h) => Ce(h, r, d, t, l))) : Ce(_, r, d, t, l);
|
|
1244
1244
|
}
|
|
1245
1245
|
return i.length && r.issues.push({
|
|
1246
1246
|
code: "unrecognized_keys",
|
|
@@ -1290,29 +1290,29 @@ const qs = /* @__PURE__ */ p("$ZodObject", (e, t) => {
|
|
|
1290
1290
|
}), a;
|
|
1291
1291
|
a.value = {};
|
|
1292
1292
|
const l = [], d = i.shape;
|
|
1293
|
-
for (const
|
|
1294
|
-
const h = d[
|
|
1295
|
-
|
|
1293
|
+
for (const _ of i.keys) {
|
|
1294
|
+
const h = d[_], y = h._zod.optout === "optional", g = h._zod.run({ value: u[_], issues: [] }, c);
|
|
1295
|
+
g instanceof Promise ? l.push(g.then((v) => Ce(v, a, _, u, y))) : Ce(g, a, _, u, y);
|
|
1296
1296
|
}
|
|
1297
1297
|
return s ? Fr(l, u, a, c, n.value, e) : l.length ? Promise.all(l).then(() => a) : a;
|
|
1298
1298
|
};
|
|
1299
1299
|
}), Gs = /* @__PURE__ */ p("$ZodObjectJIT", (e, t) => {
|
|
1300
1300
|
qs.init(e, t);
|
|
1301
|
-
const r = e._zod.parse, n = Be(() => Jr(t)), o = (
|
|
1301
|
+
const r = e._zod.parse, n = Be(() => Jr(t)), o = (_) => {
|
|
1302
1302
|
var f;
|
|
1303
|
-
const h = new ms(["shape", "payload", "ctx"]),
|
|
1303
|
+
const h = new ms(["shape", "payload", "ctx"]), y = n.value, g = ($) => {
|
|
1304
1304
|
const Z = jt($);
|
|
1305
1305
|
return `shape[${Z}]._zod.run({ value: input[${Z}], issues: [] }, ctx)`;
|
|
1306
1306
|
};
|
|
1307
1307
|
h.write("const input = payload.value;");
|
|
1308
|
-
const
|
|
1309
|
-
let
|
|
1310
|
-
for (const $ of
|
|
1311
|
-
|
|
1308
|
+
const v = /* @__PURE__ */ Object.create(null);
|
|
1309
|
+
let E = 0;
|
|
1310
|
+
for (const $ of y.keys)
|
|
1311
|
+
v[$] = `key_${E++}`;
|
|
1312
1312
|
h.write("const newResult = {};");
|
|
1313
|
-
for (const $ of
|
|
1314
|
-
const Z =
|
|
1315
|
-
h.write(`const ${Z} = ${
|
|
1313
|
+
for (const $ of y.keys) {
|
|
1314
|
+
const Z = v[$], z = jt($), N = _[$], V = ((f = N == null ? void 0 : N._zod) == null ? void 0 : f.optout) === "optional";
|
|
1315
|
+
h.write(`const ${Z} = ${g($)};`), V ? h.write(`
|
|
1316
1316
|
if (${Z}.issues.length) {
|
|
1317
1317
|
if (${z} in input) {
|
|
1318
1318
|
payload.issues = payload.issues.concat(${Z}.issues.map(iss => ({
|
|
@@ -1349,21 +1349,21 @@ const qs = /* @__PURE__ */ p("$ZodObject", (e, t) => {
|
|
|
1349
1349
|
`);
|
|
1350
1350
|
}
|
|
1351
1351
|
h.write("payload.value = newResult;"), h.write("return payload;");
|
|
1352
|
-
const
|
|
1353
|
-
return ($, Z) =>
|
|
1352
|
+
const w = h.compile();
|
|
1353
|
+
return ($, Z) => w(_, $, Z);
|
|
1354
1354
|
};
|
|
1355
1355
|
let s;
|
|
1356
1356
|
const i = ke, a = !ot.jitless, u = a && io.value, l = t.catchall;
|
|
1357
1357
|
let d;
|
|
1358
|
-
e._zod.parse = (
|
|
1358
|
+
e._zod.parse = (_, h) => {
|
|
1359
1359
|
d ?? (d = n.value);
|
|
1360
|
-
const
|
|
1361
|
-
return i(
|
|
1360
|
+
const y = _.value;
|
|
1361
|
+
return i(y) ? a && u && (h == null ? void 0 : h.async) === !1 && h.jitless !== !0 ? (s || (s = o(t.shape)), _ = s(_, h), l ? Fr([], y, _, h, d, e) : _) : r(_, h) : (_.issues.push({
|
|
1362
1362
|
expected: "object",
|
|
1363
1363
|
code: "invalid_type",
|
|
1364
|
-
input:
|
|
1364
|
+
input: y,
|
|
1365
1365
|
inst: e
|
|
1366
|
-
}),
|
|
1366
|
+
}), _);
|
|
1367
1367
|
};
|
|
1368
1368
|
});
|
|
1369
1369
|
function Dt(e, t, r, n) {
|
|
@@ -1805,7 +1805,7 @@ const Ee = globalThis.__zod_globalRegistry;
|
|
|
1805
1805
|
function ha(e, t) {
|
|
1806
1806
|
return new e({
|
|
1807
1807
|
type: "string",
|
|
1808
|
-
...
|
|
1808
|
+
...b(t)
|
|
1809
1809
|
});
|
|
1810
1810
|
}
|
|
1811
1811
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1815,7 +1815,7 @@ function ma(e, t) {
|
|
|
1815
1815
|
format: "email",
|
|
1816
1816
|
check: "string_format",
|
|
1817
1817
|
abort: !1,
|
|
1818
|
-
...
|
|
1818
|
+
...b(t)
|
|
1819
1819
|
});
|
|
1820
1820
|
}
|
|
1821
1821
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1825,7 +1825,7 @@ function Yt(e, t) {
|
|
|
1825
1825
|
format: "guid",
|
|
1826
1826
|
check: "string_format",
|
|
1827
1827
|
abort: !1,
|
|
1828
|
-
...
|
|
1828
|
+
...b(t)
|
|
1829
1829
|
});
|
|
1830
1830
|
}
|
|
1831
1831
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1835,7 +1835,7 @@ function ga(e, t) {
|
|
|
1835
1835
|
format: "uuid",
|
|
1836
1836
|
check: "string_format",
|
|
1837
1837
|
abort: !1,
|
|
1838
|
-
...
|
|
1838
|
+
...b(t)
|
|
1839
1839
|
});
|
|
1840
1840
|
}
|
|
1841
1841
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1846,7 +1846,7 @@ function va(e, t) {
|
|
|
1846
1846
|
check: "string_format",
|
|
1847
1847
|
abort: !1,
|
|
1848
1848
|
version: "v4",
|
|
1849
|
-
...
|
|
1849
|
+
...b(t)
|
|
1850
1850
|
});
|
|
1851
1851
|
}
|
|
1852
1852
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1857,7 +1857,7 @@ function _a(e, t) {
|
|
|
1857
1857
|
check: "string_format",
|
|
1858
1858
|
abort: !1,
|
|
1859
1859
|
version: "v6",
|
|
1860
|
-
...
|
|
1860
|
+
...b(t)
|
|
1861
1861
|
});
|
|
1862
1862
|
}
|
|
1863
1863
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1868,7 +1868,7 @@ function ya(e, t) {
|
|
|
1868
1868
|
check: "string_format",
|
|
1869
1869
|
abort: !1,
|
|
1870
1870
|
version: "v7",
|
|
1871
|
-
...
|
|
1871
|
+
...b(t)
|
|
1872
1872
|
});
|
|
1873
1873
|
}
|
|
1874
1874
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1878,7 +1878,7 @@ function ba(e, t) {
|
|
|
1878
1878
|
format: "url",
|
|
1879
1879
|
check: "string_format",
|
|
1880
1880
|
abort: !1,
|
|
1881
|
-
...
|
|
1881
|
+
...b(t)
|
|
1882
1882
|
});
|
|
1883
1883
|
}
|
|
1884
1884
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1888,7 +1888,7 @@ function wa(e, t) {
|
|
|
1888
1888
|
format: "emoji",
|
|
1889
1889
|
check: "string_format",
|
|
1890
1890
|
abort: !1,
|
|
1891
|
-
...
|
|
1891
|
+
...b(t)
|
|
1892
1892
|
});
|
|
1893
1893
|
}
|
|
1894
1894
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1898,7 +1898,7 @@ function Ia(e, t) {
|
|
|
1898
1898
|
format: "nanoid",
|
|
1899
1899
|
check: "string_format",
|
|
1900
1900
|
abort: !1,
|
|
1901
|
-
...
|
|
1901
|
+
...b(t)
|
|
1902
1902
|
});
|
|
1903
1903
|
}
|
|
1904
1904
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1908,7 +1908,7 @@ function Ea(e, t) {
|
|
|
1908
1908
|
format: "cuid",
|
|
1909
1909
|
check: "string_format",
|
|
1910
1910
|
abort: !1,
|
|
1911
|
-
...
|
|
1911
|
+
...b(t)
|
|
1912
1912
|
});
|
|
1913
1913
|
}
|
|
1914
1914
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1918,7 +1918,7 @@ function ka(e, t) {
|
|
|
1918
1918
|
format: "cuid2",
|
|
1919
1919
|
check: "string_format",
|
|
1920
1920
|
abort: !1,
|
|
1921
|
-
...
|
|
1921
|
+
...b(t)
|
|
1922
1922
|
});
|
|
1923
1923
|
}
|
|
1924
1924
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1928,7 +1928,7 @@ function za(e, t) {
|
|
|
1928
1928
|
format: "ulid",
|
|
1929
1929
|
check: "string_format",
|
|
1930
1930
|
abort: !1,
|
|
1931
|
-
...
|
|
1931
|
+
...b(t)
|
|
1932
1932
|
});
|
|
1933
1933
|
}
|
|
1934
1934
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1938,7 +1938,7 @@ function Sa(e, t) {
|
|
|
1938
1938
|
format: "xid",
|
|
1939
1939
|
check: "string_format",
|
|
1940
1940
|
abort: !1,
|
|
1941
|
-
...
|
|
1941
|
+
...b(t)
|
|
1942
1942
|
});
|
|
1943
1943
|
}
|
|
1944
1944
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1948,7 +1948,7 @@ function Oa(e, t) {
|
|
|
1948
1948
|
format: "ksuid",
|
|
1949
1949
|
check: "string_format",
|
|
1950
1950
|
abort: !1,
|
|
1951
|
-
...
|
|
1951
|
+
...b(t)
|
|
1952
1952
|
});
|
|
1953
1953
|
}
|
|
1954
1954
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1958,7 +1958,7 @@ function Za(e, t) {
|
|
|
1958
1958
|
format: "ipv4",
|
|
1959
1959
|
check: "string_format",
|
|
1960
1960
|
abort: !1,
|
|
1961
|
-
...
|
|
1961
|
+
...b(t)
|
|
1962
1962
|
});
|
|
1963
1963
|
}
|
|
1964
1964
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1968,7 +1968,7 @@ function $a(e, t) {
|
|
|
1968
1968
|
format: "ipv6",
|
|
1969
1969
|
check: "string_format",
|
|
1970
1970
|
abort: !1,
|
|
1971
|
-
...
|
|
1971
|
+
...b(t)
|
|
1972
1972
|
});
|
|
1973
1973
|
}
|
|
1974
1974
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1978,7 +1978,7 @@ function Ta(e, t) {
|
|
|
1978
1978
|
format: "cidrv4",
|
|
1979
1979
|
check: "string_format",
|
|
1980
1980
|
abort: !1,
|
|
1981
|
-
...
|
|
1981
|
+
...b(t)
|
|
1982
1982
|
});
|
|
1983
1983
|
}
|
|
1984
1984
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1988,7 +1988,7 @@ function Na(e, t) {
|
|
|
1988
1988
|
format: "cidrv6",
|
|
1989
1989
|
check: "string_format",
|
|
1990
1990
|
abort: !1,
|
|
1991
|
-
...
|
|
1991
|
+
...b(t)
|
|
1992
1992
|
});
|
|
1993
1993
|
}
|
|
1994
1994
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1998,7 +1998,7 @@ function Pa(e, t) {
|
|
|
1998
1998
|
format: "base64",
|
|
1999
1999
|
check: "string_format",
|
|
2000
2000
|
abort: !1,
|
|
2001
|
-
...
|
|
2001
|
+
...b(t)
|
|
2002
2002
|
});
|
|
2003
2003
|
}
|
|
2004
2004
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2008,7 +2008,7 @@ function Aa(e, t) {
|
|
|
2008
2008
|
format: "base64url",
|
|
2009
2009
|
check: "string_format",
|
|
2010
2010
|
abort: !1,
|
|
2011
|
-
...
|
|
2011
|
+
...b(t)
|
|
2012
2012
|
});
|
|
2013
2013
|
}
|
|
2014
2014
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2018,7 +2018,7 @@ function Ra(e, t) {
|
|
|
2018
2018
|
format: "e164",
|
|
2019
2019
|
check: "string_format",
|
|
2020
2020
|
abort: !1,
|
|
2021
|
-
...
|
|
2021
|
+
...b(t)
|
|
2022
2022
|
});
|
|
2023
2023
|
}
|
|
2024
2024
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2028,7 +2028,7 @@ function xa(e, t) {
|
|
|
2028
2028
|
format: "jwt",
|
|
2029
2029
|
check: "string_format",
|
|
2030
2030
|
abort: !1,
|
|
2031
|
-
...
|
|
2031
|
+
...b(t)
|
|
2032
2032
|
});
|
|
2033
2033
|
}
|
|
2034
2034
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2040,7 +2040,7 @@ function ja(e, t) {
|
|
|
2040
2040
|
offset: !1,
|
|
2041
2041
|
local: !1,
|
|
2042
2042
|
precision: null,
|
|
2043
|
-
...
|
|
2043
|
+
...b(t)
|
|
2044
2044
|
});
|
|
2045
2045
|
}
|
|
2046
2046
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2049,7 +2049,7 @@ function Ca(e, t) {
|
|
|
2049
2049
|
type: "string",
|
|
2050
2050
|
format: "date",
|
|
2051
2051
|
check: "string_format",
|
|
2052
|
-
...
|
|
2052
|
+
...b(t)
|
|
2053
2053
|
});
|
|
2054
2054
|
}
|
|
2055
2055
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2059,7 +2059,7 @@ function Ma(e, t) {
|
|
|
2059
2059
|
format: "time",
|
|
2060
2060
|
check: "string_format",
|
|
2061
2061
|
precision: null,
|
|
2062
|
-
...
|
|
2062
|
+
...b(t)
|
|
2063
2063
|
});
|
|
2064
2064
|
}
|
|
2065
2065
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2068,7 +2068,7 @@ function Da(e, t) {
|
|
|
2068
2068
|
type: "string",
|
|
2069
2069
|
format: "duration",
|
|
2070
2070
|
check: "string_format",
|
|
2071
|
-
...
|
|
2071
|
+
...b(t)
|
|
2072
2072
|
});
|
|
2073
2073
|
}
|
|
2074
2074
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2076,7 +2076,7 @@ function Ua(e, t) {
|
|
|
2076
2076
|
return new e({
|
|
2077
2077
|
type: "number",
|
|
2078
2078
|
checks: [],
|
|
2079
|
-
...
|
|
2079
|
+
...b(t)
|
|
2080
2080
|
});
|
|
2081
2081
|
}
|
|
2082
2082
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2086,21 +2086,21 @@ function La(e, t) {
|
|
|
2086
2086
|
check: "number_format",
|
|
2087
2087
|
abort: !1,
|
|
2088
2088
|
format: "safeint",
|
|
2089
|
-
...
|
|
2089
|
+
...b(t)
|
|
2090
2090
|
});
|
|
2091
2091
|
}
|
|
2092
2092
|
// @__NO_SIDE_EFFECTS__
|
|
2093
2093
|
function Ja(e, t) {
|
|
2094
2094
|
return new e({
|
|
2095
2095
|
type: "boolean",
|
|
2096
|
-
...
|
|
2096
|
+
...b(t)
|
|
2097
2097
|
});
|
|
2098
2098
|
}
|
|
2099
2099
|
// @__NO_SIDE_EFFECTS__
|
|
2100
2100
|
function Fa(e, t) {
|
|
2101
2101
|
return new e({
|
|
2102
2102
|
type: "null",
|
|
2103
|
-
...
|
|
2103
|
+
...b(t)
|
|
2104
2104
|
});
|
|
2105
2105
|
}
|
|
2106
2106
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2113,14 +2113,14 @@ function Va(e) {
|
|
|
2113
2113
|
function Ba(e, t) {
|
|
2114
2114
|
return new e({
|
|
2115
2115
|
type: "never",
|
|
2116
|
-
...
|
|
2116
|
+
...b(t)
|
|
2117
2117
|
});
|
|
2118
2118
|
}
|
|
2119
2119
|
// @__NO_SIDE_EFFECTS__
|
|
2120
2120
|
function qt(e, t) {
|
|
2121
2121
|
return new Mr({
|
|
2122
2122
|
check: "less_than",
|
|
2123
|
-
...
|
|
2123
|
+
...b(t),
|
|
2124
2124
|
value: e,
|
|
2125
2125
|
inclusive: !1
|
|
2126
2126
|
});
|
|
@@ -2129,7 +2129,7 @@ function qt(e, t) {
|
|
|
2129
2129
|
function Xe(e, t) {
|
|
2130
2130
|
return new Mr({
|
|
2131
2131
|
check: "less_than",
|
|
2132
|
-
...
|
|
2132
|
+
...b(t),
|
|
2133
2133
|
value: e,
|
|
2134
2134
|
inclusive: !0
|
|
2135
2135
|
});
|
|
@@ -2138,7 +2138,7 @@ function Xe(e, t) {
|
|
|
2138
2138
|
function Gt(e, t) {
|
|
2139
2139
|
return new Dr({
|
|
2140
2140
|
check: "greater_than",
|
|
2141
|
-
...
|
|
2141
|
+
...b(t),
|
|
2142
2142
|
value: e,
|
|
2143
2143
|
inclusive: !1
|
|
2144
2144
|
});
|
|
@@ -2147,7 +2147,7 @@ function Gt(e, t) {
|
|
|
2147
2147
|
function Qe(e, t) {
|
|
2148
2148
|
return new Dr({
|
|
2149
2149
|
check: "greater_than",
|
|
2150
|
-
...
|
|
2150
|
+
...b(t),
|
|
2151
2151
|
value: e,
|
|
2152
2152
|
inclusive: !0
|
|
2153
2153
|
});
|
|
@@ -2156,7 +2156,7 @@ function Qe(e, t) {
|
|
|
2156
2156
|
function Ht(e, t) {
|
|
2157
2157
|
return new ns({
|
|
2158
2158
|
check: "multiple_of",
|
|
2159
|
-
...
|
|
2159
|
+
...b(t),
|
|
2160
2160
|
value: e
|
|
2161
2161
|
});
|
|
2162
2162
|
}
|
|
@@ -2164,7 +2164,7 @@ function Ht(e, t) {
|
|
|
2164
2164
|
function Wr(e, t) {
|
|
2165
2165
|
return new ss({
|
|
2166
2166
|
check: "max_length",
|
|
2167
|
-
...
|
|
2167
|
+
...b(t),
|
|
2168
2168
|
maximum: e
|
|
2169
2169
|
});
|
|
2170
2170
|
}
|
|
@@ -2172,7 +2172,7 @@ function Wr(e, t) {
|
|
|
2172
2172
|
function Me(e, t) {
|
|
2173
2173
|
return new as({
|
|
2174
2174
|
check: "min_length",
|
|
2175
|
-
...
|
|
2175
|
+
...b(t),
|
|
2176
2176
|
minimum: e
|
|
2177
2177
|
});
|
|
2178
2178
|
}
|
|
@@ -2180,7 +2180,7 @@ function Me(e, t) {
|
|
|
2180
2180
|
function Yr(e, t) {
|
|
2181
2181
|
return new is({
|
|
2182
2182
|
check: "length_equals",
|
|
2183
|
-
...
|
|
2183
|
+
...b(t),
|
|
2184
2184
|
length: e
|
|
2185
2185
|
});
|
|
2186
2186
|
}
|
|
@@ -2189,7 +2189,7 @@ function Wa(e, t) {
|
|
|
2189
2189
|
return new us({
|
|
2190
2190
|
check: "string_format",
|
|
2191
2191
|
format: "regex",
|
|
2192
|
-
...
|
|
2192
|
+
...b(t),
|
|
2193
2193
|
pattern: e
|
|
2194
2194
|
});
|
|
2195
2195
|
}
|
|
@@ -2198,7 +2198,7 @@ function Ya(e) {
|
|
|
2198
2198
|
return new cs({
|
|
2199
2199
|
check: "string_format",
|
|
2200
2200
|
format: "lowercase",
|
|
2201
|
-
...
|
|
2201
|
+
...b(e)
|
|
2202
2202
|
});
|
|
2203
2203
|
}
|
|
2204
2204
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2206,7 +2206,7 @@ function qa(e) {
|
|
|
2206
2206
|
return new ls({
|
|
2207
2207
|
check: "string_format",
|
|
2208
2208
|
format: "uppercase",
|
|
2209
|
-
...
|
|
2209
|
+
...b(e)
|
|
2210
2210
|
});
|
|
2211
2211
|
}
|
|
2212
2212
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2214,7 +2214,7 @@ function Ga(e, t) {
|
|
|
2214
2214
|
return new ds({
|
|
2215
2215
|
check: "string_format",
|
|
2216
2216
|
format: "includes",
|
|
2217
|
-
...
|
|
2217
|
+
...b(t),
|
|
2218
2218
|
includes: e
|
|
2219
2219
|
});
|
|
2220
2220
|
}
|
|
@@ -2223,7 +2223,7 @@ function Ha(e, t) {
|
|
|
2223
2223
|
return new ps({
|
|
2224
2224
|
check: "string_format",
|
|
2225
2225
|
format: "starts_with",
|
|
2226
|
-
...
|
|
2226
|
+
...b(t),
|
|
2227
2227
|
prefix: e
|
|
2228
2228
|
});
|
|
2229
2229
|
}
|
|
@@ -2232,7 +2232,7 @@ function Xa(e, t) {
|
|
|
2232
2232
|
return new fs({
|
|
2233
2233
|
check: "string_format",
|
|
2234
2234
|
format: "ends_with",
|
|
2235
|
-
...
|
|
2235
|
+
...b(t),
|
|
2236
2236
|
suffix: e
|
|
2237
2237
|
});
|
|
2238
2238
|
}
|
|
@@ -2271,12 +2271,12 @@ function ni(e, t, r) {
|
|
|
2271
2271
|
// get element() {
|
|
2272
2272
|
// return element;
|
|
2273
2273
|
// },
|
|
2274
|
-
...
|
|
2274
|
+
...b(r)
|
|
2275
2275
|
});
|
|
2276
2276
|
}
|
|
2277
2277
|
// @__NO_SIDE_EFFECTS__
|
|
2278
2278
|
function oi(e, t, r) {
|
|
2279
|
-
const n =
|
|
2279
|
+
const n = b(r);
|
|
2280
2280
|
return n.abort ?? (n.abort = !0), new e({
|
|
2281
2281
|
type: "custom",
|
|
2282
2282
|
check: "custom",
|
|
@@ -2290,7 +2290,7 @@ function si(e, t, r) {
|
|
|
2290
2290
|
type: "custom",
|
|
2291
2291
|
check: "custom",
|
|
2292
2292
|
fn: t,
|
|
2293
|
-
...
|
|
2293
|
+
...b(r)
|
|
2294
2294
|
});
|
|
2295
2295
|
}
|
|
2296
2296
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2309,7 +2309,7 @@ function ai(e) {
|
|
|
2309
2309
|
function ii(e, t) {
|
|
2310
2310
|
const r = new W({
|
|
2311
2311
|
check: "custom",
|
|
2312
|
-
...
|
|
2312
|
+
...b(t)
|
|
2313
2313
|
});
|
|
2314
2314
|
return r._zod.check = e, r;
|
|
2315
2315
|
}
|
|
@@ -2342,21 +2342,21 @@ function A(e, t, r = { path: [], schemaPath: [] }) {
|
|
|
2342
2342
|
if (a)
|
|
2343
2343
|
i.schema = a;
|
|
2344
2344
|
else {
|
|
2345
|
-
const
|
|
2345
|
+
const _ = {
|
|
2346
2346
|
...r,
|
|
2347
2347
|
schemaPath: [...r.schemaPath, e],
|
|
2348
2348
|
path: r.path
|
|
2349
2349
|
};
|
|
2350
2350
|
if (e._zod.processJSONSchema)
|
|
2351
|
-
e._zod.processJSONSchema(t, i.schema,
|
|
2351
|
+
e._zod.processJSONSchema(t, i.schema, _);
|
|
2352
2352
|
else {
|
|
2353
|
-
const
|
|
2354
|
-
if (!
|
|
2353
|
+
const y = i.schema, g = t.processors[o.type];
|
|
2354
|
+
if (!g)
|
|
2355
2355
|
throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);
|
|
2356
|
-
|
|
2356
|
+
g(e, t, y, _);
|
|
2357
2357
|
}
|
|
2358
2358
|
const h = e._zod.parent;
|
|
2359
|
-
h && (i.ref || (i.ref = h), A(h, t,
|
|
2359
|
+
h && (i.ref || (i.ref = h), A(h, t, _), t.seen.get(h).isParent = !0);
|
|
2360
2360
|
}
|
|
2361
2361
|
const c = t.metadataRegistry.get(e);
|
|
2362
2362
|
return c && Object.assign(i.schema, c), t.io === "input" && L(e) && (delete i.schema.examples, delete i.schema.default), t.io === "input" && i.schema._prefault && ((n = i.schema).default ?? (n.default = i.schema._prefault)), delete i.schema._prefault, t.seen.get(e).schema;
|
|
@@ -2370,35 +2370,35 @@ function Ue(e, t) {
|
|
|
2370
2370
|
for (const l of e.seen.entries()) {
|
|
2371
2371
|
const d = (i = e.metadataRegistry.get(l[0])) == null ? void 0 : i.id;
|
|
2372
2372
|
if (d) {
|
|
2373
|
-
const
|
|
2374
|
-
if (
|
|
2373
|
+
const _ = n.get(d);
|
|
2374
|
+
if (_ && _ !== l[0])
|
|
2375
2375
|
throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
2376
2376
|
n.set(d, l[0]);
|
|
2377
2377
|
}
|
|
2378
2378
|
}
|
|
2379
2379
|
const o = (l) => {
|
|
2380
|
-
var
|
|
2380
|
+
var g;
|
|
2381
2381
|
const d = e.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
2382
2382
|
if (e.external) {
|
|
2383
|
-
const
|
|
2384
|
-
if (
|
|
2385
|
-
return { ref:
|
|
2386
|
-
const
|
|
2387
|
-
return l[1].defId =
|
|
2383
|
+
const v = (g = e.external.registry.get(l[0])) == null ? void 0 : g.id, E = e.external.uri ?? ((f) => f);
|
|
2384
|
+
if (v)
|
|
2385
|
+
return { ref: E(v) };
|
|
2386
|
+
const w = l[1].defId ?? l[1].schema.id ?? `schema${e.counter++}`;
|
|
2387
|
+
return l[1].defId = w, { defId: w, ref: `${E("__shared")}#/${d}/${w}` };
|
|
2388
2388
|
}
|
|
2389
2389
|
if (l[1] === r)
|
|
2390
2390
|
return { ref: "#" };
|
|
2391
|
-
const h = `#/${d}/`,
|
|
2392
|
-
return { defId:
|
|
2391
|
+
const h = `#/${d}/`, y = l[1].schema.id ?? `__schema${e.counter++}`;
|
|
2392
|
+
return { defId: y, ref: h + y };
|
|
2393
2393
|
}, s = (l) => {
|
|
2394
2394
|
if (l[1].schema.$ref)
|
|
2395
2395
|
return;
|
|
2396
|
-
const d = l[1], { ref:
|
|
2396
|
+
const d = l[1], { ref: _, defId: h } = o(l);
|
|
2397
2397
|
d.def = { ...d.schema }, h && (d.defId = h);
|
|
2398
|
-
const
|
|
2399
|
-
for (const
|
|
2400
|
-
delete
|
|
2401
|
-
|
|
2398
|
+
const y = d.schema;
|
|
2399
|
+
for (const g in y)
|
|
2400
|
+
delete y[g];
|
|
2401
|
+
y.$ref = _;
|
|
2402
2402
|
};
|
|
2403
2403
|
if (e.cycles === "throw")
|
|
2404
2404
|
for (const l of e.seen.entries()) {
|
|
@@ -2444,24 +2444,24 @@ function Le(e, t) {
|
|
|
2444
2444
|
const l = e.seen.get(u);
|
|
2445
2445
|
if (l.ref === null)
|
|
2446
2446
|
return;
|
|
2447
|
-
const d = l.def ?? l.schema,
|
|
2447
|
+
const d = l.def ?? l.schema, _ = { ...d }, h = l.ref;
|
|
2448
2448
|
if (l.ref = null, h) {
|
|
2449
2449
|
n(h);
|
|
2450
|
-
const
|
|
2451
|
-
if (
|
|
2452
|
-
for (const
|
|
2453
|
-
|
|
2454
|
-
if (
|
|
2455
|
-
for (const
|
|
2456
|
-
|
|
2450
|
+
const g = e.seen.get(h), v = g.schema;
|
|
2451
|
+
if (v.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (d.allOf = d.allOf ?? [], d.allOf.push(v)) : Object.assign(d, v), Object.assign(d, _), u._zod.parent === h)
|
|
2452
|
+
for (const w in d)
|
|
2453
|
+
w === "$ref" || w === "allOf" || w in _ || delete d[w];
|
|
2454
|
+
if (v.$ref)
|
|
2455
|
+
for (const w in d)
|
|
2456
|
+
w === "$ref" || w === "allOf" || w in g.def && JSON.stringify(d[w]) === JSON.stringify(g.def[w]) && delete d[w];
|
|
2457
2457
|
}
|
|
2458
|
-
const
|
|
2459
|
-
if (
|
|
2460
|
-
n(
|
|
2461
|
-
const
|
|
2462
|
-
if (
|
|
2463
|
-
for (const
|
|
2464
|
-
|
|
2458
|
+
const y = u._zod.parent;
|
|
2459
|
+
if (y && y !== h) {
|
|
2460
|
+
n(y);
|
|
2461
|
+
const g = e.seen.get(y);
|
|
2462
|
+
if (g != null && g.schema.$ref && (d.$ref = g.schema.$ref, g.def))
|
|
2463
|
+
for (const v in d)
|
|
2464
|
+
v === "$ref" || v === "allOf" || v in g.def && JSON.stringify(d[v]) === JSON.stringify(g.def[v]) && delete d[v];
|
|
2465
2465
|
}
|
|
2466
2466
|
e.override({
|
|
2467
2467
|
zodSchema: u,
|
|
@@ -2691,7 +2691,7 @@ const ui = (e, t = {}) => (r) => {
|
|
|
2691
2691
|
}, Ei = (e, t, r, n) => {
|
|
2692
2692
|
const o = r, s = e._zod.def;
|
|
2693
2693
|
o.type = "array";
|
|
2694
|
-
const i = t.target === "draft-2020-12" ? "prefixItems" : "items", a = t.target === "draft-2020-12" || t.target === "openapi-3.0" ? "items" : "additionalItems", c = s.items.map((
|
|
2694
|
+
const i = t.target === "draft-2020-12" ? "prefixItems" : "items", a = t.target === "draft-2020-12" || t.target === "openapi-3.0" ? "items" : "additionalItems", c = s.items.map((_, h) => A(_, t, {
|
|
2695
2695
|
...n,
|
|
2696
2696
|
path: [...n.path, i, h]
|
|
2697
2697
|
})), u = s.rest ? A(s.rest, t, {
|
|
@@ -2940,7 +2940,7 @@ const Ri = (e, t) => {
|
|
|
2940
2940
|
}), Wi = /* @__PURE__ */ p("ZodString", (e, t) => {
|
|
2941
2941
|
vt.init(e, t), yn.init(e, t), e.email = (r) => e.check(/* @__PURE__ */ ma(Yi, r)), e.url = (r) => e.check(/* @__PURE__ */ ba(qi, r)), e.jwt = (r) => e.check(/* @__PURE__ */ xa(cu, r)), e.emoji = (r) => e.check(/* @__PURE__ */ wa(Gi, r)), e.guid = (r) => e.check(/* @__PURE__ */ Yt(Qt, r)), e.uuid = (r) => e.check(/* @__PURE__ */ ga(je, r)), e.uuidv4 = (r) => e.check(/* @__PURE__ */ va(je, r)), e.uuidv6 = (r) => e.check(/* @__PURE__ */ _a(je, r)), e.uuidv7 = (r) => e.check(/* @__PURE__ */ ya(je, r)), e.nanoid = (r) => e.check(/* @__PURE__ */ Ia(Hi, r)), e.guid = (r) => e.check(/* @__PURE__ */ Yt(Qt, r)), e.cuid = (r) => e.check(/* @__PURE__ */ Ea(Xi, r)), e.cuid2 = (r) => e.check(/* @__PURE__ */ ka(Qi, r)), e.ulid = (r) => e.check(/* @__PURE__ */ za(Ki, r)), e.base64 = (r) => e.check(/* @__PURE__ */ Pa(au, r)), e.base64url = (r) => e.check(/* @__PURE__ */ Aa(iu, r)), e.xid = (r) => e.check(/* @__PURE__ */ Sa(eu, r)), e.ksuid = (r) => e.check(/* @__PURE__ */ Oa(tu, r)), e.ipv4 = (r) => e.check(/* @__PURE__ */ Za(ru, r)), e.ipv6 = (r) => e.check(/* @__PURE__ */ $a(nu, r)), e.cidrv4 = (r) => e.check(/* @__PURE__ */ Ta(ou, r)), e.cidrv6 = (r) => e.check(/* @__PURE__ */ Na(su, r)), e.e164 = (r) => e.check(/* @__PURE__ */ Ra(uu, r)), e.datetime = (r) => e.check(Oi(r)), e.date = (r) => e.check($i(r)), e.time = (r) => e.check(Ni(r)), e.duration = (r) => e.check(Ai(r));
|
|
2942
2942
|
});
|
|
2943
|
-
function
|
|
2943
|
+
function m(e) {
|
|
2944
2944
|
return /* @__PURE__ */ ha(Wi, e);
|
|
2945
2945
|
}
|
|
2946
2946
|
const M = /* @__PURE__ */ p("ZodStringFormat", (e, t) => {
|
|
@@ -3034,7 +3034,7 @@ function P(e, t) {
|
|
|
3034
3034
|
const r = {
|
|
3035
3035
|
type: "object",
|
|
3036
3036
|
shape: e ?? {},
|
|
3037
|
-
...
|
|
3037
|
+
...b(t)
|
|
3038
3038
|
};
|
|
3039
3039
|
return new In(r);
|
|
3040
3040
|
}
|
|
@@ -3043,7 +3043,7 @@ function R(e, t) {
|
|
|
3043
3043
|
type: "object",
|
|
3044
3044
|
shape: e,
|
|
3045
3045
|
catchall: wn(),
|
|
3046
|
-
...
|
|
3046
|
+
...b(t)
|
|
3047
3047
|
});
|
|
3048
3048
|
}
|
|
3049
3049
|
const En = /* @__PURE__ */ p("ZodUnion", (e, t) => {
|
|
@@ -3053,7 +3053,7 @@ function F(e, t) {
|
|
|
3053
3053
|
return new En({
|
|
3054
3054
|
type: "union",
|
|
3055
3055
|
options: e,
|
|
3056
|
-
...
|
|
3056
|
+
...b(t)
|
|
3057
3057
|
});
|
|
3058
3058
|
}
|
|
3059
3059
|
const _u = /* @__PURE__ */ p("ZodDiscriminatedUnion", (e, t) => {
|
|
@@ -3064,7 +3064,7 @@ function yu(e, t, r) {
|
|
|
3064
3064
|
type: "union",
|
|
3065
3065
|
options: t,
|
|
3066
3066
|
discriminator: e,
|
|
3067
|
-
...
|
|
3067
|
+
...b(r)
|
|
3068
3068
|
});
|
|
3069
3069
|
}
|
|
3070
3070
|
const bu = /* @__PURE__ */ p("ZodIntersection", (e, t) => {
|
|
@@ -3085,7 +3085,7 @@ function Se(e, t, r) {
|
|
|
3085
3085
|
type: "record",
|
|
3086
3086
|
keyType: e,
|
|
3087
3087
|
valueType: t,
|
|
3088
|
-
...
|
|
3088
|
+
...b(r)
|
|
3089
3089
|
});
|
|
3090
3090
|
}
|
|
3091
3091
|
const it = /* @__PURE__ */ p("ZodEnum", (e, t) => {
|
|
@@ -3101,7 +3101,7 @@ const it = /* @__PURE__ */ p("ZodEnum", (e, t) => {
|
|
|
3101
3101
|
return new it({
|
|
3102
3102
|
...t,
|
|
3103
3103
|
checks: [],
|
|
3104
|
-
...
|
|
3104
|
+
...b(o),
|
|
3105
3105
|
entries: s
|
|
3106
3106
|
});
|
|
3107
3107
|
}, e.exclude = (n, o) => {
|
|
@@ -3114,7 +3114,7 @@ const it = /* @__PURE__ */ p("ZodEnum", (e, t) => {
|
|
|
3114
3114
|
return new it({
|
|
3115
3115
|
...t,
|
|
3116
3116
|
checks: [],
|
|
3117
|
-
...
|
|
3117
|
+
...b(o),
|
|
3118
3118
|
entries: s
|
|
3119
3119
|
});
|
|
3120
3120
|
};
|
|
@@ -3124,7 +3124,7 @@ function kn(e, t) {
|
|
|
3124
3124
|
return new it({
|
|
3125
3125
|
type: "enum",
|
|
3126
3126
|
entries: r,
|
|
3127
|
-
...
|
|
3127
|
+
...b(t)
|
|
3128
3128
|
});
|
|
3129
3129
|
}
|
|
3130
3130
|
const Eu = /* @__PURE__ */ p("ZodLiteral", (e, t) => {
|
|
@@ -3140,7 +3140,7 @@ function I(e, t) {
|
|
|
3140
3140
|
return new Eu({
|
|
3141
3141
|
type: "literal",
|
|
3142
3142
|
values: Array.isArray(e) ? e : [e],
|
|
3143
|
-
...
|
|
3143
|
+
...b(t)
|
|
3144
3144
|
});
|
|
3145
3145
|
}
|
|
3146
3146
|
const ku = /* @__PURE__ */ p("ZodTransform", (e, t) => {
|
|
@@ -3223,7 +3223,7 @@ function Au(e, t) {
|
|
|
3223
3223
|
return new Sn({
|
|
3224
3224
|
type: "nonoptional",
|
|
3225
3225
|
innerType: e,
|
|
3226
|
-
...
|
|
3226
|
+
...b(t)
|
|
3227
3227
|
});
|
|
3228
3228
|
}
|
|
3229
3229
|
const Ru = /* @__PURE__ */ p("ZodCatch", (e, t) => {
|
|
@@ -3283,7 +3283,7 @@ function Fe(e, t = {}) {
|
|
|
3283
3283
|
check: "custom",
|
|
3284
3284
|
fn: (n) => n instanceof e,
|
|
3285
3285
|
abort: !0,
|
|
3286
|
-
...
|
|
3286
|
+
...b(t)
|
|
3287
3287
|
});
|
|
3288
3288
|
return r._zod.bag.Class = e, r._zod.check = (n) => {
|
|
3289
3289
|
n.value instanceof e || n.issues.push({
|
|
@@ -3448,10 +3448,10 @@ var or;
|
|
|
3448
3448
|
(function(e) {
|
|
3449
3449
|
e.errToObj = (t) => typeof t == "string" ? { message: t } : t || {}, e.toString = (t) => typeof t == "string" ? t : t == null ? void 0 : t.message;
|
|
3450
3450
|
})(or || (or = {}));
|
|
3451
|
-
var
|
|
3451
|
+
var k;
|
|
3452
3452
|
(function(e) {
|
|
3453
3453
|
e.ZodString = "ZodString", e.ZodNumber = "ZodNumber", e.ZodNaN = "ZodNaN", e.ZodBigInt = "ZodBigInt", e.ZodBoolean = "ZodBoolean", e.ZodDate = "ZodDate", e.ZodSymbol = "ZodSymbol", e.ZodUndefined = "ZodUndefined", e.ZodNull = "ZodNull", e.ZodAny = "ZodAny", e.ZodUnknown = "ZodUnknown", e.ZodNever = "ZodNever", e.ZodVoid = "ZodVoid", e.ZodArray = "ZodArray", e.ZodObject = "ZodObject", e.ZodUnion = "ZodUnion", e.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", e.ZodIntersection = "ZodIntersection", e.ZodTuple = "ZodTuple", e.ZodRecord = "ZodRecord", e.ZodMap = "ZodMap", e.ZodSet = "ZodSet", e.ZodFunction = "ZodFunction", e.ZodLazy = "ZodLazy", e.ZodLiteral = "ZodLiteral", e.ZodEnum = "ZodEnum", e.ZodEffects = "ZodEffects", e.ZodNativeEnum = "ZodNativeEnum", e.ZodOptional = "ZodOptional", e.ZodNullable = "ZodNullable", e.ZodDefault = "ZodDefault", e.ZodCatch = "ZodCatch", e.ZodPromise = "ZodPromise", e.ZodBranded = "ZodBranded", e.ZodPipeline = "ZodPipeline", e.ZodReadonly = "ZodReadonly";
|
|
3454
|
-
})(
|
|
3454
|
+
})(k || (k = {}));
|
|
3455
3455
|
class sr extends Error {
|
|
3456
3456
|
constructor(t, r) {
|
|
3457
3457
|
super(t), this.name = "ParseError", this.type = r.type, this.field = r.field, this.value = r.value, this.line = r.line;
|
|
@@ -3466,55 +3466,55 @@ function Fu(e) {
|
|
|
3466
3466
|
);
|
|
3467
3467
|
const { onEvent: t = Ke, onError: r = Ke, onRetry: n = Ke, onComment: o } = e;
|
|
3468
3468
|
let s = "", i = !0, a, c = "", u = "";
|
|
3469
|
-
function l(
|
|
3470
|
-
const
|
|
3471
|
-
for (const f of
|
|
3469
|
+
function l(g) {
|
|
3470
|
+
const v = i ? g.replace(/^\xEF\xBB\xBF/, "") : g, [E, w] = Vu(`${s}${v}`);
|
|
3471
|
+
for (const f of E)
|
|
3472
3472
|
d(f);
|
|
3473
|
-
s =
|
|
3473
|
+
s = w, i = !1;
|
|
3474
3474
|
}
|
|
3475
|
-
function d(
|
|
3476
|
-
if (
|
|
3475
|
+
function d(g) {
|
|
3476
|
+
if (g === "") {
|
|
3477
3477
|
h();
|
|
3478
3478
|
return;
|
|
3479
3479
|
}
|
|
3480
|
-
if (
|
|
3481
|
-
o && o(
|
|
3480
|
+
if (g.startsWith(":")) {
|
|
3481
|
+
o && o(g.slice(g.startsWith(": ") ? 2 : 1));
|
|
3482
3482
|
return;
|
|
3483
3483
|
}
|
|
3484
|
-
const
|
|
3485
|
-
if (
|
|
3486
|
-
const
|
|
3487
|
-
|
|
3484
|
+
const v = g.indexOf(":");
|
|
3485
|
+
if (v !== -1) {
|
|
3486
|
+
const E = g.slice(0, v), w = g[v + 1] === " " ? 2 : 1, f = g.slice(v + w);
|
|
3487
|
+
_(E, f, g);
|
|
3488
3488
|
return;
|
|
3489
3489
|
}
|
|
3490
|
-
|
|
3490
|
+
_(g, "", g);
|
|
3491
3491
|
}
|
|
3492
|
-
function
|
|
3493
|
-
switch (
|
|
3492
|
+
function _(g, v, E) {
|
|
3493
|
+
switch (g) {
|
|
3494
3494
|
case "event":
|
|
3495
|
-
u =
|
|
3495
|
+
u = v;
|
|
3496
3496
|
break;
|
|
3497
3497
|
case "data":
|
|
3498
|
-
c = `${c}${
|
|
3498
|
+
c = `${c}${v}
|
|
3499
3499
|
`;
|
|
3500
3500
|
break;
|
|
3501
3501
|
case "id":
|
|
3502
|
-
a =
|
|
3502
|
+
a = v.includes("\0") ? void 0 : v;
|
|
3503
3503
|
break;
|
|
3504
3504
|
case "retry":
|
|
3505
|
-
/^\d+$/.test(
|
|
3506
|
-
new sr(`Invalid \`retry\` value: "${
|
|
3505
|
+
/^\d+$/.test(v) ? n(parseInt(v, 10)) : r(
|
|
3506
|
+
new sr(`Invalid \`retry\` value: "${v}"`, {
|
|
3507
3507
|
type: "invalid-retry",
|
|
3508
|
-
value:
|
|
3509
|
-
line:
|
|
3508
|
+
value: v,
|
|
3509
|
+
line: E
|
|
3510
3510
|
})
|
|
3511
3511
|
);
|
|
3512
3512
|
break;
|
|
3513
3513
|
default:
|
|
3514
3514
|
r(
|
|
3515
3515
|
new sr(
|
|
3516
|
-
`Unknown field "${
|
|
3517
|
-
{ type: "unknown-field", field:
|
|
3516
|
+
`Unknown field "${g.length > 20 ? `${g.slice(0, 20)}…` : g}"`,
|
|
3517
|
+
{ type: "unknown-field", field: g, value: v, line: E }
|
|
3518
3518
|
)
|
|
3519
3519
|
);
|
|
3520
3520
|
break;
|
|
@@ -3530,10 +3530,10 @@ function Fu(e) {
|
|
|
3530
3530
|
`) ? c.slice(0, -1) : c
|
|
3531
3531
|
}), a = void 0, c = "", u = "";
|
|
3532
3532
|
}
|
|
3533
|
-
function
|
|
3534
|
-
s &&
|
|
3533
|
+
function y(g = {}) {
|
|
3534
|
+
s && g.consume && d(s), i = !0, a = void 0, c = "", u = "", s = "";
|
|
3535
3535
|
}
|
|
3536
|
-
return { feed: l, reset:
|
|
3536
|
+
return { feed: l, reset: y };
|
|
3537
3537
|
}
|
|
3538
3538
|
function Vu(e) {
|
|
3539
3539
|
const t = [];
|
|
@@ -3713,7 +3713,7 @@ function Ku(e, t) {
|
|
|
3713
3713
|
const s = {
|
|
3714
3714
|
type: "array"
|
|
3715
3715
|
};
|
|
3716
|
-
return (r = e.type) != null && r._def && ((o = (n = e.type) == null ? void 0 : n._def) == null ? void 0 : o.typeName) !==
|
|
3716
|
+
return (r = e.type) != null && r._def && ((o = (n = e.type) == null ? void 0 : n._def) == null ? void 0 : o.typeName) !== k.ZodAny && (s.items = T(e.type._def, {
|
|
3717
3717
|
...t,
|
|
3718
3718
|
currentPath: [...t.currentPath, "items"]
|
|
3719
3719
|
})), e.minLength && (s.minItems = e.minLength.value), e.maxLength && (s.maxItems = e.maxLength.value), e.exactLength && (s.minItems = e.exactLength.value, s.maxItems = e.exactLength.value), s;
|
|
@@ -4100,21 +4100,21 @@ function Nn(e, t) {
|
|
|
4100
4100
|
currentPath: [...t.currentPath, "additionalProperties"]
|
|
4101
4101
|
})) != null ? r : t.allowedAdditionalProperties
|
|
4102
4102
|
};
|
|
4103
|
-
if (((n = e.keyType) == null ? void 0 : n._def.typeName) ===
|
|
4103
|
+
if (((n = e.keyType) == null ? void 0 : n._def.typeName) === k.ZodString && ((o = e.keyType._def.checks) != null && o.length)) {
|
|
4104
4104
|
const { type: u, ...l } = Tn(e.keyType._def, t);
|
|
4105
4105
|
return {
|
|
4106
4106
|
...c,
|
|
4107
4107
|
propertyNames: l
|
|
4108
4108
|
};
|
|
4109
4109
|
} else {
|
|
4110
|
-
if (((s = e.keyType) == null ? void 0 : s._def.typeName) ===
|
|
4110
|
+
if (((s = e.keyType) == null ? void 0 : s._def.typeName) === k.ZodEnum)
|
|
4111
4111
|
return {
|
|
4112
4112
|
...c,
|
|
4113
4113
|
propertyNames: {
|
|
4114
4114
|
enum: e.keyType._def.values
|
|
4115
4115
|
}
|
|
4116
4116
|
};
|
|
4117
|
-
if (((i = e.keyType) == null ? void 0 : i._def.typeName) ===
|
|
4117
|
+
if (((i = e.keyType) == null ? void 0 : i._def.typeName) === k.ZodBranded && e.keyType._def.type._def.typeName === k.ZodString && ((a = e.keyType._def.type._def.checks) != null && a.length)) {
|
|
4118
4118
|
const { type: u, ...l } = Zn(
|
|
4119
4119
|
e.keyType._def,
|
|
4120
4120
|
t
|
|
@@ -4403,73 +4403,73 @@ function $c() {
|
|
|
4403
4403
|
}
|
|
4404
4404
|
var Tc = (e, t) => T(e.innerType._def, t), Nc = (e, t, r) => {
|
|
4405
4405
|
switch (t) {
|
|
4406
|
-
case
|
|
4406
|
+
case k.ZodString:
|
|
4407
4407
|
return Tn(e, r);
|
|
4408
|
-
case
|
|
4408
|
+
case k.ZodNumber:
|
|
4409
4409
|
return yc(e);
|
|
4410
|
-
case
|
|
4410
|
+
case k.ZodObject:
|
|
4411
4411
|
return bc(e, r);
|
|
4412
|
-
case
|
|
4412
|
+
case k.ZodBigInt:
|
|
4413
4413
|
return ec(e);
|
|
4414
|
-
case
|
|
4414
|
+
case k.ZodBoolean:
|
|
4415
4415
|
return tc();
|
|
4416
|
-
case
|
|
4416
|
+
case k.ZodDate:
|
|
4417
4417
|
return $n(e, r);
|
|
4418
|
-
case
|
|
4418
|
+
case k.ZodUndefined:
|
|
4419
4419
|
return Zc();
|
|
4420
|
-
case
|
|
4420
|
+
case k.ZodNull:
|
|
4421
4421
|
return mc();
|
|
4422
|
-
case
|
|
4422
|
+
case k.ZodArray:
|
|
4423
4423
|
return Ku(e, r);
|
|
4424
|
-
case
|
|
4425
|
-
case
|
|
4424
|
+
case k.ZodUnion:
|
|
4425
|
+
case k.ZodDiscriminatedUnion:
|
|
4426
4426
|
return gc(e, r);
|
|
4427
|
-
case
|
|
4427
|
+
case k.ZodIntersection:
|
|
4428
4428
|
return uc(e, r);
|
|
4429
|
-
case
|
|
4429
|
+
case k.ZodTuple:
|
|
4430
4430
|
return Oc(e, r);
|
|
4431
|
-
case
|
|
4431
|
+
case k.ZodRecord:
|
|
4432
4432
|
return Nn(e, r);
|
|
4433
|
-
case
|
|
4433
|
+
case k.ZodLiteral:
|
|
4434
4434
|
return cc(e);
|
|
4435
|
-
case
|
|
4435
|
+
case k.ZodEnum:
|
|
4436
4436
|
return ac(e);
|
|
4437
|
-
case
|
|
4437
|
+
case k.ZodNativeEnum:
|
|
4438
4438
|
return fc(e);
|
|
4439
|
-
case
|
|
4439
|
+
case k.ZodNullable:
|
|
4440
4440
|
return _c(e, r);
|
|
4441
|
-
case
|
|
4441
|
+
case k.ZodOptional:
|
|
4442
4442
|
return Ec(e, r);
|
|
4443
|
-
case
|
|
4443
|
+
case k.ZodMap:
|
|
4444
4444
|
return pc(e, r);
|
|
4445
|
-
case
|
|
4445
|
+
case k.ZodSet:
|
|
4446
4446
|
return Sc(e, r);
|
|
4447
|
-
case
|
|
4447
|
+
case k.ZodLazy:
|
|
4448
4448
|
return () => e.getter()._def;
|
|
4449
|
-
case
|
|
4449
|
+
case k.ZodPromise:
|
|
4450
4450
|
return zc(e, r);
|
|
4451
|
-
case
|
|
4452
|
-
case
|
|
4451
|
+
case k.ZodNaN:
|
|
4452
|
+
case k.ZodNever:
|
|
4453
4453
|
return hc();
|
|
4454
|
-
case
|
|
4454
|
+
case k.ZodEffects:
|
|
4455
4455
|
return sc(e, r);
|
|
4456
|
-
case
|
|
4456
|
+
case k.ZodAny:
|
|
4457
4457
|
return Y();
|
|
4458
|
-
case
|
|
4458
|
+
case k.ZodUnknown:
|
|
4459
4459
|
return $c();
|
|
4460
|
-
case
|
|
4460
|
+
case k.ZodDefault:
|
|
4461
4461
|
return oc(e, r);
|
|
4462
|
-
case
|
|
4462
|
+
case k.ZodBranded:
|
|
4463
4463
|
return Zn(e, r);
|
|
4464
|
-
case
|
|
4464
|
+
case k.ZodReadonly:
|
|
4465
4465
|
return Tc(e, r);
|
|
4466
|
-
case
|
|
4466
|
+
case k.ZodCatch:
|
|
4467
4467
|
return rc(e, r);
|
|
4468
|
-
case
|
|
4468
|
+
case k.ZodPipeline:
|
|
4469
4469
|
return kc(e, r);
|
|
4470
|
-
case
|
|
4471
|
-
case
|
|
4472
|
-
case
|
|
4470
|
+
case k.ZodFunction:
|
|
4471
|
+
case k.ZodVoid:
|
|
4472
|
+
case k.ZodSymbol:
|
|
4473
4473
|
return;
|
|
4474
4474
|
default:
|
|
4475
4475
|
return /* @__PURE__ */ ((n) => {
|
|
@@ -4546,17 +4546,17 @@ var Ac = (e, t) => {
|
|
|
4546
4546
|
const n = xc(t);
|
|
4547
4547
|
let o = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce(
|
|
4548
4548
|
(u, [l, d]) => {
|
|
4549
|
-
var
|
|
4549
|
+
var _;
|
|
4550
4550
|
return {
|
|
4551
4551
|
...u,
|
|
4552
|
-
[l]: (
|
|
4552
|
+
[l]: (_ = T(
|
|
4553
4553
|
d._def,
|
|
4554
4554
|
{
|
|
4555
4555
|
...n,
|
|
4556
4556
|
currentPath: [...n.basePath, n.definitionPath, l]
|
|
4557
4557
|
},
|
|
4558
4558
|
!0
|
|
4559
|
-
)) != null ?
|
|
4559
|
+
)) != null ? _ : Y()
|
|
4560
4560
|
};
|
|
4561
4561
|
},
|
|
4562
4562
|
{}
|
|
@@ -4766,7 +4766,7 @@ var jn = "AI_UIMessageStreamError", Cn = `vercel.ai.error.${jn}`, Yc = Symbol.fo
|
|
|
4766
4766
|
};
|
|
4767
4767
|
Mn = Yc;
|
|
4768
4768
|
var pr = "6.0.42", Dn = F([
|
|
4769
|
-
|
|
4769
|
+
m(),
|
|
4770
4770
|
Fe(Uint8Array),
|
|
4771
4771
|
Fe(ArrayBuffer),
|
|
4772
4772
|
On(
|
|
@@ -4780,38 +4780,38 @@ var pr = "6.0.42", Dn = F([
|
|
|
4780
4780
|
]), $e = Uu(
|
|
4781
4781
|
() => F([
|
|
4782
4782
|
hu(),
|
|
4783
|
-
|
|
4783
|
+
m(),
|
|
4784
4784
|
lu(),
|
|
4785
4785
|
J(),
|
|
4786
|
-
Se(
|
|
4786
|
+
Se(m(), $e.optional()),
|
|
4787
4787
|
be($e)
|
|
4788
4788
|
])
|
|
4789
4789
|
), S = Se(
|
|
4790
|
-
|
|
4791
|
-
Se(
|
|
4790
|
+
m(),
|
|
4791
|
+
Se(m(), $e.optional())
|
|
4792
4792
|
), Un = P({
|
|
4793
4793
|
type: I("text"),
|
|
4794
|
-
text:
|
|
4794
|
+
text: m(),
|
|
4795
4795
|
providerOptions: S.optional()
|
|
4796
4796
|
}), qc = P({
|
|
4797
4797
|
type: I("image"),
|
|
4798
4798
|
image: F([Dn, Fe(URL)]),
|
|
4799
|
-
mediaType:
|
|
4799
|
+
mediaType: m().optional(),
|
|
4800
4800
|
providerOptions: S.optional()
|
|
4801
4801
|
}), Ln = P({
|
|
4802
4802
|
type: I("file"),
|
|
4803
4803
|
data: F([Dn, Fe(URL)]),
|
|
4804
|
-
filename:
|
|
4805
|
-
mediaType:
|
|
4804
|
+
filename: m().optional(),
|
|
4805
|
+
mediaType: m(),
|
|
4806
4806
|
providerOptions: S.optional()
|
|
4807
4807
|
}), Gc = P({
|
|
4808
4808
|
type: I("reasoning"),
|
|
4809
|
-
text:
|
|
4809
|
+
text: m(),
|
|
4810
4810
|
providerOptions: S.optional()
|
|
4811
4811
|
}), Hc = P({
|
|
4812
4812
|
type: I("tool-call"),
|
|
4813
|
-
toolCallId:
|
|
4814
|
-
toolName:
|
|
4813
|
+
toolCallId: m(),
|
|
4814
|
+
toolName: m(),
|
|
4815
4815
|
input: Q(),
|
|
4816
4816
|
providerOptions: S.optional(),
|
|
4817
4817
|
providerExecuted: J().optional()
|
|
@@ -4820,7 +4820,7 @@ var pr = "6.0.42", Dn = F([
|
|
|
4820
4820
|
[
|
|
4821
4821
|
P({
|
|
4822
4822
|
type: I("text"),
|
|
4823
|
-
value:
|
|
4823
|
+
value: m(),
|
|
4824
4824
|
providerOptions: S.optional()
|
|
4825
4825
|
}),
|
|
4826
4826
|
P({
|
|
@@ -4830,12 +4830,12 @@ var pr = "6.0.42", Dn = F([
|
|
|
4830
4830
|
}),
|
|
4831
4831
|
P({
|
|
4832
4832
|
type: I("execution-denied"),
|
|
4833
|
-
reason:
|
|
4833
|
+
reason: m().optional(),
|
|
4834
4834
|
providerOptions: S.optional()
|
|
4835
4835
|
}),
|
|
4836
4836
|
P({
|
|
4837
4837
|
type: I("error-text"),
|
|
4838
|
-
value:
|
|
4838
|
+
value: m(),
|
|
4839
4839
|
providerOptions: S.optional()
|
|
4840
4840
|
}),
|
|
4841
4841
|
P({
|
|
@@ -4849,45 +4849,45 @@ var pr = "6.0.42", Dn = F([
|
|
|
4849
4849
|
F([
|
|
4850
4850
|
P({
|
|
4851
4851
|
type: I("text"),
|
|
4852
|
-
text:
|
|
4852
|
+
text: m(),
|
|
4853
4853
|
providerOptions: S.optional()
|
|
4854
4854
|
}),
|
|
4855
4855
|
P({
|
|
4856
4856
|
type: I("media"),
|
|
4857
|
-
data:
|
|
4858
|
-
mediaType:
|
|
4857
|
+
data: m(),
|
|
4858
|
+
mediaType: m()
|
|
4859
4859
|
}),
|
|
4860
4860
|
P({
|
|
4861
4861
|
type: I("file-data"),
|
|
4862
|
-
data:
|
|
4863
|
-
mediaType:
|
|
4864
|
-
filename:
|
|
4862
|
+
data: m(),
|
|
4863
|
+
mediaType: m(),
|
|
4864
|
+
filename: m().optional(),
|
|
4865
4865
|
providerOptions: S.optional()
|
|
4866
4866
|
}),
|
|
4867
4867
|
P({
|
|
4868
4868
|
type: I("file-url"),
|
|
4869
|
-
url:
|
|
4869
|
+
url: m(),
|
|
4870
4870
|
providerOptions: S.optional()
|
|
4871
4871
|
}),
|
|
4872
4872
|
P({
|
|
4873
4873
|
type: I("file-id"),
|
|
4874
|
-
fileId: F([
|
|
4874
|
+
fileId: F([m(), Se(m(), m())]),
|
|
4875
4875
|
providerOptions: S.optional()
|
|
4876
4876
|
}),
|
|
4877
4877
|
P({
|
|
4878
4878
|
type: I("image-data"),
|
|
4879
|
-
data:
|
|
4880
|
-
mediaType:
|
|
4879
|
+
data: m(),
|
|
4880
|
+
mediaType: m(),
|
|
4881
4881
|
providerOptions: S.optional()
|
|
4882
4882
|
}),
|
|
4883
4883
|
P({
|
|
4884
4884
|
type: I("image-url"),
|
|
4885
|
-
url:
|
|
4885
|
+
url: m(),
|
|
4886
4886
|
providerOptions: S.optional()
|
|
4887
4887
|
}),
|
|
4888
4888
|
P({
|
|
4889
4889
|
type: I("image-file-id"),
|
|
4890
|
-
fileId: F([
|
|
4890
|
+
fileId: F([m(), Se(m(), m())]),
|
|
4891
4891
|
providerOptions: S.optional()
|
|
4892
4892
|
}),
|
|
4893
4893
|
P({
|
|
@@ -4900,36 +4900,36 @@ var pr = "6.0.42", Dn = F([
|
|
|
4900
4900
|
]
|
|
4901
4901
|
), Jn = P({
|
|
4902
4902
|
type: I("tool-result"),
|
|
4903
|
-
toolCallId:
|
|
4904
|
-
toolName:
|
|
4903
|
+
toolCallId: m(),
|
|
4904
|
+
toolName: m(),
|
|
4905
4905
|
output: Xc,
|
|
4906
4906
|
providerOptions: S.optional()
|
|
4907
4907
|
}), Qc = P({
|
|
4908
4908
|
type: I("tool-approval-request"),
|
|
4909
|
-
approvalId:
|
|
4910
|
-
toolCallId:
|
|
4909
|
+
approvalId: m(),
|
|
4910
|
+
toolCallId: m()
|
|
4911
4911
|
}), Kc = P({
|
|
4912
4912
|
type: I("tool-approval-response"),
|
|
4913
|
-
approvalId:
|
|
4913
|
+
approvalId: m(),
|
|
4914
4914
|
approved: J(),
|
|
4915
|
-
reason:
|
|
4915
|
+
reason: m().optional()
|
|
4916
4916
|
}), el = P(
|
|
4917
4917
|
{
|
|
4918
4918
|
role: I("system"),
|
|
4919
|
-
content:
|
|
4919
|
+
content: m(),
|
|
4920
4920
|
providerOptions: S.optional()
|
|
4921
4921
|
}
|
|
4922
4922
|
), tl = P({
|
|
4923
4923
|
role: I("user"),
|
|
4924
4924
|
content: F([
|
|
4925
|
-
|
|
4925
|
+
m(),
|
|
4926
4926
|
be(F([Un, qc, Ln]))
|
|
4927
4927
|
]),
|
|
4928
4928
|
providerOptions: S.optional()
|
|
4929
4929
|
}), rl = P({
|
|
4930
4930
|
role: I("assistant"),
|
|
4931
4931
|
content: F([
|
|
4932
|
-
|
|
4932
|
+
m(),
|
|
4933
4933
|
be(
|
|
4934
4934
|
F([
|
|
4935
4935
|
Un,
|
|
@@ -5534,67 +5534,67 @@ var dl = Cc(
|
|
|
5534
5534
|
F([
|
|
5535
5535
|
R({
|
|
5536
5536
|
type: I("text-start"),
|
|
5537
|
-
id:
|
|
5537
|
+
id: m(),
|
|
5538
5538
|
providerMetadata: S.optional()
|
|
5539
5539
|
}),
|
|
5540
5540
|
R({
|
|
5541
5541
|
type: I("text-delta"),
|
|
5542
|
-
id:
|
|
5543
|
-
delta:
|
|
5542
|
+
id: m(),
|
|
5543
|
+
delta: m(),
|
|
5544
5544
|
providerMetadata: S.optional()
|
|
5545
5545
|
}),
|
|
5546
5546
|
R({
|
|
5547
5547
|
type: I("text-end"),
|
|
5548
|
-
id:
|
|
5548
|
+
id: m(),
|
|
5549
5549
|
providerMetadata: S.optional()
|
|
5550
5550
|
}),
|
|
5551
5551
|
R({
|
|
5552
5552
|
type: I("error"),
|
|
5553
|
-
errorText:
|
|
5553
|
+
errorText: m()
|
|
5554
5554
|
}),
|
|
5555
5555
|
R({
|
|
5556
5556
|
type: I("tool-input-start"),
|
|
5557
|
-
toolCallId:
|
|
5558
|
-
toolName:
|
|
5557
|
+
toolCallId: m(),
|
|
5558
|
+
toolName: m(),
|
|
5559
5559
|
providerExecuted: J().optional(),
|
|
5560
5560
|
providerMetadata: S.optional(),
|
|
5561
5561
|
dynamic: J().optional(),
|
|
5562
|
-
title:
|
|
5562
|
+
title: m().optional()
|
|
5563
5563
|
}),
|
|
5564
5564
|
R({
|
|
5565
5565
|
type: I("tool-input-delta"),
|
|
5566
|
-
toolCallId:
|
|
5567
|
-
inputTextDelta:
|
|
5566
|
+
toolCallId: m(),
|
|
5567
|
+
inputTextDelta: m()
|
|
5568
5568
|
}),
|
|
5569
5569
|
R({
|
|
5570
5570
|
type: I("tool-input-available"),
|
|
5571
|
-
toolCallId:
|
|
5572
|
-
toolName:
|
|
5571
|
+
toolCallId: m(),
|
|
5572
|
+
toolName: m(),
|
|
5573
5573
|
input: Q(),
|
|
5574
5574
|
providerExecuted: J().optional(),
|
|
5575
5575
|
providerMetadata: S.optional(),
|
|
5576
5576
|
dynamic: J().optional(),
|
|
5577
|
-
title:
|
|
5577
|
+
title: m().optional()
|
|
5578
5578
|
}),
|
|
5579
5579
|
R({
|
|
5580
5580
|
type: I("tool-input-error"),
|
|
5581
|
-
toolCallId:
|
|
5582
|
-
toolName:
|
|
5581
|
+
toolCallId: m(),
|
|
5582
|
+
toolName: m(),
|
|
5583
5583
|
input: Q(),
|
|
5584
5584
|
providerExecuted: J().optional(),
|
|
5585
5585
|
providerMetadata: S.optional(),
|
|
5586
5586
|
dynamic: J().optional(),
|
|
5587
|
-
errorText:
|
|
5588
|
-
title:
|
|
5587
|
+
errorText: m(),
|
|
5588
|
+
title: m().optional()
|
|
5589
5589
|
}),
|
|
5590
5590
|
R({
|
|
5591
5591
|
type: I("tool-approval-request"),
|
|
5592
|
-
approvalId:
|
|
5593
|
-
toolCallId:
|
|
5592
|
+
approvalId: m(),
|
|
5593
|
+
toolCallId: m()
|
|
5594
5594
|
}),
|
|
5595
5595
|
R({
|
|
5596
5596
|
type: I("tool-output-available"),
|
|
5597
|
-
toolCallId:
|
|
5597
|
+
toolCallId: m(),
|
|
5598
5598
|
output: Q(),
|
|
5599
5599
|
providerExecuted: J().optional(),
|
|
5600
5600
|
dynamic: J().optional(),
|
|
@@ -5602,50 +5602,50 @@ var dl = Cc(
|
|
|
5602
5602
|
}),
|
|
5603
5603
|
R({
|
|
5604
5604
|
type: I("tool-output-error"),
|
|
5605
|
-
toolCallId:
|
|
5606
|
-
errorText:
|
|
5605
|
+
toolCallId: m(),
|
|
5606
|
+
errorText: m(),
|
|
5607
5607
|
providerExecuted: J().optional(),
|
|
5608
5608
|
dynamic: J().optional()
|
|
5609
5609
|
}),
|
|
5610
5610
|
R({
|
|
5611
5611
|
type: I("tool-output-denied"),
|
|
5612
|
-
toolCallId:
|
|
5612
|
+
toolCallId: m()
|
|
5613
5613
|
}),
|
|
5614
5614
|
R({
|
|
5615
5615
|
type: I("reasoning-start"),
|
|
5616
|
-
id:
|
|
5616
|
+
id: m(),
|
|
5617
5617
|
providerMetadata: S.optional()
|
|
5618
5618
|
}),
|
|
5619
5619
|
R({
|
|
5620
5620
|
type: I("reasoning-delta"),
|
|
5621
|
-
id:
|
|
5622
|
-
delta:
|
|
5621
|
+
id: m(),
|
|
5622
|
+
delta: m(),
|
|
5623
5623
|
providerMetadata: S.optional()
|
|
5624
5624
|
}),
|
|
5625
5625
|
R({
|
|
5626
5626
|
type: I("reasoning-end"),
|
|
5627
|
-
id:
|
|
5627
|
+
id: m(),
|
|
5628
5628
|
providerMetadata: S.optional()
|
|
5629
5629
|
}),
|
|
5630
5630
|
R({
|
|
5631
5631
|
type: I("source-url"),
|
|
5632
|
-
sourceId:
|
|
5633
|
-
url:
|
|
5634
|
-
title:
|
|
5632
|
+
sourceId: m(),
|
|
5633
|
+
url: m(),
|
|
5634
|
+
title: m().optional(),
|
|
5635
5635
|
providerMetadata: S.optional()
|
|
5636
5636
|
}),
|
|
5637
5637
|
R({
|
|
5638
5638
|
type: I("source-document"),
|
|
5639
|
-
sourceId:
|
|
5640
|
-
mediaType:
|
|
5641
|
-
title:
|
|
5642
|
-
filename:
|
|
5639
|
+
sourceId: m(),
|
|
5640
|
+
mediaType: m(),
|
|
5641
|
+
title: m(),
|
|
5642
|
+
filename: m().optional(),
|
|
5643
5643
|
providerMetadata: S.optional()
|
|
5644
5644
|
}),
|
|
5645
5645
|
R({
|
|
5646
5646
|
type: I("file"),
|
|
5647
|
-
url:
|
|
5648
|
-
mediaType:
|
|
5647
|
+
url: m(),
|
|
5648
|
+
mediaType: m(),
|
|
5649
5649
|
providerMetadata: S.optional()
|
|
5650
5650
|
}),
|
|
5651
5651
|
R({
|
|
@@ -5653,7 +5653,7 @@ var dl = Cc(
|
|
|
5653
5653
|
(e) => typeof e == "string" && e.startsWith("data-"),
|
|
5654
5654
|
{ message: 'Type must start with "data-"' }
|
|
5655
5655
|
),
|
|
5656
|
-
id:
|
|
5656
|
+
id: m().optional(),
|
|
5657
5657
|
data: Q(),
|
|
5658
5658
|
transient: J().optional()
|
|
5659
5659
|
}),
|
|
@@ -5665,7 +5665,7 @@ var dl = Cc(
|
|
|
5665
5665
|
}),
|
|
5666
5666
|
R({
|
|
5667
5667
|
type: I("start"),
|
|
5668
|
-
messageId:
|
|
5668
|
+
messageId: m().optional(),
|
|
5669
5669
|
messageMetadata: Q().optional()
|
|
5670
5670
|
}),
|
|
5671
5671
|
R({
|
|
@@ -5682,7 +5682,7 @@ var dl = Cc(
|
|
|
5682
5682
|
}),
|
|
5683
5683
|
R({
|
|
5684
5684
|
type: I("abort"),
|
|
5685
|
-
reason:
|
|
5685
|
+
reason: m().optional()
|
|
5686
5686
|
}),
|
|
5687
5687
|
R({
|
|
5688
5688
|
type: I("message-metadata"),
|
|
@@ -5735,8 +5735,8 @@ function ml({
|
|
|
5735
5735
|
new TransformStream({
|
|
5736
5736
|
async transform(a, c) {
|
|
5737
5737
|
await n(async ({ state: u, write: l }) => {
|
|
5738
|
-
var d,
|
|
5739
|
-
function
|
|
5738
|
+
var d, _, h, y;
|
|
5739
|
+
function g(f) {
|
|
5740
5740
|
const Z = u.message.parts.filter(dt).find(
|
|
5741
5741
|
(z) => z.toolCallId === f
|
|
5742
5742
|
);
|
|
@@ -5748,7 +5748,7 @@ function ml({
|
|
|
5748
5748
|
});
|
|
5749
5749
|
return Z;
|
|
5750
5750
|
}
|
|
5751
|
-
function
|
|
5751
|
+
function v(f) {
|
|
5752
5752
|
var $;
|
|
5753
5753
|
const Z = u.message.parts.find(
|
|
5754
5754
|
(V) => lt(V) && V.toolCallId === f.toolCallId
|
|
@@ -5767,7 +5767,7 @@ function ml({
|
|
|
5767
5767
|
...z.providerMetadata != null ? { callProviderMetadata: z.providerMetadata } : {}
|
|
5768
5768
|
});
|
|
5769
5769
|
}
|
|
5770
|
-
function
|
|
5770
|
+
function E(f) {
|
|
5771
5771
|
var $, Z;
|
|
5772
5772
|
const z = u.message.parts.find(
|
|
5773
5773
|
(It) => It.type === "dynamic-tool" && It.toolCallId === f.toolCallId
|
|
@@ -5786,7 +5786,7 @@ function ml({
|
|
|
5786
5786
|
...N.providerMetadata != null ? { callProviderMetadata: N.providerMetadata } : {}
|
|
5787
5787
|
});
|
|
5788
5788
|
}
|
|
5789
|
-
async function
|
|
5789
|
+
async function w(f) {
|
|
5790
5790
|
if (f != null) {
|
|
5791
5791
|
const $ = u.message.metadata != null ? Fn(u.message.metadata, f) : f;
|
|
5792
5792
|
t != null && await dr({
|
|
@@ -5825,7 +5825,7 @@ function ml({
|
|
|
5825
5825
|
chunkId: a.id,
|
|
5826
5826
|
message: `Received text-end for missing text part with ID "${a.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`
|
|
5827
5827
|
});
|
|
5828
|
-
f.state = "done", f.providerMetadata = (
|
|
5828
|
+
f.state = "done", f.providerMetadata = (_ = a.providerMetadata) != null ? _ : f.providerMetadata, delete u.activeTextParts[a.id], l();
|
|
5829
5829
|
break;
|
|
5830
5830
|
}
|
|
5831
5831
|
case "reasoning-start": {
|
|
@@ -5857,7 +5857,7 @@ function ml({
|
|
|
5857
5857
|
chunkId: a.id,
|
|
5858
5858
|
message: `Received reasoning-end for missing reasoning part with ID "${a.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`
|
|
5859
5859
|
});
|
|
5860
|
-
f.providerMetadata = (
|
|
5860
|
+
f.providerMetadata = (y = a.providerMetadata) != null ? y : f.providerMetadata, f.state = "done", delete u.activeReasoningParts[a.id], l();
|
|
5861
5861
|
break;
|
|
5862
5862
|
}
|
|
5863
5863
|
case "file": {
|
|
@@ -5897,7 +5897,7 @@ function ml({
|
|
|
5897
5897
|
index: f.length,
|
|
5898
5898
|
dynamic: a.dynamic,
|
|
5899
5899
|
title: a.title
|
|
5900
|
-
}, a.dynamic ?
|
|
5900
|
+
}, a.dynamic ? E({
|
|
5901
5901
|
toolCallId: a.toolCallId,
|
|
5902
5902
|
toolName: a.toolName,
|
|
5903
5903
|
state: "input-streaming",
|
|
@@ -5905,7 +5905,7 @@ function ml({
|
|
|
5905
5905
|
providerExecuted: a.providerExecuted,
|
|
5906
5906
|
title: a.title,
|
|
5907
5907
|
providerMetadata: a.providerMetadata
|
|
5908
|
-
}) :
|
|
5908
|
+
}) : v({
|
|
5909
5909
|
toolCallId: a.toolCallId,
|
|
5910
5910
|
toolName: a.toolName,
|
|
5911
5911
|
state: "input-streaming",
|
|
@@ -5928,13 +5928,13 @@ function ml({
|
|
|
5928
5928
|
const { value: $ } = await Ne(
|
|
5929
5929
|
f.text
|
|
5930
5930
|
);
|
|
5931
|
-
f.dynamic ?
|
|
5931
|
+
f.dynamic ? E({
|
|
5932
5932
|
toolCallId: a.toolCallId,
|
|
5933
5933
|
toolName: f.toolName,
|
|
5934
5934
|
state: "input-streaming",
|
|
5935
5935
|
input: $,
|
|
5936
5936
|
title: f.title
|
|
5937
|
-
}) :
|
|
5937
|
+
}) : v({
|
|
5938
5938
|
toolCallId: a.toolCallId,
|
|
5939
5939
|
toolName: f.toolName,
|
|
5940
5940
|
state: "input-streaming",
|
|
@@ -5944,7 +5944,7 @@ function ml({
|
|
|
5944
5944
|
break;
|
|
5945
5945
|
}
|
|
5946
5946
|
case "tool-input-available": {
|
|
5947
|
-
a.dynamic ?
|
|
5947
|
+
a.dynamic ? E({
|
|
5948
5948
|
toolCallId: a.toolCallId,
|
|
5949
5949
|
toolName: a.toolName,
|
|
5950
5950
|
state: "input-available",
|
|
@@ -5952,7 +5952,7 @@ function ml({
|
|
|
5952
5952
|
providerExecuted: a.providerExecuted,
|
|
5953
5953
|
providerMetadata: a.providerMetadata,
|
|
5954
5954
|
title: a.title
|
|
5955
|
-
}) :
|
|
5955
|
+
}) : v({
|
|
5956
5956
|
toolCallId: a.toolCallId,
|
|
5957
5957
|
toolName: a.toolName,
|
|
5958
5958
|
state: "input-available",
|
|
@@ -5966,7 +5966,7 @@ function ml({
|
|
|
5966
5966
|
break;
|
|
5967
5967
|
}
|
|
5968
5968
|
case "tool-input-error": {
|
|
5969
|
-
a.dynamic ?
|
|
5969
|
+
a.dynamic ? E({
|
|
5970
5970
|
toolCallId: a.toolCallId,
|
|
5971
5971
|
toolName: a.toolName,
|
|
5972
5972
|
state: "output-error",
|
|
@@ -5974,7 +5974,7 @@ function ml({
|
|
|
5974
5974
|
errorText: a.errorText,
|
|
5975
5975
|
providerExecuted: a.providerExecuted,
|
|
5976
5976
|
providerMetadata: a.providerMetadata
|
|
5977
|
-
}) :
|
|
5977
|
+
}) : v({
|
|
5978
5978
|
toolCallId: a.toolCallId,
|
|
5979
5979
|
toolName: a.toolName,
|
|
5980
5980
|
state: "output-error",
|
|
@@ -5987,18 +5987,18 @@ function ml({
|
|
|
5987
5987
|
break;
|
|
5988
5988
|
}
|
|
5989
5989
|
case "tool-approval-request": {
|
|
5990
|
-
const f =
|
|
5990
|
+
const f = g(a.toolCallId);
|
|
5991
5991
|
f.state = "approval-requested", f.approval = { id: a.approvalId }, l();
|
|
5992
5992
|
break;
|
|
5993
5993
|
}
|
|
5994
5994
|
case "tool-output-denied": {
|
|
5995
|
-
const f =
|
|
5995
|
+
const f = g(a.toolCallId);
|
|
5996
5996
|
f.state = "output-denied", l();
|
|
5997
5997
|
break;
|
|
5998
5998
|
}
|
|
5999
5999
|
case "tool-output-available": {
|
|
6000
|
-
const f =
|
|
6001
|
-
f.type === "dynamic-tool" ?
|
|
6000
|
+
const f = g(a.toolCallId);
|
|
6001
|
+
f.type === "dynamic-tool" ? E({
|
|
6002
6002
|
toolCallId: a.toolCallId,
|
|
6003
6003
|
toolName: f.toolName,
|
|
6004
6004
|
state: "output-available",
|
|
@@ -6007,7 +6007,7 @@ function ml({
|
|
|
6007
6007
|
preliminary: a.preliminary,
|
|
6008
6008
|
providerExecuted: a.providerExecuted,
|
|
6009
6009
|
title: f.title
|
|
6010
|
-
}) :
|
|
6010
|
+
}) : v({
|
|
6011
6011
|
toolCallId: a.toolCallId,
|
|
6012
6012
|
toolName: fr(f),
|
|
6013
6013
|
state: "output-available",
|
|
@@ -6020,8 +6020,8 @@ function ml({
|
|
|
6020
6020
|
break;
|
|
6021
6021
|
}
|
|
6022
6022
|
case "tool-output-error": {
|
|
6023
|
-
const f =
|
|
6024
|
-
f.type === "dynamic-tool" ?
|
|
6023
|
+
const f = g(a.toolCallId);
|
|
6024
|
+
f.type === "dynamic-tool" ? E({
|
|
6025
6025
|
toolCallId: a.toolCallId,
|
|
6026
6026
|
toolName: f.toolName,
|
|
6027
6027
|
state: "output-error",
|
|
@@ -6029,7 +6029,7 @@ function ml({
|
|
|
6029
6029
|
errorText: a.errorText,
|
|
6030
6030
|
providerExecuted: a.providerExecuted,
|
|
6031
6031
|
title: f.title
|
|
6032
|
-
}) :
|
|
6032
|
+
}) : v({
|
|
6033
6033
|
toolCallId: a.toolCallId,
|
|
6034
6034
|
toolName: fr(f),
|
|
6035
6035
|
state: "output-error",
|
|
@@ -6050,15 +6050,15 @@ function ml({
|
|
|
6050
6050
|
break;
|
|
6051
6051
|
}
|
|
6052
6052
|
case "start": {
|
|
6053
|
-
a.messageId != null && (u.message.id = a.messageId), await
|
|
6053
|
+
a.messageId != null && (u.message.id = a.messageId), await w(a.messageMetadata), (a.messageId != null || a.messageMetadata != null) && l();
|
|
6054
6054
|
break;
|
|
6055
6055
|
}
|
|
6056
6056
|
case "finish": {
|
|
6057
|
-
a.finishReason != null && (u.finishReason = a.finishReason), await
|
|
6057
|
+
a.finishReason != null && (u.finishReason = a.finishReason), await w(a.messageMetadata), a.messageMetadata != null && l();
|
|
6058
6058
|
break;
|
|
6059
6059
|
}
|
|
6060
6060
|
case "message-metadata": {
|
|
6061
|
-
await
|
|
6061
|
+
await w(a.messageMetadata), a.messageMetadata != null && l();
|
|
6062
6062
|
break;
|
|
6063
6063
|
}
|
|
6064
6064
|
case "error": {
|
|
@@ -6187,14 +6187,14 @@ var yl = class {
|
|
|
6187
6187
|
requestMetadata: t.metadata,
|
|
6188
6188
|
trigger: t.trigger,
|
|
6189
6189
|
messageId: t.messageId
|
|
6190
|
-
})),
|
|
6190
|
+
})), _ = (n = d == null ? void 0 : d.api) != null ? n : this.api, h = (d == null ? void 0 : d.headers) !== void 0 ? ie(d.headers) : l, y = (d == null ? void 0 : d.body) !== void 0 ? d.body : {
|
|
6191
6191
|
...a,
|
|
6192
6192
|
...t.body,
|
|
6193
6193
|
id: t.chatId,
|
|
6194
6194
|
messages: t.messages,
|
|
6195
6195
|
trigger: t.trigger,
|
|
6196
6196
|
messageId: t.messageId
|
|
6197
|
-
},
|
|
6197
|
+
}, g = (o = d == null ? void 0 : d.credentials) != null ? o : u, E = await ((s = this.fetch) != null ? s : globalThis.fetch)(_, {
|
|
6198
6198
|
method: "POST",
|
|
6199
6199
|
headers: ir(
|
|
6200
6200
|
{
|
|
@@ -6204,17 +6204,17 @@ var yl = class {
|
|
|
6204
6204
|
`ai-sdk/${pr}`,
|
|
6205
6205
|
ar()
|
|
6206
6206
|
),
|
|
6207
|
-
body: JSON.stringify(
|
|
6208
|
-
credentials:
|
|
6207
|
+
body: JSON.stringify(y),
|
|
6208
|
+
credentials: g,
|
|
6209
6209
|
signal: e
|
|
6210
6210
|
});
|
|
6211
|
-
if (!
|
|
6211
|
+
if (!E.ok)
|
|
6212
6212
|
throw new Error(
|
|
6213
|
-
(i = await
|
|
6213
|
+
(i = await E.text()) != null ? i : "Failed to fetch the chat response."
|
|
6214
6214
|
);
|
|
6215
|
-
if (!
|
|
6215
|
+
if (!E.body)
|
|
6216
6216
|
throw new Error("The response body is empty.");
|
|
6217
|
-
return this.processResponseStream(
|
|
6217
|
+
return this.processResponseStream(E.body);
|
|
6218
6218
|
}
|
|
6219
6219
|
async reconnectToStream(e) {
|
|
6220
6220
|
var t, r, n, o, s;
|
|
@@ -6228,24 +6228,24 @@ var yl = class {
|
|
|
6228
6228
|
headers: u,
|
|
6229
6229
|
credentials: c,
|
|
6230
6230
|
requestMetadata: e.metadata
|
|
6231
|
-
})), d = (r = l == null ? void 0 : l.api) != null ? r : `${this.api}/${e.chatId}/stream`,
|
|
6231
|
+
})), d = (r = l == null ? void 0 : l.api) != null ? r : `${this.api}/${e.chatId}/stream`, _ = (l == null ? void 0 : l.headers) !== void 0 ? ie(l.headers) : u, h = (n = l == null ? void 0 : l.credentials) != null ? n : c, g = await ((o = this.fetch) != null ? o : globalThis.fetch)(d, {
|
|
6232
6232
|
method: "GET",
|
|
6233
6233
|
headers: ir(
|
|
6234
|
-
|
|
6234
|
+
_,
|
|
6235
6235
|
`ai-sdk/${pr}`,
|
|
6236
6236
|
ar()
|
|
6237
6237
|
),
|
|
6238
6238
|
credentials: h
|
|
6239
6239
|
});
|
|
6240
|
-
if (
|
|
6240
|
+
if (g.status === 204)
|
|
6241
6241
|
return null;
|
|
6242
|
-
if (!
|
|
6242
|
+
if (!g.ok)
|
|
6243
6243
|
throw new Error(
|
|
6244
|
-
(s = await
|
|
6244
|
+
(s = await g.text()) != null ? s : "Failed to fetch the chat response."
|
|
6245
6245
|
);
|
|
6246
|
-
if (!
|
|
6246
|
+
if (!g.body)
|
|
6247
6247
|
throw new Error("The response body is empty.");
|
|
6248
|
-
return this.processResponseStream(
|
|
6248
|
+
return this.processResponseStream(g.body);
|
|
6249
6249
|
}
|
|
6250
6250
|
}, Vn = class extends yl {
|
|
6251
6251
|
constructor(e = {}) {
|
|
@@ -6279,55 +6279,55 @@ var yl = class {
|
|
|
6279
6279
|
onData: u,
|
|
6280
6280
|
sendAutomaticallyWhen: l
|
|
6281
6281
|
}) {
|
|
6282
|
-
this.activeResponse = void 0, this.jobExecutor = new vl(), this.sendMessage = async (d,
|
|
6283
|
-
var h,
|
|
6282
|
+
this.activeResponse = void 0, this.jobExecutor = new vl(), this.sendMessage = async (d, _) => {
|
|
6283
|
+
var h, y, g, v;
|
|
6284
6284
|
if (d == null) {
|
|
6285
6285
|
await this.makeRequest({
|
|
6286
6286
|
trigger: "submit-message",
|
|
6287
6287
|
messageId: (h = this.lastMessage) == null ? void 0 : h.id,
|
|
6288
|
-
...
|
|
6288
|
+
..._
|
|
6289
6289
|
});
|
|
6290
6290
|
return;
|
|
6291
6291
|
}
|
|
6292
|
-
let
|
|
6293
|
-
if ("text" in d || "files" in d ?
|
|
6292
|
+
let E;
|
|
6293
|
+
if ("text" in d || "files" in d ? E = {
|
|
6294
6294
|
parts: [
|
|
6295
6295
|
...Array.isArray(d.files) ? d.files : await _l(d.files),
|
|
6296
6296
|
..."text" in d && d.text != null ? [{ type: "text", text: d.text }] : []
|
|
6297
6297
|
]
|
|
6298
|
-
} :
|
|
6299
|
-
const
|
|
6298
|
+
} : E = d, d.messageId != null) {
|
|
6299
|
+
const w = this.state.messages.findIndex(
|
|
6300
6300
|
(f) => f.id === d.messageId
|
|
6301
6301
|
);
|
|
6302
|
-
if (
|
|
6302
|
+
if (w === -1)
|
|
6303
6303
|
throw new Error(`message with id ${d.messageId} not found`);
|
|
6304
|
-
if (this.state.messages[
|
|
6304
|
+
if (this.state.messages[w].role !== "user")
|
|
6305
6305
|
throw new Error(
|
|
6306
6306
|
`message with id ${d.messageId} is not a user message`
|
|
6307
6307
|
);
|
|
6308
|
-
this.state.messages = this.state.messages.slice(0,
|
|
6309
|
-
...
|
|
6308
|
+
this.state.messages = this.state.messages.slice(0, w + 1), this.state.replaceMessage(w, {
|
|
6309
|
+
...E,
|
|
6310
6310
|
id: d.messageId,
|
|
6311
|
-
role: (
|
|
6311
|
+
role: (y = E.role) != null ? y : "user",
|
|
6312
6312
|
metadata: d.metadata
|
|
6313
6313
|
});
|
|
6314
6314
|
} else
|
|
6315
6315
|
this.state.pushMessage({
|
|
6316
|
-
...
|
|
6317
|
-
id: (
|
|
6318
|
-
role: (
|
|
6316
|
+
...E,
|
|
6317
|
+
id: (g = E.id) != null ? g : this.generateId(),
|
|
6318
|
+
role: (v = E.role) != null ? v : "user",
|
|
6319
6319
|
metadata: d.metadata
|
|
6320
6320
|
});
|
|
6321
6321
|
await this.makeRequest({
|
|
6322
6322
|
trigger: "submit-message",
|
|
6323
6323
|
messageId: d.messageId,
|
|
6324
|
-
...
|
|
6324
|
+
..._
|
|
6325
6325
|
});
|
|
6326
6326
|
}, this.regenerate = async ({
|
|
6327
6327
|
messageId: d,
|
|
6328
|
-
...
|
|
6328
|
+
..._
|
|
6329
6329
|
} = {}) => {
|
|
6330
|
-
const h = d == null ? this.state.messages.length - 1 : this.state.messages.findIndex((
|
|
6330
|
+
const h = d == null ? this.state.messages.length - 1 : this.state.messages.findIndex((y) => y.id === d);
|
|
6331
6331
|
if (h === -1)
|
|
6332
6332
|
throw new Error(`message ${d} not found`);
|
|
6333
6333
|
this.state.messages = this.state.messages.slice(
|
|
@@ -6337,7 +6337,7 @@ var yl = class {
|
|
|
6337
6337
|
), await this.makeRequest({
|
|
6338
6338
|
trigger: "regenerate-message",
|
|
6339
6339
|
messageId: d,
|
|
6340
|
-
...
|
|
6340
|
+
..._
|
|
6341
6341
|
});
|
|
6342
6342
|
}, this.resumeStream = async (d = {}) => {
|
|
6343
6343
|
await this.makeRequest({ trigger: "resume-stream", ...d });
|
|
@@ -6345,37 +6345,37 @@ var yl = class {
|
|
|
6345
6345
|
this.status === "error" && (this.state.error = void 0, this.setStatus({ status: "ready" }));
|
|
6346
6346
|
}, this.addToolApprovalResponse = async ({
|
|
6347
6347
|
id: d,
|
|
6348
|
-
approved:
|
|
6348
|
+
approved: _,
|
|
6349
6349
|
reason: h
|
|
6350
6350
|
}) => this.jobExecutor.run(async () => {
|
|
6351
|
-
var
|
|
6352
|
-
const
|
|
6351
|
+
var y, g;
|
|
6352
|
+
const v = this.state.messages, E = v[v.length - 1], w = (f) => dt(f) && f.state === "approval-requested" && f.approval.id === d ? {
|
|
6353
6353
|
...f,
|
|
6354
6354
|
state: "approval-responded",
|
|
6355
|
-
approval: { id: d, approved:
|
|
6355
|
+
approval: { id: d, approved: _, reason: h }
|
|
6356
6356
|
} : f;
|
|
6357
|
-
this.state.replaceMessage(
|
|
6358
|
-
...
|
|
6359
|
-
parts:
|
|
6360
|
-
}), this.activeResponse && (this.activeResponse.state.message.parts = this.activeResponse.state.message.parts.map(
|
|
6357
|
+
this.state.replaceMessage(v.length - 1, {
|
|
6358
|
+
...E,
|
|
6359
|
+
parts: E.parts.map(w)
|
|
6360
|
+
}), this.activeResponse && (this.activeResponse.state.message.parts = this.activeResponse.state.message.parts.map(w)), this.status !== "streaming" && this.status !== "submitted" && ((y = this.sendAutomaticallyWhen) != null && y.call(this, { messages: this.state.messages })) && this.makeRequest({
|
|
6361
6361
|
trigger: "submit-message",
|
|
6362
|
-
messageId: (
|
|
6362
|
+
messageId: (g = this.lastMessage) == null ? void 0 : g.id
|
|
6363
6363
|
});
|
|
6364
6364
|
}), this.addToolOutput = async ({
|
|
6365
6365
|
state: d = "output-available",
|
|
6366
|
-
tool:
|
|
6366
|
+
tool: _,
|
|
6367
6367
|
toolCallId: h,
|
|
6368
|
-
output:
|
|
6369
|
-
errorText:
|
|
6368
|
+
output: y,
|
|
6369
|
+
errorText: g
|
|
6370
6370
|
}) => this.jobExecutor.run(async () => {
|
|
6371
|
-
var
|
|
6372
|
-
const
|
|
6373
|
-
this.state.replaceMessage(
|
|
6371
|
+
var v, E;
|
|
6372
|
+
const w = this.state.messages, f = w[w.length - 1], $ = (Z) => dt(Z) && Z.toolCallId === h ? { ...Z, state: d, output: y, errorText: g } : Z;
|
|
6373
|
+
this.state.replaceMessage(w.length - 1, {
|
|
6374
6374
|
...f,
|
|
6375
6375
|
parts: f.parts.map($)
|
|
6376
|
-
}), this.activeResponse && (this.activeResponse.state.message.parts = this.activeResponse.state.message.parts.map($)), this.status !== "streaming" && this.status !== "submitted" && ((
|
|
6376
|
+
}), this.activeResponse && (this.activeResponse.state.message.parts = this.activeResponse.state.message.parts.map($)), this.status !== "streaming" && this.status !== "submitted" && ((v = this.sendAutomaticallyWhen) != null && v.call(this, { messages: this.state.messages })) && this.makeRequest({
|
|
6377
6377
|
trigger: "submit-message",
|
|
6378
|
-
messageId: (
|
|
6378
|
+
messageId: (E = this.lastMessage) == null ? void 0 : E.id
|
|
6379
6379
|
});
|
|
6380
6380
|
}), this.addToolResult = this.addToolOutput, this.stop = async () => {
|
|
6381
6381
|
var d;
|
|
@@ -6421,7 +6421,7 @@ var yl = class {
|
|
|
6421
6421
|
var s, i, a, c;
|
|
6422
6422
|
this.setStatus({ status: "submitted", error: void 0 });
|
|
6423
6423
|
const u = this.lastMessage;
|
|
6424
|
-
let l = !1, d = !1,
|
|
6424
|
+
let l = !1, d = !1, _ = !1;
|
|
6425
6425
|
try {
|
|
6426
6426
|
const h = {
|
|
6427
6427
|
state: hl({
|
|
@@ -6433,21 +6433,21 @@ var yl = class {
|
|
|
6433
6433
|
h.abortController.signal.addEventListener("abort", () => {
|
|
6434
6434
|
l = !0;
|
|
6435
6435
|
}), this.activeResponse = h;
|
|
6436
|
-
let
|
|
6436
|
+
let y;
|
|
6437
6437
|
if (e === "resume-stream") {
|
|
6438
|
-
const
|
|
6438
|
+
const v = await this.transport.reconnectToStream({
|
|
6439
6439
|
chatId: this.id,
|
|
6440
6440
|
metadata: t,
|
|
6441
6441
|
headers: r,
|
|
6442
6442
|
body: n
|
|
6443
6443
|
});
|
|
6444
|
-
if (
|
|
6444
|
+
if (v == null) {
|
|
6445
6445
|
this.setStatus({ status: "ready" });
|
|
6446
6446
|
return;
|
|
6447
6447
|
}
|
|
6448
|
-
|
|
6448
|
+
y = v;
|
|
6449
6449
|
} else
|
|
6450
|
-
|
|
6450
|
+
y = await this.transport.sendMessages({
|
|
6451
6451
|
chatId: this.id,
|
|
6452
6452
|
messages: this.state.messages,
|
|
6453
6453
|
abortSignal: h.abortController.signal,
|
|
@@ -6457,14 +6457,14 @@ var yl = class {
|
|
|
6457
6457
|
trigger: e,
|
|
6458
6458
|
messageId: o
|
|
6459
6459
|
});
|
|
6460
|
-
const
|
|
6460
|
+
const g = (v) => (
|
|
6461
6461
|
// serialize the job execution to avoid race conditions:
|
|
6462
6462
|
this.jobExecutor.run(
|
|
6463
|
-
() =>
|
|
6463
|
+
() => v({
|
|
6464
6464
|
state: h.state,
|
|
6465
6465
|
write: () => {
|
|
6466
|
-
var
|
|
6467
|
-
this.setStatus({ status: "streaming" }), h.state.message.id === ((
|
|
6466
|
+
var E;
|
|
6467
|
+
this.setStatus({ status: "streaming" }), h.state.message.id === ((E = this.lastMessage) == null ? void 0 : E.id) ? this.state.replaceMessage(
|
|
6468
6468
|
this.state.messages.length - 1,
|
|
6469
6469
|
h.state.message
|
|
6470
6470
|
) : this.state.pushMessage(h.state.message);
|
|
@@ -6474,24 +6474,24 @@ var yl = class {
|
|
|
6474
6474
|
);
|
|
6475
6475
|
await gl({
|
|
6476
6476
|
stream: ml({
|
|
6477
|
-
stream:
|
|
6477
|
+
stream: y,
|
|
6478
6478
|
onToolCall: this.onToolCall,
|
|
6479
6479
|
onData: this.onData,
|
|
6480
6480
|
messageMetadataSchema: this.messageMetadataSchema,
|
|
6481
6481
|
dataPartSchemas: this.dataPartSchemas,
|
|
6482
|
-
runUpdateMessageJob:
|
|
6483
|
-
onError: (
|
|
6484
|
-
throw
|
|
6482
|
+
runUpdateMessageJob: g,
|
|
6483
|
+
onError: (v) => {
|
|
6484
|
+
throw v;
|
|
6485
6485
|
}
|
|
6486
6486
|
}),
|
|
6487
|
-
onError: (
|
|
6488
|
-
throw
|
|
6487
|
+
onError: (v) => {
|
|
6488
|
+
throw v;
|
|
6489
6489
|
}
|
|
6490
6490
|
}), this.setStatus({ status: "ready" });
|
|
6491
6491
|
} catch (h) {
|
|
6492
6492
|
if (l || h.name === "AbortError")
|
|
6493
6493
|
return l = !0, this.setStatus({ status: "ready" }), null;
|
|
6494
|
-
|
|
6494
|
+
_ = !0, h instanceof TypeError && (h.message.toLowerCase().includes("fetch") || h.message.toLowerCase().includes("network")) && (d = !0), this.onError && h instanceof Error && this.onError(h), this.setStatus({ status: "error", error: h });
|
|
6495
6495
|
} finally {
|
|
6496
6496
|
try {
|
|
6497
6497
|
(i = this.onFinish) == null || i.call(this, {
|
|
@@ -6499,7 +6499,7 @@ var yl = class {
|
|
|
6499
6499
|
messages: this.state.messages,
|
|
6500
6500
|
isAbort: l,
|
|
6501
6501
|
isDisconnect: d,
|
|
6502
|
-
isError:
|
|
6502
|
+
isError: _,
|
|
6503
6503
|
finishReason: (s = this.activeResponse) == null ? void 0 : s.state.finishReason
|
|
6504
6504
|
});
|
|
6505
6505
|
} catch (h) {
|
|
@@ -6507,7 +6507,7 @@ var yl = class {
|
|
|
6507
6507
|
}
|
|
6508
6508
|
this.activeResponse = void 0;
|
|
6509
6509
|
}
|
|
6510
|
-
(a = this.sendAutomaticallyWhen) != null && a.call(this, { messages: this.state.messages }) && !
|
|
6510
|
+
(a = this.sendAutomaticallyWhen) != null && a.call(this, { messages: this.state.messages }) && !_ && await this.makeRequest({
|
|
6511
6511
|
trigger: "submit-message",
|
|
6512
6512
|
messageId: (c = this.lastMessage) == null ? void 0 : c.id,
|
|
6513
6513
|
metadata: t,
|
|
@@ -6701,7 +6701,7 @@ const Tl = He("x", [
|
|
|
6701
6701
|
src: Kn,
|
|
6702
6702
|
alt: "",
|
|
6703
6703
|
class: "w-16"
|
|
6704
|
-
}, Jl = ["disabled"], Fl = /* @__PURE__ */ Bn({
|
|
6704
|
+
}, Jl = ["disabled"], Fl = { class: "chat-button" }, Vl = /* @__PURE__ */ Bn({
|
|
6705
6705
|
__name: "ChatbotComponent",
|
|
6706
6706
|
props: {
|
|
6707
6707
|
clientId: { type: String, default: "" },
|
|
@@ -6713,7 +6713,7 @@ const Tl = He("x", [
|
|
|
6713
6713
|
setup(e, { emit: t }) {
|
|
6714
6714
|
const r = e, n = t, o = he(""), s = he(null), i = he(!1), a = Wn({
|
|
6715
6715
|
get: () => r.modelValue,
|
|
6716
|
-
set: (
|
|
6716
|
+
set: (h) => n("update:modelValue", h)
|
|
6717
6717
|
}), c = new Il({
|
|
6718
6718
|
transport: new Vn({
|
|
6719
6719
|
api: "https://ai-chat-backend.dev02.dtsmart.dev/api/chat",
|
|
@@ -6722,39 +6722,41 @@ const Tl = He("x", [
|
|
|
6722
6722
|
mcp_token: r.token
|
|
6723
6723
|
}
|
|
6724
6724
|
})
|
|
6725
|
-
}), u = async (
|
|
6725
|
+
}), u = async (h) => {
|
|
6726
6726
|
try {
|
|
6727
6727
|
if (!o.value.trim())
|
|
6728
6728
|
return;
|
|
6729
|
-
const
|
|
6730
|
-
o.value = "", i.value = !0,
|
|
6731
|
-
} catch (
|
|
6732
|
-
console.error(
|
|
6729
|
+
const y = o.value.trim();
|
|
6730
|
+
o.value = "", i.value = !0, h.preventDefault(), await c.sendMessage({ text: y });
|
|
6731
|
+
} catch (y) {
|
|
6732
|
+
console.error(y);
|
|
6733
6733
|
} finally {
|
|
6734
6734
|
i.value = !1;
|
|
6735
6735
|
}
|
|
6736
6736
|
}, l = () => {
|
|
6737
|
-
console.log("
|
|
6737
|
+
console.log("handleOpenToggle nha"), a.value = !0, console.log(a.value, "visible aaa");
|
|
6738
6738
|
}, d = () => {
|
|
6739
|
+
console.log("handleCloseToggle nha"), a.value = !1, console.log(a.value, "visible bbb");
|
|
6740
|
+
}, _ = () => {
|
|
6739
6741
|
a.value = !1, c.messages = [];
|
|
6740
6742
|
};
|
|
6741
6743
|
return Yn(
|
|
6742
6744
|
() => c.messages,
|
|
6743
6745
|
async () => {
|
|
6744
|
-
var
|
|
6745
|
-
await qn(), (
|
|
6746
|
+
var h;
|
|
6747
|
+
await qn(), (h = s.value) == null || h.scrollTo({
|
|
6746
6748
|
top: s.value.scrollHeight,
|
|
6747
6749
|
behavior: "smooth"
|
|
6748
6750
|
});
|
|
6749
6751
|
},
|
|
6750
6752
|
{ deep: !0 }
|
|
6751
|
-
), (
|
|
6752
|
-
var
|
|
6753
|
+
), (h, y) => {
|
|
6754
|
+
var g;
|
|
6753
6755
|
return B(), q(Pe, null, [
|
|
6754
6756
|
a.value ? (B(), q("div", {
|
|
6755
6757
|
key: 0,
|
|
6756
6758
|
class: "bg-[#ffffff00] absolute w-full h-full",
|
|
6757
|
-
onClick:
|
|
6759
|
+
onClick: y[0] || (y[0] = (v) => a.value = !1)
|
|
6758
6760
|
})) : we("", !0),
|
|
6759
6761
|
D("div", Nl, [
|
|
6760
6762
|
Gn(Ae(a.value + "aaa") + " ", 1),
|
|
@@ -6762,10 +6764,10 @@ const Tl = He("x", [
|
|
|
6762
6764
|
class: Hn(["ai-card chat-popup transition-all duration-7 gap-y-5", { "opacity-0": !a.value, "opacity-100": a.value }])
|
|
6763
6765
|
}, [
|
|
6764
6766
|
D("div", Pl, [
|
|
6765
|
-
|
|
6767
|
+
y[2] || (y[2] = D("p", { class: "ai-hello" }, "Hi, I’m Boko AI", -1)),
|
|
6766
6768
|
D("button", {
|
|
6767
6769
|
class: "ai-close",
|
|
6768
|
-
onClick:
|
|
6770
|
+
onClick: _
|
|
6769
6771
|
}, [
|
|
6770
6772
|
Et(le(Tl))
|
|
6771
6773
|
])
|
|
@@ -6778,25 +6780,25 @@ const Tl = He("x", [
|
|
|
6778
6780
|
le(c).messages.length === 0 ? (B(), q("div", Al, [
|
|
6779
6781
|
D("div", null, [
|
|
6780
6782
|
D("p", Rl, " Hello " + Ae(e.clientId), 1),
|
|
6781
|
-
|
|
6783
|
+
y[3] || (y[3] = D("p", { class: "text-5xl text-[#2a2f3c] leading-[80px]" }, " How Can I Help You Today ? ", -1))
|
|
6782
6784
|
]),
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
+
y[4] || (y[4] = D("p", { class: "text-base text-[#545e7f]" }, " I’m Boko, your friendly assistant. ", -1)),
|
|
6786
|
+
y[5] || (y[5] = D("p", { class: "text-base text-[#545e7f]" }, " Here to help — anytime you’re ready! ", -1))
|
|
6785
6787
|
])) : we("", !0),
|
|
6786
|
-
(B(!0), q(Pe, null, kt(le(c).messages, (
|
|
6787
|
-
key:
|
|
6788
|
+
(B(!0), q(Pe, null, kt(le(c).messages, (v, E) => (B(), q("div", {
|
|
6789
|
+
key: v.id ?? E,
|
|
6788
6790
|
class: "mb-3"
|
|
6789
6791
|
}, [
|
|
6790
|
-
(B(!0), q(Pe, null, kt(
|
|
6791
|
-
key: `${
|
|
6792
|
+
(B(!0), q(Pe, null, kt(v == null ? void 0 : v.parts, (w, f) => (B(), q(Pe, {
|
|
6793
|
+
key: `${v.id}-${w.type}-${f}`
|
|
6792
6794
|
}, [
|
|
6793
|
-
|
|
6795
|
+
v.role === "user" ? (B(), q("div", xl, [
|
|
6794
6796
|
D("div", jl, [
|
|
6795
|
-
(
|
|
6797
|
+
(w == null ? void 0 : w.type) === "text" ? (B(), q("div", Cl, Ae(w == null ? void 0 : w.text), 1)) : we("", !0)
|
|
6796
6798
|
])
|
|
6797
6799
|
])) : (B(), q("div", Ml, [
|
|
6798
6800
|
D("div", Dl, [
|
|
6799
|
-
(
|
|
6801
|
+
(w == null ? void 0 : w.type) === "text" ? (B(), q("div", Ul, Ae(w == null ? void 0 : w.text), 1)) : we("", !0)
|
|
6800
6802
|
])
|
|
6801
6803
|
]))
|
|
6802
6804
|
], 64))), 128))
|
|
@@ -6809,30 +6811,29 @@ const Tl = He("x", [
|
|
|
6809
6811
|
}, [
|
|
6810
6812
|
Xn(D("input", {
|
|
6811
6813
|
class: "ai-input",
|
|
6812
|
-
"onUpdate:modelValue":
|
|
6814
|
+
"onUpdate:modelValue": y[1] || (y[1] = (v) => o.value = v),
|
|
6813
6815
|
placeholder: "Ask me anything…"
|
|
6814
6816
|
}, null, 512), [
|
|
6815
6817
|
[Qn, o.value]
|
|
6816
6818
|
]),
|
|
6817
6819
|
D("button", {
|
|
6818
6820
|
class: "ai-send",
|
|
6819
|
-
disabled: !o.value || ((
|
|
6821
|
+
disabled: !o.value || ((g = o.value) == null ? void 0 : g.length) == 0 || i.value
|
|
6820
6822
|
}, [
|
|
6821
6823
|
Et(le(Ol), { class: "w-5 h-5 text-white" })
|
|
6822
6824
|
], 8, Jl)
|
|
6823
6825
|
], 32)
|
|
6824
6826
|
], 2),
|
|
6825
6827
|
D("div", null, [
|
|
6826
|
-
D("button",
|
|
6827
|
-
class: "chat-button",
|
|
6828
|
-
onClick: l
|
|
6829
|
-
}, [
|
|
6828
|
+
D("button", Fl, [
|
|
6830
6829
|
a.value ? (B(), zt(le(Zl), {
|
|
6831
6830
|
key: 1,
|
|
6832
|
-
class: "text-white"
|
|
6831
|
+
class: "text-white",
|
|
6832
|
+
onClick: d
|
|
6833
6833
|
})) : (B(), zt(le($l), {
|
|
6834
6834
|
key: 0,
|
|
6835
|
-
class: "text-white"
|
|
6835
|
+
class: "text-white",
|
|
6836
|
+
onClick: l
|
|
6836
6837
|
}))
|
|
6837
6838
|
])
|
|
6838
6839
|
])
|
|
@@ -6841,12 +6842,12 @@ const Tl = He("x", [
|
|
|
6841
6842
|
};
|
|
6842
6843
|
}
|
|
6843
6844
|
});
|
|
6844
|
-
const
|
|
6845
|
+
const Bl = (e, t) => {
|
|
6845
6846
|
const r = e.__vccOpts || e;
|
|
6846
6847
|
for (const [n, o] of t)
|
|
6847
6848
|
r[n] = o;
|
|
6848
6849
|
return r;
|
|
6849
|
-
},
|
|
6850
|
+
}, Yl = /* @__PURE__ */ Bl(Vl, [["__scopeId", "data-v-edb2dc60"]]);
|
|
6850
6851
|
export {
|
|
6851
|
-
|
|
6852
|
+
Yl as ChatbotComponent
|
|
6852
6853
|
};
|