agentf 0.6.0 → 0.8.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 (774) hide show
  1. checksums.yaml +4 -4
  2. data/.opencode/agents/agentf-engineer.md +42 -0
  3. data/.opencode/agents/agentf-incident_responder.md +30 -0
  4. data/.opencode/agents/agentf-knowledge_manager.md +27 -0
  5. data/.opencode/agents/agentf-orchestrator.md +37 -0
  6. data/.opencode/agents/agentf-planner.md +27 -0
  7. data/.opencode/agents/agentf-qa_tester.md +42 -0
  8. data/.opencode/agents/agentf-researcher.md +30 -0
  9. data/.opencode/agents/agentf-reviewer.md +27 -0
  10. data/.opencode/agents/agentf-security_reviewer.md +30 -0
  11. data/.opencode/agents/agentf-ui_engineer.md +42 -0
  12. data/.opencode/bun.lock +18 -0
  13. data/.opencode/commands/agentf-architecture.md +17 -0
  14. data/.opencode/commands/agentf-debugger.md +17 -0
  15. data/.opencode/commands/agentf-designer.md +17 -0
  16. data/.opencode/commands/agentf-explorer.md +18 -0
  17. data/.opencode/commands/agentf-memory.md +19 -0
  18. data/.opencode/commands/agentf-metrics.md +17 -0
  19. data/.opencode/commands/agentf-security.md +17 -0
  20. data/.opencode/commands/agentf-tester.md +17 -0
  21. data/.opencode/memory/agentf-redis-schema.md +49 -0
  22. data/.opencode/node_modules/@opencode-ai/plugin/dist/example.d.ts +2 -0
  23. data/.opencode/node_modules/@opencode-ai/plugin/dist/example.js +16 -0
  24. data/.opencode/node_modules/@opencode-ai/plugin/dist/index.d.ts +232 -0
  25. data/.opencode/node_modules/@opencode-ai/plugin/dist/index.js +1 -0
  26. data/.opencode/node_modules/@opencode-ai/plugin/dist/shell.d.ts +109 -0
  27. data/.opencode/node_modules/@opencode-ai/plugin/dist/shell.js +0 -0
  28. data/.opencode/node_modules/@opencode-ai/plugin/dist/tool.d.ts +46 -0
  29. data/.opencode/node_modules/@opencode-ai/plugin/dist/tool.js +5 -0
  30. data/.opencode/node_modules/@opencode-ai/plugin/package.json +34 -0
  31. data/.opencode/node_modules/@opencode-ai/sdk/dist/client.d.ts +7 -0
  32. data/.opencode/node_modules/@opencode-ai/sdk/dist/client.js +25 -0
  33. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/client/client.gen.d.ts +2 -0
  34. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/client/client.gen.js +165 -0
  35. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/client/index.d.ts +7 -0
  36. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/client/index.js +5 -0
  37. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/client/types.gen.d.ts +127 -0
  38. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/client/types.gen.js +2 -0
  39. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/client/utils.gen.d.ts +38 -0
  40. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/client/utils.gen.js +226 -0
  41. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/client.gen.d.ts +12 -0
  42. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/client.gen.js +5 -0
  43. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/auth.gen.d.ts +18 -0
  44. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/auth.gen.js +14 -0
  45. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/bodySerializer.gen.d.ts +17 -0
  46. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/bodySerializer.gen.js +57 -0
  47. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/params.gen.d.ts +33 -0
  48. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/params.gen.js +89 -0
  49. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/pathSerializer.gen.d.ts +33 -0
  50. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/pathSerializer.gen.js +106 -0
  51. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/queryKeySerializer.gen.d.ts +18 -0
  52. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/queryKeySerializer.gen.js +93 -0
  53. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/serverSentEvents.gen.d.ts +59 -0
  54. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/serverSentEvents.gen.js +117 -0
  55. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/types.gen.d.ts +78 -0
  56. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/types.gen.js +2 -0
  57. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/utils.gen.d.ts +14 -0
  58. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/core/utils.gen.js +69 -0
  59. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/sdk.gen.d.ts +403 -0
  60. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/sdk.gen.js +881 -0
  61. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/types.gen.d.ts +3380 -0
  62. data/.opencode/node_modules/@opencode-ai/sdk/dist/gen/types.gen.js +2 -0
  63. data/.opencode/node_modules/@opencode-ai/sdk/dist/index.d.ts +10 -0
  64. data/.opencode/node_modules/@opencode-ai/sdk/dist/index.js +16 -0
  65. data/.opencode/node_modules/@opencode-ai/sdk/dist/server.d.ts +23 -0
  66. data/.opencode/node_modules/@opencode-ai/sdk/dist/server.js +94 -0
  67. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/client.d.ts +8 -0
  68. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/client.js +33 -0
  69. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/client/client.gen.d.ts +2 -0
  70. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/client/client.gen.js +232 -0
  71. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/client/index.d.ts +8 -0
  72. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/client/index.js +6 -0
  73. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/client/types.gen.d.ts +117 -0
  74. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/client/types.gen.js +2 -0
  75. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/client/utils.gen.d.ts +33 -0
  76. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/client/utils.gen.js +226 -0
  77. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/client.gen.d.ts +12 -0
  78. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/client.gen.js +3 -0
  79. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/core/auth.gen.d.ts +18 -0
  80. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/core/auth.gen.js +14 -0
  81. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/core/bodySerializer.gen.d.ts +25 -0
  82. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/core/bodySerializer.gen.js +57 -0
  83. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/core/params.gen.d.ts +43 -0
  84. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/core/params.gen.js +102 -0
  85. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/core/pathSerializer.gen.d.ts +33 -0
  86. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/core/pathSerializer.gen.js +106 -0
  87. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/core/queryKeySerializer.gen.d.ts +18 -0
  88. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/core/queryKeySerializer.gen.js +93 -0
  89. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/core/serverSentEvents.gen.d.ts +71 -0
  90. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/core/serverSentEvents.gen.js +133 -0
  91. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/core/types.gen.d.ts +78 -0
  92. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/core/types.gen.js +2 -0
  93. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/core/utils.gen.d.ts +19 -0
  94. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/core/utils.gen.js +87 -0
  95. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/sdk.gen.d.ts +1271 -0
  96. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/sdk.gen.js +2575 -0
  97. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/types.gen.d.ts +4290 -0
  98. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/gen/types.gen.js +2 -0
  99. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/index.d.ts +10 -0
  100. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/index.js +16 -0
  101. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/server.d.ts +23 -0
  102. data/.opencode/node_modules/@opencode-ai/sdk/dist/v2/server.js +94 -0
  103. data/.opencode/node_modules/@opencode-ai/sdk/package.json +52 -0
  104. data/.opencode/node_modules/zod/LICENSE +21 -0
  105. data/.opencode/node_modules/zod/README.md +208 -0
  106. data/.opencode/node_modules/zod/index.cjs +33 -0
  107. data/.opencode/node_modules/zod/index.d.cts +4 -0
  108. data/.opencode/node_modules/zod/index.d.ts +4 -0
  109. data/.opencode/node_modules/zod/index.js +4 -0
  110. data/.opencode/node_modules/zod/locales/index.cjs +17 -0
  111. data/.opencode/node_modules/zod/locales/index.d.cts +1 -0
  112. data/.opencode/node_modules/zod/locales/index.d.ts +1 -0
  113. data/.opencode/node_modules/zod/locales/index.js +1 -0
  114. data/.opencode/node_modules/zod/locales/package.json +6 -0
  115. data/.opencode/node_modules/zod/mini/index.cjs +17 -0
  116. data/.opencode/node_modules/zod/mini/index.d.cts +1 -0
  117. data/.opencode/node_modules/zod/mini/index.d.ts +1 -0
  118. data/.opencode/node_modules/zod/mini/index.js +1 -0
  119. data/.opencode/node_modules/zod/mini/package.json +6 -0
  120. data/.opencode/node_modules/zod/package.json +135 -0
  121. data/.opencode/node_modules/zod/src/index.ts +4 -0
  122. data/.opencode/node_modules/zod/src/locales/index.ts +1 -0
  123. data/.opencode/node_modules/zod/src/mini/index.ts +1 -0
  124. data/.opencode/node_modules/zod/src/v3/ZodError.ts +330 -0
  125. data/.opencode/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
  126. data/.opencode/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
  127. data/.opencode/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
  128. data/.opencode/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
  129. data/.opencode/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
  130. data/.opencode/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
  131. data/.opencode/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
  132. data/.opencode/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
  133. data/.opencode/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
  134. data/.opencode/node_modules/zod/src/v3/errors.ts +13 -0
  135. data/.opencode/node_modules/zod/src/v3/external.ts +6 -0
  136. data/.opencode/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
  137. data/.opencode/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
  138. data/.opencode/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
  139. data/.opencode/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
  140. data/.opencode/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
  141. data/.opencode/node_modules/zod/src/v3/helpers/util.ts +224 -0
  142. data/.opencode/node_modules/zod/src/v3/index.ts +4 -0
  143. data/.opencode/node_modules/zod/src/v3/locales/en.ts +124 -0
  144. data/.opencode/node_modules/zod/src/v3/standard-schema.ts +113 -0
  145. data/.opencode/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
  146. data/.opencode/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
  147. data/.opencode/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
  148. data/.opencode/node_modules/zod/src/v3/tests/array.test.ts +71 -0
  149. data/.opencode/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
  150. data/.opencode/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
  151. data/.opencode/node_modules/zod/src/v3/tests/base.test.ts +29 -0
  152. data/.opencode/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
  153. data/.opencode/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
  154. data/.opencode/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
  155. data/.opencode/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
  156. data/.opencode/node_modules/zod/src/v3/tests/complex.test.ts +56 -0
  157. data/.opencode/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
  158. data/.opencode/node_modules/zod/src/v3/tests/date.test.ts +32 -0
  159. data/.opencode/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
  160. data/.opencode/node_modules/zod/src/v3/tests/default.test.ts +112 -0
  161. data/.opencode/node_modules/zod/src/v3/tests/description.test.ts +33 -0
  162. data/.opencode/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
  163. data/.opencode/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
  164. data/.opencode/node_modules/zod/src/v3/tests/error.test.ts +551 -0
  165. data/.opencode/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
  166. data/.opencode/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
  167. data/.opencode/node_modules/zod/src/v3/tests/function.test.ts +257 -0
  168. data/.opencode/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
  169. data/.opencode/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
  170. data/.opencode/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
  171. data/.opencode/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
  172. data/.opencode/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
  173. data/.opencode/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
  174. data/.opencode/node_modules/zod/src/v3/tests/map.test.ts +110 -0
  175. data/.opencode/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
  176. data/.opencode/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
  177. data/.opencode/node_modules/zod/src/v3/tests/nan.test.ts +21 -0
  178. data/.opencode/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
  179. data/.opencode/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
  180. data/.opencode/node_modules/zod/src/v3/tests/number.test.ts +176 -0
  181. data/.opencode/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
  182. data/.opencode/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
  183. data/.opencode/node_modules/zod/src/v3/tests/object.test.ts +434 -0
  184. data/.opencode/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
  185. data/.opencode/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
  186. data/.opencode/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
  187. data/.opencode/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
  188. data/.opencode/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
  189. data/.opencode/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
  190. data/.opencode/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
  191. data/.opencode/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
  192. data/.opencode/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
  193. data/.opencode/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
  194. data/.opencode/node_modules/zod/src/v3/tests/record.test.ts +171 -0
  195. data/.opencode/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
  196. data/.opencode/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
  197. data/.opencode/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
  198. data/.opencode/node_modules/zod/src/v3/tests/set.test.ts +142 -0
  199. data/.opencode/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
  200. data/.opencode/node_modules/zod/src/v3/tests/string.test.ts +916 -0
  201. data/.opencode/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
  202. data/.opencode/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
  203. data/.opencode/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
  204. data/.opencode/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
  205. data/.opencode/node_modules/zod/src/v3/tests/void.test.ts +15 -0
  206. data/.opencode/node_modules/zod/src/v3/types.ts +5138 -0
  207. data/.opencode/node_modules/zod/src/v4/classic/checks.ts +31 -0
  208. data/.opencode/node_modules/zod/src/v4/classic/coerce.ts +27 -0
  209. data/.opencode/node_modules/zod/src/v4/classic/compat.ts +70 -0
  210. data/.opencode/node_modules/zod/src/v4/classic/errors.ts +82 -0
  211. data/.opencode/node_modules/zod/src/v4/classic/external.ts +50 -0
  212. data/.opencode/node_modules/zod/src/v4/classic/index.ts +5 -0
  213. data/.opencode/node_modules/zod/src/v4/classic/iso.ts +90 -0
  214. data/.opencode/node_modules/zod/src/v4/classic/parse.ts +82 -0
  215. data/.opencode/node_modules/zod/src/v4/classic/schemas.ts +2205 -0
  216. data/.opencode/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
  217. data/.opencode/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
  218. data/.opencode/node_modules/zod/src/v4/classic/tests/assignability.test.ts +210 -0
  219. data/.opencode/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
  220. data/.opencode/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
  221. data/.opencode/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
  222. data/.opencode/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
  223. data/.opencode/node_modules/zod/src/v4/classic/tests/brand.test.ts +63 -0
  224. data/.opencode/node_modules/zod/src/v4/classic/tests/catch.test.ts +276 -0
  225. data/.opencode/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
  226. data/.opencode/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +573 -0
  227. data/.opencode/node_modules/zod/src/v4/classic/tests/codec.test.ts +562 -0
  228. data/.opencode/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
  229. data/.opencode/node_modules/zod/src/v4/classic/tests/continuability.test.ts +352 -0
  230. data/.opencode/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
  231. data/.opencode/node_modules/zod/src/v4/classic/tests/date.test.ts +31 -0
  232. data/.opencode/node_modules/zod/src/v4/classic/tests/datetime.test.ts +302 -0
  233. data/.opencode/node_modules/zod/src/v4/classic/tests/default.test.ts +365 -0
  234. data/.opencode/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
  235. data/.opencode/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +661 -0
  236. data/.opencode/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
  237. data/.opencode/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +595 -0
  238. data/.opencode/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
  239. data/.opencode/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
  240. data/.opencode/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
  241. data/.opencode/node_modules/zod/src/v4/classic/tests/function.test.ts +308 -0
  242. data/.opencode/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
  243. data/.opencode/node_modules/zod/src/v4/classic/tests/hash.test.ts +68 -0
  244. data/.opencode/node_modules/zod/src/v4/classic/tests/index.test.ts +844 -0
  245. data/.opencode/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +34 -0
  246. data/.opencode/node_modules/zod/src/v4/classic/tests/intersection.test.ts +171 -0
  247. data/.opencode/node_modules/zod/src/v4/classic/tests/json.test.ts +108 -0
  248. data/.opencode/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
  249. data/.opencode/node_modules/zod/src/v4/classic/tests/literal.test.ts +117 -0
  250. data/.opencode/node_modules/zod/src/v4/classic/tests/map.test.ts +196 -0
  251. data/.opencode/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
  252. data/.opencode/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
  253. data/.opencode/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
  254. data/.opencode/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
  255. data/.opencode/node_modules/zod/src/v4/classic/tests/number.test.ts +270 -0
  256. data/.opencode/node_modules/zod/src/v4/classic/tests/object.test.ts +609 -0
  257. data/.opencode/node_modules/zod/src/v4/classic/tests/optional.test.ts +136 -0
  258. data/.opencode/node_modules/zod/src/v4/classic/tests/partial.test.ts +340 -0
  259. data/.opencode/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +127 -0
  260. data/.opencode/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
  261. data/.opencode/node_modules/zod/src/v4/classic/tests/prefault.test.ts +74 -0
  262. data/.opencode/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +282 -0
  263. data/.opencode/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
  264. data/.opencode/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
  265. data/.opencode/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
  266. data/.opencode/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
  267. data/.opencode/node_modules/zod/src/v4/classic/tests/record.test.ts +356 -0
  268. data/.opencode/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +539 -0
  269. data/.opencode/node_modules/zod/src/v4/classic/tests/refine.test.ts +605 -0
  270. data/.opencode/node_modules/zod/src/v4/classic/tests/registries.test.ts +204 -0
  271. data/.opencode/node_modules/zod/src/v4/classic/tests/set.test.ts +181 -0
  272. data/.opencode/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +57 -0
  273. data/.opencode/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
  274. data/.opencode/node_modules/zod/src/v4/classic/tests/string.test.ts +1080 -0
  275. data/.opencode/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +106 -0
  276. data/.opencode/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +763 -0
  277. data/.opencode/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +2622 -0
  278. data/.opencode/node_modules/zod/src/v4/classic/tests/transform.test.ts +361 -0
  279. data/.opencode/node_modules/zod/src/v4/classic/tests/tuple.test.ts +163 -0
  280. data/.opencode/node_modules/zod/src/v4/classic/tests/union.test.ts +181 -0
  281. data/.opencode/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
  282. data/.opencode/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
  283. data/.opencode/node_modules/zod/src/v4/core/api.ts +1621 -0
  284. data/.opencode/node_modules/zod/src/v4/core/checks.ts +1287 -0
  285. data/.opencode/node_modules/zod/src/v4/core/config.ts +15 -0
  286. data/.opencode/node_modules/zod/src/v4/core/core.ts +115 -0
  287. data/.opencode/node_modules/zod/src/v4/core/doc.ts +44 -0
  288. data/.opencode/node_modules/zod/src/v4/core/errors.ts +423 -0
  289. data/.opencode/node_modules/zod/src/v4/core/index.ts +14 -0
  290. data/.opencode/node_modules/zod/src/v4/core/json-schema.ts +147 -0
  291. data/.opencode/node_modules/zod/src/v4/core/parse.ts +195 -0
  292. data/.opencode/node_modules/zod/src/v4/core/regexes.ts +177 -0
  293. data/.opencode/node_modules/zod/src/v4/core/registries.ts +97 -0
  294. data/.opencode/node_modules/zod/src/v4/core/schemas.ts +4303 -0
  295. data/.opencode/node_modules/zod/src/v4/core/standard-schema.ts +64 -0
  296. data/.opencode/node_modules/zod/src/v4/core/tests/extend.test.ts +18 -0
  297. data/.opencode/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
  298. data/.opencode/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
  299. data/.opencode/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
  300. data/.opencode/node_modules/zod/src/v4/core/tests/locales/es.test.ts +181 -0
  301. data/.opencode/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
  302. data/.opencode/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
  303. data/.opencode/node_modules/zod/src/v4/core/to-json-schema.ts +1044 -0
  304. data/.opencode/node_modules/zod/src/v4/core/util.ts +910 -0
  305. data/.opencode/node_modules/zod/src/v4/core/versions.ts +5 -0
  306. data/.opencode/node_modules/zod/src/v4/core/zsf.ts +323 -0
  307. data/.opencode/node_modules/zod/src/v4/index.ts +4 -0
  308. data/.opencode/node_modules/zod/src/v4/locales/ar.ts +125 -0
  309. data/.opencode/node_modules/zod/src/v4/locales/az.ts +121 -0
  310. data/.opencode/node_modules/zod/src/v4/locales/be.ts +184 -0
  311. data/.opencode/node_modules/zod/src/v4/locales/bg.ts +136 -0
  312. data/.opencode/node_modules/zod/src/v4/locales/ca.ts +127 -0
  313. data/.opencode/node_modules/zod/src/v4/locales/cs.ts +142 -0
  314. data/.opencode/node_modules/zod/src/v4/locales/da.ts +141 -0
  315. data/.opencode/node_modules/zod/src/v4/locales/de.ts +124 -0
  316. data/.opencode/node_modules/zod/src/v4/locales/en.ts +127 -0
  317. data/.opencode/node_modules/zod/src/v4/locales/eo.ts +125 -0
  318. data/.opencode/node_modules/zod/src/v4/locales/es.ts +159 -0
  319. data/.opencode/node_modules/zod/src/v4/locales/fa.ts +134 -0
  320. data/.opencode/node_modules/zod/src/v4/locales/fi.ts +131 -0
  321. data/.opencode/node_modules/zod/src/v4/locales/fr-CA.ts +126 -0
  322. data/.opencode/node_modules/zod/src/v4/locales/fr.ts +124 -0
  323. data/.opencode/node_modules/zod/src/v4/locales/he.ts +125 -0
  324. data/.opencode/node_modules/zod/src/v4/locales/hu.ts +126 -0
  325. data/.opencode/node_modules/zod/src/v4/locales/id.ts +125 -0
  326. data/.opencode/node_modules/zod/src/v4/locales/index.ts +46 -0
  327. data/.opencode/node_modules/zod/src/v4/locales/is.ts +127 -0
  328. data/.opencode/node_modules/zod/src/v4/locales/it.ts +125 -0
  329. data/.opencode/node_modules/zod/src/v4/locales/ja.ts +122 -0
  330. data/.opencode/node_modules/zod/src/v4/locales/ka.ts +138 -0
  331. data/.opencode/node_modules/zod/src/v4/locales/kh.ts +7 -0
  332. data/.opencode/node_modules/zod/src/v4/locales/km.ts +126 -0
  333. data/.opencode/node_modules/zod/src/v4/locales/ko.ts +131 -0
  334. data/.opencode/node_modules/zod/src/v4/locales/lt.ts +265 -0
  335. data/.opencode/node_modules/zod/src/v4/locales/mk.ts +127 -0
  336. data/.opencode/node_modules/zod/src/v4/locales/ms.ts +124 -0
  337. data/.opencode/node_modules/zod/src/v4/locales/nl.ts +126 -0
  338. data/.opencode/node_modules/zod/src/v4/locales/no.ts +124 -0
  339. data/.opencode/node_modules/zod/src/v4/locales/ota.ts +125 -0
  340. data/.opencode/node_modules/zod/src/v4/locales/pl.ts +126 -0
  341. data/.opencode/node_modules/zod/src/v4/locales/ps.ts +133 -0
  342. data/.opencode/node_modules/zod/src/v4/locales/pt.ts +123 -0
  343. data/.opencode/node_modules/zod/src/v4/locales/ru.ts +184 -0
  344. data/.opencode/node_modules/zod/src/v4/locales/sl.ts +126 -0
  345. data/.opencode/node_modules/zod/src/v4/locales/sv.ts +127 -0
  346. data/.opencode/node_modules/zod/src/v4/locales/ta.ts +125 -0
  347. data/.opencode/node_modules/zod/src/v4/locales/th.ts +126 -0
  348. data/.opencode/node_modules/zod/src/v4/locales/tr.ts +121 -0
  349. data/.opencode/node_modules/zod/src/v4/locales/ua.ts +7 -0
  350. data/.opencode/node_modules/zod/src/v4/locales/uk.ts +126 -0
  351. data/.opencode/node_modules/zod/src/v4/locales/ur.ts +126 -0
  352. data/.opencode/node_modules/zod/src/v4/locales/vi.ts +125 -0
  353. data/.opencode/node_modules/zod/src/v4/locales/yo.ts +131 -0
  354. data/.opencode/node_modules/zod/src/v4/locales/zh-CN.ts +123 -0
  355. data/.opencode/node_modules/zod/src/v4/locales/zh-TW.ts +125 -0
  356. data/.opencode/node_modules/zod/src/v4/mini/checks.ts +32 -0
  357. data/.opencode/node_modules/zod/src/v4/mini/coerce.ts +22 -0
  358. data/.opencode/node_modules/zod/src/v4/mini/external.ts +40 -0
  359. data/.opencode/node_modules/zod/src/v4/mini/index.ts +3 -0
  360. data/.opencode/node_modules/zod/src/v4/mini/iso.ts +62 -0
  361. data/.opencode/node_modules/zod/src/v4/mini/parse.ts +14 -0
  362. data/.opencode/node_modules/zod/src/v4/mini/schemas.ts +1739 -0
  363. data/.opencode/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
  364. data/.opencode/node_modules/zod/src/v4/mini/tests/brand.test.ts +51 -0
  365. data/.opencode/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
  366. data/.opencode/node_modules/zod/src/v4/mini/tests/codec.test.ts +529 -0
  367. data/.opencode/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
  368. data/.opencode/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
  369. data/.opencode/node_modules/zod/src/v4/mini/tests/functions.test.ts +43 -0
  370. data/.opencode/node_modules/zod/src/v4/mini/tests/index.test.ts +899 -0
  371. data/.opencode/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
  372. data/.opencode/node_modules/zod/src/v4/mini/tests/object.test.ts +200 -0
  373. data/.opencode/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
  374. data/.opencode/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +275 -0
  375. data/.opencode/node_modules/zod/src/v4/mini/tests/string.test.ts +315 -0
  376. data/.opencode/node_modules/zod/src/v4-mini/index.ts +1 -0
  377. data/.opencode/node_modules/zod/v3/ZodError.cjs +138 -0
  378. data/.opencode/node_modules/zod/v3/ZodError.d.cts +164 -0
  379. data/.opencode/node_modules/zod/v3/ZodError.d.ts +164 -0
  380. data/.opencode/node_modules/zod/v3/ZodError.js +133 -0
  381. data/.opencode/node_modules/zod/v3/errors.cjs +17 -0
  382. data/.opencode/node_modules/zod/v3/errors.d.cts +5 -0
  383. data/.opencode/node_modules/zod/v3/errors.d.ts +5 -0
  384. data/.opencode/node_modules/zod/v3/errors.js +9 -0
  385. data/.opencode/node_modules/zod/v3/external.cjs +22 -0
  386. data/.opencode/node_modules/zod/v3/external.d.cts +6 -0
  387. data/.opencode/node_modules/zod/v3/external.d.ts +6 -0
  388. data/.opencode/node_modules/zod/v3/external.js +6 -0
  389. data/.opencode/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
  390. data/.opencode/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
  391. data/.opencode/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
  392. data/.opencode/node_modules/zod/v3/helpers/enumUtil.js +1 -0
  393. data/.opencode/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
  394. data/.opencode/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
  395. data/.opencode/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
  396. data/.opencode/node_modules/zod/v3/helpers/errorUtil.js +6 -0
  397. data/.opencode/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
  398. data/.opencode/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
  399. data/.opencode/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
  400. data/.opencode/node_modules/zod/v3/helpers/parseUtil.js +109 -0
  401. data/.opencode/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
  402. data/.opencode/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
  403. data/.opencode/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
  404. data/.opencode/node_modules/zod/v3/helpers/partialUtil.js +1 -0
  405. data/.opencode/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
  406. data/.opencode/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
  407. data/.opencode/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
  408. data/.opencode/node_modules/zod/v3/helpers/typeAliases.js +1 -0
  409. data/.opencode/node_modules/zod/v3/helpers/util.cjs +137 -0
  410. data/.opencode/node_modules/zod/v3/helpers/util.d.cts +85 -0
  411. data/.opencode/node_modules/zod/v3/helpers/util.d.ts +85 -0
  412. data/.opencode/node_modules/zod/v3/helpers/util.js +133 -0
  413. data/.opencode/node_modules/zod/v3/index.cjs +33 -0
  414. data/.opencode/node_modules/zod/v3/index.d.cts +4 -0
  415. data/.opencode/node_modules/zod/v3/index.d.ts +4 -0
  416. data/.opencode/node_modules/zod/v3/index.js +4 -0
  417. data/.opencode/node_modules/zod/v3/locales/en.cjs +112 -0
  418. data/.opencode/node_modules/zod/v3/locales/en.d.cts +3 -0
  419. data/.opencode/node_modules/zod/v3/locales/en.d.ts +3 -0
  420. data/.opencode/node_modules/zod/v3/locales/en.js +109 -0
  421. data/.opencode/node_modules/zod/v3/package.json +6 -0
  422. data/.opencode/node_modules/zod/v3/standard-schema.cjs +2 -0
  423. data/.opencode/node_modules/zod/v3/standard-schema.d.cts +102 -0
  424. data/.opencode/node_modules/zod/v3/standard-schema.d.ts +102 -0
  425. data/.opencode/node_modules/zod/v3/standard-schema.js +1 -0
  426. data/.opencode/node_modules/zod/v3/types.cjs +3777 -0
  427. data/.opencode/node_modules/zod/v3/types.d.cts +1034 -0
  428. data/.opencode/node_modules/zod/v3/types.d.ts +1034 -0
  429. data/.opencode/node_modules/zod/v3/types.js +3695 -0
  430. data/.opencode/node_modules/zod/v4/classic/checks.cjs +32 -0
  431. data/.opencode/node_modules/zod/v4/classic/checks.d.cts +1 -0
  432. data/.opencode/node_modules/zod/v4/classic/checks.d.ts +1 -0
  433. data/.opencode/node_modules/zod/v4/classic/checks.js +1 -0
  434. data/.opencode/node_modules/zod/v4/classic/coerce.cjs +47 -0
  435. data/.opencode/node_modules/zod/v4/classic/coerce.d.cts +17 -0
  436. data/.opencode/node_modules/zod/v4/classic/coerce.d.ts +17 -0
  437. data/.opencode/node_modules/zod/v4/classic/coerce.js +17 -0
  438. data/.opencode/node_modules/zod/v4/classic/compat.cjs +61 -0
  439. data/.opencode/node_modules/zod/v4/classic/compat.d.cts +50 -0
  440. data/.opencode/node_modules/zod/v4/classic/compat.d.ts +50 -0
  441. data/.opencode/node_modules/zod/v4/classic/compat.js +31 -0
  442. data/.opencode/node_modules/zod/v4/classic/errors.cjs +74 -0
  443. data/.opencode/node_modules/zod/v4/classic/errors.d.cts +30 -0
  444. data/.opencode/node_modules/zod/v4/classic/errors.d.ts +30 -0
  445. data/.opencode/node_modules/zod/v4/classic/errors.js +48 -0
  446. data/.opencode/node_modules/zod/v4/classic/external.cjs +70 -0
  447. data/.opencode/node_modules/zod/v4/classic/external.d.cts +13 -0
  448. data/.opencode/node_modules/zod/v4/classic/external.d.ts +13 -0
  449. data/.opencode/node_modules/zod/v4/classic/external.js +18 -0
  450. data/.opencode/node_modules/zod/v4/classic/index.cjs +33 -0
  451. data/.opencode/node_modules/zod/v4/classic/index.d.cts +4 -0
  452. data/.opencode/node_modules/zod/v4/classic/index.d.ts +4 -0
  453. data/.opencode/node_modules/zod/v4/classic/index.js +4 -0
  454. data/.opencode/node_modules/zod/v4/classic/iso.cjs +60 -0
  455. data/.opencode/node_modules/zod/v4/classic/iso.d.cts +22 -0
  456. data/.opencode/node_modules/zod/v4/classic/iso.d.ts +22 -0
  457. data/.opencode/node_modules/zod/v4/classic/iso.js +30 -0
  458. data/.opencode/node_modules/zod/v4/classic/package.json +6 -0
  459. data/.opencode/node_modules/zod/v4/classic/parse.cjs +41 -0
  460. data/.opencode/node_modules/zod/v4/classic/parse.d.cts +31 -0
  461. data/.opencode/node_modules/zod/v4/classic/parse.d.ts +31 -0
  462. data/.opencode/node_modules/zod/v4/classic/parse.js +15 -0
  463. data/.opencode/node_modules/zod/v4/classic/schemas.cjs +1161 -0
  464. data/.opencode/node_modules/zod/v4/classic/schemas.d.cts +673 -0
  465. data/.opencode/node_modules/zod/v4/classic/schemas.d.ts +673 -0
  466. data/.opencode/node_modules/zod/v4/classic/schemas.js +1050 -0
  467. data/.opencode/node_modules/zod/v4/core/api.cjs +1060 -0
  468. data/.opencode/node_modules/zod/v4/core/api.d.cts +295 -0
  469. data/.opencode/node_modules/zod/v4/core/api.d.ts +295 -0
  470. data/.opencode/node_modules/zod/v4/core/api.js +925 -0
  471. data/.opencode/node_modules/zod/v4/core/checks.cjs +595 -0
  472. data/.opencode/node_modules/zod/v4/core/checks.d.cts +278 -0
  473. data/.opencode/node_modules/zod/v4/core/checks.d.ts +278 -0
  474. data/.opencode/node_modules/zod/v4/core/checks.js +569 -0
  475. data/.opencode/node_modules/zod/v4/core/core.cjs +74 -0
  476. data/.opencode/node_modules/zod/v4/core/core.d.cts +52 -0
  477. data/.opencode/node_modules/zod/v4/core/core.d.ts +52 -0
  478. data/.opencode/node_modules/zod/v4/core/core.js +67 -0
  479. data/.opencode/node_modules/zod/v4/core/doc.cjs +39 -0
  480. data/.opencode/node_modules/zod/v4/core/doc.d.cts +14 -0
  481. data/.opencode/node_modules/zod/v4/core/doc.d.ts +14 -0
  482. data/.opencode/node_modules/zod/v4/core/doc.js +35 -0
  483. data/.opencode/node_modules/zod/v4/core/errors.cjs +221 -0
  484. data/.opencode/node_modules/zod/v4/core/errors.d.cts +210 -0
  485. data/.opencode/node_modules/zod/v4/core/errors.d.ts +210 -0
  486. data/.opencode/node_modules/zod/v4/core/errors.js +190 -0
  487. data/.opencode/node_modules/zod/v4/core/index.cjs +43 -0
  488. data/.opencode/node_modules/zod/v4/core/index.d.cts +14 -0
  489. data/.opencode/node_modules/zod/v4/core/index.d.ts +14 -0
  490. data/.opencode/node_modules/zod/v4/core/index.js +14 -0
  491. data/.opencode/node_modules/zod/v4/core/json-schema.cjs +2 -0
  492. data/.opencode/node_modules/zod/v4/core/json-schema.d.cts +88 -0
  493. data/.opencode/node_modules/zod/v4/core/json-schema.d.ts +88 -0
  494. data/.opencode/node_modules/zod/v4/core/json-schema.js +1 -0
  495. data/.opencode/node_modules/zod/v4/core/package.json +6 -0
  496. data/.opencode/node_modules/zod/v4/core/parse.cjs +131 -0
  497. data/.opencode/node_modules/zod/v4/core/parse.d.cts +49 -0
  498. data/.opencode/node_modules/zod/v4/core/parse.d.ts +49 -0
  499. data/.opencode/node_modules/zod/v4/core/parse.js +93 -0
  500. data/.opencode/node_modules/zod/v4/core/regexes.cjs +136 -0
  501. data/.opencode/node_modules/zod/v4/core/regexes.d.cts +78 -0
  502. data/.opencode/node_modules/zod/v4/core/regexes.d.ts +78 -0
  503. data/.opencode/node_modules/zod/v4/core/regexes.js +127 -0
  504. data/.opencode/node_modules/zod/v4/core/registries.cjs +57 -0
  505. data/.opencode/node_modules/zod/v4/core/registries.d.cts +35 -0
  506. data/.opencode/node_modules/zod/v4/core/registries.d.ts +35 -0
  507. data/.opencode/node_modules/zod/v4/core/registries.js +52 -0
  508. data/.opencode/node_modules/zod/v4/core/schemas.cjs +1972 -0
  509. data/.opencode/node_modules/zod/v4/core/schemas.d.cts +1113 -0
  510. data/.opencode/node_modules/zod/v4/core/schemas.d.ts +1113 -0
  511. data/.opencode/node_modules/zod/v4/core/schemas.js +1941 -0
  512. data/.opencode/node_modules/zod/v4/core/standard-schema.cjs +2 -0
  513. data/.opencode/node_modules/zod/v4/core/standard-schema.d.cts +55 -0
  514. data/.opencode/node_modules/zod/v4/core/standard-schema.d.ts +55 -0
  515. data/.opencode/node_modules/zod/v4/core/standard-schema.js +1 -0
  516. data/.opencode/node_modules/zod/v4/core/to-json-schema.cjs +920 -0
  517. data/.opencode/node_modules/zod/v4/core/to-json-schema.d.cts +90 -0
  518. data/.opencode/node_modules/zod/v4/core/to-json-schema.d.ts +90 -0
  519. data/.opencode/node_modules/zod/v4/core/to-json-schema.js +915 -0
  520. data/.opencode/node_modules/zod/v4/core/util.cjs +658 -0
  521. data/.opencode/node_modules/zod/v4/core/util.d.cts +197 -0
  522. data/.opencode/node_modules/zod/v4/core/util.d.ts +197 -0
  523. data/.opencode/node_modules/zod/v4/core/util.js +601 -0
  524. data/.opencode/node_modules/zod/v4/core/versions.cjs +8 -0
  525. data/.opencode/node_modules/zod/v4/core/versions.d.cts +5 -0
  526. data/.opencode/node_modules/zod/v4/core/versions.d.ts +5 -0
  527. data/.opencode/node_modules/zod/v4/core/versions.js +5 -0
  528. data/.opencode/node_modules/zod/v4/index.cjs +22 -0
  529. data/.opencode/node_modules/zod/v4/index.d.cts +3 -0
  530. data/.opencode/node_modules/zod/v4/index.d.ts +3 -0
  531. data/.opencode/node_modules/zod/v4/index.js +3 -0
  532. data/.opencode/node_modules/zod/v4/locales/ar.cjs +143 -0
  533. data/.opencode/node_modules/zod/v4/locales/ar.d.cts +5 -0
  534. data/.opencode/node_modules/zod/v4/locales/ar.d.ts +4 -0
  535. data/.opencode/node_modules/zod/v4/locales/ar.js +116 -0
  536. data/.opencode/node_modules/zod/v4/locales/az.cjs +142 -0
  537. data/.opencode/node_modules/zod/v4/locales/az.d.cts +5 -0
  538. data/.opencode/node_modules/zod/v4/locales/az.d.ts +4 -0
  539. data/.opencode/node_modules/zod/v4/locales/az.js +115 -0
  540. data/.opencode/node_modules/zod/v4/locales/be.cjs +191 -0
  541. data/.opencode/node_modules/zod/v4/locales/be.d.cts +5 -0
  542. data/.opencode/node_modules/zod/v4/locales/be.d.ts +4 -0
  543. data/.opencode/node_modules/zod/v4/locales/be.js +164 -0
  544. data/.opencode/node_modules/zod/v4/locales/bg.cjs +156 -0
  545. data/.opencode/node_modules/zod/v4/locales/bg.d.cts +5 -0
  546. data/.opencode/node_modules/zod/v4/locales/bg.d.ts +5 -0
  547. data/.opencode/node_modules/zod/v4/locales/bg.js +128 -0
  548. data/.opencode/node_modules/zod/v4/locales/ca.cjs +145 -0
  549. data/.opencode/node_modules/zod/v4/locales/ca.d.cts +5 -0
  550. data/.opencode/node_modules/zod/v4/locales/ca.d.ts +4 -0
  551. data/.opencode/node_modules/zod/v4/locales/ca.js +118 -0
  552. data/.opencode/node_modules/zod/v4/locales/cs.cjs +162 -0
  553. data/.opencode/node_modules/zod/v4/locales/cs.d.cts +5 -0
  554. data/.opencode/node_modules/zod/v4/locales/cs.d.ts +4 -0
  555. data/.opencode/node_modules/zod/v4/locales/cs.js +135 -0
  556. data/.opencode/node_modules/zod/v4/locales/da.cjs +158 -0
  557. data/.opencode/node_modules/zod/v4/locales/da.d.cts +5 -0
  558. data/.opencode/node_modules/zod/v4/locales/da.d.ts +4 -0
  559. data/.opencode/node_modules/zod/v4/locales/da.js +131 -0
  560. data/.opencode/node_modules/zod/v4/locales/de.cjs +143 -0
  561. data/.opencode/node_modules/zod/v4/locales/de.d.cts +5 -0
  562. data/.opencode/node_modules/zod/v4/locales/de.d.ts +4 -0
  563. data/.opencode/node_modules/zod/v4/locales/de.js +116 -0
  564. data/.opencode/node_modules/zod/v4/locales/en.cjs +145 -0
  565. data/.opencode/node_modules/zod/v4/locales/en.d.cts +5 -0
  566. data/.opencode/node_modules/zod/v4/locales/en.d.ts +5 -0
  567. data/.opencode/node_modules/zod/v4/locales/en.js +117 -0
  568. data/.opencode/node_modules/zod/v4/locales/eo.cjs +144 -0
  569. data/.opencode/node_modules/zod/v4/locales/eo.d.cts +5 -0
  570. data/.opencode/node_modules/zod/v4/locales/eo.d.ts +5 -0
  571. data/.opencode/node_modules/zod/v4/locales/eo.js +116 -0
  572. data/.opencode/node_modules/zod/v4/locales/es.cjs +176 -0
  573. data/.opencode/node_modules/zod/v4/locales/es.d.cts +5 -0
  574. data/.opencode/node_modules/zod/v4/locales/es.d.ts +4 -0
  575. data/.opencode/node_modules/zod/v4/locales/es.js +149 -0
  576. data/.opencode/node_modules/zod/v4/locales/fa.cjs +149 -0
  577. data/.opencode/node_modules/zod/v4/locales/fa.d.cts +5 -0
  578. data/.opencode/node_modules/zod/v4/locales/fa.d.ts +4 -0
  579. data/.opencode/node_modules/zod/v4/locales/fa.js +122 -0
  580. data/.opencode/node_modules/zod/v4/locales/fi.cjs +149 -0
  581. data/.opencode/node_modules/zod/v4/locales/fi.d.cts +5 -0
  582. data/.opencode/node_modules/zod/v4/locales/fi.d.ts +4 -0
  583. data/.opencode/node_modules/zod/v4/locales/fi.js +122 -0
  584. data/.opencode/node_modules/zod/v4/locales/fr-CA.cjs +144 -0
  585. data/.opencode/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
  586. data/.opencode/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
  587. data/.opencode/node_modules/zod/v4/locales/fr-CA.js +117 -0
  588. data/.opencode/node_modules/zod/v4/locales/fr.cjs +143 -0
  589. data/.opencode/node_modules/zod/v4/locales/fr.d.cts +5 -0
  590. data/.opencode/node_modules/zod/v4/locales/fr.d.ts +4 -0
  591. data/.opencode/node_modules/zod/v4/locales/fr.js +116 -0
  592. data/.opencode/node_modules/zod/v4/locales/he.cjs +144 -0
  593. data/.opencode/node_modules/zod/v4/locales/he.d.cts +5 -0
  594. data/.opencode/node_modules/zod/v4/locales/he.d.ts +4 -0
  595. data/.opencode/node_modules/zod/v4/locales/he.js +117 -0
  596. data/.opencode/node_modules/zod/v4/locales/hu.cjs +144 -0
  597. data/.opencode/node_modules/zod/v4/locales/hu.d.cts +5 -0
  598. data/.opencode/node_modules/zod/v4/locales/hu.d.ts +4 -0
  599. data/.opencode/node_modules/zod/v4/locales/hu.js +117 -0
  600. data/.opencode/node_modules/zod/v4/locales/id.cjs +143 -0
  601. data/.opencode/node_modules/zod/v4/locales/id.d.cts +5 -0
  602. data/.opencode/node_modules/zod/v4/locales/id.d.ts +4 -0
  603. data/.opencode/node_modules/zod/v4/locales/id.js +116 -0
  604. data/.opencode/node_modules/zod/v4/locales/index.cjs +98 -0
  605. data/.opencode/node_modules/zod/v4/locales/index.d.cts +46 -0
  606. data/.opencode/node_modules/zod/v4/locales/index.d.ts +46 -0
  607. data/.opencode/node_modules/zod/v4/locales/index.js +46 -0
  608. data/.opencode/node_modules/zod/v4/locales/is.cjs +145 -0
  609. data/.opencode/node_modules/zod/v4/locales/is.d.cts +5 -0
  610. data/.opencode/node_modules/zod/v4/locales/is.d.ts +5 -0
  611. data/.opencode/node_modules/zod/v4/locales/is.js +117 -0
  612. data/.opencode/node_modules/zod/v4/locales/it.cjs +144 -0
  613. data/.opencode/node_modules/zod/v4/locales/it.d.cts +5 -0
  614. data/.opencode/node_modules/zod/v4/locales/it.d.ts +4 -0
  615. data/.opencode/node_modules/zod/v4/locales/it.js +117 -0
  616. data/.opencode/node_modules/zod/v4/locales/ja.cjs +142 -0
  617. data/.opencode/node_modules/zod/v4/locales/ja.d.cts +5 -0
  618. data/.opencode/node_modules/zod/v4/locales/ja.d.ts +4 -0
  619. data/.opencode/node_modules/zod/v4/locales/ja.js +115 -0
  620. data/.opencode/node_modules/zod/v4/locales/ka.cjs +153 -0
  621. data/.opencode/node_modules/zod/v4/locales/ka.d.cts +5 -0
  622. data/.opencode/node_modules/zod/v4/locales/ka.d.ts +5 -0
  623. data/.opencode/node_modules/zod/v4/locales/ka.js +125 -0
  624. data/.opencode/node_modules/zod/v4/locales/kh.cjs +12 -0
  625. data/.opencode/node_modules/zod/v4/locales/kh.d.cts +5 -0
  626. data/.opencode/node_modules/zod/v4/locales/kh.d.ts +5 -0
  627. data/.opencode/node_modules/zod/v4/locales/kh.js +5 -0
  628. data/.opencode/node_modules/zod/v4/locales/km.cjs +144 -0
  629. data/.opencode/node_modules/zod/v4/locales/km.d.cts +5 -0
  630. data/.opencode/node_modules/zod/v4/locales/km.d.ts +4 -0
  631. data/.opencode/node_modules/zod/v4/locales/km.js +117 -0
  632. data/.opencode/node_modules/zod/v4/locales/ko.cjs +148 -0
  633. data/.opencode/node_modules/zod/v4/locales/ko.d.cts +5 -0
  634. data/.opencode/node_modules/zod/v4/locales/ko.d.ts +4 -0
  635. data/.opencode/node_modules/zod/v4/locales/ko.js +121 -0
  636. data/.opencode/node_modules/zod/v4/locales/lt.cjs +258 -0
  637. data/.opencode/node_modules/zod/v4/locales/lt.d.cts +5 -0
  638. data/.opencode/node_modules/zod/v4/locales/lt.d.ts +5 -0
  639. data/.opencode/node_modules/zod/v4/locales/lt.js +230 -0
  640. data/.opencode/node_modules/zod/v4/locales/mk.cjs +145 -0
  641. data/.opencode/node_modules/zod/v4/locales/mk.d.cts +5 -0
  642. data/.opencode/node_modules/zod/v4/locales/mk.d.ts +4 -0
  643. data/.opencode/node_modules/zod/v4/locales/mk.js +118 -0
  644. data/.opencode/node_modules/zod/v4/locales/ms.cjs +143 -0
  645. data/.opencode/node_modules/zod/v4/locales/ms.d.cts +5 -0
  646. data/.opencode/node_modules/zod/v4/locales/ms.d.ts +4 -0
  647. data/.opencode/node_modules/zod/v4/locales/ms.js +116 -0
  648. data/.opencode/node_modules/zod/v4/locales/nl.cjs +144 -0
  649. data/.opencode/node_modules/zod/v4/locales/nl.d.cts +5 -0
  650. data/.opencode/node_modules/zod/v4/locales/nl.d.ts +4 -0
  651. data/.opencode/node_modules/zod/v4/locales/nl.js +117 -0
  652. data/.opencode/node_modules/zod/v4/locales/no.cjs +143 -0
  653. data/.opencode/node_modules/zod/v4/locales/no.d.cts +5 -0
  654. data/.opencode/node_modules/zod/v4/locales/no.d.ts +4 -0
  655. data/.opencode/node_modules/zod/v4/locales/no.js +116 -0
  656. data/.opencode/node_modules/zod/v4/locales/ota.cjs +144 -0
  657. data/.opencode/node_modules/zod/v4/locales/ota.d.cts +5 -0
  658. data/.opencode/node_modules/zod/v4/locales/ota.d.ts +4 -0
  659. data/.opencode/node_modules/zod/v4/locales/ota.js +117 -0
  660. data/.opencode/node_modules/zod/v4/locales/package.json +6 -0
  661. data/.opencode/node_modules/zod/v4/locales/pl.cjs +144 -0
  662. data/.opencode/node_modules/zod/v4/locales/pl.d.cts +5 -0
  663. data/.opencode/node_modules/zod/v4/locales/pl.d.ts +4 -0
  664. data/.opencode/node_modules/zod/v4/locales/pl.js +117 -0
  665. data/.opencode/node_modules/zod/v4/locales/ps.cjs +149 -0
  666. data/.opencode/node_modules/zod/v4/locales/ps.d.cts +5 -0
  667. data/.opencode/node_modules/zod/v4/locales/ps.d.ts +4 -0
  668. data/.opencode/node_modules/zod/v4/locales/ps.js +122 -0
  669. data/.opencode/node_modules/zod/v4/locales/pt.cjs +143 -0
  670. data/.opencode/node_modules/zod/v4/locales/pt.d.cts +5 -0
  671. data/.opencode/node_modules/zod/v4/locales/pt.d.ts +4 -0
  672. data/.opencode/node_modules/zod/v4/locales/pt.js +116 -0
  673. data/.opencode/node_modules/zod/v4/locales/ru.cjs +191 -0
  674. data/.opencode/node_modules/zod/v4/locales/ru.d.cts +5 -0
  675. data/.opencode/node_modules/zod/v4/locales/ru.d.ts +4 -0
  676. data/.opencode/node_modules/zod/v4/locales/ru.js +164 -0
  677. data/.opencode/node_modules/zod/v4/locales/sl.cjs +144 -0
  678. data/.opencode/node_modules/zod/v4/locales/sl.d.cts +5 -0
  679. data/.opencode/node_modules/zod/v4/locales/sl.d.ts +4 -0
  680. data/.opencode/node_modules/zod/v4/locales/sl.js +117 -0
  681. data/.opencode/node_modules/zod/v4/locales/sv.cjs +145 -0
  682. data/.opencode/node_modules/zod/v4/locales/sv.d.cts +5 -0
  683. data/.opencode/node_modules/zod/v4/locales/sv.d.ts +4 -0
  684. data/.opencode/node_modules/zod/v4/locales/sv.js +118 -0
  685. data/.opencode/node_modules/zod/v4/locales/ta.cjs +144 -0
  686. data/.opencode/node_modules/zod/v4/locales/ta.d.cts +5 -0
  687. data/.opencode/node_modules/zod/v4/locales/ta.d.ts +4 -0
  688. data/.opencode/node_modules/zod/v4/locales/ta.js +117 -0
  689. data/.opencode/node_modules/zod/v4/locales/th.cjs +144 -0
  690. data/.opencode/node_modules/zod/v4/locales/th.d.cts +5 -0
  691. data/.opencode/node_modules/zod/v4/locales/th.d.ts +4 -0
  692. data/.opencode/node_modules/zod/v4/locales/th.js +117 -0
  693. data/.opencode/node_modules/zod/v4/locales/tr.cjs +143 -0
  694. data/.opencode/node_modules/zod/v4/locales/tr.d.cts +5 -0
  695. data/.opencode/node_modules/zod/v4/locales/tr.d.ts +5 -0
  696. data/.opencode/node_modules/zod/v4/locales/tr.js +115 -0
  697. data/.opencode/node_modules/zod/v4/locales/ua.cjs +12 -0
  698. data/.opencode/node_modules/zod/v4/locales/ua.d.cts +5 -0
  699. data/.opencode/node_modules/zod/v4/locales/ua.d.ts +5 -0
  700. data/.opencode/node_modules/zod/v4/locales/ua.js +5 -0
  701. data/.opencode/node_modules/zod/v4/locales/uk.cjs +144 -0
  702. data/.opencode/node_modules/zod/v4/locales/uk.d.cts +5 -0
  703. data/.opencode/node_modules/zod/v4/locales/uk.d.ts +4 -0
  704. data/.opencode/node_modules/zod/v4/locales/uk.js +117 -0
  705. data/.opencode/node_modules/zod/v4/locales/ur.cjs +144 -0
  706. data/.opencode/node_modules/zod/v4/locales/ur.d.cts +5 -0
  707. data/.opencode/node_modules/zod/v4/locales/ur.d.ts +4 -0
  708. data/.opencode/node_modules/zod/v4/locales/ur.js +117 -0
  709. data/.opencode/node_modules/zod/v4/locales/vi.cjs +143 -0
  710. data/.opencode/node_modules/zod/v4/locales/vi.d.cts +5 -0
  711. data/.opencode/node_modules/zod/v4/locales/vi.d.ts +4 -0
  712. data/.opencode/node_modules/zod/v4/locales/vi.js +116 -0
  713. data/.opencode/node_modules/zod/v4/locales/yo.cjs +142 -0
  714. data/.opencode/node_modules/zod/v4/locales/yo.d.cts +5 -0
  715. data/.opencode/node_modules/zod/v4/locales/yo.d.ts +4 -0
  716. data/.opencode/node_modules/zod/v4/locales/yo.js +115 -0
  717. data/.opencode/node_modules/zod/v4/locales/zh-CN.cjs +143 -0
  718. data/.opencode/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
  719. data/.opencode/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
  720. data/.opencode/node_modules/zod/v4/locales/zh-CN.js +116 -0
  721. data/.opencode/node_modules/zod/v4/locales/zh-TW.cjs +144 -0
  722. data/.opencode/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
  723. data/.opencode/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
  724. data/.opencode/node_modules/zod/v4/locales/zh-TW.js +117 -0
  725. data/.opencode/node_modules/zod/v4/mini/checks.cjs +34 -0
  726. data/.opencode/node_modules/zod/v4/mini/checks.d.cts +1 -0
  727. data/.opencode/node_modules/zod/v4/mini/checks.d.ts +1 -0
  728. data/.opencode/node_modules/zod/v4/mini/checks.js +1 -0
  729. data/.opencode/node_modules/zod/v4/mini/coerce.cjs +47 -0
  730. data/.opencode/node_modules/zod/v4/mini/coerce.d.cts +7 -0
  731. data/.opencode/node_modules/zod/v4/mini/coerce.d.ts +7 -0
  732. data/.opencode/node_modules/zod/v4/mini/coerce.js +17 -0
  733. data/.opencode/node_modules/zod/v4/mini/external.cjs +62 -0
  734. data/.opencode/node_modules/zod/v4/mini/external.d.cts +11 -0
  735. data/.opencode/node_modules/zod/v4/mini/external.d.ts +11 -0
  736. data/.opencode/node_modules/zod/v4/mini/external.js +13 -0
  737. data/.opencode/node_modules/zod/v4/mini/index.cjs +32 -0
  738. data/.opencode/node_modules/zod/v4/mini/index.d.cts +3 -0
  739. data/.opencode/node_modules/zod/v4/mini/index.d.ts +3 -0
  740. data/.opencode/node_modules/zod/v4/mini/index.js +3 -0
  741. data/.opencode/node_modules/zod/v4/mini/iso.cjs +60 -0
  742. data/.opencode/node_modules/zod/v4/mini/iso.d.cts +22 -0
  743. data/.opencode/node_modules/zod/v4/mini/iso.d.ts +22 -0
  744. data/.opencode/node_modules/zod/v4/mini/iso.js +30 -0
  745. data/.opencode/node_modules/zod/v4/mini/package.json +6 -0
  746. data/.opencode/node_modules/zod/v4/mini/parse.cjs +16 -0
  747. data/.opencode/node_modules/zod/v4/mini/parse.d.cts +1 -0
  748. data/.opencode/node_modules/zod/v4/mini/parse.d.ts +1 -0
  749. data/.opencode/node_modules/zod/v4/mini/parse.js +1 -0
  750. data/.opencode/node_modules/zod/v4/mini/schemas.cjs +906 -0
  751. data/.opencode/node_modules/zod/v4/mini/schemas.d.cts +407 -0
  752. data/.opencode/node_modules/zod/v4/mini/schemas.d.ts +407 -0
  753. data/.opencode/node_modules/zod/v4/mini/schemas.js +789 -0
  754. data/.opencode/node_modules/zod/v4/package.json +6 -0
  755. data/.opencode/node_modules/zod/v4-mini/index.cjs +17 -0
  756. data/.opencode/node_modules/zod/v4-mini/index.d.cts +1 -0
  757. data/.opencode/node_modules/zod/v4-mini/index.d.ts +1 -0
  758. data/.opencode/node_modules/zod/v4-mini/index.js +1 -0
  759. data/.opencode/node_modules/zod/v4-mini/package.json +6 -0
  760. data/.opencode/package.json +5 -0
  761. data/lib/agentf/agents/base.rb +6 -21
  762. data/lib/agentf/agents/designer.rb +16 -2
  763. data/lib/agentf/agents/specialist.rb +17 -3
  764. data/lib/agentf/agents/tester.rb +16 -2
  765. data/lib/agentf/cli/memory.rb +34 -27
  766. data/lib/agentf/commands/explorer.rb +12 -4
  767. data/lib/agentf/commands/memory_reviewer.rb +6 -6
  768. data/lib/agentf/installer.rb +89 -4
  769. data/lib/agentf/mcp/server.rb +85 -77
  770. data/lib/agentf/memory/confirmation_handler.rb +24 -0
  771. data/lib/agentf/memory.rb +6 -0
  772. data/lib/agentf/version.rb +1 -1
  773. data/lib/agentf.rb +1 -0
  774. metadata +762 -2
