void 1.1.11 → 1.2.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 (233) hide show
  1. package/dist/{account-cmd-R35a4Oa8.mjs → account-cmd-CdUll_35.mjs} +5 -5
  2. package/dist/action-key-XZ9HkWAO.mjs +26 -0
  3. package/dist/{application-analysis-D7nNmNJb.mjs → application-analysis-fEqoSeMp.mjs} +11 -11
  4. package/dist/{application-routing-CZH66gXn.mjs → application-routing-DAhNP4u3.mjs} +1 -1
  5. package/dist/{ast-CPGPjb0V.mjs → ast-CsZ_q_gc.mjs} +6 -1
  6. package/dist/ast-bindings-C3yaPs1y.mjs +296 -0
  7. package/dist/{auth-link-VHmiKZmP.mjs → auth-link-C87vGXM-.mjs} +5 -5
  8. package/dist/{auth-router-O_Wrs5kg.mjs → auth-router-6I81r-ix.mjs} +3 -3
  9. package/dist/{better-auth-shared-Bv18bB-l.d.mts → better-auth-shared-DVk2DkTW.d.mts} +1 -1
  10. package/dist/{build-cmd-CMZiMn46.mjs → build-cmd-ex1g-j_e.mjs} +4 -4
  11. package/dist/{cache-TZ5Ab3d7.mjs → cache-oHzrnY3z.mjs} +4 -4
  12. package/dist/{cancel-deploy-DXoR6oC3.mjs → cancel-deploy-viAMD0Q_.mjs} +3 -3
  13. package/dist/cf-build-output-BJHuSsVN.mjs +1 -0
  14. package/dist/{cf-build-output-Bc8i3dzE.mjs → cf-build-output-BhVxldCw.mjs} +75 -10
  15. package/dist/{cf-user-agent-ChjQp2MU.mjs → cf-command-values-ByHk0xg4.mjs} +6 -16
  16. package/dist/cf-worker-settings-BECvvTVd.mjs +37 -0
  17. package/dist/cli/cli.mjs +139 -35
  18. package/dist/cli/cloudflare-operation-process.mjs +65 -18
  19. package/dist/cli/env-schema-probe.d.mts +1 -1
  20. package/dist/cli/env-schema-probe.mjs +3 -3
  21. package/dist/{client-GuSO3v_x.mjs → client-BEkdj1kx.mjs} +58 -13
  22. package/dist/client-BiRDZTSd.mjs +1 -0
  23. package/dist/{cloudflare-auth-DSvBc1Gu.mjs → cloudflare-auth-Byo_0_N9.mjs} +1 -1
  24. package/dist/{cloudflare-cmd-ZSErUl6Y.mjs → cloudflare-cmd-DMzCv12s.mjs} +5 -5
  25. package/dist/{cloudflare-config-rdFOys4X.mjs → cloudflare-config-DchHxPTo.mjs} +1 -1
  26. package/dist/{cloudflare-connect-BN-k2kD-.mjs → cloudflare-connect-CCRTVg-I.mjs} +3 -3
  27. package/dist/{cloudflare-operations-DH3GedbV.mjs → cloudflare-operations-Dh9dEHJj.mjs} +17 -7
  28. package/dist/{cloudflare-operations-Cm8lVx7W.mjs → cloudflare-operations-DsSaw2BT.mjs} +1 -1
  29. package/dist/{cloudflare-process-CZJ4viYl.mjs → cloudflare-process-8jEYIeim.mjs} +3 -2
  30. package/dist/{config-DC5llZaI.mjs → config-BIaXIkkv.mjs} +8 -3
  31. package/dist/{config-DYJV8aEH.mjs → config-BU6hMu1W.mjs} +1 -1
  32. package/dist/{config-D26zcdKy.mjs → config-DHgSEWT7.mjs} +39 -6
  33. package/dist/{config-7qoq2p9v.d.mts → config-DQfHOKh9.d.mts} +10 -1
  34. package/dist/config-entry.d.mts +1 -1
  35. package/dist/{connect-yQuLbuiJ.mjs → connect-k7R2rPVA.mjs} +6 -6
  36. package/dist/{create-project-CGOo_OL_.mjs → create-project-DTuy-l0z.mjs} +1 -1
  37. package/dist/{create-project-DEEWJX_M.mjs → create-project-DV71ol5d.mjs} +4 -4
  38. package/dist/{db-COI-yTJE.mjs → db-DVOkLH5X.mjs} +79 -23
  39. package/dist/{delete-PgN6L_9N.mjs → delete-BbP5eopu.mjs} +4 -4
  40. package/dist/{deploy-DsW-PrRQ.mjs → deploy-7H32EnUs.mjs} +220 -95
  41. package/dist/deploy-CE0Ev0Ob.mjs +2 -0
  42. package/dist/{deploy-managed-static-Dqz06S2u.mjs → deploy-managed-static-DlvcvnQT.mjs} +74 -28
  43. package/dist/{deploy-transport-nY3vLXPL.mjs → deploy-transport-BzGEj0Ge.mjs} +2 -2
  44. package/dist/deploy.d.mts +22 -1
  45. package/dist/deploy.mjs +49 -8
  46. package/dist/{dev-inbox-Rd6j_8vM.mjs → dev-inbox-D0jxye_D.mjs} +1 -1
  47. package/dist/{dispatch-BAbbn3jg.mjs → dispatch-DoUnxTNo.mjs} +15 -11
  48. package/dist/{dist-CfgIkieS.mjs → dist-B1PLt4_8.mjs} +1 -1
  49. package/dist/{dist-BVdsO7Py.mjs → dist-Cor9XGoz.mjs} +94 -200
  50. package/dist/{dist-Bn8Kodjp.mjs → dist-D15hFhP0.mjs} +1 -1
  51. package/dist/{domain-DKlNI0SR.mjs → domain-CA2wBgra.mjs} +5 -5
  52. package/dist/drizzle-9TubSZvI.mjs +1 -0
  53. package/dist/{email-BcjSyAL0.mjs → email-B9ayYQEG.mjs} +1 -1
  54. package/dist/{email-C0s3OvJk.mjs → email-DXpCc77w.mjs} +10 -10
  55. package/dist/{email-cloudflare-etpKiITL.mjs → email-cloudflare-D03g2TkS.mjs} +7 -7
  56. package/dist/{entry-B_0IhV64.mjs → entry-BEM8ZuGP.mjs} +40 -12
  57. package/dist/{env-BX2JFsgF.mjs → env-DgOQ9_8S.mjs} +6 -6
  58. package/dist/{env-public-CCdykygU.d.mts → env-public-6lqiSD2b.d.mts} +1 -0
  59. package/dist/{env-types-GRchm5dw.mjs → env-types-BicfKBhV.mjs} +1 -1
  60. package/dist/{env-validation-CuGfWRJd.mjs → env-validation-BmsdCZEk.mjs} +1 -1
  61. package/dist/{env-validation-D_KyMdab.mjs → env-validation-Dwq3PJzK.mjs} +3 -3
  62. package/dist/{fetch-DHLOuPyk.d.mts → fetch-CUX0tB78.d.mts} +14 -1
  63. package/dist/fetch-CtESUYWd.mjs +26 -0
  64. package/dist/{fetch-error-Dj3crt0e.mjs → fetch-error-Bw0n-IY-.mjs} +1 -1
  65. package/dist/{fetch-stream-PGgz4uGz.mjs → fetch-stream-BspOeTAI.mjs} +1 -1
  66. package/dist/{fetch-stream-CNxOrBdP.d.mts → fetch-stream-DfkAzZf-.d.mts} +1 -1
  67. package/dist/{gen-Bj6ZkOcI.mjs → gen-BfmcIi2g.mjs} +5 -5
  68. package/dist/gen-NrOlWZaG.mjs +1 -0
  69. package/dist/{github-cmd-DQDryS-5.mjs → github-cmd-CY9LUqLh.mjs} +4 -4
  70. package/dist/{handler-_PqY82xe.d.mts → handler-BbkSPzGF.d.mts} +91 -9
  71. package/dist/{headers-Bi4bOAwp.mjs → headers-D522zd0A.mjs} +2 -2
  72. package/dist/help-BeAFFE5C.mjs +1 -0
  73. package/dist/{help-D49SL_lN.mjs → help-CxSlPpzJ.mjs} +83 -12
  74. package/dist/{inbound-BuTfm11U.mjs → inbound-VrOLqwZY.mjs} +1 -1
  75. package/dist/index.d.mts +1 -1
  76. package/dist/index.mjs +125 -124
  77. package/dist/{info-Bxunp14X.mjs → info-7VDlhtyy.mjs} +4 -4
  78. package/dist/{init-DyTEY04s.mjs → init-DxYyOs4-.mjs} +103 -43
  79. package/dist/{link-CgOVn9EC.mjs → link-Ddmod1dZ.mjs} +5 -5
  80. package/dist/{list-CUfD9RSb.mjs → list-MogaugiO.mjs} +5 -5
  81. package/dist/{live-DJONVlQK.d.mts → live-Bt8Y_0bg.d.mts} +1 -1
  82. package/dist/{local-d1-CpaPbd_L.mjs → local-d1-BHBnKWRb.mjs} +1 -1
  83. package/dist/{log-vqY3pqwI.mjs → log-BMwmN5Ae.mjs} +2 -2
  84. package/dist/{login-BJvGW5Eu.mjs → login-Cttnagmm.mjs} +4 -4
  85. package/dist/login-DgDwlKc_.mjs +1 -0
  86. package/dist/{logs-DeizBI4j.mjs → logs-CAszUWZI.mjs} +4 -4
  87. package/dist/{migrate-8rk56vV8.mjs → migrate-DyT2jJ8y.mjs} +5 -5
  88. package/dist/migrate-n49ZeS1X.mjs +1 -0
  89. package/dist/{mime-srOklVVv.mjs → mime-BAyHPskU.mjs} +1 -1
  90. package/dist/nitro.mjs +3 -3
  91. package/dist/{node-uN8_zxJr.mjs → node-WB7c2N4L.mjs} +2 -2
  92. package/dist/operator-cmd-d2MvJOrl.mjs +1 -0
  93. package/dist/{operator-cmd-CA5QQyvE.mjs → operator-cmd-skshjMGl.mjs} +4 -4
  94. package/dist/output-BW9uK099.mjs +1 -0
  95. package/dist/{output-Ba6ZbrzY.mjs → output-BpgYODYx.mjs} +16 -4
  96. package/dist/pages/client.d.mts +2 -2
  97. package/dist/pages/client.mjs +48 -25
  98. package/dist/pages/index.d.mts +2 -2
  99. package/dist/pages/index.mjs +4 -4
  100. package/dist/pages/islands-plugin.d.mts +43 -5
  101. package/dist/pages/islands-plugin.mjs +100 -28
  102. package/dist/pages/protocol.d.mts +2 -2
  103. package/dist/pages/protocol.mjs +1 -1
  104. package/dist/pages/serialize.d.mts +2 -2
  105. package/dist/pages/serialize.mjs +1 -1
  106. package/dist/{parse-filename-CUbj-1MP.mjs → parse-filename-DioPHiR9.mjs} +1 -35
  107. package/dist/{picocolors-BTps1_gs.mjs → picocolors-BsDfhxIw.mjs} +1 -1
  108. package/dist/{platform-args-B7ke06up.mjs → platform-args-DVbVClZl.mjs} +12 -4
  109. package/dist/platform-args-kQrgxScY.mjs +1 -0
  110. package/dist/{platform-auth-config-CZaY812e.mjs → platform-auth-config-C-pm5Qzx.mjs} +6 -6
  111. package/dist/{platform-auth-protection-U9HCqoXv.mjs → platform-auth-protection-SHhvim1L.mjs} +4 -4
  112. package/dist/{platform-auth-recovery-B0BV2hfV.mjs → platform-auth-recovery-DXVWs-wA.mjs} +4 -4
  113. package/dist/{platform-cmd-CXrjk4fb.mjs → platform-cmd-D5I1beUX.mjs} +7 -7
  114. package/dist/{platform-cmd-D9lwFpcl.mjs → platform-cmd-PiNRkopU.mjs} +1 -1
  115. package/dist/{platform-domain-CXyq-68_.mjs → platform-domain-jpmBfZeb.mjs} +4 -4
  116. package/dist/{platform-lifecycle-Dz2cJsLX.mjs → platform-lifecycle-DH3Yr1qQ.mjs} +1 -1
  117. package/dist/{platform-lifecycle-D0TdyXbN.mjs → platform-lifecycle-DyKmuNY6.mjs} +405 -44
  118. package/dist/{platform-management-CnXhgxTM.mjs → platform-management--vDwSn35.mjs} +49 -5
  119. package/dist/{platform-management-BvgbusqL.mjs → platform-management-7m-PLaPJ.mjs} +1 -1
  120. package/dist/{platform-plans-config-BWn1S2Rv.mjs → platform-plans-config-CeydDSj0.mjs} +2 -2
  121. package/dist/{platform-recovery-CH_fThW6.mjs → platform-recovery-BiNpZZab.mjs} +2 -2
  122. package/dist/{platform-setup-YvN9VQXV.mjs → platform-setup-Ca53gtt0.mjs} +3 -2
  123. package/dist/{plugin-inference-Bekzjuqw.mjs → plugin-inference-DUjCd55H.mjs} +145 -218
  124. package/dist/{prepare-2XD6kh77.mjs → prepare-BcAE5Sdj.mjs} +3 -3
  125. package/dist/prepare-C4I0f--h.mjs +1 -0
  126. package/dist/{prepare-DepAGBcV.mjs → prepare-DA-17DhO.mjs} +5 -5
  127. package/dist/{prerender-render-Bfsumdkv.mjs → prerender-render-Cijv7UFo.mjs} +11 -6
  128. package/dist/prerender-render.mjs +1 -1
  129. package/dist/{project-cmd-CpLYflCH.mjs → project-cmd-DA4K5faU.mjs} +18 -18
  130. package/dist/{project-team-CTSY7W7Q.mjs → project-team-CQBNveX3.mjs} +4 -4
  131. package/dist/{project-token-Cybtlfbl.mjs → project-token-CCalFyQf.mjs} +4 -4
  132. package/dist/{project-zero-trust-DKOtqyvu.mjs → project-zero-trust-DPnkiEuT.mjs} +4 -4
  133. package/dist/{protocol-B8sI8dRD.d.mts → protocol-BBDpJz3G.d.mts} +3 -1
  134. package/dist/{protocol-RNP0u7UY.mjs → protocol-DimNxVRr.mjs} +42 -17
  135. package/dist/{provision-UcYjpTRh.mjs → provision-BFLCrnUp.mjs} +1 -1
  136. package/dist/{provision-BuifYvLc.mjs → provision-DtROpNNI.mjs} +6 -5
  137. package/dist/{requests-Ryiazz9i.mjs → requests-BpH0kImL.mjs} +3 -3
  138. package/dist/resolve-project-DD1vu8s9.mjs +1 -0
  139. package/dist/{resolve-project-WpwkCB_c.mjs → resolve-project-Xoi6eTWY.mjs} +1 -1
  140. package/dist/{rollback-Or0EV3rP.mjs → rollback-CXS1tAa-.mjs} +10 -9
  141. package/dist/{rolldown-runtime-DXIUcv95.mjs → rolldown-runtime-3h0WiCiA.mjs} +1 -1
  142. package/dist/{routing-assets-VkrKIbxE.mjs → routing-assets-DdSFxoLp.mjs} +10 -4
  143. package/dist/runtime/better-auth-mysql.d.mts +1 -1
  144. package/dist/runtime/better-auth-pg.d.mts +1 -1
  145. package/dist/runtime/better-auth.d.mts +1 -1
  146. package/dist/runtime/client-react.d.mts +2 -2
  147. package/dist/runtime/client-react.mjs +3 -3
  148. package/dist/runtime/client-solid.d.mts +2 -2
  149. package/dist/runtime/client-solid.mjs +3 -3
  150. package/dist/runtime/client-svelte.d.mts +2 -2
  151. package/dist/runtime/client-svelte.mjs +3 -3
  152. package/dist/runtime/client-vue.d.mts +2 -2
  153. package/dist/runtime/client-vue.mjs +3 -3
  154. package/dist/runtime/client.d.mts +2 -2
  155. package/dist/runtime/client.mjs +3 -3
  156. package/dist/runtime/email/testing.mjs +4 -4
  157. package/dist/runtime/email.mjs +3 -3
  158. package/dist/runtime/env-public.d.mts +1 -1
  159. package/dist/runtime/fetch-server.d.mts +8 -0
  160. package/dist/runtime/fetch-server.mjs +30 -0
  161. package/dist/runtime/fetch-stream.d.mts +2 -2
  162. package/dist/runtime/fetch-stream.mjs +2 -2
  163. package/dist/runtime/fetch.d.mts +2 -2
  164. package/dist/runtime/fetch.mjs +3 -3
  165. package/dist/runtime/handler.d.mts +1 -1
  166. package/dist/runtime/live-client.d.mts +1 -1
  167. package/dist/runtime/live.d.mts +1 -1
  168. package/dist/runtime/routing.d.mts +17 -76
  169. package/dist/runtime/routing.mjs +277 -216
  170. package/dist/runtime/validator.d.mts +1 -1
  171. package/dist/runtime/ws-server.d.mts +2 -2
  172. package/dist/runtime/ws.d.mts +1 -1
  173. package/dist/{scan-D2-FcLHs.mjs → scan-8IzYXiU_.mjs} +12 -11
  174. package/dist/{secret-CClHaFxm.mjs → secret-BbXHfLAt.mjs} +6 -6
  175. package/dist/serialize-DtR8Vwa_.d.mts +18 -0
  176. package/dist/serialize-YHvlcG3Q.mjs +31 -0
  177. package/dist/{skills-C_yRTg0g.mjs → skills-CrUO3PJ0.mjs} +1 -1
  178. package/dist/{subcommand-prompt-Bm3ZlYgA.mjs → subcommand-prompt-D9OhhbGG.mjs} +2 -2
  179. package/dist/{version-metadata-B1Bm2wSq.mjs → version-metadata-tS39iW09.mjs} +1 -1
  180. package/dist/wrangler-BLb3_luP.mjs +1 -0
  181. package/dist/{wrangler-C9XSzrju.mjs → wrangler-F96NnLyb.mjs} +13 -5
  182. package/dist/{wrapper-BOigE1xJ.mjs → wrapper-D3sZyh2C.mjs} +5 -3
  183. package/dist/{ws-CsBNxv86.d.mts → ws-BH-im_tX.d.mts} +1 -1
  184. package/docs/guide/ai.md +1 -1
  185. package/docs/guide/database/postgresql.md +1 -1
  186. package/docs/guide/database.md +26 -0
  187. package/docs/guide/deployment.md +2 -0
  188. package/docs/guide/edge/headers.md +1 -1
  189. package/docs/guide/email/domains.md +1 -1
  190. package/docs/guide/email/receiving.md +1 -1
  191. package/docs/guide/email/sending.md +3 -3
  192. package/docs/guide/pages-routing/actions-and-forms.md +1 -1
  193. package/docs/guide/pages-routing/markdown.md +3 -1
  194. package/docs/guide/platform/administration/email.md +7 -1
  195. package/docs/guide/platform/installation/ci.md +2 -0
  196. package/docs/guide/platform/installation/credentials.md +24 -6
  197. package/docs/guide/platform/installation/domains.md +16 -0
  198. package/docs/guide/platform/installation/maintenance.md +32 -2
  199. package/docs/guide/platform/installation/setup.md +1 -1
  200. package/docs/guide/self-hosted-platform.md +1 -1
  201. package/docs/guide/server-routing.md +1 -1
  202. package/docs/guide/typed-fetch.md +1 -1
  203. package/docs/integrations/cloudflare.md +2 -1
  204. package/docs/integrations/frameworks/tanstack-start.md +25 -0
  205. package/docs/reference/api/deploy.md +35 -3
  206. package/docs/reference/api/env.md +1 -1
  207. package/docs/reference/api/rewrites.md +1 -1
  208. package/docs/reference/api/types.md +1 -0
  209. package/docs/reference/cli/database.md +15 -0
  210. package/docs/reference/cli/platform-installation.md +5 -2
  211. package/docs/reference/cli/project.md +4 -2
  212. package/docs/reference/cli/setup.md +17 -0
  213. package/docs/reference/cli.md +1 -0
  214. package/docs/reference/config.md +14 -1
  215. package/docs/reference/resource-inference.md +4 -0
  216. package/package.json +23 -22
  217. package/sandbox.Dockerfile +1 -1
  218. package/schema.json +23 -3
  219. package/dist/cf-build-output-BU3hqdHu.mjs +0 -1
  220. package/dist/client-DrdeJgHR.mjs +0 -1
  221. package/dist/deploy-CxNgEYr4.mjs +0 -2
  222. package/dist/fetch-sAcwjzLO.mjs +0 -18
  223. package/dist/gen-DsCukhuw.mjs +0 -1
  224. package/dist/help-DOFygYi4.mjs +0 -1
  225. package/dist/login-alAlxw4S.mjs +0 -1
  226. package/dist/migrate-D2odrAmh.mjs +0 -1
  227. package/dist/operator-cmd-D7toMPJ9.mjs +0 -1
  228. package/dist/platform-args-B_LrqEZB.mjs +0 -1
  229. package/dist/prepare-EVEbQ9n2.mjs +0 -1
  230. package/dist/resolve-project-PnhzMtY6.mjs +0 -1
  231. package/dist/serialize-BtQyaYoC.mjs +0 -20
  232. package/dist/serialize-CfSwWfF2.d.mts +0 -10
  233. package/dist/wrangler-DAdxHEzh.mjs +0 -1
