cf 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (352) hide show
  1. package/README.md +15 -5
  2. package/dist/_meta/agent-context.json +13 -5
  3. package/dist/_meta/commands.json +2393 -262
  4. package/dist/_meta/hand-written-commands.json +960 -0
  5. package/dist/_meta/schemas.json +1882 -155
  6. package/dist/{abuse-reports-CGF4zcKf.mjs → abuse-reports-D40QFl-y.mjs} +2 -2
  7. package/dist/{access-lhLJo1v2.mjs → access-Dl2IU1ID.mjs} +1 -1
  8. package/dist/account-CPbieCZ4.mjs +2 -0
  9. package/dist/{account-tags-B88TotoH.mjs → account-tags-skfP7H8k.mjs} +4 -4
  10. package/dist/{accounts-BSIAT_iP.mjs → accounts-CSgR6909.mjs} +12 -12
  11. package/dist/{acm-VULm1djv.mjs → acm-CVvCTaNk.mjs} +1 -1
  12. package/dist/{addressing-BHPBIkRY.mjs → addressing-Uq5hEDDP.mjs} +11 -11
  13. package/dist/{agent-context-KBy48G1b.mjs → agent-context-BvuDdaJb.mjs} +1 -1
  14. package/dist/agent-memory-BrHMIU0E.mjs +6 -0
  15. package/dist/ai-audit-BoZuL84i.mjs +2 -0
  16. package/dist/ai-gateway-DE50Jem1.mjs +13 -0
  17. package/dist/ai-search-Fx7NHCHB.mjs +7 -0
  18. package/dist/ai-security-DyLbY9kv.mjs +4 -0
  19. package/dist/ai-v2fP1r0s.mjs +5 -0
  20. package/dist/{alerting-Bl8OqViR.mjs → alerting-5mFZjTcD.mjs} +1 -1
  21. package/dist/analytics-BygTfozw.mjs +3 -0
  22. package/dist/analytics_engine-4L-q362P.mjs +2 -0
  23. package/dist/{api-security-4FVrD4n8.mjs → api-security-DjFsRYWx.mjs} +20 -20
  24. package/dist/argo-TzXPN7tz.mjs +2 -0
  25. package/dist/args-CDgWUP4J.mjs +2 -0
  26. package/dist/{artifacts-CVDGnr2V.mjs → artifacts-dEw2UUBV.mjs} +1 -1
  27. package/dist/audit-logs-CqY7zzwv.mjs +2 -0
  28. package/dist/auth-CPLdkOC7.mjs +5 -0
  29. package/dist/{auth-MQEamPN9.mjs → auth-DY_Y2bXC.mjs} +3 -3
  30. package/dist/billing-DHQuRT8S.mjs +3 -0
  31. package/dist/body-parser-BGVbwPeM.mjs +2 -0
  32. package/dist/bot-management-CfqG79hF.mjs +5 -0
  33. package/dist/botnet-feed-BOeNnDoH.mjs +3 -0
  34. package/dist/brand-protection-DYttrKIM.mjs +3 -0
  35. package/dist/{browser-extension-BtpCbh-2.mjs → browser-extension-CTUCdgfn.mjs} +1 -1
  36. package/dist/browser-run-373D4e1i.mjs +4 -0
  37. package/dist/build-D0ir_S70.mjs +2 -0
  38. package/dist/{cache-VyWK1SjY.mjs → cache-DJXBmc3w.mjs} +1 -1
  39. package/dist/{calls-BxoRYxs4.mjs → calls-COO0Eoz1.mjs} +1 -1
  40. package/dist/certificate-authorities-DbHLmKbd.mjs +2 -0
  41. package/dist/cf-yPz_IqW6.mjs +18 -0
  42. package/dist/chunk-LQW53VED-9MACsvSG.mjs +119 -0
  43. package/dist/chunk-QBZBEHZB-yeyhVUeD.mjs +2 -0
  44. package/dist/{client-certificates-DDUv8K0a.mjs → client-certificates-RBRqYP3f.mjs} +1 -1
  45. package/dist/{client-side-security-D4ysjwWT.mjs → client-side-security-HOmA37et.mjs} +1 -1
  46. package/dist/cloud-connector-C7hw1c1f.mjs +2 -0
  47. package/dist/cloudforce-one-DLOj76q4.mjs +36 -0
  48. package/dist/command-BV87D4tR.mjs +2 -0
  49. package/dist/{completions-BHE4pRjB.mjs → completions-BnD46cXe.mjs} +3 -3
  50. package/dist/config.d.mts +1451 -1366
  51. package/dist/config.mjs +1 -1
  52. package/dist/connector-interrupts-DY-z_LrH.mjs +2 -0
  53. package/dist/connector-telemetry-events-DCXmcAc9.mjs +2 -0
  54. package/dist/connector-telemetry-snapshots-D8GNuzx3.mjs +2 -0
  55. package/dist/{connectors-BqxYMMtQ.mjs → connectors-fEOn-J_i.mjs} +1 -1
  56. package/dist/containers-BDBsEs7-.mjs +58 -0
  57. package/dist/{content-scan-Dgd7A8KF.mjs → content-scan-Cmj9--XY.mjs} +1 -1
  58. package/dist/{csamScanner-DYL37wLc.mjs → csamScanner-BRXyMCyH.mjs} +1 -1
  59. package/dist/{ct-alerting-CkhSbfAs.mjs → ct-alerting-9AvYys-f.mjs} +1 -1
  60. package/dist/custom-certificates-C5qrlyhb.mjs +5 -0
  61. package/dist/custom-csrs-BgOnTbBW.mjs +3 -0
  62. package/dist/{custom-hostnames-q_nsnlye.mjs → custom-hostnames-CbQD9aYo.mjs} +1 -1
  63. package/dist/custom-nameservers-2ZajBkRC.mjs +3 -0
  64. package/dist/custom-pages-Buki_Cb8.mjs +3 -0
  65. package/dist/d1-n2in0cSF.mjs +20 -0
  66. package/dist/data-security-DzOQMkv3.mjs +7 -0
  67. package/dist/dcv-delegation-BTP9LCOm.mjs +2 -0
  68. package/dist/delegate.mjs +1 -1
  69. package/dist/deploy-BUSz35vq.mjs +2 -0
  70. package/dist/deploy-input-BvD9aRP1.mjs +2 -0
  71. package/dist/dev-DY_DquQx.mjs +4 -0
  72. package/dist/{diagnostics-BTH-8nJH.mjs → diagnostics-BvHV8kQb.mjs} +1 -1
  73. package/dist/{directory-BlH6N6Qy.mjs → directory-BeiSyg8A.mjs} +1 -1
  74. package/dist/{dispatch-namespaces-BCjH1JzB.mjs → dispatch-namespaces-Dp8Jjpwy.mjs} +1 -1
  75. package/dist/dist-BBx1io2f.mjs +2 -0
  76. package/dist/dist-Cb9TJ2VV.mjs +9 -0
  77. package/dist/dist-DV7LR38l.mjs +387 -0
  78. package/dist/dist-DvizctjW.mjs +48 -0
  79. package/dist/{dls-BF5iN78p.mjs → dls-BwoU29mS.mjs} +1 -1
  80. package/dist/{dns-CeCTNqRk.mjs → dns-DISAfuzj.mjs} +13 -13
  81. package/dist/{dns-firewall-B54MaLGm.mjs → dns-firewall-wBcCx_ua.mjs} +1 -1
  82. package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-wwGHcwAa.mjs} +1 -1
  83. package/dist/dry-run-ILZRVpnp.mjs +2 -0
  84. package/dist/durable-objects-DhDL3San.mjs +2 -0
  85. package/dist/email-auth-BROqK6-C.mjs +2 -0
  86. package/dist/email-routing-BZXHDAOO.mjs +6 -0
  87. package/dist/email-security-DVumybrk.mjs +18 -0
  88. package/dist/email-sending-CDQ3_wyz.mjs +7 -0
  89. package/dist/fieldExtractors-Cy1rxHEF.mjs +3 -0
  90. package/dist/{firewall-CBPGJ43p.mjs → firewall-C0g5X7Zd.mjs} +9 -9
  91. package/dist/flagship-fFBiZUz-.mjs +4 -0
  92. package/dist/{fraud-BIhS8pLf.mjs → fraud-CjIETOaM.mjs} +1 -1
  93. package/dist/google-tag-gateway-hPa5IHUx.mjs +2 -0
  94. package/dist/{healthchecks-FiXIk-KP.mjs → healthchecks-CoycpTf9.mjs} +1 -1
  95. package/dist/{hostnames-Bx0mykMR.mjs → hostnames-x_Yezxpr.mjs} +1 -1
  96. package/dist/{hyperdrive-C8qCabBF.mjs → hyperdrive-BlfrTwSq.mjs} +1 -1
  97. package/dist/iam-Bk7K_PPO.mjs +6 -0
  98. package/dist/images-BAEFb9q1.mjs +8 -0
  99. package/dist/index.mjs +1 -1
  100. package/dist/{intel-B-9Z_sJs.mjs → intel-DDkyJVaP.mjs} +1 -1
  101. package/dist/interactive-CRnq-B5I.mjs +11 -0
  102. package/dist/{interactive-DtsCYfrK.mjs → interactive-cytQzL94.mjs} +1 -1
  103. package/dist/ips-DU0ti0i0.mjs +2 -0
  104. package/dist/{keyless-certificates-THHvoXX3.mjs → keyless-certificates-E1P9jBTb.mjs} +1 -1
  105. package/dist/keys-DqldTZqH.mjs +2 -0
  106. package/dist/{kv-BFDUCnft.mjs → kv-CcfCfnwq.mjs} +1 -1
  107. package/dist/{leaked-credential-checks-DUlUCOoJ.mjs → leaked-credential-checks-CqmKaEbd.mjs} +1 -1
  108. package/dist/load-balancers-Dg4pDad1.mjs +6 -0
  109. package/dist/{local-D-aVNu6A.mjs → local-DGiIS1uM.mjs} +1 -1
  110. package/dist/local-runtime--IQr44qq.mjs +2 -0
  111. package/dist/logexplorer-Bu2mG5rh.mjs +17 -0
  112. package/dist/logo-matches-CWUzxY7G.mjs +2 -0
  113. package/dist/logos-BTfdkDPi.mjs +3 -0
  114. package/dist/{logpush-BK34mMQs.mjs → logpush-BZyay3h2.mjs} +1 -1
  115. package/dist/{logs-CLAqX9h2.mjs → logs-BqF7jjQO.mjs} +1 -1
  116. package/dist/{magic-cloud-networking-h_ozrC5S.mjs → magic-cloud-networking-Dhd8pTyM.mjs} +4 -4
  117. package/dist/magic-network-monitoring-D0FnkjuN.mjs +4 -0
  118. package/dist/magic-transit-B5skt0G7.mjs +111 -0
  119. package/dist/managed-transforms-B6X_crcJ.mjs +3 -0
  120. package/dist/matches-DeYaB4I0.mjs +2 -0
  121. package/dist/mcp-ChjBiMx2.mjs +4 -0
  122. package/dist/mesh-DRVAFLBX.mjs +4 -0
  123. package/dist/{moq-qmuVPAO0.mjs → moq-DE7VDEFS.mjs} +1 -1
  124. package/dist/mtls-certificates-Cbc3uAkN.mjs +3 -0
  125. package/dist/{network-D74cSy3t.mjs → network-CDPZNFbn.mjs} +1 -1
  126. package/dist/{network-interconnects-BJ0Nc48J.mjs → network-interconnects-CMRs_chR.mjs} +1 -1
  127. package/dist/oauth-DAa7SwkM.mjs +14 -0
  128. package/dist/{oauth-clients-Br-smLxQ.mjs → oauth-clients-DAI_gcuL.mjs} +1 -1
  129. package/dist/oauth-scopes-BE6xF4_h.mjs +2 -0
  130. package/dist/observability-DnyI8rPJ.mjs +4 -0
  131. package/dist/{open-PBXRGS4R-R-qesf18.mjs → open-PBXRGS4R-DIiYQyU9.mjs} +3 -3
  132. package/dist/{organization-NX7yCZrq.mjs → organization-yh0mSUdI.mjs} +6 -6
  133. package/dist/organizations-B3aU-RCG.mjs +2 -0
  134. package/dist/origin-ca-certificates-BaNWfVqf.mjs +3 -0
  135. package/dist/origin-post-quantum-encryption-CIUtQgyv.mjs +2 -0
  136. package/dist/origin-tls-client-auth-CvEpbX2Q.mjs +4 -0
  137. package/dist/{output-DrpYYfnB.mjs → output-BqDR9h74.mjs} +1 -1
  138. package/dist/page-rules-CzbyXbt6.mjs +27 -0
  139. package/dist/pages-CX8yefTI.mjs +14 -0
  140. package/dist/pay-per-crawl-v4vBOMWD.mjs +4 -0
  141. package/dist/pipelines-BZ1KGupx.mjs +6 -0
  142. package/dist/precursor-D42A9ay5.mjs +4 -0
  143. package/dist/progress-jYW64HY7.mjs +2 -0
  144. package/dist/project-settings-BN7tL0c7.mjs +3 -0
  145. package/dist/prompt-CyATfGUu.mjs +3 -0
  146. package/dist/{public-BwQqexwo-CNW_dPly.mjs → public-BMg6-Hxh-DgIH5obr.mjs} +1 -1
  147. package/dist/queries-xvETUjUE.mjs +3 -0
  148. package/dist/queues-CpqHDtxF.mjs +6 -0
  149. package/dist/{r2-data-catalog-Du7hN9jA.mjs → r2-data-catalog-DgKmlTKR.mjs} +1 -1
  150. package/dist/r2-jhmLvD1z.mjs +24 -0
  151. package/dist/radar-C2J16wpX.mjs +2 -0
  152. package/dist/{rate-limits-yBF3qoYD.mjs → rate-limits-CoH9Xma0.mjs} +1 -1
  153. package/dist/raw-fetch-CNKIypJ7.mjs +2 -0
  154. package/dist/{realtimekit-CIP7lP-a.mjs → realtimekit-CDs0Z5WW.mjs} +1 -1
  155. package/dist/registrar-BI5ewTAk.mjs +23 -0
  156. package/dist/{registrar-sandbox-DiXg8p_1.mjs → registrar-sandbox-al1znWMc.mjs} +4 -4
  157. package/dist/{registry-Bck_zFkz.mjs → registry-5-I2XLwF.mjs} +1 -1
  158. package/dist/reporting-CxsdHAH3.mjs +2 -0
  159. package/dist/request-tracers-DJJCncft.mjs +2 -0
  160. package/dist/{resource-sharing-D1pSDvtf.mjs → resource-sharing-qQGn8AEn.mjs} +1 -1
  161. package/dist/resource-tagging-aTtpX5e5.mjs +2 -0
  162. package/dist/rules-PpsDU89Q.mjs +4 -0
  163. package/dist/rulesets-DP12Aqik.mjs +5 -0
  164. package/dist/rum-DxvpzJYc.mjs +4 -0
  165. package/dist/{schema-B34Q9tLF.mjs → schema-DlLbiOJj.mjs} +1 -1
  166. package/dist/schema-flags-CTfQVGCs.mjs +5 -0
  167. package/dist/schemas-BFCBlp_W.mjs +65 -0
  168. package/dist/{scim-CcSyfKCH.mjs → scim-DJ4AVU20.mjs} +1 -1
  169. package/dist/{secrets-store-DFmvtphu.mjs → secrets-store-D6KDNo_s.mjs} +1 -1
  170. package/dist/security-center-008FMs_z.mjs +2 -0
  171. package/dist/{security-txt-DqnFpjMI.mjs → security-txt-CqcfrhlN.mjs} +1 -1
  172. package/dist/{share-BuwYUzOL.mjs → share-D5fzsVAJ.mjs} +4 -4
  173. package/dist/{deploy-input-CrvuoDGJ.mjs → shared-DlKGNPiT.mjs} +97 -99
  174. package/dist/smart-shield-DpFscIk8.mjs +4 -0
  175. package/dist/snippets-CCKgI2ZX.mjs +4 -0
  176. package/dist/spawn-C3_tJ3RB.mjs +526 -0
  177. package/dist/{spectrum-b7N1ZRAm.mjs → spectrum-LmdqY3ki.mjs} +1 -1
  178. package/dist/{speed-cw31yFva.mjs → speed-CEK36h3A.mjs} +1 -1
  179. package/dist/src-CEb2fgtT.mjs +108 -0
  180. package/dist/{ssl-CsEhRVTO.mjs → ssl-ChHUyaQm.mjs} +1 -1
  181. package/dist/startup-profile-Dpxg-MjV.mjs +17 -0
  182. package/dist/{state-Bb5Cbc_L.mjs → state-DeX23Kmg.mjs} +1 -1
  183. package/dist/{stream-DFOao6Gu.mjs → stream-DfUSELMX.mjs} +13 -13
  184. package/dist/submit-DF2G5CIz.mjs +2 -0
  185. package/dist/tags-nFJJHlLJ.mjs +2 -0
  186. package/dist/tenant-CRLw1oRU.mjs +2 -0
  187. package/dist/tenant-custom-nameservers-BvBQRDcs.mjs +3 -0
  188. package/dist/{tools-BHfBOZOU.mjs → tools-j8UGEtP1.mjs} +1 -1
  189. package/dist/{tunnel-DkMiNtVY.mjs → tunnel-CMQeBgmb.mjs} +1 -1
  190. package/dist/tunnels-iVA3MrdS.mjs +2 -0
  191. package/dist/turnstile-DQHP6-_b.mjs +23 -0
  192. package/dist/{ui-DE8CNn6c.mjs → ui-DJFcf61J.mjs} +1 -1
  193. package/dist/url-info-BVgdb_pf.mjs +2 -0
  194. package/dist/{url-normalization-ClfFiruK.mjs → url-normalization-BTcxLxIQ.mjs} +1 -1
  195. package/dist/url-scanner-DwuDZLPk.mjs +2 -0
  196. package/dist/user-I_MbB_KX.mjs +12 -0
  197. package/dist/values-S-Q7-5o8.mjs +2 -0
  198. package/dist/{vectorize-CVKu7lEt.mjs → vectorize-CNZdF_0A.mjs} +1 -1
  199. package/dist/waiting-rooms-Bo-OSsxu.mjs +11 -0
  200. package/dist/{web-assets-C2s9kzWf.mjs → web-assets-tlFzKdNL.mjs} +1 -1
  201. package/dist/web3-CdbfoZ2x.mjs +4 -0
  202. package/dist/workers-DQ9Q7czn.mjs +28 -0
  203. package/dist/{workers-builds-B55-oXOa.mjs → workers-builds-CGRhYx-x.mjs} +1 -1
  204. package/dist/{workflows-B-kGHxFu.mjs → workflows-BhEy-crm.mjs} +1 -1
  205. package/dist/zaraz-DbKvA_8C.mjs +2 -0
  206. package/dist/{zero-trust-DV3sIOvu.mjs → zero-trust-DrHCPVOc.mjs} +67 -66
  207. package/dist/zone-D2zrbJI2.mjs +2 -0
  208. package/dist/zones-DrpxQ_-A.mjs +21 -0
  209. package/package.json +12 -8
  210. package/dist/account-CYRm3yoN.mjs +0 -2
  211. package/dist/agent-memory-DDv_Gxr7.mjs +0 -6
  212. package/dist/ai-audit-BWZGvbca.mjs +0 -2
  213. package/dist/ai-gateway-jeB-sAgP.mjs +0 -13
  214. package/dist/ai-search-BmdskMjR.mjs +0 -7
  215. package/dist/ai-security-CsmfcaUx.mjs +0 -4
  216. package/dist/ai-viHB1tgI.mjs +0 -5
  217. package/dist/analytics-vOxw8Hy0.mjs +0 -3
  218. package/dist/analytics_engine-DO4-C0wD.mjs +0 -2
  219. package/dist/argo-CQfCgazW.mjs +0 -2
  220. package/dist/args-DlUhyGU0.mjs +0 -2
  221. package/dist/audit-logs-CzpwvQ6A.mjs +0 -2
  222. package/dist/auth-D0xZxAEa.mjs +0 -5
  223. package/dist/billing-aJgapeRm.mjs +0 -3
  224. package/dist/body-parser-C-c9gfH1.mjs +0 -2
  225. package/dist/bot-management-Y2q5d-pi.mjs +0 -5
  226. package/dist/botnet-feed-DANJqfmE.mjs +0 -3
  227. package/dist/brand-protection-CjpZWBjp.mjs +0 -3
  228. package/dist/browser-run-BFn9h2Tz.mjs +0 -4
  229. package/dist/build-DcflwvqN.mjs +0 -2
  230. package/dist/certificate-authorities-D7OAFxF_.mjs +0 -2
  231. package/dist/cf-C7DU4819.mjs +0 -18
  232. package/dist/chunk-LQW53VED-DLrXV-hE.mjs +0 -499
  233. package/dist/cloud-connector-Bhec6z2P.mjs +0 -2
  234. package/dist/cloudforce-one-J_hn9ss9.mjs +0 -36
  235. package/dist/connector-interrupts-Dycx8zFx.mjs +0 -2
  236. package/dist/connector-telemetry-events-BmxOSNtN.mjs +0 -2
  237. package/dist/connector-telemetry-snapshots-CdcqfKnH.mjs +0 -2
  238. package/dist/containers-CKW081JA.mjs +0 -54
  239. package/dist/custom-certificates-BzAOnEoT.mjs +0 -5
  240. package/dist/custom-csrs-CgzG3pd3.mjs +0 -3
  241. package/dist/custom-nameservers-BUBmfhUe.mjs +0 -3
  242. package/dist/custom-pages-M7jA2Hit.mjs +0 -3
  243. package/dist/d1-BFvMd6-S.mjs +0 -20
  244. package/dist/data-security-Bji4Or_j.mjs +0 -7
  245. package/dist/dcv-delegation-BuoRQ1Yh.mjs +0 -2
  246. package/dist/deploy-CZ7bgNDu.mjs +0 -2
  247. package/dist/dev-V10MG-Bg.mjs +0 -4
  248. package/dist/dist-CgrMkXFx.mjs +0 -72
  249. package/dist/durable-objects-D8FQORrL.mjs +0 -2
  250. package/dist/email-auth-DJK0Eb30.mjs +0 -2
  251. package/dist/email-routing-NpmiKIrl.mjs +0 -6
  252. package/dist/email-security-BLZ7WZ9Z.mjs +0 -18
  253. package/dist/email-sending-dn-353Nx.mjs +0 -7
  254. package/dist/fieldExtractors-ahysj57J.mjs +0 -3
  255. package/dist/flagship-BusjRNIb.mjs +0 -4
  256. package/dist/google-tag-gateway-TZZ3F1tV.mjs +0 -2
  257. package/dist/iam-Cj63Kjc6.mjs +0 -6
  258. package/dist/images-CBWXCDhy.mjs +0 -8
  259. package/dist/ips-qs9eGJnI.mjs +0 -2
  260. package/dist/keys-D7N0j4-x.mjs +0 -2
  261. package/dist/load-balancers-D2zbQ8fT.mjs +0 -6
  262. package/dist/local-runtime-Dh3keC5v.mjs +0 -2
  263. package/dist/logexplorer-CUsfZ_bS.mjs +0 -13
  264. package/dist/logo-matches-CJcthPHf.mjs +0 -2
  265. package/dist/logos-BS65zN8q.mjs +0 -3
  266. package/dist/magic-network-monitoring-C7tAPNKP.mjs +0 -4
  267. package/dist/magic-transit-BtsFePMx.mjs +0 -111
  268. package/dist/managed-transforms-Cm_KVCMB.mjs +0 -3
  269. package/dist/matches-InA1hwII.mjs +0 -2
  270. package/dist/mcp-mJ7bekNJ.mjs +0 -4
  271. package/dist/mesh-BK4S1Ezy.mjs +0 -4
  272. package/dist/mtls-certificates-CU4OAAXY.mjs +0 -3
  273. package/dist/oauth-B0ETkNcX.mjs +0 -15
  274. package/dist/oauth-scopes-D5bF11ju.mjs +0 -2
  275. package/dist/observability-BWE0Gg3V.mjs +0 -4
  276. package/dist/organizations-DLhiRt8g.mjs +0 -2
  277. package/dist/origin-ca-certificates-Ff4McZRQ.mjs +0 -3
  278. package/dist/origin-post-quantum-encryption-UuTr4_SW.mjs +0 -2
  279. package/dist/origin-tls-client-auth-DOJ1zlH3.mjs +0 -4
  280. package/dist/page-rules-BSz1gO-_.mjs +0 -18
  281. package/dist/pages-DVDogxPs.mjs +0 -14
  282. package/dist/pay-per-crawl-BrLXK7gT.mjs +0 -4
  283. package/dist/pipelines-BszRk4sM.mjs +0 -6
  284. package/dist/precursor-BPNjQr76.mjs +0 -4
  285. package/dist/progress-CsHIt3Tp.mjs +0 -2
  286. package/dist/prompt-DdegNPpg.mjs +0 -3
  287. package/dist/queries-JL1H1Biz.mjs +0 -3
  288. package/dist/queues-DpkYdRUE.mjs +0 -6
  289. package/dist/r2-CKozthw_.mjs +0 -24
  290. package/dist/radar-C-92vggG.mjs +0 -2
  291. package/dist/raw-fetch-CteyTOM2.mjs +0 -2
  292. package/dist/registrar-DKKN0M29.mjs +0 -21
  293. package/dist/reporting-fg_GKXe1.mjs +0 -2
  294. package/dist/request-tracers-CkMya96z.mjs +0 -2
  295. package/dist/resource-tagging-z48JGHCq.mjs +0 -2
  296. package/dist/rules-BTmNjDN-.mjs +0 -4
  297. package/dist/rulesets-CsoSM-17.mjs +0 -5
  298. package/dist/rum-DB4iO2q5.mjs +0 -4
  299. package/dist/schema-flags-iGoOriJt.mjs +0 -5
  300. package/dist/security-center-DFKeHq5c.mjs +0 -2
  301. package/dist/session-D6KHthHf.mjs +0 -2
  302. package/dist/shared-VppSAQf4.mjs +0 -2
  303. package/dist/smart-shield-D6X8L7p8.mjs +0 -4
  304. package/dist/snippets-DIpc9pb_.mjs +0 -4
  305. package/dist/spawn-O1RS01vr.mjs +0 -523
  306. package/dist/src-D_HETJNy.mjs +0 -108
  307. package/dist/submit--xTzyNPy.mjs +0 -2
  308. package/dist/tags-efICDkah.mjs +0 -2
  309. package/dist/tenant-CerHuToJ.mjs +0 -2
  310. package/dist/tenant-custom-nameservers-C4otMBm2.mjs +0 -3
  311. package/dist/triggers-BEsiiKAf.mjs +0 -2
  312. package/dist/tunnels-D0J8lJoI.mjs +0 -2
  313. package/dist/turnstile-CFmtY5bn.mjs +0 -23
  314. package/dist/url-info-DBCeRWwb.mjs +0 -2
  315. package/dist/url-scanner-CNyvg65L.mjs +0 -2
  316. package/dist/user-bifVEQq5.mjs +0 -12
  317. package/dist/values-OxkdP1tV.mjs +0 -2
  318. package/dist/versions-BVL-Ludh.mjs +0 -2
  319. package/dist/waiting-rooms-CmRAl51T.mjs +0 -11
  320. package/dist/web3-y_cY91V_.mjs +0 -4
  321. package/dist/workers-jDcq14GH.mjs +0 -24
  322. package/dist/zaraz-27zwjLvv.mjs +0 -2
  323. package/dist/zone-BJix2KQ9.mjs +0 -2
  324. package/dist/zones-Bkj5i92c.mjs +0 -21
  325. /package/dist/{alerts-CRmjqOZi.mjs → alerts-9PR5sQ_z.mjs} +0 -0
  326. /package/dist/{autorag-BD7cu5NU.mjs → autorag-Bevo1kIH.mjs} +0 -0
  327. /package/dist/{brands-BhALBkX2.mjs → brands-C4M04Man.mjs} +0 -0
  328. /package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-C3w62dek.mjs} +0 -0
  329. /package/dist/{clear-BgF8No7D.mjs → clear-DS0eRXOc.mjs} +0 -0
  330. /package/dist/{cli-types-BsTty22w.mjs → cli-types-C3nVfpSG.mjs} +0 -0
  331. /package/dist/{connector-telemetry-events-latest-BY2556uL.mjs → connector-telemetry-events-latest-CKKG6_pD.mjs} +0 -0
  332. /package/dist/{connector-telemetry-snapshots-latest-BHYdxUEF.mjs → connector-telemetry-snapshots-latest-Bv5OddJr.mjs} +0 -0
  333. /package/dist/{domain-info-C50W5GhA.mjs → domain-info-BUiaGCEq.mjs} +0 -0
  334. /package/dist/{health-BFNZqiAm.mjs → health-vX6Ml2Na.mjs} +0 -0
  335. /package/dist/{input-validation-Bav2M9F-.mjs → input-validation-1esLElok.mjs} +0 -0
  336. /package/dist/{internal-BTeSewwB.mjs → internal-ROz7anul.mjs} +0 -0
  337. /package/dist/{live-Dkiyu30_.mjs → live-CSxvigCS.mjs} +0 -0
  338. /package/dist/{metadata-8AkOftcB.mjs → metadata-DEqBUaSv.mjs} +0 -0
  339. /package/dist/{rate-limit-analytics-Dz-Wv1T0.mjs → rate-limit-analytics-CgHgKjmV.mjs} +0 -0
  340. /package/dist/{ready-TKOkKeRg.mjs → ready-6G9zVGPJ.mjs} +0 -0
  341. /package/dist/{recent-submissions-3Asm6eIi.mjs → recent-submissions-B3Smh-QM.mjs} +0 -0
  342. /package/dist/{refute-BVz9nMyd.mjs → refute-DjkmLSNe.mjs} +0 -0
  343. /package/dist/{resolve-CeBbH6Pq.mjs → resolve-DEvdeprv.mjs} +0 -0
  344. /package/dist/{scan-logo-ZteA-PUV.mjs → scan-logo-545qLcGs.mjs} +0 -0
  345. /package/dist/{scan-page-DWDSyzQ7.mjs → scan-page-DRQiVufl.mjs} +0 -0
  346. /package/dist/{search-DGNc37HK.mjs → search-CXbqFoqe.mjs} +0 -0
  347. /package/dist/{signed-url-B5Qpn2mn.mjs → signed-url-rU_nvgFA.mjs} +0 -0
  348. /package/dist/{submission-info-FjUolE6A.mjs → submission-info-D6PgXNQP.mjs} +0 -0
  349. /package/dist/{theme-CeVf-5qG.mjs → theme-CrIBazAF.mjs} +0 -0
  350. /package/dist/{total-queries-NHJj1HGq.mjs → total-queries-XkFyu8H5.mjs} +0 -0
  351. /package/dist/{tracked-domains-CniKVHIp.mjs → tracked-domains-CmcRXHj_.mjs} +0 -0
  352. /package/dist/{verify-DS1PWAJe.mjs → verify-CM1NakP0.mjs} +0 -0
