alchemy 2.0.0-beta.41 → 2.0.0-beta.43

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 (514) hide show
  1. package/bin/exec.js +2 -9
  2. package/bin/exec.js.map +1 -1
  3. package/lib/AWS/CloudWatch/DescribeAlarmContributors.d.ts +1 -1
  4. package/lib/AWS/CloudWatch/DescribeAlarmContributors.d.ts.map +1 -1
  5. package/lib/AWS/CloudWatch/DescribeAlarmHistory.d.ts +1 -1
  6. package/lib/AWS/CloudWatch/DescribeAlarmHistory.d.ts.map +1 -1
  7. package/lib/AWS/CloudWatch/DescribeAlarms.d.ts +1 -1
  8. package/lib/AWS/CloudWatch/DescribeAlarms.d.ts.map +1 -1
  9. package/lib/AWS/CloudWatch/DescribeAlarmsForMetric.d.ts +1 -1
  10. package/lib/AWS/CloudWatch/DescribeAlarmsForMetric.d.ts.map +1 -1
  11. package/lib/AWS/CloudWatch/DescribeAnomalyDetectors.d.ts +1 -1
  12. package/lib/AWS/CloudWatch/DescribeAnomalyDetectors.d.ts.map +1 -1
  13. package/lib/AWS/CloudWatch/DescribeInsightRules.d.ts +1 -1
  14. package/lib/AWS/CloudWatch/DescribeInsightRules.d.ts.map +1 -1
  15. package/lib/AWS/CloudWatch/DisableAlarmActions.d.ts +1 -1
  16. package/lib/AWS/CloudWatch/DisableAlarmActions.d.ts.map +1 -1
  17. package/lib/AWS/CloudWatch/DisableInsightRules.d.ts +1 -1
  18. package/lib/AWS/CloudWatch/DisableInsightRules.d.ts.map +1 -1
  19. package/lib/AWS/CloudWatch/EnableAlarmActions.d.ts +1 -1
  20. package/lib/AWS/CloudWatch/EnableAlarmActions.d.ts.map +1 -1
  21. package/lib/AWS/CloudWatch/GetAlarmMuteRule.d.ts +1 -1
  22. package/lib/AWS/CloudWatch/GetAlarmMuteRule.d.ts.map +1 -1
  23. package/lib/AWS/CloudWatch/GetDashboard.d.ts +1 -1
  24. package/lib/AWS/CloudWatch/GetDashboard.d.ts.map +1 -1
  25. package/lib/AWS/CloudWatch/GetInsightRuleReport.d.ts +1 -1
  26. package/lib/AWS/CloudWatch/GetInsightRuleReport.d.ts.map +1 -1
  27. package/lib/AWS/CloudWatch/GetMetricData.d.ts +1 -1
  28. package/lib/AWS/CloudWatch/GetMetricData.d.ts.map +1 -1
  29. package/lib/AWS/CloudWatch/GetMetricStatistics.d.ts +1 -1
  30. package/lib/AWS/CloudWatch/GetMetricStatistics.d.ts.map +1 -1
  31. package/lib/AWS/CloudWatch/GetMetricStream.d.ts +1 -1
  32. package/lib/AWS/CloudWatch/GetMetricStream.d.ts.map +1 -1
  33. package/lib/AWS/CloudWatch/GetMetricWidgetImage.d.ts +1 -1
  34. package/lib/AWS/CloudWatch/GetMetricWidgetImage.d.ts.map +1 -1
  35. package/lib/AWS/CloudWatch/ListAlarmMuteRules.d.ts +1 -1
  36. package/lib/AWS/CloudWatch/ListAlarmMuteRules.d.ts.map +1 -1
  37. package/lib/AWS/CloudWatch/ListDashboards.d.ts +1 -1
  38. package/lib/AWS/CloudWatch/ListDashboards.d.ts.map +1 -1
  39. package/lib/AWS/CloudWatch/ListManagedInsightRules.d.ts +1 -1
  40. package/lib/AWS/CloudWatch/ListManagedInsightRules.d.ts.map +1 -1
  41. package/lib/AWS/CloudWatch/ListMetricStreams.d.ts +1 -1
  42. package/lib/AWS/CloudWatch/ListMetricStreams.d.ts.map +1 -1
  43. package/lib/AWS/CloudWatch/ListMetrics.d.ts +1 -1
  44. package/lib/AWS/CloudWatch/ListMetrics.d.ts.map +1 -1
  45. package/lib/AWS/CloudWatch/ListTagsForResource.d.ts +1 -1
  46. package/lib/AWS/CloudWatch/ListTagsForResource.d.ts.map +1 -1
  47. package/lib/AWS/CloudWatch/PutMetricData.d.ts +1 -1
  48. package/lib/AWS/CloudWatch/PutMetricData.d.ts.map +1 -1
  49. package/lib/AWS/CloudWatch/SetAlarmState.d.ts +1 -1
  50. package/lib/AWS/CloudWatch/SetAlarmState.d.ts.map +1 -1
  51. package/lib/AWS/DynamoDB/BatchExecuteStatement.d.ts +1 -1
  52. package/lib/AWS/DynamoDB/BatchExecuteStatement.d.ts.map +1 -1
  53. package/lib/AWS/DynamoDB/BatchGetItem.d.ts +1 -1
  54. package/lib/AWS/DynamoDB/BatchGetItem.d.ts.map +1 -1
  55. package/lib/AWS/DynamoDB/BatchWriteItem.d.ts +1 -1
  56. package/lib/AWS/DynamoDB/BatchWriteItem.d.ts.map +1 -1
  57. package/lib/AWS/DynamoDB/DeleteItem.d.ts +1 -1
  58. package/lib/AWS/DynamoDB/DeleteItem.d.ts.map +1 -1
  59. package/lib/AWS/DynamoDB/DescribeTable.d.ts +1 -1
  60. package/lib/AWS/DynamoDB/DescribeTable.d.ts.map +1 -1
  61. package/lib/AWS/DynamoDB/DescribeTimeToLive.d.ts +1 -1
  62. package/lib/AWS/DynamoDB/DescribeTimeToLive.d.ts.map +1 -1
  63. package/lib/AWS/DynamoDB/ExecuteStatement.d.ts +1 -1
  64. package/lib/AWS/DynamoDB/ExecuteStatement.d.ts.map +1 -1
  65. package/lib/AWS/DynamoDB/ExecuteTransaction.d.ts +1 -1
  66. package/lib/AWS/DynamoDB/ExecuteTransaction.d.ts.map +1 -1
  67. package/lib/AWS/DynamoDB/GetItem.d.ts +1 -1
  68. package/lib/AWS/DynamoDB/GetItem.d.ts.map +1 -1
  69. package/lib/AWS/DynamoDB/ListTables.d.ts +1 -1
  70. package/lib/AWS/DynamoDB/ListTables.d.ts.map +1 -1
  71. package/lib/AWS/DynamoDB/ListTagsOfResource.d.ts +1 -1
  72. package/lib/AWS/DynamoDB/ListTagsOfResource.d.ts.map +1 -1
  73. package/lib/AWS/DynamoDB/PutItem.d.ts +1 -1
  74. package/lib/AWS/DynamoDB/PutItem.d.ts.map +1 -1
  75. package/lib/AWS/DynamoDB/Query.d.ts +1 -1
  76. package/lib/AWS/DynamoDB/Query.d.ts.map +1 -1
  77. package/lib/AWS/DynamoDB/RestoreTableToPointInTime.d.ts +1 -1
  78. package/lib/AWS/DynamoDB/RestoreTableToPointInTime.d.ts.map +1 -1
  79. package/lib/AWS/DynamoDB/Scan.d.ts +1 -1
  80. package/lib/AWS/DynamoDB/Scan.d.ts.map +1 -1
  81. package/lib/AWS/DynamoDB/TransactGetItems.d.ts +1 -1
  82. package/lib/AWS/DynamoDB/TransactGetItems.d.ts.map +1 -1
  83. package/lib/AWS/DynamoDB/TransactWriteItems.d.ts +1 -1
  84. package/lib/AWS/DynamoDB/TransactWriteItems.d.ts.map +1 -1
  85. package/lib/AWS/DynamoDB/UpdateItem.d.ts +1 -1
  86. package/lib/AWS/DynamoDB/UpdateItem.d.ts.map +1 -1
  87. package/lib/AWS/DynamoDB/UpdateTimeToLive.d.ts +1 -1
  88. package/lib/AWS/DynamoDB/UpdateTimeToLive.d.ts.map +1 -1
  89. package/lib/AWS/ECS/DescribeTasks.d.ts +1 -1
  90. package/lib/AWS/ECS/DescribeTasks.d.ts.map +1 -1
  91. package/lib/AWS/ECS/ListTasks.d.ts +1 -1
  92. package/lib/AWS/ECS/ListTasks.d.ts.map +1 -1
  93. package/lib/AWS/ECS/RunTask.d.ts +1 -1
  94. package/lib/AWS/ECS/RunTask.d.ts.map +1 -1
  95. package/lib/AWS/ECS/StopTask.d.ts +1 -1
  96. package/lib/AWS/ECS/StopTask.d.ts.map +1 -1
  97. package/lib/AWS/EventBridge/DescribeEventBus.d.ts +1 -1
  98. package/lib/AWS/EventBridge/DescribeEventBus.d.ts.map +1 -1
  99. package/lib/AWS/EventBridge/DescribeRule.d.ts +1 -1
  100. package/lib/AWS/EventBridge/DescribeRule.d.ts.map +1 -1
  101. package/lib/AWS/EventBridge/EventSource.d.ts +2 -2
  102. package/lib/AWS/EventBridge/ListEventBuses.d.ts +1 -1
  103. package/lib/AWS/EventBridge/ListEventBuses.d.ts.map +1 -1
  104. package/lib/AWS/EventBridge/ListRules.d.ts +1 -1
  105. package/lib/AWS/EventBridge/ListRules.d.ts.map +1 -1
  106. package/lib/AWS/EventBridge/ListTargetsByRule.d.ts +1 -1
  107. package/lib/AWS/EventBridge/ListTargetsByRule.d.ts.map +1 -1
  108. package/lib/AWS/EventBridge/PutEvents.d.ts +1 -1
  109. package/lib/AWS/EventBridge/PutEvents.d.ts.map +1 -1
  110. package/lib/AWS/EventBridge/TestEventPattern.d.ts +1 -1
  111. package/lib/AWS/EventBridge/TestEventPattern.d.ts.map +1 -1
  112. package/lib/AWS/EventBridge/ToLambda.d.ts +1 -1
  113. package/lib/AWS/EventBridge/ToLambda.d.ts.map +1 -1
  114. package/lib/AWS/EventBridge/ToQueue.d.ts +1 -1
  115. package/lib/AWS/EventBridge/ToQueue.d.ts.map +1 -1
  116. package/lib/AWS/Kinesis/DescribeAccountSettings.d.ts +1 -1
  117. package/lib/AWS/Kinesis/DescribeAccountSettings.d.ts.map +1 -1
  118. package/lib/AWS/Kinesis/DescribeLimits.d.ts +1 -1
  119. package/lib/AWS/Kinesis/DescribeLimits.d.ts.map +1 -1
  120. package/lib/AWS/Kinesis/DescribeStream.d.ts +1 -1
  121. package/lib/AWS/Kinesis/DescribeStream.d.ts.map +1 -1
  122. package/lib/AWS/Kinesis/DescribeStreamConsumer.d.ts +1 -1
  123. package/lib/AWS/Kinesis/DescribeStreamConsumer.d.ts.map +1 -1
  124. package/lib/AWS/Kinesis/DescribeStreamSummary.d.ts +1 -1
  125. package/lib/AWS/Kinesis/DescribeStreamSummary.d.ts.map +1 -1
  126. package/lib/AWS/Kinesis/GetRecords.d.ts +1 -1
  127. package/lib/AWS/Kinesis/GetRecords.d.ts.map +1 -1
  128. package/lib/AWS/Kinesis/GetResourcePolicy.d.ts +1 -1
  129. package/lib/AWS/Kinesis/GetResourcePolicy.d.ts.map +1 -1
  130. package/lib/AWS/Kinesis/GetShardIterator.d.ts +1 -1
  131. package/lib/AWS/Kinesis/GetShardIterator.d.ts.map +1 -1
  132. package/lib/AWS/Kinesis/ListShards.d.ts +1 -1
  133. package/lib/AWS/Kinesis/ListShards.d.ts.map +1 -1
  134. package/lib/AWS/Kinesis/ListStreamConsumers.d.ts +1 -1
  135. package/lib/AWS/Kinesis/ListStreamConsumers.d.ts.map +1 -1
  136. package/lib/AWS/Kinesis/ListStreams.d.ts +1 -1
  137. package/lib/AWS/Kinesis/ListStreams.d.ts.map +1 -1
  138. package/lib/AWS/Kinesis/ListTagsForResource.d.ts +1 -1
  139. package/lib/AWS/Kinesis/ListTagsForResource.d.ts.map +1 -1
  140. package/lib/AWS/Kinesis/PutRecord.d.ts +1 -1
  141. package/lib/AWS/Kinesis/PutRecord.d.ts.map +1 -1
  142. package/lib/AWS/Kinesis/PutRecords.d.ts +1 -1
  143. package/lib/AWS/Kinesis/PutRecords.d.ts.map +1 -1
  144. package/lib/AWS/Kinesis/StreamSink.d.ts +1 -1
  145. package/lib/AWS/Kinesis/StreamSink.d.ts.map +1 -1
  146. package/lib/AWS/Kinesis/SubscribeToShard.d.ts +1 -1
  147. package/lib/AWS/Kinesis/SubscribeToShard.d.ts.map +1 -1
  148. package/lib/AWS/Lambda/BucketEventSource.d.ts +2 -1
  149. package/lib/AWS/Lambda/BucketEventSource.d.ts.map +1 -1
  150. package/lib/AWS/Lambda/EventBridgeEventSource.d.ts +2 -1
  151. package/lib/AWS/Lambda/EventBridgeEventSource.d.ts.map +1 -1
  152. package/lib/AWS/Lambda/InvokeFunction.d.ts +1 -1
  153. package/lib/AWS/Lambda/InvokeFunction.d.ts.map +1 -1
  154. package/lib/AWS/Lambda/QueueEventSource.d.ts +2 -1
  155. package/lib/AWS/Lambda/QueueEventSource.d.ts.map +1 -1
  156. package/lib/AWS/Lambda/StreamEventSource.d.ts +2 -1
  157. package/lib/AWS/Lambda/StreamEventSource.d.ts.map +1 -1
  158. package/lib/AWS/Lambda/TableEventSource.d.ts +2 -1
  159. package/lib/AWS/Lambda/TableEventSource.d.ts.map +1 -1
  160. package/lib/AWS/Lambda/TopicEventSource.d.ts +2 -1
  161. package/lib/AWS/Lambda/TopicEventSource.d.ts.map +1 -1
  162. package/lib/AWS/RDS/Connect.d.ts +1 -1
  163. package/lib/AWS/RDS/Connect.d.ts.map +1 -1
  164. package/lib/AWS/RDSData/BatchExecuteStatement.d.ts +1 -1
  165. package/lib/AWS/RDSData/BatchExecuteStatement.d.ts.map +1 -1
  166. package/lib/AWS/RDSData/BeginTransaction.d.ts +1 -1
  167. package/lib/AWS/RDSData/BeginTransaction.d.ts.map +1 -1
  168. package/lib/AWS/RDSData/CommitTransaction.d.ts +1 -1
  169. package/lib/AWS/RDSData/CommitTransaction.d.ts.map +1 -1
  170. package/lib/AWS/RDSData/ExecuteSql.d.ts +1 -1
  171. package/lib/AWS/RDSData/ExecuteSql.d.ts.map +1 -1
  172. package/lib/AWS/RDSData/ExecuteStatement.d.ts +1 -1
  173. package/lib/AWS/RDSData/ExecuteStatement.d.ts.map +1 -1
  174. package/lib/AWS/RDSData/RollbackTransaction.d.ts +1 -1
  175. package/lib/AWS/RDSData/RollbackTransaction.d.ts.map +1 -1
  176. package/lib/AWS/S3/AbortMultipartUpload.d.ts +1 -1
  177. package/lib/AWS/S3/AbortMultipartUpload.d.ts.map +1 -1
  178. package/lib/AWS/S3/CompleteMultipartUpload.d.ts +1 -1
  179. package/lib/AWS/S3/CompleteMultipartUpload.d.ts.map +1 -1
  180. package/lib/AWS/S3/CopyObject.d.ts +1 -1
  181. package/lib/AWS/S3/CopyObject.d.ts.map +1 -1
  182. package/lib/AWS/S3/CreateMultipartUpload.d.ts +1 -1
  183. package/lib/AWS/S3/CreateMultipartUpload.d.ts.map +1 -1
  184. package/lib/AWS/S3/DeleteObject.d.ts +1 -1
  185. package/lib/AWS/S3/DeleteObject.d.ts.map +1 -1
  186. package/lib/AWS/S3/GetObject.d.ts +1 -1
  187. package/lib/AWS/S3/GetObject.d.ts.map +1 -1
  188. package/lib/AWS/S3/HeadObject.d.ts +1 -1
  189. package/lib/AWS/S3/HeadObject.d.ts.map +1 -1
  190. package/lib/AWS/S3/ListObjectsV2.d.ts +1 -1
  191. package/lib/AWS/S3/ListObjectsV2.d.ts.map +1 -1
  192. package/lib/AWS/S3/PutObject.d.ts +1 -1
  193. package/lib/AWS/S3/PutObject.d.ts.map +1 -1
  194. package/lib/AWS/S3/UploadPart.d.ts +1 -1
  195. package/lib/AWS/S3/UploadPart.d.ts.map +1 -1
  196. package/lib/AWS/SNS/AddPermission.d.ts +1 -1
  197. package/lib/AWS/SNS/AddPermission.d.ts.map +1 -1
  198. package/lib/AWS/SNS/ConfirmSubscription.d.ts +1 -1
  199. package/lib/AWS/SNS/ConfirmSubscription.d.ts.map +1 -1
  200. package/lib/AWS/SNS/GetDataProtectionPolicy.d.ts +1 -1
  201. package/lib/AWS/SNS/GetDataProtectionPolicy.d.ts.map +1 -1
  202. package/lib/AWS/SNS/GetSubscriptionAttributes.d.ts +1 -1
  203. package/lib/AWS/SNS/GetSubscriptionAttributes.d.ts.map +1 -1
  204. package/lib/AWS/SNS/GetTopicAttributes.d.ts +1 -1
  205. package/lib/AWS/SNS/GetTopicAttributes.d.ts.map +1 -1
  206. package/lib/AWS/SNS/ListSubscriptions.d.ts +1 -1
  207. package/lib/AWS/SNS/ListSubscriptions.d.ts.map +1 -1
  208. package/lib/AWS/SNS/ListSubscriptionsByTopic.d.ts +1 -1
  209. package/lib/AWS/SNS/ListSubscriptionsByTopic.d.ts.map +1 -1
  210. package/lib/AWS/SNS/ListTagsForResource.d.ts +1 -1
  211. package/lib/AWS/SNS/ListTagsForResource.d.ts.map +1 -1
  212. package/lib/AWS/SNS/ListTopics.d.ts +1 -1
  213. package/lib/AWS/SNS/ListTopics.d.ts.map +1 -1
  214. package/lib/AWS/SNS/Publish.d.ts +1 -1
  215. package/lib/AWS/SNS/Publish.d.ts.map +1 -1
  216. package/lib/AWS/SNS/PublishBatch.d.ts +1 -1
  217. package/lib/AWS/SNS/PublishBatch.d.ts.map +1 -1
  218. package/lib/AWS/SNS/PutDataProtectionPolicy.d.ts +1 -1
  219. package/lib/AWS/SNS/PutDataProtectionPolicy.d.ts.map +1 -1
  220. package/lib/AWS/SNS/RemovePermission.d.ts +1 -1
  221. package/lib/AWS/SNS/RemovePermission.d.ts.map +1 -1
  222. package/lib/AWS/SNS/SetSubscriptionAttributes.d.ts +1 -1
  223. package/lib/AWS/SNS/SetSubscriptionAttributes.d.ts.map +1 -1
  224. package/lib/AWS/SNS/SetTopicAttributes.d.ts +1 -1
  225. package/lib/AWS/SNS/SetTopicAttributes.d.ts.map +1 -1
  226. package/lib/AWS/SNS/TagResource.d.ts +1 -1
  227. package/lib/AWS/SNS/TagResource.d.ts.map +1 -1
  228. package/lib/AWS/SNS/TopicSink.d.ts +1 -1
  229. package/lib/AWS/SNS/TopicSink.d.ts.map +1 -1
  230. package/lib/AWS/SNS/UntagResource.d.ts +1 -1
  231. package/lib/AWS/SNS/UntagResource.d.ts.map +1 -1
  232. package/lib/AWS/SQS/DeleteMessage.d.ts +1 -1
  233. package/lib/AWS/SQS/DeleteMessage.d.ts.map +1 -1
  234. package/lib/AWS/SQS/DeleteMessageBatch.d.ts +1 -1
  235. package/lib/AWS/SQS/DeleteMessageBatch.d.ts.map +1 -1
  236. package/lib/AWS/SQS/QueueSink.d.ts +1 -1
  237. package/lib/AWS/SQS/QueueSink.d.ts.map +1 -1
  238. package/lib/AWS/SQS/ReceiveMessage.d.ts +1 -1
  239. package/lib/AWS/SQS/ReceiveMessage.d.ts.map +1 -1
  240. package/lib/AWS/SQS/SendMessage.d.ts +1 -1
  241. package/lib/AWS/SQS/SendMessage.d.ts.map +1 -1
  242. package/lib/AWS/SQS/SendMessageBatch.d.ts +1 -1
  243. package/lib/AWS/SQS/SendMessageBatch.d.ts.map +1 -1
  244. package/lib/AWS/SecretsManager/DescribeSecret.d.ts +1 -1
  245. package/lib/AWS/SecretsManager/DescribeSecret.d.ts.map +1 -1
  246. package/lib/AWS/SecretsManager/GetRandomPassword.d.ts +1 -1
  247. package/lib/AWS/SecretsManager/GetRandomPassword.d.ts.map +1 -1
  248. package/lib/AWS/SecretsManager/GetSecretValue.d.ts +1 -1
  249. package/lib/AWS/SecretsManager/GetSecretValue.d.ts.map +1 -1
  250. package/lib/AWS/SecretsManager/ListSecrets.d.ts +1 -1
  251. package/lib/AWS/SecretsManager/ListSecrets.d.ts.map +1 -1
  252. package/lib/AWS/SecretsManager/PutSecretValue.d.ts +1 -1
  253. package/lib/AWS/SecretsManager/PutSecretValue.d.ts.map +1 -1
  254. package/lib/Binding.d.ts +1 -1
  255. package/lib/Binding.d.ts.map +1 -1
  256. package/lib/Bundle/Docker.d.ts.map +1 -1
  257. package/lib/Bundle/Docker.js +12 -13
  258. package/lib/Bundle/Docker.js.map +1 -1
  259. package/lib/Cli/commands/deploy.d.ts.map +1 -1
  260. package/lib/Cli/commands/deploy.js +1 -0
  261. package/lib/Cli/commands/deploy.js.map +1 -1
  262. package/lib/Cloudflare/AiGateway/AiGatewayBinding.d.ts +8 -7
  263. package/lib/Cloudflare/AiGateway/AiGatewayBinding.d.ts.map +1 -1
  264. package/lib/Cloudflare/AiGateway/AiGatewayBinding.js +2 -6
  265. package/lib/Cloudflare/AiGateway/AiGatewayBinding.js.map +1 -1
  266. package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.d.ts +4 -3
  267. package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.d.ts.map +1 -1
  268. package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.js +2 -1
  269. package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.js.map +1 -1
  270. package/lib/Cloudflare/Artifacts/ArtifactsBinding.d.ts +8 -7
  271. package/lib/Cloudflare/Artifacts/ArtifactsBinding.d.ts.map +1 -1
  272. package/lib/Cloudflare/Artifacts/ArtifactsBinding.js +2 -2
  273. package/lib/Cloudflare/Artifacts/ArtifactsBinding.js.map +1 -1
  274. package/lib/Cloudflare/D1/D1Connection.d.ts +12 -10
  275. package/lib/Cloudflare/D1/D1Connection.d.ts.map +1 -1
  276. package/lib/Cloudflare/D1/D1Connection.js +2 -2
  277. package/lib/Cloudflare/D1/D1Connection.js.map +1 -1
  278. package/lib/Cloudflare/D1/D1Database.js +1 -1
  279. package/lib/Cloudflare/D1/D1Database.js.map +1 -1
  280. package/lib/Cloudflare/D1/D1Migrations.d.ts +2 -2
  281. package/lib/Cloudflare/D1/D1Migrations.d.ts.map +1 -1
  282. package/lib/Cloudflare/Email/SendEmailBinding.d.ts +5 -4
  283. package/lib/Cloudflare/Email/SendEmailBinding.d.ts.map +1 -1
  284. package/lib/Cloudflare/Email/SendEmailBinding.js +2 -1
  285. package/lib/Cloudflare/Email/SendEmailBinding.js.map +1 -1
  286. package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.d.ts +10 -8
  287. package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.d.ts.map +1 -1
  288. package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.js +2 -2
  289. package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.js.map +1 -1
  290. package/lib/Cloudflare/Images/ImagesBinding.d.ts +5 -4
  291. package/lib/Cloudflare/Images/ImagesBinding.d.ts.map +1 -1
  292. package/lib/Cloudflare/Images/ImagesBinding.js +4 -2
  293. package/lib/Cloudflare/Images/ImagesBinding.js.map +1 -1
  294. package/lib/Cloudflare/KV/KVNamespaceBinding.d.ts +33 -32
  295. package/lib/Cloudflare/KV/KVNamespaceBinding.d.ts.map +1 -1
  296. package/lib/Cloudflare/KV/KVNamespaceBinding.js +5 -2
  297. package/lib/Cloudflare/KV/KVNamespaceBinding.js.map +1 -1
  298. package/lib/Cloudflare/Queue/QueueBinding.d.ts +5 -4
  299. package/lib/Cloudflare/Queue/QueueBinding.d.ts.map +1 -1
  300. package/lib/Cloudflare/Queue/QueueBinding.js +2 -2
  301. package/lib/Cloudflare/Queue/QueueBinding.js.map +1 -1
  302. package/lib/Cloudflare/Queue/QueueEventSource.d.ts +1 -2
  303. package/lib/Cloudflare/Queue/QueueEventSource.d.ts.map +1 -1
  304. package/lib/Cloudflare/R2/R2BucketBinding.d.ts +13 -12
  305. package/lib/Cloudflare/R2/R2BucketBinding.d.ts.map +1 -1
  306. package/lib/Cloudflare/R2/R2BucketBinding.js +2 -2
  307. package/lib/Cloudflare/R2/R2BucketBinding.js.map +1 -1
  308. package/lib/Cloudflare/SecretsStore/SecretBinding.d.ts +5 -4
  309. package/lib/Cloudflare/SecretsStore/SecretBinding.d.ts.map +1 -1
  310. package/lib/Cloudflare/SecretsStore/SecretBinding.js +2 -2
  311. package/lib/Cloudflare/SecretsStore/SecretBinding.js.map +1 -1
  312. package/lib/Cloudflare/StateStore/Api.d.ts +1 -1
  313. package/lib/Cloudflare/Workers/CronEventSource.d.ts +1 -2
  314. package/lib/Cloudflare/Workers/CronEventSource.d.ts.map +1 -1
  315. package/lib/Cloudflare/Workers/DurableObjectNamespace.d.ts.map +1 -1
  316. package/lib/Cloudflare/Workers/DurableObjectNamespace.js +6 -3
  317. package/lib/Cloudflare/Workers/DurableObjectNamespace.js.map +1 -1
  318. package/lib/Cloudflare/Workers/DynamicWorkerLoader.d.ts.map +1 -1
  319. package/lib/Cloudflare/Workers/DynamicWorkerLoader.js +3 -3
  320. package/lib/Cloudflare/Workers/DynamicWorkerLoader.js.map +1 -1
  321. package/lib/Cloudflare/Workers/Fetch.d.ts +1 -1
  322. package/lib/Cloudflare/Workers/Fetch.d.ts.map +1 -1
  323. package/lib/Cloudflare/Workers/RpcAsync.d.ts +55 -0
  324. package/lib/Cloudflare/Workers/RpcAsync.d.ts.map +1 -1
  325. package/lib/Cloudflare/Workers/RpcAsync.js +55 -0
  326. package/lib/Cloudflare/Workers/RpcAsync.js.map +1 -1
  327. package/lib/Cloudflare/Workers/Worker.d.ts +3 -3
  328. package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
  329. package/lib/Cloudflare/Workers/Worker.js +9 -2
  330. package/lib/Cloudflare/Workers/Worker.js.map +1 -1
  331. package/lib/Cloudflare/Workers/WorkerRuntimeContext.d.ts.map +1 -1
  332. package/lib/Cloudflare/Workers/WorkerRuntimeContext.js +2 -0
  333. package/lib/Cloudflare/Workers/WorkerRuntimeContext.js.map +1 -1
  334. package/lib/Cloudflare/Workers/Workflow.d.ts +4 -4
  335. package/lib/Cloudflare/Workers/Workflow.d.ts.map +1 -1
  336. package/lib/Cloudflare/Workers/Workflow.js +6 -3
  337. package/lib/Cloudflare/Workers/Workflow.js.map +1 -1
  338. package/lib/Neon/Branch.js +1 -1
  339. package/lib/Neon/Branch.js.map +1 -1
  340. package/lib/Neon/Migrations.d.ts +1 -1
  341. package/lib/Neon/Migrations.d.ts.map +1 -1
  342. package/lib/Neon/Project.d.ts.map +1 -1
  343. package/lib/Neon/Project.js +1 -15
  344. package/lib/Neon/Project.js.map +1 -1
  345. package/lib/Phase.d.ts +2 -2
  346. package/lib/Phase.d.ts.map +1 -1
  347. package/lib/Phase.js +2 -1
  348. package/lib/Phase.js.map +1 -1
  349. package/lib/Planetscale/AuthProvider.d.ts +59 -0
  350. package/lib/Planetscale/AuthProvider.d.ts.map +1 -0
  351. package/lib/Planetscale/AuthProvider.js +131 -0
  352. package/lib/Planetscale/AuthProvider.js.map +1 -0
  353. package/lib/Planetscale/Branch.d.ts +113 -0
  354. package/lib/Planetscale/Branch.d.ts.map +1 -0
  355. package/lib/Planetscale/Branch.js +287 -0
  356. package/lib/Planetscale/Branch.js.map +1 -0
  357. package/lib/Planetscale/Credentials.d.ts +35 -0
  358. package/lib/Planetscale/Credentials.d.ts.map +1 -0
  359. package/lib/Planetscale/Credentials.js +56 -0
  360. package/lib/Planetscale/Credentials.js.map +1 -0
  361. package/lib/Planetscale/Database.d.ts +117 -0
  362. package/lib/Planetscale/Database.d.ts.map +1 -0
  363. package/lib/Planetscale/Database.js +1 -0
  364. package/lib/Planetscale/Database.js.map +1 -0
  365. package/lib/Planetscale/MySQL/MySQLBranch.d.ts +86 -0
  366. package/lib/Planetscale/MySQL/MySQLBranch.d.ts.map +1 -0
  367. package/lib/Planetscale/MySQL/MySQLBranch.js +14 -0
  368. package/lib/Planetscale/MySQL/MySQLBranch.js.map +1 -0
  369. package/lib/Planetscale/MySQL/MySQLClusterSize.d.ts +23 -0
  370. package/lib/Planetscale/MySQL/MySQLClusterSize.d.ts.map +1 -0
  371. package/lib/Planetscale/MySQL/MySQLClusterSize.js +44 -0
  372. package/lib/Planetscale/MySQL/MySQLClusterSize.js.map +1 -0
  373. package/lib/Planetscale/MySQL/MySQLDatabase.d.ts +119 -0
  374. package/lib/Planetscale/MySQL/MySQLDatabase.d.ts.map +1 -0
  375. package/lib/Planetscale/MySQL/MySQLDatabase.js +237 -0
  376. package/lib/Planetscale/MySQL/MySQLDatabase.js.map +1 -0
  377. package/lib/Planetscale/MySQL/MySQLMigrations.d.ts +18 -0
  378. package/lib/Planetscale/MySQL/MySQLMigrations.d.ts.map +1 -0
  379. package/lib/Planetscale/MySQL/MySQLMigrations.js +157 -0
  380. package/lib/Planetscale/MySQL/MySQLMigrations.js.map +1 -0
  381. package/lib/Planetscale/MySQL/MySQLOrigin.d.ts +15 -0
  382. package/lib/Planetscale/MySQL/MySQLOrigin.d.ts.map +1 -0
  383. package/lib/Planetscale/MySQL/MySQLOrigin.js +2 -0
  384. package/lib/Planetscale/MySQL/MySQLOrigin.js.map +1 -0
  385. package/lib/Planetscale/MySQL/MySQLPassword.d.ts +115 -0
  386. package/lib/Planetscale/MySQL/MySQLPassword.d.ts.map +1 -0
  387. package/lib/Planetscale/MySQL/MySQLPassword.js +197 -0
  388. package/lib/Planetscale/MySQL/MySQLPassword.js.map +1 -0
  389. package/lib/Planetscale/MySQL/index.d.ts +6 -0
  390. package/lib/Planetscale/MySQL/index.d.ts.map +1 -0
  391. package/lib/Planetscale/MySQL/index.js +6 -0
  392. package/lib/Planetscale/MySQL/index.js.map +1 -0
  393. package/lib/Planetscale/Postgres/PostgresBranch.d.ts +67 -0
  394. package/lib/Planetscale/Postgres/PostgresBranch.d.ts.map +1 -0
  395. package/lib/Planetscale/Postgres/PostgresBranch.js +14 -0
  396. package/lib/Planetscale/Postgres/PostgresBranch.js.map +1 -0
  397. package/lib/Planetscale/Postgres/PostgresClusterSize.d.ts +44 -0
  398. package/lib/Planetscale/Postgres/PostgresClusterSize.d.ts.map +1 -0
  399. package/lib/Planetscale/Postgres/PostgresClusterSize.js +72 -0
  400. package/lib/Planetscale/Postgres/PostgresClusterSize.js.map +1 -0
  401. package/lib/Planetscale/Postgres/PostgresDatabase.d.ts +73 -0
  402. package/lib/Planetscale/Postgres/PostgresDatabase.d.ts.map +1 -0
  403. package/lib/Planetscale/Postgres/PostgresDatabase.js +241 -0
  404. package/lib/Planetscale/Postgres/PostgresDatabase.js.map +1 -0
  405. package/lib/Planetscale/Postgres/PostgresDefaultRole.d.ts +85 -0
  406. package/lib/Planetscale/Postgres/PostgresDefaultRole.d.ts.map +1 -0
  407. package/lib/Planetscale/Postgres/PostgresDefaultRole.js +142 -0
  408. package/lib/Planetscale/Postgres/PostgresDefaultRole.js.map +1 -0
  409. package/lib/Planetscale/Postgres/PostgresMigrations.d.ts +18 -0
  410. package/lib/Planetscale/Postgres/PostgresMigrations.d.ts.map +1 -0
  411. package/lib/Planetscale/Postgres/PostgresMigrations.js +148 -0
  412. package/lib/Planetscale/Postgres/PostgresMigrations.js.map +1 -0
  413. package/lib/Planetscale/Postgres/PostgresOrigin.d.ts +15 -0
  414. package/lib/Planetscale/Postgres/PostgresOrigin.d.ts.map +1 -0
  415. package/lib/Planetscale/Postgres/PostgresOrigin.js +2 -0
  416. package/lib/Planetscale/Postgres/PostgresOrigin.js.map +1 -0
  417. package/lib/Planetscale/Postgres/PostgresRole.d.ts +121 -0
  418. package/lib/Planetscale/Postgres/PostgresRole.d.ts.map +1 -0
  419. package/lib/Planetscale/Postgres/PostgresRole.js +228 -0
  420. package/lib/Planetscale/Postgres/PostgresRole.js.map +1 -0
  421. package/lib/Planetscale/Postgres/index.d.ts +7 -0
  422. package/lib/Planetscale/Postgres/index.d.ts.map +1 -0
  423. package/lib/Planetscale/Postgres/index.js +7 -0
  424. package/lib/Planetscale/Postgres/index.js.map +1 -0
  425. package/lib/Planetscale/Providers.d.ts +25 -0
  426. package/lib/Planetscale/Providers.d.ts.map +1 -0
  427. package/lib/Planetscale/Providers.js +40 -0
  428. package/lib/Planetscale/Providers.js.map +1 -0
  429. package/lib/Planetscale/Util.d.ts +182 -0
  430. package/lib/Planetscale/Util.d.ts.map +1 -0
  431. package/lib/Planetscale/Util.js +98 -0
  432. package/lib/Planetscale/Util.js.map +1 -0
  433. package/lib/Planetscale/index.d.ts +9 -0
  434. package/lib/Planetscale/index.d.ts.map +1 -0
  435. package/lib/Planetscale/index.js +9 -0
  436. package/lib/Planetscale/index.js.map +1 -0
  437. package/lib/Platform.d.ts.map +1 -1
  438. package/lib/Platform.js +7 -2
  439. package/lib/Platform.js.map +1 -1
  440. package/lib/RuntimeContext.d.ts +7 -3
  441. package/lib/RuntimeContext.d.ts.map +1 -1
  442. package/lib/RuntimeContext.js +3 -2
  443. package/lib/RuntimeContext.js.map +1 -1
  444. package/lib/Server/S3BucketEventSource.d.ts +1 -1
  445. package/lib/Server/S3BucketEventSource.d.ts.map +1 -1
  446. package/lib/{Neon → Sql}/SqlFile.d.ts +2 -0
  447. package/lib/Sql/SqlFile.d.ts.map +1 -0
  448. package/lib/{Neon → Sql}/SqlFile.js +14 -0
  449. package/lib/Sql/SqlFile.js.map +1 -0
  450. package/lib/Sql/index.d.ts +2 -0
  451. package/lib/Sql/index.d.ts.map +1 -0
  452. package/lib/Sql/index.js +2 -0
  453. package/lib/Sql/index.js.map +1 -0
  454. package/lib/tsconfig.test.tsbuildinfo +1 -1
  455. package/package.json +20 -6
  456. package/src/Binding.ts +1 -1
  457. package/src/Bundle/Docker.ts +12 -15
  458. package/src/Cli/commands/deploy.ts +1 -0
  459. package/src/Cloudflare/AiGateway/AiGatewayBinding.ts +11 -16
  460. package/src/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.ts +7 -9
  461. package/src/Cloudflare/Artifacts/ArtifactsBinding.ts +11 -22
  462. package/src/Cloudflare/D1/D1Connection.ts +31 -18
  463. package/src/Cloudflare/D1/D1Database.ts +1 -1
  464. package/src/Cloudflare/D1/D1Migrations.ts +2 -2
  465. package/src/Cloudflare/Email/SendEmailBinding.ts +7 -5
  466. package/src/Cloudflare/Hyperdrive/HyperdriveBinding.ts +16 -12
  467. package/src/Cloudflare/Images/ImagesBinding.ts +8 -8
  468. package/src/Cloudflare/KV/KVNamespaceBinding.ts +38 -38
  469. package/src/Cloudflare/Queue/QueueBinding.ts +7 -6
  470. package/src/Cloudflare/R2/R2BucketBinding.ts +16 -19
  471. package/src/Cloudflare/SecretsStore/SecretBinding.ts +11 -13
  472. package/src/Cloudflare/Workers/DurableObjectNamespace.ts +6 -6
  473. package/src/Cloudflare/Workers/DynamicWorkerLoader.ts +4 -5
  474. package/src/Cloudflare/Workers/RpcAsync.ts +55 -0
  475. package/src/Cloudflare/Workers/Worker.ts +17 -5
  476. package/src/Cloudflare/Workers/WorkerRuntimeContext.ts +2 -0
  477. package/src/Cloudflare/Workers/Workflow.ts +10 -11
  478. package/src/Neon/Branch.ts +1 -1
  479. package/src/Neon/Migrations.ts +1 -1
  480. package/src/Neon/Project.ts +6 -20
  481. package/src/Phase.ts +2 -0
  482. package/src/Planetscale/AuthProvider.ts +285 -0
  483. package/src/Planetscale/Branch.ts +508 -0
  484. package/src/Planetscale/Credentials.ts +96 -0
  485. package/src/Planetscale/Database.ts +129 -0
  486. package/src/Planetscale/MySQL/MySQLBranch.ts +112 -0
  487. package/src/Planetscale/MySQL/MySQLClusterSize.ts +102 -0
  488. package/src/Planetscale/MySQL/MySQLDatabase.ts +446 -0
  489. package/src/Planetscale/MySQL/MySQLMigrations.ts +271 -0
  490. package/src/Planetscale/MySQL/MySQLOrigin.ts +15 -0
  491. package/src/Planetscale/MySQL/MySQLPassword.ts +387 -0
  492. package/src/Planetscale/MySQL/index.ts +5 -0
  493. package/src/Planetscale/Postgres/PostgresBranch.ts +97 -0
  494. package/src/Planetscale/Postgres/PostgresClusterSize.ts +125 -0
  495. package/src/Planetscale/Postgres/PostgresDatabase.ts +404 -0
  496. package/src/Planetscale/Postgres/PostgresDefaultRole.ts +270 -0
  497. package/src/Planetscale/Postgres/PostgresMigrations.ts +256 -0
  498. package/src/Planetscale/Postgres/PostgresOrigin.ts +15 -0
  499. package/src/Planetscale/Postgres/PostgresRole.ts +469 -0
  500. package/src/Planetscale/Postgres/index.ts +6 -0
  501. package/src/Planetscale/Providers.ts +80 -0
  502. package/src/Planetscale/Util.ts +160 -0
  503. package/src/Planetscale/index.ts +18 -0
  504. package/src/Platform.ts +13 -1
  505. package/src/RuntimeContext.ts +7 -8
  506. package/src/{Neon → Sql}/SqlFile.ts +22 -0
  507. package/src/Sql/index.ts +1 -0
  508. package/lib/Cloudflare/D1/D1SqlFile.d.ts +0 -20
  509. package/lib/Cloudflare/D1/D1SqlFile.d.ts.map +0 -1
  510. package/lib/Cloudflare/D1/D1SqlFile.js +0 -46
  511. package/lib/Cloudflare/D1/D1SqlFile.js.map +0 -1
  512. package/lib/Neon/SqlFile.d.ts.map +0 -1
  513. package/lib/Neon/SqlFile.js.map +0 -1
  514. package/src/Cloudflare/D1/D1SqlFile.ts +0 -55
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alchemy",
3
- "version": "2.0.0-beta.41",
3
+ "version": "2.0.0-beta.43",
4
4
  "homepage": "https://alchemy.run",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Sam Goodwin <sam@alchemy.run>",
