alchemy 2.0.0-beta.57 → 2.0.0-beta.58

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 (1507) hide show
  1. package/README.md +1 -1
  2. package/bin/exec.js +68 -49
  3. package/bin/exec.js.map +1 -1
  4. package/lib/AI/Agent.d.ts +30 -0
  5. package/lib/AI/Agent.d.ts.map +1 -0
  6. package/lib/AI/Agent.js +14 -0
  7. package/lib/AI/Agent.js.map +1 -0
  8. package/lib/AI/Parameter.d.ts +19 -0
  9. package/lib/AI/Parameter.d.ts.map +1 -0
  10. package/lib/AI/Parameter.js +12 -0
  11. package/lib/AI/Parameter.js.map +1 -0
  12. package/lib/AI/Tool.d.ts +37 -0
  13. package/lib/AI/Tool.d.ts.map +1 -0
  14. package/lib/AI/Tool.js +11 -0
  15. package/lib/AI/Tool.js.map +1 -0
  16. package/lib/AI/index.d.ts +4 -0
  17. package/lib/AI/index.d.ts.map +1 -0
  18. package/lib/AI/index.js +4 -0
  19. package/lib/AI/index.js.map +1 -0
  20. package/lib/AWS/ACM/Certificate.d.ts +4 -0
  21. package/lib/AWS/ACM/Certificate.d.ts.map +1 -1
  22. package/lib/AWS/ACM/Certificate.js +18 -11
  23. package/lib/AWS/ACM/Certificate.js.map +1 -1
  24. package/lib/AWS/Assets.js +1 -1
  25. package/lib/AWS/Assets.js.map +1 -1
  26. package/lib/AWS/AuthProvider.js +3 -3
  27. package/lib/AWS/AuthProvider.js.map +1 -1
  28. package/lib/AWS/AutoScaling/LaunchTemplate.js +1 -1
  29. package/lib/AWS/AutoScaling/LaunchTemplate.js.map +1 -1
  30. package/lib/AWS/CloudFront/Distribution.js +1 -1
  31. package/lib/AWS/CloudFront/Distribution.js.map +1 -1
  32. package/lib/AWS/CloudWatch/DescribeAlarmContributors.d.ts +4 -3
  33. package/lib/AWS/CloudWatch/DescribeAlarmContributors.d.ts.map +1 -1
  34. package/lib/AWS/CloudWatch/DescribeAlarmContributors.js.map +1 -1
  35. package/lib/AWS/CloudWatch/DescribeAlarmHistory.d.ts +4 -3
  36. package/lib/AWS/CloudWatch/DescribeAlarmHistory.d.ts.map +1 -1
  37. package/lib/AWS/CloudWatch/DescribeAlarmHistory.js.map +1 -1
  38. package/lib/AWS/CloudWatch/DescribeAlarms.d.ts +4 -3
  39. package/lib/AWS/CloudWatch/DescribeAlarms.d.ts.map +1 -1
  40. package/lib/AWS/CloudWatch/DescribeAlarms.js.map +1 -1
  41. package/lib/AWS/CloudWatch/DescribeAlarmsForMetric.d.ts +4 -3
  42. package/lib/AWS/CloudWatch/DescribeAlarmsForMetric.d.ts.map +1 -1
  43. package/lib/AWS/CloudWatch/DescribeAlarmsForMetric.js.map +1 -1
  44. package/lib/AWS/CloudWatch/DescribeAnomalyDetectors.d.ts +4 -3
  45. package/lib/AWS/CloudWatch/DescribeAnomalyDetectors.d.ts.map +1 -1
  46. package/lib/AWS/CloudWatch/DescribeAnomalyDetectors.js.map +1 -1
  47. package/lib/AWS/CloudWatch/DescribeInsightRules.d.ts +4 -3
  48. package/lib/AWS/CloudWatch/DescribeInsightRules.d.ts.map +1 -1
  49. package/lib/AWS/CloudWatch/DescribeInsightRules.js.map +1 -1
  50. package/lib/AWS/CloudWatch/DisableAlarmActions.d.ts +4 -3
  51. package/lib/AWS/CloudWatch/DisableAlarmActions.d.ts.map +1 -1
  52. package/lib/AWS/CloudWatch/DisableAlarmActions.js.map +1 -1
  53. package/lib/AWS/CloudWatch/DisableInsightRules.d.ts +4 -3
  54. package/lib/AWS/CloudWatch/DisableInsightRules.d.ts.map +1 -1
  55. package/lib/AWS/CloudWatch/DisableInsightRules.js.map +1 -1
  56. package/lib/AWS/CloudWatch/EnableAlarmActions.d.ts +4 -3
  57. package/lib/AWS/CloudWatch/EnableAlarmActions.d.ts.map +1 -1
  58. package/lib/AWS/CloudWatch/EnableAlarmActions.js.map +1 -1
  59. package/lib/AWS/CloudWatch/GetAlarmMuteRule.d.ts +4 -3
  60. package/lib/AWS/CloudWatch/GetAlarmMuteRule.d.ts.map +1 -1
  61. package/lib/AWS/CloudWatch/GetAlarmMuteRule.js.map +1 -1
  62. package/lib/AWS/CloudWatch/GetDashboard.d.ts +4 -3
  63. package/lib/AWS/CloudWatch/GetDashboard.d.ts.map +1 -1
  64. package/lib/AWS/CloudWatch/GetDashboard.js.map +1 -1
  65. package/lib/AWS/CloudWatch/GetInsightRuleReport.d.ts +4 -3
  66. package/lib/AWS/CloudWatch/GetInsightRuleReport.d.ts.map +1 -1
  67. package/lib/AWS/CloudWatch/GetInsightRuleReport.js.map +1 -1
  68. package/lib/AWS/CloudWatch/GetMetricData.d.ts +4 -3
  69. package/lib/AWS/CloudWatch/GetMetricData.d.ts.map +1 -1
  70. package/lib/AWS/CloudWatch/GetMetricData.js.map +1 -1
  71. package/lib/AWS/CloudWatch/GetMetricStatistics.d.ts +4 -3
  72. package/lib/AWS/CloudWatch/GetMetricStatistics.d.ts.map +1 -1
  73. package/lib/AWS/CloudWatch/GetMetricStatistics.js.map +1 -1
  74. package/lib/AWS/CloudWatch/GetMetricStream.d.ts +4 -3
  75. package/lib/AWS/CloudWatch/GetMetricStream.d.ts.map +1 -1
  76. package/lib/AWS/CloudWatch/GetMetricStream.js.map +1 -1
  77. package/lib/AWS/CloudWatch/GetMetricWidgetImage.d.ts +4 -3
  78. package/lib/AWS/CloudWatch/GetMetricWidgetImage.d.ts.map +1 -1
  79. package/lib/AWS/CloudWatch/GetMetricWidgetImage.js.map +1 -1
  80. package/lib/AWS/CloudWatch/ListAlarmMuteRules.d.ts +4 -3
  81. package/lib/AWS/CloudWatch/ListAlarmMuteRules.d.ts.map +1 -1
  82. package/lib/AWS/CloudWatch/ListAlarmMuteRules.js.map +1 -1
  83. package/lib/AWS/CloudWatch/ListDashboards.d.ts +4 -3
  84. package/lib/AWS/CloudWatch/ListDashboards.d.ts.map +1 -1
  85. package/lib/AWS/CloudWatch/ListDashboards.js.map +1 -1
  86. package/lib/AWS/CloudWatch/ListManagedInsightRules.d.ts +4 -3
  87. package/lib/AWS/CloudWatch/ListManagedInsightRules.d.ts.map +1 -1
  88. package/lib/AWS/CloudWatch/ListManagedInsightRules.js.map +1 -1
  89. package/lib/AWS/CloudWatch/ListMetricStreams.d.ts +4 -3
  90. package/lib/AWS/CloudWatch/ListMetricStreams.d.ts.map +1 -1
  91. package/lib/AWS/CloudWatch/ListMetricStreams.js.map +1 -1
  92. package/lib/AWS/CloudWatch/ListMetrics.d.ts +4 -3
  93. package/lib/AWS/CloudWatch/ListMetrics.d.ts.map +1 -1
  94. package/lib/AWS/CloudWatch/ListMetrics.js.map +1 -1
  95. package/lib/AWS/CloudWatch/ListTagsForResource.d.ts +4 -3
  96. package/lib/AWS/CloudWatch/ListTagsForResource.d.ts.map +1 -1
  97. package/lib/AWS/CloudWatch/ListTagsForResource.js.map +1 -1
  98. package/lib/AWS/CloudWatch/PutMetricData.d.ts +4 -3
  99. package/lib/AWS/CloudWatch/PutMetricData.d.ts.map +1 -1
  100. package/lib/AWS/CloudWatch/PutMetricData.js.map +1 -1
  101. package/lib/AWS/CloudWatch/SetAlarmState.d.ts +4 -3
  102. package/lib/AWS/CloudWatch/SetAlarmState.d.ts.map +1 -1
  103. package/lib/AWS/CloudWatch/SetAlarmState.js.map +1 -1
  104. package/lib/AWS/Credentials.d.ts +5 -0
  105. package/lib/AWS/Credentials.d.ts.map +1 -1
  106. package/lib/AWS/Credentials.js.map +1 -1
  107. package/lib/AWS/DynamoDB/BatchExecuteStatement.d.ts +4 -3
  108. package/lib/AWS/DynamoDB/BatchExecuteStatement.d.ts.map +1 -1
  109. package/lib/AWS/DynamoDB/BatchExecuteStatement.js.map +1 -1
  110. package/lib/AWS/DynamoDB/BatchGetItem.d.ts +4 -3
  111. package/lib/AWS/DynamoDB/BatchGetItem.d.ts.map +1 -1
  112. package/lib/AWS/DynamoDB/BatchGetItem.js +4 -4
  113. package/lib/AWS/DynamoDB/BatchGetItem.js.map +1 -1
  114. package/lib/AWS/DynamoDB/BatchWriteItem.d.ts +4 -3
  115. package/lib/AWS/DynamoDB/BatchWriteItem.d.ts.map +1 -1
  116. package/lib/AWS/DynamoDB/BatchWriteItem.js +4 -4
  117. package/lib/AWS/DynamoDB/BatchWriteItem.js.map +1 -1
  118. package/lib/AWS/DynamoDB/DeleteItem.d.ts +4 -3
  119. package/lib/AWS/DynamoDB/DeleteItem.d.ts.map +1 -1
  120. package/lib/AWS/DynamoDB/DeleteItem.js.map +1 -1
  121. package/lib/AWS/DynamoDB/DescribeTable.d.ts +4 -3
  122. package/lib/AWS/DynamoDB/DescribeTable.d.ts.map +1 -1
  123. package/lib/AWS/DynamoDB/DescribeTable.js.map +1 -1
  124. package/lib/AWS/DynamoDB/DescribeTimeToLive.d.ts +4 -3
  125. package/lib/AWS/DynamoDB/DescribeTimeToLive.d.ts.map +1 -1
  126. package/lib/AWS/DynamoDB/DescribeTimeToLive.js.map +1 -1
  127. package/lib/AWS/DynamoDB/ExecuteStatement.d.ts +4 -3
  128. package/lib/AWS/DynamoDB/ExecuteStatement.d.ts.map +1 -1
  129. package/lib/AWS/DynamoDB/ExecuteStatement.js.map +1 -1
  130. package/lib/AWS/DynamoDB/ExecuteTransaction.d.ts +4 -3
  131. package/lib/AWS/DynamoDB/ExecuteTransaction.d.ts.map +1 -1
  132. package/lib/AWS/DynamoDB/ExecuteTransaction.js.map +1 -1
  133. package/lib/AWS/DynamoDB/GetItem.d.ts +4 -3
  134. package/lib/AWS/DynamoDB/GetItem.d.ts.map +1 -1
  135. package/lib/AWS/DynamoDB/GetItem.js.map +1 -1
  136. package/lib/AWS/DynamoDB/ListTables.d.ts +4 -3
  137. package/lib/AWS/DynamoDB/ListTables.d.ts.map +1 -1
  138. package/lib/AWS/DynamoDB/ListTables.js.map +1 -1
  139. package/lib/AWS/DynamoDB/ListTagsOfResource.d.ts +4 -3
  140. package/lib/AWS/DynamoDB/ListTagsOfResource.d.ts.map +1 -1
  141. package/lib/AWS/DynamoDB/ListTagsOfResource.js.map +1 -1
  142. package/lib/AWS/DynamoDB/PutItem.d.ts +4 -3
  143. package/lib/AWS/DynamoDB/PutItem.d.ts.map +1 -1
  144. package/lib/AWS/DynamoDB/PutItem.js.map +1 -1
  145. package/lib/AWS/DynamoDB/Query.d.ts +4 -3
  146. package/lib/AWS/DynamoDB/Query.d.ts.map +1 -1
  147. package/lib/AWS/DynamoDB/Query.js.map +1 -1
  148. package/lib/AWS/DynamoDB/RestoreTableToPointInTime.d.ts +4 -3
  149. package/lib/AWS/DynamoDB/RestoreTableToPointInTime.d.ts.map +1 -1
  150. package/lib/AWS/DynamoDB/RestoreTableToPointInTime.js.map +1 -1
  151. package/lib/AWS/DynamoDB/Scan.d.ts +4 -3
  152. package/lib/AWS/DynamoDB/Scan.d.ts.map +1 -1
  153. package/lib/AWS/DynamoDB/Scan.js.map +1 -1
  154. package/lib/AWS/DynamoDB/TransactGetItems.d.ts +4 -3
  155. package/lib/AWS/DynamoDB/TransactGetItems.d.ts.map +1 -1
  156. package/lib/AWS/DynamoDB/TransactGetItems.js +4 -4
  157. package/lib/AWS/DynamoDB/TransactGetItems.js.map +1 -1
  158. package/lib/AWS/DynamoDB/TransactWriteItems.d.ts +4 -3
  159. package/lib/AWS/DynamoDB/TransactWriteItems.d.ts.map +1 -1
  160. package/lib/AWS/DynamoDB/TransactWriteItems.js +5 -5
  161. package/lib/AWS/DynamoDB/TransactWriteItems.js.map +1 -1
  162. package/lib/AWS/DynamoDB/UpdateItem.d.ts +4 -3
  163. package/lib/AWS/DynamoDB/UpdateItem.d.ts.map +1 -1
  164. package/lib/AWS/DynamoDB/UpdateItem.js.map +1 -1
  165. package/lib/AWS/DynamoDB/UpdateTimeToLive.d.ts +4 -3
  166. package/lib/AWS/DynamoDB/UpdateTimeToLive.d.ts.map +1 -1
  167. package/lib/AWS/DynamoDB/UpdateTimeToLive.js.map +1 -1
  168. package/lib/AWS/EC2/Image.js +2 -2
  169. package/lib/AWS/EC2/Image.js.map +1 -1
  170. package/lib/AWS/EC2/Instance.d.ts.map +1 -1
  171. package/lib/AWS/EC2/Instance.js +1 -1
  172. package/lib/AWS/EC2/Instance.js.map +1 -1
  173. package/lib/AWS/EC2/NatGateway.js +1 -1
  174. package/lib/AWS/EC2/NatGateway.js.map +1 -1
  175. package/lib/AWS/EC2/NetworkAcl.js +1 -1
  176. package/lib/AWS/EC2/NetworkAcl.js.map +1 -1
  177. package/lib/AWS/EC2/SecurityGroup.js +1 -1
  178. package/lib/AWS/EC2/SecurityGroup.js.map +1 -1
  179. package/lib/AWS/EC2/VpcEndpoint.js +1 -1
  180. package/lib/AWS/EC2/VpcEndpoint.js.map +1 -1
  181. package/lib/AWS/EC2/hosted.js +2 -2
  182. package/lib/AWS/EC2/hosted.js.map +1 -1
  183. package/lib/AWS/ECS/DescribeTasks.d.ts +4 -3
  184. package/lib/AWS/ECS/DescribeTasks.d.ts.map +1 -1
  185. package/lib/AWS/ECS/DescribeTasks.js.map +1 -1
  186. package/lib/AWS/ECS/ListTasks.d.ts +4 -3
  187. package/lib/AWS/ECS/ListTasks.d.ts.map +1 -1
  188. package/lib/AWS/ECS/ListTasks.js.map +1 -1
  189. package/lib/AWS/ECS/RunTask.d.ts +4 -3
  190. package/lib/AWS/ECS/RunTask.d.ts.map +1 -1
  191. package/lib/AWS/ECS/RunTask.js.map +1 -1
  192. package/lib/AWS/ECS/StopTask.d.ts +4 -3
  193. package/lib/AWS/ECS/StopTask.d.ts.map +1 -1
  194. package/lib/AWS/ECS/StopTask.js.map +1 -1
  195. package/lib/AWS/ECS/Task.js +1 -1
  196. package/lib/AWS/ECS/Task.js.map +1 -1
  197. package/lib/AWS/Environment.d.ts +2 -1
  198. package/lib/AWS/Environment.d.ts.map +1 -1
  199. package/lib/AWS/Environment.js +1 -1
  200. package/lib/AWS/Environment.js.map +1 -1
  201. package/lib/AWS/EventBridge/DescribeEventBus.d.ts +4 -3
  202. package/lib/AWS/EventBridge/DescribeEventBus.d.ts.map +1 -1
  203. package/lib/AWS/EventBridge/DescribeEventBus.js.map +1 -1
  204. package/lib/AWS/EventBridge/DescribeRule.d.ts +4 -3
  205. package/lib/AWS/EventBridge/DescribeRule.d.ts.map +1 -1
  206. package/lib/AWS/EventBridge/DescribeRule.js.map +1 -1
  207. package/lib/AWS/EventBridge/EventSource.d.ts +2 -2
  208. package/lib/AWS/EventBridge/ListEventBuses.d.ts +4 -3
  209. package/lib/AWS/EventBridge/ListEventBuses.d.ts.map +1 -1
  210. package/lib/AWS/EventBridge/ListEventBuses.js.map +1 -1
  211. package/lib/AWS/EventBridge/ListRules.d.ts +4 -3
  212. package/lib/AWS/EventBridge/ListRules.d.ts.map +1 -1
  213. package/lib/AWS/EventBridge/ListRules.js.map +1 -1
  214. package/lib/AWS/EventBridge/ListTargetsByRule.d.ts +4 -3
  215. package/lib/AWS/EventBridge/ListTargetsByRule.d.ts.map +1 -1
  216. package/lib/AWS/EventBridge/ListTargetsByRule.js.map +1 -1
  217. package/lib/AWS/EventBridge/PutEvents.d.ts +4 -3
  218. package/lib/AWS/EventBridge/PutEvents.d.ts.map +1 -1
  219. package/lib/AWS/EventBridge/PutEvents.js.map +1 -1
  220. package/lib/AWS/EventBridge/TestEventPattern.d.ts +4 -3
  221. package/lib/AWS/EventBridge/TestEventPattern.d.ts.map +1 -1
  222. package/lib/AWS/EventBridge/TestEventPattern.js.map +1 -1
  223. package/lib/AWS/EventBridge/ToLambda.d.ts +4 -3
  224. package/lib/AWS/EventBridge/ToLambda.d.ts.map +1 -1
  225. package/lib/AWS/EventBridge/ToLambda.js.map +1 -1
  226. package/lib/AWS/EventBridge/ToQueue.d.ts +4 -3
  227. package/lib/AWS/EventBridge/ToQueue.d.ts.map +1 -1
  228. package/lib/AWS/EventBridge/ToQueue.js.map +1 -1
  229. package/lib/AWS/Kinesis/DescribeAccountSettings.d.ts +4 -3
  230. package/lib/AWS/Kinesis/DescribeAccountSettings.d.ts.map +1 -1
  231. package/lib/AWS/Kinesis/DescribeAccountSettings.js.map +1 -1
  232. package/lib/AWS/Kinesis/DescribeLimits.d.ts +4 -3
  233. package/lib/AWS/Kinesis/DescribeLimits.d.ts.map +1 -1
  234. package/lib/AWS/Kinesis/DescribeLimits.js.map +1 -1
  235. package/lib/AWS/Kinesis/DescribeStream.d.ts +4 -3
  236. package/lib/AWS/Kinesis/DescribeStream.d.ts.map +1 -1
  237. package/lib/AWS/Kinesis/DescribeStream.js.map +1 -1
  238. package/lib/AWS/Kinesis/DescribeStreamConsumer.d.ts +4 -3
  239. package/lib/AWS/Kinesis/DescribeStreamConsumer.d.ts.map +1 -1
  240. package/lib/AWS/Kinesis/DescribeStreamConsumer.js.map +1 -1
  241. package/lib/AWS/Kinesis/DescribeStreamSummary.d.ts +4 -3
  242. package/lib/AWS/Kinesis/DescribeStreamSummary.d.ts.map +1 -1
  243. package/lib/AWS/Kinesis/DescribeStreamSummary.js.map +1 -1
  244. package/lib/AWS/Kinesis/GetRecords.d.ts +4 -3
  245. package/lib/AWS/Kinesis/GetRecords.d.ts.map +1 -1
  246. package/lib/AWS/Kinesis/GetRecords.js.map +1 -1
  247. package/lib/AWS/Kinesis/GetResourcePolicy.d.ts +4 -3
  248. package/lib/AWS/Kinesis/GetResourcePolicy.d.ts.map +1 -1
  249. package/lib/AWS/Kinesis/GetResourcePolicy.js.map +1 -1
  250. package/lib/AWS/Kinesis/GetShardIterator.d.ts +4 -3
  251. package/lib/AWS/Kinesis/GetShardIterator.d.ts.map +1 -1
  252. package/lib/AWS/Kinesis/GetShardIterator.js.map +1 -1
  253. package/lib/AWS/Kinesis/ListShards.d.ts +4 -3
  254. package/lib/AWS/Kinesis/ListShards.d.ts.map +1 -1
  255. package/lib/AWS/Kinesis/ListShards.js.map +1 -1
  256. package/lib/AWS/Kinesis/ListStreamConsumers.d.ts +4 -3
  257. package/lib/AWS/Kinesis/ListStreamConsumers.d.ts.map +1 -1
  258. package/lib/AWS/Kinesis/ListStreamConsumers.js.map +1 -1
  259. package/lib/AWS/Kinesis/ListStreams.d.ts +4 -3
  260. package/lib/AWS/Kinesis/ListStreams.d.ts.map +1 -1
  261. package/lib/AWS/Kinesis/ListStreams.js.map +1 -1
  262. package/lib/AWS/Kinesis/ListTagsForResource.d.ts +4 -3
  263. package/lib/AWS/Kinesis/ListTagsForResource.d.ts.map +1 -1
  264. package/lib/AWS/Kinesis/ListTagsForResource.js.map +1 -1
  265. package/lib/AWS/Kinesis/PutRecord.d.ts +4 -3
  266. package/lib/AWS/Kinesis/PutRecord.d.ts.map +1 -1
  267. package/lib/AWS/Kinesis/PutRecord.js.map +1 -1
  268. package/lib/AWS/Kinesis/PutRecords.d.ts +4 -3
  269. package/lib/AWS/Kinesis/PutRecords.d.ts.map +1 -1
  270. package/lib/AWS/Kinesis/PutRecords.js.map +1 -1
  271. package/lib/AWS/Kinesis/StreamSink.d.ts +4 -3
  272. package/lib/AWS/Kinesis/StreamSink.d.ts.map +1 -1
  273. package/lib/AWS/Kinesis/StreamSink.js.map +1 -1
  274. package/lib/AWS/Kinesis/SubscribeToShard.d.ts +4 -3
  275. package/lib/AWS/Kinesis/SubscribeToShard.d.ts.map +1 -1
  276. package/lib/AWS/Kinesis/SubscribeToShard.js.map +1 -1
  277. package/lib/AWS/Lambda/BucketEventSource.d.ts +4 -3
  278. package/lib/AWS/Lambda/BucketEventSource.d.ts.map +1 -1
  279. package/lib/AWS/Lambda/BucketEventSource.js.map +1 -1
  280. package/lib/AWS/Lambda/EventBridgeEventSource.d.ts +4 -3
  281. package/lib/AWS/Lambda/EventBridgeEventSource.d.ts.map +1 -1
  282. package/lib/AWS/Lambda/EventBridgeEventSource.js.map +1 -1
  283. package/lib/AWS/Lambda/Function.d.ts +45 -3
  284. package/lib/AWS/Lambda/Function.d.ts.map +1 -1
  285. package/lib/AWS/Lambda/Function.js +121 -47
  286. package/lib/AWS/Lambda/Function.js.map +1 -1
  287. package/lib/AWS/Lambda/InvokeFunction.d.ts +4 -3
  288. package/lib/AWS/Lambda/InvokeFunction.d.ts.map +1 -1
  289. package/lib/AWS/Lambda/InvokeFunction.js.map +1 -1
  290. package/lib/AWS/Lambda/QueueEventSource.d.ts +4 -3
  291. package/lib/AWS/Lambda/QueueEventSource.d.ts.map +1 -1
  292. package/lib/AWS/Lambda/QueueEventSource.js.map +1 -1
  293. package/lib/AWS/Lambda/StreamEventSource.d.ts +4 -3
  294. package/lib/AWS/Lambda/StreamEventSource.d.ts.map +1 -1
  295. package/lib/AWS/Lambda/StreamEventSource.js.map +1 -1
  296. package/lib/AWS/Lambda/TableEventSource.d.ts +4 -3
  297. package/lib/AWS/Lambda/TableEventSource.d.ts.map +1 -1
  298. package/lib/AWS/Lambda/TableEventSource.js.map +1 -1
  299. package/lib/AWS/Lambda/TopicEventSource.d.ts +4 -3
  300. package/lib/AWS/Lambda/TopicEventSource.d.ts.map +1 -1
  301. package/lib/AWS/Lambda/TopicEventSource.js.map +1 -1
  302. package/lib/AWS/Organizations/Root.js +1 -1
  303. package/lib/AWS/Organizations/Root.js.map +1 -1
  304. package/lib/AWS/Providers.d.ts +2 -2
  305. package/lib/AWS/Providers.d.ts.map +1 -1
  306. package/lib/AWS/Providers.js +4 -5
  307. package/lib/AWS/Providers.js.map +1 -1
  308. package/lib/AWS/RDS/Connect.d.ts +4 -3
  309. package/lib/AWS/RDS/Connect.d.ts.map +1 -1
  310. package/lib/AWS/RDS/Connect.js.map +1 -1
  311. package/lib/AWS/RDSData/BatchExecuteStatement.d.ts +4 -3
  312. package/lib/AWS/RDSData/BatchExecuteStatement.d.ts.map +1 -1
  313. package/lib/AWS/RDSData/BatchExecuteStatement.js.map +1 -1
  314. package/lib/AWS/RDSData/BeginTransaction.d.ts +4 -3
  315. package/lib/AWS/RDSData/BeginTransaction.d.ts.map +1 -1
  316. package/lib/AWS/RDSData/BeginTransaction.js.map +1 -1
  317. package/lib/AWS/RDSData/CommitTransaction.d.ts +4 -3
  318. package/lib/AWS/RDSData/CommitTransaction.d.ts.map +1 -1
  319. package/lib/AWS/RDSData/CommitTransaction.js.map +1 -1
  320. package/lib/AWS/RDSData/ExecuteSql.d.ts +4 -3
  321. package/lib/AWS/RDSData/ExecuteSql.d.ts.map +1 -1
  322. package/lib/AWS/RDSData/ExecuteSql.js.map +1 -1
  323. package/lib/AWS/RDSData/ExecuteStatement.d.ts +4 -3
  324. package/lib/AWS/RDSData/ExecuteStatement.d.ts.map +1 -1
  325. package/lib/AWS/RDSData/ExecuteStatement.js.map +1 -1
  326. package/lib/AWS/RDSData/RollbackTransaction.d.ts +4 -3
  327. package/lib/AWS/RDSData/RollbackTransaction.d.ts.map +1 -1
  328. package/lib/AWS/RDSData/RollbackTransaction.js.map +1 -1
  329. package/lib/AWS/Region.d.ts +5 -0
  330. package/lib/AWS/Region.d.ts.map +1 -1
  331. package/lib/AWS/Region.js.map +1 -1
  332. package/lib/AWS/S3/AbortMultipartUpload.d.ts +4 -3
  333. package/lib/AWS/S3/AbortMultipartUpload.d.ts.map +1 -1
  334. package/lib/AWS/S3/AbortMultipartUpload.js.map +1 -1
  335. package/lib/AWS/S3/Bucket.js +18 -18
  336. package/lib/AWS/S3/Bucket.js.map +1 -1
  337. package/lib/AWS/S3/CompleteMultipartUpload.d.ts +4 -3
  338. package/lib/AWS/S3/CompleteMultipartUpload.d.ts.map +1 -1
  339. package/lib/AWS/S3/CompleteMultipartUpload.js.map +1 -1
  340. package/lib/AWS/S3/CopyObject.d.ts +4 -3
  341. package/lib/AWS/S3/CopyObject.d.ts.map +1 -1
  342. package/lib/AWS/S3/CopyObject.js.map +1 -1
  343. package/lib/AWS/S3/CreateMultipartUpload.d.ts +4 -3
  344. package/lib/AWS/S3/CreateMultipartUpload.d.ts.map +1 -1
  345. package/lib/AWS/S3/CreateMultipartUpload.js.map +1 -1
  346. package/lib/AWS/S3/DeleteObject.d.ts +4 -3
  347. package/lib/AWS/S3/DeleteObject.d.ts.map +1 -1
  348. package/lib/AWS/S3/DeleteObject.js.map +1 -1
  349. package/lib/AWS/S3/GetObject.d.ts +4 -3
  350. package/lib/AWS/S3/GetObject.d.ts.map +1 -1
  351. package/lib/AWS/S3/GetObject.js.map +1 -1
  352. package/lib/AWS/S3/HeadObject.d.ts +4 -3
  353. package/lib/AWS/S3/HeadObject.d.ts.map +1 -1
  354. package/lib/AWS/S3/HeadObject.js.map +1 -1
  355. package/lib/AWS/S3/ListObjectsV2.d.ts +4 -3
  356. package/lib/AWS/S3/ListObjectsV2.d.ts.map +1 -1
  357. package/lib/AWS/S3/ListObjectsV2.js.map +1 -1
  358. package/lib/AWS/S3/PutObject.d.ts +4 -3
  359. package/lib/AWS/S3/PutObject.d.ts.map +1 -1
  360. package/lib/AWS/S3/PutObject.js.map +1 -1
  361. package/lib/AWS/S3/UploadPart.d.ts +4 -3
  362. package/lib/AWS/S3/UploadPart.d.ts.map +1 -1
  363. package/lib/AWS/S3/UploadPart.js.map +1 -1
  364. package/lib/AWS/SNS/AddPermission.d.ts +4 -3
  365. package/lib/AWS/SNS/AddPermission.d.ts.map +1 -1
  366. package/lib/AWS/SNS/AddPermission.js.map +1 -1
  367. package/lib/AWS/SNS/ConfirmSubscription.d.ts +4 -3
  368. package/lib/AWS/SNS/ConfirmSubscription.d.ts.map +1 -1
  369. package/lib/AWS/SNS/ConfirmSubscription.js.map +1 -1
  370. package/lib/AWS/SNS/GetDataProtectionPolicy.d.ts +4 -3
  371. package/lib/AWS/SNS/GetDataProtectionPolicy.d.ts.map +1 -1
  372. package/lib/AWS/SNS/GetDataProtectionPolicy.js.map +1 -1
  373. package/lib/AWS/SNS/GetSubscriptionAttributes.d.ts +4 -3
  374. package/lib/AWS/SNS/GetSubscriptionAttributes.d.ts.map +1 -1
  375. package/lib/AWS/SNS/GetSubscriptionAttributes.js.map +1 -1
  376. package/lib/AWS/SNS/GetTopicAttributes.d.ts +4 -3
  377. package/lib/AWS/SNS/GetTopicAttributes.d.ts.map +1 -1
  378. package/lib/AWS/SNS/GetTopicAttributes.js.map +1 -1
  379. package/lib/AWS/SNS/ListSubscriptions.d.ts +4 -3
  380. package/lib/AWS/SNS/ListSubscriptions.d.ts.map +1 -1
  381. package/lib/AWS/SNS/ListSubscriptions.js.map +1 -1
  382. package/lib/AWS/SNS/ListSubscriptionsByTopic.d.ts +4 -3
  383. package/lib/AWS/SNS/ListSubscriptionsByTopic.d.ts.map +1 -1
  384. package/lib/AWS/SNS/ListSubscriptionsByTopic.js.map +1 -1
  385. package/lib/AWS/SNS/ListTagsForResource.d.ts +4 -3
  386. package/lib/AWS/SNS/ListTagsForResource.d.ts.map +1 -1
  387. package/lib/AWS/SNS/ListTagsForResource.js.map +1 -1
  388. package/lib/AWS/SNS/ListTopics.d.ts +4 -3
  389. package/lib/AWS/SNS/ListTopics.d.ts.map +1 -1
  390. package/lib/AWS/SNS/ListTopics.js.map +1 -1
  391. package/lib/AWS/SNS/Publish.d.ts +4 -3
  392. package/lib/AWS/SNS/Publish.d.ts.map +1 -1
  393. package/lib/AWS/SNS/Publish.js.map +1 -1
  394. package/lib/AWS/SNS/PublishBatch.d.ts +4 -3
  395. package/lib/AWS/SNS/PublishBatch.d.ts.map +1 -1
  396. package/lib/AWS/SNS/PublishBatch.js.map +1 -1
  397. package/lib/AWS/SNS/PutDataProtectionPolicy.d.ts +4 -3
  398. package/lib/AWS/SNS/PutDataProtectionPolicy.d.ts.map +1 -1
  399. package/lib/AWS/SNS/PutDataProtectionPolicy.js.map +1 -1
  400. package/lib/AWS/SNS/RemovePermission.d.ts +4 -3
  401. package/lib/AWS/SNS/RemovePermission.d.ts.map +1 -1
  402. package/lib/AWS/SNS/RemovePermission.js.map +1 -1
  403. package/lib/AWS/SNS/SetSubscriptionAttributes.d.ts +4 -3
  404. package/lib/AWS/SNS/SetSubscriptionAttributes.d.ts.map +1 -1
  405. package/lib/AWS/SNS/SetSubscriptionAttributes.js.map +1 -1
  406. package/lib/AWS/SNS/SetTopicAttributes.d.ts +4 -3
  407. package/lib/AWS/SNS/SetTopicAttributes.d.ts.map +1 -1
  408. package/lib/AWS/SNS/SetTopicAttributes.js.map +1 -1
  409. package/lib/AWS/SNS/TagResource.d.ts +4 -3
  410. package/lib/AWS/SNS/TagResource.d.ts.map +1 -1
  411. package/lib/AWS/SNS/TagResource.js.map +1 -1
  412. package/lib/AWS/SNS/TopicSink.d.ts +4 -3
  413. package/lib/AWS/SNS/TopicSink.d.ts.map +1 -1
  414. package/lib/AWS/SNS/TopicSink.js.map +1 -1
  415. package/lib/AWS/SNS/UntagResource.d.ts +4 -3
  416. package/lib/AWS/SNS/UntagResource.d.ts.map +1 -1
  417. package/lib/AWS/SNS/UntagResource.js.map +1 -1
  418. package/lib/AWS/SQS/DeleteMessage.d.ts +4 -3
  419. package/lib/AWS/SQS/DeleteMessage.d.ts.map +1 -1
  420. package/lib/AWS/SQS/DeleteMessage.js.map +1 -1
  421. package/lib/AWS/SQS/DeleteMessageBatch.d.ts +4 -3
  422. package/lib/AWS/SQS/DeleteMessageBatch.d.ts.map +1 -1
  423. package/lib/AWS/SQS/DeleteMessageBatch.js.map +1 -1
  424. package/lib/AWS/SQS/Queue.js +1 -1
  425. package/lib/AWS/SQS/Queue.js.map +1 -1
  426. package/lib/AWS/SQS/QueueSink.d.ts +4 -3
  427. package/lib/AWS/SQS/QueueSink.d.ts.map +1 -1
  428. package/lib/AWS/SQS/QueueSink.js.map +1 -1
  429. package/lib/AWS/SQS/ReceiveMessage.d.ts +4 -3
  430. package/lib/AWS/SQS/ReceiveMessage.d.ts.map +1 -1
  431. package/lib/AWS/SQS/ReceiveMessage.js.map +1 -1
  432. package/lib/AWS/SQS/SendMessage.d.ts +4 -3
  433. package/lib/AWS/SQS/SendMessage.d.ts.map +1 -1
  434. package/lib/AWS/SQS/SendMessage.js.map +1 -1
  435. package/lib/AWS/SQS/SendMessageBatch.d.ts +4 -3
  436. package/lib/AWS/SQS/SendMessageBatch.d.ts.map +1 -1
  437. package/lib/AWS/SQS/SendMessageBatch.js.map +1 -1
  438. package/lib/AWS/SecretsManager/DescribeSecret.d.ts +4 -3
  439. package/lib/AWS/SecretsManager/DescribeSecret.d.ts.map +1 -1
  440. package/lib/AWS/SecretsManager/DescribeSecret.js.map +1 -1
  441. package/lib/AWS/SecretsManager/GetRandomPassword.d.ts +4 -3
  442. package/lib/AWS/SecretsManager/GetRandomPassword.d.ts.map +1 -1
  443. package/lib/AWS/SecretsManager/GetRandomPassword.js.map +1 -1
  444. package/lib/AWS/SecretsManager/GetSecretValue.d.ts +4 -3
  445. package/lib/AWS/SecretsManager/GetSecretValue.d.ts.map +1 -1
  446. package/lib/AWS/SecretsManager/GetSecretValue.js.map +1 -1
  447. package/lib/AWS/SecretsManager/ListSecrets.d.ts +4 -3
  448. package/lib/AWS/SecretsManager/ListSecrets.d.ts.map +1 -1
  449. package/lib/AWS/SecretsManager/ListSecrets.js.map +1 -1
  450. package/lib/AWS/SecretsManager/PutSecretValue.d.ts +4 -3
  451. package/lib/AWS/SecretsManager/PutSecretValue.d.ts.map +1 -1
  452. package/lib/AWS/SecretsManager/PutSecretValue.js.map +1 -1
  453. package/lib/AWS/StateStore/State.js +30 -6
  454. package/lib/AWS/StateStore/State.js.map +1 -1
  455. package/lib/AWS/Website/Router.d.ts.map +1 -1
  456. package/lib/AWS/Website/Router.js +7 -4
  457. package/lib/AWS/Website/Router.js.map +1 -1
  458. package/lib/AWS/Website/SsrSite.d.ts.map +1 -1
  459. package/lib/AWS/Website/SsrSite.js +3 -3
  460. package/lib/AWS/Website/SsrSite.js.map +1 -1
  461. package/lib/AWS/Website/StaticSite.d.ts +3 -3
  462. package/lib/AWS/Website/StaticSite.d.ts.map +1 -1
  463. package/lib/AWS/Website/StaticSite.js +9 -6
  464. package/lib/AWS/Website/StaticSite.js.map +1 -1
  465. package/lib/AdoptPolicy.d.ts +1 -1
  466. package/lib/AdoptPolicy.js +1 -1
  467. package/lib/Apply.d.ts.map +1 -1
  468. package/lib/Apply.js +16 -8
  469. package/lib/Apply.js.map +1 -1
  470. package/lib/Auth/Lock.d.ts.map +1 -1
  471. package/lib/Auth/Lock.js +4 -1
  472. package/lib/Auth/Lock.js.map +1 -1
  473. package/lib/Auth/Profile.d.ts +2 -1
  474. package/lib/Auth/Profile.d.ts.map +1 -1
  475. package/lib/Auth/Profile.js +28 -3
  476. package/lib/Auth/Profile.js.map +1 -1
  477. package/lib/Axiom/AuthProvider.js +2 -2
  478. package/lib/Axiom/AuthProvider.js.map +1 -1
  479. package/lib/Binding.d.ts +1 -1
  480. package/lib/Binding.d.ts.map +1 -1
  481. package/lib/Binding.js.map +1 -1
  482. package/lib/Bundle/Bundle.d.ts.map +1 -1
  483. package/lib/Bundle/Bundle.js +46 -4
  484. package/lib/Bundle/Bundle.js.map +1 -1
  485. package/lib/Bundle/Docker.d.ts +4 -1
  486. package/lib/Bundle/Docker.d.ts.map +1 -1
  487. package/lib/Bundle/Docker.js +21 -4
  488. package/lib/Bundle/Docker.js.map +1 -1
  489. package/lib/Bundle/InstalledPackages.d.ts +79 -0
  490. package/lib/Bundle/InstalledPackages.d.ts.map +1 -0
  491. package/lib/Bundle/InstalledPackages.js +364 -0
  492. package/lib/Bundle/InstalledPackages.js.map +1 -0
  493. package/lib/Bundle/TempRoot.js +1 -1
  494. package/lib/Bundle/TempRoot.js.map +1 -1
  495. package/lib/Bundle/index.d.ts +1 -0
  496. package/lib/Bundle/index.d.ts.map +1 -1
  497. package/lib/Bundle/index.js +1 -0
  498. package/lib/Bundle/index.js.map +1 -1
  499. package/lib/Cli/commands/aws.js +1 -1
  500. package/lib/Cli/commands/aws.js.map +1 -1
  501. package/lib/Cli/commands/cloudflare.d.ts.map +1 -1
  502. package/lib/Cli/commands/cloudflare.js +3 -3
  503. package/lib/Cli/commands/cloudflare.js.map +1 -1
  504. package/lib/Cli/commands/login.js +1 -1
  505. package/lib/Cli/commands/login.js.map +1 -1
  506. package/lib/Cli/commands/logs.js +1 -1
  507. package/lib/Cli/commands/logs.js.map +1 -1
  508. package/lib/Cli/commands/nuke.js +1 -1
  509. package/lib/Cli/commands/nuke.js.map +1 -1
  510. package/lib/Cli/commands/profile.js +2 -2
  511. package/lib/Cli/commands/profile.js.map +1 -1
  512. package/lib/Cli/commands/state.d.ts.map +1 -1
  513. package/lib/Cli/commands/state.js +6 -6
  514. package/lib/Cli/commands/state.js.map +1 -1
  515. package/lib/Cli/commands/tail.js +1 -1
  516. package/lib/Cli/commands/tail.js.map +1 -1
  517. package/lib/Cli/selectCli.d.ts +1 -8
  518. package/lib/Cli/selectCli.d.ts.map +1 -1
  519. package/lib/Cli/selectCli.js +2 -27
  520. package/lib/Cli/selectCli.js.map +1 -1
  521. package/lib/Cloudflare/Access/Application.d.ts.map +1 -1
  522. package/lib/Cloudflare/Access/Application.js +36 -3
  523. package/lib/Cloudflare/Access/Application.js.map +1 -1
  524. package/lib/Cloudflare/AiGateway/AiGateway.d.ts +96 -0
  525. package/lib/Cloudflare/AiGateway/AiGateway.d.ts.map +1 -1
  526. package/lib/Cloudflare/AiGateway/AiGateway.js +87 -0
  527. package/lib/Cloudflare/AiGateway/AiGateway.js.map +1 -1
  528. package/lib/Cloudflare/AiGateway/AiGatewayBinding.d.ts +4 -3
  529. package/lib/Cloudflare/AiGateway/AiGatewayBinding.d.ts.map +1 -1
  530. package/lib/Cloudflare/AiGateway/AiGatewayBinding.js.map +1 -1
  531. package/lib/Cloudflare/AiGateway/DurableObjectChatPersistence.d.ts +7 -0
  532. package/lib/Cloudflare/AiGateway/DurableObjectChatPersistence.d.ts.map +1 -0
  533. package/lib/Cloudflare/AiGateway/DurableObjectChatPersistence.js +45 -0
  534. package/lib/Cloudflare/AiGateway/DurableObjectChatPersistence.js.map +1 -0
  535. package/lib/Cloudflare/AiGateway/LanguageModel.js +1 -1
  536. package/lib/Cloudflare/AiGateway/LanguageModel.js.map +1 -1
  537. package/lib/Cloudflare/AiGateway/index.d.ts +1 -1
  538. package/lib/Cloudflare/AiGateway/index.d.ts.map +1 -1
  539. package/lib/Cloudflare/AiGateway/index.js +1 -1
  540. package/lib/Cloudflare/AiGateway/index.js.map +1 -1
  541. package/lib/Cloudflare/AiSearch/AiSearch.d.ts +3 -2
  542. package/lib/Cloudflare/AiSearch/AiSearch.d.ts.map +1 -1
  543. package/lib/Cloudflare/AiSearch/AiSearch.js +4 -3
  544. package/lib/Cloudflare/AiSearch/AiSearch.js.map +1 -1
  545. package/lib/Cloudflare/AiSearch/AiSearchBinding.d.ts +7 -6
  546. package/lib/Cloudflare/AiSearch/AiSearchBinding.d.ts.map +1 -1
  547. package/lib/Cloudflare/AiSearch/AiSearchBinding.js.map +1 -1
  548. package/lib/Cloudflare/AiSearch/AiSearchInstance.js +28 -14
  549. package/lib/Cloudflare/AiSearch/AiSearchInstance.js.map +1 -1
  550. package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDataset.d.ts.map +1 -1
  551. package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDataset.js +1 -1
  552. package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDataset.js.map +1 -1
  553. package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.d.ts +4 -3
  554. package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.d.ts.map +1 -1
  555. package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.js +2 -2
  556. package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.js.map +1 -1
  557. package/lib/Cloudflare/ApiShield/UserSchema.d.ts.map +1 -1
  558. package/lib/Cloudflare/ApiShield/UserSchema.js +4 -1
  559. package/lib/Cloudflare/ApiShield/UserSchema.js.map +1 -1
  560. package/lib/Cloudflare/Artifacts/ArtifactsBinding.d.ts +4 -3
  561. package/lib/Cloudflare/Artifacts/ArtifactsBinding.d.ts.map +1 -1
  562. package/lib/Cloudflare/Artifacts/ArtifactsBinding.js.map +1 -1
  563. package/lib/Cloudflare/Auth/AuthProvider.d.ts +1 -0
  564. package/lib/Cloudflare/Auth/AuthProvider.d.ts.map +1 -1
  565. package/lib/Cloudflare/Auth/AuthProvider.js +5 -3
  566. package/lib/Cloudflare/Auth/AuthProvider.js.map +1 -1
  567. package/lib/Cloudflare/Browser/BrowserBinding.d.ts +4 -3
  568. package/lib/Cloudflare/Browser/BrowserBinding.d.ts.map +1 -1
  569. package/lib/Cloudflare/Browser/BrowserBinding.js.map +1 -1
  570. package/lib/Cloudflare/Cache/RegionalTieredCache.d.ts.map +1 -1
  571. package/lib/Cloudflare/Cache/RegionalTieredCache.js +15 -1
  572. package/lib/Cloudflare/Cache/RegionalTieredCache.js.map +1 -1
  573. package/lib/Cloudflare/ClientCertificate/ClientCertificate.d.ts.map +1 -1
  574. package/lib/Cloudflare/ClientCertificate/ClientCertificate.js +17 -10
  575. package/lib/Cloudflare/ClientCertificate/ClientCertificate.js.map +1 -1
  576. package/lib/Cloudflare/CloudflareEnvironment.d.ts +1 -0
  577. package/lib/Cloudflare/CloudflareEnvironment.d.ts.map +1 -1
  578. package/lib/Cloudflare/CloudflareEnvironment.js +1 -0
  579. package/lib/Cloudflare/CloudflareEnvironment.js.map +1 -1
  580. package/lib/Cloudflare/Container/Container.d.ts +233 -81
  581. package/lib/Cloudflare/Container/Container.d.ts.map +1 -1
  582. package/lib/Cloudflare/Container/Container.js +181 -116
  583. package/lib/Cloudflare/Container/Container.js.map +1 -1
  584. package/lib/Cloudflare/Container/ContainerApplication.d.ts +67 -13
  585. package/lib/Cloudflare/Container/ContainerApplication.d.ts.map +1 -1
  586. package/lib/Cloudflare/Container/ContainerApplication.js +2 -557
  587. package/lib/Cloudflare/Container/ContainerApplication.js.map +1 -1
  588. package/lib/Cloudflare/Container/ContainerBundle.d.ts +26 -0
  589. package/lib/Cloudflare/Container/ContainerBundle.d.ts.map +1 -1
  590. package/lib/Cloudflare/Container/ContainerBundle.js +65 -2
  591. package/lib/Cloudflare/Container/ContainerBundle.js.map +1 -1
  592. package/lib/Cloudflare/Container/ContainerPlatform.d.ts +5 -0
  593. package/lib/Cloudflare/Container/ContainerPlatform.d.ts.map +1 -0
  594. package/lib/Cloudflare/Container/ContainerPlatform.js +129 -0
  595. package/lib/Cloudflare/Container/ContainerPlatform.js.map +1 -0
  596. package/lib/Cloudflare/Container/ContainerProvider.d.ts +10 -0
  597. package/lib/Cloudflare/Container/ContainerProvider.d.ts.map +1 -0
  598. package/lib/Cloudflare/Container/ContainerProvider.js +684 -0
  599. package/lib/Cloudflare/Container/ContainerProvider.js.map +1 -0
  600. package/lib/Cloudflare/Container/LocalContainerProvider.d.ts.map +1 -1
  601. package/lib/Cloudflare/Container/LocalContainerProvider.js +8 -8
  602. package/lib/Cloudflare/Container/LocalContainerProvider.js.map +1 -1
  603. package/lib/Cloudflare/Container/StartContainer.d.ts +3 -19
  604. package/lib/Cloudflare/Container/StartContainer.d.ts.map +1 -1
  605. package/lib/Cloudflare/Container/StartContainer.js +41 -7
  606. package/lib/Cloudflare/Container/StartContainer.js.map +1 -1
  607. package/lib/Cloudflare/Container/index.d.ts +2 -1
  608. package/lib/Cloudflare/Container/index.d.ts.map +1 -1
  609. package/lib/Cloudflare/Container/index.js +2 -1
  610. package/lib/Cloudflare/Container/index.js.map +1 -1
  611. package/lib/Cloudflare/Credentials.d.ts +5 -0
  612. package/lib/Cloudflare/Credentials.d.ts.map +1 -1
  613. package/lib/Cloudflare/Credentials.js.map +1 -1
  614. package/lib/Cloudflare/D1/D1Connection.d.ts +4 -3
  615. package/lib/Cloudflare/D1/D1Connection.d.ts.map +1 -1
  616. package/lib/Cloudflare/D1/D1Connection.js.map +1 -1
  617. package/lib/Cloudflare/Dns/DnsBinding.d.ts +2 -11
  618. package/lib/Cloudflare/Dns/DnsBinding.d.ts.map +1 -1
  619. package/lib/Cloudflare/Dns/DnsBinding.js +0 -11
  620. package/lib/Cloudflare/Dns/DnsBinding.js.map +1 -1
  621. package/lib/Cloudflare/Dns/DnsRead.d.ts +3 -2
  622. package/lib/Cloudflare/Dns/DnsRead.d.ts.map +1 -1
  623. package/lib/Cloudflare/Dns/DnsRead.js +3 -2
  624. package/lib/Cloudflare/Dns/DnsRead.js.map +1 -1
  625. package/lib/Cloudflare/Dns/DnsReadWrite.d.ts +3 -2
  626. package/lib/Cloudflare/Dns/DnsReadWrite.d.ts.map +1 -1
  627. package/lib/Cloudflare/Dns/DnsReadWrite.js.map +1 -1
  628. package/lib/Cloudflare/Dns/DnsWrite.d.ts +3 -2
  629. package/lib/Cloudflare/Dns/DnsWrite.d.ts.map +1 -1
  630. package/lib/Cloudflare/Dns/DnsWrite.js +3 -2
  631. package/lib/Cloudflare/Dns/DnsWrite.js.map +1 -1
  632. package/lib/Cloudflare/Email/EmailCatchAll.js +1 -1
  633. package/lib/Cloudflare/Email/EmailCatchAll.js.map +1 -1
  634. package/lib/Cloudflare/Email/EmailRouting.js +1 -1
  635. package/lib/Cloudflare/Email/EmailRouting.js.map +1 -1
  636. package/lib/Cloudflare/Email/EmailRule.js +1 -1
  637. package/lib/Cloudflare/Email/EmailRule.js.map +1 -1
  638. package/lib/Cloudflare/Email/SendEmail.js +1 -1
  639. package/lib/Cloudflare/Email/SendEmail.js.map +1 -1
  640. package/lib/Cloudflare/Email/SendEmailBinding.d.ts +4 -3
  641. package/lib/Cloudflare/Email/SendEmailBinding.d.ts.map +1 -1
  642. package/lib/Cloudflare/Email/SendEmailBinding.js +2 -2
  643. package/lib/Cloudflare/Email/SendEmailBinding.js.map +1 -1
  644. package/lib/Cloudflare/Fetcher.d.ts +1 -5
  645. package/lib/Cloudflare/Fetcher.d.ts.map +1 -1
  646. package/lib/Cloudflare/Fetcher.js +77 -12
  647. package/lib/Cloudflare/Fetcher.js.map +1 -1
  648. package/lib/Cloudflare/Flagship/FlagshipBinding.d.ts +4 -3
  649. package/lib/Cloudflare/Flagship/FlagshipBinding.d.ts.map +1 -1
  650. package/lib/Cloudflare/Flagship/FlagshipBinding.js.map +1 -1
  651. package/lib/Cloudflare/GoogleTagGateway/GoogleTagGateway.js +1 -1
  652. package/lib/Cloudflare/GoogleTagGateway/GoogleTagGateway.js.map +1 -1
  653. package/lib/Cloudflare/HttpClientUtils.d.ts +13 -0
  654. package/lib/Cloudflare/HttpClientUtils.d.ts.map +1 -0
  655. package/lib/Cloudflare/HttpClientUtils.js +11 -0
  656. package/lib/Cloudflare/HttpClientUtils.js.map +1 -0
  657. package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.d.ts +4 -3
  658. package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.d.ts.map +1 -1
  659. package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.js.map +1 -1
  660. package/lib/Cloudflare/Iam/UserGroupMembership.d.ts.map +1 -1
  661. package/lib/Cloudflare/Iam/UserGroupMembership.js +6 -1
  662. package/lib/Cloudflare/Iam/UserGroupMembership.js.map +1 -1
  663. package/lib/Cloudflare/Images/ImagesBinding.d.ts +4 -3
  664. package/lib/Cloudflare/Images/ImagesBinding.d.ts.map +1 -1
  665. package/lib/Cloudflare/Images/ImagesBinding.js.map +1 -1
  666. package/lib/Cloudflare/Images/Variant.d.ts.map +1 -1
  667. package/lib/Cloudflare/Images/Variant.js +15 -3
  668. package/lib/Cloudflare/Images/Variant.js.map +1 -1
  669. package/lib/Cloudflare/KV/{KVNamespace.d.ts → Namespace.d.ts} +9 -7
  670. package/lib/Cloudflare/KV/Namespace.d.ts.map +1 -0
  671. package/lib/Cloudflare/KV/{KVNamespace.js → Namespace.js} +10 -7
  672. package/lib/Cloudflare/KV/Namespace.js.map +1 -0
  673. package/lib/Cloudflare/KV/NamespaceBinding.d.ts +24 -0
  674. package/lib/Cloudflare/KV/NamespaceBinding.d.ts.map +1 -0
  675. package/lib/Cloudflare/KV/NamespaceBinding.js +46 -0
  676. package/lib/Cloudflare/KV/NamespaceBinding.js.map +1 -0
  677. package/lib/Cloudflare/KV/NamespaceHttp.d.ts +36 -0
  678. package/lib/Cloudflare/KV/NamespaceHttp.d.ts.map +1 -0
  679. package/lib/Cloudflare/KV/NamespaceHttp.js +57 -0
  680. package/lib/Cloudflare/KV/NamespaceHttp.js.map +1 -0
  681. package/lib/Cloudflare/KV/{KVNamespaceBinding.d.ts → NamespaceRead.d.ts} +15 -30
  682. package/lib/Cloudflare/KV/NamespaceRead.d.ts.map +1 -0
  683. package/lib/Cloudflare/KV/NamespaceRead.js +11 -0
  684. package/lib/Cloudflare/KV/NamespaceRead.js.map +1 -0
  685. package/lib/Cloudflare/KV/NamespaceReadBinding.d.ts +11 -0
  686. package/lib/Cloudflare/KV/NamespaceReadBinding.d.ts.map +1 -0
  687. package/lib/Cloudflare/KV/NamespaceReadBinding.js +19 -0
  688. package/lib/Cloudflare/KV/NamespaceReadBinding.js.map +1 -0
  689. package/lib/Cloudflare/KV/NamespaceReadHttp.d.ts +16 -0
  690. package/lib/Cloudflare/KV/NamespaceReadHttp.d.ts.map +1 -0
  691. package/lib/Cloudflare/KV/NamespaceReadHttp.js +93 -0
  692. package/lib/Cloudflare/KV/NamespaceReadHttp.js.map +1 -0
  693. package/lib/Cloudflare/KV/NamespaceReadWrite.d.ts +20 -0
  694. package/lib/Cloudflare/KV/NamespaceReadWrite.d.ts.map +1 -0
  695. package/lib/Cloudflare/KV/NamespaceReadWrite.js +11 -0
  696. package/lib/Cloudflare/KV/NamespaceReadWrite.js.map +1 -0
  697. package/lib/Cloudflare/KV/NamespaceReadWriteBinding.d.ts +11 -0
  698. package/lib/Cloudflare/KV/NamespaceReadWriteBinding.d.ts.map +1 -0
  699. package/lib/Cloudflare/KV/NamespaceReadWriteBinding.js +17 -0
  700. package/lib/Cloudflare/KV/NamespaceReadWriteBinding.js.map +1 -0
  701. package/lib/Cloudflare/KV/NamespaceReadWriteHttp.d.ts +17 -0
  702. package/lib/Cloudflare/KV/NamespaceReadWriteHttp.d.ts.map +1 -0
  703. package/lib/Cloudflare/KV/NamespaceReadWriteHttp.js +22 -0
  704. package/lib/Cloudflare/KV/NamespaceReadWriteHttp.js.map +1 -0
  705. package/lib/Cloudflare/KV/NamespaceTypes.d.ts +10 -0
  706. package/lib/Cloudflare/KV/NamespaceTypes.d.ts.map +1 -0
  707. package/lib/Cloudflare/KV/NamespaceTypes.js +4 -0
  708. package/lib/Cloudflare/KV/NamespaceTypes.js.map +1 -0
  709. package/lib/Cloudflare/KV/NamespaceWrite.d.ts +22 -0
  710. package/lib/Cloudflare/KV/NamespaceWrite.d.ts.map +1 -0
  711. package/lib/Cloudflare/KV/NamespaceWrite.js +11 -0
  712. package/lib/Cloudflare/KV/NamespaceWrite.js.map +1 -0
  713. package/lib/Cloudflare/KV/NamespaceWriteBinding.d.ts +11 -0
  714. package/lib/Cloudflare/KV/NamespaceWriteBinding.d.ts.map +1 -0
  715. package/lib/Cloudflare/KV/NamespaceWriteBinding.js +17 -0
  716. package/lib/Cloudflare/KV/NamespaceWriteBinding.js.map +1 -0
  717. package/lib/Cloudflare/KV/NamespaceWriteHttp.d.ts +16 -0
  718. package/lib/Cloudflare/KV/NamespaceWriteHttp.d.ts.map +1 -0
  719. package/lib/Cloudflare/KV/NamespaceWriteHttp.js +54 -0
  720. package/lib/Cloudflare/KV/NamespaceWriteHttp.js.map +1 -0
  721. package/lib/Cloudflare/KV/index.d.ts +11 -2
  722. package/lib/Cloudflare/KV/index.d.ts.map +1 -1
  723. package/lib/Cloudflare/KV/index.js +11 -2
  724. package/lib/Cloudflare/KV/index.js.map +1 -1
  725. package/lib/Cloudflare/Providers.d.ts +2 -2
  726. package/lib/Cloudflare/Providers.d.ts.map +1 -1
  727. package/lib/Cloudflare/Providers.js +5 -13
  728. package/lib/Cloudflare/Providers.js.map +1 -1
  729. package/lib/Cloudflare/Queue/Queue.d.ts +8 -8
  730. package/lib/Cloudflare/Queue/Queue.d.ts.map +1 -1
  731. package/lib/Cloudflare/Queue/Queue.js +9 -9
  732. package/lib/Cloudflare/Queue/Queue.js.map +1 -1
  733. package/lib/Cloudflare/Queue/QueueBinding.d.ts +17 -65
  734. package/lib/Cloudflare/Queue/QueueBinding.d.ts.map +1 -1
  735. package/lib/Cloudflare/Queue/QueueBinding.js +35 -78
  736. package/lib/Cloudflare/Queue/QueueBinding.js.map +1 -1
  737. package/lib/Cloudflare/Queue/QueueEventSource.d.ts +5 -4
  738. package/lib/Cloudflare/Queue/QueueEventSource.d.ts.map +1 -1
  739. package/lib/Cloudflare/Queue/QueueEventSource.js +1 -1
  740. package/lib/Cloudflare/Queue/QueueEventSource.js.map +1 -1
  741. package/lib/Cloudflare/Queue/QueueHttp.d.ts +36 -0
  742. package/lib/Cloudflare/Queue/QueueHttp.d.ts.map +1 -0
  743. package/lib/Cloudflare/Queue/QueueHttp.js +57 -0
  744. package/lib/Cloudflare/Queue/QueueHttp.js.map +1 -0
  745. package/lib/Cloudflare/Queue/QueueTypes.d.ts +19 -0
  746. package/lib/Cloudflare/Queue/QueueTypes.d.ts.map +1 -0
  747. package/lib/Cloudflare/Queue/QueueTypes.js +4 -0
  748. package/lib/Cloudflare/Queue/QueueTypes.js.map +1 -0
  749. package/lib/Cloudflare/Queue/QueueWrite.d.ts +55 -0
  750. package/lib/Cloudflare/Queue/QueueWrite.d.ts.map +1 -0
  751. package/lib/Cloudflare/Queue/QueueWrite.js +42 -0
  752. package/lib/Cloudflare/Queue/QueueWrite.js.map +1 -0
  753. package/lib/Cloudflare/Queue/QueueWriteBinding.d.ts +11 -0
  754. package/lib/Cloudflare/Queue/QueueWriteBinding.d.ts.map +1 -0
  755. package/lib/Cloudflare/Queue/QueueWriteBinding.js +19 -0
  756. package/lib/Cloudflare/Queue/QueueWriteBinding.js.map +1 -0
  757. package/lib/Cloudflare/Queue/QueueWriteHttp.d.ts +22 -0
  758. package/lib/Cloudflare/Queue/QueueWriteHttp.d.ts.map +1 -0
  759. package/lib/Cloudflare/Queue/QueueWriteHttp.js +50 -0
  760. package/lib/Cloudflare/Queue/QueueWriteHttp.js.map +1 -0
  761. package/lib/Cloudflare/Queue/index.d.ts +4 -1
  762. package/lib/Cloudflare/Queue/index.d.ts.map +1 -1
  763. package/lib/Cloudflare/Queue/index.js +4 -1
  764. package/lib/Cloudflare/Queue/index.js.map +1 -1
  765. package/lib/Cloudflare/R2/{R2Bucket.d.ts → Bucket.d.ts} +5 -9
  766. package/lib/Cloudflare/R2/Bucket.d.ts.map +1 -0
  767. package/lib/Cloudflare/R2/{R2Bucket.js → Bucket.js} +6 -9
  768. package/lib/Cloudflare/R2/Bucket.js.map +1 -0
  769. package/lib/Cloudflare/R2/BucketBinding.d.ts +31 -0
  770. package/lib/Cloudflare/R2/BucketBinding.d.ts.map +1 -0
  771. package/lib/Cloudflare/R2/BucketBinding.js +83 -0
  772. package/lib/Cloudflare/R2/BucketBinding.js.map +1 -0
  773. package/lib/Cloudflare/R2/BucketEventNotification.d.ts +1 -1
  774. package/lib/Cloudflare/R2/BucketEventNotification.d.ts.map +1 -1
  775. package/lib/Cloudflare/R2/BucketHttp.d.ts +59 -0
  776. package/lib/Cloudflare/R2/BucketHttp.d.ts.map +1 -0
  777. package/lib/Cloudflare/R2/BucketHttp.js +129 -0
  778. package/lib/Cloudflare/R2/BucketHttp.js.map +1 -0
  779. package/lib/Cloudflare/R2/BucketRead.d.ts +28 -0
  780. package/lib/Cloudflare/R2/BucketRead.d.ts.map +1 -0
  781. package/lib/Cloudflare/R2/BucketRead.js +11 -0
  782. package/lib/Cloudflare/R2/BucketRead.js.map +1 -0
  783. package/lib/Cloudflare/R2/BucketReadBinding.d.ts +10 -0
  784. package/lib/Cloudflare/R2/BucketReadBinding.d.ts.map +1 -0
  785. package/lib/Cloudflare/R2/BucketReadBinding.js +24 -0
  786. package/lib/Cloudflare/R2/BucketReadBinding.js.map +1 -0
  787. package/lib/Cloudflare/R2/BucketReadHttp.d.ts +15 -0
  788. package/lib/Cloudflare/R2/BucketReadHttp.d.ts.map +1 -0
  789. package/lib/Cloudflare/R2/BucketReadHttp.js +109 -0
  790. package/lib/Cloudflare/R2/BucketReadHttp.js.map +1 -0
  791. package/lib/Cloudflare/R2/BucketReadWrite.d.ts +20 -0
  792. package/lib/Cloudflare/R2/BucketReadWrite.d.ts.map +1 -0
  793. package/lib/Cloudflare/R2/BucketReadWrite.js +11 -0
  794. package/lib/Cloudflare/R2/BucketReadWrite.js.map +1 -0
  795. package/lib/Cloudflare/R2/BucketReadWriteBinding.d.ts +10 -0
  796. package/lib/Cloudflare/R2/BucketReadWriteBinding.d.ts.map +1 -0
  797. package/lib/Cloudflare/R2/BucketReadWriteBinding.js +16 -0
  798. package/lib/Cloudflare/R2/BucketReadWriteBinding.js.map +1 -0
  799. package/lib/Cloudflare/R2/BucketReadWriteHttp.d.ts +16 -0
  800. package/lib/Cloudflare/R2/BucketReadWriteHttp.d.ts.map +1 -0
  801. package/lib/Cloudflare/R2/BucketReadWriteHttp.js +21 -0
  802. package/lib/Cloudflare/R2/BucketReadWriteHttp.js.map +1 -0
  803. package/lib/Cloudflare/R2/BucketSippy.d.ts +1 -1
  804. package/lib/Cloudflare/R2/BucketSippy.d.ts.map +1 -1
  805. package/lib/Cloudflare/R2/BucketTypes.d.ts +52 -0
  806. package/lib/Cloudflare/R2/BucketTypes.d.ts.map +1 -0
  807. package/lib/Cloudflare/R2/BucketTypes.js +6 -0
  808. package/lib/Cloudflare/R2/BucketTypes.js.map +1 -0
  809. package/lib/Cloudflare/R2/BucketWrite.d.ts +32 -0
  810. package/lib/Cloudflare/R2/BucketWrite.d.ts.map +1 -0
  811. package/lib/Cloudflare/R2/BucketWrite.js +12 -0
  812. package/lib/Cloudflare/R2/BucketWrite.js.map +1 -0
  813. package/lib/Cloudflare/R2/BucketWriteBinding.d.ts +10 -0
  814. package/lib/Cloudflare/R2/BucketWriteBinding.d.ts.map +1 -0
  815. package/lib/Cloudflare/R2/BucketWriteBinding.js +46 -0
  816. package/lib/Cloudflare/R2/BucketWriteBinding.js.map +1 -0
  817. package/lib/Cloudflare/R2/BucketWriteHttp.d.ts +16 -0
  818. package/lib/Cloudflare/R2/BucketWriteHttp.d.ts.map +1 -0
  819. package/lib/Cloudflare/R2/BucketWriteHttp.js +72 -0
  820. package/lib/Cloudflare/R2/BucketWriteHttp.js.map +1 -0
  821. package/lib/Cloudflare/R2/index.d.ts +10 -2
  822. package/lib/Cloudflare/R2/index.d.ts.map +1 -1
  823. package/lib/Cloudflare/R2/index.js +10 -2
  824. package/lib/Cloudflare/R2/index.js.map +1 -1
  825. package/lib/Cloudflare/RateLimit/RateLimitBinding.d.ts +4 -3
  826. package/lib/Cloudflare/RateLimit/RateLimitBinding.d.ts.map +1 -1
  827. package/lib/Cloudflare/RateLimit/RateLimitBinding.js.map +1 -1
  828. package/lib/Cloudflare/SecretsStore/SecretBinding.d.ts +4 -3
  829. package/lib/Cloudflare/SecretsStore/SecretBinding.d.ts.map +1 -1
  830. package/lib/Cloudflare/SecretsStore/SecretBinding.js.map +1 -1
  831. package/lib/Cloudflare/StateStore/Api.d.ts +6 -6
  832. package/lib/Cloudflare/StateStore/Api.js +1 -1
  833. package/lib/Cloudflare/StateStore/Api.js.map +1 -1
  834. package/lib/Cloudflare/StateStore/State.d.ts +1 -1
  835. package/lib/Cloudflare/StateStore/State.d.ts.map +1 -1
  836. package/lib/Cloudflare/StateStore/State.js +6 -5
  837. package/lib/Cloudflare/StateStore/State.js.map +1 -1
  838. package/lib/Cloudflare/StateStore/Store.d.ts +13 -13
  839. package/lib/Cloudflare/StateStore/Store.d.ts.map +1 -1
  840. package/lib/Cloudflare/StateStore/Store.js +5 -7
  841. package/lib/Cloudflare/StateStore/Store.js.map +1 -1
  842. package/lib/Cloudflare/Tunnel/Tunnel.js +1 -1
  843. package/lib/Cloudflare/Tunnel/Tunnel.js.map +1 -1
  844. package/lib/Cloudflare/Tunnel/TunnelBinding.d.ts +2 -11
  845. package/lib/Cloudflare/Tunnel/TunnelBinding.d.ts.map +1 -1
  846. package/lib/Cloudflare/Tunnel/TunnelBinding.js +0 -10
  847. package/lib/Cloudflare/Tunnel/TunnelBinding.js.map +1 -1
  848. package/lib/Cloudflare/Tunnel/TunnelRead.d.ts +3 -2
  849. package/lib/Cloudflare/Tunnel/TunnelRead.d.ts.map +1 -1
  850. package/lib/Cloudflare/Tunnel/TunnelRead.js +2 -1
  851. package/lib/Cloudflare/Tunnel/TunnelRead.js.map +1 -1
  852. package/lib/Cloudflare/Tunnel/TunnelReadWrite.d.ts +3 -2
  853. package/lib/Cloudflare/Tunnel/TunnelReadWrite.d.ts.map +1 -1
  854. package/lib/Cloudflare/Tunnel/TunnelReadWrite.js.map +1 -1
  855. package/lib/Cloudflare/Tunnel/TunnelWrite.d.ts +3 -2
  856. package/lib/Cloudflare/Tunnel/TunnelWrite.d.ts.map +1 -1
  857. package/lib/Cloudflare/Tunnel/TunnelWrite.js +2 -1
  858. package/lib/Cloudflare/Tunnel/TunnelWrite.js.map +1 -1
  859. package/lib/Cloudflare/Tunnel/WarpConnector.js +1 -1
  860. package/lib/Cloudflare/Tunnel/WarpConnector.js.map +1 -1
  861. package/lib/Cloudflare/UrlNormalization/UrlNormalization.d.ts.map +1 -1
  862. package/lib/Cloudflare/UrlNormalization/UrlNormalization.js +10 -1
  863. package/lib/Cloudflare/UrlNormalization/UrlNormalization.js.map +1 -1
  864. package/lib/Cloudflare/Vectorize/VectorizeIndexBinding.d.ts +4 -3
  865. package/lib/Cloudflare/Vectorize/VectorizeIndexBinding.d.ts.map +1 -1
  866. package/lib/Cloudflare/Vectorize/VectorizeIndexBinding.js.map +1 -1
  867. package/lib/Cloudflare/VpcService/VpcService.js +1 -1
  868. package/lib/Cloudflare/VpcService/VpcService.js.map +1 -1
  869. package/lib/Cloudflare/WaitingRoom/Settings.d.ts.map +1 -1
  870. package/lib/Cloudflare/WaitingRoom/Settings.js +17 -3
  871. package/lib/Cloudflare/WaitingRoom/Settings.js.map +1 -1
  872. package/lib/Cloudflare/Website/StaticSite.d.ts +5 -4
  873. package/lib/Cloudflare/Website/StaticSite.d.ts.map +1 -1
  874. package/lib/Cloudflare/Website/StaticSite.js +8 -8
  875. package/lib/Cloudflare/Website/StaticSite.js.map +1 -1
  876. package/lib/Cloudflare/Website/Vite.d.ts +1 -1
  877. package/lib/Cloudflare/Website/Vite.d.ts.map +1 -1
  878. package/lib/Cloudflare/Workers/AccountSetting.d.ts.map +1 -1
  879. package/lib/Cloudflare/Workers/AccountSetting.js +12 -4
  880. package/lib/Cloudflare/Workers/AccountSetting.js.map +1 -1
  881. package/lib/Cloudflare/Workers/Assets.js +6 -6
  882. package/lib/Cloudflare/Workers/Assets.js.map +1 -1
  883. package/lib/Cloudflare/Workers/CronEventSource.d.ts +4 -3
  884. package/lib/Cloudflare/Workers/CronEventSource.d.ts.map +1 -1
  885. package/lib/Cloudflare/Workers/CronEventSource.js +1 -1
  886. package/lib/Cloudflare/Workers/CronEventSource.js.map +1 -1
  887. package/lib/Cloudflare/Workers/DurableObjectBridge.d.ts.map +1 -1
  888. package/lib/Cloudflare/Workers/DurableObjectBridge.js +15 -9
  889. package/lib/Cloudflare/Workers/DurableObjectBridge.js.map +1 -1
  890. package/lib/Cloudflare/Workers/DurableObjectChatPersistence.d.ts.map +1 -1
  891. package/lib/Cloudflare/Workers/DurableObjectChatPersistence.js +7 -6
  892. package/lib/Cloudflare/Workers/DurableObjectChatPersistence.js.map +1 -1
  893. package/lib/Cloudflare/Workers/DurableObjectNamespace.d.ts +67 -52
  894. package/lib/Cloudflare/Workers/DurableObjectNamespace.d.ts.map +1 -1
  895. package/lib/Cloudflare/Workers/DurableObjectNamespace.js +75 -50
  896. package/lib/Cloudflare/Workers/DurableObjectNamespace.js.map +1 -1
  897. package/lib/Cloudflare/Workers/DurableObjectState.d.ts +11 -10
  898. package/lib/Cloudflare/Workers/DurableObjectState.d.ts.map +1 -1
  899. package/lib/Cloudflare/Workers/DurableObjectState.js.map +1 -1
  900. package/lib/Cloudflare/Workers/DurableObjectStorage.d.ts +35 -35
  901. package/lib/Cloudflare/Workers/DurableObjectStorage.d.ts.map +1 -1
  902. package/lib/Cloudflare/Workers/DurableObjectStorage.js +0 -1
  903. package/lib/Cloudflare/Workers/DurableObjectStorage.js.map +1 -1
  904. package/lib/Cloudflare/Workers/Fetch.d.ts +4 -3
  905. package/lib/Cloudflare/Workers/Fetch.d.ts.map +1 -1
  906. package/lib/Cloudflare/Workers/Fetch.js.map +1 -1
  907. package/lib/Cloudflare/Workers/GitHubRepositoryEventSource.d.ts +4 -3
  908. package/lib/Cloudflare/Workers/GitHubRepositoryEventSource.d.ts.map +1 -1
  909. package/lib/Cloudflare/Workers/GitHubRepositoryEventSource.js.map +1 -1
  910. package/lib/Cloudflare/Workers/InferEnv.d.ts +1 -1
  911. package/lib/Cloudflare/Workers/InferEnv.d.ts.map +1 -1
  912. package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
  913. package/lib/Cloudflare/Workers/LocalWorkerProvider.js +14 -15
  914. package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
  915. package/lib/Cloudflare/Workers/Rpc.d.ts +1 -75
  916. package/lib/Cloudflare/Workers/Rpc.d.ts.map +1 -1
  917. package/lib/Cloudflare/Workers/Rpc.js +7 -162
  918. package/lib/Cloudflare/Workers/Rpc.js.map +1 -1
  919. package/lib/Cloudflare/Workers/RpcDurableObjectNamespace.d.ts +8 -6
  920. package/lib/Cloudflare/Workers/RpcDurableObjectNamespace.d.ts.map +1 -1
  921. package/lib/Cloudflare/Workers/RpcDurableObjectNamespace.js +5 -4
  922. package/lib/Cloudflare/Workers/RpcDurableObjectNamespace.js.map +1 -1
  923. package/lib/Cloudflare/Workers/RpcWorker.d.ts +4 -3
  924. package/lib/Cloudflare/Workers/RpcWorker.d.ts.map +1 -1
  925. package/lib/Cloudflare/Workers/RpcWorker.js +3 -3
  926. package/lib/Cloudflare/Workers/RpcWorker.js.map +1 -1
  927. package/lib/Cloudflare/Workers/ScheduledEvents.d.ts +5 -4
  928. package/lib/Cloudflare/Workers/ScheduledEvents.d.ts.map +1 -1
  929. package/lib/Cloudflare/Workers/ScheduledEvents.js +2 -2
  930. package/lib/Cloudflare/Workers/ScheduledEvents.js.map +1 -1
  931. package/lib/Cloudflare/Workers/VersionMetadataBinding.d.ts +4 -3
  932. package/lib/Cloudflare/Workers/VersionMetadataBinding.d.ts.map +1 -1
  933. package/lib/Cloudflare/Workers/VersionMetadataBinding.js.map +1 -1
  934. package/lib/Cloudflare/Workers/WebSocket.d.ts +1 -1
  935. package/lib/Cloudflare/Workers/WebSocket.d.ts.map +1 -1
  936. package/lib/Cloudflare/Workers/WebSocket.js +1 -1
  937. package/lib/Cloudflare/Workers/WebSocket.js.map +1 -1
  938. package/lib/Cloudflare/Workers/Worker.d.ts +64 -33
  939. package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
  940. package/lib/Cloudflare/Workers/Worker.js +22 -1297
  941. package/lib/Cloudflare/Workers/Worker.js.map +1 -1
  942. package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts.map +1 -1
  943. package/lib/Cloudflare/Workers/WorkerAsyncBindings.js +5 -5
  944. package/lib/Cloudflare/Workers/WorkerAsyncBindings.js.map +1 -1
  945. package/lib/Cloudflare/Workers/WorkerBinding.d.ts +15 -14
  946. package/lib/Cloudflare/Workers/WorkerBinding.d.ts.map +1 -1
  947. package/lib/Cloudflare/Workers/WorkerBinding.js +1 -1
  948. package/lib/Cloudflare/Workers/WorkerBinding.js.map +1 -1
  949. package/lib/Cloudflare/Workers/WorkerBridge.d.ts.map +1 -1
  950. package/lib/Cloudflare/Workers/WorkerBridge.js +22 -18
  951. package/lib/Cloudflare/Workers/WorkerBridge.js.map +1 -1
  952. package/lib/Cloudflare/Workers/WorkerBundle.d.ts.map +1 -1
  953. package/lib/Cloudflare/Workers/WorkerBundle.js +3 -3
  954. package/lib/Cloudflare/Workers/WorkerBundle.js.map +1 -1
  955. package/lib/Cloudflare/Workers/{DynamicWorkerLoader.d.ts → WorkerLoader.d.ts} +47 -98
  956. package/lib/Cloudflare/Workers/WorkerLoader.d.ts.map +1 -0
  957. package/lib/Cloudflare/Workers/{DynamicWorkerLoader.js → WorkerLoader.js} +40 -32
  958. package/lib/Cloudflare/Workers/WorkerLoader.js.map +1 -0
  959. package/lib/Cloudflare/Workers/WorkerProvider.d.ts +9 -0
  960. package/lib/Cloudflare/Workers/WorkerProvider.d.ts.map +1 -0
  961. package/lib/Cloudflare/Workers/WorkerProvider.js +1318 -0
  962. package/lib/Cloudflare/Workers/WorkerProvider.js.map +1 -0
  963. package/lib/Cloudflare/Workers/Workflow.d.ts +3 -2
  964. package/lib/Cloudflare/Workers/Workflow.d.ts.map +1 -1
  965. package/lib/Cloudflare/Workers/Workflow.js +4 -4
  966. package/lib/Cloudflare/Workers/Workflow.js.map +1 -1
  967. package/lib/Cloudflare/Workers/index.d.ts +2 -2
  968. package/lib/Cloudflare/Workers/index.d.ts.map +1 -1
  969. package/lib/Cloudflare/Workers/index.js +2 -2
  970. package/lib/Cloudflare/Workers/index.js.map +1 -1
  971. package/lib/Cloudflare/Zaraz/ZarazConfig.js +1 -1
  972. package/lib/Cloudflare/Zaraz/ZarazConfig.js.map +1 -1
  973. package/lib/Cloudflare/Zone/Hold.d.ts.map +1 -1
  974. package/lib/Cloudflare/Zone/Hold.js +15 -1
  975. package/lib/Cloudflare/Zone/Hold.js.map +1 -1
  976. package/lib/Cloudflare/index.d.ts +3 -0
  977. package/lib/Cloudflare/index.d.ts.map +1 -1
  978. package/lib/Cloudflare/index.js +3 -0
  979. package/lib/Cloudflare/index.js.map +1 -1
  980. package/lib/Command/Build.d.ts +98 -0
  981. package/lib/Command/Build.d.ts.map +1 -0
  982. package/lib/Command/Build.js +118 -0
  983. package/lib/Command/Build.js.map +1 -0
  984. package/lib/Command/Command.d.ts +99 -0
  985. package/lib/Command/Command.d.ts.map +1 -0
  986. package/lib/Command/Command.js +118 -0
  987. package/lib/Command/Command.js.map +1 -0
  988. package/lib/Command/Dev.d.ts +73 -0
  989. package/lib/Command/Dev.d.ts.map +1 -0
  990. package/lib/Command/Dev.js +145 -0
  991. package/lib/Command/Dev.js.map +1 -0
  992. package/lib/Command/Exec.d.ts +70 -0
  993. package/lib/Command/Exec.d.ts.map +1 -0
  994. package/lib/Command/Exec.js +87 -0
  995. package/lib/Command/Exec.js.map +1 -0
  996. package/lib/{Build → Command}/Local.d.ts.map +1 -1
  997. package/lib/Command/Local.js +6 -0
  998. package/lib/Command/Local.js.map +1 -0
  999. package/lib/Command/Memo.d.ts.map +1 -0
  1000. package/lib/{Build → Command}/Memo.js +5 -5
  1001. package/lib/Command/Memo.js.map +1 -0
  1002. package/lib/Command/Providers.d.ts +4 -0
  1003. package/lib/Command/Providers.d.ts.map +1 -0
  1004. package/lib/Command/Providers.js +31 -0
  1005. package/lib/Command/Providers.js.map +1 -0
  1006. package/lib/Command/index.d.ts +6 -0
  1007. package/lib/Command/index.d.ts.map +1 -0
  1008. package/lib/Command/index.js +6 -0
  1009. package/lib/Command/index.js.map +1 -0
  1010. package/lib/Drizzle/Providers.d.ts +1 -1
  1011. package/lib/Drizzle/Providers.d.ts.map +1 -1
  1012. package/lib/Drizzle/Schema.d.ts +1 -1
  1013. package/lib/Drizzle/Schema.d.ts.map +1 -1
  1014. package/lib/Drizzle/Schema.js +147 -12
  1015. package/lib/Drizzle/Schema.js.map +1 -1
  1016. package/lib/GitHub/AuthProvider.js +2 -2
  1017. package/lib/GitHub/AuthProvider.js.map +1 -1
  1018. package/lib/GitHub/Secrets.d.ts.map +1 -1
  1019. package/lib/GitHub/Secrets.js +12 -9
  1020. package/lib/GitHub/Secrets.js.map +1 -1
  1021. package/lib/Local/RpcProvider.d.ts +2 -2
  1022. package/lib/Local/RpcProvider.d.ts.map +1 -1
  1023. package/lib/Local/RpcProvider.js.map +1 -1
  1024. package/lib/Local/RpcProviderProxy.js +3 -3
  1025. package/lib/Local/RpcProviderProxy.js.map +1 -1
  1026. package/lib/Local/RpcServerBun.js +1 -1
  1027. package/lib/Local/RpcServerBun.js.map +1 -1
  1028. package/lib/Local/RpcServerNode.js +1 -1
  1029. package/lib/Local/RpcServerNode.js.map +1 -1
  1030. package/lib/Local/RpcSpawner.js +3 -3
  1031. package/lib/Local/RpcSpawner.js.map +1 -1
  1032. package/lib/Named.d.ts +7 -0
  1033. package/lib/Named.d.ts.map +1 -0
  1034. package/lib/Named.js +1 -0
  1035. package/lib/Named.js.map +1 -0
  1036. package/lib/Neon/AuthProvider.js +2 -2
  1037. package/lib/Neon/AuthProvider.js.map +1 -1
  1038. package/lib/Neon/Branch.d.ts +0 -2
  1039. package/lib/Neon/Branch.d.ts.map +1 -1
  1040. package/lib/Neon/Branch.js +22 -8
  1041. package/lib/Neon/Branch.js.map +1 -1
  1042. package/lib/Neon/Project.js +2 -2
  1043. package/lib/Neon/Project.js.map +1 -1
  1044. package/lib/Phase.d.ts +15 -0
  1045. package/lib/Phase.d.ts.map +1 -1
  1046. package/lib/Phase.js.map +1 -1
  1047. package/lib/Plan.d.ts.map +1 -1
  1048. package/lib/Plan.js +12 -0
  1049. package/lib/Plan.js.map +1 -1
  1050. package/lib/Planetscale/AuthProvider.js +2 -2
  1051. package/lib/Planetscale/AuthProvider.js.map +1 -1
  1052. package/lib/Platform.d.ts +23 -14
  1053. package/lib/Platform.d.ts.map +1 -1
  1054. package/lib/Platform.js +9 -9
  1055. package/lib/Platform.js.map +1 -1
  1056. package/lib/Provider.d.ts +4 -4
  1057. package/lib/Provider.d.ts.map +1 -1
  1058. package/lib/Provider.js +1 -1
  1059. package/lib/Provider.js.map +1 -1
  1060. package/lib/Resource.d.ts +12 -6
  1061. package/lib/Resource.d.ts.map +1 -1
  1062. package/lib/Resource.js.map +1 -1
  1063. package/lib/Rpc.d.ts +124 -1
  1064. package/lib/Rpc.d.ts.map +1 -1
  1065. package/lib/Rpc.js +342 -0
  1066. package/lib/Rpc.js.map +1 -1
  1067. package/lib/RuntimeContext.d.ts +1 -0
  1068. package/lib/RuntimeContext.d.ts.map +1 -1
  1069. package/lib/RuntimeContext.js +1 -0
  1070. package/lib/RuntimeContext.js.map +1 -1
  1071. package/lib/Self.d.ts +4 -0
  1072. package/lib/Self.d.ts.map +1 -1
  1073. package/lib/Self.js.map +1 -1
  1074. package/lib/Server/S3BucketEventSource.d.ts +4 -3
  1075. package/lib/Server/S3BucketEventSource.d.ts.map +1 -1
  1076. package/lib/Server/S3BucketEventSource.js.map +1 -1
  1077. package/lib/Stack.d.ts +11 -3
  1078. package/lib/Stack.d.ts.map +1 -1
  1079. package/lib/Stack.js +6 -2
  1080. package/lib/Stack.js.map +1 -1
  1081. package/lib/State/HttpStateApi.d.ts +15 -15
  1082. package/lib/State/LocalState.js +1 -1
  1083. package/lib/State/LocalState.js.map +1 -1
  1084. package/lib/State/Sync.js +4 -4
  1085. package/lib/State/Sync.js.map +1 -1
  1086. package/lib/Tags.d.ts.map +1 -1
  1087. package/lib/Tags.js +3 -3
  1088. package/lib/Tags.js.map +1 -1
  1089. package/lib/Test/Bun.d.ts +1 -1
  1090. package/lib/Test/Bun.d.ts.map +1 -1
  1091. package/lib/Test/Bun.js +1 -0
  1092. package/lib/Test/Bun.js.map +1 -1
  1093. package/lib/Test/Http.d.ts +42 -0
  1094. package/lib/Test/Http.d.ts.map +1 -0
  1095. package/lib/Test/Http.js +48 -0
  1096. package/lib/Test/Http.js.map +1 -0
  1097. package/lib/Util/FileLogger.js +1 -1
  1098. package/lib/Util/FileLogger.js.map +1 -1
  1099. package/lib/Util/effect.d.ts.map +1 -1
  1100. package/lib/Util/effect.js +2 -1
  1101. package/lib/Util/effect.js.map +1 -1
  1102. package/lib/Util/interactive.d.ts +16 -0
  1103. package/lib/Util/interactive.d.ts.map +1 -0
  1104. package/lib/Util/interactive.js +35 -0
  1105. package/lib/Util/interactive.js.map +1 -0
  1106. package/lib/index.d.ts +2 -1
  1107. package/lib/index.d.ts.map +1 -1
  1108. package/lib/index.js +1 -1
  1109. package/lib/index.js.map +1 -1
  1110. package/package.json +23 -10
  1111. package/src/AI/Agent.ts +78 -0
  1112. package/src/AI/Parameter.ts +57 -0
  1113. package/src/AI/Tool.ts +98 -0
  1114. package/src/AI/index.ts +3 -0
  1115. package/src/AWS/ACM/Certificate.ts +30 -20
  1116. package/src/AWS/Assets.ts +1 -1
  1117. package/src/AWS/AuthProvider.ts +3 -3
  1118. package/src/AWS/AutoScaling/LaunchTemplate.ts +1 -1
  1119. package/src/AWS/CloudFront/Distribution.ts +1 -1
  1120. package/src/AWS/CloudWatch/DescribeAlarmContributors.ts +3 -1
  1121. package/src/AWS/CloudWatch/DescribeAlarmHistory.ts +3 -1
  1122. package/src/AWS/CloudWatch/DescribeAlarms.ts +3 -1
  1123. package/src/AWS/CloudWatch/DescribeAlarmsForMetric.ts +3 -1
  1124. package/src/AWS/CloudWatch/DescribeAnomalyDetectors.ts +3 -1
  1125. package/src/AWS/CloudWatch/DescribeInsightRules.ts +3 -1
  1126. package/src/AWS/CloudWatch/DisableAlarmActions.ts +3 -1
  1127. package/src/AWS/CloudWatch/DisableInsightRules.ts +3 -1
  1128. package/src/AWS/CloudWatch/EnableAlarmActions.ts +3 -1
  1129. package/src/AWS/CloudWatch/GetAlarmMuteRule.ts +3 -1
  1130. package/src/AWS/CloudWatch/GetDashboard.ts +3 -1
  1131. package/src/AWS/CloudWatch/GetInsightRuleReport.ts +3 -1
  1132. package/src/AWS/CloudWatch/GetMetricData.ts +3 -1
  1133. package/src/AWS/CloudWatch/GetMetricStatistics.ts +3 -1
  1134. package/src/AWS/CloudWatch/GetMetricStream.ts +3 -1
  1135. package/src/AWS/CloudWatch/GetMetricWidgetImage.ts +3 -1
  1136. package/src/AWS/CloudWatch/ListAlarmMuteRules.ts +3 -1
  1137. package/src/AWS/CloudWatch/ListDashboards.ts +3 -1
  1138. package/src/AWS/CloudWatch/ListManagedInsightRules.ts +3 -1
  1139. package/src/AWS/CloudWatch/ListMetricStreams.ts +3 -1
  1140. package/src/AWS/CloudWatch/ListMetrics.ts +3 -1
  1141. package/src/AWS/CloudWatch/ListTagsForResource.ts +3 -1
  1142. package/src/AWS/CloudWatch/PutMetricData.ts +3 -1
  1143. package/src/AWS/CloudWatch/SetAlarmState.ts +3 -1
  1144. package/src/AWS/Credentials.ts +6 -0
  1145. package/src/AWS/DynamoDB/BatchExecuteStatement.ts +3 -1
  1146. package/src/AWS/DynamoDB/BatchGetItem.ts +10 -6
  1147. package/src/AWS/DynamoDB/BatchWriteItem.ts +10 -6
  1148. package/src/AWS/DynamoDB/DeleteItem.ts +3 -1
  1149. package/src/AWS/DynamoDB/DescribeTable.ts +3 -1
  1150. package/src/AWS/DynamoDB/DescribeTimeToLive.ts +3 -1
  1151. package/src/AWS/DynamoDB/ExecuteStatement.ts +3 -1
  1152. package/src/AWS/DynamoDB/ExecuteTransaction.ts +3 -1
  1153. package/src/AWS/DynamoDB/GetItem.ts +3 -1
  1154. package/src/AWS/DynamoDB/ListTables.ts +3 -1
  1155. package/src/AWS/DynamoDB/ListTagsOfResource.ts +3 -1
  1156. package/src/AWS/DynamoDB/PutItem.ts +3 -1
  1157. package/src/AWS/DynamoDB/Query.ts +3 -1
  1158. package/src/AWS/DynamoDB/RestoreTableToPointInTime.ts +3 -1
  1159. package/src/AWS/DynamoDB/Scan.ts +3 -1
  1160. package/src/AWS/DynamoDB/TransactGetItems.ts +10 -6
  1161. package/src/AWS/DynamoDB/TransactWriteItems.ts +14 -8
  1162. package/src/AWS/DynamoDB/UpdateItem.ts +3 -1
  1163. package/src/AWS/DynamoDB/UpdateTimeToLive.ts +3 -1
  1164. package/src/AWS/EC2/Image.ts +2 -2
  1165. package/src/AWS/EC2/Instance.ts +1 -3
  1166. package/src/AWS/EC2/NatGateway.ts +1 -1
  1167. package/src/AWS/EC2/NetworkAcl.ts +1 -1
  1168. package/src/AWS/EC2/SecurityGroup.ts +1 -1
  1169. package/src/AWS/EC2/VpcEndpoint.ts +1 -1
  1170. package/src/AWS/EC2/hosted.ts +2 -2
  1171. package/src/AWS/ECS/DescribeTasks.ts +3 -1
  1172. package/src/AWS/ECS/ListTasks.ts +3 -1
  1173. package/src/AWS/ECS/RunTask.ts +3 -1
  1174. package/src/AWS/ECS/StopTask.ts +3 -1
  1175. package/src/AWS/ECS/Task.ts +1 -1
  1176. package/src/AWS/Environment.ts +4 -3
  1177. package/src/AWS/EventBridge/DescribeEventBus.ts +3 -1
  1178. package/src/AWS/EventBridge/DescribeRule.ts +3 -1
  1179. package/src/AWS/EventBridge/ListEventBuses.ts +3 -1
  1180. package/src/AWS/EventBridge/ListRules.ts +3 -1
  1181. package/src/AWS/EventBridge/ListTargetsByRule.ts +3 -1
  1182. package/src/AWS/EventBridge/PutEvents.ts +3 -1
  1183. package/src/AWS/EventBridge/TestEventPattern.ts +3 -1
  1184. package/src/AWS/EventBridge/ToLambda.ts +3 -1
  1185. package/src/AWS/EventBridge/ToQueue.ts +3 -1
  1186. package/src/AWS/Kinesis/DescribeAccountSettings.ts +3 -1
  1187. package/src/AWS/Kinesis/DescribeLimits.ts +3 -1
  1188. package/src/AWS/Kinesis/DescribeStream.ts +3 -1
  1189. package/src/AWS/Kinesis/DescribeStreamConsumer.ts +3 -1
  1190. package/src/AWS/Kinesis/DescribeStreamSummary.ts +3 -1
  1191. package/src/AWS/Kinesis/GetRecords.ts +3 -1
  1192. package/src/AWS/Kinesis/GetResourcePolicy.ts +3 -1
  1193. package/src/AWS/Kinesis/GetShardIterator.ts +3 -1
  1194. package/src/AWS/Kinesis/ListShards.ts +3 -1
  1195. package/src/AWS/Kinesis/ListStreamConsumers.ts +3 -1
  1196. package/src/AWS/Kinesis/ListStreams.ts +3 -1
  1197. package/src/AWS/Kinesis/ListTagsForResource.ts +3 -1
  1198. package/src/AWS/Kinesis/PutRecord.ts +3 -1
  1199. package/src/AWS/Kinesis/PutRecords.ts +3 -1
  1200. package/src/AWS/Kinesis/StreamSink.ts +3 -1
  1201. package/src/AWS/Kinesis/SubscribeToShard.ts +3 -1
  1202. package/src/AWS/Lambda/BucketEventSource.ts +3 -1
  1203. package/src/AWS/Lambda/EventBridgeEventSource.ts +3 -1
  1204. package/src/AWS/Lambda/Function.ts +182 -55
  1205. package/src/AWS/Lambda/InvokeFunction.ts +3 -1
  1206. package/src/AWS/Lambda/QueueEventSource.ts +3 -1
  1207. package/src/AWS/Lambda/StreamEventSource.ts +3 -1
  1208. package/src/AWS/Lambda/TableEventSource.ts +3 -1
  1209. package/src/AWS/Lambda/TopicEventSource.ts +3 -1
  1210. package/src/AWS/Organizations/Root.ts +1 -1
  1211. package/src/AWS/Providers.ts +4 -5
  1212. package/src/AWS/RDS/Connect.ts +3 -1
  1213. package/src/AWS/RDSData/BatchExecuteStatement.ts +3 -1
  1214. package/src/AWS/RDSData/BeginTransaction.ts +3 -1
  1215. package/src/AWS/RDSData/CommitTransaction.ts +6 -1
  1216. package/src/AWS/RDSData/ExecuteSql.ts +3 -1
  1217. package/src/AWS/RDSData/ExecuteStatement.ts +3 -1
  1218. package/src/AWS/RDSData/RollbackTransaction.ts +3 -1
  1219. package/src/AWS/Region.ts +6 -0
  1220. package/src/AWS/S3/AbortMultipartUpload.ts +3 -1
  1221. package/src/AWS/S3/Bucket.ts +18 -18
  1222. package/src/AWS/S3/CompleteMultipartUpload.ts +3 -1
  1223. package/src/AWS/S3/CopyObject.ts +3 -1
  1224. package/src/AWS/S3/CreateMultipartUpload.ts +3 -1
  1225. package/src/AWS/S3/DeleteObject.ts +3 -1
  1226. package/src/AWS/S3/GetObject.ts +3 -1
  1227. package/src/AWS/S3/HeadObject.ts +3 -1
  1228. package/src/AWS/S3/ListObjectsV2.ts +3 -1
  1229. package/src/AWS/S3/PutObject.ts +3 -1
  1230. package/src/AWS/S3/UploadPart.ts +3 -1
  1231. package/src/AWS/SNS/AddPermission.ts +3 -1
  1232. package/src/AWS/SNS/ConfirmSubscription.ts +3 -1
  1233. package/src/AWS/SNS/GetDataProtectionPolicy.ts +3 -1
  1234. package/src/AWS/SNS/GetSubscriptionAttributes.ts +3 -1
  1235. package/src/AWS/SNS/GetTopicAttributes.ts +3 -1
  1236. package/src/AWS/SNS/ListSubscriptions.ts +3 -1
  1237. package/src/AWS/SNS/ListSubscriptionsByTopic.ts +3 -1
  1238. package/src/AWS/SNS/ListTagsForResource.ts +3 -1
  1239. package/src/AWS/SNS/ListTopics.ts +3 -1
  1240. package/src/AWS/SNS/Publish.ts +3 -1
  1241. package/src/AWS/SNS/PublishBatch.ts +3 -1
  1242. package/src/AWS/SNS/PutDataProtectionPolicy.ts +3 -1
  1243. package/src/AWS/SNS/RemovePermission.ts +3 -1
  1244. package/src/AWS/SNS/SetSubscriptionAttributes.ts +3 -1
  1245. package/src/AWS/SNS/SetTopicAttributes.ts +3 -1
  1246. package/src/AWS/SNS/TagResource.ts +3 -1
  1247. package/src/AWS/SNS/TopicSink.ts +3 -1
  1248. package/src/AWS/SNS/UntagResource.ts +3 -1
  1249. package/src/AWS/SQS/DeleteMessage.ts +3 -1
  1250. package/src/AWS/SQS/DeleteMessageBatch.ts +3 -1
  1251. package/src/AWS/SQS/Queue.ts +1 -1
  1252. package/src/AWS/SQS/QueueSink.ts +3 -1
  1253. package/src/AWS/SQS/ReceiveMessage.ts +3 -1
  1254. package/src/AWS/SQS/SendMessage.ts +3 -1
  1255. package/src/AWS/SQS/SendMessageBatch.ts +3 -1
  1256. package/src/AWS/SecretsManager/DescribeSecret.ts +3 -1
  1257. package/src/AWS/SecretsManager/GetRandomPassword.ts +3 -1
  1258. package/src/AWS/SecretsManager/GetSecretValue.ts +3 -1
  1259. package/src/AWS/SecretsManager/ListSecrets.ts +3 -1
  1260. package/src/AWS/SecretsManager/PutSecretValue.ts +3 -1
  1261. package/src/AWS/StateStore/State.ts +41 -9
  1262. package/src/AWS/Website/Router.ts +212 -208
  1263. package/src/AWS/Website/SsrSite.ts +208 -209
  1264. package/src/AWS/Website/StaticSite.ts +284 -281
  1265. package/src/AdoptPolicy.ts +1 -1
  1266. package/src/Apply.ts +16 -7
  1267. package/src/Auth/Lock.ts +4 -2
  1268. package/src/Auth/Profile.ts +34 -12
  1269. package/src/Axiom/AuthProvider.ts +2 -2
  1270. package/src/Binding.ts +6 -2
  1271. package/src/Bundle/Bundle.ts +53 -4
  1272. package/src/Bundle/Docker.ts +23 -4
  1273. package/src/Bundle/InstalledPackages.ts +615 -0
  1274. package/src/Bundle/TempRoot.ts +1 -1
  1275. package/src/Bundle/index.ts +1 -0
  1276. package/src/Cli/commands/aws.ts +1 -1
  1277. package/src/Cli/commands/cloudflare.ts +3 -10
  1278. package/src/Cli/commands/login.ts +1 -1
  1279. package/src/Cli/commands/logs.ts +1 -1
  1280. package/src/Cli/commands/nuke.ts +1 -1
  1281. package/src/Cli/commands/profile.ts +2 -2
  1282. package/src/Cli/commands/state.ts +6 -11
  1283. package/src/Cli/commands/tail.ts +1 -1
  1284. package/src/Cli/selectCli.ts +2 -25
  1285. package/src/Cloudflare/Access/Application.ts +63 -20
  1286. package/src/Cloudflare/AiGateway/AiGateway.ts +186 -0
  1287. package/src/Cloudflare/AiGateway/AiGatewayBinding.ts +3 -1
  1288. package/src/Cloudflare/AiGateway/DurableObjectChatPersistence.ts +88 -0
  1289. package/src/Cloudflare/AiGateway/LanguageModel.ts +1 -3
  1290. package/src/Cloudflare/AiGateway/index.ts +1 -1
  1291. package/src/Cloudflare/AiSearch/AiSearch.ts +89 -90
  1292. package/src/Cloudflare/AiSearch/AiSearchBinding.ts +5 -2
  1293. package/src/Cloudflare/AiSearch/AiSearchInstance.ts +31 -14
  1294. package/src/Cloudflare/AnalyticsEngine/AnalyticsEngineDataset.ts +1 -4
  1295. package/src/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.ts +5 -3
  1296. package/src/Cloudflare/ApiShield/UserSchema.ts +5 -0
  1297. package/src/Cloudflare/Artifacts/ArtifactsBinding.ts +3 -1
  1298. package/src/Cloudflare/Auth/AuthProvider.ts +6 -3
  1299. package/src/Cloudflare/Browser/BrowserBinding.ts +3 -1
  1300. package/src/Cloudflare/Cache/RegionalTieredCache.ts +18 -0
  1301. package/src/Cloudflare/ClientCertificate/ClientCertificate.ts +19 -12
  1302. package/src/Cloudflare/CloudflareEnvironment.ts +3 -1
  1303. package/src/Cloudflare/Container/Container.ts +313 -171
  1304. package/src/Cloudflare/Container/ContainerApplication.ts +73 -893
  1305. package/src/Cloudflare/Container/ContainerBundle.ts +78 -2
  1306. package/src/Cloudflare/Container/ContainerPlatform.ts +220 -0
  1307. package/src/Cloudflare/Container/ContainerProvider.ts +1052 -0
  1308. package/src/Cloudflare/Container/LocalContainerProvider.ts +14 -7
  1309. package/src/Cloudflare/Container/StartContainer.ts +65 -14
  1310. package/src/Cloudflare/Container/index.ts +2 -1
  1311. package/src/Cloudflare/Credentials.ts +6 -0
  1312. package/src/Cloudflare/D1/D1Connection.ts +3 -1
  1313. package/src/Cloudflare/Dns/DnsBinding.ts +1 -30
  1314. package/src/Cloudflare/Dns/DnsRead.ts +5 -3
  1315. package/src/Cloudflare/Dns/DnsReadWrite.ts +3 -1
  1316. package/src/Cloudflare/Dns/DnsWrite.ts +5 -3
  1317. package/src/Cloudflare/Email/EmailCatchAll.ts +1 -1
  1318. package/src/Cloudflare/Email/EmailRouting.ts +1 -1
  1319. package/src/Cloudflare/Email/EmailRule.ts +1 -1
  1320. package/src/Cloudflare/Email/SendEmail.ts +1 -1
  1321. package/src/Cloudflare/Email/SendEmailBinding.ts +5 -3
  1322. package/src/Cloudflare/Fetcher.ts +86 -15
  1323. package/src/Cloudflare/Flagship/FlagshipBinding.ts +3 -1
  1324. package/src/Cloudflare/GoogleTagGateway/GoogleTagGateway.ts +1 -1
  1325. package/src/Cloudflare/HttpClientUtils.ts +31 -0
  1326. package/src/Cloudflare/Hyperdrive/HyperdriveBinding.ts +3 -1
  1327. package/src/Cloudflare/Iam/UserGroupMembership.ts +7 -0
  1328. package/src/Cloudflare/Images/ImagesBinding.ts +3 -1
  1329. package/src/Cloudflare/Images/Variant.ts +20 -3
  1330. package/src/Cloudflare/KV/{KVNamespace.ts → Namespace.ts} +9 -6
  1331. package/src/Cloudflare/KV/NamespaceBinding.ts +68 -0
  1332. package/src/Cloudflare/KV/NamespaceHttp.ts +89 -0
  1333. package/src/Cloudflare/KV/{KVNamespaceBinding.ts → NamespaceRead.ts} +15 -104
  1334. package/src/Cloudflare/KV/NamespaceReadBinding.ts +39 -0
  1335. package/src/Cloudflare/KV/NamespaceReadHttp.ts +171 -0
  1336. package/src/Cloudflare/KV/NamespaceReadWrite.ts +20 -0
  1337. package/src/Cloudflare/KV/NamespaceReadWriteBinding.ts +32 -0
  1338. package/src/Cloudflare/KV/NamespaceReadWriteHttp.ts +38 -0
  1339. package/src/Cloudflare/KV/NamespaceTypes.ts +6 -0
  1340. package/src/Cloudflare/KV/NamespaceWrite.ts +26 -0
  1341. package/src/Cloudflare/KV/NamespaceWriteBinding.ts +34 -0
  1342. package/src/Cloudflare/KV/NamespaceWriteHttp.ts +105 -0
  1343. package/src/Cloudflare/KV/index.ts +11 -2
  1344. package/src/Cloudflare/Providers.ts +4 -22
  1345. package/src/Cloudflare/Queue/Queue.ts +9 -9
  1346. package/src/Cloudflare/Queue/QueueBinding.ts +48 -131
  1347. package/src/Cloudflare/Queue/QueueEventSource.ts +4 -2
  1348. package/src/Cloudflare/Queue/QueueHttp.ts +86 -0
  1349. package/src/Cloudflare/Queue/QueueTypes.ts +17 -0
  1350. package/src/Cloudflare/Queue/QueueWrite.ts +64 -0
  1351. package/src/Cloudflare/Queue/QueueWriteBinding.ts +33 -0
  1352. package/src/Cloudflare/Queue/QueueWriteHttp.ts +82 -0
  1353. package/src/Cloudflare/Queue/index.ts +4 -1
  1354. package/src/Cloudflare/R2/{R2Bucket.ts → Bucket.ts} +6 -9
  1355. package/src/Cloudflare/R2/BucketBinding.ts +115 -0
  1356. package/src/Cloudflare/R2/BucketEventNotification.ts +1 -1
  1357. package/src/Cloudflare/R2/BucketHttp.ts +201 -0
  1358. package/src/Cloudflare/R2/BucketRead.ts +43 -0
  1359. package/src/Cloudflare/R2/BucketReadBinding.ts +44 -0
  1360. package/src/Cloudflare/R2/BucketReadHttp.ts +181 -0
  1361. package/src/Cloudflare/R2/BucketReadWrite.ts +20 -0
  1362. package/src/Cloudflare/R2/BucketReadWriteBinding.ts +26 -0
  1363. package/src/Cloudflare/R2/BucketReadWriteHttp.ts +35 -0
  1364. package/src/Cloudflare/R2/BucketSippy.ts +1 -1
  1365. package/src/Cloudflare/R2/BucketTypes.ts +59 -0
  1366. package/src/Cloudflare/R2/BucketWrite.ts +77 -0
  1367. package/src/Cloudflare/R2/BucketWriteBinding.ts +111 -0
  1368. package/src/Cloudflare/R2/BucketWriteHttp.ts +144 -0
  1369. package/src/Cloudflare/R2/index.ts +10 -2
  1370. package/src/Cloudflare/RateLimit/RateLimitBinding.ts +3 -1
  1371. package/src/Cloudflare/SecretsStore/SecretBinding.ts +3 -1
  1372. package/src/Cloudflare/StateStore/Api.ts +1 -1
  1373. package/src/Cloudflare/StateStore/State.ts +6 -4
  1374. package/src/Cloudflare/StateStore/Store.ts +5 -8
  1375. package/src/Cloudflare/Tunnel/Tunnel.ts +1 -1
  1376. package/src/Cloudflare/Tunnel/TunnelBinding.ts +1 -30
  1377. package/src/Cloudflare/Tunnel/TunnelRead.ts +4 -2
  1378. package/src/Cloudflare/Tunnel/TunnelReadWrite.ts +3 -1
  1379. package/src/Cloudflare/Tunnel/TunnelWrite.ts +4 -2
  1380. package/src/Cloudflare/Tunnel/WarpConnector.ts +1 -1
  1381. package/src/Cloudflare/UrlNormalization/UrlNormalization.ts +12 -0
  1382. package/src/Cloudflare/Vectorize/VectorizeIndexBinding.ts +3 -1
  1383. package/src/Cloudflare/VpcService/VpcService.ts +1 -1
  1384. package/src/Cloudflare/WaitingRoom/Settings.ts +19 -1
  1385. package/src/Cloudflare/Website/StaticSite.ts +12 -11
  1386. package/src/Cloudflare/Website/Vite.ts +1 -1
  1387. package/src/Cloudflare/Workers/AccountSetting.ts +9 -6
  1388. package/src/Cloudflare/Workers/Assets.ts +6 -6
  1389. package/src/Cloudflare/Workers/CronEventSource.ts +4 -2
  1390. package/src/Cloudflare/Workers/DurableObjectBridge.ts +22 -17
  1391. package/src/Cloudflare/Workers/DurableObjectChatPersistence.ts +20 -4
  1392. package/src/Cloudflare/Workers/DurableObjectNamespace.ts +125 -73
  1393. package/src/Cloudflare/Workers/DurableObjectState.ts +25 -11
  1394. package/src/Cloudflare/Workers/DurableObjectStorage.ts +50 -37
  1395. package/src/Cloudflare/Workers/Fetch.ts +3 -1
  1396. package/src/Cloudflare/Workers/GitHubRepositoryEventSource.ts +3 -1
  1397. package/src/Cloudflare/Workers/InferEnv.ts +2 -2
  1398. package/src/Cloudflare/Workers/LocalWorkerProvider.ts +15 -18
  1399. package/src/Cloudflare/Workers/Rpc.ts +7 -273
  1400. package/src/Cloudflare/Workers/RpcDurableObjectNamespace.ts +10 -8
  1401. package/src/Cloudflare/Workers/RpcWorker.ts +8 -8
  1402. package/src/Cloudflare/Workers/ScheduledEvents.ts +24 -20
  1403. package/src/Cloudflare/Workers/VersionMetadataBinding.ts +3 -1
  1404. package/src/Cloudflare/Workers/WebSocket.ts +1 -1
  1405. package/src/Cloudflare/Workers/Worker.ts +157 -1799
  1406. package/src/Cloudflare/Workers/WorkerAsyncBindings.ts +5 -5
  1407. package/src/Cloudflare/Workers/WorkerBinding.ts +8 -6
  1408. package/src/Cloudflare/Workers/WorkerBridge.ts +22 -18
  1409. package/src/Cloudflare/Workers/WorkerBundle.ts +3 -5
  1410. package/src/Cloudflare/Workers/{DynamicWorkerLoader.ts → WorkerLoader.ts} +137 -140
  1411. package/src/Cloudflare/Workers/WorkerProvider.ts +1771 -0
  1412. package/src/Cloudflare/Workers/Workflow.ts +9 -5
  1413. package/src/Cloudflare/Workers/index.ts +2 -2
  1414. package/src/Cloudflare/Zaraz/ZarazConfig.ts +1 -1
  1415. package/src/Cloudflare/Zone/Hold.ts +18 -0
  1416. package/src/Cloudflare/index.ts +3 -0
  1417. package/src/Command/Build.ts +187 -0
  1418. package/src/Command/Command.ts +244 -0
  1419. package/src/Command/Dev.ts +219 -0
  1420. package/src/Command/Exec.ts +121 -0
  1421. package/src/Command/Local.ts +6 -0
  1422. package/src/{Build → Command}/Memo.ts +5 -5
  1423. package/src/Command/Providers.ts +41 -0
  1424. package/src/Command/index.ts +5 -0
  1425. package/src/Drizzle/Schema.ts +213 -26
  1426. package/src/GitHub/AuthProvider.ts +2 -2
  1427. package/src/GitHub/Secrets.ts +15 -12
  1428. package/src/Local/RpcProvider.ts +2 -2
  1429. package/src/Local/RpcProviderProxy.ts +3 -3
  1430. package/src/Local/RpcServerBun.ts +1 -1
  1431. package/src/Local/RpcServerNode.ts +1 -1
  1432. package/src/Local/RpcSpawner.ts +3 -3
  1433. package/src/Named.ts +6 -0
  1434. package/src/Neon/AuthProvider.ts +2 -2
  1435. package/src/Neon/Branch.ts +25 -12
  1436. package/src/Neon/Project.ts +2 -2
  1437. package/src/Phase.ts +16 -0
  1438. package/src/Plan.ts +12 -0
  1439. package/src/Planetscale/AuthProvider.ts +2 -2
  1440. package/src/Platform.ts +137 -96
  1441. package/src/Provider.ts +5 -6
  1442. package/src/Resource.ts +14 -7
  1443. package/src/Rpc.ts +552 -1
  1444. package/src/RuntimeContext.ts +3 -1
  1445. package/src/Self.ts +5 -2
  1446. package/src/Server/S3BucketEventSource.ts +3 -1
  1447. package/src/Stack.ts +26 -5
  1448. package/src/State/LocalState.ts +1 -1
  1449. package/src/State/Sync.ts +4 -4
  1450. package/src/Tags.ts +3 -5
  1451. package/src/Test/Bun.ts +7 -0
  1452. package/src/Test/Http.ts +74 -0
  1453. package/src/Util/FileLogger.ts +1 -1
  1454. package/src/Util/effect.ts +2 -1
  1455. package/src/Util/interactive.ts +32 -0
  1456. package/src/index.ts +2 -2
  1457. package/lib/Build/Command.d.ts +0 -114
  1458. package/lib/Build/Command.d.ts.map +0 -1
  1459. package/lib/Build/Command.js +0 -191
  1460. package/lib/Build/Command.js.map +0 -1
  1461. package/lib/Build/DevServer.d.ts +0 -113
  1462. package/lib/Build/DevServer.d.ts.map +0 -1
  1463. package/lib/Build/DevServer.js +0 -220
  1464. package/lib/Build/DevServer.js.map +0 -1
  1465. package/lib/Build/Local.js +0 -4
  1466. package/lib/Build/Local.js.map +0 -1
  1467. package/lib/Build/Memo.d.ts.map +0 -1
  1468. package/lib/Build/Memo.js.map +0 -1
  1469. package/lib/Build/index.d.ts +0 -2
  1470. package/lib/Build/index.d.ts.map +0 -1
  1471. package/lib/Build/index.js +0 -2
  1472. package/lib/Build/index.js.map +0 -1
  1473. package/lib/Cloudflare/AiGateway/AiGatewaySpendingLimit.d.ts +0 -167
  1474. package/lib/Cloudflare/AiGateway/AiGatewaySpendingLimit.d.ts.map +0 -1
  1475. package/lib/Cloudflare/AiGateway/AiGatewaySpendingLimit.js +0 -263
  1476. package/lib/Cloudflare/AiGateway/AiGatewaySpendingLimit.js.map +0 -1
  1477. package/lib/Cloudflare/Container/ContainerBinding.d.ts +0 -8
  1478. package/lib/Cloudflare/Container/ContainerBinding.d.ts.map +0 -1
  1479. package/lib/Cloudflare/Container/ContainerBinding.js +0 -39
  1480. package/lib/Cloudflare/Container/ContainerBinding.js.map +0 -1
  1481. package/lib/Cloudflare/KV/KVNamespace.d.ts.map +0 -1
  1482. package/lib/Cloudflare/KV/KVNamespace.js.map +0 -1
  1483. package/lib/Cloudflare/KV/KVNamespaceBinding.d.ts.map +0 -1
  1484. package/lib/Cloudflare/KV/KVNamespaceBinding.js +0 -63
  1485. package/lib/Cloudflare/KV/KVNamespaceBinding.js.map +0 -1
  1486. package/lib/Cloudflare/R2/R2Bucket.d.ts.map +0 -1
  1487. package/lib/Cloudflare/R2/R2Bucket.js.map +0 -1
  1488. package/lib/Cloudflare/R2/R2BucketBinding.d.ts +0 -92
  1489. package/lib/Cloudflare/R2/R2BucketBinding.d.ts.map +0 -1
  1490. package/lib/Cloudflare/R2/R2BucketBinding.js +0 -121
  1491. package/lib/Cloudflare/R2/R2BucketBinding.js.map +0 -1
  1492. package/lib/Cloudflare/Workers/DynamicWorkerLoader.d.ts.map +0 -1
  1493. package/lib/Cloudflare/Workers/DynamicWorkerLoader.js.map +0 -1
  1494. package/lib/Construct.d.ts +0 -56
  1495. package/lib/Construct.d.ts.map +0 -1
  1496. package/lib/Construct.js +0 -51
  1497. package/lib/Construct.js.map +0 -1
  1498. package/src/Build/Command.ts +0 -293
  1499. package/src/Build/DevServer.ts +0 -338
  1500. package/src/Build/Local.ts +0 -4
  1501. package/src/Build/index.ts +0 -1
  1502. package/src/Cloudflare/AiGateway/AiGatewaySpendingLimit.ts +0 -398
  1503. package/src/Cloudflare/Container/ContainerBinding.ts +0 -74
  1504. package/src/Cloudflare/R2/R2BucketBinding.ts +0 -339
  1505. package/src/Construct.ts +0 -71
  1506. /package/lib/{Build → Command}/Local.d.ts +0 -0
  1507. /package/lib/{Build → Command}/Memo.d.ts +0 -0
