agent-relay 6.0.3 → 6.0.4

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 (157) hide show
  1. package/dist/index.cjs +1395 -674
  2. package/node_modules/@relaycast/sdk/node_modules/zod/README.md +1 -1
  3. package/node_modules/@relaycast/sdk/node_modules/zod/locales/package.json +2 -1
  4. package/node_modules/@relaycast/sdk/node_modules/zod/mini/package.json +2 -1
  5. package/node_modules/@relaycast/sdk/node_modules/zod/package.json +1 -1
  6. package/node_modules/@relaycast/sdk/node_modules/zod/src/v3/tests/all-errors.test.ts +3 -3
  7. package/node_modules/@relaycast/sdk/node_modules/zod/src/v3/tests/object.test.ts +5 -5
  8. package/node_modules/@relaycast/sdk/node_modules/zod/src/v3/tests/partials.test.ts +3 -3
  9. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/errors.ts +2 -2
  10. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/external.ts +1 -0
  11. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/from-json-schema.ts +39 -23
  12. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/parse.ts +6 -6
  13. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/schemas.ts +389 -148
  14. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/catch.test.ts +4 -2
  15. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/codec.test.ts +142 -1
  16. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/continuability.test.ts +1 -1
  17. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/datetime.test.ts +1 -1
  18. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/default.test.ts +44 -0
  19. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +197 -0
  20. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +31 -1
  21. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +214 -2
  22. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +161 -0
  23. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/function.test.ts +6 -6
  24. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/global-config.test.ts +39 -0
  25. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/index.test.ts +2 -2
  26. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +46 -0
  27. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
  28. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
  29. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/number.test.ts +55 -0
  30. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/object.test.ts +83 -6
  31. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/optional.test.ts +114 -4
  32. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/partial.test.ts +28 -2
  33. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/prefault.test.ts +1 -1
  34. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/record.test.ts +85 -0
  35. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +49 -0
  36. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/refine.test.ts +63 -0
  37. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/string.test.ts +50 -1
  38. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +4 -4
  39. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +128 -14
  40. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/transform.test.ts +17 -0
  41. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/tuple.test.ts +315 -2
  42. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/union.test.ts +54 -0
  43. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/api.ts +25 -2
  44. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/checks.ts +1 -1
  45. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/core.ts +17 -2
  46. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/errors.ts +31 -24
  47. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/json-schema-processors.ts +15 -17
  48. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/parse.ts +7 -7
  49. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/regexes.ts +8 -1
  50. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/schemas.ts +218 -66
  51. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/tests/locales/el.test.ts +215 -0
  52. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
  53. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
  54. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +22 -0
  55. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +58 -0
  56. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/to-json-schema.ts +9 -1
  57. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/util.ts +52 -35
  58. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/versions.ts +2 -2
  59. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/locales/el.ts +121 -0
  60. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/locales/en.ts +4 -0
  61. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/locales/fr.ts +24 -8
  62. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/locales/hr.ts +131 -0
  63. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/locales/index.ts +3 -0
  64. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/locales/it.ts +1 -1
  65. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/locales/ka.ts +8 -8
  66. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/locales/ro.ts +129 -0
  67. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/locales/uz.ts +1 -0
  68. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/mini/external.ts +1 -0
  69. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/mini/schemas.ts +55 -24
  70. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/mini/tests/codec.test.ts +19 -0
  71. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/mini/tests/index.test.ts +27 -2
  72. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/mini/tests/object.test.ts +9 -9
  73. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +51 -1
  74. package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/mini/tests/string.test.ts +5 -0
  75. package/node_modules/@relaycast/sdk/node_modules/zod/v3/package.json +2 -1
  76. package/node_modules/@relaycast/sdk/node_modules/zod/v4/classic/errors.js +2 -2
  77. package/node_modules/@relaycast/sdk/node_modules/zod/v4/classic/external.d.cts +1 -0
  78. package/node_modules/@relaycast/sdk/node_modules/zod/v4/classic/external.d.ts +1 -0
  79. package/node_modules/@relaycast/sdk/node_modules/zod/v4/classic/from-json-schema.cjs +31 -16
  80. package/node_modules/@relaycast/sdk/node_modules/zod/v4/classic/from-json-schema.js +31 -16
  81. package/node_modules/@relaycast/sdk/node_modules/zod/v4/classic/package.json +2 -1
  82. package/node_modules/@relaycast/sdk/node_modules/zod/v4/classic/schemas.cjs +346 -117
  83. package/node_modules/@relaycast/sdk/node_modules/zod/v4/classic/schemas.d.cts +34 -12
  84. package/node_modules/@relaycast/sdk/node_modules/zod/v4/classic/schemas.d.ts +34 -12
  85. package/node_modules/@relaycast/sdk/node_modules/zod/v4/classic/schemas.js +345 -117
  86. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/api.cjs +7 -2
  87. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/api.d.cts +20 -1
  88. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/api.d.ts +20 -1
  89. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/api.js +7 -2
  90. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/checks.d.cts +1 -1
  91. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/checks.d.ts +1 -1
  92. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/core.cjs +3 -1
  93. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/core.js +4 -2
  94. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/errors.cjs +26 -23
  95. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/errors.d.cts +1 -0
  96. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/errors.d.ts +1 -0
  97. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/errors.js +26 -23
  98. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/json-schema-processors.cjs +14 -19
  99. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/json-schema-processors.js +14 -19
  100. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/package.json +2 -1
  101. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/parse.cjs +7 -7
  102. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/parse.js +7 -7
  103. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/regexes.cjs +9 -3
  104. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/regexes.d.cts +6 -0
  105. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/regexes.d.ts +6 -0
  106. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/regexes.js +7 -1
  107. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/schemas.cjs +196 -59
  108. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/schemas.d.cts +21 -1
  109. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/schemas.d.ts +21 -1
  110. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/schemas.js +196 -59
  111. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/to-json-schema.cjs +10 -1
  112. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/to-json-schema.js +10 -1
  113. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/util.cjs +54 -30
  114. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/util.d.cts +1 -0
  115. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/util.d.ts +1 -0
  116. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/util.js +55 -32
  117. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/versions.cjs +2 -2
  118. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/versions.d.cts +1 -1
  119. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/versions.d.ts +1 -1
  120. package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/versions.js +2 -2
  121. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/el.cjs +136 -0
  122. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/el.d.cts +5 -0
  123. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/el.d.ts +4 -0
  124. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/el.js +109 -0
  125. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/en.cjs +4 -0
  126. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/en.js +4 -0
  127. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/fr.cjs +24 -7
  128. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/fr.js +24 -7
  129. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/hr.cjs +149 -0
  130. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/hr.d.cts +5 -0
  131. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/hr.d.ts +4 -0
  132. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/hr.js +122 -0
  133. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/index.cjs +8 -1
  134. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/index.d.cts +3 -0
  135. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/index.d.ts +3 -0
  136. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/index.js +3 -0
  137. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/it.cjs +1 -1
  138. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/it.js +1 -1
  139. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/ka.cjs +8 -8
  140. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/ka.js +8 -8
  141. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/package.json +2 -1
  142. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/ro.cjs +146 -0
  143. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/ro.d.cts +5 -0
  144. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/ro.d.ts +4 -0
  145. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/ro.js +119 -0
  146. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/uz.cjs +1 -0
  147. package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/uz.js +1 -0
  148. package/node_modules/@relaycast/sdk/node_modules/zod/v4/mini/external.d.cts +1 -0
  149. package/node_modules/@relaycast/sdk/node_modules/zod/v4/mini/external.d.ts +1 -0
  150. package/node_modules/@relaycast/sdk/node_modules/zod/v4/mini/package.json +2 -1
  151. package/node_modules/@relaycast/sdk/node_modules/zod/v4/mini/schemas.cjs +41 -4
  152. package/node_modules/@relaycast/sdk/node_modules/zod/v4/mini/schemas.d.cts +27 -9
  153. package/node_modules/@relaycast/sdk/node_modules/zod/v4/mini/schemas.d.ts +27 -9
  154. package/node_modules/@relaycast/sdk/node_modules/zod/v4/mini/schemas.js +40 -4
  155. package/node_modules/@relaycast/sdk/node_modules/zod/v4/package.json +2 -1
  156. package/node_modules/@relaycast/sdk/node_modules/zod/v4-mini/package.json +2 -1
  157. package/package.json +9 -9
