void 0.27.0 → 1.0.3

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 (337) hide show
  1. package/README.md +3 -1
  2. package/dist/{account-cmd-l-FM7Ioq.mjs → account-cmd-BTcUzv9L.mjs} +6 -6
  3. package/dist/{agents-B_pX_HmQ.mjs → agents-CuNtT0D_.mjs} +5 -2
  4. package/dist/{application-analysis-DKy02UY0.mjs → application-analysis-AB_YYWgH.mjs} +118 -135
  5. package/dist/{application-routing-DQyUh_5S.mjs → application-routing-L7V-TFhZ.mjs} +1 -2
  6. package/dist/atomic-write-Dq6R0BPN.mjs +18 -0
  7. package/dist/{auth-Dn2vw-SG.mjs → auth-B6iOCjKI.mjs} +23 -56
  8. package/dist/auth-Cbqi1iVX.mjs +1 -0
  9. package/dist/{auth-link-vz9Z2kmG.mjs → auth-link-DUJuvRx5.mjs} +11 -11
  10. package/dist/{auth-migrations-BwHgeEsD.mjs → auth-migrations-Cgs0k6lS.mjs} +28 -5
  11. package/dist/{auth-router-DvsCUVw4.mjs → auth-router-CIxiMG7i.mjs} +5 -5
  12. package/dist/base64-DVrOndmI.mjs +16 -0
  13. package/dist/{better-auth-shared-CPvWD3nG.d.mts → better-auth-shared-B74NJIus.d.mts} +8 -13
  14. package/dist/{better-auth-shared-DPpj8zxc.mjs → better-auth-shared-CMXlZG7W.mjs} +56 -68
  15. package/dist/{build-cmd-D6we0VjO.mjs → build-cmd-BkIv25PA.mjs} +6 -6
  16. package/dist/{cache-CZRdzKx1.mjs → cache-Ctzfig-W.mjs} +6 -6
  17. package/dist/{cancel-deploy-CQ3NnMvf.mjs → cancel-deploy-CD9o-SsC.mjs} +5 -5
  18. package/dist/{cf-access-TWNzXltp.mjs → cf-access-BM9G0lhO.mjs} +4 -3
  19. package/dist/{cf-access-BcIBSKqG.mjs → cf-access-CWP4avfP.mjs} +3 -7
  20. package/dist/cf-build-output-BU3hqdHu.mjs +1 -0
  21. package/dist/{cf-build-output-DjvB_872.mjs → cf-build-output-Bc8i3dzE.mjs} +2 -2
  22. package/dist/cf-user-agent-ChjQp2MU.mjs +33 -0
  23. package/dist/cli/cli.mjs +199 -312
  24. package/dist/cli/cloudflare-operation-process.mjs +41 -15
  25. package/dist/cli/env-schema-probe.d.mts +7 -44
  26. package/dist/cli/env-schema-probe.mjs +14 -80
  27. package/dist/client-B60PwCC4.mjs +1 -0
  28. package/dist/{client-DlDJuY0s.mjs → client-DM9Kcf4e.mjs} +161 -415
  29. package/dist/{cloudflare-auth-CuxfF6OA.mjs → cloudflare-auth-CqFBDo52.mjs} +12 -39
  30. package/dist/{cloudflare-cmd-lHqNlJGW.mjs → cloudflare-cmd-BIAF_BIY.mjs} +7 -6
  31. package/dist/{cloudflare-config-BmhBv3HV.mjs → cloudflare-config-DV60XFFK.mjs} +16 -28
  32. package/dist/{cloudflare-connect-2G3rL2rP.mjs → cloudflare-connect-WjwnVOJA.mjs} +4 -4
  33. package/dist/{cloudflare-operations-CwI1bChl.mjs → cloudflare-operations-B42EZeJy.mjs} +26 -34
  34. package/dist/cloudflare-operations-CrSUFRzJ.mjs +1 -0
  35. package/dist/{cloudflare-process-2-TfIEzB.mjs → cloudflare-process-CeDWJRhj.mjs} +12 -7
  36. package/dist/collect-Cae8A7Zr.mjs +1 -0
  37. package/dist/{collect-DiTn9yr6.mjs → collect-xjffdCdk.mjs} +1 -1
  38. package/dist/{config-CSa15FvD.d.mts → config-7qoq2p9v.d.mts} +2 -2
  39. package/dist/{config-CLYAosnQ.mjs → config-BEm9vRvS.mjs} +11 -5
  40. package/dist/{config-DiowPT80.mjs → config-Bx_1SpnO.mjs} +87 -177
  41. package/dist/{config-DPByhVck.mjs → config-D0GY5ItR.mjs} +1 -1
  42. package/dist/config-QrJWu0IX.mjs +1 -0
  43. package/dist/config-entry.d.mts +1 -1
  44. package/dist/{connect-BfPBHHm-.mjs → connect-CKtk-EZe.mjs} +9 -9
  45. package/dist/create-project-B-ewF_Af.mjs +1 -0
  46. package/dist/{create-project-BdXEFKal.mjs → create-project-yInGo72M.mjs} +8 -8
  47. package/dist/database-provider.mjs +1 -2
  48. package/dist/{db-Xs80hcaA.mjs → db-7I_gfdVq.mjs} +177 -268
  49. package/dist/db-types-Bb4WBWIs.mjs +49 -0
  50. package/dist/{delete-d2vuou3j.mjs → delete-Cy-M1u-r.mjs} +6 -6
  51. package/dist/deploy-9lgfhrXS.mjs +2 -0
  52. package/dist/deploy-BYYlnsiy.mjs +6164 -0
  53. package/dist/deploy-managed-static-Ca4TFdmx.mjs +1595 -0
  54. package/dist/deploy-transport-DWlWBe6M.mjs +180 -0
  55. package/dist/deploy.d.mts +10 -0
  56. package/dist/deploy.mjs +82 -0
  57. package/dist/dev-inbox-Rd6j_8vM.mjs +217 -0
  58. package/dist/discover-ClzFSwns.mjs +1 -0
  59. package/dist/{discover-CkCYv9T_.mjs → discover-D2PGT63u.mjs} +2 -2
  60. package/dist/dispatch-DrTTk8Xg.mjs +431 -0
  61. package/dist/{dist-D3m88sjf.mjs → dist-BVdsO7Py.mjs} +5 -6
  62. package/dist/dist-CfgIkieS.mjs +1 -0
  63. package/dist/{dist-BVqXeR_h.mjs → dist-ipQi0Q8y.mjs} +2 -3
  64. package/dist/{domain-BsDUBAvt.mjs → domain-CZGxPv9u.mjs} +8 -23
  65. package/dist/{dotenv-BfU6eqFt.mjs → dotenv-CNazY3-w.mjs} +4 -16
  66. package/dist/edge.mjs +1 -2
  67. package/dist/{email-d_Aux1vM.mjs → email-BcjSyAL0.mjs} +4 -20
  68. package/dist/{email-_lGAHOhp.mjs → email-DzyNVuoU.mjs} +100 -192
  69. package/dist/email-cloudflare-DfG6UEMm.mjs +1096 -0
  70. package/dist/email-protocol-D9nTvhCp.mjs +82 -0
  71. package/dist/{entry-CMAkqBmU.mjs → entry-ehmBvs5w.mjs} +2 -2
  72. package/dist/{env-DMA3cXZt.mjs → env-0jrMQJI_.mjs} +6 -14
  73. package/dist/{env-BxocywBB.mjs → env-BJjULvL0.mjs} +2 -2
  74. package/dist/{env-C74QepDE.mjs → env-Nx3yf50r.mjs} +9 -9
  75. package/dist/{env-public-DR7ZM6d-.d.mts → env-public-CCdykygU.d.mts} +6 -23
  76. package/dist/{env-raw-jZpP5n47.mjs → env-raw-D74P4ebM.mjs} +15 -21
  77. package/dist/{env-types-CwXgeMgL.mjs → env-types-DS2_y4X8.mjs} +2 -2
  78. package/dist/env-validation-BT7z-qpQ.mjs +1 -0
  79. package/dist/env-validation-DYxjz_Wo.mjs +488 -0
  80. package/dist/{gen-DtkQhvQg.mjs → gen-CufHEf42.mjs} +132 -254
  81. package/dist/gen-sXyp5DFO.mjs +1 -0
  82. package/dist/generate-ClI89brV.mjs +1 -0
  83. package/dist/{generate-GDbL7sUr.mjs → generate-Dat0UTry.mjs} +38 -4
  84. package/dist/generated-wrangler-config-DeWj5F9Y.mjs +18 -0
  85. package/dist/{github-cmd-DaDdBbSS.mjs → github-cmd-FU8EjFyU.mjs} +28 -72
  86. package/dist/{handler-BHAn2fZJ.mjs → handler-BZ1t7-Rv.mjs} +2 -2
  87. package/dist/{handler-CNAwjRcW.d.mts → handler-_PqY82xe.d.mts} +1 -1
  88. package/dist/{headers-DlfR78Nu.mjs → headers-Di1FsD3e.mjs} +26 -81
  89. package/dist/{help-0bTe_lID.mjs → help-BT2hovNI.mjs} +26 -14
  90. package/dist/help-i2YGGnTH.mjs +1 -0
  91. package/dist/{inbound-PfQDLXc5.mjs → inbound-BuTfm11U.mjs} +71 -222
  92. package/dist/{inbound-CH5Mksyy.d.mts → inbound-brj2-TM5.d.mts} +19 -58
  93. package/dist/index.d.mts +2 -18
  94. package/dist/index.mjs +714 -762
  95. package/dist/{info-PYWwkWyt.mjs → info-l249eUdH.mjs} +5 -5
  96. package/dist/{init-DaBGmaXC.mjs → init-D0A6M64Q.mjs} +229 -392
  97. package/dist/isr-config-fZaJJ8t7.mjs +165 -0
  98. package/dist/{link-C6fjafep.mjs → link-WMoJFf4i.mjs} +9 -9
  99. package/dist/{list-BTFBlqKl.mjs → list-CQ2EQEHL.mjs} +7 -18
  100. package/dist/{live-CgQuTpqD.mjs → live-BcHoTDFe.mjs} +19 -17
  101. package/dist/{live-Du8jXwOW.d.mts → live-DJONVlQK.d.mts} +1 -1
  102. package/dist/load-user-env-DD5qveNU.mjs +49 -0
  103. package/dist/{local-d1-ga5O_idV.mjs → local-d1-BxvQYEFi.mjs} +6 -6
  104. package/dist/{login-GKcNUmtI.mjs → login-C2T1oVG-.mjs} +12 -12
  105. package/dist/login-XD844Xs-.mjs +1 -0
  106. package/dist/{logs-BiMSULmc.mjs → logs-DnC1d7xB.mjs} +6 -6
  107. package/dist/{migrate-NLsjBbuM.mjs → migrate-BDIprOYd.mjs} +70 -22
  108. package/dist/migrate-BRwU-blY.mjs +1 -0
  109. package/dist/migration-handler-Cg0Y4EPu.mjs +470 -0
  110. package/dist/{migration-handler-DM4clYj5.d.mts → migration-handler-CwlEQUoo.d.mts} +17 -26
  111. package/dist/{mime-DxCznlJq.mjs → mime-srOklVVv.mjs} +92 -395
  112. package/dist/mysql-migration-sql-BIS5vbNk.mjs +241 -0
  113. package/dist/nitro.d.mts +30 -0
  114. package/dist/nitro.mjs +88 -0
  115. package/dist/{node-DJicPvPj.mjs → node-cPadMgUO.mjs} +9 -25
  116. package/dist/{operator-args-DOBhIaIg.mjs → operator-args-UnE8Y2eK.mjs} +27 -26
  117. package/dist/{operator-auth-BEZ_u0Cz.mjs → operator-auth-Cr2zCc-J.mjs} +2 -2
  118. package/dist/{operator-client-DbDv4vtE.mjs → operator-client-C-ROjk1I.mjs} +4 -4
  119. package/dist/operator-cmd-D6gnZsnK.mjs +1 -0
  120. package/dist/{operator-cmd-BT4hgavL.mjs → operator-cmd-DHieWtFp.mjs} +8 -8
  121. package/dist/{output-C50ag2r3.mjs → output-Ba6ZbrzY.mjs} +37 -6
  122. package/dist/{package-json-DXfiT1jV.mjs → package-json-BjYqR-So.mjs} +1 -1
  123. package/dist/pages/client.d.mts +1 -1
  124. package/dist/pages/client.mjs +91 -5
  125. package/dist/pages/head.mjs +1 -2
  126. package/dist/pages/index.d.mts +1 -2
  127. package/dist/pages/index.mjs +6 -6
  128. package/dist/pages/islands-plugin.mjs +5 -83
  129. package/dist/pages/prefetch.mjs +1 -2
  130. package/dist/pages/protocol.d.mts +2 -2
  131. package/dist/pages/protocol.mjs +1 -1
  132. package/dist/pages/serialize.mjs +1 -2
  133. package/dist/plan-CKX_jWnD.mjs +1 -0
  134. package/dist/platform-args-B0HeTh0C.mjs +1 -0
  135. package/dist/{platform-args-DUeXY9Om.mjs → platform-args-CaCL_1Ch.mjs} +43 -60
  136. package/dist/{platform-auth-config-CkSx3usH.mjs → platform-auth-config-Z16-I8nT.mjs} +11 -12
  137. package/dist/{platform-auth-protection-BJimB_p9.mjs → platform-auth-protection-BXwZiJSF.mjs} +37 -27
  138. package/dist/{platform-auth-recovery-BU6izFAU.mjs → platform-auth-recovery-CXjfqyOv.mjs} +9 -10
  139. package/dist/{platform-cmd-BbY1dWiM.mjs → platform-cmd-DaAOiWTl.mjs} +16 -16
  140. package/dist/platform-cmd-PT4YwMLM.mjs +1 -0
  141. package/dist/{platform-discovery-DIYz8V63.mjs → platform-discovery-CHhNs8Nn.mjs} +1 -1
  142. package/dist/{platform-domain-CHVS6cV0.mjs → platform-domain-CxpvUeo0.mjs} +6 -6
  143. package/dist/{platform-lifecycle-DzCwqhFq.mjs → platform-lifecycle-DBiS0cJd.mjs} +1693 -2120
  144. package/dist/platform-lifecycle-u9pMOvxC.mjs +1 -0
  145. package/dist/{platform-management-CuuVDhyt.mjs → platform-management-DhEFdQAf.mjs} +696 -130
  146. package/dist/platform-management-DvBS83rC.mjs +1 -0
  147. package/dist/{platform-plans-config-CN-heS4q.mjs → platform-plans-config-BWn1S2Rv.mjs} +16 -12
  148. package/dist/{platform-recovery-CskSJgLh.mjs → platform-recovery-BUGOB4RC.mjs} +6 -9
  149. package/dist/{platform-registry-Cjv2Qf0r.mjs → platform-registry-B9mWX9LO.mjs} +13 -18
  150. package/dist/{platform-setup-BBxRxmFC.mjs → platform-setup-YvN9VQXV.mjs} +21 -28
  151. package/dist/{plugin-inference-BlQbOL0P.mjs → plugin-inference-DsARdQKE.mjs} +18 -33
  152. package/dist/prepare-CYT6tAzD.mjs +1 -0
  153. package/dist/{prepare-Do96654b.mjs → prepare-DEB5SeVJ.mjs} +12 -13
  154. package/dist/{prepare-Dq9hTIbo.mjs → prepare-PQCgsny0.mjs} +4 -4
  155. package/dist/{prerender-render-Ct20jftc.mjs → prerender-render-Bfsumdkv.mjs} +8 -2
  156. package/dist/prerender-render.d.mts +2 -0
  157. package/dist/prerender-render.mjs +1 -2
  158. package/dist/{project-cmd-DaoRrn-8.mjs → project-cmd-DVatD8Ev.mjs} +20 -20
  159. package/dist/{project-paths-GgcMozYz.mjs → project-paths-DMvEeSau.mjs} +9 -14
  160. package/dist/{project-BAm2aB6Q.mjs → project-rqDnVsJN.mjs} +8 -4
  161. package/dist/project-slug-6cyz8E7k.mjs +1 -0
  162. package/dist/{project-team-Q_lCA7Io.mjs → project-team-DJrWEAG1.mjs} +7 -7
  163. package/dist/{project-token-BArgK9o1.mjs → project-token-CBgLBuL6.mjs} +6 -6
  164. package/dist/{project-tsconfig-CVJhNMxs.mjs → project-tsconfig-bveqhlYA.mjs} +3 -5
  165. package/dist/project-zdB3fs9G.mjs +1 -0
  166. package/dist/{project-zero-trust-KO9Hu2Pq.mjs → project-zero-trust-92gLtZ25.mjs} +6 -6
  167. package/dist/{protocol-BPZaNqBo.d.mts → protocol-4H7V_3Os.d.mts} +1 -1
  168. package/dist/{protocol-CfaUwNs8.mjs → protocol-RNP0u7UY.mjs} +9 -3
  169. package/dist/{provision-BfaLiWbj.mjs → provision-BnSSkiED.mjs} +119 -866
  170. package/dist/{requests-C7Oeoh5u.mjs → requests-7W1Pygt2.mjs} +5 -5
  171. package/dist/resolve-project-PnhzMtY6.mjs +1 -0
  172. package/dist/resolve-project-WpwkCB_c.mjs +48 -0
  173. package/dist/{rollback-DVAtrLAl.mjs → rollback-BcASVnwP.mjs} +8 -18
  174. package/dist/{route-types-CbtsIeFn.mjs → route-types-BZi26DVS.mjs} +9 -91
  175. package/dist/routing-assets-VkrKIbxE.mjs +139 -0
  176. package/dist/{runner-DMBKSrRk.mjs → runner-CabsQ-iM.mjs} +22 -34
  177. package/dist/runner-So9mYfcm.mjs +1 -0
  178. package/dist/runner-mysql-BhRaONkO.mjs +146 -0
  179. package/dist/runner-mysql-DWwE8jKi.mjs +1 -0
  180. package/dist/{runner-pg-DV8p_zjA.mjs → runner-pg-BRemq_GX.mjs} +3 -3
  181. package/dist/runner-pg-_Xncr3H5.mjs +1 -0
  182. package/dist/runtime/ai.mjs +23 -25
  183. package/dist/runtime/auth-client-react.mjs +1 -2
  184. package/dist/runtime/auth-client-solid.mjs +1 -2
  185. package/dist/runtime/auth-client-svelte.mjs +1 -2
  186. package/dist/runtime/auth-client-vue.mjs +1 -2
  187. package/dist/runtime/auth-client.mjs +1 -2
  188. package/dist/runtime/auth.mjs +1 -2
  189. package/dist/runtime/better-auth-mysql.d.mts +2 -5
  190. package/dist/runtime/better-auth-mysql.mjs +9 -31
  191. package/dist/runtime/better-auth-pg.d.mts +2 -5
  192. package/dist/runtime/better-auth-pg.mjs +6 -32
  193. package/dist/runtime/better-auth.d.mts +2 -4
  194. package/dist/runtime/better-auth.mjs +9 -19
  195. package/dist/runtime/db.mjs +6 -2
  196. package/dist/runtime/durable.d.mts +18 -1
  197. package/dist/runtime/durable.mjs +26 -2
  198. package/dist/runtime/email/testing.d.mts +1 -1
  199. package/dist/runtime/email/testing.mjs +9 -23
  200. package/dist/runtime/email-protocol.d.mts +12 -0
  201. package/dist/runtime/email-protocol.mjs +1 -70
  202. package/dist/runtime/email.d.mts +1 -1
  203. package/dist/runtime/email.mjs +79 -221
  204. package/dist/runtime/env-public.d.mts +1 -1
  205. package/dist/runtime/env-public.mjs +12 -38
  206. package/dist/runtime/env.d.mts +1 -12
  207. package/dist/runtime/env.mjs +1 -2
  208. package/dist/runtime/handler.d.mts +1 -1
  209. package/dist/runtime/handler.mjs +1 -1
  210. package/dist/runtime/isr.mjs +1 -1
  211. package/dist/runtime/kv.mjs +1 -1
  212. package/dist/runtime/limits.mjs +1 -2
  213. package/dist/runtime/live-client.d.mts +3 -2
  214. package/dist/runtime/live-server.d.mts +2 -1
  215. package/dist/runtime/live-server.mjs +1 -16
  216. package/dist/runtime/live.d.mts +1 -1
  217. package/dist/runtime/live.mjs +1 -2
  218. package/dist/runtime/log.d.mts +2 -1
  219. package/dist/runtime/migration-handler-mysql.d.mts +2 -2
  220. package/dist/runtime/migration-handler-mysql.mjs +39 -8
  221. package/dist/runtime/migration-handler-pg.d.mts +2 -2
  222. package/dist/runtime/migration-handler-pg.mjs +1 -1
  223. package/dist/runtime/migration-handler.d.mts +2 -2
  224. package/dist/runtime/migration-handler.mjs +1 -470
  225. package/dist/runtime/queues.mjs +1 -1
  226. package/dist/runtime/remote/binding-handler.mjs +62 -62
  227. package/dist/runtime/remote/index.mjs +16 -77
  228. package/dist/runtime/response.mjs +1 -2
  229. package/dist/runtime/route-url.mjs +1 -2
  230. package/dist/runtime/routing.d.mts +3 -5
  231. package/dist/runtime/routing.mjs +82 -218
  232. package/dist/runtime/sandbox-container.d.mts +2 -2
  233. package/dist/runtime/sandbox-container.mjs +1 -2
  234. package/dist/runtime/sandbox.d.mts +2 -2
  235. package/dist/runtime/sandbox.mjs +13 -6
  236. package/dist/runtime/seed.d.mts +2 -1
  237. package/dist/runtime/sse.mjs +1 -2
  238. package/dist/runtime/storage.mjs +1 -1
  239. package/dist/runtime/validator.d.mts +1 -1
  240. package/dist/runtime/validator.mjs +1 -2
  241. package/dist/runtime/ws-server.d.mts +4 -4
  242. package/dist/runtime/ws-server.mjs +6 -28
  243. package/dist/runtime/ws.d.mts +1 -1
  244. package/dist/{sandbox-container-Bo0eiFKz.d.mts → sandbox-container-ChQRum-j.d.mts} +3 -1
  245. package/dist/{sandbox-container-C6ItmVuN.mjs → sandbox-container-a9LRUtii.mjs} +13 -2
  246. package/dist/{sandbox-C5LFoJMf.d.mts → sandbox-q3waMc2T.d.mts} +1 -1
  247. package/dist/{scan-C3uDzz6J.mjs → scan-C0BMdmEd.mjs} +84 -7
  248. package/dist/{secret-BvtB7IjY.mjs → secret-bg73f1Ge.mjs} +63 -81
  249. package/dist/{serialize-BPvnNQuA.mjs → serialize-BtQyaYoC.mjs} +10 -4
  250. package/dist/{skills-BgVMvQdy.mjs → skills-C_yRTg0g.mjs} +3 -3
  251. package/dist/{subcommand-prompt-BSlnD1fI.mjs → subcommand-prompt-Bm3ZlYgA.mjs} +39 -44
  252. package/dist/sveltekit.d.mts +2 -1
  253. package/dist/sveltekit.mjs +1 -1
  254. package/dist/validate-BQFdf0Pi.mjs +1 -0
  255. package/dist/{validate-C9qJArv7.mjs → validate-CheZGRE7.mjs} +4 -8
  256. package/dist/version-metadata-DIrqEHQo.mjs +73 -0
  257. package/dist/{wrangler-D9KTuqnv.mjs → wrangler-BYs07Rxy.mjs} +119 -378
  258. package/dist/wrapper-CwhpNWtH.mjs +663 -0
  259. package/dist/{ws-CChrrAU-.d.mts → ws-aKVYB-fA.d.mts} +1 -1
  260. package/dist/yarn-pnp-DLbEFMT0.mjs +92 -0
  261. package/docs/guide/ai.md +8 -2
  262. package/docs/guide/auth.md +2 -0
  263. package/docs/guide/database/mysql.md +14 -3
  264. package/docs/guide/database/postgresql.md +2 -0
  265. package/docs/guide/database.md +3 -5
  266. package/docs/guide/durable-state.md +32 -4
  267. package/docs/guide/platform/administration/access.md +4 -0
  268. package/docs/guide/platform/administration/connected-apps.md +55 -0
  269. package/docs/guide/platform/installation/credentials.md +21 -3
  270. package/docs/guide/platform/installation/domains.md +1 -1
  271. package/docs/guide/platform/installation/maintenance.md +38 -1
  272. package/docs/guide/platform/installation/prerequisites.md +6 -2
  273. package/docs/guide/platform/installation/setup.md +23 -1
  274. package/docs/guide/platform/installation/uninstall.md +6 -1
  275. package/docs/guide/quickstart.md +2 -0
  276. package/docs/guide/sandboxes.md +3 -1
  277. package/docs/guide/self-hosted-platform.md +1 -1
  278. package/docs/integrations/cloudflare.md +2 -2
  279. package/docs/integrations/frameworks/analog.md +3 -11
  280. package/docs/integrations/frameworks/nuxt.md +7 -10
  281. package/docs/integrations/nodejs-bun-deno.md +2 -0
  282. package/docs/reference/api/deploy.md +23 -0
  283. package/docs/reference/api/pages.md +2 -0
  284. package/docs/reference/api.md +3 -1
  285. package/docs/reference/cli/database.md +9 -3
  286. package/docs/reference/cli/platform-installation.md +19 -7
  287. package/docs/reference/cli/setup.md +2 -0
  288. package/docs/reference/config.md +2 -0
  289. package/package.json +39 -36
  290. package/sandbox.Dockerfile +1 -1
  291. package/skills/void/SKILL.md +2 -1
  292. package/dist/auth-LMJcNESe.mjs +0 -2
  293. package/dist/cf-build-output-H9a97vME.mjs +0 -2
  294. package/dist/cf-user-agent-lKblH3zU.mjs +0 -17
  295. package/dist/client-tso2OfcG.mjs +0 -2
  296. package/dist/cloudflare-operations-BlYLlowZ.mjs +0 -2
  297. package/dist/collect-DLyFDiKW.mjs +0 -2
  298. package/dist/config-5r-YpMC-.mjs +0 -2
  299. package/dist/config-B_ggY-IO.mjs +0 -89
  300. package/dist/config-BtSFvXZx.mjs +0 -2
  301. package/dist/config-write-AHGesphx.mjs +0 -61
  302. package/dist/create-project-qFDC45zg.mjs +0 -2
  303. package/dist/deploy-Bqe1PYBw.mjs +0 -10458
  304. package/dist/deploy-VsWsVQkw.mjs +0 -2
  305. package/dist/dev-inbox-CK-UuPob.mjs +0 -297
  306. package/dist/discover-EDUf6JJw.mjs +0 -2
  307. package/dist/dist-Bx1z6Eva.mjs +0 -2
  308. package/dist/dist-_UUlL6bg.mjs +0 -2
  309. package/dist/env-validation-CrVNjsPm.mjs +0 -2
  310. package/dist/env-validation-Dxdx_5wo.mjs +0 -951
  311. package/dist/gen-dA9hW7AV.mjs +0 -2
  312. package/dist/head-client-DzmJGN4C.mjs +0 -90
  313. package/dist/help-DfQYVfGY.mjs +0 -2
  314. package/dist/login-mx_ydhmp.mjs +0 -2
  315. package/dist/migrate-BHp07yJE.mjs +0 -2
  316. package/dist/operator-cmd-CwBB-1yb.mjs +0 -2
  317. package/dist/pages/head-client.d.mts +0 -13
  318. package/dist/pages/head-client.mjs +0 -2
  319. package/dist/plan-CH2G51je.mjs +0 -2
  320. package/dist/platform-args-D4E1PjVw.mjs +0 -2
  321. package/dist/platform-cmd-BbmJiq5O.mjs +0 -2
  322. package/dist/platform-lifecycle-ByAlpkhV.mjs +0 -2
  323. package/dist/platform-management-CBOT4BSM.mjs +0 -2
  324. package/dist/prepare-DRUV-g3X.mjs +0 -2
  325. package/dist/project-DedqCp59.mjs +0 -2
  326. package/dist/project-slug-DofjTFd-.mjs +0 -2
  327. package/dist/provision-Wu9ZBk9L.mjs +0 -2
  328. package/dist/resolve-project-BIeYs9Cw.mjs +0 -2
  329. package/dist/resolve-project-CP8rZs_p.mjs +0 -28
  330. package/dist/runner-9wjsSZx-.mjs +0 -2
  331. package/dist/runner-mysql-CEzKtmFb.mjs +0 -54
  332. package/dist/runner-mysql-CkFqZ6CE.mjs +0 -2
  333. package/dist/runner-pg-BGYRFdRp.mjs +0 -2
  334. package/dist/runtime/env-helpers.d.mts +0 -2
  335. package/dist/runtime/env-helpers.mjs +0 -2
  336. package/dist/validate-BJr9LfXy.mjs +0 -2
  337. package/dist/yarn-pnp-CUX_iTPA.mjs +0 -188
