alchemy 2.0.0-beta.42 → 2.0.0-beta.44

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 (712) hide show
  1. package/bin/cli.js +18 -5
  2. package/bin/exec.js +317 -242
  3. package/bin/exec.js.map +1 -1
  4. package/lib/AWS/CloudWatch/DescribeAlarmContributors.d.ts +1 -1
  5. package/lib/AWS/CloudWatch/DescribeAlarmContributors.d.ts.map +1 -1
  6. package/lib/AWS/CloudWatch/DescribeAlarmHistory.d.ts +1 -1
  7. package/lib/AWS/CloudWatch/DescribeAlarmHistory.d.ts.map +1 -1
  8. package/lib/AWS/CloudWatch/DescribeAlarms.d.ts +1 -1
  9. package/lib/AWS/CloudWatch/DescribeAlarms.d.ts.map +1 -1
  10. package/lib/AWS/CloudWatch/DescribeAlarmsForMetric.d.ts +1 -1
  11. package/lib/AWS/CloudWatch/DescribeAlarmsForMetric.d.ts.map +1 -1
  12. package/lib/AWS/CloudWatch/DescribeAnomalyDetectors.d.ts +1 -1
  13. package/lib/AWS/CloudWatch/DescribeAnomalyDetectors.d.ts.map +1 -1
  14. package/lib/AWS/CloudWatch/DescribeInsightRules.d.ts +1 -1
  15. package/lib/AWS/CloudWatch/DescribeInsightRules.d.ts.map +1 -1
  16. package/lib/AWS/CloudWatch/DisableAlarmActions.d.ts +1 -1
  17. package/lib/AWS/CloudWatch/DisableAlarmActions.d.ts.map +1 -1
  18. package/lib/AWS/CloudWatch/DisableInsightRules.d.ts +1 -1
  19. package/lib/AWS/CloudWatch/DisableInsightRules.d.ts.map +1 -1
  20. package/lib/AWS/CloudWatch/EnableAlarmActions.d.ts +1 -1
  21. package/lib/AWS/CloudWatch/EnableAlarmActions.d.ts.map +1 -1
  22. package/lib/AWS/CloudWatch/GetAlarmMuteRule.d.ts +1 -1
  23. package/lib/AWS/CloudWatch/GetAlarmMuteRule.d.ts.map +1 -1
  24. package/lib/AWS/CloudWatch/GetDashboard.d.ts +1 -1
  25. package/lib/AWS/CloudWatch/GetDashboard.d.ts.map +1 -1
  26. package/lib/AWS/CloudWatch/GetInsightRuleReport.d.ts +1 -1
  27. package/lib/AWS/CloudWatch/GetInsightRuleReport.d.ts.map +1 -1
  28. package/lib/AWS/CloudWatch/GetMetricData.d.ts +1 -1
  29. package/lib/AWS/CloudWatch/GetMetricData.d.ts.map +1 -1
  30. package/lib/AWS/CloudWatch/GetMetricStatistics.d.ts +1 -1
  31. package/lib/AWS/CloudWatch/GetMetricStatistics.d.ts.map +1 -1
  32. package/lib/AWS/CloudWatch/GetMetricStream.d.ts +1 -1
  33. package/lib/AWS/CloudWatch/GetMetricStream.d.ts.map +1 -1
  34. package/lib/AWS/CloudWatch/GetMetricWidgetImage.d.ts +1 -1
  35. package/lib/AWS/CloudWatch/GetMetricWidgetImage.d.ts.map +1 -1
  36. package/lib/AWS/CloudWatch/ListAlarmMuteRules.d.ts +1 -1
  37. package/lib/AWS/CloudWatch/ListAlarmMuteRules.d.ts.map +1 -1
  38. package/lib/AWS/CloudWatch/ListDashboards.d.ts +1 -1
  39. package/lib/AWS/CloudWatch/ListDashboards.d.ts.map +1 -1
  40. package/lib/AWS/CloudWatch/ListManagedInsightRules.d.ts +1 -1
  41. package/lib/AWS/CloudWatch/ListManagedInsightRules.d.ts.map +1 -1
  42. package/lib/AWS/CloudWatch/ListMetricStreams.d.ts +1 -1
  43. package/lib/AWS/CloudWatch/ListMetricStreams.d.ts.map +1 -1
  44. package/lib/AWS/CloudWatch/ListMetrics.d.ts +1 -1
  45. package/lib/AWS/CloudWatch/ListMetrics.d.ts.map +1 -1
  46. package/lib/AWS/CloudWatch/ListTagsForResource.d.ts +1 -1
  47. package/lib/AWS/CloudWatch/ListTagsForResource.d.ts.map +1 -1
  48. package/lib/AWS/CloudWatch/PutMetricData.d.ts +1 -1
  49. package/lib/AWS/CloudWatch/PutMetricData.d.ts.map +1 -1
  50. package/lib/AWS/CloudWatch/SetAlarmState.d.ts +1 -1
  51. package/lib/AWS/CloudWatch/SetAlarmState.d.ts.map +1 -1
  52. package/lib/AWS/DynamoDB/BatchExecuteStatement.d.ts +1 -1
  53. package/lib/AWS/DynamoDB/BatchExecuteStatement.d.ts.map +1 -1
  54. package/lib/AWS/DynamoDB/BatchGetItem.d.ts +1 -1
  55. package/lib/AWS/DynamoDB/BatchGetItem.d.ts.map +1 -1
  56. package/lib/AWS/DynamoDB/BatchWriteItem.d.ts +1 -1
  57. package/lib/AWS/DynamoDB/BatchWriteItem.d.ts.map +1 -1
  58. package/lib/AWS/DynamoDB/DeleteItem.d.ts +1 -1
  59. package/lib/AWS/DynamoDB/DeleteItem.d.ts.map +1 -1
  60. package/lib/AWS/DynamoDB/DescribeTable.d.ts +1 -1
  61. package/lib/AWS/DynamoDB/DescribeTable.d.ts.map +1 -1
  62. package/lib/AWS/DynamoDB/DescribeTimeToLive.d.ts +1 -1
  63. package/lib/AWS/DynamoDB/DescribeTimeToLive.d.ts.map +1 -1
  64. package/lib/AWS/DynamoDB/ExecuteStatement.d.ts +1 -1
  65. package/lib/AWS/DynamoDB/ExecuteStatement.d.ts.map +1 -1
  66. package/lib/AWS/DynamoDB/ExecuteTransaction.d.ts +1 -1
  67. package/lib/AWS/DynamoDB/ExecuteTransaction.d.ts.map +1 -1
  68. package/lib/AWS/DynamoDB/GetItem.d.ts +1 -1
  69. package/lib/AWS/DynamoDB/GetItem.d.ts.map +1 -1
  70. package/lib/AWS/DynamoDB/ListTables.d.ts +1 -1
  71. package/lib/AWS/DynamoDB/ListTables.d.ts.map +1 -1
  72. package/lib/AWS/DynamoDB/ListTagsOfResource.d.ts +1 -1
  73. package/lib/AWS/DynamoDB/ListTagsOfResource.d.ts.map +1 -1
  74. package/lib/AWS/DynamoDB/PutItem.d.ts +1 -1
  75. package/lib/AWS/DynamoDB/PutItem.d.ts.map +1 -1
  76. package/lib/AWS/DynamoDB/Query.d.ts +1 -1
  77. package/lib/AWS/DynamoDB/Query.d.ts.map +1 -1
  78. package/lib/AWS/DynamoDB/RestoreTableToPointInTime.d.ts +1 -1
  79. package/lib/AWS/DynamoDB/RestoreTableToPointInTime.d.ts.map +1 -1
  80. package/lib/AWS/DynamoDB/Scan.d.ts +1 -1
  81. package/lib/AWS/DynamoDB/Scan.d.ts.map +1 -1
  82. package/lib/AWS/DynamoDB/TransactGetItems.d.ts +1 -1
  83. package/lib/AWS/DynamoDB/TransactGetItems.d.ts.map +1 -1
  84. package/lib/AWS/DynamoDB/TransactWriteItems.d.ts +1 -1
  85. package/lib/AWS/DynamoDB/TransactWriteItems.d.ts.map +1 -1
  86. package/lib/AWS/DynamoDB/UpdateItem.d.ts +1 -1
  87. package/lib/AWS/DynamoDB/UpdateItem.d.ts.map +1 -1
  88. package/lib/AWS/DynamoDB/UpdateTimeToLive.d.ts +1 -1
  89. package/lib/AWS/DynamoDB/UpdateTimeToLive.d.ts.map +1 -1
  90. package/lib/AWS/ECS/DescribeTasks.d.ts +1 -1
  91. package/lib/AWS/ECS/DescribeTasks.d.ts.map +1 -1
  92. package/lib/AWS/ECS/ListTasks.d.ts +1 -1
  93. package/lib/AWS/ECS/ListTasks.d.ts.map +1 -1
  94. package/lib/AWS/ECS/RunTask.d.ts +1 -1
  95. package/lib/AWS/ECS/RunTask.d.ts.map +1 -1
  96. package/lib/AWS/ECS/StopTask.d.ts +1 -1
  97. package/lib/AWS/ECS/StopTask.d.ts.map +1 -1
  98. package/lib/AWS/EventBridge/DescribeEventBus.d.ts +1 -1
  99. package/lib/AWS/EventBridge/DescribeEventBus.d.ts.map +1 -1
  100. package/lib/AWS/EventBridge/DescribeRule.d.ts +1 -1
  101. package/lib/AWS/EventBridge/DescribeRule.d.ts.map +1 -1
  102. package/lib/AWS/EventBridge/EventSource.d.ts +2 -2
  103. package/lib/AWS/EventBridge/ListEventBuses.d.ts +1 -1
  104. package/lib/AWS/EventBridge/ListEventBuses.d.ts.map +1 -1
  105. package/lib/AWS/EventBridge/ListRules.d.ts +1 -1
  106. package/lib/AWS/EventBridge/ListRules.d.ts.map +1 -1
  107. package/lib/AWS/EventBridge/ListTargetsByRule.d.ts +1 -1
  108. package/lib/AWS/EventBridge/ListTargetsByRule.d.ts.map +1 -1
  109. package/lib/AWS/EventBridge/PutEvents.d.ts +1 -1
  110. package/lib/AWS/EventBridge/PutEvents.d.ts.map +1 -1
  111. package/lib/AWS/EventBridge/TestEventPattern.d.ts +1 -1
  112. package/lib/AWS/EventBridge/TestEventPattern.d.ts.map +1 -1
  113. package/lib/AWS/EventBridge/ToLambda.d.ts +1 -1
  114. package/lib/AWS/EventBridge/ToLambda.d.ts.map +1 -1
  115. package/lib/AWS/EventBridge/ToQueue.d.ts +1 -1
  116. package/lib/AWS/EventBridge/ToQueue.d.ts.map +1 -1
  117. package/lib/AWS/Kinesis/DescribeAccountSettings.d.ts +1 -1
  118. package/lib/AWS/Kinesis/DescribeAccountSettings.d.ts.map +1 -1
  119. package/lib/AWS/Kinesis/DescribeLimits.d.ts +1 -1
  120. package/lib/AWS/Kinesis/DescribeLimits.d.ts.map +1 -1
  121. package/lib/AWS/Kinesis/DescribeStream.d.ts +1 -1
  122. package/lib/AWS/Kinesis/DescribeStream.d.ts.map +1 -1
  123. package/lib/AWS/Kinesis/DescribeStreamConsumer.d.ts +1 -1
  124. package/lib/AWS/Kinesis/DescribeStreamConsumer.d.ts.map +1 -1
  125. package/lib/AWS/Kinesis/DescribeStreamSummary.d.ts +1 -1
  126. package/lib/AWS/Kinesis/DescribeStreamSummary.d.ts.map +1 -1
  127. package/lib/AWS/Kinesis/GetRecords.d.ts +1 -1
  128. package/lib/AWS/Kinesis/GetRecords.d.ts.map +1 -1
  129. package/lib/AWS/Kinesis/GetResourcePolicy.d.ts +1 -1
  130. package/lib/AWS/Kinesis/GetResourcePolicy.d.ts.map +1 -1
  131. package/lib/AWS/Kinesis/GetShardIterator.d.ts +1 -1
  132. package/lib/AWS/Kinesis/GetShardIterator.d.ts.map +1 -1
  133. package/lib/AWS/Kinesis/ListShards.d.ts +1 -1
  134. package/lib/AWS/Kinesis/ListShards.d.ts.map +1 -1
  135. package/lib/AWS/Kinesis/ListStreamConsumers.d.ts +1 -1
  136. package/lib/AWS/Kinesis/ListStreamConsumers.d.ts.map +1 -1
  137. package/lib/AWS/Kinesis/ListStreams.d.ts +1 -1
  138. package/lib/AWS/Kinesis/ListStreams.d.ts.map +1 -1
  139. package/lib/AWS/Kinesis/ListTagsForResource.d.ts +1 -1
  140. package/lib/AWS/Kinesis/ListTagsForResource.d.ts.map +1 -1
  141. package/lib/AWS/Kinesis/PutRecord.d.ts +1 -1
  142. package/lib/AWS/Kinesis/PutRecord.d.ts.map +1 -1
  143. package/lib/AWS/Kinesis/PutRecords.d.ts +1 -1
  144. package/lib/AWS/Kinesis/PutRecords.d.ts.map +1 -1
  145. package/lib/AWS/Kinesis/StreamSink.d.ts +1 -1
  146. package/lib/AWS/Kinesis/StreamSink.d.ts.map +1 -1
  147. package/lib/AWS/Kinesis/SubscribeToShard.d.ts +1 -1
  148. package/lib/AWS/Kinesis/SubscribeToShard.d.ts.map +1 -1
  149. package/lib/AWS/Lambda/BucketEventSource.d.ts +2 -1
  150. package/lib/AWS/Lambda/BucketEventSource.d.ts.map +1 -1
  151. package/lib/AWS/Lambda/EventBridgeEventSource.d.ts +2 -1
  152. package/lib/AWS/Lambda/EventBridgeEventSource.d.ts.map +1 -1
  153. package/lib/AWS/Lambda/InvokeFunction.d.ts +1 -1
  154. package/lib/AWS/Lambda/InvokeFunction.d.ts.map +1 -1
  155. package/lib/AWS/Lambda/QueueEventSource.d.ts +2 -1
  156. package/lib/AWS/Lambda/QueueEventSource.d.ts.map +1 -1
  157. package/lib/AWS/Lambda/StreamEventSource.d.ts +2 -1
  158. package/lib/AWS/Lambda/StreamEventSource.d.ts.map +1 -1
  159. package/lib/AWS/Lambda/TableEventSource.d.ts +2 -1
  160. package/lib/AWS/Lambda/TableEventSource.d.ts.map +1 -1
  161. package/lib/AWS/Lambda/TopicEventSource.d.ts +2 -1
  162. package/lib/AWS/Lambda/TopicEventSource.d.ts.map +1 -1
  163. package/lib/AWS/RDS/Connect.d.ts +1 -1
  164. package/lib/AWS/RDS/Connect.d.ts.map +1 -1
  165. package/lib/AWS/RDSData/BatchExecuteStatement.d.ts +1 -1
  166. package/lib/AWS/RDSData/BatchExecuteStatement.d.ts.map +1 -1
  167. package/lib/AWS/RDSData/BeginTransaction.d.ts +1 -1
  168. package/lib/AWS/RDSData/BeginTransaction.d.ts.map +1 -1
  169. package/lib/AWS/RDSData/CommitTransaction.d.ts +1 -1
  170. package/lib/AWS/RDSData/CommitTransaction.d.ts.map +1 -1
  171. package/lib/AWS/RDSData/ExecuteSql.d.ts +1 -1
  172. package/lib/AWS/RDSData/ExecuteSql.d.ts.map +1 -1
  173. package/lib/AWS/RDSData/ExecuteStatement.d.ts +1 -1
  174. package/lib/AWS/RDSData/ExecuteStatement.d.ts.map +1 -1
  175. package/lib/AWS/RDSData/RollbackTransaction.d.ts +1 -1
  176. package/lib/AWS/RDSData/RollbackTransaction.d.ts.map +1 -1
  177. package/lib/AWS/S3/AbortMultipartUpload.d.ts +1 -1
  178. package/lib/AWS/S3/AbortMultipartUpload.d.ts.map +1 -1
  179. package/lib/AWS/S3/CompleteMultipartUpload.d.ts +1 -1
  180. package/lib/AWS/S3/CompleteMultipartUpload.d.ts.map +1 -1
  181. package/lib/AWS/S3/CopyObject.d.ts +1 -1
  182. package/lib/AWS/S3/CopyObject.d.ts.map +1 -1
  183. package/lib/AWS/S3/CreateMultipartUpload.d.ts +1 -1
  184. package/lib/AWS/S3/CreateMultipartUpload.d.ts.map +1 -1
  185. package/lib/AWS/S3/DeleteObject.d.ts +1 -1
  186. package/lib/AWS/S3/DeleteObject.d.ts.map +1 -1
  187. package/lib/AWS/S3/GetObject.d.ts +1 -1
  188. package/lib/AWS/S3/GetObject.d.ts.map +1 -1
  189. package/lib/AWS/S3/HeadObject.d.ts +1 -1
  190. package/lib/AWS/S3/HeadObject.d.ts.map +1 -1
  191. package/lib/AWS/S3/ListObjectsV2.d.ts +1 -1
  192. package/lib/AWS/S3/ListObjectsV2.d.ts.map +1 -1
  193. package/lib/AWS/S3/PutObject.d.ts +1 -1
  194. package/lib/AWS/S3/PutObject.d.ts.map +1 -1
  195. package/lib/AWS/S3/UploadPart.d.ts +1 -1
  196. package/lib/AWS/S3/UploadPart.d.ts.map +1 -1
  197. package/lib/AWS/SNS/AddPermission.d.ts +1 -1
  198. package/lib/AWS/SNS/AddPermission.d.ts.map +1 -1
  199. package/lib/AWS/SNS/ConfirmSubscription.d.ts +1 -1
  200. package/lib/AWS/SNS/ConfirmSubscription.d.ts.map +1 -1
  201. package/lib/AWS/SNS/GetDataProtectionPolicy.d.ts +1 -1
  202. package/lib/AWS/SNS/GetDataProtectionPolicy.d.ts.map +1 -1
  203. package/lib/AWS/SNS/GetSubscriptionAttributes.d.ts +1 -1
  204. package/lib/AWS/SNS/GetSubscriptionAttributes.d.ts.map +1 -1
  205. package/lib/AWS/SNS/GetTopicAttributes.d.ts +1 -1
  206. package/lib/AWS/SNS/GetTopicAttributes.d.ts.map +1 -1
  207. package/lib/AWS/SNS/ListSubscriptions.d.ts +1 -1
  208. package/lib/AWS/SNS/ListSubscriptions.d.ts.map +1 -1
  209. package/lib/AWS/SNS/ListSubscriptionsByTopic.d.ts +1 -1
  210. package/lib/AWS/SNS/ListSubscriptionsByTopic.d.ts.map +1 -1
  211. package/lib/AWS/SNS/ListTagsForResource.d.ts +1 -1
  212. package/lib/AWS/SNS/ListTagsForResource.d.ts.map +1 -1
  213. package/lib/AWS/SNS/ListTopics.d.ts +1 -1
  214. package/lib/AWS/SNS/ListTopics.d.ts.map +1 -1
  215. package/lib/AWS/SNS/Publish.d.ts +1 -1
  216. package/lib/AWS/SNS/Publish.d.ts.map +1 -1
  217. package/lib/AWS/SNS/PublishBatch.d.ts +1 -1
  218. package/lib/AWS/SNS/PublishBatch.d.ts.map +1 -1
  219. package/lib/AWS/SNS/PutDataProtectionPolicy.d.ts +1 -1
  220. package/lib/AWS/SNS/PutDataProtectionPolicy.d.ts.map +1 -1
  221. package/lib/AWS/SNS/RemovePermission.d.ts +1 -1
  222. package/lib/AWS/SNS/RemovePermission.d.ts.map +1 -1
  223. package/lib/AWS/SNS/SetSubscriptionAttributes.d.ts +1 -1
  224. package/lib/AWS/SNS/SetSubscriptionAttributes.d.ts.map +1 -1
  225. package/lib/AWS/SNS/SetTopicAttributes.d.ts +1 -1
  226. package/lib/AWS/SNS/SetTopicAttributes.d.ts.map +1 -1
  227. package/lib/AWS/SNS/TagResource.d.ts +1 -1
  228. package/lib/AWS/SNS/TagResource.d.ts.map +1 -1
  229. package/lib/AWS/SNS/TopicSink.d.ts +1 -1
  230. package/lib/AWS/SNS/TopicSink.d.ts.map +1 -1
  231. package/lib/AWS/SNS/UntagResource.d.ts +1 -1
  232. package/lib/AWS/SNS/UntagResource.d.ts.map +1 -1
  233. package/lib/AWS/SQS/DeleteMessage.d.ts +1 -1
  234. package/lib/AWS/SQS/DeleteMessage.d.ts.map +1 -1
  235. package/lib/AWS/SQS/DeleteMessageBatch.d.ts +1 -1
  236. package/lib/AWS/SQS/DeleteMessageBatch.d.ts.map +1 -1
  237. package/lib/AWS/SQS/QueueSink.d.ts +1 -1
  238. package/lib/AWS/SQS/QueueSink.d.ts.map +1 -1
  239. package/lib/AWS/SQS/ReceiveMessage.d.ts +1 -1
  240. package/lib/AWS/SQS/ReceiveMessage.d.ts.map +1 -1
  241. package/lib/AWS/SQS/SendMessage.d.ts +1 -1
  242. package/lib/AWS/SQS/SendMessage.d.ts.map +1 -1
  243. package/lib/AWS/SQS/SendMessageBatch.d.ts +1 -1
  244. package/lib/AWS/SQS/SendMessageBatch.d.ts.map +1 -1
  245. package/lib/AWS/SecretsManager/DescribeSecret.d.ts +1 -1
  246. package/lib/AWS/SecretsManager/DescribeSecret.d.ts.map +1 -1
  247. package/lib/AWS/SecretsManager/GetRandomPassword.d.ts +1 -1
  248. package/lib/AWS/SecretsManager/GetRandomPassword.d.ts.map +1 -1
  249. package/lib/AWS/SecretsManager/GetSecretValue.d.ts +1 -1
  250. package/lib/AWS/SecretsManager/GetSecretValue.d.ts.map +1 -1
  251. package/lib/AWS/SecretsManager/ListSecrets.d.ts +1 -1
  252. package/lib/AWS/SecretsManager/ListSecrets.d.ts.map +1 -1
  253. package/lib/AWS/SecretsManager/PutSecretValue.d.ts +1 -1
  254. package/lib/AWS/SecretsManager/PutSecretValue.d.ts.map +1 -1
  255. package/lib/Auth/Lock.js +2 -2
  256. package/lib/Auth/Lock.js.map +1 -1
  257. package/lib/Binding.d.ts +1 -1
  258. package/lib/Binding.d.ts.map +1 -1
  259. package/lib/Bundle/Bundle.d.ts +11 -0
  260. package/lib/Bundle/Bundle.d.ts.map +1 -1
  261. package/lib/Bundle/Bundle.js +19 -12
  262. package/lib/Bundle/Bundle.js.map +1 -1
  263. package/lib/Bundle/BundleAnalyzerPlugin.d.ts +25 -0
  264. package/lib/Bundle/BundleAnalyzerPlugin.d.ts.map +1 -0
  265. package/lib/Bundle/BundleAnalyzerPlugin.js +16 -0
  266. package/lib/Bundle/BundleAnalyzerPlugin.js.map +1 -0
  267. package/lib/Bundle/Docker.d.ts.map +1 -1
  268. package/lib/Bundle/Docker.js +12 -13
  269. package/lib/Bundle/Docker.js.map +1 -1
  270. package/lib/Bundle/RawPlugin.d.ts +36 -0
  271. package/lib/Bundle/RawPlugin.d.ts.map +1 -0
  272. package/lib/Bundle/RawPlugin.js +80 -0
  273. package/lib/Bundle/RawPlugin.js.map +1 -0
  274. package/lib/Bundle/index.d.ts +2 -0
  275. package/lib/Bundle/index.d.ts.map +1 -1
  276. package/lib/Bundle/index.js +2 -0
  277. package/lib/Bundle/index.js.map +1 -1
  278. package/lib/Cli/commands/deploy.d.ts.map +1 -1
  279. package/lib/Cli/commands/deploy.js +1 -0
  280. package/lib/Cli/commands/deploy.js.map +1 -1
  281. package/lib/Cli/commands/dev.d.ts +3 -2
  282. package/lib/Cli/commands/dev.d.ts.map +1 -1
  283. package/lib/Cli/commands/dev.js +9 -1
  284. package/lib/Cli/commands/dev.js.map +1 -1
  285. package/lib/Cli/exec.d.ts.map +1 -1
  286. package/lib/Cli/exec.js +2 -1
  287. package/lib/Cli/exec.js.map +1 -1
  288. package/lib/Cloudflare/AiGateway/AiGatewayBinding.d.ts +8 -7
  289. package/lib/Cloudflare/AiGateway/AiGatewayBinding.d.ts.map +1 -1
  290. package/lib/Cloudflare/AiGateway/AiGatewayBinding.js +2 -6
  291. package/lib/Cloudflare/AiGateway/AiGatewayBinding.js.map +1 -1
  292. package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.d.ts +4 -3
  293. package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.d.ts.map +1 -1
  294. package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.js +2 -1
  295. package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.js.map +1 -1
  296. package/lib/Cloudflare/Artifacts/ArtifactsBinding.d.ts +8 -7
  297. package/lib/Cloudflare/Artifacts/ArtifactsBinding.d.ts.map +1 -1
  298. package/lib/Cloudflare/Artifacts/ArtifactsBinding.js +2 -2
  299. package/lib/Cloudflare/Artifacts/ArtifactsBinding.js.map +1 -1
  300. package/lib/Cloudflare/D1/D1Connection.d.ts +12 -10
  301. package/lib/Cloudflare/D1/D1Connection.d.ts.map +1 -1
  302. package/lib/Cloudflare/D1/D1Connection.js +2 -2
  303. package/lib/Cloudflare/D1/D1Connection.js.map +1 -1
  304. package/lib/Cloudflare/D1/D1Database.js +1 -1
  305. package/lib/Cloudflare/D1/D1Database.js.map +1 -1
  306. package/lib/Cloudflare/D1/D1Migrations.d.ts +2 -2
  307. package/lib/Cloudflare/D1/D1Migrations.d.ts.map +1 -1
  308. package/lib/Cloudflare/Email/SendEmailBinding.d.ts +5 -4
  309. package/lib/Cloudflare/Email/SendEmailBinding.d.ts.map +1 -1
  310. package/lib/Cloudflare/Email/SendEmailBinding.js +2 -1
  311. package/lib/Cloudflare/Email/SendEmailBinding.js.map +1 -1
  312. package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.d.ts +10 -8
  313. package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.d.ts.map +1 -1
  314. package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.js +2 -2
  315. package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.js.map +1 -1
  316. package/lib/Cloudflare/Images/ImagesBinding.d.ts +5 -4
  317. package/lib/Cloudflare/Images/ImagesBinding.d.ts.map +1 -1
  318. package/lib/Cloudflare/Images/ImagesBinding.js +4 -2
  319. package/lib/Cloudflare/Images/ImagesBinding.js.map +1 -1
  320. package/lib/Cloudflare/KV/KVNamespaceBinding.d.ts +33 -32
  321. package/lib/Cloudflare/KV/KVNamespaceBinding.d.ts.map +1 -1
  322. package/lib/Cloudflare/KV/KVNamespaceBinding.js +5 -2
  323. package/lib/Cloudflare/KV/KVNamespaceBinding.js.map +1 -1
  324. package/lib/Cloudflare/Local.d.ts +2 -0
  325. package/lib/Cloudflare/Local.d.ts.map +1 -0
  326. package/lib/Cloudflare/Local.js +9 -0
  327. package/lib/Cloudflare/Local.js.map +1 -0
  328. package/lib/Cloudflare/Providers.d.ts.map +1 -1
  329. package/lib/Cloudflare/Providers.js +3 -1
  330. package/lib/Cloudflare/Providers.js.map +1 -1
  331. package/lib/Cloudflare/Queue/QueueBinding.d.ts +5 -4
  332. package/lib/Cloudflare/Queue/QueueBinding.d.ts.map +1 -1
  333. package/lib/Cloudflare/Queue/QueueBinding.js +2 -2
  334. package/lib/Cloudflare/Queue/QueueBinding.js.map +1 -1
  335. package/lib/Cloudflare/Queue/QueueEventSource.d.ts +1 -2
  336. package/lib/Cloudflare/Queue/QueueEventSource.d.ts.map +1 -1
  337. package/lib/Cloudflare/R2/R2BucketBinding.d.ts +13 -12
  338. package/lib/Cloudflare/R2/R2BucketBinding.d.ts.map +1 -1
  339. package/lib/Cloudflare/R2/R2BucketBinding.js +2 -2
  340. package/lib/Cloudflare/R2/R2BucketBinding.js.map +1 -1
  341. package/lib/Cloudflare/SecretsStore/SecretBinding.d.ts +5 -4
  342. package/lib/Cloudflare/SecretsStore/SecretBinding.d.ts.map +1 -1
  343. package/lib/Cloudflare/SecretsStore/SecretBinding.js +2 -2
  344. package/lib/Cloudflare/SecretsStore/SecretBinding.js.map +1 -1
  345. package/lib/Cloudflare/StateStore/Api.d.ts +1 -1
  346. package/lib/Cloudflare/Workers/CronEventSource.d.ts +1 -2
  347. package/lib/Cloudflare/Workers/CronEventSource.d.ts.map +1 -1
  348. package/lib/Cloudflare/Workers/DurableObjectBridge.d.ts.map +1 -1
  349. package/lib/Cloudflare/Workers/DurableObjectBridge.js +0 -1
  350. package/lib/Cloudflare/Workers/DurableObjectBridge.js.map +1 -1
  351. package/lib/Cloudflare/Workers/DurableObjectNamespace.d.ts.map +1 -1
  352. package/lib/Cloudflare/Workers/DurableObjectNamespace.js +6 -3
  353. package/lib/Cloudflare/Workers/DurableObjectNamespace.js.map +1 -1
  354. package/lib/Cloudflare/Workers/DynamicWorkerLoader.d.ts.map +1 -1
  355. package/lib/Cloudflare/Workers/DynamicWorkerLoader.js +3 -3
  356. package/lib/Cloudflare/Workers/DynamicWorkerLoader.js.map +1 -1
  357. package/lib/Cloudflare/Workers/Fetch.d.ts +1 -1
  358. package/lib/Cloudflare/Workers/Fetch.d.ts.map +1 -1
  359. package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts +22 -3
  360. package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
  361. package/lib/Cloudflare/Workers/LocalWorkerProvider.js +413 -21
  362. package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
  363. package/lib/Cloudflare/Workers/RpcAsync.d.ts +55 -0
  364. package/lib/Cloudflare/Workers/RpcAsync.d.ts.map +1 -1
  365. package/lib/Cloudflare/Workers/RpcAsync.js +55 -0
  366. package/lib/Cloudflare/Workers/RpcAsync.js.map +1 -1
  367. package/lib/Cloudflare/Workers/Worker.d.ts +9 -22
  368. package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
  369. package/lib/Cloudflare/Workers/Worker.js +3 -4
  370. package/lib/Cloudflare/Workers/Worker.js.map +1 -1
  371. package/lib/Cloudflare/Workers/WorkerBridge.d.ts.map +1 -1
  372. package/lib/Cloudflare/Workers/WorkerBridge.js +3 -5
  373. package/lib/Cloudflare/Workers/WorkerBridge.js.map +1 -1
  374. package/lib/Cloudflare/Workers/WorkerBundle.d.ts +1 -2
  375. package/lib/Cloudflare/Workers/WorkerBundle.d.ts.map +1 -1
  376. package/lib/Cloudflare/Workers/WorkerBundle.js +3 -6
  377. package/lib/Cloudflare/Workers/WorkerBundle.js.map +1 -1
  378. package/lib/Cloudflare/Workers/WorkerRuntimeContext.d.ts.map +1 -1
  379. package/lib/Cloudflare/Workers/WorkerRuntimeContext.js +2 -0
  380. package/lib/Cloudflare/Workers/WorkerRuntimeContext.js.map +1 -1
  381. package/lib/Cloudflare/Workers/Workflow.d.ts +4 -4
  382. package/lib/Cloudflare/Workers/Workflow.d.ts.map +1 -1
  383. package/lib/Cloudflare/Workers/Workflow.js +6 -3
  384. package/lib/Cloudflare/Workers/Workflow.js.map +1 -1
  385. package/lib/Cloudflare/Zaraz/ZarazConfig.d.ts +184 -0
  386. package/lib/Cloudflare/Zaraz/ZarazConfig.d.ts.map +1 -0
  387. package/lib/Cloudflare/Zaraz/ZarazConfig.js +216 -0
  388. package/lib/Cloudflare/Zaraz/ZarazConfig.js.map +1 -0
  389. package/lib/Cloudflare/Zaraz/ZarazEventTypes.d.ts +188 -0
  390. package/lib/Cloudflare/Zaraz/ZarazEventTypes.d.ts.map +1 -0
  391. package/lib/Cloudflare/Zaraz/ZarazEventTypes.js +4 -0
  392. package/lib/Cloudflare/Zaraz/ZarazEventTypes.js.map +1 -0
  393. package/lib/Cloudflare/Zaraz/index.d.ts +3 -0
  394. package/lib/Cloudflare/Zaraz/index.d.ts.map +1 -0
  395. package/lib/Cloudflare/Zaraz/index.js +2 -0
  396. package/lib/Cloudflare/Zaraz/index.js.map +1 -0
  397. package/lib/Cloudflare/index.d.ts +1 -0
  398. package/lib/Cloudflare/index.d.ts.map +1 -1
  399. package/lib/Cloudflare/index.js +1 -0
  400. package/lib/Cloudflare/index.js.map +1 -1
  401. package/lib/Local/RpcProvider.d.ts +54 -0
  402. package/lib/Local/RpcProvider.d.ts.map +1 -0
  403. package/lib/Local/RpcProvider.js +57 -0
  404. package/lib/Local/RpcProvider.js.map +1 -0
  405. package/lib/Local/RpcProviderProxy.d.ts +19 -0
  406. package/lib/Local/RpcProviderProxy.d.ts.map +1 -0
  407. package/lib/Local/RpcProviderProxy.js +48 -0
  408. package/lib/Local/RpcProviderProxy.js.map +1 -0
  409. package/lib/Local/RpcSerialization.d.ts +34 -0
  410. package/lib/Local/RpcSerialization.d.ts.map +1 -0
  411. package/lib/Local/RpcSerialization.js +120 -0
  412. package/lib/Local/RpcSerialization.js.map +1 -0
  413. package/lib/Local/RpcServer.d.ts +63 -0
  414. package/lib/Local/RpcServer.d.ts.map +1 -0
  415. package/lib/Local/RpcServer.js +72 -0
  416. package/lib/Local/RpcServer.js.map +1 -0
  417. package/lib/Local/RpcServerBun.d.ts +3 -0
  418. package/lib/Local/RpcServerBun.d.ts.map +1 -0
  419. package/lib/Local/RpcServerBun.js +47 -0
  420. package/lib/Local/RpcServerBun.js.map +1 -0
  421. package/lib/Local/RpcServerEnvironment.d.ts +20 -0
  422. package/lib/Local/RpcServerEnvironment.d.ts.map +1 -0
  423. package/lib/Local/RpcServerEnvironment.js +22 -0
  424. package/lib/Local/RpcServerEnvironment.js.map +1 -0
  425. package/lib/Local/RpcServerNode.d.ts +3 -0
  426. package/lib/Local/RpcServerNode.d.ts.map +1 -0
  427. package/lib/Local/RpcServerNode.js +43 -0
  428. package/lib/Local/RpcServerNode.js.map +1 -0
  429. package/lib/Local/RpcServerSession.d.ts +27 -0
  430. package/lib/Local/RpcServerSession.d.ts.map +1 -0
  431. package/lib/Local/RpcServerSession.js +68 -0
  432. package/lib/Local/RpcServerSession.js.map +1 -0
  433. package/lib/Local/RpcSpawner.d.ts +21 -0
  434. package/lib/Local/RpcSpawner.d.ts.map +1 -0
  435. package/lib/Local/RpcSpawner.js +132 -0
  436. package/lib/Local/RpcSpawner.js.map +1 -0
  437. package/lib/Neon/Branch.js +1 -1
  438. package/lib/Neon/Branch.js.map +1 -1
  439. package/lib/Neon/Migrations.d.ts +1 -1
  440. package/lib/Neon/Migrations.d.ts.map +1 -1
  441. package/lib/Neon/Project.d.ts.map +1 -1
  442. package/lib/Neon/Project.js +1 -15
  443. package/lib/Neon/Project.js.map +1 -1
  444. package/lib/Phase.d.ts +2 -2
  445. package/lib/Phase.d.ts.map +1 -1
  446. package/lib/Phase.js +2 -1
  447. package/lib/Phase.js.map +1 -1
  448. package/lib/Planetscale/AuthProvider.d.ts +59 -0
  449. package/lib/Planetscale/AuthProvider.d.ts.map +1 -0
  450. package/lib/Planetscale/AuthProvider.js +131 -0
  451. package/lib/Planetscale/AuthProvider.js.map +1 -0
  452. package/lib/Planetscale/Branch.d.ts +113 -0
  453. package/lib/Planetscale/Branch.d.ts.map +1 -0
  454. package/lib/Planetscale/Branch.js +287 -0
  455. package/lib/Planetscale/Branch.js.map +1 -0
  456. package/lib/Planetscale/Credentials.d.ts +35 -0
  457. package/lib/Planetscale/Credentials.d.ts.map +1 -0
  458. package/lib/Planetscale/Credentials.js +56 -0
  459. package/lib/Planetscale/Credentials.js.map +1 -0
  460. package/lib/Planetscale/Database.d.ts +117 -0
  461. package/lib/Planetscale/Database.d.ts.map +1 -0
  462. package/lib/Planetscale/Database.js +1 -0
  463. package/lib/Planetscale/Database.js.map +1 -0
  464. package/lib/Planetscale/MySQL/MySQLBranch.d.ts +86 -0
  465. package/lib/Planetscale/MySQL/MySQLBranch.d.ts.map +1 -0
  466. package/lib/Planetscale/MySQL/MySQLBranch.js +14 -0
  467. package/lib/Planetscale/MySQL/MySQLBranch.js.map +1 -0
  468. package/lib/Planetscale/MySQL/MySQLClusterSize.d.ts +23 -0
  469. package/lib/Planetscale/MySQL/MySQLClusterSize.d.ts.map +1 -0
  470. package/lib/Planetscale/MySQL/MySQLClusterSize.js +44 -0
  471. package/lib/Planetscale/MySQL/MySQLClusterSize.js.map +1 -0
  472. package/lib/Planetscale/MySQL/MySQLDatabase.d.ts +119 -0
  473. package/lib/Planetscale/MySQL/MySQLDatabase.d.ts.map +1 -0
  474. package/lib/Planetscale/MySQL/MySQLDatabase.js +237 -0
  475. package/lib/Planetscale/MySQL/MySQLDatabase.js.map +1 -0
  476. package/lib/Planetscale/MySQL/MySQLMigrations.d.ts +18 -0
  477. package/lib/Planetscale/MySQL/MySQLMigrations.d.ts.map +1 -0
  478. package/lib/Planetscale/MySQL/MySQLMigrations.js +157 -0
  479. package/lib/Planetscale/MySQL/MySQLMigrations.js.map +1 -0
  480. package/lib/Planetscale/MySQL/MySQLOrigin.d.ts +15 -0
  481. package/lib/Planetscale/MySQL/MySQLOrigin.d.ts.map +1 -0
  482. package/lib/Planetscale/MySQL/MySQLOrigin.js +2 -0
  483. package/lib/Planetscale/MySQL/MySQLOrigin.js.map +1 -0
  484. package/lib/Planetscale/MySQL/MySQLPassword.d.ts +115 -0
  485. package/lib/Planetscale/MySQL/MySQLPassword.d.ts.map +1 -0
  486. package/lib/Planetscale/MySQL/MySQLPassword.js +197 -0
  487. package/lib/Planetscale/MySQL/MySQLPassword.js.map +1 -0
  488. package/lib/Planetscale/MySQL/index.d.ts +6 -0
  489. package/lib/Planetscale/MySQL/index.d.ts.map +1 -0
  490. package/lib/Planetscale/MySQL/index.js +6 -0
  491. package/lib/Planetscale/MySQL/index.js.map +1 -0
  492. package/lib/Planetscale/Postgres/PostgresBranch.d.ts +67 -0
  493. package/lib/Planetscale/Postgres/PostgresBranch.d.ts.map +1 -0
  494. package/lib/Planetscale/Postgres/PostgresBranch.js +14 -0
  495. package/lib/Planetscale/Postgres/PostgresBranch.js.map +1 -0
  496. package/lib/Planetscale/Postgres/PostgresClusterSize.d.ts +44 -0
  497. package/lib/Planetscale/Postgres/PostgresClusterSize.d.ts.map +1 -0
  498. package/lib/Planetscale/Postgres/PostgresClusterSize.js +72 -0
  499. package/lib/Planetscale/Postgres/PostgresClusterSize.js.map +1 -0
  500. package/lib/Planetscale/Postgres/PostgresDatabase.d.ts +73 -0
  501. package/lib/Planetscale/Postgres/PostgresDatabase.d.ts.map +1 -0
  502. package/lib/Planetscale/Postgres/PostgresDatabase.js +241 -0
  503. package/lib/Planetscale/Postgres/PostgresDatabase.js.map +1 -0
  504. package/lib/Planetscale/Postgres/PostgresDefaultRole.d.ts +85 -0
  505. package/lib/Planetscale/Postgres/PostgresDefaultRole.d.ts.map +1 -0
  506. package/lib/Planetscale/Postgres/PostgresDefaultRole.js +142 -0
  507. package/lib/Planetscale/Postgres/PostgresDefaultRole.js.map +1 -0
  508. package/lib/Planetscale/Postgres/PostgresMigrations.d.ts +18 -0
  509. package/lib/Planetscale/Postgres/PostgresMigrations.d.ts.map +1 -0
  510. package/lib/Planetscale/Postgres/PostgresMigrations.js +148 -0
  511. package/lib/Planetscale/Postgres/PostgresMigrations.js.map +1 -0
  512. package/lib/Planetscale/Postgres/PostgresOrigin.d.ts +15 -0
  513. package/lib/Planetscale/Postgres/PostgresOrigin.d.ts.map +1 -0
  514. package/lib/Planetscale/Postgres/PostgresOrigin.js +2 -0
  515. package/lib/Planetscale/Postgres/PostgresOrigin.js.map +1 -0
  516. package/lib/Planetscale/Postgres/PostgresRole.d.ts +121 -0
  517. package/lib/Planetscale/Postgres/PostgresRole.d.ts.map +1 -0
  518. package/lib/Planetscale/Postgres/PostgresRole.js +228 -0
  519. package/lib/Planetscale/Postgres/PostgresRole.js.map +1 -0
  520. package/lib/Planetscale/Postgres/index.d.ts +7 -0
  521. package/lib/Planetscale/Postgres/index.d.ts.map +1 -0
  522. package/lib/Planetscale/Postgres/index.js +7 -0
  523. package/lib/Planetscale/Postgres/index.js.map +1 -0
  524. package/lib/Planetscale/Providers.d.ts +25 -0
  525. package/lib/Planetscale/Providers.d.ts.map +1 -0
  526. package/lib/Planetscale/Providers.js +40 -0
  527. package/lib/Planetscale/Providers.js.map +1 -0
  528. package/lib/Planetscale/Util.d.ts +182 -0
  529. package/lib/Planetscale/Util.d.ts.map +1 -0
  530. package/lib/Planetscale/Util.js +98 -0
  531. package/lib/Planetscale/Util.js.map +1 -0
  532. package/lib/Planetscale/index.d.ts +9 -0
  533. package/lib/Planetscale/index.d.ts.map +1 -0
  534. package/lib/Planetscale/index.js +9 -0
  535. package/lib/Planetscale/index.js.map +1 -0
  536. package/lib/Platform.d.ts.map +1 -1
  537. package/lib/Platform.js +7 -2
  538. package/lib/Platform.js.map +1 -1
  539. package/lib/RuntimeContext.d.ts +7 -3
  540. package/lib/RuntimeContext.d.ts.map +1 -1
  541. package/lib/RuntimeContext.js +3 -2
  542. package/lib/RuntimeContext.js.map +1 -1
  543. package/lib/Server/S3BucketEventSource.d.ts +1 -1
  544. package/lib/Server/S3BucketEventSource.d.ts.map +1 -1
  545. package/lib/{Neon → Sql}/SqlFile.d.ts +2 -0
  546. package/lib/Sql/SqlFile.d.ts.map +1 -0
  547. package/lib/{Neon → Sql}/SqlFile.js +14 -0
  548. package/lib/Sql/SqlFile.js.map +1 -0
  549. package/lib/Sql/index.d.ts +2 -0
  550. package/lib/Sql/index.d.ts.map +1 -0
  551. package/lib/Sql/index.js +2 -0
  552. package/lib/Sql/index.js.map +1 -0
  553. package/lib/Util/PlatformServices.d.ts +7 -0
  554. package/lib/Util/PlatformServices.d.ts.map +1 -1
  555. package/lib/Util/PlatformServices.js +22 -11
  556. package/lib/Util/PlatformServices.js.map +1 -1
  557. package/lib/Util/camel.d.ts.map +1 -1
  558. package/lib/Util/camel.js +2 -3
  559. package/lib/Util/camel.js.map +1 -1
  560. package/lib/Util/data.d.ts +5 -0
  561. package/lib/Util/data.d.ts.map +1 -1
  562. package/lib/Util/data.js +29 -0
  563. package/lib/Util/data.js.map +1 -1
  564. package/lib/Util/stable.d.ts.map +1 -1
  565. package/lib/Util/stable.js +3 -6
  566. package/lib/Util/stable.js.map +1 -1
  567. package/lib/tsconfig.test.tsbuildinfo +1 -1
  568. package/package.json +25 -13
  569. package/src/Auth/Lock.ts +2 -2
  570. package/src/Binding.ts +1 -1
  571. package/src/Bundle/Bundle.ts +35 -13
  572. package/src/Bundle/BundleAnalyzerPlugin.ts +33 -0
  573. package/src/Bundle/Docker.ts +12 -15
  574. package/src/Bundle/RawPlugin.ts +82 -0
  575. package/src/Bundle/index.ts +2 -0
  576. package/src/Cli/commands/deploy.ts +1 -0
  577. package/src/Cli/commands/dev.ts +51 -37
  578. package/src/Cli/exec.ts +12 -7
  579. package/src/Cloudflare/AiGateway/AiGatewayBinding.ts +11 -16
  580. package/src/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.ts +7 -9
  581. package/src/Cloudflare/Artifacts/ArtifactsBinding.ts +11 -22
  582. package/src/Cloudflare/D1/D1Connection.ts +31 -18
  583. package/src/Cloudflare/D1/D1Database.ts +1 -1
  584. package/src/Cloudflare/D1/D1Migrations.ts +2 -2
  585. package/src/Cloudflare/Email/SendEmailBinding.ts +7 -5
  586. package/src/Cloudflare/Hyperdrive/HyperdriveBinding.ts +16 -12
  587. package/src/Cloudflare/Images/ImagesBinding.ts +8 -8
  588. package/src/Cloudflare/KV/KVNamespaceBinding.ts +38 -38
  589. package/src/Cloudflare/Local.ts +23 -0
  590. package/src/Cloudflare/Providers.ts +3 -0
  591. package/src/Cloudflare/Queue/QueueBinding.ts +7 -6
  592. package/src/Cloudflare/R2/R2BucketBinding.ts +16 -19
  593. package/src/Cloudflare/SecretsStore/SecretBinding.ts +11 -13
  594. package/src/Cloudflare/Workers/DurableObjectBridge.ts +0 -1
  595. package/src/Cloudflare/Workers/DurableObjectNamespace.ts +6 -6
  596. package/src/Cloudflare/Workers/DynamicWorkerLoader.ts +4 -5
  597. package/src/Cloudflare/Workers/LocalWorkerProvider.ts +547 -21
  598. package/src/Cloudflare/Workers/RpcAsync.ts +55 -0
  599. package/src/Cloudflare/Workers/Worker.ts +18 -25
  600. package/src/Cloudflare/Workers/WorkerBridge.ts +3 -5
  601. package/src/Cloudflare/Workers/WorkerBundle.ts +4 -8
  602. package/src/Cloudflare/Workers/WorkerRuntimeContext.ts +2 -0
  603. package/src/Cloudflare/Workers/Workflow.ts +10 -11
  604. package/src/Cloudflare/Zaraz/ZarazConfig.ts +403 -0
  605. package/src/Cloudflare/Zaraz/ZarazEventTypes.ts +257 -0
  606. package/src/Cloudflare/Zaraz/index.ts +25 -0
  607. package/src/Cloudflare/index.ts +1 -0
  608. package/src/Local/RpcProvider.ts +102 -0
  609. package/src/Local/RpcProviderProxy.ts +86 -0
  610. package/src/Local/RpcSerialization.ts +225 -0
  611. package/src/Local/RpcServer.ts +138 -0
  612. package/src/Local/RpcServerBun.ts +59 -0
  613. package/src/Local/RpcServerEnvironment.ts +55 -0
  614. package/src/Local/RpcServerNode.ts +58 -0
  615. package/src/Local/RpcServerSession.ts +87 -0
  616. package/src/Local/RpcSpawner.ts +196 -0
  617. package/src/Neon/Branch.ts +1 -1
  618. package/src/Neon/Migrations.ts +1 -1
  619. package/src/Neon/Project.ts +6 -20
  620. package/src/Phase.ts +2 -0
  621. package/src/Planetscale/AuthProvider.ts +285 -0
  622. package/src/Planetscale/Branch.ts +508 -0
  623. package/src/Planetscale/Credentials.ts +96 -0
  624. package/src/Planetscale/Database.ts +129 -0
  625. package/src/Planetscale/MySQL/MySQLBranch.ts +112 -0
  626. package/src/Planetscale/MySQL/MySQLClusterSize.ts +102 -0
  627. package/src/Planetscale/MySQL/MySQLDatabase.ts +446 -0
  628. package/src/Planetscale/MySQL/MySQLMigrations.ts +271 -0
  629. package/src/Planetscale/MySQL/MySQLOrigin.ts +15 -0
  630. package/src/Planetscale/MySQL/MySQLPassword.ts +387 -0
  631. package/src/Planetscale/MySQL/index.ts +5 -0
  632. package/src/Planetscale/Postgres/PostgresBranch.ts +97 -0
  633. package/src/Planetscale/Postgres/PostgresClusterSize.ts +125 -0
  634. package/src/Planetscale/Postgres/PostgresDatabase.ts +404 -0
  635. package/src/Planetscale/Postgres/PostgresDefaultRole.ts +270 -0
  636. package/src/Planetscale/Postgres/PostgresMigrations.ts +256 -0
  637. package/src/Planetscale/Postgres/PostgresOrigin.ts +15 -0
  638. package/src/Planetscale/Postgres/PostgresRole.ts +469 -0
  639. package/src/Planetscale/Postgres/index.ts +6 -0
  640. package/src/Planetscale/Providers.ts +80 -0
  641. package/src/Planetscale/Util.ts +160 -0
  642. package/src/Planetscale/index.ts +18 -0
  643. package/src/Platform.ts +13 -1
  644. package/src/RuntimeContext.ts +7 -8
  645. package/src/{Neon → Sql}/SqlFile.ts +22 -0
  646. package/src/Sql/index.ts +1 -0
  647. package/src/Util/PlatformServices.ts +41 -27
  648. package/src/Util/camel.ts +3 -5
  649. package/src/Util/data.ts +38 -0
  650. package/src/Util/stable.ts +4 -10
  651. package/lib/Cloudflare/D1/D1SqlFile.d.ts +0 -20
  652. package/lib/Cloudflare/D1/D1SqlFile.d.ts.map +0 -1
  653. package/lib/Cloudflare/D1/D1SqlFile.js +0 -46
  654. package/lib/Cloudflare/D1/D1SqlFile.js.map +0 -1
  655. package/lib/Cloudflare/Local/Sidecar.d.ts +0 -63
  656. package/lib/Cloudflare/Local/Sidecar.d.ts.map +0 -1
  657. package/lib/Cloudflare/Local/Sidecar.js +0 -50
  658. package/lib/Cloudflare/Local/Sidecar.js.map +0 -1
  659. package/lib/Cloudflare/Local/SidecarHandlers.d.ts +0 -8
  660. package/lib/Cloudflare/Local/SidecarHandlers.d.ts.map +0 -1
  661. package/lib/Cloudflare/Local/SidecarHandlers.js +0 -381
  662. package/lib/Cloudflare/Local/SidecarHandlers.js.map +0 -1
  663. package/lib/Cloudflare/Local/SidecarServer.d.ts +0 -2
  664. package/lib/Cloudflare/Local/SidecarServer.d.ts.map +0 -1
  665. package/lib/Cloudflare/Local/SidecarServer.js +0 -34
  666. package/lib/Cloudflare/Local/SidecarServer.js.map +0 -1
  667. package/lib/Neon/SqlFile.d.ts.map +0 -1
  668. package/lib/Neon/SqlFile.js.map +0 -1
  669. package/lib/Sidecar/Lock.d.ts +0 -23
  670. package/lib/Sidecar/Lock.d.ts.map +0 -1
  671. package/lib/Sidecar/Lock.js +0 -39
  672. package/lib/Sidecar/Lock.js.map +0 -1
  673. package/lib/Sidecar/RpcClient.d.ts +0 -15
  674. package/lib/Sidecar/RpcClient.d.ts.map +0 -1
  675. package/lib/Sidecar/RpcClient.js +0 -78
  676. package/lib/Sidecar/RpcClient.js.map +0 -1
  677. package/lib/Sidecar/RpcHandler.d.ts +0 -51
  678. package/lib/Sidecar/RpcHandler.d.ts.map +0 -1
  679. package/lib/Sidecar/RpcHandler.js +0 -87
  680. package/lib/Sidecar/RpcHandler.js.map +0 -1
  681. package/lib/Sidecar/RpcPaths.d.ts +0 -19
  682. package/lib/Sidecar/RpcPaths.d.ts.map +0 -1
  683. package/lib/Sidecar/RpcPaths.js +0 -31
  684. package/lib/Sidecar/RpcPaths.js.map +0 -1
  685. package/lib/Sidecar/RpcServer.d.ts +0 -30
  686. package/lib/Sidecar/RpcServer.d.ts.map +0 -1
  687. package/lib/Sidecar/RpcServer.js +0 -105
  688. package/lib/Sidecar/RpcServer.js.map +0 -1
  689. package/lib/Sidecar/RpcServerBun.d.ts +0 -4
  690. package/lib/Sidecar/RpcServerBun.d.ts.map +0 -1
  691. package/lib/Sidecar/RpcServerBun.js +0 -28
  692. package/lib/Sidecar/RpcServerBun.js.map +0 -1
  693. package/lib/Sidecar/RpcServerNode.d.ts +0 -4
  694. package/lib/Sidecar/RpcServerNode.d.ts.map +0 -1
  695. package/lib/Sidecar/RpcServerNode.js +0 -39
  696. package/lib/Sidecar/RpcServerNode.js.map +0 -1
  697. package/lib/Sidecar/RpcServices.d.ts +0 -6
  698. package/lib/Sidecar/RpcServices.d.ts.map +0 -1
  699. package/lib/Sidecar/RpcServices.js +0 -29
  700. package/lib/Sidecar/RpcServices.js.map +0 -1
  701. package/src/Cloudflare/D1/D1SqlFile.ts +0 -55
  702. package/src/Cloudflare/Local/Sidecar.ts +0 -81
  703. package/src/Cloudflare/Local/SidecarHandlers.ts +0 -491
  704. package/src/Cloudflare/Local/SidecarServer.ts +0 -70
  705. package/src/Sidecar/Lock.ts +0 -66
  706. package/src/Sidecar/RpcClient.ts +0 -142
  707. package/src/Sidecar/RpcHandler.ts +0 -205
  708. package/src/Sidecar/RpcPaths.ts +0 -39
  709. package/src/Sidecar/RpcServer.ts +0 -153
  710. package/src/Sidecar/RpcServerBun.ts +0 -41
  711. package/src/Sidecar/RpcServerNode.ts +0 -51
  712. package/src/Sidecar/RpcServices.ts +0 -48
