@loomhelm/multi-task-flow 0.2.7 → 0.2.9

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 (1046) hide show
  1. package/README.md +22 -18
  2. package/package.json +3 -13
  3. package/src/build-info.ts +4 -2
  4. package/src/cli/release.ts +4 -40
  5. package/src/cli/service.ts +26 -0
  6. package/src/cli.ts +3 -1
  7. package/src/release-tarball.ts +1 -1
  8. package/src/release.ts +7 -1
  9. package/src/runtime-identity.ts +4 -2
  10. package/src/toolkit.ts +71 -15
  11. package/toolkit/artifact-manifest.json +317 -4224
  12. package/toolkit/package.json +1 -1
  13. package/toolkit/skills/bin/check_source_policy.ts +13 -7
  14. package/toolkit/skills/bin/multi_task_platform_gate.ts +2 -2
  15. package/toolkit/skills/bin/tests/core/package_scripts.test.ts +1 -1
  16. package/toolkit/skills/bin/tests/plan/multi-task-flow.test.ts +3 -3
  17. package/toolkit/skills/catalog.json +0 -1
  18. package/toolkit/skills/docs/vendor/dot-codex/design/multi-task-flow/data-and-scripts.md +84 -28
  19. package/toolkit/skills/docs/vendor/dot-codex/design/multi-task-flow/execution.md +1 -1
  20. package/toolkit/skills/docs/vendor/dot-codex/design/multi-task-flow/plan-revision-and-change-audit.md +1 -1
  21. package/toolkit/skills/docs/vendor/dot-codex/design/multi-task-flow/web-template.md +1 -1
  22. package/toolkit/skills/docs/vendor/dot-codex/specs/a4ge9-stable-preview-runtime/IMPLEMENTATION.md +0 -2
  23. package/toolkit/skills/docs/vendor/dot-codex/specs/a4ge9-stable-preview-runtime/SPEC.md +0 -1
  24. package/toolkit/skills/docs/vendor/dot-codex/specs/dev-plan-standalone-typescript-finalizer/IMPLEMENTATION.md +1 -1
  25. package/toolkit/skills/docs/vendor/dot-codex/specs/multi-task-flow/IMPLEMENTATION.md +3 -3
  26. package/toolkit/skills/docs/vendor/dot-codex/specs/multi-task-flow/SCHEMA.md +4 -4
  27. package/toolkit/skills/docs/vendor/dot-codex/specs/stable-preview-runtime/IMPLEMENTATION.md +0 -2
  28. package/toolkit/skills/docs/vendor/dot-codex/specs/stable-preview-runtime/SPEC.md +0 -1
  29. package/toolkit/skills/multi-task-flow/SKILL.md +65 -47
  30. package/toolkit/skills/multi-task-flow/dist/app.css +1 -1
  31. package/toolkit/skills/multi-task-flow/dist/app.js +74 -74
  32. package/toolkit/skills/multi-task-flow/dist/index.html +3 -3
  33. package/toolkit/skills/multi-task-flow/lib/atomic-orchestration.ts +26 -3
  34. package/toolkit/skills/multi-task-flow/lib/engine.ts +136 -17
  35. package/toolkit/skills/multi-task-flow/lib/package-source.ts +5 -5
  36. package/toolkit/skills/multi-task-flow/lib/schema.ts +82 -2
  37. package/toolkit/skills/multi-task-flow/lib/service-pages.ts +1 -26
  38. package/toolkit/skills/multi-task-flow/lib/view.ts +125 -11
  39. package/toolkit/skills/multi-task-flow/references/shared-viewer.md +1 -1
  40. package/toolkit/skills/multi-task-flow/scripts/check-client-skills.ts +7 -4
  41. package/toolkit/skills/multi-task-flow/scripts/check-skills-installation.ts +14 -8
  42. package/toolkit/skills/multi-task-flow/scripts/import-client-skills.ts +1 -1
  43. package/toolkit/skills/multi-task-flow/scripts/package-client-skills.ts +28 -157
  44. package/toolkit/skills/multi-task-flow/scripts/preview-source.ts +3 -0
  45. package/toolkit/skills/multi-task-flow/scripts/test-viewer-source.ts +1 -1
  46. package/toolkit/skills/multi-task-flow/tests/atomic-orchestration-schema.test.ts +40 -0
  47. package/toolkit/skills/multi-task-flow/tests/browser/README.md +1 -1
  48. package/toolkit/skills/multi-task-flow/tests/check-skills-installation.test.ts +12 -38
  49. package/toolkit/skills/multi-task-flow/tests/delivery-topology.test.ts +33 -0
  50. package/toolkit/skills/multi-task-flow/tests/engine.test.ts +339 -0
  51. package/toolkit/skills/multi-task-flow/tests/orchestrate.test.ts +3 -5
  52. package/toolkit/skills/multi-task-flow/tests/source-preview.test.ts +29 -0
  53. package/toolkit/skills/multi-task-flow/tests/ui/details-content.test.ts +31 -0
  54. package/toolkit/skills/multi-task-flow/tests/ui/responsive-width-contract.test.ts +25 -1
  55. package/toolkit/skills/multi-task-flow/tests/ui/task-context-menu.test.ts +2 -1
  56. package/toolkit/skills/multi-task-flow/tests/view.test.ts +149 -0
  57. package/toolkit/skills/multi-task-flow/web/app.css +68 -9
  58. package/toolkit/skills/multi-task-flow/web/app.ts +42 -15
  59. package/toolkit/skills/multi-task-flow/web/atomic-graph-view.tsx +2 -2
  60. package/toolkit/skills/multi-task-flow/web/details-content.ts +54 -38
  61. package/toolkit/skills/multi-task-flow/web/graph-view.tsx +1 -1
  62. package/toolkit/skills/multi-task-flow/web/index.html +3 -3
  63. package/toolkit/skills/multi-task-flow/web/model.ts +1 -1
  64. package/toolkit/skills/multi-task-flow/web/timeline.ts +11 -8
  65. package/toolkit/skills/package.json +2 -2
  66. package/toolkit/skills/source-manifest.json +693 -400
  67. package/toolkit/skills/support-manifest.json +1 -0
  68. package/toolkit/skills/multi-task-flow/node_modules/zod/LICENSE +0 -21
  69. package/toolkit/skills/multi-task-flow/node_modules/zod/README.md +0 -218
  70. package/toolkit/skills/multi-task-flow/node_modules/zod/compile.cjs +0 -96
  71. package/toolkit/skills/multi-task-flow/node_modules/zod/compile.d.cts +0 -1
  72. package/toolkit/skills/multi-task-flow/node_modules/zod/compile.d.ts +0 -1
  73. package/toolkit/skills/multi-task-flow/node_modules/zod/compile.js +0 -52
  74. package/toolkit/skills/multi-task-flow/node_modules/zod/index.cjs +0 -52
  75. package/toolkit/skills/multi-task-flow/node_modules/zod/index.d.cts +0 -3
  76. package/toolkit/skills/multi-task-flow/node_modules/zod/index.d.ts +0 -3
  77. package/toolkit/skills/multi-task-flow/node_modules/zod/index.js +0 -7
  78. package/toolkit/skills/multi-task-flow/node_modules/zod/locales/index.cjs +0 -36
  79. package/toolkit/skills/multi-task-flow/node_modules/zod/locales/index.d.cts +0 -1
  80. package/toolkit/skills/multi-task-flow/node_modules/zod/locales/index.d.ts +0 -1
  81. package/toolkit/skills/multi-task-flow/node_modules/zod/locales/index.js +0 -1
  82. package/toolkit/skills/multi-task-flow/node_modules/zod/locales/package.json +0 -7
  83. package/toolkit/skills/multi-task-flow/node_modules/zod/mini/index.cjs +0 -51
  84. package/toolkit/skills/multi-task-flow/node_modules/zod/mini/index.d.cts +0 -3
  85. package/toolkit/skills/multi-task-flow/node_modules/zod/mini/index.d.ts +0 -3
  86. package/toolkit/skills/multi-task-flow/node_modules/zod/mini/index.js +0 -3
  87. package/toolkit/skills/multi-task-flow/node_modules/zod/mini/package.json +0 -7
  88. package/toolkit/skills/multi-task-flow/node_modules/zod/package.json +0 -147
  89. package/toolkit/skills/multi-task-flow/node_modules/zod/src/compile.ts +0 -56
  90. package/toolkit/skills/multi-task-flow/node_modules/zod/src/index.ts +0 -7
  91. package/toolkit/skills/multi-task-flow/node_modules/zod/src/locales/index.ts +0 -1
  92. package/toolkit/skills/multi-task-flow/node_modules/zod/src/mini/index.ts +0 -3
  93. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/ZodError.ts +0 -340
  94. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
  95. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
  96. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/benchmarks/index.ts +0 -59
  97. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
  98. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/benchmarks/object.ts +0 -69
  99. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
  100. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
  101. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/benchmarks/string.ts +0 -55
  102. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/benchmarks/union.ts +0 -80
  103. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/errors.ts +0 -13
  104. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/external.ts +0 -6
  105. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
  106. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
  107. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
  108. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
  109. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
  110. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/helpers/util.ts +0 -224
  111. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/index.ts +0 -4
  112. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/locales/en.ts +0 -124
  113. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/standard-schema.ts +0 -113
  114. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/Mocker.ts +0 -54
  115. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
  116. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
  117. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/array.test.ts +0 -71
  118. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
  119. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
  120. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/base.test.ts +0 -29
  121. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/bigint.test.ts +0 -55
  122. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/branded.test.ts +0 -53
  123. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/catch.test.ts +0 -220
  124. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/coerce.test.ts +0 -133
  125. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/complex.test.ts +0 -70
  126. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/custom.test.ts +0 -31
  127. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/date.test.ts +0 -32
  128. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
  129. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/default.test.ts +0 -112
  130. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/description.test.ts +0 -33
  131. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
  132. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/enum.test.ts +0 -80
  133. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/error.test.ts +0 -586
  134. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
  135. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
  136. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/function.test.ts +0 -261
  137. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/generics.test.ts +0 -48
  138. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
  139. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/intersection.test.ts +0 -128
  140. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/language-server.source.ts +0 -76
  141. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/language-server.test.ts +0 -206
  142. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/literal.test.ts +0 -36
  143. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/map.test.ts +0 -110
  144. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/masking.test.ts +0 -4
  145. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/mocker.test.ts +0 -19
  146. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/nan.test.ts +0 -24
  147. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
  148. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/nullable.test.ts +0 -42
  149. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/number.test.ts +0 -176
  150. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
  151. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
  152. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/object.test.ts +0 -431
  153. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/optional.test.ts +0 -42
  154. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
  155. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/parser.test.ts +0 -41
  156. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/partials.test.ts +0 -243
  157. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
  158. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
  159. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
  160. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/primitive.test.ts +0 -440
  161. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/promise.test.ts +0 -90
  162. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/readonly.test.ts +0 -114
  163. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/record.test.ts +0 -171
  164. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/recursive.test.ts +0 -197
  165. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/refine.test.ts +0 -313
  166. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
  167. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/set.test.ts +0 -142
  168. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
  169. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/string.test.ts +0 -922
  170. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/transformer.test.ts +0 -233
  171. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/tuple.test.ts +0 -90
  172. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/unions.test.ts +0 -57
  173. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/validations.test.ts +0 -133
  174. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/tests/void.test.ts +0 -15
  175. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v3/types.ts +0 -5138
  176. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/checks.ts +0 -33
  177. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/coerce.ts +0 -27
  178. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/compat.ts +0 -78
  179. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/deep-partial.ts +0 -76
  180. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/errors.ts +0 -97
  181. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/external.ts +0 -57
  182. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/from-json-schema.ts +0 -944
  183. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/in-out.ts +0 -45
  184. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/index.ts +0 -5
  185. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/iso.ts +0 -20
  186. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/parse.ts +0 -88
  187. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/schemas.ts +0 -2937
  188. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
  189. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/apply.test.ts +0 -86
  190. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/array.test.ts +0 -291
  191. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -402
  192. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
  193. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
  194. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
  195. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -89
  196. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/brand.test.ts +0 -106
  197. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/catch.test.ts +0 -604
  198. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
  199. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +0 -572
  200. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/codec.test.ts +0 -704
  201. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
  202. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -374
  203. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +0 -76
  204. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
  205. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +0 -985
  206. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/date.test.ts +0 -92
  207. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -316
  208. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +0 -380
  209. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +0 -32
  210. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/default.test.ts +0 -455
  211. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +0 -27
  212. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
  213. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +0 -221
  214. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -942
  215. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/enum.test.ts +0 -305
  216. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -917
  217. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/error.test.ts +0 -1108
  218. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/file.test.ts +0 -96
  219. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -179
  220. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +0 -26
  221. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +0 -1467
  222. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/function.test.ts +0 -391
  223. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
  224. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/global-config.test.ts +0 -32
  225. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/hash.test.ts +0 -67
  226. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/iban.test.ts +0 -81
  227. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/in-out.test.ts +0 -159
  228. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/index.test.ts +0 -958
  229. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +0 -319
  230. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -127
  231. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -334
  232. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +0 -215
  233. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +0 -39
  234. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/json.test.ts +0 -109
  235. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -262
  236. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/literal.test.ts +0 -128
  237. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +0 -29
  238. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +0 -24
  239. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/map.test.ts +0 -349
  240. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
  241. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
  242. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -101
  243. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
  244. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/number.test.ts +0 -401
  245. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/object.test.ts +0 -1006
  246. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +0 -235
  247. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/optional.test.ts +0 -366
  248. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/partial.test.ts +0 -497
  249. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -211
  250. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -101
  251. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -144
  252. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +0 -44
  253. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -351
  254. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
  255. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
  256. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/properties.test.ts +0 -141
  257. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
  258. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -184
  259. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/record.test.ts +0 -885
  260. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -707
  261. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/redos.test.ts +0 -68
  262. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/refine.test.ts +0 -693
  263. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/registries.test.ts +0 -243
  264. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/set.test.ts +0 -196
  265. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -153
  266. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -125
  267. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/string.test.ts +0 -1440
  268. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -124
  269. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -812
  270. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +0 -438
  271. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -4733
  272. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/transform.test.ts +0 -378
  273. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -511
  274. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/union.test.ts +0 -310
  275. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/url.test.ts +0 -13
  276. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/validate.test.ts +0 -645
  277. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
  278. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
  279. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/api.ts +0 -1875
  280. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/checks.ts +0 -1266
  281. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/compile.ts +0 -2322
  282. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/core.ts +0 -230
  283. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/doc.ts +0 -52
  284. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/errors.ts +0 -543
  285. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/index.ts +0 -19
  286. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/json-schema-generator.ts +0 -131
  287. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/json-schema-processors.ts +0 -934
  288. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/json-schema.ts +0 -148
  289. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/memoizer.ts +0 -331
  290. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/parse.ts +0 -309
  291. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/regexes.ts +0 -217
  292. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/registries.ts +0 -105
  293. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/schemas.ts +0 -5226
  294. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/standard-schema.ts +0 -159
  295. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/cached.test.ts +0 -54
  296. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +0 -1004
  297. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +0 -445
  298. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/compile-global.test.ts +0 -89
  299. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +0 -26
  300. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +0 -34
  301. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/compile.test.ts +0 -2036
  302. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/email-regex.test.ts +0 -140
  303. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/extend.test.ts +0 -59
  304. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/index.test.ts +0 -46
  305. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
  306. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/locales/el.test.ts +0 -214
  307. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
  308. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/locales/es.test.ts +0 -180
  309. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +0 -72
  310. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/locales/he.test.ts +0 -379
  311. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +0 -163
  312. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +0 -46
  313. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +0 -42
  314. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
  315. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +0 -85
  316. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +0 -69
  317. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
  318. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +0 -105
  319. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +0 -46
  320. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +0 -125
  321. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +0 -45
  322. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/treeshake.test.ts +0 -51
  323. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +0 -133
  324. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/to-json-schema.ts +0 -857
  325. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/util.ts +0 -1293
  326. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/versions.ts +0 -5
  327. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/visit.ts +0 -193
  328. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/core/zsf.ts +0 -323
  329. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/index.ts +0 -4
  330. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/ar.ts +0 -120
  331. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/az.ts +0 -116
  332. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/be.ts +0 -188
  333. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/bg.ts +0 -133
  334. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/bn.ts +0 -123
  335. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/ca.ts +0 -121
  336. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/ckb.ts +0 -140
  337. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/cs.ts +0 -123
  338. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/da.ts +0 -128
  339. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/de.ts +0 -121
  340. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/el.ts +0 -124
  341. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/en.ts +0 -136
  342. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/eo.ts +0 -123
  343. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/es.ts +0 -145
  344. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/fa.ts +0 -131
  345. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/fi.ts +0 -126
  346. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/fr-CA.ts +0 -121
  347. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/fr.ts +0 -139
  348. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/gu.ts +0 -123
  349. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/he.ts +0 -253
  350. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/hi.ts +0 -126
  351. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/hr.ts +0 -135
  352. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/hu.ts +0 -122
  353. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/hy.ts +0 -175
  354. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/id.ts +0 -120
  355. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/index.ts +0 -63
  356. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/is.ts +0 -124
  357. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/it.ts +0 -121
  358. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/ja.ts +0 -119
  359. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/ka.ts +0 -128
  360. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/kh.ts +0 -7
  361. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/km.ts +0 -124
  362. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/kn.ts +0 -126
  363. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/ko.ts +0 -126
  364. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/lt.ts +0 -243
  365. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/mk.ts +0 -123
  366. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/ms.ts +0 -120
  367. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/ne.ts +0 -128
  368. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/nl.ts +0 -126
  369. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/nn.ts +0 -121
  370. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/no.ts +0 -121
  371. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/ota.ts +0 -122
  372. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/pl.ts +0 -123
  373. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/ps.ts +0 -131
  374. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/pt-BR.ts +0 -161
  375. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/pt.ts +0 -159
  376. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/ro.ts +0 -132
  377. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/ru.ts +0 -188
  378. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/sk.ts +0 -123
  379. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/sl.ts +0 -123
  380. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/sv.ts +0 -124
  381. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/ta.ts +0 -123
  382. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/tg.ts +0 -135
  383. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/th.ts +0 -124
  384. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/tk.ts +0 -113
  385. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/tr.ts +0 -116
  386. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/ua.ts +0 -7
  387. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/uk.ts +0 -122
  388. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/ur.ts +0 -124
  389. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/uz.ts +0 -120
  390. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/vi.ts +0 -122
  391. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/yo.ts +0 -129
  392. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/zh-CN.ts +0 -121
  393. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/locales/zh-TW.ts +0 -120
  394. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/checks.ts +0 -33
  395. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/coerce.ts +0 -27
  396. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/deep-partial.ts +0 -73
  397. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/external.ts +0 -52
  398. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/in-out.ts +0 -45
  399. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/index.ts +0 -3
  400. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/iso.ts +0 -66
  401. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/parse.ts +0 -16
  402. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/schemas.ts +0 -2051
  403. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/tests/apply.test.ts +0 -57
  404. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -190
  405. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/tests/brand.test.ts +0 -94
  406. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/tests/checks.test.ts +0 -158
  407. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/tests/codec.test.ts +0 -582
  408. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/tests/computed.test.ts +0 -30
  409. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +0 -84
  410. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +0 -54
  411. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/tests/error.test.ts +0 -41
  412. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/tests/functions.test.ts +0 -14
  413. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/tests/index.test.ts +0 -1146
  414. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/tests/number.test.ts +0 -109
  415. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/tests/object.test.ts +0 -292
  416. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
  417. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -341
  418. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +0 -50
  419. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4/mini/tests/string.test.ts +0 -396
  420. package/toolkit/skills/multi-task-flow/node_modules/zod/src/v4-mini/index.ts +0 -3
  421. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/ZodError.cjs +0 -167
  422. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/ZodError.d.cts +0 -164
  423. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/ZodError.d.ts +0 -164
  424. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/ZodError.js +0 -143
  425. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/errors.cjs +0 -36
  426. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/errors.d.cts +0 -5
  427. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/errors.d.ts +0 -5
  428. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/errors.js +0 -9
  429. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/external.cjs +0 -41
  430. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/external.d.cts +0 -6
  431. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/external.d.ts +0 -6
  432. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/external.js +0 -6
  433. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/enumUtil.cjs +0 -21
  434. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
  435. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
  436. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/enumUtil.js +0 -1
  437. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/errorUtil.cjs +0 -28
  438. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
  439. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
  440. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/errorUtil.js +0 -6
  441. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/parseUtil.cjs +0 -143
  442. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
  443. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
  444. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/parseUtil.js +0 -109
  445. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/partialUtil.cjs +0 -21
  446. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
  447. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
  448. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/partialUtil.js +0 -1
  449. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/typeAliases.cjs +0 -21
  450. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
  451. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
  452. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/typeAliases.js +0 -1
  453. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/util.cjs +0 -156
  454. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/util.d.cts +0 -85
  455. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/util.d.ts +0 -85
  456. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/helpers/util.js +0 -133
  457. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/index.cjs +0 -52
  458. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/index.d.cts +0 -4
  459. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/index.d.ts +0 -4
  460. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/index.js +0 -4
  461. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/locales/en.cjs +0 -112
  462. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/locales/en.d.cts +0 -3
  463. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/locales/en.d.ts +0 -3
  464. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/locales/en.js +0 -109
  465. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/package.json +0 -7
  466. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/standard-schema.cjs +0 -21
  467. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/standard-schema.d.cts +0 -102
  468. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/standard-schema.d.ts +0 -102
  469. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/standard-schema.js +0 -1
  470. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/types.cjs +0 -3798
  471. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/types.d.cts +0 -1034
  472. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/types.d.ts +0 -1034
  473. package/toolkit/skills/multi-task-flow/node_modules/zod/v3/types.js +0 -3697
  474. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/checks.cjs +0 -53
  475. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/checks.d.cts +0 -1
  476. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/checks.d.ts +0 -1
  477. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/checks.js +0 -1
  478. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/coerce.cjs +0 -66
  479. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/coerce.d.cts +0 -17
  480. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/coerce.d.ts +0 -17
  481. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/coerce.js +0 -17
  482. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/compat.cjs +0 -80
  483. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/compat.d.cts +0 -48
  484. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/compat.d.ts +0 -48
  485. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/compat.js +0 -31
  486. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/deep-partial.cjs +0 -58
  487. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/deep-partial.d.cts +0 -14
  488. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/deep-partial.d.ts +0 -14
  489. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/deep-partial.js +0 -13
  490. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/errors.cjs +0 -102
  491. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/errors.d.cts +0 -29
  492. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/errors.d.ts +0 -29
  493. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/errors.js +0 -57
  494. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/external.cjs +0 -97
  495. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/external.d.cts +0 -19
  496. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/external.d.ts +0 -19
  497. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/external.js +0 -17
  498. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/from-json-schema.cjs +0 -926
  499. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/from-json-schema.d.cts +0 -12
  500. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/from-json-schema.d.ts +0 -12
  501. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/from-json-schema.js +0 -881
  502. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/in-out.cjs +0 -82
  503. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/in-out.d.cts +0 -8
  504. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/in-out.d.ts +0 -8
  505. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/in-out.js +0 -36
  506. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/index.cjs +0 -52
  507. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/index.d.cts +0 -3
  508. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/index.d.ts +0 -3
  509. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/index.js +0 -4
  510. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/iso.cjs +0 -68
  511. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/iso.d.cts +0 -7
  512. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/iso.d.ts +0 -7
  513. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/iso.js +0 -15
  514. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/package.json +0 -7
  515. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/parse.cjs +0 -63
  516. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/parse.d.cts +0 -44
  517. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/parse.d.ts +0 -44
  518. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/parse.js +0 -16
  519. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/schemas.cjs +0 -1676
  520. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/schemas.d.cts +0 -816
  521. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/schemas.d.ts +0 -816
  522. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/classic/schemas.js +0 -1535
  523. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/api.cjs +0 -1269
  524. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/api.d.cts +0 -335
  525. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/api.d.ts +0 -335
  526. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/api.js +0 -1107
  527. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/checks.cjs +0 -561
  528. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/checks.d.cts +0 -294
  529. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/checks.d.ts +0 -294
  530. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/checks.js +0 -516
  531. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/compile.cjs +0 -1916
  532. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/compile.d.cts +0 -65
  533. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/compile.d.ts +0 -65
  534. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/compile.js +0 -1866
  535. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/core.cjs +0 -167
  536. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/core.d.cts +0 -82
  537. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/core.d.ts +0 -82
  538. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/core.js +0 -141
  539. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/doc.cjs +0 -61
  540. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/doc.d.cts +0 -16
  541. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/doc.d.ts +0 -16
  542. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/doc.js +0 -38
  543. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/errors.cjs +0 -317
  544. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/errors.d.cts +0 -225
  545. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/errors.d.ts +0 -225
  546. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/errors.js +0 -267
  547. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/index.cjs +0 -70
  548. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/index.d.cts +0 -19
  549. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/index.d.ts +0 -19
  550. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/index.js +0 -19
  551. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/json-schema-generator.cjs +0 -122
  552. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/json-schema-generator.d.cts +0 -65
  553. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/json-schema-generator.d.ts +0 -65
  554. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/json-schema-generator.js +0 -99
  555. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/json-schema-processors.cjs +0 -929
  556. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/json-schema-processors.d.cts +0 -65
  557. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/json-schema-processors.d.ts +0 -65
  558. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/json-schema-processors.js +0 -843
  559. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/json-schema.cjs +0 -21
  560. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/json-schema.d.cts +0 -89
  561. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/json-schema.d.ts +0 -89
  562. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/json-schema.js +0 -1
  563. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/memoizer.cjs +0 -360
  564. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/memoizer.d.cts +0 -15
  565. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/memoizer.d.ts +0 -15
  566. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/memoizer.js +0 -311
  567. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/package.json +0 -7
  568. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/parse.cjs +0 -233
  569. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/parse.d.cts +0 -52
  570. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/parse.d.ts +0 -52
  571. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/parse.js +0 -175
  572. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/regexes.cjs +0 -209
  573. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/regexes.d.cts +0 -90
  574. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/regexes.d.ts +0 -90
  575. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/regexes.js +0 -156
  576. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/registries.cjs +0 -75
  577. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/registries.d.cts +0 -35
  578. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/registries.d.ts +0 -35
  579. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/registries.js +0 -51
  580. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/schemas.cjs +0 -2699
  581. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/schemas.d.cts +0 -1275
  582. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/schemas.d.ts +0 -1275
  583. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/schemas.js +0 -2636
  584. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/standard-schema.cjs +0 -21
  585. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/standard-schema.d.cts +0 -126
  586. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/standard-schema.d.ts +0 -126
  587. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/standard-schema.js +0 -1
  588. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/to-json-schema.cjs +0 -681
  589. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/to-json-schema.d.cts +0 -154
  590. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/to-json-schema.d.ts +0 -154
  591. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/to-json-schema.js +0 -651
  592. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/util.cjs +0 -964
  593. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/util.d.cts +0 -280
  594. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/util.d.ts +0 -280
  595. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/util.js +0 -873
  596. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/versions.cjs +0 -27
  597. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/versions.d.cts +0 -5
  598. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/versions.d.ts +0 -5
  599. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/versions.js +0 -5
  600. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/visit.cjs +0 -214
  601. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/visit.d.cts +0 -30
  602. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/visit.d.ts +0 -30
  603. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/core/visit.js +0 -169
  604. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/index.cjs +0 -51
  605. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/index.d.cts +0 -3
  606. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/index.d.ts +0 -3
  607. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/index.js +0 -4
  608. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ar.cjs +0 -138
  609. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ar.d.cts +0 -5
  610. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ar.d.ts +0 -4
  611. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ar.js +0 -111
  612. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/az.cjs +0 -137
  613. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/az.d.cts +0 -5
  614. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/az.d.ts +0 -4
  615. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/az.js +0 -110
  616. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/be.cjs +0 -195
  617. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/be.d.cts +0 -5
  618. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/be.d.ts +0 -4
  619. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/be.js +0 -168
  620. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/bg.cjs +0 -152
  621. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/bg.d.cts +0 -5
  622. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/bg.d.ts +0 -4
  623. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/bg.js +0 -125
  624. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/bn.cjs +0 -140
  625. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/bn.d.cts +0 -5
  626. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/bn.d.ts +0 -4
  627. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/bn.js +0 -113
  628. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ca.cjs +0 -139
  629. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ca.d.cts +0 -5
  630. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ca.d.ts +0 -4
  631. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ca.js +0 -112
  632. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ckb.cjs +0 -160
  633. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ckb.d.cts +0 -5
  634. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ckb.d.ts +0 -4
  635. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ckb.js +0 -133
  636. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/cs.cjs +0 -143
  637. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/cs.d.cts +0 -5
  638. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/cs.d.ts +0 -4
  639. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/cs.js +0 -116
  640. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/da.cjs +0 -147
  641. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/da.d.cts +0 -5
  642. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/da.d.ts +0 -4
  643. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/da.js +0 -120
  644. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/de.cjs +0 -140
  645. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/de.d.cts +0 -5
  646. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/de.d.ts +0 -4
  647. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/de.js +0 -113
  648. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/el.cjs +0 -139
  649. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/el.d.cts +0 -5
  650. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/el.d.ts +0 -4
  651. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/el.js +0 -112
  652. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/en.cjs +0 -152
  653. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/en.d.cts +0 -5
  654. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/en.d.ts +0 -4
  655. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/en.js +0 -125
  656. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/eo.cjs +0 -141
  657. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/eo.d.cts +0 -5
  658. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/eo.d.ts +0 -4
  659. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/eo.js +0 -114
  660. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/es.cjs +0 -163
  661. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/es.d.cts +0 -5
  662. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/es.d.ts +0 -4
  663. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/es.js +0 -136
  664. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/fa.cjs +0 -146
  665. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/fa.d.cts +0 -5
  666. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/fa.d.ts +0 -4
  667. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/fa.js +0 -119
  668. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/fi.cjs +0 -144
  669. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/fi.d.cts +0 -5
  670. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/fi.d.ts +0 -4
  671. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/fi.js +0 -117
  672. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/fr-CA.cjs +0 -139
  673. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/fr-CA.d.cts +0 -5
  674. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
  675. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/fr-CA.js +0 -112
  676. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/fr.cjs +0 -156
  677. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/fr.d.cts +0 -5
  678. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/fr.d.ts +0 -4
  679. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/fr.js +0 -129
  680. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/gu.cjs +0 -140
  681. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/gu.d.cts +0 -5
  682. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/gu.d.ts +0 -4
  683. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/gu.js +0 -113
  684. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/he.cjs +0 -248
  685. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/he.d.cts +0 -5
  686. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/he.d.ts +0 -4
  687. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/he.js +0 -221
  688. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/hi.cjs +0 -138
  689. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/hi.d.cts +0 -5
  690. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/hi.d.ts +0 -4
  691. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/hi.js +0 -111
  692. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/hr.cjs +0 -153
  693. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/hr.d.cts +0 -5
  694. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/hr.d.ts +0 -4
  695. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/hr.js +0 -126
  696. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/hu.cjs +0 -140
  697. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/hu.d.cts +0 -5
  698. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/hu.d.ts +0 -4
  699. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/hu.js +0 -113
  700. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/hy.cjs +0 -185
  701. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/hy.d.cts +0 -5
  702. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/hy.d.ts +0 -4
  703. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/hy.js +0 -158
  704. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/id.cjs +0 -138
  705. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/id.d.cts +0 -5
  706. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/id.d.ts +0 -4
  707. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/id.js +0 -111
  708. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/index.cjs +0 -152
  709. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/index.d.cts +0 -63
  710. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/index.d.ts +0 -63
  711. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/index.js +0 -63
  712. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/is.cjs +0 -141
  713. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/is.d.cts +0 -5
  714. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/is.d.ts +0 -4
  715. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/is.js +0 -114
  716. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/it.cjs +0 -140
  717. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/it.d.cts +0 -5
  718. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/it.d.ts +0 -4
  719. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/it.js +0 -113
  720. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ja.cjs +0 -139
  721. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ja.d.cts +0 -5
  722. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ja.d.ts +0 -4
  723. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ja.js +0 -112
  724. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ka.cjs +0 -144
  725. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ka.d.cts +0 -5
  726. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ka.d.ts +0 -4
  727. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ka.js +0 -117
  728. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/kh.cjs +0 -12
  729. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/kh.d.cts +0 -5
  730. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/kh.d.ts +0 -5
  731. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/kh.js +0 -5
  732. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/km.cjs +0 -142
  733. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/km.d.cts +0 -5
  734. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/km.d.ts +0 -4
  735. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/km.js +0 -115
  736. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/kn.cjs +0 -143
  737. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/kn.d.cts +0 -5
  738. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/kn.d.ts +0 -4
  739. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/kn.js +0 -116
  740. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ko.cjs +0 -143
  741. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ko.d.cts +0 -5
  742. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ko.d.ts +0 -4
  743. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ko.js +0 -116
  744. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/lt.cjs +0 -234
  745. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/lt.d.cts +0 -5
  746. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/lt.d.ts +0 -4
  747. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/lt.js +0 -207
  748. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/mk.cjs +0 -141
  749. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/mk.d.cts +0 -5
  750. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/mk.d.ts +0 -4
  751. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/mk.js +0 -114
  752. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ms.cjs +0 -139
  753. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ms.d.cts +0 -5
  754. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ms.d.ts +0 -4
  755. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ms.js +0 -112
  756. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ne.cjs +0 -138
  757. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ne.d.cts +0 -5
  758. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ne.d.ts +0 -4
  759. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ne.js +0 -111
  760. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/nl.cjs +0 -142
  761. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/nl.d.cts +0 -5
  762. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/nl.d.ts +0 -4
  763. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/nl.js +0 -115
  764. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/nn.cjs +0 -140
  765. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/nn.d.cts +0 -5
  766. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/nn.d.ts +0 -4
  767. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/nn.js +0 -113
  768. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/no.cjs +0 -140
  769. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/no.d.cts +0 -5
  770. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/no.d.ts +0 -4
  771. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/no.js +0 -113
  772. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ota.cjs +0 -141
  773. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ota.d.cts +0 -5
  774. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ota.d.ts +0 -4
  775. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ota.js +0 -114
  776. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/package.json +0 -7
  777. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/pl.cjs +0 -141
  778. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/pl.d.cts +0 -5
  779. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/pl.d.ts +0 -4
  780. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/pl.js +0 -114
  781. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ps.cjs +0 -146
  782. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ps.d.cts +0 -5
  783. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ps.d.ts +0 -4
  784. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ps.js +0 -119
  785. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/pt-BR.cjs +0 -170
  786. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/pt-BR.d.cts +0 -5
  787. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/pt-BR.d.ts +0 -4
  788. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/pt-BR.js +0 -143
  789. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/pt.cjs +0 -169
  790. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/pt.d.cts +0 -5
  791. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/pt.d.ts +0 -4
  792. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/pt.js +0 -142
  793. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ro.cjs +0 -149
  794. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ro.d.cts +0 -5
  795. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ro.d.ts +0 -4
  796. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ro.js +0 -122
  797. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ru.cjs +0 -195
  798. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ru.d.cts +0 -5
  799. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ru.d.ts +0 -4
  800. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ru.js +0 -168
  801. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/sk.cjs +0 -143
  802. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/sk.d.cts +0 -5
  803. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/sk.d.ts +0 -4
  804. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/sk.js +0 -116
  805. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/sl.cjs +0 -141
  806. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/sl.d.cts +0 -5
  807. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/sl.d.ts +0 -4
  808. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/sl.js +0 -114
  809. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/sv.cjs +0 -142
  810. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/sv.d.cts +0 -5
  811. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/sv.d.ts +0 -4
  812. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/sv.js +0 -115
  813. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ta.cjs +0 -142
  814. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ta.d.cts +0 -5
  815. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ta.d.ts +0 -4
  816. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ta.js +0 -115
  817. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/tg.cjs +0 -144
  818. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/tg.d.cts +0 -5
  819. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/tg.d.ts +0 -4
  820. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/tg.js +0 -117
  821. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/th.cjs +0 -142
  822. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/th.d.cts +0 -5
  823. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/th.d.ts +0 -4
  824. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/th.js +0 -115
  825. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/tk.cjs +0 -134
  826. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/tk.d.cts +0 -5
  827. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/tk.d.ts +0 -4
  828. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/tk.js +0 -107
  829. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/tr.cjs +0 -137
  830. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/tr.d.cts +0 -5
  831. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/tr.d.ts +0 -4
  832. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/tr.js +0 -110
  833. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ua.cjs +0 -12
  834. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ua.d.cts +0 -5
  835. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ua.d.ts +0 -5
  836. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ua.js +0 -5
  837. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/uk.cjs +0 -140
  838. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/uk.d.cts +0 -5
  839. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/uk.d.ts +0 -4
  840. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/uk.js +0 -113
  841. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ur.cjs +0 -142
  842. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ur.d.cts +0 -5
  843. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ur.d.ts +0 -4
  844. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/ur.js +0 -115
  845. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/uz.cjs +0 -140
  846. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/uz.d.cts +0 -5
  847. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/uz.d.ts +0 -4
  848. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/uz.js +0 -113
  849. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/vi.cjs +0 -140
  850. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/vi.d.cts +0 -5
  851. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/vi.d.ts +0 -4
  852. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/vi.js +0 -113
  853. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/yo.cjs +0 -139
  854. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/yo.d.cts +0 -5
  855. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/yo.d.ts +0 -4
  856. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/yo.js +0 -112
  857. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/zh-CN.cjs +0 -141
  858. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/zh-CN.d.cts +0 -5
  859. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
  860. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/zh-CN.js +0 -114
  861. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/zh-TW.cjs +0 -139
  862. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/zh-TW.d.cts +0 -5
  863. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
  864. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/locales/zh-TW.js +0 -112
  865. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/checks.cjs +0 -54
  866. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/checks.d.cts +0 -1
  867. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/checks.d.ts +0 -1
  868. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/checks.js +0 -1
  869. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/coerce.cjs +0 -71
  870. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/coerce.d.cts +0 -7
  871. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/coerce.d.ts +0 -7
  872. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/coerce.js +0 -22
  873. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/deep-partial.cjs +0 -58
  874. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/deep-partial.d.cts +0 -14
  875. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/deep-partial.d.ts +0 -14
  876. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/deep-partial.js +0 -13
  877. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/external.cjs +0 -95
  878. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/external.d.cts +0 -16
  879. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/external.d.ts +0 -16
  880. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/external.js +0 -16
  881. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/in-out.cjs +0 -82
  882. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/in-out.d.cts +0 -8
  883. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/in-out.d.ts +0 -8
  884. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/in-out.js +0 -36
  885. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/index.cjs +0 -51
  886. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/index.d.cts +0 -3
  887. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/index.d.ts +0 -3
  888. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/index.js +0 -3
  889. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/iso.cjs +0 -83
  890. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/iso.d.cts +0 -22
  891. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/iso.d.ts +0 -22
  892. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/iso.js +0 -34
  893. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/package.json +0 -7
  894. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/parse.cjs +0 -37
  895. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/parse.d.cts +0 -1
  896. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/parse.d.ts +0 -1
  897. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/parse.js +0 -1
  898. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/schemas.cjs +0 -1147
  899. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/schemas.d.cts +0 -480
  900. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/schemas.d.ts +0 -480
  901. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/mini/schemas.js +0 -1002
  902. package/toolkit/skills/multi-task-flow/node_modules/zod/v4/package.json +0 -7
  903. package/toolkit/skills/multi-task-flow/node_modules/zod/v4-mini/index.cjs +0 -51
  904. package/toolkit/skills/multi-task-flow/node_modules/zod/v4-mini/index.d.cts +0 -3
  905. package/toolkit/skills/multi-task-flow/node_modules/zod/v4-mini/index.d.ts +0 -3
  906. package/toolkit/skills/multi-task-flow/node_modules/zod/v4-mini/index.js +0 -3
  907. package/toolkit/skills/multi-task-flow/node_modules/zod/v4-mini/package.json +0 -7
  908. package/toolkit/skills/multi-task-flow/scripts/serve.ts +0 -218
  909. package/toolkit/skills/multi-task-flow/tests/serve.test.ts +0 -194
  910. package/toolkit/skills/node_modules/@img/colour/LICENSE.md +0 -82
  911. package/toolkit/skills/node_modules/@img/colour/README.md +0 -15
  912. package/toolkit/skills/node_modules/@img/colour/color.cjs +0 -1596
  913. package/toolkit/skills/node_modules/@img/colour/index.cjs +0 -1
  914. package/toolkit/skills/node_modules/@img/colour/index.d.ts +0 -929
  915. package/toolkit/skills/node_modules/@img/colour/package.json +0 -58
  916. package/toolkit/skills/node_modules/@img/sharp-libvips-linux-x64/README.md +0 -46
  917. package/toolkit/skills/node_modules/@img/sharp-libvips-linux-x64/lib/glib-2.0/include/glibconfig.h +0 -219
  918. package/toolkit/skills/node_modules/@img/sharp-libvips-linux-x64/lib/index.js +0 -1
  919. package/toolkit/skills/node_modules/@img/sharp-libvips-linux-x64/lib/libvips-cpp.so.8.18.7 +0 -0
  920. package/toolkit/skills/node_modules/@img/sharp-libvips-linux-x64/package.json +0 -43
  921. package/toolkit/skills/node_modules/@img/sharp-libvips-linux-x64/versions.json +0 -30
  922. package/toolkit/skills/node_modules/@img/sharp-libvips-linuxmusl-x64/README.md +0 -46
  923. package/toolkit/skills/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/glib-2.0/include/glibconfig.h +0 -219
  924. package/toolkit/skills/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +0 -1
  925. package/toolkit/skills/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.18.7 +0 -0
  926. package/toolkit/skills/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +0 -43
  927. package/toolkit/skills/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +0 -30
  928. package/toolkit/skills/node_modules/@img/sharp-linux-x64/LICENSE +0 -191
  929. package/toolkit/skills/node_modules/@img/sharp-linux-x64/README.md +0 -18
  930. package/toolkit/skills/node_modules/@img/sharp-linux-x64/index.cjs +0 -2
  931. package/toolkit/skills/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64-0.35.5.node +0 -0
  932. package/toolkit/skills/node_modules/@img/sharp-linux-x64/package.json +0 -47
  933. package/toolkit/skills/node_modules/@img/sharp-linuxmusl-x64/LICENSE +0 -191
  934. package/toolkit/skills/node_modules/@img/sharp-linuxmusl-x64/README.md +0 -18
  935. package/toolkit/skills/node_modules/@img/sharp-linuxmusl-x64/index.cjs +0 -2
  936. package/toolkit/skills/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64-0.35.5.node +0 -0
  937. package/toolkit/skills/node_modules/@img/sharp-linuxmusl-x64/package.json +0 -47
  938. package/toolkit/skills/node_modules/detect-libc/LICENSE +0 -201
  939. package/toolkit/skills/node_modules/detect-libc/README.md +0 -163
  940. package/toolkit/skills/node_modules/detect-libc/index.d.ts +0 -14
  941. package/toolkit/skills/node_modules/detect-libc/lib/detect-libc.js +0 -313
  942. package/toolkit/skills/node_modules/detect-libc/lib/elf.js +0 -39
  943. package/toolkit/skills/node_modules/detect-libc/lib/filesystem.js +0 -51
  944. package/toolkit/skills/node_modules/detect-libc/lib/process.js +0 -24
  945. package/toolkit/skills/node_modules/detect-libc/package.json +0 -44
  946. package/toolkit/skills/node_modules/semver/LICENSE +0 -15
  947. package/toolkit/skills/node_modules/semver/README.md +0 -680
  948. package/toolkit/skills/node_modules/semver/bin/semver.js +0 -195
  949. package/toolkit/skills/node_modules/semver/classes/comparator.js +0 -143
  950. package/toolkit/skills/node_modules/semver/classes/index.js +0 -7
  951. package/toolkit/skills/node_modules/semver/classes/range.js +0 -577
  952. package/toolkit/skills/node_modules/semver/classes/semver.js +0 -350
  953. package/toolkit/skills/node_modules/semver/functions/clean.js +0 -8
  954. package/toolkit/skills/node_modules/semver/functions/cmp.js +0 -54
  955. package/toolkit/skills/node_modules/semver/functions/coerce.js +0 -62
  956. package/toolkit/skills/node_modules/semver/functions/compare-build.js +0 -9
  957. package/toolkit/skills/node_modules/semver/functions/compare-loose.js +0 -5
  958. package/toolkit/skills/node_modules/semver/functions/compare.js +0 -7
  959. package/toolkit/skills/node_modules/semver/functions/diff.js +0 -60
  960. package/toolkit/skills/node_modules/semver/functions/eq.js +0 -5
  961. package/toolkit/skills/node_modules/semver/functions/gt.js +0 -5
  962. package/toolkit/skills/node_modules/semver/functions/gte.js +0 -5
  963. package/toolkit/skills/node_modules/semver/functions/inc.js +0 -21
  964. package/toolkit/skills/node_modules/semver/functions/lt.js +0 -5
  965. package/toolkit/skills/node_modules/semver/functions/lte.js +0 -5
  966. package/toolkit/skills/node_modules/semver/functions/major.js +0 -5
  967. package/toolkit/skills/node_modules/semver/functions/minor.js +0 -5
  968. package/toolkit/skills/node_modules/semver/functions/neq.js +0 -5
  969. package/toolkit/skills/node_modules/semver/functions/parse.js +0 -18
  970. package/toolkit/skills/node_modules/semver/functions/patch.js +0 -5
  971. package/toolkit/skills/node_modules/semver/functions/prerelease.js +0 -8
  972. package/toolkit/skills/node_modules/semver/functions/rcompare.js +0 -5
  973. package/toolkit/skills/node_modules/semver/functions/rsort.js +0 -5
  974. package/toolkit/skills/node_modules/semver/functions/satisfies.js +0 -12
  975. package/toolkit/skills/node_modules/semver/functions/sort.js +0 -5
  976. package/toolkit/skills/node_modules/semver/functions/truncate.js +0 -48
  977. package/toolkit/skills/node_modules/semver/functions/valid.js +0 -8
  978. package/toolkit/skills/node_modules/semver/index.js +0 -93
  979. package/toolkit/skills/node_modules/semver/internal/constants.js +0 -67
  980. package/toolkit/skills/node_modules/semver/internal/debug.js +0 -11
  981. package/toolkit/skills/node_modules/semver/internal/identifiers.js +0 -29
  982. package/toolkit/skills/node_modules/semver/internal/lrucache.js +0 -42
  983. package/toolkit/skills/node_modules/semver/internal/parse-options.js +0 -17
  984. package/toolkit/skills/node_modules/semver/internal/re.js +0 -223
  985. package/toolkit/skills/node_modules/semver/internal/trim-comparator-whitespace.js +0 -438
  986. package/toolkit/skills/node_modules/semver/package.json +0 -78
  987. package/toolkit/skills/node_modules/semver/preload.js +0 -4
  988. package/toolkit/skills/node_modules/semver/range.bnf +0 -17
  989. package/toolkit/skills/node_modules/semver/ranges/gtr.js +0 -6
  990. package/toolkit/skills/node_modules/semver/ranges/intersects.js +0 -9
  991. package/toolkit/skills/node_modules/semver/ranges/ltr.js +0 -6
  992. package/toolkit/skills/node_modules/semver/ranges/max-satisfying.js +0 -27
  993. package/toolkit/skills/node_modules/semver/ranges/min-satisfying.js +0 -26
  994. package/toolkit/skills/node_modules/semver/ranges/min-version.js +0 -63
  995. package/toolkit/skills/node_modules/semver/ranges/outside.js +0 -82
  996. package/toolkit/skills/node_modules/semver/ranges/simplify.js +0 -49
  997. package/toolkit/skills/node_modules/semver/ranges/subset.js +0 -249
  998. package/toolkit/skills/node_modules/semver/ranges/to-comparators.js +0 -10
  999. package/toolkit/skills/node_modules/semver/ranges/valid.js +0 -13
  1000. package/toolkit/skills/node_modules/sharp/LICENSE +0 -191
  1001. package/toolkit/skills/node_modules/sharp/README.md +0 -112
  1002. package/toolkit/skills/node_modules/sharp/dist/channel.cjs +0 -177
  1003. package/toolkit/skills/node_modules/sharp/dist/channel.mjs +0 -177
  1004. package/toolkit/skills/node_modules/sharp/dist/colour.cjs +0 -199
  1005. package/toolkit/skills/node_modules/sharp/dist/colour.mjs +0 -199
  1006. package/toolkit/skills/node_modules/sharp/dist/composite.cjs +0 -213
  1007. package/toolkit/skills/node_modules/sharp/dist/composite.mjs +0 -213
  1008. package/toolkit/skills/node_modules/sharp/dist/constructor.cjs +0 -511
  1009. package/toolkit/skills/node_modules/sharp/dist/constructor.mjs +0 -511
  1010. package/toolkit/skills/node_modules/sharp/dist/index.cjs +0 -25
  1011. package/toolkit/skills/node_modules/sharp/dist/index.d.cts +0 -1999
  1012. package/toolkit/skills/node_modules/sharp/dist/index.d.mts +0 -2046
  1013. package/toolkit/skills/node_modules/sharp/dist/index.mjs +0 -25
  1014. package/toolkit/skills/node_modules/sharp/dist/input.cjs +0 -819
  1015. package/toolkit/skills/node_modules/sharp/dist/input.mjs +0 -819
  1016. package/toolkit/skills/node_modules/sharp/dist/is.cjs +0 -149
  1017. package/toolkit/skills/node_modules/sharp/dist/is.mjs +0 -149
  1018. package/toolkit/skills/node_modules/sharp/dist/libvips.cjs +0 -212
  1019. package/toolkit/skills/node_modules/sharp/dist/libvips.mjs +0 -212
  1020. package/toolkit/skills/node_modules/sharp/dist/operation.cjs +0 -1002
  1021. package/toolkit/skills/node_modules/sharp/dist/operation.mjs +0 -1002
  1022. package/toolkit/skills/node_modules/sharp/dist/output.cjs +0 -1786
  1023. package/toolkit/skills/node_modules/sharp/dist/output.mjs +0 -1786
  1024. package/toolkit/skills/node_modules/sharp/dist/resize.cjs +0 -617
  1025. package/toolkit/skills/node_modules/sharp/dist/resize.mjs +0 -617
  1026. package/toolkit/skills/node_modules/sharp/dist/sharp.cjs +0 -174
  1027. package/toolkit/skills/node_modules/sharp/dist/sharp.mjs +0 -174
  1028. package/toolkit/skills/node_modules/sharp/dist/utility.cjs +0 -301
  1029. package/toolkit/skills/node_modules/sharp/dist/utility.mjs +0 -301
  1030. package/toolkit/skills/node_modules/sharp/install/build.js +0 -38
  1031. package/toolkit/skills/node_modules/sharp/lib/index.d.ts +0 -1999
  1032. package/toolkit/skills/node_modules/sharp/package.json +0 -227
  1033. package/toolkit/skills/node_modules/sharp/src/binding.gyp +0 -303
  1034. package/toolkit/skills/node_modules/sharp/src/common.cc +0 -1186
  1035. package/toolkit/skills/node_modules/sharp/src/common.h +0 -421
  1036. package/toolkit/skills/node_modules/sharp/src/metadata.cc +0 -404
  1037. package/toolkit/skills/node_modules/sharp/src/metadata.h +0 -95
  1038. package/toolkit/skills/node_modules/sharp/src/operations.cc +0 -516
  1039. package/toolkit/skills/node_modules/sharp/src/operations.h +0 -137
  1040. package/toolkit/skills/node_modules/sharp/src/pipeline.cc +0 -1973
  1041. package/toolkit/skills/node_modules/sharp/src/pipeline.h +0 -422
  1042. package/toolkit/skills/node_modules/sharp/src/sharp.cc +0 -43
  1043. package/toolkit/skills/node_modules/sharp/src/stats.cc +0 -186
  1044. package/toolkit/skills/node_modules/sharp/src/stats.h +0 -62
  1045. package/toolkit/skills/node_modules/sharp/src/utilities.cc +0 -289
  1046. package/toolkit/skills/node_modules/sharp/src/utilities.h +0 -22
