void 0.22.0 → 0.24.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 +1 -1
- package/README.md +5 -1
- package/dist/{account-cmd-CjyxcGkM.mjs → account-cmd-vJhh5lrb.mjs} +5 -5
- package/dist/{scan-ClYmX3sa.mjs → application-analysis-BVsVqc11.mjs} +135 -18
- package/dist/application-routing-B7QEjqSR.mjs +27 -0
- package/dist/{auth-DLNN0D3Z.mjs → auth-CQkSDS50.mjs} +26 -96
- package/dist/auth-DX3JURcX.mjs +2 -0
- package/dist/{auth-link-BLO4ptzo.mjs → auth-link-D75t9wO2.mjs} +5 -5
- package/dist/{auth-router-ZUg9MF_U.mjs → auth-router-ClfhL1J7.mjs} +7 -7
- package/dist/{better-auth-shared-rsBGBvWJ.mjs → better-auth-shared-hy6RPh9W.mjs} +13 -2
- package/dist/{build-cmd-BxR5FROK.mjs → build-cmd-zMi1iFnS.mjs} +21 -9
- package/dist/{cache-D0sWhgKI.mjs → cache-ZtQmyxVV.mjs} +5 -5
- package/dist/{cancel-deploy-D4NUqFbi.mjs → cancel-deploy-Box0kkEV.mjs} +5 -5
- package/dist/{cf-access-P0iZnu0q.mjs → cf-access-BGe5sWXF.mjs} +4 -48
- package/dist/{cf-access-DRsQRe6k.mjs → cf-access-TWNzXltp.mjs} +3 -11
- package/dist/{cf-build-output-BJ6yGEIS.mjs → cf-build-output-BPqOT964.mjs} +2 -1
- package/dist/cf-build-output-_0HNWysu.mjs +2 -0
- package/dist/cli/cli.mjs +89 -461
- package/dist/cli/{cf-compat.mjs → cloudflare-operation-process.mjs} +454 -424
- package/dist/cli/env-schema-probe.d.mts +2 -1
- package/dist/cli/env-schema-probe.mjs +4 -4
- package/dist/client-B9UBI03V.mjs +2 -0
- package/dist/{client-BTZ3XkrB.mjs → client-DKAsFA4X.mjs} +161 -24
- package/dist/{cloudflare-auth-DQkqoMYa.mjs → cloudflare-auth-Qdc7tw8F.mjs} +41 -38
- package/dist/{cloudflare-cmd-BKlfGHAy.mjs → cloudflare-cmd-CmY8dGkd.mjs} +6 -6
- package/dist/cloudflare-config-Bktvwtpf.mjs +182 -0
- package/dist/{cloudflare-connect-Ctmrw579.mjs → cloudflare-connect-IiR3ZieC.mjs} +4 -4
- package/dist/{cloudflare-operations-BT6OWFBk.mjs → cloudflare-operations-BCdXSsmo.mjs} +1 -1
- package/dist/{cloudflare-operations-B9tzgjmf.mjs → cloudflare-operations-DzH-A966.mjs} +116 -172
- package/dist/{preset-UHj9ARyP.mjs → cloudflare-process-B-wekeR6.mjs} +93 -6
- package/dist/{config-VavjpDnp.d.mts → config-BMHb8RCj.d.mts} +1 -0
- package/dist/config-C_XRIPx2.mjs +89 -0
- package/dist/config-entry.d.mts +1 -1
- package/dist/{connect-Dg-WkW-C.mjs → connect-B-usTnlF.mjs} +9 -9
- package/dist/{create-project-l9J7pbtm.mjs → create-project-CYOOAYcn.mjs} +12 -12
- package/dist/{create-project-DdoqwFLF.mjs → create-project-FWbf5Olo.mjs} +1 -1
- package/dist/{db-gp2sCXyN.mjs → db-Ck2eZ2iB.mjs} +26 -26
- package/dist/{delete-TTedbH6B.mjs → delete-sK56qtzZ.mjs} +5 -5
- package/dist/{deploy-CH-o2CaZ.mjs → deploy-gCVaiJbS.mjs} +984 -616
- package/dist/{deploy-B19L2Bra.mjs → deploy-irP5q0-x.mjs} +1 -1
- package/dist/{domain-JRF59P_r.mjs → domain-DFfQE8jg.mjs} +6 -6
- package/dist/{email-Bo6G9LOZ.mjs → email-CdnhUHvJ.mjs} +15 -30
- package/dist/{env-BYOrWQnv.mjs → env-DmGdHi5i.mjs} +8 -8
- package/dist/{env-public-BxU_0yTL.d.mts → env-public-BX_r8HR6.d.mts} +1 -1
- package/dist/{env-types-C2_bIk_b.mjs → env-types-D5kds_OZ.mjs} +1 -1
- package/dist/{env-validation-BB4GkLxn.mjs → env-validation-C_8tPdhs.mjs} +20 -73
- package/dist/{env-validation-BXge7uyK.mjs → env-validation-zZOCcQVZ.mjs} +1 -1
- package/dist/{fetch-CXDChK7B.mjs → fetch-BIZJh7vR.mjs} +2 -2
- package/dist/{fetch-stream-AOByI7Ki.mjs → fetch-stream-IvCYKyQL.mjs} +24 -4
- package/dist/{gen-sCtlCOdA.mjs → gen-CshAkukR.mjs} +4 -4
- package/dist/gen-DvQTWzDU.mjs +2 -0
- package/dist/{github-cmd-0-7PexDq.mjs → github-cmd-DftuEvIt.mjs} +13 -13
- package/dist/{handler-HEcZsaij.d.mts → handler-CZ4nAylQ.d.mts} +1 -1
- package/dist/{headers-DWi2IXWx.mjs → headers-2rKda9Y6.mjs} +1 -1
- package/dist/{help-GKtwl07I.mjs → help-Dotbf6iz.mjs} +236 -750
- package/dist/help-mabuIV98.mjs +2 -0
- package/dist/{inbound-aVHEUhKo.mjs → inbound-fRkqcXaC.mjs} +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +299 -1517
- package/dist/info-B97bTX9N.mjs +113 -0
- package/dist/{init-FZx3Elvz.mjs → init-BTQEZZGJ.mjs} +61 -27
- package/dist/limits-Bq5LG8Id.d.mts +27 -0
- package/dist/limits-Cjuk2VPm.mjs +68 -0
- package/dist/{link-BrQfb_CU.mjs → link-B46sYH0K.mjs} +6 -6
- package/dist/{list-D44jmIAM.mjs → list-BnPrIsU_.mjs} +6 -6
- package/dist/{live-CKJlvlNp.d.mts → live-Chw1eIMv.d.mts} +1 -1
- package/dist/{local-d1-Bg9OzEEO.mjs → local-d1-2CMnpuW_.mjs} +2 -2
- package/dist/log-vqY3pqwI.mjs +29 -0
- package/dist/{login-CAsAsQ-_.mjs → login-BuiMyUrx.mjs} +8 -8
- package/dist/login-DIy9Sb-U.mjs +2 -0
- package/dist/{logs-BjKvFnVM.mjs → logs-CZG9d-ic.mjs} +10 -11
- package/dist/migrate-BCiJ8w0f.mjs +2 -0
- package/dist/{migrate-BPITvDJN.mjs → migrate-q4_njtaW.mjs} +4 -3
- package/dist/{node-Dt7z256D.mjs → node-BkyRWRx8.mjs} +1 -1
- package/dist/operator-args-B3BTmSoi.mjs +697 -0
- package/dist/{operator-auth-8KnOVXVd.mjs → operator-auth-7erYc6Lt.mjs} +2 -2
- package/dist/{operator-client-DUwumHpQ.mjs → operator-client-CpHjTd0t.mjs} +3 -3
- package/dist/{operator-cmd-BK5CCiT9.mjs → operator-cmd-DGqPJUD3.mjs} +70 -24
- package/dist/{output-Dm_A4Tbv.mjs → output-CbM85T4k.mjs} +18 -10
- package/dist/pages/client.d.mts +34 -2
- package/dist/pages/client.mjs +59 -3
- package/dist/pages/index.d.mts +1 -1
- package/dist/pages/index.mjs +2 -2
- package/dist/pages/islands-plugin.mjs +1 -1
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +2 -308
- package/dist/{parse-filename-DioPHiR9.mjs → parse-filename-CUbj-1MP.mjs} +35 -1
- package/dist/plan-D1Q5rf-r.mjs +2 -0
- package/dist/plan-NPpwZ_kc.mjs +58 -0
- package/dist/platform-args-3k8X9-H_.mjs +514 -0
- package/dist/platform-args-DdnM6WIf.mjs +2 -0
- package/dist/{platform-auth-config-BlN8xTdD.mjs → platform-auth-config-DDrxUy4m.mjs} +6 -6
- package/dist/{platform-auth-protection-7d5aV2Jg.mjs → platform-auth-protection-BLadnnct.mjs} +8 -8
- package/dist/{platform-auth-recovery-Dxij8ZbR.mjs → platform-auth-recovery-CmCzX2Fl.mjs} +6 -6
- package/dist/{platform-cmd-B3hwKrFK.mjs → platform-cmd-DMDEc9uS.mjs} +29 -8
- package/dist/{platform-cmd-E0FuL212.mjs → platform-cmd-pMTRhvYs.mjs} +1 -1
- package/dist/{platform-domain-D6Xcy9ZX.mjs → platform-domain-Di6EYrQl.mjs} +5 -5
- package/dist/{platform-lifecycle-k0E0xoxx.mjs → platform-lifecycle-BBoNzojY.mjs} +1541 -572
- package/dist/{platform-lifecycle-DMh_qrry.mjs → platform-lifecycle-BFdSi9Qt.mjs} +1 -1
- package/dist/{platform-management-Brz_BDiT.mjs → platform-management-CWOQOWXm.mjs} +10 -7
- package/dist/{platform-management-DOtss0BN.mjs → platform-management-DG47jys8.mjs} +1 -1
- package/dist/platform-plans-config-Vl9BP3H4.mjs +359 -0
- package/dist/{platform-recovery-BvtcXON5.mjs → platform-recovery-BJnQJEtQ.mjs} +4 -4
- package/dist/{platform-registry-QBa4DK32.mjs → platform-registry-DkPPXfp_.mjs} +2 -2
- package/dist/{plugin-inference-BMfKRSqE.mjs → plugin-inference-CXWnn79A.mjs} +174 -64
- package/dist/{prepare-C-6YZyyg.mjs → prepare-CBLT3CHH.mjs} +3 -3
- package/dist/prepare-CnjcTV2s.mjs +2 -0
- package/dist/{prepare-CRhJbVrG.mjs → prepare-DnaKBi--.mjs} +5 -21
- package/dist/{project-C0Fqu05O.mjs → project-DKG5Ra8p.mjs} +15 -82
- package/dist/project-DsblYifa.mjs +2 -0
- package/dist/{project-cmd-BZLCqOqw.mjs → project-cmd-DxnXstAq.mjs} +19 -19
- package/dist/{project-team-BvgM0WoX.mjs → project-team-BmHcaALJ.mjs} +5 -5
- package/dist/{project-token-l5DqK6Az.mjs → project-token-GionZlBI.mjs} +5 -5
- package/dist/{project-zero-trust-v6Mvpp8y.mjs → project-zero-trust-JLCjVQA7.mjs} +5 -5
- package/dist/prompts-2TGE6oXx.mjs +2 -0
- package/dist/prompts-BNUoTiaf.mjs +2044 -0
- package/dist/{protocol-BBa6cstI.d.mts → protocol-CjF_iI9X.d.mts} +2 -2
- package/dist/protocol-U7bfjHmA.mjs +331 -0
- package/dist/{provision-Fr9pRqce.mjs → provision-CVku1JFU.mjs} +1 -1
- package/dist/{provision-C4IGqkBf.mjs → provision-CaoxO_U7.mjs} +90 -199
- package/dist/{requests-DN-BbNiM.mjs → requests-BOjIVAeF.mjs} +5 -5
- package/dist/resource-name-C7LVpcRm.mjs +11 -0
- package/dist/{rollback-D7rzSaZM.mjs → rollback-CwR3pLj3.mjs} +6 -6
- package/dist/route-url-CG7U-cRN.mjs +15 -0
- package/dist/{runner-B8wXwWlo.mjs → runner-CXA9Fh8h.mjs} +1 -1
- package/dist/{runner-p-dMs2UN.mjs → runner-Ol0TNjk6.mjs} +2 -2
- package/dist/runtime/ai.d.mts +12 -8
- package/dist/runtime/ai.mjs +87 -22
- package/dist/runtime/better-auth-mysql.mjs +1 -1
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.mjs +1 -1
- package/dist/runtime/client-react.mjs +2 -2
- package/dist/runtime/client-solid.mjs +2 -2
- package/dist/runtime/client-svelte.mjs +2 -2
- package/dist/runtime/client-vue.mjs +2 -2
- package/dist/runtime/client.mjs +2 -2
- package/dist/runtime/durable.d.mts +3 -1
- package/dist/runtime/durable.mjs +4 -1
- package/dist/runtime/email/testing.mjs +2 -2
- package/dist/runtime/email.mjs +1 -1
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/fetch.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/kv.mjs +0 -1
- package/dist/runtime/limits.d.mts +2 -0
- package/dist/runtime/limits.mjs +2 -0
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live-server.mjs +25 -16
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/migration-handler.mjs +62 -42
- package/dist/runtime/remote/index.mjs +2 -2
- package/dist/runtime/route-url.d.mts +4 -0
- package/dist/runtime/route-url.mjs +2 -0
- package/dist/runtime/routing.d.mts +180 -0
- package/dist/runtime/routing.mjs +1082 -0
- package/dist/runtime/sandbox-container.d.mts +1 -1
- package/dist/runtime/sandbox-container.mjs +1 -1
- package/dist/runtime/sandbox.d.mts +3 -3
- package/dist/runtime/sandbox.mjs +75 -45
- package/dist/runtime/sse.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +4 -2
- package/dist/runtime/ws-server.mjs +27 -2
- package/dist/runtime/ws.d.mts +2 -2
- package/dist/runtime/ws.mjs +8 -6
- package/dist/{sandbox-qpNBT8a3.d.mts → sandbox-XZAqzFlG.d.mts} +11 -8
- package/dist/{sandbox-container-DdNEBfCc.d.mts → sandbox-container-Bo0eiFKz.d.mts} +2 -1
- package/dist/{sandbox-container-4fdqLnyb.mjs → sandbox-container-C6ItmVuN.mjs} +4 -2
- package/dist/{scan-4tfN-PSn.mjs → scan-C7okrLyM.mjs} +4 -35
- package/dist/{secret-BOtOl_cb.mjs → secret-ByWJWBUG.mjs} +7 -7
- package/dist/{skills-D1II1Juz.mjs → skills-C1PlclPt.mjs} +1 -1
- package/dist/{sse-BaC1jXko.mjs → sse-CQNaDFFV.mjs} +6 -3
- package/dist/{subcommand-prompt-CY1C4fvl.mjs → subcommand-prompt-klFCfcor.mjs} +40 -32
- package/dist/validate-Dq_L3s0S.mjs +2 -0
- package/dist/{validate-CIUwFpjB.mjs → validate-ctOrgiS3.mjs} +2 -1
- package/dist/{wrangler-DQF1vKyf.mjs → wrangler-7K-bW_DL.mjs} +8 -239
- package/dist/{ws-BoY7vQML.d.mts → ws-CL1w7GXU.d.mts} +13 -2
- package/package.json +16 -10
- package/skills/migrate-vite-cloudflare-to-void/SKILL.md +34 -157
- package/skills/void/SKILL.md +55 -135
- package/skills/void/docs/guide/ai.md +94 -84
- package/skills/void/docs/guide/app-types.md +3 -32
- package/skills/void/docs/guide/auth.md +12 -116
- package/skills/void/docs/guide/database/d1.md +9 -54
- package/skills/void/docs/guide/database/mysql.md +1 -1
- package/skills/void/docs/guide/database/postgresql.md +5 -26
- package/skills/void/docs/guide/database.md +23 -75
- package/skills/void/docs/guide/deployment.md +48 -112
- package/skills/void/docs/guide/durable-state.md +43 -18
- package/skills/void/docs/guide/edge/headers.md +4 -48
- package/skills/void/docs/guide/edge/prerendering.md +5 -20
- package/skills/void/docs/guide/edge/redirects.md +11 -64
- package/skills/void/docs/guide/edge/revalidation.md +5 -18
- package/skills/void/docs/guide/edge/rewrites.md +56 -284
- package/skills/void/docs/guide/edge/static-assets.md +22 -72
- package/skills/void/docs/guide/email/domains.md +116 -0
- package/skills/void/docs/guide/email/receiving.md +139 -0
- package/skills/void/docs/guide/email/sending.md +231 -0
- package/skills/void/docs/guide/email.md +13 -619
- package/skills/void/docs/guide/env-migration.md +11 -11
- package/skills/void/docs/guide/env-vars.md +9 -29
- package/skills/void/docs/guide/index.md +0 -15
- package/skills/void/docs/guide/jobs.md +3 -18
- package/skills/void/docs/guide/kv.md +5 -11
- package/skills/void/docs/guide/live.md +5 -56
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +78 -125
- package/skills/void/docs/guide/pages-routing/head.md +10 -10
- package/skills/void/docs/guide/pages-routing/islands.md +6 -36
- package/skills/void/docs/guide/pages-routing/layouts.md +6 -128
- package/skills/void/docs/guide/pages-routing/loaders.md +3 -19
- package/skills/void/docs/guide/pages-routing/markdown.md +13 -171
- package/skills/void/docs/guide/pages-routing/overview.md +7 -17
- package/skills/void/docs/guide/pages-routing/view-transitions.md +1 -1
- package/skills/void/docs/guide/platform/administration/access.md +1 -4
- package/skills/void/docs/guide/platform/administration/email.md +35 -8
- package/skills/void/docs/guide/platform/administration/operations.md +26 -4
- package/skills/void/docs/guide/platform/administration/plans.md +126 -0
- package/skills/void/docs/guide/platform/administration/projects.md +5 -2
- package/skills/void/docs/guide/platform/administration/zero-trust.md +49 -160
- package/skills/void/docs/guide/platform/development/runtime.md +3 -13
- package/skills/void/docs/guide/platform/development/schema-ci.md +0 -58
- package/skills/void/docs/guide/platform/installation/ci.md +1 -1
- package/skills/void/docs/guide/platform/installation/credentials.md +15 -6
- package/skills/void/docs/guide/platform/installation/domains.md +35 -2
- package/skills/void/docs/guide/platform/installation/first-deployment.md +4 -2
- package/skills/void/docs/guide/platform/installation/maintenance.md +15 -1
- package/skills/void/docs/guide/platform/installation/prerequisites.md +24 -18
- package/skills/void/docs/guide/platform/installation/setup.md +88 -14
- package/skills/void/docs/guide/platform-administration.md +1 -0
- package/skills/void/docs/guide/queues.md +7 -9
- package/skills/void/docs/guide/quickstart.md +38 -37
- package/skills/void/docs/guide/remote-dev.md +5 -10
- package/skills/void/docs/guide/sandboxes.md +29 -21
- package/skills/void/docs/guide/server-routing.md +9 -72
- package/skills/void/docs/guide/sse.md +4 -18
- package/skills/void/docs/guide/ssg.md +3 -15
- package/skills/void/docs/guide/ssr.md +14 -62
- package/skills/void/docs/guide/storage.md +9 -4
- package/skills/void/docs/guide/type-safety.md +3 -14
- package/skills/void/docs/guide/typed-fetch.md +3 -7
- package/skills/void/docs/guide/websockets.md +68 -40
- package/skills/void/docs/integrations/agents.md +3 -3
- package/skills/void/docs/integrations/cloudflare.md +85 -316
- package/skills/void/docs/integrations/frameworks/analog.md +5 -64
- package/skills/void/docs/integrations/frameworks/astro.md +4 -73
- package/skills/void/docs/integrations/frameworks/nuxt.md +5 -62
- package/skills/void/docs/integrations/frameworks/overview.md +11 -54
- package/skills/void/docs/integrations/frameworks/react-router.md +5 -60
- package/skills/void/docs/integrations/frameworks/sveltekit.md +6 -65
- package/skills/void/docs/integrations/frameworks/tanstack-start.md +4 -62
- package/skills/void/docs/integrations/nodejs-bun-deno.md +5 -69
- package/skills/void/docs/reference/api/auth.md +156 -0
- package/skills/void/docs/reference/api/client.md +87 -0
- package/skills/void/docs/reference/api/database.md +95 -0
- package/skills/void/docs/reference/api/durable.md +46 -0
- package/skills/void/docs/reference/api/env.md +50 -0
- package/skills/void/docs/reference/api/handlers.md +254 -0
- package/skills/void/docs/reference/api/pages.md +241 -0
- package/skills/void/docs/reference/api/plugin.md +39 -0
- package/skills/void/docs/reference/api/resources.md +109 -0
- package/skills/void/docs/reference/api/rewrites.md +76 -0
- package/skills/void/docs/reference/api/types.md +92 -0
- package/skills/void/docs/reference/api.md +56 -1218
- package/skills/void/docs/reference/cli/auth.md +89 -0
- package/skills/void/docs/reference/cli/database.md +128 -0
- package/skills/void/docs/reference/cli/deploy.md +105 -0
- package/skills/void/docs/reference/cli/domains.md +41 -0
- package/skills/void/docs/reference/cli/email.md +129 -0
- package/skills/void/docs/reference/cli/generate.md +116 -0
- package/skills/void/docs/reference/cli/github.md +189 -0
- package/skills/void/docs/reference/cli/platform-config.md +92 -0
- package/skills/void/docs/reference/cli/platform-email.md +81 -0
- package/skills/void/docs/reference/cli/platform-installation.md +142 -0
- package/skills/void/docs/reference/cli/platform-operations.md +90 -0
- package/skills/void/docs/reference/cli/platform-users.md +89 -0
- package/skills/void/docs/reference/cli/platform-zero-trust.md +59 -0
- package/skills/void/docs/reference/cli/platform.md +70 -0
- package/skills/void/docs/reference/cli/project.md +214 -0
- package/skills/void/docs/reference/cli/secrets.md +76 -0
- package/skills/void/docs/reference/cli/setup.md +70 -0
- package/skills/void/docs/reference/cli.md +32 -1682
- package/skills/void/docs/reference/config.md +12 -18
- package/skills/void/docs/reference/resource-inference.md +3 -58
- package/skills/void/docs/reference/structure.md +14 -41
- package/dist/auth-CZuiVsFh.mjs +0 -2
- package/dist/canonical-json-DuDiiUsQ.mjs +0 -13
- package/dist/client-Czz8o5jP.mjs +0 -2
- package/dist/dist-BuDuKZJv.mjs +0 -2
- package/dist/dist-CTBk70IR.mjs +0 -1310
- package/dist/gen-CNJ62MM7.mjs +0 -2
- package/dist/help-CmZzxUba.mjs +0 -2
- package/dist/log-ChfPKsVd.mjs +0 -26
- package/dist/login-CGcRKEoi.mjs +0 -2
- package/dist/migrate-CYfbKkXh.mjs +0 -2
- package/dist/plan-BEZ8VJW0.mjs +0 -256
- package/dist/plan-DpuOr14e.mjs +0 -2
- package/dist/prepare-Bm3iq-u4.mjs +0 -2
- package/dist/project-BuUwfj6f.mjs +0 -2
- package/dist/validate-EKmJWxmy.mjs +0 -2
- /package/dist/cli/{cf-compat.d.mts → cloudflare-operation-process.d.mts} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as findEnvFile } from "../env-types-
|
|
1
|
+
import { t as findEnvFile } from "../env-types-D5kds_OZ.mjs";
|
|
2
2
|
import { writeSync } from "node:fs";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { spawnSync } from "node:child_process";
|
|
5
5
|
//#region src/cli/env-schema-probe.ts
|
|
6
6
|
/**
|
|
7
|
-
* The self-host `void deploy --
|
|
7
|
+
* The self-host `void deploy --platform cloudflare` orchestrator validates the REAL
|
|
8
8
|
* build artifact (`dist/ssr/wrangler.json` `vars`) instead of predicting it. Two
|
|
9
9
|
* pieces still need project code, and BOTH run here — in an ISOLATED SUBPROCESS —
|
|
10
10
|
* because the orchestrator runs in a credential-bearing PARENT (CF Access service
|
|
@@ -169,7 +169,7 @@ function emitResult(result) {
|
|
|
169
169
|
* facts. The import stays isolated because env.ts is arbitrary project code.
|
|
170
170
|
*/
|
|
171
171
|
async function runFactsChild(root) {
|
|
172
|
-
const { deriveSelfHostSchemaFacts, SelfHostSchemaError } = await import("../env-validation-
|
|
172
|
+
const { deriveSelfHostSchemaFacts, SelfHostSchemaError } = await import("../env-validation-zZOCcQVZ.mjs");
|
|
173
173
|
try {
|
|
174
174
|
emitResult({
|
|
175
175
|
kind: "ok",
|
|
@@ -194,7 +194,7 @@ async function runFactsChild(root) {
|
|
|
194
194
|
* fault → fail closed as a values-free schema error.
|
|
195
195
|
*/
|
|
196
196
|
async function runValidateEmittedChild(root) {
|
|
197
|
-
const { computeInvalidEmittedKeys, readEmittedWorkerVars, SelfHostSchemaError } = await import("../env-validation-
|
|
197
|
+
const { computeInvalidEmittedKeys, readEmittedWorkerVars, SelfHostSchemaError } = await import("../env-validation-zZOCcQVZ.mjs");
|
|
198
198
|
const emitted = readEmittedWorkerVars(root);
|
|
199
199
|
if (!emitted.ok) {
|
|
200
200
|
emitResult({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as join } from "./dist-BVqXeR_h.mjs";
|
|
2
|
-
import { t as cfAccessHeaders } from "./cf-access-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { t as cfAccessHeaders } from "./cf-access-TWNzXltp.mjs";
|
|
3
|
+
import { s as normalizePlatformApiUrl } from "./platform-registry-DkPPXfp_.mjs";
|
|
4
|
+
import { i as isCloudflareAccessChallenge, n as ensurePlatformAccessToken, t as ensureCloudflaredToken } from "./cf-access-BGe5sWXF.mjs";
|
|
5
|
+
import { a as getApiUrl } from "./auth-CQkSDS50.mjs";
|
|
6
6
|
import { n as getPackageDir } from "./agents-B_pX_HmQ.mjs";
|
|
7
7
|
import { readFileSync } from "node:fs";
|
|
8
8
|
import { stripVTControlCharacters } from "node:util";
|
|
@@ -152,10 +152,11 @@ function isPreflightRejection(error) {
|
|
|
152
152
|
* the server's precheck, the only atomic (project-locked) verdict: if
|
|
153
153
|
* an earlier attempt or a concurrent deploy is still in flight, the
|
|
154
154
|
* replay is rejected with 409 and surfaced as a deploy conflict
|
|
155
|
-
* naming the deployment id.
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
155
|
+
* naming the deployment id. Receipt-aware platforms additionally bind
|
|
156
|
+
* the stable invocation key to the accepted artifact, so an accepted
|
|
157
|
+
* request can be recovered without creating another execution. Older
|
|
158
|
+
* platforms retain their concurrency guard. No client-side deployment
|
|
159
|
+
* lookup may authorize replay or identify an unrelated conflicting row.
|
|
159
160
|
*/
|
|
160
161
|
const DEPLOY_POST_MAX_RETRIES = 3;
|
|
161
162
|
const DEPLOY_POST_BACKOFF_MS = [
|
|
@@ -163,6 +164,33 @@ const DEPLOY_POST_BACKOFF_MS = [
|
|
|
163
164
|
5e3,
|
|
164
165
|
1e4
|
|
165
166
|
];
|
|
167
|
+
const DEPLOY_OBSERVATION_TIMEOUT_MS = 3e4;
|
|
168
|
+
const DEPLOY_OBSERVATION_DEADLINE_MS = 18e5;
|
|
169
|
+
const DEPLOY_OBSERVATION_BACKOFF_MS = [
|
|
170
|
+
1e3,
|
|
171
|
+
2e3,
|
|
172
|
+
5e3,
|
|
173
|
+
1e4,
|
|
174
|
+
3e4
|
|
175
|
+
];
|
|
176
|
+
const DEPLOY_EVENT_MAX_BYTES = 1048576;
|
|
177
|
+
var DeploymentProtocolError = class extends Error {};
|
|
178
|
+
var DeploymentObservationTimeoutError = class extends Error {
|
|
179
|
+
constructor(deploymentId) {
|
|
180
|
+
super(`Timed out observing deployment ${deploymentId}. Inspect with \`void project status\`.`);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
function parseDeployEvent(value) {
|
|
184
|
+
if (!value || typeof value !== "object" || !("event" in value) || typeof value.event !== "string") throw new DeploymentProtocolError("Invalid deployment event from platform.");
|
|
185
|
+
const event = value;
|
|
186
|
+
if (event.seq !== void 0 && (!Number.isSafeInteger(event.seq) || event.seq < 1)) throw new DeploymentProtocolError("Invalid deployment event sequence from platform.");
|
|
187
|
+
if (event.event === "start" && typeof event.deploymentId !== "string" || event.event === "heartbeat" && (typeof event.step !== "string" || event.status !== void 0 && ![
|
|
188
|
+
"queued",
|
|
189
|
+
"running",
|
|
190
|
+
"recovering"
|
|
191
|
+
].includes(event.status) || event.recoveryAt !== void 0 && (typeof event.recoveryAt !== "string" || !Number.isFinite(Date.parse(event.recoveryAt)))) || event.event === "done" && (typeof event.deployment !== "string" || typeof event.url !== "string" || !Array.isArray(event.urls) || !event.urls.every((url) => typeof url === "string") || !Number.isSafeInteger(event.assets) || event.assets < 0 || !Number.isSafeInteger(event.workers) || event.workers < 0 || event.published !== void 0 && typeof event.published !== "boolean") || event.event === "error" && (typeof event.message !== "string" || typeof event.step !== "string")) throw new DeploymentProtocolError("Invalid deployment result from platform.");
|
|
192
|
+
return event;
|
|
193
|
+
}
|
|
166
194
|
/**
|
|
167
195
|
* HTTP client for the Void platform API.
|
|
168
196
|
*/
|
|
@@ -237,10 +265,10 @@ var PlatformClient = class {
|
|
|
237
265
|
if (!res.ok) await throwPlatformApiError("Failed to list projects", res);
|
|
238
266
|
return res.json();
|
|
239
267
|
}
|
|
240
|
-
/** A lightweight project list for interactive linking
|
|
268
|
+
/** A lightweight project list for interactive linking. */
|
|
241
269
|
async listProjectChoices() {
|
|
242
270
|
const res = await this.request(`${this.baseUrl}/projects/choices`, { headers: { ...this.authHeaders } });
|
|
243
|
-
if (res.status === 404)
|
|
271
|
+
if (res.status === 404) throw new Error("This platform does not support project lookup. Ask its administrator to upgrade the platform runtime.");
|
|
244
272
|
if (!res.ok) await throwPlatformApiError("Failed to list project choices", res);
|
|
245
273
|
return res.json();
|
|
246
274
|
}
|
|
@@ -251,12 +279,12 @@ var PlatformClient = class {
|
|
|
251
279
|
if (!res.ok) await throwPlatformApiError("Failed to get project", res);
|
|
252
280
|
return res.json();
|
|
253
281
|
}
|
|
254
|
-
/**
|
|
282
|
+
/** Resolve a slug through the current platform contract. */
|
|
255
283
|
async findProjectBySlug(slug) {
|
|
256
284
|
const url = new URL(`${this.baseUrl}/projects/resolve`);
|
|
257
285
|
url.searchParams.set("slug", slug);
|
|
258
286
|
const res = await this.request(url.toString(), { headers: { ...this.authHeaders } });
|
|
259
|
-
if (res.status === 404)
|
|
287
|
+
if (res.status === 404) throw new Error("This platform does not support project lookup. Ask its administrator to upgrade the platform runtime.");
|
|
260
288
|
if (!res.ok) await throwPlatformApiError("Failed to resolve project", res);
|
|
261
289
|
return (await res.json()).project;
|
|
262
290
|
}
|
|
@@ -506,7 +534,8 @@ var PlatformClient = class {
|
|
|
506
534
|
method: "POST",
|
|
507
535
|
headers: {
|
|
508
536
|
"Content-Type": "application/json",
|
|
509
|
-
...this.authHeaders
|
|
537
|
+
...this.authHeaders,
|
|
538
|
+
"x-void-deploy-idempotency-key": crypto.randomUUID()
|
|
510
539
|
},
|
|
511
540
|
body: JSON.stringify(payload)
|
|
512
541
|
});
|
|
@@ -568,6 +597,25 @@ var PlatformClient = class {
|
|
|
568
597
|
}
|
|
569
598
|
throw new PlatformApiError("Deploy failed", res.status, body, isCloudflareAccessChallenge(res) ? void 0 : "deploy");
|
|
570
599
|
}
|
|
600
|
+
const receipt = res.headers.get("x-void-deployment-id");
|
|
601
|
+
const observationDeadline = Date.now() + DEPLOY_OBSERVATION_DEADLINE_MS;
|
|
602
|
+
if (receipt !== null && !/^[A-Za-z0-9_-]{1,128}$/.test(receipt)) {
|
|
603
|
+
res.body?.cancel().catch(() => {});
|
|
604
|
+
throw new Error("Invalid deployment receipt from platform.");
|
|
605
|
+
}
|
|
606
|
+
let cursor = 0;
|
|
607
|
+
let terminal = false;
|
|
608
|
+
if (!res.body) {
|
|
609
|
+
if (receipt) {
|
|
610
|
+
yield {
|
|
611
|
+
event: "start",
|
|
612
|
+
deploymentId: receipt
|
|
613
|
+
};
|
|
614
|
+
yield* this.followDeploymentEvents(projectId, receipt, cursor, observationDeadline);
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
throw new Error("Platform returned no deployment event stream.");
|
|
618
|
+
}
|
|
571
619
|
const reader = res.body.getReader();
|
|
572
620
|
const decoder = new TextDecoder();
|
|
573
621
|
let buffer = "";
|
|
@@ -576,10 +624,52 @@ var PlatformClient = class {
|
|
|
576
624
|
const startedAt = Date.now();
|
|
577
625
|
let eventCount = 0;
|
|
578
626
|
let lastEventName = "<none>";
|
|
627
|
+
let streamFinished = false;
|
|
628
|
+
let readTimer;
|
|
629
|
+
const read = async () => {
|
|
630
|
+
if (!receipt) return reader.read();
|
|
631
|
+
const remaining = observationDeadline - Date.now();
|
|
632
|
+
if (remaining <= 0) throw new DeploymentObservationTimeoutError(receipt);
|
|
633
|
+
try {
|
|
634
|
+
return await Promise.race([reader.read(), new Promise((_, reject) => {
|
|
635
|
+
readTimer = setTimeout(() => reject(Date.now() >= observationDeadline ? new DeploymentObservationTimeoutError(receipt) : /* @__PURE__ */ new TypeError("Deployment event stream timed out.")), Math.min(DEPLOY_OBSERVATION_TIMEOUT_MS, remaining));
|
|
636
|
+
})]);
|
|
637
|
+
} finally {
|
|
638
|
+
clearTimeout(readTimer);
|
|
639
|
+
}
|
|
640
|
+
};
|
|
641
|
+
const parseLine = (line) => {
|
|
642
|
+
if (Buffer.byteLength(line) > DEPLOY_EVENT_MAX_BYTES) throw new DeploymentProtocolError("Deployment event exceeds the platform response limit.");
|
|
643
|
+
if (!line.trim()) return null;
|
|
644
|
+
const event = parseDeployEvent(JSON.parse(line));
|
|
645
|
+
if (event.seq !== void 0) {
|
|
646
|
+
if (event.seq <= cursor) return null;
|
|
647
|
+
cursor = event.seq;
|
|
648
|
+
}
|
|
649
|
+
eventCount++;
|
|
650
|
+
lastEventName = event.event;
|
|
651
|
+
cliLog?.info("deploy_event", {
|
|
652
|
+
eventCount,
|
|
653
|
+
event: lastEventName,
|
|
654
|
+
raw: line.slice(0, 200)
|
|
655
|
+
});
|
|
656
|
+
if (receipt && event.event === "start") return null;
|
|
657
|
+
terminal = event.event === "done" || event.event === "error";
|
|
658
|
+
return event;
|
|
659
|
+
};
|
|
579
660
|
try {
|
|
661
|
+
if (receipt) yield {
|
|
662
|
+
event: "start",
|
|
663
|
+
deploymentId: receipt
|
|
664
|
+
};
|
|
580
665
|
while (true) {
|
|
581
|
-
const { done, value } = await
|
|
666
|
+
const { done, value } = await read();
|
|
667
|
+
if (receipt && Date.now() >= observationDeadline) throw new DeploymentObservationTimeoutError(receipt);
|
|
582
668
|
if (done) {
|
|
669
|
+
streamFinished = true;
|
|
670
|
+
buffer += decoder.decode();
|
|
671
|
+
const event = parseLine(buffer);
|
|
672
|
+
if (event) yield event;
|
|
583
673
|
cliLog?.info("deploy_stream_eof", {
|
|
584
674
|
bytesRead,
|
|
585
675
|
eventCount,
|
|
@@ -597,18 +687,13 @@ var PlatformClient = class {
|
|
|
597
687
|
while ((newlineIdx = buffer.indexOf("\n")) !== -1) {
|
|
598
688
|
const line = buffer.slice(0, newlineIdx);
|
|
599
689
|
buffer = buffer.slice(newlineIdx + 1);
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
eventCount++;
|
|
603
|
-
lastEventName = event.event ?? "<no-event-field>";
|
|
604
|
-
cliLog?.info("deploy_event", {
|
|
605
|
-
eventCount,
|
|
606
|
-
event: lastEventName,
|
|
607
|
-
raw: line.slice(0, 200)
|
|
608
|
-
});
|
|
690
|
+
const event = parseLine(line);
|
|
691
|
+
if (event) {
|
|
609
692
|
yield event;
|
|
693
|
+
if (terminal) return;
|
|
610
694
|
}
|
|
611
695
|
}
|
|
696
|
+
if (Buffer.byteLength(buffer) > DEPLOY_EVENT_MAX_BYTES) throw new DeploymentProtocolError("Deployment event exceeds the platform response limit.");
|
|
612
697
|
}
|
|
613
698
|
} catch (err) {
|
|
614
699
|
cliLog?.error("deploy_stream_error", err, {
|
|
@@ -616,8 +701,60 @@ var PlatformClient = class {
|
|
|
616
701
|
eventCount,
|
|
617
702
|
lastEvent: lastEventName
|
|
618
703
|
});
|
|
619
|
-
throw err;
|
|
704
|
+
if (!receipt || err instanceof DeploymentObservationTimeoutError || err instanceof DeploymentProtocolError || err instanceof SyntaxError || err instanceof DOMException && err.name === "AbortError") throw err;
|
|
705
|
+
} finally {
|
|
706
|
+
clearTimeout(readTimer);
|
|
707
|
+
if (!streamFinished) reader.cancel().catch(() => {});
|
|
708
|
+
reader.releaseLock();
|
|
709
|
+
}
|
|
710
|
+
if (receipt && !terminal) yield* this.followDeploymentEvents(projectId, receipt, cursor, observationDeadline);
|
|
711
|
+
}
|
|
712
|
+
async *followDeploymentEvents(projectId, deploymentId, since, deadline) {
|
|
713
|
+
let cursor = since;
|
|
714
|
+
let failures = 0;
|
|
715
|
+
while (Date.now() < deadline) {
|
|
716
|
+
const url = `${this.baseUrl}/projects/${encodeURIComponent(projectId)}/deployments/${encodeURIComponent(deploymentId)}/events?since=${cursor}`;
|
|
717
|
+
let page;
|
|
718
|
+
try {
|
|
719
|
+
const response = await this.request(url, {
|
|
720
|
+
headers: { ...this.authHeaders },
|
|
721
|
+
signal: AbortSignal.timeout(Math.max(1, Math.min(DEPLOY_OBSERVATION_TIMEOUT_MS, deadline - Date.now())))
|
|
722
|
+
});
|
|
723
|
+
if (!response.ok) await throwPlatformApiError("Failed to observe deployment", response, "read");
|
|
724
|
+
page = await response.json();
|
|
725
|
+
if (Date.now() >= deadline) throw new DeploymentObservationTimeoutError(deploymentId);
|
|
726
|
+
} catch (err) {
|
|
727
|
+
if (!(err instanceof TypeError || err instanceof DOMException && err.name === "TimeoutError" || err instanceof PlatformApiError && (err.status === 429 || err.status >= 500)) || failures >= DEPLOY_OBSERVATION_BACKOFF_MS.length) throw err;
|
|
728
|
+
const delayMs = DEPLOY_OBSERVATION_BACKOFF_MS[failures++];
|
|
729
|
+
this.cliLog?.warn("deploy_observation_retry", {
|
|
730
|
+
deploymentId,
|
|
731
|
+
cursor,
|
|
732
|
+
delayMs
|
|
733
|
+
});
|
|
734
|
+
await sleep(Math.min(delayMs, Math.max(0, deadline - Date.now())));
|
|
735
|
+
continue;
|
|
736
|
+
}
|
|
737
|
+
failures = 0;
|
|
738
|
+
if (!page || page.deploymentId !== deploymentId || !Array.isArray(page.events) || page.events.length > 1e3 || !Number.isSafeInteger(page.lastSeq) || page.lastSeq < cursor || typeof page.terminal !== "boolean") throw new Error("Invalid deployment observation response from platform.");
|
|
739
|
+
let previousSeq = 0;
|
|
740
|
+
for (const row of page.events) {
|
|
741
|
+
if (!row || !Number.isSafeInteger(row.seq) || row.seq <= previousSeq || row.seq > page.lastSeq) throw new Error("Invalid deployment observation sequence from platform.");
|
|
742
|
+
previousSeq = row.seq;
|
|
743
|
+
const event = parseDeployEvent(row.event);
|
|
744
|
+
if (row.seq <= cursor) continue;
|
|
745
|
+
cursor = row.seq;
|
|
746
|
+
if (event.event !== "start") yield event;
|
|
747
|
+
if (event.event === "done" || event.event === "error") return;
|
|
748
|
+
}
|
|
749
|
+
if (page.terminal) throw new Error("Platform finished deployment without a terminal result.");
|
|
750
|
+
if (page.heartbeat !== void 0) {
|
|
751
|
+
const heartbeat = parseDeployEvent(page.heartbeat);
|
|
752
|
+
if (heartbeat.event !== "heartbeat" || heartbeat.deploymentId !== void 0 && heartbeat.deploymentId !== deploymentId) throw new DeploymentProtocolError("Invalid deployment observation heartbeat.");
|
|
753
|
+
yield heartbeat;
|
|
754
|
+
}
|
|
755
|
+
await sleep(Math.min(1e3, Math.max(0, deadline - Date.now())));
|
|
620
756
|
}
|
|
757
|
+
throw new DeploymentObservationTimeoutError(deploymentId);
|
|
621
758
|
}
|
|
622
759
|
async listSecrets(projectId) {
|
|
623
760
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/secrets`, { headers: { ...this.authHeaders } });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as resolveCloudflareOperationArgv, n as decodeCloudflareOperationResult, r as encodeCloudflareOperation } from "./cloudflare-process-B-wekeR6.mjs";
|
|
2
2
|
import { execFile, spawn, spawnSync } from "node:child_process";
|
|
3
3
|
//#region src/cli/cloudflare-auth.ts
|
|
4
4
|
var CloudflareAuthenticationError = class extends Error {
|
|
@@ -22,26 +22,25 @@ async function ensureCloudflareAuthentication(options) {
|
|
|
22
22
|
if (overrides.length > 0) throw new CloudflareAuthenticationError(`Cloudflare browser login cannot replace credentials supplied by ${overrides.join(", ")}. Remove these overrides from this shell and rerun \`void cloudflare login\`.`, "environment-credentials");
|
|
23
23
|
}
|
|
24
24
|
if (options.acceptApiToken && !options.requireAccounts && (process.env.CLOUDFLARE_API_TOKEN?.trim() || process.env.CF_API_TOKEN?.trim())) return { accounts: [] };
|
|
25
|
-
const run = async (
|
|
25
|
+
const run = async (operation, capture) => {
|
|
26
26
|
if (options.beforeRun && !options.beforeRun()) throw new CloudflareAuthenticationError("", "uploader-changed");
|
|
27
|
-
return await options.runWrangler(
|
|
27
|
+
return await options.runWrangler(operation, capture);
|
|
28
|
+
};
|
|
29
|
+
const whoami = {
|
|
30
|
+
type: "auth.whoami",
|
|
31
|
+
...options.configPath ? { configPath: options.configPath } : {}
|
|
28
32
|
};
|
|
29
|
-
const whoamiArgs = [
|
|
30
|
-
"whoami",
|
|
31
|
-
"--json",
|
|
32
|
-
...options.whoamiArgs ?? []
|
|
33
|
-
];
|
|
34
33
|
const readSession = async () => {
|
|
35
|
-
const result = await run(
|
|
34
|
+
const result = await run(whoami, true);
|
|
36
35
|
if (!isCleanExit(result)) return null;
|
|
37
|
-
const session = parseCloudflareAuthSession(result.
|
|
36
|
+
const session = parseCloudflareAuthSession(result.data);
|
|
38
37
|
if (options.requireAccounts) return session && session.accounts.length > 0 ? session : null;
|
|
39
|
-
return session
|
|
38
|
+
return session;
|
|
40
39
|
};
|
|
41
40
|
const existing = options.forceLogin ? null : await readSession();
|
|
42
41
|
if (existing) return existing;
|
|
43
42
|
if (!(options.interactive ?? (process.stdin.isTTY && process.stdout.isTTY))) throw new CloudflareAuthenticationError("Cloudflare authentication is required. Set CLOUDFLARE_API_TOKEN in CI, or run `void cloudflare login` in an interactive terminal.", "not-authenticated");
|
|
44
|
-
if (!isCleanExit(await run(
|
|
43
|
+
if (!isCleanExit(await run({ type: "auth.login" }, false))) throw new CloudflareAuthenticationError("Cloudflare browser sign-in did not complete. Run `void cloudflare login` to try again.", "login");
|
|
45
44
|
const authenticated = await readSession();
|
|
46
45
|
if (!authenticated) throw new CloudflareAuthenticationError("Cloudflare sign-in completed without a usable session. Run `void cloudflare login` to try again.", "not-authenticated");
|
|
47
46
|
return authenticated;
|
|
@@ -53,13 +52,7 @@ function cloudflareCredentialOverrides(source = process.env) {
|
|
|
53
52
|
const email = ["CLOUDFLARE_EMAIL", "CF_EMAIL"].find((key) => Boolean(source[key]));
|
|
54
53
|
return [...tokens, ...key && email ? [key, email] : []];
|
|
55
54
|
}
|
|
56
|
-
function parseCloudflareAuthSession(
|
|
57
|
-
let value;
|
|
58
|
-
try {
|
|
59
|
-
value = JSON.parse(stdout.trim());
|
|
60
|
-
} catch {
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
55
|
+
function parseCloudflareAuthSession(value) {
|
|
63
56
|
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
64
57
|
const record = value;
|
|
65
58
|
if (record.loggedIn !== true || !Array.isArray(record.accounts)) return null;
|
|
@@ -80,39 +73,49 @@ function parseCloudflareAuthSession(stdout) {
|
|
|
80
73
|
};
|
|
81
74
|
}
|
|
82
75
|
function createBundledCloudflareAuthRunner(root) {
|
|
83
|
-
const [command, ...prefix] =
|
|
84
|
-
return (
|
|
85
|
-
const
|
|
76
|
+
const [command, ...prefix] = resolveCloudflareOperationArgv(root);
|
|
77
|
+
return (operation, capture) => {
|
|
78
|
+
const args = encodeCloudflareOperation(operation);
|
|
79
|
+
const env = cloudflareAuthCommandEnvironment(operation);
|
|
80
|
+
const streaming = cloudflareAuthNeedsTerminal(operation);
|
|
86
81
|
const result = spawnSync(command, [...prefix, ...args], {
|
|
87
82
|
cwd: root,
|
|
88
83
|
encoding: "utf8",
|
|
89
84
|
env,
|
|
90
85
|
maxBuffer: 10485760,
|
|
91
86
|
shell: false,
|
|
92
|
-
stdio:
|
|
87
|
+
stdio: streaming ? "inherit" : [
|
|
93
88
|
"ignore",
|
|
94
89
|
"pipe",
|
|
95
90
|
"pipe"
|
|
96
|
-
]
|
|
91
|
+
],
|
|
97
92
|
timeout: 6e5,
|
|
98
93
|
windowsHide: true
|
|
99
94
|
});
|
|
100
|
-
|
|
95
|
+
const raw = {
|
|
101
96
|
status: result.status,
|
|
102
|
-
stderr:
|
|
103
|
-
stdout:
|
|
97
|
+
stderr: streaming ? "" : result.stderr || "",
|
|
98
|
+
stdout: streaming ? "" : result.stdout || "",
|
|
104
99
|
signal: result.signal,
|
|
105
100
|
error: result.error?.message
|
|
106
101
|
};
|
|
102
|
+
if (streaming) return raw;
|
|
103
|
+
const decoded = decodeCloudflareOperationResult(raw);
|
|
104
|
+
if (!capture) {
|
|
105
|
+
if (decoded.stdout) process.stdout.write(decoded.stdout);
|
|
106
|
+
if (decoded.stderr) process.stderr.write(decoded.stderr);
|
|
107
|
+
}
|
|
108
|
+
return decoded;
|
|
107
109
|
};
|
|
108
110
|
}
|
|
109
111
|
/** Run a captured auth command without blocking terminal input or exposing credentials. */
|
|
110
|
-
function runCloudflareAuthCommand(root,
|
|
111
|
-
const [command, ...prefix] =
|
|
112
|
-
|
|
112
|
+
function runCloudflareAuthCommand(root, operation, signal) {
|
|
113
|
+
const [command, ...prefix] = resolveCloudflareOperationArgv(root);
|
|
114
|
+
const args = encodeCloudflareOperation(operation);
|
|
115
|
+
if (cloudflareAuthNeedsTerminal(operation)) return new Promise((resolve) => {
|
|
113
116
|
const child = spawn(command, [...prefix, ...args], {
|
|
114
117
|
cwd: root,
|
|
115
|
-
env: cloudflareAuthCommandEnvironment(
|
|
118
|
+
env: cloudflareAuthCommandEnvironment(operation),
|
|
116
119
|
shell: false,
|
|
117
120
|
signal,
|
|
118
121
|
stdio: "inherit",
|
|
@@ -140,29 +143,29 @@ function runCloudflareAuthCommand(root, args, signal) {
|
|
|
140
143
|
execFile(command, [...prefix, ...args], {
|
|
141
144
|
cwd: root,
|
|
142
145
|
encoding: "utf8",
|
|
143
|
-
env: cloudflareAuthCommandEnvironment(
|
|
146
|
+
env: cloudflareAuthCommandEnvironment(operation),
|
|
144
147
|
maxBuffer: 10485760,
|
|
145
148
|
shell: false,
|
|
146
149
|
signal,
|
|
147
150
|
timeout: 6e5,
|
|
148
151
|
windowsHide: true
|
|
149
152
|
}, (error, stdout, stderr) => {
|
|
150
|
-
resolve({
|
|
153
|
+
resolve(decodeCloudflareOperationResult({
|
|
151
154
|
status: error ? typeof error.code === "number" ? error.code : null : 0,
|
|
152
155
|
stderr,
|
|
153
156
|
stdout,
|
|
154
157
|
signal: error?.signal,
|
|
155
158
|
error: error?.message
|
|
156
|
-
});
|
|
159
|
+
}));
|
|
157
160
|
}).stdin?.end();
|
|
158
161
|
});
|
|
159
162
|
}
|
|
160
|
-
function cloudflareAuthCommandEnvironment(
|
|
163
|
+
function cloudflareAuthCommandEnvironment(operation, source = process.env) {
|
|
161
164
|
return cloudflareAuthEnvironment(source);
|
|
162
165
|
}
|
|
163
166
|
/** Browser login must display cf's prompts before it completes. */
|
|
164
|
-
function cloudflareAuthNeedsTerminal(
|
|
165
|
-
return
|
|
167
|
+
function cloudflareAuthNeedsTerminal(operation) {
|
|
168
|
+
return operation.type === "auth.login";
|
|
166
169
|
}
|
|
167
170
|
function cloudflareAuthEnvironment(source = process.env) {
|
|
168
171
|
const env = { ...source };
|
|
@@ -182,4 +185,4 @@ function isCleanExit(result) {
|
|
|
182
185
|
return result.status === 0 && result.signal == null && (result.error == null || result.error === "");
|
|
183
186
|
}
|
|
184
187
|
//#endregion
|
|
185
|
-
export {
|
|
188
|
+
export { parseCloudflareAuthSession as a, ensureCloudflareAuthentication as i, cloudflareCredentialOverrides as n, runCloudflareAuthCommand as o, createBundledCloudflareAuthRunner as r, CloudflareAuthenticationError as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as basename } from "./dist-BVqXeR_h.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { a as
|
|
2
|
+
import { y as readRootWranglerConfig } from "./wrangler-7K-bW_DL.mjs";
|
|
3
|
+
import { L as log } from "./prompts-BNUoTiaf.mjs";
|
|
4
|
+
import { a as parseCloudflareAuthSession, i as ensureCloudflareAuthentication, n as cloudflareCredentialOverrides, r as createBundledCloudflareAuthRunner } from "./cloudflare-auth-Qdc7tw8F.mjs";
|
|
5
5
|
//#region src/cli/cloudflare-cmd.ts
|
|
6
6
|
async function runCloudflareCommand(root, args) {
|
|
7
7
|
const runWrangler = createBundledCloudflareAuthRunner(root);
|
|
@@ -14,14 +14,14 @@ async function runCloudflareCommand(root, args) {
|
|
|
14
14
|
console.log("Successfully logged in.");
|
|
15
15
|
return;
|
|
16
16
|
case "status": {
|
|
17
|
-
const result = await runWrangler(
|
|
18
|
-
const session = result.status === 0 && !result.signal && !result.error ? parseCloudflareAuthSession(result.
|
|
17
|
+
const result = await runWrangler({ type: "auth.whoami" }, true);
|
|
18
|
+
const session = result.status === 0 && !result.signal && !result.error ? parseCloudflareAuthSession(result.data) : null;
|
|
19
19
|
if (!session) throw new Error("Not signed in to Cloudflare. Run `void cloudflare login`.");
|
|
20
20
|
log.info(formatSession(root, session));
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
case "logout": {
|
|
24
|
-
if ((await runWrangler(
|
|
24
|
+
if ((await runWrangler({ type: "auth.logout" }, true)).status !== 0) throw new Error("Could not remove the local Cloudflare browser session.");
|
|
25
25
|
const overrides = cloudflareCredentialOverrides();
|
|
26
26
|
if (overrides.length > 0) log.warn(`Removed the local Cloudflare browser session. Environment credentials remain active: ${overrides.join(", ")}.`);
|
|
27
27
|
else log.success("Signed out of Cloudflare.");
|