alchemy 2.0.0-beta.61 → 2.0.0-beta.63

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 (1017) hide show
  1. package/README.md +26 -11
  2. package/bin/exec.js +2023 -75
  3. package/bin/exec.js.map +1 -1
  4. package/lib/AWS/ACM/Certificate.d.ts.map +1 -1
  5. package/lib/AWS/ACM/Certificate.js +16 -4
  6. package/lib/AWS/ACM/Certificate.js.map +1 -1
  7. package/lib/AWS/ApiGateway/common.d.ts.map +1 -1
  8. package/lib/AWS/ApiGateway/common.js +6 -3
  9. package/lib/AWS/ApiGateway/common.js.map +1 -1
  10. package/lib/AWS/AuthProvider.d.ts.map +1 -1
  11. package/lib/AWS/AuthProvider.js +2 -2
  12. package/lib/AWS/AuthProvider.js.map +1 -1
  13. package/lib/AWS/AutoScaling/AutoScalingGroup.d.ts.map +1 -1
  14. package/lib/AWS/AutoScaling/AutoScalingGroup.js +8 -2
  15. package/lib/AWS/AutoScaling/AutoScalingGroup.js.map +1 -1
  16. package/lib/AWS/Bootstrap.d.ts.map +1 -1
  17. package/lib/AWS/Bootstrap.js +5 -2
  18. package/lib/AWS/Bootstrap.js.map +1 -1
  19. package/lib/AWS/CloudFront/Distribution.d.ts.map +1 -1
  20. package/lib/AWS/CloudFront/Distribution.js +20 -5
  21. package/lib/AWS/CloudFront/Distribution.js.map +1 -1
  22. package/lib/AWS/CloudFront/Function.js +5 -2
  23. package/lib/AWS/CloudFront/Function.js.map +1 -1
  24. package/lib/AWS/CloudFront/Invalidation.d.ts.map +1 -1
  25. package/lib/AWS/CloudFront/Invalidation.js +4 -1
  26. package/lib/AWS/CloudFront/Invalidation.js.map +1 -1
  27. package/lib/AWS/CloudFront/KvEntries.d.ts.map +1 -1
  28. package/lib/AWS/CloudFront/KvEntries.js +4 -1
  29. package/lib/AWS/CloudFront/KvEntries.js.map +1 -1
  30. package/lib/AWS/CloudFront/KvRoutesUpdate.d.ts.map +1 -1
  31. package/lib/AWS/CloudFront/KvRoutesUpdate.js +8 -2
  32. package/lib/AWS/CloudFront/KvRoutesUpdate.js.map +1 -1
  33. package/lib/AWS/CloudFront/VpcOrigin.d.ts.map +1 -1
  34. package/lib/AWS/CloudFront/VpcOrigin.js +12 -3
  35. package/lib/AWS/CloudFront/VpcOrigin.js.map +1 -1
  36. package/lib/AWS/CloudFront/common.d.ts.map +1 -1
  37. package/lib/AWS/CloudFront/common.js +5 -2
  38. package/lib/AWS/CloudFront/common.js.map +1 -1
  39. package/lib/AWS/CloudWatch/AnomalyDetector.d.ts.map +1 -1
  40. package/lib/AWS/CloudWatch/AnomalyDetector.js +4 -1
  41. package/lib/AWS/CloudWatch/AnomalyDetector.js.map +1 -1
  42. package/lib/AWS/CloudWatch/common.d.ts.map +1 -1
  43. package/lib/AWS/CloudWatch/common.js +1 -1
  44. package/lib/AWS/CloudWatch/common.js.map +1 -1
  45. package/lib/AWS/DynamoDB/Table.d.ts.map +1 -1
  46. package/lib/AWS/DynamoDB/Table.js +53 -20
  47. package/lib/AWS/DynamoDB/Table.js.map +1 -1
  48. package/lib/AWS/EC2/EIP.d.ts.map +1 -1
  49. package/lib/AWS/EC2/EIP.js +4 -1
  50. package/lib/AWS/EC2/EIP.js.map +1 -1
  51. package/lib/AWS/EC2/EgressOnlyInternetGateway.d.ts.map +1 -1
  52. package/lib/AWS/EC2/EgressOnlyInternetGateway.js +4 -2
  53. package/lib/AWS/EC2/EgressOnlyInternetGateway.js.map +1 -1
  54. package/lib/AWS/EC2/Instance.d.ts.map +1 -1
  55. package/lib/AWS/EC2/Instance.js +12 -3
  56. package/lib/AWS/EC2/Instance.js.map +1 -1
  57. package/lib/AWS/EC2/InternetGateway.d.ts.map +1 -1
  58. package/lib/AWS/EC2/InternetGateway.js +12 -5
  59. package/lib/AWS/EC2/InternetGateway.js.map +1 -1
  60. package/lib/AWS/EC2/NatGateway.js +2 -4
  61. package/lib/AWS/EC2/NatGateway.js.map +1 -1
  62. package/lib/AWS/EC2/NetworkAcl.d.ts.map +1 -1
  63. package/lib/AWS/EC2/NetworkAcl.js +4 -1
  64. package/lib/AWS/EC2/NetworkAcl.js.map +1 -1
  65. package/lib/AWS/EC2/NetworkAclEntry.d.ts.map +1 -1
  66. package/lib/AWS/EC2/NetworkAclEntry.js +4 -1
  67. package/lib/AWS/EC2/NetworkAclEntry.js.map +1 -1
  68. package/lib/AWS/EC2/RouteTable.d.ts.map +1 -1
  69. package/lib/AWS/EC2/RouteTable.js +8 -6
  70. package/lib/AWS/EC2/RouteTable.js.map +1 -1
  71. package/lib/AWS/EC2/RouteTableAssociation.js +2 -5
  72. package/lib/AWS/EC2/RouteTableAssociation.js.map +1 -1
  73. package/lib/AWS/EC2/SecurityGroup.d.ts.map +1 -1
  74. package/lib/AWS/EC2/SecurityGroup.js +8 -3
  75. package/lib/AWS/EC2/SecurityGroup.js.map +1 -1
  76. package/lib/AWS/EC2/Subnet.d.ts.map +1 -1
  77. package/lib/AWS/EC2/Subnet.js +10 -6
  78. package/lib/AWS/EC2/Subnet.js.map +1 -1
  79. package/lib/AWS/EC2/Vpc.d.ts.map +1 -1
  80. package/lib/AWS/EC2/Vpc.js +7 -7
  81. package/lib/AWS/EC2/Vpc.js.map +1 -1
  82. package/lib/AWS/EC2/VpcEndpoint.js +2 -4
  83. package/lib/AWS/EC2/VpcEndpoint.js.map +1 -1
  84. package/lib/AWS/EC2/hosted.d.ts.map +1 -1
  85. package/lib/AWS/EC2/hosted.js +2 -1
  86. package/lib/AWS/EC2/hosted.js.map +1 -1
  87. package/lib/AWS/ECS/Service.d.ts.map +1 -1
  88. package/lib/AWS/ECS/Service.js +4 -1
  89. package/lib/AWS/ECS/Service.js.map +1 -1
  90. package/lib/AWS/ECS/Task.d.ts.map +1 -1
  91. package/lib/AWS/ECS/Task.js +2 -1
  92. package/lib/AWS/ECS/Task.js.map +1 -1
  93. package/lib/AWS/EKS/Addon.js +8 -2
  94. package/lib/AWS/EKS/Addon.js.map +1 -1
  95. package/lib/AWS/EKS/Cluster.d.ts.map +1 -1
  96. package/lib/AWS/EKS/Cluster.js +4 -1
  97. package/lib/AWS/EKS/Cluster.js.map +1 -1
  98. package/lib/AWS/ELBv2/TargetGroup.d.ts.map +1 -1
  99. package/lib/AWS/ELBv2/TargetGroup.js +4 -1
  100. package/lib/AWS/ELBv2/TargetGroup.js.map +1 -1
  101. package/lib/AWS/ELBv2/TrustStore.d.ts.map +1 -1
  102. package/lib/AWS/ELBv2/TrustStore.js +4 -1
  103. package/lib/AWS/ELBv2/TrustStore.js.map +1 -1
  104. package/lib/AWS/IAM/SAMLProvider.js +4 -1
  105. package/lib/AWS/IAM/SAMLProvider.js.map +1 -1
  106. package/lib/AWS/IdentityCenter/AccountAssignment.js +8 -2
  107. package/lib/AWS/IdentityCenter/AccountAssignment.js.map +1 -1
  108. package/lib/AWS/IdentityCenter/common.d.ts.map +1 -1
  109. package/lib/AWS/IdentityCenter/common.js +1 -1
  110. package/lib/AWS/IdentityCenter/common.js.map +1 -1
  111. package/lib/AWS/KMS/Alias.js +4 -1
  112. package/lib/AWS/KMS/Alias.js.map +1 -1
  113. package/lib/AWS/KMS/Key.js +4 -1
  114. package/lib/AWS/KMS/Key.js.map +1 -1
  115. package/lib/AWS/Kinesis/Stream.d.ts.map +1 -1
  116. package/lib/AWS/Kinesis/Stream.js +2 -2
  117. package/lib/AWS/Kinesis/Stream.js.map +1 -1
  118. package/lib/AWS/Kinesis/StreamConsumer.d.ts.map +1 -1
  119. package/lib/AWS/Kinesis/StreamConsumer.js +7 -4
  120. package/lib/AWS/Kinesis/StreamConsumer.js.map +1 -1
  121. package/lib/AWS/Lambda/Alias.d.ts.map +1 -1
  122. package/lib/AWS/Lambda/Alias.js +4 -1
  123. package/lib/AWS/Lambda/Alias.js.map +1 -1
  124. package/lib/AWS/Lambda/EventInvokeConfig.d.ts.map +1 -1
  125. package/lib/AWS/Lambda/EventInvokeConfig.js +2 -2
  126. package/lib/AWS/Lambda/EventInvokeConfig.js.map +1 -1
  127. package/lib/AWS/Lambda/EventSourceMapping.d.ts.map +1 -1
  128. package/lib/AWS/Lambda/EventSourceMapping.js +10 -4
  129. package/lib/AWS/Lambda/EventSourceMapping.js.map +1 -1
  130. package/lib/AWS/Lambda/Function.d.ts +16 -1
  131. package/lib/AWS/Lambda/Function.d.ts.map +1 -1
  132. package/lib/AWS/Lambda/Function.js +113 -65
  133. package/lib/AWS/Lambda/Function.js.map +1 -1
  134. package/lib/AWS/Lambda/MicrovmProvider.d.ts.map +1 -1
  135. package/lib/AWS/Lambda/MicrovmProvider.js +13 -5
  136. package/lib/AWS/Lambda/MicrovmProvider.js.map +1 -1
  137. package/lib/AWS/Lambda/MicrovmRuntimeContext.d.ts.map +1 -1
  138. package/lib/AWS/Lambda/MicrovmRuntimeContext.js +9 -21
  139. package/lib/AWS/Lambda/MicrovmRuntimeContext.js.map +1 -1
  140. package/lib/AWS/Lambda/NetworkConnector.js +13 -5
  141. package/lib/AWS/Lambda/NetworkConnector.js.map +1 -1
  142. package/lib/AWS/Lambda/RuntimeExtension.d.ts +27 -0
  143. package/lib/AWS/Lambda/RuntimeExtension.d.ts.map +1 -0
  144. package/lib/AWS/Lambda/RuntimeExtension.js +49 -0
  145. package/lib/AWS/Lambda/RuntimeExtension.js.map +1 -0
  146. package/lib/AWS/Organizations/Account.js +5 -2
  147. package/lib/AWS/Organizations/Account.js.map +1 -1
  148. package/lib/AWS/Organizations/common.d.ts.map +1 -1
  149. package/lib/AWS/Organizations/common.js +1 -1
  150. package/lib/AWS/Organizations/common.js.map +1 -1
  151. package/lib/AWS/Providers.js +14 -12
  152. package/lib/AWS/Providers.js.map +1 -1
  153. package/lib/AWS/RDS/DBCluster.d.ts.map +1 -1
  154. package/lib/AWS/RDS/DBCluster.js +8 -2
  155. package/lib/AWS/RDS/DBCluster.js.map +1 -1
  156. package/lib/AWS/RDS/DBInstance.d.ts.map +1 -1
  157. package/lib/AWS/RDS/DBInstance.js +8 -2
  158. package/lib/AWS/RDS/DBInstance.js.map +1 -1
  159. package/lib/AWS/RDS/DBProxy.d.ts.map +1 -1
  160. package/lib/AWS/RDS/DBProxy.js +4 -1
  161. package/lib/AWS/RDS/DBProxy.js.map +1 -1
  162. package/lib/AWS/RDS/DBProxyEndpoint.d.ts.map +1 -1
  163. package/lib/AWS/RDS/DBProxyEndpoint.js +4 -1
  164. package/lib/AWS/RDS/DBProxyEndpoint.js.map +1 -1
  165. package/lib/AWS/Route53/HealthCheck.d.ts.map +1 -1
  166. package/lib/AWS/Route53/HealthCheck.js +8 -2
  167. package/lib/AWS/Route53/HealthCheck.js.map +1 -1
  168. package/lib/AWS/Route53/HostedZone.d.ts.map +1 -1
  169. package/lib/AWS/Route53/HostedZone.js +8 -2
  170. package/lib/AWS/Route53/HostedZone.js.map +1 -1
  171. package/lib/AWS/Route53/Record.d.ts.map +1 -1
  172. package/lib/AWS/Route53/Record.js +4 -1
  173. package/lib/AWS/Route53/Record.js.map +1 -1
  174. package/lib/AWS/S3/Bucket.d.ts.map +1 -1
  175. package/lib/AWS/S3/Bucket.js +5 -2
  176. package/lib/AWS/S3/Bucket.js.map +1 -1
  177. package/lib/AWS/SQS/Queue.d.ts.map +1 -1
  178. package/lib/AWS/SQS/Queue.js +25 -7
  179. package/lib/AWS/SQS/Queue.js.map +1 -1
  180. package/lib/AWS/StateStore/State.js +5 -2
  181. package/lib/AWS/StateStore/State.js.map +1 -1
  182. package/lib/AWS/Website/AssetDeployment.js +5 -2
  183. package/lib/AWS/Website/AssetDeployment.js.map +1 -1
  184. package/lib/Action.d.ts +8 -0
  185. package/lib/Action.d.ts.map +1 -1
  186. package/lib/Action.js +16 -5
  187. package/lib/Action.js.map +1 -1
  188. package/lib/ActionRuntimeContext.d.ts +14 -0
  189. package/lib/ActionRuntimeContext.d.ts.map +1 -0
  190. package/lib/ActionRuntimeContext.js +56 -0
  191. package/lib/ActionRuntimeContext.js.map +1 -0
  192. package/lib/Apply.d.ts.map +1 -1
  193. package/lib/Apply.js +48 -6
  194. package/lib/Apply.js.map +1 -1
  195. package/lib/Auth/AuthProvider.d.ts +10 -0
  196. package/lib/Auth/AuthProvider.d.ts.map +1 -1
  197. package/lib/Auth/AuthProvider.js +10 -0
  198. package/lib/Auth/AuthProvider.js.map +1 -1
  199. package/lib/Auth/Lock.d.ts.map +1 -1
  200. package/lib/Auth/Lock.js +5 -2
  201. package/lib/Auth/Lock.js.map +1 -1
  202. package/lib/Axiom/AuthProvider.d.ts.map +1 -1
  203. package/lib/Axiom/AuthProvider.js +1 -1
  204. package/lib/Axiom/AuthProvider.js.map +1 -1
  205. package/lib/Bundle/PurePlugin.d.ts.map +1 -1
  206. package/lib/Bundle/PurePlugin.js +26 -1
  207. package/lib/Bundle/PurePlugin.js.map +1 -1
  208. package/lib/Bundle/Vite.d.ts +3 -1
  209. package/lib/Bundle/Vite.d.ts.map +1 -1
  210. package/lib/Bundle/Vite.js +38 -13
  211. package/lib/Bundle/Vite.js.map +1 -1
  212. package/lib/Cli/LoggingCli.d.ts.map +1 -1
  213. package/lib/Cli/LoggingCli.js +7 -4
  214. package/lib/Cli/LoggingCli.js.map +1 -1
  215. package/lib/Cli/commands/_shared.d.ts +74 -5
  216. package/lib/Cli/commands/_shared.d.ts.map +1 -1
  217. package/lib/Cli/commands/_shared.js +84 -2
  218. package/lib/Cli/commands/_shared.js.map +1 -1
  219. package/lib/Cli/commands/login.d.ts +7 -3
  220. package/lib/Cli/commands/login.d.ts.map +1 -1
  221. package/lib/Cli/commands/login.js +71 -24
  222. package/lib/Cli/commands/login.js.map +1 -1
  223. package/lib/Cli/commands/logs.d.ts.map +1 -1
  224. package/lib/Cli/commands/logs.js +1 -0
  225. package/lib/Cli/commands/logs.js.map +1 -1
  226. package/lib/Cli/commands/nuke.d.ts.map +1 -1
  227. package/lib/Cli/commands/nuke.js +15 -24
  228. package/lib/Cli/commands/nuke.js.map +1 -1
  229. package/lib/Cli/commands/profile.d.ts +23 -1
  230. package/lib/Cli/commands/profile.d.ts.map +1 -1
  231. package/lib/Cli/commands/profile.js +46 -22
  232. package/lib/Cli/commands/profile.js.map +1 -1
  233. package/lib/Cli/commands/tail.d.ts.map +1 -1
  234. package/lib/Cli/commands/tail.js +1 -0
  235. package/lib/Cli/commands/tail.js.map +1 -1
  236. package/lib/Cloudflare/AI/GatewayDynamicRouting.d.ts.map +1 -1
  237. package/lib/Cloudflare/AI/GatewayDynamicRouting.js +31 -2
  238. package/lib/Cloudflare/AI/GatewayDynamicRouting.js.map +1 -1
  239. package/lib/Cloudflare/AI/LanguageModel.js +21 -4
  240. package/lib/Cloudflare/AI/LanguageModel.js.map +1 -1
  241. package/lib/Cloudflare/AI/QuerySearchLocal.d.ts +37 -0
  242. package/lib/Cloudflare/AI/QuerySearchLocal.d.ts.map +1 -0
  243. package/lib/Cloudflare/AI/QuerySearchLocal.js +53 -0
  244. package/lib/Cloudflare/AI/QuerySearchLocal.js.map +1 -0
  245. package/lib/Cloudflare/AI/QuerySearchNamespaceLocal.d.ts +35 -0
  246. package/lib/Cloudflare/AI/QuerySearchNamespaceLocal.d.ts.map +1 -0
  247. package/lib/Cloudflare/AI/QuerySearchNamespaceLocal.js +47 -0
  248. package/lib/Cloudflare/AI/QuerySearchNamespaceLocal.js.map +1 -0
  249. package/lib/Cloudflare/AI/SearchHttpClient.d.ts +34 -0
  250. package/lib/Cloudflare/AI/SearchHttpClient.d.ts.map +1 -0
  251. package/lib/Cloudflare/AI/SearchHttpClient.js +262 -0
  252. package/lib/Cloudflare/AI/SearchHttpClient.js.map +1 -0
  253. package/lib/Cloudflare/AI/SearchInstance.js +4 -1
  254. package/lib/Cloudflare/AI/SearchInstance.js.map +1 -1
  255. package/lib/Cloudflare/AI/index.d.ts +2 -0
  256. package/lib/Cloudflare/AI/index.d.ts.map +1 -1
  257. package/lib/Cloudflare/AI/index.js +2 -0
  258. package/lib/Cloudflare/AI/index.js.map +1 -1
  259. package/lib/Cloudflare/Access/Application.d.ts.map +1 -1
  260. package/lib/Cloudflare/Access/Application.js +7 -1
  261. package/lib/Cloudflare/Access/Application.js.map +1 -1
  262. package/lib/Cloudflare/Alerting/Silence.d.ts.map +1 -1
  263. package/lib/Cloudflare/Alerting/Silence.js +4 -1
  264. package/lib/Cloudflare/Alerting/Silence.js.map +1 -1
  265. package/lib/Cloudflare/Alerting/Webhook.d.ts.map +1 -1
  266. package/lib/Cloudflare/Alerting/Webhook.js +8 -2
  267. package/lib/Cloudflare/Alerting/Webhook.js.map +1 -1
  268. package/lib/Cloudflare/Auth/AuthProvider.d.ts.map +1 -1
  269. package/lib/Cloudflare/Auth/AuthProvider.js +23 -8
  270. package/lib/Cloudflare/Auth/AuthProvider.js.map +1 -1
  271. package/lib/Cloudflare/Auth/OAuthClient.d.ts.map +1 -1
  272. package/lib/Cloudflare/Auth/OAuthClient.js +6 -7
  273. package/lib/Cloudflare/Auth/OAuthClient.js.map +1 -1
  274. package/lib/Cloudflare/Cache/RegionalTieredCache.d.ts.map +1 -1
  275. package/lib/Cloudflare/Cache/RegionalTieredCache.js +7 -1
  276. package/lib/Cloudflare/Cache/RegionalTieredCache.js.map +1 -1
  277. package/lib/Cloudflare/Containers/ContainerApplication.d.ts +18 -2
  278. package/lib/Cloudflare/Containers/ContainerApplication.d.ts.map +1 -1
  279. package/lib/Cloudflare/Containers/ContainerApplication.js +1 -0
  280. package/lib/Cloudflare/Containers/ContainerApplication.js.map +1 -1
  281. package/lib/Cloudflare/Containers/ContainerBundle.d.ts +29 -3
  282. package/lib/Cloudflare/Containers/ContainerBundle.d.ts.map +1 -1
  283. package/lib/Cloudflare/Containers/ContainerBundle.js +84 -23
  284. package/lib/Cloudflare/Containers/ContainerBundle.js.map +1 -1
  285. package/lib/Cloudflare/Containers/ContainerPlatform.d.ts.map +1 -1
  286. package/lib/Cloudflare/Containers/ContainerPlatform.js +12 -33
  287. package/lib/Cloudflare/Containers/ContainerPlatform.js.map +1 -1
  288. package/lib/Cloudflare/Containers/ContainerProvider.d.ts.map +1 -1
  289. package/lib/Cloudflare/Containers/ContainerProvider.js +53 -14
  290. package/lib/Cloudflare/Containers/ContainerProvider.js.map +1 -1
  291. package/lib/Cloudflare/Containers/LocalContainerProvider.d.ts +6 -6
  292. package/lib/Cloudflare/Containers/LocalContainerProvider.d.ts.map +1 -1
  293. package/lib/Cloudflare/Containers/LocalContainerProvider.js +69 -47
  294. package/lib/Cloudflare/Containers/LocalContainerProvider.js.map +1 -1
  295. package/lib/Cloudflare/D1/QueryDatabaseHttpClient.d.ts +24 -0
  296. package/lib/Cloudflare/D1/QueryDatabaseHttpClient.d.ts.map +1 -0
  297. package/lib/Cloudflare/D1/QueryDatabaseHttpClient.js +106 -0
  298. package/lib/Cloudflare/D1/QueryDatabaseHttpClient.js.map +1 -0
  299. package/lib/Cloudflare/D1/QueryDatabaseLocal.d.ts +38 -0
  300. package/lib/Cloudflare/D1/QueryDatabaseLocal.d.ts.map +1 -0
  301. package/lib/Cloudflare/D1/QueryDatabaseLocal.js +54 -0
  302. package/lib/Cloudflare/D1/QueryDatabaseLocal.js.map +1 -0
  303. package/lib/Cloudflare/D1/index.d.ts +1 -0
  304. package/lib/Cloudflare/D1/index.d.ts.map +1 -1
  305. package/lib/Cloudflare/D1/index.js +1 -0
  306. package/lib/Cloudflare/D1/index.js.map +1 -1
  307. package/lib/Cloudflare/DNS/DnsHttp.d.ts +16 -1
  308. package/lib/Cloudflare/DNS/DnsHttp.d.ts.map +1 -1
  309. package/lib/Cloudflare/DNS/DnsHttp.js +6 -1
  310. package/lib/Cloudflare/DNS/DnsHttp.js.map +1 -1
  311. package/lib/Cloudflare/DNS/DnsLocal.d.ts +22 -0
  312. package/lib/Cloudflare/DNS/DnsLocal.d.ts.map +1 -0
  313. package/lib/Cloudflare/DNS/DnsLocal.js +31 -0
  314. package/lib/Cloudflare/DNS/DnsLocal.js.map +1 -0
  315. package/lib/Cloudflare/DNS/ReadDnsHttp.d.ts +3 -3
  316. package/lib/Cloudflare/DNS/ReadDnsHttp.d.ts.map +1 -1
  317. package/lib/Cloudflare/DNS/ReadDnsHttp.js +3 -4
  318. package/lib/Cloudflare/DNS/ReadDnsHttp.js.map +1 -1
  319. package/lib/Cloudflare/DNS/ReadDnsLocal.d.ts +32 -0
  320. package/lib/Cloudflare/DNS/ReadDnsLocal.d.ts.map +1 -0
  321. package/lib/Cloudflare/DNS/ReadDnsLocal.js +35 -0
  322. package/lib/Cloudflare/DNS/ReadDnsLocal.js.map +1 -0
  323. package/lib/Cloudflare/DNS/ReadWriteDnsHttp.d.ts +3 -3
  324. package/lib/Cloudflare/DNS/ReadWriteDnsHttp.d.ts.map +1 -1
  325. package/lib/Cloudflare/DNS/ReadWriteDnsHttp.js +4 -4
  326. package/lib/Cloudflare/DNS/ReadWriteDnsHttp.js.map +1 -1
  327. package/lib/Cloudflare/DNS/ReadWriteDnsLocal.d.ts +40 -0
  328. package/lib/Cloudflare/DNS/ReadWriteDnsLocal.d.ts.map +1 -0
  329. package/lib/Cloudflare/DNS/ReadWriteDnsLocal.js +43 -0
  330. package/lib/Cloudflare/DNS/ReadWriteDnsLocal.js.map +1 -0
  331. package/lib/Cloudflare/DNS/WriteDnsHttp.d.ts +3 -3
  332. package/lib/Cloudflare/DNS/WriteDnsHttp.d.ts.map +1 -1
  333. package/lib/Cloudflare/DNS/WriteDnsHttp.js +3 -4
  334. package/lib/Cloudflare/DNS/WriteDnsHttp.js.map +1 -1
  335. package/lib/Cloudflare/DNS/WriteDnsLocal.d.ts +38 -0
  336. package/lib/Cloudflare/DNS/WriteDnsLocal.d.ts.map +1 -0
  337. package/lib/Cloudflare/DNS/WriteDnsLocal.js +41 -0
  338. package/lib/Cloudflare/DNS/WriteDnsLocal.js.map +1 -0
  339. package/lib/Cloudflare/DNS/index.d.ts +3 -0
  340. package/lib/Cloudflare/DNS/index.d.ts.map +1 -1
  341. package/lib/Cloudflare/DNS/index.js +3 -0
  342. package/lib/Cloudflare/DNS/index.js.map +1 -1
  343. package/lib/Cloudflare/Diagnostics/EndpointHealthcheck.js +4 -1
  344. package/lib/Cloudflare/Diagnostics/EndpointHealthcheck.js.map +1 -1
  345. package/lib/Cloudflare/Flagship/ReadFlagsHttpClient.d.ts +27 -0
  346. package/lib/Cloudflare/Flagship/ReadFlagsHttpClient.d.ts.map +1 -0
  347. package/lib/Cloudflare/Flagship/ReadFlagsHttpClient.js +86 -0
  348. package/lib/Cloudflare/Flagship/ReadFlagsHttpClient.js.map +1 -0
  349. package/lib/Cloudflare/Flagship/ReadFlagsLocal.d.ts +41 -0
  350. package/lib/Cloudflare/Flagship/ReadFlagsLocal.d.ts.map +1 -0
  351. package/lib/Cloudflare/Flagship/ReadFlagsLocal.js +57 -0
  352. package/lib/Cloudflare/Flagship/ReadFlagsLocal.js.map +1 -0
  353. package/lib/Cloudflare/Flagship/index.d.ts +1 -0
  354. package/lib/Cloudflare/Flagship/index.d.ts.map +1 -1
  355. package/lib/Cloudflare/Flagship/index.js +1 -0
  356. package/lib/Cloudflare/Flagship/index.js.map +1 -1
  357. package/lib/Cloudflare/Images/Variant.d.ts.map +1 -1
  358. package/lib/Cloudflare/Images/Variant.js +4 -1
  359. package/lib/Cloudflare/Images/Variant.js.map +1 -1
  360. package/lib/Cloudflare/KV/NamespaceHttp.d.ts +16 -1
  361. package/lib/Cloudflare/KV/NamespaceHttp.d.ts.map +1 -1
  362. package/lib/Cloudflare/KV/NamespaceHttp.js +8 -2
  363. package/lib/Cloudflare/KV/NamespaceHttp.js.map +1 -1
  364. package/lib/Cloudflare/KV/NamespaceLocal.d.ts +22 -0
  365. package/lib/Cloudflare/KV/NamespaceLocal.d.ts.map +1 -0
  366. package/lib/Cloudflare/KV/NamespaceLocal.js +32 -0
  367. package/lib/Cloudflare/KV/NamespaceLocal.js.map +1 -0
  368. package/lib/Cloudflare/KV/ReadNamespaceHttp.d.ts +2 -2
  369. package/lib/Cloudflare/KV/ReadNamespaceHttp.d.ts.map +1 -1
  370. package/lib/Cloudflare/KV/ReadNamespaceHttp.js +5 -6
  371. package/lib/Cloudflare/KV/ReadNamespaceHttp.js.map +1 -1
  372. package/lib/Cloudflare/KV/ReadNamespaceLocal.d.ts +27 -0
  373. package/lib/Cloudflare/KV/ReadNamespaceLocal.d.ts.map +1 -0
  374. package/lib/Cloudflare/KV/ReadNamespaceLocal.js +30 -0
  375. package/lib/Cloudflare/KV/ReadNamespaceLocal.js.map +1 -0
  376. package/lib/Cloudflare/KV/ReadWriteNamespaceHttp.d.ts +3 -3
  377. package/lib/Cloudflare/KV/ReadWriteNamespaceHttp.d.ts.map +1 -1
  378. package/lib/Cloudflare/KV/ReadWriteNamespaceHttp.js +6 -6
  379. package/lib/Cloudflare/KV/ReadWriteNamespaceHttp.js.map +1 -1
  380. package/lib/Cloudflare/KV/ReadWriteNamespaceLocal.d.ts +34 -0
  381. package/lib/Cloudflare/KV/ReadWriteNamespaceLocal.d.ts.map +1 -0
  382. package/lib/Cloudflare/KV/ReadWriteNamespaceLocal.js +37 -0
  383. package/lib/Cloudflare/KV/ReadWriteNamespaceLocal.js.map +1 -0
  384. package/lib/Cloudflare/KV/WriteNamespaceHttp.d.ts +2 -2
  385. package/lib/Cloudflare/KV/WriteNamespaceHttp.d.ts.map +1 -1
  386. package/lib/Cloudflare/KV/WriteNamespaceHttp.js +5 -6
  387. package/lib/Cloudflare/KV/WriteNamespaceHttp.js.map +1 -1
  388. package/lib/Cloudflare/KV/WriteNamespaceLocal.d.ts +27 -0
  389. package/lib/Cloudflare/KV/WriteNamespaceLocal.d.ts.map +1 -0
  390. package/lib/Cloudflare/KV/WriteNamespaceLocal.js +30 -0
  391. package/lib/Cloudflare/KV/WriteNamespaceLocal.js.map +1 -0
  392. package/lib/Cloudflare/KV/index.d.ts +3 -0
  393. package/lib/Cloudflare/KV/index.d.ts.map +1 -1
  394. package/lib/Cloudflare/KV/index.js +3 -0
  395. package/lib/Cloudflare/KV/index.js.map +1 -1
  396. package/lib/Cloudflare/LoadBalancer/Monitor.d.ts.map +1 -1
  397. package/lib/Cloudflare/LoadBalancer/Monitor.js +4 -1
  398. package/lib/Cloudflare/LoadBalancer/Monitor.js.map +1 -1
  399. package/lib/Cloudflare/LoadBalancer/MonitorGroup.d.ts.map +1 -1
  400. package/lib/Cloudflare/LoadBalancer/MonitorGroup.js +4 -1
  401. package/lib/Cloudflare/LoadBalancer/MonitorGroup.js.map +1 -1
  402. package/lib/Cloudflare/LoadBalancer/Pool.d.ts.map +1 -1
  403. package/lib/Cloudflare/LoadBalancer/Pool.js +4 -1
  404. package/lib/Cloudflare/LoadBalancer/Pool.js.map +1 -1
  405. package/lib/Cloudflare/LocalRuntime.d.ts +14 -0
  406. package/lib/Cloudflare/LocalRuntime.d.ts.map +1 -1
  407. package/lib/Cloudflare/LocalRuntime.js +1 -0
  408. package/lib/Cloudflare/LocalRuntime.js.map +1 -1
  409. package/lib/Cloudflare/MagicNetworkMonitoring/Rule.d.ts.map +1 -1
  410. package/lib/Cloudflare/MagicNetworkMonitoring/Rule.js +4 -1
  411. package/lib/Cloudflare/MagicNetworkMonitoring/Rule.js.map +1 -1
  412. package/lib/Cloudflare/Pipelines/Pipeline.d.ts.map +1 -1
  413. package/lib/Cloudflare/Pipelines/Pipeline.js +8 -2
  414. package/lib/Cloudflare/Pipelines/Pipeline.js.map +1 -1
  415. package/lib/Cloudflare/Pipelines/Sink.d.ts.map +1 -1
  416. package/lib/Cloudflare/Pipelines/Sink.js +8 -2
  417. package/lib/Cloudflare/Pipelines/Sink.js.map +1 -1
  418. package/lib/Cloudflare/Pipelines/Stream.d.ts.map +1 -1
  419. package/lib/Cloudflare/Pipelines/Stream.js +4 -1
  420. package/lib/Cloudflare/Pipelines/Stream.js.map +1 -1
  421. package/lib/Cloudflare/Providers.js +14 -11
  422. package/lib/Cloudflare/Providers.js.map +1 -1
  423. package/lib/Cloudflare/Queues/Consumer.d.ts.map +1 -1
  424. package/lib/Cloudflare/Queues/Consumer.js +30 -3
  425. package/lib/Cloudflare/Queues/Consumer.js.map +1 -1
  426. package/lib/Cloudflare/Queues/Queue.d.ts.map +1 -1
  427. package/lib/Cloudflare/Queues/Queue.js +4 -1
  428. package/lib/Cloudflare/Queues/Queue.js.map +1 -1
  429. package/lib/Cloudflare/Queues/QueueHttp.d.ts +20 -1
  430. package/lib/Cloudflare/Queues/QueueHttp.d.ts.map +1 -1
  431. package/lib/Cloudflare/Queues/QueueHttp.js +2 -2
  432. package/lib/Cloudflare/Queues/QueueHttp.js.map +1 -1
  433. package/lib/Cloudflare/Queues/WriteQueueHttp.d.ts +9 -3
  434. package/lib/Cloudflare/Queues/WriteQueueHttp.d.ts.map +1 -1
  435. package/lib/Cloudflare/Queues/WriteQueueHttp.js +11 -6
  436. package/lib/Cloudflare/Queues/WriteQueueHttp.js.map +1 -1
  437. package/lib/Cloudflare/Queues/WriteQueueLocal.d.ts +36 -0
  438. package/lib/Cloudflare/Queues/WriteQueueLocal.d.ts.map +1 -0
  439. package/lib/Cloudflare/Queues/WriteQueueLocal.js +51 -0
  440. package/lib/Cloudflare/Queues/WriteQueueLocal.js.map +1 -0
  441. package/lib/Cloudflare/Queues/index.d.ts +1 -0
  442. package/lib/Cloudflare/Queues/index.d.ts.map +1 -1
  443. package/lib/Cloudflare/Queues/index.js +1 -0
  444. package/lib/Cloudflare/Queues/index.js.map +1 -1
  445. package/lib/Cloudflare/R2/Bucket.js +12 -3
  446. package/lib/Cloudflare/R2/Bucket.js.map +1 -1
  447. package/lib/Cloudflare/R2/BucketEventNotification.js +4 -1
  448. package/lib/Cloudflare/R2/BucketEventNotification.js.map +1 -1
  449. package/lib/Cloudflare/R2/BucketHttp.d.ts +15 -1
  450. package/lib/Cloudflare/R2/BucketHttp.d.ts.map +1 -1
  451. package/lib/Cloudflare/R2/BucketHttp.js +3 -3
  452. package/lib/Cloudflare/R2/BucketHttp.js.map +1 -1
  453. package/lib/Cloudflare/R2/BucketLocal.d.ts +21 -0
  454. package/lib/Cloudflare/R2/BucketLocal.d.ts.map +1 -0
  455. package/lib/Cloudflare/R2/BucketLocal.js +32 -0
  456. package/lib/Cloudflare/R2/BucketLocal.js.map +1 -0
  457. package/lib/Cloudflare/R2/DataCatalog.js +4 -1
  458. package/lib/Cloudflare/R2/DataCatalog.js.map +1 -1
  459. package/lib/Cloudflare/R2/ReadBucketHttp.d.ts +2 -2
  460. package/lib/Cloudflare/R2/ReadBucketHttp.d.ts.map +1 -1
  461. package/lib/Cloudflare/R2/ReadBucketHttp.js +4 -4
  462. package/lib/Cloudflare/R2/ReadBucketHttp.js.map +1 -1
  463. package/lib/Cloudflare/R2/ReadBucketLocal.d.ts +27 -0
  464. package/lib/Cloudflare/R2/ReadBucketLocal.d.ts.map +1 -0
  465. package/lib/Cloudflare/R2/ReadBucketLocal.js +30 -0
  466. package/lib/Cloudflare/R2/ReadBucketLocal.js.map +1 -0
  467. package/lib/Cloudflare/R2/ReadWriteBucketHttp.d.ts +2 -2
  468. package/lib/Cloudflare/R2/ReadWriteBucketHttp.d.ts.map +1 -1
  469. package/lib/Cloudflare/R2/ReadWriteBucketHttp.js +5 -4
  470. package/lib/Cloudflare/R2/ReadWriteBucketHttp.js.map +1 -1
  471. package/lib/Cloudflare/R2/ReadWriteBucketLocal.d.ts +30 -0
  472. package/lib/Cloudflare/R2/ReadWriteBucketLocal.d.ts.map +1 -0
  473. package/lib/Cloudflare/R2/ReadWriteBucketLocal.js +33 -0
  474. package/lib/Cloudflare/R2/ReadWriteBucketLocal.js.map +1 -0
  475. package/lib/Cloudflare/R2/WriteBucketHttp.d.ts +2 -2
  476. package/lib/Cloudflare/R2/WriteBucketHttp.d.ts.map +1 -1
  477. package/lib/Cloudflare/R2/WriteBucketHttp.js +4 -4
  478. package/lib/Cloudflare/R2/WriteBucketHttp.js.map +1 -1
  479. package/lib/Cloudflare/R2/WriteBucketLocal.d.ts +27 -0
  480. package/lib/Cloudflare/R2/WriteBucketLocal.d.ts.map +1 -0
  481. package/lib/Cloudflare/R2/WriteBucketLocal.js +30 -0
  482. package/lib/Cloudflare/R2/WriteBucketLocal.js.map +1 -0
  483. package/lib/Cloudflare/R2/index.d.ts +3 -0
  484. package/lib/Cloudflare/R2/index.d.ts.map +1 -1
  485. package/lib/Cloudflare/R2/index.js +3 -0
  486. package/lib/Cloudflare/R2/index.js.map +1 -1
  487. package/lib/Cloudflare/Rum/Rule.d.ts.map +1 -1
  488. package/lib/Cloudflare/Rum/Rule.js +4 -1
  489. package/lib/Cloudflare/Rum/Rule.js.map +1 -1
  490. package/lib/Cloudflare/Snippets/Snippet.d.ts.map +1 -1
  491. package/lib/Cloudflare/Snippets/Snippet.js +4 -1
  492. package/lib/Cloudflare/Snippets/Snippet.js.map +1 -1
  493. package/lib/Cloudflare/StateStore/Api.d.ts +2 -0
  494. package/lib/Cloudflare/StateStore/CredentialsFile.d.ts +42 -0
  495. package/lib/Cloudflare/StateStore/CredentialsFile.d.ts.map +1 -0
  496. package/lib/Cloudflare/StateStore/CredentialsFile.js +23 -0
  497. package/lib/Cloudflare/StateStore/CredentialsFile.js.map +1 -0
  498. package/lib/Cloudflare/StateStore/State.d.ts +2 -2
  499. package/lib/Cloudflare/StateStore/State.d.ts.map +1 -1
  500. package/lib/Cloudflare/StateStore/State.js +46 -9
  501. package/lib/Cloudflare/StateStore/State.js.map +1 -1
  502. package/lib/Cloudflare/Tags/ZoneResourceTags.d.ts.map +1 -1
  503. package/lib/Cloudflare/Tags/ZoneResourceTags.js +4 -1
  504. package/lib/Cloudflare/Tags/ZoneResourceTags.js.map +1 -1
  505. package/lib/Cloudflare/Tunnel/ReadTunnel.d.ts +3 -3
  506. package/lib/Cloudflare/Tunnel/ReadTunnel.d.ts.map +1 -1
  507. package/lib/Cloudflare/Tunnel/ReadTunnel.js +7 -8
  508. package/lib/Cloudflare/Tunnel/ReadTunnel.js.map +1 -1
  509. package/lib/Cloudflare/Tunnel/ReadTunnelLocal.d.ts +29 -0
  510. package/lib/Cloudflare/Tunnel/ReadTunnelLocal.d.ts.map +1 -0
  511. package/lib/Cloudflare/Tunnel/ReadTunnelLocal.js +30 -0
  512. package/lib/Cloudflare/Tunnel/ReadTunnelLocal.js.map +1 -0
  513. package/lib/Cloudflare/Tunnel/ReadWriteTunnel.d.ts +3 -3
  514. package/lib/Cloudflare/Tunnel/ReadWriteTunnel.d.ts.map +1 -1
  515. package/lib/Cloudflare/Tunnel/ReadWriteTunnel.js +4 -4
  516. package/lib/Cloudflare/Tunnel/ReadWriteTunnel.js.map +1 -1
  517. package/lib/Cloudflare/Tunnel/ReadWriteTunnelLocal.d.ts +35 -0
  518. package/lib/Cloudflare/Tunnel/ReadWriteTunnelLocal.d.ts.map +1 -0
  519. package/lib/Cloudflare/Tunnel/ReadWriteTunnelLocal.js +36 -0
  520. package/lib/Cloudflare/Tunnel/ReadWriteTunnelLocal.js.map +1 -0
  521. package/lib/Cloudflare/Tunnel/TunnelBinding.d.ts +17 -1
  522. package/lib/Cloudflare/Tunnel/TunnelBinding.d.ts.map +1 -1
  523. package/lib/Cloudflare/Tunnel/TunnelBinding.js +7 -1
  524. package/lib/Cloudflare/Tunnel/TunnelBinding.js.map +1 -1
  525. package/lib/Cloudflare/Tunnel/TunnelLocalBinding.d.ts +19 -0
  526. package/lib/Cloudflare/Tunnel/TunnelLocalBinding.d.ts.map +1 -0
  527. package/lib/Cloudflare/Tunnel/TunnelLocalBinding.js +29 -0
  528. package/lib/Cloudflare/Tunnel/TunnelLocalBinding.js.map +1 -0
  529. package/lib/Cloudflare/Tunnel/WarpConnector.d.ts +3 -3
  530. package/lib/Cloudflare/Tunnel/WarpConnector.d.ts.map +1 -1
  531. package/lib/Cloudflare/Tunnel/WarpConnector.js +7 -4
  532. package/lib/Cloudflare/Tunnel/WarpConnector.js.map +1 -1
  533. package/lib/Cloudflare/Tunnel/WriteTunnel.d.ts +3 -3
  534. package/lib/Cloudflare/Tunnel/WriteTunnel.d.ts.map +1 -1
  535. package/lib/Cloudflare/Tunnel/WriteTunnel.js +7 -8
  536. package/lib/Cloudflare/Tunnel/WriteTunnel.js.map +1 -1
  537. package/lib/Cloudflare/Tunnel/WriteTunnelLocal.d.ts +29 -0
  538. package/lib/Cloudflare/Tunnel/WriteTunnelLocal.d.ts.map +1 -0
  539. package/lib/Cloudflare/Tunnel/WriteTunnelLocal.js +30 -0
  540. package/lib/Cloudflare/Tunnel/WriteTunnelLocal.js.map +1 -0
  541. package/lib/Cloudflare/Tunnel/index.d.ts +3 -0
  542. package/lib/Cloudflare/Tunnel/index.d.ts.map +1 -1
  543. package/lib/Cloudflare/Tunnel/index.js +3 -0
  544. package/lib/Cloudflare/Tunnel/index.js.map +1 -1
  545. package/lib/Cloudflare/UrlNormalization/UrlNormalization.d.ts.map +1 -1
  546. package/lib/Cloudflare/UrlNormalization/UrlNormalization.js +7 -1
  547. package/lib/Cloudflare/UrlNormalization/UrlNormalization.js.map +1 -1
  548. package/lib/Cloudflare/Vectorize/SearchIndexHttpClient.d.ts +30 -0
  549. package/lib/Cloudflare/Vectorize/SearchIndexHttpClient.d.ts.map +1 -0
  550. package/lib/Cloudflare/Vectorize/SearchIndexHttpClient.js +100 -0
  551. package/lib/Cloudflare/Vectorize/SearchIndexHttpClient.js.map +1 -0
  552. package/lib/Cloudflare/Vectorize/SearchIndexLocal.d.ts +42 -0
  553. package/lib/Cloudflare/Vectorize/SearchIndexLocal.d.ts.map +1 -0
  554. package/lib/Cloudflare/Vectorize/SearchIndexLocal.js +58 -0
  555. package/lib/Cloudflare/Vectorize/SearchIndexLocal.js.map +1 -0
  556. package/lib/Cloudflare/Vectorize/index.d.ts +1 -0
  557. package/lib/Cloudflare/Vectorize/index.d.ts.map +1 -1
  558. package/lib/Cloudflare/Vectorize/index.js +1 -0
  559. package/lib/Cloudflare/Vectorize/index.js.map +1 -1
  560. package/lib/Cloudflare/WaitingRoom/Settings.d.ts.map +1 -1
  561. package/lib/Cloudflare/WaitingRoom/Settings.js +7 -1
  562. package/lib/Cloudflare/WaitingRoom/Settings.js.map +1 -1
  563. package/lib/Cloudflare/Website/Vite.d.ts +19 -0
  564. package/lib/Cloudflare/Website/Vite.d.ts.map +1 -1
  565. package/lib/Cloudflare/Website/Vite.js +20 -0
  566. package/lib/Cloudflare/Website/Vite.js.map +1 -1
  567. package/lib/Cloudflare/Workers/BrowserHttpClient.d.ts +32 -0
  568. package/lib/Cloudflare/Workers/BrowserHttpClient.d.ts.map +1 -0
  569. package/lib/Cloudflare/Workers/BrowserHttpClient.js +100 -0
  570. package/lib/Cloudflare/Workers/BrowserHttpClient.js.map +1 -0
  571. package/lib/Cloudflare/Workers/BrowserLocal.d.ts +37 -0
  572. package/lib/Cloudflare/Workers/BrowserLocal.d.ts.map +1 -0
  573. package/lib/Cloudflare/Workers/BrowserLocal.js +53 -0
  574. package/lib/Cloudflare/Workers/BrowserLocal.js.map +1 -0
  575. package/lib/Cloudflare/Workers/Compatibility.d.ts.map +1 -1
  576. package/lib/Cloudflare/Workers/Compatibility.js +43 -7
  577. package/lib/Cloudflare/Workers/Compatibility.js.map +1 -1
  578. package/lib/Cloudflare/Workers/ConfigProvider.d.ts +8 -0
  579. package/lib/Cloudflare/Workers/ConfigProvider.d.ts.map +1 -1
  580. package/lib/Cloudflare/Workers/ConfigProvider.js +10 -1
  581. package/lib/Cloudflare/Workers/ConfigProvider.js.map +1 -1
  582. package/lib/Cloudflare/Workers/CronEventSource.d.ts +3 -2
  583. package/lib/Cloudflare/Workers/CronEventSource.d.ts.map +1 -1
  584. package/lib/Cloudflare/Workers/CronEventSource.js.map +1 -1
  585. package/lib/Cloudflare/Workers/DurableObject.d.ts +137 -3
  586. package/lib/Cloudflare/Workers/DurableObject.d.ts.map +1 -1
  587. package/lib/Cloudflare/Workers/DurableObject.js +141 -6
  588. package/lib/Cloudflare/Workers/DurableObject.js.map +1 -1
  589. package/lib/Cloudflare/Workers/DurableObjectBridge.d.ts.map +1 -1
  590. package/lib/Cloudflare/Workers/DurableObjectBridge.js +86 -82
  591. package/lib/Cloudflare/Workers/DurableObjectBridge.js.map +1 -1
  592. package/lib/Cloudflare/Workers/HttpServer.d.ts +1 -4
  593. package/lib/Cloudflare/Workers/HttpServer.d.ts.map +1 -1
  594. package/lib/Cloudflare/Workers/HttpServer.js +1 -3
  595. package/lib/Cloudflare/Workers/HttpServer.js.map +1 -1
  596. package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts +2 -185
  597. package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
  598. package/lib/Cloudflare/Workers/LocalWorkerProvider.js +74 -11
  599. package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
  600. package/lib/Cloudflare/Workers/ObservabilityDestination.d.ts.map +1 -1
  601. package/lib/Cloudflare/Workers/ObservabilityDestination.js +4 -1
  602. package/lib/Cloudflare/Workers/ObservabilityDestination.js.map +1 -1
  603. package/lib/Cloudflare/Workers/Vite.d.ts +1 -1
  604. package/lib/Cloudflare/Workers/Vite.d.ts.map +1 -1
  605. package/lib/Cloudflare/Workers/Vite.js +81 -2
  606. package/lib/Cloudflare/Workers/Vite.js.map +1 -1
  607. package/lib/Cloudflare/Workers/Worker.d.ts +42 -6
  608. package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
  609. package/lib/Cloudflare/Workers/Worker.js +10 -5
  610. package/lib/Cloudflare/Workers/Worker.js.map +1 -1
  611. package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts.map +1 -1
  612. package/lib/Cloudflare/Workers/WorkerAsyncBindings.js +26 -16
  613. package/lib/Cloudflare/Workers/WorkerAsyncBindings.js.map +1 -1
  614. package/lib/Cloudflare/Workers/WorkerBinding.d.ts +22 -1
  615. package/lib/Cloudflare/Workers/WorkerBinding.d.ts.map +1 -1
  616. package/lib/Cloudflare/Workers/WorkerBinding.js.map +1 -1
  617. package/lib/Cloudflare/Workers/WorkerBridge.d.ts +13 -5
  618. package/lib/Cloudflare/Workers/WorkerBridge.d.ts.map +1 -1
  619. package/lib/Cloudflare/Workers/WorkerBridge.js +133 -52
  620. package/lib/Cloudflare/Workers/WorkerBridge.js.map +1 -1
  621. package/lib/Cloudflare/Workers/WorkerProvider.d.ts +81 -0
  622. package/lib/Cloudflare/Workers/WorkerProvider.d.ts.map +1 -1
  623. package/lib/Cloudflare/Workers/WorkerProvider.js +476 -68
  624. package/lib/Cloudflare/Workers/WorkerProvider.js.map +1 -1
  625. package/lib/Cloudflare/Workers/WorkerRuntimeContext.d.ts.map +1 -1
  626. package/lib/Cloudflare/Workers/WorkerRuntimeContext.js +11 -37
  627. package/lib/Cloudflare/Workers/WorkerRuntimeContext.js.map +1 -1
  628. package/lib/Cloudflare/Workers/cloudflare_workers.d.ts.map +1 -1
  629. package/lib/Cloudflare/Workers/cloudflare_workers.js +10 -3
  630. package/lib/Cloudflare/Workers/cloudflare_workers.js.map +1 -1
  631. package/lib/Cloudflare/Workers/index.d.ts +1 -0
  632. package/lib/Cloudflare/Workers/index.d.ts.map +1 -1
  633. package/lib/Cloudflare/Workers/index.js +1 -0
  634. package/lib/Cloudflare/Workers/index.js.map +1 -1
  635. package/lib/Cloudflare/Workflows/Workflow.d.ts +10 -7
  636. package/lib/Cloudflare/Workflows/Workflow.d.ts.map +1 -1
  637. package/lib/Cloudflare/Workflows/Workflow.js +38 -13
  638. package/lib/Cloudflare/Workflows/Workflow.js.map +1 -1
  639. package/lib/Cloudflare/Workflows/WorkflowBridge.d.ts.map +1 -1
  640. package/lib/Cloudflare/Workflows/WorkflowBridge.js +39 -37
  641. package/lib/Cloudflare/Workflows/WorkflowBridge.js.map +1 -1
  642. package/lib/Cloudflare/Workflows/WorkflowName.d.ts +11 -0
  643. package/lib/Cloudflare/Workflows/WorkflowName.d.ts.map +1 -0
  644. package/lib/Cloudflare/Workflows/WorkflowName.js +28 -0
  645. package/lib/Cloudflare/Workflows/WorkflowName.js.map +1 -0
  646. package/lib/Cloudflare/Zone/Hold.d.ts.map +1 -1
  647. package/lib/Cloudflare/Zone/Hold.js +7 -1
  648. package/lib/Cloudflare/Zone/Hold.js.map +1 -1
  649. package/lib/Command/Dev.d.ts +16 -6
  650. package/lib/Command/Dev.d.ts.map +1 -1
  651. package/lib/Command/Dev.js +37 -7
  652. package/lib/Command/Dev.js.map +1 -1
  653. package/lib/Diff.d.ts +16 -0
  654. package/lib/Diff.d.ts.map +1 -1
  655. package/lib/Diff.js +33 -0
  656. package/lib/Diff.js.map +1 -1
  657. package/lib/Docker/Container.js +4 -1
  658. package/lib/Docker/Container.js.map +1 -1
  659. package/lib/Drizzle/Postgres.d.ts +14 -13
  660. package/lib/Drizzle/Postgres.d.ts.map +1 -1
  661. package/lib/Drizzle/Postgres.js +39 -19
  662. package/lib/Drizzle/Postgres.js.map +1 -1
  663. package/lib/GitHub/AuthProvider.d.ts.map +1 -1
  664. package/lib/GitHub/AuthProvider.js +1 -1
  665. package/lib/GitHub/AuthProvider.js.map +1 -1
  666. package/lib/GitHub/Env.d.ts +20 -0
  667. package/lib/GitHub/Env.d.ts.map +1 -0
  668. package/lib/GitHub/Env.js +27 -0
  669. package/lib/GitHub/Env.js.map +1 -0
  670. package/lib/GitHub/Secrets.d.ts +1 -1
  671. package/lib/GitHub/Secrets.js +1 -1
  672. package/lib/GitHub/Variables.d.ts +1 -1
  673. package/lib/GitHub/Variables.js +1 -1
  674. package/lib/GitHub/index.d.ts +1 -0
  675. package/lib/GitHub/index.d.ts.map +1 -1
  676. package/lib/GitHub/index.js +1 -0
  677. package/lib/GitHub/index.js.map +1 -1
  678. package/lib/Http.d.ts +9 -0
  679. package/lib/Http.d.ts.map +1 -1
  680. package/lib/Http.js +9 -0
  681. package/lib/Http.js.map +1 -1
  682. package/lib/Local/RpcProviderProxy.js +1 -1
  683. package/lib/Local/RpcProviderProxy.js.map +1 -1
  684. package/lib/Local/RpcSerialization.d.ts.map +1 -1
  685. package/lib/Local/RpcSerialization.js +6 -2
  686. package/lib/Local/RpcSerialization.js.map +1 -1
  687. package/lib/Local/RpcSpawner.d.ts.map +1 -1
  688. package/lib/Local/RpcSpawner.js +14 -8
  689. package/lib/Local/RpcSpawner.js.map +1 -1
  690. package/lib/Neon/AuthProvider.d.ts.map +1 -1
  691. package/lib/Neon/AuthProvider.js +2 -2
  692. package/lib/Neon/AuthProvider.js.map +1 -1
  693. package/lib/Neon/Project.js +4 -1
  694. package/lib/Neon/Project.js.map +1 -1
  695. package/lib/Plan.d.ts.map +1 -1
  696. package/lib/Plan.js +37 -13
  697. package/lib/Plan.js.map +1 -1
  698. package/lib/Planetscale/AuthProvider.d.ts +26 -9
  699. package/lib/Planetscale/AuthProvider.d.ts.map +1 -1
  700. package/lib/Planetscale/AuthProvider.js +142 -11
  701. package/lib/Planetscale/AuthProvider.js.map +1 -1
  702. package/lib/Planetscale/Branch.d.ts.map +1 -1
  703. package/lib/Planetscale/Branch.js +4 -1
  704. package/lib/Planetscale/Branch.js.map +1 -1
  705. package/lib/Planetscale/Credentials.d.ts.map +1 -1
  706. package/lib/Planetscale/Credentials.js +14 -6
  707. package/lib/Planetscale/Credentials.js.map +1 -1
  708. package/lib/Planetscale/Database.d.ts +2 -1
  709. package/lib/Planetscale/Database.d.ts.map +1 -1
  710. package/lib/Planetscale/MySQL/MySQLClusterSize.d.ts +41 -3
  711. package/lib/Planetscale/MySQL/MySQLClusterSize.d.ts.map +1 -1
  712. package/lib/Planetscale/MySQL/MySQLClusterSize.js +88 -11
  713. package/lib/Planetscale/MySQL/MySQLClusterSize.js.map +1 -1
  714. package/lib/Planetscale/MySQL/MySQLDatabase.d.ts +14 -0
  715. package/lib/Planetscale/MySQL/MySQLDatabase.d.ts.map +1 -1
  716. package/lib/Planetscale/MySQL/MySQLDatabase.js +24 -11
  717. package/lib/Planetscale/MySQL/MySQLDatabase.js.map +1 -1
  718. package/lib/Planetscale/MySQL/MySQLMigrations.js +4 -1
  719. package/lib/Planetscale/MySQL/MySQLMigrations.js.map +1 -1
  720. package/lib/Planetscale/OAuthClient.d.ts +72 -0
  721. package/lib/Planetscale/OAuthClient.d.ts.map +1 -0
  722. package/lib/Planetscale/OAuthClient.js +227 -0
  723. package/lib/Planetscale/OAuthClient.js.map +1 -0
  724. package/lib/Planetscale/Postgres/PostgresClusterSize.d.ts.map +1 -1
  725. package/lib/Planetscale/Postgres/PostgresClusterSize.js +4 -1
  726. package/lib/Planetscale/Postgres/PostgresClusterSize.js.map +1 -1
  727. package/lib/Planetscale/Postgres/PostgresMigrations.js +4 -1
  728. package/lib/Planetscale/Postgres/PostgresMigrations.js.map +1 -1
  729. package/lib/Planetscale/Util.d.ts.map +1 -1
  730. package/lib/Planetscale/Util.js +4 -1
  731. package/lib/Planetscale/Util.js.map +1 -1
  732. package/lib/Platform.d.ts +2 -3
  733. package/lib/Platform.d.ts.map +1 -1
  734. package/lib/Platform.js +62 -3
  735. package/lib/Platform.js.map +1 -1
  736. package/lib/Provider.d.ts +35 -0
  737. package/lib/Provider.d.ts.map +1 -1
  738. package/lib/Provider.js.map +1 -1
  739. package/lib/Runtime.d.ts +23 -0
  740. package/lib/Runtime.d.ts.map +1 -1
  741. package/lib/Runtime.js +83 -0
  742. package/lib/Runtime.js.map +1 -1
  743. package/lib/RuntimeContext.d.ts +46 -0
  744. package/lib/RuntimeContext.d.ts.map +1 -1
  745. package/lib/RuntimeContext.js +60 -0
  746. package/lib/RuntimeContext.js.map +1 -1
  747. package/lib/Server/Process.d.ts +1 -1
  748. package/lib/Server/Process.d.ts.map +1 -1
  749. package/lib/Server/Process.js +8 -8
  750. package/lib/Server/Process.js.map +1 -1
  751. package/lib/Stack.js +1 -1
  752. package/lib/Stack.js.map +1 -1
  753. package/lib/State/HttpStateApi.d.ts +10 -10
  754. package/lib/State/HttpStateStore.js +5 -2
  755. package/lib/State/HttpStateStore.js.map +1 -1
  756. package/lib/Sync.d.ts.map +1 -1
  757. package/lib/Sync.js +3 -0
  758. package/lib/Sync.js.map +1 -1
  759. package/lib/Test/Alchemy.d.ts +74 -0
  760. package/lib/Test/Alchemy.d.ts.map +1 -0
  761. package/lib/Test/Alchemy.js +143 -0
  762. package/lib/Test/Alchemy.js.map +1 -0
  763. package/lib/Test/Http.d.ts.map +1 -1
  764. package/lib/Test/Http.js +8 -2
  765. package/lib/Test/Http.js.map +1 -1
  766. package/lib/Util/cached-function.d.ts +1 -1
  767. package/lib/Util/cached-function.d.ts.map +1 -1
  768. package/lib/Util/cached-function.js +2 -2
  769. package/lib/Util/cached-function.js.map +1 -1
  770. package/lib/Util/data.d.ts +6 -1
  771. package/lib/Util/data.d.ts.map +1 -1
  772. package/lib/Util/data.js.map +1 -1
  773. package/lib/Util/poll.js +1 -1
  774. package/lib/Util/poll.js.map +1 -1
  775. package/lib/Util/proxy-chain.js +3 -0
  776. package/lib/Util/proxy-chain.js.map +1 -1
  777. package/package.json +23 -23
  778. package/src/AWS/ACM/Certificate.ts +16 -12
  779. package/src/AWS/ApiGateway/common.ts +11 -8
  780. package/src/AWS/AuthProvider.ts +1 -4
  781. package/src/AWS/AutoScaling/AutoScalingGroup.ts +8 -6
  782. package/src/AWS/Bootstrap.ts +5 -6
  783. package/src/AWS/CloudFront/Distribution.ts +20 -16
  784. package/src/AWS/CloudFront/Function.ts +10 -6
  785. package/src/AWS/CloudFront/Invalidation.ts +4 -3
  786. package/src/AWS/CloudFront/KvEntries.ts +4 -3
  787. package/src/AWS/CloudFront/KvRoutesUpdate.ts +8 -6
  788. package/src/AWS/CloudFront/VpcOrigin.ts +12 -9
  789. package/src/AWS/CloudFront/common.ts +10 -6
  790. package/src/AWS/CloudWatch/AnomalyDetector.ts +4 -3
  791. package/src/AWS/CloudWatch/common.ts +1 -3
  792. package/src/AWS/DynamoDB/Table.ts +57 -47
  793. package/src/AWS/EC2/EIP.ts +6 -4
  794. package/src/AWS/EC2/EgressOnlyInternetGateway.ts +6 -4
  795. package/src/AWS/EC2/Instance.ts +12 -9
  796. package/src/AWS/EC2/InternetGateway.ts +18 -12
  797. package/src/AWS/EC2/NatGateway.ts +6 -10
  798. package/src/AWS/EC2/NetworkAcl.ts +6 -4
  799. package/src/AWS/EC2/NetworkAclEntry.ts +4 -3
  800. package/src/AWS/EC2/RouteTable.ts +12 -9
  801. package/src/AWS/EC2/RouteTableAssociation.ts +3 -5
  802. package/src/AWS/EC2/SecurityGroup.ts +10 -7
  803. package/src/AWS/EC2/Subnet.ts +15 -15
  804. package/src/AWS/EC2/Vpc.ts +12 -12
  805. package/src/AWS/EC2/VpcEndpoint.ts +6 -8
  806. package/src/AWS/EC2/hosted.ts +2 -1
  807. package/src/AWS/ECS/Service.ts +4 -3
  808. package/src/AWS/ECS/Task.ts +2 -1
  809. package/src/AWS/EKS/Addon.ts +8 -6
  810. package/src/AWS/EKS/Cluster.ts +4 -3
  811. package/src/AWS/ELBv2/TargetGroup.ts +4 -3
  812. package/src/AWS/ELBv2/TrustStore.ts +4 -3
  813. package/src/AWS/IAM/SAMLProvider.ts +4 -4
  814. package/src/AWS/IdentityCenter/AccountAssignment.ts +8 -6
  815. package/src/AWS/IdentityCenter/common.ts +1 -3
  816. package/src/AWS/KMS/Alias.ts +4 -3
  817. package/src/AWS/KMS/Key.ts +4 -3
  818. package/src/AWS/Kinesis/Stream.ts +2 -6
  819. package/src/AWS/Kinesis/StreamConsumer.ts +7 -12
  820. package/src/AWS/Lambda/Alias.ts +4 -3
  821. package/src/AWS/Lambda/EventInvokeConfig.ts +2 -6
  822. package/src/AWS/Lambda/EventSourceMapping.ts +10 -8
  823. package/src/AWS/Lambda/Function.ts +123 -77
  824. package/src/AWS/Lambda/MicrovmProvider.ts +18 -16
  825. package/src/AWS/Lambda/MicrovmRuntimeContext.ts +11 -38
  826. package/src/AWS/Lambda/NetworkConnector.ts +19 -15
  827. package/src/AWS/Lambda/RuntimeExtension.ts +46 -0
  828. package/src/AWS/Organizations/Account.ts +5 -6
  829. package/src/AWS/Organizations/common.ts +1 -3
  830. package/src/AWS/Providers.ts +22 -20
  831. package/src/AWS/RDS/DBCluster.ts +8 -6
  832. package/src/AWS/RDS/DBInstance.ts +8 -6
  833. package/src/AWS/RDS/DBProxy.ts +4 -3
  834. package/src/AWS/RDS/DBProxyEndpoint.ts +4 -3
  835. package/src/AWS/Route53/HealthCheck.ts +8 -6
  836. package/src/AWS/Route53/HostedZone.ts +8 -6
  837. package/src/AWS/Route53/Record.ts +4 -3
  838. package/src/AWS/S3/Bucket.ts +5 -4
  839. package/src/AWS/SQS/Queue.ts +26 -20
  840. package/src/AWS/StateStore/State.ts +5 -4
  841. package/src/AWS/Website/AssetDeployment.ts +10 -6
  842. package/src/Action.ts +39 -6
  843. package/src/ActionRuntimeContext.ts +68 -0
  844. package/src/Apply.ts +54 -8
  845. package/src/Auth/AuthProvider.ts +11 -0
  846. package/src/Auth/Lock.ts +5 -2
  847. package/src/Axiom/AuthProvider.ts +0 -3
  848. package/src/Bundle/PurePlugin.ts +34 -1
  849. package/src/Bundle/Vite.ts +67 -16
  850. package/src/Cli/LoggingCli.ts +7 -4
  851. package/src/Cli/commands/_shared.ts +171 -5
  852. package/src/Cli/commands/login.ts +91 -46
  853. package/src/Cli/commands/logs.ts +1 -0
  854. package/src/Cli/commands/nuke.ts +16 -44
  855. package/src/Cli/commands/profile.ts +67 -39
  856. package/src/Cli/commands/tail.ts +1 -0
  857. package/src/Cloudflare/AI/GatewayDynamicRouting.ts +38 -6
  858. package/src/Cloudflare/AI/LanguageModel.ts +25 -5
  859. package/src/Cloudflare/AI/QuerySearchLocal.ts +66 -0
  860. package/src/Cloudflare/AI/QuerySearchNamespaceLocal.ts +60 -0
  861. package/src/Cloudflare/AI/SearchHttpClient.ts +423 -0
  862. package/src/Cloudflare/AI/SearchInstance.ts +4 -3
  863. package/src/Cloudflare/AI/index.ts +2 -0
  864. package/src/Cloudflare/Access/Application.ts +7 -4
  865. package/src/Cloudflare/Alerting/Silence.ts +4 -3
  866. package/src/Cloudflare/Alerting/Webhook.ts +8 -6
  867. package/src/Cloudflare/Auth/AuthProvider.ts +55 -39
  868. package/src/Cloudflare/Auth/OAuthClient.ts +6 -7
  869. package/src/Cloudflare/Cache/RegionalTieredCache.ts +7 -4
  870. package/src/Cloudflare/Containers/ContainerApplication.ts +22 -2
  871. package/src/Cloudflare/Containers/ContainerBundle.ts +110 -34
  872. package/src/Cloudflare/Containers/ContainerPlatform.ts +14 -52
  873. package/src/Cloudflare/Containers/ContainerProvider.ts +73 -19
  874. package/src/Cloudflare/Containers/LocalContainerProvider.ts +78 -72
  875. package/src/Cloudflare/D1/QueryDatabaseHttpClient.ts +176 -0
  876. package/src/Cloudflare/D1/QueryDatabaseLocal.ts +66 -0
  877. package/src/Cloudflare/D1/index.ts +1 -0
  878. package/src/Cloudflare/DNS/DnsHttp.ts +24 -2
  879. package/src/Cloudflare/DNS/DnsLocal.ts +41 -0
  880. package/src/Cloudflare/DNS/ReadDnsHttp.ts +4 -5
  881. package/src/Cloudflare/DNS/ReadDnsLocal.ts +38 -0
  882. package/src/Cloudflare/DNS/ReadWriteDnsHttp.ts +5 -5
  883. package/src/Cloudflare/DNS/ReadWriteDnsLocal.ts +46 -0
  884. package/src/Cloudflare/DNS/WriteDnsHttp.ts +4 -5
  885. package/src/Cloudflare/DNS/WriteDnsLocal.ts +44 -0
  886. package/src/Cloudflare/DNS/index.ts +3 -0
  887. package/src/Cloudflare/Diagnostics/EndpointHealthcheck.ts +4 -3
  888. package/src/Cloudflare/Flagship/ReadFlagsHttpClient.ts +183 -0
  889. package/src/Cloudflare/Flagship/ReadFlagsLocal.ts +69 -0
  890. package/src/Cloudflare/Flagship/index.ts +1 -0
  891. package/src/Cloudflare/Images/Variant.ts +4 -3
  892. package/src/Cloudflare/KV/NamespaceHttp.ts +25 -2
  893. package/src/Cloudflare/KV/NamespaceLocal.ts +42 -0
  894. package/src/Cloudflare/KV/ReadNamespaceHttp.ts +7 -6
  895. package/src/Cloudflare/KV/ReadNamespaceLocal.ts +35 -0
  896. package/src/Cloudflare/KV/ReadWriteNamespaceHttp.ts +11 -6
  897. package/src/Cloudflare/KV/ReadWriteNamespaceLocal.ts +42 -0
  898. package/src/Cloudflare/KV/WriteNamespaceHttp.ts +7 -6
  899. package/src/Cloudflare/KV/WriteNamespaceLocal.ts +35 -0
  900. package/src/Cloudflare/KV/index.ts +3 -0
  901. package/src/Cloudflare/LoadBalancer/Monitor.ts +4 -3
  902. package/src/Cloudflare/LoadBalancer/MonitorGroup.ts +4 -3
  903. package/src/Cloudflare/LoadBalancer/Pool.ts +4 -3
  904. package/src/Cloudflare/LocalRuntime.ts +17 -0
  905. package/src/Cloudflare/MagicNetworkMonitoring/Rule.ts +4 -3
  906. package/src/Cloudflare/Pipelines/Pipeline.ts +8 -6
  907. package/src/Cloudflare/Pipelines/Sink.ts +8 -6
  908. package/src/Cloudflare/Pipelines/Stream.ts +4 -3
  909. package/src/Cloudflare/Providers.ts +21 -19
  910. package/src/Cloudflare/Queues/Consumer.ts +45 -9
  911. package/src/Cloudflare/Queues/Queue.ts +4 -3
  912. package/src/Cloudflare/Queues/QueueHttp.ts +24 -2
  913. package/src/Cloudflare/Queues/WriteQueueHttp.ts +16 -7
  914. package/src/Cloudflare/Queues/WriteQueueLocal.ts +64 -0
  915. package/src/Cloudflare/Queues/index.ts +1 -0
  916. package/src/Cloudflare/R2/Bucket.ts +12 -9
  917. package/src/Cloudflare/R2/BucketEventNotification.ts +4 -3
  918. package/src/Cloudflare/R2/BucketHttp.ts +20 -3
  919. package/src/Cloudflare/R2/BucketLocal.ts +47 -0
  920. package/src/Cloudflare/R2/DataCatalog.ts +4 -3
  921. package/src/Cloudflare/R2/ReadBucketHttp.ts +10 -5
  922. package/src/Cloudflare/R2/ReadBucketLocal.ts +33 -0
  923. package/src/Cloudflare/R2/ReadWriteBucketHttp.ts +11 -5
  924. package/src/Cloudflare/R2/ReadWriteBucketLocal.ts +36 -0
  925. package/src/Cloudflare/R2/WriteBucketHttp.ts +10 -5
  926. package/src/Cloudflare/R2/WriteBucketLocal.ts +33 -0
  927. package/src/Cloudflare/R2/index.ts +3 -0
  928. package/src/Cloudflare/Rum/Rule.ts +4 -3
  929. package/src/Cloudflare/Snippets/Snippet.ts +4 -3
  930. package/src/Cloudflare/StateStore/CredentialsFile.ts +48 -0
  931. package/src/Cloudflare/StateStore/State.ts +61 -25
  932. package/src/Cloudflare/Tags/ZoneResourceTags.ts +4 -3
  933. package/src/Cloudflare/Tunnel/ReadTunnel.ts +8 -9
  934. package/src/Cloudflare/Tunnel/ReadTunnelLocal.ts +33 -0
  935. package/src/Cloudflare/Tunnel/ReadWriteTunnel.ts +5 -5
  936. package/src/Cloudflare/Tunnel/ReadWriteTunnelLocal.ts +39 -0
  937. package/src/Cloudflare/Tunnel/TunnelBinding.ts +26 -2
  938. package/src/Cloudflare/Tunnel/TunnelLocalBinding.ts +38 -0
  939. package/src/Cloudflare/Tunnel/WarpConnector.ts +8 -5
  940. package/src/Cloudflare/Tunnel/WriteTunnel.ts +8 -9
  941. package/src/Cloudflare/Tunnel/WriteTunnelLocal.ts +33 -0
  942. package/src/Cloudflare/Tunnel/index.ts +3 -0
  943. package/src/Cloudflare/UrlNormalization/UrlNormalization.ts +7 -4
  944. package/src/Cloudflare/Vectorize/SearchIndexHttpClient.ts +183 -0
  945. package/src/Cloudflare/Vectorize/SearchIndexLocal.ts +70 -0
  946. package/src/Cloudflare/Vectorize/index.ts +1 -0
  947. package/src/Cloudflare/WaitingRoom/Settings.ts +7 -4
  948. package/src/Cloudflare/Website/Vite.ts +20 -0
  949. package/src/Cloudflare/Workers/BrowserHttpClient.ts +201 -0
  950. package/src/Cloudflare/Workers/BrowserLocal.ts +65 -0
  951. package/src/Cloudflare/Workers/Compatibility.ts +50 -7
  952. package/src/Cloudflare/Workers/ConfigProvider.ts +15 -1
  953. package/src/Cloudflare/Workers/CronEventSource.ts +3 -2
  954. package/src/Cloudflare/Workers/DurableObject.ts +227 -6
  955. package/src/Cloudflare/Workers/DurableObjectBridge.ts +38 -33
  956. package/src/Cloudflare/Workers/HttpServer.ts +1 -4
  957. package/src/Cloudflare/Workers/LocalWorkerProvider.ts +132 -26
  958. package/src/Cloudflare/Workers/ObservabilityDestination.ts +4 -3
  959. package/src/Cloudflare/Workers/Vite.ts +93 -11
  960. package/src/Cloudflare/Workers/Worker.ts +46 -6
  961. package/src/Cloudflare/Workers/WorkerAsyncBindings.ts +33 -21
  962. package/src/Cloudflare/Workers/WorkerBinding.ts +20 -1
  963. package/src/Cloudflare/Workers/WorkerBridge.ts +239 -108
  964. package/src/Cloudflare/Workers/WorkerProvider.ts +689 -135
  965. package/src/Cloudflare/Workers/WorkerRuntimeContext.ts +14 -45
  966. package/src/Cloudflare/Workers/cloudflare_workers.ts +20 -12
  967. package/src/Cloudflare/Workers/index.ts +1 -0
  968. package/src/Cloudflare/Workflows/Workflow.ts +54 -20
  969. package/src/Cloudflare/Workflows/WorkflowBridge.ts +19 -23
  970. package/src/Cloudflare/Workflows/WorkflowName.ts +41 -0
  971. package/src/Cloudflare/Zone/Hold.ts +7 -4
  972. package/src/Command/Dev.ts +42 -10
  973. package/src/Diff.ts +33 -0
  974. package/src/Docker/Container.ts +4 -1
  975. package/src/Drizzle/Postgres.ts +51 -23
  976. package/src/GitHub/AuthProvider.ts +0 -3
  977. package/src/GitHub/Env.ts +57 -0
  978. package/src/GitHub/Secrets.ts +1 -1
  979. package/src/GitHub/Variables.ts +1 -1
  980. package/src/GitHub/index.ts +1 -0
  981. package/src/Http.ts +11 -0
  982. package/src/Local/RpcProviderProxy.ts +1 -1
  983. package/src/Local/RpcSerialization.ts +6 -2
  984. package/src/Local/RpcSpawner.ts +21 -8
  985. package/src/Neon/AuthProvider.ts +1 -4
  986. package/src/Neon/Project.ts +2 -2
  987. package/src/Plan.ts +43 -13
  988. package/src/Planetscale/AuthProvider.ts +267 -27
  989. package/src/Planetscale/Branch.ts +4 -3
  990. package/src/Planetscale/Credentials.ts +18 -6
  991. package/src/Planetscale/Database.ts +2 -1
  992. package/src/Planetscale/MySQL/MySQLClusterSize.ts +120 -21
  993. package/src/Planetscale/MySQL/MySQLDatabase.ts +84 -44
  994. package/src/Planetscale/MySQL/MySQLMigrations.ts +4 -3
  995. package/src/Planetscale/OAuthClient.ts +307 -0
  996. package/src/Planetscale/Postgres/PostgresClusterSize.ts +4 -3
  997. package/src/Planetscale/Postgres/PostgresMigrations.ts +4 -3
  998. package/src/Planetscale/Util.ts +4 -3
  999. package/src/Platform.ts +83 -7
  1000. package/src/Provider.ts +35 -0
  1001. package/src/Runtime.ts +92 -0
  1002. package/src/RuntimeContext.ts +79 -0
  1003. package/src/Server/Process.ts +11 -18
  1004. package/src/Stack.ts +1 -1
  1005. package/src/State/HttpStateStore.ts +5 -5
  1006. package/src/Sync.ts +3 -0
  1007. package/src/Test/Alchemy.ts +282 -0
  1008. package/src/Test/Http.ts +8 -6
  1009. package/src/Util/cached-function.ts +5 -5
  1010. package/src/Util/data.ts +14 -5
  1011. package/src/Util/poll.ts +1 -1
  1012. package/src/Util/proxy-chain.ts +3 -0
  1013. package/lib/ExecutionContext.d.ts +0 -18
  1014. package/lib/ExecutionContext.d.ts.map +0 -1
  1015. package/lib/ExecutionContext.js +0 -10
  1016. package/lib/ExecutionContext.js.map +0 -1
  1017. package/src/ExecutionContext.ts +0 -18