@@ -1,63 +1,43 @@
1
1
  import type * as cf from "@cloudflare/workers-types";
2
- import type { ContainerImage } from "@distilled.cloud/cloudflare-runtime/Docker";
3
2
  import * as workers from "@distilled.cloud/cloudflare/workers";
4
- import * as zones from "@distilled.cloud/cloudflare/zones";
5
3
  import type * as Config from "effect/Config";
6
4
  import type { ConfigError } from "effect/Config";
7
5
  import * as Context from "effect/Context";
8
- import * as Data from "effect/Data";
9
6
  import * as Effect from "effect/Effect";
10
- import * as Path from "effect/Path";
11
- import * as Predicate from "effect/Predicate";
7
+ import type * as Layer from "effect/Layer";
12
8
  import * as Redacted from "effect/Redacted";
13
- import * as Schedule from "effect/Schedule";
14
- import * as Stream from "effect/Stream";
15
- import * as crypto from "node:crypto";
16
- import { Unowned } from "../../AdoptPolicy.ts";
17
- import * as Artifacts from "../../Artifacts.ts";
18
- import { hashDirectory, type MemoOptions } from "../../Build/Memo.ts";
9
+ import { type MemoOptions } from "../../Command/Memo.ts";
19
10
  import * as Bundle from "../../Bundle/Bundle.ts";
