agentf 0.6.0 → 0.8.0

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