@8wave/ai-elements 0.104.0 → 0.105.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{Agent-DG4nPG72.js → Agent-VhugusRf.js} +2 -2
- package/dist/_chunks/Agent-VhugusRf.js.map +1 -0
- package/dist/_chunks/{Document-DXkvvAnt.js → Document-DjNrISX1.js} +2 -2
- package/dist/_chunks/{Document-DXkvvAnt.js.map → Document-DjNrISX1.js.map} +1 -1
- package/dist/_chunks/{Media-3Mo4NRj7.js → Media-hjgDyEMr.js} +2 -2
- package/dist/_chunks/Media-hjgDyEMr.js.map +1 -0
- package/dist/_chunks/{PkStreamingMarkdown-YKd9F3xU.js → PkStreamingMarkdown-B4eMb97I.js} +2 -2
- package/dist/_chunks/{PkStreamingMarkdown-YKd9F3xU.js.map → PkStreamingMarkdown-B4eMb97I.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-sf6LpUN_.js → PkToolRequestGeolocation-Bp-D2nDb.js} +3 -3
- package/{dist-vue/_chunks/PkToolRequestGeolocation-BdX5DzEN.js.map → dist/_chunks/PkToolRequestGeolocation-Bp-D2nDb.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-BB8mlQit.js → PkToolRequestOAuthConnection-CjjyDj9A.js} +3 -3
- package/dist/_chunks/{PkToolRequestOAuthConnection-BB8mlQit.js.map → PkToolRequestOAuthConnection-CjjyDj9A.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-54saXXCe.js → PkToolShowArtifact-Dl8f7Q7q.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-54saXXCe.js.map → PkToolShowArtifact-Dl8f7Q7q.js.map} +1 -1
- package/dist/_chunks/{PkToolShowCalendarEvent-B_HPVUDk.js → PkToolShowCalendarEvent-B_QmZrlZ.js} +2 -2
- package/dist/_chunks/{PkToolShowCalendarEvent-B_HPVUDk.js.map → PkToolShowCalendarEvent-B_QmZrlZ.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-BtcNCixq.js → PkToolShowContactForm-CXE0485W.js} +14 -14
- package/dist/_chunks/{PkToolShowContactForm-BtcNCixq.js.map → PkToolShowContactForm-CXE0485W.js.map} +1 -1
- package/dist/_chunks/{PkToolShowDiagram-cA64c2_N.js → PkToolShowDiagram-D-TyCkCB.js} +2 -2
- package/dist/_chunks/{PkToolShowDiagram-cA64c2_N.js.map → PkToolShowDiagram-D-TyCkCB.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-DdBAG0Qs.js → PkToolShowForm-BzaibKAz.js} +101 -115
- package/dist/_chunks/PkToolShowForm-BzaibKAz.js.map +1 -0
- package/dist/_chunks/{PkToolShowSources-0qudS-bu.js → PkToolShowSources-CoTIoupP.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-0qudS-bu.js.map → PkToolShowSources-CoTIoupP.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-B2IB6ioR.js → PkToolShowSuggestedReply-DA2Bi7k4.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-B2IB6ioR.js.map → PkToolShowSuggestedReply-DA2Bi7k4.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWeather-Bl3Yoscl.js → PkToolShowWeather-ChDHtOLz.js} +2 -2
- package/dist/_chunks/{PkToolShowWeather-Bl3Yoscl.js.map → PkToolShowWeather-ChDHtOLz.js.map} +1 -1
- package/dist/_chunks/{browser-DuzNfJq0.js → browser-BXy4OnXA.js} +804 -779
- package/dist/_chunks/browser-BXy4OnXA.js.map +1 -0
- package/dist/_chunks/index.es-CnpsLhp_.js +1006 -0
- package/dist/_chunks/index.es-CnpsLhp_.js.map +1 -0
- package/dist/_chunks/utils-DtJdKlnF.js +185 -0
- package/dist/_chunks/utils-DtJdKlnF.js.map +1 -0
- package/dist/_chunks/{vue-i18n-_ouwlDGE.js → vue-i18n-C3J36GV4.js} +2 -2
- package/dist/_chunks/{vue-i18n-_ouwlDGE.js.map → vue-i18n-C3J36GV4.js.map} +1 -1
- package/dist/_chunks/{web-DnPxEADy.js → web-CzR5jWfC.js} +46 -45
- package/dist/_chunks/{web-DnPxEADy.js.map → web-CzR5jWfC.js.map} +1 -1
- package/dist/ai-elements.es.js +2100 -2159
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{Agent-gCuDMxHN.js → Agent-CpIgGdU4.js} +2 -2
- package/dist-vue/_chunks/Agent-CpIgGdU4.js.map +1 -0
- package/dist-vue/_chunks/{Document-iH61Cw06.js → Document-CiaGPYTR.js} +2 -2
- package/dist-vue/_chunks/{Document-iH61Cw06.js.map → Document-CiaGPYTR.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbot-Bg9oercD.js → PkChatbot-xmjKbljL.js} +7 -7
- package/dist-vue/_chunks/{PkChatbot-Bg9oercD.js.map → PkChatbot-xmjKbljL.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-DUQxuYaG.js → PkChatbotMessages-tHQ2JQrb.js} +75 -75
- package/dist-vue/_chunks/{PkChatbotMessages-DUQxuYaG.js.map → PkChatbotMessages-tHQ2JQrb.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepPayload-hCmy4XG9.js → PkChatbotStepPayload-BtsnkJIV.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-hCmy4XG9.js.map → PkChatbotStepPayload-BtsnkJIV.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-B0WU0HcD.js → PkChatbotStepToolDetail-CCa95eBO.js} +116 -101
- package/dist-vue/_chunks/PkChatbotStepToolDetail-CCa95eBO.js.map +1 -0
- package/dist-vue/_chunks/PkChatbotSteps-CPBzs7Gi.js +180 -0
- package/dist-vue/_chunks/PkChatbotSteps-CPBzs7Gi.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewChat-YwjWNoqf.js → PkChatbotViewChat-CdiPjQLq.js} +6 -6
- package/dist-vue/_chunks/{PkChatbotViewChat-YwjWNoqf.js.map → PkChatbotViewChat-CdiPjQLq.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-vo57eSwy.js → PkChatbotViewConversations-BP-NJvlK.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-vo57eSwy.js.map → PkChatbotViewConversations-BP-NJvlK.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-DDPugn7F.js → PkChatbotViewFiles-DRUVmxU5.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-DDPugn7F.js.map → PkChatbotViewFiles-DRUVmxU5.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-Dww5KI21.js → PkChatbotViewProfile-ywvIs6N5.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-Dww5KI21.js.map → PkChatbotViewProfile-ywvIs6N5.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-BdX5DzEN.js → PkToolRequestGeolocation-BdIyXoPQ.js} +2 -2
- package/{dist/_chunks/PkToolRequestGeolocation-sf6LpUN_.js.map → dist-vue/_chunks/PkToolRequestGeolocation-BdIyXoPQ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-BUmnRgMi.js → PkToolRequestOAuthConnection-Dnch7xAB.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-BUmnRgMi.js.map → PkToolRequestOAuthConnection-Dnch7xAB.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-YMo-iVWr.js → PkToolShowDiagram-DgLxNNp7.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-YMo-iVWr.js.map → PkToolShowDiagram-DgLxNNp7.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-D2n2rA6J.js → PkToolShowForm-6eLi6Wr0.js} +103 -117
- package/dist-vue/_chunks/PkToolShowForm-6eLi6Wr0.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowSources-DUAsrrzC.js → PkToolShowSources-DTJgvDiB.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSources-DUAsrrzC.js.map → PkToolShowSources-DTJgvDiB.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-Dm28RIJF.js → PkToolShowSuggestedReply-D9RY2h6Z.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-Dm28RIJF.js.map → PkToolShowSuggestedReply-D9RY2h6Z.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-CAX-3-oK.js → createChatbotApiClient-12eL7hul.js} +2 -2
- package/dist-vue/_chunks/{createChatbotApiClient-CAX-3-oK.js.map → createChatbotApiClient-12eL7hul.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore-Rj18hAUf.js → useChatbotStore-Chtzi5jc.js} +1086 -1016
- package/dist-vue/_chunks/useChatbotStore-Chtzi5jc.js.map +1 -0
- package/dist-vue/_chunks/{utils-B0jsOUqd.js → utils-DKNWwMTQ.js} +46 -23
- package/dist-vue/_chunks/utils-DKNWwMTQ.js.map +1 -0
- package/dist-vue/_chunks/{web-DnPxEADy.js → web-CzR5jWfC.js} +46 -45
- package/dist-vue/_chunks/{web-DnPxEADy.js.map → web-CzR5jWfC.js.map} +1 -1
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +3 -3
- package/dist-vue/index.js +259 -259
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +10 -4
- package/dist-vue/packages/components/src/PkEditorRepeater.d.ts +1 -1
- package/dist-vue/packages/components/src/chat/constants.d.ts +12 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +37 -0
- package/dist-vue/packages/models/src/schema/Agent.d.ts +24 -16
- package/dist-vue/packages/models/src/schema/AgentChatStatistics.d.ts +1 -1
- package/dist-vue/packages/models/src/schema/Chat.d.ts +9 -9
- package/dist-vue/packages/models/src/schema/Document.d.ts +6 -6
- package/dist-vue/packages/models/src/schema/DocumentFolder.d.ts +0 -1
- package/dist-vue/packages/models/src/schema/McpServer.d.ts +2 -2
- package/dist-vue/packages/models/src/schema/Member.d.ts +2 -2
- package/dist-vue/packages/models/src/schema/Organization.d.ts +4 -4
- package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +29 -29
- package/dist-vue/packages/models/src/schema/SubAgent.d.ts +20 -20
- package/dist-vue/packages/models/src/schema/User.d.ts +6 -6
- package/dist-vue/packages/models/src/schema/constants.d.ts +2 -0
- package/package.json +10 -5
- package/dist/_chunks/Agent-DG4nPG72.js.map +0 -1
- package/dist/_chunks/Media-3Mo4NRj7.js.map +0 -1
- package/dist/_chunks/PkToolShowForm-DdBAG0Qs.js.map +0 -1
- package/dist/_chunks/browser-DuzNfJq0.js.map +0 -1
- package/dist/_chunks/index.es-DXx8DNKf.js +0 -2986
- package/dist/_chunks/index.es-DXx8DNKf.js.map +0 -1
- package/dist-vue/_chunks/Agent-gCuDMxHN.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotStepToolDetail-B0WU0HcD.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotSteps-BrvTsAeZ.js +0 -177
- package/dist-vue/_chunks/PkChatbotSteps-BrvTsAeZ.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowForm-D2n2rA6J.js.map +0 -1
- package/dist-vue/_chunks/useChatbotStore-Rj18hAUf.js.map +0 -1
- package/dist-vue/_chunks/utils-B0jsOUqd.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { C as e, _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, v as g, w as _, y as ee } from "./schemas-U769m8P5.js";
|
|
2
|
-
import { E as te } from "./Agent-
|
|
3
|
-
import { r as ne, t as re } from "./createChatbotApiClient-
|
|
2
|
+
import { E as te } from "./Agent-CpIgGdU4.js";
|
|
3
|
+
import { r as ne, t as re } from "./createChatbotApiClient-12eL7hul.js";
|
|
4
4
|
import { t as ie } from "./src-C2w8W_tC.js";
|
|
5
5
|
import { n as ae } from "./message-RohfrdWS.js";
|
|
6
6
|
import { t as oe } from "./useSafeLocalStorage-BneNcUZ9.js";
|
|
@@ -73,30 +73,30 @@ var ve = "vercel.ai.error", ye = Symbol.for(ve), x, S, C = class e extends (S =
|
|
|
73
73
|
function be(e) {
|
|
74
74
|
return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.toString() : JSON.stringify(e);
|
|
75
75
|
}
|
|
76
|
-
var xe = "AI_InvalidArgumentError", Se = `vercel.ai.error.${xe}`, w = Symbol.for(Se),
|
|
76
|
+
var xe = "AI_InvalidArgumentError", Se = `vercel.ai.error.${xe}`, w = Symbol.for(Se), T, Ce, E = class extends (Ce = C, T = w, Ce) {
|
|
77
77
|
constructor({ message: e, cause: t, argument: n }) {
|
|
78
78
|
super({
|
|
79
79
|
name: xe,
|
|
80
80
|
message: e,
|
|
81
81
|
cause: t
|
|
82
|
-
}), this[
|
|
82
|
+
}), this[T] = !0, this.argument = n;
|
|
83
83
|
}
|
|
84
84
|
static isInstance(e) {
|
|
85
85
|
return C.hasMarker(e, Se);
|
|
86
86
|
}
|
|
87
|
-
},
|
|
87
|
+
}, we = "AI_JSONParseError", Te = `vercel.ai.error.${we}`, Ee = Symbol.for(Te), De, Oe, D = class extends (Oe = C, De = Ee, Oe) {
|
|
88
88
|
constructor({ text: e, cause: t }) {
|
|
89
89
|
super({
|
|
90
|
-
name:
|
|
90
|
+
name: we,
|
|
91
91
|
message: `JSON parsing failed: Text: ${e}.
|
|
92
92
|
Error message: ${be(t)}`,
|
|
93
93
|
cause: t
|
|
94
|
-
}), this[
|
|
94
|
+
}), this[De] = !0, this.text = e;
|
|
95
95
|
}
|
|
96
96
|
static isInstance(e) {
|
|
97
|
-
return C.hasMarker(e,
|
|
97
|
+
return C.hasMarker(e, Te);
|
|
98
98
|
}
|
|
99
|
-
},
|
|
99
|
+
}, ke = "AI_TypeValidationError", O = `vercel.ai.error.${ke}`, Ae = Symbol.for(O), je, k, A = class e extends (k = C, je = Ae, k) {
|
|
100
100
|
constructor({ value: e, cause: t, context: n }) {
|
|
101
101
|
let r = "Type validation failed";
|
|
102
102
|
if (n?.field && (r += ` for ${n.field}`), n?.entityName || n?.entityId) {
|
|
@@ -105,14 +105,14 @@ Error message: ${be(t)}`,
|
|
|
105
105
|
n.entityName && e.push(n.entityName), n.entityId && e.push(`id: "${n.entityId}"`), r += e.join(", "), r += ")";
|
|
106
106
|
}
|
|
107
107
|
super({
|
|
108
|
-
name:
|
|
108
|
+
name: ke,
|
|
109
109
|
message: `${r}: Value: ${JSON.stringify(e)}.
|
|
110
110
|
Error message: ${be(t)}`,
|
|
111
111
|
cause: t
|
|
112
|
-
}), this[
|
|
112
|
+
}), this[je] = !0, this.value = e, this.context = n;
|
|
113
113
|
}
|
|
114
114
|
static isInstance(e) {
|
|
115
|
-
return C.hasMarker(e,
|
|
115
|
+
return C.hasMarker(e, O);
|
|
116
116
|
}
|
|
117
117
|
static wrap({ value: t, cause: n, context: r }) {
|
|
118
118
|
return e.isInstance(n) && n.value === t && n.context?.field === r?.field && n.context?.entityName === r?.entityName && n.context?.entityId === r?.entityId ? n : new e({
|
|
@@ -121,15 +121,15 @@ Error message: ${be(t)}`,
|
|
|
121
121
|
context: r
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
-
},
|
|
124
|
+
}, Me = class extends Error {
|
|
125
125
|
constructor(e, t) {
|
|
126
126
|
super(e), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line;
|
|
127
127
|
}
|
|
128
|
-
},
|
|
129
|
-
function
|
|
130
|
-
function
|
|
128
|
+
}, Ne = 10, Pe = 13, j = 32;
|
|
129
|
+
function Fe(e) {}
|
|
130
|
+
function Ie(e) {
|
|
131
131
|
if (typeof e == "function") throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");
|
|
132
|
-
let { onEvent: t =
|
|
132
|
+
let { onEvent: t = Fe, onError: n = Fe, onRetry: r = Fe, onComment: i, maxBufferSize: a } = e, o = [], s = 0, c = !0, l, u = "", d = 0, f, p = !1;
|
|
133
133
|
function m(e) {
|
|
134
134
|
if (p) throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");
|
|
135
135
|
if (c && (c = !1, e.charCodeAt(0) === 239 && e.charCodeAt(1) === 187 && e.charCodeAt(2) === 191 && (e = e.slice(3))), o.length === 0) {
|
|
@@ -148,7 +148,7 @@ function Le(e) {
|
|
|
148
148
|
n !== "" && (o.push(n), s = n.length), h();
|
|
149
149
|
}
|
|
150
150
|
function h() {
|
|
151
|
-
a !== void 0 && (s + u.length <= a || (p = !0, o.length = 0, s = 0, l = void 0, u = "", d = 0, f = void 0, n(new
|
|
151
|
+
a !== void 0 && (s + u.length <= a || (p = !0, o.length = 0, s = 0, l = void 0, u = "", d = 0, f = void 0, n(new Me(`Buffered data exceeded max buffer size of ${a} characters`, { type: "max-buffer-size-exceeded" }))));
|
|
152
152
|
}
|
|
153
153
|
function g(e) {
|
|
154
154
|
let n = 0;
|
|
@@ -164,9 +164,9 @@ function Le(e) {
|
|
|
164
164
|
continue;
|
|
165
165
|
}
|
|
166
166
|
let i = e.charCodeAt(n);
|
|
167
|
-
if (
|
|
168
|
-
let i = e.charCodeAt(n + 5) ===
|
|
169
|
-
if (d === 0 && e.charCodeAt(r + 1) ===
|
|
167
|
+
if (M(e, n, i)) {
|
|
168
|
+
let i = e.charCodeAt(n + 5) === j ? n + 6 : n + 5, a = e.slice(i, r);
|
|
169
|
+
if (d === 0 && e.charCodeAt(r + 1) === Ne) {
|
|
170
170
|
t({
|
|
171
171
|
id: l,
|
|
172
172
|
event: f,
|
|
@@ -176,7 +176,7 @@ function Le(e) {
|
|
|
176
176
|
}
|
|
177
177
|
u = d === 0 ? a : `${u}
|
|
178
178
|
${a}`, d++;
|
|
179
|
-
} else
|
|
179
|
+
} else N(e, n, i) ? f = e.slice(e.charCodeAt(n + 6) === j ? n + 7 : n + 6, r) || void 0 : _(e, n, r);
|
|
180
180
|
n = r + 1, r = e.indexOf("\n", n);
|
|
181
181
|
}
|
|
182
182
|
return e.slice(n);
|
|
@@ -184,7 +184,7 @@ ${a}`, d++;
|
|
|
184
184
|
for (; n < e.length;) {
|
|
185
185
|
let t = e.indexOf("\r", n), r = e.indexOf("\n", n), i = -1;
|
|
186
186
|
if (t !== -1 && r !== -1 ? i = t < r ? t : r : t === -1 ? r !== -1 && (i = r) : i = t === e.length - 1 ? -1 : t, i === -1) break;
|
|
187
|
-
_(e, n, i), n = i + 1, e.charCodeAt(n - 1) ===
|
|
187
|
+
_(e, n, i), n = i + 1, e.charCodeAt(n - 1) === Pe && e.charCodeAt(n) === Ne && n++;
|
|
188
188
|
}
|
|
189
189
|
return e.slice(n);
|
|
190
190
|
}
|
|
@@ -194,25 +194,25 @@ ${a}`, d++;
|
|
|
194
194
|
return;
|
|
195
195
|
}
|
|
196
196
|
let r = e.charCodeAt(t);
|
|
197
|
-
if (
|
|
198
|
-
let r = e.charCodeAt(t + 5) ===
|
|
197
|
+
if (M(e, t, r)) {
|
|
198
|
+
let r = e.charCodeAt(t + 5) === j ? t + 6 : t + 5, i = e.slice(r, n);
|
|
199
199
|
u = d === 0 ? i : `${u}
|
|
200
200
|
${i}`, d++;
|
|
201
201
|
return;
|
|
202
202
|
}
|
|
203
|
-
if (
|
|
204
|
-
f = e.slice(e.charCodeAt(t + 6) ===
|
|
203
|
+
if (N(e, t, r)) {
|
|
204
|
+
f = e.slice(e.charCodeAt(t + 6) === j ? t + 7 : t + 6, n) || void 0;
|
|
205
205
|
return;
|
|
206
206
|
}
|
|
207
207
|
if (r === 105 && e.charCodeAt(t + 1) === 100 && e.charCodeAt(t + 2) === 58) {
|
|
208
|
-
let r = e.slice(e.charCodeAt(t + 3) ===
|
|
208
|
+
let r = e.slice(e.charCodeAt(t + 3) === j ? t + 4 : t + 3, n);
|
|
209
209
|
l = r.includes("\0") ? void 0 : r;
|
|
210
210
|
return;
|
|
211
211
|
}
|
|
212
212
|
if (r === 58) {
|
|
213
213
|
if (i) {
|
|
214
214
|
let r = e.slice(t, n);
|
|
215
|
-
i(r.slice(e.charCodeAt(t + 1) ===
|
|
215
|
+
i(r.slice(e.charCodeAt(t + 1) === j ? 2 : 1));
|
|
216
216
|
}
|
|
217
217
|
return;
|
|
218
218
|
}
|
|
@@ -221,7 +221,7 @@ ${i}`, d++;
|
|
|
221
221
|
ee(a, "", a);
|
|
222
222
|
return;
|
|
223
223
|
}
|
|
224
|
-
let s = a.slice(0, o), c = a.charCodeAt(o + 1) ===
|
|
224
|
+
let s = a.slice(0, o), c = a.charCodeAt(o + 1) === j ? 2 : 1;
|
|
225
225
|
ee(s, a.slice(o + c), a);
|
|
226
226
|
}
|
|
227
227
|
function ee(e, t, i) {
|
|
@@ -237,13 +237,13 @@ ${t}`, d++;
|
|
|
237
237
|
l = t.includes("\0") ? void 0 : t;
|
|
238
238
|
break;
|
|
239
239
|
case "retry":
|
|
240
|
-
/^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new
|
|
240
|
+
/^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new Me(`Invalid \`retry\` value: "${t}"`, {
|
|
241
241
|
type: "invalid-retry",
|
|
242
242
|
value: t,
|
|
243
243
|
line: i
|
|
244
244
|
}));
|
|
245
245
|
break;
|
|
246
|
-
default: n(new
|
|
246
|
+
default: n(new Me(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
|
|
247
247
|
type: "unknown-field",
|
|
248
248
|
field: e,
|
|
249
249
|
value: t,
|
|
@@ -270,20 +270,20 @@ ${t}`, d++;
|
|
|
270
270
|
reset: ne
|
|
271
271
|
};
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function M(e, t, n) {
|
|
274
274
|
return n === 100 && e.charCodeAt(t + 1) === 97 && e.charCodeAt(t + 2) === 116 && e.charCodeAt(t + 3) === 97 && e.charCodeAt(t + 4) === 58;
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function N(e, t, n) {
|
|
277
277
|
return n === 101 && e.charCodeAt(t + 1) === 118 && e.charCodeAt(t + 2) === 101 && e.charCodeAt(t + 3) === 110 && e.charCodeAt(t + 4) === 116 && e.charCodeAt(t + 5) === 58;
|
|
278
278
|
}
|
|
279
279
|
//#endregion
|
|
280
280
|
//#region ../../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/stream.js
|
|
281
|
-
var
|
|
281
|
+
var P = class extends TransformStream {
|
|
282
282
|
constructor({ onError: e, onRetry: t, onComment: n, maxBufferSize: r } = {}) {
|
|
283
283
|
let i;
|
|
284
284
|
super({
|
|
285
285
|
start(a) {
|
|
286
|
-
i =
|
|
286
|
+
i = Ie({
|
|
287
287
|
onEvent: (e) => {
|
|
288
288
|
a.enqueue(e);
|
|
289
289
|
},
|
|
@@ -302,8 +302,8 @@ var N = class extends TransformStream {
|
|
|
302
302
|
}
|
|
303
303
|
};
|
|
304
304
|
new TextDecoder();
|
|
305
|
-
var { btoa:
|
|
306
|
-
function
|
|
305
|
+
var { btoa: Le, atob: Re } = globalThis;
|
|
306
|
+
function F(e) {
|
|
307
307
|
if (e == null) return {};
|
|
308
308
|
let t = {};
|
|
309
309
|
if (e instanceof Headers) e.forEach((e, n) => {
|
|
@@ -315,35 +315,35 @@ function P(e) {
|
|
|
315
315
|
}
|
|
316
316
|
return t;
|
|
317
317
|
}
|
|
318
|
-
var
|
|
319
|
-
|
|
320
|
-
function
|
|
318
|
+
var ze = globalThis.fetch;
|
|
319
|
+
Be(ze);
|
|
320
|
+
function Be(e) {
|
|
321
321
|
if (typeof e != "function") return !1;
|
|
322
322
|
let t = Function.prototype.toString.call(e);
|
|
323
323
|
return t.includes("internal/deps/undici") || t.includes("lazy loading of undici");
|
|
324
324
|
}
|
|
325
|
-
var
|
|
325
|
+
var I = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
|
|
326
326
|
let i = () => {
|
|
327
327
|
let e = n.length, r = Array(t);
|
|
328
328
|
for (let i = 0; i < t; i++) r[i] = n[Math.random() * e | 0];
|
|
329
329
|
return r.join("");
|
|
330
330
|
};
|
|
331
331
|
if (e == null) return i;
|
|
332
|
-
if (n.includes(r)) throw new
|
|
332
|
+
if (n.includes(r)) throw new E({
|
|
333
333
|
argument: "separator",
|
|
334
334
|
message: `The separator "${r}" must not be part of the alphabet "${n}".`
|
|
335
335
|
});
|
|
336
336
|
return () => `${e}${r}${i()}`;
|
|
337
|
-
},
|
|
338
|
-
function
|
|
337
|
+
}, L = I();
|
|
338
|
+
function Ve(e) {
|
|
339
339
|
return globalThis.Buffer?.isBuffer(e) ?? !1;
|
|
340
340
|
}
|
|
341
|
-
var
|
|
342
|
-
function
|
|
341
|
+
var He = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, Ue = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
|
|
342
|
+
function We(e) {
|
|
343
343
|
let t = JSON.parse(e);
|
|
344
|
-
return typeof t != "object" || !t ||
|
|
344
|
+
return typeof t != "object" || !t || He.test(e) === !1 && Ue.test(e) === !1 ? t : Ge(t);
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function Ge(e) {
|
|
347
347
|
let t = [e];
|
|
348
348
|
for (; t.length;) {
|
|
349
349
|
let e = t;
|
|
@@ -358,35 +358,35 @@ function Ke(e) {
|
|
|
358
358
|
}
|
|
359
359
|
return e;
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function Ke(e) {
|
|
362
362
|
let { stackTraceLimit: t } = Error;
|
|
363
363
|
try {
|
|
364
364
|
Error.stackTraceLimit = 0;
|
|
365
365
|
} catch {
|
|
366
|
-
return
|
|
366
|
+
return We(e);
|
|
367
367
|
}
|
|
368
368
|
try {
|
|
369
|
-
return
|
|
369
|
+
return We(e);
|
|
370
370
|
} finally {
|
|
371
371
|
Error.stackTraceLimit = t;
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function qe(e) {
|
|
375
375
|
if (e.type === "object" || Array.isArray(e.type) && e.type.includes("object")) {
|
|
376
376
|
let { additionalProperties: t } = e;
|
|
377
|
-
e.additionalProperties = t != null && typeof t != "boolean" &&
|
|
377
|
+
e.additionalProperties = t != null && typeof t != "boolean" && R(t);
|
|
378
378
|
let { properties: n } = e;
|
|
379
|
-
if (n != null) for (let e of Object.keys(n)) n[e] =
|
|
379
|
+
if (n != null) for (let e of Object.keys(n)) n[e] = R(n[e]);
|
|
380
380
|
}
|
|
381
|
-
e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(
|
|
381
|
+
e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(R) : R(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(R)), e.allOf != null && (e.allOf = e.allOf.map(R)), e.oneOf != null && (e.oneOf = e.oneOf.map(R));
|
|
382
382
|
let { definitions: t } = e;
|
|
383
|
-
if (t != null) for (let e of Object.keys(t)) t[e] =
|
|
383
|
+
if (t != null) for (let e of Object.keys(t)) t[e] = R(t[e]);
|
|
384
384
|
return e;
|
|
385
385
|
}
|
|
386
|
-
function
|
|
387
|
-
return typeof e == "boolean" ? e :
|
|
386
|
+
function R(e) {
|
|
387
|
+
return typeof e == "boolean" ? e : qe(e);
|
|
388
388
|
}
|
|
389
|
-
var
|
|
389
|
+
var Je = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use"), Ye = {
|
|
390
390
|
name: void 0,
|
|
391
391
|
$refStrategy: "root",
|
|
392
392
|
basePath: ["#"],
|
|
@@ -406,24 +406,24 @@ var Ye = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to u
|
|
|
406
406
|
emailStrategy: "format:email",
|
|
407
407
|
base64Strategy: "contentEncoding:base64",
|
|
408
408
|
nameStrategy: "ref"
|
|
409
|
-
},
|
|
410
|
-
...
|
|
409
|
+
}, Xe = (e) => typeof e == "string" ? {
|
|
410
|
+
...Ye,
|
|
411
411
|
name: e
|
|
412
412
|
} : {
|
|
413
|
-
...
|
|
413
|
+
...Ye,
|
|
414
414
|
...e
|
|
415
415
|
};
|
|
416
|
-
function
|
|
416
|
+
function z() {
|
|
417
417
|
return {};
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function Ze(e, t) {
|
|
420
420
|
let n = { type: "array" };
|
|
421
|
-
return e.type?._def && e.type?._def?.typeName !== "ZodAny" && (n.items =
|
|
421
|
+
return e.type?._def && e.type?._def?.typeName !== "ZodAny" && (n.items = W(e.type._def, {
|
|
422
422
|
...t,
|
|
423
423
|
currentPath: [...t.currentPath, "items"]
|
|
424
424
|
})), e.minLength && (n.minItems = e.minLength.value), e.maxLength && (n.maxItems = e.maxLength.value), e.exactLength && (n.minItems = e.exactLength.value, n.maxItems = e.exactLength.value), n;
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function Qe(e) {
|
|
427
427
|
let t = {
|
|
428
428
|
type: "integer",
|
|
429
429
|
format: "int64"
|
|
@@ -440,16 +440,16 @@ function $e(e) {
|
|
|
440
440
|
}
|
|
441
441
|
return t;
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function $e() {
|
|
444
444
|
return { type: "boolean" };
|
|
445
445
|
}
|
|
446
|
-
function
|
|
447
|
-
return
|
|
446
|
+
function et(e, t) {
|
|
447
|
+
return W(e.type._def, t);
|
|
448
448
|
}
|
|
449
|
-
var
|
|
450
|
-
function
|
|
449
|
+
var tt = (e, t) => W(e.innerType._def, t);
|
|
450
|
+
function nt(e, t, n) {
|
|
451
451
|
let r = n ?? t.dateStrategy;
|
|
452
|
-
if (Array.isArray(r)) return { anyOf: r.map((n) =>
|
|
452
|
+
if (Array.isArray(r)) return { anyOf: r.map((n) => nt(e, t, n)) };
|
|
453
453
|
switch (r) {
|
|
454
454
|
case "string":
|
|
455
455
|
case "format:date-time": return {
|
|
@@ -460,10 +460,10 @@ function rt(e, t, n) {
|
|
|
460
460
|
type: "string",
|
|
461
461
|
format: "date"
|
|
462
462
|
};
|
|
463
|
-
case "integer": return
|
|
463
|
+
case "integer": return rt(e);
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
var
|
|
466
|
+
var rt = (e) => {
|
|
467
467
|
let t = {
|
|
468
468
|
type: "integer",
|
|
469
469
|
format: "unix-time"
|
|
@@ -476,31 +476,31 @@ var it = (e) => {
|
|
|
476
476
|
}
|
|
477
477
|
return t;
|
|
478
478
|
};
|
|
479
|
-
function
|
|
479
|
+
function it(e, t) {
|
|
480
480
|
return {
|
|
481
|
-
...
|
|
481
|
+
...W(e.innerType._def, t),
|
|
482
482
|
default: e.defaultValue()
|
|
483
483
|
};
|
|
484
484
|
}
|
|
485
|
-
function
|
|
486
|
-
return t.effectStrategy === "input" ?
|
|
485
|
+
function at(e, t) {
|
|
486
|
+
return t.effectStrategy === "input" ? W(e.schema._def, t) : z();
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function ot(e) {
|
|
489
489
|
return {
|
|
490
490
|
type: "string",
|
|
491
491
|
enum: Array.from(e.values)
|
|
492
492
|
};
|
|
493
493
|
}
|
|
494
|
-
var
|
|
495
|
-
function
|
|
496
|
-
let n = [
|
|
494
|
+
var st = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
|
|
495
|
+
function B(e, t) {
|
|
496
|
+
let n = [W(e.left._def, {
|
|
497
497
|
...t,
|
|
498
498
|
currentPath: [
|
|
499
499
|
...t.currentPath,
|
|
500
500
|
"allOf",
|
|
501
501
|
"0"
|
|
502
502
|
]
|
|
503
|
-
}),
|
|
503
|
+
}), W(e.right._def, {
|
|
504
504
|
...t,
|
|
505
505
|
currentPath: [
|
|
506
506
|
...t.currentPath,
|
|
@@ -509,7 +509,7 @@ function z(e, t) {
|
|
|
509
509
|
]
|
|
510
510
|
})].filter((e) => !!e), r = [];
|
|
511
511
|
return n.forEach((e) => {
|
|
512
|
-
if (
|
|
512
|
+
if (st(e)) r.push(...e.allOf);
|
|
513
513
|
else {
|
|
514
514
|
let t = e;
|
|
515
515
|
if ("additionalProperties" in e && e.additionalProperties === !1) {
|
|
@@ -520,19 +520,19 @@ function z(e, t) {
|
|
|
520
520
|
}
|
|
521
521
|
}), r.length ? { allOf: r } : void 0;
|
|
522
522
|
}
|
|
523
|
-
function
|
|
523
|
+
function ct(e) {
|
|
524
524
|
let t = typeof e.value;
|
|
525
525
|
return t !== "bigint" && t !== "number" && t !== "boolean" && t !== "string" ? { type: Array.isArray(e.value) ? "array" : "object" } : {
|
|
526
526
|
type: t === "bigint" ? "integer" : t,
|
|
527
527
|
const: e.value
|
|
528
528
|
};
|
|
529
529
|
}
|
|
530
|
-
var
|
|
530
|
+
var lt = void 0, V = {
|
|
531
531
|
cuid: /^[cC][^\s-]{8,}$/,
|
|
532
532
|
cuid2: /^[0-9a-z]+$/,
|
|
533
533
|
ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
|
|
534
534
|
email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
|
|
535
|
-
emoji: () => (
|
|
535
|
+
emoji: () => (lt === void 0 && (lt = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), lt),
|
|
536
536
|
uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,
|
|
537
537
|
ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
|
|
538
538
|
ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
|
|
@@ -543,7 +543,7 @@ var ut = void 0, B = {
|
|
|
543
543
|
nanoid: /^[a-zA-Z0-9_-]{21}$/,
|
|
544
544
|
jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
|
|
545
545
|
};
|
|
546
|
-
function
|
|
546
|
+
function ut(e, t) {
|
|
547
547
|
let n = { type: "string" };
|
|
548
548
|
if (e.checks) for (let r of e.checks) switch (r.kind) {
|
|
549
549
|
case "min":
|
|
@@ -555,108 +555,108 @@ function dt(e, t) {
|
|
|
555
555
|
case "email":
|
|
556
556
|
switch (t.emailStrategy) {
|
|
557
557
|
case "format:email":
|
|
558
|
-
|
|
558
|
+
H(n, "email", r.message, t);
|
|
559
559
|
break;
|
|
560
560
|
case "format:idn-email":
|
|
561
|
-
|
|
561
|
+
H(n, "idn-email", r.message, t);
|
|
562
562
|
break;
|
|
563
|
-
case "pattern:zod":
|
|
563
|
+
case "pattern:zod": U(n, V.email, r.message, t);
|
|
564
564
|
}
|
|
565
565
|
break;
|
|
566
566
|
case "url":
|
|
567
|
-
|
|
567
|
+
H(n, "uri", r.message, t);
|
|
568
568
|
break;
|
|
569
569
|
case "uuid":
|
|
570
|
-
|
|
570
|
+
H(n, "uuid", r.message, t);
|
|
571
571
|
break;
|
|
572
572
|
case "regex":
|
|
573
|
-
|
|
573
|
+
U(n, r.regex, r.message, t);
|
|
574
574
|
break;
|
|
575
575
|
case "cuid":
|
|
576
|
-
|
|
576
|
+
U(n, V.cuid, r.message, t);
|
|
577
577
|
break;
|
|
578
578
|
case "cuid2":
|
|
579
|
-
|
|
579
|
+
U(n, V.cuid2, r.message, t);
|
|
580
580
|
break;
|
|
581
581
|
case "startsWith":
|
|
582
|
-
|
|
582
|
+
U(n, RegExp(`^${dt(r.value, t)}`), r.message, t);
|
|
583
583
|
break;
|
|
584
584
|
case "endsWith":
|
|
585
|
-
|
|
585
|
+
U(n, RegExp(`${dt(r.value, t)}$`), r.message, t);
|
|
586
586
|
break;
|
|
587
587
|
case "datetime":
|
|
588
|
-
|
|
588
|
+
H(n, "date-time", r.message, t);
|
|
589
589
|
break;
|
|
590
590
|
case "date":
|
|
591
|
-
|
|
591
|
+
H(n, "date", r.message, t);
|
|
592
592
|
break;
|
|
593
593
|
case "time":
|
|
594
|
-
|
|
594
|
+
H(n, "time", r.message, t);
|
|
595
595
|
break;
|
|
596
596
|
case "duration":
|
|
597
|
-
|
|
597
|
+
H(n, "duration", r.message, t);
|
|
598
598
|
break;
|
|
599
599
|
case "length":
|
|
600
600
|
n.minLength = typeof n.minLength == "number" ? Math.max(n.minLength, r.value) : r.value, n.maxLength = typeof n.maxLength == "number" ? Math.min(n.maxLength, r.value) : r.value;
|
|
601
601
|
break;
|
|
602
602
|
case "includes":
|
|
603
|
-
|
|
603
|
+
U(n, RegExp(dt(r.value, t)), r.message, t);
|
|
604
604
|
break;
|
|
605
605
|
case "ip":
|
|
606
|
-
r.version !== "v6" &&
|
|
606
|
+
r.version !== "v6" && H(n, "ipv4", r.message, t), r.version !== "v4" && H(n, "ipv6", r.message, t);
|
|
607
607
|
break;
|
|
608
608
|
case "base64url":
|
|
609
|
-
|
|
609
|
+
U(n, V.base64url, r.message, t);
|
|
610
610
|
break;
|
|
611
611
|
case "jwt":
|
|
612
|
-
|
|
612
|
+
U(n, V.jwt, r.message, t);
|
|
613
613
|
break;
|
|
614
614
|
case "cidr":
|
|
615
|
-
r.version !== "v6" &&
|
|
615
|
+
r.version !== "v6" && U(n, V.ipv4Cidr, r.message, t), r.version !== "v4" && U(n, V.ipv6Cidr, r.message, t);
|
|
616
616
|
break;
|
|
617
617
|
case "emoji":
|
|
618
|
-
|
|
618
|
+
U(n, V.emoji(), r.message, t);
|
|
619
619
|
break;
|
|
620
620
|
case "ulid":
|
|
621
|
-
|
|
621
|
+
U(n, V.ulid, r.message, t);
|
|
622
622
|
break;
|
|
623
623
|
case "base64":
|
|
624
624
|
switch (t.base64Strategy) {
|
|
625
625
|
case "format:binary":
|
|
626
|
-
|
|
626
|
+
H(n, "binary", r.message, t);
|
|
627
627
|
break;
|
|
628
628
|
case "contentEncoding:base64":
|
|
629
629
|
n.contentEncoding = "base64";
|
|
630
630
|
break;
|
|
631
|
-
case "pattern:zod":
|
|
631
|
+
case "pattern:zod": U(n, V.base64, r.message, t);
|
|
632
632
|
}
|
|
633
633
|
break;
|
|
634
|
-
case "nanoid":
|
|
634
|
+
case "nanoid": U(n, V.nanoid, r.message, t);
|
|
635
635
|
}
|
|
636
636
|
return n;
|
|
637
637
|
}
|
|
638
|
-
function
|
|
639
|
-
return t.patternStrategy === "escape" ?
|
|
638
|
+
function dt(e, t) {
|
|
639
|
+
return t.patternStrategy === "escape" ? pt(e) : e;
|
|
640
640
|
}
|
|
641
|
-
var
|
|
642
|
-
function
|
|
641
|
+
var ft = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
|
|
642
|
+
function pt(e) {
|
|
643
643
|
let t = "";
|
|
644
|
-
for (let n = 0; n < e.length; n++)
|
|
644
|
+
for (let n = 0; n < e.length; n++) ft.has(e[n]) || (t += "\\"), t += e[n];
|
|
645
645
|
return t;
|
|
646
646
|
}
|
|
647
|
-
function
|
|
647
|
+
function H(e, t, n, r) {
|
|
648
648
|
e.format || e.anyOf?.some((e) => e.format) ? (e.anyOf ||= [], e.format && (e.anyOf.push({ format: e.format }), delete e.format), e.anyOf.push({
|
|
649
649
|
format: t,
|
|
650
650
|
...n && r.errorMessages && { errorMessage: { format: n } }
|
|
651
651
|
})) : e.format = t;
|
|
652
652
|
}
|
|
653
|
-
function
|
|
653
|
+
function U(e, t, n, r) {
|
|
654
654
|
e.pattern || e.allOf?.some((e) => e.pattern) ? (e.allOf ||= [], e.pattern && (e.allOf.push({ pattern: e.pattern }), delete e.pattern), e.allOf.push({
|
|
655
|
-
pattern:
|
|
655
|
+
pattern: mt(t, r),
|
|
656
656
|
...n && r.errorMessages && { errorMessage: { pattern: n } }
|
|
657
|
-
})) : e.pattern =
|
|
657
|
+
})) : e.pattern = mt(t, r);
|
|
658
658
|
}
|
|
659
|
-
function
|
|
659
|
+
function mt(e, t) {
|
|
660
660
|
if (!t.applyRegexFlags || !e.flags) return e.source;
|
|
661
661
|
let n = {
|
|
662
662
|
i: e.flags.includes("i"),
|
|
@@ -704,16 +704,16 @@ function ht(e, t) {
|
|
|
704
704
|
}
|
|
705
705
|
return i;
|
|
706
706
|
}
|
|
707
|
-
function
|
|
707
|
+
function ht(e, t) {
|
|
708
708
|
let n = {
|
|
709
709
|
type: "object",
|
|
710
|
-
additionalProperties:
|
|
710
|
+
additionalProperties: W(e.valueType._def, {
|
|
711
711
|
...t,
|
|
712
712
|
currentPath: [...t.currentPath, "additionalProperties"]
|
|
713
713
|
}) ?? t.allowedAdditionalProperties
|
|
714
714
|
};
|
|
715
715
|
if (e.keyType?._def.typeName === "ZodString" && e.keyType._def.checks?.length) {
|
|
716
|
-
let { type: r, ...i } =
|
|
716
|
+
let { type: r, ...i } = ut(e.keyType._def, t);
|
|
717
717
|
return {
|
|
718
718
|
...n,
|
|
719
719
|
propertyNames: i
|
|
@@ -724,7 +724,7 @@ function gt(e, t) {
|
|
|
724
724
|
propertyNames: { enum: e.keyType._def.values }
|
|
725
725
|
};
|
|
726
726
|
if (e.keyType?._def.typeName === "ZodBranded" && e.keyType._def.type._def.typeName === "ZodString" && e.keyType._def.type._def.checks?.length) {
|
|
727
|
-
let { type: r, ...i } =
|
|
727
|
+
let { type: r, ...i } = et(e.keyType._def, t);
|
|
728
728
|
return {
|
|
729
729
|
...n,
|
|
730
730
|
propertyNames: i
|
|
@@ -732,13 +732,13 @@ function gt(e, t) {
|
|
|
732
732
|
}
|
|
733
733
|
return n;
|
|
734
734
|
}
|
|
735
|
-
function
|
|
736
|
-
return t.mapStrategy === "record" ?
|
|
735
|
+
function gt(e, t) {
|
|
736
|
+
return t.mapStrategy === "record" ? ht(e, t) : {
|
|
737
737
|
type: "array",
|
|
738
738
|
maxItems: 125,
|
|
739
739
|
items: {
|
|
740
740
|
type: "array",
|
|
741
|
-
items: [
|
|
741
|
+
items: [W(e.keyType._def, {
|
|
742
742
|
...t,
|
|
743
743
|
currentPath: [
|
|
744
744
|
...t.currentPath,
|
|
@@ -746,7 +746,7 @@ function _t(e, t) {
|
|
|
746
746
|
"items",
|
|
747
747
|
"0"
|
|
748
748
|
]
|
|
749
|
-
}) ||
|
|
749
|
+
}) || z(), W(e.valueType._def, {
|
|
750
750
|
...t,
|
|
751
751
|
currentPath: [
|
|
752
752
|
...t.currentPath,
|
|
@@ -754,37 +754,37 @@ function _t(e, t) {
|
|
|
754
754
|
"items",
|
|
755
755
|
"1"
|
|
756
756
|
]
|
|
757
|
-
}) ||
|
|
757
|
+
}) || z()],
|
|
758
758
|
minItems: 2,
|
|
759
759
|
maxItems: 2
|
|
760
760
|
}
|
|
761
761
|
};
|
|
762
762
|
}
|
|
763
|
-
function
|
|
763
|
+
function _t(e) {
|
|
764
764
|
let t = e.values, n = Object.keys(e.values).filter((e) => typeof t[t[e]] != "number").map((e) => t[e]), r = Array.from(new Set(n.map((e) => typeof e)));
|
|
765
765
|
return {
|
|
766
766
|
type: r.length === 1 ? r[0] === "string" ? "string" : "number" : ["string", "number"],
|
|
767
767
|
enum: n
|
|
768
768
|
};
|
|
769
769
|
}
|
|
770
|
-
function
|
|
771
|
-
return { not:
|
|
770
|
+
function vt() {
|
|
771
|
+
return { not: z() };
|
|
772
772
|
}
|
|
773
|
-
function
|
|
773
|
+
function yt() {
|
|
774
774
|
return { type: "null" };
|
|
775
775
|
}
|
|
776
|
-
var
|
|
776
|
+
var bt = {
|
|
777
777
|
ZodString: "string",
|
|
778
778
|
ZodNumber: "number",
|
|
779
779
|
ZodBigInt: "integer",
|
|
780
780
|
ZodBoolean: "boolean",
|
|
781
781
|
ZodNull: "null"
|
|
782
782
|
};
|
|
783
|
-
function
|
|
783
|
+
function xt(e, t) {
|
|
784
784
|
let n = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
|
|
785
|
-
if (n.every((e) => e._def.typeName in
|
|
785
|
+
if (n.every((e) => e._def.typeName in bt && (!e._def.checks || !e._def.checks.length))) {
|
|
786
786
|
let e = n.reduce((e, t) => {
|
|
787
|
-
let n =
|
|
787
|
+
let n = bt[t._def.typeName];
|
|
788
788
|
return n && !e.includes(n) ? [...e, n] : e;
|
|
789
789
|
}, []);
|
|
790
790
|
return { type: e.length > 1 ? e : e[0] };
|
|
@@ -812,10 +812,10 @@ function St(e, t) {
|
|
|
812
812
|
type: "string",
|
|
813
813
|
enum: n.reduce((e, t) => [...e, ...t._def.values.filter((t) => !e.includes(t))], [])
|
|
814
814
|
};
|
|
815
|
-
return
|
|
815
|
+
return St(e, t);
|
|
816
816
|
}
|
|
817
|
-
var
|
|
818
|
-
let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) =>
|
|
817
|
+
var St = (e, t) => {
|
|
818
|
+
let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => W(e._def, {
|
|
819
819
|
...t,
|
|
820
820
|
currentPath: [
|
|
821
821
|
...t.currentPath,
|
|
@@ -825,15 +825,15 @@ var Ct = (e, t) => {
|
|
|
825
825
|
})).filter((e) => !!e && (!t.strictUnions || typeof e == "object" && Object.keys(e).length > 0));
|
|
826
826
|
return n.length ? { anyOf: n } : void 0;
|
|
827
827
|
};
|
|
828
|
-
function
|
|
828
|
+
function Ct(e, t) {
|
|
829
829
|
if ([
|
|
830
830
|
"ZodString",
|
|
831
831
|
"ZodNumber",
|
|
832
832
|
"ZodBigInt",
|
|
833
833
|
"ZodBoolean",
|
|
834
834
|
"ZodNull"
|
|
835
|
-
].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [
|
|
836
|
-
let n =
|
|
835
|
+
].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [bt[e.innerType._def.typeName], "null"] };
|
|
836
|
+
let n = W(e.innerType._def, {
|
|
837
837
|
...t,
|
|
838
838
|
currentPath: [
|
|
839
839
|
...t.currentPath,
|
|
@@ -843,7 +843,7 @@ function wt(e, t) {
|
|
|
843
843
|
});
|
|
844
844
|
return n && { anyOf: [n, { type: "null" }] };
|
|
845
845
|
}
|
|
846
|
-
function
|
|
846
|
+
function wt(e) {
|
|
847
847
|
let t = { type: "number" };
|
|
848
848
|
if (!e.checks) return t;
|
|
849
849
|
for (let n of e.checks) switch (n.kind) {
|
|
@@ -860,7 +860,7 @@ function Tt(e) {
|
|
|
860
860
|
}
|
|
861
861
|
return t;
|
|
862
862
|
}
|
|
863
|
-
function
|
|
863
|
+
function Tt(e, t) {
|
|
864
864
|
let n = {
|
|
865
865
|
type: "object",
|
|
866
866
|
properties: {}
|
|
@@ -868,7 +868,7 @@ function Et(e, t) {
|
|
|
868
868
|
for (let e in i) {
|
|
869
869
|
let a = i[e];
|
|
870
870
|
if (a === void 0 || a._def === void 0) continue;
|
|
871
|
-
let o =
|
|
871
|
+
let o = Dt(a), s = W(a._def, {
|
|
872
872
|
...t,
|
|
873
873
|
currentPath: [
|
|
874
874
|
...t.currentPath,
|
|
@@ -884,11 +884,11 @@ function Et(e, t) {
|
|
|
884
884
|
s !== void 0 && (n.properties[e] = s, o || r.push(e));
|
|
885
885
|
}
|
|
886
886
|
r.length && (n.required = r);
|
|
887
|
-
let a =
|
|
887
|
+
let a = Et(e, t);
|
|
888
888
|
return a !== void 0 && (n.additionalProperties = a), n;
|
|
889
889
|
}
|
|
890
|
-
function
|
|
891
|
-
if (e.catchall._def.typeName !== "ZodNever") return
|
|
890
|
+
function Et(e, t) {
|
|
891
|
+
if (e.catchall._def.typeName !== "ZodNever") return W(e.catchall._def, {
|
|
892
892
|
...t,
|
|
893
893
|
currentPath: [...t.currentPath, "additionalProperties"]
|
|
894
894
|
});
|
|
@@ -898,16 +898,16 @@ function Dt(e, t) {
|
|
|
898
898
|
case "strip": return t.removeAdditionalStrategy === "strict" ? t.allowedAdditionalProperties : t.rejectedAdditionalProperties;
|
|
899
899
|
}
|
|
900
900
|
}
|
|
901
|
-
function
|
|
901
|
+
function Dt(e) {
|
|
902
902
|
try {
|
|
903
903
|
return e.isOptional();
|
|
904
904
|
} catch {
|
|
905
905
|
return !0;
|
|
906
906
|
}
|
|
907
907
|
}
|
|
908
|
-
var
|
|
909
|
-
if (t.currentPath.toString() === t.propertyPath?.toString()) return
|
|
910
|
-
let n =
|
|
908
|
+
var Ot = (e, t) => {
|
|
909
|
+
if (t.currentPath.toString() === t.propertyPath?.toString()) return W(e.innerType._def, t);
|
|
910
|
+
let n = W(e.innerType._def, {
|
|
911
911
|
...t,
|
|
912
912
|
currentPath: [
|
|
913
913
|
...t.currentPath,
|
|
@@ -915,11 +915,11 @@ var kt = (e, t) => {
|
|
|
915
915
|
"1"
|
|
916
916
|
]
|
|
917
917
|
});
|
|
918
|
-
return n ? { anyOf: [{ not:
|
|
919
|
-
},
|
|
920
|
-
if (t.pipeStrategy === "input") return
|
|
921
|
-
if (t.pipeStrategy === "output") return
|
|
922
|
-
let n =
|
|
918
|
+
return n ? { anyOf: [{ not: z() }, n] } : z();
|
|
919
|
+
}, kt = (e, t) => {
|
|
920
|
+
if (t.pipeStrategy === "input") return W(e.in._def, t);
|
|
921
|
+
if (t.pipeStrategy === "output") return W(e.out._def, t);
|
|
922
|
+
let n = W(e.in._def, {
|
|
923
923
|
...t,
|
|
924
924
|
currentPath: [
|
|
925
925
|
...t.currentPath,
|
|
@@ -927,7 +927,7 @@ var kt = (e, t) => {
|
|
|
927
927
|
"0"
|
|
928
928
|
]
|
|
929
929
|
});
|
|
930
|
-
return { allOf: [n,
|
|
930
|
+
return { allOf: [n, W(e.out._def, {
|
|
931
931
|
...t,
|
|
932
932
|
currentPath: [
|
|
933
933
|
...t.currentPath,
|
|
@@ -936,25 +936,25 @@ var kt = (e, t) => {
|
|
|
936
936
|
]
|
|
937
937
|
})].filter((e) => e !== void 0) };
|
|
938
938
|
};
|
|
939
|
-
function
|
|
940
|
-
return
|
|
939
|
+
function At(e, t) {
|
|
940
|
+
return W(e.type._def, t);
|
|
941
941
|
}
|
|
942
|
-
function
|
|
942
|
+
function jt(e, t) {
|
|
943
943
|
let n = {
|
|
944
944
|
type: "array",
|
|
945
945
|
uniqueItems: !0,
|
|
946
|
-
items:
|
|
946
|
+
items: W(e.valueType._def, {
|
|
947
947
|
...t,
|
|
948
948
|
currentPath: [...t.currentPath, "items"]
|
|
949
949
|
})
|
|
950
950
|
};
|
|
951
951
|
return e.minSize && (n.minItems = e.minSize.value), e.maxSize && (n.maxItems = e.maxSize.value), n;
|
|
952
952
|
}
|
|
953
|
-
function
|
|
953
|
+
function Mt(e, t) {
|
|
954
954
|
return e.rest ? {
|
|
955
955
|
type: "array",
|
|
956
956
|
minItems: e.items.length,
|
|
957
|
-
items: e.items.map((e, n) =>
|
|
957
|
+
items: e.items.map((e, n) => W(e._def, {
|
|
958
958
|
...t,
|
|
959
959
|
currentPath: [
|
|
960
960
|
...t.currentPath,
|
|
@@ -962,7 +962,7 @@ function Nt(e, t) {
|
|
|
962
962
|
`${n}`
|
|
963
963
|
]
|
|
964
964
|
})).reduce((e, t) => t === void 0 ? e : [...e, t], []),
|
|
965
|
-
additionalItems:
|
|
965
|
+
additionalItems: W(e.rest._def, {
|
|
966
966
|
...t,
|
|
967
967
|
currentPath: [...t.currentPath, "additionalItems"]
|
|
968
968
|
})
|
|
@@ -970,7 +970,7 @@ function Nt(e, t) {
|
|
|
970
970
|
type: "array",
|
|
971
971
|
minItems: e.items.length,
|
|
972
972
|
maxItems: e.items.length,
|
|
973
|
-
items: e.items.map((e, n) =>
|
|
973
|
+
items: e.items.map((e, n) => W(e._def, {
|
|
974
974
|
...t,
|
|
975
975
|
currentPath: [
|
|
976
976
|
...t.currentPath,
|
|
@@ -980,65 +980,65 @@ function Nt(e, t) {
|
|
|
980
980
|
})).reduce((e, t) => t === void 0 ? e : [...e, t], [])
|
|
981
981
|
};
|
|
982
982
|
}
|
|
983
|
-
function
|
|
984
|
-
return { not:
|
|
983
|
+
function Nt() {
|
|
984
|
+
return { not: z() };
|
|
985
985
|
}
|
|
986
|
-
function
|
|
987
|
-
return
|
|
986
|
+
function Pt() {
|
|
987
|
+
return z();
|
|
988
988
|
}
|
|
989
|
-
var
|
|
989
|
+
var Ft = (e, t) => W(e.innerType._def, t), It = (e, t, n) => {
|
|
990
990
|
switch (t) {
|
|
991
|
-
case "ZodString": return
|
|
992
|
-
case "ZodNumber": return
|
|
993
|
-
case "ZodObject": return
|
|
994
|
-
case "ZodBigInt": return
|
|
995
|
-
case "ZodBoolean": return
|
|
996
|
-
case "ZodDate": return
|
|
997
|
-
case "ZodUndefined": return
|
|
998
|
-
case "ZodNull": return
|
|
999
|
-
case "ZodArray": return
|
|
991
|
+
case "ZodString": return ut(e, n);
|
|
992
|
+
case "ZodNumber": return wt(e);
|
|
993
|
+
case "ZodObject": return Tt(e, n);
|
|
994
|
+
case "ZodBigInt": return Qe(e);
|
|
995
|
+
case "ZodBoolean": return $e();
|
|
996
|
+
case "ZodDate": return nt(e, n);
|
|
997
|
+
case "ZodUndefined": return Nt();
|
|
998
|
+
case "ZodNull": return yt();
|
|
999
|
+
case "ZodArray": return Ze(e, n);
|
|
1000
1000
|
case "ZodUnion":
|
|
1001
|
-
case "ZodDiscriminatedUnion": return
|
|
1002
|
-
case "ZodIntersection": return
|
|
1003
|
-
case "ZodTuple": return
|
|
1004
|
-
case "ZodRecord": return
|
|
1005
|
-
case "ZodLiteral": return
|
|
1006
|
-
case "ZodEnum": return
|
|
1007
|
-
case "ZodNativeEnum": return
|
|
1008
|
-
case "ZodNullable": return
|
|
1009
|
-
case "ZodOptional": return
|
|
1010
|
-
case "ZodMap": return
|
|
1011
|
-
case "ZodSet": return
|
|
1001
|
+
case "ZodDiscriminatedUnion": return xt(e, n);
|
|
1002
|
+
case "ZodIntersection": return B(e, n);
|
|
1003
|
+
case "ZodTuple": return Mt(e, n);
|
|
1004
|
+
case "ZodRecord": return ht(e, n);
|
|
1005
|
+
case "ZodLiteral": return ct(e);
|
|
1006
|
+
case "ZodEnum": return ot(e);
|
|
1007
|
+
case "ZodNativeEnum": return _t(e);
|
|
1008
|
+
case "ZodNullable": return Ct(e, n);
|
|
1009
|
+
case "ZodOptional": return Ot(e, n);
|
|
1010
|
+
case "ZodMap": return gt(e, n);
|
|
1011
|
+
case "ZodSet": return jt(e, n);
|
|
1012
1012
|
case "ZodLazy": return () => e.getter()._def;
|
|
1013
|
-
case "ZodPromise": return
|
|
1013
|
+
case "ZodPromise": return At(e, n);
|
|
1014
1014
|
case "ZodNaN":
|
|
1015
|
-
case "ZodNever": return
|
|
1016
|
-
case "ZodEffects": return
|
|
1017
|
-
case "ZodAny": return
|
|
1018
|
-
case "ZodUnknown": return
|
|
1019
|
-
case "ZodDefault": return
|
|
1020
|
-
case "ZodBranded": return
|
|
1021
|
-
case "ZodReadonly": return
|
|
1022
|
-
case "ZodCatch": return
|
|
1023
|
-
case "ZodPipeline": return
|
|
1015
|
+
case "ZodNever": return vt();
|
|
1016
|
+
case "ZodEffects": return at(e, n);
|
|
1017
|
+
case "ZodAny": return z();
|
|
1018
|
+
case "ZodUnknown": return Pt();
|
|
1019
|
+
case "ZodDefault": return it(e, n);
|
|
1020
|
+
case "ZodBranded": return et(e, n);
|
|
1021
|
+
case "ZodReadonly": return Ft(e, n);
|
|
1022
|
+
case "ZodCatch": return tt(e, n);
|
|
1023
|
+
case "ZodPipeline": return kt(e, n);
|
|
1024
1024
|
case "ZodFunction":
|
|
1025
1025
|
case "ZodVoid":
|
|
1026
1026
|
case "ZodSymbol": return;
|
|
1027
1027
|
default: return /* @__PURE__ */ ((e) => void 0)(t);
|
|
1028
1028
|
}
|
|
1029
|
-
},
|
|
1029
|
+
}, Lt = (e, t) => {
|
|
1030
1030
|
let n = 0;
|
|
1031
1031
|
for (; n < e.length && n < t.length && e[n] === t[n]; n++);
|
|
1032
1032
|
return [(e.length - n).toString(), ...t.slice(n)].join("/");
|
|
1033
1033
|
};
|
|
1034
|
-
function
|
|
1034
|
+
function W(e, t, n = !1) {
|
|
1035
1035
|
let r = t.seen.get(e);
|
|
1036
1036
|
if (t.override) {
|
|
1037
1037
|
let i = t.override?.call(t, e, t, r, n);
|
|
1038
|
-
if (i !==
|
|
1038
|
+
if (i !== Je) return i;
|
|
1039
1039
|
}
|
|
1040
1040
|
if (r && !n) {
|
|
1041
|
-
let e =
|
|
1041
|
+
let e = Rt(r, t);
|
|
1042
1042
|
if (e !== void 0) return e;
|
|
1043
1043
|
}
|
|
1044
1044
|
let i = {
|
|
@@ -1047,22 +1047,22 @@ function U(e, t, n = !1) {
|
|
|
1047
1047
|
jsonSchema: void 0
|
|
1048
1048
|
};
|
|
1049
1049
|
t.seen.set(e, i);
|
|
1050
|
-
let a =
|
|
1051
|
-
if (o &&
|
|
1050
|
+
let a = It(e, e.typeName, t), o = typeof a == "function" ? W(a(), t) : a;
|
|
1051
|
+
if (o && zt(e, t, o), t.postProcess) {
|
|
1052
1052
|
let n = t.postProcess(o, e, t);
|
|
1053
1053
|
return i.jsonSchema = o, n;
|
|
1054
1054
|
}
|
|
1055
1055
|
return i.jsonSchema = o, o;
|
|
1056
1056
|
}
|
|
1057
|
-
var
|
|
1057
|
+
var Rt = (e, t) => {
|
|
1058
1058
|
switch (t.$refStrategy) {
|
|
1059
1059
|
case "root": return { $ref: e.path.join("/") };
|
|
1060
|
-
case "relative": return { $ref:
|
|
1060
|
+
case "relative": return { $ref: Lt(t.currentPath, e.path) };
|
|
1061
1061
|
case "none":
|
|
1062
|
-
case "seen": return e.path.length < t.currentPath.length && e.path.every((e, n) => t.currentPath[n] === e) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),
|
|
1062
|
+
case "seen": return e.path.length < t.currentPath.length && e.path.every((e, n) => t.currentPath[n] === e) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`), z()) : t.$refStrategy === "seen" ? z() : void 0;
|
|
1063
1063
|
}
|
|
1064
|
-
},
|
|
1065
|
-
let t =
|
|
1064
|
+
}, zt = (e, t, n) => (e.description && (n.description = e.description), n), Bt = (e) => {
|
|
1065
|
+
let t = Xe(e), n = t.name === void 0 ? t.basePath : [
|
|
1066
1066
|
...t.basePath,
|
|
1067
1067
|
t.definitionPath,
|
|
1068
1068
|
t.name
|
|
@@ -1081,25 +1081,25 @@ var zt = (e, t) => {
|
|
|
1081
1081
|
jsonSchema: void 0
|
|
1082
1082
|
}]))
|
|
1083
1083
|
};
|
|
1084
|
-
},
|
|
1085
|
-
let n =
|
|
1084
|
+
}, Vt = (e, t) => {
|
|
1085
|
+
let n = Bt(t), r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({
|
|
1086
1086
|
...e,
|
|
1087
|
-
[t]:
|
|
1087
|
+
[t]: W(r._def, {
|
|
1088
1088
|
...n,
|
|
1089
1089
|
currentPath: [
|
|
1090
1090
|
...n.basePath,
|
|
1091
1091
|
n.definitionPath,
|
|
1092
1092
|
t
|
|
1093
1093
|
]
|
|
1094
|
-
}, !0) ??
|
|
1095
|
-
}), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a =
|
|
1094
|
+
}, !0) ?? z()
|
|
1095
|
+
}), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = W(e._def, i === void 0 ? n : {
|
|
1096
1096
|
...n,
|
|
1097
1097
|
currentPath: [
|
|
1098
1098
|
...n.basePath,
|
|
1099
1099
|
n.definitionPath,
|
|
1100
1100
|
i
|
|
1101
1101
|
]
|
|
1102
|
-
}, !1) ??
|
|
1102
|
+
}, !1) ?? z(), o = typeof t == "object" && t.name !== void 0 && t.nameStrategy === "title" ? t.name : void 0;
|
|
1103
1103
|
o !== void 0 && (a.title = o);
|
|
1104
1104
|
let s = i === void 0 ? r ? {
|
|
1105
1105
|
...a,
|
|
@@ -1116,14 +1116,14 @@ var zt = (e, t) => {
|
|
|
1116
1116
|
}
|
|
1117
1117
|
};
|
|
1118
1118
|
return s.$schema = "http://json-schema.org/draft-07/schema#", s;
|
|
1119
|
-
},
|
|
1120
|
-
function
|
|
1119
|
+
}, Ht = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
|
|
1120
|
+
function Ut(e) {
|
|
1121
1121
|
let t;
|
|
1122
1122
|
return () => (t ??= e(), t);
|
|
1123
1123
|
}
|
|
1124
|
-
function
|
|
1124
|
+
function Wt(e, { validate: t } = {}) {
|
|
1125
1125
|
return {
|
|
1126
|
-
[
|
|
1126
|
+
[Ht]: !0,
|
|
1127
1127
|
_type: void 0,
|
|
1128
1128
|
get jsonSchema() {
|
|
1129
1129
|
return typeof e == "function" && (e = e()), e;
|
|
@@ -1131,20 +1131,20 @@ function Gt(e, { validate: t } = {}) {
|
|
|
1131
1131
|
validate: t
|
|
1132
1132
|
};
|
|
1133
1133
|
}
|
|
1134
|
-
function
|
|
1135
|
-
return typeof e == "object" && !!e &&
|
|
1134
|
+
function Gt(e) {
|
|
1135
|
+
return typeof e == "object" && !!e && Ht in e && e[Ht] === !0 && "jsonSchema" in e && "validate" in e;
|
|
1136
1136
|
}
|
|
1137
|
-
function
|
|
1138
|
-
return e == null ?
|
|
1137
|
+
function Kt(e) {
|
|
1138
|
+
return e == null ? Wt({
|
|
1139
1139
|
type: "object",
|
|
1140
1140
|
properties: {},
|
|
1141
1141
|
additionalProperties: !1
|
|
1142
|
-
}) :
|
|
1142
|
+
}) : Gt(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? Qt(e) : qt(e) : e();
|
|
1143
1143
|
}
|
|
1144
|
-
function
|
|
1145
|
-
return
|
|
1146
|
-
if (!
|
|
1147
|
-
return
|
|
1144
|
+
function qt(e) {
|
|
1145
|
+
return Wt(() => {
|
|
1146
|
+
if (!Jt(e)) throw Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);
|
|
1147
|
+
return qe(e["~standard"].jsonSchema.input({ target: "draft-07" }));
|
|
1148
1148
|
}, { validate: async (t) => {
|
|
1149
1149
|
let n = await e["~standard"].validate(t);
|
|
1150
1150
|
return "value" in n ? {
|
|
@@ -1152,19 +1152,19 @@ function Jt(e) {
|
|
|
1152
1152
|
value: n.value
|
|
1153
1153
|
} : {
|
|
1154
1154
|
success: !1,
|
|
1155
|
-
error: new
|
|
1155
|
+
error: new A({
|
|
1156
1156
|
value: t,
|
|
1157
1157
|
cause: n.issues
|
|
1158
1158
|
})
|
|
1159
1159
|
};
|
|
1160
1160
|
} });
|
|
1161
1161
|
}
|
|
1162
|
-
function
|
|
1162
|
+
function Jt(e) {
|
|
1163
1163
|
return e["~standard"].jsonSchema != null;
|
|
1164
1164
|
}
|
|
1165
|
-
function
|
|
1165
|
+
function Yt(e, t) {
|
|
1166
1166
|
let n = t?.useReferences ?? !1;
|
|
1167
|
-
return
|
|
1167
|
+
return Wt(() => Vt(e, { $refStrategy: n ? "root" : "none" }), { validate: async (t) => {
|
|
1168
1168
|
let n = await e.safeParseAsync(t);
|
|
1169
1169
|
return n.success ? {
|
|
1170
1170
|
success: !0,
|
|
@@ -1175,9 +1175,9 @@ function Xt(e, t) {
|
|
|
1175
1175
|
};
|
|
1176
1176
|
} });
|
|
1177
1177
|
}
|
|
1178
|
-
function
|
|
1178
|
+
function Xt(t, n) {
|
|
1179
1179
|
let r = n?.useReferences ?? !1;
|
|
1180
|
-
return
|
|
1180
|
+
return Wt(() => qe(_(t, {
|
|
1181
1181
|
target: "draft-7",
|
|
1182
1182
|
io: "input",
|
|
1183
1183
|
reused: r ? "ref" : "inline"
|
|
@@ -1192,27 +1192,27 @@ function Zt(t, n) {
|
|
|
1192
1192
|
};
|
|
1193
1193
|
} });
|
|
1194
1194
|
}
|
|
1195
|
-
function
|
|
1195
|
+
function Zt(e) {
|
|
1196
1196
|
return "_zod" in e;
|
|
1197
1197
|
}
|
|
1198
|
-
function
|
|
1199
|
-
return
|
|
1198
|
+
function Qt(e, t) {
|
|
1199
|
+
return Zt(e) ? Xt(e, t) : Yt(e, t);
|
|
1200
1200
|
}
|
|
1201
|
-
async function
|
|
1202
|
-
let r = await
|
|
1201
|
+
async function $t({ value: e, schema: t, context: n }) {
|
|
1202
|
+
let r = await en({
|
|
1203
1203
|
value: e,
|
|
1204
1204
|
schema: t,
|
|
1205
1205
|
context: n
|
|
1206
1206
|
});
|
|
1207
|
-
if (!r.success) throw
|
|
1207
|
+
if (!r.success) throw A.wrap({
|
|
1208
1208
|
value: e,
|
|
1209
1209
|
cause: r.error,
|
|
1210
1210
|
context: n
|
|
1211
1211
|
});
|
|
1212
1212
|
return r.value;
|
|
1213
1213
|
}
|
|
1214
|
-
async function
|
|
1215
|
-
let r =
|
|
1214
|
+
async function en({ value: e, schema: t, context: n }) {
|
|
1215
|
+
let r = Kt(t);
|
|
1216
1216
|
try {
|
|
1217
1217
|
if (r.validate == null) return {
|
|
1218
1218
|
success: !0,
|
|
@@ -1226,7 +1226,7 @@ async function tn({ value: e, schema: t, context: n }) {
|
|
|
1226
1226
|
rawValue: e
|
|
1227
1227
|
} : {
|
|
1228
1228
|
success: !1,
|
|
1229
|
-
error:
|
|
1229
|
+
error: A.wrap({
|
|
1230
1230
|
value: e,
|
|
1231
1231
|
cause: t.error,
|
|
1232
1232
|
context: n
|
|
@@ -1236,7 +1236,7 @@ async function tn({ value: e, schema: t, context: n }) {
|
|
|
1236
1236
|
} catch (t) {
|
|
1237
1237
|
return {
|
|
1238
1238
|
success: !1,
|
|
1239
|
-
error:
|
|
1239
|
+
error: A.wrap({
|
|
1240
1240
|
value: e,
|
|
1241
1241
|
cause: t,
|
|
1242
1242
|
context: n
|
|
@@ -1245,21 +1245,21 @@ async function tn({ value: e, schema: t, context: n }) {
|
|
|
1245
1245
|
};
|
|
1246
1246
|
}
|
|
1247
1247
|
}
|
|
1248
|
-
async function
|
|
1248
|
+
async function G({ text: e, schema: t }) {
|
|
1249
1249
|
try {
|
|
1250
|
-
let n =
|
|
1250
|
+
let n = Ke(e);
|
|
1251
1251
|
return t == null ? {
|
|
1252
1252
|
success: !0,
|
|
1253
1253
|
value: n,
|
|
1254
1254
|
rawValue: n
|
|
1255
|
-
} : await
|
|
1255
|
+
} : await en({
|
|
1256
1256
|
value: n,
|
|
1257
1257
|
schema: t
|
|
1258
1258
|
});
|
|
1259
1259
|
} catch (t) {
|
|
1260
1260
|
return {
|
|
1261
1261
|
success: !1,
|
|
1262
|
-
error:
|
|
1262
|
+
error: D.isInstance(t) ? t : new D({
|
|
1263
1263
|
text: e,
|
|
1264
1264
|
cause: t
|
|
1265
1265
|
}),
|
|
@@ -1267,46 +1267,56 @@ async function W({ text: e, schema: t }) {
|
|
|
1267
1267
|
};
|
|
1268
1268
|
}
|
|
1269
1269
|
}
|
|
1270
|
-
function
|
|
1271
|
-
return e.pipeThrough(new TextDecoderStream()).pipeThrough(new
|
|
1272
|
-
e !== "[DONE]" && n.enqueue(await
|
|
1270
|
+
function tn({ stream: e, schema: t }) {
|
|
1271
|
+
return e.pipeThrough(new TextDecoderStream()).pipeThrough(new P()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
|
|
1272
|
+
e !== "[DONE]" && n.enqueue(await G({
|
|
1273
1273
|
text: e,
|
|
1274
1274
|
schema: t
|
|
1275
1275
|
}));
|
|
1276
1276
|
} }));
|
|
1277
1277
|
}
|
|
1278
|
-
async function
|
|
1278
|
+
async function K(e) {
|
|
1279
1279
|
return typeof e == "function" && (e = e()), Promise.resolve(e);
|
|
1280
1280
|
}
|
|
1281
1281
|
new TextDecoder();
|
|
1282
|
-
var
|
|
1283
|
-
for (var n in t)
|
|
1282
|
+
var nn = Object.defineProperty, rn = (e, t) => {
|
|
1283
|
+
for (var n in t) nn(e, n, {
|
|
1284
1284
|
get: t[n],
|
|
1285
1285
|
enumerable: !0
|
|
1286
1286
|
});
|
|
1287
|
-
},
|
|
1287
|
+
}, an = "AI_InvalidArgumentError", on = `vercel.ai.error.${an}`, sn = Symbol.for(on), cn, ln, un = class extends (ln = C, cn = sn, ln) {
|
|
1288
|
+
constructor({ parameter: e, value: t, message: n }) {
|
|
1289
|
+
super({
|
|
1290
|
+
name: an,
|
|
1291
|
+
message: `Invalid argument for parameter ${e}: ${n}`
|
|
1292
|
+
}), this[cn] = !0, this.parameter = e, this.value = t;
|
|
1293
|
+
}
|
|
1294
|
+
static isInstance(e) {
|
|
1295
|
+
return C.hasMarker(e, on);
|
|
1296
|
+
}
|
|
1297
|
+
}, dn = "AI_NoObjectGeneratedError", fn = `vercel.ai.error.${dn}`, pn = Symbol.for(fn), mn, hn, q = class extends (hn = C, mn = pn, hn) {
|
|
1288
1298
|
constructor({ message: e = "No object generated.", cause: t, text: n, response: r, usage: i, finishReason: a }) {
|
|
1289
1299
|
super({
|
|
1290
|
-
name:
|
|
1300
|
+
name: dn,
|
|
1291
1301
|
message: e,
|
|
1292
1302
|
cause: t
|
|
1293
|
-
}), this[
|
|
1303
|
+
}), this[mn] = !0, this.text = n, this.response = r, this.usage = i, this.finishReason = a;
|
|
1294
1304
|
}
|
|
1295
1305
|
static isInstance(e) {
|
|
1296
|
-
return C.hasMarker(e,
|
|
1306
|
+
return C.hasMarker(e, fn);
|
|
1297
1307
|
}
|
|
1298
|
-
},
|
|
1308
|
+
}, gn = "AI_UIMessageStreamError", _n = `vercel.ai.error.${gn}`, vn = Symbol.for(_n), yn, bn, J = class extends (bn = C, yn = vn, bn) {
|
|
1299
1309
|
constructor({ chunkType: e, chunkId: t, message: n }) {
|
|
1300
1310
|
super({
|
|
1301
|
-
name:
|
|
1311
|
+
name: gn,
|
|
1302
1312
|
message: n
|
|
1303
|
-
}), this[
|
|
1313
|
+
}), this[yn] = !0, this.chunkType = e, this.chunkId = t;
|
|
1304
1314
|
}
|
|
1305
1315
|
static isInstance(e) {
|
|
1306
|
-
return C.hasMarker(e,
|
|
1316
|
+
return C.hasMarker(e, _n);
|
|
1307
1317
|
}
|
|
1308
1318
|
};
|
|
1309
|
-
function
|
|
1319
|
+
function xn(e, t) {
|
|
1310
1320
|
if (e === void 0 && t === void 0) return;
|
|
1311
1321
|
if (e === void 0) return t;
|
|
1312
1322
|
if (t === void 0) return e;
|
|
@@ -1315,11 +1325,11 @@ function gn(e, t) {
|
|
|
1315
1325
|
let i = t[r];
|
|
1316
1326
|
if (i === void 0) continue;
|
|
1317
1327
|
let a = r in e ? e[r] : void 0, o = typeof i == "object" && !!i && !Array.isArray(i) && !(i instanceof Date) && !(i instanceof RegExp), s = typeof a == "object" && !!a && !Array.isArray(a) && !(a instanceof Date) && !(a instanceof RegExp);
|
|
1318
|
-
n[r] = o && s ?
|
|
1328
|
+
n[r] = o && s ? xn(a, i) : i;
|
|
1319
1329
|
}
|
|
1320
1330
|
return n;
|
|
1321
1331
|
}
|
|
1322
|
-
var
|
|
1332
|
+
var Y = {
|
|
1323
1333
|
array: n,
|
|
1324
1334
|
boolean: p,
|
|
1325
1335
|
custom: i,
|
|
@@ -1337,239 +1347,239 @@ var J = {
|
|
|
1337
1347
|
string: g,
|
|
1338
1348
|
union: ee,
|
|
1339
1349
|
unknown: r
|
|
1340
|
-
},
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
])),
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
]),
|
|
1353
|
-
type:
|
|
1354
|
-
text:
|
|
1355
|
-
providerOptions:
|
|
1356
|
-
}),
|
|
1357
|
-
type:
|
|
1358
|
-
image:
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1350
|
+
}, X = Y.lazy(() => Y.union([
|
|
1351
|
+
Y.null(),
|
|
1352
|
+
Y.string(),
|
|
1353
|
+
Y.number(),
|
|
1354
|
+
Y.boolean(),
|
|
1355
|
+
Y.record(Y.string(), X.optional()),
|
|
1356
|
+
Y.array(X)
|
|
1357
|
+
])), Z = Y.record(Y.string(), Y.record(Y.string(), X.optional())), Sn = Y.union([
|
|
1358
|
+
Y.string(),
|
|
1359
|
+
Y.instanceof(Uint8Array),
|
|
1360
|
+
Y.instanceof(ArrayBuffer),
|
|
1361
|
+
Y.custom(Ve, { message: "Must be a Buffer" })
|
|
1362
|
+
]), Cn = Y.record(Y.string(), Y.string()), wn = Y.object({
|
|
1363
|
+
type: Y.literal("text"),
|
|
1364
|
+
text: Y.string(),
|
|
1365
|
+
providerOptions: Z.optional()
|
|
1366
|
+
}), Tn = Y.object({
|
|
1367
|
+
type: Y.literal("image"),
|
|
1368
|
+
image: Y.union([
|
|
1369
|
+
Sn,
|
|
1370
|
+
Y.instanceof(URL),
|
|
1371
|
+
Cn
|
|
1362
1372
|
]),
|
|
1363
|
-
mediaType:
|
|
1364
|
-
providerOptions:
|
|
1365
|
-
}),
|
|
1366
|
-
|
|
1367
|
-
type:
|
|
1368
|
-
data:
|
|
1373
|
+
mediaType: Y.string().optional(),
|
|
1374
|
+
providerOptions: Z.optional()
|
|
1375
|
+
}), En = Y.discriminatedUnion("type", [
|
|
1376
|
+
Y.object({
|
|
1377
|
+
type: Y.literal("data"),
|
|
1378
|
+
data: Sn
|
|
1369
1379
|
}),
|
|
1370
|
-
|
|
1371
|
-
type:
|
|
1372
|
-
url:
|
|
1380
|
+
Y.object({
|
|
1381
|
+
type: Y.literal("url"),
|
|
1382
|
+
url: Y.instanceof(URL)
|
|
1373
1383
|
}),
|
|
1374
|
-
|
|
1375
|
-
type:
|
|
1376
|
-
reference:
|
|
1384
|
+
Y.object({
|
|
1385
|
+
type: Y.literal("reference"),
|
|
1386
|
+
reference: Cn
|
|
1377
1387
|
}),
|
|
1378
|
-
|
|
1379
|
-
type:
|
|
1380
|
-
text:
|
|
1388
|
+
Y.object({
|
|
1389
|
+
type: Y.literal("text"),
|
|
1390
|
+
text: Y.string()
|
|
1381
1391
|
})
|
|
1382
|
-
]),
|
|
1383
|
-
type:
|
|
1384
|
-
data:
|
|
1385
|
-
}),
|
|
1386
|
-
type:
|
|
1387
|
-
url:
|
|
1388
|
-
})]),
|
|
1389
|
-
type:
|
|
1390
|
-
data:
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1392
|
+
]), Dn = Y.discriminatedUnion("type", [Y.object({
|
|
1393
|
+
type: Y.literal("data"),
|
|
1394
|
+
data: Sn
|
|
1395
|
+
}), Y.object({
|
|
1396
|
+
type: Y.literal("url"),
|
|
1397
|
+
url: Y.instanceof(URL)
|
|
1398
|
+
})]), On = Y.object({
|
|
1399
|
+
type: Y.literal("file"),
|
|
1400
|
+
data: Y.union([
|
|
1401
|
+
En,
|
|
1402
|
+
Sn,
|
|
1403
|
+
Y.instanceof(URL),
|
|
1404
|
+
Cn
|
|
1395
1405
|
]),
|
|
1396
|
-
filename:
|
|
1397
|
-
mediaType:
|
|
1398
|
-
providerOptions:
|
|
1399
|
-
}),
|
|
1400
|
-
type:
|
|
1401
|
-
text:
|
|
1402
|
-
providerOptions:
|
|
1403
|
-
}),
|
|
1404
|
-
type:
|
|
1405
|
-
kind:
|
|
1406
|
-
providerOptions:
|
|
1407
|
-
}),
|
|
1408
|
-
type:
|
|
1409
|
-
data:
|
|
1406
|
+
filename: Y.string().optional(),
|
|
1407
|
+
mediaType: Y.string(),
|
|
1408
|
+
providerOptions: Z.optional()
|
|
1409
|
+
}), kn = Y.object({
|
|
1410
|
+
type: Y.literal("reasoning"),
|
|
1411
|
+
text: Y.string(),
|
|
1412
|
+
providerOptions: Z.optional()
|
|
1413
|
+
}), An = Y.object({
|
|
1414
|
+
type: Y.literal("custom"),
|
|
1415
|
+
kind: Y.string().transform((e) => e),
|
|
1416
|
+
providerOptions: Z.optional()
|
|
1417
|
+
}), jn = Y.object({
|
|
1418
|
+
type: Y.literal("reasoning-file"),
|
|
1419
|
+
data: Y.union([
|
|
1420
|
+
Dn,
|
|
1410
1421
|
Sn,
|
|
1411
|
-
|
|
1412
|
-
J.instanceof(URL)
|
|
1422
|
+
Y.instanceof(URL)
|
|
1413
1423
|
]),
|
|
1414
|
-
mediaType:
|
|
1415
|
-
providerOptions:
|
|
1416
|
-
}),
|
|
1417
|
-
type:
|
|
1418
|
-
toolCallId:
|
|
1419
|
-
toolName:
|
|
1420
|
-
input:
|
|
1421
|
-
providerOptions:
|
|
1422
|
-
providerExecuted:
|
|
1423
|
-
}),
|
|
1424
|
-
|
|
1425
|
-
type:
|
|
1426
|
-
value:
|
|
1427
|
-
providerOptions:
|
|
1424
|
+
mediaType: Y.string(),
|
|
1425
|
+
providerOptions: Z.optional()
|
|
1426
|
+
}), Mn = Y.object({
|
|
1427
|
+
type: Y.literal("tool-call"),
|
|
1428
|
+
toolCallId: Y.string(),
|
|
1429
|
+
toolName: Y.string(),
|
|
1430
|
+
input: Y.unknown(),
|
|
1431
|
+
providerOptions: Z.optional(),
|
|
1432
|
+
providerExecuted: Y.boolean().optional()
|
|
1433
|
+
}), Nn = Y.discriminatedUnion("type", [
|
|
1434
|
+
Y.object({
|
|
1435
|
+
type: Y.literal("text"),
|
|
1436
|
+
value: Y.string(),
|
|
1437
|
+
providerOptions: Z.optional()
|
|
1428
1438
|
}),
|
|
1429
|
-
|
|
1430
|
-
type:
|
|
1431
|
-
value:
|
|
1432
|
-
providerOptions:
|
|
1439
|
+
Y.object({
|
|
1440
|
+
type: Y.literal("json"),
|
|
1441
|
+
value: X,
|
|
1442
|
+
providerOptions: Z.optional()
|
|
1433
1443
|
}),
|
|
1434
|
-
|
|
1435
|
-
type:
|
|
1436
|
-
reason:
|
|
1437
|
-
providerOptions:
|
|
1444
|
+
Y.object({
|
|
1445
|
+
type: Y.literal("execution-denied"),
|
|
1446
|
+
reason: Y.string().optional(),
|
|
1447
|
+
providerOptions: Z.optional()
|
|
1438
1448
|
}),
|
|
1439
|
-
|
|
1440
|
-
type:
|
|
1441
|
-
value:
|
|
1442
|
-
providerOptions:
|
|
1449
|
+
Y.object({
|
|
1450
|
+
type: Y.literal("error-text"),
|
|
1451
|
+
value: Y.string(),
|
|
1452
|
+
providerOptions: Z.optional()
|
|
1443
1453
|
}),
|
|
1444
|
-
|
|
1445
|
-
type:
|
|
1446
|
-
value:
|
|
1447
|
-
providerOptions:
|
|
1454
|
+
Y.object({
|
|
1455
|
+
type: Y.literal("error-json"),
|
|
1456
|
+
value: X,
|
|
1457
|
+
providerOptions: Z.optional()
|
|
1448
1458
|
}),
|
|
1449
|
-
|
|
1450
|
-
type:
|
|
1451
|
-
value:
|
|
1452
|
-
|
|
1453
|
-
type:
|
|
1454
|
-
text:
|
|
1455
|
-
providerOptions:
|
|
1459
|
+
Y.object({
|
|
1460
|
+
type: Y.literal("content"),
|
|
1461
|
+
value: Y.array(Y.union([
|
|
1462
|
+
Y.object({
|
|
1463
|
+
type: Y.literal("text"),
|
|
1464
|
+
text: Y.string(),
|
|
1465
|
+
providerOptions: Z.optional()
|
|
1456
1466
|
}),
|
|
1457
|
-
|
|
1458
|
-
type:
|
|
1459
|
-
data:
|
|
1460
|
-
mediaType:
|
|
1461
|
-
filename:
|
|
1462
|
-
providerOptions:
|
|
1467
|
+
Y.object({
|
|
1468
|
+
type: Y.literal("file"),
|
|
1469
|
+
data: En,
|
|
1470
|
+
mediaType: Y.string(),
|
|
1471
|
+
filename: Y.string().optional(),
|
|
1472
|
+
providerOptions: Z.optional()
|
|
1463
1473
|
}),
|
|
1464
|
-
|
|
1465
|
-
type:
|
|
1466
|
-
data:
|
|
1467
|
-
mediaType:
|
|
1468
|
-
filename:
|
|
1469
|
-
providerOptions:
|
|
1474
|
+
Y.object({
|
|
1475
|
+
type: Y.literal("file-data"),
|
|
1476
|
+
data: Y.string(),
|
|
1477
|
+
mediaType: Y.string(),
|
|
1478
|
+
filename: Y.string().optional(),
|
|
1479
|
+
providerOptions: Z.optional()
|
|
1470
1480
|
}),
|
|
1471
|
-
|
|
1472
|
-
type:
|
|
1473
|
-
url:
|
|
1474
|
-
mediaType:
|
|
1475
|
-
providerOptions:
|
|
1481
|
+
Y.object({
|
|
1482
|
+
type: Y.literal("file-url"),
|
|
1483
|
+
url: Y.string(),
|
|
1484
|
+
mediaType: Y.string().optional(),
|
|
1485
|
+
providerOptions: Z.optional()
|
|
1476
1486
|
}),
|
|
1477
|
-
|
|
1478
|
-
type:
|
|
1479
|
-
fileId:
|
|
1480
|
-
providerOptions:
|
|
1487
|
+
Y.object({
|
|
1488
|
+
type: Y.literal("file-id"),
|
|
1489
|
+
fileId: Y.union([Y.string(), Y.record(Y.string(), Y.string())]),
|
|
1490
|
+
providerOptions: Z.optional()
|
|
1481
1491
|
}),
|
|
1482
|
-
|
|
1483
|
-
type:
|
|
1484
|
-
providerReference:
|
|
1485
|
-
providerOptions:
|
|
1492
|
+
Y.object({
|
|
1493
|
+
type: Y.literal("file-reference"),
|
|
1494
|
+
providerReference: Y.record(Y.string(), Y.string()),
|
|
1495
|
+
providerOptions: Z.optional()
|
|
1486
1496
|
}),
|
|
1487
|
-
|
|
1488
|
-
type:
|
|
1489
|
-
data:
|
|
1490
|
-
mediaType:
|
|
1491
|
-
providerOptions:
|
|
1497
|
+
Y.object({
|
|
1498
|
+
type: Y.literal("image-data"),
|
|
1499
|
+
data: Y.string(),
|
|
1500
|
+
mediaType: Y.string(),
|
|
1501
|
+
providerOptions: Z.optional()
|
|
1492
1502
|
}),
|
|
1493
|
-
|
|
1494
|
-
type:
|
|
1495
|
-
url:
|
|
1496
|
-
providerOptions:
|
|
1503
|
+
Y.object({
|
|
1504
|
+
type: Y.literal("image-url"),
|
|
1505
|
+
url: Y.string(),
|
|
1506
|
+
providerOptions: Z.optional()
|
|
1497
1507
|
}),
|
|
1498
|
-
|
|
1499
|
-
type:
|
|
1500
|
-
fileId:
|
|
1501
|
-
providerOptions:
|
|
1508
|
+
Y.object({
|
|
1509
|
+
type: Y.literal("image-file-id"),
|
|
1510
|
+
fileId: Y.union([Y.string(), Y.record(Y.string(), Y.string())]),
|
|
1511
|
+
providerOptions: Z.optional()
|
|
1502
1512
|
}),
|
|
1503
|
-
|
|
1504
|
-
type:
|
|
1505
|
-
providerReference:
|
|
1506
|
-
providerOptions:
|
|
1513
|
+
Y.object({
|
|
1514
|
+
type: Y.literal("image-file-reference"),
|
|
1515
|
+
providerReference: Y.record(Y.string(), Y.string()),
|
|
1516
|
+
providerOptions: Z.optional()
|
|
1507
1517
|
}),
|
|
1508
|
-
|
|
1509
|
-
type:
|
|
1510
|
-
providerOptions:
|
|
1518
|
+
Y.object({
|
|
1519
|
+
type: Y.literal("custom"),
|
|
1520
|
+
providerOptions: Z.optional()
|
|
1511
1521
|
})
|
|
1512
1522
|
]))
|
|
1513
1523
|
})
|
|
1514
|
-
]),
|
|
1515
|
-
type:
|
|
1516
|
-
toolCallId:
|
|
1517
|
-
toolName:
|
|
1518
|
-
output:
|
|
1519
|
-
providerOptions:
|
|
1520
|
-
}),
|
|
1521
|
-
type:
|
|
1522
|
-
approvalId:
|
|
1523
|
-
toolCallId:
|
|
1524
|
-
reason:
|
|
1525
|
-
}),
|
|
1526
|
-
type:
|
|
1527
|
-
approvalId:
|
|
1528
|
-
approved:
|
|
1529
|
-
reason:
|
|
1530
|
-
}),
|
|
1531
|
-
role:
|
|
1532
|
-
content:
|
|
1533
|
-
providerOptions:
|
|
1534
|
-
}),
|
|
1535
|
-
role:
|
|
1536
|
-
content:
|
|
1537
|
-
|
|
1538
|
-
bn,
|
|
1539
|
-
Cn
|
|
1540
|
-
]))]),
|
|
1541
|
-
providerOptions: X.optional()
|
|
1542
|
-
}), Pn = J.object({
|
|
1543
|
-
role: J.literal("assistant"),
|
|
1544
|
-
content: J.union([J.string(), J.array(J.union([
|
|
1545
|
-
yn,
|
|
1524
|
+
]), Pn = Y.object({
|
|
1525
|
+
type: Y.literal("tool-result"),
|
|
1526
|
+
toolCallId: Y.string(),
|
|
1527
|
+
toolName: Y.string(),
|
|
1528
|
+
output: Nn,
|
|
1529
|
+
providerOptions: Z.optional()
|
|
1530
|
+
}), Fn = Y.object({
|
|
1531
|
+
type: Y.literal("tool-approval-request"),
|
|
1532
|
+
approvalId: Y.string(),
|
|
1533
|
+
toolCallId: Y.string(),
|
|
1534
|
+
reason: Y.string().optional()
|
|
1535
|
+
}), In = Y.object({
|
|
1536
|
+
type: Y.literal("tool-approval-response"),
|
|
1537
|
+
approvalId: Y.string(),
|
|
1538
|
+
approved: Y.boolean(),
|
|
1539
|
+
reason: Y.string().optional()
|
|
1540
|
+
}), Ln = Y.object({
|
|
1541
|
+
role: Y.literal("system"),
|
|
1542
|
+
content: Y.string(),
|
|
1543
|
+
providerOptions: Z.optional()
|
|
1544
|
+
}), Rn = Y.object({
|
|
1545
|
+
role: Y.literal("user"),
|
|
1546
|
+
content: Y.union([Y.string(), Y.array(Y.union([
|
|
1547
|
+
wn,
|
|
1546
1548
|
Tn,
|
|
1547
|
-
|
|
1549
|
+
On
|
|
1550
|
+
]))]),
|
|
1551
|
+
providerOptions: Z.optional()
|
|
1552
|
+
}), zn = Y.object({
|
|
1553
|
+
role: Y.literal("assistant"),
|
|
1554
|
+
content: Y.union([Y.string(), Y.array(Y.union([
|
|
1548
1555
|
wn,
|
|
1549
|
-
|
|
1550
|
-
|
|
1556
|
+
An,
|
|
1557
|
+
On,
|
|
1551
1558
|
kn,
|
|
1552
|
-
|
|
1559
|
+
jn,
|
|
1560
|
+
Mn,
|
|
1561
|
+
Pn,
|
|
1562
|
+
Fn
|
|
1553
1563
|
]))]),
|
|
1554
|
-
providerOptions:
|
|
1555
|
-
}),
|
|
1556
|
-
role:
|
|
1557
|
-
content:
|
|
1558
|
-
providerOptions:
|
|
1564
|
+
providerOptions: Z.optional()
|
|
1565
|
+
}), Bn = Y.object({
|
|
1566
|
+
role: Y.literal("tool"),
|
|
1567
|
+
content: Y.array(Y.union([Pn, In])),
|
|
1568
|
+
providerOptions: Z.optional()
|
|
1559
1569
|
});
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
]),
|
|
1566
|
-
array: () =>
|
|
1567
|
-
choice: () =>
|
|
1568
|
-
json: () =>
|
|
1569
|
-
object: () =>
|
|
1570
|
-
text: () =>
|
|
1570
|
+
Y.union([
|
|
1571
|
+
Ln,
|
|
1572
|
+
Rn,
|
|
1573
|
+
zn,
|
|
1574
|
+
Bn
|
|
1575
|
+
]), rn({}, {
|
|
1576
|
+
array: () => Gn,
|
|
1577
|
+
choice: () => Jn,
|
|
1578
|
+
json: () => Yn,
|
|
1579
|
+
object: () => Wn,
|
|
1580
|
+
text: () => Un
|
|
1571
1581
|
});
|
|
1572
|
-
function
|
|
1582
|
+
function Vn(e) {
|
|
1573
1583
|
let t = ["ROOT"], n = -1, r = null, i = 0;
|
|
1574
1584
|
function a(e) {
|
|
1575
1585
|
return e >= "0" && e <= "9" || e >= "A" && e <= "F" || e >= "a" && e <= "f";
|
|
@@ -1751,16 +1761,16 @@ function In(e) {
|
|
|
1751
1761
|
}
|
|
1752
1762
|
return l;
|
|
1753
1763
|
}
|
|
1754
|
-
async function
|
|
1764
|
+
async function Hn(e) {
|
|
1755
1765
|
if (e === void 0) return {
|
|
1756
1766
|
value: void 0,
|
|
1757
1767
|
state: "undefined-input"
|
|
1758
1768
|
};
|
|
1759
|
-
let t = await
|
|
1769
|
+
let t = await G({ text: e });
|
|
1760
1770
|
return t.success ? {
|
|
1761
1771
|
value: t.value,
|
|
1762
1772
|
state: "successful-parse"
|
|
1763
|
-
} : (t = await
|
|
1773
|
+
} : (t = await G({ text: Vn(e) }), t.success ? {
|
|
1764
1774
|
value: t.value,
|
|
1765
1775
|
state: "repaired-parse"
|
|
1766
1776
|
} : {
|
|
@@ -1768,7 +1778,7 @@ async function Ln(e) {
|
|
|
1768
1778
|
state: "failed-parse"
|
|
1769
1779
|
});
|
|
1770
1780
|
}
|
|
1771
|
-
var
|
|
1781
|
+
var Un = () => ({
|
|
1772
1782
|
name: "text",
|
|
1773
1783
|
responseFormat: Promise.resolve({ type: "text" }),
|
|
1774
1784
|
async parseCompleteOutput({ text: e }) {
|
|
@@ -1778,19 +1788,19 @@ var Rn = () => ({
|
|
|
1778
1788
|
return { partial: e };
|
|
1779
1789
|
},
|
|
1780
1790
|
createElementStreamTransform() {}
|
|
1781
|
-
}),
|
|
1782
|
-
let r =
|
|
1791
|
+
}), Wn = ({ schema: e, name: t, description: n }) => {
|
|
1792
|
+
let r = Kt(e);
|
|
1783
1793
|
return {
|
|
1784
1794
|
name: "object",
|
|
1785
|
-
responseFormat:
|
|
1795
|
+
responseFormat: K(r.jsonSchema).then((e) => ({
|
|
1786
1796
|
type: "json",
|
|
1787
1797
|
schema: e,
|
|
1788
1798
|
...t != null && { name: t },
|
|
1789
1799
|
...n != null && { description: n }
|
|
1790
1800
|
})),
|
|
1791
1801
|
async parseCompleteOutput({ text: e }, t) {
|
|
1792
|
-
let n = await
|
|
1793
|
-
if (!n.success) throw new
|
|
1802
|
+
let n = await G({ text: e });
|
|
1803
|
+
if (!n.success) throw new q({
|
|
1794
1804
|
message: "No object generated: could not parse the response.",
|
|
1795
1805
|
cause: n.error,
|
|
1796
1806
|
text: e,
|
|
@@ -1798,11 +1808,11 @@ var Rn = () => ({
|
|
|
1798
1808
|
usage: t.usage,
|
|
1799
1809
|
finishReason: t.finishReason
|
|
1800
1810
|
});
|
|
1801
|
-
let i = await
|
|
1811
|
+
let i = await en({
|
|
1802
1812
|
value: n.value,
|
|
1803
1813
|
schema: r
|
|
1804
1814
|
});
|
|
1805
|
-
if (!i.success) throw new
|
|
1815
|
+
if (!i.success) throw new q({
|
|
1806
1816
|
message: "No object generated: response did not match schema.",
|
|
1807
1817
|
cause: i.error,
|
|
1808
1818
|
text: e,
|
|
@@ -1813,7 +1823,7 @@ var Rn = () => ({
|
|
|
1813
1823
|
return i.value;
|
|
1814
1824
|
},
|
|
1815
1825
|
async parsePartialOutput({ text: e }) {
|
|
1816
|
-
let t = await
|
|
1826
|
+
let t = await Hn(e);
|
|
1817
1827
|
switch (t.state) {
|
|
1818
1828
|
case "failed-parse":
|
|
1819
1829
|
case "undefined-input": return;
|
|
@@ -1823,72 +1833,98 @@ var Rn = () => ({
|
|
|
1823
1833
|
},
|
|
1824
1834
|
createElementStreamTransform() {}
|
|
1825
1835
|
};
|
|
1826
|
-
},
|
|
1827
|
-
|
|
1836
|
+
}, Gn = ({ element: e, minItems: t, maxItems: n, name: r, description: i }) => {
|
|
1837
|
+
if (Kn({
|
|
1838
|
+
name: "minItems",
|
|
1839
|
+
value: t
|
|
1840
|
+
}), Kn({
|
|
1841
|
+
name: "maxItems",
|
|
1842
|
+
value: n
|
|
1843
|
+
}), t != null && n != null && t > n) throw new un({
|
|
1844
|
+
parameter: "minItems",
|
|
1845
|
+
value: t,
|
|
1846
|
+
message: "minItems must be less than or equal to maxItems"
|
|
1847
|
+
});
|
|
1848
|
+
let a = Kt(e);
|
|
1828
1849
|
return {
|
|
1829
1850
|
name: "array",
|
|
1830
|
-
responseFormat:
|
|
1831
|
-
let { $schema:
|
|
1851
|
+
responseFormat: K(a.jsonSchema).then((e) => {
|
|
1852
|
+
let { $schema: a, definitions: o, $defs: s, ...c } = e;
|
|
1832
1853
|
return {
|
|
1833
1854
|
type: "json",
|
|
1834
1855
|
schema: {
|
|
1835
1856
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
1836
|
-
...
|
|
1837
|
-
...
|
|
1857
|
+
...o != null && { definitions: o },
|
|
1858
|
+
...s != null && { $defs: s },
|
|
1838
1859
|
type: "object",
|
|
1839
1860
|
properties: { elements: {
|
|
1840
1861
|
type: "array",
|
|
1841
|
-
items:
|
|
1862
|
+
items: c,
|
|
1863
|
+
...t != null && { minItems: t },
|
|
1864
|
+
...n != null && { maxItems: n }
|
|
1842
1865
|
} },
|
|
1843
1866
|
required: ["elements"],
|
|
1844
1867
|
additionalProperties: !1
|
|
1845
1868
|
},
|
|
1846
|
-
...
|
|
1847
|
-
...
|
|
1869
|
+
...r != null && { name: r },
|
|
1870
|
+
...i != null && { description: i }
|
|
1848
1871
|
};
|
|
1849
1872
|
}),
|
|
1850
|
-
async parseCompleteOutput({ text: e },
|
|
1851
|
-
let
|
|
1852
|
-
if (!
|
|
1873
|
+
async parseCompleteOutput({ text: e }, r) {
|
|
1874
|
+
let i = await G({ text: e });
|
|
1875
|
+
if (!i.success) throw new q({
|
|
1853
1876
|
message: "No object generated: could not parse the response.",
|
|
1854
|
-
cause:
|
|
1877
|
+
cause: i.error,
|
|
1855
1878
|
text: e,
|
|
1856
|
-
response:
|
|
1857
|
-
usage:
|
|
1858
|
-
finishReason:
|
|
1879
|
+
response: r.response,
|
|
1880
|
+
usage: r.usage,
|
|
1881
|
+
finishReason: r.finishReason
|
|
1859
1882
|
});
|
|
1860
|
-
let
|
|
1861
|
-
if (typeof
|
|
1883
|
+
let o = i.value;
|
|
1884
|
+
if (typeof o != "object" || !o || !("elements" in o) || !Array.isArray(o.elements)) throw new q({
|
|
1862
1885
|
message: "No object generated: response did not match schema.",
|
|
1863
|
-
cause: new
|
|
1864
|
-
value:
|
|
1886
|
+
cause: new A({
|
|
1887
|
+
value: o,
|
|
1865
1888
|
cause: "response must be an object with an elements array"
|
|
1866
1889
|
}),
|
|
1867
1890
|
text: e,
|
|
1868
|
-
response:
|
|
1869
|
-
usage:
|
|
1870
|
-
finishReason:
|
|
1891
|
+
response: r.response,
|
|
1892
|
+
usage: r.usage,
|
|
1893
|
+
finishReason: r.finishReason
|
|
1871
1894
|
});
|
|
1872
|
-
let
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1895
|
+
let s = qn({
|
|
1896
|
+
value: o.elements,
|
|
1897
|
+
minItems: t,
|
|
1898
|
+
maxItems: n
|
|
1899
|
+
});
|
|
1900
|
+
if (s != null) throw new q({
|
|
1901
|
+
message: "No object generated: response did not match schema.",
|
|
1902
|
+
cause: s,
|
|
1903
|
+
text: e,
|
|
1904
|
+
response: r.response,
|
|
1905
|
+
usage: r.usage,
|
|
1906
|
+
finishReason: r.finishReason
|
|
1907
|
+
});
|
|
1908
|
+
let c = [];
|
|
1909
|
+
for (let t of o.elements) {
|
|
1910
|
+
let n = await en({
|
|
1911
|
+
value: t,
|
|
1912
|
+
schema: a
|
|
1877
1913
|
});
|
|
1878
|
-
if (!
|
|
1914
|
+
if (!n.success) throw new q({
|
|
1879
1915
|
message: "No object generated: response did not match schema.",
|
|
1880
|
-
cause:
|
|
1916
|
+
cause: n.error,
|
|
1881
1917
|
text: e,
|
|
1882
|
-
response:
|
|
1883
|
-
usage:
|
|
1884
|
-
finishReason:
|
|
1918
|
+
response: r.response,
|
|
1919
|
+
usage: r.usage,
|
|
1920
|
+
finishReason: r.finishReason
|
|
1885
1921
|
});
|
|
1886
|
-
|
|
1922
|
+
c.push(n.value);
|
|
1887
1923
|
}
|
|
1888
|
-
return
|
|
1924
|
+
return c;
|
|
1889
1925
|
},
|
|
1890
1926
|
async parsePartialOutput({ text: e }) {
|
|
1891
|
-
let t = await
|
|
1927
|
+
let t = await Hn(e);
|
|
1892
1928
|
switch (t.state) {
|
|
1893
1929
|
case "failed-parse":
|
|
1894
1930
|
case "undefined-input": return;
|
|
@@ -1896,26 +1932,60 @@ var Rn = () => ({
|
|
|
1896
1932
|
case "successful-parse": {
|
|
1897
1933
|
let e = t.value;
|
|
1898
1934
|
if (typeof e != "object" || !e || !("elements" in e) || !Array.isArray(e.elements)) return;
|
|
1899
|
-
let n = t.state === "repaired-parse" && e.elements.length > 0 ? e.elements.slice(0, -1) : e.elements,
|
|
1935
|
+
let n = t.state === "repaired-parse" && e.elements.length > 0 ? e.elements.slice(0, -1) : e.elements, r = [];
|
|
1900
1936
|
for (let e of n) {
|
|
1901
|
-
let t = await
|
|
1937
|
+
let t = await en({
|
|
1902
1938
|
value: e,
|
|
1903
|
-
schema:
|
|
1939
|
+
schema: a
|
|
1904
1940
|
});
|
|
1905
|
-
t.success &&
|
|
1941
|
+
t.success && r.push(t.value);
|
|
1906
1942
|
}
|
|
1907
|
-
return { partial:
|
|
1943
|
+
return { partial: r };
|
|
1908
1944
|
}
|
|
1909
1945
|
}
|
|
1910
1946
|
},
|
|
1911
1947
|
createElementStreamTransform() {
|
|
1912
1948
|
let e = 0;
|
|
1913
|
-
return new TransformStream({ transform({ partialOutput: t },
|
|
1914
|
-
if (t != null) for (; e < t.length; e++)
|
|
1949
|
+
return new TransformStream({ transform({ partialOutput: t }, r) {
|
|
1950
|
+
if (t != null) for (; e < t.length; e++) {
|
|
1951
|
+
if (n != null && e >= n) {
|
|
1952
|
+
r.error(qn({
|
|
1953
|
+
value: t,
|
|
1954
|
+
maxItems: n
|
|
1955
|
+
}));
|
|
1956
|
+
return;
|
|
1957
|
+
}
|
|
1958
|
+
r.enqueue(t[e]);
|
|
1959
|
+
}
|
|
1915
1960
|
} });
|
|
1916
1961
|
}
|
|
1917
1962
|
};
|
|
1918
|
-
}
|
|
1963
|
+
};
|
|
1964
|
+
function Kn({ name: e, value: t }) {
|
|
1965
|
+
if (t != null) {
|
|
1966
|
+
if (!Number.isInteger(t)) throw new un({
|
|
1967
|
+
parameter: e,
|
|
1968
|
+
value: t,
|
|
1969
|
+
message: `${e} must be an integer`
|
|
1970
|
+
});
|
|
1971
|
+
if (t < 0) throw new un({
|
|
1972
|
+
parameter: e,
|
|
1973
|
+
value: t,
|
|
1974
|
+
message: `${e} must be greater than or equal to 0`
|
|
1975
|
+
});
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
function qn({ value: e, minItems: t, maxItems: n }) {
|
|
1979
|
+
if (t != null && e.length < t) return new A({
|
|
1980
|
+
value: e,
|
|
1981
|
+
cause: `elements array must contain at least ${t} items`
|
|
1982
|
+
});
|
|
1983
|
+
if (n != null && e.length > n) return new A({
|
|
1984
|
+
value: e,
|
|
1985
|
+
cause: `elements array must contain at most ${n} items`
|
|
1986
|
+
});
|
|
1987
|
+
}
|
|
1988
|
+
var Jn = ({ options: e, name: t, description: n }) => ({
|
|
1919
1989
|
name: "choice",
|
|
1920
1990
|
responseFormat: Promise.resolve({
|
|
1921
1991
|
type: "json",
|
|
@@ -1933,8 +2003,8 @@ var Rn = () => ({
|
|
|
1933
2003
|
...n != null && { description: n }
|
|
1934
2004
|
}),
|
|
1935
2005
|
async parseCompleteOutput({ text: t }, n) {
|
|
1936
|
-
let r = await
|
|
1937
|
-
if (!r.success) throw new
|
|
2006
|
+
let r = await G({ text: t });
|
|
2007
|
+
if (!r.success) throw new q({
|
|
1938
2008
|
message: "No object generated: could not parse the response.",
|
|
1939
2009
|
cause: r.error,
|
|
1940
2010
|
text: t,
|
|
@@ -1943,9 +2013,9 @@ var Rn = () => ({
|
|
|
1943
2013
|
finishReason: n.finishReason
|
|
1944
2014
|
});
|
|
1945
2015
|
let i = r.value;
|
|
1946
|
-
if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new
|
|
2016
|
+
if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new q({
|
|
1947
2017
|
message: "No object generated: response did not match schema.",
|
|
1948
|
-
cause: new
|
|
2018
|
+
cause: new A({
|
|
1949
2019
|
value: i,
|
|
1950
2020
|
cause: "response must be an object that contains a choice value."
|
|
1951
2021
|
}),
|
|
@@ -1957,7 +2027,7 @@ var Rn = () => ({
|
|
|
1957
2027
|
return i.result;
|
|
1958
2028
|
},
|
|
1959
2029
|
async parsePartialOutput({ text: t }) {
|
|
1960
|
-
let n = await
|
|
2030
|
+
let n = await Hn(t);
|
|
1961
2031
|
switch (n.state) {
|
|
1962
2032
|
case "failed-parse":
|
|
1963
2033
|
case "undefined-input": return;
|
|
@@ -1971,7 +2041,7 @@ var Rn = () => ({
|
|
|
1971
2041
|
}
|
|
1972
2042
|
},
|
|
1973
2043
|
createElementStreamTransform() {}
|
|
1974
|
-
}),
|
|
2044
|
+
}), Yn = ({ name: e, description: t } = {}) => ({
|
|
1975
2045
|
name: "json",
|
|
1976
2046
|
responseFormat: Promise.resolve({
|
|
1977
2047
|
type: "json",
|
|
@@ -1979,8 +2049,8 @@ var Rn = () => ({
|
|
|
1979
2049
|
...t != null && { description: t }
|
|
1980
2050
|
}),
|
|
1981
2051
|
async parseCompleteOutput({ text: e }, t) {
|
|
1982
|
-
let n = await
|
|
1983
|
-
if (!n.success) throw new
|
|
2052
|
+
let n = await G({ text: e });
|
|
2053
|
+
if (!n.success) throw new q({
|
|
1984
2054
|
message: "No object generated: could not parse the response.",
|
|
1985
2055
|
cause: n.error,
|
|
1986
2056
|
text: e,
|
|
@@ -1991,7 +2061,7 @@ var Rn = () => ({
|
|
|
1991
2061
|
return n.value;
|
|
1992
2062
|
},
|
|
1993
2063
|
async parsePartialOutput({ text: e }) {
|
|
1994
|
-
let t = await
|
|
2064
|
+
let t = await Hn(e);
|
|
1995
2065
|
switch (t.state) {
|
|
1996
2066
|
case "failed-parse":
|
|
1997
2067
|
case "undefined-input": return;
|
|
@@ -2001,177 +2071,177 @@ var Rn = () => ({
|
|
|
2001
2071
|
},
|
|
2002
2072
|
createElementStreamTransform() {}
|
|
2003
2073
|
});
|
|
2004
|
-
new TextEncoder(), new TextEncoder(),
|
|
2074
|
+
new TextEncoder(), new TextEncoder(), I({
|
|
2005
2075
|
prefix: "aitxt",
|
|
2006
2076
|
size: 24
|
|
2007
|
-
}),
|
|
2077
|
+
}), I({
|
|
2008
2078
|
prefix: "call",
|
|
2009
2079
|
size: 24
|
|
2010
2080
|
}), TransformStream;
|
|
2011
|
-
var
|
|
2012
|
-
|
|
2013
|
-
type:
|
|
2014
|
-
id:
|
|
2015
|
-
providerMetadata:
|
|
2081
|
+
var Xn = Y.record(Y.string(), X.optional()), Zn = Ut(() => Qt(Y.union([
|
|
2082
|
+
Y.looseObject({
|
|
2083
|
+
type: Y.literal("text-start"),
|
|
2084
|
+
id: Y.string(),
|
|
2085
|
+
providerMetadata: Z.optional()
|
|
2016
2086
|
}),
|
|
2017
|
-
|
|
2018
|
-
type:
|
|
2019
|
-
id:
|
|
2020
|
-
delta:
|
|
2021
|
-
providerMetadata:
|
|
2087
|
+
Y.looseObject({
|
|
2088
|
+
type: Y.literal("text-delta"),
|
|
2089
|
+
id: Y.string(),
|
|
2090
|
+
delta: Y.string(),
|
|
2091
|
+
providerMetadata: Z.optional()
|
|
2022
2092
|
}),
|
|
2023
|
-
|
|
2024
|
-
type:
|
|
2025
|
-
id:
|
|
2026
|
-
providerMetadata:
|
|
2093
|
+
Y.looseObject({
|
|
2094
|
+
type: Y.literal("text-end"),
|
|
2095
|
+
id: Y.string(),
|
|
2096
|
+
providerMetadata: Z.optional()
|
|
2027
2097
|
}),
|
|
2028
|
-
|
|
2029
|
-
type:
|
|
2030
|
-
errorText:
|
|
2098
|
+
Y.looseObject({
|
|
2099
|
+
type: Y.literal("error"),
|
|
2100
|
+
errorText: Y.string()
|
|
2031
2101
|
}),
|
|
2032
|
-
|
|
2033
|
-
type:
|
|
2034
|
-
toolCallId:
|
|
2035
|
-
toolName:
|
|
2036
|
-
providerExecuted:
|
|
2037
|
-
providerMetadata:
|
|
2038
|
-
toolMetadata:
|
|
2039
|
-
dynamic:
|
|
2040
|
-
title:
|
|
2102
|
+
Y.looseObject({
|
|
2103
|
+
type: Y.literal("tool-input-start"),
|
|
2104
|
+
toolCallId: Y.string(),
|
|
2105
|
+
toolName: Y.string(),
|
|
2106
|
+
providerExecuted: Y.boolean().optional(),
|
|
2107
|
+
providerMetadata: Z.optional(),
|
|
2108
|
+
toolMetadata: Xn.optional(),
|
|
2109
|
+
dynamic: Y.boolean().optional(),
|
|
2110
|
+
title: Y.string().optional()
|
|
2041
2111
|
}),
|
|
2042
|
-
|
|
2043
|
-
type:
|
|
2044
|
-
toolCallId:
|
|
2045
|
-
inputTextDelta:
|
|
2112
|
+
Y.looseObject({
|
|
2113
|
+
type: Y.literal("tool-input-delta"),
|
|
2114
|
+
toolCallId: Y.string(),
|
|
2115
|
+
inputTextDelta: Y.string()
|
|
2046
2116
|
}),
|
|
2047
|
-
|
|
2048
|
-
type:
|
|
2049
|
-
toolCallId:
|
|
2050
|
-
toolName:
|
|
2051
|
-
input:
|
|
2052
|
-
providerExecuted:
|
|
2053
|
-
providerMetadata:
|
|
2054
|
-
toolMetadata:
|
|
2055
|
-
dynamic:
|
|
2056
|
-
title:
|
|
2117
|
+
Y.looseObject({
|
|
2118
|
+
type: Y.literal("tool-input-available"),
|
|
2119
|
+
toolCallId: Y.string(),
|
|
2120
|
+
toolName: Y.string(),
|
|
2121
|
+
input: Y.unknown(),
|
|
2122
|
+
providerExecuted: Y.boolean().optional(),
|
|
2123
|
+
providerMetadata: Z.optional(),
|
|
2124
|
+
toolMetadata: Xn.optional(),
|
|
2125
|
+
dynamic: Y.boolean().optional(),
|
|
2126
|
+
title: Y.string().optional()
|
|
2057
2127
|
}),
|
|
2058
|
-
|
|
2059
|
-
type:
|
|
2060
|
-
toolCallId:
|
|
2061
|
-
toolName:
|
|
2062
|
-
input:
|
|
2063
|
-
providerExecuted:
|
|
2064
|
-
providerMetadata:
|
|
2065
|
-
toolMetadata:
|
|
2066
|
-
dynamic:
|
|
2067
|
-
errorText:
|
|
2068
|
-
title:
|
|
2128
|
+
Y.looseObject({
|
|
2129
|
+
type: Y.literal("tool-input-error"),
|
|
2130
|
+
toolCallId: Y.string(),
|
|
2131
|
+
toolName: Y.string(),
|
|
2132
|
+
input: Y.unknown(),
|
|
2133
|
+
providerExecuted: Y.boolean().optional(),
|
|
2134
|
+
providerMetadata: Z.optional(),
|
|
2135
|
+
toolMetadata: Xn.optional(),
|
|
2136
|
+
dynamic: Y.boolean().optional(),
|
|
2137
|
+
errorText: Y.string(),
|
|
2138
|
+
title: Y.string().optional()
|
|
2069
2139
|
}),
|
|
2070
|
-
|
|
2071
|
-
type:
|
|
2072
|
-
approvalId:
|
|
2073
|
-
toolCallId:
|
|
2074
|
-
approvalDescriptor:
|
|
2075
|
-
reason:
|
|
2076
|
-
isAutomatic:
|
|
2077
|
-
signature:
|
|
2140
|
+
Y.looseObject({
|
|
2141
|
+
type: Y.literal("tool-approval-request"),
|
|
2142
|
+
approvalId: Y.string(),
|
|
2143
|
+
toolCallId: Y.string(),
|
|
2144
|
+
approvalDescriptor: Y.unknown().optional(),
|
|
2145
|
+
reason: Y.string().optional(),
|
|
2146
|
+
isAutomatic: Y.boolean().optional(),
|
|
2147
|
+
signature: Y.string().optional()
|
|
2078
2148
|
}),
|
|
2079
|
-
|
|
2080
|
-
type:
|
|
2081
|
-
approvalId:
|
|
2082
|
-
approved:
|
|
2083
|
-
reason:
|
|
2084
|
-
providerExecuted:
|
|
2085
|
-
providerMetadata:
|
|
2149
|
+
Y.looseObject({
|
|
2150
|
+
type: Y.literal("tool-approval-response"),
|
|
2151
|
+
approvalId: Y.string(),
|
|
2152
|
+
approved: Y.boolean(),
|
|
2153
|
+
reason: Y.string().optional(),
|
|
2154
|
+
providerExecuted: Y.boolean().optional(),
|
|
2155
|
+
providerMetadata: Z.optional()
|
|
2086
2156
|
}),
|
|
2087
|
-
|
|
2088
|
-
type:
|
|
2089
|
-
toolCallId:
|
|
2090
|
-
output:
|
|
2091
|
-
providerExecuted:
|
|
2092
|
-
providerMetadata:
|
|
2093
|
-
toolMetadata:
|
|
2094
|
-
dynamic:
|
|
2095
|
-
preliminary:
|
|
2157
|
+
Y.looseObject({
|
|
2158
|
+
type: Y.literal("tool-output-available"),
|
|
2159
|
+
toolCallId: Y.string(),
|
|
2160
|
+
output: Y.unknown(),
|
|
2161
|
+
providerExecuted: Y.boolean().optional(),
|
|
2162
|
+
providerMetadata: Z.optional(),
|
|
2163
|
+
toolMetadata: Xn.optional(),
|
|
2164
|
+
dynamic: Y.boolean().optional(),
|
|
2165
|
+
preliminary: Y.boolean().optional()
|
|
2096
2166
|
}),
|
|
2097
|
-
|
|
2098
|
-
type:
|
|
2099
|
-
toolCallId:
|
|
2100
|
-
errorText:
|
|
2101
|
-
providerExecuted:
|
|
2102
|
-
providerMetadata:
|
|
2103
|
-
toolMetadata:
|
|
2104
|
-
dynamic:
|
|
2167
|
+
Y.looseObject({
|
|
2168
|
+
type: Y.literal("tool-output-error"),
|
|
2169
|
+
toolCallId: Y.string(),
|
|
2170
|
+
errorText: Y.string(),
|
|
2171
|
+
providerExecuted: Y.boolean().optional(),
|
|
2172
|
+
providerMetadata: Z.optional(),
|
|
2173
|
+
toolMetadata: Xn.optional(),
|
|
2174
|
+
dynamic: Y.boolean().optional()
|
|
2105
2175
|
}),
|
|
2106
|
-
|
|
2107
|
-
type:
|
|
2108
|
-
toolCallId:
|
|
2176
|
+
Y.looseObject({
|
|
2177
|
+
type: Y.literal("tool-output-denied"),
|
|
2178
|
+
toolCallId: Y.string()
|
|
2109
2179
|
}),
|
|
2110
|
-
|
|
2111
|
-
type:
|
|
2112
|
-
id:
|
|
2113
|
-
providerMetadata:
|
|
2180
|
+
Y.looseObject({
|
|
2181
|
+
type: Y.literal("reasoning-start"),
|
|
2182
|
+
id: Y.string(),
|
|
2183
|
+
providerMetadata: Z.optional()
|
|
2114
2184
|
}),
|
|
2115
|
-
|
|
2116
|
-
type:
|
|
2117
|
-
id:
|
|
2118
|
-
delta:
|
|
2119
|
-
providerMetadata:
|
|
2185
|
+
Y.looseObject({
|
|
2186
|
+
type: Y.literal("reasoning-delta"),
|
|
2187
|
+
id: Y.string(),
|
|
2188
|
+
delta: Y.string(),
|
|
2189
|
+
providerMetadata: Z.optional()
|
|
2120
2190
|
}),
|
|
2121
|
-
|
|
2122
|
-
type:
|
|
2123
|
-
id:
|
|
2124
|
-
providerMetadata:
|
|
2191
|
+
Y.looseObject({
|
|
2192
|
+
type: Y.literal("reasoning-end"),
|
|
2193
|
+
id: Y.string(),
|
|
2194
|
+
providerMetadata: Z.optional()
|
|
2125
2195
|
}),
|
|
2126
|
-
|
|
2127
|
-
type:
|
|
2128
|
-
kind:
|
|
2129
|
-
providerMetadata:
|
|
2196
|
+
Y.looseObject({
|
|
2197
|
+
type: Y.literal("custom"),
|
|
2198
|
+
kind: Y.string().transform((e) => e),
|
|
2199
|
+
providerMetadata: Z.optional()
|
|
2130
2200
|
}),
|
|
2131
|
-
|
|
2132
|
-
type:
|
|
2133
|
-
sourceId:
|
|
2134
|
-
url:
|
|
2135
|
-
title:
|
|
2136
|
-
providerMetadata:
|
|
2201
|
+
Y.looseObject({
|
|
2202
|
+
type: Y.literal("source-url"),
|
|
2203
|
+
sourceId: Y.string(),
|
|
2204
|
+
url: Y.string(),
|
|
2205
|
+
title: Y.string().optional(),
|
|
2206
|
+
providerMetadata: Z.optional()
|
|
2137
2207
|
}),
|
|
2138
|
-
|
|
2139
|
-
type:
|
|
2140
|
-
sourceId:
|
|
2141
|
-
mediaType:
|
|
2142
|
-
title:
|
|
2143
|
-
filename:
|
|
2144
|
-
providerMetadata:
|
|
2208
|
+
Y.looseObject({
|
|
2209
|
+
type: Y.literal("source-document"),
|
|
2210
|
+
sourceId: Y.string(),
|
|
2211
|
+
mediaType: Y.string(),
|
|
2212
|
+
title: Y.string(),
|
|
2213
|
+
filename: Y.string().optional(),
|
|
2214
|
+
providerMetadata: Z.optional()
|
|
2145
2215
|
}),
|
|
2146
|
-
|
|
2147
|
-
type:
|
|
2148
|
-
url:
|
|
2149
|
-
mediaType:
|
|
2150
|
-
providerMetadata:
|
|
2216
|
+
Y.looseObject({
|
|
2217
|
+
type: Y.literal("file"),
|
|
2218
|
+
url: Y.string(),
|
|
2219
|
+
mediaType: Y.string(),
|
|
2220
|
+
providerMetadata: Z.optional()
|
|
2151
2221
|
}),
|
|
2152
|
-
|
|
2153
|
-
type:
|
|
2154
|
-
url:
|
|
2155
|
-
mediaType:
|
|
2156
|
-
providerMetadata:
|
|
2222
|
+
Y.looseObject({
|
|
2223
|
+
type: Y.literal("reasoning-file"),
|
|
2224
|
+
url: Y.string(),
|
|
2225
|
+
mediaType: Y.string(),
|
|
2226
|
+
providerMetadata: Z.optional()
|
|
2157
2227
|
}),
|
|
2158
|
-
|
|
2159
|
-
type:
|
|
2160
|
-
id:
|
|
2161
|
-
data:
|
|
2162
|
-
transient:
|
|
2228
|
+
Y.looseObject({
|
|
2229
|
+
type: Y.custom((e) => typeof e == "string" && e.startsWith("data-"), { message: "Type must start with \"data-\"" }),
|
|
2230
|
+
id: Y.string().optional(),
|
|
2231
|
+
data: Y.unknown(),
|
|
2232
|
+
transient: Y.boolean().optional()
|
|
2163
2233
|
}),
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
type:
|
|
2169
|
-
messageId:
|
|
2170
|
-
messageMetadata:
|
|
2234
|
+
Y.looseObject({ type: Y.literal("start-step") }),
|
|
2235
|
+
Y.looseObject({ type: Y.literal("finish-step") }),
|
|
2236
|
+
Y.looseObject({ type: Y.literal("reset-step") }),
|
|
2237
|
+
Y.looseObject({
|
|
2238
|
+
type: Y.literal("start"),
|
|
2239
|
+
messageId: Y.string().optional(),
|
|
2240
|
+
messageMetadata: Y.unknown().optional()
|
|
2171
2241
|
}),
|
|
2172
|
-
|
|
2173
|
-
type:
|
|
2174
|
-
finishReason:
|
|
2242
|
+
Y.looseObject({
|
|
2243
|
+
type: Y.literal("finish"),
|
|
2244
|
+
finishReason: Y.enum([
|
|
2175
2245
|
"stop",
|
|
2176
2246
|
"length",
|
|
2177
2247
|
"content-filter",
|
|
@@ -2179,36 +2249,36 @@ var Un = J.record(J.string(), Y.optional()), Wn = Wt(() => $t(J.union([
|
|
|
2179
2249
|
"error",
|
|
2180
2250
|
"other"
|
|
2181
2251
|
]).optional(),
|
|
2182
|
-
messageMetadata:
|
|
2252
|
+
messageMetadata: Y.unknown().optional()
|
|
2183
2253
|
}),
|
|
2184
|
-
|
|
2185
|
-
type:
|
|
2186
|
-
reason:
|
|
2254
|
+
Y.looseObject({
|
|
2255
|
+
type: Y.literal("abort"),
|
|
2256
|
+
reason: Y.string().optional()
|
|
2187
2257
|
}),
|
|
2188
|
-
|
|
2189
|
-
type:
|
|
2190
|
-
messageMetadata:
|
|
2258
|
+
Y.looseObject({
|
|
2259
|
+
type: Y.literal("message-metadata"),
|
|
2260
|
+
messageMetadata: Y.unknown()
|
|
2191
2261
|
})
|
|
2192
2262
|
])));
|
|
2193
|
-
function
|
|
2263
|
+
function Qn(e) {
|
|
2194
2264
|
return e.type.startsWith("data-");
|
|
2195
2265
|
}
|
|
2196
|
-
function
|
|
2266
|
+
function $n() {
|
|
2197
2267
|
return /* @__PURE__ */ Object.create(null);
|
|
2198
2268
|
}
|
|
2199
|
-
function
|
|
2269
|
+
function er(e) {
|
|
2200
2270
|
return e.type.startsWith("tool-");
|
|
2201
2271
|
}
|
|
2202
|
-
function
|
|
2272
|
+
function tr(e) {
|
|
2203
2273
|
return e.type === "dynamic-tool";
|
|
2204
2274
|
}
|
|
2205
|
-
function
|
|
2206
|
-
return
|
|
2275
|
+
function Q(e) {
|
|
2276
|
+
return er(e) || tr(e);
|
|
2207
2277
|
}
|
|
2208
|
-
function
|
|
2278
|
+
function nr(e) {
|
|
2209
2279
|
return e.type.split("-").slice(1).join("-");
|
|
2210
2280
|
}
|
|
2211
|
-
function
|
|
2281
|
+
function rr({ lastMessage: e, messageId: t }) {
|
|
2212
2282
|
return {
|
|
2213
2283
|
message: e?.role === "assistant" ? e : {
|
|
2214
2284
|
id: t,
|
|
@@ -2216,12 +2286,12 @@ function Xn({ lastMessage: e, messageId: t }) {
|
|
|
2216
2286
|
role: "assistant",
|
|
2217
2287
|
parts: []
|
|
2218
2288
|
},
|
|
2219
|
-
activeTextParts:
|
|
2220
|
-
activeReasoningParts:
|
|
2221
|
-
partialToolCalls:
|
|
2289
|
+
activeTextParts: $n(),
|
|
2290
|
+
activeReasoningParts: $n(),
|
|
2291
|
+
partialToolCalls: $n()
|
|
2222
2292
|
};
|
|
2223
2293
|
}
|
|
2224
|
-
function
|
|
2294
|
+
function ir({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdateMessageJob: r, onError: i, onToolCall: a, onData: o }) {
|
|
2225
2295
|
return e.pipeThrough(new TransformStream({ async transform(e, s) {
|
|
2226
2296
|
await r(async ({ state: r, write: c }) => {
|
|
2227
2297
|
function l() {
|
|
@@ -2230,7 +2300,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2230
2300
|
return e.slice(t + 1);
|
|
2231
2301
|
}
|
|
2232
2302
|
function u() {
|
|
2233
|
-
return l().filter(
|
|
2303
|
+
return l().filter(Q);
|
|
2234
2304
|
}
|
|
2235
2305
|
function d(e) {
|
|
2236
2306
|
let t = u().find((t) => t.toolCallId === e);
|
|
@@ -2238,13 +2308,13 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2238
2308
|
let n = r.message.parts;
|
|
2239
2309
|
for (let r = n.length - 1; r >= 0; r--) {
|
|
2240
2310
|
let i = n[r];
|
|
2241
|
-
if (
|
|
2311
|
+
if (Q(i) && i.toolCallId === e) {
|
|
2242
2312
|
t = i;
|
|
2243
2313
|
break;
|
|
2244
2314
|
}
|
|
2245
2315
|
}
|
|
2246
2316
|
}
|
|
2247
|
-
if (t == null) throw new
|
|
2317
|
+
if (t == null) throw new J({
|
|
2248
2318
|
chunkType: "tool-invocation",
|
|
2249
2319
|
chunkId: e,
|
|
2250
2320
|
message: `No tool invocation found for tool call ID "${e}".`
|
|
@@ -2252,8 +2322,8 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2252
2322
|
return t;
|
|
2253
2323
|
}
|
|
2254
2324
|
function f(e) {
|
|
2255
|
-
let t = r.message.parts.filter(
|
|
2256
|
-
if (t == null) throw new
|
|
2325
|
+
let t = r.message.parts.filter(Q).find((t) => t.approval?.id === e);
|
|
2326
|
+
if (t == null) throw new J({
|
|
2257
2327
|
chunkType: "tool-approval-response",
|
|
2258
2328
|
chunkId: e,
|
|
2259
2329
|
message: `No tool invocation found for approval ID "${e}".`
|
|
@@ -2261,7 +2331,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2261
2331
|
return t;
|
|
2262
2332
|
}
|
|
2263
2333
|
function p(e, t) {
|
|
2264
|
-
let n = t ?? l().find((t) =>
|
|
2334
|
+
let n = t ?? l().find((t) => er(t) && t.toolCallId === e.toolCallId), i = e, a = n;
|
|
2265
2335
|
if (n != null) {
|
|
2266
2336
|
n.state = e.state, a.input = i.input, a.output = i.output, a.errorText = i.errorText, a.rawInput = i.rawInput, a.preliminary = i.preliminary, e.title !== void 0 && (a.title = e.title), e.toolMetadata !== void 0 && (a.toolMetadata = e.toolMetadata), a.providerExecuted = i.providerExecuted ?? n.providerExecuted;
|
|
2267
2337
|
let t = i.providerMetadata;
|
|
@@ -2316,8 +2386,8 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2316
2386
|
}
|
|
2317
2387
|
async function h(e) {
|
|
2318
2388
|
if (e != null) {
|
|
2319
|
-
let n = r.message.metadata == null ? e :
|
|
2320
|
-
t != null && await
|
|
2389
|
+
let n = r.message.metadata == null ? e : xn(r.message.metadata, e);
|
|
2390
|
+
t != null && await $t({
|
|
2321
2391
|
value: n,
|
|
2322
2392
|
schema: t,
|
|
2323
2393
|
context: {
|
|
@@ -2340,7 +2410,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2340
2410
|
}
|
|
2341
2411
|
case "text-delta": {
|
|
2342
2412
|
let t = r.activeTextParts[e.id];
|
|
2343
|
-
if (t == null) throw new
|
|
2413
|
+
if (t == null) throw new J({
|
|
2344
2414
|
chunkType: "text-delta",
|
|
2345
2415
|
chunkId: e.id,
|
|
2346
2416
|
message: `Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`
|
|
@@ -2350,7 +2420,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2350
2420
|
}
|
|
2351
2421
|
case "text-end": {
|
|
2352
2422
|
let t = r.activeTextParts[e.id];
|
|
2353
|
-
if (t == null) throw new
|
|
2423
|
+
if (t == null) throw new J({
|
|
2354
2424
|
chunkType: "text-end",
|
|
2355
2425
|
chunkId: e.id,
|
|
2356
2426
|
message: `Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`
|
|
@@ -2380,7 +2450,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2380
2450
|
}
|
|
2381
2451
|
case "reasoning-delta": {
|
|
2382
2452
|
let t = r.activeReasoningParts[e.id];
|
|
2383
|
-
if (t == null) throw new
|
|
2453
|
+
if (t == null) throw new J({
|
|
2384
2454
|
chunkType: "reasoning-delta",
|
|
2385
2455
|
chunkId: e.id,
|
|
2386
2456
|
message: `Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`
|
|
@@ -2390,7 +2460,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2390
2460
|
}
|
|
2391
2461
|
case "reasoning-end": {
|
|
2392
2462
|
let t = r.activeReasoningParts[e.id];
|
|
2393
|
-
if (t == null) throw new
|
|
2463
|
+
if (t == null) throw new J({
|
|
2394
2464
|
chunkType: "reasoning-end",
|
|
2395
2465
|
chunkId: e.id,
|
|
2396
2466
|
message: `Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`
|
|
@@ -2427,7 +2497,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2427
2497
|
}), c();
|
|
2428
2498
|
break;
|
|
2429
2499
|
case "tool-input-start": {
|
|
2430
|
-
let t = l().filter(
|
|
2500
|
+
let t = l().filter(er);
|
|
2431
2501
|
r.partialToolCalls[e.toolCallId] = {
|
|
2432
2502
|
text: "",
|
|
2433
2503
|
toolName: e.toolName,
|
|
@@ -2458,13 +2528,13 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2458
2528
|
}
|
|
2459
2529
|
case "tool-input-delta": {
|
|
2460
2530
|
let t = r.partialToolCalls[e.toolCallId];
|
|
2461
|
-
if (t == null) throw new
|
|
2531
|
+
if (t == null) throw new J({
|
|
2462
2532
|
chunkType: "tool-input-delta",
|
|
2463
2533
|
chunkId: e.toolCallId,
|
|
2464
2534
|
message: `Received tool-input-delta for missing tool call with ID "${e.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`
|
|
2465
2535
|
});
|
|
2466
2536
|
t.text += e.inputTextDelta;
|
|
2467
|
-
let { value: n } = await
|
|
2537
|
+
let { value: n } = await Hn(t.text);
|
|
2468
2538
|
t.dynamic ? m({
|
|
2469
2539
|
toolCallId: e.toolCallId,
|
|
2470
2540
|
toolName: t.toolName,
|
|
@@ -2504,7 +2574,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2504
2574
|
}), c(), a && !e.providerExecuted && await a({ toolCall: e });
|
|
2505
2575
|
break;
|
|
2506
2576
|
case "tool-input-error": {
|
|
2507
|
-
let t = l().filter(
|
|
2577
|
+
let t = l().filter(Q).find((t) => t.toolCallId === e.toolCallId);
|
|
2508
2578
|
(t == null ? e.dynamic : t.type === "dynamic-tool") ? m({
|
|
2509
2579
|
toolCallId: e.toolCallId,
|
|
2510
2580
|
toolName: e.toolName,
|
|
@@ -2568,7 +2638,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2568
2638
|
toolMetadata: t.toolMetadata
|
|
2569
2639
|
}, t) : p({
|
|
2570
2640
|
toolCallId: e.toolCallId,
|
|
2571
|
-
toolName:
|
|
2641
|
+
toolName: nr(t),
|
|
2572
2642
|
state: "output-available",
|
|
2573
2643
|
input: t.input,
|
|
2574
2644
|
output: e.output,
|
|
@@ -2594,7 +2664,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2594
2664
|
toolMetadata: t.toolMetadata
|
|
2595
2665
|
}, t) : p({
|
|
2596
2666
|
toolCallId: e.toolCallId,
|
|
2597
|
-
toolName:
|
|
2667
|
+
toolName: nr(t),
|
|
2598
2668
|
state: "output-error",
|
|
2599
2669
|
input: t.input,
|
|
2600
2670
|
rawInput: t.rawInput,
|
|
@@ -2612,7 +2682,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2612
2682
|
case "finish-step": break;
|
|
2613
2683
|
case "reset-step": {
|
|
2614
2684
|
let e = l();
|
|
2615
|
-
r.activeTextParts =
|
|
2685
|
+
r.activeTextParts = $n(), r.activeReasoningParts = $n(), r.partialToolCalls = $n(), e.length > 0 && (r.message.parts.splice(r.message.parts.length - e.length, e.length), c());
|
|
2616
2686
|
break;
|
|
2617
2687
|
}
|
|
2618
2688
|
case "start":
|
|
@@ -2627,10 +2697,10 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2627
2697
|
case "error":
|
|
2628
2698
|
i?.(Error(e.errorText));
|
|
2629
2699
|
break;
|
|
2630
|
-
default: if (
|
|
2700
|
+
default: if (Qn(e)) {
|
|
2631
2701
|
if (n?.[e.type] != null) {
|
|
2632
2702
|
let t = r.message.parts.findIndex((t) => "id" in t && "data" in t && t.id === e.id && t.type === e.type), i = t >= 0 ? t : r.message.parts.length;
|
|
2633
|
-
await
|
|
2703
|
+
await $t({
|
|
2634
2704
|
value: e.data,
|
|
2635
2705
|
schema: n[e.type],
|
|
2636
2706
|
context: {
|
|
@@ -2653,7 +2723,7 @@ function Zn({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
2653
2723
|
});
|
|
2654
2724
|
} }));
|
|
2655
2725
|
}
|
|
2656
|
-
async function
|
|
2726
|
+
async function ar({ stream: e, onError: t, abortSignal: n }) {
|
|
2657
2727
|
let r = e.getReader(), i = () => {
|
|
2658
2728
|
r.cancel().catch(() => {});
|
|
2659
2729
|
};
|
|
@@ -2669,29 +2739,29 @@ async function Qn({ stream: e, onError: t, abortSignal: n }) {
|
|
|
2669
2739
|
n?.removeEventListener("abort", i), r.releaseLock();
|
|
2670
2740
|
}
|
|
2671
2741
|
}
|
|
2672
|
-
|
|
2742
|
+
I({
|
|
2673
2743
|
prefix: "aitxt",
|
|
2674
2744
|
size: 24
|
|
2675
|
-
}),
|
|
2745
|
+
}), I({
|
|
2676
2746
|
prefix: "call",
|
|
2677
2747
|
size: 24
|
|
2678
|
-
}),
|
|
2748
|
+
}), I({
|
|
2679
2749
|
prefix: "aitxt",
|
|
2680
2750
|
size: 24
|
|
2681
|
-
}),
|
|
2751
|
+
}), I({
|
|
2682
2752
|
prefix: "call",
|
|
2683
2753
|
size: 24
|
|
2684
|
-
}),
|
|
2754
|
+
}), Y.record(Y.string(), X.optional()), Y.record(Y.string(), Y.string()), I({
|
|
2685
2755
|
prefix: "call",
|
|
2686
2756
|
size: 24
|
|
2687
|
-
}),
|
|
2757
|
+
}), I({
|
|
2688
2758
|
prefix: "call",
|
|
2689
2759
|
size: 24
|
|
2690
|
-
}), new TextEncoder(),
|
|
2760
|
+
}), new TextEncoder(), I({
|
|
2691
2761
|
prefix: "aiobj",
|
|
2692
2762
|
size: 24
|
|
2693
2763
|
});
|
|
2694
|
-
var
|
|
2764
|
+
var or = class {
|
|
2695
2765
|
constructor() {
|
|
2696
2766
|
this.queue = [], this.isProcessing = !1;
|
|
2697
2767
|
}
|
|
@@ -2713,14 +2783,14 @@ var $n = class {
|
|
|
2713
2783
|
});
|
|
2714
2784
|
}
|
|
2715
2785
|
};
|
|
2716
|
-
|
|
2786
|
+
I({
|
|
2717
2787
|
prefix: "aiobj",
|
|
2718
2788
|
size: 24
|
|
2719
|
-
}),
|
|
2789
|
+
}), I({
|
|
2720
2790
|
prefix: "call",
|
|
2721
2791
|
size: 24
|
|
2722
2792
|
});
|
|
2723
|
-
async function
|
|
2793
|
+
async function sr(e) {
|
|
2724
2794
|
if (e == null) return [];
|
|
2725
2795
|
if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw Error("FileList is not supported in the current environment");
|
|
2726
2796
|
return Promise.all(Array.from(e).map(async (e) => {
|
|
@@ -2738,14 +2808,14 @@ async function er(e) {
|
|
|
2738
2808
|
};
|
|
2739
2809
|
}));
|
|
2740
2810
|
}
|
|
2741
|
-
var
|
|
2811
|
+
var cr = class {
|
|
2742
2812
|
constructor({ api: e = "/api/chat", credentials: t, headers: n, body: r, fetch: i, prepareSendMessagesRequest: a, prepareReconnectToStreamRequest: o }) {
|
|
2743
2813
|
this.api = e, this.credentials = t, this.headers = n, this.body = r, this.fetch = i, this.prepareSendMessagesRequest = a, this.prepareReconnectToStreamRequest = o;
|
|
2744
2814
|
}
|
|
2745
2815
|
async sendMessages({ abortSignal: e, ...t }) {
|
|
2746
|
-
let n = await
|
|
2747
|
-
...
|
|
2748
|
-
...
|
|
2816
|
+
let n = await K(this.body), r = await K(this.headers), i = await K(this.credentials), a = {
|
|
2817
|
+
...F(r),
|
|
2818
|
+
...F(t.headers)
|
|
2749
2819
|
}, o = await this.prepareSendMessagesRequest?.call(this, {
|
|
2750
2820
|
api: this.api,
|
|
2751
2821
|
id: t.chatId,
|
|
@@ -2759,7 +2829,7 @@ var tr = class {
|
|
|
2759
2829
|
requestMetadata: t.metadata,
|
|
2760
2830
|
trigger: t.trigger,
|
|
2761
2831
|
messageId: t.messageId
|
|
2762
|
-
}), s = o?.api ?? this.api, c = o?.headers === void 0 ? a :
|
|
2832
|
+
}), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : F(o.headers), l = o?.body === void 0 ? {
|
|
2763
2833
|
...n,
|
|
2764
2834
|
...t.body,
|
|
2765
2835
|
id: t.chatId,
|
|
@@ -2776,14 +2846,14 @@ var tr = class {
|
|
|
2776
2846
|
credentials: u,
|
|
2777
2847
|
signal: e
|
|
2778
2848
|
});
|
|
2779
|
-
if (!d.ok) throw Error(await d.text()
|
|
2849
|
+
if (!d.ok) throw Error(await d.text() || "Failed to fetch the chat response.");
|
|
2780
2850
|
if (!d.body) throw Error("The response body is empty.");
|
|
2781
2851
|
return this.processResponseStream(d.body);
|
|
2782
2852
|
}
|
|
2783
2853
|
async reconnectToStream(e) {
|
|
2784
|
-
let t = await
|
|
2785
|
-
...
|
|
2786
|
-
...
|
|
2854
|
+
let t = await K(this.body), n = await K(this.headers), r = await K(this.credentials), i = {
|
|
2855
|
+
...F(n),
|
|
2856
|
+
...F(e.headers)
|
|
2787
2857
|
}, a = await this.prepareReconnectToStreamRequest?.call(this, {
|
|
2788
2858
|
api: this.api,
|
|
2789
2859
|
id: e.chatId,
|
|
@@ -2794,33 +2864,33 @@ var tr = class {
|
|
|
2794
2864
|
headers: i,
|
|
2795
2865
|
credentials: r,
|
|
2796
2866
|
requestMetadata: e.metadata
|
|
2797
|
-
}), o = a?.api ?? `${this.api}/${e.chatId}/stream`, s = a?.headers === void 0 ? i :
|
|
2867
|
+
}), o = a?.api ?? `${this.api}/${e.chatId}/stream`, s = a?.headers === void 0 ? i : F(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
|
|
2798
2868
|
method: "GET",
|
|
2799
2869
|
headers: s,
|
|
2800
2870
|
credentials: c,
|
|
2801
2871
|
signal: e.abortSignal
|
|
2802
2872
|
});
|
|
2803
2873
|
if (l.status === 204) return null;
|
|
2804
|
-
if (!l.ok) throw Error(await l.text()
|
|
2874
|
+
if (!l.ok) throw Error(await l.text() || "Failed to fetch the chat response.");
|
|
2805
2875
|
if (!l.body) throw Error("The response body is empty.");
|
|
2806
2876
|
return this.processResponseStream(l.body);
|
|
2807
2877
|
}
|
|
2808
|
-
},
|
|
2878
|
+
}, lr = class extends cr {
|
|
2809
2879
|
constructor(e = {}) {
|
|
2810
2880
|
super(e);
|
|
2811
2881
|
}
|
|
2812
2882
|
processResponseStream(e) {
|
|
2813
|
-
return
|
|
2883
|
+
return tn({
|
|
2814
2884
|
stream: e,
|
|
2815
|
-
schema:
|
|
2885
|
+
schema: Zn
|
|
2816
2886
|
}).pipeThrough(new TransformStream({ async transform(e, t) {
|
|
2817
2887
|
if (!e.success) throw e.error;
|
|
2818
2888
|
t.enqueue(e.value);
|
|
2819
2889
|
} }));
|
|
2820
2890
|
}
|
|
2821
|
-
},
|
|
2822
|
-
constructor({ generateId: e =
|
|
2823
|
-
this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.jobExecutor = new
|
|
2891
|
+
}, ur = class {
|
|
2892
|
+
constructor({ generateId: e = L, id: t = e(), transport: n = new lr(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
|
|
2893
|
+
this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.jobExecutor = new or(), this.sendMessage = async (e, t) => {
|
|
2824
2894
|
if (e == null) {
|
|
2825
2895
|
await this.makeRequest({
|
|
2826
2896
|
trigger: "submit-message",
|
|
@@ -2835,7 +2905,7 @@ var tr = class {
|
|
|
2835
2905
|
this.pendingMessagePreparations.add(t);
|
|
2836
2906
|
let r;
|
|
2837
2907
|
try {
|
|
2838
|
-
r = Array.isArray(e.files) ? e.files : await
|
|
2908
|
+
r = Array.isArray(e.files) ? e.files : await sr(e.files);
|
|
2839
2909
|
} finally {
|
|
2840
2910
|
this.pendingMessagePreparations.delete(t);
|
|
2841
2911
|
}
|
|
@@ -2850,8 +2920,8 @@ var tr = class {
|
|
|
2850
2920
|
if (t === -1) throw Error(`message with id ${e.messageId} not found`);
|
|
2851
2921
|
if (this.state.messages[t].role !== "user") throw Error(`message with id ${e.messageId} is not a user message`);
|
|
2852
2922
|
this.state.messages = this.state.messages.slice(0, t + 1), this.state.replaceMessage(t, {
|
|
2853
|
-
...n,
|
|
2854
2923
|
id: e.messageId,
|
|
2924
|
+
...n,
|
|
2855
2925
|
role: n.role ?? "user",
|
|
2856
2926
|
metadata: e.metadata
|
|
2857
2927
|
});
|
|
@@ -2882,7 +2952,7 @@ var tr = class {
|
|
|
2882
2952
|
}, this.clearError = () => {
|
|
2883
2953
|
this.status === "error" && (this.state.error = void 0, this.setStatus({ status: "ready" }));
|
|
2884
2954
|
}, this.addToolApprovalResponse = async ({ id: e, approved: t, reason: n, options: r }) => this.jobExecutor.run(async () => {
|
|
2885
|
-
let i = this.state.messages, a = i[i.length - 1], o = (r) =>
|
|
2955
|
+
let i = this.state.messages, a = i[i.length - 1], o = (r) => Q(r) && r.state === "approval-requested" && r.approval.id === e ? {
|
|
2886
2956
|
...r,
|
|
2887
2957
|
state: "approval-responded",
|
|
2888
2958
|
approval: {
|
|
@@ -2903,7 +2973,7 @@ var tr = class {
|
|
|
2903
2973
|
});
|
|
2904
2974
|
});
|
|
2905
2975
|
}), this.addToolOutput = async ({ state: e = "output-available", toolCallId: t, output: n, errorText: r, options: i }) => this.jobExecutor.run(async () => {
|
|
2906
|
-
let a = this.state.messages, o = a[a.length - 1], s = (i) =>
|
|
2976
|
+
let a = this.state.messages, o = a[a.length - 1], s = (i) => Q(i) && i.toolCallId === t ? {
|
|
2907
2977
|
...i,
|
|
2908
2978
|
state: e,
|
|
2909
2979
|
output: n,
|
|
@@ -2991,7 +3061,7 @@ var tr = class {
|
|
|
2991
3061
|
let f = this.lastMessage, p = !1, m = !1, h = !1, g;
|
|
2992
3062
|
try {
|
|
2993
3063
|
let a = {
|
|
2994
|
-
state:
|
|
3064
|
+
state: rr({
|
|
2995
3065
|
lastMessage: e === "resume-stream" || e === "regenerate-message" ? void 0 : this.state.snapshot(f),
|
|
2996
3066
|
messageId: this.generateId()
|
|
2997
3067
|
}),
|
|
@@ -3010,8 +3080,8 @@ var tr = class {
|
|
|
3010
3080
|
body: r,
|
|
3011
3081
|
trigger: e,
|
|
3012
3082
|
messageId: i
|
|
3013
|
-
}), await
|
|
3014
|
-
stream:
|
|
3083
|
+
}), await ar({
|
|
3084
|
+
stream: ir({
|
|
3015
3085
|
stream: o,
|
|
3016
3086
|
onToolCall: this.onToolCall,
|
|
3017
3087
|
onData: this.onData,
|
|
@@ -3063,39 +3133,39 @@ var tr = class {
|
|
|
3063
3133
|
});
|
|
3064
3134
|
}
|
|
3065
3135
|
};
|
|
3066
|
-
function
|
|
3136
|
+
function dr({ messages: e }) {
|
|
3067
3137
|
let t = e[e.length - 1];
|
|
3068
3138
|
if (!t || t.role !== "assistant") return !1;
|
|
3069
|
-
let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter(
|
|
3139
|
+
let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter(Q);
|
|
3070
3140
|
return r.filter((e) => e.state === "approval-responded").length > 0 && r.every((e) => e.state === "output-available" || e.state === "output-error" || e.state === "output-denied" || e.state === "approval-responded");
|
|
3071
3141
|
}
|
|
3072
3142
|
//#endregion
|
|
3073
3143
|
//#region ../../node_modules/.pnpm/swrv@1.2.0_vue@3.5.42_typescript@6.0.3_/node_modules/swrv/esm/lib/hash.js
|
|
3074
|
-
var
|
|
3075
|
-
function
|
|
3144
|
+
var fr = /* @__PURE__ */ new WeakMap(), pr = 0;
|
|
3145
|
+
function mr(e) {
|
|
3076
3146
|
if (!e.length) return "";
|
|
3077
3147
|
for (var t = "arg", n = 0; n < e.length; ++n) {
|
|
3078
3148
|
var r = void 0;
|
|
3079
|
-
e[n] === null || typeof e[n] != "object" && typeof e[n] != "function" ? r = typeof e[n] == "string" ? "\"" + e[n] + "\"" : String(e[n]) :
|
|
3149
|
+
e[n] === null || typeof e[n] != "object" && typeof e[n] != "function" ? r = typeof e[n] == "string" ? "\"" + e[n] + "\"" : String(e[n]) : fr.has(e[n]) ? r = fr.get(e[n]) : (r = pr, fr.set(e[n], pr++)), t += "@" + r;
|
|
3080
3150
|
}
|
|
3081
3151
|
return t;
|
|
3082
3152
|
}
|
|
3083
3153
|
//#endregion
|
|
3084
3154
|
//#region ../../node_modules/.pnpm/swrv@1.2.0_vue@3.5.42_typescript@6.0.3_/node_modules/swrv/esm/cache/index.js
|
|
3085
|
-
function
|
|
3155
|
+
function hr(e) {
|
|
3086
3156
|
if (typeof e == "function") try {
|
|
3087
3157
|
e = e();
|
|
3088
3158
|
} catch {
|
|
3089
3159
|
e = "";
|
|
3090
3160
|
}
|
|
3091
|
-
return e = Array.isArray(e) ?
|
|
3161
|
+
return e = Array.isArray(e) ? mr(e) : String(e || ""), e;
|
|
3092
3162
|
}
|
|
3093
|
-
var
|
|
3163
|
+
var gr = function() {
|
|
3094
3164
|
function e(e) {
|
|
3095
3165
|
e === void 0 && (e = 0), this.items = /* @__PURE__ */ new Map(), this.ttl = e;
|
|
3096
3166
|
}
|
|
3097
3167
|
return e.prototype.serializeKey = function(e) {
|
|
3098
|
-
return
|
|
3168
|
+
return hr(e);
|
|
3099
3169
|
}, e.prototype.get = function(e) {
|
|
3100
3170
|
var t = this.serializeKey(e);
|
|
3101
3171
|
return this.items.get(t);
|
|
@@ -3117,26 +3187,26 @@ var lr = function() {
|
|
|
3117
3187
|
}();
|
|
3118
3188
|
//#endregion
|
|
3119
3189
|
//#region ../../node_modules/.pnpm/swrv@1.2.0_vue@3.5.42_typescript@6.0.3_/node_modules/swrv/esm/lib/web-preset.js
|
|
3120
|
-
function
|
|
3190
|
+
function _r() {
|
|
3121
3191
|
return navigator.onLine === void 0 || navigator.onLine;
|
|
3122
3192
|
}
|
|
3123
|
-
function
|
|
3193
|
+
function vr() {
|
|
3124
3194
|
return typeof document < "u" && document.visibilityState !== void 0 ? document.visibilityState !== "hidden" : !0;
|
|
3125
3195
|
}
|
|
3126
|
-
var
|
|
3127
|
-
isOnline:
|
|
3128
|
-
isDocumentVisible:
|
|
3196
|
+
var yr = {
|
|
3197
|
+
isOnline: _r,
|
|
3198
|
+
isDocumentVisible: vr,
|
|
3129
3199
|
fetcher: function(e) {
|
|
3130
3200
|
return fetch(e).then(function(e) {
|
|
3131
3201
|
return e.json();
|
|
3132
3202
|
});
|
|
3133
3203
|
}
|
|
3134
|
-
},
|
|
3135
|
-
return
|
|
3204
|
+
}, $ = function() {
|
|
3205
|
+
return $ = Object.assign || function(e) {
|
|
3136
3206
|
for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
3137
3207
|
return e;
|
|
3138
|
-
},
|
|
3139
|
-
},
|
|
3208
|
+
}, $.apply(this, arguments);
|
|
3209
|
+
}, br = function(e, t, n, r) {
|
|
3140
3210
|
function i(e) {
|
|
3141
3211
|
return e instanceof n ? e : new n(function(t) {
|
|
3142
3212
|
t(e);
|
|
@@ -3162,7 +3232,7 @@ var fr = {
|
|
|
3162
3232
|
}
|
|
3163
3233
|
c((r = r.apply(e, t || [])).next());
|
|
3164
3234
|
});
|
|
3165
|
-
},
|
|
3235
|
+
}, xr = function(e, t) {
|
|
3166
3236
|
var n = {
|
|
3167
3237
|
label: 0,
|
|
3168
3238
|
sent: function() {
|
|
@@ -3235,7 +3305,7 @@ var fr = {
|
|
|
3235
3305
|
done: !0
|
|
3236
3306
|
};
|
|
3237
3307
|
}
|
|
3238
|
-
},
|
|
3308
|
+
}, Sr = function(e, t) {
|
|
3239
3309
|
var n = typeof Symbol == "function" && e[Symbol.iterator];
|
|
3240
3310
|
if (!n) return e;
|
|
3241
3311
|
var r = n.call(e), i, a = [], o;
|
|
@@ -3251,11 +3321,11 @@ var fr = {
|
|
|
3251
3321
|
}
|
|
3252
3322
|
}
|
|
3253
3323
|
return a;
|
|
3254
|
-
},
|
|
3324
|
+
}, Cr = function(e, t, n) {
|
|
3255
3325
|
if (n || arguments.length === 2) for (var r = 0, i = t.length, a; r < i; r++) (a || !(r in t)) && (a ||= Array.prototype.slice.call(t, 0, r), a[r] = t[r]);
|
|
3256
3326
|
return e.concat(a || Array.prototype.slice.call(t));
|
|
3257
|
-
},
|
|
3258
|
-
cache:
|
|
3327
|
+
}, wr = new gr(), Tr = new gr(), Er = new gr(), Dr = {
|
|
3328
|
+
cache: wr,
|
|
3259
3329
|
refreshInterval: 0,
|
|
3260
3330
|
ttl: 0,
|
|
3261
3331
|
serverTTL: 1e3,
|
|
@@ -3265,15 +3335,15 @@ var fr = {
|
|
|
3265
3335
|
shouldRetryOnError: !0,
|
|
3266
3336
|
errorRetryInterval: 5e3,
|
|
3267
3337
|
errorRetryCount: 5,
|
|
3268
|
-
fetcher:
|
|
3269
|
-
isOnline:
|
|
3270
|
-
isDocumentVisible:
|
|
3338
|
+
fetcher: yr.fetcher,
|
|
3339
|
+
isOnline: yr.isOnline,
|
|
3340
|
+
isDocumentVisible: yr.isDocumentVisible
|
|
3271
3341
|
};
|
|
3272
|
-
function
|
|
3273
|
-
var r =
|
|
3274
|
-
r ? r.data.push(t) :
|
|
3342
|
+
function Or(e, t, n) {
|
|
3343
|
+
var r = Tr.get(e);
|
|
3344
|
+
r ? r.data.push(t) : Tr.set(e, [t], n > 0 ? n + 5e3 : n);
|
|
3275
3345
|
}
|
|
3276
|
-
function
|
|
3346
|
+
function kr(e, t, n) {
|
|
3277
3347
|
if (n.isDocumentVisible() && !(n.errorRetryCount !== void 0 && t > n.errorRetryCount)) {
|
|
3278
3348
|
var r = Math.min(t || 0, n.errorRetryCount), i = r * n.errorRetryInterval;
|
|
3279
3349
|
setTimeout(function() {
|
|
@@ -3284,17 +3354,17 @@ function xr(e, t, n) {
|
|
|
3284
3354
|
}, i);
|
|
3285
3355
|
}
|
|
3286
3356
|
}
|
|
3287
|
-
function
|
|
3357
|
+
function Ar(e) {
|
|
3288
3358
|
var t = e.shouldRetry, n = t === void 0 ? void 0 : t, r = e.error;
|
|
3289
|
-
return typeof n == "function" ? n(r) : typeof n == "boolean" ? n :
|
|
3359
|
+
return typeof n == "function" ? n(r) : typeof n == "boolean" ? n : Dr.shouldRetryOnError;
|
|
3290
3360
|
}
|
|
3291
|
-
var
|
|
3292
|
-
return n === void 0 && (n =
|
|
3361
|
+
var jr = function(e, t, n, r) {
|
|
3362
|
+
return n === void 0 && (n = wr), r === void 0 && (r = Dr.ttl), br(void 0, void 0, void 0, function() {
|
|
3293
3363
|
var i, a, o, s, c, l, u;
|
|
3294
|
-
return
|
|
3364
|
+
return xr(this, function(d) {
|
|
3295
3365
|
switch (d.label) {
|
|
3296
3366
|
case 0:
|
|
3297
|
-
if (!
|
|
3367
|
+
if (!Nr(t)) return [3, 5];
|
|
3298
3368
|
d.label = 1;
|
|
3299
3369
|
case 1: return d.trys.push([
|
|
3300
3370
|
1,
|
|
@@ -3316,7 +3386,7 @@ var Cr = function(e, t, n, r) {
|
|
|
3316
3386
|
} catch (e) {
|
|
3317
3387
|
console.error("swrv(mutate): failed to set cache", e);
|
|
3318
3388
|
}
|
|
3319
|
-
return l =
|
|
3389
|
+
return l = Tr.get(e), l && l.data.length && (u = l.data.filter(function(t) {
|
|
3320
3390
|
return t.key === e;
|
|
3321
3391
|
}), u.forEach(function(e, t) {
|
|
3322
3392
|
c.data !== void 0 && (e.data = c.data), e.error = c.error, e.isValidating = c.isValidating, e.isLoading = c.isValidating, t !== u.length - 1 && delete u[t];
|
|
@@ -3325,12 +3395,12 @@ var Cr = function(e, t, n, r) {
|
|
|
3325
3395
|
});
|
|
3326
3396
|
});
|
|
3327
3397
|
};
|
|
3328
|
-
function
|
|
3398
|
+
function Mr() {
|
|
3329
3399
|
for (var e = this, t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n];
|
|
3330
|
-
var r, i, a =
|
|
3400
|
+
var r, i, a = $({}, Dr), o = !1, s = !1;
|
|
3331
3401
|
if (!se()) return console.error("useSWRV must be called inside setup() or an active effectScope()."), null;
|
|
3332
3402
|
var c = typeof window > "u" || typeof document > "u";
|
|
3333
|
-
t.length >= 1 && (r = t[0]), t.length >= 2 && (i = t[1]), t.length > 2 && (a =
|
|
3403
|
+
t.length >= 1 && (r = t[0]), t.length >= 2 && (i = t[1]), t.length > 2 && (a = $($({}, a), t[2]));
|
|
3334
3404
|
var l = c ? a.serverTTL : a.ttl, u = typeof r == "function" ? r : y(r);
|
|
3335
3405
|
i === void 0 && (i = a.fetcher);
|
|
3336
3406
|
var d = null;
|
|
@@ -3342,32 +3412,32 @@ function wr() {
|
|
|
3342
3412
|
key: null
|
|
3343
3413
|
});
|
|
3344
3414
|
var f = function(t, n) {
|
|
3345
|
-
return
|
|
3415
|
+
return br(e, void 0, void 0, function() {
|
|
3346
3416
|
var e, r, s, c, p, m, h, g = this;
|
|
3347
|
-
return
|
|
3417
|
+
return xr(this, function(_) {
|
|
3348
3418
|
switch (_.label) {
|
|
3349
3419
|
case 0: return e = d.data === void 0, r = u.value, r ? (s = a.cache.get(r), c = s && s.data, d.isValidating = !0, d.isLoading = !c, c && (d.data = c.data, d.error = c.error), p = t || i, !p || !a.isDocumentVisible() && !e || n?.forceRevalidate !== void 0 && !n?.forceRevalidate || s && (m = !!(Date.now() - s.createdAt >= a.dedupingInterval || n?.forceRevalidate), !m) ? (d.isValidating = !1, d.isLoading = !1, [2]) : (h = function() {
|
|
3350
|
-
return
|
|
3420
|
+
return br(g, void 0, void 0, function() {
|
|
3351
3421
|
var e, t, i, s, c, u;
|
|
3352
|
-
return
|
|
3422
|
+
return xr(this, function(m) {
|
|
3353
3423
|
switch (m.label) {
|
|
3354
|
-
case 0: return e =
|
|
3424
|
+
case 0: return e = Er.get(r), e ? [3, 2] : (t = Array.isArray(r) ? r : [r], i = p.apply(void 0, Cr([], Sr(t), !1)), Er.set(r, i, a.dedupingInterval), [4, jr(r, i, a.cache, l)]);
|
|
3355
3425
|
case 1: return m.sent(), [3, 4];
|
|
3356
|
-
case 2: return [4,
|
|
3426
|
+
case 2: return [4, jr(r, e.data, a.cache, l)];
|
|
3357
3427
|
case 3: m.sent(), m.label = 4;
|
|
3358
|
-
case 4: return d.isValidating = !1, d.isLoading = !1,
|
|
3428
|
+
case 4: return d.isValidating = !1, d.isLoading = !1, Er.delete(r), d.error !== void 0 && (s = Ar({
|
|
3359
3429
|
shouldRetry: a.shouldRetryOnError,
|
|
3360
3430
|
error: d.error
|
|
3361
|
-
}), c =
|
|
3431
|
+
}), c = Ar({
|
|
3362
3432
|
shouldRetry: !n || n.shouldRetryOnError,
|
|
3363
3433
|
error: d.error
|
|
3364
|
-
}), u = !o && s && c, u &&
|
|
3434
|
+
}), u = !o && s && c, u && kr(f, n ? n.errorRetryCount : 1, a)), [2];
|
|
3365
3435
|
}
|
|
3366
3436
|
});
|
|
3367
3437
|
});
|
|
3368
3438
|
}, c && a.revalidateDebounce ? (setTimeout(function() {
|
|
3369
|
-
return
|
|
3370
|
-
return
|
|
3439
|
+
return br(g, void 0, void 0, function() {
|
|
3440
|
+
return xr(this, function(e) {
|
|
3371
3441
|
switch (e.label) {
|
|
3372
3442
|
case 0: return o ? [3, 2] : [4, h()];
|
|
3373
3443
|
case 1: e.sent(), e.label = 2;
|
|
@@ -3383,16 +3453,16 @@ function wr() {
|
|
|
3383
3453
|
});
|
|
3384
3454
|
});
|
|
3385
3455
|
}, p = function() {
|
|
3386
|
-
return
|
|
3387
|
-
return
|
|
3456
|
+
return br(e, void 0, void 0, function() {
|
|
3457
|
+
return xr(this, function(e) {
|
|
3388
3458
|
return [2, f(null, { shouldRetryOnError: !1 })];
|
|
3389
3459
|
});
|
|
3390
3460
|
});
|
|
3391
3461
|
}, m = null;
|
|
3392
3462
|
if (!c) {
|
|
3393
3463
|
var h = function() {
|
|
3394
|
-
return
|
|
3395
|
-
return
|
|
3464
|
+
return br(e, void 0, void 0, function() {
|
|
3465
|
+
return xr(this, function(e) {
|
|
3396
3466
|
switch (e.label) {
|
|
3397
3467
|
case 0: return !d.error && a.isOnline() ? [4, f()] : [3, 2];
|
|
3398
3468
|
case 1: return e.sent(), [3, 3];
|
|
@@ -3406,28 +3476,28 @@ function wr() {
|
|
|
3406
3476
|
}
|
|
3407
3477
|
le(function() {
|
|
3408
3478
|
o = !0, m &&= (clearTimeout(m), null), !c && a.revalidateOnFocus && (document.removeEventListener("visibilitychange", p, !1), window.removeEventListener("focus", p, !1));
|
|
3409
|
-
var e =
|
|
3479
|
+
var e = Tr.get(u.value);
|
|
3410
3480
|
e && (e.data = e.data.filter(function(e) {
|
|
3411
3481
|
return e !== d;
|
|
3412
3482
|
}));
|
|
3413
3483
|
});
|
|
3414
3484
|
try {
|
|
3415
3485
|
fe(u, function(e) {
|
|
3416
|
-
ce(u) || (u.value = e), d.key = e, d.isValidating = !!e,
|
|
3486
|
+
ce(u) || (u.value = e), d.key = e, d.isValidating = !!e, Or(u.value, d, l), !c && !s && u.value && f(), s = !1;
|
|
3417
3487
|
}, { immediate: !0 });
|
|
3418
3488
|
} catch {}
|
|
3419
|
-
return
|
|
3420
|
-
return f(e,
|
|
3489
|
+
return $($({}, de(d)), { mutate: function(e, t) {
|
|
3490
|
+
return f(e, $($({}, t), { forceRevalidate: !0 }));
|
|
3421
3491
|
} });
|
|
3422
3492
|
}
|
|
3423
|
-
function
|
|
3493
|
+
function Nr(e) {
|
|
3424
3494
|
return typeof e == "object" && !!e && typeof e.then == "function";
|
|
3425
3495
|
}
|
|
3426
3496
|
//#endregion
|
|
3427
3497
|
//#region ../../node_modules/.pnpm/swrv@1.2.0_vue@3.5.42_typescript@6.0.3_/node_modules/swrv/esm/index.js
|
|
3428
|
-
var
|
|
3429
|
-
|
|
3430
|
-
var
|
|
3498
|
+
var Pr = Mr;
|
|
3499
|
+
Pr.default, Pr.default;
|
|
3500
|
+
var Fr = class {
|
|
3431
3501
|
constructor(e) {
|
|
3432
3502
|
this.statusRef = y("ready"), this.errorRef = y(void 0), this.pushMessage = (e) => {
|
|
3433
3503
|
this.messagesRef.value = [...this.messagesRef.value, e];
|
|
@@ -3455,33 +3525,33 @@ var Dr = class {
|
|
|
3455
3525
|
set error(e) {
|
|
3456
3526
|
this.errorRef.value = e;
|
|
3457
3527
|
}
|
|
3458
|
-
},
|
|
3528
|
+
}, Ir = class extends ur {
|
|
3459
3529
|
constructor({ messages: e, ...t }) {
|
|
3460
3530
|
super({
|
|
3461
3531
|
...t,
|
|
3462
|
-
state: new
|
|
3532
|
+
state: new Fr(e)
|
|
3463
3533
|
});
|
|
3464
3534
|
}
|
|
3465
|
-
},
|
|
3535
|
+
}, Lr = "voice-", Rr = (e) => e.replace(/\s+/g, " ").trim().toLowerCase(), zr = (e) => Rr(e.parts.filter((e) => e.type === "text").map((e) => "text" in e ? e.text : "").join(" ")), Br = 8, Vr = (e, t) => {
|
|
3466
3536
|
let n = e.filter((e) => e.role === "user").map((e) => ({
|
|
3467
|
-
text:
|
|
3537
|
+
text: zr(e),
|
|
3468
3538
|
taken: !1
|
|
3469
3539
|
}));
|
|
3470
3540
|
return t.filter((e) => {
|
|
3471
3541
|
if (!e.id.startsWith("voice-") || e.role !== "user") return !1;
|
|
3472
|
-
let t =
|
|
3542
|
+
let t = zr(e), r = n.find((e) => !e.taken && e.text.length > 0 && (e.text === t || e.text.length >= Br && t.endsWith(e.text)));
|
|
3473
3543
|
return !r || (r.taken = !0, !1);
|
|
3474
3544
|
});
|
|
3475
|
-
},
|
|
3545
|
+
}, Hr = (e) => {
|
|
3476
3546
|
let t = e.type ?? "";
|
|
3477
3547
|
return t === "dynamic-tool" ? e.toolName ?? "" : t.startsWith("tool-") ? t.slice(5) : "";
|
|
3478
|
-
},
|
|
3548
|
+
}, Ur = ({ messages: e }) => {
|
|
3479
3549
|
let t = e[e.length - 1];
|
|
3480
3550
|
if (!t || t.role !== "assistant") return !1;
|
|
3481
|
-
let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter((e) => !e.providerExecuted && te(
|
|
3551
|
+
let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter((e) => !e.providerExecuted && te(Hr(e)));
|
|
3482
3552
|
return r.length > 0 && r.every((e) => ne.has(e.state ?? ""));
|
|
3483
3553
|
};
|
|
3484
|
-
function
|
|
3554
|
+
function Wr(e) {
|
|
3485
3555
|
return b(`chatbot-${e}`, () => {
|
|
3486
3556
|
let { t, te: n, locale: r } = me({ useScope: "global" }), i = y(""), a = y(), o = y(e), s = y(), c = y(), l = y(), u = y(), d = y(), f = y(), p = y(), m = y(), h = y(), g = y(), _ = y(), ee = y(), te = y(), ne = y(), se = y(), ce = y(), le = y(!1), ue = he(), de = v(() => {
|
|
3487
3557
|
let e = u.value?.theme;
|
|
@@ -3492,7 +3562,7 @@ function Ir(e) {
|
|
|
3492
3562
|
"feedback"
|
|
3493
3563
|
].includes(e)) : g.value), ye = oe(v(() => `${o.value}-chatId`), null);
|
|
3494
3564
|
pe(() => {
|
|
3495
|
-
ye.value ||=
|
|
3565
|
+
ye.value ||= L();
|
|
3496
3566
|
});
|
|
3497
3567
|
let x = v({
|
|
3498
3568
|
get: () => ye.value,
|
|
@@ -3510,8 +3580,8 @@ function Ir(e) {
|
|
|
3510
3580
|
}
|
|
3511
3581
|
function Se(e) {
|
|
3512
3582
|
if (xe(e)) {
|
|
3513
|
-
let e =
|
|
3514
|
-
x.value =
|
|
3583
|
+
let e = E.value.messages.filter((e) => e.role === "user"), t = e[e.length - 1], n = t ? ae(t) : void 0;
|
|
3584
|
+
x.value = L(), E.value.clearError(), S.value = void 0, n && E.value.sendMessage({ text: n });
|
|
3515
3585
|
return;
|
|
3516
3586
|
}
|
|
3517
3587
|
ie.error(e), S.value = e, be.value && (C.value = !0);
|
|
@@ -3520,12 +3590,12 @@ function Ir(e) {
|
|
|
3520
3590
|
baseUrl: i.value,
|
|
3521
3591
|
basePath: a.value,
|
|
3522
3592
|
headers: () => p.value
|
|
3523
|
-
})),
|
|
3593
|
+
})), T = y(null), Ce = () => ({
|
|
3524
3594
|
...ge(),
|
|
3525
|
-
...
|
|
3526
|
-
}),
|
|
3595
|
+
...T.value ?? {}
|
|
3596
|
+
}), E = v(() => new Ir({
|
|
3527
3597
|
id: x.value,
|
|
3528
|
-
transport: new
|
|
3598
|
+
transport: new lr({
|
|
3529
3599
|
api: w.value.getChatEndpoint(o.value, b.value ? "reasoning" : "chat"),
|
|
3530
3600
|
prepareSendMessagesRequest: ({ messages: e, id: t }) => ({ body: {
|
|
3531
3601
|
id: t,
|
|
@@ -3541,7 +3611,7 @@ function Ir(e) {
|
|
|
3541
3611
|
reasoning: d.value?.reasoning,
|
|
3542
3612
|
webSearch: f.value?.webSearch,
|
|
3543
3613
|
smoothStream: u.value?.smoothStream,
|
|
3544
|
-
deviceContext:
|
|
3614
|
+
deviceContext: Ce(),
|
|
3545
3615
|
externalContext: se.value,
|
|
3546
3616
|
disabledTools: f.value?.disabled,
|
|
3547
3617
|
fallbackModels: te.value,
|
|
@@ -3550,23 +3620,23 @@ function Ir(e) {
|
|
|
3550
3620
|
credentials: "include",
|
|
3551
3621
|
headers: () => p.value ?? {}
|
|
3552
3622
|
}),
|
|
3553
|
-
sendAutomaticallyWhen: (e) =>
|
|
3623
|
+
sendAutomaticallyWhen: (e) => Ur(e) || dr(e),
|
|
3554
3624
|
onError: Se,
|
|
3555
3625
|
onFinish: () => {
|
|
3556
3626
|
let e = x.value;
|
|
3557
|
-
!b.value && !
|
|
3627
|
+
!b.value && !D.value.some((t) => t.id === e) && Re(o.value);
|
|
3558
3628
|
}
|
|
3559
|
-
})),
|
|
3629
|
+
})), we = v(() => {
|
|
3560
3630
|
let e = u.value?.initialMessage;
|
|
3561
3631
|
return e?.[r.value] ? e[r.value] : n("message.defaultAgentWelcome") ? t("message.defaultAgentWelcome") : "";
|
|
3562
|
-
}),
|
|
3563
|
-
id:
|
|
3632
|
+
}), Te = L(), Ee = v(() => ({
|
|
3633
|
+
id: Te,
|
|
3564
3634
|
role: "assistant",
|
|
3565
3635
|
parts: [{
|
|
3566
3636
|
type: "text",
|
|
3567
|
-
text:
|
|
3637
|
+
text: we.value
|
|
3568
3638
|
}]
|
|
3569
|
-
})),
|
|
3639
|
+
})), De = v(() => {
|
|
3570
3640
|
let e = (e) => e.map((e) => e.role !== "user" || !e.parts.some((e) => e.type === "file") ? e : {
|
|
3571
3641
|
...e,
|
|
3572
3642
|
parts: e.parts.map((e) => {
|
|
@@ -3585,202 +3655,202 @@ function Ir(e) {
|
|
|
3585
3655
|
};
|
|
3586
3656
|
})
|
|
3587
3657
|
});
|
|
3588
|
-
return b.value ? e(
|
|
3589
|
-
}),
|
|
3658
|
+
return b.value ? e(E.value.messages) : !le.value && E.value.messages?.[0]?.role !== "assistant" ? [Ee.value, ...e(E.value.messages)] : e(E.value.messages);
|
|
3659
|
+
}), Oe = v(() => {
|
|
3590
3660
|
let e = u.value?.messagePlaceholder;
|
|
3591
3661
|
return e?.[r.value] ? e[r.value] : n("placeholder.askAnything") ? t("placeholder.askAnything") : "";
|
|
3592
|
-
}),
|
|
3593
|
-
async function
|
|
3662
|
+
}), D = y([]), ke = y(!1), O = y([]), Ae = y(!1), je = y("chat"), k = y([]), A = y(), Me = y(!1), Ne = y(!1), Pe = y(), j = y(!1), Fe = y(!1), Ie = y(), M = y(""), N = y([]), P = y(""), Le = y(0);
|
|
3663
|
+
async function Re(e) {
|
|
3594
3664
|
if (b.value) {
|
|
3595
|
-
|
|
3665
|
+
D.value = [];
|
|
3596
3666
|
return;
|
|
3597
3667
|
}
|
|
3598
|
-
|
|
3668
|
+
ke.value = !0;
|
|
3599
3669
|
try {
|
|
3600
|
-
|
|
3670
|
+
D.value = await w.value.getConversations(e, l.value);
|
|
3601
3671
|
} catch {
|
|
3602
|
-
|
|
3672
|
+
D.value = [];
|
|
3603
3673
|
} finally {
|
|
3604
|
-
|
|
3674
|
+
ke.value = !1;
|
|
3605
3675
|
}
|
|
3606
3676
|
}
|
|
3607
|
-
async function
|
|
3677
|
+
async function F() {
|
|
3608
3678
|
let e = x.value;
|
|
3609
3679
|
if (!e) {
|
|
3610
|
-
|
|
3680
|
+
O.value = [];
|
|
3611
3681
|
return;
|
|
3612
3682
|
}
|
|
3613
|
-
|
|
3683
|
+
Ae.value = !0;
|
|
3614
3684
|
try {
|
|
3615
|
-
|
|
3685
|
+
O.value = await w.value.getChatFiles(e);
|
|
3616
3686
|
} catch {
|
|
3617
|
-
|
|
3687
|
+
O.value = [];
|
|
3618
3688
|
} finally {
|
|
3619
|
-
|
|
3689
|
+
Ae.value = !1;
|
|
3620
3690
|
}
|
|
3621
3691
|
}
|
|
3622
|
-
function
|
|
3692
|
+
function ze(e, t = !1) {
|
|
3623
3693
|
return w.value.getChatFileDownloadUrl(e, t);
|
|
3624
3694
|
}
|
|
3625
|
-
function
|
|
3695
|
+
function Be(e) {
|
|
3626
3696
|
return w.value.getChatFilePreviewUrl(e);
|
|
3627
3697
|
}
|
|
3628
|
-
async function
|
|
3629
|
-
await w.value.deleteChatFile(e),
|
|
3698
|
+
async function I(e) {
|
|
3699
|
+
await w.value.deleteChatFile(e), O.value = O.value.filter((t) => t.documentId !== e);
|
|
3630
3700
|
}
|
|
3631
|
-
async function
|
|
3701
|
+
async function Ve(e, t) {
|
|
3632
3702
|
if (!b.value) try {
|
|
3633
3703
|
let n = await w.value.getChat(e, t);
|
|
3634
|
-
if (t !== x.value ||
|
|
3635
|
-
n && (
|
|
3704
|
+
if (t !== x.value || E.value.status !== "ready" || E.value.messages.length > 0) return;
|
|
3705
|
+
n && (E.value.messages = n.messages, C.value = n.blocked ?? !1);
|
|
3636
3706
|
} catch {}
|
|
3637
3707
|
}
|
|
3638
|
-
let
|
|
3639
|
-
let e =
|
|
3708
|
+
let He = () => {
|
|
3709
|
+
let e = E.value.status;
|
|
3640
3710
|
return e === "submitted" || e === "streaming";
|
|
3641
|
-
},
|
|
3642
|
-
async function
|
|
3643
|
-
if (b.value ||
|
|
3644
|
-
let e = x.value, t =
|
|
3711
|
+
}, Ue = 0, We = 0;
|
|
3712
|
+
async function Ge() {
|
|
3713
|
+
if (b.value || He()) return "indeterminate";
|
|
3714
|
+
let e = x.value, t = Ue += 1;
|
|
3645
3715
|
try {
|
|
3646
3716
|
let n = await w.value.getChat(o.value, e);
|
|
3647
|
-
if (!n || e !== x.value ||
|
|
3648
|
-
|
|
3649
|
-
let r = n.messages, i =
|
|
3650
|
-
return
|
|
3717
|
+
if (!n || e !== x.value || He() || t <= We) return "indeterminate";
|
|
3718
|
+
We = t;
|
|
3719
|
+
let r = n.messages, i = Vr(r, E.value.messages);
|
|
3720
|
+
return E.value.messages = [...r, ...i], C.value = n.blocked ?? !1, i.length > 0 ? "pending" : "caught-up";
|
|
3651
3721
|
} catch {}
|
|
3652
3722
|
return "indeterminate";
|
|
3653
3723
|
}
|
|
3654
|
-
function
|
|
3655
|
-
|
|
3724
|
+
function Ke(e) {
|
|
3725
|
+
E.value.messages = [...E.value.messages, e];
|
|
3656
3726
|
}
|
|
3657
|
-
async function
|
|
3727
|
+
async function qe(e) {
|
|
3658
3728
|
try {
|
|
3659
|
-
|
|
3729
|
+
k.value = await w.value.getMessageFeedbacks(e);
|
|
3660
3730
|
} catch {
|
|
3661
|
-
|
|
3731
|
+
k.value = [];
|
|
3662
3732
|
}
|
|
3663
3733
|
}
|
|
3664
|
-
function
|
|
3665
|
-
let t =
|
|
3666
|
-
t >= 0 ?
|
|
3734
|
+
function R(e) {
|
|
3735
|
+
let t = k.value.findIndex((t) => t.messageId === e.messageId);
|
|
3736
|
+
t >= 0 ? k.value[t] = e : k.value.push(e);
|
|
3667
3737
|
}
|
|
3668
|
-
function
|
|
3669
|
-
let t =
|
|
3738
|
+
function Je(e) {
|
|
3739
|
+
let t = De.value, n = t.findIndex((t) => t.id === e.id), r = ae(e) ?? "", i = t.slice(0, n).reverse().find((e) => e.role === "user");
|
|
3670
3740
|
return {
|
|
3671
3741
|
userQuestion: ae(i ?? e) ?? "",
|
|
3672
3742
|
assistantMessage: r
|
|
3673
3743
|
};
|
|
3674
3744
|
}
|
|
3675
|
-
async function
|
|
3745
|
+
async function Ye(e, t) {
|
|
3676
3746
|
await Promise.all([
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
]),
|
|
3681
|
-
e && (
|
|
3747
|
+
Ve(e, t),
|
|
3748
|
+
Re(e),
|
|
3749
|
+
qe(t)
|
|
3750
|
+
]), T.value || _e((e, t) => w.value.reverseGeocode(e, t, r.value)).then((e) => {
|
|
3751
|
+
e && (T.value = e);
|
|
3682
3752
|
});
|
|
3683
3753
|
}
|
|
3684
|
-
async function
|
|
3685
|
-
let e =
|
|
3754
|
+
async function Xe() {
|
|
3755
|
+
let e = M.value.trim(), t = N.value.filter((e) => e.state === "done" && e.mediaSource !== void 0).map((e) => ({
|
|
3686
3756
|
type: "file",
|
|
3687
3757
|
mediaType: e.mediaSource.mimeType,
|
|
3688
3758
|
url: e.localUrl,
|
|
3689
3759
|
filename: e.mediaSource.name,
|
|
3690
3760
|
providerMetadata: { "8bot": { media: e.mediaSource } }
|
|
3691
3761
|
}));
|
|
3692
|
-
b.value &&
|
|
3693
|
-
let n =
|
|
3762
|
+
b.value && De.value.length > 0 && await $e(), P.value = e, Le.value = E.value.messages.length;
|
|
3763
|
+
let n = E.value.sendMessage;
|
|
3694
3764
|
n({
|
|
3695
3765
|
text: e,
|
|
3696
3766
|
files: t.length > 0 ? t : void 0
|
|
3697
|
-
}),
|
|
3767
|
+
}), M.value = "", Qe();
|
|
3698
3768
|
}
|
|
3699
|
-
function
|
|
3769
|
+
function z(e) {
|
|
3700
3770
|
let t = e.trim();
|
|
3701
3771
|
if (!t) return;
|
|
3702
|
-
if (
|
|
3772
|
+
if (E.value.status !== "ready") {
|
|
3703
3773
|
ie.warn("[useChatbotStore] sendMessage called before chat is ready. Listen for the \"ready\" event on the widget element.");
|
|
3704
3774
|
return;
|
|
3705
3775
|
}
|
|
3706
|
-
let n =
|
|
3776
|
+
let n = E.value.sendMessage;
|
|
3707
3777
|
n({ text: t });
|
|
3708
3778
|
}
|
|
3709
|
-
async function
|
|
3710
|
-
let e =
|
|
3711
|
-
await
|
|
3779
|
+
async function Ze() {
|
|
3780
|
+
let e = P.value.length > 0;
|
|
3781
|
+
await E.value.stop(), e && (M.value = P.value, E.value.messages = E.value.messages.slice(0, Le.value), P.value = "");
|
|
3712
3782
|
}
|
|
3713
|
-
fe(() =>
|
|
3714
|
-
e === "ready" &&
|
|
3783
|
+
fe(() => E.value.status, (e) => {
|
|
3784
|
+
e === "ready" && P.value.length > 0 && (P.value = "");
|
|
3715
3785
|
});
|
|
3716
|
-
function
|
|
3717
|
-
for (let t of
|
|
3718
|
-
|
|
3786
|
+
function Qe(e = !1) {
|
|
3787
|
+
for (let t of N.value) (e || t.state !== "done") && URL.revokeObjectURL(t.localUrl);
|
|
3788
|
+
N.value = [], B.value = null;
|
|
3719
3789
|
}
|
|
3720
|
-
async function
|
|
3721
|
-
return
|
|
3790
|
+
async function $e() {
|
|
3791
|
+
return P.value = "", await Ze(), x.value = L(), E.value.clearError(), S.value = void 0, C.value = !1, Qe(!0), ht("chat"), x.value;
|
|
3722
3792
|
}
|
|
3723
|
-
async function
|
|
3724
|
-
|
|
3793
|
+
async function et(e) {
|
|
3794
|
+
E.value.status !== "ready" && (P.value = "", await Ze()), await E.value.regenerate(e);
|
|
3725
3795
|
}
|
|
3726
|
-
function
|
|
3796
|
+
function tt(e) {
|
|
3727
3797
|
if (e.tool === "requestGeolocation") {
|
|
3728
3798
|
let t = e.output;
|
|
3729
|
-
"latitude" in t && (
|
|
3799
|
+
"latitude" in t && (T.value = {
|
|
3730
3800
|
geolocationLatitude: t.latitude,
|
|
3731
3801
|
geolocationLongitude: t.longitude,
|
|
3732
3802
|
geolocationAccuracy: t.accuracy,
|
|
3733
3803
|
geolocationCity: t.city
|
|
3734
3804
|
});
|
|
3735
3805
|
}
|
|
3736
|
-
|
|
3806
|
+
E.value.addToolOutput(e);
|
|
3737
3807
|
}
|
|
3738
|
-
function
|
|
3739
|
-
|
|
3808
|
+
function nt(e) {
|
|
3809
|
+
E.value.addToolApprovalResponse(e);
|
|
3740
3810
|
}
|
|
3741
|
-
let
|
|
3742
|
-
|
|
3811
|
+
let rt = v(() => E.value.messages.reduce((e, t) => e + t.parts.filter((e) => e.type === "file").length, 0)), it = v(() => _.value?.maxFilesPerMessage ?? 5), at = v(() => _.value?.maxFilesPerChat ?? 20), ot = v(() => Math.max(0, Math.min(it.value - N.value.length, at.value - rt.value - N.value.length))), st = v(() => ot.value <= 0), B = y(null), ct = () => {
|
|
3812
|
+
B.value = null;
|
|
3743
3813
|
};
|
|
3744
|
-
fe(
|
|
3745
|
-
e || (
|
|
3814
|
+
fe(st, (e) => {
|
|
3815
|
+
e || (B.value = null);
|
|
3746
3816
|
});
|
|
3747
|
-
async function
|
|
3748
|
-
if (
|
|
3749
|
-
|
|
3817
|
+
async function lt(e) {
|
|
3818
|
+
if (st.value) {
|
|
3819
|
+
B.value = at.value - rt.value - N.value.length <= it.value - N.value.length ? {
|
|
3750
3820
|
reason: "per-chat",
|
|
3751
|
-
max:
|
|
3821
|
+
max: at.value
|
|
3752
3822
|
} : {
|
|
3753
3823
|
reason: "per-message",
|
|
3754
|
-
max:
|
|
3824
|
+
max: it.value
|
|
3755
3825
|
};
|
|
3756
3826
|
return;
|
|
3757
3827
|
}
|
|
3758
|
-
let t =
|
|
3828
|
+
let t = L(), n = {
|
|
3759
3829
|
id: t,
|
|
3760
3830
|
file: e,
|
|
3761
3831
|
localUrl: URL.createObjectURL(e),
|
|
3762
3832
|
state: "uploading"
|
|
3763
3833
|
};
|
|
3764
|
-
|
|
3834
|
+
N.value = [...N.value, n];
|
|
3765
3835
|
try {
|
|
3766
3836
|
let n = await w.value.uploadMedia(o.value, x.value, e);
|
|
3767
|
-
|
|
3837
|
+
N.value = N.value.map((e) => e.id === t ? {
|
|
3768
3838
|
...e,
|
|
3769
3839
|
state: "done",
|
|
3770
3840
|
mediaSource: n
|
|
3771
3841
|
} : e);
|
|
3772
3842
|
} catch (e) {
|
|
3773
3843
|
let n = e instanceof Error ? e.message : "Upload failed";
|
|
3774
|
-
|
|
3844
|
+
N.value = N.value.map((e) => e.id === t ? {
|
|
3775
3845
|
...e,
|
|
3776
3846
|
state: "error",
|
|
3777
3847
|
error: n
|
|
3778
3848
|
} : e);
|
|
3779
3849
|
}
|
|
3780
3850
|
}
|
|
3781
|
-
async function
|
|
3782
|
-
let { userQuestion: n, assistantMessage: r } =
|
|
3783
|
-
|
|
3851
|
+
async function V(e, t) {
|
|
3852
|
+
let { userQuestion: n, assistantMessage: r } = Je(e);
|
|
3853
|
+
R(await w.value.submitMessageFeedback({
|
|
3784
3854
|
messageId: e.id,
|
|
3785
3855
|
chatId: x.value,
|
|
3786
3856
|
agentId: o.value,
|
|
@@ -3789,75 +3859,75 @@ function Ir(e) {
|
|
|
3789
3859
|
assistantMessage: r
|
|
3790
3860
|
}));
|
|
3791
3861
|
}
|
|
3792
|
-
async function
|
|
3793
|
-
await
|
|
3862
|
+
async function ut(e) {
|
|
3863
|
+
await V(e, "upvote");
|
|
3794
3864
|
}
|
|
3795
|
-
async function
|
|
3796
|
-
await
|
|
3865
|
+
async function dt(e) {
|
|
3866
|
+
await V(e, "downvote");
|
|
3797
3867
|
}
|
|
3798
|
-
function
|
|
3799
|
-
|
|
3868
|
+
function ft(e) {
|
|
3869
|
+
Ne.value = !1, Pe.value = void 0, A.value = e;
|
|
3800
3870
|
}
|
|
3801
|
-
async function
|
|
3802
|
-
if (
|
|
3803
|
-
|
|
3804
|
-
let { userQuestion: t, assistantMessage: n } =
|
|
3805
|
-
|
|
3806
|
-
messageId:
|
|
3871
|
+
async function pt(e) {
|
|
3872
|
+
if (A.value) try {
|
|
3873
|
+
Me.value = !0, Ne.value = !1, Pe.value = void 0;
|
|
3874
|
+
let { userQuestion: t, assistantMessage: n } = Je(A.value);
|
|
3875
|
+
R(await w.value.submitMessageFeedback({
|
|
3876
|
+
messageId: A.value.id,
|
|
3807
3877
|
chatId: x.value,
|
|
3808
3878
|
agentId: o.value,
|
|
3809
3879
|
userQuestion: t,
|
|
3810
3880
|
assistantMessage: n,
|
|
3811
3881
|
comment: e
|
|
3812
|
-
})),
|
|
3882
|
+
})), Ne.value = !0, await qe(x.value);
|
|
3813
3883
|
} catch {
|
|
3814
|
-
|
|
3884
|
+
Pe.value = n("message.feedbackSubmitError") ? t("message.feedbackSubmitError") : "Failed to submit feedback";
|
|
3815
3885
|
} finally {
|
|
3816
|
-
|
|
3886
|
+
Me.value = !1;
|
|
3817
3887
|
}
|
|
3818
3888
|
}
|
|
3819
|
-
async function
|
|
3889
|
+
async function H(e) {
|
|
3820
3890
|
try {
|
|
3821
|
-
|
|
3891
|
+
Fe.value = !0, j.value = !1, Ie.value = void 0, await w.value.submitLead({
|
|
3822
3892
|
agentId: o.value,
|
|
3823
3893
|
chatId: x.value,
|
|
3824
3894
|
...e
|
|
3825
|
-
}),
|
|
3895
|
+
}), j.value = !0;
|
|
3826
3896
|
} catch {
|
|
3827
|
-
|
|
3897
|
+
Ie.value = n("message.leadSubmitError") ? t("message.leadSubmitError") : "Failed to submit lead";
|
|
3828
3898
|
} finally {
|
|
3829
|
-
|
|
3899
|
+
Fe.value = !1;
|
|
3830
3900
|
}
|
|
3831
3901
|
}
|
|
3832
|
-
async function
|
|
3902
|
+
async function U(e, t) {
|
|
3833
3903
|
let n = await w.value.updateChatTitle(o.value, e, t);
|
|
3834
|
-
|
|
3904
|
+
D.value = D.value.map((t) => t.id === e ? {
|
|
3835
3905
|
...t,
|
|
3836
3906
|
title: n.title
|
|
3837
3907
|
} : t);
|
|
3838
3908
|
}
|
|
3839
|
-
async function
|
|
3840
|
-
await w.value.deleteChat(o.value, e),
|
|
3909
|
+
async function mt(e) {
|
|
3910
|
+
await w.value.deleteChat(o.value, e), D.value = D.value.filter((t) => t.id !== e), x.value === e && await $e();
|
|
3841
3911
|
}
|
|
3842
|
-
function
|
|
3843
|
-
|
|
3912
|
+
function ht(e) {
|
|
3913
|
+
je.value = e;
|
|
3844
3914
|
}
|
|
3845
|
-
let
|
|
3846
|
-
function
|
|
3915
|
+
let gt;
|
|
3916
|
+
function _t(e) {
|
|
3847
3917
|
let t = () => w.value.getChat(o.value, e).then((e) => e !== null);
|
|
3848
3918
|
return t().catch(() => t().catch(() => !1));
|
|
3849
3919
|
}
|
|
3850
3920
|
return fe(l, async (e) => {
|
|
3851
|
-
if (!e || e ===
|
|
3852
|
-
let t =
|
|
3853
|
-
if (
|
|
3854
|
-
let n = x.value, r = !b.value && await
|
|
3921
|
+
if (!e || e === gt) return;
|
|
3922
|
+
let t = gt;
|
|
3923
|
+
if (gt = e, t === void 0) return;
|
|
3924
|
+
let n = x.value, r = !b.value && await _t(n);
|
|
3855
3925
|
if (l.value === e && x.value === n) {
|
|
3856
3926
|
if (r) {
|
|
3857
|
-
|
|
3927
|
+
Re(o.value);
|
|
3858
3928
|
return;
|
|
3859
3929
|
}
|
|
3860
|
-
|
|
3930
|
+
D.value = [], k.value = [], O.value = [], await $e(), M.value = "";
|
|
3861
3931
|
}
|
|
3862
3932
|
}), {
|
|
3863
3933
|
apiClient: w,
|
|
@@ -3883,60 +3953,60 @@ function Ir(e) {
|
|
|
3883
3953
|
systemTheme: ce,
|
|
3884
3954
|
hideWelcomeMessage: le,
|
|
3885
3955
|
isDark: de,
|
|
3886
|
-
chat:
|
|
3887
|
-
messages:
|
|
3888
|
-
conversations:
|
|
3889
|
-
isLoadingConversations:
|
|
3890
|
-
chatFiles:
|
|
3891
|
-
isLoadingChatFiles:
|
|
3892
|
-
input:
|
|
3893
|
-
pendingAttachments:
|
|
3894
|
-
isAttachmentLimitReached:
|
|
3895
|
-
fileLimitError:
|
|
3956
|
+
chat: E,
|
|
3957
|
+
messages: De,
|
|
3958
|
+
conversations: D,
|
|
3959
|
+
isLoadingConversations: ke,
|
|
3960
|
+
chatFiles: O,
|
|
3961
|
+
isLoadingChatFiles: Ae,
|
|
3962
|
+
input: M,
|
|
3963
|
+
pendingAttachments: N,
|
|
3964
|
+
isAttachmentLimitReached: st,
|
|
3965
|
+
fileLimitError: B,
|
|
3896
3966
|
localChatId: x,
|
|
3897
3967
|
isConversationBlocked: C,
|
|
3898
|
-
inputMessagePlaceholder:
|
|
3968
|
+
inputMessagePlaceholder: Oe,
|
|
3899
3969
|
chatError: S,
|
|
3900
|
-
activeView:
|
|
3901
|
-
messageFeedbacks:
|
|
3902
|
-
feedbackDialogMessage:
|
|
3903
|
-
isFeedbackSubmitting:
|
|
3904
|
-
isFeedbackSubmitted:
|
|
3905
|
-
feedbackSubmitError:
|
|
3906
|
-
isLeadSubmitted:
|
|
3907
|
-
isLoadingSubmitLead:
|
|
3908
|
-
submitLeadError:
|
|
3909
|
-
buildDeviceContext:
|
|
3910
|
-
initialize:
|
|
3911
|
-
loadConversations:
|
|
3912
|
-
loadChatFiles:
|
|
3913
|
-
refreshMessages:
|
|
3914
|
-
appendMessage:
|
|
3915
|
-
getChatFileUrl:
|
|
3916
|
-
getChatFilePreviewUrl:
|
|
3917
|
-
deleteChatFile:
|
|
3918
|
-
handleSubmit:
|
|
3919
|
-
sendMessage:
|
|
3920
|
-
stopGeneration:
|
|
3921
|
-
startNewChat:
|
|
3922
|
-
regenerate:
|
|
3923
|
-
addToolOutput:
|
|
3924
|
-
addToolApprovalResponse:
|
|
3925
|
-
handleFileSelect:
|
|
3926
|
-
clearFileLimitError:
|
|
3927
|
-
clearPendingAttachments:
|
|
3928
|
-
onUpvote:
|
|
3929
|
-
onDownvote:
|
|
3930
|
-
onFeedback:
|
|
3931
|
-
onFeedbackSubmit:
|
|
3932
|
-
onLeadSubmit:
|
|
3933
|
-
navigate:
|
|
3934
|
-
renameChatTitle:
|
|
3935
|
-
deleteChat:
|
|
3970
|
+
activeView: je,
|
|
3971
|
+
messageFeedbacks: k,
|
|
3972
|
+
feedbackDialogMessage: A,
|
|
3973
|
+
isFeedbackSubmitting: Me,
|
|
3974
|
+
isFeedbackSubmitted: Ne,
|
|
3975
|
+
feedbackSubmitError: Pe,
|
|
3976
|
+
isLeadSubmitted: j,
|
|
3977
|
+
isLoadingSubmitLead: Fe,
|
|
3978
|
+
submitLeadError: Ie,
|
|
3979
|
+
buildDeviceContext: Ce,
|
|
3980
|
+
initialize: Ye,
|
|
3981
|
+
loadConversations: Re,
|
|
3982
|
+
loadChatFiles: F,
|
|
3983
|
+
refreshMessages: Ge,
|
|
3984
|
+
appendMessage: Ke,
|
|
3985
|
+
getChatFileUrl: ze,
|
|
3986
|
+
getChatFilePreviewUrl: Be,
|
|
3987
|
+
deleteChatFile: I,
|
|
3988
|
+
handleSubmit: Xe,
|
|
3989
|
+
sendMessage: z,
|
|
3990
|
+
stopGeneration: Ze,
|
|
3991
|
+
startNewChat: $e,
|
|
3992
|
+
regenerate: et,
|
|
3993
|
+
addToolOutput: tt,
|
|
3994
|
+
addToolApprovalResponse: nt,
|
|
3995
|
+
handleFileSelect: lt,
|
|
3996
|
+
clearFileLimitError: ct,
|
|
3997
|
+
clearPendingAttachments: Qe,
|
|
3998
|
+
onUpvote: ut,
|
|
3999
|
+
onDownvote: dt,
|
|
4000
|
+
onFeedback: ft,
|
|
4001
|
+
onFeedbackSubmit: pt,
|
|
4002
|
+
onLeadSubmit: H,
|
|
4003
|
+
navigate: ht,
|
|
4004
|
+
renameChatTitle: U,
|
|
4005
|
+
deleteChat: mt
|
|
3936
4006
|
};
|
|
3937
4007
|
})();
|
|
3938
4008
|
}
|
|
3939
4009
|
//#endregion
|
|
3940
|
-
export {
|
|
4010
|
+
export { L as a, lr as i, Wr as n, Ir as r, Lr as t };
|
|
3941
4011
|
|
|
3942
|
-
//# sourceMappingURL=useChatbotStore-
|
|
4012
|
+
//# sourceMappingURL=useChatbotStore-Chtzi5jc.js.map
|