void 0.21.9 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (293) hide show
  1. package/README.md +5 -1
  2. package/dist/{account-cmd-DZZGK80W.mjs → account-cmd-C84Ee8cO.mjs} +5 -5
  3. package/dist/{scan-ClYmX3sa.mjs → application-analysis-BVsVqc11.mjs} +135 -18
  4. package/dist/application-routing-B7QEjqSR.mjs +27 -0
  5. package/dist/{auth-CZuiVsFh.mjs → auth-CCjt0hcq.mjs} +1 -1
  6. package/dist/{auth-DLNN0D3Z.mjs → auth-CSkdO2Bb.mjs} +4 -47
  7. package/dist/{auth-link-B_CeugBw.mjs → auth-link-CioEg6uY.mjs} +5 -5
  8. package/dist/{auth-router-BgEFRuvZ.mjs → auth-router-BsR981d4.mjs} +5 -5
  9. package/dist/{better-auth-shared-rsBGBvWJ.mjs → better-auth-shared-hy6RPh9W.mjs} +13 -2
  10. package/dist/{build-cmd-Dpt0jd-x.mjs → build-cmd-LzvNJORH.mjs} +19 -7
  11. package/dist/{cache-7_UeZdTk.mjs → cache-C4MvnrMH.mjs} +4 -4
  12. package/dist/{cancel-deploy-D23R1RXT.mjs → cancel-deploy-abUxpP2n.mjs} +4 -4
  13. package/dist/{cf-build-output-CGT03qCD.mjs → cf-build-output-BPqOT964.mjs} +141 -63
  14. package/dist/cf-build-output-_0HNWysu.mjs +2 -0
  15. package/dist/cli/cli.mjs +114 -460
  16. package/dist/cli/cloudflare-operation-process.mjs +1103 -0
  17. package/dist/cli/env-schema-probe.d.mts +2 -1
  18. package/dist/cli/env-schema-probe.mjs +3 -3
  19. package/dist/client-Cu7jWiF1.mjs +2 -0
  20. package/dist/{client-QTl6ko_D.mjs → client-RV8NVeB8.mjs} +165 -21
  21. package/dist/{cloudflare-auth-C4_GPZr0.mjs → cloudflare-auth-Qdc7tw8F.mjs} +41 -43
  22. package/dist/{cloudflare-cmd-bSmZ1d5L.mjs → cloudflare-cmd-BcrVyTmJ.mjs} +9 -10
  23. package/dist/cloudflare-config-Bktvwtpf.mjs +182 -0
  24. package/dist/{cloudflare-connect-jAwacxxP.mjs → cloudflare-connect-B8uPZ4nx.mjs} +4 -4
  25. package/dist/{cloudflare-operations-BipGMJ5O.mjs → cloudflare-operations-AiWashgg.mjs} +1 -1
  26. package/dist/{cloudflare-operations-sMZXpk_S.mjs → cloudflare-operations-fxHb-byx.mjs} +118 -203
  27. package/dist/{preset-UHj9ARyP.mjs → cloudflare-process-B-wekeR6.mjs} +93 -6
  28. package/dist/{config-CF69HgXc.d.mts → config-BMHb8RCj.d.mts} +2 -2
  29. package/dist/{config-CafTW6Cz.mjs → config-Br_JZD6u.mjs} +2 -7
  30. package/dist/config-C_XRIPx2.mjs +89 -0
  31. package/dist/{config-s7Xj7tPb.mjs → config-CyQ-wVd7.mjs} +1 -1
  32. package/dist/config-entry.d.mts +1 -1
  33. package/dist/{config-write-BSduPMY8.mjs → config-write-B1f88wJA.mjs} +1 -1
  34. package/dist/{connect-BsUSRzln.mjs → connect-Bd4kJd9U.mjs} +6 -6
  35. package/dist/{create-project-BniEV0OW.mjs → create-project-Boczwj5r.mjs} +1 -1
  36. package/dist/{create-project-DBfFSZKY.mjs → create-project-bMf6ffLZ.mjs} +9 -5
  37. package/dist/{db-hRrvZaq_.mjs → db-8uG64XLl.mjs} +26 -26
  38. package/dist/{delete-D6dZ9B6B.mjs → delete-NvbiyeJf.mjs} +4 -4
  39. package/dist/{deploy-WaAQez1O.mjs → deploy-DzAIwqNU.mjs} +944 -607
  40. package/dist/{deploy-DDz7c8LK.mjs → deploy-bjXdFCtn.mjs} +1 -1
  41. package/dist/{dist-BR1quN_w.mjs → dist-AoCzRTJE.mjs} +226 -60
  42. package/dist/{dist-C5fND3R0.mjs → dist-BuDuKZJv.mjs} +1 -1
  43. package/dist/{dist-Dn6nn2IU.mjs → dist-CTBk70IR.mjs} +42 -42
  44. package/dist/{domain-Dmhvb2oU.mjs → domain-y5Tvydvo.mjs} +5 -5
  45. package/dist/{email-DFi-s2t4.mjs → email-B3umsW75.mjs} +15 -30
  46. package/dist/{env-Csi-tMbT.mjs → env-BS6qYHDb.mjs} +6 -6
  47. package/dist/{env-public-D_6u46fX.d.mts → env-public-BX_r8HR6.d.mts} +2 -1
  48. package/dist/{env-validation-BB4GkLxn.mjs → env-validation-BPn7vk-V.mjs} +18 -71
  49. package/dist/{env-validation-BXge7uyK.mjs → env-validation-DbTg7-ar.mjs} +1 -1
  50. package/dist/{fetch-CXDChK7B.mjs → fetch-BIZJh7vR.mjs} +2 -2
  51. package/dist/{fetch-stream-AOByI7Ki.mjs → fetch-stream-IvCYKyQL.mjs} +24 -4
  52. package/dist/{gen-Dz3X1Qab.mjs → gen-B580--vC.mjs} +5 -5
  53. package/dist/gen-BVaUUumi.mjs +2 -0
  54. package/dist/{github-cmd-BED3_9JD.mjs → github-cmd-v45BdfKX.mjs} +6 -8
  55. package/dist/{handler-BXJTXd02.d.mts → handler-CZ4nAylQ.d.mts} +2 -1
  56. package/dist/{headers-BOg_velo.mjs → headers-DWi2IXWx.mjs} +1 -1
  57. package/dist/help-DofyZuY7.mjs +2 -0
  58. package/dist/{help-DC7gdz7L.mjs → help-daGKjXGk.mjs} +268 -666
  59. package/dist/index.d.mts +1 -1
  60. package/dist/index.mjs +305 -1490
  61. package/dist/info-B97bTX9N.mjs +113 -0
  62. package/dist/{init-WO0JlPx8.mjs → init-Bvy7zrBo.mjs} +51 -20
  63. package/dist/limits-Bq5LG8Id.d.mts +27 -0
  64. package/dist/limits-Cjuk2VPm.mjs +68 -0
  65. package/dist/{link-CsHOinF7.mjs → link-CDqqCjFl.mjs} +5 -5
  66. package/dist/{list-CDb-4bZ1.mjs → list-CZj0dzKY.mjs} +5 -5
  67. package/dist/{live-CKiJilLr.d.mts → live-Chw1eIMv.d.mts} +1 -1
  68. package/dist/{local-d1-CC8sKFGu.mjs → local-d1-2CMnpuW_.mjs} +2 -2
  69. package/dist/login-DYt_An22.mjs +2 -0
  70. package/dist/{login-DvqXsfGs.mjs → login-UZKFM_u7.mjs} +5 -5
  71. package/dist/{logs-BdfiOezj.mjs → logs-CUZ6t9t3.mjs} +5 -5
  72. package/dist/migrate-8_2u55MD.mjs +2 -0
  73. package/dist/{migrate-B8KuoYsO.mjs → migrate-DHul7PRV.mjs} +5 -4
  74. package/dist/{node-BM43oz4G.mjs → node-BkyRWRx8.mjs} +2 -2
  75. package/dist/operator-args-CLgKGlwU.mjs +690 -0
  76. package/dist/{operator-cmd-03819ATr.mjs → operator-cmd-DBA6dl0m.mjs} +69 -23
  77. package/dist/output-Dm_A4Tbv.mjs +81 -0
  78. package/dist/pages/client.d.mts +34 -2
  79. package/dist/pages/client.mjs +59 -3
  80. package/dist/pages/index.d.mts +1 -1
  81. package/dist/pages/index.mjs +3 -3
  82. package/dist/pages/islands-plugin.d.mts +16 -6
  83. package/dist/pages/islands-plugin.mjs +2 -2
  84. package/dist/pages/protocol.d.mts +2 -2
  85. package/dist/pages/protocol.mjs +2 -308
  86. package/dist/{parse-filename-DioPHiR9.mjs → parse-filename-CUbj-1MP.mjs} +35 -1
  87. package/dist/{output-CCH48AMM.mjs → picocolors-BTps1_gs.mjs} +2 -76
  88. package/dist/plan-D1Q5rf-r.mjs +2 -0
  89. package/dist/plan-NPpwZ_kc.mjs +58 -0
  90. package/dist/platform-args-BJdRtlLq.mjs +506 -0
  91. package/dist/platform-args-D3RXyR6h.mjs +2 -0
  92. package/dist/{platform-auth-config-z92h63q5.mjs → platform-auth-config-B56E9YP1.mjs} +4 -4
  93. package/dist/{platform-auth-protection-DeE3yr2R.mjs → platform-auth-protection-BDWO_aER.mjs} +3 -3
  94. package/dist/{platform-auth-recovery-o_340Ixx.mjs → platform-auth-recovery-1gg4CSRe.mjs} +4 -4
  95. package/dist/{platform-cmd-C4ZV3Vpy.mjs → platform-cmd-Bt-1w6pY.mjs} +1 -1
  96. package/dist/{platform-cmd-DNl8WosH.mjs → platform-cmd-DMcQStSc.mjs} +26 -5
  97. package/dist/{platform-domain-CU1JtJkW.mjs → platform-domain-BNkcz0OB.mjs} +36 -9
  98. package/dist/{platform-lifecycle-Bc047IeT.mjs → platform-lifecycle-9OyBALhH.mjs} +850 -276
  99. package/dist/{platform-lifecycle-Bs2qx1E3.mjs → platform-lifecycle-BE6C_jxh.mjs} +1 -1
  100. package/dist/{platform-management-CVpGI9Y5.mjs → platform-management-CjwLVQwN.mjs} +59 -11
  101. package/dist/{platform-management-C8tt6D8h.mjs → platform-management-CnyTdcWX.mjs} +1 -1
  102. package/dist/platform-plans-config-BNGKGr4P.mjs +359 -0
  103. package/dist/{platform-recovery-dvUaptLr.mjs → platform-recovery-D6KSpuFm.mjs} +2 -2
  104. package/dist/{plugin-inference-BMfKRSqE.mjs → plugin-inference-CXWnn79A.mjs} +174 -64
  105. package/dist/{prepare-DyZ-Yok5.mjs → prepare-B5Mkic5u.mjs} +3 -3
  106. package/dist/{prepare-C3kt3Rst.mjs → prepare-DOsL0CC9.mjs} +4 -20
  107. package/dist/prepare-cgvDMtSb.mjs +2 -0
  108. package/dist/{project-cmd-B44I8J_W.mjs → project-cmd-CNzrqvBv.mjs} +30 -16
  109. package/dist/{project-team-BkbYIsXN.mjs → project-team-DQOWPfQT.mjs} +4 -4
  110. package/dist/{project-token-C8xEEQnB.mjs → project-token-CTDYU0Cc.mjs} +4 -4
  111. package/dist/project-zero-trust-BNAkW-_0.mjs +63 -0
  112. package/dist/{protocol-ZH3jP4a7.d.mts → protocol-CjF_iI9X.d.mts} +2 -2
  113. package/dist/protocol-U7bfjHmA.mjs +331 -0
  114. package/dist/{provision-DNtrtaVD.mjs → provision-C4ORE7G7.mjs} +1 -1
  115. package/dist/{provision-BhreDAOS.mjs → provision-CJFgTZY8.mjs} +111 -215
  116. package/dist/{requests-DFyhBMaf.mjs → requests-MhxYnau8.mjs} +4 -4
  117. package/dist/resource-name-C7LVpcRm.mjs +11 -0
  118. package/dist/{rollback-DHHxXZiS.mjs → rollback-CJ6iSDoU.mjs} +5 -5
  119. package/dist/route-url-CG7U-cRN.mjs +15 -0
  120. package/dist/{runner-B8wXwWlo.mjs → runner-CXA9Fh8h.mjs} +1 -1
  121. package/dist/{runner-p-dMs2UN.mjs → runner-Ol0TNjk6.mjs} +2 -2
  122. package/dist/runtime/ai.d.mts +12 -8
  123. package/dist/runtime/ai.mjs +84 -17
  124. package/dist/runtime/better-auth-mysql.mjs +1 -1
  125. package/dist/runtime/better-auth-pg.mjs +1 -1
  126. package/dist/runtime/better-auth.mjs +1 -1
  127. package/dist/runtime/client-react.mjs +2 -2
  128. package/dist/runtime/client-solid.mjs +2 -2
  129. package/dist/runtime/client-svelte.mjs +2 -2
  130. package/dist/runtime/client-vue.mjs +2 -2
  131. package/dist/runtime/client.mjs +2 -2
  132. package/dist/runtime/durable.d.mts +3 -1
  133. package/dist/runtime/durable.mjs +4 -1
  134. package/dist/runtime/email/testing.mjs +1 -1
  135. package/dist/runtime/env-public.d.mts +1 -1
  136. package/dist/runtime/fetch-stream.mjs +1 -1
  137. package/dist/runtime/fetch.mjs +1 -1
  138. package/dist/runtime/handler.d.mts +1 -1
  139. package/dist/runtime/kv.mjs +0 -1
  140. package/dist/runtime/limits.d.mts +2 -0
  141. package/dist/runtime/limits.mjs +2 -0
  142. package/dist/runtime/live-client.d.mts +1 -1
  143. package/dist/runtime/live-server.mjs +25 -16
  144. package/dist/runtime/live.d.mts +1 -1
  145. package/dist/runtime/migration-handler.mjs +62 -42
  146. package/dist/runtime/route-url.d.mts +4 -0
  147. package/dist/runtime/route-url.mjs +2 -0
  148. package/dist/runtime/routing.d.mts +180 -0
  149. package/dist/runtime/routing.mjs +1082 -0
  150. package/dist/runtime/sandbox-container.d.mts +3 -0
  151. package/dist/runtime/sandbox-container.mjs +2 -0
  152. package/dist/runtime/sandbox.d.mts +4 -32
  153. package/dist/runtime/sandbox.mjs +151 -75
  154. package/dist/runtime/sse.mjs +1 -1
  155. package/dist/runtime/validator.d.mts +1 -1
  156. package/dist/runtime/ws-server.d.mts +4 -2
  157. package/dist/runtime/ws-server.mjs +27 -2
  158. package/dist/runtime/ws.d.mts +2 -2
  159. package/dist/runtime/ws.mjs +8 -6
  160. package/dist/sandbox-XZAqzFlG.d.mts +52 -0
  161. package/dist/sandbox-container-Bo0eiFKz.d.mts +73 -0
  162. package/dist/sandbox-container-C6ItmVuN.mjs +281 -0
  163. package/dist/{scan-4tfN-PSn.mjs → scan-C7okrLyM.mjs} +4 -35
  164. package/dist/{secret-DN9sSNiV.mjs → secret-Dli5fP0B.mjs} +6 -6
  165. package/dist/{skills-O6FUaizK.mjs → skills-D1II1Juz.mjs} +1 -1
  166. package/dist/{sse-BaC1jXko.mjs → sse-CQNaDFFV.mjs} +6 -3
  167. package/dist/{subcommand-prompt-BuGYkAkC.mjs → subcommand-prompt-CY1C4fvl.mjs} +2 -2
  168. package/dist/validate-Dq_L3s0S.mjs +2 -0
  169. package/dist/{validate-CIUwFpjB.mjs → validate-ctOrgiS3.mjs} +2 -1
  170. package/dist/{wrangler-BymcxrRa.mjs → wrangler-7K-bW_DL.mjs} +14 -235
  171. package/dist/{ws-BwcqizuH.d.mts → ws-CL1w7GXU.d.mts} +13 -2
  172. package/package.json +48 -33
  173. package/sandbox.Dockerfile +4 -0
  174. package/schema.json +10 -22
  175. package/skills/migrate-vite-cloudflare-to-void/SKILL.md +34 -157
  176. package/skills/void/SKILL.md +50 -133
  177. package/skills/void/docs/guide/ai.md +94 -84
  178. package/skills/void/docs/guide/app-types.md +3 -32
  179. package/skills/void/docs/guide/auth.md +12 -116
  180. package/skills/void/docs/guide/database/d1.md +9 -54
  181. package/skills/void/docs/guide/database/mysql.md +1 -1
  182. package/skills/void/docs/guide/database/postgresql.md +5 -26
  183. package/skills/void/docs/guide/database.md +23 -75
  184. package/skills/void/docs/guide/deployment.md +27 -113
  185. package/skills/void/docs/guide/durable-state.md +43 -18
  186. package/skills/void/docs/guide/edge/headers.md +3 -47
  187. package/skills/void/docs/guide/edge/prerendering.md +5 -20
  188. package/skills/void/docs/guide/edge/redirects.md +11 -64
  189. package/skills/void/docs/guide/edge/revalidation.md +6 -19
  190. package/skills/void/docs/guide/edge/rewrites.md +56 -284
  191. package/skills/void/docs/guide/edge/static-assets.md +23 -72
  192. package/skills/void/docs/guide/email/domains.md +112 -0
  193. package/skills/void/docs/guide/email/receiving.md +139 -0
  194. package/skills/void/docs/guide/email/sending.md +231 -0
  195. package/skills/void/docs/guide/email.md +13 -619
  196. package/skills/void/docs/guide/env-migration.md +11 -11
  197. package/skills/void/docs/guide/env-vars.md +9 -29
  198. package/skills/void/docs/guide/index.md +0 -15
  199. package/skills/void/docs/guide/jobs.md +3 -18
  200. package/skills/void/docs/guide/kv.md +5 -11
  201. package/skills/void/docs/guide/live.md +5 -56
  202. package/skills/void/docs/guide/pages-routing/actions-and-forms.md +78 -125
  203. package/skills/void/docs/guide/pages-routing/head.md +10 -10
  204. package/skills/void/docs/guide/pages-routing/islands.md +6 -36
  205. package/skills/void/docs/guide/pages-routing/layouts.md +6 -128
  206. package/skills/void/docs/guide/pages-routing/loaders.md +3 -19
  207. package/skills/void/docs/guide/pages-routing/markdown.md +13 -171
  208. package/skills/void/docs/guide/pages-routing/overview.md +7 -17
  209. package/skills/void/docs/guide/pages-routing/view-transitions.md +1 -1
  210. package/skills/void/docs/guide/platform/administration/access.md +1 -4
  211. package/skills/void/docs/guide/platform/administration/email.md +35 -8
  212. package/skills/void/docs/guide/platform/administration/operations.md +26 -4
  213. package/skills/void/docs/guide/platform/administration/plans.md +126 -0
  214. package/skills/void/docs/guide/platform/administration/projects.md +5 -2
  215. package/skills/void/docs/guide/platform/administration/zero-trust.md +189 -0
  216. package/skills/void/docs/guide/platform/development/local.md +2 -2
  217. package/skills/void/docs/guide/platform/development/runtime.md +3 -13
  218. package/skills/void/docs/guide/platform/development/schema-ci.md +0 -58
  219. package/skills/void/docs/guide/platform/installation/credentials.md +6 -4
  220. package/skills/void/docs/guide/platform/installation/domains.md +31 -3
  221. package/skills/void/docs/guide/platform/installation/first-deployment.md +6 -0
  222. package/skills/void/docs/guide/platform/installation/maintenance.md +3 -1
  223. package/skills/void/docs/guide/platform/installation/prerequisites.md +21 -16
  224. package/skills/void/docs/guide/platform/installation/setup.md +9 -5
  225. package/skills/void/docs/guide/platform/installation/uninstall.md +17 -2
  226. package/skills/void/docs/guide/platform-administration.md +2 -0
  227. package/skills/void/docs/guide/queues.md +7 -9
  228. package/skills/void/docs/guide/quickstart.md +38 -37
  229. package/skills/void/docs/guide/remote-dev.md +4 -9
  230. package/skills/void/docs/guide/sandboxes.md +78 -41
  231. package/skills/void/docs/guide/server-routing.md +9 -72
  232. package/skills/void/docs/guide/sse.md +4 -18
  233. package/skills/void/docs/guide/ssg.md +3 -15
  234. package/skills/void/docs/guide/ssr.md +14 -62
  235. package/skills/void/docs/guide/storage.md +9 -4
  236. package/skills/void/docs/guide/type-safety.md +3 -14
  237. package/skills/void/docs/guide/typed-fetch.md +3 -7
  238. package/skills/void/docs/guide/websockets.md +68 -40
  239. package/skills/void/docs/integrations/agents.md +3 -3
  240. package/skills/void/docs/integrations/cloudflare.md +85 -316
  241. package/skills/void/docs/integrations/frameworks/analog.md +5 -64
  242. package/skills/void/docs/integrations/frameworks/astro.md +4 -73
  243. package/skills/void/docs/integrations/frameworks/nuxt.md +5 -62
  244. package/skills/void/docs/integrations/frameworks/overview.md +11 -54
  245. package/skills/void/docs/integrations/frameworks/react-router.md +5 -60
  246. package/skills/void/docs/integrations/frameworks/sveltekit.md +6 -65
  247. package/skills/void/docs/integrations/frameworks/tanstack-start.md +4 -62
  248. package/skills/void/docs/integrations/nodejs-bun-deno.md +5 -69
  249. package/skills/void/docs/reference/api/auth.md +156 -0
  250. package/skills/void/docs/reference/api/client.md +87 -0
  251. package/skills/void/docs/reference/api/database.md +95 -0
  252. package/skills/void/docs/reference/api/durable.md +46 -0
  253. package/skills/void/docs/reference/api/env.md +50 -0
  254. package/skills/void/docs/reference/api/handlers.md +254 -0
  255. package/skills/void/docs/reference/api/pages.md +241 -0
  256. package/skills/void/docs/reference/api/plugin.md +39 -0
  257. package/skills/void/docs/reference/api/resources.md +109 -0
  258. package/skills/void/docs/reference/api/rewrites.md +76 -0
  259. package/skills/void/docs/reference/api/types.md +92 -0
  260. package/skills/void/docs/reference/api.md +56 -1218
  261. package/skills/void/docs/reference/cli/auth.md +88 -0
  262. package/skills/void/docs/reference/cli/database.md +128 -0
  263. package/skills/void/docs/reference/cli/deploy.md +85 -0
  264. package/skills/void/docs/reference/cli/domains.md +41 -0
  265. package/skills/void/docs/reference/cli/email.md +129 -0
  266. package/skills/void/docs/reference/cli/generate.md +116 -0
  267. package/skills/void/docs/reference/cli/github.md +189 -0
  268. package/skills/void/docs/reference/cli/platform-config.md +92 -0
  269. package/skills/void/docs/reference/cli/platform-email.md +81 -0
  270. package/skills/void/docs/reference/cli/platform-installation.md +127 -0
  271. package/skills/void/docs/reference/cli/platform-operations.md +90 -0
  272. package/skills/void/docs/reference/cli/platform-users.md +89 -0
  273. package/skills/void/docs/reference/cli/platform-zero-trust.md +45 -0
  274. package/skills/void/docs/reference/cli/platform.md +70 -0
  275. package/skills/void/docs/reference/cli/project.md +214 -0
  276. package/skills/void/docs/reference/cli/secrets.md +76 -0
  277. package/skills/void/docs/reference/cli/setup.md +70 -0
  278. package/skills/void/docs/reference/cli.md +33 -1621
  279. package/skills/void/docs/reference/config.md +26 -32
  280. package/skills/void/docs/reference/resource-inference.md +3 -58
  281. package/skills/void/docs/reference/structure.md +14 -41
  282. package/dist/canonical-json-DuDiiUsQ.mjs +0 -13
  283. package/dist/cli/cf-compat.mjs +0 -968
  284. package/dist/client-4cDVv7BO.mjs +0 -2
  285. package/dist/gen-Vnv2f65C.mjs +0 -2
  286. package/dist/help-DQMfeKMz.mjs +0 -2
  287. package/dist/login-DFQk7rbW.mjs +0 -2
  288. package/dist/migrate-TsHGBnDA.mjs +0 -2
  289. package/dist/plan-BEZ8VJW0.mjs +0 -256
  290. package/dist/plan-DpuOr14e.mjs +0 -2
  291. package/dist/prepare-BZXkjdNe.mjs +0 -2
  292. package/dist/validate-EKmJWxmy.mjs +0 -2
  293. /package/dist/cli/{cf-compat.d.mts → cloudflare-operation-process.d.mts} +0 -0