@@ -1,3 +1,4 @@
1
+ import * as durableObjectsApi from "@distilled.cloud/cloudflare/durable-objects";
1
2
  import * as workers from "@distilled.cloud/cloudflare/workers";
2
3
  import * as wfp from "@distilled.cloud/cloudflare/workers-for-platforms";
3
4
  import * as zones from "@distilled.cloud/cloudflare/zones";
@@ -12,7 +13,7 @@ import * as crypto from "node:crypto";
12
13
  import { Unowned } from "../../AdoptPolicy.ts";
13
14
  import * as Artifacts from "../../Artifacts.ts";
14
15
  import type { ScopedPlanStatusSession } from "../../Cli/Cli.ts";
15
- import { hashDirectory } from "../../Command/Memo.ts";
16
+ import { hashDirectory, type MemoOptions } from "../../Command/Memo.ts";
16
17
  import { isResolved } from "../../Diff.ts";
17
18
  import * as ProviderLayer from "../../Local/ProviderLayer.ts";
18
19
  import * as Provider from "../../Provider.ts";
@@ -26,7 +27,12 @@ import { readAssets, uploadAssets } from "./Assets.ts";
26
27
  import { getCompatibility } from "./Compatibility.ts";
27
28
  import { isDurableObjectExport } from "./DurableObject.ts";
