@xyd-js/ask-ai-widget 0.0.0-build-2acf05c-20251207022018 → 0.0.0-build-83b15db-20251213220910

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.js CHANGED
@@ -75470,7 +75470,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
75470
75470
  exports.useTransition = function() {
75471
75471
  return resolveDispatcher().useTransition();
75472
75472
  };
75473
- exports.version = "19.2.1";
75473
+ exports.version = "19.2.3";
75474
75474
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
75475
75475
  })();
75476
75476
  });
@@ -75880,7 +75880,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
75880
75880
  exports.useFormStatus = function() {
75881
75881
  return resolveDispatcher().useHostTransitionStatus();
75882
75882
  };
75883
- exports.version = "19.2.1";
75883
+ exports.version = "19.2.3";
75884
75884
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
75885
75885
  })();
75886
75886
  });
@@ -81547,7 +81547,7 @@ $RC=function(a,b){if(b=document.getElementById(b))(a=document.getElementById(a))
81547
81547
  exports.renderToString = function(children, options) {
81548
81548
  return renderToStringImpl(children, options, false, 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server');
81549
81549
  };
81550
- exports.version = "19.2.1";
81550
+ exports.version = "19.2.3";
81551
81551
  })();
81552
81552
  });
81553
81553
  var require_react_dom_server_node_development = __commonJS22((exports) => {
@@ -86258,10 +86258,10 @@ Check the top-level render call using <` + componentName + ">.");
86258
86258
  }
86259
86259
  function ensureCorrectIsomorphicReactVersion() {
86260
86260
  var isomorphicReactPackageVersion = React.version;
86261
- if (isomorphicReactPackageVersion !== "19.2.1")
86261
+ if (isomorphicReactPackageVersion !== "19.2.3")
86262
86262
  throw Error(`Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:
86263
86263
  - react: ` + (isomorphicReactPackageVersion + `
86264
- - react-dom: 19.2.1
86264
+ - react-dom: 19.2.3
86265
86265
  Learn more: https://react.dev/warnings/version-mismatch`));
86266
86266
  }
86267
86267
  function createDrainHandler(destination, request) {
@@ -87596,7 +87596,7 @@ $RC=function(a,b){if(b=document.getElementById(b))(a=document.getElementById(a))
87596
87596
  }
87597
87597
  };
87598
87598
  };
87599
- exports.version = "19.2.1";
87599
+ exports.version = "19.2.3";
87600
87600
  })();
87601
87601
  });
87602
87602
  var exports_abap2 = {};
@@ -168343,8 +168343,8 @@ function Ue2(e488) {
168343
168343
  }), d29) : null;
168344
168344
  }
168345
168345
  var De2 = { name: "cosmo", type: "from-css", colors: { "list.focusForeground": "var(--syntax1)", "scrollbar.shadow": "var(--syntax2)", "tab.activeBorder": "var(--syntax1)", "widget.shadow": "var(--syntax2)", "activityBar.border": "var(--syntax3)", "editorGroup.border": "var(--syntax3)", "editorGroupHeader.tabsBorder": "var(--syntax3)", "editorWidget.border": "var(--syntax3)", "editorWidget.resizeBorder": "var(--syntax3)", "input.border": "var(--syntax3)", "notificationCenter.border": "var(--syntax3)", "notifications.border": "var(--syntax3)", "panel.border": "var(--syntax3)", "sideBar.border": "var(--syntax3)", "statusBar.border": "var(--syntax3)", "tab.border": "var(--syntax3)", "activityBar.background": "var(--syntax4)", "statusBar.background": "var(--syntax4)", "statusBar.noFolderBackground": "var(--syntax4)", "statusBar.debuggingBackground": "var(--syntax4)", "editorGroupHeader.tabsBackground": "var(--syntax5)", "editorWidget.background": "var(--syntax5)", "sideBar.background": "var(--syntax5)", "sideBarSectionHeader.background": "var(--syntax5)", "tab.inactiveBackground": "var(--syntax5)", "activityBarBadge.background": "var(--syntax6)", "activityBar.foreground": "var(--syntax6)", "statusBar.foreground": "var(--syntax7)", "input.placeholderForeground": "var(--syntax8)", "editorLineNumber.foreground": "var(--syntax9)", "editorLineNumber.activeForeground": "var(--syntax6)", foreground: "var(--syntax6)", "panelTitle.activeForeground": "var(--syntax6)", "sideBarTitle.foreground": "var(--syntax6)", "sideBarSectionHeader.foreground": "var(--syntax6)", "panelTitle.inactiveForeground": "var(--syntax10)", "tab.inactiveForeground": "var(--syntax10)", "list.highlightForeground": "var(--syntax10)", "editor.lineHighlightBackground": "var(--syntax11)", focusBorder: "var(--syntax12)", "button.background": "var(--syntax13)", "list.activeSelectionBackground": "var(--syntax13)", "list.focusBackground": "var(--syntax13)", "selection.background": "#B3D7FF", "list.inactiveSelectionBackground": "var(--syntax14)", "terminal.ansiBlack": "var(--syntax15)", "terminal.ansiBrightBlack": "var(--syntax15)", "terminal.ansiRed": "var(--syntax16)", "terminal.ansiBrightRed": "var(--syntax16)", "terminal.ansiGreen": "var(--syntax17)", "terminal.ansiBrightGreen": "var(--syntax17)", "terminal.ansiYellow": "var(--syntax18)", "terminal.ansiBrightYellow": "var(--syntax18)", "terminal.ansiBlue": "var(--syntax19)", "terminal.ansiBrightBlue": "var(--syntax19)", "terminal.ansiMagenta": "var(--syntax20)", "terminal.ansiBrightMagenta": "var(--syntax20)", "terminal.ansiCyan": "var(--syntax21)", "terminal.ansiBrightCyan": "var(--syntax21)" }, tokenColors: [{ scope: "new.expr entity.name", settings: { foreground: "var(--syntax22)" } }, { name: "Comments", scope: ["comment", "comment storage.type"], settings: { foreground: "var(--syntax23)", fontStyle: "italic" } }, { name: "CSS", scope: ["entity.other.attribute-name.pseudo-class.css", "entity.other.attribute-name.pseudo-class.scss", "entity.other.attribute-name.pseudo-element.css", "entity.other.attribute-name.pseudo-element.scss", "support.function.calc.css", "support.function.calc.scss", "support.type.property-name.css", "support.type.property-name.scss", "support.type.vendored.property-name.css", "support.type.vendored.property-name.scss", "meta.property-value.css support.constant", "meta.property-value.scss support.constant", "meta.property-value.css support.constant.property-value", "meta.property-value.scss support.constant.property-value", "support.function.transform.css", "support.function.transform.scss"], settings: { foreground: "var(--syntax20)" } }, { name: "Decorator", scope: ["meta.decorator", "meta.decorator punctuation.decorator", "meta.decorator variable.other.readwrite", "meta.decorator meta.function-call entity.name.function"], settings: { foreground: "var(--syntax18)" } }, { name: "Doctype", scope: ["meta.tag.sgml.html"], settings: { foreground: "var(--syntax9)" } }, { name: "Functions", scope: ["entity.name.function", "support.function"], settings: { foreground: "var(--syntax24)" } }, { name: "Keys", scope: ["meta.property-list meta.property-name", "support.type.property-name", "support.type.map.key", "entity.name.tag.yaml"], settings: { foreground: "var(--syntax24)" } }, { name: "Keywords", scope: ["keyword.control", "keyword.declaration", "keyword.expressions-and-types", "keyword.operator.new", "keyword.reserved", "keyword.statement", "storage.type", "storage.modifier", "constant.language", "variable.language.super", "variable.language.this", "text.html entity.name.tag", "meta.tag entity.name.tag", "meta.tag support.class", "string.regexp keyword.other"], settings: { foreground: "var(--syntax25)", fontStyle: "bold" } }, { name: "Operators", scope: ["storage.type.function.arrow", "meta.template.expression punctuation", "punctuation.separator.key-value", "meta.object-literal.key meta.brace.square", "meta.template.expression keyword.operator", "keyword.operator.or.regexp", "keyword.operator.quantifier", "punctuation.definition.group.regexp", "punctuation.definition.character-class"], settings: { foreground: "var(--syntax15)" } }, { scope: ["meta.tag entity.other.attribute-name", "constant.character.escape.backslash"], settings: { foreground: "var(--syntax26)" } }, { name: "Numbers", scope: ["constant.numeric", "keyword.other.unit", "constant.other.color"], settings: { foreground: "var(--syntax19)" } }, { name: "Strings", scope: ["string", "variable.parameter.url.scss", "markup.heading.markdown", "beginning.punctuation.definition.list.markdown", "meta.template.expression meta.embedded punctuation.definition.string.begin", "meta.template.expression meta.embedded punctuation.definition.string.end"], settings: { foreground: "var(--syntax27)" } }, { name: "Types", scope: ["meta.type", "meta.return.type", "entity.name.type", "support.type.primitive"], settings: { foreground: "var(--syntax22)" } }, { scope: ["meta.objectliteral variable.other.object", "entity.name.type.module", "entity.other.inherited-class", "variable.scss", "variable.other.bracket.shell", "entity.name.function.scss"], settings: { foreground: "var(--syntax21)" } }, { scope: ["keyword.control.at-rule", "meta.import variable.other.readwrite", "meta.definition.variable variable.other.readwrite", "meta.definition.variable variable.other.constant", "meta.template.expression variable.other.readwrite", "meta.template.expression variable.other.constant", "support.constant.property-value"], settings: { foreground: "var(--syntax15)" } }, { scope: ["variable.other.property", "variable.other.object.property", "support.variable.property"], settings: { foreground: "var(--syntax22)" } }] };
168346
- var Ve2 = ["annotation"];
168347
168346
  var We2 = ["annotation"];
168347
+ var Ve2 = ["annotation"];
168348
168348
  function Ge2(e488, n470, t481) {
168349
168349
  return Ye2.apply(this, arguments);
168350
168350
  }
@@ -168886,8 +168886,8 @@ function Dn(e488) {
168886
168886
  var t481 = e488.size, r325 = t481 === undefined ? "medium" : t481, a443 = e488.className;
168887
168887
  return import_react5.default.createElement("xyd-loader", { "data-size": r325, className: " lr0mq4l ".concat(a443 || "", " ") }, import_react5.default.createElement("div", { part: "dots" }, import_react5.default.createElement("div", { part: "dot" }), import_react5.default.createElement("div", { part: "dot" }), import_react5.default.createElement("div", { part: "dot" })));
168888
168888
  }
168889
- var Vn = import_react5.createContext({ highlighted: [] });
168890
- function Wn(e488) {
168889
+ var Wn = import_react5.createContext({ highlighted: [] });
168890
+ function Vn(e488) {
168891
168891
  var r325, a443 = import_react5.useState(p28(e488.codeblocks)), o237 = S2(a443, 2), l52 = o237[0], c105 = o237[1], u28 = import_react5.useState(true), s187 = S2(u28, 2), m82 = s187[0], v4 = s187[1];
168892
168892
  function p28(e489) {
168893
168893
  return e489 ? e489.map(function(e490) {
@@ -168948,7 +168948,7 @@ function Wn(e488) {
168948
168948
  }, n);
168949
168949
  }))();
168950
168950
  }, [e488.codeblocks]);