@@ -1,8 +1,9 @@
1
1
  import { a as join, n as dirname, o as normalize, t as basename, u as resolve$2 } from "./dist-BVqXeR_h.mjs";
2
- import { R as persistCloudflareConfig, _ as readProvisionedBindingEntry, k as writeProvisionedWranglerConfig, s as assertNoDuplicateMembers } from "./wrangler-BymcxrRa.mjs";
2
+ import { i as persistCloudflareConfig } from "./cloudflare-config-Bktvwtpf.mjs";
3
+ import { A as writeProvisionedWranglerConfig, s as assertNoDuplicateMembers, v as readProvisionedBindingEntry } from "./wrangler-7K-bW_DL.mjs";
3
4
  import { i as voidWarn, r as voidLog } from "./log-ChfPKsVd.mjs";
4
5
  import { r as scanWranglerDotenvKeys } from "./dotenv-VQxupEUv.mjs";
5
- import { o as resolveWranglerArgv } from "./preset-UHj9ARyP.mjs";
6
+ import { c as resolveCloudflareOperationArgv, n as decodeCloudflareOperationResult, r as encodeCloudflareOperation } from "./cloudflare-process-B-wekeR6.mjs";
6
7
  import { createRequire } from "node:module";
7
8
  import { closeSync, existsSync, fsyncSync, lstatSync, openSync, readFileSync, readlinkSync, realpathSync, renameSync, unlinkSync, writeSync } from "node:fs";