28
29
  import { LocalWorkerProvider } from "./LocalWorkerProvider.ts";
29
- import { Worker, type WorkerProps, type WorkerRouteConfig } from "./Worker.ts";
30
+ import {
31
+ Worker,
32
+ type ViteOptions,
33
+ type WorkerProps,
34
+ type WorkerRouteConfig,
35
+ } from "./Worker.ts";
30
36
  import { getCacheBinding, getCronBindings } from "./WorkerAsyncBindings.ts";
31
37
  import type { WorkerBinding, WorkerSettingsBinding } from "./WorkerBinding.ts";
32
38
  import { readPrebuiltWorkerBundle, WorkerBundle } from "./WorkerBundle.ts";
@@ -37,6 +43,65 @@ class MissingDurableObjects extends Data.TaggedError("MissingDurableObjects")<{
37
43
  expected: string[];
38
44
  }> {}
39
45
 
46
+ /**
47
+ * A Durable Object class is being dropped from this Worker while a binding in
48
+ * the same deploy still references it on another script — the class moved
49
+ * cross-script, but its namespace (and every stored object in it) still lives
50
+ * on this Worker. Cloudflare rejects a single upload that both deletes the
51
+ * class and ships a binding referencing it, and silently deleting would
52
+ * destroy the namespace's data irreversibly, so the deploy fails before any
53
+ * upload.
54
+ *
55
+ * Moving a Durable Object class between Workers is always declared: set
56
+ * `transferredFrom` on the Durable Object at its **new host** — naming the
57
+ * former host by Worker logical id (same stack) or physical script name — and
58
+ * Alchemy performs the data-preserving `transferred_classes` migration on the
59
+ * new host's deploy; this deploy then converges on its own. To abandon the
60
+ * data instead, remove the binding entirely in one deploy (which deletes the
61
+ * class and its data), then add the cross-script binding in a second deploy.
62
+ */
63
+ export class DurableObjectTransferRequired extends Data.TaggedError(
64
+ "DurableObjectTransferRequired",
65
+ )<{
66
+ scriptName: string;
67
+ className: string;
68
+ targetScriptName: string | undefined;
69
+ }> {
70
+ override get message() {
71
+ return (
72
+ `Durable Object class '${this.className}' still lives on Worker '${this.scriptName}' but this deploy re-binds it as a cross-script reference` +
73
+ (this.targetScriptName ? ` to '${this.targetScriptName}'` : "") +
74
+ ". Durable Object data does NOT move with the class automatically. " +
75
+ `To move the data, set transferredFrom: "${this.scriptName}" (the former host's script name, or its Worker logical id for same-stack moves) on the Durable Object declaration in its new host Worker. ` +
76
+ "To abandon the data, remove the binding entirely in one deploy before re-adding it as a cross-script reference."
77
+ );
78
+ }
79
+ }
80
+
81
+ /**
82
+ * More than one script matches the `transferredFrom` declaration of a Durable
83
+ * Object (e.g. an orphaned script left behind by a `name` prop change still
84
+ * carries the same alchemy tags, or the host history lists several scripts
85
+ * that each still hold a same-class namespace). Alchemy refuses to guess
86
+ * which namespace's data to move — narrow the declaration to the exact
87
+ * physical script name that holds the data.
88
+ */
89
+ export class AmbiguousDurableObjectTransfer extends Data.TaggedError(
90
+ "AmbiguousDurableObjectTransfer",
91
+ )<{
92
+ scriptName: string;
93
+ logicalId: string;
94
+ className: string;
95
+ sources: string[];
96
+ }> {
97
+ override get message() {
98
+ return (
99
+ `Durable Object '${this.logicalId}' (class '${this.className}') is new to Worker '${this.scriptName}' and multiple scripts match its transferredFrom declaration: ${this.sources.join(", ")}. ` +
100
+ `Narrow transferredFrom to the exact physical script name that holds the data.`
101
+ );
102
+ }
103
+ }
104
+
40
105
  /**
41
106
  * Resolve the Workers for Platforms dispatch-namespace *name* from a resolved
42
107
  * `namespace` prop or persisted attribute. The engine resolves a passed
@@ -125,7 +190,7 @@ const isBindingTargetNotFound = (
125
190
  e._tag === "MtlsCertificateNotFound";
126
191
 
127
192
  const bindingTargetNotFoundRetrySchedule = () =>
128
- Schedule.fixed("2 seconds").pipe(Schedule.both(Schedule.recurs(10)));
193
+ Schedule.max([Schedule.fixed("2 seconds"), Schedule.recurs(10)]);
129
194
 
130
195
  /**
131
196
  * Upsert a Worker script, routing to the dispatch-namespace endpoint when
@@ -488,9 +553,10 @@ export const LiveWorkerProvider = () =>
488
553
  .pipe(
489
554
  Effect.retry({
490
555
  while: (error) => error._tag === "WorkerNotFound",
491
- schedule: Schedule.exponential(200).pipe(
492
- Schedule.both(Schedule.recurs(15)),
493
- ),
556
+ schedule: Schedule.max([
557
+ Schedule.exponential(200),
558
+ Schedule.recurs(15),
559
+ ]),
494
560
  }),
495
561
  );
496
562
  return normalizeCrons(
@@ -640,9 +706,10 @@ export const LiveWorkerProvider = () =>
640
706
  .pipe(
641
707
  Effect.retry({
642
708
  while: (error) => error._tag === "WorkerNotFound",
643
- schedule: Schedule.exponential(200).pipe(
644
- Schedule.both(Schedule.recurs(15)),
645
- ),
709
+ schedule: Schedule.max([
710
+ Schedule.exponential(200),
711
+ Schedule.recurs(15),
712
+ ]),
646
713
  }),
647
714
  );
648
715
  return {
@@ -841,9 +908,10 @@ export const LiveWorkerProvider = () =>
841
908
  // typed as `RouteScriptNotFound` via the createRoute patch.
842
909
  Effect.retry({
843
910
  while: (error) => error._tag === "RouteScriptNotFound",
844
- schedule: Schedule.exponential(200).pipe(
845
- Schedule.both(Schedule.recurs(15)),
846
- ),
911
+ schedule: Schedule.max([
912
+ Schedule.exponential(200),
913
+ Schedule.recurs(15),
914
+ ]),
847
915
  }),
848
916
  Effect.catchTag("InvalidRoute", (originalError) =>
849
917
  Effect.gen(function* () {
@@ -892,6 +960,79 @@ export const LiveWorkerProvider = () =>
892
960
  return createAlchemyWorkerTags(id).every((tag) => actualTags.has(tag));
893
961
  };
894
962
 
963
+ /**
964
+ * Resolve the source script of a declared Durable Object transfer for
965
+ * a class that is new to `selfScriptName`. `sources` is the
966
+ * `transferredFrom` host history: each entry names a former host either
967
+ * by *physical script name* or by *Worker logical id* in this stack +
968
+ * stage (matched via the `alchemy:id:`/stack/stage ownership tags).
969
+ * The namespace is transferred from whichever listed host currently
970
+ * holds a same-class namespace; when none does (fresh stage, or every
971
+ * transfer already completed) this returns `undefined` and the caller
972
+ * creates the class fresh — the declaration is inert and safe to keep.
973
+ * More than one match (e.g. an orphaned script from a `name` change)
974
+ * fails with {@link AmbiguousDurableObjectTransfer} rather than
975
+ * guessing whose data to move.
976
+ */
977
+ const resolveTransferSource = Effect.fn(function* (params: {
978
+ accountId: string;
979
+ selfScriptName: string;
980
+ logicalId: string;
981
+ className: string;
982
+ sources: readonly string[];
983
+ observedNamespaces: readonly { script: string; class: string }[];
984
+ }) {
985
+ if (params.sources.length === 0) {
986
+ return undefined;
987
+ }
988
+ const candidates = Array.from(
989
+ new Set(
990
+ params.observedNamespaces.flatMap((ns) =>
991
+ ns.class === params.className &&
992
+ ns.script !== params.selfScriptName
993
+ ? [ns.script]
994
+ : [],
995
+ ),
996
+ ),
997
+ );
998
+ const matched: string[] = [];
999
+ for (const script of candidates) {
1000
+ if (params.sources.includes(script)) {
1001
+ matched.push(script);
1002
+ continue;
1003
+ }
1004
+ const settings = yield* getScriptSettings(
1005
+ params.accountId,
1006
+ script,
1007
+ undefined,
1008
+ ).pipe(
1009
+ Effect.catchTag("WorkerNotFound", () => Effect.succeed(undefined)),
1010
+ Effect.catchTag("WorkerHasNoVersions", () =>
1011
+ Effect.succeed(undefined),
1012
+ ),
1013
+ );
1014
+ const tags = new Set(settings?.tags ?? []);
1015
+ if (
1016
+ tags.has(`alchemy:stack:${stack.name}`) &&
1017
+ tags.has(`alchemy:stage:${stack.stage}`) &&
1018
+ params.sources.some((source) => tags.has(`alchemy:id:${source}`))
1019
+ ) {
1020
+ matched.push(script);
1021
+ }
1022
+ }
1023
+ if (matched.length > 1) {
1024
+ return yield* Effect.fail(
1025
+ new AmbiguousDurableObjectTransfer({
1026
+ scriptName: params.selfScriptName,
1027
+ logicalId: params.logicalId,
1028
+ className: params.className,
1029
+ sources: matched,
1030
+ }),
1031
+ );
1032
+ }
1033
+ return matched[0];
1034
+ });
1035
+
895
1036
  const getDurableObjects = (
896
1037
  bindings: readonly WorkerSettingsBinding[] | null | undefined,
897
1038
  ) => {
@@ -968,9 +1109,10 @@ export const LiveWorkerProvider = () =>
968
1109
  error._tag === "WorkerNotFound" ||
969
1110
  error._tag === "DispatchNamespaceScriptNotFound" ||
970
1111
  error._tag === "DispatchNamespaceNotFound",
971
- schedule: Schedule.exponential(100).pipe(
972
- Schedule.both(Schedule.recurs(20)),
973
- ),
1112
+ schedule: Schedule.max([
1113
+ Schedule.exponential(100),
1114
+ Schedule.recurs(20),
1115
+ ]),
974
1116
  }),