@@ -1,6 +1,5 @@
1
- import { n as getOwnVersion } from "./agents-CuNtT0D_.mjs";
2
- import { readFileSync } from "node:fs";
3
1
  //#region src/cli/cf-command-values.ts
2
+ const CF_VERSION_SOURCE_MAX_OUTPUT_BYTES = 134217728;
4
3
  /** Accept a cf positional only when it cannot be read as a flag or carry control characters. */
5
4
  function safePositional(value) {
6
5
  return typeof value === "string" && value.length > 0 && !value.startsWith("-") && ![...value].some((character) => {
@@ -8,6 +7,10 @@ function safePositional(value) {
8
7
  return code < 32 || code === 127;
9
8
  });
10
9
  }
10
+ /** Accept only Cloudflare's hex-segment D1 Time Travel bookmarks; Void prints them as commands to copy. */
11
+ function isD1Bookmark(value) {
12
+ return typeof value === "string" && /^[0-9a-f]+(?:-[0-9a-f]+)+$/i.test(value);
13
+ }
11
14
  /** Read the version ID and URLs that cf prints after a prebuilt upload. */
12
15
  function readCfUploadOutput(stdout) {
13
16
  return {
@@ -17,17 +20,4 @@ function readCfUploadOutput(stdout) {
17
20
  };
18
21
  }
19
22
  //#endregion
20
- //#region src/cli/cf-user-agent.ts
21
- let voidUserAgent;
22
- let cfCliVersion;
23
- function getVoidUserAgent() {
24
- if (voidUserAgent === void 0) voidUserAgent = `void/${getOwnVersion()}`;
25
- return voidUserAgent;
26
- }
27
- /** cf prepends `cf-cli/` to CLI_VERSION for both API requests and uploads. */
28
- function getCfCliVersion(attribution) {
29
- if (cfCliVersion === void 0) cfCliVersion = `${JSON.parse(readFileSync(new URL(import.meta.resolve("cf/package.json")), "utf8")).version} ${getVoidUserAgent()}`;
30
- return attribution ? `${cfCliVersion} ${attribution}` : cfCliVersion;
31
- }
32
- //#endregion
33
- export { safePositional as i, getVoidUserAgent as n, readCfUploadOutput as r, getCfCliVersion as t };
23
+ export { safePositional as i, isD1Bookmark as n, readCfUploadOutput as r, CF_VERSION_SOURCE_MAX_OUTPUT_BYTES as t };
@@ -0,0 +1,37 @@
1
+ import { n as getOwnVersion } from "./agents-CuNtT0D_.mjs";
2
+ import { readFileSync } from "node:fs";
3
+ import { isRecord } from "@void/deploy-core";
4
+ //#region src/cli/cf-user-agent.ts
5
+ let voidUserAgent;
6
+ let cfCliVersion;
7
+ function getVoidUserAgent() {
8
+ if (voidUserAgent === void 0) voidUserAgent = `void/${getOwnVersion()}`;
9
+ return voidUserAgent;
10
+ }
11
+ /** cf prepends `cf-cli/` to CLI_VERSION for both API requests and uploads. */
12
+ function getCfCliVersion(attribution) {
13
+ if (cfCliVersion === void 0) cfCliVersion = `${JSON.parse(readFileSync(new URL(import.meta.resolve("cf/package.json")), "utf8")).version} ${getVoidUserAgent()}`;
14
+ return attribution ? `${cfCliVersion} ${attribution}` : cfCliVersion;
15
+ }
16
+ //#endregion
17
+ //#region src/cli/cf-worker-settings.ts
18
+ /** Version uploads leave Worker-wide settings untouched; publish only explicit configuration. */
19
+ async function publishCloudflareObservability(options) {
20
+ if (!isRecord(options.observability)) throw new Error("The Cloudflare Worker observability settings were not readable.");
21
+ const endpoint = `${options.apiBaseUrl.replace(/\/$/, "")}/accounts/${encodeURIComponent(options.accountId)}/workers/scripts/${encodeURIComponent(options.workerName)}/script-settings`;
22
+ const response = await fetch(endpoint, {
23
+ method: "PATCH",
24
+ headers: {
25
+ "User-Agent": getVoidUserAgent(),
26
+ ...options.headers,
27
+ "Content-Type": "application/json"
28
+ },
29
+ body: JSON.stringify({ observability: options.observability }),
30
+ redirect: "error",
31
+ signal: AbortSignal.timeout(3e4)
32
+ });
33
+ const body = await response.json();
34
+ if (!response.ok || !isRecord(body) || body.success !== true) throw new Error(`Cloudflare did not update Worker observability (HTTP ${response.status}).`);
35
+ }
36
+ //#endregion
37
+ export { getCfCliVersion as n, getVoidUserAgent as r, publishCloudflareObservability as t };
package/dist/cli/cli.mjs CHANGED
@@ -1,12 +1,13 @@
1
1
  #!/usr/bin/env node
2
- import { L as log } from "../dist-BVdsO7Py.mjs";
3
- import { f as import_picocolors, l as formatUrl } from "../output-Ba6ZbrzY.mjs";
2
+ import { L as log } from "../dist-Cor9XGoz.mjs";
4
3
  import { t as formatCloudflareUserMessage } from "../cloudflare-user-output-Q-k0QoNQ.mjs";
5
4
  import { n as getOwnVersion } from "../agents-CuNtT0D_.mjs";
6
- import { i as printVoidHeader, n as printGlobalHelp, r as printHelpPage, t as getHelpPath } from "../help-D49SL_lN.mjs";
5
+ import { f as import_picocolors, l as formatUrl } from "../output-BpgYODYx.mjs";
6
+ import { n as isD1Bookmark } from "../cf-command-values-ByHk0xg4.mjs";
7
+ import { i as printVoidHeader, n as printGlobalHelp, r as printHelpPage, t as getHelpPath } from "../help-CxSlPpzJ.mjs";
7
8
  import { r as OperatorClientError } from "../operator-client-C-ROjk1I.mjs";
8
9
  import { n as operatorGroups } from "../operator-args-UnE8Y2eK.mjs";
9
- import { n as platformSubcommands, t as parsePlatformArgs } from "../platform-args-B7ke06up.mjs";
10
+ import { n as platformSubcommands, t as parsePlatformArgs } from "../platform-args-DVbVClZl.mjs";
10
11
  import { parseArgs } from "node:util";
11
12
  //#region src/cli/account-args.ts
12
13
  const accountSubcommands = [
@@ -324,6 +325,31 @@ const dbSubcommands = [
324
325
  }
325
326
  ]
326
327
  },
328
+ {
329
+ name: "restore",
330
+ description: "Restore the deployed D1 database to an earlier point (direct Cloudflare)",
331
+ flags: [
332
+ {
333
+ name: "--bookmark",
334
+ arg: "<bookmark>",
335
+ description: "Restore point printed by deploy (or use --timestamp)"
336
+ },
337
+ {
338
+ name: "--timestamp",
339
+ arg: "<iso-time>",
340
+ description: "Time to restore to, with Z or an offset (or use --bookmark)"
341
+ },
342
+ {
343
+ name: "--platform",
344
+ arg: "cloudflare",
345
+ description: "Restore after a one-off deploy with --platform cloudflare"
346
+ },
347
+ {
348
+ name: "--yes",
349
+ description: "Skip the confirmation prompt"
350
+ }
351
+ ]
352
+ },
327
353
  {
328
354
  name: "rename-migrations",
329
355
  description: "Rename migrations to timestamp-based format"
@@ -364,6 +390,7 @@ const MAX_POSITIONALS = {
364
390
  studio: 0,
365
391
  "set-url": 0,
366
392
  connect: 1,
393
+ restore: 0,
367
394
  "rename-migrations": 0,
368
395
  export: 0
369
396
  };
@@ -383,6 +410,12 @@ const ACTION_FLAGS = {
383
410
  "region",
384
411
  "local-only"
385
412
  ],
413
+ restore: [
414
+ "bookmark",
415
+ "timestamp",
416
+ "platform",
417
+ "yes"
418
+ ],
386
419
  "rename-migrations": [],
387
420
  export: [
388
421
  "output",
@@ -391,6 +424,26 @@ const ACTION_FLAGS = {
391
424
  "table"
392
425
  ]
393
426
  };
427
+ /**
428
+ * Read a restore time as a UTC ISO string. A time without a zone would depend on where the
429
+ * command runs, `new Date` rolls impossible dates over (Feb 30 becomes Mar 2), and it keeps only
430
+ * milliseconds, so all three are rejected instead of restoring to a moment the user did not write.
431
+ */
432
+ function parseRestoreTime(value) {
433
+ const match = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d{1,3})?)?(?:Z|([+-])(\d{2}):(\d{2}))$/i.exec(value);
434
+ const time = new Date(value);
435
+ if (!match || Number.isNaN(time.getTime())) return;
436
+ const offsetMinutes = match[7] ? (match[7] === "-" ? -1 : 1) * (Number(match[8]) * 60 + Number(match[9])) : 0;
437
+ const written = new Date(time.getTime() + offsetMinutes * 6e4);
438
+ return [
439
+ written.getUTCFullYear(),
440
+ written.getUTCMonth() + 1,
441
+ written.getUTCDate(),
442
+ written.getUTCHours(),
443
+ written.getUTCMinutes(),
444
+ written.getUTCSeconds()
445
+ ].every((field, index) => field === Number(match[index + 1] ?? 0)) ? time.toISOString() : void 0;
446
+ }
394
447
  function isDbAction(value) {
395
448
  return value !== void 0 && Object.hasOwn(MAX_POSITIONALS, value);
396
449
  }
