@storm-software/git-tools 2.120.0 → 2.121.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 (57) hide show
  1. package/README.md +1 -1
  2. package/bin/{chunk-FEIWTHDN.cjs → chunk-7V324BCR.cjs} +347 -297
  3. package/bin/{chunk-VATYGW5F.js → chunk-XJZXOYRK.js} +346 -296
  4. package/bin/git.cjs +143 -99
  5. package/bin/git.js +73 -29
  6. package/bin/post-checkout.cjs +9 -9
  7. package/bin/post-checkout.js +1 -1
  8. package/bin/post-commit.cjs +9 -9
  9. package/bin/post-commit.js +1 -1
  10. package/bin/post-merge.cjs +9 -9
  11. package/bin/post-merge.js +1 -1
  12. package/bin/pre-commit.cjs +9 -9
  13. package/bin/pre-commit.js +1 -1
  14. package/bin/pre-install.cjs +9 -9
  15. package/bin/pre-install.js +1 -1
  16. package/bin/pre-push.cjs +13 -13
  17. package/bin/pre-push.js +1 -1
  18. package/bin/prepare.cjs +7 -7
  19. package/bin/prepare.js +1 -1
  20. package/bin/version-warning.cjs +5 -5
  21. package/bin/version-warning.js +1 -1
  22. package/dist/{chunk-C4NLID2V.js → chunk-25G45MG4.js} +1 -1
  23. package/dist/{chunk-LSRFGWF5.js → chunk-2IQTQBAX.js} +1 -1
  24. package/dist/chunk-2RKFQIWE.cjs +19 -0
  25. package/dist/{chunk-ZE542BCU.cjs → chunk-2SHAD3P5.cjs} +5 -2
  26. package/dist/{chunk-5XXXTVPU.js → chunk-GRCMQK4Q.js} +5 -2
  27. package/dist/{chunk-NWZD3QTO.cjs → chunk-RG47FAF4.cjs} +3 -3
  28. package/dist/commit/minimal.cjs +5 -5
  29. package/dist/commit/minimal.d.cts +1 -0
  30. package/dist/commit/minimal.d.ts +1 -0
  31. package/dist/commit/minimal.js +1 -1
  32. package/dist/commit/monorepo.cjs +3 -3
  33. package/dist/commit/monorepo.d.cts +1 -0
  34. package/dist/commit/monorepo.d.ts +1 -0
  35. package/dist/commit/monorepo.js +2 -2
  36. package/dist/commitlint/minimal.cjs +3 -12
  37. package/dist/commitlint/minimal.d.cts +1 -9
  38. package/dist/commitlint/minimal.d.ts +1 -9
  39. package/dist/commitlint/minimal.js +2 -11
  40. package/dist/commitlint/monorepo.cjs +3 -12
  41. package/dist/commitlint/monorepo.d.cts +1 -9
  42. package/dist/commitlint/monorepo.d.ts +1 -9
  43. package/dist/commitlint/monorepo.js +2 -11
  44. package/dist/index.cjs +4 -6
  45. package/dist/index.d.cts +2 -1
  46. package/dist/index.d.ts +2 -1
  47. package/dist/index.js +3 -5
  48. package/dist/release/config.cjs +3 -3
  49. package/dist/release/config.d.cts +4 -3
  50. package/dist/release/config.d.ts +4 -3
  51. package/dist/release/config.js +2 -2
  52. package/dist/types.cjs +2 -4
  53. package/dist/types.d.cts +4 -143
  54. package/dist/types.d.ts +4 -143
  55. package/dist/types.js +1 -3
  56. package/package.json +12 -5
  57. package/dist/chunk-KD6Y4AJS.cjs +0 -19
@@ -371,7 +371,7 @@ function config(newConfig) {
371
371
  return globalConfig;
372
372
  }
373
373
 
374
- // ../../node_modules/.pnpm/zod@4.0.5/node_modules/zod/v4/core/util.js
374
+ // ../../node_modules/.pnpm/zod@4.1.8/node_modules/zod/v4/core/util.js
375
375
  var util_exports = {};
