cf 1.0.0-beta.26 → 1.0.0-beta.27

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 (256) hide show
  1. package/dist/_meta/commands.json +1996 -3422
  2. package/dist/_meta/schemas.json +9249 -2339
  3. package/dist/abuse-reports-RxXqfDEW.mjs +24 -0
  4. package/dist/{access-DCOOmDC5.mjs → access-BxEprr2f.mjs} +1 -1
  5. package/dist/{accounts-HC6XuIwP.mjs → accounts-DU2ZNYqP.mjs} +17 -11
  6. package/dist/{acm-DYgr6SAR.mjs → acm-CBCIKBJ4.mjs} +1 -1
  7. package/dist/{addressing-BS66pJ_a.mjs → addressing-BKxiLRHk.mjs} +1 -1
  8. package/dist/{agent-memory-BbXdueL0.mjs → agent-memory-DkBpQYUL.mjs} +1 -1
  9. package/dist/{ai-BiIKznNv.mjs → ai-DqEN_hhg.mjs} +2 -2
  10. package/dist/{ai-audit-DI4Rw2wl.mjs → ai-audit-BmzOgt6x.mjs} +1 -1
  11. package/dist/{ai-gateway-rlYCbts5.mjs → ai-gateway-B0uiYVHq.mjs} +3 -3
  12. package/dist/ai-search-DbZIxdio.mjs +74 -0
  13. package/dist/{ai-security-BUwS6kVh.mjs → ai-security-CvZfP2JC.mjs} +1 -1
  14. package/dist/{alerting-BSzuvFk1.mjs → alerting-BjGwBxZT.mjs} +1 -1
  15. package/dist/{analytics-CQ-Yt1mm.mjs → analytics-C7kT_H-W.mjs} +4 -4
  16. package/dist/{analytics-engine-CdrY5-95.mjs → analytics-engine-BHpcNSdD.mjs} +1 -1
  17. package/dist/{api-security-BBxEJjGv.mjs → api-security-BbcvDtff.mjs} +2 -2
  18. package/dist/{argo-BiefH8wc.mjs → argo-D1VONzu-.mjs} +1 -1
  19. package/dist/{artifacts-B9g9aPrk.mjs → artifacts-2R2sxIKO.mjs} +1 -1
  20. package/dist/{audit-logs-BhJs-OS2.mjs → audit-logs-LoBB1OO_.mjs} +1 -1
  21. package/dist/auth-CspwoBlp.mjs +2 -0
  22. package/dist/{auth-C50SqX9F.mjs → auth-D499YE2n.mjs} +3 -3
  23. package/dist/{auth-D5Yj9eYU.mjs → auth-FK2eLQ02.mjs} +1 -1
  24. package/dist/{auth-token-DvNoIhRL.mjs → auth-token-BwpERbnG.mjs} +1 -1
  25. package/dist/{autoconfig-ldsgXxa6.mjs → autoconfig-B2w-woU0.mjs} +36 -36
  26. package/dist/{basin-catalog-CtKFiH-n.mjs → basin-catalog-AgOHGiPI.mjs} +2 -2
  27. package/dist/billing-DRNww0iC.mjs +24 -0
  28. package/dist/{blocks-DnNrvi8s.mjs → blocks-C8vyXIAT.mjs} +1 -1
  29. package/dist/body-unions-CjpNjwSW.mjs +2 -0
  30. package/dist/bot-management-fwxKIbaB.mjs +9 -0
  31. package/dist/{botnet-feed-lD9s2oLA.mjs → botnet-feed-DCYB5kYZ.mjs} +1 -1
  32. package/dist/{brand-protection-Byoa1hvj.mjs → brand-protection-BVICLzBc.mjs} +1 -1
  33. package/dist/browser-run-CEk-NIgP.mjs +40 -0
  34. package/dist/build-CRm2TQq8.mjs +2 -0
  35. package/dist/{build-Dwd1_7o0.mjs → build-DO_GNhRl.mjs} +1 -1
  36. package/dist/{builds-D3mAH87h.mjs → builds-CoazxuN-.mjs} +26 -26
  37. package/dist/{cache-0xCdyNg9.mjs → cache-jlLJLSu7.mjs} +1 -1
  38. package/dist/{cf-CpC4giTf.mjs → cf-hP0SOgC6.mjs} +2 -2
  39. package/dist/{chunk-DSGVRFIS-vdfri8fR.mjs → chunk-DSGVRFIS-DQwKND2c.mjs} +1 -1
  40. package/dist/chunk-SOBRPAPT-BKzUiNx_.mjs +363 -0
  41. package/dist/{cli-Cm4Twas4.mjs → cli-Nqf58-1c.mjs} +1 -1
  42. package/dist/{client-side-security-BRn7KBpu.mjs → client-side-security-VmZzMy-m.mjs} +1 -1
  43. package/dist/{cloud-connector-DqkOIRDr.mjs → cloud-connector-bMlFnqP0.mjs} +1 -1
  44. package/dist/{cloudflared-DDp_8PTK.mjs → cloudflared-Ba4KWdTO.mjs} +1 -1
  45. package/dist/{cloudforce-one-B9k8vhso.mjs → cloudforce-one-CCaIBOAo.mjs} +121 -119
  46. package/dist/{command-BV8-laJK.mjs → command-BASaTmJc.mjs} +1 -1
  47. package/dist/{command-CfOqnqlN.mjs → command-BiIVclNA.mjs} +1 -1
  48. package/dist/{command-BKNQsGqu.mjs → command-Bih1HLr3.mjs} +1 -1
  49. package/dist/{command-BVz2aES3.mjs → command-BxZBNPxG.mjs} +1 -1
  50. package/dist/{command-B-_ba4rQ.mjs → command-ByYf12-8.mjs} +1 -1
  51. package/dist/{command-Dn39o5xQ.mjs → command-C0qCuw03.mjs} +1 -1
  52. package/dist/{command-BsCFkho-.mjs → command-C2FVMd1b.mjs} +1 -1
  53. package/dist/{command--Y_QAiU2.mjs → command-C4OgtX_x.mjs} +1 -1
  54. package/dist/{command-DlI7Z_7j.mjs → command-C5Kqc5Km.mjs} +1 -1
  55. package/dist/{command-CQMRxiDz.mjs → command-CFxyp8Uo.mjs} +1 -1
  56. package/dist/{command-CN8NFLs2.mjs → command-CZAR85ba.mjs} +1 -1
  57. package/dist/{command-QHmV62Fv.mjs → command-CelQVrZL.mjs} +1 -1
  58. package/dist/{command-yOG9VUtq.mjs → command-CrAlzysj.mjs} +1 -1
  59. package/dist/{command-DsOv6z9q.mjs → command-pMoNdd22.mjs} +1 -1
  60. package/dist/{completions-BA52jTea.mjs → completions-DRzBiqpv.mjs} +1 -1
  61. package/dist/{connector-interrupts-zL7pxPn6.mjs → connector-interrupts-CrTeSyaM.mjs} +1 -1
  62. package/dist/{connector-telemetry-events-PL4Fqqvu.mjs → connector-telemetry-events-BbAOUt9h.mjs} +1 -1
  63. package/dist/{connector-telemetry-snapshots-DyBSuEFB.mjs → connector-telemetry-snapshots-DcpBx7Qx.mjs} +1 -1
  64. package/dist/{connectors-D8H6rQz9.mjs → connectors-D1WFLJoE.mjs} +1 -1
  65. package/dist/{containers-Db-eWudu.mjs → containers-BOBEs1Gk.mjs} +4 -4
  66. package/dist/containers-DINLx5_i.mjs +380 -0
  67. package/dist/{content-scan-DUVq09i8.mjs → content-scan-D1GfPSL0.mjs} +1 -1
  68. package/dist/{context-BvLXzoMs.mjs → context-Dp4CXG22.mjs} +1 -1
  69. package/dist/{cps-CqaRliZZ.mjs → cps-D4uhzg3k.mjs} +1 -1
  70. package/dist/{csam-scanner-DsXvOOsZ.mjs → csam-scanner-DOOUBeBM.mjs} +1 -3
  71. package/dist/custom-csrs-DtdFo5YZ.mjs +18 -0
  72. package/dist/{custom-hostnames-Cj_csfo_.mjs → custom-hostnames-ccdlELaD.mjs} +1 -1
  73. package/dist/custom-nameservers-p3gDjfva.mjs +12 -0
  74. package/dist/custom-pages-DAkKVzgR.mjs +38 -0
  75. package/dist/d1-CDIyRdh4.mjs +52 -0
  76. package/dist/{delegate-CMfEjvHn.mjs → delegate-B4bKqF7i.mjs} +1 -1
  77. package/dist/delegate.mjs +1 -1
  78. package/dist/{deploy-DDbmxkiX.mjs → deploy-BaC5Ty7F.mjs} +1 -1
  79. package/dist/{deploy-context-DsEVu7bf.mjs → deploy-context-DTTgNGro.mjs} +1 -1
  80. package/dist/{deploy-input-BA_3Q2Xu.mjs → deploy-input-mAy06fAI.mjs} +1 -1
  81. package/dist/{dev-BS156bim.mjs → dev-De-HszNT.mjs} +1 -1
  82. package/dist/{diagnostics-BmkQnSEb.mjs → diagnostics-D1CUs2o9.mjs} +1 -1
  83. package/dist/{dist-DehXZozc.mjs → dist-D5qkmHhC.mjs} +1 -1
  84. package/dist/{dls-DciZC_gQ.mjs → dls-DWBiYzY1.mjs} +1 -1
  85. package/dist/{dns-firewall-CRfde07f.mjs → dns-firewall-DH9xIT5H.mjs} +8 -8
  86. package/dist/{dns-C2YPspGN.mjs → dns-wMjf1t6-.mjs} +14 -8
  87. package/dist/{docs-CYjyBA8q.mjs → docs-BA7qslb2.mjs} +1 -1
  88. package/dist/{durable-objects-DcI97y4p.mjs → durable-objects-DF0MYpnV.mjs} +1 -1
  89. package/dist/{email-auth-CMCQAu99.mjs → email-auth-BShMFXn4.mjs} +1 -1
  90. package/dist/email-domains-CDSbVclP.mjs +14 -0
  91. package/dist/{email-routing-7p9dr5Ue.mjs → email-routing-CBCkbg_F.mjs} +4 -2
  92. package/dist/{email-security-Bu0fAYh-.mjs → email-security-CnNa1YON.mjs} +4 -4
  93. package/dist/{email-sending-OpMZNaHZ.mjs → email-sending-CpDSw-Eb.mjs} +16 -16
  94. package/dist/{errors-C5RGao2J.mjs → errors-DatLr-iR.mjs} +1 -1
  95. package/dist/{field-extractors-BfsNjd0e.mjs → field-extractors-BwGdMnTr.mjs} +1 -1
  96. package/dist/{firewall-CJ-VIOk1.mjs → firewall-CY_oem-d.mjs} +25 -9
  97. package/dist/{flagship-C5PTR1ND.mjs → flagship-Bat5EZCk.mjs} +1 -1
  98. package/dist/{fraud-B7hwBheX.mjs → fraud-CSUKLh8X.mjs} +2 -2
  99. package/dist/global-options-DiKj2cQy.mjs +2 -0
  100. package/dist/{google-tag-gateway-D7iFDVEa.mjs → google-tag-gateway-C2skt6t-.mjs} +1 -1
  101. package/dist/{healthchecks-B4jTcKV7.mjs → healthchecks-uC43QKQd.mjs} +1 -1
  102. package/dist/{hyperdrive-1432DM-p.mjs → hyperdrive-FcBbpew4.mjs} +3 -3
  103. package/dist/iam-8T74DNhH.mjs +62 -0
  104. package/dist/{images-Ttea4khD.mjs → images-C3JUaf6b.mjs} +1 -1
  105. package/dist/index.mjs +1 -1
  106. package/dist/{init-BeYrAg7Q.mjs → init-BEVVz4_P.mjs} +1 -1
  107. package/dist/{intel-CJznBf5n.mjs → intel-DRy4rHrt.mjs} +6 -7
  108. package/dist/{interactive-DsU8VDvK.mjs → interactive-CKHdGvkh.mjs} +1 -1
  109. package/dist/{internal-DOho_iA0.mjs → internal-CamuESs0.mjs} +1 -1
  110. package/dist/{ips-BgNoRwFN.mjs → ips-DinCNnWj.mjs} +1 -1
  111. package/dist/k2-wsanPL3y.mjs +10 -0
  112. package/dist/{kv-CTyuvcAz.mjs → kv-BLSPcEnH.mjs} +1 -1
  113. package/dist/{lazy-command-DeTzOWvU.mjs → lazy-command-WB1FOuew.mjs} +1 -1
  114. package/dist/{leaked-credential-checks-21Wc7OqL.mjs → leaked-credential-checks-CSZd9hBQ.mjs} +1 -1
  115. package/dist/{live-BfrWKfq8.mjs → live-B6AsI_E5.mjs} +1 -1
  116. package/dist/{load-balancers-DMTsh-9q.mjs → load-balancers-gap5u4b1.mjs} +19 -7
  117. package/dist/local-CFsO9Tkg.mjs +2 -0
  118. package/dist/{local-CvzO-cQH.mjs → local-CgBhtmON.mjs} +1 -1
  119. package/dist/{local-runtime-DOpR_Tnc.mjs → local-runtime-CmlJ20uJ.mjs} +1 -1
  120. package/dist/{login-CVWkMh1L.mjs → login-BJHaTERg.mjs} +1 -1
  121. package/dist/login-BfuOf-Yi.mjs +2 -0
  122. package/dist/logpush-qhlxsioM.mjs +68 -0
  123. package/dist/{logs-BSyyNwso.mjs → logs-bI54CJ0w.mjs} +23 -7
  124. package/dist/{magic-network-monitoring-DRRvSrDP.mjs → magic-network-monitoring-CX3TaMTu.mjs} +1 -1
  125. package/dist/{magic-transit-BhP424T-.mjs → magic-transit-BwDyySHJ.mjs} +20 -20
  126. package/dist/{managed-defense-6l_B3hn_.mjs → managed-defense-CsBBkfeQ.mjs} +2 -2
  127. package/dist/{managed-transforms-D7FMBsnq.mjs → managed-transforms-CUC-uAbW.mjs} +1 -1
  128. package/dist/{mcp-BUOfMkBP.mjs → mcp-CyI0sDmL.mjs} +3 -3
  129. package/dist/{mesh-B1RrhAT1.mjs → mesh-Czr0UCP4.mjs} +2 -2
  130. package/dist/{migrate-BTU8AvlP.mjs → migrate-DKDWYrz2.mjs} +1 -1
  131. package/dist/{monetization-Da3ooFLC.mjs → monetization-NUgfDtSy.mjs} +7 -3
  132. package/dist/{network-CjhSzhMm.mjs → network-B42zrBic.mjs} +1 -1
  133. package/dist/{network-interconnects-DEQD6GM8.mjs → network-interconnects-DuIBe8fK.mjs} +4 -4
  134. package/dist/{o11y-DeNxXxcp.mjs → o11y-oEUpMC3O.mjs} +6 -6
  135. package/dist/{oauth-DdXkpU44.mjs → oauth-BLQ1-y3R.mjs} +1 -1
  136. package/dist/{oauth-Dnog5v-Q.mjs → oauth-BmSFLp_s.mjs} +1 -1
  137. package/dist/observability-BxhJQCgZ.mjs +4 -0
  138. package/dist/organization-CEnlXwrl.mjs +70 -0
  139. package/dist/{organizations-p8Mgo8A7.mjs → organizations-Dt86ToxE.mjs} +1 -1
  140. package/dist/{origin-post-quantum-encryption-Bwysyttf.mjs → origin-post-quantum-encryption-lX-uaJSL.mjs} +1 -1
  141. package/dist/package-CiRJBRHO.mjs +2 -0
  142. package/dist/{page-rules-D2eFbKWb.mjs → page-rules-J6LhwR-s.mjs} +1 -1
  143. package/dist/{pages-DYZDvWK6.mjs → pages-BksdnChs.mjs} +4 -4
  144. package/dist/{pay-per-crawl-CgPFv5HT.mjs → pay-per-crawl-BLcbHRoR.mjs} +1 -1
  145. package/dist/{pay-per-use-BIQrsrTy.mjs → pay-per-use-VatiU-Nt.mjs} +4 -2
  146. package/dist/{pipelines-D6pkhlpm.mjs → pipelines-B5AoB3f3.mjs} +5 -5
  147. package/dist/precursor-D3VH2MXT.mjs +4 -0
  148. package/dist/{previews-B1mqjXaJ.mjs → previews-DzJ85fsr.mjs} +1 -1
  149. package/dist/{progress-B-CVX0kn.mjs → progress-DLri-rA7.mjs} +1 -1
  150. package/dist/{prompt-DJF_Rs5S.mjs → prompt-D0dXwuME.mjs} +1 -1
  151. package/dist/{queues-DaqLO-UO.mjs → queues-BsAck4To.mjs} +5 -5
  152. package/dist/{r2-DDIU9JN3.mjs → r2-BYjdHDEZ.mjs} +38 -38
  153. package/dist/{radar-D59qCgld.mjs → radar-CvLtu-Vr.mjs} +1 -1
  154. package/dist/{raw-fetch-BrOxDN9k.mjs → raw-fetch-DQeDx1wT.mjs} +1 -1
  155. package/dist/{ready-DgE08svD.mjs → ready-gsGEaWLL.mjs} +1 -1
  156. package/dist/{realtime-DWjdrDzv.mjs → realtime-DiCEgFTC.mjs} +81 -79
  157. package/dist/{registrar-uYOU1U27.mjs → registrar-D4wdgWpo.mjs} +8 -8
  158. package/dist/{registrar-sandbox-uzs3eOKk.mjs → registrar-sandbox-B6yopzdG.mjs} +2 -2
  159. package/dist/{reporting-Dx2YTick.mjs → reporting-BiHgnT8L.mjs} +1 -1
  160. package/dist/{request-headers-DHzBX7dQ.mjs → request-headers-CoxHUNcB.mjs} +1 -1
  161. package/dist/{request-tracers-B49cBKkj.mjs → request-tracers-817HTytF.mjs} +1 -1
  162. package/dist/{resource-sharing-CIsLVAcK.mjs → resource-sharing-CW9xxtq5.mjs} +12 -12
  163. package/dist/{rules-CjgLSlUC.mjs → rules-CRhe_ca9.mjs} +1 -1
  164. package/dist/rulesets-CKyc-Xlx.mjs +42 -0
  165. package/dist/{rum-vPEpMS_h.mjs → rum-BfnWHW_d.mjs} +1 -1
  166. package/dist/{run-BZ6Fj3jQ.mjs → run-Ciw_GIrC.mjs} +1 -1
  167. package/dist/run-DD45EQTm.mjs +2 -0
  168. package/dist/{schema-cache-C_rvto6Y.mjs → schema-cache-BIo0Gi2H.mjs} +1 -1
  169. package/dist/schema-flags-DrqvwQNw.mjs +4 -0
  170. package/dist/{scim-BA7XbsSu.mjs → scim-C4iRWNYB.mjs} +1 -1
  171. package/dist/{secrets-store-MEUNt1Ph.mjs → secrets-store-DgtzZRze.mjs} +1 -1
  172. package/dist/security-insights-SlUGW3F_.mjs +62 -0
  173. package/dist/{security-txt-DikhnR2L.mjs → security-txt-C3YS0REz.mjs} +1 -1
  174. package/dist/{session-BOnam-Wv.mjs → session-D2yuwO4i.mjs} +1 -1
  175. package/dist/{shared-DmmWSObC.mjs → shared--uVkAAd7.mjs} +1 -1
  176. package/dist/{signed-url-C-24KbWB.mjs → signed-url-ClLk45_J.mjs} +1 -1
  177. package/dist/{smart-shield-DPqLMz7M.mjs → smart-shield-Dn95hqUH.mjs} +1 -1
  178. package/dist/{snippets-Bi3Uq1DF.mjs → snippets-BNUKOajz.mjs} +1 -1
  179. package/dist/{spawn-C3hzWVrJ.mjs → spawn-DuT4snxu.mjs} +1 -1
  180. package/dist/{spectrum-BaWKMoAl.mjs → spectrum-Cj0BMtg2.mjs} +3 -3
  181. package/dist/{speed-DShjlpAs.mjs → speed-BrVeZRyX.mjs} +1 -1
  182. package/dist/{sql-DCoFf15T.mjs → sql-BX1pBqj3.mjs} +2 -2
  183. package/dist/src-DPnUfK4c.mjs +131 -0
  184. package/dist/{ssl-C4nt4pJK.mjs → ssl-Bx4LCutF.mjs} +3 -3
  185. package/dist/{startup-profile-CFJ_Lu1c.mjs → startup-profile-DqaYNT0b.mjs} +1 -1
  186. package/dist/startup-profile-tZNb2HGz.mjs +2 -0
  187. package/dist/{state-DmjHXZat.mjs → state-BmzOLELo.mjs} +1 -1
  188. package/dist/state-Uwfrmw5I.mjs +2 -0
  189. package/dist/{stream-CpZbnSpH.mjs → stream-BRzr6yh0.mjs} +1 -1
  190. package/dist/{tags-BIjQ3Kjh.mjs → tags-xVzjZxdt.mjs} +11 -5
  191. package/dist/{telemetry-BDhqOpUw.mjs → telemetry-CJ9URio3.mjs} +1 -1
  192. package/dist/telemetry-Pt5GpCKD.mjs +2 -0
  193. package/dist/tenant-custom-nameservers-M7Fxqh2W.mjs +8 -0
  194. package/dist/{tunnels-CXAO2CeL.mjs → tunnels-DQVXKUKA.mjs} +3 -3
  195. package/dist/{turnstile-Ctm0rs0q.mjs → turnstile-B_Ugzgom.mjs} +1 -1
  196. package/dist/ui-FYultowZ.mjs +2 -0
  197. package/dist/{update-check-D_Wtw0_D.mjs → update-check-DHUo4FOJ.mjs} +1 -1
  198. package/dist/{update-check-Dc7cRFlx.mjs → update-check-DRr0eRhB.mjs} +1 -1
  199. package/dist/update-check-worker.mjs +1 -1
  200. package/dist/{url-normalization-DOfc2Q7a.mjs → url-normalization-CZRQH_pJ.mjs} +1 -1
  201. package/dist/{url-scanner-J8M3X2tR.mjs → url-scanner-BH4PLy16.mjs} +1 -1
  202. package/dist/{user-BaF0qvvO.mjs → user-Bn82Qw0Y.mjs} +10 -12
  203. package/dist/{vectorize-D5qiggZU.mjs → vectorize-DoVVz_sh.mjs} +1 -1
  204. package/dist/version-Zr2oF8mY.mjs +2 -0
  205. package/dist/{waiting-rooms-BdmAq7ul.mjs → waiting-rooms-QUW131o3.mjs} +5 -3
  206. package/dist/{web-assets-BySw_Tme.mjs → web-assets-CgQXsp8m.mjs} +2 -2
  207. package/dist/{web3-BKkKf1RF.mjs → web3-TY9s6Swn.mjs} +3 -3
  208. package/dist/workers-B3uJqJKc.mjs +39 -0
  209. package/dist/{workers-builds-CVJ4FqzB.mjs → workers-builds-BgGY0IGk.mjs} +2 -2
  210. package/dist/{workers-for-platforms-mzdtmr6r.mjs → workers-for-platforms-5RkV9MVp.mjs} +2 -2
  211. package/dist/workers-vpc-Bt4OQbwM.mjs +12 -0
  212. package/dist/{workflows-Cr957c4U.mjs → workflows-6m85DdqF.mjs} +7 -7
  213. package/dist/{wrangler-migration-DZV7-4Fp.mjs → wrangler-migration-BbmGOu8l.mjs} +3 -3
  214. package/dist/{zaraz-C8__FhOh.mjs → zaraz-8WSJ7l0L.mjs} +2 -2
  215. package/dist/{zero-trust-BVCvQJ4e.mjs → zero-trust-DK0cqDZv.mjs} +483 -405
  216. package/dist/{zones-BzyjOT10.mjs → zones-DTAcguf6.mjs} +3 -3
  217. package/package.json +14 -14
  218. package/dist/abuse-reports-zPrsxbRz.mjs +0 -24
  219. package/dist/ai-search-QOenIzDL.mjs +0 -74
  220. package/dist/auth-Czzy5Rs_.mjs +0 -2
  221. package/dist/billing-BrLJqlOf.mjs +0 -22
  222. package/dist/bot-management-BSBVuKc0.mjs +0 -9
  223. package/dist/browser-run-BSVANGzU.mjs +0 -40
  224. package/dist/build-CPKxZ3kL.mjs +0 -2
  225. package/dist/chunk-3PJ54H4K-CY8EY_n2.mjs +0 -363
  226. package/dist/containers-D4sa-Eoy.mjs +0 -380
  227. package/dist/custom-csrs-Dl_daAbX.mjs +0 -10
  228. package/dist/custom-nameservers-Bw2P7F_W.mjs +0 -8
  229. package/dist/custom-pages-CJ7ecSX6.mjs +0 -20
  230. package/dist/d1-BsWI546w.mjs +0 -89
  231. package/dist/email-domains-1Nx60ETD.mjs +0 -12
  232. package/dist/iam-DuZenYtc.mjs +0 -48
  233. package/dist/k2-Cj1ORHul.mjs +0 -10
  234. package/dist/local-CWTti4ot.mjs +0 -2
  235. package/dist/login-Djz5mvHJ.mjs +0 -2
  236. package/dist/logpush-OMhp7VgE.mjs +0 -44
  237. package/dist/magic-cloud-networking-DD29yMnE.mjs +0 -68
  238. package/dist/oauth-clients-UnbMcHkx.mjs +0 -14
  239. package/dist/oauth-scopes-DbtnZVO4.mjs +0 -4
  240. package/dist/organization-IsxVyWol.mjs +0 -73
  241. package/dist/package-BOE_De2L.mjs +0 -2
  242. package/dist/precursor-B35P8h6h.mjs +0 -4
  243. package/dist/rulesets-C7_aZA7m.mjs +0 -34
  244. package/dist/run-D4-K_cbQ.mjs +0 -2
  245. package/dist/schema-flags-Cr6kleor.mjs +0 -4
  246. package/dist/security-insights-ZKtey62s.mjs +0 -40
  247. package/dist/src-jyCTFHcS.mjs +0 -131
  248. package/dist/startup-profile-D_Qjgca1.mjs +0 -2
  249. package/dist/state-C7lNNN31.mjs +0 -2
  250. package/dist/telemetry-BZdRnr26.mjs +0 -2
  251. package/dist/tenant-CqYoylyU.mjs +0 -10
  252. package/dist/tenant-custom-nameservers-DDzzdyY3.mjs +0 -8
  253. package/dist/ui-BUCBQ3Sq.mjs +0 -2
  254. package/dist/version-DNcdABcr.mjs +0 -2
  255. package/dist/workers-TS0oQ-XH.mjs +0 -39
  256. package/dist/workers-vpc-xB1hHFPd.mjs +0 -12