@@ -1,2636 +0,0 @@
1
- import * as checks from "./checks.js";
2
- import * as core from "./core.js";
3
- import { Doc } from "./doc.js";
4
- import { parse, parseAsync } 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 defChecks = inst._zod.def.checks;
15
- // if inst is itself a checks.$ZodCheck, run it as a check
16
- const checks = inst._zod.traits.has("$ZodCheck")
17
- ? [inst, ...(defChecks ?? [])]
18
- : defChecks?.length
19
- ? [...defChecks]
20
- : [];
21
- for (const ch of checks) {
22
- for (const fn of ch._zod.onattach) {
23
- fn(inst);
24
- }
25
- }
26
- if (checks.length === 0) {
27
- // deferred initializer inst._zod.parse is not yet defined
28
- (_a = inst._zod).deferred ?? (_a.deferred = []);
29
- inst._zod.deferred?.push(() => {
30
- inst._zod.run = inst._zod.parse;
31
- });
32
- }
33
- else {
34
- const runChecks = (payload, checks, ctx) => {
35
- if (payload.memo)
36
- return payload;
37
- let isAborted = util.aborted(payload);
38
- let asyncResult;
39
- for (const ch of checks) {
40
- if (ch._zod.def.when) {
41
- if (util.explicitlyAborted(payload))
42
- continue;
43
- const shouldRun = ch._zod.def.when(payload);
44
- if (!shouldRun)
45
- continue;
46
- }
47
- else if (isAborted) {
48
- continue;
49
- }
50
- const currLen = payload.issues.length;
51
- const _ = ch._zod.check(payload);
52
- if (_ instanceof Promise && ctx?.async === false) {
53
- throw new core.$ZodAsyncError();
54
- }
55
- if (asyncResult || _ instanceof Promise) {
56
- asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
57
- await _;
58
- const nextLen = payload.issues.length;
59
- if (nextLen === currLen)
60
- return;
61
- util.attachSchema(payload.issues, currLen, inst);
62
- if (!isAborted)
63
- isAborted = util.aborted(payload, currLen);
64
- });
65
- }
66
- else {
67
- const nextLen = payload.issues.length;
68
- if (nextLen === currLen)
69
- continue;
70
- util.attachSchema(payload.issues, currLen, inst);
71
- if (!isAborted)
72
- isAborted = util.aborted(payload, currLen);
73
- }
74
- }
75
- if (asyncResult) {
76
- return asyncResult.then(() => {
77
- return payload;
78
- });
79
- }
80
- return payload;
81
- };
82
- const handleCanaryResult = (canary, payload, ctx) => {
83
- // abort if the canary is aborted
84
- if (util.aborted(canary)) {
85
- canary.aborted = true;
86
- return canary;
87
- }
88
- // run checks first, then
89
- const checkResult = runChecks(payload, checks, ctx);
90
- if (checkResult instanceof Promise) {
91
- if (ctx.async === false)
92
- throw new core.$ZodAsyncError();
93
- return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));
94
- }
95
- return inst._zod.parse(checkResult, ctx);
96
- };
97
- inst._zod.run = (payload, ctx) => {
98
- if (ctx.skipChecks) {
99
- return inst._zod.parse(payload, ctx);
100
- }
101
- if (ctx.direction === "backward") {
102
- // run canary initial pass (no checks)
103
- const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });
104
- if (canary instanceof Promise) {
105
- return canary.then((canary) => {
106
- return handleCanaryResult(canary, payload, ctx);
107
- });
108
- }
109
- return handleCanaryResult(canary, payload, ctx);
110
- }
111
- // forward
112
- const result = inst._zod.parse(payload, ctx);
113
- if (result instanceof Promise) {
114
- if (ctx.async === false)
115
- throw new core.$ZodAsyncError();
116
- return result.then((result) => runChecks(result, checks, ctx));
117
- }
118
- return runChecks(result, checks, ctx);
119
- };
120
- }
121
- }, {
122
- // Wrappers extend this by installing a richer factory over it; reading it eagerly would defeat the laziness.
123
- get "~standard"() {
124
- return util.hide(this, "~standard", standardProps(this));
125
- },
126
- set "~standard"(value) {
127
- util.own(this, "~standard", value);
128
- },
129
- });
130
- /** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */
131
- // a Standard Schema result only reports issues, so a failure finalizes them straight off the raw payload: no ZodError, and no lazy result to read through
132
- const toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())) } : { value: r.value };
133
- async function validateAsync(inst, value) {
134
- const ctx = { async: true };
135
- return toStandardResult((await inst._zod.run({ value, issues: [] }, ctx)), ctx);
136
- }
137
- export function standardProps(inst) {
138
- return {
139
- validate: (value) => {
140
- const ctx = { async: false };
141
- try {
142
- const r = inst._zod.run({ value, issues: [] }, ctx);
143
- if (!(r instanceof Promise))
144
- return toStandardResult(r, ctx);
145
- }
146
- catch (_) { }
147
- // async function so a synchronously throwing check rejects instead of escaping validate
148
- return validateAsync(inst, value);
149
- },
150
- vendor: "zod",
151
- version: 1,
152
- };
153
- }
154
- export { clone } from "./util.js";
155
- export const $ZodString = /*@__PURE__*/ core.$constructor("$ZodString", (inst, def) => {
156
- $ZodType.init(inst, def);
157
- // a format's own pattern, else unbounded; a template literal derives the check-aware form itself
158
- inst._zod.pattern = def.pattern ?? regexes.anyString;
159
- inst._zod.parse = (payload, _) => {
160
- if (def.coerce)
161
- try {
162
- payload.value = String(payload.value);
163
- }
164
- catch (_) { }
165
- if (typeof payload.value === "string")
166
- return payload;
167
- payload.issues.push({
168
- expected: "string",
169
- code: "invalid_type",
170
- input: payload.value,
171
- inst,
172
- });
173
- return payload;
174
- };
175
- });
176
- export const $ZodStringFormat = /*@__PURE__*/ core.$constructor("$ZodStringFormat", (inst, def) => {
177
- // check initialization must come first
178
- checks.$ZodCheckStringFormat.init(inst, def);
179
- $ZodString.init(inst, def);
180
- });
181
- export const $ZodGUID = /*@__PURE__*/ core.$constructor("$ZodGUID", (inst, def) => {
182
- def.pattern ?? (def.pattern = regexes.guid);
183
- $ZodStringFormat.init(inst, def);
184
- });
185
- export const $ZodUUID = /*@__PURE__*/ core.$constructor("$ZodUUID", (inst, def) => {
186
- if (def.version) {
187
- const versionMap = {
188
- v1: 1,
189
- v2: 2,
190
- v3: 3,
191
- v4: 4,
192
- v5: 5,
193
- v6: 6,
194
- v7: 7,
195
- v8: 8,
196
- };
197
- const v = versionMap[def.version];
198
- if (v === undefined)
199
- throw new Error(`Invalid UUID version: "${def.version}"`);
200
- def.pattern ?? (def.pattern = regexes.uuid(v));
201
- }
202
- else
203
- def.pattern ?? (def.pattern = regexes.uuid());
204
- $ZodStringFormat.init(inst, def);
205
- });
206
- export const $ZodEmail = /*@__PURE__*/ core.$constructor("$ZodEmail", (inst, def) => {
207
- def.pattern ?? (def.pattern = regexes.email);
208
- $ZodStringFormat.init(inst, def);
209
- });
210
- /** The `://` guard rejected the input before the URL constructor saw it. */
211
- export const URL_BAD_FORMAT = 1;
212
- /** The URL parser rejected the input. */
213
- export const URL_UNPARSEABLE = 2;
214
- export function canParseURL(input) {
215
- try {
216
- if (typeof URL !== "undefined" && typeof URL.canParse === "function")
217
- return URL.canParse(input);
218
- new URL(input);
219
- return true;
220
- }
221
- catch {
222
- return false;
223
- }
224
- }
225
- export function validateURL(trimmed, def) {
226
- if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) {
227
- return canParseURL(trimmed) || URL_UNPARSEABLE;
228
- }
229
- return parseURLObject(trimmed, def);
230
- }
231
- /** Parses a URL while preserving the non-normalizing HTTP guard. */
232
- export function parseURLObject(trimmed, def) {
233
- // When normalize is off, require :// for http/https URLs. This prevents strings like "http:example.com" or "https:/path" from being silently accepted
234
- if (!def.normalize && def.protocol?.source === regexes.httpProtocol.source && !/^https?:\/\//i.test(trimmed)) {
235
- return URL_BAD_FORMAT;
236
- }
237
- try {
238
- if (typeof URL !== "undefined") {
239
- const URLStatic = URL;
240
- if (typeof URLStatic.parse === "function")
241
- return URLStatic.parse(trimmed) ?? URL_UNPARSEABLE;
242
- }
243
- // @ts-ignore
244
- return new URL(trimmed);
245
- }
246
- catch {
247
- return URL_UNPARSEABLE;
248
- }
249
- }
250
- const asciiTabOrNewline = /[\t\n\r]/g;
251
- /** The URL parser deletes every ASCII tab, LF and CR from its input before it parses, so `new URL("https://exa\nmple.com")` reports on `example.com`. Applying the same deletion to the returned value closes the half of that divergence which can move the host; the parser's other rewrite, stripping C0 controls at the edges, cannot. */
252
- export function stripTabAndNewline(value) {
253
- return value.replace(asciiTabOrNewline, "");
254
- }
255
- export function urlHostnameOk(url, hostname) {
256
- hostname.lastIndex = 0;
257
- return hostname.test(url.hostname);
258
- }
259
- export function urlProtocolOk(url, protocol) {
260
- protocol.lastIndex = 0;
261
- return protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol);
262
- }
263
- export const $ZodURL = /*@__PURE__*/ core.$constructor("$ZodURL", (inst, def) => {
264
- $ZodStringFormat.init(inst, def);
265
- inst._zod.check = (payload) => {
266
- try {
267
- // Trim whitespace from input
268
- const trimmed = payload.value.trim();
269
- const url = validateURL(trimmed, def);
270
- if (url === URL_BAD_FORMAT) {
271
- payload.issues.push({
272
- code: "invalid_format",
273
- format: "url",
274
- note: "Invalid URL format",
275
- input: payload.value,
276
- inst,
277
- continue: !def.abort,
278
- });
279
- return;
280
- }
281
- if (url === URL_UNPARSEABLE) {
282
- payload.issues.push({
283
- code: "invalid_format",
284
- format: "url",
285
- input: payload.value,
286
- inst,
287
- continue: !def.abort,
288
- });
289
- return;
290
- }
291
- if (url === true) {
292
- payload.value = stripTabAndNewline(trimmed);
293
- return;
294
- }
295
- if (def.hostname && !urlHostnameOk(url, def.hostname)) {
296
- payload.issues.push({
297
- code: "invalid_format",
298
- format: "url",
299
- note: "Invalid hostname",
300
- pattern: def.hostname.source,
301
- input: payload.value,
302
- inst,
303
- continue: !def.abort,
304
- });
305
- }
306
- if (def.protocol && !urlProtocolOk(url, def.protocol)) {
307
- payload.issues.push({
308
- code: "invalid_format",
309
- format: "url",
310
- note: "Invalid protocol",
311
- pattern: def.protocol.source,
312
- input: payload.value,
313
- inst,
314
- continue: !def.abort,
315
- });
316
- }
317
- // Set the output value based on normalize flag
318
- payload.value = def.normalize ? url.href : stripTabAndNewline(trimmed);
319
- return;
320
- }
321
- catch (_) {
322
- payload.issues.push({
323
- code: "invalid_format",
324
- format: "url",
325
- input: payload.value,
326
- inst,
327
- continue: !def.abort,
328
- });
329
- }
330
- };
331
- });
332
- export const $ZodEmoji = /*@__PURE__*/ core.$constructor("$ZodEmoji", (inst, def) => {
333
- def.pattern ?? (def.pattern = regexes.emoji());
334
- $ZodStringFormat.init(inst, def);
335
- });
336
- export const $ZodNanoID = /*@__PURE__*/ core.$constructor("$ZodNanoID", (inst, def) => {
337
- if (def.length !== undefined && (!Number.isInteger(def.length) || def.length < 1))
338
- throw new Error(`Invalid nanoid length: ${def.length}`);
339
- def.pattern ?? (def.pattern = def.length === undefined ? regexes.nanoid : regexes.nanoidOfLength(def.length));
340
- $ZodStringFormat.init(inst, def);
341
- });
342
- /**
343
- * @deprecated CUID v1 is deprecated by its authors due to information leakage
344
- * (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
345
- * See https://github.com/paralleldrive/cuid.
346
- */
347
- export const $ZodCUID = /*@__PURE__*/ core.$constructor("$ZodCUID", (inst, def) => {
348
- def.pattern ?? (def.pattern = regexes.cuid);
349
- $ZodStringFormat.init(inst, def);
350
- });
351
- export const $ZodCUID2 = /*@__PURE__*/ core.$constructor("$ZodCUID2", (inst, def) => {
352
- def.pattern ?? (def.pattern = regexes.cuid2);
353
- $ZodStringFormat.init(inst, def);
354
- });
355
- export const $ZodULID = /*@__PURE__*/ core.$constructor("$ZodULID", (inst, def) => {
356
- def.pattern ?? (def.pattern = regexes.ulid);
357
- $ZodStringFormat.init(inst, def);
358
- });
359
- export const $ZodXID = /*@__PURE__*/ core.$constructor("$ZodXID", (inst, def) => {
360
- def.pattern ?? (def.pattern = regexes.xid);
361
- $ZodStringFormat.init(inst, def);
362
- });
363
- export const $ZodKSUID = /*@__PURE__*/ core.$constructor("$ZodKSUID", (inst, def) => {
364
- def.pattern ?? (def.pattern = regexes.ksuid);
365
- $ZodStringFormat.init(inst, def);
366
- });
367
- export const $ZodISODateTime = /*@__PURE__*/ core.$constructor("$ZodISODateTime", (inst, def) => {
368
- def.pattern ?? (def.pattern = regexes.datetime(def));
369
- $ZodStringFormat.init(inst, def);
370
- });
371
- export const $ZodISODate = /*@__PURE__*/ core.$constructor("$ZodISODate", (inst, def) => {
372
- def.pattern ?? (def.pattern = regexes.date);
373
- $ZodStringFormat.init(inst, def);
374
- });
375
- export const $ZodISOTime = /*@__PURE__*/ core.$constructor("$ZodISOTime", (inst, def) => {
376
- def.pattern ?? (def.pattern = regexes.time(def));
377
- $ZodStringFormat.init(inst, def);
378
- });
379
- export const $ZodISODuration = /*@__PURE__*/ core.$constructor("$ZodISODuration", (inst, def) => {
380
- def.pattern ?? (def.pattern = regexes.duration);
381
- $ZodStringFormat.init(inst, def);
382
- });
383
- export const $ZodIPv4 = /*@__PURE__*/ core.$constructor("$ZodIPv4", (inst, def) => {
384
- def.pattern ?? (def.pattern = regexes.ipv4);
385
- $ZodStringFormat.init(inst, def);
386
- });
387
- /** An IPv6 address is written with hex digits, colons and dots, and nothing else. The guard is what makes the check below an IPv6 check: `new URL("http://[...]")` parses an authority, not an address, so `@` and `\` re-delimit it and `"::@1\\"` validates against the host `0.0.0.1`. The URL parser also deletes ASCII tab, LF and CR rather than failing, which is how `"::1\n"` validated as `::1`. */
388
- const ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
389
- export function isValidIPv6(value) {
390
- if (!ipv6Alphabet.test(value))
391
- return false;
392
- return canParseURL(`http://[${value}]`);
393
- }
394
- export const $ZodIPv6 = /*@__PURE__*/ core.$constructor("$ZodIPv6", (inst, def) => {
395
- def.pattern ?? (def.pattern = regexes.ipv6);
396
- $ZodStringFormat.init(inst, def);
397
- inst._zod.check = (payload) => {
398
- if (!isValidIPv6(payload.value)) {
399
- payload.issues.push({
400
- code: "invalid_format",
401
- format: "ipv6",
402
- input: payload.value,
403
- inst,
404
- continue: !def.abort,
405
- });
406
- }
407
- };
408
- });
409
- export const $ZodMAC = /*@__PURE__*/ core.$constructor("$ZodMAC", (inst, def) => {
410
- def.pattern ?? (def.pattern = regexes.mac(def.delimiter));
411
- $ZodStringFormat.init(inst, def);
412
- });
413
- export const $ZodCIDRv4 = /*@__PURE__*/ core.$constructor("$ZodCIDRv4", (inst, def) => {
414
- def.pattern ?? (def.pattern = regexes.cidrv4);
415
- $ZodStringFormat.init(inst, def);
416
- });
417
- export function isValidCIDRv6(value) {
418
- const parts = value.split("/");
419
- if (parts.length !== 2)
420
- return false;
421
- const [address, prefix] = parts;
422
- if (!prefix)
423
- return false;
424
- const prefixNum = Number(prefix);
425
- if (`${prefixNum}` !== prefix)
426
- return false;
427
- if (prefixNum < 0 || prefixNum > 128)
428
- return false;
429
- return isValidIPv6(address);
430
- }
431
- export const $ZodCIDRv6 = /*@__PURE__*/ core.$constructor("$ZodCIDRv6", (inst, def) => {
432
- def.pattern ?? (def.pattern = regexes.cidrv6); // not used for validation
433
- $ZodStringFormat.init(inst, def);
434
- inst._zod.check = (payload) => {
435
- if (!isValidCIDRv6(payload.value)) {
436
- payload.issues.push({
437
- code: "invalid_format",
438
- format: "cidrv6",
439
- input: payload.value,
440
- inst,
441
- continue: !def.abort,
442
- });
443
- }
444
- };
445
- });
446
- ////////////////////////////// ZodBase64 //////////////////////////////
447
- export function isValidBase64(data) {
448
- if (data === "")
449
- return true;
450
- // atob ignores whitespace, so reject it up front.
451
- if (/\s/.test(data))
452
- return false;
453
- if (data.length % 4 !== 0)
454
- return false;
455
- try {
456
- // @ts-ignore
457
- atob(data);
458
- return true;
459
- }
460
- catch {
461
- return false;
462
- }
463
- }
464
- // lax on purpose: the quantified regexes.base64 overflows the regex stack on multi-MB input and its leading ^$| alternation leaks through template-literal composition; isValidBase64 enforces length and padding
465
- export const base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
466
- export const $ZodBase64 = /*@__PURE__*/ core.$constructor("$ZodBase64", (inst, def) => {
467
- def.pattern ?? (def.pattern = base64Charset);
468
- $ZodStringFormat.init(inst, def);
469
- inst._zod.check = (payload) => {
470
- if (isValidBase64(payload.value))
471
- return;
472
- payload.issues.push({
473
- code: "invalid_format",
474
- format: "base64",
475
- input: payload.value,
476
- inst,
477
- continue: !def.abort,
478
- });
479
- };
480
- });
481
- ////////////////////////////// ZodBase64URL //////////////////////////////
482
- // lax on purpose: the quantified regexes.base64url overflows the regex stack on multi-MB input; isValidBase64 enforces length on the padded string
483
- export const base64urlCharset = /^[A-Za-z0-9_-]*$/;
484
- export function isValidBase64URL(data) {
485
- if (!base64urlCharset.test(data))
486
- return false;
487
- const base64 = data.replace(/[-_]/g, (c) => (c === "-" ? "+" : "/"));
488
- const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "=");
489
- return isValidBase64(padded);
490
- }
491
- export const $ZodBase64URL = /*@__PURE__*/ core.$constructor("$ZodBase64URL", (inst, def) => {
492
- def.pattern ?? (def.pattern = base64urlCharset);
493
- $ZodStringFormat.init(inst, def);
494
- inst._zod.check = (payload) => {
495
- if (isValidBase64URL(payload.value))
496
- return;
497
- payload.issues.push({
498
- code: "invalid_format",
499
- format: "base64url",
500
- input: payload.value,
501
- inst,
502
- continue: !def.abort,
503
- });
504
- };
505
- });
506
- export const $ZodE164 = /*@__PURE__*/ core.$constructor("$ZodE164", (inst, def) => {
507
- def.pattern ?? (def.pattern = regexes.e164);
508
- $ZodStringFormat.init(inst, def);
509
- });
510
- ////////////////////////////// ZodCreditCard //////////////////////////////
511
- const CC_SANITIZE = /[- ]/g;
512
- /** Luhn checksum on a digit-only string. Adapted from valibot (MIT). */
513
- function isLuhnAlgo(digits) {
514
- let length = digits.length;
515
- let bit = 1;
516
- let sum = 0;
517
- while (length) {
518
- const value = digits.charCodeAt(--length) - 48;
519
- bit ^= 1;
520
- sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value] : value;
521
- }
522
- return sum % 10 === 0;
523
- }
524
- export function isValidCreditCard(input) {
525
- if (!regexes.creditCard.test(input))
526
- return false;
527
- return isLuhnAlgo(input.replace(CC_SANITIZE, ""));
528
- }
529
- export const $ZodCreditCard = /*@__PURE__*/ core.$constructor("$ZodCreditCard", (inst, def) => {
530
- // Shape only — the Luhn check below is not expressible as a pattern, so consumers of `pattern` (JSON Schema, template literals) get the length and separator rules alone.
531
- def.pattern ?? (def.pattern = regexes.creditCard);
532
- $ZodStringFormat.init(inst, def);
533
- inst._zod.check = (payload) => {
534
- if (isValidCreditCard(payload.value))
535
- return;
536
- payload.issues.push({
537
- code: "invalid_format",
538
- format: "credit_card",
539
- input: payload.value,
540
- inst,
541
- continue: !def.abort,
542
- });
543
- };
544
- });
545
- ////////////////////////////// ZodIBAN //////////////////////////////
546
- // iso 7064 mod 97-10 checksum without BigInt
547
- function isIso7064Mod97(iban) {
548
- let remainder = 0;
549
- const len = iban.length;
550
- for (let i = 4; i < len; i++) {
551
- const code = iban.charCodeAt(i);
552
- remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
553
- }
554
- for (let i = 0; i < 4; i++) {
555
- const code = iban.charCodeAt(i);
556
- remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
557
- }
558
- return remainder === 1;
559
- }
560
- export function isValidIBAN(input) {
561
- if (!regexes.iban.test(input))
562
- return false;
563
- return isIso7064Mod97(input);
564
- }
565
- export const $ZodIBAN = /*@__PURE__*/ core.$constructor("$ZodIBAN", (inst, def) => {
566
- // shape only — checksum is not expressible as a pattern
567
- def.pattern ?? (def.pattern = regexes.iban);
568
- $ZodStringFormat.init(inst, def);
569
- inst._zod.check = (payload) => {
570
- if (isValidIBAN(payload.value))
571
- return;
572
- payload.issues.push({
573
- code: "invalid_format",
574
- format: "iban",
575
- input: payload.value,
576
- inst,
577
- continue: !def.abort,
578
- });
579
- };
580
- });
581
- ////////////////////////////// ZodJWT //////////////////////////////
582
- export function isValidJWT(token, algorithm = null) {
583
- try {
584
- const tokensParts = token.split(".");
585
- if (tokensParts.length !== 3)
586
- return false;
587
- const [header] = tokensParts;
588
- if (!header)
589
- return false;
590
- // @ts-ignore
591
- const parsedHeader = JSON.parse(atob(header));
592
- if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT")
593
- return false;
594
- if (!parsedHeader.alg)
595
- return false;
596
- if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm))
597
- return false;
598
- return true;
599
- }
600
- catch {
601
- return false;
602
- }
603
- }
604
- export const $ZodJWT = /*@__PURE__*/ core.$constructor("$ZodJWT", (inst, def) => {
605
- $ZodStringFormat.init(inst, def);
606
- inst._zod.check = (payload) => {
607
- if (isValidJWT(payload.value, def.alg))
608
- return;
609
- payload.issues.push({
610
- code: "invalid_format",
611
- format: "jwt",
612
- input: payload.value,
613
- inst,
614
- continue: !def.abort,
615
- });
616
- };
617
- });
618
- export const $ZodCustomStringFormat = /*@__PURE__*/ core.$constructor("$ZodCustomStringFormat", (inst, def) => {
619
- $ZodStringFormat.init(inst, def);
620
- inst._zod.check = (payload) => {
621
- if (def.fn(payload.value))
622
- return;
623
- payload.issues.push({
624
- code: "invalid_format",
625
- format: def.format,
626
- input: payload.value,
627
- inst,
628
- continue: !def.abort,
629
- });
630
- };
631
- });
632
- export const $ZodNumber = /*@__PURE__*/ core.$constructor("$ZodNumber", (inst, def) => {
633
- $ZodType.init(inst, def);
634
- inst._zod.pattern = regexes.number;
635
- inst._zod.parse = (payload, _ctx) => {
636
- if (def.coerce)
637
- try {
638
- payload.value = Number(payload.value);
639
- }
640
- catch (_) { }
641
- const input = payload.value;
642
- if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) {
643
- return payload;
644
- }
645
- const received = typeof input === "number"
646
- ? Number.isNaN(input)
647
- ? "NaN"
648
- : !Number.isFinite(input)
649
- ? String(input)
650
- : undefined
651
- : undefined;
652
- payload.issues.push({
653
- expected: "number",
654
- code: "invalid_type",
655
- input,
656
- inst,
657
- ...(received ? { received } : {}),
658
- });
659
- return payload;
660
- };
661
- });
662
- export const $ZodNumberFormat = /*@__PURE__*/ core.$constructor("$ZodNumberFormat", (inst, def) => {
663
- checks.$ZodCheckNumberFormat.init(inst, def);
664
- $ZodNumber.init(inst, def); // no format checks
665
- });
666
- export const $ZodBoolean = /*@__PURE__*/ core.$constructor("$ZodBoolean", (inst, def) => {
667
- $ZodType.init(inst, def);
668
- inst._zod.pattern = regexes.boolean;
669
- inst._zod.parse = (payload, _ctx) => {
670
- if (def.coerce)
671
- try {
672
- payload.value = Boolean(payload.value);
673
- }
674
- catch (_) { }
675
- const input = payload.value;
676
- if (typeof input === "boolean")
677
- return payload;
678
- payload.issues.push({
679
- expected: "boolean",
680
- code: "invalid_type",
681
- input,
682
- inst,
683
- });
684
- return payload;
685
- };
686
- });
687
- export const $ZodBigInt = /*@__PURE__*/ core.$constructor("$ZodBigInt", (inst, def) => {
688
- $ZodType.init(inst, def);
689
- inst._zod.pattern = regexes.bigint;
690
- inst._zod.parse = (payload, _ctx) => {
691
- if (def.coerce)
692
- try {
693
- payload.value = BigInt(payload.value);
694
- }
695
- catch (_) { }
696
- if (typeof payload.value === "bigint")
697
- return payload;
698
- payload.issues.push({
699
- expected: "bigint",
700
- code: "invalid_type",
701
- input: payload.value,
702
- inst,
703
- });
704
- return payload;
705
- };
706
- });
707
- export const $ZodBigIntFormat = /*@__PURE__*/ core.$constructor("$ZodBigIntFormat", (inst, def) => {
708
- checks.$ZodCheckBigIntFormat.init(inst, def);
709
- $ZodBigInt.init(inst, def); // no format checks
710
- });
711
- export const $ZodSymbol = /*@__PURE__*/ core.$constructor("$ZodSymbol", (inst, def) => {
712
- $ZodType.init(inst, def);
713
- inst._zod.parse = (payload, _ctx) => {
714
- const input = payload.value;
715
- if (typeof input === "symbol")
716
- return payload;
717
- payload.issues.push({
718
- expected: "symbol",
719
- code: "invalid_type",
720
- input,
721
- inst,
722
- });
723
- return payload;
724
- };
725
- });
726
- export const $ZodUndefined = /*@__PURE__*/ core.$constructor("$ZodUndefined", (inst, def) => {
727
- $ZodType.init(inst, def);
728
- inst._zod.pattern = regexes.undefined;
729
- inst._zod.values = new Set([undefined]);
730
- inst._zod.parse = (payload, _ctx) => {
731
- const input = payload.value;
732
- if (typeof input === "undefined")
733
- return payload;
734
- payload.issues.push({
735
- expected: "undefined",
736
- code: "invalid_type",
737
- input,
738
- inst,
739
- });
740
- return payload;
741
- };
742
- });
743
- export const $ZodNull = /*@__PURE__*/ core.$constructor("$ZodNull", (inst, def) => {
744
- $ZodType.init(inst, def);
745
- inst._zod.pattern = regexes.null;
746
- inst._zod.values = new Set([null]);
747
- inst._zod.parse = (payload, _ctx) => {
748
- const input = payload.value;
749
- if (input === null)
750
- return payload;
751
- payload.issues.push({
752
- expected: "null",
753
- code: "invalid_type",
754
- input,
755
- inst,
756
- });
757
- return payload;
758
- };
759
- });
760
- export const $ZodAny = /*@__PURE__*/ core.$constructor("$ZodAny", (inst, def) => {
761
- $ZodType.init(inst, def);
762
- inst._zod.parse = (payload) => payload;
763
- });
764
- export const $ZodUnknown = /*@__PURE__*/ core.$constructor("$ZodUnknown", (inst, def) => {
765
- $ZodType.init(inst, def);
766
- inst._zod.parse = (payload) => payload;
767
- });
768
- export const $ZodNever = /*@__PURE__*/ core.$constructor("$ZodNever", (inst, def) => {
769
- $ZodType.init(inst, def);
770
- inst._zod.parse = (payload, _ctx) => {
771
- payload.issues.push({
772
- expected: "never",
773
- code: "invalid_type",
774
- input: payload.value,
775
- inst,
776
- });
777
- return payload;
778
- };
779
- });
780
- export const $ZodVoid = /*@__PURE__*/ core.$constructor("$ZodVoid", (inst, def) => {
781
- $ZodType.init(inst, def);
782
- inst._zod.parse = (payload, _ctx) => {
783
- const input = payload.value;
784
- if (typeof input === "undefined")
785
- return payload;
786
- payload.issues.push({
787
- expected: "void",
788
- code: "invalid_type",
789
- input,
790
- inst,
791
- });
792
- return payload;
793
- };
794
- });
795
- export const $ZodDate = /*@__PURE__*/ core.$constructor("$ZodDate", (inst, def) => {
796
- $ZodType.init(inst, def);
797
- inst._zod.parse = (payload, _ctx) => {
798
- if (def.coerce) {
799
- try {
800
- payload.value = new Date(payload.value);
801
- }
802
- catch (_err) { }
803
- }
804
- const input = payload.value;
805
- const isDate = input instanceof Date;
806
- const isValidDate = isDate && !Number.isNaN(input.getTime());
807
- if (isValidDate)
808
- return payload;
809
- payload.issues.push({
810
- expected: "date",
811
- code: "invalid_type",
812
- input,
813
- ...(isDate ? { received: "Invalid Date" } : {}),
814
- inst,
815
- });
816
- return payload;
817
- };
818
- });
819
- // an oversized container fails its leading size checks before any element is parsed
820
- function capSize(inst, size) {
821
- const caps = util.sizeCaps(inst._zod.def.checks);
822
- if (!caps.length)
823
- return;
824
- const cap = Math.min(...caps.map((c) => c[0]));
825
- const parse = inst._zod.parse;
826
- inst._zod.parse = (payload, ctx) => {
827
- const n = size(payload.value);
828
- if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
829
- for (const [max, ch] of util.sizeCaps(inst._zod.def.checks)) {
830
- if (n > max && ch._zod.def.when(payload)) {
831
- const start = payload.issues.length;
832
- ch._zod.check(payload);
833
- // the value is still the raw input, so no later check may read it
834
- payload.issues[start].continue = false;
835
- util.attachSchema(payload.issues, start, inst);
836
- return payload;
837
- }
838
- }
839
- }
840
- return parse(payload, ctx);
841
- };
842
- }
843
- const arraySize = (input) => (Array.isArray(input) ? input.length : -1);
844
- const mapSize = (input) => (input instanceof Map ? input.size : -1);
845
- const setSize = (input) => (input instanceof Set ? input.size : -1);
846
- function handleArrayResult(result, final, index) {
847
- if (result.issues.length) {
848
- final.issues.push(...util.prefixIssues(index, result.issues));
849
- }
850
- final.value[index] = result.value;
851
- }
852
- export const $ZodArray = /*@__PURE__*/ core.$constructor("$ZodArray", (inst, def) => {
853
- $ZodType.init(inst, def);
854
- const memo = core.globalConfig.memoizer;
855
- memo?.attach(inst);
856
- inst._zod.parse = (payload, ctx) => {
857
- const input = payload.value;
858
- if (!Array.isArray(input)) {
859
- payload.issues.push({
860
- expected: "array",
861
- code: "invalid_type",
862
- input,
863
- inst,
864
- });
865
- return payload;
866
- }
867
- payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
868
- const proms = [];
869
- const abortEarly = ctx?.abortEarly;
870
- for (let i = 0; i < input.length; i++) {
871
- const item = input[i];
872
- const result = def.element._zod.run({
873
- value: item,
874
- issues: [],
875
- }, ctx);
876
- if (result instanceof Promise) {
877
- proms.push(result.then((result) => handleArrayResult(result, payload, i)));
878
- }
879
- else {
880
- handleArrayResult(result, payload, i);
881
- // the element's payload is authoritative here, since handleArrayResult forwards every issue; an object's is not, because it drops a failed absent optional
882
- if (abortEarly && result.issues.length !== 0 && util.aborted(result))
883
- break;
884
- }
885
- }
886
- if (proms.length) {
887
- return Promise.all(proms).then(() => payload);
888
- }
889
- return payload; //handleArrayResultsAsync(parseResults, final);
890
- };
891
- capSize(inst, arraySize);
892
- });
893
- function handlePropertyResult(result, final, key, input, optin, optout) {
894
- const isPresent = key in input;
895
- const isOptionalOut = optout === "optional";
896
- // The middle rung means "absence permitted, nothing supplied in its place", so an absent key contributes nothing — whatever the schema made of `undefined` is invented, not substituted. Only `optional` reaches this with a value: `defaulted` substitutes, and a schema that isn't optional-out has to keep the key.
897
- if (!isPresent && isOptionalOut && optin === "optional") {
898
- return;
899
- }
900
- if (result.issues.length) {
901
- // For optional-in/out schemas, ignore errors on absent keys.
902
- if (optin !== undefined && isOptionalOut && !isPresent) {
903
- return;
904
- }
905
- final.issues.push(...util.prefixIssues(key, result.issues));
906
- }
907
- if (!isPresent && optin === undefined) {
908
- if (!result.issues.length) {
909
- final.issues.push({
910
- code: "invalid_type",
911
- expected: "nonoptional",
912
- input: undefined,
913
- path: [key],
914
- });
915
- }
916
- return;
917
- }
918
- if (result.value === undefined) {
919
- if (isPresent || (optin === "defaulted" && !isOptionalOut)) {
920
- final.value[key] = undefined;
921
- }
922
- }
923
- else {
924
- final.value[key] = result.value;
925
- }
926
- }
927
- // one shared instance; a fresh [] per schema cost 56 bytes retained
928
- const NO_SYMBOL_KEYS = [];
929
- function normalizeDef(def) {
930
- const keys = Object.keys(def.shape);
931
- const ownSymbols = Object.getOwnPropertySymbols(def.shape);
932
- const symbolKeys = ownSymbols.length ? ownSymbols : NO_SYMBOL_KEYS;
933
- // aliases `keys` when there are no symbols, so a string-only shape keeps one array
934
- const allKeys = symbolKeys.length ? [...keys, ...symbolKeys] : keys;
935
- for (const k of allKeys) {
936
- if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) {
937
- throw new Error(`Invalid element at key "${String(k)}": expected a Zod schema`);
938
- }
939
- }
940
- const okeys = util.optionalKeys(def.shape);
941
- return {
942
- ...def,
943
- allKeys,
944
- symbolKeys,
945
- // string-only: handleCatchall matches it against `for...in`, which never yields a symbol
946
- keySet: new Set(keys),
947
- numKeys: keys.length,
948
- optionalKeys: new Set(okeys),
949
- };
950
- }
951
- function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
952
- const unrecognized = [];
953
- const keySet = def.keySet;
954
- const _catchall = def.catchall._zod;
955
- const t = _catchall.def.type;
956
- const optin = _catchall.optin;
957
- const optout = _catchall.optout;
958
- // starts at 0, not the current length: the shape phase already ran and may have aborted
959
- let seen = 0;
960
- for (const key in input) {
961
- if (abortEarly && payload.issues.length !== seen) {
962
- if (util.aborted(payload, seen))
963
- break;
964
- seen = payload.issues.length;
965
- }
966
- // Must precede the __proto__ branch: a declared key is not unrecognized, even though the shape loop deliberately strips __proto__ from the parsed output.
967
- if (keySet.has(key))
968
- continue;
969
- // Don't copy an undeclared __proto__ into the result; assignment to a plain {} would replace the result prototype. But in strict mode it is still an unknown key, so report it before skipping.
970
- if (key === "__proto__") {
971
- if (t === "never")
972
- unrecognized.push(key);
973
- continue;
974
- }
975
- if (t === "never") {
976
- unrecognized.push(key);
977
- continue;
978
- }
979
- const r = _catchall.run({ value: input[key], issues: [] }, ctx);
980
- if (r instanceof Promise) {
981
- proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
982
- }
983
- else {
984
- handlePropertyResult(r, payload, key, input, optin, optout);
985
- }
986
- }
987
- if (unrecognized.length) {
988
- payload.issues.push({
989
- code: "unrecognized_keys",
990
- keys: unrecognized,
991
- input,
992
- inst,
993
- // Describes the shape of the input, not the validity of the parsed value, so it never aborts. The parse still fails; the schema's own checks just get to run first, and an enclosing intersection can reconcile the key against a sibling operand.
994
- continue: true,
995
- });
996
- }
997
- if (!proms.length)
998
- return payload;
999
- return Promise.all(proms).then(() => {
1000
- return payload;
1001
- });
1002
- }
1003
- export const $ZodObject = /*@__PURE__*/ core.$constructor("$ZodObject", (inst, def) => {
1004
- // requires cast because technically $ZodObject doesn't extend
1005
- $ZodType.init(inst, def);
1006
- const desc = Object.getOwnPropertyDescriptor(def, "shape");
1007
- // a cloned def carries its source's accessor, which knows the shape it answers from; adopting that keeps the clone's keys readable without running it
1008
- const sh = desc?.get ? desc.get.raw : (def.shape ?? {});
1009
- if (sh) {
1010
- // Freezes the shape on first read, so its getters resolve once and every later read sees the same schemas.
1011
- const get = () => {
1012
- const newSh = { ...sh };
1013
- Object.defineProperty(def, "shape", { value: newSh });
1014
- get.raw = newSh;
1015
- return newSh;
1016
- };
1017
- get.raw = sh;
1018
- Object.defineProperty(def, "shape", { get });
1019
- }
1020
- const _normalized = util.cached(() => normalizeDef(def));
1021
- util.defineLazyInternal(inst, "propValues", (zod) => {
1022
- const shape = zod.def.shape;
1023
- const propValues = {};
1024
- for (const key in shape) {
1025
- const field = shape[key]._zod;
1026
- if (field.values) {
1027
- if (!Object.prototype.hasOwnProperty.call(propValues, key)) {
1028
- util.assignProp(propValues, key, new Set());
1029
- }
1030
- for (const v of field.values)
1031
- propValues[key].add(v);
1032
- // An omittable slot reads back as undefined at a discriminator lookup, so it has to claim undefined: two options that can both omit the key are not discriminable on it.
1033
- if (field.optin !== undefined)
1034
- propValues[key].add(undefined);
1035
- }
1036
- }
1037
- return propValues;
1038
- });
1039
- const isObject = util.isObject;
1040
- const catchall = def.catchall;
1041
- let value;
1042
- const memo = core.globalConfig.memoizer;
1043
- memo?.attach(inst);
1044
- inst._zod.parse = (payload, ctx) => {
1045
- value ?? (value = _normalized.value);
1046
- const input = payload.value;
1047
- if (!isObject(input)) {
1048
- payload.issues.push({
1049
- expected: "object",
1050
- code: "invalid_type",
1051
- input,
1052
- inst,
1053
- });
1054
- return payload;
1055
- }
1056
- payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
1057
- const proms = [];
1058
- const shape = value.shape;
1059
- const abortEarly = ctx?.abortEarly;
1060
- let seen = payload.issues.length;
1061
- for (const key of value.allKeys) {
1062
- if (abortEarly && payload.issues.length !== seen) {
1063
- if (util.aborted(payload, seen))
1064
- break;
1065
- seen = payload.issues.length;
1066
- }
1067
- if (key === "__proto__")
1068
- continue;
1069
- const el = shape[key];
1070
- const optin = el._zod.optin;
1071
- const optout = el._zod.optout;
1072
- const r = el._zod.run({ value: input[key], issues: [] }, ctx);
1073
- if (r instanceof Promise) {
1074
- proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
1075
- }
1076
- else {
1077
- handlePropertyResult(r, payload, key, input, optin, optout);
1078
- }
1079
- }
1080
- if (!catchall) {
1081
- return proms.length ? Promise.all(proms).then(() => payload) : payload;
1082
- }
1083
- return handleCatchall(proms, input, payload, ctx, _normalized.value, inst, abortEarly === true);
1084
- };
1085
- });
1086
- export const $ZodObjectJIT = /*@__PURE__*/ core.$constructor("$ZodObjectJIT", (inst, def) => {
1087
- // requires cast because technically $ZodObject doesn't extend
1088
- $ZodObject.init(inst, def);
1089
- const superParse = inst._zod.parse;
1090
- const _normalized = util.cached(() => normalizeDef(def));
1091
- const memo = core.globalConfig.memoizer;
1092
- const generateFastpass = (shape) => {
1093
- const normalized = _normalized.value;
1094
- const syms = normalized.symbolKeys;
1095
- // a symbol has no source literal, so it is read as `syms[i]` off the closed-over scope
1096
- const doc = new Doc(["payload", "ctx"], { shape, inst, memo, syms });
1097
- const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
1098
- // prefixes in place, like util.prefixIssues. newResult must land before the early return: a catchall runs after this and would otherwise write onto the caller's input
1099
- const prefixStr = (id, k) => `
1100
- let ${id}_ab = false;
1101
- for (let i = 0; i < ${id}.issues.length; i++) {
1102
- const iss = ${id}.issues[i];
1103
- iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
1104
- payload.issues.push(iss);
1105
- if (iss.continue !== true) ${id}_ab = true;
1106
- }
1107
- if (${id}_ab && ctx && ctx.abortEarly) {
1108
- payload.value = newResult;
1109
- return payload;
1110
- }`;
1111
- doc.write(`const input = payload.value;`);
1112
- const ids = Object.create(null);
1113
- let counter = 0;
1114
- for (const key of normalized.allKeys) {
1115
- ids[key] = `key_${counter++}`;
1116
- }
1117
- // A: preserve key order {
1118
- doc.write(memo ? `const newResult = memo.alloc(inst, payload, {}, ctx);` : `const newResult = {};`);
1119
- for (const key of normalized.allKeys) {
1120
- if (key === "__proto__")
1121
- continue;
1122
- const id = ids[key];
1123
- const k = typeof key === "symbol" ? `syms[${syms.indexOf(key)}]` : util.esc(key);
1124
- const isPresent = `${k} in input`;
1125
- const schema = shape[key];
1126
- const optin = schema?._zod?.optin;
1127
- const isOptionalIn = optin !== undefined;
1128
- const isOptionalOut = schema?._zod?.optout === "optional";
1129
- doc.write(`const ${id} = ${parseStr(k)};`);
1130
- if (isOptionalIn && isOptionalOut) {
1131
- // For optional-in/out schemas, ignore errors on absent keys — and, like the interpreted path, drop the value produced alongside them. The middle rung goes further: it permits absence without supplying anything in its place, so an absent key contributes nothing at all.
1132
- const assign = optin === "optional" ? `${id}_present` : `${id}.value !== undefined || ${id}_present`;
1133
- doc.write(`
1134
- const ${id}_present = ${isPresent};
1135
- if (!${id}.issues.length || ${id}_present) {
1136
- if (${id}.issues.length) {${prefixStr(id, k)}
1137
- }
1138
-
1139
- if (${assign}) {
1140
- newResult[${k}] = ${id}.value;
1141
- }
1142
- }
1143
-
1144
- `);
1145
- }
1146
- else if (!isOptionalIn) {
1147
- doc.write(`
1148
- const ${id}_present = ${isPresent};
1149
- if (${id}.issues.length) {${prefixStr(id, k)}
1150
- }
1151
- if (!${id}_present && !${id}.issues.length) {
1152
- payload.issues.push({
1153
- code: "invalid_type",
1154
- expected: "nonoptional",
1155
- input: undefined,
1156
- path: [${k}]
1157
- });
1158
- if (ctx && ctx.abortEarly) {
1159
- payload.value = newResult;
1160
- return payload;
1161
- }
1162
- }
1163
-
1164
- if (${id}_present) {
1165
- newResult[${k}] = ${id}.value;
1166
- }
1167
-
1168
- `);
1169
- }
1170
- else {
1171
- doc.write(`
1172
- if (${id}.issues.length) {${prefixStr(id, k)}
1173
- }
1174
- `);
1175
- if (optin === "defaulted") {
1176
- doc.write(`newResult[${k}] = ${id}.value;`);
1177
- }
1178
- else {
1179
- doc.write(`
1180
- if (${id}.value !== undefined || ${isPresent}) {
1181
- newResult[${k}] = ${id}.value;
1182
- }
1183
- `);
1184
- }
1185
- }
1186
- }
1187
- doc.write(`payload.value = newResult;`);
1188
- doc.write(`return payload;`);
1189
- // closing `shape` in is what pays: turbofan specializes the parser against that one shape object, so every `shape[k]._zod.run` folds to a known callee. as a parameter it stays a generic load and measures 13% slower even with the forwarding frame gone
1190
- return doc.compile();
1191
- };
1192
- let fastpass;
1193
- const isObject = util.isObject;
1194
- const jit = !core.globalConfig.jitless;
1195
- const allowsEval = util.allowsEval;
1196
- const fastEnabled = jit && allowsEval.value; // && !def.catchall;
1197
- const catchall = def.catchall;
1198
- let value;
1199
- inst._zod.parse = (payload, ctx) => {
1200
- value ?? (value = _normalized.value);
1201
- const input = payload.value;
1202
- if (!isObject(input)) {
1203
- payload.issues.push({
1204
- expected: "object",
1205
- code: "invalid_type",
1206
- input,
1207
- inst,
1208
- });
1209
- return payload;
1210
- }
1211
- if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {
1212
- // always synchronous
1213
- if (!fastpass)
1214
- fastpass = generateFastpass(def.shape);
1215
- payload = fastpass(payload, ctx);
1216
- if (!catchall)
1217
- return payload;
1218
- return handleCatchall([], input, payload, ctx, value, inst, ctx?.abortEarly === true);
1219
- }
1220
- return superParse(payload, ctx);
1221
- };
1222
- });
1223
- function handleUnionResults(results, final, inst, ctx) {
1224
- for (const result of results) {
1225
- if (result.issues.length === 0) {
1226
- final.value = result.value;
1227
- return final;
1228
- }
1229
- }
1230
- const nonaborted = results.filter((r) => !util.aborted(r));
1231
- if (nonaborted.length === 1) {
1232
- final.value = nonaborted[0].value;
1233
- return nonaborted[0];
1234
- }
1235
- final.issues.push({
1236
- code: "invalid_union",
1237
- input: final.value,
1238
- inst,
1239
- errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
1240
- });
1241
- return final;
1242
- }
1243
- export const $ZodUnion = /*@__PURE__*/ core.$constructor("$ZodUnion", (inst, def) => {
1244
- $ZodType.init(inst, def);
1245
- util.defineLazyInternal(inst, "optin", (zod) => zod.def.options.some((o) => o._zod.optin === "defaulted")
1246
- ? "defaulted"
1247
- : zod.def.options.some((o) => o._zod.optin !== undefined)
1248
- ? "optional"
1249
- : undefined);
1250
- util.defineLazyInternal(inst, "optout", (zod) => zod.def.options.some((o) => o._zod.optout === "optional") ? "optional" : undefined);
1251
- util.defineLazyInternal(inst, "values", (zod) => {
1252
- if (zod.def.options.every((o) => o._zod.values)) {
1253
- return new Set(zod.def.options.flatMap((option) => Array.from(option._zod.values)));
1254
- }
1255
- return undefined;
1256
- });
1257
- util.defineLazyInternal(inst, "pattern", (zod) => {
1258
- if (zod.def.options.every((o) => o._zod.pattern)) {
1259
- const patterns = zod.def.options.map((o) => o._zod.pattern);
1260
- return new RegExp(`^(${patterns.map((p) => util.cleanRegex(p.source)).join("|")})$`);
1261
- }
1262
- return undefined;
1263
- });
1264
- const first = def.options.length === 1 ? def.options[0]._zod.run : null;
1265
- inst._zod.parse = (payload, ctx) => {
1266
- if (first) {
1267
- return first(payload, ctx);
1268
- }
1269
- let async = false;
1270
- const results = [];
1271
- for (const option of def.options) {
1272
- const result = option._zod.run({
1273
- value: payload.value,
1274
- issues: [],
1275
- }, ctx);
1276
- if (result instanceof Promise) {
1277
- results.push(result);
1278
- async = true;
1279
- }
1280
- else {
1281
- if (result.issues.length === 0)
1282
- return result;
1283
- results.push(result);
1284
- }
1285
- }
1286
- if (!async)
1287
- return handleUnionResults(results, payload, inst, ctx);
1288
- return Promise.all(results).then((results) => {
1289
- return handleUnionResults(results, payload, inst, ctx);
1290
- });
1291
- };
1292
- });
1293
- function handleExclusiveUnionResults(results, final, inst, ctx) {
1294
- const matches = [];
1295
- for (let i = 0; i < results.length; i++) {
1296
- if (results[i].issues.length === 0)
1297
- matches.push(i);
1298
- }
1299
- if (matches.length === 1) {
1300
- final.value = results[matches[0]].value;
1301
- return final;
1302
- }
1303
- if (matches.length === 0) {
1304
- // No matches - same as regular union
1305
- final.issues.push({
1306
- code: "invalid_union",
1307
- input: final.value,
1308
- inst,
1309
- errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
1310
- });
1311
- }
1312
- else {
1313
- // Multiple matches - exclusive union failure
1314
- final.issues.push({
1315
- code: "invalid_union",
1316
- input: final.value,
1317
- inst,
1318
- errors: [],
1319
- inclusive: false,
1320
- matches,
1321
- });
1322
- }
1323
- return final;
1324
- }
1325
- export const $ZodXor = /*@__PURE__*/ core.$constructor("$ZodXor", (inst, def) => {
1326
- $ZodUnion.init(inst, def);
1327
- def.inclusive = false;
1328
- const first = def.options.length === 1 ? def.options[0]._zod.run : null;
1329
- inst._zod.parse = (payload, ctx) => {
1330
- if (first) {
1331
- return first(payload, ctx);
1332
- }
1333
- let async = false;
1334
- const results = [];
1335
- for (const option of def.options) {
1336
- const result = option._zod.run({
1337
- value: payload.value,
1338
- issues: [],
1339
- }, ctx);
1340
- if (result instanceof Promise) {
1341
- results.push(result);
1342
- async = true;
1343
- }
1344
- else {
1345
- results.push(result);
1346
- }
1347
- }
1348
- if (!async)
1349
- return handleExclusiveUnionResults(results, payload, inst, ctx);
1350
- return Promise.all(results).then((results) => {
1351
- return handleExclusiveUnionResults(results, payload, inst, ctx);
1352
- });
1353
- };
1354
- });
1355
- /** Returns the option whose discriminator claims `value`, or throws if ambiguous. */
1356
- export function getDiscriminatedOption(union, value) {
1357
- const internals = union._zod;
1358
- let map = internals.bag.optionsMap;
1359
- if (!map) {
1360
- map = discriminatorMap(internals.def);
1361
- internals.bag.optionsMap = map;
1362
- }
1363
- const option = map.get(value);
1364
- if (option === null)
1365
- throw new Error(`Ambiguous discriminator value "${String(value)}"`);
1366
- return option;
1367
- }
1368
- function discriminatorMap(def) {
1369
- const map = new Map();
1370
- for (const option of def.options) {
1371
- const values = option._zod.propValues?.[def.discriminator];
1372
- if (!values || values.size === 0)
1373
- throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
1374
- for (const value of values) {
1375
- if (map.has(value)) {
1376
- if (value !== undefined)
1377
- throw new Error(`Duplicate discriminator value "${String(value)}"`);
1378
- // keep the collision marked so a later member cannot reclaim it
1379
- map.set(value, null);
1380
- }
1381
- else {
1382
- map.set(value, option);
1383
- }
1384
- }
1385
- }
1386
- return map;
1387
- }
1388
- export const $ZodDiscriminatedUnion =
1389
- /*@__PURE__*/
1390
- core.$constructor("$ZodDiscriminatedUnion", (inst, def) => {
1391
- def.inclusive = false;
1392
- $ZodUnion.init(inst, def);
1393
- const _super = inst._zod.parse;
1394
- util.defineLazyInternal(inst, "propValues", (zod) => {
1395
- const propValues = {};
1396
- let undefinedCount = 0;
1397
- for (const option of zod.def.options) {
1398
- const pv = option._zod.propValues;
1399
- if (!pv || Object.keys(pv).length === 0)
1400
- throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
1401
- if (pv[zod.def.discriminator]?.has(undefined))
1402
- undefinedCount++;
1403
- for (const [k, v] of Object.entries(pv)) {
1404
- if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
1405
- util.assignProp(propValues, k, new Set());
1406
- }
1407
- for (const val of v) {
1408
- propValues[k].add(val);
1409
- }
1410
- }
1411
- }
1412
- if (!zod.def.unionFallback && undefinedCount > 1)
1413
- propValues[zod.def.discriminator]?.delete(undefined);
1414
- return propValues;
1415
- });
1416
- // Checked now rather than in the lookup map below, so an option that lacks the discriminator fails at the `discriminatedUnion` call instead of on the first object parsed. Options whose shape cannot be enumerated without resolving it — pipes and lazies — are left to the map.
1417
- def.options.forEach((option, i) => {
1418
- const propShape = util.rawShape(option._zod.def);
1419
- if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {
1420
- throw new Error(`Invalid discriminated union option at index "${i}"`);
1421
- }
1422
- });
1423
- const disc = util.cached(() => discriminatorMap(def));
1424
- inst._zod.parse = (payload, ctx) => {
1425
- const input = payload.value;
1426
- if (!util.isObject(input)) {
1427
- payload.issues.push({
1428
- code: "invalid_type",
1429
- expected: "object",
1430
- input,
1431
- inst,
1432
- });
1433
- return payload;
1434
- }
1435
- const value = input?.[def.discriminator];
1436
- const opt = disc.value.get(value);
1437
- // forward metadata cannot choose an encoder for an absent tag
1438
- if (opt && (value !== undefined || ctx.direction !== "backward")) {
1439
- return opt._zod.run(payload, ctx);
1440
- }
1441
- // Fall back to union matching when the fast discriminator path fails:
1442
- // - explicitly enabled via unionFallback, or
1443
- // - during backward direction (encode), since codec-based discriminators have different values in forward vs backward directions
1444
- if (def.unionFallback || ctx.direction === "backward") {
1445
- return _super(payload, ctx);
1446
- }
1447
- // no matching discriminator
1448
- payload.issues.push({
1449
- code: "invalid_union",
1450
- errors: [],
1451
- note: "No matching discriminator",
1452
- discriminator: def.discriminator,
1453
- options: Array.from(disc.value.keys()).filter((value) => disc.value.get(value) !== null),
1454
- input,
1455
- path: [def.discriminator],
1456
- inst,
1457
- });
1458
- return payload;
1459
- };
1460
- });
1461
- export const $ZodIntersection = /*@__PURE__*/ core.$constructor("$ZodIntersection", (inst, def) => {
1462
- $ZodType.init(inst, def);
1463
- inst._zod.parse = (payload, ctx) => {
1464
- const input = payload.value;
1465
- const left = def.left._zod.run({ value: input, issues: [] }, ctx);
1466
- const right = def.right._zod.run({ value: input, issues: [] }, ctx);
1467
- const async = left instanceof Promise || right instanceof Promise;
1468
- if (async) {
1469
- return Promise.all([left, right]).then(([left, right]) => {
1470
- return handleIntersectionResults(payload, left, right);
1471
- });
1472
- }
1473
- return handleIntersectionResults(payload, left, right);
1474
- };
1475
- });
1476
- export function mergeValues(a, b) {
1477
- // const aType = parse.t(a);
1478
- // const bType = parse.t(b);
1479
- if (a === b) {
1480
- return { valid: true, data: a };
1481
- }
1482
- if (a instanceof Date && b instanceof Date && +a === +b) {
1483
- return { valid: true, data: a };
1484
- }
1485
- if (util.isPlainObject(a) && util.isPlainObject(b)) {
1486
- const bKeys = Object.keys(b);
1487
- const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
1488
- const newObj = { ...a, ...b };
1489
- if (Object.prototype.hasOwnProperty.call(newObj, "__proto__"))
1490
- delete newObj.__proto__;
1491
- for (const key of sharedKeys) {
1492
- if (key === "__proto__")
1493
- continue;
1494
- const sharedValue = mergeValues(a[key], b[key]);
1495
- if (!sharedValue.valid) {
1496
- return {
1497
- valid: false,
1498
- mergeErrorPath: [key, ...sharedValue.mergeErrorPath],
1499
- };
1500
- }
1501
- newObj[key] = sharedValue.data;
1502
- }
1503
- return { valid: true, data: newObj };
1504
- }
1505
- if (Array.isArray(a) && Array.isArray(b)) {
1506
- if (a.length !== b.length) {
1507
- return { valid: false, mergeErrorPath: [] };
1508
- }
1509
- const newArray = [];
1510
- for (let index = 0; index < a.length; index++) {
1511
- const itemA = a[index];
1512
- const itemB = b[index];
1513
- const sharedValue = mergeValues(itemA, itemB);
1514
- if (!sharedValue.valid) {
1515
- return {
1516
- valid: false,
1517
- mergeErrorPath: [index, ...sharedValue.mergeErrorPath],
1518
- };
1519
- }
1520
- newArray.push(sharedValue.data);
1521
- }
1522
- return { valid: true, data: newArray };
1523
- }
1524
- return { valid: false, mergeErrorPath: [] };
1525
- }
1526
- function handleIntersectionResults(result, left, right) {
1527
- // Track which side(s) reject each key. A key rejection is reported only when BOTH sides reject it, so a key owned by one branch survives the other's key schema. strictObject reports these as unrecognized_keys; a record with an open key schema reports one invalid_key per key.
1528
- const unrecKeys = new Map();
1529
- let unrecIssue;
1530
- const keyIssues = new Map();
1531
- const collect = (iss, side) => {
1532
- let keys;
1533
- if (iss.code === "unrecognized_keys" && !iss.path?.length) {
1534
- unrecIssue ?? (unrecIssue = iss);
1535
- keys = iss.keys;
1536
- }
1537
- else if (iss.code === "invalid_key" && iss.origin === "record" && iss.path?.length === 1) {
1538
- const k = String(iss.path[0]);
1539
- if (!keyIssues.has(k))
1540
- keyIssues.set(k, iss);
1541
- keys = [k];
1542
- }
1543
- else {
1544
- return false;
1545
- }
1546
- for (const k of keys) {
1547
- if (!unrecKeys.has(k))
1548
- unrecKeys.set(k, {});
1549
- unrecKeys.get(k)[side] = true;
1550
- }
1551
- return true;
1552
- };
1553
- for (const iss of left.issues) {
1554
- if (!collect(iss, "l"))
1555
- result.issues.push(iss);
1556
- }
1557
- for (const iss of right.issues) {
1558
- if (!collect(iss, "r"))
1559
- result.issues.push(iss);
1560
- }
1561
- // Report only keys rejected by BOTH sides
1562
- const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
1563
- if (bothKeys.length) {
1564
- const aggregated = unrecIssue ? bothKeys.filter((k) => unrecIssue.keys.includes(k)) : [];
1565
- if (aggregated.length)
1566
- result.issues.push({ ...unrecIssue, keys: aggregated });
1567
- for (const k of bothKeys) {
1568
- if (!aggregated.includes(k) && keyIssues.has(k))
1569
- result.issues.push(keyIssues.get(k));
1570
- }
1571
- }
1572
- const merged = mergeValues(left.value, right.value);
1573
- if (!merged.valid) {
1574
- if (util.aborted(result))
1575
- return result;
1576
- throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);
1577
- }
1578
- result.value = merged.data;
1579
- return result;
1580
- }
1581
- export const $ZodTuple = /*@__PURE__*/ core.$constructor("$ZodTuple", (inst, def) => {
1582
- $ZodType.init(inst, def);
1583
- const items = def.items;
1584
- const memo = core.globalConfig.memoizer;
1585
- memo?.attach(inst);
1586
- inst._zod.parse = (payload, ctx) => {
1587
- const input = payload.value;
1588
- if (!Array.isArray(input)) {
1589
- payload.issues.push({
1590
- input,
1591
- inst,
1592
- expected: "tuple",
1593
- code: "invalid_type",
1594
- });
1595
- return payload;
1596
- }
1597
- payload.value = memo ? memo.alloc(inst, payload, [], ctx) : [];
1598
- const proms = [];
1599
- const optinStart = getTupleOptStart(items, "optin");
1600
- const optoutStart = getTupleOptStart(items, "optout");
1601
- if (!def.rest) {
1602
- if (input.length < optinStart) {
1603
- payload.issues.push({
1604
- code: "too_small",
1605
- minimum: optinStart,
1606
- inclusive: true,
1607
- input,
1608
- inst,
1609
- origin: "array",
1610
- });
1611
- return payload;
1612
- }
1613
- if (input.length > items.length) {
1614
- payload.issues.push({
1615
- code: "too_big",
1616
- maximum: items.length,
1617
- inclusive: true,
1618
- input,
1619
- inst,
1620
- origin: "array",
1621
- });
1622
- }
1623
- }
1624
- // Run every item in parallel, collecting results into an indexed array. The post-processing in `handleTupleResults` walks them in order so it can decide whether an absent optional-output error can truncate the tail or must be reported to preserve required output.
1625
- const itemResults = new Array(items.length);
1626
- // only tracked when there is a rest loop to skip
1627
- const abortEarly = def.rest ? ctx?.abortEarly : undefined;
1628
- let itemAborted = false;
1629
- for (let i = 0; i < items.length; i++) {
1630
- const r = items[i]._zod.run({ value: input[i], issues: [] }, ctx);
1631
- if (r instanceof Promise) {
1632
- proms.push(r.then((rr) => {
1633
- itemResults[i] = rr;
1634
- }));
1635
- }
1636
- else {
1637
- itemResults[i] = r;
1638
- if (abortEarly && !itemAborted && r.issues.length)
1639
- itemAborted = util.aborted(r);
1640
- }
1641
- }
1642
- // sound because rest is non-empty exactly when every fixed index is present, the one case handleTupleResults cannot discard an item's issues
1643
- if (def.rest && !itemAborted) {
1644
- let i = items.length - 1;
1645
- const rest = input.slice(items.length);
1646
- let seen = payload.issues.length;
1647
- for (const el of rest) {
1648
- if (abortEarly && payload.issues.length !== seen) {
1649
- if (util.aborted(payload, seen))
1650
- break;
1651
- seen = payload.issues.length;
1652
- }
1653
- i++;
1654
- const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
1655
- if (result instanceof Promise) {
1656
- proms.push(result.then((r) => handleTupleResult(r, payload, i)));
1657
- }
1658
- else {
1659
- handleTupleResult(result, payload, i);
1660
- }
1661
- }
1662
- }
1663
- if (proms.length) {
1664
- return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input, optoutStart));
1665
- }
1666
- return handleTupleResults(itemResults, payload, items, input, optoutStart);
1667
- };
1668
- });
1669
- function getTupleOptStart(items, key) {
1670
- for (let i = items.length - 1; i >= 0; i--) {
1671
- // optin is a three-rung ladder so any rung above `undefined` permits an absent slot; optout stays two-valued.
1672
- const omittable = key === "optin" ? items[i]._zod.optin !== undefined : items[i]._zod.optout === "optional";
1673
- if (!omittable)
1674
- return i + 1;
1675
- }
1676
- return 0;
1677
- }
1678
- function handleTupleResult(result, final, index) {
1679
- if (result.issues.length) {
1680
- final.issues.push(...util.prefixIssues(index, result.issues));
1681
- }
1682
- final.value[index] = result.value;
1683
- }
1684
- function handleTupleResults(itemResults, final, items, input, optoutStart) {
1685
- // Walk results in order. Mirror $ZodObject's swallow-on-absent-optional rule, but only after `optoutStart`: the first index where the output tuple tail can be absent.
1686
- for (let i = 0; i < items.length; i++) {
1687
- const r = itemResults[i];
1688
- const isPresent = i < input.length;
1689
- // The array analog of `handlePropertyResult`'s absent-key early return: the middle rung permits absence without supplying anything in its place, so the tail truncates here instead of materializing whatever the item made of `undefined`.
1690
- if (!isPresent && i >= optoutStart && items[i]._zod.optin === "optional") {
1691
- final.value.length = i;
1692
- break;
1693
- }
1694
- if (r.issues.length) {
1695
- if (!isPresent && i >= optoutStart) {
1696
- final.value.length = i;
1697
- break;
1698
- }
1699
- final.issues.push(...util.prefixIssues(i, r.issues));
1700
- }
1701
- final.value[i] = r.value;
1702
- }
1703
- // Drop trailing slots that produced `undefined` for absent input
1704
- // (the array analog of an absent optional key on an object). The
1705
- // `i >= input.length` floor is critical: an explicit `undefined`
1706
- // *inside* the input must be preserved even when the schema is
1707
- // optional-out (e.g. `z.string().or(z.undefined())` accepting an
1708
- // explicit undefined value).
1709
- for (let i = final.value.length - 1; i >= input.length; i--) {
1710
- if (items[i]._zod.optout === "optional" && final.value[i] === undefined) {
1711
- final.value.length = i;
1712
- }
1713
- else {
1714
- break;
1715
- }
1716
- }
1717
- return final;
1718
- }
1719
- export const $ZodRecord = /*@__PURE__*/ core.$constructor("$ZodRecord", (inst, def) => {
1720
- $ZodType.init(inst, def);
1721
- const memo = core.globalConfig.memoizer;
1722
- memo?.attach(inst);
1723
- inst._zod.parse = (payload, ctx) => {
1724
- const input = payload.value;
1725
- if (!util.isPlainObject(input)) {
1726
- payload.issues.push({
1727
- expected: "record",
1728
- code: "invalid_type",
1729
- input,
1730
- inst,
1731
- });
1732
- return payload;
1733
- }
1734
- // no guard in either loop below: a record's invalid_key aborts but an enclosing intersection can reconcile it, so a stopped loop hides keys the sibling does not own and the intersection then rejects nothing
1735
- const proms = [];
1736
- const values = def.keyType._zod.values;
1737
- if (values && !def.partial) {
1738
- payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
1739
- const recordKeys = new Set();
1740
- for (const key of values) {
1741
- if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
1742
- recordKeys.add(typeof key === "number" ? key.toString() : key);
1743
- // A declared __proto__ is stripped but is not an unrecognized key.
1744
- if (key === "__proto__")
1745
- continue;
1746
- const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
1747
- if (keyResult instanceof Promise) {
1748
- throw new Error("Async schemas not supported in object keys currently");
1749
- }
1750
- if (keyResult.issues.length) {
1751
- payload.issues.push({
1752
- code: "invalid_key",
1753
- origin: "record",
1754
- issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1755
- input: key,
1756
- path: [key],
1757
- inst,
1758
- });
1759
- continue;
1760
- }
1761
- const outKey = keyResult.value;
1762
- if (outKey === "__proto__")
1763
- continue;
1764
- const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
1765
- if (result instanceof Promise) {
1766
- proms.push(result.then((result) => {
1767
- if (result.issues.length) {
1768
- payload.issues.push(...util.prefixIssues(key, result.issues));
1769
- }
1770
- payload.value[outKey] = result.value;
1771
- }));
1772
- }
1773
- else {
1774
- if (result.issues.length) {
1775
- payload.issues.push(...util.prefixIssues(key, result.issues));
1776
- }
1777
- payload.value[outKey] = result.value;
1778
- }
1779
- }
1780
- }
1781
- let unrecognized;
1782
- for (const key in input) {
1783
- if (!recordKeys.has(key)) {
1784
- if (def.mode === "loose") {
1785
- // skip __proto__ so it can't replace the result prototype via the assignment setter on the plain {} we build into
1786
- if (key === "__proto__")
1787
- continue;
1788
- payload.value[key] = input[key];
1789
- }
1790
- else {
1791
- unrecognized = unrecognized ?? [];
1792
- unrecognized.push(key);
1793
- }
1794
- }
1795
- }
1796
- if (unrecognized && unrecognized.length > 0) {
1797
- payload.issues.push({
1798
- code: "unrecognized_keys",
1799
- input,
1800
- inst,
1801
- keys: unrecognized,
1802
- continue: true,
1803
- });
1804
- }
1805
- }
1806
- else {
1807
- payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
1808
- // An enumerable key schema declares which keys the record owns, so a key outside the set is unrecognized. A non-enumerable one (regex, refine) is a constraint every key must satisfy, so a failing key is invalid. Only the former is reconcilable against the other side of an intersection.
1809
- let unrecognized;
1810
- // Reflect.ownKeys for Symbol-key support; filter non-enumerable to match z.object()
1811
- for (const key of Reflect.ownKeys(input)) {
1812
- if (key === "__proto__")
1813
- continue;
1814
- if (!Object.prototype.propertyIsEnumerable.call(input, key))
1815
- continue;
1816
- let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
1817
- if (keyResult instanceof Promise) {
1818
- throw new Error("Async schemas not supported in object keys currently");
1819
- }
1820
- // Numeric string fallback: if key is a numeric string and failed, retry with Number(key). This handles z.number(), z.literal([1, 2, 3]), and unions containing numeric literals
1821
- const checkNumericKey = typeof key === "string" && regexes.number.test(key) && keyResult.issues.length;
1822
- if (checkNumericKey) {
1823
- const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);
1824
- if (retryResult instanceof Promise) {
1825
- throw new Error("Async schemas not supported in object keys currently");
1826
- }
1827
- if (retryResult.issues.length === 0) {
1828
- keyResult = retryResult;
1829
- }
1830
- }
1831
- if (keyResult.issues.length) {
1832
- if (def.mode === "loose") {
1833
- // Pass through unchanged
1834
- payload.value[key] = input[key];
1835
- }
1836
- else if (values) {
1837
- unrecognized = unrecognized ?? [];
1838
- unrecognized.push(key);
1839
- }
1840
- else {
1841
- // Default "strict" behavior: error on invalid key
1842
- payload.issues.push({
1843
- code: "invalid_key",
1844
- origin: "record",
1845
- issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1846
- input: key,
1847
- path: [key],
1848
- inst,
1849
- });
1850
- }
1851
- continue;
1852
- }
1853
- // the guard above tests the raw input key, but the key schema can normalize an ordinary key into __proto__; re-check the key we actually write under
1854
- const outKey = keyResult.value;
1855
- if (outKey === "__proto__")
1856
- continue;
1857
- const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
1858
- if (result instanceof Promise) {
1859
- proms.push(result.then((result) => {
1860
- if (result.issues.length) {
1861
- payload.issues.push(...util.prefixIssues(key, result.issues));
1862
- }
1863
- payload.value[outKey] = result.value;
1864
- }));
1865
- }
1866
- else {
1867
- if (result.issues.length) {
1868
- payload.issues.push(...util.prefixIssues(key, result.issues));
1869
- }
1870
- payload.value[outKey] = result.value;
1871
- }
1872
- }
1873
- if (unrecognized && unrecognized.length > 0) {
1874
- payload.issues.push({
1875
- code: "unrecognized_keys",
1876
- input,
1877
- inst,
1878
- keys: unrecognized,
1879
- continue: true,
1880
- });
1881
- }
1882
- }
1883
- if (proms.length) {
1884
- return Promise.all(proms).then(() => payload);
1885
- }
1886
- return payload;
1887
- };
1888
- });
1889
- export const $ZodMap = /*@__PURE__*/ core.$constructor("$ZodMap", (inst, def) => {
1890
- $ZodType.init(inst, def);
1891
- const memo = core.globalConfig.memoizer;
1892
- memo?.attach(inst);
1893
- inst._zod.parse = (payload, ctx) => {
1894
- const input = payload.value;
1895
- if (!(input instanceof Map)) {
1896
- payload.issues.push({
1897
- expected: "map",
1898
- code: "invalid_type",
1899
- input,
1900
- inst,
1901
- });
1902
- return payload;
1903
- }
1904
- const proms = [];
1905
- payload.value = memo ? memo.alloc(inst, payload, new Map(), ctx) : new Map();
1906
- const abortEarly = ctx?.abortEarly;
1907
- let seen = payload.issues.length;
1908
- for (const [key, value] of input) {
1909
- if (abortEarly && payload.issues.length !== seen) {
1910
- if (util.aborted(payload, seen))
1911
- break;
1912
- seen = payload.issues.length;
1913
- }
1914
- const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
1915
- const valueResult = def.valueType._zod.run({ value: value, issues: [] }, ctx);
1916
- if (keyResult instanceof Promise || valueResult instanceof Promise) {
1917
- proms.push(Promise.all([keyResult, valueResult]).then(([keyResult, valueResult]) => {
1918
- handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
1919
- }));
1920
- }
1921
- else {
1922
- handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
1923
- }
1924
- }
1925
- if (proms.length)
1926
- return Promise.all(proms).then(() => payload);
1927
- return payload;
1928
- };
1929
- capSize(inst, mapSize);
1930
- });
1931
- function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
1932
- if (keyResult.issues.length) {
1933
- if (util.propertyKeyTypes.has(typeof key)) {
1934
- final.issues.push(...util.prefixIssues(key, keyResult.issues));
1935
- }
1936
- else {
1937
- final.issues.push({
1938
- code: "invalid_key",
1939
- origin: "map",
1940
- input,
1941
- inst,
1942
- issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1943
- });
1944
- }
1945
- }
1946
- if (valueResult.issues.length) {
1947
- if (util.propertyKeyTypes.has(typeof key)) {
1948
- final.issues.push(...util.prefixIssues(key, valueResult.issues));
1949
- }
1950
- else {
1951
- final.issues.push({
1952
- origin: "map",
1953
- code: "invalid_element",
1954
- input,
1955
- inst,
1956
- key: key,
1957
- issues: valueResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1958
- });
1959
- }
1960
- }
1961
- final.value.set(keyResult.value, valueResult.value);
1962
- }
1963
- export const $ZodSet = /*@__PURE__*/ core.$constructor("$ZodSet", (inst, def) => {
1964
- $ZodType.init(inst, def);
1965
- const memo = core.globalConfig.memoizer;
1966
- memo?.attach(inst);
1967
- inst._zod.parse = (payload, ctx) => {
1968
- const input = payload.value;
1969
- if (!(input instanceof Set)) {
1970
- payload.issues.push({
1971
- input,
1972
- inst,
1973
- expected: "set",
1974
- code: "invalid_type",
1975
- });
1976
- return payload;
1977
- }
1978
- const proms = [];
1979
- payload.value = memo ? memo.alloc(inst, payload, new Set(), ctx) : new Set();
1980
- const abortEarly = ctx?.abortEarly;
1981
- let seen = payload.issues.length;
1982
- for (const item of input) {
1983
- if (abortEarly && payload.issues.length !== seen) {
1984
- if (util.aborted(payload, seen))
1985
- break;
1986
- seen = payload.issues.length;
1987
- }
1988
- const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
1989
- if (result instanceof Promise) {
1990
- proms.push(result.then((result) => handleSetResult(result, payload)));
1991
- }
1992
- else
1993
- handleSetResult(result, payload);
1994
- }
1995
- if (proms.length)
1996
- return Promise.all(proms).then(() => payload);
1997
- return payload;
1998
- };
1999
- capSize(inst, setSize);
2000
- });
2001
- function handleSetResult(result, final) {
2002
- if (result.issues.length) {
2003
- final.issues.push(...result.issues);
2004
- }
2005
- final.value.add(result.value);
2006
- }
2007
- export const $ZodEnum = /*@__PURE__*/ core.$constructor("$ZodEnum", (inst, def) => {
2008
- $ZodType.init(inst, def);
2009
- const values = util.getEnumValues(def.entries);
2010
- const valuesSet = new Set(values);
2011
- inst._zod.values = valuesSet;
2012
- util.defineLazyInternal(inst, "pattern", (zod) => {
2013
- const patternValues = util.getEnumValues(zod.def.entries).filter((k) => util.propertyKeyTypes.has(typeof k));
2014
- // unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches ""
2015
- return new RegExp(patternValues.length ? `^(${patternValues.map((o) => util.escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
2016
- });
2017
- inst._zod.parse = (payload, _ctx) => {
2018
- const input = payload.value;
2019
- if (valuesSet.has(input)) {
2020
- return payload;
2021
- }
2022
- payload.issues.push({
2023
- code: "invalid_value",
2024
- values,
2025
- input,
2026
- inst,
2027
- });
2028
- return payload;
2029
- };
2030
- });
2031
- export const $ZodLiteral = /*@__PURE__*/ core.$constructor("$ZodLiteral", (inst, def) => {
2032
- $ZodType.init(inst, def);
2033
- const values = new Set(def.values);
2034
- inst._zod.values = values;
2035
- util.defineLazyInternal(inst, "pattern", (zod) => {
2036
- const vals = zod.def.values;
2037
- // unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches ""
2038
- return new RegExp(vals.length
2039
- ? `^(${vals
2040
- .map((o) => typeof o === "string" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o))
2041
- .join("|")})$`
2042
- : "^[^\\s\\S]$");
2043
- });
2044
- inst._zod.parse = (payload, _ctx) => {
2045
- const input = payload.value;
2046
- if (values.has(input)) {
2047
- return payload;
2048
- }
2049
- payload.issues.push({
2050
- code: "invalid_value",
2051
- values: def.values,
2052
- input,
2053
- inst,
2054
- });
2055
- return payload;
2056
- };
2057
- });
2058
- export const $ZodFile = /*@__PURE__*/ core.$constructor("$ZodFile", (inst, def) => {
2059
- $ZodType.init(inst, def);
2060
- inst._zod.parse = (payload, _ctx) => {
2061
- const input = payload.value;
2062
- // @ts-ignore
2063
- if (input instanceof File)
2064
- return payload;
2065
- payload.issues.push({
2066
- expected: "file",
2067
- code: "invalid_type",
2068
- input,
2069
- inst,
2070
- });
2071
- return payload;
2072
- };
2073
- });
2074
- export const $ZodTransform = /*@__PURE__*/ core.$constructor("$ZodTransform", (inst, def) => {
2075
- $ZodType.init(inst, def);
2076
- inst._zod.optin = "optional";
2077
- core.globalConfig.memoizer?.guard(inst);
2078
- inst._zod.parse = (payload, ctx) => {
2079
- if (ctx.direction === "backward") {
2080
- throw new core.$ZodEncodeError(inst.constructor.name);
2081
- }
2082
- const _out = def.transform(payload.value, payload);
2083
- if (ctx.async) {
2084
- const output = _out instanceof Promise ? _out : Promise.resolve(_out);
2085
- return output.then((output) => {
2086
- payload.value = output;
2087
- return payload;
2088
- });
2089
- }
2090
- if (_out instanceof Promise) {
2091
- throw new core.$ZodAsyncError();
2092
- }
2093
- payload.value = _out;
2094
- return payload;
2095
- };
2096
- });
2097
- function handleOptionalResult(payload, result) {
2098
- // A substituting schema that still failed has no usable answer; yield undefined. Its issues are simply dropped: it ran on a payload of its own, so there is no shared array to truncate and nothing of the caller's to lose with it.
2099
- payload.value = result.issues.length ? undefined : result.value;
2100
- return payload;
2101
- }
2102
- export const $ZodOptional = /*@__PURE__*/ core.$constructor("$ZodOptional", (inst, def) => {
2103
- $ZodType.init(inst, def);
2104
- // .optional() propagates absence rather than substituting for it, so a defaulted inner keeps its rung.
2105
- util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
2106
- inst._zod.optout = "optional";
2107
- util.defineLazyInternal(inst, "values", (zod) => {
2108
- const values = zod.def.innerType._zod.values;
2109
- return values ? new Set([...values, undefined]) : undefined;
2110
- });
2111
- util.defineLazyInternal(inst, "pattern", (zod) => {
2112
- const pattern = zod.def.innerType._zod.pattern;
2113
- return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)})?$`) : undefined;
2114
- });
2115
- inst._zod.parse = (payload, ctx) => {
2116
- if (payload.value === undefined) {
2117
- // Only the top rung substitutes a value for absence; everything else leaves it intact, which is what .optional() means.
2118
- if (def.innerType._zod.optin !== "defaulted")
2119
- return payload;
2120
- // Its own payload, for the same reason $ZodCatch gets one: a pipe forwards an unrecognized key through the caller's issues array, and this must not read that as the substituting schema failing and drop it.
2121
- const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);
2122
- if (result instanceof Promise)
2123
- return result.then((result) => handleOptionalResult(payload, result));
2124
- return handleOptionalResult(payload, result);
2125
- }
2126
- return def.innerType._zod.run(payload, ctx);
2127
- };
2128
- });
2129
- export const $ZodExactOptional = /*@__PURE__*/ core.$constructor("$ZodExactOptional", (inst, def) => {
2130
- // Call parent init - inherits optin/optout = "optional"
2131
- $ZodOptional.init(inst, def);
2132
- // Override values/pattern to NOT add undefined
2133
- util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2134
- util.defineLazyInternal(inst, "pattern", (zod) => zod.def.innerType._zod.pattern);
2135
- // Override parse to just delegate (no undefined handling)
2136
- inst._zod.parse = (payload, ctx) => {
2137
- return def.innerType._zod.run(payload, ctx);
2138
- };
2139
- });
2140
- export const $ZodNullable = /*@__PURE__*/ core.$constructor("$ZodNullable", (inst, def) => {
2141
- $ZodType.init(inst, def);
2142
- util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin);
2143
- util.defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
2144
- util.defineLazyInternal(inst, "pattern", (zod) => {
2145
- const pattern = zod.def.innerType._zod.pattern;
2146
- return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)}|null)$`) : undefined;
2147
- });
2148
- util.defineLazyInternal(inst, "values", (zod) => {
2149
- return zod.def.innerType._zod.values ? new Set([...zod.def.innerType._zod.values, null]) : undefined;
2150
- });
2151
- inst._zod.parse = (payload, ctx) => {
2152
- // Forward direction (decode): allow null to pass through
2153
- if (payload.value === null)
2154
- return payload;
2155
- return def.innerType._zod.run(payload, ctx);
2156
- };
2157
- });
2158
- export const $ZodDefault = /*@__PURE__*/ core.$constructor("$ZodDefault", (inst, def) => {
2159
- $ZodType.init(inst, def);
2160
- // inst._zod.qin = "true";
2161
- inst._zod.optin = "defaulted";
2162
- util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2163
- inst._zod.parse = (payload, ctx) => {
2164
- if (ctx.direction === "backward") {
2165
- return def.innerType._zod.run(payload, ctx);
2166
- }
2167
- // Forward direction (decode): apply defaults for undefined input
2168
- if (payload.value === undefined) {
2169
- payload.value = def.defaultValue;
2170
- /**
2171
- * $ZodDefault returns the default value immediately in forward direction.
2172
- * 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. */
2173
- return payload;
2174
- }
2175
- // Forward direction: continue with default handling
2176
- const result = def.innerType._zod.run(payload, ctx);
2177
- if (result instanceof Promise) {
2178
- return result.then((result) => handleDefaultResult(result, def));
2179
- }
2180
- return handleDefaultResult(result, def);
2181
- };
2182
- });
2183
- function handleDefaultResult(payload, def) {
2184
- if (payload.value === undefined) {
2185
- payload.value = def.defaultValue;
2186
- }
2187
- return payload;
2188
- }
2189
- export const $ZodPrefault = /*@__PURE__*/ core.$constructor("$ZodPrefault", (inst, def) => {
2190
- $ZodType.init(inst, def);
2191
- inst._zod.optin = "defaulted";
2192
- util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2193
- inst._zod.parse = (payload, ctx) => {
2194
- if (ctx.direction === "backward") {
2195
- return def.innerType._zod.run(payload, ctx);
2196
- }
2197
- // Forward direction (decode): apply prefault for undefined input
2198
- if (payload.value === undefined) {
2199
- payload.value = def.defaultValue;
2200
- }
2201
- return def.innerType._zod.run(payload, ctx);
2202
- };
2203
- });
2204
- export const $ZodNonOptional = /*@__PURE__*/ core.$constructor("$ZodNonOptional", (inst, def) => {
2205
- $ZodType.init(inst, def);
2206
- util.defineLazyInternal(inst, "values", (zod) => {
2207
- const v = zod.def.innerType._zod.values;
2208
- return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;
2209
- });
2210
- inst._zod.parse = (payload, ctx) => {
2211
- const result = def.innerType._zod.run(payload, ctx);
2212
- if (result instanceof Promise) {
2213
- return result.then((result) => handleNonOptionalResult(result, inst));
2214
- }
2215
- return handleNonOptionalResult(result, inst);
2216
- };
2217
- });
2218
- function handleNonOptionalResult(payload, inst) {
2219
- if (!payload.issues.length && payload.value === undefined) {
2220
- payload.issues.push({
2221
- code: "invalid_type",
2222
- expected: "nonoptional",
2223
- input: payload.value,
2224
- inst,
2225
- });
2226
- }
2227
- return payload;
2228
- }
2229
- export const $ZodSuccess = /*@__PURE__*/ core.$constructor("$ZodSuccess", (inst, def) => {
2230
- $ZodType.init(inst, def);
2231
- inst._zod.parse = (payload, ctx) => {
2232
- if (ctx.direction === "backward") {
2233
- throw new core.$ZodEncodeError("ZodSuccess");
2234
- }
2235
- const result = def.innerType._zod.run(payload, ctx);
2236
- if (result instanceof Promise) {
2237
- return result.then((result) => {
2238
- payload.value = result.issues.length === 0;
2239
- return payload;
2240
- });
2241
- }
2242
- payload.value = result.issues.length === 0;
2243
- return payload;
2244
- };
2245
- });
2246
- function handleCatchResult(payload, result, def, ctx) {
2247
- if (!result.issues.length) {
2248
- payload.value = result.value;
2249
- // The value carries up, so the flag describing it has to carry with it: a back-edge into a node still being parsed must not be frozen by an enclosing readonly, and its checks belong to the node itself. Guarded so the ordinary case adds no own property.
2250
- if (result.memo)
2251
- payload.memo = true;
2252
- return payload;
2253
- }
2254
- // Spread the inner's own payload, not ours: `value` has to stay the input the catch was handed, and the inner ran on a payload of its own so its issues are already private to this call.
2255
- payload.value = def.catchValue({
2256
- ...result,
2257
- value: payload.value,
2258
- error: {
2259
- issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
2260
- },
2261
- input: payload.value,
2262
- });
2263
- return payload;
2264
- }
2265
- export const $ZodCatch = /*@__PURE__*/ core.$constructor("$ZodCatch", (inst, def) => {
2266
- $ZodType.init(inst, def);
2267
- util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
2268
- util.defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
2269
- util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2270
- inst._zod.parse = (payload, ctx) => {
2271
- if (ctx.direction === "backward") {
2272
- return def.innerType._zod.run(payload, ctx);
2273
- }
2274
- // Forward direction (decode): apply catch logic
2275
- const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);
2276
- if (result instanceof Promise) {
2277
- return result.then((result) => handleCatchResult(payload, result, def, ctx));
2278
- }
2279
- return handleCatchResult(payload, result, def, ctx);
2280
- };
2281
- });
2282
- export const $ZodNaN = /*@__PURE__*/ core.$constructor("$ZodNaN", (inst, def) => {
2283
- $ZodType.init(inst, def);
2284
- inst._zod.parse = (payload, _ctx) => {
2285
- if (typeof payload.value !== "number" || !Number.isNaN(payload.value)) {
2286
- payload.issues.push({
2287
- input: payload.value,
2288
- inst,
2289
- expected: "nan",
2290
- code: "invalid_type",
2291
- });
2292
- return payload;
2293
- }
2294
- return payload;
2295
- };
2296
- });
2297
- export const $ZodPipe = /*@__PURE__*/ core.$constructor("$ZodPipe", (inst, def) => {
2298
- $ZodType.init(inst, def);
2299
- util.defineLazyInternal(inst, "values", (zod) => zod.def.in._zod.values);
2300
- util.defineLazyInternal(inst, "optin", (zod) => zod.def.in._zod.optin);
2301
- util.defineLazyInternal(inst, "optout", (zod) => zod.def.out._zod.optout);
2302
- util.defineLazyInternal(inst, "propValues", (zod) => zod.def.in._zod.propValues);
2303
- inst._zod.parse = (payload, ctx) => {
2304
- if (ctx.direction === "backward") {
2305
- const right = def.out._zod.run(payload, ctx);
2306
- if (right instanceof Promise) {
2307
- return right.then((right) => handlePipeResult(right, def.in, ctx));
2308
- }
2309
- return handlePipeResult(right, def.in, ctx);
2310
- }
2311
- const left = def.in._zod.run(payload, ctx);
2312
- if (left instanceof Promise) {
2313
- return left.then((left) => handlePipeResult(left, def.out, ctx));
2314
- }
2315
- return handlePipeResult(left, def.out, ctx);
2316
- };
2317
- });
2318
- function handlePipeResult(left, next, ctx) {
2319
- // Any issue stops the pipe, so a failing refinement never feeds its transform. An unrecognized key is the exception: it describes the input's extra properties, not the value being piped, and an enclosing intersection may yet reconcile it.
2320
- if (left.issues.some((iss) => iss.code !== "unrecognized_keys")) {
2321
- // prevent further checks
2322
- left.aborted = true;
2323
- return left;
2324
- }
2325
- return next._zod.run({ value: left.value, issues: left.issues }, ctx);
2326
- }
2327
- export const $ZodCodec = /*@__PURE__*/ core.$constructor("$ZodCodec", (inst, def) => {
2328
- $ZodType.init(inst, def);
2329
- util.defineLazyInternal(inst, "values", (zod) => zod.def.in._zod.values);
2330
- util.defineLazyInternal(inst, "optin", (zod) => zod.def.in._zod.optin);
2331
- util.defineLazyInternal(inst, "optout", (zod) => zod.def.out._zod.optout);
2332
- util.defineLazyInternal(inst, "propValues", (zod) => zod.def.in._zod.propValues);
2333
- inst._zod.parse = (payload, ctx) => {
2334
- const direction = ctx.direction || "forward";
2335
- if (direction === "forward") {
2336
- const left = def.in._zod.run(payload, ctx);
2337
- if (left instanceof Promise) {
2338
- return left.then((left) => handleCodecAResult(left, def, ctx));
2339
- }
2340
- return handleCodecAResult(left, def, ctx);
2341
- }
2342
- else {
2343
- const right = def.out._zod.run(payload, ctx);
2344
- if (right instanceof Promise) {
2345
- return right.then((right) => handleCodecAResult(right, def, ctx));
2346
- }
2347
- return handleCodecAResult(right, def, ctx);
2348
- }
2349
- };
2350
- });
2351
- function handleCodecAResult(result, def, ctx) {
2352
- if (result.issues.length) {
2353
- // prevent further checks
2354
- result.aborted = true;
2355
- return result;
2356
- }
2357
- const direction = ctx.direction || "forward";
2358
- if (direction === "forward") {
2359
- const transformed = def.transform(result.value, result);
2360
- if (transformed instanceof Promise) {
2361
- return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx));
2362
- }
2363
- return handleCodecTxResult(result, transformed, def.out, ctx);
2364
- }
2365
- else {
2366
- const transformed = def.reverseTransform(result.value, result);
2367
- if (transformed instanceof Promise) {
2368
- return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx));
2369
- }
2370
- return handleCodecTxResult(result, transformed, def.in, ctx);
2371
- }
2372
- }
2373
- function handleCodecTxResult(left, value, nextSchema, ctx) {
2374
- // Check if transform added any issues
2375
- if (left.issues.length) {
2376
- left.aborted = true;
2377
- return left;
2378
- }
2379
- return nextSchema._zod.run({ value, issues: left.issues }, ctx);
2380
- }
2381
- export const $ZodPreprocess = /*@__PURE__*/ core.$constructor("$ZodPreprocess", (inst, def) => {
2382
- $ZodPipe.init(inst, def);
2383
- });
2384
- export const $ZodReadonly = /*@__PURE__*/ core.$constructor("$ZodReadonly", (inst, def) => {
2385
- $ZodType.init(inst, def);
2386
- util.defineLazyInternal(inst, "propValues", (zod) => zod.def.innerType._zod.propValues);
2387
- util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2388
- util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType?._zod?.optin);
2389
- util.defineLazyInternal(inst, "optout", (zod) => zod.def.innerType?._zod?.optout);
2390
- inst._zod.parse = (payload, ctx) => {
2391
- if (ctx.direction === "backward") {
2392
- return def.innerType._zod.run(payload, ctx);
2393
- }
2394
- const result = def.innerType._zod.run(payload, ctx);
2395
- if (result instanceof Promise) {
2396
- return result.then(handleReadonlyResult);
2397
- }
2398
- return handleReadonlyResult(result);
2399
- };
2400
- });
2401
- function handleReadonlyResult(payload) {
2402
- // A repeat visit hands back a node that is still being built; freezing it here would make the rest of its keys fail to assign.
2403
- if (!payload.memo)
2404
- payload.value = Object.freeze(payload.value);
2405
- return payload;
2406
- }
2407
- // a leaf's pattern source with its own checks folded in: the last pattern-carrying check wins, else length bounds narrow the catch-all, else an integer format narrows the number form. the fold lives here instead of on `_zod.pattern` so a bundle without template literals never pays for it
2408
- function leafPattern(schema) {
2409
- const def = schema._zod.def;
2410
- let pattern = def.pattern;
2411
- let isInt = !!def.format?.includes("int");
2412
- let minimum;
2413
- let maximum;
2414
- for (const ch of def.checks ?? []) {
2415
- const d = ch._zod.def;
2416
- if (d.pattern)
2417
- pattern = d.pattern;
2418
- isInt || (isInt = !!d.format?.includes("int"));
2419
- const lo = d.minimum ?? d.length;
2420
- const hi = d.maximum ?? d.length;
2421
- if (lo !== undefined && (minimum === undefined || lo > minimum))
2422
- minimum = lo;
2423
- if (hi !== undefined && (maximum === undefined || hi < maximum))
2424
- maximum = hi;
2425
- }
2426
- if (pattern)
2427
- return pattern.source;
2428
- // an empty range matches nothing at runtime, and `{8,5}` is not a legal quantifier
2429
- if (minimum !== undefined && maximum !== undefined && minimum > maximum)
2430
- return "(?!)";
2431
- if (minimum !== undefined || maximum !== undefined)
2432
- return regexes.string({ minimum, maximum }).source;
2433
- const own = schema._zod.pattern;
2434
- return (isInt && own === regexes.number ? regexes.integer : own)?.source;
2435
- }
2436
- // a part's pattern source. a wrapper's pattern embeds its inner pattern's source verbatim, so the folded form is substituted in place without knowing the wrapper's own composition; a union's options are joined the way the union builds its own pattern
2437
- function partPattern(schema) {
2438
- const def = schema._zod.def;
2439
- const own = schema._zod.pattern?.source;
2440
- // lazy resolves its inner on the internals, not the def
2441
- const inner = def.innerType ?? schema._zod.innerType;
2442
- if (inner) {
2443
- const before = inner._zod.pattern?.source;
2444
- const after = partPattern(inner);
2445
- if (own && before && after && after !== before) {
2446
- return own.replace(util.cleanRegex(before), () => util.cleanRegex(after));
2447
- }
2448
- return own;
2449
- }
2450
- if (def.options) {
2451
- const sources = def.options.map(partPattern);
2452
- if (sources.every(Boolean))
2453
- return `^(${sources.map((s) => util.cleanRegex(s)).join("|")})$`;
2454
- }
2455
- return leafPattern(schema);
2456
- }
2457
- export const $ZodTemplateLiteral = /*@__PURE__*/ core.$constructor("$ZodTemplateLiteral", (inst, def) => {
2458
- $ZodType.init(inst, def);
2459
- const regexParts = [];
2460
- for (const part of def.parts) {
2461
- if (typeof part === "object" && part !== null) {
2462
- // is Zod schema
2463
- const source = partPattern(part);
2464
- if (!source) {
2465
- throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
2466
- }
2467
- regexParts.push(util.cleanRegex(source));
2468
- }
2469
- else if (part === null || util.primitiveTypes.has(typeof part)) {
2470
- regexParts.push(util.escapeRegex(`${part}`));
2471
- }
2472
- else {
2473
- throw new Error(`Invalid template literal part: ${part}`);
2474
- }
2475
- }
2476
- inst._zod.pattern = new RegExp(`^${regexParts.join("")}$`);
2477
- inst._zod.parse = (payload, _ctx) => {
2478
- if (typeof payload.value !== "string") {
2479
- payload.issues.push({
2480
- input: payload.value,
2481
- inst,
2482
- expected: "string",
2483
- code: "invalid_type",
2484
- });
2485
- return payload;
2486
- }
2487
- inst._zod.pattern.lastIndex = 0;
2488
- if (!inst._zod.pattern.test(payload.value)) {
2489
- payload.issues.push({
2490
- input: payload.value,
2491
- inst,
2492
- code: "invalid_format",
2493
- format: def.format ?? "template_literal",
2494
- pattern: inst._zod.pattern.source,
2495
- });
2496
- return payload;
2497
- }
2498
- return payload;
2499
- };
2500
- });
2501
- export const $ZodFunction = /*@__PURE__*/ core.$constructor("$ZodFunction", (inst, def) => {
2502
- $ZodType.init(inst, def);
2503
- // Defined, not assigned: the classic prototype exposes `_def` as a getter with no setter.
2504
- Object.defineProperty(inst, "_def", { value: def });
2505
- inst._zod.def = def;
2506
- inst.implement = (func) => {
2507
- if (typeof func !== "function") {
2508
- throw new Error("implement() must be called with a function");
2509
- }
2510
- // Defined inline so the closure stays anonymous: binding it to a `const` first names it, which costs 256 bytes per implemented function.
2511
- return Object.defineProperty(function (...args) {
2512
- const parsedArgs = inst._def.input ? parse(inst._def.input, args) : args;
2513
- const result = Reflect.apply(func, this, parsedArgs);
2514
- if (inst._def.output) {
2515
- return parse(inst._def.output, result);
2516
- }
2517
- return result;
2518
- }, "_zod", { value: inst._zod, enumerable: false });
2519
- };
2520
- inst.implementAsync = (func) => {
2521
- if (typeof func !== "function") {
2522
- throw new Error("implementAsync() must be called with a function");
2523
- }
2524
- return Object.defineProperty(async function (...args) {
2525
- const parsedArgs = inst._def.input ? await parseAsync(inst._def.input, args) : args;
2526
- const result = await Reflect.apply(func, this, parsedArgs);
2527
- if (inst._def.output) {
2528
- return await parseAsync(inst._def.output, result);
2529
- }
2530
- return result;
2531
- }, "_zod", { value: inst._zod, enumerable: false });
2532
- };
2533
- inst._zod.parse = (payload, _ctx) => {
2534
- if (typeof payload.value !== "function") {
2535
- payload.issues.push({
2536
- code: "invalid_type",
2537
- expected: "function",
2538
- input: payload.value,
2539
- inst,
2540
- });
2541
- return payload;
2542
- }
2543
- // Check if output is a promise type to determine if we should use async implementation
2544
- const hasPromiseOutput = inst._def.output && inst._def.output._zod.def.type === "promise";
2545
- if (hasPromiseOutput) {
2546
- payload.value = inst.implementAsync(payload.value);
2547
- }
2548
- else {
2549
- payload.value = inst.implement(payload.value);
2550
- }
2551
- return payload;
2552
- };
2553
- inst.input = (...args) => {
2554
- const F = inst.constructor;
2555
- if (Array.isArray(args[0])) {
2556
- return new F({
2557
- type: "function",
2558
- input: new $ZodTuple({
2559
- type: "tuple",
2560
- items: args[0],
2561
- rest: args[1],
2562
- }),
2563
- output: inst._def.output,
2564
- });
2565
- }
2566
- return new F({
2567
- type: "function",
2568
- input: args[0],
2569
- output: inst._def.output,
2570
- });
2571
- };
2572
- inst.output = (output) => {
2573
- const F = inst.constructor;
2574
- return new F({
2575
- type: "function",
2576
- input: inst._def.input,
2577
- output,
2578
- });
2579
- };
2580
- return inst;
2581
- });
2582
- export const $ZodPromise = /*@__PURE__*/ core.$constructor("$ZodPromise", (inst, def) => {
2583
- $ZodType.init(inst, def);
2584
- inst._zod.parse = (payload, ctx) => {
2585
- return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({ value: inner, issues: [] }, ctx));
2586
- };
2587
- });
2588
- export const $ZodLazy = /*@__PURE__*/ core.$constructor("$ZodLazy", (inst, def) => {
2589
- $ZodType.init(inst, def);
2590
- // Cache the resolved inner type on the shared `def` so all clones of this lazy (e.g. via `.describe()`/`.meta()`) share the same inner instance, preserving identity for cycle detection on recursive schemas.
2591
- util.defineLazy(inst._zod, "innerType", () => {
2592
- const d = def;
2593
- if (!d._cachedInner)
2594
- d._cachedInner = def.getter();
2595
- return d._cachedInner;
2596
- });
2597
- util.defineLazyInternal(inst, "pattern", (zod) => zod.innerType?._zod?.pattern);
2598
- util.defineLazyInternal(inst, "propValues", (zod) => zod.innerType?._zod?.propValues);
2599
- util.defineLazyInternal(inst, "optin", (zod) => zod.innerType?._zod?.optin ?? undefined);
2600
- util.defineLazyInternal(inst, "optout", (zod) => zod.innerType?._zod?.optout ?? undefined);
2601
- inst._zod.parse = (payload, ctx) => {
2602
- const inner = inst._zod.innerType;
2603
- return inner._zod.run(payload, ctx);
2604
- };
2605
- });
2606
- export const $ZodCustom = /*@__PURE__*/ core.$constructor("$ZodCustom", (inst, def) => {
2607
- checks.$ZodCheck.init(inst, def);
2608
- $ZodType.init(inst, def);
2609
- inst._zod.parse = (payload, _) => {
2610
- return payload;
2611
- };
2612
- inst._zod.check = (payload) => {
2613
- const input = payload.value;
2614
- const r = def.fn(input);
2615
- if (r instanceof Promise) {
2616
- return r.then((r) => handleRefineResult(r, payload, input, inst));
2617
- }
2618
- handleRefineResult(r, payload, input, inst);
2619
- return;
2620
- };
2621
- });
2622
- function handleRefineResult(result, payload, input, inst) {
2623
- if (!result) {
2624
- const _iss = {
2625
- code: "custom",
2626
- input,
2627
- inst, // incorporates params.error into issue reporting
2628
- path: [...(inst._zod.def.path ?? [])], // incorporates params.error into issue reporting
2629
- continue: !inst._zod.def.abort,
2630
- // params: inst._zod.def.params,
2631
- };
2632
- if (inst._zod.def.params)
2633
- _iss.params = inst._zod.def.params;
2634
- payload.issues.push(util.issue(_iss));
2635
- }
2636
- }