cf 1.0.0-beta.12 → 1.0.0-beta.13

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 (283) hide show
  1. package/dist/_meta/commands.json +3119 -2067
  2. package/dist/_meta/hand-written-commands.json +14 -1
  3. package/dist/_meta/schemas.json +1856 -1132
  4. package/dist/{abuse-reports-Cy9RcWPu.mjs → abuse-reports-BjU1s8cf.mjs} +10 -10
  5. package/dist/{access-DwJm1qet.mjs → access-C_G2MZnA.mjs} +1 -1
  6. package/dist/account-tags-CaXDDeZ4.mjs +15 -0
  7. package/dist/{accounts-BSd4b-1j.mjs → accounts-BALwxDQY.mjs} +70 -77
  8. package/dist/{acm-BfI0p2sX.mjs → acm-CP9EaXQN.mjs} +1 -1
  9. package/dist/{addressing-lfeJf7YB.mjs → addressing-DRlaxqrI.mjs} +1 -1
  10. package/dist/{agent-memory-CP1qpn-y.mjs → agent-memory-vGhlfZBx.mjs} +1 -1
  11. package/dist/{ai-jFzFBANM.mjs → ai-CJtbWfB9.mjs} +18 -16
  12. package/dist/{ai-audit-B_tSl78A.mjs → ai-audit-C0BJNqZZ.mjs} +1 -1
  13. package/dist/ai-gateway-BQtv3U3x.mjs +80 -0
  14. package/dist/ai-search-DGU1Y5By.mjs +79 -0
  15. package/dist/{ai-security-CKGE547U.mjs → ai-security-CFTaYk_X.mjs} +1 -1
  16. package/dist/{alerting-CuxoqG3S.mjs → alerting-1hun27JC.mjs} +3 -3
  17. package/dist/analytics-DXUSjvzT.mjs +17 -0
  18. package/dist/{analytics_engine-BoapM9wd.mjs → analytics_engine-CQsnL09C.mjs} +1 -1
  19. package/dist/{api-security-Nk_bg-Kg.mjs → api-security-BXhrfR6-.mjs} +4 -4
  20. package/dist/argo-LPUCTnee.mjs +14 -0
  21. package/dist/{artifacts-BS6cEqCB.mjs → artifacts-Dt6easua.mjs} +1 -1
  22. package/dist/{audit-logs-x5tLqeX2.mjs → audit-logs-CVznAM2Z.mjs} +1 -1
  23. package/dist/{auth-AobvBmz4.mjs → auth-CGLsxbc6.mjs} +1 -1
  24. package/dist/auth-CrmVwfpJ.mjs +2 -0
  25. package/dist/{auth-CKotxfap.mjs → auth-eQr-kQCH.mjs} +1 -1
  26. package/dist/{auth-token-CtguMdmF.mjs → auth-token-pNQrX_9O.mjs} +1 -1
  27. package/dist/{autoconfig-PfnbLuEO.mjs → autoconfig-sD7Frryg.mjs} +151 -151
  28. package/dist/{basin-catalog-Ddi-t3q9.mjs → basin-catalog-ZQICw-zF.mjs} +1 -1
  29. package/dist/{billing-CDMc4tvX.mjs → billing-Dy1-dV_B.mjs} +2 -2
  30. package/dist/{bot-management-UrCM3P8K.mjs → bot-management-DTgPwL7O.mjs} +1 -1
  31. package/dist/{botnet-feed-CVwRm42k.mjs → botnet-feed-xb98Cj3Y.mjs} +1 -1
  32. package/dist/{brand-protection-DfNf5REj.mjs → brand-protection-Ck3okE2k.mjs} +1 -1
  33. package/dist/browser-run-DJGJSzFX.mjs +42 -0
  34. package/dist/build-B1L6xrgC.mjs +2 -0
  35. package/dist/{build-BKPVP5ip.mjs → build-HmSXqjGn.mjs} +1 -1
  36. package/dist/{builds-BG5DHqU3.mjs → builds-CYxcZtkG.mjs} +3 -3
  37. package/dist/{cache-C05hHXUp.mjs → cache-D9tSfovH.mjs} +1 -1
  38. package/dist/{certificate-authorities-DyCFmZwR.mjs → certificate-authorities-CpiveTFC.mjs} +1 -1
  39. package/dist/cf-BxsXrVeh.mjs +18 -0
  40. package/dist/chunk-DSGVRFIS-C1_SEtRK.mjs +2 -0
  41. package/dist/{chunk-FT2NMTJB-DQ7s3x7Q.mjs → chunk-NDZDTP46-Bjx_wtJe.mjs} +3 -3
  42. package/dist/{chunk-AUSY7DKT-BJX6Fdc4.mjs → chunk-TAK63GWY-DdMktrgc.mjs} +9 -2
  43. package/dist/{cli-D9qlPB-6.mjs → cli-DeJc9U8z.mjs} +1 -1
  44. package/dist/{client-certificates-B-m8rfM9.mjs → client-certificates-CF6YZyvP.mjs} +1 -1
  45. package/dist/{client-side-security-M4oIUqID.mjs → client-side-security-BLoe9kS5.mjs} +1 -1
  46. package/dist/{cloud-connector-B63Dwn6n.mjs → cloud-connector-DXRUHsjt.mjs} +1 -1
  47. package/dist/cloudflared--1Ws1RJy.mjs +2 -0
  48. package/dist/{cloudforce-one-Dlc1GNFy.mjs → cloudforce-one-CBLxXi6v.mjs} +162 -162
  49. package/dist/{command-BQpXcGKV.mjs → command-83uVfXh9.mjs} +1 -1
  50. package/dist/{command-BWlpCtHe.mjs → command-BDe67N_n.mjs} +1 -1
  51. package/dist/{command-CXxh5Hce.mjs → command-BlIb6RR2.mjs} +1 -1
  52. package/dist/{command-ZBQ1WITj.mjs → command-Bpzp8Mz2.mjs} +1 -1
  53. package/dist/{command-CKQlxypn.mjs → command-BvfKhMl7.mjs} +1 -1
  54. package/dist/command-CG6RvZs0.mjs +2 -0
  55. package/dist/{command-CRl00uA2.mjs → command-CcuLC6CJ.mjs} +1 -1
  56. package/dist/{command-CUkXxZsc.mjs → command-Cu7dcaHT.mjs} +1 -1
  57. package/dist/{command-SS1z_t68.mjs → command-D3fyhdy-.mjs} +1 -1
  58. package/dist/{command-DyE8v4sd.mjs → command-DUhX8Dcr.mjs} +1 -1
  59. package/dist/{command-VuxpEvmH.mjs → command-Dh7RmjFu.mjs} +1 -1
  60. package/dist/{command-DEQSv-S1.mjs → command-DwXiDOeH.mjs} +1 -1
  61. package/dist/{command-BlGILcTA.mjs → command-UiHLJ8Ji.mjs} +1 -1
  62. package/dist/{command-Rv2MR-eh.mjs → command-_rqD0hXF.mjs} +1 -1
  63. package/dist/{command-DBaNgfA4.mjs → command-oNVwyjGB.mjs} +1 -1
  64. package/dist/{completions-lf50FBGm.mjs → completions-D06AO7A8.mjs} +11 -11
  65. package/dist/{connector-interrupts-DHN1KtUE.mjs → connector-interrupts-DelTmNyw.mjs} +1 -1
  66. package/dist/{connector-telemetry-events-CHg7FmXh.mjs → connector-telemetry-events-BwxR3G8d.mjs} +1 -1
  67. package/dist/{connector-telemetry-snapshots-CSifYi9r.mjs → connector-telemetry-snapshots-Bqq-hrpJ.mjs} +1 -1
  68. package/dist/{connectors-0UwPUav-.mjs → connectors-D-m3rEpk.mjs} +1 -1
  69. package/dist/{containers-DuIsM7lM.mjs → containers-CVNfEjJs.mjs} +3 -3
  70. package/dist/{containers-DRzgE46U.mjs → containers-DeoZyeQe.mjs} +25 -25
  71. package/dist/{content-scan-COyTz0Wb.mjs → content-scan-W0BNzbQp.mjs} +1 -1
  72. package/dist/{context-Bwkz4Lm_.mjs → context-q7UaYK69.mjs} +2 -2
  73. package/dist/{cps-B7_BJaAU.mjs → cps-BZ6hqRb5.mjs} +1 -1
  74. package/dist/{csamScanner-jez2EYXC.mjs → csamScanner-Bo1t3CLh.mjs} +1 -1
  75. package/dist/{ct-alerting-CACDrY0E.mjs → ct-alerting-E03faC7p.mjs} +1 -1
  76. package/dist/{custom-certificates-BBd92YlF.mjs → custom-certificates-CUySSPzi.mjs} +3 -3
  77. package/dist/{custom-csrs-DTwBiNMX.mjs → custom-csrs-gNpWkJPQ.mjs} +1 -1
  78. package/dist/{custom-hostnames-DIWlqvN9.mjs → custom-hostnames-abGBAbx7.mjs} +4 -4
  79. package/dist/{custom-nameservers-DISy8v8u.mjs → custom-nameservers-BgNXol1P.mjs} +1 -1
  80. package/dist/{custom-pages-BHXO_NFv.mjs → custom-pages-DMKX3aoD.mjs} +1 -1
  81. package/dist/{d1-MvAQMvvo.mjs → d1-CE08YqYk.mjs} +26 -22
  82. package/dist/{dcv-delegation-Buq0hcm_.mjs → dcv-delegation-B5YUEWu0.mjs} +1 -1
  83. package/dist/deploy-CWNm1-5v.mjs +2 -0
  84. package/dist/deploy-context-Dr6bxNcB.mjs +56 -0
  85. package/dist/deploy-input-Cc0_2QlW.mjs +2 -0
  86. package/dist/{dev-D8FGPKRt.mjs → dev-ZA8itQE7.mjs} +1 -1
  87. package/dist/{diagnostics-ChDfJ-Gv.mjs → diagnostics-UMbG6m4n.mjs} +1 -1
  88. package/dist/dialog-D4Y9ocuF.mjs +2 -0
  89. package/dist/{dist-CYFkGHYv.mjs → dist-BHEmAAHr.mjs} +4 -4
  90. package/dist/dist-uRuGmkMB.mjs +60 -0
  91. package/dist/{dls-8D00tqvC.mjs → dls-DIl16mLp.mjs} +1 -1
  92. package/dist/{dns-C-A5pwf3.mjs → dns-QUpgljRG.mjs} +5 -5
  93. package/dist/{dns-firewall-DIiF4pro.mjs → dns-firewall-BZwJXHLj.mjs} +1 -1
  94. package/dist/dry-run-DRj2_uV3.mjs +2 -0
  95. package/dist/{durable-objects-CnIqbj84.mjs → durable-objects-BCj4ykpU.mjs} +1 -1
  96. package/dist/{email-auth-v97Md32E.mjs → email-auth-DlHIYhCk.mjs} +1 -1
  97. package/dist/{email-routing-I29RG4hb.mjs → email-routing-UKVS4DYy.mjs} +1 -1
  98. package/dist/{email-security-BCarmbky.mjs → email-security-CZjfRIg0.mjs} +8 -8
  99. package/dist/{email-sending-CsHk2HAJ.mjs → email-sending-Dquc880C.mjs} +1 -1
  100. package/dist/{error-sanitization-BWnGnB73.mjs → error-sanitization-DE_zSrXw.mjs} +1 -1
  101. package/dist/error-sanitization-DOCQ9Ykh.mjs +2 -0
  102. package/dist/{fieldExtractors-GIVe9jZa.mjs → fieldExtractors-BbwDRquU.mjs} +1 -1
  103. package/dist/{firewall-DpgFqJr3.mjs → firewall--mTfDnCJ.mjs} +3 -3
  104. package/dist/{flagship-BVaXXlsX.mjs → flagship-cfoSwwM9.mjs} +1 -1
  105. package/dist/{fraud-B5GQdEF2.mjs → fraud-Dcsq3EYK.mjs} +1 -1
  106. package/dist/{google-tag-gateway-C4O61lp-.mjs → google-tag-gateway-DPKSkZQi.mjs} +1 -1
  107. package/dist/{healthchecks-BwYMnKSF.mjs → healthchecks-D78hIIBC.mjs} +1 -1
  108. package/dist/{hostnames-DhrGRFeI.mjs → hostnames-sF999-6H.mjs} +1 -1
  109. package/dist/{hyperdrive-DAA8Fazg.mjs → hyperdrive-qWACKfA4.mjs} +2 -2
  110. package/dist/{iam-sRKDU2Z3.mjs → iam-Bvg_PayW.mjs} +1 -1
  111. package/dist/{images-DXdekLVs.mjs → images-DI_lEZ4L.mjs} +1 -1
  112. package/dist/index.mjs +1 -1
  113. package/dist/init-1w_mcgk3.mjs +43 -0
  114. package/dist/{intel-CnVeSjIS.mjs → intel-BxElBUMP.mjs} +1 -1
  115. package/dist/interactive-BW9T1D1q.mjs +48 -0
  116. package/dist/interactive-DGUWZ2Gk.mjs +2 -0
  117. package/dist/{ips-COCUG8mk.mjs → ips-DWoaKxi7.mjs} +1 -1
  118. package/dist/k2-tFjaftl-.mjs +11 -0
  119. package/dist/{keyless-certificates-l2_S__h3.mjs → keyless-certificates-BrvxHU4J.mjs} +1 -1
  120. package/dist/{keys-CDZreums.mjs → keys-DcwTYKRf.mjs} +1 -1
  121. package/dist/{kv-DkpKVimq.mjs → kv-htXS-7uP.mjs} +2 -2
  122. package/dist/{lazy-command-_vZGz6mv.mjs → lazy-command-BDiIwpss.mjs} +1 -1
  123. package/dist/{leaked-credential-checks-edbapECI.mjs → leaked-credential-checks-bvGrLOmQ.mjs} +1 -1
  124. package/dist/{load-balancers-C5YMvhXD.mjs → load-balancers-BNTUt4yG.mjs} +1 -1
  125. package/dist/local-DlDumOSC.mjs +2 -0
  126. package/dist/{local-C0lQ9sTg.mjs → local-DlT72Xpn.mjs} +1 -1
  127. package/dist/{local-runtime-DtnWXN0a.mjs → local-runtime-CokO6qaX.mjs} +1 -1
  128. package/dist/{login-BrjOuHKu.mjs → login-BGF_I_LT.mjs} +1 -1
  129. package/dist/{login-DeOM4v0L.mjs → login-Ccw-mYwT.mjs} +1 -1
  130. package/dist/{logo-matches-CF8321pb.mjs → logo-matches-tE8LTKgg.mjs} +1 -1
  131. package/dist/{logos-Bd8xNRKW.mjs → logos-Bj845Mcw.mjs} +1 -1
  132. package/dist/{logpush-BYk3qqwY.mjs → logpush-Cs8JdvKi.mjs} +7 -7
  133. package/dist/{logs-Jcj2NN8H.mjs → logs-C92XZvNu.mjs} +1 -1
  134. package/dist/{magic-cloud-networking-Dgdb9H0f.mjs → magic-cloud-networking-hNp5MMw-.mjs} +1 -1
  135. package/dist/{magic-network-monitoring-CxVU4MZB.mjs → magic-network-monitoring-68GuWAnv.mjs} +1 -1
  136. package/dist/{magic-transit-KDyfUgTv.mjs → magic-transit-DNd7gu4j.mjs} +6 -6
  137. package/dist/{managed-defense-CxaDeNUd.mjs → managed-defense-B_wCAuFD.mjs} +1 -1
  138. package/dist/{managed-transforms-C7rT5E-x.mjs → managed-transforms-DZdxHPOh.mjs} +1 -1
  139. package/dist/{matches-BtKqG8T9.mjs → matches-B65CkflD.mjs} +1 -1
  140. package/dist/{mcp-QDd1Iyc0.mjs → mcp-DrJW5ayK.mjs} +4 -4
  141. package/dist/mesh-DfVzYTn1.mjs +26 -0
  142. package/dist/{migrate-DHlfR_gZ.mjs → migrate-CZNq63Uj.mjs} +1 -1
  143. package/dist/{monetization-pLalYYMI.mjs → monetization-BGaI8CMO.mjs} +1 -1
  144. package/dist/{mtls-certificates-DYA9Wu-c.mjs → mtls-certificates-BsU2emDD.mjs} +2 -2
  145. package/dist/{network-DrJxPWXQ.mjs → network-BEMD8P0U.mjs} +1 -1
  146. package/dist/{network-interconnects-D73MlYG8.mjs → network-interconnects-DMu_fcbo.mjs} +2 -7
  147. package/dist/o11y-C1a4gDGF.mjs +93 -0
  148. package/dist/{oauth-B08YQ4xq.mjs → oauth-Bj5Ne1o8.mjs} +1 -1
  149. package/dist/{oauth-clients-CkPDLFd-.mjs → oauth-clients-p4Etdqy_.mjs} +1 -1
  150. package/dist/{oauth-TGbM1Q0V.mjs → oauth-mspHHU5U.mjs} +1 -1
  151. package/dist/{oauth-scopes-VgliqcQe.mjs → oauth-scopes-B2IabFza.mjs} +1 -1
  152. package/dist/{organization-DIwqRBBV.mjs → organization-CdXt7AVZ.mjs} +1 -1
  153. package/dist/{organizations-Dk0D9ukm.mjs → organizations-5S6xEp7T.mjs} +1 -1
  154. package/dist/{origin-ca-certificates-BSFqMTn-.mjs → origin-ca-certificates-_VJAoK1D.mjs} +1 -1
  155. package/dist/{origin-post-quantum-encryption-BOKWKDTY.mjs → origin-post-quantum-encryption-GcldDsT2.mjs} +1 -1
  156. package/dist/{origin-tls-client-auth-BzE3WpcN.mjs → origin-tls-client-auth-DZHld9fA.mjs} +3 -3
  157. package/dist/{output-BGqhvqe2.mjs → output-BOe-3AQG.mjs} +1 -1
  158. package/dist/{page-rules-BKaU37cM.mjs → page-rules-o1tAMMsD.mjs} +1 -1
  159. package/dist/{pages-2Xg-lrMf.mjs → pages-CmiOhjSl.mjs} +4 -4
  160. package/dist/pay-per-crawl-BsnOxGYU.mjs +38 -0
  161. package/dist/pay-per-use-BXWMCSyE.mjs +33 -0
  162. package/dist/{pipelines-BM-T7mMK.mjs → pipelines-DWLQC0F6.mjs} +2 -2
  163. package/dist/{precursor-DmQ32-Sp.mjs → precursor-B6DjBib6.mjs} +1 -1
  164. package/dist/{previews-DDQ9ACDJ.mjs → previews-dUKEBGSM.mjs} +1 -1
  165. package/dist/process-2wmDCy17.mjs +2 -0
  166. package/dist/{progress-BYVZuEcG.mjs → progress-BtkTVcHI.mjs} +1 -1
  167. package/dist/prompt-RlgRrmbm.mjs +3 -0
  168. package/dist/{queries-DPBkVynK.mjs → queries-yLwoJRHV.mjs} +1 -1
  169. package/dist/{queues-CCXRs98q.mjs → queues-CnJRaE1o.mjs} +1 -1
  170. package/dist/{r2-BKuBSW8h.mjs → r2-CuC6-zQX.mjs} +48 -45
  171. package/dist/{radar-Gv1yFoRX.mjs → radar-DrQLcbkq.mjs} +1 -1
  172. package/dist/{raw-fetch-DyYWa923.mjs → raw-fetch-B4NvWuZD.mjs} +1 -1
  173. package/dist/{realtime-CVl-rvgx.mjs → realtime-CjsnzHxD.mjs} +1 -1
  174. package/dist/{registrar-swlnh22i.mjs → registrar-BgOsxTnX.mjs} +1 -1
  175. package/dist/{registrar-sandbox-cmOYDnkp.mjs → registrar-sandbox-3ikBD9fB.mjs} +1 -1
  176. package/dist/{registry-C20J1MW0.mjs → registry-CHowrQsZ.mjs} +1 -1
  177. package/dist/{reporting-Bgwsvol1.mjs → reporting-hE127s5r.mjs} +1 -1
  178. package/dist/{request-headers-CUee83pa.mjs → request-headers-DiJeDAn1.mjs} +1 -1
  179. package/dist/{request-tracers-BBiJvVDz.mjs → request-tracers-BCwLxmPN.mjs} +1 -1
  180. package/dist/{resolve-DvxgnWjL.mjs → resolve-CaTBV-c6.mjs} +1 -1
  181. package/dist/resolve-DCGSzUDQ.mjs +2 -0
  182. package/dist/{resource-sharing-C1JiYLbl.mjs → resource-sharing-2qvWUuMa.mjs} +11 -11
  183. package/dist/{resource-tagging-C9VOSlDR.mjs → resource-tagging-Dwx7iL3v.mjs} +1 -1
  184. package/dist/{rules-BDunCGMj.mjs → rules-DxVQ6jIg.mjs} +1 -1
  185. package/dist/rulesets-Cdh8YjI9.mjs +37 -0
  186. package/dist/{rum-B7XiECe9.mjs → rum-a4CMq4Qu.mjs} +1 -1
  187. package/dist/{run-CrZgB8L_.mjs → run-BvHwWWUX.mjs} +1 -1
  188. package/dist/run-CkbrPJPx.mjs +2 -0
  189. package/dist/{schema-DC0kdqgV.mjs → schema-elj12WOx.mjs} +1 -1
  190. package/dist/{schema-flags-BUZR9SLd.mjs → schema-flags-BzoBGPWk.mjs} +1 -1
  191. package/dist/{scim-CORcs2wK.mjs → scim-B8XlXl8v.mjs} +1 -1
  192. package/dist/{secrets-store-BoZQaFey.mjs → secrets-store-Cqhedh_i.mjs} +2 -2
  193. package/dist/{security-insights-DblK_6sg.mjs → security-insights-le2-DteL.mjs} +1 -1
  194. package/dist/{security-txt-Dl7RPnRb.mjs → security-txt-cCArWXur.mjs} +1 -1
  195. package/dist/{session-BWe9et4K.mjs → session-C1BhT1ZJ.mjs} +1 -1
  196. package/dist/shared-BPjcpXuA.mjs +2 -0
  197. package/dist/{smart-shield-DX0-8ruu.mjs → smart-shield-Csyh8hwB.mjs} +1 -1
  198. package/dist/{snippets-BFN-Lg3K.mjs → snippets-DUWx25q6.mjs} +1 -1
  199. package/dist/spawn-IysxuTNW.mjs +10 -0
  200. package/dist/{spectrum-HYWLWB0X.mjs → spectrum-Da3UYSOR.mjs} +1 -1
  201. package/dist/{speed-Dj0YhfRe.mjs → speed-NxlMnB2e.mjs} +1 -1
  202. package/dist/sql-CNdHAlQ8.mjs +4 -0
  203. package/dist/src-JfLDUxFr.mjs +125 -0
  204. package/dist/{ssl-BQL1fNtD.mjs → ssl-BtaX2WEJ.mjs} +1 -1
  205. package/dist/startup-profile-B2l0ChVu.mjs +2 -0
  206. package/dist/{startup-profile-0X5ebbng.mjs → startup-profile-CdJWgNjd.mjs} +1 -1
  207. package/dist/{state-Dy6-rKNd.mjs → state-BDSvdSdP.mjs} +1 -1
  208. package/dist/state-JB4_BU1o.mjs +2 -0
  209. package/dist/{stream-DKv2TtZN.mjs → stream-C1Ijjzn4.mjs} +3 -3
  210. package/dist/{submit-Byt2KBGI.mjs → submit-MdkuU_Pt.mjs} +1 -1
  211. package/dist/{tags-BIBsdG68.mjs → tags-CA1xMM96.mjs} +1 -1
  212. package/dist/telemetry-BsYO3nxG.mjs +2 -0
  213. package/dist/{telemetry-bu3txnIR.mjs → telemetry-Cm39QJ-M.mjs} +1 -1
  214. package/dist/{tenant-Bs4Ac4n3.mjs → tenant-BB6Oszcl.mjs} +1 -1
  215. package/dist/{tenant-custom-nameservers-DcaELeCE.mjs → tenant-custom-nameservers-BsbgYAEo.mjs} +1 -1
  216. package/dist/{tools-BbTX7rlM.mjs → tools-CSc5DmFi.mjs} +1 -1
  217. package/dist/{tunnels-DWcrz9Sf.mjs → tunnels-CRFtyHWz.mjs} +4 -4
  218. package/dist/{turnstile-2MIGp2ce.mjs → turnstile-DBXWo_Xe.mjs} +1 -1
  219. package/dist/update-check-C2oVEbXx.mjs +2 -0
  220. package/dist/{update-check-CfB0PNTY.mjs → update-check-CMXSdres.mjs} +1 -1
  221. package/dist/update-check-worker.mjs +1 -1
  222. package/dist/{url-info-B8udoxlx.mjs → url-info-t-XAs0Mk.mjs} +1 -1
  223. package/dist/{url-normalization-C6AdWtaE.mjs → url-normalization-Cs4F8e0a.mjs} +1 -1
  224. package/dist/{url-scanner-Dg0c_yVb.mjs → url-scanner-CBIoDbTx.mjs} +1 -1
  225. package/dist/{user-BLZ-0Bgv.mjs → user-CevdOMoa.mjs} +3 -3
  226. package/dist/values-CjNlkbIh.mjs +4 -0
  227. package/dist/{vectorize-DEUSEQXY.mjs → vectorize-9d9tPmg5.mjs} +1 -1
  228. package/dist/version-BdVUXLnK.mjs +2 -0
  229. package/dist/{waiting-rooms-BycGk2Y0.mjs → waiting-rooms--5WmrWb3.mjs} +1 -1
  230. package/dist/{web-assets-CLZdWOmN.mjs → web-assets-BHot_MU8.mjs} +1 -1
  231. package/dist/{web3-DjeavuLg.mjs → web3-CYfWAF6b.mjs} +1 -1
  232. package/dist/{workers-C_SfyU-v.mjs → workers-S17M0n3h.mjs} +23 -21
  233. package/dist/{workers-builds-COn5Ne5G.mjs → workers-builds-Dw7ho3So.mjs} +2 -2
  234. package/dist/{workers-for-platforms-tchCXwNF.mjs → workers-for-platforms-A3yjyLh3.mjs} +4 -6
  235. package/dist/{workers-vpc-CKts8Av0.mjs → workers-vpc-BZ2xXtC3.mjs} +1 -1
  236. package/dist/{workflows-BibtWuOx.mjs → workflows-BgGrVpSR.mjs} +1 -1
  237. package/dist/{wrangler-migration-BpJqCFAa.mjs → wrangler-migration-C6FKHER1.mjs} +1 -1
  238. package/dist/{zaraz-BvQZB0YY.mjs → zaraz-BsD2dMI3.mjs} +1 -1
  239. package/dist/{zero-trust-FStq4uhn.mjs → zero-trust-CA3iGQbG.mjs} +413 -397
  240. package/dist/{zone-tymlghWb.mjs → zone-D2M4EZD0.mjs} +1 -1
  241. package/dist/{zones-Bz6dgT9_.mjs → zones-BoOC_JzC.mjs} +1 -1
  242. package/package.json +25 -26
  243. package/dist/account-tags-d0RkEw6s.mjs +0 -15
  244. package/dist/ai-gateway-CJaUlfGc.mjs +0 -82
  245. package/dist/ai-search-PTlpY1T9.mjs +0 -79
  246. package/dist/analytics-NPND7aHB.mjs +0 -20
  247. package/dist/argo-DYfLQhd2.mjs +0 -10
  248. package/dist/auth-CBtzZ3Sw.mjs +0 -2
  249. package/dist/browser-run-DVaiBLYX.mjs +0 -46
  250. package/dist/build-C4giET85.mjs +0 -2
  251. package/dist/cf-B9aqZZKD.mjs +0 -18
  252. package/dist/chunk-KKDV4JPS-D3kwd1Nq.mjs +0 -2
  253. package/dist/cloudflared-B48cfu95.mjs +0 -2
  254. package/dist/command-CzvlHvov.mjs +0 -2
  255. package/dist/deploy-BS47vZvJ.mjs +0 -2
  256. package/dist/deploy-context-Cfushp8j.mjs +0 -56
  257. package/dist/deploy-input-BAhS5LYx.mjs +0 -2
  258. package/dist/dialog-CL1Zy4pn.mjs +0 -2
  259. package/dist/dist-8rP3V95o.mjs +0 -57
  260. package/dist/dry-run-DmsbOMF1.mjs +0 -2
  261. package/dist/error-sanitization-C_a2LxOK.mjs +0 -2
  262. package/dist/init-j47MT4Qe.mjs +0 -39
  263. package/dist/interactive-Dqv0RWVU.mjs +0 -42
  264. package/dist/interactive-Wpd3FcDc.mjs +0 -2
  265. package/dist/k2-CmHkArHL.mjs +0 -13
  266. package/dist/local-D5L5Bwju.mjs +0 -2
  267. package/dist/mesh-DtrIzl5z.mjs +0 -26
  268. package/dist/observability-CvN9oxAo.mjs +0 -80
  269. package/dist/pay-per-crawl-5-KTQXRr.mjs +0 -65
  270. package/dist/pay-per-use-sGebKzNK.mjs +0 -6
  271. package/dist/prompt-F5wxc8zq.mjs +0 -3
  272. package/dist/resolve-qwL1LmKN.mjs +0 -2
  273. package/dist/rulesets-BMGxrnv9.mjs +0 -37
  274. package/dist/run-nNxXb_Cv.mjs +0 -2
  275. package/dist/shared-0N31BXkY.mjs +0 -2
  276. package/dist/spawn-DZ9A-xXb.mjs +0 -10
  277. package/dist/src-CAiZlihY.mjs +0 -117
  278. package/dist/startup-profile-CXnsF4c7.mjs +0 -2
  279. package/dist/state-BA2CanJ_.mjs +0 -2
  280. package/dist/telemetry-DBXOMuLh.mjs +0 -2
  281. package/dist/update-check-B-CvDAUz.mjs +0 -2
  282. package/dist/values-BUK-m0Jg.mjs +0 -4
  283. package/dist/version-BZNc7Y3t.mjs +0 -2
