@qredence/fleet 0.5.1 → 0.5.7

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 (200) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/bin/fleet-prime.mjs +6 -0
  3. package/dist/web/client/assets/action-swap-roll-BB8DFMuf.js +1 -0
  4. package/dist/web/client/assets/agent-activity-CDcDNVC6.js +1 -0
  5. package/dist/web/client/assets/agent-disclosure-B8SnhQXL.js +1 -0
  6. package/dist/web/client/assets/analytics-stub-B8MIkiDB.js +1 -0
  7. package/dist/web/client/assets/{artifacts-panel-CX62LQ13.js → artifacts-panel-CmHYXfoo.js} +1 -1
  8. package/dist/web/client/assets/button-BV9NafmI.js +1 -0
  9. package/dist/web/client/assets/{chat-CsepBQwy.js → chat-W-yOMyG_.js} +1 -1
  10. package/dist/web/client/assets/chat-command-palette-DiG-i3uJ.js +1 -0
  11. package/dist/web/client/assets/check-JjHKAZas.js +1 -0
  12. package/dist/web/client/assets/chevron-up-CnSvySGH.js +1 -0
  13. package/dist/web/client/assets/circle-alert-CONlFReH.js +1 -0
  14. package/dist/web/client/assets/circle-x-CkKCB__4.js +1 -0
  15. package/dist/web/client/assets/citations-CpTFUvx7.js +2 -0
  16. package/dist/web/client/assets/collapsible-BoXtZZWN.js +1 -0
  17. package/dist/web/client/assets/command-Cx-UYeQ9.js +1 -0
  18. package/dist/web/client/assets/createBaseUIEventDetails-DV0dQrBX.js +1 -0
  19. package/dist/web/client/assets/dialog-Dh7WpGIu.js +1 -0
  20. package/dist/web/client/assets/dist-BPaFisIZ.js +41 -0
  21. package/dist/web/client/assets/earth-DGZXAN5r.js +1 -0
  22. package/dist/web/client/assets/ease-u56MhKYS.js +1 -0
  23. package/dist/web/client/assets/file-text-T-NcAlZs.js +1 -0
  24. package/dist/web/client/assets/fleet-message-queue-B6zAK-hX.js +1 -0
  25. package/dist/web/client/assets/{fleet-pi-tool-renderer-BD_ZAjlG.js → fleet-pi-tool-renderer-Btq9mDUe.js} +29 -29
  26. package/dist/web/client/assets/fleet-reasoning-panel-MtbSdoCv.js +1 -0
  27. package/dist/web/client/assets/fleet-subagent-list-iszvrvy_.js +1 -0
  28. package/dist/web/client/assets/fleet-tool-timeline-COzPrwr8.js +1 -0
  29. package/dist/web/client/assets/{fork-picker-dialog-C2cVJUbf.js → fork-picker-dialog-CAhWx0G5.js} +1 -1
  30. package/dist/web/client/assets/gauge-DNpstbBn.js +1 -0
  31. package/dist/web/client/assets/generative-text-renderer-C1JrmYfx.js +6 -0
  32. package/dist/web/client/assets/globals-Bfr0jrPq.css +2 -0
  33. package/dist/web/client/assets/horizontal-resize-Bl3AyBJg.js +1 -0
  34. package/dist/web/client/assets/image-BbPmlw-n.js +1 -0
  35. package/dist/web/client/assets/index-QgUwd4m8.js +12 -0
  36. package/dist/web/client/assets/input-Bol3TP4v.js +1 -0
  37. package/dist/web/client/assets/input-group-D5gi9zBK.js +1 -0
  38. package/dist/web/client/assets/{ipython-tool-BfeIa0nK.js → ipython-tool-BrMePqD-.js} +1 -1
  39. package/dist/web/client/assets/{markdown-DG7pUdsX.js → markdown-RD_ydkyD.js} +2 -2
  40. package/dist/web/client/assets/{markdown-code-BgMzpy7O.js → markdown-code-ETqXqY8E.js} +1 -1
  41. package/dist/web/client/assets/message-square-hbDao-A1.js +1 -0
  42. package/dist/web/client/assets/model-selector-list-CJY9pyt2.js +1 -0
  43. package/dist/web/client/assets/notify-DKTqXChG.js +1 -0
  44. package/dist/web/client/assets/{openui-renderer-DlUo6ehT.js → openui-renderer-BZMghkzQ.js} +8 -8
  45. package/dist/web/client/assets/{prime-agent-artifacts-CHGb5V_j.js → prime-agent-artifacts-C-g1VPiW.js} +1 -1
  46. package/dist/web/client/assets/prompt-suggestions-CXM6knMK.js +1 -0
  47. package/dist/web/client/assets/provider-catalog-CHKFGwHr.js +1 -0
  48. package/dist/web/client/assets/provider-label-KkqVX1CI.js +1 -0
  49. package/dist/web/client/assets/range-BWOHiLNe.js +1 -0
  50. package/dist/web/client/assets/refresh-cw-IThTJ3j-.js +1 -0
  51. package/dist/web/client/assets/repl-panel-CCh4ly7J.js +1 -0
  52. package/dist/web/client/assets/{resource-helpers-ULlyU8qK.js → resource-helpers-Q2T0YCMO.js} +1 -1
  53. package/dist/web/client/assets/resources-panel-Bo8dfUdm.js +1 -0
  54. package/dist/web/client/assets/right-panel-context-B2VAZ2p4.js +1 -0
  55. package/dist/web/client/assets/right-panel-registry-C5fQcBKw.js +2 -0
  56. package/dist/web/client/assets/routes-C1hRkRkv.js +16 -0
  57. package/dist/web/client/assets/safe-external-url-D3PJJIcM.js +1 -0
  58. package/dist/web/client/assets/session-insights-panel-CQdT90Op.js +1 -0
  59. package/dist/web/client/assets/settings-dialog-CvvM6T0m.js +1 -0
  60. package/dist/web/client/assets/{sparkles-C5H3Jtgf.js → shield-check-CkA2viVW.js} +1 -1
  61. package/dist/web/client/assets/{skeleton-loaders-fStjEeRP.js → skeleton-loaders-DjGv9LLA.js} +1 -1
  62. package/dist/web/client/assets/sparkles-DuclzqlE.js +1 -0
  63. package/dist/web/client/assets/subagent-chat-panel-tGCg6gcn.js +1 -0
  64. package/dist/web/client/assets/subagent-transcript-NO0PR8RU.js +1 -0
  65. package/dist/web/client/assets/subagent-utils-CQbaJ1g-.js +1 -0
  66. package/dist/web/client/assets/subagents-panel-BkFLsQQY.js +1 -0
  67. package/dist/web/client/assets/surfaces-cW-gp56p.js +1 -0
  68. package/dist/web/client/assets/switch-CcOFiQBK.js +1 -0
  69. package/dist/web/client/assets/terminal-DOS1s1gm.js +1 -0
  70. package/dist/web/client/assets/toast-ATq44uAL.js +1 -0
  71. package/dist/web/client/assets/tool-result-pklnrxSW.js +4 -0
  72. package/dist/web/client/assets/use-reduced-motion-eORd7fqW.js +9 -0
  73. package/dist/web/client/assets/useBaseUiId-CHqXB2UQ.js +1 -0
  74. package/dist/web/client/assets/useControlled-CJJ9BOQB.js +1 -0
  75. package/dist/web/client/assets/workspace-panel-BmMW7h7b.js +1 -0
  76. package/dist/web/client/assets/wrench-BJNNe07k.js +1 -0
  77. package/dist/web/client/assets/x-CsRC_tCI.js +1 -0
  78. package/dist/web/client/bundle-budget.json +10 -0
  79. package/dist/web/server/_tanstack-start-manifest_v-B4BnRTa_-DR7WQTT5.js +90 -0
  80. package/dist/web/server/agent-activity-Dx6AlDhN-JXOL2EXK.js +514 -0
  81. package/dist/web/server/{artifacts-panel-D9w1DHAN-FGRDCYU2.js → artifacts-panel-CloS3-ij-XWYXKL6A.js} +30 -22
  82. package/dist/web/server/{chat-command-palette-BaenPkCN-BHSOPGU4.js → chat-command-palette-Cc0uGvNm-GKENKTO7.js} +48 -22
  83. package/dist/web/server/{chunk-KPNGZR2R.js → chunk-3B6M63AO.js} +206 -209
  84. package/dist/web/server/chunk-3D4Z32XA.js +22 -0
  85. package/dist/web/server/chunk-3SSHBMDS.js +196 -0
  86. package/dist/web/server/chunk-4PQ6OD6J.js +22 -0
  87. package/dist/web/server/{chunk-5AVQZ4AZ.js → chunk-4UBOIY2S.js} +2 -1
  88. package/dist/web/server/chunk-56SEDI5N.js +19 -0
  89. package/dist/web/server/chunk-6QNW66XR.js +19 -0
  90. package/dist/web/server/chunk-744IIIDL.js +19 -0
  91. package/dist/web/server/{chunk-52SJQXO4.js → chunk-7PQTPSEE.js} +568 -568
  92. package/dist/web/server/{chunk-XYYNYFFD.js → chunk-7SR6WDM2.js} +2 -2
  93. package/dist/web/server/chunk-ANL4B775.js +60 -0
  94. package/dist/web/server/chunk-BNQWMQHD.js +35 -0
  95. package/dist/web/server/{chunk-X2TUFLTP.js → chunk-C5X6G26O.js} +436 -454
  96. package/dist/web/server/chunk-C66BSNA6.js +42 -0
  97. package/dist/web/server/{chunk-3GSFXWL5.js → chunk-DEUBJJZN.js} +4 -59
  98. package/dist/web/server/chunk-E365EOXJ.js +35 -0
  99. package/dist/web/server/{chunk-5WZFFNFY.js → chunk-EFAGCVZ3.js} +2 -23
  100. package/dist/web/server/{chunk-Y6LJ4WBI.js → chunk-EGQ6ZX4D.js} +563 -830
  101. package/dist/web/server/{chunk-DO3TVNGA.js → chunk-EKBKGAWX.js} +12 -10
  102. package/dist/web/server/{chunk-RPROZ2JC.js → chunk-F6MGAW3L.js} +133 -133
  103. package/dist/web/server/chunk-GABXCOY3.js +37 -0
  104. package/dist/web/server/chunk-GV7DJIHY.js +36 -0
  105. package/dist/web/server/{chunk-PWK2HJIV.js → chunk-HSJMLO36.js} +5 -252
  106. package/dist/web/server/{chunk-46VQY7SG.js → chunk-HU4AIJV3.js} +4 -4
  107. package/dist/web/server/{chunk-H64JLONZ.js → chunk-HZY3LBGP.js} +146 -2
  108. package/dist/web/server/{chunk-3IKSPTYI.js → chunk-J6MRJXUH.js} +22 -15
  109. package/dist/web/server/{chunk-FE4KN6T2.js → chunk-JOSTE7WK.js} +7 -5
  110. package/dist/web/server/{chunk-QJBEWT4E.js → chunk-K3BXQG3N.js} +27 -292
  111. package/dist/web/server/chunk-K4ESBQ3R.js +20 -0
  112. package/dist/web/server/chunk-KOIPYBJF.js +3773 -0
  113. package/dist/web/server/{chunk-44IVTHDV.js → chunk-KZSM3BHO.js} +28 -119
  114. package/dist/web/server/chunk-L46H6IDX.js +13 -0
  115. package/dist/web/server/chunk-LNGWHEE6.js +206 -0
  116. package/dist/web/server/{chunk-2U7PWSJX.js → chunk-MOSVTKH5.js} +262 -3661
  117. package/dist/web/server/{chunk-MDYA4NXK.js → chunk-NJRYX4A2.js} +4 -4
  118. package/dist/web/server/chunk-NNMZQN7Q.js +296 -0
  119. package/dist/web/server/{chunk-VHCAD46L.js → chunk-NPPG2GTW.js} +7 -7
  120. package/dist/web/server/{chunk-AZZHUVJR.js → chunk-PJNYH5SR.js} +7 -303
  121. package/dist/web/server/{chunk-7APYEQIO.js → chunk-QAE5SXDK.js} +1 -24
  122. package/dist/web/server/chunk-QTFCJGOY.js +189 -0
  123. package/dist/web/server/{chunk-FBOO3G67.js → chunk-RANJ6OJ3.js} +9 -9
  124. package/dist/web/server/chunk-RPBSDXJ4.js +62 -0
  125. package/dist/web/server/{chunk-PCJ5EKFE.js → chunk-RYHIJMFD.js} +63 -34
  126. package/dist/web/server/{chunk-NLIUTTKL.js → chunk-S3PQ6HKH.js} +1 -16
  127. package/dist/web/server/chunk-SG4W4SPQ.js +31 -0
  128. package/dist/web/server/{chunk-LESNF5O4.js → chunk-T23OO4SC.js} +2 -11
  129. package/dist/web/server/{chunk-FVWDJNXR.js → chunk-UNZJQ7CY.js} +6 -4
  130. package/dist/web/server/chunk-V3S6BVXO.js +22 -0
  131. package/dist/web/server/{chunk-M2FGGPNA.js → chunk-VGDP4YDU.js} +70 -45
  132. package/dist/web/server/{chunk-WK7CQS2N.js → chunk-W5GRNHV5.js} +51 -49
  133. package/dist/web/server/{chunk-HBZ6YKRB.js → chunk-WN77JNYY.js} +2 -2
  134. package/dist/web/server/{chunk-B2F6MLVZ.js → chunk-XFVL5ITL.js} +2246 -2228
  135. package/dist/web/server/{chunk-EIVNRYP3.js → chunk-XKYEXPLQ.js} +2 -17
  136. package/dist/web/server/{chunk-6GMKRR3C.js → chunk-XNYQSCB2.js} +2 -2
  137. package/dist/web/server/chunk-YHXAXJ6I.js +22 -0
  138. package/dist/web/server/chunk-YLMXYMLG.js +86 -0
  139. package/dist/web/server/chunk-YNGDUWCF.js +56 -0
  140. package/dist/web/server/chunk-ZJFA4F5X.js +280 -0
  141. package/dist/web/server/fleet-message-queue-Bn0_3Efe-G4BZR2EU.js +74 -0
  142. package/dist/web/server/fleet-pi-tool-renderer-C52SZmPx-CIAH3IV7.js +51 -0
  143. package/dist/web/server/fleet-reasoning-panel-C_e7wzVm-SDHEWDQT.js +199 -0
  144. package/dist/web/server/fleet-subagent-list-CQltKswG-EKCMQHDI.js +18 -0
  145. package/dist/web/server/fleet-tool-timeline-KENErMKg-HTN7SW3D.js +16 -0
  146. package/dist/web/server/{fork-picker-dialog-BZzfxdQd-Y725VJ7G.js → fork-picker-dialog-DK9YGQuB-4QEFWRU4.js} +6 -5
  147. package/dist/web/server/{markdown-Boni3lHk-AZGKDNAR.js → markdown-QcSUaLyd-6DJUK5NC.js} +1 -1
  148. package/dist/web/server/{markdown-code-BrWukbg3-D2GN4Y77.js → markdown-code-Dyo1_13a-52ZQZSPE.js} +2 -2
  149. package/dist/web/server/model-selector-list-CEfWjRc--GBW2GUO6.js +289 -0
  150. package/dist/web/server/{openui-renderer-Cg4RSE9k-7BTJIYZJ.js → openui-renderer-Dk0Ak9cW-MUJQHDAS.js} +19 -16
  151. package/dist/web/server/prompt-suggestions-BOmHi4-J-C563CHFU.js +30 -0
  152. package/dist/web/server/{repl-panel-BEQrC2ef-V3YEZ7EO.js → repl-panel-D9E8nkQy-L45ZNG2V.js} +4 -3
  153. package/dist/web/server/{resources-panel-CwKh4U9f-D3VDEMDW.js → resources-panel-B03M8bEp-SZG726N5.js} +7 -6
  154. package/dist/web/server/{router-CEahIUpn-SRG7XKIH.js → router-BE9HcX2W-JMQ3JWE5.js} +1756 -1374
  155. package/dist/web/server/{routes-BznemByz-F4DJAYIM.js → routes-CJTRGB1Z-WJKXJFFT.js} +3748 -3955
  156. package/dist/web/server/server.js +3 -3
  157. package/dist/web/server/{session-insights-panel-JfeTHE0d-3HZB3ZWI.js → session-insights-panel-BHZyKDTo-LRMAMA3O.js} +4 -2
  158. package/dist/web/server/{settings-dialog-DgeBMORv-7SRSENPM.js → settings-dialog-yDibpbBH-TCLJ7NRJ.js} +172 -161
  159. package/dist/web/server/{start-CLAD7RcD-56S4BWMM.js → start-BYVnok_H-IA6TWGA3.js} +1 -1
  160. package/dist/web/server/subagent-chat-panel-B1YoZIKO-DFRUDQJ2.js +82 -0
  161. package/dist/web/server/subagents-panel-dJJwpsEL-FTWWCHND.js +200 -0
  162. package/dist/web/server/{workspace-panel-y54P79_B-VPIYUXF6.js → workspace-panel-BC_H8Jri-5MHAEQQS.js} +22 -18
  163. package/package.json +5 -5
  164. package/dist/web/client/assets/analytics-stub-Jh3lkb8P.js +0 -1
  165. package/dist/web/client/assets/button-0At5xSyU.js +0 -1
  166. package/dist/web/client/assets/chat-command-palette-C4sSf8Kg.js +0 -1
  167. package/dist/web/client/assets/collapsible-DmyYcezk.js +0 -1
  168. package/dist/web/client/assets/command-CB6emP8m.js +0 -2
  169. package/dist/web/client/assets/conversation-turns-ByFoWPXe.js +0 -6
  170. package/dist/web/client/assets/dialog-DZ44tBtH.js +0 -1
  171. package/dist/web/client/assets/dist-MNgIFxqY.js +0 -41
  172. package/dist/web/client/assets/ease-vFBiNFNK.js +0 -9
  173. package/dist/web/client/assets/file-text-BhQ0ZnoU.js +0 -1
  174. package/dist/web/client/assets/globals-CqqQdk2S.css +0 -2
  175. package/dist/web/client/assets/horizontal-resize-C1TpRLNC.js +0 -1
  176. package/dist/web/client/assets/index-DweoFRMs.js +0 -12
  177. package/dist/web/client/assets/input-CqC82Agz.js +0 -1
  178. package/dist/web/client/assets/input-group-H0TG-mkU.js +0 -1
  179. package/dist/web/client/assets/notify-Duj26eeZ.js +0 -1
  180. package/dist/web/client/assets/provider-catalog-BZhZuKSz.js +0 -1
  181. package/dist/web/client/assets/provider-label-jKm8v18u.js +0 -1
  182. package/dist/web/client/assets/range-vSJ7Ux_5.js +0 -2
  183. package/dist/web/client/assets/repl-panel-DiGS6uCw.js +0 -1
  184. package/dist/web/client/assets/resources-panel-DSU7VGX2.js +0 -1
  185. package/dist/web/client/assets/routes-CxlNCi_v.js +0 -16
  186. package/dist/web/client/assets/safe-external-url-Bl_78dpZ.js +0 -1
  187. package/dist/web/client/assets/session-insights-panel-DwmwiikS.js +0 -1
  188. package/dist/web/client/assets/settings-dialog-CkfpTKfM.js +0 -1
  189. package/dist/web/client/assets/subagents-panel-DGnsK6Nx.js +0 -1
  190. package/dist/web/client/assets/switch-BFEBpUEU.js +0 -1
  191. package/dist/web/client/assets/toast-C4s7FYYa.js +0 -1
  192. package/dist/web/client/assets/tool-result-CBzwwUE9.js +0 -4
  193. package/dist/web/client/assets/useBaseUiId-B9f7fokB.js +0 -1
  194. package/dist/web/client/assets/useControlled-CoY1jSuL.js +0 -1
  195. package/dist/web/client/assets/workspace-panel-CjdXlEvd.js +0 -1
  196. package/dist/web/client/assets/x-BgciQ7_C.js +0 -1
  197. package/dist/web/server/_tanstack-start-manifest_v-bDUlyKY0-KFW35JRO.js +0 -82
  198. package/dist/web/server/chunk-ZEVZFLIY.js +0 -334
  199. package/dist/web/server/fleet-pi-tool-renderer-lJvZWmBJ-4M5YI6VS.js +0 -35
  200. package/dist/web/server/subagents-panel-CzZe3co7-2VZ5JTWF.js +0 -332
@@ -2,1733 +2,248 @@ import {
2
2
  __export
3
3
  } from "./chunk-MLKGABMK.js";
4
4
 