20
- import type { ScopedPlanStatusSession } from "../../Cli/Cli.ts";
21
- import { isResolved } from "../../Diff.ts";
11
+ import type { Dependencies } from "../../Dependencies.ts";
22
12
  import type { InputProps } from "../../Input.ts";
23
- import * as ProviderLayer from "../../Local/ProviderLayer.ts";
24
- import { Platform, type Main, type PlatformProps } from "../../Platform.ts";
25
- import * as Provider from "../../Provider.ts";
26
- import { Resource, type ResourceBinding } from "../../Resource.ts";
27
- import { Stack } from "../../Stack.ts";
13
+ import type { Named, Tag } from "../../Named.ts";
14
+ import {
15
+ Platform,
16
+ type Main,
17
+ type MainRpc,
18
+ type MakeShape,
19
+ type PlatformProps,
20
+ type PlatformServices,
21
+ } from "../../Platform.ts";
22
+ import { Resource, type ResourceClassLike } from "../../Resource.ts";
23
+ import type { Rpc } from "../../Rpc.ts";
24
+ import type { RuntimeContext } from "../../RuntimeContext.ts";
25
+ import type { Self } from "../../Self.ts";
28
26
  import { CloudflareEnvironment } from "../CloudflareEnvironment.ts";
27
+ import type { Container } from "../Container/Container.ts";
28
+ import type { DevContainerImage } from "../Container/ContainerApplication.ts";
29
29
  import type { HyperdriveDevOrigin } from "../Hyperdrive/Hyperdrive.ts";
