cf 0.9.1 → 0.11.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 (363) hide show
  1. package/README.md +20 -5
  2. package/dist/_meta/agent-context.json +46 -39
  3. package/dist/_meta/commands.json +9358 -10581
  4. package/dist/_meta/hand-written-commands.json +784 -0
  5. package/dist/_meta/schemas.json +14870 -14667
  6. package/dist/abuse-reports-sDBTV0qZ.mjs +8 -0
  7. package/dist/{access-CxyW_sIW.mjs → access-DcNzuCue.mjs} +1 -1
  8. package/dist/account-BX90zXn5.mjs +2 -0
  9. package/dist/account-tags-Bz3JG5hI.mjs +9 -0
  10. package/dist/accounts-DCuW3xyZ.mjs +28 -0
  11. package/dist/{acm-CHacxa3s.mjs → acm-zjfShZLS.mjs} +1 -1
  12. package/dist/{addressing-BnqNmmYN.mjs → addressing-DORQ64Ux.mjs} +11 -11
  13. package/dist/{agent-context-Bu6yvDqA.mjs → agent-context-BgPR_aQr.mjs} +1 -1
  14. package/dist/agent-memory-C0hAUMeC.mjs +6 -0
  15. package/dist/ai-BpEBGMT2.mjs +5 -0
  16. package/dist/ai-audit-DnU3vn3E.mjs +2 -0
  17. package/dist/ai-gateway-COOrr_Yw.mjs +13 -0
  18. package/dist/ai-search-DKbN9Tyd.mjs +7 -0
  19. package/dist/ai-security-C_I5lo58.mjs +4 -0
  20. package/dist/{alerting-qa8SkXlD.mjs → alerting-4T8gmZs-.mjs} +4 -4
  21. package/dist/analytics-Bxh4TCP7.mjs +3 -0
  22. package/dist/analytics_engine-fV56bjVN.mjs +2 -0
  23. package/dist/{api-security-MfHbfZyf.mjs → api-security-COk_i184.mjs} +20 -20
  24. package/dist/argo-DIRfvxvv.mjs +2 -0
  25. package/dist/args-DlUhyGU0.mjs +2 -0
  26. package/dist/artifacts-BBfXNfUg.mjs +4 -0
  27. package/dist/audit-logs-BlOrlAWe.mjs +2 -0
  28. package/dist/{auth-DuLchM18.mjs → auth-D3X9HYhD.mjs} +3 -3
  29. package/dist/auth-DPhNN3Ly.mjs +5 -0
  30. package/dist/billing-B9e4PnvN.mjs +3 -0
  31. package/dist/body-parser-BshbixEq.mjs +2 -0
  32. package/dist/bot-management-D2JVeS-V.mjs +5 -0
  33. package/dist/botnet-feed-BTzTYs5d.mjs +3 -0
  34. package/dist/brand-protection-C5Q6Gpw9.mjs +3 -0
  35. package/dist/{browser-extension-q79xHrVW.mjs → browser-extension-u5uA0Lwk.mjs} +1 -1
  36. package/dist/browser-run-CHGOCTdG.mjs +4 -0
  37. package/dist/build-D0FhOj40.mjs +8 -0
  38. package/dist/{cache-Cl7vKJwH.mjs → cache-C6V7PbQM.mjs} +1 -1
  39. package/dist/{calls-DtK_ANxq.mjs → calls-Bye8Tyy-.mjs} +1 -1
  40. package/dist/certificate-authorities-B-U_e6JJ.mjs +2 -0
  41. package/dist/cf-Ds4JFovl.mjs +18 -0
  42. package/dist/chunk-LQW53VED-22IYZovK.mjs +119 -0
  43. package/dist/chunk-QBZBEHZB-CKzQKcIp.mjs +2 -0
  44. package/dist/{client-certificates-BtPU9GsQ.mjs → client-certificates-3RrC-6LG.mjs} +1 -1
  45. package/dist/{client-side-security-DAn-3jwp.mjs → client-side-security-DIdKvRMT.mjs} +1 -1
  46. package/dist/cloud-connector-CL1jPQud.mjs +2 -0
  47. package/dist/cloudforce-one-DULeqLkR.mjs +36 -0
  48. package/dist/command-C9VP3xaA.mjs +2 -0
  49. package/dist/{completions-BHE4pRjB.mjs → completions-CqgGKRAC.mjs} +3 -3
  50. package/dist/config.d.mts +1460 -1348
  51. package/dist/config.mjs +1 -1
  52. package/dist/connector-interrupts-CXlLObDv.mjs +2 -0
  53. package/dist/connector-telemetry-events-BrYX4ig4.mjs +2 -0
  54. package/dist/connector-telemetry-events-latest-BbpcII3_.mjs +2 -0
  55. package/dist/connector-telemetry-snapshots-BdeBQYcM.mjs +2 -0
  56. package/dist/connector-telemetry-snapshots-latest-DuCiimXl.mjs +2 -0
  57. package/dist/{connectors-Bo6ZT8PT.mjs → connectors-BQwyBJ4_.mjs} +1 -1
  58. package/dist/containers-BrQtGiNp.mjs +58 -0
  59. package/dist/{content-scan-D03UfK2X.mjs → content-scan-DNzhXYkY.mjs} +1 -1
  60. package/dist/{csamScanner-DgS-7ADh.mjs → csamScanner-CFq5s1Q3.mjs} +1 -1
  61. package/dist/{ct-alerting-8AKtNnUg.mjs → ct-alerting-CH6UmsGQ.mjs} +1 -1
  62. package/dist/custom-certificates-DnG73Wg2.mjs +5 -0
  63. package/dist/custom-csrs-bhClr2SU.mjs +3 -0
  64. package/dist/custom-hostnames-C0eiGvG9.mjs +5 -0
  65. package/dist/custom-nameservers-CVMhhLm6.mjs +3 -0
  66. package/dist/custom-pages-DTINMR30.mjs +3 -0
  67. package/dist/d1-sKdExJYF.mjs +20 -0
  68. package/dist/data-security-mV3a6UfW.mjs +7 -0
  69. package/dist/dcv-delegation-dBu3jdRw.mjs +2 -0
  70. package/dist/delegate.mjs +1 -1
  71. package/dist/{deploy-DGlmjPTS.mjs → deploy-BL59O1O1.mjs} +1 -1
  72. package/dist/deploy-input-Dz6q-__n.mjs +2 -0
  73. package/dist/{dev-BbLV0Ti-.mjs → dev-BDaavgH1.mjs} +2 -2
  74. package/dist/diagnostics-CJV6qWUA.mjs +3 -0
  75. package/dist/{directory-CCndFkbQ.mjs → directory-B5zCMusW.mjs} +1 -1
  76. package/dist/{dispatch-namespaces-C48JQ9EA.mjs → dispatch-namespaces-Dg5lu5xX.mjs} +1 -1
  77. package/dist/dist-BHi7UhXO.mjs +72 -0
  78. package/dist/dist-BWpErtDM.mjs +384 -0
  79. package/dist/{dls-BBq99pjI.mjs → dls-t0hnIe_P.mjs} +1 -1
  80. package/dist/dns-C8FC2hbh.mjs +29 -0
  81. package/dist/{dns-firewall-DdwVtm12.mjs → dns-firewall-CuhhUm55.mjs} +1 -1
  82. package/dist/{dot-prop-6SRZBKHT-C_xd7eTS.mjs → dot-prop-6SRZBKHT-wwGHcwAa.mjs} +1 -1
  83. package/dist/dry-run-DL2V6yFm.mjs +2 -0
  84. package/dist/durable-objects-BLrgM3Cw.mjs +2 -0
  85. package/dist/email-auth-BmYrl0pO.mjs +2 -0
  86. package/dist/email-routing-CF3_Z957.mjs +6 -0
  87. package/dist/email-security-F7OYcMkZ.mjs +18 -0
  88. package/dist/email-sending-EyU3WvGQ.mjs +7 -0
  89. package/dist/fieldExtractors-Cno37T2m.mjs +3 -0
  90. package/dist/firewall-8YWWy4iB.mjs +11 -0
  91. package/dist/flagship-C4x0l-8J.mjs +4 -0
  92. package/dist/{fraud-AH47n-wL.mjs → fraud-HR_SdUx3.mjs} +1 -1
  93. package/dist/google-tag-gateway-BdcS0WnX.mjs +2 -0
  94. package/dist/{healthchecks-DfEUG007.mjs → healthchecks-4qOvjrTN.mjs} +2 -2
  95. package/dist/{hostnames-DQUiD3Vr.mjs → hostnames-DehdYOMz.mjs} +1 -1
  96. package/dist/{hyperdrive-RyQboMWI.mjs → hyperdrive-3gD3hn70.mjs} +1 -1
  97. package/dist/iam-DR72hmii.mjs +6 -0
  98. package/dist/images-CeKc5JPh.mjs +8 -0
  99. package/dist/index.mjs +1 -1
  100. package/dist/intel-DtFix9WL.mjs +8 -0
  101. package/dist/{interactive-mV8PABm6.mjs → interactive-C7M55Wxx.mjs} +1 -1
  102. package/dist/ips-CtWCjXAN.mjs +2 -0
  103. package/dist/{keyless-certificates-oNu5jWKF.mjs → keyless-certificates-Dk24yQFz.mjs} +1 -1
  104. package/dist/keys-BmhG6Kn1.mjs +2 -0
  105. package/dist/{kv-Bi9B4E0A.mjs → kv-BuVPAuZP.mjs} +1 -1
  106. package/dist/{leaked-credential-checks-DKRjBLcr.mjs → leaked-credential-checks-XcZmt1I-.mjs} +1 -1
  107. package/dist/load-balancers-CylN-l7n.mjs +6 -0
  108. package/dist/{local-DTyuGwTw.mjs → local-Be3lg_9E.mjs} +1 -1
  109. package/dist/{local-runtime-IAXhEugU.mjs → local-runtime-Ce7k598H.mjs} +1 -1
  110. package/dist/logexplorer-CvRPoKbj.mjs +17 -0
  111. package/dist/logo-matches-Heuft3yF.mjs +2 -0
  112. package/dist/logos-DRYjGBDq.mjs +3 -0
  113. package/dist/logpush-Dve9jOMp.mjs +4 -0
  114. package/dist/{logs-DmWWL5f9.mjs → logs-SC86FE89.mjs} +1 -1
  115. package/dist/{magic-cloud-networking-XbTa6P52.mjs → magic-cloud-networking-DXzeqwX-.mjs} +4 -4
  116. package/dist/magic-network-monitoring-DW0Jl74i.mjs +4 -0
  117. package/dist/magic-transit-BK_3asH2.mjs +111 -0
  118. package/dist/managed-transforms-B6TV4qoE.mjs +3 -0
  119. package/dist/matches-Iss9Fo4R.mjs +2 -0
  120. package/dist/mcp-8wxXT6JU.mjs +4 -0
  121. package/dist/mesh-Bf9UAS4J.mjs +4 -0
  122. package/dist/{moq-CJpE-eNj.mjs → moq-ZKMFOeVz.mjs} +1 -1
  123. package/dist/mtls-certificates-DoWm6GiE.mjs +3 -0
  124. package/dist/{network-D2WRXCDe.mjs → network-B1lBARU9.mjs} +1 -1
  125. package/dist/{network-interconnects-Clq4X1U8.mjs → network-interconnects-CLYIFHfU.mjs} +1 -1
  126. package/dist/oauth-DuEONNgC.mjs +14 -0
  127. package/dist/{oauth-clients-hilWfAlm.mjs → oauth-clients-DgiTzLzu.mjs} +1 -1
  128. package/dist/oauth-scopes-BOBRMxjm.mjs +2 -0
  129. package/dist/observability-Jya7-zkl.mjs +4 -0
  130. package/dist/{open-PBXRGS4R-C46yIm3u.mjs → open-PBXRGS4R-CX8K4WYl.mjs} +3 -3
  131. package/dist/{organization-D41rIvJa.mjs → organization-CYxYV4e0.mjs} +6 -6
  132. package/dist/organizations-SacGUW44.mjs +2 -0
  133. package/dist/origin-ca-certificates-Ph1bJGQ1.mjs +3 -0
  134. package/dist/origin-post-quantum-encryption-BBLiGAGB.mjs +2 -0
  135. package/dist/origin-tls-client-auth-DSDgTN2X.mjs +4 -0
  136. package/dist/{output-DgW1hQGX.mjs → output-Ccqw2WOb.mjs} +1 -1
  137. package/dist/page-rules-BqEyFR2c.mjs +27 -0
  138. package/dist/pages-CQ7ZVWk1.mjs +14 -0
  139. package/dist/pay-per-crawl-BMe_3_Qj.mjs +4 -0
  140. package/dist/pipelines-6De2Pe2C.mjs +6 -0
  141. package/dist/precursor-iwK-1P_d.mjs +4 -0
  142. package/dist/progress-BqQcF5QH.mjs +2 -0
  143. package/dist/project-settings-C_1-JI6Y.mjs +3 -0
  144. package/dist/prompt-B0sWIs9c.mjs +3 -0
  145. package/dist/{public-BwQqexwo-DbWj8rrr.mjs → public-BYCVISMH-DnMJ5Jct.mjs} +1 -1
  146. package/dist/queries-c7zvnfEQ.mjs +3 -0
  147. package/dist/queues-BU6y16qS.mjs +6 -0
  148. package/dist/r2-Jo3QMahK.mjs +24 -0
  149. package/dist/{r2-data-catalog-DLtf9d6o.mjs → r2-data-catalog-B-tw-JdG.mjs} +1 -1
  150. package/dist/radar-DIYAMEof.mjs +2 -0
  151. package/dist/{rate-limits-B1YjnGue.mjs → rate-limits-DewOcznT.mjs} +1 -1
  152. package/dist/raw-fetch-Cc-MjHeL.mjs +2 -0
  153. package/dist/realtimekit-cnZEVNDn.mjs +7 -0
  154. package/dist/registrar-BsWr_aPM.mjs +23 -0
  155. package/dist/{registrar-sandbox-0i1T3zne.mjs → registrar-sandbox-BlcpUyIH.mjs} +6 -6
  156. package/dist/{registry-DDcSvd8H.mjs → registry-jifR3_Y6.mjs} +1 -1
  157. package/dist/reporting--1AyTV7k.mjs +2 -0
  158. package/dist/request-tracers-C_VX7X6-.mjs +2 -0
  159. package/dist/{resource-sharing-Ctdi9D-j.mjs → resource-sharing-Br5dqr3o.mjs} +1 -1
  160. package/dist/resource-tagging-C33U6T74.mjs +2 -0
  161. package/dist/rules-BfjzALMi.mjs +4 -0
  162. package/dist/rulesets-3i_1Vwt-.mjs +5 -0
  163. package/dist/rum-CjmIckiR.mjs +4 -0
  164. package/dist/{schema-BeXPWeK9.mjs → schema-1mwmslUV.mjs} +1 -1
  165. package/dist/schema-flags-llLJuFFw.mjs +5 -0
  166. package/dist/{scim-BgGsmHrL.mjs → scim-pApmzA5B.mjs} +1 -1
  167. package/dist/sdk-ZctLa5jW.mjs +3 -0
  168. package/dist/{secrets-store-BCpFhYFv.mjs → secrets-store-DBC9WJau.mjs} +1 -1
  169. package/dist/security-center-Djm06dq-.mjs +2 -0
  170. package/dist/{security-txt-Be2Bif0z.mjs → security-txt-Ci7bP4zH.mjs} +1 -1
  171. package/dist/{share-Bz2tFTUP.mjs → share-Dj-MNXrw.mjs} +4 -4
  172. package/dist/shared-BJvq4DkR.mjs +290 -0
  173. package/dist/smart-shield--8EpJjrF.mjs +4 -0
  174. package/dist/snippets-Dyz0PH60.mjs +4 -0
  175. package/dist/{spawn-CHkoow5W.mjs → spawn-C5Z7oWdp.mjs} +108 -112
  176. package/dist/{spectrum-BA0a42eM.mjs → spectrum-rAHWz8rH.mjs} +1 -1
  177. package/dist/{speed-mmOjxOzo.mjs → speed-BKepWBXj.mjs} +1 -1
  178. package/dist/src-gJma71Ec.mjs +108 -0
  179. package/dist/{ssl-Yr6kELqg.mjs → ssl-KdFiY3ev.mjs} +1 -1
  180. package/dist/startup-profile-GLNPHQ9U.mjs +17 -0
  181. package/dist/{state-DZC531l2.mjs → state-Cu3cItUg.mjs} +1 -1
  182. package/dist/{stream-Cu0kYWbc.mjs → stream-CKJ6Tb0M.mjs} +13 -13
  183. package/dist/submit-BxbKKhBn.mjs +2 -0
  184. package/dist/tags-DA8dq9fx.mjs +2 -0
  185. package/dist/tenant-DLXw48hS.mjs +2 -0
  186. package/dist/tenant-custom-nameservers-9G93XuvU.mjs +3 -0
  187. package/dist/{tools-D2Xxfkrc.mjs → tools-x8bj9E6b.mjs} +1 -1
  188. package/dist/{tunnel-CDYkWjnt.mjs → tunnel-CNQA5Flp.mjs} +1 -1
  189. package/dist/tunnels-CC10EOsU.mjs +2 -0
  190. package/dist/turnstile-CH58hnf4.mjs +23 -0
  191. package/dist/{ui-DIpjthrV.mjs → ui-CmnnBm_O.mjs} +1 -1
  192. package/dist/url-info-BpCgdUtL.mjs +2 -0
  193. package/dist/{url-normalization-BeKkOZz7.mjs → url-normalization-BzuynEy1.mjs} +1 -1
  194. package/dist/url-scanner-APIZbhB7.mjs +2 -0
  195. package/dist/user-2-NGebfI.mjs +12 -0
  196. package/dist/values-S_bNv819.mjs +2 -0
  197. package/dist/{vectorize-CjXfiFH4.mjs → vectorize-Bv7feLBC.mjs} +1 -1
  198. package/dist/waiting-rooms-Dk4LIpvm.mjs +11 -0
  199. package/dist/{web-assets-BzM5vVzy.mjs → web-assets-C1UmOyzD.mjs} +1 -1
  200. package/dist/web3-GnUocVYH.mjs +4 -0
  201. package/dist/workers-J1-PLwdl.mjs +28 -0
  202. package/dist/{workers-builds-B44wc67O.mjs → workers-builds-DCHmWOMS.mjs} +4 -4
  203. package/dist/{workflows-rFuQWClt.mjs → workflows-CArfEI2c.mjs} +2 -2
  204. package/dist/zaraz-mg2YlR3_.mjs +2 -0
  205. package/dist/zero-trust-DVdUPtj1.mjs +93 -0
  206. package/dist/zone-DMAfrDJX.mjs +2 -0
  207. package/dist/zones-CNwxUi7I.mjs +21 -0
  208. package/package.json +10 -7
  209. package/dist/abuse-reports-CzDAjFpo.mjs +0 -8
  210. package/dist/account-Dd4-tDYJ.mjs +0 -2
  211. package/dist/account-tags-65fAlHrf.mjs +0 -9
  212. package/dist/accounts-Bp5KGc6r.mjs +0 -28
  213. package/dist/agent-memory-D--BQS0W.mjs +0 -6
  214. package/dist/ai-BnVlQDiI.mjs +0 -5
  215. package/dist/ai-audit-CfpDKXkD.mjs +0 -2
  216. package/dist/ai-gateway-oG4j_oYN.mjs +0 -13
  217. package/dist/ai-search-B2l3B_jn.mjs +0 -7
  218. package/dist/ai-security-byjIIrfl.mjs +0 -4
  219. package/dist/analytics-DeIKjC9n.mjs +0 -3
  220. package/dist/analytics_engine-BnECMIWJ.mjs +0 -2
  221. package/dist/argo-DFerMyXF.mjs +0 -2
  222. package/dist/artifacts-CtyEYYDa.mjs +0 -4
  223. package/dist/audit-logs-retFtvow.mjs +0 -2
  224. package/dist/auth-aazs91XL.mjs +0 -5
  225. package/dist/billing-CxQVqpGZ.mjs +0 -3
  226. package/dist/body-parser-CYD7PKFC.mjs +0 -2
  227. package/dist/bot-management-Rli7v7tg.mjs +0 -5
  228. package/dist/botnet-feed-Cw6XSEf8.mjs +0 -3
  229. package/dist/brand-protection-CTvnHGfV.mjs +0 -3
  230. package/dist/browser-run-FwtwnBzA.mjs +0 -4
  231. package/dist/build-Dji9BYmV.mjs +0 -2
  232. package/dist/certificate-authorities-DZP1RzAs.mjs +0 -2
  233. package/dist/cf-oSz9pud_.mjs +0 -18
  234. package/dist/chunk-LQW53VED-Xakf_rUn.mjs +0 -499
  235. package/dist/cloud-connector-BpVcvhjZ.mjs +0 -2
  236. package/dist/cloudforce-one-2PecncfX.mjs +0 -30
  237. package/dist/connector-interrupts-ollUcksZ.mjs +0 -2
  238. package/dist/connector-telemetry-events-D5_3X7XW.mjs +0 -2
  239. package/dist/connector-telemetry-snapshots-CJ9gLRFR.mjs +0 -2
  240. package/dist/containers-Bog7j0Hw.mjs +0 -54
  241. package/dist/custom-certificates-4y35UC1X.mjs +0 -5
  242. package/dist/custom-csrs-DwBrLh-H.mjs +0 -4
  243. package/dist/custom-hostnames-CDIAnsRa.mjs +0 -5
  244. package/dist/custom-nameservers-stk7ymnP.mjs +0 -3
  245. package/dist/custom-pages-vfDxrXbt.mjs +0 -4
  246. package/dist/d1-Cllm-iTT.mjs +0 -20
  247. package/dist/data-security-rnoSCEdL.mjs +0 -7
  248. package/dist/dcv-delegation-DCRCOL6l.mjs +0 -2
  249. package/dist/deploy-input-DhCo1I0I.mjs +0 -242
  250. package/dist/diagnostics-D5Yo2xqx.mjs +0 -3
  251. package/dist/dist-COfwjT96.mjs +0 -72
  252. package/dist/dns-DdQYtenF.mjs +0 -29
  253. package/dist/durable-objects-BvxXBht_.mjs +0 -2
  254. package/dist/email-CGOC_evd.mjs +0 -2
  255. package/dist/email-auth-DFvXKSkg.mjs +0 -2
  256. package/dist/email-routing-QBRPBlyl.mjs +0 -6
  257. package/dist/email-security-BFagcRPP.mjs +0 -18
  258. package/dist/email-sending-Ddhe7xjN.mjs +0 -7
  259. package/dist/filters-CGisPGD1.mjs +0 -4
  260. package/dist/firewall-DD8U-Brd.mjs +0 -11
  261. package/dist/flagship-FJHc4mFi.mjs +0 -4
  262. package/dist/google-tag-gateway-149kbuG_.mjs +0 -2
  263. package/dist/iam-BhHYhMXO.mjs +0 -6
  264. package/dist/images-CDViyKtZ.mjs +0 -8
  265. package/dist/intel-YHZbPlS3.mjs +0 -8
  266. package/dist/ips-BpCdldFx.mjs +0 -2
  267. package/dist/keys-yYtv7Ztr.mjs +0 -2
  268. package/dist/load-balancers-jRCN75mX.mjs +0 -7
  269. package/dist/logexplorer-kO8CULiK.mjs +0 -24
  270. package/dist/logo-matches-LyDAYPbI.mjs +0 -2
  271. package/dist/logos-O9f5bGSB.mjs +0 -3
  272. package/dist/logpush-dtXLu3Ck.mjs +0 -5
  273. package/dist/magic-network-monitoring-CpfkgZMp.mjs +0 -4
  274. package/dist/magic-transit-DwgZeIj-.mjs +0 -111
  275. package/dist/managed-transforms-DCmogkxv.mjs +0 -3
  276. package/dist/matches-BAeN8VM1.mjs +0 -2
  277. package/dist/mcp-DKZ2D050.mjs +0 -4
  278. package/dist/media-CnxgOViL.mjs +0 -2
  279. package/dist/mesh-CzIPtuaM.mjs +0 -4
  280. package/dist/mtls-certificates-Bbm_1lQI.mjs +0 -3
  281. package/dist/oauth-BPizUUqP.mjs +0 -15
  282. package/dist/oauth-scopes-CmbgsPYd.mjs +0 -2
  283. package/dist/observability-DXYgDdU5.mjs +0 -4
  284. package/dist/organizations-eNzfOwlP.mjs +0 -2
  285. package/dist/origin-ca-certificates-DaiAmw45.mjs +0 -3
  286. package/dist/origin-post-quantum-encryption-7YztBged.mjs +0 -2
  287. package/dist/origin-tls-client-auth-DRwURM8s.mjs +0 -4
  288. package/dist/page-rules-B2Csdc4h.mjs +0 -18
  289. package/dist/pages-BAL6Q7OY.mjs +0 -14
  290. package/dist/pay-per-crawl-C-1-ZAtn.mjs +0 -4
  291. package/dist/pipelines-cyQOuFLb.mjs +0 -6
  292. package/dist/precursor-BrweY39h.mjs +0 -4
  293. package/dist/progress-B84wYh91.mjs +0 -2
  294. package/dist/prompt-CDtLWxNv.mjs +0 -3
  295. package/dist/queries-oM8uGZy5.mjs +0 -3
  296. package/dist/queues-CTx04ZNw.mjs +0 -6
  297. package/dist/r2-CnlIUn7R.mjs +0 -24
  298. package/dist/radar-CGNgGh8v.mjs +0 -2
  299. package/dist/raw-fetch-Dz-QBoP_.mjs +0 -2
  300. package/dist/realtimekit-BPwzhNS9.mjs +0 -7
  301. package/dist/registrar-BEcb90RX.mjs +0 -21
  302. package/dist/reporting-CLbjHlnw.mjs +0 -2
  303. package/dist/request-tracers-BcKpofP1.mjs +0 -2
  304. package/dist/resource-tagging-DGEyVTDN.mjs +0 -2
  305. package/dist/rules-CmuB5rIN.mjs +0 -4
  306. package/dist/rulesets-CGaMq8vG.mjs +0 -8
  307. package/dist/rum-QT6EP4JK.mjs +0 -4
  308. package/dist/schema-flags-DHryz6SF.mjs +0 -5
  309. package/dist/sdk-m4xeaua4.mjs +0 -3
  310. package/dist/security-center-BNm4uPVB.mjs +0 -2
  311. package/dist/session-Ckt20hHa.mjs +0 -2
  312. package/dist/shared-BzPQog8H.mjs +0 -2
  313. package/dist/smart-shield-SODkOUyO.mjs +0 -4
  314. package/dist/snippets-B5jY8v_7.mjs +0 -4
  315. package/dist/src-CHW7s5IS.mjs +0 -108
  316. package/dist/submit-Dl_27e0n.mjs +0 -2
  317. package/dist/tags-Cdo_Pwtr.mjs +0 -2
  318. package/dist/tenant-EX-ANl6X.mjs +0 -2
  319. package/dist/tenant-custom-nameservers-BPHUeckw.mjs +0 -3
  320. package/dist/triggers-Bf9hbP3h.mjs +0 -2
  321. package/dist/tunnels-CgyX8R2J.mjs +0 -2
  322. package/dist/turnstile-BUtzlW-0.mjs +0 -23
  323. package/dist/url-info-CJsa1Oc9.mjs +0 -2
  324. package/dist/url-scanner-Cz-yl0_3.mjs +0 -2
  325. package/dist/user-BxHjEqpd.mjs +0 -12
  326. package/dist/values-C43NurfT.mjs +0 -2
  327. package/dist/versions-BFbc90Wu.mjs +0 -2
  328. package/dist/waiting-rooms-C5jSQv_r.mjs +0 -11
  329. package/dist/web3-Ctv9HGiR.mjs +0 -4
  330. package/dist/workers-D-YbIedB.mjs +0 -24
  331. package/dist/zaraz-BA6kY-b6.mjs +0 -2
  332. package/dist/zero-trust-DOFLlUz1.mjs +0 -102
  333. package/dist/zone-B_rgejLV.mjs +0 -2
  334. package/dist/zone-tags-BWdza4rH.mjs +0 -9
  335. package/dist/zones-DTWO7Vvn.mjs +0 -21
  336. /package/dist/{Page-C-JHZnIy.mjs → Page-9ry_XAVC.mjs} +0 -0
  337. /package/dist/{alerts-B85uj2Vx.mjs → alerts-15-IW4jE.mjs} +0 -0
  338. /package/dist/{autorag-Do9l_LyY.mjs → autorag-CFwRkEKw.mjs} +0 -0
  339. /package/dist/{brands-DateHCdd.mjs → brands-BgT1vu9B.mjs} +0 -0
  340. /package/dist/{chunk-6EUZQHAF-l8tR2Qyj.mjs → chunk-6EUZQHAF-C3w62dek.mjs} +0 -0
  341. /package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-DVMMVVEs.mjs} +0 -0
  342. /package/dist/{clear-CB2kgcEB.mjs → clear-BlCK85Me.mjs} +0 -0
  343. /package/dist/{cli-types-BWdZbsFE.mjs → cli-types-DAYeL_Mj.mjs} +0 -0
  344. /package/dist/{domain-info-DJHEt8JJ.mjs → domain-info-C7LBxPBt.mjs} +0 -0
  345. /package/dist/{health-buY5f5pp.mjs → health-DZFfafkX.mjs} +0 -0
  346. /package/dist/{input-validation-BBKJRoRB.mjs → input-validation-QDIYu7Vb.mjs} +0 -0
  347. /package/dist/{internal-CwyoJUHh.mjs → internal-BKHC2D1Y.mjs} +0 -0
  348. /package/dist/{live-wEpA5V_n.mjs → live-DwCvDmaH.mjs} +0 -0
  349. /package/dist/{metadata-8AkOftcB.mjs → metadata-B5yfL0ln.mjs} +0 -0
  350. /package/dist/{rate-limit-analytics-Bf1uT0lT.mjs → rate-limit-analytics-B8Vuu1sU.mjs} +0 -0
  351. /package/dist/{ready-CBSCPiHE.mjs → ready-D9H2zHHI.mjs} +0 -0
  352. /package/dist/{recent-submissions-Dpmq1f7z.mjs → recent-submissions-BPo0J80d.mjs} +0 -0
  353. /package/dist/{refute-u7ZPQJZy.mjs → refute-2W8NLCN4.mjs} +0 -0
  354. /package/dist/{resolve-XgxRJ-Ys.mjs → resolve-B8CyM1mi.mjs} +0 -0
  355. /package/dist/{scan-logo-Ba8WZAyp.mjs → scan-logo-D5x6F1Y0.mjs} +0 -0
  356. /package/dist/{scan-page-Bcq3Ei86.mjs → scan-page-CWhta3x7.mjs} +0 -0
  357. /package/dist/{search-D9WDwnV4.mjs → search-DZmBQJL9.mjs} +0 -0
  358. /package/dist/{signed-url-CjPbG5zV.mjs → signed-url-CQrmWgz5.mjs} +0 -0
  359. /package/dist/{submission-info-Z9hhp9Rq.mjs → submission-info-C98A0bqq.mjs} +0 -0
  360. /package/dist/{theme-BePJemMn.mjs → theme-CrIBazAF.mjs} +0 -0
  361. /package/dist/{total-queries-aKAYX1iX.mjs → total-queries-BZoaFoDE.mjs} +0 -0
  362. /package/dist/{tracked-domains-Ck7Jm4Kn.mjs → tracked-domains-CNHogPHx.mjs} +0 -0
  363. /package/dist/{verify-2yi0H93r.mjs → verify-4e4L9IRk.mjs} +0 -0