975
1117
  );
976
1118
  });
@@ -1027,40 +1169,42 @@ export const LiveWorkerProvider = () =>
1027
1169
  // (~0.5s), which is only needed for vite-based workers at build time —
1028
1170
  // not for every Worker definition at module-load time.
1029
1171
  const Vite = yield* Effect.promise(() => import("./Vite.ts"));
1030
- const { clientDirectory, serverBundle } = yield* Vite.viteBuild(
1031
- props.vite?.rootDir,
1032
- Object.fromEntries(
1033
- (yield* Effect.all(
1034
- Object.entries(props.env ?? {}).map(
1035
- Effect.fn(function* ([key, value]) {
1036
- return [
1037
- key,
1038
- typeof value === "string"
1039
- ? value
1040
- : Redacted.isRedacted(value) &&
1041
- typeof Redacted.value(value) === "string"
1042
- ? Redacted.value(value)
1043
- : // A `WorkerLoader` is a real Effect that also carries
1044
- // the `~alchemy/Kind` marker — it is a binding, not a
1045
- // runnable env value. Check it before `Effect.isEffect`
1046
- // so we don't execute it as an inlined env entry.
1047
- isWorkerLoader(value)
1048
- ? undefined
1049
- : Effect.isEffect(value)
1050
- ? yield* value as any as Effect.Effect<any>
1051
- : undefined,
1052
- ];
1053
- }),
1054
- ),
1055
- )).filter(([_, value]) => value !== undefined),
1056
- ),
1057
- {
1058
- compatibilityDate: compatibility.date,
1059
- compatibilityFlags: compatibility.flags,
1060
- viteEnvironments: props.vite?.viteEnvironments,
1061
- },
1062
- );
1063
- const [assets, bundle] = yield* Effect.all(
1172
+ const { clientDirectory, serverBundle, externalWorkspaces } =
1173
+ yield* Vite.viteBuild(
1174
+ props.vite?.rootDir,
1175
+ Object.fromEntries(
1176
+ (yield* Effect.all(
1177
+ Object.entries(props.env ?? {}).map(
1178
+ Effect.fn(function* ([key, value]) {
1179
+ return [
1180
+ key,
1181
+ typeof value === "string"
1182
+ ? value
1183
+ : Redacted.isRedacted(value) &&
1184
+ typeof Redacted.value(value) === "string"
1185
+ ? Redacted.value(value)
1186
+ : // A `WorkerLoader` is a real Effect that also carries
1187
+ // the `~alchemy/Kind` marker — it is a binding, not a
1188
+ // runnable env value. Check it before `Effect.isEffect`
1189
+ // so we don't execute it as an inlined env entry.
1190
+ isWorkerLoader(value)
1191
+ ? undefined
1192
+ : Effect.isEffect(value)
1193
+ ? yield* value as any as Effect.Effect<any>
1194
+ : undefined,
1195
+ ];
1196
+ }),
1197
+ ),
1198
+ )).filter(([_, value]) => value !== undefined),
1199
+ ),
1200
+ {
1201
+ main: props.vite?.main,
1202
+ compatibilityDate: compatibility.date,
1203
+ compatibilityFlags: compatibility.flags,
1204
+ viteEnvironments: props.vite?.viteEnvironments,
1205
+ },
1206
+ );
1207
+ const [assets, bundle, input] = yield* Effect.all(
1064
1208
  [
1065
1209
  clientDirectory
1066
1210
  ? readAssets({
@@ -1074,6 +1218,11 @@ export const LiveWorkerProvider = () =>
1074
1218
  })
1075
1219
  : Effect.undefined,
1076
1220
  serverBundle,
1221
+ hashViteInput(
1222
+ props.vite?.rootDir,
1223
+ props.vite?.memo,
1224
+ externalWorkspaces,
1225
+ ),
1077
1226
  ],
1078
1227
  { concurrency: "unbounded" },
1079
1228
  );
@@ -1082,7 +1231,56 @@ export const LiveWorkerProvider = () =>
1082
1231
  new Error("Vite build produced neither assets nor server output"),
1083
1232
  );