@@ -1,74 +0,0 @@
1
- #!/usr/bin/env node
2
- import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CvzO-cQH.mjs";import{i as n,n as r}from"./auth-D5Yj9eYU.mjs";import{a as i,t as a}from"./context-BvLXzoMs.mjs";import{t as o}from"./output-BJEgbI0G.mjs";import{t as s}from"./dry-run-gy0Hl9xo.mjs";import{t as c}from"./progress-B-CVX0kn.mjs";import{t as l}from"./run-BZ6Fj3jQ.mjs";import"./telemetry-BZdRnr26.mjs";import{a as u,n as d,r as f,s as p,t as m}from"./body-parser-BKcZS9iJ.mjs";import{n as h,t as g}from"./input-validation-D7z60HJH.mjs";import{a as _,i as v,n as y}from"./prompt-DJF_Rs5S.mjs";import{n as ee,t as te}from"./raw-fetch-BrOxDN9k.mjs";function ne(e){return e.usage(`$0 ai-search chat-completions <instance-id>
3
-
4
- Performs a chat completion request against an AI Search instance, using indexed content as context for generating responses.`).positional(`instance-id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`namespace`,{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`]}).coerce(`ai-search-options-cache-cache-threshold`,e=>h(e,`ai-search-options-cache-cache-threshold`,`text`)).option(`ai-search-options-cache-enabled`,{type:`boolean`,description:`The ai_search_options.cache.enabled field`}).option(`ai-search-options-custom-metadata`,{type:`string`,description:`Metadata added to AI Gateway logs for requests this operation triggers. Accepts up to 2 string, number, or boolean entries. Reserved keys: 'ai-search', 'task', 'origin', and any key beginning with 'cf.'. Provide as a JSON object or @path/to/file.json.`}).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-boost-by`,{type:`string`,description:`Metadata fields to boost search results by. Overrides the instance-level boost_by config. Direction defaults to 'asc' for numeric/datetime fields, 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined custom_metadata field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`ai-search-options-retrieval-context-expansion`,{type:`number`,description:`The ai_search_options.retrieval.context_expansion field`}).option(`ai-search-options-retrieval-filters`,{type:`string`,description:`The ai_search_options.retrieval.filters field. Provide as a JSON object or @path/to/file.json.`}).option(`ai-search-options-retrieval-fusion-method`,{type:`string`,description:`The ai_search_options.retrieval.fusion_method field`,choices:[`max`,`rrf`]}).coerce(`ai-search-options-retrieval-fusion-method`,e=>h(e,`ai-search-options-retrieval-fusion-method`,`text`)).option(`ai-search-options-retrieval-keyword-match-mode`,{type:`string`,description:`Controls which documents become candidates for BM25 scoring. 'and' restricts candidates to documents containing all query terms; 'or' includes any document containing at least one term and ranks results according to BM25 relevance. When omitted, falls back to the instance-level retrieval_options.keyword_match_mode, then to 'and'.`,choices:[`and`,`or`]}).coerce(`ai-search-options-retrieval-keyword-match-mode`,e=>h(e,`ai-search-options-retrieval-keyword-match-mode`,`text`)).option(`ai-search-options-retrieval-match-threshold`,{type:`number`,description:`Minimum similarity score a chunk must reach to be returned. When omitted, falls back to the instance-level score_threshold, then to 0.4.`}).option(`ai-search-options-retrieval-max-num-results`,{type:`number`,description:`Maximum number of results to return. When omitted, falls back to the instance-level max_num_results, then to 10.`}).option(`ai-search-options-retrieval-retrieval-type`,{type:`string`,description:`The ai_search_options.retrieval.retrieval_type field`,choices:[`vector`,`keyword`,`hybrid`]}).coerce(`ai-search-options-retrieval-retrieval-type`,e=>h(e,`ai-search-options-retrieval-retrieval-type`,`text`)).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 re={command:`chat-completions <instance-id>`,describe:`Chat Completions`,builder:ne,handler:async e=>l({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`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search chat-completions`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}/chat/completions`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({ai_search_options:{cache:{cache_threshold:e[`ai-search-options-cache-cache-threshold`],enabled:e[`ai-search-options-cache-enabled`]},custom_metadata:f(e[`ai-search-options-custom-metadata`],`ai-search-options-custom-metadata`),query_rewrite:{enabled:e[`ai-search-options-query-rewrite-enabled`],model:h(e[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`),rewrite_prompt:h(e[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)},reranking:{enabled:e[`ai-search-options-reranking-enabled`],match_threshold:e[`ai-search-options-reranking-match-threshold`],model:h(e[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)},retrieval:{boost_by:u(e[`ai-search-options-retrieval-boost-by`],`ai-search-options-retrieval-boost-by`),context_expansion:e[`ai-search-options-retrieval-context-expansion`],filters:f(e[`ai-search-options-retrieval-filters`],`ai-search-options-retrieval-filters`),fusion_method:e[`ai-search-options-retrieval-fusion-method`],keyword_match_mode:e[`ai-search-options-retrieval-keyword-match-mode`],match_threshold:e[`ai-search-options-retrieval-match-threshold`],max_num_results:e[`ai-search-options-retrieval-max-num-results`],retrieval_type:e[`ai-search-options-retrieval-retrieval-type`],return_on_failure:e[`ai-search-options-retrieval-return-on-failure`]}},messages:u(e.messages,`messages`),model:h(e.model,`model`,`text`),stream:e.stream},[[`ai_search_options`,`custom_metadata`],[`ai_search_options`,`retrieval`,`filters`]]):d(e.body)});return}let l=await r(e),g=e.local?t:await a();if(e.accountId=g,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n(l,`POST`,`/accounts/${g}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/chat/completions`,{body:t}));o(r,{successLabel:`Created`});return}if(e.messages===void 0)throw Error(`--messages is required (or pass --body with this field set).`);let _={};e[`ai-search-options-cache-cache-threshold`]!==void 0&&p(_,[`ai_search_options`,`cache`,`cache_threshold`],e[`ai-search-options-cache-cache-threshold`]),e[`ai-search-options-cache-enabled`]!==void 0&&p(_,[`ai_search_options`,`cache`,`enabled`],e[`ai-search-options-cache-enabled`]),e[`ai-search-options-custom-metadata`]!==void 0&&p(_,[`ai_search_options`,`custom_metadata`],f(e[`ai-search-options-custom-metadata`],`ai-search-options-custom-metadata`)),e[`ai-search-options-query-rewrite-enabled`]!==void 0&&p(_,[`ai_search_options`,`query_rewrite`,`enabled`],e[`ai-search-options-query-rewrite-enabled`]),e[`ai-search-options-query-rewrite-model`]!==void 0&&p(_,[`ai_search_options`,`query_rewrite`,`model`],h(e[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`)),e[`ai-search-options-query-rewrite-rewrite-prompt`]!==void 0&&p(_,[`ai_search_options`,`query_rewrite`,`rewrite_prompt`],h(e[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)),e[`ai-search-options-reranking-enabled`]!==void 0&&p(_,[`ai_search_options`,`reranking`,`enabled`],e[`ai-search-options-reranking-enabled`]),e[`ai-search-options-reranking-match-threshold`]!==void 0&&p(_,[`ai_search_options`,`reranking`,`match_threshold`],e[`ai-search-options-reranking-match-threshold`]),e[`ai-search-options-reranking-model`]!==void 0&&p(_,[`ai_search_options`,`reranking`,`model`],h(e[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)),e[`ai-search-options-retrieval-boost-by`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`boost_by`],u(e[`ai-search-options-retrieval-boost-by`],`ai-search-options-retrieval-boost-by`)),e[`ai-search-options-retrieval-context-expansion`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`context_expansion`],e[`ai-search-options-retrieval-context-expansion`]),e[`ai-search-options-retrieval-filters`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`filters`],f(e[`ai-search-options-retrieval-filters`],`ai-search-options-retrieval-filters`)),e[`ai-search-options-retrieval-fusion-method`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`fusion_method`],e[`ai-search-options-retrieval-fusion-method`]),e[`ai-search-options-retrieval-keyword-match-mode`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`keyword_match_mode`],e[`ai-search-options-retrieval-keyword-match-mode`]),e[`ai-search-options-retrieval-match-threshold`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`match_threshold`],e[`ai-search-options-retrieval-match-threshold`]),e[`ai-search-options-retrieval-max-num-results`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`max_num_results`],e[`ai-search-options-retrieval-max-num-results`]),e[`ai-search-options-retrieval-retrieval-type`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`retrieval_type`],e[`ai-search-options-retrieval-retrieval-type`]),e[`ai-search-options-retrieval-return-on-failure`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`return_on_failure`],e[`ai-search-options-retrieval-return-on-failure`]),e.messages!==void 0&&p(_,[`messages`],u(e.messages,`messages`)),e.model!==void 0&&p(_,[`model`],h(e.model,`model`,`text`)),e.stream!==void 0&&p(_,[`stream`],e.stream);let v=await c(`Creating`,async()=>n(l,`POST`,`/accounts/${g}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/chat/completions`,{body:_}));o(v,{successLabel:`Created`})})};var b={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-search/namespaces/${t.namespace}/instances`,body:`json`,errors:{400:`BadRequestError`,403:`ForbiddenError`,409:`ConflictError`,503:`ServiceUnavailableError`}};function x(e){return e.usage(`$0 ai-search create <namespace> <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 any other source infers r2; r2 sources must name an existing bucket. A missing or blank source without a type creates a managed upload-only instance.`).positional(`namespace`,{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`}).coerce(`cache-threshold`,e=>h(e,`cache-threshold`,`text`)).option(`cache-ttl`,{type:`number`,description:`Cache entry TTL in seconds. Allowed values: 600 (10min), 1800 (30min), 3600 (1h), 7200 (2h), 21600 (6h), 43200 (12h), 86400 (24h), 172800 (48h), 259200 (72h), 518400 (6d).`,default:172800}).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`}).coerce(`fusion-method`,e=>h(e,`fusion-method`,`text`)).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.`}).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`]}).coerce(`indexing-options-keyword-tokenizer`,e=>h(e,`indexing-options-keyword-tokenizer`,`text`)).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-created-from-emdash-plugin-type`,{type:`string`,description:`The metadata.created_from_emdash_plugin.type field`,choices:[`native`,`rest`]}).coerce(`metadata-created-from-emdash-plugin-type`,e=>h(e,`metadata-created-from-emdash-plugin-type`,`text`)).option(`metadata-created-from-emdash-plugin-version`,{type:`string`,description:`The metadata.created_from_emdash_plugin.version 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`]}).coerce(`public-endpoint-params-rate-limit-technique`,e=>h(e,`public-endpoint-params-rate-limit-technique`,`text`)).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-boost-by`,{type:`string`,description:`Metadata fields to boost search results by. Each entry specifies a metadata field and an optional direction. Direction defaults to 'asc' for numeric/datetime fields and 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined custom_metadata field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`retrieval-options-keyword-match-mode`,{type:`string`,description:`Controls which documents become candidates for BM25 scoring. 'and' restricts candidates to documents containing all query terms; 'or' includes any document containing at least one term and ranks results according to BM25 relevance. When omitted on an update, the existing stored value stays unchanged; when never set, search falls back to 'and'.`,choices:[`and`,`or`]}).coerce(`retrieval-options-keyword-match-mode`,e=>h(e,`retrieval-options-keyword-match-mode`,`text`)).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:`Minimum similarity score a chunk must reach to be returned. Defaults to 0.4.`}).option(`source`,{type:`string`,description:`R2 bucket name or HTTP(S) root website URL to index. When type is omitted, the source determines it.`}).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 have a limit of 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 have a limit of 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` because discover crawls only cover 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`]}).coerce(`source-params-web-crawler-discover-options-source`,e=>h(e,`source-params-web-crawler-discover-options-source`,`text`)).option(`source-params-web-crawler-parse-options-content-selector`,{type:`string`,description:`List of path-to-selector mappings for extracting specific content from crawled pages. Each entry pairs a URL glob pattern with a CSS selector. The first matching path wins. The crawler stores and indexes only the matched HTML fragment. Omit the field to disable content selection; the API rejects empty arrays. Provide as a JSON array of objects or @path/to/file.json.`}).option(`source-params-web-crawler-parse-options-include-headers`,{type:`string`,description:`Up to 5 custom HTTP headers sent with each crawl request. Names must use RFC-7230 token characters, excluding spaces, colons, and control characters. Values must use HTAB and printable ASCII only, excluding CR and LF. Provide as a JSON object or @path/to/file.json.`}).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 the crawler finds URLs. 'sitemap' reads XML sitemaps; 'discover' follows links recursively and requires the source to belong to a Verified zone on this account.`,choices:[`sitemap`,`discover`]}).coerce(`source-params-web-crawler-parse-type`,e=>h(e,`source-params-web-crawler-parse-type`,`text`)).option(`sync-interval`,{type:`number`,description:`Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800 (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h). Defaults to 21600 (6h); instances crawling a domain outside the account may be set to 86400.`}).option(`token-id`,{type:`string`,description:`The token_id field`}).option(`type`,{type:`string`,description:`Data source type: r2 or web-crawler.`,choices:[`r2`,`web-crawler`]}).coerce(`type`,e=>h(e,`type`,`text`)).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}).check(e=>{if([`metadata-created-from-aisearch-wizard`,`metadata-created-from-emdash-plugin-type`,`metadata-created-from-emdash-plugin-version`,`metadata-worker-domain`].some(t=>e[t]!==void 0)){let t=[`metadata-created-from-emdash-plugin-type`,`metadata-created-from-emdash-plugin-version`].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 --metadata-* flag is set`)}return!0})}const S={command:`create <namespace> <id>`,describe:`Create an AI Search instance.`,builder:x,handler:async e=>l({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.metadata-created-from-emdash-plugin-type.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(`.`)}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances`,pathParams:{namespace:String(e.namespace??``)},bodyKind:`json`,body:e.body===void 0?m({ai_gateway_id:h(e[`ai-gateway-id`],`ai-gateway-id`,`text`),ai_search_model:h(e[`ai-search-model`],`ai-search-model`,`text`),cache:e.cache,cache_threshold:e[`cache-threshold`],cache_ttl:e[`cache-ttl`],chunk:e.chunk,chunk_overlap:e[`chunk-overlap`],chunk_size:e[`chunk-size`],custom_metadata:u(e[`custom-metadata`],`custom-metadata`),embedding_model:h(e[`embedding-model`],`embedding-model`,`text`),fusion_method:e[`fusion-method`],hybrid_search_enabled:e[`hybrid-search-enabled`],index_method:{keyword:e[`index-method-keyword`],vector:e[`index-method-vector`]},indexing_options:{keyword_tokenizer:e[`indexing-options-keyword-tokenizer`],use_ocr:e[`indexing-options-use-ocr`]},max_num_results:e[`max-num-results`],metadata:{created_from_aisearch_wizard:e[`metadata-created-from-aisearch-wizard`],created_from_emdash_plugin:{type:e[`metadata-created-from-emdash-plugin-type`],version:h(e[`metadata-created-from-emdash-plugin-version`],`metadata-created-from-emdash-plugin-version`,`text`)},worker_domain:h(e[`metadata-worker-domain`],`metadata-worker-domain`,`text`)},public_endpoint_params:{authorized_hosts:e[`public-endpoint-params-authorized-hosts`],chat_completions_endpoint:{disabled:e[`public-endpoint-params-chat-completions-endpoint-disabled`]},custom_domains:e[`public-endpoint-params-custom-domains`],default_domain_enabled:e[`public-endpoint-params-default-domain-enabled`],enabled:e[`public-endpoint-params-enabled`],mcp:{description:h(e[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`),disabled:e[`public-endpoint-params-mcp-disabled`]},rate_limit:{period_ms:e[`public-endpoint-params-rate-limit-period-ms`],requests:e[`public-endpoint-params-rate-limit-requests`],technique:e[`public-endpoint-params-rate-limit-technique`]},search_endpoint:{disabled:e[`public-endpoint-params-search-endpoint-disabled`]}},reranking:e.reranking,reranking_model:h(e[`reranking-model`],`reranking-model`,`text`),retrieval_options:{boost_by:u(e[`retrieval-options-boost-by`],`retrieval-options-boost-by`),keyword_match_mode:e[`retrieval-options-keyword-match-mode`]},rewrite_model:h(e[`rewrite-model`],`rewrite-model`,`text`),rewrite_query:e[`rewrite-query`],score_threshold:e[`score-threshold`],source:h(e.source,`source`,`text`),source_params:{exclude_items:e[`source-params-exclude-items`],include_items:e[`source-params-include-items`],prefix:h(e[`source-params-prefix`],`source-params-prefix`,`text`),r2_jurisdiction:h(e[`source-params-r2-jurisdiction`],`source-params-r2-jurisdiction`,`text`),web_crawler:{discover_options:{depth:e[`source-params-web-crawler-discover-options-depth`],include_external_links:e[`source-params-web-crawler-discover-options-include-external-links`],include_subdomains:e[`source-params-web-crawler-discover-options-include-subdomains`],limit:e[`source-params-web-crawler-discover-options-limit`],max_age:e[`source-params-web-crawler-discover-options-max-age`],source:e[`source-params-web-crawler-discover-options-source`]},parse_options:{content_selector:u(e[`source-params-web-crawler-parse-options-content-selector`],`source-params-web-crawler-parse-options-content-selector`),include_headers:f(e[`source-params-web-crawler-parse-options-include-headers`],`source-params-web-crawler-parse-options-include-headers`),include_images:e[`source-params-web-crawler-parse-options-include-images`],specific_sitemaps:e[`source-params-web-crawler-parse-options-specific-sitemaps`],use_browser_rendering:e[`source-params-web-crawler-parse-options-use-browser-rendering`]},parse_type:e[`source-params-web-crawler-parse-type`]}},sync_interval:e[`sync-interval`],token_id:h(e[`token-id`],`token-id`,`text`),type:e.type,id:e.id},[[`source_params`,`web_crawler`,`parse_options`,`include_headers`]]):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(b,{body:t,account_id:l,namespace:e.namespace}));o(r,{successLabel:`Created`});return}let p=m({ai_gateway_id:h(e[`ai-gateway-id`],`ai-gateway-id`,`text`),ai_search_model:h(e[`ai-search-model`],`ai-search-model`,`text`),cache:e.cache,cache_threshold:e[`cache-threshold`],cache_ttl:e[`cache-ttl`],chunk:e.chunk,chunk_overlap:e[`chunk-overlap`],chunk_size:e[`chunk-size`],custom_metadata:u(e[`custom-metadata`],`custom-metadata`),embedding_model:h(e[`embedding-model`],`embedding-model`,`text`),fusion_method:e[`fusion-method`],hybrid_search_enabled:e[`hybrid-search-enabled`],index_method:{keyword:e[`index-method-keyword`],vector:e[`index-method-vector`]},indexing_options:{keyword_tokenizer:e[`indexing-options-keyword-tokenizer`],use_ocr:e[`indexing-options-use-ocr`]},max_num_results:e[`max-num-results`],metadata:{created_from_aisearch_wizard:e[`metadata-created-from-aisearch-wizard`],created_from_emdash_plugin:{type:e[`metadata-created-from-emdash-plugin-type`],version:h(e[`metadata-created-from-emdash-plugin-version`],`metadata-created-from-emdash-plugin-version`,`text`)},worker_domain:h(e[`metadata-worker-domain`],`metadata-worker-domain`,`text`)},public_endpoint_params:{authorized_hosts:e[`public-endpoint-params-authorized-hosts`],chat_completions_endpoint:{disabled:e[`public-endpoint-params-chat-completions-endpoint-disabled`]},custom_domains:e[`public-endpoint-params-custom-domains`],default_domain_enabled:e[`public-endpoint-params-default-domain-enabled`],enabled:e[`public-endpoint-params-enabled`],mcp:{description:h(e[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`),disabled:e[`public-endpoint-params-mcp-disabled`]},rate_limit:{period_ms:e[`public-endpoint-params-rate-limit-period-ms`],requests:e[`public-endpoint-params-rate-limit-requests`],technique:e[`public-endpoint-params-rate-limit-technique`]},search_endpoint:{disabled:e[`public-endpoint-params-search-endpoint-disabled`]}},reranking:e.reranking,reranking_model:h(e[`reranking-model`],`reranking-model`,`text`),retrieval_options:{boost_by:u(e[`retrieval-options-boost-by`],`retrieval-options-boost-by`),keyword_match_mode:e[`retrieval-options-keyword-match-mode`]},rewrite_model:h(e[`rewrite-model`],`rewrite-model`,`text`),rewrite_query:e[`rewrite-query`],score_threshold:e[`score-threshold`],source:h(e.source,`source`,`text`),source_params:{exclude_items:e[`source-params-exclude-items`],include_items:e[`source-params-include-items`],prefix:h(e[`source-params-prefix`],`source-params-prefix`,`text`),r2_jurisdiction:h(e[`source-params-r2-jurisdiction`],`source-params-r2-jurisdiction`,`text`),web_crawler:{discover_options:{depth:e[`source-params-web-crawler-discover-options-depth`],include_external_links:e[`source-params-web-crawler-discover-options-include-external-links`],include_subdomains:e[`source-params-web-crawler-discover-options-include-subdomains`],limit:e[`source-params-web-crawler-discover-options-limit`],max_age:e[`source-params-web-crawler-discover-options-max-age`],source:e[`source-params-web-crawler-discover-options-source`]},parse_options:{content_selector:u(e[`source-params-web-crawler-parse-options-content-selector`],`source-params-web-crawler-parse-options-content-selector`),include_headers:f(e[`source-params-web-crawler-parse-options-include-headers`],`source-params-web-crawler-parse-options-include-headers`),include_images:e[`source-params-web-crawler-parse-options-include-images`],specific_sitemaps:e[`source-params-web-crawler-parse-options-specific-sitemaps`],use_browser_rendering:e[`source-params-web-crawler-parse-options-use-browser-rendering`]},parse_type:e[`source-params-web-crawler-parse-type`]}},sync_interval:e[`sync-interval`],token_id:h(e[`token-id`],`token-id`,`text`),type:e.type,id:e.id},[[`source_params`,`web_crawler`,`parse_options`,`include_headers`]]),g=await c(`Creating`,async()=>n.send(b,{body:p,account_id:l,namespace:e.namespace}));o(g,{successLabel:`Created`})})};function C(e){return e.usage(`$0 ai-search delete <instance-id>
7
-
8
- Deletes an AI Search instance and all its indexed data permanently.`).positional(`instance-id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`namespace`,{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 w={command:`delete <instance-id>`,describe:`Delete an AI Search instance.`,builder:C,handler:async e=>l({command:`ai-search delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``)},bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();if(e.accountId=u,!await y({force:!!e.force,message:`This operation permanently deletes the AI Search instance and all its indexed data.`}))return;let d=await c(`Deleting`,async()=>n(l,`DELETE`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}`));o(d,{successLabel:`Deleted`})})};function T(e){return e.usage(`$0 ai-search get <instance-id>
9
-
10
- Retrieve the configuration and status of an AI Search instance.`).positional(`instance-id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`namespace`,{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 E={command:`get <instance-id>`,describe:`Get an AI Search instance.`,builder:T,handler:async e=>l({command:`ai-search get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``)},bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>n(l,`GET`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}`));o(d,{successLabel:`Loaded`})})};function D(e){return e.usage(`$0 ai-search items chunks <item-id>
11
-
12
- 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(`namespace`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`instance-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 O={command:`chunks <item-id>`,describe:`List Item Chunks.`,builder:D,handler:async e=>l({command:`ai-search items chunks`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={limit:e.limit,offset:e.offset};if(e.dryRun){let t=await i();s({command:`cf ai-search items chunks`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}/items/${e[`item-id`]==null?`<item-id>`:encodeURIComponent(String(e[`item-id`]))}/chunks`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``),"item-id":String(e[`item-id`]??``)},query:l,bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/items/${encodeURIComponent(String(e[`item-id`]))}/chunks`,{query:l}));o(f,{successLabel:`Loaded`})})};function k(e){return e.usage(`$0 ai-search items delete <item-id>
13
-
14
- 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(`namespace`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`instance-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 A={command:`delete <item-id>`,describe:`Delete Item.`,builder:k,handler:async e=>l({command:`ai-search items delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search items delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}/items/${e[`item-id`]==null?`<item-id>`:encodeURIComponent(String(e[`item-id`]))}`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``),"item-id":String(e[`item-id`]??``)},bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();if(e.accountId=u,!await y({force:!!e.force}))return;let d=await c(`Deleting`,async()=>n(l,`DELETE`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/items/${encodeURIComponent(String(e[`item-id`]))}`));o(d,{successLabel:`Deleted`})})};function j(e){return e.usage(`$0 ai-search items download <item-id>
15
-
16
- 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(`namespace`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`instance-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 M={command:`download <item-id>`,describe:`Download Item Content.`,builder:j,handler:async e=>l({command:`ai-search items download`,classification:{safeFlags:[`dry-run`,`text`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search items download`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}/items/${e[`item-id`]==null?`<item-id>`:encodeURIComponent(String(e[`item-id`]))}/download`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``),"item-id":String(e[`item-id`]??``)},bodyKind:`none`});return}await r(e);let n=e.local?t:await a();e.accountId=n;let o=await c(`Loading`,async()=>te(`/accounts/${n}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/items/${encodeURIComponent(String(e[`item-id`]))}/download`,{method:`GET`,local:e.local===!0,persistTo:e.persistTo}));ee(e.text===!0?o.toString(`utf-8`):o)})};function N(e){return e.usage(`$0 ai-search items get <item-id>
17
-
18
- Retrieves a specific indexed item from an AI Search instance.`).positional(`item-id`,{type:`string`,description:`Indexed item ID.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`instance-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 P={command:`get <item-id>`,describe:`Get Item.`,builder:N,handler:async e=>l({command:`ai-search items get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search items get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}/items/${e[`item-id`]==null?`<item-id>`:encodeURIComponent(String(e[`item-id`]))}`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``),"item-id":String(e[`item-id`]??``)},bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>n(l,`GET`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/items/${encodeURIComponent(String(e[`item-id`]))}`));o(d,{successLabel:`Loaded`})})};function F(e){return e.usage(`$0 ai-search items list
19
-
20
- Lists indexed items in an AI Search instance.`).option(`namespace`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`instance-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 items according to status priority, then last_seen_at. "modified_at" sorts items according to 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:`Return only items with this 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:`Return only the item with this unique ID. Returns at most one item.`}).option(`key`,{type:`string`,description:"Return only items with this exact key (object key / filename). Each key is unique within a 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 I={command:`list`,describe:`Items List.`,builder:F,handler:async e=>l({command:`ai-search items list`,classification:{safeFlags:[`sort-by`,`status`,`dry-run`]}},e,async()=>{let l={page:e.page,per_page:e[`per-page`],search:e.search,sort_by:e[`sort-by`],status:e.status,source:e.source,metadata_filter:e[`metadata-filter`],item_id:e[`item-id`],key:e.key};if(e.dryRun){let t=await i();s({command:`cf ai-search items list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}/items`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``)},query:l,bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/items`,{query:l}));o(f,{successLabel:`Loaded`})})};function L(e){return e.usage(`$0 ai-search items logs <item-id>
21
-
22
- Lists processing logs for a specific item in an AI Search instance.`).positional(`item-id`,{type:`string`,description:`Indexed item ID.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`instance-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 R={command:`logs <item-id>`,describe:`Item Logs.`,builder:L,handler:async e=>l({command:`ai-search items logs`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={limit:e.limit,cursor:e.cursor};if(e.dryRun){let t=await i();s({command:`cf ai-search items logs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}/items/${e[`item-id`]==null?`<item-id>`:encodeURIComponent(String(e[`item-id`]))}/logs`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``),"item-id":String(e[`item-id`]??``)},query:l,bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/items/${encodeURIComponent(String(e[`item-id`]))}/logs`,{query:l}));o(f,{successLabel:`Loaded`})})};function z(e){return e.usage(`$0 ai-search items sync <item-id>
23
-
24
- Synchronizes an item to an AI Search instance index.`).positional(`item-id`,{type:`string`,description:`Indexed item ID.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`instance-id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`next-action`,{type:`string`,description:`The next_action field`,choices:[`INDEX`]}).coerce(`next-action`,e=>h(e,`next-action`,`text`)).option(`wait-for-completion`,{type:`boolean`,description:`Wait for indexing before responding. After processing, vector-indexed instances use any time remaining in a 25s wait budget to confirm Vectorize ingestion. Processing itself continues uninterrupted and can exceed that budget. If confirmation times out, the response returns the current item state and background indexing continues. 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 B={command:`sync <item-id>`,describe:`Sync Item.`,builder:z,handler:async e=>l({command:`ai-search items sync`,classification:{safeFlags:[`next-action`,`wait-for-completion`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search items sync`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}/items/${e[`item-id`]==null?`<item-id>`:encodeURIComponent(String(e[`item-id`]))}`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``),"item-id":String(e[`item-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({next_action:e[`next-action`],wait_for_completion:e[`wait-for-completion`]}):d(e.body)});return}let l=await r(e),u=e.local?t:await a();if(e.accountId=u,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(l,`PATCH`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/items/${encodeURIComponent(String(e[`item-id`]))}`,{body:t}));o(r,{successLabel:`Updated`});return}e[`next-action`]===void 0&&(e[`next-action`]=await v(`next-action`,`The next_action field`,[`INDEX`]));let f={};e[`next-action`]!==void 0&&p(f,[`next_action`],e[`next-action`]),e[`wait-for-completion`]!==void 0&&p(f,[`wait_for_completion`],e[`wait-for-completion`]);let h=await c(`Updating`,async()=>n(l,`PATCH`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/items/${encodeURIComponent(String(e[`item-id`]))}`,{body:f}));o(h,{successLabel:`Updated`})})};function V(e){return e.usage(`$0 ai-search items upload <instance-id>
25
-
26
- Uploads a file to a managed AI Search instance via multipart/form-data.`).positional(`instance-id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`namespace`,{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 before responding. After processing, vector-indexed instances use any time remaining in a 25s wait budget to confirm Vectorize ingestion. Processing itself continues uninterrupted and can exceed that budget. If confirmation times out, the response returns the current item state and background indexing continues. Defaults to false.`})}const H={command:`upload <instance-id>`,describe:`Upload Item.`,builder:V,handler:async e=>l({command:`ai-search items upload`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search items upload`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}/items`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``)},bodyKind:`multipart`,body:{body:e.body,file:e.file,metadata:e.metadata,"wait-for-completion":e[`wait-for-completion`]}});return}let l=await r(e),u=e.local?t:await a();if(e.accountId=u,e.file!==void 0||e.body!==void 0||e.metadata!==void 0||e[`wait-for-completion`]!==void 0){let t=new FormData;if(e.file){let n=g(e.file);t.append(`file`,new Blob([n]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&t.append(`file`,e.body);e.metadata!==void 0&&t.append(`metadata`,String(h(e.metadata,`metadata`,`text`)??``)),e[`wait-for-completion`]!==void 0&&t.append(`wait_for_completion`,String(e[`wait-for-completion`]));let r=await c(`Creating`,async()=>n(l,`POST`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/items`,{body:t}));o(r,{successLabel:`Created`})}else if(e.body){let t=h(e.body,`body`,`binary`),r=await c(`Creating`,async()=>n(l,`POST`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/items`,{body:t,headers:{"Content-Type":`multipart/form-data`}}));o(r,{successLabel:`Created`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function U(e){return e.usage(`$0 ai-search items upsert <instance-id>
27
-
28
- Creates or updates an indexed item in an AI Search instance.`).positional(`instance-id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`namespace`,{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`]}).coerce(`next-action`,e=>h(e,`next-action`,`text`)).option(`wait-for-completion`,{type:`boolean`,description:`Wait for indexing before responding. After processing, vector-indexed instances use any time remaining in a 25s wait budget to confirm Vectorize ingestion. Processing itself continues uninterrupted and can exceed that budget. If confirmation times out, the response returns the current item state and background indexing continues. 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 W={command:`upsert <instance-id>`,describe:`Create or Update Item.`,builder:U,handler:async e=>l({command:`ai-search items upsert`,classification:{safeFlags:[`next-action`,`wait-for-completion`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search items upsert`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}/items`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({key:h(e.key,`key`,`text`),next_action:e[`next-action`],wait_for_completion:e[`wait-for-completion`]}):d(e.body)});return}let l=await r(e),u=e.local?t:await a();if(e.accountId=u,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(l,`PUT`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/items`,{body:t}));o(r,{successLabel:`Updated`});return}e.key===void 0&&(e.key=await _(`key`,`Item key / filename. Must not exceed 128 characters.`)),e[`next-action`]===void 0&&(e[`next-action`]=await v(`next-action`,`The next_action field`,[`INDEX`]));let f={};e.key!==void 0&&p(f,[`key`],h(e.key,`key`,`text`)),e[`next-action`]!==void 0&&p(f,[`next_action`],e[`next-action`]),e[`wait-for-completion`]!==void 0&&p(f,[`wait_for_completion`],e[`wait-for-completion`]);let g=await c(`Updating`,async()=>n(l,`PUT`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/items`,{body:f}));o(g,{successLabel:`Updated`})})},G={command:`items`,describe:`Content indexed by AI Search instances`,builder:e=>e.command(O).command(A).command(M).command(P).command(I).command(R).command(B).command(H).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.usage(`$0 ai-search jobs cancel <job-id>
29
-
30
- Cancels an in-progress indexing job for an AI Search instance.`).positional(`job-id`,{type:`string`,description:`Indexing job ID.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`instance-id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`action`,{type:`string`,description:`The action field`,choices:[`cancel`]}).coerce(`action`,e=>h(e,`action`,`text`)).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 q={command:`cancel <job-id>`,describe:`Cancel an indexing job.`,builder:K,handler:async e=>l({command:`ai-search jobs cancel`,classification:{safeFlags:[`action`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search jobs cancel`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``),"job-id":String(e[`job-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({action:e.action}):d(e.body)});return}let l=await r(e),u=e.local?t:await a();if(e.accountId=u,!await y({force:!!e.force,message:`This operation cancels the running indexing job.`}))return;if(e.body){let t=d(e.body),r=await c(`Deleting`,async()=>n(l,`PATCH`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/jobs/${encodeURIComponent(String(e[`job-id`]))}`,{body:t}));o(r,{successLabel:`Deleted`});return}e.action===void 0&&(e.action=await v(`action`,`The action field`,[`cancel`]));let f={};e.action!==void 0&&p(f,[`action`],e.action);let h=await c(`Deleting`,async()=>n(l,`PATCH`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/jobs/${encodeURIComponent(String(e[`job-id`]))}`,{body:f}));o(h,{successLabel:`Deleted`})})};function J(e){return e.usage(`$0 ai-search jobs create <instance-id>
31
-
32
- Creates a new indexing job for an AI Search instance.`).positional(`instance-id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`description`,{type:`string`,description:`Optional description for the indexing job.`}).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:`create <instance-id>`,describe:`Create new job`,builder:J,handler:async e=>l({command:`ai-search jobs create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}/jobs`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`)}):d(e.body)});return}let l=await r(e),u=e.local?t:await a();if(e.accountId=u,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n(l,`POST`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/jobs`,{body:t}));o(r,{successLabel:`Created`});return}let f={};e.description!==void 0&&p(f,[`description`],h(e.description,`description`,`text`));let g=await c(`Creating`,async()=>n(l,`POST`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/jobs`,{body:f}));o(g,{successLabel:`Created`})})};function X(e){return e.usage(`$0 ai-search jobs get <job-id>
33
-
34
- Retrieves details for a specific AI Search indexing job.`).positional(`job-id`,{type:`string`,description:`Indexing job ID.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`instance-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 ie={command:`get <job-id>`,describe:`Get a Job Details`,builder:X,handler:async e=>l({command:`ai-search jobs get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``),"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>n(l,`GET`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/jobs/${encodeURIComponent(String(e[`job-id`]))}`));o(d,{successLabel:`Loaded`})})};function ae(e){return e.usage(`$0 ai-search jobs list
35
-
36
- Lists indexing jobs for an AI Search instance.`).option(`namespace`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`instance-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 oe={command:`list`,describe:`List Jobs`,builder:ae,handler:async e=>l({command:`ai-search jobs list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=await i();s({command:`cf ai-search jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}/jobs`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``)},query:l,bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/jobs`,{query:l}));o(f,{successLabel:`Loaded`})})};function se(e){return e.usage(`$0 ai-search jobs logs <job-id>
37
-
38
- Lists log entries for an AI Search indexing job.`).positional(`job-id`,{type:`string`,description:`Indexing job ID.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`instance-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 ce={command:`logs <job-id>`,describe:`List Job Logs`,builder:se,handler:async e=>l({command:`ai-search jobs logs`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=await i();s({command:`cf ai-search jobs logs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}/logs`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``),"job-id":String(e[`job-id`]??``)},query:l,bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/jobs/${encodeURIComponent(String(e[`job-id`]))}/logs`,{query:l}));o(f,{successLabel:`Loaded`})})},le={command:`jobs`,describe:`Indexing job lifecycle for AI Search instances`,builder:e=>e.command(q).command(Y).command(ie).command(oe).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ue={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-search/namespaces/${t.namespace}/instances`,query:[`page`,`per_page`,`search`,`hostname`,`order_by`,`order_by_direction`],errors:{400:`BadRequestError`}};function de(e){return e.usage(`$0 ai-search list
39
-
40
- Lists all AI Search instances in the account.`).option(`namespace`,{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:`Return only instances with this 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 fe={command:`list`,describe:`List AI Search instances.`,builder:de,handler:async e=>l({command:`ai-search list`,classification:{safeFlags:[`order-by`,`order-by-direction`,`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],search:e.search,hostname:e.hostname,order_by:e[`order-by`],order_by_direction:e[`order-by-direction`]};if(e.dryRun){let t=await i();s({command:`cf ai-search list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances`,pathParams:{namespace:String(e.namespace??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(ue,{account_id:u,namespace:e.namespace,...n}));o(d,{successLabel:`Loaded`})})};function pe(e){return e.usage(`$0 ai-search move <instance-id>
41
-
42
- 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).`).positional(`instance-id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`source-namespace`,{type:`string`,description:`Namespace currently containing the instance.`,demandOption:!0}).option(`destination-namespace`,{type:`string`,description:`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 me={command:`move <instance-id>`,describe:`Move an instance to a different namespace.`,builder:pe,handler:async e=>l({command:`ai-search move`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search move`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e[`source-namespace`]==null?`<source-namespace>`:encodeURIComponent(String(e[`source-namespace`]))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}`,pathParams:{"source-namespace":String(e[`source-namespace`]??``),"instance-id":String(e[`instance-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({new_namespace:h(e[`destination-namespace`],`destination-namespace`,`text`)}):d(e.body)});return}let l=await r(e),u=e.local?t:await a();if(e.accountId=u,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(l,`PATCH`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e[`source-namespace`]))}/instances/${encodeURIComponent(String(e[`instance-id`]))}`,{body:t}));o(r,{successLabel:`Updated`});return}e[`destination-namespace`]===void 0&&(e[`destination-namespace`]=await _(`destination-namespace`,`Namespace to move the instance into.`));let f={};e[`destination-namespace`]!==void 0&&p(f,[`new_namespace`],h(e[`destination-namespace`],`destination-namespace`,`text`));let g=await c(`Updating`,async()=>n(l,`PATCH`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e[`source-namespace`]))}/instances/${encodeURIComponent(String(e[`instance-id`]))}`,{body:f}));o(g,{successLabel:`Updated`})})};function he(e){return e.usage(`$0 ai-search multi-chat-completions <namespace>
43
-
44
- Performs a chat completion request against multiple AI Search instances in parallel, merging retrieved content as context for generating a response.`).positional(`namespace`,{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`]}).coerce(`ai-search-options-cache-cache-threshold`,e=>h(e,`ai-search-options-cache-cache-threshold`,`text`)).option(`ai-search-options-cache-enabled`,{type:`boolean`,description:`The ai_search_options.cache.enabled field`}).option(`ai-search-options-custom-metadata`,{type:`string`,description:`Metadata added to AI Gateway logs for requests this operation triggers. Accepts up to 2 string, number, or boolean entries. Reserved keys: 'ai-search', 'task', 'origin', and any key beginning with 'cf.'. Provide as a JSON object or @path/to/file.json.`}).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-boost-by`,{type:`string`,description:`Metadata fields to boost search results by. Overrides the instance-level boost_by config. Direction defaults to 'asc' for numeric/datetime fields, 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined custom_metadata field. Provide as a JSON array of objects or @path/to/file.json.`}).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-filters`,{type:`string`,description:`The ai_search_options.retrieval.filters field. Provide as a JSON object or @path/to/file.json.`}).option(`ai-search-options-retrieval-fusion-method`,{type:`string`,description:`The ai_search_options.retrieval.fusion_method field`,choices:[`max`,`rrf`]}).coerce(`ai-search-options-retrieval-fusion-method`,e=>h(e,`ai-search-options-retrieval-fusion-method`,`text`)).option(`ai-search-options-retrieval-keyword-match-mode`,{type:`string`,description:`Controls which documents become candidates for BM25 scoring. 'and' restricts candidates to documents containing all query terms; 'or' includes any document containing at least one term and ranks results according to BM25 relevance. When omitted, falls back to the instance-level retrieval_options.keyword_match_mode, then to 'and'.`,choices:[`and`,`or`]}).coerce(`ai-search-options-retrieval-keyword-match-mode`,e=>h(e,`ai-search-options-retrieval-keyword-match-mode`,`text`)).option(`ai-search-options-retrieval-match-threshold`,{type:`number`,description:`Minimum score a chunk must reach to be returned. When omitted, each instance's chunks are filtered by that instance's score_threshold, capped at the lower of the first instance's score_threshold and 0.4.`}).option(`ai-search-options-retrieval-max-num-results`,{type:`number`,description:`Maximum number of merged results to return. When omitted, defaults to the first instance's max_num_results, then 10.`}).option(`ai-search-options-retrieval-retrieval-type`,{type:`string`,description:`The ai_search_options.retrieval.retrieval_type field`,choices:[`vector`,`keyword`,`hybrid`]}).coerce(`ai-search-options-retrieval-retrieval-type`,e=>h(e,`ai-search-options-retrieval-retrieval-type`,`text`)).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 ge={command:`multi-chat-completions <namespace>`,describe:`Multi-Instance Chat Completions`,builder:he,handler:async e=>l({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`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search multi-chat-completions`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/chat/completions`,pathParams:{namespace:String(e.namespace??``)},bodyKind:`json`,body:e.body===void 0?m({ai_search_options:{cache:{cache_threshold:e[`ai-search-options-cache-cache-threshold`],enabled:e[`ai-search-options-cache-enabled`]},custom_metadata:f(e[`ai-search-options-custom-metadata`],`ai-search-options-custom-metadata`),instance_ids:e[`ai-search-options-instance-ids`],query_rewrite:{enabled:e[`ai-search-options-query-rewrite-enabled`],model:h(e[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`),rewrite_prompt:h(e[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)},reranking:{enabled:e[`ai-search-options-reranking-enabled`],match_threshold:e[`ai-search-options-reranking-match-threshold`],model:h(e[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)},retrieval:{boost_by:u(e[`ai-search-options-retrieval-boost-by`],`ai-search-options-retrieval-boost-by`),context_expansion:e[`ai-search-options-retrieval-context-expansion`],filters:f(e[`ai-search-options-retrieval-filters`],`ai-search-options-retrieval-filters`),fusion_method:e[`ai-search-options-retrieval-fusion-method`],keyword_match_mode:e[`ai-search-options-retrieval-keyword-match-mode`],match_threshold:e[`ai-search-options-retrieval-match-threshold`],max_num_results:e[`ai-search-options-retrieval-max-num-results`],retrieval_type:e[`ai-search-options-retrieval-retrieval-type`],return_on_failure:e[`ai-search-options-retrieval-return-on-failure`]}},messages:u(e.messages,`messages`),model:h(e.model,`model`,`text`),stream:e.stream},[[`ai_search_options`,`custom_metadata`],[`ai_search_options`,`retrieval`,`filters`]]):d(e.body)});return}let l=await r(e),g=e.local?t:await a();if(e.accountId=g,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n(l,`POST`,`/accounts/${g}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/chat/completions`,{body:t}));o(r,{successLabel:`Created`});return}if(e[`ai-search-options-instance-ids`]===void 0)throw Error(`--ai-search-options-instance-ids is required (or pass --body with this field set).`);if(e.messages===void 0)throw Error(`--messages is required (or pass --body with this field set).`);let _={};e[`ai-search-options-cache-cache-threshold`]!==void 0&&p(_,[`ai_search_options`,`cache`,`cache_threshold`],e[`ai-search-options-cache-cache-threshold`]),e[`ai-search-options-cache-enabled`]!==void 0&&p(_,[`ai_search_options`,`cache`,`enabled`],e[`ai-search-options-cache-enabled`]),e[`ai-search-options-custom-metadata`]!==void 0&&p(_,[`ai_search_options`,`custom_metadata`],f(e[`ai-search-options-custom-metadata`],`ai-search-options-custom-metadata`)),e[`ai-search-options-instance-ids`]!==void 0&&p(_,[`ai_search_options`,`instance_ids`],e[`ai-search-options-instance-ids`]),e[`ai-search-options-query-rewrite-enabled`]!==void 0&&p(_,[`ai_search_options`,`query_rewrite`,`enabled`],e[`ai-search-options-query-rewrite-enabled`]),e[`ai-search-options-query-rewrite-model`]!==void 0&&p(_,[`ai_search_options`,`query_rewrite`,`model`],h(e[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`)),e[`ai-search-options-query-rewrite-rewrite-prompt`]!==void 0&&p(_,[`ai_search_options`,`query_rewrite`,`rewrite_prompt`],h(e[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)),e[`ai-search-options-reranking-enabled`]!==void 0&&p(_,[`ai_search_options`,`reranking`,`enabled`],e[`ai-search-options-reranking-enabled`]),e[`ai-search-options-reranking-match-threshold`]!==void 0&&p(_,[`ai_search_options`,`reranking`,`match_threshold`],e[`ai-search-options-reranking-match-threshold`]),e[`ai-search-options-reranking-model`]!==void 0&&p(_,[`ai_search_options`,`reranking`,`model`],h(e[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)),e[`ai-search-options-retrieval-boost-by`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`boost_by`],u(e[`ai-search-options-retrieval-boost-by`],`ai-search-options-retrieval-boost-by`)),e[`ai-search-options-retrieval-context-expansion`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`context_expansion`],e[`ai-search-options-retrieval-context-expansion`]),e[`ai-search-options-retrieval-filters`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`filters`],f(e[`ai-search-options-retrieval-filters`],`ai-search-options-retrieval-filters`)),e[`ai-search-options-retrieval-fusion-method`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`fusion_method`],e[`ai-search-options-retrieval-fusion-method`]),e[`ai-search-options-retrieval-keyword-match-mode`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`keyword_match_mode`],e[`ai-search-options-retrieval-keyword-match-mode`]),e[`ai-search-options-retrieval-match-threshold`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`match_threshold`],e[`ai-search-options-retrieval-match-threshold`]),e[`ai-search-options-retrieval-max-num-results`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`max_num_results`],e[`ai-search-options-retrieval-max-num-results`]),e[`ai-search-options-retrieval-retrieval-type`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`retrieval_type`],e[`ai-search-options-retrieval-retrieval-type`]),e[`ai-search-options-retrieval-return-on-failure`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`return_on_failure`],e[`ai-search-options-retrieval-return-on-failure`]),e.messages!==void 0&&p(_,[`messages`],u(e.messages,`messages`)),e.model!==void 0&&p(_,[`model`],h(e.model,`model`,`text`)),e.stream!==void 0&&p(_,[`stream`],e.stream);let v=await c(`Creating`,async()=>n(l,`POST`,`/accounts/${g}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/chat/completions`,{body:_}));o(v,{successLabel:`Created`})})};function _e(e){return e.usage(`$0 ai-search multi-search <namespace> [query]
45
-
46
- Performs a semantic search query against multiple AI Search instances in parallel, merging the retrieved results into a single ranked response.`).positional(`namespace`,{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`]}).coerce(`ai-search-options-cache-cache-threshold`,e=>h(e,`ai-search-options-cache-cache-threshold`,`text`)).option(`ai-search-options-cache-enabled`,{type:`boolean`,description:`The ai_search_options.cache.enabled field`}).option(`ai-search-options-custom-metadata`,{type:`string`,description:`Metadata added to AI Gateway logs for requests this operation triggers. Accepts up to 2 string, number, or boolean entries. Reserved keys: 'ai-search', 'task', 'origin', and any key beginning with 'cf.'. Provide as a JSON object or @path/to/file.json.`}).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-boost-by`,{type:`string`,description:`Metadata fields to boost search results by. Overrides the instance-level boost_by config. Direction defaults to 'asc' for numeric/datetime fields, 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined custom_metadata field. Provide as a JSON array of objects or @path/to/file.json.`}).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-filters`,{type:`string`,description:`The ai_search_options.retrieval.filters field. Provide as a JSON object or @path/to/file.json.`}).option(`ai-search-options-retrieval-fusion-method`,{type:`string`,description:`The ai_search_options.retrieval.fusion_method field`,choices:[`max`,`rrf`]}).coerce(`ai-search-options-retrieval-fusion-method`,e=>h(e,`ai-search-options-retrieval-fusion-method`,`text`)).option(`ai-search-options-retrieval-keyword-match-mode`,{type:`string`,description:`Controls which documents become candidates for BM25 scoring. 'and' restricts candidates to documents containing all query terms; 'or' includes any document containing at least one term and ranks results according to BM25 relevance. When omitted, falls back to the instance-level retrieval_options.keyword_match_mode, then to 'and'.`,choices:[`and`,`or`]}).coerce(`ai-search-options-retrieval-keyword-match-mode`,e=>h(e,`ai-search-options-retrieval-keyword-match-mode`,`text`)).option(`ai-search-options-retrieval-match-threshold`,{type:`number`,description:`Minimum score a chunk must reach to be returned. When omitted, each instance's chunks are filtered by that instance's score_threshold, capped at 0.4.`}).option(`ai-search-options-retrieval-max-num-results`,{type:`number`,description:`Maximum number of merged results to return. When omitted, defaults to the sum of the searched instances' max_num_results (each falling back to 10), up to 50.`}).option(`ai-search-options-retrieval-retrieval-type`,{type:`string`,description:`The ai_search_options.retrieval.retrieval_type field`,choices:[`vector`,`keyword`,`hybrid`]}).coerce(`ai-search-options-retrieval-retrieval-type`,e=>h(e,`ai-search-options-retrieval-retrieval-type`,`text`)).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 ve={command:`multi-search <namespace> [query]`,describe:`Multi-Instance Search`,builder:_e,handler:async e=>l({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`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search multi-search`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/search`,pathParams:{namespace:String(e.namespace??``)},bodyKind:`json`,body:e.body===void 0?m({ai_search_options:{cache:{cache_threshold:e[`ai-search-options-cache-cache-threshold`],enabled:e[`ai-search-options-cache-enabled`]},custom_metadata:f(e[`ai-search-options-custom-metadata`],`ai-search-options-custom-metadata`),instance_ids:e[`ai-search-options-instance-ids`],query_rewrite:{enabled:e[`ai-search-options-query-rewrite-enabled`],model:h(e[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`),rewrite_prompt:h(e[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)},reranking:{enabled:e[`ai-search-options-reranking-enabled`],match_threshold:e[`ai-search-options-reranking-match-threshold`],model:h(e[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)},retrieval:{boost_by:u(e[`ai-search-options-retrieval-boost-by`],`ai-search-options-retrieval-boost-by`),context_expansion:e[`ai-search-options-retrieval-context-expansion`],filters:f(e[`ai-search-options-retrieval-filters`],`ai-search-options-retrieval-filters`),fusion_method:e[`ai-search-options-retrieval-fusion-method`],keyword_match_mode:e[`ai-search-options-retrieval-keyword-match-mode`],match_threshold:e[`ai-search-options-retrieval-match-threshold`],max_num_results:e[`ai-search-options-retrieval-max-num-results`],retrieval_type:e[`ai-search-options-retrieval-retrieval-type`],return_on_failure:e[`ai-search-options-retrieval-return-on-failure`]}},messages:u(e.messages,`messages`),query:e.query},[[`ai_search_options`,`custom_metadata`],[`ai_search_options`,`retrieval`,`filters`]]):d(e.body)});return}let l=await r(e),g=e.local?t:await a();if(e.accountId=g,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n(l,`POST`,`/accounts/${g}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/search`,{body:t}));o(r,{successLabel:`Created`});return}if(e[`ai-search-options-instance-ids`]===void 0)throw Error(`--ai-search-options-instance-ids is required (or pass --body with this field set).`);let _={};e[`ai-search-options-cache-cache-threshold`]!==void 0&&p(_,[`ai_search_options`,`cache`,`cache_threshold`],e[`ai-search-options-cache-cache-threshold`]),e[`ai-search-options-cache-enabled`]!==void 0&&p(_,[`ai_search_options`,`cache`,`enabled`],e[`ai-search-options-cache-enabled`]),e[`ai-search-options-custom-metadata`]!==void 0&&p(_,[`ai_search_options`,`custom_metadata`],f(e[`ai-search-options-custom-metadata`],`ai-search-options-custom-metadata`)),e[`ai-search-options-instance-ids`]!==void 0&&p(_,[`ai_search_options`,`instance_ids`],e[`ai-search-options-instance-ids`]),e[`ai-search-options-query-rewrite-enabled`]!==void 0&&p(_,[`ai_search_options`,`query_rewrite`,`enabled`],e[`ai-search-options-query-rewrite-enabled`]),e[`ai-search-options-query-rewrite-model`]!==void 0&&p(_,[`ai_search_options`,`query_rewrite`,`model`],h(e[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`)),e[`ai-search-options-query-rewrite-rewrite-prompt`]!==void 0&&p(_,[`ai_search_options`,`query_rewrite`,`rewrite_prompt`],h(e[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)),e[`ai-search-options-reranking-enabled`]!==void 0&&p(_,[`ai_search_options`,`reranking`,`enabled`],e[`ai-search-options-reranking-enabled`]),e[`ai-search-options-reranking-match-threshold`]!==void 0&&p(_,[`ai_search_options`,`reranking`,`match_threshold`],e[`ai-search-options-reranking-match-threshold`]),e[`ai-search-options-reranking-model`]!==void 0&&p(_,[`ai_search_options`,`reranking`,`model`],h(e[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)),e[`ai-search-options-retrieval-boost-by`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`boost_by`],u(e[`ai-search-options-retrieval-boost-by`],`ai-search-options-retrieval-boost-by`)),e[`ai-search-options-retrieval-context-expansion`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`context_expansion`],e[`ai-search-options-retrieval-context-expansion`]),e[`ai-search-options-retrieval-filters`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`filters`],f(e[`ai-search-options-retrieval-filters`],`ai-search-options-retrieval-filters`)),e[`ai-search-options-retrieval-fusion-method`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`fusion_method`],e[`ai-search-options-retrieval-fusion-method`]),e[`ai-search-options-retrieval-keyword-match-mode`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`keyword_match_mode`],e[`ai-search-options-retrieval-keyword-match-mode`]),e[`ai-search-options-retrieval-match-threshold`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`match_threshold`],e[`ai-search-options-retrieval-match-threshold`]),e[`ai-search-options-retrieval-max-num-results`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`max_num_results`],e[`ai-search-options-retrieval-max-num-results`]),e[`ai-search-options-retrieval-retrieval-type`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`retrieval_type`],e[`ai-search-options-retrieval-retrieval-type`]),e[`ai-search-options-retrieval-return-on-failure`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`return_on_failure`],e[`ai-search-options-retrieval-return-on-failure`]),e.messages!==void 0&&p(_,[`messages`],u(e.messages,`messages`)),e.query!==void 0&&(_.query=e.query);let v=await c(`Creating`,async()=>n(l,`POST`,`/accounts/${g}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/search`,{body:_}));o(v,{successLabel:`Created`})})};var Z={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-search/namespaces`,body:`json`,errors:{400:`BadRequestError`,403:`ForbiddenError`,409:`ConflictError`}};function ye(e){return e.usage(`$0 ai-search namespace create <namespace>
47
-
48
- Create a namespace for organizing AI Search instances.`).positional(`namespace`,{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 reference an existing instance in this namespace, and the list must stay within 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`]}).coerce(`public-endpoint-params-rate-limit-technique`,e=>h(e,`public-endpoint-params-rate-limit-technique`,`text`)).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 be={command:`create <namespace>`,describe:`Create a namespace`,builder:ye,handler:async e=>l({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`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search namespace create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),public_endpoint_params:{authorized_hosts:e[`public-endpoint-params-authorized-hosts`],chat_completions_endpoint:{disabled:e[`public-endpoint-params-chat-completions-endpoint-disabled`]},custom_domains:e[`public-endpoint-params-custom-domains`],default_domain_enabled:e[`public-endpoint-params-default-domain-enabled`],enabled:e[`public-endpoint-params-enabled`],instances_allowed:e[`public-endpoint-params-instances-allowed`],mcp:{description:h(e[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`),disabled:e[`public-endpoint-params-mcp-disabled`]},rate_limit:{period_ms:e[`public-endpoint-params-rate-limit-period-ms`],requests:e[`public-endpoint-params-rate-limit-requests`],technique:e[`public-endpoint-params-rate-limit-technique`]},search_endpoint:{disabled:e[`public-endpoint-params-search-endpoint-disabled`]}},name:e.namespace}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(Z,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}let u=m({description:h(e.description,`description`,`text`),public_endpoint_params:{authorized_hosts:e[`public-endpoint-params-authorized-hosts`],chat_completions_endpoint:{disabled:e[`public-endpoint-params-chat-completions-endpoint-disabled`]},custom_domains:e[`public-endpoint-params-custom-domains`],default_domain_enabled:e[`public-endpoint-params-default-domain-enabled`],enabled:e[`public-endpoint-params-enabled`],instances_allowed:e[`public-endpoint-params-instances-allowed`],mcp:{description:h(e[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`),disabled:e[`public-endpoint-params-mcp-disabled`]},rate_limit:{period_ms:e[`public-endpoint-params-rate-limit-period-ms`],requests:e[`public-endpoint-params-rate-limit-requests`],technique:e[`public-endpoint-params-rate-limit-technique`]},search_endpoint:{disabled:e[`public-endpoint-params-search-endpoint-disabled`]}},name:e.namespace}),f=await c(`Creating`,async()=>n.send(Z,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};function xe(e){return e.usage(`$0 ai-search namespace delete <namespace>
49
-
50
- Deletes a namespace permanently. The namespace must not contain any instances (instances whose deletion is still in progress do not count), and the default namespace cannot be deleted.`).positional(`namespace`,{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 Se={command:`delete <namespace>`,describe:`Delete a namespace`,builder:xe,handler:async e=>l({command:`ai-search namespace delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search namespace delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}`,pathParams:{namespace:String(e.namespace??``)},bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();if(e.accountId=u,!await y({force:!!e.force,message:`This operation permanently deletes the namespace.`}))return;let d=await c(`Deleting`,async()=>n(l,`DELETE`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}`));o(d,{successLabel:`Deleted`})})};function Ce(e){return e.usage(`$0 ai-search namespace get <namespace>
51
-
52
- Retrieve a namespace and its description.`).positional(`namespace`,{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 we={command:`get <namespace>`,describe:`Get a namespace`,builder:Ce,handler:async e=>l({command:`ai-search namespace get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search namespace get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}`,pathParams:{namespace:String(e.namespace??``)},bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>n(l,`GET`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}`));o(d,{successLabel:`Loaded`})})};var Te={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-search/namespaces`,query:[`page`,`per_page`,`search`],errors:{400:`BadRequestError`}};function Ee(e){return e.usage(`$0 ai-search namespace list
53
-
54
- Lists 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 De={command:`list`,describe:`List namespaces`,builder:Ee,handler:async e=>l({command:`ai-search namespace list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],search:e.search};if(e.dryRun){let e=await i();s({command:`cf ai-search namespace list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(Te,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};function Oe(e){return e.usage(`$0 ai-search namespace update <namespace>
55
-
56
- Updates 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(`namespace`,{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 reference an existing instance in this namespace, and the list must stay within 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`]}).coerce(`public-endpoint-params-rate-limit-technique`,e=>h(e,`public-endpoint-params-rate-limit-technique`,`text`)).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 ke={command:`update <namespace>`,describe:`Update a namespace`,builder:Oe,handler:async e=>l({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`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search namespace update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}`,pathParams:{namespace:String(e.namespace??``)},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),public_endpoint_params:{authorized_hosts:e[`public-endpoint-params-authorized-hosts`],chat_completions_endpoint:{disabled:e[`public-endpoint-params-chat-completions-endpoint-disabled`]},custom_domains:e[`public-endpoint-params-custom-domains`],default_domain_enabled:e[`public-endpoint-params-default-domain-enabled`],enabled:e[`public-endpoint-params-enabled`],instances_allowed:e[`public-endpoint-params-instances-allowed`],mcp:{description:h(e[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`),disabled:e[`public-endpoint-params-mcp-disabled`]},rate_limit:{period_ms:e[`public-endpoint-params-rate-limit-period-ms`],requests:e[`public-endpoint-params-rate-limit-requests`],technique:e[`public-endpoint-params-rate-limit-technique`]},search_endpoint:{disabled:e[`public-endpoint-params-search-endpoint-disabled`]}}}):d(e.body)});return}let l=await r(e),u=e.local?t:await a();if(e.accountId=u,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(l,`PUT`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}`,{body:t}));o(r,{successLabel:`Updated`});return}let f={};e.description!==void 0&&p(f,[`description`],h(e.description,`description`,`text`)),e[`public-endpoint-params-authorized-hosts`]!==void 0&&p(f,[`public_endpoint_params`,`authorized_hosts`],e[`public-endpoint-params-authorized-hosts`]),e[`public-endpoint-params-chat-completions-endpoint-disabled`]!==void 0&&p(f,[`public_endpoint_params`,`chat_completions_endpoint`,`disabled`],e[`public-endpoint-params-chat-completions-endpoint-disabled`]),e[`public-endpoint-params-custom-domains`]!==void 0&&p(f,[`public_endpoint_params`,`custom_domains`],e[`public-endpoint-params-custom-domains`]),e[`public-endpoint-params-default-domain-enabled`]!==void 0&&p(f,[`public_endpoint_params`,`default_domain_enabled`],e[`public-endpoint-params-default-domain-enabled`]),e[`public-endpoint-params-enabled`]!==void 0&&p(f,[`public_endpoint_params`,`enabled`],e[`public-endpoint-params-enabled`]),e[`public-endpoint-params-instances-allowed`]!==void 0&&p(f,[`public_endpoint_params`,`instances_allowed`],e[`public-endpoint-params-instances-allowed`]),e[`public-endpoint-params-mcp-description`]!==void 0&&p(f,[`public_endpoint_params`,`mcp`,`description`],h(e[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`)),e[`public-endpoint-params-mcp-disabled`]!==void 0&&p(f,[`public_endpoint_params`,`mcp`,`disabled`],e[`public-endpoint-params-mcp-disabled`]),e[`public-endpoint-params-rate-limit-period-ms`]!==void 0&&p(f,[`public_endpoint_params`,`rate_limit`,`period_ms`],e[`public-endpoint-params-rate-limit-period-ms`]),e[`public-endpoint-params-rate-limit-requests`]!==void 0&&p(f,[`public_endpoint_params`,`rate_limit`,`requests`],e[`public-endpoint-params-rate-limit-requests`]),e[`public-endpoint-params-rate-limit-technique`]!==void 0&&p(f,[`public_endpoint_params`,`rate_limit`,`technique`],e[`public-endpoint-params-rate-limit-technique`]),e[`public-endpoint-params-search-endpoint-disabled`]!==void 0&&p(f,[`public_endpoint_params`,`search_endpoint`,`disabled`],e[`public-endpoint-params-search-endpoint-disabled`]);let g=await c(`Updating`,async()=>n(l,`PUT`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}`,{body:f}));o(g,{successLabel:`Updated`})})},Ae={command:`namespace`,describe:`Logical groupings for organizing AI Search instances`,builder:e=>e.command(be).command(Se).command(we).command(De).command(ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function je(e){return e.usage(`$0 ai-search purge-cache <instance-id>
57
-
58
- Purges all cached search results for an AI Search instance. A new internal cache key is generated, immediately orphaning all prior cached entries.`).positional(`instance-id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`namespace`,{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 Me={command:`purge-cache <instance-id>`,describe:`Purge search cache.`,builder:je,handler:async e=>l({command:`ai-search purge-cache`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search purge-cache`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}/purge_cache`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``)},bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Creating`,async()=>n(l,`POST`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/purge_cache`));o(d,{successLabel:`Created`})})};function Ne(e){return e.usage(`$0 ai-search search <instance-id> [query]
59
-
60
- Executes a semantic search query against an AI Search instance to find relevant indexed content.`).positional(`instance-id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).positional(`query`,{type:`string`,description:`Text to search for.`}).option(`namespace`,{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`]}).coerce(`ai-search-options-cache-cache-threshold`,e=>h(e,`ai-search-options-cache-cache-threshold`,`text`)).option(`ai-search-options-cache-enabled`,{type:`boolean`,description:`The ai_search_options.cache.enabled field`}).option(`ai-search-options-custom-metadata`,{type:`string`,description:`Metadata added to AI Gateway logs for requests this operation triggers. Accepts up to 2 string, number, or boolean entries. Reserved keys: 'ai-search', 'task', 'origin', and any key beginning with 'cf.'. Provide as a JSON object or @path/to/file.json.`}).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-boost-by`,{type:`string`,description:`Metadata fields to boost search results by. Overrides the instance-level boost_by config. Direction defaults to 'asc' for numeric/datetime fields, 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined custom_metadata field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`ai-search-options-retrieval-context-expansion`,{type:`number`,description:`The ai_search_options.retrieval.context_expansion field`}).option(`ai-search-options-retrieval-filters`,{type:`string`,description:`The ai_search_options.retrieval.filters field. Provide as a JSON object or @path/to/file.json.`}).option(`ai-search-options-retrieval-fusion-method`,{type:`string`,description:`The ai_search_options.retrieval.fusion_method field`,choices:[`max`,`rrf`]}).coerce(`ai-search-options-retrieval-fusion-method`,e=>h(e,`ai-search-options-retrieval-fusion-method`,`text`)).option(`ai-search-options-retrieval-keyword-match-mode`,{type:`string`,description:`Controls which documents become candidates for BM25 scoring. 'and' restricts candidates to documents containing all query terms; 'or' includes any document containing at least one term and ranks results according to BM25 relevance. When omitted, falls back to the instance-level retrieval_options.keyword_match_mode, then to 'and'.`,choices:[`and`,`or`]}).coerce(`ai-search-options-retrieval-keyword-match-mode`,e=>h(e,`ai-search-options-retrieval-keyword-match-mode`,`text`)).option(`ai-search-options-retrieval-match-threshold`,{type:`number`,description:`Minimum similarity score a chunk must reach to be returned. When omitted, falls back to the instance-level score_threshold, then to 0.4.`}).option(`ai-search-options-retrieval-max-num-results`,{type:`number`,description:`Maximum number of results to return. When omitted, falls back to the instance-level max_num_results, then to 10.`}).option(`ai-search-options-retrieval-retrieval-type`,{type:`string`,description:`The ai_search_options.retrieval.retrieval_type field`,choices:[`vector`,`keyword`,`hybrid`]}).coerce(`ai-search-options-retrieval-retrieval-type`,e=>h(e,`ai-search-options-retrieval-retrieval-type`,`text`)).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 Pe={command:`search <instance-id> [query]`,describe:`Search`,builder:Ne,handler:async e=>l({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`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search search`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}/search`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({ai_search_options:{cache:{cache_threshold:e[`ai-search-options-cache-cache-threshold`],enabled:e[`ai-search-options-cache-enabled`]},custom_metadata:f(e[`ai-search-options-custom-metadata`],`ai-search-options-custom-metadata`),query_rewrite:{enabled:e[`ai-search-options-query-rewrite-enabled`],model:h(e[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`),rewrite_prompt:h(e[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)},reranking:{enabled:e[`ai-search-options-reranking-enabled`],match_threshold:e[`ai-search-options-reranking-match-threshold`],model:h(e[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)},retrieval:{boost_by:u(e[`ai-search-options-retrieval-boost-by`],`ai-search-options-retrieval-boost-by`),context_expansion:e[`ai-search-options-retrieval-context-expansion`],filters:f(e[`ai-search-options-retrieval-filters`],`ai-search-options-retrieval-filters`),fusion_method:e[`ai-search-options-retrieval-fusion-method`],keyword_match_mode:e[`ai-search-options-retrieval-keyword-match-mode`],match_threshold:e[`ai-search-options-retrieval-match-threshold`],max_num_results:e[`ai-search-options-retrieval-max-num-results`],retrieval_type:e[`ai-search-options-retrieval-retrieval-type`],return_on_failure:e[`ai-search-options-retrieval-return-on-failure`]}},messages:u(e.messages,`messages`),query:e.query},[[`ai_search_options`,`custom_metadata`],[`ai_search_options`,`retrieval`,`filters`]]):d(e.body)});return}let l=await r(e),g=e.local?t:await a();if(e.accountId=g,e.body){let t=d(e.body),r=await c(`Loading`,async()=>n(l,`POST`,`/accounts/${g}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/search`,{body:t}));o(r,{successLabel:`Loaded`});return}let _={};e[`ai-search-options-cache-cache-threshold`]!==void 0&&p(_,[`ai_search_options`,`cache`,`cache_threshold`],e[`ai-search-options-cache-cache-threshold`]),e[`ai-search-options-cache-enabled`]!==void 0&&p(_,[`ai_search_options`,`cache`,`enabled`],e[`ai-search-options-cache-enabled`]),e[`ai-search-options-custom-metadata`]!==void 0&&p(_,[`ai_search_options`,`custom_metadata`],f(e[`ai-search-options-custom-metadata`],`ai-search-options-custom-metadata`)),e[`ai-search-options-query-rewrite-enabled`]!==void 0&&p(_,[`ai_search_options`,`query_rewrite`,`enabled`],e[`ai-search-options-query-rewrite-enabled`]),e[`ai-search-options-query-rewrite-model`]!==void 0&&p(_,[`ai_search_options`,`query_rewrite`,`model`],h(e[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`)),e[`ai-search-options-query-rewrite-rewrite-prompt`]!==void 0&&p(_,[`ai_search_options`,`query_rewrite`,`rewrite_prompt`],h(e[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)),e[`ai-search-options-reranking-enabled`]!==void 0&&p(_,[`ai_search_options`,`reranking`,`enabled`],e[`ai-search-options-reranking-enabled`]),e[`ai-search-options-reranking-match-threshold`]!==void 0&&p(_,[`ai_search_options`,`reranking`,`match_threshold`],e[`ai-search-options-reranking-match-threshold`]),e[`ai-search-options-reranking-model`]!==void 0&&p(_,[`ai_search_options`,`reranking`,`model`],h(e[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)),e[`ai-search-options-retrieval-boost-by`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`boost_by`],u(e[`ai-search-options-retrieval-boost-by`],`ai-search-options-retrieval-boost-by`)),e[`ai-search-options-retrieval-context-expansion`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`context_expansion`],e[`ai-search-options-retrieval-context-expansion`]),e[`ai-search-options-retrieval-filters`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`filters`],f(e[`ai-search-options-retrieval-filters`],`ai-search-options-retrieval-filters`)),e[`ai-search-options-retrieval-fusion-method`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`fusion_method`],e[`ai-search-options-retrieval-fusion-method`]),e[`ai-search-options-retrieval-keyword-match-mode`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`keyword_match_mode`],e[`ai-search-options-retrieval-keyword-match-mode`]),e[`ai-search-options-retrieval-match-threshold`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`match_threshold`],e[`ai-search-options-retrieval-match-threshold`]),e[`ai-search-options-retrieval-max-num-results`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`max_num_results`],e[`ai-search-options-retrieval-max-num-results`]),e[`ai-search-options-retrieval-retrieval-type`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`retrieval_type`],e[`ai-search-options-retrieval-retrieval-type`]),e[`ai-search-options-retrieval-return-on-failure`]!==void 0&&p(_,[`ai_search_options`,`retrieval`,`return_on_failure`],e[`ai-search-options-retrieval-return-on-failure`]),e.messages!==void 0&&p(_,[`messages`],u(e.messages,`messages`)),e.query!==void 0&&(_.query=e.query);let v=await c(`Loading`,async()=>n(l,`POST`,`/accounts/${g}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/search`,{body:_}));o(v,{successLabel:`Loaded`})})};function Fe(e){return e.usage(`$0 ai-search stats <instance-id>
61
-
62
- Retrieve usage and indexing statistics for an AI Search instance.`).positional(`instance-id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`namespace`,{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 Ie={command:`stats <instance-id>`,describe:`Get instance statistics.`,builder:Fe,handler:async e=>l({command:`ai-search stats`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search stats`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}/stats`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``)},bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>n(l,`GET`,`/accounts/${u}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}/stats`));o(d,{successLabel:`Loaded`})})};var Q={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-search/tokens`,body:`json`,errors:{400:`BadRequestError`}};function Le(e){return e.usage(`$0 ai-search tokens create <name>
63
-
64
- 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(`api-token-id`,{type:`string`,description:`Cloudflare API token ID.`}).option(`api-token`,{type:`string`,description:`Cloudflare API token value.`}).option(`legacy`,{type:`boolean`,description:`Whether the credential uses the legacy API key format.`,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 Re={command:`create <name>`,describe:`Create a token`,builder:Le,handler:async e=>l({command:`ai-search tokens create`,classification:{safeFlags:[`legacy`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/tokens`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({cf_api_id:h(e[`api-token-id`],`api-token-id`,`text`),cf_api_key:h(e[`api-token`],`api-token`,`text`),legacy:e.legacy,name:e.name}):d(e.body),sensitiveBodyPaths:[[`cf_api_key`]]});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(Q,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}e[`api-token-id`]===void 0&&(e[`api-token-id`]=await _(`api-token-id`,`Cloudflare API token ID.`)),e[`api-token`]===void 0&&(e[`api-token`]=await _(`api-token`,`Cloudflare API token value.`,{kind:`secret`}));let u=m({cf_api_id:h(e[`api-token-id`],`api-token-id`,`text`),cf_api_key:h(e[`api-token`],`api-token`,`text`),legacy:e.legacy,name:e.name}),f=await c(`Creating`,async()=>n.send(Q,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};function ze(e){return e.usage(`$0 ai-search tokens delete <token-id>
65
-
66
- Deletes a stored AI Search credential permanently. Credentials in use by an instance cannot be deleted.`).positional(`token-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 Be={command:`delete <token-id>`,describe:`Delete a token`,builder:ze,handler:async e=>l({command:`ai-search tokens delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search tokens delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/tokens/${e[`token-id`]==null?`<token-id>`:encodeURIComponent(String(e[`token-id`]))}`,pathParams:{"token-id":String(e[`token-id`]??``)},bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();if(e.accountId=u,!await y({force:!!e.force,message:`This operation permanently deletes the stored credential.`}))return;let d=await c(`Deleting`,async()=>n(l,`DELETE`,`/accounts/${u}/ai-search/tokens/${encodeURIComponent(String(e[`token-id`]))}`));o(d,{successLabel:`Deleted`})})};function Ve(e){return e.usage(`$0 ai-search tokens get <token-id>
67
-
68
- Retrieve a stored AI Search credential without exposing its secret.`).positional(`token-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 <token-id>`,describe:`Get a token`,builder:Ve,handler:async e=>l({command:`ai-search tokens get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search tokens get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/tokens/${e[`token-id`]==null?`<token-id>`:encodeURIComponent(String(e[`token-id`]))}`,pathParams:{"token-id":String(e[`token-id`]??``)},bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>n(l,`GET`,`/accounts/${u}/ai-search/tokens/${encodeURIComponent(String(e[`token-id`]))}`));o(d,{successLabel:`Loaded`})})};var He={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-search/tokens`,query:[`page`,`per_page`,`search`],errors:{400:`BadRequestError`}};function Ue(e){return e.usage(`$0 ai-search tokens list
69
-
70
- Lists 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 We={command:`list`,describe:`List tokens`,builder:Ue,handler:async e=>l({command:`ai-search tokens list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],search:e.search};if(e.dryRun){let e=await i();s({command:`cf ai-search tokens list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/tokens`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(He,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};function Ge(e){return e.usage(`$0 ai-search tokens update <token-id>
71
-
72
- Replace a stored AI Search credential and invalidate cached credentials for instances that use it.`).positional(`token-id`,{type:`string`,description:`Stored credential record ID.`,demandOption:!0}).option(`api-token-id`,{type:`string`,description:`Cloudflare API token ID.`}).option(`api-token`,{type:`string`,description:`Cloudflare API token value.`}).option(`legacy`,{type:`boolean`,description:`Whether the credential uses the legacy API key format.`}).option(`name`,{type:`string`,description:`Human-readable name for the credential.`}).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 Ke={command:`update <token-id>`,describe:`Update a token`,builder:Ge,handler:async e=>l({command:`ai-search tokens update`,classification:{safeFlags:[`legacy`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search tokens update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/tokens/${e[`token-id`]==null?`<token-id>`:encodeURIComponent(String(e[`token-id`]))}`,pathParams:{"token-id":String(e[`token-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({cf_api_id:h(e[`api-token-id`],`api-token-id`,`text`),cf_api_key:h(e[`api-token`],`api-token`,`text`),legacy:e.legacy,name:h(e.name,`name`,`text`)}):d(e.body),sensitiveBodyPaths:[[`cf_api_key`]]});return}let l=await r(e),u=e.local?t:await a();if(e.accountId=u,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(l,`PUT`,`/accounts/${u}/ai-search/tokens/${encodeURIComponent(String(e[`token-id`]))}`,{body:t}));o(r,{successLabel:`Updated`});return}e[`api-token-id`]===void 0&&(e[`api-token-id`]=await _(`api-token-id`,`Cloudflare API token ID.`)),e[`api-token`]===void 0&&(e[`api-token`]=await _(`api-token`,`Cloudflare API token value.`,{kind:`secret`})),e.name===void 0&&(e.name=await _(`name`,`Human-readable name for the credential.`));let f={};e[`api-token-id`]!==void 0&&p(f,[`cf_api_id`],h(e[`api-token-id`],`api-token-id`,`text`)),e[`api-token`]!==void 0&&p(f,[`cf_api_key`],h(e[`api-token`],`api-token`,`text`)),e.legacy!==void 0&&p(f,[`legacy`],e.legacy),e.name!==void 0&&p(f,[`name`],h(e.name,`name`,`text`));let g=await c(`Updating`,async()=>n(l,`PUT`,`/accounts/${u}/ai-search/tokens/${encodeURIComponent(String(e[`token-id`]))}`,{body:f}));o(g,{successLabel:`Updated`})})},qe={command:`tokens`,describe:`Credentials used by AI Search instances`,builder:e=>e.command(Re).command(Be).command($).command(We).command(Ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Je(e){return e.usage(`$0 ai-search update <instance-id>
73
-
74
- Updates the configuration of an AI Search instance.`).positional(`instance-id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`namespace`,{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`]}).coerce(`cache-threshold`,e=>h(e,`cache-threshold`,`text`)).option(`cache-ttl`,{type:`number`,description:`Cache entry TTL in seconds. Allowed values: 600 (10min), 1800 (30min), 3600 (1h), 7200 (2h), 21600 (6h), 43200 (12h), 86400 (24h), 172800 (48h), 259200 (72h), 518400 (6d).`}).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`]}).coerce(`fusion-method`,e=>h(e,`fusion-method`,`text`)).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`]}).coerce(`indexing-options-keyword-tokenizer`,e=>h(e,`indexing-options-keyword-tokenizer`,`text`)).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-created-from-emdash-plugin-type`,{type:`string`,description:`The metadata.created_from_emdash_plugin.type field`,choices:[`native`,`rest`]}).coerce(`metadata-created-from-emdash-plugin-type`,e=>h(e,`metadata-created-from-emdash-plugin-type`,`text`)).option(`metadata-created-from-emdash-plugin-version`,{type:`string`,description:`The metadata.created_from_emdash_plugin.version 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`]}).coerce(`public-endpoint-params-rate-limit-technique`,e=>h(e,`public-endpoint-params-rate-limit-technique`,`text`)).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-boost-by`,{type:`string`,description:`Metadata fields to boost search results by. Each entry specifies a metadata field and an optional direction. Direction defaults to 'asc' for numeric/datetime fields and 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined custom_metadata field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`retrieval-options-keyword-match-mode`,{type:`string`,description:`Controls which documents become candidates for BM25 scoring. 'and' restricts candidates to documents containing all query terms; 'or' includes any document containing at least one term and ranks results according to BM25 relevance. When omitted on an update, the existing stored value stays unchanged; when never set, search falls back to 'and'.`,choices:[`and`,`or`]}).coerce(`retrieval-options-keyword-match-mode`,e=>h(e,`retrieval-options-keyword-match-mode`,`text`)).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:`Minimum similarity score a chunk must reach to be returned. Defaults to 0.4.`}).option(`source`,{type:`string`,description:`R2 bucket name or HTTP(S) root website URL to index.`}).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 have a limit of 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 have a limit of 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` because discover crawls only cover 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`]}).coerce(`source-params-web-crawler-discover-options-source`,e=>h(e,`source-params-web-crawler-discover-options-source`,`text`)).option(`source-params-web-crawler-parse-options-content-selector`,{type:`string`,description:`List of path-to-selector mappings for extracting specific content from crawled pages. Each entry pairs a URL glob pattern with a CSS selector. The first matching path wins. The crawler stores and indexes only the matched HTML fragment. Omit the field to disable content selection; the API rejects empty arrays. Provide as a JSON array of objects or @path/to/file.json.`}).option(`source-params-web-crawler-parse-options-include-headers`,{type:`string`,description:`Up to 5 custom HTTP headers sent with each crawl request. Names must use RFC-7230 token characters, excluding spaces, colons, and control characters. Values must use HTAB and printable ASCII only, excluding CR and LF. Provide as a JSON object or @path/to/file.json.`}).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 the crawler finds URLs. 'sitemap' reads XML sitemaps; 'discover' follows links recursively and requires the source to belong to a Verified zone on this account.`,choices:[`sitemap`,`discover`]}).coerce(`source-params-web-crawler-parse-type`,e=>h(e,`source-params-web-crawler-parse-type`,`text`)).option(`summarization`,{type:`boolean`,description:`The summarization field`}).option(`summarization-model`,{type:`string`,description:`The summarization_model field`}).option(`sync-interval`,{type:`number`,description:`Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800 (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h). Defaults to 21600 (6h); instances crawling a domain outside the account may be set to 86400.`}).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}).check(e=>{if([`metadata-created-from-aisearch-wizard`,`metadata-created-from-emdash-plugin-type`,`metadata-created-from-emdash-plugin-version`,`metadata-worker-domain`].some(t=>e[t]!==void 0)){let t=[`metadata-created-from-emdash-plugin-type`,`metadata-created-from-emdash-plugin-version`].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 --metadata-* flag is set`)}return!0})}const Ye={command:`update <instance-id>`,describe:`Update an AI Search instance.`,builder:Je,handler:async e=>l({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.metadata-created-from-emdash-plugin-type.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(`.`)}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-search update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}`,pathParams:{namespace:String(e.namespace??``),"instance-id":String(e[`instance-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({ai_gateway_id:h(e[`ai-gateway-id`],`ai-gateway-id`,`text`),ai_search_model:h(e[`ai-search-model`],`ai-search-model`,`text`),cache:e.cache,cache_threshold:e[`cache-threshold`],cache_ttl:e[`cache-ttl`],chunk:e.chunk,chunk_overlap:e[`chunk-overlap`],chunk_size:e[`chunk-size`],custom_metadata:u(e[`custom-metadata`],`custom-metadata`),embedding_model:h(e[`embedding-model`],`embedding-model`,`text`),fusion_method:e[`fusion-method`],index_method:{keyword:e[`index-method-keyword`],vector:e[`index-method-vector`]},indexing_options:{keyword_tokenizer:e[`indexing-options-keyword-tokenizer`],use_ocr:e[`indexing-options-use-ocr`]},max_num_results:e[`max-num-results`],metadata:{created_from_aisearch_wizard:e[`metadata-created-from-aisearch-wizard`],created_from_emdash_plugin:{type:e[`metadata-created-from-emdash-plugin-type`],version:h(e[`metadata-created-from-emdash-plugin-version`],`metadata-created-from-emdash-plugin-version`,`text`)},worker_domain:h(e[`metadata-worker-domain`],`metadata-worker-domain`,`text`)},paused:e.paused,public_endpoint_params:{authorized_hosts:e[`public-endpoint-params-authorized-hosts`],chat_completions_endpoint:{disabled:e[`public-endpoint-params-chat-completions-endpoint-disabled`]},custom_domains:e[`public-endpoint-params-custom-domains`],default_domain_enabled:e[`public-endpoint-params-default-domain-enabled`],enabled:e[`public-endpoint-params-enabled`],mcp:{description:h(e[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`),disabled:e[`public-endpoint-params-mcp-disabled`]},rate_limit:{period_ms:e[`public-endpoint-params-rate-limit-period-ms`],requests:e[`public-endpoint-params-rate-limit-requests`],technique:e[`public-endpoint-params-rate-limit-technique`]},search_endpoint:{disabled:e[`public-endpoint-params-search-endpoint-disabled`]}},reranking:e.reranking,reranking_model:h(e[`reranking-model`],`reranking-model`,`text`),retrieval_options:{boost_by:u(e[`retrieval-options-boost-by`],`retrieval-options-boost-by`),keyword_match_mode:e[`retrieval-options-keyword-match-mode`]},rewrite_model:h(e[`rewrite-model`],`rewrite-model`,`text`),rewrite_query:e[`rewrite-query`],score_threshold:e[`score-threshold`],source:h(e.source,`source`,`text`),source_params:{exclude_items:e[`source-params-exclude-items`],include_items:e[`source-params-include-items`],prefix:h(e[`source-params-prefix`],`source-params-prefix`,`text`),r2_jurisdiction:h(e[`source-params-r2-jurisdiction`],`source-params-r2-jurisdiction`,`text`),web_crawler:{discover_options:{depth:e[`source-params-web-crawler-discover-options-depth`],include_external_links:e[`source-params-web-crawler-discover-options-include-external-links`],include_subdomains:e[`source-params-web-crawler-discover-options-include-subdomains`],limit:e[`source-params-web-crawler-discover-options-limit`],max_age:e[`source-params-web-crawler-discover-options-max-age`],source:e[`source-params-web-crawler-discover-options-source`]},parse_options:{content_selector:u(e[`source-params-web-crawler-parse-options-content-selector`],`source-params-web-crawler-parse-options-content-selector`),include_headers:f(e[`source-params-web-crawler-parse-options-include-headers`],`source-params-web-crawler-parse-options-include-headers`),include_images:e[`source-params-web-crawler-parse-options-include-images`],specific_sitemaps:e[`source-params-web-crawler-parse-options-specific-sitemaps`],use_browser_rendering:e[`source-params-web-crawler-parse-options-use-browser-rendering`]},parse_type:e[`source-params-web-crawler-parse-type`]}},summarization:e.summarization,summarization_model:h(e[`summarization-model`],`summarization-model`,`text`),sync_interval:e[`sync-interval`],system_prompt_ai_search:h(e[`system-prompt-ai-search`],`system-prompt-ai-search`,`text`),system_prompt_index_summarization:h(e[`system-prompt-index-summarization`],`system-prompt-index-summarization`,`text`),system_prompt_rewrite_query:h(e[`system-prompt-rewrite-query`],`system-prompt-rewrite-query`,`text`),token_id:h(e[`token-id`],`token-id`,`text`)},[[`source_params`,`web_crawler`,`parse_options`,`include_headers`]]):d(e.body)});return}let l=await r(e),g=e.local?t:await a();if(e.accountId=g,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(l,`PUT`,`/accounts/${g}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}`,{body:t}));o(r,{successLabel:`Updated`});return}let _={};e[`ai-gateway-id`]!==void 0&&p(_,[`ai_gateway_id`],h(e[`ai-gateway-id`],`ai-gateway-id`,`text`)),e[`ai-search-model`]!==void 0&&p(_,[`ai_search_model`],h(e[`ai-search-model`],`ai-search-model`,`text`)),e.cache!==void 0&&p(_,[`cache`],e.cache),e[`cache-threshold`]!==void 0&&p(_,[`cache_threshold`],e[`cache-threshold`]),e[`cache-ttl`]!==void 0&&p(_,[`cache_ttl`],e[`cache-ttl`]),e.chunk!==void 0&&p(_,[`chunk`],e.chunk),e[`chunk-overlap`]!==void 0&&p(_,[`chunk_overlap`],e[`chunk-overlap`]),e[`chunk-size`]!==void 0&&p(_,[`chunk_size`],e[`chunk-size`]),e[`custom-metadata`]!==void 0&&p(_,[`custom_metadata`],u(e[`custom-metadata`],`custom-metadata`)),e[`embedding-model`]!==void 0&&p(_,[`embedding_model`],h(e[`embedding-model`],`embedding-model`,`text`)),e[`fusion-method`]!==void 0&&p(_,[`fusion_method`],e[`fusion-method`]),e[`index-method-keyword`]!==void 0&&p(_,[`index_method`,`keyword`],e[`index-method-keyword`]),e[`index-method-vector`]!==void 0&&p(_,[`index_method`,`vector`],e[`index-method-vector`]),e[`indexing-options-keyword-tokenizer`]!==void 0&&p(_,[`indexing_options`,`keyword_tokenizer`],e[`indexing-options-keyword-tokenizer`]),e[`indexing-options-use-ocr`]!==void 0&&p(_,[`indexing_options`,`use_ocr`],e[`indexing-options-use-ocr`]),e[`max-num-results`]!==void 0&&p(_,[`max_num_results`],e[`max-num-results`]),e[`metadata-created-from-aisearch-wizard`]!==void 0&&p(_,[`metadata`,`created_from_aisearch_wizard`],e[`metadata-created-from-aisearch-wizard`]),e[`metadata-created-from-emdash-plugin-type`]!==void 0&&p(_,[`metadata`,`created_from_emdash_plugin`,`type`],e[`metadata-created-from-emdash-plugin-type`]),e[`metadata-created-from-emdash-plugin-version`]!==void 0&&p(_,[`metadata`,`created_from_emdash_plugin`,`version`],h(e[`metadata-created-from-emdash-plugin-version`],`metadata-created-from-emdash-plugin-version`,`text`)),e[`metadata-worker-domain`]!==void 0&&p(_,[`metadata`,`worker_domain`],h(e[`metadata-worker-domain`],`metadata-worker-domain`,`text`)),e.paused!==void 0&&p(_,[`paused`],e.paused),e[`public-endpoint-params-authorized-hosts`]!==void 0&&p(_,[`public_endpoint_params`,`authorized_hosts`],e[`public-endpoint-params-authorized-hosts`]),e[`public-endpoint-params-chat-completions-endpoint-disabled`]!==void 0&&p(_,[`public_endpoint_params`,`chat_completions_endpoint`,`disabled`],e[`public-endpoint-params-chat-completions-endpoint-disabled`]),e[`public-endpoint-params-custom-domains`]!==void 0&&p(_,[`public_endpoint_params`,`custom_domains`],e[`public-endpoint-params-custom-domains`]),e[`public-endpoint-params-default-domain-enabled`]!==void 0&&p(_,[`public_endpoint_params`,`default_domain_enabled`],e[`public-endpoint-params-default-domain-enabled`]),e[`public-endpoint-params-enabled`]!==void 0&&p(_,[`public_endpoint_params`,`enabled`],e[`public-endpoint-params-enabled`]),e[`public-endpoint-params-mcp-description`]!==void 0&&p(_,[`public_endpoint_params`,`mcp`,`description`],h(e[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`)),e[`public-endpoint-params-mcp-disabled`]!==void 0&&p(_,[`public_endpoint_params`,`mcp`,`disabled`],e[`public-endpoint-params-mcp-disabled`]),e[`public-endpoint-params-rate-limit-period-ms`]!==void 0&&p(_,[`public_endpoint_params`,`rate_limit`,`period_ms`],e[`public-endpoint-params-rate-limit-period-ms`]),e[`public-endpoint-params-rate-limit-requests`]!==void 0&&p(_,[`public_endpoint_params`,`rate_limit`,`requests`],e[`public-endpoint-params-rate-limit-requests`]),e[`public-endpoint-params-rate-limit-technique`]!==void 0&&p(_,[`public_endpoint_params`,`rate_limit`,`technique`],e[`public-endpoint-params-rate-limit-technique`]),e[`public-endpoint-params-search-endpoint-disabled`]!==void 0&&p(_,[`public_endpoint_params`,`search_endpoint`,`disabled`],e[`public-endpoint-params-search-endpoint-disabled`]),e.reranking!==void 0&&p(_,[`reranking`],e.reranking),e[`reranking-model`]!==void 0&&p(_,[`reranking_model`],h(e[`reranking-model`],`reranking-model`,`text`)),e[`retrieval-options-boost-by`]!==void 0&&p(_,[`retrieval_options`,`boost_by`],u(e[`retrieval-options-boost-by`],`retrieval-options-boost-by`)),e[`retrieval-options-keyword-match-mode`]!==void 0&&p(_,[`retrieval_options`,`keyword_match_mode`],e[`retrieval-options-keyword-match-mode`]),e[`rewrite-model`]!==void 0&&p(_,[`rewrite_model`],h(e[`rewrite-model`],`rewrite-model`,`text`)),e[`rewrite-query`]!==void 0&&p(_,[`rewrite_query`],e[`rewrite-query`]),e[`score-threshold`]!==void 0&&p(_,[`score_threshold`],e[`score-threshold`]),e.source!==void 0&&p(_,[`source`],h(e.source,`source`,`text`)),e[`source-params-exclude-items`]!==void 0&&p(_,[`source_params`,`exclude_items`],e[`source-params-exclude-items`]),e[`source-params-include-items`]!==void 0&&p(_,[`source_params`,`include_items`],e[`source-params-include-items`]),e[`source-params-prefix`]!==void 0&&p(_,[`source_params`,`prefix`],h(e[`source-params-prefix`],`source-params-prefix`,`text`)),e[`source-params-r2-jurisdiction`]!==void 0&&p(_,[`source_params`,`r2_jurisdiction`],h(e[`source-params-r2-jurisdiction`],`source-params-r2-jurisdiction`,`text`)),e[`source-params-web-crawler-discover-options-depth`]!==void 0&&p(_,[`source_params`,`web_crawler`,`discover_options`,`depth`],e[`source-params-web-crawler-discover-options-depth`]),e[`source-params-web-crawler-discover-options-include-external-links`]!==void 0&&p(_,[`source_params`,`web_crawler`,`discover_options`,`include_external_links`],e[`source-params-web-crawler-discover-options-include-external-links`]),e[`source-params-web-crawler-discover-options-include-subdomains`]!==void 0&&p(_,[`source_params`,`web_crawler`,`discover_options`,`include_subdomains`],e[`source-params-web-crawler-discover-options-include-subdomains`]),e[`source-params-web-crawler-discover-options-limit`]!==void 0&&p(_,[`source_params`,`web_crawler`,`discover_options`,`limit`],e[`source-params-web-crawler-discover-options-limit`]),e[`source-params-web-crawler-discover-options-max-age`]!==void 0&&p(_,[`source_params`,`web_crawler`,`discover_options`,`max_age`],e[`source-params-web-crawler-discover-options-max-age`]),e[`source-params-web-crawler-discover-options-source`]!==void 0&&p(_,[`source_params`,`web_crawler`,`discover_options`,`source`],e[`source-params-web-crawler-discover-options-source`]),e[`source-params-web-crawler-parse-options-content-selector`]!==void 0&&p(_,[`source_params`,`web_crawler`,`parse_options`,`content_selector`],u(e[`source-params-web-crawler-parse-options-content-selector`],`source-params-web-crawler-parse-options-content-selector`)),e[`source-params-web-crawler-parse-options-include-headers`]!==void 0&&p(_,[`source_params`,`web_crawler`,`parse_options`,`include_headers`],f(e[`source-params-web-crawler-parse-options-include-headers`],`source-params-web-crawler-parse-options-include-headers`)),e[`source-params-web-crawler-parse-options-include-images`]!==void 0&&p(_,[`source_params`,`web_crawler`,`parse_options`,`include_images`],e[`source-params-web-crawler-parse-options-include-images`]),e[`source-params-web-crawler-parse-options-specific-sitemaps`]!==void 0&&p(_,[`source_params`,`web_crawler`,`parse_options`,`specific_sitemaps`],e[`source-params-web-crawler-parse-options-specific-sitemaps`]),e[`source-params-web-crawler-parse-options-use-browser-rendering`]!==void 0&&p(_,[`source_params`,`web_crawler`,`parse_options`,`use_browser_rendering`],e[`source-params-web-crawler-parse-options-use-browser-rendering`]),e[`source-params-web-crawler-parse-type`]!==void 0&&p(_,[`source_params`,`web_crawler`,`parse_type`],e[`source-params-web-crawler-parse-type`]),e.summarization!==void 0&&p(_,[`summarization`],e.summarization),e[`summarization-model`]!==void 0&&p(_,[`summarization_model`],h(e[`summarization-model`],`summarization-model`,`text`)),e[`sync-interval`]!==void 0&&p(_,[`sync_interval`],e[`sync-interval`]),e[`system-prompt-ai-search`]!==void 0&&p(_,[`system_prompt_ai_search`],h(e[`system-prompt-ai-search`],`system-prompt-ai-search`,`text`)),e[`system-prompt-index-summarization`]!==void 0&&p(_,[`system_prompt_index_summarization`],h(e[`system-prompt-index-summarization`],`system-prompt-index-summarization`,`text`)),e[`system-prompt-rewrite-query`]!==void 0&&p(_,[`system_prompt_rewrite_query`],h(e[`system-prompt-rewrite-query`],`system-prompt-rewrite-query`,`text`)),e[`token-id`]!==void 0&&p(_,[`token_id`],h(e[`token-id`],`token-id`,`text`));let v=await c(`Updating`,async()=>n(l,`PUT`,`/accounts/${g}/ai-search/namespaces/${encodeURIComponent(String(e.namespace))}/instances/${encodeURIComponent(String(e[`instance-id`]))}`,{body:_}));o(v,{successLabel:`Updated`})})},Xe={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(re).command(S).command(w).command(E).command(fe).command(me).command(ge).command(ve).command(Me).command(Pe).command(Ie).command(Ye).command(G).command(le).command(Ae).command(qe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Xe as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export{t as createCloudflareClientWithToken,n as createCommandClient}from"./auth-D5Yj9eYU.mjs";import"./context-BvLXzoMs.mjs";import"./oauth-Dnog5v-Q.mjs";import"./auth-token-DvNoIhRL.mjs";
@@ -1,22 +0,0 @@
1
- #!/usr/bin/env node
2
- import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CvzO-cQH.mjs";import{n}from"./auth-D5Yj9eYU.mjs";import{a as r,t as i}from"./context-BvLXzoMs.mjs";import{t as a}from"./output-BJEgbI0G.mjs";import{t as o}from"./dry-run-gy0Hl9xo.mjs";import{t as s}from"./progress-B-CVX0kn.mjs";import{t as c}from"./run-BZ6Fj3jQ.mjs";import"./telemetry-BZdRnr26.mjs";import{a as l,n as u,t as d}from"./body-parser-BKcZS9iJ.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{n as p}from"./prompt-DJF_Rs5S.mjs";var m={method:`POST`,path:()=>`/billing/address-validation`,body:`json`};function h(e){return e.usage(`$0 billing addresses validate
3
-
4
- Validates a billing address and returns validated address suggestions. Authentication is not enforced to support pre-signup address validation flows, so credentials are accepted but not required.`).option(`address`,{type:`string`,description:`Address line 1.`}).option(`address2`,{type:`string`,description:`Address line 2.`}).option(`city`,{type:`string`,description:`City.`}).option(`country`,{type:`string`,description:`Country code.`}).option(`state`,{type:`string`,description:`State or province.`}).option(`zipcode`,{type:`string`,description:`Postal or zip code.`}).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 g={command:`validate`,describe:`Validate Billing Address`,builder:h,handler:async e=>c({command:`billing addresses validate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf billing addresses validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/billing/address-validation`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({address:f(e.address,`address`,`text`),address2:f(e.address2,`address2`,`text`),city:f(e.city,`city`,`text`),country:f(e.country,`country`,`text`),state:f(e.state,`state`,`text`),zipcode:f(e.zipcode,`zipcode`,`text`)}):u(e.body)});return}let t=await n(e);if(e.body){let n=u(e.body),r=await s(`Validating`,async()=>t.send(m,{body:n}));a(r,{successLabel:`Validated`});return}let r=d({address:f(e.address,`address`,`text`),address2:f(e.address2,`address2`,`text`),city:f(e.city,`city`,`text`),country:f(e.country,`country`,`text`),state:f(e.state,`state`,`text`),zipcode:f(e.zipcode,`zipcode`,`text`)}),i=await s(`Validating`,async()=>t.send(m,{body:r}));a(i,{successLabel:`Validated`})})},_={command:`addresses`,describe:`Operations for addresses`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var v={method:`POST`,path:t=>e`/accounts/${t.account_id}/billing/profile/payment-method`};function y(e){return e.usage(`$0 billing profiles create-payment-intent
5
-
6
- Creates a Stripe payment intent for adding or updating a payment method on the account's billing profile. Returns a client secret for frontend payment method collection.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`create-payment-intent`,describe:`Create Payment Intent for Billing Profile`,builder:y,handler:async e=>c({command:`billing profiles create-payment-intent`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf billing profiles create-payment-intent`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/billing/profile/payment-method`,pathParams:{},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Creating`,async()=>c.send(v,{account_id:l}));a(u,{successLabel:`Created`})})};var x={method:`POST`,path:t=>e`/accounts/${t.account_id}/billing/profile`,body:`json`};function S(e){return e.usage(`$0 billing profiles create
7
-
8
- Creates a billing profile for an account.`).option(`address`,{type:`string`,description:`Street address line 1.`}).option(`address2`,{type:`string`,description:`Street address line 2 (apt, suite, etc.).`}).option(`billing-email`,{type:`string`,description:`Primary billing email address.`}).option(`buying-rate-plan`,{type:`string`,description:`Rate plan being purchased right after profile setup.`}).option(`captcha-challenge-jwt`,{type:`string`,description:`Captcha challenge JWT issued during onboarding.`}).option(`cf-turnstile-response`,{type:`string`,description:`Cloudflare Turnstile response.`}).option(`city`,{type:`string`,description:`City on the billing profile.`}).option(`company`,{type:`string`,description:`Company name on the billing profile.`}).option(`country`,{type:`string`,description:`ISO 3166-1 alpha-2 country code.`}).option(`first-name`,{type:`string`,description:`First name on the billing profile.`}).option(`h-captcha-response`,{type:`string`,description:`hCaptcha response.`}).option(`last-name`,{type:`string`,description:`Last name on the billing profile.`}).option(`preferred-locale`,{type:`string`,description:`Preferred locale for invoice rendering (BCP 47).`}).option(`secondary-billing-email`,{type:`string`,description:`Secondary billing email address for CC on invoices.`}).option(`state`,{type:`string`,description:`State or region on the billing profile.`}).option(`tax-id-type`,{type:`string`,description:`Type of tax ID provided.`}).option(`telephone`,{type:`string`,description:`Contact phone number.`}).option(`vat`,{type:`string`,description:`VAT identifier.`}).option(`zipcode`,{type:`string`,description:`ZIP or postal code.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a billing profile.`})}const C={command:`create`,describe:`Create Billing Profile`,builder:S,handler:async e=>c({command:`billing profiles create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf billing profiles create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/billing/profile`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({address:f(e.address,`address`,`text`),address2:f(e.address2,`address2`,`text`),billing_email:f(e[`billing-email`],`billing-email`,`text`),buying_rate_plan:f(e[`buying-rate-plan`],`buying-rate-plan`,`text`),captcha_challenge_jwt:f(e[`captcha-challenge-jwt`],`captcha-challenge-jwt`,`text`),cf_turnstile_response:f(e[`cf-turnstile-response`],`cf-turnstile-response`,`text`),city:f(e.city,`city`,`text`),company:f(e.company,`company`,`text`),country:f(e.country,`country`,`text`),first_name:f(e[`first-name`],`first-name`,`text`),h_captcha_response:f(e[`h-captcha-response`],`h-captcha-response`,`text`),last_name:f(e[`last-name`],`last-name`,`text`),preferred_locale:f(e[`preferred-locale`],`preferred-locale`,`text`),secondary_billing_email:f(e[`secondary-billing-email`],`secondary-billing-email`,`text`),state:f(e.state,`state`,`text`),tax_id_type:f(e[`tax-id-type`],`tax-id-type`,`text`),telephone:f(e.telephone,`telephone`,`text`),vat:f(e.vat,`vat`,`text`),zipcode:f(e.zipcode,`zipcode`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(x,{body:t,account_id:l}));a(n,{successLabel:`Created`});return}let p=d({address:f(e.address,`address`,`text`),address2:f(e.address2,`address2`,`text`),billing_email:f(e[`billing-email`],`billing-email`,`text`),buying_rate_plan:f(e[`buying-rate-plan`],`buying-rate-plan`,`text`),captcha_challenge_jwt:f(e[`captcha-challenge-jwt`],`captcha-challenge-jwt`,`text`),cf_turnstile_response:f(e[`cf-turnstile-response`],`cf-turnstile-response`,`text`),city:f(e.city,`city`,`text`),company:f(e.company,`company`,`text`),country:f(e.country,`country`,`text`),first_name:f(e[`first-name`],`first-name`,`text`),h_captcha_response:f(e[`h-captcha-response`],`h-captcha-response`,`text`),last_name:f(e[`last-name`],`last-name`,`text`),preferred_locale:f(e[`preferred-locale`],`preferred-locale`,`text`),secondary_billing_email:f(e[`secondary-billing-email`],`secondary-billing-email`,`text`),state:f(e.state,`state`,`text`),tax_id_type:f(e[`tax-id-type`],`tax-id-type`,`text`),telephone:f(e.telephone,`telephone`,`text`),vat:f(e.vat,`vat`,`text`),zipcode:f(e.zipcode,`zipcode`,`text`)}),m=await s(`Creating`,async()=>c.send(x,{body:p,account_id:l}));a(m,{successLabel:`Created`})})};var w={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/billing/profile`,response:!1};function T(e){return e.usage(`$0 billing profiles delete
9
-
10
- Deletes the billing profile for an account.`).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 E={command:`delete`,describe:`Delete Billing Profile`,builder:T,handler:async e=>c({command:`billing profiles delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf billing profiles delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/billing/profile`,pathParams:{},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await p({force:!!e.force}))return;let u=await s(`Deleting`,async()=>c.send(w,{account_id:l}));a(u,{successLabel:`Deleted`})})};var D={method:`GET`,path:t=>e`/accounts/${t.account_id}/billing/profile`};function O(e){return e.usage(`$0 billing profiles get
11
-
12
- Gets the current billing profile for the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get`,describe:`Get Billing Profile`,builder:O,handler:async e=>c({command:`billing profiles get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf billing profiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/billing/profile`,pathParams:{},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(D,{account_id:l}));a(u,{successLabel:`Loaded`})})};var A={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/billing/profile`,body:`json`};function j(e){return e.usage(`$0 billing profiles update-email
13
-
14
- Updates the billing email addresses and preferred locale for an account.`).option(`billing-email`,{type:`string`,description:`The billing_email field`}).option(`preferred-locale`,{type:`string`,description:`The preferred_locale field`}).option(`secondary-billing-email`,{type:`string`,description:`The secondary_billing_email 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 M={command:`update-email`,describe:`Update Billing Email`,builder:j,handler:async e=>c({command:`billing profiles update-email`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf billing profiles update-email`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/billing/profile`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({billing_email:f(e[`billing-email`],`billing-email`,`text`),preferred_locale:f(e[`preferred-locale`],`preferred-locale`,`text`),secondary_billing_email:f(e[`secondary-billing-email`],`secondary-billing-email`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(A,{body:t,account_id:l}));a(n,{successLabel:`Updated`});return}let p=d({billing_email:f(e[`billing-email`],`billing-email`,`text`),preferred_locale:f(e[`preferred-locale`],`preferred-locale`,`text`),secondary_billing_email:f(e[`secondary-billing-email`],`secondary-billing-email`,`text`)}),m=await s(`Updating`,async()=>c.send(A,{body:p,account_id:l}));a(m,{successLabel:`Updated`})})};var N={method:`PUT`,path:t=>e`/accounts/${t.account_id}/billing/profile`,body:`json`};function P(e){return e.usage(`$0 billing profiles update
15
-
16
- Updates the billing profile for an account.`).option(`address`,{type:`string`,description:`Street address line 1.`}).option(`address2`,{type:`string`,description:`Street address line 2 (apt, suite, etc.).`}).option(`billing-email`,{type:`string`,description:`Primary billing email address.`}).option(`buying-rate-plan`,{type:`string`,description:`Rate plan being purchased right after profile setup.`}).option(`captcha-challenge-jwt`,{type:`string`,description:`Captcha challenge JWT issued during onboarding.`}).option(`cf-turnstile-response`,{type:`string`,description:`Cloudflare Turnstile response.`}).option(`city`,{type:`string`,description:`City on the billing profile.`}).option(`company`,{type:`string`,description:`Company name on the billing profile.`}).option(`country`,{type:`string`,description:`ISO 3166-1 alpha-2 country code.`}).option(`first-name`,{type:`string`,description:`First name on the billing profile.`}).option(`h-captcha-response`,{type:`string`,description:`hCaptcha response.`}).option(`last-name`,{type:`string`,description:`Last name on the billing profile.`}).option(`preferred-locale`,{type:`string`,description:`Preferred locale for invoice rendering (BCP 47).`}).option(`secondary-billing-email`,{type:`string`,description:`Secondary billing email address for CC on invoices.`}).option(`state`,{type:`string`,description:`State or region on the billing profile.`}).option(`tax-id-type`,{type:`string`,description:`Type of tax ID provided.`}).option(`telephone`,{type:`string`,description:`Contact phone number.`}).option(`vat`,{type:`string`,description:`VAT identifier.`}).option(`zipcode`,{type:`string`,description:`ZIP or postal code.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a billing profile.`})}const F={command:`update`,describe:`Update Billing Profile`,builder:P,handler:async e=>c({command:`billing profiles update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf billing profiles update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/billing/profile`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({address:f(e.address,`address`,`text`),address2:f(e.address2,`address2`,`text`),billing_email:f(e[`billing-email`],`billing-email`,`text`),buying_rate_plan:f(e[`buying-rate-plan`],`buying-rate-plan`,`text`),captcha_challenge_jwt:f(e[`captcha-challenge-jwt`],`captcha-challenge-jwt`,`text`),cf_turnstile_response:f(e[`cf-turnstile-response`],`cf-turnstile-response`,`text`),city:f(e.city,`city`,`text`),company:f(e.company,`company`,`text`),country:f(e.country,`country`,`text`),first_name:f(e[`first-name`],`first-name`,`text`),h_captcha_response:f(e[`h-captcha-response`],`h-captcha-response`,`text`),last_name:f(e[`last-name`],`last-name`,`text`),preferred_locale:f(e[`preferred-locale`],`preferred-locale`,`text`),secondary_billing_email:f(e[`secondary-billing-email`],`secondary-billing-email`,`text`),state:f(e.state,`state`,`text`),tax_id_type:f(e[`tax-id-type`],`tax-id-type`,`text`),telephone:f(e.telephone,`telephone`,`text`),vat:f(e.vat,`vat`,`text`),zipcode:f(e.zipcode,`zipcode`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(N,{body:t,account_id:l}));a(n,{successLabel:`Updated`});return}let p=d({address:f(e.address,`address`,`text`),address2:f(e.address2,`address2`,`text`),billing_email:f(e[`billing-email`],`billing-email`,`text`),buying_rate_plan:f(e[`buying-rate-plan`],`buying-rate-plan`,`text`),captcha_challenge_jwt:f(e[`captcha-challenge-jwt`],`captcha-challenge-jwt`,`text`),cf_turnstile_response:f(e[`cf-turnstile-response`],`cf-turnstile-response`,`text`),city:f(e.city,`city`,`text`),company:f(e.company,`company`,`text`),country:f(e.country,`country`,`text`),first_name:f(e[`first-name`],`first-name`,`text`),h_captcha_response:f(e[`h-captcha-response`],`h-captcha-response`,`text`),last_name:f(e[`last-name`],`last-name`,`text`),preferred_locale:f(e[`preferred-locale`],`preferred-locale`,`text`),secondary_billing_email:f(e[`secondary-billing-email`],`secondary-billing-email`,`text`),state:f(e.state,`state`,`text`),tax_id_type:f(e[`tax-id-type`],`tax-id-type`,`text`),telephone:f(e.telephone,`telephone`,`text`),vat:f(e.vat,`vat`,`text`),zipcode:f(e.zipcode,`zipcode`,`text`)}),m=await s(`Updating`,async()=>c.send(N,{body:p,account_id:l}));a(m,{successLabel:`Updated`})})},I={command:`profiles`,describe:`Billing profile with payment method, address, and invoice preferences`,builder:e=>e.command(C).command(b).command(E).command(k).command(F).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ee={method:`GET`,path:t=>e`/billing/rate_plans/${t.public_key}`};function L(e){return e.usage(`$0 billing rate-plans get <public-key>
17
-
18
- Gets a rate plan's details by its public key (e.g., 'teams_free', 'cf_pro_20_20'). This is a public catalog endpoint, so authentication is not enforced and credentials are accepted but not required.`).positional(`public-key`,{type:`string`,description:`The public key identifier for the rate plan.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`get <public-key>`,describe:`Get Rate Plan by Public Key`,builder:L,handler:async e=>c({command:`billing rate-plans get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf billing rate-plans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/billing/rate_plans/${e[`public-key`]==null?`<public-key>`:encodeURIComponent(String(e[`public-key`]))}`,pathParams:{"public-key":String(e[`public-key`]??``)},bodyKind:`none`});return}let t=await n(e),r=await s(`Loading`,async()=>t.send(ee,{public_key:e[`public-key`]}));a(r,{successLabel:`Loaded`})})},z={command:`rate-plans`,describe:`Operations for rate-plans`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var B={method:`GET`,path:t=>e`/accounts/${t.account_id}/billable/usage/billable-metrics`,query:[`from`,`to`]};function V(e){return e.usage("$0 billing usage get-account-billable-metrics\n\nLists billable metrics available to the account through contracts and subscriptions that overlap the requested period. Results are deduplicated and ordered. If no qualifying contract exists, the result is an empty array. When `from` and `to` are omitted, the period defaults to the start of the current month through today. The maximum date range is 31 days.").option(`from`,{type:`string`,description:"Start date for the usage query (ISO 8601). Required if `to` is set. When omitted along with `to`, defaults to the start of the current month. Filters by charge period (when consumption happened), not billing period. The maximum date range is 31 days."}).option(`to`,{type:`string`,description:"End date for the usage query (ISO 8601). Required if `from` is set. When omitted along with `from`, defaults to today. Filters by charge period (when consumption happened), not billing period. The maximum date range is 31 days."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get-account-billable-metrics`,describe:`List Account Billable Metrics (Version 2, Alpha, Restricted)`,builder:V,handler:async e=>c({command:`billing usage get-account-billable-metrics`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={from:e.from,to:e.to};if(e.dryRun){let e=await r();o({command:`cf billing usage get-account-billable-metrics`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/billable/usage/billable-metrics`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(B,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})};var U={method:`GET`,path:t=>e`/accounts/${t.account_id}/billable/usage`,query:[`from`,`to`]};function W(e){return e.usage("$0 billing usage get-account-usage-v2\n\nReturns cost and usage data for a single Cloudflare account, aligned with the [FinOps FOCUS v1.3](https://focus.finops.org/focus-specification/v1-3/) Cost and Usage dataset specification. Each record represents one billable metric for one account on one day. This includes all metered usage, including usage that falls within free-tier allowances and may result in zero cost. **Note:** This endpoint serves `usage` records only; cost and pricing fields are absent from responses. To retrieve rated costs, use `POST` on the same path with `Metric: cost`. When `from` and `to` are omitted, defaults to the start of the current month through today. The maximum date range is 31 days.").option(`from`,{type:`string`,description:"Start date for the usage query (ISO 8601). Required if `to` is set. When omitted along with `to`, defaults to the start of the current month. Filters by charge period (when consumption happened), not billing period. The maximum date range is 31 days."}).option(`to`,{type:`string`,description:"End date for the usage query (ISO 8601). Required if `from` is set. When omitted along with `from`, defaults to today. Filters by charge period (when consumption happened), not billing period. The maximum date range is 31 days."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`get-account-usage-v2`,describe:`Get Account Usage (Version 2, Alpha, Restricted)`,builder:W,handler:async e=>c({command:`billing usage get-account-usage-v2`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={from:e.from,to:e.to};if(e.dryRun){let e=await r();o({command:`cf billing usage get-account-usage-v2`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/billable/usage`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(U,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})};var K={method:`GET`,path:t=>e`/accounts/${t.account_id}/billable-usage/info`};function q(e){return e.usage(`$0 billing usage get-info-v1
19
-
20
- Returns high-level usage information for the account, including coverage, and subscription metadata.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`get-info-v1`,describe:`Get Account Billable Usage Info (Version 1, Alpha)`,builder:q,handler:async e=>c({command:`billing usage get-info-v1`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf billing usage get-info-v1`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/billable-usage/info`,pathParams:{},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(K,{account_id:l}));a(u,{successLabel:`Loaded`})})};var Y={method:`GET`,path:t=>e`/accounts/${t.account_id}/billable-usage`,query:[`from`,`to`]};function X(e){return e.usage(`$0 billing usage get-v1
21
-
22
- Returns billable usage data for the account. When no query parameters are provided, returns usage for the current billing period.`).option(`from`,{type:`string`,description:`Start date for the usage query (ISO 8601). The provided time range must include the subscription billing cycle anchor day, otherwise no usage data is returned. Use the info endpoint to retrieve the subscription anchor day.`}).option(`to`,{type:`string`,description:`End date for the usage query (ISO 8601).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`get-v1`,describe:`Get Account Billable Usage (Version 1, Alpha)`,builder:X,handler:async e=>c({command:`billing usage get-v1`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={from:e.from,to:e.to};if(e.dryRun){let e=await r();o({command:`cf billing usage get-v1`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/billable-usage`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(Y,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})};var Q={method:`POST`,path:t=>e`/accounts/${t.account_id}/billable/usage`,body:`json`};function $(e){return e.usage("$0 billing usage query\n\nReturns cost and usage data for a single Cloudflare account, aligned with the [FinOps FOCUS v1.3](https://focus.finops.org/focus-specification/v1-3/) Cost and Usage dataset specification. This is the filterable counterpart to `GET` on the same path. It is a read-only operation and requires only the `#billing:read` permission; `POST` is used so that filter criteria can be supplied in a request body rather than in the query string. Each record represents one billable metric for one account on one day. This includes all metered usage, including usage that falls within free-tier allowances and may result in zero cost. **Note:** Cost and pricing fields are populated only when `Metric` is `cost`; otherwise they are absent from responses. The request body is optional. When it is omitted, or when `TimePeriod` is omitted, the range defaults to the start of the current month through today. The maximum date range is 31 days. Filters of different kinds are combined with AND. Values within one tag filter are combined with OR. Filter values that do not match usage produce an empty result set. Results can be grouped by up to two groups, in any combination of dimension keys and resource-tag keys. Tag groups are returned in the `Tags` field. Usage without a requested tag remains in an untagged group, with that key omitted from `Tags`. Requests that use tag filtering or tag grouping return HTTP 400 when the underlying usage data source does not support tags. Requests that use dimension grouping return HTTP 400 when the underlying usage data source does not support dimensions.").option(`filter-by-billable-metric-ids`,{type:`string`,array:!0,description:"Restrict results to rows whose `x_BillableMetricId` matches one of these billable metric ids (e.g. `workers_standard_requests`). Values must be unique."}).option(`filter-by-product-family-ids`,{type:`string`,array:!0,description:`Restrict results to billable metrics belonging to these product families. Values must be unique UUIDs.`}).option(`filter-by-tags`,{type:`string`,description:`Restrict results by resource tags. Filters for different keys are combined with AND, while values within one filter are combined with OR. Keys must be unique and are case-sensitive. Provide as a JSON array of objects or @path/to/file.json.`}).option(`group-by`,{type:`string`,description:`Grouping definitions used to split result rows. At most two unique keys may be supplied. Provide as a JSON array of objects or @path/to/file.json.`}).option(`metric`,{type:`string`,description:"Type of cost/usage records to retrieve. `usage` returns unrated usage quantities. `cost` returns rated usage with cost and pricing fields; it is available only on `POST` account usage and only when the underlying usage data source is ClickHouse (other sources return an empty result set). Requests that combine `cost` with `GroupBy` or `FilterBy.Tags` return HTTP 400. Unrelated to `FilterBy.BillableMetricIds`. Defaults to `usage` when omitted.",choices:[`usage`,`cost`],default:`usage`}).coerce(`metric`,e=>f(e,`metric`,`text`)).option(`time-period-from`,{type:`string`,description:"Start of the range (ISO 8601). Required if `To` is set."}).option(`time-period-to`,{type:`string`,description:"End of the range (ISO 8601). Required if `From` is set. Must be after `From` and no more than 31 days after it."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Filter criteria for a usage query. Every field is optional; an empty object is equivalent to omitting the body entirely. Unknown fields are rejected.`})}const te={command:`query`,describe:`Query Account Usage (Version 2, Alpha, Restricted)`,builder:$,handler:async e=>c({command:`billing usage query`,classification:{safeFlags:[`metric`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf billing usage query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/billable/usage`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({FilterBy:{BillableMetricIds:e[`filter-by-billable-metric-ids`],ProductFamilyIds:e[`filter-by-product-family-ids`],Tags:l(e[`filter-by-tags`],`filter-by-tags`)},GroupBy:l(e[`group-by`],`group-by`),Metric:e.metric,TimePeriod:{From:f(e[`time-period-from`],`time-period-from`,`text`),To:f(e[`time-period-to`],`time-period-to`,`text`)}}):u(e.body)});return}let c=await n(e),p=e.local?t:await i();if(e.accountId=p,e.body){let t=u(e.body),n=await s(`Loading`,async()=>c.send(Q,{body:t,account_id:p}));a(n,{successLabel:`Loaded`});return}let m=d({FilterBy:{BillableMetricIds:e[`filter-by-billable-metric-ids`],ProductFamilyIds:e[`filter-by-product-family-ids`],Tags:l(e[`filter-by-tags`],`filter-by-tags`)},GroupBy:l(e[`group-by`],`group-by`),Metric:e.metric,TimePeriod:{From:f(e[`time-period-from`],`time-period-from`,`text`),To:f(e[`time-period-to`],`time-period-to`,`text`)}}),h=await s(`Loading`,async()=>c.send(Q,{body:m,account_id:p}));a(h,{successLabel:`Loaded`})})},ne={command:`usage`,describe:`Metered usage data for billed services — requests, bandwidth, and feature consumption`,builder:e=>e.command(H).command(G).command(J).command(Z).command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},re={command:`billing`,describe:`Account billing profiles and usage data for Cloudflare subscriptions and add-on services`,builder:e=>e.command(_).command(I).command(z).command(ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{re as default};