package/dist/config.d.mts CHANGED
@@ -1,1645 +1,1730 @@
1
1
 
2
2
  import { Pipeline, PipelineRecord } from "cloudflare:pipelines";
3
3
 
4
- //#region ../../node_modules/.pnpm/@cloudflare+config@0.10.0/node_modules/@cloudflare/config/dist/public-DZgNmLyp.d.mts
5
- //#region src/utils.d.ts
4
+ //#region ../../node_modules/.pnpm/@cloudflare+config@0.17.0/node_modules/@cloudflare/config/dist/public-fVh2BrM5.d.mts
5
+ //#region src/exports.d.ts
6
6
  /**
7
- * Represents any valid JSON value.
7
+ * Storage backend for the Durable Object.
8
+ *
9
+ * Containers are only supported on the SQLite storage engine, so `container` is
10
+ * only offered alongside `storage: "sqlite"`.
8
11
  */
9
- type Json = string | number | boolean | null | Json[] | {
10
- [key: string]: Json;
11
- }; //#endregion
12
- //#region src/bindings.d.ts
13
- /** Options that control a binding during local development. */
14
- interface BindingDevOptions {
15
- /** Whether the binding should connect to the remote resource. */
16
- remote?: boolean;
17
- }
18
- interface AgentMemoryBindingOptions {
19
- /** The user-chosen namespace name. Must exist in Cloudflare at deploy time. */
20
- namespace: string;
21
- /** Options that only apply during local development. */
22
- dev?: BindingDevOptions;
23
- }
12
+ type DurableObjectStorageOptions<TContainer extends ContainerDefinition | undefined = ContainerDefinition | undefined> = {
13
+ /**
14
+ * Selects the SQLite-backed storage engine (recommended for new
15
+ * classes).
16
+ */
17
+ storage: "sqlite";
18
+ /**
19
+ * Attach a Container application to this Durable Object by config reference.
20
+ */
21
+ container?: TContainer;
22
+ } | {
23
+ /** Selects the legacy key-value storage engine. */storage: "legacy-kv";
24
+ };
24
25
  /**
25
- * Agent Memory namespace binding. Each binding is scoped to a namespace and
26
- * allows agents to persist and recall memory.
26
+ * Declares a provisioned Durable Object class exported from this Worker.
27
+ *
28
+ * For more information about Durable Objects, see the documentation at
29
+ * https://developers.cloudflare.com/workers/learning/using-durable-objects
30
+ *
31
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
27
32
  */
28
- interface AgentMemoryBinding extends AgentMemoryBindingOptions {
29
- type: "agent-memory";
30
- }
31
- interface AiBindingOptions {
32
- /** Options that only apply during local development. */
33
- dev?: BindingDevOptions;
34
- }
33
+ type DurableObjectCreatedExportOptions<TContainer extends ContainerDefinition | undefined = ContainerDefinition | undefined> = {
34
+ state?: "created";
35
+ } & DurableObjectStorageOptions<TContainer>;
35
36
  /**
36
- * Binding to the Workers AI project.
37
+ * Retire a provisioned Durable Object namespace whose class has
38
+ * been removed from code.
37
39
  *
38
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
40
+ * During deploy, the class must not be exported in the uploaded code, and no
41
+ * other Worker may hold a `durableObject` binding to the namespace.
39
42
  */