1084
1233
  }
1085
- return { assets, bundle };
1234
+ return {
1235
+ assets,
1236
+ bundle,
1237
+ input: input.hash,
1238
+ additionalWorkspaces: input.workspaces,
1239
+ };
1240
+ });
1241
+
1242
+ const hashViteInput = Effect.fn(function* <E>(
1243
+ rootDir: string = process.cwd(),
1244
+ options: ViteOptions["memo"],
1245
+ additionalWorkspaces: Effect.Effect<Iterable<string>, E>,
1246
+ ) {
1247
+ const hashWorkspaceDirectory = (cwd: string, memo?: MemoOptions) =>
1248
+ hashDirectory({ cwd: path.resolve(rootDir, cwd), memo }).pipe(
1249
+ Effect.map((hash) => `${path.relative(rootDir, cwd)}:${hash}`),
1250
+ );
1251
+ const hashRoot = hashWorkspaceDirectory(rootDir, options);
1252
+ if (Array.isArray(options?.workspaces)) {
1253
+ return yield* Effect.all(
1254
+ [
1255
+ hashRoot,
1256
+ ...options.workspaces.map(({ cwd, ...options }) =>
1257
+ hashWorkspaceDirectory(cwd, options),
1258
+ ),
1259
+ ],
1260
+ { concurrency: "unbounded" },
1261
+ ).pipe(
1262
+ Effect.flatMap(([root, ...workspaces]) =>
1263
+ sha256Object([root, ...workspaces.sort()]),
1264
+ ),
1265
+ Effect.map((hash) => ({ hash, workspaces: undefined })),
1266
+ );
1267
+ }
1268
+ const [root, workspaces] = yield* Effect.all(
1269
+ [hashRoot, additionalWorkspaces],
1270
+ { concurrency: "unbounded" },
1271
+ );
1272
+ const workspaceHashes = yield* Effect.forEach(
1273
+ workspaces,
1274
+ (cwd) => hashWorkspaceDirectory(cwd),
1275
+ { concurrency: "unbounded" },
1276
+ );
1277
+ const hash = yield* sha256Object([root, ...workspaceHashes.sort()]);
1278
+ return {
1279
+ hash,
1280
+ workspaces: Array.from(workspaces).map((cwd) =>
1281
+ path.relative(rootDir, cwd),
1282
+ ),
1283
+ };
1086
1284
  });