@@ -196,6 +196,18 @@
196
196
  "worker": "./src/Output.ts",
197
197
  "import": "./lib/Output.js"
198
198
  },
199
+ "./Planetscale": {
200
+ "types": "./lib/Planetscale/index.d.ts",
201
+ "bun": "./src/Planetscale/index.ts",
202
+ "worker": "./src/Planetscale/index.ts",
203
+ "import": "./lib/Planetscale/index.js"
204
+ },
205
+ "./Planetscale/*": {
206
+ "types": "./lib/Planetscale/*/index.d.ts",
207
+ "bun": "./src/Planetscale/*/index.ts",
208
+ "worker": "./src/Planetscale/*/index.ts",
209
+ "import": "./lib/Planetscale/*/index.js"
210
+ },
199
211
  "./Runtime": {
200
212
  "types": "./lib/Runtime.d.ts",
201
213
  "bun": "./src/Runtime.ts",
@@ -279,14 +291,15 @@
279
291
  "@alchemy.run/node-utils": "0.0.2",
280
292
  "@aws-sdk/credential-providers": "^3.0.0",
281
293
  "@clack/prompts": "^0.11.0",
282
- "@distilled.cloud/aws": "^0.21.0",
283
- "@distilled.cloud/axiom": "^0.21.0",
284
- "@distilled.cloud/cloudflare": "^0.21.0",
294
+ "@distilled.cloud/aws": "^0.21.3",
295
+ "@distilled.cloud/axiom": "^0.21.3",
296
+ "@distilled.cloud/cloudflare": "^0.21.3",
285
297
  "@distilled.cloud/cloudflare-rolldown-plugin": "0.5.4",
286
298
  "@distilled.cloud/cloudflare-runtime": "0.5.4",
287
299
  "@distilled.cloud/cloudflare-vite-plugin": "0.5.4",
288
- "@distilled.cloud/core": "^0.21.0",
289
- "@distilled.cloud/neon": "^0.21.0",
300
+ "@distilled.cloud/core": "^0.21.3",
301
+ "@distilled.cloud/planetscale": "^0.21.3",
302
+ "@distilled.cloud/neon": "^0.21.3",
290
303
  "@effect/vitest": ">=4.0.0-beta.66 || >=4.0.0",
291
304
  "@libsql/client": "^0.17.0",
292
305
  "@octokit/rest": "^22.0.1",
@@ -303,6 +316,7 @@
303
316
  "jszip": "^3.10.1",
304
317
  "libsodium-wrappers": "^0.8.3",
305
318
  "magic-string": "^0.30.21",
319
+ "mysql2": "^3.15.3",
306
320
  "pathe": "^2.0.3",
307
321
  "pg": "^8.13.0",
308
322
  "picomatch": "^4.0.4",
package/src/Binding.ts CHANGED
@@ -90,7 +90,7 @@ export interface Policy<
90
90
  in out Self,
91
91
  in out Identifier extends string,
92
92
  in out Shape extends (...args: any[]) => Effect.Effect<any, any, any>,
93
- > extends Effect.Effect<Shape, never, Self | RuntimeContext> {
93
+ > extends Effect.Effect<Shape, never, Self> {
94
94
  readonly key: Identifier;
95
95
  new (_: never): PolicyShape<Identifier, Shape>;
96
96
  layer: {
@@ -2,6 +2,7 @@ import * as Data from "effect/Data";
2
2
  import * as Effect from "effect/Effect";
3
3
  import * as FileSystem from "effect/FileSystem";
4
4
  import * as Path from "effect/Path";
5
+ import * as Stream from "effect/Stream";
5
6
  import { ChildProcess } from "effect/unstable/process";
6
7
  import { exec } from "../Util/exec.ts";
7
8
 
@@ -66,8 +67,6 @@ export const writeContextFiles = Effect.fn(function* (
66
67
  }
67
68
  });
68
69
 
69
- const shellQuote = (value: string) => `'${value.replaceAll("'", `'\\''`)}'`;
70
-
71
70
  export const runDockerCommand = Effect.fn(function* (
72
71
  args: ReadonlyArray<string>,
73
72
  options?: {
@@ -77,24 +76,22 @@ export const runDockerCommand = Effect.fn(function* (
77
76
  stdin?: string;
78
77
  },
79
78
  ) {
80
- const command = `docker ${args.map(shellQuote).join(" ")}`;
81
- const shellCommand =
82
- options?.stdin === undefined
83
- ? command
84
- : `printf '%s' "$ALCHEMY_DOCKER_STDIN" | ${command}`;
85
- const env = {
86
- ...process.env,
87
- ...options?.env,
88
- ...(options?.stdin === undefined
89
- ? {}
90
- : { ALCHEMY_DOCKER_STDIN: options.stdin }),
79
+ const command = `docker ${args.join(" ")}`;
80
+ const env = { ...process.env, ...options?.env };
81
+ const commandOptions: ChildProcess.CommandOptions = {
82
+ env,
83
+ ...(options?.stdin !== undefined
84
+ ? {
85
+ stdin: Stream.succeed(new TextEncoder().encode(options.stdin)),
86
+ }
87
+ : {}),
91
88
  };
92
89
  const child = options?.cwd
93
90
  ? ChildProcess.setCwd(
94
- ChildProcess.make(shellCommand, [], { shell: true, env }),
91
+ ChildProcess.make("docker", args, commandOptions),
95
92
  options.cwd,
96
93
  )
97
- : ChildProcess.make(shellCommand, [], { shell: true, env });
94
+ : ChildProcess.make("docker", args, commandOptions);
98
95
 
99
96
  const { stdout, stderr, exitCode } = yield* exec(child).pipe(
100
97
  Effect.catch((e) =>
@@ -125,6 +125,7 @@ export const execStack = Effect.fn(function* ({
125
125
  // TODO(sam): probably better to have Plan.destroy and Plan.update
126
126
  resources: {},
127
127
  bindings: {},
128
+ actions: {},
128
129
  output: {},
129
130
  }
130
131
  : stack,
@@ -3,9 +3,9 @@
3
3
  import * as Data from "effect/Data";
4
4
  import * as Effect from "effect/Effect";
5
5
  import * as Layer from "effect/Layer";
6
- import * as Option from "effect/Option";
7
6
  import * as Binding from "../../Binding.ts";
8
7
  import type { ResourceLike } from "../../Resource.ts";
8
+ import type { RuntimeContext } from "../../RuntimeContext.ts";
9
9
  import { isWorker, WorkerEnvironment } from "../Workers/Worker.ts";
10
10
  import type { AiGateway as AiGatewayResource } from "./AiGateway.ts";
11
11
 
@@ -34,37 +34,37 @@ export interface AiGatewayClient {
34
34
  /**
35
35
  * Effect resolving to the raw Workers AI binding.
36
36
  */
37
- raw: Effect.Effect<Ai, never, WorkerEnvironment>;
37
+ raw: Effect.Effect<Ai, never, RuntimeContext>;
38
38
  /**
39
39
  * Effect resolving to the raw AI Gateway runtime binding.
40
40
  */
41
- gateway: Effect.Effect<AiGateway, never, WorkerEnvironment>;
41
+ gateway: Effect.Effect<AiGateway, never, RuntimeContext>;
42
42
  /**
43
43
  * Update metadata on an existing AI Gateway log entry.
44
44
  */
45
45
  patchLog(
46
46
  logId: string,
47
47
  data: Parameters<AiGateway["patchLog"]>[1],
48
- ): Effect.Effect<void, AiGatewayError, WorkerEnvironment>;
48
+ ): Effect.Effect<void, AiGatewayError, RuntimeContext>;
49
49
  /**
50
50
  * Read an AI Gateway log entry by ID.
51
51
  */
52
52
  getLog(
53
53
  logId: string,
54
- ): Effect.Effect<AiGatewayLog, AiGatewayError, WorkerEnvironment>;
54
+ ): Effect.Effect<AiGatewayLog, AiGatewayError, RuntimeContext>;
55
55
  /**
56
56
  * Build a provider URL routed through this gateway.
57
57
  */
58
58
  getUrl(
59
59
  provider?: Parameters<AiGateway["getUrl"]>[0],
60
- ): Effect.Effect<string, AiGatewayError, WorkerEnvironment>;
60
+ ): Effect.Effect<string, AiGatewayError, RuntimeContext>;
61
61
  /**
62
62
  * Run an AI Gateway request through the Cloudflare runtime binding.
63
63
  */
64
64
  run(
65
65
  data: Parameters<AiGateway["run"]>[0],
66
66
  options?: Parameters<AiGateway["run"]>[1],
67
- ): Effect.Effect<Response, AiGatewayError, WorkerEnvironment>;
67
+ ): Effect.Effect<Response, AiGatewayError, RuntimeContext>;
68
68
  }
69
69
 
70
70
  /**
@@ -106,18 +106,13 @@ export const AiGatewayBindingLive = Layer.effect(
106
106
  AiGatewayBinding,
107
107
  Effect.gen(function* () {
108
108
  const Policy = yield* AiGatewayBindingPolicy;
109
+ const env = yield* WorkerEnvironment;
109
110
 
110
111
  return Effect.fn(function* (gateway: AiGatewayResource) {
111
112
  yield* Policy(gateway);
112
- // Capture the gatewayId accessor (which requires WorkerEnvironment) but
113
- // don't resolve it here — that happens lazily at runtime when each
114
- // method is invoked. Resolving eagerly would require WorkerEnvironment
115
- // at deploy time, where it's intentionally not provided.
116
113
  const gatewayIdAccessor = yield* gateway.gatewayId;
117
- const ai = yield* Effect.serviceOption(WorkerEnvironment).pipe(
118
- Effect.map(Option.getOrUndefined),
119
- Effect.map((env) => env?.[gateway.LogicalId]! as Ai),
120
- Effect.cached,
114
+ const ai = Effect.sync(
115
+ () => (env as Record<string, Ai>)[gateway.LogicalId]!,
121
116
  );
122
117
  const runtimeGateway = yield* Effect.zip(ai, gatewayIdAccessor).pipe(
123
118
  Effect.map(([ai, gatewayId]) => ai.gateway(gatewayId)),
@@ -126,7 +121,7 @@ export const AiGatewayBindingLive = Layer.effect(
126
121
 
127
122
  const use = <T>(
128
123
  fn: (gateway: AiGateway) => Promise<T>,
129
- ): Effect.Effect<T, AiGatewayError, WorkerEnvironment> =>
124
+ ): Effect.Effect<T, AiGatewayError> =>
130
125
  runtimeGateway.pipe(
131
126
  Effect.flatMap((gateway) => tryPromise(() => fn(gateway))),
132
127
  );
@@ -3,6 +3,7 @@ import * as Effect from "effect/Effect";
3
3
  import * as Layer from "effect/Layer";
4
4
  import * as Binding from "../../Binding.ts";
5
5
  import type { ResourceLike } from "../../Resource.ts";
6
+ import type { RuntimeContext } from "../../RuntimeContext.ts";
6
7
  import { isWorker, WorkerEnvironment } from "../Workers/Worker.ts";
7
8
  import type { AnalyticsEngineDataset as AnalyticsEngineDatasetLike } from "./AnalyticsEngineDataset.ts";
8
9
 
@@ -24,10 +25,10 @@ export class AnalyticsEngineDatasetError extends Data.TaggedError(
24
25
  }> {}
25
26
 
26
27
  export interface AnalyticsEngineDatasetClient {
27
- raw: Effect.Effect<RuntimeAnalyticsEngineDataset, never, WorkerEnvironment>;
28
+ raw: Effect.Effect<RuntimeAnalyticsEngineDataset, never, RuntimeContext>;
28
29
  writeDataPoint(
29
30
  dataPoint: AnalyticsEngineDataPoint,
30
- ): Effect.Effect<void, AnalyticsEngineDatasetError, WorkerEnvironment>;
31
+ ): Effect.Effect<void, AnalyticsEngineDatasetError, RuntimeContext>;
31
32
  }
32
33
 
33
34
  export class AnalyticsEngineDatasetBinding extends Binding.Service<
@@ -41,17 +42,14 @@ export const AnalyticsEngineDatasetBindingLive = Layer.effect(
41
42
  AnalyticsEngineDatasetBinding,
42
43
  Effect.gen(function* () {
43
44
  const bind = yield* AnalyticsEngineDatasetBindingPolicy;
45
+ const env = yield* WorkerEnvironment;
44
46
 
45
47
  return Effect.fnUntraced(function* (dataset: AnalyticsEngineDatasetLike) {
46
48
  yield* bind(dataset);
47
49
 
48
- const raw = WorkerEnvironment.pipe(
49
- Effect.map(
50
- (env) =>
51
- (env as Record<string, RuntimeAnalyticsEngineDataset>)[
52
- dataset.name
53
- ]!,
54
- ),
50
+ const raw = Effect.sync(
51
+ () =>
52
+ (env as Record<string, RuntimeAnalyticsEngineDataset>)[dataset.name]!,
55
53
  );
56
54
 
57
55
  return {
@@ -3,6 +3,7 @@ import * as Effect from "effect/Effect";
3
3
  import * as Layer from "effect/Layer";
4
4
  import * as Binding from "../../Binding.ts";
5
5
  import type { ResourceLike } from "../../Resource.ts";
6
+ import type { RuntimeContext } from "../../RuntimeContext.ts";
6
7
  import { isWorker, WorkerEnvironment } from "../Workers/Worker.ts";
7
8
  import { type Artifacts as ArtifactsLike } from "./Artifacts.ts";
8
9
 
@@ -66,32 +67,22 @@ export interface ArtifactsRepoClient {
66
67
  */
67
68
  export interface ArtifactsClient {
68
69
  /** Effect resolving to the raw Cloudflare runtime binding. */
69
- raw: Effect.Effect<Artifacts, never, WorkerEnvironment>;
70
+ raw: Effect.Effect<Artifacts, never, RuntimeContext>;
70
71
  create(
71
72
  name: string,
72
73
  opts?: ArtifactsCreateOptions,
73
- ): Effect.Effect<
74
- ArtifactsCreateRepoResult,
75
- ArtifactsError,
76
- WorkerEnvironment
77
- >;
74
+ ): Effect.Effect<ArtifactsCreateRepoResult, ArtifactsError, RuntimeContext>;
78
75
  /** Look up an existing repo by name. Fails with `ArtifactsError` if missing. */
79
76
  get(
80
77
  name: string,
81
- ): Effect.Effect<ArtifactsRepoClient, ArtifactsError, WorkerEnvironment>;
78
+ ): Effect.Effect<ArtifactsRepoClient, ArtifactsError, RuntimeContext>;
82
79
  list(
83
80
  opts?: ArtifactsListOptions,
84
- ): Effect.Effect<ArtifactsRepoListResult, ArtifactsError, WorkerEnvironment>;
85
- delete(
86
- name: string,
87
- ): Effect.Effect<boolean, ArtifactsError, WorkerEnvironment>;
81
+ ): Effect.Effect<ArtifactsRepoListResult, ArtifactsError, RuntimeContext>;
82
+ delete(name: string): Effect.Effect<boolean, ArtifactsError, RuntimeContext>;
88
83
  import(
89
84
  opts: ArtifactsImportOptions,
90
- ): Effect.Effect<
91
- ArtifactsCreateRepoResult,
92
- ArtifactsError,
93
- WorkerEnvironment
94
- >;
85
+ ): Effect.Effect<ArtifactsCreateRepoResult, ArtifactsError, RuntimeContext>;
95
86
  }
96
87
 
97
88
  export class ArtifactsBinding extends Binding.Service<
@@ -103,19 +94,17 @@ export const ArtifactsBindingLive = Layer.effect(
103
94
  ArtifactsBinding,
104
95
  Effect.gen(function* () {
105
96
  const Policy = yield* ArtifactsBindingPolicy;
97
+ const env = yield* WorkerEnvironment;
106
98
 
107
99
  return Effect.fn(function* (artifacts: ArtifactsLike) {
108
100
  yield* Policy(artifacts);
109
- const env = WorkerEnvironment;
110
- const raw = env.pipe(
111
- Effect.map(
112
- (env) => (env as Record<string, Artifacts>)[artifacts.name]!,
113
- ),
101
+ const raw = Effect.sync(
102
+ () => (env as Record<string, Artifacts>)[artifacts.name]!,
114
103
  );
115
104
 
116
105
  const use = <T>(
117
106
  fn: (raw: Artifacts) => Promise<T>,
118
- ): Effect.Effect<T, ArtifactsError, WorkerEnvironment> =>
107
+ ): Effect.Effect<T, ArtifactsError> =>
119
108
  raw.pipe(Effect.flatMap((raw) => tryPromise(() => fn(raw))));
120
109
 
121
110
  return {
@@ -1,8 +1,8 @@
1
1
  import type * as runtime from "@cloudflare/workers-types";
2
2
  import * as Effect from "effect/Effect";
3
3
  import * as Layer from "effect/Layer";
4
- import * as Option from "effect/Option";
5
4
  import * as Binding from "../../Binding.ts";
5
+ import type { RuntimeContext } from "../../RuntimeContext.ts";
6
6
  import { WorkerEnvironment } from "../Workers/Worker.ts";
7
7
  import type { D1Database } from "./D1Database.ts";
8
8
  import { DatabaseBinding } from "./D1DatabaseBinding.ts";
@@ -33,32 +33,44 @@ export class D1PreparedStatement {
33
33
  }
34
34
 
35
35
  /** Run the query and return all matching rows. */
36
- all<T = unknown>(): Effect.Effect<runtime.D1Result<T>> {
36
+ all<T = unknown>(): Effect.Effect<
37
+ runtime.D1Result<T>,
38
+ never,
39
+ RuntimeContext
40
+ > {
37
41
  return this.withRuntime((stmt) => stmt.all<T>());
38
42
  }
39
43
 
40
44
  /** Run the query and return the first row, or `null` if no rows. */
41
- first<T = unknown>(): Effect.Effect<T | null>;
42
- first<T = unknown>(column: string): Effect.Effect<T | null>;
43
- first<T = unknown>(column?: string): Effect.Effect<T | null> {
45
+ first<T = unknown>(): Effect.Effect<T | null, never, RuntimeContext>;
46
+ first<T = unknown>(
47
+ column: string,
48
+ ): Effect.Effect<T | null, never, RuntimeContext>;
49
+ first<T = unknown>(
50
+ column?: string,
51
+ ): Effect.Effect<T | null, never, RuntimeContext> {
44
52
  return this.withRuntime((stmt) =>
45
53
  column !== undefined ? stmt.first<T>(column) : stmt.first<T>(),
46
54
  );
47
55
  }
48
56
 
49
57
  /** Run the query as a mutation; returns row metadata. */
50
- run<T = unknown>(): Effect.Effect<runtime.D1Result<T>> {
58
+ run<T = unknown>(): Effect.Effect<
59
+ runtime.D1Result<T>,
60
+ never,
61
+ RuntimeContext
62
+ > {
51
63
  return this.withRuntime((stmt) => stmt.run<T>());
52
64
  }
53
65
 
54
66
  /** Run the query and return rows as flat arrays. */
55
- raw<T = unknown[]>(): Effect.Effect<T[]>;
67
+ raw<T = unknown[]>(): Effect.Effect<T[], never, RuntimeContext>;
56
68
  raw<T = unknown[]>(options: {
57
69
  columnNames: true;
58
- }): Effect.Effect<[string[], ...T[]]>;
70
+ }): Effect.Effect<[string[], ...T[]], never, RuntimeContext>;
59
71
  raw<T = unknown[]>(options?: {
60
72
  columnNames: true;
61
- }): Effect.Effect<T[] | [string[], ...T[]]> {
73
+ }): Effect.Effect<T[] | [string[], ...T[]], never, RuntimeContext> {
62
74
  return this.withRuntime((stmt) =>
63
75
  options
64
76
  ? stmt.raw<T>(options)
@@ -80,10 +92,10 @@ export class D1PreparedStatement {
80
92
 
81
93
  private withRuntime<A>(
82
94
  fn: (stmt: runtime.D1PreparedStatement) => Promise<A>,
83
- ): Effect.Effect<A> {
95
+ ): Effect.Effect<A, never, RuntimeContext> {
84
96
  return Effect.flatMap(this.rawEff, (raw) =>
85
97
  Effect.promise(() => fn(this._build(raw))),
86
- );
98
+ ) as Effect.Effect<A, never, RuntimeContext>;
87
99
  }
88
100
  }
89
101
 
@@ -92,7 +104,7 @@ export interface D1ConnectionClient {
92
104
  * An Effect that resolves to the raw underlying Cloudflare D1Database binding.
93
105
  * Use this when you need direct access for libraries like Better Auth.
94
106
  */
95
- raw: Effect.Effect<runtime.D1Database>;
107
+ raw: Effect.Effect<runtime.D1Database, never, RuntimeContext>;
96
108
  /**
97
109
  * Prepare a SQL statement. Returns synchronously — the network
98
110
  * round-trip happens when you yield one of the statement's
@@ -102,14 +114,16 @@ export interface D1ConnectionClient {
102
114
  /**
103
115
  * Execute raw SQL without prepared statements.
104
116
  */
105
- exec: (query: string) => Effect.Effect<runtime.D1ExecResult>;
117
+ exec: (
118
+ query: string,
119
+ ) => Effect.Effect<runtime.D1ExecResult, never, RuntimeContext>;
106
120
  /**
107
121
  * Send multiple prepared statements in a single call.
108
122
  * Statements execute sequentially and are rolled back on failure.
109
123
  */
110
124
  batch: <T = unknown>(
111
125
  statements: D1PreparedStatement[],
112
- ) => Effect.Effect<runtime.D1Result<T>[]>;
126
+ ) => Effect.Effect<runtime.D1Result<T>[], never, RuntimeContext>;
113
127
  }
114
128
 
115
129
  export class D1Connection extends Binding.Service<
@@ -121,13 +135,12 @@ export const D1ConnectionLive = Layer.effect(
121
135
  D1Connection,
122
136
  Effect.gen(function* () {
123
137
  const Policy = yield* D1ConnectionPolicy;
138
+ const env = yield* WorkerEnvironment;
124
139
 
125
140
  return Effect.fn(function* (database: D1Database) {
126
141
  yield* Policy(database);
127
- const rawEff = yield* Effect.serviceOption(WorkerEnvironment).pipe(
128
- Effect.map(Option.getOrUndefined),
129
- Effect.map((env) => env?.[database.LogicalId]! as runtime.D1Database),
130
- Effect.cached,
142
+ const rawEff = Effect.sync(
143
+ () => (env as Record<string, runtime.D1Database>)[database.LogicalId]!,
131
144
  );
132
145
 
133
146
  return {
@@ -10,7 +10,7 @@ import type { Providers } from "../Providers.ts";
10
10
  import { cloneD1Database } from "./D1Clone.ts";
11
11
  import { importD1Database } from "./D1Import.ts";
12
12
  import { applyMigrations } from "./D1Migrations.ts";
13
- import { listSqlFiles, readSqlFile } from "./D1SqlFile.ts";
13
+ import { listSqlFiles, readSqlFile } from "../../Sql/SqlFile.ts";
14
14
 
15
15
  export type Jurisdiction = "default" | "eu" | "fedramp";
16
16
  export type PrimaryLocationHint =
@@ -2,13 +2,13 @@ import * as d1 from "@distilled.cloud/cloudflare/d1";
2
2
  import * as Effect from "effect/Effect";
3
3
  import type * as HttpClient from "effect/unstable/http/HttpClient";
4
4
  import type { Credentials } from "@distilled.cloud/cloudflare/Credentials";
5
- import type { D1SqlFile } from "./D1SqlFile.ts";
5
+ import type { SqlFile } from "../../Sql/SqlFile.ts";
6
6
 
7
7
  export interface ApplyMigrationsOptions {
8
8
  accountId: string;
9
9
  databaseId: string;
10
10
  migrationsTable: string;
11
- migrationsFiles: ReadonlyArray<D1SqlFile>;
11
+ migrationsFiles: ReadonlyArray<SqlFile>;
12
12
  }
13
13
 
14
14
  interface TableColumn {
@@ -4,6 +4,7 @@ import * as Effect from "effect/Effect";
4
4
  import * as Layer from "effect/Layer";
5
5
  import * as Binding from "../../Binding.ts";
6
6
  import type { ResourceLike } from "../../Resource.ts";
7
+ import type { RuntimeContext } from "../../RuntimeContext.ts";
7
8
  import { isWorker, WorkerEnvironment } from "../Workers/Worker.ts";
8
9
  import type { SendEmail } from "./SendEmail.ts";
9
10
 
@@ -35,20 +36,20 @@ export interface SendEmailClient {
35
36
  * access to the Cloudflare object (e.g. to send a pre-built
36
37
  * `EmailMessage` from `cloudflare:email`).
37
38
  */
38
- raw: Effect.Effect<runtime.SendEmail, never, WorkerEnvironment>;
39
+ raw: Effect.Effect<runtime.SendEmail, never, RuntimeContext>;
39
40
  /**
40
41
  * Send an email using the builder form. Equivalent to calling
41
42
  * `env.<name>.send({ from, to, subject, text, html, ... })`.
42
43
  */
43
44
  send(
44
45
  message: SendEmailMessage,
45
- ): Effect.Effect<runtime.EmailSendResult, SendEmailError, WorkerEnvironment>;
46
+ ): Effect.Effect<runtime.EmailSendResult, SendEmailError, RuntimeContext>;
46
47
  /**
47
48
  * Send a raw `EmailMessage` (constructed via `cloudflare:email`).
48
49
  */
49
50
  sendRaw(
50
51
  message: runtime.EmailMessage,
51
- ): Effect.Effect<runtime.EmailSendResult, SendEmailError, WorkerEnvironment>;
52
+ ): Effect.Effect<runtime.EmailSendResult, SendEmailError, RuntimeContext>;
52
53
  }
53
54
 
54
55
  /**
@@ -65,12 +66,13 @@ export const SendEmailBindingLive = Layer.effect(
65
66
  SendEmailBinding,
66
67
  Effect.gen(function* () {
67
68
  const bind = yield* SendEmailBindingPolicy;
69
+ const env = yield* WorkerEnvironment;
68
70
 
69
71
  return Effect.fnUntraced(function* (sender: SendEmail) {
70
72
  yield* bind(sender);
71
73
 
72
- const raw = WorkerEnvironment.useSync(
73
- (env) => (env as Record<string, runtime.SendEmail>)[sender.name]!,
74
+ const raw = Effect.sync(
75
+ () => (env as Record<string, runtime.SendEmail>)[sender.name]!,
74
76
  );
75
77
 
76
78
  const tryPromise = <T>(
@@ -1,12 +1,12 @@
1
1
  import type * as runtime from "@cloudflare/workers-types";
2
2
  import * as Effect from "effect/Effect";
3
3
  import * as Layer from "effect/Layer";
4
- import * as Option from "effect/Option";
5
4
  import * as Redacted from "effect/Redacted";
6
5
  import { AlchemyContext } from "../../AlchemyContext.ts";
7
6
  import * as Binding from "../../Binding.ts";
8
7
  import * as Output from "../../Output.ts";
9
8
  import type { ResourceLike } from "../../Resource.ts";
9
+ import type { RuntimeContext } from "../../RuntimeContext.ts";
10
10
  import { isWorker, WorkerEnvironment } from "../Workers/Worker.ts";
11
11
  import type { Hyperdrive } from "./Hyperdrive.ts";
12
12
  import { defaultPort, type HyperdriveDevOrigin } from "./Hyperdrive.ts";
@@ -16,32 +16,36 @@ export interface HyperdriveBindingClient {
16
16
  * The raw runtime `Hyperdrive` binding. Use this when integrating with a
17
17
  * driver that wants direct access to the Cloudflare object.
18
18
  */
19
- raw: Effect.Effect<runtime.Hyperdrive>;
19
+ raw: Effect.Effect<runtime.Hyperdrive, never, RuntimeContext>;
20
20
  /**
21
21
  * A valid DB connection string for use with a driver/ORM.
22
22
  */
23
- connectionString: Effect.Effect<Redacted.Redacted<string>>;
23
+ connectionString: Effect.Effect<
24
+ Redacted.Redacted<string>,
25
+ never,
26
+ RuntimeContext
27
+ >;
24
28
  /**
25
29
  * Hostname valid only within the current Worker invocation.
26
30
  */
27
- host: Effect.Effect<string>;
31
+ host: Effect.Effect<string, never, RuntimeContext>;
28
32
  /**
29
33
  * Port to pair with `host`.
30
34
  */
31
- port: Effect.Effect<number>;
35
+ port: Effect.Effect<number, never, RuntimeContext>;
32
36
  /**
33
37
  * Database user.
34
38
  */
35
- user: Effect.Effect<string>;
39
+ user: Effect.Effect<string, never, RuntimeContext>;
36
40
  /**
37
41
  * Randomly generated password valid only within the current Worker
38
42
  * invocation.
39
43
  */
40
- password: Effect.Effect<Redacted.Redacted<string>>;
44
+ password: Effect.Effect<Redacted.Redacted<string>, never, RuntimeContext>;
41
45
  /**
42
46
  * Database name.
43
47
  */
44
- database: Effect.Effect<string>;
48
+ database: Effect.Effect<string, never, RuntimeContext>;
45
49
  }
46
50
 
47
51
  /**
@@ -67,13 +71,13 @@ export const HyperdriveBindingLive = Layer.effect(
67
71
  HyperdriveBinding,
68
72
  Effect.gen(function* () {
69
73
  const Policy = yield* HyperdriveBindingPolicy;
74
+ const env = yield* WorkerEnvironment;
70
75
 
71
76
  return Effect.fn(function* (hyperdrive: Hyperdrive) {
72
77
  yield* Policy(hyperdrive);
73
- const hd = yield* Effect.serviceOption(WorkerEnvironment).pipe(
74
- Effect.map(Option.getOrUndefined),
75
- Effect.map((env) => env?.[hyperdrive.LogicalId]! as runtime.Hyperdrive),
76
- Effect.cached,
78
+ const hd = Effect.sync(
79
+ () =>
80
+ (env as Record<string, runtime.Hyperdrive>)[hyperdrive.LogicalId]!,
77
81
  );
78
82
 
79
83
  return {
@@ -5,6 +5,7 @@ import * as Layer from "effect/Layer";
5
5
  import * as Stream from "effect/Stream";
6
6
  import * as Binding from "../../Binding.ts";
7
7
  import type { ResourceLike } from "../../Resource.ts";
8
+ import type { RuntimeContext } from "../../RuntimeContext.ts";
8
9
  import { isWorker, WorkerEnvironment } from "../Workers/Worker.ts";
9
10
  import { type Images as ImagesLike } from "./Images.ts";
10
11
 
@@ -55,7 +56,7 @@ export interface ImageTransformerClient {
55
56
  */
56
57
  export interface ImagesClient {
57
58
  /** Effect resolving to the raw Cloudflare runtime binding. */
58
- raw: Effect.Effect<cf.ImagesBinding, never, WorkerEnvironment>;
59
+ raw: Effect.Effect<cf.ImagesBinding, never, RuntimeContext>;
59
60
  /**
60
61
  * Read image format and dimensions from a stream of bytes.
61
62
  * Fails with {@link ImagesError} (code 9412) if the input is not
@@ -64,7 +65,7 @@ export interface ImagesClient {
64
65
  info<E = never, R = never>(
65
66
  stream: Stream.Stream<Uint8Array, E, R>,
66
67
  options?: cf.ImageInputOptions,
67
- ): Effect.Effect<cf.ImageInfoResponse, ImagesError, WorkerEnvironment | R>;
68
+ ): Effect.Effect<cf.ImageInfoResponse, ImagesError, RuntimeContext | R>;
68
69
  /**
69
70
  * Begin a transformation pipeline. Subsequent `.transform()` /
70
71
  * `.draw()` calls are pure; `.output(opts)` runs the pipeline.
@@ -72,7 +73,7 @@ export interface ImagesClient {
72
73
  input<E = never, R = never>(
73
74
  stream: Stream.Stream<Uint8Array, E, R>,
74
75
  options?: cf.ImageInputOptions,
75
- ): Effect.Effect<ImageTransformerClient, never, WorkerEnvironment | R>;
76
+ ): Effect.Effect<ImageTransformerClient, never, RuntimeContext | R>;
76
77
  }
77
78
 
78
79
  export class ImagesBinding extends Binding.Service<
@@ -84,14 +85,13 @@ export const ImagesBindingLive = Layer.effect(
84
85
  ImagesBinding,
85
86
  Effect.gen(function* () {
86
87
  const Policy = yield* ImagesBindingPolicy;
88
+ const env = yield* WorkerEnvironment;
87
89
 
88
90
  return Effect.fn(function* (images: ImagesLike) {
89
91
  yield* Policy(images);
90
- const env = WorkerEnvironment;
91
- const raw = env.pipe(
92
- Effect.map(
93
- (env) => (env as Record<string, cf.ImagesBinding>)[images.name]!,
94
- ),
92
+ const raw = Effect.sync(
93
+ // this must be lazy because the WorkerEnvironment is not available yet
94
+ () => (env as Record<string, cf.ImagesBinding>)[images.name]!,
95
95
  );
96
96
 
97
97
  return {