package/dist/config.d.mts CHANGED
@@ -1,1645 +1,1757 @@
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.12.0/node_modules/@cloudflare/config/dist/public-CxIWEZqM.d.mts
5
+ //#region src/inference.d.ts
6
6
  /**
7
- * Represents any valid JSON value.
7
+ * The Worker's entry module, imported with the `{ type: "cf-worker" }` import attribute
8
+ * @example
9
+ * ```ts
10
+ * import * as entrypoint from "./src" with { type: "cf-worker" };
11
+ * ```
8
12
  */
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
- }
13
+ type WorkerModule = Record<string, any>;
24
14
  /**
25
- * Agent Memory namespace binding. Each binding is scoped to a namespace and
26
- * allows agents to persist and recall memory.
15
+ * Default module type representing an unknown Worker's exports.
16
+ * - default export can be `ExportedHandler` or a `WorkerEntrypoint` class constructor
17
+ * - named exports can be `WorkerEntrypoint`, `DurableObject`, or `WorkflowEntrypoint` class constructors
27
18
  */
28
- interface AgentMemoryBinding extends AgentMemoryBindingOptions {
29
- type: "agent-memory";
30
- }
31
- interface AiBindingOptions {
32
- /** Options that only apply during local development. */
33
- dev?: BindingDevOptions;
19
+ interface DefaultModule {
20
+ default?: ExportedHandler | Constructor<Rpc.WorkerEntrypointBranded>;
21
+ [key: string]: ExportedHandler | Constructor<Rpc.WorkerEntrypointBranded> | Constructor<Rpc.DurableObjectBranded> | Constructor<Rpc.WorkflowEntrypointBranded> | undefined;
34
22
  }
35
23
  /**
36
- * Binding to the Workers AI project.
37
- *
38
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
24
+ * Represents a class constructor that creates instances of TInstance.
39
25
  */
40
- interface AiBinding extends AiBindingOptions {
41
- type: "ai";
42
- }
26
+ type Constructor<TInstance> = new (...args: any[]) => TInstance;
43
27
  /**
44
- * Binding to the Workers AI project.
45
- *
46
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
28
+ * Extracts the instance type from a class constructor if it extends `TInstance`.
47
29
  */
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;
57
- }
30
+ type ExtractInstance<T$1, TInstance> = T$1 extends Constructor<TInstance> ? InstanceType<T$1> : never;
58
31
  /**
59
- * AI Search instance binding. Each binding is bound directly to a single
60
- * pre-existing instance within the "default" namespace.
32
+ * Mapping from binding type literals to Cloudflare runtime types.
33
+ *
34
+ * Entries fall into two groups:
35
+ * - Parameterized bindings (ai, json, kv, pipeline, queue, text) refine their
36
+ * runtime type from the binding instance via nominal matches against the
37
+ * `Typed*Binding` / `JsonBinding` / `TextBinding` interfaces from
38
+ * `./bindings`. When `TBinding` does not match, the entry falls back to the
39
+ * unparameterized runtime type.
40
+ * - Non-parameterized bindings map their type literal directly to a runtime
41
+ * type and ignore `TBinding`.
42
+ *
43
+ * IMPORTANT: The right-hand-side identifiers in this map (e.g. `KVNamespace`,
44
+ * `ImagesBinding`, `Fetcher`) must resolve to the ambient runtime types from
45
+ * `@cloudflare/workers-types`, not to local config interfaces. Several local
46
+ * binding interfaces in `./bindings.ts` (`ImagesBinding`, `MediaBinding`,
47
+ * `StreamBinding`) share names with ambient globals — importing those local
48
+ * types into this file silently shadows the globals and breaks `InferEnv`.
49
+ * Only import the `Typed*Binding`, `JsonBinding`, and `TextBinding` interfaces
50
+ * from `./bindings` (their names do not collide with ambient globals); never
51
+ * widen the import to a wildcard or to the plain `*Binding` interfaces.
61
52
  */
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;
53
+ interface BindingTypeMap<TBinding> {
54
+ ai: TBinding extends TypedAiBinding<infer T> ? Ai<T> : Ai;
55
+ json: TBinding extends JsonBinding<infer T> ? T : never;
56
+ kv: TBinding extends TypedKvBinding<infer T> ? KVNamespace<T> : KVNamespace;
57
+ pipeline: TBinding extends TypedPipelineBinding<infer T> ? Pipeline<T> : Pipeline;
58
+ queue: TBinding extends TypedQueueBinding<infer T> ? Queue<T> : Queue;
59
+ text: TBinding extends TextBinding<infer T> ? T : never;
60
+ "agent-memory": AgentMemoryNamespace;
61
+ "ai-search": AiSearchInstance;
62
+ "ai-search-namespace": AiSearchNamespace;
63
+ "analytics-engine-dataset": AnalyticsEngineDataset;
64
+ artifacts: Artifacts;
65
+ assets: Fetcher;
66
+ browser: BrowserRun;
67
+ d1: D1Database;
68
+ "dispatch-namespace": DispatchNamespace;
69
+ "durable-object": DurableObjectNamespace;
70
+ flagship: Flagship;
71
+ hyperdrive: Hyperdrive;
72
+ images: ImagesBinding;
73
+ logfwdr: any;
74
+ media: MediaBinding;
75
+ "mtls-certificate": Fetcher;
76
+ "rate-limit": RateLimit;
77
+ r2: R2Bucket;
78
+ secret: string;
79
+ "secrets-store-secret": SecretsStoreSecret;
80
+ "send-email": SendEmail;
81
+ stream: StreamBinding;
82
+ vectorize: VectorizeIndex;
83
+ "version-metadata": WorkerVersionMetadata;
84
+ "vpc-service": Fetcher;
85
+ "vpc-network": Fetcher;
86
+ "web-search": WebSearch;
87
+ worker: Fetcher;
88
+ "worker-loader": WorkerLoader;
89
+ workflow: Workflow;
70
90
  }
