void 0.10.12 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS_TEMPLATE.md +6 -0
- package/{skills/void/docs/node_modules/void/node_modules/pglite-server/LICENSE.md → LICENSE} +1 -1
- package/README.md +34 -8
- package/dist/{auth-qgMlYp7Z.d.mts → auth-DkcFflXV.d.mts} +10 -11
- package/dist/auth-W9WII-mN.mjs +630 -0
- package/dist/{auth-cmd-BqsdZJp5.mjs → auth-cmd-CYVhSNFy.mjs} +4 -3
- package/dist/{auth-migrations-BTZ-ATvQ.mjs → auth-migrations-9vif1uj8.mjs} +53 -12
- package/dist/{better-auth-shared-BQooDxbw.mjs → better-auth-shared-CYw1T3k4.mjs} +7 -10
- package/dist/{better-auth-shared-DealXecJ.d.mts → better-auth-shared-DSCeohOK.d.mts} +10 -5
- package/dist/{build-cmd-Bujrv5q-.mjs → build-cmd-CkVD1uOh.mjs} +6 -4
- package/dist/{cache-C11V8Fxq.mjs → cache-QcUfR-ff.mjs} +9 -5
- package/dist/{cancel-deploy-fwFYF04b.mjs → cancel-deploy-DsvWKFTe.mjs} +3 -2
- package/dist/cf-access-AJ1ehiFR.mjs +42 -0
- package/dist/cf-access-DsSsZUPr.mjs +67 -0
- package/dist/cli/cli.d.mts +1 -1
- package/dist/cli/cli.mjs +1592 -153
- package/dist/cli/env-schema-probe.d.mts +48 -61
- package/dist/cli/env-schema-probe.mjs +10 -58
- package/dist/{client-Gb71-XkG.mjs → client-CyCHWSO_.mjs} +61 -463
- package/dist/cloudflare-auth-DRkGe7-s.mjs +170 -0
- package/dist/cloudflare-cmd-D3ME2GAe.mjs +62 -0
- package/dist/cloudflare-connect-BivMefMA.mjs +56 -0
- package/dist/cloudflare-operations-CPTpRW6d.mjs +566 -0
- package/dist/{config-BkTvs43g.mjs → config-BQFq7QvD.mjs} +85 -41
- package/dist/{config-CutEMNGJ.mjs → config-NOG_U1aK.mjs} +10 -15
- package/dist/connect-D9Yr-T5f.mjs +79 -0
- package/dist/{create-project-DsYvl3TB.mjs → create-project-DMV-csEm.mjs} +26 -16
- package/dist/database-provider.d.mts +21 -0
- package/dist/database-provider.mjs +6 -0
- package/dist/{db-DOiJMRt2.mjs → db-BxoUWL0F.mjs} +600 -115
- package/dist/{delete-mh6p-zkQ.mjs → delete-iJOqxBz1.mjs} +9 -6
- package/dist/{deploy-u7Rv9q_q.mjs → deploy-CcDoeBIf.mjs} +3451 -1986
- package/dist/dev-inbox-DkgRWLkW.mjs +307 -0
- package/dist/{discover-CJHyvYfR.mjs → discover-xvfrgJeo.mjs} +3 -3
- package/dist/{magic-string.es-ZQjdJFFn.mjs → dist-BR1quN_w.mjs} +570 -216
- package/dist/{dist-DaKKDf8D.mjs → dist-BrsS7cai.mjs} +17 -2
- package/dist/{dist-BuiRJkTd.mjs → dist-m40_XgNh.mjs} +48 -33
- package/dist/{domain-DiaNQbrl.mjs → domain-gu_iaHmn.mjs} +41 -4
- package/dist/dotenv-VQxupEUv.mjs +181 -0
- package/dist/edge.d.mts +2 -0
- package/dist/edge.mjs +2 -0
- package/dist/email-Ce6SQq-i.mjs +182 -0
- package/dist/email-r6DHJyAB.mjs +262 -0
- package/dist/{entry-D7yy4xVH.mjs → entry-DU3oDoQ3.mjs} +2 -2
- package/dist/env-D4Emu-M_.mjs +95 -0
- package/dist/env-DmU2To0C.mjs +73 -0
- package/dist/env-helpers-CyKtOBpj.d.mts +22 -0
- package/dist/env-public-D_6u46fX.d.mts +135 -0
- package/dist/{env-types-QBj-ndax.mjs → env-types-BNPhro-M.mjs} +2 -2
- package/dist/{env-validation-Dea3v3ej.mjs → env-validation-ENpMy6Ez.mjs} +68 -122
- package/dist/{gen-o_w-8yI8.mjs → gen-BKw6qHIg.mjs} +70 -15
- package/dist/{github-cmd-DKcGUNsj.mjs → github-cmd-DJS5Ab-H.mjs} +39 -31
- package/dist/{handler-Cjh8uM3Y.d.mts → handler-D1hLsObx.d.mts} +124 -122
- package/dist/{head-nmvOgFjd.d.mts → head-Do8P4puT.d.mts} +9 -8
- package/dist/{headers-nsHIFixA.mjs → headers-D8QfRX9Y.mjs} +12 -10
- package/dist/inbound-BJ70in1n.d.mts +354 -0
- package/dist/inbound-CNKxb3FY.mjs +694 -0
- package/dist/index.d.mts +61 -34
- package/dist/index.mjs +1048 -321
- package/dist/{init-3rgHKBVi.mjs → init-Dx5cgKqK.mjs} +329 -271
- package/dist/link-D_rm5sRH.mjs +52 -0
- package/dist/{list-CPwFDZ_c.mjs → list-M8XShti7.mjs} +37 -5
- package/dist/{runner-kapo9aPs.mjs → local-d1-BE8KBbMy.mjs} +116 -6
- package/dist/{login-BT3H8PN3.mjs → login-C8-UuLnp.mjs} +17 -15
- package/dist/{logs-Bt313ax7.mjs → logs-DwFU7dMW.mjs} +16 -2
- package/dist/mime-BJD7d_qL.mjs +1216 -0
- package/dist/neon-DHwd2zvC.mjs +54 -0
- package/dist/{node-Da0UcsGA.mjs → node-BkaXcpAc.mjs} +29 -8
- package/dist/operator-cmd-DYWRbWUA.mjs +348 -0
- package/dist/{agents-CtgBYqld.mjs → output-tFQLLj26.mjs} +676 -211
- package/dist/{package-json-Cx1osYo6.mjs → package-json-CPoWX79C.mjs} +1 -1
- package/dist/pages/client.d.mts +43 -41
- package/dist/pages/client.mjs +40 -33
- package/dist/pages/head-client.d.mts +10 -12
- package/dist/pages/head.d.mts +1 -1
- package/dist/pages/index.d.mts +37 -14
- package/dist/pages/index.mjs +5 -5
- package/dist/pages/islands-plugin.d.mts +25 -27
- package/dist/pages/islands-plugin.mjs +6 -4
- package/dist/pages/prefetch.d.mts +6 -7
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +2 -1
- package/dist/pages/serialize.d.mts +7 -8
- package/dist/platform-cmd-BEOVv1PN.mjs +123 -0
- package/dist/platform-domain-BszUfiS8.mjs +228 -0
- package/dist/platform-lifecycle-CjSr6xf0.mjs +4450 -0
- package/dist/platform-management-W30iCaTL.mjs +698 -0
- package/dist/platform-recovery-pHHv4ZSg.mjs +99 -0
- package/dist/{plugin-inference-DMeavIJ6.mjs → plugin-inference-BDRfZngg.mjs} +35 -19
- package/dist/prepare-BfJvFUtJ.mjs +14 -0
- package/dist/{prepare-BoKHgMNx.mjs → prepare-CBetXvsN.mjs} +15 -24
- package/dist/{preset-BjyR3lzz.mjs → preset-lAy0B0BQ.mjs} +25 -212
- package/dist/{project-cmd-D_w-4w5B.mjs → project-cmd-DCpk1cDt.mjs} +25 -12
- package/dist/{project-paths-BQd7OmIo.mjs → project-paths-SK8nMHPp.mjs} +3 -1
- package/dist/{project-tsconfig-B-QtXjLQ.mjs → project-tsconfig-Ql2XsSQp.mjs} +2 -2
- package/dist/{protocol-Bnb0LFp3.d.mts → protocol-C-pqYJjE.d.mts} +3 -4
- package/dist/{provision-rShh6MKY.mjs → provision-Blnstcm2.mjs} +78 -45
- package/dist/r2-conditions-D1Wk8i7b.mjs +30 -0
- package/dist/{requests-B8sZxaFM.mjs → requests-Dn8Vheh1.mjs} +5 -3
- package/dist/{resolve-project-BBMtLLV9.mjs → resolve-project--Vxawf7z.mjs} +2 -2
- package/dist/rollback-CtlPXEBi.mjs +166 -0
- package/dist/{rolldown-runtime-DJK8HYOj.mjs → rolldown-runtime-rQ84J-ij.mjs} +1 -1
- package/dist/{route-types-COI2DsZv.mjs → route-types-Da-DpyUp.mjs} +85 -26
- package/dist/routes-stub.d.mts +22 -23
- package/dist/runner-mysql-CgRFl3s6.mjs +61 -0
- package/dist/{runner-pg-CHM76xuC.mjs → runner-pg-DCkWPsWS.mjs} +18 -6
- package/dist/runtime/ai.d.mts +21 -14
- package/dist/runtime/ai.mjs +5 -4
- package/dist/runtime/auth-client-react.d.mts +3 -5
- package/dist/runtime/auth-client-solid.d.mts +3 -5
- package/dist/runtime/auth-client-svelte.d.mts +3 -5
- package/dist/runtime/auth-client-vue.d.mts +3 -5
- package/dist/runtime/auth-client.d.mts +3 -5
- package/dist/runtime/auth.d.mts +1 -1
- package/dist/runtime/better-auth-mysql.d.mts +10 -0
- package/dist/runtime/better-auth-mysql.mjs +49 -0
- package/dist/runtime/better-auth-pg.d.mts +8 -9
- package/dist/runtime/better-auth-pg.mjs +2 -2
- package/dist/runtime/better-auth.d.mts +8 -9
- package/dist/runtime/better-auth.mjs +2 -2
- package/dist/runtime/client-react.d.mts +1 -1
- package/dist/runtime/client-solid.d.mts +1 -1
- package/dist/runtime/client-svelte.d.mts +1 -1
- package/dist/runtime/client-vue.d.mts +1 -1
- package/dist/runtime/client.d.mts +1 -1
- package/dist/runtime/db-mysql.d.mts +2 -0
- package/dist/runtime/db-mysql.mjs +1 -0
- package/dist/runtime/db.d.mts +10 -11
- package/dist/runtime/durable.d.mts +47 -0
- package/dist/runtime/durable.mjs +146 -0
- package/dist/runtime/email/testing.d.mts +112 -0
- package/dist/runtime/email/testing.mjs +283 -0
- package/dist/runtime/email.d.mts +30 -0
- package/dist/runtime/email.mjs +573 -0
- package/dist/runtime/env-helpers.d.mts +2 -2
- package/dist/runtime/env-helpers.mjs +5 -42
- package/dist/runtime/env-public-client.d.mts +10 -11
- package/dist/runtime/env-public-client.mjs +1 -1
- package/dist/runtime/env-public.d.mts +2 -2
- package/dist/runtime/env-public.mjs +104 -49
- package/dist/runtime/env.d.mts +19 -18
- package/dist/runtime/env.mjs +15 -2
- package/dist/runtime/fetch-stream.d.mts +20 -21
- package/dist/runtime/fetch.d.mts +15 -16
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/isr.d.mts +21 -22
- package/dist/runtime/isr.mjs +26 -8
- package/dist/runtime/kv.d.mts +9 -10
- package/dist/runtime/live-client.d.mts +5 -7
- package/dist/runtime/live-client.mjs +9 -7
- package/dist/runtime/live-server.d.mts +4 -5
- package/dist/runtime/live.d.mts +22 -24
- package/dist/runtime/live.mjs +1 -1
- package/dist/runtime/log.d.mts +16 -17
- package/dist/runtime/migration-handler-mysql.d.mts +4 -0
- package/dist/runtime/migration-handler-mysql.mjs +81 -0
- package/dist/runtime/migration-handler-pg.d.mts +2 -4
- package/dist/runtime/migration-handler.d.mts +5 -6
- package/dist/runtime/migration-handler.mjs +4 -3
- package/dist/runtime/queues.d.mts +3 -4
- package/dist/runtime/queues.mjs +2 -1
- package/dist/runtime/remote/binding-handler.d.mts +10 -12
- package/dist/runtime/remote/binding-handler.mjs +24 -3
- package/dist/runtime/remote/index.d.mts +5 -6
- package/dist/runtime/remote/index.mjs +21 -18
- package/dist/runtime/response.d.mts +10 -11
- package/dist/runtime/sandbox.d.mts +56 -55
- package/dist/runtime/sandbox.mjs +57 -49
- package/dist/runtime/schema-mysql.d.mts +1 -0
- package/dist/runtime/schema-mysql.mjs +2 -0
- package/dist/runtime/seed.d.mts +14 -9
- package/dist/runtime/sse-client.d.mts +6 -7
- package/dist/runtime/sse.d.mts +11 -12
- package/dist/runtime/storage.d.mts +3 -4
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +12 -12
- package/dist/runtime/ws-server.mjs +32 -4
- package/dist/runtime/ws.d.mts +19 -21
- package/dist/{scan-DYXkrasO.mjs → scan-BMH4rzlv.mjs} +53 -31
- package/dist/{scan-DEwlM_Xy.mjs → scan-CpK-57ug.mjs} +9 -5
- package/dist/{secret-Dt32J6RI.mjs → secret-BqTxGqki.mjs} +62 -5
- package/dist/{skills-CLjN0uUO.mjs → skills-Q46GZMO-.mjs} +6 -4
- package/dist/{standard-schema-DJ0HW7QP.d.mts → standard-schema-Fo_vCAZh.d.mts} +6 -6
- package/dist/{subcommand-prompt-BzV8iQZo.mjs → subcommand-prompt-WfySCQ7S.mjs} +67 -48
- package/dist/sveltekit.d.mts +12 -11
- package/dist/sveltekit.mjs +1 -1
- package/dist/types-BAp5AEBU.d.mts +79 -0
- package/dist/types-CKWnYgfy.d.mts +1 -0
- package/dist/{validate-Cw_RLeTj.mjs → validate-Bihr8WBi.mjs} +3 -3
- package/dist/wrangler--imS8n0d.mjs +1796 -0
- package/dist/{yarn-pnp-DJn3SAHF.mjs → yarn-pnp-DxSInkzL.mjs} +1 -1
- package/package.json +79 -65
- package/schema.json +35 -3
- package/skills/migrate-vite-cloudflare-to-void/SKILL.md +1 -1
- package/skills/void/SKILL.md +59 -2
- package/skills/void/docs/guide/ai.md +32 -14
- package/skills/void/docs/guide/app-types.md +6 -6
- package/skills/void/docs/guide/auth.md +14 -16
- package/skills/void/docs/guide/database/d1.md +6 -0
- package/skills/void/docs/guide/database/mysql.md +60 -0
- package/skills/void/docs/guide/database/postgresql.md +14 -9
- package/skills/void/docs/guide/database.md +39 -26
- package/skills/void/docs/guide/deployment.md +163 -22
- package/skills/void/docs/guide/durable-state.md +140 -0
- package/skills/void/docs/guide/edge/headers.md +5 -5
- package/skills/void/docs/guide/edge/prerendering.md +2 -0
- package/skills/void/docs/guide/edge/revalidation.md +21 -6
- package/skills/void/docs/guide/edge/rewrites.md +18 -14
- package/skills/void/docs/guide/edge/static-assets.md +23 -8
- package/skills/void/docs/guide/email.md +609 -0
- package/skills/void/docs/guide/env-migration.md +109 -0
- package/skills/void/docs/guide/env-vars.md +70 -248
- package/skills/void/docs/guide/index.md +15 -17
- package/skills/void/docs/guide/jobs.md +8 -5
- package/skills/void/docs/guide/live.md +7 -15
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +8 -4
- package/skills/void/docs/guide/pages-routing/islands.md +3 -3
- package/skills/void/docs/guide/pages-routing/loaders.md +6 -4
- package/skills/void/docs/guide/pages-routing/overview.md +7 -7
- package/skills/void/docs/guide/platform-administration.md +212 -0
- package/skills/void/docs/guide/platform-development.md +235 -0
- package/skills/void/docs/guide/queues.md +10 -10
- package/skills/void/docs/guide/quickstart.md +46 -67
- package/skills/void/docs/guide/remote-dev.md +8 -6
- package/skills/void/docs/guide/sandboxes.md +33 -16
- package/skills/void/docs/guide/self-hosted-platform.md +553 -0
- package/skills/void/docs/guide/server-routing.md +25 -5
- package/skills/void/docs/guide/sse.md +4 -4
- package/skills/void/docs/guide/ssg.md +5 -3
- package/skills/void/docs/guide/storage.md +2 -2
- package/skills/void/docs/guide/websockets.md +18 -7
- package/skills/void/docs/index.md +3 -3
- package/skills/void/docs/integrations/agents.md +6 -64
- package/skills/void/docs/integrations/cloudflare.md +165 -146
- package/skills/void/docs/integrations/frameworks/analog.md +4 -4
- package/skills/void/docs/integrations/frameworks/astro.md +5 -5
- package/skills/void/docs/integrations/frameworks/nuxt.md +5 -5
- package/skills/void/docs/integrations/frameworks/overview.md +3 -3
- package/skills/void/docs/integrations/frameworks/react-router.md +3 -3
- package/skills/void/docs/integrations/frameworks/sveltekit.md +3 -3
- package/skills/void/docs/integrations/frameworks/tanstack-start.md +2 -2
- package/skills/void/docs/integrations/nodejs-bun-deno.md +11 -4
- package/skills/void/docs/reference/api.md +42 -6
- package/skills/void/docs/reference/cli.md +637 -159
- package/skills/void/docs/reference/config.md +80 -25
- package/skills/void/docs/reference/resource-inference.md +13 -9
- package/skills/void/docs/reference/structure.md +10 -11
- package/AGENT_PROMPT.md +0 -19
- package/dist/cf-access-Bqw81xAf.mjs +0 -22
- package/dist/env-CZy5MorI.mjs +0 -299
- package/dist/env-helpers-z4stu8uc.d.mts +0 -52
- package/dist/env-mask-Dd47NbR6.mjs +0 -90
- package/dist/env-public-BfiLcMBk.d.mts +0 -140
- package/dist/link-CdGHSIy-.mjs +0 -45
- package/dist/mcp-DoM3_nhd.mjs +0 -377
- package/dist/project-paths-GpziKeQQ.d.mts +0 -25
- package/dist/providers-BNKRacMr.d.mts +0 -7
- package/dist/proxy-D-3_D-Gl.mjs +0 -5
- package/dist/rollback-CkvTFXx5.mjs +0 -90
- package/dist/runtime/isr-cache.d.mts +0 -207
- package/dist/runtime/isr-cache.mjs +0 -523
- package/dist/types-lLjNE9Qp.d.mts +0 -51
- package/getting-started-prompt.txt +0 -28
- package/skills/void/command/void.md +0 -7
- package/skills/void/docs/integrations/auth-providers.md +0 -0
- package/skills/void/docs/integrations/payment-processors.md +0 -0
- package/skills/void/docs/node_modules/@iconify/vue/README.md +0 -408
- package/skills/void/docs/node_modules/@iconify/vue/offline/readme.md +0 -5
- package/skills/void/docs/node_modules/@voidzero-dev/vitepress-theme/README.md +0 -103
- package/skills/void/docs/node_modules/oxc-minify/README.md +0 -78
- package/skills/void/docs/node_modules/reka-ui/README.md +0 -80
- package/skills/void/docs/node_modules/vitepress/README.md +0 -28
- package/skills/void/docs/node_modules/vitepress/template/api-examples.md +0 -49
- package/skills/void/docs/node_modules/vitepress/template/index.md +0 -28
- package/skills/void/docs/node_modules/vitepress/template/markdown-examples.md +0 -85
- package/skills/void/docs/node_modules/vitepress-plugin-group-icons/README.md +0 -101
- package/skills/void/docs/node_modules/void/AGENT_PROMPT.md +0 -19
- package/skills/void/docs/node_modules/void/CLAUDE.md +0 -219
- package/skills/void/docs/node_modules/void/README.md +0 -90
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/CHANGELOG.md +0 -685
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/README.md +0 -396
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/sandbox/README.md +0 -219
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/vite-plugin/README.md +0 -37
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/workers-types/README.md +0 -135
- package/skills/void/docs/node_modules/void/node_modules/@electric-sql/pglite/README.md +0 -189
- package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/CHANGELOG.md +0 -143
- package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/README.md +0 -1272
- package/skills/void/docs/node_modules/void/node_modules/@napi-rs/keyring/README.md +0 -19
- package/skills/void/docs/node_modules/void/node_modules/@types/better-sqlite3/README.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@types/node/README.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@types/pg/README.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@types/proper-lockfile/README.md +0 -51
- package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/README.md +0 -22
- package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/vendor/vscode-jsonrpc/README.md +0 -69
- package/skills/void/docs/node_modules/void/node_modules/@void/md/README.md +0 -153
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/engine-javascript/README.md +0 -9
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/transformers/README.md +0 -9
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@types/node/README.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/CHANGELOG.md +0 -24
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/README.md +0 -565
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-exit/README.md +0 -127
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-anchor/README.md +0 -600
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-attrs/README.md +0 -386
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-container/README.md +0 -95
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-emoji/README.md +0 -101
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-footnote/README.md +0 -135
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathslash/README.md +0 -64
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/shiki/README.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tinyglobby/README.md +0 -25
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/AGENTS.md +0 -16
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/README.md +0 -220
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/build.md +0 -21
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/check.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/create.md +0 -70
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/fmt.md +0 -20
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/index.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/lint.md +0 -26
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/pack.md +0 -17
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/run.md +0 -364
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/staged.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/test.md +0 -18
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/automatic-data-tracking.md +0 -145
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/build.md +0 -40
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/cache.md +0 -107
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/check.md +0 -60
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/ci.md +0 -62
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/commit-hooks.md +0 -60
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/create.md +0 -341
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/dev.md +0 -24
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/docker.md +0 -175
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/env.md +0 -167
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/fmt.md +0 -41
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/github-actions-cache.md +0 -165
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/ide-integration.md +0 -101
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/implode.md +0 -23
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/index.md +0 -134
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/install.md +0 -199
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/lint.md +0 -50
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/migrate-rules.md +0 -347
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/migrate.md +0 -197
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/monorepo.md +0 -176
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/pack.md +0 -69
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/run.md +0 -356
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/test.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/troubleshooting.md +0 -108
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/upgrade.md +0 -101
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/vpx.md +0 -66
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/why.md +0 -39
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/index.md +0 -12
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/team.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/templates/generator/README.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/templates/monorepo/README.md +0 -29
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vue/README.md +0 -58
- package/skills/void/docs/node_modules/void/node_modules/arktype/README.md +0 -165
- package/skills/void/docs/node_modules/void/node_modules/better-auth/LICENSE.md +0 -20
- package/skills/void/docs/node_modules/void/node_modules/better-auth/README.md +0 -32
- package/skills/void/docs/node_modules/void/node_modules/better-sqlite3/README.md +0 -99
- package/skills/void/docs/node_modules/void/node_modules/blake3-jit/README.md +0 -108
- package/skills/void/docs/node_modules/void/node_modules/drizzle-arktype/README.md +0 -51
- package/skills/void/docs/node_modules/void/node_modules/drizzle-kit/README.md +0 -79
- package/skills/void/docs/node_modules/void/node_modules/drizzle-orm/README.md +0 -44
- package/skills/void/docs/node_modules/void/node_modules/drizzle-valibot/README.md +0 -51
- package/skills/void/docs/node_modules/void/node_modules/drizzle-zod/README.md +0 -65
- package/skills/void/docs/node_modules/void/node_modules/es-module-lexer/README.md +0 -403
- package/skills/void/docs/node_modules/void/node_modules/estree-walker/README.md +0 -48
- package/skills/void/docs/node_modules/void/node_modules/hono/README.md +0 -85
- package/skills/void/docs/node_modules/void/node_modules/ignore/README.md +0 -452
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/CHANGELOG.md +0 -76
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/LICENSE.md +0 -21
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/README.md +0 -364
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/SECURITY.md +0 -41
- package/skills/void/docs/node_modules/void/node_modules/magic-string/README.md +0 -325
- package/skills/void/docs/node_modules/void/node_modules/ofetch/README.md +0 -398
- package/skills/void/docs/node_modules/void/node_modules/pathslash/README.md +0 -64
- package/skills/void/docs/node_modules/void/node_modules/pg/README.md +0 -96
- package/skills/void/docs/node_modules/void/node_modules/pglite-server/README.md +0 -135
- package/skills/void/docs/node_modules/void/node_modules/picocolors/README.md +0 -21
- package/skills/void/docs/node_modules/void/node_modules/proper-lockfile/CHANGELOG.md +0 -108
- package/skills/void/docs/node_modules/void/node_modules/proper-lockfile/README.md +0 -183
- package/skills/void/docs/node_modules/void/node_modules/tinyglobby/README.md +0 -25
- package/skills/void/docs/node_modules/void/node_modules/valibot/LICENSE.md +0 -9
- package/skills/void/docs/node_modules/void/node_modules/valibot/README.md +0 -94
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/AGENTS.md +0 -16
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/README.md +0 -220
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/build.md +0 -21
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/check.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/create.md +0 -70
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/fmt.md +0 -20
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/index.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/lint.md +0 -26
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/pack.md +0 -17
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/run.md +0 -364
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/staged.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/test.md +0 -18
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/automatic-data-tracking.md +0 -145
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/build.md +0 -40
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/cache.md +0 -107
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/check.md +0 -60
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/ci.md +0 -62
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/commit-hooks.md +0 -60
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/create.md +0 -341
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/dev.md +0 -24
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/docker.md +0 -175
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/env.md +0 -167
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/fmt.md +0 -41
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/github-actions-cache.md +0 -165
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/ide-integration.md +0 -101
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/implode.md +0 -23
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/index.md +0 -134
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/install.md +0 -199
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/lint.md +0 -50
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/migrate-rules.md +0 -347
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/migrate.md +0 -197
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/monorepo.md +0 -176
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/pack.md +0 -69
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/run.md +0 -356
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/test.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/troubleshooting.md +0 -108
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/upgrade.md +0 -101
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/vpx.md +0 -66
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/why.md +0 -39
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/index.md +0 -12
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/team.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/templates/generator/README.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/templates/monorepo/README.md +0 -29
- package/skills/void/docs/node_modules/void/node_modules/wrangler/README.md +0 -63
- package/skills/void/docs/node_modules/void/node_modules/zod/README.md +0 -191
- package/skills/void/docs/node_modules/void/skills/migrate-vite-cloudflare-to-void/SKILL.md +0 -175
- package/skills/void/docs/node_modules/void/skills/void/SKILL.md +0 -76
- package/skills/void/docs/node_modules/void/skills/void/command/void.md +0 -7
- package/skills/void/docs/node_modules/void/test/e2e/README.md +0 -85
package/dist/cli/cli.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { n as __exportAll } from "../rolldown-runtime-rQ84J-ij.mjs";
|
|
3
|
+
import { o as join } from "../dist-BrsS7cai.mjs";
|
|
4
|
+
import { D as log, G as normalizePlatformApiUrl, O as note, c as import_picocolors, d as formatCloudflareUserMessage, k as outro, l as sectionTitle, p as getPackageDir, s as helpLine, t as categoryTitle } from "../output-tFQLLj26.mjs";
|
|
5
|
+
import { t as cfAccessHeaders } from "../cf-access-AJ1ehiFR.mjs";
|
|
4
6
|
import { readFileSync } from "node:fs";
|
|
5
7
|
import { parseArgs } from "node:util";
|
|
6
8
|
//#region src/cli/args.ts
|
|
@@ -15,8 +17,10 @@ function parseDeployArgs(args) {
|
|
|
15
17
|
spa: { type: "boolean" },
|
|
16
18
|
"skip-build": { type: "boolean" },
|
|
17
19
|
debug: { type: "boolean" },
|
|
20
|
+
platform: { type: "string" },
|
|
18
21
|
backend: { type: "string" },
|
|
19
|
-
provision: { type: "boolean" }
|
|
22
|
+
provision: { type: "boolean" },
|
|
23
|
+
"require-email": { type: "boolean" }
|
|
20
24
|
},
|
|
21
25
|
allowPositionals: true,
|
|
22
26
|
strict: true,
|
|
@@ -25,7 +29,9 @@ function parseDeployArgs(args) {
|
|
|
25
29
|
} catch (error) {
|
|
26
30
|
const message = error instanceof Error ? error.message : String(error);
|
|
27
31
|
if (message.includes("argument missing") || message.includes("argument is ambiguous")) {
|
|
28
|
-
|
|
32
|
+
const optionMatch = message.match(/Option '(--[a-z-]+)/);
|
|
33
|
+
if (optionMatch?.[1] === "--platform") throw new Error("deploy: --platform requires a value ('cloudflare' or 'void').");
|
|
34
|
+
if (optionMatch?.[1] === "--backend") throw new Error("deploy: --backend requires a value ('cloudflare').");
|
|
29
35
|
throw new Error("deploy: --project requires a slug.");
|
|
30
36
|
}
|
|
31
37
|
const unknownOptionMatch = message.match(/Unknown option '([^']+)'/);
|
|
@@ -34,7 +40,11 @@ function parseDeployArgs(args) {
|
|
|
34
40
|
}
|
|
35
41
|
const tokens = parsed.tokens ?? [];
|
|
36
42
|
if (tokens.filter((token) => token.kind === "option" && token.name === "project").length > 1) throw new Error("deploy: --project can only be specified once.");
|
|
37
|
-
|
|
43
|
+
const backendTokens = tokens.filter((token) => token.kind === "option" && token.name === "backend");
|
|
44
|
+
if (backendTokens.length > 1) throw new Error("deploy: --backend can only be specified once.");
|
|
45
|
+
const platformTokens = tokens.filter((token) => token.kind === "option" && token.name === "platform");
|
|
46
|
+
if (platformTokens.length > 1) throw new Error("deploy: --platform can only be specified once.");
|
|
47
|
+
if (platformTokens.length > 0 && backendTokens.length > 0) throw new Error("deploy: --platform and --backend cannot be used together.");
|
|
38
48
|
if (parsed.positionals.length > 0) throw new Error(`deploy: Unexpected argument '${parsed.positionals[0]}'.`);
|
|
39
49
|
const projectValue = parsed.values.project;
|
|
40
50
|
const projectSlug = typeof projectValue === "string" ? projectValue : void 0;
|
|
@@ -43,15 +53,18 @@ function parseDeployArgs(args) {
|
|
|
43
53
|
const spa = parsed.values.spa === true ? true : void 0;
|
|
44
54
|
const skipBuild = parsed.values["skip-build"] === true ? true : void 0;
|
|
45
55
|
const debug = parsed.values.debug === true ? true : void 0;
|
|
56
|
+
const platformValue = typeof parsed.values.platform === "string" ? parsed.values.platform : void 0;
|
|
57
|
+
if (platformValue !== void 0 && platformValue !== "cloudflare" && platformValue !== "void") throw new Error("deploy: --platform must be 'cloudflare' or 'void'.");
|
|
58
|
+
const platform = platformValue;
|
|
46
59
|
const backendValue = typeof parsed.values.backend === "string" ? parsed.values.backend : void 0;
|
|
47
60
|
if (backendValue !== void 0 && backendValue !== "cloudflare") throw new Error("deploy: --backend must be 'cloudflare'.");
|
|
48
61
|
const backend = backendValue;
|
|
49
62
|
const provision = parsed.values.provision === true ? true : void 0;
|
|
50
|
-
if (provision && backend !== "cloudflare") throw new Error("deploy: --provision requires --
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (
|
|
63
|
+
if (provision && backend !== "cloudflare" && platform !== "cloudflare") throw new Error("deploy: --provision requires --platform cloudflare.");
|
|
64
|
+
const requireEmail = parsed.values["require-email"] === true ? true : void 0;
|
|
65
|
+
if (requireEmail && backend !== "cloudflare" && platform !== "cloudflare") throw new Error("deploy: --require-email requires --platform cloudflare.");
|
|
66
|
+
if (backend === "cloudflare" || platform === "cloudflare") {
|
|
67
|
+
if (projectSlug !== void 0) throw new Error("deploy: --project is not supported with --platform cloudflare — this platform deploys to your own Cloudflare account and no Void project is involved.");
|
|
55
68
|
}
|
|
56
69
|
return {
|
|
57
70
|
projectSlug,
|
|
@@ -59,8 +72,10 @@ function parseDeployArgs(args) {
|
|
|
59
72
|
spa,
|
|
60
73
|
skipBuild,
|
|
61
74
|
debug,
|
|
75
|
+
platform,
|
|
62
76
|
backend,
|
|
63
|
-
provision
|
|
77
|
+
provision,
|
|
78
|
+
requireEmail
|
|
64
79
|
};
|
|
65
80
|
}
|
|
66
81
|
//#endregion
|
|
@@ -135,6 +150,54 @@ function parseBuildArgs(args) {
|
|
|
135
150
|
};
|
|
136
151
|
}
|
|
137
152
|
//#endregion
|
|
153
|
+
//#region src/cli/cloudflare-args.ts
|
|
154
|
+
const cloudflareSubcommands = [
|
|
155
|
+
{
|
|
156
|
+
name: "login",
|
|
157
|
+
description: "Sign in or switch Cloudflare users securely"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: "status",
|
|
161
|
+
description: "Show Cloudflare identity and the pinned deployment account"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
name: "logout",
|
|
165
|
+
description: "Remove the local Cloudflare browser session"
|
|
166
|
+
}
|
|
167
|
+
];
|
|
168
|
+
function parseCloudflareArgs(args) {
|
|
169
|
+
const [subcommand, extra] = args;
|
|
170
|
+
if (!subcommand || ![
|
|
171
|
+
"login",
|
|
172
|
+
"status",
|
|
173
|
+
"logout"
|
|
174
|
+
].includes(subcommand)) throw new Error("cloudflare: Usage: void cloudflare <login|status|logout>.");
|
|
175
|
+
if (extra) throw new Error(`cloudflare: Unexpected argument '${extra}'.`);
|
|
176
|
+
return { subcommand };
|
|
177
|
+
}
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region src/cli/connect-args.ts
|
|
180
|
+
function parseConnectArgs(args) {
|
|
181
|
+
const { values, positionals } = parseArgs({
|
|
182
|
+
args,
|
|
183
|
+
allowPositionals: true,
|
|
184
|
+
strict: true,
|
|
185
|
+
options: {
|
|
186
|
+
platform: { type: "string" },
|
|
187
|
+
"no-login": { type: "boolean" }
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
if (positionals.length > 1) throw new Error("connect: Expected at most one platform URL.");
|
|
191
|
+
const platform = values.platform ?? null;
|
|
192
|
+
if (platform !== null && platform !== "cloudflare" && platform !== "void") throw new Error("connect: --platform must be cloudflare or void.");
|
|
193
|
+
if (platform === "cloudflare" && (positionals.length > 0 || values["no-login"])) throw new Error("connect: A URL and --no-login are only supported for Void platforms.");
|
|
194
|
+
return {
|
|
195
|
+
url: positionals[0] ?? "",
|
|
196
|
+
platform,
|
|
197
|
+
noLogin: values["no-login"] ?? false
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
//#endregion
|
|
138
201
|
//#region src/cli/db-args.ts
|
|
139
202
|
const dbSubcommands = [
|
|
140
203
|
{
|
|
@@ -189,7 +252,33 @@ const dbSubcommands = [
|
|
|
189
252
|
},
|
|
190
253
|
{
|
|
191
254
|
name: "set-url",
|
|
192
|
-
description: "Update the
|
|
255
|
+
description: "Update the external database URL for deployment"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
name: "connect",
|
|
259
|
+
arg: "[connection-string]",
|
|
260
|
+
description: "Connect or provision an external database",
|
|
261
|
+
flags: [
|
|
262
|
+
{
|
|
263
|
+
name: "--provider",
|
|
264
|
+
arg: "<name-or-module>",
|
|
265
|
+
description: "Provision with an adapter"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
name: "--name",
|
|
269
|
+
arg: "<name>",
|
|
270
|
+
description: "Provider project/database name"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
name: "--region",
|
|
274
|
+
arg: "<region>",
|
|
275
|
+
description: "Provider region identifier"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
name: "--local-only",
|
|
279
|
+
description: "Do not sync a linked Void project"
|
|
280
|
+
}
|
|
281
|
+
]
|
|
193
282
|
},
|
|
194
283
|
{
|
|
195
284
|
name: "rename-migrations",
|
|
@@ -229,7 +318,11 @@ function parseDbArgs(args) {
|
|
|
229
318
|
"no-data": { type: "boolean" },
|
|
230
319
|
"no-schema": { type: "boolean" },
|
|
231
320
|
table: { type: "string" },
|
|
232
|
-
remote: { type: "boolean" }
|
|
321
|
+
remote: { type: "boolean" },
|
|
322
|
+
provider: { type: "string" },
|
|
323
|
+
name: { type: "string" },
|
|
324
|
+
region: { type: "string" },
|
|
325
|
+
"local-only": { type: "boolean" }
|
|
233
326
|
},
|
|
234
327
|
allowPositionals: true,
|
|
235
328
|
strict: true
|
|
@@ -289,6 +382,20 @@ function parseDbArgs(args) {
|
|
|
289
382
|
if (rest.length > 0) throw new Error(`db: Unexpected argument '${rest[0]}'.`);
|
|
290
383
|
return { action };
|
|
291
384
|
}
|
|
385
|
+
if (action === "connect") {
|
|
386
|
+
if (rest.length > 1) throw new Error(`db: Unexpected argument '${rest[1]}'.`);
|
|
387
|
+
const url = rest[0];
|
|
388
|
+
const provider = typeof parsed.values.provider === "string" ? parsed.values.provider : void 0;
|
|
389
|
+
if (url && provider) throw new Error("db: Provide either a connection string or --provider, not both.");
|
|
390
|
+
return {
|
|
391
|
+
action,
|
|
392
|
+
url,
|
|
393
|
+
provider,
|
|
394
|
+
name: typeof parsed.values.name === "string" ? parsed.values.name : void 0,
|
|
395
|
+
region: typeof parsed.values.region === "string" ? parsed.values.region : void 0,
|
|
396
|
+
localOnly: parsed.values["local-only"] === true ? true : void 0
|
|
397
|
+
};
|
|
398
|
+
}
|
|
292
399
|
if (action === "rename-migrations") {
|
|
293
400
|
if (rest.length > 0) throw new Error(`db: Unexpected argument '${rest[0]}'.`);
|
|
294
401
|
return { action };
|
|
@@ -304,7 +411,7 @@ function parseDbArgs(args) {
|
|
|
304
411
|
table: typeof parsed.values.table === "string" ? parsed.values.table : void 0
|
|
305
412
|
};
|
|
306
413
|
}
|
|
307
|
-
throw new Error("db: Usage: void db <push|generate|status|reset|seed|execute|migrate|studio|export|set-url|rename-migrations>.");
|
|
414
|
+
throw new Error("db: Usage: void db <push|generate|status|reset|seed|execute|migrate|studio|export|connect|set-url|rename-migrations>.");
|
|
308
415
|
}
|
|
309
416
|
//#endregion
|
|
310
417
|
//#region src/cli/domain-args.ts
|
|
@@ -354,29 +461,154 @@ function parseDomainArgs(args) {
|
|
|
354
461
|
};
|
|
355
462
|
}
|
|
356
463
|
//#endregion
|
|
357
|
-
//#region src/cli/
|
|
358
|
-
const
|
|
464
|
+
//#region src/cli/email-args.ts
|
|
465
|
+
const PLATFORM_FLAG = {
|
|
466
|
+
name: "--platform",
|
|
467
|
+
arg: "<cloudflare|void>",
|
|
468
|
+
description: "Your own Cloudflare account (`cloudflare`) instead of the Void platform"
|
|
469
|
+
};
|
|
470
|
+
const emailSubcommands = [
|
|
359
471
|
{
|
|
360
|
-
name: "
|
|
361
|
-
description: "
|
|
362
|
-
flags: [{
|
|
363
|
-
name: "--remote",
|
|
364
|
-
description: "Also check that required keys exist as remote secrets"
|
|
365
|
-
}]
|
|
472
|
+
name: "usage",
|
|
473
|
+
description: "Show monthly email send/receive counts and quota"
|
|
366
474
|
},
|
|
367
475
|
{
|
|
368
|
-
name: "
|
|
369
|
-
description: "
|
|
476
|
+
name: "logs",
|
|
477
|
+
description: "Show recent email delivery activity"
|
|
370
478
|
},
|
|
371
479
|
{
|
|
372
|
-
name: "
|
|
373
|
-
description: "
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
480
|
+
name: "destinations",
|
|
481
|
+
description: "List verified recipient addresses for outbound mail"
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
name: "allow",
|
|
485
|
+
arg: "<address>",
|
|
486
|
+
description: "Add a recipient and trigger CF verification"
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
name: "disallow",
|
|
490
|
+
arg: "<address>",
|
|
491
|
+
description: "Remove a verified recipient"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
name: "status",
|
|
495
|
+
description: "Show the email setup state and address map",
|
|
496
|
+
flags: [PLATFORM_FLAG]
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
name: "setup",
|
|
500
|
+
description: "Set email up on your own Cloudflare account (--platform cloudflare)",
|
|
501
|
+
flags: [PLATFORM_FLAG]
|
|
378
502
|
}
|
|
379
503
|
];
|
|
504
|
+
const EMAIL_SUBCOMMANDS = [
|
|
505
|
+
"usage",
|
|
506
|
+
"logs",
|
|
507
|
+
"destinations",
|
|
508
|
+
"allow",
|
|
509
|
+
"disallow",
|
|
510
|
+
"status",
|
|
511
|
+
"setup"
|
|
512
|
+
];
|
|
513
|
+
/**
|
|
514
|
+
* Read a value-taking flag in its `--flag value` or `--flag=value` form. Returns the
|
|
515
|
+
* raw value, or `undefined` when the flag is the last token or is followed by another
|
|
516
|
+
* option — the same rule `parseArgs` applies for `void deploy`, so `--platform --limit 3`
|
|
517
|
+
* is a missing value, not a value of `--limit`.
|
|
518
|
+
*/
|
|
519
|
+
function readFlagValue(rest, i, flag) {
|
|
520
|
+
const token = rest[i];
|
|
521
|
+
if (token.startsWith(`${flag}=`)) return {
|
|
522
|
+
value: token.slice(flag.length + 1),
|
|
523
|
+
next: i
|
|
524
|
+
};
|
|
525
|
+
const value = rest[i + 1];
|
|
526
|
+
if (value === void 0 || value.startsWith("-")) return {
|
|
527
|
+
value: void 0,
|
|
528
|
+
next: i
|
|
529
|
+
};
|
|
530
|
+
return {
|
|
531
|
+
value,
|
|
532
|
+
next: i + 1
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
function parseEmailArgs(args) {
|
|
536
|
+
const subcommand = args[0];
|
|
537
|
+
if (!subcommand || !EMAIL_SUBCOMMANDS.includes(subcommand)) throw new Error("email: Usage: void email <usage|logs|destinations|allow|disallow|status|setup> [args] [--project <name>] [--limit <n>] [--platform cloudflare].");
|
|
538
|
+
let limit;
|
|
539
|
+
const projectValues = [];
|
|
540
|
+
const platformValues = [];
|
|
541
|
+
const backendValues = [];
|
|
542
|
+
const positional = [];
|
|
543
|
+
const rest = args.slice(1);
|
|
544
|
+
for (let i = 0; i < rest.length; i++) if (rest[i] === "--project" || rest[i]?.startsWith("--project=")) {
|
|
545
|
+
const { value, next } = readFlagValue(rest, i, "--project");
|
|
546
|
+
if (value === void 0 || value.trim() === "") throw new Error("email: --project requires a value (a project name).");
|
|
547
|
+
projectValues.push(value);
|
|
548
|
+
i = next;
|
|
549
|
+
} else if (rest[i] === "--limit" || rest[i]?.startsWith("--limit=")) {
|
|
550
|
+
const { value: raw, next } = readFlagValue(rest, i, "--limit");
|
|
551
|
+
if (raw === void 0) throw new Error("email: --limit requires a value (a positive integer).");
|
|
552
|
+
const n = parseInt(raw, 10);
|
|
553
|
+
if (!Number.isFinite(n) || n <= 0) throw new Error(`email: --limit must be a positive integer (got '${raw}').`);
|
|
554
|
+
limit = n;
|
|
555
|
+
i = next;
|
|
556
|
+
} else if (rest[i] === "--platform" || rest[i]?.startsWith("--platform=")) {
|
|
557
|
+
const { value, next } = readFlagValue(rest, i, "--platform");
|
|
558
|
+
if (value === void 0) throw new Error("email: --platform requires a value ('cloudflare' or 'void').");
|
|
559
|
+
platformValues.push(value);
|
|
560
|
+
i = next;
|
|
561
|
+
} else if (rest[i] === "--backend" || rest[i]?.startsWith("--backend=")) {
|
|
562
|
+
const { value, next } = readFlagValue(rest, i, "--backend");
|
|
563
|
+
if (value === void 0) throw new Error("email: --backend requires a value ('cloudflare').");
|
|
564
|
+
backendValues.push(value);
|
|
565
|
+
i = next;
|
|
566
|
+
} else positional.push(rest[i]);
|
|
567
|
+
if (projectValues.length > 1) throw new Error("email: --project can only be specified once.");
|
|
568
|
+
const projectSlug = projectValues[0];
|
|
569
|
+
if (backendValues.length > 1) throw new Error("email: --backend can only be specified once.");
|
|
570
|
+
if (platformValues.length > 1) throw new Error("email: --platform can only be specified once.");
|
|
571
|
+
if (platformValues.length > 0 && backendValues.length > 0) throw new Error("email: --platform and --backend cannot be used together.");
|
|
572
|
+
let platform;
|
|
573
|
+
const platformValue = platformValues[0];
|
|
574
|
+
if (platformValue !== void 0) {
|
|
575
|
+
if (platformValue !== "cloudflare" && platformValue !== "void") throw new Error("email: --platform must be 'cloudflare' or 'void'.");
|
|
576
|
+
platform = platformValue;
|
|
577
|
+
}
|
|
578
|
+
const backendValue = backendValues[0];
|
|
579
|
+
if (backendValue !== void 0) {
|
|
580
|
+
if (backendValue !== "cloudflare") throw new Error("email: --backend must be 'cloudflare'.");
|
|
581
|
+
platform = "cloudflare";
|
|
582
|
+
}
|
|
583
|
+
if (positional.length > 1) throw new Error(`email: \`void email ${subcommand}\` takes exactly one positional argument (got ${positional.length}: ${positional.map((p) => JSON.stringify(p)).join(", ")}).`);
|
|
584
|
+
const address = positional[0];
|
|
585
|
+
if ((subcommand === "allow" || subcommand === "disallow") && !address) throw new Error(`email: Usage: void email ${subcommand} <address> [--project <name>].`);
|
|
586
|
+
if (platform === "cloudflare") {
|
|
587
|
+
if (subcommand !== "status" && subcommand !== "setup") throw new Error(`email: --platform cloudflare applies to \`void email status\` and \`void email setup\` only (\`${subcommand}\` is a Void platform command).`);
|
|
588
|
+
if (projectSlug !== void 0) throw new Error("email: --project cannot be combined with --platform cloudflare (it reads the local project, not a Void project).");
|
|
589
|
+
if (address !== void 0) throw new Error(`email: \`void email ${subcommand} --platform cloudflare\` takes no argument.`);
|
|
590
|
+
}
|
|
591
|
+
return {
|
|
592
|
+
subcommand,
|
|
593
|
+
projectSlug,
|
|
594
|
+
limit,
|
|
595
|
+
address,
|
|
596
|
+
platform
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
//#endregion
|
|
600
|
+
//#region src/cli/env-args.ts
|
|
601
|
+
const envSubcommands = [{
|
|
602
|
+
name: "check",
|
|
603
|
+
description: "Validate local .env or required remote secret names",
|
|
604
|
+
flags: [{
|
|
605
|
+
name: "--remote",
|
|
606
|
+
description: "Also check that required keys exist as remote secrets"
|
|
607
|
+
}]
|
|
608
|
+
}, {
|
|
609
|
+
name: "types",
|
|
610
|
+
description: "Regenerate .void/env.d.ts from env.ts"
|
|
611
|
+
}];
|
|
380
612
|
function parseEnvArgs(args) {
|
|
381
613
|
const [subcommand, ...rest] = args;
|
|
382
614
|
if (subcommand === "check") {
|
|
@@ -396,20 +628,7 @@ function parseEnvArgs(args) {
|
|
|
396
628
|
if (rest.length > 0) throw new Error(`env: Unexpected argument '${rest[0]}'.`);
|
|
397
629
|
return { subcommand: "types" };
|
|
398
630
|
}
|
|
399
|
-
|
|
400
|
-
const parsed = parseArgs({
|
|
401
|
-
args: rest,
|
|
402
|
-
options: { force: { type: "boolean" } },
|
|
403
|
-
allowPositionals: true,
|
|
404
|
-
strict: true
|
|
405
|
-
});
|
|
406
|
-
if (parsed.positionals.length > 0) throw new Error(`env: Unexpected argument '${parsed.positionals[0]}'.`);
|
|
407
|
-
return {
|
|
408
|
-
subcommand: "example",
|
|
409
|
-
force: !!parsed.values.force
|
|
410
|
-
};
|
|
411
|
-
}
|
|
412
|
-
throw new Error("env: Usage: void env <check|types|example>.");
|
|
631
|
+
throw new Error("env: Usage: void env <check|types>.");
|
|
413
632
|
}
|
|
414
633
|
//#endregion
|
|
415
634
|
//#region src/cli/gen-args.ts
|
|
@@ -854,21 +1073,588 @@ dP .dP .d8888b. dP .d888b88
|
|
|
854
1073
|
| |/ / /_/ / / /_/ /
|
|
855
1074
|
|___/\\____/_/\\__,_/`
|
|
856
1075
|
];
|
|
1076
|
+
const OPERATOR_MAX_TIMEOUT_MS = 36e5;
|
|
1077
|
+
var OperatorClientError = class extends Error {
|
|
1078
|
+
code;
|
|
1079
|
+
status;
|
|
1080
|
+
details;
|
|
1081
|
+
constructor(message, code = "operator_error", status, details) {
|
|
1082
|
+
super(message);
|
|
1083
|
+
this.code = code;
|
|
1084
|
+
this.status = status;
|
|
1085
|
+
this.details = details;
|
|
1086
|
+
this.name = "OperatorClientError";
|
|
1087
|
+
}
|
|
1088
|
+
toJSON() {
|
|
1089
|
+
return {
|
|
1090
|
+
error: this.code,
|
|
1091
|
+
message: this.message,
|
|
1092
|
+
...this.status === void 0 ? {} : { status: this.status },
|
|
1093
|
+
...this.details === void 0 ? {} : { details: this.details }
|
|
1094
|
+
};
|
|
1095
|
+
}
|
|
1096
|
+
};
|
|
1097
|
+
var OperatorClient = class {
|
|
1098
|
+
token;
|
|
1099
|
+
fetcher;
|
|
1100
|
+
origin;
|
|
1101
|
+
constructor(origin, token, fetcher = fetch) {
|
|
1102
|
+
this.token = token;
|
|
1103
|
+
this.fetcher = fetcher;
|
|
1104
|
+
this.origin = normalizePlatformApiUrl(origin);
|
|
1105
|
+
}
|
|
1106
|
+
async request(path, options = {}) {
|
|
1107
|
+
if (!path.startsWith("/") || path.startsWith("//") || path.includes("?") || path.includes("#")) throw new OperatorClientError("Invalid operator API path.");
|
|
1108
|
+
const timeoutMs = options.timeoutMs ?? (options.method === "POST" ? 3e5 : 3e4);
|
|
1109
|
+
if (!Number.isSafeInteger(timeoutMs) || timeoutMs < 1e3 || timeoutMs > 36e5) throw new OperatorClientError(`Operator request timeout must be an integer from 1 to ${OPERATOR_MAX_TIMEOUT_MS / 1e3} seconds.`, "invalid_timeout");
|
|
1110
|
+
const url = new URL(`${this.origin}/operator/v1${path}`);
|
|
1111
|
+
for (const [name, value] of Object.entries(options.query ?? {})) url.searchParams.set(name, value);
|
|
1112
|
+
const timeoutController = new AbortController();
|
|
1113
|
+
const timer = setTimeout(() => timeoutController.abort(), timeoutMs);
|
|
1114
|
+
timer.unref();
|
|
1115
|
+
const signal = options.signal ? AbortSignal.any([options.signal, timeoutController.signal]) : timeoutController.signal;
|
|
1116
|
+
try {
|
|
1117
|
+
let response;
|
|
1118
|
+
try {
|
|
1119
|
+
response = await this.fetcher(url, {
|
|
1120
|
+
method: options.method ?? "GET",
|
|
1121
|
+
headers: {
|
|
1122
|
+
...cfAccessHeaders(process.env, this.origin),
|
|
1123
|
+
Authorization: `Bearer ${this.token}`,
|
|
1124
|
+
Accept: "application/json",
|
|
1125
|
+
...options.body ? { "Content-Type": "application/json" } : {}
|
|
1126
|
+
},
|
|
1127
|
+
...options.body ? { body: JSON.stringify(options.body) } : {},
|
|
1128
|
+
redirect: "manual",
|
|
1129
|
+
signal
|
|
1130
|
+
});
|
|
1131
|
+
} catch (error) {
|
|
1132
|
+
if (options.signal?.aborted) throw error;
|
|
1133
|
+
if (timeoutController.signal.aborted) throw new OperatorClientError(`Operator request exceeded the ${timeoutMs / 1e3}-second timeout. ${options.method === "POST" ? "Its outcome may be unknown; inspect platform state before retrying." : "Check connectivity and try again."}`, "request_timeout");
|
|
1134
|
+
throw new OperatorClientError(`Operator request to ${this.origin} failed. ${options.method === "POST" ? "Its outcome may be unknown; inspect platform state before retrying." : "Check connectivity and try again."}`, "connection_failed");
|
|
1135
|
+
}
|
|
1136
|
+
if (response.status >= 300 && response.status < 400) throw new OperatorClientError("The operator API redirected the request. Credentials were not forwarded; use the exact platform API origin.", "redirect_rejected", response.status);
|
|
1137
|
+
let data;
|
|
1138
|
+
try {
|
|
1139
|
+
data = await response.json();
|
|
1140
|
+
} catch {
|
|
1141
|
+
throw new OperatorClientError(`Operator API returned invalid JSON (HTTP ${response.status}).${options.method === "POST" ? " Inspect platform state before retrying." : ""}`, "invalid_response", response.status);
|
|
1142
|
+
}
|
|
1143
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) throw new OperatorClientError("Operator API returned an invalid response object.", "invalid_response", response.status);
|
|
1144
|
+
const result = data;
|
|
1145
|
+
if (!response.ok) throw new OperatorClientError(typeof result.message === "string" ? result.message : `Operator request failed (HTTP ${response.status}).`, typeof result.error === "string" ? result.error : "request_failed", response.status, result.details);
|
|
1146
|
+
if (result.partial === true || result.ok === false) throw new OperatorClientError("The operation did not fully complete. Inspect the partial result before retrying.", "partial_failure", response.status, result);
|
|
1147
|
+
return result;
|
|
1148
|
+
} finally {
|
|
1149
|
+
clearTimeout(timer);
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
};
|
|
1153
|
+
//#endregion
|
|
1154
|
+
//#region src/cli/operator-args.ts
|
|
1155
|
+
const operatorCommands = [
|
|
1156
|
+
{
|
|
1157
|
+
group: "auth",
|
|
1158
|
+
action: "login",
|
|
1159
|
+
description: "Sign in as a platform administrator",
|
|
1160
|
+
path: "/session",
|
|
1161
|
+
values: { provider: "OAuth provider" },
|
|
1162
|
+
booleans: ["token-stdin"]
|
|
1163
|
+
},
|
|
1164
|
+
{
|
|
1165
|
+
group: "auth",
|
|
1166
|
+
action: "logout",
|
|
1167
|
+
description: "Revoke the current operator session and remove its local credential",
|
|
1168
|
+
path: "/session/logout"
|
|
1169
|
+
},
|
|
1170
|
+
{
|
|
1171
|
+
group: "auth",
|
|
1172
|
+
action: "status",
|
|
1173
|
+
description: "Inspect operator identity, expiry, and capabilities",
|
|
1174
|
+
path: "/session"
|
|
1175
|
+
},
|
|
1176
|
+
{
|
|
1177
|
+
group: "auth",
|
|
1178
|
+
action: "token",
|
|
1179
|
+
description: "Print an operator token; exchange an API session with --token-stdin",
|
|
1180
|
+
path: "/session",
|
|
1181
|
+
booleans: ["token-stdin"]
|
|
1182
|
+
},
|
|
1183
|
+
{
|
|
1184
|
+
group: "user",
|
|
1185
|
+
action: "list",
|
|
1186
|
+
description: "List users",
|
|
1187
|
+
path: "/users",
|
|
1188
|
+
values: { search: "Search login or email" }
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
group: "user",
|
|
1192
|
+
action: "show",
|
|
1193
|
+
description: "Inspect a user, usage, and projects",
|
|
1194
|
+
path: "/users/:id",
|
|
1195
|
+
positional: ["id"]
|
|
1196
|
+
},
|
|
1197
|
+
{
|
|
1198
|
+
group: "user",
|
|
1199
|
+
action: "plan",
|
|
1200
|
+
description: "Change a user plan",
|
|
1201
|
+
path: "/users/:id/plan",
|
|
1202
|
+
positional: ["id", "plan"],
|
|
1203
|
+
method: "POST"
|
|
1204
|
+
},
|
|
1205
|
+
{
|
|
1206
|
+
group: "user",
|
|
1207
|
+
action: "suspend",
|
|
1208
|
+
description: "Suspend a user and their projects",
|
|
1209
|
+
path: "/users/:id/suspend",
|
|
1210
|
+
positional: ["id"],
|
|
1211
|
+
values: { reason: "Reason for suspension" },
|
|
1212
|
+
method: "POST"
|
|
1213
|
+
},
|
|
1214
|
+
{
|
|
1215
|
+
group: "user",
|
|
1216
|
+
action: "restore",
|
|
1217
|
+
description: "Restore a suspended user",
|
|
1218
|
+
path: "/users/:id/restore",
|
|
1219
|
+
positional: ["id"],
|
|
1220
|
+
method: "POST"
|
|
1221
|
+
},
|
|
1222
|
+
{
|
|
1223
|
+
group: "user",
|
|
1224
|
+
action: "delete",
|
|
1225
|
+
description: "Delete a user and all owned resources",
|
|
1226
|
+
path: "/users/:id/delete",
|
|
1227
|
+
positional: ["id"],
|
|
1228
|
+
method: "POST"
|
|
1229
|
+
},
|
|
1230
|
+
{
|
|
1231
|
+
group: "project",
|
|
1232
|
+
action: "list",
|
|
1233
|
+
description: "List tenant projects",
|
|
1234
|
+
path: "/projects",
|
|
1235
|
+
values: {
|
|
1236
|
+
user: "Owner user ID",
|
|
1237
|
+
search: "Search projects"
|
|
1238
|
+
}
|
|
1239
|
+
},
|
|
1240
|
+
{
|
|
1241
|
+
group: "project",
|
|
1242
|
+
action: "show",
|
|
1243
|
+
description: "Inspect a project and its resources",
|
|
1244
|
+
path: "/projects/:id",
|
|
1245
|
+
positional: ["id"]
|
|
1246
|
+
},
|
|
1247
|
+
{
|
|
1248
|
+
group: "project",
|
|
1249
|
+
action: "delete",
|
|
1250
|
+
description: "Delete a project and its resources",
|
|
1251
|
+
path: "/projects/:id/delete",
|
|
1252
|
+
positional: ["id"],
|
|
1253
|
+
method: "POST"
|
|
1254
|
+
},
|
|
1255
|
+
{
|
|
1256
|
+
group: "deployment",
|
|
1257
|
+
action: "list",
|
|
1258
|
+
description: "List tenant deployments",
|
|
1259
|
+
path: "/deployments",
|
|
1260
|
+
values: {
|
|
1261
|
+
project: "Project ID",
|
|
1262
|
+
search: "Search deployments",
|
|
1263
|
+
status: "Deployment status"
|
|
1264
|
+
}
|
|
1265
|
+
},
|
|
1266
|
+
{
|
|
1267
|
+
group: "deployment",
|
|
1268
|
+
action: "show",
|
|
1269
|
+
description: "Inspect a deployment",
|
|
1270
|
+
path: "/deployments/:id",
|
|
1271
|
+
positional: ["id"]
|
|
1272
|
+
},
|
|
1273
|
+
{
|
|
1274
|
+
group: "deployment",
|
|
1275
|
+
action: "cancel",
|
|
1276
|
+
description: "Cancel a deployment",
|
|
1277
|
+
path: "/deployments/:id/cancel",
|
|
1278
|
+
positional: ["id"],
|
|
1279
|
+
method: "POST"
|
|
1280
|
+
},
|
|
1281
|
+
{
|
|
1282
|
+
group: "deployment",
|
|
1283
|
+
action: "logs",
|
|
1284
|
+
description: "Read runtime logs (JSON follow emits one object per line)",
|
|
1285
|
+
path: "/deployments/:id/logs",
|
|
1286
|
+
positional: ["id"],
|
|
1287
|
+
values: {
|
|
1288
|
+
since: "Duration or ISO timestamp",
|
|
1289
|
+
cursor: "Opaque continuation cursor"
|
|
1290
|
+
},
|
|
1291
|
+
booleans: ["follow"]
|
|
1292
|
+
},
|
|
1293
|
+
{
|
|
1294
|
+
group: "build",
|
|
1295
|
+
action: "show",
|
|
1296
|
+
description: "Inspect a managed build",
|
|
1297
|
+
path: "/builds/:id",
|
|
1298
|
+
positional: ["id"]
|
|
1299
|
+
},
|
|
1300
|
+
{
|
|
1301
|
+
group: "build",
|
|
1302
|
+
action: "logs",
|
|
1303
|
+
description: "Read build logs (JSON follow emits one object per line)",
|
|
1304
|
+
path: "/builds/:id/logs",
|
|
1305
|
+
positional: ["id"],
|
|
1306
|
+
values: { since: "Last received sequence number" },
|
|
1307
|
+
booleans: ["follow"]
|
|
1308
|
+
},
|
|
1309
|
+
{
|
|
1310
|
+
group: "signup",
|
|
1311
|
+
action: "show",
|
|
1312
|
+
description: "Inspect signup restrictions and allowlist",
|
|
1313
|
+
path: "/signup"
|
|
1314
|
+
},
|
|
1315
|
+
{
|
|
1316
|
+
group: "signup",
|
|
1317
|
+
action: "restrict",
|
|
1318
|
+
description: "Restrict signup to the allowlist",
|
|
1319
|
+
path: "/signup/restrict",
|
|
1320
|
+
method: "POST"
|
|
1321
|
+
},
|
|
1322
|
+
{
|
|
1323
|
+
group: "signup",
|
|
1324
|
+
action: "open",
|
|
1325
|
+
description: "Open public signup",
|
|
1326
|
+
path: "/signup/open",
|
|
1327
|
+
method: "POST"
|
|
1328
|
+
},
|
|
1329
|
+
{
|
|
1330
|
+
group: "signup",
|
|
1331
|
+
action: "allow",
|
|
1332
|
+
description: "Add a github or email allowlist pattern",
|
|
1333
|
+
path: "/signup/allow",
|
|
1334
|
+
positional: ["type", "pattern"],
|
|
1335
|
+
values: { note: "Allowlist note" },
|
|
1336
|
+
method: "POST"
|
|
1337
|
+
},
|
|
1338
|
+
{
|
|
1339
|
+
group: "signup",
|
|
1340
|
+
action: "remove",
|
|
1341
|
+
description: "Remove a github or email allowlist pattern",
|
|
1342
|
+
path: "/signup/remove",
|
|
1343
|
+
positional: ["type", "pattern"],
|
|
1344
|
+
method: "POST"
|
|
1345
|
+
},
|
|
1346
|
+
{
|
|
1347
|
+
group: "invitation",
|
|
1348
|
+
action: "list",
|
|
1349
|
+
description: "List invitations",
|
|
1350
|
+
path: "/invitations"
|
|
1351
|
+
},
|
|
1352
|
+
{
|
|
1353
|
+
group: "invitation",
|
|
1354
|
+
action: "send",
|
|
1355
|
+
description: "Send invitations to comma-separated email addresses",
|
|
1356
|
+
path: "/invitations/send",
|
|
1357
|
+
positional: ["emails"],
|
|
1358
|
+
method: "POST"
|
|
1359
|
+
},
|
|
1360
|
+
{
|
|
1361
|
+
group: "invitation",
|
|
1362
|
+
action: "revoke",
|
|
1363
|
+
description: "Revoke an invitation",
|
|
1364
|
+
path: "/invitations/:id/revoke",
|
|
1365
|
+
positional: ["id"],
|
|
1366
|
+
method: "POST"
|
|
1367
|
+
},
|
|
1368
|
+
{
|
|
1369
|
+
group: "system",
|
|
1370
|
+
action: "overview",
|
|
1371
|
+
description: "Inspect platform usage and capacity",
|
|
1372
|
+
path: "/system/overview"
|
|
1373
|
+
},
|
|
1374
|
+
{
|
|
1375
|
+
group: "system",
|
|
1376
|
+
action: "health",
|
|
1377
|
+
description: "Check platform health",
|
|
1378
|
+
path: "/system/health"
|
|
1379
|
+
},
|
|
1380
|
+
{
|
|
1381
|
+
group: "system",
|
|
1382
|
+
action: "cli-versions",
|
|
1383
|
+
description: "Inspect CLI version adoption and deployment statistics",
|
|
1384
|
+
path: "/system/cli-versions"
|
|
1385
|
+
},
|
|
1386
|
+
{
|
|
1387
|
+
group: "system",
|
|
1388
|
+
action: "events",
|
|
1389
|
+
description: "List operator audit events",
|
|
1390
|
+
path: "/system/events"
|
|
1391
|
+
},
|
|
1392
|
+
{
|
|
1393
|
+
group: "system",
|
|
1394
|
+
action: "backfill-queue-tokens",
|
|
1395
|
+
description: "Repair missing queue authentication tokens",
|
|
1396
|
+
path: "/system/backfill-queue-tokens",
|
|
1397
|
+
method: "POST"
|
|
1398
|
+
},
|
|
1399
|
+
{
|
|
1400
|
+
group: "system",
|
|
1401
|
+
action: "sandbox-drain",
|
|
1402
|
+
description: "Drain and verify managed Sandbox container applications",
|
|
1403
|
+
path: "/system/sandbox-drain",
|
|
1404
|
+
values: { cursor: "Opaque cursor returned by --plan" },
|
|
1405
|
+
method: "POST"
|
|
1406
|
+
},
|
|
1407
|
+
{
|
|
1408
|
+
group: "worker",
|
|
1409
|
+
action: "list",
|
|
1410
|
+
description: "List hosted platform workers",
|
|
1411
|
+
path: "/workers",
|
|
1412
|
+
values: { environment: "production or staging" }
|
|
1413
|
+
},
|
|
1414
|
+
{
|
|
1415
|
+
group: "worker",
|
|
1416
|
+
action: "show",
|
|
1417
|
+
description: "Inspect hosted worker versions",
|
|
1418
|
+
path: "/workers/:id",
|
|
1419
|
+
positional: ["id"],
|
|
1420
|
+
values: { environment: "production or staging" }
|
|
1421
|
+
},
|
|
1422
|
+
{
|
|
1423
|
+
group: "worker",
|
|
1424
|
+
action: "rollback",
|
|
1425
|
+
description: "Roll back a hosted worker to a version",
|
|
1426
|
+
path: "/workers/:id/rollback",
|
|
1427
|
+
positional: ["id", "versionId"],
|
|
1428
|
+
values: { environment: "production or staging" },
|
|
1429
|
+
method: "POST"
|
|
1430
|
+
},
|
|
1431
|
+
{
|
|
1432
|
+
group: "worker",
|
|
1433
|
+
action: "rollback-all",
|
|
1434
|
+
description: "Roll back all hosted workers to their previous versions",
|
|
1435
|
+
path: "/workers/rollback-all",
|
|
1436
|
+
values: { environment: "production or staging" },
|
|
1437
|
+
method: "POST"
|
|
1438
|
+
},
|
|
1439
|
+
{
|
|
1440
|
+
group: "worker",
|
|
1441
|
+
action: "events",
|
|
1442
|
+
description: "List hosted worker events or inspect a batch",
|
|
1443
|
+
path: "/workers/events",
|
|
1444
|
+
positional: ["batchId"],
|
|
1445
|
+
optionalPositional: true,
|
|
1446
|
+
values: { environment: "production or staging" }
|
|
1447
|
+
}
|
|
1448
|
+
];
|
|
1449
|
+
const operatorGroups = [...new Set(operatorCommands.map(({ group }) => group))];
|
|
1450
|
+
function parseOperatorArgs(args) {
|
|
1451
|
+
const positional = [];
|
|
1452
|
+
const values = {};
|
|
1453
|
+
const flags = /* @__PURE__ */ new Set();
|
|
1454
|
+
const booleanFlags = /* @__PURE__ */ new Set([
|
|
1455
|
+
"json",
|
|
1456
|
+
"plan",
|
|
1457
|
+
"yes",
|
|
1458
|
+
"follow",
|
|
1459
|
+
"token-stdin"
|
|
1460
|
+
]);
|
|
1461
|
+
for (let index = 0; index < args.length; index++) {
|
|
1462
|
+
const arg = args[index];
|
|
1463
|
+
if (!arg.startsWith("-")) {
|
|
1464
|
+
positional.push(arg);
|
|
1465
|
+
continue;
|
|
1466
|
+
}
|
|
1467
|
+
if (!arg.startsWith("--")) throw new Error(`platform: Unknown flag '${arg}'.`);
|
|
1468
|
+
const flag = arg.slice(2);
|
|
1469
|
+
if (flags.has(flag) || Object.hasOwn(values, flag)) throw new Error(`platform: Duplicate flag '${arg}'.`);
|
|
1470
|
+
if (booleanFlags.has(flag)) flags.add(flag);
|
|
1471
|
+
else {
|
|
1472
|
+
const value = args[++index];
|
|
1473
|
+
if (!value || value.startsWith("-")) throw new Error(`platform: ${arg} requires a value.`);
|
|
1474
|
+
values[flag] = value;
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
const [group = "", action = "", ...parameters] = positional;
|
|
1478
|
+
if (!operatorGroups.includes(group)) throw new Error("platform: Unknown operator command group.");
|
|
1479
|
+
const parsed = {
|
|
1480
|
+
subcommand: "operator",
|
|
1481
|
+
group,
|
|
1482
|
+
action,
|
|
1483
|
+
connection: values.connection ?? "",
|
|
1484
|
+
json: flags.has("json"),
|
|
1485
|
+
plan: flags.has("plan"),
|
|
1486
|
+
yes: flags.has("yes"),
|
|
1487
|
+
follow: flags.has("follow"),
|
|
1488
|
+
tokenStdin: flags.has("token-stdin"),
|
|
1489
|
+
provider: values.provider ?? "github",
|
|
1490
|
+
method: "GET",
|
|
1491
|
+
path: "",
|
|
1492
|
+
query: {},
|
|
1493
|
+
body: {}
|
|
1494
|
+
};
|
|
1495
|
+
if (!action && args.length === 1) return parsed;
|
|
1496
|
+
const command = operatorCommands.find((entry) => entry.group === group && entry.action === action);
|
|
1497
|
+
if (!command) throw new Error(`platform: Usage: void platform ${group} <${operatorCommands.filter((entry) => entry.group === group).map(({ action }) => action).join("|")}>.`);
|
|
1498
|
+
const count = command.positional?.length ?? 0;
|
|
1499
|
+
if (parameters.length > count || !command.optionalPositional && parameters.length !== count) throw new Error(`platform: Usage: void platform ${group} ${action}${command.positional?.map((name) => ` <${name}>`).join("") ?? ""}.`);
|
|
1500
|
+
const paged = action === "list" || action === "events" || action === "logs";
|
|
1501
|
+
const allowed = /* @__PURE__ */ new Set([
|
|
1502
|
+
"connection",
|
|
1503
|
+
...command.method ? ["timeout"] : [],
|
|
1504
|
+
...Object.keys(command.values ?? {}),
|
|
1505
|
+
...paged ? ["limit", ...action !== "logs" ? ["page"] : []] : []
|
|
1506
|
+
]);
|
|
1507
|
+
for (const name of Object.keys(values)) if (!allowed.has(name)) throw new Error(`platform: Unknown flag '--${name}' for ${group} ${action}.`);
|
|
1508
|
+
for (const name of flags) if (![
|
|
1509
|
+
"json",
|
|
1510
|
+
...command.method ? ["yes", "plan"] : [],
|
|
1511
|
+
...command.booleans ?? []
|
|
1512
|
+
].includes(name)) throw new Error(`platform: Unknown flag '--${name}' for ${group} ${action}.`);
|
|
1513
|
+
if (parsed.plan && parsed.yes) throw new Error("platform: --plan and --yes cannot be combined.");
|
|
1514
|
+
parsed.path = command.path;
|
|
1515
|
+
parsed.method = command.method ?? "GET";
|
|
1516
|
+
for (const [index, name] of (command.positional ?? []).entries()) {
|
|
1517
|
+
const value = parameters[index];
|
|
1518
|
+
if (value === void 0) continue;
|
|
1519
|
+
if (value === "." || value === "..") throw new Error("platform: An object ID cannot be a dot path segment.");
|
|
1520
|
+
if (parsed.path.includes(`:${name}`)) parsed.path = parsed.path.replace(`:${name}`, encodeURIComponent(value));
|
|
1521
|
+
else if (group === "worker" && action === "events") parsed.path += `/${encodeURIComponent(value)}`;
|
|
1522
|
+
else parsed.body[name] = name === "emails" ? value.split(",").map((email) => email.trim()) : value;
|
|
1523
|
+
}
|
|
1524
|
+
for (const [name, value] of Object.entries(values)) {
|
|
1525
|
+
if (name === "connection" || name === "provider") continue;
|
|
1526
|
+
if (name === "timeout") {
|
|
1527
|
+
const maximum = OPERATOR_MAX_TIMEOUT_MS / 1e3;
|
|
1528
|
+
if (!/^[1-9]\d*$/.test(value) || Number(value) > maximum) throw new Error(`platform: --timeout must be an integer from 1 to ${maximum} seconds.`);
|
|
1529
|
+
parsed.timeoutMs = Number(value) * 1e3;
|
|
1530
|
+
continue;
|
|
1531
|
+
}
|
|
1532
|
+
if (name === "page" || name === "limit") {
|
|
1533
|
+
const maximum = name === "limit" ? action === "logs" ? 500 : 100 : 1e6;
|
|
1534
|
+
if (!/^[1-9]\d*$/.test(value) || Number(value) > maximum) throw new Error(`platform: --${name} must be an integer from 1 to ${maximum}.`);
|
|
1535
|
+
}
|
|
1536
|
+
if (name === "since" && group === "build" && (!/^\d+$/.test(value) || !Number.isSafeInteger(Number(value)))) throw new Error("platform: --since must be a nonnegative safe integer for build logs.");
|
|
1537
|
+
if (name === "environment" && !["production", "staging"].includes(value)) throw new Error("platform: --environment must be production or staging.");
|
|
1538
|
+
if (parsed.method === "POST") parsed.body[name] = value;
|
|
1539
|
+
else parsed.query[name] = value;
|
|
1540
|
+
}
|
|
1541
|
+
if (parsed.body.type && !["github", "email"].includes(String(parsed.body.type))) throw new Error("platform: Signup pattern type must be github or email.");
|
|
1542
|
+
return parsed;
|
|
1543
|
+
}
|
|
857
1544
|
//#endregion
|
|
858
1545
|
//#region src/cli/help.ts
|
|
1546
|
+
var help_exports = /* @__PURE__ */ __exportAll({
|
|
1547
|
+
getHelpPath: () => getHelpPath,
|
|
1548
|
+
printGlobalHelp: () => printGlobalHelp,
|
|
1549
|
+
printHelpPage: () => printHelpPage,
|
|
1550
|
+
printVoidHeader: () => printVoidHeader
|
|
1551
|
+
});
|
|
1552
|
+
function operatorHelpTree() {
|
|
1553
|
+
return Object.fromEntries(operatorGroups.map((group) => {
|
|
1554
|
+
const commands = operatorCommands.filter((entry) => entry.group === group);
|
|
1555
|
+
return [group, {
|
|
1556
|
+
summary: `Administer platform ${group}. Operator credentials are separate from deployment credentials.`,
|
|
1557
|
+
usage: [`void platform ${group} <command> [options]`],
|
|
1558
|
+
commands: commands.map((entry) => ({
|
|
1559
|
+
command: entry.action,
|
|
1560
|
+
description: entry.description
|
|
1561
|
+
})),
|
|
1562
|
+
children: Object.fromEntries(commands.map((entry) => [entry.action, {
|
|
1563
|
+
summary: `${entry.description}.`,
|
|
1564
|
+
usage: [`void platform ${group} ${entry.action}${entry.positional?.map((name) => entry.optionalPositional ? ` [${name}]` : ` <${name}>`).join("") ?? ""} [options]`],
|
|
1565
|
+
options: [
|
|
1566
|
+
{
|
|
1567
|
+
command: "--connection <id-or-url>",
|
|
1568
|
+
description: "Choose a registered connection; otherwise use VOID_API_URL or the active connection"
|
|
1569
|
+
},
|
|
1570
|
+
{
|
|
1571
|
+
command: "--json",
|
|
1572
|
+
description: "Write structured JSON to stdout (JSON Lines while following logs)"
|
|
1573
|
+
},
|
|
1574
|
+
...entry.method ? [
|
|
1575
|
+
{
|
|
1576
|
+
command: "--plan",
|
|
1577
|
+
description: "Validate and preview without changing anything"
|
|
1578
|
+
},
|
|
1579
|
+
{
|
|
1580
|
+
command: "--yes",
|
|
1581
|
+
description: "Apply after preview without prompting; required in unattended scripts"
|
|
1582
|
+
},
|
|
1583
|
+
{
|
|
1584
|
+
command: "--timeout <seconds>",
|
|
1585
|
+
description: "Mutation deadline (default 300 seconds; maximum 3600 seconds)"
|
|
1586
|
+
}
|
|
1587
|
+
] : [],
|
|
1588
|
+
...[
|
|
1589
|
+
"list",
|
|
1590
|
+
"events",
|
|
1591
|
+
"logs"
|
|
1592
|
+
].includes(entry.action) ? [{
|
|
1593
|
+
command: "--limit <number>",
|
|
1594
|
+
description: entry.action === "logs" ? "Maximum 500 log records" : "Maximum 100 records per page"
|
|
1595
|
+
}, ...entry.action !== "logs" ? [{
|
|
1596
|
+
command: "--page <number>",
|
|
1597
|
+
description: "One-based page number"
|
|
1598
|
+
}] : []] : [],
|
|
1599
|
+
...Object.entries(entry.values ?? {}).map(([flag, description]) => ({
|
|
1600
|
+
command: `--${flag} <value>`,
|
|
1601
|
+
description
|
|
1602
|
+
})),
|
|
1603
|
+
...(entry.booleans ?? []).map((flag) => ({
|
|
1604
|
+
command: `--${flag}`,
|
|
1605
|
+
description: flag === "follow" ? "Poll new logs until interrupted or the build ends" : "Read a full API session from stdin for explicit operator session exchange"
|
|
1606
|
+
}))
|
|
1607
|
+
]
|
|
1608
|
+
}]))
|
|
1609
|
+
}];
|
|
1610
|
+
}));
|
|
1611
|
+
}
|
|
859
1612
|
const HELP_TREE = {
|
|
1613
|
+
connect: {
|
|
1614
|
+
summary: "Connect this project to Cloudflare or an existing Void platform.",
|
|
1615
|
+
usage: ["void connect [url] [--platform <cloudflare|void>] [--no-login]"],
|
|
1616
|
+
options: [{
|
|
1617
|
+
command: "--platform <cloudflare|void>",
|
|
1618
|
+
description: "Choose the deployment destination"
|
|
1619
|
+
}, {
|
|
1620
|
+
command: "--no-login",
|
|
1621
|
+
description: "Save a Void connection without authenticating"
|
|
1622
|
+
}],
|
|
1623
|
+
examples: [
|
|
1624
|
+
{
|
|
1625
|
+
command: "void connect",
|
|
1626
|
+
description: "Choose a destination and sign in"
|
|
1627
|
+
},
|
|
1628
|
+
{
|
|
1629
|
+
command: "void connect https://platform.example.com",
|
|
1630
|
+
description: "Join a Void platform"
|
|
1631
|
+
},
|
|
1632
|
+
{
|
|
1633
|
+
command: "void connect --platform cloudflare",
|
|
1634
|
+
description: "Sign in and select a Cloudflare account"
|
|
1635
|
+
}
|
|
1636
|
+
]
|
|
1637
|
+
},
|
|
860
1638
|
init: {
|
|
861
1639
|
summary: "Set up Void in a new or existing project.",
|
|
862
1640
|
usage: ["void init [options]"],
|
|
863
1641
|
options: [
|
|
864
1642
|
{
|
|
865
1643
|
command: "--agents",
|
|
866
|
-
description: "Set up agent instructions
|
|
1644
|
+
description: "Set up agent instructions and skills"
|
|
867
1645
|
},
|
|
868
1646
|
{
|
|
869
1647
|
command: "--tsconfig",
|
|
870
1648
|
description: "Only update tsconfig.json"
|
|
871
1649
|
},
|
|
1650
|
+
{
|
|
1651
|
+
command: "--git",
|
|
1652
|
+
description: "Initialize a Git repository without prompting"
|
|
1653
|
+
},
|
|
1654
|
+
{
|
|
1655
|
+
command: "--no-git",
|
|
1656
|
+
description: "Skip Git repository initialization"
|
|
1657
|
+
},
|
|
872
1658
|
{
|
|
873
1659
|
command: "--github",
|
|
874
1660
|
description: "Only create the GitHub Actions deploy workflow (OIDC, no stored token)"
|
|
@@ -881,7 +1667,7 @@ const HELP_TREE = {
|
|
|
881
1667
|
},
|
|
882
1668
|
{
|
|
883
1669
|
command: "void init --agents",
|
|
884
|
-
description: "Install agent instructions and
|
|
1670
|
+
description: "Install agent instructions and skills"
|
|
885
1671
|
},
|
|
886
1672
|
{
|
|
887
1673
|
command: "void init --github",
|
|
@@ -890,7 +1676,7 @@ const HELP_TREE = {
|
|
|
890
1676
|
]
|
|
891
1677
|
},
|
|
892
1678
|
deploy: {
|
|
893
|
-
summary: "Build and deploy
|
|
1679
|
+
summary: "Build and deploy. Offers to link an existing Cloudflare Worker when no destination is configured.",
|
|
894
1680
|
usage: ["void deploy [options]"],
|
|
895
1681
|
options: [
|
|
896
1682
|
{
|
|
@@ -907,15 +1693,15 @@ const HELP_TREE = {
|
|
|
907
1693
|
},
|
|
908
1694
|
{
|
|
909
1695
|
command: "--skip-build",
|
|
910
|
-
description: "Skip the build step and use existing output (
|
|
1696
|
+
description: "Skip the build step and use existing output (static deploys on Cloudflare)"
|
|
911
1697
|
},
|
|
912
1698
|
{
|
|
913
|
-
command: "--
|
|
914
|
-
description: "
|
|
1699
|
+
command: "--platform <cloudflare|void>",
|
|
1700
|
+
description: "Override the platform saved by void init"
|
|
915
1701
|
},
|
|
916
1702
|
{
|
|
917
|
-
command: "--
|
|
918
|
-
description: "
|
|
1703
|
+
command: "--require-email",
|
|
1704
|
+
description: "Fail instead of deploying without email when the mail domain is not set up (with --platform cloudflare)"
|
|
919
1705
|
},
|
|
920
1706
|
{
|
|
921
1707
|
command: "--debug",
|
|
@@ -936,12 +1722,8 @@ const HELP_TREE = {
|
|
|
936
1722
|
description: "Deploy a static SPA directory"
|
|
937
1723
|
},
|
|
938
1724
|
{
|
|
939
|
-
command: "void deploy --
|
|
1725
|
+
command: "void deploy --platform cloudflare",
|
|
940
1726
|
description: "Deploy to your own Cloudflare account"
|
|
941
|
-
},
|
|
942
|
-
{
|
|
943
|
-
command: "void deploy --backend cloudflare --provision",
|
|
944
|
-
description: "Provision missing resources, then deploy to Cloudflare"
|
|
945
1727
|
}
|
|
946
1728
|
]
|
|
947
1729
|
},
|
|
@@ -973,6 +1755,236 @@ const HELP_TREE = {
|
|
|
973
1755
|
token: basicSubcommand("Copy auth token to clipboard.", "void auth token")
|
|
974
1756
|
}
|
|
975
1757
|
},
|
|
1758
|
+
cloudflare: {
|
|
1759
|
+
summary: "Manage Cloudflare authentication used by Void.",
|
|
1760
|
+
usage: ["void cloudflare <command>"],
|
|
1761
|
+
commands: [
|
|
1762
|
+
{
|
|
1763
|
+
command: "login",
|
|
1764
|
+
description: "Sign in or switch users with browser OAuth"
|
|
1765
|
+
},
|
|
1766
|
+
{
|
|
1767
|
+
command: "status",
|
|
1768
|
+
description: "Show identity, authentication, and the deployment account"
|
|
1769
|
+
},
|
|
1770
|
+
{
|
|
1771
|
+
command: "logout",
|
|
1772
|
+
description: "Remove the local browser session"
|
|
1773
|
+
}
|
|
1774
|
+
],
|
|
1775
|
+
children: {
|
|
1776
|
+
login: basicSubcommand("Sign in again or switch Cloudflare users with browser OAuth.", "void cloudflare login"),
|
|
1777
|
+
status: basicSubcommand("Show Cloudflare identity, authentication, accessible accounts, and the pinned deployment account.", "void cloudflare status"),
|
|
1778
|
+
logout: basicSubcommand("Remove the local browser session.", "void cloudflare logout")
|
|
1779
|
+
}
|
|
1780
|
+
},
|
|
1781
|
+
platform: {
|
|
1782
|
+
summary: "Install Void platforms and administer users, projects, access, and operations. Use `void connect` to join one.",
|
|
1783
|
+
usage: ["void platform <command>"],
|
|
1784
|
+
commands: [
|
|
1785
|
+
...operatorGroups.map((group) => ({
|
|
1786
|
+
command: `${group} <command>`,
|
|
1787
|
+
description: `Administer platform ${group}`
|
|
1788
|
+
})),
|
|
1789
|
+
{
|
|
1790
|
+
command: "list",
|
|
1791
|
+
description: "List installed and connected platforms"
|
|
1792
|
+
},
|
|
1793
|
+
{
|
|
1794
|
+
command: "use [id]",
|
|
1795
|
+
description: "Select the default Void platform"
|
|
1796
|
+
},
|
|
1797
|
+
{
|
|
1798
|
+
command: "status [id]",
|
|
1799
|
+
description: "Inspect a platform and its health"
|
|
1800
|
+
},
|
|
1801
|
+
{
|
|
1802
|
+
command: "discover",
|
|
1803
|
+
description: "Recover installations from a Cloudflare account"
|
|
1804
|
+
},
|
|
1805
|
+
{
|
|
1806
|
+
command: "domain set <domain>",
|
|
1807
|
+
description: "Add an application domain to a test platform"
|
|
1808
|
+
},
|
|
1809
|
+
{
|
|
1810
|
+
command: "install",
|
|
1811
|
+
description: "Install a Void platform in Cloudflare"
|
|
1812
|
+
},
|
|
1813
|
+
{
|
|
1814
|
+
command: "upgrade [id]",
|
|
1815
|
+
description: "Upgrade an installed Void platform"
|
|
1816
|
+
},
|
|
1817
|
+
{
|
|
1818
|
+
command: "rollback [id]",
|
|
1819
|
+
description: "Restore a compatible earlier platform runtime"
|
|
1820
|
+
},
|
|
1821
|
+
{
|
|
1822
|
+
command: "repair [id]",
|
|
1823
|
+
description: "Reconcile an installed Void platform"
|
|
1824
|
+
},
|
|
1825
|
+
{
|
|
1826
|
+
command: "disable [id]",
|
|
1827
|
+
description: "Disable traffic without deleting data"
|
|
1828
|
+
},
|
|
1829
|
+
{
|
|
1830
|
+
command: "enable [id]",
|
|
1831
|
+
description: "Restore traffic for a disabled platform"
|
|
1832
|
+
},
|
|
1833
|
+
{
|
|
1834
|
+
command: "uninstall [id]",
|
|
1835
|
+
description: "Safely remove an installed Void platform"
|
|
1836
|
+
}
|
|
1837
|
+
],
|
|
1838
|
+
children: {
|
|
1839
|
+
...operatorHelpTree(),
|
|
1840
|
+
domain: {
|
|
1841
|
+
summary: "Add an application domain while keeping existing workers.dev URLs.",
|
|
1842
|
+
usage: ["void platform domain set <domain> [options]"],
|
|
1843
|
+
children: { set: {
|
|
1844
|
+
summary: "Set up DNS and verify HTTPS before making an application domain canonical. Rerun to resume.",
|
|
1845
|
+
usage: ["void platform domain set <domain> [options]"],
|
|
1846
|
+
options: [
|
|
1847
|
+
{
|
|
1848
|
+
command: "--installation <id>",
|
|
1849
|
+
description: "Choose an installed platform; otherwise select interactively"
|
|
1850
|
+
},
|
|
1851
|
+
{
|
|
1852
|
+
command: "--zone <domain>",
|
|
1853
|
+
description: "Containing Cloudflare zone; detected when it already exists"
|
|
1854
|
+
},
|
|
1855
|
+
{
|
|
1856
|
+
command: "--dedicated-zone",
|
|
1857
|
+
description: "Add catch-all routes for a zone dedicated to this platform"
|
|
1858
|
+
},
|
|
1859
|
+
{
|
|
1860
|
+
command: "--plan",
|
|
1861
|
+
description: "Preview without making changes"
|
|
1862
|
+
},
|
|
1863
|
+
{
|
|
1864
|
+
command: "--yes",
|
|
1865
|
+
description: "Apply without an interactive confirmation"
|
|
1866
|
+
}
|
|
1867
|
+
]
|
|
1868
|
+
} }
|
|
1869
|
+
},
|
|
1870
|
+
list: basicSubcommand("List installed and connected platforms.", "void platform list"),
|
|
1871
|
+
use: basicSubcommand("Select the default Void platform.", "void platform use [id]"),
|
|
1872
|
+
status: basicSubcommand("Inspect a platform and its health.", "void platform status [id]"),
|
|
1873
|
+
discover: {
|
|
1874
|
+
summary: "Recover owned platform installations from Cloudflare.",
|
|
1875
|
+
usage: ["void platform discover [--account <id>] [--installation <id-or-name>]"],
|
|
1876
|
+
options: [{
|
|
1877
|
+
command: "--account <id>",
|
|
1878
|
+
description: "Cloudflare account id"
|
|
1879
|
+
}, {
|
|
1880
|
+
command: "--installation <id-or-name>",
|
|
1881
|
+
description: "Recover only one installation from a shared account"
|
|
1882
|
+
}]
|
|
1883
|
+
},
|
|
1884
|
+
install: {
|
|
1885
|
+
summary: "Install or resume a Void platform with a domain, or workers.dev for testing.",
|
|
1886
|
+
usage: ["void platform install [options]"],
|
|
1887
|
+
options: [
|
|
1888
|
+
{
|
|
1889
|
+
command: "--name <slug>",
|
|
1890
|
+
description: "Installation name"
|
|
1891
|
+
},
|
|
1892
|
+
{
|
|
1893
|
+
command: "--workers-dev",
|
|
1894
|
+
description: "Use workers.dev for testing; add a domain later"
|
|
1895
|
+
},
|
|
1896
|
+
{
|
|
1897
|
+
command: "--display-name <name>",
|
|
1898
|
+
description: "Human-readable platform name"
|
|
1899
|
+
},
|
|
1900
|
+
{
|
|
1901
|
+
command: "--account <id>",
|
|
1902
|
+
description: "Cloudflare account id"
|
|
1903
|
+
},
|
|
1904
|
+
{
|
|
1905
|
+
command: "--application-domain <domain>",
|
|
1906
|
+
description: "Base domain for applications (zone apex is simplest)"
|
|
1907
|
+
},
|
|
1908
|
+
{
|
|
1909
|
+
command: "--zone <domain>",
|
|
1910
|
+
description: "Cloudflare zone containing the app domain"
|
|
1911
|
+
},
|
|
1912
|
+
{
|
|
1913
|
+
command: "--dedicated-zone",
|
|
1914
|
+
description: "Allow zone-wide application catch-all routes"
|
|
1915
|
+
},
|
|
1916
|
+
{
|
|
1917
|
+
command: "--control-plane-domain <domain>",
|
|
1918
|
+
description: "Optional API hostname"
|
|
1919
|
+
},
|
|
1920
|
+
{
|
|
1921
|
+
command: "--plan",
|
|
1922
|
+
description: "Print the exact plan without changing Cloudflare"
|
|
1923
|
+
},
|
|
1924
|
+
{
|
|
1925
|
+
command: "--resume",
|
|
1926
|
+
description: "Resume the matching local installation"
|
|
1927
|
+
},
|
|
1928
|
+
{
|
|
1929
|
+
command: "--runtime <path>",
|
|
1930
|
+
description: "Deploy an integrity-checked runtime directory instead of the package"
|
|
1931
|
+
},
|
|
1932
|
+
{
|
|
1933
|
+
command: "--yes",
|
|
1934
|
+
description: "Acknowledge changes without an interactive prompt"
|
|
1935
|
+
}
|
|
1936
|
+
]
|
|
1937
|
+
},
|
|
1938
|
+
upgrade: lifecycleHelp("upgrade", "Upgrade an installed platform without deleting resources."),
|
|
1939
|
+
rollback: {
|
|
1940
|
+
summary: "Restore a compatible earlier runtime without reversing database migrations.",
|
|
1941
|
+
usage: ["void platform rollback [id] --runtime <earlier-path> [--from-runtime <current-path>] [--plan] [--yes]"],
|
|
1942
|
+
options: [
|
|
1943
|
+
{
|
|
1944
|
+
command: "--runtime <path>",
|
|
1945
|
+
description: "Earlier compatible runtime to restore"
|
|
1946
|
+
},
|
|
1947
|
+
{
|
|
1948
|
+
command: "--from-runtime <path>",
|
|
1949
|
+
description: "Current installed runtime when it differs from the packaged runtime"
|
|
1950
|
+
},
|
|
1951
|
+
{
|
|
1952
|
+
command: "--plan",
|
|
1953
|
+
description: "Print the exact plan without making changes"
|
|
1954
|
+
},
|
|
1955
|
+
{
|
|
1956
|
+
command: "--yes",
|
|
1957
|
+
description: "Acknowledge non-interactive Cloudflare changes"
|
|
1958
|
+
}
|
|
1959
|
+
]
|
|
1960
|
+
},
|
|
1961
|
+
repair: lifecycleHelp("repair", "Reconcile drift using the installation ownership manifest."),
|
|
1962
|
+
disable: lifecycleHelp("disable", "Disable platform traffic without deleting data."),
|
|
1963
|
+
enable: lifecycleHelp("enable", "Restore configured traffic for a disabled platform."),
|
|
1964
|
+
uninstall: {
|
|
1965
|
+
summary: "Safely remove installer-owned platform resources.",
|
|
1966
|
+
usage: ["void platform uninstall [id] [options]"],
|
|
1967
|
+
options: [
|
|
1968
|
+
{
|
|
1969
|
+
command: "--plan",
|
|
1970
|
+
description: "Print the exact deletion and retention plan"
|
|
1971
|
+
},
|
|
1972
|
+
{
|
|
1973
|
+
command: "--yes",
|
|
1974
|
+
description: "Acknowledge changes without an interactive prompt"
|
|
1975
|
+
},
|
|
1976
|
+
{
|
|
1977
|
+
command: "--purge-data",
|
|
1978
|
+
description: "Delete installer-owned data even when it contains apps"
|
|
1979
|
+
},
|
|
1980
|
+
{
|
|
1981
|
+
command: "--keep-zone",
|
|
1982
|
+
description: "Explicitly retain an installer-created zone"
|
|
1983
|
+
}
|
|
1984
|
+
]
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
},
|
|
976
1988
|
project: {
|
|
977
1989
|
summary: "Manage Void projects and deployments.",
|
|
978
1990
|
usage: ["void project <command>"],
|
|
@@ -1162,6 +2174,73 @@ const HELP_TREE = {
|
|
|
1162
2174
|
}
|
|
1163
2175
|
}
|
|
1164
2176
|
},
|
|
2177
|
+
email: {
|
|
2178
|
+
summary: "Inspect email activity and manage verified recipients.",
|
|
2179
|
+
usage: ["void email <command>"],
|
|
2180
|
+
commands: [
|
|
2181
|
+
{
|
|
2182
|
+
command: "usage",
|
|
2183
|
+
description: "Show monthly outbound/inbound counts and quota"
|
|
2184
|
+
},
|
|
2185
|
+
{
|
|
2186
|
+
command: "logs",
|
|
2187
|
+
description: "Show recent email delivery activity"
|
|
2188
|
+
},
|
|
2189
|
+
{
|
|
2190
|
+
command: "destinations",
|
|
2191
|
+
description: "List verified recipient addresses"
|
|
2192
|
+
},
|
|
2193
|
+
{
|
|
2194
|
+
command: "allow <address>",
|
|
2195
|
+
description: "Add a recipient and trigger CF verification"
|
|
2196
|
+
},
|
|
2197
|
+
{
|
|
2198
|
+
command: "disallow <address>",
|
|
2199
|
+
description: "Remove a recipient from the allowlist"
|
|
2200
|
+
},
|
|
2201
|
+
{
|
|
2202
|
+
command: "status --platform cloudflare",
|
|
2203
|
+
description: "Show the email setup state and address map on your own account"
|
|
2204
|
+
},
|
|
2205
|
+
{
|
|
2206
|
+
command: "setup --platform cloudflare",
|
|
2207
|
+
description: "Set email up on your own Cloudflare account (one confirmation)"
|
|
2208
|
+
}
|
|
2209
|
+
],
|
|
2210
|
+
children: {
|
|
2211
|
+
usage: withProjectOption("Show monthly outbound/inbound counts and quota.", "void email usage [options]"),
|
|
2212
|
+
logs: {
|
|
2213
|
+
summary: "Show recent email delivery activity.",
|
|
2214
|
+
usage: ["void email logs [options]"],
|
|
2215
|
+
options: [{
|
|
2216
|
+
command: "--project <name>",
|
|
2217
|
+
description: "Project name override"
|
|
2218
|
+
}, {
|
|
2219
|
+
command: "--limit <n>",
|
|
2220
|
+
description: "How many entries to show (positive integer)"
|
|
2221
|
+
}]
|
|
2222
|
+
},
|
|
2223
|
+
destinations: withProjectOption("List verified recipient addresses.", "void email destinations [options]"),
|
|
2224
|
+
allow: withProjectOption("Add a recipient and trigger a Cloudflare verification email.", "void email allow <address> [options]"),
|
|
2225
|
+
disallow: withProjectOption("Remove a recipient from the verified allowlist.", "void email disallow <address> [options]"),
|
|
2226
|
+
status: {
|
|
2227
|
+
summary: "Show the email setup state and address map. Exit 1 when not ready.",
|
|
2228
|
+
usage: ["void email status --platform cloudflare"],
|
|
2229
|
+
options: [{
|
|
2230
|
+
command: "--platform cloudflare",
|
|
2231
|
+
description: "Your own Cloudflare account (the only platform with a status today)"
|
|
2232
|
+
}]
|
|
2233
|
+
},
|
|
2234
|
+
setup: {
|
|
2235
|
+
summary: "Set email up on your own Cloudflare account: enable Email Routing, onboard Email Sending, write send_email + addresses into wrangler.jsonc. Asks once before changing the account.",
|
|
2236
|
+
usage: ["void email setup --platform cloudflare"],
|
|
2237
|
+
options: [{
|
|
2238
|
+
command: "--platform cloudflare",
|
|
2239
|
+
description: "Your own Cloudflare account (required; the Void platform needs no setup)"
|
|
2240
|
+
}]
|
|
2241
|
+
}
|
|
2242
|
+
}
|
|
2243
|
+
},
|
|
1165
2244
|
github: {
|
|
1166
2245
|
summary: "Connect a GitHub repository for automatic deploys.",
|
|
1167
2246
|
usage: ["void github <command>"],
|
|
@@ -1392,9 +2471,13 @@ const HELP_TREE = {
|
|
|
1392
2471
|
command: "export",
|
|
1393
2472
|
description: "Export local database as SQL"
|
|
1394
2473
|
},
|
|
2474
|
+
{
|
|
2475
|
+
command: "connect",
|
|
2476
|
+
description: "Connect or provision an external database"
|
|
2477
|
+
},
|
|
1395
2478
|
{
|
|
1396
2479
|
command: "set-url",
|
|
1397
|
-
description: "Update the
|
|
2480
|
+
description: "Update the external database URL"
|
|
1398
2481
|
},
|
|
1399
2482
|
{
|
|
1400
2483
|
command: "rename-migrations",
|
|
@@ -1484,45 +2567,59 @@ const HELP_TREE = {
|
|
|
1484
2567
|
}
|
|
1485
2568
|
]
|
|
1486
2569
|
},
|
|
1487
|
-
|
|
2570
|
+
connect: {
|
|
2571
|
+
summary: "Connect or provision an external PostgreSQL/MySQL database.",
|
|
2572
|
+
usage: ["void db connect [connection-string]", "void db connect --provider <name-or-module> [options]"],
|
|
2573
|
+
options: [
|
|
2574
|
+
{
|
|
2575
|
+
command: "--provider <name-or-module>",
|
|
2576
|
+
description: "Provision with an adapter"
|
|
2577
|
+
},
|
|
2578
|
+
{
|
|
2579
|
+
command: "--name <name>",
|
|
2580
|
+
description: "Provider project/database name"
|
|
2581
|
+
},
|
|
2582
|
+
{
|
|
2583
|
+
command: "--region <region>",
|
|
2584
|
+
description: "Provider region identifier"
|
|
2585
|
+
},
|
|
2586
|
+
{
|
|
2587
|
+
command: "--local-only",
|
|
2588
|
+
description: "Do not sync a linked Void project"
|
|
2589
|
+
}
|
|
2590
|
+
],
|
|
2591
|
+
examples: [{
|
|
2592
|
+
command: "void db connect \"postgresql://user:pass@host/db\"",
|
|
2593
|
+
description: "Connect an existing database"
|
|
2594
|
+
}, {
|
|
2595
|
+
command: "void db connect --provider neon --name my-app",
|
|
2596
|
+
description: "Provision a Neon database using NEON_API_KEY"
|
|
2597
|
+
}]
|
|
2598
|
+
},
|
|
2599
|
+
"set-url": basicSubcommand("Update the external database connection string for deployment.", "void db set-url"),
|
|
1488
2600
|
"rename-migrations": basicSubcommand("Rename migrations to timestamp-based format.", "void db rename-migrations")
|
|
1489
2601
|
}
|
|
1490
2602
|
},
|
|
1491
2603
|
env: {
|
|
1492
|
-
summary: "Validate env.ts and generate environment
|
|
2604
|
+
summary: "Validate env.ts and generate environment types.",
|
|
1493
2605
|
usage: ["void env <command>"],
|
|
1494
|
-
commands: [
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
description: "Regenerate .void/env.d.ts from env.ts"
|
|
1502
|
-
},
|
|
1503
|
-
{
|
|
1504
|
-
command: "example",
|
|
1505
|
-
description: "Generate .env.example from env.ts schema"
|
|
1506
|
-
}
|
|
1507
|
-
],
|
|
2606
|
+
commands: [{
|
|
2607
|
+
command: "check",
|
|
2608
|
+
description: "Validate local .env or remote secret names"
|
|
2609
|
+
}, {
|
|
2610
|
+
command: "types",
|
|
2611
|
+
description: "Regenerate .void/env.d.ts from env.ts"
|
|
2612
|
+
}],
|
|
1508
2613
|
children: {
|
|
1509
2614
|
check: {
|
|
1510
|
-
summary: "Validate
|
|
2615
|
+
summary: "Validate local .env or required remote secret names.",
|
|
1511
2616
|
usage: ["void env check [options]"],
|
|
1512
2617
|
options: [{
|
|
1513
2618
|
command: "--remote",
|
|
1514
|
-
description: "
|
|
2619
|
+
description: "Check required server keys as remote secrets"
|
|
1515
2620
|
}]
|
|
1516
2621
|
},
|
|
1517
|
-
types: basicSubcommand("Regenerate .void/env.d.ts from env.ts.", "void env types")
|
|
1518
|
-
example: {
|
|
1519
|
-
summary: "Refresh the Void-managed block in .env.example.",
|
|
1520
|
-
usage: ["void env example [options]"],
|
|
1521
|
-
options: [{
|
|
1522
|
-
command: "--force",
|
|
1523
|
-
description: "Suppress the appended block notice"
|
|
1524
|
-
}]
|
|
1525
|
-
}
|
|
2622
|
+
types: basicSubcommand("Regenerate .void/env.d.ts from env.ts.", "void env types")
|
|
1526
2623
|
}
|
|
1527
2624
|
},
|
|
1528
2625
|
gen: {
|
|
@@ -1614,10 +2711,6 @@ const HELP_TREE = {
|
|
|
1614
2711
|
command: "void prepare",
|
|
1615
2712
|
description: "Refresh generated project types"
|
|
1616
2713
|
}]
|
|
1617
|
-
},
|
|
1618
|
-
mcp: {
|
|
1619
|
-
summary: "Start the Void MCP server over stdio for AI agents.",
|
|
1620
|
-
usage: ["void mcp"]
|
|
1621
2714
|
}
|
|
1622
2715
|
};
|
|
1623
2716
|
function basicSubcommand(summary, usage, example) {
|
|
@@ -1640,17 +2733,42 @@ function withProjectOption(summary, usage) {
|
|
|
1640
2733
|
}]
|
|
1641
2734
|
};
|
|
1642
2735
|
}
|
|
2736
|
+
function lifecycleHelp(command, summary) {
|
|
2737
|
+
return {
|
|
2738
|
+
summary,
|
|
2739
|
+
usage: [`void platform ${command} [id] [--plan]${command === "disable" ? "" : " [--runtime <path>]"} [--yes]`],
|
|
2740
|
+
options: [
|
|
2741
|
+
{
|
|
2742
|
+
command: "--plan",
|
|
2743
|
+
description: "Print the exact plan without making changes"
|
|
2744
|
+
},
|
|
2745
|
+
...command === "disable" ? [] : [{
|
|
2746
|
+
command: "--runtime <path>",
|
|
2747
|
+
description: "Deploy an integrity-checked runtime directory instead of the package"
|
|
2748
|
+
}],
|
|
2749
|
+
{
|
|
2750
|
+
command: "--yes",
|
|
2751
|
+
description: "Acknowledge non-interactive Cloudflare changes"
|
|
2752
|
+
}
|
|
2753
|
+
]
|
|
2754
|
+
};
|
|
2755
|
+
}
|
|
1643
2756
|
function printGlobalHelp() {
|
|
1644
2757
|
printVoidHeader();
|
|
1645
2758
|
note([
|
|
1646
2759
|
globalCommandLine(["init"], "void init"),
|
|
1647
2760
|
...globalOptionLines(["init"]),
|
|
1648
2761
|
"",
|
|
2762
|
+
globalCommandLine(["connect"], "void connect [url]"),
|
|
2763
|
+
...globalOptionLines(["connect"]),
|
|
2764
|
+
"",
|
|
1649
2765
|
globalCommandLine(["deploy"], "void deploy"),
|
|
1650
2766
|
...globalOptionLines(["deploy"]),
|
|
1651
2767
|
"",
|
|
1652
2768
|
...globalCommandGroup("auth"),
|
|
1653
2769
|
"",
|
|
2770
|
+
...globalCommandGroup("platform"),
|
|
2771
|
+
"",
|
|
1654
2772
|
...globalCommandGroup("project"),
|
|
1655
2773
|
"",
|
|
1656
2774
|
categoryTitle("secrets"),
|
|
@@ -1658,6 +2776,8 @@ function printGlobalHelp() {
|
|
|
1658
2776
|
"",
|
|
1659
2777
|
...globalCommandGroup("domain"),
|
|
1660
2778
|
"",
|
|
2779
|
+
...globalCommandGroup("email"),
|
|
2780
|
+
"",
|
|
1661
2781
|
...globalCommandGroup("github"),
|
|
1662
2782
|
"",
|
|
1663
2783
|
...globalCommandGroup("build"),
|
|
@@ -1673,7 +2793,6 @@ function printGlobalHelp() {
|
|
|
1673
2793
|
"",
|
|
1674
2794
|
...globalCommandGroup("env"),
|
|
1675
2795
|
...globalOptionLines(["env", "check"]),
|
|
1676
|
-
...globalOptionLines(["env", "example"]),
|
|
1677
2796
|
"",
|
|
1678
2797
|
categoryTitle("codegen"),
|
|
1679
2798
|
globalCommandLine(["prepare"], "void prepare"),
|
|
@@ -1681,7 +2800,6 @@ function printGlobalHelp() {
|
|
|
1681
2800
|
"",
|
|
1682
2801
|
categoryTitle("agent"),
|
|
1683
2802
|
helpLine("void init --agents", requiredOption(["init"], "--agents").description),
|
|
1684
|
-
globalCommandLine(["mcp"], "void mcp"),
|
|
1685
2803
|
"",
|
|
1686
2804
|
categoryTitle("help"),
|
|
1687
2805
|
helpLine("void help <command>", "Show command-specific help"),
|
|
@@ -1781,6 +2899,287 @@ function formatHelpPath(path) {
|
|
|
1781
2899
|
return path.length === 0 ? "help" : path.join(" ");
|
|
1782
2900
|
}
|
|
1783
2901
|
//#endregion
|
|
2902
|
+
//#region src/cli/platform-args.ts
|
|
2903
|
+
const platformSubcommands = [
|
|
2904
|
+
...operatorGroups.map((name) => ({
|
|
2905
|
+
name,
|
|
2906
|
+
hint: "Operator commands",
|
|
2907
|
+
description: `Administer platform ${name}`
|
|
2908
|
+
})),
|
|
2909
|
+
{
|
|
2910
|
+
name: "list",
|
|
2911
|
+
description: "List installed and connected platforms"
|
|
2912
|
+
},
|
|
2913
|
+
{
|
|
2914
|
+
name: "use",
|
|
2915
|
+
arg: "[id]",
|
|
2916
|
+
description: "Select the default Void platform"
|
|
2917
|
+
},
|
|
2918
|
+
{
|
|
2919
|
+
name: "status",
|
|
2920
|
+
arg: "[id]",
|
|
2921
|
+
description: "Inspect a platform and its health"
|
|
2922
|
+
},
|
|
2923
|
+
{
|
|
2924
|
+
name: "discover",
|
|
2925
|
+
description: "Recover installations from a Cloudflare account"
|
|
2926
|
+
},
|
|
2927
|
+
{
|
|
2928
|
+
name: "domain",
|
|
2929
|
+
hint: "Set an application domain",
|
|
2930
|
+
description: "Add a domain to a workers.dev test platform"
|
|
2931
|
+
},
|
|
2932
|
+
{
|
|
2933
|
+
name: "install",
|
|
2934
|
+
description: "Install a Void platform with a domain or workers.dev for testing"
|
|
2935
|
+
},
|
|
2936
|
+
{
|
|
2937
|
+
name: "upgrade",
|
|
2938
|
+
arg: "[id]",
|
|
2939
|
+
description: "Upgrade an installed Void platform"
|
|
2940
|
+
},
|
|
2941
|
+
{
|
|
2942
|
+
name: "rollback",
|
|
2943
|
+
arg: "[id]",
|
|
2944
|
+
description: "Restore a compatible earlier platform runtime"
|
|
2945
|
+
},
|
|
2946
|
+
{
|
|
2947
|
+
name: "repair",
|
|
2948
|
+
arg: "[id]",
|
|
2949
|
+
description: "Reconcile an installed Void platform"
|
|
2950
|
+
},
|
|
2951
|
+
{
|
|
2952
|
+
name: "disable",
|
|
2953
|
+
arg: "[id]",
|
|
2954
|
+
description: "Disable traffic without deleting data"
|
|
2955
|
+
},
|
|
2956
|
+
{
|
|
2957
|
+
name: "enable",
|
|
2958
|
+
arg: "[id]",
|
|
2959
|
+
description: "Restore traffic for a disabled platform"
|
|
2960
|
+
},
|
|
2961
|
+
{
|
|
2962
|
+
name: "uninstall",
|
|
2963
|
+
arg: "[id]",
|
|
2964
|
+
description: "Safely remove an installed Void platform"
|
|
2965
|
+
}
|
|
2966
|
+
];
|
|
2967
|
+
function readValue(rest, index, flag) {
|
|
2968
|
+
const value = rest[index + 1];
|
|
2969
|
+
if (!value || value.startsWith("-")) throw new Error(`platform: ${flag} requires a value.`);
|
|
2970
|
+
return [value, index + 1];
|
|
2971
|
+
}
|
|
2972
|
+
function parseSelector(rest, subcommand, options = {}) {
|
|
2973
|
+
let selector = "";
|
|
2974
|
+
let plan = false;
|
|
2975
|
+
let yes = false;
|
|
2976
|
+
for (const arg of rest) if (arg === "--plan") plan = true;
|
|
2977
|
+
else if (arg === "--yes" && options.allowYes) yes = true;
|
|
2978
|
+
else if (arg.startsWith("-")) throw new Error(`platform: Unknown flag '${arg}'.`);
|
|
2979
|
+
else if (selector) throw new Error(`platform: Unexpected argument '${arg}'.`);
|
|
2980
|
+
else selector = arg;
|
|
2981
|
+
if ((subcommand === "use" || subcommand === "status") && plan) throw new Error("platform: Unknown flag '--plan'.");
|
|
2982
|
+
return {
|
|
2983
|
+
selector,
|
|
2984
|
+
plan,
|
|
2985
|
+
yes
|
|
2986
|
+
};
|
|
2987
|
+
}
|
|
2988
|
+
function parseLifecycleSelector(rest, subcommand) {
|
|
2989
|
+
const positional = [];
|
|
2990
|
+
let runtime = "";
|
|
2991
|
+
let fromRuntime = "";
|
|
2992
|
+
for (let index = 0; index < rest.length; index++) {
|
|
2993
|
+
const arg = rest[index];
|
|
2994
|
+
if (arg === "--runtime") {
|
|
2995
|
+
if (subcommand === "disable") throw new Error("platform: Unknown flag '--runtime'.");
|
|
2996
|
+
const [value, next] = readValue(rest, index, arg);
|
|
2997
|
+
runtime = value;
|
|
2998
|
+
index = next;
|
|
2999
|
+
} else if (arg === "--from-runtime" && subcommand === "rollback") {
|
|
3000
|
+
const [value, next] = readValue(rest, index, arg);
|
|
3001
|
+
fromRuntime = value;
|
|
3002
|
+
index = next;
|
|
3003
|
+
} else positional.push(arg);
|
|
3004
|
+
}
|
|
3005
|
+
const parsed = parseSelector(positional, subcommand, { allowYes: true });
|
|
3006
|
+
if (subcommand === "rollback" && !runtime) throw new Error("platform: rollback requires --runtime <earlier-runtime-directory>.");
|
|
3007
|
+
return {
|
|
3008
|
+
...parsed,
|
|
3009
|
+
runtime,
|
|
3010
|
+
fromRuntime
|
|
3011
|
+
};
|
|
3012
|
+
}
|
|
3013
|
+
function parsePlatformArgs(args) {
|
|
3014
|
+
if (operatorGroups.includes(args[0] ?? "") || [
|
|
3015
|
+
"--connection",
|
|
3016
|
+
"--json",
|
|
3017
|
+
"--plan",
|
|
3018
|
+
"--yes",
|
|
3019
|
+
"--timeout"
|
|
3020
|
+
].includes(args[0] ?? "")) return parseOperatorArgs(args);
|
|
3021
|
+
const [subcommand, ...rest] = args;
|
|
3022
|
+
if (subcommand === "domain") {
|
|
3023
|
+
if (rest.length === 0) return {
|
|
3024
|
+
subcommand,
|
|
3025
|
+
domain: "",
|
|
3026
|
+
selector: "",
|
|
3027
|
+
zone: "",
|
|
3028
|
+
dedicatedZone: false,
|
|
3029
|
+
plan: false,
|
|
3030
|
+
yes: false
|
|
3031
|
+
};
|
|
3032
|
+
if (rest[0] !== "set") throw new Error("platform: Usage: void platform domain set <domain> [--installation <id>] [--zone <domain>] [--dedicated-zone] [--plan] [--yes].");
|
|
3033
|
+
let domain = "";
|
|
3034
|
+
let selector = "";
|
|
3035
|
+
let zone = "";
|
|
3036
|
+
let plan = false;
|
|
3037
|
+
let yes = false;
|
|
3038
|
+
let dedicatedZone = false;
|
|
3039
|
+
for (let index = 1; index < rest.length; index++) {
|
|
3040
|
+
const arg = rest[index];
|
|
3041
|
+
if (arg === "--installation" || arg === "--zone") {
|
|
3042
|
+
const [value, next] = readValue(rest, index, arg);
|
|
3043
|
+
index = next;
|
|
3044
|
+
if (arg === "--zone") zone = value;
|
|
3045
|
+
else selector = value;
|
|
3046
|
+
} else if (arg === "--plan") plan = true;
|
|
3047
|
+
else if (arg === "--yes") yes = true;
|
|
3048
|
+
else if (arg === "--dedicated-zone") dedicatedZone = true;
|
|
3049
|
+
else if (!arg.startsWith("-") && !domain) domain = arg;
|
|
3050
|
+
else throw new Error(`platform: Unexpected argument '${arg}'.`);
|
|
3051
|
+
}
|
|
3052
|
+
if (!domain) throw new Error("platform: domain set requires an application domain.");
|
|
3053
|
+
if (plan && yes) throw new Error("platform: Use either --plan or --yes.");
|
|
3054
|
+
return {
|
|
3055
|
+
subcommand,
|
|
3056
|
+
domain,
|
|
3057
|
+
selector,
|
|
3058
|
+
zone,
|
|
3059
|
+
dedicatedZone,
|
|
3060
|
+
plan,
|
|
3061
|
+
yes
|
|
3062
|
+
};
|
|
3063
|
+
}
|
|
3064
|
+
if (subcommand === "list") {
|
|
3065
|
+
if (rest.length > 0) throw new Error(`platform: Unexpected argument '${rest[0]}'.`);
|
|
3066
|
+
return { subcommand };
|
|
3067
|
+
}
|
|
3068
|
+
if (subcommand === "use") {
|
|
3069
|
+
const { selector } = parseSelector(rest, subcommand);
|
|
3070
|
+
return {
|
|
3071
|
+
subcommand,
|
|
3072
|
+
selector
|
|
3073
|
+
};
|
|
3074
|
+
}
|
|
3075
|
+
if (subcommand === "status") {
|
|
3076
|
+
const { selector, plan } = parseSelector(rest, subcommand);
|
|
3077
|
+
if (plan) throw new Error("platform: Unknown flag '--plan'.");
|
|
3078
|
+
return {
|
|
3079
|
+
subcommand,
|
|
3080
|
+
selector
|
|
3081
|
+
};
|
|
3082
|
+
}
|
|
3083
|
+
if (subcommand === "discover") {
|
|
3084
|
+
let account = "";
|
|
3085
|
+
let selector = "";
|
|
3086
|
+
for (let index = 0; index < rest.length; index++) {
|
|
3087
|
+
const arg = rest[index];
|
|
3088
|
+
if (arg === "--account" || arg === "--installation") {
|
|
3089
|
+
const [value, next] = readValue(rest, index, arg);
|
|
3090
|
+
if (arg === "--account") account = value;
|
|
3091
|
+
else selector = value;
|
|
3092
|
+
index = next;
|
|
3093
|
+
} else throw new Error("platform: Usage: void platform discover [--account <id>] [--installation <id-or-name>].");
|
|
3094
|
+
}
|
|
3095
|
+
return {
|
|
3096
|
+
subcommand,
|
|
3097
|
+
account,
|
|
3098
|
+
selector
|
|
3099
|
+
};
|
|
3100
|
+
}
|
|
3101
|
+
if (subcommand === "upgrade" || subcommand === "rollback" || subcommand === "repair" || subcommand === "disable" || subcommand === "enable") {
|
|
3102
|
+
const { selector, plan, runtime, fromRuntime, yes } = parseLifecycleSelector(rest, subcommand);
|
|
3103
|
+
return subcommand === "rollback" ? {
|
|
3104
|
+
subcommand,
|
|
3105
|
+
selector,
|
|
3106
|
+
plan,
|
|
3107
|
+
runtime,
|
|
3108
|
+
fromRuntime,
|
|
3109
|
+
yes
|
|
3110
|
+
} : {
|
|
3111
|
+
subcommand,
|
|
3112
|
+
selector,
|
|
3113
|
+
plan,
|
|
3114
|
+
runtime,
|
|
3115
|
+
yes
|
|
3116
|
+
};
|
|
3117
|
+
}
|
|
3118
|
+
if (subcommand === "uninstall") {
|
|
3119
|
+
const parsed = parseSelector(rest.filter((arg) => ![
|
|
3120
|
+
"--purge-data",
|
|
3121
|
+
"--delete-zone",
|
|
3122
|
+
"--keep-zone"
|
|
3123
|
+
].includes(arg)), subcommand, { allowYes: true });
|
|
3124
|
+
if (rest.includes("--delete-zone") && rest.includes("--keep-zone")) throw new Error("platform: --delete-zone and --keep-zone cannot be used together.");
|
|
3125
|
+
return {
|
|
3126
|
+
subcommand,
|
|
3127
|
+
selector: parsed.selector,
|
|
3128
|
+
plan: parsed.plan,
|
|
3129
|
+
purgeData: rest.includes("--purge-data"),
|
|
3130
|
+
yes: parsed.yes,
|
|
3131
|
+
deleteZone: rest.includes("--delete-zone") ? true : rest.includes("--keep-zone") ? false : null
|
|
3132
|
+
};
|
|
3133
|
+
}
|
|
3134
|
+
if (subcommand === "install") {
|
|
3135
|
+
const values = /* @__PURE__ */ new Map();
|
|
3136
|
+
let plan = false;
|
|
3137
|
+
let resume = false;
|
|
3138
|
+
let dedicatedZone = false;
|
|
3139
|
+
let yes = false;
|
|
3140
|
+
const valueFlags = /* @__PURE__ */ new Set([
|
|
3141
|
+
"--account",
|
|
3142
|
+
"--application-domain",
|
|
3143
|
+
"--control-plane-domain",
|
|
3144
|
+
"--display-name",
|
|
3145
|
+
"--name",
|
|
3146
|
+
"--runtime",
|
|
3147
|
+
"--zone"
|
|
3148
|
+
]);
|
|
3149
|
+
let workersDev = false;
|
|
3150
|
+
for (let i = 0; i < rest.length; i++) {
|
|
3151
|
+
const arg = rest[i];
|
|
3152
|
+
if (valueFlags.has(arg)) {
|
|
3153
|
+
const [value, next] = readValue(rest, i, arg);
|
|
3154
|
+
values.set(arg, value);
|
|
3155
|
+
i = next;
|
|
3156
|
+
} else if (arg === "--plan") plan = true;
|
|
3157
|
+
else if (arg === "--resume") resume = true;
|
|
3158
|
+
else if (arg === "--dedicated-zone") dedicatedZone = true;
|
|
3159
|
+
else if (arg === "--yes") yes = true;
|
|
3160
|
+
else if (arg === "--workers-dev") workersDev = true;
|
|
3161
|
+
else throw new Error(`platform: Unexpected argument '${arg}'.`);
|
|
3162
|
+
}
|
|
3163
|
+
if (workersDev && (values.has("--application-domain") || values.has("--zone") || dedicatedZone)) throw new Error("platform: --workers-dev cannot be combined with a domain, zone, or --dedicated-zone.");
|
|
3164
|
+
return {
|
|
3165
|
+
subcommand,
|
|
3166
|
+
...workersDev ? { workersDev: true } : {},
|
|
3167
|
+
account: values.get("--account") ?? "",
|
|
3168
|
+
applicationDomain: values.get("--application-domain") ?? "",
|
|
3169
|
+
controlPlaneDomain: values.get("--control-plane-domain") ?? "",
|
|
3170
|
+
dedicatedZone,
|
|
3171
|
+
displayName: values.get("--display-name") ?? "",
|
|
3172
|
+
name: values.get("--name") ?? "",
|
|
3173
|
+
plan,
|
|
3174
|
+
resume,
|
|
3175
|
+
runtime: values.get("--runtime") ?? "",
|
|
3176
|
+
yes,
|
|
3177
|
+
zone: values.get("--zone") ?? ""
|
|
3178
|
+
};
|
|
3179
|
+
}
|
|
3180
|
+
throw new Error("platform: Usage: void platform <auth|user|project|deployment|build|signup|invitation|system|worker|list|use|status|discover|install|domain|upgrade|rollback|repair|disable|enable|uninstall>.");
|
|
3181
|
+
}
|
|
3182
|
+
//#endregion
|
|
1784
3183
|
//#region src/cli/prepare-args.ts
|
|
1785
3184
|
function parsePrepareArgs(args) {
|
|
1786
3185
|
const parsed = parseArgs({
|
|
@@ -2047,94 +3446,115 @@ function buildArgs(result, trailingArgs) {
|
|
|
2047
3446
|
async function runSubcommandGroup(command, subcommands, parse, run) {
|
|
2048
3447
|
const root = process.cwd();
|
|
2049
3448
|
const sub = args[1];
|
|
3449
|
+
const hasNamedSubcommand = args.slice(1).some((arg) => subcommands.some(({ name }) => name === arg));
|
|
2050
3450
|
try {
|
|
2051
|
-
if ((!sub || sub.startsWith("-")) && process.stdin.isTTY) {
|
|
2052
|
-
const { promptSubcommand } = await import("../subcommand-prompt-
|
|
3451
|
+
if ((!sub || sub.startsWith("-") && !hasNamedSubcommand) && process.stdin.isTTY) {
|
|
3452
|
+
const { promptSubcommand } = await import("../subcommand-prompt-WfySCQ7S.mjs");
|
|
2053
3453
|
const result = await promptSubcommand(command, subcommands);
|
|
2054
3454
|
if (!result) process.exit(0);
|
|
2055
3455
|
await run(root, parse(buildArgs(result, args.slice(1))));
|
|
2056
3456
|
} else await run(root, parse(args.slice(1)));
|
|
2057
3457
|
} catch (err) {
|
|
2058
|
-
|
|
3458
|
+
if (command === "platform" && args.includes("--json")) {
|
|
3459
|
+
console.error(JSON.stringify(err instanceof OperatorClientError ? err.toJSON() : {
|
|
3460
|
+
error: "invalid_command",
|
|
3461
|
+
message: err instanceof Error ? err.message : String(err)
|
|
3462
|
+
}));
|
|
3463
|
+
process.exit(1);
|
|
3464
|
+
}
|
|
3465
|
+
const message = formatCloudflareUserMessage(err instanceof Error ? err.message : String(err));
|
|
3466
|
+
if (command === "platform") console.error(err instanceof OperatorClientError && err.details !== void 0 ? `${message}\nPartial result:\n${JSON.stringify(err.details, null, 2)}` : message);
|
|
3467
|
+
else log.error(message);
|
|
2059
3468
|
process.exit(1);
|
|
2060
3469
|
}
|
|
2061
3470
|
}
|
|
2062
3471
|
const args = process.argv.slice(2);
|
|
2063
3472
|
const command = args[0];
|
|
2064
3473
|
const helpPath = getHelpPath(args);
|
|
2065
|
-
if (helpPath)
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
3474
|
+
if (helpPath) {
|
|
3475
|
+
if (helpPath.length === 0) printGlobalHelp();
|
|
3476
|
+
else try {
|
|
3477
|
+
printHelpPage(helpPath);
|
|
3478
|
+
} catch (err) {
|
|
3479
|
+
log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
|
|
3480
|
+
process.exit(1);
|
|
3481
|
+
}
|
|
3482
|
+
} else if (command === "deploy") {
|
|
2073
3483
|
const root = process.cwd();
|
|
2074
3484
|
let deployArgs;
|
|
2075
3485
|
try {
|
|
2076
3486
|
deployArgs = parseDeployArgs(args.slice(1));
|
|
2077
3487
|
} catch (err) {
|
|
2078
|
-
log.error(err instanceof Error ? err.message : String(err));
|
|
3488
|
+
log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
|
|
2079
3489
|
process.exit(1);
|
|
2080
3490
|
}
|
|
2081
|
-
import("../deploy-
|
|
3491
|
+
import("../deploy-CcDoeBIf.mjs").then((n) => n.n).then(({ runDeploy }) => {
|
|
2082
3492
|
runDeploy(root, {
|
|
2083
3493
|
projectSlug: deployArgs.projectSlug,
|
|
2084
3494
|
dir: deployArgs.dir,
|
|
2085
3495
|
spa: deployArgs.spa,
|
|
2086
3496
|
skipBuild: deployArgs.skipBuild,
|
|
2087
3497
|
debug: deployArgs.debug,
|
|
3498
|
+
platform: deployArgs.platform,
|
|
2088
3499
|
backend: deployArgs.backend,
|
|
2089
|
-
provision: deployArgs.provision
|
|
3500
|
+
provision: deployArgs.provision,
|
|
3501
|
+
requireEmail: deployArgs.requireEmail
|
|
2090
3502
|
}).catch((err) => {
|
|
2091
|
-
log.error(err.message ?? err);
|
|
3503
|
+
log.error(formatCloudflareUserMessage(err.message ?? String(err)));
|
|
2092
3504
|
process.exit(1);
|
|
2093
3505
|
});
|
|
2094
3506
|
});
|
|
2095
|
-
} else if (command === "
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
else if (command === "
|
|
3507
|
+
} else if (command === "connect") (async () => {
|
|
3508
|
+
const parsed = parseConnectArgs(args.slice(1));
|
|
3509
|
+
const { runConnectCommand } = await import("../connect-D9Yr-T5f.mjs");
|
|
3510
|
+
await runConnectCommand(process.cwd(), parsed);
|
|
3511
|
+
})().catch((err) => {
|
|
3512
|
+
log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
|
|
3513
|
+
process.exit(1);
|
|
3514
|
+
});
|
|
3515
|
+
else if (command === "auth") runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-cmd-CYVhSNFy.mjs").then(({ runAuthCommand }) => runAuthCommand(root, parsed)));
|
|
3516
|
+
else if (command === "platform") runSubcommandGroup("platform", platformSubcommands, parsePlatformArgs, (root, parsed) => import("../platform-cmd-BEOVv1PN.mjs").then(({ runPlatformCommand }) => runPlatformCommand(root, parsed)));
|
|
3517
|
+
else if (command === "cloudflare") runSubcommandGroup("cloudflare", cloudflareSubcommands, parseCloudflareArgs, (root, parsed) => import("../cloudflare-cmd-D3ME2GAe.mjs").then(({ runCloudflareCommand }) => runCloudflareCommand(root, parsed)));
|
|
3518
|
+
else if (command === "project") runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-DCpk1cDt.mjs").then(({ runProjectCommand }) => runProjectCommand(root, parsed)));
|
|
3519
|
+
else if (command === "secret") runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-BqTxGqki.mjs").then(({ runSecretCommand }) => runSecretCommand(root, parsed)));
|
|
3520
|
+
else if (command === "domain") runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-gu_iaHmn.mjs").then(({ runDomainCommand }) => runDomainCommand(root, parsed)));
|
|
3521
|
+
else if (command === "email") runSubcommandGroup("email", emailSubcommands, parseEmailArgs, (root, parsed) => import("../email-r6DHJyAB.mjs").then(({ runEmailCommand }) => runEmailCommand(root, parsed)));
|
|
3522
|
+
else if (command === "db") runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-BxoUWL0F.mjs").then(({ runDbCommand }) => runDbCommand(root, parsed)));
|
|
3523
|
+
else if (command === "env") runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-DmU2To0C.mjs").then(({ runEnvCommand }) => runEnvCommand(root, parsed)));
|
|
3524
|
+
else if (command === "gen") runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-BKw6qHIg.mjs").then(({ runGenCommand }) => runGenCommand(root, parsed)));
|
|
3525
|
+
else if (command === "github") runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (root, parsed) => import("../github-cmd-DJS5Ab-H.mjs").then(({ runGithubCommand }) => runGithubCommand(root, parsed)));
|
|
3526
|
+
else if (command === "build") runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (root, parsed) => import("../build-cmd-CkVD1uOh.mjs").then(({ runBuildCommand }) => runBuildCommand(root, parsed)));
|
|
2104
3527
|
else if (command === "prepare") {
|
|
2105
3528
|
const root = process.cwd();
|
|
2106
3529
|
let prepareArgs;
|
|
2107
3530
|
try {
|
|
2108
3531
|
prepareArgs = parsePrepareArgs(args.slice(1));
|
|
2109
3532
|
} catch (err) {
|
|
2110
|
-
log.error(err instanceof Error ? err.message : String(err));
|
|
3533
|
+
log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
|
|
2111
3534
|
process.exit(1);
|
|
2112
3535
|
}
|
|
2113
|
-
import("../prepare-
|
|
3536
|
+
import("../prepare-BfJvFUtJ.mjs").then(({ runPrepareCommand }) => {
|
|
2114
3537
|
runPrepareCommand(root, prepareArgs).catch((err) => {
|
|
2115
|
-
log.error(err.message ?? err);
|
|
3538
|
+
log.error(formatCloudflareUserMessage(err.message ?? String(err)));
|
|
2116
3539
|
process.exit(1);
|
|
2117
3540
|
});
|
|
2118
3541
|
});
|
|
2119
3542
|
} else if (command === "init") {
|
|
2120
3543
|
const root = process.cwd();
|
|
2121
|
-
import("../init-
|
|
3544
|
+
import("../init-Dx5cgKqK.mjs").then(({ runInitCommand, parseInitArgs }) => {
|
|
2122
3545
|
let initArgs;
|
|
2123
3546
|
try {
|
|
2124
3547
|
initArgs = parseInitArgs(args.slice(1));
|
|
2125
3548
|
} catch (err) {
|
|
2126
|
-
log.error(err instanceof Error ? err.message : String(err));
|
|
3549
|
+
log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
|
|
2127
3550
|
process.exit(1);
|
|
2128
3551
|
}
|
|
2129
3552
|
runInitCommand(root, initArgs).catch((err) => {
|
|
2130
|
-
log.error(err.message ?? err);
|
|
3553
|
+
log.error(formatCloudflareUserMessage(err.message ?? String(err)));
|
|
2131
3554
|
process.exit(1);
|
|
2132
3555
|
});
|
|
2133
3556
|
});
|
|
2134
|
-
} else if (command === "
|
|
2135
|
-
runMcp();
|
|
2136
|
-
});
|
|
2137
|
-
else if (command === "-v" || command === "--version") {
|
|
3557
|
+
} else if (command === "-v" || command === "--version") {
|
|
2138
3558
|
const version = JSON.parse(readFileSync(join(getPackageDir(), "package.json"), "utf-8")).version;
|
|
2139
3559
|
console.log(version);
|
|
2140
3560
|
} else if (command && command !== "help" && command !== "--help" && command !== "-h") {
|
|
@@ -2144,17 +3564,32 @@ else if (command === "-v" || command === "--version") {
|
|
|
2144
3564
|
const topLevelCommands = [
|
|
2145
3565
|
{
|
|
2146
3566
|
name: "init",
|
|
3567
|
+
hint: "--agents | --tsconfig | --github | --git | --no-git",
|
|
2147
3568
|
description: "Set up void in a new or existing project"
|
|
2148
3569
|
},
|
|
3570
|
+
{
|
|
3571
|
+
name: "connect",
|
|
3572
|
+
description: "Connect to Cloudflare or a Void platform"
|
|
3573
|
+
},
|
|
2149
3574
|
{
|
|
2150
3575
|
name: "deploy",
|
|
2151
|
-
description: "Build and deploy
|
|
3576
|
+
description: "Build and deploy, or link an existing Cloudflare Worker"
|
|
2152
3577
|
},
|
|
2153
3578
|
{
|
|
2154
3579
|
name: "auth",
|
|
2155
3580
|
hint: "login | logout | whoami | token",
|
|
2156
3581
|
description: "Login, logout, and token management"
|
|
2157
3582
|
},
|
|
3583
|
+
{
|
|
3584
|
+
name: "platform",
|
|
3585
|
+
hint: "auth | user | project | deployment | signup | system | install",
|
|
3586
|
+
description: "Install platforms and administer users, projects, access, and operations"
|
|
3587
|
+
},
|
|
3588
|
+
{
|
|
3589
|
+
name: "cloudflare",
|
|
3590
|
+
hint: "login | status | logout",
|
|
3591
|
+
description: "Manage Cloudflare sign-in and inspect the deployment account"
|
|
3592
|
+
},
|
|
2158
3593
|
{
|
|
2159
3594
|
name: "project",
|
|
2160
3595
|
hint: "status | link | list | logs | requests | rollback | cancel | delete | purge-cache",
|
|
@@ -2170,6 +3605,11 @@ else if (command === "-v" || command === "--version") {
|
|
|
2170
3605
|
hint: "add | delete | list | status",
|
|
2171
3606
|
description: "Configure custom domains"
|
|
2172
3607
|
},
|
|
3608
|
+
{
|
|
3609
|
+
name: "email",
|
|
3610
|
+
hint: "usage | logs | destinations | allow | disallow | status | setup",
|
|
3611
|
+
description: "Inspect email activity and manage verified recipients"
|
|
3612
|
+
},
|
|
2173
3613
|
{
|
|
2174
3614
|
name: "github",
|
|
2175
3615
|
hint: "install | installations | connect | update | status | disconnect | link | join",
|
|
@@ -2182,13 +3622,13 @@ else if (command === "-v" || command === "--version") {
|
|
|
2182
3622
|
},
|
|
2183
3623
|
{
|
|
2184
3624
|
name: "db",
|
|
2185
|
-
hint: "status | reset | seed | execute | migrate | studio | export
|
|
3625
|
+
hint: "connect | status | reset | seed | execute | migrate | studio | export",
|
|
2186
3626
|
description: "Database migrations and management"
|
|
2187
3627
|
},
|
|
2188
3628
|
{
|
|
2189
3629
|
name: "env",
|
|
2190
|
-
hint: "check | types
|
|
2191
|
-
description: "Validate env.ts
|
|
3630
|
+
hint: "check | types",
|
|
3631
|
+
description: "Validate env.ts or generate types"
|
|
2192
3632
|
},
|
|
2193
3633
|
{
|
|
2194
3634
|
name: "gen",
|
|
@@ -2199,10 +3639,6 @@ else if (command === "-v" || command === "--version") {
|
|
|
2199
3639
|
name: "prepare",
|
|
2200
3640
|
description: "Generate .void artifacts without starting Vite"
|
|
2201
3641
|
},
|
|
2202
|
-
{
|
|
2203
|
-
name: "mcp",
|
|
2204
|
-
description: "Start MCP server (for AI agents)"
|
|
2205
|
-
},
|
|
2206
3642
|
{
|
|
2207
3643
|
name: "help",
|
|
2208
3644
|
description: "Show help message"
|
|
@@ -2210,38 +3646,41 @@ else if (command === "-v" || command === "--version") {
|
|
|
2210
3646
|
];
|
|
2211
3647
|
(async () => {
|
|
2212
3648
|
printVoidHeader();
|
|
2213
|
-
const { promptSubcommand } = await import("../subcommand-prompt-
|
|
3649
|
+
const { promptSubcommand } = await import("../subcommand-prompt-WfySCQ7S.mjs");
|
|
2214
3650
|
const result = await promptSubcommand("", topLevelCommands);
|
|
2215
3651
|
if (!result) process.exit(0);
|
|
2216
3652
|
const cmd = result.subcommand;
|
|
2217
3653
|
const root = process.cwd();
|
|
2218
3654
|
switch (cmd) {
|
|
3655
|
+
case "connect": {
|
|
3656
|
+
const { runConnectCommand } = await import("../connect-D9Yr-T5f.mjs");
|
|
3657
|
+
await runConnectCommand(root, parseConnectArgs([]));
|
|
3658
|
+
return;
|
|
3659
|
+
}
|
|
2219
3660
|
case "init": {
|
|
2220
|
-
const { runInitCommand, parseInitArgs } = await import("../init-
|
|
3661
|
+
const { runInitCommand, parseInitArgs } = await import("../init-Dx5cgKqK.mjs");
|
|
2221
3662
|
await runInitCommand(root, parseInitArgs([]));
|
|
2222
3663
|
return;
|
|
2223
3664
|
}
|
|
2224
3665
|
case "deploy": {
|
|
2225
|
-
const { runDeploy } = await import("../deploy-
|
|
3666
|
+
const { runDeploy } = await import("../deploy-CcDoeBIf.mjs").then((n) => n.n);
|
|
2226
3667
|
await runDeploy(root);
|
|
2227
3668
|
return;
|
|
2228
3669
|
}
|
|
2229
|
-
case "
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
}
|
|
2234
|
-
case "
|
|
2235
|
-
case "
|
|
2236
|
-
case "
|
|
2237
|
-
case "
|
|
2238
|
-
case "
|
|
2239
|
-
case "
|
|
2240
|
-
case "
|
|
2241
|
-
case "env": return runSubcommandGroup("env", envSubcommands, parseEnvArgs, (r, p) => import("../env-CZy5MorI.mjs").then(({ runEnvCommand }) => runEnvCommand(r, p)));
|
|
2242
|
-
case "gen": return runSubcommandGroup("gen", genSubcommands, parseGenArgs, (r, p) => import("../gen-o_w-8yI8.mjs").then(({ runGenCommand }) => runGenCommand(r, p)));
|
|
3670
|
+
case "auth": return runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (r, p) => import("../auth-cmd-CYVhSNFy.mjs").then(({ runAuthCommand }) => runAuthCommand(r, p)));
|
|
3671
|
+
case "platform": return runSubcommandGroup("platform", platformSubcommands, parsePlatformArgs, (r, p) => import("../platform-cmd-BEOVv1PN.mjs").then(({ runPlatformCommand }) => runPlatformCommand(r, p)));
|
|
3672
|
+
case "cloudflare": return runSubcommandGroup("cloudflare", cloudflareSubcommands, parseCloudflareArgs, (r, p) => import("../cloudflare-cmd-D3ME2GAe.mjs").then(({ runCloudflareCommand }) => runCloudflareCommand(r, p)));
|
|
3673
|
+
case "project": return runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (r, p) => import("../project-cmd-DCpk1cDt.mjs").then(({ runProjectCommand }) => runProjectCommand(r, p)));
|
|
3674
|
+
case "secret": return runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (r, p) => import("../secret-BqTxGqki.mjs").then(({ runSecretCommand }) => runSecretCommand(r, p)));
|
|
3675
|
+
case "domain": return runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (r, p) => import("../domain-gu_iaHmn.mjs").then(({ runDomainCommand }) => runDomainCommand(r, p)));
|
|
3676
|
+
case "github": return runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (r, p) => import("../github-cmd-DJS5Ab-H.mjs").then(({ runGithubCommand }) => runGithubCommand(r, p)));
|
|
3677
|
+
case "build": return runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (r, p) => import("../build-cmd-CkVD1uOh.mjs").then(({ runBuildCommand }) => runBuildCommand(r, p)));
|
|
3678
|
+
case "email": return runSubcommandGroup("email", emailSubcommands, parseEmailArgs, (r, p) => import("../email-r6DHJyAB.mjs").then(({ runEmailCommand }) => runEmailCommand(r, p)));
|
|
3679
|
+
case "db": return runSubcommandGroup("db", dbSubcommands, parseDbArgs, (r, p) => import("../db-BxoUWL0F.mjs").then(({ runDbCommand }) => runDbCommand(r, p)));
|
|
3680
|
+
case "env": return runSubcommandGroup("env", envSubcommands, parseEnvArgs, (r, p) => import("../env-DmU2To0C.mjs").then(({ runEnvCommand }) => runEnvCommand(r, p)));
|
|
3681
|
+
case "gen": return runSubcommandGroup("gen", genSubcommands, parseGenArgs, (r, p) => import("../gen-BKw6qHIg.mjs").then(({ runGenCommand }) => runGenCommand(r, p)));
|
|
2243
3682
|
case "prepare": {
|
|
2244
|
-
const { runPrepareCommand } = await import("../prepare-
|
|
3683
|
+
const { runPrepareCommand } = await import("../prepare-BfJvFUtJ.mjs");
|
|
2245
3684
|
await runPrepareCommand(root, parsePrepareArgs([]));
|
|
2246
3685
|
return;
|
|
2247
3686
|
}
|
|
@@ -2250,9 +3689,9 @@ else if (command === "-v" || command === "--version") {
|
|
|
2250
3689
|
return;
|
|
2251
3690
|
}
|
|
2252
3691
|
})().catch((err) => {
|
|
2253
|
-
log.error(err instanceof Error ? err.message : String(err));
|
|
3692
|
+
log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
|
|
2254
3693
|
process.exit(1);
|
|
2255
3694
|
});
|
|
2256
3695
|
} else printGlobalHelp();
|
|
2257
3696
|
//#endregion
|
|
2258
|
-
export {};
|
|
3697
|
+
export { OperatorClient as n, OperatorClientError as r, help_exports as t };
|