@inkeep/agents-manage-mcp 0.40.0 → 0.41.0

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.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
 
3
- //#region ../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/core.js
3
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/core.js
4
4
  /** A special constant with type `never` */
5
5
  const NEVER = Object.freeze({ status: "aborted" });
6
6
  function $constructor(name, initializer$2, params) {
@@ -60,7 +60,7 @@ function config(newConfig) {
60
60
  }
61
61
 
62
62
  //#endregion
63
- //#region ../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/util.js
63
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/util.js
64
64
  function getEnumValues(entries) {
65
65
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
66
66
  return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
@@ -208,6 +208,8 @@ const NUMBER_FORMAT_RANGES = {
208
208
  };
209
209
  function pick(schema, mask) {
210
210
  const currDef = schema._zod.def;
211
+ const checks = currDef.checks;
212
+ if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements");
211
213
  return clone(schema, mergeDefs(schema._zod.def, {
212
214
  get shape() {
213
215
  const newShape = {};
@@ -224,6 +226,8 @@ function pick(schema, mask) {
224
226
  }
225
227
  function omit(schema, mask) {
226
228
  const currDef = schema._zod.def;
229
+ const checks = currDef.checks;
230
+ if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
227
231
  return clone(schema, mergeDefs(schema._zod.def, {
228
232
  get shape() {
229
233
  const newShape = { ...schema._zod.def.shape };
@@ -241,33 +245,29 @@ function omit(schema, mask) {
241
245
  function extend(schema, shape) {
242
246
  if (!isPlainObject$1(shape)) throw new Error("Invalid input to extend: expected a plain object");
243
247
  const checks = schema._zod.def.checks;
244
- if (checks && checks.length > 0) throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
245
- return clone(schema, mergeDefs(schema._zod.def, {
246
- get shape() {
247
- const _shape = {
248
- ...schema._zod.def.shape,
249
- ...shape
250
- };
251
- assignProp(this, "shape", _shape);
252
- return _shape;
253
- },
254
- checks: []
255
- }));
248
+ if (checks && checks.length > 0) {
249
+ const existingShape = schema._zod.def.shape;
250
+ for (const key in shape) if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
251
+ }
252
+ return clone(schema, mergeDefs(schema._zod.def, { get shape() {
253
+ const _shape = {
254
+ ...schema._zod.def.shape,
255
+ ...shape
256
+ };
257
+ assignProp(this, "shape", _shape);
258
+ return _shape;
259
+ } }));
256
260
  }
257
261
  function safeExtend(schema, shape) {
258
262
  if (!isPlainObject$1(shape)) throw new Error("Invalid input to safeExtend: expected a plain object");
259
- return clone(schema, {
260
- ...schema._zod.def,
261
- get shape() {
262
- const _shape = {
263
- ...schema._zod.def.shape,
264
- ...shape
265
- };
266
- assignProp(this, "shape", _shape);
267
- return _shape;
268
- },
269
- checks: schema._zod.def.checks
270
- });
263
+ return clone(schema, mergeDefs(schema._zod.def, { get shape() {
264
+ const _shape = {
265
+ ...schema._zod.def.shape,
266
+ ...shape
267
+ };
268
+ assignProp(this, "shape", _shape);
269
+ return _shape;
270
+ } }));
271
271
  }
272
272
  function merge(a, b) {
273
273
  return clone(a, mergeDefs(a._zod.def, {
@@ -286,6 +286,8 @@ function merge(a, b) {
286
286
  }));
287
287
  }
288
288
  function partial(Class, schema, mask) {
289
+ const checks = schema._zod.def.checks;
290
+ if (checks && checks.length > 0) throw new Error(".partial() cannot be used on object schemas containing refinements");
289
291
  return clone(schema, mergeDefs(schema._zod.def, {
290
292
  get shape() {
291
293
  const oldShape = schema._zod.def.shape;
@@ -309,27 +311,24 @@ function partial(Class, schema, mask) {
309
311
  }));
310
312
  }
311
313
  function required(Class, schema, mask) {
312
- return clone(schema, mergeDefs(schema._zod.def, {
313
- get shape() {
314
- const oldShape = schema._zod.def.shape;
315
- const shape = { ...oldShape };
316
- if (mask) for (const key in mask) {
317
- if (!(key in shape)) throw new Error(`Unrecognized key: "${key}"`);
318
- if (!mask[key]) continue;
319
- shape[key] = new Class({
320
- type: "nonoptional",
321
- innerType: oldShape[key]
322
- });
323
- }
324
- else for (const key in oldShape) shape[key] = new Class({
314
+ return clone(schema, mergeDefs(schema._zod.def, { get shape() {
315
+ const oldShape = schema._zod.def.shape;
316
+ const shape = { ...oldShape };
317
+ if (mask) for (const key in mask) {
318
+ if (!(key in shape)) throw new Error(`Unrecognized key: "${key}"`);
319
+ if (!mask[key]) continue;
320
+ shape[key] = new Class({
325
321
  type: "nonoptional",
326
322
  innerType: oldShape[key]
327
323
  });
328
- assignProp(this, "shape", shape);
329
- return shape;
330
- },
331
- checks: []
332
- }));
324
+ }
325
+ else for (const key in oldShape) shape[key] = new Class({
326
+ type: "nonoptional",
327
+ innerType: oldShape[key]
328
+ });
329
+ assignProp(this, "shape", shape);
330
+ return shape;
331
+ } }));
333
332
  }
334
333
  function aborted(x, startIndex = 0) {
335
334
  if (x.aborted === true) return true;
@@ -375,7 +374,7 @@ function issue(...args$113) {
375
374
  }
376
375
 
377
376
  //#endregion
378
- //#region ../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/errors.js
377
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/errors.js
379
378
  const initializer$1 = (inst, def) => {
380
379
  inst.name = "$ZodError";
381
380
  Object.defineProperty(inst, "_zod", {
@@ -486,7 +485,7 @@ function prettifyError(error) {
486
485
  }
487
486
 
488
487
  //#endregion
489
- //#region ../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/parse.js
488
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/parse.js
490
489
  const _parse = (_Err) => (schema, value, _ctx, _params) => {
491
490
  const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
492
491
  const result = schema._zod.run({
@@ -590,7 +589,7 @@ const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
590
589
  const safeDecodeAsync$1 = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
591
590
 
592
591
  //#endregion
593
- //#region ../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/regexes.js
592
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/regexes.js
594
593
  const cuid = /^[cC][^\s-]{8,}$/;
595
594
  const cuid2 = /^[0-9a-z]+$/;
596
595
  const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
@@ -620,7 +619,7 @@ const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-
620
619
  const 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])$/;
621
620
  const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
622
621
  const base64url = /^[A-Za-z0-9_-]*$/;
623
- const e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
622
+ const e164 = /^\+[1-9]\d{6,14}$/;
624
623
  const 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])))`;
625
624
  const date$1 = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
626
625
  function timeSource(args$113) {
@@ -643,13 +642,13 @@ const string$1 = (params) => {
643
642
  return /* @__PURE__ */ new RegExp(`^${regex}$`);
644
643
  };
645
644
  const integer = /^-?\d+$/;
646
- const number$1 = /^-?\d+(?:\.\d+)?/;
645
+ const number$1 = /^-?\d+(?:\.\d+)?$/;
647
646
  const boolean$2 = /^(?:true|false)$/i;
648
647
  const lowercase = /^[^A-Z]*$/;
649
648
  const uppercase = /^[^a-z]*$/;
650
649
 
651
650
  //#endregion
652
- //#region ../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/checks.js
651
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/checks.js
653
652
  const $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
654
653
  var _a$1;
655
654
  inst._zod ?? (inst._zod = {});
@@ -675,7 +674,7 @@ const $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (ins
675
674
  payload.issues.push({
676
675
  origin,
677
676
  code: "too_big",
678
- maximum: def.value,
677
+ maximum: typeof def.value === "object" ? def.value.getTime() : def.value,
679
678
  input: payload.value,
680
679
  inclusive: def.inclusive,
681
680
  inst,
@@ -697,7 +696,7 @@ const $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan"
697
696
  payload.issues.push({
698
697
  origin,
699
698
  code: "too_small",
700
- minimum: def.value,
699
+ minimum: typeof def.value === "object" ? def.value.getTime() : def.value,
701
700
  input: payload.value,
702
701
  inclusive: def.inclusive,
703
702
  inst,
@@ -759,6 +758,7 @@ const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberForma
759
758
  note: "Integers must be within the safe integer range.",
760
759
  inst,
761
760
  origin,
761
+ inclusive: true,
762
762
  continue: !def.abort
763
763
  });
764
764
  else payload.issues.push({
@@ -768,6 +768,7 @@ const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberForma
768
768
  note: "Integers must be within the safe integer range.",
769
769
  inst,
770
770
  origin,
771
+ inclusive: true,
771
772
  continue: !def.abort
772
773
  });
773
774
  return;
@@ -787,7 +788,9 @@ const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberForma
787
788
  input,
788
789
  code: "too_big",
789
790
  maximum,
790
- inst
791
+ inclusive: true,
792
+ inst,
793
+ continue: !def.abort
791
794
  });
792
795
  };
793
796
  });
@@ -1004,7 +1007,7 @@ const $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (i
1004
1007
  });
1005
1008
 
1006
1009
  //#endregion
1007
- //#region ../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/doc.js
1010
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/doc.js
1008
1011
  var Doc = class {
1009
1012
  constructor(args$113 = []) {
1010
1013
  this.content = [];
@@ -1036,15 +1039,15 @@ var Doc = class {
1036
1039
  };
1037
1040
 
1038
1041
  //#endregion
1039
- //#region ../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/versions.js
1042
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/versions.js
1040
1043
  const version = {
1041
1044
  major: 4,
1042
- minor: 1,
1043
- patch: 13
1045
+ minor: 3,
1046
+ patch: 5
1044
1047
  };
1045
1048
 
1046
1049
  //#endregion
1047
- //#region ../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/schemas.js
1050
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/schemas.js
1048
1051
  const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1049
1052
  var _a$1;
1050
1053
  inst ?? (inst = {});
@@ -1120,7 +1123,7 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1120
1123
  return runChecks(result, checks, ctx);
1121
1124
  };
1122
1125
  }
1123
- inst["~standard"] = {
1126
+ defineLazy(inst, "~standard", () => ({
1124
1127
  validate: (value) => {
1125
1128
  try {
1126
1129
  const r = safeParse$2(inst, value);
@@ -1131,7 +1134,7 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1131
1134
  },
1132
1135
  vendor: "zod",
1133
1136
  version: 1
1134
- };
1137
+ }));
1135
1138
  });
1136
1139
  const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
1137
1140
  $ZodType.init(inst, def);
@@ -1489,8 +1492,11 @@ const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
1489
1492
  return payload;
1490
1493
  };
1491
1494
  });
1492
- function handlePropertyResult(result, final, key, input) {
1493
- if (result.issues.length) final.issues.push(...prefixIssues(key, result.issues));
1495
+ function handlePropertyResult(result, final, key, input, isOptionalOut) {
1496
+ if (result.issues.length) {
1497
+ if (isOptionalOut && !(key in input)) return;
1498
+ final.issues.push(...prefixIssues(key, result.issues));
1499
+ }
1494
1500
  if (result.value === void 0) {
1495
1501
  if (key in input) final.value[key] = void 0;
1496
1502
  } else final.value[key] = result.value;
@@ -1512,6 +1518,7 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
1512
1518
  const keySet = def.keySet;
1513
1519
  const _catchall = def.catchall._zod;
1514
1520
  const t = _catchall.def.type;
1521
+ const isOptionalOut = _catchall.optout === "optional";
1515
1522
  for (const key in input) {
1516
1523
  if (keySet.has(key)) continue;
1517
1524
  if (t === "never") {
@@ -1522,8 +1529,8 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
1522
1529
  value: input[key],
1523
1530
  issues: []
1524
1531
  }, ctx);
1525
- if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult(r$1, payload, key, input)));
1526
- else handlePropertyResult(r, payload, key, input);
1532
+ if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult(r$1, payload, key, input, isOptionalOut)));
1533
+ else handlePropertyResult(r, payload, key, input, isOptionalOut);
1527
1534
  }
1528
1535
  if (unrecognized.length) payload.issues.push({
1529
1536
  code: "unrecognized_keys",
@@ -1578,12 +1585,14 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
1578
1585
  const proms = [];
1579
1586
  const shape = value.shape;
1580
1587
  for (const key of value.keys) {
1581
- const r = shape[key]._zod.run({
1588
+ const el = shape[key];
1589
+ const isOptionalOut = el._zod.optout === "optional";
1590
+ const r = el._zod.run({
1582
1591
  value: input[key],
1583
1592
  issues: []
1584
1593
  }, ctx);
1585
- if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult(r$1, payload, key, input)));
1586
- else handlePropertyResult(r, payload, key, input);
1594
+ if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult(r$1, payload, key, input, isOptionalOut)));
1595
+ else handlePropertyResult(r, payload, key, input, isOptionalOut);
1587
1596
  }
1588
1597
  if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
1589
1598
  return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
@@ -1612,8 +1621,28 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def)
1612
1621
  for (const key of normalized.keys) {
1613
1622
  const id = ids[key];
1614
1623
  const k = esc(key);
1624
+ const isOptionalOut = shape[key]?._zod?.optout === "optional";
1615
1625
  doc.write(`const ${id} = ${parseStr(key)};`);
1616
- doc.write(`
1626
+ if (isOptionalOut) doc.write(`
1627
+ if (${id}.issues.length) {
1628
+ if (${k} in input) {
1629
+ payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1630
+ ...iss,
1631
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
1632
+ })));
1633
+ }
1634
+ }
1635
+
1636
+ if (${id}.value === undefined) {
1637
+ if (${k} in input) {
1638
+ newResult[${k}] = undefined;
1639
+ }
1640
+ } else {
1641
+ newResult[${k}] = ${id}.value;
1642
+ }
1643
+
1644
+ `);
1645
+ else doc.write(`
1617
1646
  if (${id}.issues.length) {
1618
1647
  payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1619
1648
  ...iss,
@@ -1621,7 +1650,6 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def)
1621
1650
  })));
1622
1651
  }
1623
1652
 
1624
-
1625
1653
  if (${id}.value === undefined) {
1626
1654
  if (${k} in input) {
1627
1655
  newResult[${k}] = undefined;
@@ -1795,8 +1823,25 @@ function mergeValues(a, b) {
1795
1823
  };
1796
1824
  }
1797
1825
  function handleIntersectionResults(result, left, right) {
1798
- if (left.issues.length) result.issues.push(...left.issues);
1799
- if (right.issues.length) result.issues.push(...right.issues);
1826
+ const unrecKeys = /* @__PURE__ */ new Map();
1827
+ let unrecIssue;
1828
+ for (const iss of left.issues) if (iss.code === "unrecognized_keys") {
1829
+ unrecIssue ?? (unrecIssue = iss);
1830
+ for (const k of iss.keys) {
1831
+ if (!unrecKeys.has(k)) unrecKeys.set(k, {});
1832
+ unrecKeys.get(k).l = true;
1833
+ }
1834
+ } else result.issues.push(iss);
1835
+ for (const iss of right.issues) if (iss.code === "unrecognized_keys") for (const k of iss.keys) {
1836
+ if (!unrecKeys.has(k)) unrecKeys.set(k, {});
1837
+ unrecKeys.get(k).r = true;
1838
+ }
1839
+ else result.issues.push(iss);
1840
+ const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
1841
+ if (bothKeys.length && unrecIssue) result.issues.push({
1842
+ ...unrecIssue,
1843
+ keys: bothKeys
1844
+ });
1800
1845
  if (aborted(result)) return result;
1801
1846
  const merged = mergeValues(left.value, right.value);
1802
1847
  if (!merged.valid) throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
@@ -1851,13 +1896,22 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
1851
1896
  payload.value = {};
1852
1897
  for (const key of Reflect.ownKeys(input)) {
1853
1898
  if (key === "__proto__") continue;
1854
- const keyResult = def.keyType._zod.run({
1899
+ let keyResult = def.keyType._zod.run({
1855
1900
  value: key,
1856
1901
  issues: []
1857
1902
  }, ctx);
1858
1903
  if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
1904
+ if (typeof key === "string" && number$1.test(key) && keyResult.issues.length && keyResult.issues.some((iss) => iss.code === "invalid_type" && iss.expected === "number")) {
1905
+ const retryResult = def.keyType._zod.run({
1906
+ value: Number(key),
1907
+ issues: []
1908
+ }, ctx);
1909
+ if (retryResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
1910
+ if (retryResult.issues.length === 0) keyResult = retryResult;
1911
+ }
1859
1912
  if (keyResult.issues.length) {
1860
- payload.issues.push({
1913
+ if (def.mode === "loose") payload.value[key] = input[key];
1914
+ else payload.issues.push({
1861
1915
  code: "invalid_key",
1862
1916
  origin: "record",
1863
1917
  issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
@@ -1865,7 +1919,6 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
1865
1919
  path: [key],
1866
1920
  inst
1867
1921
  });
1868
- payload.value[keyResult.value] = keyResult.value;
1869
1922
  continue;
1870
1923
  }
1871
1924
  const result = def.valueType._zod.run({
@@ -1946,6 +1999,14 @@ const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) =>
1946
1999
  return def.innerType._zod.run(payload, ctx);
1947
2000
  };
1948
2001
  });
2002
+ const $ZodExactOptional = /* @__PURE__ */ $constructor("$ZodExactOptional", (inst, def) => {
2003
+ $ZodOptional.init(inst, def);
2004
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2005
+ defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern);
2006
+ inst._zod.parse = (payload, ctx) => {
2007
+ return def.innerType._zod.run(payload, ctx);
2008
+ };
2009
+ });
1949
2010
  const $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
1950
2011
  $ZodType.init(inst, def);
1951
2012
  defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
@@ -2130,7 +2191,7 @@ function handleRefineResult(result, payload, input, inst) {
2130
2191
  }
2131
2192
 
2132
2193
  //#endregion
2133
- //#region ../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/registries.js
2194
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/registries.js
2134
2195
  var _a;
2135
2196
  var $ZodRegistry = class {
2136
2197
  constructor() {
@@ -2140,10 +2201,7 @@ var $ZodRegistry = class {
2140
2201
  add(schema, ..._meta) {
2141
2202
  const meta$2 = _meta[0];
2142
2203
  this._map.set(schema, meta$2);
2143
- if (meta$2 && typeof meta$2 === "object" && "id" in meta$2) {
2144
- if (this._idmap.has(meta$2.id)) throw new Error(`ID ${meta$2.id} already exists in the registry`);
2145
- this._idmap.set(meta$2.id, schema);
2146
- }
2204
+ if (meta$2 && typeof meta$2 === "object" && "id" in meta$2) this._idmap.set(meta$2.id, schema);
2147
2205
  return this;
2148
2206
  }
2149
2207
  clear() {
@@ -2181,13 +2239,15 @@ function registry() {
2181
2239
  const globalRegistry = globalThis.__zod_globalRegistry;
2182
2240
 
2183
2241
  //#endregion
2184
- //#region ../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/api.js
2242
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/api.js
2243
+ /* @__NO_SIDE_EFFECTS__ */
2185
2244
  function _string(Class, params) {
2186
2245
  return new Class({
2187
2246
  type: "string",
2188
2247
  ...normalizeParams(params)
2189
2248
  });
2190
2249
  }
2250
+ /* @__NO_SIDE_EFFECTS__ */
2191
2251
  function _email(Class, params) {
2192
2252
  return new Class({
2193
2253
  type: "string",
@@ -2197,6 +2257,7 @@ function _email(Class, params) {
2197
2257
  ...normalizeParams(params)
2198
2258
  });
2199
2259
  }
2260
+ /* @__NO_SIDE_EFFECTS__ */
2200
2261
  function _guid(Class, params) {
2201
2262
  return new Class({
2202
2263
  type: "string",
@@ -2206,6 +2267,7 @@ function _guid(Class, params) {
2206
2267
  ...normalizeParams(params)
2207
2268
  });
2208
2269
  }
2270
+ /* @__NO_SIDE_EFFECTS__ */
2209
2271
  function _uuid(Class, params) {
2210
2272
  return new Class({
2211
2273
  type: "string",
@@ -2215,6 +2277,7 @@ function _uuid(Class, params) {
2215
2277
  ...normalizeParams(params)
2216
2278
  });
2217
2279
  }
2280
+ /* @__NO_SIDE_EFFECTS__ */
2218
2281
  function _uuidv4(Class, params) {
2219
2282
  return new Class({
2220
2283
  type: "string",
@@ -2225,6 +2288,7 @@ function _uuidv4(Class, params) {
2225
2288
  ...normalizeParams(params)
2226
2289
  });
2227
2290
  }
2291
+ /* @__NO_SIDE_EFFECTS__ */
2228
2292
  function _uuidv6(Class, params) {
2229
2293
  return new Class({
2230
2294
  type: "string",
@@ -2235,6 +2299,7 @@ function _uuidv6(Class, params) {
2235
2299
  ...normalizeParams(params)
2236
2300
  });
2237
2301
  }
2302
+ /* @__NO_SIDE_EFFECTS__ */
2238
2303
  function _uuidv7(Class, params) {
2239
2304
  return new Class({
2240
2305
  type: "string",
@@ -2245,6 +2310,7 @@ function _uuidv7(Class, params) {
2245
2310
  ...normalizeParams(params)
2246
2311
  });
2247
2312
  }
2313
+ /* @__NO_SIDE_EFFECTS__ */
2248
2314
  function _url(Class, params) {
2249
2315
  return new Class({
2250
2316
  type: "string",
@@ -2254,6 +2320,7 @@ function _url(Class, params) {
2254
2320
  ...normalizeParams(params)
2255
2321
  });
2256
2322
  }
2323
+ /* @__NO_SIDE_EFFECTS__ */
2257
2324
  function _emoji(Class, params) {
2258
2325
  return new Class({
2259
2326
  type: "string",
@@ -2263,6 +2330,7 @@ function _emoji(Class, params) {
2263
2330
  ...normalizeParams(params)
2264
2331
  });
2265
2332
  }
2333
+ /* @__NO_SIDE_EFFECTS__ */
2266
2334
  function _nanoid(Class, params) {
2267
2335
  return new Class({
2268
2336
  type: "string",
@@ -2272,6 +2340,7 @@ function _nanoid(Class, params) {
2272
2340
  ...normalizeParams(params)
2273
2341
  });
2274
2342
  }
2343
+ /* @__NO_SIDE_EFFECTS__ */
2275
2344
  function _cuid(Class, params) {
2276
2345
  return new Class({
2277
2346
  type: "string",
@@ -2281,6 +2350,7 @@ function _cuid(Class, params) {
2281
2350
  ...normalizeParams(params)
2282
2351
  });
2283
2352
  }
2353
+ /* @__NO_SIDE_EFFECTS__ */
2284
2354
  function _cuid2(Class, params) {
2285
2355
  return new Class({
2286
2356
  type: "string",
@@ -2290,6 +2360,7 @@ function _cuid2(Class, params) {
2290
2360
  ...normalizeParams(params)
2291
2361
  });
2292
2362
  }
2363
+ /* @__NO_SIDE_EFFECTS__ */
2293
2364
  function _ulid(Class, params) {
2294
2365
  return new Class({
2295
2366
  type: "string",
@@ -2299,6 +2370,7 @@ function _ulid(Class, params) {
2299
2370
  ...normalizeParams(params)
2300
2371
  });
2301
2372
  }
2373
+ /* @__NO_SIDE_EFFECTS__ */
2302
2374
  function _xid(Class, params) {
2303
2375
  return new Class({
2304
2376
  type: "string",
@@ -2308,6 +2380,7 @@ function _xid(Class, params) {
2308
2380
  ...normalizeParams(params)
2309
2381
  });
2310
2382
  }
2383
+ /* @__NO_SIDE_EFFECTS__ */
2311
2384
  function _ksuid(Class, params) {
2312
2385
  return new Class({
2313
2386
  type: "string",
@@ -2317,6 +2390,7 @@ function _ksuid(Class, params) {
2317
2390
  ...normalizeParams(params)
2318
2391
  });
2319
2392
  }
2393
+ /* @__NO_SIDE_EFFECTS__ */
2320
2394
  function _ipv4(Class, params) {
2321
2395
  return new Class({
2322
2396
  type: "string",
@@ -2326,6 +2400,7 @@ function _ipv4(Class, params) {
2326
2400
  ...normalizeParams(params)
2327
2401
  });
2328
2402
  }
2403
+ /* @__NO_SIDE_EFFECTS__ */
2329
2404
  function _ipv6(Class, params) {
2330
2405
  return new Class({
2331
2406
  type: "string",
@@ -2335,6 +2410,7 @@ function _ipv6(Class, params) {
2335
2410
  ...normalizeParams(params)
2336
2411
  });
2337
2412
  }
2413
+ /* @__NO_SIDE_EFFECTS__ */
2338
2414
  function _cidrv4(Class, params) {
2339
2415
  return new Class({
2340
2416
  type: "string",
@@ -2344,6 +2420,7 @@ function _cidrv4(Class, params) {
2344
2420
  ...normalizeParams(params)
2345
2421
  });
2346
2422
  }
2423
+ /* @__NO_SIDE_EFFECTS__ */
2347
2424
  function _cidrv6(Class, params) {
2348
2425
  return new Class({
2349
2426
  type: "string",
@@ -2353,6 +2430,7 @@ function _cidrv6(Class, params) {
2353
2430
  ...normalizeParams(params)
2354
2431
  });
2355
2432
  }
2433
+ /* @__NO_SIDE_EFFECTS__ */
2356
2434
  function _base64(Class, params) {
2357
2435
  return new Class({
2358
2436
  type: "string",
@@ -2362,6 +2440,7 @@ function _base64(Class, params) {
2362
2440
  ...normalizeParams(params)
2363
2441
  });
2364
2442
  }
2443
+ /* @__NO_SIDE_EFFECTS__ */
2365
2444
  function _base64url(Class, params) {
2366
2445
  return new Class({
2367
2446
  type: "string",
@@ -2371,6 +2450,7 @@ function _base64url(Class, params) {
2371
2450
  ...normalizeParams(params)
2372
2451
  });
2373
2452
  }
2453
+ /* @__NO_SIDE_EFFECTS__ */
2374
2454
  function _e164(Class, params) {
2375
2455
  return new Class({
2376
2456
  type: "string",
@@ -2380,6 +2460,7 @@ function _e164(Class, params) {
2380
2460
  ...normalizeParams(params)
2381
2461
  });
2382
2462
  }
2463
+ /* @__NO_SIDE_EFFECTS__ */
2383
2464
  function _jwt(Class, params) {
2384
2465
  return new Class({
2385
2466
  type: "string",
@@ -2389,6 +2470,7 @@ function _jwt(Class, params) {
2389
2470
  ...normalizeParams(params)
2390
2471
  });
2391
2472
  }
2473
+ /* @__NO_SIDE_EFFECTS__ */
2392
2474
  function _isoDateTime(Class, params) {
2393
2475
  return new Class({
2394
2476
  type: "string",
@@ -2400,6 +2482,7 @@ function _isoDateTime(Class, params) {
2400
2482
  ...normalizeParams(params)
2401
2483
  });
2402
2484
  }
2485
+ /* @__NO_SIDE_EFFECTS__ */
2403
2486
  function _isoDate(Class, params) {
2404
2487
  return new Class({
2405
2488
  type: "string",
@@ -2408,6 +2491,7 @@ function _isoDate(Class, params) {
2408
2491
  ...normalizeParams(params)
2409
2492
  });
2410
2493
  }
2494
+ /* @__NO_SIDE_EFFECTS__ */
2411
2495
  function _isoTime(Class, params) {
2412
2496
  return new Class({
2413
2497
  type: "string",
@@ -2417,6 +2501,7 @@ function _isoTime(Class, params) {
2417
2501
  ...normalizeParams(params)
2418
2502
  });
2419
2503
  }
2504
+ /* @__NO_SIDE_EFFECTS__ */
2420
2505
  function _isoDuration(Class, params) {
2421
2506
  return new Class({
2422
2507
  type: "string",
@@ -2425,6 +2510,7 @@ function _isoDuration(Class, params) {
2425
2510
  ...normalizeParams(params)
2426
2511
  });
2427
2512
  }
2513
+ /* @__NO_SIDE_EFFECTS__ */
2428
2514
  function _number(Class, params) {
2429
2515
  return new Class({
2430
2516
  type: "number",
@@ -2432,6 +2518,7 @@ function _number(Class, params) {
2432
2518
  ...normalizeParams(params)
2433
2519
  });
2434
2520
  }
2521
+ /* @__NO_SIDE_EFFECTS__ */
2435
2522
  function _int(Class, params) {
2436
2523
  return new Class({
2437
2524
  type: "number",
@@ -2441,12 +2528,14 @@ function _int(Class, params) {
2441
2528
  ...normalizeParams(params)
2442
2529
  });
2443
2530
  }
2531
+ /* @__NO_SIDE_EFFECTS__ */
2444
2532
  function _boolean(Class, params) {
2445
2533
  return new Class({
2446
2534
  type: "boolean",
2447
2535
  ...normalizeParams(params)
2448
2536
  });
2449
2537
  }
2538
+ /* @__NO_SIDE_EFFECTS__ */
2450
2539
  function _coercedBoolean(Class, params) {
2451
2540
  return new Class({
2452
2541
  type: "boolean",
@@ -2454,18 +2543,22 @@ function _coercedBoolean(Class, params) {
2454
2543
  ...normalizeParams(params)
2455
2544
  });
2456
2545
  }
2546
+ /* @__NO_SIDE_EFFECTS__ */
2457
2547
  function _any(Class) {
2458
2548
  return new Class({ type: "any" });
2459
2549
  }
2550
+ /* @__NO_SIDE_EFFECTS__ */
2460
2551
  function _unknown(Class) {
2461
2552
  return new Class({ type: "unknown" });
2462
2553
  }
2554
+ /* @__NO_SIDE_EFFECTS__ */
2463
2555
  function _never(Class, params) {
2464
2556
  return new Class({
2465
2557
  type: "never",
2466
2558
  ...normalizeParams(params)
2467
2559
  });
2468
2560
  }
2561
+ /* @__NO_SIDE_EFFECTS__ */
2469
2562
  function _lt(value, params) {
2470
2563
  return new $ZodCheckLessThan({
2471
2564
  check: "less_than",
@@ -2474,6 +2567,7 @@ function _lt(value, params) {
2474
2567
  inclusive: false
2475
2568
  });
2476
2569
  }
2570
+ /* @__NO_SIDE_EFFECTS__ */
2477
2571
  function _lte(value, params) {
2478
2572
  return new $ZodCheckLessThan({
2479
2573
  check: "less_than",
@@ -2482,6 +2576,7 @@ function _lte(value, params) {
2482
2576
  inclusive: true
2483
2577
  });
2484
2578
  }
2579
+ /* @__NO_SIDE_EFFECTS__ */
2485
2580
  function _gt(value, params) {
2486
2581
  return new $ZodCheckGreaterThan({
2487
2582
  check: "greater_than",
@@ -2490,6 +2585,7 @@ function _gt(value, params) {
2490
2585
  inclusive: false
2491
2586
  });
2492
2587
  }
2588
+ /* @__NO_SIDE_EFFECTS__ */
2493
2589
  function _gte(value, params) {
2494
2590
  return new $ZodCheckGreaterThan({
2495
2591
  check: "greater_than",
@@ -2498,6 +2594,7 @@ function _gte(value, params) {
2498
2594
  inclusive: true
2499
2595
  });
2500
2596
  }
2597
+ /* @__NO_SIDE_EFFECTS__ */
2501
2598
  function _multipleOf(value, params) {
2502
2599
  return new $ZodCheckMultipleOf({
2503
2600
  check: "multiple_of",
@@ -2505,6 +2602,7 @@ function _multipleOf(value, params) {
2505
2602
  value
2506
2603
  });
2507
2604
  }
2605
+ /* @__NO_SIDE_EFFECTS__ */
2508
2606
  function _maxLength(maximum, params) {
2509
2607
  return new $ZodCheckMaxLength({
2510
2608
  check: "max_length",
@@ -2512,6 +2610,7 @@ function _maxLength(maximum, params) {
2512
2610
  maximum
2513
2611
  });
2514
2612
  }
2613
+ /* @__NO_SIDE_EFFECTS__ */
2515
2614
  function _minLength(minimum, params) {
2516
2615
  return new $ZodCheckMinLength({
2517
2616
  check: "min_length",
@@ -2519,6 +2618,7 @@ function _minLength(minimum, params) {
2519
2618
  minimum
2520
2619
  });
2521
2620
  }
2621
+ /* @__NO_SIDE_EFFECTS__ */
2522
2622
  function _length(length, params) {
2523
2623
  return new $ZodCheckLengthEquals({
2524
2624
  check: "length_equals",
@@ -2526,6 +2626,7 @@ function _length(length, params) {
2526
2626
  length
2527
2627
  });
2528
2628
  }
2629
+ /* @__NO_SIDE_EFFECTS__ */
2529
2630
  function _regex(pattern, params) {
2530
2631
  return new $ZodCheckRegex({
2531
2632
  check: "string_format",
@@ -2534,6 +2635,7 @@ function _regex(pattern, params) {
2534
2635
  pattern
2535
2636
  });
2536
2637
  }
2638
+ /* @__NO_SIDE_EFFECTS__ */
2537
2639
  function _lowercase(params) {
2538
2640
  return new $ZodCheckLowerCase({
2539
2641
  check: "string_format",
@@ -2541,6 +2643,7 @@ function _lowercase(params) {
2541
2643
  ...normalizeParams(params)
2542
2644
  });
2543
2645
  }
2646
+ /* @__NO_SIDE_EFFECTS__ */
2544
2647
  function _uppercase(params) {
2545
2648
  return new $ZodCheckUpperCase({
2546
2649
  check: "string_format",
@@ -2548,6 +2651,7 @@ function _uppercase(params) {
2548
2651
  ...normalizeParams(params)
2549
2652
  });
2550
2653
  }
2654
+ /* @__NO_SIDE_EFFECTS__ */
2551
2655
  function _includes(includes, params) {
2552
2656
  return new $ZodCheckIncludes({
2553
2657
  check: "string_format",
@@ -2556,6 +2660,7 @@ function _includes(includes, params) {
2556
2660
  includes
2557
2661
  });
2558
2662
  }
2663
+ /* @__NO_SIDE_EFFECTS__ */
2559
2664
  function _startsWith(prefix, params) {
2560
2665
  return new $ZodCheckStartsWith({
2561
2666
  check: "string_format",
@@ -2564,6 +2669,7 @@ function _startsWith(prefix, params) {
2564
2669
  prefix
2565
2670
  });
2566
2671
  }
2672
+ /* @__NO_SIDE_EFFECTS__ */
2567
2673
  function _endsWith(suffix, params) {
2568
2674
  return new $ZodCheckEndsWith({
2569
2675
  check: "string_format",
@@ -2572,27 +2678,34 @@ function _endsWith(suffix, params) {
2572
2678
  suffix
2573
2679
  });
2574
2680
  }
2681
+ /* @__NO_SIDE_EFFECTS__ */
2575
2682
  function _overwrite(tx) {
2576
2683
  return new $ZodCheckOverwrite({
2577
2684
  check: "overwrite",
2578
2685
  tx
2579
2686
  });
2580
2687
  }
2688
+ /* @__NO_SIDE_EFFECTS__ */
2581
2689
  function _normalize(form) {
2582
- return _overwrite((input) => input.normalize(form));
2690
+ return /* @__PURE__ */ _overwrite((input) => input.normalize(form));
2583
2691
  }
2692
+ /* @__NO_SIDE_EFFECTS__ */
2584
2693
  function _trim() {
2585
- return _overwrite((input) => input.trim());
2694
+ return /* @__PURE__ */ _overwrite((input) => input.trim());
2586
2695
  }
2696
+ /* @__NO_SIDE_EFFECTS__ */
2587
2697
  function _toLowerCase() {
2588
- return _overwrite((input) => input.toLowerCase());
2698
+ return /* @__PURE__ */ _overwrite((input) => input.toLowerCase());
2589
2699
  }
2700
+ /* @__NO_SIDE_EFFECTS__ */
2590
2701
  function _toUpperCase() {
2591
- return _overwrite((input) => input.toUpperCase());
2702
+ return /* @__PURE__ */ _overwrite((input) => input.toUpperCase());
2592
2703
  }
2704
+ /* @__NO_SIDE_EFFECTS__ */
2593
2705
  function _slugify() {
2594
- return _overwrite((input) => slugify(input));
2706
+ return /* @__PURE__ */ _overwrite((input) => slugify(input));
2595
2707
  }
2708
+ /* @__NO_SIDE_EFFECTS__ */
2596
2709
  function _array(Class, element, params) {
2597
2710
  return new Class({
2598
2711
  type: "array",
@@ -2600,6 +2713,7 @@ function _array(Class, element, params) {
2600
2713
  ...normalizeParams(params)
2601
2714
  });
2602
2715
  }
2716
+ /* @__NO_SIDE_EFFECTS__ */
2603
2717
  function _custom(Class, fn, _params) {
2604
2718
  const norm = normalizeParams(_params);
2605
2719
  norm.abort ?? (norm.abort = true);
@@ -2610,6 +2724,7 @@ function _custom(Class, fn, _params) {
2610
2724
  ...norm
2611
2725
  });
2612
2726
  }
2727
+ /* @__NO_SIDE_EFFECTS__ */
2613
2728
  function _refine(Class, fn, _params) {
2614
2729
  return new Class({
2615
2730
  type: "custom",
@@ -2618,8 +2733,9 @@ function _refine(Class, fn, _params) {
2618
2733
  ...normalizeParams(_params)
2619
2734
  });
2620
2735
  }
2736
+ /* @__NO_SIDE_EFFECTS__ */
2621
2737
  function _superRefine(fn) {
2622
- const ch = _check((payload) => {
2738
+ const ch = /* @__PURE__ */ _check((payload) => {
2623
2739
  payload.addIssue = (issue$1) => {
2624
2740
  if (typeof issue$1 === "string") payload.issues.push(issue(issue$1, payload.value, ch._zod.def));
2625
2741
  else {
@@ -2636,6 +2752,7 @@ function _superRefine(fn) {
2636
2752
  });
2637
2753
  return ch;
2638
2754
  }
2755
+ /* @__NO_SIDE_EFFECTS__ */
2639
2756
  function _check(fn, params) {
2640
2757
  const ch = new $ZodCheck({
2641
2758
  check: "custom",
@@ -2644,6 +2761,7 @@ function _check(fn, params) {
2644
2761
  ch._zod.check = fn;
2645
2762
  return ch;
2646
2763
  }
2764
+ /* @__NO_SIDE_EFFECTS__ */
2647
2765
  function describe$1(description) {
2648
2766
  const ch = new $ZodCheck({ check: "describe" });
2649
2767
  ch._zod.onattach = [(inst) => {
@@ -2656,6 +2774,7 @@ function describe$1(description) {
2656
2774
  ch._zod.check = () => {};
2657
2775
  return ch;
2658
2776
  }
2777
+ /* @__NO_SIDE_EFFECTS__ */
2659
2778
  function meta$1(metadata) {
2660
2779
  const ch = new $ZodCheck({ check: "meta" });
2661
2780
  ch._zod.onattach = [(inst) => {
@@ -2670,7 +2789,547 @@ function meta$1(metadata) {
2670
2789
  }
2671
2790
 
2672
2791
  //#endregion
2673
- //#region ../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/classic/iso.js
2792
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/to-json-schema.js
2793
+ function initializeContext(params) {
2794
+ let target = params?.target ?? "draft-2020-12";
2795
+ if (target === "draft-4") target = "draft-04";
2796
+ if (target === "draft-7") target = "draft-07";
2797
+ return {
2798
+ processors: params.processors ?? {},
2799
+ metadataRegistry: params?.metadata ?? globalRegistry,
2800
+ target,
2801
+ unrepresentable: params?.unrepresentable ?? "throw",
2802
+ override: params?.override ?? (() => {}),
2803
+ io: params?.io ?? "output",
2804
+ counter: 0,
2805
+ seen: /* @__PURE__ */ new Map(),
2806
+ cycles: params?.cycles ?? "ref",
2807
+ reused: params?.reused ?? "inline",
2808
+ external: params?.external ?? void 0
2809
+ };
2810
+ }
2811
+ function process(schema, ctx, _params = {
2812
+ path: [],
2813
+ schemaPath: []
2814
+ }) {
2815
+ var _a$1;
2816
+ const def = schema._zod.def;
2817
+ const seen = ctx.seen.get(schema);
2818
+ if (seen) {
2819
+ seen.count++;
2820
+ if (_params.schemaPath.includes(schema)) seen.cycle = _params.path;
2821
+ return seen.schema;
2822
+ }
2823
+ const result = {
2824
+ schema: {},
2825
+ count: 1,
2826
+ cycle: void 0,
2827
+ path: _params.path
2828
+ };
2829
+ ctx.seen.set(schema, result);
2830
+ const overrideSchema = schema._zod.toJSONSchema?.();
2831
+ if (overrideSchema) result.schema = overrideSchema;
2832
+ else {
2833
+ const params = {
2834
+ ..._params,
2835
+ schemaPath: [..._params.schemaPath, schema],
2836
+ path: _params.path
2837
+ };
2838
+ if (schema._zod.processJSONSchema) schema._zod.processJSONSchema(ctx, result.schema, params);
2839
+ else {
2840
+ const _json = result.schema;
2841
+ const processor = ctx.processors[def.type];
2842
+ if (!processor) throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);
2843
+ processor(schema, ctx, _json, params);
2844
+ }
2845
+ const parent = schema._zod.parent;
2846
+ if (parent) {
2847
+ if (!result.ref) result.ref = parent;
2848
+ process(parent, ctx, params);
2849
+ ctx.seen.get(parent).isParent = true;
2850
+ }
2851
+ }
2852
+ const meta$2 = ctx.metadataRegistry.get(schema);
2853
+ if (meta$2) Object.assign(result.schema, meta$2);
2854
+ if (ctx.io === "input" && isTransforming(schema)) {
2855
+ delete result.schema.examples;
2856
+ delete result.schema.default;
2857
+ }
2858
+ if (ctx.io === "input" && result.schema._prefault) (_a$1 = result.schema).default ?? (_a$1.default = result.schema._prefault);
2859
+ delete result.schema._prefault;
2860
+ return ctx.seen.get(schema).schema;
2861
+ }
2862
+ function extractDefs(ctx, schema) {
2863
+ const root = ctx.seen.get(schema);
2864
+ if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
2865
+ const idToSchema = /* @__PURE__ */ new Map();
2866
+ for (const entry of ctx.seen.entries()) {
2867
+ const id = ctx.metadataRegistry.get(entry[0])?.id;
2868
+ if (id) {
2869
+ const existing = idToSchema.get(id);
2870
+ if (existing && existing !== entry[0]) throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
2871
+ idToSchema.set(id, entry[0]);
2872
+ }
2873
+ }
2874
+ const makeURI = (entry) => {
2875
+ const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
2876
+ if (ctx.external) {
2877
+ const externalId = ctx.external.registry.get(entry[0])?.id;
2878
+ const uriGenerator = ctx.external.uri ?? ((id$1) => id$1);
2879
+ if (externalId) return { ref: uriGenerator(externalId) };
2880
+ const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
2881
+ entry[1].defId = id;
2882
+ return {
2883
+ defId: id,
2884
+ ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}`
2885
+ };
2886
+ }
2887
+ if (entry[1] === root) return { ref: "#" };
2888
+ const defUriPrefix = `#/${defsSegment}/`;
2889
+ const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
2890
+ return {
2891
+ defId,
2892
+ ref: defUriPrefix + defId
2893
+ };
2894
+ };
2895
+ const extractToDef = (entry) => {
2896
+ if (entry[1].schema.$ref) return;
2897
+ const seen = entry[1];
2898
+ const { ref, defId } = makeURI(entry);
2899
+ seen.def = { ...seen.schema };
2900
+ if (defId) seen.defId = defId;
2901
+ const schema$1 = seen.schema;
2902
+ for (const key in schema$1) delete schema$1[key];
2903
+ schema$1.$ref = ref;
2904
+ };
2905
+ if (ctx.cycles === "throw") for (const entry of ctx.seen.entries()) {
2906
+ const seen = entry[1];
2907
+ if (seen.cycle) throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/<root>
2908
+
2909
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
2910
+ }
2911
+ for (const entry of ctx.seen.entries()) {
2912
+ const seen = entry[1];
2913
+ if (schema === entry[0]) {
2914
+ extractToDef(entry);
2915
+ continue;
2916
+ }
2917
+ if (ctx.external) {
2918
+ const ext = ctx.external.registry.get(entry[0])?.id;
2919
+ if (schema !== entry[0] && ext) {
2920
+ extractToDef(entry);
2921
+ continue;
2922
+ }
2923
+ }
2924
+ if (ctx.metadataRegistry.get(entry[0])?.id) {
2925
+ extractToDef(entry);
2926
+ continue;
2927
+ }
2928
+ if (seen.cycle) {
2929
+ extractToDef(entry);
2930
+ continue;
2931
+ }
2932
+ if (seen.count > 1) {
2933
+ if (ctx.reused === "ref") {
2934
+ extractToDef(entry);
2935
+ continue;
2936
+ }
2937
+ }
2938
+ }
2939
+ }
2940
+ function finalize(ctx, schema) {
2941
+ const root = ctx.seen.get(schema);
2942
+ if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
2943
+ const flattenRef = (zodSchema) => {
2944
+ const seen = ctx.seen.get(zodSchema);
2945
+ if (seen.ref === null) return;
2946
+ const schema$1 = seen.def ?? seen.schema;
2947
+ const _cached = { ...schema$1 };
2948
+ const ref = seen.ref;
2949
+ seen.ref = null;
2950
+ if (ref) {
2951
+ flattenRef(ref);
2952
+ const refSeen = ctx.seen.get(ref);
2953
+ const refSchema = refSeen.schema;
2954
+ if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
2955
+ schema$1.allOf = schema$1.allOf ?? [];
2956
+ schema$1.allOf.push(refSchema);
2957
+ } else Object.assign(schema$1, refSchema);
2958
+ Object.assign(schema$1, _cached);
2959
+ if (zodSchema._zod.parent === ref) for (const key in schema$1) {
2960
+ if (key === "$ref" || key === "allOf") continue;
2961
+ if (!(key in _cached)) delete schema$1[key];
2962
+ }
2963
+ if (refSchema.$ref) for (const key in schema$1) {
2964
+ if (key === "$ref" || key === "allOf") continue;
2965
+ if (key in refSeen.def && JSON.stringify(schema$1[key]) === JSON.stringify(refSeen.def[key])) delete schema$1[key];
2966
+ }
2967
+ }
2968
+ const parent = zodSchema._zod.parent;
2969
+ if (parent && parent !== ref) {
2970
+ flattenRef(parent);
2971
+ const parentSeen = ctx.seen.get(parent);
2972
+ if (parentSeen?.schema.$ref) {
2973
+ schema$1.$ref = parentSeen.schema.$ref;
2974
+ if (parentSeen.def) for (const key in schema$1) {
2975
+ if (key === "$ref" || key === "allOf") continue;
2976
+ if (key in parentSeen.def && JSON.stringify(schema$1[key]) === JSON.stringify(parentSeen.def[key])) delete schema$1[key];
2977
+ }
2978
+ }
2979
+ }
2980
+ ctx.override({
2981
+ zodSchema,
2982
+ jsonSchema: schema$1,
2983
+ path: seen.path ?? []
2984
+ });
2985
+ };
2986
+ for (const entry of [...ctx.seen.entries()].reverse()) flattenRef(entry[0]);
2987
+ const result = {};
2988
+ if (ctx.target === "draft-2020-12") result.$schema = "https://json-schema.org/draft/2020-12/schema";
2989
+ else if (ctx.target === "draft-07") result.$schema = "http://json-schema.org/draft-07/schema#";
2990
+ else if (ctx.target === "draft-04") result.$schema = "http://json-schema.org/draft-04/schema#";
2991
+ else if (ctx.target === "openapi-3.0") {}
2992
+ if (ctx.external?.uri) {
2993
+ const id = ctx.external.registry.get(schema)?.id;
2994
+ if (!id) throw new Error("Schema is missing an `id` property");
2995
+ result.$id = ctx.external.uri(id);
2996
+ }
2997
+ Object.assign(result, root.def ?? root.schema);
2998
+ const defs = ctx.external?.defs ?? {};
2999
+ for (const entry of ctx.seen.entries()) {
3000
+ const seen = entry[1];
3001
+ if (seen.def && seen.defId) defs[seen.defId] = seen.def;
3002
+ }
3003
+ if (ctx.external) {} else if (Object.keys(defs).length > 0) if (ctx.target === "draft-2020-12") result.$defs = defs;
3004
+ else result.definitions = defs;
3005
+ try {
3006
+ const finalized = JSON.parse(JSON.stringify(result));
3007
+ Object.defineProperty(finalized, "~standard", {
3008
+ value: {
3009
+ ...schema["~standard"],
3010
+ jsonSchema: {
3011
+ input: createStandardJSONSchemaMethod(schema, "input", ctx.processors),
3012
+ output: createStandardJSONSchemaMethod(schema, "output", ctx.processors)
3013
+ }
3014
+ },
3015
+ enumerable: false,
3016
+ writable: false
3017
+ });
3018
+ return finalized;
3019
+ } catch (_err) {
3020
+ throw new Error("Error converting schema to JSON.");
3021
+ }
3022
+ }
3023
+ function isTransforming(_schema, _ctx) {
3024
+ const ctx = _ctx ?? { seen: /* @__PURE__ */ new Set() };
3025
+ if (ctx.seen.has(_schema)) return false;
3026
+ ctx.seen.add(_schema);
3027
+ const def = _schema._zod.def;
3028
+ if (def.type === "transform") return true;
3029
+ if (def.type === "array") return isTransforming(def.element, ctx);
3030
+ if (def.type === "set") return isTransforming(def.valueType, ctx);
3031
+ if (def.type === "lazy") return isTransforming(def.getter(), ctx);
3032
+ if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") return isTransforming(def.innerType, ctx);
3033
+ if (def.type === "intersection") return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
3034
+ if (def.type === "record" || def.type === "map") return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
3035
+ if (def.type === "pipe") return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
3036
+ if (def.type === "object") {
3037
+ for (const key in def.shape) if (isTransforming(def.shape[key], ctx)) return true;
3038
+ return false;
3039
+ }
3040
+ if (def.type === "union") {
3041
+ for (const option of def.options) if (isTransforming(option, ctx)) return true;
3042
+ return false;
3043
+ }
3044
+ if (def.type === "tuple") {
3045
+ for (const item of def.items) if (isTransforming(item, ctx)) return true;
3046
+ if (def.rest && isTransforming(def.rest, ctx)) return true;
3047
+ return false;
3048
+ }
3049
+ return false;
3050
+ }
3051
+ /**
3052
+ * Creates a toJSONSchema method for a schema instance.
3053
+ * This encapsulates the logic of initializing context, processing, extracting defs, and finalizing.
3054
+ */
3055
+ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
3056
+ const ctx = initializeContext({
3057
+ ...params,
3058
+ processors
3059
+ });
3060
+ process(schema, ctx);
3061
+ extractDefs(ctx, schema);
3062
+ return finalize(ctx, schema);
3063
+ };
3064
+ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
3065
+ const { libraryOptions, target } = params ?? {};
3066
+ const ctx = initializeContext({
3067
+ ...libraryOptions ?? {},
3068
+ target,
3069
+ io,
3070
+ processors
3071
+ });
3072
+ process(schema, ctx);
3073
+ extractDefs(ctx, schema);
3074
+ return finalize(ctx, schema);
3075
+ };
3076
+
3077
+ //#endregion
3078
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/json-schema-processors.js
3079
+ const formatMap = {
3080
+ guid: "uuid",
3081
+ url: "uri",
3082
+ datetime: "date-time",
3083
+ json_string: "json-string",
3084
+ regex: ""
3085
+ };
3086
+ const stringProcessor = (schema, ctx, _json, _params) => {
3087
+ const json$1 = _json;
3088
+ json$1.type = "string";
3089
+ const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
3090
+ if (typeof minimum === "number") json$1.minLength = minimum;
3091
+ if (typeof maximum === "number") json$1.maxLength = maximum;
3092
+ if (format) {
3093
+ json$1.format = formatMap[format] ?? format;
3094
+ if (json$1.format === "") delete json$1.format;
3095
+ if (format === "time") delete json$1.format;
3096
+ }
3097
+ if (contentEncoding) json$1.contentEncoding = contentEncoding;
3098
+ if (patterns && patterns.size > 0) {
3099
+ const regexes = [...patterns];
3100
+ if (regexes.length === 1) json$1.pattern = regexes[0].source;
3101
+ else if (regexes.length > 1) json$1.allOf = [...regexes.map((regex) => ({
3102
+ ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
3103
+ pattern: regex.source
3104
+ }))];
3105
+ }
3106
+ };
3107
+ const numberProcessor = (schema, ctx, _json, _params) => {
3108
+ const json$1 = _json;
3109
+ const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
3110
+ if (typeof format === "string" && format.includes("int")) json$1.type = "integer";
3111
+ else json$1.type = "number";
3112
+ if (typeof exclusiveMinimum === "number") if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
3113
+ json$1.minimum = exclusiveMinimum;
3114
+ json$1.exclusiveMinimum = true;
3115
+ } else json$1.exclusiveMinimum = exclusiveMinimum;
3116
+ if (typeof minimum === "number") {
3117
+ json$1.minimum = minimum;
3118
+ if (typeof exclusiveMinimum === "number" && ctx.target !== "draft-04") if (exclusiveMinimum >= minimum) delete json$1.minimum;
3119
+ else delete json$1.exclusiveMinimum;
3120
+ }
3121
+ if (typeof exclusiveMaximum === "number") if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
3122
+ json$1.maximum = exclusiveMaximum;
3123
+ json$1.exclusiveMaximum = true;
3124
+ } else json$1.exclusiveMaximum = exclusiveMaximum;
3125
+ if (typeof maximum === "number") {
3126
+ json$1.maximum = maximum;
3127
+ if (typeof exclusiveMaximum === "number" && ctx.target !== "draft-04") if (exclusiveMaximum <= maximum) delete json$1.maximum;
3128
+ else delete json$1.exclusiveMaximum;
3129
+ }
3130
+ if (typeof multipleOf === "number") json$1.multipleOf = multipleOf;
3131
+ };
3132
+ const booleanProcessor = (_schema, _ctx, json$1, _params) => {
3133
+ json$1.type = "boolean";
3134
+ };
3135
+ const neverProcessor = (_schema, _ctx, json$1, _params) => {
3136
+ json$1.not = {};
3137
+ };
3138
+ const anyProcessor = (_schema, _ctx, _json, _params) => {};
3139
+ const unknownProcessor = (_schema, _ctx, _json, _params) => {};
3140
+ const enumProcessor = (schema, _ctx, json$1, _params) => {
3141
+ const def = schema._zod.def;
3142
+ const values = getEnumValues(def.entries);
3143
+ if (values.every((v) => typeof v === "number")) json$1.type = "number";
3144
+ if (values.every((v) => typeof v === "string")) json$1.type = "string";
3145
+ json$1.enum = values;
3146
+ };
3147
+ const customProcessor = (_schema, ctx, _json, _params) => {
3148
+ if (ctx.unrepresentable === "throw") throw new Error("Custom types cannot be represented in JSON Schema");
3149
+ };
3150
+ const transformProcessor = (_schema, ctx, _json, _params) => {
3151
+ if (ctx.unrepresentable === "throw") throw new Error("Transforms cannot be represented in JSON Schema");
3152
+ };
3153
+ const arrayProcessor = (schema, ctx, _json, params) => {
3154
+ const json$1 = _json;
3155
+ const def = schema._zod.def;
3156
+ const { minimum, maximum } = schema._zod.bag;
3157
+ if (typeof minimum === "number") json$1.minItems = minimum;
3158
+ if (typeof maximum === "number") json$1.maxItems = maximum;
3159
+ json$1.type = "array";
3160
+ json$1.items = process(def.element, ctx, {
3161
+ ...params,
3162
+ path: [...params.path, "items"]
3163
+ });
3164
+ };
3165
+ const objectProcessor = (schema, ctx, _json, params) => {
3166
+ const json$1 = _json;
3167
+ const def = schema._zod.def;
3168
+ json$1.type = "object";
3169
+ json$1.properties = {};
3170
+ const shape = def.shape;
3171
+ for (const key in shape) json$1.properties[key] = process(shape[key], ctx, {
3172
+ ...params,
3173
+ path: [
3174
+ ...params.path,
3175
+ "properties",
3176
+ key
3177
+ ]
3178
+ });
3179
+ const allKeys = new Set(Object.keys(shape));
3180
+ const requiredKeys = new Set([...allKeys].filter((key) => {
3181
+ const v = def.shape[key]._zod;
3182
+ if (ctx.io === "input") return v.optin === void 0;
3183
+ else return v.optout === void 0;
3184
+ }));
3185
+ if (requiredKeys.size > 0) json$1.required = Array.from(requiredKeys);
3186
+ if (def.catchall?._zod.def.type === "never") json$1.additionalProperties = false;
3187
+ else if (!def.catchall) {
3188
+ if (ctx.io === "output") json$1.additionalProperties = false;
3189
+ } else if (def.catchall) json$1.additionalProperties = process(def.catchall, ctx, {
3190
+ ...params,
3191
+ path: [...params.path, "additionalProperties"]
3192
+ });
3193
+ };
3194
+ const unionProcessor = (schema, ctx, json$1, params) => {
3195
+ const def = schema._zod.def;
3196
+ const isExclusive = def.inclusive === false;
3197
+ const options = def.options.map((x, i) => process(x, ctx, {
3198
+ ...params,
3199
+ path: [
3200
+ ...params.path,
3201
+ isExclusive ? "oneOf" : "anyOf",
3202
+ i
3203
+ ]
3204
+ }));
3205
+ if (isExclusive) json$1.oneOf = options;
3206
+ else json$1.anyOf = options;
3207
+ };
3208
+ const intersectionProcessor = (schema, ctx, json$1, params) => {
3209
+ const def = schema._zod.def;
3210
+ const a = process(def.left, ctx, {
3211
+ ...params,
3212
+ path: [
3213
+ ...params.path,
3214
+ "allOf",
3215
+ 0
3216
+ ]
3217
+ });
3218
+ const b = process(def.right, ctx, {
3219
+ ...params,
3220
+ path: [
3221
+ ...params.path,
3222
+ "allOf",
3223
+ 1
3224
+ ]
3225
+ });
3226
+ const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
3227
+ json$1.allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
3228
+ };
3229
+ const recordProcessor = (schema, ctx, _json, params) => {
3230
+ const json$1 = _json;
3231
+ const def = schema._zod.def;
3232
+ json$1.type = "object";
3233
+ const keyType = def.keyType;
3234
+ const patterns = keyType._zod.bag?.patterns;
3235
+ if (def.mode === "loose" && patterns && patterns.size > 0) {
3236
+ const valueSchema = process(def.valueType, ctx, {
3237
+ ...params,
3238
+ path: [
3239
+ ...params.path,
3240
+ "patternProperties",
3241
+ "*"
3242
+ ]
3243
+ });
3244
+ json$1.patternProperties = {};
3245
+ for (const pattern of patterns) json$1.patternProperties[pattern.source] = valueSchema;
3246
+ } else {
3247
+ if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json$1.propertyNames = process(def.keyType, ctx, {
3248
+ ...params,
3249
+ path: [...params.path, "propertyNames"]
3250
+ });
3251
+ json$1.additionalProperties = process(def.valueType, ctx, {
3252
+ ...params,
3253
+ path: [...params.path, "additionalProperties"]
3254
+ });
3255
+ }
3256
+ const keyValues = keyType._zod.values;
3257
+ if (keyValues) {
3258
+ const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
3259
+ if (validKeyValues.length > 0) json$1.required = validKeyValues;
3260
+ }
3261
+ };
3262
+ const nullableProcessor = (schema, ctx, json$1, params) => {
3263
+ const def = schema._zod.def;
3264
+ const inner = process(def.innerType, ctx, params);
3265
+ const seen = ctx.seen.get(schema);
3266
+ if (ctx.target === "openapi-3.0") {
3267
+ seen.ref = def.innerType;
3268
+ json$1.nullable = true;
3269
+ } else json$1.anyOf = [inner, { type: "null" }];
3270
+ };
3271
+ const nonoptionalProcessor = (schema, ctx, _json, params) => {
3272
+ const def = schema._zod.def;
3273
+ process(def.innerType, ctx, params);
3274
+ const seen = ctx.seen.get(schema);
3275
+ seen.ref = def.innerType;
3276
+ };
3277
+ const defaultProcessor = (schema, ctx, json$1, params) => {
3278
+ const def = schema._zod.def;
3279
+ process(def.innerType, ctx, params);
3280
+ const seen = ctx.seen.get(schema);
3281
+ seen.ref = def.innerType;
3282
+ json$1.default = JSON.parse(JSON.stringify(def.defaultValue));
3283
+ };
3284
+ const prefaultProcessor = (schema, ctx, json$1, params) => {
3285
+ const def = schema._zod.def;
3286
+ process(def.innerType, ctx, params);
3287
+ const seen = ctx.seen.get(schema);
3288
+ seen.ref = def.innerType;
3289
+ if (ctx.io === "input") json$1._prefault = JSON.parse(JSON.stringify(def.defaultValue));
3290
+ };
3291
+ const catchProcessor = (schema, ctx, json$1, params) => {
3292
+ const def = schema._zod.def;
3293
+ process(def.innerType, ctx, params);
3294
+ const seen = ctx.seen.get(schema);
3295
+ seen.ref = def.innerType;
3296
+ let catchValue;
3297
+ try {
3298
+ catchValue = def.catchValue(void 0);
3299
+ } catch {
3300
+ throw new Error("Dynamic catch values are not supported in JSON Schema");
3301
+ }
3302
+ json$1.default = catchValue;
3303
+ };
3304
+ const pipeProcessor = (schema, ctx, _json, params) => {
3305
+ const def = schema._zod.def;
3306
+ const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
3307
+ process(innerType, ctx, params);
3308
+ const seen = ctx.seen.get(schema);
3309
+ seen.ref = innerType;
3310
+ };
3311
+ const readonlyProcessor = (schema, ctx, json$1, params) => {
3312
+ const def = schema._zod.def;
3313
+ process(def.innerType, ctx, params);
3314
+ const seen = ctx.seen.get(schema);
3315
+ seen.ref = def.innerType;
3316
+ json$1.readOnly = true;
3317
+ };
3318
+ const optionalProcessor = (schema, ctx, _json, params) => {
3319
+ const def = schema._zod.def;
3320
+ process(def.innerType, ctx, params);
3321
+ const seen = ctx.seen.get(schema);
3322
+ seen.ref = def.innerType;
3323
+ };
3324
+ const lazyProcessor = (schema, ctx, _json, params) => {
3325
+ const innerType = schema._zod.innerType;
3326
+ process(innerType, ctx, params);
3327
+ const seen = ctx.seen.get(schema);
3328
+ seen.ref = innerType;
3329
+ };
3330
+
3331
+ //#endregion
3332
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/iso.js
2674
3333
  const ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
2675
3334
  $ZodISODateTime.init(inst, def);
2676
3335
  ZodStringFormat.init(inst, def);
@@ -2701,7 +3360,7 @@ function duration(params) {
2701
3360
  }
2702
3361
 
2703
3362
  //#endregion
2704
- //#region ../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/classic/errors.js
3363
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/errors.js
2705
3364
  const initializer = (inst, issues) => {
2706
3365
  $ZodError.init(inst, issues);
2707
3366
  inst.name = "ZodError";
@@ -2725,7 +3384,7 @@ const ZodError = $constructor("ZodError", initializer);
2725
3384
  const ZodRealError = $constructor("ZodError", initializer, { Parent: Error });
2726
3385
 
2727
3386
  //#endregion
2728
- //#region ../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/classic/parse.js
3387
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/parse.js
2729
3388
  const parse = /* @__PURE__ */ _parse(ZodRealError);
2730
3389
  const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
2731
3390
  const safeParse$1 = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -2740,9 +3399,14 @@ const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
2740
3399
  const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
2741
3400
 
2742
3401
  //#endregion
2743
- //#region ../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/classic/schemas.js
3402
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/schemas.js
2744
3403
  const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
2745
3404
  $ZodType.init(inst, def);
3405
+ Object.assign(inst["~standard"], { jsonSchema: {
3406
+ input: createStandardJSONSchemaMethod(inst, "input"),
3407
+ output: createStandardJSONSchemaMethod(inst, "output")
3408
+ } });
3409
+ inst.toJSONSchema = createToJSONSchemaMethod(inst, {});
2746
3410
  inst.def = def;
2747
3411
  inst.type = def.type;
2748
3412
  Object.defineProperty(inst, "_def", { value: def });
@@ -2751,8 +3415,9 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
2751
3415
  check: ch,
2752
3416
  def: { check: "custom" },
2753
3417
  onattach: []
2754
- } } : ch)] }));
3418
+ } } : ch)] }), { parent: true });
2755
3419
  };