@@ -408,13 +461,16 @@ function parseDbArgs(args) {
408
461
  name: { type: "string" },
409
462
  region: { type: "string" },
410
463
  "local-only": { type: "boolean" },
411
- yes: { type: "boolean" }
464
+ yes: { type: "boolean" },
465
+ bookmark: { type: "string" },
466
+ timestamp: { type: "string" },
467
+ platform: { type: "string" }
412
468
  },
413
469
  allowPositionals: true,
414
470
  strict: true
415
471
  });
416
472
  const [action, ...rest] = positionals;
417
- if (!isDbAction(action)) throw new Error("db: Usage: void db <push|generate|status|reset|seed|execute|migrate|studio|export|connect|set-url|rename-migrations>.");
473
+ if (!isDbAction(action)) throw new Error("db: Usage: void db <push|generate|status|reset|seed|execute|migrate|studio|export|connect|set-url|restore|rename-migrations>.");
418
474
  if (action === "export" && values.remote) throw new Error("db: `void db export` reads only the local database; --remote is not supported.");
419
475
  const unsupported = Object.keys(values).find((flag) => !ACTION_FLAGS[action].includes(flag));
420
476
  if (unsupported) throw new Error(`db: \`void db ${action}\` does not support --${unsupported}.`);
@@ -458,6 +514,32 @@ function parseDbArgs(args) {
458
514
  localOnly: values["local-only"]
459
515
  };