91
+ type SelectedWorkerExportName<TBinding> = TBinding extends {
92
+ exportName?: infer TExportName;
93
+ } ? TExportName extends string ? TExportName : "default" : "default";
94
+ type InferBindingType<TBinding> = TBinding extends {
95
+ type: "worker";
96
+ worker: infer TWorker extends WorkerReference;
97
+ } ? 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 {
98
+ type: "durable-object";
99
+ worker: infer TWorker extends WorkerReference;
100
+ exportName: infer TExportName extends string;
101
+ } ? 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 {
102
+ type: "workflow";
103
+ worker: infer TWorker extends WorkerReference;
104
+ exportName: infer TExportName extends string;
105
+ } ? 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 {
106
+ run(event: {
107
+ payload: infer P;
108
+ }, step: any): any;
109
+ } ? Workflow<P> : Workflow : Workflow : never : never : TBinding extends {
110
+ type: `unsafe:${string}`;
111
+ } ? any : TBinding extends {
112
+ type: infer K extends keyof BindingTypeMap<TBinding>;
113
+ } ? BindingTypeMap<TBinding>[K] : never;
71
114
  /**
72
- * AI Search namespace binding. Each binding is scoped to a namespace and
73
- * allows dynamic instance CRUD within it.
115
+ * Infer export names from a config's exports, optionally filtered by type.
116
+ * When TExportType is `string` (default), returns all export names.
117
+ * When TExportType is a specific literal like `"durable-object"` or `"workflow"`,
118
+ * returns only exports of that type.
74
119
  */
75
- interface AiSearchNamespaceBinding extends AiSearchNamespaceBindingOptions {
76
- type: "ai-search-namespace";
77
- }
78
- interface AnalyticsEngineDatasetBindingOptions {
79
- /** The name of this dataset to write to. */
80
- name?: string;
81
- }
120
+ type InferExportsByType<TUnwrappedConfig, TExportType extends string = string> = TUnwrappedConfig extends {
121
+ exports: infer TExports extends Record<string, {
122
+ type: string;
123
+ }>;
124
+ } ? { [K in keyof TExports]: TExports[K] extends {
125
+ type: TExportType;
126
+ } ? K & string : never }[keyof TExports] : never;
82
127
  /**
83
- * Binding to an Analytics Engine dataset.
84
- *
85
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
128
+ * Infer `WorkerEntrypoint` export names from a config.
129
+ * Returns named module exports that are not declared as type `"durable-object"` or `"workflow"` in `exports`.
130
+ * Excludes `"default"` since `exportName` should only be provided for named exports.
86
131
  */
87
- interface AnalyticsEngineDatasetBinding extends AnalyticsEngineDatasetBindingOptions {
88
- type: "analytics-engine-dataset";
89
- }
90
- interface ArtifactsBindingOptions {
91
- /** The namespace to use. */
92
- namespace: string;
93
- /** Options that only apply during local development. */
94
- dev?: BindingDevOptions;
95
- }
132
+ type InferWorkerEntrypointExports<TUnwrappedConfig> = Exclude<keyof InferMainModule<TUnwrappedConfig> & string, "default" | InferExportsByType<TUnwrappedConfig, "durable-object" | "workflow">>;
96
133
  /**
97
- * Binding to an Artifacts instance. Artifacts provides git-compatible file
98
- * storage on Cloudflare Workers.
134
+ * Unwrap function and promise types to get the underlying config.
135
+ * Use this to normalize a config before passing it to other inference utilities.
99
136
  */
100
- interface ArtifactsBinding extends ArtifactsBindingOptions {
101
- type: "artifacts";
102
- }
137
+ type UnwrapConfig<TConfig$1> = TConfig$1 extends ((...args: any[]) => infer TReturn) ? UnwrapConfig<TReturn> : TConfig$1 extends Promise<infer TCompletion> ? UnwrapConfig<TCompletion> : TConfig$1;
103
138
  /**
104
- * Binding to the Worker's static assets.
139
+ * Infer the `Env` interface type from a Worker config.
105
140
  *
106
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
107
- */
108
- interface AssetsBinding {
109
- type: "assets";
110
- }
111
- interface BrowserBindingOptions {
112
- /** Options that only apply during local development. */
113
- dev?: BindingDevOptions;
114
- }
115
- /**
116
- * Binding to a headless browser usable from the Worker.
141
+ * Transforms a config object's `env` bindings into their
142
+ * corresponding Cloudflare runtime types.
117
143
  *
118
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
119
- */
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
- }
131
- /**
132
- * Binding to a D1 database.
144
+ * @example
145
+ * ```typescript
146
+ * import { defineWorker, bindings } from "@cloudflare/config";
147
+ * import type { InferEnv, UnwrapConfig } from "@cloudflare/config";
133
148
  *
134
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
135
- */
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
- }
150
- /**
151
- * Binding to a Workers for Platforms dispatch namespace.
149
+ * const config = defineWorker({
150
+ * env: {
151
+ * MY_JSON: bindings.json({ id: string }),
152
+ * MY_KV: bindings.kv(),
153
+ * },
154
+ * });
152
155
  *
153
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
156
+ * type WorkerConfig = UnwrapConfig<typeof config>;
157
+ * // Inferred as: { MY_JSON: { id: string }; MY_KV: KVNamespace }
158
+ * export type Env = InferEnv<WorkerConfig>;
159
+ * ```
154
160
  */
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;
163
- }
161
+ type InferEnv<TUnwrappedConfig> = TUnwrappedConfig extends {
162
+ env: infer TEnv extends Record<string, any>;
163
+ } ? { [K in keyof TEnv]: InferBindingType<TEnv[K]> } : never;
164
164
  /**
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.
165
+ * Infer the Durable Object namespace names from a Worker config's exports.
166
+ * Returns a union of export names that declare a *live* Durable Object —
167
+ * `type: "durable-object"` with `state` either omitted, `"created"`, or
168
+ * `"expecting-transfer"`. Tombstone entries (`deleted`, `renamed`,
169
+ * `transferred`) are excluded because they retire the namespace and a
170
+ * binding to a tombstoned class would fail at deploy time.
167
171
  *
168
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
172
+ * @example
173
+ * ```typescript
174
+ * import { defineWorker } from "@cloudflare/config";
175
+ * import type { InferDurableNamespaces, UnwrapConfig } from "@cloudflare/config";
176
+ *
177
+ * const config = defineWorker({
178
+ * exports: {
179
+ * MyDurableObject: { type: "durable-object", storage: "sqlite" },
180
+ * OldGone: { type: "durable-object", state: "deleted" },
181
+ * },
182
+ * });
183
+ *
184
+ * type WorkerConfig = UnwrapConfig<typeof config>;
185
+ * // Inferred as: "MyDurableObject" (the deleted tombstone is excluded)
186
+ * type DurableNamespaces = InferDurableNamespaces<WorkerConfig>;
187
+ * ```
169
188
  */
170
- interface DurableObjectBinding extends DurableObjectBindingOptions {
189
+ type InferDurableNamespaces<TUnwrappedConfig> = TUnwrappedConfig extends {
190
+ exports: infer TExports extends Record<string, {
191
+ type: string;
192
+ }>;
193
+ } ? { [K in keyof TExports]: TExports[K] extends {
171
194
  type: "durable-object";
172
- }
195
+ } ? TExports[K] extends {
196
+ state: "deleted" | "renamed" | "transferred";
197
+ } ? never : K & string : never }[keyof TExports] : never;
173
198
  /**
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
199
+ * Infer the main module type from a Worker config's entrypoint.
200
+ * If entrypoint is a module namespace object, returns that type.
201
+ * If entrypoint is a `string` or not present, returns `DefaultModule` as a fallback.
178
202
  */
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
- }
203
+ type InferMainModule<TUnwrappedConfig> = TUnwrappedConfig extends {
204
+ entrypoint: infer TModule extends WorkerModule;
205
+ } ? TModule : DefaultModule; //#endregion
206
+ //#region src/utils.d.ts
203
207
  /**
204
- * Binding to a Hyperdrive configuration.
205
- *
206
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
208
+ * Represents any valid JSON value.
207
209
  */
208
- interface HyperdriveBinding extends HyperdriveBindingOptions {
209
- type: "hyperdrive";
210
- }
211
- interface ImagesBindingOptions {
212
- /** Options that only apply during local development. */
213
- dev?: BindingDevOptions;
210
+ type Json = string | number | boolean | null | Json[] | {
211
+ [key: string]: Json;
212
+ }; //#endregion
213
+ //#region src/definition.d.ts
214
+ interface ConfigContext {
215
+ /**
216
+ * The mode the config is being evaluated in.
217
+ * Set via the `--mode` CLI flag.
218
+ * 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)).
219
+ * In Wrangler the mode defaults to `undefined`.
220
+ */
221
+ mode: string | undefined;
214
222
  }
215
223
  /**
216
- * Binding to Cloudflare Images.
217
- *
218
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
224
+ * The authored config in any of its supported shapes: a plain value, a promise,
225
+ * or a function of {@link ConfigContext}.
219
226
  */
220
- interface ImagesBinding$1 extends ImagesBindingOptions {
221
- type: "images";
222
- }
227
+ type ConfigInput<T$1> = T$1 | Promise<T$1> | ((ctx: ConfigContext) => T$1 | Promise<T$1>);
228
+ type ConfigObject = Record<string, unknown>;
229
+ type ConfigWithType<T$1 extends ConfigObject, TType extends string> = T$1 & {
230
+ type: TType;
231
+ }; //#endregion
232
+ //#region src/container-definition.d.ts
233
+ type ContainerConfigExport<T$1 extends ContainerConfig = ContainerConfig> = ConfigInput<T$1>;
234
+ type DistributiveOmit<T$1, K$1 extends PropertyKey> = T$1 extends unknown ? Omit<T$1, K$1> : never;
235
+ /**
236
+ * Authored Container config shape — {@link ContainerConfig} without the `type`
237
+ * discriminant, which `defineContainer` injects.
238
+ */
239
+ type ContainerConfigInput = DistributiveOmit<ContainerConfig, "type">;
240
+ /** Declare a Container application. */
241
+ declare const defineContainer: <const TInput extends ConfigInput<ContainerConfigInput>>(config: TInput) => TInput extends ((ctx: ConfigContext) => infer TResult) ? (ctx: ConfigContext) => TResult extends Promise<infer TConfig extends {
242
+ [x: string]: unknown;
243
+ }> ? Promise<ConfigWithType<TConfig, "container">> : TResult extends {
244
+ [x: string]: unknown;
245
+ } ? ConfigWithType<TResult, "container"> : never : TInput extends Promise<infer TConfig extends {
246
+ [x: string]: unknown;
247
+ }> ? Promise<ConfigWithType<TConfig, "container">> : TInput extends {
248
+ [x: string]: unknown;
249
+ } ? ConfigWithType<TInput, "container"> : never; //#endregion
250
+ //#region src/exports.d.ts
223
251
  /**
224
- * Inline JSON value made available to the Worker on `env` under the
225
- * binding name.
252
+ * Storage backend for the Durable Object.
253
+ *
254
+ * Containers are only supported on the SQLite storage engine, so `container` is
255
+ * only offered alongside `storage: "sqlite"`.
226
256
  */
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
- }
257
+ type DurableObjectStorageOptions<TContainer extends ContainerConfigExport | undefined = ContainerConfigExport | undefined> = {
258
+ /**
259
+ * Selects the SQLite-backed storage engine (recommended for new
260
+ * classes).
261
+ */
262
+ storage: "sqlite";
263
+ /**
264
+ * Attach a Container application to this Durable Object by config reference.
265
+ */
266
+ container?: TContainer;
267
+ } | {
268
+ /** Selects the legacy key-value storage engine. */storage: "legacy-kv";
269
+ };
238
270
  /**
239
- * Binding to a Workers KV namespace.
271
+ * Declares a provisioned Durable Object class exported from this Worker.
240
272
  *
241
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
273
+ * For more information about Durable Objects, see the documentation at
274
+ * https://developers.cloudflare.com/workers/learning/using-durable-objects
275
+ *
276
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
242
277
  */