3420
+ inst.with = inst.check;
2756
3421
  inst.clone = (def$1, params) => clone(inst, def$1, params);
2757
3422
  inst.brand = () => inst;
2758
3423
  inst.register = ((reg, meta$2) => {
@@ -2776,6 +3441,7 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
2776
3441
  inst.superRefine = (refinement) => inst.check(superRefine(refinement));
2777
3442
  inst.overwrite = (fn) => inst.check(_overwrite(fn));
2778
3443
  inst.optional = () => optional(inst);
3444
+ inst.exactOptional = () => exactOptional(inst);
2779
3445
  inst.nullable = () => nullable(inst);
2780
3446
  inst.nullish = () => optional(nullable(inst));
2781
3447
  inst.nonoptional = (params) => nonoptional(inst, params);
@@ -2807,12 +3473,14 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
2807
3473
  };
2808
3474
  inst.isOptional = () => inst.safeParse(void 0).success;
2809
3475
  inst.isNullable = () => inst.safeParse(null).success;
3476
+ inst.apply = (fn) => fn(inst);
2810
3477
  return inst;
2811
3478
  });
2812
3479
  /** @internal */
2813
3480
  const _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
2814
3481
  $ZodString.init(inst, def);
2815
3482
  ZodType.init(inst, def);
3483
+ inst._zod.processJSONSchema = (ctx, json$1, params) => stringProcessor(inst, ctx, json$1, params);
2816
3484
  const bag = inst._zod.bag;
