void 1.10.0 → 1.12.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/dist/{account-cmd-CZhbDfp4.mjs → account-cmd-D_0qJ9fx.mjs} +6 -6
- package/dist/{agents-DRo8gzni.mjs → agents-64FnLwxP.mjs} +6 -5
- package/dist/{application-analysis-Do1WaGAY.mjs → application-analysis-Cx2S63z5.mjs} +48 -22
- package/dist/{application-routing-DrOFahHO.mjs → application-routing-BAXpnawu.mjs} +1 -1
- package/dist/{assets-DZBd7yqh.mjs → assets-Br6_BeFJ.mjs} +34 -27
- package/dist/{ast-Cv0JwXqb.mjs → ast-BkPQu7A0.mjs} +5 -1
- package/dist/{auth-BN0NU9dz.mjs → auth-Boz0lrb3.mjs} +1 -1
- package/dist/{auth-CCk9Seol.mjs → auth-DlLDymuc.mjs} +24 -12
- package/dist/{auth-link-DFQTA1jN.mjs → auth-link-C97r9p2N.mjs} +6 -6
- package/dist/{auth-router-BOiaDmcQ.mjs → auth-router-BmzEgzYx.mjs} +5 -5
- package/dist/{better-auth-shared-BqsMzU14.d.mts → better-auth-shared-BS3pDQbT.d.mts} +11 -6
- package/dist/{better-auth-shared-DRHo5FoG.mjs → better-auth-shared-BcqDt-37.mjs} +7 -2
- package/dist/{build-cmd-BCiXgjn9.mjs → build-cmd-BaFsyZrz.mjs} +13 -12
- package/dist/{cache-CUulshOu.mjs → cache-xO711ATQ.mjs} +6 -6
- package/dist/{cancel-deploy-BHGZo6KC.mjs → cancel-deploy-Di11ynsr.mjs} +5 -5
- package/dist/{cf-access-pejlJmuy.mjs → cf-access-DmkKPcAI.mjs} +0 -8
- package/dist/{cf-access-Dnyw8KFY.mjs → cf-access-FaIm95jA.mjs} +8 -4
- package/dist/{cf-build-output-bBx1gDll.mjs → cf-build-output-Ca201_n1.mjs} +27 -25
- package/dist/cf-build-output-Dy7N0hQN.mjs +1 -0
- package/dist/{cf-command-values-Ccl-zRhl.mjs → cf-command-values-5BPBRc9Z.mjs} +1 -1
- package/dist/cf-config-migrate-D271BTiw.mjs +1664 -0
- package/dist/{cf-worker-settings-CARs4Wy9.mjs → cf-worker-settings-BBdlhm9U.mjs} +1 -1
- package/dist/cli/cli.mjs +1 -1
- package/dist/cli/cloudflare-operation-process.mjs +223 -16
- package/dist/cli/env-schema-probe.d.mts +3 -1
- package/dist/cli/env-schema-probe.mjs +7 -8
- package/dist/{cli-main-hM7rhIbB.mjs → cli-main-DlW6lB8s.mjs} +153 -91
- package/dist/{client-BEYbgqZw.mjs → client-DkYzDEC0.mjs} +1 -1
- package/dist/{client-aIv5UQf3.mjs → client-ImIe7Mjq.mjs} +192 -17
- package/dist/{cloudflare-auth-pNvmT6kL.mjs → cloudflare-auth-eWfhdZCk.mjs} +1 -1
- package/dist/{cloudflare-cmd-DLcgInCa.mjs → cloudflare-cmd-SsFlJe2B.mjs} +7 -8
- package/dist/{cloudflare-config-BfEfIEuY.mjs → cloudflare-config-D9UFH_A5.mjs} +2 -2
- package/dist/{cloudflare-connect-CMcKtA02.mjs → cloudflare-connect-BgpHcSg3.mjs} +3 -3
- package/dist/{cloudflare-operations-DLhn_Bom.mjs → cloudflare-operations-BF0PSErW.mjs} +40 -24
- package/dist/cloudflare-operations-dpRD-2Px.mjs +1 -0
- package/dist/cloudflare-process-60r4Z2Zf.mjs +671 -0
- package/dist/cloudflare-user-output-CCR99eQY.mjs +19 -0
- package/dist/collect-B6nlSnsb.mjs +1 -0
- package/dist/{collect-C6Blu9yw.mjs → collect-rNLybAnF.mjs} +3 -3
- package/dist/{config-Do7gJI3T.mjs → config-BFX5ZB1J.mjs} +5 -4
- package/dist/{config-CbKmMpHK.mjs → config-BSoW3QCB.mjs} +5 -5
- package/dist/{config-DuiDZbq7.d.mts → config-DA6ZbLXO.d.mts} +3 -1
- package/dist/{config-CtkCfPpv.mjs → config-DtjrUtPo.mjs} +1 -1
- package/dist/{config-qgt863GH.mjs → config-Dv5jri1-.mjs} +10 -6
- package/dist/config-entry.d.mts +1 -1
- package/dist/{connect-DM3yCNPG.mjs → connect-DDRQGfFE.mjs} +9 -9
- package/dist/{create-project-BkVGXGNt.mjs → create-project-CY7sP8sI.mjs} +7 -6
- package/dist/{create-project-C-hNdYvD.mjs → create-project-Dro3K-az.mjs} +1 -1
- package/dist/{db-DQAi7Ckr.mjs → db-DmlaWVBu.mjs} +166 -121
- package/dist/db-seed-loader-Bcz_SutQ.mjs +253 -0
- package/dist/{db-types-BpPYAx0B.mjs → db-types-B4Cf9dzR.mjs} +8 -2
- package/dist/{delete-BtVnPGO2.mjs → delete-Uuq9ch6o.mjs} +6 -6
- package/dist/{deploy-Cs93Af-d.mjs → deploy-B9E7_rHC.mjs} +235 -558
- package/dist/deploy-BB3rsZbP.mjs +2 -0
- package/dist/{deploy-managed-static-CZIx3cc1.mjs → deploy-managed-static-IKZyuc1W.mjs} +123 -198
- package/dist/deploy-security-notice-C3LalelR.mjs +192 -0
- package/dist/{deploy-transport-DT-ALuDj.mjs → deploy-transport-BKP_oV9q.mjs} +4 -4
- package/dist/deploy.mjs +10 -9
- package/dist/{dev-inbox-BiamQEAa.mjs → dev-inbox-ClVjKEHy.mjs} +1 -1
- package/dist/direct-r2-upload-DFXLWfXV.mjs +204 -0
- package/dist/discover-D2KGP3cR.mjs +1 -0
- package/dist/{discover-Vd18lHsj.mjs → discover-IcspacCg.mjs} +1 -1
- package/dist/{dispatch-DPEuEblR.mjs → dispatch-DIhDA3NI.mjs} +38 -17
- package/dist/{dist-Cp4b1_T9.mjs → dist-C47zy_kJ.mjs} +1 -1
- package/dist/{dist-STQXl8ck.mjs → dist-Cr_xGE_K.mjs} +73 -38
- package/dist/{domain-cOhYYiHU.mjs → domain-B_xY1yZ5.mjs} +8 -10
- package/dist/{dotenv-CEI8hapP.mjs → dotenv-BG6RQavH.mjs} +2 -2
- package/dist/{drizzle-DBSpPpU1.mjs → drizzle-BJDMPrj7.mjs} +35 -30
- package/dist/{drizzle-D4V_06-B.mjs → drizzle-CQ5jWuDL.mjs} +1 -1
- package/dist/{email-CnnDqvXV.mjs → email-BIC15L7a.mjs} +47 -32
- package/dist/{email-cloudflare-CCIoQueP.mjs → email-cloudflare-C447nOqq.mjs} +195 -109
- package/dist/{email-pattern-BYr-EFq5.mjs → email-pattern-bRna9MOJ.mjs} +2 -2
- package/dist/{entry-DMgR7XOf.mjs → entry-Bwb9ev8K.mjs} +13 -10
- package/dist/{env-5bphL5mV.mjs → env-DJPZYHT5.mjs} +8 -8
- package/dist/{env-UqS-21xi.mjs → env-EjHqc7m9.mjs} +1 -1
- package/dist/{env-types-WEZw5D-r.mjs → env-types-D2hBodXP.mjs} +2 -19
- package/dist/{env-validation-DfJ9Fzfa.mjs → env-validation-D-v5_CWL.mjs} +13 -13
- package/dist/{env-validation-ly_Q9Kgd.mjs → env-validation-j9pjCDfA.mjs} +1 -1
- package/dist/{error-pages-QNeBXiRR.mjs → error-pages-GORL6F_e.mjs} +1 -1
- package/dist/{fetch-CbI6lNnk.d.mts → fetch-CczQyIed.d.mts} +1 -1
- package/dist/{fetch-DdK9eGin.mjs → fetch-CiEsvjpP.mjs} +1 -1
- package/dist/{fetch-stream-DQAavFdm.mjs → fetch-stream-BIG5lHW6.mjs} +3 -4
- package/dist/{fetch-stream-DoED9atq.d.mts → fetch-stream-DRX8-83b.d.mts} +2 -2
- package/dist/gen-CQDiPi8m.mjs +1 -0
- package/dist/{gen-CjcH6DJS.mjs → gen-DiTZlDx8.mjs} +21 -18
- package/dist/{generate-BOp1g1H_.mjs → generate-C3ZAqCy-.mjs} +1 -1
- package/dist/{generate-CWb8aOsm.mjs → generate-Dq2Bgw75.mjs} +6 -6
- package/dist/{git-metadata-Cukp5kV5.mjs → git-metadata-BEokJ6US.mjs} +1 -1
- package/dist/{github-cmd-CVDLb51-.mjs → github-cmd-DPmby8x-.mjs} +14 -9
- package/dist/{handler-w_FAiIRu.mjs → handler-DCrDLzw2.mjs} +3 -3
- package/dist/has-own-key-D9QEnAkF.mjs +5 -0
- package/dist/{head-0o0QoREY.mjs → head-BwQ5kgqt.mjs} +5 -4
- package/dist/{head-CVO92KEx.d.mts → head-fUp8n_QJ.d.mts} +9 -4
- package/dist/{headers-Cyr87J6Z.mjs → headers-DqBsjDxg.mjs} +7 -7
- package/dist/{help-B1cH8518.mjs → help-9wfMyXHb.mjs} +146 -69
- package/dist/help-Dy3w4rPq.mjs +1 -0
- package/dist/{inbound-BHt4dIlL.d.mts → inbound-CwgZSqFI.d.mts} +9 -3
- package/dist/{inbound--OF7zkwX.mjs → inbound-feMn1Rxx.mjs} +7 -7
- package/dist/{index-CmqHYj2R.d.mts → index-8cAgNdb6.d.mts} +1 -1
- package/dist/{index-BTmhCDbw.d.mts → index-BQ5qYiAw.d.mts} +2 -2
- package/dist/{index-BESZTC1z.d.mts → index-BYcWajVp.d.mts} +2 -1
- package/dist/{index-BXdP39qx.d.mts → index-Dn2mkPr2.d.mts} +24 -23
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +351 -444
- package/dist/{info-BE3snw2_.mjs → info-BWEWaOBo.mjs} +4 -4
- package/dist/{init-BrS5MAiJ.mjs → init-BuTPVLPO.mjs} +737 -546
- package/dist/{isr-config-Czzb4mIq.mjs → isr-config-DiTnL9Tb.mjs} +5 -5
- package/dist/{link-BbzyrCBD.mjs → link-BiesPyT4.mjs} +7 -7
- package/dist/{list-DmppHjVc.mjs → list-CkonftPQ.mjs} +11 -7
- package/dist/{live-DvtxTUhW.mjs → live-dvGThbwy.mjs} +14 -17
- package/dist/{load-user-env-BltIJLtl.mjs → load-user-env-B8qC0Q2Y.mjs} +1 -1
- package/dist/{local-d1-DLxsKmkw.mjs → local-d1-CYOYkVwO.mjs} +3 -3
- package/dist/{login-Cihxnu7m.mjs → login-BSOSah1j.mjs} +8 -6
- package/dist/login-DWCZeCX9.mjs +1 -0
- package/dist/{logs-BCgLeLNd.mjs → logs-HOBUnroa.mjs} +9 -9
- package/dist/{migrate-DOK67gE-.mjs → migrate-BNZL1hee.mjs} +9 -10
- package/dist/migrate-C9aoWLvY.mjs +1 -0
- package/dist/{migrations-ByS7r3HV.mjs → migrations-CUHhX65Y.mjs} +15 -12
- package/dist/{mime-BGoZ8ZLL.mjs → mime-Btw9R3CC.mjs} +26 -12
- package/dist/{mysql-sql-SlpS6OMg.mjs → mysql-sql-CB52k8tQ.mjs} +45 -22
- package/dist/nitro.d.mts +3 -0
- package/dist/nitro.mjs +14 -5
- package/dist/{node-qXD3FbIU.mjs → node-DVJWfV6s.mjs} +6 -6
- package/dist/node-buffer-D7kgjaDs.mjs +4 -0
- package/dist/{operator-ai-logging-CNuX5uKg.mjs → operator-ai-logging-ZDqqhnIq.mjs} +11 -10
- package/dist/operator-args-DCkWbgT-.mjs +1499 -0
- package/dist/{operator-auth-CD3pap65.mjs → operator-auth-BjoPLgja.mjs} +2 -2
- package/dist/{operator-client-XvXTkea6.mjs → operator-client-DzebIntv.mjs} +3 -3
- package/dist/{operator-cmd-D0vSUVle.mjs → operator-cmd-AZoeI9Pl.mjs} +28 -12
- package/dist/operator-cmd-DEnHFmJF.mjs +1 -0
- package/dist/operator-security-Bo26FP01.mjs +263 -0
- package/dist/{output-DNVILSz2.mjs → output-BZLnu0z8.mjs} +39 -4
- package/dist/output-D7K9TWIA.mjs +1 -0
- package/dist/{package-json-DvS6IFRv.mjs → package-json-4xUI3xLz.mjs} +1 -1
- package/dist/pages/client.d.mts +53 -30
- package/dist/pages/client.mjs +93 -31
- package/dist/pages/head.d.mts +1 -1
- package/dist/pages/head.mjs +1 -1
- package/dist/pages/index.d.mts +2 -2
- package/dist/pages/index.mjs +7 -7
- package/dist/pages/islands-plugin.d.mts +26 -8
- package/dist/pages/islands-plugin.mjs +61 -22
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +1 -1
- package/dist/pages/serialize.mjs +1 -1
- package/dist/{pgpass-CEtnBOZO.mjs → pgpass-BLPoYN9_.mjs} +3 -2
- package/dist/platform-args-DNbNZ_RR.mjs +1 -0
- package/dist/{platform-args-DQSMW4EP.mjs → platform-args-lwCyQ6Xy.mjs} +37 -9
- package/dist/{platform-auth-config-V2ifSLQ-.mjs → platform-auth-config-DLRMPw1G.mjs} +26 -23
- package/dist/{platform-auth-protection-BybVCUzi.mjs → platform-auth-protection-HSmLmD3d.mjs} +10 -10
- package/dist/{platform-auth-recovery-kH1-h8Ch.mjs → platform-auth-recovery-BXPhTlKa.mjs} +11 -9
- package/dist/{platform-cmd-B1jtqXnu.mjs → platform-cmd-CqRjxFEU.mjs} +1 -1
- package/dist/{platform-cmd-BHWdh1Hx.mjs → platform-cmd-DJ-fOYhL.mjs} +11 -11
- package/dist/{platform-discovery-B0eZjZ3B.mjs → platform-discovery-CLxtixHJ.mjs} +1 -1
- package/dist/{platform-domain-DB_KpVhg.mjs → platform-domain-CRsRJOws.mjs} +14 -10
- package/dist/{platform-lifecycle-BoOTmH6H.mjs → platform-lifecycle-bx_kpqo7.mjs} +1 -1
- package/dist/{platform-lifecycle-C6fUuj4y.mjs → platform-lifecycle-fau3VKv6.mjs} +773 -206
- package/dist/platform-management-BRGhD-oF.mjs +1 -0
- package/dist/{platform-management-B8-pOxoJ.mjs → platform-management-CnKBdDx5.mjs} +227 -58
- package/dist/{platform-plans-config-iczSDkQK.mjs → platform-plans-config-2C3_5EDs.mjs} +112 -35
- package/dist/{platform-recovery-ZAXin6WK.mjs → platform-recovery-poxgOOAY.mjs} +5 -5
- package/dist/{platform-registry-DZ_2Xuqd.mjs → platform-registry-DHH6fivm.mjs} +6 -5
- package/dist/{platform-setup-CpcHLI-0.mjs → platform-setup-DYylapHD.mjs} +26 -12
- package/dist/{plugin-inference-BGamcCqB.mjs → plugin-inference-7O11_E4H.mjs} +26 -26
- package/dist/{prepare-BrAkXTTB.mjs → prepare-BbvlKreR.mjs} +12 -12
- package/dist/prepare-BmG2E6TI.mjs +1 -0
- package/dist/{prepare-Cjt6EM0d.mjs → prepare-DWjn1Lzd.mjs} +3 -3
- package/dist/{project-cmd-wtCuc8Ln.mjs → project-cmd-DyUEFi2b.mjs} +30 -24
- package/dist/{project-CLwxcEdq.mjs → project-dh9431bN.mjs} +2 -2
- package/dist/{project-paths-CUhCPMpK.mjs → project-paths-2ENfCCih.mjs} +4 -3
- package/dist/project-security--tYGFPGo.mjs +1340 -0
- package/dist/project-security-DZEQgnsS.mjs +1 -0
- package/dist/{project-team-CZFvPIJ-.mjs → project-team-BszTHgzC.mjs} +8 -8
- package/dist/{project-token-C3TxkWeC.mjs → project-token-DBDy4NdV.mjs} +6 -6
- package/dist/{project-tsconfig-MyRJgufB.mjs → project-tsconfig-BOA4ym99.mjs} +25 -5
- package/dist/{project-DVsTAWFh.mjs → project-uXKua1it.mjs} +1 -1
- package/dist/project-zero-trust-D9sUouij.mjs +210 -0
- package/dist/{protocol-W5EQcIzN.mjs → protocol-CE3wP-H1.mjs} +5 -5
- package/dist/{protocol-BlAiF-hc.d.mts → protocol-ERy-n3jf.d.mts} +7 -4
- package/dist/{provision-CknEbPuw.mjs → provision-Bh44omGA.mjs} +39 -29
- package/dist/provision-DFv7SJDn.mjs +1 -0
- package/dist/{public-B80SwOFp.d.mts → public-DB9C2Cy_.d.mts} +5 -2
- package/dist/{raw-7pQirZpQ.mjs → raw-5rak34QN.mjs} +2 -1
- package/dist/{redirect-Dqb4fEc5.mjs → redirect-DD825Stf.mjs} +1 -1
- package/dist/{requests-FaA9M3RX.mjs → requests-CBokjiOi.mjs} +6 -6
- package/dist/{resolve-project-Da3OgCU1.mjs → resolve-project-8WZ3iVmr.mjs} +3 -3
- package/dist/resolve-project-YsTH-U9I.mjs +1 -0
- package/dist/{rollback-DM6pZ23Y.mjs → rollback-CEeHNFUn.mjs} +16 -7
- package/dist/route-types-CSed9-Dp.mjs +435 -0
- package/dist/{route-url-BBdkU7rb.mjs → route-url-B41eQ8QI.mjs} +1 -1
- package/dist/{route-url-Di1kB8D_.d.mts → route-url-Bd6IX-JZ.d.mts} +2 -1
- package/dist/routes-stub.d.mts +1 -1
- package/dist/routes-stub.mjs +1 -1
- package/dist/{runner-CTk21HrO.mjs → runner-Bf94YVJK.mjs} +1 -1
- package/dist/{runner-CMZb7jNU.mjs → runner-CeguHWJx.mjs} +3 -2
- package/dist/{runner-mysql-CJ-HyqxV.mjs → runner-mysql-3XDKrn-g.mjs} +13 -9
- package/dist/{runner-mysql-C_PrAUTm.mjs → runner-mysql-r688x6Y9.mjs} +1 -1
- package/dist/{runner-pg-mYc75KfH.mjs → runner-pg-Buzw17hl.mjs} +1 -1
- package/dist/{runner-pg-2pjltt0t.mjs → runner-pg-DMJquR3d.mjs} +1 -1
- package/dist/runtime/ai/index.d.mts +1 -0
- package/dist/runtime/ai/index.mjs +26 -11
- package/dist/runtime/auth/better-auth-d1.d.mts +1 -1
- package/dist/runtime/auth/better-auth-d1.mjs +2 -2
- package/dist/runtime/auth/better-auth-mysql.d.mts +1 -1
- package/dist/runtime/auth/better-auth-mysql.mjs +2 -2
- package/dist/runtime/auth/better-auth-postgres.d.mts +1 -1
- package/dist/runtime/auth/better-auth-postgres.mjs +3 -3
- package/dist/runtime/client/fetch-server.d.mts +1 -1
- package/dist/runtime/client/fetch-server.mjs +2 -2
- package/dist/runtime/client/fetch-stream.d.mts +2 -2
- package/dist/runtime/client/fetch-stream.mjs +1 -1
- package/dist/runtime/client/fetch.d.mts +1 -1
- package/dist/runtime/client/fetch.mjs +1 -1
- package/dist/runtime/client/index.d.mts +2 -2
- package/dist/runtime/client/index.mjs +2 -2
- package/dist/runtime/client/react.d.mts +2 -2
- package/dist/runtime/client/react.mjs +2 -2
- package/dist/runtime/client/solid.d.mts +2 -2
- package/dist/runtime/client/solid.mjs +2 -2
- package/dist/runtime/client/svelte.d.mts +2 -2
- package/dist/runtime/client/svelte.mjs +2 -2
- package/dist/runtime/client/vue.d.mts +2 -2
- package/dist/runtime/client/vue.mjs +2 -2
- package/dist/runtime/db/index.d.mts +8 -2
- package/dist/runtime/db/index.mjs +21 -8
- package/dist/runtime/db/migrations/mysql-handler.mjs +1 -1
- package/dist/runtime/db/migrations/postgres-handler.mjs +1 -1
- package/dist/runtime/db/session.d.mts +2 -0
- package/dist/runtime/db/session.mjs +1 -0
- package/dist/runtime/durable/index.mjs +7 -5
- package/dist/runtime/email/index.d.mts +1 -1
- package/dist/runtime/email/index.mjs +14 -11
- package/dist/runtime/email/testing.d.mts +1 -1
- package/dist/runtime/email/testing.mjs +4 -4
- package/dist/runtime/env/public-client.d.mts +4 -1
- package/dist/runtime/env/public.d.mts +1 -1
- package/dist/runtime/env/public.mjs +2 -2
- package/dist/runtime/env/runtime.mjs +1 -1
- package/dist/runtime/handler/index.d.mts +1 -1
- package/dist/runtime/handler/index.mjs +1 -1
- package/dist/runtime/handler/validator.d.mts +1 -1
- package/dist/runtime/handler/validator.mjs +1 -1
- package/dist/runtime/isr/index.mjs +1 -1
- package/dist/runtime/kv/index.mjs +1 -1
- package/dist/runtime/live/client.d.mts +2 -2
- package/dist/runtime/live/client.mjs +7 -7
- package/dist/runtime/live/index.d.mts +1 -1
- package/dist/runtime/live/index.mjs +1 -1
- package/dist/runtime/live/server.mjs +3 -3
- package/dist/runtime/queues/index.mjs +2 -2
- package/dist/runtime/remote/index.d.mts +5 -1
- package/dist/runtime/remote/index.mjs +10 -9
- package/dist/runtime/routing/index.d.mts +11 -12
- package/dist/runtime/routing/index.mjs +69 -65
- package/dist/runtime/routing/route-url.d.mts +1 -1
- package/dist/runtime/routing/route-url.mjs +1 -1
- package/dist/runtime/sandbox/index.d.mts +1 -1
- package/dist/runtime/sandbox/index.mjs +2 -2
- package/dist/runtime/sse/client.d.mts +1 -1
- package/dist/runtime/sse/index.mjs +1 -1
- package/dist/runtime/storage/index.mjs +1 -1
- package/dist/runtime/ws/index.d.mts +1 -1
- package/dist/runtime/ws/index.mjs +3 -2
- package/dist/runtime/ws/room.d.mts +1 -1
- package/dist/runtime/ws/room.mjs +2 -2
- package/dist/runtime/ws/server.d.mts +2 -2
- package/dist/runtime/ws/server.mjs +1 -1
- package/dist/{runtime-zDDinDI5.mjs → runtime-C_VPIJBF.mjs} +1 -1
- package/dist/{scan-tDExXbA1.mjs → scan-Ct_SEzH4.mjs} +36 -29
- package/dist/{secret-DDNLIQOT.mjs → secret-Deqo3n_N.mjs} +11 -10
- package/dist/security-api-types-CU7zQtr_.mjs +9 -0
- package/dist/security-sarif-ClyYwtAW.mjs +123 -0
- package/dist/{serialize-Pf-CIQK_.mjs → serialize-BmB4BfKu.mjs} +1 -1
- package/dist/{server-CfUbeOjx.mjs → server-T-4mn8zy.mjs} +5 -4
- package/dist/session-BT8XDkvL.mjs +45 -0
- package/dist/session-ouZYD7zb.d.mts +18 -0
- package/dist/{skills-CoBB9_Ao.mjs → skills-C-csz78e.mjs} +10 -17
- package/dist/{sse-BXnTfcf3.mjs → sse-D3ab0YQT.mjs} +16 -13
- package/dist/{static-exports-DFkzL-NX.mjs → static-exports-s7P86Ngp.mjs} +3 -3
- package/dist/{subcommand-prompt-0yIARXf2.mjs → subcommand-prompt-B4LOLosl.mjs} +31 -21
- package/dist/sveltekit.mjs +1 -1
- package/dist/{terminal-log-text-DNsWJREL.mjs → terminal-log-text-CfS2JKM6.mjs} +1 -1
- package/dist/{url-DaehRGKR.mjs → url-DBQluotE.mjs} +4 -1
- package/dist/validate-CZYUIfR-.mjs +1 -0
- package/dist/{validate-Ddzl-IwT.mjs → validate-CtBWCzez.mjs} +7 -4
- package/dist/{validator-Duafcnh7.mjs → validator-Dfh9kCDm.mjs} +5 -5
- package/dist/{version-metadata-DEmItNdS.mjs → version-metadata-DqgLa6gc.mjs} +1 -1
- package/dist/{wrangler-D1zq1rXr.mjs → wrangler-DVe5KV5G.mjs} +49 -46
- package/dist/wrangler-Dq269bjx.mjs +1 -0
- package/dist/{wrapper-C2gMY432.mjs → wrapper-CcMYpOS8.mjs} +45 -171
- package/docs/guide/ai.md +13 -0
- package/docs/guide/app-types.md +1 -1
- package/docs/guide/auth.md +2 -16
- package/docs/guide/database/d1.md +283 -3
- package/docs/guide/database.md +2 -0
- package/docs/guide/email/domains.md +8 -6
- package/docs/guide/email/sending.md +18 -1
- package/docs/guide/pages-routing/actions-and-forms.md +4 -4
- package/docs/guide/pages-routing/head.md +20 -2
- package/docs/guide/platform/administration/plans.md +13 -0
- package/docs/guide/platform/administration/security-audits.md +213 -0
- package/docs/guide/platform/administration/zero-trust.md +6 -0
- package/docs/guide/platform/development/local.md +3 -5
- package/docs/guide/platform/installation/ci.md +1 -1
- package/docs/guide/platform/installation/credentials.md +23 -20
- package/docs/guide/platform/installation/maintenance.md +8 -2
- package/docs/guide/platform/installation/prerequisites.md +1 -1
- package/docs/guide/platform/installation/uninstall.md +2 -0
- package/docs/guide/platform-administration.md +1 -0
- package/docs/guide/self-hosted-platform.md +14 -13
- package/docs/guide/type-safety.md +1 -1
- package/docs/integrations/cloudflare.md +5 -3
- package/docs/reference/api/database.md +42 -2
- package/docs/reference/api/handlers.md +3 -3
- package/docs/reference/api/types.md +11 -1
- package/docs/reference/api.md +1 -1
- package/docs/reference/cli/database.md +6 -3
- package/docs/reference/cli/deploy.md +17 -13
- package/docs/reference/cli/domains.md +1 -1
- package/docs/reference/cli/email.md +3 -3
- package/docs/reference/cli/platform-config.md +5 -3
- package/docs/reference/cli/platform-installation.md +29 -28
- package/docs/reference/cli/platform-security.md +98 -0
- package/docs/reference/cli/platform-zero-trust.md +2 -0
- package/docs/reference/cli/platform.md +1 -0
- package/docs/reference/cli/project.md +57 -0
- package/docs/reference/cli.md +3 -1
- package/docs/reference/config.md +7 -6
- package/package.json +31 -27
- package/schema.json +7 -1
- package/skills/void/SKILL.md +8 -0
- package/dist/cf-build-output-D3_x71H6.mjs +0 -1
- package/dist/cf-config-migrate-CHtnM3_C.mjs +0 -348
- package/dist/cloudflare-operations-C5RTQNnh.mjs +0 -1
- package/dist/cloudflare-process-wcnaQ5JG.mjs +0 -392
- package/dist/cloudflare-user-output-zEwuGrEJ.mjs +0 -19
- package/dist/collect-8i0wU63d.mjs +0 -1
- package/dist/deploy-rUunHBNJ.mjs +0 -2
- package/dist/discover-Diq0l6TZ.mjs +0 -1
- package/dist/gen-BQ7itmK7.mjs +0 -1
- package/dist/help-Ld6XFol7.mjs +0 -1
- package/dist/login-C-n1rA0s.mjs +0 -1
- package/dist/migrate-CKn30rmw.mjs +0 -1
- package/dist/operator-args-BCCohcz3.mjs +0 -722
- package/dist/operator-cmd-BnLoIO2A.mjs +0 -1
- package/dist/output-BsdnNpxa.mjs +0 -1
- package/dist/platform-args-Rgp86xa7.mjs +0 -1
- package/dist/platform-management-7Bf_OgS5.mjs +0 -1
- package/dist/prepare-CI7_C9Xf.mjs +0 -1
- package/dist/project-zero-trust-DrRyAHW1.mjs +0 -64
- package/dist/provision-DdWqRmmr.mjs +0 -1
- package/dist/resolve-project-C5wC-Hoi.mjs +0 -1
- package/dist/route-types-CrODgORq.mjs +0 -655
- package/dist/validate-DY1U9rET.mjs +0 -1
- package/dist/wrangler-DM3GOqck.mjs +0 -1
|
@@ -0,0 +1,1340 @@
|
|
|
1
|
+
import { t as __commonJSMin } from "./rolldown-runtime-uD8oG6U2.mjs";
|
|
2
|
+
import { A as confirm, tt as isCancel } from "./dist-Cr_xGE_K.mjs";
|
|
3
|
+
import { t as hasOwnKey } from "./has-own-key-D9QEnAkF.mjs";
|
|
4
|
+
import { c as getToken, u as openBrowser } from "./auth-DlLDymuc.mjs";
|
|
5
|
+
import { n as PlatformApiError, r as PlatformClient } from "./client-ImIe7Mjq.mjs";
|
|
6
|
+
import { n as cleanBlock, r as cleanLine } from "./output-BZLnu0z8.mjs";
|
|
7
|
+
import { a as join } from "./dist-DMYe8CZJ.mjs";
|
|
8
|
+
import { o as uploadAssetsToR2, t as DirectR2PutError } from "./direct-r2-upload-DFXLWfXV.mjs";
|
|
9
|
+
import { r as readProjectConfig } from "./project-dh9431bN.mjs";
|
|
10
|
+
import { r as requireProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-8WZ3iVmr.mjs";
|
|
11
|
+
import { n as securityFindingsSarif, t as sarifToolVersion } from "./security-sarif-ClyYwtAW.mjs";
|
|
12
|
+
import { closeSync, lstatSync, openSync, readFileSync, readSync } from "node:fs";
|
|
13
|
+
import { createHash } from "node:crypto";
|
|
14
|
+
import { execFileSync } from "node:child_process";
|
|
15
|
+
import { securityPickProblemNote } from "@void/platform/security-models";
|
|
16
|
+
import { securityTraceLines } from "@void/platform/security-policy";
|
|
17
|
+
import { gzipSync } from "node:zlib";
|
|
18
|
+
import { SECURITY_LOCAL_CHECK_LIMITS, isSecurityLocalTreePath, securityInputFilter, securityLocalTreeTar } from "@void/platform/security-local-check";
|
|
19
|
+
// ../../node_modules/.pnpm/ci-info@4.5.0/node_modules/ci-info/vendors.json
|
|
20
|
+
var require_vendors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
21
|
+
module.exports = [
|
|
22
|
+
{
|
|
23
|
+
"name": "Agola CI",
|
|
24
|
+
"constant": "AGOLA",
|
|
25
|
+
"env": "AGOLA_GIT_REF",
|
|
26
|
+
"pr": "AGOLA_PULL_REQUEST_ID"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "Alpic",
|
|
30
|
+
"constant": "ALPIC",
|
|
31
|
+
"env": "ALPIC_HOST"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "Appcircle",
|
|
35
|
+
"constant": "APPCIRCLE",
|
|
36
|
+
"env": "AC_APPCIRCLE",
|
|
37
|
+
"pr": {
|
|
38
|
+
"env": "AC_GIT_PR",
|
|
39
|
+
"ne": "false"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "AppVeyor",
|
|
44
|
+
"constant": "APPVEYOR",
|
|
45
|
+
"env": "APPVEYOR",
|
|
46
|
+
"pr": "APPVEYOR_PULL_REQUEST_NUMBER"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "AWS CodeBuild",
|
|
50
|
+
"constant": "CODEBUILD",
|
|
51
|
+
"env": "CODEBUILD_BUILD_ARN",
|
|
52
|
+
"pr": {
|
|
53
|
+
"env": "CODEBUILD_WEBHOOK_EVENT",
|
|
54
|
+
"any": [
|
|
55
|
+
"PULL_REQUEST_CREATED",
|
|
56
|
+
"PULL_REQUEST_UPDATED",
|
|
57
|
+
"PULL_REQUEST_REOPENED"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "Azure Pipelines",
|
|
63
|
+
"constant": "AZURE_PIPELINES",
|
|
64
|
+
"env": "TF_BUILD",
|
|
65
|
+
"pr": { "BUILD_REASON": "PullRequest" }
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "Bamboo",
|
|
69
|
+
"constant": "BAMBOO",
|
|
70
|
+
"env": "bamboo_planKey"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "Bitbucket Pipelines",
|
|
74
|
+
"constant": "BITBUCKET",
|
|
75
|
+
"env": "BITBUCKET_COMMIT",
|
|
76
|
+
"pr": "BITBUCKET_PR_ID"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "Bitrise",
|
|
80
|
+
"constant": "BITRISE",
|
|
81
|
+
"env": "BITRISE_IO",
|
|
82
|
+
"pr": "BITRISE_PULL_REQUEST"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "Buddy",
|
|
86
|
+
"constant": "BUDDY",
|
|
87
|
+
"env": "BUDDY_WORKSPACE_ID",
|
|
88
|
+
"pr": "BUDDY_EXECUTION_PULL_REQUEST_ID"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "Buildkite",
|
|
92
|
+
"constant": "BUILDKITE",
|
|
93
|
+
"env": "BUILDKITE",
|
|
94
|
+
"pr": {
|
|
95
|
+
"env": "BUILDKITE_PULL_REQUEST",
|
|
96
|
+
"ne": "false"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"name": "Capawesome Cloud",
|
|
101
|
+
"constant": "CAPAWESOME_CLOUD",
|
|
102
|
+
"env": "CAPAWESOME_CLOUD"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "CircleCI",
|
|
106
|
+
"constant": "CIRCLE",
|
|
107
|
+
"env": "CIRCLECI",
|
|
108
|
+
"pr": "CIRCLE_PULL_REQUEST"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "Cirrus CI",
|
|
112
|
+
"constant": "CIRRUS",
|
|
113
|
+
"env": "CIRRUS_CI",
|
|
114
|
+
"pr": "CIRRUS_PR"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"name": "Cloudflare Pages",
|
|
118
|
+
"constant": "CLOUDFLARE_PAGES",
|
|
119
|
+
"env": "CF_PAGES"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "Cloudflare Workers",
|
|
123
|
+
"constant": "CLOUDFLARE_WORKERS",
|
|
124
|
+
"env": "WORKERS_CI"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "Codefresh",
|
|
128
|
+
"constant": "CODEFRESH",
|
|
129
|
+
"env": "CF_BUILD_ID",
|
|
130
|
+
"pr": { "any": ["CF_PULL_REQUEST_NUMBER", "CF_PULL_REQUEST_ID"] }
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"name": "Codemagic",
|
|
134
|
+
"constant": "CODEMAGIC",
|
|
135
|
+
"env": "CM_BUILD_ID",
|
|
136
|
+
"pr": "CM_PULL_REQUEST"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "Codeship",
|
|
140
|
+
"constant": "CODESHIP",
|
|
141
|
+
"env": { "CI_NAME": "codeship" }
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"name": "Drone",
|
|
145
|
+
"constant": "DRONE",
|
|
146
|
+
"env": "DRONE",
|
|
147
|
+
"pr": { "DRONE_BUILD_EVENT": "pull_request" }
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"name": "dsari",
|
|
151
|
+
"constant": "DSARI",
|
|
152
|
+
"env": "DSARI"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "Earthly",
|
|
156
|
+
"constant": "EARTHLY",
|
|
157
|
+
"env": "EARTHLY_CI"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"name": "Expo Application Services",
|
|
161
|
+
"constant": "EAS",
|
|
162
|
+
"env": "EAS_BUILD"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"name": "Gerrit",
|
|
166
|
+
"constant": "GERRIT",
|
|
167
|
+
"env": "GERRIT_PROJECT"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"name": "Gitea Actions",
|
|
171
|
+
"constant": "GITEA_ACTIONS",
|
|
172
|
+
"env": "GITEA_ACTIONS"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"name": "GitHub Actions",
|
|
176
|
+
"constant": "GITHUB_ACTIONS",
|
|
177
|
+
"env": "GITHUB_ACTIONS",
|
|
178
|
+
"pr": { "GITHUB_EVENT_NAME": "pull_request" }
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"name": "GitLab CI",
|
|
182
|
+
"constant": "GITLAB",
|
|
183
|
+
"env": "GITLAB_CI",
|
|
184
|
+
"pr": "CI_MERGE_REQUEST_ID"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"name": "GoCD",
|
|
188
|
+
"constant": "GOCD",
|
|
189
|
+
"env": "GO_PIPELINE_LABEL"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"name": "Google Cloud Build",
|
|
193
|
+
"constant": "GOOGLE_CLOUD_BUILD",
|
|
194
|
+
"env": "BUILDER_OUTPUT"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"name": "Harness CI",
|
|
198
|
+
"constant": "HARNESS",
|
|
199
|
+
"env": "HARNESS_BUILD_ID"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"name": "Heroku",
|
|
203
|
+
"constant": "HEROKU",
|
|
204
|
+
"env": {
|
|
205
|
+
"env": "NODE",
|
|
206
|
+
"includes": "/app/.heroku/node/bin/node"
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"name": "Hudson",
|
|
211
|
+
"constant": "HUDSON",
|
|
212
|
+
"env": "HUDSON_URL"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"name": "Jenkins",
|
|
216
|
+
"constant": "JENKINS",
|
|
217
|
+
"env": ["JENKINS_URL", "BUILD_ID"],
|
|
218
|
+
"pr": { "any": ["ghprbPullId", "CHANGE_ID"] }
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"name": "LayerCI",
|
|
222
|
+
"constant": "LAYERCI",
|
|
223
|
+
"env": "LAYERCI",
|
|
224
|
+
"pr": "LAYERCI_PULL_REQUEST"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"name": "Magnum CI",
|
|
228
|
+
"constant": "MAGNUM",
|
|
229
|
+
"env": "MAGNUM"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"name": "Netlify CI",
|
|
233
|
+
"constant": "NETLIFY",
|
|
234
|
+
"env": "NETLIFY",
|
|
235
|
+
"pr": {
|
|
236
|
+
"env": "PULL_REQUEST",
|
|
237
|
+
"ne": "false"
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"name": "Nevercode",
|
|
242
|
+
"constant": "NEVERCODE",
|
|
243
|
+
"env": "NEVERCODE",
|
|
244
|
+
"pr": {
|
|
245
|
+
"env": "NEVERCODE_PULL_REQUEST",
|
|
246
|
+
"ne": "false"
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"name": "Prow",
|
|
251
|
+
"constant": "PROW",
|
|
252
|
+
"env": "PROW_JOB_ID"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"name": "ReleaseHub",
|
|
256
|
+
"constant": "RELEASEHUB",
|
|
257
|
+
"env": "RELEASE_BUILD_ID"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"name": "Render",
|
|
261
|
+
"constant": "RENDER",
|
|
262
|
+
"env": "RENDER",
|
|
263
|
+
"pr": { "IS_PULL_REQUEST": "true" }
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"name": "RWX",
|
|
267
|
+
"constant": "RWX",
|
|
268
|
+
"env": "RWX"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"name": "Sail CI",
|
|
272
|
+
"constant": "SAIL",
|
|
273
|
+
"env": "SAILCI",
|
|
274
|
+
"pr": "SAIL_PULL_REQUEST_NUMBER"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"name": "Screwdriver",
|
|
278
|
+
"constant": "SCREWDRIVER",
|
|
279
|
+
"env": "SCREWDRIVER",
|
|
280
|
+
"pr": {
|
|
281
|
+
"env": "SD_PULL_REQUEST",
|
|
282
|
+
"ne": "false"
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"name": "Semaphore",
|
|
287
|
+
"constant": "SEMAPHORE",
|
|
288
|
+
"env": "SEMAPHORE",
|
|
289
|
+
"pr": "PULL_REQUEST_NUMBER"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"name": "Sourcehut",
|
|
293
|
+
"constant": "SOURCEHUT",
|
|
294
|
+
"env": { "CI_NAME": "sourcehut" }
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"name": "Strider CD",
|
|
298
|
+
"constant": "STRIDER",
|
|
299
|
+
"env": "STRIDER"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"name": "TaskCluster",
|
|
303
|
+
"constant": "TASKCLUSTER",
|
|
304
|
+
"env": ["TASK_ID", "RUN_ID"]
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"name": "TeamCity",
|
|
308
|
+
"constant": "TEAMCITY",
|
|
309
|
+
"env": "TEAMCITY_VERSION"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"name": "Travis CI",
|
|
313
|
+
"constant": "TRAVIS",
|
|
314
|
+
"env": "TRAVIS",
|
|
315
|
+
"pr": {
|
|
316
|
+
"env": "TRAVIS_PULL_REQUEST",
|
|
317
|
+
"ne": "false"
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"name": "Vela",
|
|
322
|
+
"constant": "VELA",
|
|
323
|
+
"env": "VELA",
|
|
324
|
+
"pr": { "VELA_PULL_REQUEST": "1" }
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"name": "Vercel",
|
|
328
|
+
"constant": "VERCEL",
|
|
329
|
+
"env": { "any": ["NOW_BUILDER", "VERCEL"] },
|
|
330
|
+
"pr": "VERCEL_GIT_PULL_REQUEST_ID"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"name": "Visual Studio App Center",
|
|
334
|
+
"constant": "APPCENTER",
|
|
335
|
+
"env": "APPCENTER_BUILD_ID"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"name": "Woodpecker",
|
|
339
|
+
"constant": "WOODPECKER",
|
|
340
|
+
"env": { "CI": "woodpecker" },
|
|
341
|
+
"pr": { "CI_BUILD_EVENT": "pull_request" }
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"name": "Xcode Cloud",
|
|
345
|
+
"constant": "XCODE_CLOUD",
|
|
346
|
+
"env": "CI_XCODE_PROJECT",
|
|
347
|
+
"pr": "CI_PULL_REQUEST_NUMBER"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"name": "Xcode Server",
|
|
351
|
+
"constant": "XCODE_SERVER",
|
|
352
|
+
"env": "XCS"
|
|
353
|
+
}
|
|
354
|
+
];
|
|
355
|
+
}));
|
|
356
|
+
// ../../node_modules/.pnpm/ci-info@4.5.0/node_modules/ci-info/index.js
|
|
357
|
+
var require_ci_info = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
358
|
+
const vendors = require_vendors();
|
|
359
|
+
const env = process.env;
|
|
360
|
+
Object.defineProperty(exports, "_vendors", { value: vendors.map(function(v) {
|
|
361
|
+
return v.constant;
|
|
362
|
+
}) });
|
|
363
|
+
exports.name = null;
|
|
364
|
+
exports.isPR = null;
|
|
365
|
+
exports.id = null;
|
|
366
|
+
if (env.CI !== "false") vendors.forEach(function(vendor) {
|
|
367
|
+
const isCI = (Array.isArray(vendor.env) ? vendor.env : [vendor.env]).every(function(obj) {
|
|
368
|
+
return checkEnv(obj);
|
|
369
|
+
});
|
|
370
|
+
exports[vendor.constant] = isCI;
|
|
371
|
+
if (!isCI) return;
|
|
372
|
+
exports.name = vendor.name;
|
|
373
|
+
exports.isPR = checkPR(vendor);
|
|
374
|
+
exports.id = vendor.constant;
|
|
375
|
+
});
|
|
376
|
+
exports.isCI = !!(env.CI !== "false" && (env.BUILD_ID || env.BUILD_NUMBER || env.CI || env.CI_APP_ID || env.CI_BUILD_ID || env.CI_BUILD_NUMBER || env.CI_NAME || env.CONTINUOUS_INTEGRATION || env.RUN_ID || exports.name || false));
|
|
377
|
+
function checkEnv(obj) {
|
|
378
|
+
if (typeof obj === "string") return !!env[obj];
|
|
379
|
+
if ("env" in obj) return env[obj.env] && env[obj.env].includes(obj.includes);
|
|
380
|
+
if ("any" in obj) return obj.any.some(function(k) {
|
|
381
|
+
return !!env[k];
|
|
382
|
+
});
|
|
383
|
+
return Object.keys(obj).every(function(k) {
|
|
384
|
+
return env[k] === obj[k];
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
function checkPR(vendor) {
|
|
388
|
+
switch (typeof vendor.pr) {
|
|
389
|
+
case "string": return !!env[vendor.pr];
|
|
390
|
+
case "object": if ("env" in vendor.pr) {
|
|
391
|
+
if ("any" in vendor.pr) return vendor.pr.any.some(function(key) {
|
|
392
|
+
return env[vendor.pr.env] === key;
|
|
393
|
+
});
|
|
394
|
+
else return vendor.pr.env in env && env[vendor.pr.env] !== vendor.pr.ne;
|
|
395
|
+
} else if ("any" in vendor.pr) return vendor.pr.any.some(function(key) {
|
|
396
|
+
return !!env[key];
|
|
397
|
+
});
|
|
398
|
+
else return checkEnv(vendor.pr);
|
|
399
|
+
default: return null;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}));
|
|
403
|
+
// src/cli/project-security-check.ts
|
|
404
|
+
var import_ci_info = require_ci_info();
|
|
405
|
+
/**
|
|
406
|
+
* `void project security check` (design doc 0095 M32): only git-tracked files that pass
|
|
407
|
+
* the platform's input filter leave the machine (tar + gzip, one presigned upload).
|
|
408
|
+
*/
|
|
409
|
+
/** Secret-like file names listed before the upload, at most. */
|
|
410
|
+
const LISTED_SECRET_FILES = 5;
|
|
411
|
+
/** How often the CLI asks for the result, and for how long. */
|
|
412
|
+
const SECURITY_CHECK_POLL_MS = 5e3;
|
|
413
|
+
const SECURITY_CHECK_WAIT_MS = 36e5;
|
|
414
|
+
const ENDED_WITH_RESULT = /* @__PURE__ */ new Set(["succeeded", "incomplete"]);
|
|
415
|
+
/** Tracked files under `root`, relative to it (git prints them so with `-z`, unquoted). */
|
|
416
|
+
function listTrackedFiles(root) {
|
|
417
|
+
try {
|
|
418
|
+
return execFileSync("git", [
|
|
419
|
+
"ls-files",
|
|
420
|
+
"-z",
|
|
421
|
+
"--cached",
|
|
422
|
+
"--",
|
|
423
|
+
"."
|
|
424
|
+
], {
|
|
425
|
+
cwd: root,
|
|
426
|
+
encoding: "utf8",
|
|
427
|
+
stdio: [
|
|
428
|
+
"ignore",
|
|
429
|
+
"pipe",
|
|
430
|
+
"ignore"
|
|
431
|
+
],
|
|
432
|
+
maxBuffer: 67108864
|
|
433
|
+
}).split("\0").filter((path) => path.length > 0);
|
|
434
|
+
} catch {
|
|
435
|
+
throw new Error("project: void project security check sends only git-tracked files, and this folder is not in a git repository. Run `git init` and `git add` your code first.");
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
const NUL_SNIFF_BYTES = 8192;
|
|
439
|
+
function hasNul(data) {
|
|
440
|
+
const end = Math.min(data.length, NUL_SNIFF_BYTES);
|
|
441
|
+
for (let index = 0; index < end; index++) if (data[index] === 0) return true;
|
|
442
|
+
return false;
|
|
443
|
+
}
|
|
444
|
+
/** The first bytes of a file, to tell a binary without reading all of it. */
|
|
445
|
+
function readHead(full) {
|
|
446
|
+
const fd = openSync(full, "r");
|
|
447
|
+
try {
|
|
448
|
+
const head = new Uint8Array(NUL_SNIFF_BYTES);
|
|
449
|
+
return head.subarray(0, readSync(fd, head, 0, NUL_SNIFF_BYTES, 0));
|
|
450
|
+
} finally {
|
|
451
|
+
closeSync(fd);
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
const MB = 1048576;
|
|
455
|
+
function tooManyFiles(count) {
|
|
456
|
+
const max = SECURITY_LOCAL_CHECK_LIMITS.maxFiles;
|
|
457
|
+
return /* @__PURE__ */ new Error(`project: A security check sends at most ${max.toLocaleString("en-US")} files, and this folder has ${count.toLocaleString("en-US")} or more. Run it from the app's folder.`);
|
|
458
|
+
}
|
|
459
|
+
function tooManyBytes(bytes) {
|
|
460
|
+
return /* @__PURE__ */ new Error(`project: A security check sends at most ${SECURITY_LOCAL_CHECK_LIMITS.maxBytes / MB} MB of code, and this folder has ${(bytes / MB).toFixed(1)} MB or more. Run it from the app's folder.`);
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* A tracked file to send: `null` when there is nothing to send (deleted, a submodule
|
|
464
|
+
* folder, a symlink, unreadable, a binary over the room left), its `size` when it is
|
|
465
|
+
* bigger than `room`, known from its size on disk before the file is read.
|
|
466
|
+
*/
|
|
467
|
+
function readTrackedFile(full, room) {
|
|
468
|
+
try {
|
|
469
|
+
const stat = lstatSync(full);
|
|
470
|
+
if (!stat.isFile()) return null;
|
|
471
|
+
if (stat.size > room) return hasNul(readHead(full)) ? null : { size: stat.size };
|
|
472
|
+
return readFileSync(full);
|
|
473
|
+
} catch {
|
|
474
|
+
return null;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* The git-tracked files under `root`, as they are on disk now (edits included), with
|
|
479
|
+
* the files the platform would never read left out. Throws past the check's limits,
|
|
480
|
+
* from the sizes on disk, before a file over them is read.
|
|
481
|
+
*/
|
|
482
|
+
function collectSecurityLocalTree(root, listFiles = listTrackedFiles) {
|
|
483
|
+
const tree = {
|
|
484
|
+
files: [],
|
|
485
|
+
bytes: 0,
|
|
486
|
+
secret: [],
|
|
487
|
+
skipped: 0
|
|
488
|
+
};
|
|
489
|
+
const limits = SECURITY_LOCAL_CHECK_LIMITS;
|
|
490
|
+
for (const path of listFiles(root)) {
|
|
491
|
+
const filter = securityInputFilter(path);
|
|
492
|
+
if (filter === "secret") {
|
|
493
|
+
tree.secret.push(path);
|
|
494
|
+
continue;
|
|
495
|
+
}
|
|
496
|
+
if (filter === "skipped" || !isSecurityLocalTreePath(path)) {
|
|
497
|
+
tree.skipped++;
|
|
498
|
+
continue;
|
|
499
|
+
}
|
|
500
|
+
const data = readTrackedFile(join(root, path), limits.maxBytes - tree.bytes);
|
|
501
|
+
if (data === null) {
|
|
502
|
+
tree.skipped++;
|
|
503
|
+
continue;
|
|
504
|
+
}
|
|
505
|
+
if (!(data instanceof Uint8Array)) throw tooManyBytes(tree.bytes + data.size);
|
|
506
|
+
if (hasNul(data)) {
|
|
507
|
+
tree.skipped++;
|
|
508
|
+
continue;
|
|
509
|
+
}
|
|
510
|
+
if (tree.files.length >= limits.maxFiles) throw tooManyFiles(tree.files.length + 1);
|
|
511
|
+
tree.files.push({
|
|
512
|
+
path,
|
|
513
|
+
data
|
|
514
|
+
});
|
|
515
|
+
tree.bytes += data.length;
|
|
516
|
+
}
|
|
517
|
+
if (tree.bytes > limits.maxBytes) throw tooManyBytes(tree.bytes);
|
|
518
|
+
return tree;
|
|
519
|
+
}
|
|
520
|
+
function packSecurityLocalTree(tree) {
|
|
521
|
+
const archive = gzipSync(securityLocalTreeTar(tree.files));
|
|
522
|
+
return {
|
|
523
|
+
archive,
|
|
524
|
+
request: {
|
|
525
|
+
files: tree.files.length,
|
|
526
|
+
bytes: tree.bytes,
|
|
527
|
+
size: archive.length,
|
|
528
|
+
md5: createHash("md5").update(archive).digest("hex")
|
|
529
|
+
}
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
function size(bytes) {
|
|
533
|
+
return bytes < 1048576 ? `${Math.max(1, Math.round(bytes / 1024))} KB` : `${(bytes / MB).toFixed(1)} MB`;
|
|
534
|
+
}
|
|
535
|
+
function plural(count, word) {
|
|
536
|
+
return `${count.toLocaleString("en-US")} ${word}${count === 1 ? "" : "s"}`;
|
|
537
|
+
}
|
|
538
|
+
/** What is sent and what is not, before the question. */
|
|
539
|
+
function checkSummaryLines(slug, tree) {
|
|
540
|
+
const lines = [`Security check of ${slug}: ${plural(tree.files.length, "git-tracked file")} (${size(tree.bytes)}) from this folder.`];
|
|
541
|
+
if (tree.secret.length > 0) {
|
|
542
|
+
const shown = tree.secret.slice(0, LISTED_SECRET_FILES).map(cleanLine).join(", ");
|
|
543
|
+
const more = tree.secret.length > LISTED_SECRET_FILES ? `, and ${tree.secret.length - LISTED_SECRET_FILES} more` : "";
|
|
544
|
+
lines.push(` Not sent: ${plural(tree.secret.length, "secret-like file")} (${shown}${more}).`);
|
|
545
|
+
}
|
|
546
|
+
if (tree.skipped > 0) lines.push(` Not sent: ${plural(tree.skipped, "other file")} (lockfiles, generated files, binaries, media).`);
|
|
547
|
+
lines.push(" Untracked files are not sent. Add them with git add to include them.");
|
|
548
|
+
return lines;
|
|
549
|
+
}
|
|
550
|
+
const SEVERITY_LABEL = {
|
|
551
|
+
critical: "CRITICAL",
|
|
552
|
+
high: "HIGH",
|
|
553
|
+
medium: "MEDIUM",
|
|
554
|
+
low: "LOW",
|
|
555
|
+
informational: "INFO"
|
|
556
|
+
};
|
|
557
|
+
/**
|
|
558
|
+
* The ended check: one line per finding, confirmed first, then leads. `fresh`: the
|
|
559
|
+
* check just ran, so a missing result is a fault, not the 30-day limit.
|
|
560
|
+
*/
|
|
561
|
+
function checkResultLines(slug, view, options = {}) {
|
|
562
|
+
const { check, result } = view;
|
|
563
|
+
const head = [`${slug} · local check ${cleanLine(check.id)}`, ` ${cleanLine(check.status)}${check.statusReason ? ` (${cleanLine(check.statusReason)})` : ""}${check.coverageLabel ? ` · ${cleanLine(check.coverageLabel)}` : ""} · ${plural(check.filesScanned, "file")}${check.model ? ` · ${cleanLine(check.model)}` : ""}`];
|
|
564
|
+
if (!ENDED_WITH_RESULT.has(check.status)) return head;
|
|
565
|
+
if (result === null) return [...head, options.fresh ? " The result is missing." : " The result is no longer stored (results are kept for 30 days)."];
|
|
566
|
+
const confirmed = result.findings.filter((finding) => finding.verdict === "confirmed");
|
|
567
|
+
const leads = result.findings.filter((finding) => finding.verdict !== "confirmed");
|
|
568
|
+
const lines = [...head];
|
|
569
|
+
if (result.findings.length === 0) lines.push(" No security issues found.");
|
|
570
|
+
else {
|
|
571
|
+
const bySeverity = /* @__PURE__ */ new Map();
|
|
572
|
+
for (const finding of confirmed) {
|
|
573
|
+
const key = finding.severity ?? "informational";
|
|
574
|
+
bySeverity.set(key, (bySeverity.get(key) ?? 0) + 1);
|
|
575
|
+
}
|
|
576
|
+
const counts = [...bySeverity.entries()].map(([severity, count]) => `${count} ${severity}`).join(", ");
|
|
577
|
+
lines.push(` ${plural(confirmed.length, "finding")}${counts ? ` (${counts})` : ""} · ${plural(leads.length, "lead")}`);
|
|
578
|
+
for (const finding of [...confirmed, ...leads]) {
|
|
579
|
+
const severity = finding.severity;
|
|
580
|
+
const label = finding.verdict !== "confirmed" ? "LEAD" : severity !== null && hasOwnKey(SEVERITY_LABEL, severity) ? SEVERITY_LABEL[severity] : "INFO";
|
|
581
|
+
const place = `${cleanLine(finding.file)}${finding.lineStart === null ? "" : `:${finding.lineStart}`}`;
|
|
582
|
+
lines.push(` ${label.padEnd(9)} ${cleanLine(finding.title)}`, ` ${" ".repeat(9)} ${place}`);
|
|
583
|
+
}
|
|
584
|
+
if (result.capped) lines.push(` Showing ${result.findings.length} of ${result.total}.`);
|
|
585
|
+
}
|
|
586
|
+
if (check.status === "incomplete") lines.push(" The check stopped early: only confirmed findings it reached are listed.");
|
|
587
|
+
lines.push(" Not saved as project findings. The platform keeps this result for 30 days. Details: --json");
|
|
588
|
+
return lines;
|
|
589
|
+
}
|
|
590
|
+
/** Why an ended check has no result, and what to do. */
|
|
591
|
+
function checkFailureMessage(view, options = {}) {
|
|
592
|
+
const { check } = view;
|
|
593
|
+
const reason = cleanLine(check.statusReason ?? "unknown");
|
|
594
|
+
switch (check.status) {
|
|
595
|
+
case "succeeded":
|
|
596
|
+
case "incomplete": return options.fresh ? "project: The check ended, but its result could not be read. Run it again." : "project: The result of this check is no longer stored (results are kept for 30 days). Run a new check.";
|
|
597
|
+
case "refused": return `project: The check was refused by ${cleanLine(check.model ?? "the scan model")} (category: ${cleanLine(check.refusalCategory ?? "unknown")}). Pick another model with void project security model <id>, then run the check again.`;
|
|
598
|
+
case "timed_out": return "project: The check timed out. Run it again, or from a smaller folder.";
|
|
599
|
+
case "skipped": return reason === "budget" ? "project: The check did not run: the monthly scan budget is used up." : `project: The check did not run (${reason}).`;
|
|
600
|
+
case "canceled": return reason === "upload_replaced" ? "project: The check was replaced by a newer one before its code was uploaded." : `project: The check was canceled (${reason}).`;
|
|
601
|
+
default: return check.failureCause === "installation" ? "project: The check failed because of a platform problem. Your platform admin can see it in the admin panel." : `project: The check failed (${reason}). Run it again.`;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
/** Upload, start, and return the check id. */
|
|
605
|
+
async function sendSecurityLocalCheck(client, projectId, packed, deps = {}) {
|
|
606
|
+
const created = await client.createProjectSecurityCheck(projectId, packed.request);
|
|
607
|
+
try {
|
|
608
|
+
await uploadAssetsToR2([{
|
|
609
|
+
path: "security check archive",
|
|
610
|
+
hash: packed.request.md5,
|
|
611
|
+
body: packed.archive,
|
|
612
|
+
url: created.upload.url,
|
|
613
|
+
headers: created.upload.headers
|
|
614
|
+
}], void 0, deps.fetch ?? fetch);
|
|
615
|
+
} catch (error) {
|
|
616
|
+
if (!(error instanceof DirectR2PutError && error.status === 412)) throw error;
|
|
617
|
+
}
|
|
618
|
+
await client.startProjectSecurityCheck(projectId, created.checkId);
|
|
619
|
+
return created.checkId;
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
* Polls until the check ends or the wait is over. `onState` hears each new state
|
|
623
|
+
* (queued, running) once. `null` when the wait ran out.
|
|
624
|
+
*/
|
|
625
|
+
async function waitForSecurityLocalCheck(client, projectId, checkId, onState, deps = {}) {
|
|
626
|
+
const sleep = deps.sleep ?? ((ms) => new Promise((done) => {
|
|
627
|
+
setTimeout(done, ms);
|
|
628
|
+
}));
|
|
629
|
+
const now = deps.now ?? Date.now;
|
|
630
|
+
const until = now() + SECURITY_CHECK_WAIT_MS;
|
|
631
|
+
let last = "";
|
|
632
|
+
for (;;) {
|
|
633
|
+
const view = await client.getProjectSecurityCheck(projectId, checkId);
|
|
634
|
+
if (view.ended) return view;
|
|
635
|
+
if (view.check.status !== last) {
|
|
636
|
+
last = view.check.status;
|
|
637
|
+
onState(last);
|
|
638
|
+
}
|
|
639
|
+
if (now() >= until) return null;
|
|
640
|
+
await sleep(SECURITY_CHECK_POLL_MS);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
function checkEndedWithResult(view) {
|
|
644
|
+
return ENDED_WITH_RESULT.has(view.check.status) && view.result !== null;
|
|
645
|
+
}
|
|
646
|
+
// src/cli/project-security.ts
|
|
647
|
+
const usd = (value) => `$${value.toFixed(2)}`;
|
|
648
|
+
function day(iso) {
|
|
649
|
+
const time = iso ? Date.parse(iso) : NaN;
|
|
650
|
+
return Number.isNaN(time) ? "-" : new Date(time).toLocaleDateString("en-US", {
|
|
651
|
+
month: "short",
|
|
652
|
+
day: "numeric",
|
|
653
|
+
timeZone: "UTC"
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
function stamp(iso) {
|
|
657
|
+
const time = iso ? Date.parse(iso) : NaN;
|
|
658
|
+
return Number.isNaN(time) ? "-" : `${day(iso)}, ${new Date(time).toISOString().slice(11, 16)} UTC`;
|
|
659
|
+
}
|
|
660
|
+
function duration(scan) {
|
|
661
|
+
const start = scan.startedAt ? Date.parse(scan.startedAt) : NaN;
|
|
662
|
+
const end = scan.finishedAt ? Date.parse(scan.finishedAt) : NaN;
|
|
663
|
+
if (Number.isNaN(start) || Number.isNaN(end) || end < start) return null;
|
|
664
|
+
const minutes = Math.round((end - start) / 6e4);
|
|
665
|
+
return minutes < 1 ? "<1 min" : minutes < 60 ? `${minutes} min` : `${Math.floor(minutes / 60)} h ${minutes % 60} min`;
|
|
666
|
+
}
|
|
667
|
+
const BUDGET_CAUSES = [
|
|
668
|
+
"project_cap",
|
|
669
|
+
"platform_cap",
|
|
670
|
+
"project_reserve",
|
|
671
|
+
"platform_reserve"
|
|
672
|
+
];
|
|
673
|
+
/**
|
|
674
|
+
* Which cap skipped a scan. Older platforms send no cause: a project cap whose spend
|
|
675
|
+
* reached it is the project's, anything else the platform's.
|
|
676
|
+
*/
|
|
677
|
+
function budgetCause(scan, budget) {
|
|
678
|
+
const sent = BUDGET_CAUSES.find((cause) => cause === scan?.budgetCause);
|
|
679
|
+
if (sent) return sent;
|
|
680
|
+
return budget && budget.capUsd !== null && budget.spentUsd >= budget.capUsd ? "project_cap" : "platform_cap";
|
|
681
|
+
}
|
|
682
|
+
/** What a used-up project cap will refuse at the next scan start, if anything (spec §6.5). */
|
|
683
|
+
function budgetAhead(budget) {
|
|
684
|
+
if (!budget || budget.capUsd === null) return null;
|
|
685
|
+
if (budget.spentUsd >= budget.capUsd) return "project_cap";
|
|
686
|
+
const reserve = budget.scanReserveUsd;
|
|
687
|
+
return typeof reserve === "number" && budget.spentUsd + reserve > budget.capUsd ? "project_reserve" : null;
|
|
688
|
+
}
|
|
689
|
+
/** A CLI `--usd` value: `150`, or `150.50` with cents. */
|
|
690
|
+
function usdArgument(value) {
|
|
691
|
+
return Number.isInteger(value) ? String(value) : value.toFixed(2);
|
|
692
|
+
}
|
|
693
|
+
/** The one §16.3 raise line that works now for this project's cap. */
|
|
694
|
+
function projectRaiseLine(budget, projectId) {
|
|
695
|
+
const cap = budget.capUsd ?? 0;
|
|
696
|
+
const ceiling = budget.ceilingUsd;
|
|
697
|
+
if (budget.capSource === "own" && (ceiling === null || cap < ceiling)) return ceiling === null ? "A project admin can raise it: void project security budget --usd <amount>" : `A project admin can raise it (up to ${usd(ceiling)}): void project security budget --usd ${usdArgument(ceiling)}`;
|
|
698
|
+
return `Your platform admin can raise it: void platform security budget --project ${projectId ? cleanLine(projectId) : "<project-id>"} --usd ${usdArgument(Math.max(1, Math.ceil(cap * 1.5)))}`;
|
|
699
|
+
}
|
|
700
|
+
function budgetSkipCopy(cause, budget, model, projectId) {
|
|
701
|
+
const none = {
|
|
702
|
+
resets: null,
|
|
703
|
+
next: null,
|
|
704
|
+
raised: false
|
|
705
|
+
};
|
|
706
|
+
if (!budget) return {
|
|
707
|
+
...none,
|
|
708
|
+
why: "the monthly scan budget is used up"
|
|
709
|
+
};
|
|
710
|
+
const resets = `Resets ${day(budget.resetsAt)}.`;
|
|
711
|
+
const reserve = typeof budget.scanReserveUsd === "number" ? budget.scanReserveUsd : null;
|
|
712
|
+
const oneScan = `one scan with ${cleanLine(model ?? "this model")} can cost${reserve === null ? "" : ` up to ${usd(reserve)},`}`;
|
|
713
|
+
const cheaper = "pick a cheaper model: void project security model";
|
|
714
|
+
if (cause === "platform_cap") return {
|
|
715
|
+
...none,
|
|
716
|
+
why: "the platform's monthly scan budget is used up",
|
|
717
|
+
resets
|
|
718
|
+
};
|
|
719
|
+
if (cause === "platform_reserve") return {
|
|
720
|
+
...none,
|
|
721
|
+
why: `${oneScan} more than is left of the platform's monthly scan budget`,
|
|
722
|
+
next: `Ask your platform admin, or ${cheaper}`
|
|
723
|
+
};
|
|
724
|
+
const cap = budget.capUsd;
|
|
725
|
+
const usedUp = cause === "project_cap" ? "was used up" : "had too little left for one scan";
|
|
726
|
+
if (cap === null) return {
|
|
727
|
+
...none,
|
|
728
|
+
why: `this project's monthly scan budget ${usedUp}; the cap was removed since`,
|
|
729
|
+
raised: true
|
|
730
|
+
};
|
|
731
|
+
const left = cap - budget.spentUsd;
|
|
732
|
+
if (cause === "project_cap" ? left > 0 : reserve !== null && reserve <= left) return {
|
|
733
|
+
...none,
|
|
734
|
+
why: `this project's monthly scan budget ${usedUp}; it was raised since (${usd(budget.spentUsd)} of ${usd(cap)} used)`,
|
|
735
|
+
raised: true
|
|
736
|
+
};
|
|
737
|
+
if (cause === "project_reserve") return {
|
|
738
|
+
...none,
|
|
739
|
+
why: `${oneScan} more than is left of this project's monthly scan budget (${usd(Math.max(0, left))} of ${usd(cap)})`,
|
|
740
|
+
next: `${projectRaiseLine(budget, projectId)}. Or ${cheaper}`
|
|
741
|
+
};
|
|
742
|
+
return {
|
|
743
|
+
...none,
|
|
744
|
+
why: `this project's monthly scan budget is used up (${usd(budget.spentUsd)} of ${usd(cap)})`,
|
|
745
|
+
resets,
|
|
746
|
+
next: projectRaiseLine(budget, projectId)
|
|
747
|
+
};
|
|
748
|
+
}
|
|
749
|
+
/** `2 critical, 1 high`. */
|
|
750
|
+
function urgentCounts(urgent) {
|
|
751
|
+
const { critical, high } = urgent.counts;
|
|
752
|
+
return [critical ? `${critical} critical` : "", high ? `${high} high` : ""].filter(Boolean).join(", ");
|
|
753
|
+
}
|
|
754
|
+
const row = (label, text) => ` ${label.padEnd(10)} ${text}`;
|
|
755
|
+
const cont = (text) => ` ${" ".repeat(10)} ${text}`;
|
|
756
|
+
const MODEL_SOURCES = {
|
|
757
|
+
project: "your project's pick",
|
|
758
|
+
default: "platform default",
|
|
759
|
+
fallback: "fallback: the model you asked for cannot run now"
|
|
760
|
+
};
|
|
761
|
+
/** Where the model in use comes from; names the pick and why it does not run (spec §8.2). */
|
|
762
|
+
function modelSource(model) {
|
|
763
|
+
if (model.pickProblem) return cleanLine(securityPickProblemNote(model.requested, model.pickProblem));
|
|
764
|
+
return model.source !== null && hasOwnKey(MODEL_SOURCES, model.source) ? MODEL_SOURCES[model.source] : "no model can run now";
|
|
765
|
+
}
|
|
766
|
+
/** Spec §11.4 status copy for the last scan; `null` when the scan needs no explanation. */
|
|
767
|
+
function scanStatusCopy(status, projectId) {
|
|
768
|
+
const { lastScan, lastSuccessfulScan, budget } = status;
|
|
769
|
+
if (!lastScan) return null;
|
|
770
|
+
const since = lastSuccessfulScan?.deploymentId ?? null;
|
|
771
|
+
const next = since ? `The next scan covers changes since ${since}.` : "The next scan reviews the whole app.";
|
|
772
|
+
const reason = cleanLine(lastScan.statusReason ?? "unknown");
|
|
773
|
+
switch (lastScan.status) {
|
|
774
|
+
case "queued":
|
|
775
|
+
case "running":
|
|
776
|
+
case "pending_input": return "Last security scan still running. Results show here when it ends.";
|
|
777
|
+
case "failed": return lastScan.failureCause === "installation" ? "Not scanned: a platform problem (your platform admin can see it in the admin panel)." : `Last scan failed (${reason}). ${next}`;
|
|
778
|
+
case "timed_out": return `Last scan failed (timed out). ${next}`;
|
|
779
|
+
case "refused": return `Refused by ${cleanLine(lastScan.model ?? "the scan model")} (category: ${cleanLine(lastScan.refusalCategory ?? "unknown")}). The next deploy is scanned again. To switch model: void project security model <id>`;
|
|
780
|
+
case "incomplete": return reason.startsWith("budget") ? `Last scan stopped early: the monthly scan budget ran out. Confirmed findings it found are kept. ${next}` : `Last scan was partial (${reason}). Confirmed findings it found are kept. ${next}`;
|
|
781
|
+
case "superseded": return "Replaced by the scan of a newer deploy.";
|
|
782
|
+
case "canceled": return `Canceled by a platform admin. ${next}`;
|
|
783
|
+
case "skipped":
|
|
784
|
+
if (reason === "budget") {
|
|
785
|
+
const cause = budgetCause(lastScan, budget);
|
|
786
|
+
const copy = budgetSkipCopy(cause, budget, status.model?.id, projectId);
|
|
787
|
+
if (copy.raised) return `Not scanned: ${copy.why}. The next deploy is scanned.`;
|
|
788
|
+
const next = cause === "platform_cap" && budget ? "Your platform admin can raise it." : copy.next;
|
|
789
|
+
return [
|
|
790
|
+
`Not scanned: ${copy.why}.`,
|
|
791
|
+
copy.resets,
|
|
792
|
+
next ? withStop(next) : null
|
|
793
|
+
].filter(Boolean).join(" ");
|
|
794
|
+
}
|
|
795
|
+
if (reason === "backlog") return `Not scanned: the scan queue was full for 24 h. ${next}`;
|
|
796
|
+
if (reason === "protected") return "Not scanned: this project is protected by Zero Trust and the platform scans public projects only.";
|
|
797
|
+
if (reason === "project_policy") return "Not scanned: a platform admin turned scans off for this project.";
|
|
798
|
+
return `Not scanned (${reason}).`;
|
|
799
|
+
default: return null;
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
const HELD_CAUSES = {
|
|
803
|
+
refused: "refused",
|
|
804
|
+
timed_out: "timed out",
|
|
805
|
+
findings_capped: "it hit the findings limit, so more findings may be hidden",
|
|
806
|
+
failed_project: "the scan of this project failed"
|
|
807
|
+
};
|
|
808
|
+
function withStop(text) {
|
|
809
|
+
return text.endsWith(".") ? text : `${text}.`;
|
|
810
|
+
}
|
|
811
|
+
/** Spec §11.4 public request copy, with the command that moves it on. */
|
|
812
|
+
function publicRequestLines(slug, request, status) {
|
|
813
|
+
const ids = request.blockers.ids.map(cleanLine).join(", ");
|
|
814
|
+
const target = cleanLine(request.targetDeploymentId);
|
|
815
|
+
const bypass = "void project zero-trust bypass --reason \"…\"";
|
|
816
|
+
const reason = request.heldReason;
|
|
817
|
+
const lines = [];
|
|
818
|
+
switch (request.state) {
|
|
819
|
+
case "waiting_scan":
|
|
820
|
+
lines.push(reason === "deployment_moving" ? `Waiting for the new deployment to go live before ${slug} goes public. It stays protected by Zero Trust until the scan of that deployment passes.` : reason === "zero_trust_not_ready" ? `Waiting for the Zero Trust protection of ${slug} to be ready before it goes public. It stays protected until then.` : status.backlogFiles > 0 ? `Scanning in parts: ${status.backlogFiles} files left. ${slug} stays protected until every file is scanned.` : `Waiting for a security scan of ${target} before ${slug} goes public. It stays protected by Zero Trust until the scan passes.`);
|
|
821
|
+
break;
|
|
822
|
+
case "held_findings": {
|
|
823
|
+
const count = request.blockers.ids.length;
|
|
824
|
+
lines.push(`Stays protected: ${count} urgent ${count === 1 ? "finding" : "findings"} must be resolved before Zero Trust is turned off (${ids}). Resolve each one as fixed (then deploy the fix), or as false-positive or accepted-risk with a comment; then the request unlocks.`, "→ void project security list --urgent");
|
|
825
|
+
break;
|
|
826
|
+
}
|
|
827
|
+
case "needs_deploy":
|
|
828
|
+
lines.push(reason === "unproven_fix" ? `Stays protected: ${ids} ${request.blockers.ids.length === 1 ? "was" : "were"} resolved as fixed. Deploy the fix (if it is already live, deploy again); ${slug} goes public when the scan of that deploy is clean.` : `Stays protected: the live deployment ${target} cannot be scanned (its code was not kept for scanning). Deploy again; that deploy is scanned before ${slug} goes public.`, `Or bypass the scan: ${bypass}`);
|
|
829
|
+
break;
|
|
830
|
+
case "held_no_result":
|
|
831
|
+
if (reason === "unread_files") lines.push(`Stays protected: the security scan could not read some project files (too large, not text, or a path the scanner cannot send). Fix them and deploy again, or bypass the scan: ${bypass}`);
|
|
832
|
+
else if (reason === "failed_installation") lines.push(`Stays protected: the security scan could not run (a platform problem; your platform admin can see it). A project admin or owner can bypass the scan: ${bypass}`);
|
|
833
|
+
else if (reason === "skipped_budget") {
|
|
834
|
+
const copy = budgetSkipCopy(budgetCause(status.lastScan && status.lastScan.id === request.gateScanId ? status.lastScan : null, status.budget), status.budget, status.model?.id, status.projectId);
|
|
835
|
+
const resets = copy.resets ? ` ${copy.resets}` : "";
|
|
836
|
+
if (copy.raised) lines.push(`Stays protected: ${copy.why}, so the scan could not run. Ask again with void project zero-trust public, or bypass the scan: ${bypass}`);
|
|
837
|
+
else if (copy.next === null) lines.push(`Stays protected: ${copy.why}, so the scan could not run.${resets} Ask your platform admin, or bypass the scan: ${bypass}`);
|
|
838
|
+
else lines.push(`Stays protected: ${copy.why}, so the scan could not run.${resets} ${withStop(copy.next)}`, `Or bypass the scan: ${bypass}`);
|
|
839
|
+
} else {
|
|
840
|
+
const cause = reason !== null && hasOwnKey(HELD_CAUSES, reason) ? HELD_CAUSES[reason] : cleanLine((reason ?? "no result").split("_").join(" "));
|
|
841
|
+
lines.push(`Stays protected: the security scan did not finish (${cause}). Ask again with void project zero-trust public, deploy again, or bypass the scan: ${bypass}`);
|
|
842
|
+
if (reason === "refused") lines.push("To switch model: void project security model <id>, then ask again.");
|
|
843
|
+
}
|
|
844
|
+
break;
|
|
845
|
+
case "passed":
|
|
846
|
+
lines.push(`Security scan passed (nothing urgent found). Zero Trust is being turned off for ${slug}.`);
|
|
847
|
+
break;
|
|
848
|
+
case "bypassed":
|
|
849
|
+
lines.push("Public without a clean scan: a project admin bypassed the scan. Your platform admins were told.");
|
|
850
|
+
break;
|
|
851
|
+
default: lines.push(`Public request canceled. ${slug} stays protected.`);
|
|
852
|
+
}
|
|
853
|
+
return lines;
|
|
854
|
+
}
|
|
855
|
+
function formatStatus(slug, status, projectId) {
|
|
856
|
+
const lines = [`${slug} · security`];
|
|
857
|
+
const { urgent, policy, model, budget, lastScan, lastSuccessfulScan, counts } = status;
|
|
858
|
+
if (urgent.count === 0) lines.push(row("Urgent", "none open"));
|
|
859
|
+
else lines.push(row("Urgent", `${urgent.count} open (${urgentCounts(urgent)}) · oldest ${day(urgent.oldestFirstSeenAt)} → void project security list --urgent`));
|
|
860
|
+
const reason = cleanLine(policy.reason);
|
|
861
|
+
if (policy.mode === "disabled") lines.push(row("Policy", reason));
|
|
862
|
+
else if (policy.applies) lines.push(row("Policy", `applies: ${reason}${policy.mode === "public" ? " (Public projects only)" : ""}`));
|
|
863
|
+
else lines.push(row("Policy", `does not apply: ${reason}`));
|
|
864
|
+
lines.push(row("Model", `${cleanLine(model.id ?? "none")} (${modelSource(model)})`));
|
|
865
|
+
if (model.thirdParty && model.id) lines.push(cont("Run by a third-party provider, not Cloudflare. Its usage policy applies and it may refuse."));
|
|
866
|
+
if (model.pendingDefault) lines.push(cont(`The platform default ${cleanLine(model.pendingDefault)} waits for the provider notice: void project security model --default --accept-provider-notice`));
|
|
867
|
+
if (budget) {
|
|
868
|
+
const origin = budget.capSource === "own" ? "project cap" : "platform limit";
|
|
869
|
+
lines.push(row("Budget", budget.capUsd === null ? `${usd(budget.spentUsd)} this month · no cap` : `${usd(budget.spentUsd)} of ${usd(budget.capUsd)} this month (${origin}) · resets ${day(budget.resetsAt)}`));
|
|
870
|
+
}
|
|
871
|
+
if (!lastScan) lines.push(row("Last scan", policy.applies && policy.mode !== "disabled" ? "none yet. The first scan runs after your next deploy and reviews the whole app." : "none"));
|
|
872
|
+
else {
|
|
873
|
+
const parts = [
|
|
874
|
+
cleanLine(lastScan.status + (lastScan.statusReason ? ` (${lastScan.statusReason})` : "")),
|
|
875
|
+
lastScan.deploymentId ? cleanLine(lastScan.deploymentId) : null,
|
|
876
|
+
duration(lastScan),
|
|
877
|
+
lastScan.coverageLabel ? cleanLine(lastScan.coverageLabel) : null
|
|
878
|
+
].filter(Boolean);
|
|
879
|
+
lines.push(row("Last scan", parts.join(" · ")));
|
|
880
|
+
}
|
|
881
|
+
if (lastSuccessfulScan?.deploymentId) {
|
|
882
|
+
const since = status.deploysSinceLastSuccess;
|
|
883
|
+
lines.push(row("Last good", `${cleanLine(lastSuccessfulScan.deploymentId)}${since === null ? "" : ` (${since} ${since === 1 ? "deploy" : "deploys"} ago)`}`));
|
|
884
|
+
}
|
|
885
|
+
if (status.backlogFiles > 0) lines.push(row("Backlog", `${status.backlogFiles} files not scanned yet`));
|
|
886
|
+
const copy = scanStatusCopy(status, projectId);
|
|
887
|
+
if (copy) lines.push(row("Note", copy));
|
|
888
|
+
const other = (counts.open.medium ?? 0) + (counts.open.low ?? 0) + (counts.open.informational ?? 0);
|
|
889
|
+
lines.push(row("Open", `${counts.urgent} urgent · ${other} other · ${counts.leads} leads`));
|
|
890
|
+
if (status.publicRequest) {
|
|
891
|
+
const [first = "", ...rest] = publicRequestLines(slug, status.publicRequest, {
|
|
892
|
+
...status,
|
|
893
|
+
projectId
|
|
894
|
+
});
|
|
895
|
+
lines.push(row("Public", first), ...rest.map(cont));
|
|
896
|
+
}
|
|
897
|
+
return lines;
|
|
898
|
+
}
|
|
899
|
+
function findingState(finding) {
|
|
900
|
+
if (finding.state === "resolved") return finding.resolution ? `resolved (${cleanLine(finding.resolution).split("_").join("-")})` : "resolved";
|
|
901
|
+
return finding.verdict === "needs_validation" ? "lead" : "open";
|
|
902
|
+
}
|
|
903
|
+
function formatFindingList(findings) {
|
|
904
|
+
return findings.map((finding) => {
|
|
905
|
+
const place = finding.file ? `${cleanLine(finding.file)}${finding.line ? `:${finding.line}` : ""}` : "";
|
|
906
|
+
return [
|
|
907
|
+
cleanLine(finding.id).padEnd(7),
|
|
908
|
+
cleanLine(finding.severity ?? "-").padEnd(14),
|
|
909
|
+
findingState(finding).padEnd(26),
|
|
910
|
+
finding.title === void 0 ? "" : cleanLine(finding.title),
|
|
911
|
+
place ? `(${place})` : ""
|
|
912
|
+
].join(" ").trimEnd();
|
|
913
|
+
});
|
|
914
|
+
}
|
|
915
|
+
function indent(text) {
|
|
916
|
+
return cleanBlock(text).split("\n").map((line) => ` ${line}`);
|
|
917
|
+
}
|
|
918
|
+
function formatFinding(finding, events) {
|
|
919
|
+
const lines = [`${cleanLine(finding.id)} ${cleanLine(finding.severity ?? "-")} ${findingState(finding)}${finding.urgent ? " (urgent)" : ""}`];
|
|
920
|
+
if (finding.title === void 0) {
|
|
921
|
+
lines.push(" Readers see the id, severity and state of open findings. Ask a project collaborator for the details.");
|
|
922
|
+
return lines;
|
|
923
|
+
}
|
|
924
|
+
lines.push(` ${cleanLine(finding.title)}`);
|
|
925
|
+
const meta = [
|
|
926
|
+
finding.file ? `${cleanLine(finding.file)}${finding.line ? `:${finding.line}` : ""}` : null,
|
|
927
|
+
finding.category ? cleanLine(finding.category) : null,
|
|
928
|
+
finding.cwe ? cleanLine(finding.cwe) : null,
|
|
929
|
+
finding.verdictSource === "runtime" ? "confirmed (runtime)" : null,
|
|
930
|
+
finding.confidence !== void 0 && finding.confidence !== null ? `confidence ${cleanLine(finding.confidence)}` : null,
|
|
931
|
+
finding.deploymentId ? `first seen in ${cleanLine(finding.deploymentId)}` : null,
|
|
932
|
+
finding.firstSeenAt ? day(finding.firstSeenAt) : null
|
|
933
|
+
].filter(Boolean);
|
|
934
|
+
if (meta.length > 0) lines.push(` ${meta.join(" · ")}`);
|
|
935
|
+
if (finding.severityEdited) lines.push(` Severity set by a person${finding.scanSeverity ? ` (scans said ${cleanLine(finding.scanSeverity)})` : ""}.`);
|
|
936
|
+
if (finding.notSeenInLatest) lines.push(" Not seen in the latest scan.");
|
|
937
|
+
if (finding.possibleDuplicateOf) lines.push(` Possible duplicate of ${cleanLine(finding.possibleDuplicateOf.id)}.`);
|
|
938
|
+
for (const [label, value] of [
|
|
939
|
+
["Trace", securityTraceLines(finding.trace)?.map(cleanLine).join("\n") ?? finding.trace],
|
|
940
|
+
["Evidence", finding.evidence],
|
|
941
|
+
["Runtime proof", finding.runtimeProof ? `${cleanLine(finding.runtimeProof.method)} ${cleanLine(finding.runtimeProof.path)} answered ${finding.runtimeProof.status} on a throwaway copy` : null],
|
|
942
|
+
["Conditions", finding.conditions],
|
|
943
|
+
["Suggested fix", finding.fix]
|
|
944
|
+
]) if (value !== null && value !== void 0 && value !== "") lines.push("", ` ${label}`, ...indent(typeof value === "string" ? value : JSON.stringify(value, null, 2)));
|
|
945
|
+
if (events && events.length > 0) {
|
|
946
|
+
lines.push("", " History");
|
|
947
|
+
for (const event of events) {
|
|
948
|
+
const who = event.actor ?? event.actorKind;
|
|
949
|
+
const role = event.formerMember ? "former member" : event.actorRole ? cleanLine(event.actorRole) : null;
|
|
950
|
+
lines.push(` ${stamp(event.createdAt)} · ${cleanLine(event.action)}${event.resolution ? ` (${cleanLine(event.resolution).split("_").join("-")})` : ""}${event.severityFrom && event.severityTo ? ` (${cleanLine(event.severityFrom)} → ${cleanLine(event.severityTo)})` : ""} · ${cleanLine(who)}${role ? ` (${role})` : ""}`);
|
|
951
|
+
if (event.comment) lines.push(...indent(event.comment).map((line) => ` ${line}`));
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
return lines;
|
|
955
|
+
}
|
|
956
|
+
function formatScans(scans) {
|
|
957
|
+
return scans.map((scan) => [
|
|
958
|
+
day(scan.createdAt).padEnd(7),
|
|
959
|
+
cleanLine(scan.status + (scan.statusReason ? ` (${scan.statusReason})` : "")).padEnd(24),
|
|
960
|
+
cleanLine(scan.deploymentId ?? "-").padEnd(12),
|
|
961
|
+
cleanLine(scan.trigger).padEnd(9),
|
|
962
|
+
duration(scan) ?? "-",
|
|
963
|
+
scan.meteredUsd === null ? "" : usd(scan.meteredUsd),
|
|
964
|
+
scan.model ? cleanLine(scan.model) : ""
|
|
965
|
+
].join(" ").trimEnd());
|
|
966
|
+
}
|
|
967
|
+
async function resolveTarget(root, args) {
|
|
968
|
+
const token = getToken(root);
|
|
969
|
+
if (!token) throw new Error("project: Not logged in. Run `void account login` first.");
|
|
970
|
+
const client = new PlatformClient(token, { root });
|
|
971
|
+
const requestedSlug = getRequestedProjectSlug({ projectSlug: args.projectSlug });
|
|
972
|
+
if (requestedSlug) {
|
|
973
|
+
const project = await requireProjectBySlug(client, requestedSlug);
|
|
974
|
+
return {
|
|
975
|
+
client,
|
|
976
|
+
projectId: project.projectId,
|
|
977
|
+
slug: project.slug
|
|
978
|
+
};
|
|
979
|
+
}
|
|
980
|
+
const linked = readProjectConfig(root);
|
|
981
|
+
if (!linked) throw new Error("project: No linked project. Pass --project <name> or set VOID_PROJECT.");
|
|
982
|
+
return {
|
|
983
|
+
client,
|
|
984
|
+
projectId: linked.projectId,
|
|
985
|
+
slug: linked.slug
|
|
986
|
+
};
|
|
987
|
+
}
|
|
988
|
+
function print(args, value, lines) {
|
|
989
|
+
if (args.json) console.log(JSON.stringify(value));
|
|
990
|
+
else console.log([
|
|
991
|
+
"",
|
|
992
|
+
...lines,
|
|
993
|
+
""
|
|
994
|
+
].join("\n"));
|
|
995
|
+
}
|
|
996
|
+
function reasonLabel(reason) {
|
|
997
|
+
return (reason ?? "resolved").split("_").join(" ");
|
|
998
|
+
}
|
|
999
|
+
function noticeOf(error) {
|
|
1000
|
+
if (!(error instanceof PlatformApiError) || error.status !== 422) return null;
|
|
1001
|
+
try {
|
|
1002
|
+
const body = JSON.parse(error.body);
|
|
1003
|
+
if (body.error !== "provider notice not accepted" || typeof body.version !== "number") return null;
|
|
1004
|
+
const notice = Array.isArray(body.notice) ? body.notice.filter((x) => typeof x === "string") : [];
|
|
1005
|
+
return {
|
|
1006
|
+
version: body.version,
|
|
1007
|
+
notice
|
|
1008
|
+
};
|
|
1009
|
+
} catch {
|
|
1010
|
+
return null;
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
function severityChangeLine(id, level, result) {
|
|
1014
|
+
if (!result.changed) return result.severityEdited ? `${id} is already ${level}. Nothing changed.` : `${id} already uses the scan severity (${level}). Nothing changed.`;
|
|
1015
|
+
if (!result.severityEdited) return `✓ ${id} uses the scan severity again: ${level}.`;
|
|
1016
|
+
const scans = result.scanSeverity ? cleanLine(result.scanSeverity) : null;
|
|
1017
|
+
return `✓ ${id} severity set to ${level}${scans && scans !== level ? ` (scans said ${scans})` : ""}. Later scans keep it.`;
|
|
1018
|
+
}
|
|
1019
|
+
/** The rescan cost confirm (spec §13.4 rescan rule): what it runs and what it can cost. */
|
|
1020
|
+
function rescanConfirmLines(preview) {
|
|
1021
|
+
const id = cleanLine(preview.deploymentId);
|
|
1022
|
+
const model = cleanLine(preview.model ?? "the scan model");
|
|
1023
|
+
const cost = typeof preview.worstCaseUsd === "number" ? ` It can cost up to ${usd(preview.worstCaseUsd)}.` : "";
|
|
1024
|
+
const whole = preview.clientAssets ? "This reviews the whole app, and the sources of its client bundles." : "This reviews the whole app.";
|
|
1025
|
+
const lines = [preview.alreadyScanned ? `Live deployment ${id} was already scanned. Run a full scan with ${model}? ${whole}${cost}` : `Run a full scan of live deployment ${id} with ${model}? ${whole}${cost}`];
|
|
1026
|
+
const budget = preview.budget;
|
|
1027
|
+
lines.push(budget && budget.capUsd !== null ? `Monthly caps apply: ${usd(budget.spentUsd)} of ${usd(budget.capUsd)} spent this month.` : "Monthly caps apply when the scan starts.");
|
|
1028
|
+
return lines;
|
|
1029
|
+
}
|
|
1030
|
+
async function runProjectSecurityCommand(root, args, deps = {}) {
|
|
1031
|
+
const { client, projectId, slug } = await resolveTarget(root, args);
|
|
1032
|
+
if (args.action === "status") {
|
|
1033
|
+
const status = await client.getProjectSecurity(projectId);
|
|
1034
|
+
print(args, status, formatStatus(slug, status, projectId));
|
|
1035
|
+
return;
|
|
1036
|
+
}
|
|
1037
|
+
if (args.action === "list") {
|
|
1038
|
+
const found = [];
|
|
1039
|
+
let cursor = null;
|
|
1040
|
+
let more = false;
|
|
1041
|
+
for (;;) {
|
|
1042
|
+
const page = await client.listProjectSecurityFindings(projectId, {
|
|
1043
|
+
state: args.state,
|
|
1044
|
+
urgent: args.urgent,
|
|
1045
|
+
severity: args.severity,
|
|
1046
|
+
limit: 100,
|
|
1047
|
+
cursor
|
|
1048
|
+
});
|
|
1049
|
+
found.push(...page.findings);
|
|
1050
|
+
cursor = page.nextCursor;
|
|
1051
|
+
if (!cursor) break;
|
|
1052
|
+
if (found.length >= 500) {
|
|
1053
|
+
more = true;
|
|
1054
|
+
break;
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
const shown = args.leads ? found : found.filter((finding) => finding.verdict !== "needs_validation");
|
|
1058
|
+
const hidden = found.length - shown.length;
|
|
1059
|
+
if (args.format === "sarif") {
|
|
1060
|
+
console.log(JSON.stringify(securityFindingsSarif(shown, { version: sarifToolVersion() }), null, 2));
|
|
1061
|
+
if (hidden > 0) console.error(`${hidden} ${hidden === 1 ? "lead is" : "leads are"} left out. Add them with --leads.`);
|
|
1062
|
+
if (more) console.error("Only the first 500 findings are in the file. Narrow it with --severity or --urgent.");
|
|
1063
|
+
return;
|
|
1064
|
+
}
|
|
1065
|
+
const lines = shown.length === 0 ? ["No findings."] : formatFindingList(shown);
|
|
1066
|
+
if (hidden > 0) lines.push(`${hidden} ${hidden === 1 ? "lead is" : "leads are"} hidden. Show them with --leads.`);
|
|
1067
|
+
if (more) lines.push("Showing the first 500. Narrow the list with --severity or --urgent.");
|
|
1068
|
+
print(args, {
|
|
1069
|
+
findings: shown,
|
|
1070
|
+
more
|
|
1071
|
+
}, lines);
|
|
1072
|
+
return;
|
|
1073
|
+
}
|
|
1074
|
+
if (args.action === "show") {
|
|
1075
|
+
const detail = await client.getProjectSecurityFinding(projectId, args.id);
|
|
1076
|
+
print(args, detail, formatFinding(detail.finding, detail.events));
|
|
1077
|
+
return;
|
|
1078
|
+
}
|
|
1079
|
+
if (args.action === "comment") {
|
|
1080
|
+
const result = await client.commentOnProjectSecurityFinding(projectId, args.id, args.text);
|
|
1081
|
+
print(args, result, [`✓ Comment added to ${cleanLine(result.id)}.`]);
|
|
1082
|
+
return;
|
|
1083
|
+
}
|
|
1084
|
+
const revision = async (id) => (await client.getProjectSecurityFinding(projectId, id)).finding.revision;
|
|
1085
|
+
if (args.action === "reopen") {
|
|
1086
|
+
const result = await client.reopenProjectSecurityFinding(projectId, args.id, {
|
|
1087
|
+
comment: args.comment,
|
|
1088
|
+
expectedRevision: await revision(args.id)
|
|
1089
|
+
});
|
|
1090
|
+
print(args, result, [`✓ ${cleanLine(result.id)} reopened.`]);
|
|
1091
|
+
return;
|
|
1092
|
+
}
|
|
1093
|
+
if (args.action === "severity") {
|
|
1094
|
+
const result = await client.editProjectSecurityFindingSeverity(projectId, args.id, {
|
|
1095
|
+
severity: args.severity,
|
|
1096
|
+
comment: args.comment,
|
|
1097
|
+
expectedRevision: await revision(args.id)
|
|
1098
|
+
});
|
|
1099
|
+
const lines = [severityChangeLine(cleanLine(result.id), cleanLine(result.severity ?? "-"), result)];
|
|
1100
|
+
if (result.publicRequest) {
|
|
1101
|
+
const status = await statusAfterChange(client, projectId);
|
|
1102
|
+
const [first = "", ...rest] = publicRequestLines(slug, result.publicRequest, {
|
|
1103
|
+
...status ?? {
|
|
1104
|
+
backlogFiles: 0,
|
|
1105
|
+
budget: null
|
|
1106
|
+
},
|
|
1107
|
+
projectId
|
|
1108
|
+
});
|
|
1109
|
+
lines.push(` Public request: ${first}`, ...rest.map((line) => ` ${line}`));
|
|
1110
|
+
}
|
|
1111
|
+
print(args, result, lines);
|
|
1112
|
+
return;
|
|
1113
|
+
}
|
|
1114
|
+
if (args.action === "resolve") {
|
|
1115
|
+
const results = [];
|
|
1116
|
+
const lines = [];
|
|
1117
|
+
let lastRequest;
|
|
1118
|
+
let failed = 0;
|
|
1119
|
+
for (const id of args.ids) try {
|
|
1120
|
+
const result = await client.resolveProjectSecurityFinding(projectId, id, {
|
|
1121
|
+
reason: args.reason,
|
|
1122
|
+
comment: args.comment,
|
|
1123
|
+
expectedRevision: await revision(id)
|
|
1124
|
+
});
|
|
1125
|
+
results.push(result);
|
|
1126
|
+
lastRequest = result.publicRequest ?? lastRequest;
|
|
1127
|
+
lines.push(`✓ ${cleanLine(result.id)} resolved (${reasonLabel(result.resolution)}).${args.reason === "fixed" ? " The next scan will check that the fix holds." : ""}`);
|
|
1128
|
+
} catch (error) {
|
|
1129
|
+
failed++;
|
|
1130
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1131
|
+
results.push({
|
|
1132
|
+
ok: false,
|
|
1133
|
+
id,
|
|
1134
|
+
error: message
|
|
1135
|
+
});
|
|
1136
|
+
lines.push(`✖ ${id}: ${cleanLine(message)}`);
|
|
1137
|
+
}
|
|
1138
|
+
if (failed < args.ids.length) {
|
|
1139
|
+
const status = await statusAfterChange(client, projectId);
|
|
1140
|
+
const open = status?.urgent.findings ?? [];
|
|
1141
|
+
const describe = (id) => {
|
|
1142
|
+
const found = open.find((finding) => finding.id === id);
|
|
1143
|
+
return found?.severity ? `${id} (${cleanLine(found.severity)})` : id;
|
|
1144
|
+
};
|
|
1145
|
+
if (lastRequest?.state === "held_findings") lines.push(` Public request: still held by ${lastRequest.blockers.ids.map(describe).join(", ")}.`);
|
|
1146
|
+
else if (lastRequest?.state === "needs_deploy") lines.push(` Public request: deploy the fix. ${slug} goes public when the scan of that deploy is clean.`);
|
|
1147
|
+
else if (lastRequest?.state === "waiting_scan") lines.push(" Public request: waiting for a security scan.");
|
|
1148
|
+
else if (status && status.urgent.count > 0) lines.push(` Still open and urgent: ${open.map((finding) => describe(finding.id)).join(", ")}${status.urgent.more > 0 ? `, and ${status.urgent.more} more` : ""}.`);
|
|
1149
|
+
}
|
|
1150
|
+
print(args, { results }, lines);
|
|
1151
|
+
if (failed > 0) throw new Error(`project: ${failed} of ${args.ids.length} findings were not resolved.`);
|
|
1152
|
+
return;
|
|
1153
|
+
}
|
|
1154
|
+
if (args.action === "scans") {
|
|
1155
|
+
const page = await client.listProjectSecurityScans(projectId, args.limit);
|
|
1156
|
+
const lines = page.scans.length === 0 ? ["No scans yet."] : formatScans(page.scans);
|
|
1157
|
+
if (page.nextCursor) lines.push("Older scans exist. Raise --limit (up to 100) to see more.");
|
|
1158
|
+
print(args, page, lines);
|
|
1159
|
+
return;
|
|
1160
|
+
}
|
|
1161
|
+
if (args.action === "scan") {
|
|
1162
|
+
const scanOptions = { clientAssets: args.clientAssets };
|
|
1163
|
+
const preview = await client.previewProjectSecurityScan(projectId, scanOptions);
|
|
1164
|
+
if (args.clientAssets && preview.clientAssets !== true) throw new Error("project: This platform cannot read client bundle sources yet. Run the scan without --client-assets, or ask your platform admin to upgrade.");
|
|
1165
|
+
if (!args.yes) {
|
|
1166
|
+
if (args.json || !isInteractive(deps)) throw new Error("project: Add --yes to start the scan without a prompt.");
|
|
1167
|
+
const [question, ...rest] = rescanConfirmLines(preview);
|
|
1168
|
+
console.log(["", ...rest].join("\n"));
|
|
1169
|
+
if (!await askYesNo(deps, question)) {
|
|
1170
|
+
console.log("Nothing was queued.");
|
|
1171
|
+
return;
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
const queued = await client.startProjectSecurityScan(projectId, scanOptions);
|
|
1175
|
+
print(args, queued, [`✓ Full scan ${cleanLine(queued.scanId)} of ${cleanLine(queued.deploymentId)} queued${queued.clientAssets ? ", with client bundle sources" : ""}.`, " It waits its turn like any scan. See the result: void project security status"]);
|
|
1176
|
+
return;
|
|
1177
|
+
}
|
|
1178
|
+
if (args.action === "check") {
|
|
1179
|
+
await runSecurityCheck(root, client, projectId, slug, args, deps);
|
|
1180
|
+
return;
|
|
1181
|
+
}
|
|
1182
|
+
if (args.action === "model") {
|
|
1183
|
+
if (args.change === "show") {
|
|
1184
|
+
const { model } = await client.getProjectSecurity(projectId);
|
|
1185
|
+
const lines = [
|
|
1186
|
+
`${slug} · security model`,
|
|
1187
|
+
row("Model", `${cleanLine(model.id ?? "none")} (${modelSource(model)})`),
|
|
1188
|
+
row("Asked for", cleanLine(model.requested)),
|
|
1189
|
+
model.thirdParty || model.pendingDefault || model.pickProblem === "notice" ? row("Notice", model.noticeAccepted ? "provider notice accepted" : "provider notice not accepted") : null,
|
|
1190
|
+
"Change: void project security model <id> or void project security model --default"
|
|
1191
|
+
].filter((line) => line !== null);
|
|
1192
|
+
print(args, { model }, lines);
|
|
1193
|
+
return;
|
|
1194
|
+
}
|
|
1195
|
+
const target = args.change === "default" ? null : args.model;
|
|
1196
|
+
const lines = [];
|
|
1197
|
+
const set = (version) => client.setProjectSecurityModel(projectId, {
|
|
1198
|
+
model: target,
|
|
1199
|
+
...version === void 0 ? {} : { acceptProviderNoticeVersion: version }
|
|
1200
|
+
});
|
|
1201
|
+
let result;
|
|
1202
|
+
try {
|
|
1203
|
+
result = await set(args.acceptNotice ? 0 : void 0);
|
|
1204
|
+
} catch (error) {
|
|
1205
|
+
const notice = noticeOf(error);
|
|
1206
|
+
if (!notice) throw error;
|
|
1207
|
+
const text = notice.notice.map(cleanLine);
|
|
1208
|
+
if (!args.acceptNotice) {
|
|
1209
|
+
if (!args.json) console.log([
|
|
1210
|
+
"",
|
|
1211
|
+
...text,
|
|
1212
|
+
""
|
|
1213
|
+
].join("\n"));
|
|
1214
|
+
throw error;
|
|
1215
|
+
}
|
|
1216
|
+
lines.push(...text, "");
|
|
1217
|
+
result = await set(notice.version);
|
|
1218
|
+
}
|
|
1219
|
+
const used = result.model?.id;
|
|
1220
|
+
lines.push(args.change === "default" ? `✓ ${slug} uses the platform default model${used ? ` (${cleanLine(used)})` : ""}.` : `✓ ${slug} scans now use ${cleanLine(args.model)}.`);
|
|
1221
|
+
if (result.model?.source === "fallback") lines.push(result.model.pickProblem ? ` The next scan runs on ${cleanLine(result.model.id ?? "no model")}: ${cleanLine(securityPickProblemNote(result.model.requested, result.model.pickProblem))}.` : " The next scan still falls back to a Cloudflare model until the provider notice is accepted on the platform.");
|
|
1222
|
+
print(args, result, lines);
|
|
1223
|
+
return;
|
|
1224
|
+
}
|
|
1225
|
+
if (args.action === "budget") {
|
|
1226
|
+
if (args.change === "show") {
|
|
1227
|
+
const { budget } = await client.getProjectSecurity(projectId);
|
|
1228
|
+
if (!budget) {
|
|
1229
|
+
print(args, { budget: null }, ["Only project members who can deploy can see the scan budget."]);
|
|
1230
|
+
return;
|
|
1231
|
+
}
|
|
1232
|
+
const month = (/* @__PURE__ */ new Date(`${budget.month.slice(0, 7)}-01T00:00:00Z`)).toLocaleDateString("en-US", {
|
|
1233
|
+
month: "long",
|
|
1234
|
+
timeZone: "UTC"
|
|
1235
|
+
});
|
|
1236
|
+
const cap = budget.capUsd === null ? "no cap" : `${usd(budget.capUsd)} / month (${budget.capSource === "own" ? "set for this project" : `platform limit for ${budget.ceilingSource === "project" ? "this project" : budget.ceilingSource === "plan" ? "this plan" : "every project"}`})`;
|
|
1237
|
+
print(args, { budget }, [
|
|
1238
|
+
`${slug} · scan budget (${month}, UTC; resets ${day(budget.resetsAt)})`,
|
|
1239
|
+
row("Cap", cap),
|
|
1240
|
+
row("Spent", `${usd(budget.spentUsd)} metered this month`),
|
|
1241
|
+
` Change: void project security budget --usd N (project admin; ${budget.ceilingUsd === null ? "any amount" : `$0–${usd(budget.ceilingUsd)}`})`
|
|
1242
|
+
]);
|
|
1243
|
+
return;
|
|
1244
|
+
}
|
|
1245
|
+
const result = await client.setProjectSecurityBudget(projectId, args.change === "off" ? null : args.usd);
|
|
1246
|
+
const budget = result.budget;
|
|
1247
|
+
if (args.change === "set") print(args, result, [`✓ ${slug} scan budget set to ${usd(args.usd)} / month. Spent so far: ${usd(budget.spentUsd)}.`]);
|
|
1248
|
+
else print(args, result, [budget.capUsd === null ? `✓ ${slug}'s own cap cleared. No cap applies.` : `✓ ${slug}'s own cap cleared. The platform cap for each project still applies: ${usd(budget.capUsd)} / month.`]);
|
|
1249
|
+
return;
|
|
1250
|
+
}
|
|
1251
|
+
if (args.action === "open") {
|
|
1252
|
+
const link = await client.createProjectSecurityPageLink(projectId);
|
|
1253
|
+
let safe;
|
|
1254
|
+
try {
|
|
1255
|
+
const url = new URL(link.url);
|
|
1256
|
+
safe = (url.protocol === "https:" || url.protocol === "http:") && !url.username && !url.password && url.pathname.startsWith("/security/projects/");
|
|
1257
|
+
} catch {
|
|
1258
|
+
safe = false;
|
|
1259
|
+
}
|
|
1260
|
+
if (!safe) throw new Error("project: The platform returned an unexpected security page link.");
|
|
1261
|
+
print(args, link, [link.url, `The link works for 15 minutes (until ${stamp(link.expiresAt)}).`]);
|
|
1262
|
+
if (isInteractive(deps) && !args.json) (deps.openUrl ?? openBrowser)(link.url);
|
|
1263
|
+
return;
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
function isInteractive(deps) {
|
|
1267
|
+
return deps.interactive ?? (Boolean(process.stdout.isTTY) && !import_ci_info.isCI);
|
|
1268
|
+
}
|
|
1269
|
+
async function askYesNo(deps, message) {
|
|
1270
|
+
if (deps.confirm) return deps.confirm(message);
|
|
1271
|
+
const answer = await confirm({
|
|
1272
|
+
message,
|
|
1273
|
+
initialValue: false
|
|
1274
|
+
});
|
|
1275
|
+
return !isCancel(answer) && answer;
|
|
1276
|
+
}
|
|
1277
|
+
/** The status for lines added after a change; the change already happened, so errors are dropped. */
|
|
1278
|
+
async function statusAfterChange(client, projectId) {
|
|
1279
|
+
try {
|
|
1280
|
+
return await client.getProjectSecurity(projectId);
|
|
1281
|
+
} catch {
|
|
1282
|
+
return null;
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
/**
|
|
1286
|
+
* `void project security check [<check-id>]` (M32). Without an id: pack this folder's
|
|
1287
|
+
* git-tracked files, say what is sent and to which model, confirm, upload, wait.
|
|
1288
|
+
* With an id: show (and wait for) that check.
|
|
1289
|
+
*/
|
|
1290
|
+
async function runSecurityCheck(root, client, projectId, slug, args, deps) {
|
|
1291
|
+
const log = (lines) => {
|
|
1292
|
+
if (!args.json) console.log(lines.join("\n"));
|
|
1293
|
+
};
|
|
1294
|
+
let checkId = args.checkId;
|
|
1295
|
+
const fresh = checkId === "";
|
|
1296
|
+
if (fresh) {
|
|
1297
|
+
if (!args.yes && (args.json || !isInteractive(deps))) throw new Error("project: Add --yes to send the code without a prompt.");
|
|
1298
|
+
const tree = collectSecurityLocalTree(root, deps.check?.listFiles);
|
|
1299
|
+
if (tree.files.length === 0) throw new Error("project: No git-tracked code to check in this folder. Add your code with git add first.");
|
|
1300
|
+
const packed = packSecurityLocalTree(tree);
|
|
1301
|
+
const preview = await client.previewProjectSecurityCheck(projectId, packed.request);
|
|
1302
|
+
const model = cleanLine(preview.model);
|
|
1303
|
+
const lines = ["", ...checkSummaryLines(slug, tree)];
|
|
1304
|
+
if (preview.notice) lines.push("", ...preview.notice.map((line) => ` ${cleanLine(line)}`));
|
|
1305
|
+
lines.push("", ` The code goes to the platform and is reviewed by ${model}.${typeof preview.worstCaseUsd === "number" ? ` It can cost up to ${usd(preview.worstCaseUsd)}; monthly caps apply.` : " Monthly caps apply."}`, " The result is not saved as project findings. The platform keeps it for 30 days.");
|
|
1306
|
+
log(lines);
|
|
1307
|
+
if (!args.yes && !await askYesNo(deps, `Send these files for a security check with ${model}?`)) {
|
|
1308
|
+
console.log("Nothing was sent.");
|
|
1309
|
+
return;
|
|
1310
|
+
}
|
|
1311
|
+
checkId = await sendSecurityLocalCheck(client, projectId, packed, deps.check);
|
|
1312
|
+
log([`✓ Check ${cleanLine(checkId)} queued. It waits its turn like any scan.`]);
|
|
1313
|
+
} else if ((await client.getProjectSecurityCheck(projectId, checkId)).check.status === "pending_input") await client.startProjectSecurityCheck(projectId, checkId);
|
|
1314
|
+
if (!args.wait) {
|
|
1315
|
+
const view = await client.getProjectSecurityCheck(projectId, checkId);
|
|
1316
|
+
print(args, view, [` Check ${cleanLine(checkId)}: ${cleanLine(view.check.status)}.`, ` See the result: void project security check ${cleanLine(checkId)}`]);
|
|
1317
|
+
return;
|
|
1318
|
+
}
|
|
1319
|
+
let view;
|
|
1320
|
+
try {
|
|
1321
|
+
view = await waitForSecurityLocalCheck(client, projectId, checkId, (status) => log([status === "running" ? " Running…" : " Waiting in the scan queue…"]), deps.check);
|
|
1322
|
+
} catch (error) {
|
|
1323
|
+
if (!(error instanceof PlatformApiError && error.status === 404)) {
|
|
1324
|
+
const hint = ` The check keeps running. See it later: void project security check ${cleanLine(checkId)}`;
|
|
1325
|
+
if (args.json) console.error(hint.trim());
|
|
1326
|
+
else log([hint]);
|
|
1327
|
+
}
|
|
1328
|
+
throw error;
|
|
1329
|
+
}
|
|
1330
|
+
if (view === null) {
|
|
1331
|
+
print(args, {
|
|
1332
|
+
checkId,
|
|
1333
|
+
ended: false
|
|
1334
|
+
}, [` Still not done. See it later: void project security check ${cleanLine(checkId)}`]);
|
|
1335
|
+
return;
|
|
1336
|
+
}
|
|
1337
|
+
print(args, view, checkResultLines(slug, view, { fresh }));
|
|
1338
|
+
if (!checkEndedWithResult(view)) throw new Error(checkFailureMessage(view, { fresh }));
|
|
1339
|
+
}
|
|
1340
|
+
export { usd as _, day as a, formatScans as c, publicRequestLines as d, rescanConfirmLines as f, urgentCounts as g, scanStatusCopy as h, budgetSkipCopy as i, formatStatus as l, runProjectSecurityCommand as m, budgetAhead as n, formatFinding as o, resolveTarget as p, budgetCause as r, formatFindingList as s, askYesNo as t, isInteractive as u, require_ci_info as v };
|