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.
Files changed (355) hide show
  1. package/dist/{account-cmd-CZhbDfp4.mjs → account-cmd-D_0qJ9fx.mjs} +6 -6
  2. package/dist/{agents-DRo8gzni.mjs → agents-64FnLwxP.mjs} +6 -5
  3. package/dist/{application-analysis-Do1WaGAY.mjs → application-analysis-Cx2S63z5.mjs} +48 -22
  4. package/dist/{application-routing-DrOFahHO.mjs → application-routing-BAXpnawu.mjs} +1 -1
  5. package/dist/{assets-DZBd7yqh.mjs → assets-Br6_BeFJ.mjs} +34 -27
  6. package/dist/{ast-Cv0JwXqb.mjs → ast-BkPQu7A0.mjs} +5 -1
  7. package/dist/{auth-BN0NU9dz.mjs → auth-Boz0lrb3.mjs} +1 -1
  8. package/dist/{auth-CCk9Seol.mjs → auth-DlLDymuc.mjs} +24 -12
  9. package/dist/{auth-link-DFQTA1jN.mjs → auth-link-C97r9p2N.mjs} +6 -6
  10. package/dist/{auth-router-BOiaDmcQ.mjs → auth-router-BmzEgzYx.mjs} +5 -5
  11. package/dist/{better-auth-shared-BqsMzU14.d.mts → better-auth-shared-BS3pDQbT.d.mts} +11 -6
  12. package/dist/{better-auth-shared-DRHo5FoG.mjs → better-auth-shared-BcqDt-37.mjs} +7 -2
  13. package/dist/{build-cmd-BCiXgjn9.mjs → build-cmd-BaFsyZrz.mjs} +13 -12
  14. package/dist/{cache-CUulshOu.mjs → cache-xO711ATQ.mjs} +6 -6
  15. package/dist/{cancel-deploy-BHGZo6KC.mjs → cancel-deploy-Di11ynsr.mjs} +5 -5
  16. package/dist/{cf-access-pejlJmuy.mjs → cf-access-DmkKPcAI.mjs} +0 -8
  17. package/dist/{cf-access-Dnyw8KFY.mjs → cf-access-FaIm95jA.mjs} +8 -4
  18. package/dist/{cf-build-output-bBx1gDll.mjs → cf-build-output-Ca201_n1.mjs} +27 -25
  19. package/dist/cf-build-output-Dy7N0hQN.mjs +1 -0
  20. package/dist/{cf-command-values-Ccl-zRhl.mjs → cf-command-values-5BPBRc9Z.mjs} +1 -1
  21. package/dist/cf-config-migrate-D271BTiw.mjs +1664 -0
  22. package/dist/{cf-worker-settings-CARs4Wy9.mjs → cf-worker-settings-BBdlhm9U.mjs} +1 -1
  23. package/dist/cli/cli.mjs +1 -1
  24. package/dist/cli/cloudflare-operation-process.mjs +223 -16
  25. package/dist/cli/env-schema-probe.d.mts +3 -1
  26. package/dist/cli/env-schema-probe.mjs +7 -8
  27. package/dist/{cli-main-hM7rhIbB.mjs → cli-main-DlW6lB8s.mjs} +153 -91
  28. package/dist/{client-BEYbgqZw.mjs → client-DkYzDEC0.mjs} +1 -1
  29. package/dist/{client-aIv5UQf3.mjs → client-ImIe7Mjq.mjs} +192 -17
  30. package/dist/{cloudflare-auth-pNvmT6kL.mjs → cloudflare-auth-eWfhdZCk.mjs} +1 -1
  31. package/dist/{cloudflare-cmd-DLcgInCa.mjs → cloudflare-cmd-SsFlJe2B.mjs} +7 -8
  32. package/dist/{cloudflare-config-BfEfIEuY.mjs → cloudflare-config-D9UFH_A5.mjs} +2 -2
  33. package/dist/{cloudflare-connect-CMcKtA02.mjs → cloudflare-connect-BgpHcSg3.mjs} +3 -3
  34. package/dist/{cloudflare-operations-DLhn_Bom.mjs → cloudflare-operations-BF0PSErW.mjs} +40 -24
  35. package/dist/cloudflare-operations-dpRD-2Px.mjs +1 -0
  36. package/dist/cloudflare-process-60r4Z2Zf.mjs +671 -0
  37. package/dist/cloudflare-user-output-CCR99eQY.mjs +19 -0
  38. package/dist/collect-B6nlSnsb.mjs +1 -0
  39. package/dist/{collect-C6Blu9yw.mjs → collect-rNLybAnF.mjs} +3 -3
  40. package/dist/{config-Do7gJI3T.mjs → config-BFX5ZB1J.mjs} +5 -4
  41. package/dist/{config-CbKmMpHK.mjs → config-BSoW3QCB.mjs} +5 -5
  42. package/dist/{config-DuiDZbq7.d.mts → config-DA6ZbLXO.d.mts} +3 -1
  43. package/dist/{config-CtkCfPpv.mjs → config-DtjrUtPo.mjs} +1 -1
  44. package/dist/{config-qgt863GH.mjs → config-Dv5jri1-.mjs} +10 -6
  45. package/dist/config-entry.d.mts +1 -1
  46. package/dist/{connect-DM3yCNPG.mjs → connect-DDRQGfFE.mjs} +9 -9
  47. package/dist/{create-project-BkVGXGNt.mjs → create-project-CY7sP8sI.mjs} +7 -6
  48. package/dist/{create-project-C-hNdYvD.mjs → create-project-Dro3K-az.mjs} +1 -1
  49. package/dist/{db-DQAi7Ckr.mjs → db-DmlaWVBu.mjs} +166 -121
  50. package/dist/db-seed-loader-Bcz_SutQ.mjs +253 -0
  51. package/dist/{db-types-BpPYAx0B.mjs → db-types-B4Cf9dzR.mjs} +8 -2
  52. package/dist/{delete-BtVnPGO2.mjs → delete-Uuq9ch6o.mjs} +6 -6
  53. package/dist/{deploy-Cs93Af-d.mjs → deploy-B9E7_rHC.mjs} +235 -558
  54. package/dist/deploy-BB3rsZbP.mjs +2 -0
  55. package/dist/{deploy-managed-static-CZIx3cc1.mjs → deploy-managed-static-IKZyuc1W.mjs} +123 -198
  56. package/dist/deploy-security-notice-C3LalelR.mjs +192 -0
  57. package/dist/{deploy-transport-DT-ALuDj.mjs → deploy-transport-BKP_oV9q.mjs} +4 -4
  58. package/dist/deploy.mjs +10 -9
  59. package/dist/{dev-inbox-BiamQEAa.mjs → dev-inbox-ClVjKEHy.mjs} +1 -1
  60. package/dist/direct-r2-upload-DFXLWfXV.mjs +204 -0
  61. package/dist/discover-D2KGP3cR.mjs +1 -0
  62. package/dist/{discover-Vd18lHsj.mjs → discover-IcspacCg.mjs} +1 -1
  63. package/dist/{dispatch-DPEuEblR.mjs → dispatch-DIhDA3NI.mjs} +38 -17
  64. package/dist/{dist-Cp4b1_T9.mjs → dist-C47zy_kJ.mjs} +1 -1
  65. package/dist/{dist-STQXl8ck.mjs → dist-Cr_xGE_K.mjs} +73 -38
  66. package/dist/{domain-cOhYYiHU.mjs → domain-B_xY1yZ5.mjs} +8 -10
  67. package/dist/{dotenv-CEI8hapP.mjs → dotenv-BG6RQavH.mjs} +2 -2
  68. package/dist/{drizzle-DBSpPpU1.mjs → drizzle-BJDMPrj7.mjs} +35 -30
  69. package/dist/{drizzle-D4V_06-B.mjs → drizzle-CQ5jWuDL.mjs} +1 -1
  70. package/dist/{email-CnnDqvXV.mjs → email-BIC15L7a.mjs} +47 -32
  71. package/dist/{email-cloudflare-CCIoQueP.mjs → email-cloudflare-C447nOqq.mjs} +195 -109
  72. package/dist/{email-pattern-BYr-EFq5.mjs → email-pattern-bRna9MOJ.mjs} +2 -2
  73. package/dist/{entry-DMgR7XOf.mjs → entry-Bwb9ev8K.mjs} +13 -10
  74. package/dist/{env-5bphL5mV.mjs → env-DJPZYHT5.mjs} +8 -8
  75. package/dist/{env-UqS-21xi.mjs → env-EjHqc7m9.mjs} +1 -1
  76. package/dist/{env-types-WEZw5D-r.mjs → env-types-D2hBodXP.mjs} +2 -19
  77. package/dist/{env-validation-DfJ9Fzfa.mjs → env-validation-D-v5_CWL.mjs} +13 -13
  78. package/dist/{env-validation-ly_Q9Kgd.mjs → env-validation-j9pjCDfA.mjs} +1 -1
  79. package/dist/{error-pages-QNeBXiRR.mjs → error-pages-GORL6F_e.mjs} +1 -1
  80. package/dist/{fetch-CbI6lNnk.d.mts → fetch-CczQyIed.d.mts} +1 -1
  81. package/dist/{fetch-DdK9eGin.mjs → fetch-CiEsvjpP.mjs} +1 -1
  82. package/dist/{fetch-stream-DQAavFdm.mjs → fetch-stream-BIG5lHW6.mjs} +3 -4
  83. package/dist/{fetch-stream-DoED9atq.d.mts → fetch-stream-DRX8-83b.d.mts} +2 -2
  84. package/dist/gen-CQDiPi8m.mjs +1 -0
  85. package/dist/{gen-CjcH6DJS.mjs → gen-DiTZlDx8.mjs} +21 -18
  86. package/dist/{generate-BOp1g1H_.mjs → generate-C3ZAqCy-.mjs} +1 -1
  87. package/dist/{generate-CWb8aOsm.mjs → generate-Dq2Bgw75.mjs} +6 -6
  88. package/dist/{git-metadata-Cukp5kV5.mjs → git-metadata-BEokJ6US.mjs} +1 -1
  89. package/dist/{github-cmd-CVDLb51-.mjs → github-cmd-DPmby8x-.mjs} +14 -9
  90. package/dist/{handler-w_FAiIRu.mjs → handler-DCrDLzw2.mjs} +3 -3
  91. package/dist/has-own-key-D9QEnAkF.mjs +5 -0
  92. package/dist/{head-0o0QoREY.mjs → head-BwQ5kgqt.mjs} +5 -4
  93. package/dist/{head-CVO92KEx.d.mts → head-fUp8n_QJ.d.mts} +9 -4
  94. package/dist/{headers-Cyr87J6Z.mjs → headers-DqBsjDxg.mjs} +7 -7
  95. package/dist/{help-B1cH8518.mjs → help-9wfMyXHb.mjs} +146 -69
  96. package/dist/help-Dy3w4rPq.mjs +1 -0
  97. package/dist/{inbound-BHt4dIlL.d.mts → inbound-CwgZSqFI.d.mts} +9 -3
  98. package/dist/{inbound--OF7zkwX.mjs → inbound-feMn1Rxx.mjs} +7 -7
  99. package/dist/{index-CmqHYj2R.d.mts → index-8cAgNdb6.d.mts} +1 -1
  100. package/dist/{index-BTmhCDbw.d.mts → index-BQ5qYiAw.d.mts} +2 -2
  101. package/dist/{index-BESZTC1z.d.mts → index-BYcWajVp.d.mts} +2 -1
  102. package/dist/{index-BXdP39qx.d.mts → index-Dn2mkPr2.d.mts} +24 -23
  103. package/dist/index.d.mts +2 -2
  104. package/dist/index.mjs +351 -444
  105. package/dist/{info-BE3snw2_.mjs → info-BWEWaOBo.mjs} +4 -4
  106. package/dist/{init-BrS5MAiJ.mjs → init-BuTPVLPO.mjs} +737 -546
  107. package/dist/{isr-config-Czzb4mIq.mjs → isr-config-DiTnL9Tb.mjs} +5 -5
  108. package/dist/{link-BbzyrCBD.mjs → link-BiesPyT4.mjs} +7 -7
  109. package/dist/{list-DmppHjVc.mjs → list-CkonftPQ.mjs} +11 -7
  110. package/dist/{live-DvtxTUhW.mjs → live-dvGThbwy.mjs} +14 -17
  111. package/dist/{load-user-env-BltIJLtl.mjs → load-user-env-B8qC0Q2Y.mjs} +1 -1
  112. package/dist/{local-d1-DLxsKmkw.mjs → local-d1-CYOYkVwO.mjs} +3 -3
  113. package/dist/{login-Cihxnu7m.mjs → login-BSOSah1j.mjs} +8 -6
  114. package/dist/login-DWCZeCX9.mjs +1 -0
  115. package/dist/{logs-BCgLeLNd.mjs → logs-HOBUnroa.mjs} +9 -9
  116. package/dist/{migrate-DOK67gE-.mjs → migrate-BNZL1hee.mjs} +9 -10
  117. package/dist/migrate-C9aoWLvY.mjs +1 -0
  118. package/dist/{migrations-ByS7r3HV.mjs → migrations-CUHhX65Y.mjs} +15 -12
  119. package/dist/{mime-BGoZ8ZLL.mjs → mime-Btw9R3CC.mjs} +26 -12
  120. package/dist/{mysql-sql-SlpS6OMg.mjs → mysql-sql-CB52k8tQ.mjs} +45 -22
  121. package/dist/nitro.d.mts +3 -0
  122. package/dist/nitro.mjs +14 -5
  123. package/dist/{node-qXD3FbIU.mjs → node-DVJWfV6s.mjs} +6 -6
  124. package/dist/node-buffer-D7kgjaDs.mjs +4 -0
  125. package/dist/{operator-ai-logging-CNuX5uKg.mjs → operator-ai-logging-ZDqqhnIq.mjs} +11 -10
  126. package/dist/operator-args-DCkWbgT-.mjs +1499 -0
  127. package/dist/{operator-auth-CD3pap65.mjs → operator-auth-BjoPLgja.mjs} +2 -2
  128. package/dist/{operator-client-XvXTkea6.mjs → operator-client-DzebIntv.mjs} +3 -3
  129. package/dist/{operator-cmd-D0vSUVle.mjs → operator-cmd-AZoeI9Pl.mjs} +28 -12
  130. package/dist/operator-cmd-DEnHFmJF.mjs +1 -0
  131. package/dist/operator-security-Bo26FP01.mjs +263 -0
  132. package/dist/{output-DNVILSz2.mjs → output-BZLnu0z8.mjs} +39 -4
  133. package/dist/output-D7K9TWIA.mjs +1 -0
  134. package/dist/{package-json-DvS6IFRv.mjs → package-json-4xUI3xLz.mjs} +1 -1
  135. package/dist/pages/client.d.mts +53 -30
  136. package/dist/pages/client.mjs +93 -31
  137. package/dist/pages/head.d.mts +1 -1
  138. package/dist/pages/head.mjs +1 -1
  139. package/dist/pages/index.d.mts +2 -2
  140. package/dist/pages/index.mjs +7 -7
  141. package/dist/pages/islands-plugin.d.mts +26 -8
  142. package/dist/pages/islands-plugin.mjs +61 -22
  143. package/dist/pages/protocol.d.mts +2 -2
  144. package/dist/pages/protocol.mjs +1 -1
  145. package/dist/pages/serialize.mjs +1 -1
  146. package/dist/{pgpass-CEtnBOZO.mjs → pgpass-BLPoYN9_.mjs} +3 -2
  147. package/dist/platform-args-DNbNZ_RR.mjs +1 -0
  148. package/dist/{platform-args-DQSMW4EP.mjs → platform-args-lwCyQ6Xy.mjs} +37 -9
  149. package/dist/{platform-auth-config-V2ifSLQ-.mjs → platform-auth-config-DLRMPw1G.mjs} +26 -23
  150. package/dist/{platform-auth-protection-BybVCUzi.mjs → platform-auth-protection-HSmLmD3d.mjs} +10 -10
  151. package/dist/{platform-auth-recovery-kH1-h8Ch.mjs → platform-auth-recovery-BXPhTlKa.mjs} +11 -9
  152. package/dist/{platform-cmd-B1jtqXnu.mjs → platform-cmd-CqRjxFEU.mjs} +1 -1
  153. package/dist/{platform-cmd-BHWdh1Hx.mjs → platform-cmd-DJ-fOYhL.mjs} +11 -11
  154. package/dist/{platform-discovery-B0eZjZ3B.mjs → platform-discovery-CLxtixHJ.mjs} +1 -1
  155. package/dist/{platform-domain-DB_KpVhg.mjs → platform-domain-CRsRJOws.mjs} +14 -10
  156. package/dist/{platform-lifecycle-BoOTmH6H.mjs → platform-lifecycle-bx_kpqo7.mjs} +1 -1
  157. package/dist/{platform-lifecycle-C6fUuj4y.mjs → platform-lifecycle-fau3VKv6.mjs} +773 -206
  158. package/dist/platform-management-BRGhD-oF.mjs +1 -0
  159. package/dist/{platform-management-B8-pOxoJ.mjs → platform-management-CnKBdDx5.mjs} +227 -58
  160. package/dist/{platform-plans-config-iczSDkQK.mjs → platform-plans-config-2C3_5EDs.mjs} +112 -35
  161. package/dist/{platform-recovery-ZAXin6WK.mjs → platform-recovery-poxgOOAY.mjs} +5 -5
  162. package/dist/{platform-registry-DZ_2Xuqd.mjs → platform-registry-DHH6fivm.mjs} +6 -5
  163. package/dist/{platform-setup-CpcHLI-0.mjs → platform-setup-DYylapHD.mjs} +26 -12
  164. package/dist/{plugin-inference-BGamcCqB.mjs → plugin-inference-7O11_E4H.mjs} +26 -26
  165. package/dist/{prepare-BrAkXTTB.mjs → prepare-BbvlKreR.mjs} +12 -12
  166. package/dist/prepare-BmG2E6TI.mjs +1 -0
  167. package/dist/{prepare-Cjt6EM0d.mjs → prepare-DWjn1Lzd.mjs} +3 -3
  168. package/dist/{project-cmd-wtCuc8Ln.mjs → project-cmd-DyUEFi2b.mjs} +30 -24
  169. package/dist/{project-CLwxcEdq.mjs → project-dh9431bN.mjs} +2 -2
  170. package/dist/{project-paths-CUhCPMpK.mjs → project-paths-2ENfCCih.mjs} +4 -3
  171. package/dist/project-security--tYGFPGo.mjs +1340 -0
  172. package/dist/project-security-DZEQgnsS.mjs +1 -0
  173. package/dist/{project-team-CZFvPIJ-.mjs → project-team-BszTHgzC.mjs} +8 -8
  174. package/dist/{project-token-C3TxkWeC.mjs → project-token-DBDy4NdV.mjs} +6 -6
  175. package/dist/{project-tsconfig-MyRJgufB.mjs → project-tsconfig-BOA4ym99.mjs} +25 -5
  176. package/dist/{project-DVsTAWFh.mjs → project-uXKua1it.mjs} +1 -1
  177. package/dist/project-zero-trust-D9sUouij.mjs +210 -0
  178. package/dist/{protocol-W5EQcIzN.mjs → protocol-CE3wP-H1.mjs} +5 -5
  179. package/dist/{protocol-BlAiF-hc.d.mts → protocol-ERy-n3jf.d.mts} +7 -4
  180. package/dist/{provision-CknEbPuw.mjs → provision-Bh44omGA.mjs} +39 -29
  181. package/dist/provision-DFv7SJDn.mjs +1 -0
  182. package/dist/{public-B80SwOFp.d.mts → public-DB9C2Cy_.d.mts} +5 -2
  183. package/dist/{raw-7pQirZpQ.mjs → raw-5rak34QN.mjs} +2 -1
  184. package/dist/{redirect-Dqb4fEc5.mjs → redirect-DD825Stf.mjs} +1 -1
  185. package/dist/{requests-FaA9M3RX.mjs → requests-CBokjiOi.mjs} +6 -6
  186. package/dist/{resolve-project-Da3OgCU1.mjs → resolve-project-8WZ3iVmr.mjs} +3 -3
  187. package/dist/resolve-project-YsTH-U9I.mjs +1 -0
  188. package/dist/{rollback-DM6pZ23Y.mjs → rollback-CEeHNFUn.mjs} +16 -7
  189. package/dist/route-types-CSed9-Dp.mjs +435 -0
  190. package/dist/{route-url-BBdkU7rb.mjs → route-url-B41eQ8QI.mjs} +1 -1
  191. package/dist/{route-url-Di1kB8D_.d.mts → route-url-Bd6IX-JZ.d.mts} +2 -1
  192. package/dist/routes-stub.d.mts +1 -1
  193. package/dist/routes-stub.mjs +1 -1
  194. package/dist/{runner-CTk21HrO.mjs → runner-Bf94YVJK.mjs} +1 -1
  195. package/dist/{runner-CMZb7jNU.mjs → runner-CeguHWJx.mjs} +3 -2
  196. package/dist/{runner-mysql-CJ-HyqxV.mjs → runner-mysql-3XDKrn-g.mjs} +13 -9
  197. package/dist/{runner-mysql-C_PrAUTm.mjs → runner-mysql-r688x6Y9.mjs} +1 -1
  198. package/dist/{runner-pg-mYc75KfH.mjs → runner-pg-Buzw17hl.mjs} +1 -1
  199. package/dist/{runner-pg-2pjltt0t.mjs → runner-pg-DMJquR3d.mjs} +1 -1
  200. package/dist/runtime/ai/index.d.mts +1 -0
  201. package/dist/runtime/ai/index.mjs +26 -11
  202. package/dist/runtime/auth/better-auth-d1.d.mts +1 -1
  203. package/dist/runtime/auth/better-auth-d1.mjs +2 -2
  204. package/dist/runtime/auth/better-auth-mysql.d.mts +1 -1
  205. package/dist/runtime/auth/better-auth-mysql.mjs +2 -2
  206. package/dist/runtime/auth/better-auth-postgres.d.mts +1 -1
  207. package/dist/runtime/auth/better-auth-postgres.mjs +3 -3
  208. package/dist/runtime/client/fetch-server.d.mts +1 -1
  209. package/dist/runtime/client/fetch-server.mjs +2 -2
  210. package/dist/runtime/client/fetch-stream.d.mts +2 -2
  211. package/dist/runtime/client/fetch-stream.mjs +1 -1
  212. package/dist/runtime/client/fetch.d.mts +1 -1
  213. package/dist/runtime/client/fetch.mjs +1 -1
  214. package/dist/runtime/client/index.d.mts +2 -2
  215. package/dist/runtime/client/index.mjs +2 -2
  216. package/dist/runtime/client/react.d.mts +2 -2
  217. package/dist/runtime/client/react.mjs +2 -2
  218. package/dist/runtime/client/solid.d.mts +2 -2
  219. package/dist/runtime/client/solid.mjs +2 -2
  220. package/dist/runtime/client/svelte.d.mts +2 -2
  221. package/dist/runtime/client/svelte.mjs +2 -2
  222. package/dist/runtime/client/vue.d.mts +2 -2
  223. package/dist/runtime/client/vue.mjs +2 -2
  224. package/dist/runtime/db/index.d.mts +8 -2
  225. package/dist/runtime/db/index.mjs +21 -8
  226. package/dist/runtime/db/migrations/mysql-handler.mjs +1 -1
  227. package/dist/runtime/db/migrations/postgres-handler.mjs +1 -1
  228. package/dist/runtime/db/session.d.mts +2 -0
  229. package/dist/runtime/db/session.mjs +1 -0
  230. package/dist/runtime/durable/index.mjs +7 -5
  231. package/dist/runtime/email/index.d.mts +1 -1
  232. package/dist/runtime/email/index.mjs +14 -11
  233. package/dist/runtime/email/testing.d.mts +1 -1
  234. package/dist/runtime/email/testing.mjs +4 -4
  235. package/dist/runtime/env/public-client.d.mts +4 -1
  236. package/dist/runtime/env/public.d.mts +1 -1
  237. package/dist/runtime/env/public.mjs +2 -2
  238. package/dist/runtime/env/runtime.mjs +1 -1
  239. package/dist/runtime/handler/index.d.mts +1 -1
  240. package/dist/runtime/handler/index.mjs +1 -1
  241. package/dist/runtime/handler/validator.d.mts +1 -1
  242. package/dist/runtime/handler/validator.mjs +1 -1
  243. package/dist/runtime/isr/index.mjs +1 -1
  244. package/dist/runtime/kv/index.mjs +1 -1
  245. package/dist/runtime/live/client.d.mts +2 -2
  246. package/dist/runtime/live/client.mjs +7 -7
  247. package/dist/runtime/live/index.d.mts +1 -1
  248. package/dist/runtime/live/index.mjs +1 -1
  249. package/dist/runtime/live/server.mjs +3 -3
  250. package/dist/runtime/queues/index.mjs +2 -2
  251. package/dist/runtime/remote/index.d.mts +5 -1
  252. package/dist/runtime/remote/index.mjs +10 -9
  253. package/dist/runtime/routing/index.d.mts +11 -12
  254. package/dist/runtime/routing/index.mjs +69 -65
  255. package/dist/runtime/routing/route-url.d.mts +1 -1
  256. package/dist/runtime/routing/route-url.mjs +1 -1
  257. package/dist/runtime/sandbox/index.d.mts +1 -1
  258. package/dist/runtime/sandbox/index.mjs +2 -2
  259. package/dist/runtime/sse/client.d.mts +1 -1
  260. package/dist/runtime/sse/index.mjs +1 -1
  261. package/dist/runtime/storage/index.mjs +1 -1
  262. package/dist/runtime/ws/index.d.mts +1 -1
  263. package/dist/runtime/ws/index.mjs +3 -2
  264. package/dist/runtime/ws/room.d.mts +1 -1
  265. package/dist/runtime/ws/room.mjs +2 -2
  266. package/dist/runtime/ws/server.d.mts +2 -2
  267. package/dist/runtime/ws/server.mjs +1 -1
  268. package/dist/{runtime-zDDinDI5.mjs → runtime-C_VPIJBF.mjs} +1 -1
  269. package/dist/{scan-tDExXbA1.mjs → scan-Ct_SEzH4.mjs} +36 -29
  270. package/dist/{secret-DDNLIQOT.mjs → secret-Deqo3n_N.mjs} +11 -10
  271. package/dist/security-api-types-CU7zQtr_.mjs +9 -0
  272. package/dist/security-sarif-ClyYwtAW.mjs +123 -0
  273. package/dist/{serialize-Pf-CIQK_.mjs → serialize-BmB4BfKu.mjs} +1 -1
  274. package/dist/{server-CfUbeOjx.mjs → server-T-4mn8zy.mjs} +5 -4
  275. package/dist/session-BT8XDkvL.mjs +45 -0
  276. package/dist/session-ouZYD7zb.d.mts +18 -0
  277. package/dist/{skills-CoBB9_Ao.mjs → skills-C-csz78e.mjs} +10 -17
  278. package/dist/{sse-BXnTfcf3.mjs → sse-D3ab0YQT.mjs} +16 -13
  279. package/dist/{static-exports-DFkzL-NX.mjs → static-exports-s7P86Ngp.mjs} +3 -3
  280. package/dist/{subcommand-prompt-0yIARXf2.mjs → subcommand-prompt-B4LOLosl.mjs} +31 -21
  281. package/dist/sveltekit.mjs +1 -1
  282. package/dist/{terminal-log-text-DNsWJREL.mjs → terminal-log-text-CfS2JKM6.mjs} +1 -1
  283. package/dist/{url-DaehRGKR.mjs → url-DBQluotE.mjs} +4 -1
  284. package/dist/validate-CZYUIfR-.mjs +1 -0
  285. package/dist/{validate-Ddzl-IwT.mjs → validate-CtBWCzez.mjs} +7 -4
  286. package/dist/{validator-Duafcnh7.mjs → validator-Dfh9kCDm.mjs} +5 -5
  287. package/dist/{version-metadata-DEmItNdS.mjs → version-metadata-DqgLa6gc.mjs} +1 -1
  288. package/dist/{wrangler-D1zq1rXr.mjs → wrangler-DVe5KV5G.mjs} +49 -46
  289. package/dist/wrangler-Dq269bjx.mjs +1 -0
  290. package/dist/{wrapper-C2gMY432.mjs → wrapper-CcMYpOS8.mjs} +45 -171
  291. package/docs/guide/ai.md +13 -0
  292. package/docs/guide/app-types.md +1 -1
  293. package/docs/guide/auth.md +2 -16
  294. package/docs/guide/database/d1.md +283 -3
  295. package/docs/guide/database.md +2 -0
  296. package/docs/guide/email/domains.md +8 -6
  297. package/docs/guide/email/sending.md +18 -1
  298. package/docs/guide/pages-routing/actions-and-forms.md +4 -4
  299. package/docs/guide/pages-routing/head.md +20 -2
  300. package/docs/guide/platform/administration/plans.md +13 -0
  301. package/docs/guide/platform/administration/security-audits.md +213 -0
  302. package/docs/guide/platform/administration/zero-trust.md +6 -0
  303. package/docs/guide/platform/development/local.md +3 -5
  304. package/docs/guide/platform/installation/ci.md +1 -1
  305. package/docs/guide/platform/installation/credentials.md +23 -20
  306. package/docs/guide/platform/installation/maintenance.md +8 -2
  307. package/docs/guide/platform/installation/prerequisites.md +1 -1
  308. package/docs/guide/platform/installation/uninstall.md +2 -0
  309. package/docs/guide/platform-administration.md +1 -0
  310. package/docs/guide/self-hosted-platform.md +14 -13
  311. package/docs/guide/type-safety.md +1 -1
  312. package/docs/integrations/cloudflare.md +5 -3
  313. package/docs/reference/api/database.md +42 -2
  314. package/docs/reference/api/handlers.md +3 -3
  315. package/docs/reference/api/types.md +11 -1
  316. package/docs/reference/api.md +1 -1
  317. package/docs/reference/cli/database.md +6 -3
  318. package/docs/reference/cli/deploy.md +17 -13
  319. package/docs/reference/cli/domains.md +1 -1
  320. package/docs/reference/cli/email.md +3 -3
  321. package/docs/reference/cli/platform-config.md +5 -3
  322. package/docs/reference/cli/platform-installation.md +29 -28
  323. package/docs/reference/cli/platform-security.md +98 -0
  324. package/docs/reference/cli/platform-zero-trust.md +2 -0
  325. package/docs/reference/cli/platform.md +1 -0
  326. package/docs/reference/cli/project.md +57 -0
  327. package/docs/reference/cli.md +3 -1
  328. package/docs/reference/config.md +7 -6
  329. package/package.json +31 -27
  330. package/schema.json +7 -1
  331. package/skills/void/SKILL.md +8 -0
  332. package/dist/cf-build-output-D3_x71H6.mjs +0 -1
  333. package/dist/cf-config-migrate-CHtnM3_C.mjs +0 -348
  334. package/dist/cloudflare-operations-C5RTQNnh.mjs +0 -1
  335. package/dist/cloudflare-process-wcnaQ5JG.mjs +0 -392
  336. package/dist/cloudflare-user-output-zEwuGrEJ.mjs +0 -19
  337. package/dist/collect-8i0wU63d.mjs +0 -1
  338. package/dist/deploy-rUunHBNJ.mjs +0 -2
  339. package/dist/discover-Diq0l6TZ.mjs +0 -1
  340. package/dist/gen-BQ7itmK7.mjs +0 -1
  341. package/dist/help-Ld6XFol7.mjs +0 -1
  342. package/dist/login-C-n1rA0s.mjs +0 -1
  343. package/dist/migrate-CKn30rmw.mjs +0 -1
  344. package/dist/operator-args-BCCohcz3.mjs +0 -722
  345. package/dist/operator-cmd-BnLoIO2A.mjs +0 -1
  346. package/dist/output-BsdnNpxa.mjs +0 -1
  347. package/dist/platform-args-Rgp86xa7.mjs +0 -1
  348. package/dist/platform-management-7Bf_OgS5.mjs +0 -1
  349. package/dist/prepare-CI7_C9Xf.mjs +0 -1
  350. package/dist/project-zero-trust-DrRyAHW1.mjs +0 -64
  351. package/dist/provision-DdWqRmmr.mjs +0 -1
  352. package/dist/resolve-project-C5wC-Hoi.mjs +0 -1
  353. package/dist/route-types-CrODgORq.mjs +0 -655
  354. package/dist/validate-DY1U9rET.mjs +0 -1
  355. package/dist/wrangler-DM3GOqck.mjs +0 -1