package/bin/exec.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as ConfigProvider from "effect/ConfigProvider";
2
2
  import * as Effect from "effect/Effect";
3
3
  import * as Layer from "effect/Layer";
4
- import * as S from "effect/Schema";
4
+ import * as Schema from "effect/Schema";
5
5
  import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient";
6
6
  import * as EffectContext from "effect/Context";
7
7
  import * as FileSystem from "effect/FileSystem";
@@ -11,20 +11,28 @@ import * as Redacted from "effect/Redacted";
11
11
  import path from "pathe";
12
12
  import * as Config from "effect/Config";
13
13
  import os from "node:os";
14
- import * as Console from "effect/Console";
14
+ import { newWebSocketRpcSession } from "capnweb";
15
+ import * as Cache from "effect/Cache";
16
+ import * as HttpBody from "effect/unstable/http/HttpBody";
17
+ import * as HttpClient from "effect/unstable/http/HttpClient";
15
18
  import * as Logger from "effect/Logger";
16
19
  import * as Option from "effect/Option";
17
- import * as Command from "effect/unstable/cli/Command";
18
- import * as Flag from "effect/unstable/cli/Flag";
19
- import * as Data from "effect/Data";
20
- import * as Cause from "effect/Cause";
20
+ import "effect/Scope";
21
21
  import * as Deferred from "effect/Deferred";
