@agentproto/adapter-pi 0.3.7 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -863,8 +863,8 @@ var require_codegen = __commonJS({
863
863
  endIf() {
864
864
  return this._endBlockNode(If, Else);
865
865
  }
866
- _for(node, forBody) {
867
- this._blockNode(node);
866
+ _for(node2, forBody) {
867
+ this._blockNode(node2);
868
868
  if (forBody)
869
869
  this.code(forBody).endFor();
870
870
  return this;
@@ -913,10 +913,10 @@ var require_codegen = __commonJS({
913
913
  }
914
914
  // `return` statement
915
915
  return(value) {
916
- const node = new Return();
917
- this._blockNode(node);
916
+ const node2 = new Return();
917
+ this._blockNode(node2);
918
918
  this.code(value);
919
- if (node.nodes.length !== 1)
919
+ if (node2.nodes.length !== 1)
920
920
  throw new Error('CodeGen: "return" should have one node');
921
921
  return this._endBlockNode(Return);
922
922
  }
@@ -924,16 +924,16 @@ var require_codegen = __commonJS({
924
924
  try(tryBody, catchCode, finallyCode) {
925
925
  if (!catchCode && !finallyCode)
926
926
  throw new Error('CodeGen: "try" without "catch" and "finally"');
927
- const node = new Try();
928
- this._blockNode(node);
927
+ const node2 = new Try();
928
+ this._blockNode(node2);
929
929
  this.code(tryBody);
930
930
  if (catchCode) {
931
931
  const error2 = this.name("e");
932
- this._currNode = node.catch = new Catch(error2);
932
+ this._currNode = node2.catch = new Catch(error2);
933
933
  catchCode(error2);
934
934
  }
935
935
  if (finallyCode) {
936
- this._currNode = node.finally = new Finally();
936
+ this._currNode = node2.finally = new Finally();
937
937
  this.code(finallyCode);
938
938
  }
939
939
  return this._endBlockNode(Catch, Finally);
@@ -978,13 +978,13 @@ var require_codegen = __commonJS({
978
978
  this._root.optimizeNames(this._root.names, this._constants);
979
979
  }
980
980
  }
981
- _leafNode(node) {
982
- this._currNode.nodes.push(node);
981
+ _leafNode(node2) {
982
+ this._currNode.nodes.push(node2);
983
983
  return this;
984
984
  }
985
- _blockNode(node) {
986
- this._currNode.nodes.push(node);
987
- this._nodes.push(node);
985
+ _blockNode(node2) {
986
+ this._currNode.nodes.push(node2);
987
+ this._nodes.push(node2);
988
988
  }
989
989
  _endBlockNode(N1, N2) {
990
990
  const n = this._currNode;
@@ -994,12 +994,12 @@ var require_codegen = __commonJS({
994
994
  }
995
995
  throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`);
996
996
  }
997
- _elseNode(node) {
997
+ _elseNode(node2) {
998
998
  const n = this._currNode;
999
999
  if (!(n instanceof If)) {
1000
1000
  throw new Error('CodeGen: "else" without "if"');
1001
1001
  }
1002
- this._currNode = n.else = node;
1002
+ this._currNode = n.else = node2;
1003
1003
  return this;
1004
1004
  }
1005
1005
  get _root() {
@@ -1009,9 +1009,9 @@ var require_codegen = __commonJS({
1009
1009
  const ns = this._nodes;
1010
1010
  return ns[ns.length - 1];
1011
1011
  }
1012
- set _currNode(node) {
1012
+ set _currNode(node2) {
1013
1013
  const ns = this._nodes;
1014
- ns[ns.length - 1] = node;
1014
+ ns[ns.length - 1] = node2;
1015
1015
  }
1016
1016
  };
1017
1017
  exports$1.CodeGen = CodeGen;
@@ -1883,8 +1883,8 @@ var require_keyword = __commonJS({
1883
1883
  var _a3;
1884
1884
  const { gen, keyword, schema, parentSchema, $data, it } = cxt;
1885
1885
  checkAsyncKeyword(it, def);
1886
- const validate = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate;
1887
- const validateRef = useKeyword(gen, keyword, validate);
1886
+ const validate2 = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate;
1887
+ const validateRef = useKeyword(gen, keyword, validate2);
1888
1888
  const valid = gen.let("valid");
1889
1889
  cxt.block$data(valid, validateKeyword);
1890
1890
  cxt.ok((_a3 = def.valid) !== null && _a3 !== void 0 ? _a3 : valid);
@@ -1895,13 +1895,13 @@ var require_keyword = __commonJS({
1895
1895
  modifyData(cxt);
1896
1896
  reportErrs(() => cxt.error());
1897
1897
  } else {
1898
- const ruleErrs = def.async ? validateAsync() : validateSync();
1898
+ const ruleErrs = def.async ? validateAsync2() : validateSync();
1899
1899
  if (def.modifying)
1900
1900
  modifyData(cxt);
1901
1901
  reportErrs(() => addErrs(cxt, ruleErrs));
1902
1902
  }
1903
1903
  }
1904
- function validateAsync() {
1904
+ function validateAsync2() {
1905
1905
  const ruleErrs = gen.let("ruleErrs", null);
1906
1906
  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)));
1907
1907
  return ruleErrs;
@@ -2307,11 +2307,11 @@ var require_resolve = __commonJS({
2307
2307
  }
2308
2308
  return ref;
2309
2309
  }
2310
- function addAnchor(anchor) {
2311
- if (typeof anchor == "string") {
2312
- if (!ANCHOR.test(anchor))
2313
- throw new Error(`invalid anchor "${anchor}"`);
2314
- addRef.call(this, `#${anchor}`);
2310
+ function addAnchor(anchor2) {
2311
+ if (typeof anchor2 == "string") {
2312
+ if (!ANCHOR.test(anchor2))
2313
+ throw new Error(`invalid anchor "${anchor2}"`);
2314
+ addRef.call(this, `#${anchor2}`);
2315
2315
  }
2316
2316
  }
2317
2317
  });
@@ -2948,28 +2948,28 @@ var require_compile = __commonJS({
2948
2948
  if (this.opts.code.process)
2949
2949
  sourceCode = this.opts.code.process(sourceCode, sch);
2950
2950
  const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode);
2951
- const validate = makeValidate(this, this.scope.get());
2952
- this.scope.value(validateName, { ref: validate });
2953
- validate.errors = null;
2954
- validate.schema = sch.schema;
2955
- validate.schemaEnv = sch;
2951
+ const validate2 = makeValidate(this, this.scope.get());
2952
+ this.scope.value(validateName, { ref: validate2 });
2953
+ validate2.errors = null;
2954
+ validate2.schema = sch.schema;
2955
+ validate2.schemaEnv = sch;
2956
2956
  if (sch.$async)
2957
- validate.$async = true;
2957
+ validate2.$async = true;
2958
2958
  if (this.opts.code.source === true) {
2959
- validate.source = { validateName, validateCode, scopeValues: gen._values };
2959
+ validate2.source = { validateName, validateCode, scopeValues: gen._values };
2960
2960
  }
2961
2961
  if (this.opts.unevaluated) {
2962
2962
  const { props, items } = schemaCxt;
2963
- validate.evaluated = {
2963
+ validate2.evaluated = {
2964
2964
  props: props instanceof codegen_1.Name ? void 0 : props,
2965
2965
  items: items instanceof codegen_1.Name ? void 0 : items,
2966
2966
  dynamicProps: props instanceof codegen_1.Name,
2967
2967
  dynamicItems: items instanceof codegen_1.Name
2968
2968
  };
2969
- if (validate.source)
2970
- validate.source.evaluated = (0, codegen_1.stringify)(validate.evaluated);
2969
+ if (validate2.source)
2970
+ validate2.source.evaluated = (0, codegen_1.stringify)(validate2.evaluated);
2971
2971
  }
2972
- sch.validate = validate;
2972
+ sch.validate = validate2;
2973
2973
  return sch;
2974
2974
  } catch (e) {
2975
2975
  delete sch.validate;
@@ -6449,8 +6449,8 @@ var require_formats = __commonJS({
6449
6449
  "../../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/formats.js"(exports$1) {
6450
6450
  Object.defineProperty(exports$1, "__esModule", { value: true });
6451
6451
  exports$1.formatNames = exports$1.fastFormats = exports$1.fullFormats = void 0;
6452
- function fmtDef(validate, compare) {
6453
- return { validate, compare };
6452
+ function fmtDef(validate2, compare) {
6453
+ return { validate: validate2, compare };
6454
6454
  }
6455
6455
  exports$1.fullFormats = {
6456
6456
  // date: http://tools.ietf.org/html/rfc3339#section-5.6
@@ -7397,86 +7397,11 @@ function buildBridgeConfig(servers, toolsByServer, prefix = DEFAULT_TOOL_PREFIX)
7397
7397
  return { servers: serverSpecs, tools };
7398
7398
  }
7399
7399
 
7400
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
7401
- var _a;
7402
- var NEVER = /* @__PURE__ */ Object.freeze({
7403
- status: "aborted"
7404
- });
7405
- // @__NO_SIDE_EFFECTS__
7406
- function $constructor(name, initializer3, params) {
7407
- function init(inst, def) {
7408
- if (!inst._zod) {
7409
- Object.defineProperty(inst, "_zod", {
7410
- value: {
7411
- def,
7412
- constr: _,
7413
- traits: /* @__PURE__ */ new Set()
7414
- },
7415
- enumerable: false
7416
- });
7417
- }
7418
- if (inst._zod.traits.has(name)) {
7419
- return;
7420
- }
7421
- inst._zod.traits.add(name);
7422
- initializer3(inst, def);
7423
- const proto = _.prototype;
7424
- const keys = Object.keys(proto);
7425
- for (let i = 0; i < keys.length; i++) {
7426
- const k = keys[i];
7427
- if (!(k in inst)) {
7428
- inst[k] = proto[k].bind(inst);
7429
- }
7430
- }
7431
- }
7432
- const Parent = params?.Parent ?? Object;
7433
- class Definition extends Parent {
7434
- }
7435
- Object.defineProperty(Definition, "name", { value: name });
7436
- function _(def) {
7437
- var _a3;
7438
- const inst = params?.Parent ? new Definition() : this;
7439
- init(inst, def);
7440
- (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
7441
- for (const fn of inst._zod.deferred) {
7442
- fn();
7443
- }
7444
- return inst;
7445
- }
7446
- Object.defineProperty(_, "init", { value: init });
7447
- Object.defineProperty(_, Symbol.hasInstance, {
7448
- value: (inst) => {
7449
- if (params?.Parent && inst instanceof params.Parent)
7450
- return true;
7451
- return inst?._zod?.traits?.has(name);
7452
- }
7453
- });
7454
- Object.defineProperty(_, "name", { value: name });
7455
- return _;
7456
- }
7457
- var $ZodAsyncError = class extends Error {
7458
- constructor() {
7459
- super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
7460
- }
7461
- };
7462
- var $ZodEncodeError = class extends Error {
7463
- constructor(name) {
7464
- super(`Encountered unidirectional transform during encode: ${name}`);
7465
- this.name = "ZodEncodeError";
7466
- }
7467
- };
7468
- (_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});
7469
- var globalConfig = globalThis.__zod_globalConfig;
7470
- function config(newConfig) {
7471
- if (newConfig)
7472
- Object.assign(globalConfig, newConfig);
7473
- return globalConfig;
7474
- }
7475
-
7476
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
7400
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/util.js
7477
7401
  var util_exports = {};
7478
7402
  __export(util_exports, {
7479
7403
  BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
7404
+ CONSTANT_CATCH: () => CONSTANT_CATCH,
7480
7405
  Class: () => Class,
7481
7406
  NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
7482
7407
  aborted: () => aborted,
@@ -7487,6 +7412,7 @@ __export(util_exports, {
7487
7412
  assertNever: () => assertNever,
7488
7413
  assertNotEqual: () => assertNotEqual,
7489
7414
  assignProp: () => assignProp,
7415
+ attachSchema: () => attachSchema,
7490
7416
  base64ToUint8Array: () => base64ToUint8Array,
7491
7417
  base64urlToUint8Array: () => base64urlToUint8Array,
7492
7418
  cached: () => cached,
@@ -7495,8 +7421,11 @@ __export(util_exports, {
7495
7421
  cleanRegex: () => cleanRegex,
7496
7422
  clone: () => clone,
7497
7423
  cloneDef: () => cloneDef,
7424
+ codePointLength: () => codePointLength,
7425
+ constantCatch: () => constantCatch,
7498
7426
  createTransparentProxy: () => createTransparentProxy,
7499
7427
  defineLazy: () => defineLazy,
7428
+ defineLazyInternal: () => defineLazyInternal,
7500
7429
  esc: () => esc,
7501
7430
  escapeRegex: () => escapeRegex,
7502
7431
  explicitlyAborted: () => explicitlyAborted,
@@ -7509,11 +7438,14 @@ __export(util_exports, {
7509
7438
  getParsedType: () => getParsedType,
7510
7439
  getSizableOrigin: () => getSizableOrigin,
7511
7440
  hexToUint8Array: () => hexToUint8Array,
7441
+ hide: () => hide,
7442
+ installLazyProp: () => installLazyProp,
7512
7443
  isObject: () => isObject,
7513
7444
  isPlainObject: () => isPlainObject,
7514
7445
  issue: () => issue,
7515
7446
  joinValues: () => joinValues,
7516
7447
  jsonStringifyReplacer: () => jsonStringifyReplacer,
7448
+ members: () => members,
7517
7449
  merge: () => merge,
7518
7450
  mergeDefs: () => mergeDefs,
7519
7451
  normalizeParams: () => normalizeParams,
@@ -7522,6 +7454,7 @@ __export(util_exports, {
7522
7454
  objectClone: () => objectClone,
7523
7455
  omit: () => omit,
7524
7456
  optionalKeys: () => optionalKeys,
7457
+ own: () => own,
7525
7458
  parsedType: () => parsedType,
7526
7459
  partial: () => partial,
7527
7460
  pick: () => pick,
@@ -7535,6 +7468,7 @@ __export(util_exports, {
7535
7468
  shallowClone: () => shallowClone,
7536
7469
  slugify: () => slugify,
7537
7470
  stringifyPrimitive: () => stringifyPrimitive,
7471
+ toZod: () => toZod,
7538
7472
  uint8ArrayToBase64: () => uint8ArrayToBase64,
7539
7473
  uint8ArrayToBase64url: () => uint8ArrayToBase64url,
7540
7474
  uint8ArrayToHex: () => uint8ArrayToHex,
@@ -7546,6 +7480,9 @@ function assertEqual(val) {
7546
7480
  function assertNotEqual(val) {
7547
7481
  return val;
7548
7482
  }
7483
+ function toZod() {
7484
+ return (schema) => schema;
7485
+ }
7549
7486
  function assertIs(_arg) {
7550
7487
  }
7551
7488
  function assertNever(_x) {
@@ -7588,7 +7525,7 @@ function cleanRegex(source) {
7588
7525
  function floatSafeRemainder(val, step) {
7589
7526
  const ratio = val / step;
7590
7527
  const roundedRatio = Math.round(ratio);
7591
- const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);
7528
+ const tolerance = 4 * Number.EPSILON * Math.max(Math.abs(ratio), 1);
7592
7529
  if (Math.abs(ratio - roundedRatio) < tolerance)
7593
7530
  return 0;
7594
7531
  return ratio - roundedRatio;
@@ -7844,16 +7781,16 @@ function stringifyPrimitive(value) {
7844
7781
  }
7845
7782
  function optionalKeys(shape) {
7846
7783
  return Object.keys(shape).filter((k) => {
7847
- return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
7784
+ return shape[k]._zod.optin !== void 0 && shape[k]._zod.optout === "optional";
7848
7785
  });
7849
7786
  }
7850
- var NUMBER_FORMAT_RANGES = {
7787
+ var NUMBER_FORMAT_RANGES = /* @__PURE__ */ (() => ({
7851
7788
  safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
7852
7789
  int32: [-2147483648, 2147483647],
7853
7790
  uint32: [0, 4294967295],
7854
7791
  float32: [-34028234663852886e22, 34028234663852886e22],
7855
7792
  float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
7856
- };
7793
+ }))();
7857
7794
  var BIGINT_FORMAT_RANGES = {
7858
7795
  int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")],
7859
7796
  uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
@@ -7868,13 +7805,13 @@ function pick(schema, mask) {
7868
7805
  const def = mergeDefs(schema._zod.def, {
7869
7806
  get shape() {
7870
7807
  const newShape = {};
7871
- for (const key in mask) {
7872
- if (!(key in currDef.shape)) {
7873
- throw new Error(`Unrecognized key: "${key}"`);
7808
+ for (const key of Reflect.ownKeys(mask)) {
7809
+ if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
7810
+ throw new Error(`Unrecognized key: "${String(key)}"`);
7874
7811
  }
7875
7812
  if (!mask[key])
7876
7813
  continue;
7877
- newShape[key] = currDef.shape[key];
7814
+ assignProp(newShape, key, currDef.shape[key]);
7878
7815
  }
7879
7816
  assignProp(this, "shape", newShape);
7880
7817
  return newShape;
@@ -7893,9 +7830,9 @@ function omit(schema, mask) {
7893
7830
  const def = mergeDefs(schema._zod.def, {
7894
7831
  get shape() {
7895
7832
  const newShape = { ...schema._zod.def.shape };
7896
- for (const key in mask) {
7897
- if (!(key in currDef.shape)) {
7898
- throw new Error(`Unrecognized key: "${key}"`);
7833
+ for (const key of Reflect.ownKeys(mask)) {
7834
+ if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
7835
+ throw new Error(`Unrecognized key: "${String(key)}"`);
7899
7836
  }
7900
7837
  if (!mask[key])
7901
7838
  continue;
@@ -7916,7 +7853,7 @@ function extend(schema, shape) {
7916
7853
  const hasChecks = checks && checks.length > 0;
7917
7854
  if (hasChecks) {
7918
7855
  const existingShape = schema._zod.def.shape;
7919
- for (const key in shape) {
7856
+ for (const key of Reflect.ownKeys(shape)) {
7920
7857
  if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) {
7921
7858
  throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
7922
7859
  }
@@ -7945,6 +7882,9 @@ function safeExtend(schema, shape) {
7945
7882
  return clone(schema, def);
7946
7883
  }
7947
7884
  function merge(a, b) {
7885
+ if (!b?._zod?.def) {
7886
+ throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");
7887
+ }
7948
7888
  if (a._zod.def.checks?.length) {
7949
7889
  throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
7950
7890
  }
@@ -7961,21 +7901,21 @@ function merge(a, b) {
7961
7901
  });
7962
7902
  return clone(a, def);
7963
7903
  }
7964
- function partial(Class2, schema, mask) {
7904
+ function partial(Class2, schema, mask, name = "partial") {
7965
7905
  const currDef = schema._zod.def;
7966
7906
  const checks = currDef.checks;
7967
7907
  const hasChecks = checks && checks.length > 0;
7968
7908
  if (hasChecks) {
7969
- throw new Error(".partial() cannot be used on object schemas containing refinements");
7909
+ throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
7970
7910
  }
7971
7911
  const def = mergeDefs(schema._zod.def, {
7972
7912
  get shape() {
7973
7913
  const oldShape = schema._zod.def.shape;
7974
7914
  const shape = { ...oldShape };
7975
7915
  if (mask) {
7976
- for (const key in mask) {
7977
- if (!(key in oldShape)) {
7978
- throw new Error(`Unrecognized key: "${key}"`);
7916
+ for (const key of Reflect.ownKeys(mask)) {
7917
+ if (!Object.prototype.hasOwnProperty.call(oldShape, key)) {
7918
+ throw new Error(`Unrecognized key: "${String(key)}"`);
7979
7919
  }
7980
7920
  if (!mask[key])
7981
7921
  continue;
@@ -7985,7 +7925,7 @@ function partial(Class2, schema, mask) {
7985
7925
  }) : oldShape[key];
7986
7926
  }
7987
7927
  } else {
7988
- for (const key in oldShape) {
7928
+ for (const key of Reflect.ownKeys(oldShape)) {
7989
7929
  shape[key] = Class2 ? new Class2({
7990
7930
  type: "optional",
7991
7931
  innerType: oldShape[key]
@@ -8005,9 +7945,9 @@ function required(Class2, schema, mask) {
8005
7945
  const oldShape = schema._zod.def.shape;
8006
7946
  const shape = { ...oldShape };
8007
7947
  if (mask) {
8008
- for (const key in mask) {
8009
- if (!(key in shape)) {
8010
- throw new Error(`Unrecognized key: "${key}"`);
7948
+ for (const key of Reflect.ownKeys(mask)) {
7949
+ if (!Object.prototype.hasOwnProperty.call(shape, key)) {
7950
+ throw new Error(`Unrecognized key: "${String(key)}"`);
8011
7951
  }
8012
7952
  if (!mask[key])
8013
7953
  continue;
@@ -8017,7 +7957,7 @@ function required(Class2, schema, mask) {
8017
7957
  });
8018
7958
  }
8019
7959
  } else {
8020
- for (const key in oldShape) {
7960
+ for (const key of Reflect.ownKeys(oldShape)) {
8021
7961
  shape[key] = new Class2({
8022
7962
  type: "nonoptional",
8023
7963
  innerType: oldShape[key]
@@ -8061,9 +8001,24 @@ function prefixIssues(path, issues) {
8061
8001
  function unwrapMessage(message) {
8062
8002
  return typeof message === "string" ? message : message?.message;
8063
8003
  }
8004
+ function attachSchema(issues, start, inst) {
8005
+ var _a3;
8006
+ for (let i = start; i < issues.length; i++) {
8007
+ (_a3 = issues[i]).schema ?? (_a3.schema = inst);
8008
+ }
8009
+ }
8064
8010
  function finalizeIssue(iss, ctx, config2) {
8065
- 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";
8066
- const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
8011
+ var _a3;
8012
+ const traits = iss.inst?._zod?.traits;
8013
+ if (traits?.has("$ZodType")) {
8014
+ if (traits.has("$ZodCheck"))
8015
+ (_a3 = iss).schema ?? (_a3.schema = iss.inst);
8016
+ else
8017
+ iss.schema = iss.inst;
8018
+ }
8019
+ const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : void 0;
8020
+ 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";
8021
+ const { inst: _inst, schema: _schema, continue: _continue, input: _input, ...rest } = iss;
8067
8022
  rest.path ?? (rest.path = []);
8068
8023
  rest.message = message;
8069
8024
  if (ctx?.reportInput) {
@@ -8080,6 +8035,20 @@ function getSizableOrigin(input) {
8080
8035
  return "file";
8081
8036
  return "unknown";
8082
8037
  }
8038
+ var highSurrogate = /[\uD800-\uDBFF]/;
8039
+ function codePointLength(str) {
8040
+ const units = str.length;
8041
+ if (!highSurrogate.test(str))
8042
+ return units;
8043
+ let count = units;
8044
+ for (let i = 0; i < units - 1; i++) {
8045
+ if ((str.charCodeAt(i) & 64512) === 55296 && (str.charCodeAt(i + 1) & 64512) === 56320) {
8046
+ count--;
8047
+ i++;
8048
+ }
8049
+ }
8050
+ return count;
8051
+ }
8083
8052
  function getLengthableOrigin(input) {
8084
8053
  if (Array.isArray(input))
8085
8054
  return "array";
@@ -8166,33 +8135,289 @@ var Class = class {
8166
8135
  constructor(..._args) {
8167
8136
  }
8168
8137
  };
8169
-
8170
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
8171
- var initializer = (inst, def) => {
8172
- inst.name = "$ZodError";
8173
- Object.defineProperty(inst, "_zod", {
8174
- value: inst._zod,
8175
- enumerable: false
8138
+ function members(proto, table) {
8139
+ for (const key in table) {
8140
+ const desc = Object.getOwnPropertyDescriptor(table, key);
8141
+ if (desc.get)
8142
+ Object.defineProperty(proto, key, { ...desc, enumerable: false });
8143
+ else
8144
+ defineBound(proto, key, desc.value);
8145
+ }
8146
+ }
8147
+ function own(inst, key, value, enumerable = true) {
8148
+ Object.defineProperty(inst, key, { configurable: true, writable: true, enumerable, value });
8149
+ return value;
8150
+ }
8151
+ function hide(inst, key, value) {
8152
+ return own(inst, key, value, false);
8153
+ }
8154
+ function defineBound(proto, key, fn) {
8155
+ Object.defineProperty(proto, key, {
8156
+ configurable: true,
8157
+ get() {
8158
+ return this == null ? fn : own(this, key, fn.bind(this));
8159
+ },
8160
+ set(value) {
8161
+ own(this, key, value);
8162
+ }
8163
+ });
8164
+ }
8165
+ function claim(inst, sentinel) {
8166
+ const proto = Object.getPrototypeOf(inst);
8167
+ return sentinel in proto ? void 0 : proto;
8168
+ }
8169
+ var installing;
8170
+ var broke = false;
8171
+ var breaker = {
8172
+ configurable: true,
8173
+ get() {
8174
+ broke = true;
8175
+ return void 0;
8176
+ }
8177
+ };
8178
+ function defineLazyInternal(inst, key, compute) {
8179
+ const proto = Object.getPrototypeOf(inst._zod);
8180
+ if (key in proto && installing !== inst._zod) {
8181
+ installing = void 0;
8182
+ return;
8183
+ }
8184
+ installing = inst._zod;
8185
+ Object.defineProperty(proto, key, {
8186
+ configurable: true,
8187
+ get() {
8188
+ Object.defineProperty(this, key, breaker);
8189
+ const outer = broke;
8190
+ broke = false;
8191
+ try {
8192
+ const value = compute(this);
8193
+ if (broke)
8194
+ delete this[key];
8195
+ else
8196
+ Object.defineProperty(this, key, { configurable: true, writable: true, value });
8197
+ broke = broke || outer;
8198
+ return value;
8199
+ } catch (err) {
8200
+ delete this[key];
8201
+ broke = broke || outer;
8202
+ throw err;
8203
+ }
8204
+ },
8205
+ set(value) {
8206
+ Object.defineProperty(this, key, { configurable: true, writable: true, value });
8207
+ }
8176
8208
  });
8177
- Object.defineProperty(inst, "issues", {
8178
- value: def,
8179
- enumerable: false
8209
+ }
8210
+ function installLazyProp(inst, key, make, enumerable) {
8211
+ const proto = claim(inst, key);
8212
+ if (!proto)
8213
+ return;
8214
+ Object.defineProperty(proto, key, {
8215
+ configurable: true,
8216
+ get() {
8217
+ const desc = { configurable: true, writable: true, enumerable, value: void 0 };
8218
+ Object.defineProperty(this, key, desc);
8219
+ desc.value = make(this);
8220
+ Object.defineProperty(this, key, desc);
8221
+ return desc.value;
8222
+ },
8223
+ set(value) {
8224
+ Object.defineProperty(this, key, { configurable: true, writable: true, enumerable, value });
8225
+ }
8180
8226
  });
8181
- inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
8182
- Object.defineProperty(inst, "toString", {
8183
- value: () => inst.message,
8184
- enumerable: false
8227
+ }
8228
+ var CONSTANT_CATCH = "~constantCatch";
8229
+ function constantCatch(value) {
8230
+ const fn = () => value;
8231
+ fn[CONSTANT_CATCH] = true;
8232
+ return fn;
8233
+ }
8234
+
8235
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/core.js
8236
+ var _a;
8237
+ var NEVER = /* @__PURE__ */ Object.freeze({
8238
+ status: "aborted"
8239
+ });
8240
+ var _zodDesc = { value: void 0, enumerable: false };
8241
+ var _E = "captureStackTrace" in Error ? Error : null;
8242
+ function newError(Definition) {
8243
+ const E = _E;
8244
+ if (E) {
8245
+ const saved = E.stackTraceLimit;
8246
+ if (typeof saved === "number") {
8247
+ try {
8248
+ E.stackTraceLimit = 0;
8249
+ } catch {
8250
+ _E = null;
8251
+ return new Definition();
8252
+ }
8253
+ try {
8254
+ return new Definition();
8255
+ } finally {
8256
+ E.stackTraceLimit = saved;
8257
+ }
8258
+ }
8259
+ }
8260
+ return new Definition();
8261
+ }
8262
+ // @__NO_SIDE_EFFECTS__
8263
+ function $constructor(name, initializer3, proto, params) {
8264
+ const zodProto = {};
8265
+ function Internals(def) {
8266
+ this.def = def;
8267
+ this.constr = _;
8268
+ this.traits = /* @__PURE__ */ new Set();
8269
+ }
8270
+ Internals.prototype = zodProto;
8271
+ const protoMembers = proto;
8272
+ const initialized = protoMembers && /* @__PURE__ */ new WeakSet();
8273
+ function init(inst, def) {
8274
+ if (!inst._zod) {
8275
+ _zodDesc.value = new Internals(def);
8276
+ try {
8277
+ Object.defineProperty(inst, "_zod", _zodDesc);
8278
+ } finally {
8279
+ _zodDesc.value = void 0;
8280
+ }
8281
+ }
8282
+ if (inst._zod.traits.has(name)) {
8283
+ return;
8284
+ }
8285
+ inst._zod.traits.add(name);
8286
+ initializer3(inst, def);
8287
+ if (initialized) {
8288
+ const own2 = Object.getPrototypeOf(inst);
8289
+ const ctorProto = inst._zod.constr.prototype;
8290
+ let up = own2;
8291
+ while (up && up !== ctorProto)
8292
+ up = Object.getPrototypeOf(up);
8293
+ const target = up ?? own2;
8294
+ if (!initialized.has(target)) {
8295
+ initialized.add(target);
8296
+ members(target, protoMembers);
8297
+ }
8298
+ }
8299
+ const proto2 = _.prototype;
8300
+ for (const k in proto2) {
8301
+ if (!Object.prototype.hasOwnProperty.call(proto2, k))
8302
+ continue;
8303
+ if (!(k in inst)) {
8304
+ inst[k] = proto2[k].bind(inst);
8305
+ }
8306
+ }
8307
+ }
8308
+ const Parent = params?.Parent ?? Object;
8309
+ class Definition extends Parent {
8310
+ }
8311
+ Object.defineProperty(Definition, "name", { value: name });
8312
+ function _(def) {
8313
+ const inst = params?.Parent ? newError(Definition) : this;
8314
+ init(inst, def);
8315
+ const deferred = inst._zod.deferred;
8316
+ if (deferred) {
8317
+ for (const fn of deferred) {
8318
+ fn();
8319
+ }
8320
+ inst._zod.deferred = void 0;
8321
+ }
8322
+ const pp = globalThis.__zod_globalConfig?.postProcessor;
8323
+ if (pp)
8324
+ pp(inst);
8325
+ return inst;
8326
+ }
8327
+ Object.defineProperty(_, "init", { value: init });
8328
+ Object.defineProperty(_, Symbol.hasInstance, {
8329
+ value: (inst) => {
8330
+ if (params?.Parent && inst instanceof params.Parent)
8331
+ return true;
8332
+ return inst?._zod?.traits?.has(name);
8333
+ }
8185
8334
  });
8335
+ Object.defineProperty(_, "name", { value: name });
8336
+ return _;
8337
+ }
8338
+ var $ZodAsyncError = class extends Error {
8339
+ constructor() {
8340
+ super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
8341
+ }
8342
+ };
8343
+ var $ZodEncodeError = class extends Error {
8344
+ constructor(name) {
8345
+ super(`Encountered unidirectional transform during encode: ${name}`);
8346
+ this.name = "ZodEncodeError";
8347
+ }
8348
+ };
8349
+ (_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});
8350
+ var globalConfig = globalThis.__zod_globalConfig;
8351
+ function config(newConfig) {
8352
+ if (newConfig)
8353
+ Object.assign(globalConfig, newConfig);
8354
+ return globalConfig;
8355
+ }
8356
+
8357
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/errors.js
8358
+ function _getMessage() {
8359
+ const internals = this._zod;
8360
+ internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
8361
+ return internals.message;
8362
+ }
8363
+ function _setMessage(value) {
8364
+ this._zod.message = value;
8365
+ }
8366
+ var _messageDesc = {
8367
+ get: _getMessage,
8368
+ set: _setMessage,
8369
+ enumerable: true,
8370
+ configurable: true
8371
+ };
8372
+ var _zodDesc2 = { value: void 0, enumerable: false };
8373
+ var _issuesDesc = { value: void 0, enumerable: false };
8374
+ var _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
8375
+ var initializer = (inst, def) => {
8376
+ inst.name = "$ZodError";
8377
+ _zodDesc2.value = inst._zod;
8378
+ Object.defineProperty(inst, "_zod", _zodDesc2);
8379
+ _issuesDesc.value = def;
8380
+ Object.defineProperty(inst, "issues", _issuesDesc);
8381
+ _zodDesc2.value = void 0;
8382
+ _issuesDesc.value = void 0;
8383
+ Object.defineProperty(inst, "message", _messageDesc);
8384
+ const proto = Object.getPrototypeOf(inst);
8385
+ if (!_installedToString.has(proto)) {
8386
+ _installedToString.add(proto);
8387
+ Object.defineProperty(proto, "toString", {
8388
+ configurable: true,
8389
+ enumerable: false,
8390
+ get() {
8391
+ const value = () => this.message;
8392
+ Object.defineProperty(this, "toString", { value, configurable: true, writable: true });
8393
+ return value;
8394
+ },
8395
+ set(value) {
8396
+ Object.defineProperty(this, "toString", { value, configurable: true, writable: true });
8397
+ }
8398
+ });
8399
+ }
8186
8400
  };
8187
8401
  var $ZodError = $constructor("$ZodError", initializer);
8188
- var $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
8402
+ var $ZodRealError = $constructor("$ZodError", initializer, void 0, {
8403
+ Parent: Error
8404
+ });
8405
+ function node(obj, key, make) {
8406
+ if (!Object.prototype.hasOwnProperty.call(obj, key)) {
8407
+ if (key === "__proto__") {
8408
+ Object.defineProperty(obj, key, { value: make(), writable: true, enumerable: true, configurable: true });
8409
+ } else {
8410
+ obj[key] = make();
8411
+ }
8412
+ }
8413
+ return obj[key];
8414
+ }
8189
8415
  function flattenError(error2, mapper = (issue2) => issue2.message) {
8190
8416
  const fieldErrors = {};
8191
8417
  const formErrors = [];
8192
8418
  for (const sub of error2.issues) {
8193
8419
  if (sub.path.length > 0) {
8194
- fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
8195
- fieldErrors[sub.path[0]].push(mapper(sub));
8420
+ node(fieldErrors, sub.path[0], () => []).push(mapper(sub));
8196
8421
  } else {
8197
8422
  formErrors.push(mapper(sub));
8198
8423
  }
@@ -8219,13 +8444,25 @@ function formatError(error2, mapper = (issue2) => issue2.message) {
8219
8444
  while (i < fullpath.length) {
8220
8445
  const el = fullpath[i];
8221
8446
  const terminal = i === fullpath.length - 1;
8222
- if (!terminal) {
8223
- curr[el] = curr[el] || { _errors: [] };
8224
- } else {
8225
- curr[el] = curr[el] || { _errors: [] };
8226
- curr[el]._errors.push(mapper(issue2));
8447
+ if (el === "_errors") {
8448
+ if (terminal)
8449
+ curr._errors.push(mapper(issue2));
8450
+ i++;
8451
+ continue;
8227
8452
  }
8228
- curr = curr[el];
8453
+ if (!Object.prototype.hasOwnProperty.call(curr, el)) {
8454
+ Object.defineProperty(curr, el, {
8455
+ value: { _errors: [] },
8456
+ enumerable: true,
8457
+ writable: true,
8458
+ configurable: true
8459
+ });
8460
+ }
8461
+ const node2 = curr[el];
8462
+ if (terminal) {
8463
+ node2._errors.push(mapper(issue2));
8464
+ }
8465
+ curr = node2;
8229
8466
  i++;
8230
8467
  }
8231
8468
  }
@@ -8236,31 +8473,40 @@ function formatError(error2, mapper = (issue2) => issue2.message) {
8236
8473
  return fieldErrors;
8237
8474
  }
8238
8475
 
8239
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
8240
- var _parse = (_Err) => (schema, value, _ctx, _params) => {
8241
- const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
8242
- const result = schema._zod.run({ value, issues: [] }, ctx);
8243
- if (result instanceof Promise) {
8244
- throw new $ZodAsyncError();
8245
- }
8246
- if (result.issues.length) {
8247
- const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
8248
- captureStackTrace(e, _params?.callee);
8249
- throw e;
8250
- }
8251
- return result.value;
8476
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/parse.js
8477
+ function finalizeParams(callee, params) {
8478
+ return { callee: params?.callee ?? callee, Err: params?.Err };
8479
+ }
8480
+ var _parse = (_Err) => {
8481
+ const fn = (schema, value, _ctx, _params) => {
8482
+ const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
8483
+ const result = schema._zod.run({ value, issues: [] }, ctx);
8484
+ if (result instanceof Promise) {
8485
+ throw new $ZodAsyncError();
8486
+ }
8487
+ if (result.issues.length) {
8488
+ const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
8489
+ captureStackTrace(e, _params?.callee ?? fn);
8490
+ throw e;
8491
+ }
8492
+ return result.value;
8493
+ };
8494
+ return fn;
8252
8495
  };
8253
- var _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
8254
- const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
8255
- let result = schema._zod.run({ value, issues: [] }, ctx);
8256
- if (result instanceof Promise)
8257
- result = await result;
8258
- if (result.issues.length) {
8259
- const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
8260
- captureStackTrace(e, params?.callee);
8261
- throw e;
8262
- }
8263
- return result.value;
8496
+ var _parseAsync = (_Err) => {
8497
+ const fn = async (schema, value, _ctx, params) => {
8498
+ const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
8499
+ let result = schema._zod.run({ value, issues: [] }, ctx);
8500
+ if (result instanceof Promise)
8501
+ result = await result;
8502
+ if (result.issues.length) {
8503
+ const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
8504
+ captureStackTrace(e, params?.callee ?? fn);
8505
+ throw e;
8506
+ }
8507
+ return result.value;
8508
+ };
8509
+ return fn;
8264
8510
  };
8265
8511
  var _safeParse = (_Err) => (schema, value, _ctx) => {
8266
8512
  const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
@@ -8285,19 +8531,35 @@ var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
8285
8531
  } : { success: true, data: result.value };
8286
8532
  };
8287
8533
  var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
8288
- var _encode = (_Err) => (schema, value, _ctx) => {
8289
- const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
8290
- return _parse(_Err)(schema, value, ctx);
8534
+ var _encode = (_Err) => {
8535
+ const parse3 = _parse(_Err);
8536
+ const fn = (schema, value, _ctx, _params) => {
8537
+ const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
8538
+ return parse3(schema, value, ctx, finalizeParams(fn, _params));
8539
+ };
8540
+ return fn;
8291
8541
  };
8292
- var _decode = (_Err) => (schema, value, _ctx) => {
8293
- return _parse(_Err)(schema, value, _ctx);
8542
+ var _decode = (_Err) => {
8543
+ const parse3 = _parse(_Err);
8544
+ const fn = (schema, value, _ctx, _params) => {
8545
+ return parse3(schema, value, _ctx, finalizeParams(fn, _params));
8546
+ };
8547
+ return fn;
8294
8548
  };
8295
- var _encodeAsync = (_Err) => async (schema, value, _ctx) => {
8296
- const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
8297
- return _parseAsync(_Err)(schema, value, ctx);
8549
+ var _encodeAsync = (_Err) => {
8550
+ const parseAsync3 = _parseAsync(_Err);
8551
+ const fn = async (schema, value, _ctx, _params) => {
8552
+ const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
8553
+ return await parseAsync3(schema, value, ctx, finalizeParams(fn, _params));
8554
+ };
8555
+ return fn;
8298
8556
  };
8299
- var _decodeAsync = (_Err) => async (schema, value, _ctx) => {
8300
- return _parseAsync(_Err)(schema, value, _ctx);
8557
+ var _decodeAsync = (_Err) => {
8558
+ const parseAsync3 = _parseAsync(_Err);
8559
+ const fn = async (schema, value, _ctx, _params) => {
8560
+ return await parseAsync3(schema, value, _ctx, finalizeParams(fn, _params));
8561
+ };
8562
+ return fn;
8301
8563
  };
8302
8564
  var _safeEncode = (_Err) => (schema, value, _ctx) => {
8303
8565
  const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
@@ -8314,13 +8576,16 @@ var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
8314
8576
  return _safeParseAsync(_Err)(schema, value, _ctx);
8315
8577
  };
8316
8578
 
8317
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.js
8579
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/regexes.js
8318
8580
  var cuid = /^[cC][0-9a-z]{6,}$/;
8319
8581
  var cuid2 = /^[0-9a-z]+$/;
8320
- var ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
8582
+ var ulid = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/;
8321
8583
  var xid = /^[0-9a-vA-V]{20}$/;
8322
8584
  var ksuid = /^[A-Za-z0-9]{27}$/;
8323
8585
  var nanoid = /^[a-zA-Z0-9_-]{21}$/;
8586
+ function nanoidOfLength(length) {
8587
+ return new RegExp(`^[a-zA-Z0-9_-]{${length}}$`);
8588
+ }
8324
8589
  var duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
8325
8590
  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})$/;
8326
8591
  var uuid = (version2) => {
@@ -8329,36 +8594,37 @@ var uuid = (version2) => {
8329
8594
  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})$`);
8330
8595
  };
8331
8596
  var email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
8332
- var _emoji = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
8597
+ var _emoji = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
8333
8598
  function emoji() {
8334
8599
  return new RegExp(_emoji, "u");
8335
8600
  }
8336
8601
  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])$/;
8337
8602
  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}|:))$/;
8338
8603
  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])$/;
8339
- 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])$/;
8604
+ 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])$/;
8340
8605
  var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
8341
8606
  var base64url = /^[A-Za-z0-9_-]*$/;
8342
8607
  var httpProtocol = /^https?$/;
8343
8608
  var e164 = /^\+[1-9]\d{6,14}$/;
8344
8609
  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])))`;
8345
- var date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
8610
+ function anchor(source) {
8611
+ return new RegExp(`^${source}$`);
8612
+ }
8613
+ var date = /* @__PURE__ */ anchor(dateSource);
8346
8614
  function timeSource(args) {
8347
8615
  const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
8348
- 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+)?)?`;
8616
+ 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+)?)?`;
8349
8617
  return regex;
8350
8618
  }
8351
8619
  function time(args) {
8352
8620
  return new RegExp(`^${timeSource(args)}$`);
8353
8621
  }
8354
8622
  function datetime(args) {
8355
- const time3 = timeSource({ precision: args.precision });
8356
8623
  const opts = ["Z"];
8357
- if (args.local)
8358
- opts.push("");
8359
8624
  if (args.offset)
8360
8625
  opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
8361
- const timeRegex = `${time3}(?:${opts.join("|")})`;
8626
+ const qualified = `${timeSource({ precision: args.precision, seconds: true })}(?:${opts.join("|")})`;
8627
+ const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;
8362
8628
  return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
8363
8629
  }
8364
8630
  var string = (params) => {
@@ -8373,13 +8639,17 @@ var _null = /^null$/i;
8373
8639
  var lowercase = /^[^A-Z]*$/;
8374
8640
  var uppercase = /^[^a-z]*$/;
8375
8641
 
8376
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.js
8642
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/checks.js
8377
8643
  var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
8378
8644
  var _a3;
8379
8645
  inst._zod ?? (inst._zod = {});
8380
8646
  inst._zod.def = def;
8381
8647
  (_a3 = inst._zod).onattach ?? (_a3.onattach = []);
8382
8648
  });
8649
+ var _whenHasLength = (payload) => {
8650
+ const val = payload.value;
8651
+ return !nullish(val) && val.length !== void 0;
8652
+ };
8383
8653
  var numericOriginMap = {
8384
8654
  number: "number",
8385
8655
  bigint: "bigint",
@@ -8403,7 +8673,7 @@ var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst,
8403
8673
  return;
8404
8674
  }
8405
8675
  payload.issues.push({
8406
- origin,
8676
+ origin: numericOriginMap[typeof payload.value] ?? origin,
8407
8677
  code: "too_big",
8408
8678
  maximum: typeof def.value === "object" ? def.value.getTime() : def.value,
8409
8679
  input: payload.value,
@@ -8431,7 +8701,7 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
8431
8701
  return;
8432
8702
  }
8433
8703
  payload.issues.push({
8434
- origin,
8704
+ origin: numericOriginMap[typeof payload.value] ?? origin,
8435
8705
  code: "too_small",
8436
8706
  minimum: typeof def.value === "object" ? def.value.getTime() : def.value,
8437
8707
  input: payload.value,
@@ -8450,7 +8720,10 @@ var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (i
8450
8720
  inst._zod.check = (payload) => {
8451
8721
  if (typeof payload.value !== typeof def.value)
8452
8722
  throw new Error("Cannot mix number and bigint in multiple_of check.");
8453
- const isMultiple = typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0;
8723
+ const isMultiple = typeof payload.value === "bigint" ? (
8724
+ // `value % 0n` throws, and nothing is a multiple of zero — the number branch already fails this way via NaN
8725
+ def.value !== BigInt(0) && payload.value % def.value === BigInt(0)
8726
+ ) : floatSafeRemainder(payload.value, def.value) === 0;
8454
8727
  if (isMultiple)
8455
8728
  return;
8456
8729
  payload.issues.push({
@@ -8545,10 +8818,7 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
8545
8818
  var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
8546
8819
  var _a3;
8547
8820
  $ZodCheck.init(inst, def);
8548
- (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
8549
- const val = payload.value;
8550
- return !nullish(val) && val.length !== void 0;
8551
- });
8821
+ (_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
8552
8822
  inst._zod.onattach.push((inst2) => {
8553
8823
  const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
8554
8824
  if (def.maximum < curr)
@@ -8556,7 +8826,8 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
8556
8826
  });
8557
8827
  inst._zod.check = (payload) => {
8558
8828
  const input = payload.value;
8559
- const length = input.length;
8829
+ const units = input.length;
8830
+ const length = typeof input === "string" && units > def.maximum ? codePointLength(input) : units;
8560
8831
  if (length <= def.maximum)
8561
8832
  return;
8562
8833
  const origin = getLengthableOrigin(input);
@@ -8574,10 +8845,7 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
8574
8845
  var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
8575
8846
  var _a3;
8576
8847
  $ZodCheck.init(inst, def);
8577
- (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
8578
- const val = payload.value;
8579
- return !nullish(val) && val.length !== void 0;
8580
- });
8848
+ (_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
8581
8849
  inst._zod.onattach.push((inst2) => {
8582
8850
  const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
8583
8851
  if (def.minimum > curr)
@@ -8585,7 +8853,8 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
8585
8853
  });
8586
8854
  inst._zod.check = (payload) => {
8587
8855
  const input = payload.value;
8588
- const length = input.length;
8856
+ const units = input.length;
8857
+ const length = typeof input === "string" && units >= def.minimum && units < def.minimum * 2 ? codePointLength(input) : units;
8589
8858
  if (length >= def.minimum)
8590
8859
  return;
8591
8860
  const origin = getLengthableOrigin(input);
@@ -8603,10 +8872,7 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
8603
8872
  var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
8604
8873
  var _a3;
8605
8874
  $ZodCheck.init(inst, def);
8606
- (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
8607
- const val = payload.value;
8608
- return !nullish(val) && val.length !== void 0;
8609
- });
8875
+ (_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
8610
8876
  inst._zod.onattach.push((inst2) => {
8611
8877
  const bag = inst2._zod.bag;
8612
8878
  bag.minimum = def.length;
@@ -8615,7 +8881,8 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
8615
8881
  });
8616
8882
  inst._zod.check = (payload) => {
8617
8883
  const input = payload.value;
8618
- const length = input.length;
8884
+ const units = input.length;
8885
+ const length = typeof input === "string" && units >= def.length && units <= def.length * 2 ? codePointLength(input) : units;
8619
8886
  if (length === def.length)
8620
8887
  return;
8621
8888
  const origin = getLengthableOrigin(input);
@@ -8689,7 +8956,7 @@ var $ZodCheckUpperCase = /* @__PURE__ */ $constructor("$ZodCheckUpperCase", (ins
8689
8956
  var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst, def) => {
8690
8957
  $ZodCheck.init(inst, def);
8691
8958
  const escapedRegex = escapeRegex(def.includes);
8692
- const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
8959
+ const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
8693
8960
  def.pattern = pattern;
8694
8961
  inst._zod.onattach.push((inst2) => {
8695
8962
  const bag = inst2._zod.bag;
@@ -8763,13 +9030,13 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
8763
9030
  };
8764
9031
  });
8765
9032
 
8766
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/doc.js
9033
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/doc.js
8767
9034
  var Doc = class {
8768
- constructor(args = []) {
9035
+ constructor(args = [], closed = {}) {
8769
9036
  this.content = [];
8770
9037
  this.indent = 0;
8771
- if (this)
8772
- this.args = args;
9038
+ this.args = args;
9039
+ this.closed = closed;
8773
9040
  }
8774
9041
  indented(fn) {
8775
9042
  this.indent += 1;
@@ -8792,31 +9059,30 @@ var Doc = class {
8792
9059
  }
8793
9060
  compile() {
8794
9061
  const F = Function;
8795
- const args = this?.args;
8796
9062
  const content = this?.content ?? [``];
8797
- const lines = [...content.map((x) => ` ${x}`)];
8798
- return new F(...args, lines.join("\n"));
9063
+ const factory = new F(...Object.keys(this.closed), `return function (${this.args.join(", ")}) {
9064
+ ${content.join("\n")}
9065
+ };`);
9066
+ return factory(...Object.values(this.closed));
8799
9067
  }
8800
9068
  };
8801
9069
 
8802
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.js
9070
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/versions.js
8803
9071
  var version = {
8804
9072
  major: 4,
8805
- minor: 4,
8806
- patch: 3
9073
+ minor: 5,
9074
+ patch: 4
8807
9075
  };
8808
9076
 
8809
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.js
9077
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/schemas.js
8810
9078
  var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
8811
9079
  var _a3;
8812
9080
  inst ?? (inst = {});
8813
9081
  inst._zod.def = def;
8814
9082
  inst._zod.bag = inst._zod.bag || {};
8815
9083
  inst._zod.version = version;
8816
- const checks = [...inst._zod.def.checks ?? []];
8817
- if (inst._zod.traits.has("$ZodCheck")) {
8818
- checks.unshift(inst);
8819
- }
9084
+ const defChecks = inst._zod.def.checks;
9085
+ const checks = inst._zod.traits.has("$ZodCheck") ? [inst, ...defChecks ?? []] : defChecks?.length ? [...defChecks] : [];
8820
9086
  for (const ch of checks) {
8821
9087
  for (const fn of ch._zod.onattach) {
8822
9088
  fn(inst);
@@ -8829,6 +9095,8 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
8829
9095
  });
8830
9096
  } else {
8831
9097
  const runChecks = (payload, checks2, ctx) => {
9098
+ if (payload.memo)
9099
+ return payload;
8832
9100
  let isAborted = aborted(payload);
8833
9101
  let asyncResult;
8834
9102
  for (const ch of checks2) {
@@ -8852,6 +9120,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
8852
9120
  const nextLen = payload.issues.length;
8853
9121
  if (nextLen === currLen)
8854
9122
  return;
9123
+ attachSchema(payload.issues, currLen, inst);
8855
9124
  if (!isAborted)
8856
9125
  isAborted = aborted(payload, currLen);
8857
9126
  });
@@ -8859,6 +9128,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
8859
9128
  const nextLen = payload.issues.length;
8860
9129
  if (nextLen === currLen)
8861
9130
  continue;
9131
+ attachSchema(payload.issues, currLen, inst);
8862
9132
  if (!isAborted)
8863
9133
  isAborted = aborted(payload, currLen);
8864
9134
  }
@@ -8905,19 +9175,29 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
8905
9175
  return runChecks(result, checks, ctx);
8906
9176
  };
8907
9177
  }
8908
- defineLazy(inst, "~standard", () => ({
9178
+ }, {
9179
+ // Wrappers extend this by installing a richer factory over it; reading it eagerly would defeat the laziness.
9180
+ get "~standard"() {
9181
+ return hide(this, "~standard", standardProps(this));
9182
+ },
9183
+ set "~standard"(value) {
9184
+ own(this, "~standard", value);
9185
+ }
9186
+ });
9187
+ var toStandardResult = (r) => r.success ? { value: r.data } : { issues: r.error?.issues };
9188
+ function standardProps(inst) {
9189
+ return {
8909
9190
  validate: (value) => {
8910
9191
  try {
8911
- const r = safeParse(inst, value);
8912
- return r.success ? { value: r.data } : { issues: r.error?.issues };
9192
+ return toStandardResult(safeParse(inst, value));
8913
9193
  } catch (_) {
8914
- return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
9194
+ return safeParseAsync(inst, value).then(toStandardResult);
8915
9195
  }
8916
9196
  },
8917
9197
  vendor: "zod",
8918
9198
  version: 1
8919
- }));
8920
- });
9199
+ };
9200
+ }
8921
9201
  var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
8922
9202
  $ZodType.init(inst, def);
8923
9203
  inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string(inst._zod.bag);
@@ -8970,58 +9250,80 @@ var $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
8970
9250
  def.pattern ?? (def.pattern = email);
8971
9251
  $ZodStringFormat.init(inst, def);
8972
9252
  });
9253
+ var URL_BAD_FORMAT = 1;
9254
+ var URL_UNPARSEABLE = 2;
9255
+ function parseURLObject(trimmed, def) {
9256
+ if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) {
9257
+ return URL_BAD_FORMAT;
9258
+ }
9259
+ try {
9260
+ return new URL(trimmed);
9261
+ } catch {
9262
+ return URL_UNPARSEABLE;
9263
+ }
9264
+ }
9265
+ var asciiTabOrNewline = /[\t\n\r]/g;
9266
+ function stripTabAndNewline(value) {
9267
+ return value.replace(asciiTabOrNewline, "");
9268
+ }
9269
+ function urlHostnameOk(url2, hostname) {
9270
+ hostname.lastIndex = 0;
9271
+ return hostname.test(url2.hostname);
9272
+ }
9273
+ function urlProtocolOk(url2, protocol) {
9274
+ protocol.lastIndex = 0;
9275
+ return protocol.test(url2.protocol.endsWith(":") ? url2.protocol.slice(0, -1) : url2.protocol);
9276
+ }
8973
9277
  var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
8974
9278
  $ZodStringFormat.init(inst, def);
8975
9279
  inst._zod.check = (payload) => {
8976
9280
  try {
8977
9281
  const trimmed = payload.value.trim();
8978
- if (!def.normalize && def.protocol?.source === httpProtocol.source) {
8979
- if (!/^https?:\/\//i.test(trimmed)) {
8980
- payload.issues.push({
8981
- code: "invalid_format",
8982
- format: "url",
8983
- note: "Invalid URL format",
8984
- input: payload.value,
8985
- inst,
8986
- continue: !def.abort
8987
- });
8988
- return;
8989
- }
9282
+ const url2 = parseURLObject(trimmed, def);
9283
+ if (url2 === URL_BAD_FORMAT) {
9284
+ payload.issues.push({
9285
+ code: "invalid_format",
9286
+ format: "url",
9287
+ note: "Invalid URL format",
9288
+ input: payload.value,
9289
+ inst,
9290
+ continue: !def.abort
9291
+ });
9292
+ return;
8990
9293
  }
8991
- const url2 = new URL(trimmed);
8992
- if (def.hostname) {
8993
- def.hostname.lastIndex = 0;
8994
- if (!def.hostname.test(url2.hostname)) {
8995
- payload.issues.push({
8996
- code: "invalid_format",
8997
- format: "url",
8998
- note: "Invalid hostname",
8999
- pattern: def.hostname.source,
9000
- input: payload.value,
9001
- inst,
9002
- continue: !def.abort
9003
- });
9004
- }
9294
+ if (url2 === URL_UNPARSEABLE) {
9295
+ payload.issues.push({
9296
+ code: "invalid_format",
9297
+ format: "url",
9298
+ input: payload.value,
9299
+ inst,
9300
+ continue: !def.abort
9301
+ });
9302
+ return;
9005
9303
  }
9006
- if (def.protocol) {
9007
- def.protocol.lastIndex = 0;
9008
- if (!def.protocol.test(url2.protocol.endsWith(":") ? url2.protocol.slice(0, -1) : url2.protocol)) {
9009
- payload.issues.push({
9010
- code: "invalid_format",
9011
- format: "url",
9012
- note: "Invalid protocol",
9013
- pattern: def.protocol.source,
9014
- input: payload.value,
9015
- inst,
9016
- continue: !def.abort
9017
- });
9018
- }
9304
+ if (def.hostname && !urlHostnameOk(url2, def.hostname)) {
9305
+ payload.issues.push({
9306
+ code: "invalid_format",
9307
+ format: "url",
9308
+ note: "Invalid hostname",
9309
+ pattern: def.hostname.source,
9310
+ input: payload.value,
9311
+ inst,
9312
+ continue: !def.abort
9313
+ });
9019
9314
  }
9020
- if (def.normalize) {
9021
- payload.value = url2.href;
9022
- } else {
9023
- payload.value = trimmed;
9315
+ if (def.protocol && !urlProtocolOk(url2, def.protocol)) {
9316
+ payload.issues.push({
9317
+ code: "invalid_format",
9318
+ format: "url",
9319
+ note: "Invalid protocol",
9320
+ pattern: def.protocol.source,
9321
+ input: payload.value,
9322
+ inst,
9323
+ continue: !def.abort
9324
+ });
9024
9325
  }
9326
+ payload.value = def.normalize ? url2.href : stripTabAndNewline(trimmed);
9025
9327
  return;
9026
9328
  } catch (_) {
9027
9329
  payload.issues.push({
@@ -9039,7 +9341,9 @@ var $ZodEmoji = /* @__PURE__ */ $constructor("$ZodEmoji", (inst, def) => {
9039
9341
  $ZodStringFormat.init(inst, def);
9040
9342
  });
9041
9343
  var $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def) => {
9042
- def.pattern ?? (def.pattern = nanoid);
9344
+ if (def.length !== void 0 && (!Number.isInteger(def.length) || def.length < 1))
9345
+ throw new Error(`Invalid nanoid length: ${def.length}`);
9346
+ def.pattern ?? (def.pattern = def.length === void 0 ? nanoid : nanoidOfLength(def.length));
9043
9347
  $ZodStringFormat.init(inst, def);
9044
9348
  });
9045
9349
  var $ZodCUID = /* @__PURE__ */ $constructor("$ZodCUID", (inst, def) => {
@@ -9065,6 +9369,12 @@ var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
9065
9369
  var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
9066
9370
  def.pattern ?? (def.pattern = datetime(def));
9067
9371
  $ZodStringFormat.init(inst, def);
9372
+ if (def.local || def.precision === -1) {
9373
+ inst._zod.bag.laxFormat = true;
9374
+ inst._zod.onattach.push((s) => {
9375
+ s._zod.bag.laxFormat = true;
9376
+ });
9377
+ }
9068
9378
  });
9069
9379
  var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
9070
9380
  def.pattern ?? (def.pattern = date);
@@ -9083,14 +9393,23 @@ var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
9083
9393
  $ZodStringFormat.init(inst, def);
9084
9394
  inst._zod.bag.format = `ipv4`;
9085
9395
  });
9396
+ var ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
9397
+ function isValidIPv6(value) {
9398
+ if (!ipv6Alphabet.test(value))
9399
+ return false;
9400
+ try {
9401
+ new URL(`http://[${value}]`);
9402
+ return true;
9403
+ } catch {
9404
+ return false;
9405
+ }
9406
+ }
9086
9407
  var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
9087
9408
  def.pattern ?? (def.pattern = ipv6);
9088
9409
  $ZodStringFormat.init(inst, def);
9089
9410
  inst._zod.bag.format = `ipv6`;
9090
9411
  inst._zod.check = (payload) => {
9091
- try {
9092
- new URL(`http://[${payload.value}]`);
9093
- } catch {
9412
+ if (!isValidIPv6(payload.value)) {
9094
9413
  payload.issues.push({
9095
9414
  code: "invalid_format",
9096
9415
  format: "ipv6",
@@ -9105,24 +9424,25 @@ var $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => {
9105
9424
  def.pattern ?? (def.pattern = cidrv4);
9106
9425
  $ZodStringFormat.init(inst, def);
9107
9426
  });
9427
+ function isValidCIDRv6(value) {
9428
+ const parts = value.split("/");
9429
+ if (parts.length !== 2)
9430
+ return false;
9431
+ const [address, prefix] = parts;
9432
+ if (!prefix)
9433
+ return false;
9434
+ const prefixNum = Number(prefix);
9435
+ if (`${prefixNum}` !== prefix)
9436
+ return false;
9437
+ if (prefixNum < 0 || prefixNum > 128)
9438
+ return false;
9439
+ return isValidIPv6(address);
9440
+ }
9108
9441
  var $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => {
9109
9442
  def.pattern ?? (def.pattern = cidrv6);
9110
9443
  $ZodStringFormat.init(inst, def);
9111
9444
  inst._zod.check = (payload) => {
9112
- const parts = payload.value.split("/");
9113
- try {
9114
- if (parts.length !== 2)
9115
- throw new Error();
9116
- const [address, prefix] = parts;
9117
- if (!prefix)
9118
- throw new Error();
9119
- const prefixNum = Number(prefix);
9120
- if (`${prefixNum}` !== prefix)
9121
- throw new Error();
9122
- if (prefixNum < 0 || prefixNum > 128)
9123
- throw new Error();
9124
- new URL(`http://[${address}]`);
9125
- } catch {
9445
+ if (!isValidCIDRv6(payload.value)) {
9126
9446
  payload.issues.push({
9127
9447
  code: "invalid_format",
9128
9448
  format: "cidrv6",
@@ -9237,7 +9557,7 @@ var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
9237
9557
  if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) {
9238
9558
  return payload;
9239
9559
  }
9240
- const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
9560
+ const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? String(input) : void 0 : void 0;
9241
9561
  payload.issues.push({
9242
9562
  expected: "number",
9243
9563
  code: "invalid_type",
@@ -9362,6 +9682,8 @@ function handleArrayResult(result, final, index) {
9362
9682
  }
9363
9683
  var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
9364
9684
  $ZodType.init(inst, def);
9685
+ const memo2 = globalConfig.memoizer;
9686
+ memo2?.attach(inst);
9365
9687
  inst._zod.parse = (payload, ctx) => {
9366
9688
  const input = payload.value;
9367
9689
  if (!Array.isArray(input)) {
@@ -9373,7 +9695,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
9373
9695
  });
9374
9696
  return payload;
9375
9697
  }
9376
- payload.value = Array(input.length);
9698
+ payload.value = memo2 ? memo2.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
9377
9699
  const proms = [];
9378
9700
  for (let i = 0; i < input.length; i++) {
9379
9701
  const item = input[i];
@@ -9393,15 +9715,19 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
9393
9715
  return payload;
9394
9716
  };
9395
9717
  });
9396
- function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {
9718
+ function handlePropertyResult(result, final, key, input, optin, optout) {
9397
9719
  const isPresent = key in input;
9720
+ const isOptionalOut = optout === "optional";
9721
+ if (!isPresent && isOptionalOut && optin === "optional") {
9722
+ return;
9723
+ }
9398
9724
  if (result.issues.length) {
9399
- if (isOptionalIn && isOptionalOut && !isPresent) {
9725
+ if (optin !== void 0 && isOptionalOut && !isPresent) {
9400
9726
  return;
9401
9727
  }
9402
9728
  final.issues.push(...prefixIssues(key, result.issues));
9403
9729
  }
9404
- if (!isPresent && !isOptionalIn) {
9730
+ if (!isPresent && optin === void 0) {
9405
9731
  if (!result.issues.length) {
9406
9732
  final.issues.push({
9407
9733
  code: "invalid_type",
@@ -9420,17 +9746,23 @@ function handlePropertyResult(result, final, key, input, isOptionalIn, isOptiona
9420
9746
  final.value[key] = result.value;
9421
9747
  }
9422
9748
  }
9749
+ var NO_SYMBOL_KEYS = [];
9423
9750
  function normalizeDef(def) {
9424
9751
  const keys = Object.keys(def.shape);
9425
- for (const k of keys) {
9752
+ const ownSymbols = Object.getOwnPropertySymbols(def.shape);
9753
+ const symbolKeys = ownSymbols.length ? ownSymbols : NO_SYMBOL_KEYS;
9754
+ const allKeys = symbolKeys.length ? [...keys, ...symbolKeys] : keys;
9755
+ for (const k of allKeys) {
9426
9756
  if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) {
9427
- throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
9757
+ throw new Error(`Invalid element at key "${String(k)}": expected a Zod schema`);
9428
9758
  }
9429
9759
  }
9430
9760
  const okeys = optionalKeys(def.shape);
9431
9761
  return {
9432
9762
  ...def,
9433
- keys,
9763
+ allKeys,
9764
+ symbolKeys,
9765
+ // string-only: handleCatchall matches it against `for...in`, which never yields a symbol
9434
9766
  keySet: new Set(keys),
9435
9767
  numKeys: keys.length,
9436
9768
  optionalKeys: new Set(okeys)
@@ -9441,22 +9773,25 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
9441
9773
  const keySet = def.keySet;
9442
9774
  const _catchall = def.catchall._zod;
9443
9775
  const t = _catchall.def.type;
9444
- const isOptionalIn = _catchall.optin === "optional";
9445
- const isOptionalOut = _catchall.optout === "optional";
9776
+ const optin = _catchall.optin;
9777
+ const optout = _catchall.optout;
9446
9778
  for (const key in input) {
9447
- if (key === "__proto__")
9448
- continue;
9449
9779
  if (keySet.has(key))
9450
9780
  continue;
9781
+ if (key === "__proto__") {
9782
+ if (t === "never")
9783
+ unrecognized.push(key);
9784
+ continue;
9785
+ }
9451
9786
  if (t === "never") {
9452
9787
  unrecognized.push(key);
9453
9788
  continue;
9454
9789
  }
9455
9790
  const r = _catchall.run({ value: input[key], issues: [] }, ctx);
9456
9791
  if (r instanceof Promise) {
9457
- proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut)));
9792
+ proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, optin, optout)));
9458
9793
  } else {
9459
- handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
9794
+ handlePropertyResult(r, payload, key, input, optin, optout);
9460
9795
  }
9461
9796
  }
9462
9797
  if (unrecognized.length) {
@@ -9464,7 +9799,9 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
9464
9799
  code: "unrecognized_keys",
9465
9800
  keys: unrecognized,
9466
9801
  input,
9467
- inst
9802
+ inst,
9803
+ // 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.
9804
+ continue: true
9468
9805
  });
9469
9806
  }
9470
9807
  if (!proms.length)
@@ -9473,31 +9810,38 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
9473
9810
  return payload;
9474
9811
  });
9475
9812
  }
9813
+ var propShapes = /* @__PURE__ */ new WeakMap();
9476
9814
  var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
9477
9815
  $ZodType.init(inst, def);
9478
9816
  const desc = Object.getOwnPropertyDescriptor(def, "shape");
9479
9817
  if (!desc?.get) {
9480
9818
  const sh = def.shape;
9819
+ propShapes.set(def, sh);
9481
9820
  Object.defineProperty(def, "shape", {
9482
9821
  get: () => {
9483
9822
  const newSh = { ...sh };
9484
9823
  Object.defineProperty(def, "shape", {
9485
9824
  value: newSh
9486
9825
  });
9826
+ propShapes.set(def, newSh);
9487
9827
  return newSh;
9488
9828
  }
9489
9829
  });
9490
9830
  }
9491
9831
  const _normalized = cached(() => normalizeDef(def));
9492
- defineLazy(inst._zod, "propValues", () => {
9493
- const shape = def.shape;
9832
+ defineLazyInternal(inst, "propValues", (zod) => {
9833
+ const shape = zod.def.shape;
9494
9834
  const propValues = {};
9495
9835
  for (const key in shape) {
9496
9836
  const field = shape[key]._zod;
9497
9837
  if (field.values) {
9498
- propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
9838
+ if (!Object.prototype.hasOwnProperty.call(propValues, key)) {
9839
+ assignProp(propValues, key, /* @__PURE__ */ new Set());
9840
+ }
9499
9841
  for (const v of field.values)
9500
9842
  propValues[key].add(v);
9843
+ if (field.optin !== void 0)
9844
+ propValues[key].add(void 0);
9501
9845
  }
9502
9846
  }
9503
9847
  return propValues;
@@ -9505,6 +9849,8 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
9505
9849
  const isObject2 = isObject;
9506
9850
  const catchall = def.catchall;
9507
9851
  let value;
9852
+ const memo2 = globalConfig.memoizer;
9853
+ memo2?.attach(inst);
9508
9854
  inst._zod.parse = (payload, ctx) => {
9509
9855
  value ?? (value = _normalized.value);
9510
9856
  const input = payload.value;
@@ -9517,18 +9863,20 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
9517
9863
  });
9518
9864
  return payload;
9519
9865
  }
9520
- payload.value = {};
9866
+ payload.value = memo2 ? memo2.alloc(inst, payload, {}, ctx) : {};
9521
9867
  const proms = [];
9522
9868
  const shape = value.shape;
9523
- for (const key of value.keys) {
9869
+ for (const key of value.allKeys) {
9870
+ if (key === "__proto__")
9871
+ continue;
9524
9872
  const el = shape[key];
9525
- const isOptionalIn = el._zod.optin === "optional";
9526
- const isOptionalOut = el._zod.optout === "optional";
9873
+ const optin = el._zod.optin;
9874
+ const optout = el._zod.optout;
9527
9875
  const r = el._zod.run({ value: input[key], issues: [] }, ctx);
9528
9876
  if (r instanceof Promise) {
9529
- proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut)));
9877
+ proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, optin, optout)));
9530
9878
  } else {
9531
- handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
9879
+ handlePropertyResult(r, payload, key, input, optin, optout);
9532
9880
  }
9533
9881
  }
9534
9882
  if (!catchall) {
@@ -9541,55 +9889,54 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
9541
9889
  $ZodObject.init(inst, def);
9542
9890
  const superParse = inst._zod.parse;
9543
9891
  const _normalized = cached(() => normalizeDef(def));
9892
+ const memo2 = globalConfig.memoizer;
9544
9893
  const generateFastpass = (shape) => {
9545
- const doc = new Doc(["shape", "payload", "ctx"]);
9546
9894
  const normalized = _normalized.value;
9547
- const parseStr = (key) => {
9548
- const k = esc(key);
9549
- return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
9550
- };
9895
+ const syms = normalized.symbolKeys;
9896
+ const doc = new Doc(["payload", "ctx"], { shape, inst, memo: memo2, syms });
9897
+ const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
9898
+ const prefixStr = (id, k) => `
9899
+ for (let i = 0; i < ${id}.issues.length; i++) {
9900
+ const iss = ${id}.issues[i];
9901
+ iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
9902
+ payload.issues.push(iss);
9903
+ }`;
9551
9904
  doc.write(`const input = payload.value;`);
9552
9905
  const ids = /* @__PURE__ */ Object.create(null);
9553
9906
  let counter = 0;
9554
- for (const key of normalized.keys) {
9907
+ for (const key of normalized.allKeys) {
9555
9908
  ids[key] = `key_${counter++}`;
9556
9909
  }
9557
- doc.write(`const newResult = {};`);
9558
- for (const key of normalized.keys) {
9910
+ doc.write(memo2 ? `const newResult = memo.alloc(inst, payload, {}, ctx);` : `const newResult = {};`);
9911
+ for (const key of normalized.allKeys) {
9912
+ if (key === "__proto__")
9913
+ continue;
9559
9914
  const id = ids[key];
9560
- const k = esc(key);
9915
+ const k = typeof key === "symbol" ? `syms[${syms.indexOf(key)}]` : esc(key);
9916
+ const isPresent = `${k} in input`;
9561
9917
  const schema = shape[key];
9562
- const isOptionalIn = schema?._zod?.optin === "optional";
9918
+ const optin = schema?._zod?.optin;
9919
+ const isOptionalIn = optin !== void 0;
9563
9920
  const isOptionalOut = schema?._zod?.optout === "optional";
9564
- doc.write(`const ${id} = ${parseStr(key)};`);
9921
+ doc.write(`const ${id} = ${parseStr(k)};`);
9565
9922
  if (isOptionalIn && isOptionalOut) {
9923
+ const assign = optin === "optional" ? `${id}_present` : `${id}.value !== undefined || ${id}_present`;
9566
9924
  doc.write(`
9567
- if (${id}.issues.length) {
9568
- if (${k} in input) {
9569
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
9570
- ...iss,
9571
- path: iss.path ? [${k}, ...iss.path] : [${k}]
9572
- })));
9925
+ const ${id}_present = ${isPresent};
9926
+ if (!${id}.issues.length || ${id}_present) {
9927
+ if (${id}.issues.length) {${prefixStr(id, k)}
9573
9928
  }
9574
- }
9575
-
9576
- if (${id}.value === undefined) {
9577
- if (${k} in input) {
9578
- newResult[${k}] = undefined;
9929
+
9930
+ if (${assign}) {
9931
+ newResult[${k}] = ${id}.value;
9579
9932
  }
9580
- } else {
9581
- newResult[${k}] = ${id}.value;
9582
9933
  }
9583
-
9934
+
9584
9935
  `);
9585
9936
  } else if (!isOptionalIn) {
9586
9937
  doc.write(`
9587
- const ${id}_present = ${k} in input;
9588
- if (${id}.issues.length) {
9589
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
9590
- ...iss,
9591
- path: iss.path ? [${k}, ...iss.path] : [${k}]
9592
- })));
9938
+ const ${id}_present = ${isPresent};
9939
+ if (${id}.issues.length) {${prefixStr(id, k)}
9593
9940
  }
9594
9941
  if (!${id}_present && !${id}.issues.length) {
9595
9942
  payload.issues.push({
@@ -9601,38 +9948,29 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
9601
9948
  }
9602
9949
 
9603
9950
  if (${id}_present) {
9604
- if (${id}.value === undefined) {
9605
- newResult[${k}] = undefined;
9606
- } else {
9607
- newResult[${k}] = ${id}.value;
9608
- }
9951
+ newResult[${k}] = ${id}.value;
9609
9952
  }
9610
9953
 
9611
9954
  `);
9612
9955
  } else {
9613
9956
  doc.write(`
9614
- if (${id}.issues.length) {
9615
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
9616
- ...iss,
9617
- path: iss.path ? [${k}, ...iss.path] : [${k}]
9618
- })));
9957
+ if (${id}.issues.length) {${prefixStr(id, k)}
9619
9958
  }
9620
9959
 
9621
9960
  if (${id}.value === undefined) {
9622
- if (${k} in input) {
9961
+ if (${isPresent}) {
9623
9962
  newResult[${k}] = undefined;
9624
9963
  }
9625
9964
  } else {
9626
9965
  newResult[${k}] = ${id}.value;
9627
9966
  }
9628
-
9967
+
9629
9968
  `);
9630
9969
  }
9631
9970
  }
9632
9971
  doc.write(`payload.value = newResult;`);
9633
9972
  doc.write(`return payload;`);
9634
- const fn = doc.compile();
9635
- return (payload, ctx) => fn(shape, payload, ctx);
9973
+ return doc.compile();
9636
9974
  };
9637
9975
  let fastpass;
9638
9976
  const isObject2 = isObject;
@@ -9686,17 +10024,17 @@ function handleUnionResults(results, final, inst, ctx) {
9686
10024
  }
9687
10025
  var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
9688
10026
  $ZodType.init(inst, def);
9689
- defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0);
9690
- defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
9691
- defineLazy(inst._zod, "values", () => {
9692
- if (def.options.every((o) => o._zod.values)) {
9693
- return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
10027
+ 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);
10028
+ defineLazyInternal(inst, "optout", (zod) => zod.def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
10029
+ defineLazyInternal(inst, "values", (zod) => {
10030
+ if (zod.def.options.every((o) => o._zod.values)) {
10031
+ return new Set(zod.def.options.flatMap((option) => Array.from(option._zod.values)));
9694
10032
  }
9695
10033
  return void 0;
9696
10034
  });
9697
- defineLazy(inst._zod, "pattern", () => {
9698
- if (def.options.every((o) => o._zod.pattern)) {
9699
- const patterns = def.options.map((o) => o._zod.pattern);
10035
+ defineLazyInternal(inst, "pattern", (zod) => {
10036
+ if (zod.def.options.every((o) => o._zod.pattern)) {
10037
+ const patterns = zod.def.options.map((o) => o._zod.pattern);
9700
10038
  return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
9701
10039
  }
9702
10040
  return void 0;
@@ -9733,15 +10071,16 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
9733
10071
  def.inclusive = false;
9734
10072
  $ZodUnion.init(inst, def);
9735
10073
  const _super = inst._zod.parse;
9736
- defineLazy(inst._zod, "propValues", () => {
10074
+ defineLazyInternal(inst, "propValues", (zod) => {
9737
10075
  const propValues = {};
9738
- for (const option of def.options) {
10076
+ for (const option of zod.def.options) {
9739
10077
  const pv = option._zod.propValues;
9740
10078
  if (!pv || Object.keys(pv).length === 0)
9741
- throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
10079
+ throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
9742
10080
  for (const [k, v] of Object.entries(pv)) {
9743
- if (!propValues[k])
9744
- propValues[k] = /* @__PURE__ */ new Set();
10081
+ if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
10082
+ assignProp(propValues, k, /* @__PURE__ */ new Set());
10083
+ }
9745
10084
  for (const val of v) {
9746
10085
  propValues[k].add(val);
9747
10086
  }
@@ -9749,6 +10088,12 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
9749
10088
  }
9750
10089
  return propValues;
9751
10090
  });
10091
+ def.options.forEach((option, i) => {
10092
+ const propShape = propShapes.get(option._zod.def);
10093
+ if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {
10094
+ throw new Error(`Invalid discriminated union option at index "${i}"`);
10095
+ }
10096
+ });
9752
10097
  const disc = cached(() => {
9753
10098
  const opts = def.options;
9754
10099
  const map = /* @__PURE__ */ new Map();
@@ -9822,7 +10167,11 @@ function mergeValues(a, b) {
9822
10167
  const bKeys = Object.keys(b);
9823
10168
  const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
9824
10169
  const newObj = { ...a, ...b };
10170
+ if (Object.prototype.hasOwnProperty.call(newObj, "__proto__"))
10171
+ delete newObj.__proto__;
9825
10172
  for (const key of sharedKeys) {
10173
+ if (key === "__proto__")
10174
+ continue;
9826
10175
  const sharedValue = mergeValues(a[key], b[key]);
9827
10176
  if (!sharedValue.valid) {
9828
10177
  return {
@@ -9858,37 +10207,49 @@ function mergeValues(a, b) {
9858
10207
  function handleIntersectionResults(result, left, right) {
9859
10208
  const unrecKeys = /* @__PURE__ */ new Map();
9860
10209
  let unrecIssue;
9861
- for (const iss of left.issues) {
9862
- if (iss.code === "unrecognized_keys") {
10210
+ const keyIssues = /* @__PURE__ */ new Map();
10211
+ const collect = (iss, side) => {
10212
+ let keys;
10213
+ if (iss.code === "unrecognized_keys" && !iss.path?.length) {
9863
10214
  unrecIssue ?? (unrecIssue = iss);
9864
- for (const k of iss.keys) {
9865
- if (!unrecKeys.has(k))
9866
- unrecKeys.set(k, {});
9867
- unrecKeys.get(k).l = true;
9868
- }
10215
+ keys = iss.keys;
10216
+ } else if (iss.code === "invalid_key" && iss.origin === "record" && iss.path?.length === 1) {
10217
+ const k = String(iss.path[0]);
10218
+ if (!keyIssues.has(k))
10219
+ keyIssues.set(k, iss);
10220
+ keys = [k];
9869
10221
  } else {
9870
- result.issues.push(iss);
10222
+ return false;
10223
+ }
10224
+ for (const k of keys) {
10225
+ if (!unrecKeys.has(k))
10226
+ unrecKeys.set(k, {});
10227
+ unrecKeys.get(k)[side] = true;
9871
10228
  }
10229
+ return true;
10230
+ };
10231
+ for (const iss of left.issues) {
10232
+ if (!collect(iss, "l"))
10233
+ result.issues.push(iss);
9872
10234
  }
9873
10235
  for (const iss of right.issues) {
9874
- if (iss.code === "unrecognized_keys") {
9875
- for (const k of iss.keys) {
9876
- if (!unrecKeys.has(k))
9877
- unrecKeys.set(k, {});
9878
- unrecKeys.get(k).r = true;
9879
- }
9880
- } else {
10236
+ if (!collect(iss, "r"))
9881
10237
  result.issues.push(iss);
9882
- }
9883
10238
  }
9884
10239
  const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
9885
- if (bothKeys.length && unrecIssue) {
9886
- result.issues.push({ ...unrecIssue, keys: bothKeys });
10240
+ if (bothKeys.length) {
10241
+ const aggregated = unrecIssue ? bothKeys.filter((k) => unrecIssue.keys.includes(k)) : [];
10242
+ if (aggregated.length)
10243
+ result.issues.push({ ...unrecIssue, keys: aggregated });
10244
+ for (const k of bothKeys) {
10245
+ if (!aggregated.includes(k) && keyIssues.has(k))
10246
+ result.issues.push(keyIssues.get(k));
10247
+ }
9887
10248
  }
9888
- if (aborted(result))
9889
- return result;
9890
10249
  const merged = mergeValues(left.value, right.value);
9891
10250
  if (!merged.valid) {
10251
+ if (aborted(result))
10252
+ return result;
9892
10253
  throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
9893
10254
  }
9894
10255
  result.value = merged.data;
@@ -9896,6 +10257,8 @@ function handleIntersectionResults(result, left, right) {
9896
10257
  }
9897
10258
  var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
9898
10259
  $ZodType.init(inst, def);
10260
+ const memo2 = globalConfig.memoizer;
10261
+ memo2?.attach(inst);
9899
10262
  inst._zod.parse = (payload, ctx) => {
9900
10263
  const input = payload.value;
9901
10264
  if (!isPlainObject(input)) {
@@ -9909,12 +10272,14 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
9909
10272
  }
9910
10273
  const proms = [];
9911
10274
  const values = def.keyType._zod.values;
9912
- if (values) {
9913
- payload.value = {};
10275
+ if (values && !def.partial) {
10276
+ payload.value = memo2 ? memo2.alloc(inst, payload, {}, ctx) : {};
9914
10277
  const recordKeys = /* @__PURE__ */ new Set();
9915
10278
  for (const key of values) {
9916
10279
  if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
9917
10280
  recordKeys.add(typeof key === "number" ? key.toString() : key);
10281
+ if (key === "__proto__")
10282
+ continue;
9918
10283
  const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
9919
10284
  if (keyResult instanceof Promise) {
9920
10285
  throw new Error("Async schemas not supported in object keys currently");
@@ -9931,6 +10296,8 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
9931
10296
  continue;
9932
10297
  }
9933
10298
  const outKey = keyResult.value;
10299
+ if (outKey === "__proto__")
10300
+ continue;
9934
10301
  const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
9935
10302
  if (result instanceof Promise) {
9936
10303
  proms.push(result.then((result2) => {
@@ -9950,8 +10317,14 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
9950
10317
  let unrecognized;
9951
10318
  for (const key in input) {
9952
10319
  if (!recordKeys.has(key)) {
9953
- unrecognized = unrecognized ?? [];
9954
- unrecognized.push(key);
10320
+ if (def.mode === "loose") {
10321
+ if (key === "__proto__")
10322
+ continue;
10323
+ payload.value[key] = input[key];
10324
+ } else {
10325
+ unrecognized = unrecognized ?? [];
10326
+ unrecognized.push(key);
10327
+ }
9955
10328
  }
9956
10329
  }
9957
10330
  if (unrecognized && unrecognized.length > 0) {
@@ -9959,11 +10332,13 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
9959
10332
  code: "unrecognized_keys",
9960
10333
  input,
9961
10334
  inst,
9962
- keys: unrecognized
10335
+ keys: unrecognized,
10336
+ continue: true
9963
10337
  });
9964
10338
  }
9965
10339
  } else {
9966
- payload.value = {};
10340
+ payload.value = memo2 ? memo2.alloc(inst, payload, {}, ctx) : {};
10341
+ let unrecognized;
9967
10342
  for (const key of Reflect.ownKeys(input)) {
9968
10343
  if (key === "__proto__")
9969
10344
  continue;
@@ -9986,6 +10361,9 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
9986
10361
  if (keyResult.issues.length) {
9987
10362
  if (def.mode === "loose") {
9988
10363
  payload.value[key] = input[key];
10364
+ } else if (values) {
10365
+ unrecognized = unrecognized ?? [];
10366
+ unrecognized.push(key);
9989
10367
  } else {
9990
10368
  payload.issues.push({
9991
10369
  code: "invalid_key",
@@ -9998,21 +10376,33 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
9998
10376
  }
9999
10377
  continue;
10000
10378
  }
10379
+ const outKey = keyResult.value;
10380
+ if (outKey === "__proto__")
10381
+ continue;
10001
10382
  const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
10002
10383
  if (result instanceof Promise) {
10003
10384
  proms.push(result.then((result2) => {
10004
10385
  if (result2.issues.length) {
10005
10386
  payload.issues.push(...prefixIssues(key, result2.issues));
10006
10387
  }
10007
- payload.value[keyResult.value] = result2.value;
10388
+ payload.value[outKey] = result2.value;
10008
10389
  }));
10009
10390
  } else {
10010
10391
  if (result.issues.length) {
10011
10392
  payload.issues.push(...prefixIssues(key, result.issues));
10012
10393
  }
10013
- payload.value[keyResult.value] = result.value;
10394
+ payload.value[outKey] = result.value;
10014
10395
  }
10015
10396
  }
10397
+ if (unrecognized && unrecognized.length > 0) {
10398
+ payload.issues.push({
10399
+ code: "unrecognized_keys",
10400
+ input,
10401
+ inst,
10402
+ keys: unrecognized,
10403
+ continue: true
10404
+ });
10405
+ }
10016
10406
  }
10017
10407
  if (proms.length) {
10018
10408
  return Promise.all(proms).then(() => payload);
@@ -10025,7 +10415,8 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
10025
10415
  const values = getEnumValues(def.entries);
10026
10416
  const valuesSet = new Set(values);
10027
10417
  inst._zod.values = valuesSet;
10028
- inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
10418
+ const patternValues = values.filter((k) => propertyKeyTypes.has(typeof k));
10419
+ inst._zod.pattern = new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
10029
10420
  inst._zod.parse = (payload, _ctx) => {
10030
10421
  const input = payload.value;
10031
10422
  if (valuesSet.has(input)) {
@@ -10042,12 +10433,9 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
10042
10433
  });
10043
10434
  var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
10044
10435
  $ZodType.init(inst, def);
10045
- if (def.values.length === 0) {
10046
- throw new Error("Cannot create literal schema with no valid values");
10047
- }
10048
10436
  const values = new Set(def.values);
10049
10437
  inst._zod.values = values;
10050
- inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
10438
+ 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]$");
10051
10439
  inst._zod.parse = (payload, _ctx) => {
10052
10440
  const input = payload.value;
10053
10441
  if (values.has(input)) {
@@ -10065,6 +10453,7 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
10065
10453
  var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
10066
10454
  $ZodType.init(inst, def);
10067
10455
  inst._zod.optin = "optional";
10456
+ globalConfig.memoizer?.guard(inst);
10068
10457
  inst._zod.parse = (payload, ctx) => {
10069
10458
  if (ctx.direction === "backward") {
10070
10459
  throw new $ZodEncodeError(inst.constructor.name);
@@ -10074,7 +10463,6 @@ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) =>
10074
10463
  const output = _out instanceof Promise ? _out : Promise.resolve(_out);
10075
10464
  return output.then((output2) => {
10076
10465
  payload.value = output2;
10077
- payload.fallback = true;
10078
10466
  return payload;
10079
10467
  });
10080
10468
  }
@@ -10082,59 +10470,55 @@ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) =>
10082
10470
  throw new $ZodAsyncError();
10083
10471
  }
10084
10472
  payload.value = _out;
10085
- payload.fallback = true;
10086
10473
  return payload;
10087
10474
  };
10088
10475
  });
10089
- function handleOptionalResult(result, input) {
10090
- if (input === void 0 && (result.issues.length || result.fallback)) {
10091
- return { issues: [], value: void 0 };
10092
- }
10093
- return result;
10476
+ function handleOptionalResult(payload, result) {
10477
+ payload.value = result.issues.length ? void 0 : result.value;
10478
+ return payload;
10094
10479
  }
10095
10480
  var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
10096
10481
  $ZodType.init(inst, def);
10097
- inst._zod.optin = "optional";
10482
+ defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
10098
10483
  inst._zod.optout = "optional";
10099
- defineLazy(inst._zod, "values", () => {
10100
- return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, void 0]) : void 0;
10484
+ defineLazyInternal(inst, "values", (zod) => {
10485
+ const values = zod.def.innerType._zod.values;
10486
+ return values ? /* @__PURE__ */ new Set([...values, void 0]) : void 0;
10101
10487
  });
10102
- defineLazy(inst._zod, "pattern", () => {
10103
- const pattern = def.innerType._zod.pattern;
10488
+ defineLazyInternal(inst, "pattern", (zod) => {
10489
+ const pattern = zod.def.innerType._zod.pattern;
10104
10490
  return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
10105
10491
  });
10106
10492
  inst._zod.parse = (payload, ctx) => {
10107
- if (def.innerType._zod.optin === "optional") {
10108
- const input = payload.value;
10109
- const result = def.innerType._zod.run(payload, ctx);
10110
- if (result instanceof Promise)
10111
- return result.then((r) => handleOptionalResult(r, input));
10112
- return handleOptionalResult(result, input);
10113
- }
10114
10493
  if (payload.value === void 0) {
10115
- return payload;
10494
+ if (def.innerType._zod.optin !== "defaulted")
10495
+ return payload;
10496
+ const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);
10497
+ if (result instanceof Promise)
10498
+ return result.then((result2) => handleOptionalResult(payload, result2));
10499
+ return handleOptionalResult(payload, result);
10116
10500
  }
10117
10501
  return def.innerType._zod.run(payload, ctx);
10118
10502
  };
10119
10503
  });
10120
10504
  var $ZodExactOptional = /* @__PURE__ */ $constructor("$ZodExactOptional", (inst, def) => {
10121
10505
  $ZodOptional.init(inst, def);
10122
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
10123
- defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern);
10506
+ defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
10507
+ defineLazyInternal(inst, "pattern", (zod) => zod.def.innerType._zod.pattern);
10124
10508
  inst._zod.parse = (payload, ctx) => {
10125
10509
  return def.innerType._zod.run(payload, ctx);
10126
10510
  };
10127
10511
  });
10128
10512
  var $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
10129
10513
  $ZodType.init(inst, def);
10130
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
10131
- defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
10132
- defineLazy(inst._zod, "pattern", () => {
10133
- const pattern = def.innerType._zod.pattern;
10514
+ defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin);
10515
+ defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
10516
+ defineLazyInternal(inst, "pattern", (zod) => {
10517
+ const pattern = zod.def.innerType._zod.pattern;
10134
10518
  return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
10135
10519
  });
10136
- defineLazy(inst._zod, "values", () => {
10137
- return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, null]) : void 0;
10520
+ defineLazyInternal(inst, "values", (zod) => {
10521
+ return zod.def.innerType._zod.values ? /* @__PURE__ */ new Set([...zod.def.innerType._zod.values, null]) : void 0;
10138
10522
  });
10139
10523
  inst._zod.parse = (payload, ctx) => {
10140
10524
  if (payload.value === null)
@@ -10144,8 +10528,8 @@ var $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
10144
10528
  });
10145
10529
  var $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
10146
10530
  $ZodType.init(inst, def);
10147
- inst._zod.optin = "optional";
10148
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
10531
+ inst._zod.optin = "defaulted";
10532
+ defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
10149
10533
  inst._zod.parse = (payload, ctx) => {
10150
10534
  if (ctx.direction === "backward") {
10151
10535
  return def.innerType._zod.run(payload, ctx);
@@ -10169,8 +10553,8 @@ function handleDefaultResult(payload, def) {
10169
10553
  }
10170
10554
  var $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => {
10171
10555
  $ZodType.init(inst, def);
10172
- inst._zod.optin = "optional";
10173
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
10556
+ inst._zod.optin = "defaulted";
10557
+ defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
10174
10558
  inst._zod.parse = (payload, ctx) => {
10175
10559
  if (ctx.direction === "backward") {
10176
10560
  return def.innerType._zod.run(payload, ctx);
@@ -10183,8 +10567,8 @@ var $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => {
10183
10567
  });
10184
10568
  var $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => {
10185
10569
  $ZodType.init(inst, def);
10186
- defineLazy(inst._zod, "values", () => {
10187
- const v = def.innerType._zod.values;
10570
+ defineLazyInternal(inst, "values", (zod) => {
10571
+ const v = zod.def.innerType._zod.values;
10188
10572
  return v ? new Set([...v].filter((x) => x !== void 0)) : void 0;
10189
10573
  });
10190
10574
  inst._zod.parse = (payload, ctx) => {
@@ -10206,54 +10590,45 @@ function handleNonOptionalResult(payload, inst) {
10206
10590
  }
10207
10591
  return payload;
10208
10592
  }
10593
+ function handleCatchResult(payload, result, def, ctx) {
10594
+ if (!result.issues.length) {
10595
+ payload.value = result.value;
10596
+ if (result.memo)
10597
+ payload.memo = true;
10598
+ return payload;
10599
+ }
10600
+ payload.value = def.catchValue({
10601
+ ...result,
10602
+ value: payload.value,
10603
+ error: {
10604
+ issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config()))
10605
+ },
10606
+ input: payload.value
10607
+ });
10608
+ return payload;
10609
+ }
10209
10610
  var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
10210
10611
  $ZodType.init(inst, def);
10211
- inst._zod.optin = "optional";
10212
- defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
10213
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
10612
+ defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
10613
+ defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
10614
+ defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
10214
10615
  inst._zod.parse = (payload, ctx) => {
10215
10616
  if (ctx.direction === "backward") {
10216
10617
  return def.innerType._zod.run(payload, ctx);
10217
10618
  }
10218
- const result = def.innerType._zod.run(payload, ctx);
10619
+ const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);
10219
10620
  if (result instanceof Promise) {
10220
- return result.then((result2) => {
10221
- payload.value = result2.value;
10222
- if (result2.issues.length) {
10223
- payload.value = def.catchValue({
10224
- ...payload,
10225
- error: {
10226
- issues: result2.issues.map((iss) => finalizeIssue(iss, ctx, config()))
10227
- },
10228
- input: payload.value
10229
- });
10230
- payload.issues = [];
10231
- payload.fallback = true;
10232
- }
10233
- return payload;
10234
- });
10235
- }
10236
- payload.value = result.value;
10237
- if (result.issues.length) {
10238
- payload.value = def.catchValue({
10239
- ...payload,
10240
- error: {
10241
- issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config()))
10242
- },
10243
- input: payload.value
10244
- });
10245
- payload.issues = [];
10246
- payload.fallback = true;
10621
+ return result.then((result2) => handleCatchResult(payload, result2, def, ctx));
10247
10622
  }
10248
- return payload;
10623
+ return handleCatchResult(payload, result, def, ctx);
10249
10624
  };
10250
10625
  });
10251
10626
  var $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
10252
10627
  $ZodType.init(inst, def);
10253
- defineLazy(inst._zod, "values", () => def.in._zod.values);
10254
- defineLazy(inst._zod, "optin", () => def.in._zod.optin);
10255
- defineLazy(inst._zod, "optout", () => def.out._zod.optout);
10256
- defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
10628
+ defineLazyInternal(inst, "values", (zod) => zod.def.in._zod.values);
10629
+ defineLazyInternal(inst, "optin", (zod) => zod.def.in._zod.optin);
10630
+ defineLazyInternal(inst, "optout", (zod) => zod.def.out._zod.optout);
10631
+ defineLazyInternal(inst, "propValues", (zod) => zod.def.in._zod.propValues);
10257
10632
  inst._zod.parse = (payload, ctx) => {
10258
10633
  if (ctx.direction === "backward") {
10259
10634
  const right = def.out._zod.run(payload, ctx);
@@ -10270,21 +10645,21 @@ var $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
10270
10645
  };
10271
10646
  });
10272
10647
  function handlePipeResult(left, next, ctx) {
10273
- if (left.issues.length) {
10648
+ if (left.issues.some((iss) => iss.code !== "unrecognized_keys")) {
10274
10649
  left.aborted = true;
10275
10650
  return left;
10276
10651
  }
10277
- return next._zod.run({ value: left.value, issues: left.issues, fallback: left.fallback }, ctx);
10652
+ return next._zod.run({ value: left.value, issues: left.issues }, ctx);
10278
10653
  }
10279
10654
  var $ZodPreprocess = /* @__PURE__ */ $constructor("$ZodPreprocess", (inst, def) => {
10280
10655
  $ZodPipe.init(inst, def);
10281
10656
  });
10282
10657
  var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
10283
10658
  $ZodType.init(inst, def);
10284
- defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
10285
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
10286
- defineLazy(inst._zod, "optin", () => def.innerType?._zod?.optin);
10287
- defineLazy(inst._zod, "optout", () => def.innerType?._zod?.optout);
10659
+ defineLazyInternal(inst, "propValues", (zod) => zod.def.innerType._zod.propValues);
10660
+ defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
10661
+ defineLazyInternal(inst, "optin", (zod) => zod.def.innerType?._zod?.optin);
10662
+ defineLazyInternal(inst, "optout", (zod) => zod.def.innerType?._zod?.optout);
10288
10663
  inst._zod.parse = (payload, ctx) => {
10289
10664
  if (ctx.direction === "backward") {
10290
10665
  return def.innerType._zod.run(payload, ctx);
@@ -10297,7 +10672,8 @@ var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
10297
10672
  };
10298
10673
  });
10299
10674
  function handleReadonlyResult(payload) {
10300
- payload.value = Object.freeze(payload.value);
10675
+ if (!payload.memo)
10676
+ payload.value = Object.freeze(payload.value);
10301
10677
  return payload;
10302
10678
  }
10303
10679
  var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
@@ -10334,7 +10710,244 @@ function handleRefineResult(result, payload, input, inst) {
10334
10710
  }
10335
10711
  }
10336
10712
 
10337
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/en.js
10713
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/memoizer.js
10714
+ var $ZodCyclicError = class extends Error {
10715
+ constructor() {
10716
+ super(`Cannot parse a reference cycle that closes through a transform`);
10717
+ this.name = "ZodCyclicError";
10718
+ }
10719
+ };
10720
+ var STATE = "~memo";
10721
+ var NO_ISSUES = [];
10722
+ function cloneIssues(issues) {
10723
+ return issues.map((iss) => iss.path ? { ...iss, path: iss.path.slice() } : { ...iss });
10724
+ }
10725
+ var recursive = /* @__PURE__ */ new WeakMap();
10726
+ function isRecursive(inst, stack) {
10727
+ const cached2 = recursive.get(inst);
10728
+ if (cached2 !== void 0)
10729
+ return cached2;
10730
+ if (stack.has(inst))
10731
+ return true;
10732
+ stack.add(inst);
10733
+ let result = false;
10734
+ const check = (child) => {
10735
+ if (!result && child?._zod && isRecursive(child, stack))
10736
+ result = true;
10737
+ };
10738
+ const def = inst._zod.def;
10739
+ const kind = def.type;
10740
+ switch (kind) {
10741
+ case "object": {
10742
+ for (const key of Reflect.ownKeys(def.shape))
10743
+ check(def.shape[key]);
10744
+ check(def.catchall);
10745
+ break;
10746
+ }
10747
+ case "array":
10748
+ check(def.element);
10749
+ break;
10750
+ case "tuple":
10751
+ for (const el of def.items)
10752
+ check(el);
10753
+ check(def.rest);
10754
+ break;
10755
+ case "record":
10756
+ case "map":
10757
+ check(def.keyType);
10758
+ check(def.valueType);
10759
+ break;
10760
+ case "set":
10761
+ check(def.valueType);
10762
+ break;
10763
+ case "union":
10764
+ for (const el of def.options)
10765
+ check(el);
10766
+ break;
10767
+ case "intersection":
10768
+ check(def.left);
10769
+ check(def.right);
10770
+ break;
10771
+ case "optional":
10772
+ case "nullable":
10773
+ case "default":
10774
+ case "prefault":
10775
+ case "catch":
10776
+ case "readonly":
10777
+ case "nonoptional":
10778
+ case "promise":
10779
+ case "success":
10780
+ check(def.innerType);
10781
+ break;
10782
+ case "pipe":
10783
+ check(def.in);
10784
+ check(def.out);
10785
+ break;
10786
+ case "function":
10787
+ check(def.input);
10788
+ check(def.output);
10789
+ break;
10790
+ // reading `_zod.innerType` resolves the getter once and caches it
10791
+ case "lazy":
10792
+ check(inst._zod.innerType);
10793
+ break;
10794
+ // a leaf by choice: `parts` are regex fragments, not data positions
10795
+ case "template_literal":
10796
+ // leaves
10797
+ case "string":
10798
+ case "number":
10799
+ case "int":
10800
+ case "boolean":
10801
+ case "bigint":
10802
+ case "symbol":
10803
+ case "undefined":
10804
+ case "null":
10805
+ case "void":
10806
+ case "never":
10807
+ case "any":
10808
+ case "unknown":
10809
+ case "date":
10810
+ case "nan":
10811
+ case "enum":
10812
+ case "literal":
10813
+ case "file":
10814
+ case "transform":
10815
+ case "custom":
10816
+ break;
10817
+ default: {
10818
+ for (const key in def) {
10819
+ const desc = Object.getOwnPropertyDescriptor(def, key);
10820
+ if (!desc || desc.get)
10821
+ continue;
10822
+ const value = desc.value;
10823
+ if (!value || typeof value !== "object")
10824
+ continue;
10825
+ if (value._zod)
10826
+ check(value);
10827
+ else if (Array.isArray(value))
10828
+ for (const el of value)
10829
+ check(el);
10830
+ }
10831
+ }
10832
+ }
10833
+ stack.delete(inst);
10834
+ recursive.set(inst, result);
10835
+ return result;
10836
+ }
10837
+ function bucketFor(state, inst) {
10838
+ let bucket = state.buckets.get(inst);
10839
+ if (!bucket) {
10840
+ bucket = /* @__PURE__ */ new Map();
10841
+ state.buckets.set(inst, bucket);
10842
+ }
10843
+ return bucket;
10844
+ }
10845
+ var handoff;
10846
+ var open = [];
10847
+ var memo = {
10848
+ alloc(_inst, payload, empty) {
10849
+ const bucket = handoff;
10850
+ if (!bucket)
10851
+ return empty;
10852
+ handoff = void 0;
10853
+ const entry = { value: empty, issues: null };
10854
+ bucket.set(payload.value, entry);
10855
+ open.push(entry);
10856
+ return empty;
10857
+ },
10858
+ guard(inst) {
10859
+ var _a3;
10860
+ (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
10861
+ inst._zod.deferred.push(() => {
10862
+ const base = inst._zod.parse;
10863
+ const wrapped = (payload, ctx) => {
10864
+ if (ctx.direction !== "backward" && isBackEdge(ctx, payload.value))
10865
+ throw new $ZodCyclicError();
10866
+ return base(payload, ctx);
10867
+ };
10868
+ inst._zod.parse = wrapped;
10869
+ if (inst._zod.run === base)
10870
+ inst._zod.run = wrapped;
10871
+ });
10872
+ },
10873
+ attach(inst) {
10874
+ var _a3;
10875
+ let isRecursiveInst;
10876
+ let lastCtx;
10877
+ let lastBucket;
10878
+ (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
10879
+ inst._zod.deferred.push(() => {
10880
+ const base = inst._zod.parse;
10881
+ const wrapped = (payload, ctx) => {
10882
+ if (isRecursiveInst === void 0) {
10883
+ isRecursiveInst = isRecursive(inst, /* @__PURE__ */ new Set());
10884
+ if (!isRecursiveInst) {
10885
+ inst._zod.parse = base;
10886
+ if (inst._zod.run === wrapped)
10887
+ inst._zod.run = base;
10888
+ return base(payload, ctx);
10889
+ }
10890
+ }
10891
+ const input = payload.value;
10892
+ if (input === null || typeof input !== "object")
10893
+ return base(payload, ctx);
10894
+ let state = ctx[STATE];
10895
+ if (!state) {
10896
+ state = { buckets: /* @__PURE__ */ new Map(), backEdges: void 0 };
10897
+ ctx[STATE] = state;
10898
+ }
10899
+ let bucket;
10900
+ if (lastCtx === ctx) {
10901
+ bucket = lastBucket;
10902
+ } else {
10903
+ bucket = bucketFor(state, inst);
10904
+ lastCtx = ctx;
10905
+ lastBucket = bucket;
10906
+ }
10907
+ const hit = bucket.get(input);
10908
+ if (hit) {
10909
+ payload.value = hit.value;
10910
+ if (hit.issues) {
10911
+ if (hit.issues.length)
10912
+ payload.issues.push(...cloneIssues(hit.issues));
10913
+ } else {
10914
+ payload.memo = true;
10915
+ state.backEdges ?? (state.backEdges = /* @__PURE__ */ new Set());
10916
+ state.backEdges.add(hit.value);
10917
+ }
10918
+ return payload;
10919
+ }
10920
+ handoff = bucket;
10921
+ const depth = open.length;
10922
+ const result = base(payload, ctx);
10923
+ handoff = void 0;
10924
+ const entry = open.length > depth ? open.pop() : void 0;
10925
+ if (result instanceof Promise) {
10926
+ return result.then((r) => {
10927
+ if (entry)
10928
+ entry.issues = r.issues.length ? cloneIssues(r.issues) : NO_ISSUES;
10929
+ return r;
10930
+ });
10931
+ }
10932
+ if (entry)
10933
+ entry.issues = result.issues.length ? cloneIssues(result.issues) : NO_ISSUES;
10934
+ return result;
10935
+ };
10936
+ inst._zod.parse = wrapped;
10937
+ if (inst._zod.run === base)
10938
+ inst._zod.run = wrapped;
10939
+ });
10940
+ }
10941
+ };
10942
+ function memoizer() {
10943
+ return memo;
10944
+ }
10945
+ function isBackEdge(ctx, value) {
10946
+ const backEdges = ctx[STATE]?.backEdges;
10947
+ return backEdges !== void 0 && value !== null && typeof value === "object" && backEdges.has(value);
10948
+ }
10949
+
10950
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/en.js
10338
10951
  var error = () => {
10339
10952
  const Sizable = {
10340
10953
  string: { unit: "characters", verb: "to have" },
@@ -10374,6 +10987,7 @@ var error = () => {
10374
10987
  base64url: "base64url-encoded string",
10375
10988
  json_string: "JSON string",
10376
10989
  e164: "E.164 number",
10990
+ credit_card: "credit card number",
10377
10991
  jwt: "JWT",
10378
10992
  template_literal: "input"
10379
10993
  };
@@ -10382,12 +10996,18 @@ var error = () => {
10382
10996
  nan: "NaN"
10383
10997
  // All other type names omitted - they fall back to raw values via ?? operator
10384
10998
  };
10999
+ function getTypeName(type, input) {
11000
+ if (type === "number" && typeof input === "number" && !Number.isFinite(input)) {
11001
+ return String(input);
11002
+ }
11003
+ return TypeDictionary[type] ?? type;
11004
+ }
10385
11005
  return (issue2) => {
10386
11006
  switch (issue2.code) {
10387
11007
  case "invalid_type": {
10388
- const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
11008
+ const expected = getTypeName(issue2.expected);
10389
11009
  const receivedType = parsedType(issue2.input);
10390
- const received = TypeDictionary[receivedType] ?? receivedType;
11010
+ const received = getTypeName(receivedType, issue2.input);
10391
11011
  return `Invalid input: expected ${expected}, received ${received}`;
10392
11012
  }
10393
11013
  case "invalid_value":
@@ -10395,14 +11015,14 @@ var error = () => {
10395
11015
  return `Invalid input: expected ${stringifyPrimitive(issue2.values[0])}`;
10396
11016
  return `Invalid option: expected one of ${joinValues(issue2.values, "|")}`;
10397
11017
  case "too_big": {
10398
- const adj = issue2.inclusive ? "<=" : "<";
11018
+ const adj = issue2.exact ? "exactly " : issue2.inclusive ? "<=" : "<";
10399
11019
  const sizing = getSizing(issue2.origin);
10400
11020
  if (sizing)
10401
11021
  return `Too big: expected ${issue2.origin ?? "value"} to have ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elements"}`;
10402
11022
  return `Too big: expected ${issue2.origin ?? "value"} to be ${adj}${issue2.maximum.toString()}`;
10403
11023
  }
10404
11024
  case "too_small": {
10405
- const adj = issue2.inclusive ? ">=" : ">";
11025
+ const adj = issue2.exact ? "exactly " : issue2.inclusive ? ">=" : ">";
10406
11026
  const sizing = getSizing(issue2.origin);
10407
11027
  if (sizing) {
10408
11028
  return `Too small: expected ${issue2.origin} to have ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
@@ -10433,6 +11053,9 @@ var error = () => {
10433
11053
  const opts = issue2.options.map((o) => `'${o}'`).join(" | ");
10434
11054
  return `Invalid discriminator value. Expected ${opts}`;
10435
11055
  }
11056
+ if (issue2.inclusive === false) {
11057
+ return "Invalid input: more than one option matched";
11058
+ }
10436
11059
  return "Invalid input";
10437
11060
  case "invalid_element":
10438
11061
  return `Invalid value in ${issue2.origin}`;
@@ -10447,7 +11070,7 @@ function en_default() {
10447
11070
  };
10448
11071
  }
10449
11072
 
10450
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js
11073
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/registries.js
10451
11074
  var _a2;
10452
11075
  var $ZodRegistry = class {
10453
11076
  constructor() {
@@ -10495,7 +11118,7 @@ function registry() {
10495
11118
  (_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
10496
11119
  var globalRegistry = globalThis.__zod_globalRegistry;
10497
11120
 
10498
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js
11121
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/api.js
10499
11122
  // @__NO_SIDE_EFFECTS__
10500
11123
  function _string(Class2, params) {
10501
11124
  return new Class2({
@@ -11050,7 +11673,8 @@ function _superRefine(fn, params) {
11050
11673
  if (_issue.fatal)
11051
11674
  _issue.continue = false;
11052
11675
  _issue.code ?? (_issue.code = "custom");
11053
- _issue.input ?? (_issue.input = payload.value);
11676
+ if (!("input" in _issue))
11677
+ _issue.input = payload.value;
11054
11678
  _issue.inst ?? (_issue.inst = ch);
11055
11679
  _issue.continue ?? (_issue.continue = !ch._zod.def.abort);
11056
11680
  payload.issues.push(issue(_issue));
@@ -11070,7 +11694,17 @@ function _check(fn, params) {
11070
11694
  return ch;
11071
11695
  }
11072
11696
 
11073
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js
11697
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/to-json-schema.js
11698
+ function assignProps(target, ...sources) {
11699
+ for (const source of sources) {
11700
+ for (const key of Reflect.ownKeys(source)) {
11701
+ if (Object.prototype.propertyIsEnumerable.call(source, key)) {
11702
+ assignProp(target, key, source[key]);
11703
+ }
11704
+ }
11705
+ }
11706
+ return target;
11707
+ }
11074
11708
  function initializeContext(params) {
11075
11709
  let target = params?.target ?? "draft-2020-12";
11076
11710
  if (target === "draft-4")
@@ -11087,11 +11721,24 @@ function initializeContext(params) {
11087
11721
  io: params?.io ?? "output",
11088
11722
  counter: 0,
11089
11723
  seen: /* @__PURE__ */ new Map(),
11724
+ sharedDefsExtractedFor: void 0,
11725
+ sharedEmitDoneFor: void 0,
11090
11726
  cycles: params?.cycles ?? "ref",
11091
11727
  reused: params?.reused ?? "inline",
11728
+ intersections: [],
11729
+ deferred: [],
11092
11730
  external: params?.external ?? void 0
11093
11731
  };
11094
11732
  }
11733
+ function handleUnrepresentable(schema, ctx, json, params, message) {
11734
+ const result = typeof ctx.unrepresentable === "function" ? ctx.unrepresentable({ zodSchema: schema, path: params.path, message }) : ctx.unrepresentable;
11735
+ if (result === "any")
11736
+ return false;
11737
+ if (result === void 0 || result === "throw")
11738
+ throw new Error(message);
11739
+ Object.assign(json, result);
11740
+ return true;
11741
+ }
11095
11742
  function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
11096
11743
  var _a3;
11097
11744
  const def = schema._zod.def;
@@ -11106,6 +11753,8 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
11106
11753
  }
11107
11754
  const result = { schema: {}, count: 1, cycle: void 0, path: _params.path };
11108
11755
  ctx.seen.set(schema, result);
11756
+ ctx.sharedDefsExtractedFor = void 0;
11757
+ ctx.sharedEmitDoneFor = void 0;
11109
11758
  const overrideSchema = schema._zod.toJSONSchema?.();
11110
11759
  if (overrideSchema) {
11111
11760
  result.schema = overrideSchema;
@@ -11135,7 +11784,7 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
11135
11784
  }
11136
11785
  const meta2 = ctx.metadataRegistry.get(schema);
11137
11786
  if (meta2)
11138
- Object.assign(result.schema, meta2);
11787
+ assignProps(result.schema, meta2);
11139
11788
  if (ctx.io === "input" && isTransforming(schema)) {
11140
11789
  delete result.schema.examples;
11141
11790
  delete result.schema.default;
@@ -11146,10 +11795,15 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
11146
11795
  const _result = ctx.seen.get(schema);
11147
11796
  return _result.schema;
11148
11797
  }
11798
+ function encodeJSONPointerSegment(segment) {
11799
+ return segment.replace(/~/g, "~0").replace(/\//g, "~1");
11800
+ }
11149
11801
  function extractDefs(ctx, schema) {
11150
11802
  const root = ctx.seen.get(schema);
11151
11803
  if (!root)
11152
11804
  throw new Error("Unprocessed schema. This is a bug in Zod.");
11805
+ if (ctx.external && ctx.sharedDefsExtractedFor === ctx.external)
11806
+ return;
11153
11807
  const idToSchema = /* @__PURE__ */ new Map();
11154
11808
  for (const entry of ctx.seen.entries()) {
11155
11809
  const id = ctx.metadataRegistry.get(entry[0])?.id;
@@ -11171,15 +11825,15 @@ function extractDefs(ctx, schema) {
11171
11825
  }
11172
11826
  const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
11173
11827
  entry[1].defId = id;
11174
- return { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}` };
11175
- }
11176
- if (entry[1] === root) {
11177
- return { ref: "#" };
11828
+ return { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${encodeJSONPointerSegment(id)}` };
11178
11829
  }
11179
11830
  const uriPrefix = `#`;
11180
11831
  const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
11832
+ if (entry[1] === root && !entry[1].schema.id) {
11833
+ return { ref: uriPrefix };
11834
+ }
11181
11835
  const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
11182
- return { defId, ref: defUriPrefix + defId };
11836
+ return { defId, ref: defUriPrefix + encodeJSONPointerSegment(defId) };
11183
11837
  };
11184
11838
  const extractToDef = (entry) => {
11185
11839
  if (entry[1].schema.$ref) {
@@ -11235,6 +11889,116 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11235
11889
  }
11236
11890
  }
11237
11891
  }
11892
+ if (ctx.external)
11893
+ ctx.sharedDefsExtractedFor = ctx.external;
11894
+ }
11895
+ function compactTypeUnion(schema) {
11896
+ const options = schema.anyOf;
11897
+ if (!Array.isArray(options) || options.length === 0 || schema.type !== void 0)
11898
+ return;
11899
+ const types = [];
11900
+ for (const option of options) {
11901
+ if (!option || typeof option !== "object")
11902
+ return;
11903
+ compactTypeUnion(option);
11904
+ const keys = Object.keys(option);
11905
+ if (keys.length !== 1 || keys[0] !== "type")
11906
+ return;
11907
+ const type = option.type;
11908
+ for (const member of Array.isArray(type) ? type : [type]) {
11909
+ if (typeof member !== "string")
11910
+ return;
11911
+ if (!types.includes(member))
11912
+ types.push(member);
11913
+ }
11914
+ }
11915
+ delete schema.anyOf;
11916
+ schema.type = types.length === 1 ? types[0] : types;
11917
+ }
11918
+ var FOLDABLE_KEYS = /* @__PURE__ */ new Set(["type", "properties", "required", "additionalProperties"]);
11919
+ var UNION_KEYS = ["oneOf", "anyOf"];
11920
+ function undeclaredConstraint(member) {
11921
+ const extra = member.additionalProperties;
11922
+ if (extra === void 0 || extra === false || typeof extra !== "object" || extra === null)
11923
+ return null;
11924
+ return Object.keys(extra).length ? extra : null;
11925
+ }
11926
+ function foldObjects(members2) {
11927
+ const objects = [];
11928
+ for (const member of members2) {
11929
+ if (typeof member !== "object" || member.type !== "object")
11930
+ return null;
11931
+ for (const key in member) {
11932
+ if (!FOLDABLE_KEYS.has(key))
11933
+ return null;
11934
+ }
11935
+ objects.push(member);
11936
+ }
11937
+ const properties = {};
11938
+ const required2 = /* @__PURE__ */ new Set();
11939
+ for (const object3 of objects) {
11940
+ for (const key in object3.properties) {
11941
+ if (Object.prototype.hasOwnProperty.call(properties, key))
11942
+ continue;
11943
+ const parts = [];
11944
+ for (const other of objects) {
11945
+ const part = other.properties?.[key] ?? undeclaredConstraint(other);
11946
+ if (part === null || part === void 0)
11947
+ continue;
11948
+ if (!parts.some((seen) => JSON.stringify(seen) === JSON.stringify(part)))
11949
+ parts.push(part);
11950
+ }
11951
+ const merged = parts.length === 1 ? parts[0] : foldObjects(parts) ?? { allOf: parts };
11952
+ assignProp(properties, key, merged);
11953
+ }
11954
+ for (const key of object3.required ?? [])
11955
+ required2.add(key);
11956
+ }
11957
+ const folded = { type: "object", properties };
11958
+ if (required2.size)
11959
+ folded.required = [...required2];
11960
+ if (objects.every((object3) => object3.additionalProperties === false)) {
11961
+ folded.additionalProperties = false;
11962
+ } else {
11963
+ const constraints = [];
11964
+ for (const object3 of objects) {
11965
+ const constraint = undeclaredConstraint(object3);
11966
+ if (constraint && !constraints.some((seen) => JSON.stringify(seen) === JSON.stringify(constraint)))
11967
+ constraints.push(constraint);
11968
+ }
11969
+ if (constraints.length === 1)
11970
+ folded.additionalProperties = constraints[0];
11971
+ else if (constraints.length > 1)
11972
+ folded.additionalProperties = { allOf: constraints };
11973
+ }
11974
+ return folded;
11975
+ }
11976
+ function foldIntersection(json) {
11977
+ const allOf = json.allOf;
11978
+ if (!Array.isArray(allOf) || allOf.length < 2)
11979
+ return;
11980
+ for (const key of FOLDABLE_KEYS)
11981
+ if (key in json)
11982
+ return;
11983
+ const unions = allOf.filter((m) => UNION_KEYS.some((k) => Array.isArray(m[k])));
11984
+ let folded = null;
11985
+ if (!unions.length) {
11986
+ folded = foldObjects(allOf);
11987
+ } else {
11988
+ const union2 = unions[0];
11989
+ const keyword = UNION_KEYS.find((k) => Array.isArray(union2[k]));
11990
+ if (Object.keys(union2).length !== 1)
11991
+ return;
11992
+ const rest = allOf.filter((m) => m !== union2);
11993
+ const branches = union2[keyword].map((branch) => foldObjects([...rest, branch]));
11994
+ if (branches.some((b) => !b))
11995
+ return;
11996
+ folded = { [keyword]: branches };
11997
+ }
11998
+ if (!folded)
11999
+ return;
12000
+ delete json.allOf;
12001
+ assignProps(json, folded);
11238
12002
  }
11239
12003
  function finalize(ctx, schema) {
11240
12004
  const root = ctx.seen.get(schema);
@@ -11256,9 +12020,9 @@ function finalize(ctx, schema) {
11256
12020
  schema2.allOf = schema2.allOf ?? [];
11257
12021
  schema2.allOf.push(refSchema);
11258
12022
  } else {
11259
- Object.assign(schema2, refSchema);
12023
+ assignProps(schema2, refSchema);
11260
12024
  }
11261
- Object.assign(schema2, _cached);
12025
+ assignProps(schema2, _cached);
11262
12026
  const isParentRef = zodSchema._zod.parent === ref;
11263
12027
  if (isParentRef) {
11264
12028
  for (const key in schema2) {
@@ -11302,8 +12066,36 @@ function finalize(ctx, schema) {
11302
12066
  path: seen.path ?? []
11303
12067
  });
11304
12068
  };
11305
- for (const entry of [...ctx.seen.entries()].reverse()) {
11306
- flattenRef(entry[0]);
12069
+ if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {
12070
+ for (const entry of [...ctx.seen.entries()].reverse()) {
12071
+ flattenRef(entry[0]);
12072
+ }
12073
+ if (ctx.target !== "openapi-3.0") {
12074
+ for (const entry of ctx.seen.entries()) {
12075
+ compactTypeUnion(entry[1].def ?? entry[1].schema);
12076
+ }
12077
+ }
12078
+ for (const rewrite of ctx.deferred)
12079
+ rewrite();
12080
+ if (ctx.intersections.length) {
12081
+ const carriers = /* @__PURE__ */ new Map();
12082
+ for (const seen of ctx.seen.values()) {
12083
+ for (const json of [seen.schema, seen.def]) {
12084
+ const allOf = json?.allOf;
12085
+ if (!Array.isArray(allOf))
12086
+ continue;
12087
+ const existing = carriers.get(allOf);
12088
+ if (existing)
12089
+ existing.push(json);
12090
+ else
12091
+ carriers.set(allOf, [json]);
12092
+ }
12093
+ }
12094
+ for (const allOf of ctx.intersections) {
12095
+ for (const json of carriers.get(allOf) ?? [])
12096
+ foldIntersection(json);
12097
+ }
12098
+ }
11307
12099
  }
11308
12100
  const result = {};
11309
12101
  if (ctx.target === "draft-2020-12") {
@@ -11319,19 +12111,23 @@ function finalize(ctx, schema) {
11319
12111
  throw new Error("Schema is missing an `id` property");
11320
12112
  result.$id = ctx.external.uri(id);
11321
12113
  }
11322
- Object.assign(result, root.def ?? root.schema);
12114
+ assignProps(result, root.defId ? root.schema : root.def ?? root.schema);
11323
12115
  const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
11324
12116
  if (rootMetaId !== void 0 && result.id === rootMetaId)
11325
12117
  delete result.id;
11326
12118
  const defs = ctx.external?.defs ?? {};
11327
- for (const entry of ctx.seen.entries()) {
11328
- const seen = entry[1];
11329
- if (seen.def && seen.defId) {
11330
- if (seen.def.id === seen.defId)
11331
- delete seen.def.id;
11332
- defs[seen.defId] = seen.def;
12119
+ if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {
12120
+ for (const entry of ctx.seen.entries()) {
12121
+ const seen = entry[1];
12122
+ if (seen.def && seen.defId) {
12123
+ if (seen.def.id === seen.defId)
12124
+ delete seen.def.id;
12125
+ assignProp(defs, seen.defId, seen.def);
12126
+ }
11333
12127
  }
11334
12128
  }
12129
+ if (ctx.external)
12130
+ ctx.sharedEmitDoneFor = ctx.external;
11335
12131
  if (ctx.external) ; else {
11336
12132
  if (Object.keys(defs).length > 0) {
11337
12133
  if (ctx.target === "draft-2020-12") {
@@ -11373,7 +12169,7 @@ function isTransforming(_schema, _ctx) {
11373
12169
  return isTransforming(def.valueType, ctx);
11374
12170
  if (def.type === "lazy")
11375
12171
  return isTransforming(def.getter(), ctx);
11376
- if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") {
12172
+ 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") {
11377
12173
  return isTransforming(def.innerType, ctx);
11378
12174
  }
11379
12175
  if (def.type === "intersection") {
@@ -11426,7 +12222,7 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
11426
12222
  return finalize(ctx, schema);
11427
12223
  };
11428
12224
 
11429
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.js
12225
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/json-schema-processors.js
11430
12226
  var formatMap = {
11431
12227
  guid: "uuid",
11432
12228
  url: "uri",
@@ -11438,7 +12234,7 @@ var formatMap = {
11438
12234
  var stringProcessor = (schema, ctx, _json, _params) => {
11439
12235
  const json = _json;
11440
12236
  json.type = "string";
11441
- const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
12237
+ const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema._zod.bag;
11442
12238
  if (typeof minimum === "number")
11443
12239
  json.minLength = minimum;
11444
12240
  if (typeof maximum === "number")
@@ -11447,19 +12243,19 @@ var stringProcessor = (schema, ctx, _json, _params) => {
11447
12243
  json.format = formatMap[format] ?? format;
11448
12244
  if (json.format === "")
11449
12245
  delete json.format;
11450
- if (format === "time") {
12246
+ if (format === "time" || laxFormat) {
11451
12247
  delete json.format;
11452
12248
  }
11453
12249
  }
11454
12250
  if (contentEncoding)
11455
12251
  json.contentEncoding = contentEncoding;
11456
12252
  if (patterns && patterns.size > 0) {
11457
- const regexes = [...patterns];
11458
- if (regexes.length === 1)
11459
- json.pattern = regexes[0].source;
11460
- else if (regexes.length > 1) {
12253
+ const patternList = [...patterns];
12254
+ if (patternList.length === 1)
12255
+ json.pattern = patternList[0].source;
12256
+ else if (patternList.length > 1) {
11461
12257
  json.allOf = [
11462
- ...regexes.map((regex) => ({
12258
+ ...patternList.map((regex) => ({
11463
12259
  ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
11464
12260
  pattern: regex.source
11465
12261
  }))
@@ -11467,7 +12263,7 @@ var stringProcessor = (schema, ctx, _json, _params) => {
11467
12263
  }
11468
12264
  }
11469
12265
  };
11470
- var numberProcessor = (schema, ctx, _json, _params) => {
12266
+ var numberProcessor = (schema, ctx, _json, params) => {
11471
12267
  const json = _json;
11472
12268
  const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
11473
12269
  if (typeof format === "string" && format.includes("int"))
@@ -11497,16 +12293,18 @@ var numberProcessor = (schema, ctx, _json, _params) => {
11497
12293
  } else if (typeof maximum === "number") {
11498
12294
  json.maximum = maximum;
11499
12295
  }
11500
- if (typeof multipleOf === "number")
11501
- json.multipleOf = multipleOf;
12296
+ if (typeof multipleOf === "number") {
12297
+ if (Number.isFinite(multipleOf) && multipleOf !== 0)
12298
+ json.multipleOf = Math.abs(multipleOf);
12299
+ else
12300
+ handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${multipleOf} cannot be represented in JSON Schema`);
12301
+ }
11502
12302
  };
11503
12303
  var booleanProcessor = (_schema, _ctx, json, _params) => {
11504
12304
  json.type = "boolean";
11505
12305
  };
11506
- var bigintProcessor = (_schema, ctx, _json, _params) => {
11507
- if (ctx.unrepresentable === "throw") {
11508
- throw new Error("BigInt cannot be represented in JSON Schema");
11509
- }
12306
+ var bigintProcessor = (schema, ctx, json, params) => {
12307
+ handleUnrepresentable(schema, ctx, json, params, "BigInt cannot be represented in JSON Schema");
11510
12308
  };
11511
12309
  var nullProcessor = (_schema, ctx, json, _params) => {
11512
12310
  if (ctx.target === "openapi-3.0") {
@@ -11524,34 +12322,37 @@ var anyProcessor = (_schema, _ctx, _json, _params) => {
11524
12322
  };
11525
12323
  var unknownProcessor = (_schema, _ctx, _json, _params) => {
11526
12324
  };
11527
- var dateProcessor = (_schema, ctx, _json, _params) => {
11528
- if (ctx.unrepresentable === "throw") {
11529
- throw new Error("Date cannot be represented in JSON Schema");
11530
- }
12325
+ var dateProcessor = (schema, ctx, json, params) => {
12326
+ handleUnrepresentable(schema, ctx, json, params, "Date cannot be represented in JSON Schema");
11531
12327
  };
11532
12328
  var enumProcessor = (schema, _ctx, json, _params) => {
11533
12329
  const def = schema._zod.def;
11534
12330
  const values = getEnumValues(def.entries);
12331
+ if (values.length === 0) {
12332
+ json.not = {};
12333
+ return;
12334
+ }
11535
12335
  if (values.every((v) => typeof v === "number"))
11536
12336
  json.type = "number";
11537
12337
  if (values.every((v) => typeof v === "string"))
11538
12338
  json.type = "string";
11539
12339
  json.enum = values;
11540
12340
  };
11541
- var literalProcessor = (schema, ctx, json, _params) => {
12341
+ var literalProcessor = (schema, ctx, json, params) => {
11542
12342
  const def = schema._zod.def;
12343
+ if (def.values.length === 0) {
12344
+ json.not = {};
12345
+ return;
12346
+ }
11543
12347
  const vals = [];
11544
12348
  for (const val of def.values) {
11545
12349
  if (val === void 0) {
11546
- if (ctx.unrepresentable === "throw") {
11547
- throw new Error("Literal `undefined` cannot be represented in JSON Schema");
11548
- }
12350
+ if (handleUnrepresentable(schema, ctx, json, params, "Literal `undefined` cannot be represented in JSON Schema"))
12351
+ return;
11549
12352
  } else if (typeof val === "bigint") {
11550
- if (ctx.unrepresentable === "throw") {
11551
- throw new Error("BigInt literals cannot be represented in JSON Schema");
11552
- } else {
11553
- vals.push(Number(val));
11554
- }
12353
+ if (handleUnrepresentable(schema, ctx, json, params, "BigInt literals cannot be represented in JSON Schema"))
12354
+ return;
12355
+ vals.push(Number(val));
11555
12356
  } else {
11556
12357
  vals.push(val);
11557
12358
  }
@@ -11576,15 +12377,11 @@ var literalProcessor = (schema, ctx, json, _params) => {
11576
12377
  json.enum = vals;
11577
12378
  }
11578
12379
  };
11579
- var customProcessor = (_schema, ctx, _json, _params) => {
11580
- if (ctx.unrepresentable === "throw") {
11581
- throw new Error("Custom types cannot be represented in JSON Schema");
11582
- }
12380
+ var customProcessor = (schema, ctx, json, params) => {
12381
+ handleUnrepresentable(schema, ctx, json, params, "Custom types cannot be represented in JSON Schema");
11583
12382
  };
11584
- var transformProcessor = (_schema, ctx, _json, _params) => {
11585
- if (ctx.unrepresentable === "throw") {
11586
- throw new Error("Transforms cannot be represented in JSON Schema");
11587
- }
12383
+ var transformProcessor = (schema, ctx, json, params) => {
12384
+ handleUnrepresentable(schema, ctx, json, params, "Transforms cannot be represented in JSON Schema");
11588
12385
  };
11589
12386
  var arrayProcessor = (schema, ctx, _json, params) => {
11590
12387
  const json = _json;
@@ -11600,25 +12397,39 @@ var arrayProcessor = (schema, ctx, _json, params) => {
11600
12397
  path: [...params.path, "items"]
11601
12398
  });
11602
12399
  };
12400
+ function inputOptin(schema) {
12401
+ const def = schema._zod.def;
12402
+ if (def.type === "pipe" && def.in._zod.traits.has("$ZodTransform")) {
12403
+ return inputOptin(def.out);
12404
+ }
12405
+ if (def.type === "catch") {
12406
+ return inputOptin(def.innerType);
12407
+ }
12408
+ return schema._zod.optin;
12409
+ }
11603
12410
  var objectProcessor = (schema, ctx, _json, params) => {
11604
12411
  const json = _json;
11605
12412
  const def = schema._zod.def;
12413
+ const shape = def.shape;
12414
+ const symbolKeys = Object.getOwnPropertySymbols(shape);
12415
+ if (symbolKeys.length && handleUnrepresentable(schema, ctx, json, params, "Symbol keys cannot be represented in JSON Schema")) {
12416
+ return;
12417
+ }
11606
12418
  json.type = "object";
11607
12419
  json.properties = {};
11608
- const shape = def.shape;
11609
12420
  for (const key in shape) {
11610
- json.properties[key] = process2(shape[key], ctx, {
12421
+ assignProp(json.properties, key, process2(shape[key], ctx, {
11611
12422
  ...params,
11612
12423
  path: [...params.path, "properties", key]
11613
- });
12424
+ }));
11614
12425
  }
11615
12426
  const allKeys = new Set(Object.keys(shape));
11616
12427
  const requiredKeys = new Set([...allKeys].filter((key) => {
11617
- const v = def.shape[key]._zod;
12428
+ const field = def.shape[key];
11618
12429
  if (ctx.io === "input") {
11619
- return v.optin === void 0;
12430
+ return inputOptin(field) === void 0;
11620
12431
  } else {
11621
- return v.optout === void 0;
12432
+ return field._zod.optout === void 0;
11622
12433
  }
11623
12434
  }));
11624
12435
  if (requiredKeys.size > 0) {
@@ -11665,7 +12476,71 @@ var intersectionProcessor = (schema, ctx, json, params) => {
11665
12476
  ...isSimpleIntersection(b) ? b.allOf : [b]
11666
12477
  ];
11667
12478
  json.allOf = allOf;
12479
+ ctx.intersections.push(allOf);
11668
12480
  };
12481
+ function stringifyKeyNames(bySchema, json, visited) {
12482
+ if (json.$ref) {
12483
+ if (visited.has(json))
12484
+ return json;
12485
+ visited.add(json);
12486
+ const def = bySchema.get(json)?.def;
12487
+ if (!def)
12488
+ return json;
12489
+ const inlined = stringifyKeyNames(bySchema, def, visited);
12490
+ return inlined === def ? json : inlined;
12491
+ }
12492
+ for (const keyword of ["anyOf", "oneOf"]) {
12493
+ const branches = json[keyword];
12494
+ if (!Array.isArray(branches))
12495
+ continue;
12496
+ const mapped = branches.map((branch) => stringifyKeyNames(bySchema, branch, visited));
12497
+ if (mapped.some((branch, i) => branch !== branches[i]))
12498
+ json = { ...json, [keyword]: mapped };
12499
+ }
12500
+ const types = Array.isArray(json.type) ? json.type : [json.type];
12501
+ const numericType = !types.includes("string") && types.some((t) => t === "number" || t === "integer");
12502
+ const values = json.enum ?? (json.const !== void 0 ? [json.const] : void 0);
12503
+ if (!numericType && !values?.some((v) => typeof v === "number"))
12504
+ return json;
12505
+ const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id, ...rest } = json;
12506
+ if (rest.enum)
12507
+ rest.enum = rest.enum.map((v) => typeof v === "number" ? String(v) : v);
12508
+ else if (typeof rest.const === "number")
12509
+ rest.const = String(rest.const);
12510
+ if (!numericType)
12511
+ return rest;
12512
+ rest.type = "string";
12513
+ if (!values)
12514
+ rest.pattern = (types.includes("number") ? number : integer).source;
12515
+ return rest;
12516
+ }
12517
+ var pendingRecords = /* @__PURE__ */ new WeakMap();
12518
+ function rewriteKeyNames(ctx) {
12519
+ const bySchema = /* @__PURE__ */ new Map();
12520
+ for (const entry of ctx.seen.values()) {
12521
+ if (entry.def && !bySchema.has(entry.schema))
12522
+ bySchema.set(entry.schema, entry);
12523
+ }
12524
+ const rewrites = /* @__PURE__ */ new Map();
12525
+ for (const record2 of pendingRecords.get(ctx) ?? []) {
12526
+ const seen = ctx.seen.get(record2);
12527
+ const names = (seen?.def ?? seen?.schema)?.propertyNames;
12528
+ if (!names || names === true || rewrites.has(names))
12529
+ continue;
12530
+ const rewritten = stringifyKeyNames(bySchema, names, /* @__PURE__ */ new Set());
12531
+ if (rewritten !== names)
12532
+ rewrites.set(names, rewritten);
12533
+ }
12534
+ if (!rewrites.size)
12535
+ return;
12536
+ for (const entry of ctx.seen.values()) {
12537
+ for (const carrier of [entry.schema, entry.def]) {
12538
+ const rewritten = carrier && rewrites.get(carrier.propertyNames);
12539
+ if (rewritten)
12540
+ carrier.propertyNames = rewritten;
12541
+ }
12542
+ }
12543
+ }
11669
12544
  var recordProcessor = (schema, ctx, _json, params) => {
11670
12545
  const json = _json;
11671
12546
  const def = schema._zod.def;
@@ -11680,7 +12555,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
11680
12555
  });
11681
12556
  json.patternProperties = {};
11682
12557
  for (const pattern of patterns) {
11683
- json.patternProperties[pattern.source] = valueSchema;
12558
+ assignProp(json.patternProperties, pattern.source, valueSchema);
11684
12559
  }
11685
12560
  } else {
11686
12561
  if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
@@ -11688,6 +12563,13 @@ var recordProcessor = (schema, ctx, _json, params) => {
11688
12563
  ...params,
11689
12564
  path: [...params.path, "propertyNames"]
11690
12565
  });
12566
+ let pending = pendingRecords.get(ctx);
12567
+ if (!pending) {
12568
+ pending = [];
12569
+ pendingRecords.set(ctx, pending);
12570
+ ctx.deferred.push(() => rewriteKeyNames(ctx));
12571
+ }
12572
+ pending.push(schema);
11691
12573
  }
11692
12574
  json.additionalProperties = process2(def.valueType, ctx, {
11693
12575
  ...params,
@@ -11695,10 +12577,11 @@ var recordProcessor = (schema, ctx, _json, params) => {
11695
12577
  });
11696
12578
  }
11697
12579
  const keyValues = keyType._zod.values;
11698
- if (keyValues) {
12580
+ const omittableOnInput = ctx.io === "input" && inputOptin(def.valueType) !== void 0;
12581
+ if (keyValues && !def.partial && !omittableOnInput) {
11699
12582
  const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
11700
12583
  if (validKeyValues.length > 0) {
11701
- json.required = validKeyValues;
12584
+ json.required = validKeyValues.map(String);
11702
12585
  }
11703
12586
  }
11704
12587
  };
@@ -11719,20 +12602,39 @@ var nonoptionalProcessor = (schema, ctx, _json, params) => {
11719
12602
  const seen = ctx.seen.get(schema);
11720
12603
  seen.ref = def.innerType;
11721
12604
  };
12605
+ var UNREPRESENTABLE_DEFAULT = /* @__PURE__ */ Symbol();
12606
+ function serializeDefaultValue(value, schema, ctx, json, params) {
12607
+ let unrepresentable = false;
12608
+ const serialized = JSON.stringify(value, (_, val) => {
12609
+ if (typeof val !== "bigint")
12610
+ return val;
12611
+ unrepresentable = true;
12612
+ return null;
12613
+ });
12614
+ if (!unrepresentable)
12615
+ return JSON.parse(serialized);
12616
+ handleUnrepresentable(schema, ctx, json, params, "BigInt defaults cannot be represented in JSON Schema");
12617
+ return UNREPRESENTABLE_DEFAULT;
12618
+ }
11722
12619
  var defaultProcessor = (schema, ctx, json, params) => {
11723
12620
  const def = schema._zod.def;
11724
12621
  process2(def.innerType, ctx, params);
11725
12622
  const seen = ctx.seen.get(schema);
11726
12623
  seen.ref = def.innerType;
11727
- json.default = JSON.parse(JSON.stringify(def.defaultValue));
12624
+ const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
12625
+ if (value !== UNREPRESENTABLE_DEFAULT)
12626
+ json.default = value;
11728
12627
  };
11729
12628
  var prefaultProcessor = (schema, ctx, json, params) => {
11730
12629
  const def = schema._zod.def;
11731
12630
  process2(def.innerType, ctx, params);
11732
12631
  const seen = ctx.seen.get(schema);
11733
12632
  seen.ref = def.innerType;
11734
- if (ctx.io === "input")
11735
- json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
12633
+ if (ctx.io !== "input")
12634
+ return;
12635
+ const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
12636
+ if (value !== UNREPRESENTABLE_DEFAULT)
12637
+ json._prefault = value;
11736
12638
  };
11737
12639
  var catchProcessor = (schema, ctx, json, params) => {
11738
12640
  const def = schema._zod.def;
@@ -11743,7 +12645,8 @@ var catchProcessor = (schema, ctx, json, params) => {
11743
12645
  try {
11744
12646
  catchValue = def.catchValue(void 0);
11745
12647
  } catch {
11746
- throw new Error("Dynamic catch values are not supported in JSON Schema");
12648
+ handleUnrepresentable(schema, ctx, json, params, "Dynamic catch values are not supported in JSON Schema");
12649
+ return;
11747
12650
  }
11748
12651
  json.default = catchValue;
11749
12652
  };
@@ -11769,7 +12672,7 @@ var optionalProcessor = (schema, ctx, _json, params) => {
11769
12672
  seen.ref = def.innerType;
11770
12673
  };
11771
12674
 
11772
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
12675
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
11773
12676
  function isZ4Schema(s) {
11774
12677
  const schema = s;
11775
12678
  return !!schema._zod;
@@ -11832,87 +12735,52 @@ function getLiteralValue(schema) {
11832
12735
  return void 0;
11833
12736
  }
11834
12737
 
11835
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.js
11836
- var iso_exports = {};
11837
- __export(iso_exports, {
11838
- ZodISODate: () => ZodISODate,
11839
- ZodISODateTime: () => ZodISODateTime,
11840
- ZodISODuration: () => ZodISODuration,
11841
- ZodISOTime: () => ZodISOTime,
11842
- date: () => date2,
11843
- datetime: () => datetime2,
11844
- duration: () => duration2,
11845
- time: () => time2
11846
- });
11847
- var ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
11848
- $ZodISODateTime.init(inst, def);
11849
- ZodStringFormat.init(inst, def);
11850
- });
11851
- function datetime2(params) {
11852
- return _isoDateTime(ZodISODateTime, params);
11853
- }
11854
- var ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
11855
- $ZodISODate.init(inst, def);
11856
- ZodStringFormat.init(inst, def);
11857
- });
11858
- function date2(params) {
11859
- return _isoDate(ZodISODate, params);
11860
- }
11861
- var ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
11862
- $ZodISOTime.init(inst, def);
11863
- ZodStringFormat.init(inst, def);
11864
- });
11865
- function time2(params) {
11866
- return _isoTime(ZodISOTime, params);
11867
- }
11868
- var ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
11869
- $ZodISODuration.init(inst, def);
11870
- ZodStringFormat.init(inst, def);
11871
- });
11872
- function duration2(params) {
11873
- return _isoDuration(ZodISODuration, params);
12738
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/errors.js
12739
+ var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
12740
+ function _lazyMethod(proto, key, make) {
12741
+ Object.defineProperty(proto, key, {
12742
+ configurable: true,
12743
+ enumerable: false,
12744
+ get() {
12745
+ const value = make(this);
12746
+ Object.defineProperty(this, key, { value, configurable: true, writable: true });
12747
+ return value;
12748
+ },
12749
+ set(value) {
12750
+ Object.defineProperty(this, key, { value, configurable: true, writable: true });
12751
+ }
12752
+ });
11874
12753
  }
11875
-
11876
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/errors.js
11877
12754
  var initializer2 = (inst, issues) => {
11878
12755
  $ZodError.init(inst, issues);
11879
12756
  inst.name = "ZodError";
11880
- Object.defineProperties(inst, {
11881
- format: {
11882
- value: (mapper) => formatError(inst, mapper)
11883
- // enumerable: false,
11884
- },
11885
- flatten: {
11886
- value: (mapper) => flattenError(inst, mapper)
11887
- // enumerable: false,
11888
- },
11889
- addIssue: {
11890
- value: (issue2) => {
11891
- inst.issues.push(issue2);
11892
- inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
11893
- }
11894
- // enumerable: false,
11895
- },
11896
- addIssues: {
11897
- value: (issues2) => {
11898
- inst.issues.push(...issues2);
11899
- inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
11900
- }
11901
- // enumerable: false,
11902
- },
11903
- isEmpty: {
11904
- get() {
11905
- return inst.issues.length === 0;
11906
- }
11907
- // enumerable: false,
12757
+ const proto = Object.getPrototypeOf(inst);
12758
+ if (_installedErrorProtos.has(proto))
12759
+ return;
12760
+ _installedErrorProtos.add(proto);
12761
+ _lazyMethod(proto, "format", (self) => (mapper) => formatError(self, mapper));
12762
+ _lazyMethod(proto, "flatten", (self) => (mapper) => flattenError(self, mapper));
12763
+ _lazyMethod(proto, "addIssue", (self) => (issue2) => {
12764
+ self.issues.push(issue2);
12765
+ self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
12766
+ });
12767
+ _lazyMethod(proto, "addIssues", (self) => (issues2) => {
12768
+ self.issues.push(...issues2);
12769
+ self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
12770
+ });
12771
+ Object.defineProperty(proto, "isEmpty", {
12772
+ configurable: true,
12773
+ enumerable: false,
12774
+ get() {
12775
+ return this.issues.length === 0;
11908
12776
  }
11909
12777
  });
11910
12778
  };
11911
- var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, {
12779
+ var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, void 0, {
11912
12780
  Parent: Error
11913
12781
  });
11914
12782
 
11915
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.js
12783
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/parse.js
11916
12784
  var parse2 = /* @__PURE__ */ _parse(ZodRealError);
11917
12785
  var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
11918
12786
  var safeParse3 = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -11926,172 +12794,183 @@ var safeDecode2 = /* @__PURE__ */ _safeDecode(ZodRealError);
11926
12794
  var safeEncodeAsync2 = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
11927
12795
  var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
11928
12796
 
11929
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.js
11930
- var _installedGroups = /* @__PURE__ */ new WeakMap();
11931
- function _installLazyMethods(inst, group, methods) {
11932
- const proto = Object.getPrototypeOf(inst);
11933
- let installed = _installedGroups.get(proto);
11934
- if (!installed) {
11935
- installed = /* @__PURE__ */ new Set();
11936
- _installedGroups.set(proto, installed);
11937
- }
11938
- if (installed.has(group))
11939
- return;
11940
- installed.add(group);
11941
- for (const key in methods) {
11942
- const fn = methods[key];
11943
- Object.defineProperty(proto, key, {
11944
- configurable: true,
11945
- enumerable: false,
11946
- get() {
11947
- const bound = fn.bind(this);
11948
- Object.defineProperty(this, key, {
11949
- configurable: true,
11950
- writable: true,
11951
- enumerable: true,
11952
- value: bound
11953
- });
11954
- return bound;
11955
- },
11956
- set(v) {
11957
- Object.defineProperty(this, key, {
11958
- configurable: true,
11959
- writable: true,
11960
- enumerable: true,
11961
- value: v
11962
- });
11963
- }
11964
- });
11965
- }
12797
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/schemas.js
12798
+ function _ensureDefaultLocale() {
12799
+ if (!globalConfig.localeError)
12800
+ config(en_default());
12801
+ }
12802
+ function _ensureDefaultMemoizer() {
12803
+ if (!globalConfig.memoizer)
12804
+ config({ memoizer: memoizer() });
11966
12805
  }
11967
12806
  var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
12807
+ _ensureDefaultLocale();
11968
12808
  $ZodType.init(inst, def);
11969
- Object.assign(inst["~standard"], {
11970
- jsonSchema: {
11971
- input: createStandardJSONSchemaMethod(inst, "input"),
11972
- output: createStandardJSONSchemaMethod(inst, "output")
11973
- }
11974
- });
11975
- inst.toJSONSchema = createToJSONSchemaMethod(inst, {});
11976
12809
  inst.def = def;
11977
12810
  inst.type = def.type;
11978
- Object.defineProperty(inst, "_def", { value: def });
11979
- inst.parse = (data, params) => parse2(inst, data, params, { callee: inst.parse });
11980
- inst.safeParse = (data, params) => safeParse3(inst, data, params);
11981
- inst.parseAsync = async (data, params) => parseAsync2(inst, data, params, { callee: inst.parseAsync });
11982
- inst.safeParseAsync = async (data, params) => safeParseAsync2(inst, data, params);
11983
- inst.spa = inst.safeParseAsync;
11984
- inst.encode = (data, params) => encode2(inst, data, params);
11985
- inst.decode = (data, params) => decode2(inst, data, params);
11986
- inst.encodeAsync = async (data, params) => encodeAsync2(inst, data, params);
11987
- inst.decodeAsync = async (data, params) => decodeAsync2(inst, data, params);
11988
- inst.safeEncode = (data, params) => safeEncode2(inst, data, params);
11989
- inst.safeDecode = (data, params) => safeDecode2(inst, data, params);
11990
- inst.safeEncodeAsync = async (data, params) => safeEncodeAsync2(inst, data, params);
11991
- inst.safeDecodeAsync = async (data, params) => safeDecodeAsync2(inst, data, params);
11992
- _installLazyMethods(inst, "ZodType", {
11993
- check(...chks) {
11994
- const def2 = this.def;
11995
- return this.clone(util_exports.mergeDefs(def2, {
11996
- checks: [
11997
- ...def2.checks ?? [],
11998
- ...chks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
11999
- ]
12000
- }), { parent: true });
12001
- },
12002
- with(...chks) {
12003
- return this.check(...chks);
12004
- },
12005
- clone(def2, params) {
12006
- return clone(this, def2, params);
12007
- },
12008
- brand() {
12009
- return this;
12010
- },
12011
- register(reg, meta2) {
12012
- reg.add(this, meta2);
12013
- return this;
12014
- },
12015
- refine(check, params) {
12016
- return this.check(refine(check, params));
12017
- },
12018
- superRefine(refinement, params) {
12019
- return this.check(superRefine(refinement, params));
12020
- },
12021
- overwrite(fn) {
12022
- return this.check(_overwrite(fn));
12023
- },
12024
- optional() {
12025
- return optional(this);
12026
- },
12027
- exactOptional() {
12028
- return exactOptional(this);
12029
- },
12030
- nullable() {
12031
- return nullable(this);
12032
- },
12033
- nullish() {
12034
- return optional(nullable(this));
12035
- },
12036
- nonoptional(params) {
12037
- return nonoptional(this, params);
12038
- },
12039
- array() {
12040
- return array(this);
12041
- },
12042
- or(arg) {
12043
- return union([this, arg]);
12044
- },
12045
- and(arg) {
12046
- return intersection(this, arg);
12047
- },
12048
- transform(tx) {
12049
- return pipe(this, transform(tx));
12050
- },
12051
- default(d) {
12052
- return _default(this, d);
12053
- },
12054
- prefault(d) {
12055
- return prefault(this, d);
12056
- },
12057
- catch(params) {
12058
- return _catch(this, params);
12059
- },
12060
- pipe(target) {
12061
- return pipe(this, target);
12062
- },
12063
- readonly() {
12064
- return readonly(this);
12065
- },
12066
- describe(description) {
12067
- const cl = this.clone();
12068
- globalRegistry.add(cl, { description });
12069
- return cl;
12070
- },
12071
- meta(...args) {
12072
- if (args.length === 0)
12073
- return globalRegistry.get(this);
12074
- const cl = this.clone();
12075
- globalRegistry.add(cl, args[0]);
12076
- return cl;
12077
- },
12078
- isOptional() {
12079
- return this.safeParse(void 0).success;
12080
- },
12081
- isNullable() {
12082
- return this.safeParse(null).success;
12083
- },
12084
- apply(fn) {
12085
- return fn(this);
12086
- }
12087
- });
12088
- Object.defineProperty(inst, "description", {
12089
- get() {
12090
- return globalRegistry.get(inst)?.description;
12091
- },
12092
- configurable: true
12093
- });
12094
12811
  return inst;
12812
+ }, {
12813
+ check(...chks) {
12814
+ const def = this.def;
12815
+ return this.clone(util_exports.mergeDefs(def, {
12816
+ checks: [
12817
+ ...def.checks ?? [],
12818
+ ...chks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
12819
+ ]
12820
+ }), { parent: true });
12821
+ },
12822
+ with(...chks) {
12823
+ return this.check(...chks);
12824
+ },
12825
+ clone(def, params) {
12826
+ return clone(this, def, params);
12827
+ },
12828
+ brand() {
12829
+ return this;
12830
+ },
12831
+ register(reg, meta2) {
12832
+ reg.add(this, meta2);
12833
+ return this;
12834
+ },
12835
+ refine(check, params) {
12836
+ return this.check(refine(check, params));
12837
+ },
12838
+ superRefine(refinement, params) {
12839
+ return this.check(superRefine(refinement, params));
12840
+ },
12841
+ overwrite(fn) {
12842
+ return this.check(_overwrite(fn));
12843
+ },
12844
+ optional() {
12845
+ return optional(this);
12846
+ },
12847
+ exactOptional() {
12848
+ return exactOptional(this);
12849
+ },
12850
+ nullable() {
12851
+ return nullable(this);
12852
+ },
12853
+ nullish() {
12854
+ return optional(nullable(this));
12855
+ },
12856
+ nonoptional(params) {
12857
+ return nonoptional(this, params);
12858
+ },
12859
+ array() {
12860
+ return array(this);
12861
+ },
12862
+ or(arg) {
12863
+ return union([this, arg]);
12864
+ },
12865
+ and(arg) {
12866
+ return intersection(this, arg);
12867
+ },
12868
+ transform(tx) {
12869
+ return pipe(this, transform(tx));
12870
+ },
12871
+ default(d) {
12872
+ return _default(this, d);
12873
+ },
12874
+ prefault(d) {
12875
+ return prefault(this, d);
12876
+ },
12877
+ catch(params) {
12878
+ return _catch(this, params);
12879
+ },
12880
+ pipe(target) {
12881
+ return pipe(this, target);
12882
+ },
12883
+ readonly() {
12884
+ return readonly(this);
12885
+ },
12886
+ describe(description) {
12887
+ const cl = this.clone();
12888
+ globalRegistry.add(cl, { description });
12889
+ return cl;
12890
+ },
12891
+ meta(...args) {
12892
+ if (args.length === 0)
12893
+ return globalRegistry.get(this);
12894
+ const cl = this.clone();
12895
+ globalRegistry.add(cl, args[0]);
12896
+ return cl;
12897
+ },
12898
+ isOptional() {
12899
+ return this.safeParse(void 0).success;
12900
+ },
12901
+ isNullable() {
12902
+ return this.safeParse(null).success;
12903
+ },
12904
+ apply(fn, ...args) {
12905
+ return args.length === 0 ? fn(this) : fn(this, ...args);
12906
+ },
12907
+ // Overrides core's `~standard` to add `jsonSchema`. Must stay a prototype entry: redefining it per instance demotes instances to dictionary mode.
12908
+ get "~standard"() {
12909
+ return util_exports.hide(this, "~standard", {
12910
+ ...standardProps(this),
12911
+ jsonSchema: {
12912
+ input: createStandardJSONSchemaMethod(this, "input"),
12913
+ output: createStandardJSONSchemaMethod(this, "output")
12914
+ }
12915
+ });
12916
+ },
12917
+ set "~standard"(value) {
12918
+ util_exports.own(this, "~standard", value);
12919
+ },
12920
+ parse: function _parse2(data, params) {
12921
+ return parse2(this, data, params, { callee: _parse2 });
12922
+ },
12923
+ parseAsync: async function _parseAsync2(data, params) {
12924
+ return await parseAsync2(this, data, params, { callee: _parseAsync2 });
12925
+ },
12926
+ safeParse(data, params) {
12927
+ return safeParse3(this, data, params);
12928
+ },
12929
+ async safeParseAsync(data, params) {
12930
+ return safeParseAsync2(this, data, params);
12931
+ },
12932
+ // `spa` is an alias: same function object as `safeParseAsync`, as before.
12933
+ get spa() {
12934
+ return this?.safeParseAsync;
12935
+ },
12936
+ set spa(value) {
12937
+ util_exports.own(this, "spa", value);
12938
+ },
12939
+ encode: function _encode2(data, params) {
12940
+ return encode2(this, data, params, { callee: _encode2 });
12941
+ },
12942
+ decode: function _decode2(data, params) {
12943
+ return decode2(this, data, params, { callee: _decode2 });
12944
+ },
12945
+ encodeAsync: async function _encodeAsync2(data, params) {
12946
+ return await encodeAsync2(this, data, params, { callee: _encodeAsync2 });
12947
+ },
12948
+ decodeAsync: async function _decodeAsync2(data, params) {
12949
+ return await decodeAsync2(this, data, params, { callee: _decodeAsync2 });
12950
+ },
12951
+ safeEncode(data, params) {
12952
+ return safeEncode2(this, data, params);
12953
+ },
12954
+ safeDecode(data, params) {
12955
+ return safeDecode2(this, data, params);
12956
+ },
12957
+ async safeEncodeAsync(data, params) {
12958
+ return safeEncodeAsync2(this, data, params);
12959
+ },
12960
+ async safeDecodeAsync(data, params) {
12961
+ return safeDecodeAsync2(this, data, params);
12962
+ },
12963
+ toJSONSchema(params) {
12964
+ return createToJSONSchemaMethod(this, {})(params);
12965
+ },
12966
+ // Reads through to the registry on every access, so it must not cache.
12967
+ get description() {
12968
+ return globalRegistry.get(this)?.description;
12969
+ },
12970
+ // No setter: `schema._def = x` throws, as it did when `_def` was a non-writable own property.
12971
+ get _def() {
12972
+ return this._zod.def;
12973
+ }
12095
12974
  });
12096
12975
  var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
12097
12976
  $ZodString.init(inst, def);
@@ -12101,84 +12980,135 @@ var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
12101
12980
  inst.format = bag.format ?? null;
12102
12981
  inst.minLength = bag.minimum ?? null;
12103
12982
  inst.maxLength = bag.maximum ?? null;
12104
- _installLazyMethods(inst, "_ZodString", {
12105
- regex(...args) {
12106
- return this.check(_regex(...args));
12107
- },
12108
- includes(...args) {
12109
- return this.check(_includes(...args));
12110
- },
12111
- startsWith(...args) {
12112
- return this.check(_startsWith(...args));
12113
- },
12114
- endsWith(...args) {
12115
- return this.check(_endsWith(...args));
12116
- },
12117
- min(...args) {
12118
- return this.check(_minLength(...args));
12119
- },
12120
- max(...args) {
12121
- return this.check(_maxLength(...args));
12122
- },
12123
- length(...args) {
12124
- return this.check(_length(...args));
12125
- },
12126
- nonempty(...args) {
12127
- return this.check(_minLength(1, ...args));
12128
- },
12129
- lowercase(params) {
12130
- return this.check(_lowercase(params));
12131
- },
12132
- uppercase(params) {
12133
- return this.check(_uppercase(params));
12134
- },
12135
- trim() {
12136
- return this.check(_trim());
12137
- },
12138
- normalize(...args) {
12139
- return this.check(_normalize(...args));
12140
- },
12141
- toLowerCase() {
12142
- return this.check(_toLowerCase());
12143
- },
12144
- toUpperCase() {
12145
- return this.check(_toUpperCase());
12146
- },
12147
- slugify() {
12148
- return this.check(_slugify());
12149
- }
12150
- });
12983
+ }, {
12984
+ regex(...args) {
12985
+ return this.check(_regex(...args));
12986
+ },
12987
+ includes(...args) {
12988
+ return this.check(_includes(...args));
12989
+ },
12990
+ startsWith(...args) {
12991
+ return this.check(_startsWith(...args));
12992
+ },
12993
+ endsWith(...args) {
12994
+ return this.check(_endsWith(...args));
12995
+ },
12996
+ min(...args) {
12997
+ return this.check(_minLength(...args));
12998
+ },
12999
+ max(...args) {
13000
+ return this.check(_maxLength(...args));
13001
+ },
13002
+ length(...args) {
13003
+ return this.check(_length(...args));
13004
+ },
13005
+ nonempty(...args) {
13006
+ return this.check(_minLength(1, ...args));
13007
+ },
13008
+ lowercase(params) {
13009
+ return this.check(_lowercase(params));
13010
+ },
13011
+ uppercase(params) {
13012
+ return this.check(_uppercase(params));
13013
+ },
13014
+ trim() {
13015
+ return this.check(_trim());
13016
+ },
13017
+ normalize(...args) {
13018
+ return this.check(_normalize(...args));
13019
+ },
13020
+ toLowerCase() {
13021
+ return this.check(_toLowerCase());
13022
+ },
13023
+ toUpperCase() {
13024
+ return this.check(_toUpperCase());
13025
+ },
13026
+ slugify() {
13027
+ return this.check(_slugify());
13028
+ }
12151
13029
  });
12152
13030
  var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
12153
13031
  $ZodString.init(inst, def);
12154
13032
  _ZodString.init(inst, def);
12155
- inst.email = (params) => inst.check(_email(ZodEmail, params));
12156
- inst.url = (params) => inst.check(_url(ZodURL, params));
12157
- inst.jwt = (params) => inst.check(_jwt(ZodJWT, params));
12158
- inst.emoji = (params) => inst.check(_emoji2(ZodEmoji, params));
12159
- inst.guid = (params) => inst.check(_guid(ZodGUID, params));
12160
- inst.uuid = (params) => inst.check(_uuid(ZodUUID, params));
12161
- inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params));
12162
- inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params));
12163
- inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params));
12164
- inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params));
12165
- inst.guid = (params) => inst.check(_guid(ZodGUID, params));
12166
- inst.cuid = (params) => inst.check(_cuid(ZodCUID, params));
12167
- inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params));
12168
- inst.ulid = (params) => inst.check(_ulid(ZodULID, params));
12169
- inst.base64 = (params) => inst.check(_base64(ZodBase64, params));
12170
- inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params));
12171
- inst.xid = (params) => inst.check(_xid(ZodXID, params));
12172
- inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params));
12173
- inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params));
12174
- inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params));
12175
- inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params));
12176
- inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params));
12177
- inst.e164 = (params) => inst.check(_e164(ZodE164, params));
12178
- inst.datetime = (params) => inst.check(datetime2(params));
12179
- inst.date = (params) => inst.check(date2(params));
12180
- inst.time = (params) => inst.check(time2(params));
12181
- inst.duration = (params) => inst.check(duration2(params));
13033
+ }, {
13034
+ email(params) {
13035
+ return this.check(_email(ZodEmail, params));
13036
+ },
13037
+ url(params) {
13038
+ return this.check(_url(ZodURL, params));
13039
+ },
13040
+ jwt(params) {
13041
+ return this.check(_jwt(ZodJWT, params));
13042
+ },
13043
+ emoji(params) {
13044
+ return this.check(_emoji2(ZodEmoji, params));
13045
+ },
13046
+ guid(params) {
13047
+ return this.check(_guid(ZodGUID, params));
13048
+ },
13049
+ uuid(params) {
13050
+ return this.check(_uuid(ZodUUID, params));
13051
+ },
13052
+ uuidv4(params) {
13053
+ return this.check(_uuidv4(ZodUUID, params));
13054
+ },
13055
+ uuidv6(params) {
13056
+ return this.check(_uuidv6(ZodUUID, params));
13057
+ },
13058
+ uuidv7(params) {
13059
+ return this.check(_uuidv7(ZodUUID, params));
13060
+ },
13061
+ nanoid(params) {
13062
+ return this.check(_nanoid(ZodNanoID, params));
13063
+ },
13064
+ cuid(params) {
13065
+ return this.check(_cuid(ZodCUID, params));
13066
+ },
13067
+ cuid2(params) {
13068
+ return this.check(_cuid2(ZodCUID2, params));
13069
+ },
13070
+ ulid(params) {
13071
+ return this.check(_ulid(ZodULID, params));
13072
+ },
13073
+ base64(params) {
13074
+ return this.check(_base64(ZodBase64, params));
13075
+ },
13076
+ base64url(params) {
13077
+ return this.check(_base64url(ZodBase64URL, params));
13078
+ },
13079
+ xid(params) {
13080
+ return this.check(_xid(ZodXID, params));
13081
+ },
13082
+ ksuid(params) {
13083
+ return this.check(_ksuid(ZodKSUID, params));
13084
+ },
13085
+ ipv4(params) {
13086
+ return this.check(_ipv4(ZodIPv4, params));
13087
+ },
13088
+ ipv6(params) {
13089
+ return this.check(_ipv6(ZodIPv6, params));
13090
+ },
13091
+ cidrv4(params) {
13092
+ return this.check(_cidrv4(ZodCIDRv4, params));
13093
+ },
13094
+ cidrv6(params) {
13095
+ return this.check(_cidrv6(ZodCIDRv6, params));
13096
+ },
13097
+ e164(params) {
13098
+ return this.check(_e164(ZodE164, params));
13099
+ },
13100
+ datetime(params) {
13101
+ return this.check(_isoDateTime(ZodISODateTime, params));
13102
+ },
13103
+ date(params) {
13104
+ return this.check(_isoDate(ZodISODate, params));
13105
+ },
13106
+ time(params) {
13107
+ return this.check(_isoTime(ZodISOTime, params));
13108
+ },
13109
+ duration(params) {
13110
+ return this.check(_isoDuration(ZodISODuration, params));
13111
+ }
12182
13112
  });
12183
13113
  function string2(params) {
12184
13114
  return _string(ZodString, params);
@@ -12187,6 +13117,22 @@ var ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def
12187
13117
  $ZodStringFormat.init(inst, def);
12188
13118
  _ZodString.init(inst, def);
12189
13119
  });
13120
+ var ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
13121
+ $ZodISODateTime.init(inst, def);
13122
+ ZodStringFormat.init(inst, def);
13123
+ });
13124
+ var ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
13125
+ $ZodISODate.init(inst, def);
13126
+ ZodStringFormat.init(inst, def);
13127
+ });
13128
+ var ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
13129
+ $ZodISOTime.init(inst, def);
13130
+ ZodStringFormat.init(inst, def);
13131
+ });
13132
+ var ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
13133
+ $ZodISODuration.init(inst, def);
13134
+ ZodStringFormat.init(inst, def);
13135
+ });
12190
13136
  var ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => {
12191
13137
  $ZodEmail.init(inst, def);
12192
13138
  ZodStringFormat.init(inst, def);
@@ -12264,65 +13210,64 @@ var ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => {
12264
13210
  });
12265
13211
  var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
12266
13212
  $ZodJWT.init(inst, def);
12267
- ZodStringFormat.init(inst, def);
12268
- });
12269
- var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
12270
- $ZodNumber.init(inst, def);
12271
- ZodType.init(inst, def);
12272
- inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json);
12273
- _installLazyMethods(inst, "ZodNumber", {
12274
- gt(value, params) {
12275
- return this.check(_gt(value, params));
12276
- },
12277
- gte(value, params) {
12278
- return this.check(_gte(value, params));
12279
- },
12280
- min(value, params) {
12281
- return this.check(_gte(value, params));
12282
- },
12283
- lt(value, params) {
12284
- return this.check(_lt(value, params));
12285
- },
12286
- lte(value, params) {
12287
- return this.check(_lte(value, params));
12288
- },
12289
- max(value, params) {
12290
- return this.check(_lte(value, params));
12291
- },
12292
- int(params) {
12293
- return this.check(int(params));
12294
- },
12295
- safe(params) {
12296
- return this.check(int(params));
12297
- },
12298
- positive(params) {
12299
- return this.check(_gt(0, params));
12300
- },
12301
- nonnegative(params) {
12302
- return this.check(_gte(0, params));
12303
- },
12304
- negative(params) {
12305
- return this.check(_lt(0, params));
12306
- },
12307
- nonpositive(params) {
12308
- return this.check(_lte(0, params));
12309
- },
12310
- multipleOf(value, params) {
12311
- return this.check(_multipleOf(value, params));
12312
- },
12313
- step(value, params) {
12314
- return this.check(_multipleOf(value, params));
12315
- },
12316
- finite() {
12317
- return this;
12318
- }
12319
- });
13213
+ ZodStringFormat.init(inst, def);
13214
+ });
13215
+ var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
13216
+ $ZodNumber.init(inst, def);
13217
+ ZodType.init(inst, def);
13218
+ inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
12320
13219
  const bag = inst._zod.bag;
12321
13220
  inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
12322
13221
  inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
12323
13222
  inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
12324
13223
  inst.isFinite = true;
12325
13224
  inst.format = bag.format ?? null;
13225
+ }, {
13226
+ gt(value, params) {
13227
+ return this.check(_gt(value, params));
13228
+ },
13229
+ gte(value, params) {
13230
+ return this.check(_gte(value, params));
13231
+ },
13232
+ min(value, params) {
13233
+ return this.check(_gte(value, params));
13234
+ },
13235
+ lt(value, params) {
13236
+ return this.check(_lt(value, params));
13237
+ },
13238
+ lte(value, params) {
13239
+ return this.check(_lte(value, params));
13240
+ },
13241
+ max(value, params) {
13242
+ return this.check(_lte(value, params));
13243
+ },
13244
+ int(params) {
13245
+ return this.check(int(params));
13246
+ },
13247
+ safe(params) {
13248
+ return this.check(int(params));
13249
+ },
13250
+ positive(params) {
13251
+ return this.check(_gt(0, params));
13252
+ },
13253
+ nonnegative(params) {
13254
+ return this.check(_gte(0, params));
13255
+ },
13256
+ negative(params) {
13257
+ return this.check(_lt(0, params));
13258
+ },
13259
+ nonpositive(params) {
13260
+ return this.check(_lte(0, params));
13261
+ },
13262
+ multipleOf(value, params) {
13263
+ return this.check(_multipleOf(value, params));
13264
+ },
13265
+ step(value, params) {
13266
+ return this.check(_multipleOf(value, params));
13267
+ },
13268
+ finite() {
13269
+ return this;
13270
+ }
12326
13271
  });
12327
13272
  function number2(params) {
12328
13273
  return _number(ZodNumber, params);
@@ -12345,24 +13290,45 @@ function boolean2(params) {
12345
13290
  var ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => {
12346
13291
  $ZodBigInt.init(inst, def);
12347
13292
  ZodType.init(inst, def);
12348
- inst._zod.processJSONSchema = (ctx, json, params) => bigintProcessor(inst, ctx);
12349
- inst.gte = (value, params) => inst.check(_gte(value, params));
12350
- inst.min = (value, params) => inst.check(_gte(value, params));
12351
- inst.gt = (value, params) => inst.check(_gt(value, params));
12352
- inst.gte = (value, params) => inst.check(_gte(value, params));
12353
- inst.min = (value, params) => inst.check(_gte(value, params));
12354
- inst.lt = (value, params) => inst.check(_lt(value, params));
12355
- inst.lte = (value, params) => inst.check(_lte(value, params));
12356
- inst.max = (value, params) => inst.check(_lte(value, params));
12357
- inst.positive = (params) => inst.check(_gt(BigInt(0), params));
12358
- inst.negative = (params) => inst.check(_lt(BigInt(0), params));
12359
- inst.nonpositive = (params) => inst.check(_lte(BigInt(0), params));
12360
- inst.nonnegative = (params) => inst.check(_gte(BigInt(0), params));
12361
- inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params));
13293
+ inst._zod.processJSONSchema = (ctx, json, params) => bigintProcessor(inst, ctx, json, params);
12362
13294
  const bag = inst._zod.bag;
12363
13295
  inst.minValue = bag.minimum ?? null;
12364
13296
  inst.maxValue = bag.maximum ?? null;
12365
13297
  inst.format = bag.format ?? null;
13298
+ }, {
13299
+ gte(value, params) {
13300
+ return this.check(_gte(value, params));
13301
+ },
13302
+ min(value, params) {
13303
+ return this.check(_gte(value, params));
13304
+ },
13305
+ gt(value, params) {
13306
+ return this.check(_gt(value, params));
13307
+ },
13308
+ lt(value, params) {
13309
+ return this.check(_lt(value, params));
13310
+ },
13311
+ lte(value, params) {
13312
+ return this.check(_lte(value, params));
13313
+ },
13314
+ max(value, params) {
13315
+ return this.check(_lte(value, params));
13316
+ },
13317
+ positive(params) {
13318
+ return this.check(_gt(BigInt(0), params));
13319
+ },
13320
+ negative(params) {
13321
+ return this.check(_lt(BigInt(0), params));
13322
+ },
13323
+ nonpositive(params) {
13324
+ return this.check(_lte(BigInt(0), params));
13325
+ },
13326
+ nonnegative(params) {
13327
+ return this.check(_gte(BigInt(0), params));
13328
+ },
13329
+ multipleOf(value, params) {
13330
+ return this.check(_multipleOf(value, params));
13331
+ }
12366
13332
  });
12367
13333
  var ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
12368
13334
  $ZodNull.init(inst, def);
@@ -12399,7 +13365,7 @@ function never(params) {
12399
13365
  var ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
12400
13366
  $ZodDate.init(inst, def);
12401
13367
  ZodType.init(inst, def);
12402
- inst._zod.processJSONSchema = (ctx, json, params) => dateProcessor(inst, ctx);
13368
+ inst._zod.processJSONSchema = (ctx, json, params) => dateProcessor(inst, ctx, json, params);
12403
13369
  inst.min = (value, params) => inst.check(_gte(value, params));
12404
13370
  inst.max = (value, params) => inst.check(_lte(value, params));
12405
13371
  const c = inst._zod.bag;
@@ -12407,79 +13373,80 @@ var ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
12407
13373
  inst.maxDate = c.maximum ? new Date(c.maximum) : null;
12408
13374
  });
12409
13375
  var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
13376
+ _ensureDefaultMemoizer();
12410
13377
  $ZodArray.init(inst, def);
12411
13378
  ZodType.init(inst, def);
12412
13379
  inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
12413
13380
  inst.element = def.element;
12414
- _installLazyMethods(inst, "ZodArray", {
12415
- min(n, params) {
12416
- return this.check(_minLength(n, params));
12417
- },
12418
- nonempty(params) {
12419
- return this.check(_minLength(1, params));
12420
- },
12421
- max(n, params) {
12422
- return this.check(_maxLength(n, params));
12423
- },
12424
- length(n, params) {
12425
- return this.check(_length(n, params));
12426
- },
12427
- unwrap() {
12428
- return this.element;
12429
- }
12430
- });
13381
+ }, {
13382
+ min(n, params) {
13383
+ return this.check(_minLength(n, params));
13384
+ },
13385
+ nonempty(params) {
13386
+ return this.check(_minLength(1, params));
13387
+ },
13388
+ max(n, params) {
13389
+ return this.check(_maxLength(n, params));
13390
+ },
13391
+ length(n, params) {
13392
+ return this.check(_length(n, params));
13393
+ },
13394
+ unwrap() {
13395
+ return this.element;
13396
+ }
12431
13397
  });
12432
13398
  function array(element, params) {
12433
13399
  return _array(ZodArray, element, params);
12434
13400
  }
12435
13401
  var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
13402
+ _ensureDefaultMemoizer();
12436
13403
  $ZodObjectJIT.init(inst, def);
12437
13404
  ZodType.init(inst, def);
12438
13405
  inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params);
12439
- util_exports.defineLazy(inst, "shape", () => {
12440
- return def.shape;
12441
- });
12442
- _installLazyMethods(inst, "ZodObject", {
12443
- keyof() {
12444
- return _enum(Object.keys(this._zod.def.shape));
12445
- },
12446
- catchall(catchall) {
12447
- return this.clone({ ...this._zod.def, catchall });
12448
- },
12449
- passthrough() {
12450
- return this.clone({ ...this._zod.def, catchall: unknown() });
12451
- },
12452
- loose() {
12453
- return this.clone({ ...this._zod.def, catchall: unknown() });
12454
- },
12455
- strict() {
12456
- return this.clone({ ...this._zod.def, catchall: never() });
12457
- },
12458
- strip() {
12459
- return this.clone({ ...this._zod.def, catchall: void 0 });
12460
- },
12461
- extend(incoming) {
12462
- return util_exports.extend(this, incoming);
12463
- },
12464
- safeExtend(incoming) {
12465
- return util_exports.safeExtend(this, incoming);
12466
- },
12467
- merge(other) {
12468
- return util_exports.merge(this, other);
12469
- },
12470
- pick(mask) {
12471
- return util_exports.pick(this, mask);
12472
- },
12473
- omit(mask) {
12474
- return util_exports.omit(this, mask);
12475
- },
12476
- partial(...args) {
12477
- return util_exports.partial(ZodOptional, this, args[0]);
12478
- },
12479
- required(...args) {
12480
- return util_exports.required(ZodNonOptional, this, args[0]);
12481
- }
12482
- });
13406
+ util_exports.installLazyProp(inst, "shape", (self) => self._zod.def.shape, false);
13407
+ }, {
13408
+ keyof() {
13409
+ return _enum(Object.keys(this._zod.def.shape));
13410
+ },
13411
+ catchall(catchall) {
13412
+ return this.clone({ ...this._zod.def, catchall });
13413
+ },
13414
+ passthrough() {
13415
+ return this.clone({ ...this._zod.def, catchall: unknown() });
13416
+ },
13417
+ loose() {
13418
+ return this.clone({ ...this._zod.def, catchall: unknown() });
13419
+ },
13420
+ strict() {
13421
+ return this.clone({ ...this._zod.def, catchall: never() });
13422
+ },
13423
+ strip() {
13424
+ return this.clone({ ...this._zod.def, catchall: void 0 });
13425
+ },
13426
+ extend(incoming) {
13427
+ return util_exports.extend(this, incoming);
13428
+ },
13429
+ safeExtend(incoming) {
13430
+ return util_exports.safeExtend(this, incoming);
13431
+ },
13432
+ merge(other) {
13433
+ return util_exports.merge(this, other);
13434
+ },
13435
+ pick(mask) {
13436
+ return util_exports.pick(this, mask);
13437
+ },
13438
+ omit(mask) {
13439
+ return util_exports.omit(this, mask);
13440
+ },
13441
+ partial(...args) {
13442
+ return util_exports.partial(ZodOptional, this, args[0]);
13443
+ },
13444
+ exactPartial(...args) {
13445
+ return util_exports.partial(ZodExactOptional, this, args[0], "exactPartial");
13446
+ },
13447
+ required(...args) {
13448
+ return util_exports.required(ZodNonOptional, this, args[0]);
13449
+ }
12483
13450
  });
12484
13451
  function object2(shape, params) {
12485
13452
  const def = {
@@ -12535,6 +13502,7 @@ function intersection(left, right) {
12535
13502
  });
12536
13503
  }
12537
13504
  var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
13505
+ _ensureDefaultMemoizer();
12538
13506
  $ZodRecord.init(inst, def);
12539
13507
  ZodType.init(inst, def);
12540
13508
  inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
@@ -12606,7 +13574,7 @@ function _enum(values, params) {
12606
13574
  var ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
12607
13575
  $ZodLiteral.init(inst, def);
12608
13576
  ZodType.init(inst, def);
12609
- inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json);
13577
+ inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json, params);
12610
13578
  inst.values = new Set(def.values);
12611
13579
  Object.defineProperty(inst, "value", {
12612
13580
  get() {
@@ -12625,9 +13593,10 @@ function literal(value, params) {
12625
13593
  });
12626
13594
  }
12627
13595
  var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
13596
+ _ensureDefaultMemoizer();
12628
13597
  $ZodTransform.init(inst, def);
12629
13598
  ZodType.init(inst, def);
12630
- inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx);
13599
+ inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params);
12631
13600
  inst._zod.parse = (payload, _ctx) => {
12632
13601
  if (_ctx.direction === "backward") {
12633
13602
  throw new $ZodEncodeError(inst.constructor.name);
@@ -12640,7 +13609,8 @@ var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
12640
13609
  if (_issue.fatal)
12641
13610
  _issue.continue = false;
12642
13611
  _issue.code ?? (_issue.code = "custom");
12643
- _issue.input ?? (_issue.input = payload.value);
13612
+ if (!("input" in _issue))
13613
+ _issue.input = payload.value;
12644
13614
  _issue.inst ?? (_issue.inst = inst);
12645
13615
  payload.issues.push(util_exports.issue(_issue));
12646
13616
  }
@@ -12649,12 +13619,10 @@ var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
12649
13619
  if (output instanceof Promise) {
12650
13620
  return output.then((output2) => {
12651
13621
  payload.value = output2;
12652
- payload.fallback = true;
12653
13622
  return payload;
12654
13623
  });
12655
13624
  }
12656
13625
  payload.value = output;
12657
- payload.fallback = true;
12658
13626
  return payload;
12659
13627
  };
12660
13628
  });
@@ -12755,7 +13723,7 @@ function _catch(innerType, catchValue) {
12755
13723
  return new ZodCatch({
12756
13724
  type: "catch",
12757
13725
  innerType,
12758
- catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
13726
+ catchValue: typeof catchValue === "function" ? catchValue : util_exports.constantCatch(catchValue)
12759
13727
  });
12760
13728
  }
12761
13729
  var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
@@ -12792,7 +13760,7 @@ function readonly(innerType) {
12792
13760
  var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
12793
13761
  $ZodCustom.init(inst, def);
12794
13762
  ZodType.init(inst, def);
12795
- inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx);
13763
+ inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
12796
13764
  });
12797
13765
  function custom(fn, _params) {
12798
13766
  return _custom(ZodCustom, fn ?? (() => true), _params);
@@ -12811,12 +13779,37 @@ function preprocess(fn, schema) {
12811
13779
  });
12812
13780
  }
12813
13781
 
12814
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/compat.js
13782
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/compat.js
12815
13783
  var ZodIssueCode = {
12816
13784
  custom: "custom"
12817
13785
  };
12818
13786
 
12819
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/coerce.js
13787
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/iso.js
13788
+ var iso_exports = {};
13789
+ __export(iso_exports, {
13790
+ ZodISODate: () => ZodISODate,
13791
+ ZodISODateTime: () => ZodISODateTime,
13792
+ ZodISODuration: () => ZodISODuration,
13793
+ ZodISOTime: () => ZodISOTime,
13794
+ date: () => date2,
13795
+ datetime: () => datetime2,
13796
+ duration: () => duration2,
13797
+ time: () => time2
13798
+ });
13799
+ function datetime2(params) {
13800
+ return _isoDateTime(ZodISODateTime, params);
13801
+ }
13802
+ function date2(params) {
13803
+ return _isoDate(ZodISODate, params);
13804
+ }
13805
+ function time2(params) {
13806
+ return _isoTime(ZodISOTime, params);
13807
+ }
13808
+ function duration2(params) {
13809
+ return _isoDuration(ZodISODuration, params);
13810
+ }
13811
+
13812
+ // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/coerce.js
12820
13813
  var coerce_exports = {};
12821
13814
  __export(coerce_exports, {
12822
13815
  bigint: () => bigint2,
@@ -12841,10 +13834,7 @@ function date3(params) {
12841
13834
  return _coercedDate(ZodDate, params);
12842
13835
  }
12843
13836
 
12844
- // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
12845
- config(en_default());
12846
-
12847
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
13837
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
12848
13838
  var LATEST_PROTOCOL_VERSION = "2025-11-25";
12849
13839
  var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
12850
13840
  var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
@@ -14364,15 +15354,15 @@ var UrlElicitationRequiredError = class extends McpError {
14364
15354
  }
14365
15355
  };
14366
15356
 
14367
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
15357
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
14368
15358
  function isTerminal(status) {
14369
15359
  return status === "completed" || status === "failed" || status === "cancelled";
14370
15360
  }
14371
15361
 
14372
- // ../../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
15362
+ // ../../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
14373
15363
  new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
14374
15364
 
14375
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
15365
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
14376
15366
  function getMethodLiteral(schema) {
14377
15367
  const shape = getObjectShape(schema);
14378
15368
  const methodSchema = shape?.method;
@@ -14393,7 +15383,7 @@ function parseWithCompat(schema, data) {
14393
15383
  return result.data;
14394
15384
  }
14395
15385
 
14396
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
15386
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
14397
15387
  var DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
14398
15388
  var Protocol = class {
14399
15389
  constructor(_options) {
@@ -15347,7 +16337,7 @@ function mergeCapabilities(base, additional) {
15347
16337
  return result;
15348
16338
  }
15349
16339
 
15350
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
16340
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
15351
16341
  var import_ajv = __toESM(require_ajv());
15352
16342
  var import_ajv_formats = __toESM(require_dist());
15353
16343
  function createDefaultAjvInstance() {
@@ -15415,7 +16405,7 @@ var AjvJsonSchemaValidator = class {
15415
16405
  }
15416
16406
  };
15417
16407
 
15418
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js
16408
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js
15419
16409
  var ExperimentalClientTasks = class {
15420
16410
  constructor(_client) {
15421
16411
  this._client = _client;
@@ -15569,7 +16559,7 @@ var ExperimentalClientTasks = class {
15569
16559
  }
15570
16560
  };
15571
16561
 
15572
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
16562
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
15573
16563
  function assertToolsCallTaskCapability(requests, method, entityName) {
15574
16564
  if (!requests) {
15575
16565
  throw new Error(`${entityName} does not support task creation (required for ${method})`);
@@ -15600,7 +16590,7 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
15600
16590
  }
15601
16591
  }
15602
16592
 
15603
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js
16593
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js
15604
16594
  function applyElicitationDefaults(schema, data) {
15605
16595
  if (!schema || data === null || typeof data !== "object")
15606
16596
  return;
@@ -16099,7 +17089,7 @@ var Client = class extends Protocol {
16099
17089
  }
16100
17090
  };
16101
17091
 
16102
- // ../../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/index.js
17092
+ // ../../node_modules/.pnpm/eventsource-parser@3.1.1/node_modules/eventsource-parser/dist/index.js
16103
17093
  var ParseError = class extends Error {
16104
17094
  constructor(message, options) {
16105
17095
  super(message), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;
@@ -16203,7 +17193,7 @@ ${value2}`, dataLines++;
16203
17193
  }
16204
17194
  if (firstCharCode === 105 && chunk.charCodeAt(start + 1) === 100 && chunk.charCodeAt(start + 2) === 58) {
16205
17195
  const value2 = chunk.slice(chunk.charCodeAt(start + 3) === SPACE ? start + 4 : start + 3, end);
16206
- id = value2.includes("\0") ? void 0 : value2;
17196
+ value2.includes("\0") || (id = value2);
16207
17197
  return;
16208
17198
  }
16209
17199
  if (firstCharCode === 58) {
@@ -16231,7 +17221,7 @@ ${value2}`, dataLines++;
16231
17221
  ${value}`, dataLines++;
16232
17222
  break;
16233
17223
  case "id":
16234
- id = value.includes("\0") ? void 0 : value;
17224
+ value.includes("\0") || (id = value);
16235
17225
  break;
16236
17226
  case "retry":
16237
17227
  /^\d+$/.test(value) ? onRetry(parseInt(value, 10)) : onError(
@@ -16394,11 +17384,11 @@ var EventSource = class extends EventTarget {
16394
17384
  return;
16395
17385
  }
16396
17386
  const decoder = new TextDecoder(), reader = body.getReader();
16397
- let open = true;
17387
+ let open2 = true;
16398
17388
  do {
16399
17389
  const { done, value } = await reader.read();
16400
- 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));
16401
- } while (open);
17390
+ 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));
17391
+ } while (open2);
16402
17392
  }), __privateAdd(this, _onFetchError, (err) => {
16403
17393
  __privateSet(this, _controller, void 0), !(err.name === "AbortError" || err.type === "aborted") && __privateMethod(this, _EventSource_instances, scheduleReconnect_fn).call(this, flattenError2(err));
16404
17394
  }), __privateAdd(this, _onEvent, (event) => {
@@ -16572,7 +17562,7 @@ function getBaseURL() {
16572
17562
  return doc && typeof doc == "object" && "baseURI" in doc && typeof doc.baseURI == "string" ? doc.baseURI : void 0;
16573
17563
  }
16574
17564
 
16575
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js
17565
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js
16576
17566
  function normalizeHeaders(headers) {
16577
17567
  if (!headers)
16578
17568
  return {};
@@ -16642,7 +17632,7 @@ async function pkceChallenge(length) {
16642
17632
  };
16643
17633
  }
16644
17634
 
16645
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
17635
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
16646
17636
  var SafeUrlSchema = url().superRefine((val, ctx) => {
16647
17637
  if (!URL.canParse(val)) {
16648
17638
  ctx.addIssue({
@@ -16786,7 +17776,7 @@ object2({
16786
17776
  token_type_hint: string2().optional()
16787
17777
  }).strip();
16788
17778
 
16789
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js
17779
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js
16790
17780
  function resourceUrlFromServerUrl(url2) {
16791
17781
  const resourceURL = typeof url2 === "string" ? new URL(url2) : new URL(url2.href);
16792
17782
  resourceURL.hash = "";
@@ -16806,7 +17796,7 @@ function checkResourceAllowed({ requestedResource, configuredResource }) {
16806
17796
  return requestedPath.startsWith(configuredPath);
16807
17797
  }
16808
17798
 
16809
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js
17799
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js
16810
17800
  var OAuthError = class extends Error {
16811
17801
  constructor(message, errorUri) {
16812
17802
  super(message);
@@ -16901,7 +17891,7 @@ var OAUTH_ERRORS = {
16901
17891
  [InvalidTargetError.errorCode]: InvalidTargetError
16902
17892
  };
16903
17893
 
16904
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js
17894
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js
16905
17895
  var UnauthorizedError = class extends Error {
16906
17896
  constructor(message) {
16907
17897
  super(message ?? "Unauthorized");
@@ -17441,7 +18431,7 @@ async function registerClient(authorizationServerUrl, { metadata, clientMetadata
17441
18431
  return OAuthClientInformationFullSchema.parse(await response.json());
17442
18432
  }
17443
18433
 
17444
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js
18434
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js
17445
18435
  var SseError = class extends Error {
17446
18436
  constructor(code, message, event) {
17447
18437
  super(`SSE error: ${message}`);
@@ -17632,10 +18622,10 @@ var SSEClientTransport = class {
17632
18622
  }
17633
18623
  };
17634
18624
 
17635
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js
18625
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js
17636
18626
  var import_cross_spawn = __toESM(require_cross_spawn());
17637
18627
 
17638
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
18628
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
17639
18629
  var STDIO_DEFAULT_MAX_BUFFER_SIZE = 10 * 1024 * 1024;
17640
18630
  var ReadBuffer = class {
17641
18631
  constructor(options) {
@@ -17672,7 +18662,7 @@ function serializeMessage(message) {
17672
18662
  return JSON.stringify(message) + "\n";
17673
18663
  }
17674
18664
 
17675
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js
18665
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js
17676
18666
  var DEFAULT_INHERITED_ENV_VARS = process3.platform === "win32" ? [
17677
18667
  "APPDATA",
17678
18668
  "HOMEDRIVE",
@@ -17843,7 +18833,7 @@ var StdioClientTransport = class {
17843
18833
  }
17844
18834
  };
17845
18835
 
17846
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.js
18836
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.js
17847
18837
  var import_content_type = __toESM(require_content_type());
17848
18838
  function mediaTypeEssence(header) {
17849
18839
  if (!header) {
@@ -17860,13 +18850,189 @@ function mediaTypeEssence(header) {
17860
18850
  }
17861
18851
  }
17862
18852
 
18853
+ // ../../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/index.js
18854
+ var ParseError2 = class extends Error {
18855
+ constructor(message, options) {
18856
+ super(message), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;
18857
+ }
18858
+ };
18859
+ var LF2 = 10;
18860
+ var CR2 = 13;
18861
+ var SPACE2 = 32;
18862
+ function noop2(_arg) {
18863
+ }
18864
+ function createParser2(config2) {
18865
+ if (typeof config2 == "function")
18866
+ throw new TypeError(
18867
+ "`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?"
18868
+ );
18869
+ const { onEvent = noop2, onError = noop2, onRetry = noop2, onComment, maxBufferSize } = config2, pendingFragments = [];
18870
+ let pendingFragmentsLength = 0, isFirstChunk = true, id, data = "", dataLines = 0, eventType, terminated = false;
18871
+ function feed(chunk) {
18872
+ if (terminated)
18873
+ throw new Error(
18874
+ "Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing."
18875
+ );
18876
+ if (isFirstChunk && (isFirstChunk = false, chunk.charCodeAt(0) === 239 && chunk.charCodeAt(1) === 187 && chunk.charCodeAt(2) === 191 && (chunk = chunk.slice(3))), pendingFragments.length === 0) {
18877
+ const trailing2 = processLines(chunk);
18878
+ trailing2 !== "" && (pendingFragments.push(trailing2), pendingFragmentsLength = trailing2.length), checkBufferSize();
18879
+ return;
18880
+ }
18881
+ if (chunk.indexOf(`
18882
+ `) === -1 && chunk.indexOf("\r") === -1) {
18883
+ pendingFragments.push(chunk), pendingFragmentsLength += chunk.length, checkBufferSize();
18884
+ return;
18885
+ }
18886
+ pendingFragments.push(chunk);
18887
+ const input = pendingFragments.join("");
18888
+ pendingFragments.length = 0, pendingFragmentsLength = 0;
18889
+ const trailing = processLines(input);
18890
+ trailing !== "" && (pendingFragments.push(trailing), pendingFragmentsLength = trailing.length), checkBufferSize();
18891
+ }
18892
+ function checkBufferSize() {
18893
+ maxBufferSize !== void 0 && (pendingFragmentsLength + data.length <= maxBufferSize || (terminated = true, pendingFragments.length = 0, pendingFragmentsLength = 0, id = void 0, data = "", dataLines = 0, eventType = void 0, onError(
18894
+ new ParseError2(`Buffered data exceeded max buffer size of ${maxBufferSize} characters`, {
18895
+ type: "max-buffer-size-exceeded"
18896
+ })
18897
+ )));
18898
+ }
18899
+ function processLines(chunk) {
18900
+ let searchIndex = 0;
18901
+ if (chunk.indexOf("\r") === -1) {
18902
+ let lfIndex = chunk.indexOf(`
18903
+ `, searchIndex);
18904
+ for (; lfIndex !== -1; ) {
18905
+ if (searchIndex === lfIndex) {
18906
+ dataLines > 0 && onEvent({ id, event: eventType, data }), id = void 0, data = "", dataLines = 0, eventType = void 0, searchIndex = lfIndex + 1, lfIndex = chunk.indexOf(`
18907
+ `, searchIndex);
18908
+ continue;
18909
+ }
18910
+ const firstCharCode = chunk.charCodeAt(searchIndex);
18911
+ if (isDataPrefix2(chunk, searchIndex, firstCharCode)) {
18912
+ const valueStart = chunk.charCodeAt(searchIndex + 5) === SPACE2 ? searchIndex + 6 : searchIndex + 5, value = chunk.slice(valueStart, lfIndex);
18913
+ if (dataLines === 0 && chunk.charCodeAt(lfIndex + 1) === LF2) {
18914
+ onEvent({ id, event: eventType, data: value }), id = void 0, data = "", eventType = void 0, searchIndex = lfIndex + 2, lfIndex = chunk.indexOf(`
18915
+ `, searchIndex);
18916
+ continue;
18917
+ }
18918
+ data = dataLines === 0 ? value : `${data}
18919
+ ${value}`, dataLines++;
18920
+ } else isEventPrefix2(chunk, searchIndex, firstCharCode) ? eventType = chunk.slice(
18921
+ chunk.charCodeAt(searchIndex + 6) === SPACE2 ? searchIndex + 7 : searchIndex + 6,
18922
+ lfIndex
18923
+ ) || void 0 : parseLine(chunk, searchIndex, lfIndex);
18924
+ searchIndex = lfIndex + 1, lfIndex = chunk.indexOf(`
18925
+ `, searchIndex);
18926
+ }
18927
+ return chunk.slice(searchIndex);
18928
+ }
18929
+ for (; searchIndex < chunk.length; ) {
18930
+ const crIndex = chunk.indexOf("\r", searchIndex), lfIndex = chunk.indexOf(`
18931
+ `, searchIndex);
18932
+ let lineEnd = -1;
18933
+ 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)
18934
+ break;
18935
+ parseLine(chunk, searchIndex, lineEnd), searchIndex = lineEnd + 1, chunk.charCodeAt(searchIndex - 1) === CR2 && chunk.charCodeAt(searchIndex) === LF2 && searchIndex++;
18936
+ }
18937
+ return chunk.slice(searchIndex);
18938
+ }
18939
+ function parseLine(chunk, start, end) {
18940
+ if (start === end) {
18941
+ dispatchEvent();
18942
+ return;
18943
+ }
18944
+ const firstCharCode = chunk.charCodeAt(start);
18945
+ if (isDataPrefix2(chunk, start, firstCharCode)) {
18946
+ const valueStart = chunk.charCodeAt(start + 5) === SPACE2 ? start + 6 : start + 5, value2 = chunk.slice(valueStart, end);
18947
+ data = dataLines === 0 ? value2 : `${data}
18948
+ ${value2}`, dataLines++;
18949
+ return;
18950
+ }
18951
+ if (isEventPrefix2(chunk, start, firstCharCode)) {
18952
+ eventType = chunk.slice(chunk.charCodeAt(start + 6) === SPACE2 ? start + 7 : start + 6, end) || void 0;
18953
+ return;
18954
+ }
18955
+ if (firstCharCode === 105 && chunk.charCodeAt(start + 1) === 100 && chunk.charCodeAt(start + 2) === 58) {
18956
+ const value2 = chunk.slice(chunk.charCodeAt(start + 3) === SPACE2 ? start + 4 : start + 3, end);
18957
+ id = value2.includes("\0") ? void 0 : value2;
18958
+ return;
18959
+ }
18960
+ if (firstCharCode === 58) {
18961
+ if (onComment) {
18962
+ const line2 = chunk.slice(start, end);
18963
+ onComment(line2.slice(chunk.charCodeAt(start + 1) === SPACE2 ? 2 : 1));
18964
+ }
18965
+ return;
18966
+ }
18967
+ const line = chunk.slice(start, end), fieldSeparatorIndex = line.indexOf(":");
18968
+ if (fieldSeparatorIndex === -1) {
18969
+ processField(line, "", line);
18970
+ return;
18971
+ }
18972
+ const field = line.slice(0, fieldSeparatorIndex), offset = line.charCodeAt(fieldSeparatorIndex + 1) === SPACE2 ? 2 : 1, value = line.slice(fieldSeparatorIndex + offset);
18973
+ processField(field, value, line);
18974
+ }
18975
+ function processField(field, value, line) {
18976
+ switch (field) {
18977
+ case "event":
18978
+ eventType = value || void 0;
18979
+ break;
18980
+ case "data":
18981
+ data = dataLines === 0 ? value : `${data}
18982
+ ${value}`, dataLines++;
18983
+ break;
18984
+ case "id":
18985
+ id = value.includes("\0") ? void 0 : value;
18986
+ break;
18987
+ case "retry":
18988
+ /^\d+$/.test(value) ? onRetry(parseInt(value, 10)) : onError(
18989
+ new ParseError2(`Invalid \`retry\` value: "${value}"`, {
18990
+ type: "invalid-retry",
18991
+ value,
18992
+ line
18993
+ })
18994
+ );
18995
+ break;
18996
+ default:
18997
+ onError(
18998
+ new ParseError2(
18999
+ `Unknown field "${field.length > 20 ? `${field.slice(0, 20)}\u2026` : field}"`,
19000
+ { type: "unknown-field", field, value, line }
19001
+ )
19002
+ );
19003
+ break;
19004
+ }
19005
+ }
19006
+ function dispatchEvent() {
19007
+ dataLines > 0 && onEvent({
19008
+ id,
19009
+ event: eventType,
19010
+ data
19011
+ }), id = void 0, data = "", dataLines = 0, eventType = void 0;
19012
+ }
19013
+ function reset(options = {}) {
19014
+ if (options.consume && pendingFragments.length > 0) {
19015
+ const incompleteLine = pendingFragments.join("");
19016
+ parseLine(incompleteLine, 0, incompleteLine.length);
19017
+ }
19018
+ isFirstChunk = true, id = void 0, data = "", dataLines = 0, eventType = void 0, pendingFragments.length = 0, pendingFragmentsLength = 0, terminated = false;
19019
+ }
19020
+ return { feed, reset };
19021
+ }
19022
+ function isDataPrefix2(chunk, i, firstCharCode) {
19023
+ return firstCharCode === 100 && chunk.charCodeAt(i + 1) === 97 && chunk.charCodeAt(i + 2) === 116 && chunk.charCodeAt(i + 3) === 97 && chunk.charCodeAt(i + 4) === 58;
19024
+ }
19025
+ function isEventPrefix2(chunk, i, firstCharCode) {
19026
+ 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;
19027
+ }
19028
+
17863
19029
  // ../../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/stream.js
17864
19030
  var EventSourceParserStream = class extends TransformStream {
17865
19031
  constructor({ onError, onRetry, onComment, maxBufferSize } = {}) {
17866
19032
  let parser;
17867
19033
  super({
17868
19034
  start(controller) {
17869
- parser = createParser({
19035
+ parser = createParser2({
17870
19036
  onEvent: (event) => {
17871
19037
  controller.enqueue(event);
17872
19038
  },
@@ -17885,7 +19051,7 @@ var EventSourceParserStream = class extends TransformStream {
17885
19051
  }
17886
19052
  };
17887
19053
 
17888
- // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js
19054
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_zod@4.5.4/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js
17889
19055
  var DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS = {
17890
19056
  initialReconnectionDelay: 1e3,
17891
19057
  maxReconnectionDelay: 3e4,
@@ -18958,7 +20124,13 @@ var pi = defineAgentCli({
18958
20124
  auth: {
18959
20125
  ref: "./SECRETS.md",
18960
20126
  state: {
18961
- env: ["ANTHROPIC_API_KEY", "OPENAI_API_KEY", "GOOGLE_GENERATIVE_AI_API_KEY", "MOONSHOT_API_KEY"]
20127
+ env: [
20128
+ "ANTHROPIC_API_KEY",
20129
+ "ANTHROPIC_OAUTH_TOKEN",
20130
+ "OPENAI_API_KEY",
20131
+ "GOOGLE_GENERATIVE_AI_API_KEY",
20132
+ "MOONSHOT_API_KEY"
20133
+ ]
18962
20134
  }
18963
20135
  },
18964
20136
  // Pi's model router reads the provider straight off each id's own
@@ -18968,6 +20140,19 @@ var pi = defineAgentCli({
18968
20140
  // include api-key profiles for the model-derived direct endpoint — without
18969
20141
  // it, no profile is eligible and pi models show "needs a profile".
18970
20142
  modelDerivedApiKey: true,
20143
+ // Pi's own bearer door: `ANTHROPIC_OAUTH_TOKEN — Anthropic OAuth token
20144
+ // (alternative to API key)` (verified against pi 0.80.x `--help`). A
20145
+ // Claude subscription token (`sk-ant-oat…`, minted by `claude
20146
+ // setup-token`) is VALID there — pi presents it on the Authorization
20147
+ // bearer path — while the same token on ANTHROPIC_API_KEY is rejected
20148
+ // upstream as an invalid key. `provider: "anthropic"` scopes the surface:
20149
+ // subscription mode (and oauth-bearer profile eligibility) lights up only
20150
+ // for pi's anthropic-derived models, never its openai/google/moonshot
20151
+ // ones.
20152
+ authSubscription: {
20153
+ setEnv: "ANTHROPIC_OAUTH_TOKEN",
20154
+ provider: "anthropic"
20155
+ },
18971
20156
  sandbox: "./SANDBOX.md",
18972
20157
  protocol: "proprietary",
18973
20158
  adapter: "@agentproto/adapter-pi",