@x-otto/cli 0.0.1-alpha.22 → 0.0.1-alpha.24

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.
@@ -11368,7 +11368,7 @@ var require_util = __commonJS({
11368
11368
  let val = obj[key];
11369
11369
  if (val !== void 0) {
11370
11370
  if (!Object.hasOwn(obj, key)) {
11371
- const headersValue = typeof headers[i2 + 1] === "string" ? headers[i2 + 1] : Array.isArray(headers[i2 + 1]) ? headers[i2 + 1].map((x3) => x3.toString("latin1")) : headers[i2 + 1].toString("latin1");
11371
+ const headersValue = typeof headers[i2 + 1] === "string" ? headers[i2 + 1] : Array.isArray(headers[i2 + 1]) ? headers[i2 + 1].map((x4) => x4.toString("latin1")) : headers[i2 + 1].toString("latin1");
11372
11372
  if (key === "__proto__") {
11373
11373
  Object.defineProperty(obj, key, {
11374
11374
  value: headersValue,
@@ -11387,7 +11387,7 @@ var require_util = __commonJS({
11387
11387
  val.push(headers[i2 + 1].toString("latin1"));
11388
11388
  }
11389
11389
  } else {
11390
- const headersValue = typeof headers[i2 + 1] === "string" ? headers[i2 + 1] : Array.isArray(headers[i2 + 1]) ? headers[i2 + 1].map((x3) => x3.toString("latin1")) : headers[i2 + 1].toString("latin1");
11390
+ const headersValue = typeof headers[i2 + 1] === "string" ? headers[i2 + 1] : Array.isArray(headers[i2 + 1]) ? headers[i2 + 1].map((x4) => x4.toString("latin1")) : headers[i2 + 1].toString("latin1");
11391
11391
  obj[key] = headersValue;
11392
11392
  }
11393
11393
  }
@@ -11441,7 +11441,7 @@ var require_util = __commonJS({
11441
11441
  if (!Array.isArray(headers)) {
11442
11442
  throw new TypeError("expected headers to be an array");
11443
11443
  }
11444
- return headers.map((x3) => Buffer.from(x3));
11444
+ return headers.map((x4) => Buffer.from(x4));
11445
11445
  }
11446
11446
  function isBuffer(buffer) {
11447
11447
  return buffer instanceof Uint8Array || Buffer.isBuffer(buffer);
@@ -14512,44 +14512,44 @@ var require_webidl = __commonJS({
14512
14512
  lowerBound = -Math.pow(2, bitLength - 1);
14513
14513
  upperBound = Math.pow(2, bitLength - 1) - 1;
14514
14514
  }
14515
- let x3 = Number(V3);
14516
- if (x3 === 0) {
14517
- x3 = 0;
14515
+ let x4 = Number(V3);
14516
+ if (x4 === 0) {
14517
+ x4 = 0;
14518
14518
  }
14519
14519
  if (webidl.util.HasFlag(flags, webidl.attributes.EnforceRange)) {
14520
- if (Number.isNaN(x3) || x3 === Number.POSITIVE_INFINITY || x3 === Number.NEGATIVE_INFINITY) {
14520
+ if (Number.isNaN(x4) || x4 === Number.POSITIVE_INFINITY || x4 === Number.NEGATIVE_INFINITY) {
14521
14521
  throw webidl.errors.exception({
14522
14522
  header: "Integer conversion",
14523
14523
  message: `Could not convert ${webidl.util.Stringify(V3)} to an integer.`
14524
14524
  });
14525
14525
  }
14526
- x3 = webidl.util.IntegerPart(x3);
14527
- if (x3 < lowerBound || x3 > upperBound) {
14526
+ x4 = webidl.util.IntegerPart(x4);
14527
+ if (x4 < lowerBound || x4 > upperBound) {
14528
14528
  throw webidl.errors.exception({
14529
14529
  header: "Integer conversion",
14530
- message: `Value must be between ${lowerBound}-${upperBound}, got ${x3}.`
14530
+ message: `Value must be between ${lowerBound}-${upperBound}, got ${x4}.`
14531
14531
  });
14532
14532
  }
14533
- return x3;
14533
+ return x4;
14534
14534
  }
14535
- if (!Number.isNaN(x3) && webidl.util.HasFlag(flags, webidl.attributes.Clamp)) {
14536
- x3 = Math.min(Math.max(x3, lowerBound), upperBound);
14537
- if (Math.floor(x3) % 2 === 0) {
14538
- x3 = Math.floor(x3);
14535
+ if (!Number.isNaN(x4) && webidl.util.HasFlag(flags, webidl.attributes.Clamp)) {
14536
+ x4 = Math.min(Math.max(x4, lowerBound), upperBound);
14537
+ if (Math.floor(x4) % 2 === 0) {
14538
+ x4 = Math.floor(x4);
14539
14539
  } else {
14540
- x3 = Math.ceil(x3);
14540
+ x4 = Math.ceil(x4);
14541
14541
  }
14542
- return x3;
14542
+ return x4;
14543
14543
  }
14544
- if (Number.isNaN(x3) || x3 === 0 && Object.is(0, x3) || x3 === Number.POSITIVE_INFINITY || x3 === Number.NEGATIVE_INFINITY) {
14544
+ if (Number.isNaN(x4) || x4 === 0 && Object.is(0, x4) || x4 === Number.POSITIVE_INFINITY || x4 === Number.NEGATIVE_INFINITY) {
14545
14545
  return 0;
14546
14546
  }
14547
- x3 = webidl.util.IntegerPart(x3);
14548
- x3 = x3 % Math.pow(2, bitLength);
14549
- if (signedness === "signed" && x3 >= Math.pow(2, bitLength - 1)) {
14550
- return x3 - Math.pow(2, bitLength);
14547
+ x4 = webidl.util.IntegerPart(x4);
14548
+ x4 = x4 % Math.pow(2, bitLength);
14549
+ if (signedness === "signed" && x4 >= Math.pow(2, bitLength - 1)) {
14550
+ return x4 - Math.pow(2, bitLength);
14551
14551
  }
14552
- return x3;
14552
+ return x4;
14553
14553
  };
14554
14554
  webidl.util.IntegerPart = function(n3) {
14555
14555
  const r3 = Math.floor(Math.abs(n3));
@@ -14658,7 +14658,7 @@ var require_webidl = __commonJS({
14658
14658
  };
14659
14659
  };
14660
14660
  webidl.dictionaryConverter = function(converters) {
14661
- converters.sort((a3, b4) => (a3.key > b4.key) - (a3.key < b4.key));
14661
+ converters.sort((a3, b3) => (a3.key > b3.key) - (a3.key < b3.key));
14662
14662
  return (dictionary, prefix, argument) => {
14663
14663
  const dict = {};
14664
14664
  if (dictionary != null && webidl.util.Type(dictionary) !== OBJECT) {
@@ -14757,15 +14757,15 @@ var require_webidl = __commonJS({
14757
14757
  message: `${argument} is a symbol, which cannot be converted to a ByteString.`
14758
14758
  });
14759
14759
  }
14760
- const x3 = String(V3);
14761
- for (let index = 0; index < x3.length; index++) {
14762
- if (x3.charCodeAt(index) > 255) {
14760
+ const x4 = String(V3);
14761
+ for (let index = 0; index < x4.length; index++) {
14762
+ if (x4.charCodeAt(index) > 255) {
14763
14763
  throw new TypeError(
14764
- `Cannot convert argument to a ByteString because the character at index ${index} has a value of ${x3.charCodeAt(index)} which is greater than 255.`
14764
+ `Cannot convert argument to a ByteString because the character at index ${index} has a value of ${x4.charCodeAt(index)} which is greater than 255.`
14765
14765
  );
14766
14766
  }
14767
14767
  }
14768
- return x3;
14768
+ return x4;
14769
14769
  };
14770
14770
  webidl.converters.USVString = function(value) {
14771
14771
  if (typeof value === "string") {
@@ -14774,27 +14774,27 @@ var require_webidl = __commonJS({
14774
14774
  return `${value}`.toWellFormed();
14775
14775
  };
14776
14776
  webidl.converters.boolean = function(V3) {
14777
- const x3 = Boolean(V3);
14778
- return x3;
14777
+ const x4 = Boolean(V3);
14778
+ return x4;
14779
14779
  };
14780
14780
  webidl.converters.any = function(V3) {
14781
14781
  return V3;
14782
14782
  };
14783
14783
  webidl.converters["long long"] = function(V3, prefix, argument) {
14784
- const x3 = webidl.util.ConvertToInt(V3, 64, "signed", 0, prefix, argument);
14785
- return x3;
14784
+ const x4 = webidl.util.ConvertToInt(V3, 64, "signed", 0, prefix, argument);
14785
+ return x4;
14786
14786
  };
14787
14787
  webidl.converters["unsigned long long"] = function(V3, prefix, argument) {
14788
- const x3 = webidl.util.ConvertToInt(V3, 64, "unsigned", 0, prefix, argument);
14789
- return x3;
14788
+ const x4 = webidl.util.ConvertToInt(V3, 64, "unsigned", 0, prefix, argument);
14789
+ return x4;
14790
14790
  };
14791
14791
  webidl.converters["unsigned long"] = function(V3, prefix, argument) {
14792
- const x3 = webidl.util.ConvertToInt(V3, 32, "unsigned", 0, prefix, argument);
14793
- return x3;
14792
+ const x4 = webidl.util.ConvertToInt(V3, 32, "unsigned", 0, prefix, argument);
14793
+ return x4;
14794
14794
  };
14795
14795
  webidl.converters["unsigned short"] = function(V3, prefix, argument, flags) {
14796
- const x3 = webidl.util.ConvertToInt(V3, 16, "unsigned", flags, prefix, argument);
14797
- return x3;
14796
+ const x4 = webidl.util.ConvertToInt(V3, 16, "unsigned", flags, prefix, argument);
14797
+ return x4;
14798
14798
  };
14799
14799
  webidl.converters.ArrayBuffer = function(V3, prefix, argument, flags) {
14800
14800
  if (webidl.util.Type(V3) !== OBJECT || !types.isArrayBuffer(V3)) {
@@ -15908,15 +15908,15 @@ var require_formdata = __commonJS({
15908
15908
  }
15909
15909
  }
15910
15910
  [nodeUtil.inspect.custom](depth, options) {
15911
- const state = this.#state.reduce((a3, b4) => {
15912
- if (a3[b4.name]) {
15913
- if (Array.isArray(a3[b4.name])) {
15914
- a3[b4.name].push(b4.value);
15911
+ const state = this.#state.reduce((a3, b3) => {
15912
+ if (a3[b3.name]) {
15913
+ if (Array.isArray(a3[b3.name])) {
15914
+ a3[b3.name].push(b3.value);
15915
15915
  } else {
15916
- a3[b4.name] = [a3[b4.name], b4.value];
15916
+ a3[b3.name] = [a3[b3.name], b3.value];
15917
15917
  }
15918
15918
  } else {
15919
- a3[b4.name] = b4.value;
15919
+ a3[b3.name] = b3.value;
15920
15920
  }
15921
15921
  return a3;
15922
15922
  }, { __proto__: null });
@@ -20006,11 +20006,11 @@ var require_balanced_pool = __commonJS({
20006
20006
  var kWeight = /* @__PURE__ */ Symbol("kWeight");
20007
20007
  var kMaxWeightPerServer = /* @__PURE__ */ Symbol("kMaxWeightPerServer");
20008
20008
  var kErrorPenalty = /* @__PURE__ */ Symbol("kErrorPenalty");
20009
- function getGreatestCommonDivisor(a3, b4) {
20010
- if (a3 === 0) return b4;
20011
- while (b4 !== 0) {
20012
- const t3 = b4;
20013
- b4 = a3 % b4;
20009
+ function getGreatestCommonDivisor(a3, b3) {
20010
+ if (a3 === 0) return b3;
20011
+ while (b3 !== 0) {
20012
+ const t3 = b3;
20013
+ b3 = a3 % b3;
20014
20014
  a3 = t3;
20015
20015
  }
20016
20016
  return a3;
@@ -26218,11 +26218,11 @@ var require_cache = __commonJS({
26218
26218
  } else if (typeof opts.headers === "object") {
26219
26219
  headers = {};
26220
26220
  if (hasSafeIterator(opts.headers)) {
26221
- for (const x3 of opts.headers) {
26222
- if (!Array.isArray(x3)) {
26221
+ for (const x4 of opts.headers) {
26222
+ if (!Array.isArray(x4)) {
26223
26223
  throw new Error("opts.headers is not a valid header map");
26224
26224
  }
26225
- const [key, val] = x3;
26225
+ const [key, val] = x4;
26226
26226
  if (typeof key !== "string" || typeof val !== "string") {
26227
26227
  throw new Error("opts.headers is not a valid header map");
26228
26228
  }
@@ -26412,9 +26412,9 @@ var require_cache = __commonJS({
26412
26412
  if (typeof store !== "object" || store === null) {
26413
26413
  throw new TypeError(`expected type of ${name} to be a CacheStore, got ${store === null ? "null" : typeof store}`);
26414
26414
  }
26415
- for (const fn of ["get", "createWriteStream", "delete"]) {
26416
- if (typeof store[fn] !== "function") {
26417
- throw new TypeError(`${name} needs to have a \`${fn}()\` function`);
26415
+ for (const fn2 of ["get", "createWriteStream", "delete"]) {
26416
+ if (typeof store[fn2] !== "function") {
26417
+ throw new TypeError(`${name} needs to have a \`${fn2}()\` function`);
26418
26418
  }
26419
26419
  }
26420
26420
  }
@@ -28980,7 +28980,7 @@ var require_sqlite_cache_store = __commonJS({
28980
28980
  if (lhs.length !== rhs.length) {
28981
28981
  return false;
28982
28982
  }
28983
- return lhs.every((x3, i2) => x3 === rhs[i2]);
28983
+ return lhs.every((x4, i2) => x4 === rhs[i2]);
28984
28984
  }
28985
28985
  return lhs === rhs;
28986
28986
  }
@@ -29082,8 +29082,8 @@ var require_headers = __commonJS({
29082
29082
  }
29083
29083
  return headersList.sortedMap = headers;
29084
29084
  }
29085
- function compareHeaderName(a3, b4) {
29086
- return a3[0] < b4[0] ? -1 : 1;
29085
+ function compareHeaderName(a3, b3) {
29086
+ return a3[0] < b3[0] ? -1 : 1;
29087
29087
  }
29088
29088
  var HeadersList = class _HeadersList {
29089
29089
  /** @type {[string, string][]|null} */
@@ -29216,15 +29216,15 @@ var require_headers = __commonJS({
29216
29216
  const firstValue = iterator.next().value;
29217
29217
  array[0] = [firstValue[0], firstValue[1].value];
29218
29218
  assert(firstValue[1].value !== null);
29219
- for (let i2 = 1, j3 = 0, right = 0, left = 0, pivot = 0, x3, value; i2 < size; ++i2) {
29219
+ for (let i2 = 1, j3 = 0, right = 0, left = 0, pivot = 0, x4, value; i2 < size; ++i2) {
29220
29220
  value = iterator.next().value;
29221
- x3 = array[i2] = [value[0], value[1].value];
29222
- assert(x3[1] !== null);
29221
+ x4 = array[i2] = [value[0], value[1].value];
29222
+ assert(x4[1] !== null);
29223
29223
  left = 0;
29224
29224
  right = i2;
29225
29225
  while (left < right) {
29226
29226
  pivot = left + (right - left >> 1);
29227
- if (array[pivot][0] <= x3[0]) {
29227
+ if (array[pivot][0] <= x4[0]) {
29228
29228
  left = pivot + 1;
29229
29229
  } else {
29230
29230
  right = pivot;
@@ -29235,7 +29235,7 @@ var require_headers = __commonJS({
29235
29235
  while (j3 > left) {
29236
29236
  array[j3] = array[--j3];
29237
29237
  }
29238
- array[left] = x3;
29238
+ array[left] = x4;
29239
29239
  }
29240
29240
  }
29241
29241
  if (!iterator.next().done) {
@@ -34572,15 +34572,15 @@ var require_websocket = __commonJS({
34572
34572
  webidl.brandCheck(this, _WebSocket);
34573
34573
  return this.#events.open;
34574
34574
  }
34575
- set onopen(fn) {
34575
+ set onopen(fn2) {
34576
34576
  webidl.brandCheck(this, _WebSocket);
34577
34577
  if (this.#events.open) {
34578
34578
  this.removeEventListener("open", this.#events.open);
34579
34579
  }
34580
- const listener = webidl.converters.EventHandlerNonNull(fn);
34580
+ const listener = webidl.converters.EventHandlerNonNull(fn2);
34581
34581
  if (listener !== null) {
34582
34582
  this.addEventListener("open", listener);
34583
- this.#events.open = fn;
34583
+ this.#events.open = fn2;
34584
34584
  } else {
34585
34585
  this.#events.open = null;
34586
34586
  }
@@ -34589,15 +34589,15 @@ var require_websocket = __commonJS({
34589
34589
  webidl.brandCheck(this, _WebSocket);
34590
34590
  return this.#events.error;
34591
34591
  }
34592
- set onerror(fn) {
34592
+ set onerror(fn2) {
34593
34593
  webidl.brandCheck(this, _WebSocket);
34594
34594
  if (this.#events.error) {
34595
34595
  this.removeEventListener("error", this.#events.error);
34596
34596
  }
34597
- const listener = webidl.converters.EventHandlerNonNull(fn);
34597
+ const listener = webidl.converters.EventHandlerNonNull(fn2);
34598
34598
  if (listener !== null) {
34599
34599
  this.addEventListener("error", listener);
34600
- this.#events.error = fn;
34600
+ this.#events.error = fn2;
34601
34601
  } else {
34602
34602
  this.#events.error = null;
34603
34603
  }
@@ -34606,15 +34606,15 @@ var require_websocket = __commonJS({
34606
34606
  webidl.brandCheck(this, _WebSocket);
34607
34607
  return this.#events.close;
34608
34608
  }
34609
- set onclose(fn) {
34609
+ set onclose(fn2) {
34610
34610
  webidl.brandCheck(this, _WebSocket);
34611
34611
  if (this.#events.close) {
34612
34612
  this.removeEventListener("close", this.#events.close);
34613
34613
  }
34614
- const listener = webidl.converters.EventHandlerNonNull(fn);
34614
+ const listener = webidl.converters.EventHandlerNonNull(fn2);
34615
34615
  if (listener !== null) {
34616
34616
  this.addEventListener("close", listener);
34617
- this.#events.close = fn;
34617
+ this.#events.close = fn2;
34618
34618
  } else {
34619
34619
  this.#events.close = null;
34620
34620
  }
@@ -34623,15 +34623,15 @@ var require_websocket = __commonJS({
34623
34623
  webidl.brandCheck(this, _WebSocket);
34624
34624
  return this.#events.message;
34625
34625
  }
34626
- set onmessage(fn) {
34626
+ set onmessage(fn2) {
34627
34627
  webidl.brandCheck(this, _WebSocket);
34628
34628
  if (this.#events.message) {
34629
34629
  this.removeEventListener("message", this.#events.message);
34630
34630
  }
34631
- const listener = webidl.converters.EventHandlerNonNull(fn);
34631
+ const listener = webidl.converters.EventHandlerNonNull(fn2);
34632
34632
  if (listener !== null) {
34633
34633
  this.addEventListener("message", listener);
34634
- this.#events.message = fn;
34634
+ this.#events.message = fn2;
34635
34635
  } else {
34636
34636
  this.#events.message = null;
34637
34637
  }
@@ -35821,14 +35821,14 @@ var require_eventsource = __commonJS({
35821
35821
  get onopen() {
35822
35822
  return this.#events.open;
35823
35823
  }
35824
- set onopen(fn) {
35824
+ set onopen(fn2) {
35825
35825
  if (this.#events.open) {
35826
35826
  this.removeEventListener("open", this.#events.open);
35827
35827
  }
35828
- const listener = webidl.converters.EventHandlerNonNull(fn);
35828
+ const listener = webidl.converters.EventHandlerNonNull(fn2);
35829
35829
  if (listener !== null) {
35830
35830
  this.addEventListener("open", listener);
35831
- this.#events.open = fn;
35831
+ this.#events.open = fn2;
35832
35832
  } else {
35833
35833
  this.#events.open = null;
35834
35834
  }
@@ -35836,14 +35836,14 @@ var require_eventsource = __commonJS({
35836
35836
  get onmessage() {
35837
35837
  return this.#events.message;
35838
35838
  }
35839
- set onmessage(fn) {
35839
+ set onmessage(fn2) {
35840
35840
  if (this.#events.message) {
35841
35841
  this.removeEventListener("message", this.#events.message);
35842
35842
  }
35843
- const listener = webidl.converters.EventHandlerNonNull(fn);
35843
+ const listener = webidl.converters.EventHandlerNonNull(fn2);
35844
35844
  if (listener !== null) {
35845
35845
  this.addEventListener("message", listener);
35846
- this.#events.message = fn;
35846
+ this.#events.message = fn2;
35847
35847
  } else {
35848
35848
  this.#events.message = null;
35849
35849
  }
@@ -35851,14 +35851,14 @@ var require_eventsource = __commonJS({
35851
35851
  get onerror() {
35852
35852
  return this.#events.error;
35853
35853
  }
35854
- set onerror(fn) {
35854
+ set onerror(fn2) {
35855
35855
  if (this.#events.error) {
35856
35856
  this.removeEventListener("error", this.#events.error);
35857
35857
  }
35858
- const listener = webidl.converters.EventHandlerNonNull(fn);
35858
+ const listener = webidl.converters.EventHandlerNonNull(fn2);
35859
35859
  if (listener !== null) {
35860
35860
  this.addEventListener("error", listener);
35861
- this.#events.error = fn;
35861
+ this.#events.error = fn2;
35862
35862
  } else {
35863
35863
  this.#events.error = null;
35864
35864
  }
@@ -36001,7 +36001,7 @@ var require_undici = __commonJS({
36001
36001
  parseHeaders: util.parseHeaders,
36002
36002
  headerNameToString: util.headerNameToString
36003
36003
  };
36004
- function makeDispatcher(fn) {
36004
+ function makeDispatcher(fn2) {
36005
36005
  return (url, opts, handler) => {
36006
36006
  if (typeof opts === "function") {
36007
36007
  handler = opts;
@@ -36032,7 +36032,7 @@ var require_undici = __commonJS({
36032
36032
  if (agent) {
36033
36033
  throw new InvalidArgumentError("unsupported opts.agent. Did you mean opts.client?");
36034
36034
  }
36035
- return fn.call(dispatcher, {
36035
+ return fn2.call(dispatcher, {
36036
36036
  ...restOpts,
36037
36037
  origin: url.origin,
36038
36038
  path: url.search ? `${url.pathname}${url.search}` : url.pathname,
@@ -36303,11 +36303,11 @@ var isAbsoluteURL = (url) => {
36303
36303
  };
36304
36304
  var isArray = (val) => (isArray = Array.isArray, isArray(val));
36305
36305
  var isReadonlyArray = isArray;
36306
- function maybeObj(x3) {
36307
- if (typeof x3 !== "object") {
36306
+ function maybeObj(x4) {
36307
+ if (typeof x4 !== "object") {
36308
36308
  return {};
36309
36309
  }
36310
- return x3 ?? {};
36310
+ return x4 ?? {};
36311
36311
  }
36312
36312
  function isEmptyObj(obj) {
36313
36313
  if (!obj)
@@ -37476,7 +37476,7 @@ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path2(stat
37476
37476
  error: `Value "${match[0]}" can't be safely passed as a path parameter`
37477
37477
  });
37478
37478
  }
37479
- invalidSegments.sort((a3, b4) => a3.start - b4.start);
37479
+ invalidSegments.sort((a3, b3) => a3.start - b3.start);
37480
37480
  if (invalidSegments.length > 0) {
37481
37481
  let lastEnd = 0;
37482
37482
  const underline = invalidSegments.reduce((acc, segment) => {
@@ -38902,7 +38902,7 @@ var BetaMessageStream = class _BetaMessageStream {
38902
38902
  return stream.toReadableStream();
38903
38903
  }
38904
38904
  };
38905
- function checkNever(x3) {
38905
+ function checkNever(x4) {
38906
38906
  }
38907
38907
 
38908
38908
  // ../../node_modules/.pnpm/@anthropic-ai+sdk@0.88.0_zod@4.4.3/node_modules/@anthropic-ai/sdk/lib/tools/ToolError.mjs
@@ -41155,7 +41155,7 @@ var MessageStream = class _MessageStream {
41155
41155
  return stream.toReadableStream();
41156
41156
  }
41157
41157
  };
41158
- function checkNever2(x3) {
41158
+ function checkNever2(x4) {
41159
41159
  }
41160
41160
 
41161
41161
  // ../../node_modules/.pnpm/@anthropic-ai+sdk@0.88.0_zod@4.4.3/node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs
@@ -42137,7 +42137,7 @@ function splitLines(chunk) {
42137
42137
 
42138
42138
  // ../shared/dist/index.js
42139
42139
  var import_undici = __toESM(require_undici(), 1);
42140
- var S = class extends Error {
42140
+ var x2 = class extends Error {
42141
42141
  code;
42142
42142
  cause;
42143
42143
  status;
@@ -42149,87 +42149,87 @@ var S = class extends Error {
42149
42149
  super(e4, { cause: t3.cause }), this.name = new.target.name, this.code = t3.code, this.cause = t3.cause, this.status = t3.status, this.headers = t3.headers, this.errorType = t3.errorType, this.pluginSource = t3.pluginSource, this.abortKind = t3.abortKind;
42150
42150
  }
42151
42151
  };
42152
- var C = class extends S {
42152
+ var S = class extends x2 {
42153
42153
  };
42154
- var Se = class extends S {
42154
+ var Ce = class extends x2 {
42155
42155
  };
42156
- var { setPrototypeOf: Te = function(e4, t3) {
42156
+ var { setPrototypeOf: Ee = function(e4, t3) {
42157
42157
  return e4.__proto__ = t3, e4;
42158
42158
  } } = Object;
42159
- var Ee = class e3 extends Error {
42159
+ var De = class e3 extends Error {
42160
42160
  framesToPop = 1;
42161
42161
  name = `Invariant Violation`;
42162
42162
  constructor(t3 = `Invariant Violation`) {
42163
- super(typeof t3 == `number` ? `Invariant Violation: ${t3}` : t3), Te(this, e3.prototype);
42163
+ super(typeof t3 == `number` ? `Invariant Violation: ${t3}` : t3), Ee(this, e3.prototype);
42164
42164
  }
42165
42165
  };
42166
- function T(e4, t3) {
42167
- if (typeof e4 == `function`) T(e4(), t3);
42168
- else if (!e4) throw new Ee(t3);
42166
+ function w(e4, t3) {
42167
+ if (typeof e4 == `function`) w(e4(), t3);
42168
+ else if (!e4) throw new De(t3);
42169
42169
  }
42170
- var De = /* @__PURE__ */ new Set([`trace`, `debug`, `info`, `warn`, `error`, `fatal`]);
42171
- function E2(e4) {
42172
- return De.has(e4) ? e4 : `info`;
42170
+ var Oe = /* @__PURE__ */ new Set([`trace`, `debug`, `info`, `warn`, `error`, `fatal`]);
42171
+ function T(e4) {
42172
+ return Oe.has(e4) ? e4 : `info`;
42173
42173
  }
42174
- var Oe = (() => {
42174
+ var ke = (() => {
42175
42175
  try {
42176
42176
  return (0, import_node_module.createRequire)(__otto_plugin_import_meta_url);
42177
42177
  } catch {
42178
42178
  return;
42179
42179
  }
42180
42180
  })();
42181
- function ke() {
42182
- if (!Oe) return false;
42181
+ function Ae() {
42182
+ if (!ke) return false;
42183
42183
  try {
42184
- return Oe.resolve(`pino-pretty`), true;
42184
+ return ke.resolve(`pino-pretty`), true;
42185
42185
  } catch {
42186
42186
  return false;
42187
42187
  }
42188
42188
  }
42189
- function Ae(e4) {
42189
+ function je(e4) {
42190
42190
  return e4 === `stdout` ? 1 : e4 === `stderr` ? 2 : e4;
42191
42191
  }
42192
- function je() {
42192
+ function Me() {
42193
42193
  return process.env.OTTO_LOG_STDERR === `0`;
42194
42194
  }
42195
- function Me() {
42195
+ function Ne() {
42196
42196
  return process.env.OTTO_LOG_FILE || `${process.env.HOME || process.env.USERPROFILE || `.`}/.otto/logs/otto.log`;
42197
42197
  }
42198
- function Ne(e4, t3) {
42199
- let n3 = ke(), r3 = je(), i2 = { target: n3 ? `pino-pretty` : `pino/file`, options: n3 ? { colorize: true, destination: 2 } : { destination: 2 }, level: t3 };
42200
- if (!e4 || e4 === `stdout` || e4 === `stderr`) return r3 ? [{ target: `pino/file`, options: { destination: Me(), mkdir: true }, level: t3 }] : [i2];
42201
- let a3 = { target: `pino/file`, options: { destination: Ae(e4), mkdir: true }, level: t3 };
42198
+ function Pe(e4, t3) {
42199
+ let n3 = Ae(), r3 = Me(), i2 = { target: n3 ? `pino-pretty` : `pino/file`, options: n3 ? { colorize: true, destination: 2 } : { destination: 2 }, level: t3 };
42200
+ if (!e4 || e4 === `stdout` || e4 === `stderr`) return r3 ? [{ target: `pino/file`, options: { destination: Ne(), mkdir: true }, level: t3 }] : [i2];
42201
+ let a3 = { target: `pino/file`, options: { destination: je(e4), mkdir: true }, level: t3 };
42202
42202
  return r3 ? [a3] : [a3, i2];
42203
42203
  }
42204
- var D = new import_node_stream.PassThrough();
42205
- var Pe = new t();
42206
- D.on(`data`, (e4) => {
42204
+ var E2 = new import_node_stream.PassThrough();
42205
+ var Fe = new t();
42206
+ E2.on(`data`, (e4) => {
42207
42207
  try {
42208
- Pe.publish({ log: [JSON.parse(e4.toString())] });
42208
+ Fe.publish({ log: [JSON.parse(e4.toString())] });
42209
42209
  } catch (t3) {
42210
42210
  console.warn(`Failed to parse log chunk for listener:`, e4.toString(), t3);
42211
42211
  }
42212
42212
  });
42213
- var O = null;
42214
- var k2 = E2(Q);
42215
- var Ie = /* @__PURE__ */ new Set();
42216
- var A = null;
42217
- function ze(e4, t3) {
42213
+ var D = null;
42214
+ var O = T(Q);
42215
+ var Le = /* @__PURE__ */ new Set();
42216
+ var k2 = null;
42217
+ function Be(e4, t3) {
42218
42218
  return globalThis.__miniv8_wasm === void 0 ? { write(n3) {
42219
- A ??= import_pino.default.transport({ targets: Ne(e4, t3) }), A.write(n3);
42219
+ k2 ??= import_pino.default.transport({ targets: Pe(e4, t3) }), k2.write(n3);
42220
42220
  } } : { write: (e5) => {
42221
- D.write(e5);
42221
+ E2.write(e5);
42222
42222
  } };
42223
42223
  }
42224
- function Be(e4, t3) {
42225
- return O ??= (0, import_pino.default)({ level: e4 }, import_pino.default.multistream([{ level: e4, stream: D }, { level: e4, stream: ze(t3, e4) }])), k2 = E2(O.level), O;
42226
- }
42227
42224
  function Ve(e4, t3) {
42228
- Be(t3?.level ?? E2(Q), t3?.destination ?? X), T(O, `Root logger is not initialized`);
42229
- let n3 = O.child({ name: e4 }, { level: t3?.level ?? k2 });
42230
- return Ie.add(n3), n3;
42225
+ return D ??= (0, import_pino.default)({ level: e4 }, import_pino.default.multistream([{ level: e4, stream: E2 }, { level: e4, stream: Be(t3, e4) }])), O = T(D.level), D;
42226
+ }
42227
+ function He(e4, t3) {
42228
+ Ve(t3?.level ?? T(Q), t3?.destination ?? X), w(D, `Root logger is not initialized`);
42229
+ let n3 = D.child({ name: e4 }, { level: t3?.level ?? O });
42230
+ return Le.add(n3), n3;
42231
42231
  }
42232
- var He = 10 * 1024 * 1024;
42232
+ var A = 10 * 1024 * 1024;
42233
42233
  var F2;
42234
42234
  function I2(e4) {
42235
42235
  let t3 = e4 || F2;
@@ -42267,9 +42267,9 @@ async function* Ct(e4) {
42267
42267
  n4 = t5?.code ?? t5?.type;
42268
42268
  } catch {
42269
42269
  }
42270
- throw new C(`Http request failed ${s4.status}: ${e5}`, { code: t4, status: s4.status, headers: s4.headers, errorType: n4 });
42270
+ throw new S(`Http request failed ${s4.status}: ${e5}`, { code: t4, status: s4.status, headers: s4.headers, errorType: n4 });
42271
42271
  }
42272
- if (e4.onResponse?.(s4.headers), !s4.body) throw new C(`Response body is empty`, { code: `BAD_RESPONSE` });
42272
+ if (e4.onResponse?.(s4.headers), !s4.body) throw new S(`Response body is empty`, { code: `BAD_RESPONSE` });
42273
42273
  h2 = s4.body.getReader();
42274
42274
  let c3 = new TextDecoder(), l3 = [], d2 = createParser({ onEvent(e5) {
42275
42275
  l3.push({ event: e5.event || void 0, data: e5.data, id: e5.id || void 0 });
@@ -42287,7 +42287,7 @@ async function* Ct(e4) {
42287
42287
  e5 && (p || (p = true, m()), yield e5);
42288
42288
  }
42289
42289
  } catch (e5) {
42290
- throw e5 instanceof C ? e5 : l2.signal.aborted || e5 instanceof DOMException && e5.name === `AbortError` ? new C(`Stream aborted or timed out`, { code: `TIMEOUT`, cause: e5 instanceof Error ? e5 : Error(String(e5)), abortKind: St(l2) }) : new C(`Stream request failed`, { code: `NETWORK_ERROR`, cause: e5 instanceof Error ? e5 : Error(String(e5)) });
42290
+ throw e5 instanceof S ? e5 : l2.signal.aborted || e5 instanceof DOMException && e5.name === `AbortError` ? new S(`Stream aborted or timed out`, { code: `TIMEOUT`, cause: e5 instanceof Error ? e5 : Error(String(e5)), abortKind: St(l2) }) : new S(`Stream request failed`, { code: `NETWORK_ERROR`, cause: e5 instanceof Error ? e5 : Error(String(e5)) });
42291
42291
  } finally {
42292
42292
  clearTimeout(d), f && clearTimeout(f), h2 && h2.cancel().catch(() => {
42293
42293
  });
@@ -42408,8 +42408,8 @@ var Yt = 5 * 1024 * 1024;
42408
42408
  var Xt = Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]);
42409
42409
  var Zt = Buffer.from(`GIF8`, `ascii`);
42410
42410
  var K2 = process.env.OTTO_STARTUP_TRACE === `1`;
42411
- var un = K2 ? performance.now() : 0;
42412
- var Y = Ve(`@x-otto/shared:file-lock`);
42411
+ var fn = K2 ? performance.now() : 0;
42412
+ var Y = He(`@x-otto/shared:file-lock`);
42413
42413
 
42414
42414
  // ../interchange/dist/index.js
42415
42415
  var a2 = /^data:([^;,]*)(?:;[^,]*)?,(.*)$/s;
@@ -42440,7 +42440,7 @@ function l(e4) {
42440
42440
  }
42441
42441
 
42442
42442
  // ../provider/dist/index.js
42443
- var h = Ve(`@x-otto/provider:tool-roundtrip`);
42443
+ var h = He(`@x-otto/provider:tool-roundtrip`);
42444
42444
  function g(e4) {
42445
42445
  let t3 = [], n3 = [], r3 = () => {
42446
42446
  for (let e5 of n3) h.warn({ toolCallId: e5.id, toolName: e5.name }, `Synthesizing placeholder for unanswered tool_call`), t3.push(_(e5));
@@ -42479,7 +42479,7 @@ ${n3.content}`, isError: e5.isError || n3.isError };
42479
42479
  }
42480
42480
  return t3;
42481
42481
  }
42482
- function b3(e4) {
42482
+ function b2(e4) {
42483
42483
  for (let t3 = 0; t3 < e4.length; t3++) {
42484
42484
  let n3 = e4[t3];
42485
42485
  if (n3.role !== `system_notification`) continue;
@@ -42489,7 +42489,7 @@ function b3(e4) {
42489
42489
  i2 === void 0 || i2.role === `assistant` || h.warn({ index: t3, relatedToolCallId: n3.relatedToolCallId, followingRole: i2?.role }, `system_notification message is not the last entry and is not immediately followed by an assistant turn (Anthropic placement rule violation risk) \u2014 sending anyway, provider may reject`);
42490
42490
  }
42491
42491
  }
42492
- function x2(e4) {
42492
+ function x3(e4) {
42493
42493
  return e4.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g, `\uFFFD`);
42494
42494
  }
42495
42495
  function ee(e4) {
@@ -42509,9 +42509,9 @@ function te2(e4) {
42509
42509
  }
42510
42510
  function w2(t3) {
42511
42511
  let n3 = [];
42512
- t3.systemPrompt && n3.push({ role: `system`, content: x2(t3.systemPrompt) });
42513
- for (let r3 of g(t3.messages)) if (r3.role === `user`) typeof r3.content == `string` ? n3.push({ role: `user`, content: x2(r3.content) }) : n3.push({ role: `user`, content: r3.content.map((t4) => {
42514
- if (t4.type === `text`) return { type: `text`, text: x2(t4.text) };
42512
+ t3.systemPrompt && n3.push({ role: `system`, content: x3(t3.systemPrompt) });
42513
+ for (let r3 of g(t3.messages)) if (r3.role === `user`) typeof r3.content == `string` ? n3.push({ role: `user`, content: x3(r3.content) }) : n3.push({ role: `user`, content: r3.content.map((t4) => {
42514
+ if (t4.type === `text`) return { type: `text`, text: x3(t4.text) };
42515
42515
  if (t4.type === `image`) {
42516
42516
  let { base64: n4, mediaType: r4, valid: i2 } = o2(t4.source, t4.mime);
42517
42517
  return i2 ? { type: `image_url`, image_url: { url: `data:${r4 || `image/png`};base64,${n4}` } } : { type: `text`, text: `[image omitted: corrupted or empty data]` };
@@ -42519,10 +42519,10 @@ function w2(t3) {
42519
42519
  return { type: `text`, text: `[unsupported]` };
42520
42520
  }) });
42521
42521
  else if (r3.role === `assistant`) {
42522
- let e4 = r3.content.filter((e5) => e5.type === `tool_call`).map((e5) => ({ id: e5.id, type: `function`, function: { name: e5.name, arguments: JSON.stringify(e5.arguments) } })), t4 = r3.content.filter((e5) => e5.type === `text`).filter((e5) => e5.text.trim().length > 0).map((e5) => x2(e5.text)).join(``);
42522
+ let e4 = r3.content.filter((e5) => e5.type === `tool_call`).map((e5) => ({ id: e5.id, type: `function`, function: { name: e5.name, arguments: JSON.stringify(e5.arguments) } })), t4 = r3.content.filter((e5) => e5.type === `text`).filter((e5) => e5.text.trim().length > 0).map((e5) => x3(e5.text)).join(``);
42523
42523
  if (!t4 && e4.length === 0) continue;
42524
42524
  n3.push({ role: `assistant`, content: t4 || null, ...e4.length > 0 ? { tool_calls: e4 } : {} });
42525
- } else r3.role === `tool_result` ? n3.push({ role: `tool`, tool_call_id: r3.toolCallId, content: x2(r3.content.map((e4) => e4.type === `text` ? e4.text : ``).join(``)) }) : r3.role === `system_notification` && n3.push({ role: `user`, content: x2(v(r3.content)) });
42525
+ } else r3.role === `tool_result` ? n3.push({ role: `tool`, tool_call_id: r3.toolCallId, content: x3(r3.content.map((e4) => e4.type === `text` ? e4.text : ``).join(``)) }) : r3.role === `system_notification` && n3.push({ role: `user`, content: x3(v(r3.content)) });
42526
42526
  return n3;
42527
42527
  }
42528
42528
  function ne(e4) {
@@ -42542,7 +42542,7 @@ function re(e4, t3, n3 = {}) {
42542
42542
  let r3 = { model: n3.modelName ?? e4.name, messages: w2(t3), max_tokens: t3.maxTokens ?? e4.maxOutputTokens, stream: true, stream_options: { include_usage: true } };
42543
42543
  return t3.temperature !== void 0 && !e4.reasoning && (r3.temperature = t3.temperature), e4.reasoning && t3.thinkingLevel && (r3.reasoning_effort = ne(C2(t3.thinkingLevel, e4.thinkingLevels))), t3.tools && t3.tools.length > 0 ? r3.tools = t3.tools.map((e5) => ({ type: `function`, function: { name: e5.name, description: e5.description, parameters: ee(e5.parameters) } })) : te2(t3.messages) && (r3.tools = []), r3;
42544
42544
  }
42545
- var T2 = Ve(`@x-otto/provider:openai-usage`);
42545
+ var T2 = He(`@x-otto/provider:openai-usage`);
42546
42546
  function ie2(e4) {
42547
42547
  let t3 = (t4) => {
42548
42548
  let n4 = e4.get(t4);
@@ -42575,7 +42575,7 @@ function E3(e4) {
42575
42575
  }
42576
42576
  return t3 ? { status: `unknown`, standardLimits: t3 } : null;
42577
42577
  }
42578
- var oe3 = Ve(`@x-otto/provider:stream-state`);
42578
+ var oe3 = He(`@x-otto/provider:stream-state`);
42579
42579
  function D2() {
42580
42580
  return { inputTokens: 0, outputTokens: 0, cacheReadTokens: 0, cacheWriteTokens: 0 };
42581
42581
  }
@@ -42629,7 +42629,7 @@ function de2(e4, t3 = true) {
42629
42629
  function F3(e4, t3, n3, r3) {
42630
42630
  return { role: `assistant`, content: t3, api: e4.api, provider: e4.provider, model: e4.model, usage: { inputTokens: n3.inputTokens, outputTokens: n3.outputTokens, cacheReadTokens: n3.cacheReadTokens, cacheWriteTokens: n3.cacheWriteTokens }, stopReason: r3 };
42631
42631
  }
42632
- var fe2 = Ve(`@x-otto/provider:chat-completions-stream`);
42632
+ var fe2 = He(`@x-otto/provider:chat-completions-stream`);
42633
42633
  function I3(e4) {
42634
42634
  switch (e4) {
42635
42635
  case `stop`:
@@ -42644,7 +42644,7 @@ function I3(e4) {
42644
42644
  return fe2.warn(`Unknown chat-completions finish_reason: ${e4}`), `end_turn`;
42645
42645
  }
42646
42646
  }
42647
- async function* pe(e4) {
42647
+ async function* pe2(e4) {
42648
42648
  let { url: t3, headers: r3, body: i2, identity: a3, signal: o3, timeout: s3, idleTimeout: c2, onResponse: l2, registeredToolNames: d } = e4, f = N2(), p = (e5 = false) => F3(a3, P2(f, e5), f, f.stopReason), m = false, h2 = false, g2 = false, _2, v2 = Ct({ url: t3, body: i2, headers: r3, signal: o3, timeout: s3, idleTimeout: c2, onResponse: (e5) => {
42649
42649
  _2 = e5, l2?.(e5);
42650
42650
  } });
@@ -42659,7 +42659,7 @@ async function* pe(e4) {
42659
42659
  }
42660
42660
  if (t4.error) {
42661
42661
  let e6 = t4.error, r5 = typeof e6.message == `string` ? e6.message : JSON.stringify(e6), i4 = e6.code, a5 = typeof i4 == `number` ? i4 : typeof i4 == `string` && /^\d+/.test(i4) ? Number(i4.match(/^\d+/)?.[0]) : void 0;
42662
- throw new Se(`Chat Completions stream error: ${r5}`, { code: `PROVIDER_API_ERROR`, status: a5 });
42662
+ throw new Ce(`Chat Completions stream error: ${r5}`, { code: `PROVIDER_API_ERROR`, status: a5 });
42663
42663
  }
42664
42664
  if (t4.usage) {
42665
42665
  let e6 = t4.usage, n3 = e6.prompt_tokens ?? 0, r5 = e6.completion_tokens ?? 0, i4 = e6.prompt_tokens_details?.cached_tokens ?? e6.prompt_cache_hit_tokens ?? 0;
@@ -42688,7 +42688,7 @@ async function* pe(e4) {
42688
42688
  for (let [e5, t4] of f.toolCalls) yield { type: `tool_call_end`, index: e5, toolCall: k3(t4.id, t4.name, t4.argumentsJson), partial: p() };
42689
42689
  yield { type: `done`, reason: f.stopReason, message: A2(p(true), d ?? /* @__PURE__ */ new Set()), providerUsage: E3(_2) };
42690
42690
  } catch (e5) {
42691
- yield { type: `error`, error: e5 instanceof Error ? e5 : new Se(`Unknown Chat Completions stream error`, { code: `PROVIDER_STREAM_ERROR` }) };
42691
+ yield { type: `error`, error: e5 instanceof Error ? e5 : new Ce(`Unknown Chat Completions stream error`, { code: `PROVIDER_STREAM_ERROR` }) };
42692
42692
  }
42693
42693
  }
42694
42694
  function L2(e4, t3, n3) {
@@ -42757,7 +42757,7 @@ function ve(e4) {
42757
42757
  for (let { name: e5, value: t4 } of o3.values()) s3[e5] = t4;
42758
42758
  return s3;
42759
42759
  }
42760
- var z2 = Ve(`@x-otto/provider:oauth:templates`);
42760
+ var z2 = He(`@x-otto/provider:oauth:templates`);
42761
42761
 
42762
42762
  // ../../extensions/plugin-otto-wire-protocols/src/anthropic-usage.ts
42763
42763
  var LIMIT_TYPE_ABBREVIATION = {
@@ -42927,7 +42927,7 @@ function buildAnthropicMessages(messages, model) {
42927
42927
  const result = [];
42928
42928
  const nativeSystemMessageSupported = model ? supportsMidConversationSystemMessage(model) : false;
42929
42929
  const normalized = nativeSystemMessageSupported ? y(messages) : messages;
42930
- b3(normalized);
42930
+ b2(normalized);
42931
42931
  for (const msg of g(normalized)) {
42932
42932
  if (msg.role === "user") {
42933
42933
  if (typeof msg.content === "string") {
@@ -43231,7 +43231,7 @@ var AnthropicStream = class {
43231
43231
  if (envKey) {
43232
43232
  return { token: envKey, mode: "api_key" };
43233
43233
  }
43234
- throw new Se(
43234
+ throw new Ce(
43235
43235
  "Missing Anthropic API key. Set ANTHROPIC_API_KEY or configure via auth file.",
43236
43236
  { code: "PROVIDER_AUTH_MISSING" }
43237
43237
  );
@@ -43333,7 +43333,7 @@ var AnthropicStream = class {
43333
43333
  if (error instanceof Anthropic.APIError) {
43334
43334
  yield {
43335
43335
  type: "error",
43336
- error: new Se(`Anthropic API error ${error.status}: ${error.message}`, {
43336
+ error: new Ce(`Anthropic API error ${error.status}: ${error.message}`, {
43337
43337
  code: "PROVIDER_API_ERROR",
43338
43338
  cause: error,
43339
43339
  // 把 SDK 的 HTTP status/headers 转成 ProviderError 的 typed 字段
@@ -43351,7 +43351,7 @@ var AnthropicStream = class {
43351
43351
  } else {
43352
43352
  yield {
43353
43353
  type: "error",
43354
- error: new Se("Unknown Anthropic stream error", {
43354
+ error: new Ce("Unknown Anthropic stream error", {
43355
43355
  code: "PROVIDER_STREAM_ERROR"
43356
43356
  })
43357
43357
  };
@@ -43400,14 +43400,14 @@ function buildResponsesInput(context) {
43400
43400
  if (typeof msg.content === "string") {
43401
43401
  input.push({
43402
43402
  role: "user",
43403
- content: [{ type: "input_text", text: x2(msg.content) }]
43403
+ content: [{ type: "input_text", text: x3(msg.content) }]
43404
43404
  });
43405
43405
  } else {
43406
43406
  input.push({
43407
43407
  role: "user",
43408
43408
  content: msg.content.map((part) => {
43409
43409
  if (part.type === "text") {
43410
- return { type: "input_text", text: x2(part.text) };
43410
+ return { type: "input_text", text: x3(part.text) };
43411
43411
  }
43412
43412
  if (part.type === "image") {
43413
43413
  const { base64, mediaType, valid } = o2(part.source, part.mime);
@@ -43424,7 +43424,7 @@ function buildResponsesInput(context) {
43424
43424
  });
43425
43425
  }
43426
43426
  } else if (msg.role === "assistant") {
43427
- const textParts = msg.content.filter((c2) => c2.type === "text").filter((c2) => c2.text.trim().length > 0).map((c2) => x2(c2.text)).join("");
43427
+ const textParts = msg.content.filter((c2) => c2.type === "text").filter((c2) => c2.text.trim().length > 0).map((c2) => x3(c2.text)).join("");
43428
43428
  if (textParts) {
43429
43429
  input.push({
43430
43430
  role: "assistant",
@@ -43445,7 +43445,7 @@ function buildResponsesInput(context) {
43445
43445
  input.push({
43446
43446
  type: "function_call_output",
43447
43447
  call_id: msg.toolCallId,
43448
- output: x2(
43448
+ output: x3(
43449
43449
  msg.content.map((c2) => c2.type === "text" ? c2.text : "").join("")
43450
43450
  )
43451
43451
  });
@@ -43453,7 +43453,7 @@ function buildResponsesInput(context) {
43453
43453
  input.push({
43454
43454
  role: "user",
43455
43455
  content: [
43456
- { type: "input_text", text: x2(v(msg.content)) }
43456
+ { type: "input_text", text: x3(v(msg.content)) }
43457
43457
  ]
43458
43458
  });
43459
43459
  }
@@ -43475,7 +43475,7 @@ function buildResponsesBody(model, context) {
43475
43475
  body.max_output_tokens = context.maxTokens ?? model.maxOutputTokens;
43476
43476
  }
43477
43477
  if (context.systemPrompt) {
43478
- body.instructions = x2(context.systemPrompt);
43478
+ body.instructions = x3(context.systemPrompt);
43479
43479
  }
43480
43480
  if (context.temperature !== void 0 && !model.reasoning) {
43481
43481
  body.temperature = context.temperature;
@@ -43582,7 +43582,7 @@ function dispatchResponsesSSEEvent(type, data, state) {
43582
43582
  state.outputTokens = outputTokens;
43583
43583
  state.cacheReadTokens = cached;
43584
43584
  }
43585
- const hasTool = [...state.blocks.values()].some((b4) => b4.kind === "tool_call");
43585
+ const hasTool = [...state.blocks.values()].some((b3) => b3.kind === "tool_call");
43586
43586
  if (type === "response.incomplete") {
43587
43587
  state.stopReason = "max_tokens";
43588
43588
  } else {
@@ -43599,7 +43599,7 @@ function dispatchResponsesSSEEvent(type, data, state) {
43599
43599
  return {
43600
43600
  events: [{
43601
43601
  type: "error",
43602
- error: new Se(`OpenAI Responses API error: ${message}`, {
43602
+ error: new Ce(`OpenAI Responses API error: ${message}`, {
43603
43603
  code: "PROVIDER_API_ERROR",
43604
43604
  errorType
43605
43605
  })
@@ -43647,7 +43647,7 @@ var OpenAIResponsesStream = class {
43647
43647
  if (envKey) {
43648
43648
  return { token: envKey, mode: "api_key" };
43649
43649
  }
43650
- throw new Se("Missing OpenAI credential. Set OPENAI_API_KEY or login via OAuth.", {
43650
+ throw new Ce("Missing OpenAI credential. Set OPENAI_API_KEY or login via OAuth.", {
43651
43651
  code: "PROVIDER_AUTH_MISSING"
43652
43652
  });
43653
43653
  }
@@ -43727,7 +43727,7 @@ var OpenAIResponsesStream = class {
43727
43727
  yield* result.events;
43728
43728
  if (result.fatal) return;
43729
43729
  }
43730
- const orderedTools = [...state.blocks.entries()].sort(([a3], [b4]) => a3 - b4);
43730
+ const orderedTools = [...state.blocks.entries()].sort(([a3], [b3]) => a3 - b3);
43731
43731
  for (const [index, block] of orderedTools) {
43732
43732
  if (block.kind === "tool_call") {
43733
43733
  yield {
@@ -43760,7 +43760,7 @@ var OpenAIResponsesStream = class {
43760
43760
  } else {
43761
43761
  yield {
43762
43762
  type: "error",
43763
- error: new Se("Unknown OpenAI Responses stream error", {
43763
+ error: new Ce("Unknown OpenAI Responses stream error", {
43764
43764
  code: "PROVIDER_STREAM_ERROR"
43765
43765
  })
43766
43766
  };
@@ -43817,7 +43817,7 @@ var OpenAICompletionsStream = class {
43817
43817
  return { token: key, mode: "api_key" };
43818
43818
  }
43819
43819
  }
43820
- throw new Se(
43820
+ throw new Ce(
43821
43821
  `Missing credential for provider '${model.provider}' (openai-completions).`,
43822
43822
  { code: "PROVIDER_AUTH_MISSING" }
43823
43823
  );
@@ -43839,7 +43839,7 @@ var OpenAICompletionsStream = class {
43839
43839
  logger: this.logger,
43840
43840
  diagnosticLabel: `openai-completions:${model.provider}`
43841
43841
  });
43842
- yield* pe({
43842
+ yield* pe2({
43843
43843
  url: `${model.baseUrl}/chat/completions`,
43844
43844
  headers,
43845
43845
  body: re(model, context),