cf 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_meta/agent-context.json +1 -1
- package/dist/_meta/commands.json +9 -112
- package/dist/{abuse-reports-BsF9JZPW.mjs → abuse-reports-C6GFnuYE.mjs} +1 -1
- package/dist/{account-D8mYiWxQ.mjs → account-DxzpnGA8.mjs} +1 -1
- package/dist/{accounts-CJci1Oez.mjs → accounts-6RFDuFLF.mjs} +1 -1
- package/dist/{acm-CmCd985Q.mjs → acm-Bndi5Jqo.mjs} +1 -1
- package/dist/{addressing-R7p6TRBe.mjs → addressing-C8HB4n_n.mjs} +1 -1
- package/dist/ai-B4La9Oqk.mjs +8 -0
- package/dist/{ai-audit-B0vJNOZG.mjs → ai-audit-B9kKFhoY.mjs} +1 -1
- package/dist/{ai-gateway-D3vJR3My.mjs → ai-gateway-Bx9MzNxL.mjs} +1 -1
- package/dist/{ai-search-CNg7W7U4.mjs → ai-search-BgIOIgXd.mjs} +1 -1
- package/dist/{alerting-_sdM0B0S.mjs → alerting-DVI-v6mE.mjs} +1 -1
- package/dist/{analytics-BFBJhDrP.mjs → analytics-B98epmDb.mjs} +1 -1
- package/dist/{analytics_engine-CWhFvyeK.mjs → analytics_engine-DwDePA2c.mjs} +1 -1
- package/dist/{api-gateway-D4AIEtUq.mjs → api-gateway-DW2GX64w.mjs} +1 -1
- package/dist/{argo-Bjk6nFfs.mjs → argo-DKEx-B66.mjs} +1 -1
- package/dist/{artifacts-Ba4b3iOa.mjs → artifacts-BEU8fBqt.mjs} +1 -1
- package/dist/{audit-logs-BE0T5All.mjs → audit-logs-DZiEPYL0.mjs} +1 -1
- package/dist/{auth-D_zyQbDR.mjs → auth-009DISzb.mjs} +1 -1
- package/dist/{auth-CZ0E51rF.mjs → auth-B1CY5zpC.mjs} +2 -2
- package/dist/{billing-Dz6Zj8Eq.mjs → billing-10B4_1qb.mjs} +1 -1
- package/dist/{bot-management-pFwIbFi-.mjs → bot-management-D51WzJBO.mjs} +1 -1
- package/dist/{botnet-feed-BY9uGChY.mjs → botnet-feed-Dw-leAwX.mjs} +1 -1
- package/dist/{brand-protection-DkPAk2Cz.mjs → brand-protection-BTYkTsER.mjs} +1 -1
- package/dist/{browser-extension-D9P6Yv8i.mjs → browser-extension-BFa5Ky8u.mjs} +1 -1
- package/dist/{browser-run-DhHtz4y3.mjs → browser-run-BMA8Z_hI.mjs} +1 -1
- package/dist/build-C1FOoThn.mjs +70 -0
- package/dist/{cache-DVhkiIGK.mjs → cache-DrX4gWvg.mjs} +1 -1
- package/dist/{calls-95zjvIcO.mjs → calls-m4WyL1Rb.mjs} +1 -1
- package/dist/{certificate-authorities-BowBqbVq.mjs → certificate-authorities-BA-S8NE-.mjs} +1 -1
- package/dist/{cf-BLT7uKJF.mjs → cf-BhDnTcDR.mjs} +7 -7
- package/dist/chunk-2SIGYDH3-_JSHaszR.mjs +473 -0
- package/dist/{chunk-6IEM75FG-BEjRFMGh.mjs → chunk-Q72B4Q5Z-B-N_eqrM.mjs} +1 -1
- package/dist/{client-certificates-D6mE4vJu.mjs → client-certificates-5h-fXoNq.mjs} +1 -1
- package/dist/{cloud-connector-DmwsjeFN.mjs → cloud-connector-ywFQuqtV.mjs} +1 -1
- package/dist/{cloudforce-one-CG3TT7IN.mjs → cloudforce-one-CPx4C-r3.mjs} +1 -1
- package/dist/{completions-DMc_PlIw.mjs → completions-CCRu-jvY.mjs} +1 -1
- package/dist/{connectivity-DJkE3crz.mjs → connectivity-y-Gav-Ge.mjs} +1 -1
- package/dist/{connector-interrupts-DTgQ7onV.mjs → connector-interrupts-Bs-jfuh8.mjs} +1 -1
- package/dist/{connector-telemetry-events-D0rTHDou.mjs → connector-telemetry-events-Bc6f3xpx.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots--0QmD3z6.mjs → connector-telemetry-snapshots-Bl54XZ3h.mjs} +1 -1
- package/dist/{connectors-zWaZTi2A.mjs → connectors-BnQq_R19.mjs} +1 -1
- package/dist/{content-scanning-CGvGf04y.mjs → content-scanning-Bxk-WkSL.mjs} +1 -1
- package/dist/{ct-alerting-ebSPSWNC.mjs → ct-alerting-BSn2Jqou.mjs} +1 -1
- package/dist/{custom-certificates-CWUrPYLP.mjs → custom-certificates-BBqr4S9W.mjs} +1 -1
- package/dist/{custom-csrs-CRtdrF9R.mjs → custom-csrs-CXeBzLUy.mjs} +1 -1
- package/dist/{custom-hostnames-CVQSksqq.mjs → custom-hostnames-CfCOedoN.mjs} +1 -1
- package/dist/{custom-nameservers-BRwbIdsX.mjs → custom-nameservers-RPXeu7f_.mjs} +1 -1
- package/dist/{custom-pages-Ci8sTQX7.mjs → custom-pages-xGG1xo88.mjs} +1 -1
- package/dist/{d1-78Ym1P6D.mjs → d1-CRIOfBsJ.mjs} +1 -1
- package/dist/{data-security-zmFoMwRU.mjs → data-security-D5Sw5rwj.mjs} +1 -1
- package/dist/{dcv-delegation-Dd4FZ2IG.mjs → dcv-delegation-BBnlgr6F.mjs} +1 -1
- package/dist/deploy-D0_KIUpW.mjs +2 -0
- package/dist/deploy-input-CdWrpzPA.mjs +1178 -0
- package/dist/{dev-DSslyDXx.mjs → dev-Bz87BeKt.mjs} +1 -1
- package/dist/{diagnostics-B8Ev5m_o.mjs → diagnostics-C1qryRf4.mjs} +1 -1
- package/dist/{dispatch-namespaces-Dm5vGeEP.mjs → dispatch-namespaces-DbosPgPV.mjs} +1 -1
- package/dist/{dist-BH-4NQOV.mjs → dist-C-6VkMPZ.mjs} +35 -35
- package/dist/dist-CnaLMpVH.mjs +18 -0
- package/dist/{dns-D7VAaCyO.mjs → dns-ByufYrJH.mjs} +1 -1
- package/dist/{dns-firewall-ByLCsf0q.mjs → dns-firewall-CiokCKRr.mjs} +1 -1
- package/dist/{durable-objects-BIpvyu9m.mjs → durable-objects-DjF-WAD3.mjs} +1 -1
- package/dist/{email-auth-Cx--s8W4.mjs → email-auth-B4BIYMb-.mjs} +1 -1
- package/dist/{email-routing-CiDbivcN.mjs → email-routing-BbbtpVyS.mjs} +1 -1
- package/dist/{email-security-BYeAuSc6.mjs → email-security-DuBVypAO.mjs} +1 -1
- package/dist/{email-sending-Dg2rSmHH.mjs → email-sending-5g-k05Lv.mjs} +1 -1
- package/dist/{filters-DZ8YnQ90.mjs → filters-CzJmLFcS.mjs} +1 -1
- package/dist/{firewall-DEd1hs_I.mjs → firewall-CjmeWA2M.mjs} +1 -1
- package/dist/{flagship-DVw7xGoP.mjs → flagship-BfyVrWP-.mjs} +1 -1
- package/dist/{fraud-BbGS3FZs.mjs → fraud-reRvxNg-.mjs} +1 -1
- package/dist/{google-tag-gateway-CBnRGYQR.mjs → google-tag-gateway-CGwzMZU1.mjs} +1 -1
- package/dist/{healthchecks-Da9N3ix4.mjs → healthchecks-BhCsPWcG.mjs} +1 -1
- package/dist/{hostnames-mimZu2tB.mjs → hostnames-JpgQW4kn.mjs} +1 -1
- package/dist/{hyperdrive-BNdvxOos.mjs → hyperdrive-iwYttuwV.mjs} +1 -1
- package/dist/{iam-DGQ-OgRl.mjs → iam-ffI98_4v.mjs} +1 -1
- package/dist/{images-CI6Iy9ho.mjs → images-Bgb9DGlr.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{intel-BDB-aRtU.mjs → intel-DVRjKpyU.mjs} +1 -1
- package/dist/{ips-B9UuPvsY.mjs → ips-BtLRO19r.mjs} +1 -1
- package/dist/{keyless-certificates-Ua9uJgPt.mjs → keyless-certificates-13w8KOcC.mjs} +1 -1
- package/dist/{kv-BHerx4dZ.mjs → kv-CvQyF_NB.mjs} +1 -1
- package/dist/{leaked-credential-checks-B8Vunj9h.mjs → leaked-credential-checks-DvY8VReW.mjs} +1 -1
- package/dist/{load-balancers-DSjS5WKw.mjs → load-balancers-6lgExyS7.mjs} +1 -1
- package/dist/{logexplorer-DBIfTlRP.mjs → logexplorer-DBfrK1hn.mjs} +1 -1
- package/dist/{logo-matches-C00iGpzW.mjs → logo-matches-XS2RaxQu.mjs} +1 -1
- package/dist/{logos-CJLhx1go.mjs → logos-COtlpbRq.mjs} +1 -1
- package/dist/{logpush-Cr1U-eK-.mjs → logpush-CIpiK3Xl.mjs} +1 -1
- package/dist/{logs-DMvtchc6.mjs → logs-0KjIf_3g.mjs} +1 -1
- package/dist/{magic-cloud-networking-FQfO8QWH.mjs → magic-cloud-networking-q_d9-he-.mjs} +1 -1
- package/dist/{magic-network-monitoring-CDd70fJQ.mjs → magic-network-monitoring-DLNCrUsn.mjs} +1 -1
- package/dist/{magic-transit-DiKiPUax.mjs → magic-transit-sIwSlzoK.mjs} +1 -1
- package/dist/{managed-transforms-fPVUTrAv.mjs → managed-transforms-BKRjmzJS.mjs} +1 -1
- package/dist/{matches-B0yHbQ2I.mjs → matches-DZLS60M2.mjs} +1 -1
- package/dist/{moq-UgBawOXe.mjs → moq-Dbb9QhC1.mjs} +1 -1
- package/dist/{mtls-certificates-xKUbC5EL.mjs → mtls-certificates-BpIqoWpc.mjs} +1 -1
- package/dist/{network-interconnects-BJzOE2ny.mjs → network-interconnects-DZwGJFYT.mjs} +1 -1
- package/dist/{oauth-DBJ5GSFk.mjs → oauth-DC9g9uK_.mjs} +1 -1
- package/dist/{observability-B-1y36QS.mjs → observability-CVLjPAir.mjs} +1 -1
- package/dist/{open-YWOUIZ5Y-CFRcYALi.mjs → open-PBXRGS4R-D5C2-7de.mjs} +1 -1
- package/dist/{organization-Dq3PClZ7.mjs → organization-BGF8N1QQ.mjs} +1 -1
- package/dist/{organizations-AhsQkHyX.mjs → organizations-BInE8nlx.mjs} +1 -1
- package/dist/{origin-ca-certificates-CRgF0UyU.mjs → origin-ca-certificates-wPzWcEa0.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-BXTx7DPa.mjs → origin-post-quantum-encryption-t1Cl9hiy.mjs} +1 -1
- package/dist/{origin-tls-client-auth-BDw5q-6G.mjs → origin-tls-client-auth-Cvr9D8eq.mjs} +1 -1
- package/dist/{page-rules-DqYQ23eg.mjs → page-rules-CMo73oVb.mjs} +1 -1
- package/dist/{page-shield-DKdlZOLO.mjs → page-shield-Z23iqabu.mjs} +1 -1
- package/dist/{pages-BsXF11Kv.mjs → pages-ByaZvYjA.mjs} +1 -1
- package/dist/{pay-per-crawl-BGAwuAP3.mjs → pay-per-crawl-BXTenh_d.mjs} +1 -1
- package/dist/{pipelines-D_QhSnGW.mjs → pipelines-7KWm5BYN.mjs} +1 -1
- package/dist/{progress-O88q63Bk.mjs → progress-BLQ2xXwD.mjs} +1 -1
- package/dist/{prompt-DTAWiEm2.mjs → prompt-DcfYBioA.mjs} +1 -1
- package/dist/{queries-CAE95-OH.mjs → queries-Cgx1lQbn.mjs} +1 -1
- package/dist/{queues-BBz35Mqd.mjs → queues-jnugmCYI.mjs} +1 -1
- package/dist/{r2-Zp99S5xF.mjs → r2-Dllx7F7a.mjs} +1 -1
- package/dist/{r2-data-catalog-BeVLZwrE.mjs → r2-data-catalog-CaAAPwKp.mjs} +1 -1
- package/dist/{radar-Cij-XVQJ.mjs → radar-DLSHX2_1.mjs} +1 -1
- package/dist/{rate-limits-DSdToIWv.mjs → rate-limits-DlVTd6QY.mjs} +1 -1
- package/dist/{raw-fetch-DgezeshQ.mjs → raw-fetch-CeW1mW_u.mjs} +1 -1
- package/dist/{realtime-kit-9rJcapfM.mjs → realtime-kit-ct8Fu2kO.mjs} +1 -1
- package/dist/{registrar-CXViZlah.mjs → registrar-CKTB7QTM.mjs} +1 -1
- package/dist/{registrar-sandbox-CvQyjXLJ.mjs → registrar-sandbox-1-nNk6Uy.mjs} +1 -1
- package/dist/{request-tracers-DATfBnE9.mjs → request-tracers-DO6lno0x.mjs} +1 -1
- package/dist/{resource-sharing-Cmhn6ghR.mjs → resource-sharing-DYhXJw44.mjs} +1 -1
- package/dist/{resource-tagging-BTn05AOj.mjs → resource-tagging-CcKWMF9l.mjs} +1 -1
- package/dist/{rules-ens3OHme.mjs → rules-DQKR3qb7.mjs} +1 -1
- package/dist/{rulesets-bkreZRao.mjs → rulesets-B9fZb_JY.mjs} +1 -1
- package/dist/{rum-CpgXFcwl.mjs → rum-BaJio_GD.mjs} +1 -1
- package/dist/{schema-validation-Ca6o94ts.mjs → schema-validation-Cqv8KT1B.mjs} +1 -1
- package/dist/{scim-C4oT8TMc.mjs → scim-DkYH1dep.mjs} +1 -1
- package/dist/{secrets-store-CWEuiDNo.mjs → secrets-store-CMR_pA1t.mjs} +1 -1
- package/dist/{security-center-BOvm7xy6.mjs → security-center-DCHfgCq6.mjs} +1 -1
- package/dist/{security-txt-BCAUBctN.mjs → security-txt-D19uTyaf.mjs} +1 -1
- package/dist/{session-B1ARgLG7.mjs → session-CQpgz61H.mjs} +1 -1
- package/dist/{share-DhmVspmL.mjs → share-CfJbt0WU.mjs} +1 -1
- package/dist/shared-D0xvDsDl.mjs +2 -0
- package/dist/{smart-shield-DZm4fn6z.mjs → smart-shield-BG5WOmi1.mjs} +1 -1
- package/dist/{snippets-oQ0u26-z.mjs → snippets-CYiSdx7R.mjs} +1 -1
- package/dist/{spawn-ChG5Xi9Z.mjs → spawn-j3dn7A69.mjs} +1 -1
- package/dist/{spectrum-Cnkee5Ww.mjs → spectrum-Qvq3yJax.mjs} +1 -1
- package/dist/{speed-DqNnvLBD.mjs → speed-vpoB9msm.mjs} +1 -1
- package/dist/{src-By-zTCHz.mjs → src-Bn0FyQIp.mjs} +5 -5
- package/dist/{ssl-tS3CYZsZ.mjs → ssl-Qw8eVAiS.mjs} +1 -1
- package/dist/{state-OsdDJvdj.mjs → state-C2cBU9iK.mjs} +1 -1
- package/dist/{stream-Bud9Os5V.mjs → stream-BNbkY3zI.mjs} +1 -1
- package/dist/{submit-BtP8she2.mjs → submit-pQNW7uWj.mjs} +1 -1
- package/dist/{tenant-CMwHa-tU.mjs → tenant-xkvdAutS.mjs} +1 -1
- package/dist/{token-validation-BYC7HTok.mjs → token-validation-5F2AbQCz.mjs} +1 -1
- package/dist/triggers-CYdZhJYr.mjs +2 -0
- package/dist/{turnstile-CP4nScaL.mjs → turnstile-BSIaunXn.mjs} +1 -1
- package/dist/{ui-BNoF0KpD.mjs → ui-CTo5OG9r.mjs} +1 -1
- package/dist/{url-info-Chs9h7Y-.mjs → url-info-Q7m7AVih.mjs} +1 -1
- package/dist/{url-normalization-XYxW5Gj0.mjs → url-normalization-Bs2m5jlD.mjs} +1 -1
- package/dist/{url-scanner-D4pYNlO-.mjs → url-scanner-CYmT3C99.mjs} +1 -1
- package/dist/{user-DtefniLc.mjs → user-Bay_0p3C.mjs} +1 -1
- package/dist/{vectorize-BeAY2g-7.mjs → vectorize-cP2OuB5N.mjs} +1 -1
- package/dist/{versions-dMW3bLVv.mjs → versions-D7F26fhH.mjs} +1 -1
- package/dist/{waiting-rooms-K78HeeTg.mjs → waiting-rooms-B5HR1-37.mjs} +1 -1
- package/dist/{web3-Dhw79l4S.mjs → web3-DqCXM4sx.mjs} +1 -1
- package/dist/{workers-l3zMNOU6.mjs → workers-Cu-A8AZc.mjs} +1 -1
- package/dist/{workers-builds-CuOAB3u4.mjs → workers-builds-CmCg27M-.mjs} +1 -1
- package/dist/{workflows-rb7RYBKP.mjs → workflows-DavS4SEh.mjs} +1 -1
- package/dist/{zaraz-CHecMYuo.mjs → zaraz-CKcVy5Xa.mjs} +1 -1
- package/dist/{zero-trust-DAZoa-Aj.mjs → zero-trust-BKVqb2yq.mjs} +1 -1
- package/dist/{zone-BnnqJwW-.mjs → zone-BOcuY4sU.mjs} +1 -1
- package/dist/{zones-DpI2YikF.mjs → zones-BR-9WaY7.mjs} +1 -1
- package/package.json +5 -4
- package/dist/ai-BzJg0RIX.mjs +0 -3
- package/dist/build-CWuStmDi.mjs +0 -2
- package/dist/chunk-2SIGYDH3-qXx_zE6v.mjs +0 -397
- package/dist/deploy-CVvkZFjR.mjs +0 -2
- package/dist/lib-Og5sB51C.mjs +0 -68
- package/dist/shared-Bod3-Exx.mjs +0 -990
- /package/dist/{schema-DCF4yEp_.mjs → schema-DAW-B7wT.mjs} +0 -0
- /package/dist/{tools-Dru4l8yh.mjs → tools-BpNGzfj2.mjs} +0 -0
package/dist/ai-BzJg0RIX.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{i as n,n as r}from"./auth-CZ0E51rF.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-O88q63Bk.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,t as l}from"./body-parser-BO6mfo_W.mjs";import{n as u,t as d}from"./input-validation-BwUR9z8e.mjs";import{r as f,t as p}from"./prompt-DTAWiEm2.mjs";import{t as m}from"./cli-types-CFw6Xygp.mjs";function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:`Searches Workers AI models by author or organization name.`,builder:h,handler:async n=>{if(n.dryRun){a({command:`cf ai authors list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai/authors/search`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.ai.authors.list({account_id:l})),{successLabel:`Loaded`})}},_={command:`authors`,describe:`Search model authors and publishers in the Workers AI catalog`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.positional(`finetune-id`,{type:`string`,description:`Finetune ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Finetune asset file upload`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`file-name`,{type:`string`,description:`Name of the file (adapter_config.json or adapter_model.safetensors)`})}const y={command:`create <finetune-id>`,describe:`Uploads training data assets for a Workers AI fine-tuning job.`,builder:v,handler:async c=>{if(c.dryRun){a({command:`cf ai finetunes assets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai/finetunes/${c[`finetune-id`]==null?`<finetune-id>`:encodeURIComponent(String(c[`finetune-id`]))}/finetune-assets`,pathParams:{"finetune-id":String(c[`finetune-id`]??``)},bodyKind:`multipart`,body:{body:c.body,file:c.file,"file-name":c[`file-name`]}});return}let l=await r(c),f=c.local?s:await t();if(c.accountId=f,c.file!==void 0||c.body!==void 0||c[`file-name`]!==void 0){let e=new FormData;if(c.file){let t=d(c.file);e.append(`file`,new Blob([t]),c.file.split(/[\\/]/).filter(Boolean).pop())}else c.body!==void 0&&e.append(`file`,c.body);c[`file-name`]!==void 0&&e.append(`file_name`,String(u(c[`file-name`],`file-name`,`text`)??``)),i(await o(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/ai/finetunes/${encodeURIComponent(String(c[`finetune-id`]))}/finetune-assets`,{body:e})),{successLabel:`Created`});return}if(c.body){let e=u(c.body,`body`,`binary`);i(await o(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/ai/finetunes/${encodeURIComponent(String(c[`finetune-id`]))}/finetune-assets`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},b={command:`assets`,describe:`Create and manage fine-tuned model variants trained on your own data`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.option(`description`,{type:`string`,description:`The description field`}).option(`model`,{type:`string`,description:`The model field`}).option(`name`,{type:`string`,description:`The name field`}).option(`public`,{type:`boolean`,description:`The public field`,default:!1}).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 S={command:`create`,describe:`Creates a new fine-tuning job for a Workers AI model using custom training data.`,builder:x,handler:async n=>{if(n.dryRun){a({command:`cf ai finetunes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai/finetunes`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({description:u(n.description,`description`,`text`),model:u(n.model,`model`,`text`),name:u(n.name,`name`,`text`),public:n.public}):c(n.body)});return}let d=await r(n),p=n.local?s:await t();if(n.accountId=p,n.body){let e=c(n.body);i(await o(`Creating`,async()=>d.ai.finetunes.create({...e,account_id:p})),{successLabel:`Created`});return}n.model===void 0&&(n.model=await f(`model`,`The model field`)),n.name===void 0&&(n.name=await f(`name`,`The name field`));let m=l({description:u(n.description,`description`,`text`),model:u(n.model,`model`,`text`),name:u(n.name,`name`,`text`),public:n.public});i(await o(`Creating`,async()=>d.ai.finetunes.create({...m,account_id:p})),{successLabel:`Created`})}};function C(e){return e.positional(`finetune-id`,{type:`string`,description:`Finetune 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 w={command:`delete <finetune-id>`,describe:`Permanently deletes a finetune. D1 rows are removed immediately and R2 objects are moved to a trash bucket with a 30-day lifecycle rule for recovery.`,builder:C,handler:async n=>{if(n.dryRun){a({command:`cf ai finetunes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai/finetunes/${n[`finetune-id`]==null?`<finetune-id>`:encodeURIComponent(String(n[`finetune-id`]))}`,pathParams:{"finetune-id":String(n[`finetune-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await p({force:!!n.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}i(await o(`Deleting`,async()=>c.ai.finetunes.delete({account_id:l,finetune_id:n[`finetune-id`]})),{successLabel:`Deleted`})}};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`list`,describe:`Lists all fine-tuning jobs created by the account, including status and metrics.`,builder:T,handler:async n=>{if(n.dryRun){a({command:`cf ai finetunes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai/finetunes`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.ai.finetunes.list({account_id:l})),{successLabel:`Loaded`})}};function D(e){return e.option(`limit`,{type:`number`,description:`Pagination Limit`}).option(`offset`,{type:`number`,description:`Pagination Offset`}).option(`order-by`,{type:`string`,description:`Order By Column Name`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`Lists publicly available fine-tuned models that can be used with Workers AI.`,builder:D,handler:async n=>{let c={limit:n.limit,offset:n.offset,orderBy:n[`order-by`]};if(n.dryRun){a({command:`cf ai finetunes public list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai/finetunes/public`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.ai.finetunes.public.list({account_id:u,...c})),{successLabel:`Loaded`})}},k={command:`public`,describe:`Create and manage fine-tuned model variants trained on your own data`,builder:e=>e.command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},A={command:`finetunes`,describe:`Create and manage fine-tuned model variants trained on your own data`,builder:e=>e.command(S).command(w).command(E).command(b).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.option(`per-page`,{type:`number`,description:`Per page`}).option(`page`,{type:`number`,description:`Page`}).option(`task`,{type:`string`,description:`Filter by Task Name`}).option(`author`,{type:`string`,description:`Filter by Author`}).option(`source`,{type:`number`,description:`Filter by Source Id`}).option(`hide-experimental`,{type:`boolean`,description:`Filter to hide experimental models`}).option(`search`,{type:`string`,description:`Search`}).option(`include-deprecated`,{type:`boolean`,description:`If true, include models whose planned_deprecation_date is in the past — but only within a three-month grace window after that date. Models whose planned_deprecation_date is more than three months in the past remain hidden regardless of this flag. Future planned-deprecation dates are always included regardless of this flag. Defaults to false, preserving the existing behavior of hiding all past-dated deprecations.`}).option(`format`,{type:`string`,description:`If set, return models in the requested marketplace format instead of the default response.`,choices:[`openrouter`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list`,describe:`Searches Workers AI models by name or description.`,builder:m(j),handler:async n=>{let c={per_page:n[`per-page`],page:n.page,task:n.task,author:n.author,source:n.source,hide_experimental:n[`hide-experimental`],search:n.search,include_deprecated:n[`include-deprecated`],format:n.format};if(n.dryRun){a({command:`cf ai models list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai/models/search`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.ai.models.list({account_id:u,...c})),{successLabel:`Loaded`})}};function N(e){return e.option(`model`,{type:`string`,description:`Model Name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get`,describe:`Retrieves the input and output JSON schema definition for a Workers AI model.`,builder:N,handler:async n=>{let c={model:n.model};if(n.dryRun){a({command:`cf ai models schema get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai/models/schema`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.ai.models.schema.get({account_id:u,...c})),{successLabel:`Loaded`})}},F={command:`schema`,describe:`Search the Workers AI model catalog and retrieve input/output schemas`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},I={command:`models`,describe:`Search the Workers AI model catalog and retrieve input/output schemas`,builder:e=>e.command(M).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.positional(`model-name`,{type:`string`,description:`Model name`,demandOption:!0}).option(`text`,{type:`string`,description:`The text that you want to classify`}).option(`guidance`,{type:`number`,description:`Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt`}).option(`height`,{type:`number`,description:`The height of the generated image in pixels`}).option(`image`,{type:`string`,array:!0,description:`For use with img2img tasks. An array of integers that represent the image data constrained to 8-bit unsigned integer values`}).option(`image-b64`,{type:`string`,description:`For use with img2img tasks. A base64-encoded string of the input image`}).option(`mask`,{type:`string`,array:!0,description:`An array representing An array of integers that represent mask image data for inpainting constrained to 8-bit unsigned integer values`}).option(`negative-prompt`,{type:`string`,description:`Text describing elements to avoid in the generated image`}).option(`num-steps`,{type:`number`,description:`The number of diffusion steps; higher values can improve quality but take longer`}).option(`prompt`,{type:`string`,description:`A text description of the image you want to generate`}).option(`seed`,{type:`number`,description:`Random seed for reproducibility of the image generation`}).option(`strength`,{type:`number`,description:`A value between 0 and 1 indicating how strongly to apply the transformation during img2img tasks; lower values make the output closer to the input image`}).option(`width`,{type:`number`,description:`The width of the generated image in pixels`}).option(`lang`,{type:`string`,description:`The speech language (e.g., 'en' for English, 'fr' for French). Defaults to 'en' if not specified`}).option(`source-lang`,{type:`string`,description:`The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified`}).option(`target-lang`,{type:`string`,description:`The language code to translate the text into (e.g., 'es' for Spanish)`}).option(`input-text`,{type:`string`,description:`The text that you want the model to summarize`}).option(`max-length`,{type:`number`,description:`The maximum length of the generated summary in tokens`}).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)`}).conflicts(`text`,[`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`prompt`,`seed`,`strength`,`width`,`lang`,`input-text`,`max-length`]).conflicts(`guidance`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`height`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`image`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`,`prompt`]).conflicts(`image-b64`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`mask`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`negative-prompt`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`num-steps`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`prompt`,[`text`,`source-lang`,`target-lang`,`input-text`,`max-length`,`image`]).conflicts(`seed`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`strength`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`width`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`lang`,[`text`,`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`seed`,`strength`,`width`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`source-lang`,[`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`prompt`,`seed`,`strength`,`width`,`lang`,`input-text`,`max-length`]).conflicts(`target-lang`,[`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`prompt`,`seed`,`strength`,`width`,`lang`,`input-text`,`max-length`]).implies(`target-lang`,[`text`]).conflicts(`input-text`,[`text`,`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`prompt`,`seed`,`strength`,`width`,`lang`,`source-lang`,`target-lang`]).conflicts(`max-length`,[`text`,`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`prompt`,`seed`,`strength`,`width`,`lang`,`source-lang`,`target-lang`])}const R={command:`run <model-name>`,describe:`This endpoint provides users with the capability to run specific AI models on-demand. By submitting the required input data, users can receive real-time predictions or results generated by the chosen AI model. The endpoint supports various AI model types, ensuring flexibility and adaptability for diverse use cases. Model specific inputs available in [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/).`,builder:L,handler:async n=>{if(n.dryRun){a({command:`cf ai run`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai/run/${n[`model-name`]==null?`<model-name>`:encodeURIComponent(String(n[`model-name`]))}`,pathParams:{"model-name":String(n[`model-name`]??``)},bodyKind:`json`,body:n.body===void 0?l({text:u(n.text,`text`,`text`),guidance:n.guidance,height:n.height,image:n.image,image_b64:u(n[`image-b64`],`image-b64`,`text`),mask:n.mask,negative_prompt:u(n[`negative-prompt`],`negative-prompt`,`text`),num_steps:n[`num-steps`],prompt:u(n.prompt,`prompt`,`text`),seed:n.seed,strength:n.strength,width:n.width,lang:u(n.lang,`lang`,`text`),source_lang:u(n[`source-lang`],`source-lang`,`text`),target_lang:u(n[`target-lang`],`target-lang`,`text`),input_text:u(n[`input-text`],`input-text`,`text`),max_length:n[`max-length`]}):c(n.body)});return}let d=await r(n),f=n.local?s:await t();if(n.accountId=f,n.body){let e=c(n.body);i(await o(`Creating`,async()=>d.ai.run({body:e,account_id:f,model_name:n[`model-name`]})),{successLabel:`Created`});return}let p=l({text:u(n.text,`text`,`text`),guidance:n.guidance,height:n.height,image:n.image,image_b64:u(n[`image-b64`],`image-b64`,`text`),mask:n.mask,negative_prompt:u(n[`negative-prompt`],`negative-prompt`,`text`),num_steps:n[`num-steps`],prompt:u(n.prompt,`prompt`,`text`),seed:n.seed,strength:n.strength,width:n.width,lang:u(n.lang,`lang`,`text`),source_lang:u(n[`source-lang`],`source-lang`,`text`),target_lang:u(n[`target-lang`],`target-lang`,`text`),input_text:u(n[`input-text`],`input-text`,`text`),max_length:n[`max-length`]});i(await o(`Creating`,async()=>d.ai.run({body:p,account_id:f,model_name:n[`model-name`]})),{successLabel:`Created`})}};function z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`list`,describe:`Searches Workers AI models by task type (e.g., text-generation, embeddings).`,builder:z,handler:async n=>{if(n.dryRun){a({command:`cf ai tasks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai/tasks/search`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.ai.tasks.list({account_id:l})),{successLabel:`Loaded`})}},V={command:`tasks`,describe:`Browse supported inference task types (text-generation, image-classification, etc.)`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`supported`,describe:`Lists all file formats supported for conversion to Markdown.`,builder:H,handler:async n=>{if(n.dryRun){a({command:`cf ai to-markdown supported`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai/tomarkdown/supported`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.ai.toMarkdown.supported({account_id:l})),{successLabel:`Loaded`})}};function W(e){return e.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(`files`,{type:`string`,description:`The files`})}const G={command:`transform`,describe:`Converts uploaded files into Markdown format using Workers AI.`,builder:W,handler:async c=>{if(c.dryRun){a({command:`cf ai to-markdown transform`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/ai/tomarkdown`,pathParams:{},bodyKind:`multipart`,body:{body:c.body,file:c.file,files:c.files}});return}let l=await r(c),f=c.local?s:await t();if(c.accountId=f,c.file!==void 0||c.body!==void 0||c.files!==void 0){let e=new FormData;if(c.file){let t=d(c.file);e.append(`file`,new Blob([t]),c.file.split(/[\\/]/).filter(Boolean).pop())}else c.body!==void 0&&e.append(`file`,c.body);if(c.files!==void 0){let t=typeof c.files==`string`?u(c.files,`files`,`text`):c.files;e.append(`files`,typeof t==`string`?t:JSON.stringify(t))}i(await o(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/ai/tomarkdown`,{body:e})),{successLabel:`Created`});return}if(c.body){let e=u(c.body,`body`,`binary`);i(await o(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/ai/tomarkdown`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},K={command:`to-markdown`,describe:`Convert documents and files to clean Markdown using AI-powered extraction`,builder:e=>e.command(U).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},q={command:`ai`,describe:`Run inference on Workers AI models — text generation, image classification, embeddings, and more`,builder:e=>e.command(R).command(_).command(A).command(I).command(V).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{q as default};
|
package/dist/build-CWuStmDi.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./chunk-DH-VkVmc.mjs";import{t}from"./src-By-zTCHz.mjs";import{G as n}from"./chunk-2SIGYDH3-qXx_zE6v.mjs";import{a as r,o as i}from"./theme-DbNbIY4d.mjs";import"./ui-BNoF0KpD.mjs";import{n as a,r as o,t as s}from"./dist-BH-4NQOV.mjs";import{n as c}from"./dist-B7hsuvbF.mjs";import{n as l,t as u}from"./spawn-ChG5Xi9Z.mjs";import*as d from"node:fs";import f from"node:fs";import*as p from"node:path";import m from"node:path";import*as h from"node:fs/promises";const g=`config.json`;function _(e){return p.resolve(e,`.cloudflare/output`)}function v(e){return p.join(_(e),`v0`,g)}function y(e){return p.join(_(e),`v0`,`workers`)}function b(e){return p.join(y(e),`default`)}function x(e){return p.join(b(e),g)}function S(e){return p.join(b(e),`bundle`)}function C(e){return p.join(b(e),`assets`)}var w=Object.defineProperty,T=(e,t)=>w(e,`name`,{value:t,configurable:!0});function E(e){return f.statSync(e,{throwIfNoEntry:!1})?.isDirectory()??!1}T(E,`isDirectory`);function D(e,{fireAndForget:t=!1}={}){let n=f.promises.rm(e,{recursive:!0,force:!0,maxRetries:5,retryDelay:100});if(t)n.catch(()=>{});else return n}T(D,`removeDir`);function O(e){f.rmSync(e,{recursive:!0,force:!0,maxRetries:5,retryDelay:100})}T(O,`removeDirSync`);var k=class extends Error{constructor(e){super(`Build Output Specification: ${e}`),this.name=`BuildOutputError`}};async function A(e){return{root:e,version:`v0`,settings:await M(e),workers:[await j(e)]}}async function j(e){let t=x(e);if(!d.existsSync(t))throw new k(`No Worker config found at ${t}.`);let n=await h.readFile(t,`utf-8`),r=s.safeParse(N(n,t));if(!r.success)throw new k(`invalid Worker config at ${t}.\n${r.error.message}`);let i=S(e),a=C(e),o=d.existsSync(i),c=d.existsSync(a);if(r.data.manifest&&!o)throw new k(`Worker config at ${t} contains a manifest, but no bundle directory exists at ${i}.`);if(o)return{configPath:t,config:r.data,bundleDir:i,assetsDir:c?a:void 0};if(c)return{configPath:t,config:r.data,bundleDir:void 0,assetsDir:a};throw new k(`Worker config at ${t} has neither a bundle directory (${i}) nor an assets directory (${a}).`)}async function M(e){let t=v(e);if(!d.existsSync(t))return;let n=await h.readFile(t,`utf-8`),r=a.safeParse(N(n,t));if(!r.success)throw new k(`invalid root config at ${t}.\n${r.error.message}`);return r.data}function N(e,t){try{return JSON.parse(e)}catch(e){throw new k(`could not parse JSON at ${t}.\n${e instanceof Error?e.message:String(e)}`)}}var P=class extends Error{constructor(e){super(e),this.name=`BuildOutputConfigError`}};function F(e,t){let n=e.config,r=o(n,t);n.manifest?.mainModule&&e.bundleDir&&(r.main=m.join(e.bundleDir,n.manifest.mainModule));let i=m.resolve(`cloudflare.config.ts`);return{wranglerConfig:I(r,e.configPath,i),builtConfig:n}}function I(e,t,r){let{config:i,diagnostics:a}=n(e,t,r,{});if(a.hasErrors())throw new P(a.renderErrors());return a.hasWarnings()&&console.warn(a.renderWarnings()),i}var L=e({default:()=>V,runBuild:()=>z});function R(e){return e.option(`mode`,{type:`string`,alias:`m`,description:`Build mode (e.g. production, staging, preview)`})}async function z(e){let n=l(process.cwd()),a=e?[`--mode`,e]:[];c.message(r.bold(`Build`),{symbol:i.dim(`├`),spacing:0}),c.message(`Delegating to ${B(n)}`,{spacing:0});let o=await u(n,`build`,a);if(o!==0)throw new t(o);let{workers:[s],settings:d}=await A(process.cwd());F(s,d),c.success(`Build complete`,{spacing:0})}function B(e){switch(e.impl.pkg){case`@cloudflare/vite-plugin`:return`Vite`;case`wrangler`:return`Wrangler`;case`cloudflare-py-dev-server`:return`the Python dev server`;case`cloudflare-rs-dev-server`:return`the Rust dev server`;default:return e.impl.pkg}}const V={command:`build`,describe:`Build a project for Cloudflare`,builder:R,handler:async e=>{await z(e.mode)}};export{A as a,F as i,z as n,P as r,L as t};
|