@@ -0,0 +1,241 @@
1
+ import { n as splitMigrationSql } from "./migration-handler-Cg0Y4EPu.mjs";
2
+ import { createHash, randomUUID } from "node:crypto";
3
+ //#region src/runtime/migration-lock-mysql.ts
4
+ /**
5
+ * Migration runs on one MySQL database exclude each other with two kinds of lock, and each run
6
+ * checks for the other kind after it takes its own:
7
+ *
8
+ * - The CLI runner holds a named lock (GET_LOCK) for its session, so it ends with the connection.
9
+ * - The hosted handler reaches MySQL through Hyperdrive, which pools connections per transaction,
10
+ * so a session lock could stay on a pooled connection or be reset away. It writes a lease row
11
+ * with an expiry instead, using one statement at a time. Lease times are UTC: NOW() follows
12
+ * each session's time zone and its DST changes, and DATETIME stores no zone.
13
+ */
14
+ /** Hyperdrive ends a statement after 60 seconds, and the hosted handler renews before each one. */
15
+ const LEASE_SECONDS = 120;
16
+ /** A deploy waits long enough for the lease of a run that stopped early to expire. */
17
+ const DEPLOY_WAIT_MS = 13e4;
18
+ const POLL_MS = 1e3;
19
+ /** How often the lease is renewed while statements that cannot renew it themselves run. */
20
+ const KEEP_ALIVE_MS = 3e4;
21
+ /**
22
+ * The CLI runner's named lock. Lock names are server-wide and at most 64 characters, so the name
23
+ * carries a hash of the database name. Vitess reports a connection's target (`app@primary`,
24
+ * `app:-80@replica`) in DATABASE(), and the lock belongs to the keyspace.
25
+ */
26
+ function mySqlMigrationLockName(database) {
27
+ return `void_migrations:${createHash("sha1").update(database.split(/[:@]/)[0]).digest("hex")}`;
28
+ }
29
+ function mySqlMigrationLockError(database, retry) {
30
+ return /* @__PURE__ */ new Error(`Another migration run is applying migrations to MySQL database "${database}". Wait for it to finish, then ${retry}.`);
31
+ }
32
+ /**
33
+ * Seconds left on a deploy's lease, or undefined when no deploy holds one. The CLI runner calls
34
+ * this while it holds the named lock.
35
+ */
36
+ async function readMySqlMigrationLease(query) {
37
+ try {
38
+ const [row] = rowsOf(await query("SELECT TIMESTAMPDIFF(SECOND, UTC_TIMESTAMP(6), `expires_at`) AS remaining FROM `_void_migration_lock` WHERE `name` = 'app' AND `expires_at` > UTC_TIMESTAMP(6)"));
39
+ return row ? Number(row.remaining) : void 0;
40
+ } catch (error) {
41
+ if (isMissingTable(error)) return;
42
+ throw error;
43
+ }
44
+ }
45
+ /**
46
+ * Takes the lease for a hosted run. It waits while another deploy holds the lease or a CLI run
47
+ * holds the named lock, and throws when that takes too long.
48
+ */
49
+ async function acquireMySqlMigrationLease(query) {
50
+ const [row] = rowsOf(await query("SELECT DATABASE() AS db"));
51
+ const database = String(row?.db ?? "");
52
+ const lockName = mySqlMigrationLockName(database);
53
+ const owner = randomUUID();
54
+ await query("CREATE TABLE IF NOT EXISTS `_void_migration_lock` (`name` VARCHAR(64) NOT NULL PRIMARY KEY, `owner` VARCHAR(64) NOT NULL, `expires_at` DATETIME(6) NOT NULL)");
55
+ const lease = {
56
+ async renew() {
57
+ if (affectedRows(await query("UPDATE `_void_migration_lock` SET `expires_at` = UTC_TIMESTAMP(6) + INTERVAL ? SECOND WHERE `name` = 'app' AND `owner` = ? AND `expires_at` > UTC_TIMESTAMP(6)", [LEASE_SECONDS, owner])) !== 1) throw new Error(`The migration lock on MySQL database "${database}" expired before this run finished. Deploy again.`);
58
+ },
59
+ async release() {
60
+ await query("UPDATE `_void_migration_lock` SET `expires_at` = UTC_TIMESTAMP(6) - INTERVAL 1 SECOND WHERE `name` = 'app' AND `owner` = ?", [owner]);
61
+ }
62
+ };
63
+ const deadline = Date.now() + DEPLOY_WAIT_MS;
64
+ for (;;) {
65
+ if (await take(query, owner)) {
66
+ const [lock] = rowsOf(await query("SELECT IS_USED_LOCK(?)", [lockName]));
67
+ if (Object.values(lock ?? {})[0] == null) return lease;
68
+ await lease.release();
69
+ }
70
+ if (Date.now() >= deadline) throw mySqlMigrationLockError(database, "deploy again");
71
+ await new Promise((resolve) => setTimeout(resolve, POLL_MS));
72
+ }
73
+ }
74
+ /**
75
+ * Runs `work`, whose statements cannot renew the lease before each one (Better Auth's migrations),
76
+ * and renews the lease in the background meanwhile. Throws after `work` when a renewal failed,
77
+ * because another run may have taken the lease.
78
+ */
79
+ async function holdMySqlMigrationLease(lease, work) {
80
+ await lease.renew();
81
+ let failure;
82
+ let renewal = Promise.resolve();
83
+ const timer = setInterval(() => {
84
+ renewal = renewal.then(() => lease.renew()).catch((error) => {
85
+ failure ??= { error };
86
+ });
87
+ }, KEEP_ALIVE_MS);
88
+ let result;
89
+ try {
90
+ result = await work();
91
+ } finally {
92
+ clearInterval(timer);
93
+ await renewal;
94
+ }
95
+ if (failure) throw failure.error;
96
+ return result;
97
+ }
98
+ async function take(query, owner) {
99
+ try {
100
+ return await tryTake(query, owner);
101
+ } catch (error) {
102
+ if (errnoOf(error) === 1213) return false;
103
+ throw error;
104
+ }
105
+ }
106
+ async function tryTake(query, owner) {
107
+ if (affectedRows(await query("INSERT IGNORE INTO `_void_migration_lock` (`name`, `owner`, `expires_at`) VALUES ('app', ?, UTC_TIMESTAMP(6) + INTERVAL ? SECOND)", [owner, LEASE_SECONDS])) === 1) return true;
108
+ return affectedRows(await query("UPDATE `_void_migration_lock` SET `owner` = ?, `expires_at` = UTC_TIMESTAMP(6) + INTERVAL ? SECOND WHERE `name` = 'app' AND `expires_at` < UTC_TIMESTAMP(6)", [owner, LEASE_SECONDS])) === 1;
109
+ }
110
+ function rowsOf(result) {
111
+ return Array.isArray(result) ? result : [];
112
+ }
113
+ function affectedRows(result) {
114
+ return Number(result?.affectedRows ?? 0);
115
+ }
116
+ function isMissingTable(error) {
117
+ const value = typeof error === "object" && error !== null ? error : void 0;
118
+ return value?.code === "ER_NO_SUCH_TABLE" || value?.errno === 1146;
119
+ }
120
+ function errnoOf(error) {
121
+ return typeof error === "object" && error !== null ? error.errno : void 0;
122
+ }
123
+ //#endregion
124
+ //#region src/runtime/mysql-migration-sql.ts
125
+ /**
126
+ * Splits a MySQL migration file into the statements Void runs one query at a time. Hyperdrive
127
+ * does not accept several statements in one query, and a file that runs statement by statement
128
+ * can tell whether a failure left earlier statements committed.
129
+ *
130
+ * The file first splits at drizzle-kit `--> statement-breakpoint` lines. Each part then splits at
131
+ * semicolons outside strings, quoted names and comments, and drops comments after its last
132
+ * statement. A statement that defines a trigger, routine or event keeps the rest of its part with
133
+ * it: the semicolons in its BEGIN ... END body cannot be told apart from the ones between
134
+ * statements without a parser.
135
+ */
136
+ function splitMySqlMigrationSql(sql) {
137
+ return splitMySqlMigrationStatements(sql).map((statement) => statement.sql);
138
+ }
139
+ /** {@link splitMySqlMigrationSql}, with each statement marked. */
140
+ function splitMySqlMigrationStatements(sql) {
141
+ return splitMigrationSql(sql).flatMap((part) => {
142
+ const statements = splitMySqlStatements(part);
143
+ return statements.length > 0 ? statements : [{
144
+ sql: part,
145
+ program: false
146
+ }];
147
+ });
148
+ }
149
+ /**
150
+ * The start of a statement whose body can hold semicolons: a stored program, after options such
151
+ * as DEFINER, or a compound statement that MariaDB also runs outside one. It is matched against
152
+ * the statement with quoted text and comments blanked out, so a column named `event` or a plain
153
+ * `BEGIN` transaction does not match.
154
+ */
155
+ const COMPOUND_START = new RegExp([
156
+ `^\\s*(?:CREATE|ALTER)\\s+(?:(?!(?:TABLE|INDEX|VIEW|DATABASE|SCHEMA|USER|ROLE|TABLESPACE|SERVER|UNIQUE|FULLTEXT|SPATIAL|TEMPORARY)\\b)\\S+\\s+){0,8}?(?:TRIGGER|PROCEDURE|FUNCTION|EVENT|PACKAGE)\\b`,
157
+ "^\\s*BEGIN\\s+NOT\\s+ATOMIC\\b",
158
+ "^\\s*(?:\\w+\\s*:\\s*)?(?:BEGIN|IF|CASE|LOOP|REPEAT|WHILE)\\b(?!\\s*(?:WORK\\s*)?$)"
159
+ ].join("|"), "i");
160
+ /** The statements in `sql`, without the comments around them. */
161
+ function splitMySqlStatements(sql) {
162
+ const statements = [];
163
+ let bare = "";
164
+ let start = -1;
165
+ let end = -1;
166
+ let compound = false;
167
+ let index = 0;
168
+ const take = (from, to) => {
169
+ if (start === -1) start = from;
170
+ end = to;
171
+ };
172
+ while (index < sql.length) {
173
+ const character = sql[index];
174
+ const next = sql[index + 1];
175
+ if (character === "'" || character === "\"" || character === "`") {
176
+ const close = skipQuoted(sql, index, character);
177
+ take(index, close);
178
+ bare += " ";
179
+ index = close;
180
+ continue;
181
+ }
182
+ if (character === "#" || character === "-" && next === "-" && !/\S/.test(sql[index + 2] ?? " ")) {
183
+ const newline = sql.indexOf("\n", index);
184
+ index = newline === -1 ? sql.length : newline;
185
+ bare += " ";
186
+ continue;
187
+ }
188
+ if (character === "/" && next === "*") {
189
+ const close = sql.indexOf("*/", index + 2);
190
+ const commentEnd = close === -1 ? sql.length : close + 2;
191
+ if (sql[index + 2] === "!" || sql[index + 2] === "+") take(index, commentEnd);
192
+ bare += " ";
193
+ index = commentEnd;
194
+ continue;
195
+ }
196
+ if (character === ";" && !compound) {
197
+ if (start !== -1 && COMPOUND_START.test(bare)) compound = true;
198
+ else {
199
+ if (start !== -1) statements.push({
200
+ sql: sql.slice(start, index + 1),
201
+ program: false
202
+ });
203
+ start = -1;
204
+ end = -1;
205
+ bare = "";
206
+ index++;
207
+ continue;
208
+ }
209
+ }
210
+ bare += character;
211
+ if (!/\s/.test(character)) take(index, index + 1);
212
+ index++;
213
+ }
214
+ if (start !== -1) statements.push({
215
+ sql: sql.slice(start, end),
216
+ program: compound
217
+ });
218
+ return statements;
219
+ }
220
+ /** The index after the quoted string or name that opens at `open`. */
221
+ function skipQuoted(sql, open, quote) {
222
+ let index = open + 1;
223
+ while (index < sql.length) {
224
+ const character = sql[index];
225
+ if (character === "\\" && quote !== "`") {
226
+ index += 2;
227
+ continue;
228
+ }
229
+ if (character === quote) {
230
+ if (sql[index + 1] === quote) {
231
+ index += 2;
232
+ continue;
233
+ }
234
+ return index + 1;
235
+ }
236
+ index++;
237
+ }
238
+ return sql.length;
239
+ }
240
+ //#endregion
241
+ export { mySqlMigrationLockError as a, holdMySqlMigrationLease as i, splitMySqlMigrationStatements as n, mySqlMigrationLockName as o, acquireMySqlMigrationLease as r, readMySqlMigrationLease as s, splitMySqlMigrationSql as t };
@@ -0,0 +1,30 @@
1
+ //#region src/nitro.d.ts
2
+ /** The parts of a Nitro instance that the module uses. */
3
+ type NitroInstance = {
4
+ options: {
5
+ dev: boolean;
6
+ rootDir: string;
7
+ buildDir: string;
8
+ exportConditions?: Array<string>;
9
+ plugins: Array<string>;
10
+ virtual: Record<string, string | (() => string | Promise<string>)>;
11
+ rollupConfig?: {
12
+ plugins?: unknown;
13
+ };
14
+ cloudflare?: {
15
+ nodeCompat?: boolean;
16
+ };
17
+ };
18
+ };
19
+ /**
20
+ * Nitro module for apps whose server routes Nitro bundles (Nuxt and Analog). Nitro's bundler
21
+ * does not run Vite plugins, so without this module `void/db` in a server route, page server
22
+ * load or cron job is the package's D1 client without the app's schema. Register it in the
23
+ * Nitro config: `modules: ['void/nitro']`.
24
+ */
25
+ declare const voidNitroModule: {
26
+ name: string;
27
+ setup(nitro: NitroInstance): void;
28
+ };
29
+ //#endregion
30
+ export { voidNitroModule as default };
package/dist/nitro.mjs ADDED
@@ -0,0 +1,88 @@
1
+ import { a as join, n as dirname } from "./dist-ipQi0Q8y.mjs";
2
+ import { d as readConfig, s as getDatabaseDialect } from "./config-Bx_1SpnO.mjs";
3
+ import { r as voidDbBundlerPlugin } from "./dispatch-DrTTk8Xg.mjs";
4
+ import { n as bundleWorkerSqlDriver } from "./wrapper-CwhpNWtH.mjs";
5
+ import { fileURLToPath } from "node:url";
6
+ import { normalizePath } from "vite";
7
+ import { resolve } from "node:path/win32";
8
+ //#region src/nitro.ts
9
+ const envModuleFile = fileURLToPath(import.meta.resolve("#self/_env"));
10
+ const packageDistDir = `${normalizePath(dirname(dirname(envModuleFile)))}/`;
11
+ const REQUEST_SCOPE_PLUGIN = "#void/nitro-request-scope";
12
+ const NODEJS_COMPAT_FLAGS = /* @__PURE__ */ new Set(["nodejs_compat", "nodejs_compat_v2"]);
13
+ /**
14
+ * `path` as Nitro's Rollup names its modules: with backslashes on Windows, as its node-resolve
15
+ * plugin returns them. That plugin looks up an absolute import, such as the `global` polyfill
16
+ * Nitro adds to pg, by walking up from the importer to a package.json. From a module named with
17
+ * forward slashes there, the walk does not stop at the drive root, so it never ends when no
18
+ * package.json is above the module.
19
+ */
20
+ function nitroModuleId(path) {
21
+ return process.platform === "win32" ? resolve(path) : path;
22
+ }
23
+ /**
24
+ * A Nitro runtime plugin that runs each request in Void's request scope, as the Class A wrapper
25
+ * does, so void/db keeps one PostgreSQL or MySQL client per request instead of one per query.
26
+ */
27
+ function requestScopePluginSource() {
28
+ return `import { withRuntimeEnv } from ${JSON.stringify(envModuleFile)};
29
+
30
+ export default function voidRequestScope(nitroApp) {
31
+ const handler = nitroApp.h3App.handler;
32
+ // Nitro's Cloudflare entry and dev plugins keep the env here; a dev plugin may first set a
33
+ // promise of it.
34
+ nitroApp.h3App.handler = async (event) =>
35
+ withRuntimeEnv(await globalThis.__env__, () => handler(event));
36
+ }
37
+ `;
38
+ }
39
+ /**
40
+ * Keep Void's `node:async_hooks` imports for workerd's own module. With its `cloudflare.nodeCompat`
41
+ * option off, Nitro bundles a stub whose AsyncLocalStorage loses the request scope at the first
42
+ * await.
43
+ */
44
+ const nativeAsyncHooksPlugin = {
45
+ name: "void:nitro-async-hooks",
46
+ resolveId(id, importer) {
47
+ if (id === "node:async_hooks" && importer !== void 0 && normalizePath(importer).startsWith(packageDistDir)) return {
48
+ id,
49
+ external: true
50
+ };
51
+ return null;
52
+ }
53
+ };
54
+ /**
55
+ * Nitro module for apps whose server routes Nitro bundles (Nuxt and Analog). Nitro's bundler
56
+ * does not run Vite plugins, so without this module `void/db` in a server route, page server
57
+ * load or cron job is the package's D1 client without the app's schema. Register it in the
58
+ * Nitro config: `modules: ['void/nitro']`.
59
+ */
60
+ const voidNitroModule = {
61
+ name: "void",
62
+ setup(nitro) {
63
+ const { options } = nitro;
64
+ const config = readConfig(options.rootDir);
65
+ const dialect = getDatabaseDialect(config);
66
+ const workerd = !options.dev && options.exportConditions?.includes("workerd") === true;
67
+ const plugins = [voidDbBundlerPlugin(options.rootDir, {
68
+ config,
69
+ ...workerd && { sqlDriver: async (sqlDialect, entry) => nitroModuleId(await bundleWorkerSqlDriver(sqlDialect, entry, join(options.buildDir, "void"))) }
70
+ })];
71
+ const nodeCompat = (flags) => flags?.some((flag) => NODEJS_COMPAT_FLAGS.has(flag)) === true;
72
+ const cloudflareFlags = config.cloudflare?.compatibility_flags;
73
+ if (workerd && (dialect !== "sqlite" || nodeCompat(cloudflareFlags) && nodeCompat(config.worker?.compatibility_flags ?? cloudflareFlags))) {
74
+ options.cloudflare ??= {};
75
+ options.cloudflare.nodeCompat ??= true;
76
+ }
77
+ if (dialect !== "sqlite") {
78
+ options.virtual[REQUEST_SCOPE_PLUGIN] = requestScopePluginSource();
79
+ options.plugins.push(REQUEST_SCOPE_PLUGIN);
80
+ if (workerd) plugins.push(nativeAsyncHooksPlugin);
81
+ }
82
+ const rollupConfig = options.rollupConfig ??= {};
83
+ const existing = rollupConfig.plugins;
84
+ rollupConfig.plugins = [...plugins, ...Array.isArray(existing) ? existing : existing ? [existing] : []];
85
+ }
86
+ };
87
+ //#endregion
88
+ export { voidNitroModule as default };
@@ -1,12 +1,11 @@
1
- import { a as join } from "./dist-BVqXeR_h.mjs";
2
- import { n as loadVoidAuthConfig, t as findVoidAuthConfig } from "./config-DPByhVck.mjs";
3
- import { m as readConfig } from "./config-DiowPT80.mjs";
4
- import { r as getMiniflareDatabasePath } from "./runner-DMBKSrRk.mjs";
5
- import { o as loadLocalEnv } from "./env-BxocywBB.mjs";
1
+ import { n as loadVoidAuthConfig, t as findVoidAuthConfig } from "./config-D0GY5ItR.mjs";
2
+ import { d as readConfig } from "./config-Bx_1SpnO.mjs";
3
+ import { r as getMiniflareDatabasePath } from "./runner-CabsQ-iM.mjs";
4
+ import { o as loadLocalEnv } from "./env-BJjULvL0.mjs";
6
5
  import { r as resolveVoidAuthMigrationSchema } from "./drizzle-CF84FOVM.mjs";