460
516
  }
517
+ case "restore": {
518
+ if (values.platform !== void 0 && values.platform !== "cloudflare") throw new Error("db: `void db restore --platform` accepts only 'cloudflare'.");
519
+ const platform = values.platform;
520
+ const bookmark = values.bookmark?.trim();
521
+ const timestamp = values.timestamp?.trim();
522
+ if (bookmark && !timestamp) {
523
+ if (!isD1Bookmark(bookmark)) throw new Error("db: --bookmark must be a D1 restore point printed by `void deploy`, for example 00000085-0000024c-00004ef2.");
524
+ return {
525
+ action,
526
+ target: { bookmark },
527
+ platform,
528
+ yes: values.yes
529
+ };
530
+ }
531
+ if (timestamp && !bookmark) {
532
+ const time = parseRestoreTime(timestamp);
533
+ if (!time) throw new Error("db: --timestamp must be a valid ISO 8601 time with Z or an offset and at most millisecond precision, for example 2026-10-16T09:30:00Z.");
534
+ return {
535
+ action,
536
+ target: { timestamp: time },
537
+ platform,
538
+ yes: values.yes
539
+ };
540
+ }
541
+ throw new Error("db: Usage: void db restore --bookmark <bookmark> or void db restore --timestamp <iso-time>.");
542
+ }
461
543
  case "export": return {
462
544
  action,
463
545
  output: values.output,
@@ -1139,7 +1221,12 @@ const projectSubcommands = [
1139
1221
  {
1140
1222
  name: "rollback",
1141
1223
  arg: "[deployId]",
1142
- description: "Roll back to a previous deployment"
1224
+ description: "Roll back to a previous deployment",
1225
+ flags: [{
1226
+ name: "--platform",
1227
+ arg: "cloudflare",
1228
+ description: "Roll back after a one-off deploy with --platform cloudflare"
1229
+ }]
1143
1230
  },
1144
1231
  {
1145
1232
  name: "cancel",
@@ -1266,7 +1353,24 @@ function parseProjectArgs(args) {
1266
1353
  range
1267
1354
  };
1268
1355
  }
1269
- if (subcommand === "rollback" || subcommand === "cancel") return {
1356
+ if (subcommand === "rollback") {
1357
+ let platform;
1358
+ const positional = [];
1359
+ for (let i = 0; i < rest.length; i++) {
1360
+ const arg = rest[i];
1361
+ if (arg === "--platform" || arg.startsWith("--platform=")) {
1362
+ const value = arg === "--platform" ? rest[++i] : arg.slice(11);
1363
+ if (value !== "cloudflare") throw new Error(`project: \`rollback --platform\` accepts only 'cloudflare', got '${value ?? ""}'.`);
1364
+ platform = "cloudflare";
1365
+ } else positional.push(arg);
1366
+ }
1367
+ return {
1368
+ subcommand,
1369
+ deployId: parseOptionalPositional(positional),
1370
+ ...platform ? { platform } : {}
1371
+ };
1372
+ }
1373
+ if (subcommand === "cancel") return {
1270
1374
  subcommand,
1271
1375
  deployId: parseOptionalPositional(rest)
1272
1376
  };
@@ -1500,7 +1604,7 @@ async function runSubcommandGroup(command, subcommands, parse, run) {
1500
1604
  const hasNamedSubcommand = args.slice(1).some((arg) => subcommands.some(({ name }) => name === arg));
1501
1605
  try {
1502
1606
  if ((!sub || sub.startsWith("-") && !hasNamedSubcommand) && process.stdin.isTTY) {
1503
- const { promptSubcommand } = await import("../subcommand-prompt-Bm3ZlYgA.mjs");
1607
+ const { promptSubcommand } = await import("../subcommand-prompt-D9OhhbGG.mjs");
1504
1608
  if (command === "platform" && !sub) log.info(`A Void platform lets a team deploy Void apps to a shared Cloudflare account.
1505
1609
  This command sets up and manages platforms. Join with \`void connect <url>\`.
1506
1610
  Docs: ${formatUrl("https://void.cloud/guide/self-hosted-platform")}`);
@@ -1528,19 +1632,19 @@ const args = process.argv.slice(2);
1528
1632
  const command = args[0];
1529
1633
  const helpPath = getHelpPath(args);
1530
1634
  const subcommandGroups = {
1531
- auth: () => runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-router-O_Wrs5kg.mjs").then(({ runAuthRouter }) => runAuthRouter(root, parsed))),
1532
- account: () => runSubcommandGroup("account", accountSubcommands, parseAccountArgs, (root, parsed) => import("../account-cmd-R35a4Oa8.mjs").then(({ runAccountCommand }) => runAccountCommand(root, parsed))),
1533
- platform: () => runSubcommandGroup("platform", platformSubcommands, parsePlatformArgs, (root, parsed) => import("../platform-cmd-D9lwFpcl.mjs").then(({ runPlatformCommand }) => runPlatformCommand(root, parsed))),
1534
- cloudflare: () => runSubcommandGroup("cloudflare", cloudflareSubcommands, parseCloudflareArgs, (root, parsed) => import("../cloudflare-cmd-ZSErUl6Y.mjs").then(({ runCloudflareCommand }) => runCloudflareCommand(root, parsed))),
1535
- project: () => runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-CpLYflCH.mjs").then(({ runProjectCommand }) => runProjectCommand(root, parsed))),
1536
- secret: () => runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-CClHaFxm.mjs").then(({ runSecretCommand }) => runSecretCommand(root, parsed))),
1537
- domain: () => runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-DKlNI0SR.mjs").then(({ runDomainCommand }) => runDomainCommand(root, parsed))),
1538
- email: () => runSubcommandGroup("email", emailSubcommands, parseEmailArgs, (root, parsed) => import("../email-C0s3OvJk.mjs").then(({ runEmailCommand }) => runEmailCommand(root, parsed))),
1539
- db: () => runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-COI-yTJE.mjs").then(({ runDbCommand }) => runDbCommand(root, parsed))),
1540
- env: () => runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-BX2JFsgF.mjs").then(({ runEnvCommand }) => runEnvCommand(root, parsed))),
1541
- gen: () => runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-DsCukhuw.mjs").then(({ runGenCommand }) => runGenCommand(root, parsed))),
1542
- github: () => runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (root, parsed) => import("../github-cmd-DQDryS-5.mjs").then(({ runGithubCommand }) => runGithubCommand(root, parsed))),
1543
- build: () => runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (root, parsed) => import("../build-cmd-CMZiMn46.mjs").then(({ runBuildCommand }) => runBuildCommand(root, parsed)))
1635
+ auth: () => runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-router-6I81r-ix.mjs").then(({ runAuthRouter }) => runAuthRouter(root, parsed))),
1636
+ account: () => runSubcommandGroup("account", accountSubcommands, parseAccountArgs, (root, parsed) => import("../account-cmd-CdUll_35.mjs").then(({ runAccountCommand }) => runAccountCommand(root, parsed))),
1637
+ platform: () => runSubcommandGroup("platform", platformSubcommands, parsePlatformArgs, (root, parsed) => import("../platform-cmd-PiNRkopU.mjs").then(({ runPlatformCommand }) => runPlatformCommand(root, parsed))),
1638
+ cloudflare: () => runSubcommandGroup("cloudflare", cloudflareSubcommands, parseCloudflareArgs, (root, parsed) => import("../cloudflare-cmd-DMzCv12s.mjs").then(({ runCloudflareCommand }) => runCloudflareCommand(root, parsed))),
1639
+ project: () => runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-DA4K5faU.mjs").then(({ runProjectCommand }) => runProjectCommand(root, parsed))),
1640
+ secret: () => runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-BbXHfLAt.mjs").then(({ runSecretCommand }) => runSecretCommand(root, parsed))),
1641
+ domain: () => runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-CA2wBgra.mjs").then(({ runDomainCommand }) => runDomainCommand(root, parsed))),
1642
+ email: () => runSubcommandGroup("email", emailSubcommands, parseEmailArgs, (root, parsed) => import("../email-DXpCc77w.mjs").then(({ runEmailCommand }) => runEmailCommand(root, parsed))),
1643
+ db: () => runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-DVOkLH5X.mjs").then(({ runDbCommand }) => runDbCommand(root, parsed))),
1644
+ env: () => runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-DgOQ9_8S.mjs").then(({ runEnvCommand }) => runEnvCommand(root, parsed))),
1645
+ gen: () => runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-NrOlWZaG.mjs").then(({ runGenCommand }) => runGenCommand(root, parsed))),
1646
+ github: () => runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (root, parsed) => import("../github-cmd-CY9LUqLh.mjs").then(({ runGithubCommand }) => runGithubCommand(root, parsed))),
1647
+ build: () => runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (root, parsed) => import("../build-cmd-ex1g-j_e.mjs").then(({ runBuildCommand }) => runBuildCommand(root, parsed)))
1544
1648
  };
1545
1649
  if (helpPath) {
1546
1650
  if (helpPath.length === 0) printGlobalHelp();
@@ -1559,7 +1663,7 @@ if (helpPath) {
1559
1663
  log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
1560
1664
  process.exit(1);
1561
1665
  }
1562
- import("../deploy-CxNgEYr4.mjs").then(({ runDeploy }) => {
1666
+ import("../deploy-CE0Ev0Ob.mjs").then(({ runDeploy }) => {
1563
1667
  runDeploy(root, deployArgs).catch((err) => {
1564
1668
  log.error(formatCloudflareUserMessage(err.message ?? String(err)));
1565
1669
  process.exit(1);
@@ -1567,14 +1671,14 @@ if (helpPath) {
1567
1671
  });
1568
1672
  } else if (command === "connect") (async () => {
1569
1673
  const parsed = parseConnectArgs(args.slice(1));
1570
- const { runConnectCommand } = await import("../connect-yQuLbuiJ.mjs");
1674
+ const { runConnectCommand } = await import("../connect-k7R2rPVA.mjs");
1571
1675
  await runConnectCommand(process.cwd(), parsed);
1572
1676
  })().catch((err) => {
1573
1677
  log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
1574
1678
  process.exit(1);
1575
1679
  });
1576
1680
  else if (command && Object.hasOwn(subcommandGroups, command)) subcommandGroups[command]();
1577
- else if (command === "info") import("../info-Bxunp14X.mjs").then(async ({ runInfoCommand }) => {
1681
+ else if (command === "info") import("../info-7VDlhtyy.mjs").then(async ({ runInfoCommand }) => {
1578
1682
  try {
1579
1683
  await runInfoCommand(process.cwd(), parseInfoArgs(args.slice(1)));
1580
1684
  } catch (err) {
@@ -1595,7 +1699,7 @@ else if (command === "prepare") {
1595
1699
  log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
1596
1700
  process.exit(1);
1597
1701
  }
1598
- import("../prepare-2XD6kh77.mjs").then(({ runPrepareCommand }) => {
1702
+ import("../prepare-BcAE5Sdj.mjs").then(({ runPrepareCommand }) => {
1599
1703
  runPrepareCommand(root).catch((err) => {
1600
1704
  log.error(formatCloudflareUserMessage(err.message ?? String(err)));
1601
1705
  process.exit(1);
@@ -1603,7 +1707,7 @@ else if (command === "prepare") {
1603
1707
  });
1604
1708
  } else if (command === "init") {
1605
1709
  const root = process.cwd();
1606
- import("../init-DyTEY04s.mjs").then(({ runInitCommand, parseInitArgs }) => {
1710
+ import("../init-DxYyOs4-.mjs").then(({ runInitCommand, parseInitArgs }) => {
1607
1711
  let initArgs;
1608
1712
  try {
1609
1713
  initArgs = parseInitArgs(args.slice(1));
@@ -1621,7 +1725,7 @@ else if (command === "prepare") {
1621
1725
  log.error("migrate: This command takes no arguments.");
1622
1726
  process.exit(1);
1623
1727
  }
1624
- import("../migrate-D2odrAmh.mjs").then(({ runMigrateCommand }) => {
1728
+ import("../migrate-n49ZeS1X.mjs").then(({ runMigrateCommand }) => {
1625
1729
  runMigrateCommand(process.cwd()).catch((err) => {
1626
1730
  log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
1627
1731
  process.exit(1);
@@ -1735,7 +1839,7 @@ else if (command) {
1735
1839
  ];
1736
1840
  (async () => {
1737
1841
  printVoidHeader();
1738
- const { promptSubcommand } = await import("../subcommand-prompt-Bm3ZlYgA.mjs");
1842
+ const { promptSubcommand } = await import("../subcommand-prompt-D9OhhbGG.mjs");
1739
1843
  const result = await promptSubcommand("", topLevelCommands);
1740
1844
  if (!result) process.exit(0);
1741
1845
  const cmd = result.subcommand;
@@ -1743,32 +1847,32 @@ else if (command) {
1743
1847
  if (Object.hasOwn(subcommandGroups, cmd)) return subcommandGroups[cmd]();
1744
1848
  switch (cmd) {
1745
1849
  case "connect": {
1746
- const { runConnectCommand } = await import("../connect-yQuLbuiJ.mjs");
1850
+ const { runConnectCommand } = await import("../connect-k7R2rPVA.mjs");
1747
1851
  await runConnectCommand(root, parseConnectArgs([]));
1748
1852
  return;
1749
1853
  }
1750
1854
  case "init": {
1751
- const { runInitCommand, parseInitArgs } = await import("../init-DyTEY04s.mjs");
1855
+ const { runInitCommand, parseInitArgs } = await import("../init-DxYyOs4-.mjs");
1752
1856
  await runInitCommand(root, parseInitArgs([]));
1753
1857
  return;
1754
1858
  }
1755
1859
  case "migrate": {
1756
- const { runMigrateCommand } = await import("../migrate-D2odrAmh.mjs");
1860
+ const { runMigrateCommand } = await import("../migrate-n49ZeS1X.mjs");
1757
1861
  await runMigrateCommand(root);
1758
1862
  return;
1759
1863
  }
1760
1864
  case "deploy": {
1761
- const { runDeploy } = await import("../deploy-CxNgEYr4.mjs");
1865
+ const { runDeploy } = await import("../deploy-CE0Ev0Ob.mjs");
1762
1866
  await runDeploy(root);
1763
1867
  return;
1764
1868
  }
1765
1869
  case "info": {
1766
- const { runInfoCommand } = await import("../info-Bxunp14X.mjs");
1870
+ const { runInfoCommand } = await import("../info-7VDlhtyy.mjs");
1767
1871
  await runInfoCommand(root, parseInfoArgs([]));
1768
1872
  return;
1769
1873
  }
1770
1874
  case "prepare": {
1771
- const { runPrepareCommand } = await import("../prepare-2XD6kh77.mjs");
1875
+ const { runPrepareCommand } = await import("../prepare-BcAE5Sdj.mjs");
1772
1876
  await runPrepareCommand(root);
1773
1877
  return;
1774
1878
  }
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { n as __toESM } from "../rolldown-runtime-DXIUcv95.mjs";
2
+ import { n as __toESM } from "../rolldown-runtime-3h0WiCiA.mjs";
3
3
  import { a as join, c as resolve, n as dirname } from "../dist-ipQi0Q8y.mjs";
4
- import { t as require_picocolors } from "../picocolors-BTps1_gs.mjs";
5
- import { l as formatUrl } from "../output-Ba6ZbrzY.mjs";
6
- import { i as safePositional, n as getVoidUserAgent, r as readCfUploadOutput, t as getCfCliVersion } from "../cf-user-agent-ChjQp2MU.mjs";
4
+ import { t as require_picocolors } from "../picocolors-BsDfhxIw.mjs";
5
+ import { l as formatUrl } from "../output-BpgYODYx.mjs";
6
+ import { i as safePositional, n as isD1Bookmark, r as readCfUploadOutput, t as CF_VERSION_SOURCE_MAX_OUTPUT_BYTES } from "../cf-command-values-ByHk0xg4.mjs";
7
+ import { n as getCfCliVersion, r as getVoidUserAgent, t as publishCloudflareObservability } from "../cf-worker-settings-BECvvTVd.mjs";
7
8
  import { t as sanitizeTerminalLogText } from "../terminal-log-text-D9ACPOuG.mjs";
8
9
  import { copyFileSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
9
10
  import { fileURLToPath } from "node:url";
@@ -148,7 +149,7 @@ function result(status, stdout = "", stderr = "", data) {
148
149
  ].includes(errorCode ?? 0) ? { failure: "not-found" } : {}
149
150
  };
150
151
  }
151
- function runCf(command, cwd = process.cwd(), bounds) {
152
+ function runCf(command, cwd = process.cwd(), bounds, interactive = false) {
152
153
  const env = cfEnvironment();
153
154
  env.CF_QUIET = "1";
154
155
  const child = spawnSync(process.execPath, [cf, ...command], {
@@ -159,7 +160,7 @@ function runCf(command, cwd = process.cwd(), bounds) {
159
160
  windowsHide: true,
160
161
  maxBuffer: bounds?.maxOutputBytes ?? 33554432,
161
162
  ...bounds ? { timeout: bounds.timeoutMs } : {},
162
- stdio: [
163
+ stdio: interactive ? "inherit" : [
163
164
  "ignore",
164
165
  "pipe",
165
166
  "pipe"
@@ -253,7 +254,7 @@ async function withBuildOutput(raw, sourceMain, action) {
253
254
  }), { mode: 384 });
254
255
  const accountId = process.env.CLOUDFLARE_ACCOUNT_ID ?? raw.account_id;
255
256
  if (typeof accountId !== "string" || !accountId) throw new Error("Cloudflare account is not pinned for Worker deployment.");
256
- const { prepareCfBuildOutput } = await import("../cf-build-output-BU3hqdHu.mjs");
257
+ const { prepareCfBuildOutput } = await import("../cf-build-output-BJHuSsVN.mjs");
257
258
  const output = await prepareCfBuildOutput(scratch, accountId);
258
259
  if (!output) throw new Error("Could not prepare the Cloudflare Worker build output.");
259
260
  try {
@@ -314,6 +315,14 @@ function d1Database(token) {
314
315
  table: typeof selected.migrations_table === "string" ? selected.migrations_table : "d1_migrations"
315
316
  };
316
317
  }
318
+ function previousD1Bookmark(stdout) {
319
+ try {
320
+ const previous = object(parsedJson(stdout)).previous_bookmark;
321
+ return isD1Bookmark(previous) ? previous : void 0;
322
+ } catch {
323
+ return;
324
+ }
325
+ }
317
326
  function cleanJson(command, transform) {
318
327
  const called = runCf(command);
319
328
  if (called.status !== 0 || !transform) return called;
@@ -568,6 +577,33 @@ async function resources() {
568
577
  if (!Array.isArray(pending) || pending.some((item) => typeof object(item).Name !== "string")) throw new Error("D1 migration list was malformed.");
569
578
  return result(0, "", called.stderr, { pending: pending.map((item) => object(item).Name) });
570
579
  }
580
+ case "d1.time-travel.bookmark": {
581
+ const called = runCf([
582
+ "d1",
583
+ "time-travel",
584
+ "get-bookmark",
585
+ d1Database(operation.database).id
586
+ ]);
587
+ if (called.status !== 0) return called;
588
+ const bookmark = object(parsedJson(called.stdout)).bookmark;
589
+ if (!isD1Bookmark(bookmark)) throw new Error("D1 Time Travel bookmark was malformed.");
590
+ return result(0, "", called.stderr, { bookmark });
591
+ }
592
+ case "d1.time-travel.restore": {
593
+ const database = d1Database(operation.database);
594
+ if ("bookmark" in operation.target && !isD1Bookmark(operation.target.bookmark)) throw new Error("D1 Time Travel bookmark was malformed.");
595
+ const target = "bookmark" in operation.target ? `--bookmark=${operation.target.bookmark}` : `--timestamp=${operation.target.timestamp}`;
596
+ const called = runCf([
597
+ "d1",
598
+ "time-travel",
599
+ "restore",
600
+ database.id,
601
+ target,
602
+ "--force"
603
+ ]);
604
+ if (called.status !== 0) return called;
605
+ return result(0, "", called.stderr, { previousBookmark: previousD1Bookmark(called.stdout) });
606
+ }
571
607
  case "containers.list": return runCf([
572
608
  "containers",
573
609
  "applications",
@@ -879,7 +915,7 @@ async function workerHistory() {
879
915
  ...operation.includeSource ? ["--include", "modules"] : []
880
916
  ], process.cwd(), operation.includeSource ? {
881
917
  timeoutMs: 3e4,
882
- maxOutputBytes: 1048576
918
+ maxOutputBytes: CF_VERSION_SOURCE_MAX_OUTPUT_BYTES
883
919
  } : void 0);
884
920
  if (called.status !== 0) return called;
885
921
  const version = object(parsedJson(called.stdout));
@@ -959,12 +995,22 @@ async function workerChanges() {
959
995
  if (raw.account_id !== void 0 && raw.account_id !== accountId()) throw new Error("Cloudflare trigger target changed.");
960
996
  return operation.type === "triggers.clear-crons" ? clearWorkerCronSchedules(name) : clearWorkerCustomDomains(name);
961
997
  }
962
- if (operation.type === "triggers.deploy") return withBuildOutput(raw, null, (directory) => runCf([
963
- "workers",
964
- "triggers",
965
- "deploy",
966
- "--prebuilt"
967
- ], directory));
998
+ if (operation.type === "triggers.deploy") {
999
+ const deployed = await withBuildOutput(raw, null, (directory) => runCf([
1000
+ "workers",
1001
+ "triggers",
1002
+ "deploy",
1003
+ "--prebuilt"
1004
+ ], directory));
1005
+ if (deployed.status === 0 && raw.observability !== void 0) await publishCloudflareObservability({
1006
+ apiBaseUrl: apiBaseUrl(),
1007
+ accountId: accountId(),
1008
+ workerName: name,
1009
+ observability: raw.observability,
1010
+ headers: await apiHeaders()
1011
+ });
1012
+ return deployed;
1013
+ }
968
1014
  if (operation.type === "versions.upload" || operation.type === "worker.deploy") {
969
1015
  const path = configPath();
970
1016
  if (typeof raw.main !== "string" || !raw.main || raw.no_bundle !== true) throw new Error("Cloudflare Worker upload requires a prebuilt platform Worker.");
@@ -979,8 +1025,8 @@ async function workerChanges() {
979
1025
  "--prebuilt",
980
1026
  ...request.message ? ["--message", request.message] : [],
981
1027
  ...request.secretsFilePath ? ["--secrets-file", request.secretsFilePath] : []
982
- ], directory));
983
- if (called.status !== 0) return called;
1028
+ ], directory, void 0, request.interactive === true));
1029
+ if (called.status !== 0 || request.interactive === true) return called;
984
1030
  let uploaded = {};
985
1031
  try {
986
1032
  uploaded = object(parsedJson(called.stdout));
@@ -1099,9 +1145,10 @@ async function main() {
1099
1145
  if (operation.type.startsWith("triggers.") || operation.type === "worker.deploy" || operation.type === "versions.upload" || operation.type === "queues.consumer.remove") return workerChanges();
1100
1146
  return resources();
1101
1147
  }
1148
+ const terminalOperation = operation?.type === "auth.login" || operation?.type === "tail" || (operation?.type === "versions.upload" || operation?.type === "worker.deploy") && operation.interactive === true;
1102
1149
  try {
1103
1150
  const output = await main();
1104
- if (operation.type !== "auth.login" && operation.type !== "tail") {
1151
+ if (!terminalOperation) {
1105
1152
  let data = output.data;
1106
1153
  let humanOutput = "";
1107
1154
  if (data === void 0 && output.stdout.trim()) try {
@@ -1127,7 +1174,7 @@ try {
1127
1174
  process.exitCode = output.status;
1128
1175
  } catch (error) {
1129
1176
  const message = error instanceof Error ? error.message : "Cloudflare operation failed.";
1130
- if (operation?.type !== "auth.login" && operation?.type !== "tail") process.stdout.write(JSON.stringify({
1177
+ if (!terminalOperation) process.stdout.write(JSON.stringify({
1131
1178
  operationResult: 1,
1132
1179
  errors: [{ message }]
1133
1180
  }) + "\n");
@@ -1,4 +1,4 @@
1
- import "../env-public-CCdykygU.mjs";
1
+ import "../env-public-6lqiSD2b.mjs";
2
2
  import "../types-CKWnYgfy.mjs";
3
3
  import "@void/deploy-cloudflare";
4
4
  //#region src/cli/env-validation.d.ts
@@ -1,4 +1,4 @@
1
- import { t as findEnvFile } from "../env-types-GRchm5dw.mjs";
1
+ import { t as findEnvFile } from "../env-types-BicfKBhV.mjs";
2
2
  import { writeSync } from "node:fs";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { spawnSync } from "node:child_process";
@@ -109,7 +109,7 @@ function emitResult(result) {
109
109
  writeSync(RESULT_FD, JSON.stringify(result));
110
110
  }
111
111
  async function runFactsChild(root) {
112
- const { deriveSelfHostSchemaFacts, SelfHostSchemaError } = await import("../env-validation-CuGfWRJd.mjs");
112
+ const { deriveSelfHostSchemaFacts, SelfHostSchemaError } = await import("../env-validation-BmsdCZEk.mjs");
113
113
  try {
114
114
  emitResult({
115
115
  kind: "ok",
@@ -128,7 +128,7 @@ async function runFactsChild(root) {
128
128
  }
129
129
  /** The parent already found the emitted config, so a read failure here fails closed. */
130
130
  async function runValidateEmittedChild(root) {
131
- const { computeInvalidEmittedKeys, readEmittedWorkerVars, SelfHostSchemaError } = await import("../env-validation-CuGfWRJd.mjs");
131
+ const { computeInvalidEmittedKeys, readEmittedWorkerVars, SelfHostSchemaError } = await import("../env-validation-BmsdCZEk.mjs");
132
132
  const emitted = readEmittedWorkerVars(root);
133
133
  if (!emitted.ok) {
134
134
  emitResult({