5
- // node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js
6
- var _a;
7
- var $output = /* @__PURE__ */ Symbol("ZodOutput");
8
- var $input = /* @__PURE__ */ Symbol("ZodInput");
9
- var $ZodRegistry = class {
10
- constructor() {
11
- this._map = /* @__PURE__ */ new WeakMap();
12
- this._idmap = /* @__PURE__ */ new Map();
13
- }
14
- add(schema, ..._meta) {
15
- const meta3 = _meta[0];
16
- this._map.set(schema, meta3);
17
- if (meta3 && typeof meta3 === "object" && "id" in meta3) {
18
- this._idmap.set(meta3.id, schema);
19
- }
20
- return this;
21
- }
22
- clear() {
23
- this._map = /* @__PURE__ */ new WeakMap();
24
- this._idmap = /* @__PURE__ */ new Map();
25
- return this;
26
- }
27
- remove(schema) {
28
- const meta3 = this._map.get(schema);
29
- if (meta3 && typeof meta3 === "object" && "id" in meta3) {
30
- this._idmap.delete(meta3.id);
31
- }
32
- this._map.delete(schema);
33
- return this;
34
- }
35
- get(schema) {
36
- const p = schema._zod.parent;
37
- if (p) {
38
- const pm = { ...this.get(p) ?? {} };
39
- delete pm.id;
40
- const f = { ...pm, ...this._map.get(schema) };
41
- return Object.keys(f).length ? f : void 0;
42
- }
43
- return this._map.get(schema);
44
- }
45
- has(schema) {
46
- return this._map.has(schema);
47
- }
48
- };
49
- function registry() {
50
- return new $ZodRegistry();
51
- }
52
- (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
53
- var globalRegistry = globalThis.__zod_globalRegistry;
54
-
55
- // node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js
56
- function initializeContext(params) {
57
- let target = params?.target ?? "draft-2020-12";
58
- if (target === "draft-4")
59
- target = "draft-04";
60
- if (target === "draft-7")
61
- target = "draft-07";
62
- return {
63
- processors: params.processors ?? {},
64
- metadataRegistry: params?.metadata ?? globalRegistry,
65
- target,
66
- unrepresentable: params?.unrepresentable ?? "throw",
67
- override: params?.override ?? (() => {
68
- }),
69
- io: params?.io ?? "output",
70
- counter: 0,
71
- seen: /* @__PURE__ */ new Map(),
72
- cycles: params?.cycles ?? "ref",
73
- reused: params?.reused ?? "inline",
74
- external: params?.external ?? void 0
75
- };
76
- }
77
- function process(schema, ctx, _params = { path: [], schemaPath: [] }) {
78
- var _a3;
79
- const def = schema._zod.def;
80
- const seen = ctx.seen.get(schema);
81
- if (seen) {
82
- seen.count++;
83
- const isCycle = _params.schemaPath.includes(schema);
84
- if (isCycle) {
85
- seen.cycle = _params.path;
86
- }
87
- return seen.schema;
88
- }
89
- const result = { schema: {}, count: 1, cycle: void 0, path: _params.path };
90
- ctx.seen.set(schema, result);
91
- const overrideSchema = schema._zod.toJSONSchema?.();
92
- if (overrideSchema) {
93
- result.schema = overrideSchema;
94
- } else {
95
- const params = {
96
- ..._params,
97
- schemaPath: [..._params.schemaPath, schema],
98
- path: _params.path
99
- };
100
- if (schema._zod.processJSONSchema) {
101
- schema._zod.processJSONSchema(ctx, result.schema, params);
102
- } else {
103
- const _json = result.schema;
104
- const processor = ctx.processors[def.type];
105
- if (!processor) {
106
- throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);
107
- }
108
- processor(schema, ctx, _json, params);
109
- }
110
- const parent = schema._zod.parent;
111
- if (parent) {
112
- if (!result.ref)
113
- result.ref = parent;
114
- process(parent, ctx, params);
115
- ctx.seen.get(parent).isParent = true;
116
- }
117
- }
118
- const meta3 = ctx.metadataRegistry.get(schema);
119
- if (meta3)
120
- Object.assign(result.schema, meta3);
121
- if (ctx.io === "input" && isTransforming(schema)) {
122
- delete result.schema.examples;
123
- delete result.schema.default;
124
- }
125
- if (ctx.io === "input" && "_prefault" in result.schema)
126
- (_a3 = result.schema).default ?? (_a3.default = result.schema._prefault);
127
- delete result.schema._prefault;
128
- const _result = ctx.seen.get(schema);
129
- return _result.schema;
130
- }
131
- function extractDefs(ctx, schema) {
132
- const root = ctx.seen.get(schema);
133
- if (!root)
134
- throw new Error("Unprocessed schema. This is a bug in Zod.");
135
- const idToSchema = /* @__PURE__ */ new Map();
136
- for (const entry of ctx.seen.entries()) {
137
- const id = ctx.metadataRegistry.get(entry[0])?.id;
138
- if (id) {
139
- const existing = idToSchema.get(id);
140
- if (existing && existing !== entry[0]) {
141
- throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
142
- }
143
- idToSchema.set(id, entry[0]);
144
- }
145
- }
146
- const makeURI = (entry) => {
147
- const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
148
- if (ctx.external) {
149
- const externalId = ctx.external.registry.get(entry[0])?.id;
150
- const uriGenerator = ctx.external.uri ?? ((id2) => id2);
151
- if (externalId) {
152
- return { ref: uriGenerator(externalId) };
153
- }
154
- const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
155
- entry[1].defId = id;
156
- return { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}` };
157
- }
158
- if (entry[1] === root) {
159
- return { ref: "#" };
160
- }
161
- const uriPrefix = `#`;
162
- const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
163
- const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
164
- return { defId, ref: defUriPrefix + defId };
165
- };
166
- const extractToDef = (entry) => {
167
- if (entry[1].schema.$ref) {
168
- return;
169
- }
170
- const seen = entry[1];
171
- const { ref, defId } = makeURI(entry);
172
- seen.def = { ...seen.schema };
173
- if (defId)
174
- seen.defId = defId;
175
- const schema2 = seen.schema;
176
- for (const key in schema2) {
177
- delete schema2[key];
178
- }
179
- schema2.$ref = ref;
180
- };
181
- if (ctx.cycles === "throw") {
182
- for (const entry of ctx.seen.entries()) {
183
- const seen = entry[1];
184
- if (seen.cycle) {
185
- throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/<root>
186
-
187
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
188
- }
189
- }
190
- }
191
- for (const entry of ctx.seen.entries()) {
192
- const seen = entry[1];
193
- if (schema === entry[0]) {
194
- extractToDef(entry);
195
- continue;
196
- }
197
- if (ctx.external) {
198
- const ext = ctx.external.registry.get(entry[0])?.id;
199
- if (schema !== entry[0] && ext) {
200
- extractToDef(entry);
201
- continue;
202
- }
203
- }
204
- const id = ctx.metadataRegistry.get(entry[0])?.id;
205
- if (id) {
206
- extractToDef(entry);
207
- continue;
208
- }
209
- if (seen.cycle) {
210
- extractToDef(entry);
211
- continue;
212
- }
213
- if (seen.count > 1) {
214
- if (ctx.reused === "ref") {
215
- extractToDef(entry);
216
- continue;
217
- }
218
- }
219
- }
220
- }
221
- function finalize(ctx, schema) {
222
- const root = ctx.seen.get(schema);
223
- if (!root)
224
- throw new Error("Unprocessed schema. This is a bug in Zod.");
225
- const flattenRef = (zodSchema) => {
226
- const seen = ctx.seen.get(zodSchema);
227
- if (seen.ref === null)
228
- return;
229
- const schema2 = seen.def ?? seen.schema;
230
- const _cached = { ...schema2 };
231
- const ref = seen.ref;
232
- seen.ref = null;
233
- if (ref) {
234
- flattenRef(ref);
235
- const refSeen = ctx.seen.get(ref);
236
- const refSchema = refSeen.schema;
237
- if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
238
- schema2.allOf = schema2.allOf ?? [];
239
- schema2.allOf.push(refSchema);
240
- } else {
241
- Object.assign(schema2, refSchema);
242
- }
243
- Object.assign(schema2, _cached);
244
- const isParentRef = zodSchema._zod.parent === ref;
245
- if (isParentRef) {
246
- for (const key in schema2) {
247
- if (key === "$ref" || key === "allOf")
248
- continue;
249
- if (!(key in _cached)) {
250
- delete schema2[key];
251
- }
252
- }
253
- }
254
- if (refSchema.$ref && refSeen.def) {
255
- for (const key in schema2) {
256
- if (key === "$ref" || key === "allOf")
257
- continue;
258
- if (key in refSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(refSeen.def[key])) {
259
- delete schema2[key];
260
- }
261
- }
262
- }
263
- }
264
- const parent = zodSchema._zod.parent;
265
- if (parent && parent !== ref) {
266
- flattenRef(parent);
267
- const parentSeen = ctx.seen.get(parent);
268
- if (parentSeen?.schema.$ref) {
269
- schema2.$ref = parentSeen.schema.$ref;
270
- if (parentSeen.def) {
271
- for (const key in schema2) {
272
- if (key === "$ref" || key === "allOf")
273
- continue;
274
- if (key in parentSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(parentSeen.def[key])) {
275
- delete schema2[key];
276
- }
277
- }
278
- }
279
- }
280
- }
281
- ctx.override({
282
- zodSchema,
283
- jsonSchema: schema2,
284
- path: seen.path ?? []
285
- });
286
- };
287
- for (const entry of [...ctx.seen.entries()].reverse()) {
288
- flattenRef(entry[0]);
289
- }
290
- const result = {};
291
- if (ctx.target === "draft-2020-12") {
292
- result.$schema = "https://json-schema.org/draft/2020-12/schema";
293
- } else if (ctx.target === "draft-07") {
294
- result.$schema = "http://json-schema.org/draft-07/schema#";
295
- } else if (ctx.target === "draft-04") {
296
- result.$schema = "http://json-schema.org/draft-04/schema#";
297
- } else if (ctx.target === "openapi-3.0") {
298
- } else {
299
- }
300
- if (ctx.external?.uri) {
301
- const id = ctx.external.registry.get(schema)?.id;
302
- if (!id)
303
- throw new Error("Schema is missing an `id` property");
304
- result.$id = ctx.external.uri(id);
305
- }
306
- Object.assign(result, root.def ?? root.schema);
307
- const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
308
- if (rootMetaId !== void 0 && result.id === rootMetaId)
309
- delete result.id;
310
- const defs = ctx.external?.defs ?? {};
311
- for (const entry of ctx.seen.entries()) {
312
- const seen = entry[1];
313
- if (seen.def && seen.defId) {
314
- if (seen.def.id === seen.defId)
315
- delete seen.def.id;
316
- defs[seen.defId] = seen.def;
317
- }
318
- }
319
- if (ctx.external) {
320
- } else {
321
- if (Object.keys(defs).length > 0) {
322
- if (ctx.target === "draft-2020-12") {
323
- result.$defs = defs;
324
- } else {
325
- result.definitions = defs;
326
- }
327
- }
328
- }
329
- try {
330
- const finalized = JSON.parse(JSON.stringify(result));
331
- Object.defineProperty(finalized, "~standard", {
332
- value: {
333
- ...schema["~standard"],
334
- jsonSchema: {
335
- input: createStandardJSONSchemaMethod(schema, "input", ctx.processors),
336
- output: createStandardJSONSchemaMethod(schema, "output", ctx.processors)
337
- }
338
- },
339
- enumerable: false,
340
- writable: false
341
- });
342
- return finalized;
343
- } catch (_err) {
344
- throw new Error("Error converting schema to JSON.");
345
- }
346
- }
347
- function isTransforming(_schema, _ctx) {
348
- const ctx = _ctx ?? { seen: /* @__PURE__ */ new Set() };
349
- if (ctx.seen.has(_schema))
350
- return false;
351
- ctx.seen.add(_schema);
352
- const def = _schema._zod.def;
353
- if (def.type === "transform")
354
- return true;
355
- if (def.type === "array")
356
- return isTransforming(def.element, ctx);
357
- if (def.type === "set")
358
- return isTransforming(def.valueType, ctx);
359
- if (def.type === "lazy")
360
- return isTransforming(def.getter(), ctx);
361
- if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") {
362
- return isTransforming(def.innerType, ctx);
363
- }
364
- if (def.type === "intersection") {
365
- return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
366
- }
367
- if (def.type === "record" || def.type === "map") {
368
- return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
369
- }
370
- if (def.type === "pipe") {
371
- if (_schema._zod.traits.has("$ZodCodec"))
372
- return true;
373
- return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
374
- }
375
- if (def.type === "object") {
376
- for (const key in def.shape) {
377
- if (isTransforming(def.shape[key], ctx))
378
- return true;
379
- }
380
- return false;
381
- }
382
- if (def.type === "union") {
383
- for (const option of def.options) {
384
- if (isTransforming(option, ctx))
385
- return true;
386
- }
387
- return false;
388
- }
389
- if (def.type === "tuple") {
390
- for (const item of def.items) {
391
- if (isTransforming(item, ctx))
392
- return true;
393
- }
394
- if (def.rest && isTransforming(def.rest, ctx))
395
- return true;
396
- return false;
397
- }
398
- return false;
399
- }
400
- var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
401
- const ctx = initializeContext({ ...params, processors });
402
- process(schema, ctx);
403
- extractDefs(ctx, schema);
404
- return finalize(ctx, schema);
405
- };
406
- var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
407
- const { libraryOptions, target } = params ?? {};
408
- const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
409
- process(schema, ctx);
410
- extractDefs(ctx, schema);
411
- return finalize(ctx, schema);
412
- };
413
-
414
- // node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
415
- var util_exports = {};
416
- __export(util_exports, {
417
- BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
418
- Class: () => Class,
419
- NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
420
- aborted: () => aborted,
421
- allowsEval: () => allowsEval,
422
- assert: () => assert,
423
- assertEqual: () => assertEqual,
424
- assertIs: () => assertIs,
425
- assertNever: () => assertNever,
426
- assertNotEqual: () => assertNotEqual,
427
- assignProp: () => assignProp,
428
- base64ToUint8Array: () => base64ToUint8Array,
429
- base64urlToUint8Array: () => base64urlToUint8Array,
430
- cached: () => cached,
431
- captureStackTrace: () => captureStackTrace,
432
- cleanEnum: () => cleanEnum,
433
- cleanRegex: () => cleanRegex,
434
- clone: () => clone,
435
- cloneDef: () => cloneDef,
436
- createTransparentProxy: () => createTransparentProxy,
437
- defineLazy: () => defineLazy,
438
- esc: () => esc,
439
- escapeRegex: () => escapeRegex,
440
- explicitlyAborted: () => explicitlyAborted,
441
- extend: () => extend,
442
- finalizeIssue: () => finalizeIssue,
443
- floatSafeRemainder: () => floatSafeRemainder,
444
- getElementAtPath: () => getElementAtPath,
445
- getEnumValues: () => getEnumValues,
446
- getLengthableOrigin: () => getLengthableOrigin,
447
- getParsedType: () => getParsedType,
448
- getSizableOrigin: () => getSizableOrigin,
449
- hexToUint8Array: () => hexToUint8Array,
450
- isObject: () => isObject,
451
- isPlainObject: () => isPlainObject,
452
- issue: () => issue,
453
- joinValues: () => joinValues,
454
- jsonStringifyReplacer: () => jsonStringifyReplacer,
455
- merge: () => merge,
456
- mergeDefs: () => mergeDefs,
457
- normalizeParams: () => normalizeParams,
458
- nullish: () => nullish,
459
- numKeys: () => numKeys,
460
- objectClone: () => objectClone,
461
- omit: () => omit,
462
- optionalKeys: () => optionalKeys,
463
- parsedType: () => parsedType,
464
- partial: () => partial,
465
- pick: () => pick,
466
- prefixIssues: () => prefixIssues,
467
- primitiveTypes: () => primitiveTypes,
468
- promiseAllObject: () => promiseAllObject,
469
- propertyKeyTypes: () => propertyKeyTypes,
470
- randomString: () => randomString,
471
- required: () => required,
472
- safeExtend: () => safeExtend,
473
- shallowClone: () => shallowClone,
474
- slugify: () => slugify,
475
- stringifyPrimitive: () => stringifyPrimitive,
476
- uint8ArrayToBase64: () => uint8ArrayToBase64,
477
- uint8ArrayToBase64url: () => uint8ArrayToBase64url,
478
- uint8ArrayToHex: () => uint8ArrayToHex,
479
- unwrapMessage: () => unwrapMessage
480
- });
481
-
482
- // node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
483
- var _a2;
484
- var NEVER = /* @__PURE__ */ Object.freeze({
485
- status: "aborted"
486
- });
487
- // @__NO_SIDE_EFFECTS__
488
- function $constructor(name, initializer3, params) {
489
- function init(inst, def) {
490
- if (!inst._zod) {
491
- Object.defineProperty(inst, "_zod", {
492
- value: {
493
- def,
494
- constr: _,
495
- traits: /* @__PURE__ */ new Set()
496
- },
497
- enumerable: false
498
- });
499
- }
500
- if (inst._zod.traits.has(name)) {
501
- return;
502
- }
503
- inst._zod.traits.add(name);
504
- initializer3(inst, def);
505
- const proto = _.prototype;
506
- const keys = Object.keys(proto);
507
- for (let i = 0; i < keys.length; i++) {
508
- const k = keys[i];
509
- if (!(k in inst)) {
510
- inst[k] = proto[k].bind(inst);
511
- }
512
- }
513
- }
514
- const Parent = params?.Parent ?? Object;
515
- class Definition extends Parent {
516
- }
517
- Object.defineProperty(Definition, "name", { value: name });
518
- function _(def) {
519
- var _a3;
520
- const inst = params?.Parent ? new Definition() : this;
521
- init(inst, def);
522
- (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
523
- for (const fn of inst._zod.deferred) {
524
- fn();
525
- }
526
- return inst;
527
- }
528
- Object.defineProperty(_, "init", { value: init });
529
- Object.defineProperty(_, Symbol.hasInstance, {
530
- value: (inst) => {
531
- if (params?.Parent && inst instanceof params.Parent)
532
- return true;
533
- return inst?._zod?.traits?.has(name);
534
- }
535
- });
536
- Object.defineProperty(_, "name", { value: name });
537
- return _;
538
- }
539
- var $brand = /* @__PURE__ */ Symbol("zod_brand");
540
- var $ZodAsyncError = class extends Error {
541
- constructor() {
542
- super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
543
- }
544
- };
545
- var $ZodEncodeError = class extends Error {
546
- constructor(name) {
547
- super(`Encountered unidirectional transform during encode: ${name}`);
548
- this.name = "ZodEncodeError";
549
- }
550
- };
551
- (_a2 = globalThis).__zod_globalConfig ?? (_a2.__zod_globalConfig = {});
552
- var globalConfig = globalThis.__zod_globalConfig;
553
- function config(newConfig) {
554
- if (newConfig)
555
- Object.assign(globalConfig, newConfig);
556
- return globalConfig;
557
- }
558
-
559
- // node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
560
- function assertEqual(val) {
561
- return val;
562
- }
563
- function assertNotEqual(val) {
564
- return val;
565
- }
566
- function assertIs(_arg) {
567
- }
568
- function assertNever(_x) {
569
- throw new Error("Unexpected value in exhaustive check");
570
- }
571
- function assert(_) {
572
- }
573
- function getEnumValues(entries) {
574
- const numericValues = Object.values(entries).filter((v) => typeof v === "number");
575
- const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
576
- return values;
577
- }
578
- function joinValues(array2, separator = "|") {
579
- return array2.map((val) => stringifyPrimitive(val)).join(separator);
580
- }
581
- function jsonStringifyReplacer(_, value) {
582
- if (typeof value === "bigint")
583
- return value.toString();
584
- return value;
585
- }
586
- function cached(getter) {
587
- const set2 = false;
588
- return {
589
- get value() {
590
- if (!set2) {
591
- const value = getter();
592
- Object.defineProperty(this, "value", { value });
593
- return value;
594
- }
595
- throw new Error("cached value already set");
596
- }
597
- };
598
- }
599
- function nullish(input) {
600
- return input === null || input === void 0;
601
- }
602
- function cleanRegex(source) {
603
- const start = source.startsWith("^") ? 1 : 0;
604
- const end = source.endsWith("$") ? source.length - 1 : source.length;
605
- return source.slice(start, end);
606
- }
607
- function floatSafeRemainder(val, step) {
608
- const ratio = val / step;
609
- const roundedRatio = Math.round(ratio);
610
- const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);
611
- if (Math.abs(ratio - roundedRatio) < tolerance)
612
- return 0;
613
- return ratio - roundedRatio;
614
- }
615
- var EVALUATING = /* @__PURE__ */ Symbol("evaluating");
616
- function defineLazy(object2, key, getter) {
617
- let value = void 0;
618
- Object.defineProperty(object2, key, {
619
- get() {
620
- if (value === EVALUATING) {
621
- return void 0;
622
- }
623
- if (value === void 0) {
624
- value = EVALUATING;
625
- value = getter();
626
- }
627
- return value;
628
- },
629
- set(v) {
630
- Object.defineProperty(object2, key, {
631
- value: v
632
- // configurable: true,
633
- });
634
- },
635
- configurable: true
636
- });
637
- }
638
- function objectClone(obj) {
639
- return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));
640
- }
641
- function assignProp(target, prop, value) {
642
- Object.defineProperty(target, prop, {
643
- value,
644
- writable: true,
645
- enumerable: true,
646
- configurable: true
647
- });
648
- }
649
- function mergeDefs(...defs) {
650
- const mergedDescriptors = {};
651
- for (const def of defs) {
652
- const descriptors = Object.getOwnPropertyDescriptors(def);
653
- Object.assign(mergedDescriptors, descriptors);
654
- }
655
- return Object.defineProperties({}, mergedDescriptors);
656
- }
657
- function cloneDef(schema) {
658
- return mergeDefs(schema._zod.def);
659
- }
660
- function getElementAtPath(obj, path) {
661
- if (!path)
662
- return obj;
663
- return path.reduce((acc, key) => acc?.[key], obj);
664
- }
665
- function promiseAllObject(promisesObj) {
666
- const keys = Object.keys(promisesObj);
667
- const promises = keys.map((key) => promisesObj[key]);
668
- return Promise.all(promises).then((results) => {
669
- const resolvedObj = {};
670
- for (let i = 0; i < keys.length; i++) {
671
- resolvedObj[keys[i]] = results[i];
672
- }
673
- return resolvedObj;
674
- });
675
- }
676
- function randomString(length = 10) {
677
- const chars = "abcdefghijklmnopqrstuvwxyz";
678
- let str = "";
679
- for (let i = 0; i < length; i++) {
680
- str += chars[Math.floor(Math.random() * chars.length)];
681
- }
682
- return str;
683
- }
684
- function esc(str) {
685
- return JSON.stringify(str);
686
- }
687
- function slugify(input) {
688
- return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
689
- }
690
- var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
691
- };
692
- function isObject(data) {
693
- return typeof data === "object" && data !== null && !Array.isArray(data);
694
- }
695
- var allowsEval = /* @__PURE__ */ cached(() => {
696
- if (globalConfig.jitless) {
697
- return false;
698
- }
699
- if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
700
- return false;
701
- }
702
- try {
703
- const F = Function;
704
- new F("");
705
- return true;
706
- } catch (_) {
707
- return false;
708
- }
709
- });
710
- function isPlainObject(o) {
711
- if (isObject(o) === false)
712
- return false;
713
- const ctor = o.constructor;
714
- if (ctor === void 0)
715
- return true;
716
- if (typeof ctor !== "function")
717
- return true;
718
- const prot = ctor.prototype;
719
- if (isObject(prot) === false)
720
- return false;
721
- if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
722
- return false;
723
- }
724
- return true;
725
- }
726
- function shallowClone(o) {
727
- if (isPlainObject(o))
728
- return { ...o };
729
- if (Array.isArray(o))
730
- return [...o];
731
- if (o instanceof Map)
732
- return new Map(o);
733
- if (o instanceof Set)
734
- return new Set(o);
735
- return o;
736
- }
737
- function numKeys(data) {
738
- let keyCount = 0;
739
- for (const key in data) {
740
- if (Object.prototype.hasOwnProperty.call(data, key)) {
741
- keyCount++;
742
- }
743
- }
744
- return keyCount;
745
- }
746
- var getParsedType = (data) => {
747
- const t = typeof data;
748
- switch (t) {
749
- case "undefined":
750
- return "undefined";
751
- case "string":
752
- return "string";
753
- case "number":
754
- return Number.isNaN(data) ? "nan" : "number";
755
- case "boolean":
756
- return "boolean";
757
- case "function":
758
- return "function";
759
- case "bigint":
760
- return "bigint";
761
- case "symbol":
762
- return "symbol";
763
- case "object":
764
- if (Array.isArray(data)) {
765
- return "array";
766
- }
767
- if (data === null) {
768
- return "null";
769
- }
770
- if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
771
- return "promise";
772
- }
773
- if (typeof Map !== "undefined" && data instanceof Map) {
774
- return "map";
775
- }
776
- if (typeof Set !== "undefined" && data instanceof Set) {
777
- return "set";
778
- }
779
- if (typeof Date !== "undefined" && data instanceof Date) {
780
- return "date";
781
- }
782
- if (typeof File !== "undefined" && data instanceof File) {
783
- return "file";
784
- }
785
- return "object";
786
- default:
787
- throw new Error(`Unknown data type: ${t}`);
788
- }
789
- };
790
- var propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
791
- var primitiveTypes = /* @__PURE__ */ new Set([
792
- "string",
793
- "number",
794
- "bigint",
795
- "boolean",
796
- "symbol",
797
- "undefined"
798
- ]);
799
- function escapeRegex(str) {
800
- return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
801
- }
802
- function clone(inst, def, params) {
803
- const cl = new inst._zod.constr(def ?? inst._zod.def);
804
- if (!def || params?.parent)
805
- cl._zod.parent = inst;
806
- return cl;
807
- }
808
- function normalizeParams(_params) {
809
- const params = _params;
810
- if (!params)
811
- return {};
812
- if (typeof params === "string")
813
- return { error: () => params };
814
- if (params?.message !== void 0) {
815
- if (params?.error !== void 0)
816
- throw new Error("Cannot specify both `message` and `error` params");
817
- params.error = params.message;
818
- }
819
- delete params.message;
820
- if (typeof params.error === "string")
821
- return { ...params, error: () => params.error };
822
- return params;
823
- }
824
- function createTransparentProxy(getter) {
825
- let target;
826
- return new Proxy({}, {
827
- get(_, prop, receiver) {
828
- target ?? (target = getter());
829
- return Reflect.get(target, prop, receiver);
830
- },
831
- set(_, prop, value, receiver) {
832
- target ?? (target = getter());
833
- return Reflect.set(target, prop, value, receiver);
834
- },
835
- has(_, prop) {
836
- target ?? (target = getter());
837
- return Reflect.has(target, prop);
838
- },
839
- deleteProperty(_, prop) {
840
- target ?? (target = getter());
841
- return Reflect.deleteProperty(target, prop);
842
- },
843
- ownKeys(_) {
844
- target ?? (target = getter());
845
- return Reflect.ownKeys(target);
846
- },
847
- getOwnPropertyDescriptor(_, prop) {
848
- target ?? (target = getter());
849
- return Reflect.getOwnPropertyDescriptor(target, prop);
850
- },
851
- defineProperty(_, prop, descriptor) {
852
- target ?? (target = getter());
853
- return Reflect.defineProperty(target, prop, descriptor);
854
- }
855
- });
856
- }
857
- function stringifyPrimitive(value) {
858
- if (typeof value === "bigint")
859
- return value.toString() + "n";
860
- if (typeof value === "string")
861
- return `"${value}"`;
862
- return `${value}`;
863
- }
864
- function optionalKeys(shape) {
865
- return Object.keys(shape).filter((k) => {
866
- return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
867
- });
868
- }
869
- var NUMBER_FORMAT_RANGES = {
870
- safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
871
- int32: [-2147483648, 2147483647],
872
- uint32: [0, 4294967295],
873
- float32: [-34028234663852886e22, 34028234663852886e22],
874
- float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
875
- };
876
- var BIGINT_FORMAT_RANGES = {
877
- int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")],
878
- uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
879
- };
880
- function pick(schema, mask) {
881
- const currDef = schema._zod.def;
882
- const checks = currDef.checks;
883
- const hasChecks = checks && checks.length > 0;
884
- if (hasChecks) {
885
- throw new Error(".pick() cannot be used on object schemas containing refinements");
886
- }
887
- const def = mergeDefs(schema._zod.def, {
888
- get shape() {
889
- const newShape = {};
890
- for (const key in mask) {
891
- if (!(key in currDef.shape)) {
892
- throw new Error(`Unrecognized key: "${key}"`);
893
- }
894
- if (!mask[key])
895
- continue;
896
- newShape[key] = currDef.shape[key];
897
- }
898
- assignProp(this, "shape", newShape);
899
- return newShape;
900
- },
901
- checks: []
902
- });
903
- return clone(schema, def);
904
- }
905
- function omit(schema, mask) {
906
- const currDef = schema._zod.def;
907
- const checks = currDef.checks;
908
- const hasChecks = checks && checks.length > 0;
909
- if (hasChecks) {
910
- throw new Error(".omit() cannot be used on object schemas containing refinements");
911
- }
912
- const def = mergeDefs(schema._zod.def, {
913
- get shape() {
914
- const newShape = { ...schema._zod.def.shape };
915
- for (const key in mask) {
916
- if (!(key in currDef.shape)) {
917
- throw new Error(`Unrecognized key: "${key}"`);
918
- }
919
- if (!mask[key])
920
- continue;
921
- delete newShape[key];
922
- }
923
- assignProp(this, "shape", newShape);
924
- return newShape;
925
- },
926
- checks: []
927
- });
928
- return clone(schema, def);
929
- }
930
- function extend(schema, shape) {
931
- if (!isPlainObject(shape)) {
932
- throw new Error("Invalid input to extend: expected a plain object");
933
- }
934
- const checks = schema._zod.def.checks;
935
- const hasChecks = checks && checks.length > 0;
936
- if (hasChecks) {
937
- const existingShape = schema._zod.def.shape;
938
- for (const key in shape) {
939
- if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) {
940
- throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
941
- }
942
- }
943
- }
944
- const def = mergeDefs(schema._zod.def, {
945
- get shape() {
946
- const _shape = { ...schema._zod.def.shape, ...shape };
947
- assignProp(this, "shape", _shape);
948
- return _shape;
949
- }
950
- });
951
- return clone(schema, def);
952
- }
953
- function safeExtend(schema, shape) {
954
- if (!isPlainObject(shape)) {
955
- throw new Error("Invalid input to safeExtend: expected a plain object");
956
- }
957
- const def = mergeDefs(schema._zod.def, {
958
- get shape() {
959
- const _shape = { ...schema._zod.def.shape, ...shape };
960
- assignProp(this, "shape", _shape);
961
- return _shape;
962
- }
963
- });
964
- return clone(schema, def);
965
- }
966
- function merge(a, b) {
967
- if (a._zod.def.checks?.length) {
968
- throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
969
- }
970
- const def = mergeDefs(a._zod.def, {
971
- get shape() {
972
- const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
973
- assignProp(this, "shape", _shape);
974
- return _shape;
975
- },
976
- get catchall() {
977
- return b._zod.def.catchall;
978
- },
979
- checks: b._zod.def.checks ?? []
980
- });
981
- return clone(a, def);
982
- }
983
- function partial(Class2, schema, mask) {
984
- const currDef = schema._zod.def;
985
- const checks = currDef.checks;
986
- const hasChecks = checks && checks.length > 0;
987
- if (hasChecks) {
988
- throw new Error(".partial() cannot be used on object schemas containing refinements");
989
- }
990
- const def = mergeDefs(schema._zod.def, {
991
- get shape() {
992
- const oldShape = schema._zod.def.shape;
993
- const shape = { ...oldShape };
994
- if (mask) {
995
- for (const key in mask) {
996
- if (!(key in oldShape)) {
997
- throw new Error(`Unrecognized key: "${key}"`);
998
- }
999
- if (!mask[key])
1000
- continue;
1001
- shape[key] = Class2 ? new Class2({
1002
- type: "optional",
1003
- innerType: oldShape[key]
1004
- }) : oldShape[key];
1005
- }
1006
- } else {
1007
- for (const key in oldShape) {
1008
- shape[key] = Class2 ? new Class2({
1009
- type: "optional",
1010
- innerType: oldShape[key]
1011
- }) : oldShape[key];
1012
- }
1013
- }
1014
- assignProp(this, "shape", shape);
1015
- return shape;
1016
- },
1017
- checks: []
1018
- });
1019
- return clone(schema, def);
1020
- }
1021
- function required(Class2, schema, mask) {
1022
- const def = mergeDefs(schema._zod.def, {
1023
- get shape() {
1024
- const oldShape = schema._zod.def.shape;
1025
- const shape = { ...oldShape };
1026
- if (mask) {
1027
- for (const key in mask) {
1028
- if (!(key in shape)) {
1029
- throw new Error(`Unrecognized key: "${key}"`);
1030
- }
1031
- if (!mask[key])
1032
- continue;
1033
- shape[key] = new Class2({
1034
- type: "nonoptional",
1035
- innerType: oldShape[key]
1036
- });
1037
- }
1038
- } else {
1039
- for (const key in oldShape) {
1040
- shape[key] = new Class2({
1041
- type: "nonoptional",
1042
- innerType: oldShape[key]
1043
- });
1044
- }
1045
- }
1046
- assignProp(this, "shape", shape);
1047
- return shape;
1048
- }
1049
- });
1050
- return clone(schema, def);
1051
- }
1052
- function aborted(x, startIndex = 0) {
1053
- if (x.aborted === true)
1054
- return true;
1055
- for (let i = startIndex; i < x.issues.length; i++) {
1056
- if (x.issues[i]?.continue !== true) {
1057
- return true;
1058
- }
1059
- }
1060
- return false;
1061
- }
1062
- function explicitlyAborted(x, startIndex = 0) {
1063
- if (x.aborted === true)
1064
- return true;
1065
- for (let i = startIndex; i < x.issues.length; i++) {
1066
- if (x.issues[i]?.continue === false) {
1067
- return true;
1068
- }
1069
- }
1070
- return false;
1071
- }
1072
- function prefixIssues(path, issues) {
1073
- return issues.map((iss) => {
1074
- var _a3;
1075
- (_a3 = iss).path ?? (_a3.path = []);
1076
- iss.path.unshift(path);
1077
- return iss;
1078
- });
1079
- }
1080
- function unwrapMessage(message) {
1081
- return typeof message === "string" ? message : message?.message;
1082
- }
1083
- function finalizeIssue(iss, ctx, config2) {
1084
- const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
1085
- const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
1086
- rest.path ?? (rest.path = []);
1087
- rest.message = message;
1088
- if (ctx?.reportInput) {
1089
- rest.input = _input;
1090
- }
1091
- return rest;
1092
- }
1093
- function getSizableOrigin(input) {
1094
- if (input instanceof Set)
1095
- return "set";
1096
- if (input instanceof Map)
1097
- return "map";
1098
- if (input instanceof File)
1099
- return "file";
1100
- return "unknown";
1101
- }
1102
- function getLengthableOrigin(input) {
1103
- if (Array.isArray(input))
1104
- return "array";
1105
- if (typeof input === "string")
1106
- return "string";
1107
- return "unknown";
1108
- }
1109
- function parsedType(data) {
1110
- const t = typeof data;
1111
- switch (t) {
1112
- case "number": {
1113
- return Number.isNaN(data) ? "nan" : "number";
1114
- }
1115
- case "object": {
1116
- if (data === null) {
1117
- return "null";
1118
- }
1119
- if (Array.isArray(data)) {
1120
- return "array";
1121
- }
1122
- const obj = data;
1123
- if (obj && Object.getPrototypeOf(obj) !== Object.prototype && "constructor" in obj && obj.constructor) {
1124
- return obj.constructor.name;
1125
- }
1126
- }
1127
- }
1128
- return t;
1129
- }
1130
- function issue(...args) {
1131
- const [iss, input, inst] = args;
1132
- if (typeof iss === "string") {
1133
- return {
1134
- message: iss,
1135
- code: "custom",
1136
- input,
1137
- inst
1138
- };
1139
- }
1140
- return { ...iss };
1141
- }
1142
- function cleanEnum(obj) {
1143
- return Object.entries(obj).filter(([k, _]) => {
1144
- return Number.isNaN(Number.parseInt(k, 10));
1145
- }).map((el) => el[1]);
1146
- }
1147
- function base64ToUint8Array(base643) {
1148
- const binaryString = atob(base643);
1149
- const bytes = new Uint8Array(binaryString.length);
1150
- for (let i = 0; i < binaryString.length; i++) {
1151
- bytes[i] = binaryString.charCodeAt(i);
1152
- }
1153
- return bytes;
1154
- }
1155
- function uint8ArrayToBase64(bytes) {
1156
- let binaryString = "";
1157
- for (let i = 0; i < bytes.length; i++) {
1158
- binaryString += String.fromCharCode(bytes[i]);
1159
- }
1160
- return btoa(binaryString);
1161
- }
1162
- function base64urlToUint8Array(base64url3) {
1163
- const base643 = base64url3.replace(/-/g, "+").replace(/_/g, "/");
1164
- const padding = "=".repeat((4 - base643.length % 4) % 4);
1165
- return base64ToUint8Array(base643 + padding);
1166
- }
1167
- function uint8ArrayToBase64url(bytes) {
1168
- return uint8ArrayToBase64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
1169
- }
1170
- function hexToUint8Array(hex3) {
1171
- const cleanHex = hex3.replace(/^0x/, "");
1172
- if (cleanHex.length % 2 !== 0) {
1173
- throw new Error("Invalid hex string length");
1174
- }
1175
- const bytes = new Uint8Array(cleanHex.length / 2);
1176
- for (let i = 0; i < cleanHex.length; i += 2) {
1177
- bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);
1178
- }
1179
- return bytes;
1180
- }
1181
- function uint8ArrayToHex(bytes) {
1182
- return Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
1183
- }
1184
- var Class = class {
1185
- constructor(..._args) {
1186
- }
1187
- };
1188
-
1189
- // node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.js
1190
- var formatMap = {
1191
- guid: "uuid",
1192
- url: "uri",
1193
- datetime: "date-time",
1194
- json_string: "json-string",
1195
- regex: ""
1196
- // do not set
1197
- };
1198
- var stringProcessor = (schema, ctx, _json, _params) => {
1199
- const json2 = _json;
1200
- json2.type = "string";
1201
- const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
1202
- if (typeof minimum === "number")
1203
- json2.minLength = minimum;
1204
- if (typeof maximum === "number")
1205
- json2.maxLength = maximum;
1206
- if (format) {
1207
- json2.format = formatMap[format] ?? format;
1208
- if (json2.format === "")
1209
- delete json2.format;
1210
- if (format === "time") {
1211
- delete json2.format;
1212
- }
1213
- }
1214
- if (contentEncoding)
1215
- json2.contentEncoding = contentEncoding;
1216
- if (patterns && patterns.size > 0) {
1217
- const regexes = [...patterns];
1218
- if (regexes.length === 1)
1219
- json2.pattern = regexes[0].source;
1220
- else if (regexes.length > 1) {
1221
- json2.allOf = [
1222
- ...regexes.map((regex) => ({
1223
- ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
1224
- pattern: regex.source
1225
- }))
1226
- ];
1227
- }
1228
- }
1229
- };
1230
- var numberProcessor = (schema, ctx, _json, _params) => {
1231
- const json2 = _json;
1232
- const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
1233
- if (typeof format === "string" && format.includes("int"))
1234
- json2.type = "integer";
1235
- else
1236
- json2.type = "number";
1237
- const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
1238
- const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
1239
- const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
1240
- if (exMin) {
1241
- if (legacy) {
1242
- json2.minimum = exclusiveMinimum;
1243
- json2.exclusiveMinimum = true;
1244
- } else {
1245
- json2.exclusiveMinimum = exclusiveMinimum;
1246
- }
1247
- } else if (typeof minimum === "number") {
1248
- json2.minimum = minimum;
1249
- }
1250
- if (exMax) {
1251
- if (legacy) {
1252
- json2.maximum = exclusiveMaximum;
1253
- json2.exclusiveMaximum = true;
1254
- } else {
1255
- json2.exclusiveMaximum = exclusiveMaximum;
1256
- }
1257
- } else if (typeof maximum === "number") {
1258
- json2.maximum = maximum;
1259
- }
1260
- if (typeof multipleOf === "number")
1261
- json2.multipleOf = multipleOf;
1262
- };
1263
- var booleanProcessor = (_schema, _ctx, json2, _params) => {
1264
- json2.type = "boolean";
1265
- };
1266
- var bigintProcessor = (_schema, ctx, _json, _params) => {
1267
- if (ctx.unrepresentable === "throw") {
1268
- throw new Error("BigInt cannot be represented in JSON Schema");
1269
- }
1270
- };
1271
- var symbolProcessor = (_schema, ctx, _json, _params) => {
1272
- if (ctx.unrepresentable === "throw") {
1273
- throw new Error("Symbols cannot be represented in JSON Schema");
1274
- }
1275
- };
1276
- var nullProcessor = (_schema, ctx, json2, _params) => {
1277
- if (ctx.target === "openapi-3.0") {
1278
- json2.type = "string";
1279
- json2.nullable = true;
1280
- json2.enum = [null];
1281
- } else {
1282
- json2.type = "null";
1283
- }
1284
- };
1285
- var undefinedProcessor = (_schema, ctx, _json, _params) => {
1286
- if (ctx.unrepresentable === "throw") {
1287
- throw new Error("Undefined cannot be represented in JSON Schema");
1288
- }
1289
- };
1290
- var voidProcessor = (_schema, ctx, _json, _params) => {
1291
- if (ctx.unrepresentable === "throw") {
1292
- throw new Error("Void cannot be represented in JSON Schema");
1293
- }
1294
- };
1295
- var neverProcessor = (_schema, _ctx, json2, _params) => {
1296
- json2.not = {};
1297
- };
1298
- var anyProcessor = (_schema, _ctx, _json, _params) => {
1299
- };
1300
- var unknownProcessor = (_schema, _ctx, _json, _params) => {
1301
- };
1302
- var dateProcessor = (_schema, ctx, _json, _params) => {
1303
- if (ctx.unrepresentable === "throw") {
1304
- throw new Error("Date cannot be represented in JSON Schema");
1305
- }
1306
- };
1307
- var enumProcessor = (schema, _ctx, json2, _params) => {
1308
- const def = schema._zod.def;
1309
- const values = getEnumValues(def.entries);
1310
- if (values.every((v) => typeof v === "number"))
1311
- json2.type = "number";
1312
- if (values.every((v) => typeof v === "string"))
1313
- json2.type = "string";
1314
- json2.enum = values;
1315
- };
1316
- var literalProcessor = (schema, ctx, json2, _params) => {
1317
- const def = schema._zod.def;
1318
- const vals = [];
1319
- for (const val of def.values) {
1320
- if (val === void 0) {
1321
- if (ctx.unrepresentable === "throw") {
1322
- throw new Error("Literal `undefined` cannot be represented in JSON Schema");
1323
- } else {
1324
- }
1325
- } else if (typeof val === "bigint") {
1326
- if (ctx.unrepresentable === "throw") {
1327
- throw new Error("BigInt literals cannot be represented in JSON Schema");
1328
- } else {
1329
- vals.push(Number(val));
1330
- }
1331
- } else {
1332
- vals.push(val);
1333
- }
1334
- }
1335
- if (vals.length === 0) {
1336
- } else if (vals.length === 1) {
1337
- const val = vals[0];
1338
- json2.type = val === null ? "null" : typeof val;
1339
- if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
1340
- json2.enum = [val];
1341
- } else {
1342
- json2.const = val;
1343
- }
1344
- } else {
1345
- if (vals.every((v) => typeof v === "number"))
1346
- json2.type = "number";
1347
- if (vals.every((v) => typeof v === "string"))
1348
- json2.type = "string";
1349
- if (vals.every((v) => typeof v === "boolean"))
1350
- json2.type = "boolean";
1351
- if (vals.every((v) => v === null))
1352
- json2.type = "null";
1353
- json2.enum = vals;
1354
- }
1355
- };
1356
- var nanProcessor = (_schema, ctx, _json, _params) => {
1357
- if (ctx.unrepresentable === "throw") {
1358
- throw new Error("NaN cannot be represented in JSON Schema");
1359
- }
1360
- };
1361
- var templateLiteralProcessor = (schema, _ctx, json2, _params) => {
1362
- const _json = json2;
1363
- const pattern = schema._zod.pattern;
1364
- if (!pattern)
1365
- throw new Error("Pattern not found in template literal");
1366
- _json.type = "string";
1367
- _json.pattern = pattern.source;
1368
- };
1369
- var fileProcessor = (schema, _ctx, json2, _params) => {
1370
- const _json = json2;
1371
- const file2 = {
1372
- type: "string",
1373
- format: "binary",
1374
- contentEncoding: "binary"
1375
- };
1376
- const { minimum, maximum, mime } = schema._zod.bag;
1377
- if (minimum !== void 0)
1378
- file2.minLength = minimum;
1379
- if (maximum !== void 0)
1380
- file2.maxLength = maximum;
1381
- if (mime) {
1382
- if (mime.length === 1) {
1383
- file2.contentMediaType = mime[0];
1384
- Object.assign(_json, file2);
1385
- } else {
1386
- Object.assign(_json, file2);
1387
- _json.anyOf = mime.map((m) => ({ contentMediaType: m }));
1388
- }
1389
- } else {
1390
- Object.assign(_json, file2);
1391
- }
1392
- };
1393
- var successProcessor = (_schema, _ctx, json2, _params) => {
1394
- json2.type = "boolean";
1395
- };
1396
- var customProcessor = (_schema, ctx, _json, _params) => {
1397
- if (ctx.unrepresentable === "throw") {
1398
- throw new Error("Custom types cannot be represented in JSON Schema");
1399
- }
1400
- };
1401
- var functionProcessor = (_schema, ctx, _json, _params) => {
1402
- if (ctx.unrepresentable === "throw") {
1403
- throw new Error("Function types cannot be represented in JSON Schema");
1404
- }
1405
- };
1406
- var transformProcessor = (_schema, ctx, _json, _params) => {
1407
- if (ctx.unrepresentable === "throw") {
1408
- throw new Error("Transforms cannot be represented in JSON Schema");
1409
- }
1410
- };
1411
- var mapProcessor = (_schema, ctx, _json, _params) => {
1412
- if (ctx.unrepresentable === "throw") {
1413
- throw new Error("Map cannot be represented in JSON Schema");
1414
- }
1415
- };
1416
- var setProcessor = (_schema, ctx, _json, _params) => {
1417
- if (ctx.unrepresentable === "throw") {
1418
- throw new Error("Set cannot be represented in JSON Schema");
1419
- }
1420
- };
1421
- var arrayProcessor = (schema, ctx, _json, params) => {
1422
- const json2 = _json;
1423
- const def = schema._zod.def;
1424
- const { minimum, maximum } = schema._zod.bag;
1425
- if (typeof minimum === "number")
1426
- json2.minItems = minimum;
1427
- if (typeof maximum === "number")
1428
- json2.maxItems = maximum;
1429
- json2.type = "array";
1430
- json2.items = process(def.element, ctx, {
1431
- ...params,
1432
- path: [...params.path, "items"]
1433
- });
1434
- };
1435
- var objectProcessor = (schema, ctx, _json, params) => {
1436
- const json2 = _json;
1437
- const def = schema._zod.def;
1438
- json2.type = "object";
1439
- json2.properties = {};
1440
- const shape = def.shape;
1441
- for (const key in shape) {
1442
- json2.properties[key] = process(shape[key], ctx, {
1443
- ...params,
1444
- path: [...params.path, "properties", key]
1445
- });
1446
- }
1447
- const allKeys = new Set(Object.keys(shape));
1448
- const requiredKeys = new Set([...allKeys].filter((key) => {
1449
- const v = def.shape[key]._zod;
1450
- if (ctx.io === "input") {
1451
- return v.optin === void 0;
1452
- } else {
1453
- return v.optout === void 0;
1454
- }
1455
- }));
1456
- if (requiredKeys.size > 0) {
1457
- json2.required = Array.from(requiredKeys);
1458
- }
1459
- if (def.catchall?._zod.def.type === "never") {
1460
- json2.additionalProperties = false;
1461
- } else if (!def.catchall) {
1462
- if (ctx.io === "output")
1463
- json2.additionalProperties = false;
1464
- } else if (def.catchall) {
1465
- json2.additionalProperties = process(def.catchall, ctx, {
1466
- ...params,
1467
- path: [...params.path, "additionalProperties"]
1468
- });
1469
- }
1470
- };
1471
- var unionProcessor = (schema, ctx, json2, params) => {
1472
- const def = schema._zod.def;
1473
- const isExclusive = def.inclusive === false;
1474
- const options = def.options.map((x, i) => process(x, ctx, {
1475
- ...params,
1476
- path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
1477
- }));
1478
- if (isExclusive) {
1479
- json2.oneOf = options;
1480
- } else {
1481
- json2.anyOf = options;
1482
- }
1483
- };
1484
- var intersectionProcessor = (schema, ctx, json2, params) => {
1485
- const def = schema._zod.def;
1486
- const a = process(def.left, ctx, {
1487
- ...params,
1488
- path: [...params.path, "allOf", 0]
1489
- });
1490
- const b = process(def.right, ctx, {
1491
- ...params,
1492
- path: [...params.path, "allOf", 1]
1493
- });
1494
- const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
1495
- const allOf = [
1496
- ...isSimpleIntersection(a) ? a.allOf : [a],
1497
- ...isSimpleIntersection(b) ? b.allOf : [b]
1498
- ];
1499
- json2.allOf = allOf;
1500
- };
1501
- var tupleProcessor = (schema, ctx, _json, params) => {
1502
- const json2 = _json;
1503
- const def = schema._zod.def;
1504
- json2.type = "array";
1505
- const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
1506
- const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
1507
- const prefixItems = def.items.map((x, i) => process(x, ctx, {
1508
- ...params,
1509
- path: [...params.path, prefixPath, i]
1510
- }));
1511
- const rest = def.rest ? process(def.rest, ctx, {
1512
- ...params,
1513
- path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
1514
- }) : null;
1515
- if (ctx.target === "draft-2020-12") {
1516
- json2.prefixItems = prefixItems;
1517
- if (rest) {
1518
- json2.items = rest;
1519
- }
1520
- } else if (ctx.target === "openapi-3.0") {
1521
- json2.items = {
1522
- anyOf: prefixItems
1523
- };
1524
- if (rest) {
1525
- json2.items.anyOf.push(rest);
1526
- }
1527
- json2.minItems = prefixItems.length;
1528
- if (!rest) {
1529
- json2.maxItems = prefixItems.length;
1530
- }
1531
- } else {
1532
- json2.items = prefixItems;
1533
- if (rest) {
1534
- json2.additionalItems = rest;
1535
- }
1536
- }
1537
- const { minimum, maximum } = schema._zod.bag;
1538
- if (typeof minimum === "number")
1539
- json2.minItems = minimum;
1540
- if (typeof maximum === "number")
1541
- json2.maxItems = maximum;
1542
- };
1543
- var recordProcessor = (schema, ctx, _json, params) => {
1544
- const json2 = _json;
1545
- const def = schema._zod.def;
1546
- json2.type = "object";
1547
- const keyType = def.keyType;
1548
- const keyBag = keyType._zod.bag;
1549
- const patterns = keyBag?.patterns;
1550
- if (def.mode === "loose" && patterns && patterns.size > 0) {
1551
- const valueSchema = process(def.valueType, ctx, {
1552
- ...params,
1553
- path: [...params.path, "patternProperties", "*"]
1554
- });
1555
- json2.patternProperties = {};
1556
- for (const pattern of patterns) {
1557
- json2.patternProperties[pattern.source] = valueSchema;
1558
- }
1559
- } else {
1560
- if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
1561
- json2.propertyNames = process(def.keyType, ctx, {
1562
- ...params,
1563
- path: [...params.path, "propertyNames"]
1564
- });
1565
- }
1566
- json2.additionalProperties = process(def.valueType, ctx, {
1567
- ...params,
1568
- path: [...params.path, "additionalProperties"]
1569
- });
1570
- }
1571
- const keyValues = keyType._zod.values;
1572
- if (keyValues) {
1573
- const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
1574
- if (validKeyValues.length > 0) {
1575
- json2.required = validKeyValues;
1576
- }
1577
- }
1578
- };
1579
- var nullableProcessor = (schema, ctx, json2, params) => {
1580
- const def = schema._zod.def;
1581
- const inner = process(def.innerType, ctx, params);
1582
- const seen = ctx.seen.get(schema);
1583
- if (ctx.target === "openapi-3.0") {
1584
- seen.ref = def.innerType;
1585
- json2.nullable = true;
1586
- } else {
1587
- json2.anyOf = [inner, { type: "null" }];
1588
- }
1589
- };
1590
- var nonoptionalProcessor = (schema, ctx, _json, params) => {
1591
- const def = schema._zod.def;
1592
- process(def.innerType, ctx, params);
1593
- const seen = ctx.seen.get(schema);
1594
- seen.ref = def.innerType;
1595
- };
1596
- var defaultProcessor = (schema, ctx, json2, params) => {
1597
- const def = schema._zod.def;
1598
- process(def.innerType, ctx, params);
1599
- const seen = ctx.seen.get(schema);
1600
- seen.ref = def.innerType;
1601
- json2.default = JSON.parse(JSON.stringify(def.defaultValue));
1602
- };
1603
- var prefaultProcessor = (schema, ctx, json2, params) => {
1604
- const def = schema._zod.def;
1605
- process(def.innerType, ctx, params);
1606
- const seen = ctx.seen.get(schema);
1607
- seen.ref = def.innerType;
1608
- if (ctx.io === "input")
1609
- json2._prefault = JSON.parse(JSON.stringify(def.defaultValue));
1610
- };
1611
- var catchProcessor = (schema, ctx, json2, params) => {
1612
- const def = schema._zod.def;
1613
- process(def.innerType, ctx, params);
1614
- const seen = ctx.seen.get(schema);
1615
- seen.ref = def.innerType;
1616
- let catchValue;
1617
- try {
1618
- catchValue = def.catchValue(void 0);
1619
- } catch {
1620
- throw new Error("Dynamic catch values are not supported in JSON Schema");
1621
- }
1622
- json2.default = catchValue;
1623
- };
1624
- var pipeProcessor = (schema, ctx, _json, params) => {
1625
- const def = schema._zod.def;
1626
- const inIsTransform = def.in._zod.traits.has("$ZodTransform");
1627
- const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
1628
- process(innerType, ctx, params);
1629
- const seen = ctx.seen.get(schema);
1630
- seen.ref = innerType;
1631
- };
1632
- var readonlyProcessor = (schema, ctx, json2, params) => {
1633
- const def = schema._zod.def;
1634
- process(def.innerType, ctx, params);
1635
- const seen = ctx.seen.get(schema);
1636
- seen.ref = def.innerType;
1637
- json2.readOnly = true;
1638
- };
1639
- var promiseProcessor = (schema, ctx, _json, params) => {
1640
- const def = schema._zod.def;
1641
- process(def.innerType, ctx, params);
1642
- const seen = ctx.seen.get(schema);
1643
- seen.ref = def.innerType;
1644
- };
1645
- var optionalProcessor = (schema, ctx, _json, params) => {
1646
- const def = schema._zod.def;
1647
- process(def.innerType, ctx, params);
1648
- const seen = ctx.seen.get(schema);
1649
- seen.ref = def.innerType;
1650
- };
1651
- var lazyProcessor = (schema, ctx, _json, params) => {
1652
- const innerType = schema._zod.innerType;
1653
- process(innerType, ctx, params);
1654
- const seen = ctx.seen.get(schema);
1655
- seen.ref = innerType;
1656
- };
1657
- var allProcessors = {
1658
- string: stringProcessor,
1659
- number: numberProcessor,
1660
- boolean: booleanProcessor,
1661
- bigint: bigintProcessor,
1662
- symbol: symbolProcessor,
1663
- null: nullProcessor,
1664
- undefined: undefinedProcessor,
1665
- void: voidProcessor,
1666
- never: neverProcessor,
1667
- any: anyProcessor,
1668
- unknown: unknownProcessor,
1669
- date: dateProcessor,
1670
- enum: enumProcessor,
1671
- literal: literalProcessor,
1672
- nan: nanProcessor,
1673
- template_literal: templateLiteralProcessor,
1674
- file: fileProcessor,
1675
- success: successProcessor,
1676
- custom: customProcessor,
1677
- function: functionProcessor,
1678
- transform: transformProcessor,
1679
- map: mapProcessor,
1680
- set: setProcessor,
1681
- array: arrayProcessor,
1682
- object: objectProcessor,
1683
- union: unionProcessor,
1684
- intersection: intersectionProcessor,
1685
- tuple: tupleProcessor,
1686
- record: recordProcessor,
1687
- nullable: nullableProcessor,
1688
- nonoptional: nonoptionalProcessor,
1689
- default: defaultProcessor,
1690
- prefault: prefaultProcessor,
1691
- catch: catchProcessor,
1692
- pipe: pipeProcessor,
1693
- readonly: readonlyProcessor,
1694
- promise: promiseProcessor,
1695
- optional: optionalProcessor,
1696
- lazy: lazyProcessor
1697
- };
1698
- function toJSONSchema(input, params) {
1699
- if ("_idmap" in input) {
1700
- const registry3 = input;
1701
- const ctx2 = initializeContext({ ...params, processors: allProcessors });
1702
- const defs = {};
1703
- for (const entry of registry3._idmap.entries()) {
1704
- const [_, schema] = entry;
1705
- process(schema, ctx2);
1706
- }
1707
- const schemas = {};
1708
- const external = {
1709
- registry: registry3,
1710
- uri: params?.uri,
1711
- defs
1712
- };
1713
- ctx2.external = external;
1714
- for (const entry of registry3._idmap.entries()) {
1715
- const [key, schema] = entry;
1716
- extractDefs(ctx2, schema);
1717
- schemas[key] = finalize(ctx2, schema);
1718
- }
1719
- if (Object.keys(defs).length > 0) {
1720
- const defsSegment = ctx2.target === "draft-2020-12" ? "$defs" : "definitions";
1721
- schemas.__shared = {
1722
- [defsSegment]: defs
1723
- };
1724
- }
1725
- return { schemas };
1726
- }
1727
- const ctx = initializeContext({ ...params, processors: allProcessors });
1728
- process(input, ctx);
1729
- extractDefs(ctx, input);
1730
- return finalize(ctx, input);
1731
- }
5
+ // node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
6
+ var external_exports = {};
7
+ __export(external_exports, {
8
+ $brand: () => $brand,
9
+ $input: () => $input,
10
+ $output: () => $output,
11
+ NEVER: () => NEVER,
12
+ TimePrecision: () => TimePrecision,
13
+ ZodAny: () => ZodAny,
14
+ ZodArray: () => ZodArray,
15
+ ZodBase64: () => ZodBase64,
16
+ ZodBase64URL: () => ZodBase64URL,
17
+ ZodBigInt: () => ZodBigInt,
18
+ ZodBigIntFormat: () => ZodBigIntFormat,
19
+ ZodBoolean: () => ZodBoolean,
20
+ ZodCIDRv4: () => ZodCIDRv4,
21
+ ZodCIDRv6: () => ZodCIDRv6,
22
+ ZodCUID: () => ZodCUID,
23
+ ZodCUID2: () => ZodCUID2,
24
+ ZodCatch: () => ZodCatch,
25
+ ZodCodec: () => ZodCodec,
26
+ ZodCustom: () => ZodCustom,
27
+ ZodCustomStringFormat: () => ZodCustomStringFormat,
28
+ ZodDate: () => ZodDate,
29
+ ZodDefault: () => ZodDefault,
30
+ ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
31
+ ZodE164: () => ZodE164,
32
+ ZodEmail: () => ZodEmail,
33
+ ZodEmoji: () => ZodEmoji,
34
+ ZodEnum: () => ZodEnum,
35
+ ZodError: () => ZodError,
36
+ ZodExactOptional: () => ZodExactOptional,
37
+ ZodFile: () => ZodFile,
38
+ ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
39
+ ZodFunction: () => ZodFunction,
40
+ ZodGUID: () => ZodGUID,
41
+ ZodIPv4: () => ZodIPv4,
42
+ ZodIPv6: () => ZodIPv6,
43
+ ZodISODate: () => ZodISODate,
44
+ ZodISODateTime: () => ZodISODateTime,
45
+ ZodISODuration: () => ZodISODuration,
46
+ ZodISOTime: () => ZodISOTime,
47
+ ZodIntersection: () => ZodIntersection,
48
+ ZodIssueCode: () => ZodIssueCode,
49
+ ZodJWT: () => ZodJWT,
50
+ ZodKSUID: () => ZodKSUID,
51
+ ZodLazy: () => ZodLazy,
52
+ ZodLiteral: () => ZodLiteral,
53
+ ZodMAC: () => ZodMAC,
54
+ ZodMap: () => ZodMap,
55
+ ZodNaN: () => ZodNaN,
56
+ ZodNanoID: () => ZodNanoID,
57
+ ZodNever: () => ZodNever,
58
+ ZodNonOptional: () => ZodNonOptional,
59
+ ZodNull: () => ZodNull,
60
+ ZodNullable: () => ZodNullable,
61
+ ZodNumber: () => ZodNumber,
62
+ ZodNumberFormat: () => ZodNumberFormat,
63
+ ZodObject: () => ZodObject,
64
+ ZodOptional: () => ZodOptional,
65
+ ZodPipe: () => ZodPipe,
66
+ ZodPrefault: () => ZodPrefault,
67
+ ZodPreprocess: () => ZodPreprocess,
68
+ ZodPromise: () => ZodPromise,
69
+ ZodReadonly: () => ZodReadonly,
70
+ ZodRealError: () => ZodRealError,
71
+ ZodRecord: () => ZodRecord,
72
+ ZodSet: () => ZodSet,
73
+ ZodString: () => ZodString,
74
+ ZodStringFormat: () => ZodStringFormat,
75
+ ZodSuccess: () => ZodSuccess,
76
+ ZodSymbol: () => ZodSymbol,
77
+ ZodTemplateLiteral: () => ZodTemplateLiteral,
78
+ ZodTransform: () => ZodTransform,
79
+ ZodTuple: () => ZodTuple,
80
+ ZodType: () => ZodType,
81
+ ZodULID: () => ZodULID,
82
+ ZodURL: () => ZodURL,
83
+ ZodUUID: () => ZodUUID,
84
+ ZodUndefined: () => ZodUndefined,
85
+ ZodUnion: () => ZodUnion,
86
+ ZodUnknown: () => ZodUnknown,
87
+ ZodVoid: () => ZodVoid,
88
+ ZodXID: () => ZodXID,
89
+ ZodXor: () => ZodXor,
90
+ _ZodString: () => _ZodString,
91
+ _default: () => _default2,
92
+ _function: () => _function,
93
+ any: () => any,
94
+ array: () => array,
95
+ base64: () => base642,
96
+ base64url: () => base64url2,
97
+ bigint: () => bigint2,
98
+ boolean: () => boolean2,
99
+ catch: () => _catch2,
100
+ check: () => check,
101
+ cidrv4: () => cidrv42,
102
+ cidrv6: () => cidrv62,
103
+ clone: () => clone,
104
+ codec: () => codec,
105
+ coerce: () => coerce_exports,
106
+ config: () => config,
107
+ core: () => core_exports2,
108
+ cuid: () => cuid3,
109
+ cuid2: () => cuid22,
110
+ custom: () => custom,
111
+ date: () => date3,
112
+ decode: () => decode2,
113
+ decodeAsync: () => decodeAsync2,
114
+ describe: () => describe2,
115
+ discriminatedUnion: () => discriminatedUnion,
116
+ e164: () => e1642,
117
+ email: () => email2,
118
+ emoji: () => emoji2,
119
+ encode: () => encode2,
120
+ encodeAsync: () => encodeAsync2,
121
+ endsWith: () => _endsWith,
122
+ enum: () => _enum2,
123
+ exactOptional: () => exactOptional,
124
+ file: () => file,
125
+ flattenError: () => flattenError,
126
+ float32: () => float32,
127
+ float64: () => float64,
128
+ formatError: () => formatError,
129
+ fromJSONSchema: () => fromJSONSchema,
130
+ function: () => _function,
131
+ getErrorMap: () => getErrorMap,
132
+ globalRegistry: () => globalRegistry,
133
+ gt: () => _gt,
134
+ gte: () => _gte,
135
+ guid: () => guid2,
136
+ hash: () => hash,
137
+ hex: () => hex2,
138
+ hostname: () => hostname2,
139
+ httpUrl: () => httpUrl,
140
+ includes: () => _includes,
141
+ instanceof: () => _instanceof,
142
+ int: () => int,
143
+ int32: () => int32,
144
+ int64: () => int64,
145
+ intersection: () => intersection,
146
+ invertCodec: () => invertCodec,
147
+ ipv4: () => ipv42,
148
+ ipv6: () => ipv62,
149
+ iso: () => iso_exports,
150
+ json: () => json,
151
+ jwt: () => jwt,
152
+ keyof: () => keyof,
153
+ ksuid: () => ksuid2,
154
+ lazy: () => lazy,
155
+ length: () => _length,
156
+ literal: () => literal,
157
+ locales: () => locales_exports,
158
+ looseObject: () => looseObject,
159
+ looseRecord: () => looseRecord,
160
+ lowercase: () => _lowercase,
161
+ lt: () => _lt,
162
+ lte: () => _lte,
163
+ mac: () => mac2,
164
+ map: () => map,
165
+ maxLength: () => _maxLength,
166
+ maxSize: () => _maxSize,
167
+ meta: () => meta2,
168
+ mime: () => _mime,
169
+ minLength: () => _minLength,
170
+ minSize: () => _minSize,
171
+ multipleOf: () => _multipleOf,
172
+ nan: () => nan,
173
+ nanoid: () => nanoid2,
174
+ nativeEnum: () => nativeEnum,
175
+ negative: () => _negative,
176
+ never: () => never,
177
+ nonnegative: () => _nonnegative,
178
+ nonoptional: () => nonoptional,
179
+ nonpositive: () => _nonpositive,
180
+ normalize: () => _normalize,
181
+ null: () => _null3,
182
+ nullable: () => nullable,
183
+ nullish: () => nullish2,
184
+ number: () => number2,
185
+ object: () => object,
186
+ optional: () => optional,
187
+ overwrite: () => _overwrite,
188
+ parse: () => parse2,
189
+ parseAsync: () => parseAsync2,
190
+ partialRecord: () => partialRecord,
191
+ pipe: () => pipe,
192
+ positive: () => _positive,
193
+ prefault: () => prefault,
194
+ preprocess: () => preprocess,
195
+ prettifyError: () => prettifyError,
196
+ promise: () => promise,
197
+ property: () => _property,
198
+ readonly: () => readonly,
199
+ record: () => record,
200
+ refine: () => refine,
201
+ regex: () => _regex,
202
+ regexes: () => regexes_exports,
203
+ registry: () => registry,
204
+ safeDecode: () => safeDecode2,
205
+ safeDecodeAsync: () => safeDecodeAsync2,
206
+ safeEncode: () => safeEncode2,
207
+ safeEncodeAsync: () => safeEncodeAsync2,
208
+ safeParse: () => safeParse2,
209
+ safeParseAsync: () => safeParseAsync2,
210
+ set: () => set,
211
+ setErrorMap: () => setErrorMap,
212
+ size: () => _size,
213
+ slugify: () => _slugify,
214
+ startsWith: () => _startsWith,
215
+ strictObject: () => strictObject,
216
+ string: () => string2,
217
+ stringFormat: () => stringFormat,
218
+ stringbool: () => stringbool,
219
+ success: () => success,
220
+ superRefine: () => superRefine,
221
+ symbol: () => symbol,
222
+ templateLiteral: () => templateLiteral,
223
+ toJSONSchema: () => toJSONSchema,
224
+ toLowerCase: () => _toLowerCase,
225
+ toUpperCase: () => _toUpperCase,
226
+ transform: () => transform,
227
+ treeifyError: () => treeifyError,
228
+ trim: () => _trim,
229
+ tuple: () => tuple,
230
+ uint32: () => uint32,
231
+ uint64: () => uint64,
232
+ ulid: () => ulid2,
233
+ undefined: () => _undefined3,
234
+ union: () => union,
235
+ unknown: () => unknown,
236
+ uppercase: () => _uppercase,
237
+ url: () => url,
238
+ util: () => util_exports,
239
+ uuid: () => uuid2,
240
+ uuidv4: () => uuidv4,
241
+ uuidv6: () => uuidv6,
242
+ uuidv7: () => uuidv7,
243
+ void: () => _void2,
244
+ xid: () => xid2,
245
+ xor: () => xor
246
+ });
1732
247
 