30
- import { CloudflareLogs } from "../Logs.ts";
31
30
  import type { Providers } from "../Providers.ts";
32
- import {
33
- readAssets,
34
- uploadAssets,
35
- type Assets,
36
- type AssetsProps,
37
- } from "./Assets.ts";
38
- import { getCompatibility } from "./Compatibility.ts";
39
- import {
40
- isDurableObjectExport,
41
- type DurableObjectExport,
42
- } from "./DurableObjectNamespace.ts";
43
- import { LocalWorkerProvider } from "./LocalWorkerProvider.ts";
31
+ import { type Assets, type AssetsProps } from "./Assets.ts";
32
+ import { type DurableObjectExport } from "./DurableObjectNamespace.ts";
44
33
  import { Request } from "./Request.ts";
45
- import {
46
- bindWorkerAsyncBindings,
47
- getCronBindings,
48
- } from "./WorkerAsyncBindings.ts";
34
+ import { bindWorkerAsyncBindings } from "./WorkerAsyncBindings.ts";
49
35
  import type {
50
36
  WorkerBinding,
51
37
  WorkerBindingResource,
52
38
  WorkerBindings,
53
- WorkerSettingsBinding,
54
39
  } from "./WorkerBinding.ts";
55
- import {
56
- readPrebuiltWorkerBundle,
57
- WorkerBundle,
58
- type ModuleRule,
59
- } from "./WorkerBundle.ts";
60
- import { createWorkerName } from "./WorkerName.ts";
40
+ import { type ModuleRule } from "./WorkerBundle.ts";
61
41
  import {
62
42
  makeWorkerRuntimeContext,
63
43
  type WorkerRuntimeContext,
@@ -143,9 +123,12 @@ export type WorkerServices =
143
123
  | Request
144
124
  | WorkerExecutionContext
145
125
  | WorkerEnvironment
146
- | CloudflareEnvironment;
126
+ | CloudflareEnvironment
127
+ | Container.Application<any>
128
+ | Self;
147
129
 
148
- export type WorkerShape = Main<WorkerServices>;
130
+ export type WorkerShape<Req = never> = Main<WorkerServices | Req> &
131
+ MainRpc<WorkerServices | Req>;
149
132
 
150
133
  export type WorkerEnv = Record<
151
134
  string,
@@ -324,14 +307,17 @@ export interface WorkerProps<
324
307
  * Options for the local dev server that runs this Worker under `alchemy dev`.
325
308
  * Each Worker is served on its own port.
326
309
  *
327
- * Set to `false` to skip starting a local Worker entirely — useful when an
328
- * external dev server (e.g. one spawned via `Build.DevCommand`) is
329
- * serving the content this Worker would otherwise host.
310
+ * Use `{ mode: "external" }` to skip starting a local Worker entirely —
311
+ * useful when an external dev server (e.g. one spawned via `Command.Dev`)
312
+ * is serving the content this Worker would otherwise host.
330
313
  */
331
314
  dev?:
332
- | false
333
- | string
334
315
  | {
316
+ /**
317
+ * Run this Worker in `workerd` locally (the default).
318
+ * @default "worker"
319
+ */
320
+ mode?: "worker";
335
321
  /**
336
322
  * Host the local dev server binds to.
337
323
  * @default "localhost"
@@ -349,6 +335,17 @@ export interface WorkerProps<
349
335
  * @default false
350
336
  */
351
337
  strictPort?: boolean;
338
+ }
339
+ | {
340
+ /**
341
+ * Don't start a local Worker; an external dev server is running instead.
342
+ */
343
+ mode: "external";
344
+ /**
345
+ * URL the external dev server is reachable at, if applicable.
346
+ * This will be returned as the `url` attribute of the Worker resource.
347
+ */
348
+ url?: string;
352
349
  };
353
350
  }