40
- interface AiBinding extends AiBindingOptions {
41
- type: "ai";
43
+ interface DurableObjectDeletedExportOptions {
44
+ state: "deleted";
42
45
  }
43
46
  /**
44
- * Binding to the Workers AI project.
45
- *
46
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
47
+ * Rename a provisioned Durable Object namespace's class. The
48
+ * `renamedTo` value must also appear as a live (`state: "created"`)
49
+ * `durableObject` entry in the same `exports` map.
47
50
  */
48
- interface TypedAiBinding<TAiModelList extends AiModelListType = AiModels> extends AiBinding {
49
- /** @internal Carries type parameters for inference */
50
- __typeParams: [TAiModelList];
51
- }
52
- interface AiSearchBindingOptions {
53
- /** The user-chosen instance name. Must exist in Cloudflare at deploy time. */
54
- name: string;
55
- /** Options that only apply during local development. */
56
- dev?: BindingDevOptions;
51
+ interface DurableObjectRenamedExportOptions {
52
+ state: "renamed";
53
+ /**
54
+ * The destination class name. Must be a valid JavaScript identifier and
55
+ * must appear as a live (`state: "created"`) `durableObject` entry in the
56
+ * same `exports` map.
57
+ */
58
+ renamedTo: string;
57
59
  }
58
60
  /**
59
- * AI Search instance binding. Each binding is bound directly to a single
60
- * pre-existing instance within the "default" namespace.
61
+ * Transfer ownership of a Durable Object namespace to another Worker in the same account.
62
+ * The target Worker must first deploy an `expectingTransfer` entry naming this Worker via `transferFrom`.
61
63
  */
62
- interface AiSearchBinding extends AiSearchBindingOptions {
63
- type: "ai-search";
64
- }
65
- interface AiSearchNamespaceBindingOptions {
66
- /** The user-chosen namespace name. Must exist in Cloudflare at deploy time. */
67
- namespace: string;
68
- /** Options that only apply during local development. */
69
- dev?: BindingDevOptions;
64
+ interface DurableObjectTransferredExportOptions {
65
+ state: "transferred";
66
+ /**
67
+ * The destination Worker. Must reference a Worker in the same account.
68
+ */
69
+ transferredTo: string;
70
70
  }
71
71
  /**
72
- * AI Search namespace binding. Each binding is scoped to a namespace and
73
- * allows dynamic instance CRUD within it.
72
+ * Prepare to receive cross-Worker Durable Object transfer.
73
+ * Once the source Worker's `transferred` export is deployed, this entry becomes a normal live `durable-object` export.
74
74
  */
75
- interface AiSearchNamespaceBinding extends AiSearchNamespaceBindingOptions {
76
- type: "ai-search-namespace";
75
+ type DurableObjectExpectingTransferExportOptions<TContainer extends ContainerDefinition | undefined = ContainerDefinition | undefined> = {
76
+ state: "expecting-transfer";
77
+ /**
78
+ * The source Worker for the two-phase cross-Worker transfer.
79
+ */
80
+ transferFrom: string;
81
+ } & DurableObjectStorageOptions<TContainer>;
82
+ type DurableObjectCreatedExport<TContainer extends ContainerDefinition | undefined = ContainerDefinition | undefined> = DurableObjectCreatedExportOptions<TContainer> & {
83
+ type: "durable-object";
84
+ };
85
+ interface DurableObjectDeletedExport extends DurableObjectDeletedExportOptions {
86
+ type: "durable-object";
77
87
  }
78
- interface AnalyticsEngineDatasetBindingOptions {
79
- /** The name of this dataset to write to. */
80
- name?: string;
88
+ interface DurableObjectRenamedExport extends DurableObjectRenamedExportOptions {
89
+ type: "durable-object";
81
90
  }
82
- /**
83
- * Binding to an Analytics Engine dataset.
84
- *
85
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
86
- */
87
- interface AnalyticsEngineDatasetBinding extends AnalyticsEngineDatasetBindingOptions {
88
- type: "analytics-engine-dataset";
91
+ interface DurableObjectTransferredExport extends DurableObjectTransferredExportOptions {
92
+ type: "durable-object";
89
93
  }
90
- interface ArtifactsBindingOptions {
91
- /** The namespace to use. */
92
- namespace: string;
93
- /** Options that only apply during local development. */
94
- dev?: BindingDevOptions;
94
+ type DurableObjectExpectingTransferExport<TContainer extends ContainerDefinition | undefined = ContainerDefinition | undefined> = DurableObjectExpectingTransferExportOptions<TContainer> & {
95
+ type: "durable-object";
96
+ };
97
+ type DurableObjectExportOptions = DurableObjectCreatedExportOptions | DurableObjectDeletedExportOptions | DurableObjectRenamedExportOptions | DurableObjectTransferredExportOptions | DurableObjectExpectingTransferExportOptions;
98
+ type DurableObjectExports = DurableObjectCreatedExport | DurableObjectDeletedExport | DurableObjectRenamedExport | DurableObjectTransferredExport | DurableObjectExpectingTransferExport;
99
+ interface WorkerEntrypointExportOptions {
100
+ cache?: {
101
+ /** Whether cache is enabled for this entrypoint. */enabled: boolean;
102
+ };
95
103
  }
96
- /**
97
- * Binding to an Artifacts instance. Artifacts provides git-compatible file
98
- * storage on Cloudflare Workers.
99
- */
100
- interface ArtifactsBinding extends ArtifactsBindingOptions {
101
- type: "artifacts";
104
+ interface WorkerEntrypointExport extends WorkerEntrypointExportOptions {
105
+ type: "worker";
102
106
  }
103
107
  /**
104
- * Binding to the Worker's static assets.
105
- *
106
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
108
+ * Configuration for named exports declared by the Worker. Each entry's
109
+ * key is the exported class name; the value configures the export.
107
110
  */
108
- interface AssetsBinding {
109
- type: "assets";
110
- }
111
- interface BrowserBindingOptions {
112
- /** Options that only apply during local development. */
113
- dev?: BindingDevOptions;
111
+ interface Exports {
112
+ /**
113
+ * Declares a Durable Object class defined by this Worker.
114
+ *
115
+ * For more information about Durable Objects, see the documentation at
116
+ * https://developers.cloudflare.com/workers/learning/using-durable-objects
117
+ *
118
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
119
+ */
120
+ durableObject<TContainer extends ContainerDefinition | undefined = undefined>(options: DurableObjectCreatedExportOptions<TContainer>): DurableObjectCreatedExport<TContainer>;
121
+ /**
122
+ * Retire a provisioned Durable Object namespace whose class has been removed from code.
123
+ */
124
+ durableObject(options: DurableObjectDeletedExportOptions): DurableObjectDeletedExport;
125
+ /**
126
+ * Rename a provisioned Durable Object namespace's class.
127
+ */
128
+ durableObject(options: DurableObjectRenamedExportOptions): DurableObjectRenamedExport;
129
+ /**
130
+ * Transfer ownership of a Durable Object namespace to another Worker in the same account.
131
+ */
132
+ durableObject(options: DurableObjectTransferredExportOptions): DurableObjectTransferredExport;
133
+ /**
134
+ * Prepare to receive cross-Worker Durable Object transfer.
135
+ * The source Worker must follow up with a deployment containing a `transferred` export to commit the transfer.
136
+ */
137
+ durableObject<TContainer extends ContainerDefinition | undefined = undefined>(options: DurableObjectExpectingTransferExportOptions<TContainer>): DurableObjectExpectingTransferExport<TContainer>;
138
+ durableObject(options: DurableObjectExportOptions): DurableObjectExports;
139
+ /** Declares a WorkerEntrypoint export defined by this Worker. */
140
+ worker(options?: WorkerEntrypointExportOptions): WorkerEntrypointExport;
114
141
  }
115
142
  /**
116
- * Binding to a headless browser usable from the Worker.
143
+ * Exports builder for configuring Worker exports.
117
144
  *
118
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
145
+ * @example
146
+ * ```typescript
147
+ * import { defineConfig, defineContainer, defineWorker, exports } from "@cloudflare/config";
148
+ *
149
+ * const myContainer = defineContainer({
150
+ * name: "my-container",
151
+ * image: { dockerfile: "./Dockerfile" },
152
+ * });
153
+ *
154
+ * const worker = defineWorker({
155
+ * exports: {
156
+ * MyDurableObject: exports.durableObject({ storage: "sqlite" }),
157
+ * MyContainerDO: exports.durableObject({ storage: "sqlite", container: myContainer }),
158
+ * OldClass: exports.durableObject({ state: "deleted" }),
159
+ * OldName: exports.durableObject({ state: "renamed", renamedTo: "NewName" }),
160
+ * Outgoing: exports.durableObject({ state: "transferred", transferredTo: "target-worker" }),
161
+ * Incoming: exports.durableObject({ state: "expecting-transfer", storage: "sqlite", transferFrom: "source-worker" }),
162
+ * },
163
+ * });
164
+ *
165
+ * export default defineConfig({ worker, containers: [myContainer] });
166
+ * ```
119
167
  */
120
- interface BrowserBinding extends BrowserBindingOptions {
121
- type: "browser";
122
- }
123
- interface D1BindingOptions {
124
- /** The UUID of this D1 database (not required). */
125
- id?: string;
126
- /** The name of this D1 database. */
127
- name?: string;
128
- /** Options that only apply during local development. */
129
- dev?: BindingDevOptions;
130
- }
168
+ declare const exports: Exports; //#endregion
169
+ //#region src/inference.d.ts
131
170
  /**
132
- * Binding to a D1 database.
133
- *
134
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
171
+ * The Worker's entry module, imported with the `{ type: "cf-worker" }` import attribute
172
+ * @example
173
+ * ```ts
174
+ * import * as entrypoint from "./src" with { type: "cf-worker" };
175
+ * ```
135
176
  */
136
- interface D1Binding extends D1BindingOptions {
137
- type: "d1";
138
- }
139
- interface DispatchNamespaceBindingOptions {
140
- /** The namespace to bind to. */
141
- namespace?: string;
142
- /** Details about the outbound Worker which will handle outbound requests from your namespace. */
143
- outbound?: {
144
- /** Name of the Worker handling the outbound requests. */worker: string; /** (Optional) List of parameter names, for sending context from your dispatch Worker to the outbound handler. */
145
- parameters?: string[];
146
- };
147
- /** Options that only apply during local development. */
148
- dev?: BindingDevOptions;
149
- }
177
+ type WorkerModule = Record<string, any>;
150
178
  /**
151
- * Binding to a Workers for Platforms dispatch namespace.
152
- *
153
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
179
+ * Default module type representing an unknown Worker's exports.
180
+ * - default export can be `ExportedHandler` or a `WorkerEntrypoint` class constructor
181
+ * - named exports can be `WorkerEntrypoint`, `DurableObject`, or `WorkflowEntrypoint` class constructors
154
182
  */
155
- interface DispatchNamespaceBinding extends DispatchNamespaceBindingOptions {
156
- type: "dispatch-namespace";
157
- }
158
- interface DurableObjectBindingOptions {
159
- /** The name of the Worker that defines the Durable Object class. */
160
- worker: string;
161
- /** The exported class name of the Durable Object. */
162
- exportName: string;
183
+ interface DefaultModule {
184
+ default?: ExportedHandler | Constructor<Rpc.WorkerEntrypointBranded>;
185
+ [key: string]: ExportedHandler | Constructor<Rpc.WorkerEntrypointBranded> | Constructor<Rpc.DurableObjectBranded> | Constructor<Rpc.WorkflowEntrypointBranded> | undefined;
163
186
  }
164
187
  /**
165
- * Binding to a Durable Object class. `worker` is the name of the Worker
166
- * that defines the class; `exportName` is the exported class name.
167
- *
168
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
188
+ * Represents a class constructor that creates instances of TInstance.
169
189
  */
170
- interface DurableObjectBinding extends DurableObjectBindingOptions {
171
- type: "durable-object";
172
- }
190
+ type Constructor<TInstance> = new (...args: any[]) => TInstance;
173
191
  /**
174
- * Binding to a Durable Object class. `worker` is the name of the Worker
175
- * that defines the class; `exportName` is the exported class name.
176
- *
177
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
192
+ * Extracts the instance type from a class constructor if it extends `TInstance`.
178
193
  */
179
- interface TypedDurableObjectBinding<TConfig$1, TExportName$1 extends string> extends DurableObjectBinding {
180
- worker: string;
181
- exportName: TExportName$1;
182
- /** @internal Carries the config type for inference */
183
- __config: TConfig$1;
184
- }
185
- interface FlagshipBindingOptions {
186
- /** The Flagship app ID to bind to. */
187
- id?: string;
188
- /** Options that only apply during local development. */
189
- dev?: BindingDevOptions;
190
- }
191
- /** Binding to a Flagship feature-flag service. */
192
- interface FlagshipBinding extends FlagshipBindingOptions {
193
- type: "flagship";
194
- }
195
- interface HyperdriveBindingOptions {
196
- /** The ID of the Hyperdrive configuration. */
197
- id: string;
198
- /** Options that only apply during local development. */
199
- dev?: {
200
- /** The database connection string used during local development. */connectionString?: string;
201
- };
202
- }
194
+ type ExtractInstance<T$1, TInstance> = T$1 extends Constructor<TInstance> ? InstanceType<T$1> : never;
203
195
  /**
204
- * Binding to a Hyperdrive configuration.
196
+ * Mapping from binding type literals to Cloudflare runtime types.
205
197
  *
206
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
198
+ * Entries fall into two groups:
199
+ * - Parameterized bindings (ai, json, kv, pipeline, queue, text) refine their
200
+ * runtime type from the binding instance via nominal matches against the
201
+ * `Typed*Binding` / `JsonBinding` / `TextBinding` interfaces from
202
+ * `./bindings`. When `TBinding` does not match, the entry falls back to the
203
+ * unparameterized runtime type.
204
+ * - Non-parameterized bindings map their type literal directly to a runtime
205
+ * type and ignore `TBinding`.
206
+ *
207
+ * IMPORTANT: The right-hand-side identifiers in this map (e.g. `KVNamespace`,
208
+ * `ImagesBinding`, `Fetcher`) must resolve to the ambient runtime types from
209
+ * `@cloudflare/workers-types`, not to local config interfaces. Several local
210
+ * binding interfaces in `./bindings.ts` (`ImagesBinding`, `MediaBinding`,
211
+ * `StreamBinding`) share names with ambient globals — importing those local
212
+ * types into this file silently shadows the globals and breaks `InferEnv`.
213
+ * Only import the `Typed*Binding`, `JsonBinding`, and `TextBinding` interfaces
214
+ * from `./bindings` (their names do not collide with ambient globals); never
215
+ * widen the import to a wildcard or to the plain `*Binding` interfaces.
207
216
  */
208
- interface HyperdriveBinding extends HyperdriveBindingOptions {
209
- type: "hyperdrive";
210
- }
211
- interface ImagesBindingOptions {
212
- /** Options that only apply during local development. */
213
- dev?: BindingDevOptions;
217
+ interface BindingTypeMap<TBinding> {
218
+ ai: TBinding extends TypedAiBinding<infer T> ? Ai<T> : Ai;
219
+ json: TBinding extends JsonBinding<infer T> ? T : never;
220
+ kv: TBinding extends TypedKvBinding<infer T> ? KVNamespace<T> : KVNamespace;
221
+ pipeline: TBinding extends TypedPipelineBinding<infer T> ? Pipeline<T> : Pipeline;
222
+ queue: TBinding extends TypedQueueBinding<infer T> ? Queue<T> : Queue;
223
+ text: TBinding extends TextBinding<infer T> ? T : never;
224
+ "agent-memory": AgentMemoryNamespace;
225
+ "ai-search": AiSearchInstance;
226
+ "ai-search-namespace": AiSearchNamespace;
227
+ "analytics-engine-dataset": AnalyticsEngineDataset;
228
+ artifacts: Artifacts;
229
+ assets: Fetcher;
230
+ browser: BrowserRun;
231
+ d1: D1Database;
232
+ "dispatch-namespace": DispatchNamespace;
233
+ "durable-object": DurableObjectNamespace;
234
+ flagship: Flagship;
235
+ hyperdrive: Hyperdrive;
236
+ images: ImagesBinding;
237
+ logfwdr: any;
238
+ media: MediaBinding;
239
+ "mtls-certificate": Fetcher;
240
+ "rate-limit": RateLimit;
241
+ r2: R2Bucket;
242
+ secret: string;
243
+ "secrets-store-secret": SecretsStoreSecret;
244
+ "send-email": SendEmail;
245
+ stream: StreamBinding;
246
+ vectorize: VectorizeIndex;
247
+ "version-metadata": WorkerVersionMetadata;
248
+ "vpc-service": Fetcher;
249
+ "vpc-network": Fetcher;
250
+ worker: Fetcher;
251
+ "worker-loader": WorkerLoader;
252
+ workflow: Workflow;
214
253
  }
254
+ type SelectedWorkerExportName<TBinding> = TBinding extends {
255
+ exportName?: infer TExportName;
256
+ } ? TExportName extends string ? TExportName : "default" : "default";
257
+ type InferBindingType<TBinding> = TBinding extends {
258
+ type: "worker";
259
+ worker: infer TWorker extends WorkerReference;
260
+ } ? TWorker extends string ? Fetcher : InferMainModule<UnwrapConfig<TWorker>> extends infer TModule extends WorkerModule ? SelectedWorkerExportName<TBinding> extends infer TExportName ? TExportName extends keyof TModule ? TModule[TExportName] extends Constructor<any> ? Fetcher<ExtractInstance<TModule[TExportName], Rpc.WorkerEntrypointBranded>> : Fetcher : never : never : never : TBinding extends {
261
+ type: "durable-object";
262
+ worker: infer TWorker extends WorkerReference;
263
+ exportName: infer TExportName extends string;
264
+ } ? TWorker extends string ? DurableObjectNamespace : InferMainModule<UnwrapConfig<TWorker>> extends infer TModule extends WorkerModule ? TExportName extends keyof TModule ? DurableObjectNamespace<ExtractInstance<TModule[TExportName], Rpc.DurableObjectBranded>> : never : never : TBinding extends {
265
+ type: "workflow";
266
+ worker: infer TWorker extends WorkerReference;
267
+ exportName: infer TExportName extends string;
268
+ } ? TWorker extends string ? Workflow : InferMainModule<UnwrapConfig<TWorker>> extends infer TModule extends WorkerModule ? TExportName extends keyof TModule ? ExtractInstance<TModule[TExportName], Rpc.WorkflowEntrypointBranded> extends infer TWorkflow ? TWorkflow extends {
269
+ run(event: {
270
+ payload: infer P;
271
+ }, step: any): any;
272
+ } ? Workflow<P> : Workflow : Workflow : never : never : TBinding extends {
273
+ type: `unsafe:${string}`;
274
+ } ? any : TBinding extends {
275
+ type: infer K extends keyof BindingTypeMap<TBinding>;
276
+ } ? BindingTypeMap<TBinding>[K] : never;
215
277
  /**
216
- * Binding to Cloudflare Images.
217
- *
218
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
278
+ * Infer export names from a config's exports, optionally filtered by type.
279
+ * When TExportType is `string` (default), returns all export names.
280
+ * When TExportType is a specific literal like `"durable-object"` or `"workflow"`,
281
+ * returns only exports of that type.
219
282
  */
220
- interface ImagesBinding$1 extends ImagesBindingOptions {
221
- type: "images";
222
- }
283
+ type InferExportsByType<TUnwrappedConfig, TExportType extends string = string> = TUnwrappedConfig extends {
284
+ exports: infer TExports extends Record<string, {
285
+ type: string;
286
+ }>;
287
+ } ? { [K in keyof TExports]: TExports[K] extends {
288
+ type: TExportType;
289
+ } ? K & string : never }[keyof TExports] : never;
223
290
  /**
224
- * Inline JSON value made available to the Worker on `env` under the
225
- * binding name.
291
+ * Infer `WorkerEntrypoint` export names from a config.
292
+ * Returns named module exports that are not declared as type `"durable-object"` or `"workflow"` in `exports`.
293
+ * Excludes `"default"` since `exportName` should only be provided for named exports.
226
294
  */
227
- interface JsonBinding<T$1 extends Json = Json> {
228
- type: "json";
229
- /** The JSON value made available to the Worker. */
230
- value: T$1;
231
- }
232
- interface KvBindingOptions {
233
- /** The ID of the KV namespace. */
234
- id?: string;
235
- /** Options that only apply during local development. */
236
- dev?: BindingDevOptions;
237
- }
295
+ type InferWorkerEntrypointExports<TUnwrappedConfig> = Exclude<keyof InferMainModule<TUnwrappedConfig> & string, "default" | InferExportsByType<TUnwrappedConfig, "durable-object" | "workflow">>;
238
296
  /**
239
- * Binding to a Workers KV namespace.
297
+ * Unwrap function and promise types to get the underlying config.
298
+ * Use this to normalize a config before passing it to other inference utilities.
299
+ */
300
+ type UnwrapConfig<TConfig> = TConfig extends ((...args: any[]) => infer TReturn) ? UnwrapConfig<TReturn> : TConfig extends Promise<infer TCompletion> ? UnwrapConfig<TCompletion> : TConfig;
301
+ /**
302
+ * Infer the `Env` interface type from a Worker config.
240
303
  *
241
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
304
+ * Transforms a config object's `env` bindings into their
305
+ * corresponding Cloudflare runtime types.
306
+ *
307
+ * @example
308
+ * ```typescript
309
+ * import { defineWorker, bindings } from "@cloudflare/config";
310
+ * import type { InferEnv, UnwrapConfig } from "@cloudflare/config";
311
+ *
312
+ * const config = defineWorker({
313
+ * env: {
314
+ * MY_JSON: bindings.json({ id: string }),
315
+ * MY_KV: bindings.kv(),
316
+ * },
317
+ * });
318
+ *
319
+ * type WorkerConfig = UnwrapConfig<typeof config>;
320
+ * // Inferred as: { MY_JSON: { id: string }; MY_KV: KVNamespace }
321
+ * export type Env = InferEnv<WorkerConfig>;
322
+ * ```
242
323
  */
243
- interface KvBinding extends KvBindingOptions {
244
- type: "kv";
245
- }
324
+ type InferEnv<TUnwrappedConfig> = TUnwrappedConfig extends {
325
+ env: infer TEnv extends Record<string, any>;
326
+ } ? { [K in keyof TEnv]: InferBindingType<TEnv[K]> } : never;
246
327
  /**
247
- * Binding to a Workers KV namespace.
328
+ * Infer the Durable Object namespace names from a Worker config's exports.
329
+ * Returns a union of export names that declare a *live* Durable Object —
330
+ * `type: "durable-object"` with `state` either omitted, `"created"`, or
331
+ * `"expecting-transfer"`. Tombstone entries (`deleted`, `renamed`,
332
+ * `transferred`) are excluded because they retire the namespace and a
333
+ * binding to a tombstoned class would fail at deploy time.
248
334
  *
249
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
335
+ * @example
336
+ * ```typescript
337
+ * import { defineWorker } from "@cloudflare/config";
338
+ * import type { InferDurableNamespaces, UnwrapConfig } from "@cloudflare/config";
339
+ *
340
+ * const config = defineWorker({
341
+ * exports: {
342
+ * MyDurableObject: { type: "durable-object", storage: "sqlite" },
343
+ * OldGone: { type: "durable-object", state: "deleted" },
344
+ * },
345
+ * });
346
+ *
347
+ * type WorkerConfig = UnwrapConfig<typeof config>;
348
+ * // Inferred as: "MyDurableObject" (the deleted tombstone is excluded)
349
+ * type DurableNamespaces = InferDurableNamespaces<WorkerConfig>;
350
+ * ```
250
351
  */
251
- interface TypedKvBinding<TKey extends string = string> extends KvBinding {
252
- /** @internal Carries type parameters for inference */
253
- __typeParams: [TKey];
254
- }
255
- interface LogfwdrBindingOptions {
256
- /** The destination for this logged message. */
257
- destination: string;
258
- }
259
- /** Binding for forwarding logs to logfwdr. */
260
- interface LogfwdrBinding extends LogfwdrBindingOptions {
261
- type: "logfwdr";
262
- }
263
- interface MediaBindingOptions {
264
- /** Options that only apply during local development. */
265
- dev?: BindingDevOptions;
266
- }
267
- /** Binding to Cloudflare Media Transformations. */
268
- interface MediaBinding$1 extends MediaBindingOptions {
269
- type: "media";
270
- }
271
- interface MtlsCertificateBindingOptions {
272
- /** The UUID of the uploaded mTLS certificate. */
273
- id: string;
274
- /** Options that only apply during local development. */
275
- dev?: BindingDevOptions;
352
+ type InferDurableNamespaces<TUnwrappedConfig> = TUnwrappedConfig extends {
353
+ exports: infer TExports extends Record<string, {
354
+ type: string;
355
+ }>;
356
+ } ? { [K in keyof TExports]: TExports[K] extends {
357
+ type: "durable-object";
358
+ } ? TExports[K] extends {
359
+ state: "deleted" | "renamed" | "transferred";
360
+ } ? never : K & string : never }[keyof TExports] : never;
361
+ /**
362
+ * Infer the main module type from a Worker config's entrypoint.
363
+ * If entrypoint is a module namespace object, returns that type.
364
+ * If entrypoint is a `string` or not present, returns `DefaultModule` as a fallback.
365
+ */
366
+ type InferMainModule<TUnwrappedConfig> = TUnwrappedConfig extends {
367
+ entrypoint: infer TModule extends WorkerModule;
368
+ } ? TModule : DefaultModule; //#endregion
369
+ //#region src/triggers.d.ts
370
+ interface FetchTriggerOptions {
371
+ /**
372
+ * A route that your Worker should be published to.
373
+ *
374
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
375
+ */
376
+ pattern: string;
377
+ /**
378
+ * The DNS zone the pattern is attached to. Required when the
379
+ * pattern is ambiguous.
380
+ */
381
+ zone?: string;
276
382
  }
277
383
  /**
278
- * Binding to an uploaded mTLS certificate.
384
+ * Fetch trigger a route that your Worker should be published to.
279
385
  *
280
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
386
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
281
387
  */
282
- interface MtlsCertificateBinding extends MtlsCertificateBindingOptions {
283
- type: "mtls-certificate";
388
+ interface FetchTrigger extends FetchTriggerOptions {
389
+ type: "fetch";
284
390
  }
285
- interface PipelineBindingOptions {
286
- /** Name of the Pipeline to bind. */
391
+ interface QueueConsumerTriggerOptions {
392
+ /** The name of the queue from which this consumer should consume. */
287
393
  name: string;
288
- /** Options that only apply during local development. */
289
- dev?: BindingDevOptions;
290
- }
291
- /** Binding to a Cloudflare Pipeline. */
292
- interface PipelineBinding extends PipelineBindingOptions {
293
- type: "pipeline";
294
- }
295
- /** Binding to a Cloudflare Pipeline. */
296
- interface TypedPipelineBinding<TRecord extends PipelineRecord = PipelineRecord> extends PipelineBinding {
297
- /** @internal Carries type parameters for inference */
298
- __typeParams: [TRecord];
299
- }
300
- interface QueueBindingOptions {
301
- /** The name of this Queue. */
302
- name?: string;
303
- /** The number of seconds to wait before delivering a message. */
304
- deliveryDelay?: number;
305
- /** Options that only apply during local development. */
306
- dev?: BindingDevOptions;
394
+ /** The queue to send messages that failed to be consumed. */
395
+ deadLetterQueue?: string;
396
+ /** The maximum number of messages per batch. */
397
+ maxBatchSize?: number;
398
+ /** The maximum number of seconds to wait to fill a batch with messages. */
399
+ maxBatchTimeout?: number;
400
+ /**
401
+ * The maximum number of concurrent consumer Worker invocations.
402
+ * Leaving this unset will allow your consumer to scale to the
403
+ * maximum concurrency needed to keep up with the message backlog.
404
+ */
405
+ maxConcurrency?: number | null;
406
+ /** The maximum number of retries for each message. */
407
+ maxRetries?: number;
408
+ /** The number of seconds to wait before retrying a message. */
409
+ retryDelay?: number;
410
+ /** The number of milliseconds to wait for pulled messages to become visible again. */
411
+ visibilityTimeoutMs?: number;
307
412
  }
308
413
  /**
309
- * Producer binding to a Cloudflare Queue.
414
+ * Queue consumer trigger invokes this Worker when messages arrive on the
415
+ * named queue.
310
416
  *
311
417
  * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
312
418
  */
313
- interface QueueBinding extends QueueBindingOptions {
419
+ interface QueueConsumerTrigger extends QueueConsumerTriggerOptions {
314
420
  type: "queue";
315
421
  }
422
+ interface ScheduledTriggerOptions {
423
+ /**
424
+ * A "cron" definition to trigger a Worker's "scheduled" function.
425
+ *
426
+ * Lets you call Workers periodically, much like a cron job.
427
+ *
428
+ * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
429
+ */
430
+ schedule: string;
431
+ }
316
432
  /**
317
- * Producer binding to a Cloudflare Queue.
433
+ * Scheduled (cron) trigger invokes this Worker on the given schedules.
318
434
  *
319
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
435
+ * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
320
436
  */
321
- interface TypedQueueBinding<TBody = unknown> extends QueueBinding {
322
- /** @internal Carries type parameters for inference */
323
- __typeParams: [TBody];
437
+ interface ScheduledTrigger extends ScheduledTriggerOptions {
438
+ type: "scheduled";
324
439
  }
325
- interface R2BindingOptions {
326
- /** The name of this R2 bucket at the edge. */
327
- name?: string;
328
- /** The jurisdiction that the bucket exists in. Default if not present. */
329
- jurisdiction?: string;
330
- /** Settings that only apply to local development. */
331
- dev?: BindingDevOptions & {
332
- /** EXPERIMENTAL: credentials for the local S3-compatible endpoint. */experimentalS3Credentials?: {
333
- accessKeyId: string;
334
- secretAccessKey: string;
335
- };
336
- };
440
+ interface EmailTriggerOptions {
441
+ /**
442
+ * Inbound Email Routing addresses handled by this Worker.
443
+ *
444
+ * Each entry is a literal recipient address (e.g. `"support@example.com"`)
445
+ * or a `*@domain` catch-all (e.g. `"*@example.com"`).
446
+ */
447
+ addresses: string[];
337
448
  }
338
449
  /**
339
- * Binding to an R2 bucket.
340
- *
341
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
450
+ * Email trigger invokes this Worker for the configured Email Routing
451
+ * addresses.
342
452
  */
343
- interface R2Binding extends R2BindingOptions {
344
- type: "r2";
345
- }
346
- interface RateLimitBindingOptions {
347
- /** The namespace ID for this rate limiter. */
348
- namespace: string;
349
- /** Simple rate limiting configuration. */
350
- simple: {
351
- /** The maximum number of requests allowed in the time period. */limit: number; /** The time period in seconds (10 for ten seconds, 60 for one minute). */
352
- period: 10 | 60;
353
- };
453
+ interface EmailTrigger extends EmailTriggerOptions {
454
+ type: "email";
354
455
  }
355
- /** Binding to a rate limiter. */
356
- interface RateLimitBinding extends RateLimitBindingOptions {
357
- type: "rate-limit";
456
+ interface ConnectTriggerOptions {
457
+ /** The transport protocol to listen for. */
458
+ protocol: "tcp";
459
+ /** The port to listen on. */
460
+ port: number;
461
+ /** The address to bind to. Defaults to `127.0.0.1`. */
462
+ address?: string;
358
463
  }
359
464
  /**
360
- * Declares a secret that is required by your Worker, exposed on `env` under
361
- * the binding name.
362
- *
363
- * When defined, this binding:
364
- * - Replaces .dev.vars/.env/process.env inference for type generation
365
- * - Enables local dev validation with warnings for missing secrets
366
- *
367
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#secrets-configuration-property
465
+ * Connect trigger invokes this Worker's `connect(socket, env, ctx)`
466
+ * handler for raw socket connections received on the configured
467
+ * protocol/port.
368
468
  */
369
- interface SecretBinding {
370
- type: "secret";
371
- }
372
- interface SecretsStoreSecretBindingOptions {
373
- /** ID of the secret store. */
374
- storeId: string;
375
- /** Name of the secret. */
376
- secretName: string;
377
- }
378
- /** Binding to a Secrets Store secret. */
379
- interface SecretsStoreSecretBinding extends SecretsStoreSecretBindingOptions {
380
- type: "secrets-store-secret";
469
+ interface ConnectTrigger extends ConnectTriggerOptions {
470
+ type: "connect";
381
471
  }
382
- type SendEmailDestinationOptions = {
383
- /** If this binding should be restricted to a specific verified address. */destinationAddress: string;
384
- allowedDestinationAddresses?: never;
385
- } | {
386
- destinationAddress?: never; /** If this binding should be restricted to a set of verified addresses. */
387
- allowedDestinationAddresses: string[];
388
- } | {
389
- destinationAddress?: never;
390
- allowedDestinationAddresses?: never;
391
- };
392
- type SendEmailBindingOptions = SendEmailDestinationOptions & {
393
- /** If this binding should be restricted to a set of sender addresses. */allowedSenderAddresses?: string[]; /** Options that only apply during local development. */
394
- dev?: BindingDevOptions;
395
- };
396
472
  /**
397
- * Binding for sending email from inside the Worker.
473
+ * Event triggers fetch routes, queue consumers, cron schedules, Email
474
+ * Routing addresses, and raw sockets — that invoke this Worker.
475
+ * Construct entries with `triggers.fetch(...)`, `triggers.queue(...)`,
476
+ * `triggers.scheduled(...)`, `triggers.email(...)`, or `triggers.connect(...)`.
398
477
  *
399
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
478
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
400
479
  */
401
- type SendEmailBinding = SendEmailBindingOptions & {
402
- type: "send-email";
403
- };
404
- interface StreamBindingOptions {
405
- /** Options that only apply during local development. */
406
- dev?: BindingDevOptions;
407
- }
408
- /** Binding to Cloudflare Stream. */
409
- interface StreamBinding$1 extends StreamBindingOptions {
410
- type: "stream";
480
+ interface Triggers {
481
+ /**
482
+ * Fetch trigger — a route that your Worker should be published to.
483
+ *
484
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
485
+ */
486
+ fetch(options: FetchTriggerOptions): FetchTrigger;
487
+ /**
488
+ * Queue consumer trigger — invokes this Worker when messages arrive on the
489
+ * named queue.
490
+ *
491
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
492
+ */
493
+ queue(options: QueueConsumerTriggerOptions): QueueConsumerTrigger;
494
+ /**
495
+ * Scheduled (cron) trigger — invokes this Worker on the given schedules.
496
+ *
497
+ * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
498
+ */
499
+ scheduled(options: ScheduledTriggerOptions): ScheduledTrigger;
500
+ /**
501
+ * Email trigger — invokes this Worker for the configured Email Routing
502
+ * addresses.
503
+ */
504
+ email(options: EmailTriggerOptions): EmailTrigger;
505
+ /**
506
+ * Connect trigger — invokes this Worker's `connect(socket, env, ctx)`
507
+ * handler for raw socket connections received on the configured
508
+ * protocol/port.
509
+ */
510
+ connect(options: ConnectTriggerOptions): ConnectTrigger;
411
511
  }
412
512
  /**
413
- * Inline string value made available to the Worker on `env` under the
414
- * binding name.
513
+ * Triggers builder for configuring event triggers.
415
514
  *
416
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
515
+ * @example
516
+ * ```typescript
517
+ * import { defineConfig, triggers } from "@cloudflare/config";
518
+ *
519
+ * export default defineConfig({
520
+ * worker: {
521
+ * name: "my-worker",
522
+ * compatibilityDate: "2026-09-17",
523
+ * triggers: [
524
+ * triggers.fetch({ pattern: "example.com/*", zone: "example.com" }),
525
+ * triggers.queue({ name: "my-queue" }),
526
+ * triggers.scheduled({ schedule: "0 * * * *" }),
527
+ * triggers.scheduled({ schedule: "30 0 * * *" }),
528
+ * triggers.email({ addresses: ["support@example.com"] }),
529
+ * triggers.connect({ protocol: "tcp", port: 5432 }),
530
+ * ],
531
+ * },
532
+ * });
533
+ * ```
417
534
  */
418
- interface TextBinding<T$1 extends string = string> {
419
- type: "text";
420
- /** The string value made available to the Worker. */
421
- value: T$1;
535
+ declare const triggers: Triggers; //#endregion
536
+ //#region src/types.d.ts
537
+ /** Account-level values shared by the resources in a configuration. */
538
+ interface Settings {
539
+ /**
540
+ * This is the ID of the account associated with your zone. It can also be
541
+ * specified through the `CLOUDFLARE_ACCOUNT_ID` environment variable.
542
+ */
543
+ accountId?: string;
544
+ /**
545
+ * The compliance boundary in which commands should operate. When omitted,
546
+ * this can be supplied through `CLOUDFLARE_COMPLIANCE_REGION`.
547
+ */
548
+ complianceRegion?: "public" | "fedramp-high";
422
549
  }
423
- interface UnsafeBindingOptions {
424
- /** Local-dev plugin configuration for this unsafe binding. */
425
- dev?: {
426
- /** The plugin package that provides the binding's local-dev implementation. */plugin: {
427
- package: string;
428
- name: string;
429
- }; /** Plugin-specific options. */
430
- options?: Record<string, unknown>;
431
- };
432
- [key: string]: unknown;
550
+ /** The authored shape of `cloudflare.config.ts`'s default export. */
551
+ interface CloudflareConfig extends Settings {
552
+ /** The Worker defined by this configuration. */
553
+ worker?: ConfigInput<WorkerConfig>;
554
+ /** Container applications defined by this configuration. */
555
+ containers?: ConfigInput<ContainerConfig>[];
433
556
  }
434
557
  /**
435
- * Escape-hatch binding for runtime features that aren't directly supported
436
- * by this configuration. Included in the Worker's upload metadata without
437
- * changes.
558
+ * Union of all binding definitions accepted in `env`.
438
559
  */
439
- interface UnsafeBinding extends UnsafeBindingOptions {
440
- type: `unsafe:${string}`;
441
- }
442
- interface VectorizeBindingOptions {
443
- /** The name of the Vectorize index. */
444
- name: string;
445
- /** Options that only apply during local development. */
446
- dev?: BindingDevOptions;
447
- }
560
+ type Binding = AgentMemoryBinding | AiBinding | AiSearchBinding | AiSearchNamespaceBinding | AnalyticsEngineDatasetBinding | ArtifactsBinding | AssetsBinding | BrowserBinding | D1Binding | DispatchNamespaceBinding | DurableObjectBinding | FlagshipBinding | HyperdriveBinding | ImagesBinding$1 | JsonBinding | KvBinding | LogfwdrBinding | MediaBinding$1 | MtlsCertificateBinding | PipelineBinding | QueueBinding | R2Binding | RateLimitBinding | SecretBinding | SecretsStoreSecretBinding | SendEmailBinding | StreamBinding$1 | TextBinding | UnsafeBinding | VectorizeBinding | VersionMetadataBinding | VpcNetworkBinding | VpcServiceBinding | WorkerBinding | WorkerLoaderBinding;
448
561
  /**
449
- * Binding to a Vectorize index.
450
- *
451
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
562
+ * Union of all trigger definitions accepted in `triggers`.
452
563
  */
453
- interface VectorizeBinding extends VectorizeBindingOptions {
454
- type: "vectorize";
455
- }
456
- /** Binding to the Worker version's metadata. */
457
- interface VersionMetadataBinding {
458
- type: "version-metadata";
459
- }
460
- type VpcNetworkBindingOptions = {
461
- /** The tunnel ID of the Cloudflare Tunnel to route traffic through. Mutually exclusive with `networkId`. */tunnelId: string;
462
- networkId?: never; /** Options that only apply during local development. */
463
- dev?: BindingDevOptions;
464
- } | {
465
- tunnelId?: never; /** The network ID to route traffic through. Mutually exclusive with `tunnelId`. */
466
- networkId: string; /** Options that only apply during local development. */
467
- dev?: BindingDevOptions;
468
- };
469
- /** Binding to a VPC network. */
470
- type VpcNetworkBinding = VpcNetworkBindingOptions & {
471
- type: "vpc-network";
472
- };
473
- interface VpcServiceBindingOptions {
474
- /** The service ID of the VPC connectivity service. */
475
- id: string;
476
- /** Options that only apply during local development. */
477
- dev?: BindingDevOptions;
478
- }
479
- /** Binding to a VPC service. */
480
- interface VpcServiceBinding extends VpcServiceBindingOptions {
481
- type: "vpc-service";
482
- }
483
- interface WebSearchBindingOptions {
484
- /** Options that only apply during local development. */
485
- dev?: BindingDevOptions;
486
- }
487
- /**
488
- * Cloudflare Web Search binding. There is exactly one shared web corpus, so
489
- * the binding is zero-config — only the variable name is required.
490
- */
491
- interface WebSearchBinding extends WebSearchBindingOptions {
492
- type: "web-search";
493
- }
494
- interface WorkerBindingOptions {
495
- /** The name of the bound Worker. */
496
- worker: string;
497
- /** The named export to bind to (defaults to the default export). */
498
- exportName?: string;
499
- /** Optional properties that will be made available to the service via `ctx.props`. */
500
- props?: Record<string, unknown>;
501
- /** Options that only apply during local development. */
502
- dev?: BindingDevOptions;
503
- }
504
- /**
505
- * Service binding (Worker-to-Worker). `worker` is the name of the bound
506
- * Worker; `exportName` selects a named `WorkerEntrypoint` export (defaults to
507
- * the default export).
508
- *
509
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
510
- */
511
- interface WorkerBinding extends WorkerBindingOptions {
512
- type: "worker";
513
- }
514
- /**
515
- * Service binding (Worker-to-Worker). `worker` is the name of the bound
516
- * Worker; `exportName` selects a named `WorkerEntrypoint` export (defaults to
517
- * the default export).
518
- *
519
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
520
- */
521
- interface TypedWorkerBinding<TConfig$1, TExportName$1 extends string> extends WorkerBinding {
522
- worker: string;
523
- exportName: TExportName$1;
524
- /** @internal Carries the config type for inference */
525
- __config: TConfig$1;
526
- }
527
- /** Binding to a Worker Loader. */
528
- interface WorkerLoaderBinding {
529
- type: "worker-loader";
530
- }
531
- interface WorkflowBindingOptions {
532
- /** The name of the Worker that defines the Workflow. */
533
- worker: string;
534
- /** The exported class name of the Workflow. */
535
- exportName: string;
536
- }
537
- /**
538
- * Binding to a Workflow. `worker` is the name of the Worker that defines
539
- * the Workflow; `exportName` is the exported `WorkflowEntrypoint` class name.
540
- */
541
- interface WorkflowBinding extends WorkflowBindingOptions {
542
- type: "workflow";
543
- }
564
+ type Trigger = ConnectTrigger | EmailTrigger | FetchTrigger | QueueConsumerTrigger | ScheduledTrigger;
544
565
  /**
545
- * Binding to a Workflow. `worker` is the name of the Worker that defines
546
- * the Workflow; `exportName` is the exported `WorkflowEntrypoint` class name.
566
+ * Union of all export definitions accepted in `exports`. Worker entries
567
+ * configure WorkerEntrypoint exports. Durable Object entries configure live
568
+ * classes and tombstone lifecycle operations.
547
569
  */
548
- interface TypedWorkflowBinding<TConfig$1, TExportName$1 extends string> extends WorkflowBinding {
549
- worker: string;
550
- exportName: TExportName$1;
551
- /** @internal Carries the config type for inference */
552
- __config: TConfig$1;
553
- }
554
- interface Bindings {
555
- /**
556
- * Agent Memory namespace binding. Each binding is scoped to a namespace and
557
- * allows agents to persist and recall memory.
558
- */
559
- agentMemory(options: AgentMemoryBindingOptions): AgentMemoryBinding;
570
+ type Export = DurableObjectCreatedExport | DurableObjectDeletedExport | DurableObjectRenamedExport | DurableObjectTransferredExport | DurableObjectExpectingTransferExport | WorkerEntrypointExport;
571
+ /** An image source accepted in an authored Container configuration. */
572
+ type ContainerImage = {
573
+ /** The path to a Dockerfile. */dockerfile: string;
560
574
  /**
561
- * Binding to the Workers AI project.
575
+ * Build context of the application.
562
576
  *
563
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
564
- */
565
- ai<TAiModelList extends AiModelListType = AiModels>(options?: AiBindingOptions): TypedAiBinding<TAiModelList>;
566
- /**
567
- * AI Search instance binding. Each binding is bound directly to a single
568
- * pre-existing instance within the "default" namespace.
577
+ * @default The directory containing `dockerfile`.
569
578
  */
570
- aiSearch(options: AiSearchBindingOptions): AiSearchBinding;
571
- /**
572
- * AI Search namespace binding. Each binding is scoped to a namespace and
573
- * allows dynamic instance CRUD within it.
574
- */
575
- aiSearchNamespace(options: AiSearchNamespaceBindingOptions): AiSearchNamespaceBinding;
579
+ buildContext?: string; /** Image variables available to the image at build time only. */
580
+ buildVars?: Record<string, string>;
581
+ } | {
576
582
  /**
577
- * Binding to an Analytics Engine dataset.
583
+ * Reference to an existing image.
578
584
  *
579
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
585
+ * For supported registries, refer to
586
+ * https://developers.cloudflare.com/containers/guides/image-management/#use-pre-built-container-images
580
587
  */
581
- analyticsEngineDataset(options?: AnalyticsEngineDatasetBindingOptions): AnalyticsEngineDatasetBinding;
588
+ reference: string;
589
+ };
590
+ /** Application-wide observability settings shared by all Containers. */
591
+ interface ContainerObservabilityConfig {
592
+ /** Whether observability is enabled. */
593
+ enabled?: boolean;
594
+ logs?: {
595
+ /** Whether log collection is enabled. */enabled?: boolean;
596
+ };
597
+ }
598
+ /** Observability settings for a standard Container application. */
599
+ type StandardContainerObservabilityConfig = ContainerObservabilityConfig & ({
600
+ /** Percentage of Container instances targeted for observability. */targetInstancePercentage?: number;
601
+ targetInstanceCount?: never;
602
+ } | {
603
+ targetInstancePercentage?: never; /** Number of Container instances targeted for observability. */
604
+ targetInstanceCount?: number;
605
+ });
606
+ /** Fields shared by all Container application configurations. */
607
+ interface BaseContainerConfig {
582
608
  /**
583
- * Binding to an Artifacts instance. Artifacts provides git-compatible file
584
- * storage on Cloudflare Workers.
609
+ * Name of the application.
610
+ *
611
+ * This is also the identifier used to reference the Container from a Durable
612
+ * Object's `exports` entry via its `container` field.
585
613
  */
586
- artifacts(options: ArtifactsBindingOptions): ArtifactsBinding;
614
+ name: string;
587
615
  /**
588
- * Binding to the Worker's static assets.
616
+ * Passed through without client-side validation or transformation.
589
617
  *
590
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
618
+ * @hidden
591
619
  */
592
- assets(): AssetsBinding;
620
+ unsafe?: Record<string, unknown>;
621
+ }
622
+ /** A Container application managed with a standard scheduling policy. */
623
+ interface StandardContainerConfig extends BaseContainerConfig {
624
+ /** Configures observability and optional targeting for Container instances. */
625
+ observability?: StandardContainerObservabilityConfig;
626
+ /** The image to build or deploy. */
627
+ image: ContainerImage;
593
628
  /**
594
- * Binding to a headless browser usable from the Worker.
629
+ * Maximum number of application instances.
595
630
  *
596
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
631
+ * @default 20
597
632
  */
598
- browser(options?: BrowserBindingOptions): BrowserBinding;
633
+ maxInstances?: number;
599
634
  /**
600
- * Binding to a D1 database.
635
+ * The instance type to be used for the Container.
636
+ * Select from one of the following named instance types:
601
637
  *
602
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
638
+ * - lite: 1/16 vCPU, 256 MiB memory, and 2 GB disk
639
+ * - basic: 1/4 vCPU, 1 GiB memory, and 4 GB disk
640
+ * - standard-1: 1/2 vCPU, 4 GiB memory, and 8 GB disk
641
+ * - standard-2: 1 vCPU, 6 GiB memory, and 12 GB disk
642
+ * - standard-3: 2 vCPU, 8 GiB memory, and 16 GB disk
643
+ * - standard-4: 4 vCPU, 12 GiB memory, and 20 GB disk
644
+ *
645
+ * Customers on an enterprise plan have the additional option to set custom
646
+ * limits.
647
+ *
648
+ * @default "lite"
603
649
  */
604
- d1(options?: D1BindingOptions): D1Binding;
650
+ instanceType?: "basic" | "lite" | "standard-1" | "standard-2" | "standard-3" | "standard-4" | {
651
+ /** @default 0.0625 (1/16 vCPU) */vcpu?: number; /** @default 256 MiB */
652
+ memoryMib?: number; /** @default 2 GB */
653
+ diskMb?: number;
654
+ };
605
655
  /**
606
- * Binding to a Workers for Platforms dispatch namespace.
656
+ * The scheduling policy of the application.
607
657
  *
608
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
658
+ * @default "default"
609
659
  */
610
- dispatchNamespace(options?: DispatchNamespaceBindingOptions): DispatchNamespaceBinding;
660
+ schedulingPolicy?: "default" | "regional";
661
+ ssh?: {
662
+ /**
663
+ * If enabled, users with write access to the Container application can
664
+ * connect to it over SSH.
665
+ *
666
+ * @default false
667
+ */
668
+ enabled: boolean;
669
+ /**
670
+ * Port that the SSH service is running on.
671
+ *
672
+ * @default 22
673
+ */
674
+ port?: number;
675
+ };
676
+ /** SSH public keys to put in the Container's authorized_keys file. */
677
+ authorizedKeys?: Array<{
678
+ name: string;
679
+ publicKey: string;
680
+ }>;
681
+ /** Scheduling constraints for Container placement. */
682
+ constraints?: {
683
+ /** Limit Container placement to specific geographic regions. */regions?: Array<"ENAM" | "WNAM" | "EEUR" | "WEUR" | "APAC" | "SAM" | "ME" | "OC" | "AFR">; /** Restrict Containers to compliance boundaries. */
684
+ jurisdiction?: "eu" | "fedramp";
685
+ };
686
+ rollout?: {
687
+ /**
688
+ * How a rollout should be created. It supports the following modes:
689
+ *
690
+ * - full-auto: The Container application will be rolled out fully
691
+ * automatically.
692
+ * - none: The Container application will not have a rollout or update.
693
+ * - full-manual: The Container application will be rolled out by manually
694
+ * progressing through the rollout steps.
695
+ *
696
+ * @default "full-auto"
697
+ * @hidden
698
+ */
699
+ kind?: "full-auto" | "none" | "full-manual";
700
+ /**
701
+ * Configures what percentage of instances should be updated at each step of
702
+ * a rollout. You can specify this as a single number or an array of numbers.
703
+ *
704
+ * If this is a single number, each step will progress by that percentage.
705
+ * The options are 5, 10, 20, 25, 50, or 100.
706
+ *
707
+ * If this is an array, each step specifies the cumulative rollout progress.
708
+ * The final step must be 100.
709
+ *
710
+ * @default [10, 100]
711
+ */
712
+ stepPercentage?: number | number[];
713
+ /**
714
+ * Configures the grace period, in seconds, for active instances before they
715
+ * are shut down during a rollout.
716
+ *
717
+ * @default 0
718
+ */
719
+ activeGracePeriod?: number;
720
+ };
721
+ }
722
+ /** A Container application managed by a Durable Object. */
723
+ interface DurableObjectContainerConfig extends BaseContainerConfig {
724
+ schedulingPolicy: "durable-object";
611
725
  /**
612
- * Binding to a Durable Object class. `worker` is the name of the Worker
613
- * that defines the class; `exportName` is the exported class name.
614
- *
615
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
726
+ * Configures application-wide observability. Instance targeting is not
727
+ * supported for Durable Object-managed Containers.
616
728
  */
617
- durableObject(options: DurableObjectBindingOptions): DurableObjectBinding;
618
- /** Binding to a Flagship feature-flag service. */
619
- flagship(options?: FlagshipBindingOptions): FlagshipBinding;
729
+ observability?: ContainerObservabilityConfig;
730
+ /** Named images that the Durable Object can start. */
731
+ images?: Record<string, ContainerImage>;
732
+ }
733
+ /**
734
+ * Container application configuration. This is the input shape passed to
735
+ * `defineContainer` and parsed at runtime by `InputContainerSchema`.
736
+ */
737
+ type ContainerConfig = DurableObjectContainerConfig | StandardContainerConfig;
738
+ /**
739
+ * Worker configuration. This is the input shape passed to
740
+ * [`defineWorker`](https://developers.cloudflare.com/workers/wrangler/configuration/).
741
+ *
742
+ * Fields are parsed and normalised at runtime by `InputWorkerSchema` before
743
+ * being passed to downstream tooling.
744
+ */
745
+ interface WorkerConfig {
620
746
  /**
621
- * Binding to a Hyperdrive configuration.
622
- *
623
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
747
+ * The name of your Worker.
624
748
  */
625
- hyperdrive(options: HyperdriveBindingOptions): HyperdriveBinding;
749
+ name: string;
626
750
  /**
627
- * Binding to Cloudflare Images.
751
+ * A date in the form yyyy-mm-dd, which will be used to determine
752
+ * which version of the Workers runtime is used.
628
753
  *
629
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
754
+ * More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
630
755
  */
631
- images(options?: ImagesBindingOptions): ImagesBinding$1;
756
+ compatibilityDate: string;
632
757
  /**
633
- * Inline JSON value made available to the Worker on `env` under the
634
- * binding name.
758
+ * A list of flags that enable features from upcoming features of
759
+ * the Workers runtime, usually used together with `compatibilityDate`.
760
+ *
761
+ * More details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/
762
+ *
763
+ * @default []
635
764
  */
636
- json<T$1 extends Json>(value: T$1): JsonBinding<T$1>;
765
+ compatibilityFlags?: string[];
637
766
  /**
638
- * Binding to a Workers KV namespace.
767
+ * The entrypoint module that will be executed.
639
768
  *
640
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
769
+ * May be either a path string (e.g. `"./src/index.ts"`) or a module
770
+ * namespace imported with the `cf-worker` import attribute.
771
+ *
772
+ * @example
773
+ * ```ts
774
+ * import { defineConfig, defineWorker } from "@cloudflare/config";
775
+ * import * as entrypoint from "./src" with { type: "cf-worker" };
776
+ * const worker = defineWorker({ entrypoint });
777
+ * export default defineConfig({ worker });
778
+ * ```
641
779
  */
642
- kv<TKey extends string = string>(options?: KvBindingOptions): TypedKvBinding<TKey>;
643
- /** Binding for forwarding logs to logfwdr. */
644
- logfwdr(options: LogfwdrBindingOptions): LogfwdrBinding;
645
- /** Binding to Cloudflare Media Transformations. */
646
- media(options?: MediaBindingOptions): MediaBinding$1;
780
+ entrypoint?: string | WorkerModule;
647
781
  /**
648
- * Binding to an uploaded mTLS certificate.
782
+ * Specify the directory of static assets to deploy/serve.
649
783
  *
650
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
784
+ * More details at https://developers.cloudflare.com/workers/frameworks/
785
+ *
786
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
651
787
  */
652
- mtlsCertificate(options: MtlsCertificateBindingOptions): MtlsCertificateBinding;
653
- /** Binding to a Cloudflare Pipeline. */
654
- pipeline<TRecord extends PipelineRecord = PipelineRecord>(options: PipelineBindingOptions): TypedPipelineBinding<TRecord>;
788
+ assets?: {
789
+ /** How to handle HTML requests. */htmlHandling?: "auto-trailing-slash" | "drop-trailing-slash" | "force-trailing-slash" | "none"; /** How to handle requests that do not match an asset. */
790
+ notFoundHandling?: "single-page-application" | "404-page" | "none";
791
+ /**
792
+ * Matches will be routed to the User Worker, and matches to negative rules will go to the Asset Worker.
793
+ *
794
+ * Can also be `true`, indicating that every request should be routed to the User Worker.
795
+ */
796
+ runWorkerFirst?: string[] | boolean;
797
+ };
655
798
  /**
656
- * Producer binding to a Cloudflare Queue.
799
+ * Custom domains that your Worker should be published to.
657
800
  *
658
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
801
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
659
802
  */
660
- queue<TBody = unknown>(options?: QueueBindingOptions): TypedQueueBinding<TBody>;
803
+ domains?: string[];
661
804
  /**
662
- * Binding to an R2 bucket.
805
+ * Event triggers fetch routes, queue consumers, cron schedules, Email
806
+ * Routing addresses, and raw sockets — that invoke this Worker.
807
+ * Construct entries with `triggers.fetch(...)`, `triggers.queue(...)`,
808
+ * `triggers.scheduled(...)`, `triggers.email(...)`, or
809
+ * `triggers.connect(...)`.
663
810
  *
664
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
811
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
665
812
  */
666
- r2(options?: R2BindingOptions): R2Binding;
667
- /** Binding to a rate limiter. */
668
- rateLimit(options: RateLimitBindingOptions): RateLimitBinding;
813
+ triggers?: Trigger[];
669
814
  /**
670
- * Declares a secret that is required by your Worker, exposed on `env` under
671
- * the binding name.
815
+ * A list of Tail Workers that are bound to this Worker.
672
816
  *
673
- * When defined, this binding:
674
- * - Replaces .dev.vars/.env/process.env inference for type generation
675
- * - Enables local dev validation with warnings for missing secrets
817
+ * `@cloudflare/config` unifies regular and streaming tail consumers under
818
+ * a single field; pass `streaming: true` to forward streaming tail events.
676
819
  *
677
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#secrets-configuration-property
820
+ * @default []
678
821
  */
679
- secret(): SecretBinding;
680
- /** Binding to a Secrets Store secret. */
681
- secretsStoreSecret(options: SecretsStoreSecretBindingOptions): SecretsStoreSecretBinding;
822
+ tailConsumers?: Array<{
823
+ /** The name of the service tail events will be forwarded to. */worker: string; /** Whether to stream tail events in real time. */
824
+ streaming?: boolean;
825
+ }>;
682
826
  /**
683
- * Binding for sending email from inside the Worker.
684
- *
685
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
827
+ * Specify the cache behavior of the Worker.
686
828
  */
687
- sendEmail(options?: SendEmailBindingOptions): SendEmailBinding;
688
- /** Binding to Cloudflare Stream. */
689
- stream(options?: StreamBindingOptions): StreamBinding$1;
829
+ cache?: {
830
+ /** If cache is enabled for this Worker. */enabled: boolean; /** Whether cached assets may be reused across Worker versions. */
831
+ crossVersionCache?: boolean;
832
+ };
690
833
  /**
691
- * Inline string value made available to the Worker on `env` under the
692
- * binding name.
834
+ * Specify how the Worker should be located to minimize round-trip time.
693
835
  *
694
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
836
+ * More details: https://developers.cloudflare.com/workers/platform/smart-placement/
695
837
  */
696
- text<T$1 extends string>(value: T$1): TextBinding<T$1>;
697
- /**
698
- * Binding to a Vectorize index.
838
+ placement?: {
839
+ mode: "off" | "smart";
840
+ hint?: string;
841
+ } | {
842
+ mode?: "targeted";
843
+ region: string;
844
+ } | {
845
+ mode?: "targeted";
846
+ host: string;
847
+ } | {
848
+ mode?: "targeted";
849
+ hostname: string;
850
+ };
851
+ /**
852
+ * Specify limits for runtime behavior.
853
+ * Only supported for the "standard" Usage Model.
699
854
  *
700
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
855
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#limits
701
856
  */
702
- vectorize(options: VectorizeBindingOptions): VectorizeBinding;
703
- /** Binding to the Worker version's metadata. */
704
- versionMetadata(): VersionMetadataBinding;
705
- /** Binding to a VPC network. */
706
- vpcNetwork(options: VpcNetworkBindingOptions): VpcNetworkBinding;
707
- /** Binding to a VPC service. */
708
- vpcService(options: VpcServiceBindingOptions): VpcServiceBinding;
857
+ limits?: {
858
+ /** Maximum allowed CPU time for a Worker's invocation in milliseconds. */cpuMs?: number; /** Maximum allowed number of fetch requests that a Worker's invocation can execute. */
859
+ subrequests?: number;
860
+ };
709
861
  /**
710
- * Cloudflare Web Search binding. There is exactly one shared web corpus, so
711
- * the binding is zero-config — only the variable name is required.
862
+ * Send Trace Events from this Worker to Workers Logpush.
863
+ *
864
+ * This will not configure a corresponding Logpush job automatically.
865
+ *
866
+ * For more information about Workers Logpush, see:
867
+ * https://blog.cloudflare.com/logpush-for-workers/
712
868
  */
713
- webSearch(options?: WebSearchBindingOptions): WebSearchBinding;
869
+ logpush?: boolean;
714
870
  /**
715
- * Service binding (Worker-to-Worker). `worker` is the name of the bound
716
- * Worker; `exportName` selects a named `WorkerEntrypoint` export (defaults to
717
- * the default export).
871
+ * Specify the observability behavior of the Worker.
718
872
  *
719
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
873
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#observability
720
874
  */
721
- worker(options: WorkerBindingOptions): WorkerBinding;
722
- /** Binding to a Worker Loader. */
723
- workerLoader(): WorkerLoaderBinding;
724
- }
725
- declare const bindings: Bindings; //#endregion
726
- //#region src/triggers.d.ts
727
- interface FetchTriggerOptions {
875
+ observability?: {
876
+ /** If observability is enabled for this Worker. */enabled?: boolean; /** The sampling rate. */
877
+ headSamplingRate?: number;
878
+ /**
879
+ * Whether query strings are removed from request URLs in logs and traces.
880
+ *
881
+ * @default false
882
+ */
883
+ redactQueryString?: boolean; /** Real-time Issues settings for this Worker. */
884
+ issues?: {
885
+ /** Whether real-time Issues are enabled. */enabled?: boolean;
886
+ };
887
+ logs?: {
888
+ enabled?: boolean; /** The sampling rate. */
889
+ headSamplingRate?: number; /** Set to false to disable invocation logs. */
890
+ invocationLogs?: boolean;
891
+ /**
892
+ * If logs should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
893
+ *
894
+ * @default true
895
+ */
896
+ persist?: boolean;
897
+ /**
898
+ * What destinations logs emitted from the Worker should be sent to.
899
+ *
900
+ * @default []
901
+ */
902
+ destinations?: string[];
903
+ };
904
+ traces?: {
905
+ enabled?: boolean; /** The sampling rate. */
906
+ headSamplingRate?: number;
907
+ /**
908
+ * If traces should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
909
+ *
910
+ * @default true
911
+ */
912
+ persist?: boolean;
913
+ /**
914
+ * What destinations traces emitted from the Worker should be sent to.
915
+ *
916
+ * @default []
917
+ */
918
+ destinations?: string[];
919
+ };
920
+ };
728
921
  /**
729
- * A route that your Worker should be published to.
922
+ * Whether we use `<name>.<subdomain>.workers.dev` to
923
+ * test and deploy your Worker.
730
924
  *
731
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
925
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workersdev
926
+ *
927
+ * @default true
732
928
  */
733
- pattern: string;
929
+ workersDev?: boolean;
734
930
  /**
735
- * The DNS zone the pattern is attached to. Required when the
736
- * pattern is ambiguous.
931
+ * Whether we use `<version>-<name>.<subdomain>.workers.dev` to
932
+ * serve Preview URLs for your Worker.
933
+ *
934
+ * @default false
737
935
  */
738
- zone?: string;
739
- }
740
- /**
741
- * Fetch trigger — a route that your Worker should be published to.
742
- *
743
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
744
- */
745
- interface FetchTrigger extends FetchTriggerOptions {
746
- type: "fetch";
747
- }
748
- interface QueueConsumerTriggerOptions {
749
- /** The name of the queue from which this consumer should consume. */
750
- name: string;
751
- /** The queue to send messages that failed to be consumed. */
752
- deadLetterQueue?: string;
753
- /** The maximum number of messages per batch. */
754
- maxBatchSize?: number;
755
- /** The maximum number of seconds to wait to fill a batch with messages. */
756
- maxBatchTimeout?: number;
936
+ previewUrls?: boolean;
757
937
  /**
758
- * The maximum number of concurrent consumer Worker invocations.
759
- * Leaving this unset will allow your consumer to scale to the
760
- * maximum concurrency needed to keep up with the message backlog.
938
+ * Designates this Worker as an internal-only "first-party" Worker.
939
+ *
940
+ * @internal
761
941
  */
762
- maxConcurrency?: number | null;
763
- /** The maximum number of retries for each message. */
764
- maxRetries?: number;
765
- /** The number of seconds to wait before retrying a message. */
766
- retryDelay?: number;
767
- /** The number of milliseconds to wait for pulled messages to become visible again. */
768
- visibilityTimeoutMs?: number;
769
- }
770
- /**
771
- * Queue consumer trigger — invokes this Worker when messages arrive on the
772
- * named queue.
773
- *
774
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
775
- */
776
- interface QueueConsumerTrigger extends QueueConsumerTriggerOptions {
777
- type: "queue";
778
- }
779
- interface ScheduledTriggerOptions {
942
+ firstPartyWorker?: boolean;
780
943
  /**
781
- * A "cron" definition to trigger a Worker's "scheduled" function.
782
- *
783
- * Lets you call Workers periodically, much like a cron job.
944
+ * "Unsafe" tables for runtime features that aren't directly supported by
945
+ * this configuration. Values are forwarded verbatim in the Worker's
946
+ * upload metadata.
784
947
  *
785
- * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
948
+ * @default {}
786
949
  */
787
- schedule: string;
788
- }
789
- /**
790
- * Scheduled (cron) trigger invokes this Worker on the given schedules.
791
- *
792
- * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
793
- */
794
- interface ScheduledTrigger extends ScheduledTriggerOptions {
795
- type: "scheduled";
796
- }
797
- interface EmailTriggerOptions {
950
+ unsafe?: {
951
+ /**
952
+ * Arbitrary key/value pairs that will be included in the uploaded metadata. Values specified
953
+ * here will always be applied to metadata last, so can add new or override existing fields.
954
+ */
955
+ metadata?: Record<string, unknown>;
956
+ /**
957
+ * Used for internal capnp uploads for the Workers runtime.
958
+ */
959
+ capnp?: {
960
+ basePath: string;
961
+ sourceSchemas: string[];
962
+ compiledSchema?: never;
963
+ } | {
964
+ basePath?: never;
965
+ sourceSchemas?: never;
966
+ compiledSchema: string;
967
+ };
968
+ };
798
969
  /**
799
- * Inbound Email Routing addresses handled by this Worker.
970
+ * Bindings exposed on the Worker's `env` object. Construct entries with
971
+ * `bindings.kv(...)`, `bindings.r2(...)`, etc.
972
+ */
973
+ env?: Record<string, Binding>;
974
+ /**
975
+ * Configuration for named exports declared by the Worker. Each entry's
976
+ * key is the exported class name; the value configures the export.
800
977
  *
801
- * Each entry is a literal recipient address (e.g. `"support@example.com"`)
802
- * or a `*@domain` catch-all (e.g. `"*@example.com"`).
978
+ * Only one export kind is currently supported:
979
+ *
980
+ * - Construct entries with `exports.durableObject(...)`.
981
+ * - Declares Durable Object classes exported from this Worker.
982
+ * For more information about Durable Objects, see the documentation at
983
+ * https://developers.cloudflare.com/workers/learning/using-durable-objects.
984
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects.
803
985
  */
804
- addresses: string[];
986
+ exports?: Record<string, Export>;
987
+ } //#endregion
988
+ //#region src/definition.d.ts
989
+ interface ConfigContext {
990
+ /** Whether the config is being evaluated for a Preview build. */
991
+ isPreview: boolean;
992
+ /**
993
+ * The mode the config is being evaluated in.
994
+ * Set via the `--mode` CLI flag.
995
+ * In Vite the mode defaults to `development` in `vite dev` and `production` in `vite build` ([more info](https://vite.dev/guide/env-and-mode.html#modes)).
996
+ * In Wrangler the mode defaults to `undefined`.
997
+ */
998
+ mode: string | undefined;
805
999
  }
806
1000
  /**
807
- * Email trigger invokes this Worker for the configured Email Routing
808
- * addresses.
1001
+ * A configuration value, promise, or factory. Factories can be passed directly
1002
+ * for automatic resolution with the current context or called explicitly with
1003
+ * another context before they are used.
809
1004
  */
810
- interface EmailTrigger extends EmailTriggerOptions {
811
- type: "email";
812
- }
813
- interface ConnectTriggerOptions {
814
- /** The transport protocol to listen for. */
815
- protocol: "tcp";
816
- /** The port to listen on. */
817
- port: number;
818
- /** The address to bind to. Defaults to `127.0.0.1`. */
819
- address?: string;
820
- }
1005
+ type ConfigInput<T$1> = T$1 | Promise<T$1> | ((ctx: ConfigContext) => T$1 | Promise<T$1>);
1006
+ type ContainerDefinition<T$1 extends ContainerConfig = ContainerConfig> = ConfigInput<T$1>;
1007
+ type WorkerDefinition<T$1 extends WorkerConfig = WorkerConfig> = ConfigInput<T$1>;
1008
+ /** A Worker name, value, promise, or context-aware factory. */
1009
+ type WorkerReference = string | WorkerDefinition;
821
1010
  /**
822
- * Connect trigger invokes this Worker's `connect(socket, env, ctx)`
823
- * handler for raw socket connections received on the configured
824
- * protocol/port.
1011
+ * Used to define the default export in `cloudflare.config.ts`.
1012
+ *
1013
+ * @example
1014
+ * ```typescript
1015
+ * import { defineConfig } from "@cloudflare/config";
1016
+ *
1017
+ * export default defineConfig({
1018
+ * worker: {
1019
+ * name: "my-worker",
1020
+ * compatibilityDate: "2026-09-17",
1021
+ * },
1022
+ * });
1023
+ * ```
825
1024
  */
826
- interface ConnectTrigger extends ConnectTriggerOptions {
827
- type: "connect";
828
- }
1025
+ declare const defineConfig: <const TInput extends ConfigInput<CloudflareConfig>>(config: TInput) => TInput;
829
1026
  /**
830
- * Event triggers — fetch routes, queue consumers, cron schedules, Email
831
- * Routing addresses, and raw sockets — that invoke this Worker.
832
- * Construct entries with `triggers.fetch(...)`, `triggers.queue(...)`,
833
- * `triggers.scheduled(...)`, `triggers.email(...)`, or `triggers.connect(...)`.
1027
+ * Define a Container.
834
1028
  *
835
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
1029
+ * @example
1030
+ * ```typescript
1031
+ * import { defineContainer } from "@cloudflare/config";
1032
+ *
1033
+ * const container = defineContainer({
1034
+ * name: "my-container",
1035
+ * image: { dockerfile: "./Dockerfile" },
1036
+ * });
1037
+ * ```
836
1038
  */
837
- interface Triggers {
838
- /**
839
- * Fetch trigger — a route that your Worker should be published to.
840
- *
841
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
842
- */
843
- fetch(options: FetchTriggerOptions): FetchTrigger;
844
- /**
845
- * Queue consumer trigger — invokes this Worker when messages arrive on the
846
- * named queue.
847
- *
848
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
849
- */
850
- queue(options: QueueConsumerTriggerOptions): QueueConsumerTrigger;
851
- /**
852
- * Scheduled (cron) trigger — invokes this Worker on the given schedules.
853
- *
854
- * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
855
- */
856
- scheduled(options: ScheduledTriggerOptions): ScheduledTrigger;
857
- /**
858
- * Email trigger — invokes this Worker for the configured Email Routing
859
- * addresses.
860
- */
861
- email(options: EmailTriggerOptions): EmailTrigger;
862
- /**
863
- * Connect trigger — invokes this Worker's `connect(socket, env, ctx)`
864
- * handler for raw socket connections received on the configured
865
- * protocol/port.
866
- */
867
- connect(options: ConnectTriggerOptions): ConnectTrigger;
868
- }
1039
+ declare const defineContainer: <const TInput extends ConfigInput<ContainerConfig>>(config: TInput) => TInput;
869
1040
  /**
870
- * Triggers builder for configuring event triggers.
1041
+ * Define a Worker.
871
1042
  *
872
1043
  * @example
873
1044
  * ```typescript
874
- * import { defineWorker, triggers } from "@cloudflare/config";
1045
+ * import { defineWorker } from "@cloudflare/config";
875
1046
  *
876
- * export default defineWorker({
877
- * triggers: [
878
- * triggers.fetch({ pattern: "example.com/*", zone: "example.com" }),
879
- * triggers.queue({ name: "my-queue" }),
880
- * triggers.scheduled({ schedule: "0 * * * *" }),
881
- * triggers.scheduled({ schedule: "30 0 * * *" }),
882
- * triggers.email({ addresses: ["support@example.com"] }),
883
- * triggers.connect({ protocol: "tcp", port: 5432 }),
884
- * ],
1047
+ * const worker = defineWorker({
1048
+ * name: "my-worker",
1049
+ * compatibilityDate: "2026-09-17",
885
1050
  * });
886
1051
  * ```
887
1052
  */
888
- declare const triggers: Triggers; //#endregion
889
- //#region src/exports.d.ts
1053
+ declare const defineWorker: <const TInput extends ConfigInput<WorkerConfig>>(config: TInput) => TInput; //#endregion
1054
+ //#region src/utils.d.ts
890
1055
  /**
891
- * Storage backend for the Durable Object.
892
- *
893
- * Containers are only supported on the SQLite storage engine, so `container` is
894
- * only offered alongside `storage: "sqlite"`.
1056
+ * Represents any valid JSON value.
895
1057
  */
896
- type DurableObjectStorageOptions = {
897
- /**
898
- * Selects the SQLite-backed storage engine (recommended for new
899
- * classes).
900
- */
901
- storage: "sqlite";
902
- /**
903
- * Attach a container to this Durable Object, by container name. The
904
- * name must match an entry in the top level `containers` array.
905
- */
906
- container?: string;
907
- } | {
908
- /** Selects the legacy key-value storage engine. */storage: "legacy-kv";
909
- };
1058
+ type Json = string | number | boolean | null | Json[] | {
1059
+ [key: string]: Json;
1060
+ }; //#endregion
1061
+ //#region src/bindings.d.ts
1062
+ /** Options that control a binding during local development. */
1063
+ interface BindingDevOptions {
1064
+ /** Whether the binding should connect to the remote resource. */
1065
+ remote?: boolean;
1066
+ }
1067
+ interface AgentMemoryBindingOptions {
1068
+ /** The user-chosen namespace name. Must exist in Cloudflare at deploy time. */
1069
+ namespace: string;
1070
+ /** Options that only apply during local development. */
1071
+ dev?: BindingDevOptions;
1072
+ }
910
1073
  /**
911
- * Declares a provisioned Durable Object class exported from this Worker.
912
- *
913
- * For more information about Durable Objects, see the documentation at
914
- * https://developers.cloudflare.com/workers/learning/using-durable-objects
915
- *
916
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
1074
+ * Agent Memory namespace binding. Each binding is scoped to a namespace and
1075
+ * allows agents to persist and recall memory.
917
1076
  */
918
- type DurableObjectCreatedExportOptions = {
919
- state?: "created";
920
- } & DurableObjectStorageOptions;
1077
+ interface AgentMemoryBinding extends AgentMemoryBindingOptions {
1078
+ type: "agent-memory";
1079
+ }
1080
+ interface AiBindingOptions {
1081
+ /** Options that only apply during local development. */
1082
+ dev?: BindingDevOptions;
1083
+ }
921
1084
  /**
922
- * Retire a provisioned Durable Object namespace whose class has
923
- * been removed from code.
1085
+ * Binding to the Workers AI project.
924
1086
  *
925
- * During deploy, the class must not be exported in the uploaded code, and no
926
- * other Worker may hold a `durableObject` binding to the namespace.
1087
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
927
1088
  */
928
- interface DurableObjectDeletedExportOptions {
929
- state: "deleted";
1089
+ interface AiBinding extends AiBindingOptions {
1090
+ type: "ai";
930
1091
  }
931
1092
  /**
932
- * Rename a provisioned Durable Object namespace's class. The
933
- * `renamedTo` value must also appear as a live (`state: "created"`)
934
- * `durableObject` entry in the same `exports` map.
1093
+ * Binding to the Workers AI project.
1094
+ *
1095
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
935
1096
  */
936
- interface DurableObjectRenamedExportOptions {
937
- state: "renamed";
938
- /**
939
- * The destination class name. Must be a valid JavaScript identifier and
940
- * must appear as a live (`state: "created"`) `durableObject` entry in the
941
- * same `exports` map.
942
- */
943
- renamedTo: string;
1097
+ interface TypedAiBinding<TAiModelList extends AiModelListType = AiModels> extends AiBinding {
1098
+ /** @internal Carries type parameters for inference */
1099
+ __typeParams: [TAiModelList];
944
1100
  }
945
- /**
946
- * Transfer ownership of a Durable Object namespace to another Worker in the same account.
947
- * The target Worker must first deploy an `expectingTransfer` entry naming this Worker via `transferFrom`.
948
- */
949
- interface DurableObjectTransferredExportOptions {
950
- state: "transferred";
951
- /**
952
- * The destination Worker. Must reference a Worker in the same account.
953
- */
954
- transferredTo: string;
1101
+ interface AiSearchBindingOptions {
1102
+ /** The user-chosen instance name. Must exist in Cloudflare at deploy time. */
1103
+ name: string;
1104
+ /** Options that only apply during local development. */
1105
+ dev?: BindingDevOptions;
955
1106
  }
956
1107
  /**
957
- * Prepare to receive cross-Worker Durable Object transfer.
958
- * Once the source Worker's `transferred` export is deployed, this entry becomes a normal live `durable-object` export.
1108
+ * AI Search instance binding. Each binding is bound directly to a single
1109
+ * pre-existing instance within the "default" namespace.
959
1110
  */
960
- type DurableObjectExpectingTransferExportOptions = {
961
- state: "expecting-transfer";
962
- /**
963
- * The source Worker for the two-phase cross-Worker transfer.
964
- */
965
- transferFrom: string;
966
- } & DurableObjectStorageOptions;
967
- type DurableObjectCreatedExport = DurableObjectCreatedExportOptions & {
968
- type: "durable-object";
969
- };
970
- interface DurableObjectDeletedExport extends DurableObjectDeletedExportOptions {
971
- type: "durable-object";
972
- }
973
- interface DurableObjectRenamedExport extends DurableObjectRenamedExportOptions {
974
- type: "durable-object";
975
- }
976
- interface DurableObjectTransferredExport extends DurableObjectTransferredExportOptions {
977
- type: "durable-object";
978
- }
979
- type DurableObjectExpectingTransferExport = DurableObjectExpectingTransferExportOptions & {
980
- type: "durable-object";
981
- };
982
- type DurableObjectExportOptions = DurableObjectCreatedExportOptions | DurableObjectDeletedExportOptions | DurableObjectRenamedExportOptions | DurableObjectTransferredExportOptions | DurableObjectExpectingTransferExportOptions;
983
- type DurableObjectExports = DurableObjectCreatedExport | DurableObjectDeletedExport | DurableObjectRenamedExport | DurableObjectTransferredExport | DurableObjectExpectingTransferExport;
984
- interface WorkerEntrypointExportOptions {
985
- cache?: {
986
- /** Whether cache is enabled for this entrypoint. */enabled: boolean;
987
- };
1111
+ interface AiSearchBinding extends AiSearchBindingOptions {
1112
+ type: "ai-search";
988
1113
  }
989
- interface WorkerEntrypointExport extends WorkerEntrypointExportOptions {
990
- type: "worker";
1114
+ interface AiSearchNamespaceBindingOptions {
1115
+ /** The user-chosen namespace name. Must exist in Cloudflare at deploy time. */
1116
+ namespace: string;
1117
+ /** Options that only apply during local development. */
1118
+ dev?: BindingDevOptions;
991
1119
  }
992
1120
  /**
993
- * Configuration for named exports declared by the Worker. Each entry's
994
- * key is the exported class name; the value configures the export.
1121
+ * AI Search namespace binding. Each binding is scoped to a namespace and
1122
+ * allows dynamic instance CRUD within it.
995
1123
  */
996
- interface Exports {
997
- /**
998
- * Declares a Durable Object class defined by this Worker.
999
- *
1000
- * For more information about Durable Objects, see the documentation at
1001
- * https://developers.cloudflare.com/workers/learning/using-durable-objects
1002
- *
1003
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
1004
- */
1005
- durableObject(options: DurableObjectCreatedExportOptions): DurableObjectCreatedExport;
1006
- /**
1007
- * Retire a provisioned Durable Object namespace whose class has been removed from code.
1008
- */
1009
- durableObject(options: DurableObjectDeletedExportOptions): DurableObjectDeletedExport;
1010
- /**
1011
- * Rename a provisioned Durable Object namespace's class.
1012
- */
1013
- durableObject(options: DurableObjectRenamedExportOptions): DurableObjectRenamedExport;
1014
- /**
1015
- * Transfer ownership of a Durable Object namespace to another Worker in the same account.
1016
- */
1017
- durableObject(options: DurableObjectTransferredExportOptions): DurableObjectTransferredExport;
1018
- /**
1019
- * Prepare to receive cross-Worker Durable Object transfer.
1020
- * The source Worker must follow up with a deployment containing a `transferred` export to commit the transfer.
1021
- */
1022
- durableObject(options: DurableObjectExpectingTransferExportOptions): DurableObjectExpectingTransferExport;
1023
- durableObject(options: DurableObjectExportOptions): DurableObjectExports;
1024
- /** Declares a WorkerEntrypoint export defined by this Worker. */
1025
- worker(options?: WorkerEntrypointExportOptions): WorkerEntrypointExport;
1124
+ interface AiSearchNamespaceBinding extends AiSearchNamespaceBindingOptions {
1125
+ type: "ai-search-namespace";
1126
+ }
1127
+ interface AnalyticsEngineDatasetBindingOptions {
1128
+ /** The name of this dataset to write to. */
1129
+ name?: string;
1026
1130
  }
1027
1131
  /**
1028
- * Exports builder for configuring Worker exports.
1029
- *
1030
- * @example
1031
- * ```typescript
1032
- * import { defineWorker, exports } from "@cloudflare/config";
1132
+ * Binding to an Analytics Engine dataset.
1033
1133
  *
1034
- * export default defineWorker({
1035
- * exports: {
1036
- * MyDurableObject: exports.durableObject({ storage: "sqlite" }),
1037
- * MyContainerDO: exports.durableObject({ storage: "sqlite", container: "my-container" }),
1038
- * OldClass: exports.durableObject({ state: "deleted" }),
1039
- * OldName: exports.durableObject({ state: "renamed", renamedTo: "NewName" }),
1040
- * Outgoing: exports.durableObject({ state: "transferred", transferredTo: "target-worker" }),
1041
- * Incoming: exports.durableObject({ state: "expecting-transfer", storage: "sqlite", transferFrom: "source-worker" }),
1042
- * },
1043
- * });
1044
- * ```
1134
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
1045
1135
  */
1046
- declare const exports: Exports; //#endregion
1047
- //#region src/definition.d.ts
1048
- interface ConfigContext {
1049
- /**
1050
- * The mode the config is being evaluated in.
1051
- * Set via the `--mode` CLI flag.
1052
- * In Vite the mode defaults to `development` in `vite dev` and `production` in `vite build` ([more info](https://vite.dev/guide/env-and-mode.html#modes)).
1053
- * In Wrangler the mode defaults to `undefined`.
1054
- */
1055
- mode: string | undefined;
1136
+ interface AnalyticsEngineDatasetBinding extends AnalyticsEngineDatasetBindingOptions {
1137
+ type: "analytics-engine-dataset";
1138
+ }
1139
+ interface ArtifactsBindingOptions {
1140
+ /** The namespace to use. */
1141
+ namespace: string;
1142
+ /** Options that only apply during local development. */
1143
+ dev?: BindingDevOptions;
1056
1144
  }
1057
- declare const DEFINITION: unique symbol;
1058
1145
  /**
1059
- * The authored config in any of its supported shapes: a plain value, a promise,
1060
- * or a function of {@link ConfigContext}.
1146
+ * Binding to an Artifacts instance. Artifacts provides git-compatible file
1147
+ * storage on Cloudflare Workers.
1061
1148
  */
1062
- type ConfigInput<T$1> = T$1 | Promise<T$1> | ((ctx: ConfigContext) => T$1 | Promise<T$1>);
1149
+ interface ArtifactsBinding extends ArtifactsBindingOptions {
1150
+ type: "artifacts";
1151
+ }
1063
1152
  /**
1064
- * Resolve any `cloudflare.config.ts` export to its plain config value.
1153
+ * Binding to the Worker's static assets.
1065
1154
  *
1066
- * A `define*` helper stores its authored config plus `type` under the
1067
- * {@link DEFINITION} symbol; here we unwrap the config and stamp `type` back on.
1068
- * Every other export — a raw object/promise/function — is unwrapped as-is and
1069
- * already carries its own `type`. Discrimination happens afterwards via `type`.
1070
- */
1071
- //#endregion
1072
- //#region src/types.d.ts
1073
- /**
1074
- * Union of all binding definitions accepted in `env`.
1155
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
1075
1156
  */
1076
- type Binding = AgentMemoryBinding | AiBinding | AiSearchBinding | AiSearchNamespaceBinding | AnalyticsEngineDatasetBinding | ArtifactsBinding | AssetsBinding | BrowserBinding | D1Binding | DispatchNamespaceBinding | DurableObjectBinding | FlagshipBinding | HyperdriveBinding | ImagesBinding$1 | JsonBinding | KvBinding | LogfwdrBinding | MediaBinding$1 | MtlsCertificateBinding | PipelineBinding | QueueBinding | R2Binding | RateLimitBinding | SecretBinding | SecretsStoreSecretBinding | SendEmailBinding | StreamBinding$1 | TextBinding | UnsafeBinding | VectorizeBinding | VersionMetadataBinding | VpcNetworkBinding | VpcServiceBinding | WebSearchBinding | WorkerBinding | WorkerLoaderBinding;
1157
+ interface AssetsBinding {
1158
+ type: "assets";
1159
+ }
1160
+ interface BrowserBindingOptions {
1161
+ /** Options that only apply during local development. */
1162
+ dev?: BindingDevOptions;
1163
+ }
1077
1164
  /**
1078
- * Union of all trigger definitions accepted in `triggers`.
1165
+ * Binding to a headless browser usable from the Worker.
1166
+ *
1167
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
1079
1168
  */
1080
- type Trigger = ConnectTrigger | EmailTrigger | FetchTrigger | QueueConsumerTrigger | ScheduledTrigger;
1081
- /**
1082
- * Union of all export definitions accepted in `exports`. Worker entries
1083
- * configure WorkerEntrypoint exports. Durable Object entries configure live
1084
- * classes and tombstone lifecycle operations.
1169
+ interface BrowserBinding extends BrowserBindingOptions {
1170
+ type: "browser";
1171
+ }
1172
+ interface D1BindingOptions {
1173
+ /** The UUID of this D1 database (not required). */
1174
+ id?: string;
1175
+ /** The name of this D1 database. */
1176
+ name?: string;
1177
+ /** Options that only apply during local development. */
1178
+ dev?: BindingDevOptions;
1179
+ }
1180
+ /**
1181
+ * Binding to a D1 database.
1182
+ *
1183
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
1085
1184
  */
1086
- type Export = DurableObjectCreatedExport | DurableObjectDeletedExport | DurableObjectRenamedExport | DurableObjectTransferredExport | DurableObjectExpectingTransferExport | WorkerEntrypointExport;
1185
+ interface D1Binding extends D1BindingOptions {
1186
+ type: "d1";
1187
+ }
1188
+ interface DispatchNamespaceBindingOptions {
1189
+ /** The namespace to bind to. */
1190
+ namespace?: string;
1191
+ /** Details about the outbound Worker which will handle outbound requests from your namespace. */
1192
+ outbound?: {
1193
+ /** Name of the Worker handling the outbound requests. */worker: string; /** (Optional) List of parameter names, for sending context from your dispatch Worker to the outbound handler. */
1194
+ parameters?: string[];
1195
+ };
1196
+ /** Options that only apply during local development. */
1197
+ dev?: BindingDevOptions;
1198
+ }
1199
+ /**
1200
+ * Binding to a Workers for Platforms dispatch namespace.
1201
+ *
1202
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
1203
+ */
1204
+ interface DispatchNamespaceBinding extends DispatchNamespaceBindingOptions {
1205
+ type: "dispatch-namespace";
1206
+ }
1207
+ type ReferencedWorkerConfig<TWorker$1 extends WorkerReference> = TWorker$1 extends string ? never : UnwrapConfig<TWorker$1>;
1208
+ type DurableObjectExportName<TWorker$1 extends WorkerReference> = TWorker$1 extends string ? string : InferDurableNamespaces<ReferencedWorkerConfig<TWorker$1>>;
1209
+ type WorkerEntrypointExportName<TWorker$1 extends WorkerReference> = TWorker$1 extends string ? string : InferWorkerEntrypointExports<ReferencedWorkerConfig<TWorker$1>>;
1210
+ type WorkflowExportName<TWorker$1 extends WorkerReference> = TWorker$1 extends string ? string : InferExportsByType<ReferencedWorkerConfig<TWorker$1>, "workflow">;
1211
+ interface DurableObjectBindingOptions<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends DurableObjectExportName<TWorker$1> = DurableObjectExportName<TWorker$1>> {
1212
+ /** The name or config of the Worker that defines the Durable Object class. */
1213
+ worker: TWorker$1;
1214
+ /** The exported class name of the Durable Object. */
1215
+ exportName: TExportName$1;
1216
+ }
1217
+ /**
1218
+ * Binding to a Durable Object class. `worker` is the name or config of the
1219
+ * Worker that defines the class; `exportName` is the exported class name.
1220
+ *
1221
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
1222
+ */
1223
+ interface DurableObjectBinding<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends DurableObjectExportName<TWorker$1> = DurableObjectExportName<TWorker$1>> extends DurableObjectBindingOptions<TWorker$1, TExportName$1> {
1224
+ type: "durable-object";
1225
+ }
1226
+ interface FlagshipBindingOptions {
1227
+ /** The Flagship app ID to bind to. */
1228
+ id?: string;
1229
+ /** Options that only apply during local development. */
1230
+ dev?: BindingDevOptions;
1231
+ }
1232
+ /** Binding to a Flagship feature-flag service. */
1233
+ interface FlagshipBinding extends FlagshipBindingOptions {
1234
+ type: "flagship";
1235
+ }
1236
+ interface HyperdriveBindingOptions {
1237
+ /** The ID of the Hyperdrive configuration. */
1238
+ id: string;
1239
+ /** Options that only apply during local development. */
1240
+ dev?: {
1241
+ /** The database connection string used during local development. */connectionString?: string;
1242
+ };
1243
+ }
1244
+ /**
1245
+ * Binding to a Hyperdrive configuration.
1246
+ *
1247
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
1248
+ */
1249
+ interface HyperdriveBinding extends HyperdriveBindingOptions {
1250
+ type: "hyperdrive";
1251
+ }
1252
+ interface ImagesBindingOptions {
1253
+ /** Options that only apply during local development. */
1254
+ dev?: BindingDevOptions;
1255
+ }
1256
+ /**
1257
+ * Binding to Cloudflare Images.
1258
+ *
1259
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
1260
+ */
1261
+ interface ImagesBinding$1 extends ImagesBindingOptions {
1262
+ type: "images";
1263
+ }
1264
+ /**
1265
+ * Inline JSON value made available to the Worker on `env` under the
1266
+ * binding name.
1267
+ */
1268
+ interface JsonBinding<T$1 extends Json = Json> {
1269
+ type: "json";
1270
+ /** The JSON value made available to the Worker. */
1271
+ value: T$1;
1272
+ }
1273
+ interface KvBindingOptions {
1274
+ /** The ID of the KV namespace. */
1275
+ id?: string;
1276
+ /** Options that only apply during local development. */
1277
+ dev?: BindingDevOptions;
1278
+ }
1279
+ /**
1280
+ * Binding to a Workers KV namespace.
1281
+ *
1282
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
1283
+ */
1284
+ interface KvBinding extends KvBindingOptions {
1285
+ type: "kv";
1286
+ }
1287
+ /**
1288
+ * Binding to a Workers KV namespace.
1289
+ *
1290
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
1291
+ */
1292
+ interface TypedKvBinding<TKey extends string = string> extends KvBinding {
1293
+ /** @internal Carries type parameters for inference */
1294
+ __typeParams: [TKey];
1295
+ }
1296
+ interface LogfwdrBindingOptions {
1297
+ /** The destination for this logged message. */
1298
+ destination: string;
1299
+ }
1300
+ /** Binding for forwarding logs to logfwdr. */
1301
+ interface LogfwdrBinding extends LogfwdrBindingOptions {
1302
+ type: "logfwdr";
1303
+ }
1304
+ interface MediaBindingOptions {
1305
+ /** Options that only apply during local development. */
1306
+ dev?: BindingDevOptions;
1307
+ }
1308
+ /** Binding to Cloudflare Media Transformations. */
1309
+ interface MediaBinding$1 extends MediaBindingOptions {
1310
+ type: "media";
1311
+ }
1312
+ interface MtlsCertificateBindingOptions {
1313
+ /** The UUID of the uploaded mTLS certificate. */
1314
+ id: string;
1315
+ /** Options that only apply during local development. */
1316
+ dev?: BindingDevOptions;
1317
+ }
1318
+ /**
1319
+ * Binding to an uploaded mTLS certificate.
1320
+ *
1321
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
1322
+ */
1323
+ interface MtlsCertificateBinding extends MtlsCertificateBindingOptions {
1324
+ type: "mtls-certificate";
1325
+ }
1326
+ interface PipelineBindingOptions {
1327
+ /** Name of the Pipeline to bind. */
1328
+ name: string;
1329
+ /** Options that only apply during local development. */
1330
+ dev?: BindingDevOptions;
1331
+ }
1332
+ /** Binding to a Cloudflare Pipeline. */
1333
+ interface PipelineBinding extends PipelineBindingOptions {
1334
+ type: "pipeline";
1335
+ }
1336
+ /** Binding to a Cloudflare Pipeline. */
1337
+ interface TypedPipelineBinding<TRecord extends PipelineRecord = PipelineRecord> extends PipelineBinding {
1338
+ /** @internal Carries type parameters for inference */
1339
+ __typeParams: [TRecord];
1340
+ }
1341
+ interface QueueBindingOptions {
1342
+ /** The name of this Queue. */
1343
+ name?: string;
1344
+ /** The number of seconds to wait before delivering a message. */
1345
+ deliveryDelay?: number;
1346
+ /** Options that only apply during local development. */
1347
+ dev?: BindingDevOptions;
1348
+ }
1349
+ /**
1350
+ * Producer binding to a Cloudflare Queue.
1351
+ *
1352
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
1353
+ */
1354
+ interface QueueBinding extends QueueBindingOptions {
1355
+ type: "queue";
1356
+ }
1357
+ /**
1358
+ * Producer binding to a Cloudflare Queue.
1359
+ *
1360
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
1361
+ */
1362
+ interface TypedQueueBinding<TBody = unknown> extends QueueBinding {
1363
+ /** @internal Carries type parameters for inference */
1364
+ __typeParams: [TBody];
1365
+ }
1366
+ interface R2BindingOptions {
1367
+ /** The name of this R2 bucket at the edge. */
1368
+ name?: string;
1369
+ /** The jurisdiction that the bucket exists in. Default if not present. */
1370
+ jurisdiction?: string;
1371
+ /** Settings that only apply to local development. */
1372
+ dev?: BindingDevOptions & {
1373
+ /** EXPERIMENTAL: credentials for the local S3-compatible endpoint. */experimentalS3Credentials?: {
1374
+ accessKeyId: string;
1375
+ secretAccessKey: string;
1376
+ };
1377
+ };
1378
+ }
1379
+ /**
1380
+ * Binding to an R2 bucket.
1381
+ *
1382
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
1383
+ */
1384
+ interface R2Binding extends R2BindingOptions {
1385
+ type: "r2";
1386
+ }
1387
+ interface RateLimitBindingOptions {
1388
+ /** The namespace ID for this rate limiter. */
1389
+ namespace: string;
1390
+ /** Simple rate limiting configuration. */
1391
+ simple: {
1392
+ /** The maximum number of requests allowed in the time period. */limit: number; /** The time period in seconds (10 for ten seconds, 60 for one minute). */
1393
+ period: 10 | 60;
1394
+ };
1395
+ }
1396
+ /** Binding to a rate limiter. */
1397
+ interface RateLimitBinding extends RateLimitBindingOptions {
1398
+ type: "rate-limit";
1399
+ }
1400
+ /**
1401
+ * Declares a secret that is required by your Worker, exposed on `env` under
1402
+ * the binding name.
1403
+ *
1404
+ * When defined, this binding:
1405
+ * - Replaces .dev.vars/.env/process.env inference for type generation
1406
+ * - Enables local dev validation with warnings for missing secrets
1407
+ *
1408
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#secrets-configuration-property
1409
+ */
1410
+ interface SecretBinding {
1411
+ type: "secret";
1412
+ }
1413
+ interface SecretsStoreSecretBindingOptions {
1414
+ /** ID of the secret store. */
1415
+ storeId: string;
1416
+ /** Name of the secret. */
1417
+ secretName: string;
1418
+ }
1419
+ /** Binding to a Secrets Store secret. */
1420
+ interface SecretsStoreSecretBinding extends SecretsStoreSecretBindingOptions {
1421
+ type: "secrets-store-secret";
1422
+ }
1423
+ type SendEmailDestinationOptions = {
1424
+ /** If this binding should be restricted to a specific verified address. */destinationAddress: string;
1425
+ allowedDestinationAddresses?: never;
1426
+ } | {
1427
+ destinationAddress?: never; /** If this binding should be restricted to a set of verified addresses. */
1428
+ allowedDestinationAddresses: string[];
1429
+ } | {
1430
+ destinationAddress?: never;
1431
+ allowedDestinationAddresses?: never;
1432
+ };
1433
+ type SendEmailBindingOptions = SendEmailDestinationOptions & {
1434
+ /** If this binding should be restricted to a set of sender addresses. */allowedSenderAddresses?: string[]; /** Options that only apply during local development. */
1435
+ dev?: BindingDevOptions;
1436
+ };
1437
+ /**
1438
+ * Binding for sending email from inside the Worker.
1439
+ *
1440
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
1441
+ */
1442
+ type SendEmailBinding = SendEmailBindingOptions & {
1443
+ type: "send-email";
1444
+ };
1445
+ interface StreamBindingOptions {
1446
+ /** Options that only apply during local development. */
1447
+ dev?: BindingDevOptions;
1448
+ }
1449
+ /** Binding to Cloudflare Stream. */
1450
+ interface StreamBinding$1 extends StreamBindingOptions {
1451
+ type: "stream";
1452
+ }
1453
+ /**
1454
+ * Inline string value made available to the Worker on `env` under the
1455
+ * binding name.
1456
+ *
1457
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
1458
+ */
1459
+ interface TextBinding<T$1 extends string = string> {
1460
+ type: "text";
1461
+ /** The string value made available to the Worker. */
1462
+ value: T$1;
1463
+ }
1464
+ interface UnsafeBindingOptions {
1465
+ /** Local-dev plugin configuration for this unsafe binding. */
1466
+ dev?: {
1467
+ /** The plugin package that provides the binding's local-dev implementation. */plugin: {
1468
+ package: string;
1469
+ name: string;
1470
+ }; /** Plugin-specific options. */
1471
+ options?: Record<string, unknown>;
1472
+ };
1473
+ [key: string]: unknown;
1474
+ }
1475
+ /**
1476
+ * Escape-hatch binding for runtime features that aren't directly supported
1477
+ * by this configuration. Included in the Worker's upload metadata without
1478
+ * changes.
1479
+ */
1480
+ interface UnsafeBinding extends UnsafeBindingOptions {
1481
+ type: `unsafe:${string}`;
1482
+ }
1483
+ interface VectorizeBindingOptions {
1484
+ /** The name of the Vectorize index. */
1485
+ name: string;
1486
+ /** Options that only apply during local development. */
1487
+ dev?: BindingDevOptions;
1488
+ }
1489
+ /**
1490
+ * Binding to a Vectorize index.
1491
+ *
1492
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
1493
+ */
1494
+ interface VectorizeBinding extends VectorizeBindingOptions {
1495
+ type: "vectorize";
1496
+ }
1497
+ /** Binding to the Worker version's metadata. */
1498
+ interface VersionMetadataBinding {
1499
+ type: "version-metadata";
1500
+ }
1501
+ type VpcNetworkBindingOptions = {
1502
+ /** The tunnel ID of the Cloudflare Tunnel to route traffic through. Mutually exclusive with `networkId`. */tunnelId: string;
1503
+ networkId?: never; /** Options that only apply during local development. */
1504
+ dev?: BindingDevOptions;
1505
+ } | {
1506
+ tunnelId?: never; /** The network ID to route traffic through. Mutually exclusive with `tunnelId`. */
1507
+ networkId: string; /** Options that only apply during local development. */
1508
+ dev?: BindingDevOptions;
1509
+ };
1510
+ /** Binding to a VPC network. */
1511
+ type VpcNetworkBinding = VpcNetworkBindingOptions & {
1512
+ type: "vpc-network";
1513
+ };
1514
+ interface VpcServiceBindingOptions {
1515
+ /** The service ID of the VPC connectivity service. */
1516
+ id: string;
1517
+ /** Options that only apply during local development. */
1518
+ dev?: BindingDevOptions;
1519
+ }
1520
+ /** Binding to a VPC service. */
1521
+ interface VpcServiceBinding extends VpcServiceBindingOptions {
1522
+ type: "vpc-service";
1523
+ }
1524
+ interface WorkerBindingOptions<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkerEntrypointExportName<TWorker$1> | undefined = WorkerEntrypointExportName<TWorker$1> | undefined> {
1525
+ /** The name or config of the bound Worker. */
1526
+ worker: TWorker$1;
1527
+ /** The named export to bind to (defaults to the default export). */
1528
+ exportName?: TExportName$1;
1529
+ /** Optional properties that will be made available to the service via `ctx.props`. */
1530
+ props?: Record<string, unknown>;
1531
+ /** Options that only apply during local development. */
1532
+ dev?: BindingDevOptions;
1533
+ }
1534
+ /**
1535
+ * Service binding (Worker-to-Worker). `worker` is the name or config of the
1536
+ * bound Worker; `exportName` selects a named `WorkerEntrypoint` export
1537
+ * (defaults to the default export).
1538
+ *
1539
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
1540
+ */
1541
+ interface WorkerBinding<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkerEntrypointExportName<TWorker$1> | undefined = WorkerEntrypointExportName<TWorker$1> | undefined> extends WorkerBindingOptions<TWorker$1, TExportName$1> {
1542
+ type: "worker";
1543
+ }
1544
+ /** Binding to a Worker Loader. */
1545
+ interface WorkerLoaderBinding {
1546
+ type: "worker-loader";
1547
+ }
1548
+ interface WorkflowBindingOptions<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkflowExportName<TWorker$1> = WorkflowExportName<TWorker$1>> {
1549
+ /** The name or config of the Worker that defines the Workflow. */
1550
+ worker: TWorker$1;
1551
+ /** The exported class name of the Workflow. */
1552
+ exportName: TExportName$1;
1553
+ }
1087
1554
  /**
1088
- * Worker configuration. This is the input shape passed to
1089
- * [`defineWorker`](https://developers.cloudflare.com/workers/wrangler/configuration/).
1090
- *
1091
- * Fields are validated at runtime by `InputWorkerSchema` and normalised before
1092
- * being passed to downstream tooling.
1555
+ * Binding to a Workflow. `worker` is the name or config of the Worker that
1556
+ * defines the Workflow; `exportName` is the exported `WorkflowEntrypoint`
1557
+ * class name.
1093
1558
  */
1094
- interface WorkerConfig {
1559
+ interface WorkflowBinding<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkflowExportName<TWorker$1> = WorkflowExportName<TWorker$1>> extends WorkflowBindingOptions<TWorker$1, TExportName$1> {
1560
+ type: "workflow";
1561
+ }
1562
+ interface Bindings {
1095
1563
  /**
1096
- * Discriminates this config as a Worker config.
1564
+ * Agent Memory namespace binding. Each binding is scoped to a namespace and
1565
+ * allows agents to persist and recall memory.
1566
+ */
1567
+ agentMemory(options: AgentMemoryBindingOptions): AgentMemoryBinding;
1568
+ /**
1569
+ * Binding to the Workers AI project.
1097
1570
  *
1098
- * Injected automatically by `defineWorker`; only needs to be written by
1099
- * hand when authoring a raw config object without the helper.
1571
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
1100
1572
  */
1101
- type: "worker";
1573
+ ai<TAiModelList extends AiModelListType = AiModels>(options?: AiBindingOptions): TypedAiBinding<TAiModelList>;
1102
1574
  /**
1103
- * The name of your Worker.
1575
+ * AI Search instance binding. Each binding is bound directly to a single
1576
+ * pre-existing instance within the "default" namespace.
1104
1577
  */
1105
- name: string;
1578
+ aiSearch(options: AiSearchBindingOptions): AiSearchBinding;
1106
1579
  /**
1107
- * A date in the form yyyy-mm-dd, which will be used to determine
1108
- * which version of the Workers runtime is used.
1109
- *
1110
- * More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
1580
+ * AI Search namespace binding. Each binding is scoped to a namespace and
1581
+ * allows dynamic instance CRUD within it.
1111
1582
  */
1112
- compatibilityDate: string;
1583
+ aiSearchNamespace(options: AiSearchNamespaceBindingOptions): AiSearchNamespaceBinding;
1113
1584
  /**
1114
- * A list of flags that enable features from upcoming features of
1115
- * the Workers runtime, usually used together with `compatibilityDate`.
1116
- *
1117
- * More details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/
1585
+ * Binding to an Analytics Engine dataset.
1118
1586
  *
1119
- * @default []
1587
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
1120
1588
  */
1121
- compatibilityFlags?: string[];
1589
+ analyticsEngineDataset(options?: AnalyticsEngineDatasetBindingOptions): AnalyticsEngineDatasetBinding;
1122
1590
  /**
1123
- * The entrypoint module that will be executed.
1124
- *
1125
- * May be either a path string (e.g. `"./src/index.ts"`) or a module
1126
- * namespace imported with the `cf-worker` import attribute.
1127
- *
1128
- * @example
1129
- * ```ts
1130
- * import * as entrypoint from "./src" with { type: "cf-worker" };
1131
- * export default defineWorker({ entrypoint });
1132
- * ```
1591
+ * Binding to an Artifacts instance. Artifacts provides git-compatible file
1592
+ * storage on Cloudflare Workers.
1133
1593
  */
1134
- entrypoint?: string | WorkerModule;
1594
+ artifacts(options: ArtifactsBindingOptions): ArtifactsBinding;
1135
1595
  /**
1136
- * Specify the directory of static assets to deploy/serve.
1137
- *
1138
- * More details at https://developers.cloudflare.com/workers/frameworks/
1596
+ * Binding to the Worker's static assets.
1139
1597
  *
1140
1598
  * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
1141
1599
  */
1142
- assets?: {
1143
- /** How to handle HTML requests. */htmlHandling?: "auto-trailing-slash" | "drop-trailing-slash" | "force-trailing-slash" | "none"; /** How to handle requests that do not match an asset. */
1144
- notFoundHandling?: "single-page-application" | "404-page" | "none";
1145
- /**
1146
- * Matches will be routed to the User Worker, and matches to negative rules will go to the Asset Worker.
1147
- *
1148
- * Can also be `true`, indicating that every request should be routed to the User Worker.
1149
- */
1150
- runWorkerFirst?: string[] | boolean;
1151
- };
1600
+ assets(): AssetsBinding;
1152
1601
  /**
1153
- * Custom domains that your Worker should be published to.
1602
+ * Binding to a headless browser usable from the Worker.
1154
1603
  *
1155
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
1604
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
1156
1605
  */
1157
- domains?: string[];
1606
+ browser(options?: BrowserBindingOptions): BrowserBinding;
1158
1607
  /**
1159
- * Event triggers fetch routes, queue consumers, cron schedules, Email
1160
- * Routing addresses, and raw sockets — that invoke this Worker.
1161
- * Construct entries with `triggers.fetch(...)`, `triggers.queue(...)`,
1162
- * `triggers.scheduled(...)`, `triggers.email(...)`, or
1163
- * `triggers.connect(...)`.
1608
+ * Binding to a D1 database.
1164
1609
  *
1165
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
1610
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
1166
1611
  */
1167
- triggers?: Trigger[];
1612
+ d1(options?: D1BindingOptions): D1Binding;
1168
1613
  /**
1169
- * A list of Tail Workers that are bound to this Worker.
1170
- *
1171
- * `@cloudflare/config` unifies regular and streaming tail consumers under
1172
- * a single field; pass `streaming: true` to forward streaming tail events.
1614
+ * Binding to a Workers for Platforms dispatch namespace.
1173
1615
  *
1174
- * @default []
1175
- */
1176
- tailConsumers?: Array<{
1177
- /** The name of the service tail events will be forwarded to. */worker: string; /** Whether to stream tail events in real time. */
1178
- streaming?: boolean;
1179
- }>;
1180
- /**
1181
- * Specify the cache behavior of the Worker.
1616
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
1182
1617
  */
1183
- cache?: {
1184
- /** If cache is enabled for this Worker. */enabled: boolean; /** Whether cached assets may be reused across Worker versions. */
1185
- crossVersionCache?: boolean;
1186
- };
1618
+ dispatchNamespace(options?: DispatchNamespaceBindingOptions): DispatchNamespaceBinding;
1187
1619
  /**
1188
- * Specify how the Worker should be located to minimize round-trip time.
1620
+ * Binding to a Durable Object class. `worker` is the name or config of the
1621
+ * Worker that defines the class; `exportName` is the exported class name.
1189
1622
  *
1190
- * More details: https://developers.cloudflare.com/workers/platform/smart-placement/
1623
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
1191
1624
  */
1192
- placement?: {
1193
- mode: "off" | "smart";
1194
- hint?: string;
1195
- } | {
1196
- mode?: "targeted";
1197
- region: string;
1198
- } | {
1199
- mode?: "targeted";
1200
- host: string;
1201
- } | {
1202
- mode?: "targeted";
1203
- hostname: string;
1204
- };
1625
+ durableObject<TWorker$1 extends WorkerReference, TExportName$1 extends DurableObjectExportName<TWorker$1>>(options: DurableObjectBindingOptions<TWorker$1, TExportName$1>): DurableObjectBinding<TWorker$1, TExportName$1>;
1626
+ /** Binding to a Flagship feature-flag service. */
1627
+ flagship(options?: FlagshipBindingOptions): FlagshipBinding;
1205
1628
  /**
1206
- * Specify limits for runtime behavior.
1207
- * Only supported for the "standard" Usage Model.
1629
+ * Binding to a Hyperdrive configuration.
1208
1630
  *
1209
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#limits
1631
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
1210
1632
  */
1211
- limits?: {
1212
- /** Maximum allowed CPU time for a Worker's invocation in milliseconds. */cpuMs?: number; /** Maximum allowed number of fetch requests that a Worker's invocation can execute. */
1213
- subrequests?: number;
1214
- };
1633
+ hyperdrive(options: HyperdriveBindingOptions): HyperdriveBinding;
1215
1634
  /**
1216
- * Send Trace Events from this Worker to Workers Logpush.
1217
- *
1218
- * This will not configure a corresponding Logpush job automatically.
1635
+ * Binding to Cloudflare Images.
1219
1636
  *
1220
- * For more information about Workers Logpush, see:
1221
- * https://blog.cloudflare.com/logpush-for-workers/
1637
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
1222
1638
  */
1223
- logpush?: boolean;
1639
+ images(options?: ImagesBindingOptions): ImagesBinding$1;
1224
1640
  /**
1225
- * Specify the observability behavior of the Worker.
1226
- *
1227
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#observability
1641
+ * Inline JSON value made available to the Worker on `env` under the
1642
+ * binding name.
1228
1643
  */
1229
- observability?: {
1230
- /** If observability is enabled for this Worker. */enabled?: boolean; /** The sampling rate. */
1231
- headSamplingRate?: number;
1232
- /**
1233
- * Whether query strings are removed from request URLs in logs and traces.
1234
- *
1235
- * @default false
1236
- */
1237
- redactQueryString?: boolean;
1238
- logs?: {
1239
- enabled?: boolean; /** The sampling rate. */
1240
- headSamplingRate?: number; /** Set to false to disable invocation logs. */
1241
- invocationLogs?: boolean;
1242
- /**
1243
- * If logs should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
1244
- *
1245
- * @default true
1246
- */
1247
- persist?: boolean;
1248
- /**
1249
- * What destinations logs emitted from the Worker should be sent to.
1250
- *
1251
- * @default []
1252
- */
1253
- destinations?: string[];
1254
- };
1255
- traces?: {
1256
- enabled?: boolean; /** The sampling rate. */
1257
- headSamplingRate?: number;
1258
- /**
1259
- * If traces should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
1260
- *
1261
- * @default true
1262
- */
1263
- persist?: boolean;
1264
- /**
1265
- * What destinations traces emitted from the Worker should be sent to.
1266
- *
1267
- * @default []
1268
- */
1269
- destinations?: string[];
1270
- };
1271
- };
1644
+ json<T$1 extends Json>(value: T$1): JsonBinding<T$1>;
1272
1645
  /**
1273
- * Whether we use `<name>.<subdomain>.workers.dev` to
1274
- * test and deploy your Worker.
1275
- *
1276
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workersdev
1646
+ * Binding to a Workers KV namespace.
1277
1647
  *
1278
- * @default true
1648
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
1279
1649
  */
1280
- workersDev?: boolean;
1650
+ kv<TKey extends string = string>(options?: KvBindingOptions): TypedKvBinding<TKey>;
1651
+ /** Binding for forwarding logs to logfwdr. */
1652
+ logfwdr(options: LogfwdrBindingOptions): LogfwdrBinding;
1653
+ /** Binding to Cloudflare Media Transformations. */
1654
+ media(options?: MediaBindingOptions): MediaBinding$1;
1281
1655
  /**
1282
- * Whether we use `<version>-<name>.<subdomain>.workers.dev` to
1283
- * serve Preview URLs for your Worker.
1656
+ * Binding to an uploaded mTLS certificate.
1284
1657
  *
1285
- * @default false
1658
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
1286
1659
  */
1287
- previewUrls?: boolean;
1660
+ mtlsCertificate(options: MtlsCertificateBindingOptions): MtlsCertificateBinding;
1661
+ /** Binding to a Cloudflare Pipeline. */
1662
+ pipeline<TRecord extends PipelineRecord = PipelineRecord>(options: PipelineBindingOptions): TypedPipelineBinding<TRecord>;
1288
1663
  /**
1289
- * Designates this Worker as an internal-only "first-party" Worker.
1664
+ * Producer binding to a Cloudflare Queue.
1290
1665
  *
1291
- * @internal
1666
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
1292
1667
  */
1293
- firstPartyWorker?: boolean;
1668
+ queue<TBody = unknown>(options?: QueueBindingOptions): TypedQueueBinding<TBody>;
1294
1669
  /**
1295
- * "Unsafe" tables for runtime features that aren't directly supported by
1296
- * this configuration. Values are forwarded verbatim in the Worker's
1297
- * upload metadata.
1670
+ * Binding to an R2 bucket.
1298
1671
  *
1299
- * @default {}
1300
- */
1301
- unsafe?: {
1302
- /**
1303
- * Arbitrary key/value pairs that will be included in the uploaded metadata. Values specified
1304
- * here will always be applied to metadata last, so can add new or override existing fields.
1305
- */
1306
- metadata?: Record<string, unknown>;
1307
- /**
1308
- * Used for internal capnp uploads for the Workers runtime.
1309
- */
1310
- capnp?: {
1311
- basePath: string;
1312
- sourceSchemas: string[];
1313
- compiledSchema?: never;
1314
- } | {
1315
- basePath?: never;
1316
- sourceSchemas?: never;
1317
- compiledSchema: string;
1318
- };
1319
- };
1320
- /**
1321
- * Bindings exposed on the Worker's `env` object. Construct entries with
1322
- * `bindings.kv(...)`, `bindings.r2(...)`, etc.
1672
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
1323
1673
  */
1324
- env?: Record<string, Binding>;
1674
+ r2(options?: R2BindingOptions): R2Binding;
1675
+ /** Binding to a rate limiter. */
1676
+ rateLimit(options: RateLimitBindingOptions): RateLimitBinding;
1325
1677
  /**
1326
- * Configuration for named exports declared by the Worker. Each entry's
1327
- * key is the exported class name; the value configures the export.
1678
+ * Declares a secret that is required by your Worker, exposed on `env` under
1679
+ * the binding name.
1328
1680
  *
1329
- * Only one export kind is currently supported:
1681
+ * When defined, this binding:
1682
+ * - Replaces .dev.vars/.env/process.env inference for type generation
1683
+ * - Enables local dev validation with warnings for missing secrets
1330
1684
  *
1331
- * - Construct entries with `exports.durableObject(...)`.
1332
- * - Declares Durable Object classes exported from this Worker.
1333
- * For more information about Durable Objects, see the documentation at
1334
- * https://developers.cloudflare.com/workers/learning/using-durable-objects.
1335
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects.
1685
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#secrets-configuration-property
1336
1686
  */
1337
- exports?: Record<string, Export>;
1338
- }
1339
- /**
1340
- * Settings shared by the other exports.
1341
- * Authored as a named `settings` export via
1342
- * `defineSettings`.
1343
- */
1344
- interface SettingsConfig {
1687
+ secret(): SecretBinding;
1688
+ /** Binding to a Secrets Store secret. */
1689
+ secretsStoreSecret(options: SecretsStoreSecretBindingOptions): SecretsStoreSecretBinding;
1345
1690
  /**
1346
- * Discriminates this config as a settings config.
1691
+ * Binding for sending email from inside the Worker.
1347
1692
  *
1348
- * Injected automatically by `defineSettings`; only needs to be written by
1349
- * hand when authoring a raw config object without the helper.
1350
- */
1351
- type: "settings";
1352
- /**
1353
- * This is the ID of the account associated with your zone.
1354
- * You might have more than one account, so make sure to use
1355
- * the ID of the account associated with the zone/route you
1356
- * provide, if you provide one. It can also be specified through
1357
- * the CLOUDFLARE_ACCOUNT_ID environment variable.
1693
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
1358
1694
  */
1359
- accountId?: string;
1695
+ sendEmail(options?: SendEmailBindingOptions): SendEmailBinding;
1696
+ /** Binding to Cloudflare Stream. */
1697
+ stream(options?: StreamBindingOptions): StreamBinding$1;
1360
1698
  /**
1361
- * Specify the compliance region mode of the Worker.
1699
+ * Inline string value made available to the Worker on `env` under the
1700
+ * binding name.
1362
1701
  *
1363
- * Although if the user does not specify a compliance region, the default is `public`,
1364
- * it can be set to `undefined` in configuration to delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable.
1702
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
1365
1703
  */
1366
- complianceRegion?: "public" | "fedramp-high";
1367
- } //#endregion
1368
- //#region src/worker-definition.d.ts
1369
- /**
1370
- * Base shape of a Worker definition. Carries the authored config (under
1371
- * {@link DEFINITION}) and the untyped cross-worker binding helpers.
1372
- */
1373
- interface WorkerDefinition<TConfig$1 extends WorkerConfig = WorkerConfig> extends Pick<Bindings, "durableObject" | "worker"> {
1374
- [DEFINITION]: {
1375
- config: ConfigInput<Omit<TConfig$1, "type">>;
1376
- type: "worker";
1377
- };
1378
- }
1379
- /**
1380
- * Worker definition with typed cross-worker binding helpers.
1381
- */
1382
- interface TypedWorkerDefinition<TConfig$1 extends WorkerConfig, TWorkerName extends string = InferWorkerName<TConfig$1>> extends WorkerDefinition<TConfig$1> {
1704
+ text<T$1 extends string>(value: T$1): TextBinding<T$1>;
1383
1705
  /**
1384
- * Binding to a Durable Object class. `worker` is the name of the Worker
1385
- * that defines the class; `exportName` is the exported class name.
1706
+ * Binding to a Vectorize index.
1386
1707
  *
1387
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
1708
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
1388
1709
  */
1389
- durableObject<TExportName$1 extends InferDurableNamespaces<TConfig$1>>(options: {
1390
- worker: TWorkerName;
1391
- exportName: TExportName$1;
1392
- }): TypedDurableObjectBinding<TConfig$1, TExportName$1>;
1710
+ vectorize(options: VectorizeBindingOptions): VectorizeBinding;
1711
+ /** Binding to the Worker version's metadata. */
1712
+ versionMetadata(): VersionMetadataBinding;
1713
+ /** Binding to a VPC network. */
1714
+ vpcNetwork(options: VpcNetworkBindingOptions): VpcNetworkBinding;
1715
+ /** Binding to a VPC service. */
1716
+ vpcService(options: VpcServiceBindingOptions): VpcServiceBinding;
1393
1717
  /**
1394
- * Service binding (Worker-to-Worker). `worker` is the name of the bound
1395
- * Worker; `exportName` selects a named `WorkerEntrypoint` export (defaults to
1396
- * the default export).
1718
+ * Service binding (Worker-to-Worker). `worker` is the name or config of the
1719
+ * bound Worker; `exportName` selects a named `WorkerEntrypoint` export
1720
+ * (defaults to the default export).
1397
1721
  *
1398
1722
  * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
1399
1723
  */
1400
- worker<TExportName$1 extends InferWorkerEntrypointExports<TConfig$1> | undefined = undefined>(options: {
1401
- worker: TWorkerName;
1402
- exportName?: TExportName$1;
1403
- props?: Record<string, unknown>;
1404
- dev?: BindingDevOptions;
1405
- }): TypedWorkerBinding<TConfig$1, TExportName$1 extends string ? TExportName$1 : "default">;
1406
- }
1407
- type WorkerConfigExport<T$1 extends WorkerConfig = WorkerConfig> = ConfigInput<T$1>;
1408
- /**
1409
- * Authored Worker config shape — {@link WorkerConfig} without the `type`
1410
- * discriminant, which `defineWorker` injects.
1411
- */
1412
- type WorkerConfigInput = Omit<WorkerConfig, "type">;
1413
- declare function defineWorker<const T$1 extends WorkerConfigInput>(config: (ctx: ConfigContext) => (WorkerConfigInput & T$1) | Promise<WorkerConfigInput & T$1>): TypedWorkerDefinition<T$1 & {
1414
- type: "worker";
1415
- }>;
1416
- declare function defineWorker<const T$1 extends WorkerConfigInput>(config: (WorkerConfigInput & T$1) | Promise<WorkerConfigInput & T$1>): TypedWorkerDefinition<T$1 & {
1417
- type: "worker";
1418
- }>; //#endregion
1419
- //#region src/inference.d.ts
1420
- /**
1421
- * The Worker's entry module, imported with the `{ type: "cf-worker" }` import attribute
1422
- * @example
1423
- * ```ts
1424
- * import * as entrypoint from "./src" with { type: "cf-worker" };
1425
- * ```
1426
- */
1427
- type WorkerModule = Record<string, any>;
1428
- /**
1429
- * Default module type representing an unknown Worker's exports.
1430
- * - default export can be `ExportedHandler` or a `WorkerEntrypoint` class constructor
1431
- * - named exports can be `WorkerEntrypoint`, `DurableObject`, or `WorkflowEntrypoint` class constructors
1432
- */
1433
- interface DefaultModule {
1434
- default?: ExportedHandler | Constructor<Rpc.WorkerEntrypointBranded>;
1435
- [key: string]: ExportedHandler | Constructor<Rpc.WorkerEntrypointBranded> | Constructor<Rpc.DurableObjectBranded> | Constructor<Rpc.WorkflowEntrypointBranded> | undefined;
1436
- }
1437
- /**
1438
- * Represents a class constructor that creates instances of TInstance.
1439
- */
1440
- type Constructor<TInstance> = new (...args: any[]) => TInstance;
1441
- /**
1442
- * Extracts the instance type from a class constructor if it extends `TInstance`.
1443
- */
1444
- type ExtractInstance<T$1, TInstance> = T$1 extends Constructor<TInstance> ? InstanceType<T$1> : never;
1445
- /**
1446
- * Mapping from binding type literals to Cloudflare runtime types.
1447
- *
1448
- * Entries fall into two groups:
1449
- * - Parameterized bindings (ai, json, kv, pipeline, queue, text) refine their
1450
- * runtime type from the binding instance via nominal matches against the
1451
- * `Typed*Binding` / `JsonBinding` / `TextBinding` interfaces from
1452
- * `./bindings`. When `TBinding` does not match, the entry falls back to the
1453
- * unparameterized runtime type.
1454
- * - Non-parameterized bindings map their type literal directly to a runtime
1455
- * type and ignore `TBinding`.
1456
- *
1457
- * IMPORTANT: The right-hand-side identifiers in this map (e.g. `KVNamespace`,
1458
- * `ImagesBinding`, `Fetcher`) must resolve to the ambient runtime types from
1459
- * `@cloudflare/workers-types`, not to local config interfaces. Several local
1460
- * binding interfaces in `./bindings.ts` (`ImagesBinding`, `MediaBinding`,
1461
- * `StreamBinding`) share names with ambient globals — importing those local
1462
- * types into this file silently shadows the globals and breaks `InferEnv`.
1463
- * Only import the `Typed*Binding`, `JsonBinding`, and `TextBinding` interfaces
1464
- * from `./bindings` (their names do not collide with ambient globals); never
1465
- * widen the import to a wildcard or to the plain `*Binding` interfaces.
1466
- */
1467
- interface BindingTypeMap<TBinding> {
1468
- ai: TBinding extends TypedAiBinding<infer T> ? Ai<T> : Ai;
1469
- json: TBinding extends JsonBinding<infer T> ? T : never;
1470
- kv: TBinding extends TypedKvBinding<infer T> ? KVNamespace<T> : KVNamespace;
1471
- pipeline: TBinding extends TypedPipelineBinding<infer T> ? Pipeline<T> : Pipeline;
1472
- queue: TBinding extends TypedQueueBinding<infer T> ? Queue<T> : Queue;
1473
- text: TBinding extends TextBinding<infer T> ? T : never;
1474
- "agent-memory": AgentMemoryNamespace;
1475
- "ai-search": AiSearchInstance;
1476
- "ai-search-namespace": AiSearchNamespace;
1477
- "analytics-engine-dataset": AnalyticsEngineDataset;
1478
- artifacts: Artifacts;
1479
- assets: Fetcher;
1480
- browser: BrowserRun;
1481
- d1: D1Database;
1482
- "dispatch-namespace": DispatchNamespace;
1483
- "durable-object": DurableObjectNamespace;
1484
- flagship: Flagship;
1485
- hyperdrive: Hyperdrive;
1486
- images: ImagesBinding;
1487
- logfwdr: any;
1488
- media: MediaBinding;
1489
- "mtls-certificate": Fetcher;
1490
- "rate-limit": RateLimit;
1491
- r2: R2Bucket;
1492
- secret: string;
1493
- "secrets-store-secret": SecretsStoreSecret;
1494
- "send-email": SendEmail;
1495
- stream: StreamBinding;
1496
- vectorize: VectorizeIndex;
1497
- "version-metadata": WorkerVersionMetadata;
1498
- "vpc-service": Fetcher;
1499
- "vpc-network": Fetcher;
1500
- "web-search": WebSearch;
1501
- worker: Fetcher;
1502
- "worker-loader": WorkerLoader;
1503
- workflow: Workflow;
1504
- }
1505
- type InferBindingType<TBinding> = TBinding extends TypedWorkerBinding<infer TConfig, infer TExportName extends string> ? InferMainModule<TConfig> extends infer TModule extends WorkerModule ? TExportName extends keyof TModule ? TModule[TExportName] extends Constructor<any> ? Fetcher<ExtractInstance<TModule[TExportName], Rpc.WorkerEntrypointBranded>> : Fetcher : never : never : TBinding extends TypedDurableObjectBinding<infer TConfig, infer TExportName extends string> ? InferMainModule<TConfig> extends infer TModule extends WorkerModule ? TExportName extends keyof TModule ? DurableObjectNamespace<ExtractInstance<TModule[TExportName], Rpc.DurableObjectBranded>> : never : never : TBinding extends TypedWorkflowBinding<infer TConfig, infer TExportName extends string> ? InferMainModule<TConfig> extends infer TModule extends WorkerModule ? TExportName extends keyof TModule ? ExtractInstance<TModule[TExportName], Rpc.WorkflowEntrypointBranded> extends infer TWorkflow ? TWorkflow extends {
1506
- run(event: {
1507
- payload: infer P;
1508
- }, step: any): any;
1509
- } ? Workflow<P> : Workflow : Workflow : never : never : TBinding extends {
1510
- type: `unsafe:${string}`;
1511
- } ? any : TBinding extends {
1512
- type: infer K extends keyof BindingTypeMap<TBinding>;
1513
- } ? BindingTypeMap<TBinding>[K] : never;
1514
- /**
1515
- * Infer the Worker name from a config.
1516
- *
1517
- * @example
1518
- * ```typescript
1519
- * import { defineWorker } from "@cloudflare/config";
1520
- * import type { InferDurableNamespaces, UnwrapConfig } from "@cloudflare/config";
1521
- *
1522
- * const config = defineWorker({ name: "my-worker", ... });
1523
- *
1524
- * type WorkerConfig = UnwrapConfig<typeof config>;
1525
- * // Inferred as: "my-worker"
1526
- * type Name = InferWorkerName<WorkerConfig>;
1527
- * ```
1528
- */
1529
- type InferWorkerName<TUnwrappedConfig$1> = TUnwrappedConfig$1 extends {
1530
- name: infer TName extends string;
1531
- } ? TName : never;
1532
- /**
1533
- * Infer export names from a config's exports, optionally filtered by type.
1534
- * When TExportType is `string` (default), returns all export names.
1535
- * When TExportType is a specific literal like `"durable-object"` or `"workflow"`,
1536
- * returns only exports of that type.
1537
- */
1538
- type InferExportsByType<TUnwrappedConfig$1, TExportType extends string = string> = TUnwrappedConfig$1 extends {
1539
- exports: infer TExports extends Record<string, {
1540
- type: string;
1541
- }>;
1542
- } ? { [K in keyof TExports]: TExports[K] extends {
1543
- type: TExportType;
1544
- } ? K & string : never }[keyof TExports] : never;
1545
- /**
1546
- * Infer `WorkerEntrypoint` export names from a config.
1547
- * Returns named module exports that are not declared as type `"durable-object"` or `"workflow"` in `exports`.
1548
- * Excludes `"default"` since `exportName` should only be provided for named exports.
1549
- */
1550
- type InferWorkerEntrypointExports<TUnwrappedConfig$1> = Exclude<keyof InferMainModule<TUnwrappedConfig$1> & string, "default" | InferExportsByType<TUnwrappedConfig$1, "durable-object" | "workflow">>;
1551
- /**
1552
- * Unwrap function and promise types to get the underlying config.
1553
- * Use this to normalize a config before passing it to other inference utilities.
1554
- */
1555
- type UnwrapConfig<TConfig$1> = TConfig$1 extends WorkerDefinition<infer TUnwrappedConfig> ? TUnwrappedConfig : TConfig$1 extends WorkerConfigExport<infer TUnwrappedConfig> ? TUnwrappedConfig : never;
1556
- /**
1557
- * Infer the `Env` interface type from a Worker config.
1558
- *
1559
- * Transforms a config object's `env` bindings into their
1560
- * corresponding Cloudflare runtime types.
1561
- *
1562
- * @example
1563
- * ```typescript
1564
- * import { defineWorker, bindings } from "@cloudflare/config";
1565
- * import type { InferEnv, UnwrapConfig } from "@cloudflare/config";
1566
- *
1567
- * const config = defineWorker({
1568
- * env: {
1569
- * MY_JSON: bindings.json({ id: string }),
1570
- * MY_KV: bindings.kv(),
1571
- * },
1572
- * });
1573
- *
1574
- * type WorkerConfig = UnwrapConfig<typeof config>;
1575
- * // Inferred as: { MY_JSON: { id: string }; MY_KV: KVNamespace }
1576
- * export type Env = InferEnv<WorkerConfig>;
1577
- * ```
1578
- */
1579
- type InferEnv<TUnwrappedConfig$1> = TUnwrappedConfig$1 extends {
1580
- env: infer TEnv extends Record<string, any>;
1581
- } ? { [K in keyof TEnv]: InferBindingType<TEnv[K]> } : never;
1582
- /**
1583
- * Infer the Durable Object namespace names from a Worker config's exports.
1584
- * Returns a union of export names that declare a *live* Durable Object —
1585
- * `type: "durable-object"` with `state` either omitted, `"created"`, or
1586
- * `"expecting-transfer"`. Tombstone entries (`deleted`, `renamed`,
1587
- * `transferred`) are excluded because they retire the namespace and a
1588
- * binding to a tombstoned class would fail at deploy time.
1589
- *
1590
- * @example
1591
- * ```typescript
1592
- * import { defineWorker } from "@cloudflare/config";
1593
- * import type { InferDurableNamespaces, UnwrapConfig } from "@cloudflare/config";
1594
- *
1595
- * const config = defineWorker({
1596
- * exports: {
1597
- * MyDurableObject: { type: "durable-object", storage: "sqlite" },
1598
- * OldGone: { type: "durable-object", state: "deleted" },
1599
- * },
1600
- * });
1601
- *
1602
- * type WorkerConfig = UnwrapConfig<typeof config>;
1603
- * // Inferred as: "MyDurableObject" (the deleted tombstone is excluded)
1604
- * type DurableNamespaces = InferDurableNamespaces<WorkerConfig>;
1605
- * ```
1606
- */
1607
- type InferDurableNamespaces<TUnwrappedConfig$1> = TUnwrappedConfig$1 extends {
1608
- exports: infer TExports extends Record<string, {
1609
- type: string;
1610
- }>;
1611
- } ? { [K in keyof TExports]: TExports[K] extends {
1612
- type: "durable-object";
1613
- } ? TExports[K] extends {
1614
- state: "deleted" | "renamed" | "transferred";
1615
- } ? never : K & string : never }[keyof TExports] : never;
1616
- /**
1617
- * Infer the main module type from a Worker config's entrypoint.
1618
- * If entrypoint is a module namespace object, returns that type.
1619
- * If entrypoint is a `string` or not present, returns `DefaultModule` as a fallback.
1620
- */
1621
- type InferMainModule<TUnwrappedConfig$1> = TUnwrappedConfig$1 extends {
1622
- entrypoint: infer TModule extends WorkerModule;
1623
- } ? TModule : DefaultModule; //#endregion
1624
- //#region src/settings-definition.d.ts
1625
- /**
1626
- * Authored settings config shape — {@link SettingsConfig} without the `type`
1627
- * discriminant, which `defineSettings` injects.
1628
- */
1629
- type SettingsConfigInput = Omit<SettingsConfig, "type">;
1630
- /**
1631
- * A settings definition created by {@link defineSettings}.
1632
- */
1633
- interface SettingsDefinition {
1634
- [DEFINITION]: {
1635
- config: ConfigInput<SettingsConfigInput>;
1636
- type: "settings";
1637
- };
1724
+ worker<TWorker$1 extends WorkerReference, TExportName$1 extends WorkerEntrypointExportName<TWorker$1> | undefined = undefined>(options: WorkerBindingOptions<TWorker$1, TExportName$1>): WorkerBinding<TWorker$1, NoInfer<TExportName$1>>;
1725
+ /** Binding to a Worker Loader. */
1726
+ workerLoader(): WorkerLoaderBinding;
1638
1727
  }
1639
- /**
1640
- * Declare shared settings.
1641
- * Authored as a named `settings` export.
1642
- */
1643
- declare function defineSettings(config: ConfigInput<SettingsConfigInput>): SettingsDefinition; //#endregion
1728
+ declare const bindings: Bindings; //#endregion
1644
1729
  //#endregion
1645
- export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, ArtifactsBinding, AssetsBinding, BindingDevOptions, Bindings, BrowserBinding, ConfigContext, ConnectTrigger, D1Binding, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectDeletedExport, DurableObjectExpectingTransferExport, DurableObjectRenamedExport, DurableObjectTransferredExport, EmailTrigger, Exports, FetchTrigger, FlagshipBinding, HyperdriveBinding, ImagesBinding$1 as ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, JsonBinding, KvBinding, LogfwdrBinding, MediaBinding$1 as MediaBinding, MtlsCertificateBinding, PipelineBinding, QueueBinding, QueueConsumerTrigger, R2Binding, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, SettingsConfig, SettingsConfigInput, SettingsDefinition, StreamBinding$1 as StreamBinding, TextBinding, Triggers, TypedAiBinding, TypedDurableObjectBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, TypedWorkerBinding, TypedWorkerDefinition, TypedWorkflowBinding, UnsafeBinding, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WebSearchBinding, WorkerBinding, WorkerConfig, WorkerConfigExport, WorkerConfigInput, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerLoaderBinding, WorkflowBinding, bindings, defineSettings, defineWorker, exports, triggers };
1730
+ export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, ArtifactsBinding, AssetsBinding, BindingDevOptions, Bindings, BrowserBinding, CloudflareConfig, ConfigContext, ConnectTrigger, ContainerConfig, ContainerDefinition, D1Binding, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectDeletedExport, DurableObjectExpectingTransferExport, DurableObjectRenamedExport, DurableObjectTransferredExport, EmailTrigger, Exports, FetchTrigger, FlagshipBinding, HyperdriveBinding, ImagesBinding$1 as ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, JsonBinding, KvBinding, LogfwdrBinding, MediaBinding$1 as MediaBinding, MtlsCertificateBinding, PipelineBinding, QueueBinding, QueueConsumerTrigger, R2Binding, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, Settings, StreamBinding$1 as StreamBinding, TextBinding, Triggers, TypedAiBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, UnsafeBinding, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WorkerBinding, WorkerConfig, WorkerDefinition, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerLoaderBinding, WorkerReference, WorkflowBinding, bindings, defineConfig, defineContainer, defineWorker, exports, triggers };