22
- import { pipe } from "effect/Function";
22
+ import * as Data from "effect/Data";
23
+ import { flow, pipe } from "effect/Function";
23
24
  import { SingleShotGen } from "effect/Utils";
24
25
  import { pipeArguments } from "effect/Pipeable";
25
- import "effect/Scope";
26
- import * as Duration from "effect/Duration";
26
+ import "effect/Predicate";
27
+ import "effect/Record";
28
+ import * as Cause from "effect/Cause";
27
29
  import * as Exit from "effect/Exit";
30
+ import * as Stream from "effect/Stream";
31
+ import * as NodeUtil from "node:util";
32
+ import * as Console from "effect/Console";
33
+ import * as Command from "effect/unstable/cli/Command";
34
+ import * as Flag from "effect/unstable/cli/Flag";
35
+ import * as Duration from "effect/Duration";
28
36
  import * as Metric from "effect/Metric";
29
37
  import { createHash } from "node:crypto";
30
38
  import * as Argument from "effect/unstable/cli/Argument";
@@ -146,125 +154,6 @@ const CredentialsStoreLive = Layer.effect(CredentialsStore, Effect.gen(function*
146
154
  };
147
155
  }));
148
156
 
149
- //#endregion
150
- //#region lib/Util/PlatformServices.js
151
- const isBun = typeof Bun !== "undefined";
152
- const PlatformServices = Effect.promise(async () => {
153
- if (isBun) {
154
- const [BunServices, BunSocket] = await Promise.all([import("@effect/platform-bun/BunServices"), import("@effect/platform-bun/BunSocket")]);
155
- return Layer.merge(BunServices.layer, BunSocket.layerWebSocketConstructor);
156
- } else {
157
- const [NodeServices, NodeSocket] = await Promise.all([import("@effect/platform-node/NodeServices"), import("@effect/platform-node/NodeSocket")]);
158
- return Layer.merge(NodeServices.layer, NodeSocket.layerWebSocketConstructor);
159
- }
160
- }).pipe(Layer.unwrap);
161
- const runMain = (effect, options) => {
162
- if (isBun) import("@effect/platform-bun/BunRuntime").then((BunRuntime) => BunRuntime.runMain(effect, options));
163
- else import("@effect/platform-node/NodeRuntime").then((NodeRuntime) => NodeRuntime.runMain(effect, options));
164
- };
165
-
166
- //#endregion
167
- //#region lib/AdoptPolicy.js
168
- /**
169
- * AdoptPolicy controls whether the engine should "adopt" pre-existing cloud
170
- * resources that conflict with this stack instead of failing.
171
- *
172
- * The engine always calls a provider's `read` lifecycle operation when there
173
- * is no prior state and `read` is implemented. The provider's job is to
174
- * report two things:
175
- *
176
- * 1. Whether the resource exists (returns attributes vs. `undefined`).
177
- * 2. Whether *we* own it (plain attributes vs. {@link Unowned}-branded).
178
- *
179
- * The engine then routes:
180
- *
181
- * | `read` outcome | `adopt: false` | `adopt: true` |
182
- * | ------------------- | -------------- | ----------------- |
183
- * | undefined | create | create |
184
- * | owned (plain attrs) | silent adopt | silent adopt |
185
- * | {@link Unowned} | fail | takeover (adopt) |
186
- *
187
- * "Owned" means a provider has affirmatively determined the resource was
188
- * created by this stack/stage/logical-id (typically by inspecting tags or
189
- * naming conventions). Resources without ownership semantics simply always
190
- * return plain attrs — they are treated as owned by default, so silent
191
- * adoption is the norm and `--adopt` is unnecessary.
192
- *
193
- * The policy can be overridden per-effect via {@link adopt} — most commonly
194
- * applied at the resource or stack scope.
195
- */
196
- var AdoptPolicy = class extends EffectContext.Service()("AdoptPolicy") {};
197
- /**
198
- * Engine-raised failure produced when `read` reports an existing resource
199
- * marked as {@link Unowned} and `adopt` is `false`. Surface this to the user
200
- * to indicate they should either re-tag the cloud resource, pick a different
201
- * physical name, or re-run with `--adopt` (or `adopt(true)`) to force a
202
- * takeover.
203
- */
204
- var OwnedBySomeoneElse = class extends Data.TaggedError("OwnedBySomeoneElse") {};
205
- /**
206
- * Private symbol used to brand attribute objects returned by `read` as
207
- * "exists in cloud, but not owned by this stack/stage/logical-id".
208
- *
209
- * Deliberately *not* registered via `Symbol.for` — the brand is an
210
- * engine-internal routing hint and must not be observable or
211
- * forgeable from outside this module. The engine strips it before any
212
- * state persistence (see {@link stripUnowned}) so it never leaks into
213
- * the state store, JSON serialization, or downstream `Output`s.
214
- */
215
- const UnownedTag = Symbol("alchemy/Unowned");
216
- /**
217
- * Brand a `read` return value as belonging to a different owner.
218
- *
219
- * Use this in a provider's `read` implementation when the resource exists in
220
- * the cloud but a positive ownership check (e.g. tag inspection) shows it
221
- * was *not* created by this stack/stage/logical-id:
222
- *
223
- * ```ts
224
- * read: Effect.fnUntraced(function* ({ id, output, olds }) {
225
- * const settings = yield* getScriptSettings({ ... }).pipe(
226
- * Effect.catchTag("WorkerNotFound", () => Effect.succeed(undefined)),
227
- * );
228
- * if (!settings) return undefined;
229
- *
230
- * const attrs = { workerName, ...buildAttrs(settings) };
231
- * return hasAlchemyWorkerTags(id, settings.tags) ? attrs : Unowned(attrs);
232
- * }),
233
- * ```
234
- *
235
- * The returned value is structurally still `T` — there is no wrapper to
236
- * unwrap. The brand is a non-enumerable symbol that the engine inspects
237
- * during planning to decide whether to take over (`adopt: true`) or fail
238
- * loudly (`adopt: false`).
239
- *
240
- * Resources without ownership semantics should simply return plain attrs —
241
- * the engine treats them as owned and silent adoption is the default.
242
- */
243
- const Unowned = Object.assign((attrs) => {
244
- const cloned = { ...attrs };
245
- Object.defineProperty(cloned, UnownedTag, {
246
- value: true,
247
- enumerable: false,
248
- writable: false,
249
- configurable: false
250
- });
251
- return cloned;
252
- }, { is: (value) => typeof value === "object" && value !== null && value[UnownedTag] === true });
253
- /**
254
- * Strip the {@link Unowned} brand from an attributes object before persisting
255
- * it — state should not carry per-deploy ownership-routing metadata.
256
- *
257
- * The brand is intentionally non-enumerable, so a plain spread already
258
- * drops it; the additional `delete` is defense-in-depth in case a future
259
- * change makes the descriptor enumerable. Always returns a fresh object
260
- * (never mutates the input).
261
- */
262
- const stripUnowned = (attrs) => {
263
- const out = { ...attrs };
264
- if (UnownedTag in out) delete out[UnownedTag];
265
- return out;
266
- };
267
-
268
157
  //#endregion