168951
- var f4 = import_react5.default.createElement(Vn, { value: { highlighted: l52 || [] } }, e488.children), h6 = (r325 = e488.codeblocks) === null || r325 === undefined ? undefined : r325.every(function(e489) {
168951
+ var f4 = import_react5.default.createElement(Wn, { value: { highlighted: l52 || [] } }, e488.children), h6 = (r325 = e488.codeblocks) === null || r325 === undefined ? undefined : r325.every(function(e489) {
168952
168952
  return e489.highlighted;
168953
168953
  });
168954
168954
  return h6 ? f4 : m82 ? import_react5.default.createElement(Dn, null) : f4;
@@ -169012,7 +169012,7 @@ function Jn(e488) {
169012
169012
  }(), n470;
169013
169013
  }
169014
169014
  function Qn(e488) {
169015
- return import_react5.default.createElement(import_react5.Suspense, { fallback: import_react5.default.createElement(Yn, null) }, import_react5.default.createElement(Wn, { codeblocks: e488.codeblocks, theme: e488.theme }, e488.children));
169015
+ return import_react5.default.createElement(import_react5.Suspense, { fallback: import_react5.default.createElement(Yn, null) }, import_react5.default.createElement(Vn, { codeblocks: e488.codeblocks, theme: e488.theme }, e488.children));
169016
169016
  }
169017
169017
  function et2() {
169018
169018
  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" }));
@@ -169045,12 +169045,12 @@ var nt2 = { mark: { name: "mark", Line: function(e488) {
169045
169045
  return import_react5.default.createElement(Qn.Bg, e488);
169046
169046
  } }, lineNumbers: { name: "line-numbers", Line: function(e488) {
169047
169047
  e488.annotation;
169048
- var t481 = w2(e488, Ve2);
169048
+ var t481 = w2(e488, We2);
169049
169049
  return import_react5.default.createElement(Qn.LineNumber, t481);
169050
169050
  } }, diff: { name: "diff", onlyIfAnnotated: true, transform: function(e488) {
169051
169051
  return [e488, E4(E4({}, e488), {}, { name: "mark", query: e488.query, diff: true })];
169052
169052
  }, Line: function(e488) {
169053
- var t481 = e488.annotation, r325 = w2(e488, We2);
169053
+ var t481 = e488.annotation, r325 = w2(e488, Ve2);
169054
169054
  return import_react5.default.createElement(import_react5.default.Fragment, null, import_react5.default.createElement("div", null, t481 == null ? undefined : t481.query), import_react5.default.createElement(Sn, { merge: r325 }));
169055
169055
  } } };
169056
169056
  function tt2(e488) {
@@ -169082,7 +169082,7 @@ function it2(e488) {
169082
169082
  return import_react5.default.createElement(Zn, null, import_react5.default.createElement(Qn, { codeblocks: e488.codeblocks, theme: e488.theme }, import_react5.default.createElement(lt2, e488)));
169083
169083
  }
169084
169084
  function lt2(e488) {
169085
- var t481, r325, o237 = import_react5.use(Vn).highlighted, i314 = import_react5.useContext(at3);
169085
+ var t481, r325, o237 = import_react5.use(Wn).highlighted, i314 = import_react5.useContext(at3);
169086
169086
  if (e488.kind === "secondary")
169087
169087
  return import_react5.default.createElement(ot2, { value: { size: e488.size, lineNumbers: e488.lineNumbers, descriptionHead: e488.descriptionHead, descriptionContent: e488.descriptionContent, descriptionIcon: e488.descriptionIcon, markdownFormat: e488.markdownFormat } }, import_react5.default.createElement(Qn.Pre, { codeblock: o237[0], handlers: [nt2.mark, nt2.bg, nt2.lineNumbers] }));
169088
169088
  typeof e488.size == "string" ? r325 = e488.size : typeof i314.scroll != "boolean" || i314.scroll || (r325 = "full");
@@ -210608,7 +210608,7 @@ function convertToPrettyString(message) {
210608
210608
  lines.push(` Call ID: ${tc.id}`);
210609
210609
  lines.push(" Args:");
210610
210610
  for (const [key, value] of Object.entries(tc.args))
210611
- lines.push(` ${key}: ${value}`);
210611
+ lines.push(` ${key}: ${typeof value === "object" ? JSON.stringify(value) : value}`);
210612
210612
  }
210613
210613
  }
210614
210614
  }
@@ -212548,7 +212548,7 @@ var BaseCallbackHandler = class extends BaseCallbackHandlerMethodsClass {
212548
212548
  static fromMethods(methods) {
212549
212549
 
212550
212550
  class Handler extends BaseCallbackHandler {
212551
- name = v4();
212551
+ name = v7();
212552
212552
  constructor() {
212553
212553
  super();
212554
212554
  Object.assign(this, methods);
@@ -212637,7 +212637,7 @@ function uuid7FromTime(timestamp2) {
212637
212637
  const msecs = typeof timestamp2 === "string" ? Date.parse(timestamp2) : timestamp2;
212638
212638
  return v7({ msecs, seq: 0 });
212639
212639
  }
212640
- var __version__ = "0.3.82";
212640
+ var __version__ = "0.3.87";
212641
212641
  var globalEnv;
212642
212642
  var isBrowser2 = () => typeof window !== "undefined" && typeof window.document !== "undefined";
212643
212643
  var isWebWorker2 = () => typeof globalThis === "object" && globalThis.constructor && globalThis.constructor.name === "DedicatedWorkerGlobalScope";
@@ -213788,7 +213788,10 @@ function replaceGetterValues(replacer) {
213788
213788
  return replacer.call(this, key, val);
213789
213789
  };
213790
213790
  }
213791
- function mergeRuntimeEnvIntoRun(run, cachedEnvVars) {
213791
+ function mergeRuntimeEnvIntoRun(run, cachedEnvVars, omitTracedRuntimeInfo) {
213792
+ if (omitTracedRuntimeInfo) {
213793
+ return run;
213794
+ }
213792
213795
  const runtimeEnv = getRuntimeEnvironment2();
213793
213796
  const envVars = cachedEnvVars ?? getLangSmithEnvVarsMetadata();
213794
213797
  const extra = run.extra ?? {};
@@ -214008,6 +214011,12 @@ class Client {
214008
214011
  writable: true,
214009
214012
  value: undefined
214010
214013
  });
214014
+ Object.defineProperty(this, "omitTracedRuntimeInfo", {
214015
+ enumerable: true,
214016
+ configurable: true,
214017
+ writable: true,
214018
+ value: undefined
214019
+ });
214011
214020
  Object.defineProperty(this, "tracingSampleRate", {
214012
214021
  enumerable: true,
214013
214022
  configurable: true,
@@ -214163,6 +214172,7 @@ class Client {
214163
214172
  });
214164
214173
  this.hideInputs = config2.hideInputs ?? config2.anonymizer ?? defaultConfig.hideInputs;
214165
214174
  this.hideOutputs = config2.hideOutputs ?? config2.anonymizer ?? defaultConfig.hideOutputs;
214175
+ this.omitTracedRuntimeInfo = config2.omitTracedRuntimeInfo ?? false;
214166
214176
  this.autoBatchTracing = config2.autoBatchTracing ?? this.autoBatchTracing;
214167
214177
  this.autoBatchQueue = new AutoBatchQueue(maxMemory);
214168
214178
  this.blockOnRootRunFinalization = config2.blockOnRootRunFinalization ?? this.blockOnRootRunFinalization;
@@ -214493,7 +214503,7 @@ class Client {
214493
214503
  async processRunOperation(item) {
214494
214504
  clearTimeout(this.autoBatchTimeout);
214495
214505
  this.autoBatchTimeout = undefined;
214496
- item.item = mergeRuntimeEnvIntoRun(item.item, this.cachedLSEnvVarsForMetadata);
214506
+ item.item = mergeRuntimeEnvIntoRun(item.item, this.cachedLSEnvVarsForMetadata, this.omitTracedRuntimeInfo);
214497
214507
  const itemPromise = this.autoBatchQueue.push(item);
214498
214508
  if (this.manualFlushMode) {
214499
214509
  return itemPromise;
@@ -214608,7 +214618,7 @@ class Client {
214608
214618
  }).catch(console.error);
214609
214619
  return;
214610
214620
  }
214611
- const mergedRunCreateParam = mergeRuntimeEnvIntoRun(runCreate, this.cachedLSEnvVarsForMetadata);
214621
+ const mergedRunCreateParam = mergeRuntimeEnvIntoRun(runCreate, this.cachedLSEnvVarsForMetadata, this.omitTracedRuntimeInfo);
214612
214622
  if (options?.apiKey !== undefined) {
214613
214623
  headers["x-api-key"] = options.apiKey;
214614
214624
  }
@@ -216096,6 +216106,39 @@ Message: ${Array.isArray(result.detail) ? result.detail.join(`
216096
216106
  return res;
216097
216107
  });
216098
216108
  }
216109
+ async deleteExamples(exampleIds, options) {
216110
+ exampleIds.forEach((id) => assertUuid(id));
216111
+ if (options?.hardDelete) {
216112
+ const path5 = this._getPlatformEndpointPath("datasets/examples/delete");
216113
+ await this.caller.call(async () => {
216114
+ const res = await this._fetch(`${this.apiUrl}${path5}`, {
216115
+ method: "POST",
216116
+ headers: { ...this.headers, "Content-Type": "application/json" },
216117
+ body: JSON.stringify({
216118
+ example_ids: exampleIds,
216119
+ hard_delete: true
216120
+ }),
216121
+ signal: AbortSignal.timeout(this.timeout_ms),
216122
+ ...this.fetchOptions
216123
+ });
216124
+ await raiseForStatus(res, "hard delete examples", true);
216125
+ return res;
216126
+ });
216127
+ } else {
216128
+ const params2 = new URLSearchParams;
216129
+ exampleIds.forEach((id) => params2.append("example_ids", id));
216130
+ await this.caller.call(async () => {
216131
+ const res = await this._fetch(`${this.apiUrl}/examples?${params2.toString()}`, {
216132
+ method: "DELETE",
216133
+ headers: this.headers,
216134
+ signal: AbortSignal.timeout(this.timeout_ms),
216135
+ ...this.fetchOptions
216136
+ });
216137
+ await raiseForStatus(res, "delete examples", true);
216138
+ return res;
216139
+ });
216140
+ }
216141
+ }
216099
216142
  async updateExample(exampleIdOrUpdate, update) {
216100
216143
  let exampleId;
216101
216144
  if (update) {
@@ -217904,7 +217947,8 @@ function isCallbackManagerLike(x4) {
217904
217947
  return typeof x4 === "object" && x4 != null && Array.isArray(x4.handlers);
217905
217948
  }
217906
217949
  function isRunnableConfigLike(x4) {
217907
- return x4 != null && typeof x4.callbacks === "object" && (containsLangChainTracerLike(x4.callbacks?.handlers) || containsLangChainTracerLike(x4.callbacks));
217950
+ const callbacks = x4?.callbacks;
217951
+ return x4 != null && typeof callbacks === "object" && (containsLangChainTracerLike(callbacks?.handlers) || containsLangChainTracerLike(callbacks));
217908
217952
  }
217909
217953
  function _getWriteReplicasFromEnv() {
217910
217954
  const envVar = getEnvironmentVariable2("LANGSMITH_RUNS_ENDPOINTS");
@@ -218044,7 +218088,7 @@ ${error2.stack}` : "");
218044
218088
  const { dottedOrder: currentDottedOrder, microsecondPrecisionDatestring } = convertToDottedOrderFormat(new Date(run.start_time).getTime(), run.id, run.execution_order);
218045
218089
  const storedRun = { ...run };
218046
218090
  const parentRun = this.getRunById(storedRun.parent_run_id);
218047
- if (storedRun.parent_run_id !== undefined) {
218091
+ if (storedRun.parent_run_id !== undefined)
218048
218092
  if (parentRun) {
218049
218093
  this._addChildRun(parentRun, storedRun);
218050
218094
  parentRun.child_execution_order = Math.max(parentRun.child_execution_order, storedRun.child_execution_order);
@@ -218053,8 +218097,9 @@ ${error2.stack}` : "");
218053
218097
  storedRun.dotted_order = [parentRun.dotted_order, currentDottedOrder].join(".");
218054
218098
  storedRun._serialized_start_time = microsecondPrecisionDatestring;
218055
218099
  }
218056
- }
218057
- } else {
218100
+ } else
218101
+ storedRun.parent_run_id = undefined;
218102
+ else {
218058
218103
  storedRun.trace_id = storedRun.id;
218059
218104
  storedRun.dotted_order = currentDottedOrder;
218060
218105
  storedRun._serialized_start_time = microsecondPrecisionDatestring;
@@ -218980,7 +219025,7 @@ var CallbackManager = class CallbackManager2 extends BaseCallbackManager {
218980
219025
  }
218981
219026
  async handleLLMStart(llm, prompts, runId = undefined, _parentRunId = undefined, extraParams = undefined, _tags = undefined, _metadata = undefined, runName = undefined) {
218982
219027
  return Promise.all(prompts.map(async (prompt, idx) => {
218983
- const runId_ = idx === 0 && runId ? runId : v4();
219028
+ const runId_ = idx === 0 && runId ? runId : v7();
218984
219029
  await Promise.all(this.handlers.map((handler) => {
218985
219030
  if (handler.ignoreLLM)
218986
219031
  return;
@@ -219002,7 +219047,7 @@ var CallbackManager = class CallbackManager2 extends BaseCallbackManager {
219002
219047
  }
219003
219048
  async handleChatModelStart(llm, messages, runId = undefined, _parentRunId = undefined, extraParams = undefined, _tags = undefined, _metadata = undefined, runName = undefined) {
219004
219049
  return Promise.all(messages.map(async (messageGroup, idx) => {
219005
- const runId_ = idx === 0 && runId ? runId : v4();
219050
+ const runId_ = idx === 0 && runId ? runId : v7();
219006
219051
  await Promise.all(this.handlers.map((handler) => {
219007
219052
  if (handler.ignoreLLM)
219008
219053
  return;
@@ -219027,7 +219072,7 @@ var CallbackManager = class CallbackManager2 extends BaseCallbackManager {
219027
219072
  return new CallbackManagerForLLMRun(runId_, this.handlers, this.inheritableHandlers, this.tags, this.inheritableTags, this.metadata, this.inheritableMetadata, this._parentRunId);
219028
219073
  }));
219029
219074
  }
219030
- async handleChainStart(chain, inputs, runId = v4(), runType = undefined, _tags = undefined, _metadata = undefined, runName = undefined) {
219075
+ async handleChainStart(chain, inputs, runId = v7(), runType = undefined, _tags = undefined, _metadata = undefined, runName = undefined) {
219031
219076
  await Promise.all(this.handlers.map((handler) => {
219032
219077
  if (handler.ignoreChain)
219033
219078
  return;
@@ -219046,7 +219091,7 @@ var CallbackManager = class CallbackManager2 extends BaseCallbackManager {
219046
219091
  }));
219047
219092
  return new CallbackManagerForChainRun(runId, this.handlers, this.inheritableHandlers, this.tags, this.inheritableTags, this.metadata, this.inheritableMetadata, this._parentRunId);
219048
219093
  }
219049
- async handleToolStart(tool, input, runId = v4(), _parentRunId = undefined, _tags = undefined, _metadata = undefined, runName = undefined) {
219094
+ async handleToolStart(tool, input, runId = v7(), _parentRunId = undefined, _tags = undefined, _metadata = undefined, runName = undefined) {
219050
219095
  await Promise.all(this.handlers.map((handler) => {
219051
219096
  if (handler.ignoreAgent)
219052
219097
  return;
@@ -219065,7 +219110,7 @@ var CallbackManager = class CallbackManager2 extends BaseCallbackManager {
219065
219110
  }));
219066
219111
  return new CallbackManagerForToolRun(runId, this.handlers, this.inheritableHandlers, this.tags, this.inheritableTags, this.metadata, this.inheritableMetadata, this._parentRunId);
219067
219112
  }
219068
- async handleRetrieverStart(retriever, query, runId = v4(), _parentRunId = undefined, _tags = undefined, _metadata = undefined, runName = undefined) {
219113
+ async handleRetrieverStart(retriever, query, runId = v7(), _parentRunId = undefined, _tags = undefined, _metadata = undefined, runName = undefined) {
219069
219114
  await Promise.all(this.handlers.map((handler) => {
219070
219115
  if (handler.ignoreRetriever)
219071
219116
  return;
@@ -219163,7 +219208,7 @@ var CallbackManager = class CallbackManager2 extends BaseCallbackManager {
219163
219208
  static fromHandlers(handlers) {
219164
219209
 
219165
219210
  class Handler extends BaseCallbackHandler {
219166
- name = v4();
219211
+ name = v7();
219167
219212
  constructor() {
219168
219213
  super();
219169
219214
  Object.assign(this, handlers);
@@ -219416,7 +219461,12 @@ function ensureConfig(config2) {
219416
219461
  if (empty2.timeout !== undefined) {
219417
219462
  if (empty2.timeout <= 0)
219418
219463
  throw new Error("Timeout must be a positive number");
219419
- const timeoutSignal = AbortSignal.timeout(empty2.timeout);
219464
+ const originalTimeoutMs = empty2.timeout;
219465
+ const timeoutSignal = AbortSignal.timeout(originalTimeoutMs);
219466
+ if (!empty2.metadata)
219467
+ empty2.metadata = {};
219468
+ if (empty2.metadata.timeoutMs === undefined)
219469
+ empty2.metadata.timeoutMs = originalTimeoutMs;
219420
219470
  if (empty2.signal !== undefined) {
219421
219471
  if ("any" in AbortSignal)
219422
219472
  empty2.signal = AbortSignal.any([empty2.signal, timeoutSignal]);
@@ -219794,12 +219844,19 @@ __export222(core_exports, {
219794
219844
  });
219795
219845
  var JsonPatchError = PatchError;
219796
219846
  var deepClone = _deepClone;
219847
+ function isDangerousKey(key) {
219848
+ return Object.getOwnPropertyNames(Object.prototype).includes(key);
219849
+ }
219797
219850
  var objOps = {
219798
219851
  add: function(obj, key, document4) {
219852
+ if (isDangerousKey(key))
219853
+ throw new TypeError("JSON-Patch: modifying `__proto__`, `constructor`, or `prototype` prop is banned for security reasons");
219799
219854
  obj[key] = this.value;
219800
219855
  return { newDocument: document4 };
219801
219856
  },
219802
219857
  remove: function(obj, key, document4) {
219858
+ if (isDangerousKey(key))
219859
+ throw new TypeError("JSON-Patch: modifying `__proto__`, `constructor`, or `prototype` prop is banned for security reasons");
219803
219860
  var removed = obj[key];
219804
219861
  delete obj[key];
219805
219862
  return {
@@ -219808,6 +219865,8 @@ var objOps = {
219808
219865
  };
219809
219866
  },
219810
219867
  replace: function(obj, key, document4) {
219868
+ if (isDangerousKey(key))
219869
+ throw new TypeError("JSON-Patch: modifying `__proto__`, `constructor`, or `prototype` prop is banned for security reasons");
219811
219870
  var removed = obj[key];
219812
219871
  obj[key] = this.value;
219813
219872
  return {
@@ -231206,7 +231265,7 @@ function interopZodTransformInputSchemaImpl(schema2, recursive, cache) {
231206
231265
  outputSchema = interopZodTransformInputSchemaImpl(schema2._zod.def.in, recursive, cache);
231207
231266
  if (recursive) {
231208
231267
  if (isZodObjectV4(outputSchema)) {
231209
- const outputShape = outputSchema._zod.def.shape;
231268
+ const outputShape = {};
231210
231269
  for (const [key, keySchema] of Object.entries(outputSchema._zod.def.shape))
231211
231270
  outputShape[key] = interopZodTransformInputSchemaImpl(keySchema, recursive, cache);
231212
231271
  outputSchema = clone2(outputSchema, {
@@ -231329,16 +231388,24 @@ graph TD;
231329
231388
  edgeGroups[commonPrefix].push(edge);
231330
231389
  }
231331
231390
  const seenSubgraphs = /* @__PURE__ */ new Set;
231391
+ function sortPrefixesByDepth(prefixes) {
231392
+ return [...prefixes].sort((a443, b8) => {
231393
+ return a443.split(":").length - b8.split(":").length;
231394
+ });
231395
+ }
231332
231396
  function addSubgraph(edges$1, prefix) {
231333
231397
  const selfLoop = edges$1.length === 1 && edges$1[0].source === edges$1[0].target;
231334
231398
  if (prefix && !selfLoop) {
231335
231399
  const subgraph = prefix.split(":").pop();
231336
- if (seenSubgraphs.has(subgraph))
231337
- throw new Error(`Found duplicate subgraph '${subgraph}' -- this likely means that you're reusing a subgraph node with the same name. Please adjust your graph to have subgraph nodes with unique names.`);
231338
- seenSubgraphs.add(subgraph);
231400
+ if (seenSubgraphs.has(prefix))
231401
+ throw new Error(`Found duplicate subgraph '${subgraph}' at '${prefix} -- this likely means that you're reusing a subgraph node with the same name. Please adjust your graph to have subgraph nodes with unique names.`);
231402
+ seenSubgraphs.add(prefix);
231339
231403
  mermaidGraph += ` subgraph ${subgraph}
231340
231404
  `;
231341
231405
  }
231406
+ const nestedPrefixes = sortPrefixesByDepth(Object.keys(edgeGroups).filter((nestedPrefix) => nestedPrefix.startsWith(`${prefix}:`) && nestedPrefix !== prefix && nestedPrefix.split(":").length === prefix.split(":").length + 1));
231407
+ for (const nestedPrefix of nestedPrefixes)
231408
+ addSubgraph(edgeGroups[nestedPrefix], nestedPrefix);
231342
231409
  for (const edge of edges$1) {
231343
231410
  const { source, target, data, conditional } = edge;
231344
231411
  let edgeLabel = "";
@@ -231353,9 +231420,6 @@ graph TD;
231353
231420
  mermaidGraph += ` ${_escapeNodeLabel(source)}${edgeLabel}${_escapeNodeLabel(target)};
231354
231421
  `;
231355
231422
  }
231356
- for (const nestedPrefix in edgeGroups)
231357
- if (nestedPrefix.startsWith(`${prefix}:`) && nestedPrefix !== prefix)
231358
- addSubgraph(edgeGroups[nestedPrefix], nestedPrefix);
231359
231423
  if (prefix && !selfLoop)
231360
231424
  mermaidGraph += ` end
231361
231425
  `;
@@ -233583,14 +233647,14 @@ __export222(json_schema_exports, {
233583
233647
  toJsonSchema: () => toJsonSchema,
233584
233648
  validatesOnlyStrings: () => validatesOnlyStrings
233585
233649
  });
233586
- function toJsonSchema(schema2) {
233650
+ function toJsonSchema(schema2, params2) {
233587
233651
  if (isZodSchemaV4(schema2)) {
233588
233652
  const inputSchema = interopZodTransformInputSchema(schema2, true);
233589
233653
  if (isZodObjectV4(inputSchema)) {
233590
233654
  const strictSchema = interopZodObjectStrict(inputSchema, true);
233591
- return toJSONSchema3(strictSchema);
233655
+ return toJSONSchema3(strictSchema, params2);
233592
233656
  } else
233593
- return toJSONSchema3(schema2);
233657
+ return toJSONSchema3(schema2, params2);
233594
233658
  }
233595
233659
  if (isZodSchemaV3(schema2))
233596
233660
  return zodToJsonSchema3(schema2);
@@ -241542,6 +241606,107 @@ function _stringify(content3) {
241542
241606
  return `${content3}`;
241543
241607
  }
241544
241608
  }
241609
+ var ComputerUseScreenshotActionSchema = exports_external2.object({ type: exports_external2.literal("screenshot") });
241610
+ var ComputerUseClickActionSchema = exports_external2.object({
241611
+ type: exports_external2.literal("click"),
241612
+ x: exports_external2.number(),
241613
+ y: exports_external2.number(),
241614
+ button: exports_external2.enum([
241615
+ "left",
241616
+ "right",
241617
+ "wheel",
241618
+ "back",
241619
+ "forward"
241620
+ ]).default("left")
241621
+ });
241622
+ var ComputerUseDoubleClickActionSchema = exports_external2.object({
241623
+ type: exports_external2.literal("double_click"),
241624
+ x: exports_external2.number(),
241625
+ y: exports_external2.number(),
241626
+ button: exports_external2.enum([
241627
+ "left",
241628
+ "right",
241629
+ "wheel",
241630
+ "back",
241631
+ "forward"
241632
+ ]).default("left")
241633
+ });
241634
+ var ComputerUseDragActionSchema = exports_external2.object({
241635
+ type: exports_external2.literal("drag"),
241636
+ path: exports_external2.array(exports_external2.object({
241637
+ x: exports_external2.number(),
241638
+ y: exports_external2.number()
241639
+ }))
241640
+ });
241641
+ var ComputerUseKeypressActionSchema = exports_external2.object({
241642
+ type: exports_external2.literal("keypress"),
241643
+ keys: exports_external2.array(exports_external2.string())
241644
+ });
241645
+ var ComputerUseMoveActionSchema = exports_external2.object({
241646
+ type: exports_external2.literal("move"),
241647
+ x: exports_external2.number(),
241648
+ y: exports_external2.number()
241649
+ });
241650
+ var ComputerUseScrollActionSchema = exports_external2.object({
241651
+ type: exports_external2.literal("scroll"),
241652
+ x: exports_external2.number(),
241653
+ y: exports_external2.number(),
241654
+ scroll_x: exports_external2.number(),
241655
+ scroll_y: exports_external2.number()
241656
+ });
241657
+ var ComputerUseTypeActionSchema = exports_external2.object({
241658
+ type: exports_external2.literal("type"),
241659
+ text: exports_external2.string()
241660
+ });
241661
+ var ComputerUseWaitActionSchema = exports_external2.object({
241662
+ type: exports_external2.literal("wait"),
241663
+ duration: exports_external2.number().optional()
241664
+ });
241665
+ var ComputerUseActionUnionSchema = exports_external2.discriminatedUnion("type", [
241666
+ ComputerUseScreenshotActionSchema,
241667
+ ComputerUseClickActionSchema,
241668
+ ComputerUseDoubleClickActionSchema,
241669
+ ComputerUseDragActionSchema,
241670
+ ComputerUseKeypressActionSchema,
241671
+ ComputerUseMoveActionSchema,
241672
+ ComputerUseScrollActionSchema,
241673
+ ComputerUseTypeActionSchema,
241674
+ ComputerUseWaitActionSchema
241675
+ ]);
241676
+ var ComputerUseActionSchema = exports_external2.object({ action: ComputerUseActionUnionSchema });
241677
+ var LocalShellExecActionSchema = exports_external2.object({
241678
+ type: exports_external2.literal("exec"),
241679
+ command: exports_external2.array(exports_external2.string()),
241680
+ env: exports_external2.record(exports_external2.string(), exports_external2.string()).optional(),
241681
+ working_directory: exports_external2.string().optional(),
241682
+ timeout_ms: exports_external2.number().optional(),
241683
+ user: exports_external2.string().optional()
241684
+ });
241685
+ var LocalShellActionSchema = exports_external2.discriminatedUnion("type", [LocalShellExecActionSchema]);
241686
+ var ShellActionSchema = exports_external2.object({
241687
+ commands: exports_external2.array(exports_external2.string()).describe("Array of shell commands to execute"),
241688
+ timeout_ms: exports_external2.number().optional().describe("Optional timeout in milliseconds for the commands"),
241689
+ max_output_length: exports_external2.number().optional().describe("Optional maximum number of characters to return from each command")
241690
+ });
241691
+ var ApplyPatchCreateFileOperationSchema = exports_external2.object({
241692
+ type: exports_external2.literal("create_file"),
241693
+ path: exports_external2.string(),
241694
+ diff: exports_external2.string()
241695
+ });
241696
+ var ApplyPatchUpdateFileOperationSchema = exports_external2.object({
241697
+ type: exports_external2.literal("update_file"),
241698
+ path: exports_external2.string(),
241699
+ diff: exports_external2.string()
241700
+ });
241701
+ var ApplyPatchDeleteFileOperationSchema = exports_external2.object({
241702
+ type: exports_external2.literal("delete_file"),
241703
+ path: exports_external2.string()
241704
+ });
241705
+ var ApplyPatchOperationSchema = exports_external2.discriminatedUnion("type", [
241706
+ ApplyPatchCreateFileOperationSchema,
241707
+ ApplyPatchUpdateFileOperationSchema,
241708
+ ApplyPatchDeleteFileOperationSchema
241709
+ ]);
241545
241710
  var Document = class {
241546
241711
  pageContent;
241547
241712
  metadata;
@@ -258051,7 +258216,7 @@ var optionalType3 = ZodOptional6.create;
258051
258216
  var nullableType3 = ZodNullable6.create;
258052
258217
  var preprocessType3 = ZodEffects3.createWithPreprocess;
258053
258218
  var pipelineType3 = ZodPipeline3.create;
258054
- // ../../node_modules/.pnpm/@ai-sdk+provider-utils@3.0.18_zod@3.25.76/node_modules/@ai-sdk/provider-utils/dist/index.mjs
258219
+ // ../../node_modules/.pnpm/@ai-sdk+provider-utils@3.0.19_zod@3.25.76/node_modules/@ai-sdk/provider-utils/dist/index.mjs
258055
258220
  function combineHeaders(...headers) {
258056
258221
  return headers.reduce((combinedHeaders, currentHeaders) => ({
258057
258222
  ...combinedHeaders,
@@ -258241,7 +258406,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
258241
258406
  normalizedHeaders.set("user-agent", [currentUserAgentHeader, ...userAgentSuffixParts].filter(Boolean).join(" "));
258242
258407
  return Object.fromEntries(normalizedHeaders.entries());
258243
258408
  }
258244
- var VERSION2 = "3.0.18";
258409
+ var VERSION2 = "3.0.19";
258245
258410
  var getOriginalFetch = () => globalThis.fetch;
258246
258411
  var getFromApi = async ({
258247
258412
  url: url3,
@@ -258680,9 +258845,6 @@ var postToApi = async ({
258680
258845
  function tool2(tool22) {
258681
258846
  return tool22;
258682
258847
  }
258683
- function dynamicTool(tool22) {
258684
- return { ...tool22, type: "dynamic" };
258685
- }
258686
258848
  function createProviderDefinedToolFactory({
258687
258849
  id,
258688
258850
  name: name14,
@@ -258864,6 +259026,25 @@ var createBinaryResponseHandler = () => async ({ response, url: url3, requestBod
258864
259026
  });
258865
259027
  }
258866
259028
  };
259029
+ function addAdditionalPropertiesToJsonSchema(jsonSchema2) {
259030
+ if (jsonSchema2.type === "object") {
259031
+ jsonSchema2.additionalProperties = false;
259032
+ const properties = jsonSchema2.properties;
259033
+ if (properties != null) {
259034
+ for (const property in properties) {
259035
+ properties[property] = addAdditionalPropertiesToJsonSchema(properties[property]);
259036
+ }
259037
+ }
259038
+ }
259039
+ if (jsonSchema2.type === "array" && jsonSchema2.items != null) {
259040
+ if (Array.isArray(jsonSchema2.items)) {
259041
+ jsonSchema2.items = jsonSchema2.items.map((item) => addAdditionalPropertiesToJsonSchema(item));
259042
+ } else {
259043
+ jsonSchema2.items = addAdditionalPropertiesToJsonSchema(jsonSchema2.items);
259044
+ }
259045
+ }
259046
+ return jsonSchema2;
259047
+ }
258867
259048
  var getRelativePath2 = (pathA, pathB) => {
258868
259049
  let i155 = 0;
258869
259050
  for (;i155 < pathA.length && i155 < pathB.length; i155++) {
@@ -259873,11 +260054,11 @@ function zod3Schema(zodSchema2, options) {
259873
260054
  function zod4Schema(zodSchema2, options) {
259874
260055
  var _a15;
259875
260056
  const useReferences = (_a15 = options == null ? undefined : options.useReferences) != null ? _a15 : false;
259876
- return jsonSchema(() => toJSONSchema4(zodSchema2, {
260057
+ return jsonSchema(() => addAdditionalPropertiesToJsonSchema(toJSONSchema4(zodSchema2, {
259877
260058
  target: "draft-7",
259878
- io: "output",
260059
+ io: "input",
259879
260060
  reused: useReferences ? "ref" : "inline"
259880
- }), {
260061
+ })), {
259881
260062
  validate: async (value) => {
259882
260063
  const result = await safeParseAsync7(zodSchema2, value);
259883
260064
  return result.success ? { success: true, value: result.data } : { success: false, error: result.error };
@@ -259969,7 +260150,7 @@ async function* executeTool({
259969
260150
  }
259970
260151
  }
259971
260152
 
259972
- // ../../node_modules/.pnpm/@ai-sdk+gateway@2.0.18_zod@3.25.76/node_modules/@ai-sdk/gateway/dist/index.mjs
260153
+ // ../../node_modules/.pnpm/@ai-sdk+gateway@2.0.21_zod@3.25.76/node_modules/@ai-sdk/gateway/dist/index.mjs
259973
260154
  var import_oidc = __toESM(require_dist4(), 1);
259974
260155
  var import_oidc2 = __toESM(require_dist4(), 1);
259975
260156
  var marker15 = "vercel.ai.gateway.error";
@@ -260607,7 +260788,7 @@ async function getVercelRequestId() {
260607
260788
  var _a82;
260608
260789
  return (_a82 = import_oidc.getContext().headers) == null ? undefined : _a82["x-vercel-id"];
260609
260790
  }
260610
- var VERSION3 = "2.0.18";
260791
+ var VERSION3 = "2.0.21";
260611
260792
  var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
260612
260793
  function createGatewayProvider(options = {}) {
260613
260794
  var _a82, _b8;
@@ -260743,7 +260924,7 @@ async function getGatewayAuthToken(options) {
260743
260924
  }
260744
260925
  }
260745
260926
 
260746
- // ../../node_modules/.pnpm/ai@5.0.108_zod@3.25.76/node_modules/ai/dist/index.mjs
260927
+ // ../../node_modules/.pnpm/ai@5.0.113_zod@3.25.76/node_modules/ai/dist/index.mjs
260747
260928
  var import_api2 = __toESM(require_src6(), 1);
260748
260929
  var import_api3 = __toESM(require_src6(), 1);
260749
260930
  var __defProp5 = Object.defineProperty;
@@ -261147,7 +261328,7 @@ function detectMediaType({
261147
261328
  }
261148
261329
  return;
261149
261330
  }
261150
- var VERSION4 = "5.0.108";
261331
+ var VERSION4 = "5.0.113";
261151
261332
  var download = async ({ url: url3 }) => {
261152
261333
  var _a16;
261153
261334
  const urlText = url3.toString();
@@ -261739,14 +261920,25 @@ async function standardizePrompt(prompt) {
261739
261920
  };
261740
261921
  }
261741
261922
  function wrapGatewayError(error42) {
261742
- if (GatewayAuthenticationError.isInstance(error42) || GatewayModelNotFoundError.isInstance(error42)) {
261923
+ if (!GatewayAuthenticationError.isInstance(error42))
261924
+ return error42;
261925
+ const isProductionEnv = (process == null ? undefined : "production") === "production";
261926
+ const moreInfoURL = "https://ai-sdk.dev/unauthenticated-ai-gateway";
261927
+ if (isProductionEnv) {
261743
261928
  return new AISDKError({
261744
261929
  name: "GatewayError",
261745
- 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.",
261746
- cause: error42
261930
+ message: `Unauthenticated. Configure AI_GATEWAY_API_KEY or use a provider module. Learn more: ${moreInfoURL}`
261747
261931
  });
261748
261932
  }
261749
- return error42;
261933
+ return Object.assign(new Error(`\x1B[1m\x1B[31mUnauthenticated request to AI Gateway.\x1B[0m
261934
+
261935
+ To authenticate, set the \x1B[33mAI_GATEWAY_API_KEY\x1B[0m environment variable with your API key.
261936
+
261937
+ Alternatively, you can use a provider module instead of the AI Gateway.
261938
+
261939
+ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
261940
+
261941
+ `), { name: "GatewayAuthenticationError" });
261750
261942
  }
261751
261943
  function assembleOperationName({
261752
261944
  operationId,
@@ -265425,6 +265617,102 @@ var uiMessagesSchema = lazyValidator(() => zodSchema(exports_external3.array(exp
265425
265617
  })
265426
265618
  ])).nonempty("Message must contain at least one part")
265427
265619
  })).nonempty("Messages array must not be empty")));
265620
+ // ../../node_modules/.pnpm/@ai-sdk+provider-utils@3.0.18_zod@3.25.76/node_modules/@ai-sdk/provider-utils/dist/index.mjs
265621
+ var createIdGenerator2 = ({
265622
+ prefix,
265623
+ size = 16,
265624
+ alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
265625
+ separator = "-"
265626
+ } = {}) => {
265627
+ const generator = () => {
265628
+ const alphabetLength = alphabet.length;
265629
+ const chars = new Array(size);
265630
+ for (let i155 = 0;i155 < size; i155++) {
265631
+ chars[i155] = alphabet[Math.random() * alphabetLength | 0];
265632
+ }
265633
+ return chars.join("");
265634
+ };
265635
+ if (prefix == null) {
265636
+ return generator;
265637
+ }
265638
+ if (alphabet.includes(separator)) {
265639
+ throw new InvalidArgumentError({
265640
+ argument: "separator",
265641
+ message: `The separator "${separator}" must not be part of the alphabet "${alphabet}".`
265642
+ });
265643
+ }
265644
+ return () => `${prefix}${separator}${generator()}`;
265645
+ };
265646
+ var generateId2 = createIdGenerator2();
265647
+ function getRuntimeEnvironmentUserAgent2(globalThisAny = globalThis) {
265648
+ var _a16, _b8, _c;
265649
+ if (globalThisAny.window) {
265650
+ return `runtime/browser`;
265651
+ }
265652
+ if ((_a16 = globalThisAny.navigator) == null ? undefined : _a16.userAgent) {
265653
+ return `runtime/${globalThisAny.navigator.userAgent.toLowerCase()}`;
265654
+ }
265655
+ if ((_c = (_b8 = globalThisAny.process) == null ? undefined : _b8.versions) == null ? undefined : _c.node) {
265656
+ return `runtime/node.js/${globalThisAny.process.version.substring(0)}`;
265657
+ }
265658
+ if (globalThisAny.EdgeRuntime) {
265659
+ return `runtime/vercel-edge`;
265660
+ }
265661
+ return "runtime/unknown";
265662
+ }
265663
+ function normalizeHeaders3(headers) {
265664
+ if (headers == null) {
265665
+ return {};
265666
+ }
265667
+ const normalized = {};
265668
+ if (headers instanceof Headers) {
265669
+ headers.forEach((value, key) => {
265670
+ normalized[key.toLowerCase()] = value;
265671
+ });
265672
+ } else {
265673
+ if (!Array.isArray(headers)) {
265674
+ headers = Object.entries(headers);
265675
+ }
265676
+ for (const [key, value] of headers) {
265677
+ if (value != null) {
265678
+ normalized[key.toLowerCase()] = value;
265679
+ }
265680
+ }
265681
+ }
265682
+ return normalized;
265683
+ }
265684
+ function withUserAgentSuffix2(headers, ...userAgentSuffixParts) {
265685
+ const normalizedHeaders = new Headers(normalizeHeaders3(headers));
265686
+ const currentUserAgentHeader = normalizedHeaders.get("user-agent") || "";
265687
+ normalizedHeaders.set("user-agent", [currentUserAgentHeader, ...userAgentSuffixParts].filter(Boolean).join(" "));
265688
+ return Object.fromEntries(normalizedHeaders.entries());
265689
+ }
265690
+ var validatorSymbol2 = Symbol.for("vercel.ai.validator");
265691
+ function tool3(tool22) {
265692
+ return tool22;
265693
+ }
265694
+ function dynamicTool(tool22) {
265695
+ return { ...tool22, type: "dynamic" };
265696
+ }
265697
+ var ignoreOverride5 = Symbol("Let zodToJsonSchema decide on which parser to use");
265698
+ var ALPHA_NUMERIC5 = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
265699
+ var schemaSymbol2 = Symbol.for("vercel.ai.schema");
265700
+ function jsonSchema2(jsonSchema22, {
265701
+ validate: validate5
265702
+ } = {}) {
265703
+ return {
265704
+ [schemaSymbol2]: true,
265705
+ _type: undefined,
265706
+ [validatorSymbol2]: true,
265707
+ get jsonSchema() {
265708
+ if (typeof jsonSchema22 === "function") {
265709
+ jsonSchema22 = jsonSchema22();
265710
+ }
265711
+ return jsonSchema22;
265712
+ },
265713
+ validate: validate5
265714
+ };
265715
+ }
265428
265716
 
265429
265717
  // ../../node_modules/.pnpm/pkce-challenge@5.0.1/node_modules/pkce-challenge/dist/index.node.js
265430
265718
  var crypto3;
@@ -266355,7 +266643,7 @@ var SseMCPTransport = class {
266355
266643
  headers["Authorization"] = `Bearer ${tokens.access_token}`;
266356
266644
  }
266357
266645
  }
266358
- return withUserAgentSuffix(headers, `ai-sdk/${VERSION5}`, getRuntimeEnvironmentUserAgent());
266646
+ return withUserAgentSuffix2(headers, `ai-sdk/${VERSION5}`, getRuntimeEnvironmentUserAgent2());
266359
266647
  }
266360
266648
  async start() {
266361
266649
  return new Promise((resolve2, reject) => {
@@ -266557,7 +266845,7 @@ var HttpMCPTransport = class {
266557
266845
  headers["Authorization"] = `Bearer ${tokens.access_token}`;
266558
266846
  }
266559
266847
  }
266560
- return withUserAgentSuffix(headers, `ai-sdk/${VERSION5}`, getRuntimeEnvironmentUserAgent());
266848
+ return withUserAgentSuffix2(headers, `ai-sdk/${VERSION5}`, getRuntimeEnvironmentUserAgent2());
266561
266849
  }
266562
266850
  async start() {
266563
266851
  if (this.abortController) {
@@ -267139,13 +267427,13 @@ var DefaultMCPClient = class {
267139
267427
  };
267140
267428
  const toolWithExecute = schemas3 === "automatic" ? dynamicTool({
267141
267429
  description,
267142
- inputSchema: jsonSchema({
267430
+ inputSchema: jsonSchema2({
267143
267431
  ...inputSchema,
267144
267432
  properties: (_a35 = inputSchema.properties) != null ? _a35 : {},
267145
267433
  additionalProperties: false
267146
267434
  }),
267147
267435
  execute
267148
- }) : tool2({
267436
+ }) : tool3({
267149
267437
  description,
267150
267438
  inputSchema: schemas3[name34].inputSchema,
267151
267439
  execute
@@ -267618,8 +267906,8 @@ function S4(t480) {
267618
267906
  }, S4(t480);
267619
267907
  }
267620
267908
 
267621
- // ../../node_modules/.pnpm/@ai-sdk+anthropic@2.0.53_zod@3.25.76/node_modules/@ai-sdk/anthropic/dist/index.mjs
267622
- var VERSION6 = "2.0.53";
267909
+ // ../../node_modules/.pnpm/@ai-sdk+anthropic@2.0.56_zod@3.25.76/node_modules/@ai-sdk/anthropic/dist/index.mjs
267910
+ var VERSION6 = "2.0.56";
267623
267911
  var anthropicErrorDataSchema = lazySchema(() => zodSchema(exports_external3.object({
267624
267912
  type: exports_external3.literal("error"),
267625
267913
  error: exports_external3.object({
@@ -267698,11 +267986,18 @@ var anthropicMessagesResponseSchema = lazySchema(() => zodSchema(exports_externa
267698
267986
  type: exports_external3.literal("document"),
267699
267987
  title: exports_external3.string().nullable(),
267700
267988
  citations: exports_external3.object({ enabled: exports_external3.boolean() }).optional(),
267701
- source: exports_external3.object({
267702
- type: exports_external3.literal("text"),
267703
- media_type: exports_external3.string(),
267704
- data: exports_external3.string()
267705
- })
267989
+ source: exports_external3.union([
267990
+ exports_external3.object({
267991
+ type: exports_external3.literal("base64"),
267992
+ media_type: exports_external3.literal("application/pdf"),
267993
+ data: exports_external3.string()
267994
+ }),
267995
+ exports_external3.object({
267996
+ type: exports_external3.literal("text"),
267997
+ media_type: exports_external3.literal("text/plain"),
267998
+ data: exports_external3.string()
267999
+ })
268000
+ ])
267706
268001
  })
267707
268002
  }),
267708
268003
  exports_external3.object({
@@ -267865,11 +268160,18 @@ var anthropicMessagesChunkSchema = lazySchema(() => zodSchema(exports_external3.
267865
268160
  type: exports_external3.literal("document"),
267866
268161
  title: exports_external3.string().nullable(),
267867
268162
  citations: exports_external3.object({ enabled: exports_external3.boolean() }).optional(),
267868
- source: exports_external3.object({
267869
- type: exports_external3.literal("text"),
267870
- media_type: exports_external3.string(),
267871
- data: exports_external3.string()
267872
- })
268163
+ source: exports_external3.union([
268164
+ exports_external3.object({
268165
+ type: exports_external3.literal("base64"),
268166
+ media_type: exports_external3.literal("application/pdf"),
268167
+ data: exports_external3.string()
268168
+ }),
268169
+ exports_external3.object({
268170
+ type: exports_external3.literal("text"),
268171
+ media_type: exports_external3.literal("text/plain"),
268172
+ data: exports_external3.string()
268173
+ })
268174
+ ])
267873
268175
  })
267874
268176
  }),
267875
268177
  exports_external3.object({
@@ -268161,7 +268463,7 @@ var webSearch_20250305ArgsSchema = lazySchema(() => zodSchema(exports_external3.
268161
268463
  })));
268162
268464
  var webSearch_20250305OutputSchema = lazySchema(() => zodSchema(exports_external3.array(exports_external3.object({
268163
268465
  url: exports_external3.string(),
268164
- title: exports_external3.string(),
268466
+ title: exports_external3.string().nullable(),
268165
268467
  pageAge: exports_external3.string().nullable(),
268166
268468
  encryptedContent: exports_external3.string(),
268167
268469
  type: exports_external3.literal("web_search_result")
@@ -268190,7 +268492,7 @@ var webFetch_20250910OutputSchema = lazySchema(() => zodSchema(exports_external3
268190
268492
  url: exports_external3.string(),
268191
268493
  content: exports_external3.object({
268192
268494
  type: exports_external3.literal("document"),
268193
- title: exports_external3.string(),
268495
+ title: exports_external3.string().nullable(),
268194
268496
  citations: exports_external3.object({ enabled: exports_external3.boolean() }).optional(),
268195
268497
  source: exports_external3.union([
268196
268498
  exports_external3.object({
@@ -268233,23 +268535,23 @@ async function prepareTools({
268233
268535
  return { tools: undefined, toolChoice: undefined, toolWarnings, betas };
268234
268536
  }
268235
268537
  const anthropicTools2 = [];
268236
- for (const tool3 of tools) {
268237
- switch (tool3.type) {
268538
+ for (const tool4 of tools) {
268539
+ switch (tool4.type) {
268238
268540
  case "function": {
268239
- const cacheControl = validator4.getCacheControl(tool3.providerOptions, {
268541
+ const cacheControl = validator4.getCacheControl(tool4.providerOptions, {
268240
268542
  type: "tool definition",
268241
268543
  canCache: true
268242
268544
  });
268243
268545
  anthropicTools2.push({
268244
- name: tool3.name,
268245
- description: tool3.description,
268246
- input_schema: tool3.inputSchema,
268546
+ name: tool4.name,
268547
+ description: tool4.description,
268548
+ input_schema: tool4.inputSchema,
268247
268549
  cache_control: cacheControl
268248
268550
  });
268249
268551
  break;
268250
268552
  }
268251
268553
  case "provider-defined": {
268252
- switch (tool3.id) {
268554
+ switch (tool4.id) {
268253
268555
  case "anthropic.code_execution_20250522": {
268254
268556
  betas.add("code-execution-2025-05-22");
268255
268557
  anthropicTools2.push({
@@ -268272,9 +268574,9 @@ async function prepareTools({
268272
268574
  anthropicTools2.push({
268273
268575
  name: "computer",
268274
268576
  type: "computer_20250124",
268275
- display_width_px: tool3.args.displayWidthPx,
268276
- display_height_px: tool3.args.displayHeightPx,
268277
- display_number: tool3.args.displayNumber,
268577
+ display_width_px: tool4.args.displayWidthPx,
268578
+ display_height_px: tool4.args.displayHeightPx,
268579
+ display_number: tool4.args.displayNumber,
268278
268580
  cache_control: undefined
268279
268581
  });
268280
268582
  break;
@@ -268284,9 +268586,9 @@ async function prepareTools({
268284
268586
  anthropicTools2.push({
268285
268587
  name: "computer",
268286
268588
  type: "computer_20241022",
268287
- display_width_px: tool3.args.displayWidthPx,
268288
- display_height_px: tool3.args.displayHeightPx,
268289
- display_number: tool3.args.displayNumber,
268589
+ display_width_px: tool4.args.displayWidthPx,
268590
+ display_height_px: tool4.args.displayHeightPx,
268591
+ display_number: tool4.args.displayNumber,
268290
268592
  cache_control: undefined
268291
268593
  });
268292
268594
  break;
@@ -268320,7 +268622,7 @@ async function prepareTools({
268320
268622
  }
268321
268623
  case "anthropic.text_editor_20250728": {
268322
268624
  const args = await validateTypes({
268323
- value: tool3.args,
268625
+ value: tool4.args,
268324
268626
  schema: textEditor_20250728ArgsSchema
268325
268627
  });
268326
268628
  anthropicTools2.push({
@@ -268360,7 +268662,7 @@ async function prepareTools({
268360
268662
  case "anthropic.web_fetch_20250910": {
268361
268663
  betas.add("web-fetch-2025-09-10");
268362
268664
  const args = await validateTypes({
268363
- value: tool3.args,
268665
+ value: tool4.args,
268364
268666
  schema: webFetch_20250910ArgsSchema
268365
268667
  });
268366
268668
  anthropicTools2.push({
@@ -268377,7 +268679,7 @@ async function prepareTools({
268377
268679
  }
268378
268680
  case "anthropic.web_search_20250305": {
268379
268681
  const args = await validateTypes({
268380
- value: tool3.args,
268682
+ value: tool4.args,
268381
268683
  schema: webSearch_20250305ArgsSchema
268382
268684
  });
268383
268685
  anthropicTools2.push({
@@ -268392,14 +268694,14 @@ async function prepareTools({
268392
268694
  break;
268393
268695
  }
268394
268696
  default: {
268395
- toolWarnings.push({ type: "unsupported-tool", tool: tool3 });
268697
+ toolWarnings.push({ type: "unsupported-tool", tool: tool4 });
268396
268698
  break;
268397
268699
  }
268398
268700
  }
268399
268701
  break;
268400
268702
  }
268401
268703
  default: {
268402
- toolWarnings.push({ type: "unsupported-tool", tool: tool3 });
268704
+ toolWarnings.push({ type: "unsupported-tool", tool: tool4 });
268403
268705
  break;
268404
268706
  }
268405
268707
  }
@@ -269316,7 +269618,7 @@ var AnthropicMessagesLanguageModel = class {
269316
269618
  betas.add("code-execution-2025-08-25");
269317
269619
  betas.add("skills-2025-10-02");
269318
269620
  betas.add("files-api-2025-04-14");
269319
- if (!(tools == null ? undefined : tools.some((tool3) => tool3.type === "provider-defined" && tool3.id === "anthropic.code_execution_20250825"))) {
269621
+ if (!(tools == null ? undefined : tools.some((tool4) => tool4.type === "provider-defined" && tool4.id === "anthropic.code_execution_20250825"))) {
269320
269622
  warnings.push({
269321
269623
  type: "other",
269322
269624
  message: "code execution tool is required when using skills"
@@ -270397,7 +270699,7 @@ function createAnthropic(options = {}) {
270397
270699
  }
270398
270700
  var anthropic = createAnthropic();
270399
270701
 
270400
- // ../../node_modules/.pnpm/@ai-sdk+openai@2.0.77_zod@3.25.76/node_modules/@ai-sdk/openai/dist/index.mjs
270702
+ // ../../node_modules/.pnpm/@ai-sdk+openai@2.0.86_zod@3.25.76/node_modules/@ai-sdk/openai/dist/index.mjs
270401
270703
  var openaiErrorDataSchema = exports_external3.object({
270402
270704
  error: exports_external3.object({
270403
270705
  message: exports_external3.string(),
@@ -270410,6 +270712,20 @@ var openaiFailedResponseHandler = createJsonErrorResponseHandler({
270410
270712
  errorSchema: openaiErrorDataSchema,
270411
270713
  errorToMessage: (data) => data.error.message
270412
270714
  });
270715
+ function getOpenAILanguageModelCapabilities(modelId) {
270716
+ const supportsFlexProcessing = modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-chat");
270717
+ const supportsPriorityProcessing = modelId.startsWith("gpt-4") || modelId.startsWith("gpt-5-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-nano") && !modelId.startsWith("gpt-5-chat") || modelId.startsWith("o3") || modelId.startsWith("o4-mini");
270718
+ const isReasoningModel = !(modelId.startsWith("gpt-3") || modelId.startsWith("gpt-4") || modelId.startsWith("chatgpt-4o") || modelId.startsWith("gpt-5-chat"));
270719
+ const supportsNonReasoningParameters = modelId.startsWith("gpt-5.1");
270720
+ const systemMessageMode = isReasoningModel ? "developer" : "system";
270721
+ return {
270722
+ supportsFlexProcessing,
270723
+ supportsPriorityProcessing,
270724
+ isReasoningModel,
270725
+ systemMessageMode,
270726
+ supportsNonReasoningParameters
270727
+ };
270728
+ }
270413
270729
  function convertToOpenAIChatMessages({
270414
270730
  prompt,
270415
270731
  systemMessageMode = "system"
@@ -270625,10 +270941,12 @@ var openaiChatResponseSchema = lazyValidator(() => zodSchema(exports_external3.o
270625
270941
  })).nullish(),
270626
270942
  annotations: exports_external3.array(exports_external3.object({
270627
270943
  type: exports_external3.literal("url_citation"),
270628
- start_index: exports_external3.number(),
270629
- end_index: exports_external3.number(),
270630
- url: exports_external3.string(),
270631
- title: exports_external3.string()
270944
+ url_citation: exports_external3.object({
270945
+ start_index: exports_external3.number(),
270946
+ end_index: exports_external3.number(),
270947
+ url: exports_external3.string(),
270948
+ title: exports_external3.string()
270949
+ })
270632
270950
  })).nullish()
270633
270951
  }),
270634
270952
  index: exports_external3.number(),
@@ -270678,10 +270996,12 @@ var openaiChatChunkSchema = lazyValidator(() => zodSchema(exports_external3.unio
270678
270996
  })).nullish(),
270679
270997
  annotations: exports_external3.array(exports_external3.object({
270680
270998
  type: exports_external3.literal("url_citation"),
270681
- start_index: exports_external3.number(),
270682
- end_index: exports_external3.number(),
270683
- url: exports_external3.string(),
270684
- title: exports_external3.string()
270999
+ url_citation: exports_external3.object({
271000
+ start_index: exports_external3.number(),
271001
+ end_index: exports_external3.number(),
271002
+ url: exports_external3.string(),
271003
+ title: exports_external3.string()
271004
+ })
270685
271005
  })).nullish()
270686
271006
  }).nullish(),
270687
271007
  logprobs: exports_external3.object({
@@ -270718,7 +271038,7 @@ var openaiChatLanguageModelOptions = lazyValidator(() => zodSchema(exports_exter
270718
271038
  logprobs: exports_external3.union([exports_external3.boolean(), exports_external3.number()]).optional(),
270719
271039
  parallelToolCalls: exports_external3.boolean().optional(),
270720
271040
  user: exports_external3.string().optional(),
270721
- reasoningEffort: exports_external3.enum(["none", "minimal", "low", "medium", "high"]).optional(),
271041
+ reasoningEffort: exports_external3.enum(["none", "minimal", "low", "medium", "high", "xhigh"]).optional(),
270722
271042
  maxCompletionTokens: exports_external3.number().optional(),
270723
271043
  store: exports_external3.boolean().optional(),
270724
271044
  metadata: exports_external3.record(exports_external3.string().max(64), exports_external3.string().max(512)).optional(),
@@ -270743,21 +271063,21 @@ function prepareChatTools({
270743
271063
  return { tools: undefined, toolChoice: undefined, toolWarnings };
270744
271064
  }
270745
271065
  const openaiTools2 = [];
270746
- for (const tool3 of tools) {
270747
- switch (tool3.type) {
271066
+ for (const tool4 of tools) {
271067
+ switch (tool4.type) {
270748
271068
  case "function":
270749
271069
  openaiTools2.push({
270750
271070
  type: "function",
270751
271071
  function: {
270752
- name: tool3.name,
270753
- description: tool3.description,
270754
- parameters: tool3.inputSchema,
271072
+ name: tool4.name,
271073
+ description: tool4.description,
271074
+ parameters: tool4.inputSchema,
270755
271075
  strict: structuredOutputs ? strictJsonSchema : undefined
270756
271076
  }
270757
271077
  });
270758
271078
  break;
270759
271079
  default:
270760
- toolWarnings.push({ type: "unsupported-tool", tool: tool3 });
271080
+ toolWarnings.push({ type: "unsupported-tool", tool: tool4 });
270761
271081
  break;
270762
271082
  }
270763
271083
  }
@@ -270824,6 +271144,7 @@ var OpenAIChatLanguageModel = class {
270824
271144
  schema: openaiChatLanguageModelOptions
270825
271145
  })) != null ? _a16 : {};
270826
271146
  const structuredOutputs = (_b9 = openaiOptions.structuredOutputs) != null ? _b9 : true;
271147
+ const modelCapabilities = getOpenAILanguageModelCapabilities(this.modelId);
270827
271148
  if (topK != null) {
270828
271149
  warnings.push({
270829
271150
  type: "unsupported-setting",
@@ -270839,7 +271160,7 @@ var OpenAIChatLanguageModel = class {
270839
271160
  }
270840
271161
  const { messages, warnings: messageWarnings } = convertToOpenAIChatMessages({
270841
271162
  prompt,
270842
- systemMessageMode: getSystemMessageMode(this.modelId)
271163
+ systemMessageMode: modelCapabilities.systemMessageMode
270843
271164
  });
270844
271165
  warnings.push(...messageWarnings);
270845
271166
  const strictJsonSchema = (_c = openaiOptions.strictJsonSchema) != null ? _c : false;
@@ -270878,22 +271199,31 @@ var OpenAIChatLanguageModel = class {
270878
271199
  safety_identifier: openaiOptions.safetyIdentifier,
270879
271200
  messages
270880
271201
  };
270881
- if (isReasoningModel(this.modelId)) {
270882
- if (baseArgs.temperature != null) {
270883
- baseArgs.temperature = undefined;
270884
- warnings.push({
270885
- type: "unsupported-setting",
270886
- setting: "temperature",
270887
- details: "temperature is not supported for reasoning models"
270888
- });
270889
- }
270890
- if (baseArgs.top_p != null) {
270891
- baseArgs.top_p = undefined;
270892
- warnings.push({
270893
- type: "unsupported-setting",
270894
- setting: "topP",
270895
- details: "topP is not supported for reasoning models"
270896
- });
271202
+ if (modelCapabilities.isReasoningModel) {
271203
+ if (openaiOptions.reasoningEffort !== "none" || !modelCapabilities.supportsNonReasoningParameters) {
271204
+ if (baseArgs.temperature != null) {
271205
+ baseArgs.temperature = undefined;
271206
+ warnings.push({
271207
+ type: "unsupported-setting",
271208
+ setting: "temperature",
271209
+ details: "temperature is not supported for reasoning models"
271210
+ });
271211
+ }
271212
+ if (baseArgs.top_p != null) {
271213
+ baseArgs.top_p = undefined;
271214
+ warnings.push({
271215
+ type: "unsupported-setting",
271216
+ setting: "topP",
271217
+ details: "topP is not supported for reasoning models"
271218
+ });
271219
+ }
271220
+ if (baseArgs.logprobs != null) {
271221
+ baseArgs.logprobs = undefined;
271222
+ warnings.push({
271223
+ type: "other",
271224
+ message: "logprobs is not supported for reasoning models"
271225
+ });
271226
+ }
270897
271227
  }
270898
271228
  if (baseArgs.frequency_penalty != null) {
270899
271229
  baseArgs.frequency_penalty = undefined;
@@ -270918,13 +271248,6 @@ var OpenAIChatLanguageModel = class {
270918
271248
  message: "logitBias is not supported for reasoning models"
270919
271249
  });
270920
271250
  }
270921
- if (baseArgs.logprobs != null) {
270922
- baseArgs.logprobs = undefined;
270923
- warnings.push({
270924
- type: "other",
270925
- message: "logprobs is not supported for reasoning models"
270926
- });
270927
- }
270928
271251
  if (baseArgs.top_logprobs != null) {
270929
271252
  baseArgs.top_logprobs = undefined;
270930
271253
  warnings.push({
@@ -270948,7 +271271,7 @@ var OpenAIChatLanguageModel = class {
270948
271271
  });
270949
271272
  }
270950
271273
  }
270951
- if (openaiOptions.serviceTier === "flex" && !supportsFlexProcessing(this.modelId)) {
271274
+ if (openaiOptions.serviceTier === "flex" && !modelCapabilities.supportsFlexProcessing) {
270952
271275
  warnings.push({
270953
271276
  type: "unsupported-setting",
270954
271277
  setting: "serviceTier",
@@ -270956,7 +271279,7 @@ var OpenAIChatLanguageModel = class {
270956
271279
  });
270957
271280
  baseArgs.service_tier = undefined;
270958
271281
  }
270959
- if (openaiOptions.serviceTier === "priority" && !supportsPriorityProcessing(this.modelId)) {
271282
+ if (openaiOptions.serviceTier === "priority" && !modelCapabilities.supportsPriorityProcessing) {
270960
271283
  warnings.push({
270961
271284
  type: "unsupported-setting",
270962
271285
  setting: "serviceTier",
@@ -271021,8 +271344,8 @@ var OpenAIChatLanguageModel = class {
271021
271344
  type: "source",
271022
271345
  sourceType: "url",
271023
271346
  id: generateId(),
271024
- url: annotation.url,
271025
- title: annotation.title
271347
+ url: annotation.url_citation.url,
271348
+ title: annotation.url_citation.title
271026
271349
  });
271027
271350
  }
271028
271351
  const completionTokenDetails = (_d = response.usage) == null ? undefined : _d.completion_tokens_details;
@@ -271248,8 +271571,8 @@ var OpenAIChatLanguageModel = class {
271248
271571
  type: "source",
271249
271572
  sourceType: "url",
271250
271573
  id: generateId(),
271251
- url: annotation.url,
271252
- title: annotation.title
271574
+ url: annotation.url_citation.url,
271575
+ title: annotation.url_citation.title
271253
271576
  });
271254
271577
  }
271255
271578
  }
@@ -271271,42 +271594,6 @@ var OpenAIChatLanguageModel = class {
271271
271594
  };
271272
271595
  }
271273
271596
  };
271274
- function isReasoningModel(modelId) {
271275
- return (modelId.startsWith("o") || modelId.startsWith("gpt-5")) && !modelId.startsWith("gpt-5-chat");
271276
- }
271277
- function supportsFlexProcessing(modelId) {
271278
- return modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-chat");
271279
- }
271280
- function supportsPriorityProcessing(modelId) {
271281
- return modelId.startsWith("gpt-4") || modelId.startsWith("gpt-5-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-nano") && !modelId.startsWith("gpt-5-chat") || modelId.startsWith("o3") || modelId.startsWith("o4-mini");
271282
- }
271283
- function getSystemMessageMode(modelId) {
271284
- var _a16, _b9;
271285
- if (!isReasoningModel(modelId)) {
271286
- return "system";
271287
- }
271288
- return (_b9 = (_a16 = reasoningModels[modelId]) == null ? undefined : _a16.systemMessageMode) != null ? _b9 : "developer";
271289
- }
271290
- var reasoningModels = {
271291
- o3: {
271292
- systemMessageMode: "developer"
271293
- },
271294
- "o3-2025-04-16": {
271295
- systemMessageMode: "developer"
271296
- },
271297
- "o3-mini": {
271298
- systemMessageMode: "developer"
271299
- },
271300
- "o3-mini-2025-01-31": {
271301
- systemMessageMode: "developer"
271302
- },
271303
- "o4-mini": {
271304
- systemMessageMode: "developer"
271305
- },
271306
- "o4-mini-2025-04-16": {
271307
- systemMessageMode: "developer"
271308
- }
271309
- };
271310
271597
  function convertToOpenAICompletionPrompt({
271311
271598
  prompt,
271312
271599
  user = "user",
@@ -271874,8 +272161,8 @@ var codeInterpreter = (args = {}) => {
271874
272161
  };
271875
272162
  var comparisonFilterSchema = exports_external3.object({
271876
272163
  key: exports_external3.string(),
271877
- type: exports_external3.enum(["eq", "ne", "gt", "gte", "lt", "lte"]),
271878
- value: exports_external3.union([exports_external3.string(), exports_external3.number(), exports_external3.boolean()])
272164
+ type: exports_external3.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
272165
+ value: exports_external3.union([exports_external3.string(), exports_external3.number(), exports_external3.boolean(), exports_external3.array(exports_external3.string())])
271879
272166
  });
271880
272167
  var compoundFilterSchema = exports_external3.object({
271881
272168
  type: exports_external3.enum(["and", "or"]),
@@ -271973,7 +272260,7 @@ var webSearchOutputSchema = lazySchema(() => zodSchema(exports_external3.object(
271973
272260
  url: exports_external3.string().nullish()
271974
272261
  }),
271975
272262
  exports_external3.object({
271976
- type: exports_external3.literal("find"),
272263
+ type: exports_external3.literal("findInPage"),
271977
272264
  url: exports_external3.string().nullish(),
271978
272265
  pattern: exports_external3.string().nullish()
271979
272266
  })
@@ -272012,7 +272299,7 @@ var webSearchPreviewOutputSchema = lazySchema(() => zodSchema(exports_external3.
272012
272299
  url: exports_external3.string().nullish()
272013
272300
  }),
272014
272301
  exports_external3.object({
272015
- type: exports_external3.literal("find"),
272302
+ type: exports_external3.literal("findInPage"),
272016
272303
  url: exports_external3.string().nullish(),
272017
272304
  pattern: exports_external3.string().nullish()
272018
272305
  })
@@ -272465,7 +272752,7 @@ var openaiResponsesChunkSchema = lazyValidator(() => zodSchema(exports_external3
272465
272752
  url: exports_external3.string().nullish()
272466
272753
  }),
272467
272754
  exports_external3.object({
272468
- type: exports_external3.literal("find"),
272755
+ type: exports_external3.literal("find_in_page"),
272469
272756
  url: exports_external3.string().nullish(),
272470
272757
  pattern: exports_external3.string().nullish()
272471
272758
  })
@@ -272657,7 +272944,7 @@ var openaiResponsesResponseSchema = lazyValidator(() => zodSchema(exports_extern
272657
272944
  url: exports_external3.string().nullish()
272658
272945
  }),
272659
272946
  exports_external3.object({
272660
- type: exports_external3.literal("find"),
272947
+ type: exports_external3.literal("find_in_page"),
272661
272948
  url: exports_external3.string().nullish(),
272662
272949
  pattern: exports_external3.string().nullish()
272663
272950
  })
@@ -272762,7 +273049,11 @@ var openaiResponsesReasoningModelIds = [
272762
273049
  "gpt-5.1",
272763
273050
  "gpt-5.1-chat-latest",
272764
273051
  "gpt-5.1-codex-mini",
272765
- "gpt-5.1-codex"
273052
+ "gpt-5.1-codex",
273053
+ "gpt-5.1-codex-max",
273054
+ "gpt-5.2",
273055
+ "gpt-5.2-chat-latest",
273056
+ "gpt-5.2-pro"
272766
273057
  ];
272767
273058
  var openaiResponsesModelIds = [
272768
273059
  "gpt-4.1",
@@ -272836,22 +273127,22 @@ async function prepareResponsesTools({
272836
273127
  return { tools: undefined, toolChoice: undefined, toolWarnings };
272837
273128
  }
272838
273129
  const openaiTools2 = [];
272839
- for (const tool3 of tools) {
272840
- switch (tool3.type) {
273130
+ for (const tool4 of tools) {
273131
+ switch (tool4.type) {
272841
273132
  case "function":
272842
273133
  openaiTools2.push({
272843
273134
  type: "function",
272844
- name: tool3.name,
272845
- description: tool3.description,
272846
- parameters: tool3.inputSchema,
273135
+ name: tool4.name,
273136
+ description: tool4.description,
273137
+ parameters: tool4.inputSchema,
272847
273138
  strict: strictJsonSchema
272848
273139
  });
272849
273140
  break;
272850
273141
  case "provider-defined": {
272851
- switch (tool3.id) {
273142
+ switch (tool4.id) {
272852
273143
  case "openai.file_search": {
272853
273144
  const args = await validateTypes({
272854
- value: tool3.args,
273145
+ value: tool4.args,
272855
273146
  schema: fileSearchArgsSchema
272856
273147
  });
272857
273148
  openaiTools2.push({
@@ -272874,7 +273165,7 @@ async function prepareResponsesTools({
272874
273165
  }
272875
273166
  case "openai.web_search_preview": {
272876
273167
  const args = await validateTypes({
272877
- value: tool3.args,
273168
+ value: tool4.args,
272878
273169
  schema: webSearchPreviewArgsSchema
272879
273170
  });
272880
273171
  openaiTools2.push({
@@ -272886,7 +273177,7 @@ async function prepareResponsesTools({
272886
273177
  }
272887
273178
  case "openai.web_search": {
272888
273179
  const args = await validateTypes({
272889
- value: tool3.args,
273180
+ value: tool4.args,
272890
273181
  schema: webSearchArgsSchema
272891
273182
  });
272892
273183
  openaiTools2.push({
@@ -272900,7 +273191,7 @@ async function prepareResponsesTools({
272900
273191
  }
272901
273192
  case "openai.code_interpreter": {
272902
273193
  const args = await validateTypes({
272903
- value: tool3.args,
273194
+ value: tool4.args,
272904
273195
  schema: codeInterpreterArgsSchema
272905
273196
  });
272906
273197
  openaiTools2.push({
@@ -272911,7 +273202,7 @@ async function prepareResponsesTools({
272911
273202
  }
272912
273203
  case "openai.image_generation": {
272913
273204
  const args = await validateTypes({
272914
- value: tool3.args,
273205
+ value: tool4.args,
272915
273206
  schema: imageGenerationArgsSchema
272916
273207
  });
272917
273208
  openaiTools2.push({
@@ -272935,7 +273226,7 @@ async function prepareResponsesTools({
272935
273226
  break;
272936
273227
  }
272937
273228
  default:
272938
- toolWarnings.push({ type: "unsupported-tool", tool: tool3 });
273229
+ toolWarnings.push({ type: "unsupported-tool", tool: tool4 });
272939
273230
  break;
272940
273231
  }
272941
273232
  }
@@ -272992,7 +273283,7 @@ var OpenAIResponsesLanguageModel = class {
272992
273283
  }) {
272993
273284
  var _a16, _b9, _c, _d;
272994
273285
  const warnings = [];
272995
- const modelConfig = getResponsesModelConfig(this.modelId);
273286
+ const modelCapabilities = getOpenAILanguageModelCapabilities(this.modelId);
272996
273287
  if (topK != null) {
272997
273288
  warnings.push({ type: "unsupported-setting", setting: "topK" });
272998
273289
  }
@@ -273028,7 +273319,7 @@ var OpenAIResponsesLanguageModel = class {
273028
273319
  }
273029
273320
  const { input, warnings: inputWarnings } = await convertToOpenAIResponsesInput({
273030
273321
  prompt,
273031
- systemMessageMode: modelConfig.systemMessageMode,
273322
+ systemMessageMode: modelCapabilities.systemMessageMode,
273032
273323
  fileIdPrefixes: this.config.fileIdPrefixes,
273033
273324
  store: (_a16 = openaiOptions == null ? undefined : openaiOptions.store) != null ? _a16 : true,
273034
273325
  hasLocalShellTool: hasOpenAITool("openai.local_shell")
@@ -273044,13 +273335,13 @@ var OpenAIResponsesLanguageModel = class {
273044
273335
  }
273045
273336
  }
273046
273337
  function hasOpenAITool(id) {
273047
- return (tools == null ? undefined : tools.find((tool3) => tool3.type === "provider-defined" && tool3.id === id)) != null;
273338
+ return (tools == null ? undefined : tools.find((tool4) => tool4.type === "provider-defined" && tool4.id === id)) != null;
273048
273339
  }
273049
273340
  const topLogprobs = typeof (openaiOptions == null ? undefined : openaiOptions.logprobs) === "number" ? openaiOptions == null ? undefined : openaiOptions.logprobs : (openaiOptions == null ? undefined : openaiOptions.logprobs) === true ? TOP_LOGPROBS_MAX : undefined;
273050
273341
  if (topLogprobs) {
273051
273342
  addInclude("message.output_text.logprobs");
273052
273343
  }
273053
- const webSearchToolName = (_c = tools == null ? undefined : tools.find((tool3) => tool3.type === "provider-defined" && (tool3.id === "openai.web_search" || tool3.id === "openai.web_search_preview"))) == null ? undefined : _c.name;
273344
+ const webSearchToolName = (_c = tools == null ? undefined : tools.find((tool4) => tool4.type === "provider-defined" && (tool4.id === "openai.web_search" || tool4.id === "openai.web_search_preview"))) == null ? undefined : _c.name;
273054
273345
  if (webSearchToolName) {
273055
273346
  addInclude("web_search_call.action.sources");
273056
273347
  }
@@ -273058,7 +273349,7 @@ var OpenAIResponsesLanguageModel = class {
273058
273349
  addInclude("code_interpreter_call.outputs");
273059
273350
  }
273060
273351
  const store = openaiOptions == null ? undefined : openaiOptions.store;
273061
- if (store === false && modelConfig.isReasoningModel) {
273352
+ if (store === false && modelCapabilities.isReasoningModel) {
273062
273353
  addInclude("reasoning.encrypted_content");
273063
273354
  }
273064
273355
  const baseArgs = {
@@ -273098,7 +273389,7 @@ var OpenAIResponsesLanguageModel = class {
273098
273389
  safety_identifier: openaiOptions == null ? undefined : openaiOptions.safetyIdentifier,
273099
273390
  top_logprobs: topLogprobs,
273100
273391
  truncation: openaiOptions == null ? undefined : openaiOptions.truncation,
273101
- ...modelConfig.isReasoningModel && ((openaiOptions == null ? undefined : openaiOptions.reasoningEffort) != null || (openaiOptions == null ? undefined : openaiOptions.reasoningSummary) != null) && {
273392
+ ...modelCapabilities.isReasoningModel && ((openaiOptions == null ? undefined : openaiOptions.reasoningEffort) != null || (openaiOptions == null ? undefined : openaiOptions.reasoningSummary) != null) && {
273102
273393
  reasoning: {
273103
273394
  ...(openaiOptions == null ? undefined : openaiOptions.reasoningEffort) != null && {
273104
273395
  effort: openaiOptions.reasoningEffort
@@ -273109,22 +273400,24 @@ var OpenAIResponsesLanguageModel = class {
273109
273400
  }
273110
273401
  }
273111
273402
  };
273112
- if (modelConfig.isReasoningModel) {
273113
- if (baseArgs.temperature != null) {
273114
- baseArgs.temperature = undefined;
273115
- warnings.push({
273116
- type: "unsupported-setting",
273117
- setting: "temperature",
273118
- details: "temperature is not supported for reasoning models"
273119
- });
273120
- }
273121
- if (baseArgs.top_p != null) {
273122
- baseArgs.top_p = undefined;
273123
- warnings.push({
273124
- type: "unsupported-setting",
273125
- setting: "topP",
273126
- details: "topP is not supported for reasoning models"
273127
- });
273403
+ if (modelCapabilities.isReasoningModel) {
273404
+ if (!((openaiOptions == null ? undefined : openaiOptions.reasoningEffort) === "none" && modelCapabilities.supportsNonReasoningParameters)) {
273405
+ if (baseArgs.temperature != null) {
273406
+ baseArgs.temperature = undefined;
273407
+ warnings.push({
273408
+ type: "unsupported-setting",
273409
+ setting: "temperature",
273410
+ details: "temperature is not supported for reasoning models"
273411
+ });
273412
+ }
273413
+ if (baseArgs.top_p != null) {
273414
+ baseArgs.top_p = undefined;
273415
+ warnings.push({
273416
+ type: "unsupported-setting",
273417
+ setting: "topP",
273418
+ details: "topP is not supported for reasoning models"
273419
+ });
273420
+ }
273128
273421
  }
273129
273422
  } else {
273130
273423
  if ((openaiOptions == null ? undefined : openaiOptions.reasoningEffort) != null) {
@@ -273142,7 +273435,7 @@ var OpenAIResponsesLanguageModel = class {
273142
273435
  });
273143
273436
  }
273144
273437
  }
273145
- if ((openaiOptions == null ? undefined : openaiOptions.serviceTier) === "flex" && !modelConfig.supportsFlexProcessing) {
273438
+ if ((openaiOptions == null ? undefined : openaiOptions.serviceTier) === "flex" && !modelCapabilities.supportsFlexProcessing) {
273146
273439
  warnings.push({
273147
273440
  type: "unsupported-setting",
273148
273441
  setting: "serviceTier",
@@ -273150,7 +273443,7 @@ var OpenAIResponsesLanguageModel = class {
273150
273443
  });
273151
273444
  delete baseArgs.service_tier;
273152
273445
  }
273153
- if ((openaiOptions == null ? undefined : openaiOptions.serviceTier) === "priority" && !modelConfig.supportsPriorityProcessing) {
273446
+ if ((openaiOptions == null ? undefined : openaiOptions.serviceTier) === "priority" && !modelCapabilities.supportsPriorityProcessing) {
273154
273447
  warnings.push({
273155
273448
  type: "unsupported-setting",
273156
273449
  setting: "serviceTier",
@@ -273993,32 +274286,6 @@ function isResponseAnnotationAddedChunk(chunk) {
273993
274286
  function isErrorChunk(chunk) {
273994
274287
  return chunk.type === "error";
273995
274288
  }
273996
- function getResponsesModelConfig(modelId) {
273997
- const supportsFlexProcessing2 = modelId.startsWith("o3") || modelId.startsWith("o4-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-chat");
273998
- const supportsPriorityProcessing2 = modelId.startsWith("gpt-4") || modelId.startsWith("gpt-5-mini") || modelId.startsWith("gpt-5") && !modelId.startsWith("gpt-5-nano") && !modelId.startsWith("gpt-5-chat") || modelId.startsWith("o3") || modelId.startsWith("o4-mini");
273999
- const defaults3 = {
274000
- systemMessageMode: "system",
274001
- supportsFlexProcessing: supportsFlexProcessing2,
274002
- supportsPriorityProcessing: supportsPriorityProcessing2
274003
- };
274004
- if (modelId.startsWith("gpt-5-chat")) {
274005
- return {
274006
- ...defaults3,
274007
- isReasoningModel: false
274008
- };
274009
- }
274010
- if (modelId.startsWith("o") || modelId.startsWith("gpt-5") || modelId.startsWith("codex-") || modelId.startsWith("computer-use")) {
274011
- return {
274012
- ...defaults3,
274013
- isReasoningModel: true,
274014
- systemMessageMode: "developer"
274015
- };
274016
- }
274017
- return {
274018
- ...defaults3,
274019
- isReasoningModel: false
274020
- };
274021
- }
274022
274289
  function mapWebSearchOutput(action) {
274023
274290
  var _a16;
274024
274291
  switch (action.type) {
@@ -274029,9 +274296,13 @@ function mapWebSearchOutput(action) {
274029
274296
  };
274030
274297
  case "open_page":
274031
274298
  return { action: { type: "openPage", url: action.url } };
274032
- case "find":
274299
+ case "find_in_page":
274033
274300
  return {
274034
- action: { type: "find", url: action.url, pattern: action.pattern }
274301
+ action: {
274302
+ type: "findInPage",
274303
+ url: action.url,
274304
+ pattern: action.pattern
274305
+ }
274035
274306
  };
274036
274307
  }
274037
274308
  }
@@ -274324,7 +274595,7 @@ var OpenAITranscriptionModel = class {
274324
274595
  };
274325
274596
  }
274326
274597
  };
274327
- var VERSION7 = "2.0.77";
274598
+ var VERSION7 = "2.0.86";
274328
274599
  function createOpenAI(options = {}) {
274329
274600
  var _a16, _b9;
274330
274601
  const baseURL = (_a16 = withoutTrailingSlash(loadOptionalSetting({