void 0.25.0 → 0.26.1
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.
- package/AGENTS_TEMPLATE.md +1 -3
- package/README.md +19 -9
- package/dist/{account-cmd-DcR1ywt8.mjs → account-cmd-CfUXh_nU.mjs} +8 -7
- package/dist/{application-analysis-BVsVqc11.mjs → application-analysis-DKy02UY0.mjs} +21 -32
- package/dist/{application-routing-B7QEjqSR.mjs → application-routing-DQyUh_5S.mjs} +1 -1
- package/dist/{auth-7wuZ5ob8.mjs → auth-B5_tZLxT.mjs} +9 -9
- package/dist/{auth-CdgZ9uag.mjs → auth-BgX2qYSY.mjs} +1 -1
- package/dist/{auth-link-Z6E5DYvM.mjs → auth-link-D5RmKnzh.mjs} +5 -5
- package/dist/{auth-migrations-9vif1uj8.mjs → auth-migrations-BwHgeEsD.mjs} +8 -18
- package/dist/{auth-router-BdM4avI8.mjs → auth-router-Bap-pvbn.mjs} +6 -19
- package/dist/{better-auth-shared-BVkjZ3vM.d.mts → better-auth-shared-CPvWD3nG.d.mts} +0 -4
- package/dist/{better-auth-shared-hy6RPh9W.mjs → better-auth-shared-DPpj8zxc.mjs} +94 -16
- package/dist/{build-cmd-CEE7D-hM.mjs → build-cmd-B58c8iS8.mjs} +8 -7
- package/dist/{cache-TcZnBLtH.mjs → cache-Bo52trKF.mjs} +8 -8
- package/dist/{cancel-deploy-CYoZmcmR.mjs → cancel-deploy-BZNz3Q26.mjs} +6 -5
- package/dist/{cf-access-AHKBzmuu.mjs → cf-access-ngGqZpHZ.mjs} +11 -12
- package/dist/{cf-build-output-U8o1Gl6X.mjs → cf-build-output-DjvB_872.mjs} +62 -85
- package/dist/cf-build-output-H9a97vME.mjs +2 -0
- package/dist/cli/cli.mjs +48 -83
- package/dist/cli/cloudflare-operation-process.mjs +71 -77
- package/dist/cli/env-schema-probe.d.mts +1 -1
- package/dist/cli/env-schema-probe.mjs +5 -6
- package/dist/client-By4JjMw_.mjs +2 -0
- package/dist/{client-RsPo8wsP.mjs → client-C2Prx_Bi.mjs} +30 -8
- package/dist/{cloudflare-auth-Qdc7tw8F.mjs → cloudflare-auth-CuxfF6OA.mjs} +9 -17
- package/dist/{cloudflare-cmd-bhwCxAN6.mjs → cloudflare-cmd-lHqNlJGW.mjs} +6 -5
- package/dist/{cloudflare-config-Bktvwtpf.mjs → cloudflare-config-BmhBv3HV.mjs} +1 -1
- package/dist/{cloudflare-connect-CuhRgk3k.mjs → cloudflare-connect-2G3rL2rP.mjs} +4 -4
- package/dist/{cloudflare-operations-BhbK6yTq.mjs → cloudflare-operations-BlYLlowZ.mjs} +1 -1
- package/dist/{cloudflare-operations-CjaV4lZi.mjs → cloudflare-operations-CwI1bChl.mjs} +41 -70
- package/dist/{cloudflare-process-B-wekeR6.mjs → cloudflare-process-2-TfIEzB.mjs} +20 -22
- package/dist/{config-CyQ-wVd7.mjs → config-5r-YpMC-.mjs} +1 -1
- package/dist/{config-C_XRIPx2.mjs → config-B_ggY-IO.mjs} +3 -3
- package/dist/config-BtSFvXZx.mjs +2 -0
- package/dist/config-CLYAosnQ.mjs +78 -0
- package/dist/{config-BMHb8RCj.d.mts → config-CSa15FvD.d.mts} +1 -1
- package/dist/{config-Br_JZD6u.mjs → config-DiowPT80.mjs} +24 -30
- package/dist/config-entry.d.mts +1 -1
- package/dist/{config-write-B1f88wJA.mjs → config-write-AHGesphx.mjs} +8 -7
- package/dist/{connect-DCvUmPXY.mjs → connect-X0MUA1gk.mjs} +12 -11
- package/dist/{create-project-eAPgYq35.mjs → create-project-DxiyW6iX.mjs} +7 -7
- package/dist/{create-project-C734I-Mu.mjs → create-project-iwkbqiBU.mjs} +1 -1
- package/dist/{db-C07GEdKF.mjs → db-XnVMHzoV.mjs} +101 -133
- package/dist/{delete-pKMVsrpJ.mjs → delete-esYlMiSJ.mjs} +8 -8
- package/dist/{deploy-DfsAe-T0.mjs → deploy-BsEvnlJl.mjs} +2377 -2512
- package/dist/deploy-C1d-YTfp.mjs +2 -0
- package/dist/{dev-inbox-D64ZKUod.mjs → dev-inbox-CK-UuPob.mjs} +7 -16
- package/dist/{discover-BcPPiF1o.mjs → discover-CkCYv9T_.mjs} +1 -2
- package/dist/discover-EDUf6JJw.mjs +2 -0
- package/dist/{prompts-ZAuJlyCj.mjs → dist-Bx1z6Eva.mjs} +1 -1
- package/dist/{dist-AoCzRTJE.mjs → dist-Cegxq8gs.mjs} +8 -8
- package/dist/{prompts-6OSVA7DJ.mjs → dist-D3m88sjf.mjs} +10 -53
- package/dist/{domain-D3uA9ize.mjs → domain-CbbBWhWE.mjs} +29 -30
- package/dist/{dotenv-VQxupEUv.mjs → dotenv-BfU6eqFt.mjs} +20 -32
- package/dist/{drizzle-Beb2Am5S.mjs → drizzle-CF84FOVM.mjs} +16 -13
- package/dist/{email-z3o2cwjH.mjs → email-CpuT42g7.mjs} +24 -19
- package/dist/{email--tEtMoj_.mjs → email-d_Aux1vM.mjs} +1 -1
- package/dist/{entry-CF5wvH4w.mjs → entry-CMAkqBmU.mjs} +6 -6
- package/dist/{env-_v349JBd.mjs → env-BxocywBB.mjs} +25 -6
- package/dist/{env-D5liuQYR.mjs → env-DMA3cXZt.mjs} +1 -1
- package/dist/{env-public-BX_r8HR6.d.mts → env-public-DR7ZM6d-.d.mts} +1 -1
- package/dist/{env-raw-Cx8ElDdj.mjs → env-raw-jZpP5n47.mjs} +1 -2
- package/dist/{env-types-D5kds_OZ.mjs → env-types-CwXgeMgL.mjs} +1 -1
- package/dist/{env-validation-cZBvGWaP.mjs → env-validation-CrVNjsPm.mjs} +1 -1
- package/dist/{env-validation-vBSQ8gw5.mjs → env-validation-Dxdx_5wo.mjs} +17 -21
- package/dist/{env-3Q8-_2IH.mjs → env-w9jOyGZn.mjs} +10 -9
- package/dist/{fetch-_SeGZao9.d.mts → fetch-BPCYVi3H.d.mts} +20 -1
- package/dist/{fetch-BIZJh7vR.mjs → fetch-sAcwjzLO.mjs} +1 -1
- package/dist/{fetch-stream-IvCYKyQL.mjs → fetch-stream-PGgz4uGz.mjs} +26 -24
- package/dist/{fetch-stream-Bjf0hoZb.d.mts → fetch-stream-obvZ7fvO.d.mts} +1 -16
- package/dist/{gen-NjwoG9FK.mjs → gen-DtkQhvQg.mjs} +40 -57
- package/dist/gen-dA9hW7AV.mjs +2 -0
- package/dist/{github-cmd-DquUq-b1.mjs → github-cmd-D_FsOFxq.mjs} +65 -164
- package/dist/{handler-DghKr6dU.mjs → handler-BHAn2fZJ.mjs} +1 -0
- package/dist/{handler-CZ4nAylQ.d.mts → handler-CNAwjRcW.d.mts} +5 -12
- package/dist/{head-Do8P4puT.d.mts → head-C8K_iGe6.d.mts} +1 -1
- package/dist/{head-D_QRR5Yd.mjs → head-D2VF4ApL.mjs} +29 -51
- package/dist/{headers-2rKda9Y6.mjs → headers-DlfR78Nu.mjs} +3 -3
- package/dist/{help-DRZXC4fj.mjs → help-CVFBTmBx.mjs} +23 -38
- package/dist/help-DzKUrQvk.mjs +2 -0
- package/dist/{inbound-fRkqcXaC.mjs → inbound-PfQDLXc5.mjs} +23 -24
- package/dist/index.d.mts +19 -2
- package/dist/index.mjs +632 -532
- package/dist/{info-BmA3_IFZ.mjs → info-PYWwkWyt.mjs} +4 -4
- package/dist/{init-DT7yuuyl.mjs → init-Bw-fRKGp.mjs} +161 -197
- package/dist/{limits-Bq5LG8Id.d.mts → limits-CFsDKQvU.d.mts} +1 -10
- package/dist/{limits-Cjuk2VPm.mjs → limits-D0vD1M9A.mjs} +1 -22
- package/dist/{link-CXOlqh2F.mjs → link-DlPG8iX3.mjs} +10 -10
- package/dist/{list-eEWVJEPn.mjs → list-2GN7_ueV.mjs} +11 -9
- package/dist/{live-CB1y5IuC.mjs → live-CgQuTpqD.mjs} +15 -16
- package/dist/{live-Chw1eIMv.d.mts → live-Du8jXwOW.d.mts} +4 -2
- package/dist/{local-d1-Df4XpwhW.mjs → local-d1-ga5O_idV.mjs} +2 -2
- package/dist/{login-pWQHYVu2.mjs → login-D-Q4xw3Q.mjs} +7 -7
- package/dist/login-Dc-wuTDq.mjs +2 -0
- package/dist/{logs-DnxVX7TR.mjs → logs-rd8J-OFh.mjs} +28 -11
- package/dist/migrate-BHp07yJE.mjs +2 -0
- package/dist/{migrate-CV1on-yJ.mjs → migrate-NLsjBbuM.mjs} +34 -20
- package/dist/{mime-D5Nmdzf7.mjs → mime-DxCznlJq.mjs} +45 -95
- package/dist/{node-BkyRWRx8.mjs → node-DJicPvPj.mjs} +5 -5
- package/dist/{operator-args-CAVcmwUt.mjs → operator-args-BNsW5gfp.mjs} +10 -1
- package/dist/{operator-auth-CkmTE3rt.mjs → operator-auth-AzVLbrr3.mjs} +4 -8
- package/dist/{operator-client-LmwjxT6q.mjs → operator-client-BQtzyG-g.mjs} +3 -3
- package/dist/{operator-cmd-d-IEKgNk.mjs → operator-cmd-B6f6Cg9Z.mjs} +45 -14
- package/dist/operator-cmd-Cwn50lOV.mjs +2 -0
- package/dist/{output-BBsUwdyT.mjs → output-C50ag2r3.mjs} +44 -2
- package/dist/pages/client.d.mts +19 -51
- package/dist/pages/client.mjs +204 -225
- package/dist/pages/head-client.d.mts +1 -1
- package/dist/pages/head.d.mts +1 -1
- package/dist/pages/head.mjs +1 -1
- package/dist/pages/index.d.mts +2 -2
- package/dist/pages/index.mjs +6 -12
- package/dist/pages/islands-plugin.d.mts +1 -1
- package/dist/pages/islands-plugin.mjs +21 -25
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +2 -2
- package/dist/{plan-NPpwZ_kc.mjs → plan-BhLO2p4w.mjs} +4 -3
- package/dist/plan-CH2G51je.mjs +2 -0
- package/dist/{platform-args-Bzf8JPc2.mjs → platform-args-BoZkWQnJ.mjs} +4 -2
- package/dist/platform-args-DYgITk0D.mjs +2 -0
- package/dist/{platform-auth-config-0V0lA3pF.mjs → platform-auth-config-n603OANg.mjs} +45 -40
- package/dist/{platform-auth-protection-DFeJ-JkK.mjs → platform-auth-protection-zxDr0hWW.mjs} +9 -8
- package/dist/{platform-auth-recovery-ICy4muq6.mjs → platform-auth-recovery-tw9lgtgE.mjs} +8 -7
- package/dist/{platform-cmd-D7vSWMvV.mjs → platform-cmd-B8-bCb7t.mjs} +48 -23
- package/dist/{platform-cmd-BPySFOew.mjs → platform-cmd-C00YM14r.mjs} +1 -1
- package/dist/{platform-discovery-DDDUvnqp.mjs → platform-discovery-BC0HCKYt.mjs} +18 -4
- package/dist/{platform-domain-CUdY064e.mjs → platform-domain-p0kobLV8.mjs} +6 -5
- package/dist/{platform-lifecycle-Dm09JNkn.mjs → platform-lifecycle-D_QEY32D.mjs} +906 -389
- package/dist/{platform-lifecycle-BaUdTRPU.mjs → platform-lifecycle-vFqtNPPa.mjs} +1 -1
- package/dist/{platform-management-BSEc_ZeG.mjs → platform-management-BdYblvvE.mjs} +175 -32
- package/dist/{platform-management-Bp6aoH2C.mjs → platform-management-oi-SvI3f.mjs} +1 -1
- package/dist/{platform-plans-config-B0pOVQyW.mjs → platform-plans-config-CjiFv5J4.mjs} +5 -4
- package/dist/{platform-recovery-WOZ95Uze.mjs → platform-recovery-PvNS9Nl2.mjs} +3 -3
- package/dist/{platform-registry-KfNEF84O.mjs → platform-registry-P387v42A.mjs} +17 -10
- package/dist/platform-setup-DVe42Ws7.mjs +299 -0
- package/dist/{plugin-inference-CXWnn79A.mjs → plugin-inference-BlQbOL0P.mjs} +43 -42
- package/dist/prepare-DRUV-g3X.mjs +2 -0
- package/dist/{prepare-DnaKBi--.mjs → prepare-Do96654b.mjs} +8 -8
- package/dist/{prepare-39EvOhI6.mjs → prepare-Dq9hTIbo.mjs} +4 -3
- package/dist/{prerender-render-D9qbLs2f.mjs → prerender-render-Ct20jftc.mjs} +17 -3
- package/dist/prerender-render.mjs +1 -1
- package/dist/{project-IOjBU8R6.mjs → project-BiaPQ7ur.mjs} +1 -1
- package/dist/{project-BkbfDs0V.mjs → project-DQstYTxO.mjs} +1 -1
- package/dist/{project-cmd-Bs5A392E.mjs → project-cmd-ti8_yTcA.mjs} +19 -19
- package/dist/{project-team-ohAWWaew.mjs → project-team-CDPE1Tsg.mjs} +15 -18
- package/dist/{project-token-CP01Jna6.mjs → project-token-CkZ1cN0Z.mjs} +14 -17
- package/dist/{project-tsconfig-B8GeM0RM.mjs → project-tsconfig-CVJhNMxs.mjs} +2 -1
- package/dist/{project-zero-trust-BzkVgx35.mjs → project-zero-trust-DdjLR61k.mjs} +12 -9
- package/dist/{protocol-CjF_iI9X.d.mts → protocol-BPZaNqBo.d.mts} +4 -2
- package/dist/{protocol-U7bfjHmA.mjs → protocol-CfaUwNs8.mjs} +46 -49
- package/dist/{providers-CJlNS3kT.mjs → providers-BXuhmuub.mjs} +1 -12
- package/dist/{provision-Btj1jppf.mjs → provision-BfaLiWbj.mjs} +51 -42
- package/dist/{provision-BEv0k-qz.mjs → provision-Wu9ZBk9L.mjs} +2 -3
- package/dist/{requests-B3PBuGlX.mjs → requests-DFAqyYy8.mjs} +5 -5
- package/dist/resolve-project-BIeYs9Cw.mjs +2 -0
- package/dist/{resolve-project-BG5ORGID.mjs → resolve-project-CP8rZs_p.mjs} +6 -1
- package/dist/{rollback-DDub9GsO.mjs → rollback-BKYXBduI.mjs} +30 -37
- package/dist/{route-types-Clm4WD0B.mjs → route-types-CbtsIeFn.mjs} +1 -1
- package/dist/route-url-BgPja1GS.d.mts +5 -0
- package/dist/route-url-BjGv_KKY.mjs +28 -0
- package/dist/runner-9wjsSZx-.mjs +2 -0
- package/dist/{runner-Ol0TNjk6.mjs → runner-DMBKSrRk.mjs} +2 -2
- package/dist/{runner-mysql-DmWchSWJ.mjs → runner-mysql-CEzKtmFb.mjs} +8 -8
- package/dist/{runner-mysql-CEG5JozK.mjs → runner-mysql-CkFqZ6CE.mjs} +1 -1
- package/dist/{runner-pg-Bh4AgZdj.mjs → runner-pg-BGYRFdRp.mjs} +1 -1
- package/dist/runtime/ai.d.mts +11 -12
- package/dist/runtime/ai.mjs +47 -113
- package/dist/runtime/better-auth-mysql.d.mts +1 -1
- package/dist/runtime/better-auth-mysql.mjs +4 -9
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth-pg.mjs +5 -10
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/better-auth.mjs +3 -3
- package/dist/runtime/client-react.d.mts +2 -3
- package/dist/runtime/client-react.mjs +2 -2
- package/dist/runtime/client-solid.d.mts +2 -3
- package/dist/runtime/client-solid.mjs +2 -2
- package/dist/runtime/client-svelte.d.mts +2 -3
- package/dist/runtime/client-svelte.mjs +2 -2
- package/dist/runtime/client-vue.d.mts +2 -3
- package/dist/runtime/client-vue.mjs +2 -2
- package/dist/runtime/client.d.mts +2 -3
- package/dist/runtime/client.mjs +2 -2
- package/dist/runtime/db.mjs +1 -1
- package/dist/runtime/durable.mjs +3 -10
- package/dist/runtime/email/testing.mjs +5 -5
- package/dist/runtime/email.d.mts +2 -1
- package/dist/runtime/email.mjs +11 -27
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/env-public.mjs +15 -20
- package/dist/runtime/env.mjs +1 -1
- package/dist/runtime/fetch-stream.d.mts +2 -2
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/fetch.d.mts +2 -3
- package/dist/runtime/fetch.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/handler.mjs +2 -2
- package/dist/runtime/isr.mjs +1 -1
- package/dist/runtime/kv.mjs +10 -11
- package/dist/runtime/limits.d.mts +2 -2
- package/dist/runtime/limits.mjs +2 -2
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live-client.mjs +12 -22
- package/dist/runtime/live-server.mjs +27 -35
- package/dist/runtime/live.d.mts +2 -2
- package/dist/runtime/live.mjs +2 -2
- package/dist/runtime/migration-handler.mjs +35 -86
- package/dist/runtime/queues.mjs +1 -1
- package/dist/runtime/remote/binding-handler.d.mts +2 -2
- package/dist/runtime/remote/binding-handler.mjs +8 -9
- package/dist/runtime/remote/index.mjs +27 -77
- package/dist/runtime/route-url.d.mts +2 -4
- package/dist/runtime/route-url.mjs +1 -1
- package/dist/runtime/routing.d.mts +1 -1
- package/dist/runtime/routing.mjs +15 -26
- package/dist/runtime/sandbox.d.mts +1 -1
- package/dist/runtime/sandbox.mjs +14 -24
- package/dist/runtime/sse.mjs +1 -1
- package/dist/runtime/storage.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +2 -2
- package/dist/runtime/ws-server.mjs +30 -61
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/runtime/ws.mjs +1 -1
- package/dist/{sandbox-XZAqzFlG.d.mts → sandbox-C5LFoJMf.d.mts} +7 -7
- package/dist/{scan-C7okrLyM.mjs → scan-C3uDzz6J.mjs} +21 -18
- package/dist/{secret-3c72lY1U.mjs → secret-BAt2KMmO.mjs} +15 -15
- package/dist/{skills-BPQUGClu.mjs → skills-BgVMvQdy.mjs} +2 -2
- package/dist/{sse-CQNaDFFV.mjs → sse-CMvCgjNk.mjs} +1 -1
- package/dist/{subcommand-prompt-Dhom39bd.mjs → subcommand-prompt-BSlnD1fI.mjs} +2 -2
- package/dist/sveltekit.d.mts +0 -2
- package/dist/terminal-log-text-D9ACPOuG.mjs +32 -0
- package/dist/validate-BJr9LfXy.mjs +2 -0
- package/dist/{validate-ctOrgiS3.mjs → validate-C9qJArv7.mjs} +9 -28
- package/dist/{defer-YsYDUoii.mjs → validation-error-Dg9Recn1.mjs} +11 -11
- package/dist/{wrangler-DhUerFkW.mjs → wrangler-D9KTuqnv.mjs} +89 -194
- package/dist/{ws-CL1w7GXU.d.mts → ws-CChrrAU-.d.mts} +1 -1
- package/dist/{yarn-pnp-BV4AzNul.mjs → yarn-pnp-CUX_iTPA.mjs} +19 -27
- package/{skills/void/docs → docs}/guide/ai.md +69 -64
- package/{skills/void/docs → docs}/guide/app-types.md +1 -1
- package/{skills/void/docs → docs}/guide/auth.md +37 -1
- package/{skills/void/docs → docs}/guide/database/postgresql.md +2 -2
- package/{skills/void/docs → docs}/guide/database.md +23 -8
- package/{skills/void/docs → docs}/guide/edge/revalidation.md +1 -1
- package/{skills/void/docs → docs}/guide/edge/rewrites.md +2 -4
- package/{skills/void/docs → docs}/guide/email/receiving.md +2 -2
- package/{skills/void/docs → docs}/guide/email/sending.md +0 -2
- package/{skills/void/docs → docs}/guide/env-vars.md +4 -0
- package/{skills/void/docs → docs}/guide/jobs.md +2 -2
- package/{skills/void/docs → docs}/guide/live.md +12 -5
- package/{skills/void/docs → docs}/guide/pages-routing/actions-and-forms.md +21 -9
- package/{skills/void/docs → docs}/guide/pages-routing/loaders.md +7 -3
- package/{skills/void/docs → docs}/guide/pages-routing/markdown.md +15 -23
- package/{skills/void/docs → docs}/guide/pages-routing/overview.md +6 -4
- package/{skills/void/docs → docs}/guide/platform/administration/access.md +2 -10
- package/{skills/void/docs → docs}/guide/platform/administration/operations.md +3 -12
- package/{skills/void/docs → docs}/guide/platform/administration/projects.md +1 -1
- package/{skills/void/docs → docs}/guide/platform/development/local.md +4 -2
- package/{skills/void/docs → docs}/guide/platform/development/runtime.md +1 -1
- package/{skills/void/docs → docs}/guide/platform/development/schema-ci.md +1 -1
- package/{skills/void/docs → docs}/guide/platform/installation/credentials.md +2 -2
- package/{skills/void/docs → docs}/guide/platform/installation/domains.md +3 -1
- package/{skills/void/docs → docs}/guide/platform/installation/first-deployment.md +8 -2
- package/{skills/void/docs → docs}/guide/platform/installation/maintenance.md +7 -1
- package/{skills/void/docs → docs}/guide/platform/installation/setup.md +1 -1
- package/docs/guide/platform/installation/uninstall.md +102 -0
- package/{skills/void/docs → docs}/guide/project-collaboration.md +6 -2
- package/{skills/void/docs → docs}/guide/queues.md +0 -2
- package/{skills/void/docs → docs}/guide/remote-dev.md +5 -5
- package/{skills/void/docs → docs}/guide/sandboxes.md +41 -22
- package/{skills/void/docs → docs}/guide/sse.md +0 -2
- package/{skills/void/docs → docs}/guide/storage.md +7 -2
- package/{skills/void/docs → docs}/guide/websockets.md +4 -0
- package/docs/integrations/agents.md +37 -0
- package/{skills/void/docs → docs}/integrations/frameworks/astro.md +3 -3
- package/{skills/void/docs → docs}/integrations/frameworks/nuxt.md +6 -2
- package/{skills/void/docs → docs}/integrations/hono.md +15 -7
- package/{skills/void/docs → docs}/integrations/nodejs-bun-deno.md +1 -0
- package/{skills/void/docs → docs}/reference/api/auth.md +1 -1
- package/{skills/void/docs → docs}/reference/api/handlers.md +4 -2
- package/{skills/void/docs → docs}/reference/api/pages.md +4 -0
- package/{skills/void/docs → docs}/reference/api/resources.md +11 -14
- package/{skills/void/docs → docs}/reference/api.md +35 -34
- package/{skills/void/docs → docs}/reference/cli/auth.md +3 -6
- package/{skills/void/docs → docs}/reference/cli/database.md +3 -4
- package/{skills/void/docs → docs}/reference/cli/generate.md +1 -1
- package/{skills/void/docs → docs}/reference/cli/github.md +3 -12
- package/{skills/void/docs → docs}/reference/cli/platform-config.md +3 -3
- package/{skills/void/docs → docs}/reference/cli/platform-email.md +2 -3
- package/{skills/void/docs → docs}/reference/cli/platform-installation.md +15 -13
- package/{skills/void/docs → docs}/reference/cli/platform-operations.md +3 -0
- package/{skills/void/docs → docs}/reference/cli/platform-users.md +2 -2
- package/{skills/void/docs → docs}/reference/cli/platform.md +4 -2
- package/{skills/void/docs → docs}/reference/cli/project.md +5 -4
- package/{skills/void/docs → docs}/reference/cli/secrets.md +3 -3
- package/{skills/void/docs → docs}/reference/cli/setup.md +9 -11
- package/{skills/void/docs → docs}/reference/cli.md +2 -2
- package/{skills/void/docs → docs}/reference/config.md +13 -13
- package/{skills/void/docs → docs}/reference/resource-inference.md +2 -16
- package/package.json +34 -30
- package/schema.json +1 -1
- package/skills/migrate-vite-cloudflare-to-void/SKILL.md +4 -1
- package/skills/void/SKILL.md +11 -5
- package/dist/cf-build-output-ChY6-XWP.mjs +0 -2
- package/dist/client-B4Me-9HE.mjs +0 -2
- package/dist/config-0acf1oys.mjs +0 -2
- package/dist/config-D8MOgiQV.mjs +0 -32
- package/dist/deploy-BDu1vhSH.mjs +0 -2
- package/dist/discover-AMCBXivQ.mjs +0 -2
- package/dist/fetch-error-Sp1R4mZv.d.mts +0 -20
- package/dist/gen-ById9r2j.mjs +0 -2
- package/dist/help-DPGBwomV.mjs +0 -2
- package/dist/login-C98-sw79.mjs +0 -2
- package/dist/migrate-CEu2X5DB.mjs +0 -2
- package/dist/plan-D1Q5rf-r.mjs +0 -2
- package/dist/platform-args-Cq6EjQro.mjs +0 -2
- package/dist/prepare-CnjcTV2s.mjs +0 -2
- package/dist/resolve-project-DtbidV4y.mjs +0 -2
- package/dist/route-url-CG7U-cRN.mjs +0 -15
- package/dist/runner-CXA9Fh8h.mjs +0 -2
- package/dist/validate-Dq_L3s0S.mjs +0 -2
- package/skills/void/docs/guide/platform/installation/uninstall.md +0 -69
- package/skills/void/docs/integrations/agents.md +0 -26
- package/dist/{runner-pg-D4OPlil-.mjs → runner-pg-DV8p_zjA.mjs} +4 -4
- package/{skills/void/docs → docs}/guide/database/d1.md +2 -2
- package/{skills/void/docs → docs}/guide/database/mysql.md +0 -0
- package/{skills/void/docs → docs}/guide/deployment.md +0 -0
- package/{skills/void/docs → docs}/guide/durable-state.md +0 -0
- package/{skills/void/docs → docs}/guide/edge/headers.md +0 -0
- package/{skills/void/docs → docs}/guide/edge/prerendering.md +0 -0
- package/{skills/void/docs → docs}/guide/edge/redirects.md +0 -0
- package/{skills/void/docs → docs}/guide/edge/static-assets.md +0 -0
- package/{skills/void/docs → docs}/guide/email/domains.md +0 -0
- package/{skills/void/docs → docs}/guide/email.md +0 -0
- package/{skills/void/docs → docs}/guide/index.md +0 -0
- package/{skills/void/docs → docs}/guide/kv.md +0 -0
- package/{skills/void/docs → docs}/guide/pages-routing/head.md +0 -0
- package/{skills/void/docs → docs}/guide/pages-routing/islands.md +2 -2
- package/{skills/void/docs → docs}/guide/pages-routing/layouts.md +0 -0
- package/{skills/void/docs → docs}/guide/pages-routing/view-transitions.md +0 -0
- package/{skills/void/docs → docs}/guide/platform/administration/email.md +0 -0
- package/{skills/void/docs → docs}/guide/platform/administration/plans.md +0 -0
- package/{skills/void/docs → docs}/guide/platform/administration/zero-trust.md +0 -0
- package/{skills/void/docs → docs}/guide/platform/installation/ci.md +0 -0
- package/{skills/void/docs → docs}/guide/platform/installation/prerequisites.md +0 -0
- package/{skills/void/docs → docs}/guide/platform-administration.md +0 -0
- package/{skills/void/docs → docs}/guide/platform-development.md +0 -0
- package/{skills/void/docs → docs}/guide/quickstart.md +0 -0
- package/{skills/void/docs → docs}/guide/self-hosted-platform.md +0 -0
- package/{skills/void/docs → docs}/guide/server-routing.md +3 -3
- package/{skills/void/docs → docs}/guide/ssg.md +0 -0
- package/{skills/void/docs → docs}/guide/ssr.md +0 -0
- package/{skills/void/docs → docs}/guide/type-safety.md +0 -0
- package/{skills/void/docs → docs}/guide/typed-fetch.md +0 -0
- package/{skills/void/docs → docs}/index.md +0 -0
- package/{skills/void/docs → docs}/integrations/cloudflare.md +0 -0
- package/{skills/void/docs → docs}/integrations/frameworks/analog.md +3 -3
- package/{skills/void/docs → docs}/integrations/frameworks/overview.md +0 -0
- package/{skills/void/docs → docs}/integrations/frameworks/react-router.md +3 -3
- package/{skills/void/docs → docs}/integrations/frameworks/sveltekit.md +1 -1
- package/{skills/void/docs → docs}/integrations/frameworks/tanstack-start.md +2 -2
- package/{skills/void/docs → docs}/reference/api/client.md +0 -0
- package/{skills/void/docs → docs}/reference/api/database.md +2 -2
- /package/{skills/void/docs → docs}/reference/api/durable.md +0 -0
- /package/{skills/void/docs → docs}/reference/api/env.md +0 -0
- /package/{skills/void/docs → docs}/reference/api/plugin.md +0 -0
- /package/{skills/void/docs → docs}/reference/api/rewrites.md +0 -0
- /package/{skills/void/docs → docs}/reference/api/types.md +0 -0
- /package/{skills/void/docs → docs}/reference/cli/deploy.md +0 -0
- /package/{skills/void/docs → docs}/reference/cli/domains.md +0 -0
- /package/{skills/void/docs → docs}/reference/cli/email.md +0 -0
- /package/{skills/void/docs → docs}/reference/cli/platform-zero-trust.md +0 -0
- /package/{skills/void/docs → docs}/reference/structure.md +0 -0
|
@@ -18,13 +18,10 @@ import { getSandbox } from 'void/sandbox';
|
|
|
18
18
|
|
|
19
19
|
export const POST = defineHandler(async (c) => {
|
|
20
20
|
const sandbox = await getSandbox('default');
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
stdout: new TextDecoder().decode(result.stdout),
|
|
26
|
-
}),
|
|
27
|
-
limited: (limit) => limit.response({ message: 'Execution is temporarily unavailable.' }),
|
|
21
|
+
const result = await sandbox.run(['node', '--version']);
|
|
22
|
+
return c.json({
|
|
23
|
+
exitCode: result.exitCode,
|
|
24
|
+
stdout: new TextDecoder().decode(result.stdout),
|
|
28
25
|
});
|
|
29
26
|
});
|
|
30
27
|
```
|
|
@@ -42,33 +39,55 @@ const sandbox = await getSandbox(`user-${user.id}`, {
|
|
|
42
39
|
inactivityTimeoutMs: 10 * 60 * 1000,
|
|
43
40
|
enableInternet: false,
|
|
44
41
|
});
|
|
45
|
-
const
|
|
46
|
-
.
|
|
47
|
-
|
|
48
|
-
})
|
|
49
|
-
.match({
|
|
50
|
-
ok: (result) => Response.json({ exitCode: result.exitCode }),
|
|
51
|
-
limited: (limit) => limit.response(),
|
|
52
|
-
});
|
|
42
|
+
const result = await sandbox.run(['node', '--version'], {
|
|
43
|
+
signal: AbortSignal.timeout(5_000),
|
|
44
|
+
});
|
|
53
45
|
```
|
|
54
46
|
|
|
55
47
|
Commands take an executable and arguments as an array. For shell syntax, explicitly run `['sh', '-c', command]`. Execution options include `cwd` (default `/workspace`), `env`, `user`, `signal`, `pty`, `stdin`, `stdout`, and `stderr`.
|
|
56
48
|
|
|
57
|
-
`run()`
|
|
49
|
+
Sandbox operations return promises. `run()` resolves with `stdout` and `stderr` as `ArrayBuffer`s and the command's exit code. Usage limits reject with [`UsageLimit`](#usage-limits); other failures reject normally.
|
|
58
50
|
|
|
59
|
-
`exec()`
|
|
51
|
+
`exec()` resolves with a process. Await `process.output()` to collect its output and exit code, or read the streams and await `process.exitCode`. Waiting for completion keeps a long command active during pauses in its output; unattended background commands can stop when the Sandbox becomes idle. A runtime limit can reject completion after a command has successfully started.
|
|
60
52
|
|
|
61
53
|
Use `stdin: 'pipe'` for a writable input stream. `kill(signal?)` stops a process, and `resize(cols, rows)` resizes its terminal.
|
|
62
54
|
|
|
63
|
-
File operations live under `sandbox.files`: `readFile`, `writeFile`, `stat`, `lstat`, `readDirectory`, `mkdir`, `rename`, and `remove`.
|
|
55
|
+
File operations live under `sandbox.files`: `readFile`, `writeFile`, `stat`, `lstat`, `readDirectory`, `mkdir`, `rename`, and `remove`. Await `readFile()` to receive a streaming `Response`, then use `.text()`, `.arrayBuffer()`, or `.body`. `writeFile()` accepts text, binary data, or a byte stream. Relative file paths require an explicit `cwd` option.
|
|
64
56
|
|
|
65
|
-
To reach a server inside the container,
|
|
57
|
+
To reach a server inside the container, await `sandbox.fetch(port, new Request(url))`. `sandbox.running()` checks whether the container is running; `sandbox.destroy()` stops it.
|
|
66
58
|
|
|
67
59
|
`getSandbox()` options include `inactivityTimeoutMs` (default ten minutes, maximum six hours), `enableInternet` (default `false`), and string `labels`. Internet access and labels take effect on the next container start. `binding` selects a custom native binding; managed platforms use the configured binding.
|
|
68
60
|
|
|
69
61
|
For code that runs on both deployment targets, use `getSandbox()`. Direct access through `c.env.SANDBOX` is available only on local and native Cloudflare deployments.
|
|
70
62
|
|
|
71
|
-
|
|
63
|
+
## Usage limits
|
|
64
|
+
|
|
65
|
+
Sandbox limits reject with `SandboxLimitError`, which extends `UsageLimit` from `void/limits`. The error includes `resource: 'sandbox'` and a `reason` of `concurrency` or `runtime_budget`. Void route handlers and Pages actions automatically send a structured HTTP 429 when the error is left uncaught.
|
|
66
|
+
|
|
67
|
+
Use `instanceof UsageLimit` to optionally handle both AI and Sandbox limits, or `instanceof SandboxLimitError` for Sandbox-specific handling:
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
import { defineHandler } from 'void';
|
|
71
|
+
import { UsageLimit } from 'void/limits';
|
|
72
|
+
import { getSandbox } from 'void/sandbox';
|
|
73
|
+
|
|
74
|
+
export const POST = defineHandler(async (c) => {
|
|
75
|
+
const sandbox = await getSandbox('default');
|
|
76
|
+
try {
|
|
77
|
+
const result = await sandbox.run(['node', 'task.mjs']);
|
|
78
|
+
return c.json({ exitCode: result.exitCode });
|
|
79
|
+
} catch (error) {
|
|
80
|
+
if (error instanceof UsageLimit) {
|
|
81
|
+
return error.response({
|
|
82
|
+
message: 'Execution is temporarily unavailable. Try again shortly.',
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
throw error;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Keep user input available so it can be retried. Checking `running()`, stopping a process, and `destroy()` remain available after a usage limit.
|
|
72
91
|
|
|
73
92
|
## State persistence
|
|
74
93
|
|
|
@@ -78,7 +97,7 @@ Files, running processes, and listening servers last only as long as the contain
|
|
|
78
97
|
|
|
79
98
|
## Configuration
|
|
80
99
|
|
|
81
|
-
The default environment provides Node.js
|
|
100
|
+
The default environment provides Node.js 26 on Debian Trixie. Managed platform deploys use Cloudflare's managed Node.js image.
|
|
82
101
|
|
|
83
102
|
Use `void.config.ts` when you need a custom image or container size:
|
|
84
103
|
|
|
@@ -99,7 +118,7 @@ See the [configuration reference](../reference/config.md#sandbox) for binding na
|
|
|
99
118
|
Custom images must include the helper matching Void's installed Sandbox SDK version. The SDK image supplies this binary, but is not a runnable environment itself:
|
|
100
119
|
|
|
101
120
|
```dockerfile
|
|
102
|
-
FROM node:
|
|
121
|
+
FROM node:26.10.0-trixie-slim
|
|
103
122
|
COPY --from=docker.io/cloudflare/sandbox:1.0.0 /usr/local/bin/sandbox-shim /usr/local/bin/sandbox-shim
|
|
104
123
|
WORKDIR /workspace
|
|
105
124
|
CMD ["sleep", "infinity"]
|
|
@@ -168,6 +168,4 @@ export const GET = defineHandler(async (c) => {
|
|
|
168
168
|
});
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
Native `EventSource` can send cookies with `withCredentials: true`. For non-cookie auth, generate a short-lived signed URL and validate it in the route handler.
|
|
172
|
-
|
|
173
171
|
For shared topics and subscriptions, use [Live Event Streams](./live.md). For two-way communication, use [WebSockets](./websockets.md).
|
|
@@ -42,12 +42,12 @@ const head = await storage.head('uploads/photo.jpg');
|
|
|
42
42
|
A common pattern is serving uploaded files from an API route:
|
|
43
43
|
|
|
44
44
|
```ts
|
|
45
|
+
// routes/files/[key].ts
|
|
45
46
|
import { defineHandler } from 'void';
|
|
46
47
|
import { storage } from 'void/storage';
|
|
47
48
|
|
|
48
49
|
export const GET = defineHandler(async (c) => {
|
|
49
|
-
const
|
|
50
|
-
const object = await storage.get(key);
|
|
50
|
+
const object = await storage.get(`uploads/${c.req.param('key')}`);
|
|
51
51
|
|
|
52
52
|
if (!object) {
|
|
53
53
|
return c.notFound();
|
|
@@ -56,11 +56,16 @@ export const GET = defineHandler(async (c) => {
|
|
|
56
56
|
const headers = new Headers();
|
|
57
57
|
object.writeHttpMetadata(headers);
|
|
58
58
|
headers.set('etag', object.httpEtag);
|
|
59
|
+
// Don't let an uploaded HTML or SVG file run as a page on your site.
|
|
60
|
+
headers.set('X-Content-Type-Options', 'nosniff');
|
|
61
|
+
headers.set('Content-Disposition', 'attachment');
|
|
59
62
|
|
|
60
63
|
return new Response(object.body, { headers });
|
|
61
64
|
});
|
|
62
65
|
```
|
|
63
66
|
|
|
67
|
+
Files your users upload can contain HTML or scripts. Store them under keys your server picks, and serve them with `nosniff` and `Content-Disposition: attachment`. `<img>` and `<video>` tags still display them; opening the URL directly downloads the file.
|
|
68
|
+
|
|
64
69
|
## Custom bindings
|
|
65
70
|
|
|
66
71
|
Use `createStorage(bucket)` with your own R2 binding, or in tests:
|
|
@@ -151,6 +151,10 @@ Messages are JSON events. Raw string and binary messages are not supported.
|
|
|
151
151
|
|
|
152
152
|
When Void auth is enabled, every WebSocket hook receives the current user as `ctx.user`, or `null` for an anonymous connection. Use `onBeforeConnect` to reject unauthenticated clients.
|
|
153
153
|
|
|
154
|
+
Connections from another origin are anonymous unless that origin is in your auth `trustedOrigins`. If you read your own cookies from `ctx.request`, check its `Origin` header yourself.
|
|
155
|
+
|
|
156
|
+
`ctx.user` is resolved when the socket connects and stays the same for that connection, even if the user later signs out or the session is revoked. For actions that must respect a ban or role change, re-check your own records in `onMessage` and close the connection with `ctx.connection.close()` in rooms or `ctx.socket.close()` in `defineWebSocket()`.
|
|
157
|
+
|
|
154
158
|
## Hooks
|
|
155
159
|
|
|
156
160
|
Both `defineRoom()` and `defineWebSocket()` support:
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
outline: deep
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Using Void with Coding Agents
|
|
6
|
+
|
|
7
|
+
`void init` sets up coding agents as part of project initialization:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npx void init
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
New projects get a minimal `AGENTS.md` explaining Void and where to read its docs.
|
|
14
|
+
In an existing project, Void asks before creating, appending to, or updating
|
|
15
|
+
`AGENTS.md`. It preserves your instructions outside the Void section. Declining
|
|
16
|
+
keeps the file unchanged; CI and non-interactive runs skip changes to existing
|
|
17
|
+
projects' instructions.
|
|
18
|
+
|
|
19
|
+
The complete Markdown docs ship at `node_modules/void/docs/`. Start with
|
|
20
|
+
`guide/quickstart.md` for setup and `reference/cli.md` for commands. Agents can
|
|
21
|
+
read them directly, even without a linked skill.
|
|
22
|
+
|
|
23
|
+
## Skills
|
|
24
|
+
|
|
25
|
+
Skills point your agent to the commands and docs it needs for the task. They link to the installed `void` package, so the guidance matches the version your app uses.
|
|
26
|
+
|
|
27
|
+
Void ships two skills:
|
|
28
|
+
|
|
29
|
+
- **`void`:** commands and docs for app development.
|
|
30
|
+
- **`migrate-vite-cloudflare-to-void`:** migration skill for converting existing `@cloudflare/vite-plugin` apps to Void.
|
|
31
|
+
|
|
32
|
+
Skills are linked automatically by `void init` when it detects a supported
|
|
33
|
+
agent's configuration. For example, Claude Code uses `.claude/skills/` and Codex
|
|
34
|
+
uses `.agents/skills/`. The skills use the app's installed docs so their guidance
|
|
35
|
+
matches its Void version. Globally installed skills can use the docs in their
|
|
36
|
+
Void package when there is no local installation. If no agent is detected, the
|
|
37
|
+
instructions still point directly to the bundled docs.
|
|
@@ -10,7 +10,7 @@ Use Void with [Astro](https://astro.build/) for resource detection, typed databa
|
|
|
10
10
|
|
|
11
11
|
- [Astro 6+](https://astro.build/blog/astro-6/) is required to use `import { x } from "void/x"` helpers in Astro apps.
|
|
12
12
|
- You also need to enable `"nodejs_als"` under `compatibility_flags` in your Cloudflare config.
|
|
13
|
-
|
|
13
|
+
:::
|
|
14
14
|
|
|
15
15
|
## Setup
|
|
16
16
|
|
|
@@ -30,8 +30,8 @@ npm install -D @astrojs/cloudflare void
|
|
|
30
30
|
### 3. Configure `astro.config.mjs`
|
|
31
31
|
|
|
32
32
|
```js
|
|
33
|
-
import { defineConfig } from 'astro/config';
|
|
34
33
|
import cloudflare from '@astrojs/cloudflare';
|
|
34
|
+
import { defineConfig } from 'astro/config';
|
|
35
35
|
import { voidPlugin } from 'void';
|
|
36
36
|
|
|
37
37
|
export default defineConfig({
|
|
@@ -85,9 +85,9 @@ export const prerender = false;
|
|
|
85
85
|
Use `void/db` in API routes and server-side code:
|
|
86
86
|
|
|
87
87
|
```ts
|
|
88
|
+
import { users } from '@schema';
|
|
88
89
|
import type { APIRoute } from 'astro';
|
|
89
90
|
import { db } from 'void/db';
|
|
90
|
-
import { users } from '@schema';
|
|
91
91
|
|
|
92
92
|
export const GET: APIRoute = async () => {
|
|
93
93
|
const rows = await db.select().from(users);
|
|
@@ -33,10 +33,14 @@ export default defineNuxtConfig({
|
|
|
33
33
|
nitro: {
|
|
34
34
|
preset: 'cloudflare-module',
|
|
35
35
|
cloudflareDev: { configPath: './.void-wrangler.jsonc' },
|
|
36
|
+
// Required for Nuxt 4.6.0 on Windows.
|
|
37
|
+
externals: {
|
|
38
|
+
inline: [/[\\/]node_modules[\\/]nuxt[\\/]dist[\\/]/],
|
|
39
|
+
},
|
|
36
40
|
alias: {
|
|
37
41
|
// Nitro has its own bundler that doesn't use Vite aliases.
|
|
38
42
|
// Duplicate @schema here so Nitro can resolve it.
|
|
39
|
-
'@schema': resolve(
|
|
43
|
+
'@schema': resolve(import.meta.dirname, 'db/schema.ts'),
|
|
40
44
|
},
|
|
41
45
|
},
|
|
42
46
|
vite: { plugins: [voidPlugin()] },
|
|
@@ -75,9 +79,9 @@ Void-managed auth is not supported in framework mode yet. Use Better Auth's offi
|
|
|
75
79
|
### Database
|
|
76
80
|
|
|
77
81
|
```ts
|
|
82
|
+
import { users } from '@schema';
|
|
78
83
|
// server/api/users.get.ts
|
|
79
84
|
import { db } from 'void/db';
|
|
80
|
-
import { users } from '@schema';
|
|
81
85
|
|
|
82
86
|
export default defineEventHandler(async () => {
|
|
83
87
|
return db.select().from(users);
|
|
@@ -17,25 +17,33 @@ Once `hono` is installed in your app, you can use built-in middleware, helpers,
|
|
|
17
17
|
Use Hono's built-in middleware in your global middleware files or per-route:
|
|
18
18
|
|
|
19
19
|
```ts
|
|
20
|
+
import { cors } from 'hono/cors';
|
|
20
21
|
// middleware/01.cors.ts
|
|
21
22
|
import { defineMiddleware } from 'void';
|
|
22
|
-
import { cors } from 'hono/cors';
|
|
23
23
|
|
|
24
24
|
export default defineMiddleware(cors({ origin: 'https://example.com' }));
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
```ts
|
|
28
|
-
// middleware/02.cache.ts
|
|
29
|
-
import { defineMiddleware } from 'void';
|
|
30
28
|
import { cache } from 'hono/cache';
|
|
29
|
+
// routes/api/products.ts (per-route cache)
|
|
30
|
+
import { defineHandler } from 'void';
|
|
31
|
+
import { listProducts } from '../../lib/products';
|
|
31
32
|
|
|
32
|
-
export
|
|
33
|
+
export const GET = defineHandler(
|
|
34
|
+
cache({ cacheName: 'products', cacheControl: 'max-age=3600' }),
|
|
35
|
+
async () => ({ products: await listProducts() }),
|
|
36
|
+
);
|
|
33
37
|
```
|
|
34
38
|
|
|
39
|
+
::: warning
|
|
40
|
+
`cache()` stores one response per URL and returns it to every visitor. It skips requests with an `Authorization` header, but not cookies. Use it only on routes whose response is the same for everyone, never on a route that reads the signed-in user. To cache pages, use [revalidation](../guide/edge/revalidation.md), which skips requests that carry a cookie.
|
|
41
|
+
:::
|
|
42
|
+
|
|
35
43
|
```ts
|
|
44
|
+
import { bearerAuth } from 'hono/bearer-auth';
|
|
36
45
|
// routes/api/webhooks/stripe.ts (per-route usage)
|
|
37
46
|
import { defineHandler } from 'void';
|
|
38
|
-
import { bearerAuth } from 'hono/bearer-auth';
|
|
39
47
|
|
|
40
48
|
export const POST = defineHandler(bearerAuth({ token: 'webhook-secret' }), async (c) => {
|
|
41
49
|
const body = await c.req.json();
|
|
@@ -48,9 +56,9 @@ export const POST = defineHandler(bearerAuth({ token: 'webhook-secret' }), async
|
|
|
48
56
|
Hono's context helpers are available on `c` in every handler:
|
|
49
57
|
|
|
50
58
|
```ts
|
|
59
|
+
import { stream } from 'hono/streaming';
|
|
51
60
|
// routes/api/download.ts
|
|
52
61
|
import { defineHandler } from 'void';
|
|
53
|
-
import { stream } from 'hono/streaming';
|
|
54
62
|
|
|
55
63
|
export const GET = defineHandler((c) => {
|
|
56
64
|
return stream(c, async (stream) => {
|
|
@@ -76,9 +84,9 @@ export const GET = defineHandler((c) => {
|
|
|
76
84
|
Any `hono/*` or `@hono/*` package works. Install the package in your app, then use it directly:
|
|
77
85
|
|
|
78
86
|
```ts
|
|
87
|
+
import { rateLimiter } from 'hono-rate-limiter';
|
|
79
88
|
// middleware/01.rate-limit.ts
|
|
80
89
|
import { defineMiddleware } from 'void';
|
|
81
|
-
import { rateLimiter } from 'hono-rate-limiter';
|
|
82
90
|
|
|
83
91
|
export default defineMiddleware(rateLimiter({ windowMs: 60_000, limit: 100 }));
|
|
84
92
|
```
|
|
@@ -111,6 +111,7 @@ The following imports are **not available** with a non-CF target and produce a c
|
|
|
111
111
|
| `void/storage` | R2 (blob storage) |
|
|
112
112
|
| `void/auth` | Void-managed Better Auth |
|
|
113
113
|
| `void/ai` | Workers AI |
|
|
114
|
+
| `void/sandbox` | Cloudflare Sandboxes |
|
|
114
115
|
| `void/env` | Typed environment schema |
|
|
115
116
|
|
|
116
117
|
If you need a database or storage, use an external provider and connect via standard Node.js libraries.
|
|
@@ -4,7 +4,7 @@ outline: deep
|
|
|
4
4
|
|
|
5
5
|
# Authentication {#auth}
|
|
6
6
|
|
|
7
|
-
Imported from `"void
|
|
7
|
+
Imported from `"void/auth"`. Client-side helpers imported from `"void/client"`.
|
|
8
8
|
|
|
9
9
|
## `defineAuth(config)` {#defineauth-config}
|
|
10
10
|
|
|
@@ -41,8 +41,8 @@ Creates a handler with input validation using any [Standard Schema](https://gith
|
|
|
41
41
|
Validated input is passed as the second argument to the handler.
|
|
42
42
|
|
|
43
43
|
```ts
|
|
44
|
-
import { defineHandler } from 'void';
|
|
45
44
|
import * as v from 'valibot';
|
|
45
|
+
import { defineHandler } from 'void';
|
|
46
46
|
|
|
47
47
|
export const POST = defineHandler.withValidator({
|
|
48
48
|
body: v.object({
|
|
@@ -103,6 +103,8 @@ Void’s reserved `/__void` endpoints use their own authentication and are exclu
|
|
|
103
103
|
|
|
104
104
|
When credentials come from `void/env`, wrap the reads in functions so they are resolved per request after Void has bound the runtime env.
|
|
105
105
|
|
|
106
|
+
If `password` resolves to an empty value, requests fail with a server error instead of passing the gate.
|
|
107
|
+
|
|
106
108
|
For app-specific bypasses such as health checks or public webhooks, compose that logic in your own middleware before calling `basicAuth()`.
|
|
107
109
|
|
|
108
110
|
```ts
|
|
@@ -182,7 +184,7 @@ export default defineQueue<{ to: string; subject: string }>(async (batch, env) =
|
|
|
182
184
|
```ts
|
|
183
185
|
function defineQueue<T>(
|
|
184
186
|
handler: (batch: QueueBatch<T>, env: CloudEnv['Bindings']) => void | Promise<void>,
|
|
185
|
-
):
|
|
187
|
+
): TypedQueueHandler<T>;
|
|
186
188
|
```
|
|
187
189
|
|
|
188
190
|
## `defineRender(handler)` {#definerender-handler}
|
|
@@ -32,6 +32,10 @@ function voidVue(options?: VoidVueOptions): Plugin[];
|
|
|
32
32
|
interface VoidVueOptions {
|
|
33
33
|
vue?: VuePluginOptions; // passed through to @vitejs/plugin-vue
|
|
34
34
|
viewTransitions?: boolean; // enable View Transitions API for navigations
|
|
35
|
+
prefetch?: {
|
|
36
|
+
hoverDelay?: number;
|
|
37
|
+
cacheFor?: number | string | [string, string];
|
|
38
|
+
};
|
|
35
39
|
}
|
|
36
40
|
```
|
|
37
41
|
|
|
@@ -51,25 +51,22 @@ Typed AI client for Cloudflare AI models and provider-native AI Gateway requests
|
|
|
51
51
|
```ts
|
|
52
52
|
import { ai } from 'void/ai';
|
|
53
53
|
|
|
54
|
-
const result = await ai
|
|
55
|
-
|
|
54
|
+
const result = await ai.run('@cf/meta/llama-3.3-70b-instruct-fp8-fast', {
|
|
55
|
+
messages: [{ role: 'user', content: 'Summarize this release note.' }],
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const response = await ai.provider('openai').fetch('/chat/completions', {
|
|
59
|
+
body: {
|
|
60
|
+
model: 'gpt-4o',
|
|
56
61
|
messages: [{ role: 'user', content: 'Summarize this release note.' }],
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const response = await ai
|
|
61
|
-
.provider('openai')
|
|
62
|
-
.fetch('/chat/completions', {
|
|
63
|
-
body: {
|
|
64
|
-
model: 'gpt-4o',
|
|
65
|
-
messages: [{ role: 'user', content: 'Summarize this release note.' }],
|
|
66
|
-
},
|
|
67
|
-
})
|
|
68
|
-
.match({ ok: (result) => result, limited: (limit) => limit.response() });
|
|
62
|
+
},
|
|
63
|
+
});
|
|
69
64
|
```
|
|
70
65
|
|
|
71
66
|
**Key exports:** `ai`, `VoidAi`, provider request types. See [AI](../../guide/ai.md) for provider setup and streaming examples.
|
|
72
67
|
|
|
68
|
+
AI methods return promises and reject usage limits with `UsageLimit` from `void/limits`. Void routes and Pages actions return a structured HTTP 429 for uncaught limits. See [usage limits](../../guide/ai.md#usage-limits) for optional `instanceof UsageLimit` handling.
|
|
69
|
+
|
|
73
70
|
### Provider keys
|
|
74
71
|
|
|
75
72
|
Default secret names for `ai.provider()`. Use `apiKeyEnv` to choose another name.
|
|
@@ -33,37 +33,38 @@ Use this reference to find public imports, signatures, and return types. For set
|
|
|
33
33
|
|
|
34
34
|
Import Void's app-facing APIs from these paths:
|
|
35
35
|
|
|
36
|
-
| Import path | Contents
|
|
37
|
-
| ------------------------- |
|
|
38
|
-
| `void` | `voidPlugin`, handler/type re-exports, `defer`, `Deferred`, `DeferredState`, `InferProps`, `HeadDescriptor`
|
|
39
|
-
| `void/handler` | `defineHandler`, `defineMiddleware`, `basicAuth`, `defineScheduled`, `defineQueue`, `defineRender`, `defineHead`, types
|
|
40
|
-
| `void/auth` | `defineAuth`, `getUser`, `getSession`, `requireAuth`, `AuthUser`, `AuthSession`, `AuthState`
|
|
41
|
-
| `void/client` | `fetch`, `fetchStream`, `FetchError`, `auth`, `createAuthClient`, `AuthUser`, `AuthSession`, `AuthState`
|
|
42
|
-
| `void/client/{framework}` | Same as `void/client`, with framework-specific Better Auth clients for `react`, `vue`, `svelte`, and `solid`
|
|
43
|
-
| `void/ws` | `defineRoom`, `defineWebSocket`, `connect`, WebSocket context and connection types
|
|
44
|
-
| `void/durable` | `defineDurableState`, typed state/RPC/context/migration types
|
|
45
|
-
| `void/sse` | `eventStream`, `formatSse`, `formatSseText`, `getLastEventId`, `SseStreamClosedError`, SSE message and stream types
|
|
46
|
-
| `void/sse/client` | `connectEventStream`, browser `EventSource` wrapper types
|
|
47
|
-
| `void/live` | `defineLiveStream`, SSE topic fanout runtime types. Server-only.
|
|
48
|
-
| `void/live/client` | `connectLiveStream`, browser helper for one SSE connection plus POST subscribe/unsubscribe control.
|
|
49
|
-
| `void/response` | `convertReturnValue`
|
|
50
|
-
| `void/validator` | `runValidation`, `ValidatorSlots`, `HandlerInput`
|
|
51
|
-
| `void/drizzle-zod` | Re-exports [`drizzle-zod`](https://orm.drizzle.team/docs/zod) for schema-derived Zod validators for Drizzle tables
|
|
52
|
-
| `void/drizzle-valibot` | Re-exports [`drizzle-valibot`](https://orm.drizzle.team/docs/valibot) for schema-derived Valibot validators for Drizzle tables
|
|
53
|
-
| `void/drizzle-arktype` | Re-exports [`drizzle-arktype`](https://orm.drizzle.team/docs/arktype) for schema-derived ArkType validators for Drizzle tables
|
|
54
|
-
| `void/schema-d1` | Re-exports [`drizzle-orm/sqlite-core`](https://orm.drizzle.team/docs/column-types/sqlite) for D1 table and column builders
|
|
55
|
-
| `void/schema-pg` | Re-exports [`drizzle-orm/pg-core`](https://orm.drizzle.team/docs/column-types/pg) for PostgreSQL table and column builders
|
|
56
|
-
| `void/schema-mysql` | Re-exports `drizzle-orm/mysql-core` for MySQL table and column builders
|
|
57
|
-
| `void/database-provider` | `defineDatabaseProvider` and adapter types for `void db connect --provider`
|
|
58
|
-
| `void/db` | `db` (Drizzle D1, PostgreSQL, or MySQL instance for the active dialect), `createDb`, query operators (`eq`, `and`, `or`, `desc`, `like`, `inArray`, etc.)
|
|
59
|
-
| `void/seed` | `defineSeed`, `SeedContext`, `SeedFn` for programmatic `void db seed` modules
|
|
60
|
-
| `void/kv` | `kv`, `createKV`, typed KV client/map types
|
|
61
|
-
| `void/storage` | `storage`, `createStorage` for the inferred R2 binding or a specific `R2Bucket`
|
|
62
|
-
| `void/ai` | `ai`, `VoidAi`, model input and response types
|
|
63
|
-
| `void/
|
|
64
|
-
| `void/
|
|
65
|
-
| `void/
|
|
66
|
-
| `void/
|
|
67
|
-
| `void/
|
|
68
|
-
| `void/
|
|
69
|
-
| `void/
|
|
36
|
+
| Import path | Contents |
|
|
37
|
+
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
38
|
+
| `void` | `voidPlugin`, handler/type re-exports, `defer`, `Deferred`, `DeferredState`, `InferProps`, `HeadDescriptor` |
|
|
39
|
+
| `void/handler` | `defineHandler`, `defineMiddleware`, `basicAuth`, `defineScheduled`, `defineQueue`, `defineRender`, `defineHead`, types |
|
|
40
|
+
| `void/auth` | `defineAuth`, `getUser`, `getSession`, `requireAuth`, `AuthUser`, `AuthSession`, `AuthState` |
|
|
41
|
+
| `void/client` | `fetch`, `fetchStream`, `FetchError`, `auth`, `createAuthClient`, `AuthUser`, `AuthSession`, `AuthState` |
|
|
42
|
+
| `void/client/{framework}` | Same as `void/client`, with framework-specific Better Auth clients for `react`, `vue`, `svelte`, and `solid` |
|
|
43
|
+
| `void/ws` | `defineRoom`, `defineWebSocket`, `connect`, WebSocket context and connection types |
|
|
44
|
+
| `void/durable` | `defineDurableState`, typed state/RPC/context/migration types |
|
|
45
|
+
| `void/sse` | `eventStream`, `formatSse`, `formatSseText`, `getLastEventId`, `SseStreamClosedError`, SSE message and stream types |
|
|
46
|
+
| `void/sse/client` | `connectEventStream`, browser `EventSource` wrapper types |
|
|
47
|
+
| `void/live` | `defineLiveStream`, SSE topic fanout runtime types. Server-only. |
|
|
48
|
+
| `void/live/client` | `connectLiveStream`, browser helper for one SSE connection plus POST subscribe/unsubscribe control. |
|
|
49
|
+
| `void/response` | `convertReturnValue` |
|
|
50
|
+
| `void/validator` | `runValidation`, `ValidatorSlots`, `HandlerInput` |
|
|
51
|
+
| `void/drizzle-zod` | Re-exports [`drizzle-zod`](https://orm.drizzle.team/docs/zod) for schema-derived Zod validators for Drizzle tables |
|
|
52
|
+
| `void/drizzle-valibot` | Re-exports [`drizzle-valibot`](https://orm.drizzle.team/docs/valibot) for schema-derived Valibot validators for Drizzle tables |
|
|
53
|
+
| `void/drizzle-arktype` | Re-exports [`drizzle-arktype`](https://orm.drizzle.team/docs/arktype) for schema-derived ArkType validators for Drizzle tables |
|
|
54
|
+
| `void/schema-d1` | Re-exports [`drizzle-orm/sqlite-core`](https://orm.drizzle.team/docs/column-types/sqlite) for D1 table and column builders |
|
|
55
|
+
| `void/schema-pg` | Re-exports [`drizzle-orm/pg-core`](https://orm.drizzle.team/docs/column-types/pg) for PostgreSQL table and column builders |
|
|
56
|
+
| `void/schema-mysql` | Re-exports `drizzle-orm/mysql-core` for MySQL table and column builders |
|
|
57
|
+
| `void/database-provider` | `defineDatabaseProvider` and adapter types for `void db connect --provider` |
|
|
58
|
+
| `void/db` | `db` (Drizzle D1, PostgreSQL, or MySQL instance for the active dialect), `createDb`, query operators (`eq`, `and`, `or`, `desc`, `like`, `inArray`, etc.) |
|
|
59
|
+
| `void/seed` | `defineSeed`, `SeedContext`, `SeedFn` for programmatic `void db seed` modules |
|
|
60
|
+
| `void/kv` | `kv`, `createKV`, typed KV client/map types |
|
|
61
|
+
| `void/storage` | `storage`, `createStorage` for the inferred R2 binding or a specific `R2Bucket` |
|
|
62
|
+
| `void/ai` | `ai`, `VoidAi`, model input and response types |
|
|
63
|
+
| `void/limits` | `UsageLimit`, `UsageLimitData`, and `readUsageLimit`. AI and Sandbox limits reject with `UsageLimit`; uncaught limits in Void routes and Pages actions return structured HTTP 429 responses. |
|
|
64
|
+
| `void/isr` | `revalidate(options)` for on-demand ISR cache invalidation |
|
|
65
|
+
| `void/log` | `logger` structured logging helper |
|
|
66
|
+
| `void/routes` | `RouteMap` and `WebSocketRouteMap` stubs (types only) |
|
|
67
|
+
| `void/queues` | `queues` proxy for sending messages to typed queues |
|
|
68
|
+
| `void/sandbox` | `getSandbox`, `sandbox`, `SandboxLimitError`, `SandboxUnavailableError`, and the SDK 1.0 file, backup, and mount helpers. `getSandbox(id)` resolves a client. Commands, files, port requests, and process completion return promises; limits reject with `SandboxLimitError`, which extends `UsageLimit`. Container state lasts until inactivity (default ten minutes), a crash, or a restart. See [Sandboxes](../guide/sandboxes.md) for the API and deployment requirements. |
|
|
69
|
+
| `void/env` | `defineEnv`, `env`, schema helpers (`string`, `number`, `boolean`, `url`, `email`, `oneOf`, `json`), and global Cloudflare env types |
|
|
70
|
+
| `void/sveltekit` | SvelteKit integration helpers: `withVoidTSConfig()` and `mergeVoidSvelteKitTsconfig()` |
|
|
@@ -6,13 +6,15 @@ outline: deep
|
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
8
|
void connect
|
|
9
|
-
void connect
|
|
9
|
+
void connect platform.example.com
|
|
10
10
|
void connect --platform cloudflare
|
|
11
11
|
void connect --platform void
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
Connect a project to its deployment destination. With no arguments, choose Cloudflare or a Void platform interactively. A URL selects a Void platform directly. `--platform void` offers saved platforms and an option to enter another URL.
|
|
15
15
|
|
|
16
|
+
You can omit `https://` from a platform URL: `void connect platform.example.com` connects to `https://platform.example.com`. This also works in the interactive prompt. For a local HTTP platform, include the scheme, such as `http://localhost:8787`.
|
|
17
|
+
|
|
16
18
|
For Cloudflare, Void signs in through the browser when needed, selects an accessible account, and saves `cloudflare.account_id` in `void.config.ts` or resolved state in `void.lock.json`. It shares this setup with `void init`. An existing account selection is preserved; conflicting or inaccessible account settings must be resolved before continuing.
|
|
17
19
|
|
|
18
20
|
For a Void platform, Void checks the connection and signs you in through your browser when needed. It saves credentials in your system keychain separately for each platform.
|
|
@@ -30,11 +32,6 @@ platform. In a non-interactive shell, pass `--platform cloudflare|void` or use
|
|
|
30
32
|
the explicit `void cloudflare` and `void account` commands. Choosing a destination
|
|
31
33
|
for authentication does not change the project's deploy target.
|
|
32
34
|
|
|
33
|
-
`void auth whoami`, `void auth link`, and `void auth token` remain supported for
|
|
34
|
-
existing scripts. `whoami` follows the selected destination; `link` and `token`
|
|
35
|
-
are Void account operations. Prefer `void auth status`, `void account link`, and
|
|
36
|
-
`void account token` in new scripts.
|
|
37
|
-
|
|
38
35
|
## Void platform account {#void-platform-account}
|
|
39
36
|
|
|
40
37
|
### `void account login` {#void-account-login}
|
|
@@ -24,7 +24,7 @@ Show migration status. Displays which migrations are applied or pending locally,
|
|
|
24
24
|
|
|
25
25
|
## `void db reset` {#void-db-reset}
|
|
26
26
|
|
|
27
|
-
Drop the
|
|
27
|
+
Drop the development database and re-apply all migrations. D1 resets the local database; PostgreSQL and MySQL drop all tables in the `DATABASE_URL` database from `.env`. Does not affect the deployed database.
|
|
28
28
|
|
|
29
29
|
## `void db seed` {#void-db-seed}
|
|
30
30
|
|
|
@@ -79,11 +79,10 @@ Open [Drizzle Studio](https://orm.drizzle.team/docs/drizzle-kit-studio) for the
|
|
|
79
79
|
|
|
80
80
|
By default, targets the local database. Pass `--remote` to open Studio against the deployed database:
|
|
81
81
|
|
|
82
|
-
- **PostgreSQL and MySQL projects**: fetch the stored connection string from the platform and open Studio against it. If the URL isn't stored yet, run `void db set-url` first.
|
|
82
|
+
- **Hosted PostgreSQL and MySQL projects**: fetch the stored connection string from the platform and open Studio against it. If the URL isn't stored yet, run `void db set-url` first.
|
|
83
|
+
- **Direct Cloudflare PostgreSQL and MySQL projects**: use `DATABASE_URL` from the current shell.
|
|
83
84
|
- **D1 projects**: remote Studio is not yet supported. Use `void db execute --remote` for ad-hoc queries against your deployed D1 database.
|
|
84
85
|
|
|
85
|
-
On direct Cloudflare PostgreSQL/MySQL targets, remote Studio uses `DATABASE_URL` from the current shell. Direct D1 Studio remains unsupported; use `void db execute --remote`.
|
|
86
|
-
|
|
87
86
|
## `void db rename-migrations` {#void-db-rename-migrations}
|
|
88
87
|
|
|
89
88
|
Rename existing migrations from the old numeric prefix format (`0001_name.sql`) to timestamp-based format (`20260410161500_name.sql`). Updates local tracking table and remote records if logged in with a linked project.
|
|
@@ -109,7 +109,7 @@ void gen cron hourly-sync
|
|
|
109
109
|
void gen queue <name>
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
-
Create a queue consumer file in `queues/` with `defineQueue`, a `Message`
|
|
112
|
+
Create a queue consumer file in `queues/` with `defineQueue`, a `Message` type, and commented-out batch options.
|
|
113
113
|
|
|
114
114
|
```sh
|
|
115
115
|
void gen queue emails
|