@@ -1,79 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-C0lQ9sTg.mjs";import{i as t,n}from"./auth-AobvBmz4.mjs";import{a as r,t as i}from"./context-Bwkz4Lm_.mjs";import{t as a}from"./output-BGqhvqe2.mjs";import{t as o}from"./dry-run-DmsbOMF1.mjs";import{t as s}from"./progress-BYVZuEcG.mjs";import{t as c}from"./run-CrZgB8L_.mjs";import"./telemetry-DBXOMuLh.mjs";import{n as l,r as u,t as d}from"./body-parser-DkHKPkJ7.mjs";import{n as f,t as p}from"./input-validation-D7z60HJH.mjs";import{a as m,i as h,n as g}from"./prompt-F5wxc8zq.mjs";import{t as _}from"./cli-types-9oYmRTHJ.mjs";import{n as ee,t as te}from"./raw-fetch-DyYWa923.mjs";function v(e){return e.usage(`$0 ai-search chat-completions <id>
3
-
4
- Performs a chat completion request against an AI Search instance, using indexed content as context for generating responses.`).positional(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`ai-search-options-cache-cache-threshold`,{type:`string`,description:`The ai_search_options.cache.cache_threshold field`,choices:[`super_strict_match`,`close_enough`,`flexible_friend`,`anything_goes`]}).option(`ai-search-options-cache-enabled`,{type:`boolean`,description:`The ai_search_options.cache.enabled field`}).option(`ai-search-options-query-rewrite-enabled`,{type:`boolean`,description:`The ai_search_options.query_rewrite.enabled field`}).option(`ai-search-options-query-rewrite-model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`ai-search-options-query-rewrite-rewrite-prompt`,{type:`string`,description:`The ai_search_options.query_rewrite.rewrite_prompt field`}).option(`ai-search-options-reranking-enabled`,{type:`boolean`,description:`The ai_search_options.reranking.enabled field`}).option(`ai-search-options-reranking-match-threshold`,{type:`number`,description:`The ai_search_options.reranking.match_threshold field`}).option(`ai-search-options-reranking-model`,{type:`string`,description:`The ai_search_options.reranking.model field`}).option(`ai-search-options-retrieval-context-expansion`,{type:`number`,description:`The ai_search_options.retrieval.context_expansion field`}).option(`ai-search-options-retrieval-fusion-method`,{type:`string`,description:`The ai_search_options.retrieval.fusion_method field`,choices:[`max`,`rrf`]}).option(`ai-search-options-retrieval-keyword-match-mode`,{type:`string`,description:`Controls which documents are candidates for BM25 scoring. 'and' restricts candidates to documents containing all query terms; 'or' includes any document containing at least one term, ranked by BM25 relevance. When omitted, falls back to the instance-level retrieval_options.keyword_match_mode, then to 'and'.`,choices:[`and`,`or`]}).option(`ai-search-options-retrieval-match-threshold`,{type:`number`,description:`The ai_search_options.retrieval.match_threshold field`}).option(`ai-search-options-retrieval-max-num-results`,{type:`number`,description:`The ai_search_options.retrieval.max_num_results field`}).option(`ai-search-options-retrieval-retrieval-type`,{type:`string`,description:`The ai_search_options.retrieval.retrieval_type field`,choices:[`vector`,`keyword`,`hybrid`]}).option(`ai-search-options-retrieval-return-on-failure`,{type:`boolean`,description:`The ai_search_options.retrieval.return_on_failure field`}).option(`messages`,{type:`string`,description:`The messages field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`stream`,{type:`boolean`,description:`The stream field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`chat-completions <id>`,describe:`Chat Completions`,builder:v,handler:async t=>c({command:`ai-search chat-completions`,classification:{safeFlags:[`ai-search-options-cache-cache-threshold`,`ai-search-options-cache-enabled`,`ai-search-options-query-rewrite-enabled`,`ai-search-options-reranking-enabled`,`ai-search-options-retrieval-fusion-method`,`ai-search-options-retrieval-keyword-match-mode`,`ai-search-options-retrieval-retrieval-type`,`ai-search-options-retrieval-return-on-failure`,`stream`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search chat-completions`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/chat/completions`,pathParams:{id:String(t.id??``),name:String(t.name??``)},bodyKind:`json`,body:t.body===void 0?d({ai_search_options:{cache:{cache_threshold:f(t[`ai-search-options-cache-cache-threshold`],`ai-search-options-cache-cache-threshold`,`text`),enabled:t[`ai-search-options-cache-enabled`]},query_rewrite:{enabled:t[`ai-search-options-query-rewrite-enabled`],model:f(t[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`),rewrite_prompt:f(t[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)},reranking:{enabled:t[`ai-search-options-reranking-enabled`],match_threshold:t[`ai-search-options-reranking-match-threshold`],model:f(t[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)},retrieval:{context_expansion:t[`ai-search-options-retrieval-context-expansion`],fusion_method:f(t[`ai-search-options-retrieval-fusion-method`],`ai-search-options-retrieval-fusion-method`,`text`),keyword_match_mode:f(t[`ai-search-options-retrieval-keyword-match-mode`],`ai-search-options-retrieval-keyword-match-mode`,`text`),match_threshold:t[`ai-search-options-retrieval-match-threshold`],max_num_results:t[`ai-search-options-retrieval-max-num-results`],retrieval_type:f(t[`ai-search-options-retrieval-retrieval-type`],`ai-search-options-retrieval-retrieval-type`,`text`),return_on_failure:t[`ai-search-options-retrieval-return-on-failure`]}},messages:u(t.messages,`messages`),model:f(t.model,`model`,`text`),stream:t.stream}):l(t.body)});return}let c=await n(t),p=t.local?e:await i();if(t.accountId=p,t.body){let e=l(t.body),n=await s(`Creating`,async()=>c.aiSearch.chatCompletions({...e,account_id:p,name:t.name,id:t.id}));a(n,{successLabel:`Created`});return}if(t.messages===void 0)throw Error(`--messages is required (or pass --body with this field set).`);let m=d({ai_search_options:{cache:{cache_threshold:f(t[`ai-search-options-cache-cache-threshold`],`ai-search-options-cache-cache-threshold`,`text`),enabled:t[`ai-search-options-cache-enabled`]},query_rewrite:{enabled:t[`ai-search-options-query-rewrite-enabled`],model:f(t[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`),rewrite_prompt:f(t[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)},reranking:{enabled:t[`ai-search-options-reranking-enabled`],match_threshold:t[`ai-search-options-reranking-match-threshold`],model:f(t[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)},retrieval:{context_expansion:t[`ai-search-options-retrieval-context-expansion`],fusion_method:f(t[`ai-search-options-retrieval-fusion-method`],`ai-search-options-retrieval-fusion-method`,`text`),keyword_match_mode:f(t[`ai-search-options-retrieval-keyword-match-mode`],`ai-search-options-retrieval-keyword-match-mode`,`text`),match_threshold:t[`ai-search-options-retrieval-match-threshold`],max_num_results:t[`ai-search-options-retrieval-max-num-results`],retrieval_type:f(t[`ai-search-options-retrieval-retrieval-type`],`ai-search-options-retrieval-retrieval-type`,`text`),return_on_failure:t[`ai-search-options-retrieval-return-on-failure`]}},messages:u(t.messages,`messages`),model:f(t.model,`model`,`text`),stream:t.stream}),h=await s(`Creating`,async()=>c.aiSearch.chatCompletions({...m,account_id:p,name:t.name,id:t.id}));a(h,{successLabel:`Created`})})};function b(e){return e.usage(`$0 ai-search create <name> <id>
5
-
6
- Create a new AI Search instance with the given configuration. If type is omitted or null, a non-blank HTTP(S) source infers web-crawler and an existing R2 bucket source infers r2. A missing or blank source without a type creates a managed upload-only instance. Search for Agents instances require the default namespace.`).positional(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).positional(`id`,{type:`string`,description:`Unique ID for the new AI Search instance.`,demandOption:!0}).option(`ai-gateway-id`,{type:`string`,description:`The ai_gateway_id field`}).option(`ai-search-model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`cache`,{type:`boolean`,description:`The cache field`,default:!0}).option(`cache-threshold`,{type:`string`,description:`The cache_threshold field`,choices:[`super_strict_match`,`close_enough`,`flexible_friend`,`anything_goes`],default:`close_enough`}).option(`chunk`,{type:`boolean`,description:`The chunk field`,default:!0}).option(`chunk-overlap`,{type:`number`,description:`The chunk_overlap field`,default:10}).option(`chunk-size`,{type:`number`,description:`The chunk_size field`}).option(`custom-metadata`,{type:`string`,description:`The custom_metadata field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`embedding-model`,{type:`string`,description:`The embedding_model field`}).option(`fusion-method`,{type:`string`,description:`The fusion_method field`,choices:[`max`,`rrf`],default:`rrf`}).option(`hybrid-search-enabled`,{type:`boolean`,description:`Deprecated — use index_method instead. Defaults to true for new instances; set false to create a vector-only instance.`,default:!0}).option(`index-method-keyword`,{type:`boolean`,description:`Enable keyword (BM25) storage backend.`}).option(`index-method-vector`,{type:`boolean`,description:`Enable vector (embedding) storage backend.`}).option(`indexing-options-keyword-tokenizer`,{type:`string`,description:`Tokenizer used for keyword search indexing. porter provides word-level tokenization with Porter stemming (good for natural language queries). trigram enables character-level substring matching (good for partial matches, code, identifiers). Changing this triggers a full re-index. Defaults to porter.`,choices:[`porter`,`trigram`]}).option(`indexing-options-use-ocr`,{type:`boolean`,description:`Enables OCR ingestion for PDFs and images. Changing this triggers a full re-index. Defaults to false.`}).option(`max-num-results`,{type:`number`,description:`The max_num_results field`,default:10}).option(`metadata-created-from-aisearch-wizard`,{type:`boolean`,description:`The metadata.created_from_aisearch_wizard field`}).option(`metadata-worker-domain`,{type:`string`,description:`The metadata.worker_domain field`}).option(`public-endpoint-params-authorized-hosts`,{type:`string`,array:!0,description:`The public_endpoint_params.authorized_hosts field`}).option(`public-endpoint-params-chat-completions-endpoint-disabled`,{type:`boolean`,description:`Disable chat completions endpoint for this public endpoint`}).option(`public-endpoint-params-custom-domains`,{type:`string`,array:!0,description:`Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).`}).option(`public-endpoint-params-default-domain-enabled`,{type:`boolean`,description:`When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public_endpoint_params is replaced wholesale on update, so resend default_domain_enabled on every update to keep the default host off — omitting it resets to true.`}).option(`public-endpoint-params-enabled`,{type:`boolean`,description:`The public_endpoint_params.enabled field`}).option(`public-endpoint-params-mcp-description`,{type:`string`,description:`The public_endpoint_params.mcp.description field`}).option(`public-endpoint-params-mcp-disabled`,{type:`boolean`,description:`Disable MCP endpoint for this public endpoint`}).option(`public-endpoint-params-rate-limit-period-ms`,{type:`number`,description:`The public_endpoint_params.rate_limit.period_ms field`}).option(`public-endpoint-params-rate-limit-requests`,{type:`number`,description:`The public_endpoint_params.rate_limit.requests field`}).option(`public-endpoint-params-rate-limit-technique`,{type:`string`,description:`The public_endpoint_params.rate_limit.technique field`,choices:[`fixed`,`sliding`]}).option(`public-endpoint-params-search-endpoint-disabled`,{type:`boolean`,description:`Disable search endpoint for this public endpoint`}).option(`reranking`,{type:`boolean`,description:`The reranking field`,default:!1}).option(`reranking-model`,{type:`string`,description:`The reranking_model field`}).option(`retrieval-options-keyword-match-mode`,{type:`string`,description:`Controls which documents are candidates for BM25 scoring. 'and' restricts candidates to documents containing all query terms; 'or' includes any document containing at least one term, ranked by BM25 relevance. When omitted on an update, the existing stored value is preserved; when never set, search falls back to 'and'.`,choices:[`and`,`or`]}).option(`rewrite-model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`rewrite-query`,{type:`boolean`,description:`The rewrite_query field`,default:!1}).option(`score-threshold`,{type:`number`,description:`The score_threshold field`,default:.4}).option(`source`,{type:`string`,description:`The source field`}).option(`source-params-exclude-items`,{type:`string`,array:!0,description:`List of path patterns to exclude. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /admin/** matches /admin/users and /admin/settings/advanced). Most accounts are limited to 10 rules; contact support to raise it.`}).option(`source-params-include-items`,{type:`string`,array:!0,description:`List of path patterns to include. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /blog/** matches /blog/post and /blog/2024/post). Most accounts are limited to 10 rules; contact support to raise it.`}).option(`source-params-prefix`,{type:`string`,description:`The source_params.prefix field`}).option(`source-params-r2-jurisdiction`,{type:`string`,description:`The source_params.r2_jurisdiction field`}).option(`source-params-web-crawler-discover-options-depth`,{type:`number`,description:`Maximum link-follow depth from the seed URL.`}).option(`source-params-web-crawler-discover-options-include-external-links`,{type:`boolean`,description:"Follow links that point outside the source domain. Must stay `false` — discover crawls are restricted to the zone you own."}).option(`source-params-web-crawler-discover-options-include-subdomains`,{type:`boolean`,description:`Follow links to subdomains of the source host.`}).option(`source-params-web-crawler-discover-options-limit`,{type:`number`,description:`Maximum number of pages to crawl (1-100000).`}).option(`source-params-web-crawler-discover-options-max-age`,{type:`number`,description:`Maximum content age in seconds to accept (0–604800).`}).option(`source-params-web-crawler-discover-options-source`,{type:`string`,description:`Where the crawler looks for URLs: 'sitemaps' reads sitemap XML only, 'links' follows page links only, 'all' does both.`,choices:[`all`,`sitemaps`,`links`]}).option(`source-params-web-crawler-parse-options-include-images`,{type:`boolean`,description:`The source_params.web_crawler.parse_options.include_images field`}).option(`source-params-web-crawler-parse-options-specific-sitemaps`,{type:`string`,array:!0,description:`List of specific sitemap URLs to use for crawling. Only valid when parse_type is 'sitemap'.`}).option(`source-params-web-crawler-parse-options-use-browser-rendering`,{type:`boolean`,description:`The source_params.web_crawler.parse_options.use_browser_rendering field`}).option(`source-params-web-crawler-parse-type`,{type:`string`,description:`How URLs are discovered. 'sitemap' reads XML sitemaps; 'discover' follows links recursively and requires the source to be a Verified zone on this account.`,choices:[`sitemap`,`discover`]}).option(`token-id`,{type:`string`,description:`The token_id field`}).option(`type`,{type:`string`,description:`Source type. When omitted or null with a non-blank source, HTTP(S) URLs infer web-crawler and existing R2 bucket names infer r2. A missing or blank source without a type uses managed upload-only storage.`,choices:[`r2`,`web-crawler`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`index-method-keyword`,`index-method-vector`].some(t=>e[t]!==void 0)){let t=[`index-method-keyword`,`index-method-vector`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --index_method-* flag is set`)}return!0})}const x={command:`create <name> <id>`,describe:`Create an AI Search instance (Search for Agents requires the default namespace).`,builder:b,handler:async t=>c({command:`ai-search create`,classification:{safeFlags:/* @__PURE__ */ `cache.cache-threshold.chunk.fusion-method.hybrid-search-enabled.index-method-keyword.index-method-vector.indexing-options-keyword-tokenizer.indexing-options-use-ocr.metadata-created-from-aisearch-wizard.public-endpoint-params-chat-completions-endpoint-disabled.public-endpoint-params-default-domain-enabled.public-endpoint-params-enabled.public-endpoint-params-mcp-disabled.public-endpoint-params-rate-limit-technique.public-endpoint-params-search-endpoint-disabled.reranking.retrieval-options-keyword-match-mode.rewrite-query.source-params-web-crawler-discover-options-include-external-links.source-params-web-crawler-discover-options-include-subdomains.source-params-web-crawler-discover-options-source.source-params-web-crawler-parse-options-include-images.source-params-web-crawler-parse-options-use-browser-rendering.source-params-web-crawler-parse-type.type.dry-run`.split(`.`)}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances`,pathParams:{name:String(t.name??``)},bodyKind:`json`,body:t.body===void 0?d({ai_gateway_id:f(t[`ai-gateway-id`],`ai-gateway-id`,`text`),ai_search_model:f(t[`ai-search-model`],`ai-search-model`,`text`),cache:t.cache,cache_threshold:f(t[`cache-threshold`],`cache-threshold`,`text`),chunk:t.chunk,chunk_overlap:t[`chunk-overlap`],chunk_size:t[`chunk-size`],custom_metadata:u(t[`custom-metadata`],`custom-metadata`),embedding_model:f(t[`embedding-model`],`embedding-model`,`text`),fusion_method:f(t[`fusion-method`],`fusion-method`,`text`),hybrid_search_enabled:t[`hybrid-search-enabled`],index_method:{keyword:t[`index-method-keyword`],vector:t[`index-method-vector`]},indexing_options:{keyword_tokenizer:f(t[`indexing-options-keyword-tokenizer`],`indexing-options-keyword-tokenizer`,`text`),use_ocr:t[`indexing-options-use-ocr`]},max_num_results:t[`max-num-results`],metadata:{created_from_aisearch_wizard:t[`metadata-created-from-aisearch-wizard`],worker_domain:f(t[`metadata-worker-domain`],`metadata-worker-domain`,`text`)},public_endpoint_params:{authorized_hosts:t[`public-endpoint-params-authorized-hosts`],chat_completions_endpoint:{disabled:t[`public-endpoint-params-chat-completions-endpoint-disabled`]},custom_domains:t[`public-endpoint-params-custom-domains`],default_domain_enabled:t[`public-endpoint-params-default-domain-enabled`],enabled:t[`public-endpoint-params-enabled`],mcp:{description:f(t[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`),disabled:t[`public-endpoint-params-mcp-disabled`]},rate_limit:{period_ms:t[`public-endpoint-params-rate-limit-period-ms`],requests:t[`public-endpoint-params-rate-limit-requests`],technique:f(t[`public-endpoint-params-rate-limit-technique`],`public-endpoint-params-rate-limit-technique`,`text`)},search_endpoint:{disabled:t[`public-endpoint-params-search-endpoint-disabled`]}},reranking:t.reranking,reranking_model:f(t[`reranking-model`],`reranking-model`,`text`),retrieval_options:{keyword_match_mode:f(t[`retrieval-options-keyword-match-mode`],`retrieval-options-keyword-match-mode`,`text`)},rewrite_model:f(t[`rewrite-model`],`rewrite-model`,`text`),rewrite_query:t[`rewrite-query`],score_threshold:t[`score-threshold`],source:f(t.source,`source`,`text`),source_params:{exclude_items:t[`source-params-exclude-items`],include_items:t[`source-params-include-items`],prefix:f(t[`source-params-prefix`],`source-params-prefix`,`text`),r2_jurisdiction:f(t[`source-params-r2-jurisdiction`],`source-params-r2-jurisdiction`,`text`),web_crawler:{discover_options:{depth:t[`source-params-web-crawler-discover-options-depth`],include_external_links:t[`source-params-web-crawler-discover-options-include-external-links`],include_subdomains:t[`source-params-web-crawler-discover-options-include-subdomains`],limit:t[`source-params-web-crawler-discover-options-limit`],max_age:t[`source-params-web-crawler-discover-options-max-age`],source:f(t[`source-params-web-crawler-discover-options-source`],`source-params-web-crawler-discover-options-source`,`text`)},parse_options:{include_images:t[`source-params-web-crawler-parse-options-include-images`],specific_sitemaps:t[`source-params-web-crawler-parse-options-specific-sitemaps`],use_browser_rendering:t[`source-params-web-crawler-parse-options-use-browser-rendering`]},parse_type:f(t[`source-params-web-crawler-parse-type`],`source-params-web-crawler-parse-type`,`text`)}},token_id:f(t[`token-id`],`token-id`,`text`),type:f(t.type,`type`,`text`),id:t.id}):l(t.body)});return}let c=await n(t),p=t.local?e:await i();if(t.accountId=p,t.body){let e=l(t.body),n=await s(`Creating`,async()=>c.aiSearch.create({...e,account_id:p,name:t.name}));a(n,{successLabel:`Created`});return}let m=d({ai_gateway_id:f(t[`ai-gateway-id`],`ai-gateway-id`,`text`),ai_search_model:f(t[`ai-search-model`],`ai-search-model`,`text`),cache:t.cache,cache_threshold:f(t[`cache-threshold`],`cache-threshold`,`text`),chunk:t.chunk,chunk_overlap:t[`chunk-overlap`],chunk_size:t[`chunk-size`],custom_metadata:u(t[`custom-metadata`],`custom-metadata`),embedding_model:f(t[`embedding-model`],`embedding-model`,`text`),fusion_method:f(t[`fusion-method`],`fusion-method`,`text`),hybrid_search_enabled:t[`hybrid-search-enabled`],index_method:{keyword:t[`index-method-keyword`],vector:t[`index-method-vector`]},indexing_options:{keyword_tokenizer:f(t[`indexing-options-keyword-tokenizer`],`indexing-options-keyword-tokenizer`,`text`),use_ocr:t[`indexing-options-use-ocr`]},max_num_results:t[`max-num-results`],metadata:{created_from_aisearch_wizard:t[`metadata-created-from-aisearch-wizard`],worker_domain:f(t[`metadata-worker-domain`],`metadata-worker-domain`,`text`)},public_endpoint_params:{authorized_hosts:t[`public-endpoint-params-authorized-hosts`],chat_completions_endpoint:{disabled:t[`public-endpoint-params-chat-completions-endpoint-disabled`]},custom_domains:t[`public-endpoint-params-custom-domains`],default_domain_enabled:t[`public-endpoint-params-default-domain-enabled`],enabled:t[`public-endpoint-params-enabled`],mcp:{description:f(t[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`),disabled:t[`public-endpoint-params-mcp-disabled`]},rate_limit:{period_ms:t[`public-endpoint-params-rate-limit-period-ms`],requests:t[`public-endpoint-params-rate-limit-requests`],technique:f(t[`public-endpoint-params-rate-limit-technique`],`public-endpoint-params-rate-limit-technique`,`text`)},search_endpoint:{disabled:t[`public-endpoint-params-search-endpoint-disabled`]}},reranking:t.reranking,reranking_model:f(t[`reranking-model`],`reranking-model`,`text`),retrieval_options:{keyword_match_mode:f(t[`retrieval-options-keyword-match-mode`],`retrieval-options-keyword-match-mode`,`text`)},rewrite_model:f(t[`rewrite-model`],`rewrite-model`,`text`),rewrite_query:t[`rewrite-query`],score_threshold:t[`score-threshold`],source:f(t.source,`source`,`text`),source_params:{exclude_items:t[`source-params-exclude-items`],include_items:t[`source-params-include-items`],prefix:f(t[`source-params-prefix`],`source-params-prefix`,`text`),r2_jurisdiction:f(t[`source-params-r2-jurisdiction`],`source-params-r2-jurisdiction`,`text`),web_crawler:{discover_options:{depth:t[`source-params-web-crawler-discover-options-depth`],include_external_links:t[`source-params-web-crawler-discover-options-include-external-links`],include_subdomains:t[`source-params-web-crawler-discover-options-include-subdomains`],limit:t[`source-params-web-crawler-discover-options-limit`],max_age:t[`source-params-web-crawler-discover-options-max-age`],source:f(t[`source-params-web-crawler-discover-options-source`],`source-params-web-crawler-discover-options-source`,`text`)},parse_options:{include_images:t[`source-params-web-crawler-parse-options-include-images`],specific_sitemaps:t[`source-params-web-crawler-parse-options-specific-sitemaps`],use_browser_rendering:t[`source-params-web-crawler-parse-options-use-browser-rendering`]},parse_type:f(t[`source-params-web-crawler-parse-type`],`source-params-web-crawler-parse-type`,`text`)}},token_id:f(t[`token-id`],`token-id`,`text`),type:f(t.type,`type`,`text`),id:t.id}),h=await s(`Creating`,async()=>c.aiSearch.create({...m,account_id:p,name:t.name}));a(h,{successLabel:`Created`})})};function S(e){return e.usage(`$0 ai-search delete <id>
7
-
8
- Permanently delete an AI Search instance and all its indexed data.`).positional(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`delete <id>`,describe:`Delete an AI Search instance.`,builder:S,handler:async t=>c({command:`ai-search delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}`,pathParams:{id:String(t.id??``),name:String(t.name??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force,message:`This operation permanently deletes the AI Search instance and all its indexed data.`})){process.stderr.write(`Aborted.
9
- `);return}let u=await s(`Deleting`,async()=>c.aiSearch.delete({account_id:l,name:t.name,id:t.id}));a(u,{successLabel:`Deleted`})})};function w(e){return e.usage(`$0 ai-search get <id>
10
-
11
- Retrieve the configuration and status of an AI Search instance.`).positional(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <id>`,describe:`Get an AI Search instance.`,builder:w,handler:async t=>c({command:`ai-search get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}`,pathParams:{id:String(t.id??``),name:String(t.name??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.aiSearch.get({account_id:l,name:t.name,id:t.id}));a(u,{successLabel:`Loaded`})})};function E(e){return e.usage(`$0 ai-search items chunks <item-id>
12
-
13
- Lists chunks for a specific item in an AI Search instance, including their text content.`).positional(`item-id`,{type:`string`,description:`Indexed item ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limit`}).option(`offset`,{type:`number`,description:`Offset`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`chunks <item-id>`,describe:`List Item Chunks.`,builder:E,handler:async t=>c({command:`ai-search items chunks`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={limit:t.limit,offset:t.offset};if(t.dryRun){let e=await r();o({command:`cf ai-search items chunks`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/items/${t[`item-id`]==null?`<item-id>`:encodeURIComponent(String(t[`item-id`]))}/chunks`,pathParams:{id:String(t.id??``),"item-id":String(t[`item-id`]??``),name:String(t.name??``)},query:c,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await i();t.accountId=u;let d=await s(`Loading`,async()=>l.aiSearch.items.chunks({account_id:u,name:t.name,id:t.id,item_id:t[`item-id`],...c}));a(d,{successLabel:`Loaded`})})};function O(e){return e.usage(`$0 ai-search items delete <item-id>
14
-
15
- Deletes a file from a managed AI Search instance and removes its indexed data.`).positional(`item-id`,{type:`string`,description:`Indexed item ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const k={command:`delete <item-id>`,describe:`Delete Item.`,builder:O,handler:async t=>c({command:`ai-search items delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search items delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/items/${t[`item-id`]==null?`<item-id>`:encodeURIComponent(String(t[`item-id`]))}`,pathParams:{id:String(t.id??``),"item-id":String(t[`item-id`]??``),name:String(t.name??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
16
- `);return}let u=await s(`Deleting`,async()=>c.aiSearch.items.delete({account_id:l,name:t.name,id:t.id,item_id:t[`item-id`]}));a(u,{successLabel:`Deleted`})})};function A(e){return e.usage(`$0 ai-search items download <item-id>
17
-
18
- Downloads the raw file content for a specific item from the managed AI Search instance storage.`).positional(`item-id`,{type:`string`,description:`Indexed item ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const j={command:`download <item-id>`,describe:`Download Item Content.`,builder:A,handler:async t=>c({command:`ai-search items download`,classification:{safeFlags:[`dry-run`,`text`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search items download`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/items/${t[`item-id`]==null?`<item-id>`:encodeURIComponent(String(t[`item-id`]))}/download`,pathParams:{id:String(t.id??``),"item-id":String(t[`item-id`]??``),name:String(t.name??``)},bodyKind:`none`});return}await n(t);let a=t.local?e:await i();t.accountId=a;let c=await s(`Loading`,async()=>te(`/accounts/${a}/ai-search/namespaces/${encodeURIComponent(String(t.name))}/instances/${encodeURIComponent(String(t.id))}/items/${encodeURIComponent(String(t[`item-id`]))}/download`,{method:`GET`,local:t.local===!0,persistTo:t.persistTo}));ee(t.text===!0?c.toString(`utf-8`):c)})};function M(e){return e.usage(`$0 ai-search items get <item-id>
19
-
20
- Retrieves a specific indexed item from an AI Search instance.`).positional(`item-id`,{type:`string`,description:`Indexed item ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`get <item-id>`,describe:`Get Item.`,builder:M,handler:async t=>c({command:`ai-search items get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search items get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/items/${t[`item-id`]==null?`<item-id>`:encodeURIComponent(String(t[`item-id`]))}`,pathParams:{id:String(t.id??``),"item-id":String(t[`item-id`]??``),name:String(t.name??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.aiSearch.items.get({account_id:l,name:t.name,id:t.id,item_id:t[`item-id`]}));a(u,{successLabel:`Loaded`})})};function P(e){return e.usage(`$0 ai-search items list
21
-
22
- Lists indexed items in an AI Search instance.`).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`search`,{type:`string`,description:`Search`}).option(`sort-by`,{type:`string`,description:`Sort order for items. "status" (default) sorts by status priority then last_seen_at. "modified_at" sorts by file modification time (most recent first), falling back to created_at.`,choices:[`status`,`modified_at`]}).option(`status`,{type:`string`,description:`Status`,choices:[`queued`,`running`,`completed`,`error`,`skipped`,`outdated`]}).option(`source`,{type:`string`,description:`Filter items by source_id. Use "builtin" for uploaded files, or a source identifier like "web-crawler:https://example.com".`}).option(`metadata-filter`,{type:`string`,description:`JSON-encoded metadata filter using Vectorize filter syntax. Examples: {"folder":"reports/"}, {"timestamp":{"$gte":1700000000000}}, {"folder":{"$in":["docs/","reports/"]}}`}).option(`item-id`,{type:`string`,description:`Filter items by their unique ID. Returns at most one item.`}).option(`key`,{type:`string`,description:"Filter items by their exact key (object key / filename). Keys are unique per source, so combine with `source` to disambiguate across data sources."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`list`,describe:`Items List.`,builder:_(P),handler:async t=>c({command:`ai-search items list`,classification:{safeFlags:[`sort-by`,`status`,`dry-run`]}},t,async()=>{let c={page:t.page,per_page:t[`per-page`],search:t.search,sort_by:t[`sort-by`],status:t.status,source:t.source,metadata_filter:t[`metadata-filter`],item_id:t[`item-id`],key:t.key};if(t.dryRun){let e=await r();o({command:`cf ai-search items list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/items`,pathParams:{id:String(t.id??``),name:String(t.name??``)},query:c,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await i();t.accountId=u;let d=await s(`Loading`,async()=>l.aiSearch.items.list({account_id:u,name:t.name,id:t.id,...c}));a(d,{successLabel:`Loaded`})})};function I(e){return e.usage(`$0 ai-search items logs <item-id>
23
-
24
- Lists processing logs for a specific item in an AI Search instance.`).positional(`item-id`,{type:`string`,description:`Indexed item ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`logs <item-id>`,describe:`Item Logs.`,builder:I,handler:async t=>c({command:`ai-search items logs`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={limit:t.limit,cursor:t.cursor};if(t.dryRun){let e=await r();o({command:`cf ai-search items logs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/items/${t[`item-id`]==null?`<item-id>`:encodeURIComponent(String(t[`item-id`]))}/logs`,pathParams:{id:String(t.id??``),"item-id":String(t[`item-id`]??``),name:String(t.name??``)},query:c,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await i();t.accountId=u;let d=await s(`Loading`,async()=>l.aiSearch.items.logs({account_id:u,name:t.name,id:t.id,item_id:t[`item-id`],...c}));a(d,{successLabel:`Loaded`})})};function R(e){return e.usage(`$0 ai-search items sync <item-id>
25
-
26
- Syncs an item to an AI Search instance index.`).positional(`item-id`,{type:`string`,description:`Indexed item ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`next-action`,{type:`string`,description:`The next_action field`,choices:[`INDEX`]}).option(`wait-for-completion`,{type:`boolean`,description:"Wait for indexing to fully complete before responding. On RAGs with vector indexing enabled, this additionally waits for Vectorize ingestion confirmation (up to 40s) so the returned item reflects a queryable state. On timeout the item is returned in `running` state and the background alarm continues polling. Defaults to false."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const z={command:`sync <item-id>`,describe:`Sync Item.`,builder:R,handler:async t=>c({command:`ai-search items sync`,classification:{safeFlags:[`next-action`,`wait-for-completion`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search items sync`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/items/${t[`item-id`]==null?`<item-id>`:encodeURIComponent(String(t[`item-id`]))}`,pathParams:{id:String(t.id??``),"item-id":String(t[`item-id`]??``),name:String(t.name??``)},bodyKind:`json`,body:t.body===void 0?d({next_action:f(t[`next-action`],`next-action`,`text`),wait_for_completion:t[`wait-for-completion`]}):l(t.body)});return}let c=await n(t),u=t.local?e:await i();if(t.accountId=u,t.body){let e=l(t.body),n=await s(`Updating`,async()=>c.aiSearch.items.sync({...e,account_id:u,name:t.name,id:t.id,item_id:t[`item-id`]}));a(n,{successLabel:`Updated`});return}t[`next-action`]===void 0&&(t[`next-action`]=await h(`next-action`,`The next_action field`,[`INDEX`]));let p=d({next_action:f(t[`next-action`],`next-action`,`text`),wait_for_completion:t[`wait-for-completion`]}),m=await s(`Updating`,async()=>c.aiSearch.items.sync({...p,account_id:u,name:t.name,id:t.id,item_id:t[`item-id`]}));a(m,{successLabel:`Updated`})})};function B(e){return e.usage(`$0 ai-search items upload <id>
27
-
28
- Uploads a file to a managed AI Search instance via multipart/form-data.`).positional(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`metadata`,{type:`string`,description:`JSON string of custom metadata key-value pairs.`}).option(`wait-for-completion`,{type:`boolean`,description:"Wait for indexing to fully complete before responding. On RAGs with vector indexing enabled, this additionally waits for Vectorize ingestion confirmation (up to 40s) so the returned item reflects a queryable state. On timeout the item is returned in `running` state and the background alarm continues polling. Defaults to false."})}const V={command:`upload <id>`,describe:`Upload Item.`,builder:B,handler:async l=>c({command:`ai-search items upload`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=await r();o({command:`cf ai-search items upload`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${l.name==null?`<name>`:encodeURIComponent(String(l.name))}/instances/${l.id==null?`<id>`:encodeURIComponent(String(l.id))}/items`,pathParams:{id:String(l.id??``),name:String(l.name??``)},bodyKind:`multipart`,body:{body:l.body,file:l.file,metadata:l.metadata,"wait-for-completion":l[`wait-for-completion`]}});return}let c=await n(l),u=l.local?e:await i();if(l.accountId=u,l.file!==void 0||l.body!==void 0||l.metadata!==void 0||l[`wait-for-completion`]!==void 0){let e=new FormData;if(l.file){let t=p(l.file);e.append(`file`,new Blob([t]),l.file.split(/[\\/]/).filter(Boolean).pop())}else l.body!==void 0&&e.append(`file`,l.body);l.metadata!==void 0&&e.append(`metadata`,String(f(l.metadata,`metadata`,`text`)??``)),l[`wait-for-completion`]!==void 0&&e.append(`wait_for_completion`,String(l[`wait-for-completion`]));let n=await s(`Creating`,async()=>t(c,`POST`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(l.name))}/instances/${encodeURIComponent(String(l.id))}/items`,{body:e}));a(n,{successLabel:`Created`});return}if(l.body){let e=f(l.body,`body`,`binary`),n=await s(`Creating`,async()=>t(c,`POST`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(l.name))}/instances/${encodeURIComponent(String(l.id))}/items`,{body:e,headers:{"Content-Type":`multipart/form-data`}}));a(n,{successLabel:`Created`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function H(e){return e.usage(`$0 ai-search items upsert <id>
29
-
30
- Creates or updates an indexed item in an AI Search instance.`).positional(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`key`,{type:`string`,description:`Item key / filename. Must not exceed 128 characters.`}).option(`next-action`,{type:`string`,description:`The next_action field`,choices:[`INDEX`]}).option(`wait-for-completion`,{type:`boolean`,description:"Wait for indexing to fully complete before responding. On RAGs with vector indexing enabled, this additionally waits for Vectorize ingestion confirmation (up to 40s) so the returned item reflects a queryable state. On timeout the item is returned in `running` state and the background alarm continues polling. Defaults to false."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const U={command:`upsert <id>`,describe:`Create or Update Item.`,builder:H,handler:async t=>c({command:`ai-search items upsert`,classification:{safeFlags:[`next-action`,`wait-for-completion`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search items upsert`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/items`,pathParams:{id:String(t.id??``),name:String(t.name??``)},bodyKind:`json`,body:t.body===void 0?d({key:f(t.key,`key`,`text`),next_action:f(t[`next-action`],`next-action`,`text`),wait_for_completion:t[`wait-for-completion`]}):l(t.body)});return}let c=await n(t),u=t.local?e:await i();if(t.accountId=u,t.body){let e=l(t.body),n=await s(`Updating`,async()=>c.aiSearch.items.upsert({...e,account_id:u,name:t.name,id:t.id}));a(n,{successLabel:`Updated`});return}t.key===void 0&&(t.key=await m(`key`,`Item key / filename. Must not exceed 128 characters.`)),t[`next-action`]===void 0&&(t[`next-action`]=await h(`next-action`,`The next_action field`,[`INDEX`]));let p=d({key:f(t.key,`key`,`text`),next_action:f(t[`next-action`],`next-action`,`text`),wait_for_completion:t[`wait-for-completion`]}),g=await s(`Updating`,async()=>c.aiSearch.items.upsert({...p,account_id:u,name:t.name,id:t.id}));a(g,{successLabel:`Updated`})})},W={command:`items`,describe:`Content indexed by AI Search instances`,builder:e=>e.command(D).command(k).command(j).command(N).command(F).command(L).command(z).command(V).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.usage(`$0 ai-search jobs cancel <job-id>
31
-
32
- Cancel an in-progress indexing job for an AI Search instance.`).positional(`job-id`,{type:`string`,description:`Indexing job ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`action`,{type:`string`,description:`The action field`,choices:[`cancel`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`cancel <job-id>`,describe:`Cancel an indexing job.`,builder:G,handler:async t=>c({command:`ai-search jobs cancel`,classification:{safeFlags:[`action`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search jobs cancel`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/jobs/${t[`job-id`]==null?`<job-id>`:encodeURIComponent(String(t[`job-id`]))}`,pathParams:{id:String(t.id??``),"job-id":String(t[`job-id`]??``),name:String(t.name??``)},bodyKind:`json`,body:t.body===void 0?d({action:f(t.action,`action`,`text`)}):l(t.body)});return}let c=await n(t),u=t.local?e:await i();if(t.accountId=u,!await g({force:!!t.force,message:`This operation cancels the running indexing job.`})){process.stderr.write(`Aborted.
33
- `);return}if(t.body){let e=l(t.body),n=await s(`Deleting`,async()=>c.aiSearch.jobs.cancel({...e,account_id:u,name:t.name,id:t.id,job_id:t[`job-id`]}));a(n,{successLabel:`Deleted`});return}t.action===void 0&&(t.action=await h(`action`,`The action field`,[`cancel`]));let p=d({action:f(t.action,`action`,`text`)}),m=await s(`Deleting`,async()=>c.aiSearch.jobs.cancel({...p,account_id:u,name:t.name,id:t.id,job_id:t[`job-id`]}));a(m,{successLabel:`Deleted`})})};function q(e){return e.usage(`$0 ai-search jobs create <id>
34
-
35
- Creates a new indexing job for an AI Search instance.`).positional(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const J={command:`create <id>`,describe:`Create new job`,builder:q,handler:async t=>c({command:`ai-search jobs create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/jobs`,pathParams:{id:String(t.id??``),name:String(t.name??``)},bodyKind:`json`,body:t.body===void 0?d({description:f(t.description,`description`,`text`)}):l(t.body)});return}let c=await n(t),u=t.local?e:await i();if(t.accountId=u,t.body){let e=l(t.body),n=await s(`Creating`,async()=>c.aiSearch.jobs.create({...e,account_id:u,name:t.name,id:t.id}));a(n,{successLabel:`Created`});return}let p=d({description:f(t.description,`description`,`text`)}),m=await s(`Creating`,async()=>c.aiSearch.jobs.create({...p,account_id:u,name:t.name,id:t.id}));a(m,{successLabel:`Created`})})};function Y(e){return e.usage(`$0 ai-search jobs get <job-id>
36
-
37
- Retrieves details for a specific AI Search indexing job.`).positional(`job-id`,{type:`string`,description:`Indexing job ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`get <job-id>`,describe:`Get a Job Details`,builder:Y,handler:async t=>c({command:`ai-search jobs get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/jobs/${t[`job-id`]==null?`<job-id>`:encodeURIComponent(String(t[`job-id`]))}`,pathParams:{id:String(t.id??``),"job-id":String(t[`job-id`]??``),name:String(t.name??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.aiSearch.jobs.get({account_id:l,name:t.name,id:t.id,job_id:t[`job-id`]}));a(u,{successLabel:`Loaded`})})};function Z(e){return e.usage(`$0 ai-search jobs list
38
-
39
- Lists indexing jobs for an AI Search instance.`).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`list`,describe:`List Jobs`,builder:Z,handler:async t=>c({command:`ai-search jobs list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=await r();o({command:`cf ai-search jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/jobs`,pathParams:{id:String(t.id??``),name:String(t.name??``)},query:c,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await i();t.accountId=u;let d=await s(`Loading`,async()=>l.aiSearch.jobs.list({account_id:u,name:t.name,id:t.id,...c}));a(d,{successLabel:`Loaded`})})};function ne(e){return e.usage(`$0 ai-search jobs logs <job-id>
40
-
41
- Lists log entries for an AI Search indexing job.`).positional(`job-id`,{type:`string`,description:`Indexing job ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`logs <job-id>`,describe:`List Job Logs`,builder:ne,handler:async t=>c({command:`ai-search jobs logs`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=await r();o({command:`cf ai-search jobs logs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/jobs/${t[`job-id`]==null?`<job-id>`:encodeURIComponent(String(t[`job-id`]))}/logs`,pathParams:{id:String(t.id??``),"job-id":String(t[`job-id`]??``),name:String(t.name??``)},query:c,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await i();t.accountId=u;let d=await s(`Loading`,async()=>l.aiSearch.jobs.logs({account_id:u,name:t.name,id:t.id,job_id:t[`job-id`],...c}));a(d,{successLabel:`Loaded`})})},ie={command:`jobs`,describe:`Indexing job lifecycle for AI Search instances`,builder:e=>e.command(K).command(J).command(X).command(Q).command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.usage(`$0 ai-search list
42
-
43
- List all AI Search instances in the account.`).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number (1-indexed).`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`search`,{type:`string`,description:`Filter instances whose id contains this string (case-insensitive).`}).option(`hostname`,{type:`string`,description:`Filter by exact Search for Agents hostname (case-insensitive).`}).option(`order-by`,{type:`string`,description:`Field to order results by.`,choices:[`created_at`]}).option(`order-by-direction`,{type:`string`,description:`Order direction.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`List AI Search instances.`,builder:_(ae),handler:async t=>c({command:`ai-search list`,classification:{safeFlags:[`order-by`,`order-by-direction`,`dry-run`]}},t,async()=>{let c={page:t.page,per_page:t[`per-page`],search:t.search,hostname:t.hostname,order_by:t[`order-by`],order_by_direction:t[`order-by-direction`]};if(t.dryRun){let e=await r();o({command:`cf ai-search list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances`,pathParams:{name:String(t.name??``)},query:c,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await i();t.accountId=u;let d=await s(`Loading`,async()=>l.aiSearch.list({account_id:u,name:t.name,...c}));a(d,{successLabel:`Loaded`})})};function se(e){return e.usage(`$0 ai-search move <id>
44
-
45
- Moves an instance from its current namespace to the specified target namespace. Use 'default' with --destination-namespace to move the instance back to the default namespace. Fails with 400 if the target namespace already has an instance with the same id (ids must be unique within a namespace — the same id can exist in different namespaces). Search for Agents instances cannot move to another namespace.`).positional(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`Namespace currently containing the instance.`,demandOption:!0}).option(`new-namespace`,{type:`string`,description:`Target namespace to move the instance into.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ce={command:`move <id>`,describe:`Move an instance to a different namespace.`,builder:se,handler:async t=>c({command:`ai-search move`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search move`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}`,pathParams:{name:String(t.name??``),id:String(t.id??``)},bodyKind:`json`,body:t.body===void 0?d({new_namespace:f(t[`new-namespace`],`new-namespace`,`text`)}):l(t.body)});return}let c=await n(t),u=t.local?e:await i();if(t.accountId=u,t.body){let e=l(t.body),n=await s(`Updating`,async()=>c.aiSearch.move({...e,account_id:u,name:t.name,id:t.id}));a(n,{successLabel:`Updated`});return}t[`new-namespace`]===void 0&&(t[`new-namespace`]=await m(`new-namespace`,`Target namespace to move the instance into.`));let p=d({new_namespace:f(t[`new-namespace`],`new-namespace`,`text`)}),h=await s(`Updating`,async()=>c.aiSearch.move({...p,account_id:u,name:t.name,id:t.id}));a(h,{successLabel:`Updated`})})};function le(e){return e.usage(`$0 ai-search multi-chat-completions <name>
46
-
47
- Performs a chat completion request against multiple AI Search instances in parallel, merging retrieved content as context for generating a response.`).positional(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`ai-search-options-cache-cache-threshold`,{type:`string`,description:`The ai_search_options.cache.cache_threshold field`,choices:[`super_strict_match`,`close_enough`,`flexible_friend`,`anything_goes`]}).option(`ai-search-options-cache-enabled`,{type:`boolean`,description:`The ai_search_options.cache.enabled field`}).option(`ai-search-options-instance-ids`,{type:`string`,array:!0,description:`The ai_search_options.instance_ids field`}).option(`ai-search-options-query-rewrite-enabled`,{type:`boolean`,description:`The ai_search_options.query_rewrite.enabled field`}).option(`ai-search-options-query-rewrite-model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`ai-search-options-query-rewrite-rewrite-prompt`,{type:`string`,description:`The ai_search_options.query_rewrite.rewrite_prompt field`}).option(`ai-search-options-reranking-enabled`,{type:`boolean`,description:`The ai_search_options.reranking.enabled field`}).option(`ai-search-options-reranking-match-threshold`,{type:`number`,description:`The ai_search_options.reranking.match_threshold field`,default:.4}).option(`ai-search-options-reranking-model`,{type:`string`,description:`The ai_search_options.reranking.model field`}).option(`ai-search-options-retrieval-context-expansion`,{type:`number`,description:`The ai_search_options.retrieval.context_expansion field`,default:0}).option(`ai-search-options-retrieval-fusion-method`,{type:`string`,description:`The ai_search_options.retrieval.fusion_method field`,choices:[`max`,`rrf`]}).option(`ai-search-options-retrieval-keyword-match-mode`,{type:`string`,description:`Controls which documents are candidates for BM25 scoring. 'and' restricts candidates to documents containing all query terms; 'or' includes any document containing at least one term, ranked by BM25 relevance. When omitted, falls back to the instance-level retrieval_options.keyword_match_mode, then to 'and'.`,choices:[`and`,`or`]}).option(`ai-search-options-retrieval-match-threshold`,{type:`number`,description:`The ai_search_options.retrieval.match_threshold field`,default:.4}).option(`ai-search-options-retrieval-max-num-results`,{type:`number`,description:`The ai_search_options.retrieval.max_num_results field`,default:10}).option(`ai-search-options-retrieval-retrieval-type`,{type:`string`,description:`The ai_search_options.retrieval.retrieval_type field`,choices:[`vector`,`keyword`,`hybrid`]}).option(`ai-search-options-retrieval-return-on-failure`,{type:`boolean`,description:`The ai_search_options.retrieval.return_on_failure field`,default:!0}).option(`messages`,{type:`string`,description:`The messages field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`stream`,{type:`boolean`,description:`The stream field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ue={command:`multi-chat-completions <name>`,describe:`Multi-Instance Chat Completions`,builder:le,handler:async t=>c({command:`ai-search multi-chat-completions`,classification:{safeFlags:[`ai-search-options-cache-cache-threshold`,`ai-search-options-cache-enabled`,`ai-search-options-query-rewrite-enabled`,`ai-search-options-reranking-enabled`,`ai-search-options-retrieval-fusion-method`,`ai-search-options-retrieval-keyword-match-mode`,`ai-search-options-retrieval-retrieval-type`,`ai-search-options-retrieval-return-on-failure`,`stream`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search multi-chat-completions`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/chat/completions`,pathParams:{name:String(t.name??``)},bodyKind:`json`,body:t.body===void 0?d({ai_search_options:{cache:{cache_threshold:f(t[`ai-search-options-cache-cache-threshold`],`ai-search-options-cache-cache-threshold`,`text`),enabled:t[`ai-search-options-cache-enabled`]},instance_ids:t[`ai-search-options-instance-ids`],query_rewrite:{enabled:t[`ai-search-options-query-rewrite-enabled`],model:f(t[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`),rewrite_prompt:f(t[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)},reranking:{enabled:t[`ai-search-options-reranking-enabled`],match_threshold:t[`ai-search-options-reranking-match-threshold`],model:f(t[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)},retrieval:{context_expansion:t[`ai-search-options-retrieval-context-expansion`],fusion_method:f(t[`ai-search-options-retrieval-fusion-method`],`ai-search-options-retrieval-fusion-method`,`text`),keyword_match_mode:f(t[`ai-search-options-retrieval-keyword-match-mode`],`ai-search-options-retrieval-keyword-match-mode`,`text`),match_threshold:t[`ai-search-options-retrieval-match-threshold`],max_num_results:t[`ai-search-options-retrieval-max-num-results`],retrieval_type:f(t[`ai-search-options-retrieval-retrieval-type`],`ai-search-options-retrieval-retrieval-type`,`text`),return_on_failure:t[`ai-search-options-retrieval-return-on-failure`]}},messages:u(t.messages,`messages`),model:f(t.model,`model`,`text`),stream:t.stream}):l(t.body)});return}let c=await n(t),p=t.local?e:await i();if(t.accountId=p,t.body){let e=l(t.body),n=await s(`Creating`,async()=>c.aiSearch.multiChatCompletions({...e,account_id:p,name:t.name}));a(n,{successLabel:`Created`});return}if(t[`ai-search-options-instance-ids`]===void 0)throw Error(`--ai-search-options-instance-ids is required (or pass --body with this field set).`);if(t.messages===void 0)throw Error(`--messages is required (or pass --body with this field set).`);let m=d({ai_search_options:{cache:{cache_threshold:f(t[`ai-search-options-cache-cache-threshold`],`ai-search-options-cache-cache-threshold`,`text`),enabled:t[`ai-search-options-cache-enabled`]},instance_ids:t[`ai-search-options-instance-ids`],query_rewrite:{enabled:t[`ai-search-options-query-rewrite-enabled`],model:f(t[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`),rewrite_prompt:f(t[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)},reranking:{enabled:t[`ai-search-options-reranking-enabled`],match_threshold:t[`ai-search-options-reranking-match-threshold`],model:f(t[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)},retrieval:{context_expansion:t[`ai-search-options-retrieval-context-expansion`],fusion_method:f(t[`ai-search-options-retrieval-fusion-method`],`ai-search-options-retrieval-fusion-method`,`text`),keyword_match_mode:f(t[`ai-search-options-retrieval-keyword-match-mode`],`ai-search-options-retrieval-keyword-match-mode`,`text`),match_threshold:t[`ai-search-options-retrieval-match-threshold`],max_num_results:t[`ai-search-options-retrieval-max-num-results`],retrieval_type:f(t[`ai-search-options-retrieval-retrieval-type`],`ai-search-options-retrieval-retrieval-type`,`text`),return_on_failure:t[`ai-search-options-retrieval-return-on-failure`]}},messages:u(t.messages,`messages`),model:f(t.model,`model`,`text`),stream:t.stream}),h=await s(`Creating`,async()=>c.aiSearch.multiChatCompletions({...m,account_id:p,name:t.name}));a(h,{successLabel:`Created`})})};function de(e){return e.usage(`$0 ai-search multi-search <name> <query>
48
-
49
- Performs a semantic search query against multiple AI Search instances in parallel, merging the retrieved results into a single ranked response.`).positional(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).positional(`query`,{type:`string`,description:`Text to search for.`}).option(`ai-search-options-cache-cache-threshold`,{type:`string`,description:`The ai_search_options.cache.cache_threshold field`,choices:[`super_strict_match`,`close_enough`,`flexible_friend`,`anything_goes`]}).option(`ai-search-options-cache-enabled`,{type:`boolean`,description:`The ai_search_options.cache.enabled field`}).option(`ai-search-options-instance-ids`,{type:`string`,array:!0,description:`The ai_search_options.instance_ids field`}).option(`ai-search-options-query-rewrite-enabled`,{type:`boolean`,description:`The ai_search_options.query_rewrite.enabled field`}).option(`ai-search-options-query-rewrite-model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`ai-search-options-query-rewrite-rewrite-prompt`,{type:`string`,description:`The ai_search_options.query_rewrite.rewrite_prompt field`}).option(`ai-search-options-reranking-enabled`,{type:`boolean`,description:`The ai_search_options.reranking.enabled field`}).option(`ai-search-options-reranking-match-threshold`,{type:`number`,description:`The ai_search_options.reranking.match_threshold field`,default:.4}).option(`ai-search-options-reranking-model`,{type:`string`,description:`The ai_search_options.reranking.model field`}).option(`ai-search-options-retrieval-context-expansion`,{type:`number`,description:`The ai_search_options.retrieval.context_expansion field`,default:0}).option(`ai-search-options-retrieval-fusion-method`,{type:`string`,description:`The ai_search_options.retrieval.fusion_method field`,choices:[`max`,`rrf`]}).option(`ai-search-options-retrieval-keyword-match-mode`,{type:`string`,description:`Controls which documents are candidates for BM25 scoring. 'and' restricts candidates to documents containing all query terms; 'or' includes any document containing at least one term, ranked by BM25 relevance. When omitted, falls back to the instance-level retrieval_options.keyword_match_mode, then to 'and'.`,choices:[`and`,`or`]}).option(`ai-search-options-retrieval-match-threshold`,{type:`number`,description:`The ai_search_options.retrieval.match_threshold field`,default:.4}).option(`ai-search-options-retrieval-max-num-results`,{type:`number`,description:`The ai_search_options.retrieval.max_num_results field`,default:10}).option(`ai-search-options-retrieval-retrieval-type`,{type:`string`,description:`The ai_search_options.retrieval.retrieval_type field`,choices:[`vector`,`keyword`,`hybrid`]}).option(`ai-search-options-retrieval-return-on-failure`,{type:`boolean`,description:`The ai_search_options.retrieval.return_on_failure field`,default:!0}).option(`messages`,{type:`string`,description:"OpenAI-compatible message array. For multimodal queries, set the last user message's `content` to an array of typed parts: `[{type:'text', text:'…'}, {type:'image_url', image_url:{url:'…'}}]`. Image inputs require the RAG's embedding_model to declare 'image' in supported_modalities. Provide as a JSON array of objects or @path/to/file.json."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const fe={command:`multi-search <name> <query>`,describe:`Multi-Instance Search`,builder:de,handler:async t=>c({command:`ai-search multi-search`,classification:{safeFlags:[`ai-search-options-cache-cache-threshold`,`ai-search-options-cache-enabled`,`ai-search-options-query-rewrite-enabled`,`ai-search-options-reranking-enabled`,`ai-search-options-retrieval-fusion-method`,`ai-search-options-retrieval-keyword-match-mode`,`ai-search-options-retrieval-retrieval-type`,`ai-search-options-retrieval-return-on-failure`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search multi-search`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/search`,pathParams:{name:String(t.name??``)},bodyKind:`json`,body:t.body===void 0?d({ai_search_options:{cache:{cache_threshold:f(t[`ai-search-options-cache-cache-threshold`],`ai-search-options-cache-cache-threshold`,`text`),enabled:t[`ai-search-options-cache-enabled`]},instance_ids:t[`ai-search-options-instance-ids`],query_rewrite:{enabled:t[`ai-search-options-query-rewrite-enabled`],model:f(t[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`),rewrite_prompt:f(t[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)},reranking:{enabled:t[`ai-search-options-reranking-enabled`],match_threshold:t[`ai-search-options-reranking-match-threshold`],model:f(t[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)},retrieval:{context_expansion:t[`ai-search-options-retrieval-context-expansion`],fusion_method:f(t[`ai-search-options-retrieval-fusion-method`],`ai-search-options-retrieval-fusion-method`,`text`),keyword_match_mode:f(t[`ai-search-options-retrieval-keyword-match-mode`],`ai-search-options-retrieval-keyword-match-mode`,`text`),match_threshold:t[`ai-search-options-retrieval-match-threshold`],max_num_results:t[`ai-search-options-retrieval-max-num-results`],retrieval_type:f(t[`ai-search-options-retrieval-retrieval-type`],`ai-search-options-retrieval-retrieval-type`,`text`),return_on_failure:t[`ai-search-options-retrieval-return-on-failure`]}},messages:u(t.messages,`messages`),query:t.query}):l(t.body)});return}let c=await n(t),p=t.local?e:await i();if(t.accountId=p,t.body){let e=l(t.body),n=await s(`Creating`,async()=>c.aiSearch.multiSearch({...e,account_id:p,name:t.name}));a(n,{successLabel:`Created`});return}if(t[`ai-search-options-instance-ids`]===void 0)throw Error(`--ai-search-options-instance-ids is required (or pass --body with this field set).`);let m=d({ai_search_options:{cache:{cache_threshold:f(t[`ai-search-options-cache-cache-threshold`],`ai-search-options-cache-cache-threshold`,`text`),enabled:t[`ai-search-options-cache-enabled`]},instance_ids:t[`ai-search-options-instance-ids`],query_rewrite:{enabled:t[`ai-search-options-query-rewrite-enabled`],model:f(t[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`),rewrite_prompt:f(t[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)},reranking:{enabled:t[`ai-search-options-reranking-enabled`],match_threshold:t[`ai-search-options-reranking-match-threshold`],model:f(t[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)},retrieval:{context_expansion:t[`ai-search-options-retrieval-context-expansion`],fusion_method:f(t[`ai-search-options-retrieval-fusion-method`],`ai-search-options-retrieval-fusion-method`,`text`),keyword_match_mode:f(t[`ai-search-options-retrieval-keyword-match-mode`],`ai-search-options-retrieval-keyword-match-mode`,`text`),match_threshold:t[`ai-search-options-retrieval-match-threshold`],max_num_results:t[`ai-search-options-retrieval-max-num-results`],retrieval_type:f(t[`ai-search-options-retrieval-retrieval-type`],`ai-search-options-retrieval-retrieval-type`,`text`),return_on_failure:t[`ai-search-options-retrieval-return-on-failure`]}},messages:u(t.messages,`messages`),query:t.query}),h=await s(`Creating`,async()=>c.aiSearch.multiSearch({...m,account_id:p,name:t.name}));a(h,{successLabel:`Created`})})};function pe(e){return e.usage(`$0 ai-search namespace create <name>
50
-
51
- Create a namespace for organizing AI Search instances.`).positional(`name`,{type:`string`,description:`Name for the new namespace.`,demandOption:!0}).option(`description`,{type:`string`,description:`Optional description for the namespace. Max 256 characters.`}).option(`public-endpoint-params-authorized-hosts`,{type:`string`,array:!0,description:`The public_endpoint_params.authorized_hosts field`}).option(`public-endpoint-params-chat-completions-endpoint-disabled`,{type:`boolean`,description:`Disable chat completions endpoint for this public endpoint`}).option(`public-endpoint-params-custom-domains`,{type:`string`,array:!0,description:`Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).`}).option(`public-endpoint-params-default-domain-enabled`,{type:`boolean`,description:`When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public_endpoint_params is replaced wholesale on update, so resend default_domain_enabled on every update to keep the default host off — omitting it resets to true.`}).option(`public-endpoint-params-enabled`,{type:`boolean`,description:`The public_endpoint_params.enabled field`}).option(`public-endpoint-params-instances-allowed`,{type:`string`,array:!0,description:`Instance IDs exposed through the namespace public endpoint. Empty means nothing is searchable. Every ID must be an existing instance in this namespace, and the list cannot exceed the account's multi-instance search limit.`}).option(`public-endpoint-params-mcp-description`,{type:`string`,description:`The public_endpoint_params.mcp.description field`}).option(`public-endpoint-params-mcp-disabled`,{type:`boolean`,description:`Disable MCP endpoint for this public endpoint`}).option(`public-endpoint-params-rate-limit-period-ms`,{type:`number`,description:`The public_endpoint_params.rate_limit.period_ms field`}).option(`public-endpoint-params-rate-limit-requests`,{type:`number`,description:`The public_endpoint_params.rate_limit.requests field`}).option(`public-endpoint-params-rate-limit-technique`,{type:`string`,description:`The public_endpoint_params.rate_limit.technique field`,choices:[`fixed`,`sliding`]}).option(`public-endpoint-params-search-endpoint-disabled`,{type:`boolean`,description:`Disable search endpoint for this public endpoint`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const me={command:`create <name>`,describe:`Create a namespace`,builder:pe,handler:async t=>c({command:`ai-search namespace create`,classification:{safeFlags:[`public-endpoint-params-chat-completions-endpoint-disabled`,`public-endpoint-params-default-domain-enabled`,`public-endpoint-params-enabled`,`public-endpoint-params-mcp-disabled`,`public-endpoint-params-rate-limit-technique`,`public-endpoint-params-search-endpoint-disabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search namespace create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces`,pathParams:{},bodyKind:`json`,body:t.body===void 0?d({description:f(t.description,`description`,`text`),public_endpoint_params:{authorized_hosts:t[`public-endpoint-params-authorized-hosts`],chat_completions_endpoint:{disabled:t[`public-endpoint-params-chat-completions-endpoint-disabled`]},custom_domains:t[`public-endpoint-params-custom-domains`],default_domain_enabled:t[`public-endpoint-params-default-domain-enabled`],enabled:t[`public-endpoint-params-enabled`],instances_allowed:t[`public-endpoint-params-instances-allowed`],mcp:{description:f(t[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`),disabled:t[`public-endpoint-params-mcp-disabled`]},rate_limit:{period_ms:t[`public-endpoint-params-rate-limit-period-ms`],requests:t[`public-endpoint-params-rate-limit-requests`],technique:f(t[`public-endpoint-params-rate-limit-technique`],`public-endpoint-params-rate-limit-technique`,`text`)},search_endpoint:{disabled:t[`public-endpoint-params-search-endpoint-disabled`]}},name:t.name}):l(t.body)});return}let c=await n(t),u=t.local?e:await i();if(t.accountId=u,t.body){let e=l(t.body),n=await s(`Creating`,async()=>c.aiSearch.namespace.create({...e,account_id:u}));a(n,{successLabel:`Created`});return}let p=d({description:f(t.description,`description`,`text`),public_endpoint_params:{authorized_hosts:t[`public-endpoint-params-authorized-hosts`],chat_completions_endpoint:{disabled:t[`public-endpoint-params-chat-completions-endpoint-disabled`]},custom_domains:t[`public-endpoint-params-custom-domains`],default_domain_enabled:t[`public-endpoint-params-default-domain-enabled`],enabled:t[`public-endpoint-params-enabled`],instances_allowed:t[`public-endpoint-params-instances-allowed`],mcp:{description:f(t[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`),disabled:t[`public-endpoint-params-mcp-disabled`]},rate_limit:{period_ms:t[`public-endpoint-params-rate-limit-period-ms`],requests:t[`public-endpoint-params-rate-limit-requests`],technique:f(t[`public-endpoint-params-rate-limit-technique`],`public-endpoint-params-rate-limit-technique`,`text`)},search_endpoint:{disabled:t[`public-endpoint-params-search-endpoint-disabled`]}},name:t.name}),m=await s(`Creating`,async()=>c.aiSearch.namespace.create({...p,account_id:u}));a(m,{successLabel:`Created`})})};function he(e){return e.usage(`$0 ai-search namespace delete <name>
52
-
53
- Permanently delete a namespace. The namespace must be empty (no instances), and the default namespace cannot be deleted.`).positional(`name`,{type:`string`,description:`Namespace to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ge={command:`delete <name>`,describe:`Delete a namespace`,builder:he,handler:async t=>c({command:`ai-search namespace delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search namespace delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}`,pathParams:{name:String(t.name??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force,message:`This operation permanently deletes the namespace.`})){process.stderr.write(`Aborted.
54
- `);return}let u=await s(`Deleting`,async()=>c.aiSearch.namespace.delete({account_id:l,name:t.name}));a(u,{successLabel:`Deleted`})})};function _e(e){return e.usage(`$0 ai-search namespace get <name>
55
-
56
- Retrieve a namespace and its description.`).positional(`name`,{type:`string`,description:`Namespace to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ve={command:`get <name>`,describe:`Get a namespace`,builder:_e,handler:async t=>c({command:`ai-search namespace get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search namespace get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}`,pathParams:{name:String(t.name??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.aiSearch.namespace.get({account_id:l,name:t.name}));a(u,{successLabel:`Loaded`})})};function ye(e){return e.usage(`$0 ai-search namespace list
57
-
58
- List namespaces in the account, including their descriptions and creation times.`).option(`page`,{type:`number`,description:`Page number (1-indexed).`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`search`,{type:`string`,description:`Filter namespaces whose name or description contains this string (case-insensitive).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const be={command:`list`,describe:`List namespaces`,builder:ye,handler:async t=>c({command:`ai-search namespace list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={page:t.page,per_page:t[`per-page`],search:t.search};if(t.dryRun){let e=await r();o({command:`cf ai-search namespace list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await i();t.accountId=u;let d=await s(`Loading`,async()=>l.aiSearch.namespace.list({account_id:u,...c}));a(d,{successLabel:`Loaded`})})};function xe(e){return e.usage(`$0 ai-search namespace update <name>
59
-
60
- Update the description and/or the public endpoint configuration of an existing namespace. The default namespace's description cannot be modified, but its public endpoint can.`).positional(`name`,{type:`string`,description:`Namespace to update.`,demandOption:!0}).option(`description`,{type:`string`,description:`Optional description for the namespace. Max 256 characters.`}).option(`public-endpoint-params-authorized-hosts`,{type:`string`,array:!0,description:`The public_endpoint_params.authorized_hosts field`}).option(`public-endpoint-params-chat-completions-endpoint-disabled`,{type:`boolean`,description:`Disable chat completions endpoint for this public endpoint`}).option(`public-endpoint-params-custom-domains`,{type:`string`,array:!0,description:`Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).`}).option(`public-endpoint-params-default-domain-enabled`,{type:`boolean`,description:`When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public_endpoint_params is replaced wholesale on update, so resend default_domain_enabled on every update to keep the default host off — omitting it resets to true.`}).option(`public-endpoint-params-enabled`,{type:`boolean`,description:`The public_endpoint_params.enabled field`}).option(`public-endpoint-params-instances-allowed`,{type:`string`,array:!0,description:`Instance IDs exposed through the namespace public endpoint. Empty means nothing is searchable. Every ID must be an existing instance in this namespace, and the list cannot exceed the account's multi-instance search limit.`}).option(`public-endpoint-params-mcp-description`,{type:`string`,description:`The public_endpoint_params.mcp.description field`}).option(`public-endpoint-params-mcp-disabled`,{type:`boolean`,description:`Disable MCP endpoint for this public endpoint`}).option(`public-endpoint-params-rate-limit-period-ms`,{type:`number`,description:`The public_endpoint_params.rate_limit.period_ms field`}).option(`public-endpoint-params-rate-limit-requests`,{type:`number`,description:`The public_endpoint_params.rate_limit.requests field`}).option(`public-endpoint-params-rate-limit-technique`,{type:`string`,description:`The public_endpoint_params.rate_limit.technique field`,choices:[`fixed`,`sliding`]}).option(`public-endpoint-params-search-endpoint-disabled`,{type:`boolean`,description:`Disable search endpoint for this public endpoint`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Se={command:`update <name>`,describe:`Update a namespace`,builder:xe,handler:async t=>c({command:`ai-search namespace update`,classification:{safeFlags:[`public-endpoint-params-chat-completions-endpoint-disabled`,`public-endpoint-params-default-domain-enabled`,`public-endpoint-params-enabled`,`public-endpoint-params-mcp-disabled`,`public-endpoint-params-rate-limit-technique`,`public-endpoint-params-search-endpoint-disabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search namespace update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}`,pathParams:{name:String(t.name??``)},bodyKind:`json`,body:t.body===void 0?d({description:f(t.description,`description`,`text`),public_endpoint_params:{authorized_hosts:t[`public-endpoint-params-authorized-hosts`],chat_completions_endpoint:{disabled:t[`public-endpoint-params-chat-completions-endpoint-disabled`]},custom_domains:t[`public-endpoint-params-custom-domains`],default_domain_enabled:t[`public-endpoint-params-default-domain-enabled`],enabled:t[`public-endpoint-params-enabled`],instances_allowed:t[`public-endpoint-params-instances-allowed`],mcp:{description:f(t[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`),disabled:t[`public-endpoint-params-mcp-disabled`]},rate_limit:{period_ms:t[`public-endpoint-params-rate-limit-period-ms`],requests:t[`public-endpoint-params-rate-limit-requests`],technique:f(t[`public-endpoint-params-rate-limit-technique`],`public-endpoint-params-rate-limit-technique`,`text`)},search_endpoint:{disabled:t[`public-endpoint-params-search-endpoint-disabled`]}}}):l(t.body)});return}let c=await n(t),u=t.local?e:await i();if(t.accountId=u,t.body){let e=l(t.body),n=await s(`Updating`,async()=>c.aiSearch.namespace.update({...e,account_id:u,name:t.name}));a(n,{successLabel:`Updated`});return}let p=d({description:f(t.description,`description`,`text`),public_endpoint_params:{authorized_hosts:t[`public-endpoint-params-authorized-hosts`],chat_completions_endpoint:{disabled:t[`public-endpoint-params-chat-completions-endpoint-disabled`]},custom_domains:t[`public-endpoint-params-custom-domains`],default_domain_enabled:t[`public-endpoint-params-default-domain-enabled`],enabled:t[`public-endpoint-params-enabled`],instances_allowed:t[`public-endpoint-params-instances-allowed`],mcp:{description:f(t[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`),disabled:t[`public-endpoint-params-mcp-disabled`]},rate_limit:{period_ms:t[`public-endpoint-params-rate-limit-period-ms`],requests:t[`public-endpoint-params-rate-limit-requests`],technique:f(t[`public-endpoint-params-rate-limit-technique`],`public-endpoint-params-rate-limit-technique`,`text`)},search_endpoint:{disabled:t[`public-endpoint-params-search-endpoint-disabled`]}}}),m=await s(`Updating`,async()=>c.aiSearch.namespace.update({...p,account_id:u,name:t.name}));a(m,{successLabel:`Updated`})})},Ce={command:`namespace`,describe:`Logical groupings for organizing AI Search instances`,builder:e=>e.command(me).command(ge).command(ve).command(be).command(Se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function we(e){return e.usage(`$0 ai-search purge-cache <id>
61
-
62
- Purges all cached search results for an AI Search instance. A new internal cache key is generated, immediately orphaning all prior cached entries.`).positional(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Te={command:`purge-cache <id>`,describe:`Purge search cache.`,builder:we,handler:async t=>c({command:`ai-search purge-cache`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search purge-cache`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/purge_cache`,pathParams:{id:String(t.id??``),name:String(t.name??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Creating`,async()=>c.aiSearch.purgeCache({account_id:l,name:t.name,id:t.id}));a(u,{successLabel:`Created`})})};function Ee(e){return e.usage(`$0 ai-search search <id> <query>
63
-
64
- Executes a semantic search query against an AI Search instance to find relevant indexed content.`).positional(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).positional(`query`,{type:`string`,description:`Text to search for.`}).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`ai-search-options-cache-cache-threshold`,{type:`string`,description:`The ai_search_options.cache.cache_threshold field`,choices:[`super_strict_match`,`close_enough`,`flexible_friend`,`anything_goes`]}).option(`ai-search-options-cache-enabled`,{type:`boolean`,description:`The ai_search_options.cache.enabled field`}).option(`ai-search-options-query-rewrite-enabled`,{type:`boolean`,description:`The ai_search_options.query_rewrite.enabled field`}).option(`ai-search-options-query-rewrite-model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`ai-search-options-query-rewrite-rewrite-prompt`,{type:`string`,description:`The ai_search_options.query_rewrite.rewrite_prompt field`}).option(`ai-search-options-reranking-enabled`,{type:`boolean`,description:`The ai_search_options.reranking.enabled field`}).option(`ai-search-options-reranking-match-threshold`,{type:`number`,description:`The ai_search_options.reranking.match_threshold field`}).option(`ai-search-options-reranking-model`,{type:`string`,description:`The ai_search_options.reranking.model field`}).option(`ai-search-options-retrieval-context-expansion`,{type:`number`,description:`The ai_search_options.retrieval.context_expansion field`}).option(`ai-search-options-retrieval-fusion-method`,{type:`string`,description:`The ai_search_options.retrieval.fusion_method field`,choices:[`max`,`rrf`]}).option(`ai-search-options-retrieval-keyword-match-mode`,{type:`string`,description:`Controls which documents are candidates for BM25 scoring. 'and' restricts candidates to documents containing all query terms; 'or' includes any document containing at least one term, ranked by BM25 relevance. When omitted, falls back to the instance-level retrieval_options.keyword_match_mode, then to 'and'.`,choices:[`and`,`or`]}).option(`ai-search-options-retrieval-match-threshold`,{type:`number`,description:`The ai_search_options.retrieval.match_threshold field`}).option(`ai-search-options-retrieval-max-num-results`,{type:`number`,description:`The ai_search_options.retrieval.max_num_results field`}).option(`ai-search-options-retrieval-retrieval-type`,{type:`string`,description:`The ai_search_options.retrieval.retrieval_type field`,choices:[`vector`,`keyword`,`hybrid`]}).option(`ai-search-options-retrieval-return-on-failure`,{type:`boolean`,description:`The ai_search_options.retrieval.return_on_failure field`}).option(`messages`,{type:`string`,description:"OpenAI-compatible message array. For multimodal queries, set the last user message's `content` to an array of typed parts: `[{type:'text', text:'…'}, {type:'image_url', image_url:{url:'…'}}]`. Image inputs require the RAG's embedding_model to declare 'image' in supported_modalities. Provide as a JSON array of objects or @path/to/file.json."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const De={command:`search <id> <query>`,describe:`Search`,builder:Ee,handler:async t=>c({command:`ai-search search`,classification:{safeFlags:[`ai-search-options-cache-cache-threshold`,`ai-search-options-cache-enabled`,`ai-search-options-query-rewrite-enabled`,`ai-search-options-reranking-enabled`,`ai-search-options-retrieval-fusion-method`,`ai-search-options-retrieval-keyword-match-mode`,`ai-search-options-retrieval-retrieval-type`,`ai-search-options-retrieval-return-on-failure`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search search`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/search`,pathParams:{id:String(t.id??``),name:String(t.name??``)},bodyKind:`json`,body:t.body===void 0?d({ai_search_options:{cache:{cache_threshold:f(t[`ai-search-options-cache-cache-threshold`],`ai-search-options-cache-cache-threshold`,`text`),enabled:t[`ai-search-options-cache-enabled`]},query_rewrite:{enabled:t[`ai-search-options-query-rewrite-enabled`],model:f(t[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`),rewrite_prompt:f(t[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)},reranking:{enabled:t[`ai-search-options-reranking-enabled`],match_threshold:t[`ai-search-options-reranking-match-threshold`],model:f(t[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)},retrieval:{context_expansion:t[`ai-search-options-retrieval-context-expansion`],fusion_method:f(t[`ai-search-options-retrieval-fusion-method`],`ai-search-options-retrieval-fusion-method`,`text`),keyword_match_mode:f(t[`ai-search-options-retrieval-keyword-match-mode`],`ai-search-options-retrieval-keyword-match-mode`,`text`),match_threshold:t[`ai-search-options-retrieval-match-threshold`],max_num_results:t[`ai-search-options-retrieval-max-num-results`],retrieval_type:f(t[`ai-search-options-retrieval-retrieval-type`],`ai-search-options-retrieval-retrieval-type`,`text`),return_on_failure:t[`ai-search-options-retrieval-return-on-failure`]}},messages:u(t.messages,`messages`),query:t.query}):l(t.body)});return}let c=await n(t),p=t.local?e:await i();if(t.accountId=p,t.body){let e=l(t.body),n=await s(`Loading`,async()=>c.aiSearch.search({...e,account_id:p,name:t.name,id:t.id}));a(n,{successLabel:`Loaded`});return}let m=d({ai_search_options:{cache:{cache_threshold:f(t[`ai-search-options-cache-cache-threshold`],`ai-search-options-cache-cache-threshold`,`text`),enabled:t[`ai-search-options-cache-enabled`]},query_rewrite:{enabled:t[`ai-search-options-query-rewrite-enabled`],model:f(t[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`),rewrite_prompt:f(t[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)},reranking:{enabled:t[`ai-search-options-reranking-enabled`],match_threshold:t[`ai-search-options-reranking-match-threshold`],model:f(t[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)},retrieval:{context_expansion:t[`ai-search-options-retrieval-context-expansion`],fusion_method:f(t[`ai-search-options-retrieval-fusion-method`],`ai-search-options-retrieval-fusion-method`,`text`),keyword_match_mode:f(t[`ai-search-options-retrieval-keyword-match-mode`],`ai-search-options-retrieval-keyword-match-mode`,`text`),match_threshold:t[`ai-search-options-retrieval-match-threshold`],max_num_results:t[`ai-search-options-retrieval-max-num-results`],retrieval_type:f(t[`ai-search-options-retrieval-retrieval-type`],`ai-search-options-retrieval-retrieval-type`,`text`),return_on_failure:t[`ai-search-options-retrieval-return-on-failure`]}},messages:u(t.messages,`messages`),query:t.query}),h=await s(`Loading`,async()=>c.aiSearch.search({...m,account_id:p,name:t.name,id:t.id}));a(h,{successLabel:`Loaded`})})};function Oe(e){return e.usage(`$0 ai-search stats <id>
65
-
66
- Retrieve usage and indexing statistics for an AI Search instance.`).positional(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ke={command:`stats <id>`,describe:`Get instance statistics.`,builder:Oe,handler:async t=>c({command:`ai-search stats`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search stats`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/stats`,pathParams:{id:String(t.id??``),name:String(t.name??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.aiSearch.stats({account_id:l,name:t.name,id:t.id}));a(u,{successLabel:`Loaded`})})};function Ae(e){return e.usage(`$0 ai-search tokens create <name>
67
-
68
- Create a stored Cloudflare credential for an AI Search instance to access its data source.`).positional(`name`,{type:`string`,description:`Human-readable name for the credential.`,demandOption:!0}).option(`cf-api-id`,{type:`string`,description:`The cf_api_id field`}).option(`cf-api-key`,{type:`string`,description:`The cf_api_key field`}).option(`legacy`,{type:`boolean`,description:`The legacy field`,default:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const je={command:`create <name>`,describe:`Create a token`,builder:Ae,handler:async t=>c({command:`ai-search tokens create`,classification:{safeFlags:[`legacy`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/tokens`,pathParams:{},bodyKind:`json`,body:t.body===void 0?d({cf_api_id:f(t[`cf-api-id`],`cf-api-id`,`text`),cf_api_key:f(t[`cf-api-key`],`cf-api-key`,`text`),legacy:t.legacy,name:t.name}):l(t.body)});return}let c=await n(t),u=t.local?e:await i();if(t.accountId=u,t.body){let e=l(t.body),n=await s(`Creating`,async()=>c.aiSearch.tokens.create({...e,account_id:u}));a(n,{successLabel:`Created`});return}t[`cf-api-id`]===void 0&&(t[`cf-api-id`]=await m(`cf-api-id`,`The cf_api_id field`)),t[`cf-api-key`]===void 0&&(t[`cf-api-key`]=await m(`cf-api-key`,`The cf_api_key field`,{kind:`secret`}));let p=d({cf_api_id:f(t[`cf-api-id`],`cf-api-id`,`text`),cf_api_key:f(t[`cf-api-key`],`cf-api-key`,`text`),legacy:t.legacy,name:t.name}),h=await s(`Creating`,async()=>c.aiSearch.tokens.create({...p,account_id:u}));a(h,{successLabel:`Created`})})};function Me(e){return e.usage(`$0 ai-search tokens delete <id>
69
-
70
- Permanently delete a stored AI Search credential. Credentials in use by an instance cannot be deleted.`).positional(`id`,{type:`string`,description:`Stored credential record ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ne={command:`delete <id>`,describe:`Delete a token`,builder:Me,handler:async t=>c({command:`ai-search tokens delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search tokens delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/tokens/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}`,pathParams:{id:String(t.id??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force,message:`This operation permanently deletes the stored credential.`})){process.stderr.write(`Aborted.
71
- `);return}let u=await s(`Deleting`,async()=>c.aiSearch.tokens.delete({account_id:l,id:t.id}));a(u,{successLabel:`Deleted`})})};function Pe(e){return e.usage(`$0 ai-search tokens get <id>
72
-
73
- Retrieve a stored AI Search credential without exposing its secret.`).positional(`id`,{type:`string`,description:`Stored credential record ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`get <id>`,describe:`Get a token`,builder:Pe,handler:async t=>c({command:`ai-search tokens get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search tokens get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/tokens/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}`,pathParams:{id:String(t.id??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.aiSearch.tokens.get({account_id:l,id:t.id}));a(u,{successLabel:`Loaded`})})};function Fe(e){return e.usage(`$0 ai-search tokens list
74
-
75
- List stored AI Search credentials in the account without exposing their secrets.`).option(`page`,{type:`number`,description:`Page number (1-indexed).`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`search`,{type:`string`,description:`Filter tokens whose name contains this string (case-insensitive).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ie={command:`list`,describe:`List tokens`,builder:Fe,handler:async t=>c({command:`ai-search tokens list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={page:t.page,per_page:t[`per-page`],search:t.search};if(t.dryRun){let e=await r();o({command:`cf ai-search tokens list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/tokens`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await i();t.accountId=u;let d=await s(`Loading`,async()=>l.aiSearch.tokens.list({account_id:u,...c}));a(d,{successLabel:`Loaded`})})};function Le(e){return e.usage(`$0 ai-search tokens update <id>
76
-
77
- Replace a stored AI Search credential and invalidate cached credentials for instances that use it.`).positional(`id`,{type:`string`,description:`Stored credential record ID.`,demandOption:!0}).option(`cf-api-id`,{type:`string`,description:`The cf_api_id field`}).option(`cf-api-key`,{type:`string`,description:`The cf_api_key field`}).option(`legacy`,{type:`boolean`,description:`The legacy field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Re={command:`update <id>`,describe:`Update a token`,builder:Le,handler:async t=>c({command:`ai-search tokens update`,classification:{safeFlags:[`legacy`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search tokens update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/tokens/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}`,pathParams:{id:String(t.id??``)},bodyKind:`json`,body:t.body===void 0?d({cf_api_id:f(t[`cf-api-id`],`cf-api-id`,`text`),cf_api_key:f(t[`cf-api-key`],`cf-api-key`,`text`),legacy:t.legacy,name:f(t.name,`name`,`text`)}):l(t.body)});return}let c=await n(t),u=t.local?e:await i();if(t.accountId=u,t.body){let e=l(t.body),n=await s(`Updating`,async()=>c.aiSearch.tokens.update({...e,account_id:u,id:t.id}));a(n,{successLabel:`Updated`});return}t[`cf-api-id`]===void 0&&(t[`cf-api-id`]=await m(`cf-api-id`,`The cf_api_id field`)),t[`cf-api-key`]===void 0&&(t[`cf-api-key`]=await m(`cf-api-key`,`The cf_api_key field`,{kind:`secret`})),t.name===void 0&&(t.name=await m(`name`,`The name field`));let p=d({cf_api_id:f(t[`cf-api-id`],`cf-api-id`,`text`),cf_api_key:f(t[`cf-api-key`],`cf-api-key`,`text`),legacy:t.legacy,name:f(t.name,`name`,`text`)}),h=await s(`Updating`,async()=>c.aiSearch.tokens.update({...p,account_id:u,id:t.id}));a(h,{successLabel:`Updated`})})},ze={command:`tokens`,describe:`Credentials used by AI Search instances`,builder:e=>e.command(je).command(Ne).command($).command(Ie).command(Re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Be(e){return e.usage(`$0 ai-search update <id>
78
-
79
- Update an AI Search instance. Submitting Search for Agents metadata requires the default namespace; omitting or removing it is allowed elsewhere. Submit Search for Agents metadata and restrictive or unknown public endpoint changes or custom domains in separate PUT requests, even when resubmitting unchanged metadata.`).positional(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`ai-gateway-id`,{type:`string`,description:`The ai_gateway_id field`}).option(`ai-search-model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`cache`,{type:`boolean`,description:`The cache field`}).option(`cache-threshold`,{type:`string`,description:`The cache_threshold field`,choices:[`super_strict_match`,`close_enough`,`flexible_friend`,`anything_goes`]}).option(`chunk`,{type:`boolean`,description:`The chunk field`}).option(`chunk-overlap`,{type:`number`,description:`The chunk_overlap field`}).option(`chunk-size`,{type:`number`,description:`The chunk_size field`}).option(`custom-metadata`,{type:`string`,description:`The custom_metadata field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`embedding-model`,{type:`string`,description:`The embedding_model field`}).option(`fusion-method`,{type:`string`,description:`The fusion_method field`,choices:[`max`,`rrf`]}).option(`index-method-keyword`,{type:`boolean`,description:`Enable keyword (BM25) storage backend.`}).option(`index-method-vector`,{type:`boolean`,description:`Enable vector (embedding) storage backend.`}).option(`indexing-options-keyword-tokenizer`,{type:`string`,description:`Tokenizer used for keyword search indexing. porter provides word-level tokenization with Porter stemming (good for natural language queries). trigram enables character-level substring matching (good for partial matches, code, identifiers). Changing this triggers a full re-index. Defaults to porter.`,choices:[`porter`,`trigram`]}).option(`indexing-options-use-ocr`,{type:`boolean`,description:`Enables OCR ingestion for PDFs and images. Changing this triggers a full re-index. Defaults to false.`}).option(`max-num-results`,{type:`number`,description:`The max_num_results field`}).option(`metadata-created-from-aisearch-wizard`,{type:`boolean`,description:`The metadata.created_from_aisearch_wizard field`}).option(`metadata-worker-domain`,{type:`string`,description:`The metadata.worker_domain field`}).option(`paused`,{type:`boolean`,description:`The paused field`}).option(`public-endpoint-params-authorized-hosts`,{type:`string`,array:!0,description:`The public_endpoint_params.authorized_hosts field`}).option(`public-endpoint-params-chat-completions-endpoint-disabled`,{type:`boolean`,description:`Disable chat completions endpoint for this public endpoint`}).option(`public-endpoint-params-custom-domains`,{type:`string`,array:!0,description:`Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).`}).option(`public-endpoint-params-default-domain-enabled`,{type:`boolean`,description:`When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public_endpoint_params is replaced wholesale on update, so resend default_domain_enabled on every update to keep the default host off — omitting it resets to true.`}).option(`public-endpoint-params-enabled`,{type:`boolean`,description:`The public_endpoint_params.enabled field`}).option(`public-endpoint-params-mcp-description`,{type:`string`,description:`The public_endpoint_params.mcp.description field`}).option(`public-endpoint-params-mcp-disabled`,{type:`boolean`,description:`Disable MCP endpoint for this public endpoint`}).option(`public-endpoint-params-rate-limit-period-ms`,{type:`number`,description:`The public_endpoint_params.rate_limit.period_ms field`}).option(`public-endpoint-params-rate-limit-requests`,{type:`number`,description:`The public_endpoint_params.rate_limit.requests field`}).option(`public-endpoint-params-rate-limit-technique`,{type:`string`,description:`The public_endpoint_params.rate_limit.technique field`,choices:[`fixed`,`sliding`]}).option(`public-endpoint-params-search-endpoint-disabled`,{type:`boolean`,description:`Disable search endpoint for this public endpoint`}).option(`reranking`,{type:`boolean`,description:`The reranking field`}).option(`reranking-model`,{type:`string`,description:`The reranking_model field`}).option(`retrieval-options-keyword-match-mode`,{type:`string`,description:`Controls which documents are candidates for BM25 scoring. 'and' restricts candidates to documents containing all query terms; 'or' includes any document containing at least one term, ranked by BM25 relevance. When omitted on an update, the existing stored value is preserved; when never set, search falls back to 'and'.`,choices:[`and`,`or`]}).option(`rewrite-model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`rewrite-query`,{type:`boolean`,description:`The rewrite_query field`}).option(`score-threshold`,{type:`number`,description:`The score_threshold field`}).option(`source`,{type:`string`,description:`The source field`}).option(`source-params-exclude-items`,{type:`string`,array:!0,description:`List of path patterns to exclude. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /admin/** matches /admin/users and /admin/settings/advanced). Most accounts are limited to 10 rules; contact support to raise it.`}).option(`source-params-include-items`,{type:`string`,array:!0,description:`List of path patterns to include. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /blog/** matches /blog/post and /blog/2024/post). Most accounts are limited to 10 rules; contact support to raise it.`}).option(`source-params-prefix`,{type:`string`,description:`The source_params.prefix field`}).option(`source-params-r2-jurisdiction`,{type:`string`,description:`The source_params.r2_jurisdiction field`}).option(`source-params-web-crawler-discover-options-depth`,{type:`number`,description:`Maximum link-follow depth from the seed URL.`}).option(`source-params-web-crawler-discover-options-include-external-links`,{type:`boolean`,description:"Follow links that point outside the source domain. Must stay `false` — discover crawls are restricted to the zone you own."}).option(`source-params-web-crawler-discover-options-include-subdomains`,{type:`boolean`,description:`Follow links to subdomains of the source host.`}).option(`source-params-web-crawler-discover-options-limit`,{type:`number`,description:`Maximum number of pages to crawl (1-100000).`}).option(`source-params-web-crawler-discover-options-max-age`,{type:`number`,description:`Maximum content age in seconds to accept (0–604800).`}).option(`source-params-web-crawler-discover-options-source`,{type:`string`,description:`Where the crawler looks for URLs: 'sitemaps' reads sitemap XML only, 'links' follows page links only, 'all' does both.`,choices:[`all`,`sitemaps`,`links`]}).option(`source-params-web-crawler-parse-options-include-images`,{type:`boolean`,description:`The source_params.web_crawler.parse_options.include_images field`}).option(`source-params-web-crawler-parse-options-specific-sitemaps`,{type:`string`,array:!0,description:`List of specific sitemap URLs to use for crawling. Only valid when parse_type is 'sitemap'.`}).option(`source-params-web-crawler-parse-options-use-browser-rendering`,{type:`boolean`,description:`The source_params.web_crawler.parse_options.use_browser_rendering field`}).option(`source-params-web-crawler-parse-type`,{type:`string`,description:`How URLs are discovered. 'sitemap' reads XML sitemaps; 'discover' follows links recursively and requires the source to be a Verified zone on this account.`,choices:[`sitemap`,`discover`]}).option(`summarization`,{type:`boolean`,description:`The summarization field`}).option(`summarization-model`,{type:`string`,description:`The summarization_model field`}).option(`system-prompt-ai-search`,{type:`string`,description:`The system_prompt_ai_search field`}).option(`system-prompt-index-summarization`,{type:`string`,description:`The system_prompt_index_summarization field`}).option(`system-prompt-rewrite-query`,{type:`string`,description:`The system_prompt_rewrite_query field`}).option(`token-id`,{type:`string`,description:`The token_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`index-method-keyword`,`index-method-vector`].some(t=>e[t]!==void 0)){let t=[`index-method-keyword`,`index-method-vector`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --index_method-* flag is set`)}return!0})}const Ve={command:`update <id>`,describe:`Update an AI Search instance (Search for Agents metadata requires the default namespace).`,builder:Be,handler:async t=>c({command:`ai-search update`,classification:{safeFlags:/* @__PURE__ */ `cache.cache-threshold.chunk.fusion-method.index-method-keyword.index-method-vector.indexing-options-keyword-tokenizer.indexing-options-use-ocr.metadata-created-from-aisearch-wizard.paused.public-endpoint-params-chat-completions-endpoint-disabled.public-endpoint-params-default-domain-enabled.public-endpoint-params-enabled.public-endpoint-params-mcp-disabled.public-endpoint-params-rate-limit-technique.public-endpoint-params-search-endpoint-disabled.reranking.retrieval-options-keyword-match-mode.rewrite-query.source-params-web-crawler-discover-options-include-external-links.source-params-web-crawler-discover-options-include-subdomains.source-params-web-crawler-discover-options-source.source-params-web-crawler-parse-options-include-images.source-params-web-crawler-parse-options-use-browser-rendering.source-params-web-crawler-parse-type.summarization.dry-run`.split(`.`)}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf ai-search update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${t.name==null?`<name>`:encodeURIComponent(String(t.name))}/instances/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}`,pathParams:{id:String(t.id??``),name:String(t.name??``)},bodyKind:`json`,body:t.body===void 0?d({ai_gateway_id:f(t[`ai-gateway-id`],`ai-gateway-id`,`text`),ai_search_model:f(t[`ai-search-model`],`ai-search-model`,`text`),cache:t.cache,cache_threshold:f(t[`cache-threshold`],`cache-threshold`,`text`),chunk:t.chunk,chunk_overlap:t[`chunk-overlap`],chunk_size:t[`chunk-size`],custom_metadata:u(t[`custom-metadata`],`custom-metadata`),embedding_model:f(t[`embedding-model`],`embedding-model`,`text`),fusion_method:f(t[`fusion-method`],`fusion-method`,`text`),index_method:{keyword:t[`index-method-keyword`],vector:t[`index-method-vector`]},indexing_options:{keyword_tokenizer:f(t[`indexing-options-keyword-tokenizer`],`indexing-options-keyword-tokenizer`,`text`),use_ocr:t[`indexing-options-use-ocr`]},max_num_results:t[`max-num-results`],metadata:{created_from_aisearch_wizard:t[`metadata-created-from-aisearch-wizard`],worker_domain:f(t[`metadata-worker-domain`],`metadata-worker-domain`,`text`)},paused:t.paused,public_endpoint_params:{authorized_hosts:t[`public-endpoint-params-authorized-hosts`],chat_completions_endpoint:{disabled:t[`public-endpoint-params-chat-completions-endpoint-disabled`]},custom_domains:t[`public-endpoint-params-custom-domains`],default_domain_enabled:t[`public-endpoint-params-default-domain-enabled`],enabled:t[`public-endpoint-params-enabled`],mcp:{description:f(t[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`),disabled:t[`public-endpoint-params-mcp-disabled`]},rate_limit:{period_ms:t[`public-endpoint-params-rate-limit-period-ms`],requests:t[`public-endpoint-params-rate-limit-requests`],technique:f(t[`public-endpoint-params-rate-limit-technique`],`public-endpoint-params-rate-limit-technique`,`text`)},search_endpoint:{disabled:t[`public-endpoint-params-search-endpoint-disabled`]}},reranking:t.reranking,reranking_model:f(t[`reranking-model`],`reranking-model`,`text`),retrieval_options:{keyword_match_mode:f(t[`retrieval-options-keyword-match-mode`],`retrieval-options-keyword-match-mode`,`text`)},rewrite_model:f(t[`rewrite-model`],`rewrite-model`,`text`),rewrite_query:t[`rewrite-query`],score_threshold:t[`score-threshold`],source:f(t.source,`source`,`text`),source_params:{exclude_items:t[`source-params-exclude-items`],include_items:t[`source-params-include-items`],prefix:f(t[`source-params-prefix`],`source-params-prefix`,`text`),r2_jurisdiction:f(t[`source-params-r2-jurisdiction`],`source-params-r2-jurisdiction`,`text`),web_crawler:{discover_options:{depth:t[`source-params-web-crawler-discover-options-depth`],include_external_links:t[`source-params-web-crawler-discover-options-include-external-links`],include_subdomains:t[`source-params-web-crawler-discover-options-include-subdomains`],limit:t[`source-params-web-crawler-discover-options-limit`],max_age:t[`source-params-web-crawler-discover-options-max-age`],source:f(t[`source-params-web-crawler-discover-options-source`],`source-params-web-crawler-discover-options-source`,`text`)},parse_options:{include_images:t[`source-params-web-crawler-parse-options-include-images`],specific_sitemaps:t[`source-params-web-crawler-parse-options-specific-sitemaps`],use_browser_rendering:t[`source-params-web-crawler-parse-options-use-browser-rendering`]},parse_type:f(t[`source-params-web-crawler-parse-type`],`source-params-web-crawler-parse-type`,`text`)}},summarization:t.summarization,summarization_model:f(t[`summarization-model`],`summarization-model`,`text`),system_prompt_ai_search:f(t[`system-prompt-ai-search`],`system-prompt-ai-search`,`text`),system_prompt_index_summarization:f(t[`system-prompt-index-summarization`],`system-prompt-index-summarization`,`text`),system_prompt_rewrite_query:f(t[`system-prompt-rewrite-query`],`system-prompt-rewrite-query`,`text`),token_id:f(t[`token-id`],`token-id`,`text`)}):l(t.body)});return}let c=await n(t),p=t.local?e:await i();if(t.accountId=p,t.body){let e=l(t.body),n=await s(`Updating`,async()=>c.aiSearch.update({...e,account_id:p,name:t.name,id:t.id}));a(n,{successLabel:`Updated`});return}let m=d({ai_gateway_id:f(t[`ai-gateway-id`],`ai-gateway-id`,`text`),ai_search_model:f(t[`ai-search-model`],`ai-search-model`,`text`),cache:t.cache,cache_threshold:f(t[`cache-threshold`],`cache-threshold`,`text`),chunk:t.chunk,chunk_overlap:t[`chunk-overlap`],chunk_size:t[`chunk-size`],custom_metadata:u(t[`custom-metadata`],`custom-metadata`),embedding_model:f(t[`embedding-model`],`embedding-model`,`text`),fusion_method:f(t[`fusion-method`],`fusion-method`,`text`),index_method:{keyword:t[`index-method-keyword`],vector:t[`index-method-vector`]},indexing_options:{keyword_tokenizer:f(t[`indexing-options-keyword-tokenizer`],`indexing-options-keyword-tokenizer`,`text`),use_ocr:t[`indexing-options-use-ocr`]},max_num_results:t[`max-num-results`],metadata:{created_from_aisearch_wizard:t[`metadata-created-from-aisearch-wizard`],worker_domain:f(t[`metadata-worker-domain`],`metadata-worker-domain`,`text`)},paused:t.paused,public_endpoint_params:{authorized_hosts:t[`public-endpoint-params-authorized-hosts`],chat_completions_endpoint:{disabled:t[`public-endpoint-params-chat-completions-endpoint-disabled`]},custom_domains:t[`public-endpoint-params-custom-domains`],default_domain_enabled:t[`public-endpoint-params-default-domain-enabled`],enabled:t[`public-endpoint-params-enabled`],mcp:{description:f(t[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`),disabled:t[`public-endpoint-params-mcp-disabled`]},rate_limit:{period_ms:t[`public-endpoint-params-rate-limit-period-ms`],requests:t[`public-endpoint-params-rate-limit-requests`],technique:f(t[`public-endpoint-params-rate-limit-technique`],`public-endpoint-params-rate-limit-technique`,`text`)},search_endpoint:{disabled:t[`public-endpoint-params-search-endpoint-disabled`]}},reranking:t.reranking,reranking_model:f(t[`reranking-model`],`reranking-model`,`text`),retrieval_options:{keyword_match_mode:f(t[`retrieval-options-keyword-match-mode`],`retrieval-options-keyword-match-mode`,`text`)},rewrite_model:f(t[`rewrite-model`],`rewrite-model`,`text`),rewrite_query:t[`rewrite-query`],score_threshold:t[`score-threshold`],source:f(t.source,`source`,`text`),source_params:{exclude_items:t[`source-params-exclude-items`],include_items:t[`source-params-include-items`],prefix:f(t[`source-params-prefix`],`source-params-prefix`,`text`),r2_jurisdiction:f(t[`source-params-r2-jurisdiction`],`source-params-r2-jurisdiction`,`text`),web_crawler:{discover_options:{depth:t[`source-params-web-crawler-discover-options-depth`],include_external_links:t[`source-params-web-crawler-discover-options-include-external-links`],include_subdomains:t[`source-params-web-crawler-discover-options-include-subdomains`],limit:t[`source-params-web-crawler-discover-options-limit`],max_age:t[`source-params-web-crawler-discover-options-max-age`],source:f(t[`source-params-web-crawler-discover-options-source`],`source-params-web-crawler-discover-options-source`,`text`)},parse_options:{include_images:t[`source-params-web-crawler-parse-options-include-images`],specific_sitemaps:t[`source-params-web-crawler-parse-options-specific-sitemaps`],use_browser_rendering:t[`source-params-web-crawler-parse-options-use-browser-rendering`]},parse_type:f(t[`source-params-web-crawler-parse-type`],`source-params-web-crawler-parse-type`,`text`)}},summarization:t.summarization,summarization_model:f(t[`summarization-model`],`summarization-model`,`text`),system_prompt_ai_search:f(t[`system-prompt-ai-search`],`system-prompt-ai-search`,`text`),system_prompt_index_summarization:f(t[`system-prompt-index-summarization`],`system-prompt-index-summarization`,`text`),system_prompt_rewrite_query:f(t[`system-prompt-rewrite-query`],`system-prompt-rewrite-query`,`text`),token_id:f(t[`token-id`],`token-id`,`text`)}),h=await s(`Updating`,async()=>c.aiSearch.update({...m,account_id:p,name:t.name,id:t.id}));a(h,{successLabel:`Updated`})})},He={command:`ai-search`,describe:`Managed search-as-a-service: crawl, index, and query content with AI-powered relevance and chat completions`,builder:e=>e.command(y).command(x).command(C).command(T).command(oe).command(ce).command(ue).command(fe).command(Te).command(De).command(ke).command(Ve).command(W).command(ie).command(Ce).command(ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{He as default};
@@ -1,20 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-C0lQ9sTg.mjs";import{i as t,n}from"./auth-AobvBmz4.mjs";import{a as r,i,t as a}from"./context-Bwkz4Lm_.mjs";import{t as o}from"./output-BGqhvqe2.mjs";import{t as s}from"./dry-run-DmsbOMF1.mjs";import{t as c}from"./progress-BYVZuEcG.mjs";import{t as l}from"./run-CrZgB8L_.mjs";import"./telemetry-DBXOMuLh.mjs";import{i as u,n as d,r as f,t as p}from"./body-parser-DkHKPkJ7.mjs";import{n as m,t as h}from"./input-validation-D7z60HJH.mjs";import{a as g}from"./prompt-F5wxc8zq.mjs";function _(e){return e.usage(`$0 analytics latency colos get
3
-
4
- Retrieves Argo Smart Routing analytics broken down by geographic points of presence (PoPs). Shows latency improvements and routing efficiency per location.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get`,describe:`Argo Analytics for a zone at different PoPs`,builder:_,handler:async e=>l({command:`analytics latency colos get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf analytics latency colos get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/analytics/latency/colos`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await n(e),r=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r;let a=await c(`Loading`,async()=>t.analytics.latency.colos.get({zone_id:r}));o(a,{successLabel:`Loaded`})})},y={command:`colos`,describe:`Operations for latency.colos`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.usage(`$0 analytics latency get
5
-
6
- Retrieves aggregate Argo Smart Routing analytics for a zone, including latency improvements, bandwidth savings, and routing statistics.`).option(`bins`,{type:`string`,description:`Bins`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get`,describe:`Argo Analytics for a zone`,builder:b,handler:async e=>l({command:`analytics latency get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={bins:e.bins};if(e.dryRun){s({command:`cf analytics latency get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/analytics/latency`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let r=await n(e),a=await i({zone:e.zone},r,{quiet:e.quiet});e.zoneId=a;let l=await c(`Loading`,async()=>r.analytics.latency.get({zone_id:a,...t}));o(l,{successLabel:`Loaded`})})},S={command:`latency`,describe:`Argo Smart Routing latency analytics showing time-to-first-byte improvements`,builder:e=>e.command(x).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.usage(`$0 analytics query data-security content-findings top-n
7
-
8
- Returns the top N integrations ranked by total content findings.`).option(`filters`,{type:`string`,description:"Filters to apply. `findingType = content` is applied automatically for CASB data. Provide as a JSON array of objects or @path/to/file.json."}).option(`from`,{type:`string`,description:`Start of the query time range (inclusive). RFC3339.`}).option(`n`,{type:`number`,description:`Maximum number of integrations to return.`}).option(`to`,{type:`string`,description:`End of the query time range (exclusive). RFC3339.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Returns the top N integrations for content findings.`})}const w={command:`top-n`,describe:`Top integrations by content findings`,builder:C,handler:async t=>l({command:`analytics query data-security content-findings top-n`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf analytics query data-security content-findings top-n`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/analytics/query/data-security/content-findings/top-n`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({filters:f(t.filters,`filters`),from:m(t.from,`from`,`text`),n:t.n,to:m(t.to,`to`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.analytics.query.dataSecurity.contentFindings.topN({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);if(t.from===void 0&&(t.from=await g(`from`,`Start of the query time range (inclusive). RFC3339.`)),t.n===void 0)throw Error(`--n is required (or pass --body with this field set).`);t.to===void 0&&(t.to=await g(`to`,`End of the query time range (exclusive). RFC3339.`));let u=p({filters:f(t.filters,`filters`),from:m(t.from,`from`,`text`),n:t.n,to:m(t.to,`to`,`text`)}),h=await c(`Creating`,async()=>i.analytics.query.dataSecurity.contentFindings.topN({...u,account_id:l}));o(h,{successLabel:`Created`})})},T={command:`content-findings`,describe:`Operations for query.data-security.content-findings`,builder:e=>e.command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function E(e){return e.usage(`$0 analytics query data-security findings summary
9
-
10
- Returns aggregate current-period and previous-period totals for CASB findings.`).option(`filters`,{type:`string`,description:`Filters to apply. Provide as a JSON array of objects or @path/to/file.json.`}).option(`from`,{type:`string`,description:`Start of the query time range (inclusive). RFC3339.`}).option(`to`,{type:`string`,description:`End of the query time range (exclusive). RFC3339.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Query for aggregate findings summary.`})}const D={command:`summary`,describe:`Data security findings summary`,builder:E,handler:async t=>l({command:`analytics query data-security findings summary`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf analytics query data-security findings summary`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/analytics/query/data-security/findings/summary`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({filters:f(t.filters,`filters`),from:m(t.from,`from`,`text`),to:m(t.to,`to`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.analytics.query.dataSecurity.findings.summary({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);t.from===void 0&&(t.from=await g(`from`,`Start of the query time range (inclusive). RFC3339.`)),t.to===void 0&&(t.to=await g(`to`,`End of the query time range (exclusive). RFC3339.`));let u=p({filters:f(t.filters,`filters`),from:m(t.from,`from`,`text`),to:m(t.to,`to`,`text`)}),h=await c(`Creating`,async()=>i.analytics.query.dataSecurity.findings.summary({...u,account_id:l}));o(h,{successLabel:`Created`})})};function O(e){return e.usage(`$0 analytics query data-security findings timeseries
11
-
12
- Returns merged time-bucketed CASB findings.`).option(`filters`,{type:`string`,description:`Filters to apply. Provide as a JSON array of objects or @path/to/file.json.`}).option(`from`,{type:`string`,description:`Start of the query time range (inclusive). RFC3339.`}).option(`to`,{type:`string`,description:`End of the query time range (exclusive). RFC3339.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Query for findings timeseries.`})}const k={command:`timeseries`,describe:`Data security findings timeseries`,builder:O,handler:async t=>l({command:`analytics query data-security findings timeseries`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf analytics query data-security findings timeseries`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/analytics/query/data-security/findings/timeseries`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({filters:f(t.filters,`filters`),from:m(t.from,`from`,`text`),to:m(t.to,`to`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.analytics.query.dataSecurity.findings.timeseries({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);t.from===void 0&&(t.from=await g(`from`,`Start of the query time range (inclusive). RFC3339.`)),t.to===void 0&&(t.to=await g(`to`,`End of the query time range (exclusive). RFC3339.`));let u=p({filters:f(t.filters,`filters`),from:m(t.from,`from`,`text`),to:m(t.to,`to`,`text`)}),h=await c(`Creating`,async()=>i.analytics.query.dataSecurity.findings.timeseries({...u,account_id:l}));o(h,{successLabel:`Created`})})},A={command:`findings`,describe:`Operations for query.data-security.findings`,builder:e=>e.command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`data-security`,describe:`Operations for query.data-security`,builder:e=>e.command(T).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.usage(`$0 analytics query summary <dataset>
13
-
14
- Returns aggregate summary stats for a dataset. Includes current-period and previous-period totals for trend comparison.`).positional(`dataset`,{type:`string`,description:"Dataset name to query. Examples: `access-logins`, `gateway-http`, `gateway-dns`, `gateway-http`, `shadow-it`.",demandOption:!0}).option(`filters`,{type:`string`,description:`Filters to apply before aggregating results. Provide as a JSON array of objects or @path/to/file.json.`}).option(`from`,{type:`string`,description:"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`)."}).option(`group-by`,{type:`string`,array:!0,description:`Specifies the column names to group results by. Requires valid columns for the target dataset.`}).option(`stats`,{type:`string`,array:!0,description:"Specifies the stat names to include in results. Requires valid stats for the target dataset (e.g. `attemptsTotal`, `bytesTotal`)."}).option(`to`,{type:`string`,description:`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines fields that all query types share.`})}const N={command:`summary <dataset>`,describe:`Query analytics summary`,builder:M,handler:async t=>l({command:`analytics query summary`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf analytics query summary`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/analytics/query/${t.dataset==null?`<dataset>`:encodeURIComponent(String(t.dataset))}/summary`,pathParams:{dataset:String(t.dataset??``)},bodyKind:`json`,body:t.body===void 0?p({filters:f(t.filters,`filters`),from:m(t.from,`from`,`text`),groupBy:t[`group-by`],stats:t.stats,to:m(t.to,`to`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.analytics.query.summary({...e,account_id:l,dataset:t.dataset}));o(n,{successLabel:`Created`});return}if(t.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);if(t.from===void 0&&(t.from=await g(`from`,"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`).")),t[`group-by`]===void 0)throw Error(`--group-by is required (or pass --body with this field set).`);if(t.stats===void 0)throw Error(`--stats is required (or pass --body with this field set).`);t.to===void 0&&(t.to=await g(`to`,`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`));let u=p({filters:f(t.filters,`filters`),from:m(t.from,`from`,`text`),groupBy:t[`group-by`],stats:t.stats,to:m(t.to,`to`,`text`)}),h=await c(`Creating`,async()=>i.analytics.query.summary({...u,account_id:l,dataset:t.dataset}));o(h,{successLabel:`Created`})})};function P(e){return e.usage("$0 analytics query timeseries <dataset>\n\nReturns time-bucketed analytics data for a dataset. Includes time slots, each containing the requested stats, group-by dimensions, and resolution-controlled bucket size (e.g. `hour`, `day`).").positional(`dataset`,{type:`string`,description:"Dataset name to query. Examples: `access-logins`, `gateway-http`, `gateway-dns`, `gateway-http`, `shadow-it`.",demandOption:!0}).option(`filters`,{type:`string`,description:`Filters to apply before aggregating results. Provide as a JSON array of objects or @path/to/file.json.`}).option(`from`,{type:`string`,description:"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`)."}).option(`group-by`,{type:`string`,array:!0,description:`Specifies the column names to group results by. Requires valid columns for the target dataset.`}).option(`stats`,{type:`string`,array:!0,description:"Specifies the stat names to include in results. Requires valid stats for the target dataset (e.g. `attemptsTotal`, `bytesTotal`)."}).option(`to`,{type:`string`,description:`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`}).option(`resolution`,{type:`string`,description:`Time bucket size for grouping results. Controls the granularity of the returned time slots.
15
- `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines fields that all query types share.`})}const F={command:`timeseries <dataset>`,describe:`Query analytics timeseries`,builder:P,handler:async t=>l({command:`analytics query timeseries`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf analytics query timeseries`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/analytics/query/${t.dataset==null?`<dataset>`:encodeURIComponent(String(t.dataset))}/timeseries`,pathParams:{dataset:String(t.dataset??``)},bodyKind:`json`,body:t.body===void 0?p({filters:f(t.filters,`filters`),from:m(t.from,`from`,`text`),groupBy:t[`group-by`],stats:t.stats,to:m(t.to,`to`,`text`),resolution:m(t.resolution,`resolution`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.analytics.query.timeseries({...e,account_id:l,dataset:t.dataset}));o(n,{successLabel:`Created`});return}if(t.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);if(t.from===void 0&&(t.from=await g(`from`,"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`).")),t[`group-by`]===void 0)throw Error(`--group-by is required (or pass --body with this field set).`);if(t.stats===void 0)throw Error(`--stats is required (or pass --body with this field set).`);t.to===void 0&&(t.to=await g(`to`,`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`)),t.resolution===void 0&&(t.resolution=await g(`resolution`,`Time bucket size for grouping results. Controls the granularity of the returned time slots. `));let u=p({filters:f(t.filters,`filters`),from:m(t.from,`from`,`text`),groupBy:t[`group-by`],stats:t.stats,to:m(t.to,`to`,`text`),resolution:m(t.resolution,`resolution`,`text`)}),h=await c(`Creating`,async()=>i.analytics.query.timeseries({...u,account_id:l,dataset:t.dataset}));o(h,{successLabel:`Created`})})};function I(e){return e.usage(`$0 analytics query top-n <dataset>
16
-
17
- Returns the top N results for a dataset by a specified stat. Includes an array of result rows, each containing the requested stats and group-by dimensions.`).positional(`dataset`,{type:`string`,description:"Dataset name to query. Examples: `access-logins`, `gateway-http`, `gateway-dns`, `gateway-http`, `shadow-it`.",demandOption:!0}).option(`filters`,{type:`string`,description:`Filters to apply before aggregating results. Provide as a JSON array of objects or @path/to/file.json.`}).option(`from`,{type:`string`,description:"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`)."}).option(`group-by`,{type:`string`,array:!0,description:`Specifies the column names to group results by. Requires valid columns for the target dataset.`}).option(`stats`,{type:`string`,array:!0,description:"Specifies the stat names to include in results. Requires valid stats for the target dataset (e.g. `attemptsTotal`, `bytesTotal`)."}).option(`to`,{type:`string`,description:`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`}).option(`n`,{type:`number`,description:`Maximum number of results to return.`}).option(`order-by`,{type:`string`,description:`Specifies the stat name for sorting results in descending order. Requires a valid stat for the target dataset.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines fields that all query types share.`})}const L={command:`top-n <dataset>`,describe:`Query analytics top-N`,builder:I,handler:async t=>l({command:`analytics query top-n`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf analytics query top-n`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/analytics/query/${t.dataset==null?`<dataset>`:encodeURIComponent(String(t.dataset))}/top-n`,pathParams:{dataset:String(t.dataset??``)},bodyKind:`json`,body:t.body===void 0?p({filters:f(t.filters,`filters`),from:m(t.from,`from`,`text`),groupBy:t[`group-by`],stats:t.stats,to:m(t.to,`to`,`text`),n:t.n,orderBy:m(t[`order-by`],`order-by`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.analytics.query.topN({...e,account_id:l,dataset:t.dataset}));o(n,{successLabel:`Created`});return}if(t.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);if(t.from===void 0&&(t.from=await g(`from`,"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`).")),t[`group-by`]===void 0)throw Error(`--group-by is required (or pass --body with this field set).`);if(t.stats===void 0)throw Error(`--stats is required (or pass --body with this field set).`);if(t.to===void 0&&(t.to=await g(`to`,`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`)),t.n===void 0)throw Error(`--n is required (or pass --body with this field set).`);t[`order-by`]===void 0&&(t[`order-by`]=await g(`order-by`,`Specifies the stat name for sorting results in descending order. Requires a valid stat for the target dataset.`));let u=p({filters:f(t.filters,`filters`),from:m(t.from,`from`,`text`),groupBy:t[`group-by`],stats:t.stats,to:m(t.to,`to`,`text`),n:t.n,orderBy:m(t[`order-by`],`order-by`,`text`)}),h=await c(`Creating`,async()=>i.analytics.query.topN({...u,account_id:l,dataset:t.dataset}));o(h,{successLabel:`Created`})})},R={command:`query`,describe:`Operations for query`,builder:e=>e.command(N).command(F).command(L).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.usage("$0 analytics sql get\n\nExecutes a SQL query against the analytics datasets available to the caller. SQL placeholders can be bound with query parameters named `param_<name>`, such as `param_status=404` for `$status`. A trailing `FORMAT JSON`, `FORMAT JSONEachRow`, `FORMAT TabSeparated`, or `FORMAT TSV` is supported for all datasets. Without FORMAT, each backend retains its existing default JSON response.").option(`query`,{type:`string`,description:`SQL query to execute. A trailing FORMAT selects JSON, JSONEachRow, TabSeparated, or TSV output on any dataset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get`,describe:`Query analytics datasets`,builder:z,handler:async e=>l({command:`analytics sql get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={query:e.query};if(e.dryRun){s({command:`cf analytics sql get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/analytics/sql`,pathParams:{},query:t,bodyKind:`none`});return}let r=await n(e),i=await c(`Loading`,async()=>r.analytics.sql.get(t));o(i,{successLabel:`Loaded`})})};function V(e){return e.usage("$0 analytics sql introspection get\n\nReturns the analytics dataset catalogue. By default, the response contains dataset names, titles, descriptions, and kinds. Set `include_columns` to include each dataset's column names, descriptions, and data types. The caller must have Account Analytics Read permission on the account identified by `account_tag`. Dataset names, descriptions, and columns are the same for every authorized account. When `include_custom_attributes` is set, the response also includes custom attribute names and types discovered from that account's own data, which legitimately differs per caller. The catalogue lists the datasets this deployment is able to describe, which is not a fixed list. Some datasets are described by the service that owns them and are listed only where that service is available, so the same account may see a different catalogue in different environments, and datasets may appear or disappear without a change to this API. Clients should query the catalogue rather than hard-coding it, and should not treat a dataset's absence as proof that it does not exist. Workers Analytics Engine datasets are named by the account that writes them, so they are discovered from that account's own data rather than from a fixed list. They appear as `events.analyticsEngine.<dataset_name>` and differ per account. A dataset is listed for as long as any of its data is retained, so it does not disappear from the catalogue merely because writes have stopped. An account with a very large number of datasets may receive a truncated list. Set `include_wae=false` to omit them. Log Explorer datasets are listed only where the account has them, so they differ per account and are not part of the static catalogue. Set `include_lex=false` to omit them.").option(`account-tag`,{type:`string`,description:`Account whose available analytics datasets are returned.`,demandOption:!0}).option(`include-columns`,{type:`boolean`,description:`Include column metadata for each returned dataset.`}).option(`include-custom-attributes`,{type:`boolean`,description:`Include a capped set of custom attribute names and types observed during the preceding seven days. Requires a nonempty dataset_name.`}).option(`include-wae`,{type:`boolean`,description:"Include Workers Analytics Engine datasets, which are discovered from the account's own data. Set to `false` to return only datasets described from the static catalogue, which avoids that lookup."}).option(`include-lex`,{type:`boolean`,description:"Include Log Explorer datasets, which are listed only where the account has them. Set to `false` to return only datasets described from the static catalogue, which avoids that lookup."}).option(`dataset-name`,{type:`string`,description:"Return only the dataset with this exact name. An empty value is treated as if the parameter had been omitted, and does not filter the catalogue. A name that matches no dataset in this deployment's catalogue is rejected with `422`; a dataset that exists but is not describable here is rejected identically, so the two cases cannot be told apart.\n\nA Workers Analytics Engine dataset is named in full, as `events.analyticsEngine.<dataset_name>`; the namespace on its own returns every such dataset the account has. A `dataset_name` the account does not have is rejected with `422` like any other unknown name."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get`,describe:`List available analytics datasets`,builder:V,handler:async e=>l({command:`analytics sql introspection get`,classification:{safeFlags:[`include-columns`,`include-custom-attributes`,`include-wae`,`include-lex`,`dry-run`]}},e,async()=>{let t={account_tag:e[`account-tag`],include_columns:e[`include-columns`],include_custom_attributes:e[`include-custom-attributes`],include_wae:e[`include-wae`],include_lex:e[`include-lex`],dataset_name:e[`dataset-name`]};if(e.dryRun){s({command:`cf analytics sql introspection get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/analytics/sql/introspection`,pathParams:{},query:t,bodyKind:`none`});return}let r=await n(e),i=await c(`Loading`,async()=>r.analytics.sql.introspection.get(t));o(i,{successLabel:`Loaded`})})},U={command:`introspection`,describe:`Operations for sql.introspection`,builder:e=>e.command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.usage("$0 analytics sql post\n\nExecutes a SQL query against the analytics datasets available to the caller. Send either raw SQL or a JSON object containing the query and optional positional or named parameters, time range, and account or zone scope. Raw SQL placeholders can also be bound with query parameters named `param_<name>`. A trailing `FORMAT JSON`, `FORMAT JSONEachRow`, `FORMAT TabSeparated`, or `FORMAT TSV` is supported for all datasets. Without FORMAT, each backend retains its existing default JSON response.").option(`query`,{type:`string`,description:`SQL query to execute. A trailing FORMAT selects JSON, JSONEachRow, TabSeparated, or TSV output on any dataset.
18
- `}).option(`scope-account-tag`,{type:`string`,description:`Account tag used to authorize and scope the query. Must be a 32-character lowercase hex string.
19
- `}).option(`scope-zone-tag`,{type:`string`,description:`Zone tag used to authorize and scope the query. Must be a 32-character lowercase hex string.
20
- `}).option(`time-range-end`,{type:`string`,description:`Inclusive upper bound for the dataset's timestamp column.`}).option(`time-range-start`,{type:`string`,description:`Inclusive lower bound for the dataset's timestamp column.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).conflicts(`scope-account-tag`,[`scope-zone-tag`]).conflicts(`scope-zone-tag`,[`scope-account-tag`]).check(e=>{if([`time-range-end`,`time-range-start`].some(t=>e[t]!==void 0)){let t=[`time-range-start`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --time_range-* flag is set`)}return!0})}const G={command:`post`,describe:`Query analytics datasets`,builder:W,handler:async e=>l({command:`analytics sql post`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf analytics sql post`,method:`POST`,url:`https://api.cloudflare.com/client/v4/analytics/sql`,pathParams:{},bodyKind:e.file===void 0?`json`:`octet-stream`,body:e.file===void 0?e.body===void 0?p({query:m(e.query,`query`,`text`),scope:{accountTag:m(e[`scope-account-tag`],`scope-account-tag`,`text`),zoneTag:m(e[`scope-zone-tag`],`scope-zone-tag`,`text`)},time_range:{end:m(e[`time-range-end`],`time-range-end`,`text`),start:m(e[`time-range-start`],`time-range-start`,`text`)}}):d(e.body):{file:e.file}});return}let r=await n(e);if(e.file){let n=h(e.file),i=await c(`Creating`,async()=>t(r,`POST`,`/analytics/sql`,{body:n,headers:{"Content-Type":`text/plain`}}));o(i,{successLabel:`Created`});return}if(e.body){let n=d(e.body),i=await c(`Creating`,async()=>t(r,`POST`,`/analytics/sql`,{body:n}));o(i,{successLabel:`Created`});return}e.query===void 0&&(e.query=await g(`query`,`SQL query to execute. A trailing FORMAT selects JSON, JSONEachRow, TabSeparated, or TSV output on any dataset. `));let i={};e.query!==void 0&&u(i,[`query`],m(e.query,`query`,`text`)),e[`scope-account-tag`]!==void 0&&u(i,[`scope`,`accountTag`],m(e[`scope-account-tag`],`scope-account-tag`,`text`)),e[`scope-zone-tag`]!==void 0&&u(i,[`scope`,`zoneTag`],m(e[`scope-zone-tag`],`scope-zone-tag`,`text`)),e[`time-range-end`]!==void 0&&u(i,[`time_range`,`end`],m(e[`time-range-end`],`time-range-end`,`text`)),e[`time-range-start`]!==void 0&&u(i,[`time_range`,`start`],m(e[`time-range-start`],`time-range-start`,`text`));let a=await c(`Creating`,async()=>t(r,`POST`,`/analytics/sql`,{body:Object.keys(i).length>0?i:void 0}));o(a,{successLabel:`Created`})})},K={command:`sql`,describe:`Operations for sql`,builder:e=>e.command(B).command(G).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},q={command:`analytics`,describe:`Zone-level traffic analytics — dashboard summaries, per-colo breakdowns, and Argo latency metrics`,builder:e=>e.command(S).command(R).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{q as default};
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env node
2
- import{n as e}from"./auth-AobvBmz4.mjs";import{i as t}from"./context-Bwkz4Lm_.mjs";import{t as n}from"./output-BGqhvqe2.mjs";import{t as r}from"./dry-run-DmsbOMF1.mjs";import{t as i}from"./progress-BYVZuEcG.mjs";import{t as a}from"./run-CrZgB8L_.mjs";import"./telemetry-DBXOMuLh.mjs";import{n as o,t as s}from"./body-parser-DkHKPkJ7.mjs";import{n as c}from"./input-validation-D7z60HJH.mjs";import{i as l}from"./prompt-F5wxc8zq.mjs";function u(e){return e.usage(`$0 argo smart-routing edit
3
-
4
- Configures the value of the Argo Smart Routing enablement setting.`).option(`value`,{type:`string`,description:`Specifies the enablement value of Argo Smart Routing.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Configures the enablement of Argo Smart Routing.`})}const d={command:`edit`,describe:`Patch Argo Smart Routing setting`,builder:u,handler:async u=>a({command:`argo smart-routing edit`,classification:{safeFlags:[`value`,`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf argo smart-routing edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/argo/smart_routing`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?s({value:c(u.value,`value`,`text`)}):o(u.body)});return}let a=await e(u),d=await t({zone:u.zone},a,{quiet:u.quiet});if(u.zoneId=d,u.body){let e=o(u.body),t=await i(`Updating`,async()=>a.argo.smartRouting.edit({...e,zone_id:d}));n(t,{successLabel:`Updated`});return}u.value===void 0&&(u.value=await l(`value`,`Specifies the enablement value of Argo Smart Routing.`,[`on`,`off`]));let f=s({value:c(u.value,`value`,`text`)}),p=await i(`Updating`,async()=>a.argo.smartRouting.edit({...f,zone_id:d}));n(p,{successLabel:`Updated`})})};function f(e){return e.usage(`$0 argo smart-routing get
5
-
6
- Retrieves the value of Argo Smart Routing enablement setting.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get`,describe:`Get Argo Smart Routing setting`,builder:f,handler:async o=>a({command:`argo smart-routing get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf argo smart-routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/argo/smart_routing`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await e(o),s=await t({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s;let c=await i(`Loading`,async()=>a.argo.smartRouting.get({zone_id:s}));n(c,{successLabel:`Loaded`})})},m={command:`smart-routing`,describe:`Route traffic through the fastest network paths to your origin using real-time latency data`,builder:e=>e.command(d).command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.usage(`$0 argo tiered-caching edit
7
-
8
- Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of lower-tiers and upper-tiers. If content is not cached in lower-tier data centers (generally the ones closest to a visitor), the lower-tier must ask an upper-tier to see if it has the content. If the upper-tier does not have the content, only the upper-tier can ask the origin for content. This practice improves bandwidth efficiency by limiting the number of data centers that can ask the origin for content, which reduces origin load and makes websites more cost-effective to operate. Additionally, Tiered Cache concentrates connections to origin servers so they come from a small number of data centers rather than the full set of network locations. This results in fewer open connections using server resources.`).option(`value`,{type:`string`,description:`Enables Tiered Caching.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update enablement of Tiered Caching.`})}const g={command:`edit`,describe:`Patch Tiered Caching setting`,builder:h,handler:async u=>a({command:`argo tiered-caching edit`,classification:{safeFlags:[`value`,`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf argo tiered-caching edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/argo/tiered_caching`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?s({value:c(u.value,`value`,`text`)}):o(u.body)});return}let a=await e(u),d=await t({zone:u.zone},a,{quiet:u.quiet});if(u.zoneId=d,u.body){let e=o(u.body),t=await i(`Updating`,async()=>a.argo.tieredCaching.edit({...e,zone_id:d}));n(t,{successLabel:`Updated`});return}u.value===void 0&&(u.value=await l(`value`,`Enables Tiered Caching.`,[`on`,`off`]));let f=s({value:c(u.value,`value`,`text`)}),p=await i(`Updating`,async()=>a.argo.tieredCaching.edit({...f,zone_id:d}));n(p,{successLabel:`Updated`})})};function _(e){return e.usage(`$0 argo tiered-caching get
9
-
10
- Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of lower-tiers and upper-tiers. If content is not cached in lower-tier data centers (generally the ones closest to a visitor), the lower-tier must ask an upper-tier to see if it has the content. If the upper-tier does not have the content, only the upper-tier can ask the origin for content. This practice improves bandwidth efficiency by limiting the number of data centers that can ask the origin for content, which reduces origin load and makes websites more cost-effective to operate. Additionally, Tiered Cache concentrates connections to origin servers so they come from a small number of data centers rather than the full set of network locations. This results in fewer open connections using server resources.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get`,describe:`Get Tiered Caching setting`,builder:_,handler:async o=>a({command:`argo tiered-caching get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf argo tiered-caching get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/argo/tiered_caching`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await e(o),s=await t({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s;let c=await i(`Loading`,async()=>a.argo.tieredCaching.get({zone_id:s}));n(c,{successLabel:`Loaded`})})},y={command:`tiered-caching`,describe:`Reduce origin load by having upper-tier data centers serve cache misses before reaching your origin`,builder:e=>e.command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},b={command:`argo`,describe:`Network optimization features that speed up and improve reliability of traffic to your origins`,builder:e=>e.command(m).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{b as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./auth-AobvBmz4.mjs";import"./context-Bwkz4Lm_.mjs";import"./oauth-B08YQ4xq.mjs";import"./auth-token-CtguMdmF.mjs";export{e as createCloudflareClientWithToken};