void 0.22.0 → 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 (276) hide show
  1. package/README.md +5 -1
  2. package/dist/{account-cmd-CjyxcGkM.mjs → account-cmd-C84Ee8cO.mjs} +4 -4
  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-BLO4ptzo.mjs → auth-link-CioEg6uY.mjs} +4 -4
  8. package/dist/{auth-router-ZUg9MF_U.mjs → auth-router-BsR981d4.mjs} +4 -4
  9. package/dist/{better-auth-shared-rsBGBvWJ.mjs → better-auth-shared-hy6RPh9W.mjs} +13 -2
  10. package/dist/{build-cmd-BxR5FROK.mjs → build-cmd-LzvNJORH.mjs} +17 -5
  11. package/dist/{cache-D0sWhgKI.mjs → cache-C4MvnrMH.mjs} +2 -2
  12. package/dist/{cancel-deploy-D4NUqFbi.mjs → cancel-deploy-abUxpP2n.mjs} +2 -2
  13. package/dist/{cf-build-output-BJ6yGEIS.mjs → cf-build-output-BPqOT964.mjs} +2 -1
  14. package/dist/cf-build-output-_0HNWysu.mjs +2 -0
  15. package/dist/cli/cli.mjs +80 -455
  16. package/dist/cli/{cf-compat.mjs → cloudflare-operation-process.mjs} +442 -421
  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-BTZ3XkrB.mjs → client-RV8NVeB8.mjs} +140 -21
  21. package/dist/{cloudflare-auth-DQkqoMYa.mjs → cloudflare-auth-Qdc7tw8F.mjs} +41 -38
  22. package/dist/{cloudflare-cmd-BKlfGHAy.mjs → cloudflare-cmd-BcrVyTmJ.mjs} +5 -5
  23. package/dist/cloudflare-config-Bktvwtpf.mjs +182 -0
  24. package/dist/{cloudflare-connect-Ctmrw579.mjs → cloudflare-connect-B8uPZ4nx.mjs} +3 -3
  25. package/dist/{cloudflare-operations-BT6OWFBk.mjs → cloudflare-operations-AiWashgg.mjs} +1 -1
  26. package/dist/{cloudflare-operations-B9tzgjmf.mjs → cloudflare-operations-fxHb-byx.mjs} +116 -172
  27. package/dist/{preset-UHj9ARyP.mjs → cloudflare-process-B-wekeR6.mjs} +93 -6
  28. package/dist/{config-VavjpDnp.d.mts → config-BMHb8RCj.d.mts} +1 -0
  29. package/dist/config-C_XRIPx2.mjs +89 -0
  30. package/dist/config-entry.d.mts +1 -1
  31. package/dist/{connect-Dg-WkW-C.mjs → connect-Bd4kJd9U.mjs} +5 -5
  32. package/dist/{create-project-DdoqwFLF.mjs → create-project-Boczwj5r.mjs} +1 -1
  33. package/dist/{create-project-l9J7pbtm.mjs → create-project-bMf6ffLZ.mjs} +2 -2
  34. package/dist/{db-gp2sCXyN.mjs → db-8uG64XLl.mjs} +21 -21
  35. package/dist/{delete-TTedbH6B.mjs → delete-NvbiyeJf.mjs} +2 -2
  36. package/dist/{deploy-CH-o2CaZ.mjs → deploy-DzAIwqNU.mjs} +908 -582
  37. package/dist/{deploy-B19L2Bra.mjs → deploy-bjXdFCtn.mjs} +1 -1
  38. package/dist/{domain-JRF59P_r.mjs → domain-y5Tvydvo.mjs} +3 -3
  39. package/dist/{email-Bo6G9LOZ.mjs → email-B3umsW75.mjs} +13 -28
  40. package/dist/{env-BYOrWQnv.mjs → env-BS6qYHDb.mjs} +4 -4
  41. package/dist/{env-public-BxU_0yTL.d.mts → env-public-BX_r8HR6.d.mts} +1 -1
  42. package/dist/{env-validation-BB4GkLxn.mjs → env-validation-BPn7vk-V.mjs} +18 -71
  43. package/dist/{env-validation-BXge7uyK.mjs → env-validation-DbTg7-ar.mjs} +1 -1
  44. package/dist/{fetch-CXDChK7B.mjs → fetch-BIZJh7vR.mjs} +2 -2
  45. package/dist/{fetch-stream-AOByI7Ki.mjs → fetch-stream-IvCYKyQL.mjs} +24 -4
  46. package/dist/{gen-sCtlCOdA.mjs → gen-B580--vC.mjs} +2 -2
  47. package/dist/gen-BVaUUumi.mjs +2 -0
  48. package/dist/{github-cmd-0-7PexDq.mjs → github-cmd-v45BdfKX.mjs} +2 -2
  49. package/dist/{handler-HEcZsaij.d.mts → handler-CZ4nAylQ.d.mts} +1 -1
  50. package/dist/help-DofyZuY7.mjs +2 -0
  51. package/dist/{help-GKtwl07I.mjs → help-daGKjXGk.mjs} +229 -747
  52. package/dist/index.d.mts +1 -1
  53. package/dist/index.mjs +288 -1502
  54. package/dist/info-B97bTX9N.mjs +113 -0
  55. package/dist/{init-FZx3Elvz.mjs → init-Bvy7zrBo.mjs} +46 -15
  56. package/dist/limits-Bq5LG8Id.d.mts +27 -0
  57. package/dist/limits-Cjuk2VPm.mjs +68 -0
  58. package/dist/{link-BrQfb_CU.mjs → link-CDqqCjFl.mjs} +3 -3
  59. package/dist/{list-D44jmIAM.mjs → list-CZj0dzKY.mjs} +3 -3
  60. package/dist/{live-CKJlvlNp.d.mts → live-Chw1eIMv.d.mts} +1 -1
  61. package/dist/{local-d1-Bg9OzEEO.mjs → local-d1-2CMnpuW_.mjs} +2 -2
  62. package/dist/login-DYt_An22.mjs +2 -0
  63. package/dist/{login-CAsAsQ-_.mjs → login-UZKFM_u7.mjs} +3 -3
  64. package/dist/{logs-BjKvFnVM.mjs → logs-CUZ6t9t3.mjs} +3 -3
  65. package/dist/migrate-8_2u55MD.mjs +2 -0
  66. package/dist/{migrate-BPITvDJN.mjs → migrate-DHul7PRV.mjs} +2 -1
  67. package/dist/{node-Dt7z256D.mjs → node-BkyRWRx8.mjs} +1 -1
  68. package/dist/operator-args-CLgKGlwU.mjs +690 -0
  69. package/dist/{operator-cmd-BK5CCiT9.mjs → operator-cmd-DBA6dl0m.mjs} +68 -22
  70. package/dist/pages/client.d.mts +34 -2
  71. package/dist/pages/client.mjs +59 -3
  72. package/dist/pages/index.d.mts +1 -1
  73. package/dist/pages/index.mjs +1 -1
  74. package/dist/pages/islands-plugin.mjs +1 -1
  75. package/dist/pages/protocol.d.mts +2 -2
  76. package/dist/pages/protocol.mjs +2 -308
  77. package/dist/{parse-filename-DioPHiR9.mjs → parse-filename-CUbj-1MP.mjs} +35 -1
  78. package/dist/plan-D1Q5rf-r.mjs +2 -0
  79. package/dist/plan-NPpwZ_kc.mjs +58 -0
  80. package/dist/platform-args-BJdRtlLq.mjs +506 -0
  81. package/dist/platform-args-D3RXyR6h.mjs +2 -0
  82. package/dist/{platform-auth-config-BlN8xTdD.mjs → platform-auth-config-B56E9YP1.mjs} +3 -3
  83. package/dist/{platform-auth-protection-7d5aV2Jg.mjs → platform-auth-protection-BDWO_aER.mjs} +2 -2
  84. package/dist/{platform-auth-recovery-Dxij8ZbR.mjs → platform-auth-recovery-1gg4CSRe.mjs} +3 -3
  85. package/dist/{platform-cmd-E0FuL212.mjs → platform-cmd-Bt-1w6pY.mjs} +1 -1
  86. package/dist/{platform-cmd-B3hwKrFK.mjs → platform-cmd-DMcQStSc.mjs} +24 -3
  87. package/dist/{platform-domain-D6Xcy9ZX.mjs → platform-domain-BNkcz0OB.mjs} +2 -2
  88. package/dist/{platform-lifecycle-k0E0xoxx.mjs → platform-lifecycle-9OyBALhH.mjs} +327 -215
  89. package/dist/{platform-lifecycle-DMh_qrry.mjs → platform-lifecycle-BE6C_jxh.mjs} +1 -1
  90. package/dist/{platform-management-Brz_BDiT.mjs → platform-management-CjwLVQwN.mjs} +6 -3
  91. package/dist/{platform-management-DOtss0BN.mjs → platform-management-CnyTdcWX.mjs} +1 -1
  92. package/dist/platform-plans-config-BNGKGr4P.mjs +359 -0
  93. package/dist/{platform-recovery-BvtcXON5.mjs → platform-recovery-D6KSpuFm.mjs} +2 -2
  94. package/dist/{plugin-inference-BMfKRSqE.mjs → plugin-inference-CXWnn79A.mjs} +174 -64
  95. package/dist/{prepare-C-6YZyyg.mjs → prepare-B5Mkic5u.mjs} +1 -1
  96. package/dist/{prepare-CRhJbVrG.mjs → prepare-DOsL0CC9.mjs} +4 -20
  97. package/dist/prepare-cgvDMtSb.mjs +2 -0
  98. package/dist/{project-cmd-BZLCqOqw.mjs → project-cmd-CNzrqvBv.mjs} +16 -16
  99. package/dist/{project-team-BvgM0WoX.mjs → project-team-DQOWPfQT.mjs} +2 -2
  100. package/dist/{project-token-l5DqK6Az.mjs → project-token-CTDYU0Cc.mjs} +2 -2
  101. package/dist/{project-zero-trust-v6Mvpp8y.mjs → project-zero-trust-BNAkW-_0.mjs} +2 -2
  102. package/dist/{protocol-BBa6cstI.d.mts → protocol-CjF_iI9X.d.mts} +2 -2
  103. package/dist/protocol-U7bfjHmA.mjs +331 -0
  104. package/dist/{provision-Fr9pRqce.mjs → provision-C4ORE7G7.mjs} +1 -1
  105. package/dist/{provision-C4IGqkBf.mjs → provision-CJFgTZY8.mjs} +89 -198
  106. package/dist/{requests-DN-BbNiM.mjs → requests-MhxYnau8.mjs} +2 -2
  107. package/dist/resource-name-C7LVpcRm.mjs +11 -0
  108. package/dist/{rollback-D7rzSaZM.mjs → rollback-CJ6iSDoU.mjs} +3 -3
  109. package/dist/route-url-CG7U-cRN.mjs +15 -0
  110. package/dist/{runner-B8wXwWlo.mjs → runner-CXA9Fh8h.mjs} +1 -1
  111. package/dist/{runner-p-dMs2UN.mjs → runner-Ol0TNjk6.mjs} +2 -2
  112. package/dist/runtime/ai.d.mts +12 -8
  113. package/dist/runtime/ai.mjs +84 -17
  114. package/dist/runtime/better-auth-mysql.mjs +1 -1
  115. package/dist/runtime/better-auth-pg.mjs +1 -1
  116. package/dist/runtime/better-auth.mjs +1 -1
  117. package/dist/runtime/client-react.mjs +2 -2
  118. package/dist/runtime/client-solid.mjs +2 -2
  119. package/dist/runtime/client-svelte.mjs +2 -2
  120. package/dist/runtime/client-vue.mjs +2 -2
  121. package/dist/runtime/client.mjs +2 -2
  122. package/dist/runtime/durable.d.mts +3 -1
  123. package/dist/runtime/durable.mjs +4 -1
  124. package/dist/runtime/email/testing.mjs +1 -1
  125. package/dist/runtime/env-public.d.mts +1 -1
  126. package/dist/runtime/fetch-stream.mjs +1 -1
  127. package/dist/runtime/fetch.mjs +1 -1
  128. package/dist/runtime/handler.d.mts +1 -1
  129. package/dist/runtime/kv.mjs +0 -1
  130. package/dist/runtime/limits.d.mts +2 -0
  131. package/dist/runtime/limits.mjs +2 -0
  132. package/dist/runtime/live-client.d.mts +1 -1
  133. package/dist/runtime/live-server.mjs +25 -16
  134. package/dist/runtime/live.d.mts +1 -1
  135. package/dist/runtime/migration-handler.mjs +62 -42
  136. package/dist/runtime/route-url.d.mts +4 -0
  137. package/dist/runtime/route-url.mjs +2 -0
  138. package/dist/runtime/routing.d.mts +180 -0
  139. package/dist/runtime/routing.mjs +1082 -0
  140. package/dist/runtime/sandbox-container.d.mts +1 -1
  141. package/dist/runtime/sandbox-container.mjs +1 -1
  142. package/dist/runtime/sandbox.d.mts +3 -3
  143. package/dist/runtime/sandbox.mjs +75 -45
  144. package/dist/runtime/sse.mjs +1 -1
  145. package/dist/runtime/validator.d.mts +1 -1
  146. package/dist/runtime/ws-server.d.mts +4 -2
  147. package/dist/runtime/ws-server.mjs +27 -2
  148. package/dist/runtime/ws.d.mts +2 -2
  149. package/dist/runtime/ws.mjs +8 -6
  150. package/dist/{sandbox-qpNBT8a3.d.mts → sandbox-XZAqzFlG.d.mts} +11 -8
  151. package/dist/{sandbox-container-DdNEBfCc.d.mts → sandbox-container-Bo0eiFKz.d.mts} +2 -1
  152. package/dist/{sandbox-container-4fdqLnyb.mjs → sandbox-container-C6ItmVuN.mjs} +4 -2
  153. package/dist/{scan-4tfN-PSn.mjs → scan-C7okrLyM.mjs} +4 -35
  154. package/dist/{secret-BOtOl_cb.mjs → secret-Dli5fP0B.mjs} +4 -4
  155. package/dist/{sse-BaC1jXko.mjs → sse-CQNaDFFV.mjs} +6 -3
  156. package/dist/validate-Dq_L3s0S.mjs +2 -0
  157. package/dist/{validate-CIUwFpjB.mjs → validate-ctOrgiS3.mjs} +2 -1
  158. package/dist/{wrangler-DQF1vKyf.mjs → wrangler-7K-bW_DL.mjs} +8 -239
  159. package/dist/{ws-BoY7vQML.d.mts → ws-CL1w7GXU.d.mts} +13 -2
  160. package/package.json +15 -8
  161. package/skills/migrate-vite-cloudflare-to-void/SKILL.md +34 -157
  162. package/skills/void/SKILL.md +50 -135
  163. package/skills/void/docs/guide/ai.md +94 -84
  164. package/skills/void/docs/guide/app-types.md +3 -32
  165. package/skills/void/docs/guide/auth.md +12 -116
  166. package/skills/void/docs/guide/database/d1.md +9 -54
  167. package/skills/void/docs/guide/database/mysql.md +1 -1
  168. package/skills/void/docs/guide/database/postgresql.md +5 -26
  169. package/skills/void/docs/guide/database.md +23 -75
  170. package/skills/void/docs/guide/deployment.md +27 -113
  171. package/skills/void/docs/guide/durable-state.md +43 -18
  172. package/skills/void/docs/guide/edge/headers.md +3 -47
  173. package/skills/void/docs/guide/edge/prerendering.md +5 -20
  174. package/skills/void/docs/guide/edge/redirects.md +11 -64
  175. package/skills/void/docs/guide/edge/revalidation.md +5 -18
  176. package/skills/void/docs/guide/edge/rewrites.md +56 -284
  177. package/skills/void/docs/guide/edge/static-assets.md +22 -72
  178. package/skills/void/docs/guide/email/domains.md +112 -0
  179. package/skills/void/docs/guide/email/receiving.md +139 -0
  180. package/skills/void/docs/guide/email/sending.md +231 -0
  181. package/skills/void/docs/guide/email.md +13 -619
  182. package/skills/void/docs/guide/env-migration.md +11 -11
  183. package/skills/void/docs/guide/env-vars.md +9 -29
  184. package/skills/void/docs/guide/index.md +0 -15
  185. package/skills/void/docs/guide/jobs.md +3 -18
  186. package/skills/void/docs/guide/kv.md +5 -11
  187. package/skills/void/docs/guide/live.md +5 -56
  188. package/skills/void/docs/guide/pages-routing/actions-and-forms.md +78 -125
  189. package/skills/void/docs/guide/pages-routing/head.md +10 -10
  190. package/skills/void/docs/guide/pages-routing/islands.md +6 -36
  191. package/skills/void/docs/guide/pages-routing/layouts.md +6 -128
  192. package/skills/void/docs/guide/pages-routing/loaders.md +3 -19
  193. package/skills/void/docs/guide/pages-routing/markdown.md +13 -171
  194. package/skills/void/docs/guide/pages-routing/overview.md +7 -17
  195. package/skills/void/docs/guide/pages-routing/view-transitions.md +1 -1
  196. package/skills/void/docs/guide/platform/administration/access.md +1 -4
  197. package/skills/void/docs/guide/platform/administration/email.md +35 -8
  198. package/skills/void/docs/guide/platform/administration/operations.md +26 -4
  199. package/skills/void/docs/guide/platform/administration/plans.md +126 -0
  200. package/skills/void/docs/guide/platform/administration/projects.md +5 -2
  201. package/skills/void/docs/guide/platform/administration/zero-trust.md +23 -152
  202. package/skills/void/docs/guide/platform/development/runtime.md +3 -13
  203. package/skills/void/docs/guide/platform/development/schema-ci.md +0 -58
  204. package/skills/void/docs/guide/platform/installation/credentials.md +6 -4
  205. package/skills/void/docs/guide/platform/installation/domains.md +30 -2
  206. package/skills/void/docs/guide/platform/installation/first-deployment.md +2 -0
  207. package/skills/void/docs/guide/platform/installation/maintenance.md +3 -1
  208. package/skills/void/docs/guide/platform/installation/prerequisites.md +20 -15
  209. package/skills/void/docs/guide/platform/installation/setup.md +9 -5
  210. package/skills/void/docs/guide/platform-administration.md +1 -0
  211. package/skills/void/docs/guide/queues.md +7 -9
  212. package/skills/void/docs/guide/quickstart.md +38 -37
  213. package/skills/void/docs/guide/remote-dev.md +4 -9
  214. package/skills/void/docs/guide/sandboxes.md +29 -21
  215. package/skills/void/docs/guide/server-routing.md +9 -72
  216. package/skills/void/docs/guide/sse.md +4 -18
  217. package/skills/void/docs/guide/ssg.md +3 -15
  218. package/skills/void/docs/guide/ssr.md +14 -62
  219. package/skills/void/docs/guide/storage.md +9 -4
  220. package/skills/void/docs/guide/type-safety.md +3 -14
  221. package/skills/void/docs/guide/typed-fetch.md +3 -7
  222. package/skills/void/docs/guide/websockets.md +68 -40
  223. package/skills/void/docs/integrations/agents.md +3 -3
  224. package/skills/void/docs/integrations/cloudflare.md +85 -316
  225. package/skills/void/docs/integrations/frameworks/analog.md +5 -64
  226. package/skills/void/docs/integrations/frameworks/astro.md +4 -73
  227. package/skills/void/docs/integrations/frameworks/nuxt.md +5 -62
  228. package/skills/void/docs/integrations/frameworks/overview.md +11 -54
  229. package/skills/void/docs/integrations/frameworks/react-router.md +5 -60
  230. package/skills/void/docs/integrations/frameworks/sveltekit.md +6 -65
  231. package/skills/void/docs/integrations/frameworks/tanstack-start.md +4 -62
  232. package/skills/void/docs/integrations/nodejs-bun-deno.md +5 -69
  233. package/skills/void/docs/reference/api/auth.md +156 -0
  234. package/skills/void/docs/reference/api/client.md +87 -0
  235. package/skills/void/docs/reference/api/database.md +95 -0
  236. package/skills/void/docs/reference/api/durable.md +46 -0
  237. package/skills/void/docs/reference/api/env.md +50 -0
  238. package/skills/void/docs/reference/api/handlers.md +254 -0
  239. package/skills/void/docs/reference/api/pages.md +241 -0
  240. package/skills/void/docs/reference/api/plugin.md +39 -0
  241. package/skills/void/docs/reference/api/resources.md +109 -0
  242. package/skills/void/docs/reference/api/rewrites.md +76 -0
  243. package/skills/void/docs/reference/api/types.md +92 -0
  244. package/skills/void/docs/reference/api.md +56 -1218
  245. package/skills/void/docs/reference/cli/auth.md +88 -0
  246. package/skills/void/docs/reference/cli/database.md +128 -0
  247. package/skills/void/docs/reference/cli/deploy.md +85 -0
  248. package/skills/void/docs/reference/cli/domains.md +41 -0
  249. package/skills/void/docs/reference/cli/email.md +129 -0
  250. package/skills/void/docs/reference/cli/generate.md +116 -0
  251. package/skills/void/docs/reference/cli/github.md +189 -0
  252. package/skills/void/docs/reference/cli/platform-config.md +92 -0
  253. package/skills/void/docs/reference/cli/platform-email.md +81 -0
  254. package/skills/void/docs/reference/cli/platform-installation.md +127 -0
  255. package/skills/void/docs/reference/cli/platform-operations.md +90 -0
  256. package/skills/void/docs/reference/cli/platform-users.md +89 -0
  257. package/skills/void/docs/reference/cli/platform-zero-trust.md +45 -0
  258. package/skills/void/docs/reference/cli/platform.md +70 -0
  259. package/skills/void/docs/reference/cli/project.md +214 -0
  260. package/skills/void/docs/reference/cli/secrets.md +76 -0
  261. package/skills/void/docs/reference/cli/setup.md +70 -0
  262. package/skills/void/docs/reference/cli.md +32 -1682
  263. package/skills/void/docs/reference/config.md +12 -18
  264. package/skills/void/docs/reference/resource-inference.md +3 -58
  265. package/skills/void/docs/reference/structure.md +14 -41
  266. package/dist/canonical-json-DuDiiUsQ.mjs +0 -13
  267. package/dist/client-Czz8o5jP.mjs +0 -2
  268. package/dist/gen-CNJ62MM7.mjs +0 -2
  269. package/dist/help-CmZzxUba.mjs +0 -2
  270. package/dist/login-CGcRKEoi.mjs +0 -2
  271. package/dist/migrate-CYfbKkXh.mjs +0 -2
  272. package/dist/plan-BEZ8VJW0.mjs +0 -256
  273. package/dist/plan-DpuOr14e.mjs +0 -2
  274. package/dist/prepare-Bm3iq-u4.mjs +0 -2
  275. package/dist/validate-EKmJWxmy.mjs +0 -2
  276. /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 { V as persistCloudflareConfig, _ as readProvisionedBindingEntry, k as writeProvisionedWranglerConfig, s as assertNoDuplicateMembers } from "./wrangler-DQF1vKyf.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";
