@glasstrace/sdk 1.10.2 → 1.12.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.
Files changed (91) hide show
  1. package/README.md +63 -8
  2. package/dist/async-context/index.cjs +1189 -440
  3. package/dist/async-context/index.cjs.map +1 -1
  4. package/dist/async-context/index.js +2 -2
  5. package/dist/{capture-error-BeuEXXJO.d.cts → capture-error-CRQSqKgd.d.cts} +2 -2
  6. package/dist/{capture-error-D02pzB7q.d.ts → capture-error-CqCbjoMq.d.ts} +2 -2
  7. package/dist/{chunk-OXM2BZMF.js → chunk-4YRYR32D.js} +2 -2
  8. package/dist/{chunk-XG6WR2KS.js → chunk-6NKMAKMI.js} +3 -3
  9. package/dist/{chunk-6RKS3DNA.js → chunk-BN5DVIUO.js} +1176 -424
  10. package/dist/chunk-BN5DVIUO.js.map +1 -0
  11. package/dist/{chunk-QS5RZ2TC.js → chunk-CZQN6G4I.js} +28 -22
  12. package/dist/chunk-CZQN6G4I.js.map +1 -0
  13. package/dist/{chunk-D54FMQHF.js → chunk-FFNGE5RR.js} +2 -2
  14. package/dist/{chunk-RL43PU2X.js → chunk-J3ZCVE67.js} +2 -2
  15. package/dist/{chunk-BSVWJSVX.js → chunk-KBHGPQZ2.js} +2 -2
  16. package/dist/{chunk-CIKPFJOM.js → chunk-KOYZJN6G.js} +310 -20
  17. package/dist/chunk-KOYZJN6G.js.map +1 -0
  18. package/dist/{chunk-M5GO2SSO.js → chunk-M3ZTG4P5.js} +2 -2
  19. package/dist/{chunk-UMGZJYC4.js → chunk-V75ZB4G4.js} +10 -5
  20. package/dist/chunk-V75ZB4G4.js.map +1 -0
  21. package/dist/{chunk-ZBQQXVHD.js → chunk-YIEXKQYP.js} +2 -67
  22. package/dist/chunk-YIEXKQYP.js.map +1 -0
  23. package/dist/{chunk-QVTONMVZ.js → chunk-ZIL2IY4C.js} +2 -2
  24. package/dist/cli/init.cjs +1672 -576
  25. package/dist/cli/init.cjs.map +1 -1
  26. package/dist/cli/init.js +33 -20
  27. package/dist/cli/init.js.map +1 -1
  28. package/dist/cli/mcp-add.cjs +1509 -521
  29. package/dist/cli/mcp-add.cjs.map +1 -1
  30. package/dist/cli/mcp-add.js +34 -16
  31. package/dist/cli/mcp-add.js.map +1 -1
  32. package/dist/cli/status.cjs +6 -1
  33. package/dist/cli/status.cjs.map +1 -1
  34. package/dist/cli/status.js +7 -2
  35. package/dist/cli/status.js.map +1 -1
  36. package/dist/cli/uninit.cjs +6 -1
  37. package/dist/cli/uninit.cjs.map +1 -1
  38. package/dist/cli/uninit.js +4 -4
  39. package/dist/cli/upgrade-instructions.cjs +383 -112
  40. package/dist/cli/upgrade-instructions.cjs.map +1 -1
  41. package/dist/cli/upgrade-instructions.js +72 -20
  42. package/dist/cli/upgrade-instructions.js.map +1 -1
  43. package/dist/cli/validate.cjs +1168 -422
  44. package/dist/cli/validate.cjs.map +1 -1
  45. package/dist/cli/validate.js +2 -2
  46. package/dist/{correlation-id-NAapJ5jn.d.cts → correlation-id-CFpyJsKv.d.cts} +1 -1
  47. package/dist/{correlation-id-B_K8adD6.d.ts → correlation-id-DPXyY9-3.d.ts} +1 -1
  48. package/dist/edge-entry.cjs +1197 -448
  49. package/dist/edge-entry.cjs.map +1 -1
  50. package/dist/edge-entry.d.cts +2 -2
  51. package/dist/edge-entry.d.ts +2 -2
  52. package/dist/edge-entry.js +4 -4
  53. package/dist/index.cjs +1341 -553
  54. package/dist/index.cjs.map +1 -1
  55. package/dist/{index.d-CkTf_boH.d.cts → index.d-D-jdiIPU.d.cts} +1 -1
  56. package/dist/{index.d-CkTf_boH.d.ts → index.d-D-jdiIPU.d.ts} +1 -1
  57. package/dist/index.d.cts +4 -4
  58. package/dist/index.d.ts +4 -4
  59. package/dist/index.js +14 -7
  60. package/dist/index.js.map +1 -1
  61. package/dist/middleware/index.cjs +1192 -443
  62. package/dist/middleware/index.cjs.map +1 -1
  63. package/dist/middleware/index.js +2 -2
  64. package/dist/node-entry.cjs +1329 -551
  65. package/dist/node-entry.cjs.map +1 -1
  66. package/dist/node-entry.d.cts +3 -3
  67. package/dist/node-entry.d.ts +3 -3
  68. package/dist/node-entry.js +8 -8
  69. package/dist/node-subpath.cjs +1168 -422
  70. package/dist/node-subpath.cjs.map +1 -1
  71. package/dist/node-subpath.d.cts +1 -1
  72. package/dist/node-subpath.d.ts +1 -1
  73. package/dist/node-subpath.js +3 -3
  74. package/dist/{source-map-uploader-CLYCE2TZ.js → source-map-uploader-K67LTPBG.js} +3 -3
  75. package/dist/trpc/index.cjs +1187 -438
  76. package/dist/trpc/index.cjs.map +1 -1
  77. package/dist/trpc/index.js +1 -1
  78. package/package.json +2 -2
  79. package/dist/chunk-6RKS3DNA.js.map +0 -1
  80. package/dist/chunk-CIKPFJOM.js.map +0 -1
  81. package/dist/chunk-QS5RZ2TC.js.map +0 -1
  82. package/dist/chunk-UMGZJYC4.js.map +0 -1
  83. package/dist/chunk-ZBQQXVHD.js.map +0 -1
  84. /package/dist/{chunk-OXM2BZMF.js.map → chunk-4YRYR32D.js.map} +0 -0
  85. /package/dist/{chunk-XG6WR2KS.js.map → chunk-6NKMAKMI.js.map} +0 -0
  86. /package/dist/{chunk-D54FMQHF.js.map → chunk-FFNGE5RR.js.map} +0 -0
  87. /package/dist/{chunk-RL43PU2X.js.map → chunk-J3ZCVE67.js.map} +0 -0
  88. /package/dist/{chunk-BSVWJSVX.js.map → chunk-KBHGPQZ2.js.map} +0 -0
  89. /package/dist/{chunk-M5GO2SSO.js.map → chunk-M3ZTG4P5.js.map} +0 -0
  90. /package/dist/{chunk-QVTONMVZ.js.map → chunk-ZIL2IY4C.js.map} +0 -0
  91. /package/dist/{source-map-uploader-CLYCE2TZ.js.map → source-map-uploader-K67LTPBG.js.map} +0 -0
package/dist/cli/init.cjs CHANGED
@@ -84,10 +84,10 @@ function $constructor(name, initializer3, params) {
84
84
  }
85
85
  Object.defineProperty(Definition, "name", { value: name });
