@gram-ai/elements 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/popover.d.ts +7 -0
- package/dist/elements.css +1 -1
- package/dist/elements.js +4016 -3730
- package/dist/lib/models.d.ts +1 -0
- package/dist/{index-BfPvCJYI.js → models-DBbuJvSc.js} +34 -13
- package/dist/server.js +783 -782
- package/dist/types/index.d.ts +9 -7
- package/package.json +2 -1
package/dist/server.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var
|
|
3
|
-
function
|
|
1
|
+
import { gl as ei, gm as dt, gn as Mt, go as se, gp as ti, gq as Nt, fI as ri, dc as ai, gr as M, gs as ni, eu as Oe, fr as v, ev as I, eS as Kt, fM as c, fd as C, fZ as D, f_ as Re, fq as R, fB as De, gt as Yt, gj as J, f0 as $t, eH as oi, fc as si, fn as ii, ez as _e, eM as li, gu as Ze, fe as ze, gv as ui, gw as ci, gx as di, fs as $, g9 as Tn, ga as In, ew as Sn, dR as pi, aQ as fi, gk as hi } from "./models-DBbuJvSc.js";
|
|
2
|
+
var mi = typeof globalThis == "object" ? globalThis : typeof self == "object" ? self : typeof window == "object" ? window : typeof global == "object" ? global : {}, qe = "1.9.0", Ta = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
|
3
|
+
function gi(e) {
|
|
4
4
|
var t = /* @__PURE__ */ new Set([e]), r = /* @__PURE__ */ new Set(), a = e.match(Ta);
|
|
5
5
|
if (!a)
|
|
6
6
|
return function() {
|
|
@@ -39,7 +39,7 @@ function mi(e) {
|
|
|
39
39
|
return d.prerelease != null || o.major !== d.major ? n(u) : o.major === 0 ? o.minor === d.minor && o.patch <= d.patch ? i(u) : n(u) : o.minor <= d.minor ? i(u) : n(u);
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
var
|
|
42
|
+
var vi = gi(qe), yi = qe.split(".")[0], pt = Symbol.for("opentelemetry.js.api." + yi), ft = mi;
|
|
43
43
|
function Gr(e, t, r, a) {
|
|
44
44
|
var o;
|
|
45
45
|
a === void 0 && (a = !1);
|
|
@@ -58,7 +58,7 @@ function Gr(e, t, r, a) {
|
|
|
58
58
|
}
|
|
59
59
|
function ht(e) {
|
|
60
60
|
var t, r, a = (t = ft[pt]) === null || t === void 0 ? void 0 : t.version;
|
|
61
|
-
if (!(!a || !
|
|
61
|
+
if (!(!a || !vi(a)))
|
|
62
62
|
return (r = ft[pt]) === null || r === void 0 ? void 0 : r[e];
|
|
63
63
|
}
|
|
64
64
|
function Jr(e, t) {
|
|
@@ -66,7 +66,7 @@ function Jr(e, t) {
|
|
|
66
66
|
var r = ft[pt];
|
|
67
67
|
r && delete r[e];
|
|
68
68
|
}
|
|
69
|
-
var
|
|
69
|
+
var _i = function(e, t) {
|
|
70
70
|
var r = typeof Symbol == "function" && e[Symbol.iterator];
|
|
71
71
|
if (!r) return e;
|
|
72
72
|
var a = r.call(e), o, n = [], i;
|
|
@@ -82,11 +82,11 @@ var yi = function(e, t) {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
return n;
|
|
85
|
-
},
|
|
85
|
+
}, wi = function(e, t, r) {
|
|
86
86
|
if (r || arguments.length === 2) for (var a = 0, o = t.length, n; a < o; a++)
|
|
87
87
|
(n || !(a in t)) && (n || (n = Array.prototype.slice.call(t, 0, a)), n[a] = t[a]);
|
|
88
88
|
return e.concat(n || Array.prototype.slice.call(t));
|
|
89
|
-
},
|
|
89
|
+
}, bi = (
|
|
90
90
|
/** @class */
|
|
91
91
|
(function() {
|
|
92
92
|
function e(t) {
|
|
@@ -118,13 +118,13 @@ var yi = function(e, t) {
|
|
|
118
118
|
function ot(e, t, r) {
|
|
119
119
|
var a = ht("diag");
|
|
120
120
|
if (a)
|
|
121
|
-
return r.unshift(t), a[e].apply(a,
|
|
121
|
+
return r.unshift(t), a[e].apply(a, wi([], _i(r), !1));
|
|
122
122
|
}
|
|
123
123
|
var le;
|
|
124
124
|
(function(e) {
|
|
125
125
|
e[e.NONE = 0] = "NONE", e[e.ERROR = 30] = "ERROR", e[e.WARN = 50] = "WARN", e[e.INFO = 60] = "INFO", e[e.DEBUG = 70] = "DEBUG", e[e.VERBOSE = 80] = "VERBOSE", e[e.ALL = 9999] = "ALL";
|
|
126
126
|
})(le || (le = {}));
|
|
127
|
-
function
|
|
127
|
+
function Ti(e, t) {
|
|
128
128
|
e < le.NONE ? e = le.NONE : e > le.ALL && (e = le.ALL), t = t || {};
|
|
129
129
|
function r(a, o) {
|
|
130
130
|
var n = t[a];
|
|
@@ -139,7 +139,7 @@ function bi(e, t) {
|
|
|
139
139
|
verbose: r("verbose", le.VERBOSE)
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
var
|
|
142
|
+
var Ii = function(e, t) {
|
|
143
143
|
var r = typeof Symbol == "function" && e[Symbol.iterator];
|
|
144
144
|
if (!r) return e;
|
|
145
145
|
var a = r.call(e), o, n = [], i;
|
|
@@ -155,11 +155,11 @@ var Ti = function(e, t) {
|
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
return n;
|
|
158
|
-
},
|
|
158
|
+
}, Si = function(e, t, r) {
|
|
159
159
|
if (r || arguments.length === 2) for (var a = 0, o = t.length, n; a < o; a++)
|
|
160
160
|
(n || !(a in t)) && (n || (n = Array.prototype.slice.call(t, 0, a)), n[a] = t[a]);
|
|
161
161
|
return e.concat(n || Array.prototype.slice.call(t));
|
|
162
|
-
},
|
|
162
|
+
}, Ei = "diag", Ut = (
|
|
163
163
|
/** @class */
|
|
164
164
|
(function() {
|
|
165
165
|
function e() {
|
|
@@ -169,7 +169,7 @@ var Ti = function(e, t) {
|
|
|
169
169
|
n[i] = arguments[i];
|
|
170
170
|
var s = ht("diag");
|
|
171
171
|
if (s)
|
|
172
|
-
return s[o].apply(s,
|
|
172
|
+
return s[o].apply(s, Si([], Ii(n), !1));
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
175
|
var r = this, a = function(o, n) {
|
|
@@ -181,7 +181,7 @@ var Ti = function(e, t) {
|
|
|
181
181
|
typeof n == "number" && (n = {
|
|
182
182
|
logLevel: n
|
|
183
183
|
});
|
|
184
|
-
var d = ht("diag"), p =
|
|
184
|
+
var d = ht("diag"), p = Ti((s = n.logLevel) !== null && s !== void 0 ? s : le.INFO, o);
|
|
185
185
|
if (d && !n.suppressOverrideMessage) {
|
|
186
186
|
var m = (u = new Error().stack) !== null && u !== void 0 ? u : "<failed to generate stacktrace>";
|
|
187
187
|
d.warn("Current logger will be overwritten from " + m), p.warn("Current logger will overwrite one already registered from " + m);
|
|
@@ -189,9 +189,9 @@ var Ti = function(e, t) {
|
|
|
189
189
|
return Gr("diag", p, r, !0);
|
|
190
190
|
};
|
|
191
191
|
r.setLogger = a, r.disable = function() {
|
|
192
|
-
Jr(
|
|
192
|
+
Jr(Ei, r);
|
|
193
193
|
}, r.createComponentLogger = function(o) {
|
|
194
|
-
return new
|
|
194
|
+
return new bi(o);
|
|
195
195
|
}, r.verbose = t("verbose"), r.debug = t("debug"), r.info = t("info"), r.warn = t("warn"), r.error = t("error");
|
|
196
196
|
}
|
|
197
197
|
return e.instance = function() {
|
|
@@ -199,10 +199,10 @@ var Ti = function(e, t) {
|
|
|
199
199
|
}, e;
|
|
200
200
|
})()
|
|
201
201
|
);
|
|
202
|
-
function
|
|
202
|
+
function xi(e) {
|
|
203
203
|
return Symbol.for(e);
|
|
204
204
|
}
|
|
205
|
-
var
|
|
205
|
+
var Ri = (
|
|
206
206
|
/** @class */
|
|
207
207
|
/* @__PURE__ */ (function() {
|
|
208
208
|
function e(t) {
|
|
@@ -219,7 +219,7 @@ var xi = (
|
|
|
219
219
|
}
|
|
220
220
|
return e;
|
|
221
221
|
})()
|
|
222
|
-
),
|
|
222
|
+
), Ci = new Ri(), Ai = function(e, t) {
|
|
223
223
|
var r = typeof Symbol == "function" && e[Symbol.iterator];
|
|
224
224
|
if (!r) return e;
|
|
225
225
|
var a = r.call(e), o, n = [], i;
|
|
@@ -235,21 +235,21 @@ var xi = (
|
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
return n;
|
|
238
|
-
},
|
|
238
|
+
}, ki = function(e, t, r) {
|
|
239
239
|
if (r || arguments.length === 2) for (var a = 0, o = t.length, n; a < o; a++)
|
|
240
240
|
(n || !(a in t)) && (n || (n = Array.prototype.slice.call(t, 0, a)), n[a] = t[a]);
|
|
241
241
|
return e.concat(n || Array.prototype.slice.call(t));
|
|
242
|
-
},
|
|
242
|
+
}, Oi = (
|
|
243
243
|
/** @class */
|
|
244
244
|
(function() {
|
|
245
245
|
function e() {
|
|
246
246
|
}
|
|
247
247
|
return e.prototype.active = function() {
|
|
248
|
-
return
|
|
248
|
+
return Ci;
|
|
249
249
|
}, e.prototype.with = function(t, r, a) {
|
|
250
250
|
for (var o = [], n = 3; n < arguments.length; n++)
|
|
251
251
|
o[n - 3] = arguments[n];
|
|
252
|
-
return r.call.apply(r,
|
|
252
|
+
return r.call.apply(r, ki([a], Ai(o), !1));
|
|
253
253
|
}, e.prototype.bind = function(t, r) {
|
|
254
254
|
return r;
|
|
255
255
|
}, e.prototype.enable = function() {
|
|
@@ -258,7 +258,7 @@ var xi = (
|
|
|
258
258
|
return this;
|
|
259
259
|
}, e;
|
|
260
260
|
})()
|
|
261
|
-
),
|
|
261
|
+
), Pi = function(e, t) {
|
|
262
262
|
var r = typeof Symbol == "function" && e[Symbol.iterator];
|
|
263
263
|
if (!r) return e;
|
|
264
264
|
var a = r.call(e), o, n = [], i;
|
|
@@ -274,11 +274,11 @@ var xi = (
|
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
return n;
|
|
277
|
-
},
|
|
277
|
+
}, Mi = function(e, t, r) {
|
|
278
278
|
if (r || arguments.length === 2) for (var a = 0, o = t.length, n; a < o; a++)
|
|
279
279
|
(n || !(a in t)) && (n || (n = Array.prototype.slice.call(t, 0, a)), n[a] = t[a]);
|
|
280
280
|
return e.concat(n || Array.prototype.slice.call(t));
|
|
281
|
-
},
|
|
281
|
+
}, hr = "context", Ni = new Oi(), En = (
|
|
282
282
|
/** @class */
|
|
283
283
|
(function() {
|
|
284
284
|
function e() {
|
|
@@ -286,34 +286,34 @@ var xi = (
|
|
|
286
286
|
return e.getInstance = function() {
|
|
287
287
|
return this._instance || (this._instance = new e()), this._instance;
|
|
288
288
|
}, e.prototype.setGlobalContextManager = function(t) {
|
|
289
|
-
return Gr(
|
|
289
|
+
return Gr(hr, t, Ut.instance());
|
|
290
290
|
}, e.prototype.active = function() {
|
|
291
291
|
return this._getContextManager().active();
|
|
292
292
|
}, e.prototype.with = function(t, r, a) {
|
|
293
293
|
for (var o, n = [], i = 3; i < arguments.length; i++)
|
|
294
294
|
n[i - 3] = arguments[i];
|
|
295
|
-
return (o = this._getContextManager()).with.apply(o,
|
|
295
|
+
return (o = this._getContextManager()).with.apply(o, Mi([t, r, a], Pi(n), !1));
|
|
296
296
|
}, e.prototype.bind = function(t, r) {
|
|
297
297
|
return this._getContextManager().bind(t, r);
|
|
298
298
|
}, e.prototype._getContextManager = function() {
|
|
299
|
-
return ht(
|
|
299
|
+
return ht(hr) || Ni;
|
|
300
300
|
}, e.prototype.disable = function() {
|
|
301
|
-
this._getContextManager().disable(), Jr(
|
|
301
|
+
this._getContextManager().disable(), Jr(hr, Ut.instance());
|
|
302
302
|
}, e;
|
|
303
303
|
})()
|
|
304
|
-
),
|
|
304
|
+
), kr;
|
|
305
305
|
(function(e) {
|
|
306
306
|
e[e.NONE = 0] = "NONE", e[e.SAMPLED = 1] = "SAMPLED";
|
|
307
|
-
})(
|
|
308
|
-
var xn = "0000000000000000", Rn = "00000000000000000000000000000000",
|
|
307
|
+
})(kr || (kr = {}));
|
|
308
|
+
var xn = "0000000000000000", Rn = "00000000000000000000000000000000", $i = {
|
|
309
309
|
traceId: Rn,
|
|
310
310
|
spanId: xn,
|
|
311
|
-
traceFlags:
|
|
311
|
+
traceFlags: kr.NONE
|
|
312
312
|
}, ut = (
|
|
313
313
|
/** @class */
|
|
314
314
|
(function() {
|
|
315
315
|
function e(t) {
|
|
316
|
-
t === void 0 && (t =
|
|
316
|
+
t === void 0 && (t = $i), this._spanContext = t;
|
|
317
317
|
}
|
|
318
318
|
return e.prototype.spanContext = function() {
|
|
319
319
|
return this._spanContext;
|
|
@@ -337,65 +337,65 @@ var xn = "0000000000000000", Rn = "00000000000000000000000000000000", Ni = {
|
|
|
337
337
|
}, e.prototype.recordException = function(t, r) {
|
|
338
338
|
}, e;
|
|
339
339
|
})()
|
|
340
|
-
), Zr =
|
|
340
|
+
), Zr = xi("OpenTelemetry Context Key SPAN");
|
|
341
341
|
function zr(e) {
|
|
342
342
|
return e.getValue(Zr) || void 0;
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function Ui() {
|
|
345
345
|
return zr(En.getInstance().active());
|
|
346
346
|
}
|
|
347
347
|
function Wr(e, t) {
|
|
348
348
|
return e.setValue(Zr, t);
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function Di(e) {
|
|
351
351
|
return e.deleteValue(Zr);
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function ji(e, t) {
|
|
354
354
|
return Wr(e, new ut(t));
|
|
355
355
|
}
|
|
356
356
|
function Cn(e) {
|
|
357
357
|
var t;
|
|
358
358
|
return (t = zr(e)) === null || t === void 0 ? void 0 : t.spanContext();
|
|
359
359
|
}
|
|
360
|
-
var
|
|
361
|
-
function Li(e) {
|
|
362
|
-
return ji.test(e) && e !== Rn;
|
|
363
|
-
}
|
|
360
|
+
var qi = /^([0-9a-f]{32})$/i, Li = /^[0-9a-f]{16}$/i;
|
|
364
361
|
function Vi(e) {
|
|
365
|
-
return qi.test(e) && e !==
|
|
362
|
+
return qi.test(e) && e !== Rn;
|
|
363
|
+
}
|
|
364
|
+
function Fi(e) {
|
|
365
|
+
return Li.test(e) && e !== xn;
|
|
366
366
|
}
|
|
367
367
|
function An(e) {
|
|
368
|
-
return
|
|
368
|
+
return Vi(e.traceId) && Fi(e.spanId);
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function Bi(e) {
|
|
371
371
|
return new ut(e);
|
|
372
372
|
}
|
|
373
|
-
var
|
|
373
|
+
var mr = En.getInstance(), kn = (
|
|
374
374
|
/** @class */
|
|
375
375
|
(function() {
|
|
376
376
|
function e() {
|
|
377
377
|
}
|
|
378
378
|
return e.prototype.startSpan = function(t, r, a) {
|
|
379
|
-
a === void 0 && (a =
|
|
379
|
+
a === void 0 && (a = mr.active());
|
|
380
380
|
var o = !!r?.root;
|
|
381
381
|
if (o)
|
|
382
382
|
return new ut();
|
|
383
383
|
var n = a && Cn(a);
|
|
384
|
-
return
|
|
384
|
+
return Hi(n) && An(n) ? new ut(n) : new ut();
|
|
385
385
|
}, e.prototype.startActiveSpan = function(t, r, a, o) {
|
|
386
386
|
var n, i, s;
|
|
387
387
|
if (!(arguments.length < 2)) {
|
|
388
388
|
arguments.length === 2 ? s = r : arguments.length === 3 ? (n = r, s = a) : (n = r, i = a, s = o);
|
|
389
|
-
var u = i ??
|
|
390
|
-
return
|
|
389
|
+
var u = i ?? mr.active(), l = this.startSpan(t, n, u), d = Wr(u, l);
|
|
390
|
+
return mr.with(d, s, void 0, l);
|
|
391
391
|
}
|
|
392
392
|
}, e;
|
|
393
393
|
})()
|
|
394
394
|
);
|
|
395
|
-
function
|
|
395
|
+
function Hi(e) {
|
|
396
396
|
return typeof e == "object" && typeof e.spanId == "string" && typeof e.traceId == "string" && typeof e.traceFlags == "number";
|
|
397
397
|
}
|
|
398
|
-
var
|
|
398
|
+
var Gi = new kn(), Ji = (
|
|
399
399
|
/** @class */
|
|
400
400
|
(function() {
|
|
401
401
|
function e(t, r, a, o) {
|
|
@@ -410,10 +410,10 @@ var Hi = new kn(), Gi = (
|
|
|
410
410
|
if (this._delegate)
|
|
411
411
|
return this._delegate;
|
|
412
412
|
var t = this._provider.getDelegateTracer(this.name, this.version, this.options);
|
|
413
|
-
return t ? (this._delegate = t, this._delegate) :
|
|
413
|
+
return t ? (this._delegate = t, this._delegate) : Gi;
|
|
414
414
|
}, e;
|
|
415
415
|
})()
|
|
416
|
-
),
|
|
416
|
+
), Zi = (
|
|
417
417
|
/** @class */
|
|
418
418
|
(function() {
|
|
419
419
|
function e() {
|
|
@@ -422,17 +422,17 @@ var Hi = new kn(), Gi = (
|
|
|
422
422
|
return new kn();
|
|
423
423
|
}, e;
|
|
424
424
|
})()
|
|
425
|
-
),
|
|
425
|
+
), zi = new Zi(), Ia = (
|
|
426
426
|
/** @class */
|
|
427
427
|
(function() {
|
|
428
428
|
function e() {
|
|
429
429
|
}
|
|
430
430
|
return e.prototype.getTracer = function(t, r, a) {
|
|
431
431
|
var o;
|
|
432
|
-
return (o = this.getDelegateTracer(t, r, a)) !== null && o !== void 0 ? o : new
|
|
432
|
+
return (o = this.getDelegateTracer(t, r, a)) !== null && o !== void 0 ? o : new Ji(this, t, r, a);
|
|
433
433
|
}, e.prototype.getDelegate = function() {
|
|
434
434
|
var t;
|
|
435
|
-
return (t = this._delegate) !== null && t !== void 0 ? t :
|
|
435
|
+
return (t = this._delegate) !== null && t !== void 0 ? t : zi;
|
|
436
436
|
}, e.prototype.setDelegate = function(t) {
|
|
437
437
|
this._delegate = t;
|
|
438
438
|
}, e.prototype.getDelegateTracer = function(t, r, a) {
|
|
@@ -444,27 +444,27 @@ var Hi = new kn(), Gi = (
|
|
|
444
444
|
(function(e) {
|
|
445
445
|
e[e.UNSET = 0] = "UNSET", e[e.OK = 1] = "OK", e[e.ERROR = 2] = "ERROR";
|
|
446
446
|
})(Dt || (Dt = {}));
|
|
447
|
-
var
|
|
447
|
+
var gr = "trace", Wi = (
|
|
448
448
|
/** @class */
|
|
449
449
|
(function() {
|
|
450
450
|
function e() {
|
|
451
|
-
this._proxyTracerProvider = new Ia(), this.wrapSpanContext =
|
|
451
|
+
this._proxyTracerProvider = new Ia(), this.wrapSpanContext = Bi, this.isSpanContextValid = An, this.deleteSpan = Di, this.getSpan = zr, this.getActiveSpan = Ui, this.getSpanContext = Cn, this.setSpan = Wr, this.setSpanContext = ji;
|
|
452
452
|
}
|
|
453
453
|
return e.getInstance = function() {
|
|
454
454
|
return this._instance || (this._instance = new e()), this._instance;
|
|
455
455
|
}, e.prototype.setGlobalTracerProvider = function(t) {
|
|
456
|
-
var r = Gr(
|
|
456
|
+
var r = Gr(gr, this._proxyTracerProvider, Ut.instance());
|
|
457
457
|
return r && this._proxyTracerProvider.setDelegate(t), r;
|
|
458
458
|
}, e.prototype.getTracerProvider = function() {
|
|
459
|
-
return ht(
|
|
459
|
+
return ht(gr) || this._proxyTracerProvider;
|
|
460
460
|
}, e.prototype.getTracer = function(t, r) {
|
|
461
461
|
return this.getTracerProvider().getTracer(t, r);
|
|
462
462
|
}, e.prototype.disable = function() {
|
|
463
|
-
Jr(
|
|
463
|
+
Jr(gr, Ut.instance()), this._proxyTracerProvider = new Ia();
|
|
464
464
|
}, e;
|
|
465
465
|
})()
|
|
466
|
-
),
|
|
467
|
-
function
|
|
466
|
+
), Ki = Wi.getInstance();
|
|
467
|
+
function Or(...e) {
|
|
468
468
|
return e.reduce(
|
|
469
469
|
(t, r) => ({
|
|
470
470
|
...t,
|
|
@@ -473,7 +473,7 @@ function kr(...e) {
|
|
|
473
473
|
{}
|
|
474
474
|
);
|
|
475
475
|
}
|
|
476
|
-
async function
|
|
476
|
+
async function Yi(e, t) {
|
|
477
477
|
if (e == null)
|
|
478
478
|
return Promise.resolve();
|
|
479
479
|
const r = t?.abortSignal;
|
|
@@ -518,7 +518,7 @@ var It = ({
|
|
|
518
518
|
message: `The separator "${a}" must not be part of the alphabet "${r}".`
|
|
519
519
|
});
|
|
520
520
|
return () => `${e}${a}${o()}`;
|
|
521
|
-
},
|
|
521
|
+
}, Xi = It();
|
|
522
522
|
function On(e) {
|
|
523
523
|
return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.message : JSON.stringify(e);
|
|
524
524
|
}
|
|
@@ -526,7 +526,7 @@ function Le(e) {
|
|
|
526
526
|
return (e instanceof Error || e instanceof DOMException) && (e.name === "AbortError" || e.name === "ResponseAborted" || // Next.js
|
|
527
527
|
e.name === "TimeoutError");
|
|
528
528
|
}
|
|
529
|
-
var
|
|
529
|
+
var Qi = ["fetch failed", "failed to fetch"];
|
|
530
530
|
function Pn({
|
|
531
531
|
error: e,
|
|
532
532
|
url: t,
|
|
@@ -534,7 +534,7 @@ function Pn({
|
|
|
534
534
|
}) {
|
|
535
535
|
if (Le(e))
|
|
536
536
|
return e;
|
|
537
|
-
if (e instanceof TypeError &&
|
|
537
|
+
if (e instanceof TypeError && Qi.includes(e.message.toLowerCase())) {
|
|
538
538
|
const a = e.cause;
|
|
539
539
|
if (a != null)
|
|
540
540
|
return new se({
|
|
@@ -552,7 +552,7 @@ function Kr(e = globalThis) {
|
|
|
552
552
|
var t, r, a;
|
|
553
553
|
return e.window ? "runtime/browser" : (t = e.navigator) != null && t.userAgent ? `runtime/${e.navigator.userAgent.toLowerCase()}` : (a = (r = e.process) == null ? void 0 : r.versions) != null && a.node ? `runtime/node.js/${e.process.version.substring(0)}` : e.EdgeRuntime ? "runtime/vercel-edge" : "runtime/unknown";
|
|
554
554
|
}
|
|
555
|
-
function
|
|
555
|
+
function el(e) {
|
|
556
556
|
if (e == null)
|
|
557
557
|
return {};
|
|
558
558
|
const t = {};
|
|
@@ -567,25 +567,25 @@ function Qi(e) {
|
|
|
567
567
|
}
|
|
568
568
|
return t;
|
|
569
569
|
}
|
|
570
|
-
function
|
|
571
|
-
const r = new Headers(
|
|
570
|
+
function Xt(e, ...t) {
|
|
571
|
+
const r = new Headers(el(e)), a = r.get("user-agent") || "";
|
|
572
572
|
return r.set(
|
|
573
573
|
"user-agent",
|
|
574
574
|
[a, ...t].filter(Boolean).join(" ")
|
|
575
575
|
), Object.fromEntries(r.entries());
|
|
576
576
|
}
|
|
577
|
-
var Mn = "3.0.16",
|
|
577
|
+
var Mn = "3.0.16", tl = () => globalThis.fetch, Ea = async ({
|
|
578
578
|
url: e,
|
|
579
579
|
headers: t = {},
|
|
580
580
|
successfulResponseHandler: r,
|
|
581
581
|
failedResponseHandler: a,
|
|
582
582
|
abortSignal: o,
|
|
583
|
-
fetch: n =
|
|
583
|
+
fetch: n = tl()
|
|
584
584
|
}) => {
|
|
585
585
|
try {
|
|
586
586
|
const i = await n(e, {
|
|
587
587
|
method: "GET",
|
|
588
|
-
headers:
|
|
588
|
+
headers: Xt(
|
|
589
589
|
t,
|
|
590
590
|
`ai-sdk/provider-utils/${Mn}`,
|
|
591
591
|
Kr()
|
|
@@ -632,7 +632,7 @@ var Mn = "3.0.16", el = () => globalThis.fetch, Ea = async ({
|
|
|
632
632
|
throw Pn({ error: i, url: e, requestBodyValues: {} });
|
|
633
633
|
}
|
|
634
634
|
};
|
|
635
|
-
function
|
|
635
|
+
function rl({
|
|
636
636
|
mediaType: e,
|
|
637
637
|
url: t,
|
|
638
638
|
supportedUrls: r
|
|
@@ -651,12 +651,12 @@ function Ot({
|
|
|
651
651
|
if (!(e != null || typeof process > "u") && (e = process.env[t], !(e == null || typeof e != "string")))
|
|
652
652
|
return e;
|
|
653
653
|
}
|
|
654
|
-
var
|
|
655
|
-
function
|
|
654
|
+
var al = /"__proto__"\s*:/, nl = /"constructor"\s*:/;
|
|
655
|
+
function ol(e) {
|
|
656
656
|
const t = JSON.parse(e);
|
|
657
|
-
return t === null || typeof t != "object" ||
|
|
657
|
+
return t === null || typeof t != "object" || al.test(e) === !1 && nl.test(e) === !1 ? t : sl(t);
|
|
658
658
|
}
|
|
659
|
-
function
|
|
659
|
+
function sl(e) {
|
|
660
660
|
let t = [e];
|
|
661
661
|
for (; t.length; ) {
|
|
662
662
|
const r = t;
|
|
@@ -678,27 +678,27 @@ function Nn(e) {
|
|
|
678
678
|
const { stackTraceLimit: t } = Error;
|
|
679
679
|
Error.stackTraceLimit = 0;
|
|
680
680
|
try {
|
|
681
|
-
return
|
|
681
|
+
return ol(e);
|
|
682
682
|
} finally {
|
|
683
683
|
Error.stackTraceLimit = t;
|
|
684
684
|
}
|
|
685
685
|
}
|
|
686
686
|
var jt = Symbol.for("vercel.ai.validator");
|
|
687
|
-
function
|
|
687
|
+
function il(e) {
|
|
688
688
|
return { [jt]: !0, validate: e };
|
|
689
689
|
}
|
|
690
|
-
function
|
|
690
|
+
function ll(e) {
|
|
691
691
|
return typeof e == "object" && e !== null && jt in e && e[jt] === !0 && "validate" in e;
|
|
692
692
|
}
|
|
693
693
|
function Xe(e) {
|
|
694
694
|
let t;
|
|
695
695
|
return () => (t == null && (t = e()), t);
|
|
696
696
|
}
|
|
697
|
-
function ll(e) {
|
|
698
|
-
return il(e) ? e : typeof e == "function" ? e() : ul(e);
|
|
699
|
-
}
|
|
700
697
|
function ul(e) {
|
|
701
|
-
return
|
|
698
|
+
return ll(e) ? e : typeof e == "function" ? e() : cl(e);
|
|
699
|
+
}
|
|
700
|
+
function cl(e) {
|
|
701
|
+
return il(async (t) => {
|
|
702
702
|
const r = await e["~standard"].validate(t);
|
|
703
703
|
return r.issues == null ? { success: !0, value: r.value } : {
|
|
704
704
|
success: !1,
|
|
@@ -709,7 +709,7 @@ function ul(e) {
|
|
|
709
709
|
};
|
|
710
710
|
});
|
|
711
711
|
}
|
|
712
|
-
async function
|
|
712
|
+
async function Pr({
|
|
713
713
|
value: e,
|
|
714
714
|
schema: t
|
|
715
715
|
}) {
|
|
@@ -722,7 +722,7 @@ async function je({
|
|
|
722
722
|
value: e,
|
|
723
723
|
schema: t
|
|
724
724
|
}) {
|
|
725
|
-
const r =
|
|
725
|
+
const r = ul(t);
|
|
726
726
|
try {
|
|
727
727
|
if (r.validate == null)
|
|
728
728
|
return { success: !0, value: e, rawValue: e };
|
|
@@ -740,13 +740,13 @@ async function je({
|
|
|
740
740
|
};
|
|
741
741
|
}
|
|
742
742
|
}
|
|
743
|
-
async function
|
|
743
|
+
async function dl({
|
|
744
744
|
text: e,
|
|
745
745
|
schema: t
|
|
746
746
|
}) {
|
|
747
747
|
try {
|
|
748
748
|
const r = Nn(e);
|
|
749
|
-
return t == null ? r :
|
|
749
|
+
return t == null ? r : Pr({ value: r, schema: t });
|
|
750
750
|
} catch (r) {
|
|
751
751
|
throw Mt.isInstance(r) || dt.isInstance(r) ? r : new Mt({ text: e, cause: r });
|
|
752
752
|
}
|
|
@@ -766,7 +766,7 @@ async function Ve({
|
|
|
766
766
|
};
|
|
767
767
|
}
|
|
768
768
|
}
|
|
769
|
-
function
|
|
769
|
+
function pl({
|
|
770
770
|
stream: e,
|
|
771
771
|
schema: t
|
|
772
772
|
}) {
|
|
@@ -778,7 +778,7 @@ function dl({
|
|
|
778
778
|
})
|
|
779
779
|
);
|
|
780
780
|
}
|
|
781
|
-
var
|
|
781
|
+
var fl = () => globalThis.fetch, Mr = async ({
|
|
782
782
|
url: e,
|
|
783
783
|
headers: t,
|
|
784
784
|
body: r,
|
|
@@ -786,7 +786,7 @@ var pl = () => globalThis.fetch, Pr = async ({
|
|
|
786
786
|
successfulResponseHandler: o,
|
|
787
787
|
abortSignal: n,
|
|
788
788
|
fetch: i
|
|
789
|
-
}) =>
|
|
789
|
+
}) => hl({
|
|
790
790
|
url: e,
|
|
791
791
|
headers: {
|
|
792
792
|
"Content-Type": "application/json",
|
|
@@ -800,19 +800,19 @@ var pl = () => globalThis.fetch, Pr = async ({
|
|
|
800
800
|
successfulResponseHandler: o,
|
|
801
801
|
abortSignal: n,
|
|
802
802
|
fetch: i
|
|
803
|
-
}),
|
|
803
|
+
}), hl = async ({
|
|
804
804
|
url: e,
|
|
805
805
|
headers: t = {},
|
|
806
806
|
body: r,
|
|
807
807
|
successfulResponseHandler: a,
|
|
808
808
|
failedResponseHandler: o,
|
|
809
809
|
abortSignal: n,
|
|
810
|
-
fetch: i =
|
|
810
|
+
fetch: i = fl()
|
|
811
811
|
}) => {
|
|
812
812
|
try {
|
|
813
813
|
const s = await i(e, {
|
|
814
814
|
method: "POST",
|
|
815
|
-
headers:
|
|
815
|
+
headers: Xt(
|
|
816
816
|
t,
|
|
817
817
|
`ai-sdk/provider-utils/${Mn}`,
|
|
818
818
|
Kr()
|
|
@@ -883,7 +883,7 @@ var mt = ({
|
|
|
883
883
|
})
|
|
884
884
|
};
|
|
885
885
|
try {
|
|
886
|
-
const u = await
|
|
886
|
+
const u = await dl({
|
|
887
887
|
text: i,
|
|
888
888
|
schema: e
|
|
889
889
|
});
|
|
@@ -914,13 +914,13 @@ var mt = ({
|
|
|
914
914
|
})
|
|
915
915
|
};
|
|
916
916
|
}
|
|
917
|
-
},
|
|
917
|
+
}, ml = (e) => async ({ response: t }) => {
|
|
918
918
|
const r = Tt(t);
|
|
919
919
|
if (t.body == null)
|
|
920
920
|
throw new ti({});
|
|
921
921
|
return {
|
|
922
922
|
responseHeaders: r,
|
|
923
|
-
value:
|
|
923
|
+
value: pl({
|
|
924
924
|
stream: t.body,
|
|
925
925
|
schema: e
|
|
926
926
|
})
|
|
@@ -945,12 +945,12 @@ var mt = ({
|
|
|
945
945
|
value: n.value,
|
|
946
946
|
rawValue: n.rawValue
|
|
947
947
|
};
|
|
948
|
-
},
|
|
948
|
+
}, gl = (e, t) => {
|
|
949
949
|
let r = 0;
|
|
950
950
|
for (; r < e.length && r < t.length && e[r] === t[r]; r++)
|
|
951
951
|
;
|
|
952
952
|
return [(e.length - r).toString(), ...t.slice(r)].join("/");
|
|
953
|
-
},
|
|
953
|
+
}, vl = Symbol(
|
|
954
954
|
"Let zodToJsonSchema decide on which parser to use"
|
|
955
955
|
), xa = {
|
|
956
956
|
name: void 0,
|
|
@@ -972,7 +972,7 @@ var mt = ({
|
|
|
972
972
|
emailStrategy: "format:email",
|
|
973
973
|
base64Strategy: "contentEncoding:base64",
|
|
974
974
|
nameStrategy: "ref"
|
|
975
|
-
},
|
|
975
|
+
}, yl = (e) => typeof e == "string" ? {
|
|
976
976
|
...xa,
|
|
977
977
|
name: e
|
|
978
978
|
} : {
|
|
@@ -982,7 +982,7 @@ var mt = ({
|
|
|
982
982
|
function ue() {
|
|
983
983
|
return {};
|
|
984
984
|
}
|
|
985
|
-
function
|
|
985
|
+
function _l(e, t) {
|
|
986
986
|
var r, a, o;
|
|
987
987
|
const n = {
|
|
988
988
|
type: "array"
|
|
@@ -992,7 +992,7 @@ function yl(e, t) {
|
|
|
992
992
|
currentPath: [...t.currentPath, "items"]
|
|
993
993
|
})), 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;
|
|
994
994
|
}
|
|
995
|
-
function
|
|
995
|
+
function wl(e) {
|
|
996
996
|
const t = {
|
|
997
997
|
type: "integer",
|
|
998
998
|
format: "int64"
|
|
@@ -1012,13 +1012,13 @@ function _l(e) {
|
|
|
1012
1012
|
}
|
|
1013
1013
|
return t;
|
|
1014
1014
|
}
|
|
1015
|
-
function
|
|
1015
|
+
function bl() {
|
|
1016
1016
|
return { type: "boolean" };
|
|
1017
1017
|
}
|
|
1018
1018
|
function $n(e, t) {
|
|
1019
1019
|
return G(e.type._def, t);
|
|
1020
1020
|
}
|
|
1021
|
-
var
|
|
1021
|
+
var Tl = (e, t) => G(e.innerType._def, t);
|
|
1022
1022
|
function Un(e, t, r) {
|
|
1023
1023
|
const a = r ?? t.dateStrategy;
|
|
1024
1024
|
if (Array.isArray(a))
|
|
@@ -1038,10 +1038,10 @@ function Un(e, t, r) {
|
|
|
1038
1038
|
format: "date"
|
|
1039
1039
|
};
|
|
1040
1040
|
case "integer":
|
|
1041
|
-
return
|
|
1041
|
+
return Il(e);
|
|
1042
1042
|
}
|
|
1043
1043
|
}
|
|
1044
|
-
var
|
|
1044
|
+
var Il = (e) => {
|
|
1045
1045
|
const t = {
|
|
1046
1046
|
type: "integer",
|
|
1047
1047
|
format: "unix-time"
|
|
@@ -1057,23 +1057,23 @@ var Tl = (e) => {
|
|
|
1057
1057
|
}
|
|
1058
1058
|
return t;
|
|
1059
1059
|
};
|
|
1060
|
-
function
|
|
1060
|
+
function Sl(e, t) {
|
|
1061
1061
|
return {
|
|
1062
1062
|
...G(e.innerType._def, t),
|
|
1063
1063
|
default: e.defaultValue()
|
|
1064
1064
|
};
|
|
1065
1065
|
}
|
|
1066
|
-
function
|
|
1066
|
+
function El(e, t) {
|
|
1067
1067
|
return t.effectStrategy === "input" ? G(e.schema._def, t) : ue();
|
|
1068
1068
|
}
|
|
1069
|
-
function
|
|
1069
|
+
function xl(e) {
|
|
1070
1070
|
return {
|
|
1071
1071
|
type: "string",
|
|
1072
1072
|
enum: Array.from(e.values)
|
|
1073
1073
|
};
|
|
1074
1074
|
}
|
|
1075
|
-
var
|
|
1076
|
-
function
|
|
1075
|
+
var Rl = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
|
|
1076
|
+
function Cl(e, t) {
|
|
1077
1077
|
const r = [
|
|
1078
1078
|
G(e.left._def, {
|
|
1079
1079
|
...t,
|
|
@@ -1085,7 +1085,7 @@ function Rl(e, t) {
|
|
|
1085
1085
|
})
|
|
1086
1086
|
].filter((o) => !!o), a = [];
|
|
1087
1087
|
return r.forEach((o) => {
|
|
1088
|
-
if (
|
|
1088
|
+
if (Rl(o))
|
|
1089
1089
|
a.push(...o.allOf);
|
|
1090
1090
|
else {
|
|
1091
1091
|
let n = o;
|
|
@@ -1097,7 +1097,7 @@ function Rl(e, t) {
|
|
|
1097
1097
|
}
|
|
1098
1098
|
}), a.length ? { allOf: a } : void 0;
|
|
1099
1099
|
}
|
|
1100
|
-
function
|
|
1100
|
+
function Al(e) {
|
|
1101
1101
|
const t = typeof e.value;
|
|
1102
1102
|
return t !== "bigint" && t !== "number" && t !== "boolean" && t !== "string" ? {
|
|
1103
1103
|
type: Array.isArray(e.value) ? "array" : "object"
|
|
@@ -1106,7 +1106,7 @@ function Cl(e) {
|
|
|
1106
1106
|
const: e.value
|
|
1107
1107
|
};
|
|
1108
1108
|
}
|
|
1109
|
-
var
|
|
1109
|
+
var vr = void 0, ge = {
|
|
1110
1110
|
/**
|
|
1111
1111
|
* `c` was changed to `[cC]` to replicate /i flag
|
|
1112
1112
|
*/
|
|
@@ -1128,10 +1128,10 @@ var gr = void 0, ge = {
|
|
|
1128
1128
|
* Fix in Zod:
|
|
1129
1129
|
* https://github.com/colinhacks/zod/commit/9340fd51e48576a75adc919bff65dbc4a5d4c99b
|
|
1130
1130
|
*/
|
|
1131
|
-
emoji: () => (
|
|
1131
|
+
emoji: () => (vr === void 0 && (vr = RegExp(
|
|
1132
1132
|
"^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",
|
|
1133
1133
|
"u"
|
|
1134
|
-
)),
|
|
1134
|
+
)), vr),
|
|
1135
1135
|
/**
|
|
1136
1136
|
* Unused
|
|
1137
1137
|
*/
|
|
@@ -1195,7 +1195,7 @@ function Dn(e, t) {
|
|
|
1195
1195
|
case "startsWith":
|
|
1196
1196
|
oe(
|
|
1197
1197
|
r,
|
|
1198
|
-
RegExp(`^${
|
|
1198
|
+
RegExp(`^${yr(a.value, t)}`),
|
|
1199
1199
|
a.message,
|
|
1200
1200
|
t
|
|
1201
1201
|
);
|
|
@@ -1203,7 +1203,7 @@ function Dn(e, t) {
|
|
|
1203
1203
|
case "endsWith":
|
|
1204
1204
|
oe(
|
|
1205
1205
|
r,
|
|
1206
|
-
RegExp(`${
|
|
1206
|
+
RegExp(`${yr(a.value, t)}$`),
|
|
1207
1207
|
a.message,
|
|
1208
1208
|
t
|
|
1209
1209
|
);
|
|
@@ -1226,7 +1226,7 @@ function Dn(e, t) {
|
|
|
1226
1226
|
case "includes": {
|
|
1227
1227
|
oe(
|
|
1228
1228
|
r,
|
|
1229
|
-
RegExp(
|
|
1229
|
+
RegExp(yr(a.value, t)),
|
|
1230
1230
|
a.message,
|
|
1231
1231
|
t
|
|
1232
1232
|
);
|
|
@@ -1275,16 +1275,16 @@ function Dn(e, t) {
|
|
|
1275
1275
|
}
|
|
1276
1276
|
return r;
|
|
1277
1277
|
}
|
|
1278
|
-
function
|
|
1279
|
-
return t.patternStrategy === "escape" ?
|
|
1278
|
+
function yr(e, t) {
|
|
1279
|
+
return t.patternStrategy === "escape" ? Ol(e) : e;
|
|
1280
1280
|
}
|
|
1281
|
-
var
|
|
1281
|
+
var kl = new Set(
|
|
1282
1282
|
"ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789"
|
|
1283
1283
|
);
|
|
1284
|
-
function
|
|
1284
|
+
function Ol(e) {
|
|
1285
1285
|
let t = "";
|
|
1286
1286
|
for (let r = 0; r < e.length; r++)
|
|
1287
|
-
|
|
1287
|
+
kl.has(e[r]) || (t += "\\"), t += e[r];
|
|
1288
1288
|
return t;
|
|
1289
1289
|
}
|
|
1290
1290
|
function ve(e, t, r, a) {
|
|
@@ -1400,7 +1400,7 @@ function jn(e, t) {
|
|
|
1400
1400
|
}
|
|
1401
1401
|
return u;
|
|
1402
1402
|
}
|
|
1403
|
-
function
|
|
1403
|
+
function Pl(e, t) {
|
|
1404
1404
|
if (t.mapStrategy === "record")
|
|
1405
1405
|
return jn(e, t);
|
|
1406
1406
|
const r = G(e.keyType._def, {
|
|
@@ -1421,7 +1421,7 @@ function Ol(e, t) {
|
|
|
1421
1421
|
}
|
|
1422
1422
|
};
|
|
1423
1423
|
}
|
|
1424
|
-
function
|
|
1424
|
+
function Ml(e) {
|
|
1425
1425
|
const t = e.values, a = Object.keys(e.values).filter((n) => typeof t[t[n]] != "number").map((n) => t[n]), o = Array.from(
|
|
1426
1426
|
new Set(a.map((n) => typeof n))
|
|
1427
1427
|
);
|
|
@@ -1430,28 +1430,28 @@ function Pl(e) {
|
|
|
1430
1430
|
enum: a
|
|
1431
1431
|
};
|
|
1432
1432
|
}
|
|
1433
|
-
function
|
|
1433
|
+
function Nl() {
|
|
1434
1434
|
return { not: ue() };
|
|
1435
1435
|
}
|
|
1436
|
-
function
|
|
1436
|
+
function $l() {
|
|
1437
1437
|
return {
|
|
1438
1438
|
type: "null"
|
|
1439
1439
|
};
|
|
1440
1440
|
}
|
|
1441
|
-
var
|
|
1441
|
+
var Nr = {
|
|
1442
1442
|
ZodString: "string",
|
|
1443
1443
|
ZodNumber: "number",
|
|
1444
1444
|
ZodBigInt: "integer",
|
|
1445
1445
|
ZodBoolean: "boolean",
|
|
1446
1446
|
ZodNull: "null"
|
|
1447
1447
|
};
|
|
1448
|
-
function
|
|
1448
|
+
function Ul(e, t) {
|
|
1449
1449
|
const r = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
|
|
1450
1450
|
if (r.every(
|
|
1451
|
-
(a) => a._def.typeName in
|
|
1451
|
+
(a) => a._def.typeName in Nr && (!a._def.checks || !a._def.checks.length)
|
|
1452
1452
|
)) {
|
|
1453
1453
|
const a = r.reduce((o, n) => {
|
|
1454
|
-
const i =
|
|
1454
|
+
const i = Nr[n._def.typeName];
|
|
1455
1455
|
return i && !o.includes(i) ? [...o, i] : o;
|
|
1456
1456
|
}, []);
|
|
1457
1457
|
return {
|
|
@@ -1500,9 +1500,9 @@ function $l(e, t) {
|
|
|
1500
1500
|
[]
|
|
1501
1501
|
)
|
|
1502
1502
|
};
|
|
1503
|
-
return
|
|
1503
|
+
return Dl(e, t);
|
|
1504
1504
|
}
|
|
1505
|
-
var
|
|
1505
|
+
var Dl = (e, t) => {
|
|
1506
1506
|
const r = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map(
|
|
1507
1507
|
(a, o) => G(a._def, {
|
|
1508
1508
|
...t,
|
|
@@ -1513,13 +1513,13 @@ var Ul = (e, t) => {
|
|
|
1513
1513
|
);
|
|
1514
1514
|
return r.length ? { anyOf: r } : void 0;
|
|
1515
1515
|
};
|
|
1516
|
-
function
|
|
1516
|
+
function jl(e, t) {
|
|
1517
1517
|
if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(
|
|
1518
1518
|
e.innerType._def.typeName
|
|
1519
1519
|
) && (!e.innerType._def.checks || !e.innerType._def.checks.length))
|
|
1520
1520
|
return {
|
|
1521
1521
|
type: [
|
|
1522
|
-
|
|
1522
|
+
Nr[e.innerType._def.typeName],
|
|
1523
1523
|
"null"
|
|
1524
1524
|
]
|
|
1525
1525
|
};
|
|
@@ -1529,7 +1529,7 @@ function Dl(e, t) {
|
|
|
1529
1529
|
});
|
|
1530
1530
|
return r && { anyOf: [r, { type: "null" }] };
|
|
1531
1531
|
}
|
|
1532
|
-
function
|
|
1532
|
+
function ql(e) {
|
|
1533
1533
|
const t = {
|
|
1534
1534
|
type: "number"
|
|
1535
1535
|
};
|
|
@@ -1551,7 +1551,7 @@ function jl(e) {
|
|
|
1551
1551
|
}
|
|
1552
1552
|
return t;
|
|
1553
1553
|
}
|
|
1554
|
-
function
|
|
1554
|
+
function Ll(e, t) {
|
|
1555
1555
|
const r = {
|
|
1556
1556
|
type: "object",
|
|
1557
1557
|
properties: {}
|
|
@@ -1560,7 +1560,7 @@ function ql(e, t) {
|
|
|
1560
1560
|
let s = o[i];
|
|
1561
1561
|
if (s === void 0 || s._def === void 0)
|
|
1562
1562
|
continue;
|
|
1563
|
-
const u =
|
|
1563
|
+
const u = Fl(s), l = G(s._def, {
|
|
1564
1564
|
...t,
|
|
1565
1565
|
currentPath: [...t.currentPath, "properties", i],
|
|
1566
1566
|
propertyPath: [...t.currentPath, "properties", i]
|
|
@@ -1568,10 +1568,10 @@ function ql(e, t) {
|
|
|
1568
1568
|
l !== void 0 && (r.properties[i] = l, u || a.push(i));
|
|
1569
1569
|
}
|
|
1570
1570
|
a.length && (r.required = a);
|
|
1571
|
-
const n =
|
|
1571
|
+
const n = Vl(e, t);
|
|
1572
1572
|
return n !== void 0 && (r.additionalProperties = n), r;
|
|
1573
1573
|
}
|
|
1574
|
-
function
|
|
1574
|
+
function Vl(e, t) {
|
|
1575
1575
|
if (e.catchall._def.typeName !== "ZodNever")
|
|
1576
1576
|
return G(e.catchall._def, {
|
|
1577
1577
|
...t,
|
|
@@ -1586,14 +1586,14 @@ function Ll(e, t) {
|
|
|
1586
1586
|
return t.removeAdditionalStrategy === "strict" ? t.allowedAdditionalProperties : t.rejectedAdditionalProperties;
|
|
1587
1587
|
}
|
|
1588
1588
|
}
|
|
1589
|
-
function
|
|
1589
|
+
function Fl(e) {
|
|
1590
1590
|
try {
|
|
1591
1591
|
return e.isOptional();
|
|
1592
1592
|
} catch {
|
|
1593
1593
|
return !0;
|
|
1594
1594
|
}
|
|
1595
1595
|
}
|
|
1596
|
-
var
|
|
1596
|
+
var Bl = (e, t) => {
|
|
1597
1597
|
var r;
|
|
1598
1598
|
if (t.currentPath.toString() === ((r = t.propertyPath) == null ? void 0 : r.toString()))
|
|
1599
1599
|
return G(e.innerType._def, t);
|
|
@@ -1602,7 +1602,7 @@ var Fl = (e, t) => {
|
|
|
1602
1602
|
currentPath: [...t.currentPath, "anyOf", "1"]
|
|
1603
1603
|
});
|
|
1604
1604
|
return a ? { anyOf: [{ not: ue() }, a] } : ue();
|
|
1605
|
-
},
|
|
1605
|
+
}, Hl = (e, t) => {
|
|
1606
1606
|
if (t.pipeStrategy === "input")
|
|
1607
1607
|
return G(e.in._def, t);
|
|
1608
1608
|
if (t.pipeStrategy === "output")
|
|
@@ -1618,10 +1618,10 @@ var Fl = (e, t) => {
|
|
|
1618
1618
|
allOf: [r, a].filter((o) => o !== void 0)
|
|
1619
1619
|
};
|
|
1620
1620
|
};
|
|
1621
|
-
function
|
|
1621
|
+
function Gl(e, t) {
|
|
1622
1622
|
return G(e.type._def, t);
|
|
1623
1623
|
}
|
|
1624
|
-
function
|
|
1624
|
+
function Jl(e, t) {
|
|
1625
1625
|
const a = {
|
|
1626
1626
|
type: "array",
|
|
1627
1627
|
uniqueItems: !0,
|
|
@@ -1632,7 +1632,7 @@ function Gl(e, t) {
|
|
|
1632
1632
|
};
|
|
1633
1633
|
return e.minSize && (a.minItems = e.minSize.value), e.maxSize && (a.maxItems = e.maxSize.value), a;
|
|
1634
1634
|
}
|
|
1635
|
-
function
|
|
1635
|
+
function Zl(e, t) {
|
|
1636
1636
|
return e.rest ? {
|
|
1637
1637
|
type: "array",
|
|
1638
1638
|
minItems: e.items.length,
|
|
@@ -1664,80 +1664,80 @@ function Jl(e, t) {
|
|
|
1664
1664
|
)
|
|
1665
1665
|
};
|
|
1666
1666
|
}
|
|
1667
|
-
function
|
|
1667
|
+
function zl() {
|
|
1668
1668
|
return {
|
|
1669
1669
|
not: ue()
|
|
1670
1670
|
};
|
|
1671
1671
|
}
|
|
1672
|
-
function
|
|
1672
|
+
function Wl() {
|
|
1673
1673
|
return ue();
|
|
1674
1674
|
}
|
|
1675
|
-
var
|
|
1675
|
+
var Kl = (e, t) => G(e.innerType._def, t), Yl = (e, t, r) => {
|
|
1676
1676
|
switch (t) {
|
|
1677
1677
|
case M.ZodString:
|
|
1678
1678
|
return Dn(e, r);
|
|
1679
1679
|
case M.ZodNumber:
|
|
1680
|
-
return
|
|
1680
|
+
return ql(e);
|
|
1681
1681
|
case M.ZodObject:
|
|
1682
|
-
return
|
|
1682
|
+
return Ll(e, r);
|
|
1683
1683
|
case M.ZodBigInt:
|
|
1684
|
-
return
|
|
1684
|
+
return wl(e);
|
|
1685
1685
|
case M.ZodBoolean:
|
|
1686
|
-
return
|
|
1686
|
+
return bl();
|
|
1687
1687
|
case M.ZodDate:
|
|
1688
1688
|
return Un(e, r);
|
|
1689
1689
|
case M.ZodUndefined:
|
|
1690
|
-
return
|
|
1690
|
+
return zl();
|
|
1691
1691
|
case M.ZodNull:
|
|
1692
|
-
return
|
|
1692
|
+
return $l();
|
|
1693
1693
|
case M.ZodArray:
|
|
1694
|
-
return
|
|
1694
|
+
return _l(e, r);
|
|
1695
1695
|
case M.ZodUnion:
|
|
1696
1696
|
case M.ZodDiscriminatedUnion:
|
|
1697
|
-
return
|
|
1697
|
+
return Ul(e, r);
|
|
1698
1698
|
case M.ZodIntersection:
|
|
1699
|
-
return
|
|
1699
|
+
return Cl(e, r);
|
|
1700
1700
|
case M.ZodTuple:
|
|
1701
|
-
return
|
|
1701
|
+
return Zl(e, r);
|
|
1702
1702
|
case M.ZodRecord:
|
|
1703
1703
|
return jn(e, r);
|
|
1704
1704
|
case M.ZodLiteral:
|
|
1705
|
-
return
|
|
1705
|
+
return Al(e);
|
|
1706
1706
|
case M.ZodEnum:
|
|
1707
|
-
return
|
|
1707
|
+
return xl(e);
|
|
1708
1708
|
case M.ZodNativeEnum:
|
|
1709
|
-
return
|
|
1709
|
+
return Ml(e);
|
|
1710
1710
|
case M.ZodNullable:
|
|
1711
|
-
return
|
|
1711
|
+
return jl(e, r);
|
|
1712
1712
|
case M.ZodOptional:
|
|
1713
|
-
return
|
|
1713
|
+
return Bl(e, r);
|
|
1714
1714
|
case M.ZodMap:
|
|
1715
|
-
return
|
|
1715
|
+
return Pl(e, r);
|
|
1716
1716
|
case M.ZodSet:
|
|
1717
|
-
return
|
|
1717
|
+
return Jl(e, r);
|
|
1718
1718
|
case M.ZodLazy:
|
|
1719
1719
|
return () => e.getter()._def;
|
|
1720
1720
|
case M.ZodPromise:
|
|
1721
|
-
return
|
|
1721
|
+
return Gl(e, r);
|
|
1722
1722
|
case M.ZodNaN:
|
|
1723
1723
|
case M.ZodNever:
|
|
1724
|
-
return
|
|
1724
|
+
return Nl();
|
|
1725
1725
|
case M.ZodEffects:
|
|
1726
|
-
return
|
|
1726
|
+
return El(e, r);
|
|
1727
1727
|
case M.ZodAny:
|
|
1728
1728
|
return ue();
|
|
1729
1729
|
case M.ZodUnknown:
|
|
1730
|
-
return
|
|
1730
|
+
return Wl();
|
|
1731
1731
|
case M.ZodDefault:
|
|
1732
|
-
return
|
|
1732
|
+
return Sl(e, r);
|
|
1733
1733
|
case M.ZodBranded:
|
|
1734
1734
|
return $n(e, r);
|
|
1735
1735
|
case M.ZodReadonly:
|
|
1736
|
-
return
|
|
1736
|
+
return Kl(e, r);
|
|
1737
1737
|
case M.ZodCatch:
|
|
1738
|
-
return
|
|
1738
|
+
return Tl(e, r);
|
|
1739
1739
|
case M.ZodPipeline:
|
|
1740
|
-
return
|
|
1740
|
+
return Hl(e, r);
|
|
1741
1741
|
case M.ZodFunction:
|
|
1742
1742
|
case M.ZodVoid:
|
|
1743
1743
|
case M.ZodSymbol:
|
|
@@ -1758,29 +1758,29 @@ function G(e, t, r = !1) {
|
|
|
1758
1758
|
o,
|
|
1759
1759
|
r
|
|
1760
1760
|
);
|
|
1761
|
-
if (u !==
|
|
1761
|
+
if (u !== vl)
|
|
1762
1762
|
return u;
|
|
1763
1763
|
}
|
|
1764
1764
|
if (o && !r) {
|
|
1765
|
-
const u =
|
|
1765
|
+
const u = Xl(o, t);
|
|
1766
1766
|
if (u !== void 0)
|
|
1767
1767
|
return u;
|
|
1768
1768
|
}
|
|
1769
1769
|
const n = { def: e, path: t.currentPath, jsonSchema: void 0 };
|
|
1770
1770
|
t.seen.set(e, n);
|
|
1771
|
-
const i =
|
|
1772
|
-
if (s &&
|
|
1771
|
+
const i = Yl(e, e.typeName, t), s = typeof i == "function" ? G(i(), t) : i;
|
|
1772
|
+
if (s && Ql(e, t, s), t.postProcess) {
|
|
1773
1773
|
const u = t.postProcess(s, e, t);
|
|
1774
1774
|
return n.jsonSchema = s, u;
|
|
1775
1775
|
}
|
|
1776
1776
|
return n.jsonSchema = s, s;
|
|
1777
1777
|
}
|
|
1778
|
-
var
|
|
1778
|
+
var Xl = (e, t) => {
|
|
1779
1779
|
switch (t.$refStrategy) {
|
|
1780
1780
|
case "root":
|
|
1781
1781
|
return { $ref: e.path.join("/") };
|
|
1782
1782
|
case "relative":
|
|
1783
|
-
return { $ref:
|
|
1783
|
+
return { $ref: gl(t.currentPath, e.path) };
|
|
1784
1784
|
case "none":
|
|
1785
1785
|
case "seen":
|
|
1786
1786
|
return e.path.length < t.currentPath.length && e.path.every((r, a) => t.currentPath[a] === r) ? (console.warn(
|
|
@@ -1789,8 +1789,8 @@ var Yl = (e, t) => {
|
|
|
1789
1789
|
)}! Defaulting to any`
|
|
1790
1790
|
), ue()) : t.$refStrategy === "seen" ? ue() : void 0;
|
|
1791
1791
|
}
|
|
1792
|
-
},
|
|
1793
|
-
const t =
|
|
1792
|
+
}, Ql = (e, t, r) => (e.description && (r.description = e.description), r), eu = (e) => {
|
|
1793
|
+
const t = yl(e), r = t.name !== void 0 ? [...t.basePath, t.definitionPath, t.name] : t.basePath;
|
|
1794
1794
|
return {
|
|
1795
1795
|
...t,
|
|
1796
1796
|
currentPath: r,
|
|
@@ -1807,9 +1807,9 @@ var Yl = (e, t) => {
|
|
|
1807
1807
|
])
|
|
1808
1808
|
)
|
|
1809
1809
|
};
|
|
1810
|
-
},
|
|
1810
|
+
}, tu = (e, t) => {
|
|
1811
1811
|
var r;
|
|
1812
|
-
const a =
|
|
1812
|
+
const a = eu(t);
|
|
1813
1813
|
let o = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce(
|
|
1814
1814
|
(l, [d, p]) => {
|
|
1815
1815
|
var m;
|
|
@@ -1851,13 +1851,13 @@ var Yl = (e, t) => {
|
|
|
1851
1851
|
}
|
|
1852
1852
|
};
|
|
1853
1853
|
return u.$schema = "http://json-schema.org/draft-07/schema#", u;
|
|
1854
|
-
},
|
|
1855
|
-
function
|
|
1854
|
+
}, ru = tu;
|
|
1855
|
+
function au(e, t) {
|
|
1856
1856
|
var r;
|
|
1857
1857
|
const a = (r = void 0) != null ? r : !1;
|
|
1858
1858
|
return Yr(
|
|
1859
1859
|
// defer json schema creation to avoid unnecessary computation when only validation is needed
|
|
1860
|
-
() =>
|
|
1860
|
+
() => ru(e, {
|
|
1861
1861
|
$refStrategy: a ? "root" : "none"
|
|
1862
1862
|
}),
|
|
1863
1863
|
{
|
|
@@ -1868,7 +1868,7 @@ function ru(e, t) {
|
|
|
1868
1868
|
}
|
|
1869
1869
|
);
|
|
1870
1870
|
}
|
|
1871
|
-
function
|
|
1871
|
+
function nu(e, t) {
|
|
1872
1872
|
var r;
|
|
1873
1873
|
const a = (r = void 0) != null ? r : !1;
|
|
1874
1874
|
return Yr(
|
|
@@ -1886,18 +1886,18 @@ function au(e, t) {
|
|
|
1886
1886
|
}
|
|
1887
1887
|
);
|
|
1888
1888
|
}
|
|
1889
|
-
function
|
|
1889
|
+
function ou(e) {
|
|
1890
1890
|
return "_zod" in e;
|
|
1891
1891
|
}
|
|
1892
1892
|
function Be(e, t) {
|
|
1893
|
-
return
|
|
1893
|
+
return ou(e) ? nu(e) : au(e);
|
|
1894
1894
|
}
|
|
1895
|
-
var
|
|
1895
|
+
var $r = Symbol.for("vercel.ai.schema");
|
|
1896
1896
|
function Yr(e, {
|
|
1897
1897
|
validate: t
|
|
1898
1898
|
} = {}) {
|
|
1899
1899
|
return {
|
|
1900
|
-
[
|
|
1900
|
+
[$r]: !0,
|
|
1901
1901
|
_type: void 0,
|
|
1902
1902
|
// should never be used directly
|
|
1903
1903
|
[jt]: !0,
|
|
@@ -1907,39 +1907,39 @@ function Yr(e, {
|
|
|
1907
1907
|
validate: t
|
|
1908
1908
|
};
|
|
1909
1909
|
}
|
|
1910
|
-
function
|
|
1911
|
-
return typeof e == "object" && e !== null &&
|
|
1910
|
+
function su(e) {
|
|
1911
|
+
return typeof e == "object" && e !== null && $r in e && e[$r] === !0 && "jsonSchema" in e && "validate" in e;
|
|
1912
1912
|
}
|
|
1913
|
-
function
|
|
1913
|
+
function Qt(e) {
|
|
1914
1914
|
return e == null ? Yr({
|
|
1915
1915
|
properties: {},
|
|
1916
1916
|
additionalProperties: !1
|
|
1917
|
-
}) :
|
|
1917
|
+
}) : su(e) ? e : typeof e == "function" ? e() : Be(e);
|
|
1918
1918
|
}
|
|
1919
|
-
var { btoa:
|
|
1919
|
+
var { btoa: iu, atob: lu } = globalThis;
|
|
1920
1920
|
function Xr(e) {
|
|
1921
|
-
const t = e.replace(/-/g, "+").replace(/_/g, "/"), r =
|
|
1921
|
+
const t = e.replace(/-/g, "+").replace(/_/g, "/"), r = lu(t);
|
|
1922
1922
|
return Uint8Array.from(r, (a) => a.codePointAt(0));
|
|
1923
1923
|
}
|
|
1924
|
-
function
|
|
1924
|
+
function Ur(e) {
|
|
1925
1925
|
let t = "";
|
|
1926
1926
|
for (let r = 0; r < e.length; r++)
|
|
1927
1927
|
t += String.fromCodePoint(e[r]);
|
|
1928
|
-
return
|
|
1928
|
+
return iu(t);
|
|
1929
1929
|
}
|
|
1930
|
-
function
|
|
1930
|
+
function uu(e) {
|
|
1931
1931
|
return e?.replace(/\/$/, "");
|
|
1932
1932
|
}
|
|
1933
|
-
function
|
|
1933
|
+
function cu(e) {
|
|
1934
1934
|
return e != null && typeof e[Symbol.asyncIterator] == "function";
|
|
1935
1935
|
}
|
|
1936
|
-
async function*
|
|
1936
|
+
async function* du({
|
|
1937
1937
|
execute: e,
|
|
1938
1938
|
input: t,
|
|
1939
1939
|
options: r
|
|
1940
1940
|
}) {
|
|
1941
1941
|
const a = e(t, r);
|
|
1942
|
-
if (
|
|
1942
|
+
if (cu(a)) {
|
|
1943
1943
|
let o;
|
|
1944
1944
|
for await (const n of a)
|
|
1945
1945
|
o = n, yield { type: "preliminary", output: n };
|
|
@@ -1947,9 +1947,9 @@ async function* cu({
|
|
|
1947
1947
|
} else
|
|
1948
1948
|
yield { type: "final", output: await a };
|
|
1949
1949
|
}
|
|
1950
|
-
var
|
|
1951
|
-
function
|
|
1952
|
-
if (Ca) return
|
|
1950
|
+
var _r, Ca;
|
|
1951
|
+
function pu() {
|
|
1952
|
+
if (Ca) return _r;
|
|
1953
1953
|
Ca = 1;
|
|
1954
1954
|
var e = Object.defineProperty, t = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (d, p) => {
|
|
1955
1955
|
for (var m in p)
|
|
@@ -1963,16 +1963,16 @@ function du() {
|
|
|
1963
1963
|
o(s, {
|
|
1964
1964
|
SYMBOL_FOR_REQ_CONTEXT: () => u,
|
|
1965
1965
|
getContext: () => l
|
|
1966
|
-
}),
|
|
1966
|
+
}), _r = i(s);
|
|
1967
1967
|
const u = Symbol.for("@vercel/request-context");
|
|
1968
1968
|
function l() {
|
|
1969
1969
|
return globalThis[u]?.get?.() ?? {};
|
|
1970
1970
|
}
|
|
1971
|
-
return
|
|
1971
|
+
return _r;
|
|
1972
1972
|
}
|
|
1973
|
-
var
|
|
1974
|
-
function
|
|
1975
|
-
if (Aa) return
|
|
1973
|
+
var wr, Aa;
|
|
1974
|
+
function fu() {
|
|
1975
|
+
if (Aa) return wr;
|
|
1976
1976
|
Aa = 1;
|
|
1977
1977
|
var e = Object.defineProperty, t = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (p, m) => {
|
|
1978
1978
|
for (var f in m)
|
|
@@ -1987,17 +1987,17 @@ function pu() {
|
|
|
1987
1987
|
getContext: () => u.getContext,
|
|
1988
1988
|
getVercelOidcToken: () => l,
|
|
1989
1989
|
getVercelOidcTokenSync: () => d
|
|
1990
|
-
}),
|
|
1991
|
-
var u =
|
|
1990
|
+
}), wr = i(s);
|
|
1991
|
+
var u = pu();
|
|
1992
1992
|
async function l() {
|
|
1993
1993
|
return "";
|
|
1994
1994
|
}
|
|
1995
1995
|
function d() {
|
|
1996
1996
|
return "";
|
|
1997
1997
|
}
|
|
1998
|
-
return
|
|
1998
|
+
return wr;
|
|
1999
1999
|
}
|
|
2000
|
-
var qn =
|
|
2000
|
+
var qn = fu(), hu = "vercel.ai.gateway.error", br = Symbol.for(hu), ka, Oa, ce = class Ln extends (Oa = Error, ka = br, Oa) {
|
|
2001
2001
|
constructor({
|
|
2002
2002
|
message: t,
|
|
2003
2003
|
statusCode: r = 500,
|
|
@@ -2014,9 +2014,9 @@ var qn = pu(), fu = "vercel.ai.gateway.error", wr = Symbol.for(fu), ka, Oa, ce =
|
|
|
2014
2014
|
return Ln.hasMarker(t);
|
|
2015
2015
|
}
|
|
2016
2016
|
static hasMarker(t) {
|
|
2017
|
-
return typeof t == "object" && t !== null &&
|
|
2017
|
+
return typeof t == "object" && t !== null && br in t && t[br] === !0;
|
|
2018
2018
|
}
|
|
2019
|
-
}, Vn = "GatewayAuthenticationError",
|
|
2019
|
+
}, Vn = "GatewayAuthenticationError", mu = `vercel.ai.gateway.error.${Vn}`, Pa = Symbol.for(mu), Ma, Na, Qr = class Fn extends (Na = ce, Ma = Pa, Na) {
|
|
2020
2020
|
constructor({
|
|
2021
2021
|
message: t = "Authentication failed",
|
|
2022
2022
|
statusCode: r = 401,
|
|
@@ -2059,7 +2059,7 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
2059
2059
|
cause: n
|
|
2060
2060
|
});
|
|
2061
2061
|
}
|
|
2062
|
-
}, Bn = "GatewayInvalidRequestError",
|
|
2062
|
+
}, Bn = "GatewayInvalidRequestError", gu = `vercel.ai.gateway.error.${Bn}`, $a = Symbol.for(gu), Ua, Da, vu = class extends (Da = ce, Ua = $a, Da) {
|
|
2063
2063
|
constructor({
|
|
2064
2064
|
message: e = "Invalid request",
|
|
2065
2065
|
statusCode: t = 400,
|
|
@@ -2070,7 +2070,7 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
2070
2070
|
static isInstance(e) {
|
|
2071
2071
|
return ce.hasMarker(e) && $a in e;
|
|
2072
2072
|
}
|
|
2073
|
-
}, Hn = "GatewayRateLimitError",
|
|
2073
|
+
}, Hn = "GatewayRateLimitError", yu = `vercel.ai.gateway.error.${Hn}`, ja = Symbol.for(yu), qa, La, _u = class extends (La = ce, qa = ja, La) {
|
|
2074
2074
|
constructor({
|
|
2075
2075
|
message: e = "Rate limit exceeded",
|
|
2076
2076
|
statusCode: t = 429,
|
|
@@ -2081,7 +2081,7 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
2081
2081
|
static isInstance(e) {
|
|
2082
2082
|
return ce.hasMarker(e) && ja in e;
|
|
2083
2083
|
}
|
|
2084
|
-
}, Gn = "GatewayModelNotFoundError",
|
|
2084
|
+
}, Gn = "GatewayModelNotFoundError", wu = `vercel.ai.gateway.error.${Gn}`, Va = Symbol.for(wu), bu = Xe(
|
|
2085
2085
|
() => Be(
|
|
2086
2086
|
v({
|
|
2087
2087
|
modelId: c()
|
|
@@ -2099,7 +2099,7 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
2099
2099
|
static isInstance(e) {
|
|
2100
2100
|
return ce.hasMarker(e) && Va in e;
|
|
2101
2101
|
}
|
|
2102
|
-
}, Zn = "GatewayInternalServerError",
|
|
2102
|
+
}, Zn = "GatewayInternalServerError", Tu = `vercel.ai.gateway.error.${Zn}`, Ha = Symbol.for(Tu), Ga, Ja, Za = class extends (Ja = ce, Ga = Ha, Ja) {
|
|
2103
2103
|
constructor({
|
|
2104
2104
|
message: e = "Internal server error",
|
|
2105
2105
|
statusCode: t = 500,
|
|
@@ -2110,7 +2110,7 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
2110
2110
|
static isInstance(e) {
|
|
2111
2111
|
return ce.hasMarker(e) && Ha in e;
|
|
2112
2112
|
}
|
|
2113
|
-
}, zn = "GatewayResponseError",
|
|
2113
|
+
}, zn = "GatewayResponseError", Iu = `vercel.ai.gateway.error.${zn}`, za = Symbol.for(Iu), Wa, Ka, Su = class extends (Ka = ce, Wa = za, Ka) {
|
|
2114
2114
|
constructor({
|
|
2115
2115
|
message: e = "Invalid response from Gateway",
|
|
2116
2116
|
statusCode: t = 502,
|
|
@@ -2133,10 +2133,10 @@ async function Ya({
|
|
|
2133
2133
|
}) {
|
|
2134
2134
|
const n = await je({
|
|
2135
2135
|
value: e,
|
|
2136
|
-
schema:
|
|
2136
|
+
schema: Eu
|
|
2137
2137
|
});
|
|
2138
2138
|
if (!n.success)
|
|
2139
|
-
return new
|
|
2139
|
+
return new Su({
|
|
2140
2140
|
message: `Invalid error response format: ${r}`,
|
|
2141
2141
|
statusCode: t,
|
|
2142
2142
|
response: e,
|
|
@@ -2153,13 +2153,13 @@ async function Ya({
|
|
|
2153
2153
|
cause: a
|
|
2154
2154
|
});
|
|
2155
2155
|
case "invalid_request_error":
|
|
2156
|
-
return new
|
|
2156
|
+
return new vu({ message: u, statusCode: t, cause: a });
|
|
2157
2157
|
case "rate_limit_exceeded":
|
|
2158
|
-
return new
|
|
2158
|
+
return new _u({ message: u, statusCode: t, cause: a });
|
|
2159
2159
|
case "model_not_found": {
|
|
2160
2160
|
const l = await je({
|
|
2161
2161
|
value: i.error.param,
|
|
2162
|
-
schema:
|
|
2162
|
+
schema: bu
|
|
2163
2163
|
});
|
|
2164
2164
|
return new Jn({
|
|
2165
2165
|
message: u,
|
|
@@ -2174,7 +2174,7 @@ async function Ya({
|
|
|
2174
2174
|
return new Za({ message: u, statusCode: t, cause: a });
|
|
2175
2175
|
}
|
|
2176
2176
|
}
|
|
2177
|
-
var
|
|
2177
|
+
var Eu = Xe(
|
|
2178
2178
|
() => Be(
|
|
2179
2179
|
v({
|
|
2180
2180
|
error: v({
|
|
@@ -2189,7 +2189,7 @@ var Su = Xe(
|
|
|
2189
2189
|
function Fe(e, t) {
|
|
2190
2190
|
var r;
|
|
2191
2191
|
return ce.isInstance(e) ? e : se.isInstance(e) ? Ya({
|
|
2192
|
-
response:
|
|
2192
|
+
response: xu(e),
|
|
2193
2193
|
statusCode: (r = e.statusCode) != null ? r : 500,
|
|
2194
2194
|
defaultMessage: "Gateway request failed",
|
|
2195
2195
|
cause: e,
|
|
@@ -2202,7 +2202,7 @@ function Fe(e, t) {
|
|
|
2202
2202
|
authMethod: t
|
|
2203
2203
|
});
|
|
2204
2204
|
}
|
|
2205
|
-
function
|
|
2205
|
+
function xu(e) {
|
|
2206
2206
|
if (e.data !== void 0)
|
|
2207
2207
|
return e.data;
|
|
2208
2208
|
if (e.responseBody != null)
|
|
@@ -2217,11 +2217,11 @@ var Wn = "ai-gateway-auth-method";
|
|
|
2217
2217
|
async function gt(e) {
|
|
2218
2218
|
const t = await je({
|
|
2219
2219
|
value: e[Wn],
|
|
2220
|
-
schema:
|
|
2220
|
+
schema: Ru
|
|
2221
2221
|
});
|
|
2222
2222
|
return t.success ? t.value : void 0;
|
|
2223
2223
|
}
|
|
2224
|
-
var
|
|
2224
|
+
var Ru = Xe(
|
|
2225
2225
|
() => Be(D([C("api-key"), C("oidc")]))
|
|
2226
2226
|
), Xa = class {
|
|
2227
2227
|
constructor(e) {
|
|
@@ -2233,7 +2233,7 @@ var xu = Xe(
|
|
|
2233
2233
|
url: `${this.config.baseURL}/config`,
|
|
2234
2234
|
headers: await Ue(this.config.headers()),
|
|
2235
2235
|
successfulResponseHandler: qt(
|
|
2236
|
-
|
|
2236
|
+
Cu
|
|
2237
2237
|
),
|
|
2238
2238
|
failedResponseHandler: mt({
|
|
2239
2239
|
errorSchema: Oe(),
|
|
@@ -2252,7 +2252,7 @@ var xu = Xe(
|
|
|
2252
2252
|
url: `${e.origin}/v1/credits`,
|
|
2253
2253
|
headers: await Ue(this.config.headers()),
|
|
2254
2254
|
successfulResponseHandler: qt(
|
|
2255
|
-
|
|
2255
|
+
Au
|
|
2256
2256
|
),
|
|
2257
2257
|
failedResponseHandler: mt({
|
|
2258
2258
|
errorSchema: Oe(),
|
|
@@ -2265,7 +2265,7 @@ var xu = Xe(
|
|
|
2265
2265
|
throw await Fe(e);
|
|
2266
2266
|
}
|
|
2267
2267
|
}
|
|
2268
|
-
},
|
|
2268
|
+
}, Cu = Xe(
|
|
2269
2269
|
() => Be(
|
|
2270
2270
|
v({
|
|
2271
2271
|
models: I(
|
|
@@ -2291,12 +2291,12 @@ var xu = Xe(
|
|
|
2291
2291
|
provider: c(),
|
|
2292
2292
|
modelId: c()
|
|
2293
2293
|
}),
|
|
2294
|
-
modelType:
|
|
2294
|
+
modelType: Kt(["language", "embedding", "image"]).nullish()
|
|
2295
2295
|
})
|
|
2296
2296
|
)
|
|
2297
2297
|
})
|
|
2298
2298
|
)
|
|
2299
|
-
),
|
|
2299
|
+
), Au = Xe(
|
|
2300
2300
|
() => Be(
|
|
2301
2301
|
v({
|
|
2302
2302
|
balance: c(),
|
|
@@ -2306,7 +2306,7 @@ var xu = Xe(
|
|
|
2306
2306
|
totalUsed: t
|
|
2307
2307
|
}))
|
|
2308
2308
|
)
|
|
2309
|
-
),
|
|
2309
|
+
), ku = class {
|
|
2310
2310
|
constructor(e, t) {
|
|
2311
2311
|
this.modelId = e, this.config = t, this.specificationVersion = "v2", this.supportedUrls = { "*/*": [/.*/] };
|
|
2312
2312
|
}
|
|
@@ -2327,9 +2327,9 @@ var xu = Xe(
|
|
|
2327
2327
|
responseHeaders: n,
|
|
2328
2328
|
value: i,
|
|
2329
2329
|
rawValue: s
|
|
2330
|
-
} = await
|
|
2330
|
+
} = await Mr({
|
|
2331
2331
|
url: this.getUrl(),
|
|
2332
|
-
headers:
|
|
2332
|
+
headers: Or(
|
|
2333
2333
|
o,
|
|
2334
2334
|
e.headers,
|
|
2335
2335
|
this.getModelConfigHeaders(this.modelId, !1),
|
|
@@ -2357,16 +2357,16 @@ var xu = Xe(
|
|
|
2357
2357
|
async doStream(e) {
|
|
2358
2358
|
const { args: t, warnings: r } = await this.getArgs(e), { abortSignal: a } = e, o = await Ue(this.config.headers());
|
|
2359
2359
|
try {
|
|
2360
|
-
const { value: n, responseHeaders: i } = await
|
|
2360
|
+
const { value: n, responseHeaders: i } = await Mr({
|
|
2361
2361
|
url: this.getUrl(),
|
|
2362
|
-
headers:
|
|
2362
|
+
headers: Or(
|
|
2363
2363
|
o,
|
|
2364
2364
|
e.headers,
|
|
2365
2365
|
this.getModelConfigHeaders(this.modelId, !0),
|
|
2366
2366
|
await Ue(this.config.o11yHeaders)
|
|
2367
2367
|
),
|
|
2368
2368
|
body: t,
|
|
2369
|
-
successfulResponseHandler:
|
|
2369
|
+
successfulResponseHandler: ml(Oe()),
|
|
2370
2370
|
failedResponseHandler: mt({
|
|
2371
2371
|
errorSchema: Oe(),
|
|
2372
2372
|
errorToMessage: (s) => s
|
|
@@ -2433,7 +2433,7 @@ var xu = Xe(
|
|
|
2433
2433
|
"ai-language-model-streaming": String(t)
|
|
2434
2434
|
};
|
|
2435
2435
|
}
|
|
2436
|
-
},
|
|
2436
|
+
}, Ou = class {
|
|
2437
2437
|
constructor(e, t) {
|
|
2438
2438
|
this.modelId = e, this.config = t, this.specificationVersion = "v2", this.maxEmbeddingsPerCall = 2048, this.supportsParallelCalls = !0;
|
|
2439
2439
|
}
|
|
@@ -2453,9 +2453,9 @@ var xu = Xe(
|
|
|
2453
2453
|
responseHeaders: i,
|
|
2454
2454
|
value: s,
|
|
2455
2455
|
rawValue: u
|
|
2456
|
-
} = await
|
|
2456
|
+
} = await Mr({
|
|
2457
2457
|
url: this.getUrl(),
|
|
2458
|
-
headers:
|
|
2458
|
+
headers: Or(
|
|
2459
2459
|
n,
|
|
2460
2460
|
t ?? {},
|
|
2461
2461
|
this.getModelConfigHeaders(),
|
|
@@ -2466,7 +2466,7 @@ var xu = Xe(
|
|
|
2466
2466
|
...a ? { providerOptions: a } : {}
|
|
2467
2467
|
},
|
|
2468
2468
|
successfulResponseHandler: qt(
|
|
2469
|
-
|
|
2469
|
+
Pu
|
|
2470
2470
|
),
|
|
2471
2471
|
failedResponseHandler: mt({
|
|
2472
2472
|
errorSchema: Oe(),
|
|
@@ -2494,7 +2494,7 @@ var xu = Xe(
|
|
|
2494
2494
|
"ai-model-id": this.modelId
|
|
2495
2495
|
};
|
|
2496
2496
|
}
|
|
2497
|
-
},
|
|
2497
|
+
}, Pu = Xe(
|
|
2498
2498
|
() => Be(
|
|
2499
2499
|
v({
|
|
2500
2500
|
embeddings: I(I(R())),
|
|
@@ -2503,27 +2503,27 @@ var xu = Xe(
|
|
|
2503
2503
|
})
|
|
2504
2504
|
)
|
|
2505
2505
|
);
|
|
2506
|
-
async function
|
|
2506
|
+
async function Mu() {
|
|
2507
2507
|
var e;
|
|
2508
2508
|
return (e = qn.getContext().headers) == null ? void 0 : e["x-vercel-id"];
|
|
2509
2509
|
}
|
|
2510
|
-
var
|
|
2511
|
-
function
|
|
2510
|
+
var Nu = "2.0.7", $u = "0.0.1";
|
|
2511
|
+
function Uu(e = {}) {
|
|
2512
2512
|
var t, r;
|
|
2513
2513
|
let a = null, o = null;
|
|
2514
2514
|
const n = (t = e.metadataCacheRefreshMillis) != null ? t : 1e3 * 60 * 5;
|
|
2515
2515
|
let i = 0;
|
|
2516
|
-
const s = (r =
|
|
2517
|
-
const h = await
|
|
2516
|
+
const s = (r = uu(e.baseURL)) != null ? r : "https://ai-gateway.vercel.sh/v1/ai", u = async () => {
|
|
2517
|
+
const h = await ju(e);
|
|
2518
2518
|
if (h)
|
|
2519
|
-
return
|
|
2519
|
+
return Xt(
|
|
2520
2520
|
{
|
|
2521
2521
|
Authorization: `Bearer ${h.token}`,
|
|
2522
|
-
"ai-gateway-protocol-version":
|
|
2522
|
+
"ai-gateway-protocol-version": $u,
|
|
2523
2523
|
[Wn]: h.authMethod,
|
|
2524
2524
|
...e.headers
|
|
2525
2525
|
},
|
|
2526
|
-
`ai-sdk/gateway/${
|
|
2526
|
+
`ai-sdk/gateway/${Nu}`
|
|
2527
2527
|
);
|
|
2528
2528
|
throw Qr.createContextualError({
|
|
2529
2529
|
apiKeyProvided: !1,
|
|
@@ -2542,7 +2542,7 @@ function $u(e = {}) {
|
|
|
2542
2542
|
environmentVariableName: "VERCEL_REGION"
|
|
2543
2543
|
});
|
|
2544
2544
|
return async () => {
|
|
2545
|
-
const _ = await
|
|
2545
|
+
const _ = await Mu();
|
|
2546
2546
|
return {
|
|
2547
2547
|
...h && { "ai-o11y-deployment-id": h },
|
|
2548
2548
|
...y && { "ai-o11y-environment": y },
|
|
@@ -2550,7 +2550,7 @@ function $u(e = {}) {
|
|
|
2550
2550
|
..._ && { "ai-o11y-request-id": _ }
|
|
2551
2551
|
};
|
|
2552
2552
|
};
|
|
2553
|
-
}, d = (h) => new
|
|
2553
|
+
}, d = (h) => new ku(h, {
|
|
2554
2554
|
provider: "gateway",
|
|
2555
2555
|
baseURL: s,
|
|
2556
2556
|
headers: u,
|
|
@@ -2587,7 +2587,7 @@ function $u(e = {}) {
|
|
|
2587
2587
|
};
|
|
2588
2588
|
return f.getAvailableModels = p, f.getCredits = m, f.imageModel = (h) => {
|
|
2589
2589
|
throw new ni({ modelId: h, modelType: "imageModel" });
|
|
2590
|
-
}, f.languageModel = d, f.textEmbeddingModel = (h) => new
|
|
2590
|
+
}, f.languageModel = d, f.textEmbeddingModel = (h) => new Ou(h, {
|
|
2591
2591
|
provider: "gateway",
|
|
2592
2592
|
baseURL: s,
|
|
2593
2593
|
headers: u,
|
|
@@ -2595,8 +2595,8 @@ function $u(e = {}) {
|
|
|
2595
2595
|
o11yHeaders: l()
|
|
2596
2596
|
}), f;
|
|
2597
2597
|
}
|
|
2598
|
-
var
|
|
2599
|
-
async function
|
|
2598
|
+
var Du = Uu();
|
|
2599
|
+
async function ju(e) {
|
|
2600
2600
|
const t = Ot({
|
|
2601
2601
|
settingValue: e.apiKey,
|
|
2602
2602
|
environmentVariableName: "AI_GATEWAY_API_KEY"
|
|
@@ -2615,10 +2615,10 @@ async function Du(e) {
|
|
|
2615
2615
|
return null;
|
|
2616
2616
|
}
|
|
2617
2617
|
}
|
|
2618
|
-
var
|
|
2618
|
+
var qu = Object.defineProperty, Lu = (e, t) => {
|
|
2619
2619
|
for (var r in t)
|
|
2620
|
-
|
|
2621
|
-
}, Kn = "AI_NoOutputSpecifiedError", Yn = `vercel.ai.error.${Kn}`,
|
|
2620
|
+
qu(e, r, { get: t[r], enumerable: !0 });
|
|
2621
|
+
}, Kn = "AI_NoOutputSpecifiedError", Yn = `vercel.ai.error.${Kn}`, Vu = Symbol.for(Yn), Xn, Fu = class extends J {
|
|
2622
2622
|
// used in isInstance
|
|
2623
2623
|
constructor({ message: e = "No output specified." } = {}) {
|
|
2624
2624
|
super({ name: Kn, message: e }), this[Xn] = !0;
|
|
@@ -2627,8 +2627,8 @@ var ju = Object.defineProperty, qu = (e, t) => {
|
|
|
2627
2627
|
return J.hasMarker(e, Yn);
|
|
2628
2628
|
}
|
|
2629
2629
|
};
|
|
2630
|
-
Xn =
|
|
2631
|
-
function
|
|
2630
|
+
Xn = Vu;
|
|
2631
|
+
function Bu(e) {
|
|
2632
2632
|
const t = "AI SDK Warning:";
|
|
2633
2633
|
switch (e.type) {
|
|
2634
2634
|
case "unsupported-setting": {
|
|
@@ -2646,7 +2646,7 @@ function Fu(e) {
|
|
|
2646
2646
|
return `${t} ${JSON.stringify(e, null, 2)}`;
|
|
2647
2647
|
}
|
|
2648
2648
|
}
|
|
2649
|
-
var
|
|
2649
|
+
var Hu = "AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.", Qa = !1, Gu = (e) => {
|
|
2650
2650
|
if (e.length === 0)
|
|
2651
2651
|
return;
|
|
2652
2652
|
const t = globalThis.AI_SDK_LOG_WARNINGS;
|
|
@@ -2655,11 +2655,11 @@ var Bu = "AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG
|
|
|
2655
2655
|
t(e);
|
|
2656
2656
|
return;
|
|
2657
2657
|
}
|
|
2658
|
-
Qa || (Qa = !0, console.info(
|
|
2658
|
+
Qa || (Qa = !0, console.info(Hu));
|
|
2659
2659
|
for (const r of e)
|
|
2660
|
-
console.warn(
|
|
2660
|
+
console.warn(Bu(r));
|
|
2661
2661
|
}
|
|
2662
|
-
}, Qn = "AI_InvalidArgumentError", eo = `vercel.ai.error.${Qn}`,
|
|
2662
|
+
}, Qn = "AI_InvalidArgumentError", eo = `vercel.ai.error.${Qn}`, Ju = Symbol.for(eo), to, xe = class extends J {
|
|
2663
2663
|
constructor({
|
|
2664
2664
|
parameter: t,
|
|
2665
2665
|
value: r,
|
|
@@ -2674,13 +2674,13 @@ var Bu = "AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG
|
|
|
2674
2674
|
return J.hasMarker(t, eo);
|
|
2675
2675
|
}
|
|
2676
2676
|
};
|
|
2677
|
-
to =
|
|
2678
|
-
var ro = "AI_InvalidToolInputError", ao = `vercel.ai.error.${ro}`,
|
|
2677
|
+
to = Ju;
|
|
2678
|
+
var ro = "AI_InvalidToolInputError", ao = `vercel.ai.error.${ro}`, Zu = Symbol.for(ao), no, oo = class extends J {
|
|
2679
2679
|
constructor({
|
|
2680
2680
|
toolInput: e,
|
|
2681
2681
|
toolName: t,
|
|
2682
2682
|
cause: r,
|
|
2683
|
-
message: a = `Invalid input for tool ${t}: ${
|
|
2683
|
+
message: a = `Invalid input for tool ${t}: ${Yt(r)}`
|
|
2684
2684
|
}) {
|
|
2685
2685
|
super({ name: ro, message: a, cause: r }), this[no] = !0, this.toolInput = e, this.toolName = t;
|
|
2686
2686
|
}
|
|
@@ -2688,8 +2688,8 @@ var ro = "AI_InvalidToolInputError", ao = `vercel.ai.error.${ro}`, Ju = Symbol.f
|
|
|
2688
2688
|
return J.hasMarker(e, ao);
|
|
2689
2689
|
}
|
|
2690
2690
|
};
|
|
2691
|
-
no =
|
|
2692
|
-
var so = "AI_NoObjectGeneratedError", io = `vercel.ai.error.${so}`,
|
|
2691
|
+
no = Zu;
|
|
2692
|
+
var so = "AI_NoObjectGeneratedError", io = `vercel.ai.error.${so}`, zu = Symbol.for(io), lo, en = class extends J {
|
|
2693
2693
|
constructor({
|
|
2694
2694
|
message: e = "No object generated.",
|
|
2695
2695
|
cause: t,
|
|
@@ -2704,8 +2704,8 @@ var so = "AI_NoObjectGeneratedError", io = `vercel.ai.error.${so}`, Zu = Symbol.
|
|
|
2704
2704
|
return J.hasMarker(e, io);
|
|
2705
2705
|
}
|
|
2706
2706
|
};
|
|
2707
|
-
lo =
|
|
2708
|
-
var uo = "AI_NoOutputGeneratedError", co = `vercel.ai.error.${uo}`,
|
|
2707
|
+
lo = zu;
|
|
2708
|
+
var uo = "AI_NoOutputGeneratedError", co = `vercel.ai.error.${uo}`, Wu = Symbol.for(co), po, Ku = class extends J {
|
|
2709
2709
|
// used in isInstance
|
|
2710
2710
|
constructor({
|
|
2711
2711
|
message: e = "No output generated.",
|
|
@@ -2717,8 +2717,8 @@ var uo = "AI_NoOutputGeneratedError", co = `vercel.ai.error.${uo}`, zu = Symbol.
|
|
|
2717
2717
|
return J.hasMarker(e, co);
|
|
2718
2718
|
}
|
|
2719
2719
|
};
|
|
2720
|
-
po =
|
|
2721
|
-
var fo = "AI_NoSuchToolError", ho = `vercel.ai.error.${fo}`,
|
|
2720
|
+
po = Wu;
|
|
2721
|
+
var fo = "AI_NoSuchToolError", ho = `vercel.ai.error.${fo}`, Yu = Symbol.for(ho), mo, Dr = class extends J {
|
|
2722
2722
|
constructor({
|
|
2723
2723
|
toolName: e,
|
|
2724
2724
|
availableTools: t = void 0,
|
|
@@ -2730,12 +2730,12 @@ var fo = "AI_NoSuchToolError", ho = `vercel.ai.error.${fo}`, Ku = Symbol.for(ho)
|
|
|
2730
2730
|
return J.hasMarker(e, ho);
|
|
2731
2731
|
}
|
|
2732
2732
|
};
|
|
2733
|
-
mo =
|
|
2734
|
-
var go = "AI_ToolCallRepairError", vo = `vercel.ai.error.${go}`,
|
|
2733
|
+
mo = Yu;
|
|
2734
|
+
var go = "AI_ToolCallRepairError", vo = `vercel.ai.error.${go}`, Xu = Symbol.for(vo), yo, Qu = class extends J {
|
|
2735
2735
|
constructor({
|
|
2736
2736
|
cause: e,
|
|
2737
2737
|
originalError: t,
|
|
2738
|
-
message: r = `Error repairing tool call: ${
|
|
2738
|
+
message: r = `Error repairing tool call: ${Yt(e)}`
|
|
2739
2739
|
}) {
|
|
2740
2740
|
super({ name: go, message: r, cause: e }), this[yo] = !0, this.originalError = t;
|
|
2741
2741
|
}
|
|
@@ -2743,15 +2743,15 @@ var go = "AI_ToolCallRepairError", vo = `vercel.ai.error.${go}`, Yu = Symbol.for
|
|
|
2743
2743
|
return J.hasMarker(e, vo);
|
|
2744
2744
|
}
|
|
2745
2745
|
};
|
|
2746
|
-
yo =
|
|
2747
|
-
var
|
|
2746
|
+
yo = Xu;
|
|
2747
|
+
var ec = class extends J {
|
|
2748
2748
|
constructor(e) {
|
|
2749
2749
|
super({
|
|
2750
2750
|
name: "AI_UnsupportedModelVersionError",
|
|
2751
2751
|
message: `Unsupported model version ${e.version} for provider "${e.provider}" and model "${e.modelId}". AI SDK 5 only supports models that implement specification version "v2".`
|
|
2752
2752
|
}), this.version = e.version, this.provider = e.provider, this.modelId = e.modelId;
|
|
2753
2753
|
}
|
|
2754
|
-
}, _o = "AI_InvalidMessageRoleError", wo = `vercel.ai.error.${_o}`,
|
|
2754
|
+
}, _o = "AI_InvalidMessageRoleError", wo = `vercel.ai.error.${_o}`, tc = Symbol.for(wo), bo, rc = class extends J {
|
|
2755
2755
|
constructor({
|
|
2756
2756
|
role: e,
|
|
2757
2757
|
message: t = `Invalid message role: '${e}'. Must be one of: "system", "user", "assistant", "tool".`
|
|
@@ -2762,8 +2762,8 @@ var Qu = class extends J {
|
|
|
2762
2762
|
return J.hasMarker(e, wo);
|
|
2763
2763
|
}
|
|
2764
2764
|
};
|
|
2765
|
-
bo =
|
|
2766
|
-
var To = "AI_MessageConversionError", Io = `vercel.ai.error.${To}`,
|
|
2765
|
+
bo = tc;
|
|
2766
|
+
var To = "AI_MessageConversionError", Io = `vercel.ai.error.${To}`, ac = Symbol.for(Io), So, nc = class extends J {
|
|
2767
2767
|
constructor({
|
|
2768
2768
|
originalMessage: e,
|
|
2769
2769
|
message: t
|
|
@@ -2774,8 +2774,8 @@ var To = "AI_MessageConversionError", Io = `vercel.ai.error.${To}`, rc = Symbol.
|
|
|
2774
2774
|
return J.hasMarker(e, Io);
|
|
2775
2775
|
}
|
|
2776
2776
|
};
|
|
2777
|
-
So =
|
|
2778
|
-
var Eo = "AI_DownloadError", xo = `vercel.ai.error.${Eo}`,
|
|
2777
|
+
So = ac;
|
|
2778
|
+
var Eo = "AI_DownloadError", xo = `vercel.ai.error.${Eo}`, oc = Symbol.for(xo), Ro, Tr = class extends J {
|
|
2779
2779
|
constructor({
|
|
2780
2780
|
url: e,
|
|
2781
2781
|
statusCode: t,
|
|
@@ -2789,8 +2789,8 @@ var Eo = "AI_DownloadError", xo = `vercel.ai.error.${Eo}`, nc = Symbol.for(xo),
|
|
|
2789
2789
|
return J.hasMarker(e, xo);
|
|
2790
2790
|
}
|
|
2791
2791
|
};
|
|
2792
|
-
Ro =
|
|
2793
|
-
var Co = "AI_RetryError", Ao = `vercel.ai.error.${Co}`,
|
|
2792
|
+
Ro = oc;
|
|
2793
|
+
var Co = "AI_RetryError", Ao = `vercel.ai.error.${Co}`, sc = Symbol.for(Ao), ko, tn = class extends J {
|
|
2794
2794
|
constructor({
|
|
2795
2795
|
message: e,
|
|
2796
2796
|
reason: t,
|
|
@@ -2802,24 +2802,24 @@ var Co = "AI_RetryError", Ao = `vercel.ai.error.${Co}`, oc = Symbol.for(Ao), ko,
|
|
|
2802
2802
|
return J.hasMarker(e, Ao);
|
|
2803
2803
|
}
|
|
2804
2804
|
};
|
|
2805
|
-
ko =
|
|
2805
|
+
ko = sc;
|
|
2806
2806
|
function Oo(e) {
|
|
2807
2807
|
if (typeof e != "string") {
|
|
2808
2808
|
if (e.specificationVersion !== "v2")
|
|
2809
|
-
throw new
|
|
2809
|
+
throw new ec({
|
|
2810
2810
|
version: e.specificationVersion,
|
|
2811
2811
|
provider: e.provider,
|
|
2812
2812
|
modelId: e.modelId
|
|
2813
2813
|
});
|
|
2814
2814
|
return e;
|
|
2815
2815
|
}
|
|
2816
|
-
return
|
|
2816
|
+
return ic().languageModel(e);
|
|
2817
2817
|
}
|
|
2818
|
-
function
|
|
2818
|
+
function ic() {
|
|
2819
2819
|
var e;
|
|
2820
|
-
return (e = globalThis.AI_SDK_DEFAULT_PROVIDER) != null ? e :
|
|
2820
|
+
return (e = globalThis.AI_SDK_DEFAULT_PROVIDER) != null ? e : Du;
|
|
2821
2821
|
}
|
|
2822
|
-
var
|
|
2822
|
+
var lc = [
|
|
2823
2823
|
{
|
|
2824
2824
|
mediaType: "image/gif",
|
|
2825
2825
|
bytesPrefix: [71, 73, 70]
|
|
@@ -2901,20 +2901,20 @@ var ic = [
|
|
|
2901
2901
|
99
|
|
2902
2902
|
]
|
|
2903
2903
|
}
|
|
2904
|
-
],
|
|
2904
|
+
], uc = (e) => {
|
|
2905
2905
|
const t = typeof e == "string" ? Xr(e) : e, r = (t[6] & 127) << 21 | (t[7] & 127) << 14 | (t[8] & 127) << 7 | t[9] & 127;
|
|
2906
2906
|
return t.slice(r + 10);
|
|
2907
2907
|
};
|
|
2908
|
-
function
|
|
2908
|
+
function cc(e) {
|
|
2909
2909
|
return typeof e == "string" && e.startsWith("SUQz") || typeof e != "string" && e.length > 10 && e[0] === 73 && // 'I'
|
|
2910
2910
|
e[1] === 68 && // 'D'
|
|
2911
|
-
e[2] === 51 ?
|
|
2911
|
+
e[2] === 51 ? uc(e) : e;
|
|
2912
2912
|
}
|
|
2913
|
-
function
|
|
2913
|
+
function dc({
|
|
2914
2914
|
data: e,
|
|
2915
2915
|
signatures: t
|
|
2916
2916
|
}) {
|
|
2917
|
-
const r =
|
|
2917
|
+
const r = cc(e), a = typeof r == "string" ? Xr(
|
|
2918
2918
|
r.substring(0, Math.min(r.length, 24))
|
|
2919
2919
|
) : r;
|
|
2920
2920
|
for (const o of t)
|
|
@@ -2923,19 +2923,19 @@ function cc({
|
|
|
2923
2923
|
))
|
|
2924
2924
|
return o.mediaType;
|
|
2925
2925
|
}
|
|
2926
|
-
var
|
|
2926
|
+
var pc = "5.0.90", fc = async ({ url: e }) => {
|
|
2927
2927
|
var t;
|
|
2928
2928
|
const r = e.toString();
|
|
2929
2929
|
try {
|
|
2930
2930
|
const a = await fetch(r, {
|
|
2931
|
-
headers:
|
|
2931
|
+
headers: Xt(
|
|
2932
2932
|
{},
|
|
2933
|
-
`ai-sdk/${
|
|
2933
|
+
`ai-sdk/${pc}`,
|
|
2934
2934
|
Kr()
|
|
2935
2935
|
)
|
|
2936
2936
|
});
|
|
2937
2937
|
if (!a.ok)
|
|
2938
|
-
throw new
|
|
2938
|
+
throw new Tr({
|
|
2939
2939
|
url: r,
|
|
2940
2940
|
statusCode: a.status,
|
|
2941
2941
|
statusText: a.statusText
|
|
@@ -2945,14 +2945,14 @@ var dc = "5.0.90", pc = async ({ url: e }) => {
|
|
|
2945
2945
|
mediaType: (t = a.headers.get("content-type")) != null ? t : void 0
|
|
2946
2946
|
};
|
|
2947
2947
|
} catch (a) {
|
|
2948
|
-
throw
|
|
2948
|
+
throw Tr.isInstance(a) ? a : new Tr({ url: r, cause: a });
|
|
2949
2949
|
}
|
|
2950
|
-
},
|
|
2950
|
+
}, hc = (e = fc) => (t) => Promise.all(
|
|
2951
2951
|
t.map(
|
|
2952
2952
|
async (r) => r.isUrlSupportedByModel ? null : e(r)
|
|
2953
2953
|
)
|
|
2954
2954
|
);
|
|
2955
|
-
function
|
|
2955
|
+
function mc(e) {
|
|
2956
2956
|
try {
|
|
2957
2957
|
const [t, r] = e.split(",");
|
|
2958
2958
|
return {
|
|
@@ -2990,7 +2990,7 @@ function Mo(e) {
|
|
|
2990
2990
|
} catch {
|
|
2991
2991
|
}
|
|
2992
2992
|
if (e instanceof URL && e.protocol === "data:") {
|
|
2993
|
-
const { mediaType: t, base64Content: r } =
|
|
2993
|
+
const { mediaType: t, base64Content: r } = mc(
|
|
2994
2994
|
e.toString()
|
|
2995
2995
|
);
|
|
2996
2996
|
if (t == null || r == null)
|
|
@@ -3002,15 +3002,15 @@ function Mo(e) {
|
|
|
3002
3002
|
}
|
|
3003
3003
|
return { data: e, mediaType: void 0 };
|
|
3004
3004
|
}
|
|
3005
|
-
function
|
|
3006
|
-
return typeof e == "string" ? e : e instanceof ArrayBuffer ?
|
|
3005
|
+
function gc(e) {
|
|
3006
|
+
return typeof e == "string" ? e : e instanceof ArrayBuffer ? Ur(new Uint8Array(e)) : Ur(e);
|
|
3007
3007
|
}
|
|
3008
|
-
async function
|
|
3008
|
+
async function vc({
|
|
3009
3009
|
prompt: e,
|
|
3010
3010
|
supportedUrls: t,
|
|
3011
|
-
download: r =
|
|
3011
|
+
download: r = hc()
|
|
3012
3012
|
}) {
|
|
3013
|
-
const a = await
|
|
3013
|
+
const a = await _c(
|
|
3014
3014
|
e.messages,
|
|
3015
3015
|
r,
|
|
3016
3016
|
t
|
|
@@ -3018,11 +3018,11 @@ async function gc({
|
|
|
3018
3018
|
return [
|
|
3019
3019
|
...e.system != null ? [{ role: "system", content: e.system }] : [],
|
|
3020
3020
|
...e.messages.map(
|
|
3021
|
-
(o) =>
|
|
3021
|
+
(o) => yc({ message: o, downloadedAssets: a })
|
|
3022
3022
|
)
|
|
3023
3023
|
];
|
|
3024
3024
|
}
|
|
3025
|
-
function
|
|
3025
|
+
function yc({
|
|
3026
3026
|
message: e,
|
|
3027
3027
|
downloadedAssets: t
|
|
3028
3028
|
}) {
|
|
@@ -3041,7 +3041,7 @@ function vc({
|
|
|
3041
3041
|
providerOptions: e.providerOptions
|
|
3042
3042
|
} : {
|
|
3043
3043
|
role: "user",
|
|
3044
|
-
content: e.content.map((a) =>
|
|
3044
|
+
content: e.content.map((a) => wc(a, t)).filter((a) => a.type !== "text" || a.text !== ""),
|
|
3045
3045
|
providerOptions: e.providerOptions
|
|
3046
3046
|
};
|
|
3047
3047
|
case "assistant":
|
|
@@ -3116,11 +3116,11 @@ function vc({
|
|
|
3116
3116
|
};
|
|
3117
3117
|
default: {
|
|
3118
3118
|
const a = r;
|
|
3119
|
-
throw new
|
|
3119
|
+
throw new rc({ role: a });
|
|
3120
3120
|
}
|
|
3121
3121
|
}
|
|
3122
3122
|
}
|
|
3123
|
-
async function
|
|
3123
|
+
async function _c(e, t, r) {
|
|
3124
3124
|
const a = e.filter((n) => n.role === "user").map((n) => n.content).filter(
|
|
3125
3125
|
(n) => Array.isArray(n)
|
|
3126
3126
|
).flat().filter(
|
|
@@ -3139,7 +3139,7 @@ async function yc(e, t, r) {
|
|
|
3139
3139
|
(n) => n.data instanceof URL
|
|
3140
3140
|
).map((n) => ({
|
|
3141
3141
|
url: n.data,
|
|
3142
|
-
isUrlSupportedByModel: n.mediaType != null &&
|
|
3142
|
+
isUrlSupportedByModel: n.mediaType != null && rl({
|
|
3143
3143
|
url: n.data.toString(),
|
|
3144
3144
|
mediaType: n.mediaType,
|
|
3145
3145
|
supportedUrls: r
|
|
@@ -3154,7 +3154,7 @@ async function yc(e, t, r) {
|
|
|
3154
3154
|
).filter((n) => n != null)
|
|
3155
3155
|
);
|
|
3156
3156
|
}
|
|
3157
|
-
function
|
|
3157
|
+
function wc(e, t) {
|
|
3158
3158
|
var r;
|
|
3159
3159
|
if (e.type === "text")
|
|
3160
3160
|
return {
|
|
@@ -3182,7 +3182,7 @@ function _c(e, t) {
|
|
|
3182
3182
|
}
|
|
3183
3183
|
switch (o) {
|
|
3184
3184
|
case "image":
|
|
3185
|
-
return (u instanceof Uint8Array || typeof u == "string") && (s = (r =
|
|
3185
|
+
return (u instanceof Uint8Array || typeof u == "string") && (s = (r = dc({ data: u, signatures: lc })) != null ? r : s), {
|
|
3186
3186
|
type: "file",
|
|
3187
3187
|
mediaType: s ?? "image/*",
|
|
3188
3188
|
// any image
|
|
@@ -3203,7 +3203,7 @@ function _c(e, t) {
|
|
|
3203
3203
|
}
|
|
3204
3204
|
}
|
|
3205
3205
|
}
|
|
3206
|
-
function
|
|
3206
|
+
function bc({
|
|
3207
3207
|
maxOutputTokens: e,
|
|
3208
3208
|
temperature: t,
|
|
3209
3209
|
topP: r,
|
|
@@ -3274,15 +3274,15 @@ function wc({
|
|
|
3274
3274
|
seed: i
|
|
3275
3275
|
};
|
|
3276
3276
|
}
|
|
3277
|
-
function
|
|
3277
|
+
function Tc(e) {
|
|
3278
3278
|
return e != null && Object.keys(e).length > 0;
|
|
3279
3279
|
}
|
|
3280
|
-
function
|
|
3280
|
+
function Ic({
|
|
3281
3281
|
tools: e,
|
|
3282
3282
|
toolChoice: t,
|
|
3283
3283
|
activeTools: r
|
|
3284
3284
|
}) {
|
|
3285
|
-
return
|
|
3285
|
+
return Tc(e) ? {
|
|
3286
3286
|
tools: (r != null ? Object.entries(e).filter(
|
|
3287
3287
|
([o]) => r.includes(o)
|
|
3288
3288
|
) : Object.entries(e)).map(([o, n]) => {
|
|
@@ -3295,7 +3295,7 @@ function Tc({
|
|
|
3295
3295
|
type: "function",
|
|
3296
3296
|
name: o,
|
|
3297
3297
|
description: n.description,
|
|
3298
|
-
inputSchema:
|
|
3298
|
+
inputSchema: Qt(n.inputSchema).jsonSchema,
|
|
3299
3299
|
providerOptions: n.providerOptions
|
|
3300
3300
|
};
|
|
3301
3301
|
case "provider-defined":
|
|
@@ -3333,7 +3333,7 @@ var vt = si(
|
|
|
3333
3333
|
type: C("text"),
|
|
3334
3334
|
text: c(),
|
|
3335
3335
|
providerOptions: Ce.optional()
|
|
3336
|
-
}),
|
|
3336
|
+
}), Sc = v({
|
|
3337
3337
|
type: C("image"),
|
|
3338
3338
|
image: D([Po, $t(URL)]),
|
|
3339
3339
|
mediaType: c().optional(),
|
|
@@ -3344,18 +3344,18 @@ var vt = si(
|
|
|
3344
3344
|
filename: c().optional(),
|
|
3345
3345
|
mediaType: c(),
|
|
3346
3346
|
providerOptions: Ce.optional()
|
|
3347
|
-
}),
|
|
3347
|
+
}), Ec = v({
|
|
3348
3348
|
type: C("reasoning"),
|
|
3349
3349
|
text: c(),
|
|
3350
3350
|
providerOptions: Ce.optional()
|
|
3351
|
-
}),
|
|
3351
|
+
}), xc = v({
|
|
3352
3352
|
type: C("tool-call"),
|
|
3353
3353
|
toolCallId: c(),
|
|
3354
3354
|
toolName: c(),
|
|
3355
3355
|
input: Re(),
|
|
3356
3356
|
providerOptions: Ce.optional(),
|
|
3357
3357
|
providerExecuted: _e().optional()
|
|
3358
|
-
}),
|
|
3358
|
+
}), Rc = li("type", [
|
|
3359
3359
|
v({
|
|
3360
3360
|
type: C("text"),
|
|
3361
3361
|
value: c()
|
|
@@ -3392,22 +3392,22 @@ var vt = si(
|
|
|
3392
3392
|
type: C("tool-result"),
|
|
3393
3393
|
toolCallId: c(),
|
|
3394
3394
|
toolName: c(),
|
|
3395
|
-
output:
|
|
3395
|
+
output: Rc,
|
|
3396
3396
|
providerOptions: Ce.optional()
|
|
3397
|
-
}),
|
|
3397
|
+
}), Cc = v(
|
|
3398
3398
|
{
|
|
3399
3399
|
role: C("system"),
|
|
3400
3400
|
content: c(),
|
|
3401
3401
|
providerOptions: Ce.optional()
|
|
3402
3402
|
}
|
|
3403
|
-
),
|
|
3403
|
+
), Ac = v({
|
|
3404
3404
|
role: C("user"),
|
|
3405
3405
|
content: D([
|
|
3406
3406
|
c(),
|
|
3407
|
-
I(D([No,
|
|
3407
|
+
I(D([No, Sc, $o]))
|
|
3408
3408
|
]),
|
|
3409
3409
|
providerOptions: Ce.optional()
|
|
3410
|
-
}),
|
|
3410
|
+
}), kc = v({
|
|
3411
3411
|
role: C("assistant"),
|
|
3412
3412
|
content: D([
|
|
3413
3413
|
c(),
|
|
@@ -3415,24 +3415,24 @@ var vt = si(
|
|
|
3415
3415
|
D([
|
|
3416
3416
|
No,
|
|
3417
3417
|
$o,
|
|
3418
|
-
Sc,
|
|
3419
3418
|
Ec,
|
|
3419
|
+
xc,
|
|
3420
3420
|
Uo
|
|
3421
3421
|
])
|
|
3422
3422
|
)
|
|
3423
3423
|
]),
|
|
3424
3424
|
providerOptions: Ce.optional()
|
|
3425
|
-
}),
|
|
3425
|
+
}), Oc = v({
|
|
3426
3426
|
role: C("tool"),
|
|
3427
3427
|
content: I(Uo),
|
|
3428
3428
|
providerOptions: Ce.optional()
|
|
3429
|
-
}),
|
|
3430
|
-
Rc,
|
|
3429
|
+
}), Pc = D([
|
|
3431
3430
|
Cc,
|
|
3432
3431
|
Ac,
|
|
3433
|
-
kc
|
|
3432
|
+
kc,
|
|
3433
|
+
Oc
|
|
3434
3434
|
]);
|
|
3435
|
-
async function
|
|
3435
|
+
async function Mc(e) {
|
|
3436
3436
|
if (e.prompt == null && e.messages == null)
|
|
3437
3437
|
throw new Ze({
|
|
3438
3438
|
prompt: e,
|
|
@@ -3467,7 +3467,7 @@ async function Pc(e) {
|
|
|
3467
3467
|
});
|
|
3468
3468
|
const r = await je({
|
|
3469
3469
|
value: t,
|
|
3470
|
-
schema: I(
|
|
3470
|
+
schema: I(Pc)
|
|
3471
3471
|
});
|
|
3472
3472
|
if (!r.success)
|
|
3473
3473
|
throw new Ze({
|
|
@@ -3480,14 +3480,14 @@ async function Pc(e) {
|
|
|
3480
3480
|
system: e.system
|
|
3481
3481
|
};
|
|
3482
3482
|
}
|
|
3483
|
-
function
|
|
3483
|
+
function Nc(e) {
|
|
3484
3484
|
return Qr.isInstance(e) || Jn.isInstance(e) ? new J({
|
|
3485
3485
|
name: "GatewayError",
|
|
3486
3486
|
message: "Vercel AI Gateway access failed. If you want to use AI SDK providers directly, use the providers, e.g. @ai-sdk/openai, or register a different global default provider.",
|
|
3487
3487
|
cause: e
|
|
3488
3488
|
}) : e;
|
|
3489
3489
|
}
|
|
3490
|
-
function
|
|
3490
|
+
function jr({
|
|
3491
3491
|
operationId: e,
|
|
3492
3492
|
telemetry: t
|
|
3493
3493
|
}) {
|
|
@@ -3500,7 +3500,7 @@ function Dr({
|
|
|
3500
3500
|
"ai.telemetry.functionId": t?.functionId
|
|
3501
3501
|
};
|
|
3502
3502
|
}
|
|
3503
|
-
function
|
|
3503
|
+
function $c({
|
|
3504
3504
|
model: e,
|
|
3505
3505
|
settings: t,
|
|
3506
3506
|
telemetry: r,
|
|
@@ -3521,7 +3521,7 @@ function Nc({
|
|
|
3521
3521
|
...Object.entries(a ?? {}).reduce((n, [i, s]) => (s !== void 0 && (n[`ai.request.headers.${i}`] = s), n), {})
|
|
3522
3522
|
};
|
|
3523
3523
|
}
|
|
3524
|
-
var
|
|
3524
|
+
var Uc = {
|
|
3525
3525
|
startSpan() {
|
|
3526
3526
|
return Rt;
|
|
3527
3527
|
},
|
|
@@ -3535,7 +3535,7 @@ var $c = {
|
|
|
3535
3535
|
}
|
|
3536
3536
|
}, Rt = {
|
|
3537
3537
|
spanContext() {
|
|
3538
|
-
return
|
|
3538
|
+
return Dc;
|
|
3539
3539
|
},
|
|
3540
3540
|
setAttribute() {
|
|
3541
3541
|
return this;
|
|
@@ -3567,18 +3567,18 @@ var $c = {
|
|
|
3567
3567
|
recordException() {
|
|
3568
3568
|
return this;
|
|
3569
3569
|
}
|
|
3570
|
-
},
|
|
3570
|
+
}, Dc = {
|
|
3571
3571
|
traceId: "",
|
|
3572
3572
|
spanId: "",
|
|
3573
3573
|
traceFlags: 0
|
|
3574
3574
|
};
|
|
3575
|
-
function
|
|
3575
|
+
function jc({
|
|
3576
3576
|
isEnabled: e = !1,
|
|
3577
3577
|
tracer: t
|
|
3578
3578
|
} = {}) {
|
|
3579
|
-
return e ? t ||
|
|
3579
|
+
return e ? t || Ki.getTracer("ai") : Uc;
|
|
3580
3580
|
}
|
|
3581
|
-
function
|
|
3581
|
+
function qr({
|
|
3582
3582
|
name: e,
|
|
3583
3583
|
tracer: t,
|
|
3584
3584
|
attributes: r,
|
|
@@ -3631,20 +3631,20 @@ function We({
|
|
|
3631
3631
|
return { ...r, [a]: o };
|
|
3632
3632
|
}, {});
|
|
3633
3633
|
}
|
|
3634
|
-
function
|
|
3634
|
+
function qc(e) {
|
|
3635
3635
|
return JSON.stringify(
|
|
3636
3636
|
e.map((t) => ({
|
|
3637
3637
|
...t,
|
|
3638
3638
|
content: typeof t.content == "string" ? t.content : t.content.map(
|
|
3639
3639
|
(r) => r.type === "file" ? {
|
|
3640
3640
|
...r,
|
|
3641
|
-
data: r.data instanceof Uint8Array ?
|
|
3641
|
+
data: r.data instanceof Uint8Array ? gc(r.data) : r.data
|
|
3642
3642
|
} : r
|
|
3643
3643
|
)
|
|
3644
3644
|
}))
|
|
3645
3645
|
);
|
|
3646
3646
|
}
|
|
3647
|
-
function
|
|
3647
|
+
function Lc(e, t) {
|
|
3648
3648
|
return {
|
|
3649
3649
|
inputTokens: st(e.inputTokens, t.inputTokens),
|
|
3650
3650
|
outputTokens: st(e.outputTokens, t.outputTokens),
|
|
@@ -3665,7 +3665,7 @@ function st(e, t) {
|
|
|
3665
3665
|
function rn(e) {
|
|
3666
3666
|
return e === void 0 ? [] : Array.isArray(e) ? e : [e];
|
|
3667
3667
|
}
|
|
3668
|
-
function
|
|
3668
|
+
function Vc({
|
|
3669
3669
|
error: e,
|
|
3670
3670
|
exponentialBackoffDelay: t
|
|
3671
3671
|
}) {
|
|
@@ -3685,7 +3685,7 @@ function Lc({
|
|
|
3685
3685
|
}
|
|
3686
3686
|
return a != null && !Number.isNaN(a) && 0 <= a && (a < 60 * 1e3 || a < t) ? a : t;
|
|
3687
3687
|
}
|
|
3688
|
-
var
|
|
3688
|
+
var Fc = ({
|
|
3689
3689
|
maxRetries: e = 2,
|
|
3690
3690
|
initialDelayInMs: t = 2e3,
|
|
3691
3691
|
backoffFactor: r = 2,
|
|
@@ -3715,8 +3715,8 @@ async function jo(e, {
|
|
|
3715
3715
|
errors: u
|
|
3716
3716
|
});
|
|
3717
3717
|
if (i instanceof Error && se.isInstance(i) && i.isRetryable === !0 && l <= t)
|
|
3718
|
-
return await
|
|
3719
|
-
|
|
3718
|
+
return await Yi(
|
|
3719
|
+
Vc({
|
|
3720
3720
|
error: i,
|
|
3721
3721
|
exponentialBackoffDelay: r
|
|
3722
3722
|
}),
|
|
@@ -3738,7 +3738,7 @@ async function jo(e, {
|
|
|
3738
3738
|
});
|
|
3739
3739
|
}
|
|
3740
3740
|
}
|
|
3741
|
-
function
|
|
3741
|
+
function Bc({
|
|
3742
3742
|
maxRetries: e,
|
|
3743
3743
|
abortSignal: t
|
|
3744
3744
|
}) {
|
|
@@ -3759,13 +3759,13 @@ function Fc({
|
|
|
3759
3759
|
const r = e ?? 2;
|
|
3760
3760
|
return {
|
|
3761
3761
|
maxRetries: r,
|
|
3762
|
-
retry:
|
|
3762
|
+
retry: Fc({
|
|
3763
3763
|
maxRetries: r,
|
|
3764
3764
|
abortSignal: t
|
|
3765
3765
|
})
|
|
3766
3766
|
};
|
|
3767
3767
|
}
|
|
3768
|
-
var
|
|
3768
|
+
var Hc = class {
|
|
3769
3769
|
constructor({
|
|
3770
3770
|
data: e,
|
|
3771
3771
|
mediaType: t
|
|
@@ -3775,18 +3775,18 @@ var Bc = class {
|
|
|
3775
3775
|
}
|
|
3776
3776
|
// lazy conversion with caching to avoid unnecessary conversion overhead:
|
|
3777
3777
|
get base64() {
|
|
3778
|
-
return this.base64Data == null && (this.base64Data =
|
|
3778
|
+
return this.base64Data == null && (this.base64Data = Ur(this.uint8ArrayData)), this.base64Data;
|
|
3779
3779
|
}
|
|
3780
3780
|
// lazy conversion with caching to avoid unnecessary conversion overhead:
|
|
3781
3781
|
get uint8Array() {
|
|
3782
3782
|
return this.uint8ArrayData == null && (this.uint8ArrayData = Xr(this.base64Data)), this.uint8ArrayData;
|
|
3783
3783
|
}
|
|
3784
|
-
},
|
|
3784
|
+
}, Gc = class extends Hc {
|
|
3785
3785
|
constructor(e) {
|
|
3786
3786
|
super(e), this.type = "file";
|
|
3787
3787
|
}
|
|
3788
3788
|
};
|
|
3789
|
-
async function
|
|
3789
|
+
async function Jc({
|
|
3790
3790
|
toolCall: e,
|
|
3791
3791
|
tools: t,
|
|
3792
3792
|
repairToolCall: r,
|
|
@@ -3795,11 +3795,11 @@ async function Gc({
|
|
|
3795
3795
|
}) {
|
|
3796
3796
|
try {
|
|
3797
3797
|
if (t == null)
|
|
3798
|
-
throw new
|
|
3798
|
+
throw new Dr({ toolName: e.toolName });
|
|
3799
3799
|
try {
|
|
3800
3800
|
return await an({ toolCall: e, tools: t });
|
|
3801
3801
|
} catch (n) {
|
|
3802
|
-
if (r == null || !(
|
|
3802
|
+
if (r == null || !(Dr.isInstance(n) || oo.isInstance(n)))
|
|
3803
3803
|
throw n;
|
|
3804
3804
|
let i = null;
|
|
3805
3805
|
try {
|
|
@@ -3808,14 +3808,14 @@ async function Gc({
|
|
|
3808
3808
|
tools: t,
|
|
3809
3809
|
inputSchema: ({ toolName: s }) => {
|
|
3810
3810
|
const { inputSchema: u } = t[s];
|
|
3811
|
-
return
|
|
3811
|
+
return Qt(u).jsonSchema;
|
|
3812
3812
|
},
|
|
3813
3813
|
system: a,
|
|
3814
3814
|
messages: o,
|
|
3815
3815
|
error: n
|
|
3816
3816
|
});
|
|
3817
3817
|
} catch (s) {
|
|
3818
|
-
throw new
|
|
3818
|
+
throw new Qu({
|
|
3819
3819
|
cause: s,
|
|
3820
3820
|
originalError: n
|
|
3821
3821
|
});
|
|
@@ -3843,11 +3843,11 @@ async function an({
|
|
|
3843
3843
|
}) {
|
|
3844
3844
|
const r = e.toolName, a = t[r];
|
|
3845
3845
|
if (a == null)
|
|
3846
|
-
throw new
|
|
3846
|
+
throw new Dr({
|
|
3847
3847
|
toolName: e.toolName,
|
|
3848
3848
|
availableTools: Object.keys(t)
|
|
3849
3849
|
});
|
|
3850
|
-
const o =
|
|
3850
|
+
const o = Qt(a.inputSchema), n = e.input.trim() === "" ? await je({ value: {}, schema: o }) : await Ve({ text: e.input, schema: o });
|
|
3851
3851
|
if (n.success === !1)
|
|
3852
3852
|
throw new oo({
|
|
3853
3853
|
toolName: r,
|
|
@@ -3871,7 +3871,7 @@ async function an({
|
|
|
3871
3871
|
providerMetadata: e.providerMetadata
|
|
3872
3872
|
};
|
|
3873
3873
|
}
|
|
3874
|
-
var
|
|
3874
|
+
var Zc = class {
|
|
3875
3875
|
constructor({
|
|
3876
3876
|
content: e,
|
|
3877
3877
|
finishReason: t,
|
|
@@ -3925,10 +3925,10 @@ var Jc = class {
|
|
|
3925
3925
|
);
|
|
3926
3926
|
}
|
|
3927
3927
|
};
|
|
3928
|
-
function
|
|
3928
|
+
function zc(e) {
|
|
3929
3929
|
return ({ steps: t }) => t.length === e;
|
|
3930
3930
|
}
|
|
3931
|
-
async function
|
|
3931
|
+
async function Wc({
|
|
3932
3932
|
stopConditions: e,
|
|
3933
3933
|
steps: t
|
|
3934
3934
|
}) {
|
|
@@ -3939,7 +3939,7 @@ function ct({
|
|
|
3939
3939
|
tool: t,
|
|
3940
3940
|
errorMode: r
|
|
3941
3941
|
}) {
|
|
3942
|
-
return r === "text" ? { type: "error-text", value:
|
|
3942
|
+
return r === "text" ? { type: "error-text", value: Yt(e) } : r === "json" ? { type: "error-json", value: nn(e) } : t?.toModelOutput ? t.toModelOutput(e) : typeof e == "string" ? { type: "text", value: e } : { type: "json", value: nn(e) };
|
|
3943
3943
|
}
|
|
3944
3944
|
function nn(e) {
|
|
3945
3945
|
return e === void 0 ? null : e;
|
|
@@ -4030,13 +4030,13 @@ It({
|
|
|
4030
4030
|
prefix: "aitxt",
|
|
4031
4031
|
size: 24
|
|
4032
4032
|
});
|
|
4033
|
-
function
|
|
4033
|
+
function er(e, t) {
|
|
4034
4034
|
const r = new Headers(e ?? {});
|
|
4035
4035
|
for (const [a, o] of Object.entries(t))
|
|
4036
4036
|
r.has(a) || r.set(a, o);
|
|
4037
4037
|
return r;
|
|
4038
4038
|
}
|
|
4039
|
-
function
|
|
4039
|
+
function Kc({
|
|
4040
4040
|
status: e,
|
|
4041
4041
|
statusText: t,
|
|
4042
4042
|
headers: r,
|
|
@@ -4045,7 +4045,7 @@ function Wc({
|
|
|
4045
4045
|
return new Response(a.pipeThrough(new TextEncoderStream()), {
|
|
4046
4046
|
status: e ?? 200,
|
|
4047
4047
|
statusText: t,
|
|
4048
|
-
headers:
|
|
4048
|
+
headers: er(r, {
|
|
4049
4049
|
"content-type": "text/plain; charset=utf-8"
|
|
4050
4050
|
})
|
|
4051
4051
|
});
|
|
@@ -4076,7 +4076,7 @@ function qo({
|
|
|
4076
4076
|
}
|
|
4077
4077
|
})();
|
|
4078
4078
|
}
|
|
4079
|
-
function
|
|
4079
|
+
function Yc({
|
|
4080
4080
|
response: e,
|
|
4081
4081
|
status: t,
|
|
4082
4082
|
statusText: r,
|
|
@@ -4088,7 +4088,7 @@ function Kc({
|
|
|
4088
4088
|
status: t,
|
|
4089
4089
|
statusText: r,
|
|
4090
4090
|
headers: Object.fromEntries(
|
|
4091
|
-
|
|
4091
|
+
er(a, {
|
|
4092
4092
|
"content-type": "text/plain; charset=utf-8"
|
|
4093
4093
|
}).entries()
|
|
4094
4094
|
),
|
|
@@ -4118,7 +4118,7 @@ var Lo = class extends TransformStream {
|
|
|
4118
4118
|
"x-accel-buffering": "no"
|
|
4119
4119
|
// disable nginx buffering
|
|
4120
4120
|
};
|
|
4121
|
-
function
|
|
4121
|
+
function Xc({
|
|
4122
4122
|
status: e,
|
|
4123
4123
|
statusText: t,
|
|
4124
4124
|
headers: r,
|
|
@@ -4133,10 +4133,10 @@ function Yc({
|
|
|
4133
4133
|
return new Response(n.pipeThrough(new TextEncoderStream()), {
|
|
4134
4134
|
status: e,
|
|
4135
4135
|
statusText: t,
|
|
4136
|
-
headers:
|
|
4136
|
+
headers: er(r, Vo)
|
|
4137
4137
|
});
|
|
4138
4138
|
}
|
|
4139
|
-
function
|
|
4139
|
+
function Qc({
|
|
4140
4140
|
originalMessages: e,
|
|
4141
4141
|
responseMessageId: t
|
|
4142
4142
|
}) {
|
|
@@ -4145,7 +4145,7 @@ function Xc({
|
|
|
4145
4145
|
const r = e[e.length - 1];
|
|
4146
4146
|
return r?.role === "assistant" ? r.id : typeof t == "function" ? t() : t;
|
|
4147
4147
|
}
|
|
4148
|
-
function
|
|
4148
|
+
function ed(e) {
|
|
4149
4149
|
return e.type.startsWith("data-");
|
|
4150
4150
|
}
|
|
4151
4151
|
function Fo(e, t) {
|
|
@@ -4169,7 +4169,7 @@ function Fo(e, t) {
|
|
|
4169
4169
|
}
|
|
4170
4170
|
return r;
|
|
4171
4171
|
}
|
|
4172
|
-
function
|
|
4172
|
+
function td(e) {
|
|
4173
4173
|
const t = ["ROOT"];
|
|
4174
4174
|
let r = -1, a = null;
|
|
4175
4175
|
function o(u, l, d) {
|
|
@@ -4421,15 +4421,15 @@ async function Bo(e) {
|
|
|
4421
4421
|
if (e === void 0)
|
|
4422
4422
|
return { value: void 0, state: "undefined-input" };
|
|
4423
4423
|
let t = await Ve({ text: e });
|
|
4424
|
-
return t.success ? { value: t.value, state: "successful-parse" } : (t = await Ve({ text:
|
|
4424
|
+
return t.success ? { value: t.value, state: "successful-parse" } : (t = await Ve({ text: td(e) }), t.success ? { value: t.value, state: "repaired-parse" } : { value: void 0, state: "failed-parse" });
|
|
4425
4425
|
}
|
|
4426
|
-
function
|
|
4426
|
+
function Ir(e) {
|
|
4427
4427
|
return e.type.startsWith("data-");
|
|
4428
4428
|
}
|
|
4429
|
-
function
|
|
4429
|
+
function Sr(e) {
|
|
4430
4430
|
return e.type === "text";
|
|
4431
4431
|
}
|
|
4432
|
-
function
|
|
4432
|
+
function Er(e) {
|
|
4433
4433
|
return e.type === "file";
|
|
4434
4434
|
}
|
|
4435
4435
|
function sn(e) {
|
|
@@ -4447,10 +4447,10 @@ function ln(e) {
|
|
|
4447
4447
|
function Lt(e) {
|
|
4448
4448
|
return e.type.split("-").slice(1).join("-");
|
|
4449
4449
|
}
|
|
4450
|
-
function
|
|
4450
|
+
function rd(e) {
|
|
4451
4451
|
return ea(e) ? e.toolName : Lt(e);
|
|
4452
4452
|
}
|
|
4453
|
-
function
|
|
4453
|
+
function ad({
|
|
4454
4454
|
lastMessage: e,
|
|
4455
4455
|
messageId: t
|
|
4456
4456
|
}) {
|
|
@@ -4466,7 +4466,7 @@ function rd({
|
|
|
4466
4466
|
partialToolCalls: {}
|
|
4467
4467
|
};
|
|
4468
4468
|
}
|
|
4469
|
-
function
|
|
4469
|
+
function nd({
|
|
4470
4470
|
stream: e,
|
|
4471
4471
|
messageMetadataSchema: t,
|
|
4472
4472
|
dataPartSchemas: r,
|
|
@@ -4541,7 +4541,7 @@ function ad({
|
|
|
4541
4541
|
async function b(g) {
|
|
4542
4542
|
if (g != null) {
|
|
4543
4543
|
const x = l.message.metadata != null ? Fo(l.message.metadata, g) : g;
|
|
4544
|
-
t != null && await
|
|
4544
|
+
t != null && await Pr({
|
|
4545
4545
|
value: x,
|
|
4546
4546
|
schema: t
|
|
4547
4547
|
}), l.message.metadata = x;
|
|
@@ -4780,8 +4780,8 @@ function ad({
|
|
|
4780
4780
|
break;
|
|
4781
4781
|
}
|
|
4782
4782
|
default:
|
|
4783
|
-
if (
|
|
4784
|
-
r?.[s.type] != null && await
|
|
4783
|
+
if (ed(s)) {
|
|
4784
|
+
r?.[s.type] != null && await Pr({
|
|
4785
4785
|
value: s.data,
|
|
4786
4786
|
schema: r[s.type]
|
|
4787
4787
|
});
|
|
@@ -4802,7 +4802,7 @@ function ad({
|
|
|
4802
4802
|
})
|
|
4803
4803
|
);
|
|
4804
4804
|
}
|
|
4805
|
-
function
|
|
4805
|
+
function od({
|
|
4806
4806
|
messageId: e,
|
|
4807
4807
|
originalMessages: t = [],
|
|
4808
4808
|
onFinish: r,
|
|
@@ -4825,7 +4825,7 @@ function nd({
|
|
|
4825
4825
|
);
|
|
4826
4826
|
if (r == null)
|
|
4827
4827
|
return s;
|
|
4828
|
-
const u =
|
|
4828
|
+
const u = ad({
|
|
4829
4829
|
lastMessage: n ? structuredClone(n) : void 0,
|
|
4830
4830
|
messageId: e ?? ""
|
|
4831
4831
|
// will be overridden by the stream
|
|
@@ -4849,7 +4849,7 @@ function nd({
|
|
|
4849
4849
|
]
|
|
4850
4850
|
});
|
|
4851
4851
|
};
|
|
4852
|
-
return
|
|
4852
|
+
return nd({
|
|
4853
4853
|
stream: s,
|
|
4854
4854
|
runUpdateMessageJob: l,
|
|
4855
4855
|
onError: a
|
|
@@ -4868,7 +4868,7 @@ function nd({
|
|
|
4868
4868
|
})
|
|
4869
4869
|
);
|
|
4870
4870
|
}
|
|
4871
|
-
function
|
|
4871
|
+
function sd({
|
|
4872
4872
|
response: e,
|
|
4873
4873
|
status: t,
|
|
4874
4874
|
statusText: r,
|
|
@@ -4886,7 +4886,7 @@ function od({
|
|
|
4886
4886
|
status: t,
|
|
4887
4887
|
statusText: r,
|
|
4888
4888
|
headers: Object.fromEntries(
|
|
4889
|
-
|
|
4889
|
+
er(a, Vo).entries()
|
|
4890
4890
|
),
|
|
4891
4891
|
stream: i.pipeThrough(new TextEncoderStream())
|
|
4892
4892
|
});
|
|
@@ -4939,7 +4939,7 @@ function Ct(e) {
|
|
|
4939
4939
|
};
|
|
4940
4940
|
}, t;
|
|
4941
4941
|
}
|
|
4942
|
-
async function
|
|
4942
|
+
async function id({
|
|
4943
4943
|
stream: e,
|
|
4944
4944
|
onError: t
|
|
4945
4945
|
}) {
|
|
@@ -4966,7 +4966,7 @@ function un() {
|
|
|
4966
4966
|
reject: t
|
|
4967
4967
|
};
|
|
4968
4968
|
}
|
|
4969
|
-
function
|
|
4969
|
+
function ld() {
|
|
4970
4970
|
let e = [], t = null, r = !1, a = un();
|
|
4971
4971
|
const o = () => {
|
|
4972
4972
|
r = !0, a.resolve(), e.forEach((i) => i.cancel()), e = [], t?.close();
|
|
@@ -5033,11 +5033,11 @@ var At = class {
|
|
|
5033
5033
|
this.status = { type: "rejected", error: e }, this._promise && ((t = this._reject) == null || t.call(this, e));
|
|
5034
5034
|
}
|
|
5035
5035
|
};
|
|
5036
|
-
function
|
|
5036
|
+
function ud() {
|
|
5037
5037
|
var e, t;
|
|
5038
5038
|
return (t = (e = globalThis?.performance) == null ? void 0 : e.now()) != null ? t : Date.now();
|
|
5039
5039
|
}
|
|
5040
|
-
function
|
|
5040
|
+
function cd({
|
|
5041
5041
|
tools: e,
|
|
5042
5042
|
generatorStream: t,
|
|
5043
5043
|
tracer: r,
|
|
@@ -5082,7 +5082,7 @@ function ud({
|
|
|
5082
5082
|
case "file": {
|
|
5083
5083
|
T.enqueue({
|
|
5084
5084
|
type: "file",
|
|
5085
|
-
file: new
|
|
5085
|
+
file: new Gc({
|
|
5086
5086
|
data: _.data,
|
|
5087
5087
|
mediaType: _.mediaType
|
|
5088
5088
|
})
|
|
@@ -5100,7 +5100,7 @@ function ud({
|
|
|
5100
5100
|
}
|
|
5101
5101
|
case "tool-call": {
|
|
5102
5102
|
try {
|
|
5103
|
-
const g = await
|
|
5103
|
+
const g = await Jc({
|
|
5104
5104
|
toolCall: _,
|
|
5105
5105
|
tools: e,
|
|
5106
5106
|
repairToolCall: s,
|
|
@@ -5126,13 +5126,13 @@ function ud({
|
|
|
5126
5126
|
abortSignal: i,
|
|
5127
5127
|
experimental_context: u
|
|
5128
5128
|
}), x.execute != null && g.providerExecuted !== !0) {
|
|
5129
|
-
const A =
|
|
5130
|
-
p.add(A),
|
|
5129
|
+
const A = Xi();
|
|
5130
|
+
p.add(A), qr({
|
|
5131
5131
|
name: "ai.toolCall",
|
|
5132
5132
|
attributes: We({
|
|
5133
5133
|
telemetry: a,
|
|
5134
5134
|
attributes: {
|
|
5135
|
-
...
|
|
5135
|
+
...jr({
|
|
5136
5136
|
operationId: "ai.toolCall",
|
|
5137
5137
|
telemetry: a
|
|
5138
5138
|
}),
|
|
@@ -5147,7 +5147,7 @@ function ud({
|
|
|
5147
5147
|
fn: async (E) => {
|
|
5148
5148
|
let k;
|
|
5149
5149
|
try {
|
|
5150
|
-
const U =
|
|
5150
|
+
const U = du({
|
|
5151
5151
|
execute: x.execute.bind(x),
|
|
5152
5152
|
input: g.input,
|
|
5153
5153
|
options: {
|
|
@@ -5251,11 +5251,11 @@ function ud({
|
|
|
5251
5251
|
}
|
|
5252
5252
|
});
|
|
5253
5253
|
}
|
|
5254
|
-
var
|
|
5254
|
+
var dd = It({
|
|
5255
5255
|
prefix: "aitxt",
|
|
5256
5256
|
size: 24
|
|
5257
5257
|
});
|
|
5258
|
-
function
|
|
5258
|
+
function pd({
|
|
5259
5259
|
model: e,
|
|
5260
5260
|
tools: t,
|
|
5261
5261
|
toolChoice: r,
|
|
@@ -5265,7 +5265,7 @@ function dd({
|
|
|
5265
5265
|
maxRetries: i,
|
|
5266
5266
|
abortSignal: s,
|
|
5267
5267
|
headers: u,
|
|
5268
|
-
stopWhen: l =
|
|
5268
|
+
stopWhen: l = zc(1),
|
|
5269
5269
|
experimental_output: d,
|
|
5270
5270
|
experimental_telemetry: p,
|
|
5271
5271
|
prepareStep: m,
|
|
@@ -5285,13 +5285,13 @@ function dd({
|
|
|
5285
5285
|
onStepFinish: k,
|
|
5286
5286
|
experimental_context: U,
|
|
5287
5287
|
_internal: {
|
|
5288
|
-
now: z =
|
|
5289
|
-
generateId: ee =
|
|
5288
|
+
now: z = ud,
|
|
5289
|
+
generateId: ee = dd,
|
|
5290
5290
|
currentDate: be = () => /* @__PURE__ */ new Date()
|
|
5291
5291
|
} = {},
|
|
5292
5292
|
...Z
|
|
5293
5293
|
}) {
|
|
5294
|
-
return new
|
|
5294
|
+
return new hd({
|
|
5295
5295
|
model: Oo(e),
|
|
5296
5296
|
telemetry: p,
|
|
5297
5297
|
headers: u,
|
|
@@ -5323,7 +5323,7 @@ function dd({
|
|
|
5323
5323
|
download: T
|
|
5324
5324
|
});
|
|
5325
5325
|
}
|
|
5326
|
-
function
|
|
5326
|
+
function fd(e) {
|
|
5327
5327
|
if (!e)
|
|
5328
5328
|
return new TransformStream({
|
|
5329
5329
|
transform(i, s) {
|
|
@@ -5373,7 +5373,7 @@ function pd(e) {
|
|
|
5373
5373
|
}
|
|
5374
5374
|
});
|
|
5375
5375
|
}
|
|
5376
|
-
var
|
|
5376
|
+
var hd = class {
|
|
5377
5377
|
constructor({
|
|
5378
5378
|
model: e,
|
|
5379
5379
|
telemetry: t,
|
|
@@ -5416,7 +5416,7 @@ var fd = class {
|
|
|
5416
5416
|
var te, V, he, et;
|
|
5417
5417
|
Y.enqueue(K);
|
|
5418
5418
|
const { part: S } = K;
|
|
5419
|
-
if ((S.type === "text-delta" || S.type === "reasoning-delta" || S.type === "source" || S.type === "tool-call" || S.type === "tool-result" || S.type === "tool-input-start" || S.type === "tool-input-delta" || S.type === "raw") && await A?.({ chunk: S }), S.type === "error" && await E({ error:
|
|
5419
|
+
if ((S.type === "text-delta" || S.type === "reasoning-delta" || S.type === "source" || S.type === "tool-call" || S.type === "tool-result" || S.type === "tool-input-start" || S.type === "tool-input-delta" || S.type === "raw") && await A?.({ chunk: S }), S.type === "error" && await E({ error: Nc(S.error) }), S.type === "text-start" && (fe[S.id] = {
|
|
5420
5420
|
type: "text",
|
|
5421
5421
|
text: "",
|
|
5422
5422
|
providerMetadata: S.providerMetadata
|
|
@@ -5484,7 +5484,7 @@ var fd = class {
|
|
|
5484
5484
|
const W = on({
|
|
5485
5485
|
content: L,
|
|
5486
5486
|
tools: l
|
|
5487
|
-
}), tt = new
|
|
5487
|
+
}), tt = new Zc({
|
|
5488
5488
|
content: L,
|
|
5489
5489
|
finishReason: S.finishReason,
|
|
5490
5490
|
usage: S.usage,
|
|
@@ -5496,14 +5496,14 @@ var fd = class {
|
|
|
5496
5496
|
},
|
|
5497
5497
|
providerMetadata: S.providerMetadata
|
|
5498
5498
|
});
|
|
5499
|
-
await z?.(tt),
|
|
5499
|
+
await z?.(tt), Gu(q), O.push(tt), L = [], N = {}, fe = {}, Te.push(...W), Z.resolve();
|
|
5500
5500
|
}
|
|
5501
5501
|
S.type === "finish" && (Me = S.totalUsage, Ie = S.finishReason);
|
|
5502
5502
|
},
|
|
5503
5503
|
async flush(K) {
|
|
5504
5504
|
try {
|
|
5505
5505
|
if (O.length === 0) {
|
|
5506
|
-
const he = new
|
|
5506
|
+
const he = new Ku({
|
|
5507
5507
|
message: "No output generated. Check the stream for errors."
|
|
5508
5508
|
});
|
|
5509
5509
|
pe._finishReason.reject(he), pe._totalUsage.reject(he), pe._steps.reject(he);
|
|
@@ -5566,10 +5566,10 @@ var fd = class {
|
|
|
5566
5566
|
Q.end();
|
|
5567
5567
|
}
|
|
5568
5568
|
}
|
|
5569
|
-
}), F =
|
|
5569
|
+
}), F = ld();
|
|
5570
5570
|
this.addStream = F.addStream, this.closeStream = F.close;
|
|
5571
5571
|
const ae = F.stream.getReader();
|
|
5572
|
-
let
|
|
5572
|
+
let or = new ReadableStream({
|
|
5573
5573
|
async start(K) {
|
|
5574
5574
|
K.enqueue({ type: "start" });
|
|
5575
5575
|
},
|
|
@@ -5597,7 +5597,7 @@ var fd = class {
|
|
|
5597
5597
|
}
|
|
5598
5598
|
});
|
|
5599
5599
|
for (const K of p)
|
|
5600
|
-
|
|
5600
|
+
or = or.pipeThrough(
|
|
5601
5601
|
K({
|
|
5602
5602
|
tools: l,
|
|
5603
5603
|
stopStream() {
|
|
@@ -5605,22 +5605,22 @@ var fd = class {
|
|
|
5605
5605
|
}
|
|
5606
5606
|
})
|
|
5607
5607
|
);
|
|
5608
|
-
this.baseStream =
|
|
5609
|
-
const { maxRetries: Ws, retry: Ks } =
|
|
5608
|
+
this.baseStream = or.pipeThrough(fd(y)).pipeThrough(j);
|
|
5609
|
+
const { maxRetries: Ws, retry: Ks } = Bc({
|
|
5610
5610
|
maxRetries: o,
|
|
5611
5611
|
abortSignal: n
|
|
5612
|
-
}),
|
|
5612
|
+
}), sr = jc(t), Ae = bc(a), da = $c({
|
|
5613
5613
|
model: e,
|
|
5614
5614
|
telemetry: t,
|
|
5615
5615
|
headers: r,
|
|
5616
5616
|
settings: { ...Ae, maxRetries: Ws }
|
|
5617
5617
|
}), pe = this;
|
|
5618
|
-
|
|
5618
|
+
qr({
|
|
5619
5619
|
name: "ai.streamText",
|
|
5620
5620
|
attributes: We({
|
|
5621
5621
|
telemetry: t,
|
|
5622
5622
|
attributes: {
|
|
5623
|
-
...
|
|
5623
|
+
...jr({ operationId: "ai.streamText", telemetry: t }),
|
|
5624
5624
|
...da,
|
|
5625
5625
|
// specific settings that only make sense on the outer level:
|
|
5626
5626
|
"ai.prompt": {
|
|
@@ -5628,7 +5628,7 @@ var fd = class {
|
|
|
5628
5628
|
}
|
|
5629
5629
|
}
|
|
5630
5630
|
}),
|
|
5631
|
-
tracer:
|
|
5631
|
+
tracer: sr,
|
|
5632
5632
|
endWhenDone: !1,
|
|
5633
5633
|
fn: async (K) => {
|
|
5634
5634
|
Q = K;
|
|
@@ -5640,7 +5640,7 @@ var fd = class {
|
|
|
5640
5640
|
var et, S, W, tt, pa;
|
|
5641
5641
|
const fa = pe.includeRawChunks;
|
|
5642
5642
|
Z = new At();
|
|
5643
|
-
const ha = await
|
|
5643
|
+
const ha = await Mc({
|
|
5644
5644
|
system: i,
|
|
5645
5645
|
prompt: s,
|
|
5646
5646
|
messages: u
|
|
@@ -5654,14 +5654,14 @@ var fd = class {
|
|
|
5654
5654
|
messages: rt
|
|
5655
5655
|
}), He = Oo(
|
|
5656
5656
|
(et = Se?.model) != null ? et : e
|
|
5657
|
-
), ma = await
|
|
5657
|
+
), ma = await vc({
|
|
5658
5658
|
prompt: {
|
|
5659
5659
|
system: (S = Se?.system) != null ? S : ha.system,
|
|
5660
5660
|
messages: (W = Se?.messages) != null ? W : rt
|
|
5661
5661
|
},
|
|
5662
5662
|
supportedUrls: await He.supportedUrls,
|
|
5663
5663
|
download: be
|
|
5664
|
-
}), { toolChoice:
|
|
5664
|
+
}), { toolChoice: ir, tools: lr } = Ic({
|
|
5665
5665
|
tools: l,
|
|
5666
5666
|
toolChoice: (tt = Se?.toolChoice) != null ? tt : d,
|
|
5667
5667
|
activeTools: (pa = Se?.activeTools) != null ? pa : m
|
|
@@ -5670,12 +5670,12 @@ var fd = class {
|
|
|
5670
5670
|
doStreamSpan: Ge,
|
|
5671
5671
|
startTimestampMs: ya
|
|
5672
5672
|
} = await Ks(
|
|
5673
|
-
() =>
|
|
5673
|
+
() => qr({
|
|
5674
5674
|
name: "ai.streamText.doStream",
|
|
5675
5675
|
attributes: We({
|
|
5676
5676
|
telemetry: t,
|
|
5677
5677
|
attributes: {
|
|
5678
|
-
...
|
|
5678
|
+
...jr({
|
|
5679
5679
|
operationId: "ai.streamText.doStream",
|
|
5680
5680
|
telemetry: t
|
|
5681
5681
|
}),
|
|
@@ -5685,14 +5685,14 @@ var fd = class {
|
|
|
5685
5685
|
"ai.model.id": He.modelId,
|
|
5686
5686
|
// prompt:
|
|
5687
5687
|
"ai.prompt.messages": {
|
|
5688
|
-
input: () =>
|
|
5688
|
+
input: () => qc(ma)
|
|
5689
5689
|
},
|
|
5690
5690
|
"ai.prompt.tools": {
|
|
5691
5691
|
// convert the language model level tools:
|
|
5692
|
-
input: () =>
|
|
5692
|
+
input: () => lr?.map((P) => JSON.stringify(P))
|
|
5693
5693
|
},
|
|
5694
5694
|
"ai.prompt.toolChoice": {
|
|
5695
|
-
input: () =>
|
|
5695
|
+
input: () => ir != null ? JSON.stringify(ir) : void 0
|
|
5696
5696
|
},
|
|
5697
5697
|
// standardized gen-ai llm span attributes:
|
|
5698
5698
|
"gen_ai.system": He.provider,
|
|
@@ -5706,7 +5706,7 @@ var fd = class {
|
|
|
5706
5706
|
"gen_ai.request.top_p": Ae.topP
|
|
5707
5707
|
}
|
|
5708
5708
|
}),
|
|
5709
|
-
tracer:
|
|
5709
|
+
tracer: sr,
|
|
5710
5710
|
endWhenDone: !1,
|
|
5711
5711
|
fn: async (P) => ({
|
|
5712
5712
|
startTimestampMs: b(),
|
|
@@ -5714,8 +5714,8 @@ var fd = class {
|
|
|
5714
5714
|
doStreamSpan: P,
|
|
5715
5715
|
result: await He.doStream({
|
|
5716
5716
|
...Ae,
|
|
5717
|
-
tools:
|
|
5718
|
-
toolChoice:
|
|
5717
|
+
tools: lr,
|
|
5718
|
+
toolChoice: ir,
|
|
5719
5719
|
responseFormat: y?.responseFormat,
|
|
5720
5720
|
prompt: ma,
|
|
5721
5721
|
providerOptions: w,
|
|
@@ -5725,24 +5725,24 @@ var fd = class {
|
|
|
5725
5725
|
})
|
|
5726
5726
|
})
|
|
5727
5727
|
})
|
|
5728
|
-
), Xs =
|
|
5728
|
+
), Xs = cd({
|
|
5729
5729
|
tools: l,
|
|
5730
5730
|
generatorStream: Ys,
|
|
5731
|
-
tracer:
|
|
5731
|
+
tracer: sr,
|
|
5732
5732
|
telemetry: t,
|
|
5733
5733
|
system: i,
|
|
5734
5734
|
messages: rt,
|
|
5735
5735
|
repairToolCall: f,
|
|
5736
5736
|
abortSignal: n,
|
|
5737
5737
|
experimental_context: ee
|
|
5738
|
-
}), Qs = va ?? {}, Et = [],
|
|
5739
|
-
let
|
|
5740
|
-
const
|
|
5738
|
+
}), Qs = va ?? {}, Et = [], ur = [];
|
|
5739
|
+
let cr;
|
|
5740
|
+
const dr = {};
|
|
5741
5741
|
let Je = "unknown", me = {
|
|
5742
5742
|
inputTokens: void 0,
|
|
5743
5743
|
outputTokens: void 0,
|
|
5744
5744
|
totalTokens: void 0
|
|
5745
|
-
},
|
|
5745
|
+
}, pr, _a = !0, Ee = {
|
|
5746
5746
|
id: x(),
|
|
5747
5747
|
timestamp: g(),
|
|
5748
5748
|
modelId: e.modelId
|
|
@@ -5753,7 +5753,7 @@ var fd = class {
|
|
|
5753
5753
|
async transform(P, re) {
|
|
5754
5754
|
var at, nt, xt, ke;
|
|
5755
5755
|
if (P.type === "stream-start") {
|
|
5756
|
-
|
|
5756
|
+
cr = P.warnings;
|
|
5757
5757
|
return;
|
|
5758
5758
|
}
|
|
5759
5759
|
if (_a) {
|
|
@@ -5765,7 +5765,7 @@ var fd = class {
|
|
|
5765
5765
|
}), re.enqueue({
|
|
5766
5766
|
type: "start-step",
|
|
5767
5767
|
request: Qs,
|
|
5768
|
-
warnings:
|
|
5768
|
+
warnings: cr ?? []
|
|
5769
5769
|
});
|
|
5770
5770
|
}
|
|
5771
5771
|
const ba = P.type;
|
|
@@ -5803,11 +5803,11 @@ var fd = class {
|
|
|
5803
5803
|
break;
|
|
5804
5804
|
}
|
|
5805
5805
|
case "tool-result": {
|
|
5806
|
-
re.enqueue(P), P.preliminary ||
|
|
5806
|
+
re.enqueue(P), P.preliminary || ur.push(P);
|
|
5807
5807
|
break;
|
|
5808
5808
|
}
|
|
5809
5809
|
case "tool-error": {
|
|
5810
|
-
re.enqueue(P),
|
|
5810
|
+
re.enqueue(P), ur.push(P);
|
|
5811
5811
|
break;
|
|
5812
5812
|
}
|
|
5813
5813
|
case "response-metadata": {
|
|
@@ -5819,7 +5819,7 @@ var fd = class {
|
|
|
5819
5819
|
break;
|
|
5820
5820
|
}
|
|
5821
5821
|
case "finish": {
|
|
5822
|
-
me = P.usage, Je = P.finishReason,
|
|
5822
|
+
me = P.usage, Je = P.finishReason, pr = P.providerMetadata;
|
|
5823
5823
|
const ne = b() - ya;
|
|
5824
5824
|
Ge.addEvent("ai.stream.finish"), Ge.setAttributes({
|
|
5825
5825
|
"ai.response.msToFinish": ne,
|
|
@@ -5836,7 +5836,7 @@ var fd = class {
|
|
|
5836
5836
|
break;
|
|
5837
5837
|
}
|
|
5838
5838
|
case "tool-input-start": {
|
|
5839
|
-
|
|
5839
|
+
dr[P.id] = P.toolName;
|
|
5840
5840
|
const ne = l?.[P.toolName];
|
|
5841
5841
|
ne?.onInputStart != null && await ne.onInputStart({
|
|
5842
5842
|
toolCallId: P.id,
|
|
@@ -5850,12 +5850,12 @@ var fd = class {
|
|
|
5850
5850
|
break;
|
|
5851
5851
|
}
|
|
5852
5852
|
case "tool-input-end": {
|
|
5853
|
-
delete
|
|
5853
|
+
delete dr[P.id], re.enqueue(P);
|
|
5854
5854
|
break;
|
|
5855
5855
|
}
|
|
5856
5856
|
case "tool-input-delta": {
|
|
5857
|
-
const ne =
|
|
5858
|
-
|
|
5857
|
+
const ne = dr[P.id], fr = l?.[ne];
|
|
5858
|
+
fr?.onInputDelta != null && await fr.onInputDelta({
|
|
5859
5859
|
inputTextDelta: P.delta,
|
|
5860
5860
|
toolCallId: P.id,
|
|
5861
5861
|
messages: rt,
|
|
@@ -5896,7 +5896,7 @@ var fd = class {
|
|
|
5896
5896
|
"ai.response.id": Ee.id,
|
|
5897
5897
|
"ai.response.model": Ee.modelId,
|
|
5898
5898
|
"ai.response.timestamp": Ee.timestamp.toISOString(),
|
|
5899
|
-
"ai.response.providerMetadata": JSON.stringify(
|
|
5899
|
+
"ai.response.providerMetadata": JSON.stringify(pr),
|
|
5900
5900
|
"ai.usage.inputTokens": me.inputTokens,
|
|
5901
5901
|
"ai.usage.outputTokens": me.outputTokens,
|
|
5902
5902
|
"ai.usage.totalTokens": me.totalTokens,
|
|
@@ -5919,22 +5919,22 @@ var fd = class {
|
|
|
5919
5919
|
type: "finish-step",
|
|
5920
5920
|
finishReason: Je,
|
|
5921
5921
|
usage: me,
|
|
5922
|
-
providerMetadata:
|
|
5922
|
+
providerMetadata: pr,
|
|
5923
5923
|
response: {
|
|
5924
5924
|
...Ee,
|
|
5925
5925
|
headers: ga?.headers
|
|
5926
5926
|
}
|
|
5927
5927
|
});
|
|
5928
|
-
const at =
|
|
5928
|
+
const at = Lc(he, me);
|
|
5929
5929
|
await Z.promise;
|
|
5930
5930
|
const nt = Et.filter(
|
|
5931
5931
|
(ke) => ke.providerExecuted !== !0
|
|
5932
|
-
), xt =
|
|
5932
|
+
), xt = ur.filter(
|
|
5933
5933
|
(ke) => ke.providerExecuted !== !0
|
|
5934
5934
|
);
|
|
5935
5935
|
if (nt.length > 0 && // all current tool calls have outputs (incl. execution errors):
|
|
5936
5936
|
xt.length === nt.length && // continue until a stop condition is met:
|
|
5937
|
-
!await
|
|
5937
|
+
!await Wc({
|
|
5938
5938
|
stopConditions: h,
|
|
5939
5939
|
steps: O
|
|
5940
5940
|
})) {
|
|
@@ -6090,7 +6090,7 @@ var fd = class {
|
|
|
6090
6090
|
async consumeStream(e) {
|
|
6091
6091
|
var t;
|
|
6092
6092
|
try {
|
|
6093
|
-
await
|
|
6093
|
+
await id({
|
|
6094
6094
|
stream: this.fullStream,
|
|
6095
6095
|
onError: e?.onError
|
|
6096
6096
|
});
|
|
@@ -6100,7 +6100,7 @@ var fd = class {
|
|
|
6100
6100
|
}
|
|
6101
6101
|
get experimental_partialOutputStream() {
|
|
6102
6102
|
if (this.output == null)
|
|
6103
|
-
throw new
|
|
6103
|
+
throw new Fu();
|
|
6104
6104
|
return Ct(
|
|
6105
6105
|
this.teeStream().pipeThrough(
|
|
6106
6106
|
new TransformStream({
|
|
@@ -6120,9 +6120,9 @@ var fd = class {
|
|
|
6120
6120
|
sendSources: n = !1,
|
|
6121
6121
|
sendStart: i = !0,
|
|
6122
6122
|
sendFinish: s = !0,
|
|
6123
|
-
onError: u =
|
|
6123
|
+
onError: u = Yt
|
|
6124
6124
|
} = {}) {
|
|
6125
|
-
const l = t != null ?
|
|
6125
|
+
const l = t != null ? Qc({
|
|
6126
6126
|
originalMessages: e,
|
|
6127
6127
|
responseMessageId: t
|
|
6128
6128
|
}) : void 0, d = {}, p = (f) => {
|
|
@@ -6326,7 +6326,7 @@ var fd = class {
|
|
|
6326
6326
|
})
|
|
6327
6327
|
);
|
|
6328
6328
|
return Ct(
|
|
6329
|
-
|
|
6329
|
+
od({
|
|
6330
6330
|
stream: m,
|
|
6331
6331
|
messageId: l ?? t?.(),
|
|
6332
6332
|
originalMessages: e,
|
|
@@ -6347,7 +6347,7 @@ var fd = class {
|
|
|
6347
6347
|
onError: l,
|
|
6348
6348
|
...d
|
|
6349
6349
|
} = {}) {
|
|
6350
|
-
|
|
6350
|
+
sd({
|
|
6351
6351
|
response: e,
|
|
6352
6352
|
stream: this.toUIMessageStream({
|
|
6353
6353
|
originalMessages: t,
|
|
@@ -6364,7 +6364,7 @@ var fd = class {
|
|
|
6364
6364
|
});
|
|
6365
6365
|
}
|
|
6366
6366
|
pipeTextStreamToResponse(e, t) {
|
|
6367
|
-
|
|
6367
|
+
Yc({
|
|
6368
6368
|
response: e,
|
|
6369
6369
|
textStream: this.textStream,
|
|
6370
6370
|
...t
|
|
@@ -6382,7 +6382,7 @@ var fd = class {
|
|
|
6382
6382
|
onError: u,
|
|
6383
6383
|
...l
|
|
6384
6384
|
} = {}) {
|
|
6385
|
-
return
|
|
6385
|
+
return Xc({
|
|
6386
6386
|
stream: this.toUIMessageStream({
|
|
6387
6387
|
originalMessages: e,
|
|
6388
6388
|
generateMessageId: t,
|
|
@@ -6398,13 +6398,13 @@ var fd = class {
|
|
|
6398
6398
|
});
|
|
6399
6399
|
}
|
|
6400
6400
|
toTextStreamResponse(e) {
|
|
6401
|
-
return
|
|
6401
|
+
return Kc({
|
|
6402
6402
|
textStream: this.textStream,
|
|
6403
6403
|
...e
|
|
6404
6404
|
});
|
|
6405
6405
|
}
|
|
6406
6406
|
};
|
|
6407
|
-
function
|
|
6407
|
+
function md(e, t) {
|
|
6408
6408
|
const r = [];
|
|
6409
6409
|
t?.ignoreIncompleteToolCalls && (e = e.map((a) => ({
|
|
6410
6410
|
...a,
|
|
@@ -6430,13 +6430,13 @@ function hd(e, t) {
|
|
|
6430
6430
|
role: "user",
|
|
6431
6431
|
content: a.parts.map((o) => {
|
|
6432
6432
|
var n;
|
|
6433
|
-
if (
|
|
6433
|
+
if (Sr(o))
|
|
6434
6434
|
return {
|
|
6435
6435
|
type: "text",
|
|
6436
6436
|
text: o.text,
|
|
6437
6437
|
...o.providerMetadata != null ? { providerOptions: o.providerMetadata } : {}
|
|
6438
6438
|
};
|
|
6439
|
-
if (
|
|
6439
|
+
if (Er(o))
|
|
6440
6440
|
return {
|
|
6441
6441
|
type: "file",
|
|
6442
6442
|
mediaType: o.mediaType,
|
|
@@ -6444,7 +6444,7 @@ function hd(e, t) {
|
|
|
6444
6444
|
data: o.url,
|
|
6445
6445
|
...o.providerMetadata != null ? { providerOptions: o.providerMetadata } : {}
|
|
6446
6446
|
};
|
|
6447
|
-
if (
|
|
6447
|
+
if (Ir(o))
|
|
6448
6448
|
return (n = t?.convertDataPart) == null ? void 0 : n.call(
|
|
6449
6449
|
t,
|
|
6450
6450
|
o
|
|
@@ -6461,13 +6461,13 @@ function hd(e, t) {
|
|
|
6461
6461
|
return;
|
|
6462
6462
|
const l = [];
|
|
6463
6463
|
for (const p of n)
|
|
6464
|
-
if (
|
|
6464
|
+
if (Sr(p))
|
|
6465
6465
|
l.push({
|
|
6466
6466
|
type: "text",
|
|
6467
6467
|
text: p.text,
|
|
6468
6468
|
...p.providerMetadata != null ? { providerOptions: p.providerMetadata } : {}
|
|
6469
6469
|
});
|
|
6470
|
-
else if (
|
|
6470
|
+
else if (Er(p))
|
|
6471
6471
|
l.push({
|
|
6472
6472
|
type: "file",
|
|
6473
6473
|
mediaType: p.mediaType,
|
|
@@ -6508,7 +6508,7 @@ function hd(e, t) {
|
|
|
6508
6508
|
errorMode: p.state === "output-error" ? "json" : "none"
|
|
6509
6509
|
})
|
|
6510
6510
|
}));
|
|
6511
|
-
} else if (
|
|
6511
|
+
} else if (Ir(p)) {
|
|
6512
6512
|
const m = (u = t?.convertDataPart) == null ? void 0 : u.call(
|
|
6513
6513
|
t,
|
|
6514
6514
|
p
|
|
@@ -6532,7 +6532,7 @@ function hd(e, t) {
|
|
|
6532
6532
|
switch (p.state) {
|
|
6533
6533
|
case "output-error":
|
|
6534
6534
|
case "output-available": {
|
|
6535
|
-
const f =
|
|
6535
|
+
const f = rd(p);
|
|
6536
6536
|
return {
|
|
6537
6537
|
type: "tool-result",
|
|
6538
6538
|
toolCallId: p.toolCallId,
|
|
@@ -6553,7 +6553,7 @@ function hd(e, t) {
|
|
|
6553
6553
|
}), n = [];
|
|
6554
6554
|
}, n = [];
|
|
6555
6555
|
for (const i of a.parts)
|
|
6556
|
-
|
|
6556
|
+
Sr(i) || sn(i) || Er(i) || ln(i) || Ir(i) ? n.push(i) : i.type === "step-start" && o();
|
|
6557
6557
|
o();
|
|
6558
6558
|
break;
|
|
6559
6559
|
}
|
|
@@ -6561,7 +6561,7 @@ function hd(e, t) {
|
|
|
6561
6561
|
}
|
|
6562
6562
|
default: {
|
|
6563
6563
|
const o = a.role;
|
|
6564
|
-
throw new
|
|
6564
|
+
throw new nc({
|
|
6565
6565
|
originalMessage: a,
|
|
6566
6566
|
message: `Unsupported role: ${o}`
|
|
6567
6567
|
});
|
|
@@ -6571,12 +6571,12 @@ function hd(e, t) {
|
|
|
6571
6571
|
}
|
|
6572
6572
|
It({ prefix: "aiobj", size: 24 });
|
|
6573
6573
|
It({ prefix: "aiobj", size: 24 });
|
|
6574
|
-
var
|
|
6575
|
-
|
|
6576
|
-
object: () =>
|
|
6577
|
-
text: () =>
|
|
6574
|
+
var gd = {};
|
|
6575
|
+
Lu(gd, {
|
|
6576
|
+
object: () => yd,
|
|
6577
|
+
text: () => vd
|
|
6578
6578
|
});
|
|
6579
|
-
var
|
|
6579
|
+
var vd = () => ({
|
|
6580
6580
|
type: "text",
|
|
6581
6581
|
responseFormat: { type: "text" },
|
|
6582
6582
|
async parsePartial({ text: e }) {
|
|
@@ -6585,10 +6585,10 @@ var gd = () => ({
|
|
|
6585
6585
|
async parseOutput({ text: e }) {
|
|
6586
6586
|
return e;
|
|
6587
6587
|
}
|
|
6588
|
-
}),
|
|
6588
|
+
}), yd = ({
|
|
6589
6589
|
schema: e
|
|
6590
6590
|
}) => {
|
|
6591
|
-
const t =
|
|
6591
|
+
const t = Qt(e);
|
|
6592
6592
|
return {
|
|
6593
6593
|
type: "object",
|
|
6594
6594
|
responseFormat: {
|
|
@@ -6640,14 +6640,14 @@ var gd = () => ({
|
|
|
6640
6640
|
return n.value;
|
|
6641
6641
|
}
|
|
6642
6642
|
};
|
|
6643
|
-
},
|
|
6643
|
+
}, _d = Object.defineProperty, wd = Object.defineProperties, bd = Object.getOwnPropertyDescriptors, cn = Object.getOwnPropertySymbols, Td = Object.prototype.hasOwnProperty, Id = Object.prototype.propertyIsEnumerable, dn = (e, t, r) => t in e ? _d(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, B = (e, t) => {
|
|
6644
6644
|
for (var r in t || (t = {}))
|
|
6645
|
-
|
|
6645
|
+
Td.call(t, r) && dn(e, r, t[r]);
|
|
6646
6646
|
if (cn)
|
|
6647
6647
|
for (var r of cn(t))
|
|
6648
|
-
|
|
6648
|
+
Id.call(t, r) && dn(e, r, t[r]);
|
|
6649
6649
|
return e;
|
|
6650
|
-
}, Vt = (e, t) =>
|
|
6650
|
+
}, Vt = (e, t) => wd(e, bd(t)), Ho = "vercel.ai.error", Sd = Symbol.for(Ho), Go, Ed = class Jo extends Error {
|
|
6651
6651
|
/**
|
|
6652
6652
|
* Creates an AI SDK Error.
|
|
6653
6653
|
*
|
|
@@ -6676,8 +6676,8 @@ var gd = () => ({
|
|
|
6676
6676
|
return t != null && typeof t == "object" && a in t && typeof t[a] == "boolean" && t[a] === !0;
|
|
6677
6677
|
}
|
|
6678
6678
|
};
|
|
6679
|
-
Go =
|
|
6680
|
-
var X =
|
|
6679
|
+
Go = Sd;
|
|
6680
|
+
var X = Ed, Zo = "AI_APICallError", zo = `vercel.ai.error.${Zo}`, xd = Symbol.for(zo), Wo, we = class extends X {
|
|
6681
6681
|
constructor({
|
|
6682
6682
|
message: e,
|
|
6683
6683
|
url: t,
|
|
@@ -6699,8 +6699,8 @@ var X = Sd, Zo = "AI_APICallError", zo = `vercel.ai.error.${Zo}`, Ed = Symbol.fo
|
|
|
6699
6699
|
return X.hasMarker(e, zo);
|
|
6700
6700
|
}
|
|
6701
6701
|
};
|
|
6702
|
-
Wo =
|
|
6703
|
-
var Ko = "AI_EmptyResponseBodyError", Yo = `vercel.ai.error.${Ko}`,
|
|
6702
|
+
Wo = xd;
|
|
6703
|
+
var Ko = "AI_EmptyResponseBodyError", Yo = `vercel.ai.error.${Ko}`, Rd = Symbol.for(Yo), Xo, Cd = class extends X {
|
|
6704
6704
|
// used in isInstance
|
|
6705
6705
|
constructor({ message: e = "Empty response body" } = {}) {
|
|
6706
6706
|
super({ name: Ko, message: e }), this[Xo] = !0;
|
|
@@ -6709,11 +6709,11 @@ var Ko = "AI_EmptyResponseBodyError", Yo = `vercel.ai.error.${Ko}`, xd = Symbol.
|
|
|
6709
6709
|
return X.hasMarker(e, Yo);
|
|
6710
6710
|
}
|
|
6711
6711
|
};
|
|
6712
|
-
Xo =
|
|
6712
|
+
Xo = Rd;
|
|
6713
6713
|
function Qo(e) {
|
|
6714
6714
|
return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.message : JSON.stringify(e);
|
|
6715
6715
|
}
|
|
6716
|
-
var es = "AI_InvalidArgumentError", ts = `vercel.ai.error.${es}`,
|
|
6716
|
+
var es = "AI_InvalidArgumentError", ts = `vercel.ai.error.${es}`, Ad = Symbol.for(ts), rs, as = class extends X {
|
|
6717
6717
|
constructor({
|
|
6718
6718
|
message: e,
|
|
6719
6719
|
cause: t,
|
|
@@ -6725,8 +6725,8 @@ var es = "AI_InvalidArgumentError", ts = `vercel.ai.error.${es}`, Cd = Symbol.fo
|
|
|
6725
6725
|
return X.hasMarker(e, ts);
|
|
6726
6726
|
}
|
|
6727
6727
|
};
|
|
6728
|
-
rs =
|
|
6729
|
-
var ns = "AI_InvalidPromptError", os = `vercel.ai.error.${ns}`,
|
|
6728
|
+
rs = Ad;
|
|
6729
|
+
var ns = "AI_InvalidPromptError", os = `vercel.ai.error.${ns}`, kd = Symbol.for(os), ss, Od = class extends X {
|
|
6730
6730
|
constructor({
|
|
6731
6731
|
prompt: e,
|
|
6732
6732
|
message: t,
|
|
@@ -6738,8 +6738,8 @@ var ns = "AI_InvalidPromptError", os = `vercel.ai.error.${ns}`, Ad = Symbol.for(
|
|
|
6738
6738
|
return X.hasMarker(e, os);
|
|
6739
6739
|
}
|
|
6740
6740
|
};
|
|
6741
|
-
ss =
|
|
6742
|
-
var is = "AI_InvalidResponseDataError", ls = `vercel.ai.error.${is}`,
|
|
6741
|
+
ss = kd;
|
|
6742
|
+
var is = "AI_InvalidResponseDataError", ls = `vercel.ai.error.${is}`, Pd = Symbol.for(ls), us, it = class extends X {
|
|
6743
6743
|
constructor({
|
|
6744
6744
|
data: e,
|
|
6745
6745
|
message: t = `Invalid response data: ${JSON.stringify(e)}.`
|
|
@@ -6750,8 +6750,8 @@ var is = "AI_InvalidResponseDataError", ls = `vercel.ai.error.${is}`, Od = Symbo
|
|
|
6750
6750
|
return X.hasMarker(e, ls);
|
|
6751
6751
|
}
|
|
6752
6752
|
};
|
|
6753
|
-
us =
|
|
6754
|
-
var cs = "AI_JSONParseError", ds = `vercel.ai.error.${cs}`,
|
|
6753
|
+
us = Pd;
|
|
6754
|
+
var cs = "AI_JSONParseError", ds = `vercel.ai.error.${cs}`, Md = Symbol.for(ds), ps, Ft = class extends X {
|
|
6755
6755
|
constructor({ text: e, cause: t }) {
|
|
6756
6756
|
super({
|
|
6757
6757
|
name: cs,
|
|
@@ -6764,8 +6764,8 @@ Error message: ${Qo(t)}`,
|
|
|
6764
6764
|
return X.hasMarker(e, ds);
|
|
6765
6765
|
}
|
|
6766
6766
|
};
|
|
6767
|
-
ps =
|
|
6768
|
-
var fs = "AI_LoadAPIKeyError", hs = `vercel.ai.error.${fs}`,
|
|
6767
|
+
ps = Md;
|
|
6768
|
+
var fs = "AI_LoadAPIKeyError", hs = `vercel.ai.error.${fs}`, Nd = Symbol.for(hs), ms, kt = class extends X {
|
|
6769
6769
|
// used in isInstance
|
|
6770
6770
|
constructor({ message: e }) {
|
|
6771
6771
|
super({ name: fs, message: e }), this[ms] = !0;
|
|
@@ -6774,8 +6774,8 @@ var fs = "AI_LoadAPIKeyError", hs = `vercel.ai.error.${fs}`, Md = Symbol.for(hs)
|
|
|
6774
6774
|
return X.hasMarker(e, hs);
|
|
6775
6775
|
}
|
|
6776
6776
|
};
|
|
6777
|
-
ms =
|
|
6778
|
-
var gs = "AI_NoContentGeneratedError", vs = `vercel.ai.error.${gs}`,
|
|
6777
|
+
ms = Nd;
|
|
6778
|
+
var gs = "AI_NoContentGeneratedError", vs = `vercel.ai.error.${gs}`, $d = Symbol.for(vs), ys, _s = class extends X {
|
|
6779
6779
|
// used in isInstance
|
|
6780
6780
|
constructor({
|
|
6781
6781
|
message: e = "No content generated."
|
|
@@ -6786,8 +6786,8 @@ var gs = "AI_NoContentGeneratedError", vs = `vercel.ai.error.${gs}`, Nd = Symbol
|
|
|
6786
6786
|
return X.hasMarker(e, vs);
|
|
6787
6787
|
}
|
|
6788
6788
|
};
|
|
6789
|
-
ys =
|
|
6790
|
-
var ws = "AI_TypeValidationError", bs = `vercel.ai.error.${ws}`,
|
|
6789
|
+
ys = $d;
|
|
6790
|
+
var ws = "AI_TypeValidationError", bs = `vercel.ai.error.${ws}`, Ud = Symbol.for(bs), Ts, Dd = class Lr extends X {
|
|
6791
6791
|
constructor({ value: t, cause: r }) {
|
|
6792
6792
|
super({
|
|
6793
6793
|
name: ws,
|
|
@@ -6813,11 +6813,11 @@ Error message: ${Qo(r)}`,
|
|
|
6813
6813
|
value: t,
|
|
6814
6814
|
cause: r
|
|
6815
6815
|
}) {
|
|
6816
|
-
return
|
|
6816
|
+
return Lr.isInstance(r) && r.value === t ? r : new Lr({ value: t, cause: r });
|
|
6817
6817
|
}
|
|
6818
6818
|
};
|
|
6819
|
-
Ts =
|
|
6820
|
-
var yt =
|
|
6819
|
+
Ts = Ud;
|
|
6820
|
+
var yt = Dd, Is = "AI_UnsupportedFunctionalityError", Ss = `vercel.ai.error.${Is}`, jd = Symbol.for(Ss), Es, $e = class extends X {
|
|
6821
6821
|
constructor({
|
|
6822
6822
|
functionality: e,
|
|
6823
6823
|
message: t = `'${e}' functionality not supported.`
|
|
@@ -6828,23 +6828,23 @@ var yt = Ud, Is = "AI_UnsupportedFunctionalityError", Ss = `vercel.ai.error.${Is
|
|
|
6828
6828
|
return X.hasMarker(e, Ss);
|
|
6829
6829
|
}
|
|
6830
6830
|
};
|
|
6831
|
-
Es =
|
|
6831
|
+
Es = jd;
|
|
6832
6832
|
var pn = class extends Error {
|
|
6833
6833
|
constructor(e, t) {
|
|
6834
6834
|
super(e), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line;
|
|
6835
6835
|
}
|
|
6836
6836
|
};
|
|
6837
|
-
function
|
|
6837
|
+
function xr(e) {
|
|
6838
6838
|
}
|
|
6839
|
-
function
|
|
6839
|
+
function qd(e) {
|
|
6840
6840
|
if (typeof e == "function")
|
|
6841
6841
|
throw new TypeError(
|
|
6842
6842
|
"`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?"
|
|
6843
6843
|
);
|
|
6844
|
-
const { onEvent: t =
|
|
6844
|
+
const { onEvent: t = xr, onError: r = xr, onRetry: a = xr, onComment: o } = e;
|
|
6845
6845
|
let n = "", i = !0, s, u = "", l = "";
|
|
6846
6846
|
function d(y) {
|
|
6847
|
-
const w = i ? y.replace(/^\xEF\xBB\xBF/, "") : y, [_, T] =
|
|
6847
|
+
const w = i ? y.replace(/^\xEF\xBB\xBF/, "") : y, [_, T] = Ld(`${n}${w}`);
|
|
6848
6848
|
for (const b of _)
|
|
6849
6849
|
p(b);
|
|
6850
6850
|
n = T, i = !1;
|
|
@@ -6912,7 +6912,7 @@ function jd(e) {
|
|
|
6912
6912
|
}
|
|
6913
6913
|
return { feed: d, reset: h };
|
|
6914
6914
|
}
|
|
6915
|
-
function
|
|
6915
|
+
function Ld(e) {
|
|
6916
6916
|
const t = [];
|
|
6917
6917
|
let r = "", a = 0;
|
|
6918
6918
|
for (; a < e.length; ) {
|
|
@@ -6930,12 +6930,12 @@ function qd(e) {
|
|
|
6930
6930
|
}
|
|
6931
6931
|
return [t, r];
|
|
6932
6932
|
}
|
|
6933
|
-
var
|
|
6933
|
+
var Vd = class extends TransformStream {
|
|
6934
6934
|
constructor({ onError: e, onRetry: t, onComment: r } = {}) {
|
|
6935
6935
|
let a;
|
|
6936
6936
|
super({
|
|
6937
6937
|
start(o) {
|
|
6938
|
-
a =
|
|
6938
|
+
a = qd({
|
|
6939
6939
|
onEvent: (n) => {
|
|
6940
6940
|
o.enqueue(n);
|
|
6941
6941
|
},
|
|
@@ -6959,10 +6959,10 @@ function _t(...e) {
|
|
|
6959
6959
|
{}
|
|
6960
6960
|
);
|
|
6961
6961
|
}
|
|
6962
|
-
function
|
|
6962
|
+
function tr(e) {
|
|
6963
6963
|
return Object.fromEntries([...e.headers]);
|
|
6964
6964
|
}
|
|
6965
|
-
var
|
|
6965
|
+
var Fd = ({
|
|
6966
6966
|
prefix: e,
|
|
6967
6967
|
size: t = 16,
|
|
6968
6968
|
alphabet: r = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
|
@@ -6982,20 +6982,20 @@ var Vd = ({
|
|
|
6982
6982
|
message: `The separator "${a}" must not be part of the alphabet "${r}".`
|
|
6983
6983
|
});
|
|
6984
6984
|
return () => `${e}${a}${o()}`;
|
|
6985
|
-
}, ye =
|
|
6986
|
-
function
|
|
6985
|
+
}, ye = Fd();
|
|
6986
|
+
function Vr(e) {
|
|
6987
6987
|
return (e instanceof Error || e instanceof DOMException) && (e.name === "AbortError" || e.name === "ResponseAborted" || // Next.js
|
|
6988
6988
|
e.name === "TimeoutError");
|
|
6989
6989
|
}
|
|
6990
|
-
var
|
|
6991
|
-
function
|
|
6990
|
+
var Bd = ["fetch failed", "failed to fetch"];
|
|
6991
|
+
function Hd({
|
|
6992
6992
|
error: e,
|
|
6993
6993
|
url: t,
|
|
6994
6994
|
requestBodyValues: r
|
|
6995
6995
|
}) {
|
|
6996
|
-
if (
|
|
6996
|
+
if (Vr(e))
|
|
6997
6997
|
return e;
|
|
6998
|
-
if (e instanceof TypeError &&
|
|
6998
|
+
if (e instanceof TypeError && Bd.includes(e.message.toLowerCase())) {
|
|
6999
6999
|
const a = e.cause;
|
|
7000
7000
|
if (a != null)
|
|
7001
7001
|
return new we({
|
|
@@ -7009,12 +7009,12 @@ function Bd({
|
|
|
7009
7009
|
}
|
|
7010
7010
|
return e;
|
|
7011
7011
|
}
|
|
7012
|
-
function
|
|
7012
|
+
function Gd(e) {
|
|
7013
7013
|
return Object.fromEntries(
|
|
7014
7014
|
Object.entries(e).filter(([t, r]) => r != null)
|
|
7015
7015
|
);
|
|
7016
7016
|
}
|
|
7017
|
-
function
|
|
7017
|
+
function Jd({
|
|
7018
7018
|
apiKey: e,
|
|
7019
7019
|
environmentVariableName: t,
|
|
7020
7020
|
apiKeyParameterName: r = "apiKey",
|
|
@@ -7040,12 +7040,12 @@ function Gd({
|
|
|
7040
7040
|
});
|
|
7041
7041
|
return e;
|
|
7042
7042
|
}
|
|
7043
|
-
var
|
|
7044
|
-
function
|
|
7043
|
+
var Zd = /"__proto__"\s*:/, zd = /"constructor"\s*:/;
|
|
7044
|
+
function Wd(e) {
|
|
7045
7045
|
const t = JSON.parse(e);
|
|
7046
|
-
return t === null || typeof t != "object" ||
|
|
7046
|
+
return t === null || typeof t != "object" || Zd.test(e) === !1 && zd.test(e) === !1 ? t : Kd(t);
|
|
7047
7047
|
}
|
|
7048
|
-
function
|
|
7048
|
+
function Kd(e) {
|
|
7049
7049
|
let t = [e];
|
|
7050
7050
|
for (; t.length; ) {
|
|
7051
7051
|
const r = t;
|
|
@@ -7067,23 +7067,23 @@ function ta(e) {
|
|
|
7067
7067
|
const { stackTraceLimit: t } = Error;
|
|
7068
7068
|
Error.stackTraceLimit = 0;
|
|
7069
7069
|
try {
|
|
7070
|
-
return
|
|
7070
|
+
return Wd(e);
|
|
7071
7071
|
} finally {
|
|
7072
7072
|
Error.stackTraceLimit = t;
|
|
7073
7073
|
}
|
|
7074
7074
|
}
|
|
7075
|
-
var
|
|
7076
|
-
function Kd(e) {
|
|
7077
|
-
return { [Vr]: !0, validate: e };
|
|
7078
|
-
}
|
|
7075
|
+
var Fr = Symbol.for("vercel.ai.validator");
|
|
7079
7076
|
function Yd(e) {
|
|
7080
|
-
return
|
|
7077
|
+
return { [Fr]: !0, validate: e };
|
|
7081
7078
|
}
|
|
7082
7079
|
function Xd(e) {
|
|
7083
|
-
return
|
|
7080
|
+
return typeof e == "object" && e !== null && Fr in e && e[Fr] === !0 && "validate" in e;
|
|
7084
7081
|
}
|
|
7085
7082
|
function Qd(e) {
|
|
7086
|
-
return
|
|
7083
|
+
return Xd(e) ? e : ep(e);
|
|
7084
|
+
}
|
|
7085
|
+
function ep(e) {
|
|
7086
|
+
return Yd(async (t) => {
|
|
7087
7087
|
const r = await e["~standard"].validate(t);
|
|
7088
7088
|
return r.issues == null ? { success: !0, value: r.value } : {
|
|
7089
7089
|
success: !1,
|
|
@@ -7094,7 +7094,7 @@ function Qd(e) {
|
|
|
7094
7094
|
};
|
|
7095
7095
|
});
|
|
7096
7096
|
}
|
|
7097
|
-
async function
|
|
7097
|
+
async function tp({
|
|
7098
7098
|
value: e,
|
|
7099
7099
|
schema: t
|
|
7100
7100
|
}) {
|
|
@@ -7107,7 +7107,7 @@ async function xs({
|
|
|
7107
7107
|
value: e,
|
|
7108
7108
|
schema: t
|
|
7109
7109
|
}) {
|
|
7110
|
-
const r =
|
|
7110
|
+
const r = Qd(t);
|
|
7111
7111
|
try {
|
|
7112
7112
|
if (r.validate == null)
|
|
7113
7113
|
return { success: !0, value: e, rawValue: e };
|
|
@@ -7125,13 +7125,13 @@ async function xs({
|
|
|
7125
7125
|
};
|
|
7126
7126
|
}
|
|
7127
7127
|
}
|
|
7128
|
-
async function
|
|
7128
|
+
async function rp({
|
|
7129
7129
|
text: e,
|
|
7130
7130
|
schema: t
|
|
7131
7131
|
}) {
|
|
7132
7132
|
try {
|
|
7133
7133
|
const r = ta(e);
|
|
7134
|
-
return t == null ? r :
|
|
7134
|
+
return t == null ? r : tp({ value: r, schema: t });
|
|
7135
7135
|
} catch (r) {
|
|
7136
7136
|
throw Ft.isInstance(r) || yt.isInstance(r) ? r : new Ft({ text: e, cause: r });
|
|
7137
7137
|
}
|
|
@@ -7151,18 +7151,18 @@ async function Rs({
|
|
|
7151
7151
|
};
|
|
7152
7152
|
}
|
|
7153
7153
|
}
|
|
7154
|
-
function
|
|
7154
|
+
function Rr(e) {
|
|
7155
7155
|
try {
|
|
7156
7156
|
return ta(e), !0;
|
|
7157
7157
|
} catch {
|
|
7158
7158
|
return !1;
|
|
7159
7159
|
}
|
|
7160
7160
|
}
|
|
7161
|
-
function
|
|
7161
|
+
function ap({
|
|
7162
7162
|
stream: e,
|
|
7163
7163
|
schema: t
|
|
7164
7164
|
}) {
|
|
7165
|
-
return e.pipeThrough(new TextDecoderStream()).pipeThrough(new
|
|
7165
|
+
return e.pipeThrough(new TextDecoderStream()).pipeThrough(new Vd()).pipeThrough(
|
|
7166
7166
|
new TransformStream({
|
|
7167
7167
|
async transform({ data: r }, a) {
|
|
7168
7168
|
r !== "[DONE]" && a.enqueue(await Rs({ text: r, schema: t }));
|
|
@@ -7170,7 +7170,7 @@ function rp({
|
|
|
7170
7170
|
})
|
|
7171
7171
|
);
|
|
7172
7172
|
}
|
|
7173
|
-
var
|
|
7173
|
+
var np = () => globalThis.fetch, wt = async ({
|
|
7174
7174
|
url: e,
|
|
7175
7175
|
headers: t,
|
|
7176
7176
|
body: r,
|
|
@@ -7178,7 +7178,7 @@ var ap = () => globalThis.fetch, wt = async ({
|
|
|
7178
7178
|
successfulResponseHandler: o,
|
|
7179
7179
|
abortSignal: n,
|
|
7180
7180
|
fetch: i
|
|
7181
|
-
}) =>
|
|
7181
|
+
}) => op({
|
|
7182
7182
|
url: e,
|
|
7183
7183
|
headers: B({
|
|
7184
7184
|
"Content-Type": "application/json"
|
|
@@ -7191,22 +7191,22 @@ var ap = () => globalThis.fetch, wt = async ({
|
|
|
7191
7191
|
successfulResponseHandler: o,
|
|
7192
7192
|
abortSignal: n,
|
|
7193
7193
|
fetch: i
|
|
7194
|
-
}),
|
|
7194
|
+
}), op = async ({
|
|
7195
7195
|
url: e,
|
|
7196
7196
|
headers: t = {},
|
|
7197
7197
|
body: r,
|
|
7198
7198
|
successfulResponseHandler: a,
|
|
7199
7199
|
failedResponseHandler: o,
|
|
7200
7200
|
abortSignal: n,
|
|
7201
|
-
fetch: i =
|
|
7201
|
+
fetch: i = np()
|
|
7202
7202
|
}) => {
|
|
7203
7203
|
try {
|
|
7204
7204
|
const s = await i(e, {
|
|
7205
7205
|
method: "POST",
|
|
7206
|
-
headers:
|
|
7206
|
+
headers: Gd(t),
|
|
7207
7207
|
body: r.content,
|
|
7208
7208
|
signal: n
|
|
7209
|
-
}), u =
|
|
7209
|
+
}), u = tr(s);
|
|
7210
7210
|
if (!s.ok) {
|
|
7211
7211
|
let l;
|
|
7212
7212
|
try {
|
|
@@ -7216,7 +7216,7 @@ var ap = () => globalThis.fetch, wt = async ({
|
|
|
7216
7216
|
requestBodyValues: r.values
|
|
7217
7217
|
});
|
|
7218
7218
|
} catch (d) {
|
|
7219
|
-
throw
|
|
7219
|
+
throw Vr(d) || we.isInstance(d) ? d : new we({
|
|
7220
7220
|
message: "Failed to process error response",
|
|
7221
7221
|
cause: d,
|
|
7222
7222
|
statusCode: s.status,
|
|
@@ -7234,7 +7234,7 @@ var ap = () => globalThis.fetch, wt = async ({
|
|
|
7234
7234
|
requestBodyValues: r.values
|
|
7235
7235
|
});
|
|
7236
7236
|
} catch (l) {
|
|
7237
|
-
throw l instanceof Error && (
|
|
7237
|
+
throw l instanceof Error && (Vr(l) || we.isInstance(l)) ? l : new we({
|
|
7238
7238
|
message: "Failed to process successful response",
|
|
7239
7239
|
cause: l,
|
|
7240
7240
|
statusCode: s.status,
|
|
@@ -7244,14 +7244,14 @@ var ap = () => globalThis.fetch, wt = async ({
|
|
|
7244
7244
|
});
|
|
7245
7245
|
}
|
|
7246
7246
|
} catch (s) {
|
|
7247
|
-
throw
|
|
7247
|
+
throw Hd({ error: s, url: e, requestBodyValues: r.values });
|
|
7248
7248
|
}
|
|
7249
|
-
},
|
|
7249
|
+
}, sp = ({
|
|
7250
7250
|
errorSchema: e,
|
|
7251
7251
|
errorToMessage: t,
|
|
7252
7252
|
isRetryable: r
|
|
7253
7253
|
}) => async ({ response: a, url: o, requestBodyValues: n }) => {
|
|
7254
|
-
const i = await a.text(), s =
|
|
7254
|
+
const i = await a.text(), s = tr(a);
|
|
7255
7255
|
if (i.trim() === "")
|
|
7256
7256
|
return {
|
|
7257
7257
|
responseHeaders: s,
|
|
@@ -7266,7 +7266,7 @@ var ap = () => globalThis.fetch, wt = async ({
|
|
|
7266
7266
|
})
|
|
7267
7267
|
};
|
|
7268
7268
|
try {
|
|
7269
|
-
const u = await
|
|
7269
|
+
const u = await rp({
|
|
7270
7270
|
text: i,
|
|
7271
7271
|
schema: e
|
|
7272
7272
|
});
|
|
@@ -7298,12 +7298,12 @@ var ap = () => globalThis.fetch, wt = async ({
|
|
|
7298
7298
|
};
|
|
7299
7299
|
}
|
|
7300
7300
|
}, Cs = (e) => async ({ response: t }) => {
|
|
7301
|
-
const r =
|
|
7301
|
+
const r = tr(t);
|
|
7302
7302
|
if (t.body == null)
|
|
7303
|
-
throw new
|
|
7303
|
+
throw new Cd({});
|
|
7304
7304
|
return {
|
|
7305
7305
|
responseHeaders: r,
|
|
7306
|
-
value:
|
|
7306
|
+
value: ap({
|
|
7307
7307
|
stream: t.body,
|
|
7308
7308
|
schema: e
|
|
7309
7309
|
})
|
|
@@ -7312,7 +7312,7 @@ var ap = () => globalThis.fetch, wt = async ({
|
|
|
7312
7312
|
const o = await t.text(), n = await Rs({
|
|
7313
7313
|
text: o,
|
|
7314
7314
|
schema: e
|
|
7315
|
-
}), i =
|
|
7315
|
+
}), i = tr(t);
|
|
7316
7316
|
if (!n.success)
|
|
7317
7317
|
throw new we({
|
|
7318
7318
|
message: "Invalid JSON response",
|
|
@@ -7328,36 +7328,36 @@ var ap = () => globalThis.fetch, wt = async ({
|
|
|
7328
7328
|
value: n.value,
|
|
7329
7329
|
rawValue: n.rawValue
|
|
7330
7330
|
};
|
|
7331
|
-
}, { btoa:
|
|
7332
|
-
function
|
|
7331
|
+
}, { btoa: ip } = globalThis;
|
|
7332
|
+
function lp(e) {
|
|
7333
7333
|
let t = "";
|
|
7334
7334
|
for (let r = 0; r < e.length; r++)
|
|
7335
7335
|
t += String.fromCodePoint(e[r]);
|
|
7336
|
-
return
|
|
7336
|
+
return ip(t);
|
|
7337
7337
|
}
|
|
7338
|
-
function
|
|
7338
|
+
function up(e) {
|
|
7339
7339
|
return e?.replace(/\/$/, "");
|
|
7340
7340
|
}
|
|
7341
|
-
function
|
|
7341
|
+
function Cr(e) {
|
|
7342
7342
|
return e != null;
|
|
7343
7343
|
}
|
|
7344
7344
|
var As = /* @__PURE__ */ ((e) => (e.Unknown = "unknown", e.OpenAIResponsesV1 = "openai-responses-v1", e.XAIResponsesV1 = "xai-responses-v1", e.AnthropicClaudeV1 = "anthropic-claude-v1", e.GoogleGeminiV1 = "google-gemini-v1", e))(As || {}), aa = v({
|
|
7345
7345
|
id: c().nullish(),
|
|
7346
|
-
format:
|
|
7346
|
+
format: Kt(As).nullish(),
|
|
7347
7347
|
index: R().optional()
|
|
7348
|
-
}).loose(),
|
|
7348
|
+
}).loose(), cp = v({
|
|
7349
7349
|
type: C(
|
|
7350
7350
|
"reasoning.summary"
|
|
7351
7351
|
/* Summary */
|
|
7352
7352
|
),
|
|
7353
7353
|
summary: c()
|
|
7354
|
-
}).extend(aa.shape),
|
|
7354
|
+
}).extend(aa.shape), dp = v({
|
|
7355
7355
|
type: C(
|
|
7356
7356
|
"reasoning.encrypted"
|
|
7357
7357
|
/* Encrypted */
|
|
7358
7358
|
),
|
|
7359
7359
|
data: c()
|
|
7360
|
-
}).extend(aa.shape),
|
|
7360
|
+
}).extend(aa.shape), pp = v({
|
|
7361
7361
|
type: C(
|
|
7362
7362
|
"reasoning.text"
|
|
7363
7363
|
/* Text */
|
|
@@ -7365,9 +7365,9 @@ var As = /* @__PURE__ */ ((e) => (e.Unknown = "unknown", e.OpenAIResponsesV1 = "
|
|
|
7365
7365
|
text: c().nullish(),
|
|
7366
7366
|
signature: c().nullish()
|
|
7367
7367
|
}).extend(aa.shape), na = D([
|
|
7368
|
-
up,
|
|
7369
7368
|
cp,
|
|
7370
|
-
dp
|
|
7369
|
+
dp,
|
|
7370
|
+
pp
|
|
7371
7371
|
]), Pt = D([
|
|
7372
7372
|
na,
|
|
7373
7373
|
Re().transform(() => null)
|
|
@@ -7378,29 +7378,29 @@ D([
|
|
|
7378
7378
|
reasoning_details: I(Pt)
|
|
7379
7379
|
})
|
|
7380
7380
|
}).transform(
|
|
7381
|
-
(e) => e.delta.reasoning_details.filter(
|
|
7381
|
+
(e) => e.delta.reasoning_details.filter(Cr)
|
|
7382
7382
|
),
|
|
7383
7383
|
v({
|
|
7384
7384
|
message: v({
|
|
7385
7385
|
reasoning_details: I(Pt)
|
|
7386
7386
|
})
|
|
7387
7387
|
}).transform(
|
|
7388
|
-
(e) => e.message.reasoning_details.filter(
|
|
7388
|
+
(e) => e.message.reasoning_details.filter(Cr)
|
|
7389
7389
|
),
|
|
7390
7390
|
v({
|
|
7391
7391
|
text: c(),
|
|
7392
7392
|
reasoning_details: I(Pt)
|
|
7393
|
-
}).transform((e) => e.reasoning_details.filter(
|
|
7393
|
+
}).transform((e) => e.reasoning_details.filter(Cr))
|
|
7394
7394
|
]);
|
|
7395
|
-
var
|
|
7395
|
+
var rr = v({
|
|
7396
7396
|
error: v({
|
|
7397
7397
|
code: D([c(), R()]).nullable().optional().default(null),
|
|
7398
7398
|
message: c(),
|
|
7399
7399
|
type: c().nullable().optional().default(null),
|
|
7400
7400
|
param: Oe().nullable().optional().default(null)
|
|
7401
7401
|
}).passthrough()
|
|
7402
|
-
}).passthrough(), bt =
|
|
7403
|
-
errorSchema:
|
|
7402
|
+
}).passthrough(), bt = sp({
|
|
7403
|
+
errorSchema: rr,
|
|
7404
7404
|
errorToMessage: (e) => e.error.message
|
|
7405
7405
|
}), ks = v({
|
|
7406
7406
|
type: C("file"),
|
|
@@ -7414,7 +7414,7 @@ var tr = v({
|
|
|
7414
7414
|
}).passthrough()
|
|
7415
7415
|
).optional()
|
|
7416
7416
|
}).passthrough()
|
|
7417
|
-
}),
|
|
7417
|
+
}), fp = v({
|
|
7418
7418
|
provider: c(),
|
|
7419
7419
|
reasoning_details: I(na).optional(),
|
|
7420
7420
|
annotations: I(ks).optional(),
|
|
@@ -7465,13 +7465,13 @@ function sa({
|
|
|
7465
7465
|
return !1;
|
|
7466
7466
|
}
|
|
7467
7467
|
}
|
|
7468
|
-
function
|
|
7468
|
+
function Br({
|
|
7469
7469
|
part: e,
|
|
7470
7470
|
defaultMediaType: t
|
|
7471
7471
|
}) {
|
|
7472
7472
|
var r, a;
|
|
7473
7473
|
if (e.data instanceof Uint8Array) {
|
|
7474
|
-
const n =
|
|
7474
|
+
const n = lp(e.data);
|
|
7475
7475
|
return `data:${(r = e.mediaType) != null ? r : t};base64,${n}`;
|
|
7476
7476
|
}
|
|
7477
7477
|
const o = e.data.toString();
|
|
@@ -7485,12 +7485,12 @@ function hn(e, t) {
|
|
|
7485
7485
|
const a = e.match(/^data:([^;]+)/);
|
|
7486
7486
|
return a && (r = a[1]) != null ? r : t;
|
|
7487
7487
|
}
|
|
7488
|
-
function
|
|
7488
|
+
function Hr(e) {
|
|
7489
7489
|
const t = e.match(/^data:[^;]*;base64,(.+)$/);
|
|
7490
7490
|
return t ? t[1] : e;
|
|
7491
7491
|
}
|
|
7492
|
-
function
|
|
7493
|
-
const t =
|
|
7492
|
+
function hp(e) {
|
|
7493
|
+
const t = Br({
|
|
7494
7494
|
part: e,
|
|
7495
7495
|
defaultMediaType: "audio/mpeg"
|
|
7496
7496
|
});
|
|
@@ -7510,7 +7510,7 @@ The AI SDK will automatically handle base64 encoding.
|
|
|
7510
7510
|
|
|
7511
7511
|
Learn more: https://openrouter.ai/docs/features/multimodal/audio`
|
|
7512
7512
|
);
|
|
7513
|
-
const r =
|
|
7513
|
+
const r = Hr(t), a = e.mediaType || "audio/mpeg";
|
|
7514
7514
|
let o = a.replace("audio/", "");
|
|
7515
7515
|
if (o === "mpeg" || o === "mp3" ? o = "mp3" : (o === "x-wav" || o === "wave" || o === "wav") && (o = "wav"), o !== "mp3" && o !== "wav")
|
|
7516
7516
|
throw new Error(
|
|
@@ -7529,7 +7529,7 @@ function Ne(e) {
|
|
|
7529
7529
|
const o = e?.anthropic, n = e?.openrouter;
|
|
7530
7530
|
return (a = (r = (t = n?.cacheControl) != null ? t : n?.cache_control) != null ? r : o?.cacheControl) != null ? a : o?.cache_control;
|
|
7531
7531
|
}
|
|
7532
|
-
function
|
|
7532
|
+
function mp(e) {
|
|
7533
7533
|
var t, r, a, o, n, i, s, u, l, d;
|
|
7534
7534
|
const p = [];
|
|
7535
7535
|
for (const { role: m, content: f, providerOptions: h } of e)
|
|
@@ -7574,7 +7574,7 @@ function hp(e) {
|
|
|
7574
7574
|
return {
|
|
7575
7575
|
type: "image_url",
|
|
7576
7576
|
image_url: {
|
|
7577
|
-
url:
|
|
7577
|
+
url: Br({
|
|
7578
7578
|
part: _,
|
|
7579
7579
|
defaultMediaType: "image/jpeg"
|
|
7580
7580
|
})
|
|
@@ -7585,12 +7585,12 @@ function hp(e) {
|
|
|
7585
7585
|
if ((g = _.mediaType) != null && g.startsWith("audio/"))
|
|
7586
7586
|
return {
|
|
7587
7587
|
type: "input_audio",
|
|
7588
|
-
input_audio:
|
|
7588
|
+
input_audio: hp(_),
|
|
7589
7589
|
cache_control: U
|
|
7590
7590
|
};
|
|
7591
7591
|
const z = String(
|
|
7592
7592
|
(k = (E = (A = (x = _.providerOptions) == null ? void 0 : x.openrouter) == null ? void 0 : A.filename) != null ? E : _.filename) != null ? k : ""
|
|
7593
|
-
), ee =
|
|
7593
|
+
), ee = Br({
|
|
7594
7594
|
part: _,
|
|
7595
7595
|
defaultMediaType: "application/pdf"
|
|
7596
7596
|
});
|
|
@@ -7673,7 +7673,7 @@ function hp(e) {
|
|
|
7673
7673
|
}
|
|
7674
7674
|
case "tool": {
|
|
7675
7675
|
for (const y of f) {
|
|
7676
|
-
const w =
|
|
7676
|
+
const w = gp(y);
|
|
7677
7677
|
p.push({
|
|
7678
7678
|
role: "tool",
|
|
7679
7679
|
tool_call_id: y.toolCallId,
|
|
@@ -7686,7 +7686,7 @@ function hp(e) {
|
|
|
7686
7686
|
}
|
|
7687
7687
|
return p;
|
|
7688
7688
|
}
|
|
7689
|
-
function
|
|
7689
|
+
function gp(e) {
|
|
7690
7690
|
return e.output.type === "text" ? e.output.value : JSON.stringify(e.output.value);
|
|
7691
7691
|
}
|
|
7692
7692
|
D([
|
|
@@ -7700,7 +7700,7 @@ D([
|
|
|
7700
7700
|
})
|
|
7701
7701
|
})
|
|
7702
7702
|
]);
|
|
7703
|
-
function
|
|
7703
|
+
function vp(e) {
|
|
7704
7704
|
switch (e.type) {
|
|
7705
7705
|
case "auto":
|
|
7706
7706
|
case "none":
|
|
@@ -7718,15 +7718,15 @@ function gp(e) {
|
|
|
7718
7718
|
});
|
|
7719
7719
|
}
|
|
7720
7720
|
}
|
|
7721
|
-
var
|
|
7721
|
+
var yp = v({
|
|
7722
7722
|
type: C("image_url"),
|
|
7723
7723
|
image_url: v({
|
|
7724
7724
|
url: c()
|
|
7725
7725
|
}).passthrough()
|
|
7726
|
-
}).passthrough(),
|
|
7727
|
-
|
|
7726
|
+
}).passthrough(), _p = D([
|
|
7727
|
+
yp,
|
|
7728
7728
|
Re().transform(() => null)
|
|
7729
|
-
]), Os = I(
|
|
7729
|
+
]), Os = I(_p).transform((e) => e.filter((t) => !!t)), Ps = v({
|
|
7730
7730
|
id: c().optional(),
|
|
7731
7731
|
model: c().optional(),
|
|
7732
7732
|
provider: c().optional(),
|
|
@@ -7745,7 +7745,7 @@ var vp = v({
|
|
|
7745
7745
|
upstream_inference_cost: R().nullish()
|
|
7746
7746
|
}).passthrough().nullish()
|
|
7747
7747
|
}).passthrough().nullish()
|
|
7748
|
-
}).passthrough(),
|
|
7748
|
+
}).passthrough(), wp = D([
|
|
7749
7749
|
// Success response with choices
|
|
7750
7750
|
Ps.extend({
|
|
7751
7751
|
choices: I(
|
|
@@ -7824,15 +7824,15 @@ var vp = v({
|
|
|
7824
7824
|
)
|
|
7825
7825
|
}),
|
|
7826
7826
|
// Error response (HTTP 200 with error payload)
|
|
7827
|
-
|
|
7827
|
+
rr.extend({
|
|
7828
7828
|
user_id: c().optional()
|
|
7829
7829
|
})
|
|
7830
|
-
]),
|
|
7830
|
+
]), bp = D([
|
|
7831
7831
|
Ps.extend({
|
|
7832
7832
|
choices: I(
|
|
7833
7833
|
v({
|
|
7834
7834
|
delta: v({
|
|
7835
|
-
role:
|
|
7835
|
+
role: Kt(["assistant"]).optional(),
|
|
7836
7836
|
content: c().nullish(),
|
|
7837
7837
|
reasoning: c().nullish().optional(),
|
|
7838
7838
|
reasoning_details: oa.nullish(),
|
|
@@ -7905,8 +7905,8 @@ var vp = v({
|
|
|
7905
7905
|
}).passthrough()
|
|
7906
7906
|
)
|
|
7907
7907
|
}),
|
|
7908
|
-
|
|
7909
|
-
]),
|
|
7908
|
+
rr
|
|
7909
|
+
]), Tp = class {
|
|
7910
7910
|
constructor(e, t, r) {
|
|
7911
7911
|
this.specificationVersion = "v2", this.provider = "openrouter", this.defaultObjectGenerationMode = "tool", this.supportsImageUrls = !0, this.supportedUrls = {
|
|
7912
7912
|
"image/*": [
|
|
@@ -7962,7 +7962,7 @@ var vp = v({
|
|
|
7962
7962
|
} : { type: "json_object" } : void 0,
|
|
7963
7963
|
top_k: l,
|
|
7964
7964
|
// messages:
|
|
7965
|
-
messages:
|
|
7965
|
+
messages: mp(e),
|
|
7966
7966
|
// OpenRouter specific settings:
|
|
7967
7967
|
include_reasoning: this.settings.includeReasoning,
|
|
7968
7968
|
reasoning: this.settings.reasoning,
|
|
@@ -7988,7 +7988,7 @@ var vp = v({
|
|
|
7988
7988
|
}));
|
|
7989
7989
|
return Vt(B({}, f), {
|
|
7990
7990
|
tools: h,
|
|
7991
|
-
tool_choice: p ?
|
|
7991
|
+
tool_choice: p ? vp(p) : void 0
|
|
7992
7992
|
});
|
|
7993
7993
|
}
|
|
7994
7994
|
return f;
|
|
@@ -8004,7 +8004,7 @@ var vp = v({
|
|
|
8004
8004
|
body: z,
|
|
8005
8005
|
failedResponseHandler: bt,
|
|
8006
8006
|
successfulResponseHandler: ra(
|
|
8007
|
-
|
|
8007
|
+
wp
|
|
8008
8008
|
),
|
|
8009
8009
|
abortSignal: e.abortSignal,
|
|
8010
8010
|
fetch: this.config.fetch
|
|
@@ -8110,7 +8110,7 @@ var vp = v({
|
|
|
8110
8110
|
de.push({
|
|
8111
8111
|
type: "file",
|
|
8112
8112
|
mediaType: hn(O.image_url.url, "image/jpeg"),
|
|
8113
|
-
data:
|
|
8113
|
+
data: Hr(O.image_url.url)
|
|
8114
8114
|
});
|
|
8115
8115
|
if (L.message.annotations)
|
|
8116
8116
|
for (const O of L.message.annotations)
|
|
@@ -8135,7 +8135,7 @@ var vp = v({
|
|
|
8135
8135
|
usage: Te,
|
|
8136
8136
|
warnings: [],
|
|
8137
8137
|
providerMetadata: {
|
|
8138
|
-
openrouter:
|
|
8138
|
+
openrouter: fp.parse({
|
|
8139
8139
|
provider: (m = Z.provider) != null ? m : "",
|
|
8140
8140
|
reasoning_details: (f = L.message.reasoning_details) != null ? f : [],
|
|
8141
8141
|
annotations: q && q.length > 0 ? q : void 0,
|
|
@@ -8184,7 +8184,7 @@ var vp = v({
|
|
|
8184
8184
|
}),
|
|
8185
8185
|
failedResponseHandler: bt,
|
|
8186
8186
|
successfulResponseHandler: Cs(
|
|
8187
|
-
|
|
8187
|
+
bp
|
|
8188
8188
|
),
|
|
8189
8189
|
abortSignal: e.abortSignal,
|
|
8190
8190
|
fetch: this.config.fetch
|
|
@@ -8339,7 +8339,7 @@ var vp = v({
|
|
|
8339
8339
|
data: { index: j, toolCallsLength: s.length },
|
|
8340
8340
|
message: `Tool call at index ${j} is missing after creation.`
|
|
8341
8341
|
});
|
|
8342
|
-
((z = ae.function) == null ? void 0 : z.name) != null && ((ee = ae.function) == null ? void 0 : ee.arguments) != null &&
|
|
8342
|
+
((z = ae.function) == null ? void 0 : z.name) != null && ((ee = ae.function) == null ? void 0 : ee.arguments) != null && Rr(ae.function.arguments) && (ae.inputStarted = !0, b.enqueue({
|
|
8343
8343
|
type: "tool-input-start",
|
|
8344
8344
|
id: ae.id,
|
|
8345
8345
|
toolName: ae.function.name
|
|
@@ -8381,7 +8381,7 @@ var vp = v({
|
|
|
8381
8381
|
type: "tool-input-delta",
|
|
8382
8382
|
id: F.id,
|
|
8383
8383
|
delta: (Te = N.function.arguments) != null ? Te : ""
|
|
8384
|
-
}), ((Ie = F.function) == null ? void 0 : Ie.name) != null && ((Me = F.function) == null ? void 0 : Me.arguments) != null &&
|
|
8384
|
+
}), ((Ie = F.function) == null ? void 0 : Ie.name) != null && ((Me = F.function) == null ? void 0 : Me.arguments) != null && Rr(F.function.arguments) && (b.enqueue({
|
|
8385
8385
|
type: "tool-call",
|
|
8386
8386
|
toolCallId: (de = F.id) != null ? de : ye(),
|
|
8387
8387
|
toolName: F.function.name,
|
|
@@ -8398,7 +8398,7 @@ var vp = v({
|
|
|
8398
8398
|
b.enqueue({
|
|
8399
8399
|
type: "file",
|
|
8400
8400
|
mediaType: hn(N.image_url.url, "image/jpeg"),
|
|
8401
|
-
data:
|
|
8401
|
+
data: Hr(N.image_url.url)
|
|
8402
8402
|
});
|
|
8403
8403
|
},
|
|
8404
8404
|
flush(T) {
|
|
@@ -8410,7 +8410,7 @@ var vp = v({
|
|
|
8410
8410
|
toolCallId: (b = x.id) != null ? b : ye(),
|
|
8411
8411
|
toolName: x.function.name,
|
|
8412
8412
|
// Coerce invalid arguments to an empty JSON object
|
|
8413
|
-
input:
|
|
8413
|
+
input: Rr(x.function.arguments) ? x.function.arguments : "{}",
|
|
8414
8414
|
providerMetadata: {
|
|
8415
8415
|
openrouter: {
|
|
8416
8416
|
reasoning_details: p
|
|
@@ -8444,7 +8444,7 @@ var vp = v({
|
|
|
8444
8444
|
};
|
|
8445
8445
|
}
|
|
8446
8446
|
};
|
|
8447
|
-
function
|
|
8447
|
+
function Ip({
|
|
8448
8448
|
prompt: e,
|
|
8449
8449
|
inputFormat: t,
|
|
8450
8450
|
user: r = "user",
|
|
@@ -8459,7 +8459,7 @@ function Tp({
|
|
|
8459
8459
|
for (const { role: n, content: i } of e)
|
|
8460
8460
|
switch (n) {
|
|
8461
8461
|
case "system":
|
|
8462
|
-
throw new
|
|
8462
|
+
throw new Od({
|
|
8463
8463
|
message: `Unexpected system message in prompt: ${i}`,
|
|
8464
8464
|
prompt: e
|
|
8465
8465
|
});
|
|
@@ -8559,8 +8559,8 @@ var mn = D([
|
|
|
8559
8559
|
}).passthrough().nullish()
|
|
8560
8560
|
}).passthrough().nullish()
|
|
8561
8561
|
}).passthrough(),
|
|
8562
|
-
|
|
8563
|
-
]),
|
|
8562
|
+
rr
|
|
8563
|
+
]), Sp = class {
|
|
8564
8564
|
constructor(e, t, r) {
|
|
8565
8565
|
this.specificationVersion = "v2", this.provider = "openrouter", this.supportsImageUrls = !0, this.supportedUrls = {
|
|
8566
8566
|
"image/*": [
|
|
@@ -8585,7 +8585,7 @@ var mn = D([
|
|
|
8585
8585
|
tools: d,
|
|
8586
8586
|
toolChoice: p
|
|
8587
8587
|
}) {
|
|
8588
|
-
const { prompt: m } =
|
|
8588
|
+
const { prompt: m } = Ip({
|
|
8589
8589
|
prompt: e,
|
|
8590
8590
|
inputFormat: "prompt"
|
|
8591
8591
|
});
|
|
@@ -8765,21 +8765,21 @@ var mn = D([
|
|
|
8765
8765
|
}
|
|
8766
8766
|
};
|
|
8767
8767
|
}
|
|
8768
|
-
},
|
|
8768
|
+
}, Ep = v({
|
|
8769
8769
|
prompt_tokens: R(),
|
|
8770
8770
|
total_tokens: R(),
|
|
8771
8771
|
cost: R().optional()
|
|
8772
|
-
}),
|
|
8772
|
+
}), xp = v({
|
|
8773
8773
|
object: C("embedding"),
|
|
8774
8774
|
embedding: I(R()),
|
|
8775
8775
|
index: R().optional()
|
|
8776
|
-
}),
|
|
8776
|
+
}), Rp = v({
|
|
8777
8777
|
id: c().optional(),
|
|
8778
8778
|
object: C("list"),
|
|
8779
|
-
data: I(
|
|
8779
|
+
data: I(xp),
|
|
8780
8780
|
model: c(),
|
|
8781
|
-
usage:
|
|
8782
|
-
}),
|
|
8781
|
+
usage: Ep.optional()
|
|
8782
|
+
}), Cp = class {
|
|
8783
8783
|
constructor(e, t, r) {
|
|
8784
8784
|
this.specificationVersion = "v2", this.provider = "openrouter", this.maxEmbeddingsPerCall = void 0, this.supportsParallelCalls = !0, this.modelId = e, this.settings = t, this.config = r;
|
|
8785
8785
|
}
|
|
@@ -8799,7 +8799,7 @@ var mn = D([
|
|
|
8799
8799
|
body: n,
|
|
8800
8800
|
failedResponseHandler: bt,
|
|
8801
8801
|
successfulResponseHandler: ra(
|
|
8802
|
-
|
|
8802
|
+
Rp
|
|
8803
8803
|
),
|
|
8804
8804
|
abortSignal: a,
|
|
8805
8805
|
fetch: this.config.fetch
|
|
@@ -8821,25 +8821,25 @@ var mn = D([
|
|
|
8821
8821
|
};
|
|
8822
8822
|
}
|
|
8823
8823
|
};
|
|
8824
|
-
function
|
|
8824
|
+
function Ap(e) {
|
|
8825
8825
|
return Object.fromEntries(
|
|
8826
8826
|
Object.entries(e).filter(([, t]) => t !== null)
|
|
8827
8827
|
);
|
|
8828
8828
|
}
|
|
8829
|
-
function
|
|
8830
|
-
const r =
|
|
8829
|
+
function kp(e, ...t) {
|
|
8830
|
+
const r = Ap(
|
|
8831
8831
|
e ?? {}
|
|
8832
8832
|
), o = [r["user-agent"] || "", ...t].filter(Boolean).join(" ");
|
|
8833
8833
|
return Vt(B({}, r), {
|
|
8834
8834
|
"user-agent": o
|
|
8835
8835
|
});
|
|
8836
8836
|
}
|
|
8837
|
-
var
|
|
8837
|
+
var Op = "1.4.1";
|
|
8838
8838
|
function Ms(e = {}) {
|
|
8839
8839
|
var t, r, a;
|
|
8840
|
-
const o = (r =
|
|
8840
|
+
const o = (r = up((t = e.baseURL) != null ? t : e.baseUrl)) != null ? r : "https://openrouter.ai/api/v1", n = (a = e.compatibility) != null ? a : "compatible", i = () => kp(
|
|
8841
8841
|
B(B({
|
|
8842
|
-
Authorization: `Bearer ${
|
|
8842
|
+
Authorization: `Bearer ${Jd({
|
|
8843
8843
|
apiKey: e.apiKey,
|
|
8844
8844
|
environmentVariableName: "OPENROUTER_API_KEY",
|
|
8845
8845
|
description: "OpenRouter"
|
|
@@ -8847,22 +8847,22 @@ function Ms(e = {}) {
|
|
|
8847
8847
|
}, e.headers), e.api_keys && Object.keys(e.api_keys).length > 0 && {
|
|
8848
8848
|
"X-Provider-API-Keys": JSON.stringify(e.api_keys)
|
|
8849
8849
|
}),
|
|
8850
|
-
`ai-sdk/openrouter/${
|
|
8851
|
-
), s = (m, f = {}) => new
|
|
8850
|
+
`ai-sdk/openrouter/${Op}`
|
|
8851
|
+
), s = (m, f = {}) => new Tp(m, f, {
|
|
8852
8852
|
provider: "openrouter.chat",
|
|
8853
8853
|
url: ({ path: h }) => `${o}${h}`,
|
|
8854
8854
|
headers: i,
|
|
8855
8855
|
compatibility: n,
|
|
8856
8856
|
fetch: e.fetch,
|
|
8857
8857
|
extraBody: e.extraBody
|
|
8858
|
-
}), u = (m, f = {}) => new
|
|
8858
|
+
}), u = (m, f = {}) => new Sp(m, f, {
|
|
8859
8859
|
provider: "openrouter.completion",
|
|
8860
8860
|
url: ({ path: h }) => `${o}${h}`,
|
|
8861
8861
|
headers: i,
|
|
8862
8862
|
compatibility: n,
|
|
8863
8863
|
fetch: e.fetch,
|
|
8864
8864
|
extraBody: e.extraBody
|
|
8865
|
-
}), l = (m, f = {}) => new
|
|
8865
|
+
}), l = (m, f = {}) => new Cp(m, f, {
|
|
8866
8866
|
provider: "openrouter.embedding",
|
|
8867
8867
|
url: ({ path: h }) => `${o}${h}`,
|
|
8868
8868
|
headers: i,
|
|
@@ -8886,36 +8886,36 @@ Ms({
|
|
|
8886
8886
|
});
|
|
8887
8887
|
let ia;
|
|
8888
8888
|
ia = globalThis.crypto;
|
|
8889
|
-
async function
|
|
8889
|
+
async function Pp(e) {
|
|
8890
8890
|
return (await ia).getRandomValues(new Uint8Array(e));
|
|
8891
8891
|
}
|
|
8892
|
-
async function
|
|
8892
|
+
async function Mp(e) {
|
|
8893
8893
|
const t = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~", r = Math.pow(2, 8) - Math.pow(2, 8) % t.length;
|
|
8894
8894
|
let a = "";
|
|
8895
8895
|
for (; a.length < e; ) {
|
|
8896
|
-
const o = await
|
|
8896
|
+
const o = await Pp(e - a.length);
|
|
8897
8897
|
for (const n of o)
|
|
8898
8898
|
n < r && (a += t[n % t.length]);
|
|
8899
8899
|
}
|
|
8900
8900
|
return a;
|
|
8901
8901
|
}
|
|
8902
|
-
async function Mp(e) {
|
|
8903
|
-
return await Pp(e);
|
|
8904
|
-
}
|
|
8905
8902
|
async function Np(e) {
|
|
8903
|
+
return await Mp(e);
|
|
8904
|
+
}
|
|
8905
|
+
async function $p(e) {
|
|
8906
8906
|
const t = await (await ia).subtle.digest("SHA-256", new TextEncoder().encode(e));
|
|
8907
8907
|
return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g, "_").replace(/\+/g, "-").replace(/=/g, "");
|
|
8908
8908
|
}
|
|
8909
|
-
async function
|
|
8909
|
+
async function Up(e) {
|
|
8910
8910
|
if (e || (e = 43), e < 43 || e > 128)
|
|
8911
8911
|
throw `Expected a length between 43 and 128. Received ${e}.`;
|
|
8912
|
-
const t = await
|
|
8912
|
+
const t = await Np(e), r = await $p(t);
|
|
8913
8913
|
return {
|
|
8914
8914
|
code_verifier: t,
|
|
8915
8915
|
code_challenge: r
|
|
8916
8916
|
};
|
|
8917
8917
|
}
|
|
8918
|
-
var
|
|
8918
|
+
var Dp = "AI_MCPClientError", Ns = `vercel.ai.error.${Dp}`, jp = Symbol.for(Ns), gn, vn, H = class extends (vn = J, gn = jp, vn) {
|
|
8919
8919
|
constructor({
|
|
8920
8920
|
name: e = "MCPClientError",
|
|
8921
8921
|
message: t,
|
|
@@ -8928,21 +8928,21 @@ var Up = "AI_MCPClientError", Ns = `vercel.ai.error.${Up}`, Dp = Symbol.for(Ns),
|
|
|
8928
8928
|
static isInstance(e) {
|
|
8929
8929
|
return J.hasMarker(e, Ns);
|
|
8930
8930
|
}
|
|
8931
|
-
}, Qe = "2025-06-18",
|
|
8931
|
+
}, Qe = "2025-06-18", qp = [
|
|
8932
8932
|
Qe,
|
|
8933
8933
|
"2025-03-26",
|
|
8934
8934
|
"2024-11-05"
|
|
8935
|
-
],
|
|
8935
|
+
], Lp = ze({
|
|
8936
8936
|
name: c(),
|
|
8937
8937
|
version: c()
|
|
8938
|
-
}),
|
|
8938
|
+
}), ar = ze({
|
|
8939
8939
|
_meta: $(v({}).loose())
|
|
8940
|
-
}), Pe =
|
|
8940
|
+
}), Pe = ar, $s = v({
|
|
8941
8941
|
method: c(),
|
|
8942
|
-
params: $(
|
|
8942
|
+
params: $(ar)
|
|
8943
8943
|
}), Us = v({
|
|
8944
8944
|
applyDefaults: $(_e())
|
|
8945
|
-
}).loose(),
|
|
8945
|
+
}).loose(), Vp = ze({
|
|
8946
8946
|
experimental: $(v({}).loose()),
|
|
8947
8947
|
logging: $(v({}).loose()),
|
|
8948
8948
|
prompts: $(
|
|
@@ -8966,22 +8966,22 @@ var Up = "AI_MCPClientError", Ns = `vercel.ai.error.${Up}`, Dp = Symbol.for(Ns),
|
|
|
8966
8966
|
v({
|
|
8967
8967
|
elicitation: $(Us)
|
|
8968
8968
|
}).loose();
|
|
8969
|
-
var
|
|
8969
|
+
var Fp = Pe.extend({
|
|
8970
8970
|
protocolVersion: c(),
|
|
8971
|
-
capabilities:
|
|
8972
|
-
serverInfo:
|
|
8971
|
+
capabilities: Vp,
|
|
8972
|
+
serverInfo: Lp,
|
|
8973
8973
|
instructions: $(c())
|
|
8974
8974
|
}), la = Pe.extend({
|
|
8975
8975
|
nextCursor: $(c())
|
|
8976
|
-
}),
|
|
8976
|
+
}), Bp = v({
|
|
8977
8977
|
name: c(),
|
|
8978
8978
|
description: $(c()),
|
|
8979
8979
|
inputSchema: v({
|
|
8980
8980
|
type: C("object"),
|
|
8981
8981
|
properties: $(v({}).loose())
|
|
8982
8982
|
}).loose()
|
|
8983
|
-
}).loose(),
|
|
8984
|
-
tools: I(
|
|
8983
|
+
}).loose(), Hp = la.extend({
|
|
8984
|
+
tools: I(Bp)
|
|
8985
8985
|
}), Ds = v({
|
|
8986
8986
|
type: C("text"),
|
|
8987
8987
|
text: c()
|
|
@@ -8989,15 +8989,15 @@ var Vp = Pe.extend({
|
|
|
8989
8989
|
type: C("image"),
|
|
8990
8990
|
data: Sn(),
|
|
8991
8991
|
mimeType: c()
|
|
8992
|
-
}).loose(),
|
|
8992
|
+
}).loose(), Gp = v({
|
|
8993
8993
|
uri: c(),
|
|
8994
8994
|
name: c(),
|
|
8995
8995
|
title: $(c()),
|
|
8996
8996
|
description: $(c()),
|
|
8997
8997
|
mimeType: $(c()),
|
|
8998
8998
|
size: $(R())
|
|
8999
|
-
}).loose(),
|
|
9000
|
-
resources: I(
|
|
8999
|
+
}).loose(), Jp = la.extend({
|
|
9000
|
+
resources: I(Gp)
|
|
9001
9001
|
}), qs = v({
|
|
9002
9002
|
/**
|
|
9003
9003
|
* The URI of this resource.
|
|
@@ -9022,7 +9022,7 @@ var Vp = Pe.extend({
|
|
|
9022
9022
|
}), Fs = v({
|
|
9023
9023
|
type: C("resource"),
|
|
9024
9024
|
resource: D([Ls, Vs])
|
|
9025
|
-
}).loose(),
|
|
9025
|
+
}).loose(), Zp = Pe.extend({
|
|
9026
9026
|
content: I(
|
|
9027
9027
|
D([Ds, js, Fs])
|
|
9028
9028
|
),
|
|
@@ -9031,79 +9031,79 @@ var Vp = Pe.extend({
|
|
|
9031
9031
|
Pe.extend({
|
|
9032
9032
|
toolResult: Re()
|
|
9033
9033
|
})
|
|
9034
|
-
),
|
|
9034
|
+
), zp = v({
|
|
9035
9035
|
uriTemplate: c(),
|
|
9036
9036
|
name: c(),
|
|
9037
9037
|
title: $(c()),
|
|
9038
9038
|
description: $(c()),
|
|
9039
9039
|
mimeType: $(c())
|
|
9040
|
-
}).loose(),
|
|
9041
|
-
resourceTemplates: I(
|
|
9042
|
-
}),
|
|
9040
|
+
}).loose(), Wp = Pe.extend({
|
|
9041
|
+
resourceTemplates: I(zp)
|
|
9042
|
+
}), Kp = Pe.extend({
|
|
9043
9043
|
contents: I(
|
|
9044
9044
|
D([Ls, Vs])
|
|
9045
9045
|
)
|
|
9046
|
-
}),
|
|
9046
|
+
}), Yp = v({
|
|
9047
9047
|
name: c(),
|
|
9048
9048
|
description: $(c()),
|
|
9049
9049
|
required: $(_e())
|
|
9050
|
-
}).loose(),
|
|
9050
|
+
}).loose(), Xp = v({
|
|
9051
9051
|
name: c(),
|
|
9052
9052
|
title: $(c()),
|
|
9053
9053
|
description: $(c()),
|
|
9054
|
-
arguments: $(I(
|
|
9055
|
-
}).loose(),
|
|
9056
|
-
prompts: I(
|
|
9057
|
-
}),
|
|
9054
|
+
arguments: $(I(Yp))
|
|
9055
|
+
}).loose(), Qp = la.extend({
|
|
9056
|
+
prompts: I(Xp)
|
|
9057
|
+
}), ef = v({
|
|
9058
9058
|
role: D([C("user"), C("assistant")]),
|
|
9059
9059
|
content: D([
|
|
9060
9060
|
Ds,
|
|
9061
9061
|
js,
|
|
9062
9062
|
Fs
|
|
9063
9063
|
])
|
|
9064
|
-
}).loose(),
|
|
9064
|
+
}).loose(), tf = Pe.extend({
|
|
9065
9065
|
description: $(c()),
|
|
9066
|
-
messages: I(
|
|
9067
|
-
}),
|
|
9066
|
+
messages: I(ef)
|
|
9067
|
+
}), rf = ar.extend({
|
|
9068
9068
|
message: c(),
|
|
9069
9069
|
requestedSchema: Re()
|
|
9070
9070
|
}), yn = $s.extend({
|
|
9071
9071
|
method: C("elicitation/create"),
|
|
9072
|
-
params:
|
|
9073
|
-
}),
|
|
9072
|
+
params: rf
|
|
9073
|
+
}), af = Pe.extend({
|
|
9074
9074
|
action: D([
|
|
9075
9075
|
C("accept"),
|
|
9076
9076
|
C("decline"),
|
|
9077
9077
|
C("cancel")
|
|
9078
9078
|
]),
|
|
9079
9079
|
content: $(De(c(), Re()))
|
|
9080
|
-
}),
|
|
9081
|
-
jsonrpc: C(
|
|
9080
|
+
}), nr = "2.0", nf = v({
|
|
9081
|
+
jsonrpc: C(nr),
|
|
9082
9082
|
id: D([c(), R().int()])
|
|
9083
|
-
}).merge($s).strict(),
|
|
9084
|
-
jsonrpc: C(
|
|
9083
|
+
}).merge($s).strict(), of = v({
|
|
9084
|
+
jsonrpc: C(nr),
|
|
9085
9085
|
id: D([c(), R().int()]),
|
|
9086
9086
|
result: Pe
|
|
9087
|
-
}).strict(),
|
|
9088
|
-
jsonrpc: C(
|
|
9087
|
+
}).strict(), sf = v({
|
|
9088
|
+
jsonrpc: C(nr),
|
|
9089
9089
|
id: D([c(), R().int()]),
|
|
9090
9090
|
error: v({
|
|
9091
9091
|
code: R().int(),
|
|
9092
9092
|
message: c(),
|
|
9093
9093
|
data: $(Re())
|
|
9094
9094
|
})
|
|
9095
|
-
}).strict(),
|
|
9096
|
-
jsonrpc: C(
|
|
9095
|
+
}).strict(), lf = v({
|
|
9096
|
+
jsonrpc: C(nr)
|
|
9097
9097
|
}).merge(
|
|
9098
9098
|
v({
|
|
9099
9099
|
method: c(),
|
|
9100
|
-
params: $(
|
|
9100
|
+
params: $(ar)
|
|
9101
9101
|
})
|
|
9102
9102
|
).strict(), lt = D([
|
|
9103
|
-
af,
|
|
9104
|
-
sf,
|
|
9105
9103
|
nf,
|
|
9106
|
-
|
|
9104
|
+
lf,
|
|
9105
|
+
of,
|
|
9106
|
+
sf
|
|
9107
9107
|
]), Bs = typeof __PACKAGE_VERSION__ < "u" ? __PACKAGE_VERSION__ : "0.0.0-test", Hs = v({
|
|
9108
9108
|
access_token: c(),
|
|
9109
9109
|
id_token: c().optional(),
|
|
@@ -9125,7 +9125,7 @@ var Vp = Pe.extend({
|
|
|
9125
9125
|
return t.protocol !== "javascript:" && t.protocol !== "data:" && t.protocol !== "vbscript:";
|
|
9126
9126
|
},
|
|
9127
9127
|
{ message: "URL cannot use javascript:, data:, or vbscript: scheme" }
|
|
9128
|
-
),
|
|
9128
|
+
), uf = v({
|
|
9129
9129
|
resource: c().url(),
|
|
9130
9130
|
authorization_servers: I(ie).optional(),
|
|
9131
9131
|
jwks_uri: c().url().optional(),
|
|
@@ -9151,7 +9151,7 @@ var Vp = Pe.extend({
|
|
|
9151
9151
|
code_challenge_methods_supported: I(c()),
|
|
9152
9152
|
token_endpoint_auth_methods_supported: I(c()).optional(),
|
|
9153
9153
|
token_endpoint_auth_signing_alg_values_supported: I(c()).optional()
|
|
9154
|
-
}).passthrough(),
|
|
9154
|
+
}).passthrough(), cf = v({
|
|
9155
9155
|
issuer: c(),
|
|
9156
9156
|
authorization_endpoint: ie,
|
|
9157
9157
|
token_endpoint: ie,
|
|
@@ -9165,16 +9165,16 @@ var Vp = Pe.extend({
|
|
|
9165
9165
|
id_token_signing_alg_values_supported: I(c()),
|
|
9166
9166
|
claims_supported: I(c()).optional(),
|
|
9167
9167
|
token_endpoint_auth_methods_supported: I(c()).optional()
|
|
9168
|
-
}).passthrough(),
|
|
9168
|
+
}).passthrough(), df = cf.merge(
|
|
9169
9169
|
Gs.pick({
|
|
9170
9170
|
code_challenge_methods_supported: !0
|
|
9171
9171
|
})
|
|
9172
|
-
),
|
|
9172
|
+
), pf = v({
|
|
9173
9173
|
client_id: c(),
|
|
9174
9174
|
client_secret: c().optional(),
|
|
9175
9175
|
client_id_issued_at: R().optional(),
|
|
9176
9176
|
client_secret_expires_at: R().optional()
|
|
9177
|
-
}).strip(),
|
|
9177
|
+
}).strip(), ff = v({
|
|
9178
9178
|
redirect_uris: I(ie),
|
|
9179
9179
|
token_endpoint_auth_method: c().optional(),
|
|
9180
9180
|
grant_types: I(c()).optional(),
|
|
@@ -9191,13 +9191,13 @@ var Vp = Pe.extend({
|
|
|
9191
9191
|
software_id: c().optional(),
|
|
9192
9192
|
software_version: c().optional(),
|
|
9193
9193
|
software_statement: c().optional()
|
|
9194
|
-
}).strip(),
|
|
9194
|
+
}).strip(), hf = v({
|
|
9195
9195
|
error: c(),
|
|
9196
9196
|
error_description: c().optional(),
|
|
9197
9197
|
error_uri: c().optional()
|
|
9198
|
-
}),
|
|
9199
|
-
|
|
9200
|
-
),
|
|
9198
|
+
}), mf = ff.merge(
|
|
9199
|
+
pf
|
|
9200
|
+
), gf = "AI_MCPClientOAuthError", Js = `vercel.ai.error.${gf}`, vf = Symbol.for(Js), _n, wn, St = class extends (wn = J, _n = vf, wn) {
|
|
9201
9201
|
constructor({
|
|
9202
9202
|
name: e = "MCPClientOAuthError",
|
|
9203
9203
|
message: t,
|
|
@@ -9220,17 +9220,17 @@ Gt.errorCode = "invalid_grant";
|
|
|
9220
9220
|
var Jt = class extends St {
|
|
9221
9221
|
};
|
|
9222
9222
|
Jt.errorCode = "unauthorized_client";
|
|
9223
|
-
var
|
|
9223
|
+
var yf = {
|
|
9224
9224
|
[Ye.errorCode]: Ye,
|
|
9225
9225
|
[Ht.errorCode]: Ht,
|
|
9226
9226
|
[Gt.errorCode]: Gt,
|
|
9227
9227
|
[Jt.errorCode]: Jt
|
|
9228
9228
|
};
|
|
9229
|
-
function
|
|
9229
|
+
function _f(e) {
|
|
9230
9230
|
const t = typeof e == "string" ? new URL(e) : new URL(e.href);
|
|
9231
9231
|
return t.hash = "", t;
|
|
9232
9232
|
}
|
|
9233
|
-
function
|
|
9233
|
+
function wf({
|
|
9234
9234
|
requestedResource: e,
|
|
9235
9235
|
configuredResource: t
|
|
9236
9236
|
}) {
|
|
@@ -9261,7 +9261,7 @@ function zt(e) {
|
|
|
9261
9261
|
return;
|
|
9262
9262
|
}
|
|
9263
9263
|
}
|
|
9264
|
-
function
|
|
9264
|
+
function bf(e, t = "", r = {}) {
|
|
9265
9265
|
return t.endsWith("/") && (t = t.slice(0, -1)), r.prependPathname ? `${t}/.well-known/${e}` : `/.well-known/${e}${t}`;
|
|
9266
9266
|
}
|
|
9267
9267
|
async function ua(e, t, r = fetch) {
|
|
@@ -9278,28 +9278,28 @@ async function bn(e, t, r = fetch) {
|
|
|
9278
9278
|
"MCP-Protocol-Version": t
|
|
9279
9279
|
}, r);
|
|
9280
9280
|
}
|
|
9281
|
-
function
|
|
9281
|
+
function Tf(e, t) {
|
|
9282
9282
|
return !e || e.status >= 400 && e.status < 500 && t !== "/";
|
|
9283
9283
|
}
|
|
9284
|
-
async function
|
|
9284
|
+
async function If(e, t, r, a) {
|
|
9285
9285
|
var o, n;
|
|
9286
9286
|
const i = new URL(e), s = (o = a?.protocolVersion) != null ? o : Qe;
|
|
9287
9287
|
let u;
|
|
9288
9288
|
if (a?.metadataUrl)
|
|
9289
9289
|
u = new URL(a.metadataUrl);
|
|
9290
9290
|
else {
|
|
9291
|
-
const d =
|
|
9291
|
+
const d = bf(t, i.pathname);
|
|
9292
9292
|
u = new URL(d, (n = a?.metadataServerUrl) != null ? n : i), u.search = i.search;
|
|
9293
9293
|
}
|
|
9294
9294
|
let l = await bn(u, s, r);
|
|
9295
|
-
if (!a?.metadataUrl &&
|
|
9295
|
+
if (!a?.metadataUrl && Tf(l, i.pathname)) {
|
|
9296
9296
|
const d = new URL(`/.well-known/${t}`, i);
|
|
9297
9297
|
l = await bn(d, s, r);
|
|
9298
9298
|
}
|
|
9299
9299
|
return l;
|
|
9300
9300
|
}
|
|
9301
|
-
async function
|
|
9302
|
-
const a = await
|
|
9301
|
+
async function Sf(e, t, r = fetch) {
|
|
9302
|
+
const a = await If(
|
|
9303
9303
|
e,
|
|
9304
9304
|
"oauth-protected-resource",
|
|
9305
9305
|
r,
|
|
@@ -9316,9 +9316,9 @@ async function If(e, t, r = fetch) {
|
|
|
9316
9316
|
throw new Error(
|
|
9317
9317
|
`HTTP ${a.status} trying to load well-known OAuth protected resource metadata.`
|
|
9318
9318
|
);
|
|
9319
|
-
return
|
|
9319
|
+
return uf.parse(await a.json());
|
|
9320
9320
|
}
|
|
9321
|
-
function
|
|
9321
|
+
function Ef(e) {
|
|
9322
9322
|
const t = typeof e == "string" ? new URL(e) : e, r = t.pathname !== "/", a = [];
|
|
9323
9323
|
if (!r)
|
|
9324
9324
|
return a.push({
|
|
@@ -9346,12 +9346,12 @@ function Sf(e) {
|
|
|
9346
9346
|
type: "oidc"
|
|
9347
9347
|
}), a;
|
|
9348
9348
|
}
|
|
9349
|
-
async function
|
|
9349
|
+
async function xf(e, {
|
|
9350
9350
|
fetchFn: t = fetch,
|
|
9351
9351
|
protocolVersion: r = Qe
|
|
9352
9352
|
} = {}) {
|
|
9353
9353
|
var a;
|
|
9354
|
-
const o = { "MCP-Protocol-Version": r }, n =
|
|
9354
|
+
const o = { "MCP-Protocol-Version": r }, n = Ef(e);
|
|
9355
9355
|
for (const { url: i, type: s } of n) {
|
|
9356
9356
|
const u = await ua(i, o, t);
|
|
9357
9357
|
if (u) {
|
|
@@ -9365,7 +9365,7 @@ async function Ef(e, {
|
|
|
9365
9365
|
if (s === "oauth")
|
|
9366
9366
|
return Gs.parse(await u.json());
|
|
9367
9367
|
{
|
|
9368
|
-
const l =
|
|
9368
|
+
const l = df.parse(
|
|
9369
9369
|
await u.json()
|
|
9370
9370
|
);
|
|
9371
9371
|
if (!((a = l.code_challenge_methods_supported) != null && a.includes("S256")))
|
|
@@ -9377,7 +9377,7 @@ async function Ef(e, {
|
|
|
9377
9377
|
}
|
|
9378
9378
|
}
|
|
9379
9379
|
}
|
|
9380
|
-
async function
|
|
9380
|
+
async function Rf(e, {
|
|
9381
9381
|
metadata: t,
|
|
9382
9382
|
clientInformation: r,
|
|
9383
9383
|
redirectUrl: a,
|
|
@@ -9398,7 +9398,7 @@ async function xf(e, {
|
|
|
9398
9398
|
);
|
|
9399
9399
|
} else
|
|
9400
9400
|
l = new URL("/authorize", e);
|
|
9401
|
-
const d = await
|
|
9401
|
+
const d = await Up(), p = d.code_verifier, m = d.code_challenge;
|
|
9402
9402
|
return l.searchParams.set("response_type", s), l.searchParams.set("client_id", r.client_id), l.searchParams.set("code_challenge", m), l.searchParams.set(
|
|
9403
9403
|
"code_challenge_method",
|
|
9404
9404
|
u
|
|
@@ -9412,19 +9412,19 @@ function zs(e, t, r, a) {
|
|
|
9412
9412
|
const { client_id: o, client_secret: n } = t;
|
|
9413
9413
|
switch (e) {
|
|
9414
9414
|
case "client_secret_basic":
|
|
9415
|
-
|
|
9415
|
+
Cf(o, n, r);
|
|
9416
9416
|
return;
|
|
9417
9417
|
case "client_secret_post":
|
|
9418
|
-
|
|
9418
|
+
Af(o, n, a);
|
|
9419
9419
|
return;
|
|
9420
9420
|
case "none":
|
|
9421
|
-
|
|
9421
|
+
kf(o, a);
|
|
9422
9422
|
return;
|
|
9423
9423
|
default:
|
|
9424
9424
|
throw new Error(`Unsupported client authentication method: ${e}`);
|
|
9425
9425
|
}
|
|
9426
9426
|
}
|
|
9427
|
-
function
|
|
9427
|
+
function Cf(e, t, r) {
|
|
9428
9428
|
if (!t)
|
|
9429
9429
|
throw new Error(
|
|
9430
9430
|
"client_secret_basic authentication requires a client_secret"
|
|
@@ -9432,16 +9432,16 @@ function Rf(e, t, r) {
|
|
|
9432
9432
|
const a = btoa(`${e}:${t}`);
|
|
9433
9433
|
r.set("Authorization", `Basic ${a}`);
|
|
9434
9434
|
}
|
|
9435
|
-
function
|
|
9435
|
+
function Af(e, t, r) {
|
|
9436
9436
|
r.set("client_id", e), t && r.set("client_secret", t);
|
|
9437
9437
|
}
|
|
9438
|
-
function
|
|
9438
|
+
function kf(e, t) {
|
|
9439
9439
|
t.set("client_id", e);
|
|
9440
9440
|
}
|
|
9441
9441
|
async function ca(e) {
|
|
9442
9442
|
const t = e instanceof Response ? e.status : void 0, r = e instanceof Response ? await e.text() : e;
|
|
9443
9443
|
try {
|
|
9444
|
-
const a =
|
|
9444
|
+
const a = hf.parse(JSON.parse(r)), { error: o, error_description: n, error_uri: i } = a, s = yf[o] || Ye;
|
|
9445
9445
|
return new s({
|
|
9446
9446
|
message: n || "",
|
|
9447
9447
|
cause: i
|
|
@@ -9451,7 +9451,7 @@ async function ca(e) {
|
|
|
9451
9451
|
return new Ye({ message: o });
|
|
9452
9452
|
}
|
|
9453
9453
|
}
|
|
9454
|
-
async function
|
|
9454
|
+
async function Of(e, {
|
|
9455
9455
|
metadata: t,
|
|
9456
9456
|
clientInformation: r,
|
|
9457
9457
|
authorizationCode: a,
|
|
@@ -9495,7 +9495,7 @@ async function kf(e, {
|
|
|
9495
9495
|
throw await ca(h);
|
|
9496
9496
|
return Hs.parse(await h.json());
|
|
9497
9497
|
}
|
|
9498
|
-
async function
|
|
9498
|
+
async function Pf(e, {
|
|
9499
9499
|
metadata: t,
|
|
9500
9500
|
clientInformation: r,
|
|
9501
9501
|
refreshToken: a,
|
|
@@ -9541,7 +9541,7 @@ async function Of(e, {
|
|
|
9541
9541
|
...await m.json()
|
|
9542
9542
|
});
|
|
9543
9543
|
}
|
|
9544
|
-
async function
|
|
9544
|
+
async function Mf(e, {
|
|
9545
9545
|
metadata: t,
|
|
9546
9546
|
clientMetadata: r,
|
|
9547
9547
|
fetchFn: a
|
|
@@ -9564,29 +9564,29 @@ async function Pf(e, {
|
|
|
9564
9564
|
});
|
|
9565
9565
|
if (!n.ok)
|
|
9566
9566
|
throw await ca(n);
|
|
9567
|
-
return
|
|
9567
|
+
return mf.parse(await n.json());
|
|
9568
9568
|
}
|
|
9569
9569
|
async function Wt(e, t) {
|
|
9570
9570
|
var r, a;
|
|
9571
9571
|
try {
|
|
9572
|
-
return await
|
|
9572
|
+
return await Ar(e, t);
|
|
9573
9573
|
} catch (o) {
|
|
9574
9574
|
if (o instanceof Ht || o instanceof Jt)
|
|
9575
|
-
return await ((r = e.invalidateCredentials) == null ? void 0 : r.call(e, "all")), await
|
|
9575
|
+
return await ((r = e.invalidateCredentials) == null ? void 0 : r.call(e, "all")), await Ar(e, t);
|
|
9576
9576
|
if (o instanceof Gt)
|
|
9577
|
-
return await ((a = e.invalidateCredentials) == null ? void 0 : a.call(e, "tokens")), await
|
|
9577
|
+
return await ((a = e.invalidateCredentials) == null ? void 0 : a.call(e, "tokens")), await Ar(e, t);
|
|
9578
9578
|
throw o;
|
|
9579
9579
|
}
|
|
9580
9580
|
}
|
|
9581
|
-
async function
|
|
9582
|
-
const a =
|
|
9581
|
+
async function Nf(e, t, r) {
|
|
9582
|
+
const a = _f(e);
|
|
9583
9583
|
if (t.validateResourceURL)
|
|
9584
9584
|
return await t.validateResourceURL(
|
|
9585
9585
|
a,
|
|
9586
9586
|
r?.resource
|
|
9587
9587
|
);
|
|
9588
9588
|
if (r) {
|
|
9589
|
-
if (!
|
|
9589
|
+
if (!wf({
|
|
9590
9590
|
requestedResource: a,
|
|
9591
9591
|
configuredResource: r.resource
|
|
9592
9592
|
}))
|
|
@@ -9596,7 +9596,7 @@ async function Mf(e, t, r) {
|
|
|
9596
9596
|
return new URL(r.resource);
|
|
9597
9597
|
}
|
|
9598
9598
|
}
|
|
9599
|
-
async function
|
|
9599
|
+
async function Ar(e, {
|
|
9600
9600
|
serverUrl: t,
|
|
9601
9601
|
authorizationCode: r,
|
|
9602
9602
|
scope: a,
|
|
@@ -9605,7 +9605,7 @@ async function Cr(e, {
|
|
|
9605
9605
|
}) {
|
|
9606
9606
|
let i, s;
|
|
9607
9607
|
try {
|
|
9608
|
-
i = await
|
|
9608
|
+
i = await Sf(
|
|
9609
9609
|
t,
|
|
9610
9610
|
{ resourceMetadataUrl: o },
|
|
9611
9611
|
n
|
|
@@ -9613,11 +9613,11 @@ async function Cr(e, {
|
|
|
9613
9613
|
} catch {
|
|
9614
9614
|
}
|
|
9615
9615
|
s || (s = t);
|
|
9616
|
-
const u = await
|
|
9616
|
+
const u = await Nf(
|
|
9617
9617
|
t,
|
|
9618
9618
|
e,
|
|
9619
9619
|
i
|
|
9620
|
-
), l = await
|
|
9620
|
+
), l = await xf(
|
|
9621
9621
|
s,
|
|
9622
9622
|
{
|
|
9623
9623
|
fetchFn: n
|
|
@@ -9633,7 +9633,7 @@ async function Cr(e, {
|
|
|
9633
9633
|
throw new Error(
|
|
9634
9634
|
"OAuth client information must be saveable for dynamic registration"
|
|
9635
9635
|
);
|
|
9636
|
-
const y = await
|
|
9636
|
+
const y = await Mf(s, {
|
|
9637
9637
|
metadata: l,
|
|
9638
9638
|
clientMetadata: e.clientMetadata,
|
|
9639
9639
|
fetchFn: n
|
|
@@ -9641,7 +9641,7 @@ async function Cr(e, {
|
|
|
9641
9641
|
await e.saveClientInformation(y), d = y;
|
|
9642
9642
|
}
|
|
9643
9643
|
if (r !== void 0) {
|
|
9644
|
-
const y = await e.codeVerifier(), w = await
|
|
9644
|
+
const y = await e.codeVerifier(), w = await Of(s, {
|
|
9645
9645
|
metadata: l,
|
|
9646
9646
|
clientInformation: d,
|
|
9647
9647
|
authorizationCode: r,
|
|
@@ -9656,7 +9656,7 @@ async function Cr(e, {
|
|
|
9656
9656
|
const p = await e.tokens();
|
|
9657
9657
|
if (p?.refresh_token)
|
|
9658
9658
|
try {
|
|
9659
|
-
const y = await
|
|
9659
|
+
const y = await Pf(s, {
|
|
9660
9660
|
metadata: l,
|
|
9661
9661
|
clientInformation: d,
|
|
9662
9662
|
refreshToken: p.refresh_token,
|
|
@@ -9671,7 +9671,7 @@ async function Cr(e, {
|
|
|
9671
9671
|
!(!(y instanceof St) || y instanceof Ye)
|
|
9672
9672
|
) throw y;
|
|
9673
9673
|
}
|
|
9674
|
-
const m = e.state ? await e.state() : void 0, { authorizationUrl: f, codeVerifier: h } = await
|
|
9674
|
+
const m = e.state ? await e.state() : void 0, { authorizationUrl: f, codeVerifier: h } = await Rf(
|
|
9675
9675
|
s,
|
|
9676
9676
|
{
|
|
9677
9677
|
metadata: l,
|
|
@@ -9684,7 +9684,7 @@ async function Cr(e, {
|
|
|
9684
9684
|
);
|
|
9685
9685
|
return await e.saveCodeVerifier(h), await e.redirectToAuthorization(f), "REDIRECT";
|
|
9686
9686
|
}
|
|
9687
|
-
var
|
|
9687
|
+
var $f = class {
|
|
9688
9688
|
constructor({
|
|
9689
9689
|
url: e,
|
|
9690
9690
|
headers: t,
|
|
@@ -9847,7 +9847,7 @@ var Nf = class {
|
|
|
9847
9847
|
};
|
|
9848
9848
|
await r();
|
|
9849
9849
|
}
|
|
9850
|
-
},
|
|
9850
|
+
}, Uf = class {
|
|
9851
9851
|
constructor({
|
|
9852
9852
|
url: e,
|
|
9853
9853
|
headers: t,
|
|
@@ -10093,35 +10093,35 @@ var Nf = class {
|
|
|
10093
10093
|
}
|
|
10094
10094
|
}
|
|
10095
10095
|
};
|
|
10096
|
-
function
|
|
10096
|
+
function Df(e) {
|
|
10097
10097
|
switch (e.type) {
|
|
10098
10098
|
case "sse":
|
|
10099
|
-
return new Nf(e);
|
|
10100
|
-
case "http":
|
|
10101
10099
|
return new $f(e);
|
|
10100
|
+
case "http":
|
|
10101
|
+
return new Uf(e);
|
|
10102
10102
|
default:
|
|
10103
10103
|
throw new H({
|
|
10104
10104
|
message: "Unsupported or invalid transport configuration. If you are using a custom transport, make sure it implements the MCPTransport interface."
|
|
10105
10105
|
});
|
|
10106
10106
|
}
|
|
10107
10107
|
}
|
|
10108
|
-
function
|
|
10108
|
+
function jf(e) {
|
|
10109
10109
|
return "start" in e && typeof e.start == "function" && "send" in e && typeof e.send == "function" && "close" in e && typeof e.close == "function";
|
|
10110
10110
|
}
|
|
10111
|
-
var
|
|
10112
|
-
async function
|
|
10113
|
-
const t = new
|
|
10111
|
+
var qf = "1.0.0";
|
|
10112
|
+
async function Lf(e) {
|
|
10113
|
+
const t = new Vf(e);
|
|
10114
10114
|
return await t.init(), t;
|
|
10115
10115
|
}
|
|
10116
|
-
var
|
|
10116
|
+
var Vf = class {
|
|
10117
10117
|
constructor({
|
|
10118
10118
|
transport: e,
|
|
10119
10119
|
name: t = "ai-sdk-mcp-client",
|
|
10120
|
-
version: r =
|
|
10120
|
+
version: r = qf,
|
|
10121
10121
|
onUncaughtError: a,
|
|
10122
10122
|
capabilities: o
|
|
10123
10123
|
}) {
|
|
10124
|
-
this.requestMessageId = 0, this.responseHandlers = /* @__PURE__ */ new Map(), this.serverCapabilities = {}, this.isClosed = !0, this.onUncaughtError = a, this.clientCapabilities = o ?? {},
|
|
10124
|
+
this.requestMessageId = 0, this.responseHandlers = /* @__PURE__ */ new Map(), this.serverCapabilities = {}, this.isClosed = !0, this.onUncaughtError = a, this.clientCapabilities = o ?? {}, jf(e) ? this.transport = e : this.transport = Df(e), this.transport.onclose = () => this.onClose(), this.transport.onerror = (n) => this.onError(n), this.transport.onmessage = (n) => {
|
|
10125
10125
|
if ("method" in n) {
|
|
10126
10126
|
"id" in n ? this.onRequestMessage(n) : this.onError(
|
|
10127
10127
|
new H({
|
|
@@ -10148,13 +10148,13 @@ var Lf = class {
|
|
|
10148
10148
|
clientInfo: this.clientInfo
|
|
10149
10149
|
}
|
|
10150
10150
|
},
|
|
10151
|
-
resultSchema:
|
|
10151
|
+
resultSchema: Fp
|
|
10152
10152
|
});
|
|
10153
10153
|
if (e === void 0)
|
|
10154
10154
|
throw new H({
|
|
10155
10155
|
message: "Server sent invalid initialize result"
|
|
10156
10156
|
});
|
|
10157
|
-
if (!
|
|
10157
|
+
if (!qp.includes(e.protocolVersion))
|
|
10158
10158
|
throw new H({
|
|
10159
10159
|
message: `Server's protocol version is not supported: ${e.protocolVersion}`
|
|
10160
10160
|
});
|
|
@@ -10255,7 +10255,7 @@ var Lf = class {
|
|
|
10255
10255
|
try {
|
|
10256
10256
|
return this.request({
|
|
10257
10257
|
request: { method: "tools/list", params: e },
|
|
10258
|
-
resultSchema:
|
|
10258
|
+
resultSchema: Hp,
|
|
10259
10259
|
options: t
|
|
10260
10260
|
});
|
|
10261
10261
|
} catch (r) {
|
|
@@ -10270,7 +10270,7 @@ var Lf = class {
|
|
|
10270
10270
|
try {
|
|
10271
10271
|
return this.request({
|
|
10272
10272
|
request: { method: "tools/call", params: { name: e, arguments: t } },
|
|
10273
|
-
resultSchema:
|
|
10273
|
+
resultSchema: Zp,
|
|
10274
10274
|
options: {
|
|
10275
10275
|
signal: r?.abortSignal
|
|
10276
10276
|
}
|
|
@@ -10286,7 +10286,7 @@ var Lf = class {
|
|
|
10286
10286
|
try {
|
|
10287
10287
|
return this.request({
|
|
10288
10288
|
request: { method: "resources/list", params: e },
|
|
10289
|
-
resultSchema:
|
|
10289
|
+
resultSchema: Jp,
|
|
10290
10290
|
options: t
|
|
10291
10291
|
});
|
|
10292
10292
|
} catch (r) {
|
|
@@ -10300,7 +10300,7 @@ var Lf = class {
|
|
|
10300
10300
|
try {
|
|
10301
10301
|
return this.request({
|
|
10302
10302
|
request: { method: "resources/read", params: { uri: e } },
|
|
10303
|
-
resultSchema:
|
|
10303
|
+
resultSchema: Kp,
|
|
10304
10304
|
options: t
|
|
10305
10305
|
});
|
|
10306
10306
|
} catch (r) {
|
|
@@ -10313,7 +10313,7 @@ var Lf = class {
|
|
|
10313
10313
|
try {
|
|
10314
10314
|
return this.request({
|
|
10315
10315
|
request: { method: "resources/templates/list" },
|
|
10316
|
-
resultSchema:
|
|
10316
|
+
resultSchema: Wp,
|
|
10317
10317
|
options: e
|
|
10318
10318
|
});
|
|
10319
10319
|
} catch (t) {
|
|
@@ -10327,7 +10327,7 @@ var Lf = class {
|
|
|
10327
10327
|
try {
|
|
10328
10328
|
return this.request({
|
|
10329
10329
|
request: { method: "prompts/list", params: e },
|
|
10330
|
-
resultSchema:
|
|
10330
|
+
resultSchema: Qp,
|
|
10331
10331
|
options: t
|
|
10332
10332
|
});
|
|
10333
10333
|
} catch (r) {
|
|
@@ -10342,7 +10342,7 @@ var Lf = class {
|
|
|
10342
10342
|
try {
|
|
10343
10343
|
return this.request({
|
|
10344
10344
|
request: { method: "prompts/get", params: { name: e, arguments: t } },
|
|
10345
|
-
resultSchema:
|
|
10345
|
+
resultSchema: tf,
|
|
10346
10346
|
options: r
|
|
10347
10347
|
});
|
|
10348
10348
|
} catch (a) {
|
|
@@ -10471,7 +10471,7 @@ var Lf = class {
|
|
|
10471
10471
|
return;
|
|
10472
10472
|
}
|
|
10473
10473
|
try {
|
|
10474
|
-
const r = await this.elicitationRequestHandler(t.data), a =
|
|
10474
|
+
const r = await this.elicitationRequestHandler(t.data), a = af.parse(r);
|
|
10475
10475
|
await this.transport.send({
|
|
10476
10476
|
jsonrpc: "2.0",
|
|
10477
10477
|
id: e.id,
|
|
@@ -10522,26 +10522,27 @@ var Lf = class {
|
|
|
10522
10522
|
);
|
|
10523
10523
|
}
|
|
10524
10524
|
};
|
|
10525
|
-
const
|
|
10526
|
-
chat:
|
|
10527
|
-
}),
|
|
10525
|
+
const Ff = "https://app.getgram.ai", Zf = () => ({
|
|
10526
|
+
chat: Hf
|
|
10527
|
+
}), Bf = v({
|
|
10528
10528
|
// currently only supports serverURL, however we will support other config shapes for this via a union type in the future
|
|
10529
10529
|
mcp: D([c()]),
|
|
10530
10530
|
environment: De(c(), Re()).optional(),
|
|
10531
|
-
projectSlug: c()
|
|
10532
|
-
|
|
10531
|
+
projectSlug: c(),
|
|
10532
|
+
model: Kt(hi)
|
|
10533
|
+
}), Hf = async (e, t) => {
|
|
10533
10534
|
if (e.method === "POST")
|
|
10534
10535
|
try {
|
|
10535
10536
|
const r = [];
|
|
10536
10537
|
for await (const p of e)
|
|
10537
10538
|
r.push(p);
|
|
10538
|
-
const a = Buffer.concat(r).toString(), { messages: o, config: n } = JSON.parse(a), i =
|
|
10539
|
+
const a = Buffer.concat(r).toString(), { messages: o, config: n } = JSON.parse(a), i = Bf.parse(n), u = await (await Lf({
|
|
10539
10540
|
transport: {
|
|
10540
10541
|
type: "http",
|
|
10541
10542
|
url: i.mcp
|
|
10542
10543
|
}
|
|
10543
10544
|
})).tools(), l = Ms({
|
|
10544
|
-
baseURL:
|
|
10545
|
+
baseURL: Ff,
|
|
10545
10546
|
// We do not use the apiKey field as the requests are proxied through the Gram API.
|
|
10546
10547
|
// Instead we use the Gram-Key header to authenticate the request.
|
|
10547
10548
|
apiKey: "must be set",
|
|
@@ -10549,9 +10550,9 @@ const Vf = "https://app.getgram.ai", Jf = () => ({
|
|
|
10549
10550
|
"Gram-Project": i.projectSlug,
|
|
10550
10551
|
"Gram-Key": process.env.GRAM_API_KEY ?? ""
|
|
10551
10552
|
}
|
|
10552
|
-
}), d =
|
|
10553
|
-
model: l.chat(
|
|
10554
|
-
messages:
|
|
10553
|
+
}), d = pd({
|
|
10554
|
+
model: l.chat(i.model),
|
|
10555
|
+
messages: md(o),
|
|
10555
10556
|
tools: u
|
|
10556
10557
|
});
|
|
10557
10558
|
t.setHeader("Content-Type", "text/event-stream"), t.setHeader("Cache-Control", "no-cache"), t.setHeader("Connection", "keep-alive"), t.setHeader("Transfer-Encoding", "chunked"), t.statusCode = 200, d.pipeUIMessageStreamToResponse(t, {
|
|
@@ -10567,5 +10568,5 @@ const Vf = "https://app.getgram.ai", Jf = () => ({
|
|
|
10567
10568
|
}
|
|
10568
10569
|
};
|
|
10569
10570
|
export {
|
|
10570
|
-
|
|
10571
|
+
Zf as createElementsServerHandlers
|
|
10571
10572
|
};
|