@xyd-js/ask-ai-widget 0.0.0-build-6675456-20251014012658 → 0.0.0-build-1f6458c-20251015205119
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/server-standalone.js +456 -101
- package/dist/server.js +507 -136
- package/package.json +3 -3
package/dist/server.js
CHANGED
|
@@ -157566,14 +157566,14 @@ function Ce2(e488) {
|
|
|
157566
157566
|
var t481, r325 = e488.properties;
|
|
157567
157567
|
return import_react5.default.createElement("ul", { className: me2 }, (t481 = Te2(r325)) === null || t481 === undefined ? undefined : t481.map(function(e489, t482) {
|
|
157568
157568
|
var r326, a443 = e489.name, o237 = e489.type, i314 = Fe2(e489), l52 = ((r326 = e489.ofProperty) === null || r326 === undefined ? undefined : r326.description) || e489.description || "", c105 = Ie2(e489.meta);
|
|
157569
|
-
return import_react5.default.createElement("atlas-apiref-prop", { className: ve2, key: t482 }, a443 || o237 ? import_react5.default.createElement("dl", { className: fe2 }, import_react5.default.createElement(
|
|
157569
|
+
return import_react5.default.createElement("atlas-apiref-prop", { className: ve2, key: t482 }, a443 || o237 ? import_react5.default.createElement("dl", { className: fe2 }, import_react5.default.createElement(Oe2, { property: e489, meta: e489.meta || [] }), import_react5.default.createElement(_e2, { property: e489 }), import_react5.default.createElement(Re2, { metas: e489.meta || [] })) : null, l52 || c105 ? import_react5.default.createElement("atlas-apiref-propdescription", { className: pe2 }, import_react5.default.createElement(import_react5.default.Fragment, null, import_react5.default.createElement("div", null, l52), import_react5.default.createElement("div", null, Ie2(e489.meta)))) : null, (i314 == null ? undefined : i314.length) > 0 ? import_react5.default.createElement(Ae2, { parent: e489, properties: i314 }) : null);
|
|
157570
157570
|
}));
|
|
157571
157571
|
}
|
|
157572
|
-
function
|
|
157572
|
+
function Oe2(e488) {
|
|
157573
157573
|
var t481 = e488.property.name;
|
|
157574
157574
|
return t481 ? import_react5.default.createElement("atlas-apiref-propname", null, import_react5.default.createElement("dd", null, import_react5.default.createElement("code", { "data-parent-choice-type": e488.parentChoiceType ? "true" : undefined, className: he2 }, t481))) : null;
|
|
157575
157575
|
}
|
|
157576
|
-
function
|
|
157576
|
+
function _e2(e488) {
|
|
157577
157577
|
var t481 = e488.property, r325 = import_react5.useContext(J4).Link, o237 = r325 === undefined ? "a" : r325, i314 = function(e489) {
|
|
157578
157578
|
var n470, t482, r326 = function() {
|
|
157579
157579
|
var e490 = import_react5.useContext(J4);
|
|
@@ -157641,7 +157641,7 @@ function Ae2(e488) {
|
|
|
157641
157641
|
return u28(!c105);
|
|
157642
157642
|
}, isExpanded: c105 }) : null, import_react5.default.createElement("div", { className: "".concat(Ee2, " ").concat(c105 && be2) }, import_react5.default.createElement("div", { className: ke2 }, import_react5.default.createElement("ul", { role: "list", className: xe2 }, s187 == null ? undefined : s187.map(function(e489, t481) {
|
|
157643
157643
|
var r326, a444 = e489.name, o238 = e489.type, i315 = Fe2(e489), l53 = ((r326 = e489.ofProperty) === null || r326 === undefined ? undefined : r326.description) || e489.description || "", c106 = Ie2(e489.meta);
|
|
157644
|
-
return import_react5.default.createElement("atlas-apiref-prop", { className: we2, key: t481 }, a444 || o238 ? import_react5.default.createElement("dl", { className: fe2 }, import_react5.default.createElement(
|
|
157644
|
+
return import_react5.default.createElement("atlas-apiref-prop", { className: we2, key: t481 }, a444 || o238 ? import_react5.default.createElement("dl", { className: fe2 }, import_react5.default.createElement(Oe2, { property: e489, meta: e489.meta || [], parentChoiceType: d29 || !!v4 }), import_react5.default.createElement(_e2, { property: e489 }), import_react5.default.createElement(Re2, { metas: e489.meta || [] })) : null, l53 || c106 ? import_react5.default.createElement("atlas-apiref-propdescription", { className: pe2 }, import_react5.default.createElement(import_react5.default.Fragment, null, import_react5.default.createElement("div", null, l53), import_react5.default.createElement("div", null, Ie2(e489.meta)))) : null, (i315 == null ? undefined : i315.length) ? import_react5.default.createElement(Ae2, { parent: e489, properties: i315 }) : null);
|
|
157645
157645
|
})))));
|
|
157646
157646
|
}
|
|
157647
157647
|
function Be2(e488) {
|
|
@@ -157710,18 +157710,18 @@ function Me2(e488) {
|
|
|
157710
157710
|
var x4, w4 = {}, N6 = [], j4 = h3(n471.properties);
|
|
157711
157711
|
try {
|
|
157712
157712
|
for (j4.s();!(x4 = j4.n()).done; ) {
|
|
157713
|
-
var S4, C4 = x4.value,
|
|
157714
|
-
C4.ofProperty &&
|
|
157713
|
+
var S4, C4 = x4.value, O4 = e(C4);
|
|
157714
|
+
C4.ofProperty && O4.length > 1 && (O4 = [[O4[0]].concat(b4(O4.slice(1, O4.length))).join("")]), (S4 = N6).push.apply(S4, b4(O4));
|
|
157715
157715
|
}
|
|
157716
157716
|
} catch (e489) {
|
|
157717
157717
|
j4.e(e489);
|
|
157718
157718
|
} finally {
|
|
157719
157719
|
j4.f();
|
|
157720
157720
|
}
|
|
157721
|
-
var
|
|
157721
|
+
var _8, P4 = false, R8 = h3(N6);
|
|
157722
157722
|
try {
|
|
157723
|
-
for (R8.s();!(
|
|
157724
|
-
var A8 =
|
|
157723
|
+
for (R8.s();!(_8 = R8.n()).done; ) {
|
|
157724
|
+
var A8 = _8.value;
|
|
157725
157725
|
if (A8.trim() === "or") {
|
|
157726
157726
|
P4 = true;
|
|
157727
157727
|
break;
|
|
@@ -157805,10 +157805,10 @@ function Ue2() {
|
|
|
157805
157805
|
})), Ue2.apply(this, arguments);
|
|
157806
157806
|
}
|
|
157807
157807
|
function De2(e488, n470) {
|
|
157808
|
-
return
|
|
157808
|
+
return Ve2.apply(this, arguments);
|
|
157809
157809
|
}
|
|
157810
|
-
function
|
|
157811
|
-
return
|
|
157810
|
+
function Ve2() {
|
|
157811
|
+
return Ve2 = T4(P2().m(function e(n470, t481) {
|
|
157812
157812
|
var r325, a443, o237, i314, l52, c105 = arguments;
|
|
157813
157813
|
return P2().w(function(e488) {
|
|
157814
157814
|
for (;; )
|
|
@@ -157825,9 +157825,9 @@ function We2() {
|
|
|
157825
157825
|
return o237 = e488.v, i314 = o237.code, l52 = o237.annotations, e488.a(2, { code: i314, annotations: l52 });
|
|
157826
157826
|
}
|
|
157827
157827
|
}, e);
|
|
157828
|
-
})),
|
|
157828
|
+
})), Ve2.apply(this, arguments);
|
|
157829
157829
|
}
|
|
157830
|
-
function
|
|
157830
|
+
function We2(e488) {
|
|
157831
157831
|
return !Ge2(e488);
|
|
157832
157832
|
}
|
|
157833
157833
|
function Ge2(e488) {
|
|
@@ -158015,7 +158015,7 @@ var un = (an || (an = 1, on.exports = (rn || (rn = 1, function() {
|
|
|
158015
158015
|
var d30, v5 = t482.children;
|
|
158016
158016
|
if (v5 !== undefined)
|
|
158017
158017
|
if (o238)
|
|
158018
|
-
if (
|
|
158018
|
+
if (_8(v5)) {
|
|
158019
158019
|
for (o238 = 0;o238 < v5.length; o238++)
|
|
158020
158020
|
c105(v5[o238]);
|
|
158021
158021
|
Object.freeze && Object.freeze(v5);
|
|
@@ -158023,7 +158023,7 @@ var un = (an || (an = 1, on.exports = (rn || (rn = 1, function() {
|
|
|
158023
158023
|
console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
158024
158024
|
else
|
|
158025
158025
|
c105(v5);
|
|
158026
|
-
if (
|
|
158026
|
+
if (O4.call(t482, "key")) {
|
|
158027
158027
|
v5 = e488(n470);
|
|
158028
158028
|
var p29 = Object.keys(t482).filter(function(e489) {
|
|
158029
158029
|
return e489 !== "key";
|
|
@@ -158036,7 +158036,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
158036
158036
|
<%s key={someKey} {...props} />`, o238, v5, p29, v5), L4[v5 + o238] = true);
|
|
158037
158037
|
}
|
|
158038
158038
|
if (v5 = null, a444 !== undefined && (r325(a444), v5 = "" + a444), function(e489) {
|
|
158039
|
-
if (
|
|
158039
|
+
if (O4.call(e489, "key")) {
|
|
158040
158040
|
var n471 = Object.getOwnPropertyDescriptor(e489, "key").get;
|
|
158041
158041
|
if (n471 && n471.isReactWarning)
|
|
158042
158042
|
return false;
|
|
@@ -158063,7 +158063,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
158063
158063
|
function u28(e489) {
|
|
158064
158064
|
return B2(e489) === "object" && e489 !== null && e489.$$typeof === m82;
|
|
158065
158065
|
}
|
|
158066
|
-
var s187, d29 = import_react5.default, m82 = Symbol.for("react.transitional.element"), v4 = Symbol.for("react.portal"), p28 = Symbol.for("react.fragment"), f4 = Symbol.for("react.strict_mode"), h6 = Symbol.for("react.profiler"), g6 = Symbol.for("react.consumer"), y4 = Symbol.for("react.context"), E8 = Symbol.for("react.forward_ref"), b8 = Symbol.for("react.suspense"), x4 = Symbol.for("react.suspense_list"), w4 = Symbol.for("react.memo"), N6 = Symbol.for("react.lazy"), j4 = Symbol.for("react.activity"), S4 = Symbol.for("react.client.reference"), C4 = d29.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
158066
|
+
var s187, d29 = import_react5.default, m82 = Symbol.for("react.transitional.element"), v4 = Symbol.for("react.portal"), p28 = Symbol.for("react.fragment"), f4 = Symbol.for("react.strict_mode"), h6 = Symbol.for("react.profiler"), g6 = Symbol.for("react.consumer"), y4 = Symbol.for("react.context"), E8 = Symbol.for("react.forward_ref"), b8 = Symbol.for("react.suspense"), x4 = Symbol.for("react.suspense_list"), w4 = Symbol.for("react.memo"), N6 = Symbol.for("react.lazy"), j4 = Symbol.for("react.activity"), S4 = Symbol.for("react.client.reference"), C4 = d29.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, O4 = Object.prototype.hasOwnProperty, _8 = Array.isArray, P4 = console.createTask ? console.createTask : function() {
|
|
158067
158067
|
return null;
|
|
158068
158068
|
}, R8 = {}, A8 = (d29 = { react_stack_bottom_frame: function(e489) {
|
|
158069
158069
|
return e489();
|
|
@@ -158186,13 +158186,13 @@ function Sn(e488, n470) {
|
|
|
158186
158186
|
function Cn(e488) {
|
|
158187
158187
|
return e488.content !== undefined;
|
|
158188
158188
|
}
|
|
158189
|
-
function
|
|
158189
|
+
function On(e488) {
|
|
158190
158190
|
var { content: n470, handlers: t481, annotationStack: r325 } = e488;
|
|
158191
158191
|
return n470.map(function(e489, n471) {
|
|
158192
|
-
return Cn(e489) ? un.jsx(Pn, { annotationStack: r325, handlers: t481, group: e489 }, n471) : e489.style ? un.jsx(
|
|
158192
|
+
return Cn(e489) ? un.jsx(Pn, { annotationStack: r325, handlers: t481, group: e489 }, n471) : e489.style ? un.jsx(_n, { annotationStack: r325, handlers: t481, token: e489 }, n471) : e489.value;
|
|
158193
158193
|
});
|
|
158194
158194
|
}
|
|
158195
|
-
function
|
|
158195
|
+
function _n(e488) {
|
|
158196
158196
|
var { handlers: n470, token: t481 } = e488, r325 = function(e489, n471) {
|
|
158197
158197
|
var t482 = [];
|
|
158198
158198
|
return e489.forEach(function(e490) {
|
|
@@ -158209,7 +158209,7 @@ function On(e488) {
|
|
|
158209
158209
|
return un.jsx(wn, { merge: { _stack: r325, style: t481.style, value: t481.value } });
|
|
158210
158210
|
}
|
|
158211
158211
|
function Pn(e488) {
|
|
158212
|
-
var n470, t481 = e488.group, r325 = e488.handlers, a443 = e488.annotationStack, o237 = t481.annotation, i314 = t481.content, l52 = o237.name, c105 =
|
|
158212
|
+
var n470, t481 = e488.group, r325 = e488.handlers, a443 = e488.annotationStack, o237 = t481.annotation, i314 = t481.content, l52 = o237.name, c105 = On({ content: i314, handlers: r325, annotationStack: [].concat(j2(a443), [o237]) }), u28 = (n470 = r325.find(function(e489) {
|
|
158213
158213
|
return e489.name === l52;
|
|
158214
158214
|
})) === null || n470 === undefined ? undefined : n470.Inline;
|
|
158215
158215
|
return u28 ? un.jsx(u28, { annotation: o237, children: c105 }) : c105;
|
|
@@ -158261,7 +158261,7 @@ function Fn(e488) {
|
|
|
158261
158261
|
t482.push({ Component: a444, annotation: e491 });
|
|
158262
158262
|
}));
|
|
158263
158263
|
}), t482;
|
|
158264
|
-
}(t481, o237), m82 =
|
|
158264
|
+
}(t481, o237), m82 = On({ content: s187, handlers: t481, annotationStack: o237 }), v4 = { lineNumber: i314, indentation: c105, totalLines: l52, _stack: d29 };
|
|
158265
158265
|
return un.jsx(xn, { merge: v4, children: m82 }, i314);
|
|
158266
158266
|
}
|
|
158267
158267
|
function Tn(e488) {
|
|
@@ -158320,7 +158320,7 @@ function qn(e488) {
|
|
|
158320
158320
|
var t483, r327, a445;
|
|
158321
158321
|
return { tokens: e490, range: [n472 + 1, n472 + 1], lineNumber: n472 + 1, indentation: ((a445 = (r327 = (t483 = e490[0]) === null || t483 === undefined ? undefined : t483.value) === null || r327 === undefined ? undefined : r327.replace(/\t/g, " ").match(/^\s*/)) === null || a445 === undefined ? undefined : a445[0].length) || 0, totalLines: g6 };
|
|
158322
158322
|
});
|
|
158323
|
-
}(n470), o237 = r325.filter(
|
|
158323
|
+
}(n470), o237 = r325.filter(We2), i314 = r325.filter(Ge2), l52 = function(e489, n471) {
|
|
158324
158324
|
for (var t482 = e489, r326 = n471.length - 1;r326 >= 0; r326--)
|
|
158325
158325
|
t482 = Rn(t482, n471[r326]);
|
|
158326
158326
|
return t482;
|
|
@@ -158397,18 +158397,18 @@ function Un(e488, n470) {
|
|
|
158397
158397
|
}));
|
|
158398
158398
|
}
|
|
158399
158399
|
var Dn = "cwih9s3";
|
|
158400
|
-
function
|
|
158400
|
+
function Vn() {
|
|
158401
158401
|
return import_react5.default.createElement("xyd-code-loader", { className: Dn }, import_react5.default.createElement(In, null));
|
|
158402
158402
|
}
|
|
158403
|
-
var
|
|
158403
|
+
var Wn = import_react5.default.createContext({ ref: { current: null }, setActiveTab: function() {}, setActiveExample: function() {} });
|
|
158404
158404
|
function Gn() {
|
|
158405
|
-
return import_react5.default.useContext(
|
|
158405
|
+
return import_react5.default.useContext(Wn);
|
|
158406
158406
|
}
|
|
158407
158407
|
function Yn(e488) {
|
|
158408
158408
|
var r325 = e488.children, a443 = import_react5.useRef(null), o237 = import_react5.useState(""), c105 = M2(o237, 2), u28 = c105[0], s187 = c105[1], m82 = import_react5.useState(""), v4 = M2(m82, 2), p28 = v4[0], f4 = v4[1], h6 = Kt();
|
|
158409
158409
|
return import_react5.useEffect(function() {
|
|
158410
158410
|
f4(h6.value);
|
|
158411
|
-
}, [h6.value]), import_react5.default.createElement(
|
|
158411
|
+
}, [h6.value]), import_react5.default.createElement(Wn, { value: { ref: a443, setActiveTab: s187, setActiveExample: f4 } }, import_react5.default.createElement(UXNode, { name: "CodeSample", props: { tab: u28, example: p28, code: "" } }, import_react5.default.createElement(Kn, null, r325)));
|
|
158412
158412
|
}
|
|
158413
158413
|
function Kn(e488) {
|
|
158414
158414
|
var n470, t481, r325 = e488.children;
|
|
@@ -158452,7 +158452,7 @@ function Kn(e488) {
|
|
|
158452
158452
|
}(), r325;
|
|
158453
158453
|
}
|
|
158454
158454
|
function Xn(e488) {
|
|
158455
|
-
return import_react5.default.createElement(import_react5.Suspense, { fallback: import_react5.default.createElement(
|
|
158455
|
+
return import_react5.default.createElement(import_react5.Suspense, { fallback: import_react5.default.createElement(Vn, null) }, import_react5.default.createElement($n, { codeblocks: e488.codeblocks, theme: e488.theme }, e488.children));
|
|
158456
158456
|
}
|
|
158457
158457
|
function Zn() {
|
|
158458
158458
|
return import_react5.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", strokeWidth: 3, stroke: "currentColor", fill: "none", width: 16, strokeLinecap: "round", strokeLinejoin: "round" }, import_react5.default.createElement("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), import_react5.default.createElement("path", { d: "M12 12l8 -4.5" }), import_react5.default.createElement("path", { d: "M12 12v9" }), import_react5.default.createElement("path", { d: "M12 12l-8 -4.5" }), import_react5.default.createElement("path", { d: "M12 12l8 4.5" }), import_react5.default.createElement("path", { d: "M12 3v9" }), import_react5.default.createElement("path", { d: "M12 12l-8 4.5" }));
|
|
@@ -158639,12 +158639,12 @@ function Ct2(n470) {
|
|
|
158639
158639
|
return null;
|
|
158640
158640
|
var a443 = t481.slice(0, 2), o237 = t481.slice(2), i314 = o237.length > 0 ? "Show more (".concat(o237.length, ") reference").concat(o237.length === 1 ? "" : "s") : "";
|
|
158641
158641
|
return e487.createElement(e487.Fragment, null, a443.map(function(n471, t482) {
|
|
158642
|
-
return e487.createElement(
|
|
158642
|
+
return e487.createElement(Ot2, { key: t482, reference: n471, index: t482, syntaxHighlight: r325 });
|
|
158643
158643
|
}), o237.length > 0 && e487.createElement(Y4, { label: i314 }, o237.map(function(n471, t482) {
|
|
158644
|
-
return e487.createElement(
|
|
158644
|
+
return e487.createElement(Ot2, { key: t482 + 2, reference: n471, index: t482 + 2, syntaxHighlight: r325 });
|
|
158645
158645
|
})));
|
|
158646
158646
|
}
|
|
158647
|
-
function
|
|
158647
|
+
function Ot2(n470) {
|
|
158648
158648
|
var t481, r325 = n470.reference, a443 = n470.index, o237 = n470.syntaxHighlight;
|
|
158649
158649
|
return e487.createElement(e487.Fragment, { key: a443 }, e487.createElement(nr, { size: 3 }, r325.title), ((t481 = r325.context) === null || t481 === undefined ? undefined : t481.fileName) && e487.createElement(Y4, { label: "", kind: "tertiary", title: e487.createElement(e487.Fragment, null, "Source code in ", e487.createElement(G4, null, r325.context.fileFullPath)), icon: e487.createElement(St2, null) }, e487.createElement(rt2, { name: r325.context.fileName, description: r325.context.sourcecode.description, theme: o237 || undefined, codeblocks: [{ lang: r325.context.sourcecode.lang, meta: "", value: r325.context.sourcecode.code }] })), r325.definitions.map(function(n471, t482) {
|
|
158650
158650
|
var r326;
|
|
@@ -158653,7 +158653,7 @@ function _t2(n470) {
|
|
|
158653
158653
|
}))));
|
|
158654
158654
|
}), e487.createElement("br", null));
|
|
158655
158655
|
}
|
|
158656
|
-
var
|
|
158656
|
+
var _t2 = { track: function() {} };
|
|
158657
158657
|
function Pt2(e488) {
|
|
158658
158658
|
var t481;
|
|
158659
158659
|
t481 = e488.kind === "secondary" ? Ct2 : jt2;
|
|
@@ -158665,7 +158665,7 @@ function Pt2(e488) {
|
|
|
158665
158665
|
console.error("Error parsing references", e489);
|
|
158666
158666
|
}
|
|
158667
158667
|
var a443 = e488.analytics ? UXAnalytics : import_react5.default.Fragment;
|
|
158668
|
-
return import_react5.default.createElement(a443, { analytics:
|
|
158668
|
+
return import_react5.default.createElement(a443, { analytics: _t2 }, import_react5.default.createElement(Nt2, null, import_react5.default.createElement("div", { className: "a5edgc7" }, import_react5.default.createElement(t481, { references: r325, apiRefItemKind: e488.apiRefItemKind }))));
|
|
158669
158669
|
}
|
|
158670
158670
|
var jsx_dev_runtime = __toESM22(require_jsx_dev_runtime(), 1);
|
|
158671
158671
|
function References({
|
|
@@ -181406,6 +181406,7 @@ function oasToSnippet(oas, operation, values2, auth, lang, opts = {}) {
|
|
|
181406
181406
|
};
|
|
181407
181407
|
}
|
|
181408
181408
|
}
|
|
181409
|
+
var SKIP_SYMBOL = Symbol("skip");
|
|
181409
181410
|
function pad(number2) {
|
|
181410
181411
|
if (number2 < 10) {
|
|
181411
181412
|
return "0" + number2;
|
|
@@ -181531,7 +181532,10 @@ function allOfSample(into, children, options, spec, context) {
|
|
|
181531
181532
|
let res = traverse(into, options, spec);
|
|
181532
181533
|
const subSamples = [];
|
|
181533
181534
|
for (let subSchema of children) {
|
|
181534
|
-
const { type: type2, readOnly, writeOnly, value } = traverse({ type: res.type, ...subSchema }, options, spec,
|
|
181535
|
+
const { type: type2, readOnly, writeOnly, value } = traverse({ type: res.type, ...subSchema }, options, spec, {
|
|
181536
|
+
...context,
|
|
181537
|
+
isAllOfChild: true
|
|
181538
|
+
});
|
|
181535
181539
|
if (res.type && type2 && type2 !== res.type) {
|
|
181536
181540
|
console.warn("allOf: schemas with different types can't be merged");
|
|
181537
181541
|
res.type = type2;
|
|
@@ -181544,6 +181548,11 @@ function allOfSample(into, children, options, spec, context) {
|
|
|
181544
181548
|
}
|
|
181545
181549
|
if (res.type === "object") {
|
|
181546
181550
|
res.value = mergeDeep(res.value || {}, ...subSamples.filter((sample) => typeof sample === "object"));
|
|
181551
|
+
for (const key in res.value) {
|
|
181552
|
+
if (res.value[key] === SKIP_SYMBOL) {
|
|
181553
|
+
delete res.value[key];
|
|
181554
|
+
}
|
|
181555
|
+
}
|
|
181547
181556
|
return res;
|
|
181548
181557
|
} else {
|
|
181549
181558
|
if (res.type === "array") {
|
|
@@ -181995,9 +182004,15 @@ function sampleObject(schema2, options = {}, spec, context) {
|
|
|
181995
182004
|
}
|
|
181996
182005
|
const sample = traverse(schema2.properties[propertyName], options, spec, { propertyName, depth: depth + 1 });
|
|
181997
182006
|
if (options.skipReadOnly && sample.readOnly) {
|
|
182007
|
+
if (context?.isAllOfChild) {
|
|
182008
|
+
res[propertyName] = SKIP_SYMBOL;
|
|
182009
|
+
}
|
|
181998
182010
|
return;
|
|
181999
182011
|
}
|
|
182000
182012
|
if (options.skipWriteOnly && sample.writeOnly) {
|
|
182013
|
+
if (context?.isAllOfChild) {
|
|
182014
|
+
res[propertyName] = SKIP_SYMBOL;
|
|
182015
|
+
}
|
|
182001
182016
|
return;
|
|
182002
182017
|
}
|
|
182003
182018
|
if (options?.format === "xml") {
|
|
@@ -182073,6 +182088,7 @@ function regexSample$1(pattern) {
|
|
|
182073
182088
|
pattern = pattern.toString();
|
|
182074
182089
|
pattern = pattern.match(/\/(.+?)\//)?.[1] ?? "";
|
|
182075
182090
|
}
|
|
182091
|
+
pattern = pattern.replace(/^(\^)?(.*?)(\$)?$/, "$2");
|
|
182076
182092
|
let min;
|
|
182077
182093
|
let max;
|
|
182078
182094
|
let repetitions;
|
|
@@ -210672,7 +210688,7 @@ async function* executeTool({
|
|
|
210672
210688
|
}
|
|
210673
210689
|
}
|
|
210674
210690
|
|
|
210675
|
-
// ../../node_modules/.pnpm/@ai-sdk+gateway@1.0.
|
|
210691
|
+
// ../../node_modules/.pnpm/@ai-sdk+gateway@1.0.40_zod@3.25.76/node_modules/@ai-sdk/gateway/dist/index.mjs
|
|
210676
210692
|
var import_oidc = __toESM(require_dist2(), 1);
|
|
210677
210693
|
var import_oidc2 = __toESM(require_dist2(), 1);
|
|
210678
210694
|
var marker15 = "vercel.ai.gateway.error";
|
|
@@ -211238,7 +211254,7 @@ async function getVercelRequestId() {
|
|
|
211238
211254
|
var _a82;
|
|
211239
211255
|
return (_a82 = import_oidc.getContext().headers) == null ? undefined : _a82["x-vercel-id"];
|
|
211240
211256
|
}
|
|
211241
|
-
var VERSION2 = "1.0.
|
|
211257
|
+
var VERSION2 = "1.0.40";
|
|
211242
211258
|
var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|
|
211243
211259
|
function createGatewayProvider(options = {}) {
|
|
211244
211260
|
var _a82, _b8;
|
|
@@ -211368,7 +211384,7 @@ async function getGatewayAuthToken(options) {
|
|
|
211368
211384
|
}
|
|
211369
211385
|
}
|
|
211370
211386
|
|
|
211371
|
-
// ../../node_modules/.pnpm/ai@5.0.
|
|
211387
|
+
// ../../node_modules/.pnpm/ai@5.0.72_zod@3.25.76/node_modules/ai/dist/index.mjs
|
|
211372
211388
|
var import_api2 = __toESM(require_src6(), 1);
|
|
211373
211389
|
var import_api3 = __toESM(require_src6(), 1);
|
|
211374
211390
|
var __defProp3 = Object.defineProperty;
|
|
@@ -211794,7 +211810,7 @@ function detectMediaType({
|
|
|
211794
211810
|
}
|
|
211795
211811
|
return;
|
|
211796
211812
|
}
|
|
211797
|
-
var VERSION3 = "5.0.
|
|
211813
|
+
var VERSION3 = "5.0.72";
|
|
211798
211814
|
var download = async ({ url: url2 }) => {
|
|
211799
211815
|
var _a172;
|
|
211800
211816
|
const urlText = url2.toString();
|
|
@@ -213036,7 +213052,12 @@ function writeToServerResponse({
|
|
|
213036
213052
|
const { done, value } = await reader.read();
|
|
213037
213053
|
if (done)
|
|
213038
213054
|
break;
|
|
213039
|
-
response.write(value);
|
|
213055
|
+
const canContinue = response.write(value);
|
|
213056
|
+
if (!canContinue) {
|
|
213057
|
+
await new Promise((resolve2) => {
|
|
213058
|
+
response.once("drain", resolve2);
|
|
213059
|
+
});
|
|
213060
|
+
}
|
|
213040
213061
|
}
|
|
213041
213062
|
} catch (error40) {
|
|
213042
213063
|
throw error40;
|
|
@@ -216953,8 +216974,8 @@ async function pkceChallenge(length) {
|
|
|
216953
216974
|
};
|
|
216954
216975
|
}
|
|
216955
216976
|
|
|
216956
|
-
// ../../node_modules/.pnpm/@ai-sdk+anthropic@2.0.
|
|
216957
|
-
var VERSION4 = "2.0.
|
|
216977
|
+
// ../../node_modules/.pnpm/@ai-sdk+anthropic@2.0.30_zod@3.25.76/node_modules/@ai-sdk/anthropic/dist/index.mjs
|
|
216978
|
+
var VERSION4 = "2.0.30";
|
|
216958
216979
|
var anthropicErrorDataSchema = lazySchema(() => zodSchema(exports_external3.object({
|
|
216959
216980
|
type: exports_external3.literal("error"),
|
|
216960
216981
|
error: exports_external3.object({
|
|
@@ -217078,6 +217099,56 @@ var anthropicMessagesResponseSchema = lazySchema(() => zodSchema(exports_externa
|
|
|
217078
217099
|
error_code: exports_external3.string()
|
|
217079
217100
|
})
|
|
217080
217101
|
])
|
|
217102
|
+
}),
|
|
217103
|
+
exports_external3.object({
|
|
217104
|
+
type: exports_external3.literal("bash_code_execution_tool_result"),
|
|
217105
|
+
tool_use_id: exports_external3.string(),
|
|
217106
|
+
content: exports_external3.discriminatedUnion("type", [
|
|
217107
|
+
exports_external3.object({
|
|
217108
|
+
type: exports_external3.literal("bash_code_execution_result"),
|
|
217109
|
+
content: exports_external3.array(exports_external3.object({
|
|
217110
|
+
type: exports_external3.literal("bash_code_execution_output"),
|
|
217111
|
+
file_id: exports_external3.string()
|
|
217112
|
+
})),
|
|
217113
|
+
stdout: exports_external3.string(),
|
|
217114
|
+
stderr: exports_external3.string(),
|
|
217115
|
+
return_code: exports_external3.number()
|
|
217116
|
+
}),
|
|
217117
|
+
exports_external3.object({
|
|
217118
|
+
type: exports_external3.literal("bash_code_execution_tool_result_error"),
|
|
217119
|
+
error_code: exports_external3.string()
|
|
217120
|
+
})
|
|
217121
|
+
])
|
|
217122
|
+
}),
|
|
217123
|
+
exports_external3.object({
|
|
217124
|
+
type: exports_external3.literal("text_editor_code_execution_tool_result"),
|
|
217125
|
+
tool_use_id: exports_external3.string(),
|
|
217126
|
+
content: exports_external3.discriminatedUnion("type", [
|
|
217127
|
+
exports_external3.object({
|
|
217128
|
+
type: exports_external3.literal("text_editor_code_execution_tool_result_error"),
|
|
217129
|
+
error_code: exports_external3.string()
|
|
217130
|
+
}),
|
|
217131
|
+
exports_external3.object({
|
|
217132
|
+
type: exports_external3.literal("text_editor_code_execution_view_result"),
|
|
217133
|
+
content: exports_external3.string(),
|
|
217134
|
+
file_type: exports_external3.string(),
|
|
217135
|
+
num_lines: exports_external3.number().nullable(),
|
|
217136
|
+
start_line: exports_external3.number().nullable(),
|
|
217137
|
+
total_lines: exports_external3.number().nullable()
|
|
217138
|
+
}),
|
|
217139
|
+
exports_external3.object({
|
|
217140
|
+
type: exports_external3.literal("text_editor_code_execution_create_result"),
|
|
217141
|
+
is_file_update: exports_external3.boolean()
|
|
217142
|
+
}),
|
|
217143
|
+
exports_external3.object({
|
|
217144
|
+
type: exports_external3.literal("text_editor_code_execution_str_replace_result"),
|
|
217145
|
+
lines: exports_external3.array(exports_external3.string()).nullable(),
|
|
217146
|
+
new_lines: exports_external3.number().nullable(),
|
|
217147
|
+
new_start: exports_external3.number().nullable(),
|
|
217148
|
+
old_lines: exports_external3.number().nullable(),
|
|
217149
|
+
old_start: exports_external3.number().nullable()
|
|
217150
|
+
})
|
|
217151
|
+
])
|
|
217081
217152
|
})
|
|
217082
217153
|
])),
|
|
217083
217154
|
stop_reason: exports_external3.string().nullish(),
|
|
@@ -217186,6 +217257,56 @@ var anthropicMessagesChunkSchema = lazySchema(() => zodSchema(exports_external3.
|
|
|
217186
217257
|
error_code: exports_external3.string()
|
|
217187
217258
|
})
|
|
217188
217259
|
])
|
|
217260
|
+
}),
|
|
217261
|
+
exports_external3.object({
|
|
217262
|
+
type: exports_external3.literal("bash_code_execution_tool_result"),
|
|
217263
|
+
tool_use_id: exports_external3.string(),
|
|
217264
|
+
content: exports_external3.discriminatedUnion("type", [
|
|
217265
|
+
exports_external3.object({
|
|
217266
|
+
type: exports_external3.literal("bash_code_execution_result"),
|
|
217267
|
+
content: exports_external3.array(exports_external3.object({
|
|
217268
|
+
type: exports_external3.literal("bash_code_execution_output"),
|
|
217269
|
+
file_id: exports_external3.string()
|
|
217270
|
+
})),
|
|
217271
|
+
stdout: exports_external3.string(),
|
|
217272
|
+
stderr: exports_external3.string(),
|
|
217273
|
+
return_code: exports_external3.number()
|
|
217274
|
+
}),
|
|
217275
|
+
exports_external3.object({
|
|
217276
|
+
type: exports_external3.literal("bash_code_execution_tool_result_error"),
|
|
217277
|
+
error_code: exports_external3.string()
|
|
217278
|
+
})
|
|
217279
|
+
])
|
|
217280
|
+
}),
|
|
217281
|
+
exports_external3.object({
|
|
217282
|
+
type: exports_external3.literal("text_editor_code_execution_tool_result"),
|
|
217283
|
+
tool_use_id: exports_external3.string(),
|
|
217284
|
+
content: exports_external3.discriminatedUnion("type", [
|
|
217285
|
+
exports_external3.object({
|
|
217286
|
+
type: exports_external3.literal("text_editor_code_execution_tool_result_error"),
|
|
217287
|
+
error_code: exports_external3.string()
|
|
217288
|
+
}),
|
|
217289
|
+
exports_external3.object({
|
|
217290
|
+
type: exports_external3.literal("text_editor_code_execution_view_result"),
|
|
217291
|
+
content: exports_external3.string(),
|
|
217292
|
+
file_type: exports_external3.string(),
|
|
217293
|
+
num_lines: exports_external3.number().nullable(),
|
|
217294
|
+
start_line: exports_external3.number().nullable(),
|
|
217295
|
+
total_lines: exports_external3.number().nullable()
|
|
217296
|
+
}),
|
|
217297
|
+
exports_external3.object({
|
|
217298
|
+
type: exports_external3.literal("text_editor_code_execution_create_result"),
|
|
217299
|
+
is_file_update: exports_external3.boolean()
|
|
217300
|
+
}),
|
|
217301
|
+
exports_external3.object({
|
|
217302
|
+
type: exports_external3.literal("text_editor_code_execution_str_replace_result"),
|
|
217303
|
+
lines: exports_external3.array(exports_external3.string()).nullable(),
|
|
217304
|
+
new_lines: exports_external3.number().nullable(),
|
|
217305
|
+
new_start: exports_external3.number().nullable(),
|
|
217306
|
+
old_lines: exports_external3.number().nullable(),
|
|
217307
|
+
old_start: exports_external3.number().nullable()
|
|
217308
|
+
})
|
|
217309
|
+
])
|
|
217189
217310
|
})
|
|
217190
217311
|
])
|
|
217191
217312
|
}),
|
|
@@ -217423,6 +217544,14 @@ async function prepareTools({
|
|
|
217423
217544
|
});
|
|
217424
217545
|
break;
|
|
217425
217546
|
}
|
|
217547
|
+
case "anthropic.code_execution_20250825": {
|
|
217548
|
+
betas.add("code-execution-2025-08-25");
|
|
217549
|
+
anthropicTools2.push({
|
|
217550
|
+
type: "code_execution_20250825",
|
|
217551
|
+
name: "code_execution"
|
|
217552
|
+
});
|
|
217553
|
+
break;
|
|
217554
|
+
}
|
|
217426
217555
|
case "anthropic.computer_20250124": {
|
|
217427
217556
|
betas.add("computer-use-2025-01-24");
|
|
217428
217557
|
anthropicTools2.push({
|
|
@@ -217497,6 +217626,14 @@ async function prepareTools({
|
|
|
217497
217626
|
});
|
|
217498
217627
|
break;
|
|
217499
217628
|
}
|
|
217629
|
+
case "anthropic.memory_20250818": {
|
|
217630
|
+
betas.add("context-management-2025-06-27");
|
|
217631
|
+
anthropicTools2.push({
|
|
217632
|
+
name: "memory",
|
|
217633
|
+
type: "memory_20250818"
|
|
217634
|
+
});
|
|
217635
|
+
break;
|
|
217636
|
+
}
|
|
217500
217637
|
case "anthropic.web_fetch_20250910": {
|
|
217501
217638
|
betas.add("web-fetch-2025-09-10");
|
|
217502
217639
|
const args = await validateTypes({
|
|
@@ -217611,6 +217748,81 @@ var factory4 = createProviderDefinedToolFactoryWithOutputSchema({
|
|
|
217611
217748
|
var codeExecution_20250522 = (args = {}) => {
|
|
217612
217749
|
return factory4(args);
|
|
217613
217750
|
};
|
|
217751
|
+
var codeExecution_20250825OutputSchema = lazySchema(() => zodSchema(exports_external3.discriminatedUnion("type", [
|
|
217752
|
+
exports_external3.object({
|
|
217753
|
+
type: exports_external3.literal("bash_code_execution_result"),
|
|
217754
|
+
content: exports_external3.array(exports_external3.object({
|
|
217755
|
+
type: exports_external3.literal("bash_code_execution_output"),
|
|
217756
|
+
file_id: exports_external3.string()
|
|
217757
|
+
})),
|
|
217758
|
+
stdout: exports_external3.string(),
|
|
217759
|
+
stderr: exports_external3.string(),
|
|
217760
|
+
return_code: exports_external3.number()
|
|
217761
|
+
}),
|
|
217762
|
+
exports_external3.object({
|
|
217763
|
+
type: exports_external3.literal("bash_code_execution_tool_result_error"),
|
|
217764
|
+
error_code: exports_external3.string()
|
|
217765
|
+
}),
|
|
217766
|
+
exports_external3.object({
|
|
217767
|
+
type: exports_external3.literal("text_editor_code_execution_tool_result_error"),
|
|
217768
|
+
error_code: exports_external3.string()
|
|
217769
|
+
}),
|
|
217770
|
+
exports_external3.object({
|
|
217771
|
+
type: exports_external3.literal("text_editor_code_execution_view_result"),
|
|
217772
|
+
content: exports_external3.string(),
|
|
217773
|
+
file_type: exports_external3.string(),
|
|
217774
|
+
num_lines: exports_external3.number().nullable(),
|
|
217775
|
+
start_line: exports_external3.number().nullable(),
|
|
217776
|
+
total_lines: exports_external3.number().nullable()
|
|
217777
|
+
}),
|
|
217778
|
+
exports_external3.object({
|
|
217779
|
+
type: exports_external3.literal("text_editor_code_execution_create_result"),
|
|
217780
|
+
is_file_update: exports_external3.boolean()
|
|
217781
|
+
}),
|
|
217782
|
+
exports_external3.object({
|
|
217783
|
+
type: exports_external3.literal("text_editor_code_execution_str_replace_result"),
|
|
217784
|
+
lines: exports_external3.array(exports_external3.string()).nullable(),
|
|
217785
|
+
new_lines: exports_external3.number().nullable(),
|
|
217786
|
+
new_start: exports_external3.number().nullable(),
|
|
217787
|
+
old_lines: exports_external3.number().nullable(),
|
|
217788
|
+
old_start: exports_external3.number().nullable()
|
|
217789
|
+
})
|
|
217790
|
+
])));
|
|
217791
|
+
var codeExecution_20250825InputSchema = lazySchema(() => zodSchema(exports_external3.discriminatedUnion("type", [
|
|
217792
|
+
exports_external3.object({
|
|
217793
|
+
type: exports_external3.literal("bash_code_execution"),
|
|
217794
|
+
command: exports_external3.string()
|
|
217795
|
+
}),
|
|
217796
|
+
exports_external3.discriminatedUnion("command", [
|
|
217797
|
+
exports_external3.object({
|
|
217798
|
+
type: exports_external3.literal("text_editor_code_execution"),
|
|
217799
|
+
command: exports_external3.literal("view"),
|
|
217800
|
+
path: exports_external3.string()
|
|
217801
|
+
}),
|
|
217802
|
+
exports_external3.object({
|
|
217803
|
+
type: exports_external3.literal("text_editor_code_execution"),
|
|
217804
|
+
command: exports_external3.literal("create"),
|
|
217805
|
+
path: exports_external3.string(),
|
|
217806
|
+
file_text: exports_external3.string().nullish()
|
|
217807
|
+
}),
|
|
217808
|
+
exports_external3.object({
|
|
217809
|
+
type: exports_external3.literal("text_editor_code_execution"),
|
|
217810
|
+
command: exports_external3.literal("str_replace"),
|
|
217811
|
+
path: exports_external3.string(),
|
|
217812
|
+
old_str: exports_external3.string(),
|
|
217813
|
+
new_str: exports_external3.string()
|
|
217814
|
+
})
|
|
217815
|
+
])
|
|
217816
|
+
])));
|
|
217817
|
+
var factory5 = createProviderDefinedToolFactoryWithOutputSchema({
|
|
217818
|
+
id: "anthropic.code_execution_20250825",
|
|
217819
|
+
name: "code_execution",
|
|
217820
|
+
inputSchema: codeExecution_20250825InputSchema,
|
|
217821
|
+
outputSchema: codeExecution_20250825OutputSchema
|
|
217822
|
+
});
|
|
217823
|
+
var codeExecution_20250825 = (args = {}) => {
|
|
217824
|
+
return factory5(args);
|
|
217825
|
+
};
|
|
217614
217826
|
function convertToString(data) {
|
|
217615
217827
|
if (typeof data === "string") {
|
|
217616
217828
|
return Buffer.from(data, "base64").toString("utf-8");
|
|
@@ -217899,7 +218111,15 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
217899
218111
|
}
|
|
217900
218112
|
case "tool-call": {
|
|
217901
218113
|
if (part.providerExecuted) {
|
|
217902
|
-
if (part.toolName === "code_execution"
|
|
218114
|
+
if (part.toolName === "code_execution" && part.input != null && typeof part.input === "object" && "type" in part.input && typeof part.input.type === "string" && (part.input.type === "bash_code_execution" || part.input.type === "text_editor_code_execution")) {
|
|
218115
|
+
anthropicContent.push({
|
|
218116
|
+
type: "server_tool_use",
|
|
218117
|
+
id: part.toolCallId,
|
|
218118
|
+
name: part.input.type,
|
|
218119
|
+
input: part.input,
|
|
218120
|
+
cache_control: cacheControl
|
|
218121
|
+
});
|
|
218122
|
+
} else if (part.toolName === "code_execution" || part.toolName === "web_fetch" || part.toolName === "web_search") {
|
|
217903
218123
|
anthropicContent.push({
|
|
217904
218124
|
type: "server_tool_use",
|
|
217905
218125
|
id: part.toolCallId,
|
|
@@ -217934,21 +218154,46 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
217934
218154
|
});
|
|
217935
218155
|
break;
|
|
217936
218156
|
}
|
|
217937
|
-
|
|
217938
|
-
|
|
217939
|
-
|
|
217940
|
-
|
|
217941
|
-
|
|
217942
|
-
|
|
217943
|
-
|
|
217944
|
-
|
|
217945
|
-
|
|
217946
|
-
|
|
217947
|
-
|
|
217948
|
-
|
|
217949
|
-
|
|
217950
|
-
|
|
217951
|
-
|
|
218157
|
+
if (output.value == null || typeof output.value !== "object" || !("type" in output.value) || typeof output.value.type !== "string") {
|
|
218158
|
+
warnings.push({
|
|
218159
|
+
type: "other",
|
|
218160
|
+
message: `provider executed tool result output value is not a valid code execution result for tool ${part.toolName}`
|
|
218161
|
+
});
|
|
218162
|
+
break;
|
|
218163
|
+
}
|
|
218164
|
+
if (output.value.type === "code_execution_result") {
|
|
218165
|
+
const codeExecutionOutput = await validateTypes({
|
|
218166
|
+
value: output.value,
|
|
218167
|
+
schema: codeExecution_20250522OutputSchema
|
|
218168
|
+
});
|
|
218169
|
+
anthropicContent.push({
|
|
218170
|
+
type: "code_execution_tool_result",
|
|
218171
|
+
tool_use_id: part.toolCallId,
|
|
218172
|
+
content: {
|
|
218173
|
+
type: codeExecutionOutput.type,
|
|
218174
|
+
stdout: codeExecutionOutput.stdout,
|
|
218175
|
+
stderr: codeExecutionOutput.stderr,
|
|
218176
|
+
return_code: codeExecutionOutput.return_code
|
|
218177
|
+
},
|
|
218178
|
+
cache_control: cacheControl
|
|
218179
|
+
});
|
|
218180
|
+
} else {
|
|
218181
|
+
const codeExecutionOutput = await validateTypes({
|
|
218182
|
+
value: output.value,
|
|
218183
|
+
schema: codeExecution_20250825OutputSchema
|
|
218184
|
+
});
|
|
218185
|
+
anthropicContent.push(codeExecutionOutput.type === "bash_code_execution_result" || codeExecutionOutput.type === "bash_code_execution_tool_result_error" ? {
|
|
218186
|
+
type: "bash_code_execution_tool_result",
|
|
218187
|
+
tool_use_id: part.toolCallId,
|
|
218188
|
+
cache_control: cacheControl,
|
|
218189
|
+
content: codeExecutionOutput
|
|
218190
|
+
} : {
|
|
218191
|
+
type: "text_editor_code_execution_tool_result",
|
|
218192
|
+
tool_use_id: part.toolCallId,
|
|
218193
|
+
cache_control: cacheControl,
|
|
218194
|
+
content: codeExecutionOutput
|
|
218195
|
+
});
|
|
218196
|
+
}
|
|
217952
218197
|
break;
|
|
217953
218198
|
}
|
|
217954
218199
|
if (part.toolName === "web_fetch") {
|
|
@@ -218394,7 +218639,15 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
218394
218639
|
break;
|
|
218395
218640
|
}
|
|
218396
218641
|
case "server_tool_use": {
|
|
218397
|
-
if (part.name === "
|
|
218642
|
+
if (part.name === "text_editor_code_execution" || part.name === "bash_code_execution") {
|
|
218643
|
+
content3.push({
|
|
218644
|
+
type: "tool-call",
|
|
218645
|
+
toolCallId: part.id,
|
|
218646
|
+
toolName: "code_execution",
|
|
218647
|
+
input: JSON.stringify({ type: part.name, ...part.input }),
|
|
218648
|
+
providerExecuted: true
|
|
218649
|
+
});
|
|
218650
|
+
} else if (part.name === "web_search" || part.name === "code_execution" || part.name === "web_fetch") {
|
|
218398
218651
|
content3.push({
|
|
218399
218652
|
type: "tool-call",
|
|
218400
218653
|
toolCallId: part.id,
|
|
@@ -218519,6 +218772,17 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
218519
218772
|
}
|
|
218520
218773
|
break;
|
|
218521
218774
|
}
|
|
218775
|
+
case "bash_code_execution_tool_result":
|
|
218776
|
+
case "text_editor_code_execution_tool_result": {
|
|
218777
|
+
content3.push({
|
|
218778
|
+
type: "tool-result",
|
|
218779
|
+
toolCallId: part.tool_use_id,
|
|
218780
|
+
toolName: "code_execution",
|
|
218781
|
+
result: part.content,
|
|
218782
|
+
providerExecuted: true
|
|
218783
|
+
});
|
|
218784
|
+
break;
|
|
218785
|
+
}
|
|
218522
218786
|
}
|
|
218523
218787
|
}
|
|
218524
218788
|
return {
|
|
@@ -218632,7 +218896,8 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
218632
218896
|
type: "tool-call",
|
|
218633
218897
|
toolCallId: value.content_block.id,
|
|
218634
218898
|
toolName: value.content_block.name,
|
|
218635
|
-
input: ""
|
|
218899
|
+
input: "",
|
|
218900
|
+
firstDelta: true
|
|
218636
218901
|
};
|
|
218637
218902
|
controller.enqueue(usesJsonResponseTool ? { type: "text-start", id: String(value.index) } : {
|
|
218638
218903
|
type: "tool-input-start",
|
|
@@ -218642,18 +218907,26 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
218642
218907
|
return;
|
|
218643
218908
|
}
|
|
218644
218909
|
case "server_tool_use": {
|
|
218645
|
-
if (
|
|
218910
|
+
if ([
|
|
218911
|
+
"web_fetch",
|
|
218912
|
+
"web_search",
|
|
218913
|
+
"code_execution",
|
|
218914
|
+
"text_editor_code_execution",
|
|
218915
|
+
"bash_code_execution"
|
|
218916
|
+
].includes(value.content_block.name)) {
|
|
218646
218917
|
contentBlocks[value.index] = {
|
|
218647
218918
|
type: "tool-call",
|
|
218648
218919
|
toolCallId: value.content_block.id,
|
|
218649
218920
|
toolName: value.content_block.name,
|
|
218650
218921
|
input: "",
|
|
218651
|
-
providerExecuted: true
|
|
218922
|
+
providerExecuted: true,
|
|
218923
|
+
firstDelta: true
|
|
218652
218924
|
};
|
|
218925
|
+
const mappedToolName = value.content_block.name === "text_editor_code_execution" || value.content_block.name === "bash_code_execution" ? "code_execution" : value.content_block.name;
|
|
218653
218926
|
controller.enqueue({
|
|
218654
218927
|
type: "tool-input-start",
|
|
218655
218928
|
id: value.content_block.id,
|
|
218656
|
-
toolName:
|
|
218929
|
+
toolName: mappedToolName,
|
|
218657
218930
|
providerExecuted: true
|
|
218658
218931
|
});
|
|
218659
218932
|
}
|
|
@@ -218775,6 +219048,18 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
218775
219048
|
}
|
|
218776
219049
|
return;
|
|
218777
219050
|
}
|
|
219051
|
+
case "bash_code_execution_tool_result":
|
|
219052
|
+
case "text_editor_code_execution_tool_result": {
|
|
219053
|
+
const part = value.content_block;
|
|
219054
|
+
controller.enqueue({
|
|
219055
|
+
type: "tool-result",
|
|
219056
|
+
toolCallId: part.tool_use_id,
|
|
219057
|
+
toolName: "code_execution",
|
|
219058
|
+
result: part.content,
|
|
219059
|
+
providerExecuted: true
|
|
219060
|
+
});
|
|
219061
|
+
return;
|
|
219062
|
+
}
|
|
218778
219063
|
default: {
|
|
218779
219064
|
const _exhaustiveCheck = contentBlockType;
|
|
218780
219065
|
throw new Error(`Unsupported content block type: ${_exhaustiveCheck}`);
|
|
@@ -218805,7 +219090,14 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
218805
219090
|
type: "tool-input-end",
|
|
218806
219091
|
id: contentBlock.toolCallId
|
|
218807
219092
|
});
|
|
218808
|
-
|
|
219093
|
+
const toolName = contentBlock.toolName === "text_editor_code_execution" || contentBlock.toolName === "bash_code_execution" ? "code_execution" : contentBlock.toolName;
|
|
219094
|
+
controller.enqueue({
|
|
219095
|
+
type: "tool-call",
|
|
219096
|
+
toolCallId: contentBlock.toolCallId,
|
|
219097
|
+
toolName,
|
|
219098
|
+
input: contentBlock.input,
|
|
219099
|
+
providerExecuted: contentBlock.providerExecuted
|
|
219100
|
+
});
|
|
218809
219101
|
}
|
|
218810
219102
|
break;
|
|
218811
219103
|
}
|
|
@@ -218853,7 +219145,10 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
218853
219145
|
}
|
|
218854
219146
|
case "input_json_delta": {
|
|
218855
219147
|
const contentBlock = contentBlocks[value.index];
|
|
218856
|
-
|
|
219148
|
+
let delta = value.delta.partial_json;
|
|
219149
|
+
if (delta.length === 0) {
|
|
219150
|
+
return;
|
|
219151
|
+
}
|
|
218857
219152
|
if (usesJsonResponseTool) {
|
|
218858
219153
|
if ((contentBlock == null ? undefined : contentBlock.type) !== "text") {
|
|
218859
219154
|
return;
|
|
@@ -218867,12 +219162,16 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
218867
219162
|
if ((contentBlock == null ? undefined : contentBlock.type) !== "tool-call") {
|
|
218868
219163
|
return;
|
|
218869
219164
|
}
|
|
219165
|
+
if (contentBlock.firstDelta && (contentBlock.toolName === "bash_code_execution" || contentBlock.toolName === "text_editor_code_execution")) {
|
|
219166
|
+
delta = `{"type": "${contentBlock.toolName}",${delta.substring(1)}`;
|
|
219167
|
+
}
|
|
218870
219168
|
controller.enqueue({
|
|
218871
219169
|
type: "tool-input-delta",
|
|
218872
219170
|
id: contentBlock.toolCallId,
|
|
218873
219171
|
delta
|
|
218874
219172
|
});
|
|
218875
219173
|
contentBlock.input += delta;
|
|
219174
|
+
contentBlock.firstDelta = false;
|
|
218876
219175
|
}
|
|
218877
219176
|
return;
|
|
218878
219177
|
}
|
|
@@ -219019,6 +219318,44 @@ var computer_20250124 = createProviderDefinedToolFactory({
|
|
|
219019
219318
|
name: "computer",
|
|
219020
219319
|
inputSchema: computer_20250124InputSchema
|
|
219021
219320
|
});
|
|
219321
|
+
var memory_20250818InputSchema = lazySchema(() => zodSchema(exports_external3.discriminatedUnion("command", [
|
|
219322
|
+
exports_external3.object({
|
|
219323
|
+
command: exports_external3.literal("view"),
|
|
219324
|
+
path: exports_external3.string(),
|
|
219325
|
+
view_range: exports_external3.tuple([exports_external3.number(), exports_external3.number()]).optional()
|
|
219326
|
+
}),
|
|
219327
|
+
exports_external3.object({
|
|
219328
|
+
command: exports_external3.literal("create"),
|
|
219329
|
+
path: exports_external3.string(),
|
|
219330
|
+
file_text: exports_external3.string()
|
|
219331
|
+
}),
|
|
219332
|
+
exports_external3.object({
|
|
219333
|
+
command: exports_external3.literal("str_replace"),
|
|
219334
|
+
path: exports_external3.string(),
|
|
219335
|
+
old_str: exports_external3.string(),
|
|
219336
|
+
new_str: exports_external3.string()
|
|
219337
|
+
}),
|
|
219338
|
+
exports_external3.object({
|
|
219339
|
+
command: exports_external3.literal("insert"),
|
|
219340
|
+
path: exports_external3.string(),
|
|
219341
|
+
insert_line: exports_external3.number(),
|
|
219342
|
+
insert_text: exports_external3.string()
|
|
219343
|
+
}),
|
|
219344
|
+
exports_external3.object({
|
|
219345
|
+
command: exports_external3.literal("delete"),
|
|
219346
|
+
path: exports_external3.string()
|
|
219347
|
+
}),
|
|
219348
|
+
exports_external3.object({
|
|
219349
|
+
command: exports_external3.literal("rename"),
|
|
219350
|
+
old_path: exports_external3.string(),
|
|
219351
|
+
new_path: exports_external3.string()
|
|
219352
|
+
})
|
|
219353
|
+
])));
|
|
219354
|
+
var memory_20250818 = createProviderDefinedToolFactory({
|
|
219355
|
+
id: "anthropic.memory_20250818",
|
|
219356
|
+
name: "memory",
|
|
219357
|
+
inputSchema: memory_20250818InputSchema
|
|
219358
|
+
});
|
|
219022
219359
|
var textEditor_20241022InputSchema = lazySchema(() => zodSchema(exports_external3.object({
|
|
219023
219360
|
command: exports_external3.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
219024
219361
|
path: exports_external3.string(),
|
|
@@ -219065,8 +219402,10 @@ var anthropicTools = {
|
|
|
219065
219402
|
bash_20241022,
|
|
219066
219403
|
bash_20250124,
|
|
219067
219404
|
codeExecution_20250522,
|
|
219405
|
+
codeExecution_20250825,
|
|
219068
219406
|
computer_20241022,
|
|
219069
219407
|
computer_20250124,
|
|
219408
|
+
memory_20250818,
|
|
219070
219409
|
textEditor_20241022,
|
|
219071
219410
|
textEditor_20250124,
|
|
219072
219411
|
textEditor_20250429,
|
|
@@ -219119,7 +219458,7 @@ function createAnthropic(options = {}) {
|
|
|
219119
219458
|
}
|
|
219120
219459
|
var anthropic = createAnthropic();
|
|
219121
219460
|
|
|
219122
|
-
// ../../node_modules/.pnpm/@ai-sdk+openai@2.0.
|
|
219461
|
+
// ../../node_modules/.pnpm/@ai-sdk+openai@2.0.52_zod@3.25.76/node_modules/@ai-sdk/openai/dist/index.mjs
|
|
219123
219462
|
var openaiErrorDataSchema = exports_external3.object({
|
|
219124
219463
|
error: exports_external3.object({
|
|
219125
219464
|
message: exports_external3.string(),
|
|
@@ -220660,9 +220999,7 @@ var localShell = createProviderDefinedToolFactoryWithOutputSchema({
|
|
|
220660
220999
|
outputSchema: localShellOutputSchema
|
|
220661
221000
|
});
|
|
220662
221001
|
var webSearchArgsSchema = lazySchema(() => zodSchema(exports_external3.object({
|
|
220663
|
-
filters: exports_external3.object({
|
|
220664
|
-
allowedDomains: exports_external3.array(exports_external3.string()).optional()
|
|
220665
|
-
}).optional(),
|
|
221002
|
+
filters: exports_external3.object({ allowedDomains: exports_external3.array(exports_external3.string()).optional() }).optional(),
|
|
220666
221003
|
searchContextSize: exports_external3.enum(["low", "medium", "high"]).optional(),
|
|
220667
221004
|
userLocation: exports_external3.object({
|
|
220668
221005
|
type: exports_external3.literal("approximate"),
|
|
@@ -220672,14 +221009,15 @@ var webSearchArgsSchema = lazySchema(() => zodSchema(exports_external3.object({
|
|
|
220672
221009
|
timezone: exports_external3.string().optional()
|
|
220673
221010
|
}).optional()
|
|
220674
221011
|
})));
|
|
220675
|
-
var webSearchInputSchema = lazySchema(() => zodSchema(exports_external3.object({
|
|
221012
|
+
var webSearchInputSchema = lazySchema(() => zodSchema(exports_external3.object({})));
|
|
221013
|
+
var webSearchOutputSchema = lazySchema(() => zodSchema(exports_external3.object({
|
|
220676
221014
|
action: exports_external3.discriminatedUnion("type", [
|
|
220677
221015
|
exports_external3.object({
|
|
220678
221016
|
type: exports_external3.literal("search"),
|
|
220679
|
-
query: exports_external3.string().
|
|
221017
|
+
query: exports_external3.string().optional()
|
|
220680
221018
|
}),
|
|
220681
221019
|
exports_external3.object({
|
|
220682
|
-
type: exports_external3.literal("
|
|
221020
|
+
type: exports_external3.literal("openPage"),
|
|
220683
221021
|
url: exports_external3.string()
|
|
220684
221022
|
}),
|
|
220685
221023
|
exports_external3.object({
|
|
@@ -220687,16 +221025,15 @@ var webSearchInputSchema = lazySchema(() => zodSchema(exports_external3.object({
|
|
|
220687
221025
|
url: exports_external3.string(),
|
|
220688
221026
|
pattern: exports_external3.string()
|
|
220689
221027
|
})
|
|
220690
|
-
])
|
|
221028
|
+
])
|
|
220691
221029
|
})));
|
|
220692
|
-
var webSearchToolFactory =
|
|
221030
|
+
var webSearchToolFactory = createProviderDefinedToolFactoryWithOutputSchema({
|
|
220693
221031
|
id: "openai.web_search",
|
|
220694
221032
|
name: "web_search",
|
|
220695
|
-
inputSchema: webSearchInputSchema
|
|
221033
|
+
inputSchema: webSearchInputSchema,
|
|
221034
|
+
outputSchema: webSearchOutputSchema
|
|
220696
221035
|
});
|
|
220697
|
-
var webSearch = (args = {}) =>
|
|
220698
|
-
return webSearchToolFactory(args);
|
|
220699
|
-
};
|
|
221036
|
+
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
220700
221037
|
var webSearchPreviewArgsSchema = lazySchema(() => zodSchema(exports_external3.object({
|
|
220701
221038
|
searchContextSize: exports_external3.enum(["low", "medium", "high"]).optional(),
|
|
220702
221039
|
userLocation: exports_external3.object({
|
|
@@ -220707,14 +221044,15 @@ var webSearchPreviewArgsSchema = lazySchema(() => zodSchema(exports_external3.ob
|
|
|
220707
221044
|
timezone: exports_external3.string().optional()
|
|
220708
221045
|
}).optional()
|
|
220709
221046
|
})));
|
|
220710
|
-
var webSearchPreviewInputSchema = lazySchema(() => zodSchema(exports_external3.object({
|
|
221047
|
+
var webSearchPreviewInputSchema = lazySchema(() => zodSchema(exports_external3.object({})));
|
|
221048
|
+
var webSearchPreviewOutputSchema = lazySchema(() => zodSchema(exports_external3.object({
|
|
220711
221049
|
action: exports_external3.discriminatedUnion("type", [
|
|
220712
221050
|
exports_external3.object({
|
|
220713
221051
|
type: exports_external3.literal("search"),
|
|
220714
|
-
query: exports_external3.string().
|
|
221052
|
+
query: exports_external3.string().optional()
|
|
220715
221053
|
}),
|
|
220716
221054
|
exports_external3.object({
|
|
220717
|
-
type: exports_external3.literal("
|
|
221055
|
+
type: exports_external3.literal("openPage"),
|
|
220718
221056
|
url: exports_external3.string()
|
|
220719
221057
|
}),
|
|
220720
221058
|
exports_external3.object({
|
|
@@ -220722,12 +221060,13 @@ var webSearchPreviewInputSchema = lazySchema(() => zodSchema(exports_external3.o
|
|
|
220722
221060
|
url: exports_external3.string(),
|
|
220723
221061
|
pattern: exports_external3.string()
|
|
220724
221062
|
})
|
|
220725
|
-
])
|
|
221063
|
+
])
|
|
220726
221064
|
})));
|
|
220727
|
-
var webSearchPreview =
|
|
221065
|
+
var webSearchPreview = createProviderDefinedToolFactoryWithOutputSchema({
|
|
220728
221066
|
id: "openai.web_search_preview",
|
|
220729
221067
|
name: "web_search_preview",
|
|
220730
|
-
inputSchema: webSearchPreviewInputSchema
|
|
221068
|
+
inputSchema: webSearchPreviewInputSchema,
|
|
221069
|
+
outputSchema: webSearchPreviewOutputSchema
|
|
220731
221070
|
});
|
|
220732
221071
|
var openaiTools = {
|
|
220733
221072
|
codeInterpreter,
|
|
@@ -220931,6 +221270,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
220931
221270
|
input.push(reasoningMessages[reasoningId]);
|
|
220932
221271
|
} else {
|
|
220933
221272
|
reasoningMessage.summary.push(...summaryParts);
|
|
221273
|
+
if ((providerOptions == null ? undefined : providerOptions.reasoningEncryptedContent) != null) {
|
|
221274
|
+
reasoningMessage.encrypted_content = providerOptions.reasoningEncryptedContent;
|
|
221275
|
+
}
|
|
220934
221276
|
}
|
|
220935
221277
|
}
|
|
220936
221278
|
} else {
|
|
@@ -221085,11 +221427,7 @@ var openaiResponsesChunkSchema = lazyValidator(() => zodSchema(exports_external3
|
|
|
221085
221427
|
exports_external3.object({
|
|
221086
221428
|
type: exports_external3.literal("web_search_call"),
|
|
221087
221429
|
id: exports_external3.string(),
|
|
221088
|
-
status: exports_external3.string()
|
|
221089
|
-
action: exports_external3.object({
|
|
221090
|
-
type: exports_external3.literal("search"),
|
|
221091
|
-
query: exports_external3.string().optional()
|
|
221092
|
-
}).nullish()
|
|
221430
|
+
status: exports_external3.string()
|
|
221093
221431
|
}),
|
|
221094
221432
|
exports_external3.object({
|
|
221095
221433
|
type: exports_external3.literal("computer_call"),
|
|
@@ -221171,7 +221509,7 @@ var openaiResponsesChunkSchema = lazyValidator(() => zodSchema(exports_external3
|
|
|
221171
221509
|
url: exports_external3.string(),
|
|
221172
221510
|
pattern: exports_external3.string()
|
|
221173
221511
|
})
|
|
221174
|
-
])
|
|
221512
|
+
])
|
|
221175
221513
|
}),
|
|
221176
221514
|
exports_external3.object({
|
|
221177
221515
|
type: exports_external3.literal("file_search_call"),
|
|
@@ -221259,6 +221597,11 @@ var openaiResponsesChunkSchema = lazyValidator(() => zodSchema(exports_external3
|
|
|
221259
221597
|
summary_index: exports_external3.number(),
|
|
221260
221598
|
delta: exports_external3.string()
|
|
221261
221599
|
}),
|
|
221600
|
+
exports_external3.object({
|
|
221601
|
+
type: exports_external3.literal("response.reasoning_summary_part.done"),
|
|
221602
|
+
item_id: exports_external3.string(),
|
|
221603
|
+
summary_index: exports_external3.number()
|
|
221604
|
+
}),
|
|
221262
221605
|
exports_external3.object({
|
|
221263
221606
|
type: exports_external3.literal("error"),
|
|
221264
221607
|
code: exports_external3.string(),
|
|
@@ -221336,7 +221679,7 @@ var openaiResponsesResponseSchema = lazyValidator(() => zodSchema(exports_extern
|
|
|
221336
221679
|
url: exports_external3.string(),
|
|
221337
221680
|
pattern: exports_external3.string()
|
|
221338
221681
|
})
|
|
221339
|
-
])
|
|
221682
|
+
])
|
|
221340
221683
|
}),
|
|
221341
221684
|
exports_external3.object({
|
|
221342
221685
|
type: exports_external3.literal("file_search_call"),
|
|
@@ -221830,7 +222173,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
221830
222173
|
tools: openaiTools2,
|
|
221831
222174
|
tool_choice: openaiToolChoice
|
|
221832
222175
|
},
|
|
221833
|
-
warnings: [...warnings, ...toolWarnings]
|
|
222176
|
+
warnings: [...warnings, ...toolWarnings],
|
|
222177
|
+
store
|
|
221834
222178
|
};
|
|
221835
222179
|
}
|
|
221836
222180
|
async doGenerate(options) {
|
|
@@ -221983,14 +222327,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
221983
222327
|
type: "tool-call",
|
|
221984
222328
|
toolCallId: part.id,
|
|
221985
222329
|
toolName: webSearchToolName != null ? webSearchToolName : "web_search",
|
|
221986
|
-
input: JSON.stringify({
|
|
222330
|
+
input: JSON.stringify({}),
|
|
221987
222331
|
providerExecuted: true
|
|
221988
222332
|
});
|
|
221989
222333
|
content3.push({
|
|
221990
222334
|
type: "tool-result",
|
|
221991
222335
|
toolCallId: part.id,
|
|
221992
222336
|
toolName: webSearchToolName != null ? webSearchToolName : "web_search",
|
|
221993
|
-
result:
|
|
222337
|
+
result: mapWebSearchOutput(part.action),
|
|
221994
222338
|
providerExecuted: true
|
|
221995
222339
|
});
|
|
221996
222340
|
break;
|
|
@@ -222103,7 +222447,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
222103
222447
|
const {
|
|
222104
222448
|
args: body,
|
|
222105
222449
|
warnings,
|
|
222106
|
-
webSearchToolName
|
|
222450
|
+
webSearchToolName,
|
|
222451
|
+
store
|
|
222107
222452
|
} = await this.getArgs(options);
|
|
222108
222453
|
const { responseHeaders, value: response } = await postJsonToApi({
|
|
222109
222454
|
url: this.config.url({
|
|
@@ -222139,7 +222484,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
222139
222484
|
controller.enqueue({ type: "stream-start", warnings });
|
|
222140
222485
|
},
|
|
222141
222486
|
transform(chunk, controller) {
|
|
222142
|
-
var _a18, _b8, _c, _d, _e3, _f, _g, _h, _i, _j, _k, _l, _m, _n2, _o, _p, _q, _r, _s, _t3, _u, _v
|
|
222487
|
+
var _a18, _b8, _c, _d, _e3, _f, _g, _h, _i, _j, _k, _l, _m, _n2, _o, _p, _q, _r, _s, _t3, _u, _v;
|
|
222143
222488
|
if (options.includeRawChunks) {
|
|
222144
222489
|
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
222145
222490
|
}
|
|
@@ -222171,6 +222516,17 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
222171
222516
|
toolName: webSearchToolName != null ? webSearchToolName : "web_search",
|
|
222172
222517
|
providerExecuted: true
|
|
222173
222518
|
});
|
|
222519
|
+
controller.enqueue({
|
|
222520
|
+
type: "tool-input-end",
|
|
222521
|
+
id: value.item.id
|
|
222522
|
+
});
|
|
222523
|
+
controller.enqueue({
|
|
222524
|
+
type: "tool-call",
|
|
222525
|
+
toolCallId: value.item.id,
|
|
222526
|
+
toolName: "web_search",
|
|
222527
|
+
input: JSON.stringify({}),
|
|
222528
|
+
providerExecuted: true
|
|
222529
|
+
});
|
|
222174
222530
|
} else if (value.item.type === "computer_call") {
|
|
222175
222531
|
ongoingToolCalls[value.output_index] = {
|
|
222176
222532
|
toolName: "computer_use",
|
|
@@ -222227,10 +222583,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
222227
222583
|
}
|
|
222228
222584
|
}
|
|
222229
222585
|
});
|
|
222230
|
-
} else if (
|
|
222586
|
+
} else if (isResponseOutputItemAddedChunk(value) && value.item.type === "reasoning") {
|
|
222231
222587
|
activeReasoning[value.item.id] = {
|
|
222232
222588
|
encryptedContent: value.item.encrypted_content,
|
|
222233
|
-
summaryParts:
|
|
222589
|
+
summaryParts: { 0: "active" }
|
|
222234
222590
|
};
|
|
222235
222591
|
controller.enqueue({
|
|
222236
222592
|
type: "reasoning-start",
|
|
@@ -222264,22 +222620,11 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
222264
222620
|
});
|
|
222265
222621
|
} else if (value.item.type === "web_search_call") {
|
|
222266
222622
|
ongoingToolCalls[value.output_index] = undefined;
|
|
222267
|
-
controller.enqueue({
|
|
222268
|
-
type: "tool-input-end",
|
|
222269
|
-
id: value.item.id
|
|
222270
|
-
});
|
|
222271
|
-
controller.enqueue({
|
|
222272
|
-
type: "tool-call",
|
|
222273
|
-
toolCallId: value.item.id,
|
|
222274
|
-
toolName: "web_search",
|
|
222275
|
-
input: JSON.stringify({ action: value.item.action }),
|
|
222276
|
-
providerExecuted: true
|
|
222277
|
-
});
|
|
222278
222623
|
controller.enqueue({
|
|
222279
222624
|
type: "tool-result",
|
|
222280
222625
|
toolCallId: value.item.id,
|
|
222281
222626
|
toolName: "web_search",
|
|
222282
|
-
result:
|
|
222627
|
+
result: mapWebSearchOutput(value.item.action),
|
|
222283
222628
|
providerExecuted: true
|
|
222284
222629
|
});
|
|
222285
222630
|
} else if (value.item.type === "computer_call") {
|
|
@@ -222369,9 +222714,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
222369
222714
|
type: "text-end",
|
|
222370
222715
|
id: value.item.id
|
|
222371
222716
|
});
|
|
222372
|
-
} else if (
|
|
222717
|
+
} else if (value.item.type === "reasoning") {
|
|
222373
222718
|
const activeReasoningPart = activeReasoning[value.item.id];
|
|
222374
|
-
|
|
222719
|
+
const summaryPartIndices = Object.entries(activeReasoningPart.summaryParts).filter(([_8, status]) => status === "active" || status === "can-conclude").map(([summaryIndex]) => summaryIndex);
|
|
222720
|
+
for (const summaryIndex of summaryPartIndices) {
|
|
222375
222721
|
controller.enqueue({
|
|
222376
222722
|
type: "reasoning-end",
|
|
222377
222723
|
id: `${value.item.id}:${summaryIndex}`,
|
|
@@ -222443,21 +222789,32 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
222443
222789
|
if (((_f = (_e3 = options.providerOptions) == null ? undefined : _e3.openai) == null ? undefined : _f.logprobs) && value.logprobs) {
|
|
222444
222790
|
logprobs.push(value.logprobs);
|
|
222445
222791
|
}
|
|
222446
|
-
} else if (
|
|
222792
|
+
} else if (value.type === "response.reasoning_summary_part.added") {
|
|
222447
222793
|
if (value.summary_index > 0) {
|
|
222448
|
-
|
|
222794
|
+
const activeReasoningPart = activeReasoning[value.item_id];
|
|
222795
|
+
activeReasoningPart.summaryParts[value.summary_index] = "active";
|
|
222796
|
+
for (const summaryIndex of Object.keys(activeReasoningPart.summaryParts)) {
|
|
222797
|
+
if (activeReasoningPart.summaryParts[summaryIndex] === "can-conclude") {
|
|
222798
|
+
controller.enqueue({
|
|
222799
|
+
type: "reasoning-end",
|
|
222800
|
+
id: `${value.item_id}:${summaryIndex}`,
|
|
222801
|
+
providerMetadata: { openai: { itemId: value.item_id } }
|
|
222802
|
+
});
|
|
222803
|
+
activeReasoningPart.summaryParts[summaryIndex] = "concluded";
|
|
222804
|
+
}
|
|
222805
|
+
}
|
|
222449
222806
|
controller.enqueue({
|
|
222450
222807
|
type: "reasoning-start",
|
|
222451
222808
|
id: `${value.item_id}:${value.summary_index}`,
|
|
222452
222809
|
providerMetadata: {
|
|
222453
222810
|
openai: {
|
|
222454
222811
|
itemId: value.item_id,
|
|
222455
|
-
reasoningEncryptedContent: (
|
|
222812
|
+
reasoningEncryptedContent: (_h = (_g = activeReasoning[value.item_id]) == null ? undefined : _g.encryptedContent) != null ? _h : null
|
|
222456
222813
|
}
|
|
222457
222814
|
}
|
|
222458
222815
|
});
|
|
222459
222816
|
}
|
|
222460
|
-
} else if (
|
|
222817
|
+
} else if (value.type === "response.reasoning_summary_text.delta") {
|
|
222461
222818
|
controller.enqueue({
|
|
222462
222819
|
type: "reasoning-delta",
|
|
222463
222820
|
id: `${value.item_id}:${value.summary_index}`,
|
|
@@ -222468,16 +222825,29 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
222468
222825
|
}
|
|
222469
222826
|
}
|
|
222470
222827
|
});
|
|
222828
|
+
} else if (value.type === "response.reasoning_summary_part.done") {
|
|
222829
|
+
if (store) {
|
|
222830
|
+
controller.enqueue({
|
|
222831
|
+
type: "reasoning-end",
|
|
222832
|
+
id: `${value.item_id}:${value.summary_index}`,
|
|
222833
|
+
providerMetadata: {
|
|
222834
|
+
openai: { itemId: value.item_id }
|
|
222835
|
+
}
|
|
222836
|
+
});
|
|
222837
|
+
activeReasoning[value.item_id].summaryParts[value.summary_index] = "concluded";
|
|
222838
|
+
} else {
|
|
222839
|
+
activeReasoning[value.item_id].summaryParts[value.summary_index] = "can-conclude";
|
|
222840
|
+
}
|
|
222471
222841
|
} else if (isResponseFinishedChunk(value)) {
|
|
222472
222842
|
finishReason = mapOpenAIResponseFinishReason({
|
|
222473
|
-
finishReason: (
|
|
222843
|
+
finishReason: (_i = value.response.incomplete_details) == null ? undefined : _i.reason,
|
|
222474
222844
|
hasFunctionCall
|
|
222475
222845
|
});
|
|
222476
222846
|
usage.inputTokens = value.response.usage.input_tokens;
|
|
222477
222847
|
usage.outputTokens = value.response.usage.output_tokens;
|
|
222478
222848
|
usage.totalTokens = value.response.usage.input_tokens + value.response.usage.output_tokens;
|
|
222479
|
-
usage.reasoningTokens = (
|
|
222480
|
-
usage.cachedInputTokens = (
|
|
222849
|
+
usage.reasoningTokens = (_k = (_j = value.response.usage.output_tokens_details) == null ? undefined : _j.reasoning_tokens) != null ? _k : undefined;
|
|
222850
|
+
usage.cachedInputTokens = (_m = (_l = value.response.usage.input_tokens_details) == null ? undefined : _l.cached_tokens) != null ? _m : undefined;
|
|
222481
222851
|
if (typeof value.response.service_tier === "string") {
|
|
222482
222852
|
serviceTier = value.response.service_tier;
|
|
222483
222853
|
}
|
|
@@ -222486,7 +222856,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
222486
222856
|
controller.enqueue({
|
|
222487
222857
|
type: "source",
|
|
222488
222858
|
sourceType: "url",
|
|
222489
|
-
id: (
|
|
222859
|
+
id: (_p = (_o = (_n2 = self2.config).generateId) == null ? undefined : _o.call(_n2)) != null ? _p : generateId(),
|
|
222490
222860
|
url: value.annotation.url,
|
|
222491
222861
|
title: value.annotation.title
|
|
222492
222862
|
});
|
|
@@ -222494,10 +222864,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
222494
222864
|
controller.enqueue({
|
|
222495
222865
|
type: "source",
|
|
222496
222866
|
sourceType: "document",
|
|
222497
|
-
id: (
|
|
222867
|
+
id: (_s = (_r = (_q = self2.config).generateId) == null ? undefined : _r.call(_q)) != null ? _s : generateId(),
|
|
222498
222868
|
mediaType: "text/plain",
|
|
222499
|
-
title: (
|
|
222500
|
-
filename: (
|
|
222869
|
+
title: (_u = (_t3 = value.annotation.quote) != null ? _t3 : value.annotation.filename) != null ? _u : "Document",
|
|
222870
|
+
filename: (_v = value.annotation.filename) != null ? _v : value.annotation.file_id
|
|
222501
222871
|
});
|
|
222502
222872
|
}
|
|
222503
222873
|
} else if (isErrorChunk(value)) {
|
|
@@ -222535,9 +222905,6 @@ function isTextDeltaChunk(chunk) {
|
|
|
222535
222905
|
function isResponseOutputItemDoneChunk(chunk) {
|
|
222536
222906
|
return chunk.type === "response.output_item.done";
|
|
222537
222907
|
}
|
|
222538
|
-
function isResponseOutputItemDoneReasoningChunk(chunk) {
|
|
222539
|
-
return isResponseOutputItemDoneChunk(chunk) && chunk.item.type === "reasoning";
|
|
222540
|
-
}
|
|
222541
222908
|
function isResponseFinishedChunk(chunk) {
|
|
222542
222909
|
return chunk.type === "response.completed" || chunk.type === "response.incomplete";
|
|
222543
222910
|
}
|
|
@@ -222556,18 +222923,9 @@ function isResponseCodeInterpreterCallCodeDoneChunk(chunk) {
|
|
|
222556
222923
|
function isResponseOutputItemAddedChunk(chunk) {
|
|
222557
222924
|
return chunk.type === "response.output_item.added";
|
|
222558
222925
|
}
|
|
222559
|
-
function isResponseOutputItemAddedReasoningChunk(chunk) {
|
|
222560
|
-
return isResponseOutputItemAddedChunk(chunk) && chunk.item.type === "reasoning";
|
|
222561
|
-
}
|
|
222562
222926
|
function isResponseAnnotationAddedChunk(chunk) {
|
|
222563
222927
|
return chunk.type === "response.output_text.annotation.added";
|
|
222564
222928
|
}
|
|
222565
|
-
function isResponseReasoningSummaryPartAddedChunk(chunk) {
|
|
222566
|
-
return chunk.type === "response.reasoning_summary_part.added";
|
|
222567
|
-
}
|
|
222568
|
-
function isResponseReasoningSummaryTextDeltaChunk(chunk) {
|
|
222569
|
-
return chunk.type === "response.reasoning_summary_text.delta";
|
|
222570
|
-
}
|
|
222571
222929
|
function isErrorChunk(chunk) {
|
|
222572
222930
|
return chunk.type === "error";
|
|
222573
222931
|
}
|
|
@@ -222605,6 +222963,19 @@ function getResponsesModelConfig(modelId) {
|
|
|
222605
222963
|
isReasoningModel: false
|
|
222606
222964
|
};
|
|
222607
222965
|
}
|
|
222966
|
+
function mapWebSearchOutput(action) {
|
|
222967
|
+
var _a18;
|
|
222968
|
+
switch (action.type) {
|
|
222969
|
+
case "search":
|
|
222970
|
+
return { action: { type: "search", query: (_a18 = action.query) != null ? _a18 : undefined } };
|
|
222971
|
+
case "open_page":
|
|
222972
|
+
return { action: { type: "openPage", url: action.url } };
|
|
222973
|
+
case "find":
|
|
222974
|
+
return {
|
|
222975
|
+
action: { type: "find", url: action.url, pattern: action.pattern }
|
|
222976
|
+
};
|
|
222977
|
+
}
|
|
222978
|
+
}
|
|
222608
222979
|
var openaiSpeechProviderOptionsSchema = lazyValidator(() => zodSchema(exports_external3.object({
|
|
222609
222980
|
instructions: exports_external3.string().nullish(),
|
|
222610
222981
|
speed: exports_external3.number().min(0.25).max(4).default(1).nullish()
|
|
@@ -222894,7 +223265,7 @@ var OpenAITranscriptionModel = class {
|
|
|
222894
223265
|
};
|
|
222895
223266
|
}
|
|
222896
223267
|
};
|
|
222897
|
-
var VERSION5 = "2.0.
|
|
223268
|
+
var VERSION5 = "2.0.52";
|
|
222898
223269
|
function createOpenAI(options = {}) {
|
|
222899
223270
|
var _a18, _b8;
|
|
222900
223271
|
const baseURL = (_a18 = withoutTrailingSlash(loadOptionalSetting({
|