1087
1285
 
1088
1286
  const prepareAssetsAndBundle = (
@@ -1107,27 +1305,12 @@ export const LiveWorkerProvider = () =>
1107
1305
  files: [{ path: "main.js", content: props.script }],
1108
1306
  hash: bundleHash,
1109
1307
  },
1308
+ input: undefined,
1309
+ additionalWorkspaces: undefined,
1110
1310
  };
1111
1311
  }
1112
1312
  if (props.vite) {
1113
- const [{ assets, bundle }, input] = yield* Effect.all(
1114
- [
1115
- viteBuild(props),
1116
- // hashDirectory expects `{ cwd, memo }`. The vite props
1117
- // store the project root under `rootDir`, so map it
1118
- // here. Without this, `cwd` falls back to
1119
- // `process.cwd()` and the input hash is computed over
1120
- // the wrong directory tree (often the entire monorepo
1121
- // root), making it both slow and unable to detect
1122
- // changes scoped to the actual Vite project.
1123
- hashDirectory({
1124
- cwd: props.vite.rootDir,
1125
- memo: props.vite.memo,
1126
- }),
1127
- ],
1128
- { concurrency: "unbounded" },
1129
- );
1130
- return { assets, bundle, input };
1313
+ return yield* viteBuild(props);
1131
1314
  }