1733
248
  // node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/index.js
1734
249
  var core_exports2 = {};
@@ -2009,6 +524,779 @@ __export(core_exports2, {
2009
524
  version: () => version
2010
525
  });
2011
526
 
527
+ // node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
528
+ var _a;
529
+ var NEVER = /* @__PURE__ */ Object.freeze({
530
+ status: "aborted"
531
+ });
532
+ // @__NO_SIDE_EFFECTS__
533
+ function $constructor(name, initializer3, params) {
534
+ function init(inst, def) {
535
+ if (!inst._zod) {
536
+ Object.defineProperty(inst, "_zod", {
537
+ value: {
538
+ def,
539
+ constr: _,
540
+ traits: /* @__PURE__ */ new Set()
541
+ },
542
+ enumerable: false
543
+ });
544
+ }
545
+ if (inst._zod.traits.has(name)) {
546
+ return;
547
+ }
548
+ inst._zod.traits.add(name);
549
+ initializer3(inst, def);
550
+ const proto = _.prototype;
551
+ const keys = Object.keys(proto);
552
+ for (let i = 0; i < keys.length; i++) {
553
+ const k = keys[i];
554
+ if (!(k in inst)) {
555
+ inst[k] = proto[k].bind(inst);
556
+ }
557
+ }
558
+ }
559
+ const Parent = params?.Parent ?? Object;
560
+ class Definition extends Parent {
561
+ }
562
+ Object.defineProperty(Definition, "name", { value: name });
563
+ function _(def) {
564
+ var _a3;
565
+ const inst = params?.Parent ? new Definition() : this;
566
+ init(inst, def);
567
+ (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
568
+ for (const fn of inst._zod.deferred) {
569
+ fn();
570
+ }
571
+ return inst;
572
+ }
573
+ Object.defineProperty(_, "init", { value: init });
574
+ Object.defineProperty(_, Symbol.hasInstance, {
575
+ value: (inst) => {
576
+ if (params?.Parent && inst instanceof params.Parent)
577
+ return true;
578
+ return inst?._zod?.traits?.has(name);
579
+ }
580
+ });
581
+ Object.defineProperty(_, "name", { value: name });
582
+ return _;
583
+ }
584
+ var $brand = /* @__PURE__ */ Symbol("zod_brand");
585
+ var $ZodAsyncError = class extends Error {
586
+ constructor() {
587
+ super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
588
+ }
589
+ };
590
+ var $ZodEncodeError = class extends Error {
591
+ constructor(name) {
592
+ super(`Encountered unidirectional transform during encode: ${name}`);
593
+ this.name = "ZodEncodeError";
594
+ }
595
+ };
596
+ (_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});
597
+ var globalConfig = globalThis.__zod_globalConfig;
598
+ function config(newConfig) {
599
+ if (newConfig)
600
+ Object.assign(globalConfig, newConfig);
601
+ return globalConfig;
602
+ }
603
+
604
+ // node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
605
+ var util_exports = {};
606
+ __export(util_exports, {
607
+ BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
608
+ Class: () => Class,
609
+ NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
610
+ aborted: () => aborted,
611
+ allowsEval: () => allowsEval,
612
+ assert: () => assert,
613
+ assertEqual: () => assertEqual,
614
+ assertIs: () => assertIs,
615
+ assertNever: () => assertNever,
616
+ assertNotEqual: () => assertNotEqual,
617
+ assignProp: () => assignProp,
618
+ base64ToUint8Array: () => base64ToUint8Array,
619
+ base64urlToUint8Array: () => base64urlToUint8Array,
620
+ cached: () => cached,
621
+ captureStackTrace: () => captureStackTrace,
622
+ cleanEnum: () => cleanEnum,
623
+ cleanRegex: () => cleanRegex,
624
+ clone: () => clone,
625
+ cloneDef: () => cloneDef,
626
+ createTransparentProxy: () => createTransparentProxy,
627
+ defineLazy: () => defineLazy,
628
+ esc: () => esc,
629
+ escapeRegex: () => escapeRegex,
630
+ explicitlyAborted: () => explicitlyAborted,
631
+ extend: () => extend,
632
+ finalizeIssue: () => finalizeIssue,
633
+ floatSafeRemainder: () => floatSafeRemainder,
634
+ getElementAtPath: () => getElementAtPath,
635
+ getEnumValues: () => getEnumValues,
636
+ getLengthableOrigin: () => getLengthableOrigin,
637
+ getParsedType: () => getParsedType,
638
+ getSizableOrigin: () => getSizableOrigin,
639
+ hexToUint8Array: () => hexToUint8Array,
640
+ isObject: () => isObject,
641
+ isPlainObject: () => isPlainObject,
642
+ issue: () => issue,
643
+ joinValues: () => joinValues,
644
+ jsonStringifyReplacer: () => jsonStringifyReplacer,
645
+ merge: () => merge,
646
+ mergeDefs: () => mergeDefs,
647
+ normalizeParams: () => normalizeParams,
648
+ nullish: () => nullish,
649
+ numKeys: () => numKeys,
650
+ objectClone: () => objectClone,
651
+ omit: () => omit,
652
+ optionalKeys: () => optionalKeys,
653
+ parsedType: () => parsedType,
654
+ partial: () => partial,
655
+ pick: () => pick,
656
+ prefixIssues: () => prefixIssues,
657
+ primitiveTypes: () => primitiveTypes,
658
+ promiseAllObject: () => promiseAllObject,
659
+ propertyKeyTypes: () => propertyKeyTypes,
660
+ randomString: () => randomString,
661
+ required: () => required,
662
+ safeExtend: () => safeExtend,
663
+ shallowClone: () => shallowClone,
664
+ slugify: () => slugify,
665
+ stringifyPrimitive: () => stringifyPrimitive,
666
+ uint8ArrayToBase64: () => uint8ArrayToBase64,
667
+ uint8ArrayToBase64url: () => uint8ArrayToBase64url,
668
+ uint8ArrayToHex: () => uint8ArrayToHex,
669
+ unwrapMessage: () => unwrapMessage
670
+ });
671
+ function assertEqual(val) {
672
+ return val;
673
+ }
674
+ function assertNotEqual(val) {
675
+ return val;
676
+ }
677
+ function assertIs(_arg) {
678
+ }
679
+ function assertNever(_x) {
680
+ throw new Error("Unexpected value in exhaustive check");
681
+ }
682
+ function assert(_) {
683
+ }
684
+ function getEnumValues(entries) {
685
+ const numericValues = Object.values(entries).filter((v) => typeof v === "number");
686
+ const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
687
+ return values;
688
+ }
689
+ function joinValues(array2, separator = "|") {
690
+ return array2.map((val) => stringifyPrimitive(val)).join(separator);
691
+ }
692
+ function jsonStringifyReplacer(_, value) {
693
+ if (typeof value === "bigint")
694
+ return value.toString();
695
+ return value;
696
+ }
697
+ function cached(getter) {
698
+ const set2 = false;
699
+ return {
700
+ get value() {
701
+ if (!set2) {
702
+ const value = getter();
703
+ Object.defineProperty(this, "value", { value });
704
+ return value;
705
+ }
706
+ throw new Error("cached value already set");
707
+ }
708
+ };
709
+ }
710
+ function nullish(input) {
711
+ return input === null || input === void 0;
712
+ }
713
+ function cleanRegex(source) {
714
+ const start = source.startsWith("^") ? 1 : 0;
715
+ const end = source.endsWith("$") ? source.length - 1 : source.length;
716
+ return source.slice(start, end);
717
+ }
718
+ function floatSafeRemainder(val, step) {
719
+ const ratio = val / step;
720
+ const roundedRatio = Math.round(ratio);
721
+ const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);
722
+ if (Math.abs(ratio - roundedRatio) < tolerance)
723
+ return 0;
724
+ return ratio - roundedRatio;
725
+ }
726
+ var EVALUATING = /* @__PURE__ */ Symbol("evaluating");
727
+ function defineLazy(object2, key, getter) {
728
+ let value = void 0;
729
+ Object.defineProperty(object2, key, {
730
+ get() {
731
+ if (value === EVALUATING) {
732
+ return void 0;
733
+ }
734
+ if (value === void 0) {
735
+ value = EVALUATING;
736
+ value = getter();
737
+ }
738
+ return value;
739
+ },
740
+ set(v) {
741
+ Object.defineProperty(object2, key, {
742
+ value: v
743
+ // configurable: true,
744
+ });
745
+ },
746
+ configurable: true
747
+ });
748
+ }
749
+ function objectClone(obj) {
750
+ return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));
751
+ }
752
+ function assignProp(target, prop, value) {
753
+ Object.defineProperty(target, prop, {
754
+ value,
755
+ writable: true,
756
+ enumerable: true,
757
+ configurable: true
758
+ });
759
+ }
760
+ function mergeDefs(...defs) {
761
+ const mergedDescriptors = {};
762
+ for (const def of defs) {
763
+ const descriptors = Object.getOwnPropertyDescriptors(def);
764
+ Object.assign(mergedDescriptors, descriptors);
765
+ }
766
+ return Object.defineProperties({}, mergedDescriptors);
767
+ }
768
+ function cloneDef(schema) {
769
+ return mergeDefs(schema._zod.def);
770
+ }
771
+ function getElementAtPath(obj, path) {
772
+ if (!path)
773
+ return obj;
774
+ return path.reduce((acc, key) => acc?.[key], obj);
775
+ }
776
+ function promiseAllObject(promisesObj) {
777
+ const keys = Object.keys(promisesObj);
778
+ const promises = keys.map((key) => promisesObj[key]);
779
+ return Promise.all(promises).then((results) => {
780
+ const resolvedObj = {};
781
+ for (let i = 0; i < keys.length; i++) {
782
+ resolvedObj[keys[i]] = results[i];
783
+ }
784
+ return resolvedObj;
785
+ });
786
+ }
787
+ function randomString(length = 10) {
788
+ const chars = "abcdefghijklmnopqrstuvwxyz";
789
+ let str = "";
790
+ for (let i = 0; i < length; i++) {
791
+ str += chars[Math.floor(Math.random() * chars.length)];
792
+ }
793
+ return str;
794
+ }
795
+ function esc(str) {
796
+ return JSON.stringify(str);
797
+ }
798
+ function slugify(input) {
799
+ return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
800
+ }
801
+ var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
802
+ };
803
+ function isObject(data) {
804
+ return typeof data === "object" && data !== null && !Array.isArray(data);
805
+ }
806
+ var allowsEval = /* @__PURE__ */ cached(() => {
807
+ if (globalConfig.jitless) {
808
+ return false;
809
+ }
810
+ if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
811
+ return false;
812
+ }
813
+ try {
814
+ const F = Function;
815
+ new F("");
816
+ return true;
817
+ } catch (_) {
818
+ return false;
819
+ }
820
+ });
821
+ function isPlainObject(o) {
822
+ if (isObject(o) === false)
823
+ return false;
824
+ const ctor = o.constructor;
825
+ if (ctor === void 0)
826
+ return true;
827
+ if (typeof ctor !== "function")
828
+ return true;
829
+ const prot = ctor.prototype;
830
+ if (isObject(prot) === false)
831
+ return false;
832
+ if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
833
+ return false;
834
+ }
835
+ return true;
836
+ }
837
+ function shallowClone(o) {
838
+ if (isPlainObject(o))
839
+ return { ...o };
840
+ if (Array.isArray(o))
841
+ return [...o];
842
+ if (o instanceof Map)
843
+ return new Map(o);
844
+ if (o instanceof Set)
845
+ return new Set(o);
846
+ return o;
847
+ }
848
+ function numKeys(data) {
849
+ let keyCount = 0;
850
+ for (const key in data) {
851
+ if (Object.prototype.hasOwnProperty.call(data, key)) {
852
+ keyCount++;
853
+ }
854
+ }
855
+ return keyCount;
856
+ }
857
+ var getParsedType = (data) => {
858
+ const t = typeof data;
859
+ switch (t) {
860
+ case "undefined":
861
+ return "undefined";
862
+ case "string":
863
+ return "string";
864
+ case "number":
865
+ return Number.isNaN(data) ? "nan" : "number";
866
+ case "boolean":
867
+ return "boolean";
868
+ case "function":
869
+ return "function";
870
+ case "bigint":
871
+ return "bigint";
872
+ case "symbol":
873
+ return "symbol";
874
+ case "object":
875
+ if (Array.isArray(data)) {
876
+ return "array";
877
+ }
878
+ if (data === null) {
879
+ return "null";
880
+ }
881
+ if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
882
+ return "promise";
883
+ }
884
+ if (typeof Map !== "undefined" && data instanceof Map) {
885
+ return "map";
886
+ }
887
+ if (typeof Set !== "undefined" && data instanceof Set) {
888
+ return "set";
889
+ }
890
+ if (typeof Date !== "undefined" && data instanceof Date) {
891
+ return "date";
892
+ }
893
+ if (typeof File !== "undefined" && data instanceof File) {
894
+ return "file";
895
+ }
896
+ return "object";
897
+ default:
898
+ throw new Error(`Unknown data type: ${t}`);
899
+ }
900
+ };
901
+ var propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
902
+ var primitiveTypes = /* @__PURE__ */ new Set([
903
+ "string",
904
+ "number",
905
+ "bigint",
906
+ "boolean",
907
+ "symbol",
908
+ "undefined"
909
+ ]);
910
+ function escapeRegex(str) {
911
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
912
+ }
913
+ function clone(inst, def, params) {
914
+ const cl = new inst._zod.constr(def ?? inst._zod.def);
915
+ if (!def || params?.parent)
916
+ cl._zod.parent = inst;
917
+ return cl;
918
+ }
919
+ function normalizeParams(_params) {
920
+ const params = _params;
921
+ if (!params)
922
+ return {};
923
+ if (typeof params === "string")
924
+ return { error: () => params };
925
+ if (params?.message !== void 0) {
926
+ if (params?.error !== void 0)
927
+ throw new Error("Cannot specify both `message` and `error` params");
928
+ params.error = params.message;
929
+ }
930
+ delete params.message;
931
+ if (typeof params.error === "string")
932
+ return { ...params, error: () => params.error };
933
+ return params;
934
+ }
935
+ function createTransparentProxy(getter) {
936
+ let target;
937
+ return new Proxy({}, {
938
+ get(_, prop, receiver) {
939
+ target ?? (target = getter());
940
+ return Reflect.get(target, prop, receiver);
941
+ },
942
+ set(_, prop, value, receiver) {
943
+ target ?? (target = getter());
944
+ return Reflect.set(target, prop, value, receiver);
945
+ },
946
+ has(_, prop) {
947
+ target ?? (target = getter());
948
+ return Reflect.has(target, prop);
949
+ },
950
+ deleteProperty(_, prop) {
951
+ target ?? (target = getter());
952
+ return Reflect.deleteProperty(target, prop);
953
+ },
954
+ ownKeys(_) {
955
+ target ?? (target = getter());
956
+ return Reflect.ownKeys(target);
957
+ },
958
+ getOwnPropertyDescriptor(_, prop) {
959
+ target ?? (target = getter());
960
+ return Reflect.getOwnPropertyDescriptor(target, prop);
961
+ },
962
+ defineProperty(_, prop, descriptor) {
963
+ target ?? (target = getter());
964
+ return Reflect.defineProperty(target, prop, descriptor);
965
+ }
966
+ });
967
+ }
968
+ function stringifyPrimitive(value) {
969
+ if (typeof value === "bigint")
970
+ return value.toString() + "n";
971
+ if (typeof value === "string")
972
+ return `"${value}"`;
973
+ return `${value}`;
974
+ }
975
+ function optionalKeys(shape) {
976
+ return Object.keys(shape).filter((k) => {
977
+ return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
978
+ });
979
+ }
980
+ var NUMBER_FORMAT_RANGES = {
981
+ safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
982
+ int32: [-2147483648, 2147483647],
983
+ uint32: [0, 4294967295],
984
+ float32: [-34028234663852886e22, 34028234663852886e22],
985
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
986
+ };
987
+ var BIGINT_FORMAT_RANGES = {
988
+ int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")],
989
+ uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
990
+ };
991
+ function pick(schema, mask) {
992
+ const currDef = schema._zod.def;
993
+ const checks = currDef.checks;
994
+ const hasChecks = checks && checks.length > 0;
995
+ if (hasChecks) {
996
+ throw new Error(".pick() cannot be used on object schemas containing refinements");
997
+ }
998
+ const def = mergeDefs(schema._zod.def, {
999
+ get shape() {
1000
+ const newShape = {};
1001
+ for (const key in mask) {
1002
+ if (!(key in currDef.shape)) {
1003
+ throw new Error(`Unrecognized key: "${key}"`);
1004
+ }
1005
+ if (!mask[key])
1006
+ continue;
1007
+ newShape[key] = currDef.shape[key];
1008
+ }
1009
+ assignProp(this, "shape", newShape);
1010
+ return newShape;
1011
+ },
1012
+ checks: []
1013
+ });
1014
+ return clone(schema, def);
1015
+ }
1016
+ function omit(schema, mask) {
1017
+ const currDef = schema._zod.def;
1018
+ const checks = currDef.checks;
1019
+ const hasChecks = checks && checks.length > 0;
1020
+ if (hasChecks) {
1021
+ throw new Error(".omit() cannot be used on object schemas containing refinements");
1022
+ }
1023
+ const def = mergeDefs(schema._zod.def, {
1024
+ get shape() {
1025
+ const newShape = { ...schema._zod.def.shape };
1026
+ for (const key in mask) {
1027
+ if (!(key in currDef.shape)) {
1028
+ throw new Error(`Unrecognized key: "${key}"`);
1029
+ }
1030
+ if (!mask[key])
1031
+ continue;
1032
+ delete newShape[key];
1033
+ }
1034
+ assignProp(this, "shape", newShape);
1035
+ return newShape;
1036
+ },
1037
+ checks: []
1038
+ });
1039
+ return clone(schema, def);
1040
+ }
1041
+ function extend(schema, shape) {
1042
+ if (!isPlainObject(shape)) {
1043
+ throw new Error("Invalid input to extend: expected a plain object");
1044
+ }
1045
+ const checks = schema._zod.def.checks;
1046
+ const hasChecks = checks && checks.length > 0;
1047
+ if (hasChecks) {
1048
+ const existingShape = schema._zod.def.shape;
1049
+ for (const key in shape) {
1050
+ if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) {
1051
+ throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
1052
+ }
1053
+ }
1054
+ }
1055
+ const def = mergeDefs(schema._zod.def, {
1056
+ get shape() {
1057
+ const _shape = { ...schema._zod.def.shape, ...shape };
1058
+ assignProp(this, "shape", _shape);
1059
+ return _shape;
1060
+ }
1061
+ });
1062
+ return clone(schema, def);
1063
+ }
1064
+ function safeExtend(schema, shape) {
1065
+ if (!isPlainObject(shape)) {
1066
+ throw new Error("Invalid input to safeExtend: expected a plain object");
1067
+ }
1068
+ const def = mergeDefs(schema._zod.def, {
1069
+ get shape() {
1070
+ const _shape = { ...schema._zod.def.shape, ...shape };
1071
+ assignProp(this, "shape", _shape);
1072
+ return _shape;
1073
+ }
1074
+ });
1075
+ return clone(schema, def);
1076
+ }
1077
+ function merge(a, b) {
1078
+ if (a._zod.def.checks?.length) {
1079
+ throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
1080
+ }
1081
+ const def = mergeDefs(a._zod.def, {
1082
+ get shape() {
1083
+ const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
1084
+ assignProp(this, "shape", _shape);
1085
+ return _shape;
1086
+ },
1087
+ get catchall() {
1088
+ return b._zod.def.catchall;
1089
+ },
1090
+ checks: b._zod.def.checks ?? []
1091
+ });
1092
+ return clone(a, def);
1093
+ }
1094
+ function partial(Class2, schema, mask) {
1095
+ const currDef = schema._zod.def;
1096
+ const checks = currDef.checks;
1097
+ const hasChecks = checks && checks.length > 0;
1098
+ if (hasChecks) {
1099
+ throw new Error(".partial() cannot be used on object schemas containing refinements");
1100
+ }
1101
+ const def = mergeDefs(schema._zod.def, {
1102
+ get shape() {
1103
+ const oldShape = schema._zod.def.shape;
1104
+ const shape = { ...oldShape };
1105
+ if (mask) {
1106
+ for (const key in mask) {
1107
+ if (!(key in oldShape)) {
1108
+ throw new Error(`Unrecognized key: "${key}"`);
1109
+ }
1110
+ if (!mask[key])
1111
+ continue;
1112
+ shape[key] = Class2 ? new Class2({
1113
+ type: "optional",
1114
+ innerType: oldShape[key]
1115
+ }) : oldShape[key];
1116
+ }
1117
+ } else {
1118
+ for (const key in oldShape) {
1119
+ shape[key] = Class2 ? new Class2({
1120
+ type: "optional",
1121
+ innerType: oldShape[key]
1122
+ }) : oldShape[key];
1123
+ }
1124
+ }
1125
+ assignProp(this, "shape", shape);
1126
+ return shape;
1127
+ },
1128
+ checks: []
1129
+ });
1130
+ return clone(schema, def);
1131
+ }
1132
+ function required(Class2, schema, mask) {
1133
+ const def = mergeDefs(schema._zod.def, {
1134
+ get shape() {
1135
+ const oldShape = schema._zod.def.shape;
1136
+ const shape = { ...oldShape };
1137
+ if (mask) {
1138
+ for (const key in mask) {
1139
+ if (!(key in shape)) {
1140
+ throw new Error(`Unrecognized key: "${key}"`);
1141
+ }
1142
+ if (!mask[key])
1143
+ continue;
1144
+ shape[key] = new Class2({
1145
+ type: "nonoptional",
1146
+ innerType: oldShape[key]
1147
+ });
1148
+ }
1149
+ } else {
1150
+ for (const key in oldShape) {
1151
+ shape[key] = new Class2({
1152
+ type: "nonoptional",
1153
+ innerType: oldShape[key]
1154
+ });
1155
+ }
1156
+ }
1157
+ assignProp(this, "shape", shape);
1158
+ return shape;
1159
+ }
1160
+ });
1161
+ return clone(schema, def);
1162
+ }
1163
+ function aborted(x, startIndex = 0) {
1164
+ if (x.aborted === true)
1165
+ return true;
1166
+ for (let i = startIndex; i < x.issues.length; i++) {
1167
+ if (x.issues[i]?.continue !== true) {
1168
+ return true;
1169
+ }
1170
+ }
1171
+ return false;
1172
+ }
1173
+ function explicitlyAborted(x, startIndex = 0) {
1174
+ if (x.aborted === true)
1175
+ return true;
1176
+ for (let i = startIndex; i < x.issues.length; i++) {
1177
+ if (x.issues[i]?.continue === false) {
1178
+ return true;
1179
+ }
1180
+ }
1181
+ return false;
1182
+ }
1183
+ function prefixIssues(path, issues) {
1184
+ return issues.map((iss) => {
1185
+ var _a3;
1186
+ (_a3 = iss).path ?? (_a3.path = []);
1187
+ iss.path.unshift(path);
1188
+ return iss;
1189
+ });
1190
+ }
1191
+ function unwrapMessage(message) {
1192
+ return typeof message === "string" ? message : message?.message;
1193
+ }
1194
+ function finalizeIssue(iss, ctx, config2) {
1195
+ const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
1196
+ const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
1197
+ rest.path ?? (rest.path = []);
1198
+ rest.message = message;
1199
+ if (ctx?.reportInput) {
1200
+ rest.input = _input;
1201
+ }
1202
+ return rest;
1203
+ }
1204
+ function getSizableOrigin(input) {
1205
+ if (input instanceof Set)
1206
+ return "set";
1207
+ if (input instanceof Map)
1208
+ return "map";
1209
+ if (input instanceof File)
1210
+ return "file";
1211
+ return "unknown";
1212
+ }
1213
+ function getLengthableOrigin(input) {
1214
+ if (Array.isArray(input))
1215
+ return "array";
1216
+ if (typeof input === "string")
1217
+ return "string";
1218
+ return "unknown";
1219
+ }
1220
+ function parsedType(data) {
1221
+ const t = typeof data;
1222
+ switch (t) {
1223
+ case "number": {
1224
+ return Number.isNaN(data) ? "nan" : "number";
1225
+ }
1226
+ case "object": {
1227
+ if (data === null) {
1228
+ return "null";
1229
+ }
1230
+ if (Array.isArray(data)) {
1231
+ return "array";
1232
+ }
1233
+ const obj = data;
1234
+ if (obj && Object.getPrototypeOf(obj) !== Object.prototype && "constructor" in obj && obj.constructor) {
1235
+ return obj.constructor.name;
1236
+ }
1237
+ }
1238
+ }
1239
+ return t;
1240
+ }
1241
+ function issue(...args) {
1242
+ const [iss, input, inst] = args;
1243
+ if (typeof iss === "string") {
1244
+ return {
1245
+ message: iss,
1246
+ code: "custom",
1247
+ input,
1248
+ inst
1249
+ };
1250
+ }
1251
+ return { ...iss };
1252
+ }
1253
+ function cleanEnum(obj) {
1254
+ return Object.entries(obj).filter(([k, _]) => {
1255
+ return Number.isNaN(Number.parseInt(k, 10));
1256
+ }).map((el) => el[1]);
1257
+ }
1258
+ function base64ToUint8Array(base643) {
1259
+ const binaryString = atob(base643);
1260
+ const bytes = new Uint8Array(binaryString.length);
1261
+ for (let i = 0; i < binaryString.length; i++) {
1262
+ bytes[i] = binaryString.charCodeAt(i);
1263
+ }
1264
+ return bytes;
1265
+ }
1266
+ function uint8ArrayToBase64(bytes) {
1267
+ let binaryString = "";
1268
+ for (let i = 0; i < bytes.length; i++) {
1269
+ binaryString += String.fromCharCode(bytes[i]);
1270
+ }
1271
+ return btoa(binaryString);
1272
+ }
1273
+ function base64urlToUint8Array(base64url3) {
1274
+ const base643 = base64url3.replace(/-/g, "+").replace(/_/g, "/");
1275
+ const padding = "=".repeat((4 - base643.length % 4) % 4);
1276
+ return base64ToUint8Array(base643 + padding);
1277
+ }
1278
+ function uint8ArrayToBase64url(bytes) {
1279
+ return uint8ArrayToBase64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
1280
+ }
1281
+ function hexToUint8Array(hex3) {
1282
+ const cleanHex = hex3.replace(/^0x/, "");
1283
+ if (cleanHex.length % 2 !== 0) {
1284
+ throw new Error("Invalid hex string length");
1285
+ }
1286
+ const bytes = new Uint8Array(cleanHex.length / 2);
1287
+ for (let i = 0; i < cleanHex.length; i += 2) {
1288
+ bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);
1289
+ }
1290
+ return bytes;
1291
+ }
1292
+ function uint8ArrayToHex(bytes) {
1293
+ return Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
1294
+ }
1295
+ var Class = class {
1296
+ constructor(..._args) {
1297
+ }
1298
+ };
1299
+
2012
1300
  // node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
