@agentproto/adapter-pi 0.3.7 → 0.3.10

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.
@@ -854,8 +854,8 @@ var require_codegen = __commonJS({
854
854
  endIf() {
855
855
  return this._endBlockNode(If, Else);
856
856
  }
857
- _for(node, forBody) {
858
- this._blockNode(node);
857
+ _for(node2, forBody) {
858
+ this._blockNode(node2);
859
859
  if (forBody)
860
860
  this.code(forBody).endFor();
861
861
  return this;
@@ -904,10 +904,10 @@ var require_codegen = __commonJS({
904
904
  }
905
905
  // `return` statement
906
906
  return(value) {
907
- const node = new Return();
908
- this._blockNode(node);
907
+ const node2 = new Return();
908
+ this._blockNode(node2);
909
909
  this.code(value);
910
- if (node.nodes.length !== 1)
910
+ if (node2.nodes.length !== 1)
911
911
  throw new Error('CodeGen: "return" should have one node');
912
912
  return this._endBlockNode(Return);
913
913
  }
@@ -915,16 +915,16 @@ var require_codegen = __commonJS({
915
915
  try(tryBody, catchCode, finallyCode) {
916
916
  if (!catchCode && !finallyCode)
917
917
  throw new Error('CodeGen: "try" without "catch" and "finally"');
918
- const node = new Try();
919
- this._blockNode(node);
918
+ const node2 = new Try();
919
+ this._blockNode(node2);
920
920
  this.code(tryBody);
921
921
  if (catchCode) {
922
922
  const error2 = this.name("e");
923
- this._currNode = node.catch = new Catch(error2);
923
+ this._currNode = node2.catch = new Catch(error2);
924
924
  catchCode(error2);
925
925
  }
926
926
  if (finallyCode) {
927
- this._currNode = node.finally = new Finally();
927
+ this._currNode = node2.finally = new Finally();
928
928
  this.code(finallyCode);
929
929
  }
930
930
  return this._endBlockNode(Catch, Finally);
@@ -969,13 +969,13 @@ var require_codegen = __commonJS({
969
969
  this._root.optimizeNames(this._root.names, this._constants);
970
970
  }
971
971
  }
972
- _leafNode(node) {
973
- this._currNode.nodes.push(node);
972
+ _leafNode(node2) {
973
+ this._currNode.nodes.push(node2);
974
974
  return this;
975
975
  }
976
- _blockNode(node) {
977
- this._currNode.nodes.push(node);
978
- this._nodes.push(node);
976
+ _blockNode(node2) {
977
+ this._currNode.nodes.push(node2);
978
+ this._nodes.push(node2);
979
979
  }
980
980
  _endBlockNode(N1, N2) {
981
981
  const n = this._currNode;
@@ -985,12 +985,12 @@ var require_codegen = __commonJS({
985
985
  }
986
986
  throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`);
987
987
  }
988
- _elseNode(node) {
988
+ _elseNode(node2) {
989
989
  const n = this._currNode;
990
990
  if (!(n instanceof If)) {
991
991
  throw new Error('CodeGen: "else" without "if"');
992
992
  }
993
- this._currNode = n.else = node;
993
+ this._currNode = n.else = node2;
994
994
  return this;
995
995
  }
996
996
  get _root() {
@@ -1000,9 +1000,9 @@ var require_codegen = __commonJS({
1000
1000
  const ns = this._nodes;
1001
1001
  return ns[ns.length - 1];
1002
1002
  }
1003
- set _currNode(node) {
1003
+ set _currNode(node2) {
1004
1004
  const ns = this._nodes;
1005
- ns[ns.length - 1] = node;
1005
+ ns[ns.length - 1] = node2;
1006
1006
  }
1007
1007
  };
1008
1008
  exports$1.CodeGen = CodeGen;
@@ -1874,8 +1874,8 @@ var require_keyword = __commonJS({
1874
1874
  var _a3;
1875
1875
  const { gen, keyword, schema, parentSchema, $data, it } = cxt;
1876
1876
  checkAsyncKeyword(it, def);
1877
- const validate = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate;
1878
- const validateRef = useKeyword(gen, keyword, validate);
1877
+ const validate2 = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate;
1878
+ const validateRef = useKeyword(gen, keyword, validate2);
1879
1879
  const valid = gen.let("valid");
1880
1880
  cxt.block$data(valid, validateKeyword);
1881
1881
  cxt.ok((_a3 = def.valid) !== null && _a3 !== void 0 ? _a3 : valid);
@@ -1886,13 +1886,13 @@ var require_keyword = __commonJS({
1886
1886
  modifyData(cxt);
1887
1887
  reportErrs(() => cxt.error());
1888
1888
  } else {
1889
- const ruleErrs = def.async ? validateAsync() : validateSync();
1889
+ const ruleErrs = def.async ? validateAsync2() : validateSync();
1890
1890
  if (def.modifying)
1891
1891
  modifyData(cxt);
1892
1892
  reportErrs(() => addErrs(cxt, ruleErrs));
1893
1893
  }
1894
1894
  }
1895
- function validateAsync() {
1895
+ function validateAsync2() {
1896
1896
  const ruleErrs = gen.let("ruleErrs", null);
1897
1897
  gen.try(() => assignValid((0, codegen_1._)`await `), (e) => gen.assign(valid, false).if((0, codegen_1._)`${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._)`${e}.errors`), () => gen.throw(e)));
1898
1898
  return ruleErrs;
@@ -2298,11 +2298,11 @@ var require_resolve = __commonJS({
2298
2298
  }
2299
2299
  return ref;
2300
2300
  }
2301
- function addAnchor(anchor) {
2302
- if (typeof anchor == "string") {
2303
- if (!ANCHOR.test(anchor))
2304
- throw new Error(`invalid anchor "${anchor}"`);
2305
- addRef.call(this, `#${anchor}`);
2301
+ function addAnchor(anchor2) {
2302
+ if (typeof anchor2 == "string") {
2303
+ if (!ANCHOR.test(anchor2))
2304
+ throw new Error(`invalid anchor "${anchor2}"`);
2305
+ addRef.call(this, `#${anchor2}`);
2306
2306
  }
2307
2307
  }
2308
2308
  });
@@ -2939,28 +2939,28 @@ var require_compile = __commonJS({
2939
2939
  if (this.opts.code.process)
2940
2940
  sourceCode = this.opts.code.process(sourceCode, sch);
2941
2941
  const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode);
2942
- const validate = makeValidate(this, this.scope.get());
2943
- this.scope.value(validateName, { ref: validate });
2944
- validate.errors = null;
2945
- validate.schema = sch.schema;
2946
- validate.schemaEnv = sch;
2942
+ const validate2 = makeValidate(this, this.scope.get());
2943
+ this.scope.value(validateName, { ref: validate2 });
2944
+ validate2.errors = null;
2945
+ validate2.schema = sch.schema;
2946
+ validate2.schemaEnv = sch;
2947
2947
  if (sch.$async)
2948
- validate.$async = true;
2948
+ validate2.$async = true;
2949
2949
  if (this.opts.code.source === true) {
2950
- validate.source = { validateName, validateCode, scopeValues: gen._values };
2950
+ validate2.source = { validateName, validateCode, scopeValues: gen._values };
2951
2951
  }
2952
2952
  if (this.opts.unevaluated) {
2953
2953
  const { props, items } = schemaCxt;
2954
- validate.evaluated = {
2954
+ validate2.evaluated = {
2955
2955
  props: props instanceof codegen_1.Name ? void 0 : props,
2956
2956
  items: items instanceof codegen_1.Name ? void 0 : items,
2957
2957
  dynamicProps: props instanceof codegen_1.Name,
2958
2958
  dynamicItems: items instanceof codegen_1.Name
2959
2959
  };
2960
- if (validate.source)
2961
- validate.source.evaluated = (0, codegen_1.stringify)(validate.evaluated);
2960
+ if (validate2.source)
2961
+ validate2.source.evaluated = (0, codegen_1.stringify)(validate2.evaluated);
2962
2962
  }
2963
- sch.validate = validate;
2963
+ sch.validate = validate2;
2964
2964
  return sch;
2965
2965
  } catch (e) {
2966
2966
  delete sch.validate;
@@ -6440,8 +6440,8 @@ var require_formats = __commonJS({
6440
6440
  "../../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/formats.js"(exports$1) {
6441
6441
  Object.defineProperty(exports$1, "__esModule", { value: true });
6442
6442
  exports$1.formatNames = exports$1.fastFormats = exports$1.fullFormats = void 0;
6443
- function fmtDef(validate, compare) {
6444
- return { validate, compare };
6443
+ function fmtDef(validate2, compare) {
6444
+ return { validate: validate2, compare };
6445
6445
  }
6446
6446
  exports$1.fullFormats = {
6447
6447
  // date: http://tools.ietf.org/html/rfc3339#section-5.6
@@ -7340,86 +7340,11 @@ var require_content_type = __commonJS({
7340
7340
  }
7341
7341
  });
7342
7342
 
7343
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
7344
- var _a;
7345
- var NEVER = /* @__PURE__ */ Object.freeze({
7346
- status: "aborted"
7347
- });
7348
- // @__NO_SIDE_EFFECTS__
7349
- function $constructor(name, initializer3, params) {
7350
- function init(inst, def) {
7351
- if (!inst._zod) {
7352
- Object.defineProperty(inst, "_zod", {
7353
- value: {
7354
- def,
7355
- constr: _,
7356
- traits: /* @__PURE__ */ new Set()
7357
- },
7358
- enumerable: false
7359
- });
7360
- }
7361
- if (inst._zod.traits.has(name)) {
7362
- return;
7363
- }
7364
- inst._zod.traits.add(name);
7365
- initializer3(inst, def);
7366
- const proto = _.prototype;
7367
- const keys = Object.keys(proto);
7368
- for (let i = 0; i < keys.length; i++) {
7369
- const k = keys[i];
7370
- if (!(k in inst)) {
7371
- inst[k] = proto[k].bind(inst);
7372
- }
7373
- }
7374
- }
7375
- const Parent = params?.Parent ?? Object;
7376
- class Definition extends Parent {
7377
- }
7378
- Object.defineProperty(Definition, "name", { value: name });
7379
- function _(def) {
7380
- var _a3;
7381
- const inst = params?.Parent ? new Definition() : this;
7382
- init(inst, def);
7383
- (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
7384
- for (const fn of inst._zod.deferred) {
7385
- fn();
7386
- }
7387
- return inst;
7388
- }
7389
- Object.defineProperty(_, "init", { value: init });
7390
- Object.defineProperty(_, Symbol.hasInstance, {
7391
- value: (inst) => {
7392
- if (params?.Parent && inst instanceof params.Parent)
7393
- return true;
7394
- return inst?._zod?.traits?.has(name);
7395
- }
7396
- });
7397
- Object.defineProperty(_, "name", { value: name });
7398
- return _;
7399
- }
7400
- var $ZodAsyncError = class extends Error {
7401
- constructor() {
7402
- super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
7403
- }
7404
- };
7405
- var $ZodEncodeError = class extends Error {
7406
- constructor(name) {
7407
- super(`Encountered unidirectional transform during encode: ${name}`);
7408
- this.name = "ZodEncodeError";
7409
- }
7410
- };
7411
- (_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});
7412
- var globalConfig = globalThis.__zod_globalConfig;
7413
- function config(newConfig) {
7414
- if (newConfig)
7415
- Object.assign(globalConfig, newConfig);
7416
- return globalConfig;
7417
- }
7418
-
7419
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
7343
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/util.js
7420
7344
  var util_exports = {};
7421
7345
  __export(util_exports, {
7422
7346
  BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
7347
+ CONSTANT_CATCH: () => CONSTANT_CATCH,
7423
7348
  Class: () => Class,
7424
7349
  NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
7425
7350
  aborted: () => aborted,
@@ -7430,6 +7355,7 @@ __export(util_exports, {
7430
7355
  assertNever: () => assertNever,
7431
7356
  assertNotEqual: () => assertNotEqual,
7432
7357
  assignProp: () => assignProp,
7358
+ attachSchema: () => attachSchema,
7433
7359
  base64ToUint8Array: () => base64ToUint8Array,
7434
7360
  base64urlToUint8Array: () => base64urlToUint8Array,
7435
7361
  cached: () => cached,
@@ -7438,8 +7364,11 @@ __export(util_exports, {
7438
7364
  cleanRegex: () => cleanRegex,
7439
7365
  clone: () => clone,
7440
7366
  cloneDef: () => cloneDef,
7367
+ codePointLength: () => codePointLength,
7368
+ constantCatch: () => constantCatch,
7441
7369
  createTransparentProxy: () => createTransparentProxy,
7442
7370
  defineLazy: () => defineLazy,
7371
+ defineLazyInternal: () => defineLazyInternal,
7443
7372
  esc: () => esc,
7444
7373
  escapeRegex: () => escapeRegex,
7445
7374
  explicitlyAborted: () => explicitlyAborted,
@@ -7452,11 +7381,14 @@ __export(util_exports, {
7452
7381
  getParsedType: () => getParsedType,
7453
7382
  getSizableOrigin: () => getSizableOrigin,
7454
7383
  hexToUint8Array: () => hexToUint8Array,
7384
+ hide: () => hide,
7385
+ installLazyProp: () => installLazyProp,
7455
7386
  isObject: () => isObject,
7456
7387
  isPlainObject: () => isPlainObject,
7457
7388
  issue: () => issue,
7458
7389
  joinValues: () => joinValues,
7459
7390
  jsonStringifyReplacer: () => jsonStringifyReplacer,
7391
+ members: () => members,
7460
7392
  merge: () => merge,
7461
7393
  mergeDefs: () => mergeDefs,
7462
7394
  normalizeParams: () => normalizeParams,
@@ -7465,6 +7397,7 @@ __export(util_exports, {
7465
7397
  objectClone: () => objectClone,
7466
7398
  omit: () => omit,
7467
7399
  optionalKeys: () => optionalKeys,
7400
+ own: () => own,
7468
7401
  parsedType: () => parsedType,
7469
7402
  partial: () => partial,
7470
7403
  pick: () => pick,
@@ -7478,6 +7411,7 @@ __export(util_exports, {
7478
7411
  shallowClone: () => shallowClone,
7479
7412
  slugify: () => slugify,
7480
7413
  stringifyPrimitive: () => stringifyPrimitive,
7414
+ toZod: () => toZod,
7481
7415
  uint8ArrayToBase64: () => uint8ArrayToBase64,
7482
7416
  uint8ArrayToBase64url: () => uint8ArrayToBase64url,
7483
7417
  uint8ArrayToHex: () => uint8ArrayToHex,
@@ -7489,6 +7423,9 @@ function assertEqual(val) {
7489
7423
  function assertNotEqual(val) {
7490
7424
  return val;
7491
7425
  }
7426
+ function toZod() {
7427
+ return (schema) => schema;
7428
+ }
7492
7429
  function assertIs(_arg) {
7493
7430
  }
7494
7431
  function assertNever(_x) {
@@ -7531,7 +7468,7 @@ function cleanRegex(source) {
7531
7468
  function floatSafeRemainder(val, step) {
7532
7469
  const ratio = val / step;
7533
7470
  const roundedRatio = Math.round(ratio);
7534
- const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);
7471
+ const tolerance = 4 * Number.EPSILON * Math.max(Math.abs(ratio), 1);
7535
7472
  if (Math.abs(ratio - roundedRatio) < tolerance)
7536
7473
  return 0;
7537
7474
  return ratio - roundedRatio;
@@ -7787,16 +7724,16 @@ function stringifyPrimitive(value) {
7787
7724
  }
7788
7725
  function optionalKeys(shape) {
7789
7726
  return Object.keys(shape).filter((k) => {
7790
- return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
7727
+ return shape[k]._zod.optin !== void 0 && shape[k]._zod.optout === "optional";
7791
7728
  });
7792
7729
  }
7793
- var NUMBER_FORMAT_RANGES = {
7730
+ var NUMBER_FORMAT_RANGES = /* @__PURE__ */ (() => ({
7794
7731
  safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
7795
7732
  int32: [-2147483648, 2147483647],
7796
7733
  uint32: [0, 4294967295],
7797
7734
  float32: [-34028234663852886e22, 34028234663852886e22],
7798
7735
  float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
7799
- };
7736
+ }))();
7800
7737
  var BIGINT_FORMAT_RANGES = {
7801
7738
  int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")],
7802
7739
  uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
@@ -7811,13 +7748,13 @@ function pick(schema, mask) {
7811
7748
  const def = mergeDefs(schema._zod.def, {
7812
7749
  get shape() {
7813
7750
  const newShape = {};
7814
- for (const key in mask) {
7815
- if (!(key in currDef.shape)) {
7816
- throw new Error(`Unrecognized key: "${key}"`);
7751
+ for (const key of Reflect.ownKeys(mask)) {
7752
+ if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
7753
+ throw new Error(`Unrecognized key: "${String(key)}"`);
7817
7754
  }
7818
7755
  if (!mask[key])
7819
7756
  continue;
7820
- newShape[key] = currDef.shape[key];
7757
+ assignProp(newShape, key, currDef.shape[key]);
7821
7758
  }
7822
7759
  assignProp(this, "shape", newShape);
7823
7760
  return newShape;
@@ -7836,9 +7773,9 @@ function omit(schema, mask) {
7836
7773
  const def = mergeDefs(schema._zod.def, {
7837
7774
  get shape() {
7838
7775
  const newShape = { ...schema._zod.def.shape };
7839
- for (const key in mask) {
7840
- if (!(key in currDef.shape)) {
7841
- throw new Error(`Unrecognized key: "${key}"`);
7776
+ for (const key of Reflect.ownKeys(mask)) {
7777
+ if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
7778
+ throw new Error(`Unrecognized key: "${String(key)}"`);
7842
7779
  }
7843
7780
  if (!mask[key])
7844
7781
  continue;
@@ -7859,7 +7796,7 @@ function extend(schema, shape) {
7859
7796
  const hasChecks = checks && checks.length > 0;
7860
7797
  if (hasChecks) {
7861
7798
  const existingShape = schema._zod.def.shape;
7862
- for (const key in shape) {
7799
+ for (const key of Reflect.ownKeys(shape)) {
7863
7800
  if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) {
7864
7801
  throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
7865
7802
  }
@@ -7888,6 +7825,9 @@ function safeExtend(schema, shape) {
7888
7825
  return clone(schema, def);
7889
7826
  }
7890
7827
  function merge(a, b) {
7828
+ if (!b?._zod?.def) {
7829
+ throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");
7830
+ }
7891
7831
  if (a._zod.def.checks?.length) {
7892
7832
  throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
7893
7833
  }
@@ -7904,21 +7844,21 @@ function merge(a, b) {
7904
7844
  });
7905
7845
  return clone(a, def);
7906
7846
  }
7907
- function partial(Class2, schema, mask) {
7847
+ function partial(Class2, schema, mask, name = "partial") {
7908
7848
  const currDef = schema._zod.def;
7909
7849
  const checks = currDef.checks;
7910
7850
  const hasChecks = checks && checks.length > 0;
7911
7851
  if (hasChecks) {
7912
- throw new Error(".partial() cannot be used on object schemas containing refinements");
7852
+ throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
7913
7853
  }
7914
7854
  const def = mergeDefs(schema._zod.def, {
7915
7855
  get shape() {
7916
7856
  const oldShape = schema._zod.def.shape;
7917
7857
  const shape = { ...oldShape };
7918
7858
  if (mask) {
7919
- for (const key in mask) {
7920
- if (!(key in oldShape)) {
7921
- throw new Error(`Unrecognized key: "${key}"`);
7859
+ for (const key of Reflect.ownKeys(mask)) {
7860
+ if (!Object.prototype.hasOwnProperty.call(oldShape, key)) {
7861
+ throw new Error(`Unrecognized key: "${String(key)}"`);
7922
7862
  }
7923
7863
  if (!mask[key])
7924
7864
  continue;
@@ -7928,7 +7868,7 @@ function partial(Class2, schema, mask) {
7928
7868
  }) : oldShape[key];
7929
7869
  }
7930
7870
  } else {
7931
- for (const key in oldShape) {
7871
+ for (const key of Reflect.ownKeys(oldShape)) {
7932
7872
  shape[key] = Class2 ? new Class2({
7933
7873
  type: "optional",
7934
7874
  innerType: oldShape[key]
@@ -7948,9 +7888,9 @@ function required(Class2, schema, mask) {
7948
7888
  const oldShape = schema._zod.def.shape;
7949
7889
  const shape = { ...oldShape };
7950
7890
  if (mask) {
7951
- for (const key in mask) {
7952
- if (!(key in shape)) {
7953
- throw new Error(`Unrecognized key: "${key}"`);
7891
+ for (const key of Reflect.ownKeys(mask)) {
7892
+ if (!Object.prototype.hasOwnProperty.call(shape, key)) {
7893
+ throw new Error(`Unrecognized key: "${String(key)}"`);
7954
7894
  }
7955
7895
  if (!mask[key])
7956
7896
  continue;
@@ -7960,7 +7900,7 @@ function required(Class2, schema, mask) {
7960
7900
  });
7961
7901
  }
7962
7902
  } else {
7963
- for (const key in oldShape) {
7903
+ for (const key of Reflect.ownKeys(oldShape)) {
7964
7904
  shape[key] = new Class2({
7965
7905
  type: "nonoptional",
7966
7906
  innerType: oldShape[key]
@@ -8004,9 +7944,24 @@ function prefixIssues(path, issues) {
8004
7944
  function unwrapMessage(message) {
8005
7945
  return typeof message === "string" ? message : message?.message;
8006
7946
  }
7947
+ function attachSchema(issues, start, inst) {
7948
+ var _a3;
7949
+ for (let i = start; i < issues.length; i++) {
7950
+ (_a3 = issues[i]).schema ?? (_a3.schema = inst);
7951
+ }
7952
+ }
8007
7953
  function finalizeIssue(iss, ctx, config2) {
8008
- const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
8009
- const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
7954
+ var _a3;
7955
+ const traits = iss.inst?._zod?.traits;
7956
+ if (traits?.has("$ZodType")) {
7957
+ if (traits.has("$ZodCheck"))
7958
+ (_a3 = iss).schema ?? (_a3.schema = iss.inst);
7959
+ else
7960
+ iss.schema = iss.inst;
7961
+ }
7962
+ const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : void 0;
7963
+ const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(schemaError?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
7964
+ const { inst: _inst, schema: _schema, continue: _continue, input: _input, ...rest } = iss;
8010
7965
  rest.path ?? (rest.path = []);
8011
7966
  rest.message = message;
8012
7967
  if (ctx?.reportInput) {
@@ -8023,6 +7978,20 @@ function getSizableOrigin(input) {
8023
7978
  return "file";
8024
7979
  return "unknown";
8025
7980
  }
7981
+ var highSurrogate = /[\uD800-\uDBFF]/;
7982
+ function codePointLength(str) {
7983
+ const units = str.length;
7984
+ if (!highSurrogate.test(str))
7985
+ return units;
7986
+ let count = units;
7987
+ for (let i = 0; i < units - 1; i++) {
7988
+ if ((str.charCodeAt(i) & 64512) === 55296 && (str.charCodeAt(i + 1) & 64512) === 56320) {
7989
+ count--;
7990
+ i++;
7991
+ }
7992
+ }
7993
+ return count;
7994
+ }
8026
7995
  function getLengthableOrigin(input) {
8027
7996
  if (Array.isArray(input))
8028
7997
  return "array";
@@ -8109,33 +8078,289 @@ var Class = class {
8109
8078
  constructor(..._args) {
8110
8079
  }
8111
8080
  };
8112
-
8113
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
8114
- var initializer = (inst, def) => {
8115
- inst.name = "$ZodError";
8116
- Object.defineProperty(inst, "_zod", {
8117
- value: inst._zod,
8118
- enumerable: false
8081
+ function members(proto, table) {
8082
+ for (const key in table) {
8083
+ const desc = Object.getOwnPropertyDescriptor(table, key);
8084
+ if (desc.get)
8085
+ Object.defineProperty(proto, key, { ...desc, enumerable: false });
8086
+ else
8087
+ defineBound(proto, key, desc.value);
8088
+ }
8089
+ }
8090
+ function own(inst, key, value, enumerable = true) {
8091
+ Object.defineProperty(inst, key, { configurable: true, writable: true, enumerable, value });
8092
+ return value;
8093
+ }
8094
+ function hide(inst, key, value) {
8095
+ return own(inst, key, value, false);
8096
+ }
8097
+ function defineBound(proto, key, fn) {
8098
+ Object.defineProperty(proto, key, {
8099
+ configurable: true,
8100
+ get() {
8101
+ return this == null ? fn : own(this, key, fn.bind(this));
8102
+ },
8103
+ set(value) {
8104
+ own(this, key, value);
8105
+ }
8106
+ });
8107
+ }
8108
+ function claim(inst, sentinel) {
8109
+ const proto = Object.getPrototypeOf(inst);
8110
+ return sentinel in proto ? void 0 : proto;
8111
+ }
8112
+ var installing;
8113
+ var broke = false;
8114
+ var breaker = {
8115
+ configurable: true,
8116
+ get() {
8117
+ broke = true;
8118
+ return void 0;
8119
+ }
8120
+ };
8121
+ function defineLazyInternal(inst, key, compute) {
8122
+ const proto = Object.getPrototypeOf(inst._zod);
8123
+ if (key in proto && installing !== inst._zod) {
8124
+ installing = void 0;
8125
+ return;
8126
+ }
8127
+ installing = inst._zod;
8128
+ Object.defineProperty(proto, key, {
8129
+ configurable: true,
8130
+ get() {
8131
+ Object.defineProperty(this, key, breaker);
8132
+ const outer = broke;
8133
+ broke = false;
8134
+ try {
8135
+ const value = compute(this);
8136
+ if (broke)
8137
+ delete this[key];
8138
+ else
8139
+ Object.defineProperty(this, key, { configurable: true, writable: true, value });
8140
+ broke = broke || outer;
8141
+ return value;
8142
+ } catch (err) {
8143
+ delete this[key];
8144
+ broke = broke || outer;
8145
+ throw err;
8146
+ }
8147
+ },
8148
+ set(value) {
8149
+ Object.defineProperty(this, key, { configurable: true, writable: true, value });
8150
+ }
8119
8151
  });
8120
- Object.defineProperty(inst, "issues", {
8121
- value: def,
8122
- enumerable: false
8152
+ }
8153
+ function installLazyProp(inst, key, make, enumerable) {
8154
+ const proto = claim(inst, key);
8155
+ if (!proto)
8156
+ return;
8157
+ Object.defineProperty(proto, key, {
8158
+ configurable: true,
8159
+ get() {
8160
+ const desc = { configurable: true, writable: true, enumerable, value: void 0 };
8161
+ Object.defineProperty(this, key, desc);
8162
+ desc.value = make(this);
8163
+ Object.defineProperty(this, key, desc);
8164
+ return desc.value;
8165
+ },
8166
+ set(value) {
8167
+ Object.defineProperty(this, key, { configurable: true, writable: true, enumerable, value });
8168
+ }
8123
8169
  });
8124
- inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
8125
- Object.defineProperty(inst, "toString", {
8126
- value: () => inst.message,
8127
- enumerable: false
8170
+ }
8171
+ var CONSTANT_CATCH = "~constantCatch";
8172
+ function constantCatch(value) {
8173
+ const fn = () => value;
8174
+ fn[CONSTANT_CATCH] = true;
8175
+ return fn;
8176
+ }
8177
+
8178
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/core.js
8179
+ var _a;
8180
+ var NEVER = /* @__PURE__ */ Object.freeze({
8181
+ status: "aborted"
8182
+ });
8183
+ var _zodDesc = { value: void 0, enumerable: false };
8184
+ var _E = "captureStackTrace" in Error ? Error : null;
8185
+ function newError(Definition) {
8186
+ const E = _E;
8187
+ if (E) {
8188
+ const saved = E.stackTraceLimit;
8189
+ if (typeof saved === "number") {
8190
+ try {
8191
+ E.stackTraceLimit = 0;
8192
+ } catch {
8193
+ _E = null;
8194
+ return new Definition();
8195
+ }
8196
+ try {
8197
+ return new Definition();
8198
+ } finally {
8199
+ E.stackTraceLimit = saved;
8200
+ }
8201
+ }
8202
+ }
8203
+ return new Definition();
8204
+ }
8205
+ // @__NO_SIDE_EFFECTS__
8206
+ function $constructor(name, initializer3, proto, params) {
8207
+ const zodProto = {};
8208
+ function Internals(def) {
8209
+ this.def = def;
8210
+ this.constr = _;
8211
+ this.traits = /* @__PURE__ */ new Set();
8212
+ }
8213
+ Internals.prototype = zodProto;
8214
+ const protoMembers = proto;
8215
+ const initialized = protoMembers && /* @__PURE__ */ new WeakSet();
8216
+ function init(inst, def) {
8217
+ if (!inst._zod) {
8218
+ _zodDesc.value = new Internals(def);
8219
+ try {
8220
+ Object.defineProperty(inst, "_zod", _zodDesc);
8221
+ } finally {
8222
+ _zodDesc.value = void 0;
8223
+ }
8224
+ }
8225
+ if (inst._zod.traits.has(name)) {
8226
+ return;
8227
+ }
8228
+ inst._zod.traits.add(name);
8229
+ initializer3(inst, def);
8230
+ if (initialized) {
8231
+ const own2 = Object.getPrototypeOf(inst);
8232
+ const ctorProto = inst._zod.constr.prototype;
8233
+ let up = own2;
8234
+ while (up && up !== ctorProto)
8235
+ up = Object.getPrototypeOf(up);
8236
+ const target = up ?? own2;
8237
+ if (!initialized.has(target)) {
8238
+ initialized.add(target);
8239
+ members(target, protoMembers);
8240
+ }
8241
+ }
8242
+ const proto2 = _.prototype;
8243
+ for (const k in proto2) {
8244
+ if (!Object.prototype.hasOwnProperty.call(proto2, k))
8245
+ continue;
8246
+ if (!(k in inst)) {
8247
+ inst[k] = proto2[k].bind(inst);
8248
+ }
8249
+ }
8250
+ }
8251
+ const Parent = params?.Parent ?? Object;
8252
+ class Definition extends Parent {
8253
+ }
8254
+ Object.defineProperty(Definition, "name", { value: name });
8255
+ function _(def) {
8256
+ const inst = params?.Parent ? newError(Definition) : this;
8257
+ init(inst, def);
8258
+ const deferred = inst._zod.deferred;
8259
+ if (deferred) {
8260
+ for (const fn of deferred) {
8261
+ fn();
8262
+ }
8263
+ inst._zod.deferred = void 0;
8264
+ }
8265
+ const pp = globalThis.__zod_globalConfig?.postProcessor;
8266
+ if (pp)
8267
+ pp(inst);
8268
+ return inst;
8269
+ }
8270
+ Object.defineProperty(_, "init", { value: init });
8271
+ Object.defineProperty(_, Symbol.hasInstance, {
8272
+ value: (inst) => {
8273
+ if (params?.Parent && inst instanceof params.Parent)
8274
+ return true;
8275
+ return inst?._zod?.traits?.has(name);
8276
+ }
8128
8277
  });
8278
+ Object.defineProperty(_, "name", { value: name });
8279
+ return _;
8280
+ }
8281
+ var $ZodAsyncError = class extends Error {
8282
+ constructor() {
8283
+ super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
8284
+ }
8285
+ };
8286
+ var $ZodEncodeError = class extends Error {
8287
+ constructor(name) {
8288
+ super(`Encountered unidirectional transform during encode: ${name}`);
8289
+ this.name = "ZodEncodeError";
8290
+ }
8291
+ };
8292
+ (_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});
8293
+ var globalConfig = globalThis.__zod_globalConfig;
8294
+ function config(newConfig) {
8295
+ if (newConfig)
8296
+ Object.assign(globalConfig, newConfig);
8297
+ return globalConfig;
8298
+ }
8299
+
8300
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/errors.js
8301
+ function _getMessage() {
8302
+ const internals = this._zod;
8303
+ internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
8304
+ return internals.message;
8305
+ }
8306
+ function _setMessage(value) {
8307
+ this._zod.message = value;
8308
+ }
8309
+ var _messageDesc = {
8310
+ get: _getMessage,
8311
+ set: _setMessage,
8312
+ enumerable: true,
8313
+ configurable: true
8314
+ };
8315
+ var _zodDesc2 = { value: void 0, enumerable: false };
8316
+ var _issuesDesc = { value: void 0, enumerable: false };
8317
+ var _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
8318
+ var initializer = (inst, def) => {
8319
+ inst.name = "$ZodError";
8320
+ _zodDesc2.value = inst._zod;
8321
+ Object.defineProperty(inst, "_zod", _zodDesc2);
8322
+ _issuesDesc.value = def;
8323
+ Object.defineProperty(inst, "issues", _issuesDesc);
8324
+ _zodDesc2.value = void 0;
8325
+ _issuesDesc.value = void 0;
8326
+ Object.defineProperty(inst, "message", _messageDesc);
8327
+ const proto = Object.getPrototypeOf(inst);
8328
+ if (!_installedToString.has(proto)) {
8329
+ _installedToString.add(proto);
8330
+ Object.defineProperty(proto, "toString", {
8331
+ configurable: true,
8332
+ enumerable: false,
8333
+ get() {
8334
+ const value = () => this.message;
8335
+ Object.defineProperty(this, "toString", { value, configurable: true, writable: true });
8336
+ return value;
8337
+ },
8338
+ set(value) {
8339
+ Object.defineProperty(this, "toString", { value, configurable: true, writable: true });
8340
+ }
8341
+ });
8342
+ }
8129
8343
  };
8130
8344
  var $ZodError = $constructor("$ZodError", initializer);
8131
- var $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
8345
+ var $ZodRealError = $constructor("$ZodError", initializer, void 0, {
8346
+ Parent: Error
8347
+ });
8348
+ function node(obj, key, make) {
8349
+ if (!Object.prototype.hasOwnProperty.call(obj, key)) {
8350
+ if (key === "__proto__") {
8351
+ Object.defineProperty(obj, key, { value: make(), writable: true, enumerable: true, configurable: true });
8352
+ } else {
8353
+ obj[key] = make();
8354
+ }
8355
+ }
8356
+ return obj[key];
8357
+ }
8132
8358
  function flattenError(error2, mapper = (issue2) => issue2.message) {
8133
8359
  const fieldErrors = {};
8134
8360
  const formErrors = [];
8135
8361
  for (const sub of error2.issues) {
8136
8362
  if (sub.path.length > 0) {
8137
- fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
8138
- fieldErrors[sub.path[0]].push(mapper(sub));
8363
+ node(fieldErrors, sub.path[0], () => []).push(mapper(sub));
8139
8364
  } else {
8140
8365
  formErrors.push(mapper(sub));
8141
8366
  }
@@ -8162,13 +8387,25 @@ function formatError(error2, mapper = (issue2) => issue2.message) {
8162
8387
  while (i < fullpath.length) {
8163
8388
  const el = fullpath[i];
8164
8389
  const terminal = i === fullpath.length - 1;
8165
- if (!terminal) {
8166
- curr[el] = curr[el] || { _errors: [] };
8167
- } else {
8168
- curr[el] = curr[el] || { _errors: [] };
8169
- curr[el]._errors.push(mapper(issue2));
8390
+ if (el === "_errors") {
8391
+ if (terminal)
8392
+ curr._errors.push(mapper(issue2));
8393
+ i++;
8394
+ continue;
8395
+ }
8396
+ if (!Object.prototype.hasOwnProperty.call(curr, el)) {
8397
+ Object.defineProperty(curr, el, {
8398
+ value: { _errors: [] },
8399
+ enumerable: true,
8400
+ writable: true,
8401
+ configurable: true
8402
+ });
8170
8403
  }
8171
- curr = curr[el];
8404
+ const node2 = curr[el];
8405
+ if (terminal) {
8406
+ node2._errors.push(mapper(issue2));
8407
+ }
8408
+ curr = node2;
8172
8409
  i++;
8173
8410
  }
8174
8411
  }
@@ -8179,31 +8416,40 @@ function formatError(error2, mapper = (issue2) => issue2.message) {
8179
8416
  return fieldErrors;
8180
8417
  }
8181
8418
 
8182
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
8183
- var _parse = (_Err) => (schema, value, _ctx, _params) => {
8184
- const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
8185
- const result = schema._zod.run({ value, issues: [] }, ctx);
8186
- if (result instanceof Promise) {
8187
- throw new $ZodAsyncError();
8188
- }
8189
- if (result.issues.length) {
8190
- const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
8191
- captureStackTrace(e, _params?.callee);
8192
- throw e;
8193
- }
8194
- return result.value;
8419
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/parse.js
8420
+ function finalizeParams(callee, params) {
8421
+ return { callee: params?.callee ?? callee, Err: params?.Err };
8422
+ }
8423
+ var _parse = (_Err) => {
8424
+ const fn = (schema, value, _ctx, _params) => {
8425
+ const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
8426
+ const result = schema._zod.run({ value, issues: [] }, ctx);
8427
+ if (result instanceof Promise) {
8428
+ throw new $ZodAsyncError();
8429
+ }
8430
+ if (result.issues.length) {
8431
+ const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
8432
+ captureStackTrace(e, _params?.callee ?? fn);
8433
+ throw e;
8434
+ }
8435
+ return result.value;
8436
+ };
8437
+ return fn;
8195
8438
  };
8196
- var _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
8197
- const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
8198
- let result = schema._zod.run({ value, issues: [] }, ctx);
8199
- if (result instanceof Promise)
8200
- result = await result;
8201
- if (result.issues.length) {
8202
- const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
8203
- captureStackTrace(e, params?.callee);
8204
- throw e;
8205
- }
8206
- return result.value;
8439
+ var _parseAsync = (_Err) => {
8440
+ const fn = async (schema, value, _ctx, params) => {
8441
+ const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
8442
+ let result = schema._zod.run({ value, issues: [] }, ctx);
8443
+ if (result instanceof Promise)
8444
+ result = await result;
8445
+ if (result.issues.length) {
8446
+ const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
8447
+ captureStackTrace(e, params?.callee ?? fn);
8448
+ throw e;
8449
+ }
8450
+ return result.value;
8451
+ };
8452
+ return fn;
8207
8453
  };
8208
8454
  var _safeParse = (_Err) => (schema, value, _ctx) => {
8209
8455
  const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
@@ -8228,19 +8474,35 @@ var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
8228
8474
  } : { success: true, data: result.value };
8229
8475
  };
8230
8476
  var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
8231
- var _encode = (_Err) => (schema, value, _ctx) => {
8232
- const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
8233
- return _parse(_Err)(schema, value, ctx);
8477
+ var _encode = (_Err) => {
8478
+ const parse3 = _parse(_Err);
8479
+ const fn = (schema, value, _ctx, _params) => {
8480
+ const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
8481
+ return parse3(schema, value, ctx, finalizeParams(fn, _params));
8482
+ };
8483
+ return fn;
8234
8484
  };
8235
- var _decode = (_Err) => (schema, value, _ctx) => {
8236
- return _parse(_Err)(schema, value, _ctx);
8485
+ var _decode = (_Err) => {
8486
+ const parse3 = _parse(_Err);
8487
+ const fn = (schema, value, _ctx, _params) => {
8488
+ return parse3(schema, value, _ctx, finalizeParams(fn, _params));
8489
+ };
8490
+ return fn;
8237
8491
  };
8238
- var _encodeAsync = (_Err) => async (schema, value, _ctx) => {
8239
- const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
8240
- return _parseAsync(_Err)(schema, value, ctx);
8492
+ var _encodeAsync = (_Err) => {
8493
+ const parseAsync3 = _parseAsync(_Err);
8494
+ const fn = async (schema, value, _ctx, _params) => {
8495
+ const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
8496
+ return await parseAsync3(schema, value, ctx, finalizeParams(fn, _params));
8497
+ };
8498
+ return fn;
8241
8499
  };
8242
- var _decodeAsync = (_Err) => async (schema, value, _ctx) => {
8243
- return _parseAsync(_Err)(schema, value, _ctx);
8500
+ var _decodeAsync = (_Err) => {
8501
+ const parseAsync3 = _parseAsync(_Err);
8502
+ const fn = async (schema, value, _ctx, _params) => {
8503
+ return await parseAsync3(schema, value, _ctx, finalizeParams(fn, _params));
8504
+ };
8505
+ return fn;
8244
8506
  };
8245
8507
  var _safeEncode = (_Err) => (schema, value, _ctx) => {
8246
8508
  const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
@@ -8257,13 +8519,16 @@ var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
8257
8519
  return _safeParseAsync(_Err)(schema, value, _ctx);
8258
8520
  };
8259
8521
 
8260
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.js
8522
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/regexes.js
8261
8523
  var cuid = /^[cC][0-9a-z]{6,}$/;
8262
8524
  var cuid2 = /^[0-9a-z]+$/;
8263
- var ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
8525
+ var ulid = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/;
8264
8526
  var xid = /^[0-9a-vA-V]{20}$/;
8265
8527
  var ksuid = /^[A-Za-z0-9]{27}$/;
8266
8528
  var nanoid = /^[a-zA-Z0-9_-]{21}$/;
8529
+ function nanoidOfLength(length) {
8530
+ return new RegExp(`^[a-zA-Z0-9_-]{${length}}$`);
8531
+ }
8267
8532
  var duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
8268
8533
  var guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
8269
8534
  var uuid = (version2) => {
@@ -8272,36 +8537,37 @@ var uuid = (version2) => {
8272
8537
  return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version2}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
8273
8538
  };
8274
8539
  var email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
8275
- var _emoji = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
8540
+ var _emoji = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
8276
8541
  function emoji() {
8277
8542
  return new RegExp(_emoji, "u");
8278
8543
  }
8279
8544
  var ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
8280
8545
  var ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
8281
8546
  var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
8282
- var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
8547
+ var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
8283
8548
  var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
8284
8549
  var base64url = /^[A-Za-z0-9_-]*$/;
8285
8550
  var httpProtocol = /^https?$/;
8286
8551
  var e164 = /^\+[1-9]\d{6,14}$/;
8287
8552
  var dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
8288
- var date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
8553
+ function anchor(source) {
8554
+ return new RegExp(`^${source}$`);
8555
+ }
8556
+ var date = /* @__PURE__ */ anchor(dateSource);
8289
8557
  function timeSource(args) {
8290
8558
  const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
8291
- const regex = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
8559
+ const regex = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : args.seconds ? `${hhmm}:[0-5]\\d(?:\\.\\d+)?` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
8292
8560
  return regex;
8293
8561
  }
8294
8562
  function time(args) {
8295
8563
  return new RegExp(`^${timeSource(args)}$`);
8296
8564
  }
8297
8565
  function datetime(args) {
8298
- const time3 = timeSource({ precision: args.precision });
8299
8566
  const opts = ["Z"];
8300
- if (args.local)
8301
- opts.push("");
8302
8567
  if (args.offset)
8303
8568
  opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
8304
- const timeRegex = `${time3}(?:${opts.join("|")})`;
8569
+ const qualified = `${timeSource({ precision: args.precision, seconds: true })}(?:${opts.join("|")})`;
8570
+ const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;
8305
8571
  return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
8306
8572
  }
8307
8573
  var string = (params) => {
@@ -8316,13 +8582,17 @@ var _null = /^null$/i;
8316
8582
  var lowercase = /^[^A-Z]*$/;
8317
8583
  var uppercase = /^[^a-z]*$/;
8318
8584
 
8319
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.js
8585
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/checks.js
8320
8586
  var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
8321
8587
  var _a3;
8322
8588
  inst._zod ?? (inst._zod = {});
8323
8589
  inst._zod.def = def;
8324
8590
  (_a3 = inst._zod).onattach ?? (_a3.onattach = []);
8325
8591
  });
8592
+ var _whenHasLength = (payload) => {
8593
+ const val = payload.value;
8594
+ return !nullish(val) && val.length !== void 0;
8595
+ };
8326
8596
  var numericOriginMap = {
8327
8597
  number: "number",
8328
8598
  bigint: "bigint",
@@ -8346,7 +8616,7 @@ var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst,
8346
8616
  return;
8347
8617
  }
8348
8618
  payload.issues.push({
8349
- origin,
8619
+ origin: numericOriginMap[typeof payload.value] ?? origin,
8350
8620
  code: "too_big",
8351
8621
  maximum: typeof def.value === "object" ? def.value.getTime() : def.value,
8352
8622
  input: payload.value,
@@ -8374,7 +8644,7 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
8374
8644
  return;
8375
8645
  }
8376
8646
  payload.issues.push({
8377
- origin,
8647
+ origin: numericOriginMap[typeof payload.value] ?? origin,
8378
8648
  code: "too_small",
8379
8649
  minimum: typeof def.value === "object" ? def.value.getTime() : def.value,
8380
8650
  input: payload.value,
@@ -8393,7 +8663,10 @@ var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (i
8393
8663
  inst._zod.check = (payload) => {
8394
8664
  if (typeof payload.value !== typeof def.value)
8395
8665
  throw new Error("Cannot mix number and bigint in multiple_of check.");
8396
- const isMultiple = typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0;
8666
+ const isMultiple = typeof payload.value === "bigint" ? (
8667
+ // `value % 0n` throws, and nothing is a multiple of zero — the number branch already fails this way via NaN
8668
+ def.value !== BigInt(0) && payload.value % def.value === BigInt(0)
8669
+ ) : floatSafeRemainder(payload.value, def.value) === 0;
8397
8670
  if (isMultiple)
8398
8671
  return;
8399
8672
  payload.issues.push({
@@ -8488,10 +8761,7 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
8488
8761
  var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
8489
8762
  var _a3;
8490
8763
  $ZodCheck.init(inst, def);
8491
- (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
8492
- const val = payload.value;
8493
- return !nullish(val) && val.length !== void 0;
8494
- });
8764
+ (_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
8495
8765
  inst._zod.onattach.push((inst2) => {
8496
8766
  const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
8497
8767
  if (def.maximum < curr)
@@ -8499,7 +8769,8 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
8499
8769
  });
8500
8770
  inst._zod.check = (payload) => {
8501
8771
  const input = payload.value;
8502
- const length = input.length;
8772
+ const units = input.length;
8773
+ const length = typeof input === "string" && units > def.maximum ? codePointLength(input) : units;
8503
8774
  if (length <= def.maximum)
8504
8775
  return;
8505
8776
  const origin = getLengthableOrigin(input);
@@ -8517,10 +8788,7 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
8517
8788
  var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
8518
8789
  var _a3;
8519
8790
  $ZodCheck.init(inst, def);
8520
- (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
8521
- const val = payload.value;
8522
- return !nullish(val) && val.length !== void 0;
8523
- });
8791
+ (_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
8524
8792
  inst._zod.onattach.push((inst2) => {
8525
8793
  const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
8526
8794
  if (def.minimum > curr)
@@ -8528,7 +8796,8 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
8528
8796
  });
8529
8797
  inst._zod.check = (payload) => {
8530
8798
  const input = payload.value;
8531
- const length = input.length;
8799
+ const units = input.length;
8800
+ const length = typeof input === "string" && units >= def.minimum && units < def.minimum * 2 ? codePointLength(input) : units;
8532
8801
  if (length >= def.minimum)
8533
8802
  return;
8534
8803
  const origin = getLengthableOrigin(input);
@@ -8546,10 +8815,7 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
8546
8815
  var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
8547
8816
  var _a3;
8548
8817
  $ZodCheck.init(inst, def);
8549
- (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
8550
- const val = payload.value;
8551
- return !nullish(val) && val.length !== void 0;
8552
- });
8818
+ (_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
8553
8819
  inst._zod.onattach.push((inst2) => {
8554
8820
  const bag = inst2._zod.bag;
8555
8821
  bag.minimum = def.length;
@@ -8558,7 +8824,8 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
8558
8824
  });
8559
8825
  inst._zod.check = (payload) => {
8560
8826
  const input = payload.value;
8561
- const length = input.length;
8827
+ const units = input.length;
8828
+ const length = typeof input === "string" && units >= def.length && units <= def.length * 2 ? codePointLength(input) : units;
8562
8829
  if (length === def.length)
8563
8830
  return;
8564
8831
  const origin = getLengthableOrigin(input);
@@ -8632,7 +8899,7 @@ var $ZodCheckUpperCase = /* @__PURE__ */ $constructor("$ZodCheckUpperCase", (ins
8632
8899
  var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst, def) => {
8633
8900
  $ZodCheck.init(inst, def);
8634
8901
  const escapedRegex = escapeRegex(def.includes);
8635
- const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
8902
+ const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
8636
8903
  def.pattern = pattern;
8637
8904
  inst._zod.onattach.push((inst2) => {
8638
8905
  const bag = inst2._zod.bag;
@@ -8706,13 +8973,13 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
8706
8973
  };
8707
8974
  });
8708
8975
 
8709
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/doc.js
8976
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/doc.js
8710
8977
  var Doc = class {
8711
- constructor(args = []) {
8978
+ constructor(args = [], closed = {}) {
8712
8979
  this.content = [];
8713
8980
  this.indent = 0;
8714
- if (this)
8715
- this.args = args;
8981
+ this.args = args;
8982
+ this.closed = closed;
8716
8983
  }
8717
8984
  indented(fn) {
8718
8985
  this.indent += 1;
@@ -8735,31 +9002,30 @@ var Doc = class {
8735
9002
  }
8736
9003
  compile() {
8737
9004
  const F = Function;
8738
- const args = this?.args;
8739
9005
  const content = this?.content ?? [``];
8740
- const lines = [...content.map((x) => ` ${x}`)];
8741
- return new F(...args, lines.join("\n"));
9006
+ const factory = new F(...Object.keys(this.closed), `return function (${this.args.join(", ")}) {
9007
+ ${content.join("\n")}
9008
+ };`);
9009
+ return factory(...Object.values(this.closed));
8742
9010
  }
8743
9011
  };
8744
9012
 
8745
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.js
9013
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/versions.js
8746
9014
  var version = {
8747
9015
  major: 4,
8748
- minor: 4,
8749
- patch: 3
9016
+ minor: 5,
9017
+ patch: 4
8750
9018
  };
8751
9019
 
8752
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.js
9020
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/schemas.js
8753
9021
  var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
8754
9022
  var _a3;
8755
9023
  inst ?? (inst = {});
8756
9024
  inst._zod.def = def;
8757
9025
  inst._zod.bag = inst._zod.bag || {};
8758
9026
  inst._zod.version = version;
8759
- const checks = [...inst._zod.def.checks ?? []];
8760
- if (inst._zod.traits.has("$ZodCheck")) {
8761
- checks.unshift(inst);
8762
- }
9027
+ const defChecks = inst._zod.def.checks;
9028
+ const checks = inst._zod.traits.has("$ZodCheck") ? [inst, ...defChecks ?? []] : defChecks?.length ? [...defChecks] : [];
8763
9029
  for (const ch of checks) {
8764
9030
  for (const fn of ch._zod.onattach) {
8765
9031
  fn(inst);
@@ -8772,6 +9038,8 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
8772
9038
  });
8773
9039
  } else {
8774
9040
  const runChecks = (payload, checks2, ctx) => {
9041
+ if (payload.memo)
9042
+ return payload;
8775
9043
  let isAborted = aborted(payload);
8776
9044
  let asyncResult;
8777
9045
  for (const ch of checks2) {
@@ -8795,6 +9063,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
8795
9063
  const nextLen = payload.issues.length;
8796
9064
  if (nextLen === currLen)
8797
9065
  return;
9066
+ attachSchema(payload.issues, currLen, inst);
8798
9067
  if (!isAborted)
8799
9068
  isAborted = aborted(payload, currLen);
8800
9069
  });
@@ -8802,6 +9071,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
8802
9071
  const nextLen = payload.issues.length;
8803
9072
  if (nextLen === currLen)
8804
9073
  continue;
9074
+ attachSchema(payload.issues, currLen, inst);
8805
9075
  if (!isAborted)
8806
9076
  isAborted = aborted(payload, currLen);
8807
9077
  }
@@ -8848,19 +9118,29 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
8848
9118
  return runChecks(result, checks, ctx);
8849
9119
  };
8850
9120
  }
8851
- defineLazy(inst, "~standard", () => ({
9121
+ }, {
9122
+ // Wrappers extend this by installing a richer factory over it; reading it eagerly would defeat the laziness.
9123
+ get "~standard"() {
9124
+ return hide(this, "~standard", standardProps(this));
9125
+ },
9126
+ set "~standard"(value) {
9127
+ own(this, "~standard", value);
9128
+ }
9129
+ });
9130
+ var toStandardResult = (r) => r.success ? { value: r.data } : { issues: r.error?.issues };
9131
+ function standardProps(inst) {
9132
+ return {
8852
9133
  validate: (value) => {
8853
9134
  try {
8854
- const r = safeParse(inst, value);
8855
- return r.success ? { value: r.data } : { issues: r.error?.issues };
9135
+ return toStandardResult(safeParse(inst, value));
8856
9136
  } catch (_) {
8857
- return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
9137
+ return safeParseAsync(inst, value).then(toStandardResult);
8858
9138
  }
8859
9139
  },
8860
9140
  vendor: "zod",
8861
9141
  version: 1
8862
- }));
8863
- });
9142
+ };
9143
+ }
8864
9144
  var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
8865
9145
  $ZodType.init(inst, def);
8866
9146
  inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string(inst._zod.bag);
@@ -8913,58 +9193,80 @@ var $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
8913
9193
  def.pattern ?? (def.pattern = email);
8914
9194
  $ZodStringFormat.init(inst, def);
8915
9195
  });
9196
+ var URL_BAD_FORMAT = 1;
9197
+ var URL_UNPARSEABLE = 2;
9198
+ function parseURLObject(trimmed, def) {
9199
+ if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) {
9200
+ return URL_BAD_FORMAT;
9201
+ }
9202
+ try {
9203
+ return new URL(trimmed);
9204
+ } catch {
9205
+ return URL_UNPARSEABLE;
9206
+ }
9207
+ }
9208
+ var asciiTabOrNewline = /[\t\n\r]/g;
9209
+ function stripTabAndNewline(value) {
9210
+ return value.replace(asciiTabOrNewline, "");
9211
+ }
9212
+ function urlHostnameOk(url2, hostname) {
9213
+ hostname.lastIndex = 0;
9214
+ return hostname.test(url2.hostname);
9215
+ }
9216
+ function urlProtocolOk(url2, protocol) {
9217
+ protocol.lastIndex = 0;
9218
+ return protocol.test(url2.protocol.endsWith(":") ? url2.protocol.slice(0, -1) : url2.protocol);
9219
+ }
8916
9220
  var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
8917
9221
  $ZodStringFormat.init(inst, def);
8918
9222
  inst._zod.check = (payload) => {
8919
9223
  try {
8920
9224
  const trimmed = payload.value.trim();
8921
- if (!def.normalize && def.protocol?.source === httpProtocol.source) {
8922
- if (!/^https?:\/\//i.test(trimmed)) {
8923
- payload.issues.push({
8924
- code: "invalid_format",
8925
- format: "url",
8926
- note: "Invalid URL format",
8927
- input: payload.value,
8928
- inst,
8929
- continue: !def.abort
8930
- });
8931
- return;
8932
- }
9225
+ const url2 = parseURLObject(trimmed, def);
9226
+ if (url2 === URL_BAD_FORMAT) {
9227
+ payload.issues.push({
9228
+ code: "invalid_format",
9229
+ format: "url",
9230
+ note: "Invalid URL format",
9231
+ input: payload.value,
9232
+ inst,
9233
+ continue: !def.abort
9234
+ });
9235
+ return;
8933
9236
  }
8934
- const url2 = new URL(trimmed);
8935
- if (def.hostname) {
8936
- def.hostname.lastIndex = 0;
8937
- if (!def.hostname.test(url2.hostname)) {
8938
- payload.issues.push({
8939
- code: "invalid_format",
8940
- format: "url",
8941
- note: "Invalid hostname",
8942
- pattern: def.hostname.source,
8943
- input: payload.value,
8944
- inst,
8945
- continue: !def.abort
8946
- });
8947
- }
9237
+ if (url2 === URL_UNPARSEABLE) {
9238
+ payload.issues.push({
9239
+ code: "invalid_format",
9240
+ format: "url",
9241
+ input: payload.value,
9242
+ inst,
9243
+ continue: !def.abort
9244
+ });
9245
+ return;
8948
9246
  }
8949
- if (def.protocol) {
8950
- def.protocol.lastIndex = 0;
8951
- if (!def.protocol.test(url2.protocol.endsWith(":") ? url2.protocol.slice(0, -1) : url2.protocol)) {
8952
- payload.issues.push({
8953
- code: "invalid_format",
8954
- format: "url",
8955
- note: "Invalid protocol",
8956
- pattern: def.protocol.source,
8957
- input: payload.value,
8958
- inst,
8959
- continue: !def.abort
8960
- });
8961
- }
9247
+ if (def.hostname && !urlHostnameOk(url2, def.hostname)) {
9248
+ payload.issues.push({
9249
+ code: "invalid_format",
9250
+ format: "url",
9251
+ note: "Invalid hostname",
9252
+ pattern: def.hostname.source,
9253
+ input: payload.value,
9254
+ inst,
9255
+ continue: !def.abort
9256
+ });
8962
9257
  }
8963
- if (def.normalize) {
8964
- payload.value = url2.href;
8965
- } else {
8966
- payload.value = trimmed;
9258
+ if (def.protocol && !urlProtocolOk(url2, def.protocol)) {
9259
+ payload.issues.push({
9260
+ code: "invalid_format",
9261
+ format: "url",
9262
+ note: "Invalid protocol",
9263
+ pattern: def.protocol.source,
9264
+ input: payload.value,
9265
+ inst,
9266
+ continue: !def.abort
9267
+ });
8967
9268
  }
9269
+ payload.value = def.normalize ? url2.href : stripTabAndNewline(trimmed);
8968
9270
  return;
8969
9271
  } catch (_) {
8970
9272
  payload.issues.push({
@@ -8982,7 +9284,9 @@ var $ZodEmoji = /* @__PURE__ */ $constructor("$ZodEmoji", (inst, def) => {
8982
9284
  $ZodStringFormat.init(inst, def);
8983
9285
  });
8984
9286
  var $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def) => {
8985
- def.pattern ?? (def.pattern = nanoid);
9287
+ if (def.length !== void 0 && (!Number.isInteger(def.length) || def.length < 1))
9288
+ throw new Error(`Invalid nanoid length: ${def.length}`);
9289
+ def.pattern ?? (def.pattern = def.length === void 0 ? nanoid : nanoidOfLength(def.length));
8986
9290
  $ZodStringFormat.init(inst, def);
8987
9291
  });
8988
9292
  var $ZodCUID = /* @__PURE__ */ $constructor("$ZodCUID", (inst, def) => {
@@ -9008,6 +9312,12 @@ var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
9008
9312
  var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
9009
9313
  def.pattern ?? (def.pattern = datetime(def));
9010
9314
  $ZodStringFormat.init(inst, def);
9315
+ if (def.local || def.precision === -1) {
9316
+ inst._zod.bag.laxFormat = true;
9317
+ inst._zod.onattach.push((s) => {
9318
+ s._zod.bag.laxFormat = true;
9319
+ });
9320
+ }
9011
9321
  });
9012
9322
  var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
9013
9323
  def.pattern ?? (def.pattern = date);
@@ -9026,14 +9336,23 @@ var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
9026
9336
  $ZodStringFormat.init(inst, def);
9027
9337
  inst._zod.bag.format = `ipv4`;
9028
9338
  });
9339
+ var ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
9340
+ function isValidIPv6(value) {
9341
+ if (!ipv6Alphabet.test(value))
9342
+ return false;
9343
+ try {
9344
+ new URL(`http://[${value}]`);
9345
+ return true;
9346
+ } catch {
9347
+ return false;
9348
+ }
9349
+ }
9029
9350
  var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
9030
9351
  def.pattern ?? (def.pattern = ipv6);
9031
9352
  $ZodStringFormat.init(inst, def);
9032
9353
  inst._zod.bag.format = `ipv6`;
9033
9354
  inst._zod.check = (payload) => {
9034
- try {
9035
- new URL(`http://[${payload.value}]`);
9036
- } catch {
9355
+ if (!isValidIPv6(payload.value)) {
9037
9356
  payload.issues.push({
9038
9357
  code: "invalid_format",
9039
9358
  format: "ipv6",
@@ -9048,24 +9367,25 @@ var $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => {
9048
9367
  def.pattern ?? (def.pattern = cidrv4);
9049
9368
  $ZodStringFormat.init(inst, def);
9050
9369
  });
9370
+ function isValidCIDRv6(value) {
9371
+ const parts = value.split("/");
9372
+ if (parts.length !== 2)
9373
+ return false;
9374
+ const [address, prefix] = parts;
9375
+ if (!prefix)
9376
+ return false;
9377
+ const prefixNum = Number(prefix);
9378
+ if (`${prefixNum}` !== prefix)
9379
+ return false;
9380
+ if (prefixNum < 0 || prefixNum > 128)
9381
+ return false;
9382
+ return isValidIPv6(address);
9383
+ }
9051
9384
  var $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => {
9052
9385
  def.pattern ?? (def.pattern = cidrv6);
9053
9386
  $ZodStringFormat.init(inst, def);
9054
9387
  inst._zod.check = (payload) => {
9055
- const parts = payload.value.split("/");
9056
- try {
9057
- if (parts.length !== 2)
9058
- throw new Error();
9059
- const [address, prefix] = parts;
9060
- if (!prefix)
9061
- throw new Error();
9062
- const prefixNum = Number(prefix);
9063
- if (`${prefixNum}` !== prefix)
9064
- throw new Error();
9065
- if (prefixNum < 0 || prefixNum > 128)
9066
- throw new Error();
9067
- new URL(`http://[${address}]`);
9068
- } catch {
9388
+ if (!isValidCIDRv6(payload.value)) {
9069
9389
  payload.issues.push({
9070
9390
  code: "invalid_format",
9071
9391
  format: "cidrv6",
@@ -9180,7 +9500,7 @@ var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
9180
9500
  if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) {
9181
9501
  return payload;
9182
9502
  }
9183
- const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
9503
+ const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? String(input) : void 0 : void 0;
9184
9504
  payload.issues.push({
9185
9505
  expected: "number",
9186
9506
  code: "invalid_type",
@@ -9305,6 +9625,8 @@ function handleArrayResult(result, final, index) {
9305
9625
  }
9306
9626
  var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
9307
9627
  $ZodType.init(inst, def);
9628
+ const memo2 = globalConfig.memoizer;
9629
+ memo2?.attach(inst);
9308
9630
  inst._zod.parse = (payload, ctx) => {
9309
9631
  const input = payload.value;
9310
9632
  if (!Array.isArray(input)) {
@@ -9316,7 +9638,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
9316
9638
  });
9317
9639
  return payload;
9318
9640
  }
9319
- payload.value = Array(input.length);
9641
+ payload.value = memo2 ? memo2.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
9320
9642
  const proms = [];
9321
9643
  for (let i = 0; i < input.length; i++) {
9322
9644
  const item = input[i];
@@ -9336,15 +9658,19 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
9336
9658
  return payload;
9337
9659
  };
9338
9660
  });
9339
- function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {
9661
+ function handlePropertyResult(result, final, key, input, optin, optout) {
9340
9662
  const isPresent = key in input;
9663
+ const isOptionalOut = optout === "optional";
9664
+ if (!isPresent && isOptionalOut && optin === "optional") {
9665
+ return;
9666
+ }
9341
9667
  if (result.issues.length) {
9342
- if (isOptionalIn && isOptionalOut && !isPresent) {
9668
+ if (optin !== void 0 && isOptionalOut && !isPresent) {
9343
9669
  return;
9344
9670
  }
9345
9671
  final.issues.push(...prefixIssues(key, result.issues));
9346
9672
  }
9347
- if (!isPresent && !isOptionalIn) {
9673
+ if (!isPresent && optin === void 0) {
9348
9674
  if (!result.issues.length) {
9349
9675
  final.issues.push({
9350
9676
  code: "invalid_type",
@@ -9363,17 +9689,23 @@ function handlePropertyResult(result, final, key, input, isOptionalIn, isOptiona
9363
9689
  final.value[key] = result.value;
9364
9690
  }
9365
9691
  }
9692
+ var NO_SYMBOL_KEYS = [];
9366
9693
  function normalizeDef(def) {
9367
9694
  const keys = Object.keys(def.shape);
9368
- for (const k of keys) {
9695
+ const ownSymbols = Object.getOwnPropertySymbols(def.shape);
9696
+ const symbolKeys = ownSymbols.length ? ownSymbols : NO_SYMBOL_KEYS;
9697
+ const allKeys = symbolKeys.length ? [...keys, ...symbolKeys] : keys;
9698
+ for (const k of allKeys) {
9369
9699
  if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) {
9370
- throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
9700
+ throw new Error(`Invalid element at key "${String(k)}": expected a Zod schema`);
9371
9701
  }
9372
9702
  }
9373
9703
  const okeys = optionalKeys(def.shape);
9374
9704
  return {
9375
9705
  ...def,
9376
- keys,
9706
+ allKeys,
9707
+ symbolKeys,
9708
+ // string-only: handleCatchall matches it against `for...in`, which never yields a symbol
9377
9709
  keySet: new Set(keys),
9378
9710
  numKeys: keys.length,
9379
9711
  optionalKeys: new Set(okeys)
@@ -9384,22 +9716,25 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
9384
9716
  const keySet = def.keySet;
9385
9717
  const _catchall = def.catchall._zod;
9386
9718
  const t = _catchall.def.type;
9387
- const isOptionalIn = _catchall.optin === "optional";
9388
- const isOptionalOut = _catchall.optout === "optional";
9719
+ const optin = _catchall.optin;
9720
+ const optout = _catchall.optout;
9389
9721
  for (const key in input) {
9390
- if (key === "__proto__")
9391
- continue;
9392
9722
  if (keySet.has(key))
9393
9723
  continue;
9724
+ if (key === "__proto__") {
9725
+ if (t === "never")
9726
+ unrecognized.push(key);
9727
+ continue;
9728
+ }
9394
9729
  if (t === "never") {
9395
9730
  unrecognized.push(key);
9396
9731
  continue;
9397
9732
  }
9398
9733
  const r = _catchall.run({ value: input[key], issues: [] }, ctx);
9399
9734
  if (r instanceof Promise) {
9400
- proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut)));
9735
+ proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, optin, optout)));
9401
9736
  } else {
9402
- handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
9737
+ handlePropertyResult(r, payload, key, input, optin, optout);
9403
9738
  }
9404
9739
  }
9405
9740
  if (unrecognized.length) {
@@ -9407,7 +9742,9 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
9407
9742
  code: "unrecognized_keys",
9408
9743
  keys: unrecognized,
9409
9744
  input,
9410
- inst
9745
+ inst,
9746
+ // Describes the shape of the input, not the validity of the parsed value, so it never aborts. The parse still fails; the schema's own checks just get to run first, and an enclosing intersection can reconcile the key against a sibling operand.
9747
+ continue: true
9411
9748
  });
9412
9749
  }
9413
9750
  if (!proms.length)
@@ -9416,31 +9753,38 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
9416
9753
  return payload;
9417
9754
  });
9418
9755
  }
9756
+ var propShapes = /* @__PURE__ */ new WeakMap();
9419
9757
  var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
9420
9758
  $ZodType.init(inst, def);
9421
9759
  const desc = Object.getOwnPropertyDescriptor(def, "shape");
9422
9760
  if (!desc?.get) {
9423
9761
  const sh = def.shape;
9762
+ propShapes.set(def, sh);
9424
9763
  Object.defineProperty(def, "shape", {
9425
9764
  get: () => {
9426
9765
  const newSh = { ...sh };
9427
9766
  Object.defineProperty(def, "shape", {
9428
9767
  value: newSh
9429
9768
  });
9769
+ propShapes.set(def, newSh);
9430
9770
  return newSh;
9431
9771
  }
9432
9772
  });
9433
9773
  }
9434
9774
  const _normalized = cached(() => normalizeDef(def));
9435
- defineLazy(inst._zod, "propValues", () => {
9436
- const shape = def.shape;
9775
+ defineLazyInternal(inst, "propValues", (zod) => {
9776
+ const shape = zod.def.shape;
9437
9777
  const propValues = {};
9438
9778
  for (const key in shape) {
9439
9779
  const field = shape[key]._zod;
9440
9780
  if (field.values) {
9441
- propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
9781
+ if (!Object.prototype.hasOwnProperty.call(propValues, key)) {
9782
+ assignProp(propValues, key, /* @__PURE__ */ new Set());
9783
+ }
9442
9784
  for (const v of field.values)
9443
9785
  propValues[key].add(v);
9786
+ if (field.optin !== void 0)
9787
+ propValues[key].add(void 0);
9444
9788
  }
9445
9789
  }
9446
9790
  return propValues;
@@ -9448,6 +9792,8 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
9448
9792
  const isObject2 = isObject;
9449
9793
  const catchall = def.catchall;
9450
9794
  let value;
9795
+ const memo2 = globalConfig.memoizer;
9796
+ memo2?.attach(inst);
9451
9797
  inst._zod.parse = (payload, ctx) => {
9452
9798
  value ?? (value = _normalized.value);
9453
9799
  const input = payload.value;
@@ -9460,18 +9806,20 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
9460
9806
  });
9461
9807
  return payload;
9462
9808
  }
9463
- payload.value = {};
9809
+ payload.value = memo2 ? memo2.alloc(inst, payload, {}, ctx) : {};
9464
9810
  const proms = [];
9465
9811
  const shape = value.shape;
9466
- for (const key of value.keys) {
9812
+ for (const key of value.allKeys) {
9813
+ if (key === "__proto__")
9814
+ continue;
9467
9815
  const el = shape[key];
9468
- const isOptionalIn = el._zod.optin === "optional";
9469
- const isOptionalOut = el._zod.optout === "optional";
9816
+ const optin = el._zod.optin;
9817
+ const optout = el._zod.optout;
9470
9818
  const r = el._zod.run({ value: input[key], issues: [] }, ctx);
9471
9819
  if (r instanceof Promise) {
9472
- proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut)));
9820
+ proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, optin, optout)));
9473
9821
  } else {
9474
- handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
9822
+ handlePropertyResult(r, payload, key, input, optin, optout);
9475
9823
  }
9476
9824
  }
9477
9825
  if (!catchall) {
@@ -9484,55 +9832,54 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
9484
9832
  $ZodObject.init(inst, def);
9485
9833
  const superParse = inst._zod.parse;
9486
9834
  const _normalized = cached(() => normalizeDef(def));
9835
+ const memo2 = globalConfig.memoizer;
9487
9836
  const generateFastpass = (shape) => {
9488
- const doc = new Doc(["shape", "payload", "ctx"]);
9489
9837
  const normalized = _normalized.value;
9490
- const parseStr = (key) => {
9491
- const k = esc(key);
9492
- return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
9493
- };
9838
+ const syms = normalized.symbolKeys;
9839
+ const doc = new Doc(["payload", "ctx"], { shape, inst, memo: memo2, syms });
9840
+ const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
9841
+ const prefixStr = (id, k) => `
9842
+ for (let i = 0; i < ${id}.issues.length; i++) {
9843
+ const iss = ${id}.issues[i];
9844
+ iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
9845
+ payload.issues.push(iss);
9846
+ }`;
9494
9847
  doc.write(`const input = payload.value;`);
9495
9848
  const ids = /* @__PURE__ */ Object.create(null);
9496
9849
  let counter = 0;
9497
- for (const key of normalized.keys) {
9850
+ for (const key of normalized.allKeys) {
9498
9851
  ids[key] = `key_${counter++}`;
9499
9852
  }
9500
- doc.write(`const newResult = {};`);
9501
- for (const key of normalized.keys) {
9853
+ doc.write(memo2 ? `const newResult = memo.alloc(inst, payload, {}, ctx);` : `const newResult = {};`);
9854
+ for (const key of normalized.allKeys) {
9855
+ if (key === "__proto__")
9856
+ continue;
9502
9857
  const id = ids[key];
9503
- const k = esc(key);
9858
+ const k = typeof key === "symbol" ? `syms[${syms.indexOf(key)}]` : esc(key);
9859
+ const isPresent = `${k} in input`;
9504
9860
  const schema = shape[key];
9505
- const isOptionalIn = schema?._zod?.optin === "optional";
9861
+ const optin = schema?._zod?.optin;
9862
+ const isOptionalIn = optin !== void 0;
9506
9863
  const isOptionalOut = schema?._zod?.optout === "optional";
9507
- doc.write(`const ${id} = ${parseStr(key)};`);
9864
+ doc.write(`const ${id} = ${parseStr(k)};`);
9508
9865
  if (isOptionalIn && isOptionalOut) {
9866
+ const assign = optin === "optional" ? `${id}_present` : `${id}.value !== undefined || ${id}_present`;
9509
9867
  doc.write(`
9510
- if (${id}.issues.length) {
9511
- if (${k} in input) {
9512
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
9513
- ...iss,
9514
- path: iss.path ? [${k}, ...iss.path] : [${k}]
9515
- })));
9868
+ const ${id}_present = ${isPresent};
9869
+ if (!${id}.issues.length || ${id}_present) {
9870
+ if (${id}.issues.length) {${prefixStr(id, k)}
9516
9871
  }
9517
- }
9518
-
9519
- if (${id}.value === undefined) {
9520
- if (${k} in input) {
9521
- newResult[${k}] = undefined;
9872
+
9873
+ if (${assign}) {
9874
+ newResult[${k}] = ${id}.value;
9522
9875
  }
9523
- } else {
9524
- newResult[${k}] = ${id}.value;
9525
9876
  }
9526
-
9877
+
9527
9878
  `);
9528
9879
  } else if (!isOptionalIn) {
9529
9880
  doc.write(`
9530
- const ${id}_present = ${k} in input;
9531
- if (${id}.issues.length) {
9532
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
9533
- ...iss,
9534
- path: iss.path ? [${k}, ...iss.path] : [${k}]
9535
- })));
9881
+ const ${id}_present = ${isPresent};
9882
+ if (${id}.issues.length) {${prefixStr(id, k)}
9536
9883
  }
9537
9884
  if (!${id}_present && !${id}.issues.length) {
9538
9885
  payload.issues.push({
@@ -9544,38 +9891,29 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
9544
9891
  }
9545
9892
 
9546
9893
  if (${id}_present) {
9547
- if (${id}.value === undefined) {
9548
- newResult[${k}] = undefined;
9549
- } else {
9550
- newResult[${k}] = ${id}.value;
9551
- }
9894
+ newResult[${k}] = ${id}.value;
9552
9895
  }
9553
9896
 
9554
9897
  `);
9555
9898
  } else {
9556
9899
  doc.write(`
9557
- if (${id}.issues.length) {
9558
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
9559
- ...iss,
9560
- path: iss.path ? [${k}, ...iss.path] : [${k}]
9561
- })));
9900
+ if (${id}.issues.length) {${prefixStr(id, k)}
9562
9901
  }
9563
9902
 
9564
9903
  if (${id}.value === undefined) {
9565
- if (${k} in input) {
9904
+ if (${isPresent}) {
9566
9905
  newResult[${k}] = undefined;
9567
9906
  }
9568
9907
  } else {
9569
9908
  newResult[${k}] = ${id}.value;
9570
9909
  }
9571
-
9910
+
9572
9911
  `);
9573
9912
  }
9574
9913
  }
9575
9914
  doc.write(`payload.value = newResult;`);
9576
9915
  doc.write(`return payload;`);
9577
- const fn = doc.compile();
9578
- return (payload, ctx) => fn(shape, payload, ctx);
9916
+ return doc.compile();
9579
9917
  };
9580
9918
  let fastpass;
9581
9919
  const isObject2 = isObject;
@@ -9629,17 +9967,17 @@ function handleUnionResults(results, final, inst, ctx) {
9629
9967
  }
9630
9968
  var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
9631
9969
  $ZodType.init(inst, def);
9632
- defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0);
9633
- defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
9634
- defineLazy(inst._zod, "values", () => {
9635
- if (def.options.every((o) => o._zod.values)) {
9636
- return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
9970
+ defineLazyInternal(inst, "optin", (zod) => zod.def.options.some((o) => o._zod.optin === "defaulted") ? "defaulted" : zod.def.options.some((o) => o._zod.optin !== void 0) ? "optional" : void 0);
9971
+ defineLazyInternal(inst, "optout", (zod) => zod.def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
9972
+ defineLazyInternal(inst, "values", (zod) => {
9973
+ if (zod.def.options.every((o) => o._zod.values)) {
9974
+ return new Set(zod.def.options.flatMap((option) => Array.from(option._zod.values)));
9637
9975
  }
9638
9976
  return void 0;
9639
9977
  });
9640
- defineLazy(inst._zod, "pattern", () => {
9641
- if (def.options.every((o) => o._zod.pattern)) {
9642
- const patterns = def.options.map((o) => o._zod.pattern);
9978
+ defineLazyInternal(inst, "pattern", (zod) => {
9979
+ if (zod.def.options.every((o) => o._zod.pattern)) {
9980
+ const patterns = zod.def.options.map((o) => o._zod.pattern);
9643
9981
  return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
9644
9982
  }
9645
9983
  return void 0;
@@ -9676,15 +10014,16 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
9676
10014
  def.inclusive = false;
9677
10015
  $ZodUnion.init(inst, def);
9678
10016
  const _super = inst._zod.parse;
9679
- defineLazy(inst._zod, "propValues", () => {
10017
+ defineLazyInternal(inst, "propValues", (zod) => {
9680
10018
  const propValues = {};
9681
- for (const option of def.options) {
10019
+ for (const option of zod.def.options) {
9682
10020
  const pv = option._zod.propValues;
9683
10021
  if (!pv || Object.keys(pv).length === 0)
9684
- throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
10022
+ throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
9685
10023
  for (const [k, v] of Object.entries(pv)) {
9686
- if (!propValues[k])
9687
- propValues[k] = /* @__PURE__ */ new Set();
10024
+ if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
10025
+ assignProp(propValues, k, /* @__PURE__ */ new Set());
10026
+ }
9688
10027
  for (const val of v) {
9689
10028
  propValues[k].add(val);
9690
10029
  }
@@ -9692,6 +10031,12 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
9692
10031
  }
9693
10032
  return propValues;
9694
10033
  });
10034
+ def.options.forEach((option, i) => {
10035
+ const propShape = propShapes.get(option._zod.def);
10036
+ if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {
10037
+ throw new Error(`Invalid discriminated union option at index "${i}"`);
10038
+ }
10039
+ });
9695
10040
  const disc = cached(() => {
9696
10041
  const opts = def.options;
9697
10042
  const map = /* @__PURE__ */ new Map();
@@ -9765,7 +10110,11 @@ function mergeValues(a, b) {
9765
10110
  const bKeys = Object.keys(b);
9766
10111
  const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
9767
10112
  const newObj = { ...a, ...b };
10113
+ if (Object.prototype.hasOwnProperty.call(newObj, "__proto__"))
10114
+ delete newObj.__proto__;
9768
10115
  for (const key of sharedKeys) {
10116
+ if (key === "__proto__")
10117
+ continue;
9769
10118
  const sharedValue = mergeValues(a[key], b[key]);
9770
10119
  if (!sharedValue.valid) {
9771
10120
  return {
@@ -9801,37 +10150,49 @@ function mergeValues(a, b) {
9801
10150
  function handleIntersectionResults(result, left, right) {
9802
10151
  const unrecKeys = /* @__PURE__ */ new Map();
9803
10152
  let unrecIssue;
9804
- for (const iss of left.issues) {
9805
- if (iss.code === "unrecognized_keys") {
10153
+ const keyIssues = /* @__PURE__ */ new Map();
10154
+ const collect = (iss, side) => {
10155
+ let keys;
10156
+ if (iss.code === "unrecognized_keys" && !iss.path?.length) {
9806
10157
  unrecIssue ?? (unrecIssue = iss);
9807
- for (const k of iss.keys) {
9808
- if (!unrecKeys.has(k))
9809
- unrecKeys.set(k, {});
9810
- unrecKeys.get(k).l = true;
9811
- }
10158
+ keys = iss.keys;
10159
+ } else if (iss.code === "invalid_key" && iss.origin === "record" && iss.path?.length === 1) {
10160
+ const k = String(iss.path[0]);
10161
+ if (!keyIssues.has(k))
10162
+ keyIssues.set(k, iss);
10163
+ keys = [k];
9812
10164
  } else {
9813
- result.issues.push(iss);
10165
+ return false;
9814
10166
  }
10167
+ for (const k of keys) {
10168
+ if (!unrecKeys.has(k))
10169
+ unrecKeys.set(k, {});
10170
+ unrecKeys.get(k)[side] = true;
10171
+ }
10172
+ return true;
10173
+ };
10174
+ for (const iss of left.issues) {
10175
+ if (!collect(iss, "l"))
10176
+ result.issues.push(iss);
9815
10177
  }
9816
10178
  for (const iss of right.issues) {
9817
- if (iss.code === "unrecognized_keys") {
9818
- for (const k of iss.keys) {
9819
- if (!unrecKeys.has(k))
9820
- unrecKeys.set(k, {});
9821
- unrecKeys.get(k).r = true;
9822
- }
9823
- } else {
10179
+ if (!collect(iss, "r"))
9824
10180
  result.issues.push(iss);
9825
- }
9826
10181
  }
9827
10182
  const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
9828
- if (bothKeys.length && unrecIssue) {
9829
- result.issues.push({ ...unrecIssue, keys: bothKeys });
10183
+ if (bothKeys.length) {
10184
+ const aggregated = unrecIssue ? bothKeys.filter((k) => unrecIssue.keys.includes(k)) : [];
10185
+ if (aggregated.length)
10186
+ result.issues.push({ ...unrecIssue, keys: aggregated });
10187
+ for (const k of bothKeys) {
10188
+ if (!aggregated.includes(k) && keyIssues.has(k))
10189
+ result.issues.push(keyIssues.get(k));
10190
+ }
9830
10191
  }
9831
- if (aborted(result))
9832
- return result;
9833
10192
  const merged = mergeValues(left.value, right.value);
9834
10193
  if (!merged.valid) {
10194
+ if (aborted(result))
10195
+ return result;
9835
10196
  throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
9836
10197
  }
9837
10198
  result.value = merged.data;
@@ -9839,6 +10200,8 @@ function handleIntersectionResults(result, left, right) {
9839
10200
  }
9840
10201
  var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
9841
10202
  $ZodType.init(inst, def);
10203
+ const memo2 = globalConfig.memoizer;
10204
+ memo2?.attach(inst);
9842
10205
  inst._zod.parse = (payload, ctx) => {
9843
10206
  const input = payload.value;
9844
10207
  if (!isPlainObject(input)) {
@@ -9852,12 +10215,14 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
9852
10215
  }
9853
10216
  const proms = [];
9854
10217
  const values = def.keyType._zod.values;
9855
- if (values) {
9856
- payload.value = {};
10218
+ if (values && !def.partial) {
10219
+ payload.value = memo2 ? memo2.alloc(inst, payload, {}, ctx) : {};
9857
10220
  const recordKeys = /* @__PURE__ */ new Set();
9858
10221
  for (const key of values) {
9859
10222
  if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
9860
10223
  recordKeys.add(typeof key === "number" ? key.toString() : key);
10224
+ if (key === "__proto__")
10225
+ continue;
9861
10226
  const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
9862
10227
  if (keyResult instanceof Promise) {
9863
10228
  throw new Error("Async schemas not supported in object keys currently");
@@ -9874,6 +10239,8 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
9874
10239
  continue;
9875
10240
  }
9876
10241
  const outKey = keyResult.value;
10242
+ if (outKey === "__proto__")
10243
+ continue;
9877
10244
  const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
9878
10245
  if (result instanceof Promise) {
9879
10246
  proms.push(result.then((result2) => {
@@ -9893,8 +10260,14 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
9893
10260
  let unrecognized;
9894
10261
  for (const key in input) {
9895
10262
  if (!recordKeys.has(key)) {
9896
- unrecognized = unrecognized ?? [];
9897
- unrecognized.push(key);
10263
+ if (def.mode === "loose") {
10264
+ if (key === "__proto__")
10265
+ continue;
10266
+ payload.value[key] = input[key];
10267
+ } else {
10268
+ unrecognized = unrecognized ?? [];
10269
+ unrecognized.push(key);
10270
+ }
9898
10271
  }
9899
10272
  }
9900
10273
  if (unrecognized && unrecognized.length > 0) {
@@ -9902,11 +10275,13 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
9902
10275
  code: "unrecognized_keys",
9903
10276
  input,
9904
10277
  inst,
9905
- keys: unrecognized
10278
+ keys: unrecognized,
10279
+ continue: true
9906
10280
  });
9907
10281
  }
9908
10282
  } else {
9909
- payload.value = {};
10283
+ payload.value = memo2 ? memo2.alloc(inst, payload, {}, ctx) : {};
10284
+ let unrecognized;
9910
10285
  for (const key of Reflect.ownKeys(input)) {
9911
10286
  if (key === "__proto__")
9912
10287
  continue;
@@ -9929,6 +10304,9 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
9929
10304
  if (keyResult.issues.length) {
9930
10305
  if (def.mode === "loose") {
9931
10306
  payload.value[key] = input[key];
10307
+ } else if (values) {
10308
+ unrecognized = unrecognized ?? [];
10309
+ unrecognized.push(key);
9932
10310
  } else {
9933
10311
  payload.issues.push({
9934
10312
  code: "invalid_key",
@@ -9941,21 +10319,33 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
9941
10319
  }
9942
10320
  continue;
9943
10321
  }
10322
+ const outKey = keyResult.value;
10323
+ if (outKey === "__proto__")
10324
+ continue;
9944
10325
  const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
9945
10326
  if (result instanceof Promise) {
9946
10327
  proms.push(result.then((result2) => {
9947
10328
  if (result2.issues.length) {
9948
10329
  payload.issues.push(...prefixIssues(key, result2.issues));
9949
10330
  }
9950
- payload.value[keyResult.value] = result2.value;
10331
+ payload.value[outKey] = result2.value;
9951
10332
  }));
9952
10333
  } else {
9953
10334
  if (result.issues.length) {
9954
10335
  payload.issues.push(...prefixIssues(key, result.issues));
9955
10336
  }
9956
- payload.value[keyResult.value] = result.value;
10337
+ payload.value[outKey] = result.value;
9957
10338
  }
9958
10339
  }
10340
+ if (unrecognized && unrecognized.length > 0) {
10341
+ payload.issues.push({
10342
+ code: "unrecognized_keys",
10343
+ input,
10344
+ inst,
10345
+ keys: unrecognized,
10346
+ continue: true
10347
+ });
10348
+ }
9959
10349
  }
9960
10350
  if (proms.length) {
9961
10351
  return Promise.all(proms).then(() => payload);
@@ -9968,7 +10358,8 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
9968
10358
  const values = getEnumValues(def.entries);
9969
10359
  const valuesSet = new Set(values);
9970
10360
  inst._zod.values = valuesSet;
9971
- inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
10361
+ const patternValues = values.filter((k) => propertyKeyTypes.has(typeof k));
10362
+ inst._zod.pattern = new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
9972
10363
  inst._zod.parse = (payload, _ctx) => {
9973
10364
  const input = payload.value;
9974
10365
  if (valuesSet.has(input)) {
@@ -9985,12 +10376,9 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
9985
10376
  });
9986
10377
  var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
9987
10378
  $ZodType.init(inst, def);
9988
- if (def.values.length === 0) {
9989
- throw new Error("Cannot create literal schema with no valid values");
9990
- }
9991
10379
  const values = new Set(def.values);
9992
10380
  inst._zod.values = values;
9993
- inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
10381
+ inst._zod.pattern = new RegExp(def.values.length ? `^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
9994
10382
  inst._zod.parse = (payload, _ctx) => {
9995
10383
  const input = payload.value;
9996
10384
  if (values.has(input)) {
@@ -10008,6 +10396,7 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
10008
10396
  var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
10009
10397
  $ZodType.init(inst, def);
10010
10398
  inst._zod.optin = "optional";
10399
+ globalConfig.memoizer?.guard(inst);
10011
10400
  inst._zod.parse = (payload, ctx) => {
10012
10401
  if (ctx.direction === "backward") {
10013
10402
  throw new $ZodEncodeError(inst.constructor.name);
@@ -10017,7 +10406,6 @@ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) =>
10017
10406
  const output = _out instanceof Promise ? _out : Promise.resolve(_out);
10018
10407
  return output.then((output2) => {
10019
10408
  payload.value = output2;
10020
- payload.fallback = true;
10021
10409
  return payload;
10022
10410
  });
10023
10411
  }
@@ -10025,59 +10413,55 @@ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) =>
10025
10413
  throw new $ZodAsyncError();
10026
10414
  }
10027
10415
  payload.value = _out;
10028
- payload.fallback = true;
10029
10416
  return payload;
10030
10417
  };
10031
10418
  });
10032
- function handleOptionalResult(result, input) {
10033
- if (input === void 0 && (result.issues.length || result.fallback)) {
10034
- return { issues: [], value: void 0 };
10035
- }
10036
- return result;
10419
+ function handleOptionalResult(payload, result) {
10420
+ payload.value = result.issues.length ? void 0 : result.value;
10421
+ return payload;
10037
10422
  }
10038
10423
  var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
10039
10424
  $ZodType.init(inst, def);
10040
- inst._zod.optin = "optional";
10425
+ defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
10041
10426
  inst._zod.optout = "optional";
10042
- defineLazy(inst._zod, "values", () => {
10043
- return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, void 0]) : void 0;
10427
+ defineLazyInternal(inst, "values", (zod) => {
10428
+ const values = zod.def.innerType._zod.values;
10429
+ return values ? /* @__PURE__ */ new Set([...values, void 0]) : void 0;
10044
10430
  });
10045
- defineLazy(inst._zod, "pattern", () => {
10046
- const pattern = def.innerType._zod.pattern;
10431
+ defineLazyInternal(inst, "pattern", (zod) => {
10432
+ const pattern = zod.def.innerType._zod.pattern;
10047
10433
  return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
10048
10434
  });
10049
10435
  inst._zod.parse = (payload, ctx) => {
10050
- if (def.innerType._zod.optin === "optional") {
10051
- const input = payload.value;
10052
- const result = def.innerType._zod.run(payload, ctx);
10053
- if (result instanceof Promise)
10054
- return result.then((r) => handleOptionalResult(r, input));
10055
- return handleOptionalResult(result, input);
10056
- }
10057
10436
  if (payload.value === void 0) {
10058
- return payload;
10437
+ if (def.innerType._zod.optin !== "defaulted")
10438
+ return payload;
10439
+ const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);
10440
+ if (result instanceof Promise)
10441
+ return result.then((result2) => handleOptionalResult(payload, result2));
10442
+ return handleOptionalResult(payload, result);
10059
10443
  }
10060
10444
  return def.innerType._zod.run(payload, ctx);
10061
10445
  };
10062
10446
  });
10063
10447
  var $ZodExactOptional = /* @__PURE__ */ $constructor("$ZodExactOptional", (inst, def) => {
10064
10448
  $ZodOptional.init(inst, def);
10065
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
10066
- defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern);
10449
+ defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
10450
+ defineLazyInternal(inst, "pattern", (zod) => zod.def.innerType._zod.pattern);
10067
10451
  inst._zod.parse = (payload, ctx) => {
10068
10452
  return def.innerType._zod.run(payload, ctx);
10069
10453
  };
10070
10454
  });
10071
10455
  var $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
10072
10456
  $ZodType.init(inst, def);
10073
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
10074
- defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
10075
- defineLazy(inst._zod, "pattern", () => {
10076
- const pattern = def.innerType._zod.pattern;
10457
+ defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin);
10458
+ defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
10459
+ defineLazyInternal(inst, "pattern", (zod) => {
10460
+ const pattern = zod.def.innerType._zod.pattern;
10077
10461
  return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
10078
10462
  });
10079
- defineLazy(inst._zod, "values", () => {
10080
- return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, null]) : void 0;
10463
+ defineLazyInternal(inst, "values", (zod) => {
10464
+ return zod.def.innerType._zod.values ? /* @__PURE__ */ new Set([...zod.def.innerType._zod.values, null]) : void 0;
10081
10465
  });
10082
10466
  inst._zod.parse = (payload, ctx) => {
10083
10467
  if (payload.value === null)
@@ -10087,8 +10471,8 @@ var $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
10087
10471
  });
10088
10472
  var $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
10089
10473
  $ZodType.init(inst, def);
10090
- inst._zod.optin = "optional";
10091
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
10474
+ inst._zod.optin = "defaulted";
10475
+ defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
10092
10476
  inst._zod.parse = (payload, ctx) => {
10093
10477
  if (ctx.direction === "backward") {
10094
10478
  return def.innerType._zod.run(payload, ctx);
@@ -10112,8 +10496,8 @@ function handleDefaultResult(payload, def) {
10112
10496
  }
10113
10497
  var $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => {
10114
10498
  $ZodType.init(inst, def);
10115
- inst._zod.optin = "optional";
10116
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
10499
+ inst._zod.optin = "defaulted";
10500
+ defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
10117
10501
  inst._zod.parse = (payload, ctx) => {
10118
10502
  if (ctx.direction === "backward") {
10119
10503
  return def.innerType._zod.run(payload, ctx);
@@ -10126,8 +10510,8 @@ var $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => {
10126
10510
  });
10127
10511
  var $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => {
10128
10512
  $ZodType.init(inst, def);
10129
- defineLazy(inst._zod, "values", () => {
10130
- const v = def.innerType._zod.values;
10513
+ defineLazyInternal(inst, "values", (zod) => {
10514
+ const v = zod.def.innerType._zod.values;
10131
10515
  return v ? new Set([...v].filter((x) => x !== void 0)) : void 0;
10132
10516
  });
10133
10517
  inst._zod.parse = (payload, ctx) => {
@@ -10149,54 +10533,45 @@ function handleNonOptionalResult(payload, inst) {
10149
10533
  }
10150
10534
  return payload;
10151
10535
  }
10536
+ function handleCatchResult(payload, result, def, ctx) {
10537
+ if (!result.issues.length) {
10538
+ payload.value = result.value;
10539
+ if (result.memo)
10540
+ payload.memo = true;
10541
+ return payload;
10542
+ }
10543
+ payload.value = def.catchValue({
10544
+ ...result,
10545
+ value: payload.value,
10546
+ error: {
10547
+ issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config()))
10548
+ },
10549
+ input: payload.value
10550
+ });
10551
+ return payload;
10552
+ }
10152
10553
  var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
10153
10554
  $ZodType.init(inst, def);
10154
- inst._zod.optin = "optional";
10155
- defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
10156
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
10555
+ defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
10556
+ defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
10557
+ defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
10157
10558
  inst._zod.parse = (payload, ctx) => {
10158
10559
  if (ctx.direction === "backward") {
10159
10560
  return def.innerType._zod.run(payload, ctx);
10160
10561
  }
10161
- const result = def.innerType._zod.run(payload, ctx);
10562
+ const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);
10162
10563
  if (result instanceof Promise) {
10163
- return result.then((result2) => {
10164
- payload.value = result2.value;
10165
- if (result2.issues.length) {
10166
- payload.value = def.catchValue({
10167
- ...payload,
10168
- error: {
10169
- issues: result2.issues.map((iss) => finalizeIssue(iss, ctx, config()))
10170
- },
10171
- input: payload.value
10172
- });
10173
- payload.issues = [];
10174
- payload.fallback = true;
10175
- }
10176
- return payload;
10177
- });
10178
- }
10179
- payload.value = result.value;
10180
- if (result.issues.length) {
10181
- payload.value = def.catchValue({
10182
- ...payload,
10183
- error: {
10184
- issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config()))
10185
- },
10186
- input: payload.value
10187
- });
10188
- payload.issues = [];
10189
- payload.fallback = true;
10564
+ return result.then((result2) => handleCatchResult(payload, result2, def, ctx));
10190
10565
  }
10191
- return payload;
10566
+ return handleCatchResult(payload, result, def, ctx);
10192
10567
  };
10193
10568
  });
10194
10569
  var $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
10195
10570
  $ZodType.init(inst, def);
10196
- defineLazy(inst._zod, "values", () => def.in._zod.values);
10197
- defineLazy(inst._zod, "optin", () => def.in._zod.optin);
10198
- defineLazy(inst._zod, "optout", () => def.out._zod.optout);
10199
- defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
10571
+ defineLazyInternal(inst, "values", (zod) => zod.def.in._zod.values);
10572
+ defineLazyInternal(inst, "optin", (zod) => zod.def.in._zod.optin);
10573
+ defineLazyInternal(inst, "optout", (zod) => zod.def.out._zod.optout);
10574
+ defineLazyInternal(inst, "propValues", (zod) => zod.def.in._zod.propValues);
10200
10575
  inst._zod.parse = (payload, ctx) => {
10201
10576
  if (ctx.direction === "backward") {
10202
10577
  const right = def.out._zod.run(payload, ctx);
@@ -10213,21 +10588,21 @@ var $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
10213
10588
  };
10214
10589
  });
10215
10590
  function handlePipeResult(left, next, ctx) {
10216
- if (left.issues.length) {
10591
+ if (left.issues.some((iss) => iss.code !== "unrecognized_keys")) {
10217
10592
  left.aborted = true;
10218
10593
  return left;
10219
10594
  }
10220
- return next._zod.run({ value: left.value, issues: left.issues, fallback: left.fallback }, ctx);
10595
+ return next._zod.run({ value: left.value, issues: left.issues }, ctx);
10221
10596
  }
10222
10597
  var $ZodPreprocess = /* @__PURE__ */ $constructor("$ZodPreprocess", (inst, def) => {
10223
10598
  $ZodPipe.init(inst, def);
10224
10599
  });
10225
10600
  var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
10226
10601
  $ZodType.init(inst, def);
10227
- defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
10228
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
10229
- defineLazy(inst._zod, "optin", () => def.innerType?._zod?.optin);
10230
- defineLazy(inst._zod, "optout", () => def.innerType?._zod?.optout);
10602
+ defineLazyInternal(inst, "propValues", (zod) => zod.def.innerType._zod.propValues);
10603
+ defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
10604
+ defineLazyInternal(inst, "optin", (zod) => zod.def.innerType?._zod?.optin);
10605
+ defineLazyInternal(inst, "optout", (zod) => zod.def.innerType?._zod?.optout);
10231
10606
  inst._zod.parse = (payload, ctx) => {
10232
10607
  if (ctx.direction === "backward") {
10233
10608
  return def.innerType._zod.run(payload, ctx);
@@ -10240,7 +10615,8 @@ var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
10240
10615
  };
10241
10616
  });
10242
10617
  function handleReadonlyResult(payload) {
10243
- payload.value = Object.freeze(payload.value);
10618
+ if (!payload.memo)
10619
+ payload.value = Object.freeze(payload.value);
10244
10620
  return payload;
10245
10621
  }
10246
10622
  var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
@@ -10277,7 +10653,244 @@ function handleRefineResult(result, payload, input, inst) {
10277
10653
  }
10278
10654
  }
10279
10655
 
10280
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/en.js
10656
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/memoizer.js
10657
+ var $ZodCyclicError = class extends Error {
10658
+ constructor() {
10659
+ super(`Cannot parse a reference cycle that closes through a transform`);
10660
+ this.name = "ZodCyclicError";
10661
+ }
10662
+ };
10663
+ var STATE = "~memo";
10664
+ var NO_ISSUES = [];
10665
+ function cloneIssues(issues) {
10666
+ return issues.map((iss) => iss.path ? { ...iss, path: iss.path.slice() } : { ...iss });
10667
+ }
10668
+ var recursive = /* @__PURE__ */ new WeakMap();
10669
+ function isRecursive(inst, stack) {
10670
+ const cached2 = recursive.get(inst);
10671
+ if (cached2 !== void 0)
10672
+ return cached2;
10673
+ if (stack.has(inst))
10674
+ return true;
10675
+ stack.add(inst);
10676
+ let result = false;
10677
+ const check = (child) => {
10678
+ if (!result && child?._zod && isRecursive(child, stack))
10679
+ result = true;
10680
+ };
10681
+ const def = inst._zod.def;
10682
+ const kind = def.type;
10683
+ switch (kind) {
10684
+ case "object": {
10685
+ for (const key of Reflect.ownKeys(def.shape))
10686
+ check(def.shape[key]);
10687
+ check(def.catchall);
10688
+ break;
10689
+ }
10690
+ case "array":
10691
+ check(def.element);
10692
+ break;
10693
+ case "tuple":
10694
+ for (const el of def.items)
10695
+ check(el);
10696
+ check(def.rest);
10697
+ break;
10698
+ case "record":
10699
+ case "map":
10700
+ check(def.keyType);
10701
+ check(def.valueType);
10702
+ break;
10703
+ case "set":
10704
+ check(def.valueType);
10705
+ break;
10706
+ case "union":
10707
+ for (const el of def.options)
10708
+ check(el);
10709
+ break;
10710
+ case "intersection":
10711
+ check(def.left);
10712
+ check(def.right);
10713
+ break;
10714
+ case "optional":
10715
+ case "nullable":
10716
+ case "default":
10717
+ case "prefault":
10718
+ case "catch":
10719
+ case "readonly":
10720
+ case "nonoptional":
10721
+ case "promise":
10722
+ case "success":
10723
+ check(def.innerType);
10724
+ break;
10725
+ case "pipe":
10726
+ check(def.in);
10727
+ check(def.out);
10728
+ break;
10729
+ case "function":
10730
+ check(def.input);
10731
+ check(def.output);
10732
+ break;
10733
+ // reading `_zod.innerType` resolves the getter once and caches it
10734
+ case "lazy":
10735
+ check(inst._zod.innerType);
10736
+ break;
10737
+ // a leaf by choice: `parts` are regex fragments, not data positions
10738
+ case "template_literal":
10739
+ // leaves
10740
+ case "string":
10741
+ case "number":
10742
+ case "int":
10743
+ case "boolean":
10744
+ case "bigint":
10745
+ case "symbol":
10746
+ case "undefined":
10747
+ case "null":
10748
+ case "void":
10749
+ case "never":
10750
+ case "any":
10751
+ case "unknown":
10752
+ case "date":
10753
+ case "nan":
10754
+ case "enum":
10755
+ case "literal":
10756
+ case "file":
10757
+ case "transform":
10758
+ case "custom":
10759
+ break;
10760
+ default: {
10761
+ for (const key in def) {
10762
+ const desc = Object.getOwnPropertyDescriptor(def, key);
10763
+ if (!desc || desc.get)
10764
+ continue;
10765
+ const value = desc.value;
10766
+ if (!value || typeof value !== "object")
10767
+ continue;
10768
+ if (value._zod)
10769
+ check(value);
10770
+ else if (Array.isArray(value))
10771
+ for (const el of value)
10772
+ check(el);
10773
+ }
10774
+ }
10775
+ }
10776
+ stack.delete(inst);
10777
+ recursive.set(inst, result);
10778
+ return result;
10779
+ }
10780
+ function bucketFor(state, inst) {
10781
+ let bucket = state.buckets.get(inst);
10782
+ if (!bucket) {
10783
+ bucket = /* @__PURE__ */ new Map();
10784
+ state.buckets.set(inst, bucket);
10785
+ }
10786
+ return bucket;
10787
+ }
10788
+ var handoff;
10789
+ var open = [];
10790
+ var memo = {
10791
+ alloc(_inst, payload, empty) {
10792
+ const bucket = handoff;
10793
+ if (!bucket)
10794
+ return empty;
10795
+ handoff = void 0;
10796
+ const entry = { value: empty, issues: null };
10797
+ bucket.set(payload.value, entry);
10798
+ open.push(entry);
10799
+ return empty;
10800
+ },
10801
+ guard(inst) {
10802
+ var _a3;
10803
+ (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
10804
+ inst._zod.deferred.push(() => {
10805
+ const base = inst._zod.parse;
10806
+ const wrapped = (payload, ctx) => {
10807
+ if (ctx.direction !== "backward" && isBackEdge(ctx, payload.value))
10808
+ throw new $ZodCyclicError();
10809
+ return base(payload, ctx);
10810
+ };
10811
+ inst._zod.parse = wrapped;
10812
+ if (inst._zod.run === base)
10813
+ inst._zod.run = wrapped;
10814
+ });
10815
+ },
10816
+ attach(inst) {
10817
+ var _a3;
10818
+ let isRecursiveInst;
10819
+ let lastCtx;
10820
+ let lastBucket;
10821
+ (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
10822
+ inst._zod.deferred.push(() => {
10823
+ const base = inst._zod.parse;
10824
+ const wrapped = (payload, ctx) => {
10825
+ if (isRecursiveInst === void 0) {
10826
+ isRecursiveInst = isRecursive(inst, /* @__PURE__ */ new Set());
10827
+ if (!isRecursiveInst) {
10828
+ inst._zod.parse = base;
10829
+ if (inst._zod.run === wrapped)
10830
+ inst._zod.run = base;
10831
+ return base(payload, ctx);
10832
+ }
10833
+ }
10834
+ const input = payload.value;
10835
+ if (input === null || typeof input !== "object")
10836
+ return base(payload, ctx);
10837
+ let state = ctx[STATE];
10838
+ if (!state) {
10839
+ state = { buckets: /* @__PURE__ */ new Map(), backEdges: void 0 };
10840
+ ctx[STATE] = state;
10841
+ }
10842
+ let bucket;
10843
+ if (lastCtx === ctx) {
10844
+ bucket = lastBucket;
10845
+ } else {
10846
+ bucket = bucketFor(state, inst);
10847
+ lastCtx = ctx;
10848
+ lastBucket = bucket;
10849
+ }
10850
+ const hit = bucket.get(input);
10851
+ if (hit) {
10852
+ payload.value = hit.value;
10853
+ if (hit.issues) {
10854
+ if (hit.issues.length)
10855
+ payload.issues.push(...cloneIssues(hit.issues));
10856
+ } else {
10857
+ payload.memo = true;
10858
+ state.backEdges ?? (state.backEdges = /* @__PURE__ */ new Set());
10859
+ state.backEdges.add(hit.value);
10860
+ }
10861
+ return payload;
10862
+ }
10863
+ handoff = bucket;
10864
+ const depth = open.length;
10865
+ const result = base(payload, ctx);
10866
+ handoff = void 0;
10867
+ const entry = open.length > depth ? open.pop() : void 0;
10868
+ if (result instanceof Promise) {
10869
+ return result.then((r) => {
10870
+ if (entry)
10871
+ entry.issues = r.issues.length ? cloneIssues(r.issues) : NO_ISSUES;
10872
+ return r;
10873
+ });
10874
+ }
10875
+ if (entry)
10876
+ entry.issues = result.issues.length ? cloneIssues(result.issues) : NO_ISSUES;
10877
+ return result;
10878
+ };
10879
+ inst._zod.parse = wrapped;
10880
+ if (inst._zod.run === base)
10881
+ inst._zod.run = wrapped;
10882
+ });
10883
+ }
10884
+ };
10885
+ function memoizer() {
10886
+ return memo;
10887
+ }
10888
+ function isBackEdge(ctx, value) {
10889
+ const backEdges = ctx[STATE]?.backEdges;
10890
+ return backEdges !== void 0 && value !== null && typeof value === "object" && backEdges.has(value);
10891
+ }
10892
+
10893
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/en.js
10281
10894
  var error = () => {
10282
10895
  const Sizable = {
10283
10896
  string: { unit: "characters", verb: "to have" },
@@ -10317,6 +10930,7 @@ var error = () => {
10317
10930
  base64url: "base64url-encoded string",
10318
10931
  json_string: "JSON string",
10319
10932
  e164: "E.164 number",
10933
+ credit_card: "credit card number",
10320
10934
  jwt: "JWT",
10321
10935
  template_literal: "input"
10322
10936
  };
@@ -10325,12 +10939,18 @@ var error = () => {
10325
10939
  nan: "NaN"
10326
10940
  // All other type names omitted - they fall back to raw values via ?? operator
10327
10941
  };
10942
+ function getTypeName(type, input) {
10943
+ if (type === "number" && typeof input === "number" && !Number.isFinite(input)) {
10944
+ return String(input);
10945
+ }
10946
+ return TypeDictionary[type] ?? type;
10947
+ }
10328
10948
  return (issue2) => {
10329
10949
  switch (issue2.code) {
10330
10950
  case "invalid_type": {
10331
- const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
10951
+ const expected = getTypeName(issue2.expected);
10332
10952
  const receivedType = parsedType(issue2.input);
10333
- const received = TypeDictionary[receivedType] ?? receivedType;
10953
+ const received = getTypeName(receivedType, issue2.input);
10334
10954
  return `Invalid input: expected ${expected}, received ${received}`;
10335
10955
  }
10336
10956
  case "invalid_value":
@@ -10338,14 +10958,14 @@ var error = () => {
10338
10958
  return `Invalid input: expected ${stringifyPrimitive(issue2.values[0])}`;
10339
10959
  return `Invalid option: expected one of ${joinValues(issue2.values, "|")}`;
10340
10960
  case "too_big": {
10341
- const adj = issue2.inclusive ? "<=" : "<";
10961
+ const adj = issue2.exact ? "exactly " : issue2.inclusive ? "<=" : "<";
10342
10962
  const sizing = getSizing(issue2.origin);
10343
10963
  if (sizing)
10344
10964
  return `Too big: expected ${issue2.origin ?? "value"} to have ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elements"}`;
10345
10965
  return `Too big: expected ${issue2.origin ?? "value"} to be ${adj}${issue2.maximum.toString()}`;
10346
10966
  }
10347
10967
  case "too_small": {
10348
- const adj = issue2.inclusive ? ">=" : ">";
10968
+ const adj = issue2.exact ? "exactly " : issue2.inclusive ? ">=" : ">";
10349
10969
  const sizing = getSizing(issue2.origin);
10350
10970
  if (sizing) {
10351
10971
  return `Too small: expected ${issue2.origin} to have ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
@@ -10376,6 +10996,9 @@ var error = () => {
10376
10996
  const opts = issue2.options.map((o) => `'${o}'`).join(" | ");
10377
10997
  return `Invalid discriminator value. Expected ${opts}`;
10378
10998
  }
10999
+ if (issue2.inclusive === false) {
11000
+ return "Invalid input: more than one option matched";
11001
+ }
10379
11002
  return "Invalid input";
10380
11003
  case "invalid_element":
10381
11004
  return `Invalid value in ${issue2.origin}`;
@@ -10390,7 +11013,7 @@ function en_default() {
10390
11013
  };
10391
11014
  }
10392
11015
 
10393
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js
11016
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/registries.js
10394
11017
  var _a2;
10395
11018
  var $ZodRegistry = class {
10396
11019
  constructor() {
@@ -10438,7 +11061,7 @@ function registry() {
10438
11061
  (_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
10439
11062
  var globalRegistry = globalThis.__zod_globalRegistry;
10440
11063
 
10441
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js
11064
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/api.js
10442
11065
  // @__NO_SIDE_EFFECTS__
10443
11066
  function _string(Class2, params) {
10444
11067
  return new Class2({
@@ -10993,7 +11616,8 @@ function _superRefine(fn, params) {
10993
11616
  if (_issue.fatal)
10994
11617
  _issue.continue = false;
10995
11618
  _issue.code ?? (_issue.code = "custom");
10996
- _issue.input ?? (_issue.input = payload.value);
11619
+ if (!("input" in _issue))
11620
+ _issue.input = payload.value;
10997
11621
  _issue.inst ?? (_issue.inst = ch);
10998
11622
  _issue.continue ?? (_issue.continue = !ch._zod.def.abort);
10999
11623
  payload.issues.push(issue(_issue));
@@ -11013,7 +11637,17 @@ function _check(fn, params) {
11013
11637
  return ch;
11014
11638
  }
11015
11639
 
11016
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js
11640
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/to-json-schema.js
11641
+ function assignProps(target, ...sources) {
11642
+ for (const source of sources) {
11643
+ for (const key of Reflect.ownKeys(source)) {
11644
+ if (Object.prototype.propertyIsEnumerable.call(source, key)) {
11645
+ assignProp(target, key, source[key]);
11646
+ }
11647
+ }
11648
+ }
11649
+ return target;
11650
+ }
11017
11651
  function initializeContext(params) {
11018
11652
  let target = params?.target ?? "draft-2020-12";
11019
11653
  if (target === "draft-4")
@@ -11030,11 +11664,24 @@ function initializeContext(params) {
11030
11664
  io: params?.io ?? "output",
11031
11665
  counter: 0,
11032
11666
  seen: /* @__PURE__ */ new Map(),
11667
+ sharedDefsExtractedFor: void 0,
11668
+ sharedEmitDoneFor: void 0,
11033
11669
  cycles: params?.cycles ?? "ref",
11034
11670
  reused: params?.reused ?? "inline",
11671
+ intersections: [],
11672
+ deferred: [],
11035
11673
  external: params?.external ?? void 0
11036
11674
  };
11037
11675
  }
11676
+ function handleUnrepresentable(schema, ctx, json, params, message) {
11677
+ const result = typeof ctx.unrepresentable === "function" ? ctx.unrepresentable({ zodSchema: schema, path: params.path, message }) : ctx.unrepresentable;
11678
+ if (result === "any")
11679
+ return false;
11680
+ if (result === void 0 || result === "throw")
11681
+ throw new Error(message);
11682
+ Object.assign(json, result);
11683
+ return true;
11684
+ }
11038
11685
  function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
11039
11686
  var _a3;
11040
11687
  const def = schema._zod.def;
@@ -11049,6 +11696,8 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
11049
11696
  }
11050
11697
  const result = { schema: {}, count: 1, cycle: void 0, path: _params.path };
11051
11698
  ctx.seen.set(schema, result);
11699
+ ctx.sharedDefsExtractedFor = void 0;
11700
+ ctx.sharedEmitDoneFor = void 0;
11052
11701
  const overrideSchema = schema._zod.toJSONSchema?.();
11053
11702
  if (overrideSchema) {
11054
11703
  result.schema = overrideSchema;
@@ -11078,7 +11727,7 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
11078
11727
  }
11079
11728
  const meta2 = ctx.metadataRegistry.get(schema);
11080
11729
  if (meta2)
11081
- Object.assign(result.schema, meta2);
11730
+ assignProps(result.schema, meta2);
11082
11731
  if (ctx.io === "input" && isTransforming(schema)) {
11083
11732
  delete result.schema.examples;
11084
11733
  delete result.schema.default;
@@ -11089,10 +11738,15 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
11089
11738
  const _result = ctx.seen.get(schema);
11090
11739
  return _result.schema;
11091
11740
  }
11741
+ function encodeJSONPointerSegment(segment) {
11742
+ return segment.replace(/~/g, "~0").replace(/\//g, "~1");
11743
+ }
11092
11744
  function extractDefs(ctx, schema) {
11093
11745
  const root = ctx.seen.get(schema);
11094
11746
  if (!root)
11095
11747
  throw new Error("Unprocessed schema. This is a bug in Zod.");
11748
+ if (ctx.external && ctx.sharedDefsExtractedFor === ctx.external)
11749
+ return;
11096
11750
  const idToSchema = /* @__PURE__ */ new Map();
11097
11751
  for (const entry of ctx.seen.entries()) {
11098
11752
  const id = ctx.metadataRegistry.get(entry[0])?.id;
@@ -11114,15 +11768,15 @@ function extractDefs(ctx, schema) {
11114
11768
  }
11115
11769
  const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
11116
11770
  entry[1].defId = id;
11117
- return { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}` };
11118
- }
11119
- if (entry[1] === root) {
11120
- return { ref: "#" };
11771
+ return { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${encodeJSONPointerSegment(id)}` };
11121
11772
  }
11122
11773
  const uriPrefix = `#`;
11123
11774
  const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
11775
+ if (entry[1] === root && !entry[1].schema.id) {
11776
+ return { ref: uriPrefix };
11777
+ }
11124
11778
  const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
11125
- return { defId, ref: defUriPrefix + defId };
11779
+ return { defId, ref: defUriPrefix + encodeJSONPointerSegment(defId) };
11126
11780
  };
11127
11781
  const extractToDef = (entry) => {
11128
11782
  if (entry[1].schema.$ref) {
@@ -11178,6 +11832,116 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11178
11832
  }
11179
11833
  }
11180
11834
  }
11835
+ if (ctx.external)
11836
+ ctx.sharedDefsExtractedFor = ctx.external;
11837
+ }
11838
+ function compactTypeUnion(schema) {
11839
+ const options = schema.anyOf;
11840
+ if (!Array.isArray(options) || options.length === 0 || schema.type !== void 0)
11841
+ return;
11842
+ const types = [];
11843
+ for (const option of options) {
11844
+ if (!option || typeof option !== "object")
11845
+ return;
11846
+ compactTypeUnion(option);
11847
+ const keys = Object.keys(option);
11848
+ if (keys.length !== 1 || keys[0] !== "type")
11849
+ return;
11850
+ const type = option.type;
11851
+ for (const member of Array.isArray(type) ? type : [type]) {
11852
+ if (typeof member !== "string")
11853
+ return;
11854
+ if (!types.includes(member))
11855
+ types.push(member);
11856
+ }
11857
+ }
11858
+ delete schema.anyOf;
11859
+ schema.type = types.length === 1 ? types[0] : types;
11860
+ }
11861
+ var FOLDABLE_KEYS = /* @__PURE__ */ new Set(["type", "properties", "required", "additionalProperties"]);
11862
+ var UNION_KEYS = ["oneOf", "anyOf"];
11863
+ function undeclaredConstraint(member) {
11864
+ const extra = member.additionalProperties;
11865
+ if (extra === void 0 || extra === false || typeof extra !== "object" || extra === null)
11866
+ return null;
11867
+ return Object.keys(extra).length ? extra : null;
11868
+ }
11869
+ function foldObjects(members2) {
11870
+ const objects = [];
11871
+ for (const member of members2) {
11872
+ if (typeof member !== "object" || member.type !== "object")
11873
+ return null;
11874
+ for (const key in member) {
11875
+ if (!FOLDABLE_KEYS.has(key))
11876
+ return null;
11877
+ }
11878
+ objects.push(member);
11879
+ }
11880
+ const properties = {};
11881
+ const required2 = /* @__PURE__ */ new Set();
11882
+ for (const object3 of objects) {
11883
+ for (const key in object3.properties) {
11884
+ if (Object.prototype.hasOwnProperty.call(properties, key))
11885
+ continue;
11886
+ const parts = [];
11887
+ for (const other of objects) {
11888
+ const part = other.properties?.[key] ?? undeclaredConstraint(other);
11889
+ if (part === null || part === void 0)
11890
+ continue;
11891
+ if (!parts.some((seen) => JSON.stringify(seen) === JSON.stringify(part)))
11892
+ parts.push(part);
11893
+ }
11894
+ const merged = parts.length === 1 ? parts[0] : foldObjects(parts) ?? { allOf: parts };
11895
+ assignProp(properties, key, merged);
11896
+ }
11897
+ for (const key of object3.required ?? [])
11898
+ required2.add(key);
11899
+ }
11900
+ const folded = { type: "object", properties };
11901
+ if (required2.size)
11902
+ folded.required = [...required2];
11903
+ if (objects.every((object3) => object3.additionalProperties === false)) {
11904
+ folded.additionalProperties = false;
11905
+ } else {
11906
+ const constraints = [];
11907
+ for (const object3 of objects) {
11908
+ const constraint = undeclaredConstraint(object3);
11909
+ if (constraint && !constraints.some((seen) => JSON.stringify(seen) === JSON.stringify(constraint)))
11910
+ constraints.push(constraint);
11911
+ }
11912
+ if (constraints.length === 1)
11913
+ folded.additionalProperties = constraints[0];
11914
+ else if (constraints.length > 1)
11915
+ folded.additionalProperties = { allOf: constraints };
11916
+ }
11917
+ return folded;
11918
+ }
11919
+ function foldIntersection(json) {
11920
+ const allOf = json.allOf;
11921
+ if (!Array.isArray(allOf) || allOf.length < 2)
11922
+ return;
11923
+ for (const key of FOLDABLE_KEYS)
11924
+ if (key in json)
11925
+ return;
11926
+ const unions = allOf.filter((m) => UNION_KEYS.some((k) => Array.isArray(m[k])));
11927
+ let folded = null;
11928
+ if (!unions.length) {
11929
+ folded = foldObjects(allOf);
11930
+ } else {
11931
+ const union2 = unions[0];
11932
+ const keyword = UNION_KEYS.find((k) => Array.isArray(union2[k]));
11933
+ if (Object.keys(union2).length !== 1)
11934
+ return;
11935
+ const rest = allOf.filter((m) => m !== union2);
11936
+ const branches = union2[keyword].map((branch) => foldObjects([...rest, branch]));
11937
+ if (branches.some((b) => !b))
11938
+ return;
11939
+ folded = { [keyword]: branches };
11940
+ }
11941
+ if (!folded)
11942
+ return;
11943
+ delete json.allOf;
11944
+ assignProps(json, folded);
11181
11945
  }
11182
11946
  function finalize(ctx, schema) {
11183
11947
  const root = ctx.seen.get(schema);
@@ -11199,9 +11963,9 @@ function finalize(ctx, schema) {
11199
11963
  schema2.allOf = schema2.allOf ?? [];
11200
11964
  schema2.allOf.push(refSchema);
11201
11965
  } else {
11202
- Object.assign(schema2, refSchema);
11966
+ assignProps(schema2, refSchema);
11203
11967
  }
11204
- Object.assign(schema2, _cached);
11968
+ assignProps(schema2, _cached);
11205
11969
  const isParentRef = zodSchema._zod.parent === ref;
11206
11970
  if (isParentRef) {
11207
11971
  for (const key in schema2) {
@@ -11245,8 +12009,36 @@ function finalize(ctx, schema) {
11245
12009
  path: seen.path ?? []
11246
12010
  });
11247
12011
  };
11248
- for (const entry of [...ctx.seen.entries()].reverse()) {
11249
- flattenRef(entry[0]);
12012
+ if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {
12013
+ for (const entry of [...ctx.seen.entries()].reverse()) {
12014
+ flattenRef(entry[0]);
12015
+ }
12016
+ if (ctx.target !== "openapi-3.0") {
12017
+ for (const entry of ctx.seen.entries()) {
12018
+ compactTypeUnion(entry[1].def ?? entry[1].schema);
12019
+ }
12020
+ }
12021
+ for (const rewrite of ctx.deferred)
12022
+ rewrite();
12023
+ if (ctx.intersections.length) {
12024
+ const carriers = /* @__PURE__ */ new Map();
12025
+ for (const seen of ctx.seen.values()) {
12026
+ for (const json of [seen.schema, seen.def]) {
12027
+ const allOf = json?.allOf;
12028
+ if (!Array.isArray(allOf))
12029
+ continue;
12030
+ const existing = carriers.get(allOf);
12031
+ if (existing)
12032
+ existing.push(json);
12033
+ else
12034
+ carriers.set(allOf, [json]);
12035
+ }
12036
+ }
12037
+ for (const allOf of ctx.intersections) {
12038
+ for (const json of carriers.get(allOf) ?? [])
12039
+ foldIntersection(json);
12040
+ }
12041
+ }
11250
12042
  }
11251
12043
  const result = {};
11252
12044
  if (ctx.target === "draft-2020-12") {
@@ -11262,19 +12054,23 @@ function finalize(ctx, schema) {
11262
12054
  throw new Error("Schema is missing an `id` property");
11263
12055
  result.$id = ctx.external.uri(id);
11264
12056
  }
11265
- Object.assign(result, root.def ?? root.schema);
12057
+ assignProps(result, root.defId ? root.schema : root.def ?? root.schema);
11266
12058
  const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
11267
12059
  if (rootMetaId !== void 0 && result.id === rootMetaId)
11268
12060
  delete result.id;
11269
12061
  const defs = ctx.external?.defs ?? {};
11270
- for (const entry of ctx.seen.entries()) {
11271
- const seen = entry[1];
11272
- if (seen.def && seen.defId) {
11273
- if (seen.def.id === seen.defId)
11274
- delete seen.def.id;
11275
- defs[seen.defId] = seen.def;
12062
+ if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {
12063
+ for (const entry of ctx.seen.entries()) {
12064
+ const seen = entry[1];
12065
+ if (seen.def && seen.defId) {
12066
+ if (seen.def.id === seen.defId)
12067
+ delete seen.def.id;
12068
+ assignProp(defs, seen.defId, seen.def);
12069
+ }
11276
12070
  }
11277
12071
  }
12072
+ if (ctx.external)
12073
+ ctx.sharedEmitDoneFor = ctx.external;
11278
12074
  if (ctx.external) ; else {
11279
12075
  if (Object.keys(defs).length > 0) {
11280
12076
  if (ctx.target === "draft-2020-12") {
@@ -11316,7 +12112,7 @@ function isTransforming(_schema, _ctx) {
11316
12112
  return isTransforming(def.valueType, ctx);
11317
12113
  if (def.type === "lazy")
11318
12114
  return isTransforming(def.getter(), ctx);
11319
- if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") {
12115
+ if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault" || def.type === "catch") {
11320
12116
  return isTransforming(def.innerType, ctx);
11321
12117
  }
11322
12118
  if (def.type === "intersection") {
@@ -11369,7 +12165,7 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
11369
12165
  return finalize(ctx, schema);
11370
12166
  };
11371
12167
 
11372
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.js
12168
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/json-schema-processors.js
11373
12169
  var formatMap = {
11374
12170
  guid: "uuid",
11375
12171
  url: "uri",
@@ -11381,7 +12177,7 @@ var formatMap = {
11381
12177
  var stringProcessor = (schema, ctx, _json, _params) => {
11382
12178
  const json = _json;
11383
12179
  json.type = "string";
11384
- const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
12180
+ const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema._zod.bag;
11385
12181
  if (typeof minimum === "number")
11386
12182
  json.minLength = minimum;
11387
12183
  if (typeof maximum === "number")
@@ -11390,19 +12186,19 @@ var stringProcessor = (schema, ctx, _json, _params) => {
11390
12186
  json.format = formatMap[format] ?? format;
11391
12187
  if (json.format === "")
11392
12188
  delete json.format;
11393
- if (format === "time") {
12189
+ if (format === "time" || laxFormat) {
11394
12190
  delete json.format;
11395
12191
  }
11396
12192
  }
11397
12193
  if (contentEncoding)
11398
12194
  json.contentEncoding = contentEncoding;
11399
12195
  if (patterns && patterns.size > 0) {
11400
- const regexes = [...patterns];
11401
- if (regexes.length === 1)
11402
- json.pattern = regexes[0].source;
11403
- else if (regexes.length > 1) {
12196
+ const patternList = [...patterns];
12197
+ if (patternList.length === 1)
12198
+ json.pattern = patternList[0].source;
12199
+ else if (patternList.length > 1) {
11404
12200
  json.allOf = [
11405
- ...regexes.map((regex) => ({
12201
+ ...patternList.map((regex) => ({
11406
12202
  ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
11407
12203
  pattern: regex.source
11408
12204
  }))
@@ -11410,7 +12206,7 @@ var stringProcessor = (schema, ctx, _json, _params) => {
11410
12206
  }
11411
12207
  }
11412
12208
  };
11413
- var numberProcessor = (schema, ctx, _json, _params) => {
12209
+ var numberProcessor = (schema, ctx, _json, params) => {
11414
12210
  const json = _json;
11415
12211
  const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
11416
12212
  if (typeof format === "string" && format.includes("int"))
@@ -11440,16 +12236,18 @@ var numberProcessor = (schema, ctx, _json, _params) => {
11440
12236
  } else if (typeof maximum === "number") {
11441
12237
  json.maximum = maximum;
11442
12238
  }
11443
- if (typeof multipleOf === "number")
11444
- json.multipleOf = multipleOf;
12239
+ if (typeof multipleOf === "number") {
12240
+ if (Number.isFinite(multipleOf) && multipleOf !== 0)
12241
+ json.multipleOf = Math.abs(multipleOf);
12242
+ else
12243
+ handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${multipleOf} cannot be represented in JSON Schema`);
12244
+ }
11445
12245
  };
11446
12246
  var booleanProcessor = (_schema, _ctx, json, _params) => {
11447
12247
  json.type = "boolean";
11448
12248
  };
11449
- var bigintProcessor = (_schema, ctx, _json, _params) => {
11450
- if (ctx.unrepresentable === "throw") {
11451
- throw new Error("BigInt cannot be represented in JSON Schema");
11452
- }
12249
+ var bigintProcessor = (schema, ctx, json, params) => {
12250
+ handleUnrepresentable(schema, ctx, json, params, "BigInt cannot be represented in JSON Schema");
11453
12251
  };
11454
12252
  var nullProcessor = (_schema, ctx, json, _params) => {
11455
12253
  if (ctx.target === "openapi-3.0") {
@@ -11467,34 +12265,37 @@ var anyProcessor = (_schema, _ctx, _json, _params) => {
11467
12265
  };
11468
12266
  var unknownProcessor = (_schema, _ctx, _json, _params) => {
11469
12267
  };
11470
- var dateProcessor = (_schema, ctx, _json, _params) => {
11471
- if (ctx.unrepresentable === "throw") {
11472
- throw new Error("Date cannot be represented in JSON Schema");
11473
- }
12268
+ var dateProcessor = (schema, ctx, json, params) => {
12269
+ handleUnrepresentable(schema, ctx, json, params, "Date cannot be represented in JSON Schema");
11474
12270
  };
11475
12271
  var enumProcessor = (schema, _ctx, json, _params) => {
11476
12272
  const def = schema._zod.def;
11477
12273
  const values = getEnumValues(def.entries);
12274
+ if (values.length === 0) {
12275
+ json.not = {};
12276
+ return;
12277
+ }
11478
12278
  if (values.every((v) => typeof v === "number"))
11479
12279
  json.type = "number";
11480
12280
  if (values.every((v) => typeof v === "string"))
11481
12281
  json.type = "string";
11482
12282
  json.enum = values;
11483
12283
  };
11484
- var literalProcessor = (schema, ctx, json, _params) => {
12284
+ var literalProcessor = (schema, ctx, json, params) => {
11485
12285
  const def = schema._zod.def;
12286
+ if (def.values.length === 0) {
12287
+ json.not = {};
12288
+ return;
12289
+ }
11486
12290
  const vals = [];
11487
12291
  for (const val of def.values) {
11488
12292
  if (val === void 0) {
11489
- if (ctx.unrepresentable === "throw") {
11490
- throw new Error("Literal `undefined` cannot be represented in JSON Schema");
11491
- }
12293
+ if (handleUnrepresentable(schema, ctx, json, params, "Literal `undefined` cannot be represented in JSON Schema"))
12294
+ return;
11492
12295
  } else if (typeof val === "bigint") {
11493
- if (ctx.unrepresentable === "throw") {
11494
- throw new Error("BigInt literals cannot be represented in JSON Schema");
11495
- } else {
11496
- vals.push(Number(val));
11497
- }
12296
+ if (handleUnrepresentable(schema, ctx, json, params, "BigInt literals cannot be represented in JSON Schema"))
12297
+ return;
12298
+ vals.push(Number(val));
11498
12299
  } else {
11499
12300
  vals.push(val);
11500
12301
  }
@@ -11519,15 +12320,11 @@ var literalProcessor = (schema, ctx, json, _params) => {
11519
12320
  json.enum = vals;
11520
12321
  }
11521
12322
  };
11522
- var customProcessor = (_schema, ctx, _json, _params) => {
11523
- if (ctx.unrepresentable === "throw") {
11524
- throw new Error("Custom types cannot be represented in JSON Schema");
11525
- }
12323
+ var customProcessor = (schema, ctx, json, params) => {
12324
+ handleUnrepresentable(schema, ctx, json, params, "Custom types cannot be represented in JSON Schema");
11526
12325
  };
11527
- var transformProcessor = (_schema, ctx, _json, _params) => {
11528
- if (ctx.unrepresentable === "throw") {
11529
- throw new Error("Transforms cannot be represented in JSON Schema");
11530
- }
12326
+ var transformProcessor = (schema, ctx, json, params) => {
12327
+ handleUnrepresentable(schema, ctx, json, params, "Transforms cannot be represented in JSON Schema");
11531
12328
  };
11532
12329
  var arrayProcessor = (schema, ctx, _json, params) => {
11533
12330
  const json = _json;
@@ -11543,25 +12340,39 @@ var arrayProcessor = (schema, ctx, _json, params) => {
11543
12340
  path: [...params.path, "items"]
11544
12341
  });
11545
12342
  };
12343
+ function inputOptin(schema) {
12344
+ const def = schema._zod.def;
12345
+ if (def.type === "pipe" && def.in._zod.traits.has("$ZodTransform")) {
12346
+ return inputOptin(def.out);
12347
+ }
12348
+ if (def.type === "catch") {
12349
+ return inputOptin(def.innerType);
12350
+ }
12351
+ return schema._zod.optin;
12352
+ }
11546
12353
  var objectProcessor = (schema, ctx, _json, params) => {
11547
12354
  const json = _json;
11548
12355
  const def = schema._zod.def;
12356
+ const shape = def.shape;
12357
+ const symbolKeys = Object.getOwnPropertySymbols(shape);
12358
+ if (symbolKeys.length && handleUnrepresentable(schema, ctx, json, params, "Symbol keys cannot be represented in JSON Schema")) {
12359
+ return;
12360
+ }
11549
12361
  json.type = "object";
11550
12362
  json.properties = {};
11551
- const shape = def.shape;
11552
12363
  for (const key in shape) {
11553
- json.properties[key] = process2(shape[key], ctx, {
12364
+ assignProp(json.properties, key, process2(shape[key], ctx, {
11554
12365
  ...params,
11555
12366
  path: [...params.path, "properties", key]
11556
- });
12367
+ }));
11557
12368
  }
11558
12369
  const allKeys = new Set(Object.keys(shape));
11559
12370
  const requiredKeys = new Set([...allKeys].filter((key) => {
11560
- const v = def.shape[key]._zod;
12371
+ const field = def.shape[key];
11561
12372
  if (ctx.io === "input") {
11562
- return v.optin === void 0;
12373
+ return inputOptin(field) === void 0;
11563
12374
  } else {
11564
- return v.optout === void 0;
12375
+ return field._zod.optout === void 0;
11565
12376
  }
11566
12377
  }));
11567
12378
  if (requiredKeys.size > 0) {
@@ -11608,7 +12419,71 @@ var intersectionProcessor = (schema, ctx, json, params) => {
11608
12419
  ...isSimpleIntersection(b) ? b.allOf : [b]
11609
12420
  ];
11610
12421
  json.allOf = allOf;
12422
+ ctx.intersections.push(allOf);
11611
12423
  };
12424
+ function stringifyKeyNames(bySchema, json, visited) {
12425
+ if (json.$ref) {
12426
+ if (visited.has(json))
12427
+ return json;
12428
+ visited.add(json);
12429
+ const def = bySchema.get(json)?.def;
12430
+ if (!def)
12431
+ return json;
12432
+ const inlined = stringifyKeyNames(bySchema, def, visited);
12433
+ return inlined === def ? json : inlined;
12434
+ }
12435
+ for (const keyword of ["anyOf", "oneOf"]) {
12436
+ const branches = json[keyword];
12437
+ if (!Array.isArray(branches))
12438
+ continue;
12439
+ const mapped = branches.map((branch) => stringifyKeyNames(bySchema, branch, visited));
12440
+ if (mapped.some((branch, i) => branch !== branches[i]))
12441
+ json = { ...json, [keyword]: mapped };
12442
+ }
12443
+ const types = Array.isArray(json.type) ? json.type : [json.type];
12444
+ const numericType = !types.includes("string") && types.some((t) => t === "number" || t === "integer");
12445
+ const values = json.enum ?? (json.const !== void 0 ? [json.const] : void 0);
12446
+ if (!numericType && !values?.some((v) => typeof v === "number"))
12447
+ return json;
12448
+ const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id, ...rest } = json;
12449
+ if (rest.enum)
12450
+ rest.enum = rest.enum.map((v) => typeof v === "number" ? String(v) : v);
12451
+ else if (typeof rest.const === "number")
12452
+ rest.const = String(rest.const);
12453
+ if (!numericType)
12454
+ return rest;
12455
+ rest.type = "string";
12456
+ if (!values)
12457
+ rest.pattern = (types.includes("number") ? number : integer).source;
12458
+ return rest;
12459
+ }
12460
+ var pendingRecords = /* @__PURE__ */ new WeakMap();
12461
+ function rewriteKeyNames(ctx) {
12462
+ const bySchema = /* @__PURE__ */ new Map();
12463
+ for (const entry of ctx.seen.values()) {
12464
+ if (entry.def && !bySchema.has(entry.schema))
12465
+ bySchema.set(entry.schema, entry);
12466
+ }
12467
+ const rewrites = /* @__PURE__ */ new Map();
12468
+ for (const record2 of pendingRecords.get(ctx) ?? []) {
12469
+ const seen = ctx.seen.get(record2);
12470
+ const names = (seen?.def ?? seen?.schema)?.propertyNames;
12471
+ if (!names || names === true || rewrites.has(names))
12472
+ continue;
12473
+ const rewritten = stringifyKeyNames(bySchema, names, /* @__PURE__ */ new Set());
12474
+ if (rewritten !== names)
12475
+ rewrites.set(names, rewritten);
12476
+ }
12477
+ if (!rewrites.size)
12478
+ return;
12479
+ for (const entry of ctx.seen.values()) {
12480
+ for (const carrier of [entry.schema, entry.def]) {
12481
+ const rewritten = carrier && rewrites.get(carrier.propertyNames);
12482
+ if (rewritten)
12483
+ carrier.propertyNames = rewritten;
12484
+ }
12485
+ }
12486
+ }
11612
12487
  var recordProcessor = (schema, ctx, _json, params) => {
11613
12488
  const json = _json;
11614
12489
  const def = schema._zod.def;
@@ -11623,7 +12498,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
11623
12498
  });
11624
12499
  json.patternProperties = {};
11625
12500
  for (const pattern of patterns) {
11626
- json.patternProperties[pattern.source] = valueSchema;
12501
+ assignProp(json.patternProperties, pattern.source, valueSchema);
11627
12502
  }
11628
12503
  } else {
11629
12504
  if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
@@ -11631,6 +12506,13 @@ var recordProcessor = (schema, ctx, _json, params) => {
11631
12506
  ...params,
11632
12507
  path: [...params.path, "propertyNames"]
11633
12508
  });
12509
+ let pending = pendingRecords.get(ctx);
12510
+ if (!pending) {
12511
+ pending = [];
12512
+ pendingRecords.set(ctx, pending);
12513
+ ctx.deferred.push(() => rewriteKeyNames(ctx));
12514
+ }
12515
+ pending.push(schema);
11634
12516
  }
11635
12517
  json.additionalProperties = process2(def.valueType, ctx, {
11636
12518
  ...params,
@@ -11638,10 +12520,11 @@ var recordProcessor = (schema, ctx, _json, params) => {
11638
12520
  });
11639
12521
  }
11640
12522
  const keyValues = keyType._zod.values;
11641
- if (keyValues) {
12523
+ const omittableOnInput = ctx.io === "input" && inputOptin(def.valueType) !== void 0;
12524
+ if (keyValues && !def.partial && !omittableOnInput) {
11642
12525
  const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
11643
12526
  if (validKeyValues.length > 0) {
11644
- json.required = validKeyValues;
12527
+ json.required = validKeyValues.map(String);
11645
12528
  }
11646
12529
  }
11647
12530
  };
@@ -11662,20 +12545,39 @@ var nonoptionalProcessor = (schema, ctx, _json, params) => {
11662
12545
  const seen = ctx.seen.get(schema);
11663
12546
  seen.ref = def.innerType;
11664
12547
  };
12548
+ var UNREPRESENTABLE_DEFAULT = /* @__PURE__ */ Symbol();
12549
+ function serializeDefaultValue(value, schema, ctx, json, params) {
12550
+ let unrepresentable = false;
12551
+ const serialized = JSON.stringify(value, (_, val) => {
12552
+ if (typeof val !== "bigint")
12553
+ return val;
12554
+ unrepresentable = true;
12555
+ return null;
12556
+ });
12557
+ if (!unrepresentable)
12558
+ return JSON.parse(serialized);
12559
+ handleUnrepresentable(schema, ctx, json, params, "BigInt defaults cannot be represented in JSON Schema");
12560
+ return UNREPRESENTABLE_DEFAULT;
12561
+ }
11665
12562
  var defaultProcessor = (schema, ctx, json, params) => {
11666
12563
  const def = schema._zod.def;
11667
12564
  process2(def.innerType, ctx, params);
11668
12565
  const seen = ctx.seen.get(schema);
11669
12566
  seen.ref = def.innerType;
11670
- json.default = JSON.parse(JSON.stringify(def.defaultValue));
12567
+ const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
12568
+ if (value !== UNREPRESENTABLE_DEFAULT)
12569
+ json.default = value;
11671
12570
  };
11672
12571
  var prefaultProcessor = (schema, ctx, json, params) => {
11673
12572
  const def = schema._zod.def;
11674
12573
  process2(def.innerType, ctx, params);
11675
12574
  const seen = ctx.seen.get(schema);
11676
12575
  seen.ref = def.innerType;
11677
- if (ctx.io === "input")
11678
- json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
12576
+ if (ctx.io !== "input")
12577
+ return;
12578
+ const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
12579
+ if (value !== UNREPRESENTABLE_DEFAULT)
12580
+ json._prefault = value;
11679
12581
  };
11680
12582
  var catchProcessor = (schema, ctx, json, params) => {
11681
12583
  const def = schema._zod.def;
@@ -11686,7 +12588,8 @@ var catchProcessor = (schema, ctx, json, params) => {
11686
12588
  try {
11687
12589
  catchValue = def.catchValue(void 0);
11688
12590
  } catch {
11689
- throw new Error("Dynamic catch values are not supported in JSON Schema");
12591
+ handleUnrepresentable(schema, ctx, json, params, "Dynamic catch values are not supported in JSON Schema");
12592
+ return;
11690
12593
  }
11691
12594
  json.default = catchValue;
11692
12595
  };
@@ -11712,7 +12615,7 @@ var optionalProcessor = (schema, ctx, _json, params) => {
11712
12615
  seen.ref = def.innerType;
11713
12616
  };
11714
12617
 
11715
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
12618
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
11716
12619
  function isZ4Schema(s) {
11717
12620
  const schema = s;
11718
12621
  return !!schema._zod;
@@ -11775,87 +12678,52 @@ function getLiteralValue(schema) {
11775
12678
  return void 0;
11776
12679
  }
11777
12680
 
11778
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.js
11779
- var iso_exports = {};
11780
- __export(iso_exports, {
11781
- ZodISODate: () => ZodISODate,
11782
- ZodISODateTime: () => ZodISODateTime,
11783
- ZodISODuration: () => ZodISODuration,
11784
- ZodISOTime: () => ZodISOTime,
11785
- date: () => date2,
11786
- datetime: () => datetime2,
11787
- duration: () => duration2,
11788
- time: () => time2
11789
- });
11790
- var ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
11791
- $ZodISODateTime.init(inst, def);
11792
- ZodStringFormat.init(inst, def);
11793
- });
11794
- function datetime2(params) {
11795
- return _isoDateTime(ZodISODateTime, params);
11796
- }
11797
- var ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
11798
- $ZodISODate.init(inst, def);
11799
- ZodStringFormat.init(inst, def);
11800
- });
11801
- function date2(params) {
11802
- return _isoDate(ZodISODate, params);
11803
- }
11804
- var ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
11805
- $ZodISOTime.init(inst, def);
11806
- ZodStringFormat.init(inst, def);
11807
- });
11808
- function time2(params) {
11809
- return _isoTime(ZodISOTime, params);
11810
- }
11811
- var ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
11812
- $ZodISODuration.init(inst, def);
11813
- ZodStringFormat.init(inst, def);
11814
- });
11815
- function duration2(params) {
11816
- return _isoDuration(ZodISODuration, params);
12681
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/errors.js
12682
+ var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
12683
+ function _lazyMethod(proto, key, make) {
12684
+ Object.defineProperty(proto, key, {
12685
+ configurable: true,
12686
+ enumerable: false,
12687
+ get() {
12688
+ const value = make(this);
12689
+ Object.defineProperty(this, key, { value, configurable: true, writable: true });
12690
+ return value;
12691
+ },
12692
+ set(value) {
12693
+ Object.defineProperty(this, key, { value, configurable: true, writable: true });
12694
+ }
12695
+ });
11817
12696
  }
11818
-
11819
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/errors.js
11820
12697
  var initializer2 = (inst, issues) => {
11821
12698
  $ZodError.init(inst, issues);
11822
12699
  inst.name = "ZodError";
11823
- Object.defineProperties(inst, {
11824
- format: {
11825
- value: (mapper) => formatError(inst, mapper)
11826
- // enumerable: false,
11827
- },
11828
- flatten: {
11829
- value: (mapper) => flattenError(inst, mapper)
11830
- // enumerable: false,
11831
- },
11832
- addIssue: {
11833
- value: (issue2) => {
11834
- inst.issues.push(issue2);
11835
- inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
11836
- }
11837
- // enumerable: false,
11838
- },
11839
- addIssues: {
11840
- value: (issues2) => {
11841
- inst.issues.push(...issues2);
11842
- inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
11843
- }
11844
- // enumerable: false,
11845
- },
11846
- isEmpty: {
11847
- get() {
11848
- return inst.issues.length === 0;
11849
- }
11850
- // enumerable: false,
12700
+ const proto = Object.getPrototypeOf(inst);
12701
+ if (_installedErrorProtos.has(proto))
12702
+ return;
12703
+ _installedErrorProtos.add(proto);
12704
+ _lazyMethod(proto, "format", (self) => (mapper) => formatError(self, mapper));
12705
+ _lazyMethod(proto, "flatten", (self) => (mapper) => flattenError(self, mapper));
12706
+ _lazyMethod(proto, "addIssue", (self) => (issue2) => {
12707
+ self.issues.push(issue2);
12708
+ self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
12709
+ });
12710
+ _lazyMethod(proto, "addIssues", (self) => (issues2) => {
12711
+ self.issues.push(...issues2);
12712
+ self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
12713
+ });
12714
+ Object.defineProperty(proto, "isEmpty", {
12715
+ configurable: true,
12716
+ enumerable: false,
12717
+ get() {
12718
+ return this.issues.length === 0;
11851
12719
  }
11852
12720
  });
11853
12721
  };
11854
- var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, {
12722
+ var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, void 0, {
11855
12723
  Parent: Error
11856
12724
  });
11857
12725
 
11858
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.js
12726
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/parse.js
11859
12727
  var parse2 = /* @__PURE__ */ _parse(ZodRealError);
11860
12728
  var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
11861
12729
  var safeParse3 = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -11869,259 +12737,321 @@ var safeDecode2 = /* @__PURE__ */ _safeDecode(ZodRealError);
11869
12737
  var safeEncodeAsync2 = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
11870
12738
  var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
11871
12739
 
11872
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.js
11873
- var _installedGroups = /* @__PURE__ */ new WeakMap();
11874
- function _installLazyMethods(inst, group, methods) {
11875
- const proto = Object.getPrototypeOf(inst);
11876
- let installed = _installedGroups.get(proto);
11877
- if (!installed) {
11878
- installed = /* @__PURE__ */ new Set();
11879
- _installedGroups.set(proto, installed);
11880
- }
11881
- if (installed.has(group))
11882
- return;
11883
- installed.add(group);
11884
- for (const key in methods) {
11885
- const fn = methods[key];
11886
- Object.defineProperty(proto, key, {
11887
- configurable: true,
11888
- enumerable: false,
11889
- get() {
11890
- const bound = fn.bind(this);
11891
- Object.defineProperty(this, key, {
11892
- configurable: true,
11893
- writable: true,
11894
- enumerable: true,
11895
- value: bound
11896
- });
11897
- return bound;
11898
- },
11899
- set(v) {
11900
- Object.defineProperty(this, key, {
11901
- configurable: true,
11902
- writable: true,
11903
- enumerable: true,
11904
- value: v
11905
- });
11906
- }
11907
- });
11908
- }
12740
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/schemas.js
12741
+ function _ensureDefaultLocale() {
12742
+ if (!globalConfig.localeError)
12743
+ config(en_default());
12744
+ }
12745
+ function _ensureDefaultMemoizer() {
12746
+ if (!globalConfig.memoizer)
12747
+ config({ memoizer: memoizer() });
11909
12748
  }
11910
12749
  var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
12750
+ _ensureDefaultLocale();
11911
12751
  $ZodType.init(inst, def);
11912
- Object.assign(inst["~standard"], {
11913
- jsonSchema: {
11914
- input: createStandardJSONSchemaMethod(inst, "input"),
11915
- output: createStandardJSONSchemaMethod(inst, "output")
11916
- }
11917
- });
11918
- inst.toJSONSchema = createToJSONSchemaMethod(inst, {});
11919
12752
  inst.def = def;
11920
12753
  inst.type = def.type;
11921
- Object.defineProperty(inst, "_def", { value: def });
11922
- inst.parse = (data, params) => parse2(inst, data, params, { callee: inst.parse });
11923
- inst.safeParse = (data, params) => safeParse3(inst, data, params);
11924
- inst.parseAsync = async (data, params) => parseAsync2(inst, data, params, { callee: inst.parseAsync });
11925
- inst.safeParseAsync = async (data, params) => safeParseAsync2(inst, data, params);
11926
- inst.spa = inst.safeParseAsync;
11927
- inst.encode = (data, params) => encode2(inst, data, params);
11928
- inst.decode = (data, params) => decode2(inst, data, params);
11929
- inst.encodeAsync = async (data, params) => encodeAsync2(inst, data, params);
11930
- inst.decodeAsync = async (data, params) => decodeAsync2(inst, data, params);
11931
- inst.safeEncode = (data, params) => safeEncode2(inst, data, params);
11932
- inst.safeDecode = (data, params) => safeDecode2(inst, data, params);
11933
- inst.safeEncodeAsync = async (data, params) => safeEncodeAsync2(inst, data, params);
11934
- inst.safeDecodeAsync = async (data, params) => safeDecodeAsync2(inst, data, params);
11935
- _installLazyMethods(inst, "ZodType", {
11936
- check(...chks) {
11937
- const def2 = this.def;
11938
- return this.clone(util_exports.mergeDefs(def2, {
11939
- checks: [
11940
- ...def2.checks ?? [],
11941
- ...chks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
11942
- ]
11943
- }), { parent: true });
11944
- },
11945
- with(...chks) {
11946
- return this.check(...chks);
11947
- },
11948
- clone(def2, params) {
11949
- return clone(this, def2, params);
11950
- },
11951
- brand() {
11952
- return this;
11953
- },
11954
- register(reg, meta2) {
11955
- reg.add(this, meta2);
11956
- return this;
11957
- },
11958
- refine(check, params) {
11959
- return this.check(refine(check, params));
11960
- },
11961
- superRefine(refinement, params) {
11962
- return this.check(superRefine(refinement, params));
11963
- },
11964
- overwrite(fn) {
11965
- return this.check(_overwrite(fn));
11966
- },
11967
- optional() {
11968
- return optional(this);
11969
- },
11970
- exactOptional() {
11971
- return exactOptional(this);
11972
- },
11973
- nullable() {
11974
- return nullable(this);
11975
- },
11976
- nullish() {
11977
- return optional(nullable(this));
11978
- },
11979
- nonoptional(params) {
11980
- return nonoptional(this, params);
11981
- },
11982
- array() {
11983
- return array(this);
11984
- },
11985
- or(arg) {
11986
- return union([this, arg]);
11987
- },
11988
- and(arg) {
11989
- return intersection(this, arg);
11990
- },
11991
- transform(tx) {
11992
- return pipe(this, transform(tx));
11993
- },
11994
- default(d) {
11995
- return _default(this, d);
11996
- },
11997
- prefault(d) {
11998
- return prefault(this, d);
11999
- },
12000
- catch(params) {
12001
- return _catch(this, params);
12002
- },
12003
- pipe(target) {
12004
- return pipe(this, target);
12005
- },
12006
- readonly() {
12007
- return readonly(this);
12008
- },
12009
- describe(description) {
12010
- const cl = this.clone();
12011
- globalRegistry.add(cl, { description });
12012
- return cl;
12013
- },
12014
- meta(...args) {
12015
- if (args.length === 0)
12016
- return globalRegistry.get(this);
12017
- const cl = this.clone();
12018
- globalRegistry.add(cl, args[0]);
12019
- return cl;
12020
- },
12021
- isOptional() {
12022
- return this.safeParse(void 0).success;
12023
- },
12024
- isNullable() {
12025
- return this.safeParse(null).success;
12026
- },
12027
- apply(fn) {
12028
- return fn(this);
12029
- }
12030
- });
12031
- Object.defineProperty(inst, "description", {
12032
- get() {
12033
- return globalRegistry.get(inst)?.description;
12034
- },
12035
- configurable: true
12036
- });
12037
12754
  return inst;
12038
- });
12039
- var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
12040
- $ZodString.init(inst, def);
12041
- ZodType.init(inst, def);
12042
- inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json);
12043
- const bag = inst._zod.bag;
12044
- inst.format = bag.format ?? null;
12045
- inst.minLength = bag.minimum ?? null;
12046
- inst.maxLength = bag.maximum ?? null;
12047
- _installLazyMethods(inst, "_ZodString", {
12048
- regex(...args) {
12049
- return this.check(_regex(...args));
12050
- },
12051
- includes(...args) {
12052
- return this.check(_includes(...args));
12053
- },
12054
- startsWith(...args) {
12055
- return this.check(_startsWith(...args));
12056
- },
12057
- endsWith(...args) {
12058
- return this.check(_endsWith(...args));
12059
- },
12060
- min(...args) {
12061
- return this.check(_minLength(...args));
12062
- },
12063
- max(...args) {
12064
- return this.check(_maxLength(...args));
12065
- },
12066
- length(...args) {
12067
- return this.check(_length(...args));
12068
- },
12069
- nonempty(...args) {
12070
- return this.check(_minLength(1, ...args));
12071
- },
12072
- lowercase(params) {
12073
- return this.check(_lowercase(params));
12074
- },
12075
- uppercase(params) {
12076
- return this.check(_uppercase(params));
12077
- },
12078
- trim() {
12079
- return this.check(_trim());
12080
- },
12081
- normalize(...args) {
12082
- return this.check(_normalize(...args));
12083
- },
12084
- toLowerCase() {
12085
- return this.check(_toLowerCase());
12086
- },
12087
- toUpperCase() {
12088
- return this.check(_toUpperCase());
12089
- },
12090
- slugify() {
12091
- return this.check(_slugify());
12092
- }
12093
- });
12755
+ }, {
12756
+ check(...chks) {
12757
+ const def = this.def;
12758
+ return this.clone(util_exports.mergeDefs(def, {
12759
+ checks: [
12760
+ ...def.checks ?? [],
12761
+ ...chks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
12762
+ ]
12763
+ }), { parent: true });
12764
+ },
12765
+ with(...chks) {
12766
+ return this.check(...chks);
12767
+ },
12768
+ clone(def, params) {
12769
+ return clone(this, def, params);
12770
+ },
12771
+ brand() {
12772
+ return this;
12773
+ },
12774
+ register(reg, meta2) {
12775
+ reg.add(this, meta2);
12776
+ return this;
12777
+ },
12778
+ refine(check, params) {
12779
+ return this.check(refine(check, params));
12780
+ },
12781
+ superRefine(refinement, params) {
12782
+ return this.check(superRefine(refinement, params));
12783
+ },
12784
+ overwrite(fn) {
12785
+ return this.check(_overwrite(fn));
12786
+ },
12787
+ optional() {
12788
+ return optional(this);
12789
+ },
12790
+ exactOptional() {
12791
+ return exactOptional(this);
12792
+ },
12793
+ nullable() {
12794
+ return nullable(this);
12795
+ },
12796
+ nullish() {
12797
+ return optional(nullable(this));
12798
+ },
12799
+ nonoptional(params) {
12800
+ return nonoptional(this, params);
12801
+ },
12802
+ array() {
12803
+ return array(this);
12804
+ },
12805
+ or(arg) {
12806
+ return union([this, arg]);
12807
+ },
12808
+ and(arg) {
12809
+ return intersection(this, arg);
12810
+ },
12811
+ transform(tx) {
12812
+ return pipe(this, transform(tx));
12813
+ },
12814
+ default(d) {
12815
+ return _default(this, d);
12816
+ },
12817
+ prefault(d) {
12818
+ return prefault(this, d);
12819
+ },
12820
+ catch(params) {
12821
+ return _catch(this, params);
12822
+ },
12823
+ pipe(target) {
12824
+ return pipe(this, target);
12825
+ },
12826
+ readonly() {
12827
+ return readonly(this);
12828
+ },
12829
+ describe(description) {
12830
+ const cl = this.clone();
12831
+ globalRegistry.add(cl, { description });
12832
+ return cl;
12833
+ },
12834
+ meta(...args) {
12835
+ if (args.length === 0)
12836
+ return globalRegistry.get(this);
12837
+ const cl = this.clone();
12838
+ globalRegistry.add(cl, args[0]);
12839
+ return cl;
12840
+ },
12841
+ isOptional() {
12842
+ return this.safeParse(void 0).success;
12843
+ },
12844
+ isNullable() {
12845
+ return this.safeParse(null).success;
12846
+ },
12847
+ apply(fn, ...args) {
12848
+ return args.length === 0 ? fn(this) : fn(this, ...args);
12849
+ },
12850
+ // Overrides core's `~standard` to add `jsonSchema`. Must stay a prototype entry: redefining it per instance demotes instances to dictionary mode.
12851
+ get "~standard"() {
12852
+ return util_exports.hide(this, "~standard", {
12853
+ ...standardProps(this),
12854
+ jsonSchema: {
12855
+ input: createStandardJSONSchemaMethod(this, "input"),
12856
+ output: createStandardJSONSchemaMethod(this, "output")
12857
+ }
12858
+ });
12859
+ },
12860
+ set "~standard"(value) {
12861
+ util_exports.own(this, "~standard", value);
12862
+ },
12863
+ parse: function _parse2(data, params) {
12864
+ return parse2(this, data, params, { callee: _parse2 });
12865
+ },
12866
+ parseAsync: async function _parseAsync2(data, params) {
12867
+ return await parseAsync2(this, data, params, { callee: _parseAsync2 });
12868
+ },
12869
+ safeParse(data, params) {
12870
+ return safeParse3(this, data, params);
12871
+ },
12872
+ async safeParseAsync(data, params) {
12873
+ return safeParseAsync2(this, data, params);
12874
+ },
12875
+ // `spa` is an alias: same function object as `safeParseAsync`, as before.
12876
+ get spa() {
12877
+ return this?.safeParseAsync;
12878
+ },
12879
+ set spa(value) {
12880
+ util_exports.own(this, "spa", value);
12881
+ },
12882
+ encode: function _encode2(data, params) {
12883
+ return encode2(this, data, params, { callee: _encode2 });
12884
+ },
12885
+ decode: function _decode2(data, params) {
12886
+ return decode2(this, data, params, { callee: _decode2 });
12887
+ },
12888
+ encodeAsync: async function _encodeAsync2(data, params) {
12889
+ return await encodeAsync2(this, data, params, { callee: _encodeAsync2 });
12890
+ },
12891
+ decodeAsync: async function _decodeAsync2(data, params) {
12892
+ return await decodeAsync2(this, data, params, { callee: _decodeAsync2 });
12893
+ },
12894
+ safeEncode(data, params) {
12895
+ return safeEncode2(this, data, params);
12896
+ },
12897
+ safeDecode(data, params) {
12898
+ return safeDecode2(this, data, params);
12899
+ },
12900
+ async safeEncodeAsync(data, params) {
12901
+ return safeEncodeAsync2(this, data, params);
12902
+ },
12903
+ async safeDecodeAsync(data, params) {
12904
+ return safeDecodeAsync2(this, data, params);
12905
+ },
12906
+ toJSONSchema(params) {
12907
+ return createToJSONSchemaMethod(this, {})(params);
12908
+ },
12909
+ // Reads through to the registry on every access, so it must not cache.
12910
+ get description() {
12911
+ return globalRegistry.get(this)?.description;
12912
+ },
12913
+ // No setter: `schema._def = x` throws, as it did when `_def` was a non-writable own property.
12914
+ get _def() {
12915
+ return this._zod.def;
12916
+ }
12917
+ });
12918
+ var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
12919
+ $ZodString.init(inst, def);
12920
+ ZodType.init(inst, def);
12921
+ inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json);
12922
+ const bag = inst._zod.bag;
12923
+ inst.format = bag.format ?? null;
12924
+ inst.minLength = bag.minimum ?? null;
12925
+ inst.maxLength = bag.maximum ?? null;
12926
+ }, {
12927
+ regex(...args) {
12928
+ return this.check(_regex(...args));
12929
+ },
12930
+ includes(...args) {
12931
+ return this.check(_includes(...args));
12932
+ },
12933
+ startsWith(...args) {
12934
+ return this.check(_startsWith(...args));
12935
+ },
12936
+ endsWith(...args) {
12937
+ return this.check(_endsWith(...args));
12938
+ },
12939
+ min(...args) {
12940
+ return this.check(_minLength(...args));
12941
+ },
12942
+ max(...args) {
12943
+ return this.check(_maxLength(...args));
12944
+ },
12945
+ length(...args) {
12946
+ return this.check(_length(...args));
12947
+ },
12948
+ nonempty(...args) {
12949
+ return this.check(_minLength(1, ...args));
12950
+ },
12951
+ lowercase(params) {
12952
+ return this.check(_lowercase(params));
12953
+ },
12954
+ uppercase(params) {
12955
+ return this.check(_uppercase(params));
12956
+ },
12957
+ trim() {
12958
+ return this.check(_trim());
12959
+ },
12960
+ normalize(...args) {
12961
+ return this.check(_normalize(...args));
12962
+ },
12963
+ toLowerCase() {
12964
+ return this.check(_toLowerCase());
12965
+ },
12966
+ toUpperCase() {
12967
+ return this.check(_toUpperCase());
12968
+ },
12969
+ slugify() {
12970
+ return this.check(_slugify());
12971
+ }
12094
12972
  });
12095
12973
  var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
12096
12974
  $ZodString.init(inst, def);
12097
12975
  _ZodString.init(inst, def);
12098
- inst.email = (params) => inst.check(_email(ZodEmail, params));
12099
- inst.url = (params) => inst.check(_url(ZodURL, params));
12100
- inst.jwt = (params) => inst.check(_jwt(ZodJWT, params));
12101
- inst.emoji = (params) => inst.check(_emoji2(ZodEmoji, params));
12102
- inst.guid = (params) => inst.check(_guid(ZodGUID, params));
12103
- inst.uuid = (params) => inst.check(_uuid(ZodUUID, params));
12104
- inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params));
12105
- inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params));
12106
- inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params));
12107
- inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params));
12108
- inst.guid = (params) => inst.check(_guid(ZodGUID, params));
12109
- inst.cuid = (params) => inst.check(_cuid(ZodCUID, params));
12110
- inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params));
12111
- inst.ulid = (params) => inst.check(_ulid(ZodULID, params));
12112
- inst.base64 = (params) => inst.check(_base64(ZodBase64, params));
12113
- inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params));
12114
- inst.xid = (params) => inst.check(_xid(ZodXID, params));
12115
- inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params));
12116
- inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params));
12117
- inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params));
12118
- inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params));
12119
- inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params));
12120
- inst.e164 = (params) => inst.check(_e164(ZodE164, params));
12121
- inst.datetime = (params) => inst.check(datetime2(params));
12122
- inst.date = (params) => inst.check(date2(params));
12123
- inst.time = (params) => inst.check(time2(params));
12124
- inst.duration = (params) => inst.check(duration2(params));
12976
+ }, {
12977
+ email(params) {
12978
+ return this.check(_email(ZodEmail, params));
12979
+ },
12980
+ url(params) {
12981
+ return this.check(_url(ZodURL, params));
12982
+ },
12983
+ jwt(params) {
12984
+ return this.check(_jwt(ZodJWT, params));
12985
+ },
12986
+ emoji(params) {
12987
+ return this.check(_emoji2(ZodEmoji, params));
12988
+ },
12989
+ guid(params) {
12990
+ return this.check(_guid(ZodGUID, params));
12991
+ },
12992
+ uuid(params) {
12993
+ return this.check(_uuid(ZodUUID, params));
12994
+ },
12995
+ uuidv4(params) {
12996
+ return this.check(_uuidv4(ZodUUID, params));
12997
+ },
12998
+ uuidv6(params) {
12999
+ return this.check(_uuidv6(ZodUUID, params));
13000
+ },
13001
+ uuidv7(params) {
13002
+ return this.check(_uuidv7(ZodUUID, params));
13003
+ },
13004
+ nanoid(params) {
13005
+ return this.check(_nanoid(ZodNanoID, params));
13006
+ },
13007
+ cuid(params) {
13008
+ return this.check(_cuid(ZodCUID, params));
13009
+ },
13010
+ cuid2(params) {
13011
+ return this.check(_cuid2(ZodCUID2, params));
13012
+ },
13013
+ ulid(params) {
13014
+ return this.check(_ulid(ZodULID, params));
13015
+ },
13016
+ base64(params) {
13017
+ return this.check(_base64(ZodBase64, params));
13018
+ },
13019
+ base64url(params) {
13020
+ return this.check(_base64url(ZodBase64URL, params));
13021
+ },
13022
+ xid(params) {
13023
+ return this.check(_xid(ZodXID, params));
13024
+ },
13025
+ ksuid(params) {
13026
+ return this.check(_ksuid(ZodKSUID, params));
13027
+ },
13028
+ ipv4(params) {
13029
+ return this.check(_ipv4(ZodIPv4, params));
13030
+ },
13031
+ ipv6(params) {
13032
+ return this.check(_ipv6(ZodIPv6, params));
13033
+ },
13034
+ cidrv4(params) {
13035
+ return this.check(_cidrv4(ZodCIDRv4, params));
13036
+ },
13037
+ cidrv6(params) {
13038
+ return this.check(_cidrv6(ZodCIDRv6, params));
13039
+ },
13040
+ e164(params) {
13041
+ return this.check(_e164(ZodE164, params));
13042
+ },
13043
+ datetime(params) {
13044
+ return this.check(_isoDateTime(ZodISODateTime, params));
13045
+ },
13046
+ date(params) {
13047
+ return this.check(_isoDate(ZodISODate, params));
13048
+ },
13049
+ time(params) {
13050
+ return this.check(_isoTime(ZodISOTime, params));
13051
+ },
13052
+ duration(params) {
13053
+ return this.check(_isoDuration(ZodISODuration, params));
13054
+ }
12125
13055
  });
12126
13056
  function string2(params) {
12127
13057
  return _string(ZodString, params);
@@ -12130,6 +13060,22 @@ var ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def
12130
13060
  $ZodStringFormat.init(inst, def);
12131
13061
  _ZodString.init(inst, def);
12132
13062
  });
13063
+ var ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
13064
+ $ZodISODateTime.init(inst, def);
13065
+ ZodStringFormat.init(inst, def);
13066
+ });
13067
+ var ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
13068
+ $ZodISODate.init(inst, def);
13069
+ ZodStringFormat.init(inst, def);
13070
+ });
13071
+ var ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
13072
+ $ZodISOTime.init(inst, def);
13073
+ ZodStringFormat.init(inst, def);
13074
+ });
13075
+ var ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
13076
+ $ZodISODuration.init(inst, def);
13077
+ ZodStringFormat.init(inst, def);
13078
+ });
12133
13079
  var ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => {
12134
13080
  $ZodEmail.init(inst, def);
12135
13081
  ZodStringFormat.init(inst, def);
@@ -12212,60 +13158,59 @@ var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
12212
13158
  var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
12213
13159
  $ZodNumber.init(inst, def);
12214
13160
  ZodType.init(inst, def);
12215
- inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json);
12216
- _installLazyMethods(inst, "ZodNumber", {
12217
- gt(value, params) {
12218
- return this.check(_gt(value, params));
12219
- },
12220
- gte(value, params) {
12221
- return this.check(_gte(value, params));
12222
- },
12223
- min(value, params) {
12224
- return this.check(_gte(value, params));
12225
- },
12226
- lt(value, params) {
12227
- return this.check(_lt(value, params));
12228
- },
12229
- lte(value, params) {
12230
- return this.check(_lte(value, params));
12231
- },
12232
- max(value, params) {
12233
- return this.check(_lte(value, params));
12234
- },
12235
- int(params) {
12236
- return this.check(int(params));
12237
- },
12238
- safe(params) {
12239
- return this.check(int(params));
12240
- },
12241
- positive(params) {
12242
- return this.check(_gt(0, params));
12243
- },
12244
- nonnegative(params) {
12245
- return this.check(_gte(0, params));
12246
- },
12247
- negative(params) {
12248
- return this.check(_lt(0, params));
12249
- },
12250
- nonpositive(params) {
12251
- return this.check(_lte(0, params));
12252
- },
12253
- multipleOf(value, params) {
12254
- return this.check(_multipleOf(value, params));
12255
- },
12256
- step(value, params) {
12257
- return this.check(_multipleOf(value, params));
12258
- },
12259
- finite() {
12260
- return this;
12261
- }
12262
- });
13161
+ inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
12263
13162
  const bag = inst._zod.bag;
12264
13163
  inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
12265
13164
  inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
12266
13165
  inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
12267
13166
  inst.isFinite = true;
12268
13167
  inst.format = bag.format ?? null;
13168
+ }, {
13169
+ gt(value, params) {
13170
+ return this.check(_gt(value, params));
13171
+ },
13172
+ gte(value, params) {
13173
+ return this.check(_gte(value, params));
13174
+ },
13175
+ min(value, params) {
13176
+ return this.check(_gte(value, params));
13177
+ },
13178
+ lt(value, params) {
13179
+ return this.check(_lt(value, params));
13180
+ },
13181
+ lte(value, params) {
13182
+ return this.check(_lte(value, params));
13183
+ },
13184
+ max(value, params) {
13185
+ return this.check(_lte(value, params));
13186
+ },
13187
+ int(params) {
13188
+ return this.check(int(params));
13189
+ },
13190
+ safe(params) {
13191
+ return this.check(int(params));
13192
+ },
13193
+ positive(params) {
13194
+ return this.check(_gt(0, params));
13195
+ },
13196
+ nonnegative(params) {
13197
+ return this.check(_gte(0, params));
13198
+ },
13199
+ negative(params) {
13200
+ return this.check(_lt(0, params));
13201
+ },
13202
+ nonpositive(params) {
13203
+ return this.check(_lte(0, params));
13204
+ },
13205
+ multipleOf(value, params) {
13206
+ return this.check(_multipleOf(value, params));
13207
+ },
13208
+ step(value, params) {
13209
+ return this.check(_multipleOf(value, params));
13210
+ },
13211
+ finite() {
13212
+ return this;
13213
+ }
12269
13214
  });
12270
13215
  function number2(params) {
12271
13216
  return _number(ZodNumber, params);
@@ -12288,24 +13233,45 @@ function boolean2(params) {
12288
13233
  var ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => {
12289
13234
  $ZodBigInt.init(inst, def);
12290
13235
  ZodType.init(inst, def);
12291
- inst._zod.processJSONSchema = (ctx, json, params) => bigintProcessor(inst, ctx);
12292
- inst.gte = (value, params) => inst.check(_gte(value, params));
12293
- inst.min = (value, params) => inst.check(_gte(value, params));
12294
- inst.gt = (value, params) => inst.check(_gt(value, params));
12295
- inst.gte = (value, params) => inst.check(_gte(value, params));
12296
- inst.min = (value, params) => inst.check(_gte(value, params));
12297
- inst.lt = (value, params) => inst.check(_lt(value, params));
12298
- inst.lte = (value, params) => inst.check(_lte(value, params));
12299
- inst.max = (value, params) => inst.check(_lte(value, params));
12300
- inst.positive = (params) => inst.check(_gt(BigInt(0), params));
12301
- inst.negative = (params) => inst.check(_lt(BigInt(0), params));
12302
- inst.nonpositive = (params) => inst.check(_lte(BigInt(0), params));
12303
- inst.nonnegative = (params) => inst.check(_gte(BigInt(0), params));
12304
- inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params));
13236
+ inst._zod.processJSONSchema = (ctx, json, params) => bigintProcessor(inst, ctx, json, params);
12305
13237
  const bag = inst._zod.bag;
12306
13238
  inst.minValue = bag.minimum ?? null;
12307
13239
  inst.maxValue = bag.maximum ?? null;
12308
13240
  inst.format = bag.format ?? null;
13241
+ }, {
13242
+ gte(value, params) {
13243
+ return this.check(_gte(value, params));
13244
+ },
13245
+ min(value, params) {
13246
+ return this.check(_gte(value, params));
13247
+ },
13248
+ gt(value, params) {
13249
+ return this.check(_gt(value, params));
13250
+ },
13251
+ lt(value, params) {
13252
+ return this.check(_lt(value, params));
13253
+ },
13254
+ lte(value, params) {
13255
+ return this.check(_lte(value, params));
13256
+ },
13257
+ max(value, params) {
13258
+ return this.check(_lte(value, params));
13259
+ },
13260
+ positive(params) {
13261
+ return this.check(_gt(BigInt(0), params));
13262
+ },
13263
+ negative(params) {
13264
+ return this.check(_lt(BigInt(0), params));
13265
+ },
13266
+ nonpositive(params) {
13267
+ return this.check(_lte(BigInt(0), params));
13268
+ },
13269
+ nonnegative(params) {
13270
+ return this.check(_gte(BigInt(0), params));
13271
+ },
13272
+ multipleOf(value, params) {
13273
+ return this.check(_multipleOf(value, params));
13274
+ }
12309
13275
  });
12310
13276
  var ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
12311
13277
  $ZodNull.init(inst, def);
@@ -12342,7 +13308,7 @@ function never(params) {
12342
13308
  var ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
12343
13309
  $ZodDate.init(inst, def);
12344
13310
  ZodType.init(inst, def);
12345
- inst._zod.processJSONSchema = (ctx, json, params) => dateProcessor(inst, ctx);
13311
+ inst._zod.processJSONSchema = (ctx, json, params) => dateProcessor(inst, ctx, json, params);
12346
13312
  inst.min = (value, params) => inst.check(_gte(value, params));
12347
13313
  inst.max = (value, params) => inst.check(_lte(value, params));
12348
13314
  const c = inst._zod.bag;
@@ -12350,79 +13316,80 @@ var ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
12350
13316
  inst.maxDate = c.maximum ? new Date(c.maximum) : null;
12351
13317
  });
12352
13318
  var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
13319
+ _ensureDefaultMemoizer();
12353
13320
  $ZodArray.init(inst, def);
12354
13321
  ZodType.init(inst, def);
12355
13322
  inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
12356
13323
  inst.element = def.element;
12357
- _installLazyMethods(inst, "ZodArray", {
12358
- min(n, params) {
12359
- return this.check(_minLength(n, params));
12360
- },
12361
- nonempty(params) {
12362
- return this.check(_minLength(1, params));
12363
- },
12364
- max(n, params) {
12365
- return this.check(_maxLength(n, params));
12366
- },
12367
- length(n, params) {
12368
- return this.check(_length(n, params));
12369
- },
12370
- unwrap() {
12371
- return this.element;
12372
- }
12373
- });
13324
+ }, {
13325
+ min(n, params) {
13326
+ return this.check(_minLength(n, params));
13327
+ },
13328
+ nonempty(params) {
13329
+ return this.check(_minLength(1, params));
13330
+ },
13331
+ max(n, params) {
13332
+ return this.check(_maxLength(n, params));
13333
+ },
13334
+ length(n, params) {
13335
+ return this.check(_length(n, params));
13336
+ },
13337
+ unwrap() {
13338
+ return this.element;
13339
+ }
12374
13340
  });
12375
13341
  function array(element, params) {
12376
13342
  return _array(ZodArray, element, params);
12377
13343
  }
12378
13344
  var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
13345
+ _ensureDefaultMemoizer();
12379
13346
  $ZodObjectJIT.init(inst, def);
12380
13347
  ZodType.init(inst, def);
12381
13348
  inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params);
12382
- util_exports.defineLazy(inst, "shape", () => {
12383
- return def.shape;
12384
- });
12385
- _installLazyMethods(inst, "ZodObject", {
12386
- keyof() {
12387
- return _enum(Object.keys(this._zod.def.shape));
12388
- },
12389
- catchall(catchall) {
12390
- return this.clone({ ...this._zod.def, catchall });
12391
- },
12392
- passthrough() {
12393
- return this.clone({ ...this._zod.def, catchall: unknown() });
12394
- },
12395
- loose() {
12396
- return this.clone({ ...this._zod.def, catchall: unknown() });
12397
- },
12398
- strict() {
12399
- return this.clone({ ...this._zod.def, catchall: never() });
12400
- },
12401
- strip() {
12402
- return this.clone({ ...this._zod.def, catchall: void 0 });
12403
- },
12404
- extend(incoming) {
12405
- return util_exports.extend(this, incoming);
12406
- },
12407
- safeExtend(incoming) {
12408
- return util_exports.safeExtend(this, incoming);
12409
- },
12410
- merge(other) {
12411
- return util_exports.merge(this, other);
12412
- },
12413
- pick(mask) {
12414
- return util_exports.pick(this, mask);
12415
- },
12416
- omit(mask) {
12417
- return util_exports.omit(this, mask);
12418
- },
12419
- partial(...args) {
12420
- return util_exports.partial(ZodOptional, this, args[0]);
12421
- },
12422
- required(...args) {
12423
- return util_exports.required(ZodNonOptional, this, args[0]);
12424
- }
12425
- });
13349
+ util_exports.installLazyProp(inst, "shape", (self) => self._zod.def.shape, false);
13350
+ }, {
13351
+ keyof() {
13352
+ return _enum(Object.keys(this._zod.def.shape));
13353
+ },
13354
+ catchall(catchall) {
13355
+ return this.clone({ ...this._zod.def, catchall });
13356
+ },
13357
+ passthrough() {
13358
+ return this.clone({ ...this._zod.def, catchall: unknown() });
13359
+ },
13360
+ loose() {
13361
+ return this.clone({ ...this._zod.def, catchall: unknown() });
13362
+ },
13363
+ strict() {
13364
+ return this.clone({ ...this._zod.def, catchall: never() });
13365
+ },
13366
+ strip() {
13367
+ return this.clone({ ...this._zod.def, catchall: void 0 });
13368
+ },
13369
+ extend(incoming) {
13370
+ return util_exports.extend(this, incoming);
13371
+ },
13372
+ safeExtend(incoming) {
13373
+ return util_exports.safeExtend(this, incoming);
13374
+ },
13375
+ merge(other) {
13376
+ return util_exports.merge(this, other);
13377
+ },
13378
+ pick(mask) {
13379
+ return util_exports.pick(this, mask);
13380
+ },
13381
+ omit(mask) {
13382
+ return util_exports.omit(this, mask);
13383
+ },
13384
+ partial(...args) {
13385
+ return util_exports.partial(ZodOptional, this, args[0]);
13386
+ },
13387
+ exactPartial(...args) {
13388
+ return util_exports.partial(ZodExactOptional, this, args[0], "exactPartial");
13389
+ },
13390
+ required(...args) {
13391
+ return util_exports.required(ZodNonOptional, this, args[0]);
13392
+ }
12426
13393
  });
12427
13394
  function object2(shape, params) {
12428
13395
  const def = {
@@ -12478,6 +13445,7 @@ function intersection(left, right) {
12478
13445
  });
12479
13446
  }
12480
13447
  var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
13448
+ _ensureDefaultMemoizer();
12481
13449
  $ZodRecord.init(inst, def);
12482
13450
  ZodType.init(inst, def);
12483
13451
  inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
@@ -12549,7 +13517,7 @@ function _enum(values, params) {
12549
13517
  var ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
12550
13518
  $ZodLiteral.init(inst, def);
12551
13519
  ZodType.init(inst, def);
12552
- inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json);
13520
+ inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json, params);
12553
13521
  inst.values = new Set(def.values);
12554
13522
  Object.defineProperty(inst, "value", {
12555
13523
  get() {
@@ -12568,9 +13536,10 @@ function literal(value, params) {
12568
13536
  });
12569
13537
  }
12570
13538
  var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
13539
+ _ensureDefaultMemoizer();
12571
13540
  $ZodTransform.init(inst, def);
12572
13541
  ZodType.init(inst, def);
12573
- inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx);
13542
+ inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params);
12574
13543
  inst._zod.parse = (payload, _ctx) => {
12575
13544
  if (_ctx.direction === "backward") {
12576
13545
  throw new $ZodEncodeError(inst.constructor.name);
@@ -12583,7 +13552,8 @@ var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
12583
13552
  if (_issue.fatal)
12584
13553
  _issue.continue = false;
12585
13554
  _issue.code ?? (_issue.code = "custom");
12586
- _issue.input ?? (_issue.input = payload.value);
13555
+ if (!("input" in _issue))
13556
+ _issue.input = payload.value;
12587
13557
  _issue.inst ?? (_issue.inst = inst);
12588
13558
  payload.issues.push(util_exports.issue(_issue));
12589
13559
  }
@@ -12592,12 +13562,10 @@ var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
12592
13562
  if (output instanceof Promise) {
12593
13563
  return output.then((output2) => {
12594
13564
  payload.value = output2;
12595
- payload.fallback = true;
12596
13565
  return payload;
12597
13566
  });
12598
13567
  }
12599
13568
  payload.value = output;
12600
- payload.fallback = true;
12601
13569
  return payload;
12602
13570
  };
12603
13571
  });
@@ -12698,7 +13666,7 @@ function _catch(innerType, catchValue) {
12698
13666
  return new ZodCatch({
12699
13667
  type: "catch",
12700
13668
  innerType,
12701
- catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
13669
+ catchValue: typeof catchValue === "function" ? catchValue : util_exports.constantCatch(catchValue)
12702
13670
  });
12703
13671
  }
12704
13672
  var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
@@ -12735,7 +13703,7 @@ function readonly(innerType) {
12735
13703
  var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
12736
13704
  $ZodCustom.init(inst, def);
12737
13705
  ZodType.init(inst, def);
12738
- inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx);
13706
+ inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
12739
13707
  });
12740
13708
  function custom(fn, _params) {
12741
13709
  return _custom(ZodCustom, fn ?? (() => true), _params);
@@ -12754,12 +13722,37 @@ function preprocess(fn, schema) {
12754
13722
  });
12755
13723
  }
12756
13724
 
12757
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/compat.js
13725
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/compat.js
12758
13726
  var ZodIssueCode = {
12759
13727
  custom: "custom"
12760
13728
  };
12761
13729
 
12762
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/coerce.js
13730
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/iso.js
13731
+ var iso_exports = {};
13732
+ __export(iso_exports, {
13733
+ ZodISODate: () => ZodISODate,
13734
+ ZodISODateTime: () => ZodISODateTime,
13735
+ ZodISODuration: () => ZodISODuration,
13736
+ ZodISOTime: () => ZodISOTime,
13737
+ date: () => date2,
13738
+ datetime: () => datetime2,
13739
+ duration: () => duration2,
13740
+ time: () => time2
13741
+ });
13742
+ function datetime2(params) {
13743
+ return _isoDateTime(ZodISODateTime, params);
13744
+ }
13745
+ function date2(params) {
13746
+ return _isoDate(ZodISODate, params);
13747
+ }
13748
+ function time2(params) {
13749
+ return _isoTime(ZodISOTime, params);
13750
+ }
13751
+ function duration2(params) {
13752
+ return _isoDuration(ZodISODuration, params);
13753
+ }
13754
+
13755
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/coerce.js
12763
13756
  var coerce_exports = {};
12764
13757
  __export(coerce_exports, {
12765
13758
  bigint: () => bigint2,
@@ -12784,10 +13777,7 @@ function date3(params) {
12784
13777
  return _coercedDate(ZodDate, params);
12785
13778
  }
12786
13779
 
12787
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
12788
- config(en_default());
12789
-
12790
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
13780
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
12791
13781
  var LATEST_PROTOCOL_VERSION = "2025-11-25";
12792
13782
  var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
12793
13783
  var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
@@ -14307,15 +15297,15 @@ var UrlElicitationRequiredError = class extends McpError {
14307
15297
  }
14308
15298
  };
14309
15299
 
14310
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
15300
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
14311
15301
  function isTerminal(status) {
14312
15302
  return status === "completed" || status === "failed" || status === "cancelled";
14313
15303
  }
14314
15304
 
14315
- // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@4.4.3/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
15305
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@4.5.4/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
14316
15306
  new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
14317
15307
 
14318
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
15308
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
14319
15309
  function getMethodLiteral(schema) {
14320
15310
  const shape = getObjectShape(schema);
14321
15311
  const methodSchema = shape?.method;
@@ -14336,7 +15326,7 @@ function parseWithCompat(schema, data) {
14336
15326
  return result.data;
14337
15327
  }
14338
15328
 
14339
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
15329
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
14340
15330
  var DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
14341
15331
  var Protocol = class {
14342
15332
  constructor(_options) {
@@ -15290,7 +16280,7 @@ function mergeCapabilities(base, additional) {
15290
16280
  return result;
15291
16281
  }
15292
16282
 
15293
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
16283
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
15294
16284
  var import_ajv = __toESM(require_ajv());
15295
16285
  var import_ajv_formats = __toESM(require_dist());
15296
16286
  function createDefaultAjvInstance() {
@@ -15358,7 +16348,7 @@ var AjvJsonSchemaValidator = class {
15358
16348
  }
15359
16349
  };
15360
16350
 
15361
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js
16351
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js
15362
16352
  var ExperimentalClientTasks = class {
15363
16353
  constructor(_client) {
15364
16354
  this._client = _client;
@@ -15512,7 +16502,7 @@ var ExperimentalClientTasks = class {
15512
16502
  }
15513
16503
  };
15514
16504
 
15515
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
16505
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
15516
16506
  function assertToolsCallTaskCapability(requests, method, entityName) {
15517
16507
  if (!requests) {
15518
16508
  throw new Error(`${entityName} does not support task creation (required for ${method})`);
@@ -15543,7 +16533,7 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
15543
16533
  }
15544
16534
  }
15545
16535
 
15546
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js
16536
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js
15547
16537
  function applyElicitationDefaults(schema, data) {
15548
16538
  if (!schema || data === null || typeof data !== "object")
15549
16539
  return;
@@ -16042,7 +17032,7 @@ var Client = class extends Protocol {
16042
17032
  }
16043
17033
  };
16044
17034
 
16045
- // ../../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/index.js
17035
+ // ../../node_modules/.pnpm/eventsource-parser@3.1.1/node_modules/eventsource-parser/dist/index.js
16046
17036
  var ParseError = class extends Error {
16047
17037
  constructor(message, options) {
16048
17038
  super(message), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;
@@ -16146,7 +17136,7 @@ ${value2}`, dataLines++;
16146
17136
  }
16147
17137
  if (firstCharCode === 105 && chunk.charCodeAt(start + 1) === 100 && chunk.charCodeAt(start + 2) === 58) {
16148
17138
  const value2 = chunk.slice(chunk.charCodeAt(start + 3) === SPACE ? start + 4 : start + 3, end);
16149
- id = value2.includes("\0") ? void 0 : value2;
17139
+ value2.includes("\0") || (id = value2);
16150
17140
  return;
16151
17141
  }
16152
17142
  if (firstCharCode === 58) {
@@ -16174,7 +17164,7 @@ ${value2}`, dataLines++;
16174
17164
  ${value}`, dataLines++;
16175
17165
  break;
16176
17166
  case "id":
16177
- id = value.includes("\0") ? void 0 : value;
17167
+ value.includes("\0") || (id = value);
16178
17168
  break;
16179
17169
  case "retry":
16180
17170
  /^\d+$/.test(value) ? onRetry(parseInt(value, 10)) : onError(
@@ -16337,11 +17327,11 @@ var EventSource = class extends EventTarget {
16337
17327
  return;
16338
17328
  }
16339
17329
  const decoder = new TextDecoder(), reader = body.getReader();
16340
- let open = true;
17330
+ let open2 = true;
16341
17331
  do {
16342
17332
  const { done, value } = await reader.read();
16343
- value && __privateGet(this, _parser).feed(decoder.decode(value, { stream: !done })), done && (open = false, __privateGet(this, _parser).reset(), __privateMethod(this, _EventSource_instances, scheduleReconnect_fn).call(this));
16344
- } while (open);
17333
+ value && __privateGet(this, _parser).feed(decoder.decode(value, { stream: !done })), done && (open2 = false, __privateGet(this, _parser).reset(), __privateMethod(this, _EventSource_instances, scheduleReconnect_fn).call(this));
17334
+ } while (open2);
16345
17335
  }), __privateAdd(this, _onFetchError, (err) => {
16346
17336
  __privateSet(this, _controller, void 0), !(err.name === "AbortError" || err.type === "aborted") && __privateMethod(this, _EventSource_instances, scheduleReconnect_fn).call(this, flattenError2(err));
16347
17337
  }), __privateAdd(this, _onEvent, (event) => {
@@ -16515,7 +17505,7 @@ function getBaseURL() {
16515
17505
  return doc && typeof doc == "object" && "baseURI" in doc && typeof doc.baseURI == "string" ? doc.baseURI : void 0;
16516
17506
  }
16517
17507
 
16518
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js
17508
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js
16519
17509
  function normalizeHeaders(headers) {
16520
17510
  if (!headers)
16521
17511
  return {};
@@ -16585,7 +17575,7 @@ async function pkceChallenge(length) {
16585
17575
  };
16586
17576
  }
16587
17577
 
16588
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
17578
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
16589
17579
  var SafeUrlSchema = url().superRefine((val, ctx) => {
16590
17580
  if (!URL.canParse(val)) {
16591
17581
  ctx.addIssue({
@@ -16729,7 +17719,7 @@ object2({
16729
17719
  token_type_hint: string2().optional()
16730
17720
  }).strip();
16731
17721
 
16732
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js
17722
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js
16733
17723
  function resourceUrlFromServerUrl(url2) {
16734
17724
  const resourceURL = typeof url2 === "string" ? new URL(url2) : new URL(url2.href);
16735
17725
  resourceURL.hash = "";
@@ -16749,7 +17739,7 @@ function checkResourceAllowed({ requestedResource, configuredResource }) {
16749
17739
  return requestedPath.startsWith(configuredPath);
16750
17740
  }
16751
17741
 
16752
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js
17742
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js
16753
17743
  var OAuthError = class extends Error {
16754
17744
  constructor(message, errorUri) {
16755
17745
  super(message);
@@ -16844,7 +17834,7 @@ var OAUTH_ERRORS = {
16844
17834
  [InvalidTargetError.errorCode]: InvalidTargetError
16845
17835
  };
16846
17836
 
16847
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js
17837
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js
16848
17838
  var UnauthorizedError = class extends Error {
16849
17839
  constructor(message) {
16850
17840
  super(message ?? "Unauthorized");
@@ -17384,7 +18374,7 @@ async function registerClient(authorizationServerUrl, { metadata, clientMetadata
17384
18374
  return OAuthClientInformationFullSchema.parse(await response.json());
17385
18375
  }
17386
18376
 
17387
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js
18377
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js
17388
18378
  var SseError = class extends Error {
17389
18379
  constructor(code, message, event) {
17390
18380
  super(`SSE error: ${message}`);
@@ -17575,10 +18565,10 @@ var SSEClientTransport = class {
17575
18565
  }
17576
18566
  };
17577
18567
 
17578
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js
18568
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js
17579
18569
  var import_cross_spawn = __toESM(require_cross_spawn());
17580
18570
 
17581
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
18571
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
17582
18572
  var STDIO_DEFAULT_MAX_BUFFER_SIZE = 10 * 1024 * 1024;
17583
18573
  var ReadBuffer = class {
17584
18574
  constructor(options) {
@@ -17615,7 +18605,7 @@ function serializeMessage(message) {
17615
18605
  return JSON.stringify(message) + "\n";
17616
18606
  }
17617
18607
 
17618
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js
18608
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js
17619
18609
  var DEFAULT_INHERITED_ENV_VARS = process3.platform === "win32" ? [
17620
18610
  "APPDATA",
17621
18611
  "HOMEDRIVE",
@@ -17786,7 +18776,7 @@ var StdioClientTransport = class {
17786
18776
  }
17787
18777
  };
17788
18778
 
17789
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.js
18779
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.js
17790
18780
  var import_content_type = __toESM(require_content_type());
17791
18781
  function mediaTypeEssence(header) {
17792
18782
  if (!header) {
@@ -17803,13 +18793,189 @@ function mediaTypeEssence(header) {
17803
18793
  }
17804
18794
  }
17805
18795
 
18796
+ // ../../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/index.js
18797
+ var ParseError2 = class extends Error {
18798
+ constructor(message, options) {
18799
+ super(message), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;
18800
+ }
18801
+ };
18802
+ var LF2 = 10;
18803
+ var CR2 = 13;
18804
+ var SPACE2 = 32;
18805
+ function noop2(_arg) {
18806
+ }
18807
+ function createParser2(config2) {
18808
+ if (typeof config2 == "function")
18809
+ throw new TypeError(
18810
+ "`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?"
18811
+ );
18812
+ const { onEvent = noop2, onError = noop2, onRetry = noop2, onComment, maxBufferSize } = config2, pendingFragments = [];
18813
+ let pendingFragmentsLength = 0, isFirstChunk = true, id, data = "", dataLines = 0, eventType, terminated = false;
18814
+ function feed(chunk) {
18815
+ if (terminated)
18816
+ throw new Error(
18817
+ "Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing."
18818
+ );
18819
+ if (isFirstChunk && (isFirstChunk = false, chunk.charCodeAt(0) === 239 && chunk.charCodeAt(1) === 187 && chunk.charCodeAt(2) === 191 && (chunk = chunk.slice(3))), pendingFragments.length === 0) {
18820
+ const trailing2 = processLines(chunk);
18821
+ trailing2 !== "" && (pendingFragments.push(trailing2), pendingFragmentsLength = trailing2.length), checkBufferSize();
18822
+ return;
18823
+ }
18824
+ if (chunk.indexOf(`
18825
+ `) === -1 && chunk.indexOf("\r") === -1) {
18826
+ pendingFragments.push(chunk), pendingFragmentsLength += chunk.length, checkBufferSize();
18827
+ return;
18828
+ }
18829
+ pendingFragments.push(chunk);
18830
+ const input = pendingFragments.join("");
18831
+ pendingFragments.length = 0, pendingFragmentsLength = 0;
18832
+ const trailing = processLines(input);
18833
+ trailing !== "" && (pendingFragments.push(trailing), pendingFragmentsLength = trailing.length), checkBufferSize();
18834
+ }
18835
+ function checkBufferSize() {
18836
+ maxBufferSize !== void 0 && (pendingFragmentsLength + data.length <= maxBufferSize || (terminated = true, pendingFragments.length = 0, pendingFragmentsLength = 0, id = void 0, data = "", dataLines = 0, eventType = void 0, onError(
18837
+ new ParseError2(`Buffered data exceeded max buffer size of ${maxBufferSize} characters`, {
18838
+ type: "max-buffer-size-exceeded"
18839
+ })
18840
+ )));
18841
+ }
18842
+ function processLines(chunk) {
18843
+ let searchIndex = 0;
18844
+ if (chunk.indexOf("\r") === -1) {
18845
+ let lfIndex = chunk.indexOf(`
18846
+ `, searchIndex);
18847
+ for (; lfIndex !== -1; ) {
18848
+ if (searchIndex === lfIndex) {
18849
+ dataLines > 0 && onEvent({ id, event: eventType, data }), id = void 0, data = "", dataLines = 0, eventType = void 0, searchIndex = lfIndex + 1, lfIndex = chunk.indexOf(`
18850
+ `, searchIndex);
18851
+ continue;
18852
+ }
18853
+ const firstCharCode = chunk.charCodeAt(searchIndex);
18854
+ if (isDataPrefix2(chunk, searchIndex, firstCharCode)) {
18855
+ const valueStart = chunk.charCodeAt(searchIndex + 5) === SPACE2 ? searchIndex + 6 : searchIndex + 5, value = chunk.slice(valueStart, lfIndex);
18856
+ if (dataLines === 0 && chunk.charCodeAt(lfIndex + 1) === LF2) {
18857
+ onEvent({ id, event: eventType, data: value }), id = void 0, data = "", eventType = void 0, searchIndex = lfIndex + 2, lfIndex = chunk.indexOf(`
18858
+ `, searchIndex);
18859
+ continue;
18860
+ }
18861
+ data = dataLines === 0 ? value : `${data}
18862
+ ${value}`, dataLines++;
18863
+ } else isEventPrefix2(chunk, searchIndex, firstCharCode) ? eventType = chunk.slice(
18864
+ chunk.charCodeAt(searchIndex + 6) === SPACE2 ? searchIndex + 7 : searchIndex + 6,
18865
+ lfIndex
18866
+ ) || void 0 : parseLine(chunk, searchIndex, lfIndex);
18867
+ searchIndex = lfIndex + 1, lfIndex = chunk.indexOf(`
18868
+ `, searchIndex);
18869
+ }
18870
+ return chunk.slice(searchIndex);
18871
+ }
18872
+ for (; searchIndex < chunk.length; ) {
18873
+ const crIndex = chunk.indexOf("\r", searchIndex), lfIndex = chunk.indexOf(`
18874
+ `, searchIndex);
18875
+ let lineEnd = -1;
18876
+ if (crIndex !== -1 && lfIndex !== -1 ? lineEnd = crIndex < lfIndex ? crIndex : lfIndex : crIndex !== -1 ? crIndex === chunk.length - 1 ? lineEnd = -1 : lineEnd = crIndex : lfIndex !== -1 && (lineEnd = lfIndex), lineEnd === -1)
18877
+ break;
18878
+ parseLine(chunk, searchIndex, lineEnd), searchIndex = lineEnd + 1, chunk.charCodeAt(searchIndex - 1) === CR2 && chunk.charCodeAt(searchIndex) === LF2 && searchIndex++;
18879
+ }
18880
+ return chunk.slice(searchIndex);
18881
+ }
18882
+ function parseLine(chunk, start, end) {
18883
+ if (start === end) {
18884
+ dispatchEvent();
18885
+ return;
18886
+ }
18887
+ const firstCharCode = chunk.charCodeAt(start);
18888
+ if (isDataPrefix2(chunk, start, firstCharCode)) {
18889
+ const valueStart = chunk.charCodeAt(start + 5) === SPACE2 ? start + 6 : start + 5, value2 = chunk.slice(valueStart, end);
18890
+ data = dataLines === 0 ? value2 : `${data}
18891
+ ${value2}`, dataLines++;
18892
+ return;
18893
+ }
18894
+ if (isEventPrefix2(chunk, start, firstCharCode)) {
18895
+ eventType = chunk.slice(chunk.charCodeAt(start + 6) === SPACE2 ? start + 7 : start + 6, end) || void 0;
18896
+ return;
18897
+ }
18898
+ if (firstCharCode === 105 && chunk.charCodeAt(start + 1) === 100 && chunk.charCodeAt(start + 2) === 58) {
18899
+ const value2 = chunk.slice(chunk.charCodeAt(start + 3) === SPACE2 ? start + 4 : start + 3, end);
18900
+ id = value2.includes("\0") ? void 0 : value2;
18901
+ return;
18902
+ }
18903
+ if (firstCharCode === 58) {
18904
+ if (onComment) {
18905
+ const line2 = chunk.slice(start, end);
18906
+ onComment(line2.slice(chunk.charCodeAt(start + 1) === SPACE2 ? 2 : 1));
18907
+ }
18908
+ return;
18909
+ }
18910
+ const line = chunk.slice(start, end), fieldSeparatorIndex = line.indexOf(":");
18911
+ if (fieldSeparatorIndex === -1) {
18912
+ processField(line, "", line);
18913
+ return;
18914
+ }
18915
+ const field = line.slice(0, fieldSeparatorIndex), offset = line.charCodeAt(fieldSeparatorIndex + 1) === SPACE2 ? 2 : 1, value = line.slice(fieldSeparatorIndex + offset);
18916
+ processField(field, value, line);
18917
+ }
18918
+ function processField(field, value, line) {
18919
+ switch (field) {
18920
+ case "event":
18921
+ eventType = value || void 0;
18922
+ break;
18923
+ case "data":
18924
+ data = dataLines === 0 ? value : `${data}
18925
+ ${value}`, dataLines++;
18926
+ break;
18927
+ case "id":
18928
+ id = value.includes("\0") ? void 0 : value;
18929
+ break;
18930
+ case "retry":
18931
+ /^\d+$/.test(value) ? onRetry(parseInt(value, 10)) : onError(
18932
+ new ParseError2(`Invalid \`retry\` value: "${value}"`, {
18933
+ type: "invalid-retry",
18934
+ value,
18935
+ line
18936
+ })
18937
+ );
18938
+ break;
18939
+ default:
18940
+ onError(
18941
+ new ParseError2(
18942
+ `Unknown field "${field.length > 20 ? `${field.slice(0, 20)}\u2026` : field}"`,
18943
+ { type: "unknown-field", field, value, line }
18944
+ )
18945
+ );
18946
+ break;
18947
+ }
18948
+ }
18949
+ function dispatchEvent() {
18950
+ dataLines > 0 && onEvent({
18951
+ id,
18952
+ event: eventType,
18953
+ data
18954
+ }), id = void 0, data = "", dataLines = 0, eventType = void 0;
18955
+ }
18956
+ function reset(options = {}) {
18957
+ if (options.consume && pendingFragments.length > 0) {
18958
+ const incompleteLine = pendingFragments.join("");
18959
+ parseLine(incompleteLine, 0, incompleteLine.length);
18960
+ }
18961
+ isFirstChunk = true, id = void 0, data = "", dataLines = 0, eventType = void 0, pendingFragments.length = 0, pendingFragmentsLength = 0, terminated = false;
18962
+ }
18963
+ return { feed, reset };
18964
+ }
18965
+ function isDataPrefix2(chunk, i, firstCharCode) {
18966
+ return firstCharCode === 100 && chunk.charCodeAt(i + 1) === 97 && chunk.charCodeAt(i + 2) === 116 && chunk.charCodeAt(i + 3) === 97 && chunk.charCodeAt(i + 4) === 58;
18967
+ }
18968
+ function isEventPrefix2(chunk, i, firstCharCode) {
18969
+ return firstCharCode === 101 && chunk.charCodeAt(i + 1) === 118 && chunk.charCodeAt(i + 2) === 101 && chunk.charCodeAt(i + 3) === 110 && chunk.charCodeAt(i + 4) === 116 && chunk.charCodeAt(i + 5) === 58;
18970
+ }
18971
+
17806
18972
  // ../../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/stream.js
17807
18973
  var EventSourceParserStream = class extends TransformStream {
17808
18974
  constructor({ onError, onRetry, onComment, maxBufferSize } = {}) {
17809
18975
  let parser;
17810
18976
  super({
17811
18977
  start(controller) {
17812
- parser = createParser({
18978
+ parser = createParser2({
17813
18979
  onEvent: (event) => {
17814
18980
  controller.enqueue(event);
17815
18981
  },
@@ -17828,7 +18994,7 @@ var EventSourceParserStream = class extends TransformStream {
17828
18994
  }
17829
18995
  };
17830
18996
 
17831
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js
18997
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js
17832
18998
  var DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS = {
17833
18999
  initialReconnectionDelay: 1e3,
17834
19000
  maxReconnectionDelay: 3e4,