376
376
  __export(util_exports, {
377
377
  BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
@@ -385,11 +385,14 @@ __export(util_exports, {
385
385
  assertNever: () => assertNever,
386
386
  assertNotEqual: () => assertNotEqual,
387
387
  assignProp: () => assignProp,
388
+ base64ToUint8Array: () => base64ToUint8Array,
389
+ base64urlToUint8Array: () => base64urlToUint8Array,
388
390
  cached: () => cached,
389
391
  captureStackTrace: () => captureStackTrace,
390
392
  cleanEnum: () => cleanEnum,
391
393
  cleanRegex: () => cleanRegex,
392
394
  clone: () => clone,
395
+ cloneDef: () => cloneDef,
393
396
  createTransparentProxy: () => createTransparentProxy,
394
397
  defineLazy: () => defineLazy,
395
398
  esc: () => esc,
@@ -402,15 +405,18 @@ __export(util_exports, {
402
405
  getLengthableOrigin: () => getLengthableOrigin,
403
406
  getParsedType: () => getParsedType,
404
407
  getSizableOrigin: () => getSizableOrigin,
408
+ hexToUint8Array: () => hexToUint8Array,
405
409
  isObject: () => isObject,
406
410
  isPlainObject: () => isPlainObject,
407
411
  issue: () => issue,
408
412
  joinValues: () => joinValues,
409
413
  jsonStringifyReplacer: () => jsonStringifyReplacer,
410
414
  merge: () => merge,
415
+ mergeDefs: () => mergeDefs,
411
416
  normalizeParams: () => normalizeParams,
412
417
  nullish: () => nullish,
413
418
  numKeys: () => numKeys,
419
+ objectClone: () => objectClone,
414
420
  omit: () => omit,
415
421
  optionalKeys: () => optionalKeys,
416
422
  partial: () => partial,
@@ -421,7 +427,12 @@ __export(util_exports, {
421
427
  propertyKeyTypes: () => propertyKeyTypes,
422
428
  randomString: () => randomString,
423
429
  required: () => required,
430
+ safeExtend: () => safeExtend,
431
+ shallowClone: () => shallowClone,
424
432
  stringifyPrimitive: () => stringifyPrimitive,
433
+ uint8ArrayToBase64: () => uint8ArrayToBase64,
434
+ uint8ArrayToBase64url: () => uint8ArrayToBase64url,
435
+ uint8ArrayToHex: () => uint8ArrayToHex,
425
436
  unwrapMessage: () => unwrapMessage
426
437
  });
427
438
  function assertEqual(val) {
@@ -471,20 +482,32 @@ function cleanRegex(source) {
471
482
  }
472
483
  function floatSafeRemainder(val, step) {
473
484
  const valDecCount = (val.toString().split(".")[1] || "").length;
474
- const stepDecCount = (step.toString().split(".")[1] || "").length;
485
+ const stepString = step.toString();
486
+ let stepDecCount = (stepString.split(".")[1] || "").length;
487
+ if (stepDecCount === 0 && /\d?e-\d?/.test(stepString)) {
488
+ const match = stepString.match(/\d?e-(\d?)/);
489
+ if (match?.[1]) {
490
+ stepDecCount = Number.parseInt(match[1]);
491
+ }
492
+ }
475
493
  const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
476
494
  const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
477
495
  const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
478
496
  return valInt % stepInt / 10 ** decCount;
479
497
  }
498
+ var EVALUATING = Symbol("evaluating");
480
499
  function defineLazy(object2, key, getter) {
500
+ let value = void 0;
481
501
  Object.defineProperty(object2, key, {
482
502
  get() {
483
- {
484
- const value = getter();
485
- object2[key] = value;
486
- return value;
503
+ if (value === EVALUATING) {
504
+ return void 0;
487
505
  }
506
+ if (value === void 0) {
507
+ value = EVALUATING;
508
+ value = getter();
509
+ }
510
+ return value;
488
511
  },
489
512
  set(v) {
490
513
  Object.defineProperty(object2, key, {
@@ -495,6 +518,9 @@ function defineLazy(object2, key, getter) {
495
518
  configurable: true
496
519
  });
497
520
  }
521
+ function objectClone(obj) {
522
+ return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));
523
+ }
498
524
  function assignProp(target, prop, value) {
499
525
  Object.defineProperty(target, prop, {
500
526
  value,
@@ -503,6 +529,17 @@ function assignProp(target, prop, value) {
503
529
  configurable: true
504
530
  });
505
531
  }
532
+ function mergeDefs(...defs) {
533
+ const mergedDescriptors = {};
534
+ for (const def of defs) {
535
+ const descriptors = Object.getOwnPropertyDescriptors(def);
536
+ Object.assign(mergedDescriptors, descriptors);
537
+ }
538
+ return Object.defineProperties({}, mergedDescriptors);
539
+ }
540
+ function cloneDef(schema) {
541
+ return mergeDefs(schema._zod.def);
542
+ }
506
543
  function getElementAtPath(obj, path) {
507
544
  if (!path)
508
545
  return obj;
@@ -530,7 +567,7 @@ function randomString(length = 10) {
530
567
  function esc(str) {
531
568
  return JSON.stringify(str);
532
569
  }
533
- var captureStackTrace = Error.captureStackTrace ? Error.captureStackTrace : (..._args) => {
570
+ var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
534
571
  };
535
572
  function isObject(data) {
536
573
  return typeof data === "object" && data !== null && !Array.isArray(data);
@@ -561,6 +598,13 @@ function isPlainObject(o) {
561
598
  }
562
599
  return true;
563
600
  }
601
+ function shallowClone(o) {
602
+ if (isPlainObject(o))
603
+ return { ...o };
604
+ if (Array.isArray(o))
605
+ return [...o];
606
+ return o;
607
+ }
564
608
  function numKeys(data) {
565
609
  let keyCount = 0;
566
610
  for (const key in data) {
@@ -698,43 +742,68 @@ var BIGINT_FORMAT_RANGES = {
698
742
  uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
699
743
  };
700
744
  function pick(schema, mask) {
701
- const newShape = {};
702
745
  const currDef = schema._zod.def;
703
- for (const key in mask) {
704
- if (!(key in currDef.shape)) {
705
- throw new Error(`Unrecognized key: "${key}"`);
706
- }
707
- if (!mask[key])
708
- continue;
709
- newShape[key] = currDef.shape[key];
710
- }
711
- return clone(schema, {
712
- ...schema._zod.def,
713
- shape: newShape,
746
+ const def = mergeDefs(schema._zod.def, {
747
+ get shape() {
748
+ const newShape = {};
749
+ for (const key in mask) {
750
+ if (!(key in currDef.shape)) {
751
+ throw new Error(`Unrecognized key: "${key}"`);
752
+ }
753
+ if (!mask[key])
754
+ continue;
755
+ newShape[key] = currDef.shape[key];
756
+ }
757
+ assignProp(this, "shape", newShape);
758
+ return newShape;
759
+ },
714
760
  checks: []
715
761
  });
762
+ return clone(schema, def);
716
763
  }
717
764
  function omit(schema, mask) {
718
- const newShape = { ...schema._zod.def.shape };
719
765
  const currDef = schema._zod.def;
720
- for (const key in mask) {
721
- if (!(key in currDef.shape)) {
722
- throw new Error(`Unrecognized key: "${key}"`);
723
- }
724
- if (!mask[key])
725
- continue;
726
- delete newShape[key];
727
- }
728
- return clone(schema, {
729
- ...schema._zod.def,
730
- shape: newShape,
766
+ const def = mergeDefs(schema._zod.def, {
767
+ get shape() {
768
+ const newShape = { ...schema._zod.def.shape };
769
+ for (const key in mask) {
770
+ if (!(key in currDef.shape)) {
771
+ throw new Error(`Unrecognized key: "${key}"`);
772
+ }
773
+ if (!mask[key])
774
+ continue;
775
+ delete newShape[key];
776
+ }
777
+ assignProp(this, "shape", newShape);
778
+ return newShape;
779
+ },
731
780
  checks: []
732
781
  });
782
+ return clone(schema, def);
733
783
  }
734
784
  function extend(schema, shape) {
735
785
  if (!isPlainObject(shape)) {
736
786
  throw new Error("Invalid input to extend: expected a plain object");
737
787
  }
788
+ const checks = schema._zod.def.checks;
789
+ const hasChecks = checks && checks.length > 0;
790
+ if (hasChecks) {
791
+ throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
792
+ }
793
+ const def = mergeDefs(schema._zod.def, {
794
+ get shape() {
795
+ const _shape = { ...schema._zod.def.shape, ...shape };
796
+ assignProp(this, "shape", _shape);
797
+ return _shape;
798
+ },
799
+ checks: []
800
+ });
801
+ return clone(schema, def);
802
+ }
803
+ function safeExtend(schema, shape) {
804
+ if (!isPlainObject(shape)) {
805
+ throw new Error("Invalid input to safeExtend: expected a plain object");
806
+ }
738
807
  const def = {
739
808
  ...schema._zod.def,
740
809
  get shape() {
@@ -742,87 +811,96 @@ function extend(schema, shape) {
742
811
  assignProp(this, "shape", _shape);
743
812
  return _shape;
744
813
  },
745
- checks: []
746
- // delete existing checks
814
+ checks: schema._zod.def.checks
747
815
  };
748
816
  return clone(schema, def);
749
817
  }
750
818
  function merge(a, b) {
751
- return clone(a, {
752
- ...a._zod.def,
819
+ const def = mergeDefs(a._zod.def, {
753
820
  get shape() {
754
821
  const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
755
822
  assignProp(this, "shape", _shape);
756
823
  return _shape;
757
824
  },
758
- catchall: b._zod.def.catchall,
825
+ get catchall() {
826
+ return b._zod.def.catchall;
827
+ },
759
828
  checks: []
760
829
  // delete existing checks
761
830
  });
831
+ return clone(a, def);
762
832
  }
763
833
  function partial(Class2, schema, mask) {
764
- const oldShape = schema._zod.def.shape;
765
- const shape = { ...oldShape };
766
- if (mask) {
767
- for (const key in mask) {
768
- if (!(key in oldShape)) {
769
- throw new Error(`Unrecognized key: "${key}"`);
834
+ const def = mergeDefs(schema._zod.def, {
835
+ get shape() {
836
+ const oldShape = schema._zod.def.shape;
837
+ const shape = { ...oldShape };
838
+ if (mask) {
839
+ for (const key in mask) {
840
+ if (!(key in oldShape)) {
841
+ throw new Error(`Unrecognized key: "${key}"`);
842
+ }
843
+ if (!mask[key])
844
+ continue;
845
+ shape[key] = Class2 ? new Class2({
846
+ type: "optional",
847
+ innerType: oldShape[key]
848
+ }) : oldShape[key];
849
+ }
850
+ } else {
851
+ for (const key in oldShape) {
852
+ shape[key] = Class2 ? new Class2({
853
+ type: "optional",
854
+ innerType: oldShape[key]
855
+ }) : oldShape[key];
856
+ }
770
857
  }
771
- if (!mask[key])
772
- continue;
773
- shape[key] = Class2 ? new Class2({
774
- type: "optional",
775
- innerType: oldShape[key]
776
- }) : oldShape[key];
777
- }
778
- } else {
779
- for (const key in oldShape) {
780
- shape[key] = Class2 ? new Class2({
781
- type: "optional",
782
- innerType: oldShape[key]
783
- }) : oldShape[key];
784
- }
785
- }
786
- return clone(schema, {
787
- ...schema._zod.def,
788
- shape,
858
+ assignProp(this, "shape", shape);
859
+ return shape;
860
+ },
789
861
  checks: []
790
862
  });
863
+ return clone(schema, def);
791
864
  }
792
865
  function required(Class2, schema, mask) {
793
- const oldShape = schema._zod.def.shape;
794
- const shape = { ...oldShape };
795
- if (mask) {
796
- for (const key in mask) {
797
- if (!(key in shape)) {
798
- throw new Error(`Unrecognized key: "${key}"`);
866
+ const def = mergeDefs(schema._zod.def, {
867
+ get shape() {
868
+ const oldShape = schema._zod.def.shape;
869
+ const shape = { ...oldShape };
870
+ if (mask) {
871
+ for (const key in mask) {
872
+ if (!(key in shape)) {
873
+ throw new Error(`Unrecognized key: "${key}"`);
874
+ }
875
+ if (!mask[key])
876
+ continue;
877
+ shape[key] = new Class2({
878
+ type: "nonoptional",
879
+ innerType: oldShape[key]
880
+ });
881
+ }
882
+ } else {
883
+ for (const key in oldShape) {
884
+ shape[key] = new Class2({
885
+ type: "nonoptional",
886
+ innerType: oldShape[key]
887
+ });
888
+ }
799
889
  }
800
- if (!mask[key])
801
- continue;
802
- shape[key] = new Class2({
803
- type: "nonoptional",
804
- innerType: oldShape[key]
805
- });
806
- }
807
- } else {
808
- for (const key in oldShape) {
809
- shape[key] = new Class2({
810
- type: "nonoptional",
811
- innerType: oldShape[key]
812
- });
813
- }
814
- }
815
- return clone(schema, {
816
- ...schema._zod.def,
817
- shape,
818
- // optional: [],
890
+ assignProp(this, "shape", shape);
891
+ return shape;
892
+ },
819
893
  checks: []
820
894
  });
895
+ return clone(schema, def);
821
896
  }
822
897
  function aborted(x, startIndex = 0) {
898
+ if (x.aborted === true)
899
+ return true;
823
900
  for (let i = startIndex; i < x.issues.length; i++) {
824
- if (x.issues[i]?.continue !== true)
901
+ if (x.issues[i]?.continue !== true) {
825
902
  return true;
903
+ }
826
904
  }
827
905
  return false;
828
906
  }
@@ -883,12 +961,49 @@ function cleanEnum(obj) {
883
961
  return Number.isNaN(Number.parseInt(k, 10));
884
962
  }).map((el) => el[1]);
885
963
  }
964
+ function base64ToUint8Array(base642) {
965
+ const binaryString = atob(base642);
966
+ const bytes = new Uint8Array(binaryString.length);
967
+ for (let i = 0; i < binaryString.length; i++) {
968
+ bytes[i] = binaryString.charCodeAt(i);
969
+ }
970
+ return bytes;
971
+ }
972
+ function uint8ArrayToBase64(bytes) {
973
+ let binaryString = "";
974
+ for (let i = 0; i < bytes.length; i++) {
975
+ binaryString += String.fromCharCode(bytes[i]);
976
+ }
977
+ return btoa(binaryString);
978
+ }
979
+ function base64urlToUint8Array(base64url2) {
980
+ const base642 = base64url2.replace(/-/g, "+").replace(/_/g, "/");
981
+ const padding = "=".repeat((4 - base642.length % 4) % 4);
982
+ return base64ToUint8Array(base642 + padding);
983
+ }
984
+ function uint8ArrayToBase64url(bytes) {
985
+ return uint8ArrayToBase64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
986
+ }
987
+ function hexToUint8Array(hex) {
988
+ const cleanHex = hex.replace(/^0x/, "");
989
+ if (cleanHex.length % 2 !== 0) {
990
+ throw new Error("Invalid hex string length");
991
+ }
992
+ const bytes = new Uint8Array(cleanHex.length / 2);
993
+ for (let i = 0; i < cleanHex.length; i += 2) {
994
+ bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);
995
+ }
996
+ return bytes;
997
+ }
998
+ function uint8ArrayToHex(bytes) {
999
+ return Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
1000
+ }
886
1001
  var Class = class {
887
1002
  constructor(..._args) {
888
1003
  }
889
1004
  };
890
1005
 
891
- // ../../node_modules/.pnpm/zod@4.0.5/node_modules/zod/v4/core/errors.js
1006
+ // ../../node_modules/.pnpm/zod@4.1.8/node_modules/zod/v4/core/errors.js
892
1007
  var initializer = (inst, def) => {
893
1008
  inst.name = "$ZodError";
894
1009
  Object.defineProperty(inst, "_zod", {
@@ -899,13 +1014,7 @@ var initializer = (inst, def) => {
899
1014
  value: def,
900
1015
  enumerable: false
901
1016
  });
902
- Object.defineProperty(inst, "message", {
903
- get() {
904
- return JSON.stringify(def, jsonStringifyReplacer, 2);
905
- },
906
- enumerable: true
907
- // configurable: false,
908
- });
1017
+ inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
909
1018
  Object.defineProperty(inst, "toString", {
910
1019
  value: () => inst.message,
911
1020
  enumerable: false
@@ -914,7 +1023,7 @@ var initializer = (inst, def) => {
914
1023
  var $ZodError = $constructor("$ZodError", initializer);
915
1024
  var $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
916
1025
 
917
- // ../../node_modules/.pnpm/zod@4.0.5/node_modules/zod/v4/core/parse.js
1026
+ // ../../node_modules/.pnpm/zod@4.1.8/node_modules/zod/v4/core/parse.js
918
1027
  var _parse = (_Err) => (schema, value, _ctx, _params) => {
919
1028
  const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
920
1029
  const result = schema._zod.run({ value, issues: [] }, ctx);
@@ -966,15 +1075,15 @@ var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
966
1075
  };
967
1076
  var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
968
1077
 
969
- // ../../node_modules/.pnpm/zod@4.0.5/node_modules/zod/v4/core/regexes.js
970
- var hostname = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;
1078
+ // ../../node_modules/.pnpm/zod@4.1.8/node_modules/zod/v4/core/regexes.js
1079
+ var 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])?)*\.?$/;
971
1080
  var string = (params) => {
972
1081
  const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
973
1082
  return new RegExp(`^${regex}$`);
974
1083
  };
975
- var boolean = /true|false/i;
1084
+ var boolean = /^(?:true|false)$/i;
976
1085
 
977
- // ../../node_modules/.pnpm/zod@4.0.5/node_modules/zod/v4/core/checks.js
1086
+ // ../../node_modules/.pnpm/zod@4.1.8/node_modules/zod/v4/core/checks.js
978
1087
  var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
979
1088
  var _a;
980
1089
  inst._zod ?? (inst._zod = {});
@@ -1066,50 +1175,14 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
1066
1175
  };
1067
1176
  });
1068
1177
 
1069
- // ../../node_modules/.pnpm/zod@4.0.5/node_modules/zod/v4/core/doc.js
1070
- var Doc = class {
1071
- constructor(args = []) {
1072
- this.content = [];
1073
- this.indent = 0;
1074
- if (this)
1075
- this.args = args;
1076
- }
1077
- indented(fn) {
1078
- this.indent += 1;
1079
- fn(this);
1080
- this.indent -= 1;
1081
- }
1082
- write(arg) {
1083
- if (typeof arg === "function") {
1084
- arg(this, { execution: "sync" });
1085
- arg(this, { execution: "async" });
1086
- return;
1087
- }
1088
- const content = arg;
1089
- const lines = content.split("\n").filter((x) => x);
1090
- const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
1091
- const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
1092
- for (const line of dedented) {
1093
- this.content.push(line);
1094
- }
1095
- }
1096
- compile() {
1097
- const F = Function;
1098
- const args = this?.args;
1099
- const content = this?.content ?? [``];
1100
- const lines = [...content.map((x) => ` ${x}`)];
1101
- return new F(...args, lines.join("\n"));
1102
- }
1103
- };
1104
-
1105
- // ../../node_modules/.pnpm/zod@4.0.5/node_modules/zod/v4/core/versions.js
1178
+ // ../../node_modules/.pnpm/zod@4.1.8/node_modules/zod/v4/core/versions.js
1106
1179
  var version = {
1107
1180
  major: 4,
1108
- minor: 0,
1109
- patch: 5
1181
+ minor: 1,
1182
+ patch: 8
1110
1183
  };
1111
1184
 
1112
- // ../../node_modules/.pnpm/zod@4.0.5/node_modules/zod/v4/core/schemas.js
1185
+ // ../../node_modules/.pnpm/zod@4.1.8/node_modules/zod/v4/core/schemas.js
1113
1186
  var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1114
1187
  var _a;
1115
1188
  inst ?? (inst = {});
@@ -1171,7 +1244,32 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1171
1244
  }
1172
1245
  return payload;
1173
1246
  };
1247
+ const handleCanaryResult = (canary, payload, ctx) => {
1248
+ if (aborted(canary)) {
1249
+ canary.aborted = true;
1250
+ return canary;
1251
+ }
1252
+ const checkResult = runChecks(payload, checks, ctx);
1253
+ if (checkResult instanceof Promise) {
1254
+ if (ctx.async === false)
1255
+ throw new $ZodAsyncError();
1256
+ return checkResult.then((checkResult2) => inst._zod.parse(checkResult2, ctx));
1257
+ }
1258
+ return inst._zod.parse(checkResult, ctx);
1259
+ };
1174
1260
  inst._zod.run = (payload, ctx) => {
1261
+ if (ctx.skipChecks) {
1262
+ return inst._zod.parse(payload, ctx);
1263
+ }
1264
+ if (ctx.direction === "backward") {
1265
+ const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });
1266
+ if (canary instanceof Promise) {
1267
+ return canary.then((canary2) => {
1268
+ return handleCanaryResult(canary2, payload, ctx);
1269
+ });
1270
+ }
1271
+ return handleCanaryResult(canary, payload, ctx);
1272
+ }
1175
1273
  const result = inst._zod.parse(payload, ctx);
1176
1274
  if (result instanceof Promise) {
1177
1275
  if (ctx.async === false)
@@ -1222,9 +1320,8 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
1222
1320
  $ZodStringFormat.init(inst, def);
1223
1321
  inst._zod.check = (payload) => {
1224
1322
  try {
1225
- const orig = payload.value;
1226
- const url2 = new URL(orig);
1227
- const href = url2.href;
1323
+ const trimmed = payload.value.trim();
1324
+ const url2 = new URL(trimmed);
1228
1325
  if (def.hostname) {
1229
1326
  def.hostname.lastIndex = 0;
1230
1327
  if (!def.hostname.test(url2.hostname)) {
@@ -1253,10 +1350,10 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
1253
1350
  });
1254
1351
  }
1255
1352
  }
1256
- if (!orig.endsWith("/") && href.endsWith("/")) {
1257
- payload.value = href.slice(0, -1);
1353
+ if (def.normalize) {
1354
+ payload.value = url2.href;
1258
1355
  } else {
1259
- payload.value = href;
1356
+ payload.value = trimmed;
1260
1357
  }
1261
1358
  return;
1262
1359
  } catch (_) {
@@ -1334,48 +1431,70 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
1334
1431
  return payload;
1335
1432
  };
1336
1433
  });
1337
- function handleObjectResult(result, final, key) {
1434
+ function handlePropertyResult(result, final, key, input) {
1338
1435
  if (result.issues.length) {
1339
1436
  final.issues.push(...prefixIssues(key, result.issues));
1340
1437
  }
1341
- final.value[key] = result.value;
1342
- }
1343
- function handleOptionalObjectResult(result, final, key, input) {
1344
- if (result.issues.length) {
1345
- if (input[key] === void 0) {
1346
- if (key in input) {
1347
- final.value[key] = void 0;
1348
- } else {
1349
- final.value[key] = result.value;
1350
- }
1351
- } else {
1352
- final.issues.push(...prefixIssues(key, result.issues));
1353
- }
1354
- } else if (result.value === void 0) {
1355
- if (key in input)
1438
+ if (result.value === void 0) {
1439
+ if (key in input) {
1356
1440
  final.value[key] = void 0;
1441
+ }
1357
1442
  } else {
1358
1443
  final.value[key] = result.value;
1359
1444
  }
1360
1445
  }
1361
- var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
1362
- $ZodType.init(inst, def);
1363
- const _normalized = cached(() => {
1364
- const keys = Object.keys(def.shape);
1365
- for (const k of keys) {
1366
- if (!(def.shape[k] instanceof $ZodType)) {
1367
- throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
1368
- }
1446
+ function normalizeDef(def) {
1447
+ const keys = Object.keys(def.shape);
1448
+ for (const k of keys) {
1449
+ if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) {
1450
+ throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
1369
1451
  }
1370
- const okeys = optionalKeys(def.shape);
1371
- return {
1372
- shape: def.shape,
1373
- keys,
1374
- keySet: new Set(keys),
1375
- numKeys: keys.length,
1376
- optionalKeys: new Set(okeys)
1377
- };
1452
+ }
1453
+ const okeys = optionalKeys(def.shape);
1454
+ return {
1455
+ ...def,
1456
+ keys,
1457
+ keySet: new Set(keys),
1458
+ numKeys: keys.length,
1459
+ optionalKeys: new Set(okeys)
1460
+ };
1461
+ }
1462
+ function handleCatchall(proms, input, payload, ctx, def, inst) {
1463
+ const unrecognized = [];
1464
+ const keySet = def.keySet;
1465
+ const _catchall = def.catchall._zod;
1466
+ const t = _catchall.def.type;
1467
+ for (const key of Object.keys(input)) {
1468
+ if (keySet.has(key))
1469
+ continue;
1470
+ if (t === "never") {
1471
+ unrecognized.push(key);
1472
+ continue;
1473
+ }
1474
+ const r = _catchall.run({ value: input[key], issues: [] }, ctx);
1475
+ if (r instanceof Promise) {
1476
+ proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input)));
1477
+ } else {
1478
+ handlePropertyResult(r, payload, key, input);
1479
+ }
1480
+ }
1481
+ if (unrecognized.length) {
1482
+ payload.issues.push({
1483
+ code: "unrecognized_keys",
1484
+ keys: unrecognized,
1485
+ input,
1486
+ inst
1487
+ });
1488
+ }
1489
+ if (!proms.length)
1490
+ return payload;
1491
+ return Promise.all(proms).then(() => {
1492
+ return payload;
1378
1493
  });
1494
+ }
1495
+ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
1496
+ $ZodType.init(inst, def);
1497
+ const _normalized = cached(() => normalizeDef(def));
1379
1498
  defineLazy(inst._zod, "propValues", () => {
1380
1499
  const shape = def.shape;
1381
1500
  const propValues = {};
@@ -1389,66 +1508,7 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
1389
1508
  }
1390
1509
  return propValues;
1391
1510
  });
1392
- const generateFastpass = (shape) => {
1393
- const doc = new Doc(["shape", "payload", "ctx"]);
1394
- const normalized = _normalized.value;
1395
- const parseStr = (key) => {
1396
- const k = esc(key);
1397
- return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
1398
- };
1399
- doc.write(`const input = payload.value;`);
1400
- const ids = /* @__PURE__ */ Object.create(null);
1401
- let counter = 0;
1402
- for (const key of normalized.keys) {
1403
- ids[key] = `key_${counter++}`;
1404
- }
1405
- doc.write(`const newResult = {}`);
1406
- for (const key of normalized.keys) {
1407
- if (normalized.optionalKeys.has(key)) {
1408
- const id = ids[key];
1409
- doc.write(`const ${id} = ${parseStr(key)};`);
1410
- const k = esc(key);
1411
- doc.write(`
1412
- if (${id}.issues.length) {
1413
- if (input[${k}] === undefined) {
1414
- if (${k} in input) {
1415
- newResult[${k}] = undefined;
1416
- }
1417
- } else {
1418
- payload.issues = payload.issues.concat(
1419
- ${id}.issues.map((iss) => ({
1420
- ...iss,
1421
- path: iss.path ? [${k}, ...iss.path] : [${k}],
1422
- }))
1423
- );
1424
- }
1425
- } else if (${id}.value === undefined) {
1426
- if (${k} in input) newResult[${k}] = undefined;
1427
- } else {
1428
- newResult[${k}] = ${id}.value;
1429
- }
1430
- `);
1431
- } else {
1432
- const id = ids[key];
1433
- doc.write(`const ${id} = ${parseStr(key)};`);
1434
- doc.write(`
1435
- if (${id}.issues.length) payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1436
- ...iss,
1437
- path: iss.path ? [${esc(key)}, ...iss.path] : [${esc(key)}]
1438
- })));`);
1439
- doc.write(`newResult[${esc(key)}] = ${id}.value`);
1440
- }
1441
- }
1442
- doc.write(`payload.value = newResult;`);
1443
- doc.write(`return payload;`);
1444
- const fn = doc.compile();
1445
- return (payload, ctx) => fn(shape, payload, ctx);
1446
- };
1447
- let fastpass;
1448
1511
  const isObject2 = isObject;
1449
- const jit = !globalConfig.jitless;
1450
- const allowsEval2 = allowsEval;
1451
- const fastEnabled = jit && allowsEval2.value;
1452
1512
  const catchall = def.catchall;
1453
1513
  let value;
1454
1514
  inst._zod.parse = (payload, ctx) => {
@@ -1463,61 +1523,22 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
1463
1523
  });
1464
1524
  return payload;
1465
1525
  }
1526
+ payload.value = {};
1466
1527
  const proms = [];
1467
- if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {
1468
- if (!fastpass)
1469
- fastpass = generateFastpass(def.shape);
1470
- payload = fastpass(payload, ctx);
1471
- } else {
1472
- payload.value = {};
1473
- const shape = value.shape;
1474
- for (const key of value.keys) {
1475
- const el = shape[key];
1476
- const r = el._zod.run({ value: input[key], issues: [] }, ctx);
1477
- const isOptional = el._zod.optin === "optional" && el._zod.optout === "optional";
1478
- if (r instanceof Promise) {
1479
- proms.push(r.then((r2) => isOptional ? handleOptionalObjectResult(r2, payload, key, input) : handleObjectResult(r2, payload, key)));
1480
- } else if (isOptional) {
1481
- handleOptionalObjectResult(r, payload, key, input);
1482
- } else {
1483
- handleObjectResult(r, payload, key);
1484
- }
1485
- }
1486
- }
1487
- if (!catchall) {
1488
- return proms.length ? Promise.all(proms).then(() => payload) : payload;
1489
- }
1490
- const unrecognized = [];
1491
- const keySet = value.keySet;
1492
- const _catchall = catchall._zod;
1493
- const t = _catchall.def.type;
1494
- for (const key of Object.keys(input)) {
1495
- if (keySet.has(key))
1496
- continue;
1497
- if (t === "never") {
1498
- unrecognized.push(key);
1499
- continue;
1500
- }
1501
- const r = _catchall.run({ value: input[key], issues: [] }, ctx);
1528
+ const shape = value.shape;
1529
+ for (const key of value.keys) {
1530
+ const el = shape[key];
1531
+ const r = el._zod.run({ value: input[key], issues: [] }, ctx);
1502
1532
  if (r instanceof Promise) {
1503
- proms.push(r.then((r2) => handleObjectResult(r2, payload, key)));
1533
+ proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input)));
1504
1534
  } else {
1505
- handleObjectResult(r, payload, key);
1535
+ handlePropertyResult(r, payload, key, input);
1506
1536
  }
1507
1537
  }
1508
- if (unrecognized.length) {
1509
- payload.issues.push({
1510
- code: "unrecognized_keys",
1511
- keys: unrecognized,
1512
- input,
1513
- inst
1514
- });
1538
+ if (!catchall) {
1539
+ return proms.length ? Promise.all(proms).then(() => payload) : payload;
1515
1540
  }
1516
- if (!proms.length)
1517
- return payload;
1518
- return Promise.all(proms).then(() => {
1519
- return payload;
1520
- });
1541
+ return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
1521
1542
  };
1522
1543
  });
1523
1544
  function handleUnionResults(results, final, inst, ctx) {
@@ -1527,6 +1548,11 @@ function handleUnionResults(results, final, inst, ctx) {
1527
1548
  return final;
1528
1549
  }
1529
1550
  }
1551
+ const nonaborted = results.filter((r) => !aborted(r));
1552
+ if (nonaborted.length === 1) {
1553
+ final.value = nonaborted[0].value;
1554
+ return nonaborted[0];
1555
+ }
1530
1556
  final.issues.push({
1531
1557
  code: "invalid_union",
1532
1558
  input: final.value,
@@ -1552,7 +1578,12 @@ var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
1552
1578
  }
1553
1579
  return void 0;
1554
1580
  });
1581
+ const single = def.options.length === 1;
1582
+ const first = def.options[0]._zod.run;
1555
1583
  inst._zod.parse = (payload, ctx) => {
1584
+ if (single) {
1585
+ return first(payload, ctx);
1586
+ }
1556
1587
  let async = false;
1557
1588
  const results = [];
1558
1589
  for (const option of def.options) {
@@ -1637,8 +1668,8 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
1637
1668
  }
1638
1669
  if (keyResult.issues.length) {
1639
1670
  payload.issues.push({
1640
- origin: "record",
1641
1671
  code: "invalid_key",
1672
+ origin: "record",
1642
1673
  issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
1643
1674
  input: key,
1644
1675
  path: [key],
@@ -1672,11 +1703,12 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
1672
1703
  var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
1673
1704
  $ZodType.init(inst, def);
1674
1705
  const values = getEnumValues(def.entries);
1675
- inst._zod.values = new Set(values);
1706
+ const valuesSet = new Set(values);
1707
+ inst._zod.values = valuesSet;
1676
1708
  inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
1677
1709
  inst._zod.parse = (payload, _ctx) => {
1678
1710
  const input = payload.value;
1679
- if (inst._zod.values.has(input)) {
1711
+ if (valuesSet.has(input)) {
1680
1712
  return payload;
1681
1713
  }
1682
1714
  payload.issues.push({
@@ -1690,8 +1722,11 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
1690
1722
  });
1691
1723
  var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
1692
1724
  $ZodType.init(inst, def);
1725
+ if (def.values.length === 0) {
1726
+ throw new Error("Cannot create literal schema with no valid values");
1727
+ }
1693
1728
  inst._zod.values = new Set(def.values);
1694
- inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? o.toString() : String(o)).join("|")})$`);
1729
+ inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
1695
1730
  inst._zod.parse = (payload, _ctx) => {
1696
1731
  const input = payload.value;
1697
1732
  if (inst._zod.values.has(input)) {
@@ -1706,6 +1741,12 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
1706
1741
  return payload;
1707
1742
  };
1708
1743
  });
1744
+ function handleOptionalResult(result, input) {
1745
+ if (result.issues.length && input === void 0) {
1746
+ return { issues: [], value: void 0 };
1747
+ }
1748
+ return result;
1749
+ }
1709
1750
  var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
1710
1751
  $ZodType.init(inst, def);
1711
1752
  inst._zod.optin = "optional";
@@ -1719,7 +1760,10 @@ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
1719
1760
  });
1720
1761
  inst._zod.parse = (payload, ctx) => {
1721
1762
  if (def.innerType._zod.optin === "optional") {
1722
- return def.innerType._zod.run(payload, ctx);
1763
+ const result = def.innerType._zod.run(payload, ctx);
1764
+ if (result instanceof Promise)
1765
+ return result.then((r) => handleOptionalResult(r, payload.value));
1766
+ return handleOptionalResult(result, payload.value);
1723
1767
  }
1724
1768
  if (payload.value === void 0) {
1725
1769
  return payload;
@@ -1749,6 +1793,9 @@ var $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
1749
1793
  inst._zod.optin = "optional";
1750
1794
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1751
1795
  inst._zod.parse = (payload, ctx) => {
1796
+ if (ctx.direction === "backward") {
1797
+ return def.innerType._zod.run(payload, ctx);
1798
+ }
1752
1799
  if (payload.value === void 0) {
1753
1800
  payload.value = def.defaultValue;
1754
1801
  return payload;
@@ -1768,7 +1815,7 @@ function handleDefaultResult(payload, def) {
1768
1815
  }
1769
1816
  var $ZodRegistry = class {
1770
1817
  constructor() {
1771
- this._map = /* @__PURE__ */ new Map();
1818
+ this._map = /* @__PURE__ */ new WeakMap();
1772
1819
  this._idmap = /* @__PURE__ */ new Map();
1773
1820
  }
1774
1821
  add(schema, ..._meta) {
@@ -1783,7 +1830,7 @@ var $ZodRegistry = class {
1783
1830
  return this;
1784
1831
  }
1785
1832
  clear() {
1786
- this._map = /* @__PURE__ */ new Map();
1833
+ this._map = /* @__PURE__ */ new WeakMap();
1787
1834
  this._idmap = /* @__PURE__ */ new Map();
1788
1835
  return this;
1789
1836
  }
@@ -1800,7 +1847,8 @@ var $ZodRegistry = class {
1800
1847
  if (p) {
1801
1848
  const pm = { ...this.get(p) ?? {} };
1802
1849
  delete pm.id;
1803
- return { ...pm, ...this._map.get(schema) };
1850
+ const f = { ...pm, ...this._map.get(schema) };
1851
+ return Object.keys(f).length ? f : void 0;
1804
1852
  }
1805
1853
  return this._map.get(schema);
1806
1854
  }
@@ -1812,7 +1860,7 @@ function registry() {
1812
1860
  return new $ZodRegistry();
1813
1861
  }
1814
1862
 
1815
- // ../../node_modules/.pnpm/zod@4.0.5/node_modules/zod/v4/core/api.js
1863
+ // ../../node_modules/.pnpm/zod@4.1.8/node_modules/zod/v4/core/api.js
1816
1864
  function _string(Class2, params) {
1817
1865
  return new Class2({
1818
1866
  type: "string",
@@ -1867,12 +1915,13 @@ function _toLowerCase() {
1867
1915
  return _overwrite((input) => input.toLowerCase());
1868
1916
  }
1869
1917
 
1870
- // ../../node_modules/.pnpm/zod@4.0.5/node_modules/zod/v4/mini/schemas.js
1918
+ // ../../node_modules/.pnpm/zod@4.1.8/node_modules/zod/v4/mini/schemas.js
1871
1919
  var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
1872
1920
  if (!inst._zod)
1873
1921
  throw new Error("Uninitialized schema in ZodMiniType.");
1874
1922
  $ZodType.init(inst, def);
1875
1923
  inst.def = def;
1924
+ inst.type = def.type;
1876
1925
  inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse });
1877
1926
  inst.safeParse = (data, params) => safeParse(inst, data, params);
1878
1927
  inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
@@ -1981,6 +2030,7 @@ function record(keyType, valueType, params) {
1981
2030
  var ZodMiniEnum = /* @__PURE__ */ $constructor("ZodMiniEnum", (inst, def) => {
1982
2031
  $ZodEnum.init(inst, def);
1983
2032
  ZodMiniType.init(inst, def);
2033
+ inst.options = Object.values(def.entries);
1984
2034
  });
1985
2035
  function _enum(values, params) {
1986
2036
  const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
@@ -2030,7 +2080,7 @@ function _default(innerType, defaultValue) {
2030
2080
  type: "default",
2031
2081
  innerType,
2032
2082
  get defaultValue() {
2033
- return typeof defaultValue === "function" ? defaultValue() : defaultValue;
2083
+ return typeof defaultValue === "function" ? defaultValue() : util_exports.shallowClone(defaultValue);
2034
2084
  }
2035
2085
  });
2036
2086
  }