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
@@ -1,5 +1,6 @@
1
- import { t as cfAccessHeaders } from "../cf-access-TWNzXltp.mjs";
2
- import { a as getRawRuntimeEnv } from "../env-raw-jZpP5n47.mjs";
1
+ import { n as bytesToBase64 } from "../base64-DVrOndmI.mjs";
2
+ import { t as cfAccessHeaders } from "../cf-access-BM9G0lhO.mjs";
3
+ import { a as getRawRuntimeEnv } from "../env-raw-D74P4ebM.mjs";
3
4
  import { r as limitFromResponse, t as UsageLimit } from "../limits-D0vD1M9A.mjs";
4
5
  //#region src/runtime/ai-types.ts
5
6
  /** Maps provider prefix to expected env var name for the API key */
@@ -95,12 +96,6 @@ function copyBinaryView(value) {
95
96
  copy.set(bytes);
96
97
  return copy.buffer;
97
98
  }
98
- function bytesToBase64(bytes) {
99
- let binary = "";
100
- const chunkSize = 32768;
101
- for (let i = 0; i < bytes.length; i += chunkSize) binary += String.fromCharCode(...bytes.subarray(i, i + chunkSize));
102
- return btoa(binary);
103
- }
104
99
  function arrayBufferToBase64(buffer) {
105
100
  return bytesToBase64(new Uint8Array(buffer));
106
101
  }
@@ -214,16 +209,10 @@ async function responseFromResult(result) {
214
209
  if (isBinaryView(result)) return new Response(copyBinaryView(result), { headers: { "content-type": "application/octet-stream" } });
215
210
  return Response.json(result);
216
211
  }