243
- interface KvBinding extends KvBindingOptions {
244
- type: "kv";
245
- }
278
+ type DurableObjectCreatedExportOptions<TContainer extends ContainerConfigExport | undefined = ContainerConfigExport | undefined> = {
279
+ state?: "created";
280
+ } & DurableObjectStorageOptions<TContainer>;
246
281
  /**
247
- * Binding to a Workers KV namespace.
282
+ * Retire a provisioned Durable Object namespace whose class has
283
+ * been removed from code.
248
284
  *
249
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
285
+ * During deploy, the class must not be exported in the uploaded code, and no
286
+ * other Worker may hold a `durableObject` binding to the namespace.
250
287
  */
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;
288
+ interface DurableObjectDeletedExportOptions {
289
+ state: "deleted";
276
290
  }
277
291
  /**
278
- * Binding to an uploaded mTLS certificate.
279
- *
280
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
292
+ * Rename a provisioned Durable Object namespace's class. The
293
+ * `renamedTo` value must also appear as a live (`state: "created"`)
294
+ * `durableObject` entry in the same `exports` map.
281
295
  */
282
- interface MtlsCertificateBinding extends MtlsCertificateBindingOptions {
283
- type: "mtls-certificate";
284
- }
285
- interface PipelineBindingOptions {
286
- /** Name of the Pipeline to bind. */
287
- 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;
296
+ interface DurableObjectRenamedExportOptions {
297
+ state: "renamed";
298
+ /**
299
+ * The destination class name. Must be a valid JavaScript identifier and
300
+ * must appear as a live (`state: "created"`) `durableObject` entry in the
301
+ * same `exports` map.
302
+ */
303
+ renamedTo: string;
307
304
  }
308
305
  /**
309
- * Producer binding to a Cloudflare Queue.
310
- *
311
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
306
+ * Transfer ownership of a Durable Object namespace to another Worker in the same account.
307
+ * The target Worker must first deploy an `expectingTransfer` entry naming this Worker via `transferFrom`.
312
308
  */
313
- interface QueueBinding extends QueueBindingOptions {
314
- type: "queue";
309
+ interface DurableObjectTransferredExportOptions {
310
+ state: "transferred";
311
+ /**
312
+ * The destination Worker. Must reference a Worker in the same account.
313
+ */
314
+ transferredTo: string;
315
315
  }
316
316
  /**
317
- * Producer binding to a Cloudflare Queue.
318
- *
319
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
317
+ * Prepare to receive cross-Worker Durable Object transfer.
318
+ * Once the source Worker's `transferred` export is deployed, this entry becomes a normal live `durable-object` export.
320
319
  */
321
- interface TypedQueueBinding<TBody = unknown> extends QueueBinding {
322
- /** @internal Carries type parameters for inference */
323
- __typeParams: [TBody];
320
+ type DurableObjectExpectingTransferExportOptions<TContainer extends ContainerConfigExport | undefined = ContainerConfigExport | undefined> = {
321
+ state: "expecting-transfer";
322
+ /**
323
+ * The source Worker for the two-phase cross-Worker transfer.
324
+ */
325
+ transferFrom: string;
326
+ } & DurableObjectStorageOptions<TContainer>;
327
+ type DurableObjectCreatedExport<TContainer extends ContainerConfigExport | undefined = ContainerConfigExport | undefined> = DurableObjectCreatedExportOptions<TContainer> & {
328
+ type: "durable-object";
329
+ };
330
+ interface DurableObjectDeletedExport extends DurableObjectDeletedExportOptions {
331
+ type: "durable-object";
324
332
  }
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
- };
333
+ interface DurableObjectRenamedExport extends DurableObjectRenamedExportOptions {
334
+ type: "durable-object";
335
+ }
336
+ interface DurableObjectTransferredExport extends DurableObjectTransferredExportOptions {
337
+ type: "durable-object";
338
+ }
339
+ type DurableObjectExpectingTransferExport<TContainer extends ContainerConfigExport | undefined = ContainerConfigExport | undefined> = DurableObjectExpectingTransferExportOptions<TContainer> & {
340
+ type: "durable-object";
341
+ };
342
+ type DurableObjectExportOptions = DurableObjectCreatedExportOptions | DurableObjectDeletedExportOptions | DurableObjectRenamedExportOptions | DurableObjectTransferredExportOptions | DurableObjectExpectingTransferExportOptions;
343
+ type DurableObjectExports = DurableObjectCreatedExport | DurableObjectDeletedExport | DurableObjectRenamedExport | DurableObjectTransferredExport | DurableObjectExpectingTransferExport;
344
+ interface WorkerEntrypointExportOptions {
345
+ cache?: {
346
+ /** Whether cache is enabled for this entrypoint. */enabled: boolean;
336
347
  };
337
348
  }
349
+ interface WorkerEntrypointExport extends WorkerEntrypointExportOptions {
350
+ type: "worker";
351
+ }
338
352
  /**
339
- * Binding to an R2 bucket.
340
- *
341
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
353
+ * Configuration for named exports declared by the Worker. Each entry's
354
+ * key is the exported class name; the value configures the export.
342
355
  */
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
- };
354
- }
355
- /** Binding to a rate limiter. */
356
- interface RateLimitBinding extends RateLimitBindingOptions {
357
- type: "rate-limit";
356
+ interface Exports {
357
+ /**
358
+ * Declares a Durable Object class defined by this Worker.
359
+ *
360
+ * For more information about Durable Objects, see the documentation at
361
+ * https://developers.cloudflare.com/workers/learning/using-durable-objects
362
+ *
363
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
364
+ */
365
+ durableObject<TContainer extends ContainerConfigExport | undefined = undefined>(options: DurableObjectCreatedExportOptions<TContainer>): DurableObjectCreatedExport<TContainer>;
366
+ /**
367
+ * Retire a provisioned Durable Object namespace whose class has been removed from code.
368
+ */
369
+ durableObject(options: DurableObjectDeletedExportOptions): DurableObjectDeletedExport;
370
+ /**
371
+ * Rename a provisioned Durable Object namespace's class.
372
+ */
373
+ durableObject(options: DurableObjectRenamedExportOptions): DurableObjectRenamedExport;
374
+ /**
375
+ * Transfer ownership of a Durable Object namespace to another Worker in the same account.
376
+ */
377
+ durableObject(options: DurableObjectTransferredExportOptions): DurableObjectTransferredExport;
378
+ /**
379
+ * Prepare to receive cross-Worker Durable Object transfer.
380
+ * The source Worker must follow up with a deployment containing a `transferred` export to commit the transfer.
381
+ */
382
+ durableObject<TContainer extends ContainerConfigExport | undefined = undefined>(options: DurableObjectExpectingTransferExportOptions<TContainer>): DurableObjectExpectingTransferExport<TContainer>;
383
+ durableObject(options: DurableObjectExportOptions): DurableObjectExports;
384
+ /** Declares a WorkerEntrypoint export defined by this Worker. */
385
+ worker(options?: WorkerEntrypointExportOptions): WorkerEntrypointExport;
358
386
  }
359
387
  /**
360
- * Declares a secret that is required by your Worker, exposed on `env` under
361
- * the binding name.
388
+ * Exports builder for configuring Worker exports.
362
389
  *
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
390
+ * @example
391
+ * ```typescript
392
+ * import { defineContainer, defineWorker, exports } from "@cloudflare/config";
366
393
  *
367
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#secrets-configuration-property
394
+ * const myContainer = defineContainer({
395
+ * name: "my-container",
396
+ * image: { dockerfile: "./Dockerfile" },
397
+ * });
398
+ *
399
+ * export default defineWorker({
400
+ * exports: {
401
+ * MyDurableObject: exports.durableObject({ storage: "sqlite" }),
402
+ * MyContainerDO: exports.durableObject({ storage: "sqlite", container: myContainer }),
403
+ * OldClass: exports.durableObject({ state: "deleted" }),
404
+ * OldName: exports.durableObject({ state: "renamed", renamedTo: "NewName" }),
405
+ * Outgoing: exports.durableObject({ state: "transferred", transferredTo: "target-worker" }),
406
+ * Incoming: exports.durableObject({ state: "expecting-transfer", storage: "sqlite", transferFrom: "source-worker" }),
407
+ * },
408
+ * });
409
+ * ```
368
410
  */
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";
411
+ declare const exports: Exports; //#endregion
412
+ //#region src/triggers.d.ts
413
+ interface FetchTriggerOptions {
414
+ /**
415
+ * A route that your Worker should be published to.
416
+ *
417
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
418
+ */
419
+ pattern: string;
420
+ /**
421
+ * The DNS zone the pattern is attached to. Required when the
422
+ * pattern is ambiguous.
423
+ */
424
+ zone?: string;
381
425
  }
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
426
  /**
397
- * Binding for sending email from inside the Worker.
427
+ * Fetch trigger a route that your Worker should be published to.
398
428
  *
399
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
429
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
400
430
  */
401
- type SendEmailBinding = SendEmailBindingOptions & {
402
- type: "send-email";
403
- };
404
- interface StreamBindingOptions {
405
- /** Options that only apply during local development. */
406
- dev?: BindingDevOptions;
431
+ interface FetchTrigger extends FetchTriggerOptions {
432
+ type: "fetch";
407
433
  }
408
- /** Binding to Cloudflare Stream. */
409
- interface StreamBinding$1 extends StreamBindingOptions {
410
- type: "stream";
434
+ interface QueueConsumerTriggerOptions {
435
+ /** The name of the queue from which this consumer should consume. */
436
+ name: string;
437
+ /** The queue to send messages that failed to be consumed. */
438
+ deadLetterQueue?: string;
439
+ /** The maximum number of messages per batch. */
440
+ maxBatchSize?: number;
441
+ /** The maximum number of seconds to wait to fill a batch with messages. */
442
+ maxBatchTimeout?: number;
443
+ /**
444
+ * The maximum number of concurrent consumer Worker invocations.
445
+ * Leaving this unset will allow your consumer to scale to the
446
+ * maximum concurrency needed to keep up with the message backlog.
447
+ */
448
+ maxConcurrency?: number | null;
449
+ /** The maximum number of retries for each message. */
450
+ maxRetries?: number;
451
+ /** The number of seconds to wait before retrying a message. */
452
+ retryDelay?: number;
453
+ /** The number of milliseconds to wait for pulled messages to become visible again. */
454
+ visibilityTimeoutMs?: number;
411
455
  }
412
456
  /**
413
- * Inline string value made available to the Worker on `env` under the
414
- * binding name.
457
+ * Queue consumer trigger invokes this Worker when messages arrive on the
458
+ * named queue.
415
459
  *
416
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
460
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
417
461
  */
418
- interface TextBinding<T$1 extends string = string> {
419
- type: "text";
420
- /** The string value made available to the Worker. */
421
- value: T$1;
462
+ interface QueueConsumerTrigger extends QueueConsumerTriggerOptions {
463
+ type: "queue";
422
464
  }
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;
465
+ interface ScheduledTriggerOptions {
466
+ /**
467
+ * A "cron" definition to trigger a Worker's "scheduled" function.
468
+ *
469
+ * Lets you call Workers periodically, much like a cron job.
470
+ *
471
+ * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
472
+ */
473
+ schedule: string;
433
474
  }
434
475
  /**
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.
476
+ * Scheduled (cron) trigger invokes this Worker on the given schedules.
477
+ *
478
+ * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
438
479
  */
439
- interface UnsafeBinding extends UnsafeBindingOptions {
440
- type: `unsafe:${string}`;
480
+ interface ScheduledTrigger extends ScheduledTriggerOptions {
481
+ type: "scheduled";
441
482
  }
442
- interface VectorizeBindingOptions {
443
- /** The name of the Vectorize index. */
444
- name: string;
445
- /** Options that only apply during local development. */
446
- dev?: BindingDevOptions;
483
+ interface EmailTriggerOptions {
484
+ /**
485
+ * Inbound Email Routing addresses handled by this Worker.
486
+ *
487
+ * Each entry is a literal recipient address (e.g. `"support@example.com"`)
488
+ * or a `*@domain` catch-all (e.g. `"*@example.com"`).
489
+ */
490
+ addresses: string[];
447
491
  }
448
492
  /**
449
- * Binding to a Vectorize index.
450
- *
451
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
493
+ * Email trigger invokes this Worker for the configured Email Routing
494
+ * addresses.
452
495
  */
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";
496
+ interface EmailTrigger extends EmailTriggerOptions {
497
+ type: "email";
482
498
  }
483
- interface WebSearchBindingOptions {
484
- /** Options that only apply during local development. */
485
- dev?: BindingDevOptions;
499
+ interface ConnectTriggerOptions {
500
+ /** The transport protocol to listen for. */
501
+ protocol: "tcp";
502
+ /** The port to listen on. */
503
+ port: number;
504
+ /** The address to bind to. Defaults to `127.0.0.1`. */
505
+ address?: string;
486
506
  }
487
507
  /**
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.
508
+ * Connect trigger invokes this Worker's `connect(socket, env, ctx)`
509
+ * handler for raw socket connections received on the configured
510
+ * protocol/port.
490
511
  */
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";
512
+ interface ConnectTrigger extends ConnectTriggerOptions {
513
+ type: "connect";
513
514
  }
514
515
  /**
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).
516
+ * Event triggers fetch routes, queue consumers, cron schedules, Email
517
+ * Routing addresses, and raw sockets that invoke this Worker.
518
+ * Construct entries with `triggers.fetch(...)`, `triggers.queue(...)`,
519
+ * `triggers.scheduled(...)`, `triggers.email(...)`, or `triggers.connect(...)`.
518
520
  *
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
- }
544
- /**
545
- * Binding to a Workflow. `worker` is the name of the Worker that defines
546
- * the Workflow; `exportName` is the exported `WorkflowEntrypoint` class name.
521
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
547
522
  */
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 {
523
+ interface Triggers {
555
524
  /**
556
- * Agent Memory namespace binding. Each binding is scoped to a namespace and
557
- * allows agents to persist and recall memory.
525
+ * Fetch trigger a route that your Worker should be published to.
526
+ *
527
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
558
528
  */
559
- agentMemory(options: AgentMemoryBindingOptions): AgentMemoryBinding;
529
+ fetch(options: FetchTriggerOptions): FetchTrigger;
560
530
  /**
561
- * Binding to the Workers AI project.
531
+ * Queue consumer trigger invokes this Worker when messages arrive on the
532
+ * named queue.
562
533
  *
563
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
534
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
564
535
  */
565
- ai<TAiModelList extends AiModelListType = AiModels>(options?: AiBindingOptions): TypedAiBinding<TAiModelList>;
536
+ queue(options: QueueConsumerTriggerOptions): QueueConsumerTrigger;
566
537
  /**
567
- * AI Search instance binding. Each binding is bound directly to a single
568
- * pre-existing instance within the "default" namespace.
538
+ * Scheduled (cron) trigger invokes this Worker on the given schedules.
539
+ *
540
+ * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
569
541
  */
570
- aiSearch(options: AiSearchBindingOptions): AiSearchBinding;
542
+ scheduled(options: ScheduledTriggerOptions): ScheduledTrigger;
571
543
  /**
572
- * AI Search namespace binding. Each binding is scoped to a namespace and
573
- * allows dynamic instance CRUD within it.
544
+ * Email trigger invokes this Worker for the configured Email Routing
545
+ * addresses.
574
546
  */
575
- aiSearchNamespace(options: AiSearchNamespaceBindingOptions): AiSearchNamespaceBinding;
547
+ email(options: EmailTriggerOptions): EmailTrigger;
576
548
  /**
577
- * Binding to an Analytics Engine dataset.
578
- *
579
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
549
+ * Connect trigger invokes this Worker's `connect(socket, env, ctx)`
550
+ * handler for raw socket connections received on the configured
551
+ * protocol/port.
580
552
  */
581
- analyticsEngineDataset(options?: AnalyticsEngineDatasetBindingOptions): AnalyticsEngineDatasetBinding;
553
+ connect(options: ConnectTriggerOptions): ConnectTrigger;
554
+ }
555
+ /**
556
+ * Triggers builder for configuring event triggers.
557
+ *
558
+ * @example
559
+ * ```typescript
560
+ * import { defineWorker, triggers } from "@cloudflare/config";
561
+ *
562
+ * export default defineWorker({
563
+ * triggers: [
564
+ * triggers.fetch({ pattern: "example.com/*", zone: "example.com" }),
565
+ * triggers.queue({ name: "my-queue" }),
566
+ * triggers.scheduled({ schedule: "0 * * * *" }),
567
+ * triggers.scheduled({ schedule: "30 0 * * *" }),
568
+ * triggers.email({ addresses: ["support@example.com"] }),
569
+ * triggers.connect({ protocol: "tcp", port: 5432 }),
570
+ * ],
571
+ * });
572
+ * ```
573
+ */
574
+ declare const triggers: Triggers; //#endregion
575
+ //#region src/types.d.ts
576
+ /**
577
+ * Union of all binding definitions accepted in `env`.
578
+ */
579
+ 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;
580
+ /**
581
+ * Union of all trigger definitions accepted in `triggers`.
582
+ */
583
+ type Trigger = ConnectTrigger | EmailTrigger | FetchTrigger | QueueConsumerTrigger | ScheduledTrigger;
584
+ /**
585
+ * Union of all export definitions accepted in `exports`. Worker entries
586
+ * configure WorkerEntrypoint exports. Durable Object entries configure live
587
+ * classes and tombstone lifecycle operations.
588
+ */
589
+ type Export = DurableObjectCreatedExport | DurableObjectDeletedExport | DurableObjectRenamedExport | DurableObjectTransferredExport | DurableObjectExpectingTransferExport | WorkerEntrypointExport;
590
+ /** An image source accepted in an authored Container configuration. */
591
+ type ContainerImage = {
592
+ /** The path to a Dockerfile. */dockerfile: string;
582
593
  /**
583
- * Binding to an Artifacts instance. Artifacts provides git-compatible file
584
- * storage on Cloudflare Workers.
594
+ * Build context of the application.
595
+ *
596
+ * @default The directory containing `dockerfile`.
585
597
  */
586
- artifacts(options: ArtifactsBindingOptions): ArtifactsBinding;
598
+ buildContext?: string; /** Image variables available to the image at build time only. */
599
+ buildVars?: Record<string, string>;
600
+ } | {
587
601
  /**
588
- * Binding to the Worker's static assets.
602
+ * Reference to an existing image.
589
603
  *
590
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
604
+ * For supported registries, refer to
605
+ * https://developers.cloudflare.com/containers/guides/image-management/#use-pre-built-container-images
591
606
  */
592
- assets(): AssetsBinding;
607
+ reference: string;
608
+ };
609
+ /** Fields shared by all Container application configurations. */
610
+ interface BaseContainerConfig {
593
611
  /**
594
- * Binding to a headless browser usable from the Worker.
612
+ * Discriminates this config as a Container config.
595
613
  *
596
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
614
+ * Injected automatically by `defineContainer`; only needs to be written by
615
+ * hand when authoring a raw config object without the helper.
597
616
  */
598
- browser(options?: BrowserBindingOptions): BrowserBinding;
617
+ type: "container";
599
618
  /**
600
- * Binding to a D1 database.
619
+ * Name of the application.
601
620
  *
602
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
621
+ * This is also the identifier used to reference the Container from a Durable
622
+ * Object's `exports` entry via its `container` field.
603
623
  */
604
- d1(options?: D1BindingOptions): D1Binding;
624
+ name: string;
625
+ /** Configures observability for Container instances. */
626
+ observability?: {
627
+ /** Whether observability is enabled. */enabled?: boolean;
628
+ logs?: {
629
+ /** Whether log collection is enabled. */enabled?: boolean;
630
+ };
631
+ } & ({
632
+ /** Percentage of Container instances targeted for observability. */targetInstancePercentage?: number;
633
+ targetInstanceCount?: never;
634
+ } | {
635
+ targetInstancePercentage?: never; /** Number of Container instances targeted for observability. */
636
+ targetInstanceCount?: number;
637
+ });
605
638
  /**
606
- * Binding to a Workers for Platforms dispatch namespace.
639
+ * Passed through without client-side validation or transformation.
607
640
  *
608
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
641
+ * @hidden
609
642
  */
610
- dispatchNamespace(options?: DispatchNamespaceBindingOptions): DispatchNamespaceBinding;
643
+ unsafe?: Record<string, unknown>;
644
+ }
645
+ /** A Container application managed with a standard scheduling policy. */
646
+ interface StandardContainerConfig extends BaseContainerConfig {
647
+ /** The image to build or deploy. */
648
+ image: ContainerImage;
611
649
  /**
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.
650
+ * Maximum number of application instances.
614
651
  *
615
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
652
+ * @default 20
616
653
  */
617
- durableObject(options: DurableObjectBindingOptions): DurableObjectBinding;
618
- /** Binding to a Flagship feature-flag service. */
619
- flagship(options?: FlagshipBindingOptions): FlagshipBinding;
654
+ maxInstances?: number;
620
655
  /**
621
- * Binding to a Hyperdrive configuration.
656
+ * The instance type to be used for the Container.
657
+ * Select from one of the following named instance types:
622
658
  *
623
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
659
+ * - lite: 1/16 vCPU, 256 MiB memory, and 2 GB disk
660
+ * - basic: 1/4 vCPU, 1 GiB memory, and 4 GB disk
661
+ * - standard-1: 1/2 vCPU, 4 GiB memory, and 8 GB disk
662
+ * - standard-2: 1 vCPU, 6 GiB memory, and 12 GB disk
663
+ * - standard-3: 2 vCPU, 8 GiB memory, and 16 GB disk
664
+ * - standard-4: 4 vCPU, 12 GiB memory, and 20 GB disk
665
+ *
666
+ * Customers on an enterprise plan have the additional option to set custom
667
+ * limits.
668
+ *
669
+ * @default "lite"
624
670
  */
625
- hyperdrive(options: HyperdriveBindingOptions): HyperdriveBinding;
671
+ instanceType?: "basic" | "lite" | "standard-1" | "standard-2" | "standard-3" | "standard-4" | {
672
+ /** @default 0.0625 (1/16 vCPU) */vcpu?: number; /** @default 256 MiB */
673
+ memoryMib?: number; /** @default 2 GB */
674
+ diskMb?: number;
675
+ };
626
676
  /**
627
- * Binding to Cloudflare Images.
677
+ * The scheduling policy of the application.
628
678
  *
629
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
679
+ * @default "default"
630
680
  */
631
- images(options?: ImagesBindingOptions): ImagesBinding$1;
681
+ schedulingPolicy?: "default" | "regional";
682
+ ssh?: {
683
+ /**
684
+ * If enabled, users with write access to the Container application can
685
+ * connect to it over SSH.
686
+ *
687
+ * @default false
688
+ */
689
+ enabled: boolean;
690
+ /**
691
+ * Port that the SSH service is running on.
692
+ *
693
+ * @default 22
694
+ */
695
+ port?: number;
696
+ };
697
+ /** SSH public keys to put in the Container's authorized_keys file. */
698
+ authorizedKeys?: Array<{
699
+ name: string;
700
+ publicKey: string;
701
+ }>;
702
+ /** Scheduling constraints for Container placement. */
703
+ constraints?: {
704
+ /** Limit Container placement to specific geographic regions. */regions?: Array<"ENAM" | "WNAM" | "EEUR" | "WEUR" | "APAC" | "SAM" | "ME" | "OC" | "AFR">; /** Restrict Containers to compliance boundaries. */
705
+ jurisdiction?: "eu" | "fedramp";
706
+ };
707
+ rollout?: {
708
+ /**
709
+ * How a rollout should be created. It supports the following modes:
710
+ *
711
+ * - full-auto: The Container application will be rolled out fully
712
+ * automatically.
713
+ * - none: The Container application will not have a rollout or update.
714
+ * - full-manual: The Container application will be rolled out by manually
715
+ * progressing through the rollout steps.
716
+ *
717
+ * @default "full-auto"
718
+ * @hidden
719
+ */
720
+ kind?: "full-auto" | "none" | "full-manual";
721
+ /**
722
+ * Configures what percentage of instances should be updated at each step of
723
+ * a rollout. You can specify this as a single number or an array of numbers.
724
+ *
725
+ * If this is a single number, each step will progress by that percentage.
726
+ * The options are 5, 10, 20, 25, 50, or 100.
727
+ *
728
+ * If this is an array, each step specifies the cumulative rollout progress.
729
+ * The final step must be 100.
730
+ *
731
+ * @default [10, 100]
732
+ */
733
+ stepPercentage?: number | number[];
734
+ /**
735
+ * Configures the grace period, in seconds, for active instances before they
736
+ * are shut down during a rollout.
737
+ *
738
+ * @default 0
739
+ */
740
+ activeGracePeriod?: number;
741
+ };
742
+ }
743
+ /** A Container application managed by a Durable Object. */
744
+ interface DurableObjectContainerConfig extends BaseContainerConfig {
745
+ schedulingPolicy: "durable-object";
746
+ /** Named images that the Durable Object can start. */
747
+ images?: Record<string, ContainerImage>;
748
+ }
749
+ /**
750
+ * Container application configuration. This is the input shape passed to
751
+ * `defineContainer` and is validated at runtime by `InputContainerSchema`.
752
+ */
753
+ type ContainerConfig = DurableObjectContainerConfig | StandardContainerConfig;
754
+ /**
755
+ * Worker configuration. This is the input shape passed to
756
+ * [`defineWorker`](https://developers.cloudflare.com/workers/wrangler/configuration/).
757
+ *
758
+ * Fields are validated at runtime by `InputWorkerSchema` and normalised before
759
+ * being passed to downstream tooling.
760
+ */
761
+ interface WorkerConfig {
632
762
  /**
633
- * Inline JSON value made available to the Worker on `env` under the
634
- * binding name.
763
+ * Discriminates this config as a Worker config.
764
+ *
765
+ * Injected automatically by `defineWorker`; only needs to be written by
766
+ * hand when authoring a raw config object without the helper.
635
767
  */
636
- json<T$1 extends Json>(value: T$1): JsonBinding<T$1>;
768
+ type: "worker";
637
769
  /**
638
- * Binding to a Workers KV namespace.
639
- *
640
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
770
+ * The name of your Worker.
641
771
  */
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;
772
+ name: string;
647
773
  /**
648
- * Binding to an uploaded mTLS certificate.
774
+ * A date in the form yyyy-mm-dd, which will be used to determine
775
+ * which version of the Workers runtime is used.
649
776
  *
650
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
777
+ * More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
651
778
  */
652
- mtlsCertificate(options: MtlsCertificateBindingOptions): MtlsCertificateBinding;
653
- /** Binding to a Cloudflare Pipeline. */
654
- pipeline<TRecord extends PipelineRecord = PipelineRecord>(options: PipelineBindingOptions): TypedPipelineBinding<TRecord>;
779
+ compatibilityDate: string;
655
780
  /**
656
- * Producer binding to a Cloudflare Queue.
781
+ * A list of flags that enable features from upcoming features of
782
+ * the Workers runtime, usually used together with `compatibilityDate`.
657
783
  *
658
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
784
+ * More details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/
785
+ *
786
+ * @default []
659
787
  */
660
- queue<TBody = unknown>(options?: QueueBindingOptions): TypedQueueBinding<TBody>;
788
+ compatibilityFlags?: string[];
661
789
  /**
662
- * Binding to an R2 bucket.
790
+ * The entrypoint module that will be executed.
663
791
  *
664
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
792
+ * May be either a path string (e.g. `"./src/index.ts"`) or a module
793
+ * namespace imported with the `cf-worker` import attribute.
794
+ *
795
+ * @example
796
+ * ```ts
797
+ * import * as entrypoint from "./src" with { type: "cf-worker" };
798
+ * export default defineWorker({ entrypoint });
799
+ * ```
665
800
  */
666
- r2(options?: R2BindingOptions): R2Binding;
667
- /** Binding to a rate limiter. */
668
- rateLimit(options: RateLimitBindingOptions): RateLimitBinding;
801
+ entrypoint?: string | WorkerModule;
669
802
  /**
670
- * Declares a secret that is required by your Worker, exposed on `env` under
671
- * the binding name.
803
+ * Specify the directory of static assets to deploy/serve.
672
804
  *
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
805
+ * More details at https://developers.cloudflare.com/workers/frameworks/
676
806
  *
677
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#secrets-configuration-property
807
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
678
808
  */
679
- secret(): SecretBinding;
680
- /** Binding to a Secrets Store secret. */
681
- secretsStoreSecret(options: SecretsStoreSecretBindingOptions): SecretsStoreSecretBinding;
809
+ assets?: {
810
+ /** 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. */
811
+ notFoundHandling?: "single-page-application" | "404-page" | "none";
812
+ /**
813
+ * Matches will be routed to the User Worker, and matches to negative rules will go to the Asset Worker.
814
+ *
815
+ * Can also be `true`, indicating that every request should be routed to the User Worker.
816
+ */
817
+ runWorkerFirst?: string[] | boolean;
818
+ };
682
819
  /**
683
- * Binding for sending email from inside the Worker.
820
+ * Custom domains that your Worker should be published to.
684
821
  *
685
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
822
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
686
823
  */
687
- sendEmail(options?: SendEmailBindingOptions): SendEmailBinding;
688
- /** Binding to Cloudflare Stream. */
689
- stream(options?: StreamBindingOptions): StreamBinding$1;
824
+ domains?: string[];
690
825
  /**
691
- * Inline string value made available to the Worker on `env` under the
692
- * binding name.
826
+ * Event triggers fetch routes, queue consumers, cron schedules, Email
827
+ * Routing addresses, and raw sockets — that invoke this Worker.
828
+ * Construct entries with `triggers.fetch(...)`, `triggers.queue(...)`,
829
+ * `triggers.scheduled(...)`, `triggers.email(...)`, or
830
+ * `triggers.connect(...)`.
693
831
  *
694
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
832
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
695
833
  */
696
- text<T$1 extends string>(value: T$1): TextBinding<T$1>;
834
+ triggers?: Trigger[];
697
835
  /**
698
- * Binding to a Vectorize index.
836
+ * A list of Tail Workers that are bound to this Worker.
699
837
  *
700
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
838
+ * `@cloudflare/config` unifies regular and streaming tail consumers under
839
+ * a single field; pass `streaming: true` to forward streaming tail events.
840
+ *
841
+ * @default []
701
842
  */
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;
843
+ tailConsumers?: Array<{
844
+ /** The name of the service tail events will be forwarded to. */worker: string; /** Whether to stream tail events in real time. */
845
+ streaming?: boolean;
846
+ }>;
709
847
  /**
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.
848
+ * Specify the cache behavior of the Worker.
712
849
  */
713
- webSearch(options?: WebSearchBindingOptions): WebSearchBinding;
850
+ cache?: {
851
+ /** If cache is enabled for this Worker. */enabled: boolean; /** Whether cached assets may be reused across Worker versions. */
852
+ crossVersionCache?: boolean;
853
+ };
714
854
  /**
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).
855
+ * Specify how the Worker should be located to minimize round-trip time.
718
856
  *
719
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
857
+ * More details: https://developers.cloudflare.com/workers/platform/smart-placement/
720
858
  */
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 {
859
+ placement?: {
860
+ mode: "off" | "smart";
861
+ hint?: string;
862
+ } | {
863
+ mode?: "targeted";
864
+ region: string;
865
+ } | {
866
+ mode?: "targeted";
867
+ host: string;
868
+ } | {
869
+ mode?: "targeted";
870
+ hostname: string;
871
+ };
728
872
  /**
729
- * A route that your Worker should be published to.
873
+ * Specify limits for runtime behavior.
874
+ * Only supported for the "standard" Usage Model.
730
875
  *
731
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
732
- */
733
- pattern: string;
734
- /**
735
- * The DNS zone the pattern is attached to. Required when the
736
- * pattern is ambiguous.
737
- */
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;
757
- /**
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.
876
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#limits
761
877
  */
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 {
878
+ limits?: {
879
+ /** 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. */
880
+ subrequests?: number;
881
+ };
780
882
  /**
781
- * A "cron" definition to trigger a Worker's "scheduled" function.
883
+ * Send Trace Events from this Worker to Workers Logpush.
782
884
  *
783
- * Lets you call Workers periodically, much like a cron job.
885
+ * This will not configure a corresponding Logpush job automatically.
784
886
  *
785
- * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
887
+ * For more information about Workers Logpush, see:
888
+ * https://blog.cloudflare.com/logpush-for-workers/
786
889
  */
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 {
890
+ logpush?: boolean;
798
891
  /**
799
- * Inbound Email Routing addresses handled by this Worker.
892
+ * Specify the observability behavior of the Worker.
800
893
  *
801
- * Each entry is a literal recipient address (e.g. `"support@example.com"`)
802
- * or a `*@domain` catch-all (e.g. `"*@example.com"`).
894
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#observability
803
895
  */
804
- addresses: string[];
805
- }
806
- /**
807
- * Email trigger — invokes this Worker for the configured Email Routing
808
- * addresses.
809
- */
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
- }
821
- /**
822
- * Connect trigger — invokes this Worker's `connect(socket, env, ctx)`
823
- * handler for raw socket connections received on the configured
824
- * protocol/port.
825
- */
826
- interface ConnectTrigger extends ConnectTriggerOptions {
827
- type: "connect";
828
- }
829
- /**
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(...)`.
834
- *
835
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
836
- */
837
- interface Triggers {
896
+ observability?: {
897
+ /** If observability is enabled for this Worker. */enabled?: boolean; /** The sampling rate. */
898
+ headSamplingRate?: number;
899
+ /**
900
+ * Whether query strings are removed from request URLs in logs and traces.
901
+ *
902
+ * @default false
903
+ */
904
+ redactQueryString?: boolean;
905
+ logs?: {
906
+ enabled?: boolean; /** The sampling rate. */
907
+ headSamplingRate?: number; /** Set to false to disable invocation logs. */
908
+ invocationLogs?: boolean;
909
+ /**
910
+ * If logs should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
911
+ *
912
+ * @default true
913
+ */
914
+ persist?: boolean;
915
+ /**
916
+ * What destinations logs emitted from the Worker should be sent to.
917
+ *
918
+ * @default []
919
+ */
920
+ destinations?: string[];
921
+ };
922
+ traces?: {
923
+ enabled?: boolean; /** The sampling rate. */
924
+ headSamplingRate?: number;
925
+ /**
926
+ * If traces should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
927
+ *
928
+ * @default true
929
+ */
930
+ persist?: boolean;
931
+ /**
932
+ * What destinations traces emitted from the Worker should be sent to.
933
+ *
934
+ * @default []
935
+ */
936
+ destinations?: string[];
937
+ };
938
+ };
838
939
  /**
839
- * Fetch trigger a route that your Worker should be published to.
940
+ * Whether we use `<name>.<subdomain>.workers.dev` to
941
+ * test and deploy your Worker.
840
942
  *
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.
943
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workersdev
847
944
  *
848
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
945
+ * @default true
849
946
  */
850
- queue(options: QueueConsumerTriggerOptions): QueueConsumerTrigger;
947
+ workersDev?: boolean;
851
948
  /**
852
- * Scheduled (cron) trigger invokes this Worker on the given schedules.
949
+ * Whether we use `<version>-<name>.<subdomain>.workers.dev` to
950
+ * serve Preview URLs for your Worker.
853
951
  *
854
- * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
952
+ * @default false
855
953
  */
856
- scheduled(options: ScheduledTriggerOptions): ScheduledTrigger;
954
+ previewUrls?: boolean;
857
955
  /**
858
- * Email trigger — invokes this Worker for the configured Email Routing
859
- * addresses.
956
+ * Designates this Worker as an internal-only "first-party" Worker.
957
+ *
958
+ * @internal
860
959
  */
861
- email(options: EmailTriggerOptions): EmailTrigger;
960
+ firstPartyWorker?: boolean;
862
961
  /**
863
- * Connect trigger invokes this Worker's `connect(socket, env, ctx)`
864
- * handler for raw socket connections received on the configured
865
- * protocol/port.
962
+ * "Unsafe" tables for runtime features that aren't directly supported by
963
+ * this configuration. Values are forwarded verbatim in the Worker's
964
+ * upload metadata.
965
+ *
966
+ * @default {}
866
967
  */
867
- connect(options: ConnectTriggerOptions): ConnectTrigger;
868
- }
869
- /**
870
- * Triggers builder for configuring event triggers.
871
- *
872
- * @example
873
- * ```typescript
874
- * import { defineWorker, triggers } from "@cloudflare/config";
875
- *
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
- * ],
885
- * });
886
- * ```
887
- */
888
- declare const triggers: Triggers; //#endregion
889
- //#region src/exports.d.ts
968
+ unsafe?: {
969
+ /**
970
+ * Arbitrary key/value pairs that will be included in the uploaded metadata. Values specified
971
+ * here will always be applied to metadata last, so can add new or override existing fields.
972
+ */
973
+ metadata?: Record<string, unknown>;
974
+ /**
975
+ * Used for internal capnp uploads for the Workers runtime.
976
+ */
977
+ capnp?: {
978
+ basePath: string;
979
+ sourceSchemas: string[];
980
+ compiledSchema?: never;
981
+ } | {
982
+ basePath?: never;
983
+ sourceSchemas?: never;
984
+ compiledSchema: string;
985
+ };
986
+ };
987
+ /**
988
+ * Bindings exposed on the Worker's `env` object. Construct entries with
989
+ * `bindings.kv(...)`, `bindings.r2(...)`, etc.
990
+ */
991
+ env?: Record<string, Binding>;
992
+ /**
993
+ * Configuration for named exports declared by the Worker. Each entry's
994
+ * key is the exported class name; the value configures the export.
995
+ *
996
+ * Only one export kind is currently supported:
997
+ *
998
+ * - Construct entries with `exports.durableObject(...)`.
999
+ * - Declares Durable Object classes exported from this Worker.
1000
+ * For more information about Durable Objects, see the documentation at
1001
+ * https://developers.cloudflare.com/workers/learning/using-durable-objects.
1002
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects.
1003
+ */
1004
+ exports?: Record<string, Export>;
1005
+ }
890
1006
  /**
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"`.
1007
+ * Settings shared by the other exports.
1008
+ * Authored as a named `settings` export via
1009
+ * `defineSettings`.
895
1010
  */
896
- type DurableObjectStorageOptions = {
1011
+ interface SettingsConfig {
897
1012
  /**
898
- * Selects the SQLite-backed storage engine (recommended for new
899
- * classes).
1013
+ * Discriminates this config as a settings config.
1014
+ *
1015
+ * Injected automatically by `defineSettings`; only needs to be written by
1016
+ * hand when authoring a raw config object without the helper.
900
1017
  */
901
- storage: "sqlite";
1018
+ type: "settings";
902
1019
  /**
903
- * Attach a container to this Durable Object, by container name. The
904
- * name must match an entry in the top level `containers` array.
1020
+ * This is the ID of the account associated with your zone.
1021
+ * You might have more than one account, so make sure to use
1022
+ * the ID of the account associated with the zone/route you
1023
+ * provide, if you provide one. It can also be specified through
1024
+ * the CLOUDFLARE_ACCOUNT_ID environment variable.
905
1025
  */
906
- container?: string;
907
- } | {
908
- /** Selects the legacy key-value storage engine. */storage: "legacy-kv";
909
- };
1026
+ accountId?: string;
1027
+ /**
1028
+ * Specify the compliance region mode of the Worker.
1029
+ *
1030
+ * Although if the user does not specify a compliance region, the default is `public`,
1031
+ * it can be set to `undefined` in configuration to delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable.
1032
+ */
1033
+ complianceRegion?: "public" | "fedramp-high";
1034
+ } //#endregion
1035
+ //#region src/worker-definition.d.ts
1036
+ type WorkerConfigExport<T$1 extends WorkerConfig = WorkerConfig> = ConfigInput<T$1>;
910
1037
  /**
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
1038
+ * Authored Worker config shape {@link WorkerConfig} without the `type`
1039
+ * discriminant, which `defineWorker` injects.
917
1040
  */
918
- type DurableObjectCreatedExportOptions = {
919
- state?: "created";
920
- } & DurableObjectStorageOptions;
1041
+ type WorkerConfigInput = Omit<WorkerConfig, "type">;
1042
+ declare const defineWorker: <const TInput extends ConfigInput<WorkerConfigInput>>(config: TInput) => TInput extends ((ctx: ConfigContext) => infer TResult) ? (ctx: ConfigContext) => TResult extends Promise<infer TConfig extends {
1043
+ [x: string]: unknown;
1044
+ }> ? Promise<ConfigWithType<TConfig, "worker">> : TResult extends {
1045
+ [x: string]: unknown;
1046
+ } ? ConfigWithType<TResult, "worker"> : never : TInput extends Promise<infer TConfig extends {
1047
+ [x: string]: unknown;
1048
+ }> ? Promise<ConfigWithType<TConfig, "worker">> : TInput extends {
1049
+ [x: string]: unknown;
1050
+ } ? ConfigWithType<TInput, "worker"> : never; //#endregion
1051
+ //#region src/bindings.d.ts
1052
+ /** Options that control a binding during local development. */
1053
+ interface BindingDevOptions {
1054
+ /** Whether the binding should connect to the remote resource. */
1055
+ remote?: boolean;
1056
+ }
1057
+ interface AgentMemoryBindingOptions {
1058
+ /** The user-chosen namespace name. Must exist in Cloudflare at deploy time. */
1059
+ namespace: string;
1060
+ /** Options that only apply during local development. */
1061
+ dev?: BindingDevOptions;
1062
+ }
921
1063
  /**
922
- * Retire a provisioned Durable Object namespace whose class has
923
- * been removed from code.
924
- *
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.
1064
+ * Agent Memory namespace binding. Each binding is scoped to a namespace and
1065
+ * allows agents to persist and recall memory.
927
1066
  */
928
- interface DurableObjectDeletedExportOptions {
929
- state: "deleted";
1067
+ interface AgentMemoryBinding extends AgentMemoryBindingOptions {
1068
+ type: "agent-memory";
1069
+ }
1070
+ interface AiBindingOptions {
1071
+ /** Options that only apply during local development. */
1072
+ dev?: BindingDevOptions;
930
1073
  }
931
1074
  /**
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.
1075
+ * Binding to the Workers AI project.
1076
+ *
1077
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
935
1078
  */
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;
1079
+ interface AiBinding extends AiBindingOptions {
1080
+ type: "ai";
944
1081
  }
945
1082
  /**
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`.
1083
+ * Binding to the Workers AI project.
1084
+ *
1085
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
948
1086
  */
949
- interface DurableObjectTransferredExportOptions {
950
- state: "transferred";
951
- /**
952
- * The destination Worker. Must reference a Worker in the same account.
953
- */
954
- transferredTo: string;
1087
+ interface TypedAiBinding<TAiModelList extends AiModelListType = AiModels> extends AiBinding {
1088
+ /** @internal Carries type parameters for inference */
1089
+ __typeParams: [TAiModelList];
1090
+ }
1091
+ interface AiSearchBindingOptions {
1092
+ /** The user-chosen instance name. Must exist in Cloudflare at deploy time. */
1093
+ name: string;
1094
+ /** Options that only apply during local development. */
1095
+ dev?: BindingDevOptions;
955
1096
  }
956
1097
  /**
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.
1098
+ * AI Search instance binding. Each binding is bound directly to a single
1099
+ * pre-existing instance within the "default" namespace.
959
1100
  */
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";
1101
+ interface AiSearchBinding extends AiSearchBindingOptions {
1102
+ type: "ai-search";
972
1103
  }
973
- interface DurableObjectRenamedExport extends DurableObjectRenamedExportOptions {
974
- type: "durable-object";
1104
+ interface AiSearchNamespaceBindingOptions {
1105
+ /** The user-chosen namespace name. Must exist in Cloudflare at deploy time. */
1106
+ namespace: string;
1107
+ /** Options that only apply during local development. */
1108
+ dev?: BindingDevOptions;
975
1109
  }
976
- interface DurableObjectTransferredExport extends DurableObjectTransferredExportOptions {
977
- type: "durable-object";
1110
+ /**
1111
+ * AI Search namespace binding. Each binding is scoped to a namespace and
1112
+ * allows dynamic instance CRUD within it.
1113
+ */
1114
+ interface AiSearchNamespaceBinding extends AiSearchNamespaceBindingOptions {
1115
+ type: "ai-search-namespace";
978
1116
  }
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
- };
1117
+ interface AnalyticsEngineDatasetBindingOptions {
1118
+ /** The name of this dataset to write to. */
1119
+ name?: string;
988
1120
  }
989
- interface WorkerEntrypointExport extends WorkerEntrypointExportOptions {
990
- type: "worker";
1121
+ /**
1122
+ * Binding to an Analytics Engine dataset.
1123
+ *
1124
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
1125
+ */
1126
+ interface AnalyticsEngineDatasetBinding extends AnalyticsEngineDatasetBindingOptions {
1127
+ type: "analytics-engine-dataset";
1128
+ }
1129
+ interface ArtifactsBindingOptions {
1130
+ /** The namespace to use. */
1131
+ namespace: string;
1132
+ /** Options that only apply during local development. */
1133
+ dev?: BindingDevOptions;
991
1134
  }
992
1135
  /**
993
- * Configuration for named exports declared by the Worker. Each entry's
994
- * key is the exported class name; the value configures the export.
1136
+ * Binding to an Artifacts instance. Artifacts provides git-compatible file
1137
+ * storage on Cloudflare Workers.
995
1138
  */
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;
1139
+ interface ArtifactsBinding extends ArtifactsBindingOptions {
1140
+ type: "artifacts";
1026
1141
  }
1027
1142
  /**
1028
- * Exports builder for configuring Worker exports.
1143
+ * Binding to the Worker's static assets.
1029
1144
  *
1030
- * @example
1031
- * ```typescript
1032
- * import { defineWorker, exports } from "@cloudflare/config";
1145
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
1146
+ */
1147
+ interface AssetsBinding {
1148
+ type: "assets";
1149
+ }
1150
+ interface BrowserBindingOptions {
1151
+ /** Options that only apply during local development. */
1152
+ dev?: BindingDevOptions;
1153
+ }
1154
+ /**
1155
+ * Binding to a headless browser usable from the Worker.
1033
1156
  *
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
- * ```
1157
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
1045
1158
  */
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;
1159
+ interface BrowserBinding extends BrowserBindingOptions {
1160
+ type: "browser";
1161
+ }
1162
+ interface D1BindingOptions {
1163
+ /** The UUID of this D1 database (not required). */
1164
+ id?: string;
1165
+ /** The name of this D1 database. */
1166
+ name?: string;
1167
+ /** Options that only apply during local development. */
1168
+ dev?: BindingDevOptions;
1056
1169
  }
1057
- declare const DEFINITION: unique symbol;
1058
1170
  /**
1059
- * The authored config in any of its supported shapes: a plain value, a promise,
1060
- * or a function of {@link ConfigContext}.
1171
+ * Binding to a D1 database.
1172
+ *
1173
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
1061
1174
  */
1062
- type ConfigInput<T$1> = T$1 | Promise<T$1> | ((ctx: ConfigContext) => T$1 | Promise<T$1>);
1175
+ interface D1Binding extends D1BindingOptions {
1176
+ type: "d1";
1177
+ }
1178
+ interface DispatchNamespaceBindingOptions {
1179
+ /** The namespace to bind to. */
1180
+ namespace?: string;
1181
+ /** Details about the outbound Worker which will handle outbound requests from your namespace. */
1182
+ outbound?: {
1183
+ /** 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. */
1184
+ parameters?: string[];
1185
+ };
1186
+ /** Options that only apply during local development. */
1187
+ dev?: BindingDevOptions;
1188
+ }
1063
1189
  /**
1064
- * Resolve any `cloudflare.config.ts` export to its plain config value.
1190
+ * Binding to a Workers for Platforms dispatch namespace.
1065
1191
  *
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`.
1192
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
1070
1193
  */
1071
- //#endregion
1072
- //#region src/types.d.ts
1194
+ interface DispatchNamespaceBinding extends DispatchNamespaceBindingOptions {
1195
+ type: "dispatch-namespace";
1196
+ }
1197
+ type WorkerReference = string | WorkerConfigExport;
1198
+ type ReferencedWorkerConfig<TWorker$1 extends WorkerReference> = TWorker$1 extends string ? never : UnwrapConfig<TWorker$1>;
1199
+ type DurableObjectExportName<TWorker$1 extends WorkerReference> = TWorker$1 extends string ? string : InferDurableNamespaces<ReferencedWorkerConfig<TWorker$1>>;
1200
+ type WorkerEntrypointExportName<TWorker$1 extends WorkerReference> = TWorker$1 extends string ? string : InferWorkerEntrypointExports<ReferencedWorkerConfig<TWorker$1>>;
1201
+ type WorkflowExportName<TWorker$1 extends WorkerReference> = TWorker$1 extends string ? string : InferExportsByType<ReferencedWorkerConfig<TWorker$1>, "workflow">;
1202
+ interface DurableObjectBindingOptions<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends DurableObjectExportName<TWorker$1> = DurableObjectExportName<TWorker$1>> {
1203
+ /** The name or config of the Worker that defines the Durable Object class. */
1204
+ worker: TWorker$1;
1205
+ /** The exported class name of the Durable Object. */
1206
+ exportName: TExportName$1;
1207
+ }
1073
1208
  /**
1074
- * Union of all binding definitions accepted in `env`.
1209
+ * Binding to a Durable Object class. `worker` is the name or config of the
1210
+ * Worker that defines the class; `exportName` is the exported class name.
1211
+ *
1212
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
1075
1213
  */
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;
1214
+ interface DurableObjectBinding<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends DurableObjectExportName<TWorker$1> = DurableObjectExportName<TWorker$1>> extends DurableObjectBindingOptions<TWorker$1, TExportName$1> {
1215
+ type: "durable-object";
1216
+ }
1217
+ interface FlagshipBindingOptions {
1218
+ /** The Flagship app ID to bind to. */
1219
+ id?: string;
1220
+ /** Options that only apply during local development. */
1221
+ dev?: BindingDevOptions;
1222
+ }
1223
+ /** Binding to a Flagship feature-flag service. */
1224
+ interface FlagshipBinding extends FlagshipBindingOptions {
1225
+ type: "flagship";
1226
+ }
1227
+ interface HyperdriveBindingOptions {
1228
+ /** The ID of the Hyperdrive configuration. */
1229
+ id: string;
1230
+ /** Options that only apply during local development. */
1231
+ dev?: {
1232
+ /** The database connection string used during local development. */connectionString?: string;
1233
+ };
1234
+ }
1077
1235
  /**
1078
- * Union of all trigger definitions accepted in `triggers`.
1236
+ * Binding to a Hyperdrive configuration.
1237
+ *
1238
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
1079
1239
  */
1080
- type Trigger = ConnectTrigger | EmailTrigger | FetchTrigger | QueueConsumerTrigger | ScheduledTrigger;
1240
+ interface HyperdriveBinding extends HyperdriveBindingOptions {
1241
+ type: "hyperdrive";
1242
+ }
1243
+ interface ImagesBindingOptions {
1244
+ /** Options that only apply during local development. */
1245
+ dev?: BindingDevOptions;
1246
+ }
1081
1247
  /**
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.
1248
+ * Binding to Cloudflare Images.
1249
+ *
1250
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
1085
1251
  */
1086
- type Export = DurableObjectCreatedExport | DurableObjectDeletedExport | DurableObjectRenamedExport | DurableObjectTransferredExport | DurableObjectExpectingTransferExport | WorkerEntrypointExport;
1252
+ interface ImagesBinding$1 extends ImagesBindingOptions {
1253
+ type: "images";
1254
+ }
1087
1255
  /**
1088
- * Worker configuration. This is the input shape passed to
1089
- * [`defineWorker`](https://developers.cloudflare.com/workers/wrangler/configuration/).
1256
+ * Inline JSON value made available to the Worker on `env` under the
1257
+ * binding name.
1258
+ */
1259
+ interface JsonBinding<T$1 extends Json = Json> {
1260
+ type: "json";
1261
+ /** The JSON value made available to the Worker. */
1262
+ value: T$1;
1263
+ }
1264
+ interface KvBindingOptions {
1265
+ /** The ID of the KV namespace. */
1266
+ id?: string;
1267
+ /** Options that only apply during local development. */
1268
+ dev?: BindingDevOptions;
1269
+ }
1270
+ /**
1271
+ * Binding to a Workers KV namespace.
1090
1272
  *
1091
- * Fields are validated at runtime by `InputWorkerSchema` and normalised before
1092
- * being passed to downstream tooling.
1273
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
1093
1274
  */
1094
- interface WorkerConfig {
1095
- /**
1096
- * Discriminates this config as a Worker config.
1097
- *
1098
- * Injected automatically by `defineWorker`; only needs to be written by
1099
- * hand when authoring a raw config object without the helper.
1100
- */
1101
- type: "worker";
1102
- /**
1103
- * The name of your Worker.
1104
- */
1275
+ interface KvBinding extends KvBindingOptions {
1276
+ type: "kv";
1277
+ }
1278
+ /**
1279
+ * Binding to a Workers KV namespace.
1280
+ *
1281
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
1282
+ */
1283
+ interface TypedKvBinding<TKey extends string = string> extends KvBinding {
1284
+ /** @internal Carries type parameters for inference */
1285
+ __typeParams: [TKey];
1286
+ }
1287
+ interface LogfwdrBindingOptions {
1288
+ /** The destination for this logged message. */
1289
+ destination: string;
1290
+ }
1291
+ /** Binding for forwarding logs to logfwdr. */
1292
+ interface LogfwdrBinding extends LogfwdrBindingOptions {
1293
+ type: "logfwdr";
1294
+ }
1295
+ interface MediaBindingOptions {
1296
+ /** Options that only apply during local development. */
1297
+ dev?: BindingDevOptions;
1298
+ }
1299
+ /** Binding to Cloudflare Media Transformations. */
1300
+ interface MediaBinding$1 extends MediaBindingOptions {
1301
+ type: "media";
1302
+ }
1303
+ interface MtlsCertificateBindingOptions {
1304
+ /** The UUID of the uploaded mTLS certificate. */
1305
+ id: string;
1306
+ /** Options that only apply during local development. */
1307
+ dev?: BindingDevOptions;
1308
+ }
1309
+ /**
1310
+ * Binding to an uploaded mTLS certificate.
1311
+ *
1312
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
1313
+ */
1314
+ interface MtlsCertificateBinding extends MtlsCertificateBindingOptions {
1315
+ type: "mtls-certificate";
1316
+ }
1317
+ interface PipelineBindingOptions {
1318
+ /** Name of the Pipeline to bind. */
1105
1319
  name: string;
1320
+ /** Options that only apply during local development. */
1321
+ dev?: BindingDevOptions;
1322
+ }
1323
+ /** Binding to a Cloudflare Pipeline. */
1324
+ interface PipelineBinding extends PipelineBindingOptions {
1325
+ type: "pipeline";
1326
+ }
1327
+ /** Binding to a Cloudflare Pipeline. */
1328
+ interface TypedPipelineBinding<TRecord extends PipelineRecord = PipelineRecord> extends PipelineBinding {
1329
+ /** @internal Carries type parameters for inference */
1330
+ __typeParams: [TRecord];
1331
+ }
1332
+ interface QueueBindingOptions {
1333
+ /** The name of this Queue. */
1334
+ name?: string;
1335
+ /** The number of seconds to wait before delivering a message. */
1336
+ deliveryDelay?: number;
1337
+ /** Options that only apply during local development. */
1338
+ dev?: BindingDevOptions;
1339
+ }
1340
+ /**
1341
+ * Producer binding to a Cloudflare Queue.
1342
+ *
1343
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
1344
+ */
1345
+ interface QueueBinding extends QueueBindingOptions {
1346
+ type: "queue";
1347
+ }
1348
+ /**
1349
+ * Producer binding to a Cloudflare Queue.
1350
+ *
1351
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
1352
+ */
1353
+ interface TypedQueueBinding<TBody = unknown> extends QueueBinding {
1354
+ /** @internal Carries type parameters for inference */
1355
+ __typeParams: [TBody];
1356
+ }
1357
+ interface R2BindingOptions {
1358
+ /** The name of this R2 bucket at the edge. */
1359
+ name?: string;
1360
+ /** The jurisdiction that the bucket exists in. Default if not present. */
1361
+ jurisdiction?: string;
1362
+ /** Settings that only apply to local development. */
1363
+ dev?: BindingDevOptions & {
1364
+ /** EXPERIMENTAL: credentials for the local S3-compatible endpoint. */experimentalS3Credentials?: {
1365
+ accessKeyId: string;
1366
+ secretAccessKey: string;
1367
+ };
1368
+ };
1369
+ }
1370
+ /**
1371
+ * Binding to an R2 bucket.
1372
+ *
1373
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
1374
+ */
1375
+ interface R2Binding extends R2BindingOptions {
1376
+ type: "r2";
1377
+ }
1378
+ interface RateLimitBindingOptions {
1379
+ /** The namespace ID for this rate limiter. */
1380
+ namespace: string;
1381
+ /** Simple rate limiting configuration. */
1382
+ simple: {
1383
+ /** 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). */
1384
+ period: 10 | 60;
1385
+ };
1386
+ }
1387
+ /** Binding to a rate limiter. */
1388
+ interface RateLimitBinding extends RateLimitBindingOptions {
1389
+ type: "rate-limit";
1390
+ }
1391
+ /**
1392
+ * Declares a secret that is required by your Worker, exposed on `env` under
1393
+ * the binding name.
1394
+ *
1395
+ * When defined, this binding:
1396
+ * - Replaces .dev.vars/.env/process.env inference for type generation
1397
+ * - Enables local dev validation with warnings for missing secrets
1398
+ *
1399
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#secrets-configuration-property
1400
+ */
1401
+ interface SecretBinding {
1402
+ type: "secret";
1403
+ }
1404
+ interface SecretsStoreSecretBindingOptions {
1405
+ /** ID of the secret store. */
1406
+ storeId: string;
1407
+ /** Name of the secret. */
1408
+ secretName: string;
1409
+ }
1410
+ /** Binding to a Secrets Store secret. */
1411
+ interface SecretsStoreSecretBinding extends SecretsStoreSecretBindingOptions {
1412
+ type: "secrets-store-secret";
1413
+ }
1414
+ type SendEmailDestinationOptions = {
1415
+ /** If this binding should be restricted to a specific verified address. */destinationAddress: string;
1416
+ allowedDestinationAddresses?: never;
1417
+ } | {
1418
+ destinationAddress?: never; /** If this binding should be restricted to a set of verified addresses. */
1419
+ allowedDestinationAddresses: string[];
1420
+ } | {
1421
+ destinationAddress?: never;
1422
+ allowedDestinationAddresses?: never;
1423
+ };
1424
+ type SendEmailBindingOptions = SendEmailDestinationOptions & {
1425
+ /** If this binding should be restricted to a set of sender addresses. */allowedSenderAddresses?: string[]; /** Options that only apply during local development. */
1426
+ dev?: BindingDevOptions;
1427
+ };
1428
+ /**
1429
+ * Binding for sending email from inside the Worker.
1430
+ *
1431
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
1432
+ */
1433
+ type SendEmailBinding = SendEmailBindingOptions & {
1434
+ type: "send-email";
1435
+ };
1436
+ interface StreamBindingOptions {
1437
+ /** Options that only apply during local development. */
1438
+ dev?: BindingDevOptions;
1439
+ }
1440
+ /** Binding to Cloudflare Stream. */
1441
+ interface StreamBinding$1 extends StreamBindingOptions {
1442
+ type: "stream";
1443
+ }
1444
+ /**
1445
+ * Inline string value made available to the Worker on `env` under the
1446
+ * binding name.
1447
+ *
1448
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
1449
+ */
1450
+ interface TextBinding<T$1 extends string = string> {
1451
+ type: "text";
1452
+ /** The string value made available to the Worker. */
1453
+ value: T$1;
1454
+ }
1455
+ interface UnsafeBindingOptions {
1456
+ /** Local-dev plugin configuration for this unsafe binding. */
1457
+ dev?: {
1458
+ /** The plugin package that provides the binding's local-dev implementation. */plugin: {
1459
+ package: string;
1460
+ name: string;
1461
+ }; /** Plugin-specific options. */
1462
+ options?: Record<string, unknown>;
1463
+ };
1464
+ [key: string]: unknown;
1465
+ }
1466
+ /**
1467
+ * Escape-hatch binding for runtime features that aren't directly supported
1468
+ * by this configuration. Included in the Worker's upload metadata without
1469
+ * changes.
1470
+ */
1471
+ interface UnsafeBinding extends UnsafeBindingOptions {
1472
+ type: `unsafe:${string}`;
1473
+ }
1474
+ interface VectorizeBindingOptions {
1475
+ /** The name of the Vectorize index. */
1476
+ name: string;
1477
+ /** Options that only apply during local development. */
1478
+ dev?: BindingDevOptions;
1479
+ }
1480
+ /**
1481
+ * Binding to a Vectorize index.
1482
+ *
1483
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
1484
+ */
1485
+ interface VectorizeBinding extends VectorizeBindingOptions {
1486
+ type: "vectorize";
1487
+ }
1488
+ /** Binding to the Worker version's metadata. */
1489
+ interface VersionMetadataBinding {
1490
+ type: "version-metadata";
1491
+ }
1492
+ type VpcNetworkBindingOptions = {
1493
+ /** The tunnel ID of the Cloudflare Tunnel to route traffic through. Mutually exclusive with `networkId`. */tunnelId: string;
1494
+ networkId?: never; /** Options that only apply during local development. */
1495
+ dev?: BindingDevOptions;
1496
+ } | {
1497
+ tunnelId?: never; /** The network ID to route traffic through. Mutually exclusive with `tunnelId`. */
1498
+ networkId: string; /** Options that only apply during local development. */
1499
+ dev?: BindingDevOptions;
1500
+ };
1501
+ /** Binding to a VPC network. */
1502
+ type VpcNetworkBinding = VpcNetworkBindingOptions & {
1503
+ type: "vpc-network";
1504
+ };
1505
+ interface VpcServiceBindingOptions {
1506
+ /** The service ID of the VPC connectivity service. */
1507
+ id: string;
1508
+ /** Options that only apply during local development. */
1509
+ dev?: BindingDevOptions;
1510
+ }
1511
+ /** Binding to a VPC service. */
1512
+ interface VpcServiceBinding extends VpcServiceBindingOptions {
1513
+ type: "vpc-service";
1514
+ }
1515
+ interface WebSearchBindingOptions {
1516
+ /** Options that only apply during local development. */
1517
+ dev?: BindingDevOptions;
1518
+ }
1519
+ /**
1520
+ * Cloudflare Web Search binding. There is exactly one shared web corpus, so
1521
+ * the binding is zero-config — only the variable name is required.
1522
+ */
1523
+ interface WebSearchBinding extends WebSearchBindingOptions {
1524
+ type: "web-search";
1525
+ }
1526
+ interface WorkerBindingOptions<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkerEntrypointExportName<TWorker$1> | undefined = WorkerEntrypointExportName<TWorker$1> | undefined> {
1527
+ /** The name or config of the bound Worker. */
1528
+ worker: TWorker$1;
1529
+ /** The named export to bind to (defaults to the default export). */
1530
+ exportName?: TExportName$1;
1531
+ /** Optional properties that will be made available to the service via `ctx.props`. */
1532
+ props?: Record<string, unknown>;
1533
+ /** Options that only apply during local development. */
1534
+ dev?: BindingDevOptions;
1535
+ }
1536
+ /**
1537
+ * Service binding (Worker-to-Worker). `worker` is the name or config of the
1538
+ * bound Worker; `exportName` selects a named `WorkerEntrypoint` export
1539
+ * (defaults to the default export).
1540
+ *
1541
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
1542
+ */
1543
+ interface WorkerBinding<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkerEntrypointExportName<TWorker$1> | undefined = WorkerEntrypointExportName<TWorker$1> | undefined> extends WorkerBindingOptions<TWorker$1, TExportName$1> {
1544
+ type: "worker";
1545
+ }
1546
+ /** Binding to a Worker Loader. */
1547
+ interface WorkerLoaderBinding {
1548
+ type: "worker-loader";
1549
+ }
1550
+ interface WorkflowBindingOptions<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkflowExportName<TWorker$1> = WorkflowExportName<TWorker$1>> {
1551
+ /** The name or config of the Worker that defines the Workflow. */
1552
+ worker: TWorker$1;
1553
+ /** The exported class name of the Workflow. */
1554
+ exportName: TExportName$1;
1555
+ }
1556
+ /**
1557
+ * Binding to a Workflow. `worker` is the name or config of the Worker that
1558
+ * defines the Workflow; `exportName` is the exported `WorkflowEntrypoint`
1559
+ * class name.
1560
+ */
1561
+ interface WorkflowBinding<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkflowExportName<TWorker$1> = WorkflowExportName<TWorker$1>> extends WorkflowBindingOptions<TWorker$1, TExportName$1> {
1562
+ type: "workflow";
1563
+ }
1564
+ interface Bindings {
1106
1565
  /**
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
1566
+ * Agent Memory namespace binding. Each binding is scoped to a namespace and
1567
+ * allows agents to persist and recall memory.
1111
1568
  */
1112
- compatibilityDate: string;
1569
+ agentMemory(options: AgentMemoryBindingOptions): AgentMemoryBinding;
1113
1570
  /**
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/
1571
+ * Binding to the Workers AI project.
1118
1572
  *
1119
- * @default []
1573
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
1120
1574
  */
1121
- compatibilityFlags?: string[];
1575
+ ai<TAiModelList extends AiModelListType = AiModels>(options?: AiBindingOptions): TypedAiBinding<TAiModelList>;
1122
1576
  /**
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
- * ```
1577
+ * AI Search instance binding. Each binding is bound directly to a single
1578
+ * pre-existing instance within the "default" namespace.
1133
1579
  */
1134
- entrypoint?: string | WorkerModule;
1580
+ aiSearch(options: AiSearchBindingOptions): AiSearchBinding;
1135
1581
  /**
1136
- * Specify the directory of static assets to deploy/serve.
1137
- *
1138
- * More details at https://developers.cloudflare.com/workers/frameworks/
1139
- *
1140
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
1582
+ * AI Search namespace binding. Each binding is scoped to a namespace and
1583
+ * allows dynamic instance CRUD within it.
1141
1584
  */
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
- };
1585
+ aiSearchNamespace(options: AiSearchNamespaceBindingOptions): AiSearchNamespaceBinding;
1152
1586
  /**
1153
- * Custom domains that your Worker should be published to.
1587
+ * Binding to an Analytics Engine dataset.
1154
1588
  *
1155
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
1589
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
1156
1590
  */
1157
- domains?: string[];
1591
+ analyticsEngineDataset(options?: AnalyticsEngineDatasetBindingOptions): AnalyticsEngineDatasetBinding;
1158
1592
  /**
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(...)`.
1164
- *
1165
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
1593
+ * Binding to an Artifacts instance. Artifacts provides git-compatible file
1594
+ * storage on Cloudflare Workers.
1166
1595
  */
1167
- triggers?: Trigger[];
1596
+ artifacts(options: ArtifactsBindingOptions): ArtifactsBinding;
1168
1597
  /**
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.
1598
+ * Binding to the Worker's static assets.
1173
1599
  *
1174
- * @default []
1600
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
1175
1601
  */
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
- }>;
1602
+ assets(): AssetsBinding;
1180
1603
  /**
1181
- * Specify the cache behavior of the Worker.
1604
+ * Binding to a headless browser usable from the Worker.
1605
+ *
1606
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
1182
1607
  */
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
- };
1608
+ browser(options?: BrowserBindingOptions): BrowserBinding;
1187
1609
  /**
1188
- * Specify how the Worker should be located to minimize round-trip time.
1610
+ * Binding to a D1 database.
1189
1611
  *
1190
- * More details: https://developers.cloudflare.com/workers/platform/smart-placement/
1612
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
1191
1613
  */
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
- };
1614
+ d1(options?: D1BindingOptions): D1Binding;
1205
1615
  /**
1206
- * Specify limits for runtime behavior.
1207
- * Only supported for the "standard" Usage Model.
1616
+ * Binding to a Workers for Platforms dispatch namespace.
1208
1617
  *
1209
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#limits
1618
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
1210
1619
  */
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
- };
1620
+ dispatchNamespace(options?: DispatchNamespaceBindingOptions): DispatchNamespaceBinding;
1215
1621
  /**
1216
- * Send Trace Events from this Worker to Workers Logpush.
1217
- *
1218
- * This will not configure a corresponding Logpush job automatically.
1622
+ * Binding to a Durable Object class. `worker` is the name or config of the
1623
+ * Worker that defines the class; `exportName` is the exported class name.
1219
1624
  *
1220
- * For more information about Workers Logpush, see:
1221
- * https://blog.cloudflare.com/logpush-for-workers/
1625
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
1222
1626
  */
1223
- logpush?: boolean;
1627
+ durableObject<TWorker$1 extends WorkerReference, TExportName$1 extends DurableObjectExportName<TWorker$1>>(options: DurableObjectBindingOptions<TWorker$1, TExportName$1>): DurableObjectBinding<TWorker$1, TExportName$1>;
1628
+ /** Binding to a Flagship feature-flag service. */
1629
+ flagship(options?: FlagshipBindingOptions): FlagshipBinding;
1224
1630
  /**
1225
- * Specify the observability behavior of the Worker.
1631
+ * Binding to a Hyperdrive configuration.
1226
1632
  *
1227
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#observability
1633
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
1228
1634
  */
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
- };
1635
+ hyperdrive(options: HyperdriveBindingOptions): HyperdriveBinding;
1272
1636
  /**
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
1637
+ * Binding to Cloudflare Images.
1277
1638
  *
1278
- * @default true
1639
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
1279
1640
  */
1280
- workersDev?: boolean;
1641
+ images(options?: ImagesBindingOptions): ImagesBinding$1;
1281
1642
  /**
1282
- * Whether we use `<version>-<name>.<subdomain>.workers.dev` to
1283
- * serve Preview URLs for your Worker.
1284
- *
1285
- * @default false
1643
+ * Inline JSON value made available to the Worker on `env` under the
1644
+ * binding name.
1286
1645
  */
1287
- previewUrls?: boolean;
1646
+ json<T$1 extends Json>(value: T$1): JsonBinding<T$1>;
1288
1647
  /**
1289
- * Designates this Worker as an internal-only "first-party" Worker.
1648
+ * Binding to a Workers KV namespace.
1290
1649
  *
1291
- * @internal
1650
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
1292
1651
  */
1293
- firstPartyWorker?: boolean;
1652
+ kv<TKey extends string = string>(options?: KvBindingOptions): TypedKvBinding<TKey>;
1653
+ /** Binding for forwarding logs to logfwdr. */
1654
+ logfwdr(options: LogfwdrBindingOptions): LogfwdrBinding;
1655
+ /** Binding to Cloudflare Media Transformations. */
1656
+ media(options?: MediaBindingOptions): MediaBinding$1;
1294
1657
  /**
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.
1658
+ * Binding to an uploaded mTLS certificate.
1298
1659
  *
1299
- * @default {}
1660
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
1300
1661
  */
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
- };
1662
+ mtlsCertificate(options: MtlsCertificateBindingOptions): MtlsCertificateBinding;
1663
+ /** Binding to a Cloudflare Pipeline. */
1664
+ pipeline<TRecord extends PipelineRecord = PipelineRecord>(options: PipelineBindingOptions): TypedPipelineBinding<TRecord>;
1320
1665
  /**
1321
- * Bindings exposed on the Worker's `env` object. Construct entries with
1322
- * `bindings.kv(...)`, `bindings.r2(...)`, etc.
1666
+ * Producer binding to a Cloudflare Queue.
1667
+ *
1668
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
1323
1669
  */
1324
- env?: Record<string, Binding>;
1670
+ queue<TBody = unknown>(options?: QueueBindingOptions): TypedQueueBinding<TBody>;
1325
1671
  /**
1326
- * Configuration for named exports declared by the Worker. Each entry's
1327
- * key is the exported class name; the value configures the export.
1328
- *
1329
- * Only one export kind is currently supported:
1672
+ * Binding to an R2 bucket.
1330
1673
  *
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.
1674
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
1336
1675
  */
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 {
1676
+ r2(options?: R2BindingOptions): R2Binding;
1677
+ /** Binding to a rate limiter. */
1678
+ rateLimit(options: RateLimitBindingOptions): RateLimitBinding;
1345
1679
  /**
1346
- * Discriminates this config as a settings config.
1680
+ * Declares a secret that is required by your Worker, exposed on `env` under
1681
+ * the binding name.
1682
+ *
1683
+ * When defined, this binding:
1684
+ * - Replaces .dev.vars/.env/process.env inference for type generation
1685
+ * - Enables local dev validation with warnings for missing secrets
1347
1686
  *
1348
- * Injected automatically by `defineSettings`; only needs to be written by
1349
- * hand when authoring a raw config object without the helper.
1687
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#secrets-configuration-property
1350
1688
  */
1351
- type: "settings";
1689
+ secret(): SecretBinding;
1690
+ /** Binding to a Secrets Store secret. */
1691
+ secretsStoreSecret(options: SecretsStoreSecretBindingOptions): SecretsStoreSecretBinding;
1352
1692
  /**
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
+ * Binding for sending email from inside the Worker.
1694
+ *
1695
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
1358
1696
  */
1359
- accountId?: string;
1697
+ sendEmail(options?: SendEmailBindingOptions): SendEmailBinding;
1698
+ /** Binding to Cloudflare Stream. */
1699
+ stream(options?: StreamBindingOptions): StreamBinding$1;
1360
1700
  /**
1361
- * Specify the compliance region mode of the Worker.
1701
+ * Inline string value made available to the Worker on `env` under the
1702
+ * binding name.
1362
1703
  *
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.
1704
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
1365
1705
  */
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> {
1706
+ text<T$1 extends string>(value: T$1): TextBinding<T$1>;
1383
1707
  /**
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.
1708
+ * Binding to a Vectorize index.
1386
1709
  *
1387
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
1710
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
1711
+ */
1712
+ vectorize(options: VectorizeBindingOptions): VectorizeBinding;
1713
+ /** Binding to the Worker version's metadata. */
1714
+ versionMetadata(): VersionMetadataBinding;
1715
+ /** Binding to a VPC network. */
1716
+ vpcNetwork(options: VpcNetworkBindingOptions): VpcNetworkBinding;
1717
+ /** Binding to a VPC service. */
1718
+ vpcService(options: VpcServiceBindingOptions): VpcServiceBinding;
1719
+ /**
1720
+ * Cloudflare Web Search binding. There is exactly one shared web corpus, so
1721
+ * the binding is zero-config — only the variable name is required.
1388
1722
  */
1389
- durableObject<TExportName$1 extends InferDurableNamespaces<TConfig$1>>(options: {
1390
- worker: TWorkerName;
1391
- exportName: TExportName$1;
1392
- }): TypedDurableObjectBinding<TConfig$1, TExportName$1>;
1723
+ webSearch(options?: WebSearchBindingOptions): WebSearchBinding;
1393
1724
  /**
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).
1725
+ * Service binding (Worker-to-Worker). `worker` is the name or config of the
1726
+ * bound Worker; `exportName` selects a named `WorkerEntrypoint` export
1727
+ * (defaults to the default export).
1397
1728
  *
1398
1729
  * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
1399
1730
  */
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;
1731
+ 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>>;
1732
+ /** Binding to a Worker Loader. */
1733
+ workerLoader(): WorkerLoaderBinding;
1504
1734
  }
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
1735
+ declare const bindings: Bindings; //#endregion
1624
1736
  //#region src/settings-definition.d.ts
1737
+ type SettingsConfigExport<T$1 extends SettingsConfig = SettingsConfig> = ConfigInput<T$1>;
1625
1738
  /**
1626
1739
  * Authored settings config shape — {@link SettingsConfig} without the `type`
1627
1740
  * discriminant, which `defineSettings` injects.
1628
1741
  */
1629
1742
  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
- };
1638
- }
1639
1743
  /**
1640
1744
  * Declare shared settings.
1641
1745
  * Authored as a named `settings` export.
1642
1746
  */
1643
- declare function defineSettings(config: ConfigInput<SettingsConfigInput>): SettingsDefinition; //#endregion
1747
+ declare const defineSettings: <const TInput extends ConfigInput<SettingsConfigInput>>(config: TInput) => TInput extends ((ctx: ConfigContext) => infer TResult) ? (ctx: ConfigContext) => TResult extends Promise<infer TConfig extends {
1748
+ [x: string]: unknown;
1749
+ }> ? Promise<ConfigWithType<TConfig, "settings">> : TResult extends {
1750
+ [x: string]: unknown;
1751
+ } ? ConfigWithType<TResult, "settings"> : never : TInput extends Promise<infer TConfig extends {
1752
+ [x: string]: unknown;
1753
+ }> ? Promise<ConfigWithType<TConfig, "settings">> : TInput extends {
1754
+ [x: string]: unknown;
1755
+ } ? ConfigWithType<TInput, "settings"> : never; //#endregion
1644
1756
  //#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 };
1757
+ export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, ArtifactsBinding, AssetsBinding, BindingDevOptions, Bindings, BrowserBinding, ConfigContext, ConnectTrigger, ContainerConfig, ContainerConfigExport, ContainerConfigInput, 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, SettingsConfigExport, SettingsConfigInput, StreamBinding$1 as StreamBinding, TextBinding, Triggers, TypedAiBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, UnsafeBinding, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WebSearchBinding, WorkerBinding, WorkerConfig, WorkerConfigExport, WorkerConfigInput, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerLoaderBinding, WorkerReference, WorkflowBinding, bindings, defineContainer, defineSettings, defineWorker, exports, triggers };