86
86
  function _(def) {
87
- var _a2;
87
+ var _a3;
88
88
  const inst = params?.Parent ? new Definition() : this;
89
89
  init(inst, def);
90
- (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
90
+ (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
91
91
  for (const fn of inst._zod.deferred) {
92
92
  fn();
93
93
  }
@@ -109,11 +109,11 @@ function config(newConfig) {
109
109
  Object.assign(globalConfig, newConfig);
110
110
  return globalConfig;
111
111
  }
112
- var NEVER, $brand, $ZodAsyncError, $ZodEncodeError, globalConfig;
112
+ var _a, NEVER, $brand, $ZodAsyncError, $ZodEncodeError, globalConfig;
113
113
  var init_core = __esm({
114
114
  "../../node_modules/zod/v4/core/core.js"() {
115
115
  "use strict";
116
- NEVER = Object.freeze({
116
+ NEVER = /* @__PURE__ */ Object.freeze({
117
117
  status: "aborted"
118
118
  });
119
119
  $brand = /* @__PURE__ */ Symbol("zod_brand");
@@ -128,7 +128,8 @@ var init_core = __esm({
128
128
  this.name = "ZodEncodeError";
129
129
  }
130
130
  };
131
- globalConfig = {};
131
+ (_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});
132
+ globalConfig = globalThis.__zod_globalConfig;
132
133
  }
133
134
  });
134
135
 
@@ -158,6 +159,7 @@ __export(util_exports, {
158
159
  defineLazy: () => defineLazy,
159
160
  esc: () => esc,
160
161
  escapeRegex: () => escapeRegex,
162
+ explicitlyAborted: () => explicitlyAborted,
161
163
  extend: () => extend,
162
164
  finalizeIssue: () => finalizeIssue,
163
165
  floatSafeRemainder: () => floatSafeRemainder,
@@ -246,19 +248,12 @@ function cleanRegex(source) {
246
248
  return source.slice(start, end);
247
249
  }
248
250
  function floatSafeRemainder(val, step) {
249
- const valDecCount = (val.toString().split(".")[1] || "").length;
250
- const stepString = step.toString();
251
- let stepDecCount = (stepString.split(".")[1] || "").length;
252
- if (stepDecCount === 0 && /\d?e-\d?/.test(stepString)) {
253
- const match = stepString.match(/\d?e-(\d?)/);
254
- if (match?.[1]) {
255
- stepDecCount = Number.parseInt(match[1]);
256
- }
257
- }
258
- const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
259
- const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
260
- const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
261
- return valInt % stepInt / 10 ** decCount;
251
+ const ratio = val / step;
252
+ const roundedRatio = Math.round(ratio);
253
+ const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);
254
+ if (Math.abs(ratio - roundedRatio) < tolerance)
255
+ return 0;
256
+ return ratio - roundedRatio;
262
257
  }
263
258
  function defineLazy(object2, key, getter) {
264
259
  let value = void 0;
@@ -358,6 +353,10 @@ function shallowClone(o) {
358
353
  return { ...o };
359
354
  if (Array.isArray(o))
360
355
  return [...o];
356
+ if (o instanceof Map)
357
+ return new Map(o);
358
+ if (o instanceof Set)
359
+ return new Set(o);
361
360
  return o;
362
361
  }
363
362
  function numKeys(data) {
@@ -526,6 +525,9 @@ function safeExtend(schema, shape) {
526
525
  return clone(schema, def);
527
526
  }
528
527
  function merge(a, b) {
528
+ if (a._zod.def.checks?.length) {
529
+ throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
530
+ }
529
531
  const def = mergeDefs(a._zod.def, {
530
532
  get shape() {
531
533
  const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
@@ -535,8 +537,7 @@ function merge(a, b) {
535
537
  get catchall() {
536
538
  return b._zod.def.catchall;
537
539
  },
538
- checks: []
539
- // delete existing checks
540
+ checks: b._zod.def.checks ?? []
540
541
  });
541
542
  return clone(a, def);
542
543
  }
@@ -619,10 +620,20 @@ function aborted(x, startIndex = 0) {
619
620
  }
620
621
  return false;
621
622
  }
623
+ function explicitlyAborted(x, startIndex = 0) {
624
+ if (x.aborted === true)
625
+ return true;
626
+ for (let i = startIndex; i < x.issues.length; i++) {
627
+ if (x.issues[i]?.continue === false) {
628
+ return true;
629
+ }
630
+ }
631
+ return false;
632
+ }
622
633
  function prefixIssues(path10, issues) {
623
634
  return issues.map((iss) => {
624
- var _a2;
625
- (_a2 = iss).path ?? (_a2.path = []);
635
+ var _a3;
636
+ (_a3 = iss).path ?? (_a3.path = []);
626
637
  iss.path.unshift(path10);
627
638
  return iss;
628
639
  });
@@ -631,17 +642,14 @@ function unwrapMessage(message) {
631
642
  return typeof message === "string" ? message : message?.message;
632
643
  }
633
644
  function finalizeIssue(iss, ctx, config2) {
634
- const full = { ...iss, path: iss.path ?? [] };
635
- if (!iss.message) {
636
- const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
637
- full.message = message;
645
+ 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";
646
+ const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
647
+ rest.path ?? (rest.path = []);
648
+ rest.message = message;
649
+ if (ctx?.reportInput) {
650
+ rest.input = _input;
638
651
  }
639
- delete full.inst;
640
- delete full.continue;
641
- if (!ctx?.reportInput) {
642
- delete full.input;
643
- }
644
- return full;
652
+ return rest;
645
653
  }
646
654
  function getSizableOrigin(input) {
647
655
  if (input instanceof Set)
@@ -738,10 +746,14 @@ var EVALUATING, captureStackTrace, allowsEval, getParsedType, propertyKeyTypes,
738
746
  var init_util = __esm({
739
747
  "../../node_modules/zod/v4/core/util.js"() {
740
748
  "use strict";
749
+ init_core();
741
750
  EVALUATING = /* @__PURE__ */ Symbol("evaluating");
742
751
  captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
743
752
  };
744
- allowsEval = cached(() => {
753
+ allowsEval = /* @__PURE__ */ cached(() => {
754
+ if (globalConfig.jitless) {
755
+ return false;
756
+ }
745
757
  if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
746
758
  return false;
747
759
  }
@@ -798,7 +810,14 @@ var init_util = __esm({
798
810
  }
799
811
  };
800
812
  propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
801
- primitiveTypes = /* @__PURE__ */ new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
813
+ primitiveTypes = /* @__PURE__ */ new Set([
814
+ "string",
815
+ "number",
816
+ "bigint",
817
+ "boolean",
818
+ "symbol",
819
+ "undefined"
820
+ ]);
802
821
  NUMBER_FORMAT_RANGES = {
803
822
  safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
804
823
  int32: [-2147483648, 2147483647],
@@ -818,10 +837,10 @@ var init_util = __esm({
818
837
  });
819
838
 
820
839
  // ../../node_modules/zod/v4/core/errors.js
821
- function flattenError(error48, mapper = (issue2) => issue2.message) {
840
+ function flattenError(error51, mapper = (issue2) => issue2.message) {
822
841
  const fieldErrors = {};
823
842
  const formErrors = [];
824
- for (const sub of error48.issues) {
843
+ for (const sub of error51.issues) {
825
844
  if (sub.path.length > 0) {
826
845
  fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
827
846
  fieldErrors[sub.path[0]].push(mapper(sub));
@@ -831,50 +850,53 @@ function flattenError(error48, mapper = (issue2) => issue2.message) {
831
850
  }
832
851
  return { formErrors, fieldErrors };
833
852
  }
834
- function formatError(error48, mapper = (issue2) => issue2.message) {
853
+ function formatError(error51, mapper = (issue2) => issue2.message) {
835
854
  const fieldErrors = { _errors: [] };
836
- const processError = (error49) => {
837
- for (const issue2 of error49.issues) {
855
+ const processError = (error52, path10 = []) => {
856
+ for (const issue2 of error52.issues) {
838
857
  if (issue2.code === "invalid_union" && issue2.errors.length) {
839
- issue2.errors.map((issues) => processError({ issues }));
858
+ issue2.errors.map((issues) => processError({ issues }, [...path10, ...issue2.path]));
840
859
  } else if (issue2.code === "invalid_key") {
841
- processError({ issues: issue2.issues });
860
+ processError({ issues: issue2.issues }, [...path10, ...issue2.path]);
842
861
  } else if (issue2.code === "invalid_element") {
843
- processError({ issues: issue2.issues });
844
- } else if (issue2.path.length === 0) {
845
- fieldErrors._errors.push(mapper(issue2));
862
+ processError({ issues: issue2.issues }, [...path10, ...issue2.path]);
846
863
  } else {
847
- let curr = fieldErrors;
848
- let i = 0;
849
- while (i < issue2.path.length) {
850
- const el = issue2.path[i];
851
- const terminal = i === issue2.path.length - 1;
852
- if (!terminal) {
853
- curr[el] = curr[el] || { _errors: [] };
854
- } else {
855
- curr[el] = curr[el] || { _errors: [] };
856
- curr[el]._errors.push(mapper(issue2));
864
+ const fullpath = [...path10, ...issue2.path];
865
+ if (fullpath.length === 0) {
866
+ fieldErrors._errors.push(mapper(issue2));
867
+ } else {
868
+ let curr = fieldErrors;
869
+ let i = 0;
870
+ while (i < fullpath.length) {
871
+ const el = fullpath[i];
872
+ const terminal = i === fullpath.length - 1;
873
+ if (!terminal) {
874
+ curr[el] = curr[el] || { _errors: [] };
875
+ } else {
876
+ curr[el] = curr[el] || { _errors: [] };
877
+ curr[el]._errors.push(mapper(issue2));
878
+ }
879
+ curr = curr[el];
880
+ i++;
857
881
  }
858
- curr = curr[el];
859
- i++;
860
882
  }
861
883
  }
862
884
  }
863
885
  };
864
- processError(error48);
886
+ processError(error51);
865
887
  return fieldErrors;
866
888
  }
867
- function treeifyError(error48, mapper = (issue2) => issue2.message) {
889
+ function treeifyError(error51, mapper = (issue2) => issue2.message) {
868
890
  const result = { errors: [] };
869
- const processError = (error49, path10 = []) => {
870
- var _a2, _b;
871
- for (const issue2 of error49.issues) {
891
+ const processError = (error52, path10 = []) => {
892
+ var _a3, _b;
893
+ for (const issue2 of error52.issues) {
872
894
  if (issue2.code === "invalid_union" && issue2.errors.length) {
873
- issue2.errors.map((issues) => processError({ issues }, issue2.path));
895
+ issue2.errors.map((issues) => processError({ issues }, [...path10, ...issue2.path]));
874
896
  } else if (issue2.code === "invalid_key") {
875
- processError({ issues: issue2.issues }, issue2.path);
897
+ processError({ issues: issue2.issues }, [...path10, ...issue2.path]);
876
898
  } else if (issue2.code === "invalid_element") {
877
- processError({ issues: issue2.issues }, issue2.path);
899
+ processError({ issues: issue2.issues }, [...path10, ...issue2.path]);
878
900
  } else {
879
901
  const fullpath = [...path10, ...issue2.path];
880
902
  if (fullpath.length === 0) {
@@ -888,7 +910,7 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
888
910
  const terminal = i === fullpath.length - 1;
889
911
  if (typeof el === "string") {
890
912
  curr.properties ?? (curr.properties = {});
891
- (_a2 = curr.properties)[el] ?? (_a2[el] = { errors: [] });
913
+ (_a3 = curr.properties)[el] ?? (_a3[el] = { errors: [] });
892
914
  curr = curr.properties[el];
893
915
  } else {
894
916
  curr.items ?? (curr.items = []);
@@ -903,7 +925,7 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
903
925
  }
904
926
  }
905
927
  };
906
- processError(error48);
928
+ processError(error51);
907
929
  return result;
908
930
  }
909
931
  function toDotPath(_path) {
@@ -924,9 +946,9 @@ function toDotPath(_path) {
924
946
  }
925
947
  return segs.join("");
926
948
  }
927
- function prettifyError(error48) {
949
+ function prettifyError(error51) {
928
950
  const lines = [];
929
- const issues = [...error48.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);
951
+ const issues = [...error51.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);
930
952
  for (const issue2 of issues) {
931
953
  lines.push(`\u2716 ${issue2.message}`);
932
954
  if (issue2.path?.length)
@@ -970,7 +992,7 @@ var init_parse = __esm({
970
992
  init_errors();
971
993
  init_util();
972
994
  _parse = (_Err) => (schema, value, _ctx, _params) => {
973
- const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
995
+ const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
974
996
  const result = schema._zod.run({ value, issues: [] }, ctx);
975
997
  if (result instanceof Promise) {
976
998
  throw new $ZodAsyncError();
@@ -984,7 +1006,7 @@ var init_parse = __esm({
984
1006
  };
985
1007
  parse = /* @__PURE__ */ _parse($ZodRealError);
986
1008
  _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
987
- const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
1009
+ const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
988
1010
  let result = schema._zod.run({ value, issues: [] }, ctx);
989
1011
  if (result instanceof Promise)
990
1012
  result = await result;
@@ -1009,7 +1031,7 @@ var init_parse = __esm({
1009
1031
  };
1010
1032
  safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
1011
1033
  _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
1012
- const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
1034
+ const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
1013
1035
  let result = schema._zod.run({ value, issues: [] }, ctx);
1014
1036
  if (result instanceof Promise)
1015
1037
  result = await result;
@@ -1020,7 +1042,7 @@ var init_parse = __esm({
1020
1042
  };
1021
1043
  safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
1022
1044
  _encode = (_Err) => (schema, value, _ctx) => {
1023
- const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
1045
+ const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
1024
1046
  return _parse(_Err)(schema, value, ctx);
1025
1047
  };
1026
1048
  encode = /* @__PURE__ */ _encode($ZodRealError);
@@ -1029,7 +1051,7 @@ var init_parse = __esm({
1029
1051
  };
1030
1052
  decode = /* @__PURE__ */ _decode($ZodRealError);
1031
1053
  _encodeAsync = (_Err) => async (schema, value, _ctx) => {
1032
- const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
1054
+ const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
1033
1055
  return _parseAsync(_Err)(schema, value, ctx);
1034
1056
  };
1035
1057
  encodeAsync = /* @__PURE__ */ _encodeAsync($ZodRealError);
@@ -1038,7 +1060,7 @@ var init_parse = __esm({
1038
1060
  };
1039
1061
  decodeAsync = /* @__PURE__ */ _decodeAsync($ZodRealError);
1040
1062
  _safeEncode = (_Err) => (schema, value, _ctx) => {
1041
- const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
1063
+ const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
1042
1064
  return _safeParse(_Err)(schema, value, ctx);
1043
1065
  };
1044
1066
  safeEncode = /* @__PURE__ */ _safeEncode($ZodRealError);
@@ -1047,7 +1069,7 @@ var init_parse = __esm({
1047
1069
  };
1048
1070
  safeDecode = /* @__PURE__ */ _safeDecode($ZodRealError);
1049
1071
  _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
1050
- const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
1072
+ const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
1051
1073
  return _safeParseAsync(_Err)(schema, value, ctx);
1052
1074
  };
1053
1075
  safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync($ZodRealError);
@@ -1082,6 +1104,7 @@ __export(regexes_exports, {
1082
1104
  hex: () => hex,
1083
1105
  hostname: () => hostname,
1084
1106
  html5Email: () => html5Email,
1107
+ httpProtocol: () => httpProtocol,
1085
1108
  idnEmail: () => idnEmail,
1086
1109
  integer: () => integer,
1087
1110
  ipv4: () => ipv4,
@@ -1147,12 +1170,12 @@ function fixedBase64(bodyLength, padding) {
1147
1170
  function fixedBase64url(length) {
1148
1171
  return new RegExp(`^[A-Za-z0-9_-]{${length}}$`);
1149
1172
  }
1150
- var cuid, cuid2, ulid, xid, ksuid, nanoid, duration, extendedDuration, guid, uuid, uuid4, uuid6, uuid7, email, html5Email, rfc5322Email, unicodeEmail, idnEmail, browserEmail, _emoji, ipv4, ipv6, mac, cidrv4, cidrv6, base64, base64url, hostname, domain, e164, dateSource, date, string, bigint, integer, number, boolean, _null, _undefined, lowercase, uppercase, hex, md5_hex, md5_base64, md5_base64url, sha1_hex, sha1_base64, sha1_base64url, sha256_hex, sha256_base64, sha256_base64url, sha384_hex, sha384_base64, sha384_base64url, sha512_hex, sha512_base64, sha512_base64url;
1173
+ var cuid, cuid2, ulid, xid, ksuid, nanoid, duration, extendedDuration, guid, uuid, uuid4, uuid6, uuid7, email, html5Email, rfc5322Email, unicodeEmail, idnEmail, browserEmail, _emoji, ipv4, ipv6, mac, cidrv4, cidrv6, base64, base64url, hostname, domain, httpProtocol, e164, dateSource, date, string, bigint, integer, number, boolean, _null, _undefined, lowercase, uppercase, hex, md5_hex, md5_base64, md5_base64url, sha1_hex, sha1_base64, sha1_base64url, sha256_hex, sha256_base64, sha256_base64url, sha384_hex, sha384_base64, sha384_base64url, sha512_hex, sha512_base64, sha512_base64url;
1151
1174
  var init_regexes = __esm({
1152
1175
  "../../node_modules/zod/v4/core/regexes.js"() {
1153
1176
  "use strict";
1154
1177
  init_util();
1155
- cuid = /^[cC][^\s-]{8,}$/;
1178
+ cuid = /^[cC][0-9a-z]{6,}$/;
1156
1179
  cuid2 = /^[0-9a-z]+$/;
1157
1180
  ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
1158
1181
  xid = /^[0-9a-vA-V]{20}$/;
@@ -1188,6 +1211,7 @@ var init_regexes = __esm({
1188
1211
  base64url = /^[A-Za-z0-9_-]*$/;
1189
1212
  hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
1190
1213
  domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
1214
+ httpProtocol = /^https?$/;
1191
1215
  e164 = /^\+[1-9]\d{6,14}$/;
1192
1216
  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])))`;
1193
1217
  date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
@@ -1236,10 +1260,10 @@ var init_checks = __esm({
1236
1260
  init_regexes();
1237
1261
  init_util();
1238
1262
  $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
1239
- var _a2;
1263
+ var _a3;
1240
1264
  inst._zod ?? (inst._zod = {});
1241
1265
  inst._zod.def = def;
1242
- (_a2 = inst._zod).onattach ?? (_a2.onattach = []);
1266
+ (_a3 = inst._zod).onattach ?? (_a3.onattach = []);
1243
1267
  });
1244
1268
  numericOriginMap = {
1245
1269
  number: "number",
@@ -1305,8 +1329,8 @@ var init_checks = __esm({
1305
1329
  $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
1306
1330
  $ZodCheck.init(inst, def);
1307
1331
  inst._zod.onattach.push((inst2) => {
1308
- var _a2;
1309
- (_a2 = inst2._zod.bag).multipleOf ?? (_a2.multipleOf = def.value);
1332
+ var _a3;
1333
+ (_a3 = inst2._zod.bag).multipleOf ?? (_a3.multipleOf = def.value);
1310
1334
  });
1311
1335
  inst._zod.check = (payload) => {
1312
1336
  if (typeof payload.value !== typeof def.value)
@@ -1439,9 +1463,9 @@ var init_checks = __esm({
1439
1463
  };
1440
1464
  });
1441
1465
  $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, def) => {
1442
- var _a2;
1466
+ var _a3;
1443
1467
  $ZodCheck.init(inst, def);
1444
- (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
1468
+ (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
1445
1469
  const val = payload.value;
1446
1470
  return !nullish(val) && val.size !== void 0;
1447
1471
  });
@@ -1467,9 +1491,9 @@ var init_checks = __esm({
1467
1491
  };
1468
1492
  });
1469
1493
  $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, def) => {
1470
- var _a2;
1494
+ var _a3;
1471
1495
  $ZodCheck.init(inst, def);
1472
- (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
1496
+ (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
1473
1497
  const val = payload.value;
1474
1498
  return !nullish(val) && val.size !== void 0;
1475
1499
  });
@@ -1495,9 +1519,9 @@ var init_checks = __esm({
1495
1519
  };
1496
1520
  });
1497
1521
  $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (inst, def) => {
1498
- var _a2;
1522
+ var _a3;
1499
1523
  $ZodCheck.init(inst, def);
1500
- (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
1524
+ (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
1501
1525
  const val = payload.value;
1502
1526
  return !nullish(val) && val.size !== void 0;
1503
1527
  });
@@ -1525,9 +1549,9 @@ var init_checks = __esm({
1525
1549
  };
1526
1550
  });
1527
1551
  $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
1528
- var _a2;
1552
+ var _a3;
1529
1553
  $ZodCheck.init(inst, def);
1530
- (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
1554
+ (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
1531
1555
  const val = payload.value;
1532
1556
  return !nullish(val) && val.length !== void 0;
1533
1557
  });
@@ -1554,9 +1578,9 @@ var init_checks = __esm({
1554
1578
  };
1555
1579
  });
1556
1580
  $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
1557
- var _a2;
1581
+ var _a3;
1558
1582
  $ZodCheck.init(inst, def);
1559
- (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
1583
+ (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
1560
1584
  const val = payload.value;
1561
1585
  return !nullish(val) && val.length !== void 0;
1562
1586
  });
@@ -1583,9 +1607,9 @@ var init_checks = __esm({
1583
1607
  };
1584
1608
  });
1585
1609
  $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
1586
- var _a2;
1610
+ var _a3;
1587
1611
  $ZodCheck.init(inst, def);
1588
- (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
1612
+ (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
1589
1613
  const val = payload.value;
1590
1614
  return !nullish(val) && val.length !== void 0;
1591
1615
  });
@@ -1614,7 +1638,7 @@ var init_checks = __esm({
1614
1638
  };
1615
1639
  });
1616
1640
  $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
1617
- var _a2, _b;
1641
+ var _a3, _b;
1618
1642
  $ZodCheck.init(inst, def);
1619
1643
  inst._zod.onattach.push((inst2) => {
1620
1644
  const bag = inst2._zod.bag;
@@ -1625,7 +1649,7 @@ var init_checks = __esm({
1625
1649
  }
1626
1650
  });
1627
1651
  if (def.pattern)
1628
- (_a2 = inst._zod).check ?? (_a2.check = (payload) => {
1652
+ (_a3 = inst._zod).check ?? (_a3.check = (payload) => {
1629
1653
  def.pattern.lastIndex = 0;
1630
1654
  if (def.pattern.test(payload.value))
1631
1655
  return;
@@ -1828,8 +1852,8 @@ var init_versions = __esm({
1828
1852
  "use strict";
1829
1853
  version = {
1830
1854
  major: 4,
1831
- minor: 3,
1832
- patch: 6
1855
+ minor: 4,
1856
+ patch: 3
1833
1857
  };
1834
1858
  }
1835
1859
  });
@@ -1838,6 +1862,8 @@ var init_versions = __esm({
1838
1862
  function isValidBase64(data) {
1839
1863
  if (data === "")
1840
1864
  return true;
1865
+ if (/\s/.test(data))
1866
+ return false;
1841
1867
  if (data.length % 4 !== 0)
1842
1868
  return false;
1843
1869
  try {
@@ -1880,15 +1906,27 @@ function handleArrayResult(result, final, index) {
1880
1906
  }
1881
1907
  final.value[index] = result.value;
1882
1908
  }
1883
- function handlePropertyResult(result, final, key, input, isOptionalOut) {
1909
+ function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {
1910
+ const isPresent = key in input;
1884
1911
  if (result.issues.length) {
1885
- if (isOptionalOut && !(key in input)) {
1912
+ if (isOptionalIn && isOptionalOut && !isPresent) {
1886
1913
  return;
1887
1914
  }
1888
1915
  final.issues.push(...prefixIssues(key, result.issues));
1889
1916
  }
1917
+ if (!isPresent && !isOptionalIn) {
1918
+ if (!result.issues.length) {
1919
+ final.issues.push({
1920
+ code: "invalid_type",
1921
+ expected: "nonoptional",
1922
+ input: void 0,
1923
+ path: [key]
1924
+ });
1925
+ }
1926
+ return;
1927
+ }
1890
1928
  if (result.value === void 0) {
1891
- if (key in input) {
1929
+ if (isPresent) {
1892
1930
  final.value[key] = void 0;
1893
1931
  }
1894
1932
  } else {
@@ -1916,8 +1954,11 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
1916
1954
  const keySet = def.keySet;
1917
1955
  const _catchall = def.catchall._zod;
1918
1956
  const t = _catchall.def.type;
1957
+ const isOptionalIn = _catchall.optin === "optional";
1919
1958
  const isOptionalOut = _catchall.optout === "optional";
1920
1959
  for (const key in input) {
1960
+ if (key === "__proto__")
1961
+ continue;
1921
1962
  if (keySet.has(key))
1922
1963
  continue;
1923
1964
  if (t === "never") {
@@ -1926,9 +1967,9 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
1926
1967
  }
1927
1968
  const r = _catchall.run({ value: input[key], issues: [] }, ctx);
1928
1969
  if (r instanceof Promise) {
1929
- proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalOut)));
1970
+ proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut)));
1930
1971
  } else {
1931
- handlePropertyResult(r, payload, key, input, isOptionalOut);
1972
+ handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
1932
1973
  }
1933
1974
  }
1934
1975
  if (unrecognized.length) {
@@ -2072,12 +2113,41 @@ function handleIntersectionResults(result, left, right) {
2072
2113
  result.value = merged.data;
2073
2114
  return result;
2074
2115
  }
2116
+ function getTupleOptStart(items, key) {
2117
+ for (let i = items.length - 1; i >= 0; i--) {
2118
+ if (items[i]._zod[key] !== "optional")
2119
+ return i + 1;
2120
+ }
2121
+ return 0;
2122
+ }
2075
2123
  function handleTupleResult(result, final, index) {
2076
2124
  if (result.issues.length) {
2077
2125
  final.issues.push(...prefixIssues(index, result.issues));
2078
2126
  }
2079
2127
  final.value[index] = result.value;
2080
2128
  }
2129
+ function handleTupleResults(itemResults, final, items, input, optoutStart) {
2130
+ for (let i = 0; i < items.length; i++) {
2131
+ const r = itemResults[i];
2132
+ const isPresent = i < input.length;
2133
+ if (r.issues.length) {
2134
+ if (!isPresent && i >= optoutStart) {
2135
+ final.value.length = i;
2136
+ break;
2137
+ }
2138
+ final.issues.push(...prefixIssues(i, r.issues));
2139
+ }
2140
+ final.value[i] = r.value;
2141
+ }
2142
+ for (let i = final.value.length - 1; i >= input.length; i--) {
2143
+ if (items[i]._zod.optout === "optional" && final.value[i] === void 0) {
2144
+ final.value.length = i;
2145
+ } else {
2146
+ break;
2147
+ }
2148
+ }
2149
+ return final;
2150
+ }
2081
2151
  function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
2082
2152
  if (keyResult.issues.length) {
2083
2153
  if (propertyKeyTypes.has(typeof key)) {
@@ -2115,7 +2185,7 @@ function handleSetResult(result, final) {
2115
2185
  final.value.add(result.value);
2116
2186
  }
2117
2187
  function handleOptionalResult(result, input) {
2118
- if (result.issues.length && input === void 0) {
2188
+ if (input === void 0 && (result.issues.length || result.fallback)) {
2119
2189
  return { issues: [], value: void 0 };
2120
2190
  }
2121
2191
  return result;
@@ -2142,7 +2212,7 @@ function handlePipeResult(left, next, ctx) {
2142
2212
  left.aborted = true;
2143
2213
  return left;
2144
2214
  }
2145
- return next._zod.run({ value: left.value, issues: left.issues }, ctx);
2215
+ return next._zod.run({ value: left.value, issues: left.issues, fallback: left.fallback }, ctx);
2146
2216
  }
2147
2217
  function handleCodecAResult(result, def, ctx) {
2148
2218
  if (result.issues.length) {
@@ -2192,7 +2262,7 @@ function handleRefineResult(result, payload, input, inst) {
2192
2262
  payload.issues.push(issue(_iss));
2193
2263
  }
2194
2264
  }
2195
- var $ZodType, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, $ZodIPv6, $ZodMAC, $ZodCIDRv4, $ZodCIDRv6, $ZodBase64, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodCustomStringFormat, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodBigInt, $ZodBigIntFormat, $ZodSymbol, $ZodUndefined, $ZodNull, $ZodAny, $ZodUnknown, $ZodNever, $ZodVoid, $ZodDate, $ZodArray, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodXor, $ZodDiscriminatedUnion, $ZodIntersection, $ZodTuple, $ZodRecord, $ZodMap, $ZodSet, $ZodEnum, $ZodLiteral, $ZodFile, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodSuccess, $ZodCatch, $ZodNaN, $ZodPipe, $ZodCodec, $ZodReadonly, $ZodTemplateLiteral, $ZodFunction, $ZodPromise, $ZodLazy, $ZodCustom;
2265
+ var $ZodType, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, $ZodIPv6, $ZodMAC, $ZodCIDRv4, $ZodCIDRv6, $ZodBase64, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodCustomStringFormat, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodBigInt, $ZodBigIntFormat, $ZodSymbol, $ZodUndefined, $ZodNull, $ZodAny, $ZodUnknown, $ZodNever, $ZodVoid, $ZodDate, $ZodArray, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodXor, $ZodDiscriminatedUnion, $ZodIntersection, $ZodTuple, $ZodRecord, $ZodMap, $ZodSet, $ZodEnum, $ZodLiteral, $ZodFile, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodSuccess, $ZodCatch, $ZodNaN, $ZodPipe, $ZodCodec, $ZodPreprocess, $ZodReadonly, $ZodTemplateLiteral, $ZodFunction, $ZodPromise, $ZodLazy, $ZodCustom;
2196
2266
  var init_schemas = __esm({
2197
2267
  "../../node_modules/zod/v4/core/schemas.js"() {
2198
2268
  "use strict";
@@ -2205,7 +2275,7 @@ var init_schemas = __esm({
2205
2275
  init_versions();
2206
2276
  init_util();
2207
2277
  $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
2208
- var _a2;
2278
+ var _a3;
2209
2279
  inst ?? (inst = {});
2210
2280
  inst._zod.def = def;
2211
2281
  inst._zod.bag = inst._zod.bag || {};
@@ -2220,7 +2290,7 @@ var init_schemas = __esm({
2220
2290
  }
2221
2291
  }
2222
2292
  if (checks.length === 0) {
2223
- (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
2293
+ (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
2224
2294
  inst._zod.deferred?.push(() => {
2225
2295
  inst._zod.run = inst._zod.parse;
2226
2296
  });
@@ -2230,6 +2300,8 @@ var init_schemas = __esm({
2230
2300
  let asyncResult;
2231
2301
  for (const ch of checks2) {
2232
2302
  if (ch._zod.def.when) {
2303
+ if (explicitlyAborted(payload))
2304
+ continue;
2233
2305
  const shouldRun = ch._zod.def.when(payload);
2234
2306
  if (!shouldRun)
2235
2307
  continue;
@@ -2370,6 +2442,19 @@ var init_schemas = __esm({
2370
2442
  inst._zod.check = (payload) => {
2371
2443
  try {
2372
2444
  const trimmed = payload.value.trim();
2445
+ if (!def.normalize && def.protocol?.source === httpProtocol.source) {
2446
+ if (!/^https?:\/\//i.test(trimmed)) {
2447
+ payload.issues.push({
2448
+ code: "invalid_format",
2449
+ format: "url",
2450
+ note: "Invalid URL format",
2451
+ input: payload.value,
2452
+ inst,
2453
+ continue: !def.abort
2454
+ });
2455
+ return;
2456
+ }
2457
+ }
2373
2458
  const url2 = new URL(trimmed);
2374
2459
  if (def.hostname) {
2375
2460
  def.hostname.lastIndex = 0;
@@ -2676,8 +2761,6 @@ var init_schemas = __esm({
2676
2761
  $ZodType.init(inst, def);
2677
2762
  inst._zod.pattern = _undefined;
2678
2763
  inst._zod.values = /* @__PURE__ */ new Set([void 0]);
2679
- inst._zod.optin = "optional";
2680
- inst._zod.optout = "optional";
2681
2764
  inst._zod.parse = (payload, _ctx) => {
2682
2765
  const input = payload.value;
2683
2766
  if (typeof input === "undefined")
@@ -2849,12 +2932,13 @@ var init_schemas = __esm({
2849
2932
  const shape = value.shape;
2850
2933
  for (const key of value.keys) {
2851
2934
  const el = shape[key];
2935
+ const isOptionalIn = el._zod.optin === "optional";
2852
2936
  const isOptionalOut = el._zod.optout === "optional";
2853
2937
  const r = el._zod.run({ value: input[key], issues: [] }, ctx);
2854
2938
  if (r instanceof Promise) {
2855
- proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalOut)));
2939
+ proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut)));
2856
2940
  } else {
2857
- handlePropertyResult(r, payload, key, input, isOptionalOut);
2941
+ handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
2858
2942
  }
2859
2943
  }
2860
2944
  if (!catchall) {
@@ -2885,9 +2969,10 @@ var init_schemas = __esm({
2885
2969
  const id = ids[key];
2886
2970
  const k = esc(key);
2887
2971
  const schema = shape[key];
2972
+ const isOptionalIn = schema?._zod?.optin === "optional";
2888
2973
  const isOptionalOut = schema?._zod?.optout === "optional";
2889
2974
  doc.write(`const ${id} = ${parseStr(key)};`);
2890
- if (isOptionalOut) {
2975
+ if (isOptionalIn && isOptionalOut) {
2891
2976
  doc.write(`
2892
2977
  if (${id}.issues.length) {
2893
2978
  if (${k} in input) {
@@ -2906,6 +2991,33 @@ var init_schemas = __esm({
2906
2991
  newResult[${k}] = ${id}.value;
2907
2992
  }
2908
2993
 
2994
+ `);
2995
+ } else if (!isOptionalIn) {
2996
+ doc.write(`
2997
+ const ${id}_present = ${k} in input;
2998
+ if (${id}.issues.length) {
2999
+ payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
3000
+ ...iss,
3001
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
3002
+ })));
3003
+ }
3004
+ if (!${id}_present && !${id}.issues.length) {
3005
+ payload.issues.push({
3006
+ code: "invalid_type",
3007
+ expected: "nonoptional",
3008
+ input: undefined,
3009
+ path: [${k}]
3010
+ });
3011
+ }
3012
+
3013
+ if (${id}_present) {
3014
+ if (${id}.value === undefined) {
3015
+ newResult[${k}] = undefined;
3016
+ } else {
3017
+ newResult[${k}] = ${id}.value;
3018
+ }
3019
+ }
3020
+
2909
3021
  `);
2910
3022
  } else {
2911
3023
  doc.write(`
@@ -2979,10 +3091,9 @@ var init_schemas = __esm({
2979
3091
  }
2980
3092
  return void 0;
2981
3093
  });
2982
- const single = def.options.length === 1;
2983
- const first = def.options[0]._zod.run;
3094
+ const first = def.options.length === 1 ? def.options[0]._zod.run : null;
2984
3095
  inst._zod.parse = (payload, ctx) => {
2985
- if (single) {
3096
+ if (first) {
2986
3097
  return first(payload, ctx);
2987
3098
  }
2988
3099
  let async = false;
@@ -3011,10 +3122,9 @@ var init_schemas = __esm({
3011
3122
  $ZodXor = /* @__PURE__ */ $constructor("$ZodXor", (inst, def) => {
3012
3123
  $ZodUnion.init(inst, def);
3013
3124
  def.inclusive = false;
3014
- const single = def.options.length === 1;
3015
- const first = def.options[0]._zod.run;
3125
+ const first = def.options.length === 1 ? def.options[0]._zod.run : null;
3016
3126
  inst._zod.parse = (payload, ctx) => {
3017
- if (single) {
3127
+ if (first) {
3018
3128
  return first(payload, ctx);
3019
3129
  }
3020
3130
  let async = false;
@@ -3089,7 +3199,7 @@ var init_schemas = __esm({
3089
3199
  if (opt) {
3090
3200
  return opt._zod.run(payload, ctx);
3091
3201
  }
3092
- if (def.unionFallback) {
3202
+ if (def.unionFallback || ctx.direction === "backward") {
3093
3203
  return _super(payload, ctx);
3094
3204
  }
3095
3205
  payload.issues.push({
@@ -3097,6 +3207,7 @@ var init_schemas = __esm({
3097
3207
  errors: [],
3098
3208
  note: "No matching discriminator",
3099
3209
  discriminator: def.discriminator,
3210
+ options: Array.from(disc.value.keys()),
3100
3211
  input,
3101
3212
  path: [def.discriminator],
3102
3213
  inst
@@ -3135,56 +3246,59 @@ var init_schemas = __esm({
3135
3246
  }
3136
3247
  payload.value = [];
3137
3248
  const proms = [];
3138
- const reversedIndex = [...items].reverse().findIndex((item) => item._zod.optin !== "optional");
3139
- const optStart = reversedIndex === -1 ? 0 : items.length - reversedIndex;
3249
+ const optinStart = getTupleOptStart(items, "optin");
3250
+ const optoutStart = getTupleOptStart(items, "optout");
3140
3251
  if (!def.rest) {
3141
- const tooBig = input.length > items.length;
3142
- const tooSmall = input.length < optStart - 1;
3143
- if (tooBig || tooSmall) {
3252
+ if (input.length < optinStart) {
3144
3253
  payload.issues.push({
3145
- ...tooBig ? { code: "too_big", maximum: items.length, inclusive: true } : { code: "too_small", minimum: items.length },
3254
+ code: "too_small",
3255
+ minimum: optinStart,
3256
+ inclusive: true,
3146
3257
  input,
3147
3258
  inst,
3148
3259
  origin: "array"
3149
3260
  });
3150
3261
  return payload;
3151
3262
  }
3152
- }
3153
- let i = -1;
3154
- for (const item of items) {
3155
- i++;
3156
- if (i >= input.length) {
3157
- if (i >= optStart)
3158
- continue;
3263
+ if (input.length > items.length) {
3264
+ payload.issues.push({
3265
+ code: "too_big",
3266
+ maximum: items.length,
3267
+ inclusive: true,
3268
+ input,
3269
+ inst,
3270
+ origin: "array"
3271
+ });
3159
3272
  }
3160
- const result = item._zod.run({
3161
- value: input[i],
3162
- issues: []
3163
- }, ctx);
3164
- if (result instanceof Promise) {
3165
- proms.push(result.then((result2) => handleTupleResult(result2, payload, i)));
3273
+ }
3274
+ const itemResults = new Array(items.length);
3275
+ for (let i = 0; i < items.length; i++) {
3276
+ const r = items[i]._zod.run({ value: input[i], issues: [] }, ctx);
3277
+ if (r instanceof Promise) {
3278
+ proms.push(r.then((rr) => {
3279
+ itemResults[i] = rr;
3280
+ }));
3166
3281
  } else {
3167
- handleTupleResult(result, payload, i);
3282
+ itemResults[i] = r;
3168
3283
  }
3169
3284
  }
3170
3285
  if (def.rest) {
3286
+ let i = items.length - 1;
3171
3287
  const rest = input.slice(items.length);
3172
3288
  for (const el of rest) {
3173
3289
  i++;
3174
- const result = def.rest._zod.run({
3175
- value: el,
3176
- issues: []
3177
- }, ctx);
3290
+ const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
3178
3291
  if (result instanceof Promise) {
3179
- proms.push(result.then((result2) => handleTupleResult(result2, payload, i)));
3292
+ proms.push(result.then((r) => handleTupleResult(r, payload, i)));
3180
3293
  } else {
3181
3294
  handleTupleResult(result, payload, i);
3182
3295
  }
3183
3296
  }
3184
3297
  }
3185
- if (proms.length)
3186
- return Promise.all(proms).then(() => payload);
3187
- return payload;
3298
+ if (proms.length) {
3299
+ return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input, optoutStart));
3300
+ }
3301
+ return handleTupleResults(itemResults, payload, items, input, optoutStart);
3188
3302
  };
3189
3303
  });
3190
3304
  $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
@@ -3208,19 +3322,35 @@ var init_schemas = __esm({
3208
3322
  for (const key of values) {
3209
3323
  if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
3210
3324
  recordKeys.add(typeof key === "number" ? key.toString() : key);
3325
+ const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
3326
+ if (keyResult instanceof Promise) {
3327
+ throw new Error("Async schemas not supported in object keys currently");
3328
+ }
3329
+ if (keyResult.issues.length) {
3330
+ payload.issues.push({
3331
+ code: "invalid_key",
3332
+ origin: "record",
3333
+ issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
3334
+ input: key,
3335
+ path: [key],
3336
+ inst
3337
+ });
3338
+ continue;
3339
+ }
3340
+ const outKey = keyResult.value;
3211
3341
  const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
3212
3342
  if (result instanceof Promise) {
3213
3343
  proms.push(result.then((result2) => {
3214
3344
  if (result2.issues.length) {
3215
3345
  payload.issues.push(...prefixIssues(key, result2.issues));
3216
3346
  }
3217
- payload.value[key] = result2.value;
3347
+ payload.value[outKey] = result2.value;
3218
3348
  }));
3219
3349
  } else {
3220
3350
  if (result.issues.length) {
3221
3351
  payload.issues.push(...prefixIssues(key, result.issues));
3222
3352
  }
3223
- payload.value[key] = result.value;
3353
+ payload.value[outKey] = result.value;
3224
3354
  }
3225
3355
  }
3226
3356
  }
@@ -3244,6 +3374,8 @@ var init_schemas = __esm({
3244
3374
  for (const key of Reflect.ownKeys(input)) {
3245
3375
  if (key === "__proto__")
3246
3376
  continue;
3377
+ if (!Object.prototype.propertyIsEnumerable.call(input, key))
3378
+ continue;
3247
3379
  let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
3248
3380
  if (keyResult instanceof Promise) {
3249
3381
  throw new Error("Async schemas not supported in object keys currently");
@@ -3412,6 +3544,7 @@ var init_schemas = __esm({
3412
3544
  });
3413
3545
  $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
3414
3546
  $ZodType.init(inst, def);
3547
+ inst._zod.optin = "optional";
3415
3548
  inst._zod.parse = (payload, ctx) => {
3416
3549
  if (ctx.direction === "backward") {
3417
3550
  throw new $ZodEncodeError(inst.constructor.name);
@@ -3421,6 +3554,7 @@ var init_schemas = __esm({
3421
3554
  const output = _out instanceof Promise ? _out : Promise.resolve(_out);
3422
3555
  return output.then((output2) => {
3423
3556
  payload.value = output2;
3557
+ payload.fallback = true;
3424
3558
  return payload;
3425
3559
  });
3426
3560
  }
@@ -3428,6 +3562,7 @@ var init_schemas = __esm({
3428
3562
  throw new $ZodAsyncError();
3429
3563
  }
3430
3564
  payload.value = _out;
3565
+ payload.fallback = true;
3431
3566
  return payload;
3432
3567
  };
3433
3568
  });
@@ -3444,10 +3579,11 @@ var init_schemas = __esm({
3444
3579
  });
3445
3580
  inst._zod.parse = (payload, ctx) => {
3446
3581
  if (def.innerType._zod.optin === "optional") {
3582
+ const input = payload.value;
3447
3583
  const result = def.innerType._zod.run(payload, ctx);
3448
3584
  if (result instanceof Promise)
3449
- return result.then((r) => handleOptionalResult(r, payload.value));
3450
- return handleOptionalResult(result, payload.value);
3585
+ return result.then((r) => handleOptionalResult(r, input));
3586
+ return handleOptionalResult(result, input);
3451
3587
  }
3452
3588
  if (payload.value === void 0) {
3453
3589
  return payload;
@@ -3546,7 +3682,7 @@ var init_schemas = __esm({
3546
3682
  });
3547
3683
  $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
3548
3684
  $ZodType.init(inst, def);
3549
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
3685
+ inst._zod.optin = "optional";
3550
3686
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
3551
3687
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
3552
3688
  inst._zod.parse = (payload, ctx) => {
@@ -3566,6 +3702,7 @@ var init_schemas = __esm({
3566
3702
  input: payload.value
3567
3703
  });
3568
3704
  payload.issues = [];
3705
+ payload.fallback = true;
3569
3706
  }
3570
3707
  return payload;
3571
3708
  });
@@ -3580,6 +3717,7 @@ var init_schemas = __esm({
3580
3717
  input: payload.value
3581
3718
  });
3582
3719
  payload.issues = [];
3720
+ payload.fallback = true;
3583
3721
  }
3584
3722
  return payload;
3585
3723
  };
@@ -3643,6 +3781,9 @@ var init_schemas = __esm({
3643
3781
  }
3644
3782
  };
3645
3783
  });
3784
+ $ZodPreprocess = /* @__PURE__ */ $constructor("$ZodPreprocess", (inst, def) => {
3785
+ $ZodPipe.init(inst, def);
3786
+ });
3646
3787
  $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
3647
3788
  $ZodType.init(inst, def);
3648
3789
  defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
@@ -3790,7 +3931,12 @@ var init_schemas = __esm({
3790
3931
  });
3791
3932
  $ZodLazy = /* @__PURE__ */ $constructor("$ZodLazy", (inst, def) => {
3792
3933
  $ZodType.init(inst, def);
3793
- defineLazy(inst._zod, "innerType", () => def.getter());
3934
+ defineLazy(inst._zod, "innerType", () => {
3935
+ const d = def;
3936
+ if (!d._cachedInner)
3937
+ d._cachedInner = def.getter();
3938
+ return d._cachedInner;
3939
+ });
3794
3940
  defineLazy(inst._zod, "pattern", () => inst._zod.innerType?._zod?.pattern);
3795
3941
  defineLazy(inst._zod, "propValues", () => inst._zod.innerType?._zod?.propValues);
3796
3942
  defineLazy(inst._zod, "optin", () => inst._zod.innerType?._zod?.optin ?? void 0);
@@ -4812,18 +4958,135 @@ var init_de = __esm({
4812
4958
  }
4813
4959
  });
4814
4960
 
4815
- // ../../node_modules/zod/v4/locales/en.js
4816
- function en_default() {
4961
+ // ../../node_modules/zod/v4/locales/el.js
4962
+ function el_default() {
4817
4963
  return {
4818
4964
  localeError: error9()
4819
4965
  };
4820
4966
  }
4821
4967
  var error9;
4968
+ var init_el = __esm({
4969
+ "../../node_modules/zod/v4/locales/el.js"() {
4970
+ "use strict";
4971
+ init_util();
4972
+ error9 = () => {
4973
+ const Sizable = {
4974
+ string: { unit: "\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" },
4975
+ file: { unit: "bytes", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" },
4976
+ array: { unit: "\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" },
4977
+ set: { unit: "\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" },
4978
+ map: { unit: "\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" }
4979
+ };
4980
+ function getSizing(origin) {
4981
+ return Sizable[origin] ?? null;
4982
+ }
4983
+ const FormatDictionary = {
4984
+ regex: "\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",
4985
+ email: "\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",
4986
+ url: "URL",
4987
+ emoji: "emoji",
4988
+ uuid: "UUID",
4989
+ uuidv4: "UUIDv4",
4990
+ uuidv6: "UUIDv6",
4991
+ nanoid: "nanoid",
4992
+ guid: "GUID",
4993
+ cuid: "cuid",
4994
+ cuid2: "cuid2",
4995
+ ulid: "ULID",
4996
+ xid: "XID",
4997
+ ksuid: "KSUID",
4998
+ datetime: "ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",
4999
+ date: "ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",
5000
+ time: "ISO \u03CE\u03C1\u03B1",
5001
+ duration: "ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",
5002
+ ipv4: "\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",
5003
+ ipv6: "\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",
5004
+ mac: "\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",
5005
+ cidrv4: "\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",
5006
+ cidrv6: "\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",
5007
+ base64: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",
5008
+ base64url: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",
5009
+ json_string: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",
5010
+ e164: "\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",
5011
+ jwt: "JWT",
5012
+ template_literal: "\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"
5013
+ };
5014
+ const TypeDictionary = {
5015
+ nan: "NaN"
5016
+ };
5017
+ return (issue2) => {
5018
+ switch (issue2.code) {
5019
+ case "invalid_type": {
5020
+ const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
5021
+ const receivedType = parsedType(issue2.input);
5022
+ const received = TypeDictionary[receivedType] ?? receivedType;
5023
+ if (typeof issue2.expected === "string" && /^[A-Z]/.test(issue2.expected)) {
5024
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${issue2.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${received}`;
5025
+ }
5026
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${received}`;
5027
+ }
5028
+ case "invalid_value":
5029
+ if (issue2.values.length === 1)
5030
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${stringifyPrimitive(issue2.values[0])}`;
5031
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${joinValues(issue2.values, "|")}`;
5032
+ case "too_big": {
5033
+ const adj = issue2.inclusive ? "<=" : "<";
5034
+ const sizing = getSizing(issue2.origin);
5035
+ if (sizing)
5036
+ return `\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${issue2.origin ?? "\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`;
5037
+ return `\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${issue2.origin ?? "\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${adj}${issue2.maximum.toString()}`;
5038
+ }
5039
+ case "too_small": {
5040
+ const adj = issue2.inclusive ? ">=" : ">";
5041
+ const sizing = getSizing(issue2.origin);
5042
+ if (sizing) {
5043
+ return `\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${issue2.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
5044
+ }
5045
+ return `\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${issue2.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${adj}${issue2.minimum.toString()}`;
5046
+ }
5047
+ case "invalid_format": {
5048
+ const _issue = issue2;
5049
+ if (_issue.format === "starts_with") {
5050
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${_issue.prefix}"`;
5051
+ }
5052
+ if (_issue.format === "ends_with")
5053
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${_issue.suffix}"`;
5054
+ if (_issue.format === "includes")
5055
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${_issue.includes}"`;
5056
+ if (_issue.format === "regex")
5057
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${_issue.pattern}`;
5058
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${FormatDictionary[_issue.format] ?? issue2.format}`;
5059
+ }
5060
+ case "not_multiple_of":
5061
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${issue2.divisor}`;
5062
+ case "unrecognized_keys":
5063
+ return `\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${issue2.keys.length > 1 ? "\u03B1" : "\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${issue2.keys.length > 1 ? "\u03B9\u03AC" : "\u03AF"}: ${joinValues(issue2.keys, ", ")}`;
5064
+ case "invalid_key":
5065
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${issue2.origin}`;
5066
+ case "invalid_union":
5067
+ return "\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";
5068
+ case "invalid_element":
5069
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${issue2.origin}`;
5070
+ default:
5071
+ return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2`;
5072
+ }
5073
+ };
5074
+ };
5075
+ }
5076
+ });
5077
+
5078
+ // ../../node_modules/zod/v4/locales/en.js
5079
+ function en_default() {
5080
+ return {
5081
+ localeError: error10()
5082
+ };
5083
+ }
5084
+ var error10;
4822
5085
  var init_en = __esm({
4823
5086
  "../../node_modules/zod/v4/locales/en.js"() {
4824
5087
  "use strict";
4825
5088
  init_util();
4826
- error9 = () => {
5089
+ error10 = () => {
4827
5090
  const Sizable = {
4828
5091
  string: { unit: "characters", verb: "to have" },
4829
5092
  file: { unit: "bytes", verb: "to have" },
@@ -4917,6 +5180,10 @@ var init_en = __esm({
4917
5180
  case "invalid_key":
4918
5181
  return `Invalid key in ${issue2.origin}`;
4919
5182
  case "invalid_union":
5183
+ if (issue2.options && Array.isArray(issue2.options) && issue2.options.length > 0) {
5184
+ const opts = issue2.options.map((o) => `'${o}'`).join(" | ");
5185
+ return `Invalid discriminator value. Expected ${opts}`;
5186
+ }
4920
5187
  return "Invalid input";
4921
5188
  case "invalid_element":
4922
5189
  return `Invalid value in ${issue2.origin}`;
@@ -4931,15 +5198,15 @@ var init_en = __esm({
4931
5198
  // ../../node_modules/zod/v4/locales/eo.js
4932
5199
  function eo_default() {
4933
5200
  return {
4934
- localeError: error10()
5201
+ localeError: error11()
4935
5202
  };
4936
5203
  }
4937
- var error10;
5204
+ var error11;
4938
5205
  var init_eo = __esm({
4939
5206
  "../../node_modules/zod/v4/locales/eo.js"() {
4940
5207
  "use strict";
4941
5208
  init_util();
4942
- error10 = () => {
5209
+ error11 = () => {
4943
5210
  const Sizable = {
4944
5211
  string: { unit: "karaktrojn", verb: "havi" },
4945
5212
  file: { unit: "bajtojn", verb: "havi" },
@@ -5048,15 +5315,15 @@ var init_eo = __esm({
5048
5315
  // ../../node_modules/zod/v4/locales/es.js
5049
5316
  function es_default() {
5050
5317
  return {
5051
- localeError: error11()
5318
+ localeError: error12()
5052
5319
  };
5053
5320
  }
5054
- var error11;
5321
+ var error12;
5055
5322
  var init_es = __esm({
5056
5323
  "../../node_modules/zod/v4/locales/es.js"() {
5057
5324
  "use strict";
5058
5325
  init_util();
5059
- error11 = () => {
5326
+ error12 = () => {
5060
5327
  const Sizable = {
5061
5328
  string: { unit: "caracteres", verb: "tener" },
5062
5329
  file: { unit: "bytes", verb: "tener" },
@@ -5188,15 +5455,15 @@ var init_es = __esm({
5188
5455
  // ../../node_modules/zod/v4/locales/fa.js
5189
5456
  function fa_default() {
5190
5457
  return {
5191
- localeError: error12()
5458
+ localeError: error13()
5192
5459
  };
5193
5460
  }
5194
- var error12;
5461
+ var error13;
5195
5462
  var init_fa = __esm({
5196
5463
  "../../node_modules/zod/v4/locales/fa.js"() {
5197
5464
  "use strict";
5198
5465
  init_util();
5199
- error12 = () => {
5466
+ error13 = () => {
5200
5467
  const Sizable = {
5201
5468
  string: { unit: "\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" },
5202
5469
  file: { unit: "\u0628\u0627\u06CC\u062A", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" },
@@ -5310,15 +5577,15 @@ var init_fa = __esm({
5310
5577
  // ../../node_modules/zod/v4/locales/fi.js
5311
5578
  function fi_default() {
5312
5579
  return {
5313
- localeError: error13()
5580
+ localeError: error14()
5314
5581
  };
5315
5582
  }
5316
- var error13;
5583
+ var error14;
5317
5584
  var init_fi = __esm({
5318
5585
  "../../node_modules/zod/v4/locales/fi.js"() {
5319
5586
  "use strict";
5320
5587
  init_util();
5321
- error13 = () => {
5588
+ error14 = () => {
5322
5589
  const Sizable = {
5323
5590
  string: { unit: "merkki\xE4", subject: "merkkijonon" },
5324
5591
  file: { unit: "tavua", subject: "tiedoston" },
@@ -5430,15 +5697,15 @@ var init_fi = __esm({
5430
5697
  // ../../node_modules/zod/v4/locales/fr.js
5431
5698
  function fr_default() {
5432
5699
  return {
5433
- localeError: error14()
5700
+ localeError: error15()
5434
5701
  };
5435
5702
  }
5436
- var error14;
5703
+ var error15;
5437
5704
  var init_fr = __esm({
5438
5705
  "../../node_modules/zod/v4/locales/fr.js"() {
5439
5706
  "use strict";
5440
5707
  init_util();
5441
- error14 = () => {
5708
+ error15 = () => {
5442
5709
  const Sizable = {
5443
5710
  string: { unit: "caract\xE8res", verb: "avoir" },
5444
5711
  file: { unit: "octets", verb: "avoir" },
@@ -5479,9 +5746,27 @@ var init_fr = __esm({
5479
5746
  template_literal: "entr\xE9e"
5480
5747
  };
5481
5748
  const TypeDictionary = {
5482
- nan: "NaN",
5749
+ string: "cha\xEEne",
5483
5750
  number: "nombre",
5484
- array: "tableau"
5751
+ int: "entier",
5752
+ boolean: "bool\xE9en",
5753
+ bigint: "grand entier",
5754
+ symbol: "symbole",
5755
+ undefined: "ind\xE9fini",
5756
+ null: "null",
5757
+ never: "jamais",
5758
+ void: "vide",
5759
+ date: "date",
5760
+ array: "tableau",
5761
+ object: "objet",
5762
+ tuple: "tuple",
5763
+ record: "enregistrement",
5764
+ map: "carte",
5765
+ set: "ensemble",
5766
+ file: "fichier",
5767
+ nonoptional: "non-optionnel",
5768
+ nan: "NaN",
5769
+ function: "fonction"
5485
5770
  };
5486
5771
  return (issue2) => {
5487
5772
  switch (issue2.code) {
@@ -5502,16 +5787,15 @@ var init_fr = __esm({
5502
5787
  const adj = issue2.inclusive ? "<=" : "<";
5503
5788
  const sizing = getSizing(issue2.origin);
5504
5789
  if (sizing)
5505
- return `Trop grand : ${issue2.origin ?? "valeur"} doit ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\xE9l\xE9ment(s)"}`;
5506
- return `Trop grand : ${issue2.origin ?? "valeur"} doit \xEAtre ${adj}${issue2.maximum.toString()}`;
5790
+ return `Trop grand : ${TypeDictionary[issue2.origin] ?? "valeur"} doit ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\xE9l\xE9ment(s)"}`;
5791
+ return `Trop grand : ${TypeDictionary[issue2.origin] ?? "valeur"} doit \xEAtre ${adj}${issue2.maximum.toString()}`;
5507
5792
  }
5508
5793
  case "too_small": {
5509
5794
  const adj = issue2.inclusive ? ">=" : ">";
5510
5795
  const sizing = getSizing(issue2.origin);
5511
- if (sizing) {
5512
- return `Trop petit : ${issue2.origin} doit ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
5513
- }
5514
- return `Trop petit : ${issue2.origin} doit \xEAtre ${adj}${issue2.minimum.toString()}`;
5796
+ if (sizing)
5797
+ return `Trop petit : ${TypeDictionary[issue2.origin] ?? "valeur"} doit ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
5798
+ return `Trop petit : ${TypeDictionary[issue2.origin] ?? "valeur"} doit \xEAtre ${adj}${issue2.minimum.toString()}`;
5515
5799
  }
5516
5800
  case "invalid_format": {
5517
5801
  const _issue = issue2;
@@ -5546,15 +5830,15 @@ var init_fr = __esm({
5546
5830
  // ../../node_modules/zod/v4/locales/fr-CA.js
5547
5831
  function fr_CA_default() {
5548
5832
  return {
5549
- localeError: error15()
5833
+ localeError: error16()
5550
5834
  };
5551
5835
  }
5552
- var error15;
5836
+ var error16;
5553
5837
  var init_fr_CA = __esm({
5554
5838
  "../../node_modules/zod/v4/locales/fr-CA.js"() {
5555
5839
  "use strict";
5556
5840
  init_util();
5557
- error15 = () => {
5841
+ error16 = () => {
5558
5842
  const Sizable = {
5559
5843
  string: { unit: "caract\xE8res", verb: "avoir" },
5560
5844
  file: { unit: "octets", verb: "avoir" },
@@ -5661,15 +5945,15 @@ var init_fr_CA = __esm({
5661
5945
  // ../../node_modules/zod/v4/locales/he.js
5662
5946
  function he_default() {
5663
5947
  return {
5664
- localeError: error16()
5948
+ localeError: error17()
5665
5949
  };
5666
5950
  }
5667
- var error16;
5951
+ var error17;
5668
5952
  var init_he = __esm({
5669
5953
  "../../node_modules/zod/v4/locales/he.js"() {
5670
5954
  "use strict";
5671
5955
  init_util();
5672
- error16 = () => {
5956
+ error17 = () => {
5673
5957
  const TypeNames = {
5674
5958
  string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA", gender: "f" },
5675
5959
  number: { label: "\u05DE\u05E1\u05E4\u05E8", gender: "m" },
@@ -5860,23 +6144,153 @@ var init_he = __esm({
5860
6144
  }
5861
6145
  });
5862
6146
 
5863
- // ../../node_modules/zod/v4/locales/hu.js
5864
- function hu_default() {
6147
+ // ../../node_modules/zod/v4/locales/hr.js
6148
+ function hr_default() {
5865
6149
  return {
5866
- localeError: error17()
6150
+ localeError: error18()
5867
6151
  };
5868
6152
  }
5869
- var error17;
5870
- var init_hu = __esm({
5871
- "../../node_modules/zod/v4/locales/hu.js"() {
6153
+ var error18;
6154
+ var init_hr = __esm({
6155
+ "../../node_modules/zod/v4/locales/hr.js"() {
5872
6156
  "use strict";
5873
6157
  init_util();
5874
- error17 = () => {
6158
+ error18 = () => {
5875
6159
  const Sizable = {
5876
- string: { unit: "karakter", verb: "legyen" },
5877
- file: { unit: "byte", verb: "legyen" },
5878
- array: { unit: "elem", verb: "legyen" },
5879
- set: { unit: "elem", verb: "legyen" }
6160
+ string: { unit: "znakova", verb: "imati" },
6161
+ file: { unit: "bajtova", verb: "imati" },
6162
+ array: { unit: "stavki", verb: "imati" },
6163
+ set: { unit: "stavki", verb: "imati" }
6164
+ };
6165
+ function getSizing(origin) {
6166
+ return Sizable[origin] ?? null;
6167
+ }
6168
+ const FormatDictionary = {
6169
+ regex: "unos",
6170
+ email: "email adresa",
6171
+ url: "URL",
6172
+ emoji: "emoji",
6173
+ uuid: "UUID",
6174
+ uuidv4: "UUIDv4",
6175
+ uuidv6: "UUIDv6",
6176
+ nanoid: "nanoid",
6177
+ guid: "GUID",
6178
+ cuid: "cuid",
6179
+ cuid2: "cuid2",
6180
+ ulid: "ULID",
6181
+ xid: "XID",
6182
+ ksuid: "KSUID",
6183
+ datetime: "ISO datum i vrijeme",
6184
+ date: "ISO datum",
6185
+ time: "ISO vrijeme",
6186
+ duration: "ISO trajanje",
6187
+ ipv4: "IPv4 adresa",
6188
+ ipv6: "IPv6 adresa",
6189
+ cidrv4: "IPv4 raspon",
6190
+ cidrv6: "IPv6 raspon",
6191
+ base64: "base64 kodirani tekst",
6192
+ base64url: "base64url kodirani tekst",
6193
+ json_string: "JSON tekst",
6194
+ e164: "E.164 broj",
6195
+ jwt: "JWT",
6196
+ template_literal: "unos"
6197
+ };
6198
+ const TypeDictionary = {
6199
+ nan: "NaN",
6200
+ string: "tekst",
6201
+ number: "broj",
6202
+ boolean: "boolean",
6203
+ array: "niz",
6204
+ object: "objekt",
6205
+ set: "skup",
6206
+ file: "datoteka",
6207
+ date: "datum",
6208
+ bigint: "bigint",
6209
+ symbol: "simbol",
6210
+ undefined: "undefined",
6211
+ null: "null",
6212
+ function: "funkcija",
6213
+ map: "mapa"
6214
+ };
6215
+ return (issue2) => {
6216
+ switch (issue2.code) {
6217
+ case "invalid_type": {
6218
+ const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
6219
+ const receivedType = parsedType(issue2.input);
6220
+ const received = TypeDictionary[receivedType] ?? receivedType;
6221
+ if (/^[A-Z]/.test(issue2.expected)) {
6222
+ return `Neispravan unos: o\u010Dekuje se instanceof ${issue2.expected}, a primljeno je ${received}`;
6223
+ }
6224
+ return `Neispravan unos: o\u010Dekuje se ${expected}, a primljeno je ${received}`;
6225
+ }
6226
+ case "invalid_value":
6227
+ if (issue2.values.length === 1)
6228
+ return `Neispravna vrijednost: o\u010Dekivano ${stringifyPrimitive(issue2.values[0])}`;
6229
+ return `Neispravna opcija: o\u010Dekivano jedno od ${joinValues(issue2.values, "|")}`;
6230
+ case "too_big": {
6231
+ const adj = issue2.inclusive ? "<=" : "<";
6232
+ const sizing = getSizing(issue2.origin);
6233
+ const origin = TypeDictionary[issue2.origin] ?? issue2.origin;
6234
+ if (sizing)
6235
+ return `Preveliko: o\u010Dekivano da ${origin ?? "vrijednost"} ima ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elemenata"}`;
6236
+ return `Preveliko: o\u010Dekivano da ${origin ?? "vrijednost"} bude ${adj}${issue2.maximum.toString()}`;
6237
+ }
6238
+ case "too_small": {
6239
+ const adj = issue2.inclusive ? ">=" : ">";
6240
+ const sizing = getSizing(issue2.origin);
6241
+ const origin = TypeDictionary[issue2.origin] ?? issue2.origin;
6242
+ if (sizing) {
6243
+ return `Premalo: o\u010Dekivano da ${origin} ima ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
6244
+ }
6245
+ return `Premalo: o\u010Dekivano da ${origin} bude ${adj}${issue2.minimum.toString()}`;
6246
+ }
6247
+ case "invalid_format": {
6248
+ const _issue = issue2;
6249
+ if (_issue.format === "starts_with")
6250
+ return `Neispravan tekst: mora zapo\u010Dinjati s "${_issue.prefix}"`;
6251
+ if (_issue.format === "ends_with")
6252
+ return `Neispravan tekst: mora zavr\u0161avati s "${_issue.suffix}"`;
6253
+ if (_issue.format === "includes")
6254
+ return `Neispravan tekst: mora sadr\u017Eavati "${_issue.includes}"`;
6255
+ if (_issue.format === "regex")
6256
+ return `Neispravan tekst: mora odgovarati uzorku ${_issue.pattern}`;
6257
+ return `Neispravna ${FormatDictionary[_issue.format] ?? issue2.format}`;
6258
+ }
6259
+ case "not_multiple_of":
6260
+ return `Neispravan broj: mora biti vi\u0161ekratnik od ${issue2.divisor}`;
6261
+ case "unrecognized_keys":
6262
+ return `Neprepoznat${issue2.keys.length > 1 ? "i klju\u010Devi" : " klju\u010D"}: ${joinValues(issue2.keys, ", ")}`;
6263
+ case "invalid_key":
6264
+ return `Neispravan klju\u010D u ${TypeDictionary[issue2.origin] ?? issue2.origin}`;
6265
+ case "invalid_union":
6266
+ return "Neispravan unos";
6267
+ case "invalid_element":
6268
+ return `Neispravna vrijednost u ${TypeDictionary[issue2.origin] ?? issue2.origin}`;
6269
+ default:
6270
+ return `Neispravan unos`;
6271
+ }
6272
+ };
6273
+ };
6274
+ }
6275
+ });
6276
+
6277
+ // ../../node_modules/zod/v4/locales/hu.js
6278
+ function hu_default() {
6279
+ return {
6280
+ localeError: error19()
6281
+ };
6282
+ }
6283
+ var error19;
6284
+ var init_hu = __esm({
6285
+ "../../node_modules/zod/v4/locales/hu.js"() {
6286
+ "use strict";
6287
+ init_util();
6288
+ error19 = () => {
6289
+ const Sizable = {
6290
+ string: { unit: "karakter", verb: "legyen" },
6291
+ file: { unit: "byte", verb: "legyen" },
6292
+ array: { unit: "elem", verb: "legyen" },
6293
+ set: { unit: "elem", verb: "legyen" }
5880
6294
  };
5881
6295
  function getSizing(origin) {
5882
6296
  return Sizable[origin] ?? null;
@@ -5989,15 +6403,15 @@ function withDefiniteArticle(word) {
5989
6403
  }
5990
6404
  function hy_default() {
5991
6405
  return {
5992
- localeError: error18()
6406
+ localeError: error20()
5993
6407
  };
5994
6408
  }
5995
- var error18;
6409
+ var error20;
5996
6410
  var init_hy = __esm({
5997
6411
  "../../node_modules/zod/v4/locales/hy.js"() {
5998
6412
  "use strict";
5999
6413
  init_util();
6000
- error18 = () => {
6414
+ error20 = () => {
6001
6415
  const Sizable = {
6002
6416
  string: {
6003
6417
  unit: {
@@ -6134,15 +6548,15 @@ var init_hy = __esm({
6134
6548
  // ../../node_modules/zod/v4/locales/id.js
6135
6549
  function id_default() {
6136
6550
  return {
6137
- localeError: error19()
6551
+ localeError: error21()
6138
6552
  };
6139
6553
  }
6140
- var error19;
6554
+ var error21;
6141
6555
  var init_id = __esm({
6142
6556
  "../../node_modules/zod/v4/locales/id.js"() {
6143
6557
  "use strict";
6144
6558
  init_util();
6145
- error19 = () => {
6559
+ error21 = () => {
6146
6560
  const Sizable = {
6147
6561
  string: { unit: "karakter", verb: "memiliki" },
6148
6562
  file: { unit: "byte", verb: "memiliki" },
@@ -6248,15 +6662,15 @@ var init_id = __esm({
6248
6662
  // ../../node_modules/zod/v4/locales/is.js
6249
6663
  function is_default() {
6250
6664
  return {
6251
- localeError: error20()
6665
+ localeError: error22()
6252
6666
  };
6253
6667
  }
6254
- var error20;
6668
+ var error22;
6255
6669
  var init_is = __esm({
6256
6670
  "../../node_modules/zod/v4/locales/is.js"() {
6257
6671
  "use strict";
6258
6672
  init_util();
6259
- error20 = () => {
6673
+ error22 = () => {
6260
6674
  const Sizable = {
6261
6675
  string: { unit: "stafi", verb: "a\xF0 hafa" },
6262
6676
  file: { unit: "b\xE6ti", verb: "a\xF0 hafa" },
@@ -6365,15 +6779,15 @@ var init_is = __esm({
6365
6779
  // ../../node_modules/zod/v4/locales/it.js
6366
6780
  function it_default() {
6367
6781
  return {
6368
- localeError: error21()
6782
+ localeError: error23()
6369
6783
  };
6370
6784
  }
6371
- var error21;
6785
+ var error23;
6372
6786
  var init_it = __esm({
6373
6787
  "../../node_modules/zod/v4/locales/it.js"() {
6374
6788
  "use strict";
6375
6789
  init_util();
6376
- error21 = () => {
6790
+ error23 = () => {
6377
6791
  const Sizable = {
6378
6792
  string: { unit: "caratteri", verb: "avere" },
6379
6793
  file: { unit: "byte", verb: "avere" },
@@ -6458,7 +6872,7 @@ var init_it = __esm({
6458
6872
  return `Stringa non valida: deve includere "${_issue.includes}"`;
6459
6873
  if (_issue.format === "regex")
6460
6874
  return `Stringa non valida: deve corrispondere al pattern ${_issue.pattern}`;
6461
- return `Invalid ${FormatDictionary[_issue.format] ?? issue2.format}`;
6875
+ return `Input non valido: ${FormatDictionary[_issue.format] ?? issue2.format}`;
6462
6876
  }
6463
6877
  case "not_multiple_of":
6464
6878
  return `Numero non valido: deve essere un multiplo di ${issue2.divisor}`;
@@ -6481,15 +6895,15 @@ var init_it = __esm({
6481
6895
  // ../../node_modules/zod/v4/locales/ja.js
6482
6896
  function ja_default() {
6483
6897
  return {
6484
- localeError: error22()
6898
+ localeError: error24()
6485
6899
  };
6486
6900
  }
6487
- var error22;
6901
+ var error24;
6488
6902
  var init_ja = __esm({
6489
6903
  "../../node_modules/zod/v4/locales/ja.js"() {
6490
6904
  "use strict";
6491
6905
  init_util();
6492
- error22 = () => {
6906
+ error24 = () => {
6493
6907
  const Sizable = {
6494
6908
  string: { unit: "\u6587\u5B57", verb: "\u3067\u3042\u308B" },
6495
6909
  file: { unit: "\u30D0\u30A4\u30C8", verb: "\u3067\u3042\u308B" },
@@ -6596,15 +7010,15 @@ var init_ja = __esm({
6596
7010
  // ../../node_modules/zod/v4/locales/ka.js
6597
7011
  function ka_default() {
6598
7012
  return {
6599
- localeError: error23()
7013
+ localeError: error25()
6600
7014
  };
6601
7015
  }
6602
- var error23;
7016
+ var error25;
6603
7017
  var init_ka = __esm({
6604
7018
  "../../node_modules/zod/v4/locales/ka.js"() {
6605
7019
  "use strict";
6606
7020
  init_util();
6607
- error23 = () => {
7021
+ error25 = () => {
6608
7022
  const Sizable = {
6609
7023
  string: { unit: "\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" },
6610
7024
  file: { unit: "\u10D1\u10D0\u10D8\u10E2\u10D8", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" },
@@ -6637,9 +7051,9 @@ var init_ka = __esm({
6637
7051
  ipv6: "IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",
6638
7052
  cidrv4: "IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",
6639
7053
  cidrv6: "IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",
6640
- base64: "base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",
6641
- base64url: "base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",
6642
- json_string: "JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",
7054
+ base64: "base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",
7055
+ base64url: "base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",
7056
+ json_string: "JSON \u10D5\u10D4\u10DA\u10D8",
6643
7057
  e164: "E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
6644
7058
  jwt: "JWT",
6645
7059
  template_literal: "\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"
@@ -6647,7 +7061,7 @@ var init_ka = __esm({
6647
7061
  const TypeDictionary = {
6648
7062
  nan: "NaN",
6649
7063
  number: "\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",
6650
- string: "\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",
7064
+ string: "\u10D5\u10D4\u10DA\u10D8",
6651
7065
  boolean: "\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",
6652
7066
  function: "\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",
6653
7067
  array: "\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"
@@ -6685,14 +7099,14 @@ var init_ka = __esm({
6685
7099
  case "invalid_format": {
6686
7100
  const _issue = issue2;
6687
7101
  if (_issue.format === "starts_with") {
6688
- return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${_issue.prefix}"-\u10D8\u10D7`;
7102
+ return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${_issue.prefix}"-\u10D8\u10D7`;
6689
7103
  }
6690
7104
  if (_issue.format === "ends_with")
6691
- return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${_issue.suffix}"-\u10D8\u10D7`;
7105
+ return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${_issue.suffix}"-\u10D8\u10D7`;
6692
7106
  if (_issue.format === "includes")
6693
- return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${_issue.includes}"-\u10E1`;
7107
+ return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${_issue.includes}"-\u10E1`;
6694
7108
  if (_issue.format === "regex")
6695
- return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${_issue.pattern}`;
7109
+ return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${_issue.pattern}`;
6696
7110
  return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${FormatDictionary[_issue.format] ?? issue2.format}`;
6697
7111
  }
6698
7112
  case "not_multiple_of":
@@ -6716,15 +7130,15 @@ var init_ka = __esm({
6716
7130
  // ../../node_modules/zod/v4/locales/km.js
6717
7131
  function km_default() {
6718
7132
  return {
6719
- localeError: error24()
7133
+ localeError: error26()
6720
7134
  };
6721
7135
  }
6722
- var error24;
7136
+ var error26;
6723
7137
  var init_km = __esm({
6724
7138
  "../../node_modules/zod/v4/locales/km.js"() {
6725
7139
  "use strict";
6726
7140
  init_util();
6727
- error24 = () => {
7141
+ error26 = () => {
6728
7142
  const Sizable = {
6729
7143
  string: { unit: "\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" },
6730
7144
  file: { unit: "\u1794\u17C3", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" },
@@ -6845,15 +7259,15 @@ var init_kh = __esm({
6845
7259
  // ../../node_modules/zod/v4/locales/ko.js
6846
7260
  function ko_default() {
6847
7261
  return {
6848
- localeError: error25()
7262
+ localeError: error27()
6849
7263
  };
6850
7264
  }
6851
- var error25;
7265
+ var error27;
6852
7266
  var init_ko = __esm({
6853
7267
  "../../node_modules/zod/v4/locales/ko.js"() {
6854
7268
  "use strict";
6855
7269
  init_util();
6856
- error25 = () => {
7270
+ error27 = () => {
6857
7271
  const Sizable = {
6858
7272
  string: { unit: "\uBB38\uC790", verb: "to have" },
6859
7273
  file: { unit: "\uBC14\uC774\uD2B8", verb: "to have" },
@@ -6974,10 +7388,10 @@ function getUnitTypeFromNumber(number4) {
6974
7388
  }
6975
7389
  function lt_default() {
6976
7390
  return {
6977
- localeError: error26()
7391
+ localeError: error28()
6978
7392
  };
6979
7393
  }
6980
- var capitalizeFirstCharacter, error26;
7394
+ var capitalizeFirstCharacter, error28;
6981
7395
  var init_lt = __esm({
6982
7396
  "../../node_modules/zod/v4/locales/lt.js"() {
6983
7397
  "use strict";
@@ -6985,7 +7399,7 @@ var init_lt = __esm({
6985
7399
  capitalizeFirstCharacter = (text) => {
6986
7400
  return text.charAt(0).toUpperCase() + text.slice(1);
6987
7401
  };
6988
- error26 = () => {
7402
+ error28 = () => {
6989
7403
  const Sizable = {
6990
7404
  string: {
6991
7405
  unit: {
@@ -7175,15 +7589,15 @@ var init_lt = __esm({
7175
7589
  // ../../node_modules/zod/v4/locales/mk.js
7176
7590
  function mk_default() {
7177
7591
  return {
7178
- localeError: error27()
7592
+ localeError: error29()
7179
7593
  };
7180
7594
  }
7181
- var error27;
7595
+ var error29;
7182
7596
  var init_mk = __esm({
7183
7597
  "../../node_modules/zod/v4/locales/mk.js"() {
7184
7598
  "use strict";
7185
7599
  init_util();
7186
- error27 = () => {
7600
+ error29 = () => {
7187
7601
  const Sizable = {
7188
7602
  string: { unit: "\u0437\u043D\u0430\u0446\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" },
7189
7603
  file: { unit: "\u0431\u0430\u0458\u0442\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" },
@@ -7292,15 +7706,15 @@ var init_mk = __esm({
7292
7706
  // ../../node_modules/zod/v4/locales/ms.js
7293
7707
  function ms_default() {
7294
7708
  return {
7295
- localeError: error28()
7709
+ localeError: error30()
7296
7710
  };
7297
7711
  }
7298
- var error28;
7712
+ var error30;
7299
7713
  var init_ms = __esm({
7300
7714
  "../../node_modules/zod/v4/locales/ms.js"() {
7301
7715
  "use strict";
7302
7716
  init_util();
7303
- error28 = () => {
7717
+ error30 = () => {
7304
7718
  const Sizable = {
7305
7719
  string: { unit: "aksara", verb: "mempunyai" },
7306
7720
  file: { unit: "bait", verb: "mempunyai" },
@@ -7407,15 +7821,15 @@ var init_ms = __esm({
7407
7821
  // ../../node_modules/zod/v4/locales/nl.js
7408
7822
  function nl_default() {
7409
7823
  return {
7410
- localeError: error29()
7824
+ localeError: error31()
7411
7825
  };
7412
7826
  }
7413
- var error29;
7827
+ var error31;
7414
7828
  var init_nl = __esm({
7415
7829
  "../../node_modules/zod/v4/locales/nl.js"() {
7416
7830
  "use strict";
7417
7831
  init_util();
7418
- error29 = () => {
7832
+ error31 = () => {
7419
7833
  const Sizable = {
7420
7834
  string: { unit: "tekens", verb: "heeft" },
7421
7835
  file: { unit: "bytes", verb: "heeft" },
@@ -7525,15 +7939,15 @@ var init_nl = __esm({
7525
7939
  // ../../node_modules/zod/v4/locales/no.js
7526
7940
  function no_default() {
7527
7941
  return {
7528
- localeError: error30()
7942
+ localeError: error32()
7529
7943
  };
7530
7944
  }
7531
- var error30;
7945
+ var error32;
7532
7946
  var init_no = __esm({
7533
7947
  "../../node_modules/zod/v4/locales/no.js"() {
7534
7948
  "use strict";
7535
7949
  init_util();
7536
- error30 = () => {
7950
+ error32 = () => {
7537
7951
  const Sizable = {
7538
7952
  string: { unit: "tegn", verb: "\xE5 ha" },
7539
7953
  file: { unit: "bytes", verb: "\xE5 ha" },
@@ -7641,15 +8055,15 @@ var init_no = __esm({
7641
8055
  // ../../node_modules/zod/v4/locales/ota.js
7642
8056
  function ota_default() {
7643
8057
  return {
7644
- localeError: error31()
8058
+ localeError: error33()
7645
8059
  };
7646
8060
  }
7647
- var error31;
8061
+ var error33;
7648
8062
  var init_ota = __esm({
7649
8063
  "../../node_modules/zod/v4/locales/ota.js"() {
7650
8064
  "use strict";
7651
8065
  init_util();
7652
- error31 = () => {
8066
+ error33 = () => {
7653
8067
  const Sizable = {
7654
8068
  string: { unit: "harf", verb: "olmal\u0131d\u0131r" },
7655
8069
  file: { unit: "bayt", verb: "olmal\u0131d\u0131r" },
@@ -7758,15 +8172,15 @@ var init_ota = __esm({
7758
8172
  // ../../node_modules/zod/v4/locales/ps.js
7759
8173
  function ps_default() {
7760
8174
  return {
7761
- localeError: error32()
8175
+ localeError: error34()
7762
8176
  };
7763
8177
  }
7764
- var error32;
8178
+ var error34;
7765
8179
  var init_ps = __esm({
7766
8180
  "../../node_modules/zod/v4/locales/ps.js"() {
7767
8181
  "use strict";
7768
8182
  init_util();
7769
- error32 = () => {
8183
+ error34 = () => {
7770
8184
  const Sizable = {
7771
8185
  string: { unit: "\u062A\u0648\u06A9\u064A", verb: "\u0648\u0644\u0631\u064A" },
7772
8186
  file: { unit: "\u0628\u0627\u06CC\u067C\u0633", verb: "\u0648\u0644\u0631\u064A" },
@@ -7880,15 +8294,15 @@ var init_ps = __esm({
7880
8294
  // ../../node_modules/zod/v4/locales/pl.js
7881
8295
  function pl_default() {
7882
8296
  return {
7883
- localeError: error33()
8297
+ localeError: error35()
7884
8298
  };
7885
8299
  }
7886
- var error33;
8300
+ var error35;
7887
8301
  var init_pl = __esm({
7888
8302
  "../../node_modules/zod/v4/locales/pl.js"() {
7889
8303
  "use strict";
7890
8304
  init_util();
7891
- error33 = () => {
8305
+ error35 = () => {
7892
8306
  const Sizable = {
7893
8307
  string: { unit: "znak\xF3w", verb: "mie\u0107" },
7894
8308
  file: { unit: "bajt\xF3w", verb: "mie\u0107" },
@@ -7997,15 +8411,15 @@ var init_pl = __esm({
7997
8411
  // ../../node_modules/zod/v4/locales/pt.js
7998
8412
  function pt_default() {
7999
8413
  return {
8000
- localeError: error34()
8414
+ localeError: error36()
8001
8415
  };
8002
8416
  }
8003
- var error34;
8417
+ var error36;
8004
8418
  var init_pt = __esm({
8005
8419
  "../../node_modules/zod/v4/locales/pt.js"() {
8006
8420
  "use strict";
8007
8421
  init_util();
8008
- error34 = () => {
8422
+ error36 = () => {
8009
8423
  const Sizable = {
8010
8424
  string: { unit: "caracteres", verb: "ter" },
8011
8425
  file: { unit: "bytes", verb: "ter" },
@@ -8110,6 +8524,133 @@ var init_pt = __esm({
8110
8524
  }
8111
8525
  });
8112
8526
 
8527
+ // ../../node_modules/zod/v4/locales/ro.js
8528
+ function ro_default() {
8529
+ return {
8530
+ localeError: error37()
8531
+ };
8532
+ }
8533
+ var error37;
8534
+ var init_ro = __esm({
8535
+ "../../node_modules/zod/v4/locales/ro.js"() {
8536
+ "use strict";
8537
+ init_util();
8538
+ error37 = () => {
8539
+ const Sizable = {
8540
+ string: { unit: "caractere", verb: "s\u0103 aib\u0103" },
8541
+ file: { unit: "octe\u021Bi", verb: "s\u0103 aib\u0103" },
8542
+ array: { unit: "elemente", verb: "s\u0103 aib\u0103" },
8543
+ set: { unit: "elemente", verb: "s\u0103 aib\u0103" },
8544
+ map: { unit: "intr\u0103ri", verb: "s\u0103 aib\u0103" }
8545
+ };
8546
+ function getSizing(origin) {
8547
+ return Sizable[origin] ?? null;
8548
+ }
8549
+ const FormatDictionary = {
8550
+ regex: "intrare",
8551
+ email: "adres\u0103 de email",
8552
+ url: "URL",
8553
+ emoji: "emoji",
8554
+ uuid: "UUID",
8555
+ uuidv4: "UUIDv4",
8556
+ uuidv6: "UUIDv6",
8557
+ nanoid: "nanoid",
8558
+ guid: "GUID",
8559
+ cuid: "cuid",
8560
+ cuid2: "cuid2",
8561
+ ulid: "ULID",
8562
+ xid: "XID",
8563
+ ksuid: "KSUID",
8564
+ datetime: "dat\u0103 \u0219i or\u0103 ISO",
8565
+ date: "dat\u0103 ISO",
8566
+ time: "or\u0103 ISO",
8567
+ duration: "durat\u0103 ISO",
8568
+ ipv4: "adres\u0103 IPv4",
8569
+ ipv6: "adres\u0103 IPv6",
8570
+ mac: "adres\u0103 MAC",
8571
+ cidrv4: "interval IPv4",
8572
+ cidrv6: "interval IPv6",
8573
+ base64: "\u0219ir codat base64",
8574
+ base64url: "\u0219ir codat base64url",
8575
+ json_string: "\u0219ir JSON",
8576
+ e164: "num\u0103r E.164",
8577
+ jwt: "JWT",
8578
+ template_literal: "intrare"
8579
+ };
8580
+ const TypeDictionary = {
8581
+ nan: "NaN",
8582
+ string: "\u0219ir",
8583
+ number: "num\u0103r",
8584
+ boolean: "boolean",
8585
+ function: "func\u021Bie",
8586
+ array: "matrice",
8587
+ object: "obiect",
8588
+ undefined: "nedefinit",
8589
+ symbol: "simbol",
8590
+ bigint: "num\u0103r mare",
8591
+ void: "void",
8592
+ never: "never",
8593
+ map: "hart\u0103",
8594
+ set: "set"
8595
+ };
8596
+ return (issue2) => {
8597
+ switch (issue2.code) {
8598
+ case "invalid_type": {
8599
+ const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
8600
+ const receivedType = parsedType(issue2.input);
8601
+ const received = TypeDictionary[receivedType] ?? receivedType;
8602
+ return `Intrare invalid\u0103: a\u0219teptat ${expected}, primit ${received}`;
8603
+ }
8604
+ case "invalid_value":
8605
+ if (issue2.values.length === 1)
8606
+ return `Intrare invalid\u0103: a\u0219teptat ${stringifyPrimitive(issue2.values[0])}`;
8607
+ return `Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${joinValues(issue2.values, "|")}`;
8608
+ case "too_big": {
8609
+ const adj = issue2.inclusive ? "<=" : "<";
8610
+ const sizing = getSizing(issue2.origin);
8611
+ if (sizing)
8612
+ return `Prea mare: a\u0219teptat ca ${issue2.origin ?? "valoarea"} ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elemente"}`;
8613
+ return `Prea mare: a\u0219teptat ca ${issue2.origin ?? "valoarea"} s\u0103 fie ${adj}${issue2.maximum.toString()}`;
8614
+ }
8615
+ case "too_small": {
8616
+ const adj = issue2.inclusive ? ">=" : ">";
8617
+ const sizing = getSizing(issue2.origin);
8618
+ if (sizing) {
8619
+ return `Prea mic: a\u0219teptat ca ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
8620
+ }
8621
+ return `Prea mic: a\u0219teptat ca ${issue2.origin} s\u0103 fie ${adj}${issue2.minimum.toString()}`;
8622
+ }
8623
+ case "invalid_format": {
8624
+ const _issue = issue2;
8625
+ if (_issue.format === "starts_with") {
8626
+ return `\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${_issue.prefix}"`;
8627
+ }
8628
+ if (_issue.format === "ends_with")
8629
+ return `\u0218ir invalid: trebuie s\u0103 se termine cu "${_issue.suffix}"`;
8630
+ if (_issue.format === "includes")
8631
+ return `\u0218ir invalid: trebuie s\u0103 includ\u0103 "${_issue.includes}"`;
8632
+ if (_issue.format === "regex")
8633
+ return `\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${_issue.pattern}`;
8634
+ return `Format invalid: ${FormatDictionary[_issue.format] ?? issue2.format}`;
8635
+ }
8636
+ case "not_multiple_of":
8637
+ return `Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${issue2.divisor}`;
8638
+ case "unrecognized_keys":
8639
+ return `Chei nerecunoscute: ${joinValues(issue2.keys, ", ")}`;
8640
+ case "invalid_key":
8641
+ return `Cheie invalid\u0103 \xEEn ${issue2.origin}`;
8642
+ case "invalid_union":
8643
+ return "Intrare invalid\u0103";
8644
+ case "invalid_element":
8645
+ return `Valoare invalid\u0103 \xEEn ${issue2.origin}`;
8646
+ default:
8647
+ return `Intrare invalid\u0103`;
8648
+ }
8649
+ };
8650
+ };
8651
+ }
8652
+ });
8653
+
8113
8654
  // ../../node_modules/zod/v4/locales/ru.js
8114
8655
  function getRussianPlural(count, one, few, many) {
8115
8656
  const absCount = Math.abs(count);
@@ -8128,15 +8669,15 @@ function getRussianPlural(count, one, few, many) {
8128
8669
  }
8129
8670
  function ru_default() {
8130
8671
  return {
8131
- localeError: error35()
8672
+ localeError: error38()
8132
8673
  };
8133
8674
  }
8134
- var error35;
8675
+ var error38;
8135
8676
  var init_ru = __esm({
8136
8677
  "../../node_modules/zod/v4/locales/ru.js"() {
8137
8678
  "use strict";
8138
8679
  init_util();
8139
- error35 = () => {
8680
+ error38 = () => {
8140
8681
  const Sizable = {
8141
8682
  string: {
8142
8683
  unit: {
@@ -8277,15 +8818,15 @@ var init_ru = __esm({
8277
8818
  // ../../node_modules/zod/v4/locales/sl.js
8278
8819
  function sl_default() {
8279
8820
  return {
8280
- localeError: error36()
8821
+ localeError: error39()
8281
8822
  };
8282
8823
  }
8283
- var error36;
8824
+ var error39;
8284
8825
  var init_sl = __esm({
8285
8826
  "../../node_modules/zod/v4/locales/sl.js"() {
8286
8827
  "use strict";
8287
8828
  init_util();
8288
- error36 = () => {
8829
+ error39 = () => {
8289
8830
  const Sizable = {
8290
8831
  string: { unit: "znakov", verb: "imeti" },
8291
8832
  file: { unit: "bajtov", verb: "imeti" },
@@ -8394,15 +8935,15 @@ var init_sl = __esm({
8394
8935
  // ../../node_modules/zod/v4/locales/sv.js
8395
8936
  function sv_default() {
8396
8937
  return {
8397
- localeError: error37()
8938
+ localeError: error40()
8398
8939
  };
8399
8940
  }
8400
- var error37;
8941
+ var error40;
8401
8942
  var init_sv = __esm({
8402
8943
  "../../node_modules/zod/v4/locales/sv.js"() {
8403
8944
  "use strict";
8404
8945
  init_util();
8405
- error37 = () => {
8946
+ error40 = () => {
8406
8947
  const Sizable = {
8407
8948
  string: { unit: "tecken", verb: "att ha" },
8408
8949
  file: { unit: "bytes", verb: "att ha" },
@@ -8512,15 +9053,15 @@ var init_sv = __esm({
8512
9053
  // ../../node_modules/zod/v4/locales/ta.js
8513
9054
  function ta_default() {
8514
9055
  return {
8515
- localeError: error38()
9056
+ localeError: error41()
8516
9057
  };
8517
9058
  }
8518
- var error38;
9059
+ var error41;
8519
9060
  var init_ta = __esm({
8520
9061
  "../../node_modules/zod/v4/locales/ta.js"() {
8521
9062
  "use strict";
8522
9063
  init_util();
8523
- error38 = () => {
9064
+ error41 = () => {
8524
9065
  const Sizable = {
8525
9066
  string: { unit: "\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" },
8526
9067
  file: { unit: "\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" },
@@ -8630,15 +9171,15 @@ var init_ta = __esm({
8630
9171
  // ../../node_modules/zod/v4/locales/th.js
8631
9172
  function th_default() {
8632
9173
  return {
8633
- localeError: error39()
9174
+ localeError: error42()
8634
9175
  };
8635
9176
  }
8636
- var error39;
9177
+ var error42;
8637
9178
  var init_th = __esm({
8638
9179
  "../../node_modules/zod/v4/locales/th.js"() {
8639
9180
  "use strict";
8640
9181
  init_util();
8641
- error39 = () => {
9182
+ error42 = () => {
8642
9183
  const Sizable = {
8643
9184
  string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
8644
9185
  file: { unit: "\u0E44\u0E1A\u0E15\u0E4C", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
@@ -8748,15 +9289,15 @@ var init_th = __esm({
8748
9289
  // ../../node_modules/zod/v4/locales/tr.js
8749
9290
  function tr_default() {
8750
9291
  return {
8751
- localeError: error40()
9292
+ localeError: error43()
8752
9293
  };
8753
9294
  }
8754
- var error40;
9295
+ var error43;
8755
9296
  var init_tr = __esm({
8756
9297
  "../../node_modules/zod/v4/locales/tr.js"() {
8757
9298
  "use strict";
8758
9299
  init_util();
8759
- error40 = () => {
9300
+ error43 = () => {
8760
9301
  const Sizable = {
8761
9302
  string: { unit: "karakter", verb: "olmal\u0131" },
8762
9303
  file: { unit: "bayt", verb: "olmal\u0131" },
@@ -8861,15 +9402,15 @@ var init_tr = __esm({
8861
9402
  // ../../node_modules/zod/v4/locales/uk.js
8862
9403
  function uk_default() {
8863
9404
  return {
8864
- localeError: error41()
9405
+ localeError: error44()
8865
9406
  };
8866
9407
  }
8867
- var error41;
9408
+ var error44;
8868
9409
  var init_uk = __esm({
8869
9410
  "../../node_modules/zod/v4/locales/uk.js"() {
8870
9411
  "use strict";
8871
9412
  init_util();
8872
- error41 = () => {
9413
+ error44 = () => {
8873
9414
  const Sizable = {
8874
9415
  string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
8875
9416
  file: { unit: "\u0431\u0430\u0439\u0442\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
@@ -8988,15 +9529,15 @@ var init_ua = __esm({
8988
9529
  // ../../node_modules/zod/v4/locales/ur.js
8989
9530
  function ur_default() {
8990
9531
  return {
8991
- localeError: error42()
9532
+ localeError: error45()
8992
9533
  };
8993
9534
  }
8994
- var error42;
9535
+ var error45;
8995
9536
  var init_ur = __esm({
8996
9537
  "../../node_modules/zod/v4/locales/ur.js"() {
8997
9538
  "use strict";
8998
9539
  init_util();
8999
- error42 = () => {
9540
+ error45 = () => {
9000
9541
  const Sizable = {
9001
9542
  string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
9002
9543
  file: { unit: "\u0628\u0627\u0626\u0679\u0633", verb: "\u06C1\u0648\u0646\u0627" },
@@ -9106,20 +9647,21 @@ var init_ur = __esm({
9106
9647
  // ../../node_modules/zod/v4/locales/uz.js
9107
9648
  function uz_default() {
9108
9649
  return {
9109
- localeError: error43()
9650
+ localeError: error46()
9110
9651
  };
9111
9652
  }
9112
- var error43;
9653
+ var error46;
9113
9654
  var init_uz = __esm({
9114
9655
  "../../node_modules/zod/v4/locales/uz.js"() {
9115
9656
  "use strict";
9116
9657
  init_util();
9117
- error43 = () => {
9658
+ error46 = () => {
9118
9659
  const Sizable = {
9119
9660
  string: { unit: "belgi", verb: "bo\u2018lishi kerak" },
9120
9661
  file: { unit: "bayt", verb: "bo\u2018lishi kerak" },
9121
9662
  array: { unit: "element", verb: "bo\u2018lishi kerak" },
9122
- set: { unit: "element", verb: "bo\u2018lishi kerak" }
9663
+ set: { unit: "element", verb: "bo\u2018lishi kerak" },
9664
+ map: { unit: "yozuv", verb: "bo\u2018lishi kerak" }
9123
9665
  };
9124
9666
  function getSizing(origin) {
9125
9667
  return Sizable[origin] ?? null;
@@ -9223,15 +9765,15 @@ var init_uz = __esm({
9223
9765
  // ../../node_modules/zod/v4/locales/vi.js
9224
9766
  function vi_default() {
9225
9767
  return {
9226
- localeError: error44()
9768
+ localeError: error47()
9227
9769
  };
9228
9770
  }
9229
- var error44;
9771
+ var error47;
9230
9772
  var init_vi = __esm({
9231
9773
  "../../node_modules/zod/v4/locales/vi.js"() {
9232
9774
  "use strict";
9233
9775
  init_util();
9234
- error44 = () => {
9776
+ error47 = () => {
9235
9777
  const Sizable = {
9236
9778
  string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
9237
9779
  file: { unit: "byte", verb: "c\xF3" },
@@ -9339,15 +9881,15 @@ var init_vi = __esm({
9339
9881
  // ../../node_modules/zod/v4/locales/zh-CN.js
9340
9882
  function zh_CN_default() {
9341
9883
  return {
9342
- localeError: error45()
9884
+ localeError: error48()
9343
9885
  };
9344
9886
  }
9345
- var error45;
9887
+ var error48;
9346
9888
  var init_zh_CN = __esm({
9347
9889
  "../../node_modules/zod/v4/locales/zh-CN.js"() {
9348
9890
  "use strict";
9349
9891
  init_util();
9350
- error45 = () => {
9892
+ error48 = () => {
9351
9893
  const Sizable = {
9352
9894
  string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
9353
9895
  file: { unit: "\u5B57\u8282", verb: "\u5305\u542B" },
@@ -9456,15 +9998,15 @@ var init_zh_CN = __esm({
9456
9998
  // ../../node_modules/zod/v4/locales/zh-TW.js
9457
9999
  function zh_TW_default() {
9458
10000
  return {
9459
- localeError: error46()
10001
+ localeError: error49()
9460
10002
  };
9461
10003
  }
9462
- var error46;
10004
+ var error49;
9463
10005
  var init_zh_TW = __esm({
9464
10006
  "../../node_modules/zod/v4/locales/zh-TW.js"() {
9465
10007
  "use strict";
9466
10008
  init_util();
9467
- error46 = () => {
10009
+ error49 = () => {
9468
10010
  const Sizable = {
9469
10011
  string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
9470
10012
  file: { unit: "\u4F4D\u5143\u7D44", verb: "\u64C1\u6709" },
@@ -9571,15 +10113,15 @@ var init_zh_TW = __esm({
9571
10113
  // ../../node_modules/zod/v4/locales/yo.js
9572
10114
  function yo_default() {
9573
10115
  return {
9574
- localeError: error47()
10116
+ localeError: error50()
9575
10117
  };
9576
10118
  }
9577
- var error47;
10119
+ var error50;
9578
10120
  var init_yo = __esm({
9579
10121
  "../../node_modules/zod/v4/locales/yo.js"() {
9580
10122
  "use strict";
9581
10123
  init_util();
9582
- error47 = () => {
10124
+ error50 = () => {
9583
10125
  const Sizable = {
9584
10126
  string: { unit: "\xE0mi", verb: "n\xED" },
9585
10127
  file: { unit: "bytes", verb: "n\xED" },
@@ -9694,6 +10236,7 @@ __export(locales_exports, {
9694
10236
  cs: () => cs_default,
9695
10237
  da: () => da_default,
9696
10238
  de: () => de_default,
10239
+ el: () => el_default,
9697
10240
  en: () => en_default,
9698
10241
  eo: () => eo_default,
9699
10242
  es: () => es_default,
@@ -9702,6 +10245,7 @@ __export(locales_exports, {
9702
10245
  fr: () => fr_default,
9703
10246
  frCA: () => fr_CA_default,
9704
10247
  he: () => he_default,
10248
+ hr: () => hr_default,
9705
10249
  hu: () => hu_default,
9706
10250
  hy: () => hy_default,
9707
10251
  id: () => id_default,
@@ -9721,6 +10265,7 @@ __export(locales_exports, {
9721
10265
  pl: () => pl_default,
9722
10266
  ps: () => ps_default,
9723
10267
  pt: () => pt_default,
10268
+ ro: () => ro_default,
9724
10269
  ru: () => ru_default,
9725
10270
  sl: () => sl_default,
9726
10271
  sv: () => sv_default,
@@ -9747,6 +10292,7 @@ var init_locales = __esm({
9747
10292
  init_cs();
9748
10293
  init_da();
9749
10294
  init_de();
10295
+ init_el();
9750
10296
  init_en();
9751
10297
  init_eo();
9752
10298
  init_es();
@@ -9755,6 +10301,7 @@ var init_locales = __esm({
9755
10301
  init_fr();
9756
10302
  init_fr_CA();
9757
10303
  init_he();
10304
+ init_hr();
9758
10305
  init_hu();
9759
10306
  init_hy();
9760
10307
  init_id();
@@ -9774,6 +10321,7 @@ var init_locales = __esm({
9774
10321
  init_ps();
9775
10322
  init_pl();
9776
10323
  init_pt();
10324
+ init_ro();
9777
10325
  init_ru();
9778
10326
  init_sl();
9779
10327
  init_sv();
@@ -9795,7 +10343,7 @@ var init_locales = __esm({
9795
10343
  function registry() {
9796
10344
  return new $ZodRegistry();
9797
10345
  }
9798
- var _a, $output, $input, $ZodRegistry, globalRegistry;
10346
+ var _a2, $output, $input, $ZodRegistry, globalRegistry;
9799
10347
  var init_registries = __esm({
9800
10348
  "../../node_modules/zod/v4/core/registries.js"() {
9801
10349
  "use strict";
@@ -9841,7 +10389,7 @@ var init_registries = __esm({
9841
10389
  return this._map.has(schema);
9842
10390
  }
9843
10391
  };
9844
- (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
10392
+ (_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
9845
10393
  globalRegistry = globalThis.__zod_globalRegistry;
9846
10394
  }
9847
10395
  });
@@ -10754,7 +11302,7 @@ function _refine(Class2, fn, _params) {
10754
11302
  return schema;
10755
11303
  }
10756
11304
  // @__NO_SIDE_EFFECTS__
10757
- function _superRefine(fn) {
11305
+ function _superRefine(fn, params) {
10758
11306
  const ch = /* @__PURE__ */ _check((payload) => {
10759
11307
  payload.addIssue = (issue2) => {
10760
11308
  if (typeof issue2 === "string") {
@@ -10771,7 +11319,7 @@ function _superRefine(fn) {
10771
11319
  }
10772
11320
  };
10773
11321
  return fn(payload.value, payload);
10774
- });
11322
+ }, params);
10775
11323
  return ch;
10776
11324
  }
10777
11325
  // @__NO_SIDE_EFFECTS__
@@ -10918,7 +11466,7 @@ function initializeContext(params) {
10918
11466
  };
10919
11467
  }
10920
11468
  function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
10921
- var _a2;
11469
+ var _a3;
10922
11470
  const def = schema._zod.def;
10923
11471
  const seen = ctx.seen.get(schema);
10924
11472
  if (seen) {
@@ -10965,8 +11513,8 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
10965
11513
  delete result.schema.examples;
10966
11514
  delete result.schema.default;
10967
11515
  }
10968
- if (ctx.io === "input" && result.schema._prefault)
10969
- (_a2 = result.schema).default ?? (_a2.default = result.schema._prefault);
11516
+ if (ctx.io === "input" && "_prefault" in result.schema)
11517
+ (_a3 = result.schema).default ?? (_a3.default = result.schema._prefault);
10970
11518
  delete result.schema._prefault;
10971
11519
  const _result = ctx.seen.get(schema);
10972
11520
  return _result.schema;
@@ -11147,10 +11695,15 @@ function finalize(ctx, schema) {
11147
11695
  result.$id = ctx.external.uri(id);
11148
11696
  }
11149
11697
  Object.assign(result, root.def ?? root.schema);
11698
+ const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
11699
+ if (rootMetaId !== void 0 && result.id === rootMetaId)
11700
+ delete result.id;
11150
11701
  const defs = ctx.external?.defs ?? {};
11151
11702
  for (const entry of ctx.seen.entries()) {
11152
11703
  const seen = entry[1];
11153
11704
  if (seen.def && seen.defId) {
11705
+ if (seen.def.id === seen.defId)
11706
+ delete seen.def.id;
11154
11707
  defs[seen.defId] = seen.def;
11155
11708
  }
11156
11709
  }
@@ -11206,6 +11759,8 @@ function isTransforming(_schema, _ctx) {
11206
11759
  return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
11207
11760
  }
11208
11761
  if (def.type === "pipe") {
11762
+ if (_schema._zod.traits.has("$ZodCodec"))
11763
+ return true;
11209
11764
  return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
11210
11765
  }
11211
11766
  if (def.type === "object") {
@@ -11342,39 +11897,28 @@ var init_json_schema_processors = __esm({
11342
11897
  json2.type = "integer";
11343
11898
  else
11344
11899
  json2.type = "number";
11345
- if (typeof exclusiveMinimum === "number") {
11346
- if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
11900
+ const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
11901
+ const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
11902
+ const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
11903
+ if (exMin) {
11904
+ if (legacy) {
11347
11905
  json2.minimum = exclusiveMinimum;
11348
11906
  json2.exclusiveMinimum = true;
11349
11907
  } else {
11350
11908
  json2.exclusiveMinimum = exclusiveMinimum;
11351
11909
  }
11352
- }
11353
- if (typeof minimum === "number") {
11910
+ } else if (typeof minimum === "number") {
11354
11911
  json2.minimum = minimum;
11355
- if (typeof exclusiveMinimum === "number" && ctx.target !== "draft-04") {
11356
- if (exclusiveMinimum >= minimum)
11357
- delete json2.minimum;
11358
- else
11359
- delete json2.exclusiveMinimum;
11360
- }
11361
11912
  }
11362
- if (typeof exclusiveMaximum === "number") {
11363
- if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
11913
+ if (exMax) {
11914
+ if (legacy) {
11364
11915
  json2.maximum = exclusiveMaximum;
11365
11916
  json2.exclusiveMaximum = true;
11366
11917
  } else {
11367
11918
  json2.exclusiveMaximum = exclusiveMaximum;
11368
11919
  }
11369
- }
11370
- if (typeof maximum === "number") {
11920
+ } else if (typeof maximum === "number") {
11371
11921
  json2.maximum = maximum;
11372
- if (typeof exclusiveMaximum === "number" && ctx.target !== "draft-04") {
11373
- if (exclusiveMaximum <= maximum)
11374
- delete json2.maximum;
11375
- else
11376
- delete json2.exclusiveMaximum;
11377
- }
11378
11922
  }
11379
11923
  if (typeof multipleOf === "number")
11380
11924
  json2.multipleOf = multipleOf;
@@ -11546,7 +12090,10 @@ var init_json_schema_processors = __esm({
11546
12090
  if (typeof maximum === "number")
11547
12091
  json2.maxItems = maximum;
11548
12092
  json2.type = "array";
11549
- json2.items = process2(def.element, ctx, { ...params, path: [...params.path, "items"] });
12093
+ json2.items = process2(def.element, ctx, {
12094
+ ...params,
12095
+ path: [...params.path, "items"]
12096
+ });
11550
12097
  };
11551
12098
  objectProcessor = (schema, ctx, _json, params) => {
11552
12099
  const json2 = _json;
@@ -11739,7 +12286,8 @@ var init_json_schema_processors = __esm({
11739
12286
  };
11740
12287
  pipeProcessor = (schema, ctx, _json, params) => {
11741
12288
  const def = schema._zod.def;
11742
- const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
12289
+ const inIsTransform = def.in._zod.traits.has("$ZodTransform");
12290
+ const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
11743
12291
  process2(innerType, ctx, params);
11744
12292
  const seen = ctx.seen.get(schema);
11745
12293
  seen.ref = innerType;
@@ -11984,6 +12532,7 @@ __export(core_exports2, {
11984
12532
  $ZodOptional: () => $ZodOptional,
11985
12533
  $ZodPipe: () => $ZodPipe,
11986
12534
  $ZodPrefault: () => $ZodPrefault,
12535
+ $ZodPreprocess: () => $ZodPreprocess,
11987
12536
  $ZodPromise: () => $ZodPromise,
11988
12537
  $ZodReadonly: () => $ZodReadonly,
11989
12538
  $ZodRealError: () => $ZodRealError,
@@ -12334,8 +12883,8 @@ var init_errors2 = __esm({
12334
12883
  }
12335
12884
  });
12336
12885
  };
12337
- ZodError = $constructor("ZodError", initializer2);
12338
- ZodRealError = $constructor("ZodError", initializer2, {
12886
+ ZodError = /* @__PURE__ */ $constructor("ZodError", initializer2);
12887
+ ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, {
12339
12888
  Parent: Error
12340
12889
  });
12341
12890
  }
@@ -12413,6 +12962,7 @@ __export(schemas_exports2, {
12413
12962
  ZodOptional: () => ZodOptional,
12414
12963
  ZodPipe: () => ZodPipe,
12415
12964
  ZodPrefault: () => ZodPrefault,
12965
+ ZodPreprocess: () => ZodPreprocess,
12416
12966
  ZodPromise: () => ZodPromise,
12417
12967
  ZodReadonly: () => ZodReadonly,
12418
12968
  ZodRecord: () => ZodRecord,
@@ -12473,6 +13023,7 @@ __export(schemas_exports2, {
12473
13023
  int32: () => int32,
12474
13024
  int64: () => int64,
12475
13025
  intersection: () => intersection,
13026
+ invertCodec: () => invertCodec,
12476
13027
  ipv4: () => ipv42,
12477
13028
  ipv6: () => ipv62,
12478
13029
  json: () => json,
@@ -12531,6 +13082,42 @@ __export(schemas_exports2, {
12531
13082
  xid: () => xid2,
12532
13083
  xor: () => xor
12533
13084
  });
13085
+ function _installLazyMethods(inst, group, methods) {
13086
+ const proto = Object.getPrototypeOf(inst);
13087
+ let installed = _installedGroups.get(proto);
13088
+ if (!installed) {
13089
+ installed = /* @__PURE__ */ new Set();
13090
+ _installedGroups.set(proto, installed);
13091
+ }
13092
+ if (installed.has(group))
13093
+ return;
13094
+ installed.add(group);
13095
+ for (const key in methods) {
13096
+ const fn = methods[key];
13097
+ Object.defineProperty(proto, key, {
13098
+ configurable: true,
13099
+ enumerable: false,
13100
+ get() {
13101
+ const bound = fn.bind(this);
13102
+ Object.defineProperty(this, key, {
13103
+ configurable: true,
13104
+ writable: true,
13105
+ enumerable: true,
13106
+ value: bound
13107
+ });
13108
+ return bound;
13109
+ },
13110
+ set(v) {
13111
+ Object.defineProperty(this, key, {
13112
+ configurable: true,
13113
+ writable: true,
13114
+ enumerable: true,
13115
+ value: v
13116
+ });
13117
+ }
13118
+ });
13119
+ }
13120
+ }
12534
13121
  function string2(params) {
12535
13122
  return _string(ZodString, params);
12536
13123
  }
@@ -12557,7 +13144,7 @@ function url(params) {
12557
13144
  }
12558
13145
  function httpUrl(params) {
12559
13146
  return _url(ZodURL, {
12560
- protocol: /^https?$/,
13147
+ protocol: regexes_exports.httpProtocol,
12561
13148
  hostname: regexes_exports.domain,
12562
13149
  ...util_exports.normalizeParams(params)
12563
13150
  });
@@ -12754,6 +13341,14 @@ function tuple(items, _paramsOrRest, _params) {
12754
13341
  });
12755
13342
  }
12756
13343
  function record(keyType, valueType, params) {
13344
+ if (!valueType || !valueType._zod) {
13345
+ return new ZodRecord({
13346
+ type: "record",
13347
+ keyType: string2(),
13348
+ valueType: keyType,
13349
+ ...util_exports.normalizeParams(valueType)
13350
+ });
13351
+ }
12757
13352
  return new ZodRecord({
12758
13353
  type: "record",
12759
13354
  keyType,
@@ -12905,6 +13500,16 @@ function codec(in_, out, params) {
12905
13500
  reverseTransform: params.encode
12906
13501
  });
12907
13502
  }
13503
+ function invertCodec(codec2) {
13504
+ const def = codec2._zod.def;
13505
+ return new ZodCodec({
13506
+ type: "pipe",
13507
+ in: def.out,
13508
+ out: def.in,
13509
+ transform: def.reverseTransform,
13510
+ reverseTransform: def.transform
13511
+ });
13512
+ }
12908
13513
  function readonly(innerType) {
12909
13514
  return new ZodReadonly({
12910
13515
  type: "readonly",
@@ -12951,8 +13556,8 @@ function custom(fn, _params) {
12951
13556
  function refine(fn, _params = {}) {
12952
13557
  return _refine(ZodCustom, fn, _params);
12953
13558
  }
12954
- function superRefine(fn) {
12955
- return _superRefine(fn);
13559
+ function superRefine(fn, params) {
13560
+ return _superRefine(fn, params);
12956
13561
  }
12957
13562
  function _instanceof(cls, params = {}) {
12958
13563
  const inst = new ZodCustom({
@@ -12983,9 +13588,13 @@ function json(params) {
12983
13588
  return jsonSchema;
12984
13589
  }
12985
13590
  function preprocess(fn, schema) {
12986
- return pipe(transform(fn), schema);
13591
+ return new ZodPreprocess({
13592
+ type: "pipe",
13593
+ in: transform(fn),
13594
+ out: schema
13595
+ });
12987
13596
  }
12988
- var ZodType, _ZodString, ZodString, ZodStringFormat, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodMAC, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodCustomStringFormat, ZodNumber, ZodNumberFormat, ZodBoolean, ZodBigInt, ZodBigIntFormat, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodDate, ZodArray, ZodObject, ZodUnion, ZodXor, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodEnum, ZodLiteral, ZodFile, ZodTransform, ZodOptional, ZodExactOptional, ZodNullable, ZodDefault, ZodPrefault, ZodNonOptional, ZodSuccess, ZodCatch, ZodNaN, ZodPipe, ZodCodec, ZodReadonly, ZodTemplateLiteral, ZodLazy, ZodPromise, ZodFunction, ZodCustom, describe2, meta2, stringbool;
13597
+ var _installedGroups, ZodType, _ZodString, ZodString, ZodStringFormat, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodMAC, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodCustomStringFormat, ZodNumber, ZodNumberFormat, ZodBoolean, ZodBigInt, ZodBigIntFormat, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodDate, ZodArray, ZodObject, ZodUnion, ZodXor, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodEnum, ZodLiteral, ZodFile, ZodTransform, ZodOptional, ZodExactOptional, ZodNullable, ZodDefault, ZodPrefault, ZodNonOptional, ZodSuccess, ZodCatch, ZodNaN, ZodPipe, ZodCodec, ZodPreprocess, ZodReadonly, ZodTemplateLiteral, ZodLazy, ZodPromise, ZodFunction, ZodCustom, describe2, meta2, stringbool;
12989
13598
  var init_schemas2 = __esm({
12990
13599
  "../../node_modules/zod/v4/classic/schemas.js"() {
12991
13600
  "use strict";
@@ -12996,6 +13605,7 @@ var init_schemas2 = __esm({
12996
13605
  init_checks2();
12997
13606
  init_iso();
12998
13607
  init_parse2();
13608
+ _installedGroups = /* @__PURE__ */ new WeakMap();
12999
13609
  ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
13000
13610
  $ZodType.init(inst, def);
13001
13611
  Object.assign(inst["~standard"], {
@@ -13008,23 +13618,6 @@ var init_schemas2 = __esm({
13008
13618
  inst.def = def;
13009
13619
  inst.type = def.type;
13010
13620
  Object.defineProperty(inst, "_def", { value: def });
13011
- inst.check = (...checks) => {
13012
- return inst.clone(util_exports.mergeDefs(def, {
13013
- checks: [
13014
- ...def.checks ?? [],
13015
- ...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
13016
- ]
13017
- }), {
13018
- parent: true
13019
- });
13020
- };
13021
- inst.with = inst.check;
13022
- inst.clone = (def2, params) => clone(inst, def2, params);
13023
- inst.brand = () => inst;
13024
- inst.register = ((reg, meta3) => {
13025
- reg.add(inst, meta3);
13026
- return inst;
13027
- });
13028
13621
  inst.parse = (data, params) => parse2(inst, data, params, { callee: inst.parse });
13029
13622
  inst.safeParse = (data, params) => safeParse2(inst, data, params);
13030
13623
  inst.parseAsync = async (data, params) => parseAsync2(inst, data, params, { callee: inst.parseAsync });
@@ -13038,45 +13631,108 @@ var init_schemas2 = __esm({
13038
13631
  inst.safeDecode = (data, params) => safeDecode2(inst, data, params);
13039
13632
  inst.safeEncodeAsync = async (data, params) => safeEncodeAsync2(inst, data, params);
13040
13633
  inst.safeDecodeAsync = async (data, params) => safeDecodeAsync2(inst, data, params);
13041
- inst.refine = (check2, params) => inst.check(refine(check2, params));
13042
- inst.superRefine = (refinement) => inst.check(superRefine(refinement));
13043
- inst.overwrite = (fn) => inst.check(_overwrite(fn));
13044
- inst.optional = () => optional(inst);
13045
- inst.exactOptional = () => exactOptional(inst);
13046
- inst.nullable = () => nullable(inst);
13047
- inst.nullish = () => optional(nullable(inst));
13048
- inst.nonoptional = (params) => nonoptional(inst, params);
13049
- inst.array = () => array(inst);
13050
- inst.or = (arg) => union([inst, arg]);
13051
- inst.and = (arg) => intersection(inst, arg);
13052
- inst.transform = (tx) => pipe(inst, transform(tx));
13053
- inst.default = (def2) => _default2(inst, def2);
13054
- inst.prefault = (def2) => prefault(inst, def2);
13055
- inst.catch = (params) => _catch2(inst, params);
13056
- inst.pipe = (target) => pipe(inst, target);
13057
- inst.readonly = () => readonly(inst);
13058
- inst.describe = (description) => {
13059
- const cl = inst.clone();
13060
- globalRegistry.add(cl, { description });
13061
- return cl;
13062
- };
13634
+ _installLazyMethods(inst, "ZodType", {
13635
+ check(...chks) {
13636
+ const def2 = this.def;
13637
+ return this.clone(util_exports.mergeDefs(def2, {
13638
+ checks: [
13639
+ ...def2.checks ?? [],
13640
+ ...chks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
13641
+ ]
13642
+ }), { parent: true });
13643
+ },
13644
+ with(...chks) {
13645
+ return this.check(...chks);
13646
+ },
13647
+ clone(def2, params) {
13648
+ return clone(this, def2, params);
13649
+ },
13650
+ brand() {
13651
+ return this;
13652
+ },
13653
+ register(reg, meta3) {
13654
+ reg.add(this, meta3);
13655
+ return this;
13656
+ },
13657
+ refine(check2, params) {
13658
+ return this.check(refine(check2, params));
13659
+ },
13660
+ superRefine(refinement, params) {
13661
+ return this.check(superRefine(refinement, params));
13662
+ },
13663
+ overwrite(fn) {
13664
+ return this.check(_overwrite(fn));
13665
+ },
13666
+ optional() {
13667
+ return optional(this);
13668
+ },
13669
+ exactOptional() {
13670
+ return exactOptional(this);
13671
+ },
13672
+ nullable() {
13673
+ return nullable(this);
13674
+ },
13675
+ nullish() {
13676
+ return optional(nullable(this));
13677
+ },
13678
+ nonoptional(params) {
13679
+ return nonoptional(this, params);
13680
+ },
13681
+ array() {
13682
+ return array(this);
13683
+ },
13684
+ or(arg) {
13685
+ return union([this, arg]);
13686
+ },
13687
+ and(arg) {
13688
+ return intersection(this, arg);
13689
+ },
13690
+ transform(tx) {
13691
+ return pipe(this, transform(tx));
13692
+ },
13693
+ default(d) {
13694
+ return _default2(this, d);
13695
+ },
13696
+ prefault(d) {
13697
+ return prefault(this, d);
13698
+ },
13699
+ catch(params) {
13700
+ return _catch2(this, params);
13701
+ },
13702
+ pipe(target) {
13703
+ return pipe(this, target);
13704
+ },
13705
+ readonly() {
13706
+ return readonly(this);
13707
+ },
13708
+ describe(description) {
13709
+ const cl = this.clone();
13710
+ globalRegistry.add(cl, { description });
13711
+ return cl;
13712
+ },
13713
+ meta(...args) {
13714
+ if (args.length === 0)
13715
+ return globalRegistry.get(this);
13716
+ const cl = this.clone();
13717
+ globalRegistry.add(cl, args[0]);
13718
+ return cl;
13719
+ },
13720
+ isOptional() {
13721
+ return this.safeParse(void 0).success;
13722
+ },
13723
+ isNullable() {
13724
+ return this.safeParse(null).success;
13725
+ },
13726
+ apply(fn) {
13727
+ return fn(this);
13728
+ }
13729
+ });
13063
13730
  Object.defineProperty(inst, "description", {
13064
13731
  get() {
13065
13732
  return globalRegistry.get(inst)?.description;
13066
13733
  },
13067
13734
  configurable: true
13068
13735
  });
13069
- inst.meta = (...args) => {
13070
- if (args.length === 0) {
13071
- return globalRegistry.get(inst);
13072
- }
13073
- const cl = inst.clone();
13074
- globalRegistry.add(cl, args[0]);
13075
- return cl;
13076
- };
13077
- inst.isOptional = () => inst.safeParse(void 0).success;
13078
- inst.isNullable = () => inst.safeParse(null).success;
13079
- inst.apply = (fn) => fn(inst);
13080
13736
  return inst;
13081
13737
  });
13082
13738
  _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
@@ -13087,21 +13743,53 @@ var init_schemas2 = __esm({
13087
13743
  inst.format = bag.format ?? null;
13088
13744
  inst.minLength = bag.minimum ?? null;
13089
13745
  inst.maxLength = bag.maximum ?? null;
13090
- inst.regex = (...args) => inst.check(_regex(...args));
13091
- inst.includes = (...args) => inst.check(_includes(...args));
13092
- inst.startsWith = (...args) => inst.check(_startsWith(...args));
13093
- inst.endsWith = (...args) => inst.check(_endsWith(...args));
13094
- inst.min = (...args) => inst.check(_minLength(...args));
13095
- inst.max = (...args) => inst.check(_maxLength(...args));
13096
- inst.length = (...args) => inst.check(_length(...args));
13097
- inst.nonempty = (...args) => inst.check(_minLength(1, ...args));
13098
- inst.lowercase = (params) => inst.check(_lowercase(params));
13099
- inst.uppercase = (params) => inst.check(_uppercase(params));
13100
- inst.trim = () => inst.check(_trim());
13101
- inst.normalize = (...args) => inst.check(_normalize(...args));
13102
- inst.toLowerCase = () => inst.check(_toLowerCase());
13103
- inst.toUpperCase = () => inst.check(_toUpperCase());
13104
- inst.slugify = () => inst.check(_slugify());
13746
+ _installLazyMethods(inst, "_ZodString", {
13747
+ regex(...args) {
13748
+ return this.check(_regex(...args));
13749
+ },
13750
+ includes(...args) {
13751
+ return this.check(_includes(...args));
13752
+ },
13753
+ startsWith(...args) {
13754
+ return this.check(_startsWith(...args));
13755
+ },
13756
+ endsWith(...args) {
13757
+ return this.check(_endsWith(...args));
13758
+ },
13759
+ min(...args) {
13760
+ return this.check(_minLength(...args));
13761
+ },
13762
+ max(...args) {
13763
+ return this.check(_maxLength(...args));
13764
+ },
13765
+ length(...args) {
13766
+ return this.check(_length(...args));
13767
+ },
13768
+ nonempty(...args) {
13769
+ return this.check(_minLength(1, ...args));
13770
+ },
13771
+ lowercase(params) {
13772
+ return this.check(_lowercase(params));
13773
+ },
13774
+ uppercase(params) {
13775
+ return this.check(_uppercase(params));
13776
+ },
13777
+ trim() {
13778
+ return this.check(_trim());
13779
+ },
13780
+ normalize(...args) {
13781
+ return this.check(_normalize(...args));
13782
+ },
13783
+ toLowerCase() {
13784
+ return this.check(_toLowerCase());
13785
+ },
13786
+ toUpperCase() {
13787
+ return this.check(_toUpperCase());
13788
+ },
13789
+ slugify() {
13790
+ return this.check(_slugify());
13791
+ }
13792
+ });
13105
13793
  });
13106
13794
  ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
13107
13795
  $ZodString.init(inst, def);
@@ -13226,21 +13914,53 @@ var init_schemas2 = __esm({
13226
13914
  $ZodNumber.init(inst, def);
13227
13915
  ZodType.init(inst, def);
13228
13916
  inst._zod.processJSONSchema = (ctx, json2, params) => numberProcessor(inst, ctx, json2, params);
13229
- inst.gt = (value, params) => inst.check(_gt(value, params));
13230
- inst.gte = (value, params) => inst.check(_gte(value, params));
13231
- inst.min = (value, params) => inst.check(_gte(value, params));
13232
- inst.lt = (value, params) => inst.check(_lt(value, params));
13233
- inst.lte = (value, params) => inst.check(_lte(value, params));
13234
- inst.max = (value, params) => inst.check(_lte(value, params));
13235
- inst.int = (params) => inst.check(int(params));
13236
- inst.safe = (params) => inst.check(int(params));
13237
- inst.positive = (params) => inst.check(_gt(0, params));
13238
- inst.nonnegative = (params) => inst.check(_gte(0, params));
13239
- inst.negative = (params) => inst.check(_lt(0, params));
13240
- inst.nonpositive = (params) => inst.check(_lte(0, params));
13241
- inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params));
13242
- inst.step = (value, params) => inst.check(_multipleOf(value, params));
13243
- inst.finite = () => inst;
13917
+ _installLazyMethods(inst, "ZodNumber", {
13918
+ gt(value, params) {
13919
+ return this.check(_gt(value, params));
13920
+ },
13921
+ gte(value, params) {
13922
+ return this.check(_gte(value, params));
13923
+ },
13924
+ min(value, params) {
13925
+ return this.check(_gte(value, params));
13926
+ },
13927
+ lt(value, params) {
13928
+ return this.check(_lt(value, params));
13929
+ },
13930
+ lte(value, params) {
13931
+ return this.check(_lte(value, params));
13932
+ },
13933
+ max(value, params) {
13934
+ return this.check(_lte(value, params));
13935
+ },
13936
+ int(params) {
13937
+ return this.check(int(params));
13938
+ },
13939
+ safe(params) {
13940
+ return this.check(int(params));
13941
+ },
13942
+ positive(params) {
13943
+ return this.check(_gt(0, params));
13944
+ },
13945
+ nonnegative(params) {
13946
+ return this.check(_gte(0, params));
13947
+ },
13948
+ negative(params) {
13949
+ return this.check(_lt(0, params));
13950
+ },
13951
+ nonpositive(params) {
13952
+ return this.check(_lte(0, params));
13953
+ },
13954
+ multipleOf(value, params) {
13955
+ return this.check(_multipleOf(value, params));
13956
+ },
13957
+ step(value, params) {
13958
+ return this.check(_multipleOf(value, params));
13959
+ },
13960
+ finite() {
13961
+ return this;
13962
+ }
13963
+ });
13244
13964
  const bag = inst._zod.bag;
13245
13965
  inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
13246
13966
  inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
@@ -13333,11 +14053,23 @@ var init_schemas2 = __esm({
13333
14053
  ZodType.init(inst, def);
13334
14054
  inst._zod.processJSONSchema = (ctx, json2, params) => arrayProcessor(inst, ctx, json2, params);
13335
14055
  inst.element = def.element;
13336
- inst.min = (minLength, params) => inst.check(_minLength(minLength, params));
13337
- inst.nonempty = (params) => inst.check(_minLength(1, params));
13338
- inst.max = (maxLength, params) => inst.check(_maxLength(maxLength, params));
13339
- inst.length = (len, params) => inst.check(_length(len, params));
13340
- inst.unwrap = () => inst.element;
14056
+ _installLazyMethods(inst, "ZodArray", {
14057
+ min(n, params) {
14058
+ return this.check(_minLength(n, params));
14059
+ },
14060
+ nonempty(params) {
14061
+ return this.check(_minLength(1, params));
14062
+ },
14063
+ max(n, params) {
14064
+ return this.check(_maxLength(n, params));
14065
+ },
14066
+ length(n, params) {
14067
+ return this.check(_length(n, params));
14068
+ },
14069
+ unwrap() {
14070
+ return this.element;
14071
+ }
14072
+ });
13341
14073
  });
13342
14074
  ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
13343
14075
  $ZodObjectJIT.init(inst, def);
@@ -13346,23 +14078,47 @@ var init_schemas2 = __esm({
13346
14078
  util_exports.defineLazy(inst, "shape", () => {
13347
14079
  return def.shape;
13348
14080
  });
13349
- inst.keyof = () => _enum2(Object.keys(inst._zod.def.shape));
13350
- inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall });
13351
- inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
13352
- inst.loose = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
13353
- inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never() });
13354
- inst.strip = () => inst.clone({ ...inst._zod.def, catchall: void 0 });
13355
- inst.extend = (incoming) => {
13356
- return util_exports.extend(inst, incoming);
13357
- };
13358
- inst.safeExtend = (incoming) => {
13359
- return util_exports.safeExtend(inst, incoming);
13360
- };
13361
- inst.merge = (other) => util_exports.merge(inst, other);
13362
- inst.pick = (mask) => util_exports.pick(inst, mask);
13363
- inst.omit = (mask) => util_exports.omit(inst, mask);
13364
- inst.partial = (...args) => util_exports.partial(ZodOptional, inst, args[0]);
13365
- inst.required = (...args) => util_exports.required(ZodNonOptional, inst, args[0]);
14081
+ _installLazyMethods(inst, "ZodObject", {
14082
+ keyof() {
14083
+ return _enum2(Object.keys(this._zod.def.shape));
14084
+ },
14085
+ catchall(catchall) {
14086
+ return this.clone({ ...this._zod.def, catchall });
14087
+ },
14088
+ passthrough() {
14089
+ return this.clone({ ...this._zod.def, catchall: unknown() });
14090
+ },
14091
+ loose() {
14092
+ return this.clone({ ...this._zod.def, catchall: unknown() });
14093
+ },
14094
+ strict() {
14095
+ return this.clone({ ...this._zod.def, catchall: never() });
14096
+ },
14097
+ strip() {
14098
+ return this.clone({ ...this._zod.def, catchall: void 0 });
14099
+ },
14100
+ extend(incoming) {
14101
+ return util_exports.extend(this, incoming);
14102
+ },
14103
+ safeExtend(incoming) {
14104
+ return util_exports.safeExtend(this, incoming);
14105
+ },
14106
+ merge(other) {
14107
+ return util_exports.merge(this, other);
14108
+ },
14109
+ pick(mask) {
14110
+ return util_exports.pick(this, mask);
14111
+ },
14112
+ omit(mask) {
14113
+ return util_exports.omit(this, mask);
14114
+ },
14115
+ partial(...args) {
14116
+ return util_exports.partial(ZodOptional, this, args[0]);
14117
+ },
14118
+ required(...args) {
14119
+ return util_exports.required(ZodNonOptional, this, args[0]);
14120
+ }
14121
+ });
13366
14122
  });
13367
14123
  ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
13368
14124
  $ZodUnion.init(inst, def);
@@ -13506,10 +14262,12 @@ var init_schemas2 = __esm({
13506
14262
  if (output instanceof Promise) {
13507
14263
  return output.then((output2) => {
13508
14264
  payload.value = output2;
14265
+ payload.fallback = true;
13509
14266
  return payload;
13510
14267
  });
13511
14268
  }
13512
14269
  payload.value = output;
14270
+ payload.fallback = true;
13513
14271
  return payload;
13514
14272
  };
13515
14273
  });
@@ -13579,6 +14337,10 @@ var init_schemas2 = __esm({
13579
14337
  ZodPipe.init(inst, def);
13580
14338
  $ZodCodec.init(inst, def);
13581
14339
  });
14340
+ ZodPreprocess = /* @__PURE__ */ $constructor("ZodPreprocess", (inst, def) => {
14341
+ ZodPipe.init(inst, def);
14342
+ $ZodPreprocess.init(inst, def);
14343
+ });
13582
14344
  ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
13583
14345
  $ZodReadonly.init(inst, def);
13584
14346
  ZodType.init(inst, def);
@@ -13636,7 +14398,6 @@ var init_compat = __esm({
13636
14398
  "../../node_modules/zod/v4/classic/compat.js"() {
13637
14399
  "use strict";
13638
14400
  init_core2();
13639
- init_core2();
13640
14401
  ZodIssueCode = {
13641
14402
  invalid_type: "invalid_type",
13642
14403
  too_big: "too_big",
@@ -13971,12 +14732,6 @@ function convertBaseSchema(schema, ctx) {
13971
14732
  default:
13972
14733
  throw new Error(`Unsupported type: ${type}`);
13973
14734
  }
13974
- if (schema.description) {
13975
- zodSchema = zodSchema.describe(schema.description);
13976
- }
13977
- if (schema.default !== void 0) {
13978
- zodSchema = zodSchema.default(schema.default);
13979
- }
13980
14735
  return zodSchema;
13981
14736
  }
13982
14737
  function convertSchema(schema, ctx) {
@@ -14013,6 +14768,9 @@ function convertSchema(schema, ctx) {
14013
14768
  if (schema.readOnly === true) {
14014
14769
  baseSchema = z.readonly(baseSchema);
14015
14770
  }
14771
+ if (schema.default !== void 0) {
14772
+ baseSchema = baseSchema.default(schema.default);
14773
+ }
14016
14774
  const extraMeta = {};
14017
14775
  const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
14018
14776
  for (const key of coreMetadataKeys) {
@@ -14034,23 +14792,32 @@ function convertSchema(schema, ctx) {
14034
14792
  if (Object.keys(extraMeta).length > 0) {
14035
14793
  ctx.registry.add(baseSchema, extraMeta);
14036
14794
  }
14795
+ if (schema.description) {
14796
+ baseSchema = baseSchema.describe(schema.description);
14797
+ }
14037
14798
  return baseSchema;
14038
14799
  }
14039
14800
  function fromJSONSchema(schema, params) {
14040
14801
  if (typeof schema === "boolean") {
14041
14802
  return schema ? z.any() : z.never();
14042
14803
  }
14043
- const version2 = detectVersion(schema, params?.defaultTarget);
14044
- const defs = schema.$defs || schema.definitions || {};
14804
+ let normalized;
14805
+ try {
14806
+ normalized = JSON.parse(JSON.stringify(schema));
14807
+ } catch {
14808
+ throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas");
14809
+ }
14810
+ const version2 = detectVersion(normalized, params?.defaultTarget);
14811
+ const defs = normalized.$defs || normalized.definitions || {};
14045
14812
  const ctx = {
14046
14813
  version: version2,
14047
14814
  defs,
14048
14815
  refs: /* @__PURE__ */ new Map(),
14049
14816
  processing: /* @__PURE__ */ new Set(),
14050
- rootSchema: schema,
14817
+ rootSchema: normalized,
14051
14818
  registry: params?.registry ?? globalRegistry
14052
14819
  };
14053
- return convertSchema(schema, ctx);
14820
+ return convertSchema(normalized, ctx);
14054
14821
  }
14055
14822
  var z, RECOGNIZED_KEYS;
14056
14823
  var init_from_json_schema = __esm({
@@ -14233,6 +15000,7 @@ __export(external_exports, {
14233
15000
  ZodOptional: () => ZodOptional,
14234
15001
  ZodPipe: () => ZodPipe,
14235
15002
  ZodPrefault: () => ZodPrefault,
15003
+ ZodPreprocess: () => ZodPreprocess,
14236
15004
  ZodPromise: () => ZodPromise,
14237
15005
  ZodReadonly: () => ZodReadonly,
14238
15006
  ZodRealError: () => ZodRealError,
@@ -14311,6 +15079,7 @@ __export(external_exports, {
14311
15079
  int32: () => int32,
14312
15080
  int64: () => int64,
14313
15081
  intersection: () => intersection,
15082
+ invertCodec: () => invertCodec,
14314
15083
  ipv4: () => ipv42,
14315
15084
  ipv6: () => ipv62,
14316
15085
  iso: () => iso_exports,
@@ -15169,8 +15938,8 @@ async function findGitRoot(startDir) {
15169
15938
  function isCliAvailable(binary) {
15170
15939
  return new Promise((resolve2) => {
15171
15940
  const command = process.platform === "win32" ? "where" : "which";
15172
- (0, import_node_child_process.execFile)(command, [binary], (error48) => {
15173
- resolve2(error48 === null);
15941
+ (0, import_node_child_process.execFile)(command, [binary], (error51) => {
15942
+ resolve2(error51 === null);
15174
15943
  });
15175
15944
  });
15176
15945
  }
@@ -15226,10 +15995,7 @@ async function detectAgents(projectRoot) {
15226
15995
  continue;
15227
15996
  }
15228
15997
  seenAgents.add(rule.name);
15229
- let infoFilePath = rule.infoFilePath(foundDir);
15230
- if (infoFilePath !== null && !await pathExists(infoFilePath)) {
15231
- infoFilePath = null;
15232
- }
15998
+ const infoFilePath = rule.infoFilePath(foundDir);
15233
15999
  const cliAvailable = rule.cliBinary ? await isCliAvailable(rule.cliBinary) : false;
15234
16000
  detected.push({
15235
16001
  name: rule.name,
@@ -15242,7 +16008,7 @@ async function detectAgents(projectRoot) {
15242
16008
  detected.push({
15243
16009
  name: "generic",
15244
16010
  mcpConfigPath: (0, import_node_path.join)(resolvedRoot, ".glasstrace", "mcp.json"),
15245
- infoFilePath: null,
16011
+ infoFilePath: (0, import_node_path.join)(resolvedRoot, "AGENTS.md"),
15246
16012
  cliAvailable: false,
15247
16013
  registrationCommand: null
15248
16014
  });
@@ -15268,33 +16034,61 @@ var init_detect = __esm({
15268
16034
  },
15269
16035
  {
15270
16036
  name: "codex",
16037
+ // Codex 2026 default discovery is `AGENTS.override.md` → `AGENTS.md` →
16038
+ // opt-in `project_doc_fallback_filenames`; `codex.md` is NOT in the
16039
+ // default fallback list. Detection requires Codex-specific markers
16040
+ // (`codex.md` legacy, `.codex/` config dir) — `AGENTS.md` is NOT
16041
+ // included as a marker because the SDK now writes `AGENTS.md`
16042
+ // broadly via the multi-target dispatcher's companion writes; if
16043
+ // `AGENTS.md` were a Codex marker, every project with the SDK's
16044
+ // own companion AGENTS.md would re-classify as Codex on subsequent
16045
+ // detect runs and trigger unintended `.codex/config.toml` writes
16046
+ // (Codex P1 + Copilot P1 review of Wave 18 PR #274). The canonical
16047
+ // write destination remains AGENTS.md regardless of which marker
16048
+ // classified the project.
15271
16049
  markers: ["codex.md", ".codex"],
15272
16050
  mcpConfigPath: (dir) => (0, import_node_path.join)(dir, ".codex", "config.toml"),
15273
- infoFilePath: (dir) => (0, import_node_path.join)(dir, "codex.md"),
16051
+ infoFilePath: (dir) => (0, import_node_path.join)(dir, "AGENTS.md"),
15274
16052
  cliBinary: "codex",
15275
16053
  registrationCommand: "npx glasstrace mcp add --agent codex"
15276
16054
  },
15277
16055
  {
15278
16056
  name: "gemini",
15279
- markers: [".gemini"],
16057
+ markers: [".gemini", "GEMINI.md"],
15280
16058
  mcpConfigPath: (dir) => (0, import_node_path.join)(dir, ".gemini", "settings.json"),
15281
- infoFilePath: () => null,
16059
+ infoFilePath: (dir) => (0, import_node_path.join)(dir, "GEMINI.md"),
15282
16060
  cliBinary: "gemini",
15283
16061
  registrationCommand: "npx glasstrace mcp add --agent gemini"
15284
16062
  },
15285
16063
  {
15286
16064
  name: "cursor",
16065
+ // `.cursor/rules/*.mdc` is the current canonical format per Cursor's
16066
+ // 2026 docs. `.cursorrules` (single file) is supported-but-deprecated
16067
+ // and stays as a transitional fallback that the multi-target write
16068
+ // helper writes unconditionally alongside the .mdc canonical.
15287
16069
  markers: [".cursor", ".cursorrules"],
15288
16070
  mcpConfigPath: (dir) => (0, import_node_path.join)(dir, ".cursor", "mcp.json"),
15289
- infoFilePath: (dir) => (0, import_node_path.join)(dir, ".cursorrules"),
16071
+ infoFilePath: (dir) => (0, import_node_path.join)(dir, ".cursor", "rules", "glasstrace.mdc"),
15290
16072
  cliBinary: null,
15291
16073
  registrationCommand: "npx glasstrace mcp add --agent cursor"
15292
16074
  },
15293
16075
  {
15294
16076
  name: "windsurf",
15295
- markers: [".windsurfrules", ".windsurf"],
16077
+ // Windsurf's current canonical workspace-rules format is
16078
+ // `.windsurf/rules/*.md`. AGENTS.md is a parallel cross-tool
16079
+ // mechanism Windsurf also reads BUT is NOT included as a Windsurf
16080
+ // detection marker — the SDK writes `AGENTS.md` broadly via the
16081
+ // multi-target dispatcher's companion writes, so treating
16082
+ // `AGENTS.md` as a Windsurf marker would re-classify every
16083
+ // SDK-managed project as Windsurf and cause `glasstrace uninit`
16084
+ // to mutate the global `~/.codeium/windsurf/mcp_config.json` for
16085
+ // non-Windsurf projects (Codex P1 + Copilot P1 review of Wave 18
16086
+ // PR #274). The single-file `.windsurfrules` is the deprecated
16087
+ // legacy form — recognized as a marker so legacy projects classify
16088
+ // correctly, but the SDK no longer writes to it.
16089
+ markers: [".windsurf", ".windsurfrules"],
15296
16090
  mcpConfigPath: () => (0, import_node_path.join)((0, import_node_os.homedir)(), ".codeium", "windsurf", "mcp_config.json"),
15297
- infoFilePath: (dir) => (0, import_node_path.join)(dir, ".windsurfrules"),
16091
+ infoFilePath: (dir) => (0, import_node_path.join)(dir, ".windsurf", "rules", "glasstrace.md"),
15298
16092
  cliBinary: null,
15299
16093
  registrationCommand: "npx glasstrace mcp add --agent windsurf"
15300
16094
  }
@@ -15479,34 +16273,71 @@ function generateInfoSection(agent, endpoint, sdkVersion) {
15479
16273
  }
15480
16274
  const content = buildAgentInstructionBody();
15481
16275
  switch (agent.name) {
15482
- case "claude": {
15483
- const m = htmlMarkers(sdkVersion);
15484
- return `${m.start}
15485
- ${content}${m.end}
15486
- `;
15487
- }
15488
- case "codex": {
16276
+ case "claude":
16277
+ case "codex":
16278
+ case "gemini":
16279
+ case "windsurf":
16280
+ case "generic": {
15489
16281
  const m = htmlMarkers(sdkVersion);
15490
16282
  return `${m.start}
15491
16283
  ${content}${m.end}
15492
16284
  `;
15493
16285
  }
15494
16286
  case "cursor": {
15495
- const m = hashMarkers(sdkVersion);
16287
+ const m = htmlMarkers(sdkVersion);
15496
16288
  return `${m.start}
15497
16289
  ${content}${m.end}
15498
16290
  `;
15499
16291
  }
15500
- case "gemini":
15501
- case "windsurf":
15502
- case "generic":
15503
- return "";
15504
16292
  default: {
15505
16293
  const _exhaustive = agent.name;
15506
16294
  throw new Error(`Unknown agent: ${_exhaustive}`);
15507
16295
  }
15508
16296
  }
15509
16297
  }
16298
+ function generateInfoSectionForCursorrulesLegacy(endpoint, sdkVersion) {
16299
+ if (!endpoint || endpoint.trim() === "") {
16300
+ throw new Error("endpoint must not be empty");
16301
+ }
16302
+ if (!sdkVersion || sdkVersion.trim() === "") {
16303
+ throw new Error("sdkVersion must not be empty");
16304
+ }
16305
+ if (!SDK_VERSION_STAMP_PATTERN.test(sdkVersion)) {
16306
+ throw new Error(
16307
+ "sdkVersion must match [A-Za-z0-9.+\\-]+ (semver-shaped, no whitespace, no angle brackets)"
16308
+ );
16309
+ }
16310
+ const content = buildAgentInstructionBody();
16311
+ const m = hashMarkers(sdkVersion);
16312
+ return `${m.start}
16313
+ ${content}${m.end}
16314
+ `;
16315
+ }
16316
+ function generateInfoSectionForCursorMdc(endpoint, sdkVersion) {
16317
+ if (!endpoint || endpoint.trim() === "") {
16318
+ throw new Error("endpoint must not be empty");
16319
+ }
16320
+ if (!sdkVersion || sdkVersion.trim() === "") {
16321
+ throw new Error("sdkVersion must not be empty");
16322
+ }
16323
+ if (!SDK_VERSION_STAMP_PATTERN.test(sdkVersion)) {
16324
+ throw new Error(
16325
+ "sdkVersion must match [A-Za-z0-9.+\\-]+ (semver-shaped, no whitespace, no angle brackets)"
16326
+ );
16327
+ }
16328
+ const content = buildAgentInstructionBody();
16329
+ const m = htmlMarkers(sdkVersion);
16330
+ return [
16331
+ "---",
16332
+ "description: Glasstrace MCP runtime debugging tools \u2014 runtime evidence the agent reads when source alone cannot resolve a bug",
16333
+ "alwaysApply: true",
16334
+ "---",
16335
+ "",
16336
+ `${m.start}
16337
+ ${content}${m.end}
16338
+ `
16339
+ ].join("\n");
16340
+ }
15510
16341
  var SDK_VERSION_STAMP_PATTERN;
15511
16342
  var init_configs = __esm({
15512
16343
  "src/agent-detection/configs.ts"() {
@@ -15586,71 +16417,6 @@ function findMarkerBoundaries(lines) {
15586
16417
  }
15587
16418
  return null;
15588
16419
  }
15589
- async function injectInfoSection(agent, content, projectRoot) {
15590
- if (agent.infoFilePath === null) {
15591
- return;
15592
- }
15593
- if (content === "") {
15594
- return;
15595
- }
15596
- const filePath = agent.infoFilePath;
15597
- let existingContent = null;
15598
- try {
15599
- existingContent = await (0, import_promises2.readFile)(filePath, "utf-8");
15600
- } catch (err) {
15601
- const code = err.code;
15602
- if (code !== "ENOENT") {
15603
- if (isPermissionError(err)) {
15604
- process.stderr.write(
15605
- `Warning: cannot read info file ${filePath}: permission denied
15606
- `
15607
- );
15608
- return;
15609
- }
15610
- throw err;
15611
- }
15612
- }
15613
- if (existingContent === null) {
15614
- try {
15615
- await (0, import_promises2.mkdir)((0, import_node_path2.dirname)(filePath), { recursive: true });
15616
- await (0, import_promises2.writeFile)(filePath, content, "utf-8");
15617
- } catch (err) {
15618
- if (isPermissionError(err)) {
15619
- process.stderr.write(
15620
- `Warning: cannot write info file ${filePath}: permission denied
15621
- `
15622
- );
15623
- return;
15624
- }
15625
- throw err;
15626
- }
15627
- return;
15628
- }
15629
- const lines = existingContent.split("\n");
15630
- const boundaries = findMarkerBoundaries(lines);
15631
- let newContent;
15632
- if (boundaries !== null) {
15633
- const before = lines.slice(0, boundaries.startIdx);
15634
- const after = lines.slice(boundaries.endIdx + 1);
15635
- const contentWithoutTrailingNewline = content.endsWith("\n") ? content.slice(0, -1) : content;
15636
- newContent = [...before, contentWithoutTrailingNewline, ...after].join("\n");
15637
- } else {
15638
- const separator = existingContent.endsWith("\n") ? "\n" : "\n\n";
15639
- newContent = existingContent + separator + content;
15640
- }
15641
- try {
15642
- await (0, import_promises2.writeFile)(filePath, newContent, "utf-8");
15643
- } catch (err) {
15644
- if (isPermissionError(err)) {
15645
- process.stderr.write(
15646
- `Warning: cannot write info file ${filePath}: permission denied
15647
- `
15648
- );
15649
- return;
15650
- }
15651
- throw err;
15652
- }
15653
- }
15654
16420
  async function hasManagedSection(filePath) {
15655
16421
  let content;
15656
16422
  try {
@@ -15721,6 +16487,238 @@ var init_inject = __esm({
15721
16487
  }
15722
16488
  });
15723
16489
 
16490
+ // src/agent-detection/inject-all-targets.ts
16491
+ async function injectAllTargets(agents, endpoint, sdkVersion, projectRoot) {
16492
+ const writtenAgentsMd = /* @__PURE__ */ new Set();
16493
+ for (const agent of agents) {
16494
+ const targets = computeTargets(agent, projectRoot);
16495
+ for (const target of targets) {
16496
+ if (target.isAgentsMdCompanion) {
16497
+ if (writtenAgentsMd.has(target.path)) {
16498
+ continue;
16499
+ }
16500
+ writtenAgentsMd.add(target.path);
16501
+ }
16502
+ let createContent;
16503
+ let managedSectionOnly;
16504
+ if (target.kind === "cursor-mdc") {
16505
+ createContent = generateInfoSectionForCursorMdc(endpoint, sdkVersion);
16506
+ managedSectionOnly = generateInfoSection(agent, endpoint, sdkVersion);
16507
+ } else if (target.kind === "cursorrules-legacy") {
16508
+ createContent = generateInfoSectionForCursorrulesLegacy(
16509
+ endpoint,
16510
+ sdkVersion
16511
+ );
16512
+ managedSectionOnly = createContent;
16513
+ } else {
16514
+ createContent = generateInfoSection(agent, endpoint, sdkVersion);
16515
+ managedSectionOnly = createContent;
16516
+ }
16517
+ if (managedSectionOnly === "") continue;
16518
+ await writeManagedSectionToTarget(
16519
+ target.path,
16520
+ createContent,
16521
+ managedSectionOnly
16522
+ );
16523
+ }
16524
+ }
16525
+ }
16526
+ function foundDirFromAgent(agent) {
16527
+ if (agent.infoFilePath === null) return null;
16528
+ switch (agent.name) {
16529
+ case "claude":
16530
+ case "codex":
16531
+ case "gemini":
16532
+ case "generic":
16533
+ return (0, import_node_path3.dirname)(agent.infoFilePath);
16534
+ case "cursor":
16535
+ return (0, import_node_path3.dirname)((0, import_node_path3.dirname)((0, import_node_path3.dirname)(agent.infoFilePath)));
16536
+ case "windsurf":
16537
+ return (0, import_node_path3.dirname)((0, import_node_path3.dirname)((0, import_node_path3.dirname)(agent.infoFilePath)));
16538
+ }
16539
+ }
16540
+ function computeTargets(agent, projectRoot) {
16541
+ const targets = [];
16542
+ const foundDir = foundDirFromAgent(agent) ?? projectRoot;
16543
+ switch (agent.name) {
16544
+ case "claude": {
16545
+ if (agent.infoFilePath) {
16546
+ targets.push({
16547
+ path: agent.infoFilePath,
16548
+ kind: "primary",
16549
+ isAgentsMdCompanion: false
16550
+ });
16551
+ }
16552
+ targets.push({
16553
+ path: (0, import_node_path3.join)(foundDir, "AGENTS.md"),
16554
+ kind: "agents-md-companion",
16555
+ isAgentsMdCompanion: true
16556
+ });
16557
+ return targets;
16558
+ }
16559
+ case "codex": {
16560
+ if (agent.infoFilePath) {
16561
+ targets.push({
16562
+ path: agent.infoFilePath,
16563
+ kind: "primary",
16564
+ isAgentsMdCompanion: true
16565
+ });
16566
+ }
16567
+ return targets;
16568
+ }
16569
+ case "gemini": {
16570
+ if (agent.infoFilePath) {
16571
+ targets.push({
16572
+ path: agent.infoFilePath,
16573
+ kind: "primary",
16574
+ isAgentsMdCompanion: false
16575
+ });
16576
+ }
16577
+ targets.push({
16578
+ path: (0, import_node_path3.join)(foundDir, "AGENTS.md"),
16579
+ kind: "agents-md-companion",
16580
+ isAgentsMdCompanion: true
16581
+ });
16582
+ return targets;
16583
+ }
16584
+ case "cursor": {
16585
+ if (agent.infoFilePath) {
16586
+ targets.push({
16587
+ path: agent.infoFilePath,
16588
+ kind: "cursor-mdc",
16589
+ isAgentsMdCompanion: false
16590
+ });
16591
+ targets.push({
16592
+ path: (0, import_node_path3.join)(foundDir, ".cursorrules"),
16593
+ kind: "cursorrules-legacy",
16594
+ isAgentsMdCompanion: false
16595
+ });
16596
+ }
16597
+ targets.push({
16598
+ path: (0, import_node_path3.join)(foundDir, "AGENTS.md"),
16599
+ kind: "agents-md-companion",
16600
+ isAgentsMdCompanion: true
16601
+ });
16602
+ return targets;
16603
+ }
16604
+ case "windsurf": {
16605
+ if (agent.infoFilePath) {
16606
+ targets.push({
16607
+ path: agent.infoFilePath,
16608
+ kind: "primary",
16609
+ isAgentsMdCompanion: false
16610
+ });
16611
+ }
16612
+ targets.push({
16613
+ path: (0, import_node_path3.join)(foundDir, "AGENTS.md"),
16614
+ kind: "agents-md-companion",
16615
+ isAgentsMdCompanion: true
16616
+ });
16617
+ return targets;
16618
+ }
16619
+ case "generic": {
16620
+ if (agent.infoFilePath) {
16621
+ targets.push({
16622
+ path: agent.infoFilePath,
16623
+ kind: "primary",
16624
+ isAgentsMdCompanion: true
16625
+ });
16626
+ }
16627
+ return targets;
16628
+ }
16629
+ default: {
16630
+ const _exhaustive = agent.name;
16631
+ throw new Error(`Unknown agent: ${_exhaustive}`);
16632
+ }
16633
+ }
16634
+ }
16635
+ async function writeManagedSectionToTarget(filePath, createContent, managedSectionOnly) {
16636
+ let existingContent = null;
16637
+ try {
16638
+ existingContent = await (0, import_promises3.readFile)(filePath, "utf-8");
16639
+ } catch (err) {
16640
+ const code = err.code;
16641
+ if (code !== "ENOENT") {
16642
+ emitTargetWarning(filePath, "read", err);
16643
+ return;
16644
+ }
16645
+ }
16646
+ if (existingContent === null) {
16647
+ try {
16648
+ await (0, import_promises3.mkdir)((0, import_node_path3.dirname)(filePath), { recursive: true });
16649
+ await (0, import_promises3.writeFile)(filePath, createContent, "utf-8");
16650
+ } catch (err) {
16651
+ emitTargetWarning(filePath, "write", err);
16652
+ return;
16653
+ }
16654
+ return;
16655
+ }
16656
+ const lines = existingContent.split("\n");
16657
+ const boundaries = findMarkerBoundaries(lines);
16658
+ let newContent;
16659
+ if (boundaries !== null) {
16660
+ const before = lines.slice(0, boundaries.startIdx);
16661
+ const after = lines.slice(boundaries.endIdx + 1);
16662
+ const contentWithoutTrailingNewline = managedSectionOnly.endsWith("\n") ? managedSectionOnly.slice(0, -1) : managedSectionOnly;
16663
+ newContent = [...before, contentWithoutTrailingNewline, ...after].join(
16664
+ "\n"
16665
+ );
16666
+ } else {
16667
+ const separator = existingContent.endsWith("\n") ? "\n" : "\n\n";
16668
+ newContent = existingContent + separator + managedSectionOnly;
16669
+ }
16670
+ try {
16671
+ await (0, import_promises3.writeFile)(filePath, newContent, "utf-8");
16672
+ } catch (err) {
16673
+ emitTargetWarning(filePath, "write", err);
16674
+ }
16675
+ }
16676
+ function emitTargetWarning(filePath, op, err) {
16677
+ const code = err.code;
16678
+ let qualifier;
16679
+ switch (code) {
16680
+ case "EACCES":
16681
+ case "EPERM":
16682
+ qualifier = "permission denied";
16683
+ break;
16684
+ case "EROFS":
16685
+ qualifier = "filesystem read-only";
16686
+ break;
16687
+ case "ENOSPC":
16688
+ qualifier = "disk full";
16689
+ break;
16690
+ case "ENAMETOOLONG":
16691
+ qualifier = "path too long";
16692
+ break;
16693
+ case "ENOTDIR":
16694
+ qualifier = "not a directory";
16695
+ break;
16696
+ case "EISDIR":
16697
+ qualifier = "is a directory";
16698
+ break;
16699
+ default:
16700
+ qualifier = "I/O error";
16701
+ break;
16702
+ }
16703
+ try {
16704
+ process.stderr.write(
16705
+ `Warning: cannot ${op} info file ${filePath}: ${qualifier}
16706
+ `
16707
+ );
16708
+ } catch {
16709
+ }
16710
+ }
16711
+ var import_promises3, import_node_path3;
16712
+ var init_inject_all_targets = __esm({
16713
+ "src/agent-detection/inject-all-targets.ts"() {
16714
+ "use strict";
16715
+ import_promises3 = require("node:fs/promises");
16716
+ import_node_path3 = require("node:path");
16717
+ init_configs();
16718
+ init_inject();
16719
+ }
16720
+ });
16721
+
15724
16722
  // src/cli/monorepo.ts
15725
16723
  var monorepo_exports = {};
15726
16724
  __export(monorepo_exports, {
@@ -16873,9 +17871,14 @@ var init_uninit = __esm({
16873
17871
  init_inject();
16874
17872
  MCP_CONFIG_FILES = [".mcp.json", ".cursor/mcp.json", ".gemini/settings.json"];
16875
17873
  AGENT_INFO_FILES = [
17874
+ "AGENTS.md",
16876
17875
  "CLAUDE.md",
17876
+ "GEMINI.md",
17877
+ ".cursor/rules/glasstrace.mdc",
17878
+ ".windsurf/rules/glasstrace.md",
17879
+ ".cursorrules",
16877
17880
  "codex.md",
16878
- ".cursorrules"
17881
+ ".windsurfrules"
16879
17882
  ];
16880
17883
  }
16881
17884
  });
@@ -17026,14 +18029,9 @@ async function mcpAdd(options) {
17026
18029
  const bearer = resolved.effective.key;
17027
18030
  for (const agent of targetAgents) {
17028
18031
  const name = formatAgentName(agent.name);
17029
- const sdkVersion = true ? "1.10.2" : "0.0.0-dev";
17030
18032
  if (agent.name !== "generic") {
17031
18033
  const cliSuccess = await registerViaCli(agent, bearer);
17032
18034
  if (cliSuccess) {
17033
- const infoContent = generateInfoSection(agent, MCP_ENDPOINT, sdkVersion);
17034
- if (infoContent !== "") {
17035
- await injectInfoSection(agent, infoContent, projectRoot);
17036
- }
17037
18035
  results.push({
17038
18036
  agent: agent.name,
17039
18037
  success: true,
@@ -17048,10 +18046,6 @@ async function mcpAdd(options) {
17048
18046
  const configContent = generateMcpConfig(agent, MCP_ENDPOINT, bearer);
17049
18047
  await writeMcpConfig(agent, configContent, projectRoot);
17050
18048
  if (fs6.existsSync(agent.mcpConfigPath)) {
17051
- const infoContent = generateInfoSection(agent, MCP_ENDPOINT, sdkVersion);
17052
- if (infoContent !== "") {
17053
- await injectInfoSection(agent, infoContent, projectRoot);
17054
- }
17055
18049
  results.push({
17056
18050
  agent: agent.name,
17057
18051
  success: true,
@@ -17084,6 +18078,34 @@ async function mcpAdd(options) {
17084
18078
  message: `${name}: No registration method available`
17085
18079
  });
17086
18080
  }
18081
+ const successfulAgentNames = new Set(
18082
+ results.filter((r) => r.success).map((r) => r.agent)
18083
+ );
18084
+ const agentsWithMcpReady = targetAgents.filter(
18085
+ (a) => successfulAgentNames.has(a.name)
18086
+ );
18087
+ const detectedNonGenericMcpAdd = targetAgents.filter(
18088
+ (a) => a.name !== "generic"
18089
+ );
18090
+ const nonGenericReadyMcpAdd = agentsWithMcpReady.filter(
18091
+ (a) => a.name !== "generic"
18092
+ );
18093
+ const dispatchSetMcpAdd = detectedNonGenericMcpAdd.length === 0 ? agentsWithMcpReady : nonGenericReadyMcpAdd;
18094
+ if (dispatchSetMcpAdd.length > 0) {
18095
+ const sdkVersion = true ? "1.12.0" : "0.0.0-dev";
18096
+ try {
18097
+ await injectAllTargets(
18098
+ dispatchSetMcpAdd,
18099
+ MCP_ENDPOINT,
18100
+ sdkVersion,
18101
+ projectRoot
18102
+ );
18103
+ } catch (injectErr) {
18104
+ messages.push(
18105
+ `Warning: Failed to write some agent-instruction files: ${injectErr instanceof Error ? injectErr.message : String(injectErr)}`
18106
+ );
18107
+ }
18108
+ }
17087
18109
  await updateGitignore(
17088
18110
  [".mcp.json", ".cursor/mcp.json", ".gemini/settings.json", ".codex/config.toml"],
17089
18111
  projectRoot
@@ -17139,6 +18161,7 @@ var init_mcp_add = __esm({
17139
18161
  init_mcp_runtime();
17140
18162
  init_detect();
17141
18163
  init_configs();
18164
+ init_inject_all_targets();
17142
18165
  init_inject();
17143
18166
  init_constants();
17144
18167
  execFileAsync = (0, import_node_util.promisify)(import_node_child_process2.execFile);
@@ -17273,9 +18296,41 @@ var upgrade_instructions_exports = {};
17273
18296
  __export(upgrade_instructions_exports, {
17274
18297
  runUpgradeInstructions: () => runUpgradeInstructions
17275
18298
  });
18299
+ function legacyDestinationsForAgent(agent) {
18300
+ if (agent.infoFilePath === null) {
18301
+ return [];
18302
+ }
18303
+ switch (agent.name) {
18304
+ case "codex":
18305
+ return [(0, import_node_path4.join)((0, import_node_path4.dirname)(agent.infoFilePath), "codex.md")];
18306
+ case "cursor":
18307
+ return [
18308
+ (0, import_node_path4.join)((0, import_node_path4.dirname)((0, import_node_path4.dirname)((0, import_node_path4.dirname)(agent.infoFilePath))), ".cursorrules")
18309
+ ];
18310
+ case "windsurf":
18311
+ return [
18312
+ (0, import_node_path4.join)(
18313
+ (0, import_node_path4.dirname)((0, import_node_path4.dirname)((0, import_node_path4.dirname)(agent.infoFilePath))),
18314
+ ".windsurfrules"
18315
+ )
18316
+ ];
18317
+ case "claude":
18318
+ case "gemini":
18319
+ case "generic":
18320
+ return [];
18321
+ }
18322
+ }
18323
+ async function anyHasManagedSection(paths) {
18324
+ for (const p of paths) {
18325
+ if (await hasManagedSection(p)) {
18326
+ return true;
18327
+ }
18328
+ }
18329
+ return false;
18330
+ }
17276
18331
  function formatPathForOutput(filePath, projectRoot) {
17277
- const rel = (0, import_node_path3.relative)(projectRoot, filePath);
17278
- if (rel === "" || rel.startsWith("..") || (0, import_node_path3.isAbsolute)(rel)) {
18332
+ const rel = (0, import_node_path4.relative)(projectRoot, filePath);
18333
+ if (rel === "" || rel.startsWith("..") || (0, import_node_path4.isAbsolute)(rel)) {
17279
18334
  return filePath;
17280
18335
  }
17281
18336
  return rel;
@@ -17294,7 +18349,8 @@ async function runUpgradeInstructions(options) {
17294
18349
  );
17295
18350
  return { exitCode: 1, refreshed, skipped, warnings, errors };
17296
18351
  }
17297
- const sdkVersion = true ? "1.10.2" : "0.0.0-dev";
18352
+ const sdkVersion = true ? "1.12.0" : "0.0.0-dev";
18353
+ const optedInAgents = [];
17298
18354
  for (const agent of agents) {
17299
18355
  if (agent.infoFilePath === null) {
17300
18356
  continue;
@@ -17303,44 +18359,64 @@ async function runUpgradeInstructions(options) {
17303
18359
  agent.infoFilePath,
17304
18360
  options.projectRoot
17305
18361
  );
17306
- let containsSection;
18362
+ const legacyDestinations = legacyDestinationsForAgent(agent);
18363
+ let optedIn;
17307
18364
  try {
17308
- containsSection = await hasManagedSection(agent.infoFilePath);
18365
+ optedIn = await anyHasManagedSection([
18366
+ agent.infoFilePath,
18367
+ ...legacyDestinations
18368
+ ]);
17309
18369
  } catch (err) {
17310
18370
  warnings.push(
17311
18371
  `Could not inspect ${displayPath}: ${err instanceof Error ? err.message : String(err)}`
17312
18372
  );
17313
18373
  continue;
17314
18374
  }
17315
- if (!containsSection) {
18375
+ if (!optedIn) {
17316
18376
  skipped.push(displayPath);
17317
18377
  continue;
17318
18378
  }
17319
- const content = generateInfoSection(agent, MCP_ENDPOINT, sdkVersion);
17320
- if (content === "") {
17321
- continue;
17322
- }
18379
+ optedInAgents.push(agent);
18380
+ }
18381
+ if (optedInAgents.length > 0) {
17323
18382
  try {
17324
- await injectInfoSection(agent, content, options.projectRoot);
17325
- refreshed.push(displayPath);
18383
+ await injectAllTargets(
18384
+ optedInAgents,
18385
+ MCP_ENDPOINT,
18386
+ sdkVersion,
18387
+ options.projectRoot
18388
+ );
18389
+ for (const a of optedInAgents) {
18390
+ if (a.infoFilePath !== null) {
18391
+ refreshed.push(formatPathForOutput(a.infoFilePath, options.projectRoot));
18392
+ }
18393
+ }
17326
18394
  } catch (err) {
17327
18395
  errors.push(
17328
- `Failed to refresh ${displayPath}: ${err instanceof Error ? err.message : String(err)}`
18396
+ `Failed to refresh agent-instruction files: ${err instanceof Error ? err.message : String(err)}`
17329
18397
  );
17330
18398
  }
17331
18399
  }
18400
+ const refreshedSet = new Set(refreshed);
18401
+ const dedupedSkipped = skipped.filter((p) => !refreshedSet.has(p));
17332
18402
  const exitCode = errors.length === 0 ? 0 : 1;
17333
- return { exitCode, refreshed, skipped, warnings, errors };
18403
+ return {
18404
+ exitCode,
18405
+ refreshed,
18406
+ skipped: dedupedSkipped,
18407
+ warnings,
18408
+ errors
18409
+ };
17334
18410
  }
17335
- var import_node_path3;
18411
+ var import_node_path4;
17336
18412
  var init_upgrade_instructions = __esm({
17337
18413
  "src/cli/upgrade-instructions.ts"() {
17338
18414
  "use strict";
17339
- import_node_path3 = require("node:path");
18415
+ import_node_path4 = require("node:path");
17340
18416
  init_mcp_runtime();
17341
18417
  init_detect();
17342
- init_configs();
17343
18418
  init_inject();
18419
+ init_inject_all_targets();
17344
18420
  }
17345
18421
  });
17346
18422
 
@@ -17528,9 +18604,14 @@ var init_status = __esm({
17528
18604
  MCP_JSON_FILES = [".mcp.json", ".cursor/mcp.json", ".gemini/settings.json", ".glasstrace/mcp.json"];
17529
18605
  MCP_TOML_FILES = [".codex/config.toml"];
17530
18606
  AGENT_INFO_FILES2 = [
18607
+ "AGENTS.md",
17531
18608
  "CLAUDE.md",
18609
+ "GEMINI.md",
18610
+ ".cursor/rules/glasstrace.mdc",
18611
+ ".windsurf/rules/glasstrace.md",
18612
+ ".cursorrules",
17532
18613
  "codex.md",
17533
- ".cursorrules"
18614
+ ".windsurfrules"
17534
18615
  ];
17535
18616
  INSTRUMENTATION_FILES = [
17536
18617
  "instrumentation.ts",
@@ -18112,6 +19193,7 @@ async function buildImportGraph(projectRoot) {
18112
19193
  init_anon_key();
18113
19194
  init_detect();
18114
19195
  init_configs();
19196
+ init_inject_all_targets();
18115
19197
  init_inject();
18116
19198
  init_constants();
18117
19199
  init_monorepo();
@@ -18393,9 +19475,9 @@ async function sendInitRequest(config2, anonKey, sdkVersion, importGraph, health
18393
19475
  });
18394
19476
  } catch (err) {
18395
19477
  if (err instanceof HttpsStatusError) {
18396
- const error48 = new Error(`Init request failed with status ${err.status}`);
18397
- error48.status = err.status;
18398
- throw error48;
19478
+ const error51 = new Error(`Init request failed with status ${err.status}`);
19479
+ error51.status = err.status;
19480
+ throw error51;
18399
19481
  }
18400
19482
  if (err instanceof HttpsBodyParseError) {
18401
19483
  const cause = err.cause;
@@ -18910,6 +19992,7 @@ Then add this as the first statement in your register() function:
18910
19992
  agents = [];
18911
19993
  }
18912
19994
  const configuredNames = [];
19995
+ const agentsWithMcpReady = [];
18913
19996
  for (const agent of agents) {
18914
19997
  try {
18915
19998
  const configContent = generateMcpConfig(agent, MCP_ENDPOINT, bearer);
@@ -18924,6 +20007,7 @@ Then add this as the first statement in your register() function:
18924
20007
  );
18925
20008
  if (agent.mcpConfigPath !== null && fs9.existsSync(agent.mcpConfigPath)) {
18926
20009
  anyConfigWritten = true;
20010
+ agentsWithMcpReady.push(agent);
18927
20011
  }
18928
20012
  continue;
18929
20013
  }
@@ -18934,15 +20018,7 @@ Then add this as the first statement in your register() function:
18934
20018
  }
18935
20019
  anyConfigWritten = true;
18936
20020
  anyConfigRewrittenWithBearer = true;
18937
- const sdkVersionForInject = true ? "1.10.2" : "0.0.0-dev";
18938
- const infoContent = generateInfoSection(
18939
- agent,
18940
- MCP_ENDPOINT,
18941
- sdkVersionForInject
18942
- );
18943
- if (infoContent !== "") {
18944
- await injectInfoSection(agent, infoContent, projectRoot);
18945
- }
20021
+ agentsWithMcpReady.push(agent);
18946
20022
  if (agent.name !== "generic") {
18947
20023
  configuredNames.push(formatAgentName(agent.name));
18948
20024
  }
@@ -18952,6 +20028,26 @@ Then add this as the first statement in your register() function:
18952
20028
  );
18953
20029
  }
18954
20030
  }
20031
+ const detectedNonGeneric = agents.filter((a) => a.name !== "generic");
20032
+ const nonGenericReady = agentsWithMcpReady.filter(
20033
+ (a) => a.name !== "generic"
20034
+ );
20035
+ const dispatchSet = detectedNonGeneric.length === 0 ? agentsWithMcpReady : nonGenericReady;
20036
+ if (dispatchSet.length > 0) {
20037
+ const sdkVersionForInject = true ? "1.12.0" : "0.0.0-dev";
20038
+ try {
20039
+ await injectAllTargets(
20040
+ dispatchSet,
20041
+ MCP_ENDPOINT,
20042
+ sdkVersionForInject,
20043
+ projectRoot
20044
+ );
20045
+ } catch (injectErr) {
20046
+ warnings.push(
20047
+ `Failed to write agent-instruction files: ${injectErr instanceof Error ? injectErr.message : String(injectErr)}`
20048
+ );
20049
+ }
20050
+ }
18955
20051
  if (configuredNames.length > 0) {
18956
20052
  summary.push(`Configured MCP for: ${configuredNames.join(", ")}`);
18957
20053
  } else if (anyConfigWritten) {
@@ -19040,7 +20136,7 @@ async function verifyAnonKeyRegistration(projectRoot) {
19040
20136
  }
19041
20137
  const baseConfig = resolveConfig({ apiKey: devKey });
19042
20138
  const config2 = { ...baseConfig, apiKey: devKey };
19043
- const sdkVersion = true ? "1.10.2" : "0.0.0-dev";
20139
+ const sdkVersion = true ? "1.12.0" : "0.0.0-dev";
19044
20140
  const result = await verifyInitReachable(config2, anonKey, sdkVersion);
19045
20141
  if (result.ok) {
19046
20142
  return { outcome: "verified" };