269
158
  //#region lib/Artifacts.js
270
159
  /**
@@ -325,6 +214,10 @@ const makeScopedArtifacts = (store, fqn) => {
325
214
  */
326
215
  const ensureArtifactStore = (effect) => Effect.serviceOption(ArtifactStore).pipe(Effect.map(Option.getOrUndefined), Effect.flatMap((existing) => effect.pipe(Effect.provideService(ArtifactStore, existing ?? createArtifactStore()))));
327
216
 
217
+ //#endregion
218
+ //#region lib/Auth/AuthProvider.js
219
+ var AuthProviders = class extends EffectContext.Service()("AuthProviders") {};
220
+
328
221
  //#endregion
329
222
  //#region lib/Cli/Cli.js
330
223
  var Cli = class extends EffectContext.Service()("CLI") {};
@@ -415,105 +308,6 @@ const tryFindProviderByType = Effect.fnUntraced(function* (resourceType) {
415
308
  return Option.none();
416
309
  });
417
310
 
418
- //#endregion
419
- //#region lib/Util/service.js
420
- const GenericService = () => (Kind) => {
421
- const service = EffectContext.Service(Kind);
422
- const make$2 = (Type) => EffectContext.Service(`${Kind}<${Type}>`);
423
- return Object.assign(Object.setPrototypeOf(make$2, service), service);
424
- };
425
-
426
- //#endregion
427
- //#region lib/Auth/AuthProvider.js
428
- var AuthProviders = class extends EffectContext.Service()("AuthProviders") {};
429
-
430
- //#endregion
431
- //#region lib/Stage.js
432
- var Stage = class extends EffectContext.Service()("Stage") {};
433
-
434
- //#endregion
435
- //#region lib/Util/ConfigProvider.js
436
- const loadConfigProvider = (envFile$1) => {
437
- if (Option.isSome(envFile$1)) return ConfigProvider.fromDotEnv({ path: envFile$1.value }).pipe(Effect.map((dotEnv) => ConfigProvider.orElse(dotEnv, ConfigProvider.fromEnv())));
438
- return Effect.gen(function* () {
439
- if (!(yield* (yield* FileSystem.FileSystem).exists(".env"))) return ConfigProvider.fromEnv();
440
- return ConfigProvider.orElse(yield* ConfigProvider.fromDotEnv({ path: ".env" }), ConfigProvider.fromEnv());
441
- });
442
- };
443
-
444
- //#endregion
445
- //#region lib/Util/effect.js
446
- const effectClass = ((impl) => impl === void 0 ? (innerImpl) => effectClass(innerImpl) : Object.assign(class {
447
- static asEffect() {
448
- return impl;
449
- }
450
- static [Symbol.iterator]() {
451
- return new SingleShotGen(this.asEffect());
452
- }
453
- static pipe(...fns) {
454
- return pipeArguments(this, fns);
455
- }
456
- }, impl));
457
- const taggedFunction = (tag$1, fn) => {
458
- const overrides = {
459
- asEffect: () => tag$1,
460
- [Symbol.iterator]: () => tag$1[Symbol.iterator](),
461
- pipe: (...fns) => pipeArguments(tag$1, fns),
462
- toString: () => `${tag$1.toString()}.${fn.name}`
463
- };
464
- return new Proxy(fn, {
465
- get: (target, prop, receiver) => Reflect.has(overrides, prop) ? Reflect.get(overrides, prop, receiver) : Reflect.has(target, prop) ? Reflect.get(target, prop, receiver) : Reflect.get(tag$1, prop, tag$1),
466
- has: (target, prop) => Reflect.has(overrides, prop) || Reflect.has(target, prop) || Reflect.has(tag$1, prop)
467
- });
468
- };
469
-
470
- //#endregion
471
- //#region lib/Util/FileLogger.js
472
- const fileLogger = Effect.fnUntraced(function* (...segments) {
473
- const { dotAlchemy } = yield* AlchemyContext;
474
- const fs = yield* FileSystem.FileSystem;
475
- const path$1 = yield* Path;
476
- const logFile = path$1.join(dotAlchemy, "log", ...segments);
477
- yield* fs.makeDirectory(path$1.dirname(logFile), { recursive: true });
478
- return yield* Logger.formatLogFmt.pipe(Logger.toFile(logFile, { flag: "a" }));
479
- });
480
-
481
- //#endregion
482
- //#region lib/Stack.js
483
- const Stack = Object.assign(taggedFunction(EffectContext.Service()("Stack"), (stackName, options, eff) => {
484
- if (!stackName) return (stackName$1) => Object.assign(stackRef(stackName$1).pipe(effectClass), {
485
- stage: createStageProxy(stackName$1),
486
- make: (options$1, eff$1) => Stack(stackName$1, options$1, eff$1)
487
- });
488
- return eff.pipe(make$1({
489
- name: stackName,
490
- ...options
491
- }), (eff$1) => Object.assign(eff$1, { stage: createStageProxy(stackName) }));
492
- }));
493
- const createStageProxy = (stackName) => new Proxy({}, { get: (_, stage$1) => stackRef(stackName, { stage: stage$1 }) });
494
- const StackName = Stack.use((stack) => Effect.succeed(stack.name));
495
- const make$1 = (options) => (effect) => Effect.scope.pipe(Effect.flatMap((scope) => {
496
- if (options.state == null) return Effect.die(/* @__PURE__ */ new Error(`Stack "${options.name}" is missing a state store. Add a \`state\` layer to the stack options, e.g.:\n Alchemy.Stack("${options.name}", {\n providers: Cloudflare.providers(),\n state: Cloudflare.state(), // <-- required\n }, ...)\nSee https://v2.alchemy.run/concepts/state-store for available state stores.`));
497
- if (options.providers == null) return Effect.die(/* @__PURE__ */ new Error(`Stack "${options.name}" is missing a providers layer. Add a \`providers\` layer to the stack options, e.g.:\n Alchemy.Stack("${options.name}", {\n providers: Cloudflare.providers(), // <-- required\n state: Cloudflare.state(),\n }, ...)`));
498
- return options.providers.pipe(Layer.provideMerge(options.state), Layer.provideMerge(Layer.effect(Stack, Stage.pipe(Effect.map((stage$1) => options.stack ?? {
499
- name: options.name,
500
- stage: stage$1,
501
- resources: {},
502
- bindings: {},
503
- actions: {}
504
- })))), Layer.buildWithScope(scope));
505
- }), Effect.flatMap((context) => Effect.all([
506
- effect,
507
- Stack,
508
- Effect.context()
509
- ]).pipe(Effect.map(([output, stack, services$1]) => ({
510
- ...stack,
511
- output,
512
- services: EffectContext.merge(services$1, context)
513
- })), Effect.provideContext(context))));
514
- const CurrentStack = Effect.serviceOption(Stack).pipe(Effect.map(Option.getOrUndefined));
515
- const platform = Layer.mergeAll(PlatformServices, FetchHttpClient.layer, Logger.layer([fileLogger("out")], { mergeWithExisting: true }), Layer.provide(ProfileLive, PlatformServices), Layer.provide(CredentialsStoreLive, PlatformServices));
516
-
517
311
  //#endregion