1132
1315
  const [assets, bundle] = yield* Effect.all(
1133
1316
  [
@@ -1138,9 +1321,14 @@ export const LiveWorkerProvider = () =>
1138
1321
  ],
1139
1322
  { concurrency: "unbounded" },
1140
1323
  );
1141
- return { assets, bundle };
1324
+ return {
1325
+ assets,
1326
+ bundle,
1327
+ input: undefined,
1328
+ additionalWorkspaces: undefined,
1329
+ };
1142
1330
  }).pipe(
1143
- Effect.map(({ assets, bundle, input }) => ({
1331
+ Effect.map(({ assets, bundle, input, additionalWorkspaces }) => ({
1144
1332
  assets,
1145
1333
  bundle: {
1146
1334
  main: bundle?.files[0].path,
@@ -1155,6 +1343,7 @@ export const LiveWorkerProvider = () =>
1155
1343
  assets: assets?.hash,
1156
1344
  bundle: bundle?.hash,
1157
1345
  input,
1346
+ additionalWorkspaces,
1158
1347
  } satisfies Worker["Attributes"]["hash"],
1159
1348
  })),
1160
1349
  );
@@ -1217,7 +1406,22 @@ export const LiveWorkerProvider = () =>
1217
1406
  assets: prebuiltAssets?.hash ?? preparedHash.assets,
1218
1407
  metadata: metadataHash,
1219
1408
  } satisfies Worker["Attributes"]["hash"];
1220
- const metadataBindings = bindings.flatMap((b) => b.data.bindings ?? []);
1409
+ // `transferredFrom` is alchemy-only transfer metadata on
1410
+ // durable_object_namespace bindings — it drives the
1411
+ // `transferred_classes` migration below and must be stripped from the
1412
+ // wire-shape binding before upload.
1413
+ const metadataBindings = bindings.flatMap((b) =>
1414
+ (b.data.bindings ?? []).map((item): WorkerBinding => {
1415
+ if (
1416
+ item.type === "durable_object_namespace" &&
1417
+ item.transferredFrom !== undefined
1418
+ ) {
1419
+ const { transferredFrom: _, ...rest } = item;
1420
+ return rest;
1421
+ }
1422
+ return item;
1423
+ }),
1424
+ );
1221
1425
  const expectedDurableObjectClassNames =
1222
1426
  getExpectedDurableObjectClassNames(metadataBindings, name);
1223
1427
  let metadataAssets:
@@ -1350,7 +1554,8 @@ export const LiveWorkerProvider = () =>
1350
1554
  const oldTags = Array.from(new Set(oldSettings?.tags ?? []));
1351
1555
  const oldBindings = oldSettings?.bindings ?? [];
1352
1556
 
1353
- // Parse alchemy:do:{logicalId}:{className} tags
1557
+ // Parse the DO logical-id→class mapping from script tags (packed
1558
+ // `alchemy:dos:` and legacy per-DO `alchemy:do:` formats)
1354
1559
  const oldDoClassNameByLogicalId = getDurableObjectTagMap(oldTags);
1355
1560
  const currentDoBindings = getDurableObjectBindings(bindings, name);
1356
1561
  const currentDoClassNameByLogicalId = Object.fromEntries(
@@ -1368,13 +1573,15 @@ export const LiveWorkerProvider = () =>
1368
1573
  )[0];
1369
1574
  const newMigrationTag = bumpMigrationTagVersion(oldMigrationTag);
1370
1575
 
1371
- // Compute deleted classes
1372
- const deletedClasses: string[] = [];
1576
+ // Compute delete-class candidates. Candidates are validated against
1577
+ // observed namespace ownership below — a class may already have been
1578
+ // transferred to another script by its new host's deploy.
1579
+ const deletedClassCandidates: string[] = [];
1373
1580
  for (const [logicalId, className] of Object.entries(
1374
1581
  oldDoClassNameByLogicalId,
1375
1582
  )) {
1376
1583
  if (!currentDoClassNameByLogicalId[logicalId]) {
1377
- deletedClasses.push(className);
1584
+ deletedClassCandidates.push(className);
1378
1585
  }
1379
1586
  }
1380
1587
 
@@ -1396,9 +1603,105 @@ export const LiveWorkerProvider = () =>
1396
1603
  (binding) => binding.bindingName === oldBinding.name,
1397
1604
  )
1398
1605
  ) {
1399
- deletedClasses.push(oldBinding.className);
1606
+ deletedClassCandidates.push(oldBinding.className);
1607
+ }
1608
+ }
1609
+ }
1610
+
1611
+ // Class names the current deploy references *cross-script* (mapped to
1612
+ // the foreign script). A class that both leaves the "hosted here" set
1613
+ // and shows up here has moved to another Worker — Cloudflare rejects
1614
+ // deleting a class while any binding in the upload references its
1615
+ // class name, and deleting would destroy the namespace's data.
1616
+ const crossScriptClassTargets = new Map<string, string>();
1617
+ for (const item of metadataBindings) {
1618
+ if (
1619
+ item.type === "durable_object_namespace" &&
1620
+ item.className &&
1621
+ typeof item.scriptName === "string" &&
1622
+ item.scriptName !== name
1623
+ ) {
1624
+ crossScriptClassTargets.set(item.className, item.scriptName);
1625
+ }
1626
+ }
1627
+
1628
+ // One account-level namespace listing serves both sides of a
1629
+ // transfer: the destination checks the source still hosts the class
1630
+ // before emitting `transferred_classes`, and the former host checks
1631
+ // whether a to-be-deleted class was already transferred away.
1632
+ // Dispatch-namespace user workers keep the legacy behavior — their
1633
+ // namespaces don't surface on the account-level list.
1634
+ const mayTransferIn = currentDoBindings.some(
1635
+ (binding) =>
1636
+ !oldDoClassNameByLogicalId[binding.logicalId] &&
1637
+ binding.transferredFrom !== undefined,
1638
+ );
1639
+ const observedNamespaces =
1640
+ !dispatchNamespace &&
1641
+ (deletedClassCandidates.length > 0 || mayTransferIn)
1642
+ ? yield* listDurableObjectNamespaces(accountId)
1643
+ : [];
1644
+ const hosts = (
1645
+ namespaces: readonly { script: string; class: string }[],
1646
+ scriptName: string,
1647
+ className: string,
1648
+ ) =>
1649
+ namespaces.some(
1650
+ (ns) => ns.script === scriptName && ns.class === className,
1651
+ );
1652
+ const scriptHostsClass = (scriptName: string, className: string) =>
1653
+ hosts(observedNamespaces, scriptName, className);
1654
+
1655
+ const deletedClasses: string[] = [];
1656
+ for (const className of deletedClassCandidates) {
1657
+ if (dispatchNamespace) {
1658
+ deletedClasses.push(className);
1659
+ continue;
1660
+ }
1661
+ const targetScriptName = crossScriptClassTargets.get(className);
1662
+ if (targetScriptName === undefined) {
1663
+ // Plain removal. Delete only if the namespace actually still
1664
+ // lives here — it may have been transferred to another script by
1665
+ // that script's deploy, or removed out-of-band. The stale
1666
+ // alchemy:do tag drops out either way because tags are recomputed
1667
+ // from current bindings.
1668
+ if (scriptHostsClass(name, className)) {
1669
+ deletedClasses.push(className);
1400
1670
  }
1671
+ continue;
1672
+ }
1673
+ // The class went local → cross-script. When the new host's deploy
1674
+ // ran a `transferred_classes` migration moments ago, the account
1675
+ // listing can briefly still attribute the namespace to this script,
1676
+ // so re-observe with a short bounded budget until the transfer
1677
+ // becomes visible (namespace off this script) or the state is
1678
+ // conclusively a conflict (still here — including the case where
1679
+ // the target created a *fresh* namespace for the same class name).
1680
+ const namespaces = yield* listDurableObjectNamespaces(accountId).pipe(
1681
+ Effect.repeat({
1682
+ schedule: Schedule.spaced("2 seconds"),
1683
+ until: (observed) =>
1684
+ !hosts(observed, name, className) ||
1685
+ hosts(observed, targetScriptName, className),
1686
+ times: 5,
1687
+ }),
1688
+ );
1689
+ if (!hosts(namespaces, name, className)) {
1690
+ // Transferred away — nothing to delete.
1691
+ continue;
1401
1692
  }
1693
+ // local → cross-script transition without a transfer. Fail before
1694
+ // any upload: Cloudflare would reject the combined delete + binding
1695
+ // anyway, and silently deleting would destroy the namespace's
1696
+ // data. See the error's docs for the two ways out
1697
+ // (`transferredFrom` on the new host, or a two-phase removal).
1698
+ return yield* Effect.fail(
1699
+ new DurableObjectTransferRequired({
1700
+ scriptName: name,
1701
+ className,
1702
+ targetScriptName,
1703
+ }),
1704
+ );
1402
1705
  }
1403
1706
 
1404
1707
  // Collect container-backed class names so we can send container metadata
@@ -1408,27 +1711,42 @@ export const LiveWorkerProvider = () =>
1408
1711
  ),
1409
1712
  );
1410
1713
 
1411
- // Compute new and renamed classes
1714
+ // Compute new, renamed, and transferred classes
1412
1715
  const newClasses: string[] = [];
1413
1716
  const newSqliteClasses: string[] = [];
1414
1717
  const renamedClasses: { from: string; to: string }[] = [];