2013
1301
  var initializer = (inst, def) => {
2014
1302
  inst.name = "$ZodError";
@@ -11034,6 +10322,56 @@ function yo_default() {
11034
10322
  };
11035
10323
  }
11036
10324
 
10325
+ // node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js
10326
+ var _a2;
10327
+ var $output = /* @__PURE__ */ Symbol("ZodOutput");
10328
+ var $input = /* @__PURE__ */ Symbol("ZodInput");
10329
+ var $ZodRegistry = class {
10330
+ constructor() {
10331
+ this._map = /* @__PURE__ */ new WeakMap();
10332
+ this._idmap = /* @__PURE__ */ new Map();
10333
+ }
10334
+ add(schema, ..._meta) {
10335
+ const meta3 = _meta[0];
10336
+ this._map.set(schema, meta3);
10337
+ if (meta3 && typeof meta3 === "object" && "id" in meta3) {
10338
+ this._idmap.set(meta3.id, schema);
10339
+ }
10340
+ return this;
10341
+ }
10342
+ clear() {
10343
+ this._map = /* @__PURE__ */ new WeakMap();
10344
+ this._idmap = /* @__PURE__ */ new Map();
10345
+ return this;
10346
+ }
10347
+ remove(schema) {
10348
+ const meta3 = this._map.get(schema);
10349
+ if (meta3 && typeof meta3 === "object" && "id" in meta3) {
10350
+ this._idmap.delete(meta3.id);
10351
+ }
10352
+ this._map.delete(schema);
10353
+ return this;
10354
+ }
10355
+ get(schema) {
10356
+ const p = schema._zod.parent;
10357
+ if (p) {
10358
+ const pm = { ...this.get(p) ?? {} };
10359
+ delete pm.id;
10360
+ const f = { ...pm, ...this._map.get(schema) };
10361
+ return Object.keys(f).length ? f : void 0;
10362
+ }
10363
+ return this._map.get(schema);
10364
+ }
10365
+ has(schema) {
10366
+ return this._map.has(schema);
10367
+ }
10368
+ };
10369
+ function registry() {
10370
+ return new $ZodRegistry();
10371
+ }
10372
+ (_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
10373
+ var globalRegistry = globalThis.__zod_globalRegistry;
10374
+
11037
10375
  // node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js
11038
10376
  // @__NO_SIDE_EFFECTS__
11039
10377
  function _string(Class2, params) {
@@ -11787,290 +11125,1193 @@ function _record(Class2, keyType, valueType, params) {
11787
11125
  });
11788
11126
  }