2817
3485
  inst.format = bag.format ?? null;
2818
3486
  inst.minLength = bag.minimum ?? null;
@@ -2950,6 +3618,7 @@ const ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
2950
3618
  const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
2951
3619
  $ZodNumber.init(inst, def);
2952
3620
  ZodType.init(inst, def);
3621
+ inst._zod.processJSONSchema = (ctx, json$1, params) => numberProcessor(inst, ctx, json$1, params);
2953
3622
  inst.gt = (value, params) => inst.check(_gt(value, params));
2954
3623
  inst.gte = (value, params) => inst.check(_gte(value, params));
2955
3624
  inst.min = (value, params) => inst.check(_gte(value, params));
@@ -2985,6 +3654,7 @@ function int(params) {
2985
3654
  const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
2986
3655
  $ZodBoolean.init(inst, def);
2987
3656
  ZodType.init(inst, def);
3657
+ inst._zod.processJSONSchema = (ctx, json$1, params) => booleanProcessor(inst, ctx, json$1, params);
2988
3658
  });
2989
3659
  function boolean$1(params) {
2990
3660
  return _boolean(ZodBoolean, params);
@@ -2992,6 +3662,7 @@ function boolean$1(params) {
2992
3662
  const ZodAny = /* @__PURE__ */ $constructor("ZodAny", (inst, def) => {
2993
3663
  $ZodAny.init(inst, def);
2994
3664
  ZodType.init(inst, def);
3665
+ inst._zod.processJSONSchema = (ctx, json$1, params) => anyProcessor(inst, ctx, json$1, params);
2995
3666
  });
2996
3667
  function any() {
2997
3668
  return _any(ZodAny);
@@ -2999,6 +3670,7 @@ function any() {
2999
3670
  const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
3000
3671
  $ZodUnknown.init(inst, def);
3001
3672
  ZodType.init(inst, def);
3673
+ inst._zod.processJSONSchema = (ctx, json$1, params) => unknownProcessor(inst, ctx, json$1, params);
3002
3674
  });
3003
3675
  function unknown() {
3004
3676
  return _unknown(ZodUnknown);
@@ -3006,6 +3678,7 @@ function unknown() {
3006
3678
  const ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
3007
3679
  $ZodNever.init(inst, def);
3008
3680
  ZodType.init(inst, def);
3681
+ inst._zod.processJSONSchema = (ctx, json$1, params) => neverProcessor(inst, ctx, json$1, params);
3009
3682
  });
3010
3683
  function never(params) {
3011
3684
  return _never(ZodNever, params);
@@ -3013,6 +3686,7 @@ function never(params) {
3013
3686
  const ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
3014
3687
  $ZodArray.init(inst, def);
3015
3688
  ZodType.init(inst, def);
3689
+ inst._zod.processJSONSchema = (ctx, json$1, params) => arrayProcessor(inst, ctx, json$1, params);
3016
3690
  inst.element = def.element;
3017
3691
  inst.min = (minLength, params) => inst.check(_minLength(minLength, params));
3018
3692
  inst.nonempty = (params) => inst.check(_minLength(1, params));
@@ -3026,6 +3700,7 @@ function array(element, params) {
3026
3700
  const ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
3027
3701
  $ZodObjectJIT.init(inst, def);
3028
3702
  ZodType.init(inst, def);
3703
+ inst._zod.processJSONSchema = (ctx, json$1, params) => objectProcessor(inst, ctx, json$1, params);
3029
3704
  defineLazy(inst, "shape", () => {
3030
3705
  return def.shape;
3031
3706
  });
@@ -3072,6 +3747,7 @@ function object(shape, params) {
3072
3747
  const ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
3073
3748
  $ZodUnion.init(inst, def);
3074
3749
  ZodType.init(inst, def);
3750
+ inst._zod.processJSONSchema = (ctx, json$1, params) => unionProcessor(inst, ctx, json$1, params);
3075
3751
  inst.options = def.options;
3076
3752
  });
3077
3753
  function union(options, params) {
@@ -3084,6 +3760,7 @@ function union(options, params) {
3084
3760
  const ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
3085
3761
  $ZodIntersection.init(inst, def);
3086
3762
  ZodType.init(inst, def);
3763
+ inst._zod.processJSONSchema = (ctx, json$1, params) => intersectionProcessor(inst, ctx, json$1, params);
3087
3764
  });
3088
3765
  function intersection(left, right) {
3089
3766
  return new ZodIntersection({
@@ -3095,6 +3772,7 @@ function intersection(left, right) {
3095
3772
  const ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
3096
3773
  $ZodRecord.init(inst, def);
3097
3774
  ZodType.init(inst, def);
3775
+ inst._zod.processJSONSchema = (ctx, json$1, params) => recordProcessor(inst, ctx, json$1, params);
3098
3776
  inst.keyType = def.keyType;
3099
3777
  inst.valueType = def.valueType;
3100
3778
  });
@@ -3109,6 +3787,7 @@ function record(keyType, valueType, params) {
3109
3787
  const ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
3110
3788
  $ZodEnum.init(inst, def);
3111
3789
  ZodType.init(inst, def);
3790
+ inst._zod.processJSONSchema = (ctx, json$1, params) => enumProcessor(inst, ctx, json$1, params);
3112
3791
  inst.enum = def.entries;
3113
3792
  inst.options = Object.values(def.entries);
3114
3793
  const keys = new Set(Object.keys(def.entries));
@@ -3145,6 +3824,7 @@ function _enum(values, params) {
3145
3824
  const ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
3146
3825
  $ZodTransform.init(inst, def);
3147
3826
  ZodType.init(inst, def);
3827
+ inst._zod.processJSONSchema = (ctx, json$1, params) => transformProcessor(inst, ctx, json$1, params);
3148
3828
  inst._zod.parse = (payload, _ctx) => {
3149
3829
  if (_ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
3150
3830
  payload.addIssue = (issue$1) => {
@@ -3176,6 +3856,7 @@ function transform(fn) {
3176
3856
  const ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
3177
3857
  $ZodOptional.init(inst, def);
3178
3858
  ZodType.init(inst, def);
3859
+ inst._zod.processJSONSchema = (ctx, json$1, params) => optionalProcessor(inst, ctx, json$1, params);
3179
3860
  inst.unwrap = () => inst._zod.def.innerType;
3180
3861
  });
3181
3862
  function optional(innerType) {
@@ -3184,9 +3865,22 @@ function optional(innerType) {
3184
3865
  innerType
3185
3866
  });
3186
3867
  }
3868
+ const ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
3869
+ $ZodExactOptional.init(inst, def);
3870
+ ZodType.init(inst, def);
3871
+ inst._zod.processJSONSchema = (ctx, json$1, params) => optionalProcessor(inst, ctx, json$1, params);
3872
+ inst.unwrap = () => inst._zod.def.innerType;
3873
+ });
3874
+ function exactOptional(innerType) {
3875
+ return new ZodExactOptional({
3876
+ type: "optional",
3877
+ innerType
3878
+ });
3879
+ }
3187
3880
  const ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
3188
3881
  $ZodNullable.init(inst, def);
3189
3882
  ZodType.init(inst, def);
3883
+ inst._zod.processJSONSchema = (ctx, json$1, params) => nullableProcessor(inst, ctx, json$1, params);
3190
3884
  inst.unwrap = () => inst._zod.def.innerType;
3191
3885
  });
3192
3886
  function nullable(innerType) {
@@ -3198,6 +3892,7 @@ function nullable(innerType) {
3198
3892
  const ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
3199
3893
  $ZodDefault.init(inst, def);
3200
3894
  ZodType.init(inst, def);
3895
+ inst._zod.processJSONSchema = (ctx, json$1, params) => defaultProcessor(inst, ctx, json$1, params);
3201
3896
  inst.unwrap = () => inst._zod.def.innerType;
3202
3897
  inst.removeDefault = inst.unwrap;
3203
3898
  });
@@ -3213,6 +3908,7 @@ function _default(innerType, defaultValue) {
3213
3908
  const ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
3214
3909
  $ZodPrefault.init(inst, def);
3215
3910
  ZodType.init(inst, def);
3911
+ inst._zod.processJSONSchema = (ctx, json$1, params) => prefaultProcessor(inst, ctx, json$1, params);
3216
3912
  inst.unwrap = () => inst._zod.def.innerType;
3217
3913
  });
3218
3914
  function prefault(innerType, defaultValue) {
@@ -3227,6 +3923,7 @@ function prefault(innerType, defaultValue) {
3227
3923
  const ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
3228
3924
  $ZodNonOptional.init(inst, def);
3229
3925
  ZodType.init(inst, def);
3926
+ inst._zod.processJSONSchema = (ctx, json$1, params) => nonoptionalProcessor(inst, ctx, json$1, params);
3230
3927
  inst.unwrap = () => inst._zod.def.innerType;
3231
3928
  });
3232
3929
  function nonoptional(innerType, params) {
@@ -3239,6 +3936,7 @@ function nonoptional(innerType, params) {
3239
3936
  const ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
3240
3937
  $ZodCatch.init(inst, def);
3241
3938
  ZodType.init(inst, def);
3939
+ inst._zod.processJSONSchema = (ctx, json$1, params) => catchProcessor(inst, ctx, json$1, params);
3242
3940
  inst.unwrap = () => inst._zod.def.innerType;
3243
3941
  inst.removeCatch = inst.unwrap;
3244
3942
  });
@@ -3252,6 +3950,7 @@ function _catch(innerType, catchValue) {
3252
3950
  const ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
3253
3951
  $ZodPipe.init(inst, def);
3254
3952
  ZodType.init(inst, def);
3953
+ inst._zod.processJSONSchema = (ctx, json$1, params) => pipeProcessor(inst, ctx, json$1, params);
3255
3954
  inst.in = def.in;
3256
3955
  inst.out = def.out;
3257
3956
  });
@@ -3265,6 +3964,7 @@ function pipe(in_, out) {
3265
3964
  const ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
3266
3965
  $ZodReadonly.init(inst, def);
3267
3966
  ZodType.init(inst, def);
3967
+ inst._zod.processJSONSchema = (ctx, json$1, params) => readonlyProcessor(inst, ctx, json$1, params);
3268
3968
  inst.unwrap = () => inst._zod.def.innerType;
3269
3969
  });
3270
3970
  function readonly(innerType) {
@@ -3276,6 +3976,7 @@ function readonly(innerType) {
3276
3976
  const ZodLazy = /* @__PURE__ */ $constructor("ZodLazy", (inst, def) => {
3277
3977
  $ZodLazy.init(inst, def);
3278
3978
  ZodType.init(inst, def);
3979
+ inst._zod.processJSONSchema = (ctx, json$1, params) => lazyProcessor(inst, ctx, json$1, params);
3279
3980
  inst.unwrap = () => inst._zod.def.getter();
3280
3981
  });
3281
3982
  function lazy(getter) {
@@ -3287,6 +3988,7 @@ function lazy(getter) {
3287
3988
  const ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
3288
3989
  $ZodCustom.init(inst, def);
3289
3990
  ZodType.init(inst, def);
3991
+ inst._zod.processJSONSchema = (ctx, json$1, params) => customProcessor(inst, ctx, json$1, params);
3290
3992
  });
3291
3993
  function custom(fn, _params) {
3292
3994
  return _custom(ZodCustom, fn ?? (() => true), _params);
@@ -3301,7 +4003,7 @@ const describe = describe$1;
3301
4003
  const meta = meta$1;
3302
4004
 
3303
4005
  //#endregion
3304
- //#region ../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/classic/coerce.js
4006
+ //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/coerce.js
3305
4007
  function boolean(params) {
3306
4008
  return _coercedBoolean(ZodBoolean, params);
3307
4009
  }
@@ -4140,7 +4842,10 @@ var HeaderForwardingHook = class {
4140
4842
  async beforeRequest(_hookCtx, request) {
4141
4843
  if (Object.keys(this.headersToForward).length === 0) return request;
4142
4844
  const newHeaders = new Headers(request.headers);
4143
- for (const [key, value] of Object.entries(this.headersToForward)) if (!newHeaders.has(key)) newHeaders.set(key, value);
4845
+ for (const [key, value] of Object.entries(this.headersToForward)) {
4846
+ const existingValue = newHeaders.get(key);
4847
+ if (!existingValue || key === "cookie" && existingValue === "") newHeaders.set(key, value);
4848
+ }
4144
4849
  return new Request(request, { headers: newHeaders });
4145
4850
  }
4146
4851
  };