@@ -0,0 +1,2205 @@
1
+ import * as core from "../core/index.js";
2
+ import { util } from "../core/index.js";
3
+
4
+ import * as checks from "./checks.js";
5
+ import * as iso from "./iso.js";
6
+ import * as parse from "./parse.js";
7
+
8
+ ///////////////////////////////////////////
9
+ ///////////////////////////////////////////
10
+ //////////// ////////////
11
+ //////////// ZodType ////////////
12
+ //////////// ////////////
13
+ ///////////////////////////////////////////
14
+ ///////////////////////////////////////////
15
+
16
+ export interface ZodType<
17
+ out Output = unknown,
18
+ out Input = unknown,
19
+ out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>,
20
+ > extends core.$ZodType<Output, Input, Internals> {
21
+ def: Internals["def"];
22
+ type: Internals["def"]["type"];
23
+
24
+ /** @deprecated Use `.def` instead. */
25
+ _def: Internals["def"];
26
+ /** @deprecated Use `z.output<typeof schema>` instead. */
27
+ _output: Internals["output"];
28
+ /** @deprecated Use `z.input<typeof schema>` instead. */
29
+ _input: Internals["input"];
30
+
31
+ // base methods
32
+ check(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
33
+ clone(def?: Internals["def"], params?: { parent: boolean }): this;
34
+ register<R extends core.$ZodRegistry>(
35
+ registry: R,
36
+ ...meta: this extends R["_schema"]
37
+ ? undefined extends R["_meta"]
38
+ ? [core.$replace<R["_meta"], this>?]
39
+ : [core.$replace<R["_meta"], this>]
40
+ : ["Incompatible schema"]
41
+ ): this;
42
+
43
+ brand<T extends PropertyKey = PropertyKey>(value?: T): PropertyKey extends T ? this : core.$ZodBranded<this, T>;
44
+
45
+ // parsing
46
+ parse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
47
+ safeParse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): parse.ZodSafeParseResult<core.output<this>>;
48
+ parseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
49
+ safeParseAsync(
50
+ data: unknown,
51
+ params?: core.ParseContext<core.$ZodIssue>
52
+ ): Promise<parse.ZodSafeParseResult<core.output<this>>>;
53
+ spa: (
54
+ data: unknown,
55
+ params?: core.ParseContext<core.$ZodIssue>
56
+ ) => Promise<parse.ZodSafeParseResult<core.output<this>>>;
57
+
58
+ // encoding/decoding
59
+ encode(data: core.output<this>, params?: core.ParseContext<core.$ZodIssue>): core.input<this>;
60
+ decode(data: core.input<this>, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
61
+ encodeAsync(data: core.output<this>, params?: core.ParseContext<core.$ZodIssue>): Promise<core.input<this>>;
62
+ decodeAsync(data: core.input<this>, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
63
+ safeEncode(
64
+ data: core.output<this>,
65
+ params?: core.ParseContext<core.$ZodIssue>
66
+ ): parse.ZodSafeParseResult<core.input<this>>;
67
+ safeDecode(
68
+ data: core.input<this>,
69
+ params?: core.ParseContext<core.$ZodIssue>
70
+ ): parse.ZodSafeParseResult<core.output<this>>;
71
+ safeEncodeAsync(
72
+ data: core.output<this>,
73
+ params?: core.ParseContext<core.$ZodIssue>
74
+ ): Promise<parse.ZodSafeParseResult<core.input<this>>>;
75
+ safeDecodeAsync(
76
+ data: core.input<this>,
77
+ params?: core.ParseContext<core.$ZodIssue>
78
+ ): Promise<parse.ZodSafeParseResult<core.output<this>>>;
79
+
80
+ // refinements
81
+ refine(check: (arg: core.output<this>) => unknown | Promise<unknown>, params?: string | core.$ZodCustomParams): this;
82
+ superRefine(
83
+ refinement: (arg: core.output<this>, ctx: core.$RefinementCtx<core.output<this>>) => void | Promise<void>
84
+ ): this;
85
+ overwrite(fn: (x: core.output<this>) => core.output<this>): this;
86
+
87
+ // wrappers
88
+ optional(): ZodOptional<this>;
89
+ nonoptional(params?: string | core.$ZodNonOptionalParams): ZodNonOptional<this>;
90
+ nullable(): ZodNullable<this>;
91
+ nullish(): ZodOptional<ZodNullable<this>>;
92
+ default(def: util.NoUndefined<core.output<this>>): ZodDefault<this>;
93
+ default(def: () => util.NoUndefined<core.output<this>>): ZodDefault<this>;
94
+ prefault(def: () => core.input<this>): ZodPrefault<this>;
95
+ prefault(def: core.input<this>): ZodPrefault<this>;
96
+ array(): ZodArray<this>;
97
+ or<T extends core.SomeType>(option: T): ZodUnion<[this, T]>;
98
+ and<T extends core.SomeType>(incoming: T): ZodIntersection<this, T>;
99
+ transform<NewOut>(
100
+ transform: (arg: core.output<this>, ctx: core.$RefinementCtx<core.output<this>>) => NewOut | Promise<NewOut>
101
+ ): ZodPipe<this, ZodTransform<Awaited<NewOut>, core.output<this>>>;
102
+ catch(def: core.output<this>): ZodCatch<this>;
103
+ catch(def: (ctx: core.$ZodCatchCtx) => core.output<this>): ZodCatch<this>;
104
+ pipe<T extends core.$ZodType<any, core.output<this>>>(
105
+ target: T | core.$ZodType<any, core.output<this>>
106
+ ): ZodPipe<this, T>;
107
+ readonly(): ZodReadonly<this>;
108
+
109
+ /** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */
110
+ describe(description: string): this;
111
+ description?: string;
112
+ /** Returns the metadata associated with this instance in `z.globalRegistry` */
113
+ meta(): core.$replace<core.GlobalMeta, this> | undefined;
114
+ /** Returns a new instance that has been registered in `z.globalRegistry` with the specified metadata */
115
+ meta(data: core.$replace<core.GlobalMeta, this>): this;
116
+
117
+ // helpers
118
+ /** @deprecated Try safe-parsing `undefined` (this is what `isOptional` does internally):
119
+ *
120
+ * ```ts
121
+ * const schema = z.string().optional();
122
+ * const isOptional = schema.safeParse(undefined).success; // true
123
+ * ```
124
+ */
125
+ isOptional(): boolean;
126
+ /**
127
+ * @deprecated Try safe-parsing `null` (this is what `isNullable` does internally):
128
+ *
129
+ * ```ts
130
+ * const schema = z.string().nullable();
131
+ * const isNullable = schema.safeParse(null).success; // true
132
+ * ```
133
+ */
134
+ isNullable(): boolean;
135
+ }
136
+
137
+ export interface _ZodType<out Internals extends core.$ZodTypeInternals = core.$ZodTypeInternals>
138
+ extends ZodType<any, any, Internals> {}
139
+
140
+ export const ZodType: core.$constructor<ZodType> = /*@__PURE__*/ core.$constructor("ZodType", (inst, def) => {
141
+ core.$ZodType.init(inst, def);
142
+ inst.def = def;
143
+ inst.type = def.type;
144
+ Object.defineProperty(inst, "_def", { value: def });
145
+
146
+ // base methods
147
+ inst.check = (...checks) => {
148
+ return inst.clone(
149
+ {
150
+ ...def,
151
+ checks: [
152
+ ...(def.checks ?? []),
153
+ ...checks.map((ch) =>
154
+ typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch
155
+ ),
156
+ ],
157
+ }
158
+ // { parent: true }
159
+ );
160
+ };
161
+ inst.clone = (def, params) => core.clone(inst, def, params);
162
+ inst.brand = () => inst as any;
163
+ inst.register = ((reg: any, meta: any) => {
164
+ reg.add(inst, meta);
165
+ return inst;
166
+ }) as any;
167
+
168
+ // parsing
169
+ inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });
170
+ inst.safeParse = (data, params) => parse.safeParse(inst, data, params);
171
+ inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });
172
+ inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);
173
+ inst.spa = inst.safeParseAsync;
174
+
175
+ // encoding/decoding
176
+ inst.encode = (data, params) => parse.encode(inst, data, params);
177
+ inst.decode = (data, params) => parse.decode(inst, data, params);
178
+ inst.encodeAsync = async (data, params) => parse.encodeAsync(inst, data, params);
179
+ inst.decodeAsync = async (data, params) => parse.decodeAsync(inst, data, params);
180
+ inst.safeEncode = (data, params) => parse.safeEncode(inst, data, params);
181
+ inst.safeDecode = (data, params) => parse.safeDecode(inst, data, params);
182
+ inst.safeEncodeAsync = async (data, params) => parse.safeEncodeAsync(inst, data, params);
183
+ inst.safeDecodeAsync = async (data, params) => parse.safeDecodeAsync(inst, data, params);
184
+
185
+ // refinements
186
+ inst.refine = (check, params) => inst.check(refine(check, params));
187
+ inst.superRefine = (refinement) => inst.check(superRefine(refinement));
188
+ inst.overwrite = (fn) => inst.check(checks.overwrite(fn));
189
+
190
+ // wrappers
191
+ inst.optional = () => optional(inst);
192
+ inst.nullable = () => nullable(inst);
193
+ inst.nullish = () => optional(nullable(inst));
194
+ inst.nonoptional = (params) => nonoptional(inst, params);
195
+ inst.array = () => array(inst);
196
+ inst.or = (arg) => union([inst, arg]);
197
+ inst.and = (arg) => intersection(inst, arg);
198
+ inst.transform = (tx) => pipe(inst, transform(tx as any)) as never;
199
+ inst.default = (def) => _default(inst, def);
200
+ inst.prefault = (def) => prefault(inst, def);
201
+ // inst.coalesce = (def, params) => coalesce(inst, def, params);
202
+ inst.catch = (params) => _catch(inst, params);
203
+ inst.pipe = (target) => pipe(inst, target);
204
+ inst.readonly = () => readonly(inst);
205
+
206
+ // meta
207
+ inst.describe = (description) => {
208
+ const cl = inst.clone();
209
+ core.globalRegistry.add(cl, { description });
210
+ return cl;
211
+ };
212
+ Object.defineProperty(inst, "description", {
213
+ get() {
214
+ return core.globalRegistry.get(inst)?.description;
215
+ },
216
+ configurable: true,
217
+ });
218
+ inst.meta = (...args: any) => {
219
+ if (args.length === 0) {
220
+ return core.globalRegistry.get(inst);
221
+ }
222
+ const cl = inst.clone();
223
+ core.globalRegistry.add(cl, args[0]);
224
+ return cl as any;
225
+ };
226
+
227
+ // helpers
228
+ inst.isOptional = () => inst.safeParse(undefined).success;
229
+ inst.isNullable = () => inst.safeParse(null).success;
230
+ return inst;
231
+ });
232
+
233
+ // ZodString
234
+ export interface _ZodString<T extends core.$ZodStringInternals<unknown> = core.$ZodStringInternals<unknown>>
235
+ extends _ZodType<T> {
236
+ format: string | null;
237
+ minLength: number | null;
238
+ maxLength: number | null;
239
+
240
+ // miscellaneous checks
241
+ regex(regex: RegExp, params?: string | core.$ZodCheckRegexParams): this;
242
+ includes(value: string, params?: core.$ZodCheckIncludesParams): this;
243
+ startsWith(value: string, params?: string | core.$ZodCheckStartsWithParams): this;
244
+ endsWith(value: string, params?: string | core.$ZodCheckEndsWithParams): this;
245
+ min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
246
+ max(maxLength: number, params?: string | core.$ZodCheckMaxLengthParams): this;
247
+ length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
248
+ nonempty(params?: string | core.$ZodCheckMinLengthParams): this;
249
+ lowercase(params?: string | core.$ZodCheckLowerCaseParams): this;
250
+ uppercase(params?: string | core.$ZodCheckUpperCaseParams): this;
251
+
252
+ // transforms
253
+ trim(): this;
254
+ normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})): this;
255
+ toLowerCase(): this;
256
+ toUpperCase(): this;
257
+ }
258
+
259
+ /** @internal */
260
+ export const _ZodString: core.$constructor<_ZodString> = /*@__PURE__*/ core.$constructor("_ZodString", (inst, def) => {
261
+ core.$ZodString.init(inst, def);
262
+ ZodType.init(inst, def);
263
+
264
+ const bag = inst._zod.bag;
265
+ inst.format = bag.format ?? null;
266
+ inst.minLength = bag.minimum ?? null;
267
+ inst.maxLength = bag.maximum ?? null;
268
+
269
+ // validations
270
+ inst.regex = (...args) => inst.check(checks.regex(...args));
271
+ inst.includes = (...args) => inst.check(checks.includes(...args));
272
+ inst.startsWith = (...args) => inst.check(checks.startsWith(...args));
273
+ inst.endsWith = (...args) => inst.check(checks.endsWith(...args));
274
+ inst.min = (...args) => inst.check(checks.minLength(...args));
275
+ inst.max = (...args) => inst.check(checks.maxLength(...args));
276
+ inst.length = (...args) => inst.check(checks.length(...args));
277
+ inst.nonempty = (...args) => inst.check(checks.minLength(1, ...args));
278
+ inst.lowercase = (params) => inst.check(checks.lowercase(params));
279
+ inst.uppercase = (params) => inst.check(checks.uppercase(params));
280
+
281
+ // transforms
282
+ inst.trim = () => inst.check(checks.trim());
283
+ inst.normalize = (...args) => inst.check(checks.normalize(...args));
284
+ inst.toLowerCase = () => inst.check(checks.toLowerCase());
285
+ inst.toUpperCase = () => inst.check(checks.toUpperCase());
286
+ });
287
+
288
+ export interface ZodString extends _ZodString<core.$ZodStringInternals<string>> {
289
+ // string format checks
290
+
291
+ /** @deprecated Use `z.email()` instead. */
292
+ email(params?: string | core.$ZodCheckEmailParams): this;
293
+ /** @deprecated Use `z.url()` instead. */
294
+ url(params?: string | core.$ZodCheckURLParams): this;
295
+ /** @deprecated Use `z.jwt()` instead. */
296
+ jwt(params?: string | core.$ZodCheckJWTParams): this;
297
+ /** @deprecated Use `z.emoji()` instead. */
298
+ emoji(params?: string | core.$ZodCheckEmojiParams): this;
299
+ /** @deprecated Use `z.guid()` instead. */
300
+ guid(params?: string | core.$ZodCheckGUIDParams): this;
301
+ /** @deprecated Use `z.uuid()` instead. */
302
+ uuid(params?: string | core.$ZodCheckUUIDParams): this;
303
+ /** @deprecated Use `z.uuid()` instead. */
304
+ uuidv4(params?: string | core.$ZodCheckUUIDParams): this;
305
+ /** @deprecated Use `z.uuid()` instead. */
306
+ uuidv6(params?: string | core.$ZodCheckUUIDParams): this;
307
+ /** @deprecated Use `z.uuid()` instead. */
308
+ uuidv7(params?: string | core.$ZodCheckUUIDParams): this;
309
+ /** @deprecated Use `z.nanoid()` instead. */
310
+ nanoid(params?: string | core.$ZodCheckNanoIDParams): this;
311
+ /** @deprecated Use `z.guid()` instead. */
312
+ guid(params?: string | core.$ZodCheckGUIDParams): this;
313
+ /** @deprecated Use `z.cuid()` instead. */
314
+ cuid(params?: string | core.$ZodCheckCUIDParams): this;
315
+ /** @deprecated Use `z.cuid2()` instead. */
316
+ cuid2(params?: string | core.$ZodCheckCUID2Params): this;
317
+ /** @deprecated Use `z.ulid()` instead. */
318
+ ulid(params?: string | core.$ZodCheckULIDParams): this;
319
+ /** @deprecated Use `z.base64()` instead. */
320
+ base64(params?: string | core.$ZodCheckBase64Params): this;
321
+ /** @deprecated Use `z.base64url()` instead. */
322
+ base64url(params?: string | core.$ZodCheckBase64URLParams): this;
323
+ // /** @deprecated Use `z.jsonString()` instead. */
324
+ // jsonString(params?: string | core.$ZodCheckJSONStringParams): this;
325
+ /** @deprecated Use `z.xid()` instead. */
326
+ xid(params?: string | core.$ZodCheckXIDParams): this;
327
+ /** @deprecated Use `z.ksuid()` instead. */
328
+ ksuid(params?: string | core.$ZodCheckKSUIDParams): this;
329
+ // /** @deprecated Use `z.ipv4()` or `z.ipv6()` instead. */
330
+ // ip(params?: string | (core.$ZodCheckIPv4Params & { version?: "v4" | "v6" })): ZodUnion<[this, this]>;
331
+ /** @deprecated Use `z.ipv4()` instead. */
332
+ ipv4(params?: string | core.$ZodCheckIPv4Params): this;
333
+ /** @deprecated Use `z.ipv6()` instead. */
334
+ ipv6(params?: string | core.$ZodCheckIPv6Params): this;
335
+ /** @deprecated Use `z.cidrv4()` instead. */
336
+ cidrv4(params?: string | core.$ZodCheckCIDRv4Params): this;
337
+ /** @deprecated Use `z.cidrv6()` instead. */
338
+ cidrv6(params?: string | core.$ZodCheckCIDRv6Params): this;
339
+ /** @deprecated Use `z.e164()` instead. */
340
+ e164(params?: string | core.$ZodCheckE164Params): this;
341
+
342
+ // ISO 8601 checks
343
+ /** @deprecated Use `z.iso.datetime()` instead. */
344
+ datetime(params?: string | core.$ZodCheckISODateTimeParams): this;
345
+ /** @deprecated Use `z.iso.date()` instead. */
346
+ date(params?: string | core.$ZodCheckISODateParams): this;
347
+ /** @deprecated Use `z.iso.time()` instead. */
348
+ time(
349
+ params?:
350
+ | string
351
+ // | {
352
+ // message?: string | undefined;
353
+ // precision?: number | null;
354
+ // }
355
+ | core.$ZodCheckISOTimeParams
356
+ ): this;
357
+ /** @deprecated Use `z.iso.duration()` instead. */
358
+ duration(params?: string | core.$ZodCheckISODurationParams): this;
359
+ }
360
+
361
+ export const ZodString: core.$constructor<ZodString> = /*@__PURE__*/ core.$constructor("ZodString", (inst, def) => {
362
+ core.$ZodString.init(inst, def);
363
+ _ZodString.init(inst, def);
364
+
365
+ inst.email = (params) => inst.check(core._email(ZodEmail, params));
366
+ inst.url = (params) => inst.check(core._url(ZodURL, params));
367
+ inst.jwt = (params) => inst.check(core._jwt(ZodJWT, params));
368
+ inst.emoji = (params) => inst.check(core._emoji(ZodEmoji, params));
369
+ inst.guid = (params) => inst.check(core._guid(ZodGUID, params));
370
+ inst.uuid = (params) => inst.check(core._uuid(ZodUUID, params));
371
+ inst.uuidv4 = (params) => inst.check(core._uuidv4(ZodUUID, params));
372
+ inst.uuidv6 = (params) => inst.check(core._uuidv6(ZodUUID, params));
373
+ inst.uuidv7 = (params) => inst.check(core._uuidv7(ZodUUID, params));
374
+ inst.nanoid = (params) => inst.check(core._nanoid(ZodNanoID, params));
375
+ inst.guid = (params) => inst.check(core._guid(ZodGUID, params));
376
+ inst.cuid = (params) => inst.check(core._cuid(ZodCUID, params));
377
+ inst.cuid2 = (params) => inst.check(core._cuid2(ZodCUID2, params));
378
+ inst.ulid = (params) => inst.check(core._ulid(ZodULID, params));
379
+ inst.base64 = (params) => inst.check(core._base64(ZodBase64, params));
380
+ inst.base64url = (params) => inst.check(core._base64url(ZodBase64URL, params));
381
+ inst.xid = (params) => inst.check(core._xid(ZodXID, params));
382
+ inst.ksuid = (params) => inst.check(core._ksuid(ZodKSUID, params));
383
+ inst.ipv4 = (params) => inst.check(core._ipv4(ZodIPv4, params));
384
+ inst.ipv6 = (params) => inst.check(core._ipv6(ZodIPv6, params));
385
+ inst.cidrv4 = (params) => inst.check(core._cidrv4(ZodCIDRv4, params));
386
+ inst.cidrv6 = (params) => inst.check(core._cidrv6(ZodCIDRv6, params));
387
+ inst.e164 = (params) => inst.check(core._e164(ZodE164, params));
388
+
389
+ // iso
390
+ inst.datetime = (params) => inst.check(iso.datetime(params as any));
391
+ inst.date = (params) => inst.check(iso.date(params as any));
392
+ inst.time = (params) => inst.check(iso.time(params as any));
393
+ inst.duration = (params) => inst.check(iso.duration(params as any));
394
+ });
395
+
396
+ export function string(params?: string | core.$ZodStringParams): ZodString;
397
+ export function string<T extends string>(params?: string | core.$ZodStringParams): core.$ZodType<T, T>;
398
+ export function string(params?: string | core.$ZodStringParams): ZodString {
399
+ return core._string(ZodString, params) as any;
400
+ }
401
+
402
+ // ZodStringFormat
403
+ export interface ZodStringFormat<Format extends string = string>
404
+ extends _ZodString<core.$ZodStringFormatInternals<Format>> {}
405
+ export const ZodStringFormat: core.$constructor<ZodStringFormat> = /*@__PURE__*/ core.$constructor(
406
+ "ZodStringFormat",
407
+ (inst, def) => {
408
+ core.$ZodStringFormat.init(inst, def);
409
+ _ZodString.init(inst, def);
410
+ }
411
+ );
412
+
413
+ // ZodEmail
414
+ export interface ZodEmail extends ZodStringFormat<"email"> {
415
+ _zod: core.$ZodEmailInternals;
416
+ }
417
+ export const ZodEmail: core.$constructor<ZodEmail> = /*@__PURE__*/ core.$constructor("ZodEmail", (inst, def) => {
418
+ // ZodStringFormat.init(inst, def);
419
+ core.$ZodEmail.init(inst, def);
420
+ ZodStringFormat.init(inst, def);
421
+ });
422
+
423
+ export function email(params?: string | core.$ZodEmailParams): ZodEmail {
424
+ return core._email(ZodEmail, params);
425
+ }
426
+
427
+ // ZodGUID
428
+ export interface ZodGUID extends ZodStringFormat<"guid"> {
429
+ _zod: core.$ZodGUIDInternals;
430
+ }
431
+ export const ZodGUID: core.$constructor<ZodGUID> = /*@__PURE__*/ core.$constructor("ZodGUID", (inst, def) => {
432
+ // ZodStringFormat.init(inst, def);
433
+ core.$ZodGUID.init(inst, def);
434
+ ZodStringFormat.init(inst, def);
435
+ });
436
+
437
+ export function guid(params?: string | core.$ZodGUIDParams): ZodGUID {
438
+ return core._guid(ZodGUID, params);
439
+ }
440
+
441
+ // ZodUUID
442
+ export interface ZodUUID extends ZodStringFormat<"uuid"> {
443
+ _zod: core.$ZodUUIDInternals;
444
+ }
445
+ export const ZodUUID: core.$constructor<ZodUUID> = /*@__PURE__*/ core.$constructor("ZodUUID", (inst, def) => {
446
+ // ZodStringFormat.init(inst, def);
447
+ core.$ZodUUID.init(inst, def);
448
+ ZodStringFormat.init(inst, def);
449
+ });
450
+
451
+ export function uuid(params?: string | core.$ZodUUIDParams): ZodUUID {
452
+ return core._uuid(ZodUUID, params);
453
+ }
454
+
455
+ export function uuidv4(params?: string | core.$ZodUUIDv4Params): ZodUUID {
456
+ return core._uuidv4(ZodUUID, params);
457
+ }
458
+
459
+ // ZodUUIDv6
460
+
461
+ export function uuidv6(params?: string | core.$ZodUUIDv6Params): ZodUUID {
462
+ return core._uuidv6(ZodUUID, params);
463
+ }
464
+
465
+ // ZodUUIDv7
466
+
467
+ export function uuidv7(params?: string | core.$ZodUUIDv7Params): ZodUUID {
468
+ return core._uuidv7(ZodUUID, params);
469
+ }
470
+
471
+ // ZodURL
472
+ export interface ZodURL extends ZodStringFormat<"url"> {
473
+ _zod: core.$ZodURLInternals;
474
+ }
475
+ export const ZodURL: core.$constructor<ZodURL> = /*@__PURE__*/ core.$constructor("ZodURL", (inst, def) => {
476
+ // ZodStringFormat.init(inst, def);
477
+ core.$ZodURL.init(inst, def);
478
+ ZodStringFormat.init(inst, def);
479
+ });
480
+
481
+ export function url(params?: string | core.$ZodURLParams): ZodURL {
482
+ return core._url(ZodURL, params);
483
+ }
484
+
485
+ export function httpUrl(params?: string | Omit<core.$ZodURLParams, "protocol" | "hostname">): ZodURL {
486
+ return core._url(ZodURL, {
487
+ protocol: /^https?$/,
488
+ hostname: core.regexes.domain,
489
+ ...util.normalizeParams(params),
490
+ });
491
+ }
492
+
493
+ // ZodEmoji
494
+ export interface ZodEmoji extends ZodStringFormat<"emoji"> {
495
+ _zod: core.$ZodEmojiInternals;
496
+ }
497
+ export const ZodEmoji: core.$constructor<ZodEmoji> = /*@__PURE__*/ core.$constructor("ZodEmoji", (inst, def) => {
498
+ // ZodStringFormat.init(inst, def);
499
+ core.$ZodEmoji.init(inst, def);
500
+ ZodStringFormat.init(inst, def);
501
+ });
502
+
503
+ export function emoji(params?: string | core.$ZodEmojiParams): ZodEmoji {
504
+ return core._emoji(ZodEmoji, params);
505
+ }
506
+
507
+ // ZodNanoID
508
+ export interface ZodNanoID extends ZodStringFormat<"nanoid"> {
509
+ _zod: core.$ZodNanoIDInternals;
510
+ }
511
+ export const ZodNanoID: core.$constructor<ZodNanoID> = /*@__PURE__*/ core.$constructor("ZodNanoID", (inst, def) => {
512
+ // ZodStringFormat.init(inst, def);
513
+ core.$ZodNanoID.init(inst, def);
514
+ ZodStringFormat.init(inst, def);
515
+ });
516
+
517
+ export function nanoid(params?: string | core.$ZodNanoIDParams): ZodNanoID {
518
+ return core._nanoid(ZodNanoID, params);
519
+ }
520
+
521
+ // ZodCUID
522
+ export interface ZodCUID extends ZodStringFormat<"cuid"> {
523
+ _zod: core.$ZodCUIDInternals;
524
+ }
525
+ export const ZodCUID: core.$constructor<ZodCUID> = /*@__PURE__*/ core.$constructor("ZodCUID", (inst, def) => {
526
+ // ZodStringFormat.init(inst, def);
527
+ core.$ZodCUID.init(inst, def);
528
+ ZodStringFormat.init(inst, def);
529
+ });
530
+
531
+ export function cuid(params?: string | core.$ZodCUIDParams): ZodCUID {
532
+ return core._cuid(ZodCUID, params);
533
+ }
534
+
535
+ // ZodCUID2
536
+ export interface ZodCUID2 extends ZodStringFormat<"cuid2"> {
537
+ _zod: core.$ZodCUID2Internals;
538
+ }
539
+ export const ZodCUID2: core.$constructor<ZodCUID2> = /*@__PURE__*/ core.$constructor("ZodCUID2", (inst, def) => {
540
+ // ZodStringFormat.init(inst, def);
541
+ core.$ZodCUID2.init(inst, def);
542
+ ZodStringFormat.init(inst, def);
543
+ });
544
+
545
+ export function cuid2(params?: string | core.$ZodCUID2Params): ZodCUID2 {
546
+ return core._cuid2(ZodCUID2, params);
547
+ }
548
+
549
+ // ZodULID
550
+ export interface ZodULID extends ZodStringFormat<"ulid"> {
551
+ _zod: core.$ZodULIDInternals;
552
+ }
553
+ export const ZodULID: core.$constructor<ZodULID> = /*@__PURE__*/ core.$constructor("ZodULID", (inst, def) => {
554
+ // ZodStringFormat.init(inst, def);
555
+ core.$ZodULID.init(inst, def);
556
+ ZodStringFormat.init(inst, def);
557
+ });
558
+
559
+ export function ulid(params?: string | core.$ZodULIDParams): ZodULID {
560
+ return core._ulid(ZodULID, params);
561
+ }
562
+
563
+ // ZodXID
564
+ export interface ZodXID extends ZodStringFormat<"xid"> {
565
+ _zod: core.$ZodXIDInternals;
566
+ }
567
+ export const ZodXID: core.$constructor<ZodXID> = /*@__PURE__*/ core.$constructor("ZodXID", (inst, def) => {
568
+ // ZodStringFormat.init(inst, def);
569
+ core.$ZodXID.init(inst, def);
570
+ ZodStringFormat.init(inst, def);
571
+ });
572
+
573
+ export function xid(params?: string | core.$ZodXIDParams): ZodXID {
574
+ return core._xid(ZodXID, params);
575
+ }
576
+
577
+ // ZodKSUID
578
+ export interface ZodKSUID extends ZodStringFormat<"ksuid"> {
579
+ _zod: core.$ZodKSUIDInternals;
580
+ }
581
+ export const ZodKSUID: core.$constructor<ZodKSUID> = /*@__PURE__*/ core.$constructor("ZodKSUID", (inst, def) => {
582
+ // ZodStringFormat.init(inst, def);
583
+ core.$ZodKSUID.init(inst, def);
584
+ ZodStringFormat.init(inst, def);
585
+ });
586
+
587
+ export function ksuid(params?: string | core.$ZodKSUIDParams): ZodKSUID {
588
+ return core._ksuid(ZodKSUID, params);
589
+ }
590
+
591
+ // ZodIP
592
+ // export interface ZodIP extends ZodStringFormat<"ip"> {
593
+ // _zod: core.$ZodIPInternals;
594
+ // }
595
+ // export const ZodIP: core.$constructor<ZodIP> = /*@__PURE__*/ core.$constructor("ZodIP", (inst, def) => {
596
+ // // ZodStringFormat.init(inst, def);
597
+ // core.$ZodIP.init(inst, def);
598
+ // ZodStringFormat.init(inst, def);
599
+ // });
600
+
601
+ // export function ip(params?: string | core.$ZodIPParams): ZodIP {
602
+ // return core._ip(ZodIP, params);
603
+ // }
604
+
605
+ // ZodIPv4
606
+ export interface ZodIPv4 extends ZodStringFormat<"ipv4"> {
607
+ _zod: core.$ZodIPv4Internals;
608
+ }
609
+ export const ZodIPv4: core.$constructor<ZodIPv4> = /*@__PURE__*/ core.$constructor("ZodIPv4", (inst, def) => {
610
+ // ZodStringFormat.init(inst, def);
611
+ core.$ZodIPv4.init(inst, def);
612
+ ZodStringFormat.init(inst, def);
613
+ });
614
+
615
+ export function ipv4(params?: string | core.$ZodIPv4Params): ZodIPv4 {
616
+ return core._ipv4(ZodIPv4, params);
617
+ }
618
+
619
+ // ZodIPv6
620
+ export interface ZodIPv6 extends ZodStringFormat<"ipv6"> {
621
+ _zod: core.$ZodIPv6Internals;
622
+ }
623
+ export const ZodIPv6: core.$constructor<ZodIPv6> = /*@__PURE__*/ core.$constructor("ZodIPv6", (inst, def) => {
624
+ // ZodStringFormat.init(inst, def);
625
+ core.$ZodIPv6.init(inst, def);
626
+ ZodStringFormat.init(inst, def);
627
+ });
628
+ export function ipv6(params?: string | core.$ZodIPv6Params): ZodIPv6 {
629
+ return core._ipv6(ZodIPv6, params);
630
+ }
631
+
632
+ // ZodCIDRv4
633
+ export interface ZodCIDRv4 extends ZodStringFormat<"cidrv4"> {
634
+ _zod: core.$ZodCIDRv4Internals;
635
+ }
636
+ export const ZodCIDRv4: core.$constructor<ZodCIDRv4> = /*@__PURE__*/ core.$constructor("ZodCIDRv4", (inst, def) => {
637
+ core.$ZodCIDRv4.init(inst, def);
638
+ ZodStringFormat.init(inst, def);
639
+ });
640
+
641
+ export function cidrv4(params?: string | core.$ZodCIDRv4Params): ZodCIDRv4 {
642
+ return core._cidrv4(ZodCIDRv4, params);
643
+ }
644
+
645
+ // ZodCIDRv6
646
+ export interface ZodCIDRv6 extends ZodStringFormat<"cidrv6"> {
647
+ _zod: core.$ZodCIDRv6Internals;
648
+ }
649
+ export const ZodCIDRv6: core.$constructor<ZodCIDRv6> = /*@__PURE__*/ core.$constructor("ZodCIDRv6", (inst, def) => {
650
+ core.$ZodCIDRv6.init(inst, def);
651
+ ZodStringFormat.init(inst, def);
652
+ });
653
+
654
+ export function cidrv6(params?: string | core.$ZodCIDRv6Params): ZodCIDRv6 {
655
+ return core._cidrv6(ZodCIDRv6, params);
656
+ }
657
+
658
+ // ZodBase64
659
+ export interface ZodBase64 extends ZodStringFormat<"base64"> {
660
+ _zod: core.$ZodBase64Internals;
661
+ }
662
+ export const ZodBase64: core.$constructor<ZodBase64> = /*@__PURE__*/ core.$constructor("ZodBase64", (inst, def) => {
663
+ // ZodStringFormat.init(inst, def);
664
+ core.$ZodBase64.init(inst, def);
665
+ ZodStringFormat.init(inst, def);
666
+ });
667
+ export function base64(params?: string | core.$ZodBase64Params): ZodBase64 {
668
+ return core._base64(ZodBase64, params);
669
+ }
670
+
671
+ // ZodBase64URL
672
+ export interface ZodBase64URL extends ZodStringFormat<"base64url"> {
673
+ _zod: core.$ZodBase64URLInternals;
674
+ }
675
+ export const ZodBase64URL: core.$constructor<ZodBase64URL> = /*@__PURE__*/ core.$constructor(
676
+ "ZodBase64URL",
677
+ (inst, def) => {
678
+ // ZodStringFormat.init(inst, def);
679
+ core.$ZodBase64URL.init(inst, def);
680
+ ZodStringFormat.init(inst, def);
681
+ }
682
+ );
683
+ export function base64url(params?: string | core.$ZodBase64URLParams): ZodBase64URL {
684
+ return core._base64url(ZodBase64URL, params);
685
+ }
686
+
687
+ // ZodE164
688
+ export interface ZodE164 extends ZodStringFormat<"e164"> {
689
+ _zod: core.$ZodE164Internals;
690
+ }
691
+ export const ZodE164: core.$constructor<ZodE164> = /*@__PURE__*/ core.$constructor("ZodE164", (inst, def) => {
692
+ // ZodStringFormat.init(inst, def);
693
+ core.$ZodE164.init(inst, def);
694
+ ZodStringFormat.init(inst, def);
695
+ });
696
+
697
+ export function e164(params?: string | core.$ZodE164Params): ZodE164 {
698
+ return core._e164(ZodE164, params);
699
+ }
700
+
701
+ // ZodJWT
702
+ export interface ZodJWT extends ZodStringFormat<"jwt"> {
703
+ _zod: core.$ZodJWTInternals;
704
+ }
705
+ export const ZodJWT: core.$constructor<ZodJWT> = /*@__PURE__*/ core.$constructor("ZodJWT", (inst, def) => {
706
+ // ZodStringFormat.init(inst, def);
707
+ core.$ZodJWT.init(inst, def);
708
+ ZodStringFormat.init(inst, def);
709
+ });
710
+
711
+ export function jwt(params?: string | core.$ZodJWTParams): ZodJWT {
712
+ return core._jwt(ZodJWT, params);
713
+ }
714
+
715
+ // ZodCustomStringFormat
716
+ export interface ZodCustomStringFormat<Format extends string = string>
717
+ extends ZodStringFormat<Format>,
718
+ core.$ZodCustomStringFormat<Format> {
719
+ _zod: core.$ZodCustomStringFormatInternals<Format>;
720
+ }
721
+ export const ZodCustomStringFormat: core.$constructor<ZodCustomStringFormat> = /*@__PURE__*/ core.$constructor(
722
+ "ZodCustomStringFormat",
723
+ (inst, def) => {
724
+ // ZodStringFormat.init(inst, def);
725
+ core.$ZodCustomStringFormat.init(inst, def);
726
+ ZodStringFormat.init(inst, def);
727
+ }
728
+ );
729
+ export function stringFormat<Format extends string>(
730
+ format: Format,
731
+ fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp,
732
+ _params: string | core.$ZodStringFormatParams = {}
733
+ ): ZodCustomStringFormat<Format> {
734
+ return core._stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params) as any;
735
+ }
736
+
737
+ export function hostname(_params?: string | core.$ZodStringFormatParams): ZodCustomStringFormat<"hostname"> {
738
+ return core._stringFormat(ZodCustomStringFormat, "hostname", core.regexes.hostname, _params) as any;
739
+ }
740
+
741
+ export function hex(_params?: string | core.$ZodStringFormatParams): ZodCustomStringFormat<"hex"> {
742
+ return core._stringFormat(ZodCustomStringFormat, "hex", core.regexes.hex, _params) as any;
743
+ }
744
+
745
+ export function hash<Alg extends util.HashAlgorithm, Enc extends util.HashEncoding = "hex">(
746
+ alg: Alg,
747
+ params?: {
748
+ enc?: Enc;
749
+ } & core.$ZodStringFormatParams
750
+ ): ZodCustomStringFormat<`${Alg}_${Enc}`> {
751
+ const enc = params?.enc ?? "hex";
752
+ const format = `${alg}_${enc}` as const;
753
+ const regex = core.regexes[format as keyof typeof core.regexes] as RegExp;
754
+ if (!regex) throw new Error(`Unrecognized hash format: ${format}`);
755
+ return core._stringFormat(ZodCustomStringFormat, format, regex, params) as any;
756
+ }
757
+
758
+ // ZodNumber
759
+ export interface _ZodNumber<Internals extends core.$ZodNumberInternals = core.$ZodNumberInternals>
760
+ extends _ZodType<Internals> {
761
+ gt(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
762
+ /** Identical to .min() */
763
+ gte(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
764
+ min(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
765
+ lt(value: number, params?: string | core.$ZodCheckLessThanParams): this;
766
+ /** Identical to .max() */
767
+ lte(value: number, params?: string | core.$ZodCheckLessThanParams): this;
768
+ max(value: number, params?: string | core.$ZodCheckLessThanParams): this;
769
+ /** Consider `z.int()` instead. This API is considered *legacy*; it will never be removed but a better alternative exists. */
770
+ int(params?: string | core.$ZodCheckNumberFormatParams): this;
771
+ /** @deprecated This is now identical to `.int()`. Only numbers in the safe integer range are accepted. */
772
+ safe(params?: string | core.$ZodCheckNumberFormatParams): this;
773
+ positive(params?: string | core.$ZodCheckGreaterThanParams): this;
774
+ nonnegative(params?: string | core.$ZodCheckGreaterThanParams): this;
775
+ negative(params?: string | core.$ZodCheckLessThanParams): this;
776
+ nonpositive(params?: string | core.$ZodCheckLessThanParams): this;
777
+ multipleOf(value: number, params?: string | core.$ZodCheckMultipleOfParams): this;
778
+ /** @deprecated Use `.multipleOf()` instead. */
779
+ step(value: number, params?: string | core.$ZodCheckMultipleOfParams): this;
780
+
781
+ /** @deprecated In v4 and later, z.number() does not allow infinite values by default. This is a no-op. */
782
+ finite(params?: unknown): this;
783
+
784
+ minValue: number | null;
785
+ maxValue: number | null;
786
+ /** @deprecated Check the `format` property instead. */
787
+ isInt: boolean;
788
+ /** @deprecated Number schemas no longer accept infinite values, so this always returns `true`. */
789
+ isFinite: boolean;
790
+ format: string | null;
791
+ }
792
+
793
+ export interface ZodNumber extends _ZodNumber<core.$ZodNumberInternals<number>> {}
794
+
795
+ export const ZodNumber: core.$constructor<ZodNumber> = /*@__PURE__*/ core.$constructor("ZodNumber", (inst, def) => {
796
+ core.$ZodNumber.init(inst, def);
797
+ ZodType.init(inst, def);
798
+
799
+ inst.gt = (value, params) => inst.check(checks.gt(value, params));
800
+ inst.gte = (value, params) => inst.check(checks.gte(value, params));
801
+ inst.min = (value, params) => inst.check(checks.gte(value, params));
802
+ inst.lt = (value, params) => inst.check(checks.lt(value, params));
803
+ inst.lte = (value, params) => inst.check(checks.lte(value, params));
804
+ inst.max = (value, params) => inst.check(checks.lte(value, params));
805
+ inst.int = (params) => inst.check(int(params));
806
+ inst.safe = (params) => inst.check(int(params));
807
+ inst.positive = (params) => inst.check(checks.gt(0, params));
808
+ inst.nonnegative = (params) => inst.check(checks.gte(0, params));
809
+ inst.negative = (params) => inst.check(checks.lt(0, params));
810
+ inst.nonpositive = (params) => inst.check(checks.lte(0, params));
811
+ inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));
812
+ inst.step = (value, params) => inst.check(checks.multipleOf(value, params));
813
+
814
+ // inst.finite = (params) => inst.check(core.finite(params));
815
+ inst.finite = () => inst;
816
+
817
+ const bag = inst._zod.bag;
818
+ inst.minValue =
819
+ Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
820
+ inst.maxValue =
821
+ Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
822
+ inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
823
+ inst.isFinite = true;
824
+ inst.format = bag.format ?? null;
825
+ });
826
+
827
+ export function number(params?: string | core.$ZodNumberParams): ZodNumber {
828
+ return core._number(ZodNumber, params) as any;
829
+ }
830
+
831
+ // ZodNumberFormat
832
+ export interface ZodNumberFormat extends ZodNumber {
833
+ _zod: core.$ZodNumberFormatInternals;
834
+ }
835
+ export const ZodNumberFormat: core.$constructor<ZodNumberFormat> = /*@__PURE__*/ core.$constructor(
836
+ "ZodNumberFormat",
837
+ (inst, def) => {
838
+ core.$ZodNumberFormat.init(inst, def);
839
+ ZodNumber.init(inst, def);
840
+ }
841
+ );
842
+
843
+ // int
844
+ export interface ZodInt extends ZodNumberFormat {}
845
+ export function int(params?: string | core.$ZodCheckNumberFormatParams): ZodInt {
846
+ return core._int(ZodNumberFormat, params);
847
+ }
848
+
849
+ // float32
850
+ export interface ZodFloat32 extends ZodNumberFormat {}
851
+ export function float32(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat32 {
852
+ return core._float32(ZodNumberFormat, params);
853
+ }
854
+
855
+ // float64
856
+ export interface ZodFloat64 extends ZodNumberFormat {}
857
+ export function float64(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat64 {
858
+ return core._float64(ZodNumberFormat, params);
859
+ }
860
+
861
+ // int32
862
+ export interface ZodInt32 extends ZodNumberFormat {}
863
+ export function int32(params?: string | core.$ZodCheckNumberFormatParams): ZodInt32 {
864
+ return core._int32(ZodNumberFormat, params);
865
+ }
866
+
867
+ // uint32
868
+ export interface ZodUInt32 extends ZodNumberFormat {}
869
+ export function uint32(params?: string | core.$ZodCheckNumberFormatParams): ZodUInt32 {
870
+ return core._uint32(ZodNumberFormat, params);
871
+ }
872
+
873
+ // boolean
874
+ export interface _ZodBoolean<T extends core.$ZodBooleanInternals = core.$ZodBooleanInternals> extends _ZodType<T> {}
875
+ export interface ZodBoolean extends _ZodBoolean<core.$ZodBooleanInternals<boolean>> {}
876
+ export const ZodBoolean: core.$constructor<ZodBoolean> = /*@__PURE__*/ core.$constructor("ZodBoolean", (inst, def) => {
877
+ core.$ZodBoolean.init(inst, def);
878
+ ZodType.init(inst, def);
879
+ });
880
+
881
+ export function boolean(params?: string | core.$ZodBooleanParams): ZodBoolean {
882
+ return core._boolean(ZodBoolean, params) as any;
883
+ }
884
+
885
+ // bigint
886
+ export interface _ZodBigInt<T extends core.$ZodBigIntInternals = core.$ZodBigIntInternals> extends _ZodType<T> {
887
+ gte(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
888
+ /** Alias of `.gte()` */
889
+ min(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
890
+ gt(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
891
+ /** Alias of `.lte()` */
892
+ lte(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
893
+ max(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
894
+ lt(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
895
+ positive(params?: string | core.$ZodCheckGreaterThanParams): this;
896
+ negative(params?: string | core.$ZodCheckLessThanParams): this;
897
+ nonpositive(params?: string | core.$ZodCheckLessThanParams): this;
898
+ nonnegative(params?: string | core.$ZodCheckGreaterThanParams): this;
899
+ multipleOf(value: bigint, params?: string | core.$ZodCheckMultipleOfParams): this;
900
+
901
+ minValue: bigint | null;
902
+ maxValue: bigint | null;
903
+ format: string | null;
904
+ }
905
+
906
+ export interface ZodBigInt extends _ZodBigInt<core.$ZodBigIntInternals<bigint>> {}
907
+ export const ZodBigInt: core.$constructor<ZodBigInt> = /*@__PURE__*/ core.$constructor("ZodBigInt", (inst, def) => {
908
+ core.$ZodBigInt.init(inst, def);
909
+ ZodType.init(inst, def);
910
+
911
+ inst.gte = (value, params) => inst.check(checks.gte(value, params));
912
+ inst.min = (value, params) => inst.check(checks.gte(value, params));
913
+ inst.gt = (value, params) => inst.check(checks.gt(value, params));
914
+ inst.gte = (value, params) => inst.check(checks.gte(value, params));
915
+ inst.min = (value, params) => inst.check(checks.gte(value, params));
916
+ inst.lt = (value, params) => inst.check(checks.lt(value, params));
917
+ inst.lte = (value, params) => inst.check(checks.lte(value, params));
918
+ inst.max = (value, params) => inst.check(checks.lte(value, params));
919
+ inst.positive = (params) => inst.check(checks.gt(BigInt(0), params));
920
+ inst.negative = (params) => inst.check(checks.lt(BigInt(0), params));
921
+ inst.nonpositive = (params) => inst.check(checks.lte(BigInt(0), params));
922
+ inst.nonnegative = (params) => inst.check(checks.gte(BigInt(0), params));
923
+ inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));
924
+
925
+ const bag = inst._zod.bag;
926
+ inst.minValue = bag.minimum ?? null;
927
+ inst.maxValue = bag.maximum ?? null;
928
+ inst.format = bag.format ?? null;
929
+ });
930
+
931
+ export function bigint(params?: string | core.$ZodBigIntParams): ZodBigInt {
932
+ return core._bigint(ZodBigInt, params) as any;
933
+ }
934
+ // bigint formats
935
+
936
+ // ZodBigIntFormat
937
+ export interface ZodBigIntFormat extends ZodBigInt {
938
+ _zod: core.$ZodBigIntFormatInternals;
939
+ }
940
+ export const ZodBigIntFormat: core.$constructor<ZodBigIntFormat> = /*@__PURE__*/ core.$constructor(
941
+ "ZodBigIntFormat",
942
+ (inst, def) => {
943
+ core.$ZodBigIntFormat.init(inst, def);
944
+ ZodBigInt.init(inst, def);
945
+ }
946
+ );
947
+
948
+ // int64
949
+ export function int64(params?: string | core.$ZodBigIntFormatParams): ZodBigIntFormat {
950
+ return core._int64(ZodBigIntFormat, params);
951
+ }
952
+
953
+ // uint64
954
+ export function uint64(params?: string | core.$ZodBigIntFormatParams): ZodBigIntFormat {
955
+ return core._uint64(ZodBigIntFormat, params);
956
+ }
957
+
958
+ // symbol
959
+ export interface ZodSymbol extends _ZodType<core.$ZodSymbolInternals> {}
960
+ export const ZodSymbol: core.$constructor<ZodSymbol> = /*@__PURE__*/ core.$constructor("ZodSymbol", (inst, def) => {
961
+ core.$ZodSymbol.init(inst, def);
962
+ ZodType.init(inst, def);
963
+ });
964
+
965
+ export function symbol(params?: string | core.$ZodSymbolParams): ZodSymbol {
966
+ return core._symbol(ZodSymbol, params);
967
+ }
968
+
969
+ // ZodUndefined
970
+ export interface ZodUndefined extends _ZodType<core.$ZodUndefinedInternals> {}
971
+ export const ZodUndefined: core.$constructor<ZodUndefined> = /*@__PURE__*/ core.$constructor(
972
+ "ZodUndefined",
973
+ (inst, def) => {
974
+ core.$ZodUndefined.init(inst, def);
975
+ ZodType.init(inst, def);
976
+ }
977
+ );
978
+
979
+ function _undefined(params?: string | core.$ZodUndefinedParams): ZodUndefined {
980
+ return core._undefined(ZodUndefined, params);
981
+ }
982
+ export { _undefined as undefined };
983
+
984
+ // ZodNull
985
+ export interface ZodNull extends _ZodType<core.$ZodNullInternals> {}
986
+ export const ZodNull: core.$constructor<ZodNull> = /*@__PURE__*/ core.$constructor("ZodNull", (inst, def) => {
987
+ core.$ZodNull.init(inst, def);
988
+ ZodType.init(inst, def);
989
+ });
990
+
991
+ function _null(params?: string | core.$ZodNullParams): ZodNull {
992
+ return core._null(ZodNull, params);
993
+ }
994
+ export { _null as null };
995
+
996
+ // ZodAny
997
+ export interface ZodAny extends _ZodType<core.$ZodAnyInternals> {}
998
+ export const ZodAny: core.$constructor<ZodAny> = /*@__PURE__*/ core.$constructor("ZodAny", (inst, def) => {
999
+ core.$ZodAny.init(inst, def);
1000
+ ZodType.init(inst, def);
1001
+ });
1002
+
1003
+ export function any(): ZodAny {
1004
+ return core._any(ZodAny);
1005
+ }
1006
+
1007
+ // ZodUnknown
1008
+ export interface ZodUnknown extends _ZodType<core.$ZodUnknownInternals> {}
1009
+ export const ZodUnknown: core.$constructor<ZodUnknown> = /*@__PURE__*/ core.$constructor("ZodUnknown", (inst, def) => {
1010
+ core.$ZodUnknown.init(inst, def);
1011
+ ZodType.init(inst, def);
1012
+ });
1013
+
1014
+ export function unknown(): ZodUnknown {
1015
+ return core._unknown(ZodUnknown);
1016
+ }
1017
+
1018
+ // ZodNever
1019
+ export interface ZodNever extends _ZodType<core.$ZodNeverInternals> {}
1020
+ export const ZodNever: core.$constructor<ZodNever> = /*@__PURE__*/ core.$constructor("ZodNever", (inst, def) => {
1021
+ core.$ZodNever.init(inst, def);
1022
+ ZodType.init(inst, def);
1023
+ });
1024
+
1025
+ export function never(params?: string | core.$ZodNeverParams): ZodNever {
1026
+ return core._never(ZodNever, params);
1027
+ }
1028
+
1029
+ // ZodVoid
1030
+ export interface ZodVoid extends _ZodType<core.$ZodVoidInternals> {}
1031
+ export const ZodVoid: core.$constructor<ZodVoid> = /*@__PURE__*/ core.$constructor("ZodVoid", (inst, def) => {
1032
+ core.$ZodVoid.init(inst, def);
1033
+ ZodType.init(inst, def);
1034
+ });
1035
+
1036
+ function _void(params?: string | core.$ZodVoidParams): ZodVoid {
1037
+ return core._void(ZodVoid, params);
1038
+ }
1039
+ export { _void as void };
1040
+
1041
+ // ZodDate
1042
+ export interface _ZodDate<T extends core.$ZodDateInternals = core.$ZodDateInternals> extends _ZodType<T> {
1043
+ min(value: number | Date, params?: string | core.$ZodCheckGreaterThanParams): this;
1044
+ max(value: number | Date, params?: string | core.$ZodCheckLessThanParams): this;
1045
+
1046
+ /** @deprecated Not recommended. */
1047
+ minDate: Date | null;
1048
+ /** @deprecated Not recommended. */
1049
+ maxDate: Date | null;
1050
+ }
1051
+
1052
+ export interface ZodDate extends _ZodDate<core.$ZodDateInternals<Date>> {}
1053
+ export const ZodDate: core.$constructor<ZodDate> = /*@__PURE__*/ core.$constructor("ZodDate", (inst, def) => {
1054
+ core.$ZodDate.init(inst, def);
1055
+ ZodType.init(inst, def);
1056
+
1057
+ inst.min = (value, params) => inst.check(checks.gte(value, params));
1058
+ inst.max = (value, params) => inst.check(checks.lte(value, params));
1059
+
1060
+ const c = inst._zod.bag;
1061
+ inst.minDate = c.minimum ? new Date(c.minimum) : null;
1062
+ inst.maxDate = c.maximum ? new Date(c.maximum) : null;
1063
+ });
1064
+
1065
+ export function date(params?: string | core.$ZodDateParams): ZodDate {
1066
+ return core._date(ZodDate, params);
1067
+ }
1068
+
1069
+ // ZodArray
1070
+ export interface ZodArray<T extends core.SomeType = core.$ZodType>
1071
+ extends _ZodType<core.$ZodArrayInternals<T>>,
1072
+ core.$ZodArray<T> {
1073
+ element: T;
1074
+ min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
1075
+ nonempty(params?: string | core.$ZodCheckMinLengthParams): this;
1076
+ max(maxLength: number, params?: string | core.$ZodCheckMaxLengthParams): this;
1077
+ length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
1078
+
1079
+ unwrap(): T;
1080
+ }
1081
+ export const ZodArray: core.$constructor<ZodArray> = /*@__PURE__*/ core.$constructor("ZodArray", (inst, def) => {
1082
+ core.$ZodArray.init(inst, def);
1083
+ ZodType.init(inst, def);
1084
+
1085
+ inst.element = def.element as any;
1086
+ inst.min = (minLength, params) => inst.check(checks.minLength(minLength, params));
1087
+ inst.nonempty = (params) => inst.check(checks.minLength(1, params));
1088
+ inst.max = (maxLength, params) => inst.check(checks.maxLength(maxLength, params));
1089
+ inst.length = (len, params) => inst.check(checks.length(len, params));
1090
+
1091
+ inst.unwrap = () => inst.element;
1092
+ });
1093
+
1094
+ export function array<T extends core.SomeType>(element: T, params?: string | core.$ZodArrayParams): ZodArray<T> {
1095
+ return core._array(ZodArray, element as any, params) as any;
1096
+ }
1097
+
1098
+ // .keyof
1099
+ export function keyof<T extends ZodObject>(schema: T): ZodEnum<util.KeysEnum<T["_zod"]["output"]>> {
1100
+ const shape = schema._zod.def.shape;
1101
+ return _enum(Object.keys(shape)) as any;
1102
+ }
1103
+
1104
+ // ZodObject
1105
+
1106
+ export type SafeExtendShape<Base extends core.$ZodShape, Ext extends core.$ZodLooseShape> = {
1107
+ [K in keyof Ext]: K extends keyof Base
1108
+ ? core.output<Ext[K]> extends core.output<Base[K]>
1109
+ ? core.input<Ext[K]> extends core.input<Base[K]>
1110
+ ? Ext[K]
1111
+ : never
1112
+ : never
1113
+ : Ext[K];
1114
+ };
1115
+
1116
+ export interface ZodObject<
1117
+ /** @ts-ignore Cast variance */
1118
+ out Shape extends core.$ZodShape = core.$ZodLooseShape,
1119
+ out Config extends core.$ZodObjectConfig = core.$strip,
1120
+ > extends _ZodType<core.$ZodObjectInternals<Shape, Config>>,
1121
+ core.$ZodObject<Shape, Config> {
1122
+ shape: Shape;
1123
+
1124
+ keyof(): ZodEnum<util.ToEnum<keyof Shape & string>>;
1125
+ /** Define a schema to validate all unrecognized keys. This overrides the existing strict/loose behavior. */
1126
+ catchall<T extends core.SomeType>(schema: T): ZodObject<Shape, core.$catchall<T>>;
1127
+
1128
+ /** @deprecated Use `z.looseObject()` or `.loose()` instead. */
1129
+ passthrough(): ZodObject<Shape, core.$loose>;
1130
+ /** Consider `z.looseObject(A.shape)` instead */
1131
+ loose(): ZodObject<Shape, core.$loose>;
1132
+
1133
+ /** Consider `z.strictObject(A.shape)` instead */
1134
+ strict(): ZodObject<Shape, core.$strict>;
1135
+
1136
+ /** This is the default behavior. This method call is likely unnecessary. */
1137
+ strip(): ZodObject<Shape, core.$strip>;
1138
+
1139
+ extend<U extends core.$ZodLooseShape>(shape: U): ZodObject<util.Extend<Shape, U>, Config>;
1140
+
1141
+ safeExtend<U extends core.$ZodLooseShape>(
1142
+ shape: SafeExtendShape<Shape, U> & Partial<Record<keyof Shape, core.SomeType>>
1143
+ ): ZodObject<util.Extend<Shape, U>, Config>;
1144
+
1145
+ /**
1146
+ * @deprecated Use [`A.extend(B.shape)`](https://zod.dev/api?id=extend) instead.
1147
+ */
1148
+ merge<U extends ZodObject>(other: U): ZodObject<util.Extend<Shape, U["shape"]>, U["_zod"]["config"]>;
1149
+
1150
+ pick<M extends util.Mask<keyof Shape>>(
1151
+ mask: M
1152
+ ): ZodObject<util.Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Config>;
1153
+
1154
+ omit<M extends util.Mask<keyof Shape>>(
1155
+ mask: M
1156
+ ): ZodObject<util.Flatten<Omit<Shape, Extract<keyof Shape, keyof M>>>, Config>;
1157
+
1158
+ partial(): ZodObject<
1159
+ {
1160
+ [k in keyof Shape]: ZodOptional<Shape[k]>;
1161
+ },
1162
+ Config
1163
+ >;
1164
+ partial<M extends util.Mask<keyof Shape>>(
1165
+ mask: M
1166
+ ): ZodObject<
1167
+ {
1168
+ [k in keyof Shape]: k extends keyof M
1169
+ ? // Shape[k] extends OptionalInSchema
1170
+ // ? Shape[k]
1171
+ // :
1172
+ ZodOptional<Shape[k]>
1173
+ : Shape[k];
1174
+ },
1175
+ Config
1176
+ >;
1177
+
1178
+ // required
1179
+ required(): ZodObject<
1180
+ {
1181
+ [k in keyof Shape]: ZodNonOptional<Shape[k]>;
1182
+ },
1183
+ Config
1184
+ >;
1185
+ required<M extends util.Mask<keyof Shape>>(
1186
+ mask: M
1187
+ ): ZodObject<
1188
+ {
1189
+ [k in keyof Shape]: k extends keyof M ? ZodNonOptional<Shape[k]> : Shape[k];
1190
+ },
1191
+ Config
1192
+ >;
1193
+ }
1194
+
1195
+ export const ZodObject: core.$constructor<ZodObject> = /*@__PURE__*/ core.$constructor("ZodObject", (inst, def) => {
1196
+ core.$ZodObjectJIT.init(inst, def);
1197
+ ZodType.init(inst, def);
1198
+
1199
+ util.defineLazy(inst, "shape", () => def.shape);
1200
+ inst.keyof = () => _enum(Object.keys(inst._zod.def.shape)) as any;
1201
+ inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall: catchall as any as core.$ZodType }) as any;
1202
+ inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
1203
+ inst.loose = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
1204
+ inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never() });
1205
+ inst.strip = () => inst.clone({ ...inst._zod.def, catchall: undefined });
1206
+
1207
+ inst.extend = (incoming: any) => {
1208
+ return util.extend(inst, incoming);
1209
+ };
1210
+ inst.safeExtend = (incoming: any) => {
1211
+ return util.safeExtend(inst, incoming);
1212
+ };
1213
+ inst.merge = (other) => util.merge(inst, other);
1214
+ inst.pick = (mask) => util.pick(inst, mask);
1215
+ inst.omit = (mask) => util.omit(inst, mask);
1216
+ inst.partial = (...args: any[]) => util.partial(ZodOptional, inst, args[0] as object);
1217
+ inst.required = (...args: any[]) => util.required(ZodNonOptional, inst, args[0] as object);
1218
+ });
1219
+
1220
+ export function object<T extends core.$ZodLooseShape = Partial<Record<never, core.SomeType>>>(
1221
+ shape?: T,
1222
+ params?: string | core.$ZodObjectParams
1223
+ ): ZodObject<util.Writeable<T>, core.$strip> {
1224
+ const def: core.$ZodObjectDef = {
1225
+ type: "object",
1226
+ get shape() {
1227
+ util.assignProp(this, "shape", shape ? util.objectClone(shape) : {});
1228
+ return this.shape;
1229
+ },
1230
+ ...util.normalizeParams(params),
1231
+ };
1232
+ return new ZodObject(def) as any;
1233
+ }
1234
+
1235
+ // strictObject
1236
+
1237
+ export function strictObject<T extends core.$ZodLooseShape>(
1238
+ shape: T,
1239
+ params?: string | core.$ZodObjectParams
1240
+ ): ZodObject<T, core.$strict> {
1241
+ return new ZodObject({
1242
+ type: "object",
1243
+ get shape() {
1244
+ util.assignProp(this, "shape", util.objectClone(shape));
1245
+ return this.shape;
1246
+ },
1247
+ catchall: never(),
1248
+ ...util.normalizeParams(params),
1249
+ }) as any;
1250
+ }
1251
+
1252
+ // looseObject
1253
+
1254
+ export function looseObject<T extends core.$ZodLooseShape>(
1255
+ shape: T,
1256
+ params?: string | core.$ZodObjectParams
1257
+ ): ZodObject<T, core.$loose> {
1258
+ return new ZodObject({
1259
+ type: "object",
1260
+ get shape() {
1261
+ util.assignProp(this, "shape", util.objectClone(shape));
1262
+ return this.shape;
1263
+ },
1264
+ catchall: unknown(),
1265
+ ...util.normalizeParams(params),
1266
+ }) as any;
1267
+ }
1268
+
1269
+ // ZodUnion
1270
+ export interface ZodUnion<T extends readonly core.SomeType[] = readonly core.$ZodType[]>
1271
+ extends _ZodType<core.$ZodUnionInternals<T>>,
1272
+ core.$ZodUnion<T> {
1273
+ options: T;
1274
+ }
1275
+ export const ZodUnion: core.$constructor<ZodUnion> = /*@__PURE__*/ core.$constructor("ZodUnion", (inst, def) => {
1276
+ core.$ZodUnion.init(inst, def);
1277
+ ZodType.init(inst, def);
1278
+ inst.options = def.options;
1279
+ });
1280
+
1281
+ export function union<const T extends readonly core.SomeType[]>(
1282
+ options: T,
1283
+ params?: string | core.$ZodUnionParams
1284
+ ): ZodUnion<T> {
1285
+ return new ZodUnion({
1286
+ type: "union",
1287
+ options: options as any as core.$ZodType[],
1288
+ ...util.normalizeParams(params),
1289
+ }) as any;
1290
+ }
1291
+
1292
+ // ZodDiscriminatedUnion
1293
+ export interface ZodDiscriminatedUnion<
1294
+ Options extends readonly core.SomeType[] = readonly core.$ZodType[],
1295
+ Disc extends string = string,
1296
+ > extends ZodUnion<Options>,
1297
+ core.$ZodDiscriminatedUnion<Options, Disc> {
1298
+ _zod: core.$ZodDiscriminatedUnionInternals<Options, Disc>;
1299
+ def: core.$ZodDiscriminatedUnionDef<Options, Disc>;
1300
+ }
1301
+ export const ZodDiscriminatedUnion: core.$constructor<ZodDiscriminatedUnion> = /*@__PURE__*/ core.$constructor(
1302
+ "ZodDiscriminatedUnion",
1303
+ (inst, def) => {
1304
+ ZodUnion.init(inst, def);
1305
+ core.$ZodDiscriminatedUnion.init(inst, def);
1306
+ }
1307
+ );
1308
+
1309
+ export function discriminatedUnion<
1310
+ Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]],
1311
+ Disc extends string,
1312
+ >(
1313
+ discriminator: Disc,
1314
+ options: Types,
1315
+ params?: string | core.$ZodDiscriminatedUnionParams
1316
+ ): ZodDiscriminatedUnion<Types, Disc> {
1317
+ // const [options, params] = args;
1318
+ return new ZodDiscriminatedUnion({
1319
+ type: "union",
1320
+ options,
1321
+ discriminator,
1322
+ ...util.normalizeParams(params),
1323
+ }) as any;
1324
+ }
1325
+
1326
+ // ZodIntersection
1327
+ export interface ZodIntersection<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType>
1328
+ extends _ZodType<core.$ZodIntersectionInternals<A, B>>,
1329
+ core.$ZodIntersection<A, B> {}
1330
+ export const ZodIntersection: core.$constructor<ZodIntersection> = /*@__PURE__*/ core.$constructor(
1331
+ "ZodIntersection",
1332
+ (inst, def) => {
1333
+ core.$ZodIntersection.init(inst, def);
1334
+ ZodType.init(inst, def);
1335
+ }
1336
+ );
1337
+
1338
+ export function intersection<T extends core.SomeType, U extends core.SomeType>(
1339
+ left: T,
1340
+ right: U
1341
+ ): ZodIntersection<T, U> {
1342
+ return new ZodIntersection({
1343
+ type: "intersection",
1344
+ left: left as any as core.$ZodType,
1345
+ right: right as any as core.$ZodType,
1346
+ }) as any;
1347
+ }
1348
+
1349
+ // ZodTuple
1350
+ export interface ZodTuple<
1351
+ T extends util.TupleItems = readonly core.$ZodType[],
1352
+ Rest extends core.SomeType | null = core.$ZodType | null,
1353
+ > extends _ZodType<core.$ZodTupleInternals<T, Rest>>,
1354
+ core.$ZodTuple<T, Rest> {
1355
+ rest<Rest extends core.SomeType = core.$ZodType>(rest: Rest): ZodTuple<T, Rest>;
1356
+ }
1357
+ export const ZodTuple: core.$constructor<ZodTuple> = /*@__PURE__*/ core.$constructor("ZodTuple", (inst, def) => {
1358
+ core.$ZodTuple.init(inst, def);
1359
+ ZodType.init(inst, def);
1360
+ inst.rest = (rest) =>
1361
+ inst.clone({
1362
+ ...inst._zod.def,
1363
+ rest: rest as any as core.$ZodType,
1364
+ }) as any;
1365
+ });
1366
+
1367
+ export function tuple<T extends readonly [core.SomeType, ...core.SomeType[]]>(
1368
+ items: T,
1369
+ params?: string | core.$ZodTupleParams
1370
+ ): ZodTuple<T, null>;
1371
+ export function tuple<T extends readonly [core.SomeType, ...core.SomeType[]], Rest extends core.SomeType>(
1372
+ items: T,
1373
+ rest: Rest,
1374
+ params?: string | core.$ZodTupleParams
1375
+ ): ZodTuple<T, Rest>;
1376
+ export function tuple(items: [], params?: string | core.$ZodTupleParams): ZodTuple<[], null>;
1377
+ export function tuple(
1378
+ items: core.SomeType[],
1379
+ _paramsOrRest?: string | core.$ZodTupleParams | core.SomeType,
1380
+ _params?: string | core.$ZodTupleParams
1381
+ ) {
1382
+ const hasRest = _paramsOrRest instanceof core.$ZodType;
1383
+ const params = hasRest ? _params : _paramsOrRest;
1384
+ const rest = hasRest ? _paramsOrRest : null;
1385
+ return new ZodTuple({
1386
+ type: "tuple",
1387
+ items: items as any as core.$ZodType[],
1388
+ rest,
1389
+ ...util.normalizeParams(params),
1390
+ });
1391
+ }
1392
+
1393
+ // ZodRecord
1394
+ export interface ZodRecord<
1395
+ Key extends core.$ZodRecordKey = core.$ZodRecordKey,
1396
+ Value extends core.SomeType = core.$ZodType,
1397
+ > extends _ZodType<core.$ZodRecordInternals<Key, Value>>,
1398
+ core.$ZodRecord<Key, Value> {
1399
+ keyType: Key;
1400
+ valueType: Value;
1401
+ }
1402
+ export const ZodRecord: core.$constructor<ZodRecord> = /*@__PURE__*/ core.$constructor("ZodRecord", (inst, def) => {
1403
+ core.$ZodRecord.init(inst, def);
1404
+ ZodType.init(inst, def);
1405
+
1406
+ inst.keyType = def.keyType;
1407
+ inst.valueType = def.valueType;
1408
+ });
1409
+
1410
+ export function record<Key extends core.$ZodRecordKey, Value extends core.SomeType>(
1411
+ keyType: Key,
1412
+ valueType: Value,
1413
+ params?: string | core.$ZodRecordParams
1414
+ ): ZodRecord<Key, Value> {
1415
+ return new ZodRecord({
1416
+ type: "record",
1417
+ keyType,
1418
+ valueType: valueType as any as core.$ZodType,
1419
+ ...util.normalizeParams(params),
1420
+ }) as any;
1421
+ }
1422
+ // type alksjf = core.output<core.$ZodRecordKey>;
1423
+ export function partialRecord<Key extends core.$ZodRecordKey, Value extends core.SomeType>(
1424
+ keyType: Key,
1425
+ valueType: Value,
1426
+ params?: string | core.$ZodRecordParams
1427
+ ): ZodRecord<Key & core.$partial, Value> {
1428
+ const k = core.clone(keyType);
1429
+ k._zod.values = undefined;
1430
+ return new ZodRecord({
1431
+ type: "record",
1432
+ keyType: k,
1433
+ valueType: valueType as any,
1434
+ ...util.normalizeParams(params),
1435
+ }) as any;
1436
+ }
1437
+
1438
+ // ZodMap
1439
+ export interface ZodMap<Key extends core.SomeType = core.$ZodType, Value extends core.SomeType = core.$ZodType>
1440
+ extends _ZodType<core.$ZodMapInternals<Key, Value>>,
1441
+ core.$ZodMap<Key, Value> {
1442
+ keyType: Key;
1443
+ valueType: Value;
1444
+ }
1445
+ export const ZodMap: core.$constructor<ZodMap> = /*@__PURE__*/ core.$constructor("ZodMap", (inst, def) => {
1446
+ core.$ZodMap.init(inst, def);
1447
+ ZodType.init(inst, def);
1448
+ inst.keyType = def.keyType;
1449
+ inst.valueType = def.valueType;
1450
+ });
1451
+
1452
+ export function map<Key extends core.SomeType, Value extends core.SomeType>(
1453
+ keyType: Key,
1454
+ valueType: Value,
1455
+ params?: string | core.$ZodMapParams
1456
+ ): ZodMap<Key, Value> {
1457
+ return new ZodMap({
1458
+ type: "map",
1459
+ keyType: keyType as any as core.$ZodType,
1460
+ valueType: valueType as any as core.$ZodType,
1461
+ ...util.normalizeParams(params),
1462
+ }) as any;
1463
+ }
1464
+
1465
+ // ZodSet
1466
+ export interface ZodSet<T extends core.SomeType = core.$ZodType>
1467
+ extends _ZodType<core.$ZodSetInternals<T>>,
1468
+ core.$ZodSet<T> {
1469
+ min(minSize: number, params?: string | core.$ZodCheckMinSizeParams): this;
1470
+ nonempty(params?: string | core.$ZodCheckMinSizeParams): this;
1471
+ max(maxSize: number, params?: string | core.$ZodCheckMaxSizeParams): this;
1472
+ size(size: number, params?: string | core.$ZodCheckSizeEqualsParams): this;
1473
+ }
1474
+ export const ZodSet: core.$constructor<ZodSet> = /*@__PURE__*/ core.$constructor("ZodSet", (inst, def) => {
1475
+ core.$ZodSet.init(inst, def);
1476
+ ZodType.init(inst, def);
1477
+
1478
+ inst.min = (...args) => inst.check(core._minSize(...args));
1479
+ inst.nonempty = (params) => inst.check(core._minSize(1, params));
1480
+ inst.max = (...args) => inst.check(core._maxSize(...args));
1481
+ inst.size = (...args) => inst.check(core._size(...args));
1482
+ });
1483
+
1484
+ export function set<Value extends core.SomeType>(
1485
+ valueType: Value,
1486
+ params?: string | core.$ZodSetParams
1487
+ ): ZodSet<Value> {
1488
+ return new ZodSet({
1489
+ type: "set",
1490
+ valueType: valueType as any as core.$ZodType,
1491
+ ...util.normalizeParams(params),
1492
+ }) as any;
1493
+ }
1494
+
1495
+ // ZodEnum
1496
+ export interface ZodEnum<
1497
+ /** @ts-ignore Cast variance */
1498
+ out T extends util.EnumLike = util.EnumLike,
1499
+ > extends _ZodType<core.$ZodEnumInternals<T>>,
1500
+ core.$ZodEnum<T> {
1501
+ enum: T;
1502
+ options: Array<T[keyof T]>;
1503
+
1504
+ extract<const U extends readonly (keyof T)[]>(
1505
+ values: U,
1506
+ params?: string | core.$ZodEnumParams
1507
+ ): ZodEnum<util.Flatten<Pick<T, U[number]>>>;
1508
+ exclude<const U extends readonly (keyof T)[]>(
1509
+ values: U,
1510
+ params?: string | core.$ZodEnumParams
1511
+ ): ZodEnum<util.Flatten<Omit<T, U[number]>>>;
1512
+ }
1513
+ export const ZodEnum: core.$constructor<ZodEnum> = /*@__PURE__*/ core.$constructor("ZodEnum", (inst, def) => {
1514
+ core.$ZodEnum.init(inst, def);
1515
+ ZodType.init(inst, def);
1516
+
1517
+ inst.enum = def.entries;
1518
+ inst.options = Object.values(def.entries);
1519
+
1520
+ const keys = new Set(Object.keys(def.entries));
1521
+
1522
+ inst.extract = (values, params) => {
1523
+ const newEntries: Record<string, any> = {};
1524
+ for (const value of values) {
1525
+ if (keys.has(value)) {
1526
+ newEntries[value] = def.entries[value];
1527
+ } else throw new Error(`Key ${value} not found in enum`);
1528
+ }
1529
+ return new ZodEnum({
1530
+ ...def,
1531
+ checks: [],
1532
+ ...util.normalizeParams(params),
1533
+ entries: newEntries,
1534
+ }) as any;
1535
+ };
1536
+
1537
+ inst.exclude = (values, params) => {
1538
+ const newEntries: Record<string, any> = { ...def.entries };
1539
+ for (const value of values) {
1540
+ if (keys.has(value)) {
1541
+ delete newEntries[value];
1542
+ } else throw new Error(`Key ${value} not found in enum`);
1543
+ }
1544
+ return new ZodEnum({
1545
+ ...def,
1546
+ checks: [],
1547
+ ...util.normalizeParams(params),
1548
+ entries: newEntries,
1549
+ }) as any;
1550
+ };
1551
+ });
1552
+
1553
+ function _enum<const T extends readonly string[]>(
1554
+ values: T,
1555
+ params?: string | core.$ZodEnumParams
1556
+ ): ZodEnum<util.ToEnum<T[number]>>;
1557
+ function _enum<const T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodEnum<T>;
1558
+ function _enum(values: any, params?: string | core.$ZodEnumParams) {
1559
+ const entries: any = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
1560
+
1561
+ return new ZodEnum({
1562
+ type: "enum",
1563
+ entries,
1564
+ ...util.normalizeParams(params),
1565
+ }) as any;
1566
+ }
1567
+ export { _enum as enum };
1568
+
1569
+ /** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
1570
+ *
1571
+ * ```ts
1572
+ * enum Colors { red, green, blue }
1573
+ * z.enum(Colors);
1574
+ * ```
1575
+ */
1576
+ export function nativeEnum<T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodEnum<T> {
1577
+ return new ZodEnum({
1578
+ type: "enum",
1579
+ entries,
1580
+ ...util.normalizeParams(params),
1581
+ }) as any as ZodEnum<T>;
1582
+ }
1583
+
1584
+ // ZodLiteral
1585
+ export interface ZodLiteral<T extends util.Literal = util.Literal>
1586
+ extends _ZodType<core.$ZodLiteralInternals<T>>,
1587
+ core.$ZodLiteral<T> {
1588
+ values: Set<T>;
1589
+ /** @legacy Use `.values` instead. Accessing this property will throw an error if the literal accepts multiple values. */
1590
+ value: T;
1591
+ }
1592
+ export const ZodLiteral: core.$constructor<ZodLiteral> = /*@__PURE__*/ core.$constructor("ZodLiteral", (inst, def) => {
1593
+ core.$ZodLiteral.init(inst, def);
1594
+ ZodType.init(inst, def);
1595
+ inst.values = new Set(def.values);
1596
+ Object.defineProperty(inst, "value", {
1597
+ get() {
1598
+ if (def.values.length > 1) {
1599
+ throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
1600
+ }
1601
+ return def.values[0];
1602
+ },
1603
+ });
1604
+ });
1605
+
1606
+ export function literal<const T extends ReadonlyArray<util.Literal>>(
1607
+ value: T,
1608
+ params?: string | core.$ZodLiteralParams
1609
+ ): ZodLiteral<T[number]>;
1610
+ export function literal<const T extends util.Literal>(
1611
+ value: T,
1612
+ params?: string | core.$ZodLiteralParams
1613
+ ): ZodLiteral<T>;
1614
+ export function literal(value: any, params: any) {
1615
+ return new ZodLiteral({
1616
+ type: "literal",
1617
+ values: Array.isArray(value) ? value : [value],
1618
+ ...util.normalizeParams(params),
1619
+ });
1620
+ }
1621
+
1622
+ // ZodFile
1623
+ export interface ZodFile extends _ZodType<core.$ZodFileInternals>, core.$ZodFile {
1624
+ min(size: number, params?: string | core.$ZodCheckMinSizeParams): this;
1625
+ max(size: number, params?: string | core.$ZodCheckMaxSizeParams): this;
1626
+ mime(types: util.MimeTypes | Array<util.MimeTypes>, params?: string | core.$ZodCheckMimeTypeParams): this;
1627
+ }
1628
+ export const ZodFile: core.$constructor<ZodFile> = /*@__PURE__*/ core.$constructor("ZodFile", (inst, def) => {
1629
+ core.$ZodFile.init(inst, def);
1630
+ ZodType.init(inst, def);
1631
+
1632
+ inst.min = (size, params) => inst.check(core._minSize(size, params));
1633
+ inst.max = (size, params) => inst.check(core._maxSize(size, params));
1634
+ inst.mime = (types, params) => inst.check(core._mime(Array.isArray(types) ? types : [types], params));
1635
+ });
1636
+
1637
+ export function file(params?: string | core.$ZodFileParams): ZodFile {
1638
+ return core._file(ZodFile, params) as any;
1639
+ }
1640
+
1641
+ // ZodTransform
1642
+ export interface ZodTransform<O = unknown, I = unknown>
1643
+ extends _ZodType<core.$ZodTransformInternals<O, I>>,
1644
+ core.$ZodTransform<O, I> {}
1645
+ export const ZodTransform: core.$constructor<ZodTransform> = /*@__PURE__*/ core.$constructor(
1646
+ "ZodTransform",
1647
+ (inst, def) => {
1648
+ core.$ZodTransform.init(inst, def);
1649
+ ZodType.init(inst, def);
1650
+
1651
+ inst._zod.parse = (payload, _ctx) => {
1652
+ if (_ctx.direction === "backward") {
1653
+ throw new core.$ZodEncodeError(inst.constructor.name);
1654
+ }
1655
+
1656
+ (payload as core.$RefinementCtx).addIssue = (issue) => {
1657
+ if (typeof issue === "string") {
1658
+ payload.issues.push(util.issue(issue, payload.value, def));
1659
+ } else {
1660
+ // for Zod 3 backwards compatibility
1661
+ const _issue = issue as any;
1662
+
1663
+ if (_issue.fatal) _issue.continue = false;
1664
+ _issue.code ??= "custom";
1665
+ _issue.input ??= payload.value;
1666
+ _issue.inst ??= inst;
1667
+ // _issue.continue ??= true;
1668
+ payload.issues.push(util.issue(_issue));
1669
+ }
1670
+ };
1671
+
1672
+ const output = def.transform(payload.value, payload);
1673
+ if (output instanceof Promise) {
1674
+ return output.then((output) => {
1675
+ payload.value = output;
1676
+ return payload;
1677
+ });
1678
+ }
1679
+ payload.value = output;
1680
+ return payload;
1681
+ };
1682
+ }
1683
+ );
1684
+
1685
+ export function transform<I = unknown, O = I>(
1686
+ fn: (input: I, ctx: core.ParsePayload) => O
1687
+ ): ZodTransform<Awaited<O>, I> {
1688
+ return new ZodTransform({
1689
+ type: "transform",
1690
+ transform: fn as any,
1691
+ }) as any;
1692
+ }
1693
+
1694
+ // ZodOptional
1695
+ export interface ZodOptional<T extends core.SomeType = core.$ZodType>
1696
+ extends _ZodType<core.$ZodOptionalInternals<T>>,
1697
+ core.$ZodOptional<T> {
1698
+ unwrap(): T;
1699
+ }
1700
+ export const ZodOptional: core.$constructor<ZodOptional> = /*@__PURE__*/ core.$constructor(
1701
+ "ZodOptional",
1702
+ (inst, def) => {
1703
+ core.$ZodOptional.init(inst, def);
1704
+ ZodType.init(inst, def);
1705
+
1706
+ inst.unwrap = () => inst._zod.def.innerType;
1707
+ }
1708
+ );
1709
+
1710
+ export function optional<T extends core.SomeType>(innerType: T): ZodOptional<T> {
1711
+ return new ZodOptional({
1712
+ type: "optional",
1713
+ innerType: innerType as any as core.$ZodType,
1714
+ }) as any;
1715
+ }
1716
+
1717
+ // ZodNullable
1718
+ export interface ZodNullable<T extends core.SomeType = core.$ZodType>
1719
+ extends _ZodType<core.$ZodNullableInternals<T>>,
1720
+ core.$ZodNullable<T> {
1721
+ unwrap(): T;
1722
+ }
1723
+ export const ZodNullable: core.$constructor<ZodNullable> = /*@__PURE__*/ core.$constructor(
1724
+ "ZodNullable",
1725
+ (inst, def) => {
1726
+ core.$ZodNullable.init(inst, def);
1727
+ ZodType.init(inst, def);
1728
+
1729
+ inst.unwrap = () => inst._zod.def.innerType;
1730
+ }
1731
+ );
1732
+
1733
+ export function nullable<T extends core.SomeType>(innerType: T): ZodNullable<T> {
1734
+ return new ZodNullable({
1735
+ type: "nullable",
1736
+ innerType: innerType as any as core.$ZodType,
1737
+ }) as any;
1738
+ }
1739
+
1740
+ // nullish
1741
+ export function nullish<T extends core.SomeType>(innerType: T): ZodOptional<ZodNullable<T>> {
1742
+ return optional(nullable(innerType));
1743
+ }
1744
+
1745
+ // ZodDefault
1746
+ export interface ZodDefault<T extends core.SomeType = core.$ZodType>
1747
+ extends _ZodType<core.$ZodDefaultInternals<T>>,
1748
+ core.$ZodDefault<T> {
1749
+ unwrap(): T;
1750
+ /** @deprecated Use `.unwrap()` instead. */
1751
+ removeDefault(): T;
1752
+ }
1753
+ export const ZodDefault: core.$constructor<ZodDefault> = /*@__PURE__*/ core.$constructor("ZodDefault", (inst, def) => {
1754
+ core.$ZodDefault.init(inst, def);
1755
+ ZodType.init(inst, def);
1756
+
1757
+ inst.unwrap = () => inst._zod.def.innerType;
1758
+ inst.removeDefault = inst.unwrap;
1759
+ });
1760
+
1761
+ export function _default<T extends core.SomeType>(
1762
+ innerType: T,
1763
+ defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>)
1764
+ ): ZodDefault<T> {
1765
+ return new ZodDefault({
1766
+ type: "default",
1767
+ innerType: innerType as any as core.$ZodType,
1768
+ get defaultValue() {
1769
+ return typeof defaultValue === "function" ? (defaultValue as Function)() : util.shallowClone(defaultValue);
1770
+ },
1771
+ }) as any;
1772
+ }
1773
+
1774
+ // ZodPrefault
1775
+ export interface ZodPrefault<T extends core.SomeType = core.$ZodType>
1776
+ extends _ZodType<core.$ZodPrefaultInternals<T>>,
1777
+ core.$ZodPrefault<T> {
1778
+ unwrap(): T;
1779
+ }
1780
+ export const ZodPrefault: core.$constructor<ZodPrefault> = /*@__PURE__*/ core.$constructor(
1781
+ "ZodPrefault",
1782
+ (inst, def) => {
1783
+ core.$ZodPrefault.init(inst, def);
1784
+ ZodType.init(inst, def);
1785
+ inst.unwrap = () => inst._zod.def.innerType;
1786
+ }
1787
+ );
1788
+
1789
+ export function prefault<T extends core.SomeType>(
1790
+ innerType: T,
1791
+ defaultValue: core.input<T> | (() => core.input<T>)
1792
+ ): ZodPrefault<T> {
1793
+ return new ZodPrefault({
1794
+ type: "prefault",
1795
+ innerType: innerType as any as core.$ZodType,
1796
+ get defaultValue() {
1797
+ return typeof defaultValue === "function" ? (defaultValue as Function)() : util.shallowClone(defaultValue);
1798
+ },
1799
+ }) as any;
1800
+ }
1801
+
1802
+ // ZodNonOptional
1803
+ export interface ZodNonOptional<T extends core.SomeType = core.$ZodType>
1804
+ extends _ZodType<core.$ZodNonOptionalInternals<T>>,
1805
+ core.$ZodNonOptional<T> {
1806
+ unwrap(): T;
1807
+ }
1808
+ export const ZodNonOptional: core.$constructor<ZodNonOptional> = /*@__PURE__*/ core.$constructor(
1809
+ "ZodNonOptional",
1810
+ (inst, def) => {
1811
+ core.$ZodNonOptional.init(inst, def);
1812
+ ZodType.init(inst, def);
1813
+
1814
+ inst.unwrap = () => inst._zod.def.innerType;
1815
+ }
1816
+ );
1817
+
1818
+ export function nonoptional<T extends core.SomeType>(
1819
+ innerType: T,
1820
+ params?: string | core.$ZodNonOptionalParams
1821
+ ): ZodNonOptional<T> {
1822
+ return new ZodNonOptional({
1823
+ type: "nonoptional",
1824
+ innerType: innerType as any as core.$ZodType,
1825
+ ...util.normalizeParams(params),
1826
+ }) as any;
1827
+ }
1828
+
1829
+ // ZodSuccess
1830
+ export interface ZodSuccess<T extends core.SomeType = core.$ZodType>
1831
+ extends _ZodType<core.$ZodSuccessInternals<T>>,
1832
+ core.$ZodSuccess<T> {
1833
+ unwrap(): T;
1834
+ }
1835
+ export const ZodSuccess: core.$constructor<ZodSuccess> = /*@__PURE__*/ core.$constructor("ZodSuccess", (inst, def) => {
1836
+ core.$ZodSuccess.init(inst, def);
1837
+ ZodType.init(inst, def);
1838
+
1839
+ inst.unwrap = () => inst._zod.def.innerType;
1840
+ });
1841
+
1842
+ export function success<T extends core.SomeType>(innerType: T): ZodSuccess<T> {
1843
+ return new ZodSuccess({
1844
+ type: "success",
1845
+ innerType: innerType as any as core.$ZodType,
1846
+ }) as any;
1847
+ }
1848
+
1849
+ // ZodCatch
1850
+ export interface ZodCatch<T extends core.SomeType = core.$ZodType>
1851
+ extends _ZodType<core.$ZodCatchInternals<T>>,
1852
+ core.$ZodCatch<T> {
1853
+ unwrap(): T;
1854
+ /** @deprecated Use `.unwrap()` instead. */
1855
+ removeCatch(): T;
1856
+ }
1857
+ export const ZodCatch: core.$constructor<ZodCatch> = /*@__PURE__*/ core.$constructor("ZodCatch", (inst, def) => {
1858
+ core.$ZodCatch.init(inst, def);
1859
+ ZodType.init(inst, def);
1860
+
1861
+ inst.unwrap = () => inst._zod.def.innerType;
1862
+ inst.removeCatch = inst.unwrap;
1863
+ });
1864
+
1865
+ function _catch<T extends core.SomeType>(
1866
+ innerType: T,
1867
+ catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>)
1868
+ ): ZodCatch<T> {
1869
+ return new ZodCatch({
1870
+ type: "catch",
1871
+ innerType: innerType as any as core.$ZodType,
1872
+ catchValue: (typeof catchValue === "function" ? catchValue : () => catchValue) as (
1873
+ ctx: core.$ZodCatchCtx
1874
+ ) => core.output<T>,
1875
+ }) as any;
1876
+ }
1877
+ export { _catch as catch };
1878
+
1879
+ // ZodNaN
1880
+ export interface ZodNaN extends _ZodType<core.$ZodNaNInternals>, core.$ZodNaN {}
1881
+ export const ZodNaN: core.$constructor<ZodNaN> = /*@__PURE__*/ core.$constructor("ZodNaN", (inst, def) => {
1882
+ core.$ZodNaN.init(inst, def);
1883
+ ZodType.init(inst, def);
1884
+ });
1885
+
1886
+ export function nan(params?: string | core.$ZodNaNParams): ZodNaN {
1887
+ return core._nan(ZodNaN, params);
1888
+ }
1889
+
1890
+ // ZodPipe
1891
+ export interface ZodPipe<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType>
1892
+ extends _ZodType<core.$ZodPipeInternals<A, B>>,
1893
+ core.$ZodPipe<A, B> {
1894
+ in: A;
1895
+ out: B;
1896
+ }
1897
+ export const ZodPipe: core.$constructor<ZodPipe> = /*@__PURE__*/ core.$constructor("ZodPipe", (inst, def) => {
1898
+ core.$ZodPipe.init(inst, def);
1899
+ ZodType.init(inst, def);
1900
+
1901
+ inst.in = def.in;
1902
+ inst.out = def.out;
1903
+ });
1904
+
1905
+ export function pipe<
1906
+ const A extends core.SomeType,
1907
+ B extends core.$ZodType<unknown, core.output<A>> = core.$ZodType<unknown, core.output<A>>,
1908
+ >(in_: A, out: B | core.$ZodType<unknown, core.output<A>>): ZodPipe<A, B>;
1909
+ export function pipe(in_: core.SomeType, out: core.SomeType) {
1910
+ return new ZodPipe({
1911
+ type: "pipe",
1912
+ in: in_ as unknown as core.$ZodType,
1913
+ out: out as unknown as core.$ZodType,
1914
+ // ...util.normalizeParams(params),
1915
+ });
1916
+ }
1917
+
1918
+ // ZodCodec
1919
+ export interface ZodCodec<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType>
1920
+ extends ZodPipe<A, B>,
1921
+ core.$ZodCodec<A, B> {
1922
+ _zod: core.$ZodCodecInternals<A, B>;
1923
+ def: core.$ZodCodecDef<A, B>;
1924
+ }
1925
+ export const ZodCodec: core.$constructor<ZodCodec> = /*@__PURE__*/ core.$constructor("ZodCodec", (inst, def) => {
1926
+ ZodPipe.init(inst, def);
1927
+ core.$ZodCodec.init(inst, def);
1928
+ });
1929
+
1930
+ export function codec<const A extends core.SomeType, B extends core.SomeType = core.$ZodType>(
1931
+ in_: A,
1932
+ out: B,
1933
+ params: {
1934
+ decode: (value: core.output<A>, payload: core.ParsePayload<core.output<A>>) => core.util.MaybeAsync<core.input<B>>;
1935
+ encode: (value: core.input<B>, payload: core.ParsePayload<core.input<B>>) => core.util.MaybeAsync<core.output<A>>;
1936
+ }
1937
+ ): ZodCodec<A, B> {
1938
+ return new ZodCodec({
1939
+ type: "pipe",
1940
+ in: in_ as any as core.$ZodType,
1941
+ out: out as any as core.$ZodType,
1942
+ transform: params.decode as any,
1943
+ reverseTransform: params.encode as any,
1944
+ }) as any;
1945
+ }
1946
+
1947
+ // ZodReadonly
1948
+ export interface ZodReadonly<T extends core.SomeType = core.$ZodType>
1949
+ extends _ZodType<core.$ZodReadonlyInternals<T>>,
1950
+ core.$ZodReadonly<T> {
1951
+ unwrap(): T;
1952
+ }
1953
+ export const ZodReadonly: core.$constructor<ZodReadonly> = /*@__PURE__*/ core.$constructor(
1954
+ "ZodReadonly",
1955
+ (inst, def) => {
1956
+ core.$ZodReadonly.init(inst, def);
1957
+ ZodType.init(inst, def);
1958
+
1959
+ inst.unwrap = () => inst._zod.def.innerType;
1960
+ }
1961
+ );
1962
+
1963
+ export function readonly<T extends core.SomeType>(innerType: T): ZodReadonly<T> {
1964
+ return new ZodReadonly({
1965
+ type: "readonly",
1966
+ innerType: innerType as any as core.$ZodType,
1967
+ }) as any;
1968
+ }
1969
+
1970
+ // ZodTemplateLiteral
1971
+ export interface ZodTemplateLiteral<Template extends string = string>
1972
+ extends _ZodType<core.$ZodTemplateLiteralInternals<Template>>,
1973
+ core.$ZodTemplateLiteral<Template> {}
1974
+ export const ZodTemplateLiteral: core.$constructor<ZodTemplateLiteral> = /*@__PURE__*/ core.$constructor(
1975
+ "ZodTemplateLiteral",
1976
+ (inst, def) => {
1977
+ core.$ZodTemplateLiteral.init(inst, def);
1978
+ ZodType.init(inst, def);
1979
+ }
1980
+ );
1981
+
1982
+ export function templateLiteral<const Parts extends core.$ZodTemplateLiteralPart[]>(
1983
+ parts: Parts,
1984
+ params?: string | core.$ZodTemplateLiteralParams
1985
+ ): ZodTemplateLiteral<core.$PartsToTemplateLiteral<Parts>> {
1986
+ return new ZodTemplateLiteral({
1987
+ type: "template_literal",
1988
+ parts,
1989
+ ...util.normalizeParams(params),
1990
+ }) as any;
1991
+ }
1992
+
1993
+ // ZodLazy
1994
+ export interface ZodLazy<T extends core.SomeType = core.$ZodType>
1995
+ extends _ZodType<core.$ZodLazyInternals<T>>,
1996
+ core.$ZodLazy<T> {
1997
+ unwrap(): T;
1998
+ }
1999
+ export const ZodLazy: core.$constructor<ZodLazy> = /*@__PURE__*/ core.$constructor("ZodLazy", (inst, def) => {
2000
+ core.$ZodLazy.init(inst, def);
2001
+ ZodType.init(inst, def);
2002
+
2003
+ inst.unwrap = () => inst._zod.def.getter();
2004
+ });
2005
+
2006
+ export function lazy<T extends core.SomeType>(getter: () => T): ZodLazy<T> {
2007
+ return new ZodLazy({
2008
+ type: "lazy",
2009
+ getter: getter as any,
2010
+ }) as any;
2011
+ }
2012
+
2013
+ // ZodPromise
2014
+ export interface ZodPromise<T extends core.SomeType = core.$ZodType>
2015
+ extends _ZodType<core.$ZodPromiseInternals<T>>,
2016
+ core.$ZodPromise<T> {
2017
+ unwrap(): T;
2018
+ }
2019
+ export const ZodPromise: core.$constructor<ZodPromise> = /*@__PURE__*/ core.$constructor("ZodPromise", (inst, def) => {
2020
+ core.$ZodPromise.init(inst, def);
2021
+ ZodType.init(inst, def);
2022
+
2023
+ inst.unwrap = () => inst._zod.def.innerType;
2024
+ });
2025
+
2026
+ export function promise<T extends core.SomeType>(innerType: T): ZodPromise<T> {
2027
+ return new ZodPromise({
2028
+ type: "promise",
2029
+ innerType: innerType as any as core.$ZodType,
2030
+ }) as any;
2031
+ }
2032
+
2033
+ // ZodFunction
2034
+ export interface ZodFunction<
2035
+ Args extends core.$ZodFunctionIn = core.$ZodFunctionIn,
2036
+ Returns extends core.$ZodFunctionOut = core.$ZodFunctionOut,
2037
+ > extends _ZodType<core.$ZodFunctionInternals<Args, Returns>>,
2038
+ core.$ZodFunction<Args, Returns> {
2039
+ _def: core.$ZodFunctionDef<Args, Returns>;
2040
+ _input: core.$InferInnerFunctionType<Args, Returns>;
2041
+ _output: core.$InferOuterFunctionType<Args, Returns>;
2042
+
2043
+ input<const Items extends util.TupleItems, const Rest extends core.$ZodFunctionOut = core.$ZodFunctionOut>(
2044
+ args: Items,
2045
+ rest?: Rest
2046
+ ): ZodFunction<core.$ZodTuple<Items, Rest>, Returns>;
2047
+ input<NewArgs extends core.$ZodFunctionIn>(args: NewArgs): ZodFunction<NewArgs, Returns>;
2048
+ input(...args: any[]): ZodFunction<any, Returns>;
2049
+
2050
+ output<NewReturns extends core.$ZodType>(output: NewReturns): ZodFunction<Args, NewReturns>;
2051
+ }
2052
+
2053
+ export const ZodFunction: core.$constructor<ZodFunction> = /*@__PURE__*/ core.$constructor(
2054
+ "ZodFunction",
2055
+ (inst, def) => {
2056
+ core.$ZodFunction.init(inst, def);
2057
+ ZodType.init(inst, def);
2058
+ }
2059
+ );
2060
+
2061
+ export function _function(): ZodFunction;
2062
+ export function _function<const In extends ReadonlyArray<core.$ZodType>>(params: {
2063
+ input: In;
2064
+ }): ZodFunction<ZodTuple<In, null>, core.$ZodFunctionOut>;
2065
+ export function _function<
2066
+ const In extends ReadonlyArray<core.$ZodType>,
2067
+ const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut,
2068
+ >(params: {
2069
+ input: In;
2070
+ output: Out;
2071
+ }): ZodFunction<ZodTuple<In, null>, Out>;
2072
+ export function _function<const In extends core.$ZodFunctionIn = core.$ZodFunctionIn>(params: {
2073
+ input: In;
2074
+ }): ZodFunction<In, core.$ZodFunctionOut>;
2075
+ export function _function<const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut>(params: {
2076
+ output: Out;
2077
+ }): ZodFunction<core.$ZodFunctionIn, Out>;
2078
+ export function _function<
2079
+ In extends core.$ZodFunctionIn = core.$ZodFunctionIn,
2080
+ Out extends core.$ZodType = core.$ZodType,
2081
+ >(params?: {
2082
+ input: In;
2083
+ output: Out;
2084
+ }): ZodFunction<In, Out>;
2085
+ export function _function(params?: {
2086
+ output?: core.$ZodType;
2087
+ input?: core.$ZodFunctionArgs | Array<core.$ZodType>;
2088
+ }): ZodFunction {
2089
+ return new ZodFunction({
2090
+ type: "function",
2091
+ input: Array.isArray(params?.input) ? tuple(params?.input as any) : (params?.input ?? array(unknown())),
2092
+ output: params?.output ?? unknown(),
2093
+ });
2094
+ }
2095
+
2096
+ export { _function as function };
2097
+
2098
+ // ZodCustom
2099
+ export interface ZodCustom<O = unknown, I = unknown>
2100
+ extends _ZodType<core.$ZodCustomInternals<O, I>>,
2101
+ core.$ZodCustom<O, I> {}
2102
+ export const ZodCustom: core.$constructor<ZodCustom> = /*@__PURE__*/ core.$constructor("ZodCustom", (inst, def) => {
2103
+ core.$ZodCustom.init(inst, def);
2104
+ ZodType.init(inst, def);
2105
+ });
2106
+
2107
+ // custom checks
2108
+ export function check<O = unknown>(fn: core.CheckFn<O>): core.$ZodCheck<O> {
2109
+ const ch = new core.$ZodCheck({
2110
+ check: "custom",
2111
+ // ...util.normalizeParams(params),
2112
+ });
2113
+
2114
+ ch._zod.check = fn;
2115
+ return ch;
2116
+ }
2117
+
2118
+ export function custom<O>(
2119
+ fn?: (data: unknown) => unknown,
2120
+ _params?: string | core.$ZodCustomParams | undefined
2121
+ ): ZodCustom<O, O> {
2122
+ return core._custom(ZodCustom, fn ?? (() => true), _params) as any;
2123
+ }
2124
+
2125
+ export function refine<T>(
2126
+ fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>,
2127
+ _params: string | core.$ZodCustomParams = {}
2128
+ ): core.$ZodCheck<T> {
2129
+ return core._refine(ZodCustom, fn, _params);
2130
+ }
2131
+
2132
+ // superRefine
2133
+ export function superRefine<T>(
2134
+ fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>
2135
+ ): core.$ZodCheck<T> {
2136
+ return core._superRefine(fn);
2137
+ }
2138
+
2139
+ type ZodInstanceOfParams = core.Params<
2140
+ ZodCustom,
2141
+ core.$ZodIssueCustom,
2142
+ "type" | "check" | "checks" | "fn" | "abort" | "error" | "params" | "path"
2143
+ >;
2144
+ function _instanceof<T extends typeof util.Class>(
2145
+ cls: T,
2146
+ params: ZodInstanceOfParams = {
2147
+ error: `Input not instance of ${cls.name}`,
2148
+ }
2149
+ ): ZodCustom<InstanceType<T>, InstanceType<T>> {
2150
+ const inst = new ZodCustom({
2151
+ type: "custom",
2152
+ check: "custom",
2153
+ fn: (data) => data instanceof cls,
2154
+ abort: true,
2155
+ ...(util.normalizeParams(params) as any),
2156
+ });
2157
+ inst._zod.bag.Class = cls;
2158
+ return inst as any;
2159
+ }
2160
+ export { _instanceof as instanceof };
2161
+
2162
+ // stringbool
2163
+ export const stringbool: (_params?: string | core.$ZodStringBoolParams) => ZodCodec<ZodString, ZodBoolean> = (
2164
+ ...args
2165
+ ) =>
2166
+ core._stringbool(
2167
+ {
2168
+ Codec: ZodCodec,
2169
+ Boolean: ZodBoolean,
2170
+ String: ZodString,
2171
+ },
2172
+ ...args
2173
+ ) as any;
2174
+
2175
+ // json
2176
+ type _ZodJSONSchema = ZodUnion<
2177
+ [ZodString, ZodNumber, ZodBoolean, ZodNull, ZodArray<ZodJSONSchema>, ZodRecord<ZodString, ZodJSONSchema>]
2178
+ >;
2179
+ type _ZodJSONSchemaInternals = _ZodJSONSchema["_zod"];
2180
+
2181
+ export interface ZodJSONSchemaInternals extends _ZodJSONSchemaInternals {
2182
+ output: util.JSONType;
2183
+ input: util.JSONType;
2184
+ }
2185
+ export interface ZodJSONSchema extends _ZodJSONSchema {
2186
+ _zod: ZodJSONSchemaInternals;
2187
+ }
2188
+
2189
+ export function json(params?: string | core.$ZodCustomParams): ZodJSONSchema {
2190
+ const jsonSchema: any = lazy(() => {
2191
+ return union([string(params), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);
2192
+ });
2193
+
2194
+ return jsonSchema;
2195
+ }
2196
+
2197
+ // preprocess
2198
+
2199
+ // /** @deprecated Use `z.pipe()` and `z.transform()` instead. */
2200
+ export function preprocess<A, U extends core.SomeType, B = unknown>(
2201
+ fn: (arg: B, ctx: core.$RefinementCtx) => A,
2202
+ schema: U
2203
+ ): ZodPipe<ZodTransform<A, B>, U> {
2204
+ return pipe(transform(fn as any), schema as any) as any;
2205
+ }