11789
11127
  // @__NO_SIDE_EFFECTS__
11790
- function _map(Class2, keyType, valueType, params) {
11128
+ function _map(Class2, keyType, valueType, params) {
11129
+ return new Class2({
11130
+ type: "map",
11131
+ keyType,
11132
+ valueType,
11133
+ ...normalizeParams(params)
11134
+ });
11135
+ }
11136
+ // @__NO_SIDE_EFFECTS__
11137
+ function _set(Class2, valueType, params) {
11138
+ return new Class2({
11139
+ type: "set",
11140
+ valueType,
11141
+ ...normalizeParams(params)
11142
+ });
11143
+ }
11144
+ // @__NO_SIDE_EFFECTS__
11145
+ function _enum(Class2, values, params) {
11146
+ const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
11147
+ return new Class2({
11148
+ type: "enum",
11149
+ entries,
11150
+ ...normalizeParams(params)
11151
+ });
11152
+ }
11153
+ // @__NO_SIDE_EFFECTS__
11154
+ function _nativeEnum(Class2, entries, params) {
11155
+ return new Class2({
11156
+ type: "enum",
11157
+ entries,
11158
+ ...normalizeParams(params)
11159
+ });
11160
+ }
11161
+ // @__NO_SIDE_EFFECTS__
11162
+ function _literal(Class2, value, params) {
11163
+ return new Class2({
11164
+ type: "literal",
11165
+ values: Array.isArray(value) ? value : [value],
11166
+ ...normalizeParams(params)
11167
+ });
11168
+ }
11169
+ // @__NO_SIDE_EFFECTS__
11170
+ function _file(Class2, params) {
11171
+ return new Class2({
11172
+ type: "file",
11173
+ ...normalizeParams(params)
11174
+ });
11175
+ }
11176
+ // @__NO_SIDE_EFFECTS__
11177
+ function _transform(Class2, fn) {
11178
+ return new Class2({
11179
+ type: "transform",
11180
+ transform: fn
11181
+ });
11182
+ }
11183
+ // @__NO_SIDE_EFFECTS__
11184
+ function _optional(Class2, innerType) {
11185
+ return new Class2({
11186
+ type: "optional",
11187
+ innerType
11188
+ });
11189
+ }
11190
+ // @__NO_SIDE_EFFECTS__
11191
+ function _nullable(Class2, innerType) {
11192
+ return new Class2({
11193
+ type: "nullable",
11194
+ innerType
11195
+ });
11196
+ }
11197
+ // @__NO_SIDE_EFFECTS__
11198
+ function _default(Class2, innerType, defaultValue) {
11199
+ return new Class2({
11200
+ type: "default",
11201
+ innerType,
11202
+ get defaultValue() {
11203
+ return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
11204
+ }
11205
+ });
11206
+ }
11207
+ // @__NO_SIDE_EFFECTS__
11208
+ function _nonoptional(Class2, innerType, params) {
11209
+ return new Class2({
11210
+ type: "nonoptional",
11211
+ innerType,
11212
+ ...normalizeParams(params)
11213
+ });
11214
+ }
11215
+ // @__NO_SIDE_EFFECTS__
11216
+ function _success(Class2, innerType) {
11217
+ return new Class2({
11218
+ type: "success",
11219
+ innerType
11220
+ });
11221
+ }
11222
+ // @__NO_SIDE_EFFECTS__
11223
+ function _catch(Class2, innerType, catchValue) {
11224
+ return new Class2({
11225
+ type: "catch",
11226
+ innerType,
11227
+ catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
11228
+ });
11229
+ }
11230
+ // @__NO_SIDE_EFFECTS__
11231
+ function _pipe(Class2, in_, out) {
11232
+ return new Class2({
11233
+ type: "pipe",
11234
+ in: in_,
11235
+ out
11236
+ });
11237
+ }
11238
+ // @__NO_SIDE_EFFECTS__
11239
+ function _readonly(Class2, innerType) {
11240
+ return new Class2({
11241
+ type: "readonly",
11242
+ innerType
11243
+ });
11244
+ }
11245
+ // @__NO_SIDE_EFFECTS__
11246
+ function _templateLiteral(Class2, parts, params) {
11247
+ return new Class2({
11248
+ type: "template_literal",
11249
+ parts,
11250
+ ...normalizeParams(params)
11251
+ });
11252
+ }
11253
+ // @__NO_SIDE_EFFECTS__
11254
+ function _lazy(Class2, getter) {
11791
11255
  return new Class2({
11792
- type: "map",
11793
- keyType,
11794
- valueType,
11795
- ...normalizeParams(params)
11256
+ type: "lazy",
11257
+ getter
11796
11258
  });
11797
11259
  }
11798
11260
  // @__NO_SIDE_EFFECTS__
11799
- function _set(Class2, valueType, params) {
11261
+ function _promise(Class2, innerType) {
11800
11262
  return new Class2({
11801
- type: "set",
11802
- valueType,
11803
- ...normalizeParams(params)
11263
+ type: "promise",
11264
+ innerType
11804
11265
  });
11805
11266
  }
11806
11267
  // @__NO_SIDE_EFFECTS__
11807
- function _enum(Class2, values, params) {
11808
- const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
11809
- return new Class2({
11810
- type: "enum",
11811
- entries,
11812
- ...normalizeParams(params)
11268
+ function _custom(Class2, fn, _params) {
11269
+ const norm = normalizeParams(_params);
11270
+ norm.abort ?? (norm.abort = true);
11271
+ const schema = new Class2({
11272
+ type: "custom",
11273
+ check: "custom",
11274
+ fn,
11275
+ ...norm
11813
11276
  });
11277
+ return schema;
11814
11278
  }
11815
11279
  // @__NO_SIDE_EFFECTS__
11816
- function _nativeEnum(Class2, entries, params) {
11817
- return new Class2({
11818
- type: "enum",
11819
- entries,
11820
- ...normalizeParams(params)
11280
+ function _refine(Class2, fn, _params) {
11281
+ const schema = new Class2({
11282
+ type: "custom",
11283
+ check: "custom",
11284
+ fn,
11285
+ ...normalizeParams(_params)
11821
11286
  });
11287
+ return schema;
11822
11288
  }
11823
11289
  // @__NO_SIDE_EFFECTS__
11824
- function _literal(Class2, value, params) {
11825
- return new Class2({
11826
- type: "literal",
11827
- values: Array.isArray(value) ? value : [value],
11290
+ function _superRefine(fn, params) {
11291
+ const ch = /* @__PURE__ */ _check((payload) => {
11292
+ payload.addIssue = (issue2) => {
11293
+ if (typeof issue2 === "string") {
11294
+ payload.issues.push(issue(issue2, payload.value, ch._zod.def));
11295
+ } else {
11296
+ const _issue = issue2;
11297
+ if (_issue.fatal)
11298
+ _issue.continue = false;
11299
+ _issue.code ?? (_issue.code = "custom");
11300
+ _issue.input ?? (_issue.input = payload.value);
11301
+ _issue.inst ?? (_issue.inst = ch);
11302
+ _issue.continue ?? (_issue.continue = !ch._zod.def.abort);
11303
+ payload.issues.push(issue(_issue));
11304
+ }
11305
+ };
11306
+ return fn(payload.value, payload);
11307
+ }, params);
11308
+ return ch;
11309
+ }
11310
+ // @__NO_SIDE_EFFECTS__
11311
+ function _check(fn, params) {
11312
+ const ch = new $ZodCheck({
11313
+ check: "custom",
11828
11314
  ...normalizeParams(params)
11829
11315
  });
11316
+ ch._zod.check = fn;
11317
+ return ch;
11830
11318
  }
11831
11319
  // @__NO_SIDE_EFFECTS__
11832
- function _file(Class2, params) {
11833
- return new Class2({
11834
- type: "file",
11835
- ...normalizeParams(params)
11320
+ function describe(description) {
11321
+ const ch = new $ZodCheck({ check: "describe" });
11322
+ ch._zod.onattach = [
11323
+ (inst) => {
11324
+ const existing = globalRegistry.get(inst) ?? {};
11325
+ globalRegistry.add(inst, { ...existing, description });
11326
+ }
11327
+ ];
11328
+ ch._zod.check = () => {
11329
+ };
11330
+ return ch;
11331
+ }
11332
+ // @__NO_SIDE_EFFECTS__
11333
+ function meta(metadata) {
11334
+ const ch = new $ZodCheck({ check: "meta" });
11335
+ ch._zod.onattach = [
11336
+ (inst) => {
11337
+ const existing = globalRegistry.get(inst) ?? {};
11338
+ globalRegistry.add(inst, { ...existing, ...metadata });
11339
+ }
11340
+ ];
11341
+ ch._zod.check = () => {
11342
+ };
11343
+ return ch;
11344
+ }
11345
+ // @__NO_SIDE_EFFECTS__
11346
+ function _stringbool(Classes, _params) {
11347
+ const params = normalizeParams(_params);
11348
+ let truthyArray = params.truthy ?? ["true", "1", "yes", "on", "y", "enabled"];
11349
+ let falsyArray = params.falsy ?? ["false", "0", "no", "off", "n", "disabled"];
11350
+ if (params.case !== "sensitive") {
11351
+ truthyArray = truthyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
11352
+ falsyArray = falsyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
11353
+ }
11354
+ const truthySet = new Set(truthyArray);
11355
+ const falsySet = new Set(falsyArray);
11356
+ const _Codec = Classes.Codec ?? $ZodCodec;
11357
+ const _Boolean = Classes.Boolean ?? $ZodBoolean;
11358
+ const _String = Classes.String ?? $ZodString;
11359
+ const stringSchema = new _String({ type: "string", error: params.error });
11360
+ const booleanSchema = new _Boolean({ type: "boolean", error: params.error });
11361
+ const codec2 = new _Codec({
11362
+ type: "pipe",
11363
+ in: stringSchema,
11364
+ out: booleanSchema,
11365
+ transform: ((input, payload) => {
11366
+ let data = input;
11367
+ if (params.case !== "sensitive")
11368
+ data = data.toLowerCase();
11369
+ if (truthySet.has(data)) {
11370
+ return true;
11371
+ } else if (falsySet.has(data)) {
11372
+ return false;
11373
+ } else {
11374
+ payload.issues.push({
11375
+ code: "invalid_value",
11376
+ expected: "stringbool",
11377
+ values: [...truthySet, ...falsySet],
11378
+ input: payload.value,
11379
+ inst: codec2,
11380
+ continue: false
11381
+ });
11382
+ return {};
11383
+ }
11384
+ }),
11385
+ reverseTransform: ((input, _payload) => {
11386
+ if (input === true) {
11387
+ return truthyArray[0] || "true";
11388
+ } else {
11389
+ return falsyArray[0] || "false";
11390
+ }
11391
+ }),
11392
+ error: params.error
11836
11393
  });
11394
+ return codec2;
11395
+ }
11396
+ // @__NO_SIDE_EFFECTS__
11397
+ function _stringFormat(Class2, format, fnOrRegex, _params = {}) {
11398
+ const params = normalizeParams(_params);
11399
+ const def = {
11400
+ ...normalizeParams(_params),
11401
+ check: "string_format",
11402
+ type: "string",
11403
+ format,
11404
+ fn: typeof fnOrRegex === "function" ? fnOrRegex : (val) => fnOrRegex.test(val),
11405
+ ...params
11406
+ };
11407
+ if (fnOrRegex instanceof RegExp) {
11408
+ def.pattern = fnOrRegex;
11409
+ }
11410
+ const inst = new Class2(def);
11411
+ return inst;
11412
+ }
11413
+
11414
+ // node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js
11415
+ function initializeContext(params) {
11416
+ let target = params?.target ?? "draft-2020-12";
11417
+ if (target === "draft-4")
11418
+ target = "draft-04";
11419
+ if (target === "draft-7")
11420
+ target = "draft-07";
11421
+ return {
11422
+ processors: params.processors ?? {},
11423
+ metadataRegistry: params?.metadata ?? globalRegistry,
11424
+ target,
11425
+ unrepresentable: params?.unrepresentable ?? "throw",
11426
+ override: params?.override ?? (() => {
11427
+ }),
11428
+ io: params?.io ?? "output",
11429
+ counter: 0,
11430
+ seen: /* @__PURE__ */ new Map(),
11431
+ cycles: params?.cycles ?? "ref",
11432
+ reused: params?.reused ?? "inline",
11433
+ external: params?.external ?? void 0
11434
+ };
11435
+ }
11436
+ function process(schema, ctx, _params = { path: [], schemaPath: [] }) {
11437
+ var _a3;
11438
+ const def = schema._zod.def;
11439
+ const seen = ctx.seen.get(schema);
11440
+ if (seen) {
11441
+ seen.count++;
11442
+ const isCycle = _params.schemaPath.includes(schema);
11443
+ if (isCycle) {
11444
+ seen.cycle = _params.path;
11445
+ }
11446
+ return seen.schema;
11447
+ }
11448
+ const result = { schema: {}, count: 1, cycle: void 0, path: _params.path };
11449
+ ctx.seen.set(schema, result);
11450
+ const overrideSchema = schema._zod.toJSONSchema?.();
11451
+ if (overrideSchema) {
11452
+ result.schema = overrideSchema;
11453
+ } else {
11454
+ const params = {
11455
+ ..._params,
11456
+ schemaPath: [..._params.schemaPath, schema],
11457
+ path: _params.path
11458
+ };
11459
+ if (schema._zod.processJSONSchema) {
11460
+ schema._zod.processJSONSchema(ctx, result.schema, params);
11461
+ } else {
11462
+ const _json = result.schema;
11463
+ const processor = ctx.processors[def.type];
11464
+ if (!processor) {
11465
+ throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);
11466
+ }
11467
+ processor(schema, ctx, _json, params);
11468
+ }
11469
+ const parent = schema._zod.parent;
11470
+ if (parent) {
11471
+ if (!result.ref)
11472
+ result.ref = parent;
11473
+ process(parent, ctx, params);
11474
+ ctx.seen.get(parent).isParent = true;
11475
+ }
11476
+ }
11477
+ const meta3 = ctx.metadataRegistry.get(schema);
11478
+ if (meta3)
11479
+ Object.assign(result.schema, meta3);
11480
+ if (ctx.io === "input" && isTransforming(schema)) {
11481
+ delete result.schema.examples;
11482
+ delete result.schema.default;
11483
+ }
11484
+ if (ctx.io === "input" && "_prefault" in result.schema)
11485
+ (_a3 = result.schema).default ?? (_a3.default = result.schema._prefault);
11486
+ delete result.schema._prefault;
11487
+ const _result = ctx.seen.get(schema);
11488
+ return _result.schema;
11489
+ }
11490
+ function extractDefs(ctx, schema) {
11491
+ const root = ctx.seen.get(schema);
11492
+ if (!root)
11493
+ throw new Error("Unprocessed schema. This is a bug in Zod.");
11494
+ const idToSchema = /* @__PURE__ */ new Map();
11495
+ for (const entry of ctx.seen.entries()) {
11496
+ const id = ctx.metadataRegistry.get(entry[0])?.id;
11497
+ if (id) {
11498
+ const existing = idToSchema.get(id);
11499
+ if (existing && existing !== entry[0]) {
11500
+ throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
11501
+ }
11502
+ idToSchema.set(id, entry[0]);
11503
+ }
11504
+ }
11505
+ const makeURI = (entry) => {
11506
+ const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
11507
+ if (ctx.external) {
11508
+ const externalId = ctx.external.registry.get(entry[0])?.id;
11509
+ const uriGenerator = ctx.external.uri ?? ((id2) => id2);
11510
+ if (externalId) {
11511
+ return { ref: uriGenerator(externalId) };
11512
+ }
11513
+ const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
11514
+ entry[1].defId = id;
11515
+ return { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}` };
11516
+ }
11517
+ if (entry[1] === root) {
11518
+ return { ref: "#" };
11519
+ }
11520
+ const uriPrefix = `#`;
11521
+ const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
11522
+ const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
11523
+ return { defId, ref: defUriPrefix + defId };
11524
+ };
11525
+ const extractToDef = (entry) => {
11526
+ if (entry[1].schema.$ref) {
11527
+ return;
11528
+ }
11529
+ const seen = entry[1];
11530
+ const { ref, defId } = makeURI(entry);
11531
+ seen.def = { ...seen.schema };
11532
+ if (defId)
11533
+ seen.defId = defId;
11534
+ const schema2 = seen.schema;
11535
+ for (const key in schema2) {
11536
+ delete schema2[key];
11537
+ }
11538
+ schema2.$ref = ref;
11539
+ };
11540
+ if (ctx.cycles === "throw") {
11541
+ for (const entry of ctx.seen.entries()) {
11542
+ const seen = entry[1];
11543
+ if (seen.cycle) {
11544
+ throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/<root>
11545
+
11546
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
11547
+ }
11548
+ }
11549
+ }
11550
+ for (const entry of ctx.seen.entries()) {
11551
+ const seen = entry[1];
11552
+ if (schema === entry[0]) {
11553
+ extractToDef(entry);
11554
+ continue;
11555
+ }
11556
+ if (ctx.external) {
11557
+ const ext = ctx.external.registry.get(entry[0])?.id;
11558
+ if (schema !== entry[0] && ext) {
11559
+ extractToDef(entry);
11560
+ continue;
11561
+ }
11562
+ }
11563
+ const id = ctx.metadataRegistry.get(entry[0])?.id;
11564
+ if (id) {
11565
+ extractToDef(entry);
11566
+ continue;
11567
+ }
11568
+ if (seen.cycle) {
11569
+ extractToDef(entry);
11570
+ continue;
11571
+ }
11572
+ if (seen.count > 1) {
11573
+ if (ctx.reused === "ref") {
11574
+ extractToDef(entry);
11575
+ continue;
11576
+ }
11577
+ }
11578
+ }
11837
11579
  }
11838
- // @__NO_SIDE_EFFECTS__
11839
- function _transform(Class2, fn) {
11840
- return new Class2({
11841
- type: "transform",
11842
- transform: fn
11843
- });
11580
+ function finalize(ctx, schema) {
11581
+ const root = ctx.seen.get(schema);
11582
+ if (!root)
11583
+ throw new Error("Unprocessed schema. This is a bug in Zod.");
11584
+ const flattenRef = (zodSchema) => {
11585
+ const seen = ctx.seen.get(zodSchema);
11586
+ if (seen.ref === null)
11587
+ return;
11588
+ const schema2 = seen.def ?? seen.schema;
11589
+ const _cached = { ...schema2 };
11590
+ const ref = seen.ref;
11591
+ seen.ref = null;
11592
+ if (ref) {
11593
+ flattenRef(ref);
11594
+ const refSeen = ctx.seen.get(ref);
11595
+ const refSchema = refSeen.schema;
11596
+ if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
11597
+ schema2.allOf = schema2.allOf ?? [];
11598
+ schema2.allOf.push(refSchema);
11599
+ } else {
11600
+ Object.assign(schema2, refSchema);
11601
+ }
11602
+ Object.assign(schema2, _cached);
11603
+ const isParentRef = zodSchema._zod.parent === ref;
11604
+ if (isParentRef) {
11605
+ for (const key in schema2) {
11606
+ if (key === "$ref" || key === "allOf")
11607
+ continue;
11608
+ if (!(key in _cached)) {
11609
+ delete schema2[key];
11610
+ }
11611
+ }
11612
+ }
11613
+ if (refSchema.$ref && refSeen.def) {
11614
+ for (const key in schema2) {
11615
+ if (key === "$ref" || key === "allOf")
11616
+ continue;
11617
+ if (key in refSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(refSeen.def[key])) {
11618
+ delete schema2[key];
11619
+ }
11620
+ }
11621
+ }
11622
+ }
11623
+ const parent = zodSchema._zod.parent;
11624
+ if (parent && parent !== ref) {
11625
+ flattenRef(parent);
11626
+ const parentSeen = ctx.seen.get(parent);
11627
+ if (parentSeen?.schema.$ref) {
11628
+ schema2.$ref = parentSeen.schema.$ref;
11629
+ if (parentSeen.def) {
11630
+ for (const key in schema2) {
11631
+ if (key === "$ref" || key === "allOf")
11632
+ continue;
11633
+ if (key in parentSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(parentSeen.def[key])) {
11634
+ delete schema2[key];
11635
+ }
11636
+ }
11637
+ }
11638
+ }
11639
+ }
11640
+ ctx.override({
11641
+ zodSchema,
11642
+ jsonSchema: schema2,
11643
+ path: seen.path ?? []
11644
+ });
11645
+ };
11646
+ for (const entry of [...ctx.seen.entries()].reverse()) {
11647
+ flattenRef(entry[0]);
11648
+ }
11649
+ const result = {};
11650
+ if (ctx.target === "draft-2020-12") {
11651
+ result.$schema = "https://json-schema.org/draft/2020-12/schema";
11652
+ } else if (ctx.target === "draft-07") {
11653
+ result.$schema = "http://json-schema.org/draft-07/schema#";
11654
+ } else if (ctx.target === "draft-04") {
11655
+ result.$schema = "http://json-schema.org/draft-04/schema#";
11656
+ } else if (ctx.target === "openapi-3.0") {
11657
+ } else {
11658
+ }
11659
+ if (ctx.external?.uri) {
11660
+ const id = ctx.external.registry.get(schema)?.id;
11661
+ if (!id)
11662
+ throw new Error("Schema is missing an `id` property");
11663
+ result.$id = ctx.external.uri(id);
11664
+ }
11665
+ Object.assign(result, root.def ?? root.schema);
11666
+ const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
11667
+ if (rootMetaId !== void 0 && result.id === rootMetaId)
11668
+ delete result.id;
11669
+ const defs = ctx.external?.defs ?? {};
11670
+ for (const entry of ctx.seen.entries()) {
11671
+ const seen = entry[1];
11672
+ if (seen.def && seen.defId) {
11673
+ if (seen.def.id === seen.defId)
11674
+ delete seen.def.id;
11675
+ defs[seen.defId] = seen.def;
11676
+ }
11677
+ }
11678
+ if (ctx.external) {
11679
+ } else {
11680
+ if (Object.keys(defs).length > 0) {
11681
+ if (ctx.target === "draft-2020-12") {
11682
+ result.$defs = defs;
11683
+ } else {
11684
+ result.definitions = defs;
11685
+ }
11686
+ }
11687
+ }
11688
+ try {
11689
+ const finalized = JSON.parse(JSON.stringify(result));
11690
+ Object.defineProperty(finalized, "~standard", {
11691
+ value: {
11692
+ ...schema["~standard"],
11693
+ jsonSchema: {
11694
+ input: createStandardJSONSchemaMethod(schema, "input", ctx.processors),
11695
+ output: createStandardJSONSchemaMethod(schema, "output", ctx.processors)
11696
+ }
11697
+ },
11698
+ enumerable: false,
11699
+ writable: false
11700
+ });
11701
+ return finalized;
11702
+ } catch (_err) {
11703
+ throw new Error("Error converting schema to JSON.");
11704
+ }
11844
11705
  }
11845
- // @__NO_SIDE_EFFECTS__
11846
- function _optional(Class2, innerType) {
11847
- return new Class2({
11848
- type: "optional",
11849
- innerType
11850
- });
11706
+ function isTransforming(_schema, _ctx) {
11707
+ const ctx = _ctx ?? { seen: /* @__PURE__ */ new Set() };
11708
+ if (ctx.seen.has(_schema))
11709
+ return false;
11710
+ ctx.seen.add(_schema);
11711
+ const def = _schema._zod.def;
11712
+ if (def.type === "transform")
11713
+ return true;
11714
+ if (def.type === "array")
11715
+ return isTransforming(def.element, ctx);
11716
+ if (def.type === "set")
11717
+ return isTransforming(def.valueType, ctx);
11718
+ if (def.type === "lazy")
11719
+ return isTransforming(def.getter(), ctx);
11720
+ if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") {
11721
+ return isTransforming(def.innerType, ctx);
11722
+ }
11723
+ if (def.type === "intersection") {
11724
+ return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
11725
+ }
11726
+ if (def.type === "record" || def.type === "map") {
11727
+ return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
11728
+ }
11729
+ if (def.type === "pipe") {
11730
+ if (_schema._zod.traits.has("$ZodCodec"))
11731
+ return true;
11732
+ return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
11733
+ }
11734
+ if (def.type === "object") {
11735
+ for (const key in def.shape) {
11736
+ if (isTransforming(def.shape[key], ctx))
11737
+ return true;
11738
+ }
11739
+ return false;
11740
+ }
11741
+ if (def.type === "union") {
11742
+ for (const option of def.options) {
11743
+ if (isTransforming(option, ctx))
11744
+ return true;
11745
+ }
11746
+ return false;
11747
+ }
11748
+ if (def.type === "tuple") {
11749
+ for (const item of def.items) {
11750
+ if (isTransforming(item, ctx))
11751
+ return true;
11752
+ }
11753
+ if (def.rest && isTransforming(def.rest, ctx))
11754
+ return true;
11755
+ return false;
11756
+ }
11757
+ return false;
11851
11758
  }
11852
- // @__NO_SIDE_EFFECTS__
11853
- function _nullable(Class2, innerType) {
11854
- return new Class2({
11855
- type: "nullable",
11856
- innerType
11759
+ var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
11760
+ const ctx = initializeContext({ ...params, processors });
11761
+ process(schema, ctx);
11762
+ extractDefs(ctx, schema);
11763
+ return finalize(ctx, schema);
11764
+ };
11765
+ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
11766
+ const { libraryOptions, target } = params ?? {};
11767
+ const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
11768
+ process(schema, ctx);
11769
+ extractDefs(ctx, schema);
11770
+ return finalize(ctx, schema);
11771
+ };
11772
+
11773
+ // node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.js
11774
+ var formatMap = {
11775
+ guid: "uuid",
11776
+ url: "uri",
11777
+ datetime: "date-time",
11778
+ json_string: "json-string",
11779
+ regex: ""
11780
+ // do not set
11781
+ };
11782
+ var stringProcessor = (schema, ctx, _json, _params) => {
11783
+ const json2 = _json;
11784
+ json2.type = "string";
11785
+ const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
11786
+ if (typeof minimum === "number")
11787
+ json2.minLength = minimum;
11788
+ if (typeof maximum === "number")
11789
+ json2.maxLength = maximum;
11790
+ if (format) {
11791
+ json2.format = formatMap[format] ?? format;
11792
+ if (json2.format === "")
11793
+ delete json2.format;
11794
+ if (format === "time") {
11795
+ delete json2.format;
11796
+ }
11797
+ }
11798
+ if (contentEncoding)
11799
+ json2.contentEncoding = contentEncoding;
11800
+ if (patterns && patterns.size > 0) {
11801
+ const regexes = [...patterns];
11802
+ if (regexes.length === 1)
11803
+ json2.pattern = regexes[0].source;
11804
+ else if (regexes.length > 1) {
11805
+ json2.allOf = [
11806
+ ...regexes.map((regex) => ({
11807
+ ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
11808
+ pattern: regex.source
11809
+ }))
11810
+ ];
11811
+ }
11812
+ }
11813
+ };
11814
+ var numberProcessor = (schema, ctx, _json, _params) => {
11815
+ const json2 = _json;
11816
+ const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
11817
+ if (typeof format === "string" && format.includes("int"))
11818
+ json2.type = "integer";
11819
+ else
11820
+ json2.type = "number";
11821
+ const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
11822
+ const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
11823
+ const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
11824
+ if (exMin) {
11825
+ if (legacy) {
11826
+ json2.minimum = exclusiveMinimum;
11827
+ json2.exclusiveMinimum = true;
11828
+ } else {
11829
+ json2.exclusiveMinimum = exclusiveMinimum;
11830
+ }
11831
+ } else if (typeof minimum === "number") {
11832
+ json2.minimum = minimum;
11833
+ }
11834
+ if (exMax) {
11835
+ if (legacy) {
11836
+ json2.maximum = exclusiveMaximum;
11837
+ json2.exclusiveMaximum = true;
11838
+ } else {
11839
+ json2.exclusiveMaximum = exclusiveMaximum;
11840
+ }
11841
+ } else if (typeof maximum === "number") {
11842
+ json2.maximum = maximum;
11843
+ }
11844
+ if (typeof multipleOf === "number")
11845
+ json2.multipleOf = multipleOf;
11846
+ };
11847
+ var booleanProcessor = (_schema, _ctx, json2, _params) => {
11848
+ json2.type = "boolean";
11849
+ };
11850
+ var bigintProcessor = (_schema, ctx, _json, _params) => {
11851
+ if (ctx.unrepresentable === "throw") {
11852
+ throw new Error("BigInt cannot be represented in JSON Schema");
11853
+ }
11854
+ };
11855
+ var symbolProcessor = (_schema, ctx, _json, _params) => {
11856
+ if (ctx.unrepresentable === "throw") {
11857
+ throw new Error("Symbols cannot be represented in JSON Schema");
11858
+ }
11859
+ };
11860
+ var nullProcessor = (_schema, ctx, json2, _params) => {
11861
+ if (ctx.target === "openapi-3.0") {
11862
+ json2.type = "string";
11863
+ json2.nullable = true;
11864
+ json2.enum = [null];
11865
+ } else {
11866
+ json2.type = "null";
11867
+ }
11868
+ };
11869
+ var undefinedProcessor = (_schema, ctx, _json, _params) => {
11870
+ if (ctx.unrepresentable === "throw") {
11871
+ throw new Error("Undefined cannot be represented in JSON Schema");
11872
+ }
11873
+ };
11874
+ var voidProcessor = (_schema, ctx, _json, _params) => {
11875
+ if (ctx.unrepresentable === "throw") {
11876
+ throw new Error("Void cannot be represented in JSON Schema");
11877
+ }
11878
+ };
11879
+ var neverProcessor = (_schema, _ctx, json2, _params) => {
11880
+ json2.not = {};
11881
+ };
11882
+ var anyProcessor = (_schema, _ctx, _json, _params) => {
11883
+ };
11884
+ var unknownProcessor = (_schema, _ctx, _json, _params) => {
11885
+ };
11886
+ var dateProcessor = (_schema, ctx, _json, _params) => {
11887
+ if (ctx.unrepresentable === "throw") {
11888
+ throw new Error("Date cannot be represented in JSON Schema");
11889
+ }
11890
+ };
11891
+ var enumProcessor = (schema, _ctx, json2, _params) => {
11892
+ const def = schema._zod.def;
11893
+ const values = getEnumValues(def.entries);
11894
+ if (values.every((v) => typeof v === "number"))
11895
+ json2.type = "number";
11896
+ if (values.every((v) => typeof v === "string"))
11897
+ json2.type = "string";
11898
+ json2.enum = values;
11899
+ };
11900
+ var literalProcessor = (schema, ctx, json2, _params) => {
11901
+ const def = schema._zod.def;
11902
+ const vals = [];
11903
+ for (const val of def.values) {
11904
+ if (val === void 0) {
11905
+ if (ctx.unrepresentable === "throw") {
11906
+ throw new Error("Literal `undefined` cannot be represented in JSON Schema");
11907
+ } else {
11908
+ }
11909
+ } else if (typeof val === "bigint") {
11910
+ if (ctx.unrepresentable === "throw") {
11911
+ throw new Error("BigInt literals cannot be represented in JSON Schema");
11912
+ } else {
11913
+ vals.push(Number(val));
11914
+ }
11915
+ } else {
11916
+ vals.push(val);
11917
+ }
11918
+ }
11919
+ if (vals.length === 0) {
11920
+ } else if (vals.length === 1) {
11921
+ const val = vals[0];
11922
+ json2.type = val === null ? "null" : typeof val;
11923
+ if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
11924
+ json2.enum = [val];
11925
+ } else {
11926
+ json2.const = val;
11927
+ }
11928
+ } else {
11929
+ if (vals.every((v) => typeof v === "number"))
11930
+ json2.type = "number";
11931
+ if (vals.every((v) => typeof v === "string"))
11932
+ json2.type = "string";
11933
+ if (vals.every((v) => typeof v === "boolean"))
11934
+ json2.type = "boolean";
11935
+ if (vals.every((v) => v === null))
11936
+ json2.type = "null";
11937
+ json2.enum = vals;
11938
+ }
11939
+ };
11940
+ var nanProcessor = (_schema, ctx, _json, _params) => {
11941
+ if (ctx.unrepresentable === "throw") {
11942
+ throw new Error("NaN cannot be represented in JSON Schema");
11943
+ }
11944
+ };
11945
+ var templateLiteralProcessor = (schema, _ctx, json2, _params) => {
11946
+ const _json = json2;
11947
+ const pattern = schema._zod.pattern;
11948
+ if (!pattern)
11949
+ throw new Error("Pattern not found in template literal");
11950
+ _json.type = "string";
11951
+ _json.pattern = pattern.source;
11952
+ };
11953
+ var fileProcessor = (schema, _ctx, json2, _params) => {
11954
+ const _json = json2;
11955
+ const file2 = {
11956
+ type: "string",
11957
+ format: "binary",
11958
+ contentEncoding: "binary"
11959
+ };
11960
+ const { minimum, maximum, mime } = schema._zod.bag;
11961
+ if (minimum !== void 0)
11962
+ file2.minLength = minimum;
11963
+ if (maximum !== void 0)
11964
+ file2.maxLength = maximum;
11965
+ if (mime) {
11966
+ if (mime.length === 1) {
11967
+ file2.contentMediaType = mime[0];
11968
+ Object.assign(_json, file2);
11969
+ } else {
11970
+ Object.assign(_json, file2);
11971
+ _json.anyOf = mime.map((m) => ({ contentMediaType: m }));
11972
+ }
11973
+ } else {
11974
+ Object.assign(_json, file2);
11975
+ }
11976
+ };
11977
+ var successProcessor = (_schema, _ctx, json2, _params) => {
11978
+ json2.type = "boolean";
11979
+ };
11980
+ var customProcessor = (_schema, ctx, _json, _params) => {
11981
+ if (ctx.unrepresentable === "throw") {
11982
+ throw new Error("Custom types cannot be represented in JSON Schema");
11983
+ }
11984
+ };
11985
+ var functionProcessor = (_schema, ctx, _json, _params) => {
11986
+ if (ctx.unrepresentable === "throw") {
11987
+ throw new Error("Function types cannot be represented in JSON Schema");
11988
+ }
11989
+ };
11990
+ var transformProcessor = (_schema, ctx, _json, _params) => {
11991
+ if (ctx.unrepresentable === "throw") {
11992
+ throw new Error("Transforms cannot be represented in JSON Schema");
11993
+ }
11994
+ };
11995
+ var mapProcessor = (_schema, ctx, _json, _params) => {
11996
+ if (ctx.unrepresentable === "throw") {
11997
+ throw new Error("Map cannot be represented in JSON Schema");
11998
+ }
11999
+ };
12000
+ var setProcessor = (_schema, ctx, _json, _params) => {
12001
+ if (ctx.unrepresentable === "throw") {
12002
+ throw new Error("Set cannot be represented in JSON Schema");
12003
+ }
12004
+ };
12005
+ var arrayProcessor = (schema, ctx, _json, params) => {
12006
+ const json2 = _json;
12007
+ const def = schema._zod.def;
12008
+ const { minimum, maximum } = schema._zod.bag;
12009
+ if (typeof minimum === "number")
12010
+ json2.minItems = minimum;
12011
+ if (typeof maximum === "number")
12012
+ json2.maxItems = maximum;
12013
+ json2.type = "array";
12014
+ json2.items = process(def.element, ctx, {
12015
+ ...params,
12016
+ path: [...params.path, "items"]
11857
12017
  });
11858
- }
11859
- // @__NO_SIDE_EFFECTS__
11860
- function _default(Class2, innerType, defaultValue) {
11861
- return new Class2({
11862
- type: "default",
11863
- innerType,
11864
- get defaultValue() {
11865
- return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
12018
+ };
12019
+ var objectProcessor = (schema, ctx, _json, params) => {
12020
+ const json2 = _json;
12021
+ const def = schema._zod.def;
12022
+ json2.type = "object";
12023
+ json2.properties = {};
12024
+ const shape = def.shape;
12025
+ for (const key in shape) {
12026
+ json2.properties[key] = process(shape[key], ctx, {
12027
+ ...params,
12028
+ path: [...params.path, "properties", key]
12029
+ });
12030
+ }
12031
+ const allKeys = new Set(Object.keys(shape));
12032
+ const requiredKeys = new Set([...allKeys].filter((key) => {
12033
+ const v = def.shape[key]._zod;
12034
+ if (ctx.io === "input") {
12035
+ return v.optin === void 0;
12036
+ } else {
12037
+ return v.optout === void 0;
11866
12038
  }
12039
+ }));
12040
+ if (requiredKeys.size > 0) {
12041
+ json2.required = Array.from(requiredKeys);
12042
+ }
12043
+ if (def.catchall?._zod.def.type === "never") {
12044
+ json2.additionalProperties = false;
12045
+ } else if (!def.catchall) {
12046
+ if (ctx.io === "output")
12047
+ json2.additionalProperties = false;
12048
+ } else if (def.catchall) {
12049
+ json2.additionalProperties = process(def.catchall, ctx, {
12050
+ ...params,
12051
+ path: [...params.path, "additionalProperties"]
12052
+ });
12053
+ }
12054
+ };
12055
+ var unionProcessor = (schema, ctx, json2, params) => {
12056
+ const def = schema._zod.def;
12057
+ const isExclusive = def.inclusive === false;
12058
+ const options = def.options.map((x, i) => process(x, ctx, {
12059
+ ...params,
12060
+ path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
12061
+ }));
12062
+ if (isExclusive) {
12063
+ json2.oneOf = options;
12064
+ } else {
12065
+ json2.anyOf = options;
12066
+ }
12067
+ };
12068
+ var intersectionProcessor = (schema, ctx, json2, params) => {
12069
+ const def = schema._zod.def;
12070
+ const a = process(def.left, ctx, {
12071
+ ...params,
12072
+ path: [...params.path, "allOf", 0]
11867
12073
  });
11868
- }
11869
- // @__NO_SIDE_EFFECTS__
11870
- function _nonoptional(Class2, innerType, params) {
11871
- return new Class2({
11872
- type: "nonoptional",
11873
- innerType,
11874
- ...normalizeParams(params)
11875
- });
11876
- }
11877
- // @__NO_SIDE_EFFECTS__
11878
- function _success(Class2, innerType) {
11879
- return new Class2({
11880
- type: "success",
11881
- innerType
11882
- });
11883
- }
11884
- // @__NO_SIDE_EFFECTS__
11885
- function _catch(Class2, innerType, catchValue) {
11886
- return new Class2({
11887
- type: "catch",
11888
- innerType,
11889
- catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
11890
- });
11891
- }
11892
- // @__NO_SIDE_EFFECTS__
11893
- function _pipe(Class2, in_, out) {
11894
- return new Class2({
11895
- type: "pipe",
11896
- in: in_,
11897
- out
11898
- });
11899
- }
11900
- // @__NO_SIDE_EFFECTS__
11901
- function _readonly(Class2, innerType) {
11902
- return new Class2({
11903
- type: "readonly",
11904
- innerType
11905
- });
11906
- }
11907
- // @__NO_SIDE_EFFECTS__
11908
- function _templateLiteral(Class2, parts, params) {
11909
- return new Class2({
11910
- type: "template_literal",
11911
- parts,
11912
- ...normalizeParams(params)
11913
- });
11914
- }
11915
- // @__NO_SIDE_EFFECTS__
11916
- function _lazy(Class2, getter) {
11917
- return new Class2({
11918
- type: "lazy",
11919
- getter
11920
- });
11921
- }
11922
- // @__NO_SIDE_EFFECTS__
11923
- function _promise(Class2, innerType) {
11924
- return new Class2({
11925
- type: "promise",
11926
- innerType
11927
- });
11928
- }
11929
- // @__NO_SIDE_EFFECTS__
11930
- function _custom(Class2, fn, _params) {
11931
- const norm = normalizeParams(_params);
11932
- norm.abort ?? (norm.abort = true);
11933
- const schema = new Class2({
11934
- type: "custom",
11935
- check: "custom",
11936
- fn,
11937
- ...norm
11938
- });
11939
- return schema;
11940
- }
11941
- // @__NO_SIDE_EFFECTS__
11942
- function _refine(Class2, fn, _params) {
11943
- const schema = new Class2({
11944
- type: "custom",
11945
- check: "custom",
11946
- fn,
11947
- ...normalizeParams(_params)
12074
+ const b = process(def.right, ctx, {
12075
+ ...params,
12076
+ path: [...params.path, "allOf", 1]
11948
12077
  });
11949
- return schema;
11950
- }
11951
- // @__NO_SIDE_EFFECTS__
11952
- function _superRefine(fn, params) {
11953
- const ch = /* @__PURE__ */ _check((payload) => {
11954
- payload.addIssue = (issue2) => {
11955
- if (typeof issue2 === "string") {
11956
- payload.issues.push(issue(issue2, payload.value, ch._zod.def));
11957
- } else {
11958
- const _issue = issue2;
11959
- if (_issue.fatal)
11960
- _issue.continue = false;
11961
- _issue.code ?? (_issue.code = "custom");
11962
- _issue.input ?? (_issue.input = payload.value);
11963
- _issue.inst ?? (_issue.inst = ch);
11964
- _issue.continue ?? (_issue.continue = !ch._zod.def.abort);
11965
- payload.issues.push(issue(_issue));
11966
- }
12078
+ const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
12079
+ const allOf = [
12080
+ ...isSimpleIntersection(a) ? a.allOf : [a],
12081
+ ...isSimpleIntersection(b) ? b.allOf : [b]
12082
+ ];
12083
+ json2.allOf = allOf;
12084
+ };
12085
+ var tupleProcessor = (schema, ctx, _json, params) => {
12086
+ const json2 = _json;
12087
+ const def = schema._zod.def;
12088
+ json2.type = "array";
12089
+ const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
12090
+ const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
12091
+ const prefixItems = def.items.map((x, i) => process(x, ctx, {
12092
+ ...params,
12093
+ path: [...params.path, prefixPath, i]
12094
+ }));
12095
+ const rest = def.rest ? process(def.rest, ctx, {
12096
+ ...params,
12097
+ path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
12098
+ }) : null;
12099
+ if (ctx.target === "draft-2020-12") {
12100
+ json2.prefixItems = prefixItems;
12101
+ if (rest) {
12102
+ json2.items = rest;
12103
+ }
12104
+ } else if (ctx.target === "openapi-3.0") {
12105
+ json2.items = {
12106
+ anyOf: prefixItems
11967
12107
  };
11968
- return fn(payload.value, payload);
11969
- }, params);
11970
- return ch;
11971
- }
11972
- // @__NO_SIDE_EFFECTS__
11973
- function _check(fn, params) {
11974
- const ch = new $ZodCheck({
11975
- check: "custom",
11976
- ...normalizeParams(params)
11977
- });
11978
- ch._zod.check = fn;
11979
- return ch;
11980
- }
11981
- // @__NO_SIDE_EFFECTS__
11982
- function describe(description) {
11983
- const ch = new $ZodCheck({ check: "describe" });
11984
- ch._zod.onattach = [
11985
- (inst) => {
11986
- const existing = globalRegistry.get(inst) ?? {};
11987
- globalRegistry.add(inst, { ...existing, description });
12108
+ if (rest) {
12109
+ json2.items.anyOf.push(rest);
12110
+ }
12111
+ json2.minItems = prefixItems.length;
12112
+ if (!rest) {
12113
+ json2.maxItems = prefixItems.length;
12114
+ }
12115
+ } else {
12116
+ json2.items = prefixItems;
12117
+ if (rest) {
12118
+ json2.additionalItems = rest;
12119
+ }
12120
+ }
12121
+ const { minimum, maximum } = schema._zod.bag;
12122
+ if (typeof minimum === "number")
12123
+ json2.minItems = minimum;
12124
+ if (typeof maximum === "number")
12125
+ json2.maxItems = maximum;
12126
+ };
12127
+ var recordProcessor = (schema, ctx, _json, params) => {
12128
+ const json2 = _json;
12129
+ const def = schema._zod.def;
12130
+ json2.type = "object";
12131
+ const keyType = def.keyType;
12132
+ const keyBag = keyType._zod.bag;
12133
+ const patterns = keyBag?.patterns;
12134
+ if (def.mode === "loose" && patterns && patterns.size > 0) {
12135
+ const valueSchema = process(def.valueType, ctx, {
12136
+ ...params,
12137
+ path: [...params.path, "patternProperties", "*"]
12138
+ });
12139
+ json2.patternProperties = {};
12140
+ for (const pattern of patterns) {
12141
+ json2.patternProperties[pattern.source] = valueSchema;
11988
12142
  }
11989
- ];
11990
- ch._zod.check = () => {
11991
- };
11992
- return ch;
11993
- }
11994
- // @__NO_SIDE_EFFECTS__
11995
- function meta(metadata) {
11996
- const ch = new $ZodCheck({ check: "meta" });
11997
- ch._zod.onattach = [
11998
- (inst) => {
11999
- const existing = globalRegistry.get(inst) ?? {};
12000
- globalRegistry.add(inst, { ...existing, ...metadata });
12143
+ } else {
12144
+ if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
12145
+ json2.propertyNames = process(def.keyType, ctx, {
12146
+ ...params,
12147
+ path: [...params.path, "propertyNames"]
12148
+ });
12001
12149
  }
12002
- ];
12003
- ch._zod.check = () => {
12004
- };
12005
- return ch;
12006
- }
12007
- // @__NO_SIDE_EFFECTS__
12008
- function _stringbool(Classes, _params) {
12009
- const params = normalizeParams(_params);
12010
- let truthyArray = params.truthy ?? ["true", "1", "yes", "on", "y", "enabled"];
12011
- let falsyArray = params.falsy ?? ["false", "0", "no", "off", "n", "disabled"];
12012
- if (params.case !== "sensitive") {
12013
- truthyArray = truthyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
12014
- falsyArray = falsyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
12150
+ json2.additionalProperties = process(def.valueType, ctx, {
12151
+ ...params,
12152
+ path: [...params.path, "additionalProperties"]
12153
+ });
12015
12154
  }
12016
- const truthySet = new Set(truthyArray);
12017
- const falsySet = new Set(falsyArray);
12018
- const _Codec = Classes.Codec ?? $ZodCodec;
12019
- const _Boolean = Classes.Boolean ?? $ZodBoolean;
12020
- const _String = Classes.String ?? $ZodString;
12021
- const stringSchema = new _String({ type: "string", error: params.error });
12022
- const booleanSchema = new _Boolean({ type: "boolean", error: params.error });
12023
- const codec2 = new _Codec({
12024
- type: "pipe",
12025
- in: stringSchema,
12026
- out: booleanSchema,
12027
- transform: ((input, payload) => {
12028
- let data = input;
12029
- if (params.case !== "sensitive")
12030
- data = data.toLowerCase();
12031
- if (truthySet.has(data)) {
12032
- return true;
12033
- } else if (falsySet.has(data)) {
12034
- return false;
12035
- } else {
12036
- payload.issues.push({
12037
- code: "invalid_value",
12038
- expected: "stringbool",
12039
- values: [...truthySet, ...falsySet],
12040
- input: payload.value,
12041
- inst: codec2,
12042
- continue: false
12043
- });
12044
- return {};
12045
- }
12046
- }),
12047
- reverseTransform: ((input, _payload) => {
12048
- if (input === true) {
12049
- return truthyArray[0] || "true";
12050
- } else {
12051
- return falsyArray[0] || "false";
12052
- }
12053
- }),
12054
- error: params.error
12055
- });
12056
- return codec2;
12057
- }
12058
- // @__NO_SIDE_EFFECTS__
12059
- function _stringFormat(Class2, format, fnOrRegex, _params = {}) {
12060
- const params = normalizeParams(_params);
12061
- const def = {
12062
- ...normalizeParams(_params),
12063
- check: "string_format",
12064
- type: "string",
12065
- format,
12066
- fn: typeof fnOrRegex === "function" ? fnOrRegex : (val) => fnOrRegex.test(val),
12067
- ...params
12068
- };
12069
- if (fnOrRegex instanceof RegExp) {
12070
- def.pattern = fnOrRegex;
12155
+ const keyValues = keyType._zod.values;
12156
+ if (keyValues) {
12157
+ const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
12158
+ if (validKeyValues.length > 0) {
12159
+ json2.required = validKeyValues;
12160
+ }
12071
12161
  }
12072
- const inst = new Class2(def);
12073
- return inst;
12162
+ };
12163
+ var nullableProcessor = (schema, ctx, json2, params) => {
12164
+ const def = schema._zod.def;
12165
+ const inner = process(def.innerType, ctx, params);
12166
+ const seen = ctx.seen.get(schema);
12167
+ if (ctx.target === "openapi-3.0") {
12168
+ seen.ref = def.innerType;
12169
+ json2.nullable = true;
12170
+ } else {
12171
+ json2.anyOf = [inner, { type: "null" }];
12172
+ }
12173
+ };
12174
+ var nonoptionalProcessor = (schema, ctx, _json, params) => {
12175
+ const def = schema._zod.def;
12176
+ process(def.innerType, ctx, params);
12177
+ const seen = ctx.seen.get(schema);
12178
+ seen.ref = def.innerType;
12179
+ };
12180
+ var defaultProcessor = (schema, ctx, json2, params) => {
12181
+ const def = schema._zod.def;
12182
+ process(def.innerType, ctx, params);
12183
+ const seen = ctx.seen.get(schema);
12184
+ seen.ref = def.innerType;
12185
+ json2.default = JSON.parse(JSON.stringify(def.defaultValue));
12186
+ };
12187
+ var prefaultProcessor = (schema, ctx, json2, params) => {
12188
+ const def = schema._zod.def;
12189
+ process(def.innerType, ctx, params);
12190
+ const seen = ctx.seen.get(schema);
12191
+ seen.ref = def.innerType;
12192
+ if (ctx.io === "input")
12193
+ json2._prefault = JSON.parse(JSON.stringify(def.defaultValue));
12194
+ };
12195
+ var catchProcessor = (schema, ctx, json2, params) => {
12196
+ const def = schema._zod.def;
12197
+ process(def.innerType, ctx, params);
12198
+ const seen = ctx.seen.get(schema);
12199
+ seen.ref = def.innerType;
12200
+ let catchValue;
12201
+ try {
12202
+ catchValue = def.catchValue(void 0);
12203
+ } catch {
12204
+ throw new Error("Dynamic catch values are not supported in JSON Schema");
12205
+ }
12206
+ json2.default = catchValue;
12207
+ };
12208
+ var pipeProcessor = (schema, ctx, _json, params) => {
12209
+ const def = schema._zod.def;
12210
+ const inIsTransform = def.in._zod.traits.has("$ZodTransform");
12211
+ const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
12212
+ process(innerType, ctx, params);
12213
+ const seen = ctx.seen.get(schema);
12214
+ seen.ref = innerType;
12215
+ };
12216
+ var readonlyProcessor = (schema, ctx, json2, params) => {
12217
+ const def = schema._zod.def;
12218
+ process(def.innerType, ctx, params);
12219
+ const seen = ctx.seen.get(schema);
12220
+ seen.ref = def.innerType;
12221
+ json2.readOnly = true;
12222
+ };
12223
+ var promiseProcessor = (schema, ctx, _json, params) => {
12224
+ const def = schema._zod.def;
12225
+ process(def.innerType, ctx, params);
12226
+ const seen = ctx.seen.get(schema);
12227
+ seen.ref = def.innerType;
12228
+ };
12229
+ var optionalProcessor = (schema, ctx, _json, params) => {
12230
+ const def = schema._zod.def;
12231
+ process(def.innerType, ctx, params);
12232
+ const seen = ctx.seen.get(schema);
12233
+ seen.ref = def.innerType;
12234
+ };
12235
+ var lazyProcessor = (schema, ctx, _json, params) => {
12236
+ const innerType = schema._zod.innerType;
12237
+ process(innerType, ctx, params);
12238
+ const seen = ctx.seen.get(schema);
12239
+ seen.ref = innerType;
12240
+ };
12241
+ var allProcessors = {
12242
+ string: stringProcessor,
12243
+ number: numberProcessor,
12244
+ boolean: booleanProcessor,
12245
+ bigint: bigintProcessor,
12246
+ symbol: symbolProcessor,
12247
+ null: nullProcessor,
12248
+ undefined: undefinedProcessor,
12249
+ void: voidProcessor,
12250
+ never: neverProcessor,
12251
+ any: anyProcessor,
12252
+ unknown: unknownProcessor,
12253
+ date: dateProcessor,
12254
+ enum: enumProcessor,
12255
+ literal: literalProcessor,
12256
+ nan: nanProcessor,
12257
+ template_literal: templateLiteralProcessor,
12258
+ file: fileProcessor,
12259
+ success: successProcessor,
12260
+ custom: customProcessor,
12261
+ function: functionProcessor,
12262
+ transform: transformProcessor,
12263
+ map: mapProcessor,
12264
+ set: setProcessor,
12265
+ array: arrayProcessor,
12266
+ object: objectProcessor,
12267
+ union: unionProcessor,
12268
+ intersection: intersectionProcessor,
12269
+ tuple: tupleProcessor,
12270
+ record: recordProcessor,
12271
+ nullable: nullableProcessor,
12272
+ nonoptional: nonoptionalProcessor,
12273
+ default: defaultProcessor,
12274
+ prefault: prefaultProcessor,
12275
+ catch: catchProcessor,
12276
+ pipe: pipeProcessor,
12277
+ readonly: readonlyProcessor,
12278
+ promise: promiseProcessor,
12279
+ optional: optionalProcessor,
12280
+ lazy: lazyProcessor
12281
+ };
12282
+ function toJSONSchema(input, params) {
12283
+ if ("_idmap" in input) {
12284
+ const registry3 = input;
12285
+ const ctx2 = initializeContext({ ...params, processors: allProcessors });
12286
+ const defs = {};
12287
+ for (const entry of registry3._idmap.entries()) {
12288
+ const [_, schema] = entry;
12289
+ process(schema, ctx2);
12290
+ }
12291
+ const schemas = {};
12292
+ const external = {
12293
+ registry: registry3,
12294
+ uri: params?.uri,
12295
+ defs
12296
+ };
12297
+ ctx2.external = external;
12298
+ for (const entry of registry3._idmap.entries()) {
12299
+ const [key, schema] = entry;
12300
+ extractDefs(ctx2, schema);
12301
+ schemas[key] = finalize(ctx2, schema);
12302
+ }
12303
+ if (Object.keys(defs).length > 0) {
12304
+ const defsSegment = ctx2.target === "draft-2020-12" ? "$defs" : "definitions";
12305
+ schemas.__shared = {
12306
+ [defsSegment]: defs
12307
+ };
12308
+ }
12309
+ return { schemas };
12310
+ }
12311
+ const ctx = initializeContext({ ...params, processors: allProcessors });
12312
+ process(input, ctx);
12313
+ extractDefs(ctx, input);
12314
+ return finalize(ctx, input);
12074
12315
  }
12075
12316
 
12076
12317
  // node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-generator.js
@@ -13741,249 +13982,6 @@ function preprocess(fn, schema) {
13741
13982
  });
13742
13983
  }
13743
13984
 
13744
- // node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
13745
- var external_exports = {};
13746
- __export(external_exports, {
13747
- $brand: () => $brand,
13748
- $input: () => $input,
13749
- $output: () => $output,
13750
- NEVER: () => NEVER,
13751
- TimePrecision: () => TimePrecision,
13752
- ZodAny: () => ZodAny,
13753
- ZodArray: () => ZodArray,
13754
- ZodBase64: () => ZodBase64,
13755
- ZodBase64URL: () => ZodBase64URL,
13756
- ZodBigInt: () => ZodBigInt,
13757
- ZodBigIntFormat: () => ZodBigIntFormat,
13758
- ZodBoolean: () => ZodBoolean,
13759
- ZodCIDRv4: () => ZodCIDRv4,
13760
- ZodCIDRv6: () => ZodCIDRv6,
13761
- ZodCUID: () => ZodCUID,
13762
- ZodCUID2: () => ZodCUID2,
13763
- ZodCatch: () => ZodCatch,
13764
- ZodCodec: () => ZodCodec,
13765
- ZodCustom: () => ZodCustom,
13766
- ZodCustomStringFormat: () => ZodCustomStringFormat,
13767
- ZodDate: () => ZodDate,
13768
- ZodDefault: () => ZodDefault,
13769
- ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
13770
- ZodE164: () => ZodE164,
13771
- ZodEmail: () => ZodEmail,
13772
- ZodEmoji: () => ZodEmoji,
13773
- ZodEnum: () => ZodEnum,
13774
- ZodError: () => ZodError,
13775
- ZodExactOptional: () => ZodExactOptional,
13776
- ZodFile: () => ZodFile,
13777
- ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
13778
- ZodFunction: () => ZodFunction,
13779
- ZodGUID: () => ZodGUID,
13780
- ZodIPv4: () => ZodIPv4,
13781
- ZodIPv6: () => ZodIPv6,
13782
- ZodISODate: () => ZodISODate,
13783
- ZodISODateTime: () => ZodISODateTime,
13784
- ZodISODuration: () => ZodISODuration,
13785
- ZodISOTime: () => ZodISOTime,
13786
- ZodIntersection: () => ZodIntersection,
13787
- ZodIssueCode: () => ZodIssueCode,
13788
- ZodJWT: () => ZodJWT,
13789
- ZodKSUID: () => ZodKSUID,
13790
- ZodLazy: () => ZodLazy,
13791
- ZodLiteral: () => ZodLiteral,
13792
- ZodMAC: () => ZodMAC,
13793
- ZodMap: () => ZodMap,
13794
- ZodNaN: () => ZodNaN,
13795
- ZodNanoID: () => ZodNanoID,
13796
- ZodNever: () => ZodNever,
13797
- ZodNonOptional: () => ZodNonOptional,
13798
- ZodNull: () => ZodNull,
13799
- ZodNullable: () => ZodNullable,
13800
- ZodNumber: () => ZodNumber,
13801
- ZodNumberFormat: () => ZodNumberFormat,
13802
- ZodObject: () => ZodObject,
13803
- ZodOptional: () => ZodOptional,
13804
- ZodPipe: () => ZodPipe,
13805
- ZodPrefault: () => ZodPrefault,
13806
- ZodPreprocess: () => ZodPreprocess,
13807
- ZodPromise: () => ZodPromise,
13808
- ZodReadonly: () => ZodReadonly,
13809
- ZodRealError: () => ZodRealError,
13810
- ZodRecord: () => ZodRecord,
13811
- ZodSet: () => ZodSet,
13812
- ZodString: () => ZodString,
13813
- ZodStringFormat: () => ZodStringFormat,
13814
- ZodSuccess: () => ZodSuccess,
13815
- ZodSymbol: () => ZodSymbol,
13816
- ZodTemplateLiteral: () => ZodTemplateLiteral,
13817
- ZodTransform: () => ZodTransform,
13818
- ZodTuple: () => ZodTuple,
13819
- ZodType: () => ZodType,
13820
- ZodULID: () => ZodULID,
13821
- ZodURL: () => ZodURL,
13822
- ZodUUID: () => ZodUUID,
13823
- ZodUndefined: () => ZodUndefined,
13824
- ZodUnion: () => ZodUnion,
13825
- ZodUnknown: () => ZodUnknown,
13826
- ZodVoid: () => ZodVoid,
13827
- ZodXID: () => ZodXID,
13828
- ZodXor: () => ZodXor,
13829
- _ZodString: () => _ZodString,
13830
- _default: () => _default2,
13831
- _function: () => _function,
13832
- any: () => any,
13833
- array: () => array,
13834
- base64: () => base642,
13835
- base64url: () => base64url2,
13836
- bigint: () => bigint2,
13837
- boolean: () => boolean2,
13838
- catch: () => _catch2,
13839
- check: () => check,
13840
- cidrv4: () => cidrv42,
13841
- cidrv6: () => cidrv62,
13842
- clone: () => clone,
13843
- codec: () => codec,
13844
- coerce: () => coerce_exports,
13845
- config: () => config,
13846
- core: () => core_exports2,
13847
- cuid: () => cuid3,
13848
- cuid2: () => cuid22,
13849
- custom: () => custom,
13850
- date: () => date3,
13851
- decode: () => decode2,
13852
- decodeAsync: () => decodeAsync2,
13853
- describe: () => describe2,
13854
- discriminatedUnion: () => discriminatedUnion,
13855
- e164: () => e1642,
13856
- email: () => email2,
13857
- emoji: () => emoji2,
13858
- encode: () => encode2,
13859
- encodeAsync: () => encodeAsync2,
13860
- endsWith: () => _endsWith,
13861
- enum: () => _enum2,
13862
- exactOptional: () => exactOptional,
13863
- file: () => file,
13864
- flattenError: () => flattenError,
13865
- float32: () => float32,
13866
- float64: () => float64,
13867
- formatError: () => formatError,
13868
- fromJSONSchema: () => fromJSONSchema,
13869
- function: () => _function,
13870
- getErrorMap: () => getErrorMap,
13871
- globalRegistry: () => globalRegistry,
13872
- gt: () => _gt,
13873
- gte: () => _gte,
13874
- guid: () => guid2,
13875
- hash: () => hash,
13876
- hex: () => hex2,
13877
- hostname: () => hostname2,
13878
- httpUrl: () => httpUrl,
13879
- includes: () => _includes,
13880
- instanceof: () => _instanceof,
13881
- int: () => int,
13882
- int32: () => int32,
13883
- int64: () => int64,
13884
- intersection: () => intersection,
13885
- invertCodec: () => invertCodec,
13886
- ipv4: () => ipv42,
13887
- ipv6: () => ipv62,
13888
- iso: () => iso_exports,
13889
- json: () => json,
13890
- jwt: () => jwt,
13891
- keyof: () => keyof,
13892
- ksuid: () => ksuid2,
13893
- lazy: () => lazy,
13894
- length: () => _length,
13895
- literal: () => literal,
13896
- locales: () => locales_exports,
13897
- looseObject: () => looseObject,
13898
- looseRecord: () => looseRecord,
13899
- lowercase: () => _lowercase,
13900
- lt: () => _lt,
13901
- lte: () => _lte,
13902
- mac: () => mac2,
13903
- map: () => map,
13904
- maxLength: () => _maxLength,
13905
- maxSize: () => _maxSize,
13906
- meta: () => meta2,
13907
- mime: () => _mime,
13908
- minLength: () => _minLength,
13909
- minSize: () => _minSize,
13910
- multipleOf: () => _multipleOf,
13911
- nan: () => nan,
13912
- nanoid: () => nanoid2,
13913
- nativeEnum: () => nativeEnum,
13914
- negative: () => _negative,
13915
- never: () => never,
13916
- nonnegative: () => _nonnegative,
13917
- nonoptional: () => nonoptional,
13918
- nonpositive: () => _nonpositive,
13919
- normalize: () => _normalize,
13920
- null: () => _null3,
13921
- nullable: () => nullable,
13922
- nullish: () => nullish2,
13923
- number: () => number2,
13924
- object: () => object,
13925
- optional: () => optional,
13926
- overwrite: () => _overwrite,
13927
- parse: () => parse2,
13928
- parseAsync: () => parseAsync2,
13929
- partialRecord: () => partialRecord,
13930
- pipe: () => pipe,
13931
- positive: () => _positive,
13932
- prefault: () => prefault,
13933
- preprocess: () => preprocess,
13934
- prettifyError: () => prettifyError,
13935
- promise: () => promise,
13936
- property: () => _property,
13937
- readonly: () => readonly,
13938
- record: () => record,
13939
- refine: () => refine,
13940
- regex: () => _regex,
13941
- regexes: () => regexes_exports,
13942
- registry: () => registry,
13943
- safeDecode: () => safeDecode2,
13944
- safeDecodeAsync: () => safeDecodeAsync2,
13945
- safeEncode: () => safeEncode2,
13946
- safeEncodeAsync: () => safeEncodeAsync2,
13947
- safeParse: () => safeParse2,
13948
- safeParseAsync: () => safeParseAsync2,
13949
- set: () => set,
13950
- setErrorMap: () => setErrorMap,
13951
- size: () => _size,
13952
- slugify: () => _slugify,
13953
- startsWith: () => _startsWith,
13954
- strictObject: () => strictObject,
13955
- string: () => string2,
13956
- stringFormat: () => stringFormat,
13957
- stringbool: () => stringbool,
13958
- success: () => success,
13959
- superRefine: () => superRefine,
13960
- symbol: () => symbol,
13961
- templateLiteral: () => templateLiteral,
13962
- toJSONSchema: () => toJSONSchema,
13963
- toLowerCase: () => _toLowerCase,
13964
- toUpperCase: () => _toUpperCase,
13965
- transform: () => transform,
13966
- treeifyError: () => treeifyError,
13967
- trim: () => _trim,
13968
- tuple: () => tuple,
13969
- uint32: () => uint32,
13970
- uint64: () => uint64,
13971
- ulid: () => ulid2,
13972
- undefined: () => _undefined3,
13973
- union: () => union,
13974
- unknown: () => unknown,
13975
- uppercase: () => _uppercase,
13976
- url: () => url,
13977
- util: () => util_exports,
13978
- uuid: () => uuid2,
13979
- uuidv4: () => uuidv4,
13980
- uuidv6: () => uuidv6,
13981
- uuidv7: () => uuidv7,
13982
- void: () => _void2,
13983
- xid: () => xid2,
13984
- xor: () => xor
13985
- });
13986
-
13987
13985
  // node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/compat.js
13988
13986
  var ZodIssueCode = {
13989
13987
  invalid_type: "invalid_type",
@@ -14518,7 +14516,7 @@ function date4(params) {
14518
14516
  // node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
14519
14517
  config(en_default());
14520
14518
 
14521
- // web/app/dist/server/assets/chat-Bt1SKsm5.js
14519
+ // web/app/dist/server/assets/chat-ScIVP5Xw.js
14522
14520
  var MAX_ATTACHMENT_BYTES = 26214400;
14523
14521
  var RightPanelIdSchema = external_exports.enum([
14524
14522
  "resources",
@@ -14567,7 +14565,8 @@ var ProjectListResponseSchema = external_exports.object({
14567
14565
  "failed"
14568
14566
  ]),
14569
14567
  messageCount: external_exports.number().int().nonnegative(),
14570
- firstMessage: external_exports.string()
14568
+ firstMessage: external_exports.string(),
14569
+ isSubagent: external_exports.boolean().optional()
14571
14570
  }))
14572
14571
  });
14573
14572
  var ProjectCreateRequestSchema = external_exports.object({
@@ -14636,7 +14635,8 @@ var ChatToolPartSchema$1 = external_exports.discriminatedUnion("kind", [
14636
14635
  external_exports.object({
14637
14636
  kind: external_exports.literal("ipython"),
14638
14637
  code: external_exports.string(),
14639
- output: external_exports.string().optional()
14638
+ output: external_exports.string().optional(),
14639
+ backgroundOutput: external_exports.string().optional()
14640
14640
  }),
14641
14641
  external_exports.object({
14642
14642
  kind: external_exports.literal("file"),
@@ -15442,6 +15442,7 @@ var PrimeAgentArtifactSchema = external_exports.object({
15442
15442
  status: PrimeAgentArtifactStatusSchema,
15443
15443
  input: external_exports.unknown().optional(),
15444
15444
  output: external_exports.unknown().optional(),
15445
+ backgroundOutput: external_exports.string().optional(),
15445
15446
  timestamp: external_exports.number().finite()
15446
15447
  }).openapi({ description: "Browser-safe Prime Agent technical artifact" });
15447
15448
  var PrimeAgentArtifactRunSchema = external_exports.object({
@@ -15477,7 +15478,9 @@ var PrimeAgentRlmChildSchema = external_exports.object({
15477
15478
  "running",
15478
15479
  "done",
15479
15480
  "error",
15480
- "cancelled"
15481
+ "cancelled",
15482
+ "recovering",
15483
+ "failed"
15481
15484
  ]),
15482
15485
  durationMs: external_exports.number().finite().optional(),
15483
15486
  answerPreview: external_exports.string().optional(),
@@ -15496,6 +15499,7 @@ var PrimeAgentRlmChildSchema = external_exports.object({
15496
15499
  error: external_exports.string().optional(),
15497
15500
  depth: external_exports.number().int().positive().optional(),
15498
15501
  childrenIds: external_exports.array(external_exports.string()).optional(),
15502
+ lastHeardFrom: external_exports.number().finite().optional(),
15499
15503
  timestamp: external_exports.number().finite()
15500
15504
  }).openapi({ description: "Browser-safe RLM child status" });
15501
15505
  var PrimeAgentRlmNodeSchema = PrimeAgentRlmChildSchema.extend({
@@ -15602,6 +15606,18 @@ var ChatPresentationEventSchema = external_exports.object({
15602
15606
  sessionId: SessionIdSchema,
15603
15607
  presentation: PrimeAgentSessionPresentationSchema
15604
15608
  }).openapi({ description: "Immutable Prime Agent presentation snapshot" });
15609
+ var ChatSessionSnapshotEventSchema = external_exports.object({
15610
+ type: external_exports.literal("session_snapshot"),
15611
+ session: ChatSessionMetadataSchema,
15612
+ messages: external_exports.array(ChatMessageSchema),
15613
+ presentation: PrimeAgentSessionPresentationSchema,
15614
+ status: external_exports.enum([
15615
+ "ready",
15616
+ "streaming",
15617
+ "error"
15618
+ ]),
15619
+ terminal: external_exports.boolean().optional()
15620
+ }).openapi({ description: "Authoritative transcript bootstrap for a read-only session stream" });
15605
15621
  var ChatRlmStreamEventSchema = external_exports.object({
15606
15622
  type: external_exports.literal("rlm"),
15607
15623
  child: PrimeAgentRlmChildSchema,
@@ -15681,6 +15697,7 @@ var ChatStreamEventSchema = external_exports.union([
15681
15697
  ChatQueueEventSchema,
15682
15698
  ChatThinkingEventSchema,
15683
15699
  ChatPresentationEventSchema,
15700
+ ChatSessionSnapshotEventSchema,
15684
15701
  ChatMessageEventSchema,
15685
15702
  ChatPayloadEventSchema,
15686
15703
  ChatReasoningEventSchema,
@@ -15717,7 +15734,8 @@ var ChatSessionInfoSchema = external_exports.object({
15717
15734
  "failed"
15718
15735
  ]),
15719
15736
  messageCount: external_exports.number(),
15720
- firstMessage: external_exports.string()
15737
+ firstMessage: external_exports.string(),
15738
+ isSubagent: external_exports.boolean().optional()
15721
15739
  }).openapi({ description: "Chat session info" });
15722
15740
  var ChatSessionsResponseSchema = external_exports.object({ sessions: external_exports.array(ChatSessionInfoSchema) }).openapi({ description: "Chat sessions list response" });
15723
15741