agentf 0.7.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 (763) 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/commands/explorer.rb +12 -4
  762. data/lib/agentf/version.rb +1 -1
  763. metadata +761 -2
@@ -0,0 +1,1972 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.$ZodMap = exports.$ZodRecord = exports.$ZodTuple = exports.$ZodIntersection = exports.$ZodDiscriminatedUnion = exports.$ZodUnion = exports.$ZodObjectJIT = exports.$ZodObject = exports.$ZodArray = exports.$ZodDate = exports.$ZodVoid = exports.$ZodNever = exports.$ZodUnknown = exports.$ZodAny = exports.$ZodNull = exports.$ZodUndefined = exports.$ZodSymbol = exports.$ZodBigIntFormat = exports.$ZodBigInt = exports.$ZodBoolean = exports.$ZodNumberFormat = exports.$ZodNumber = exports.$ZodCustomStringFormat = exports.$ZodJWT = exports.$ZodE164 = exports.$ZodBase64URL = exports.$ZodBase64 = exports.$ZodCIDRv6 = exports.$ZodCIDRv4 = exports.$ZodIPv6 = exports.$ZodIPv4 = exports.$ZodISODuration = exports.$ZodISOTime = exports.$ZodISODate = exports.$ZodISODateTime = exports.$ZodKSUID = exports.$ZodXID = exports.$ZodULID = exports.$ZodCUID2 = exports.$ZodCUID = exports.$ZodNanoID = exports.$ZodEmoji = exports.$ZodURL = exports.$ZodEmail = exports.$ZodUUID = exports.$ZodGUID = exports.$ZodStringFormat = exports.$ZodString = exports.clone = exports.$ZodType = void 0;
27
+ exports.$ZodCustom = exports.$ZodLazy = exports.$ZodPromise = exports.$ZodFunction = exports.$ZodTemplateLiteral = exports.$ZodReadonly = exports.$ZodCodec = exports.$ZodPipe = exports.$ZodNaN = exports.$ZodCatch = exports.$ZodSuccess = exports.$ZodNonOptional = exports.$ZodPrefault = exports.$ZodDefault = exports.$ZodNullable = exports.$ZodOptional = exports.$ZodTransform = exports.$ZodFile = exports.$ZodLiteral = exports.$ZodEnum = exports.$ZodSet = void 0;
28
+ exports.isValidBase64 = isValidBase64;
29
+ exports.isValidBase64URL = isValidBase64URL;
30
+ exports.isValidJWT = isValidJWT;
31
+ const checks = __importStar(require("./checks.cjs"));
32
+ const core = __importStar(require("./core.cjs"));
33
+ const doc_js_1 = require("./doc.cjs");
34
+ const parse_js_1 = require("./parse.cjs");
35
+ const regexes = __importStar(require("./regexes.cjs"));
36
+ const util = __importStar(require("./util.cjs"));
37
+ const versions_js_1 = require("./versions.cjs");
38
+ exports.$ZodType = core.$constructor("$ZodType", (inst, def) => {
39
+ var _a;
40
+ inst ?? (inst = {});
41
+ inst._zod.def = def; // set _def property
42
+ inst._zod.bag = inst._zod.bag || {}; // initialize _bag object
43
+ inst._zod.version = versions_js_1.version;
44
+ const checks = [...(inst._zod.def.checks ?? [])];
45
+ // if inst is itself a checks.$ZodCheck, run it as a check
46
+ if (inst._zod.traits.has("$ZodCheck")) {
47
+ checks.unshift(inst);
48
+ }
49
+ for (const ch of checks) {
50
+ for (const fn of ch._zod.onattach) {
51
+ fn(inst);
52
+ }
53
+ }
54
+ if (checks.length === 0) {
55
+ // deferred initializer
56
+ // inst._zod.parse is not yet defined
57
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
58
+ inst._zod.deferred?.push(() => {
59
+ inst._zod.run = inst._zod.parse;
60
+ });
61
+ }
62
+ else {
63
+ const runChecks = (payload, checks, ctx) => {
64
+ let isAborted = util.aborted(payload);
65
+ let asyncResult;
66
+ for (const ch of checks) {
67
+ if (ch._zod.def.when) {
68
+ const shouldRun = ch._zod.def.when(payload);
69
+ if (!shouldRun)
70
+ continue;
71
+ }
72
+ else if (isAborted) {
73
+ continue;
74
+ }
75
+ const currLen = payload.issues.length;
76
+ const _ = ch._zod.check(payload);
77
+ if (_ instanceof Promise && ctx?.async === false) {
78
+ throw new core.$ZodAsyncError();
79
+ }
80
+ if (asyncResult || _ instanceof Promise) {
81
+ asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
82
+ await _;
83
+ const nextLen = payload.issues.length;
84
+ if (nextLen === currLen)
85
+ return;
86
+ if (!isAborted)
87
+ isAborted = util.aborted(payload, currLen);
88
+ });
89
+ }
90
+ else {
91
+ const nextLen = payload.issues.length;
92
+ if (nextLen === currLen)
93
+ continue;
94
+ if (!isAborted)
95
+ isAborted = util.aborted(payload, currLen);
96
+ }
97
+ }
98
+ if (asyncResult) {
99
+ return asyncResult.then(() => {
100
+ return payload;
101
+ });
102
+ }
103
+ return payload;
104
+ };
105
+ // const handleChecksResult = (
106
+ // checkResult: ParsePayload,
107
+ // originalResult: ParsePayload,
108
+ // ctx: ParseContextInternal
109
+ // ): util.MaybeAsync<ParsePayload> => {
110
+ // // if the checks mutated the value && there are no issues, re-parse the result
111
+ // if (checkResult.value !== originalResult.value && !checkResult.issues.length)
112
+ // return inst._zod.parse(checkResult, ctx);
113
+ // return originalResult;
114
+ // };
115
+ const handleCanaryResult = (canary, payload, ctx) => {
116
+ // abort if the canary is aborted
117
+ if (util.aborted(canary)) {
118
+ canary.aborted = true;
119
+ return canary;
120
+ }
121
+ // run checks first, then
122
+ const checkResult = runChecks(payload, checks, ctx);
123
+ if (checkResult instanceof Promise) {
124
+ if (ctx.async === false)
125
+ throw new core.$ZodAsyncError();
126
+ return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));
127
+ }
128
+ return inst._zod.parse(checkResult, ctx);
129
+ };
130
+ inst._zod.run = (payload, ctx) => {
131
+ if (ctx.skipChecks) {
132
+ return inst._zod.parse(payload, ctx);
133
+ }
134
+ if (ctx.direction === "backward") {
135
+ // run canary
136
+ // initial pass (no checks)
137
+ const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });
138
+ if (canary instanceof Promise) {
139
+ return canary.then((canary) => {
140
+ return handleCanaryResult(canary, payload, ctx);
141
+ });
142
+ }
143
+ return handleCanaryResult(canary, payload, ctx);
144
+ }
145
+ // forward
146
+ const result = inst._zod.parse(payload, ctx);
147
+ if (result instanceof Promise) {
148
+ if (ctx.async === false)
149
+ throw new core.$ZodAsyncError();
150
+ return result.then((result) => runChecks(result, checks, ctx));
151
+ }
152
+ return runChecks(result, checks, ctx);
153
+ };
154
+ }
155
+ inst["~standard"] = {
156
+ validate: (value) => {
157
+ try {
158
+ const r = (0, parse_js_1.safeParse)(inst, value);
159
+ return r.success ? { value: r.data } : { issues: r.error?.issues };
160
+ }
161
+ catch (_) {
162
+ return (0, parse_js_1.safeParseAsync)(inst, value).then((r) => (r.success ? { value: r.data } : { issues: r.error?.issues }));
163
+ }
164
+ },
165
+ vendor: "zod",
166
+ version: 1,
167
+ };
168
+ });
169
+ var util_js_1 = require("./util.cjs");
170
+ Object.defineProperty(exports, "clone", { enumerable: true, get: function () { return util_js_1.clone; } });
171
+ exports.$ZodString = core.$constructor("$ZodString", (inst, def) => {
172
+ exports.$ZodType.init(inst, def);
173
+ inst._zod.pattern = [...(inst?._zod.bag?.patterns ?? [])].pop() ?? regexes.string(inst._zod.bag);
174
+ inst._zod.parse = (payload, _) => {
175
+ if (def.coerce)
176
+ try {
177
+ payload.value = String(payload.value);
178
+ }
179
+ catch (_) { }
180
+ if (typeof payload.value === "string")
181
+ return payload;
182
+ payload.issues.push({
183
+ expected: "string",
184
+ code: "invalid_type",
185
+ input: payload.value,
186
+ inst,
187
+ });
188
+ return payload;
189
+ };
190
+ });
191
+ exports.$ZodStringFormat = core.$constructor("$ZodStringFormat", (inst, def) => {
192
+ // check initialization must come first
193
+ checks.$ZodCheckStringFormat.init(inst, def);
194
+ exports.$ZodString.init(inst, def);
195
+ });
196
+ exports.$ZodGUID = core.$constructor("$ZodGUID", (inst, def) => {
197
+ def.pattern ?? (def.pattern = regexes.guid);
198
+ exports.$ZodStringFormat.init(inst, def);
199
+ });
200
+ exports.$ZodUUID = core.$constructor("$ZodUUID", (inst, def) => {
201
+ if (def.version) {
202
+ const versionMap = {
203
+ v1: 1,
204
+ v2: 2,
205
+ v3: 3,
206
+ v4: 4,
207
+ v5: 5,
208
+ v6: 6,
209
+ v7: 7,
210
+ v8: 8,
211
+ };
212
+ const v = versionMap[def.version];
213
+ if (v === undefined)
214
+ throw new Error(`Invalid UUID version: "${def.version}"`);
215
+ def.pattern ?? (def.pattern = regexes.uuid(v));
216
+ }
217
+ else
218
+ def.pattern ?? (def.pattern = regexes.uuid());
219
+ exports.$ZodStringFormat.init(inst, def);
220
+ });
221
+ exports.$ZodEmail = core.$constructor("$ZodEmail", (inst, def) => {
222
+ def.pattern ?? (def.pattern = regexes.email);
223
+ exports.$ZodStringFormat.init(inst, def);
224
+ });
225
+ exports.$ZodURL = core.$constructor("$ZodURL", (inst, def) => {
226
+ exports.$ZodStringFormat.init(inst, def);
227
+ inst._zod.check = (payload) => {
228
+ try {
229
+ // Trim whitespace from input
230
+ const trimmed = payload.value.trim();
231
+ // @ts-ignore
232
+ const url = new URL(trimmed);
233
+ if (def.hostname) {
234
+ def.hostname.lastIndex = 0;
235
+ if (!def.hostname.test(url.hostname)) {
236
+ payload.issues.push({
237
+ code: "invalid_format",
238
+ format: "url",
239
+ note: "Invalid hostname",
240
+ pattern: regexes.hostname.source,
241
+ input: payload.value,
242
+ inst,
243
+ continue: !def.abort,
244
+ });
245
+ }
246
+ }
247
+ if (def.protocol) {
248
+ def.protocol.lastIndex = 0;
249
+ if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) {
250
+ payload.issues.push({
251
+ code: "invalid_format",
252
+ format: "url",
253
+ note: "Invalid protocol",
254
+ pattern: def.protocol.source,
255
+ input: payload.value,
256
+ inst,
257
+ continue: !def.abort,
258
+ });
259
+ }
260
+ }
261
+ // Set the output value based on normalize flag
262
+ if (def.normalize) {
263
+ // Use normalized URL
264
+ payload.value = url.href;
265
+ }
266
+ else {
267
+ // Preserve the original input (trimmed)
268
+ payload.value = trimmed;
269
+ }
270
+ return;
271
+ }
272
+ catch (_) {
273
+ payload.issues.push({
274
+ code: "invalid_format",
275
+ format: "url",
276
+ input: payload.value,
277
+ inst,
278
+ continue: !def.abort,
279
+ });
280
+ }
281
+ };
282
+ });
283
+ exports.$ZodEmoji = core.$constructor("$ZodEmoji", (inst, def) => {
284
+ def.pattern ?? (def.pattern = regexes.emoji());
285
+ exports.$ZodStringFormat.init(inst, def);
286
+ });
287
+ exports.$ZodNanoID = core.$constructor("$ZodNanoID", (inst, def) => {
288
+ def.pattern ?? (def.pattern = regexes.nanoid);
289
+ exports.$ZodStringFormat.init(inst, def);
290
+ });
291
+ exports.$ZodCUID = core.$constructor("$ZodCUID", (inst, def) => {
292
+ def.pattern ?? (def.pattern = regexes.cuid);
293
+ exports.$ZodStringFormat.init(inst, def);
294
+ });
295
+ exports.$ZodCUID2 = core.$constructor("$ZodCUID2", (inst, def) => {
296
+ def.pattern ?? (def.pattern = regexes.cuid2);
297
+ exports.$ZodStringFormat.init(inst, def);
298
+ });
299
+ exports.$ZodULID = core.$constructor("$ZodULID", (inst, def) => {
300
+ def.pattern ?? (def.pattern = regexes.ulid);
301
+ exports.$ZodStringFormat.init(inst, def);
302
+ });
303
+ exports.$ZodXID = core.$constructor("$ZodXID", (inst, def) => {
304
+ def.pattern ?? (def.pattern = regexes.xid);
305
+ exports.$ZodStringFormat.init(inst, def);
306
+ });
307
+ exports.$ZodKSUID = core.$constructor("$ZodKSUID", (inst, def) => {
308
+ def.pattern ?? (def.pattern = regexes.ksuid);
309
+ exports.$ZodStringFormat.init(inst, def);
310
+ });
311
+ exports.$ZodISODateTime = core.$constructor("$ZodISODateTime", (inst, def) => {
312
+ def.pattern ?? (def.pattern = regexes.datetime(def));
313
+ exports.$ZodStringFormat.init(inst, def);
314
+ });
315
+ exports.$ZodISODate = core.$constructor("$ZodISODate", (inst, def) => {
316
+ def.pattern ?? (def.pattern = regexes.date);
317
+ exports.$ZodStringFormat.init(inst, def);
318
+ });
319
+ exports.$ZodISOTime = core.$constructor("$ZodISOTime", (inst, def) => {
320
+ def.pattern ?? (def.pattern = regexes.time(def));
321
+ exports.$ZodStringFormat.init(inst, def);
322
+ });
323
+ exports.$ZodISODuration = core.$constructor("$ZodISODuration", (inst, def) => {
324
+ def.pattern ?? (def.pattern = regexes.duration);
325
+ exports.$ZodStringFormat.init(inst, def);
326
+ });
327
+ exports.$ZodIPv4 = core.$constructor("$ZodIPv4", (inst, def) => {
328
+ def.pattern ?? (def.pattern = regexes.ipv4);
329
+ exports.$ZodStringFormat.init(inst, def);
330
+ inst._zod.onattach.push((inst) => {
331
+ const bag = inst._zod.bag;
332
+ bag.format = `ipv4`;
333
+ });
334
+ });
335
+ exports.$ZodIPv6 = core.$constructor("$ZodIPv6", (inst, def) => {
336
+ def.pattern ?? (def.pattern = regexes.ipv6);
337
+ exports.$ZodStringFormat.init(inst, def);
338
+ inst._zod.onattach.push((inst) => {
339
+ const bag = inst._zod.bag;
340
+ bag.format = `ipv6`;
341
+ });
342
+ inst._zod.check = (payload) => {
343
+ try {
344
+ // @ts-ignore
345
+ new URL(`http://[${payload.value}]`);
346
+ // return;
347
+ }
348
+ catch {
349
+ payload.issues.push({
350
+ code: "invalid_format",
351
+ format: "ipv6",
352
+ input: payload.value,
353
+ inst,
354
+ continue: !def.abort,
355
+ });
356
+ }
357
+ };
358
+ });
359
+ exports.$ZodCIDRv4 = core.$constructor("$ZodCIDRv4", (inst, def) => {
360
+ def.pattern ?? (def.pattern = regexes.cidrv4);
361
+ exports.$ZodStringFormat.init(inst, def);
362
+ });
363
+ exports.$ZodCIDRv6 = core.$constructor("$ZodCIDRv6", (inst, def) => {
364
+ def.pattern ?? (def.pattern = regexes.cidrv6); // not used for validation
365
+ exports.$ZodStringFormat.init(inst, def);
366
+ inst._zod.check = (payload) => {
367
+ const parts = payload.value.split("/");
368
+ try {
369
+ if (parts.length !== 2)
370
+ throw new Error();
371
+ const [address, prefix] = parts;
372
+ if (!prefix)
373
+ throw new Error();
374
+ const prefixNum = Number(prefix);
375
+ if (`${prefixNum}` !== prefix)
376
+ throw new Error();
377
+ if (prefixNum < 0 || prefixNum > 128)
378
+ throw new Error();
379
+ // @ts-ignore
380
+ new URL(`http://[${address}]`);
381
+ }
382
+ catch {
383
+ payload.issues.push({
384
+ code: "invalid_format",
385
+ format: "cidrv6",
386
+ input: payload.value,
387
+ inst,
388
+ continue: !def.abort,
389
+ });
390
+ }
391
+ };
392
+ });
393
+ ////////////////////////////// ZodBase64 //////////////////////////////
394
+ function isValidBase64(data) {
395
+ if (data === "")
396
+ return true;
397
+ if (data.length % 4 !== 0)
398
+ return false;
399
+ try {
400
+ // @ts-ignore
401
+ atob(data);
402
+ return true;
403
+ }
404
+ catch {
405
+ return false;
406
+ }
407
+ }
408
+ exports.$ZodBase64 = core.$constructor("$ZodBase64", (inst, def) => {
409
+ def.pattern ?? (def.pattern = regexes.base64);
410
+ exports.$ZodStringFormat.init(inst, def);
411
+ inst._zod.onattach.push((inst) => {
412
+ inst._zod.bag.contentEncoding = "base64";
413
+ });
414
+ inst._zod.check = (payload) => {
415
+ if (isValidBase64(payload.value))
416
+ return;
417
+ payload.issues.push({
418
+ code: "invalid_format",
419
+ format: "base64",
420
+ input: payload.value,
421
+ inst,
422
+ continue: !def.abort,
423
+ });
424
+ };
425
+ });
426
+ ////////////////////////////// ZodBase64 //////////////////////////////
427
+ function isValidBase64URL(data) {
428
+ if (!regexes.base64url.test(data))
429
+ return false;
430
+ const base64 = data.replace(/[-_]/g, (c) => (c === "-" ? "+" : "/"));
431
+ const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "=");
432
+ return isValidBase64(padded);
433
+ }
434
+ exports.$ZodBase64URL = core.$constructor("$ZodBase64URL", (inst, def) => {
435
+ def.pattern ?? (def.pattern = regexes.base64url);
436
+ exports.$ZodStringFormat.init(inst, def);
437
+ inst._zod.onattach.push((inst) => {
438
+ inst._zod.bag.contentEncoding = "base64url";
439
+ });
440
+ inst._zod.check = (payload) => {
441
+ if (isValidBase64URL(payload.value))
442
+ return;
443
+ payload.issues.push({
444
+ code: "invalid_format",
445
+ format: "base64url",
446
+ input: payload.value,
447
+ inst,
448
+ continue: !def.abort,
449
+ });
450
+ };
451
+ });
452
+ exports.$ZodE164 = core.$constructor("$ZodE164", (inst, def) => {
453
+ def.pattern ?? (def.pattern = regexes.e164);
454
+ exports.$ZodStringFormat.init(inst, def);
455
+ });
456
+ ////////////////////////////// ZodJWT //////////////////////////////
457
+ function isValidJWT(token, algorithm = null) {
458
+ try {
459
+ const tokensParts = token.split(".");
460
+ if (tokensParts.length !== 3)
461
+ return false;
462
+ const [header] = tokensParts;
463
+ if (!header)
464
+ return false;
465
+ // @ts-ignore
466
+ const parsedHeader = JSON.parse(atob(header));
467
+ if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT")
468
+ return false;
469
+ if (!parsedHeader.alg)
470
+ return false;
471
+ if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm))
472
+ return false;
473
+ return true;
474
+ }
475
+ catch {
476
+ return false;
477
+ }
478
+ }
479
+ exports.$ZodJWT = core.$constructor("$ZodJWT", (inst, def) => {
480
+ exports.$ZodStringFormat.init(inst, def);
481
+ inst._zod.check = (payload) => {
482
+ if (isValidJWT(payload.value, def.alg))
483
+ return;
484
+ payload.issues.push({
485
+ code: "invalid_format",
486
+ format: "jwt",
487
+ input: payload.value,
488
+ inst,
489
+ continue: !def.abort,
490
+ });
491
+ };
492
+ });
493
+ exports.$ZodCustomStringFormat = core.$constructor("$ZodCustomStringFormat", (inst, def) => {
494
+ exports.$ZodStringFormat.init(inst, def);
495
+ inst._zod.check = (payload) => {
496
+ if (def.fn(payload.value))
497
+ return;
498
+ payload.issues.push({
499
+ code: "invalid_format",
500
+ format: def.format,
501
+ input: payload.value,
502
+ inst,
503
+ continue: !def.abort,
504
+ });
505
+ };
506
+ });
507
+ exports.$ZodNumber = core.$constructor("$ZodNumber", (inst, def) => {
508
+ exports.$ZodType.init(inst, def);
509
+ inst._zod.pattern = inst._zod.bag.pattern ?? regexes.number;
510
+ inst._zod.parse = (payload, _ctx) => {
511
+ if (def.coerce)
512
+ try {
513
+ payload.value = Number(payload.value);
514
+ }
515
+ catch (_) { }
516
+ const input = payload.value;
517
+ if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) {
518
+ return payload;
519
+ }
520
+ const received = typeof input === "number"
521
+ ? Number.isNaN(input)
522
+ ? "NaN"
523
+ : !Number.isFinite(input)
524
+ ? "Infinity"
525
+ : undefined
526
+ : undefined;
527
+ payload.issues.push({
528
+ expected: "number",
529
+ code: "invalid_type",
530
+ input,
531
+ inst,
532
+ ...(received ? { received } : {}),
533
+ });
534
+ return payload;
535
+ };
536
+ });
537
+ exports.$ZodNumberFormat = core.$constructor("$ZodNumber", (inst, def) => {
538
+ checks.$ZodCheckNumberFormat.init(inst, def);
539
+ exports.$ZodNumber.init(inst, def); // no format checksp
540
+ });
541
+ exports.$ZodBoolean = core.$constructor("$ZodBoolean", (inst, def) => {
542
+ exports.$ZodType.init(inst, def);
543
+ inst._zod.pattern = regexes.boolean;
544
+ inst._zod.parse = (payload, _ctx) => {
545
+ if (def.coerce)
546
+ try {
547
+ payload.value = Boolean(payload.value);
548
+ }
549
+ catch (_) { }
550
+ const input = payload.value;
551
+ if (typeof input === "boolean")
552
+ return payload;
553
+ payload.issues.push({
554
+ expected: "boolean",
555
+ code: "invalid_type",
556
+ input,
557
+ inst,
558
+ });
559
+ return payload;
560
+ };
561
+ });
562
+ exports.$ZodBigInt = core.$constructor("$ZodBigInt", (inst, def) => {
563
+ exports.$ZodType.init(inst, def);
564
+ inst._zod.pattern = regexes.bigint;
565
+ inst._zod.parse = (payload, _ctx) => {
566
+ if (def.coerce)
567
+ try {
568
+ payload.value = BigInt(payload.value);
569
+ }
570
+ catch (_) { }
571
+ if (typeof payload.value === "bigint")
572
+ return payload;
573
+ payload.issues.push({
574
+ expected: "bigint",
575
+ code: "invalid_type",
576
+ input: payload.value,
577
+ inst,
578
+ });
579
+ return payload;
580
+ };
581
+ });
582
+ exports.$ZodBigIntFormat = core.$constructor("$ZodBigInt", (inst, def) => {
583
+ checks.$ZodCheckBigIntFormat.init(inst, def);
584
+ exports.$ZodBigInt.init(inst, def); // no format checks
585
+ });
586
+ exports.$ZodSymbol = core.$constructor("$ZodSymbol", (inst, def) => {
587
+ exports.$ZodType.init(inst, def);
588
+ inst._zod.parse = (payload, _ctx) => {
589
+ const input = payload.value;
590
+ if (typeof input === "symbol")
591
+ return payload;
592
+ payload.issues.push({
593
+ expected: "symbol",
594
+ code: "invalid_type",
595
+ input,
596
+ inst,
597
+ });
598
+ return payload;
599
+ };
600
+ });
601
+ exports.$ZodUndefined = core.$constructor("$ZodUndefined", (inst, def) => {
602
+ exports.$ZodType.init(inst, def);
603
+ inst._zod.pattern = regexes.undefined;
604
+ inst._zod.values = new Set([undefined]);
605
+ inst._zod.optin = "optional";
606
+ inst._zod.optout = "optional";
607
+ inst._zod.parse = (payload, _ctx) => {
608
+ const input = payload.value;
609
+ if (typeof input === "undefined")
610
+ return payload;
611
+ payload.issues.push({
612
+ expected: "undefined",
613
+ code: "invalid_type",
614
+ input,
615
+ inst,
616
+ });
617
+ return payload;
618
+ };
619
+ });
620
+ exports.$ZodNull = core.$constructor("$ZodNull", (inst, def) => {
621
+ exports.$ZodType.init(inst, def);
622
+ inst._zod.pattern = regexes.null;
623
+ inst._zod.values = new Set([null]);
624
+ inst._zod.parse = (payload, _ctx) => {
625
+ const input = payload.value;
626
+ if (input === null)
627
+ return payload;
628
+ payload.issues.push({
629
+ expected: "null",
630
+ code: "invalid_type",
631
+ input,
632
+ inst,
633
+ });
634
+ return payload;
635
+ };
636
+ });
637
+ exports.$ZodAny = core.$constructor("$ZodAny", (inst, def) => {
638
+ exports.$ZodType.init(inst, def);
639
+ inst._zod.parse = (payload) => payload;
640
+ });
641
+ exports.$ZodUnknown = core.$constructor("$ZodUnknown", (inst, def) => {
642
+ exports.$ZodType.init(inst, def);
643
+ inst._zod.parse = (payload) => payload;
644
+ });
645
+ exports.$ZodNever = core.$constructor("$ZodNever", (inst, def) => {
646
+ exports.$ZodType.init(inst, def);
647
+ inst._zod.parse = (payload, _ctx) => {
648
+ payload.issues.push({
649
+ expected: "never",
650
+ code: "invalid_type",
651
+ input: payload.value,
652
+ inst,
653
+ });
654
+ return payload;
655
+ };
656
+ });
657
+ exports.$ZodVoid = core.$constructor("$ZodVoid", (inst, def) => {
658
+ exports.$ZodType.init(inst, def);
659
+ inst._zod.parse = (payload, _ctx) => {
660
+ const input = payload.value;
661
+ if (typeof input === "undefined")
662
+ return payload;
663
+ payload.issues.push({
664
+ expected: "void",
665
+ code: "invalid_type",
666
+ input,
667
+ inst,
668
+ });
669
+ return payload;
670
+ };
671
+ });
672
+ exports.$ZodDate = core.$constructor("$ZodDate", (inst, def) => {
673
+ exports.$ZodType.init(inst, def);
674
+ inst._zod.parse = (payload, _ctx) => {
675
+ if (def.coerce) {
676
+ try {
677
+ payload.value = new Date(payload.value);
678
+ }
679
+ catch (_err) { }
680
+ }
681
+ const input = payload.value;
682
+ const isDate = input instanceof Date;
683
+ const isValidDate = isDate && !Number.isNaN(input.getTime());
684
+ if (isValidDate)
685
+ return payload;
686
+ payload.issues.push({
687
+ expected: "date",
688
+ code: "invalid_type",
689
+ input,
690
+ ...(isDate ? { received: "Invalid Date" } : {}),
691
+ inst,
692
+ });
693
+ return payload;
694
+ };
695
+ });
696
+ function handleArrayResult(result, final, index) {
697
+ if (result.issues.length) {
698
+ final.issues.push(...util.prefixIssues(index, result.issues));
699
+ }
700
+ final.value[index] = result.value;
701
+ }
702
+ exports.$ZodArray = core.$constructor("$ZodArray", (inst, def) => {
703
+ exports.$ZodType.init(inst, def);
704
+ inst._zod.parse = (payload, ctx) => {
705
+ const input = payload.value;
706
+ if (!Array.isArray(input)) {
707
+ payload.issues.push({
708
+ expected: "array",
709
+ code: "invalid_type",
710
+ input,
711
+ inst,
712
+ });
713
+ return payload;
714
+ }
715
+ payload.value = Array(input.length);
716
+ const proms = [];
717
+ for (let i = 0; i < input.length; i++) {
718
+ const item = input[i];
719
+ const result = def.element._zod.run({
720
+ value: item,
721
+ issues: [],
722
+ }, ctx);
723
+ if (result instanceof Promise) {
724
+ proms.push(result.then((result) => handleArrayResult(result, payload, i)));
725
+ }
726
+ else {
727
+ handleArrayResult(result, payload, i);
728
+ }
729
+ }
730
+ if (proms.length) {
731
+ return Promise.all(proms).then(() => payload);
732
+ }
733
+ return payload; //handleArrayResultsAsync(parseResults, final);
734
+ };
735
+ });
736
+ function handlePropertyResult(result, final, key, input) {
737
+ if (result.issues.length) {
738
+ final.issues.push(...util.prefixIssues(key, result.issues));
739
+ }
740
+ if (result.value === undefined) {
741
+ if (key in input) {
742
+ final.value[key] = undefined;
743
+ }
744
+ }
745
+ else {
746
+ final.value[key] = result.value;
747
+ }
748
+ }
749
+ function normalizeDef(def) {
750
+ const keys = Object.keys(def.shape);
751
+ for (const k of keys) {
752
+ if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) {
753
+ throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
754
+ }
755
+ }
756
+ const okeys = util.optionalKeys(def.shape);
757
+ return {
758
+ ...def,
759
+ keys,
760
+ keySet: new Set(keys),
761
+ numKeys: keys.length,
762
+ optionalKeys: new Set(okeys),
763
+ };
764
+ }
765
+ function handleCatchall(proms, input, payload, ctx, def, inst) {
766
+ const unrecognized = [];
767
+ // iterate over input keys
768
+ const keySet = def.keySet;
769
+ const _catchall = def.catchall._zod;
770
+ const t = _catchall.def.type;
771
+ for (const key of Object.keys(input)) {
772
+ if (keySet.has(key))
773
+ continue;
774
+ if (t === "never") {
775
+ unrecognized.push(key);
776
+ continue;
777
+ }
778
+ const r = _catchall.run({ value: input[key], issues: [] }, ctx);
779
+ if (r instanceof Promise) {
780
+ proms.push(r.then((r) => handlePropertyResult(r, payload, key, input)));
781
+ }
782
+ else {
783
+ handlePropertyResult(r, payload, key, input);
784
+ }
785
+ }
786
+ if (unrecognized.length) {
787
+ payload.issues.push({
788
+ code: "unrecognized_keys",
789
+ keys: unrecognized,
790
+ input,
791
+ inst,
792
+ });
793
+ }
794
+ if (!proms.length)
795
+ return payload;
796
+ return Promise.all(proms).then(() => {
797
+ return payload;
798
+ });
799
+ }
800
+ exports.$ZodObject = core.$constructor("$ZodObject", (inst, def) => {
801
+ // requires cast because technically $ZodObject doesn't extend
802
+ exports.$ZodType.init(inst, def);
803
+ const _normalized = util.cached(() => normalizeDef(def));
804
+ util.defineLazy(inst._zod, "propValues", () => {
805
+ const shape = def.shape;
806
+ const propValues = {};
807
+ for (const key in shape) {
808
+ const field = shape[key]._zod;
809
+ if (field.values) {
810
+ propValues[key] ?? (propValues[key] = new Set());
811
+ for (const v of field.values)
812
+ propValues[key].add(v);
813
+ }
814
+ }
815
+ return propValues;
816
+ });
817
+ const isObject = util.isObject;
818
+ const catchall = def.catchall;
819
+ let value;
820
+ inst._zod.parse = (payload, ctx) => {
821
+ value ?? (value = _normalized.value);
822
+ const input = payload.value;
823
+ if (!isObject(input)) {
824
+ payload.issues.push({
825
+ expected: "object",
826
+ code: "invalid_type",
827
+ input,
828
+ inst,
829
+ });
830
+ return payload;
831
+ }
832
+ payload.value = {};
833
+ const proms = [];
834
+ const shape = value.shape;
835
+ for (const key of value.keys) {
836
+ const el = shape[key];
837
+ const r = el._zod.run({ value: input[key], issues: [] }, ctx);
838
+ if (r instanceof Promise) {
839
+ proms.push(r.then((r) => handlePropertyResult(r, payload, key, input)));
840
+ }
841
+ else {
842
+ handlePropertyResult(r, payload, key, input);
843
+ }
844
+ }
845
+ if (!catchall) {
846
+ return proms.length ? Promise.all(proms).then(() => payload) : payload;
847
+ }
848
+ return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
849
+ };
850
+ });
851
+ exports.$ZodObjectJIT = core.$constructor("$ZodObjectJIT", (inst, def) => {
852
+ // requires cast because technically $ZodObject doesn't extend
853
+ exports.$ZodObject.init(inst, def);
854
+ const superParse = inst._zod.parse;
855
+ const _normalized = util.cached(() => normalizeDef(def));
856
+ const generateFastpass = (shape) => {
857
+ const doc = new doc_js_1.Doc(["shape", "payload", "ctx"]);
858
+ const normalized = _normalized.value;
859
+ const parseStr = (key) => {
860
+ const k = util.esc(key);
861
+ return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
862
+ };
863
+ doc.write(`const input = payload.value;`);
864
+ const ids = Object.create(null);
865
+ let counter = 0;
866
+ for (const key of normalized.keys) {
867
+ ids[key] = `key_${counter++}`;
868
+ }
869
+ // A: preserve key order {
870
+ doc.write(`const newResult = {};`);
871
+ for (const key of normalized.keys) {
872
+ const id = ids[key];
873
+ const k = util.esc(key);
874
+ doc.write(`const ${id} = ${parseStr(key)};`);
875
+ doc.write(`
876
+ if (${id}.issues.length) {
877
+ payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
878
+ ...iss,
879
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
880
+ })));
881
+ }
882
+
883
+
884
+ if (${id}.value === undefined) {
885
+ if (${k} in input) {
886
+ newResult[${k}] = undefined;
887
+ }
888
+ } else {
889
+ newResult[${k}] = ${id}.value;
890
+ }
891
+
892
+ `);
893
+ }
894
+ doc.write(`payload.value = newResult;`);
895
+ doc.write(`return payload;`);
896
+ const fn = doc.compile();
897
+ return (payload, ctx) => fn(shape, payload, ctx);
898
+ };
899
+ let fastpass;
900
+ const isObject = util.isObject;
901
+ const jit = !core.globalConfig.jitless;
902
+ const allowsEval = util.allowsEval;
903
+ const fastEnabled = jit && allowsEval.value; // && !def.catchall;
904
+ const catchall = def.catchall;
905
+ let value;
906
+ inst._zod.parse = (payload, ctx) => {
907
+ value ?? (value = _normalized.value);
908
+ const input = payload.value;
909
+ if (!isObject(input)) {
910
+ payload.issues.push({
911
+ expected: "object",
912
+ code: "invalid_type",
913
+ input,
914
+ inst,
915
+ });
916
+ return payload;
917
+ }
918
+ if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {
919
+ // always synchronous
920
+ if (!fastpass)
921
+ fastpass = generateFastpass(def.shape);
922
+ payload = fastpass(payload, ctx);
923
+ if (!catchall)
924
+ return payload;
925
+ return handleCatchall([], input, payload, ctx, value, inst);
926
+ }
927
+ return superParse(payload, ctx);
928
+ };
929
+ });
930
+ function handleUnionResults(results, final, inst, ctx) {
931
+ for (const result of results) {
932
+ if (result.issues.length === 0) {
933
+ final.value = result.value;
934
+ return final;
935
+ }
936
+ }
937
+ const nonaborted = results.filter((r) => !util.aborted(r));
938
+ if (nonaborted.length === 1) {
939
+ final.value = nonaborted[0].value;
940
+ return nonaborted[0];
941
+ }
942
+ final.issues.push({
943
+ code: "invalid_union",
944
+ input: final.value,
945
+ inst,
946
+ errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
947
+ });
948
+ return final;
949
+ }
950
+ exports.$ZodUnion = core.$constructor("$ZodUnion", (inst, def) => {
951
+ exports.$ZodType.init(inst, def);
952
+ util.defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : undefined);
953
+ util.defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : undefined);
954
+ util.defineLazy(inst._zod, "values", () => {
955
+ if (def.options.every((o) => o._zod.values)) {
956
+ return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
957
+ }
958
+ return undefined;
959
+ });
960
+ util.defineLazy(inst._zod, "pattern", () => {
961
+ if (def.options.every((o) => o._zod.pattern)) {
962
+ const patterns = def.options.map((o) => o._zod.pattern);
963
+ return new RegExp(`^(${patterns.map((p) => util.cleanRegex(p.source)).join("|")})$`);
964
+ }
965
+ return undefined;
966
+ });
967
+ const single = def.options.length === 1;
968
+ const first = def.options[0]._zod.run;
969
+ inst._zod.parse = (payload, ctx) => {
970
+ if (single) {
971
+ return first(payload, ctx);
972
+ }
973
+ let async = false;
974
+ const results = [];
975
+ for (const option of def.options) {
976
+ const result = option._zod.run({
977
+ value: payload.value,
978
+ issues: [],
979
+ }, ctx);
980
+ if (result instanceof Promise) {
981
+ results.push(result);
982
+ async = true;
983
+ }
984
+ else {
985
+ if (result.issues.length === 0)
986
+ return result;
987
+ results.push(result);
988
+ }
989
+ }
990
+ if (!async)
991
+ return handleUnionResults(results, payload, inst, ctx);
992
+ return Promise.all(results).then((results) => {
993
+ return handleUnionResults(results, payload, inst, ctx);
994
+ });
995
+ };
996
+ });
997
+ exports.$ZodDiscriminatedUnion =
998
+ /*@__PURE__*/
999
+ core.$constructor("$ZodDiscriminatedUnion", (inst, def) => {
1000
+ exports.$ZodUnion.init(inst, def);
1001
+ const _super = inst._zod.parse;
1002
+ util.defineLazy(inst._zod, "propValues", () => {
1003
+ const propValues = {};
1004
+ for (const option of def.options) {
1005
+ const pv = option._zod.propValues;
1006
+ if (!pv || Object.keys(pv).length === 0)
1007
+ throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
1008
+ for (const [k, v] of Object.entries(pv)) {
1009
+ if (!propValues[k])
1010
+ propValues[k] = new Set();
1011
+ for (const val of v) {
1012
+ propValues[k].add(val);
1013
+ }
1014
+ }
1015
+ }
1016
+ return propValues;
1017
+ });
1018
+ const disc = util.cached(() => {
1019
+ const opts = def.options;
1020
+ const map = new Map();
1021
+ for (const o of opts) {
1022
+ const values = o._zod.propValues?.[def.discriminator];
1023
+ if (!values || values.size === 0)
1024
+ throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
1025
+ for (const v of values) {
1026
+ if (map.has(v)) {
1027
+ throw new Error(`Duplicate discriminator value "${String(v)}"`);
1028
+ }
1029
+ map.set(v, o);
1030
+ }
1031
+ }
1032
+ return map;
1033
+ });
1034
+ inst._zod.parse = (payload, ctx) => {
1035
+ const input = payload.value;
1036
+ if (!util.isObject(input)) {
1037
+ payload.issues.push({
1038
+ code: "invalid_type",
1039
+ expected: "object",
1040
+ input,
1041
+ inst,
1042
+ });
1043
+ return payload;
1044
+ }
1045
+ const opt = disc.value.get(input?.[def.discriminator]);
1046
+ if (opt) {
1047
+ return opt._zod.run(payload, ctx);
1048
+ }
1049
+ if (def.unionFallback) {
1050
+ return _super(payload, ctx);
1051
+ }
1052
+ // no matching discriminator
1053
+ payload.issues.push({
1054
+ code: "invalid_union",
1055
+ errors: [],
1056
+ note: "No matching discriminator",
1057
+ discriminator: def.discriminator,
1058
+ input,
1059
+ path: [def.discriminator],
1060
+ inst,
1061
+ });
1062
+ return payload;
1063
+ };
1064
+ });
1065
+ exports.$ZodIntersection = core.$constructor("$ZodIntersection", (inst, def) => {
1066
+ exports.$ZodType.init(inst, def);
1067
+ inst._zod.parse = (payload, ctx) => {
1068
+ const input = payload.value;
1069
+ const left = def.left._zod.run({ value: input, issues: [] }, ctx);
1070
+ const right = def.right._zod.run({ value: input, issues: [] }, ctx);
1071
+ const async = left instanceof Promise || right instanceof Promise;
1072
+ if (async) {
1073
+ return Promise.all([left, right]).then(([left, right]) => {
1074
+ return handleIntersectionResults(payload, left, right);
1075
+ });
1076
+ }
1077
+ return handleIntersectionResults(payload, left, right);
1078
+ };
1079
+ });
1080
+ function mergeValues(a, b) {
1081
+ // const aType = parse.t(a);
1082
+ // const bType = parse.t(b);
1083
+ if (a === b) {
1084
+ return { valid: true, data: a };
1085
+ }
1086
+ if (a instanceof Date && b instanceof Date && +a === +b) {
1087
+ return { valid: true, data: a };
1088
+ }
1089
+ if (util.isPlainObject(a) && util.isPlainObject(b)) {
1090
+ const bKeys = Object.keys(b);
1091
+ const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
1092
+ const newObj = { ...a, ...b };
1093
+ for (const key of sharedKeys) {
1094
+ const sharedValue = mergeValues(a[key], b[key]);
1095
+ if (!sharedValue.valid) {
1096
+ return {
1097
+ valid: false,
1098
+ mergeErrorPath: [key, ...sharedValue.mergeErrorPath],
1099
+ };
1100
+ }
1101
+ newObj[key] = sharedValue.data;
1102
+ }
1103
+ return { valid: true, data: newObj };
1104
+ }
1105
+ if (Array.isArray(a) && Array.isArray(b)) {
1106
+ if (a.length !== b.length) {
1107
+ return { valid: false, mergeErrorPath: [] };
1108
+ }
1109
+ const newArray = [];
1110
+ for (let index = 0; index < a.length; index++) {
1111
+ const itemA = a[index];
1112
+ const itemB = b[index];
1113
+ const sharedValue = mergeValues(itemA, itemB);
1114
+ if (!sharedValue.valid) {
1115
+ return {
1116
+ valid: false,
1117
+ mergeErrorPath: [index, ...sharedValue.mergeErrorPath],
1118
+ };
1119
+ }
1120
+ newArray.push(sharedValue.data);
1121
+ }
1122
+ return { valid: true, data: newArray };
1123
+ }
1124
+ return { valid: false, mergeErrorPath: [] };
1125
+ }
1126
+ function handleIntersectionResults(result, left, right) {
1127
+ if (left.issues.length) {
1128
+ result.issues.push(...left.issues);
1129
+ }
1130
+ if (right.issues.length) {
1131
+ result.issues.push(...right.issues);
1132
+ }
1133
+ if (util.aborted(result))
1134
+ return result;
1135
+ const merged = mergeValues(left.value, right.value);
1136
+ if (!merged.valid) {
1137
+ throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);
1138
+ }
1139
+ result.value = merged.data;
1140
+ return result;
1141
+ }
1142
+ exports.$ZodTuple = core.$constructor("$ZodTuple", (inst, def) => {
1143
+ exports.$ZodType.init(inst, def);
1144
+ const items = def.items;
1145
+ const optStart = items.length - [...items].reverse().findIndex((item) => item._zod.optin !== "optional");
1146
+ inst._zod.parse = (payload, ctx) => {
1147
+ const input = payload.value;
1148
+ if (!Array.isArray(input)) {
1149
+ payload.issues.push({
1150
+ input,
1151
+ inst,
1152
+ expected: "tuple",
1153
+ code: "invalid_type",
1154
+ });
1155
+ return payload;
1156
+ }
1157
+ payload.value = [];
1158
+ const proms = [];
1159
+ if (!def.rest) {
1160
+ const tooBig = input.length > items.length;
1161
+ const tooSmall = input.length < optStart - 1;
1162
+ if (tooBig || tooSmall) {
1163
+ payload.issues.push({
1164
+ ...(tooBig ? { code: "too_big", maximum: items.length } : { code: "too_small", minimum: items.length }),
1165
+ input,
1166
+ inst,
1167
+ origin: "array",
1168
+ });
1169
+ return payload;
1170
+ }
1171
+ }
1172
+ let i = -1;
1173
+ for (const item of items) {
1174
+ i++;
1175
+ if (i >= input.length)
1176
+ if (i >= optStart)
1177
+ continue;
1178
+ const result = item._zod.run({
1179
+ value: input[i],
1180
+ issues: [],
1181
+ }, ctx);
1182
+ if (result instanceof Promise) {
1183
+ proms.push(result.then((result) => handleTupleResult(result, payload, i)));
1184
+ }
1185
+ else {
1186
+ handleTupleResult(result, payload, i);
1187
+ }
1188
+ }
1189
+ if (def.rest) {
1190
+ const rest = input.slice(items.length);
1191
+ for (const el of rest) {
1192
+ i++;
1193
+ const result = def.rest._zod.run({
1194
+ value: el,
1195
+ issues: [],
1196
+ }, ctx);
1197
+ if (result instanceof Promise) {
1198
+ proms.push(result.then((result) => handleTupleResult(result, payload, i)));
1199
+ }
1200
+ else {
1201
+ handleTupleResult(result, payload, i);
1202
+ }
1203
+ }
1204
+ }
1205
+ if (proms.length)
1206
+ return Promise.all(proms).then(() => payload);
1207
+ return payload;
1208
+ };
1209
+ });
1210
+ function handleTupleResult(result, final, index) {
1211
+ if (result.issues.length) {
1212
+ final.issues.push(...util.prefixIssues(index, result.issues));
1213
+ }
1214
+ final.value[index] = result.value;
1215
+ }
1216
+ exports.$ZodRecord = core.$constructor("$ZodRecord", (inst, def) => {
1217
+ exports.$ZodType.init(inst, def);
1218
+ inst._zod.parse = (payload, ctx) => {
1219
+ const input = payload.value;
1220
+ if (!util.isPlainObject(input)) {
1221
+ payload.issues.push({
1222
+ expected: "record",
1223
+ code: "invalid_type",
1224
+ input,
1225
+ inst,
1226
+ });
1227
+ return payload;
1228
+ }
1229
+ const proms = [];
1230
+ if (def.keyType._zod.values) {
1231
+ const values = def.keyType._zod.values;
1232
+ payload.value = {};
1233
+ for (const key of values) {
1234
+ if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
1235
+ const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
1236
+ if (result instanceof Promise) {
1237
+ proms.push(result.then((result) => {
1238
+ if (result.issues.length) {
1239
+ payload.issues.push(...util.prefixIssues(key, result.issues));
1240
+ }
1241
+ payload.value[key] = result.value;
1242
+ }));
1243
+ }
1244
+ else {
1245
+ if (result.issues.length) {
1246
+ payload.issues.push(...util.prefixIssues(key, result.issues));
1247
+ }
1248
+ payload.value[key] = result.value;
1249
+ }
1250
+ }
1251
+ }
1252
+ let unrecognized;
1253
+ for (const key in input) {
1254
+ if (!values.has(key)) {
1255
+ unrecognized = unrecognized ?? [];
1256
+ unrecognized.push(key);
1257
+ }
1258
+ }
1259
+ if (unrecognized && unrecognized.length > 0) {
1260
+ payload.issues.push({
1261
+ code: "unrecognized_keys",
1262
+ input,
1263
+ inst,
1264
+ keys: unrecognized,
1265
+ });
1266
+ }
1267
+ }
1268
+ else {
1269
+ payload.value = {};
1270
+ for (const key of Reflect.ownKeys(input)) {
1271
+ if (key === "__proto__")
1272
+ continue;
1273
+ const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
1274
+ if (keyResult instanceof Promise) {
1275
+ throw new Error("Async schemas not supported in object keys currently");
1276
+ }
1277
+ if (keyResult.issues.length) {
1278
+ payload.issues.push({
1279
+ code: "invalid_key",
1280
+ origin: "record",
1281
+ issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1282
+ input: key,
1283
+ path: [key],
1284
+ inst,
1285
+ });
1286
+ payload.value[keyResult.value] = keyResult.value;
1287
+ continue;
1288
+ }
1289
+ const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
1290
+ if (result instanceof Promise) {
1291
+ proms.push(result.then((result) => {
1292
+ if (result.issues.length) {
1293
+ payload.issues.push(...util.prefixIssues(key, result.issues));
1294
+ }
1295
+ payload.value[keyResult.value] = result.value;
1296
+ }));
1297
+ }
1298
+ else {
1299
+ if (result.issues.length) {
1300
+ payload.issues.push(...util.prefixIssues(key, result.issues));
1301
+ }
1302
+ payload.value[keyResult.value] = result.value;
1303
+ }
1304
+ }
1305
+ }
1306
+ if (proms.length) {
1307
+ return Promise.all(proms).then(() => payload);
1308
+ }
1309
+ return payload;
1310
+ };
1311
+ });
1312
+ exports.$ZodMap = core.$constructor("$ZodMap", (inst, def) => {
1313
+ exports.$ZodType.init(inst, def);
1314
+ inst._zod.parse = (payload, ctx) => {
1315
+ const input = payload.value;
1316
+ if (!(input instanceof Map)) {
1317
+ payload.issues.push({
1318
+ expected: "map",
1319
+ code: "invalid_type",
1320
+ input,
1321
+ inst,
1322
+ });
1323
+ return payload;
1324
+ }
1325
+ const proms = [];
1326
+ payload.value = new Map();
1327
+ for (const [key, value] of input) {
1328
+ const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
1329
+ const valueResult = def.valueType._zod.run({ value: value, issues: [] }, ctx);
1330
+ if (keyResult instanceof Promise || valueResult instanceof Promise) {
1331
+ proms.push(Promise.all([keyResult, valueResult]).then(([keyResult, valueResult]) => {
1332
+ handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
1333
+ }));
1334
+ }
1335
+ else {
1336
+ handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
1337
+ }
1338
+ }
1339
+ if (proms.length)
1340
+ return Promise.all(proms).then(() => payload);
1341
+ return payload;
1342
+ };
1343
+ });
1344
+ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
1345
+ if (keyResult.issues.length) {
1346
+ if (util.propertyKeyTypes.has(typeof key)) {
1347
+ final.issues.push(...util.prefixIssues(key, keyResult.issues));
1348
+ }
1349
+ else {
1350
+ final.issues.push({
1351
+ code: "invalid_key",
1352
+ origin: "map",
1353
+ input,
1354
+ inst,
1355
+ issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1356
+ });
1357
+ }
1358
+ }
1359
+ if (valueResult.issues.length) {
1360
+ if (util.propertyKeyTypes.has(typeof key)) {
1361
+ final.issues.push(...util.prefixIssues(key, valueResult.issues));
1362
+ }
1363
+ else {
1364
+ final.issues.push({
1365
+ origin: "map",
1366
+ code: "invalid_element",
1367
+ input,
1368
+ inst,
1369
+ key: key,
1370
+ issues: valueResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1371
+ });
1372
+ }
1373
+ }
1374
+ final.value.set(keyResult.value, valueResult.value);
1375
+ }
1376
+ exports.$ZodSet = core.$constructor("$ZodSet", (inst, def) => {
1377
+ exports.$ZodType.init(inst, def);
1378
+ inst._zod.parse = (payload, ctx) => {
1379
+ const input = payload.value;
1380
+ if (!(input instanceof Set)) {
1381
+ payload.issues.push({
1382
+ input,
1383
+ inst,
1384
+ expected: "set",
1385
+ code: "invalid_type",
1386
+ });
1387
+ return payload;
1388
+ }
1389
+ const proms = [];
1390
+ payload.value = new Set();
1391
+ for (const item of input) {
1392
+ const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
1393
+ if (result instanceof Promise) {
1394
+ proms.push(result.then((result) => handleSetResult(result, payload)));
1395
+ }
1396
+ else
1397
+ handleSetResult(result, payload);
1398
+ }
1399
+ if (proms.length)
1400
+ return Promise.all(proms).then(() => payload);
1401
+ return payload;
1402
+ };
1403
+ });
1404
+ function handleSetResult(result, final) {
1405
+ if (result.issues.length) {
1406
+ final.issues.push(...result.issues);
1407
+ }
1408
+ final.value.add(result.value);
1409
+ }
1410
+ exports.$ZodEnum = core.$constructor("$ZodEnum", (inst, def) => {
1411
+ exports.$ZodType.init(inst, def);
1412
+ const values = util.getEnumValues(def.entries);
1413
+ const valuesSet = new Set(values);
1414
+ inst._zod.values = valuesSet;
1415
+ inst._zod.pattern = new RegExp(`^(${values
1416
+ .filter((k) => util.propertyKeyTypes.has(typeof k))
1417
+ .map((o) => (typeof o === "string" ? util.escapeRegex(o) : o.toString()))
1418
+ .join("|")})$`);
1419
+ inst._zod.parse = (payload, _ctx) => {
1420
+ const input = payload.value;
1421
+ if (valuesSet.has(input)) {
1422
+ return payload;
1423
+ }
1424
+ payload.issues.push({
1425
+ code: "invalid_value",
1426
+ values,
1427
+ input,
1428
+ inst,
1429
+ });
1430
+ return payload;
1431
+ };
1432
+ });
1433
+ exports.$ZodLiteral = core.$constructor("$ZodLiteral", (inst, def) => {
1434
+ exports.$ZodType.init(inst, def);
1435
+ if (def.values.length === 0) {
1436
+ throw new Error("Cannot create literal schema with no valid values");
1437
+ }
1438
+ inst._zod.values = new Set(def.values);
1439
+ inst._zod.pattern = new RegExp(`^(${def.values
1440
+ .map((o) => (typeof o === "string" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o)))
1441
+ .join("|")})$`);
1442
+ inst._zod.parse = (payload, _ctx) => {
1443
+ const input = payload.value;
1444
+ if (inst._zod.values.has(input)) {
1445
+ return payload;
1446
+ }
1447
+ payload.issues.push({
1448
+ code: "invalid_value",
1449
+ values: def.values,
1450
+ input,
1451
+ inst,
1452
+ });
1453
+ return payload;
1454
+ };
1455
+ });
1456
+ exports.$ZodFile = core.$constructor("$ZodFile", (inst, def) => {
1457
+ exports.$ZodType.init(inst, def);
1458
+ inst._zod.parse = (payload, _ctx) => {
1459
+ const input = payload.value;
1460
+ // @ts-ignore
1461
+ if (input instanceof File)
1462
+ return payload;
1463
+ payload.issues.push({
1464
+ expected: "file",
1465
+ code: "invalid_type",
1466
+ input,
1467
+ inst,
1468
+ });
1469
+ return payload;
1470
+ };
1471
+ });
1472
+ exports.$ZodTransform = core.$constructor("$ZodTransform", (inst, def) => {
1473
+ exports.$ZodType.init(inst, def);
1474
+ inst._zod.parse = (payload, ctx) => {
1475
+ if (ctx.direction === "backward") {
1476
+ throw new core.$ZodEncodeError(inst.constructor.name);
1477
+ }
1478
+ const _out = def.transform(payload.value, payload);
1479
+ if (ctx.async) {
1480
+ const output = _out instanceof Promise ? _out : Promise.resolve(_out);
1481
+ return output.then((output) => {
1482
+ payload.value = output;
1483
+ return payload;
1484
+ });
1485
+ }
1486
+ if (_out instanceof Promise) {
1487
+ throw new core.$ZodAsyncError();
1488
+ }
1489
+ payload.value = _out;
1490
+ return payload;
1491
+ };
1492
+ });
1493
+ function handleOptionalResult(result, input) {
1494
+ if (result.issues.length && input === undefined) {
1495
+ return { issues: [], value: undefined };
1496
+ }
1497
+ return result;
1498
+ }
1499
+ exports.$ZodOptional = core.$constructor("$ZodOptional", (inst, def) => {
1500
+ exports.$ZodType.init(inst, def);
1501
+ inst._zod.optin = "optional";
1502
+ inst._zod.optout = "optional";
1503
+ util.defineLazy(inst._zod, "values", () => {
1504
+ return def.innerType._zod.values ? new Set([...def.innerType._zod.values, undefined]) : undefined;
1505
+ });
1506
+ util.defineLazy(inst._zod, "pattern", () => {
1507
+ const pattern = def.innerType._zod.pattern;
1508
+ return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)})?$`) : undefined;
1509
+ });
1510
+ inst._zod.parse = (payload, ctx) => {
1511
+ if (def.innerType._zod.optin === "optional") {
1512
+ const result = def.innerType._zod.run(payload, ctx);
1513
+ if (result instanceof Promise)
1514
+ return result.then((r) => handleOptionalResult(r, payload.value));
1515
+ return handleOptionalResult(result, payload.value);
1516
+ }
1517
+ if (payload.value === undefined) {
1518
+ return payload;
1519
+ }
1520
+ return def.innerType._zod.run(payload, ctx);
1521
+ };
1522
+ });
1523
+ exports.$ZodNullable = core.$constructor("$ZodNullable", (inst, def) => {
1524
+ exports.$ZodType.init(inst, def);
1525
+ util.defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
1526
+ util.defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
1527
+ util.defineLazy(inst._zod, "pattern", () => {
1528
+ const pattern = def.innerType._zod.pattern;
1529
+ return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)}|null)$`) : undefined;
1530
+ });
1531
+ util.defineLazy(inst._zod, "values", () => {
1532
+ return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : undefined;
1533
+ });
1534
+ inst._zod.parse = (payload, ctx) => {
1535
+ // Forward direction (decode): allow null to pass through
1536
+ if (payload.value === null)
1537
+ return payload;
1538
+ return def.innerType._zod.run(payload, ctx);
1539
+ };
1540
+ });
1541
+ exports.$ZodDefault = core.$constructor("$ZodDefault", (inst, def) => {
1542
+ exports.$ZodType.init(inst, def);
1543
+ // inst._zod.qin = "true";
1544
+ inst._zod.optin = "optional";
1545
+ util.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1546
+ inst._zod.parse = (payload, ctx) => {
1547
+ if (ctx.direction === "backward") {
1548
+ return def.innerType._zod.run(payload, ctx);
1549
+ }
1550
+ // Forward direction (decode): apply defaults for undefined input
1551
+ if (payload.value === undefined) {
1552
+ payload.value = def.defaultValue;
1553
+ /**
1554
+ * $ZodDefault returns the default value immediately in forward direction.
1555
+ * It doesn't pass the default value into the validator ("prefault"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a "prefault" for the pipe. */
1556
+ return payload;
1557
+ }
1558
+ // Forward direction: continue with default handling
1559
+ const result = def.innerType._zod.run(payload, ctx);
1560
+ if (result instanceof Promise) {
1561
+ return result.then((result) => handleDefaultResult(result, def));
1562
+ }
1563
+ return handleDefaultResult(result, def);
1564
+ };
1565
+ });
1566
+ function handleDefaultResult(payload, def) {
1567
+ if (payload.value === undefined) {
1568
+ payload.value = def.defaultValue;
1569
+ }
1570
+ return payload;
1571
+ }
1572
+ exports.$ZodPrefault = core.$constructor("$ZodPrefault", (inst, def) => {
1573
+ exports.$ZodType.init(inst, def);
1574
+ inst._zod.optin = "optional";
1575
+ util.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1576
+ inst._zod.parse = (payload, ctx) => {
1577
+ if (ctx.direction === "backward") {
1578
+ return def.innerType._zod.run(payload, ctx);
1579
+ }
1580
+ // Forward direction (decode): apply prefault for undefined input
1581
+ if (payload.value === undefined) {
1582
+ payload.value = def.defaultValue;
1583
+ }
1584
+ return def.innerType._zod.run(payload, ctx);
1585
+ };
1586
+ });
1587
+ exports.$ZodNonOptional = core.$constructor("$ZodNonOptional", (inst, def) => {
1588
+ exports.$ZodType.init(inst, def);
1589
+ util.defineLazy(inst._zod, "values", () => {
1590
+ const v = def.innerType._zod.values;
1591
+ return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;
1592
+ });
1593
+ inst._zod.parse = (payload, ctx) => {
1594
+ const result = def.innerType._zod.run(payload, ctx);
1595
+ if (result instanceof Promise) {
1596
+ return result.then((result) => handleNonOptionalResult(result, inst));
1597
+ }
1598
+ return handleNonOptionalResult(result, inst);
1599
+ };
1600
+ });
1601
+ function handleNonOptionalResult(payload, inst) {
1602
+ if (!payload.issues.length && payload.value === undefined) {
1603
+ payload.issues.push({
1604
+ code: "invalid_type",
1605
+ expected: "nonoptional",
1606
+ input: payload.value,
1607
+ inst,
1608
+ });
1609
+ }
1610
+ return payload;
1611
+ }
1612
+ exports.$ZodSuccess = core.$constructor("$ZodSuccess", (inst, def) => {
1613
+ exports.$ZodType.init(inst, def);
1614
+ inst._zod.parse = (payload, ctx) => {
1615
+ if (ctx.direction === "backward") {
1616
+ throw new core.$ZodEncodeError("ZodSuccess");
1617
+ }
1618
+ const result = def.innerType._zod.run(payload, ctx);
1619
+ if (result instanceof Promise) {
1620
+ return result.then((result) => {
1621
+ payload.value = result.issues.length === 0;
1622
+ return payload;
1623
+ });
1624
+ }
1625
+ payload.value = result.issues.length === 0;
1626
+ return payload;
1627
+ };
1628
+ });
1629
+ exports.$ZodCatch = core.$constructor("$ZodCatch", (inst, def) => {
1630
+ exports.$ZodType.init(inst, def);
1631
+ util.defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
1632
+ util.defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
1633
+ util.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1634
+ inst._zod.parse = (payload, ctx) => {
1635
+ if (ctx.direction === "backward") {
1636
+ return def.innerType._zod.run(payload, ctx);
1637
+ }
1638
+ // Forward direction (decode): apply catch logic
1639
+ const result = def.innerType._zod.run(payload, ctx);
1640
+ if (result instanceof Promise) {
1641
+ return result.then((result) => {
1642
+ payload.value = result.value;
1643
+ if (result.issues.length) {
1644
+ payload.value = def.catchValue({
1645
+ ...payload,
1646
+ error: {
1647
+ issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1648
+ },
1649
+ input: payload.value,
1650
+ });
1651
+ payload.issues = [];
1652
+ }
1653
+ return payload;
1654
+ });
1655
+ }
1656
+ payload.value = result.value;
1657
+ if (result.issues.length) {
1658
+ payload.value = def.catchValue({
1659
+ ...payload,
1660
+ error: {
1661
+ issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1662
+ },
1663
+ input: payload.value,
1664
+ });
1665
+ payload.issues = [];
1666
+ }
1667
+ return payload;
1668
+ };
1669
+ });
1670
+ exports.$ZodNaN = core.$constructor("$ZodNaN", (inst, def) => {
1671
+ exports.$ZodType.init(inst, def);
1672
+ inst._zod.parse = (payload, _ctx) => {
1673
+ if (typeof payload.value !== "number" || !Number.isNaN(payload.value)) {
1674
+ payload.issues.push({
1675
+ input: payload.value,
1676
+ inst,
1677
+ expected: "nan",
1678
+ code: "invalid_type",
1679
+ });
1680
+ return payload;
1681
+ }
1682
+ return payload;
1683
+ };
1684
+ });
1685
+ exports.$ZodPipe = core.$constructor("$ZodPipe", (inst, def) => {
1686
+ exports.$ZodType.init(inst, def);
1687
+ util.defineLazy(inst._zod, "values", () => def.in._zod.values);
1688
+ util.defineLazy(inst._zod, "optin", () => def.in._zod.optin);
1689
+ util.defineLazy(inst._zod, "optout", () => def.out._zod.optout);
1690
+ util.defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
1691
+ inst._zod.parse = (payload, ctx) => {
1692
+ if (ctx.direction === "backward") {
1693
+ const right = def.out._zod.run(payload, ctx);
1694
+ if (right instanceof Promise) {
1695
+ return right.then((right) => handlePipeResult(right, def.in, ctx));
1696
+ }
1697
+ return handlePipeResult(right, def.in, ctx);
1698
+ }
1699
+ const left = def.in._zod.run(payload, ctx);
1700
+ if (left instanceof Promise) {
1701
+ return left.then((left) => handlePipeResult(left, def.out, ctx));
1702
+ }
1703
+ return handlePipeResult(left, def.out, ctx);
1704
+ };
1705
+ });
1706
+ function handlePipeResult(left, next, ctx) {
1707
+ if (left.issues.length) {
1708
+ // prevent further checks
1709
+ left.aborted = true;
1710
+ return left;
1711
+ }
1712
+ return next._zod.run({ value: left.value, issues: left.issues }, ctx);
1713
+ }
1714
+ exports.$ZodCodec = core.$constructor("$ZodCodec", (inst, def) => {
1715
+ exports.$ZodType.init(inst, def);
1716
+ util.defineLazy(inst._zod, "values", () => def.in._zod.values);
1717
+ util.defineLazy(inst._zod, "optin", () => def.in._zod.optin);
1718
+ util.defineLazy(inst._zod, "optout", () => def.out._zod.optout);
1719
+ util.defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
1720
+ inst._zod.parse = (payload, ctx) => {
1721
+ const direction = ctx.direction || "forward";
1722
+ if (direction === "forward") {
1723
+ const left = def.in._zod.run(payload, ctx);
1724
+ if (left instanceof Promise) {
1725
+ return left.then((left) => handleCodecAResult(left, def, ctx));
1726
+ }
1727
+ return handleCodecAResult(left, def, ctx);
1728
+ }
1729
+ else {
1730
+ const right = def.out._zod.run(payload, ctx);
1731
+ if (right instanceof Promise) {
1732
+ return right.then((right) => handleCodecAResult(right, def, ctx));
1733
+ }
1734
+ return handleCodecAResult(right, def, ctx);
1735
+ }
1736
+ };
1737
+ });
1738
+ function handleCodecAResult(result, def, ctx) {
1739
+ if (result.issues.length) {
1740
+ // prevent further checks
1741
+ result.aborted = true;
1742
+ return result;
1743
+ }
1744
+ const direction = ctx.direction || "forward";
1745
+ if (direction === "forward") {
1746
+ const transformed = def.transform(result.value, result);
1747
+ if (transformed instanceof Promise) {
1748
+ return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx));
1749
+ }
1750
+ return handleCodecTxResult(result, transformed, def.out, ctx);
1751
+ }
1752
+ else {
1753
+ const transformed = def.reverseTransform(result.value, result);
1754
+ if (transformed instanceof Promise) {
1755
+ return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx));
1756
+ }
1757
+ return handleCodecTxResult(result, transformed, def.in, ctx);
1758
+ }
1759
+ }
1760
+ function handleCodecTxResult(left, value, nextSchema, ctx) {
1761
+ // Check if transform added any issues
1762
+ if (left.issues.length) {
1763
+ left.aborted = true;
1764
+ return left;
1765
+ }
1766
+ return nextSchema._zod.run({ value, issues: left.issues }, ctx);
1767
+ }
1768
+ exports.$ZodReadonly = core.$constructor("$ZodReadonly", (inst, def) => {
1769
+ exports.$ZodType.init(inst, def);
1770
+ util.defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
1771
+ util.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1772
+ util.defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
1773
+ util.defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
1774
+ inst._zod.parse = (payload, ctx) => {
1775
+ if (ctx.direction === "backward") {
1776
+ return def.innerType._zod.run(payload, ctx);
1777
+ }
1778
+ const result = def.innerType._zod.run(payload, ctx);
1779
+ if (result instanceof Promise) {
1780
+ return result.then(handleReadonlyResult);
1781
+ }
1782
+ return handleReadonlyResult(result);
1783
+ };
1784
+ });
1785
+ function handleReadonlyResult(payload) {
1786
+ payload.value = Object.freeze(payload.value);
1787
+ return payload;
1788
+ }
1789
+ exports.$ZodTemplateLiteral = core.$constructor("$ZodTemplateLiteral", (inst, def) => {
1790
+ exports.$ZodType.init(inst, def);
1791
+ const regexParts = [];
1792
+ for (const part of def.parts) {
1793
+ if (typeof part === "object" && part !== null) {
1794
+ // is Zod schema
1795
+ if (!part._zod.pattern) {
1796
+ // if (!source)
1797
+ throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
1798
+ }
1799
+ const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;
1800
+ if (!source)
1801
+ throw new Error(`Invalid template literal part: ${part._zod.traits}`);
1802
+ const start = source.startsWith("^") ? 1 : 0;
1803
+ const end = source.endsWith("$") ? source.length - 1 : source.length;
1804
+ regexParts.push(source.slice(start, end));
1805
+ }
1806
+ else if (part === null || util.primitiveTypes.has(typeof part)) {
1807
+ regexParts.push(util.escapeRegex(`${part}`));
1808
+ }
1809
+ else {
1810
+ throw new Error(`Invalid template literal part: ${part}`);
1811
+ }
1812
+ }
1813
+ inst._zod.pattern = new RegExp(`^${regexParts.join("")}$`);
1814
+ inst._zod.parse = (payload, _ctx) => {
1815
+ if (typeof payload.value !== "string") {
1816
+ payload.issues.push({
1817
+ input: payload.value,
1818
+ inst,
1819
+ expected: "template_literal",
1820
+ code: "invalid_type",
1821
+ });
1822
+ return payload;
1823
+ }
1824
+ inst._zod.pattern.lastIndex = 0;
1825
+ if (!inst._zod.pattern.test(payload.value)) {
1826
+ payload.issues.push({
1827
+ input: payload.value,
1828
+ inst,
1829
+ code: "invalid_format",
1830
+ format: def.format ?? "template_literal",
1831
+ pattern: inst._zod.pattern.source,
1832
+ });
1833
+ return payload;
1834
+ }
1835
+ return payload;
1836
+ };
1837
+ });
1838
+ exports.$ZodFunction = core.$constructor("$ZodFunction", (inst, def) => {
1839
+ exports.$ZodType.init(inst, def);
1840
+ inst._def = def;
1841
+ inst._zod.def = def;
1842
+ inst.implement = (func) => {
1843
+ if (typeof func !== "function") {
1844
+ throw new Error("implement() must be called with a function");
1845
+ }
1846
+ return function (...args) {
1847
+ const parsedArgs = inst._def.input ? (0, parse_js_1.parse)(inst._def.input, args) : args;
1848
+ const result = Reflect.apply(func, this, parsedArgs);
1849
+ if (inst._def.output) {
1850
+ return (0, parse_js_1.parse)(inst._def.output, result);
1851
+ }
1852
+ return result;
1853
+ };
1854
+ };
1855
+ inst.implementAsync = (func) => {
1856
+ if (typeof func !== "function") {
1857
+ throw new Error("implementAsync() must be called with a function");
1858
+ }
1859
+ return async function (...args) {
1860
+ const parsedArgs = inst._def.input ? await (0, parse_js_1.parseAsync)(inst._def.input, args) : args;
1861
+ const result = await Reflect.apply(func, this, parsedArgs);
1862
+ if (inst._def.output) {
1863
+ return await (0, parse_js_1.parseAsync)(inst._def.output, result);
1864
+ }
1865
+ return result;
1866
+ };
1867
+ };
1868
+ inst._zod.parse = (payload, _ctx) => {
1869
+ if (typeof payload.value !== "function") {
1870
+ payload.issues.push({
1871
+ code: "invalid_type",
1872
+ expected: "function",
1873
+ input: payload.value,
1874
+ inst,
1875
+ });
1876
+ return payload;
1877
+ }
1878
+ // Check if output is a promise type to determine if we should use async implementation
1879
+ const hasPromiseOutput = inst._def.output && inst._def.output._zod.def.type === "promise";
1880
+ if (hasPromiseOutput) {
1881
+ payload.value = inst.implementAsync(payload.value);
1882
+ }
1883
+ else {
1884
+ payload.value = inst.implement(payload.value);
1885
+ }
1886
+ return payload;
1887
+ };
1888
+ inst.input = (...args) => {
1889
+ const F = inst.constructor;
1890
+ if (Array.isArray(args[0])) {
1891
+ return new F({
1892
+ type: "function",
1893
+ input: new exports.$ZodTuple({
1894
+ type: "tuple",
1895
+ items: args[0],
1896
+ rest: args[1],
1897
+ }),
1898
+ output: inst._def.output,
1899
+ });
1900
+ }
1901
+ return new F({
1902
+ type: "function",
1903
+ input: args[0],
1904
+ output: inst._def.output,
1905
+ });
1906
+ };
1907
+ inst.output = (output) => {
1908
+ const F = inst.constructor;
1909
+ return new F({
1910
+ type: "function",
1911
+ input: inst._def.input,
1912
+ output,
1913
+ });
1914
+ };
1915
+ return inst;
1916
+ });
1917
+ exports.$ZodPromise = core.$constructor("$ZodPromise", (inst, def) => {
1918
+ exports.$ZodType.init(inst, def);
1919
+ inst._zod.parse = (payload, ctx) => {
1920
+ return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({ value: inner, issues: [] }, ctx));
1921
+ };
1922
+ });
1923
+ exports.$ZodLazy = core.$constructor("$ZodLazy", (inst, def) => {
1924
+ exports.$ZodType.init(inst, def);
1925
+ // let _innerType!: any;
1926
+ // util.defineLazy(def, "getter", () => {
1927
+ // if (!_innerType) {
1928
+ // _innerType = def.getter();
1929
+ // }
1930
+ // return () => _innerType;
1931
+ // });
1932
+ util.defineLazy(inst._zod, "innerType", () => def.getter());
1933
+ util.defineLazy(inst._zod, "pattern", () => inst._zod.innerType._zod.pattern);
1934
+ util.defineLazy(inst._zod, "propValues", () => inst._zod.innerType._zod.propValues);
1935
+ util.defineLazy(inst._zod, "optin", () => inst._zod.innerType._zod.optin ?? undefined);
1936
+ util.defineLazy(inst._zod, "optout", () => inst._zod.innerType._zod.optout ?? undefined);
1937
+ inst._zod.parse = (payload, ctx) => {
1938
+ const inner = inst._zod.innerType;
1939
+ return inner._zod.run(payload, ctx);
1940
+ };
1941
+ });
1942
+ exports.$ZodCustom = core.$constructor("$ZodCustom", (inst, def) => {
1943
+ checks.$ZodCheck.init(inst, def);
1944
+ exports.$ZodType.init(inst, def);
1945
+ inst._zod.parse = (payload, _) => {
1946
+ return payload;
1947
+ };
1948
+ inst._zod.check = (payload) => {
1949
+ const input = payload.value;
1950
+ const r = def.fn(input);
1951
+ if (r instanceof Promise) {
1952
+ return r.then((r) => handleRefineResult(r, payload, input, inst));
1953
+ }
1954
+ handleRefineResult(r, payload, input, inst);
1955
+ return;
1956
+ };
1957
+ });
1958
+ function handleRefineResult(result, payload, input, inst) {
1959
+ if (!result) {
1960
+ const _iss = {
1961
+ code: "custom",
1962
+ input,
1963
+ inst, // incorporates params.error into issue reporting
1964
+ path: [...(inst._zod.def.path ?? [])], // incorporates params.error into issue reporting
1965
+ continue: !inst._zod.def.abort,
1966
+ // params: inst._zod.def.params,
1967
+ };
1968
+ if (inst._zod.def.params)
1969
+ _iss.params = inst._zod.def.params;
1970
+ payload.issues.push(util.issue(_iss));
1971
+ }
1972
+ }