@@ -0,0 +1,1499 @@
1
+ import { t as OPERATOR_MAX_TIMEOUT_MS } from "./operator-client-DzebIntv.mjs";
2
+ import { t as hasOwnKey } from "./has-own-key-D9QEnAkF.mjs";
3
+ import { parsePlatformLoginId } from "@void/platform";
4
+ import { parseSecurityDigits } from "@void/platform/security-policy";
5
+ // src/cli/project-security-args.ts
6
+ /** Arguments of `void project security …` (spec §13.3). */
7
+ const SECURITY_COMMENT_MAX_CHARS = 4e3;
8
+ const SEVERITIES$1 = [
9
+ "critical",
10
+ "high",
11
+ "medium",
12
+ "low",
13
+ "informational"
14
+ ];
15
+ const STATES = /* @__PURE__ */ new Set([
16
+ "open",
17
+ "resolved",
18
+ "all"
19
+ ]);
20
+ const REASONS$1 = {
21
+ fixed: "fixed",
22
+ "false-positive": "false_positive",
23
+ "accepted-risk": "accepted_risk"
24
+ };
25
+ const MAX_BUDGET_USD = 1e6;
26
+ const VALUE_FLAGS = new Set("--project --reason --comment --state --severity --limit --usd --format".split(" "));
27
+ const BOOLEAN_FLAGS = new Set("--json --urgent --leads --default --accept-provider-notice --off --yes --client-assets --no-wait".split(" "));
28
+ const ACTION_FLAGS = {
29
+ status: [],
30
+ list: [
31
+ "--urgent",
32
+ "--state",
33
+ "--severity",
34
+ "--leads",
35
+ "--format"
36
+ ],
37
+ show: [],
38
+ comment: [],
39
+ resolve: ["--reason", "--comment"],
40
+ reopen: ["--comment"],
41
+ severity: ["--comment"],
42
+ scans: ["--limit"],
43
+ scan: ["--yes", "--client-assets"],
44
+ check: ["--yes", "--no-wait"],
45
+ model: ["--default", "--accept-provider-notice"],
46
+ budget: ["--usd", "--off"],
47
+ open: []
48
+ };
49
+ /** `F-12`, `f-12` or `12` → `F-12`; anything else is `null`. */
50
+ function normalizeFindingId(value) {
51
+ const text = value.trim();
52
+ let digits = text;
53
+ if (text[0] === "F" || text[0] === "f") {
54
+ digits = text.slice(1);
55
+ if (digits[0] === "-") digits = digits.slice(1);
56
+ }
57
+ return parseSecurityDigits(digits, 9) === null || digits.startsWith("0") ? null : `F-${digits}`;
58
+ }
59
+ function parseFindingIds(values) {
60
+ const ids = [];
61
+ for (const value of values) for (const part of value.split(",")) {
62
+ if (part.trim() === "") continue;
63
+ const id = normalizeFindingId(part);
64
+ if (!id) throw new Error(`project: '${part.trim()}' is not a finding id. Use a form like F-12.`);
65
+ if (!ids.includes(id)) ids.push(id);
66
+ }
67
+ return ids;
68
+ }
69
+ /** The first finding id in one positional. */
70
+ function firstFindingId(value) {
71
+ const id = parseFindingIds([value])[0];
72
+ if (!id) throw new Error(`project: '${value}' is not a finding id. Use a form like F-12.`);
73
+ return id;
74
+ }
75
+ /** `40` or `12.50`: digits, then at most two decimals. */
76
+ function isDollarAmount(value) {
77
+ const [whole = "", cents, ...extra] = value.split(".");
78
+ return extra.length === 0 && parseSecurityDigits(whole, value.length) !== null && (cents === void 0 || parseSecurityDigits(cents, 2) !== null);
79
+ }
80
+ function parseUsd(value) {
81
+ if (!isDollarAmount(value)) throw new Error("project: --usd must be a dollar amount such as 40 or 12.50.");
82
+ const usd = Number(value);
83
+ if (!Number.isFinite(usd) || usd > MAX_BUDGET_USD) throw new Error(`project: --usd must be at most ${MAX_BUDGET_USD}.`);
84
+ return usd;
85
+ }
86
+ function requireComment(value) {
87
+ const text = value?.trim() ?? "";
88
+ if (text === "") throw new Error("project: A comment is required. Say why, for example: --comment \"Added requireAdmin() in a1b2c3\"");
89
+ if (Array.from(text).length > 4e3) throw new Error(`project: A comment can be at most ${SECURITY_COMMENT_MAX_CHARS} characters.`);
90
+ return text;
91
+ }
92
+ function parseSecurityArgs(rest) {
93
+ const [action = "", ...args] = rest;
94
+ if (action !== "" && !hasOwnKey(ACTION_FLAGS, action)) throw new Error(`project: Usage: void project security <${Object.keys(ACTION_FLAGS).join("|")}> [--project <slug>] [--json].`);
95
+ const values = /* @__PURE__ */ new Map();
96
+ const flags = /* @__PURE__ */ new Set();
97
+ const positionals = [];
98
+ const allowed = /* @__PURE__ */ new Set([
99
+ "--project",
100
+ "--json",
101
+ ...action === "" ? [] : ACTION_FLAGS[action]
102
+ ]);
103
+ for (let index = 0; index < args.length; index++) {
104
+ const arg = args[index];
105
+ if (BOOLEAN_FLAGS.has(arg) || VALUE_FLAGS.has(arg)) {
106
+ if (!allowed.has(arg)) throw new Error(`project: ${arg} is not used with security ${action || "<command>"}.`);
107
+ if (flags.has(arg) || values.has(arg)) throw new Error(`project: Duplicate flag '${arg}'.`);
108
+ if (BOOLEAN_FLAGS.has(arg)) {
109
+ flags.add(arg);
110
+ continue;
111
+ }
112
+ const value = args[++index];
113
+ if (value === void 0 || !(arg === "--comment" || arg === "--usd") && value.startsWith("-")) throw new Error(`project: ${arg} requires a value.`);
114
+ values.set(arg, value);
115
+ } else if (arg.startsWith("-") && !(action === "comment" && positionals.length >= 1)) throw new Error(`project: Unknown flag '${arg}'.`);
116
+ else positionals.push(arg);
117
+ }
118
+ const base = {
119
+ subcommand: "security",
120
+ projectSlug: values.get("--project") ?? ""
121
+ };
122
+ const json = flags.has("--json");
123
+ const noPositionals = () => {
124
+ if (positionals.length > 0) throw new Error(`project: Unexpected argument '${positionals[0]}'.`);
125
+ };
126
+ if (action === "" || action === "status" || action === "open") {
127
+ noPositionals();
128
+ return {
129
+ ...base,
130
+ json,
131
+ action
132
+ };
133
+ }
134
+ if (action === "list") {
135
+ noPositionals();
136
+ const state = values.get("--state") ?? "open";
137
+ if (!STATES.has(state)) throw new Error(`project: Invalid --state '${state}'. Use one of open|resolved|all.`);
138
+ const severity = values.get("--severity") ?? null;
139
+ if (severity !== null && !SEVERITIES$1.includes(severity)) throw new Error(`project: Invalid --severity '${severity}'. Use one of ${SEVERITIES$1.join("|")}.`);
140
+ const format = values.get("--format") ?? "text";
141
+ if (format !== "text" && format !== "sarif") throw new Error(`project: Invalid --format '${format}'. Use text or sarif.`);
142
+ if (format === "sarif" && json) throw new Error("project: Use --format sarif or --json, not both.");
143
+ return {
144
+ ...base,
145
+ json,
146
+ action,
147
+ format,
148
+ urgent: flags.has("--urgent"),
149
+ state,
150
+ severity,
151
+ leads: flags.has("--leads")
152
+ };
153
+ }
154
+ if (action === "show" || action === "reopen") {
155
+ if (positionals.length !== 1) throw new Error(`project: Usage: void project security ${action} <F-id>${action === "reopen" ? " --comment \"<text>\"" : ""}.`);
156
+ const id = firstFindingId(positionals[0]);
157
+ if (action === "show") return {
158
+ ...base,
159
+ json,
160
+ action,
161
+ id
162
+ };
163
+ return {
164
+ ...base,
165
+ json,
166
+ action,
167
+ id,
168
+ comment: requireComment(values.get("--comment"))
169
+ };
170
+ }
171
+ if (action === "comment") {
172
+ if (positionals.length !== 2) throw new Error("project: Usage: void project security comment <F-id> \"<text>\".");
173
+ const id = firstFindingId(positionals[0]);
174
+ return {
175
+ ...base,
176
+ json,
177
+ action,
178
+ id,
179
+ text: requireComment(positionals[1])
180
+ };
181
+ }
182
+ if (action === "resolve") {
183
+ const ids = parseFindingIds(positionals);
184
+ if (ids.length === 0) throw new Error("project: Usage: void project security resolve <F-id>… --reason fixed|false-positive|accepted-risk --comment \"<text>\".");
185
+ const reasonText = values.get("--reason");
186
+ const reason = reasonText !== void 0 && hasOwnKey(REASONS$1, reasonText) ? REASONS$1[reasonText] : void 0;
187
+ if (!reason) throw new Error("project: --reason is required: fixed, false-positive or accepted-risk.");
188
+ return {
189
+ ...base,
190
+ json,
191
+ action,
192
+ ids,
193
+ reason,
194
+ comment: requireComment(values.get("--comment"))
195
+ };
196
+ }
197
+ if (action === "severity") {
198
+ const usage = `project: Usage: void project security severity <F-id> <${SEVERITIES$1.join("|")}|scan> --comment "<text>".`;
199
+ if (positionals.length !== 2) throw new Error(usage);
200
+ const id = firstFindingId(positionals[0]);
201
+ const level = positionals[1];
202
+ if (level !== "scan" && !SEVERITIES$1.includes(level)) throw new Error(`project: Invalid severity '${level}'. Use one of ${SEVERITIES$1.join("|")}, or scan to use the scan severity again.`);
203
+ return {
204
+ ...base,
205
+ json,
206
+ action,
207
+ id,
208
+ severity: level === "scan" ? null : level,
209
+ comment: requireComment(values.get("--comment"))
210
+ };
211
+ }
212
+ if (action === "scans") {
213
+ noPositionals();
214
+ const text = values.get("--limit");
215
+ let limit = 10;
216
+ if (text !== void 0) {
217
+ limit = Number(text);
218
+ if (!Number.isInteger(limit) || limit < 1 || limit > 100) throw new Error("project: --limit must be a whole number from 1 to 100.");
219
+ }
220
+ return {
221
+ ...base,
222
+ json,
223
+ action,
224
+ limit
225
+ };
226
+ }
227
+ if (action === "scan") {
228
+ noPositionals();
229
+ return {
230
+ ...base,
231
+ json,
232
+ action,
233
+ yes: flags.has("--yes"),
234
+ clientAssets: flags.has("--client-assets")
235
+ };
236
+ }
237
+ if (action === "check") {
238
+ if (positionals.length > 1) throw new Error(`project: Unexpected argument '${positionals[1]}'.`);
239
+ const checkId = positionals[0] ?? "";
240
+ if (checkId.length > 64) throw new Error(`project: '${checkId.slice(0, 64)}…' is not a check id.`);
241
+ if (checkId !== "" && flags.has("--yes")) throw new Error("project: --yes is used only when a new check starts.");
242
+ return {
243
+ ...base,
244
+ json,
245
+ action,
246
+ checkId,
247
+ yes: flags.has("--yes"),
248
+ wait: !flags.has("--no-wait")
249
+ };
250
+ }
251
+ if (action === "model") {
252
+ if (positionals.length > 1) throw new Error(`project: Unexpected argument '${positionals[1]}'.`);
253
+ const useDefault = flags.has("--default");
254
+ if (useDefault && positionals.length > 0) throw new Error("project: Pass a model id or --default, not both.");
255
+ const acceptNotice = flags.has("--accept-provider-notice");
256
+ if (acceptNotice && !useDefault && positionals.length === 0) throw new Error("project: --accept-provider-notice needs a model id or --default.");
257
+ return {
258
+ ...base,
259
+ json,
260
+ action,
261
+ change: useDefault ? "default" : positionals.length > 0 ? "set" : "show",
262
+ model: positionals[0] ?? "",
263
+ acceptNotice
264
+ };
265
+ }
266
+ noPositionals();
267
+ const usdText = values.get("--usd");
268
+ if (usdText !== void 0 && flags.has("--off")) throw new Error("project: Pass --usd <amount> or --off, not both.");
269
+ return {
270
+ ...base,
271
+ json,
272
+ action: "budget",
273
+ change: flags.has("--off") ? "off" : usdText === void 0 ? "show" : "set",
274
+ usd: usdText === void 0 ? 0 : parseUsd(usdText)
275
+ };
276
+ }
277
+ const securityOperatorCommands = [
278
+ {
279
+ action: "status",
280
+ description: "Inspect capability, last probe, policy, queue depth, running scans and month totals",
281
+ path: "/security/status"
282
+ },
283
+ {
284
+ action: "probe",
285
+ description: "Run the entitlement probe (checks Containers, Workers AI and model hosts)",
286
+ path: "/security/probe",
287
+ method: "POST",
288
+ noConfirm: true
289
+ },
290
+ {
291
+ action: "policy",
292
+ description: "Set the scan mode (disabled, public or all), or one project’s own scan rule",
293
+ path: "/security/policy",
294
+ positional: ["mode"],
295
+ usage: ["void platform security policy <disabled|public|all> [options]", "void platform security policy --project <project-id> <inherit|always|never> [options]"],
296
+ values: { project: "Project id whose own rule to set: inherit follows the mode, always scans it, never skips it" },
297
+ method: "POST"
298
+ },
299
+ {
300
+ action: "models",
301
+ description: "Set the default model, block or unblock models, or save your own OpenAI or Anthropic key",
302
+ path: "/security/policy",
303
+ usage: ["void platform security models [--default <id>] [--block <id,…>] [--unblock <id,…>] [--accept-provider-notice] [options]", "void platform security models --provider <openai|anthropic> (--key-stdin | --remove-key) [options]"],
304
+ values: {
305
+ default: "Default model id",
306
+ block: "Comma-separated model ids to block",
307
+ unblock: "Comma-separated model ids to unblock",
308
+ provider: "openai or anthropic: the provider whose key --key-stdin or --remove-key changes"
309
+ },
310
+ booleans: {
311
+ "accept-provider-notice": "Accept the current provider notice (needed for a third-party model)",
312
+ "key-stdin": "Read your own provider API key from stdin; scans with that provider bill to it",
313
+ "remove-key": "Remove your saved provider key; scans go back to Unified Billing credits"
314
+ },
315
+ method: "POST"
316
+ },
317
+ {
318
+ action: "limits",
319
+ description: "Set scan limits: concurrent scans and the time one scan may run",
320
+ path: "/security/policy",
321
+ values: {
322
+ concurrency: "Scans that run at once (1 to 10)",
323
+ "scan-timeout": "Minutes one scan may run (5 to 60)"
324
+ },
325
+ method: "POST"
326
+ },
327
+ {
328
+ action: "budget",
329
+ description: "Show the monthly caps and this month’s spend, or set the platform cap, the default project cap or one project’s limit",
330
+ path: "/security/budget",
331
+ usage: ["void platform security budget [--platform-usd <n> | --platform-off] [--project-default-usd <n>] [--project-caps <on|off>] [--project <project-id> (--usd <n> | --clear)] [options]"],
332
+ values: {
333
+ "platform-usd": "Platform cap in USD per month (turns the cap on)",
334
+ "project-default-usd": "Default project cap in USD per month (turns project caps on)",
335
+ "project-caps": "on applies the saved default to every project; off removes it",
336
+ project: "Project id whose limit to change (use with --usd or --clear)",
337
+ usd: "That project’s limit in USD per month, any amount"
338
+ },
339
+ booleans: {
340
+ "platform-off": "Turn the platform cap off",
341
+ clear: "Remove the project’s limit (the default applies again)"
342
+ },
343
+ method: "POST"
344
+ },
345
+ {
346
+ action: "findings",
347
+ description: "List findings across projects, oldest first",
348
+ path: "/security/findings",
349
+ values: {
350
+ project: "Project id or slug",
351
+ state: "open, resolved or all",
352
+ severity: "critical, high, medium, low or informational",
353
+ format: "sarif prints every matching finding as a SARIF 2.1.0 log"
354
+ },
355
+ booleans: { urgent: "Only open critical or high findings that are confirmed" },
356
+ paged: true
357
+ },
358
+ {
359
+ action: "show",
360
+ description: "Show findings of a project, by comma-separated finding ids",
361
+ path: "/projects/:id/security/findings/:fid",
362
+ positional: ["id", "fid"],
363
+ usage: ["void platform security show <project-id> <finding-id,…> [options]"]
364
+ },
365
+ {
366
+ action: "resolve",
367
+ description: "Resolve findings as an installation admin",
368
+ path: "/projects/:id/security/findings/:fid/resolve",
369
+ positional: ["id", "fid"],
370
+ usage: ["void platform security resolve <project-id> <finding-id,…> --reason <fixed|false-positive|accepted-risk> --comment <text> [options]"],
371
+ values: {
372
+ reason: "fixed, false-positive or accepted-risk",
373
+ comment: "Why (required)"
374
+ },
375
+ method: "POST"
376
+ },
377
+ {
378
+ action: "reopen",
379
+ description: "Reopen resolved findings as an installation admin",
380
+ path: "/projects/:id/security/findings/:fid/reopen",
381
+ positional: ["id", "fid"],
382
+ usage: ["void platform security reopen <project-id> <finding-id,…> --comment <text> [options]"],
383
+ values: { comment: "Why (required)" },
384
+ method: "POST"
385
+ },
386
+ {
387
+ action: "comment",
388
+ description: "Add a comment to findings as an installation admin",
389
+ path: "/projects/:id/security/findings/:fid/comments",
390
+ positional: [
391
+ "id",
392
+ "fid",
393
+ "text"
394
+ ],
395
+ usage: ["void platform security comment <project-id> <finding-id,…> <text> [options]"],
396
+ method: "POST"
397
+ },
398
+ {
399
+ action: "model",
400
+ description: "Set one project’s scan model, or go back to the platform default",
401
+ path: "/projects/:id/security/model",
402
+ positional: ["id", "model"],
403
+ optionalPositional: true,
404
+ usage: ["void platform security model <project-id> <model-id|--default> [options]"],
405
+ booleans: {
406
+ default: "Use the platform default model",
407
+ "accept-provider-notice": "Accept the current provider notice (needed for a third-party model)"
408
+ },
409
+ method: "POST"
410
+ },
411
+ {
412
+ action: "scans",
413
+ description: "List scans across projects, newest first, with month totals",
414
+ path: "/security/scans",
415
+ values: {
416
+ project: "Project id or slug",
417
+ status: "Scan status, such as failed, refused or running",
418
+ trigger: "gate for public-request scans"
419
+ },
420
+ paged: true
421
+ },
422
+ {
423
+ action: "rescan",
424
+ description: "Run a full scan of the live deployment (asks first; it can cost real money)",
425
+ path: "/projects/:id/security/scans",
426
+ positional: ["id"],
427
+ booleans: { "client-assets": "Also read the sources of the client bundles from their source maps" },
428
+ method: "POST"
429
+ },
430
+ {
431
+ action: "backfill",
432
+ description: "Scan every live deployment that was never scanned (asks first; it can cost real money)",
433
+ path: "/security/backfill",
434
+ method: "POST"
435
+ },
436
+ {
437
+ action: "sweeps",
438
+ description: "Turn scheduled full sweeps of every live app on or off",
439
+ path: "/security/policy",
440
+ positional: ["state"],
441
+ usage: ["void platform security sweeps <on|off> [--every-days <n>] [options]"],
442
+ values: { "every-days": "Days between two sweeps of one project (7 to 90, default 30)" },
443
+ method: "POST"
444
+ },
445
+ {
446
+ action: "fallback",
447
+ description: "Re-scan once on the @cf default after a third-party scan is refused, fails or times out",
448
+ path: "/security/policy",
449
+ positional: ["state"],
450
+ usage: ["void platform security fallback <on|off> [options]"],
451
+ method: "POST"
452
+ },
453
+ {
454
+ action: "digest",
455
+ description: "Turn the weekly security summary email to installation admins on or off",
456
+ path: "/security/policy",
457
+ positional: ["state"],
458
+ usage: ["void platform security digest <on|off> [options]"],
459
+ method: "POST"
460
+ },
461
+ {
462
+ action: "webhook",
463
+ description: "Send signed security events (ids and counts only) to an https URL, or turn it off",
464
+ path: "/security/webhook",
465
+ positional: ["url"],
466
+ usage: ["void platform security webhook <https-url|off> [options]"],
467
+ method: "POST"
468
+ },
469
+ {
470
+ action: "cancel",
471
+ description: "Cancel a waiting or running scan",
472
+ path: "/security/scans/:sid/cancel",
473
+ positional: ["sid"],
474
+ method: "POST"
475
+ },
476
+ {
477
+ action: "public-gate",
478
+ description: "Turn “Scan before a project goes public” on or off",
479
+ path: "/security/policy",
480
+ positional: ["state"],
481
+ usage: ["void platform security public-gate <on|off> [options]"],
482
+ method: "POST"
483
+ },
484
+ {
485
+ action: "public-requests",
486
+ description: "List public requests across projects, longest waiting first",
487
+ path: "/security/public-requests",
488
+ values: {
489
+ project: "Project id or slug",
490
+ state: "open, closed, all or one request state"
491
+ },
492
+ paged: true
493
+ },
494
+ {
495
+ action: "bypass",
496
+ description: "Bypass the gate scan of a project’s public request",
497
+ path: "/projects/:id/security/public-request/bypass",
498
+ positional: ["id"],
499
+ values: { reason: "Why the scan is skipped (required, up to 4,000 characters)" },
500
+ method: "POST"
501
+ },
502
+ {
503
+ action: "bypasses",
504
+ description: "List bypass records, newest first",
505
+ path: "/security/bypasses",
506
+ values: { project: "Project id or slug" },
507
+ paged: true
508
+ }
509
+ ].map((command) => ({
510
+ group: "security",
511
+ ...command
512
+ }));
513
+ const MODES = /* @__PURE__ */ new Set([
514
+ "disabled",
515
+ "public",
516
+ "all"
517
+ ]);
518
+ /** One project's own scan rule (M34). */
519
+ const OVERRIDES = /* @__PURE__ */ new Set([
520
+ "inherit",
521
+ "always",
522
+ "never"
523
+ ]);
524
+ const SEVERITIES = [
525
+ "critical",
526
+ "high",
527
+ "medium",
528
+ "low",
529
+ "informational"
530
+ ];
531
+ const REASONS = {
532
+ fixed: "fixed",
533
+ "false-positive": "false_positive",
534
+ false_positive: "false_positive",
535
+ "accepted-risk": "accepted_risk",
536
+ accepted_risk: "accepted_risk"
537
+ };
538
+ const MAX_FINDING_IDS = 20;
539
+ const ON_OFF_FIELDS = {
540
+ fallback: "fallbackToCf",
541
+ digest: "digest",
542
+ "public-gate": "publicGate"
543
+ };
544
+ /** An id for a URL path segment. */
545
+ function pathId(id) {
546
+ if (id === "." || id === "..") throw new Error("platform: An object ID cannot be a dot path segment.");
547
+ return encodeURIComponent(id);
548
+ }
549
+ function list(value, name) {
550
+ const items = [...new Set(value.split(",").map((entry) => entry.trim()).filter(Boolean))];
551
+ if (items.length === 0) throw new Error(`platform: --${name} needs at least one id.`);
552
+ return items;
553
+ }
554
+ function wholeNumber(value, name) {
555
+ const number = parseSecurityDigits(value, 16);
556
+ if (number === null || value.startsWith("0") || !Number.isSafeInteger(number)) throw new Error(`platform: --${name} must be a whole number.`);
557
+ return number;
558
+ }
559
+ function dollars(value, name) {
560
+ if (!isDollarAmount(value)) throw new Error(`platform: --${name} must be a dollar amount such as 50 or 12.50.`);
561
+ return Number(value);
562
+ }
563
+ /**
564
+ * Fills the request for one security command. The path keeps `:fid`: the runner sends one
565
+ * request per `findingIds` entry. The runner strips the internal body keys.
566
+ */
567
+ function applySecurityArgs(command, parameters, values, flags, parsed) {
568
+ const action = command.action;
569
+ parsed.body = {};
570
+ parsed.path = command.path;
571
+ if (action === "budget") {
572
+ if (!([
573
+ "platform-usd",
574
+ "project-default-usd",
575
+ "project-caps",
576
+ "project",
577
+ "usd"
578
+ ].some((name) => values[name] !== void 0) || flags.has("platform-off") || flags.has("clear"))) {
579
+ parsed.method = "GET";
580
+ return;
581
+ }
582
+ parsed.method = "POST";
583
+ parsed.action = "budget-set";
584
+ }
585
+ const projectId = parameters[0];
586
+ if (projectId !== void 0) parsed.path = parsed.path.replace(":id", pathId(projectId));
587
+ if (action === "cancel") {
588
+ parsed.path = parsed.path.replace(":sid", encodeURIComponent(parameters[0]));
589
+ return;
590
+ }
591
+ if (action === "rescan" && flags.has("client-assets")) {
592
+ parsed.body = { clientAssets: true };
593
+ return;
594
+ }
595
+ if (action === "findings") {
596
+ if (flags.has("urgent")) parsed.query.urgent = "true";
597
+ if (values.format !== void 0) {
598
+ if (values.format !== "sarif") throw new Error("platform: --format must be sarif.");
599
+ if (flags.has("json")) throw new Error("platform: Use --format sarif or --json, not both.");
600
+ if (parsed.query.page !== void 0 || parsed.query.limit !== void 0) throw new Error("platform: --format sarif exports every matching finding; drop --page and --limit.");
601
+ delete parsed.query.format;
602
+ parsed.action = "findings-sarif";
603
+ }
604
+ if (values.state !== void 0 && ![
605
+ "open",
606
+ "resolved",
607
+ "all"
608
+ ].includes(values.state)) throw new Error("platform: --state must be open, resolved or all.");
609
+ if (values.severity !== void 0 && !SEVERITIES.includes(values.severity)) throw new Error(`platform: --severity must be one of: ${SEVERITIES.join(", ")}.`);
610
+ return;
611
+ }
612
+ if (action === "scans" && values.trigger !== void 0 && values.trigger !== "gate") throw new Error("platform: --trigger must be gate.");
613
+ if (action === "show" || action === "resolve" || action === "reopen" || action === "comment") {
614
+ const ids = list(parameters[1], "finding ids");
615
+ if (ids.length > MAX_FINDING_IDS) throw new Error(`platform: Name at most ${MAX_FINDING_IDS} findings at a time.`);
616
+ parsed.body.findingIds = ids;
617
+ if (action === "show") return;
618
+ }
619
+ switch (action) {
620
+ case "policy": {
621
+ const mode = parameters[0];
622
+ const project = values.project;
623
+ if (project !== void 0) {
624
+ if (!OVERRIDES.has(mode)) throw new Error("platform: Usage: void platform security policy --project <project-id> <inherit|always|never>.");
625
+ parsed.action = "project-policy";
626
+ parsed.path = `/projects/${pathId(project)}/security/policy`;
627
+ parsed.body = { override: mode };
628
+ return;
629
+ }
630
+ if (OVERRIDES.has(mode)) throw new Error(`platform: ${mode} is a project rule; name the project: void platform security policy --project <project-id> ${mode}.`);
631
+ if (!MODES.has(mode)) throw new Error("platform: Usage: void platform security policy <disabled|public|all>.");
632
+ parsed.body = { mode };
633
+ return;
634
+ }
635
+ case "sweeps":
636
+ case "fallback":
637
+ case "digest":
638
+ case "public-gate": {
639
+ const state = parameters[0];
640
+ if (state !== "on" && state !== "off") throw new Error(`platform: Usage: void platform security ${action} <on|off>${action === "sweeps" ? " [--every-days <n>]" : ""}.`);
641
+ const on = state === "on";
642
+ const days = values["every-days"];
643
+ parsed.body = action === "sweeps" ? { sweeps: {
644
+ on,
645
+ ...days === void 0 ? {} : { everyDays: wholeNumber(days, "every-days") }
646
+ } } : { [ON_OFF_FIELDS[action]]: on };
647
+ return;
648
+ }
649
+ case "webhook": {
650
+ const url = parameters[0];
651
+ if (url !== "off" && !url.startsWith("https://")) throw new Error("platform: Usage: void platform security webhook <https-url|off>.");
652
+ parsed.body = { url: url === "off" ? null : url };
653
+ return;
654
+ }
655
+ case "models": {
656
+ const provider = values.provider;
657
+ const keyStdin = flags.has("key-stdin");
658
+ const removeKey = flags.has("remove-key");
659
+ if (provider !== void 0 || keyStdin || removeKey) {
660
+ if (values.default || values.block || values.unblock || flags.has("accept-provider-notice")) throw new Error("platform: Change a provider key on its own; set models in a separate command.");
661
+ if (provider !== "openai" && provider !== "anthropic") throw new Error("platform: --provider must be openai or anthropic.");
662
+ if (keyStdin === removeKey) throw new Error("platform: Usage: void platform security models --provider <openai|anthropic> (--key-stdin | --remove-key).");
663
+ parsed.action = "provider-key";
664
+ parsed.path = "/security/provider-keys";
665
+ parsed.body = keyStdin ? {
666
+ host: provider,
667
+ keyStdin: true
668
+ } : {
669
+ host: provider,
670
+ key: null
671
+ };
672
+ return;
673
+ }
674
+ if (!values.default && !values.block && !values.unblock) throw new Error("platform: Usage: void platform security models [--default <id>] [--block <id,…>] [--unblock <id,…>] [--accept-provider-notice], or --provider <openai|anthropic> (--key-stdin | --remove-key).");
675
+ parsed.body = {
676
+ ...values.default ? { defaultModel: values.default } : {},
677
+ ...values.block ? { block: list(values.block, "block") } : {},
678
+ ...values.unblock ? { unblock: list(values.unblock, "unblock") } : {},
679
+ ...flags.has("accept-provider-notice") ? { acceptProviderNotice: true } : {}
680
+ };
681
+ return;
682
+ }
683
+ case "limits": {
684
+ const limits = {
685
+ ...values.concurrency ? { concurrency: wholeNumber(values.concurrency, "concurrency") } : {},
686
+ ...values["scan-timeout"] ? { timeoutMinutes: wholeNumber(values["scan-timeout"], "scan-timeout") } : {}
687
+ };
688
+ if (Object.keys(limits).length === 0) throw new Error("platform: Usage: void platform security limits [--concurrency <n>] [--scan-timeout <minutes>].");
689
+ parsed.body = { limits };
690
+ return;
691
+ }
692
+ case "budget": {
693
+ const project = values.project;
694
+ const platformChange = [
695
+ "platform-usd",
696
+ "project-default-usd",
697
+ "project-caps"
698
+ ].some((name) => values[name] !== void 0) || flags.has("platform-off");
699
+ if (project !== void 0) {
700
+ if (platformChange) throw new Error("platform: --project changes one project; do not combine it with platform cap flags.");
701
+ if (values.usd === void 0 === !flags.has("clear")) throw new Error("platform: Usage: void platform security budget --project <id> (--usd <amount> | --clear).");
702
+ parsed.path = `/projects/${pathId(project)}/security/budget`;
703
+ parsed.body = { monthlyUsd: values.usd === void 0 ? null : dollars(values.usd, "usd") };
704
+ return;
705
+ }
706
+ if (values.usd !== void 0 || flags.has("clear")) throw new Error("platform: --usd and --clear need --project <id>.");
707
+ if (values["platform-usd"] !== void 0 && flags.has("platform-off")) throw new Error("platform: Choose --platform-usd or --platform-off, not both.");
708
+ const caps = values["project-caps"];
709
+ if (caps !== void 0 && caps !== "on" && caps !== "off") throw new Error("platform: --project-caps must be on or off.");
710
+ if (caps === "off" && values["project-default-usd"] !== void 0) throw new Error("platform: --project-caps off cannot be combined with --project-default-usd.");
711
+ const body = {};
712
+ if (values["platform-usd"] !== void 0) body.platformMonthlyUsd = dollars(values["platform-usd"], "platform-usd");
713
+ else if (flags.has("platform-off")) body.platformMonthlyUsd = null;
714
+ if (values["project-default-usd"] !== void 0) body.projectDefaultMonthlyUsd = dollars(values["project-default-usd"], "project-default-usd");
715
+ else if (caps === "off") body.projectDefaultMonthlyUsd = null;
716
+ else if (caps === "on") body.projectCapsOn = true;
717
+ parsed.body = body;
718
+ return;
719
+ }
720
+ case "resolve": {
721
+ const reason = values.reason !== void 0 && hasOwnKey(REASONS, values.reason) ? REASONS[values.reason] : void 0;
722
+ if (!reason) throw new Error("platform: --reason is required: fixed, false-positive or accepted-risk.");
723
+ parsed.body.reason = reason;
724
+ parsed.body.comment = requireText(values.comment, "comment");
725
+ return;
726
+ }
727
+ case "reopen":
728
+ parsed.body.comment = requireText(values.comment, "comment");
729
+ return;
730
+ case "comment":
731
+ parsed.body.text = requireText(parameters[2], "text");
732
+ return;
733
+ case "model": {
734
+ const useDefault = flags.has("default");
735
+ const model = parameters[1];
736
+ if (useDefault === (model !== void 0)) throw new Error("platform: Usage: void platform security model <project-id> <model-id|--default>.");
737
+ parsed.body = {
738
+ model: useDefault ? null : model,
739
+ ...flags.has("accept-provider-notice") ? { acceptProviderNotice: true } : {}
740
+ };
741
+ return;
742
+ }
743
+ case "bypass":
744
+ parsed.body.reason = requireText(values.reason, "reason");
745
+ return;
746
+ default: return;
747
+ }
748
+ }
749
+ function requireText(value, name) {
750
+ if (value === void 0 || value.trim() === "") throw new Error(`platform: ${name} is required.`);
751
+ return value;
752
+ }
753
+ // src/cli/operator-args.ts
754
+ const operatorCommands = [
755
+ {
756
+ group: "auth",
757
+ action: "login",
758
+ description: "Sign in as a platform administrator",
759
+ path: "/session",
760
+ values: { provider: "OAuth provider" },
761
+ booleans: { "token-stdin": "Read a full API session from stdin for explicit operator session exchange" }
762
+ },
763
+ {
764
+ group: "auth",
765
+ action: "logout",
766
+ description: "Revoke the current operator session and remove its local credential",
767
+ path: "/session/logout"
768
+ },
769
+ {
770
+ group: "auth",
771
+ action: "status",
772
+ description: "Inspect operator identity, expiry, and capabilities",
773
+ path: "/session"
774
+ },
775
+ {
776
+ group: "auth",
777
+ action: "token",
778
+ description: "Print an operator token; exchange an API session with --token-stdin",
779
+ path: "/session",
780
+ booleans: { "token-stdin": "Read a full API session from stdin for explicit operator session exchange" }
781
+ },
782
+ {
783
+ group: "user",
784
+ action: "list",
785
+ description: "List users",
786
+ path: "/users",
787
+ values: { search: "Search login or email" }
788
+ },
789
+ {
790
+ group: "user",
791
+ action: "show",
792
+ description: "Inspect a user, usage, and projects",
793
+ path: "/users/:id",
794
+ positional: ["id"]
795
+ },
796
+ {
797
+ group: "user",
798
+ action: "plan",
799
+ description: "Change a user plan",
800
+ path: "/users/:id/plan",
801
+ positional: ["id", "plan"],
802
+ method: "POST"
803
+ },
804
+ {
805
+ group: "user",
806
+ action: "suspend",
807
+ description: "Suspend a user and their projects",
808
+ path: "/users/:id/suspend",
809
+ positional: ["id"],
810
+ values: { reason: "Reason for suspension" },
811
+ method: "POST"
812
+ },
813
+ {
814
+ group: "user",
815
+ action: "restore",
816
+ description: "Restore a suspended user",
817
+ path: "/users/:id/restore",
818
+ positional: ["id"],
819
+ method: "POST"
820
+ },
821
+ {
822
+ group: "user",
823
+ action: "delete",
824
+ description: "Delete a user and all owned resources",
825
+ path: "/users/:id/delete",
826
+ positional: ["id"],
827
+ method: "POST"
828
+ },
829
+ {
830
+ group: "project",
831
+ action: "list",
832
+ description: "List tenant projects",
833
+ path: "/projects",
834
+ values: {
835
+ user: "Owner user ID",
836
+ search: "Search projects"
837
+ }
838
+ },
839
+ {
840
+ group: "project",
841
+ action: "show",
842
+ description: "Inspect a project, its resources, and its effective AI Gateway logging",
843
+ path: "/projects/:id",
844
+ positional: ["id"]
845
+ },
846
+ {
847
+ group: "project",
848
+ action: "delete",
849
+ description: "Delete a project and its resources",
850
+ path: "/projects/:id/delete",
851
+ positional: ["id"],
852
+ method: "POST"
853
+ },
854
+ {
855
+ group: "project",
856
+ action: "normalize",
857
+ description: "Verify and normalize legacy project deployment and queue identities",
858
+ path: "/projects/:id/normalize",
859
+ positional: ["id"],
860
+ method: "POST"
861
+ },
862
+ {
863
+ group: "project",
864
+ action: "ai-logging",
865
+ description: "Set AI Gateway logging (inherit, off, metadata, or full); new AI requests normally follow it within 2 minutes",
866
+ path: "/projects/:id/ai-logging",
867
+ positional: ["id", "mode"],
868
+ usage: ["void platform project ai-logging <project-id> <inherit|off|metadata|full> [options]"],
869
+ method: "POST"
870
+ },
871
+ {
872
+ group: "project",
873
+ action: "owner",
874
+ description: "Transfer project ownership to another registered user",
875
+ path: "/projects/:id/owner",
876
+ positional: ["id", "userId"],
877
+ method: "POST"
878
+ },
879
+ {
880
+ group: "zero-trust",
881
+ action: "status",
882
+ description: "Inspect saved platform Zero Trust configuration and project state counts",
883
+ path: "/zero-trust",
884
+ booleans: { check: "Also check the saved settings against Cloudflare Access (several API calls)" }
885
+ },
886
+ {
887
+ group: "zero-trust",
888
+ action: "configure",
889
+ description: "Configure and reconcile project Zero Trust protection",
890
+ path: "/zero-trust/configure",
891
+ values: {
892
+ "identity-providers": "Comma-separated Access identity provider IDs",
893
+ policies: "Comma-separated reusable Access policy IDs",
894
+ "existing-projects": "Required when enabling: protected or public for existing projects"
895
+ },
896
+ booleans: {
897
+ "token-stdin": "Read the Access management API token from stdin",
898
+ "protect-new-projects": "Protect newly created projects by default",
899
+ "public-apps": "Manage public app rules without identity policies"
900
+ },
901
+ method: "POST"
902
+ },
903
+ {
904
+ group: "zero-trust",
905
+ action: "reconcile",
906
+ description: "Repair platform and project Access configuration drift",
907
+ path: "/zero-trust/reconcile",
908
+ method: "POST"
909
+ },
910
+ {
911
+ group: "zero-trust",
912
+ action: "disable",
913
+ description: "Remove Void-managed Access applications and make projects public",
914
+ path: "/zero-trust/disable",
915
+ method: "POST"
916
+ },
917
+ {
918
+ group: "zero-trust",
919
+ action: "project-status",
920
+ description: "Inspect one project Zero Trust override and effective state",
921
+ path: "/zero-trust/projects/:id",
922
+ positional: ["id"]
923
+ },
924
+ {
925
+ group: "zero-trust",
926
+ action: "project-protect",
927
+ description: "Protect one project, overriding the platform default",
928
+ path: "/zero-trust/projects/:id",
929
+ positional: ["id"],
930
+ method: "POST"
931
+ },
932
+ {
933
+ group: "zero-trust",
934
+ action: "project-public",
935
+ description: "Make one project public, overriding the platform default",
936
+ path: "/zero-trust/projects/:id",
937
+ positional: ["id"],
938
+ method: "POST"
939
+ },
940
+ {
941
+ group: "zero-trust",
942
+ action: "project-reconcile",
943
+ description: "Repair Access configuration drift for one project",
944
+ path: "/zero-trust/projects/:id/reconcile",
945
+ positional: ["id"],
946
+ method: "POST"
947
+ },
948
+ ...securityOperatorCommands,
949
+ {
950
+ group: "deployment",
951
+ action: "list",
952
+ description: "List tenant deployments",
953
+ path: "/deployments",
954
+ values: {
955
+ project: "Project ID",
956
+ search: "Search deployments",
957
+ status: "Deployment status"
958
+ }
959
+ },
960
+ {
961
+ group: "deployment",
962
+ action: "show",
963
+ description: "Inspect a deployment",
964
+ path: "/deployments/:id",
965
+ positional: ["id"]
966
+ },
967
+ {
968
+ group: "deployment",
969
+ action: "cancel",
970
+ description: "Cancel a deployment",
971
+ path: "/deployments/:id/cancel",
972
+ positional: ["id"],
973
+ method: "POST"
974
+ },
975
+ {
976
+ group: "deployment",
977
+ action: "migrate-assets",
978
+ description: "Copy and verify legacy deployment assets in scoped R2 storage",
979
+ path: "/deployments/:id/migrate-assets",
980
+ positional: ["id"],
981
+ values: { cursor: "Resume from the last successful asset migration cursor" },
982
+ method: "POST"
983
+ },
984
+ {
985
+ group: "deployment",
986
+ action: "logs",
987
+ description: "Read runtime logs (JSON follow emits one object per line)",
988
+ path: "/deployments/:id/logs",
989
+ positional: ["id"],
990
+ values: {
991
+ since: "Duration or ISO timestamp",
992
+ cursor: "Opaque continuation cursor"
993
+ },
994
+ booleans: { follow: "Poll new logs until interrupted or the build ends" }
995
+ },
996
+ {
997
+ group: "build",
998
+ action: "show",
999
+ description: "Inspect a managed build",
1000
+ path: "/builds/:id",
1001
+ positional: ["id"]
1002
+ },
1003
+ {
1004
+ group: "build",
1005
+ action: "logs",
1006
+ description: "Read build logs (JSON follow emits one object per line)",
1007
+ path: "/builds/:id/logs",
1008
+ positional: ["id"],
1009
+ values: { since: "Last received sequence number" },
1010
+ booleans: { follow: "Poll new logs until interrupted or the build ends" }
1011
+ },
1012
+ {
1013
+ group: "signup",
1014
+ action: "show",
1015
+ description: "Inspect signup restrictions and allowlist",
1016
+ path: "/signup"
1017
+ },
1018
+ {
1019
+ group: "signup",
1020
+ action: "restrict",
1021
+ description: "Restrict signup to the allowlist",
1022
+ path: "/signup/restrict",
1023
+ method: "POST"
1024
+ },
1025
+ {
1026
+ group: "signup",
1027
+ action: "open",
1028
+ description: "Open public signup",
1029
+ path: "/signup/open",
1030
+ method: "POST"
1031
+ },
1032
+ {
1033
+ group: "signup",
1034
+ action: "allow",
1035
+ description: "Add a GitHub, email, or exact login identity grant",
1036
+ path: "/signup/allow",
1037
+ positional: ["type", "pattern"],
1038
+ usage: ["void platform signup allow <github|email> <pattern> [options]", "void platform signup allow identity <connection-id> <subject> [options]"],
1039
+ values: { note: "Allowlist note" },
1040
+ method: "POST"
1041
+ },
1042
+ {
1043
+ group: "signup",
1044
+ action: "disallow",
1045
+ description: "Remove a GitHub, email, or exact login identity grant",
1046
+ path: "/signup/disallow",
1047
+ positional: ["type", "pattern"],
1048
+ usage: ["void platform signup disallow <github|email> <pattern> [options]", "void platform signup disallow identity <connection-id> <subject> [options]"],
1049
+ method: "POST"
1050
+ },
1051
+ {
1052
+ group: "signup",
1053
+ action: "remove",
1054
+ description: "Remove a GitHub or email allowlist pattern (compatibility alias)",
1055
+ path: "/signup/remove",
1056
+ positional: ["type", "pattern"],
1057
+ method: "POST"
1058
+ },
1059
+ {
1060
+ group: "invitation",
1061
+ action: "list",
1062
+ description: "List invitations",
1063
+ path: "/invitations"
1064
+ },
1065
+ {
1066
+ group: "invitation",
1067
+ action: "send",
1068
+ description: "Send invitations to comma-separated email addresses",
1069
+ path: "/invitations/send",
1070
+ positional: ["emails"],
1071
+ method: "POST"
1072
+ },
1073
+ {
1074
+ group: "invitation",
1075
+ action: "revoke",
1076
+ description: "Revoke an invitation",
1077
+ path: "/invitations/:id/revoke",
1078
+ positional: ["id"],
1079
+ method: "POST"
1080
+ },
1081
+ {
1082
+ group: "system",
1083
+ action: "overview",
1084
+ description: "Inspect platform usage and capacity",
1085
+ path: "/system/overview"
1086
+ },
1087
+ {
1088
+ group: "system",
1089
+ action: "health",
1090
+ description: "Check platform health",
1091
+ path: "/system/health"
1092
+ },
1093
+ {
1094
+ group: "system",
1095
+ action: "cli-versions",
1096
+ description: "Inspect CLI version adoption and deployment statistics",
1097
+ path: "/system/cli-versions"
1098
+ },
1099
+ {
1100
+ group: "system",
1101
+ action: "asset-migrations",
1102
+ description: "Inventory legacy assets in active and retained deployments",
1103
+ path: "/system/asset-migrations",
1104
+ values: {
1105
+ page: "One-based page number",
1106
+ limit: "Maximum 100 records per page"
1107
+ }
1108
+ },
1109
+ {
1110
+ group: "system",
1111
+ action: "events",
1112
+ description: "List operator audit events",
1113
+ path: "/system/events"
1114
+ },
1115
+ {
1116
+ group: "system",
1117
+ action: "backfill-queue-tokens",
1118
+ description: "Repair missing queue authentication tokens",
1119
+ path: "/system/backfill-queue-tokens",
1120
+ method: "POST"
1121
+ },
1122
+ {
1123
+ group: "system",
1124
+ action: "sandbox-drain",
1125
+ description: "Drain and verify managed Sandbox container applications",
1126
+ path: "/system/sandbox-drain",
1127
+ values: { cursor: "Opaque cursor returned by --plan" },
1128
+ method: "POST"
1129
+ },
1130
+ {
1131
+ group: "system",
1132
+ action: "rotate-proxy-tokens",
1133
+ description: "Rotate project proxy tokens on tenant Workers",
1134
+ path: "/system/rotate-proxy-tokens",
1135
+ values: { project: "Project ID" },
1136
+ booleans: { all: "Rotate every project" },
1137
+ method: "POST"
1138
+ },
1139
+ {
1140
+ group: "email",
1141
+ action: "policy",
1142
+ description: "Show the recipient policy for the shared sender",
1143
+ path: "/email/policy"
1144
+ },
1145
+ {
1146
+ group: "email",
1147
+ action: "policy-set",
1148
+ description: "Set the recipient policy: verified, domains, or any",
1149
+ path: "/email/policy",
1150
+ positional: ["mode"],
1151
+ values: { domains: "Comma-separated recipient domains for mode=domains" },
1152
+ method: "POST"
1153
+ },
1154
+ {
1155
+ group: "email",
1156
+ action: "settings",
1157
+ description: "Show platform email settings",
1158
+ path: "/email/settings"
1159
+ },
1160
+ {
1161
+ group: "email",
1162
+ action: "settings-set",
1163
+ description: "Set who manages email domains: self-serve or admin",
1164
+ path: "/email/settings",
1165
+ values: { domains: "self-serve or admin" },
1166
+ method: "POST"
1167
+ },
1168
+ {
1169
+ group: "email",
1170
+ action: "limit",
1171
+ description: "Set a project's monthly and burst recipient submission caps",
1172
+ path: "/email/projects/:project/limit",
1173
+ positional: ["project"],
1174
+ values: {
1175
+ monthly: "Recipient submissions per UTC calendar month",
1176
+ burst: "Recipient submissions per rolling 60-second window"
1177
+ },
1178
+ method: "POST"
1179
+ },
1180
+ {
1181
+ group: "email",
1182
+ action: "logs",
1183
+ description: "Inspect retained email receipt and recipient outcomes for a project",
1184
+ path: "/email/projects/:project/logs",
1185
+ positional: ["project"]
1186
+ },
1187
+ {
1188
+ group: "email",
1189
+ action: "attempts",
1190
+ description: "List unresolved email send attempts awaiting operator reconciliation",
1191
+ path: "/email/attempts",
1192
+ values: { project: "Project id or slug" }
1193
+ },
1194
+ {
1195
+ group: "email",
1196
+ action: "attempt-resolve",
1197
+ description: "Resolve a stopped send as outcome unknown and release its cleanup fence",
1198
+ path: "/email/attempts/:id/resolve",
1199
+ positional: ["id"],
1200
+ values: { reason: "Audit reason without recipient or message content" },
1201
+ booleans: { ended: "Attest that the original provider execution has ended" },
1202
+ method: "POST"
1203
+ },
1204
+ {
1205
+ group: "email",
1206
+ action: "operation-resolve",
1207
+ description: "Resolve an ended ambiguous email setup write with operator attestation",
1208
+ path: "/email/operations/:id/resolve",
1209
+ positional: ["id"],
1210
+ values: {
1211
+ outcome: "Provider outcome: applied or not-applied",
1212
+ reason: "Audit reason for the verified provider outcome"
1213
+ },
1214
+ booleans: { ended: "Attest that the original provider execution has ended" },
1215
+ method: "POST"
1216
+ },
1217
+ {
1218
+ group: "email",
1219
+ action: "shared-recipients",
1220
+ description: "Inspect shared inbound recipient rules and interrupted creation intents",
1221
+ path: "/email/shared-recipients",
1222
+ values: { project: "Project id or slug, including a project awaiting deletion" }
1223
+ },
1224
+ {
1225
+ group: "email",
1226
+ action: "shared-recipient-resolve",
1227
+ description: "Resolve an ended ambiguous shared recipient creation after provider inspection",
1228
+ path: "/email/shared-recipients/:id/resolve",
1229
+ positional: ["id"],
1230
+ values: {
1231
+ outcome: "Provider outcome: applied or not-applied",
1232
+ reason: "Audit reason for the verified provider outcome"
1233
+ },
1234
+ booleans: { ended: "Attest that the original provider execution has ended" },
1235
+ method: "POST"
1236
+ },
1237
+ {
1238
+ group: "email",
1239
+ action: "domains",
1240
+ description: "List email domains registered on this platform",
1241
+ path: "/email/domains",
1242
+ values: { project: "Project id or slug" }
1243
+ },
1244
+ {
1245
+ group: "email",
1246
+ action: "domain-add",
1247
+ description: "Register an email domain for a project with the platform credential",
1248
+ path: "/email/domains",
1249
+ positional: ["domain"],
1250
+ values: { project: "Project id or slug" },
1251
+ booleans: {
1252
+ "token-stdin": "Read a scoped Cloudflare API token from stdin",
1253
+ "outbound-only": "Send only; leave the MX records and inbound mail with the current provider"
1254
+ },
1255
+ method: "POST"
1256
+ },
1257
+ {
1258
+ group: "email",
1259
+ action: "domain-status",
1260
+ description: "Inspect an email domain's setup, credential and relay",
1261
+ path: "/email/domains/:domain",
1262
+ positional: ["domain"]
1263
+ },
1264
+ {
1265
+ group: "email",
1266
+ action: "domain-sync",
1267
+ description: "Reconcile an email domain with its Cloudflare setup",
1268
+ path: "/email/domains/:domain/sync",
1269
+ positional: ["domain"],
1270
+ method: "POST"
1271
+ },
1272
+ {
1273
+ group: "email",
1274
+ action: "domain-rotate-secret",
1275
+ description: "Rotate an email domain's ingress secret",
1276
+ path: "/email/domains/:domain/rotate-secret",
1277
+ positional: ["domain"],
1278
+ method: "POST"
1279
+ },
1280
+ {
1281
+ group: "email",
1282
+ action: "domain-remove",
1283
+ description: "Remove an email domain and its Cloudflare setup",
1284
+ path: "/email/domains/:domain/remove",
1285
+ positional: ["domain"],
1286
+ booleans: { "token-stdin": "Read a replacement Cloudflare token for blocked project cleanup from stdin" },
1287
+ method: "POST"
1288
+ },
1289
+ {
1290
+ group: "worker",
1291
+ action: "list",
1292
+ description: "List hosted platform workers",
1293
+ path: "/workers",
1294
+ values: { environment: "production or staging" }
1295
+ },
1296
+ {
1297
+ group: "worker",
1298
+ action: "show",
1299
+ description: "Inspect hosted worker versions",
1300
+ path: "/workers/:id",
1301
+ positional: ["id"],
1302
+ values: { environment: "production or staging" }
1303
+ },
1304
+ {
1305
+ group: "worker",
1306
+ action: "rollback",
1307
+ description: "Roll back a hosted worker to a version",
1308
+ path: "/workers/:id/rollback",
1309
+ positional: ["id", "versionId"],
1310
+ values: { environment: "production or staging" },
1311
+ method: "POST"
1312
+ },
1313
+ {
1314
+ group: "worker",
1315
+ action: "rollback-all",
1316
+ description: "Roll back all hosted workers to their previous versions",
1317
+ path: "/workers/rollback-all",
1318
+ values: { environment: "production or staging" },
1319
+ method: "POST"
1320
+ },
1321
+ {
1322
+ group: "worker",
1323
+ action: "events",
1324
+ description: "List hosted worker events or inspect a batch",
1325
+ path: "/workers/events",
1326
+ positional: ["batchId"],
1327
+ optionalPositional: true,
1328
+ values: { environment: "production or staging" }
1329
+ }
1330
+ ];
1331
+ const operatorGroups = [...new Set(operatorCommands.map(({ group }) => group))];
1332
+ /**
1333
+ * A flag name can be a switch in one command and take a value in another (`security
1334
+ * model --default` against `security models --default <id>`). Those names are switches
1335
+ * only for the command that declares them as switches.
1336
+ */
1337
+ function booleanFlagsFor(args) {
1338
+ const valueNames = new Set(operatorCommands.flatMap((command) => Object.keys(command.values ?? {})));
1339
+ const declared = operatorCommands.flatMap((command) => Object.keys(command.booleans ?? {}));
1340
+ const ambiguous = new Set(declared.filter((name) => valueNames.has(name)));
1341
+ const names = declared.filter((name) => !ambiguous.has(name));
1342
+ if (ambiguous.size === 0) return names;
1343
+ const words = [];
1344
+ for (let index = 0; index < args.length && words.length < 2; index++) {
1345
+ const arg = args[index];
1346
+ if (!arg.startsWith("--")) words.push(arg);
1347
+ else if (!names.includes(arg.slice(2)) && !ambiguous.has(arg.slice(2)) && ![
1348
+ "json",
1349
+ "plan",
1350
+ "yes",
1351
+ "force"
1352
+ ].includes(arg.slice(2))) index++;
1353
+ }
1354
+ const selected = operatorCommands.find((command) => command.group === words[0] && command.action === words[1]);
1355
+ return [...names, ...Object.keys(selected?.booleans ?? {}).filter((name) => ambiguous.has(name))];
1356
+ }
1357
+ function parseOperatorArgs(args) {
1358
+ const positional = [];
1359
+ const values = {};
1360
+ const flags = /* @__PURE__ */ new Set();
1361
+ const booleanFlags = /* @__PURE__ */ new Set([
1362
+ "json",
1363
+ "plan",
1364
+ "yes",
1365
+ "force",
1366
+ ...booleanFlagsFor(args)
1367
+ ]);
1368
+ for (let index = 0; index < args.length; index++) {
1369
+ const arg = args[index];
1370
+ if (!arg.startsWith("-")) {
1371
+ positional.push(arg);
1372
+ continue;
1373
+ }
1374
+ if (!arg.startsWith("--")) throw new Error(`platform: Unknown flag '${arg}'.`);
1375
+ const flag = arg.slice(2);
1376
+ if (flags.has(flag) || Object.hasOwn(values, flag)) throw new Error(`platform: Duplicate flag '${arg}'.`);
1377
+ if (booleanFlags.has(flag)) flags.add(flag);
1378
+ else {
1379
+ const value = args[++index];
1380
+ if (!value || value.startsWith("-")) throw new Error(`platform: ${arg} requires a value.`);
1381
+ values[flag] = value;
1382
+ }
1383
+ }
1384
+ const [group = "", action = "", ...parameters] = positional;
1385
+ if (!operatorGroups.includes(group)) throw new Error("platform: Unknown operator command group.");
1386
+ const parsed = {
1387
+ subcommand: "operator",
1388
+ group,
1389
+ action,
1390
+ connection: values.connection ?? "",
1391
+ json: flags.has("json"),
1392
+ plan: flags.has("plan"),
1393
+ yes: flags.has("yes"),
1394
+ follow: flags.has("follow"),
1395
+ tokenStdin: flags.has("token-stdin"),
1396
+ provider: values.provider,
1397
+ method: "GET",
1398
+ path: "",
1399
+ query: {},
1400
+ body: {}
1401
+ };
1402
+ if (!action && args.length === 1) return parsed;
1403
+ const command = operatorCommands.find((entry) => entry.group === group && entry.action === action);
1404
+ if (!command) throw new Error(`platform: Usage: void platform ${group} <${operatorCommands.flatMap(({ group: entryGroup, action }) => entryGroup === group ? [action] : []).join("|")}>.`);
1405
+ const count = command.positional?.length ?? 0;
1406
+ const identitySignupEntry = group === "signup" && ["allow", "disallow"].includes(action) && parameters[0] === "identity";
1407
+ if (group === "signup" && action === "remove" && parameters[0] === "identity") throw new Error("platform: Use `void platform signup disallow identity <connection-id> <subject>`.");
1408
+ const expectedCount = identitySignupEntry ? 3 : count;
1409
+ if (parameters.length > expectedCount || !command.optionalPositional && parameters.length !== expectedCount) throw new Error(`platform: Usage: ${command.usage?.[identitySignupEntry ? 1 : 0]?.replace(/ \[options\]$/, "") ?? `void platform ${group} ${action}${command.positional?.map((name) => ` <${name}>`).join("") ?? ""}`}.`);
1410
+ const paged = command.paged === true || action === "list" || action === "events" || action === "logs" || action === "attempts" || action === "shared-recipients";
1411
+ const allowed = /* @__PURE__ */ new Set([
1412
+ "connection",
1413
+ ...command.method ? ["timeout"] : [],
1414
+ ...Object.keys(command.values ?? {}),
1415
+ ...paged ? ["limit", ...action !== "logs" || group === "email" ? ["page"] : []] : []
1416
+ ]);
1417
+ for (const name of Object.keys(values)) if (!allowed.has(name)) throw new Error(`platform: Unknown flag '--${name}' for ${group} ${action}.`);
1418
+ for (const name of flags) if (![
1419
+ "json",
1420
+ ...command.method && !command.noConfirm ? ["yes", "plan"] : [],
1421
+ ...Object.keys(command.booleans ?? {})
1422
+ ].includes(name)) throw new Error(`platform: Unknown flag '--${name}' for ${group} ${action}.`);
1423
+ if (parsed.plan && parsed.yes) throw new Error("platform: --plan and --yes cannot be combined.");
1424
+ parsed.path = command.path;
1425
+ parsed.method = command.method ?? "GET";
1426
+ if (identitySignupEntry) {
1427
+ const connectionId = parameters[1];
1428
+ const subject = parameters[2];
1429
+ try {
1430
+ parsePlatformLoginId(connectionId);
1431
+ } catch {
1432
+ throw new Error("platform: Invalid login connection ID.");
1433
+ }
1434
+ if (!subject || subject.length > 255) throw new Error("platform: Identity subject must be 1–255 characters.");
1435
+ parsed.body = {
1436
+ type: "identity",
1437
+ connectionId,
1438
+ subject
1439
+ };
1440
+ } else for (const [index, name] of (command.positional ?? []).entries()) {
1441
+ const value = parameters[index];
1442
+ if (value === void 0) continue;
1443
+ if (value === "." || value === "..") throw new Error("platform: An object ID cannot be a dot path segment.");
1444
+ if (parsed.path.includes(`:${name}`)) parsed.path = parsed.path.replace(`:${name}`, encodeURIComponent(value));
1445
+ else if (group === "worker" && action === "events") parsed.path += `/${encodeURIComponent(value)}`;
1446
+ else parsed.body[name] = name === "emails" ? value.split(",").map((email) => email.trim()) : value;
1447
+ }
1448
+ for (const [name, value] of Object.entries(values)) {
1449
+ if (name === "connection" || name === "provider") continue;
1450
+ if (name === "timeout") {
1451
+ const maximum = OPERATOR_MAX_TIMEOUT_MS / 1e3;
1452
+ if (!/^[1-9]\d*$/.test(value) || Number(value) > maximum) throw new Error(`platform: --timeout must be an integer from 1 to ${maximum} seconds.`);
1453
+ parsed.timeoutMs = Number(value) * 1e3;
1454
+ continue;
1455
+ }
1456
+ if (name === "page" || name === "limit") {
1457
+ const maximum = name === "limit" ? action === "logs" && group !== "email" ? 500 : 100 : 1e6;
1458
+ if (!/^[1-9]\d*$/.test(value) || Number(value) > maximum) throw new Error(`platform: --${name} must be an integer from 1 to ${maximum}.`);
1459
+ }
1460
+ if (name === "since" && group === "build" && (!/^\d+$/.test(value) || !Number.isSafeInteger(Number(value)))) throw new Error("platform: --since must be a nonnegative safe integer for build logs.");
1461
+ if (name === "environment" && !["production", "staging"].includes(value)) throw new Error("platform: --environment must be production or staging.");
1462
+ if (parsed.method === "POST") parsed.body[name] = value;
1463
+ else parsed.query[name] = value;
1464
+ }
1465
+ if (parsed.body.type && ![
1466
+ "github",
1467
+ "email",
1468
+ "identity"
1469
+ ].includes(String(parsed.body.type))) throw new Error("platform: Signup grant type must be github, email, or identity.");
1470
+ for (const name of Object.keys(command.booleans ?? {})) if (name !== "token-stdin" && flags.has(name)) parsed.body[name] = true;
1471
+ if (group === "security") applySecurityArgs(command, parameters, values, flags, parsed);
1472
+ else if (group === "zero-trust" && action === "configure") {
1473
+ if (!parsed.tokenStdin) throw new Error("platform: zero-trust configure requires --token-stdin.");
1474
+ const identityProviderIds = values["identity-providers"]?.split(",").map((entry) => entry.trim()).filter(Boolean);
1475
+ const policyIds = values.policies?.split(",").map((entry) => entry.trim()).filter(Boolean);
1476
+ const existingProjects = values["existing-projects"];
1477
+ const publicAccess = flags.has("public-apps");
1478
+ if (publicAccess && (identityProviderIds?.length || policyIds?.length || flags.has("protect-new-projects") || existingProjects === "protected")) throw new Error("platform: --public-apps cannot include identity policies or protected project choices.");
1479
+ if (!publicAccess && (!identityProviderIds?.length || !policyIds?.length)) throw new Error("platform: zero-trust configure requires --identity-providers and --policies.");
1480
+ if (existingProjects !== void 0 && existingProjects !== "protected" && existingProjects !== "public") throw new Error("platform: --existing-projects must be protected or public.");
1481
+ parsed.body = {
1482
+ identityProviderIds: identityProviderIds ?? [],
1483
+ policyIds: policyIds ?? [],
1484
+ ...publicAccess ? { publicAccess: true } : {},
1485
+ ...existingProjects ? { existingProjects } : {},
1486
+ protectNewProjects: flags.has("protect-new-projects")
1487
+ };
1488
+ } else if (group === "zero-trust" && action === "status") {
1489
+ delete parsed.body.check;
1490
+ if (flags.has("check")) parsed.query.check = "true";
1491
+ } else if (group === "zero-trust" && action === "project-protect") parsed.body.protected = true;
1492
+ else if (group === "zero-trust" && action === "project-public") parsed.body.protected = false;
1493
+ else if (group === "email" && action === "domain-add" && flags.has("outbound-only")) {
1494
+ delete parsed.body["outbound-only"];
1495
+ parsed.body.outboundOnly = true;
1496
+ }
1497
+ return parsed;
1498
+ }
1499
+ export { parseSecurityArgs as i, operatorGroups as n, parseOperatorArgs as r, operatorCommands as t };