1718
+ const transferredClasses: {
1719
+ from: string;
1720
+ fromScript: string;
1721
+ to: string;
1722
+ }[] = [];
1415
1723
  for (const binding of currentDoBindings) {
1416
1724
  let previousClassName: string | undefined =
1417
1725
  oldDoClassNameByLogicalId[binding.logicalId];
1418
1726
  if (!previousClassName) {
1419
- // No `alchemy:do:` tag maps this logical id to a class — the
1727
+ // No DO metadata tag maps this logical id to a class — the
1420
1728
  // worker was created outside Alchemy (raw API / Wrangler) or
1421
1729
  // before these tags existed. Fall back to matching the observed
1422
1730
  // cloud binding by binding name so adoption reuses the existing
1423
1731
  // class instead of asking Cloudflare to create one that already
1424
1732
  // exists (which fails the migration). This is the "first deploy
1425
1733
  // must match the existing class name" path; once we write the
1426
- // `alchemy:do:` tag, subsequent renames are driven by logical id.
1734
+ // `alchemy:dos:` tag, subsequent renames are driven by logical id.
1427
1735
  const observed = oldBindings.find(
1428
1736
  (old) =>
1429
1737
  old.type === "durable_object_namespace" &&
1430
1738
  "className" in old &&
1431
1739
  old.className &&
1740
+ // Only a *locally-owned* binding proves the class exists on
1741
+ // this script. A cross-script binding under the same name —
1742
+ // e.g. this worker previously referenced another host's
1743
+ // class and now hosts its own — points at a foreign
1744
+ // namespace and must not suppress the create migration
1745
+ // (Cloudflare rejects a local binding for a class the
1746
+ // script isn't configured to implement).
1747
+ (!("scriptName" in old) ||
1748
+ old.scriptName === undefined ||
1749
+ old.scriptName === name) &&
1432
1750
  old.name === binding.bindingName,
1433
1751
  );
1434
1752
  if (observed && "className" in observed && observed.className) {
@@ -1436,6 +1754,38 @@ export const LiveWorkerProvider = () =>
1436
1754
  }
1437
1755
  }
1438
1756
  if (!previousClassName) {
1757
+ // A class new to this script is a host move when the declaration
1758
+ // says so: `transferredFrom` lists the former host(s) — moves
1759
+ // are always declared, never inferred, because a class deleted
1760
+ // on one worker and created on another is otherwise ambiguous
1761
+ // between "move the data" and "delete + fresh namespace". The
1762
+ // declared source must be observed to still host the namespace;
1763
+ // otherwise (fresh stage, transfer already completed) fall
1764
+ // through to a plain create.
1765
+ const fromScript = dispatchNamespace
1766
+ ? undefined
1767
+ : yield* resolveTransferSource({
1768
+ accountId,
1769
+ selfScriptName: name,
1770
+ logicalId: binding.logicalId,
1771
+ className: binding.className,
1772
+ sources: normalizeTransferSources(
1773
+ binding.transferredFrom,
1774
+ name,
1775
+ ),
1776
+ observedNamespaces,
1777
+ });
1778
+ if (fromScript !== undefined) {
1779
+ // Data-preserving move: ship Cloudflare's
1780
+ // `transferred_classes` migration instead of creating a
1781
+ // fresh class.
1782
+ transferredClasses.push({
1783
+ from: binding.className,
1784
+ fromScript,
1785
+ to: binding.className,
1786
+ });
1787
+ continue;
1788
+ }
1439
1789
  // Default all new Durable Object classes to SQLite. Cloudflare
1440
1790
  // recommends SQLite for new namespaces, and container-backed
1441
1791
  // Durable Objects require it.
@@ -1455,29 +1805,28 @@ export const LiveWorkerProvider = () =>
1455
1805
  currentDoClassNameByLogicalId,
1456
1806
  deletedClasses,
1457
1807
  renamedClasses,
1808
+ transferredClasses,
1458
1809
  newSqliteClasses,
1459
1810
  },
1460
1811
  )}`,
1461
1812
  );
1462
1813
 
1463
- // Build alchemy:do:{logicalId}:{className} tags for each DO binding
1464
- const alchemyDoTags: string[] = [];
1465
- for (const binding of currentDoBindings) {
1466
- alchemyDoTags.push(
1467
- `alchemy:do:${binding.logicalId}:${binding.className}`,
1468
- );
1469
- }
1470
-
1814
+ // Pack every DO logical-id→class mapping into as few `alchemy:dos:`
1815
+ // tags as possible — one tag per DO blows Cloudflare's 10-tag limit
1816
+ // at 7+ bindings (#811).
1817
+ const alchemyDoTags = encodeDurableObjectTags(currentDoBindings);
1818
+
1819
+ const alchemyTags = [
1820
+ ...createAlchemyWorkerTags(id),
1821
+ ...alchemyDoTags,
1822
+ ...(newMigrationTag
1823
+ ? [`alchemy:migration-tag:${newMigrationTag}`]
1824
+ : []),
1825
+ ];
1471
1826
  const metadataTags = Array.from(
1472
- new Set([
1473
- ...createAlchemyWorkerTags(id),
1474
- ...alchemyDoTags,
1475
- ...(newMigrationTag
1476
- ? [`alchemy:migration-tag:${newMigrationTag}`]
1477
- : []),
1478
- ...(news.tags ?? []),
1479
- ]),
1827
+ new Set([...alchemyTags, ...(news.tags ?? [])]),
1480
1828
  );
1829
+ yield* validateWorkerTags(name, metadataTags, alchemyTags.length);
1481
1830
 
1482
1831
  const migrations = {
1483
1832
  oldTag: oldMigrationTag,
@@ -1485,7 +1834,7 @@ export const LiveWorkerProvider = () =>
1485
1834
  newClasses,
1486
1835
  deletedClasses,
1487
1836
  renamedClasses,
1488
- transferredClasses: [] as { from: string; to: string }[],
1837
+ transferredClasses,
1489
1838
  newSqliteClasses,
1490
1839
  };
1491
1840
 
@@ -1630,9 +1979,10 @@ export const LiveWorkerProvider = () =>
1630
1979
  error._tag === "WorkerNotFound" ||
1631
1980
  error._tag === "InternalServerError" ||
1632
1981
  error._tag === "UnknownCloudflareError",
1633
- schedule: Schedule.exponential(200).pipe(
1634
- Schedule.both(Schedule.recurs(15)),
1635
- ),
1982
+ schedule: Schedule.max([
1983
+ Schedule.exponential(200),
1984
+ Schedule.recurs(15),
1985
+ ]),
1636
1986
  }),
1637
1987
  );
1638
1988
  }
@@ -1727,11 +2077,12 @@ export const LiveWorkerProvider = () =>
1727
2077
  return assetsHash !== output.hash?.assets;
1728
2078
  }
1729
2079
  if (props.vite) {
1730
- const input = yield* hashDirectory({
1731
- cwd: props.vite.rootDir,
1732
- memo: props.vite.memo,
1733
- });
1734
- return input !== output.hash?.input;
2080
+ const { hash } = yield* hashViteInput(
2081
+ props.vite.rootDir,
2082
+ props.vite.memo,
2083
+ Effect.succeed(output.hash?.additionalWorkspaces ?? []),
2084
+ );
2085
+ return hash !== output.hash?.input;
1735
2086
  }
1736
2087
  const bundleHash = yield* prepareBundle(id, props).pipe(
1737
2088
  Effect.map((b) => b.hash),
@@ -2003,10 +2354,17 @@ export const LiveWorkerProvider = () =>
2003
2354
  const exportDerived = Object.keys(exportMap)
2004
2355
  .filter((logicalId) => isDurableObjectExport(exportMap[logicalId]))
2005
2356
  .map((logicalId) => ({ logicalId, className: logicalId }));
2357
+ // Transfer-destination classes are excluded from the placeholder
2358
+ // entirely (class list, bindings, tags): Cloudflare forbids
2359
+ // creating the destination class of a `transferred_classes`
2360
+ // migration ahead of the transfer, so `reconcile` must perform it
2361
+ // with the real upload. (`transferredFrom` may still be an
2362
+ // unresolved Output here — precreate runs on raw props — but only
2363
+ // its presence matters.)
2006
2364
  const durableObjects = mergeDurableObjectClasses(
2007
2365
  exportDerived,
2008
2366
  getDurableObjectBindings(bindings, name),
2009
- );
2367
+ ).filter((binding) => !binding.transferredFrom);
2010
2368
  const doClasses = durableObjects.map((binding) => binding.className);
2011
2369
  // Only attach container metadata for classes actually fronted by a
2012
2370
  // Container binding (mirrors reconcile's `containerClassNames`).
@@ -2019,17 +2377,15 @@ export const LiveWorkerProvider = () =>
2019
2377
  ),
2020
2378
  ),
2021
2379
  ).map((className) => ({ className }));
2022
- const alchemyDoTags = durableObjects.map(
2023
- ({ logicalId, className }) =>
2024
- `alchemy:do:${logicalId}:${className}`,
2025
- );
2380
+ const alchemyDoTags = encodeDurableObjectTags(durableObjects);
2381
+ const alchemyTags = [
2382
+ ...createAlchemyWorkerTags(id),
2383
+ ...alchemyDoTags,
2384
+ ];
2026
2385
  const tags = Array.from(
2027
- new Set([
2028
- ...createAlchemyWorkerTags(id),
2029
- ...alchemyDoTags,
2030
- ...(news.tags ?? []),
2031
- ]),
2386
+ new Set([...alchemyTags, ...(news.tags ?? [])]),
2032
2387
  );
2388
+ yield* validateWorkerTags(name, tags, alchemyTags.length);
2033
2389
  yield* Effect.logInfo(
2034
2390
  `Cloudflare Worker precreate: starting ${name}`,
2035
2391
  );
@@ -2134,9 +2490,10 @@ export const LiveWorkerProvider = () =>
2134
2490
  while: (e) =>
2135
2491
  e._tag === "InternalServerError" ||
2136
2492
  e._tag === "UnknownCloudflareError",
2137
- schedule: Schedule.exponential(1000).pipe(
2138
- Schedule.both(Schedule.recurs(5)),
2139
- ),
2493
+ schedule: Schedule.max([
2494
+ Schedule.exponential(1000),
2495
+ Schedule.recurs(5),
2496
+ ]),
2140
2497
  }),
2141
2498
  );
2142
2499
  if (doClasses.length > 0) {
@@ -2370,16 +2727,12 @@ export const LiveWorkerProvider = () =>
2370
2727
  );
2371
2728
  yield* Effect.logInfo(
2372
2729
  `Cloudflare Worker reconcile: existing durable object tags ${JSON.stringify(
2373
- (existingSettings?.tags ?? []).filter((tag) =>
2374
- tag.startsWith("alchemy:do:"),
2375
- ),
2730
+ (existingSettings?.tags ?? []).filter(isDurableObjectTag),
2376
2731
  )}`,
2377
2732
  );
2378
2733
  yield* Effect.logInfo(
2379
2734
  `Cloudflare Worker reconcile: previous durable object tags ${JSON.stringify(
2380
- (output?.tags ?? []).filter((tag) =>
2381
- tag.startsWith("alchemy:do:"),
2382
- ),
2735
+ (output?.tags ?? []).filter(isDurableObjectTag),
2383
2736
  )}`,
2384
2737
  );
2385
2738
 
@@ -2514,6 +2867,41 @@ const contentTypeFromExtension = (extension: string) => {
2514
2867
  }
2515
2868
  };
2516
2869
 
2870
+ /**
2871
+ * Observe every Durable Object namespace on the account as `(script, class)`
2872
+ * pairs. Namespace ownership is authoritative cloud state: after a
2873
+ * `transferred_classes` migration the namespace moves to the receiving
2874
+ * script, so this is how both sides of a transfer observe where a class
2875
+ * currently lives — the destination checks the source still hosts the class
2876
+ * before emitting the transfer, and the former host checks whether a class
2877
+ * it is about to delete has already been transferred away.
2878
+ */
2879
+ const listDurableObjectNamespaces = (accountId: string) =>
2880
+ durableObjectsApi.listNamespaces.items({ accountId }).pipe(
2881
+ Stream.runCollect,
2882
+ Effect.map((namespaces) =>
2883
+ Array.from(namespaces).flatMap((ns) =>
2884
+ ns.script && ns.class ? [{ script: ns.script, class: ns.class }] : [],
2885
+ ),
2886
+ ),
2887
+ );
2888
+
2889
+ /**
2890
+ * Coerce a resolved `transferredFrom` declaration to its list form, dropping
2891
+ * self-references (a worker naming itself as its own former host is
2892
+ * meaningless — the class already lives there).
2893
+ */
2894
+ const normalizeTransferSources = (
2895
+ value: string | readonly string[] | undefined,
2896
+ selfScriptName: string,
2897
+ ): string[] =>
2898
+ (value === undefined
2899
+ ? []
2900
+ : Array.isArray(value)
2901
+ ? value
2902
+ : [value as string]
2903
+ ).filter((source) => source !== selfScriptName);
2904
+
2517
2905
  function bumpMigrationTagVersion(
2518
2906
  oldTag: string | undefined,
2519
2907
  ): string | undefined {
@@ -2526,12 +2914,20 @@ function bumpMigrationTagVersion(
2526
2914
  /**
2527
2915
  * Merges a worker's export-derived and binding-derived Durable Object class
2528
2916
  * lists for the precreate placeholder, deduping by class name. The
2529
- * binding-derived entry wins on a collision so the `alchemy:do:` tag keys off
2917
+ * binding-derived entry wins on a collision so the `alchemy:dos:` tag keys off
2530
2918
  * the same logical id (the binding sid) that `reconcile` writes.
2531
2919
  */
2532
2920
  function mergeDurableObjectClasses(
2533
- exportDerived: ReadonlyArray<{ logicalId: string; className: string }>,
2534
- bindingDerived: ReadonlyArray<{ logicalId: string; className: string }>,
2921
+ exportDerived: ReadonlyArray<{
2922
+ logicalId: string;
2923
+ className: string;
2924
+ transferredFrom?: string | string[];
2925
+ }>,
2926
+ bindingDerived: ReadonlyArray<{
2927
+ logicalId: string;
2928
+ className: string;
2929
+ transferredFrom?: string | string[];
2930
+ }>,
2535
2931
  ) {
2536
2932
  return Array.from(
2537
2933
  new Map(
@@ -2575,22 +2971,180 @@ function getDurableObjectBindings(
2575
2971
  logicalId: binding.sid,
2576
2972
  bindingName: item.name,
2577
2973
  className: item.className,
2974
+ // Declared host history for a data-preserving
2975
+ // `transferred_classes` migration. Normalize an empty list to
2976
+ // "not declared"; self-references are dropped at resolution time.
2977
+ transferredFrom:
2978
+ Array.isArray(item.transferredFrom) &&
2979
+ item.transferredFrom.length === 0
2980
+ ? undefined
2981
+ : item.transferredFrom,
2578
2982
  },
2579
2983
  ];
2580
2984
  }),
2581
2985
  );
2582
2986
  }
2583
2987
 
2584
- function getDurableObjectTagMap(tags: ReadonlyArray<string>) {
2585
- return Object.fromEntries(
2586
- tags.flatMap((tag) => {
2587
- if (!tag.startsWith("alchemy:do:")) {
2588
- return [];
2589
- }
2988
+ /**
2989
+ * Cloudflare Worker script-tag limits, verified empirically against the live
2990
+ * API (2026-07):
2991
+ *
2992
+ * - at most **10 tags** per Worker (the 11th is rejected with `Forbidden`)
2993
+ * - each tag is at most **1024 bytes** (`BadRequest: Tag is too large`)
2994
+ * - tags may not contain `,` or `&`; everything else (`:`, `;`, `=`, `/`,
2995
+ * spaces, unicode) is accepted and round-trips intact
2996
+ *
2997
+ * Alchemy reserves 3 ownership tags (`alchemy:stack/stage/id`) and 1
2998
+ * migration tag, so the Durable Object logical-id→class mapping must not
2999
+ * spend one tag per DO (#811). Instead all mappings are packed into as few
3000
+ * `alchemy:dos:` tags as possible.
3001
+ */
3002
+ const MAX_TAGS_PER_WORKER = 10;
3003
+ const MAX_TAG_BYTES = 1024;
3004
+ const LEGACY_DO_TAG_PREFIX = "alchemy:do:";
3005
+ const PACKED_DO_TAG_PREFIX = "alchemy:dos:";
3006
+
3007
+ class InvalidWorkerTags extends Data.TaggedError("InvalidWorkerTags")<{
3008
+ scriptName: string;
3009
+ reason: string;
3010
+ }> {}
3011
+
3012
+ /**
3013
+ * Pack Durable Object logical-id→class mappings into `alchemy:dos:` tags.
3014
+ *
3015
+ * Each mapping is encoded as `logicalId=className` — elided to just
3016
+ * `className` when the two are equal (the common case for export-derived
3017
+ * classes) — with both components `encodeURIComponent`-escaped so the `;`
3018
+ * pair separator, the `=` delimiter, and Cloudflare's forbidden tag
3019
+ * characters (`,`, `&`) can never collide with user identifiers. Pairs are
3020
+ * sorted for deterministic output and greedily packed so each tag stays
3021
+ * within Cloudflare's 1024-byte tag limit; workers with more DOs than fit in
3022
+ * one tag spill into additional `alchemy:dos:` tags.
3023
+ *
3024
+ * `encodeURIComponent` output is pure ASCII, so `String.length` equals the
3025
+ * tag's byte length.
3026
+ *
3027
+ * @internal exported for unit testing.
3028
+ */
3029
+ export function encodeDurableObjectTags(
3030
+ durableObjects: ReadonlyArray<{ logicalId: string; className: string }>,
3031
+ ): string[] {
3032
+ const pairs = [...durableObjects]
3033
+ .sort((a, b) => a.logicalId.localeCompare(b.logicalId))
3034
+ .map(({ logicalId, className }) =>
3035
+ logicalId === className
3036
+ ? encodeURIComponent(className)
3037
+ : `${encodeURIComponent(logicalId)}=${encodeURIComponent(className)}`,
3038
+ );
3039
+ const tags: string[] = [];
3040
+ let payload = "";
3041
+ for (const pair of pairs) {
3042
+ const appended = payload === "" ? pair : `${payload};${pair}`;
3043
+ if (
3044
+ PACKED_DO_TAG_PREFIX.length + appended.length > MAX_TAG_BYTES &&
3045
+ payload !== ""
3046
+ ) {
3047
+ tags.push(`${PACKED_DO_TAG_PREFIX}${payload}`);
3048
+ payload = pair;
3049
+ } else {
3050
+ payload = appended;
3051
+ }
3052
+ }
3053
+ if (payload !== "") {
3054
+ tags.push(`${PACKED_DO_TAG_PREFIX}${payload}`);
3055
+ }
3056
+ return tags;
3057
+ }
3058
+
3059
+ /**
3060
+ * Parse the Durable Object logical-id→class mapping from a worker's script
3061
+ * tags. Reads both formats so workers deployed before the packed format roll
3062
+ * forward transparently:
3063
+ *
3064
+ * - legacy: one `alchemy:do:{logicalId}:{className}` tag per DO
3065
+ * - packed: `alchemy:dos:{pair};{pair};…` (see {@link encodeDurableObjectTags})
3066
+ *
3067
+ * A packed entry wins over a legacy entry for the same logical id.
3068
+ *
3069
+ * @internal exported for unit testing.
3070
+ */
3071
+ export function getDurableObjectTagMap(tags: ReadonlyArray<string>) {
3072
+ const map: Record<string, string> = {};
3073
+ for (const tag of tags) {
3074
+ if (tag.startsWith(LEGACY_DO_TAG_PREFIX)) {
2590
3075
  const parts = tag.split(":");
2591
3076
  const logicalId = parts[2];
2592
3077
  const className = parts.slice(3).join(":");
2593
- return logicalId && className ? [[logicalId, className]] : [];
2594
- }),
2595
- );
3078
+ if (logicalId && className && !(logicalId in map)) {
3079
+ map[logicalId] = className;
3080
+ }
3081
+ }
3082
+ }
3083
+ for (const tag of tags) {
3084
+ if (tag.startsWith(PACKED_DO_TAG_PREFIX)) {
3085
+ for (const pair of tag.slice(PACKED_DO_TAG_PREFIX.length).split(";")) {
3086
+ if (pair === "") continue;
3087
+ const eq = pair.indexOf("=");
3088
+ const logicalId = decodeURIComponent(
3089
+ eq === -1 ? pair : pair.slice(0, eq),
3090
+ );
3091
+ const className = decodeURIComponent(
3092
+ eq === -1 ? pair : pair.slice(eq + 1),
3093
+ );
3094
+ if (logicalId && className) {
3095
+ map[logicalId] = className;
3096
+ }
3097
+ }
3098
+ }
3099
+ }
3100
+ return map;
2596
3101
  }
3102
+
3103
+ const isDurableObjectTag = (tag: string) =>
3104
+ tag.startsWith(LEGACY_DO_TAG_PREFIX) || tag.startsWith(PACKED_DO_TAG_PREFIX);
3105
+
3106
+ /**
3107
+ * Fail fast — before the script upload — when a worker's tag set violates
3108
+ * Cloudflare's limits, instead of surfacing the raw `Forbidden`/`BadRequest`
3109
+ * at PUT time (#811). `alchemyTagCount` is the number of tags alchemy itself
3110
+ * generated (ownership + migration + packed DO tags) so the message can tell
3111
+ * the user how much of the budget is theirs.
3112
+ */
3113
+ const validateWorkerTags = (
3114
+ scriptName: string,
3115
+ tags: ReadonlyArray<string>,
3116
+ alchemyTagCount: number,
3117
+ ) =>
3118
+ Effect.gen(function* () {
3119
+ if (tags.length > MAX_TAGS_PER_WORKER) {
3120
+ return yield* Effect.fail(
3121
+ new InvalidWorkerTags({
3122
+ scriptName,
3123
+ reason:
3124
+ `worker "${scriptName}" needs ${tags.length} script tags but Cloudflare allows at most ${MAX_TAGS_PER_WORKER}. ` +
3125
+ `Alchemy reserves ${alchemyTagCount} (ownership, migration and durable-object metadata); ` +
3126
+ `${tags.length - alchemyTagCount} user tags were passed via \`tags\`. Remove ${tags.length - MAX_TAGS_PER_WORKER} tag(s).`,
3127
+ }),
3128
+ );
3129
+ }
3130
+ const encoder = new TextEncoder();
3131
+ for (const tag of tags) {
3132
+ if (tag.includes(",") || tag.includes("&")) {
3133
+ return yield* Effect.fail(
3134
+ new InvalidWorkerTags({
3135
+ scriptName,
3136
+ reason: `worker "${scriptName}" tag ${JSON.stringify(tag)} contains ',' or '&', which Cloudflare rejects.`,
3137
+ }),
3138
+ );
3139
+ }
3140
+ const bytes = yield* Effect.sync(() => encoder.encode(tag).length);
3141
+ if (bytes > MAX_TAG_BYTES) {
3142
+ return yield* Effect.fail(
3143
+ new InvalidWorkerTags({
3144
+ scriptName,
3145
+ reason: `worker "${scriptName}" tag ${JSON.stringify(tag.slice(0, 64))}… is ${bytes} bytes; Cloudflare allows at most ${MAX_TAG_BYTES}.`,
3146
+ }),
3147
+ );
3148
+ }
3149
+ }
3150
+ });