354
351
 
@@ -373,7 +370,7 @@ export type Worker<Bindings extends WorkerBindings = any> = Resource<
373
370
  },
374
371
  {
375
372
  bindings?: WorkerBinding[];
376
- containers?: { className: string; dev: ContainerImage | undefined }[];
373
+ containers?: { className: string; dev: DevContainerImage | undefined }[];
377
374
  crons?: string[];
378
375
  hyperdrives?: Record<string, Required<HyperdriveDevOrigin>>;
379
376
  },
@@ -392,7 +389,7 @@ export type Worker<Bindings extends WorkerBindings = any> = Resource<
392
389
  * ```typescript
393
390
  * Effect.gen(function* () {
394
391
  * // Phase 1: bind resources (runs at deploy time)
395
- * const kv = yield* Cloudflare.KVNamespace.bind(MyKV);
392
+ * const kv = yield* Cloudflare.KV.ReadWriteNamespace(MyKV);
396
393
  *
397
394
  * return {
398
395
  * // Phase 2: runtime handlers (runs on each request)
@@ -473,7 +470,7 @@ export type Worker<Bindings extends WorkerBindings = any> = Resource<
473
470
  * { main: import.meta.filename },
474
471
  * Effect.gen(function* () {
475
472
  * // init: bind resources
476
- * const kv = yield* Cloudflare.KVNamespace.bind(MyKV);
473
+ * const kv = yield* Cloudflare.KV.ReadWriteNamespace(MyKV);
477
474
  *
478
475
  * return {
479
476
  * // runtime: use them
@@ -502,16 +499,18 @@ export type Worker<Bindings extends WorkerBindings = any> = Resource<
502
499
  *
503
500
  * @example Worker Layer (class + .make() in one file)
504
501
  * ```typescript