8
9
  import { randomUUID } from "node:crypto";
@@ -418,8 +419,8 @@ let activeProvisionQuarantineHook;
418
419
  function isQuarantineError(error) {
419
420
  return error instanceof WranglerQuarantineError || error?.quarantine === true;
420
421
  }
421
- /** The (at most one) currently-registered {runner, owning-lock} pair. */
422
- let activeRegistration;
422
+ /** Concurrent registrations are allowed only for two immutable Worker uploads. */
423
+ const activeRegistrations = /* @__PURE__ */ new Map();
423
424
  let coordinatorListenersInstalled = false;
424
425
  let activeTeardown;
425
426
  let reRaisedOnce = false;
@@ -437,21 +438,25 @@ function removeCoordinatorListeners() {
437
438
  process.removeListener("SIGINT", onCoordinatorSigint);
438
439
  process.removeListener("SIGTERM", onCoordinatorSigterm);
439
440
  }
440
- function registerRunner(registrant) {
441
- if (activeRegistration !== void 0) throw new Error("provision: internal invariant violated — a second wrangler child tried to register while one is already active in this process");
442
- activeRegistration = {
441
+ function canRegisterRunner(parallelWorkerUpload) {
442
+ return activeRegistrations.size === 0 || parallelWorkerUpload && activeProvisionQuarantineHook === void 0 && activeRegistrations.size < 2 && [...activeRegistrations.values()].every((entry) => entry.parallelWorkerUpload);
443
+ }
444
+ function registerRunner(registrant, parallelWorkerUpload) {
445
+ if (!canRegisterRunner(parallelWorkerUpload)) throw new Error("provision: internal invariant violated — a Cloudflare child tried to register outside its concurrency limit");
446
+ activeRegistrations.set(registrant, {
443
447
  registrant,
444
- lockQuarantine: activeProvisionQuarantineHook
445
- };
448
+ lockQuarantine: activeProvisionQuarantineHook,
449
+ parallelWorkerUpload
450
+ });
446
451
  installCoordinatorListeners();
447
452
  }
448
453
  function deregisterRunner(registrant) {
449
- if (activeRegistration?.registrant === registrant) activeRegistration = void 0;
450
- if (activeRegistration === void 0 && activeTeardown === void 0 && retentionWatchdog === void 0) removeCoordinatorListeners();
454
+ activeRegistrations.delete(registrant);
455
+ if (activeRegistrations.size === 0 && activeTeardown === void 0 && retentionWatchdog === void 0) removeCoordinatorListeners();
451
456
  }
452
457
  function coordinatorHandleSignal(signal) {
453
458
  if (activeTeardown !== void 0) return;
454
- if (retentionWatchdog !== void 0 && activeRegistration === void 0) {
459
+ if (retentionWatchdog !== void 0 && activeRegistrations.size === 0) {
455
460
  process.stderr.write(`provision: ignoring ${signal} — a provision lock is retained while an unconfirmed wrangler child may live and its quarantine metadata is not yet durable. The process exits once the child is confirmed dead or the metadata persists.\n`);
456
461
  return;
457
462
  }
@@ -462,15 +467,15 @@ function coordinatorHandleSignal(signal) {
462
467
  persistFailed: false,
463
468
  finished: false,
464
469
  deadlineTimer: void 0,
465
- expirePendingPair: void 0
470
+ expirePendingPairs: []
466
471
  };
467
472
  activeTeardown = teardown;
468
- const snapshot = activeRegistration !== void 0 ? [activeRegistration] : [];
473
+ const snapshot = [...activeRegistrations.values()];
469
474
  teardown.pending = snapshot.length;
470
475
  if (snapshot.length > 0) {
471
476
  const deadlineMs = Math.max(...snapshot.map((r) => r.registrant.teardownDeadlineMs));
472
477
  teardown.deadlineTimer = setTimeout(() => {
473
- teardown.expirePendingPair?.(`the coordinator-wide ${deadlineMs}ms teardown deadline expired before the process group's termination was confirmed`);
478
+ for (const expire of teardown.expirePendingPairs) expire(`the coordinator-wide ${deadlineMs}ms teardown deadline expired before the process group's termination was confirmed`);
474
479
  }, deadlineMs);
475
480
  }
476
481
  for (const registration of snapshot) coordinatorTearDownRegistrant(teardown, registration);
@@ -507,7 +512,7 @@ function coordinatorTearDownRegistrant(teardown, registration) {
507
512
  registrant.quarantine(detail);
508
513
  complete();
509
514
  };
510
- teardown.expirePendingPair = quarantinePair;
515
+ teardown.expirePendingPairs.push(quarantinePair);
511
516
  const outcome = registrant.signalGroup(teardown.signal);
512
517
  if (typeof outcome === "object") {
513
518
  quarantinePair(`the process group could not be signalled: ${outcome.error.message}`);
@@ -560,7 +565,7 @@ function armRetentionWatchdog(lock, info) {
560
565
  const resolveWatchdog = () => {
561
566
  if (retentionWatchdog !== void 0) clearTimeout(retentionWatchdog.timer);
562
567
  retentionWatchdog = void 0;
563
- if (activeRegistration === void 0 && activeTeardown === void 0) removeCoordinatorListeners();
568
+ if (activeRegistrations.size === 0 && activeTeardown === void 0) removeCoordinatorListeners();
564
569
  };
565
570
  const tick = () => {
566
571
  if (info.pid !== void 0) {
@@ -594,11 +599,10 @@ function armRetentionWatchdog(lock, info) {
594
599
  };
595
600
  }
596
601
  /**
597
- * Default `runWrangler`: resolves the project-local wrangler as an ARGV launcher
598
- * via Task 2's {@link resolveWranglerArgv} and runs it with `spawn` and
599
- * `shell: false`, so every argument is passed literally (no shell parsing → no
600
- * injection). Captures stdout (for `--json` parsing) and stderr (for
601
- * error/collision detection). Never called in unit tests — those inject a stub.
602
+ * Default provider runner: launches the isolated typed operation entry through
603
+ * {@link resolveCloudflareOperationArgv} with `shell: false`. Public request fields
604
+ * travel as literal JSON argv; secrets travel through stdin. Captured stdout carries
605
+ * the structured result envelope, while stderr carries provider diagnostics.
602
606
  *
603
607
  * ASYNC (returns a Promise). `spawn` + `await` (vs. the old blocking
604
608
  * `spawnSync`) keeps the Node event loop free while wrangler runs, so
@@ -608,7 +612,7 @@ function armRetentionWatchdog(lock, info) {
608
612
  * {@link COMMAND_TIMEOUT_MS} SIGKILL guards against a hung child.
609
613
  */
610
614
  function createDefaultRunWrangler(root, options) {
611
- const launcher = options?.launcher ?? resolveWranglerArgv(root);
615
+ const launcher = options?.launcher ?? resolveCloudflareOperationArgv(root);
612
616
  const timeoutMs = options?.timeoutMs ?? COMMAND_TIMEOUT_MS;
613
617
  const confirmGraceMs = options?.confirmKillGraceMs ?? CONFIRM_KILL_GRACE_MS;
614
618
  const killProcessGroup = options?.killProcessGroup ?? ((target, signal) => process.kill(target, signal));
@@ -616,15 +620,16 @@ function createDefaultRunWrangler(root, options) {
616
620
  const isWindows = process.platform === "win32";
617
621
  const teardownDeadlineMs = options?.signalTeardownDeadlineMs ?? confirmGraceMs + SIGNAL_TEARDOWN_DEADLINE_MARGIN_MS;
618
622
  return (args, opts) => new Promise((resolvePromise, rejectPromise) => {
623
+ const parallelWorkerUpload = options?.parallelWorkerUpload === true && args.type === "versions.upload";
619
624
  if (activeTeardown !== void 0) {
620
625
  rejectPromise(/* @__PURE__ */ new Error(`provision: refusing to spawn wrangler — a fatal ${activeTeardown.signal} is being handled and this process is terminating; no new wrangler work may start.`));
621
626
  return;
622
627
  }
623
- if (activeRegistration !== void 0) {
624
- rejectPromise(/* @__PURE__ */ new Error("provision: refusing to spawn wrangler — another wrangler child is already active in this process (wrangler calls must run sequentially; provisions run at most one per process)."));
628
+ if (!canRegisterRunner(parallelWorkerUpload)) {
629
+ rejectPromise(/* @__PURE__ */ new Error("provision: refusing to spawn wrangler — another wrangler child is already active in this process (only two immutable Worker uploads may overlap; all other Cloudflare commands and provisions remain sequential)."));
625
630
  return;
626
631
  }
627
- const child = spawn(command, [...prefix, ...args], {
632
+ const child = spawn(command, [...prefix, ...encodeCloudflareOperation(args)], {
628
633
  cwd: opts.cwd ?? root,
629
634
  shell: false,
630
635
  env: {
@@ -635,7 +640,7 @@ function createDefaultRunWrangler(root, options) {
635
640
  ...opts.suppressLogs ? { WRANGLER_WRITE_LOGS: "false" } : {}
636
641
  },
637
642
  stdio: [
638
- "ignore",
643
+ opts.input === void 0 ? "ignore" : "pipe",
639
644
  "pipe",
640
645
  "pipe"
641
646
  ],
@@ -716,7 +721,7 @@ function createDefaultRunWrangler(root, options) {
716
721
  settled = true;
717
722
  clearTimeout(commandTimer);
718
723
  deregisterSelf();
719
- resolvePromise(result);
724
+ resolvePromise(decodeCloudflareOperationResult(result));
720
725
  };
721
726
  const quarantine = (detail) => {
722
727
  if (settled) return;
@@ -789,7 +794,7 @@ function createDefaultRunWrangler(root, options) {
789
794
  signal: "SIGKILL"
790
795
  }), `the timeout SIGKILL (${timeoutStderr()})`);
791
796
  }, timeoutMs);
792
- child.on("error", (error) => {
797
+ const handleProcessError = (error) => {
793
798
  if (!spawned && typeof child.pid !== "number") {
794
799
  finish(normalizeRunWranglerResult({
795
800
  stdout,
@@ -815,7 +820,9 @@ function createDefaultRunWrangler(root, options) {
815
820
  status: null,
816
821
  signal: "SIGKILL"
817
822
  }), `a post-spawn child error (${error.message}; the group was SIGKILLed)`);
818
- });
823
+ };
824
+ child.on("error", handleProcessError);
825
+ child.stdin?.on("error", handleProcessError);
819
826
  child.on("close", (code, signal) => {
820
827
  closed = true;
821
828
  if (timedOut || postSpawnError !== void 0) {
@@ -842,8 +849,9 @@ function createDefaultRunWrangler(root, options) {
842
849
  confirmThenSettle(makeResult, `the child's exit (status ${String(code)}; surviving process-group members were SIGKILLed)`);
843
850
  nudgeConfirmPolls();
844
851
  });
845
- registerRunner(registrant);
852
+ registerRunner(registrant, parallelWorkerUpload);
846
853
  options?.onSpawnedChild?.(child);
854
+ if (opts.input !== void 0) child.stdin?.end(opts.input);
847
855
  });
848
856
  }
849
857
  /**
@@ -890,7 +898,7 @@ function isCleanSuccess(result) {
890
898
  * classified for a resource-specific not-found signal.
891
899
  */
892
900
  function isCleanFailure(result) {
893
- return !isHardFailure(result) && typeof result.status === "number" && result.status !== 0;
901
+ return !isHardFailure(result) && Number.isSafeInteger(result.status) && result.status > 0;
894
902
  }
895
903
  /**
896
904
  * The OVERALL deadline for the Hyperdrive existence lister (across ALL its paginated
@@ -1416,29 +1424,12 @@ async function acquireProvisionLock(configPath, lockOptions) {
1416
1424
  * like "absent", minting a duplicate). Used everywhere an empty list must mean
1417
1425
  * "authoritatively absent" and garbage must NOT be coerced to "absent".
1418
1426
  */
1419
- function parseJsonArrayStrict(stdout) {
1420
- const value = parseJsonLoose(stdout);
1427
+ function parseJsonArrayStrict(value) {
1421
1428
  return Array.isArray(value) ? value : void 0;
1422
1429
  }
1423
- /** Parse a wrangler `--json` stdout into an object, tolerating noise/failure. */
1424
- function parseJsonObject(stdout) {
1425
- const value = parseJsonLoose(stdout);
1430
+ function parseJsonObject(value) {
1426
1431
  return isRecord(value) ? value : void 0;
1427
1432
  }
1428
- /**
1429
- * wrangler may print human banners before the JSON payload; slice from the
1430
- * first `{`/`[` so a leading banner does not break `JSON.parse`.
1431
- */
1432
- function parseJsonLoose(stdout) {
1433
- const trimmed = stdout.trim();
1434
- const start = trimmed.search(/[[{]/);
1435
- if (start === -1) return;
1436
- try {
1437
- return JSON.parse(trimmed.slice(start));
1438
- } catch {
1439
- return;
1440
- }
1441
- }
1442
1433
  function isRecord(value) {
1443
1434
  return typeof value === "object" && value !== null && !Array.isArray(value);
1444
1435
  }
@@ -1471,17 +1462,13 @@ function readRootConfig(configPath) {
1471
1462
  if (!isRecord(parsed)) throw new Error(`provision: "${configPath}" must be a JSON object.`);
1472
1463
  return parsed;
1473
1464
  }
1474
- /** Escape a string for literal embedding in a `RegExp`. */
1475
- function escapeRegExp(value) {
1476
- return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1477
- }
1478
1465
  /**
1479
1466
  * FAIL-CLOSED gate over a discovery/list/info result. Throws (no create) unless
1480
1467
  * the child exited cleanly — a NUMERIC `status === 0`. Because
1481
1468
  * {@link normalizeRunWranglerResult} already folds a signal-killed child or a
1482
1469
  * spawn error into a non-zero status, a single numeric check here rejects ALL of
1483
1470
  * nonzero-exit / SIGTERM / spawn-error / non-numeric status. MUST be called
1484
- * BEFORE parsing stdout, so a failed result can never be parsed as "absent".
1471
+ * BEFORE reading provider data, so failed discovery never implies absence.
1485
1472
  */
1486
1473
  function assertDiscoverySucceeded(result, label) {
1487
1474
  if (!isCleanSuccess(result)) throw new Error(`provision: "${label}" failed (exit ${String(result.status)}): ${result.stderr || result.stdout || "no output"}. Cannot verify existing resources; refusing to create a possible duplicate.`);
@@ -1577,8 +1564,7 @@ function extractKvMatches(list, title) {
1577
1564
  }
1578
1565
  /** True when a `d1 create` failure means the name is already taken (code 7502). */
1579
1566
  function isAlreadyExistsError(result) {
1580
- const text = `${result.stdout}\n${result.stderr}`;
1581
- return text.includes("7502") || /already exists/i.test(text);
1567
+ return result.errorCode === 7502;
1582
1568
  }
1583
1569
  /**
1584
1570
  * EXACT, name-aware not-found classifier shared by R2 + queues. Given a
@@ -1589,43 +1575,16 @@ function isAlreadyExistsError(result) {
1589
1575
  * GENERIC "not found" (e.g. `Account not found`) is NEVER treated as absence,
1590
1576
  * which would mint a duplicate resource.
1591
1577
  */
1592
- function isConfirmedAbsent(result, kind, name) {
1593
- if (!isCleanFailure(result)) return false;
1594
- const text = `${result.stdout}\n${result.stderr}`;
1595
- switch (kind) {
1596
- case "r2": return /\[code:\s*10006\]/.test(text);
1597
- case "queue": return new RegExp(`Queue\\s+"${escapeRegExp(name)}"\\s+does not exist`, "i").test(text);
1598
- }
1578
+ function isConfirmedAbsent(result, kind, _name) {
1579
+ return isCleanFailure(result) && (kind === "r2" ? result.errorCode === 10006 : result.failure === "not-found");
1599
1580
  }
1600
- /**
1601
- * A `wrangler queues info <name>` result POSITIVELY confirms THIS queue does NOT
1602
- * exist in the account. Narrow, queue-only view of {@link isConfirmedAbsent}, shared
1603
- * with the deploy orchestrator's pre-build queue probe (`cli/deploy.ts`) so both call
1604
- * sites classify the SAME wrangler output the SAME way. Only the exact, name-aware
1605
- * `Queue "<name>" does not exist` on a clean non-zero exit returns `true`; every other
1606
- * outcome (success, signal/spawn failure, auth or network error, generic "not found")
1607
- * returns `false` and is left for the caller to treat as inconclusive.
1608
- */
1581
+ /** Only a completed, typed not-found response confirms queue absence. */
1609
1582
  function isQueueConfirmedAbsent(result, name) {
1610
1583
  return isConfirmedAbsent(result, "queue", name);
1611
1584
  }
1612
- /**
1613
- * A `wrangler queues info <name>` result POSITIVELY confirms THIS queue
1614
- * exists. Queues write NO config, so a create cannot be verified by re-reading the
1615
- * config (the D1/KV/R2/Hyperdrive backstop). And wrangler's `bin.wrangler` wrapper
1616
- * maps a signal-killed inner CLI to `process.exit(0)` (`bin/wrangler.js`:
1617
- * `code === null → exit(0)`), so a KILLED probe/create can surface a clean exit 0
1618
- * with empty/partial output. A bare clean 0 is therefore NOT proof the queue exists.
1619
- * We require BOTH a clean success (numeric exit 0, no signal/spawn error — the
1620
- * provenance rule) AND the output to name THIS exact queue: wrangler 4.131's
1621
- * `queues info` prints `Queue Name: <queue_name>` for the queue it fetched by name
1622
- * (account-unique), so an exact `Queue Name: <name>` line is the positive signal.
1623
- * Used for BOTH the reuse probe and the post-create verify probe.
1624
- */
1585
+ /** Reuse and post-create verification require clean success and the exact returned name. */
1625
1586
  function queueInfoConfirmsExists(result, name) {
1626
- if (!isCleanSuccess(result)) return false;
1627
- const text = `${result.stdout}\n${result.stderr}`;
1628
- return new RegExp(`^Queue Name:\\s+${escapeRegExp(name)}\\s*$`, "m").test(text);
1587
+ return isCleanSuccess(result) && isRecord(result.data) && result.data.name === name;
1629
1588
  }
1630
1589
  /**
1631
1590
  * Throw when the writer could not attach `migrations_dir` because no matching
@@ -1728,29 +1687,6 @@ function assertValidResourceName(kind, name) {
1728
1687
  if (!grammar.re.test(name)) throw new Error(`provision: refusing to pass an invalid ${grammar.label} name ${JSON.stringify(name)} to wrangler. A ${grammar.label} name must ${grammar.rule}. Rename the resource and retry.`);
1729
1688
  }
1730
1689
  /**
1731
- * The trailing flags EVERY provisioner wrangler invocation MUST carry, built
1732
- * ONCE so no call site can forget them:
1733
- * - `-c <configPath>` pins the ONE resolved config (no split-brain reads/writes);
1734
- * - `--env=` (an explicit EMPTY environment) FORCES wrangler onto the top-level
1735
- * config environment. wrangler 4.131 selects its config env as
1736
- * `args.env ?? getCloudflareEnv()`; passing an explicit empty `args.env`
1737
- * short-circuits the `??` so a project `.env`/`.env.local` that sets
1738
- * `CLOUDFLARE_ENV` (reloaded into `process.env` on every wrangler command)
1739
- * can NEVER reselect a named `env.*` block — whose `account_id`/bindings could
1740
- * differ from the single account this provision resolved, patched, and pinned.
1741
- * `--env=` is wrangler's own documented sentinel for "use the top-level
1742
- * environment" (it prints exactly this guidance when multiple env blocks exist).
1743
- * Discovery/create AND `--update-config` therefore all operate on the SAME
1744
- * top-level config/account.
1745
- */
1746
- function wranglerConfigArgs(configPath) {
1747
- return [
1748
- "-c",
1749
- configPath,
1750
- "--env="
1751
- ];
1752
- }
1753
- /**
1754
1690
  * Build a redactor that strips connection-string secrets from every string the
1755
1691
  * provisioner PROPAGATES (buffered wrangler stdout/stderr, error strings, logged
1756
1692
  * warnings). Two layers:
@@ -2151,14 +2087,12 @@ async function reconcileD1(desired, configPath, runWrangler, write, persistCreat
2151
2087
  id: entry.database_id
2152
2088
  });
2153
2089
  } else {
2154
- const listResult = await runWrangler([
2155
- "d1",
2156
- "list",
2157
- "--json",
2158
- ...wranglerConfigArgs(configPath)
2159
- ], { captureJson: true });
2090
+ const listResult = await runWrangler({
2091
+ type: "d1.list",
2092
+ configPath
2093
+ }, {});
2160
2094
  assertDiscoverySucceeded(listResult, "wrangler d1 list");
2161
- const rawList = parseJsonArrayStrict(listResult.stdout);
2095
+ const rawList = parseJsonArrayStrict(listResult.data);
2162
2096
  if (!rawList) throw new Error(`provision: "wrangler d1 list --json" did not return a JSON array; cannot verify whether D1 database ${JSON.stringify(name)} exists. Refusing to create a possible duplicate.`);
2163
2097
  const claimants = validateResourceList(rawList, {
2164
2098
  resource: "D1 database",
@@ -2192,15 +2126,12 @@ async function reconcileD1(desired, configPath, runWrangler, write, persistCreat
2192
2126
  id: existing.id
2193
2127
  });
2194
2128
  } else {
2195
- const created = await runWrangler([
2196
- "d1",
2197
- "create",
2129
+ const created = await runWrangler({
2130
+ type: "d1.create",
2198
2131
  name,
2199
- "--binding",
2200
2132
  binding,
2201
- "--update-config",
2202
- ...wranglerConfigArgs(configPath)
2203
- ]);
2133
+ configPath
2134
+ });
2204
2135
  if (isCleanSuccess(created)) {
2205
2136
  assertCreateWroteRealId(configPath, {
2206
2137
  field: "d1_databases",
@@ -2222,15 +2153,13 @@ async function reconcileD1(desired, configPath, runWrangler, write, persistCreat
2222
2153
  action: "created"
2223
2154
  });
2224
2155
  } else if (isCleanFailure(created) && isAlreadyExistsError(created)) {
2225
- const infoResult = await runWrangler([
2226
- "d1",
2227
- "info",
2156
+ const infoResult = await runWrangler({
2157
+ type: "d1.info",
2228
2158
  name,
2229
- "--json",
2230
- ...wranglerConfigArgs(configPath)
2231
- ], { captureJson: true });
2159
+ configPath
2160
+ }, {});
2232
2161
  assertDiscoverySucceeded(infoResult, `wrangler d1 info ${name}`);
2233
- const info = normalizeD1(parseJsonObject(infoResult.stdout), name);
2162
+ const info = normalizeD1(parseJsonObject(infoResult.data), name);
2234
2163
  if (info.kind !== "match") throw new Error(`provision: "wrangler d1 create ${name}" reported the database already exists, but "wrangler d1 info ${name} --json" did not return a database with a matching name and an unambiguous id. Refusing to adopt an unverified database.`);
2235
2164
  log.info(`adopted existing D1 database ${name} (${info.id})`);
2236
2165
  assertD1MigrationsDirApplied(write({
@@ -2265,21 +2194,11 @@ async function reconcileD1(desired, configPath, runWrangler, write, persistCreat
2265
2194
  else {
2266
2195
  let token = opts?.apiToken ?? process.env.CLOUDFLARE_API_TOKEN;
2267
2196
  if (!token) {
2268
- const auth = await runWrangler([
2269
- "auth",
2270
- "token",
2271
- "--json",
2272
- ...wranglerConfigArgs(configPath)
2273
- ], {
2274
- captureJson: true,
2275
- suppressLogs: true
2276
- });
2277
- const start = auth.stdout.indexOf("{");
2278
- const end = auth.stdout.lastIndexOf("}");
2279
- let parsed;
2280
- if (isCleanSuccess(auth) && start >= 0 && end > start) try {
2281
- parsed = JSON.parse(auth.stdout.slice(start, end + 1));
2282
- } catch {}
2197
+ const auth = await runWrangler({
2198
+ type: "auth.token",
2199
+ configPath
2200
+ }, { suppressLogs: true });
2201
+ const parsed = isCleanSuccess(auth) && isRecord(auth.data) ? auth.data : void 0;
2283
2202
  if ((parsed?.type === "oauth" || parsed?.type === "api_token") && typeof parsed.token === "string") token = parsed.token;
2284
2203
  }
2285
2204
  if (!token) throw new Error("provision: D1 read replication requires a Cloudflare API bearer with D1 Edit permission. Log in with `wrangler login` or set CLOUDFLARE_API_TOKEN, then retry.");
@@ -2300,14 +2219,12 @@ async function reconcileKv(desired, configPath, runWrangler, write, persistCreat
2300
2219
  });
2301
2220
  continue;
2302
2221
  }
2303
- const listResult = await runWrangler([
2304
- "kv",
2305
- "namespace",
2306
- "list",
2307
- ...wranglerConfigArgs(configPath)
2308
- ], { captureJson: true });
2222
+ const listResult = await runWrangler({
2223
+ type: "kv.namespace.list",
2224
+ configPath
2225
+ }, {});
2309
2226
  assertDiscoverySucceeded(listResult, "wrangler kv namespace list");
2310
- const rawList = parseJsonArrayStrict(listResult.stdout);
2227
+ const rawList = parseJsonArrayStrict(listResult.data);
2311
2228
  if (!rawList) throw new Error(`provision: "wrangler kv namespace list" did not return a JSON array; cannot verify whether KV namespace ${JSON.stringify(title)} exists. Refusing to create a possible duplicate.`);
2312
2229
  const matches = extractKvMatches(validateResourceList(rawList, {
2313
2230
  resource: "KV namespace",
@@ -2333,16 +2250,12 @@ async function reconcileKv(desired, configPath, runWrangler, write, persistCreat
2333
2250
  id: chosen.id
2334
2251
  });
2335
2252
  } else {
2336
- const created = await runWrangler([
2337
- "kv",
2338
- "namespace",
2339
- "create",
2340
- title,
2341
- "--binding",
2253
+ const created = await runWrangler({
2254
+ type: "kv.namespace.create",
2255
+ name: title,
2342
2256
  binding,
2343
- "--update-config",
2344
- ...wranglerConfigArgs(configPath)
2345
- ]);
2257
+ configPath
2258
+ });
2346
2259
  if (!isCleanSuccess(created)) throw new Error(`provision: "wrangler kv namespace create ${title}" failed: ${created.stderr || created.stdout}`);
2347
2260
  assertCreateWroteRealId(configPath, {
2348
2261
  field: "kv_namespaces",
@@ -2375,16 +2288,13 @@ async function reconcileR2(desired, configPath, runWrangler, write, persistCreat
2375
2288
  action: "reused"
2376
2289
  });
2377
2290
  } else {
2378
- const info = await runWrangler([
2379
- "r2",
2380
- "bucket",
2381
- "info",
2382
- bucketName,
2383
- "--json",
2384
- ...wranglerConfigArgs(configPath)
2385
- ], { captureJson: true });
2291
+ const info = await runWrangler({
2292
+ type: "r2.bucket.info",
2293
+ name: bucketName,
2294
+ configPath
2295
+ }, {});
2386
2296
  if (isCleanSuccess(info)) {
2387
- const payload = parseJsonObject(info.stdout);
2297
+ const payload = parseJsonObject(info.data);
2388
2298
  if (!payload || payload.name !== bucketName) throw new Error(`provision: "wrangler r2 bucket info ${bucketName} --json" exited 0 but did not identify the requested bucket (expected name ${JSON.stringify(bucketName)}). Refusing to adopt an unverified bucket. Output: ${info.stdout || info.stderr}`);
2389
2299
  log.info(`adopted existing R2 bucket ${bucketName}`);
2390
2300
  write({ r2: {
@@ -2398,16 +2308,12 @@ async function reconcileR2(desired, configPath, runWrangler, write, persistCreat
2398
2308
  action: "adopted"
2399
2309
  });
2400
2310
  } else if (isConfirmedAbsent(info, "r2", bucketName)) {
2401
- const created = await runWrangler([
2402
- "r2",
2403
- "bucket",
2404
- "create",
2405
- bucketName,
2406
- "--binding",
2311
+ const created = await runWrangler({
2312
+ type: "r2.bucket.create",
2313
+ name: bucketName,
2407
2314
  binding,
2408
- "--update-config",
2409
- ...wranglerConfigArgs(configPath)
2410
- ]);
2315
+ configPath
2316
+ });
2411
2317
  if (!isCleanSuccess(created)) throw new Error(`provision: "wrangler r2 bucket create ${bucketName}" failed: ${created.stderr || created.stdout}`);
2412
2318
  assertCreateWroteRealId(configPath, {
2413
2319
  field: "r2_buckets",
@@ -2418,15 +2324,12 @@ async function reconcileR2(desired, configPath, runWrangler, write, persistCreat
2418
2324
  command: "wrangler r2 bucket create"
2419
2325
  }, binding, bucketName);
2420
2326
  if (bucketName === R2_BUCKET_NAME_PLACEHOLDER) {
2421
- const verify = await runWrangler([
2422
- "r2",
2423
- "bucket",
2424
- "info",
2425
- bucketName,
2426
- "--json",
2427
- ...wranglerConfigArgs(configPath)
2428
- ], { captureJson: true });
2429
- const payload = isCleanSuccess(verify) ? parseJsonObject(verify.stdout) : void 0;
2327
+ const verify = await runWrangler({
2328
+ type: "r2.bucket.info",
2329
+ name: bucketName,
2330
+ configPath
2331
+ }, {});
2332
+ const payload = isCleanSuccess(verify) ? parseJsonObject(verify.data) : void 0;
2430
2333
  if (!payload || payload.name !== bucketName) throw new Error(`provision: "wrangler r2 bucket create ${bucketName}" reported success but a follow-up "wrangler r2 bucket info ${bucketName}" did not confirm the bucket exists. The create may have been interrupted — wrangler's launcher can mask a signal-killed child as exit 0, and the config entry is indistinguishable from the local-dev placeholder for this name. Refusing to record an unprovisioned bucket; inspect the account and retry.`);
2431
2334
  }
2432
2335
  persistCreatedConfig();
@@ -2495,16 +2398,12 @@ async function reconcileHyperdrive(desired, configPath, runWrangler, write, pers
2495
2398
  });
2496
2399
  } else if (existenceUnknown) throw new Error(`provision: cannot verify whether Hyperdrive config ${JSON.stringify(name)} already exists (no existence check available — provide an accountId + API token, or inject a listHyperdriveConfigs seam). "wrangler hyperdrive create" silently duplicates a same-named config, so provisioning refuses to create it blindly.`);
2497
2400
  else {
2498
- const created = await runWrangler([
2499
- "hyperdrive",
2500
- "create",
2401
+ const created = await runWrangler({
2402
+ type: "hyperdrive.create",
2501
2403
  name,
2502
- `--connection-string=${connectionString}`,
2503
- "--binding",
2504
2404
  binding,
2505
- "--update-config",
2506
- ...wranglerConfigArgs(configPath)
2507
- ]);
2405
+ configPath
2406
+ }, { input: connectionString });
2508
2407
  if (!isCleanSuccess(created)) throw new Error(`provision: "wrangler hyperdrive create ${name}" failed: ${created.stderr || created.stdout}`);
2509
2408
  assertCreateWroteRealId(configPath, {
2510
2409
  field: "hyperdrive",
@@ -2526,12 +2425,11 @@ async function reconcileHyperdrive(desired, configPath, runWrangler, write, pers
2526
2425
  }
2527
2426
  async function reconcileQueues(desired, configPath, runWrangler, resources) {
2528
2427
  for (const name of desired.queues) {
2529
- const info = await runWrangler([
2530
- "queues",
2531
- "info",
2428
+ const info = await runWrangler({
2429
+ type: "queues.info",
2532
2430
  name,
2533
- ...wranglerConfigArgs(configPath)
2534
- ]);
2431
+ configPath
2432
+ });
2535
2433
  if (queueInfoConfirmsExists(info, name)) {
2536
2434
  resources.push({
2537
2435
  kind: "queue",
@@ -2541,19 +2439,17 @@ async function reconcileQueues(desired, configPath, runWrangler, resources) {
2541
2439
  continue;
2542
2440
  }
2543
2441
  if (!isConfirmedAbsent(info, "queue", name)) throw new Error(`provision: "wrangler queues info ${name}" failed or did not confirm the queue exists: ${info.stderr || info.stdout || "no output"}`);
2544
- const created = await runWrangler([
2545
- "queues",
2546
- "create",
2442
+ const created = await runWrangler({
2443
+ type: "queues.create",
2547
2444
  name,
2548
- ...wranglerConfigArgs(configPath)
2549
- ]);
2445
+ configPath
2446
+ });
2550
2447
  if (!isCleanSuccess(created)) throw new Error(`provision: "wrangler queues create ${name}" failed: ${created.stderr || created.stdout}`);
2551
- if (!queueInfoConfirmsExists(await runWrangler([
2552
- "queues",
2553
- "info",
2448
+ if (!queueInfoConfirmsExists(await runWrangler({
2449
+ type: "queues.info",
2554
2450
  name,
2555
- ...wranglerConfigArgs(configPath)
2556
- ]), name)) throw new Error(`provision: "wrangler queues create ${name}" reported success but "wrangler queues info ${name}" did not confirm the queue exists afterward. The create may have been interrupted — wrangler's launcher can mask a signal-killed child as exit 0. Refusing to record an unprovisioned queue; inspect the account and retry.`);
2451
+ configPath
2452
+ }), name)) throw new Error(`provision: "wrangler queues create ${name}" reported success but "wrangler queues info ${name}" did not confirm the queue exists afterward. The create may have been interrupted — wrangler's launcher can mask a signal-killed child as exit 0. Refusing to record an unprovisioned queue; inspect the account and retry.`);
2557
2453
  resources.push({
2558
2454
  kind: "queue",
2559
2455
  name,
@@ -1,8 +1,8 @@
1
- import { a as dim, c as import_picocolors, r as cliTitle } from "./output-CCH48AMM.mjs";
2
- import { c as getToken } from "./auth-DLNN0D3Z.mjs";
1
+ import { c as getToken } from "./auth-CSkdO2Bb.mjs";
3
2
  import { o as readProjectConfig } from "./project-C0Fqu05O.mjs";
4
- import { O as intro, P as outro, j as log } from "./dist-Dn6nn2IU.mjs";
5
- import { n as PlatformClient } from "./client-QTl6ko_D.mjs";
3
+ import { O as intro, P as outro, j as log } from "./dist-CTBk70IR.mjs";
4
+ import { n as PlatformClient } from "./client-RV8NVeB8.mjs";
5
+ import { a as dim, c as import_picocolors, r as cliTitle } from "./output-Dm_A4Tbv.mjs";
6
6
  //#region src/cli/requests.ts
7
7
  async function runRequestsCommand(root, range, status) {
8
8
  console.log();
@@ -0,0 +1,11 @@
1
+ //#region src/shared/resource-name.ts
2
+ function resourceNameWords(value) {
3
+ return value.split(/[^a-zA-Z0-9]+/).filter(Boolean);
4
+ }
5
+ function isResourceName(value) {
6
+ if (typeof value !== "string") return false;
7
+ const words = resourceNameWords(value);
8
+ return words.length > 0 && /^[a-zA-Z]/.test(words[0]);
9
+ }
10
+ //#endregion
11
+ export { resourceNameWords as n, isResourceName as t };
@@ -1,8 +1,8 @@
1
- import { a as dim, c as import_picocolors, i as createSpinner, o as ensureUtc, r as cliTitle } from "./output-CCH48AMM.mjs";
2
- import { c as getToken } from "./auth-DLNN0D3Z.mjs";
1
+ import { c as getToken } from "./auth-CSkdO2Bb.mjs";
3
2
  import { i as readDeploymentPlatform, o as readProjectConfig } from "./project-C0Fqu05O.mjs";
4
- import { E as confirm, I as select, O as intro, P as outro, T as cancel, W as isCancel, j as log } from "./dist-Dn6nn2IU.mjs";
5
- import { n as PlatformClient } from "./client-QTl6ko_D.mjs";
3
+ import { E as confirm, I as select, O as intro, P as outro, T as cancel, W as isCancel, j as log } from "./dist-CTBk70IR.mjs";
4
+ import { n as PlatformClient } from "./client-RV8NVeB8.mjs";
5
+ import { a as dim, c as import_picocolors, i as createSpinner, o as ensureUtc, r as cliTitle } from "./output-Dm_A4Tbv.mjs";
6
6
  //#region src/cli/rollback.ts
7
7
  async function runRollbackCommand(root, deployId) {
8
8
  console.log();
@@ -83,7 +83,7 @@ async function runRollbackCommand(root, deployId) {
83
83
  outro(dim("Traffic is now serving the rolled-back deployment."));
84
84
  }
85
85
  async function runCloudflareRollback(root, deployId) {
86
- const { activateCloudflareExistingVersion, readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-BipGMJ5O.mjs");
86
+ const { activateCloudflareExistingVersion, readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-AiWashgg.mjs");
87
87
  const context = resolveCloudflareOperationContext(root);
88
88
  const status = await readCloudflareWorkerStatus(context);
89
89
  const deployedVersionIds = new Set(status.deployedVersionIds);