217
- function splitImageOptions(options) {
218
- if (typeof options !== "object" || options === null) return {
219
- endpoint: "images/generations",
220
- runOptions: void 0
221
- };
222
- const { endpoint, ...runOptions } = options;
223
- return {
224
- endpoint: typeof endpoint === "string" ? endpoint : "images/generations",
225
- runOptions: Object.keys(runOptions).length > 0 ? runOptions : void 0
226
- };
212
+ function imageRunOptions(options) {
213
+ if (typeof options !== "object" || options === null) return;
214
+ const { endpoint: _endpoint, ...runOptions } = options;
215
+ return Object.keys(runOptions).length > 0 ? runOptions : void 0;
227
216
  }
228
217
  function resolveProviderKey(provider, runtimeEnv, options) {
229
218
  const envVar = options?.apiKeyEnv ?? PROVIDER_KEY_MAP[provider];
@@ -304,7 +293,16 @@ async function providerRequestBody(provider, path, init, options, runtimeEnv) {
304
293
  /** Backend for the Void platform proxy, reached by service binding or HTTPS. */
305
294
  function makeProxyBackend(send, runtimeEnv) {
306
295
  async function proxyFetch(action, payload, options = {}) {
307
- const res = await send(action, payload);
296
+ let signal;
297
+ if (typeof payload.options === "object" && payload.options !== null) {
298
+ const { signal: bindingSignal, ...wireOptions } = payload.options;
299
+ signal = bindingSignal;
300
+ payload = {
301
+ ...payload,
302
+ options: wireOptions
303
+ };
304
+ }
305
+ const res = await send(action, payload, signal);
308
306
  const limit = await limitFromResponse(res, "ai");
309
307
  if (limit) throw limit;
310
308
  if (options.throwOnError !== false && !res.ok) {
@@ -324,11 +322,10 @@ function makeProxyBackend(send, runtimeEnv) {
324
322
  return readProxyResult(res);
325
323
  },
326
324
  async image(model, inputs, options) {
327
- const { runOptions } = splitImageOptions(options);
328
325
  return proxyFetch("run", {
329
326
  model,
330
327
  inputs,
331
- options: runOptions
328
+ options: imageRunOptions(options)
332
329
  });
333
330
  },
334
331
  async providerFetch(provider, path, init, options) {
@@ -346,8 +343,9 @@ function makeProxyBackend(send, runtimeEnv) {
346
343
  };
347
344
  }
348
345
  function makeServiceBindingBackend(proxy, runtimeEnv) {
349
- return makeProxyBackend((action, payload) => proxy.fetch(`https://ai-proxy/ai/${action}`, {
346
+ return makeProxyBackend((action, payload, signal) => proxy.fetch(`https://ai-proxy/ai/${action}`, {
350
347
  method: "POST",
348
+ signal,
351
349
  headers: { "content-type": "application/json" },
352
350
  body: JSON.stringify({
353
351
  action,
@@ -364,8 +362,9 @@ function makeHttpBackend(token, projectId, runtimeEnv) {
364
362
  authorization: `Bearer ${token}`,
365
363
  ...cfAccessHeaders(runtimeEnv, base)
366
364
  };
367
- return makeProxyBackend((action, payload) => fetch(`${base}/${action}`, {
365
+ return makeProxyBackend((action, payload, signal) => fetch(`${base}/${action}`, {
368
366
  method: "POST",
367
+ signal,
369
368
  headers,
370
369
  body: JSON.stringify({
371
370
  action,
@@ -392,8 +391,7 @@ function makeDirectBackend(directAi, runtimeEnv, gatewayId) {
392
391
  return {
393
392
  run,
394
393
  async image(model, inputs, options) {
395
- const { runOptions } = splitImageOptions(options);
396
- return responseFromResult(await run(model, inputs, runOptions));
394
+ return responseFromResult(await run(model, inputs, imageRunOptions(options)));
397
395
  },
398
396
  async providerFetch(provider, path, init, options) {
399
397
  if (!gatewayId) return Response.json({ error: "ai: ai.provider().fetch() needs an AI Gateway when self-hosting. Set \"ai\": { \"gateway\": \"<id>\" } in void.json." }, { status: 501 });
@@ -1,2 +1 @@
1
- import { n as createAuthClient, t as auth } from "../auth-client-react-CMLwT2xI.mjs";
2
- export { auth, createAuthClient };
1
+ export { t as auth, n as createAuthClient } from "../auth-client-react-CMLwT2xI.mjs";
@@ -1,2 +1 @@
1
- import { n as createAuthClient, t as auth } from "../auth-client-solid-UoreJWZG.mjs";
2
- export { auth, createAuthClient };
1
+ export { t as auth, n as createAuthClient } from "../auth-client-solid-UoreJWZG.mjs";
@@ -1,2 +1 @@
1
- import { n as createAuthClient, t as auth } from "../auth-client-svelte-Cv_WvrRk.mjs";
2
- export { auth, createAuthClient };
1
+ export { t as auth, n as createAuthClient } from "../auth-client-svelte-Cv_WvrRk.mjs";
@@ -1,2 +1 @@
1
- import { n as createAuthClient, t as auth } from "../auth-client-vue-CFk7Xbv3.mjs";
2
- export { auth, createAuthClient };
1
+ export { t as auth, n as createAuthClient } from "../auth-client-vue-CFk7Xbv3.mjs";
@@ -1,2 +1 @@
1
- import { n as createAuthClient, t as auth } from "../auth-client-BWBT8HLp.mjs";
2
- export { auth, createAuthClient };
1
+ export { t as auth, n as createAuthClient } from "../auth-client-BWBT8HLp.mjs";
@@ -1,2 +1 @@
1
- import { a as requireAuth, i as getUser, n as defineAuth, r as getSession, t as authContext } from "../auth-3sGB0zJ1.mjs";
2
- export { authContext, defineAuth, getSession, getUser, requireAuth };
1
+ export { t as authContext, n as defineAuth, r as getSession, i as getUser, a as requireAuth } from "../auth-3sGB0zJ1.mjs";
@@ -1,10 +1,7 @@
1
- import { i as VoidAuthRuntimeOptions, n as VoidAuthEnv, r as VoidAuthRuntimeApi, t as VoidAuthDialect } from "../better-auth-shared-CPvWD3nG.mjs";
1
+ import { n as VoidAuthRuntimeApi } from "../better-auth-shared-B74NJIus.mjs";
2
2
  //#region src/runtime/better-auth-mysql.d.ts
3
- export declare const resolveVoidAuthOptions: VoidAuthRuntimeApi["resolveVoidAuthOptions"];
4
- export declare const createVoidAuth: VoidAuthRuntimeApi["createVoidAuth"];
5
3
  export declare const resolveVoidAuthState: VoidAuthRuntimeApi["resolveVoidAuthState"];
6
4
  export declare const runVoidAuthMiddleware: VoidAuthRuntimeApi["runVoidAuthMiddleware"];
7
5
  export declare const handleVoidAuthRequest: VoidAuthRuntimeApi["handleVoidAuthRequest"];
8
6
  export declare const runVoidAuthMigrations: VoidAuthRuntimeApi["runVoidAuthMigrations"];
9
- //#endregion
10
- export type { VoidAuthDialect, VoidAuthEnv, VoidAuthRuntimeOptions };
7
+ //#endregion
@@ -1,44 +1,22 @@
1
- import { t as applyMySqlAuthMigrations } from "../auth-migrations-BwHgeEsD.mjs";
2
- import { n as createVoidAuthRuntime, r as resolveConnectionString } from "../better-auth-shared-DPpj8zxc.mjs";
1
+ import { i as mysqlMigrationRunner, t as applyMySqlAuthMigrations } from "../auth-migrations-Cgs0k6lS.mjs";
2
+ import { n as resolveConnectionString, t as createVoidAuthRuntime } from "../better-auth-shared-CMXlZG7W.mjs";
3
3
  //#region src/runtime/better-auth-mysql.ts
4
- async function resolveDatabase(env) {
5
- const { createPool } = await import("mysql2/promise");
6
- const pool = createPool({
4
+ async function applyMigrations(env, migrationSchema) {
5
+ const { createConnection } = await import("mysql2/promise");
6
+ const connection = await createConnection({
7
7
  uri: resolveConnectionString(env, "MySQL"),
8
- connectionLimit: 1
8
+ disableEval: true
9
9
  });
10
- return {
11
- database: pool,
12
- async dispose() {
13
- await pool.end();
14
- }
15
- };
16
- }
17
- async function runMySqlAuthMigrations(_request, env, runtime, migrationSchema) {
18
- if (!migrationSchema) throw new Error("auth: Migration schema is unavailable.");
19
- if (runtime.dialect !== "mysql" || migrationSchema.dialect !== "mysql") throw new Error("auth: Runtime mismatch. Expected mysql.");
20
- const { createConnection } = await import("mysql2/promise");
21
- const connection = await createConnection(resolveConnectionString(env, "MySQL"));
22
10
  try {
23
- await applyMySqlAuthMigrations({
24
- async all(sql, params) {
25
- const [rows] = await connection.query(sql, params);
26
- return rows;
27
- },
28
- async run(sql, params) {
29
- await connection.query(sql, params);
30
- }
31
- }, migrationSchema);
11
+ await applyMySqlAuthMigrations(mysqlMigrationRunner(connection), migrationSchema);
32
12
  } finally {
33
13
  await connection.end();
34
14
  }
35
15
  }
36
- const runtime = createVoidAuthRuntime("mysql", resolveDatabase, runMySqlAuthMigrations);
37
- const resolveVoidAuthOptions = runtime.resolveVoidAuthOptions;
38
- const createVoidAuth = runtime.createVoidAuth;
16
+ const runtime = createVoidAuthRuntime("mysql", applyMigrations);
39
17
  const resolveVoidAuthState = runtime.resolveVoidAuthState;
40
18
  const runVoidAuthMiddleware = runtime.runVoidAuthMiddleware;
41
19
  const handleVoidAuthRequest = runtime.handleVoidAuthRequest;
42
20
  const runVoidAuthMigrations = runtime.runVoidAuthMigrations;
43
21
  //#endregion
44
- export { createVoidAuth, handleVoidAuthRequest, resolveVoidAuthOptions, resolveVoidAuthState, runVoidAuthMiddleware, runVoidAuthMigrations };
22
+ export { handleVoidAuthRequest, resolveVoidAuthState, runVoidAuthMiddleware, runVoidAuthMigrations };
@@ -1,10 +1,7 @@
1
- import { i as VoidAuthRuntimeOptions, n as VoidAuthEnv, r as VoidAuthRuntimeApi, t as VoidAuthDialect } from "../better-auth-shared-CPvWD3nG.mjs";
1
+ import { n as VoidAuthRuntimeApi } from "../better-auth-shared-B74NJIus.mjs";
2
2
  //#region src/runtime/better-auth-pg.d.ts
3
- export declare const resolveVoidAuthOptions: VoidAuthRuntimeApi["resolveVoidAuthOptions"];
4
- export declare const createVoidAuth: VoidAuthRuntimeApi["createVoidAuth"];
5
3
  export declare const resolveVoidAuthState: VoidAuthRuntimeApi["resolveVoidAuthState"];
6
4
  export declare const runVoidAuthMiddleware: VoidAuthRuntimeApi["runVoidAuthMiddleware"];
7
5
  export declare const handleVoidAuthRequest: VoidAuthRuntimeApi["handleVoidAuthRequest"];
8
6
  export declare const runVoidAuthMigrations: VoidAuthRuntimeApi["runVoidAuthMigrations"];
9
- //#endregion
10
- export type { VoidAuthDialect, VoidAuthEnv, VoidAuthRuntimeOptions };
7
+ //#endregion
@@ -1,48 +1,22 @@
1
- import { n as applyPgAuthMigrations } from "../auth-migrations-BwHgeEsD.mjs";
2
- import { n as createVoidAuthRuntime, r as resolveConnectionString, t as assertRuntimeDialect } from "../better-auth-shared-DPpj8zxc.mjs";
1
+ import { a as pgMigrationRunner, n as applyPgAuthMigrations } from "../auth-migrations-Cgs0k6lS.mjs";
2
+ import { n as resolveConnectionString, t as createVoidAuthRuntime } from "../better-auth-shared-CMXlZG7W.mjs";
3
3
  import { t as disablePgPassFallback } from "../pg-J2HbZIkX.mjs";
4
4
  //#region src/runtime/better-auth-pg.ts
5
- async function resolveDatabase(env) {
6
- const { default: pg } = await import("pg");
7
- const connectionString = resolveConnectionString(env, "PostgreSQL");
8
- const pool = new pg.Pool({
9
- connectionString,
10
- max: 1
11
- });
12
- return {
13
- database: pool,
14
- async dispose() {
15
- await pool.end();
16
- }
17
- };
18
- }
19
- async function runPostgresAuthMigrations(_request, env, runtime, migrationSchema) {
20
- if (!migrationSchema) throw new Error("auth: Migration schema is unavailable.");
21
- assertRuntimeDialect(runtime, "postgresql");
22
- if (migrationSchema.dialect !== "postgresql") throw new Error(`auth: Runtime mismatch. Expected postgresql, received '${migrationSchema.dialect}'.`);
5
+ async function applyMigrations(env, migrationSchema) {
23
6
  const { Client } = await import("pg");
24
7
  const client = new Client({ connectionString: resolveConnectionString(env, "PostgreSQL") });
25
8
  disablePgPassFallback(client);
26
9
  await client.connect();
27
10
  try {
28
- await applyPgAuthMigrations({
29
- async all(sql, params) {
30
- return (await client.query(sql, params)).rows;
31
- },
32
- async run(sql, params) {
33
- await client.query(sql, params);
34
- }
35
- }, migrationSchema);
11
+ await applyPgAuthMigrations(pgMigrationRunner(client), migrationSchema);
36
12
  } finally {
37
13
  await client.end();
38
14
  }
39
15
  }
40
- const runtime = createVoidAuthRuntime("postgresql", resolveDatabase, runPostgresAuthMigrations);
41
- const resolveVoidAuthOptions = runtime.resolveVoidAuthOptions;
42
- const createVoidAuth = runtime.createVoidAuth;
16
+ const runtime = createVoidAuthRuntime("postgresql", applyMigrations);
43
17
  const resolveVoidAuthState = runtime.resolveVoidAuthState;
44
18
  const runVoidAuthMiddleware = runtime.runVoidAuthMiddleware;
45
19
  const handleVoidAuthRequest = runtime.handleVoidAuthRequest;
46
20
  const runVoidAuthMigrations = runtime.runVoidAuthMigrations;
47
21
  //#endregion
48
- export { createVoidAuth, handleVoidAuthRequest, resolveVoidAuthOptions, resolveVoidAuthState, runVoidAuthMiddleware, runVoidAuthMigrations };
22
+ export { handleVoidAuthRequest, resolveVoidAuthState, runVoidAuthMiddleware, runVoidAuthMigrations };
@@ -1,10 +1,8 @@
1
- import { i as VoidAuthRuntimeOptions, n as VoidAuthEnv, r as VoidAuthRuntimeApi, t as VoidAuthDialect } from "../better-auth-shared-CPvWD3nG.mjs";
1
+ import { n as VoidAuthRuntimeApi } from "../better-auth-shared-B74NJIus.mjs";
2
2
  //#region src/runtime/better-auth.d.ts
3
3
  export declare const resolveVoidAuthOptions: VoidAuthRuntimeApi["resolveVoidAuthOptions"];
4
- export declare const createVoidAuth: VoidAuthRuntimeApi["createVoidAuth"];
5
4
  export declare const resolveVoidAuthState: VoidAuthRuntimeApi["resolveVoidAuthState"];
6
5
  export declare const runVoidAuthMiddleware: VoidAuthRuntimeApi["runVoidAuthMiddleware"];
7
6
  export declare const handleVoidAuthRequest: VoidAuthRuntimeApi["handleVoidAuthRequest"];
8
7
  export declare const runVoidAuthMigrations: VoidAuthRuntimeApi["runVoidAuthMigrations"];
9
- //#endregion
10
- export type { VoidAuthDialect, VoidAuthEnv, VoidAuthRuntimeOptions };
8
+ //#endregion
@@ -1,33 +1,23 @@
1
- import { r as applySqliteAuthMigrations } from "../auth-migrations-BwHgeEsD.mjs";
2
- import { n as createVoidAuthRuntime, t as assertRuntimeDialect } from "../better-auth-shared-DPpj8zxc.mjs";
1
+ import { r as applySqliteAuthMigrations } from "../auth-migrations-Cgs0k6lS.mjs";
2
+ import { t as createVoidAuthRuntime } from "../better-auth-shared-CMXlZG7W.mjs";
3
3
  //#region src/runtime/better-auth.ts
4
- async function resolveDatabase(env) {
5
- if (!env.DB) throw new Error("auth: Better Auth requires the \"DB\" D1 binding for sqlite apps.");
6
- return {
7
- database: env.DB.withSession("first-primary"),
8
- async dispose() {}
9
- };
10
- }
11
- async function runSqliteAuthMigrations(_request, env, runtime, migrationSchema) {
12
- if (!migrationSchema) throw new Error("auth: Migration schema is unavailable.");
13
- assertRuntimeDialect(runtime, "sqlite");
14
- if (migrationSchema.dialect !== "sqlite") throw new Error(`auth: Runtime mismatch. Expected sqlite, received '${migrationSchema.dialect}'.`);
15
- if (!env.DB) throw new Error("auth: Better Auth requires the \"DB\" D1 binding for sqlite apps.");
4
+ async function applyMigrations(env, migrationSchema) {
5
+ const database = env.DB;
6
+ if (!database) throw new Error("auth: Better Auth requires the \"DB\" D1 binding for sqlite apps.");
16
7
  await applySqliteAuthMigrations({
17
8
  async all(sql) {
18
- return (await env.DB.prepare(sql).all()).results ?? [];
9
+ return (await database.prepare(sql).all()).results ?? [];
19
10
  },
20
11
  async run(sql) {
21
- await env.DB.prepare(sql).run();
12
+ await database.prepare(sql).run();
22
13
  }
23
14
  }, migrationSchema);
24
15
  }
25
- const runtime = createVoidAuthRuntime("sqlite", resolveDatabase, runSqliteAuthMigrations);
16
+ const runtime = createVoidAuthRuntime("sqlite", applyMigrations);
26
17
  const resolveVoidAuthOptions = runtime.resolveVoidAuthOptions;
27
- const createVoidAuth = runtime.createVoidAuth;
28
18
  const resolveVoidAuthState = runtime.resolveVoidAuthState;
29
19
  const runVoidAuthMiddleware = runtime.runVoidAuthMiddleware;
30
20
  const handleVoidAuthRequest = runtime.handleVoidAuthRequest;
31
21
  const runVoidAuthMigrations = runtime.runVoidAuthMigrations;
32
22
  //#endregion
33
- export { createVoidAuth, handleVoidAuthRequest, resolveVoidAuthOptions, resolveVoidAuthState, runVoidAuthMiddleware, runVoidAuthMigrations };
23
+ export { handleVoidAuthRequest, resolveVoidAuthOptions, resolveVoidAuthState, runVoidAuthMiddleware, runVoidAuthMigrations };
@@ -1,4 +1,4 @@
1
- import { a as requireRuntimeBinding, r as getRuntimeRequestResource } from "../env-DMA3cXZt.mjs";
1
+ import { a as requireRuntimeBinding, r as getRuntimeRequestResource, t as getRuntimeBinding } from "../env-0jrMQJI_.mjs";
2
2
  import { drizzle } from "drizzle-orm/d1";
3
3
  import { and, asc, avg, between, count, desc, eq, exists, gt, gte, ilike, inArray, isNotNull, isNull, like, lt, lte, max, min, ne, not, notBetween, notExists, notInArray, notLike, or, sql, sum } from "drizzle-orm";
4
4
  //#region src/runtime/db.ts
@@ -20,13 +20,17 @@ function createPrimaryDb(d1) {
20
20
  return drizzle(d1.withSession("first-primary"));
21
21
  }
22
22
  const requestDbKey = {};
23
+ function requireD1() {
24
+ if (getRuntimeBinding("DB") == null && (getRuntimeBinding("HYPERDRIVE") != null || getRuntimeBinding("DATABASE_URL") != null)) throw new Error("db: Missing Cloudflare binding 'DB'. This app connects through HYPERDRIVE or DATABASE_URL, but its server bundle loaded the D1 client. In Nuxt or Analog, add 'void/nitro' to the Nitro modules. An installed package that imports void/db must be an ES module that lists void in its dependencies or peerDependencies, and the app must list it or reach it through such packages.");
25
+ return requireRuntimeBinding("DB");
26
+ }
23
27
  /**
24
28
  * Default Drizzle D1 instance — resolves the `DB` binding from the runtime
25
29
  * environment. When the Void plugin is active, this is replaced with a
26
30
  * schema-aware instance via virtual module.
27
31
  */
28
32
  const db = new Proxy({}, { get(_, prop) {
29
- const instance = getRuntimeRequestResource(requestDbKey, () => createDb(requireRuntimeBinding("DB")), () => createPrimaryDb(requireRuntimeBinding("DB")));
33
+ const instance = getRuntimeRequestResource(requestDbKey, () => createDb(requireD1()), () => createPrimaryDb(requireD1()));
30
34
  return Reflect.get(instance, prop);
31
35
  } });
32
36
  //#endregion
@@ -1,4 +1,20 @@
1
+ import { DurableObject as DurableObject$1 } from "cloudflare:workers";
1
2
  //#region src/runtime/durable.d.ts
3
+ type NativeDurableClass = new (...args: Array<never>) => DurableObject$1<unknown>;
4
+ export type DurableObjectApi<TClass extends NativeDurableClass> = {
5
+ class: TClass;
6
+ /** @internal Called by the generated Worker entry. */
7
+ __bind(bindingName: string, resourceName?: string): void;
8
+ get(name: string): DurableObjectStub<InstanceType<TClass>>;
9
+ get(namespace: DurableObjectNamespace<InstanceType<TClass>>, name: string): DurableObjectStub<InstanceType<TClass>>;
10
+ getById(id: DurableObjectId): DurableObjectStub<InstanceType<TClass>>;
11
+ getById(namespace: DurableObjectNamespace<InstanceType<TClass>>, id: DurableObjectId): DurableObjectStub<InstanceType<TClass>>;
12
+ };
13
+ /** Register a native Durable Object class without altering its lifecycle or RPC methods. */
14
+ export declare function defineDurableObject<TClass extends NativeDurableClass>(definition: {
15
+ name?: string;
16
+ class: TClass;
17
+ }): DurableObjectApi<TClass>;
2
18
  export type DurableStateContext<TState, TEnv extends Record<string, unknown>> = {
3
19
  state: TState;
4
20
  readonly env: TEnv;
@@ -46,4 +62,5 @@ export type DurableStateApi<TMethods> = {
46
62
  getById(namespace: DurableObjectNamespace, id: DurableObjectId): TypedDurableObjectStub<TMethods>;
47
63
  };
48
64
  export declare function defineDurableState<TState, TEnv extends Record<string, unknown> = Record<string, unknown>, const TMethods extends DurableStateMethods<TState, TEnv> = DurableStateMethods<TState, TEnv>>(definition: DurableStateDefinition<TState, TEnv, TMethods>): DurableStateApi<TMethods>;
49
- //#endregion
65
+ //#endregion
66
+ export {};
@@ -1,8 +1,32 @@
1
1
  import { t as isResourceName } from "../resource-name-C7LVpcRm.mjs";
2
- import { a as requireRuntimeBinding, o as withRuntimeEnv } from "../env-DMA3cXZt.mjs";
2
+ import { a as requireRuntimeBinding, o as withRuntimeEnv } from "../env-0jrMQJI_.mjs";
3
3
  import { DurableObject } from "cloudflare:workers";
4
4
  //#region src/runtime/durable.ts
5
5
  const DEFAULT_STORAGE_KEY = "__void_durable_state";
6
+ /** Register a native Durable Object class without altering its lifecycle or RPC methods. */
7
+ function defineDurableObject(definition) {
8
+ if (definition.name !== void 0 && !isResourceName(definition.name)) throw new Error("durable: name must contain a word starting with a letter.");
9
+ let bindingName;
10
+ function boundNamespace() {
11
+ if (!bindingName) throw new Error("durable: this definition is not bound. Default-export it from a file in durable-objects/.");
12
+ return requireRuntimeBinding(bindingName);
13
+ }
14
+ return {
15
+ class: definition.class,
16
+ __bind(name, resourceName) {
17
+ if (definition.name !== resourceName) throw new Error("durable: name must be statically discoverable in defineDurableObject(). Run void info to inspect this definition.");
18
+ if (bindingName && bindingName !== name) throw new Error(`durable: definition is already bound to '${bindingName}' and cannot also bind to '${name}'.`);
19
+ bindingName = name;
20
+ },
21
+ get(namespaceOrName, maybeName) {
22
+ const namespace = typeof namespaceOrName === "string" ? boundNamespace() : namespaceOrName;
23
+ return namespace.get(namespace.idFromName(typeof namespaceOrName === "string" ? namespaceOrName : maybeName));
24
+ },
25
+ getById(namespaceOrId, maybeId) {
26
+ return (maybeId ? namespaceOrId : boundNamespace()).get(maybeId ?? namespaceOrId);
27
+ }
28
+ };
29
+ }
6
30
  function assertMigrations(version, migrations) {
7
31
  const byVersion = /* @__PURE__ */ new Map();
8
32
  for (const migration of migrations) {
@@ -139,4 +163,4 @@ function defineDurableState(definition) {
139
163
  };
140
164
  }
141
165
  //#endregion
142
- export { defineDurableState };
166
+ export { defineDurableObject, defineDurableState };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="@cloudflare/workers-types" />
2
- import { r as EmailHandler } from "../../inbound-CH5Mksyy.mjs";
2
+ import { r as EmailHandler } from "../../inbound-brj2-TM5.mjs";
3
3
  //#region src/runtime/email/dev-inbox.d.ts
4
4
  interface CapturedMessage {
5
5
  id: string;
@@ -1,7 +1,7 @@
1
- import { i as normalizeEmail, r as buildMime } from "../../mime-DxCznlJq.mjs";
2
- import { n as compileEmailPattern, t as compareEmailRoutes } from "../../email-d_Aux1vM.mjs";
3
- import { b as registerEmailSink } from "../../dev-inbox-CK-UuPob.mjs";
4
- import { a as createMessageProxy, n as MAX_INBOUND_HEADERS, t as MAX_INBOUND_BYTES } from "../../inbound-PfQDLXc5.mjs";
1
+ import { o as normalizeEmail, r as buildMime } from "../../mime-srOklVVv.mjs";
2
+ import { n as compileEmailPattern, t as compareEmailRoutes } from "../../email-BcjSyAL0.mjs";
3
+ import { y as registerEmailSink } from "../../dev-inbox-Rd6j_8vM.mjs";
4
+ import { a as createMessageProxy, n as MAX_INBOUND_HEADERS, t as MAX_INBOUND_BYTES } from "../../inbound-BuTfm11U.mjs";
5
5
  //#region src/runtime/email/testing.ts
6
6
  /**
7
7
  * Test harnesses for void/email.
@@ -86,27 +86,13 @@ async function buildSyntheticRaw(opts) {
86
86
  });
87
87
  return buildMime(normalized).raw;
88
88
  }
89
- /**
90
- * Thrown by `parseHeaderBlock` at the first distinct name past its cap —
91
- * the router's `InboundTooManyHeadersError` (`email-router.ts`).
92
- */
89
+ /** The router's `InboundTooManyHeadersError` (`email-router.ts`). */
93
90
  var InboundTooManyHeadersError = class extends Error {};
94
91
  /**
95
- * Headers of a raw MIME message, up to the first blank line.
96
- *
97
- * Unfolds continuation lines (RFC 5322 §2.2.3: a line starting with WSP
98
- * continues the one before it). Anything it cannot parse is skipped rather
99
- * than thrown, because a test may deliver deliberately malformed bytes.
100
- *
101
- * `maxDistinct` is the router's header-count admission (`buildEnvelope` in
102
- * `email-router.ts`): it walks the bag Cloudflare built from the wire and
103
- * refuses at the cap, BEFORE any entry past it is materialized. That bag is
104
- * a `Headers`, so the unit is the DISTINCT, case-insensitive name — a
105
- * repeated `Received:` is one entry, and a continuation line is part of the
106
- * one before it, never its own. The check sits in the same walk, checked
107
- * before the `set`, so an over-cap message costs this harness the same
108
- * `maxDistinct + 1` names it costs the router. A name a `Headers` refuses
109
- * is not in the bag on either side, so it does not count.
92
+ * Unfolded headers of a raw message, up to the first blank line. Unparsable
93
+ * lines are skipped so malformed fixtures still reach the handler. Like the
94
+ * router's `buildEnvelope`, refuses more than `maxDistinct` distinct
95
+ * case-insensitive names before materializing more.
110
96
  */
111
97
  function parseHeaderBlock(raw, maxDistinct) {
112
98
  const headers = new Headers();
@@ -9,6 +9,18 @@ type ReceiptVerificationInput = {
9
9
  type ReceiptVerifier = {
10
10
  fetch(input: string | Request, init?: RequestInit): Promise<Response>;
11
11
  };
12
+ /**
13
+ * Settle `run()` within `ms`, or reject with `onTimeout()`. `run` is not
14
+ * called when `ms` has already elapsed.
15
+ */
16
+ export declare function withTimeout<T>(ms: number, run: () => Promise<T>, onTimeout: () => Error): Promise<T>;
17
+ /**
18
+ * Read a JSON body of at most `maxBytes`, each read bounded by `race`. A
19
+ * declared length must be exact.
20
+ */
21
+ export declare function readBoundedJson(response: Response, maxBytes: number, race: <T>(run: () => Promise<T>) => Promise<T>, { rejectEncoding }?: {
22
+ rejectEncoding?: boolean;
23
+ }): Promise<unknown>;
12
24
  /** Validate a gateway receipt without exposing the signing secret to the tenant worker. */
13
25
  export declare function verifyEmailReceiptThroughProxy(proxy: ReceiptVerifier, projectToken: string, input: ReceiptVerificationInput): Promise<boolean>;
14
26
  //#endregion
@@ -1,70 +1 @@
1
- import { EMAIL_PROTOCOL_VERSION, encodeEmailActions, readEmailEnvelope } from "@void/platform/email-protocol";
2
- //#region src/runtime/email-protocol.ts
3
- const RECEIPT_VERIFICATION_DEADLINE_MS = 5e3;
4
- const MAX_RECEIPT_VERIFICATION_BYTES = 2048;
5
- const decoder = new TextDecoder("utf-8", {
6
- fatal: true,
7
- ignoreBOM: false
8
- });
9
- async function beforeDeadline(deadline, run) {
10
- const remaining = deadline - Date.now();
11
- if (remaining <= 0) throw new Error("email receipt verification timeout");
12
- let timer;
13
- return Promise.race([run(), new Promise((_, reject) => {
14
- timer = setTimeout(() => reject(/* @__PURE__ */ new Error("email receipt verification timeout")), remaining);
15
- })]).finally(() => {
16
- if (timer !== void 0) clearTimeout(timer);
17
- });
18
- }
19
- async function readResponseJson(response, deadline) {
20
- const declaredLength = response.headers.get("content-length");
21
- if (response.headers.has("content-encoding") || !response.body || declaredLength !== null && (!/^\d+$/.test(declaredLength) || Number(declaredLength) > MAX_RECEIPT_VERIFICATION_BYTES)) throw new Error("invalid email receipt verification response");
22
- const expectedLength = declaredLength === null ? null : Number(declaredLength);
23
- const reader = response.body.getReader();
24
- const bytes = new Uint8Array(MAX_RECEIPT_VERIFICATION_BYTES);
25
- let size = 0;
26
- try {
27
- for (;;) {
28
- const chunk = await beforeDeadline(deadline, () => reader.read());
29
- if (chunk.done) break;
30
- const nextSize = size + chunk.value.byteLength;
31
- if (nextSize > bytes.byteLength) throw new Error("email receipt verification response too large");
32
- bytes.set(chunk.value, size);
33
- size = nextSize;
34
- }
35
- } finally {
36
- reader.cancel().catch(() => {});
37
- try {
38
- reader.releaseLock();
39
- } catch {}
40
- }
41
- if (size === 0 || expectedLength !== null && size !== expectedLength) throw new Error("invalid email receipt verification response length");
42
- return JSON.parse(decoder.decode(bytes.subarray(0, size)));
43
- }
44
- /** Validate a gateway receipt without exposing the signing secret to the tenant worker. */
45
- async function verifyEmailReceiptThroughProxy(proxy, projectToken, input) {
46
- const deadline = Date.now() + RECEIPT_VERIFICATION_DEADLINE_MS;
47
- const controller = new AbortController();
48
- let response;
49
- try {
50
- response = await beforeDeadline(deadline, () => proxy.fetch("https://proxy/email/verify-receipt", {
51
- method: "POST",
52
- headers: {
53
- "content-type": "application/json",
54
- "x-void-internal": projectToken
55
- },
56
- body: JSON.stringify(input),
57
- signal: controller.signal
58
- }));
59
- if (!response.ok) return false;
60
- const body = await readResponseJson(response, deadline);
61
- return !!body && typeof body === "object" && !Array.isArray(body) && body.valid === true;
62
- } catch {
63
- return false;
64
- } finally {
65
- controller.abort();
66
- response?.body?.cancel().catch(() => {});
67
- }
68
- }
69
- //#endregion
70
- export { EMAIL_PROTOCOL_VERSION, encodeEmailActions, readEmailEnvelope, verifyEmailReceiptThroughProxy };
1
+ export { t as EMAIL_PROTOCOL_VERSION, n as encodeEmailActions, r as readBoundedJson, i as readEmailEnvelope, a as verifyEmailReceiptThroughProxy, o as withTimeout } from "../email-protocol-D9nTvhCp.mjs";
@@ -1,5 +1,5 @@
1
1
  /// <reference types="@cloudflare/workers-types" />
2
- import { C as SendEmailOptions, S as SendEmailErrorCode, T as SendEmailResult, _ as Attachment, a as MessageProxy, b as SendEmailDelivery, c as ParsedEmail, d as defineEmail, f as enactEmailActions, g as Address, h as replyEmail, i as EmailHandlerInfo, l as ReplyEmailOptions, m as parseEmail, n as EmailEnvelope, o as ParseEmailError, p as isForwardableEmailMessage, r as EmailHandler, s as ParseEmailErrorCode, t as EmailAction, u as createMessageProxy, v as EmailDeliveryState, w as SendEmailRecipientResult, x as SendEmailError, y as NormalizedEmail } from "../inbound-CH5Mksyy.mjs";
2
+ import { C as SendEmailOptions, S as SendEmailErrorCode, T as SendEmailResult, _ as Attachment, a as MessageProxy, b as SendEmailDelivery, c as ParsedEmail, d as defineEmail, f as enactEmailActions, g as Address, h as replyEmail, i as EmailHandlerInfo, l as ReplyEmailOptions, m as parseEmail, n as EmailEnvelope, o as ParseEmailError, p as isForwardableEmailMessage, r as EmailHandler, s as ParseEmailErrorCode, t as EmailAction, u as createMessageProxy, v as EmailDeliveryState, w as SendEmailRecipientResult, x as SendEmailError, y as NormalizedEmail } from "../inbound-brj2-TM5.mjs";
3
3
  //#region src/runtime/email/mime.d.ts
4
4
  type MimeErrorCode = "INVALID_FROM" | "INVALID_TO" | "MIME_ERROR";
5
5
  export declare class MimeError extends Error {