505
- * // src/WorkerB.ts
506
- * export default class WorkerB extends Cloudflare.Worker<WorkerB>()(
507
- * "WorkerB",
508
- * { main: import.meta.filename },
509
- * ) {}
502
+ * // src/WorkerB.ts — the tag carries the name + RPC shape; props live
503
+ * // on `.make()`.
504
+ * export class WorkerB extends Cloudflare.Worker<
505
+ * WorkerB,
506
+ * { greet: (name: string) => Effect.Effect<string> }
507
+ * >()("WorkerB") {}
510
508
  *
511
509
  * export default WorkerB.make(
510
+ * { main: import.meta.filename },
512
511
  * Effect.gen(function* () {
513
512
  * // init: bind resources
514
- * const kv = yield* Cloudflare.KVNamespace.bind(MyKV);
513
+ * const kv = yield* Cloudflare.KV.ReadWriteNamespace(MyKV);
515
514
  *
516
515
  * return {
517
516
  * // runtime: use them
@@ -622,7 +621,7 @@ export type Worker<Bindings extends WorkerBindings = any> = Resource<
622
621
  * @example Binding and using R2
623
622
  * ```typescript
624
623
  * // init
625
- * const bucket = yield* Cloudflare.R2Bucket.bind(MyBucket);
624
+ * const bucket = yield* Cloudflare.R2.ReadWrite(MyBucket);
626
625
  *
627
626
  * return {
628
627
  * fetch: Effect.gen(function* () {
@@ -643,14 +642,14 @@ export type Worker<Bindings extends WorkerBindings = any> = Resource<
643
642
  * ```
644
643
  *
645
644
  * @section KV Namespace
646
- * Bind a KV namespace with `Cloudflare.KVNamespace.bind`. KV provides
645
+ * Bind a KV namespace with `Cloudflare.KV.ReadWriteNamespace`. KV provides
647
646
  * eventually-consistent, low-latency key-value reads replicated
648
647
  * globally across Cloudflare's edge.
649
648
  *
650
649
  * @example Binding and using KV
651
650
  * ```typescript
652
651
  * // init
653
- * const kv = yield* Cloudflare.KVNamespace.bind(MyKV);
652
+ * const kv = yield* Cloudflare.KV.ReadWriteNamespace(MyKV);
654
653
  *
655
654
  * return {
656
655
  * fetch: Effect.gen(function* () {
@@ -726,18 +725,18 @@ export type Worker<Bindings extends WorkerBindings = any> = Resource<
726
725
  * ```
727
726
  *
728
727
  * @section Dynamic Workers
729
- * `DynamicWorkerLoader` lets you spin up ephemeral Workers at runtime
728
+ * `WorkerLoader` lets you spin up ephemeral Workers at runtime
730
729
  * from inline JavaScript modules. This is useful for sandboxing
731
730
  * user-provided code or running untrusted scripts in isolation.
732
731
  *
733
732
  * @example Loading a dynamic Worker
734
733
  * ```typescript
735
734
  * // init
736
- * const loader = yield* Cloudflare.DynamicWorkerLoader("Loader");
735
+ * const loader = yield* Cloudflare.WorkerLoader("Loader");
737
736
  *
738
737
  * return {
739
738
  * fetch: Effect.gen(function* () {
740
- * const worker = loader.load({
739
+ * const worker = yield* loader.load({
741
740
  * compatibilityDate: "2026-01-28",
742
741
  * mainModule: "worker.js",
743
742
  * modules: {
@@ -755,36 +754,101 @@ export type Worker<Bindings extends WorkerBindings = any> = Resource<
755
754
  * };
756
755
  * ```
757
756
  */
758
- export const Worker: Platform<
759
- Worker,
760
- WorkerServices,
761
- WorkerShape,
762
- WorkerRuntimeContext
763
- > & {
764
- <
765
- const Bindings extends WorkerBindingProps = {},
766
- const Assets extends WorkerAssetsConfig | undefined = undefined,
767
- Req = never,
768
- >(
769
- id: string,
770
- props:
771
- | InputProps<WorkerProps<Bindings, Assets>>
772
- | Effect.Effect<
773
- InputProps<WorkerProps<Bindings, Assets>>,
774
- ConfigError,
775
- Req
776
- >,
777
- ): Effect.Effect<
778
- Worker<{
779
- [binding in keyof NormalizedBindings<
780
- Bindings,
781
- Assets
782
- >]: NormalizedBindings<Bindings, Assets>[binding];
783
- }>,
757
+ export const Worker: ResourceClassLike<Worker> &
758
+ Effect.Effect<
759
+ Worker & WorkerRuntimeContext & RuntimeContext,
784
760
  never,
785
- Req | Providers
786
- >;
787
- } = Platform(WorkerTypeId, {
761
+ Worker
762
+ > & {
763
+ <Self, Shape extends WorkerShape, Deps = never>(): {
764
+ <const Id extends string>(
765
+ id: Id,
766
+ ): Effect.Effect<
767
+ Worker & Rpc<Self> & Dependencies<Deps>,
768
+ never,
769
+ Self | Extract<Deps, Container.Application<any>> | Providers
770
+ > &
771
+ Named<Id> & {
772
+ new (_: never): MakeShape<Shape, WorkerShape> & Named<Id> & Tag;
773
+ of(shape: Shape & WorkerShape): MakeShape<Shape, WorkerShape>;
774
+ make<PropsReq = never, InitReq = never>(
775
+ props:
776
+ | InputProps<WorkerProps>
777
+ | Effect.Effect<InputProps<WorkerProps>, ConfigError, PropsReq>,
778
+ impl: Effect.Effect<Shape, ConfigError, InitReq>,
779
+ ): Layer.Layer<
780
+ Self,
781
+ never,
782
+ | Extract<Deps, Container.Application<any>>
783
+ | Providers
784
+ | Exclude<InitReq, Self | WorkerServices>
785
+ >;
786
+ };
787
+ };
788
+ <Self>(): {
789
+ <
790
+ const Id extends string,
791
+ Shape extends WorkerShape,
792
+ Req extends
793
+ | WorkerServices
794
+ | Container.Application<any>
795
+ | PlatformServices
796
+ | Tag,
797
+ >(
798
+ id: Id,
799
+ props: InputProps<WorkerProps>,
800
+ impl: Effect.Effect<Shape, ConfigError, Req>,
801
+ ): Effect.Effect<
802
+ Worker & Rpc<Self>,
803
+ never,
804
+ Extract<Req, Container.Application<any>> | Providers
805
+ > &
806
+ Named<Id> & {
807
+ new (): MakeShape<Shape, WorkerShape> & Named<Id> & Tag;
808
+ };
809
+ };
810
+ <
811
+ const Bindings extends WorkerBindingProps = {},
812
+ const Assets extends WorkerAssetsConfig | undefined = undefined,
813
+ Req = never,
814
+ >(
815
+ id: string,
816
+ props:
817
+ | InputProps<WorkerProps<Bindings, Assets>>
818
+ | Effect.Effect<
819
+ InputProps<WorkerProps<Bindings, Assets>>,
820
+ ConfigError,
821
+ Req
822
+ >,
823
+ ): Effect.Effect<
824
+ Worker<{
825
+ [binding in keyof NormalizedBindings<
826
+ Bindings,
827
+ Assets
828
+ >]: NormalizedBindings<Bindings, Assets>[binding];
829
+ }> &
830
+ Rpc<{}>,
831
+ never,
832
+ Req | Providers
833
+ >;
834
+ <
835
+ const Id extends string,
836
+ Shape extends WorkerShape,
837
+ Req extends
838
+ | WorkerServices
839
+ | Container.Application<any>
840
+ | PlatformServices,
841
+ >(
842
+ id: string,
843
+ props: InputProps<WorkerProps>,
844
+ impl: Effect.Effect<Shape, ConfigError, Req>,
845
+ ): Effect.Effect<
846
+ Worker & Rpc<Shape>,
847
+ never,
848
+ Extract<Req, Container.Application<any>> | Providers
849
+ > &
850
+ Named<Id>;
851
+ } = Platform(WorkerTypeId, {
788
852
  // Both hooks are wrapped in arrows so the imported references are resolved
789
853
  // at call time rather than at module-load time. Worker.ts forms import
790
854
  // cycles with both WorkerAsyncBindings.ts (which imports `isWorker` here)
@@ -796,1709 +860,3 @@ export const Worker: Platform<
796
860
  bindWorkerAsyncBindings(resource as Worker, props),
797
861
  createRuntimeContext: (id) => makeWorkerRuntimeContext(id),
798
862
  });
799
-
800
- class MissingDurableObjectNamespaces extends Data.TaggedError(
801
- "MissingDurableObjectNamespaces",
802
- )<{
803
- scriptName: string;
804
- expected: string[];
805
- }> {}
806
-
807
- export const WorkerProvider = () =>
808
- ProviderLayer.select({
809
- live: () => LiveWorkerProvider(),
810
- local: () => LocalWorkerProvider(),
811
- });
812
-
813
- export const LiveWorkerProvider = () =>
814
- Provider.effect(
815
- Worker,
816
- Effect.gen(function* () {
817
- const path = yield* Path.Path;
818
-
819
- const bundler = yield* WorkerBundle;
820
- const stack = yield* Stack;
821
-
822
- // const createScriptSubdomain = yield* workers.createScriptSubdomain;
823
- // const deleteScript = yield* workers.deleteScript;
824
- // const getScriptSubdomain = yield* workers.getScriptSubdomain;
825
- // const getScriptSchedule = yield* workers.getScriptSchedule;
826
- // const getScriptSettings = yield* workers.getScriptScriptAndVersionSetting;
827
- // const getSubdomain = yield* workers.getSubdomain;
828
- // const putScript = yield* workers.putScript;
829
- // const putScriptSchedule = yield* workers.putScriptSchedule;
830
- // const putDomain = yield* workers.putDomain;
831
- // const listDomains = yield* workers.listDomains;
832
- // const deleteDomain = yield* workers.deleteDomain;
833
- // const listZones = yield* zones.listZones;
834
- const telemetry = yield* CloudflareLogs;
835
-
836
- const getAccountSubdomain = (accountId: string) =>
837
- workers
838
- .getSubdomain({
839
- accountId,
840
- })
841
- .pipe(Effect.map((result) => result.subdomain));
842
-
843
- // Toggle the workers.dev subdomain via `POST /subdomain` with
844
- // `enabled: true | false`. Mirrors the upstream Alchemy
845
- // implementation in `.vendor/alchemy/.../worker-subdomain.ts`.
846
- // When enabling we also set `previewsEnabled: true` so the
847
- // script is reachable both at its stable workers.dev URL and at
848
- // version-preview URLs; on disable we send just `enabled: false`.
849
- const setWorkerSubdomain = Effect.fn(function* (
850
- name: string,
851
- enabled: boolean,
852
- ) {
853
- const { accountId } = yield* yield* CloudflareEnvironment;
854
- return yield* workers.createScriptSubdomain({
855
- accountId,
856
- scriptName: name,
857
- enabled,
858
- previewsEnabled: enabled ? true : undefined,
859
- });
860
- });
861
-
862
- // Convert non-ASCII hostnames (emoji, IDN, etc.) to punycode so the
863
- // Cloudflare API receives the form it stores domains in. `new URL(...)`
864
- // does IDNA via WHATWG URL parsing — `📦.alchemy.run` → `xn--5z8h.alchemy.run`.
865
- const toPunycode = (hostname: string): string => {
866
- try {
867
- return new URL(`https://${hostname}`).hostname;
868
- } catch {
869
- return hostname;
870
- }
871
- };
872
-
873
- const normalizeDomains = (
874
- domain: string | string[] | undefined,
875
- ): string[] =>
876
- domain === undefined
877
- ? []
878
- : Array.from(
879
- new Set(
880
- (Array.isArray(domain) ? domain : [domain]).map(toPunycode),
881
- ),
882
- );
883
-
884
- const normalizeCrons = (crons: string[] | undefined): string[] =>
885
- Array.from(new Set(crons ?? []));
886
-
887
- const getWorkerCrons = Effect.fn(function* (scriptName: string) {
888
- const { accountId } = yield* yield* CloudflareEnvironment;
889
- return yield* workers
890
- .getScriptSchedule({
891
- accountId,
892
- scriptName,
893
- })
894
- .pipe(
895
- Effect.map((response) =>
896
- normalizeCrons(
897
- response.schedules.map((schedule) => schedule.cron),
898
- ),
899
- ),
900
- Effect.catchTag("WorkerNotFound", () => Effect.succeed([])),
901
- );
902
- });
903
-
904
- const reconcileCrons = (
905
- scriptName: string,
906
- desired: string[],
907
- previous: string[],
908
- session: ScopedPlanStatusSession,
909
- ) =>
910
- Effect.gen(function* () {
911
- const { accountId } = yield* yield* CloudflareEnvironment;
912
- const live = yield* getWorkerCrons(scriptName);
913
- const desiredSorted = [...desired].sort();
914
- const liveSorted = [...live].sort();
915
- const changed =
916
- desiredSorted.length !== liveSorted.length ||
917
- desiredSorted.some((cron, index) => cron !== liveSorted[index]);
918
-
919
- if (!changed) return live;
920
-
921
- if (desired.length > 0 || previous.length > 0 || live.length > 0) {
922
- yield* session.note(
923
- `Reconciling Cron Triggers (${desired.length}) ...`,
924
- );
925
- }
926
-
927
- const result = yield* workers
928
- .putScriptSchedule({
929
- accountId,
930
- scriptName,
931
- body: desired.map((cron) => ({ cron })),
932
- })
933
- .pipe(
934
- Effect.retry({
935
- while: (error) => error._tag === "WorkerNotFound",
936
- schedule: Schedule.exponential(200).pipe(
937
- Schedule.both(Schedule.recurs(15)),
938
- ),
939
- }),
940
- );
941
- return normalizeCrons(
942
- result.schedules.map((schedule) => schedule.cron),
943
- );
944
- });
945
-
946
- /**
947
- * Infer the Cloudflare Zone ID for a given hostname by listing the
948
- * account's zones and matching the hostname against each zone's name —
949
- * walking up the DNS label hierarchy until a match is found.
950
- */
951
- const inferZoneIdForHostname = (
952
- hostname: string,
953
- zoneCache: Map<string, string>,
954
- ) =>
955
- Effect.gen(function* () {
956
- const cached = zoneCache.get(hostname);
957
- if (cached) return cached;
958
-
959
- const zoneList = yield* zones
960
- .listZones({})
961
- .pipe(Effect.map((response) => response.result ?? []));
962
- for (const zone of zoneList) {
963
- zoneCache.set(zone.name, zone.id);
964
- }
965
-
966
- const parts = hostname.split(".");
967
- for (let i = 0; i < parts.length - 1; i++) {
968
- const candidate = parts.slice(i).join(".");
969
- const match = zoneList.find((z) => z.name === candidate);
970
- if (match) {
971
- zoneCache.set(hostname, match.id);
972
- return match.id;
973
- }
974
- }
975
- return yield* Effect.die(
976
- `Could not infer Cloudflare Zone for hostname "${hostname}". ` +
977
- "Ensure the parent zone exists in this account.",
978
- );
979
- });
980
-
981
- const reconcileDomains = (scriptName: string, desired: string[]) =>
982
- Effect.gen(function* () {
983
- const { accountId } = yield* yield* CloudflareEnvironment;
984
- // Always query the live state of domains attached to *this*
985
- // Worker rather than trusting `_previous` from local state.
986
- // State may have been wiped, populated by another machine, or
987
- // simply be out of date. Without this we PUT domains that are
988
- // already registered to this same Worker and Cloudflare
989
- // returns a confusing "hostname already in use" error.
990
- const liveAll = yield* workers
991
- .listDomains({
992
- accountId,
993
- service: scriptName,
994
- })
995
- .pipe(
996
- Effect.map((r) =>
997
- (r.result ?? []).flatMap((d) =>
998
- d.id && d.hostname && d.zoneId
999
- ? [
1000
- {
1001
- id: d.id,
1002
- hostname: d.hostname,
1003
- zoneId: d.zoneId,
1004
- service: d.service ?? undefined,
1005
- },
1006
- ]
1007
- : [],
1008
- ),
1009
- ),
1010
- Effect.catch(() => Effect.succeed([])),
1011
- );
1012
-
1013
- const desiredSet = new Set(desired);
1014
- const liveByHostname = new Map(liveAll.map((d) => [d.hostname, d]));
1015
-
1016
- // Detach what's no longer wanted. Use the live list so we
1017
- // don't try to delete domains we no longer track.
1018
- const toRemove = liveAll.filter((d) => !desiredSet.has(d.hostname));
1019
- yield* Effect.all(
1020
- toRemove.map((d) =>
1021
- workers
1022
- .deleteDomain({ accountId, domainId: d.id })
1023
- .pipe(Effect.catchTag("DomainNotFound", () => Effect.void)),
1024
- ),
1025
- { concurrency: "unbounded" },
1026
- );
1027
-
1028
- if (desired.length === 0) return [];
1029
-
1030
- const zoneCache = new Map<string, string>();
1031
-
1032
- // Attach `hostname` to this Worker. Skip the PUT entirely if
1033
- // the hostname is already attached to *this* Worker — that's a
1034
- // no-op for Cloudflare and avoids the "already in use" 409.
1035
- // If it's attached to a *different* Worker, refuse with a
1036
- // clear message rather than silently re-routing traffic.
1037
- const attachDomain = Effect.fn(function* (hostname: string) {
1038
- const live = liveByHostname.get(hostname);
1039
- if (live) {
1040
- return {
1041
- hostname: live.hostname,
1042
- id: live.id,
1043
- zoneId: live.zoneId,
1044
- };
1045
- }
1046
-
1047
- // Not attached to this Worker — but it could still belong
1048
- // to another Worker. Check before we try to PUT so we can
1049
- // emit a helpful error instead of the raw 409.
1050
- const otherOwner = yield* workers
1051
- .listDomains({
1052
- accountId,
1053
- hostname,
1054
- })
1055
- .pipe(
1056
- Effect.map((r) =>
1057
- (r.result ?? []).find(
1058
- (d) => d.hostname === hostname && d.service !== scriptName,
1059
- ),
1060
- ),
1061
- Effect.catch(() => Effect.succeed(undefined)),
1062
- );
1063
- if (otherOwner?.id) {
1064
- return yield* Effect.die(
1065
- new Error(
1066
- `Cannot attach hostname '${hostname}' to Worker '${scriptName}': ` +
1067
- `it is already attached to Worker '${otherOwner.service ?? "<unknown>"}'. ` +
1068
- `Detach it from that Worker first, or pick a different hostname.`,
1069
- ),
1070
- );
1071
- }
1072
-
1073
- const zoneId = yield* inferZoneIdForHostname(hostname, zoneCache);
1074
- // Same eventual-consistency window as `setWorkerSubdomain`:
1075
- // PUT /accounts/.../workers/domains right after `putScript`
1076
- // can return `WorkerNotFound` until Cloudflare's script
1077
- // registry has propagated. Retry on that specific tag.
1078
- const res = yield* workers
1079
- .putDomain({
1080
- accountId,
1081
- hostname,
1082
- service: scriptName,
1083
- zoneId,
1084
- })
1085
- .pipe(
1086
- Effect.retry({
1087
- while: (error) => error._tag === "WorkerNotFound",
1088
- schedule: Schedule.exponential(200).pipe(
1089
- Schedule.both(Schedule.recurs(15)),
1090
- ),
1091
- }),
1092
- );
1093
- return {
1094
- hostname,
1095
- id: res.id ?? "",
1096
- zoneId: res.zoneId ?? zoneId,
1097
- };
1098
- });
1099
-
1100
- const applied = yield* Effect.all(desired.map(attachDomain), {
1101
- concurrency: "unbounded",
1102
- });
1103
- return applied;
1104
- });
1105
-
1106
- const createAlchemyWorkerTags = (id: string) => [
1107
- `alchemy:stack:${stack.name}`,
1108
- `alchemy:stage:${stack.stage}`,
1109
- `alchemy:id:${id}`,
1110
- ];
1111
-
1112
- const hasAlchemyWorkerTags = (
1113
- id: string,
1114
- tags: readonly string[] | undefined,
1115
- ) => {
1116
- const actualTags = new Set(tags ?? []);
1117
- return createAlchemyWorkerTags(id).every((tag) => actualTags.has(tag));
1118
- };
1119
-
1120
- const getDurableObjectNamespaces = (
1121
- bindings: readonly WorkerSettingsBinding[] | null | undefined,
1122
- ) => {
1123
- const namespaces = Object.fromEntries(
1124
- (bindings ?? []).flatMap((binding) =>
1125
- binding.type === "durable_object_namespace" &&
1126
- binding.className &&
1127
- binding.namespaceId
1128
- ? [[binding.className, binding.namespaceId]]
1129
- : [],
1130
- ),
1131
- );
1132
- return namespaces;
1133
- };
1134
-
1135
- const getExpectedDurableObjectClassNames = (
1136
- bindings: readonly WorkerBinding[] | undefined,
1137
- workerName: string,
1138
- ) =>
1139
- Array.from(
1140
- new Set(
1141
- bindings?.flatMap((binding) =>
1142
- binding.type === "durable_object_namespace" &&
1143
- binding.className &&
1144
- (binding.scriptName === undefined ||
1145
- binding.scriptName === workerName)
1146
- ? [binding.className]
1147
- : [],
1148
- ) ?? [],
1149
- ),
1150
- );
1151
-
1152
- const getWorkerSettingsWithDurableObjects = Effect.fn(function* (
1153
- scriptName: string,
1154
- expectedClassNames: readonly string[],
1155
- ) {
1156
- const { accountId } = yield* yield* CloudflareEnvironment;
1157
- return yield* workers
1158
- .getScriptScriptAndVersionSetting({
1159
- accountId,
1160
- scriptName,
1161
- })
1162
- .pipe(
1163
- Effect.map((settings) => {
1164
- const namespaces = getDurableObjectNamespaces(settings.bindings);
1165
- const missing = expectedClassNames.filter(
1166
- (className) => !namespaces[className],
1167
- );
1168
- if (missing.length > 0) {
1169
- return Effect.fail(
1170
- new MissingDurableObjectNamespaces({
1171
- scriptName,
1172
- expected: missing,
1173
- }),
1174
- );
1175
- }
1176
- return Effect.succeed({
1177
- settings,
1178
- durableObjectNamespaces: namespaces,
1179
- });
1180
- }),
1181
- Effect.flatten,
1182
- Effect.retry({
1183
- while: (error) => error._tag === "MissingDurableObjectNamespaces",
1184
- schedule: Schedule.exponential(100).pipe(
1185
- Schedule.both(Schedule.recurs(20)),
1186
- ),
1187
- }),
1188
- );
1189
- });
1190
-
1191
- const prepareAssets = Effect.fn(function* (
1192
- assets: WorkerProps["assets"],
1193
- ) {
1194
- if (!assets) {
1195
- return undefined;
1196
- }
1197
-
1198
- if (typeof assets === "object" && "hash" in assets) {
1199
- const { hash: _, ...config } = assets;
1200
- return yield* readAssets(config);
1201
- }
1202
-
1203
- // Handle string path or AssetsProps
1204
- return yield* readAssets(
1205
- typeof assets === "string" ? { directory: assets } : assets,
1206
- );
1207
- });
1208
-
1209
- const prepareBundle = (id: string, props: WorkerProps) =>
1210
- (props.bundle === false
1211
- ? readPrebuiltWorkerBundle({
1212
- main: props.main!,
1213
- rules: props.rules,
1214
- })
1215
- : bundler.build({
1216
- id,
1217
- main: props.main!,
1218
- compatibility: getCompatibility(props),
1219
- entry: props.isExternal
1220
- ? {
1221
- kind: "external",
1222
- }
1223
- : {
1224
- kind: "effect",
1225
- exports: props.exports ?? {},
1226
- },
1227
- stack: { name: stack.name, stage: stack.stage },
1228
- extraOptions: props.build,
1229
- })
1230
- ).pipe(Artifacts.cached("build"));
1231
-
1232
- const hashScript = (script: string) =>
1233
- Effect.sync(() =>
1234
- crypto.createHash("sha256").update(script).digest("hex"),
1235
- );
1236
-
1237
- const viteBuild = Effect.fn(function* (props: WorkerProps) {
1238
- const compatibility = getCompatibility(props);
1239
- // Loaded lazily: `./Vite.ts` pulls in `@distilled.cloud/cloudflare-vite-plugin`
1240
- // (~0.5s), which is only needed for vite-based workers at build time —
1241
- // not for every Worker definition at module-load time.
1242
- const Vite = yield* Effect.promise(() => import("./Vite.ts"));
1243
- const { assetsDirectory, serverBundle } = yield* Vite.viteBuild(
1244
- props.vite?.rootDir,
1245
- Object.fromEntries(
1246
- (yield* Effect.all(
1247
- Object.entries(props.env ?? {}).map(
1248
- Effect.fn(function* ([key, value]) {
1249
- return [
1250
- key,
1251
- typeof value === "string"
1252
- ? value
1253
- : Redacted.isRedacted(value) &&
1254
- typeof Redacted.value(value) === "string"
1255
- ? Redacted.value(value)
1256
- : Effect.isEffect(value)
1257
- ? yield* value as Effect.Effect<any>
1258
- : undefined,
1259
- ];
1260
- }),
1261
- ),
1262
- )).filter(([_, value]) => value !== undefined),
1263
- ),
1264
- {
1265
- compatibilityDate: compatibility.date,
1266
- compatibilityFlags: compatibility.flags,
1267
- },
1268
- );
1269
-
1270
- if (!assetsDirectory && !serverBundle) {
1271
- return yield* Effect.die(
1272
- new Error("Vite build produced neither server nor client output"),
1273
- );
1274
- }
1275
- const [assets, bundle] = yield* Effect.all(
1276
- [
1277
- assetsDirectory
1278
- ? readAssets({
1279
- ...(props.assets && typeof props.assets !== "string"
1280
- ? props.assets
1281
- : undefined),
1282
- directory: assetsDirectory,
1283
- })
1284
- : Effect.succeed(undefined),
1285
- serverBundle
1286
- ? Bundle.bundleOutputFromRolldownOutputBundle(serverBundle)
1287
- : Effect.succeed(undefined),
1288
- ],
1289
- { concurrency: "unbounded" },
1290
- );
1291
- return { assets, bundle };
1292
- });
1293
-
1294
- const prepareAssetsAndBundle = (
1295
- id: string,
1296
- props: WorkerProps,
1297
- opts: { skipAssetsRead?: boolean } = {},
1298
- ) =>
1299
- Effect.gen(function* () {
1300
- if (props.script !== undefined) {
1301
- const [assets, bundleHash] = yield* Effect.all(
1302
- [
1303
- opts.skipAssetsRead
1304
- ? Effect.succeed(undefined)
1305
- : prepareAssets(props.assets),
1306
- hashScript(props.script),
1307
- ],
1308
- { concurrency: "unbounded" },
1309
- );
1310
- return {
1311
- assets,
1312
- bundle: {
1313
- files: [{ path: "main.js", content: props.script }],
1314
- hash: bundleHash,
1315
- },
1316
- };
1317
- }
1318
- if (props.vite) {
1319
- const [{ assets, bundle }, input] = yield* Effect.all(
1320
- [
1321
- viteBuild(props),
1322
- // hashDirectory expects `{ cwd, memo }`. The vite props
1323
- // store the project root under `rootDir`, so map it
1324
- // here. Without this, `cwd` falls back to
1325
- // `process.cwd()` and the input hash is computed over
1326
- // the wrong directory tree (often the entire monorepo
1327
- // root), making it both slow and unable to detect
1328
- // changes scoped to the actual Vite project.
1329
- hashDirectory({
1330
- cwd: props.vite.rootDir,
1331
- memo: props.vite.memo,
1332
- }),
1333
- ],
1334
- { concurrency: "unbounded" },
1335
- );
1336
- return { assets, bundle, input };
1337
- }
1338
- const [assets, bundle] = yield* Effect.all(
1339
- [
1340
- opts.skipAssetsRead
1341
- ? Effect.succeed(undefined)
1342
- : prepareAssets(props.assets),
1343
- prepareBundle(id, props),
1344
- ],
1345
- { concurrency: "unbounded" },
1346
- );
1347
- return { assets, bundle };
1348
- }).pipe(
1349
- Effect.map(({ assets, bundle, input }) => ({
1350
- assets,
1351
- bundle: {
1352
- main: bundle?.files[0].path,
1353
- files: bundle?.files.map(
1354
- (file) =>
1355
- new File([file.content as BlobPart], file.path, {
1356
- type: contentTypeFromExtension(path.extname(file.path)),
1357
- }),
1358
- ),
1359
- },
1360
- hash: {
1361
- assets: assets?.hash,
1362
- bundle: bundle?.hash,
1363
- input,
1364
- } satisfies Worker["Attributes"]["hash"],
1365
- })),
1366
- );
1367
-
1368
- const normalizePrebuiltAssets = (
1369
- assets: WorkerProps["assets"],
1370
- output: Worker["Attributes"] | undefined,
1371
- ) => {
1372
- if (!Predicate.hasProperty(assets, "hash")) return undefined;
1373
- const { directory: _, hash, ...config } = assets;
1374
- return { config, hash, skip: hash === output?.hash?.assets };
1375
- };
1376
-
1377
- const putWorker = Effect.fn(function* (
1378
- id: string,
1379
- news: WorkerProps,
1380
- bindings: ResourceBinding<Worker["Binding"]>[],
1381
- olds: WorkerProps | undefined,
1382
- output: Worker["Attributes"] | undefined,
1383
- session: ScopedPlanStatusSession,
1384
- existingSettings?: workers.GetScriptScriptAndVersionSettingResponse,
1385
- ) {
1386
- const { accountId } = yield* yield* CloudflareEnvironment;
1387
- const name = yield* createWorkerName(id, news.name);
1388
- yield* Effect.logInfo(
1389
- `Cloudflare Worker ${olds ? "update" : "create"}: preparing bundle for ${name}`,
1390
- );
1391
- // If the caller handed us a precomputed asset hash that matches
1392
- // what we previously stored, we can skip walking the directory
1393
- // entirely and tell Cloudflare to keep the assets it already
1394
- // has bound to this script. The disk read is the expensive
1395
- // part; the script PUT happens either way.
1396
- const prebuiltAssets = normalizePrebuiltAssets(news.assets, output);
1397
- const {
1398
- assets,
1399
- bundle,
1400
- hash: preparedHash,
1401
- } = yield* prepareAssetsAndBundle(id, news, {
1402
- skipAssetsRead: prebuiltAssets?.skip,
1403
- });
1404
- // When the caller supplied a precomputed hash (e.g. via
1405
- // `Build.Command`), store *that* hash in output state so the
1406
- // next diff can short-circuit by comparing it directly. The
1407
- // hash that `readAssets` produces is the manifest-derived
1408
- // hash, which is shaped differently from any upstream
1409
- // build-input hash and will never match it on the next pass.
1410
- const hash = {
1411
- ...preparedHash,
1412
- assets: prebuiltAssets?.hash ?? preparedHash.assets,
1413
- } satisfies Worker["Attributes"]["hash"];
1414
- const metadataBindings = bindings.flatMap((b) => b.data.bindings ?? []);
1415
- const expectedDurableObjectClassNames =
1416
- getExpectedDurableObjectClassNames(metadataBindings, name);
1417
- let metadataAssets:
1418
- | workers.PutScriptRequest["metadata"]["assets"]
1419
- | undefined;
1420
- let keepAssets = false;
1421
- if (prebuiltAssets?.skip) {
1422
- // Hash matched what's already on Cloudflare: keep the
1423
- // existing asset manifest and skip the upload session.
1424
- yield* Effect.logInfo(
1425
- `Cloudflare Worker update: assets unchanged for ${name}, keeping existing`,
1426
- );
1427
- keepAssets = true;
1428
- metadataAssets = { config: prebuiltAssets.config };
1429
- metadataBindings.push({
1430
- type: "assets",
1431
- name: "ASSETS",
1432
- });
1433
- } else if (assets) {
1434
- // We had to read the directory. Even after the read, the
1435
- // computed hash may match what's already deployed (e.g.
1436
- // legacy `string` / `AssetsProps` shapes that don't carry a
1437
- // precomputed hash, or a precomputed hash that disagreed with
1438
- // disk). In that case still keep the existing manifest and
1439
- // skip the upload session — Cloudflare's content-addressed
1440
- // session would no-op on every byte anyway.
1441
- if (assets.hash === prebuiltAssets?.hash) {
1442
- yield* Effect.logInfo(
1443
- `Cloudflare Worker update: assets unchanged for ${name}, keeping existing`,
1444
- );
1445
- keepAssets = true;
1446
- metadataAssets = { config: assets.config };
1447
- } else {
1448
- yield* Effect.logInfo(
1449
- `Cloudflare Worker ${olds ? "update" : "create"}: uploading assets for ${name}`,
1450
- );
1451
- const { jwt } = yield* uploadAssets(
1452
- accountId,
1453
- name,
1454
- assets,
1455
- session,
1456
- );
1457
- metadataAssets = {
1458
- jwt,
1459
- config: assets.config,
1460
- };
1461
- }
1462
- metadataBindings.push({
1463
- type: "assets",
1464
- name: "ASSETS",
1465
- });
1466
- }
1467
- metadataBindings.push(
1468
- {
1469
- type: "plain_text",
1470
- name: "ALCHEMY_PHASE",
1471
- text: "runtime",
1472
- },
1473
- {
1474
- type: "plain_text",
1475
- name: "ALCHEMY_STACK_NAME",
1476
- text: stack.name,
1477
- },
1478
- {
1479
- type: "plain_text",
1480
- name: "ALCHEMY_STAGE",
1481
- text: stack.stage,
1482
- },
1483
- {
1484
- type: "plain_text",
1485
- name: "ALCHEMY_CLOUDFLARE_ACCOUNT_ID",
1486
- text: accountId,
1487
- },
1488
- );
1489
- // Add environment variables as metadata bindings
1490
- if (news.env) {
1491
- for (const [key, value] of Object.entries(news.env)) {
1492
- if (value === undefined) continue;
1493
- if (metadataBindings.some((b) => b.name === key)) continue;
1494
- if (Redacted.isRedacted(value)) {
1495
- const unredacted = Redacted.value(value);
1496
- metadataBindings.push({
1497
- type: "secret_text",
1498
- name: key,
1499
- text:
1500
- typeof unredacted === "string"
1501
- ? unredacted
1502
- : JSON.stringify(unredacted),
1503
- });
1504
- } else if (typeof value === "string") {
1505
- metadataBindings.push({
1506
- type: "plain_text",
1507
- name: key,
1508
- text: value,
1509
- });
1510
- } else {
1511
- metadataBindings.push({
1512
- type: "json",
1513
- name: key,
1514
- json: value,
1515
- });
1516
- }
1517
- }
1518
- }
1519
- yield* Effect.logInfo(
1520
- `Cloudflare Worker ${olds ? "update" : "create"}: uploading script for ${name}`,
1521
- );
1522
- const size =
1523
- bundle.files
1524
- ?.filter((file) => !file.name.endsWith(".map"))
1525
- .reduce((acc, file) => acc + file.size, 0) ?? 0;
1526
- const sizeKB = size / 1024;
1527
- const sizeMB = sizeKB / 1024;
1528
- const bundleSize = `${sizeKB > 1024 ? `${sizeMB.toFixed(2)} MB` : `${sizeKB.toFixed(2)} KB`}`;
1529
- yield* session.note(`Uploading worker (${bundleSize}) ...`);
1530
-
1531
- // Read existing worker settings for migration tracking
1532
- const oldSettings =
1533
- existingSettings ??
1534
- (yield* workers
1535
- .getScriptScriptAndVersionSetting({
1536
- accountId,
1537
- scriptName: name,
1538
- })
1539
- .pipe(
1540
- Effect.map((s) => s as typeof s | undefined),
1541
- Effect.catch(() => Effect.succeed(undefined)),
1542
- ));
1543
-
1544
- const oldTags = Array.from(new Set(oldSettings?.tags ?? []));
1545
- const oldBindings = oldSettings?.bindings ?? [];
1546
-
1547
- // Parse alchemy:do:{logicalId}:{className} tags
1548
- const oldDoClassNameByLogicalId = getDurableObjectTagMap(oldTags);
1549
- const currentDoBindings = getDurableObjectBindings(bindings, name);
1550
- const currentDoClassNameByLogicalId = Object.fromEntries(
1551
- currentDoBindings.map((binding) => [
1552
- binding.logicalId,
1553
- binding.className,
1554
- ]),
1555
- );
1556
-
1557
- // Parse alchemy:migration-tag:{version}
1558
- const oldMigrationTag = oldTags.flatMap((tag) =>
1559
- tag.startsWith("alchemy:migration-tag:")
1560
- ? [tag.slice("alchemy:migration-tag:".length)]
1561
- : [],
1562
- )[0];
1563
- const newMigrationTag = bumpMigrationTagVersion(oldMigrationTag);
1564
-
1565
- // Compute deleted classes
1566
- const deletedClasses: string[] = [];
1567
- for (const [logicalId, className] of Object.entries(
1568
- oldDoClassNameByLogicalId,
1569
- )) {
1570
- if (!currentDoClassNameByLogicalId[logicalId]) {
1571
- deletedClasses.push(className);
1572
- }
1573
- }
1574
-
1575
- // Backward compatibility for old workers that have DO bindings but no
1576
- // alchemy:do tags yet. Cross-script bindings (`scriptName` set to
1577
- // anything other than this worker) are NEVER candidates for
1578
- // delete-class migrations — the class lives on the foreign script
1579
- // and we don't own its lifecycle.
1580
- if (Object.keys(oldDoClassNameByLogicalId).length === 0) {
1581
- for (const oldBinding of oldBindings) {
1582
- const ownedLocally =
1583
- !("scriptName" in oldBinding) || oldBinding.scriptName === name;
1584
- if (
1585
- oldBinding.type === "durable_object_namespace" &&
1586
- "className" in oldBinding &&
1587
- oldBinding.className &&
1588
- ownedLocally &&
1589
- !currentDoBindings.some(
1590
- (binding) => binding.bindingName === oldBinding.name,
1591
- )
1592
- ) {
1593
- deletedClasses.push(oldBinding.className);
1594
- }
1595
- }
1596
- }
1597
-
1598
- // Collect container-backed class names so we can send container metadata
1599
- const containerClassNames = new Set(
1600
- bindings.flatMap((b) =>
1601
- (b.data.containers ?? []).map((c) => c.className),
1602
- ),
1603
- );
1604
-
1605
- // Compute new and renamed classes
1606
- const newClasses: string[] = [];
1607
- const newSqliteClasses: string[] = [];
1608
- const renamedClasses: { from: string; to: string }[] = [];
1609
- for (const binding of currentDoBindings) {
1610
- const previousClassName =
1611
- oldDoClassNameByLogicalId[binding.logicalId];
1612
- if (!previousClassName) {
1613
- // Default all new Durable Object classes to SQLite. Cloudflare
1614
- // recommends SQLite for new namespaces, and container-backed
1615
- // Durable Objects require it.
1616
- newSqliteClasses.push(binding.className);
1617
- } else if (previousClassName !== binding.className) {
1618
- renamedClasses.push({
1619
- from: previousClassName,
1620
- to: binding.className,
1621
- });
1622
- }
1623
- }
1624
-
1625
- yield* Effect.logInfo(
1626
- `Cloudflare Worker put: durable object reconciliation ${JSON.stringify(
1627
- {
1628
- oldDoClassNameByLogicalId,
1629
- currentDoClassNameByLogicalId,
1630
- deletedClasses,
1631
- renamedClasses,
1632
- newSqliteClasses,
1633
- },
1634
- )}`,
1635
- );
1636
-
1637
- // Build alchemy:do:{logicalId}:{className} tags for each DO binding
1638
- const alchemyDoTags: string[] = [];
1639
- for (const binding of currentDoBindings) {
1640
- alchemyDoTags.push(
1641
- `alchemy:do:${binding.logicalId}:${binding.className}`,
1642
- );
1643
- }
1644
-
1645
- const metadataTags = Array.from(
1646
- new Set([
1647
- ...createAlchemyWorkerTags(id),
1648
- ...alchemyDoTags,
1649
- ...(newMigrationTag
1650
- ? [`alchemy:migration-tag:${newMigrationTag}`]
1651
- : []),
1652
- ...(news.tags ?? []),
1653
- ]),
1654
- );
1655
-
1656
- const migrations = {
1657
- oldTag: oldMigrationTag,
1658
- newTag: newMigrationTag,
1659
- newClasses,
1660
- deletedClasses,
1661
- renamedClasses,
1662
- transferredClasses: [] as { from: string; to: string }[],
1663
- newSqliteClasses,
1664
- };
1665
-
1666
- const metadataContainers = [...containerClassNames].map(
1667
- (className) => ({
1668
- className,
1669
- }),
1670
- );
1671
-
1672
- const compatibility = getCompatibility(news);
1673
- const metadata: workers.PutScriptRequest["metadata"] = {
1674
- assets: metadataAssets,
1675
- bindings: metadataBindings,
1676
- bodyPart: undefined,
1677
- compatibilityDate: compatibility.date,
1678
- compatibilityFlags: compatibility.flags,
1679
- containers:
1680
- metadataContainers.length > 0 ? metadataContainers : undefined,
1681
- keepAssets,
1682
- keepBindings: undefined,
1683
- limits: news.limits,
1684
- logpush: news.logpush,
1685
- mainModule: bundle.main,
1686
- migrations,
1687
- observability: news.observability ?? {
1688
- enabled: true,
1689
- logs: {
1690
- enabled: true,
1691
- invocationLogs: true,
1692
- },
1693
- },
1694
- placement: news.placement,
1695
- tags: metadataTags,
1696
- tailConsumers: undefined,
1697
- usageModel: undefined,
1698
- };
1699
- const worker = yield* workers
1700
- .putScript({
1701
- accountId,
1702
- scriptName: name,
1703
- metadata,
1704
- files: bundle.files,
1705
- })
1706
- .pipe(
1707
- Effect.catch((err) => {
1708
- // When adopting a Worker managed by Wrangler (or after a previous
1709
- // deploy with mismatched migrations), the old_tag precondition
1710
- // fails. The only way to discover the actual tag is through the
1711
- // error message — getScriptSettings is meant to return it but
1712
- // doesn't at runtime.
1713
- const msg = String(
1714
- typeof err === "object" && err !== null && "message" in err
1715
- ? err.message
1716
- : err,
1717
- );
1718
- const expectedTag = msg.match(
1719
- /when expected tag is ['"]?([^'"]+)['"]?/,
1720
- )?.[1];
1721
- if (expectedTag) {
1722
- return workers.putScript({
1723
- accountId,
1724
- scriptName: name,
1725
- metadata: {
1726
- ...metadata,
1727
- migrations: {
1728
- ...migrations,
1729
- oldTag: expectedTag,
1730
- newTag: bumpMigrationTagVersion(expectedTag),
1731
- },
1732
- },
1733
- files: bundle.files,
1734
- });
1735
- }
1736
- return Effect.fail(err as any);
1737
- }),
1738
- );
1739
- const { settings, durableObjectNamespaces } =
1740
- yield* getWorkerSettingsWithDurableObjects(
1741
- name,
1742
- expectedDurableObjectClassNames,
1743
- );
1744
- // Reconcile workers.dev subdomain against observed cloud state.
1745
- // We can't diff `news.url` against `olds.url` here because both
1746
- // default to `undefined` (meaning "enable") — that comparison
1747
- // would skip the API call on every deploy where the user never
1748
- // explicitly set `url`, leaving the subdomain in whatever state
1749
- // Cloudflare currently has it (disabled by default, or whatever
1750
- // a previous failed/external action left it as).
1751
- const desiredSubdomainEnabled = news.url !== false;
1752
- const observedSubdomain = yield* workers
1753
- .getScriptSubdomain({
1754
- accountId,
1755
- scriptName: name,
1756
- })
1757
- .pipe(
1758
- Effect.orElseSucceed<workers.GetScriptSubdomainResponse>(() => ({
1759
- enabled: false,
1760
- previewsEnabled: false,
1761
- })),
1762
- );
1763
- if (
1764
- desiredSubdomainEnabled !== observedSubdomain.enabled ||
1765
- desiredSubdomainEnabled !== observedSubdomain.previewsEnabled
1766
- ) {
1767
- yield* session.note(
1768
- `${desiredSubdomainEnabled ? "Enabling" : "Disabling"} workers.dev subdomain...`,
1769
- );
1770
- // Cloudflare's script registry is eventually consistent — for the
1771
- // first few hundred ms after `putScript` returns, POST /subdomain
1772
- // can still get back `WorkerNotFound` (a generic "unknown error"
1773
- // body), or a bare 500 surfaced as `InternalServerError` /
1774
- // `UnknownCloudflareError` (code 10013). Bigger uploads race harder.
1775
- // Retry the subdomain toggle on those transient tags with a short
1776
- // exponential backoff; same pattern we use elsewhere in this
1777
- // provider for DO-namespace propagation and for `putScript` itself.
1778
- yield* setWorkerSubdomain(name, desiredSubdomainEnabled).pipe(
1779
- Effect.retry({
1780
- while: (error) =>
1781
- error._tag === "WorkerNotFound" ||
1782
- error._tag === "InternalServerError" ||
1783
- error._tag === "UnknownCloudflareError",
1784
- schedule: Schedule.exponential(200).pipe(
1785
- Schedule.both(Schedule.recurs(15)),
1786
- ),
1787
- }),
1788
- );
1789
- }
1790
- const desiredDomains = normalizeDomains(news.domain);
1791
- const previousDomains = output?.domains ?? [];
1792
- if (desiredDomains.length > 0 || previousDomains.length > 0) {
1793
- yield* session.note(
1794
- `Reconciling custom domains (${desiredDomains.length}) ...`,
1795
- );
1796
- }
1797
- const reconciled = yield* reconcileDomains(name, desiredDomains);
1798
- const workersDevUrl =
1799
- news.url !== false
1800
- ? `https://${name}.${yield* getAccountSubdomain(accountId)}.workers.dev`
1801
- : undefined;
1802
- const domains = [
1803
- ...reconciled.map((d) => `https://${d.hostname}`),
1804
- ...(workersDevUrl ? [workersDevUrl] : []),
1805
- ];
1806
- const crons = yield* reconcileCrons(
1807
- name,
1808
- normalizeCrons([...getCronBindings(bindings), ...(news.crons ?? [])]),
1809
- output?.crons ?? [],
1810
- session,
1811
- );
1812
- return {
1813
- workerId: worker.id ?? name,
1814
- workerName: name,
1815
- logpush: worker.logpush ?? undefined,
1816
- url: domains[0],
1817
- tags: settings.tags ?? metadata.tags,
1818
- durableObjectNamespaces,
1819
- accountId,
1820
- domains,
1821
- crons,
1822
- hash,
1823
- } satisfies Worker["Attributes"];
1824
- });
1825
-
1826
- const hasChanged = Effect.fn(function* (
1827
- id: string,
1828
- props: WorkerProps,
1829
- output: Worker["Attributes"],
1830
- ) {
1831
- if (props.script !== undefined) {
1832
- const scriptHash = yield* hashScript(props.script);
1833
- if (scriptHash !== output.hash?.bundle) {
1834
- return true;
1835
- }
1836
- if (!props.assets) {
1837
- return false;
1838
- }
1839
- const assetsHash = Predicate.hasProperty(props.assets, "hash")
1840
- ? props.assets.hash
1841
- : undefined;
1842
- if (assetsHash === undefined) {
1843
- return true;
1844
- }
1845
- return assetsHash !== output.hash?.assets;
1846
- }
1847
- if (props.vite) {
1848
- const input = yield* hashDirectory({
1849
- cwd: props.vite.rootDir,
1850
- memo: props.vite.memo,
1851
- });
1852
- return input !== output.hash?.input;
1853
- }
1854
- const bundleHash = yield* prepareBundle(id, props).pipe(
1855
- Effect.map((b) => b.hash),
1856
- );
1857
- if (bundleHash !== output.hash?.bundle) {
1858
- return true;
1859
- }
1860
- if (!props.assets) {
1861
- return false;
1862
- }
1863
- // We deliberately don't read the assets directory during diff.
1864
- // For `AssetsWithHash` (the documented contract) the upstream
1865
- // `Build.Command` already gave us an authoritative hash — we
1866
- // just compare strings. Reading the directory here would
1867
- // (a) hash the same tree twice per apply (`putWorker` reads
1868
- // again when an upload is actually required), and (b) crash
1869
- // when the prior state was written on a different machine
1870
- // and `path` doesn't exist locally — blocking any local
1871
- // reapply even though the precomputed hash is right there
1872
- // in props.
1873
- //
1874
- // For the legacy `string` / `AssetsProps` shapes there's no
1875
- // hash in props to compare against, so we conservatively
1876
- // assume the assets changed; `putWorker` will read once,
1877
- // hash, and use `keepAssets` if it turns out nothing actually
1878
- // changed.
1879
- const assetsHash = Predicate.hasProperty(props.assets, "hash")
1880
- ? props.assets.hash
1881
- : undefined;
1882
- if (assetsHash === undefined) {
1883
- return true;
1884
- }
1885
- return assetsHash !== output.hash?.assets;
1886
- });
1887
-
1888
- return Worker.Provider.of({
1889
- stables: ["workerId", "workerName"],
1890
- list: () =>
1891
- Effect.gen(function* () {
1892
- const { accountId } = yield* yield* CloudflareEnvironment;
1893
- // Account-scoped enumeration of every Worker script. The
1894
- // per-script `read` makes several extra calls (subdomain,
1895
- // settings, domains, schedule) to fully hydrate
1896
- // url/durableObjectNamespaces/domains/crons. Doing that for
1897
- // every script on the account is both expensive (4 calls × N)
1898
- // and fragile — a single script with a binding shape the
1899
- // settings schema doesn't know about would break the whole
1900
- // listing (the same reason `read` deliberately avoids
1901
- // `listScripts`). For `list()` we hydrate the core identifying
1902
- // and settings fields that come straight from the script
1903
- // metadata and leave the binding-derived fields at the same
1904
- // defaults `read` returns when those sub-resources are absent
1905
- // (`url: undefined`, `durableObjectNamespaces: {}`,
1906
- // `domains: []`, `crons: []`). `accountId` + `workerName` are
1907
- // sufficient for `delete`.
1908
- return yield* workers.listScripts.pages({ accountId }).pipe(
1909
- Stream.runCollect,
1910
- Effect.map((chunk) =>
1911
- Array.from(chunk).flatMap((page) =>
1912
- // Annotate the element type as the full `Attributes` shape
1913
- // (incl. the optional `hash`) so it matches `read` exactly.
1914
- // `list()` is an inference source for the provider's resource
1915
- // type; a narrower element (e.g. via `satisfies`, which omits
1916
- // `hash`) would derail `Res` inference and cascade every
1917
- // lifecycle method's requirement channel to `never`.
1918
- (page.result ?? []).flatMap(
1919
- (script): Worker["Attributes"][] =>
1920
- script.id
1921
- ? [
1922
- {
1923
- accountId,
1924
- workerId: script.id,
1925
- workerName: script.id,
1926
- logpush: script.logpush ?? undefined,
1927
- url: undefined,
1928
- tags: script.tags ?? undefined,
1929
- durableObjectNamespaces: {},
1930
- domains: [],
1931
- crons: [],
1932
- },
1933
- ]
1934
- : [],
1935
- ),
1936
- ),
1937
- ),
1938
- );
1939
- }),
1940
- diff: Effect.fn(function* ({ id, news, olds, output, newBindings }) {
1941
- const { accountId } = yield* yield* CloudflareEnvironment;
1942
- if (!isResolved(news)) return undefined;
1943
- if ((output?.accountId ?? accountId) !== accountId) {
1944
- return { action: "replace" };
1945
- }
1946
- const workerName = yield* createWorkerName(id, news.name);
1947
- const oldWorkerName = output?.workerName
1948
- ? output.workerName
1949
- : yield* createWorkerName(id, olds?.name);
1950
- if (workerName !== oldWorkerName) {
1951
- return { action: "replace" };
1952
- }
1953
- if (!output) {
1954
- return;
1955
- }
1956
- const newDomains = normalizeDomains(news.domain)
1957
- .map((h) => `https://${h}`)
1958
- .sort();
1959
- const oldDomains = (output?.domains ?? [])
1960
- .filter((u) => !u.endsWith(".workers.dev"))
1961
- .sort();
1962
- const domainsChanged =
1963
- newDomains.length !== oldDomains.length ||
1964
- newDomains.some((d, i) => d !== oldDomains[i]);
1965
- const newCrons = normalizeCrons([
1966
- ...(Array.isArray(newBindings)
1967
- ? getCronBindings(
1968
- newBindings as ResourceBinding<Worker["Binding"]>[],
1969
- )
1970
- : []),
1971
- ...(news.crons ?? []),
1972
- ]).sort();
1973
- const oldCrons = [...(output?.crons ?? [])].sort();
1974
- const cronsChanged =
1975
- newCrons.length !== oldCrons.length ||
1976
- newCrons.some((cron, index) => cron !== oldCrons[index]);
1977
- // `url` is `domains[0]`: the first custom domain in user order if
1978
- // any, otherwise the workers.dev URL (derived from the stable
1979
- // worker name + account subdomain). It's stable across this update
1980
- // exactly when that first domain is unchanged — which is NOT the
1981
- // same as "the domain set is unchanged": adding a second custom
1982
- // domain leaves `url` put, while reordering changes it even though
1983
- // the set is equal. Compute the resulting `url` and carry it
1984
- // forward as a stable only when it matches the old one, so
1985
- // downstream resources that reference `worker.url` (e.g. a GitHub
1986
- // Webhook delivery URL built via `Output.interpolate`) resolve it
1987
- // to a concrete value during planning instead of an unresolved
1988
- // Output — otherwise every worker update spuriously re-updates them.
1989
- const newCustomDomains = normalizeDomains(news.domain);
1990
- const newUrl =
1991
- newCustomDomains.length > 0
1992
- ? `https://${newCustomDomains[0]}`
1993
- : news.url !== false
1994
- ? (output.domains ?? []).find((u) => u.endsWith(".workers.dev"))
1995
- : undefined;
1996
- const urlStable = newUrl !== undefined && newUrl === output.url;
1997
- // `durableObjectNamespaces` maps each hosted DO class name to the
1998
- // namespace id Cloudflare assigned it. Those ids are permanent for
1999
- // the lifetime of a (worker, class) pair, so the map only changes
2000
- // when a class is added or removed — never on a plain code/config
2001
- // update. Carry it forward as a stable whenever the set of local DO
2002
- // class names is unchanged, for the same reason as `url` above:
2003
- // downstream resources that bind a DO namespace via
2004
- // `worker.durableObjectNamespaces[name]` (e.g. a Container attached
2005
- // to a DO) must resolve it to a concrete value during planning.
2006
- // Otherwise the binding holds an unresolved Output, which
2007
- // `diffBindings` treats as "changed", spuriously re-updating the
2008
- // bound resource on every deploy. Class names are structural (not the
2009
- // namespace id), so this comparison holds even when `newBindings` is
2010
- // otherwise unresolved.
2011
- const newDoClassNames = Array.isArray(newBindings)
2012
- ? getExpectedDurableObjectClassNames(
2013
- (newBindings as ResourceBinding<Worker["Binding"]>[]).flatMap(
2014
- (b) => b.data.bindings ?? [],
2015
- ),
2016
- workerName,
2017
- ).sort()
2018
- : [];
2019
- const oldDoClassNames = Object.keys(
2020
- output.durableObjectNamespaces ?? {},
2021
- ).sort();
2022
- const doNamespacesStable =
2023
- oldWorkerName === workerName &&
2024
- newDoClassNames.length === oldDoClassNames.length &&
2025
- newDoClassNames.every((name, i) => name === oldDoClassNames[i]);
2026
- if (
2027
- domainsChanged ||
2028
- cronsChanged ||
2029
- (yield* hasChanged(id, news, output))
2030
- ) {
2031
- // `workerId` is always stable across an update; seed it so it
2032
- // survives now that `diff.stables` overrides `provider.stables`
2033
- // rather than being merged with it.
2034
- const stables: string[] = ["workerId"];
2035
- if (oldWorkerName === workerName) {
2036
- stables.push("workerName");
2037
- }
2038
- if (urlStable) {
2039
- stables.push("url");
2040
- }
2041
- if (doNamespacesStable) {
2042
- stables.push("durableObjectNamespaces");
2043
- }
2044
- return {
2045
- action: "update",
2046
- stables: stables.length > 0 ? stables : undefined,
2047
- };
2048
- }
2049
- }),
2050
- precreate: Effect.fn(function* ({ id, news, session }) {
2051
- const { accountId } = yield* yield* CloudflareEnvironment;
2052
- const name = yield* createWorkerName(id, news.name);
2053
- const exportMap = news.exports ?? {};
2054
- const durableObjects = Object.keys(exportMap)
2055
- .filter((logicalId) => isDurableObjectExport(exportMap[logicalId]))
2056
- .map((logicalId) => ({
2057
- logicalId,
2058
- className: logicalId,
2059
- }));
2060
- const doClasses = durableObjects.map((binding) => binding.className);
2061
- const containers = doClasses.map((className) => ({ className }));
2062
- const alchemyDoTags = durableObjects.map(
2063
- ({ logicalId, className }) =>
2064
- `alchemy:do:${logicalId}:${className}`,
2065
- );
2066
- const tags = Array.from(
2067
- new Set([
2068
- ...createAlchemyWorkerTags(id),
2069
- ...alchemyDoTags,
2070
- ...(news.tags ?? []),
2071
- ]),
2072
- );
2073
- yield* Effect.logInfo(
2074
- `Cloudflare Worker precreate: starting ${name}`,
2075
- );
2076
- yield* Effect.logInfo(
2077
- `Cloudflare Worker precreate: durable objects ${JSON.stringify(
2078
- durableObjects,
2079
- )}`,
2080
- );
2081
- const existingSettings = yield* workers
2082
- .getScriptScriptAndVersionSetting({
2083
- accountId,
2084
- scriptName: name,
2085
- })
2086
- .pipe(
2087
- Effect.catchTag("WorkerNotFound", () =>
2088
- Effect.succeed(undefined),
2089
- ),
2090
- );
2091
- let durableObjectNamespaces = getDurableObjectNamespaces(
2092
- existingSettings?.bindings,
2093
- );
2094
-
2095
- if (existingSettings) {
2096
- // Engine has already cleared this resource for write via
2097
- // `read` + AdoptPolicy. Either we own it (matching tags) or
2098
- // the user opted in to a takeover (`--adopt` / `adopt(true)`).
2099
- yield* Effect.logInfo(
2100
- `Cloudflare Worker precreate: reusing existing ${name}`,
2101
- );
2102
- } else {
2103
- yield* session.note("Pre-creating worker...");
2104
- const mainModule = "main.js";
2105
- const placeholderScript = `${doClasses.length > 0 ? 'import { DurableObject } from "cloudflare:workers";\n\n' : ""}export default { fetch() { return new Response("Alchemy worker is being deployed...") } };\n${doClasses
2106
- .map(
2107
- (className) =>
2108
- `export class ${className} extends DurableObject {}`,
2109
- )
2110
- .join("\n")}`;
2111
- yield* workers
2112
- .putScript({
2113
- accountId,
2114
- scriptName: name,
2115
- metadata: {
2116
- mainModule,
2117
- bindings:
2118
- doClasses.length > 0
2119
- ? doClasses.map((className) => ({
2120
- type: "durable_object_namespace" as const,
2121
- name: className,
2122
- className,
2123
- }))
2124
- : undefined,
2125
- ...getCompatibility(news),
2126
- containers,
2127
- migrations:
2128
- doClasses.length > 0
2129
- ? {
2130
- oldTag: undefined,
2131
- newTag: undefined,
2132
- newClasses: [],
2133
- deletedClasses: [],
2134
- renamedClasses: [],
2135
- transferredClasses: [],
2136
- newSqliteClasses: doClasses,
2137
- }
2138
- : undefined,
2139
- observability: news.observability ?? {
2140
- enabled: true,
2141
- logs: {
2142
- enabled: true,
2143
- invocationLogs: true,
2144
- },
2145
- },
2146
- tags,
2147
- },
2148
- files: [
2149
- new File([placeholderScript], mainModule, {
2150
- type: "application/javascript+module",
2151
- }),
2152
- ],
2153
- })
2154
- .pipe(
2155
- // Cloudflare's PUT /workers/scripts/{name} intermittently
2156
- // returns code 10002 / "An unknown error has occurred" on the
2157
- // first put for a fresh worker name. Surfaced as the shared
2158
- // `InternalServerError` upstream (alchemy-run/distilled#290).
2159
- // Also match `UnknownCloudflareError` for older
2160
- // @distilled.cloud/cloudflare versions that haven't picked
2161
- // up the patch yet.
2162
- Effect.retry({
2163
- while: (e) =>
2164
- e._tag === "InternalServerError" ||
2165
- e._tag === "UnknownCloudflareError",
2166
- schedule: Schedule.exponential(1000).pipe(
2167
- Schedule.both(Schedule.recurs(5)),
2168
- ),
2169
- }),
2170
- );
2171
- if (doClasses.length > 0) {
2172
- ({ durableObjectNamespaces } =
2173
- yield* getWorkerSettingsWithDurableObjects(name, doClasses));
2174
- }
2175
- }
2176
-
2177
- if (existingSettings && doClasses.length > 0) {
2178
- ({ durableObjectNamespaces } =
2179
- yield* getWorkerSettingsWithDurableObjects(name, doClasses));
2180
- }
2181
-
2182
- return {
2183
- workerId: name,
2184
- workerName: name,
2185
- logpush: existingSettings?.logpush ?? undefined,
2186
- url: undefined,
2187
- tags: existingSettings?.tags ?? tags,
2188
- durableObjectNamespaces,
2189
- accountId,
2190
- domains: [],
2191
- crons: [],
2192
- } satisfies Worker["Attributes"];
2193
- }),
2194
- read: Effect.fn(
2195
- function* ({ id, output, olds }) {
2196
- const { accountId } = yield* yield* CloudflareEnvironment;
2197
- const workerName =
2198
- output?.workerName ?? (yield* createWorkerName(id, olds?.name));
2199
- yield* Effect.logInfo(
2200
- `Cloudflare Worker read: checking ${workerName}`,
2201
- );
2202
- // We deliberately don't call `listScripts({ accountId })` here:
2203
- // it pulls every Worker on the account back through a strict
2204
- // schema decode, and a single existing Worker the schema doesn't
2205
- // know about (e.g. `placement_mode: "targeted"`) breaks the
2206
- // entire read. `getScriptSettings` already fails with
2207
- // `WorkerNotFound` if the script doesn't exist, which the
2208
- // surrounding `Effect.catchTag` turns into `undefined` — that's
2209
- // all the existence check we need.
2210
- const [subdomain, settings, domainsList] = yield* Effect.all([
2211
- workers.getScriptSubdomain({
2212
- accountId,
2213
- scriptName: workerName,
2214
- }),
2215
- workers.getScriptScriptAndVersionSetting({
2216
- accountId,
2217
- scriptName: workerName,
2218
- }),
2219
- workers
2220
- .listDomains({
2221
- accountId,
2222
- service: workerName,
2223
- })
2224
- .pipe(Effect.map((r) => r.result ?? [])),
2225
- ]);
2226
- // Preserve the order the user provided in `olds.domain`. The
2227
- // Cloudflare API returns domains in non-deterministic order,
2228
- // which would cause downstream `worker.domains[0]` reads to flip
2229
- // between deploys. Drift (domains we don't know about) is
2230
- // appended after the user-ordered ones.
2231
- const userOrder = normalizeDomains(olds?.domain);
2232
- const orderedHostnames = [
2233
- ...userOrder.flatMap(
2234
- (h) =>
2235
- domainsList.find((d) => d.hostname === h)?.hostname ?? [],
2236
- ),
2237
- ...domainsList.flatMap((d) =>
2238
- d.hostname && !userOrder.includes(d.hostname)
2239
- ? [d.hostname]
2240
- : [],
2241
- ),
2242
- ];
2243
- const workersDevUrl = subdomain.enabled
2244
- ? `https://${workerName}.${yield* getAccountSubdomain(accountId)}.workers.dev`
2245
- : undefined;
2246
- const domains = [
2247
- ...orderedHostnames.map((h) => `https://${h}`),
2248
- ...(workersDevUrl ? [workersDevUrl] : []),
2249
- ];
2250
- const crons = yield* getWorkerCrons(workerName);
2251
- yield* Effect.logInfo(
2252
- `Cloudflare Worker read: found ${workerName}`,
2253
- );
2254
- const attrs = {
2255
- accountId,
2256
- workerId: workerName,
2257
- workerName,
2258
- logpush: settings.logpush ?? undefined,
2259
- url: domains[0],
2260
- tags: settings.tags ?? undefined,
2261
- durableObjectNamespaces: getDurableObjectNamespaces(
2262
- settings.bindings,
2263
- ),
2264
- domains,
2265
- crons,
2266
- } satisfies Worker["Attributes"];
2267
-
2268
- // Centralized ownership decision: the engine routes `read`'s
2269
- // return value based on `AdoptPolicy`. We hand it the attrs
2270
- // either as-is (owned: alchemy tags identify this stack/stage/id,
2271
- // safe to silently adopt even without `--adopt`) or branded with
2272
- // `Unowned` (caller must opt in via `--adopt` or the engine
2273
- // raises `OwnedBySomeoneElse`).
2274
- return hasAlchemyWorkerTags(id, settings.tags ?? [])
2275
- ? attrs
2276
- : Unowned(attrs);
2277
- },
2278
- (effect) =>
2279
- effect.pipe(
2280
- Effect.catchTag("WorkerNotFound", () =>
2281
- Effect.succeed(undefined),
2282
- ),
2283
- ),
2284
- ),
2285
- reconcile: Effect.fn(function* ({
2286
- id,
2287
- news,
2288
- olds,
2289
- bindings,
2290
- output,
2291
- session,
2292
- }) {
2293
- const { accountId } = yield* yield* CloudflareEnvironment;
2294
- const name =
2295
- output?.workerName ?? (yield* createWorkerName(id, news.name));
2296
- const durableObjects = getDurableObjectBindings(bindings, name).map(
2297
- ({ logicalId, className }) => ({
2298
- logicalId,
2299
- className,
2300
- }),
2301
- );
2302
- yield* Effect.logInfo(
2303
- `Cloudflare Worker reconcile: starting ${name}`,
2304
- );
2305
- yield* Effect.logInfo(
2306
- `Cloudflare Worker reconcile: durable objects ${JSON.stringify(
2307
- durableObjects,
2308
- )}`,
2309
- );
2310
-
2311
- // Observe — fetch the script's current settings if it already exists.
2312
- // `putWorker` is a true upsert against the Cloudflare API; the
2313
- // existing settings inform asset/migration decisions and let the
2314
- // reconciler converge whether the worker is brand-new, adopted, or
2315
- // an in-place update.
2316
- const existingSettings = yield* workers
2317
- .getScriptScriptAndVersionSetting({
2318
- accountId,
2319
- scriptName: name,
2320
- })
2321
- .pipe(
2322
- Effect.catchTag("WorkerNotFound", () =>
2323
- Effect.succeed(undefined),
2324
- ),
2325
- );
2326
- yield* Effect.logInfo(
2327
- `Cloudflare Worker reconcile: existing durable object tags ${JSON.stringify(
2328
- (existingSettings?.tags ?? []).filter((tag) =>
2329
- tag.startsWith("alchemy:do:"),
2330
- ),
2331
- )}`,
2332
- );
2333
- yield* Effect.logInfo(
2334
- `Cloudflare Worker reconcile: previous durable object tags ${JSON.stringify(
2335
- (output?.tags ?? []).filter((tag) =>
2336
- tag.startsWith("alchemy:do:"),
2337
- ),
2338
- )}`,
2339
- );
2340
- return yield* putWorker(
2341
- id,
2342
- news,
2343
- bindings,
2344
- olds,
2345
- output,
2346
- session,
2347
- existingSettings,
2348
- );
2349
- }),
2350
- delete: Effect.fn(function* ({ output }) {
2351
- yield* Effect.logInfo(
2352
- `Cloudflare Worker delete: deleting ${output.workerName}`,
2353
- );
2354
- // Look up live domain IDs rather than trusting persisted state.
2355
- // We no longer track `{ id, zoneId }` on the output; fetching
2356
- // straight from Cloudflare handles both the normal case and
2357
- // adopted workers whose domains we never recorded.
2358
- const liveDomains = yield* workers
2359
- .listDomains({
2360
- accountId: output.accountId,
2361
- service: output.workerName,
2362
- })
2363
- .pipe(
2364
- Effect.map((r) => r.result ?? []),
2365
- Effect.catch(() => Effect.succeed([])),
2366
- );
2367
- if (liveDomains.length) {
2368
- yield* Effect.all(
2369
- liveDomains.flatMap((d) =>
2370
- d.id
2371
- ? [
2372
- workers
2373
- .deleteDomain({
2374
- accountId: output.accountId,
2375
- domainId: d.id,
2376
- })
2377
- .pipe(
2378
- Effect.catchTag("DomainNotFound", () => Effect.void),
2379
- ),
2380
- ]
2381
- : [],
2382
- ),
2383
- { concurrency: "unbounded" },
2384
- );
2385
- }
2386
- yield* workers
2387
- .deleteScript({
2388
- accountId: output.accountId,
2389
- scriptName: output.workerName,
2390
- // Force teardown of queue consumers, durable object classes, and
2391
- // service bindings hanging off this worker. Without `force`, those
2392
- // conditions raise QueueConsumerConflict / ServiceBindingConflict
2393
- // and leave the script in CF. Alchemy is the source of truth for
2394
- // the worker, so we want a hard delete on teardown.
2395
- force: true,
2396
- })
2397
- .pipe(Effect.catchTag("WorkerNotFound", () => Effect.void));
2398
- }),
2399
- tail: ({ output }) =>
2400
- telemetry.tailScript({
2401
- accountId: output.accountId,
2402
- scriptName: output.workerName,
2403
- }),
2404
- logs: ({ output, options }) =>
2405
- telemetry.queryLogs({
2406
- accountId: output.accountId,
2407
- filters: [
2408
- {
2409
- key: "$workers.scriptName",
2410
- operation: "eq",
2411
- type: "string",
2412
- value: output.workerName,
2413
- },
2414
- ],
2415
- options,
2416
- }),
2417
- });
2418
- }),
2419
- );
2420
-
2421
- const contentTypeFromExtension = (extension: string) => {
2422
- switch (extension) {
2423
- case ".wasm":
2424
- return "application/wasm";
2425
- case ".txt":
2426
- case ".html":
2427
- case ".sql":
2428
- case ".custom":
2429
- return "text/plain";
2430
- case ".bin":
2431
- return "application/octet-stream";
2432
- case ".mjs":
2433
- case ".js":
2434
- return "application/javascript+module";
2435
- case ".cjs":
2436
- return "application/javascript";
2437
- case ".map":
2438
- return "application/source-map";
2439
- default:
2440
- return "application/octet-stream";
2441
- }
2442
- };
2443
-
2444
- function bumpMigrationTagVersion(
2445
- oldTag: string | undefined,
2446
- ): string | undefined {
2447
- if (!oldTag) return undefined;
2448
- const version = oldTag.match(/^(alchemy:)?v(\d+)$/)?.[2];
2449
- if (!version) return "alchemy:v1";
2450
- return `alchemy:v${parseInt(version, 10) + 1}`;
2451
- }
2452
-
2453
- function getDurableObjectBindings(
2454
- bindings: ReadonlyArray<ResourceBinding>,
2455
- workerName: string,
2456
- ) {
2457
- // Resource authors (and the `make`/`yield* Tag`/plan-vs-apply machinery)
2458
- // can register the same DO binding multiple times under the same logical
2459
- // id — `binding()` is a plain `worker.bind` and intentionally has no
2460
- // dedup. Collapse duplicates here so each `(logicalId, bindingName,
2461
- // className)` tuple appears at most once. We also exclude cross-script
2462
- // references: a `scriptName` pointing to *another* worker means this
2463
- // worker just references a foreign class — ship the binding to
2464
- // Cloudflare, but don't drive class migrations for it.
2465
- const seen = new Set<string>();
2466
- return bindings.flatMap((binding) =>
2467
- (binding.data.bindings ?? []).flatMap((item: WorkerBinding) => {
2468
- if (
2469
- item.type !== "durable_object_namespace" ||
2470
- !("className" in item) ||
2471
- !item.className
2472
- ) {
2473
- return [];
2474
- }
2475
- if (item.scriptName !== undefined && item.scriptName !== workerName) {
2476
- return [];
2477
- }
2478
- const dedupKey = `${binding.sid}::${item.name}::${item.className}`;
2479
- if (seen.has(dedupKey)) return [];
2480
- seen.add(dedupKey);
2481
- return [
2482
- {
2483
- logicalId: binding.sid,
2484
- bindingName: item.name,
2485
- className: item.className,
2486
- },
2487
- ];
2488
- }),
2489
- );
2490
- }
2491
-
2492
- function getDurableObjectTagMap(tags: ReadonlyArray<string>) {
2493
- return Object.fromEntries(
2494
- tags.flatMap((tag) => {
2495
- if (!tag.startsWith("alchemy:do:")) {
2496
- return [];
2497
- }
2498
- const parts = tag.split(":");
2499
- const logicalId = parts[2];
2500
- const className = parts.slice(3).join(":");
2501
- return logicalId && className ? [[logicalId, className]] : [];
2502
- }),
2503
- );
2504
- }