@@ -0,0 +1,5 @@
1
+ import type * as errors from "../core/errors.cjs";
2
+ declare function _default(): {
3
+ localeError: errors.$ZodErrorMap;
4
+ };
5
+ export = _default;
@@ -0,0 +1,4 @@
1
+ import type * as errors from "../core/errors.js";
2
+ export default function (): {
3
+ localeError: errors.$ZodErrorMap;
4
+ };
@@ -0,0 +1,119 @@
1
+ import * as util from "../core/util.js";
2
+ const error = () => {
3
+ const Sizable = {
4
+ string: { unit: "caractere", verb: "să aibă" },
5
+ file: { unit: "octeți", verb: "să aibă" },
6
+ array: { unit: "elemente", verb: "să aibă" },
7
+ set: { unit: "elemente", verb: "să aibă" },
8
+ map: { unit: "intrări", verb: "să aibă" },
9
+ };
10
+ function getSizing(origin) {
11
+ return Sizable[origin] ?? null;
12
+ }
13
+ const FormatDictionary = {
14
+ regex: "intrare",
15
+ email: "adresă de email",
16
+ url: "URL",
17
+ emoji: "emoji",
18
+ uuid: "UUID",
19
+ uuidv4: "UUIDv4",
20
+ uuidv6: "UUIDv6",
21
+ nanoid: "nanoid",
22
+ guid: "GUID",
23
+ cuid: "cuid",
24
+ cuid2: "cuid2",
25
+ ulid: "ULID",
26
+ xid: "XID",
27
+ ksuid: "KSUID",
28
+ datetime: "dată și oră ISO",
29
+ date: "dată ISO",
30
+ time: "oră ISO",
31
+ duration: "durată ISO",
32
+ ipv4: "adresă IPv4",
33
+ ipv6: "adresă IPv6",
34
+ mac: "adresă MAC",
35
+ cidrv4: "interval IPv4",
36
+ cidrv6: "interval IPv6",
37
+ base64: "șir codat base64",
38
+ base64url: "șir codat base64url",
39
+ json_string: "șir JSON",
40
+ e164: "număr E.164",
41
+ jwt: "JWT",
42
+ template_literal: "intrare",
43
+ };
44
+ const TypeDictionary = {
45
+ nan: "NaN",
46
+ string: "șir",
47
+ number: "număr",
48
+ boolean: "boolean",
49
+ function: "funcție",
50
+ array: "matrice",
51
+ object: "obiect",
52
+ undefined: "nedefinit",
53
+ symbol: "simbol",
54
+ bigint: "număr mare",
55
+ void: "void",
56
+ never: "never",
57
+ map: "hartă",
58
+ set: "set",
59
+ };
60
+ return (issue) => {
61
+ switch (issue.code) {
62
+ case "invalid_type": {
63
+ const expected = TypeDictionary[issue.expected] ?? issue.expected;
64
+ const receivedType = util.parsedType(issue.input);
65
+ const received = TypeDictionary[receivedType] ?? receivedType;
66
+ return `Intrare invalidă: așteptat ${expected}, primit ${received}`;
67
+ }
68
+ case "invalid_value":
69
+ if (issue.values.length === 1)
70
+ return `Intrare invalidă: așteptat ${util.stringifyPrimitive(issue.values[0])}`;
71
+ return `Opțiune invalidă: așteptat una dintre ${util.joinValues(issue.values, "|")}`;
72
+ case "too_big": {
73
+ const adj = issue.inclusive ? "<=" : "<";
74
+ const sizing = getSizing(issue.origin);
75
+ if (sizing)
76
+ return `Prea mare: așteptat ca ${issue.origin ?? "valoarea"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elemente"}`;
77
+ return `Prea mare: așteptat ca ${issue.origin ?? "valoarea"} să fie ${adj}${issue.maximum.toString()}`;
78
+ }
79
+ case "too_small": {
80
+ const adj = issue.inclusive ? ">=" : ">";
81
+ const sizing = getSizing(issue.origin);
82
+ if (sizing) {
83
+ return `Prea mic: așteptat ca ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
84
+ }
85
+ return `Prea mic: așteptat ca ${issue.origin} să fie ${adj}${issue.minimum.toString()}`;
86
+ }
87
+ case "invalid_format": {
88
+ const _issue = issue;
89
+ if (_issue.format === "starts_with") {
90
+ return `Șir invalid: trebuie să înceapă cu "${_issue.prefix}"`;
91
+ }
92
+ if (_issue.format === "ends_with")
93
+ return `Șir invalid: trebuie să se termine cu "${_issue.suffix}"`;
94
+ if (_issue.format === "includes")
95
+ return `Șir invalid: trebuie să includă "${_issue.includes}"`;
96
+ if (_issue.format === "regex")
97
+ return `Șir invalid: trebuie să se potrivească cu modelul ${_issue.pattern}`;
98
+ return `Format invalid: ${FormatDictionary[_issue.format] ?? issue.format}`;
99
+ }
100
+ case "not_multiple_of":
101
+ return `Număr invalid: trebuie să fie multiplu de ${issue.divisor}`;
102
+ case "unrecognized_keys":
103
+ return `Chei nerecunoscute: ${util.joinValues(issue.keys, ", ")}`;
104
+ case "invalid_key":
105
+ return `Cheie invalidă în ${issue.origin}`;
106
+ case "invalid_union":
107
+ return "Intrare invalidă";
108
+ case "invalid_element":
109
+ return `Valoare invalidă în ${issue.origin}`;
110
+ default:
111
+ return `Intrare invalidă`;
112
+ }
113
+ };
114
+ };
115
+ export default function () {
116
+ return {
117
+ localeError: error(),
118
+ };
119
+ }
@@ -31,6 +31,7 @@ const error = () => {
31
31
  file: { unit: "bayt", verb: "bo‘lishi kerak" },
32
32
  array: { unit: "element", verb: "bo‘lishi kerak" },
33
33
  set: { unit: "element", verb: "bo‘lishi kerak" },
34
+ map: { unit: "yozuv", verb: "bo‘lishi kerak" },
34
35
  };
35
36
  function getSizing(origin) {
36
37
  return Sizable[origin] ?? null;
@@ -5,6 +5,7 @@ const error = () => {
5
5
  file: { unit: "bayt", verb: "bo‘lishi kerak" },
6
6
  array: { unit: "element", verb: "bo‘lishi kerak" },
7
7
  set: { unit: "element", verb: "bo‘lishi kerak" },
8
+ map: { unit: "yozuv", verb: "bo‘lishi kerak" },
8
9
  };
9
10
  function getSizing(origin) {
10
11
  return Sizable[origin] ?? null;
@@ -3,6 +3,7 @@ export * from "./parse.cjs";
3
3
  export * from "./schemas.cjs";
4
4
  export * from "./checks.cjs";
5
5
  export type { infer, output, input } from "../core/index.cjs";
6
+ export type { JSONType } from "../core/util.cjs";
6
7
  export { globalRegistry, registry, config, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, } from "../core/index.cjs";
7
8
  export { toJSONSchema } from "../core/json-schema-processors.cjs";
8
9
  export * as locales from "../locales/index.cjs";
@@ -3,6 +3,7 @@ export * from "./parse.js";
3
3
  export * from "./schemas.js";
4
4
  export * from "./checks.js";
5
5
  export type { infer, output, input } from "../core/index.js";
6
+ export type { JSONType } from "../core/util.js";
6
7
  export { globalRegistry, registry, config, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, } from "../core/index.js";
7
8
  export { toJSONSchema } from "../core/json-schema-processors.js";
8
9
  export * as locales from "../locales/index.js";
@@ -2,5 +2,6 @@
2
2
  "type": "module",
3
3
  "main": "./index.cjs",
4
4
  "module": "./index.js",
5
- "types": "./index.d.cts"
5
+ "types": "./index.d.cts",
6
+ "sideEffects": false
6
7
  }
@@ -112,6 +112,7 @@ exports.catch = _catch;
112
112
  exports.nan = nan;
113
113
  exports.pipe = pipe;
114
114
  exports.codec = codec;
115
+ exports.invertCodec = invertCodec;
115
116
  exports.readonly = readonly;
116
117
  exports.templateLiteral = templateLiteral;
117
118
  exports.lazy = _lazy;
@@ -144,7 +145,11 @@ exports.ZodMiniType = core.$constructor("ZodMiniType", (inst, def) => {
144
145
  ...def,
145
146
  checks: [
146
147
  ...(def.checks ?? []),
147
- ...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch),
148
+ ...checks.map((ch) => typeof ch === "function"
149
+ ? {
150
+ _zod: { check: ch, def: { check: "custom" }, onattach: [] },
151
+ }
152
+ : ch),
148
153
  ],
149
154
  }, { parent: true });
150
155
  };
@@ -218,7 +223,7 @@ function url(params) {
218
223
  // @__NO_SIDE_EFFECTS__
219
224
  function httpUrl(params) {
220
225
  return core._url(exports.ZodMiniURL, {
221
- protocol: /^https?$/,
226
+ protocol: core.regexes.httpProtocol,
222
227
  hostname: core.regexes.domain,
223
228
  ...util.normalizeParams(params),
224
229
  });
@@ -239,10 +244,22 @@ exports.ZodMiniNanoID = core.$constructor("ZodMiniNanoID", (inst, def) => {
239
244
  function nanoid(params) {
240
245
  return core._nanoid(exports.ZodMiniNanoID, params);
241
246
  }
247
+ /**
248
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
249
+ * (timestamps embedded in the id). Use {@link ZodMiniCUID2} instead.
250
+ * See https://github.com/paralleldrive/cuid.
251
+ */
242
252
  exports.ZodMiniCUID = core.$constructor("ZodMiniCUID", (inst, def) => {
243
253
  core.$ZodCUID.init(inst, def);
244
254
  exports.ZodMiniStringFormat.init(inst, def);
245
255
  });
256
+ /**
257
+ * Validates a CUID v1 string.
258
+ *
259
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
260
+ * (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.
261
+ * See https://github.com/paralleldrive/cuid.
262
+ */
246
263
  // @__NO_SIDE_EFFECTS__
247
264
  function cuid(params) {
248
265
  return core._cuid(exports.ZodMiniCUID, params);
@@ -668,6 +685,15 @@ exports.ZodMiniRecord = core.$constructor("ZodMiniRecord", (inst, def) => {
668
685
  });
669
686
  // @__NO_SIDE_EFFECTS__
670
687
  function record(keyType, valueType, params) {
688
+ // v3-compat: z.record(valueType, params?) — defaults keyType to z.string()
689
+ if (!valueType || !valueType._zod) {
690
+ return new exports.ZodMiniRecord({
691
+ type: "record",
692
+ keyType: string(),
693
+ valueType: keyType,
694
+ ...util.normalizeParams(valueType),
695
+ });
696
+ }
671
697
  return new exports.ZodMiniRecord({
672
698
  type: "record",
673
699
  keyType,
@@ -915,6 +941,17 @@ function codec(in_, out, params) {
915
941
  reverseTransform: params.encode,
916
942
  });
917
943
  }
944
+ // @__NO_SIDE_EFFECTS__
945
+ function invertCodec(codec) {
946
+ const def = codec._zod.def;
947
+ return new exports.ZodMiniCodec({
948
+ type: "pipe",
949
+ in: def.out,
950
+ out: def.in,
951
+ transform: def.reverseTransform,
952
+ reverseTransform: def.transform,
953
+ });
954
+ }
918
955
  exports.ZodMiniReadonly = core.$constructor("ZodMiniReadonly", (inst, def) => {
919
956
  core.$ZodReadonly.init(inst, def);
920
957
  exports.ZodMiniType.init(inst, def);
@@ -990,8 +1027,8 @@ function refine(fn, _params = {}) {
990
1027
  }
991
1028
  // superRefine
992
1029
  // @__NO_SIDE_EFFECTS__
993
- function superRefine(fn) {
994
- return core._superRefine(fn);
1030
+ function superRefine(fn, params) {
1031
+ return core._superRefine(fn, params);
995
1032
  }
996
1033
  // Re-export describe and meta from core
997
1034
  exports.describe = core.describe;
@@ -58,9 +58,26 @@ export interface ZodMiniNanoID extends _ZodMiniString<core.$ZodNanoIDInternals>
58
58
  }
59
59
  export declare const ZodMiniNanoID: core.$constructor<ZodMiniNanoID>;
60
60
  export declare function nanoid(params?: string | core.$ZodNanoIDParams): ZodMiniNanoID;
61
+ /**
62
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
63
+ * (timestamps embedded in the id). Use {@link ZodMiniCUID2} instead.
64
+ * See https://github.com/paralleldrive/cuid.
65
+ */
61
66
  export interface ZodMiniCUID extends _ZodMiniString<core.$ZodCUIDInternals> {
62
67
  }
68
+ /**
69
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
70
+ * (timestamps embedded in the id). Use {@link ZodMiniCUID2} instead.
71
+ * See https://github.com/paralleldrive/cuid.
72
+ */
63
73
  export declare const ZodMiniCUID: core.$constructor<ZodMiniCUID>;
74
+ /**
75
+ * Validates a CUID v1 string.
76
+ *
77
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
78
+ * (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.
79
+ * See https://github.com/paralleldrive/cuid.
80
+ */
64
81
  export declare function cuid(params?: string | core.$ZodCUIDParams): ZodMiniCUID;
65
82
  export interface ZodMiniCUID2 extends _ZodMiniString<core.$ZodCUID2Internals> {
66
83
  }
@@ -198,23 +215,23 @@ out Shape extends core.$ZodShape = core.$ZodShape, out Config extends core.$ZodO
198
215
  shape: Shape;
199
216
  }
200
217
  export declare const ZodMiniObject: core.$constructor<ZodMiniObject>;
201
- export declare function object<T extends core.$ZodLooseShape = Record<never, SomeType>>(shape?: T, params?: string | core.$ZodObjectParams): ZodMiniObject<T, core.$strip>;
202
- export declare function strictObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<T, core.$strict>;
203
- export declare function looseObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<T, core.$loose>;
204
- export declare function extend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: U): ZodMiniObject<util.Extend<T["shape"], U>, T["_zod"]["config"]>;
218
+ export declare function object<T extends core.$ZodLooseShape = Record<never, SomeType>>(shape?: T, params?: string | core.$ZodObjectParams): ZodMiniObject<util.Writeable<T>, core.$strip>;
219
+ export declare function strictObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<util.Writeable<T>, core.$strict>;
220
+ export declare function looseObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<util.Writeable<T>, core.$loose>;
221
+ export declare function extend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: U): ZodMiniObject<util.Extend<T["shape"], util.Writeable<U>>, T["_zod"]["config"]>;
205
222
  export type SafeExtendShape<Base extends core.$ZodShape, Ext extends core.$ZodLooseShape> = {
206
223
  [K in keyof Ext]: K extends keyof Base ? core.output<Ext[K]> extends core.output<Base[K]> ? core.input<Ext[K]> extends core.input<Base[K]> ? Ext[K] : never : never : Ext[K];
207
224
  };
208
- export declare function safeExtend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: SafeExtendShape<T["shape"], U>): ZodMiniObject<util.Extend<T["shape"], U>, T["_zod"]["config"]>;
225
+ export declare function safeExtend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: SafeExtendShape<T["shape"], U>): ZodMiniObject<util.Extend<T["shape"], util.Writeable<U>>, T["_zod"]["config"]>;
209
226
  /** @deprecated Identical to `z.extend(A, B)` */
210
227
  export declare function merge<T extends ZodMiniObject, U extends ZodMiniObject>(a: T, b: U): ZodMiniObject<util.Extend<T["shape"], U["shape"]>, T["_zod"]["config"]>;
211
228
  export declare function pick<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<util.Flatten<Pick<T["shape"], keyof T["shape"] & keyof M>>, T["_zod"]["config"]>;
212
229
  export declare function omit<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<util.Flatten<Omit<T["shape"], keyof M>>, T["_zod"]["config"]>;
213
230
  export declare function partial<T extends ZodMiniObject>(schema: T): ZodMiniObject<{
214
- [k in keyof T["shape"]]: ZodMiniOptional<T["shape"][k]>;
231
+ -readonly [k in keyof T["shape"]]: ZodMiniOptional<T["shape"][k]>;
215
232
  }, T["_zod"]["config"]>;
216
233
  export declare function partial<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<{
217
- [k in keyof T["shape"]]: k extends keyof M ? ZodMiniOptional<T["shape"][k]> : T["shape"][k];
234
+ -readonly [k in keyof T["shape"]]: k extends keyof M ? ZodMiniOptional<T["shape"][k]> : T["shape"][k];
218
235
  }, T["_zod"]["config"]>;
219
236
  export type RequiredInterfaceShape<Shape extends core.$ZodLooseShape, Keys extends PropertyKey = keyof Shape> = util.Identity<{
220
237
  [k in keyof Shape as k extends Keys ? k : never]: ZodMiniNonOptional<Shape[k]>;
@@ -222,7 +239,7 @@ export type RequiredInterfaceShape<Shape extends core.$ZodLooseShape, Keys exten
222
239
  [k in keyof Shape as k extends Keys ? never : k]: Shape[k];
223
240
  }>;
224
241
  export declare function required<T extends ZodMiniObject>(schema: T): ZodMiniObject<{
225
- [k in keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
242
+ -readonly [k in keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
226
243
  }, T["_zod"]["config"]>;
227
244
  export declare function required<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<util.Extend<T["shape"], {
228
245
  [k in keyof M & keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
@@ -347,6 +364,7 @@ export declare function codec<const A extends SomeType, B extends core.SomeType
347
364
  decode: (value: core.output<A>, payload: core.ParsePayload<core.output<A>>) => core.util.MaybeAsync<core.input<B>>;
348
365
  encode: (value: core.input<B>, payload: core.ParsePayload<core.input<B>>) => core.util.MaybeAsync<core.output<A>>;
349
366
  }): ZodMiniCodec<A, B>;
367
+ export declare function invertCodec<A extends SomeType, B extends SomeType>(codec: ZodMiniCodec<A, B>): ZodMiniCodec<B, A>;
350
368
  export interface ZodMiniReadonly<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodReadonlyInternals<T>> {
351
369
  }
352
370
  export declare const ZodMiniReadonly: core.$constructor<ZodMiniReadonly>;
@@ -370,7 +388,7 @@ export declare const ZodMiniCustom: core.$constructor<ZodMiniCustom>;
370
388
  export declare function check<O = unknown>(fn: core.CheckFn<O>, params?: string | core.$ZodCustomParams): core.$ZodCheck<O>;
371
389
  export declare function custom<O = unknown, I = O>(fn?: (data: O) => unknown, _params?: string | core.$ZodCustomParams | undefined): ZodMiniCustom<O, I>;
372
390
  export declare function refine<T>(fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>, _params?: string | core.$ZodCustomParams): core.$ZodCheck<T>;
373
- export declare function superRefine<T>(fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>): core.$ZodCheck<T>;
391
+ export declare function superRefine<T>(fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>, params?: core.$ZodSuperRefineParams): core.$ZodCheck<T>;
374
392
  export declare const describe: typeof core.describe;
375
393
  export declare const meta: typeof core.meta;
376
394
  declare abstract class Class {
@@ -58,9 +58,26 @@ export interface ZodMiniNanoID extends _ZodMiniString<core.$ZodNanoIDInternals>
58
58
  }
59
59
  export declare const ZodMiniNanoID: core.$constructor<ZodMiniNanoID>;
60
60
  export declare function nanoid(params?: string | core.$ZodNanoIDParams): ZodMiniNanoID;
61
+ /**
62
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
63
+ * (timestamps embedded in the id). Use {@link ZodMiniCUID2} instead.
64
+ * See https://github.com/paralleldrive/cuid.
65
+ */
61
66
  export interface ZodMiniCUID extends _ZodMiniString<core.$ZodCUIDInternals> {
62
67
  }
68
+ /**
69
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
70
+ * (timestamps embedded in the id). Use {@link ZodMiniCUID2} instead.
71
+ * See https://github.com/paralleldrive/cuid.
72
+ */
63
73
  export declare const ZodMiniCUID: core.$constructor<ZodMiniCUID>;
74
+ /**
75
+ * Validates a CUID v1 string.
76
+ *
77
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
78
+ * (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.
79
+ * See https://github.com/paralleldrive/cuid.
80
+ */
64
81
  export declare function cuid(params?: string | core.$ZodCUIDParams): ZodMiniCUID;
65
82
  export interface ZodMiniCUID2 extends _ZodMiniString<core.$ZodCUID2Internals> {
66
83
  }
@@ -198,23 +215,23 @@ out Shape extends core.$ZodShape = core.$ZodShape, out Config extends core.$ZodO
198
215
  shape: Shape;
199
216
  }
200
217
  export declare const ZodMiniObject: core.$constructor<ZodMiniObject>;
201
- export declare function object<T extends core.$ZodLooseShape = Record<never, SomeType>>(shape?: T, params?: string | core.$ZodObjectParams): ZodMiniObject<T, core.$strip>;
202
- export declare function strictObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<T, core.$strict>;
203
- export declare function looseObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<T, core.$loose>;
204
- export declare function extend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: U): ZodMiniObject<util.Extend<T["shape"], U>, T["_zod"]["config"]>;
218
+ export declare function object<T extends core.$ZodLooseShape = Record<never, SomeType>>(shape?: T, params?: string | core.$ZodObjectParams): ZodMiniObject<util.Writeable<T>, core.$strip>;
219
+ export declare function strictObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<util.Writeable<T>, core.$strict>;
220
+ export declare function looseObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<util.Writeable<T>, core.$loose>;
221
+ export declare function extend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: U): ZodMiniObject<util.Extend<T["shape"], util.Writeable<U>>, T["_zod"]["config"]>;
205
222
  export type SafeExtendShape<Base extends core.$ZodShape, Ext extends core.$ZodLooseShape> = {
206
223
  [K in keyof Ext]: K extends keyof Base ? core.output<Ext[K]> extends core.output<Base[K]> ? core.input<Ext[K]> extends core.input<Base[K]> ? Ext[K] : never : never : Ext[K];
207
224
  };
208
- export declare function safeExtend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: SafeExtendShape<T["shape"], U>): ZodMiniObject<util.Extend<T["shape"], U>, T["_zod"]["config"]>;
225
+ export declare function safeExtend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: SafeExtendShape<T["shape"], U>): ZodMiniObject<util.Extend<T["shape"], util.Writeable<U>>, T["_zod"]["config"]>;
209
226
  /** @deprecated Identical to `z.extend(A, B)` */
210
227
  export declare function merge<T extends ZodMiniObject, U extends ZodMiniObject>(a: T, b: U): ZodMiniObject<util.Extend<T["shape"], U["shape"]>, T["_zod"]["config"]>;
211
228
  export declare function pick<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<util.Flatten<Pick<T["shape"], keyof T["shape"] & keyof M>>, T["_zod"]["config"]>;
212
229
  export declare function omit<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<util.Flatten<Omit<T["shape"], keyof M>>, T["_zod"]["config"]>;
213
230
  export declare function partial<T extends ZodMiniObject>(schema: T): ZodMiniObject<{
214
- [k in keyof T["shape"]]: ZodMiniOptional<T["shape"][k]>;
231
+ -readonly [k in keyof T["shape"]]: ZodMiniOptional<T["shape"][k]>;
215
232
  }, T["_zod"]["config"]>;
216
233
  export declare function partial<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<{
217
- [k in keyof T["shape"]]: k extends keyof M ? ZodMiniOptional<T["shape"][k]> : T["shape"][k];
234
+ -readonly [k in keyof T["shape"]]: k extends keyof M ? ZodMiniOptional<T["shape"][k]> : T["shape"][k];
218
235
  }, T["_zod"]["config"]>;
219
236
  export type RequiredInterfaceShape<Shape extends core.$ZodLooseShape, Keys extends PropertyKey = keyof Shape> = util.Identity<{
220
237
  [k in keyof Shape as k extends Keys ? k : never]: ZodMiniNonOptional<Shape[k]>;
@@ -222,7 +239,7 @@ export type RequiredInterfaceShape<Shape extends core.$ZodLooseShape, Keys exten
222
239
  [k in keyof Shape as k extends Keys ? never : k]: Shape[k];
223
240
  }>;
224
241
  export declare function required<T extends ZodMiniObject>(schema: T): ZodMiniObject<{
225
- [k in keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
242
+ -readonly [k in keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
226
243
  }, T["_zod"]["config"]>;
227
244
  export declare function required<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<util.Extend<T["shape"], {
228
245
  [k in keyof M & keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
@@ -347,6 +364,7 @@ export declare function codec<const A extends SomeType, B extends core.SomeType
347
364
  decode: (value: core.output<A>, payload: core.ParsePayload<core.output<A>>) => core.util.MaybeAsync<core.input<B>>;
348
365
  encode: (value: core.input<B>, payload: core.ParsePayload<core.input<B>>) => core.util.MaybeAsync<core.output<A>>;
349
366
  }): ZodMiniCodec<A, B>;
367
+ export declare function invertCodec<A extends SomeType, B extends SomeType>(codec: ZodMiniCodec<A, B>): ZodMiniCodec<B, A>;
350
368
  export interface ZodMiniReadonly<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodReadonlyInternals<T>> {
351
369
  }
352
370
  export declare const ZodMiniReadonly: core.$constructor<ZodMiniReadonly>;
@@ -370,7 +388,7 @@ export declare const ZodMiniCustom: core.$constructor<ZodMiniCustom>;
370
388
  export declare function check<O = unknown>(fn: core.CheckFn<O>, params?: string | core.$ZodCustomParams): core.$ZodCheck<O>;
371
389
  export declare function custom<O = unknown, I = O>(fn?: (data: O) => unknown, _params?: string | core.$ZodCustomParams | undefined): ZodMiniCustom<O, I>;
372
390
  export declare function refine<T>(fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>, _params?: string | core.$ZodCustomParams): core.$ZodCheck<T>;
373
- export declare function superRefine<T>(fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>): core.$ZodCheck<T>;
391
+ export declare function superRefine<T>(fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>, params?: core.$ZodSuperRefineParams): core.$ZodCheck<T>;
374
392
  export declare const describe: typeof core.describe;
375
393
  export declare const meta: typeof core.meta;
376
394
  declare abstract class Class {
@@ -16,7 +16,11 @@ export const ZodMiniType = /*@__PURE__*/ core.$constructor("ZodMiniType", (inst,
16
16
  ...def,
17
17
  checks: [
18
18
  ...(def.checks ?? []),
19
- ...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch),
19
+ ...checks.map((ch) => typeof ch === "function"
20
+ ? {
21
+ _zod: { check: ch, def: { check: "custom" }, onattach: [] },
22
+ }
23
+ : ch),
20
24
  ],
21
25
  }, { parent: true });
22
26
  };
@@ -90,7 +94,7 @@ export function url(params) {
90
94
  // @__NO_SIDE_EFFECTS__
91
95
  export function httpUrl(params) {
92
96
  return core._url(ZodMiniURL, {
93
- protocol: /^https?$/,
97
+ protocol: core.regexes.httpProtocol,
94
98
  hostname: core.regexes.domain,
95
99
  ...util.normalizeParams(params),
96
100
  });
@@ -111,10 +115,22 @@ export const ZodMiniNanoID = /*@__PURE__*/ core.$constructor("ZodMiniNanoID", (i
111
115
  export function nanoid(params) {
112
116
  return core._nanoid(ZodMiniNanoID, params);
113
117
  }
118
+ /**
119
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
120
+ * (timestamps embedded in the id). Use {@link ZodMiniCUID2} instead.
121
+ * See https://github.com/paralleldrive/cuid.
122
+ */
114
123
  export const ZodMiniCUID = /*@__PURE__*/ core.$constructor("ZodMiniCUID", (inst, def) => {
115
124
  core.$ZodCUID.init(inst, def);
116
125
  ZodMiniStringFormat.init(inst, def);
117
126
  });
127
+ /**
128
+ * Validates a CUID v1 string.
129
+ *
130
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
131
+ * (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.
132
+ * See https://github.com/paralleldrive/cuid.
133
+ */
118
134
  // @__NO_SIDE_EFFECTS__
119
135
  export function cuid(params) {
120
136
  return core._cuid(ZodMiniCUID, params);
@@ -543,6 +559,15 @@ export const ZodMiniRecord = /*@__PURE__*/ core.$constructor("ZodMiniRecord", (i
543
559
  });
544
560
  // @__NO_SIDE_EFFECTS__
545
561
  export function record(keyType, valueType, params) {
562
+ // v3-compat: z.record(valueType, params?) — defaults keyType to z.string()
563
+ if (!valueType || !valueType._zod) {
564
+ return new ZodMiniRecord({
565
+ type: "record",
566
+ keyType: string(),
567
+ valueType: keyType,
568
+ ...util.normalizeParams(valueType),
569
+ });
570
+ }
546
571
  return new ZodMiniRecord({
547
572
  type: "record",
548
573
  keyType,
@@ -792,6 +817,17 @@ export function codec(in_, out, params) {
792
817
  reverseTransform: params.encode,
793
818
  });
794
819
  }
820
+ // @__NO_SIDE_EFFECTS__
821
+ export function invertCodec(codec) {
822
+ const def = codec._zod.def;
823
+ return new ZodMiniCodec({
824
+ type: "pipe",
825
+ in: def.out,
826
+ out: def.in,
827
+ transform: def.reverseTransform,
828
+ reverseTransform: def.transform,
829
+ });
830
+ }
795
831
  export const ZodMiniReadonly = /*@__PURE__*/ core.$constructor("ZodMiniReadonly", (inst, def) => {
796
832
  core.$ZodReadonly.init(inst, def);
797
833
  ZodMiniType.init(inst, def);
@@ -868,8 +904,8 @@ export function refine(fn, _params = {}) {
868
904
  }
869
905
  // superRefine
870
906
  // @__NO_SIDE_EFFECTS__
871
- export function superRefine(fn) {
872
- return core._superRefine(fn);
907
+ export function superRefine(fn, params) {
908
+ return core._superRefine(fn, params);
873
909
  }
874
910
  // Re-export describe and meta from core
875
911
  export const describe = core.describe;
@@ -2,5 +2,6 @@
2
2
  "type": "module",
3
3
  "main": "./index.cjs",
4
4
  "module": "./index.js",
5
- "types": "./index.d.cts"
5
+ "types": "./index.d.cts",
6
+ "sideEffects": false
6
7
  }
@@ -2,5 +2,6 @@
2
2
  "type": "module",
3
3
  "main": "./index.cjs",
4
4
  "module": "./index.js",
5
- "types": "./index.d.cts"
5
+ "types": "./index.d.cts",
6
+ "sideEffects": false
6
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-relay",
3
- "version": "6.0.3",
3
+ "version": "6.0.4",
4
4
  "description": "Real-time agent-to-agent communication system",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -130,14 +130,14 @@
130
130
  },
131
131
  "homepage": "https://github.com/AgentWorkforce/relay#readme",
132
132
  "dependencies": {
133
- "@agent-relay/cloud": "6.0.3",
134
- "@agent-relay/config": "6.0.3",
135
- "@agent-relay/hooks": "6.0.3",
136
- "@agent-relay/sdk": "6.0.3",
137
- "@agent-relay/telemetry": "6.0.3",
138
- "@agent-relay/trajectory": "6.0.3",
139
- "@agent-relay/user-directory": "6.0.3",
140
- "@agent-relay/utils": "6.0.3",
133
+ "@agent-relay/cloud": "6.0.4",
134
+ "@agent-relay/config": "6.0.4",
135
+ "@agent-relay/hooks": "6.0.4",
136
+ "@agent-relay/sdk": "6.0.4",
137
+ "@agent-relay/telemetry": "6.0.4",
138
+ "@agent-relay/trajectory": "6.0.4",
139
+ "@agent-relay/user-directory": "6.0.4",
140
+ "@agent-relay/utils": "6.0.4",
141
141
  "@aws-sdk/client-s3": "3.1020.0",
142
142
  "@modelcontextprotocol/sdk": "^1.0.0",
143
143
  "@relayauth/core": "^0.1.2",