@@ -598,11 +599,10 @@ function armRetentionWatchdog(lock, info) {
598
599
  };
599
600
  }
600
601
  /**
601
- * Default `runWrangler`: resolves the project-local wrangler as an ARGV launcher
602
- * via Task 2's {@link resolveWranglerArgv} and runs it with `spawn` and
603
- * `shell: false`, so every argument is passed literally (no shell parsing → no
604
- * injection). Captures stdout (for `--json` parsing) and stderr (for
605
- * 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.
606
606
  *
607
607
  * ASYNC (returns a Promise). `spawn` + `await` (vs. the old blocking
608
608
  * `spawnSync`) keeps the Node event loop free while wrangler runs, so
@@ -612,7 +612,7 @@ function armRetentionWatchdog(lock, info) {
612
612
  * {@link COMMAND_TIMEOUT_MS} SIGKILL guards against a hung child.
613
613
  */
614
614
  function createDefaultRunWrangler(root, options) {
615
- const launcher = options?.launcher ?? resolveWranglerArgv(root);
615
+ const launcher = options?.launcher ?? resolveCloudflareOperationArgv(root);
616
616
  const timeoutMs = options?.timeoutMs ?? COMMAND_TIMEOUT_MS;
617
617
  const confirmGraceMs = options?.confirmKillGraceMs ?? CONFIRM_KILL_GRACE_MS;
618
618
  const killProcessGroup = options?.killProcessGroup ?? ((target, signal) => process.kill(target, signal));
@@ -620,7 +620,7 @@ function createDefaultRunWrangler(root, options) {
620
620
  const isWindows = process.platform === "win32";
621
621
  const teardownDeadlineMs = options?.signalTeardownDeadlineMs ?? confirmGraceMs + SIGNAL_TEARDOWN_DEADLINE_MARGIN_MS;
622
622
  return (args, opts) => new Promise((resolvePromise, rejectPromise) => {
623
- const parallelWorkerUpload = options?.parallelWorkerUpload === true && args[0] === "versions" && args[1] === "upload";
623
+ const parallelWorkerUpload = options?.parallelWorkerUpload === true && args.type === "versions.upload";
624
624
  if (activeTeardown !== void 0) {
625
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.`));
626
626
  return;
@@ -629,7 +629,7 @@ function createDefaultRunWrangler(root, options) {
629
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)."));
630
630
  return;
631
631
  }
632
- const child = spawn(command, [...prefix, ...args], {
632
+ const child = spawn(command, [...prefix, ...encodeCloudflareOperation(args)], {
633
633
  cwd: opts.cwd ?? root,
634
634
  shell: false,
635
635
  env: {
@@ -640,7 +640,7 @@ function createDefaultRunWrangler(root, options) {
640
640
  ...opts.suppressLogs ? { WRANGLER_WRITE_LOGS: "false" } : {}
641
641
  },
642
642
  stdio: [
643
- "ignore",
643
+ opts.input === void 0 ? "ignore" : "pipe",
644
644
  "pipe",
645
645
  "pipe"
646
646
  ],
@@ -721,7 +721,7 @@ function createDefaultRunWrangler(root, options) {
721
721
  settled = true;
722
722
  clearTimeout(commandTimer);
723
723
  deregisterSelf();
724
- resolvePromise(result);
724
+ resolvePromise(decodeCloudflareOperationResult(result));
725
725
  };
726
726
  const quarantine = (detail) => {
727
727
  if (settled) return;
@@ -794,7 +794,7 @@ function createDefaultRunWrangler(root, options) {
794
794
  signal: "SIGKILL"
795
795
  }), `the timeout SIGKILL (${timeoutStderr()})`);
796
796
  }, timeoutMs);
797
- child.on("error", (error) => {
797
+ const handleProcessError = (error) => {
798
798
  if (!spawned && typeof child.pid !== "number") {
799
799
  finish(normalizeRunWranglerResult({
800
800
  stdout,
@@ -820,7 +820,9 @@ function createDefaultRunWrangler(root, options) {
820
820
  status: null,
821
821
  signal: "SIGKILL"
822
822
  }), `a post-spawn child error (${error.message}; the group was SIGKILLed)`);
823
- });
823
+ };
824
+ child.on("error", handleProcessError);
825
+ child.stdin?.on("error", handleProcessError);
824
826
  child.on("close", (code, signal) => {
825
827
  closed = true;
826
828
  if (timedOut || postSpawnError !== void 0) {
@@ -849,6 +851,7 @@ function createDefaultRunWrangler(root, options) {
849
851
  });
850
852
  registerRunner(registrant, parallelWorkerUpload);
851
853
  options?.onSpawnedChild?.(child);
854
+ if (opts.input !== void 0) child.stdin?.end(opts.input);
852
855
  });
853
856
  }
854
857
  /**
@@ -895,7 +898,7 @@ function isCleanSuccess(result) {
895
898
  * classified for a resource-specific not-found signal.
896
899
  */
897
900
  function isCleanFailure(result) {
898
- return !isHardFailure(result) && typeof result.status === "number" && result.status !== 0;
901
+ return !isHardFailure(result) && Number.isSafeInteger(result.status) && result.status > 0;
899
902
  }
900
903
  /**
901
904
  * The OVERALL deadline for the Hyperdrive existence lister (across ALL its paginated
@@ -1421,29 +1424,12 @@ async function acquireProvisionLock(configPath, lockOptions) {
1421
1424
  * like "absent", minting a duplicate). Used everywhere an empty list must mean
1422
1425
  * "authoritatively absent" and garbage must NOT be coerced to "absent".
1423
1426
  */
1424
- function parseJsonArrayStrict(stdout) {
1425
- const value = parseJsonLoose(stdout);
1427
+ function parseJsonArrayStrict(value) {
1426
1428
  return Array.isArray(value) ? value : void 0;
1427
1429
  }
1428
- /** Parse a wrangler `--json` stdout into an object, tolerating noise/failure. */
1429
- function parseJsonObject(stdout) {
1430
- const value = parseJsonLoose(stdout);
1430
+ function parseJsonObject(value) {
1431
1431
  return isRecord(value) ? value : void 0;
1432
1432
  }
1433
- /**
1434
- * wrangler may print human banners before the JSON payload; slice from the
1435
- * first `{`/`[` so a leading banner does not break `JSON.parse`.
1436
- */
1437
- function parseJsonLoose(stdout) {
1438
- const trimmed = stdout.trim();
1439
- const start = trimmed.search(/[[{]/);
1440
- if (start === -1) return;
1441
- try {
1442
- return JSON.parse(trimmed.slice(start));
1443
- } catch {
1444
- return;
1445
- }
1446
- }
1447
1433
  function isRecord(value) {
1448
1434
  return typeof value === "object" && value !== null && !Array.isArray(value);
1449
1435
  }
@@ -1476,17 +1462,13 @@ function readRootConfig(configPath) {
1476
1462
  if (!isRecord(parsed)) throw new Error(`provision: "${configPath}" must be a JSON object.`);
1477
1463
  return parsed;
1478
1464
  }
1479
- /** Escape a string for literal embedding in a `RegExp`. */
1480
- function escapeRegExp(value) {
1481
- return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1482
- }
1483
1465
  /**
1484
1466
  * FAIL-CLOSED gate over a discovery/list/info result. Throws (no create) unless
1485
1467
  * the child exited cleanly — a NUMERIC `status === 0`. Because
1486
1468
  * {@link normalizeRunWranglerResult} already folds a signal-killed child or a
1487
1469
  * spawn error into a non-zero status, a single numeric check here rejects ALL of
1488
1470
  * nonzero-exit / SIGTERM / spawn-error / non-numeric status. MUST be called
1489
- * BEFORE parsing stdout, so a failed result can never be parsed as "absent".
1471
+ * BEFORE reading provider data, so failed discovery never implies absence.
1490
1472
  */
1491
1473
  function assertDiscoverySucceeded(result, label) {
1492
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.`);
@@ -1582,8 +1564,7 @@ function extractKvMatches(list, title) {
1582
1564
  }
1583
1565
  /** True when a `d1 create` failure means the name is already taken (code 7502). */
1584
1566
  function isAlreadyExistsError(result) {
1585
- const text = `${result.stdout}\n${result.stderr}`;
1586
- return text.includes("7502") || /already exists/i.test(text);
1567
+ return result.errorCode === 7502;
1587
1568
  }
1588
1569
  /**
1589
1570
  * EXACT, name-aware not-found classifier shared by R2 + queues. Given a
@@ -1594,43 +1575,16 @@ function isAlreadyExistsError(result) {
1594
1575
  * GENERIC "not found" (e.g. `Account not found`) is NEVER treated as absence,
1595
1576
  * which would mint a duplicate resource.
1596
1577
  */
1597
- function isConfirmedAbsent(result, kind, name) {
1598
- if (!isCleanFailure(result)) return false;
1599
- const text = `${result.stdout}\n${result.stderr}`;
1600
- switch (kind) {
1601
- case "r2": return /\[code:\s*10006\]/.test(text);
1602
- case "queue": return new RegExp(`Queue\\s+"${escapeRegExp(name)}"\\s+does not exist`, "i").test(text);
1603
- }
1578
+ function isConfirmedAbsent(result, kind, _name) {
1579
+ return isCleanFailure(result) && (kind === "r2" ? result.errorCode === 10006 : result.failure === "not-found");
1604
1580
  }
1605
- /**
1606
- * A `wrangler queues info <name>` result POSITIVELY confirms THIS queue does NOT
1607
- * exist in the account. Narrow, queue-only view of {@link isConfirmedAbsent}, shared
1608
- * with the deploy orchestrator's pre-build queue probe (`cli/deploy.ts`) so both call
1609
- * sites classify the SAME wrangler output the SAME way. Only the exact, name-aware
1610
- * `Queue "<name>" does not exist` on a clean non-zero exit returns `true`; every other
1611
- * outcome (success, signal/spawn failure, auth or network error, generic "not found")
1612
- * returns `false` and is left for the caller to treat as inconclusive.
1613
- */
1581
+ /** Only a completed, typed not-found response confirms queue absence. */
1614
1582
  function isQueueConfirmedAbsent(result, name) {
1615
1583
  return isConfirmedAbsent(result, "queue", name);
1616
1584
  }
1617
- /**
1618
- * A `wrangler queues info <name>` result POSITIVELY confirms THIS queue
1619
- * exists. Queues write NO config, so a create cannot be verified by re-reading the
1620
- * config (the D1/KV/R2/Hyperdrive backstop). And wrangler's `bin.wrangler` wrapper
1621
- * maps a signal-killed inner CLI to `process.exit(0)` (`bin/wrangler.js`:
1622
- * `code === null → exit(0)`), so a KILLED probe/create can surface a clean exit 0
1623
- * with empty/partial output. A bare clean 0 is therefore NOT proof the queue exists.
1624
- * We require BOTH a clean success (numeric exit 0, no signal/spawn error — the
1625
- * provenance rule) AND the output to name THIS exact queue: wrangler 4.131's
1626
- * `queues info` prints `Queue Name: <queue_name>` for the queue it fetched by name
1627
- * (account-unique), so an exact `Queue Name: <name>` line is the positive signal.
1628
- * Used for BOTH the reuse probe and the post-create verify probe.
1629
- */
1585
+ /** Reuse and post-create verification require clean success and the exact returned name. */
1630
1586
  function queueInfoConfirmsExists(result, name) {
1631
- if (!isCleanSuccess(result)) return false;
1632
- const text = `${result.stdout}\n${result.stderr}`;
1633
- return new RegExp(`^Queue Name:\\s+${escapeRegExp(name)}\\s*$`, "m").test(text);
1587
+ return isCleanSuccess(result) && isRecord(result.data) && result.data.name === name;
1634
1588
  }
1635
1589
  /**
1636
1590
  * Throw when the writer could not attach `migrations_dir` because no matching
@@ -1733,29 +1687,6 @@ function assertValidResourceName(kind, name) {
1733
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.`);
1734
1688
  }
1735
1689
  /**
1736
- * The trailing flags EVERY provisioner wrangler invocation MUST carry, built
1737
- * ONCE so no call site can forget them:
1738
- * - `-c <configPath>` pins the ONE resolved config (no split-brain reads/writes);
1739
- * - `--env=` (an explicit EMPTY environment) FORCES wrangler onto the top-level
1740
- * config environment. wrangler 4.131 selects its config env as
1741
- * `args.env ?? getCloudflareEnv()`; passing an explicit empty `args.env`
1742
- * short-circuits the `??` so a project `.env`/`.env.local` that sets
1743
- * `CLOUDFLARE_ENV` (reloaded into `process.env` on every wrangler command)
1744
- * can NEVER reselect a named `env.*` block — whose `account_id`/bindings could
1745
- * differ from the single account this provision resolved, patched, and pinned.
1746
- * `--env=` is wrangler's own documented sentinel for "use the top-level
1747
- * environment" (it prints exactly this guidance when multiple env blocks exist).
1748
- * Discovery/create AND `--update-config` therefore all operate on the SAME
1749
- * top-level config/account.
1750
- */
1751
- function wranglerConfigArgs(configPath) {
1752
- return [
1753
- "-c",
1754
- configPath,
1755
- "--env="
1756
- ];
1757
- }
1758
- /**
1759
1690
  * Build a redactor that strips connection-string secrets from every string the
1760
1691
  * provisioner PROPAGATES (buffered wrangler stdout/stderr, error strings, logged
1761
1692
  * warnings). Two layers:
@@ -2156,14 +2087,12 @@ async function reconcileD1(desired, configPath, runWrangler, write, persistCreat
2156
2087
  id: entry.database_id
2157
2088
  });
2158
2089
  } else {
2159
- const listResult = await runWrangler([
2160
- "d1",
2161
- "list",
2162
- "--json",
2163
- ...wranglerConfigArgs(configPath)
2164
- ], { captureJson: true });
2090
+ const listResult = await runWrangler({
2091
+ type: "d1.list",
2092
+ configPath
2093
+ }, {});
2165
2094
  assertDiscoverySucceeded(listResult, "wrangler d1 list");
2166
- const rawList = parseJsonArrayStrict(listResult.stdout);
2095
+ const rawList = parseJsonArrayStrict(listResult.data);
2167
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.`);
2168
2097
  const claimants = validateResourceList(rawList, {
2169
2098
  resource: "D1 database",
@@ -2197,15 +2126,12 @@ async function reconcileD1(desired, configPath, runWrangler, write, persistCreat
2197
2126
  id: existing.id
2198
2127
  });
2199
2128
  } else {
2200
- const created = await runWrangler([
2201
- "d1",
2202
- "create",
2129
+ const created = await runWrangler({
2130
+ type: "d1.create",
2203
2131
  name,
2204
- "--binding",
2205
2132
  binding,
2206
- "--update-config",
2207
- ...wranglerConfigArgs(configPath)
2208
- ]);
2133
+ configPath
2134
+ });
2209
2135
  if (isCleanSuccess(created)) {
2210
2136
  assertCreateWroteRealId(configPath, {
2211
2137
  field: "d1_databases",
@@ -2227,15 +2153,13 @@ async function reconcileD1(desired, configPath, runWrangler, write, persistCreat
2227
2153
  action: "created"
2228
2154
  });
2229
2155
  } else if (isCleanFailure(created) && isAlreadyExistsError(created)) {
2230
- const infoResult = await runWrangler([
2231
- "d1",
2232
- "info",
2156
+ const infoResult = await runWrangler({
2157
+ type: "d1.info",
2233
2158
  name,
2234
- "--json",
2235
- ...wranglerConfigArgs(configPath)
2236
- ], { captureJson: true });
2159
+ configPath
2160
+ }, {});
2237
2161
  assertDiscoverySucceeded(infoResult, `wrangler d1 info ${name}`);
2238
- const info = normalizeD1(parseJsonObject(infoResult.stdout), name);
2162
+ const info = normalizeD1(parseJsonObject(infoResult.data), name);
2239
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.`);
2240
2164
  log.info(`adopted existing D1 database ${name} (${info.id})`);
2241
2165
  assertD1MigrationsDirApplied(write({
@@ -2270,21 +2194,11 @@ async function reconcileD1(desired, configPath, runWrangler, write, persistCreat
2270
2194
  else {
2271
2195
  let token = opts?.apiToken ?? process.env.CLOUDFLARE_API_TOKEN;
2272
2196
  if (!token) {
2273
- const auth = await runWrangler([
2274
- "auth",
2275
- "token",
2276
- "--json",
2277
- ...wranglerConfigArgs(configPath)
2278
- ], {
2279
- captureJson: true,
2280
- suppressLogs: true
2281
- });
2282
- const start = auth.stdout.indexOf("{");
2283
- const end = auth.stdout.lastIndexOf("}");
2284
- let parsed;
2285
- if (isCleanSuccess(auth) && start >= 0 && end > start) try {
2286
- parsed = JSON.parse(auth.stdout.slice(start, end + 1));
2287
- } 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;
2288
2202
  if ((parsed?.type === "oauth" || parsed?.type === "api_token") && typeof parsed.token === "string") token = parsed.token;
2289
2203
  }
2290
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.");
@@ -2305,14 +2219,12 @@ async function reconcileKv(desired, configPath, runWrangler, write, persistCreat
2305
2219
  });
2306
2220
  continue;
2307
2221
  }
2308
- const listResult = await runWrangler([
2309
- "kv",
2310
- "namespace",
2311
- "list",
2312
- ...wranglerConfigArgs(configPath)
2313
- ], { captureJson: true });
2222
+ const listResult = await runWrangler({
2223
+ type: "kv.namespace.list",
2224
+ configPath
2225
+ }, {});
2314
2226
  assertDiscoverySucceeded(listResult, "wrangler kv namespace list");
2315
- const rawList = parseJsonArrayStrict(listResult.stdout);
2227
+ const rawList = parseJsonArrayStrict(listResult.data);
2316
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.`);
2317
2229
  const matches = extractKvMatches(validateResourceList(rawList, {
2318
2230
  resource: "KV namespace",
@@ -2338,16 +2250,12 @@ async function reconcileKv(desired, configPath, runWrangler, write, persistCreat
2338
2250
  id: chosen.id
2339
2251
  });
2340
2252
  } else {
2341
- const created = await runWrangler([
2342
- "kv",
2343
- "namespace",
2344
- "create",
2345
- title,
2346
- "--binding",
2253
+ const created = await runWrangler({
2254
+ type: "kv.namespace.create",
2255
+ name: title,
2347
2256
  binding,
2348
- "--update-config",
2349
- ...wranglerConfigArgs(configPath)
2350
- ]);
2257
+ configPath
2258
+ });
2351
2259
  if (!isCleanSuccess(created)) throw new Error(`provision: "wrangler kv namespace create ${title}" failed: ${created.stderr || created.stdout}`);
2352
2260
  assertCreateWroteRealId(configPath, {
2353
2261
  field: "kv_namespaces",
@@ -2380,16 +2288,13 @@ async function reconcileR2(desired, configPath, runWrangler, write, persistCreat
2380
2288
  action: "reused"
2381
2289
  });
2382
2290
  } else {
2383
- const info = await runWrangler([
2384
- "r2",
2385
- "bucket",
2386
- "info",
2387
- bucketName,
2388
- "--json",
2389
- ...wranglerConfigArgs(configPath)
2390
- ], { captureJson: true });
2291
+ const info = await runWrangler({
2292
+ type: "r2.bucket.info",
2293
+ name: bucketName,
2294
+ configPath
2295
+ }, {});
2391
2296
  if (isCleanSuccess(info)) {
2392
- const payload = parseJsonObject(info.stdout);
2297
+ const payload = parseJsonObject(info.data);
2393
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}`);
2394
2299
  log.info(`adopted existing R2 bucket ${bucketName}`);
2395
2300
  write({ r2: {
@@ -2403,16 +2308,12 @@ async function reconcileR2(desired, configPath, runWrangler, write, persistCreat
2403
2308
  action: "adopted"
2404
2309
  });
2405
2310
  } else if (isConfirmedAbsent(info, "r2", bucketName)) {
2406
- const created = await runWrangler([
2407
- "r2",
2408
- "bucket",
2409
- "create",
2410
- bucketName,
2411
- "--binding",
2311
+ const created = await runWrangler({
2312
+ type: "r2.bucket.create",
2313
+ name: bucketName,
2412
2314
  binding,
2413
- "--update-config",
2414
- ...wranglerConfigArgs(configPath)
2415
- ]);
2315
+ configPath
2316
+ });
2416
2317
  if (!isCleanSuccess(created)) throw new Error(`provision: "wrangler r2 bucket create ${bucketName}" failed: ${created.stderr || created.stdout}`);
2417
2318
  assertCreateWroteRealId(configPath, {
2418
2319
  field: "r2_buckets",
@@ -2423,15 +2324,12 @@ async function reconcileR2(desired, configPath, runWrangler, write, persistCreat
2423
2324
  command: "wrangler r2 bucket create"
2424
2325
  }, binding, bucketName);
2425
2326
  if (bucketName === R2_BUCKET_NAME_PLACEHOLDER) {
2426
- const verify = await runWrangler([
2427
- "r2",
2428
- "bucket",
2429
- "info",
2430
- bucketName,
2431
- "--json",
2432
- ...wranglerConfigArgs(configPath)
2433
- ], { captureJson: true });
2434
- 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;
2435
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.`);
2436
2334
  }
2437
2335
  persistCreatedConfig();
@@ -2500,16 +2398,12 @@ async function reconcileHyperdrive(desired, configPath, runWrangler, write, pers
2500
2398
  });
2501
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.`);
2502
2400
  else {
2503
- const created = await runWrangler([
2504
- "hyperdrive",
2505
- "create",
2401
+ const created = await runWrangler({
2402
+ type: "hyperdrive.create",
2506
2403
  name,
2507
- `--connection-string=${connectionString}`,
2508
- "--binding",
2509
2404
  binding,
2510
- "--update-config",
2511
- ...wranglerConfigArgs(configPath)
2512
- ]);
2405
+ configPath
2406
+ }, { input: connectionString });
2513
2407
  if (!isCleanSuccess(created)) throw new Error(`provision: "wrangler hyperdrive create ${name}" failed: ${created.stderr || created.stdout}`);
2514
2408
  assertCreateWroteRealId(configPath, {
2515
2409
  field: "hyperdrive",
@@ -2531,12 +2425,11 @@ async function reconcileHyperdrive(desired, configPath, runWrangler, write, pers
2531
2425
  }
2532
2426
  async function reconcileQueues(desired, configPath, runWrangler, resources) {
2533
2427
  for (const name of desired.queues) {
2534
- const info = await runWrangler([
2535
- "queues",
2536
- "info",
2428
+ const info = await runWrangler({
2429
+ type: "queues.info",
2537
2430
  name,
2538
- ...wranglerConfigArgs(configPath)
2539
- ]);
2431
+ configPath
2432
+ });
2540
2433
  if (queueInfoConfirmsExists(info, name)) {
2541
2434
  resources.push({
2542
2435
  kind: "queue",
@@ -2546,19 +2439,17 @@ async function reconcileQueues(desired, configPath, runWrangler, resources) {
2546
2439
  continue;
2547
2440
  }
2548
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"}`);
2549
- const created = await runWrangler([
2550
- "queues",
2551
- "create",
2442
+ const created = await runWrangler({
2443
+ type: "queues.create",
2552
2444
  name,
2553
- ...wranglerConfigArgs(configPath)
2554
- ]);
2445
+ configPath
2446
+ });
2555
2447
  if (!isCleanSuccess(created)) throw new Error(`provision: "wrangler queues create ${name}" failed: ${created.stderr || created.stdout}`);
2556
- if (!queueInfoConfirmsExists(await runWrangler([
2557
- "queues",
2558
- "info",
2448
+ if (!queueInfoConfirmsExists(await runWrangler({
2449
+ type: "queues.info",
2559
2450
  name,
2560
- ...wranglerConfigArgs(configPath)
2561
- ]), 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.`);
2562
2453
  resources.push({
2563
2454
  kind: "queue",
2564
2455
  name,
@@ -1,7 +1,7 @@
1
- import { c as getToken } from "./auth-DLNN0D3Z.mjs";
1
+ import { c as getToken } from "./auth-CSkdO2Bb.mjs";
2
2
  import { o as readProjectConfig } from "./project-C0Fqu05O.mjs";
3
3
  import { O as intro, P as outro, j as log } from "./dist-CTBk70IR.mjs";
4
- import { n as PlatformClient } from "./client-BTZ3XkrB.mjs";
4
+ import { n as PlatformClient } from "./client-RV8NVeB8.mjs";
5
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) {
@@ -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,7 +1,7 @@
1
- import { c as getToken } from "./auth-DLNN0D3Z.mjs";
1
+ import { c as getToken } from "./auth-CSkdO2Bb.mjs";
2
2
  import { i as readDeploymentPlatform, o as readProjectConfig } from "./project-C0Fqu05O.mjs";
3
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-BTZ3XkrB.mjs";
4
+ import { n as PlatformClient } from "./client-RV8NVeB8.mjs";
5
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) {
@@ -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-BT6OWFBk.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);
@@ -0,0 +1,15 @@
1
+ //#region src/runtime/route-url.ts
2
+ /** Expand complete route tokens without changing query strings or fragments. */
3
+ function interpolateRouteParams(path, params) {
4
+ if (!params) return path;
5
+ const suffixIndex = path.search(/[?#]/);
6
+ const pathname = suffixIndex === -1 ? path : path.slice(0, suffixIndex);
7
+ const suffix = suffixIndex === -1 ? "" : path.slice(suffixIndex);
8
+ return pathname.replace(/(^|\/):([^/{}]+)(\{\.\+\})?(?=\/|$)/g, (token, prefix, name, catchAll) => {
9
+ if (!Object.hasOwn(params, name)) return token;
10
+ const value = params[name];
11
+ return prefix + (catchAll ? value.split("/").map(encodeURIComponent).join("/") : encodeURIComponent(value));
12
+ }) + suffix;
13
+ }
14
+ //#endregion
15
+ export { interpolateRouteParams as t };
@@ -1,2 +1,2 @@
1
- import { i as openSqliteDatabase, n as getAppliedMigrations, o as runMigrations, r as getMiniflareDatabasePath, t as getApplicationTables } from "./runner-p-dMs2UN.mjs";
1
+ import { i as openSqliteDatabase, n as getAppliedMigrations, o as runMigrations, r as getMiniflareDatabasePath, t as getApplicationTables } from "./runner-Ol0TNjk6.mjs";
2
2
  export { getApplicationTables, getAppliedMigrations, getMiniflareDatabasePath, openSqliteDatabase, runMigrations };
@@ -1,7 +1,7 @@
1
1
  import { a as join, n as dirname } from "./dist-BVqXeR_h.mjs";
2
- import { n as hasPackageDependency, r as readNearestPackageJson } from "./package-json-DXfiT1jV.mjs";
3
2
  import { t as collectMigrations } from "./collect-DiTn9yr6.mjs";
4
- import { a as classifyMigration } from "./plan-BEZ8VJW0.mjs";
3
+ import { n as hasPackageDependency, r as readNearestPackageJson } from "./package-json-DXfiT1jV.mjs";
4
+ import { r as classifyMigration } from "./plan-NPpwZ_kc.mjs";
5
5
  import { existsSync, mkdirSync } from "node:fs";
6
6
  import { createHash, createHmac } from "node:crypto";
7
7
  //#region src/migrations/runner.ts
@@ -1,3 +1,4 @@
1
+ import { n as LimitOperation } from "../limits-Bq5LG8Id.mjs";
1
2
  //#region src/runtime/ai-types.d.ts
2
3
  type AiProviderName = "openai" | "anthropic" | "google-ai-studio" | "groq" | "mistral" | "grok" | "deepseek" | "openrouter" | "perplexity" | "cohere" | "cerebras" | "huggingface" | "replicate" | "baseten" | "cartesia" | "deepgram" | "elevenlabs" | "fal" | "ideogram" | "parallel";
3
4
  type AiProvider = AiProviderName | (string & {});
@@ -24,23 +25,26 @@ type AiProviderFetchInit = {
24
25
  * `stream()` calls `ai.run()` with `stream: true` and wraps the result
25
26
  * in a `Response` with SSE headers — ready to return from a route handler.
26
27
  */
27
- export type VoidAi = Omit<Ai, "run"> & {
28
+ export type VoidAi = {
29
+ models(...args: Parameters<Ai["models"]>): LimitOperation<Awaited<ReturnType<Ai["models"]>>>;
30
+ toMarkdown(files: Array<Parameters<Ai["toMarkdown"]>[0]>, options?: Parameters<Ai["toMarkdown"]>[1]): LimitOperation<Array<Awaited<ReturnType<Ai["toMarkdown"]>>>>;
31
+ toMarkdown(...args: Parameters<Ai["toMarkdown"]>): LimitOperation<Awaited<ReturnType<Ai["toMarkdown"]>>>;
28
32
  /** Workers AI inference (existing) */
29
- run<Name extends keyof AiModels>(model: Name, inputs: AiModels[Name]["inputs"], options?: AiOptions): Promise<AiModels[Name]["postProcessedOutputs"]>;
33
+ run<Name extends keyof AiModels>(model: Name, inputs: AiModels[Name]["inputs"], options?: AiOptions): LimitOperation<AiModels[Name]["postProcessedOutputs"]>;
30
34
  /** Cloudflare AI Gateway model inference. Accepts Cloudflare model IDs unchanged. */
31
- run(model: string, inputs: unknown, options?: AiOptions): Promise<unknown>;
35
+ run(model: string, inputs: unknown, options?: AiOptions): LimitOperation<unknown>;
32
36
  /** Image generation. Returns the proxy response so callers can return or parse it. */
33
- image<Name extends keyof AiModels>(model: Name, inputs: AiModels[Name]["inputs"], options?: AiOptions): Promise<Response>;
37
+ image<Name extends keyof AiModels>(model: Name, inputs: AiModels[Name]["inputs"], options?: AiOptions): LimitOperation<Response>;
34
38
  /** Cloudflare AI Gateway model inference returned as a Response. */
35
- image(model: string, inputs: unknown, options?: AiOptions): Promise<Response>;
39
+ image(model: string, inputs: unknown, options?: AiOptions): LimitOperation<Response>;
36
40
  /** Provider-native AI Gateway requests using a project secret for the provider API key. */
37
41
  provider(provider: AiProvider, options?: AiProviderOptions): {
38
- fetch(path: string, init?: AiProviderFetchInit): Promise<Response>;
42
+ fetch(path: string, init?: AiProviderFetchInit): LimitOperation<Response>;
39
43
  };
40
44
  /** Stream Workers AI response as SSE */
41
- stream<Name extends keyof AiModels>(model: Name, inputs: Omit<AiModels[Name]["inputs"], "stream">, options?: AiOptions): Promise<Response>;
45
+ stream<Name extends keyof AiModels>(model: Name, inputs: Omit<AiModels[Name]["inputs"], "stream">, options?: AiOptions): LimitOperation<Response>;
42
46
  /** Stream any Cloudflare AI Gateway model response as SSE */
43
- stream(model: string, inputs: Record<string, unknown>, options?: AiOptions): Promise<Response>;
47
+ stream(model: string, inputs: Record<string, unknown>, options?: AiOptions): LimitOperation<Response>;
44
48
  };
45
49
  export declare const ai: VoidAi;
46
50
  //#endregion