7
- import { n as applyPgAuthMigrations, r as applySqliteAuthMigrations, t as applyMySqlAuthMigrations } from "./auth-migrations-BwHgeEsD.mjs";
6
+ import { a as pgMigrationRunner, i as mysqlMigrationRunner, n as applyPgAuthMigrations, r as applySqliteAuthMigrations, t as applyMySqlAuthMigrations } from "./auth-migrations-Cgs0k6lS.mjs";
8
7
  //#region src/auth/node.ts
9
- async function runLocalVoidAuthMigrations(root, dialect, persistRoot = join(root, ".void"), databaseId = "local", configPath = findVoidAuthConfig(root)) {
8
+ async function runLocalVoidAuthMigrations(root, dialect, persistRoot, databaseId, configPath = findVoidAuthConfig(root), databaseUrl) {
10
9
  const authConfig = await loadVoidAuthConfig(configPath);
11
10
  const runtime = {
12
11
  dialect,
@@ -35,21 +34,13 @@ async function runLocalVoidAuthMigrations(root, dialect, persistRoot = join(root
35
34
  }
36
35
  return;
37
36
  }
38
- const connectionString = typeof env.DATABASE_URL === "string" && env.DATABASE_URL.length > 0 ? env.DATABASE_URL : void 0;
37
+ const connectionString = databaseUrl ?? (typeof env.DATABASE_URL === "string" && env.DATABASE_URL.length > 0 ? env.DATABASE_URL : void 0);
39
38
  if (!connectionString) return;
40
39
  if (dialect === "mysql") {
41
40
  const { createConnection } = await import("mysql2/promise");
42
41
  const connection = await createConnection(connectionString);
43
42
  try {
44
- await applyMySqlAuthMigrations({
45
- async all(sql, params) {
46
- const [rows] = await connection.query(sql, params);
47
- return rows;
48
- },
49
- async run(sql, params) {
50
- await connection.query(sql, params);
51
- }
52
- }, migrationSchema);
43
+ await applyMySqlAuthMigrations(mysqlMigrationRunner(connection), migrationSchema);
53
44
  } finally {
54
45
  await connection.end();
55
46
  }
@@ -59,14 +50,7 @@ async function runLocalVoidAuthMigrations(root, dialect, persistRoot = join(root
59
50
  const client = new Client({ connectionString });
60
51
  await client.connect();
61
52
  try {
62
- await applyPgAuthMigrations({
63
- async all(sql, params) {
64
- return (await client.query(sql, params)).rows;
65
- },
66
- async run(sql, params) {
67
- await client.query(sql, params);
68
- }
69
- }, migrationSchema);
53
+ await applyPgAuthMigrations(pgMigrationRunner(client), migrationSchema);
70
54
  } finally {
71
55
  await client.end();
72
56
  }
@@ -1,4 +1,5 @@
1
- import { t as OPERATOR_MAX_TIMEOUT_MS } from "./operator-client-DbDv4vtE.mjs";
1
+ import { t as OPERATOR_MAX_TIMEOUT_MS } from "./operator-client-C-ROjk1I.mjs";
2
+ import { parsePlatformLoginId } from "@void/platform";
2
3
  //#region src/cli/operator-args.ts
3
4
  const operatorCommands = [
4
5
  {
@@ -7,7 +8,7 @@ const operatorCommands = [
7
8
  description: "Sign in as a platform administrator",
8
9
  path: "/session",
9
10
  values: { provider: "OAuth provider" },
10
- booleans: ["token-stdin"]
11
+ booleans: { "token-stdin": "Read a full API session from stdin for explicit operator session exchange" }
11
12
  },
12
13
  {
13
14
  group: "auth",
@@ -26,7 +27,7 @@ const operatorCommands = [
26
27
  action: "token",
27
28
  description: "Print an operator token; exchange an API session with --token-stdin",
28
29
  path: "/session",
29
- booleans: ["token-stdin"]
30
+ booleans: { "token-stdin": "Read a full API session from stdin for explicit operator session exchange" }
30
31
  },
31
32
  {
32
33
  group: "user",
@@ -121,7 +122,7 @@ const operatorCommands = [
121
122
  action: "status",
122
123
  description: "Inspect saved platform Zero Trust configuration and project state counts",
123
124
  path: "/zero-trust",
124
- booleans: ["check"]
125
+ booleans: { check: "Also check the saved settings against Cloudflare Access (several API calls)" }
125
126
  },
126
127
  {
127
128
  group: "zero-trust",
@@ -133,11 +134,11 @@ const operatorCommands = [
133
134
  policies: "Comma-separated reusable Access policy IDs",
134
135
  "existing-projects": "Required when enabling: protected or public for existing projects"
135
136
  },
136
- booleans: [
137
- "token-stdin",
138
- "protect-new-projects",
139
- "public-apps"
140
- ],
137
+ booleans: {
138
+ "token-stdin": "Read the Access management API token from stdin",
139
+ "protect-new-projects": "Protect newly created projects by default",
140
+ "public-apps": "Manage public app rules without identity policies"
141
+ },
141
142
  method: "POST"
142
143
  },
143
144
  {
@@ -230,7 +231,7 @@ const operatorCommands = [
230
231
  since: "Duration or ISO timestamp",
231
232
  cursor: "Opaque continuation cursor"
232
233
  },
233
- booleans: ["follow"]
234
+ booleans: { follow: "Poll new logs until interrupted or the build ends" }
234
235
  },
235
236
  {
236
237
  group: "build",
@@ -246,7 +247,7 @@ const operatorCommands = [
246
247
  path: "/builds/:id/logs",
247
248
  positional: ["id"],
248
249
  values: { since: "Last received sequence number" },
249
- booleans: ["follow"]
250
+ booleans: { follow: "Poll new logs until interrupted or the build ends" }
250
251
  },
251
252
  {
252
253
  group: "signup",
@@ -372,7 +373,7 @@ const operatorCommands = [
372
373
  description: "Rotate project proxy tokens on tenant Workers",
373
374
  path: "/system/rotate-proxy-tokens",
374
375
  values: { project: "Project ID" },
375
- booleans: ["all"],
376
+ booleans: { all: "Rotate every project" },
376
377
  method: "POST"
377
378
  },
378
379
  {
@@ -437,7 +438,7 @@ const operatorCommands = [
437
438
  path: "/email/attempts/:id/resolve",
438
439
  positional: ["id"],
439
440
  values: { reason: "Audit reason without recipient or message content" },
440
- booleans: ["ended"],
441
+ booleans: { ended: "Attest that the original provider execution has ended" },
441
442
  method: "POST"
442
443
  },
443
444
  {
@@ -450,7 +451,7 @@ const operatorCommands = [
450
451
  outcome: "Provider outcome: applied or not-applied",
451
452
  reason: "Audit reason for the verified provider outcome"
452
453
  },
453
- booleans: ["ended"],
454
+ booleans: { ended: "Attest that the original provider execution has ended" },
454
455
  method: "POST"
455
456
  },
456
457
  {
@@ -470,7 +471,7 @@ const operatorCommands = [
470
471
  outcome: "Provider outcome: applied or not-applied",
471
472
  reason: "Audit reason for the verified provider outcome"
472
473
  },
473
- booleans: ["ended"],
474
+ booleans: { ended: "Attest that the original provider execution has ended" },
474
475
  method: "POST"
475
476
  },
476
477
  {
@@ -487,7 +488,7 @@ const operatorCommands = [
487
488
  path: "/email/domains",
488
489
  positional: ["domain"],
489
490
  values: { project: "Project id or slug" },
490
- booleans: ["token-stdin"],
491
+ booleans: { "token-stdin": "Read a scoped Cloudflare API token from stdin" },
491
492
  method: "POST"
492
493
  },
493
494
  {
@@ -519,7 +520,7 @@ const operatorCommands = [
519
520
  description: "Remove an email domain and its Cloudflare setup",
520
521
  path: "/email/domains/:domain/remove",
521
522
  positional: ["domain"],
522
- booleans: ["token-stdin"],
523
+ booleans: { "token-stdin": "Read a replacement Cloudflare token for blocked project cleanup from stdin" },
523
524
  method: "POST"
524
525
  },
525
526
  {
@@ -573,11 +574,8 @@ function parseOperatorArgs(args) {
573
574
  "json",
574
575
  "plan",
575
576
  "yes",
576
- "follow",
577
- "token-stdin",
578
577
  "force",
579
- "ended",
580
- ...operatorCommands.flatMap((command) => command.booleans ?? [])
578
+ ...operatorCommands.flatMap((command) => Object.keys(command.booleans ?? {}))
581
579
  ]);
582
580
  for (let index = 0; index < args.length; index++) {
583
581
  const arg = args[index];
@@ -607,8 +605,7 @@ function parseOperatorArgs(args) {
607
605
  yes: flags.has("yes"),
608
606
  follow: flags.has("follow"),
609
607
  tokenStdin: flags.has("token-stdin"),
610
- provider: values.provider ?? "github",
611
- ...values.provider ? { providerExplicit: true } : {},
608
+ provider: values.provider,
612
609
  method: "GET",
613
610
  path: "",
614
611
  query: {},
@@ -633,7 +630,7 @@ function parseOperatorArgs(args) {
633
630
  for (const name of flags) if (![
634
631
  "json",
635
632
  ...command.method ? ["yes", "plan"] : [],
636
- ...command.booleans ?? []
633
+ ...Object.keys(command.booleans ?? {})
637
634
  ].includes(name)) throw new Error(`platform: Unknown flag '--${name}' for ${group} ${action}.`);
638
635
  if (parsed.plan && parsed.yes) throw new Error("platform: --plan and --yes cannot be combined.");
639
636
  parsed.path = command.path;
@@ -641,7 +638,11 @@ function parseOperatorArgs(args) {
641
638
  if (identitySignupEntry) {
642
639
  const connectionId = parameters[1];
643
640
  const subject = parameters[2];
644
- if (!/^[a-z][a-z0-9-]{0,63}$/.test(connectionId)) throw new Error("platform: Invalid login connection ID.");
641
+ try {
642
+ parsePlatformLoginId(connectionId);
643
+ } catch {
644
+ throw new Error("platform: Invalid login connection ID.");
645
+ }
645
646
  if (!subject || subject.length > 255) throw new Error("platform: Identity subject must be 1–255 characters.");
646
647
  parsed.body = {
647
648
  type: "identity",
@@ -678,7 +679,7 @@ function parseOperatorArgs(args) {
678
679
  "email",
679
680
  "identity"
680
681
  ].includes(String(parsed.body.type))) throw new Error("platform: Signup grant type must be github, email, or identity.");
681
- for (const name of command.booleans ?? []) if (name !== "token-stdin" && flags.has(name)) parsed.body[name] = true;
682
+ for (const name of Object.keys(command.booleans ?? {})) if (name !== "token-stdin" && flags.has(name)) parsed.body[name] = true;
682
683
  if (group === "zero-trust" && action === "configure") {
683
684
  if (!parsed.tokenStdin) throw new Error("platform: zero-trust configure requires --token-stdin.");
684
685
  const identityProviderIds = values["identity-providers"]?.split(",").map((entry) => entry.trim()).filter(Boolean);
@@ -1,5 +1,5 @@
1
- import { C as deleteKeyringPassword, T as writeKeyringPassword, c as normalizePlatformApiUrl, i as getActivePlatformConnection, r as findPlatformConnections, u as platformCredentialAccount, w as readKeyringPassword } from "./platform-registry-Cjv2Qf0r.mjs";
2
- import { n as OperatorClient, r as OperatorClientError } from "./operator-client-DbDv4vtE.mjs";
1
+ import { C as deleteKeyringPassword, T as writeKeyringPassword, c as normalizePlatformApiUrl, i as getActivePlatformConnection, r as findPlatformConnections, u as platformCredentialAccount, w as readKeyringPassword } from "./platform-registry-B9mWX9LO.mjs";
2
+ import { n as OperatorClient, r as OperatorClientError } from "./operator-client-C-ROjk1I.mjs";
3
3
  /** Operator authority never comes from repository-controlled metadata. */
4
4
  function resolveOperatorOrigin(connection = "") {
5
5
  if (connection) {
@@ -1,6 +1,6 @@
1
- import { c as normalizePlatformApiUrl } from "./platform-registry-Cjv2Qf0r.mjs";
2
- import { t as cfAccessHeaders } from "./cf-access-TWNzXltp.mjs";
3
- import { t as ensureCloudflaredToken } from "./cf-access-BcIBSKqG.mjs";
1
+ import { c as normalizePlatformApiUrl } from "./platform-registry-B9mWX9LO.mjs";
2
+ import { t as cfAccessHeaders } from "./cf-access-BM9G0lhO.mjs";
3
+ import { t as ensurePlatformAccessToken } from "./cf-access-CWP4avfP.mjs";
4
4
  const OPERATOR_MAX_TIMEOUT_MS = 36e5;
5
5
  var OperatorClientError = class extends Error {
6
6
  code;
@@ -36,7 +36,7 @@ var OperatorClient = class {
36
36
  const timeoutMs = options.timeoutMs ?? (options.method === "POST" ? 3e5 : 3e4);
37
37
  if (!Number.isSafeInteger(timeoutMs) || timeoutMs < 1e3 || timeoutMs > 36e5) throw new OperatorClientError(`Operator request timeout must be an integer from 1 to ${OPERATOR_MAX_TIMEOUT_MS / 1e3} seconds.`, "invalid_timeout");
38
38
  const url = new URL(`${this.origin}/operator/v1${path}`);
39
- ensureCloudflaredToken(this.origin);
39
+ ensurePlatformAccessToken(this.origin);
40
40
  for (const [name, value] of Object.entries(options.query ?? {})) url.searchParams.set(name, value);
41
41
  const timeoutController = new AbortController();
42
42
  const timer = setTimeout(() => timeoutController.abort(), timeoutMs);
@@ -0,0 +1 @@
1
+ export { a as runOperatorCommand } from "./operator-cmd-DHieWtFp.mjs";
@@ -1,6 +1,6 @@
1
- import { d as printSuccess, f as sanitizeTerminalText } from "./output-C50ag2r3.mjs";
2
- import { n as OperatorClient, r as OperatorClientError } from "./operator-client-DbDv4vtE.mjs";
3
- import { a as resolveOperatorOrigin, i as removeOperatorToken, n as readOperatorApiTokenStdin, o as saveOperatorToken, r as readOperatorToken, t as exchangeOperatorSession } from "./operator-auth-BEZ_u0Cz.mjs";
1
+ import { h as sanitizeTerminalText, m as printSuccess } from "./output-Ba6ZbrzY.mjs";
2
+ import { n as OperatorClient, r as OperatorClientError } from "./operator-client-C-ROjk1I.mjs";
3
+ import { a as resolveOperatorOrigin, i as removeOperatorToken, n as readOperatorApiTokenStdin, o as saveOperatorToken, r as readOperatorToken, t as exchangeOperatorSession } from "./operator-auth-Cr2zCc-J.mjs";
4
4
  import { createHash } from "node:crypto";
5
5
  import { setTimeout } from "node:timers/promises";
6
6
  import { createInterface } from "node:readline/promises";
@@ -163,10 +163,10 @@ async function runAuth(origin, args) {
163
163
  if (args.action === "login" || args.action === "token" && args.tokenStdin) {
164
164
  if (!args.tokenStdin && !process.stdin.isTTY) throw new OperatorClientError("Browser login requires an interactive terminal. Use --token-stdin to exchange an API session.", "interactive_login_required");
165
165
  const apiToken = args.tokenStdin ? await readOperatorApiTokenStdin() : await (async () => {
166
- const { discoverPlatform } = await import("./platform-cmd-BbmJiq5O.mjs");
167
- const { selectPlatformLoginMethod } = await import("./login-mx_ydhmp.mjs");
168
- const { runPlatformLogin } = await import("./auth-LMJcNESe.mjs");
169
- return runPlatformLogin(origin, (await selectPlatformLoginMethod(await discoverPlatform(origin), args.providerExplicit ? args.provider : void 0)).id, (url) => process.stderr.write(`Sign in at ${url}\n`));
166
+ const { discoverPlatform } = await import("./platform-cmd-PT4YwMLM.mjs");
167
+ const { selectPlatformLoginMethod } = await import("./login-XD844Xs-.mjs");
168
+ const { runPlatformLogin } = await import("./auth-Cbqi1iVX.mjs");
169
+ return runPlatformLogin(origin, (await selectPlatformLoginMethod(await discoverPlatform(origin), args.provider)).id, (url) => process.stderr.write(`Sign in at ${url}\n`));
170
170
  })();
171
171
  const session = await exchangeOperatorSession(origin, apiToken);
172
172
  const { token, ...identity } = session;
@@ -344,7 +344,7 @@ async function migrateDeploymentAssets(client, origin, args) {
344
344
  }
345
345
  async function runOperatorCommand(args) {
346
346
  if (!args.action) {
347
- const { printHelpPage } = await import("./help-DfQYVfGY.mjs");
347
+ const { printHelpPage } = await import("./help-i2YGGnTH.mjs");
348
348
  printHelpPage(["platform", args.group]);
349
349
  return;
350
350
  }