518
312
  //#region lib/Resource.js
519
313
  const isResource = (value) => {
@@ -527,9 +321,13 @@ const isResource = (value) => {
527
321
  *
528
322
  * E.g. the context of a running Worker, Task, Process, Function
529
323
  */
530
- const RuntimeContext = GenericService()("Alchemy::RuntimeContext");
324
+ var RuntimeContext = class extends EffectContext.Service()("RuntimeContext") {};
531
325
  const CurrentRuntimeContext = Effect.serviceOption(RuntimeContext).pipe(Effect.map(Option.getOrUndefined));
532
326
 
327
+ //#endregion
328
+ //#region lib/Stage.js
329
+ var Stage = class extends EffectContext.Service()("Stage") {};
330
+
533
331
  //#endregion
534
332
  //#region lib/State/State.js
535
333
  const isActionState = (s) => !!s && s.kind === "action";
@@ -847,6 +645,282 @@ const toObject = (acc, v) => ({
847
645
  ...v
848
646
  });
849
647
 
648
+ //#endregion
649
+ //#region lib/Util/ConfigProvider.js
650
+ const loadConfigProvider = (envFile$1) => {
651
+ if (Option.isSome(envFile$1)) return ConfigProvider.fromDotEnv({ path: envFile$1.value }).pipe(Effect.map((dotEnv) => ConfigProvider.orElse(dotEnv, ConfigProvider.fromEnv())));
652
+ return Effect.gen(function* () {
653
+ if (!(yield* (yield* FileSystem.FileSystem).exists(".env"))) return ConfigProvider.fromEnv();
654
+ return ConfigProvider.orElse(yield* ConfigProvider.fromDotEnv({ path: ".env" }), ConfigProvider.fromEnv());
655
+ });
656
+ };
657
+
658
+ //#endregion
659
+ //#region lib/Util/effect.js
660
+ const effectClass = ((impl) => impl === void 0 ? (innerImpl) => effectClass(innerImpl) : Object.assign(class {
661
+ static asEffect() {
662
+ return impl;
663
+ }
664
+ static [Symbol.iterator]() {
665
+ return new SingleShotGen(this.asEffect());
666
+ }
667
+ static pipe(...fns) {
668
+ return pipeArguments(this, fns);
669
+ }
670
+ }, impl));
671
+ const taggedFunction = (tag$1, fn) => {
672
+ const overrides = {
673
+ asEffect: () => tag$1,
674
+ [Symbol.iterator]: () => tag$1[Symbol.iterator](),
675
+ pipe: (...fns) => pipeArguments(tag$1, fns),
676
+ toString: () => `${tag$1.toString()}.${fn.name}`
677
+ };
678
+ return new Proxy(fn, {
679
+ get: (target, prop, receiver) => Reflect.has(overrides, prop) ? Reflect.get(overrides, prop, receiver) : Reflect.has(target, prop) ? Reflect.get(target, prop, receiver) : Reflect.get(tag$1, prop, tag$1),
680
+ has: (target, prop) => Reflect.has(overrides, prop) || Reflect.has(target, prop) || Reflect.has(tag$1, prop)
681
+ });
682
+ };
683
+
684
+ //#endregion
685
+ //#region lib/Util/FileLogger.js
686
+ const fileLogger = Effect.fnUntraced(function* (...segments) {
687
+ const { dotAlchemy } = yield* AlchemyContext;
688
+ const fs = yield* FileSystem.FileSystem;
689
+ const path$1 = yield* Path;
690
+ const logFile = path$1.join(dotAlchemy, "log", ...segments);
691
+ yield* fs.makeDirectory(path$1.dirname(logFile), { recursive: true });
692
+ return yield* Logger.formatLogFmt.pipe(Logger.toFile(logFile, { flag: "a" }));
693
+ });
694
+
695
+ //#endregion
696
+ //#region lib/Util/PlatformServices.js
697
+ const isBun = typeof Bun !== "undefined";
698
+ /**
699
+ * Constructs a layer with different implementations for Bun and Node.
700
+ */
701
+ const platformLayer = (constructors) => Layer.unwrap(Effect.promise(async () => {
702
+ if (isBun) return await constructors.bun();
703
+ else return await constructors.node();
704
+ }));
705
+ const PlatformServices = platformLayer({
706
+ bun: async () => {
707
+ const [BunServices, BunSocket] = await Promise.all([import("@effect/platform-bun/BunServices"), import("@effect/platform-bun/BunSocket")]);
708
+ return Layer.merge(BunServices.layer, BunSocket.layerWebSocketConstructor);
709
+ },
710
+ node: async () => {
711
+ const [NodeServices, NodeSocket] = await Promise.all([import("@effect/platform-node/NodeServices"), import("@effect/platform-node/NodeSocket")]);
712
+ return Layer.merge(NodeServices.layer, NodeSocket.layerWebSocketConstructor);
713
+ }
714
+ });
715
+ const runMain = (effect, options) => {
716
+ if (isBun) import("@effect/platform-bun/BunRuntime").then((BunRuntime) => BunRuntime.runMain(effect, options));
717
+ else import("@effect/platform-node/NodeRuntime").then((NodeRuntime) => NodeRuntime.runMain(effect, options));
718
+ };
719
+
720
+ //#endregion
721
+ //#region lib/Stack.js
722
+ const Stack = Object.assign(taggedFunction(EffectContext.Service()("Stack"), (stackName, options, eff) => {
723
+ if (!stackName) return (stackName$1) => Object.assign(stackRef(stackName$1).pipe(effectClass), {
724
+ stage: createStageProxy(stackName$1),
725
+ make: (options$1, eff$1) => Stack(stackName$1, options$1, eff$1)
726
+ });
727
+ return eff.pipe(make$2({
728
+ name: stackName,
729
+ ...options
730
+ }), (eff$1) => Object.assign(eff$1, { stage: createStageProxy(stackName) }));
731
+ }));
732
+ const createStageProxy = (stackName) => new Proxy({}, { get: (_, stage$1) => stackRef(stackName, { stage: stage$1 }) });
733
+ const StackName = Stack.use((stack) => Effect.succeed(stack.name));
734
+ const make$2 = (options) => (effect) => Effect.scope.pipe(Effect.flatMap((scope) => {
735
+ if (options.state == null) return Effect.die(/* @__PURE__ */ new Error(`Stack "${options.name}" is missing a state store. Add a \`state\` layer to the stack options, e.g.:\n Alchemy.Stack("${options.name}", {\n providers: Cloudflare.providers(),\n state: Cloudflare.state(), // <-- required\n }, ...)\nSee https://v2.alchemy.run/concepts/state-store for available state stores.`));
736
+ if (options.providers == null) return Effect.die(/* @__PURE__ */ new Error(`Stack "${options.name}" is missing a providers layer. Add a \`providers\` layer to the stack options, e.g.:\n Alchemy.Stack("${options.name}", {\n providers: Cloudflare.providers(), // <-- required\n state: Cloudflare.state(),\n }, ...)`));
737
+ return options.providers.pipe(Layer.provideMerge(options.state), Layer.provideMerge(Layer.effect(Stack, Stage.pipe(Effect.map((stage$1) => options.stack ?? {
738
+ name: options.name,
739
+ stage: stage$1,
740
+ resources: {},
741
+ bindings: {},
742
+ actions: {}
743
+ })))), Layer.buildWithScope(scope));
744
+ }), Effect.flatMap((context) => Effect.all([
745
+ effect,
746
+ Stack,
747
+ Effect.context()
748
+ ]).pipe(Effect.map(([output, stack, services$1]) => ({
749
+ ...stack,
750
+ output,
751
+ services: EffectContext.merge(services$1, context)
752
+ })), Effect.provideContext(context))));
753
+ const CurrentStack = Effect.serviceOption(Stack).pipe(Effect.map(Option.getOrUndefined));
754
+ const platform = Layer.mergeAll(PlatformServices, FetchHttpClient.layer, Logger.layer([fileLogger("out")], { mergeWithExisting: true }), Layer.provide(ProfileLive, PlatformServices), Layer.provide(CredentialsStoreLive, PlatformServices));
755
+
756
+ //#endregion
757
+ //#region lib/Local/RpcSerialization.js
758
+ const unwrapRpcHandlers = (handlers, streamKeys) => {
759
+ return Object.fromEntries(Object.entries(handlers).map(([key, value]) => [key, typeof value === "function" ? streamKeys?.includes(key) ? unwrapRpcStreamHandler(value) : unwrapRpcEffectHandler(value) : typeof value === "object" && value !== null ? unwrapRpcHandlers(value) : value]));
760
+ };
761
+ const serializeError = Schema.encodeSync(Schema.Defect);
762
+ const unwrapRpcEffectHandler = (handler) => flow((...args) => serializeRpcArgs(args), (args) => Effect.promise(() => handler(args)), Effect.flatMap((exit) => {
763
+ if (exit._tag === "Success") return Exit.succeed(exit.value);
764
+ return Exit.failCause(Cause.fromReasons(exit.cause.map((reason) => {
765
+ switch (reason._tag) {
766
+ case "Fail": return Cause.makeFailReason(reason.error);
767
+ case "Die": return Cause.makeDieReason(reason.defect);
768
+ case "Interrupt": return Cause.makeInterruptReason(reason.fiberId);
769
+ }
770
+ })));
771
+ }));
772
+ const unwrapRpcStreamHandler = (handler) => flow((...args) => serializeRpcArgs(args), (args) => handler(args), (stream) => Stream.fromReadableStream({
773
+ evaluate: () => stream,
774
+ onError: (error) => error
775
+ }));
776
+ const serializeRpcArgs = (value) => {
777
+ if (Redacted.isRedacted(value)) return {
778
+ _tag: "Redacted",
779
+ value: Redacted.value(value)
780
+ };
781
+ if (isOutput(value)) return {
782
+ _tag: "Output",
783
+ description: NodeUtil.inspect(value)
784
+ };
785
+ if (typeof value === "function") return null;
786
+ if (Array.isArray(value)) return value.map(serializeRpcArgs);
787
+ if (value && typeof value === "object" && !("toJSON" in value)) return Object.fromEntries(Object.entries(value).map(([key, child]) => [key, serializeRpcArgs(child)]));
788
+ return value;
789
+ };
790
+
791
+ //#endregion
792
+ //#region lib/Local/RpcProviderProxy.js
793
+ var RpcProviderProxy = class extends EffectContext.Service()("alchemy/Local/RpcProviderProxy") {};
794
+ const SPAWNER_URL_ENV_KEY = "ALCHEMY_RPC_SPAWNER_URL";
795
+ const make$1 = Effect.fnUntraced(function* (spawnerUrl) {
796
+ const client = yield* HttpClient.HttpClient;
797
+ const getSession = Effect.fnUntraced(function* (serverEntryUrl) {
798
+ const alchemyContext = yield* AlchemyContext;
799
+ const stack = yield* Stack;
800
+ const payload = {
801
+ serverEntryUrl,
802
+ alchemyContext,
803
+ stack: {
804
+ name: stack.name,
805
+ stage: stack.stage
806
+ }
807
+ };
808
+ return newWebSocketRpcSession(yield* (yield* client.post(spawnerUrl, { body: yield* HttpBody.json(payload) })).text);
809
+ }, (effect, serverEntryUrl) => Effect.catch(effect, (error) => Effect.die(new Error(`Failed to create provider RPC session for "${serverEntryUrl}"`, { cause: error }))));
810
+ const cache = yield* Cache.make({
811
+ lookup: getSession,
812
+ capacity: Infinity,
813
+ requireServicesAt: "lookup"
814
+ });
815
+ return RpcProviderProxy.of({ get: Effect.fnUntraced(function* (mainUrl, providerName) {
816
+ const session = yield* cache.lookup(mainUrl);
817
+ return unwrapRpcHandlers(yield* Effect.promise(() => session.getProvider(providerName)), ["tail"]);
818
+ }) });
819
+ });
820
+ const fromEnv = () => Layer.effect(RpcProviderProxy, Config.string(SPAWNER_URL_ENV_KEY).pipe(Effect.flatMap(make$1)));
821
+
822
+ //#endregion
823
+ //#region lib/AdoptPolicy.js
824
+ /**
825
+ * AdoptPolicy controls whether the engine should "adopt" pre-existing cloud
826
+ * resources that conflict with this stack instead of failing.
827
+ *
828
+ * The engine always calls a provider's `read` lifecycle operation when there
829
+ * is no prior state and `read` is implemented. The provider's job is to
830
+ * report two things:
831
+ *
832
+ * 1. Whether the resource exists (returns attributes vs. `undefined`).
833
+ * 2. Whether *we* own it (plain attributes vs. {@link Unowned}-branded).
834
+ *
835
+ * The engine then routes:
836
+ *
837
+ * | `read` outcome | `adopt: false` | `adopt: true` |
838
+ * | ------------------- | -------------- | ----------------- |
839
+ * | undefined | create | create |
840
+ * | owned (plain attrs) | silent adopt | silent adopt |
841
+ * | {@link Unowned} | fail | takeover (adopt) |
842
+ *
843
+ * "Owned" means a provider has affirmatively determined the resource was
844
+ * created by this stack/stage/logical-id (typically by inspecting tags or
845
+ * naming conventions). Resources without ownership semantics simply always
846
+ * return plain attrs — they are treated as owned by default, so silent
847
+ * adoption is the norm and `--adopt` is unnecessary.
848
+ *
849
+ * The policy can be overridden per-effect via {@link adopt} — most commonly
850
+ * applied at the resource or stack scope.
851
+ */
852
+ var AdoptPolicy = class extends EffectContext.Service()("AdoptPolicy") {};
853
+ /**
854
+ * Engine-raised failure produced when `read` reports an existing resource
855
+ * marked as {@link Unowned} and `adopt` is `false`. Surface this to the user
856
+ * to indicate they should either re-tag the cloud resource, pick a different
857
+ * physical name, or re-run with `--adopt` (or `adopt(true)`) to force a
858
+ * takeover.
859
+ */
860
+ var OwnedBySomeoneElse = class extends Data.TaggedError("OwnedBySomeoneElse") {};
861
+ /**
862
+ * Private symbol used to brand attribute objects returned by `read` as
863
+ * "exists in cloud, but not owned by this stack/stage/logical-id".
864
+ *
865
+ * Deliberately *not* registered via `Symbol.for` — the brand is an
866
+ * engine-internal routing hint and must not be observable or
867
+ * forgeable from outside this module. The engine strips it before any
868
+ * state persistence (see {@link stripUnowned}) so it never leaks into
869
+ * the state store, JSON serialization, or downstream `Output`s.
870
+ */
871
+ const UnownedTag = Symbol("alchemy/Unowned");
872
+ /**
873
+ * Brand a `read` return value as belonging to a different owner.
874
+ *
875
+ * Use this in a provider's `read` implementation when the resource exists in
876
+ * the cloud but a positive ownership check (e.g. tag inspection) shows it
877
+ * was *not* created by this stack/stage/logical-id:
878
+ *
879
+ * ```ts
880
+ * read: Effect.fnUntraced(function* ({ id, output, olds }) {
881
+ * const settings = yield* getScriptSettings({ ... }).pipe(
882
+ * Effect.catchTag("WorkerNotFound", () => Effect.succeed(undefined)),
883
+ * );
884
+ * if (!settings) return undefined;
885
+ *
886
+ * const attrs = { workerName, ...buildAttrs(settings) };
887
+ * return hasAlchemyWorkerTags(id, settings.tags) ? attrs : Unowned(attrs);
888
+ * }),
889
+ * ```
890
+ *
891
+ * The returned value is structurally still `T` — there is no wrapper to
892
+ * unwrap. The brand is a non-enumerable symbol that the engine inspects
893
+ * during planning to decide whether to take over (`adopt: true`) or fail
894
+ * loudly (`adopt: false`).
895
+ *
896
+ * Resources without ownership semantics should simply return plain attrs —
897
+ * the engine treats them as owned and silent adoption is the default.
898
+ */
899
+ const Unowned = Object.assign((attrs) => {
900
+ const cloned = { ...attrs };
901
+ Object.defineProperty(cloned, UnownedTag, {
902
+ value: true,
903
+ enumerable: false,
904
+ writable: false,
905
+ configurable: false
906
+ });
907
+ return cloned;
908
+ }, { is: (value) => typeof value === "object" && value !== null && value[UnownedTag] === true });
909
+ /**
910
+ * Strip the {@link Unowned} brand from an attributes object before persisting
911
+ * it — state should not carry per-deploy ownership-routing metadata.
912
+ *
913
+ * The brand is intentionally non-enumerable, so a plain spread already
914
+ * drops it; the additional `delete` is defense-in-depth in case a future
915
+ * change makes the descriptor enumerable. Always returns a fresh object
916
+ * (never mutates the input).
917
+ */
918
+ const stripUnowned = (attrs) => {
919
+ const out = { ...attrs };
920
+ if (UnownedTag in out) delete out[UnownedTag];
921
+ return out;
922
+ };
923
+
850
924
  //#endregion
851
925
  //#region lib/Diff.js
852
926
  const isResolved = (value) => !_hasUnresolved(value);
@@ -2428,7 +2502,7 @@ var __rewriteRelativeImportExtension = void 0 && (void 0).__rewriteRelativeImpor
2428
2502
  };
2429
2503
  const USER = Config.string("USER").pipe(Config.orElse(() => Config.string("USERNAME")), Config.withDefault("unknown"));
2430
2504
  const STAGE = Config.string("stage").pipe(Config.option, (a) => a, Effect.map(Option.getOrUndefined));
2431
- const stage = Flag.string("stage").pipe(Flag.withSchema(S.String.check(S.isPattern(/^[a-z0-9]+([-_a-z0-9]+)*$/gi))), Flag.withDescription("Stage to deploy to, defaults to dev_${USER}"), Flag.optional, Flag.map(Option.getOrUndefined), Flag.mapEffect(Effect.fn(function* (stage$1) {
2505
+ const stage = Flag.string("stage").pipe(Flag.withSchema(Schema.String.check(Schema.isPattern(/^[a-z0-9]+([-_a-z0-9]+)*$/gi))), Flag.withDescription("Stage to deploy to, defaults to dev_${USER}"), Flag.optional, Flag.map(Option.getOrUndefined), Flag.mapEffect(Effect.fn(function* (stage$1) {
2432
2506
  if (stage$1) return stage$1;
2433
2507
  return yield* STAGE.pipe(Effect.catch(() => Effect.fail(new CliError.MissingOption({ option: "stage" }))), Effect.flatMap((s) => s === void 0 ? USER.pipe(Effect.map((user) => `dev_${user}`), Effect.catch(() => Effect.succeed("unknown"))) : Effect.succeed(s)));
2434
2508
  })));
@@ -2468,17 +2542,17 @@ const importStack = Effect.fn(function* (main) {
2468
2542
 
2469
2543
  //#endregion
2470
2544
  //#region lib/Cli/commands/deploy.js
2471
- const ExecStackOptions = S.Struct({
2472
- main: S.String,
2473
- stage: S.String,
2474
- envFile: S.OptionFromOptional(S.String),
2475
- profile: S.optional(S.String),
2476
- dryRun: S.optional(S.Boolean),
2477
- force: S.optional(S.Boolean),
2478
- yes: S.optional(S.Boolean),
2479
- destroy: S.optional(S.Boolean),
2480
- dev: S.optional(S.Boolean),
2481
- adopt: S.optional(S.Boolean)
2545
+ const ExecStackOptions = Schema.Struct({
2546
+ main: Schema.String,
2547
+ stage: Schema.String,
2548
+ envFile: Schema.OptionFromOptional(Schema.String),
2549
+ profile: Schema.optional(Schema.String),
2550
+ dryRun: Schema.optional(Schema.Boolean),
2551
+ force: Schema.optional(Schema.Boolean),
2552
+ yes: Schema.optional(Schema.Boolean),
2553
+ destroy: Schema.optional(Schema.Boolean),
2554
+ dev: Schema.optional(Schema.Boolean),
2555
+ adopt: Schema.optional(Schema.Boolean)
2482
2556
  });
2483
2557
  const stackSpanAttrs = (args) => ({
2484
2558
  "alchemy.stage": args.stage,
@@ -2506,6 +2580,7 @@ const execStack = Effect.fn(function* ({ main, stage: stage$1, envFile: envFile$
2506
2580
  ...stack,
2507
2581
  resources: {},
2508
2582
  bindings: {},
2583
+ actions: {},
2509
2584
  output: {}
2510
2585
  } : stack, { force: force$1 });
2511
2586
  if (dryRun$1) yield* cli.displayPlan(updatePlan);
@@ -3348,8 +3423,8 @@ const selectCli = () => isNonInteractive() ? LoggingCli : inkCLI();
3348
3423
 
3349
3424
  //#endregion
3350
3425
  //#region lib/Cli/exec.js
3351
- const services = Layer.mergeAll(Layer.provideMerge(AlchemyContextLive, PlatformServices), Layer.provide(ProfileLive, PlatformServices), Layer.provide(CredentialsStoreLive, PlatformServices), FetchHttpClient.layer, ConfigProvider.layer(ConfigProvider.fromEnv()), selectCli());
3352
- const exec = () => execStack(S.decodeSync(ExecStackOptions)(JSON.parse(process.env.ALCHEMY_EXEC_OPTIONS))).pipe(Effect.provide(services), Effect.scoped);
3426
+ const services = Layer.merge(selectCli(), fromEnv()).pipe(Layer.provideMerge(Layer.mergeAll(AlchemyContextLive, ProfileLive, CredentialsStoreLive)), Layer.provideMerge(Layer.mergeAll(PlatformServices, FetchHttpClient.layer, ConfigProvider.layer(ConfigProvider.fromEnv()))));
3427
+ const exec = () => execStack(Schema.decodeSync(ExecStackOptions)(JSON.parse(process.env.ALCHEMY_EXEC_OPTIONS))).pipe(Effect.provide(services), Effect.scoped);
3353
3428
 
3354
3429
  //#endregion
3355
3430
  //#region bin/exec.ts