alchemy 2.0.0-beta.59 → 2.0.0-beta.60

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 (697) hide show
  1. package/README.md +1 -1
  2. package/bin/exec.js +684 -758
  3. package/bin/exec.js.map +1 -1
  4. package/lib/AWS/AuthProvider.d.ts.map +1 -1
  5. package/lib/AWS/AuthProvider.js +22 -9
  6. package/lib/AWS/AuthProvider.js.map +1 -1
  7. package/lib/AWS/AutoScaling/LaunchTemplate.d.ts +1 -1
  8. package/lib/AWS/AutoScaling/LaunchTemplate.js +1 -1
  9. package/lib/AWS/CloudWatch/Dashboard.d.ts.map +1 -1
  10. package/lib/AWS/CloudWatch/Dashboard.js +4 -1
  11. package/lib/AWS/CloudWatch/Dashboard.js.map +1 -1
  12. package/lib/AWS/Credentials.d.ts +58 -2
  13. package/lib/AWS/Credentials.d.ts.map +1 -1
  14. package/lib/AWS/Credentials.js +124 -2
  15. package/lib/AWS/Credentials.js.map +1 -1
  16. package/lib/AWS/EC2/Image.d.ts.map +1 -1
  17. package/lib/AWS/EC2/Image.js +4 -1
  18. package/lib/AWS/EC2/Image.js.map +1 -1
  19. package/lib/AWS/EC2/Instance.d.ts +4 -3
  20. package/lib/AWS/EC2/Instance.d.ts.map +1 -1
  21. package/lib/AWS/EC2/Instance.js +4 -2
  22. package/lib/AWS/EC2/Instance.js.map +1 -1
  23. package/lib/AWS/EC2/KeyPair.d.ts +87 -0
  24. package/lib/AWS/EC2/KeyPair.d.ts.map +1 -0
  25. package/lib/AWS/EC2/KeyPair.js +198 -0
  26. package/lib/AWS/EC2/KeyPair.js.map +1 -0
  27. package/lib/AWS/EC2/NetworkAcl.d.ts.map +1 -1
  28. package/lib/AWS/EC2/NetworkAcl.js +4 -1
  29. package/lib/AWS/EC2/NetworkAcl.js.map +1 -1
  30. package/lib/AWS/EC2/SecurityGroup.d.ts.map +1 -1
  31. package/lib/AWS/EC2/SecurityGroup.js +4 -1
  32. package/lib/AWS/EC2/SecurityGroup.js.map +1 -1
  33. package/lib/AWS/EC2/SecurityGroupRule.d.ts.map +1 -1
  34. package/lib/AWS/EC2/SecurityGroupRule.js +14 -7
  35. package/lib/AWS/EC2/SecurityGroupRule.js.map +1 -1
  36. package/lib/AWS/EC2/Subnet.d.ts.map +1 -1
  37. package/lib/AWS/EC2/Subnet.js +29 -5
  38. package/lib/AWS/EC2/Subnet.js.map +1 -1
  39. package/lib/AWS/EC2/hosted.d.ts +8 -10
  40. package/lib/AWS/EC2/hosted.d.ts.map +1 -1
  41. package/lib/AWS/EC2/hosted.js +81 -67
  42. package/lib/AWS/EC2/hosted.js.map +1 -1
  43. package/lib/AWS/EC2/index.d.ts +1 -0
  44. package/lib/AWS/EC2/index.d.ts.map +1 -1
  45. package/lib/AWS/EC2/index.js +1 -0
  46. package/lib/AWS/EC2/index.js.map +1 -1
  47. package/lib/AWS/ECS/Task.d.ts +8 -8
  48. package/lib/AWS/ECS/Task.d.ts.map +1 -1
  49. package/lib/AWS/ECS/Task.js +82 -56
  50. package/lib/AWS/ECS/Task.js.map +1 -1
  51. package/lib/AWS/IAM/Role.d.ts +19 -4
  52. package/lib/AWS/IAM/Role.d.ts.map +1 -1
  53. package/lib/AWS/IAM/Role.js +81 -16
  54. package/lib/AWS/IAM/Role.js.map +1 -1
  55. package/lib/AWS/Lambda/CreateAuthToken.d.ts +28 -0
  56. package/lib/AWS/Lambda/CreateAuthToken.d.ts.map +1 -0
  57. package/lib/AWS/Lambda/CreateAuthToken.js +3 -0
  58. package/lib/AWS/Lambda/CreateAuthToken.js.map +1 -0
  59. package/lib/AWS/Lambda/CreateAuthTokenHttp.d.ts +3 -0
  60. package/lib/AWS/Lambda/CreateAuthTokenHttp.d.ts.map +1 -0
  61. package/lib/AWS/Lambda/CreateAuthTokenHttp.js +11 -0
  62. package/lib/AWS/Lambda/CreateAuthTokenHttp.js.map +1 -0
  63. package/lib/AWS/Lambda/CreateShellAuthToken.d.ts +27 -0
  64. package/lib/AWS/Lambda/CreateShellAuthToken.d.ts.map +1 -0
  65. package/lib/AWS/Lambda/CreateShellAuthToken.js +3 -0
  66. package/lib/AWS/Lambda/CreateShellAuthToken.js.map +1 -0
  67. package/lib/AWS/Lambda/CreateShellAuthTokenHttp.d.ts +3 -0
  68. package/lib/AWS/Lambda/CreateShellAuthTokenHttp.d.ts.map +1 -0
  69. package/lib/AWS/Lambda/CreateShellAuthTokenHttp.js +11 -0
  70. package/lib/AWS/Lambda/CreateShellAuthTokenHttp.js.map +1 -0
  71. package/lib/AWS/Lambda/DeleteMicrovmImageVersion.d.ts +18 -0
  72. package/lib/AWS/Lambda/DeleteMicrovmImageVersion.d.ts.map +1 -0
  73. package/lib/AWS/Lambda/DeleteMicrovmImageVersion.js +3 -0
  74. package/lib/AWS/Lambda/DeleteMicrovmImageVersion.js.map +1 -0
  75. package/lib/AWS/Lambda/DeleteMicrovmImageVersionHttp.d.ts +3 -0
  76. package/lib/AWS/Lambda/DeleteMicrovmImageVersionHttp.d.ts.map +1 -0
  77. package/lib/AWS/Lambda/DeleteMicrovmImageVersionHttp.js +12 -0
  78. package/lib/AWS/Lambda/DeleteMicrovmImageVersionHttp.js.map +1 -0
  79. package/lib/AWS/Lambda/Function.d.ts +4 -2
  80. package/lib/AWS/Lambda/Function.d.ts.map +1 -1
  81. package/lib/AWS/Lambda/Function.js +10 -5
  82. package/lib/AWS/Lambda/Function.js.map +1 -1
  83. package/lib/AWS/Lambda/GetMicrovm.d.ts +23 -0
  84. package/lib/AWS/Lambda/GetMicrovm.d.ts.map +1 -0
  85. package/lib/AWS/Lambda/GetMicrovm.js +3 -0
  86. package/lib/AWS/Lambda/GetMicrovm.js.map +1 -0
  87. package/lib/AWS/Lambda/GetMicrovmHttp.d.ts +3 -0
  88. package/lib/AWS/Lambda/GetMicrovmHttp.d.ts.map +1 -0
  89. package/lib/AWS/Lambda/GetMicrovmHttp.js +13 -0
  90. package/lib/AWS/Lambda/GetMicrovmHttp.js.map +1 -0
  91. package/lib/AWS/Lambda/GetMicrovmImage.d.ts +23 -0
  92. package/lib/AWS/Lambda/GetMicrovmImage.d.ts.map +1 -0
  93. package/lib/AWS/Lambda/GetMicrovmImage.js +3 -0
  94. package/lib/AWS/Lambda/GetMicrovmImage.js.map +1 -0
  95. package/lib/AWS/Lambda/GetMicrovmImageBuild.d.ts +18 -0
  96. package/lib/AWS/Lambda/GetMicrovmImageBuild.d.ts.map +1 -0
  97. package/lib/AWS/Lambda/GetMicrovmImageBuild.js +3 -0
  98. package/lib/AWS/Lambda/GetMicrovmImageBuild.js.map +1 -0
  99. package/lib/AWS/Lambda/GetMicrovmImageBuildHttp.d.ts +3 -0
  100. package/lib/AWS/Lambda/GetMicrovmImageBuildHttp.d.ts.map +1 -0
  101. package/lib/AWS/Lambda/GetMicrovmImageBuildHttp.js +12 -0
  102. package/lib/AWS/Lambda/GetMicrovmImageBuildHttp.js.map +1 -0
  103. package/lib/AWS/Lambda/GetMicrovmImageHttp.d.ts +3 -0
  104. package/lib/AWS/Lambda/GetMicrovmImageHttp.d.ts.map +1 -0
  105. package/lib/AWS/Lambda/GetMicrovmImageHttp.js +12 -0
  106. package/lib/AWS/Lambda/GetMicrovmImageHttp.js.map +1 -0
  107. package/lib/AWS/Lambda/GetMicrovmImageVersion.d.ts +18 -0
  108. package/lib/AWS/Lambda/GetMicrovmImageVersion.d.ts.map +1 -0
  109. package/lib/AWS/Lambda/GetMicrovmImageVersion.js +3 -0
  110. package/lib/AWS/Lambda/GetMicrovmImageVersion.js.map +1 -0
  111. package/lib/AWS/Lambda/GetMicrovmImageVersionHttp.d.ts +3 -0
  112. package/lib/AWS/Lambda/GetMicrovmImageVersionHttp.d.ts.map +1 -0
  113. package/lib/AWS/Lambda/GetMicrovmImageVersionHttp.js +12 -0
  114. package/lib/AWS/Lambda/GetMicrovmImageVersionHttp.js.map +1 -0
  115. package/lib/AWS/Lambda/ListManagedMicrovmImageVersions.d.ts +17 -0
  116. package/lib/AWS/Lambda/ListManagedMicrovmImageVersions.d.ts.map +1 -0
  117. package/lib/AWS/Lambda/ListManagedMicrovmImageVersions.js +3 -0
  118. package/lib/AWS/Lambda/ListManagedMicrovmImageVersions.js.map +1 -0
  119. package/lib/AWS/Lambda/ListManagedMicrovmImageVersionsHttp.d.ts +3 -0
  120. package/lib/AWS/Lambda/ListManagedMicrovmImageVersionsHttp.d.ts.map +1 -0
  121. package/lib/AWS/Lambda/ListManagedMicrovmImageVersionsHttp.js +10 -0
  122. package/lib/AWS/Lambda/ListManagedMicrovmImageVersionsHttp.js.map +1 -0
  123. package/lib/AWS/Lambda/ListManagedMicrovmImages.d.ts +17 -0
  124. package/lib/AWS/Lambda/ListManagedMicrovmImages.d.ts.map +1 -0
  125. package/lib/AWS/Lambda/ListManagedMicrovmImages.js +3 -0
  126. package/lib/AWS/Lambda/ListManagedMicrovmImages.js.map +1 -0
  127. package/lib/AWS/Lambda/ListManagedMicrovmImagesHttp.d.ts +3 -0
  128. package/lib/AWS/Lambda/ListManagedMicrovmImagesHttp.d.ts.map +1 -0
  129. package/lib/AWS/Lambda/ListManagedMicrovmImagesHttp.js +10 -0
  130. package/lib/AWS/Lambda/ListManagedMicrovmImagesHttp.js.map +1 -0
  131. package/lib/AWS/Lambda/ListMicrovmImageBuilds.d.ts +19 -0
  132. package/lib/AWS/Lambda/ListMicrovmImageBuilds.d.ts.map +1 -0
  133. package/lib/AWS/Lambda/ListMicrovmImageBuilds.js +3 -0
  134. package/lib/AWS/Lambda/ListMicrovmImageBuilds.js.map +1 -0
  135. package/lib/AWS/Lambda/ListMicrovmImageBuildsHttp.d.ts +3 -0
  136. package/lib/AWS/Lambda/ListMicrovmImageBuildsHttp.d.ts.map +1 -0
  137. package/lib/AWS/Lambda/ListMicrovmImageBuildsHttp.js +12 -0
  138. package/lib/AWS/Lambda/ListMicrovmImageBuildsHttp.js.map +1 -0
  139. package/lib/AWS/Lambda/ListMicrovmImageVersions.d.ts +18 -0
  140. package/lib/AWS/Lambda/ListMicrovmImageVersions.d.ts.map +1 -0
  141. package/lib/AWS/Lambda/ListMicrovmImageVersions.js +3 -0
  142. package/lib/AWS/Lambda/ListMicrovmImageVersions.js.map +1 -0
  143. package/lib/AWS/Lambda/ListMicrovmImageVersionsHttp.d.ts +3 -0
  144. package/lib/AWS/Lambda/ListMicrovmImageVersionsHttp.d.ts.map +1 -0
  145. package/lib/AWS/Lambda/ListMicrovmImageVersionsHttp.js +12 -0
  146. package/lib/AWS/Lambda/ListMicrovmImageVersionsHttp.js.map +1 -0
  147. package/lib/AWS/Lambda/ListMicrovms.d.ts +23 -0
  148. package/lib/AWS/Lambda/ListMicrovms.d.ts.map +1 -0
  149. package/lib/AWS/Lambda/ListMicrovms.js +3 -0
  150. package/lib/AWS/Lambda/ListMicrovms.js.map +1 -0
  151. package/lib/AWS/Lambda/ListMicrovmsHttp.d.ts +3 -0
  152. package/lib/AWS/Lambda/ListMicrovmsHttp.d.ts.map +1 -0
  153. package/lib/AWS/Lambda/ListMicrovmsHttp.js +12 -0
  154. package/lib/AWS/Lambda/ListMicrovmsHttp.js.map +1 -0
  155. package/lib/AWS/Lambda/MicrovmBinding.d.ts +61 -0
  156. package/lib/AWS/Lambda/MicrovmBinding.d.ts.map +1 -0
  157. package/lib/AWS/Lambda/MicrovmBinding.js +279 -0
  158. package/lib/AWS/Lambda/MicrovmBinding.js.map +1 -0
  159. package/lib/AWS/Lambda/MicrovmBundle.d.ts +62 -0
  160. package/lib/AWS/Lambda/MicrovmBundle.d.ts.map +1 -0
  161. package/lib/AWS/Lambda/MicrovmBundle.js +197 -0
  162. package/lib/AWS/Lambda/MicrovmBundle.js.map +1 -0
  163. package/lib/AWS/Lambda/MicrovmImage.d.ts +488 -0
  164. package/lib/AWS/Lambda/MicrovmImage.d.ts.map +1 -0
  165. package/lib/AWS/Lambda/MicrovmImage.js +381 -0
  166. package/lib/AWS/Lambda/MicrovmImage.js.map +1 -0
  167. package/lib/AWS/Lambda/MicrovmProvider.d.ts +7 -0
  168. package/lib/AWS/Lambda/MicrovmProvider.d.ts.map +1 -0
  169. package/lib/AWS/Lambda/MicrovmProvider.js +384 -0
  170. package/lib/AWS/Lambda/MicrovmProvider.js.map +1 -0
  171. package/lib/AWS/Lambda/MicrovmRpc.d.ts +50 -0
  172. package/lib/AWS/Lambda/MicrovmRpc.d.ts.map +1 -0
  173. package/lib/AWS/Lambda/MicrovmRpc.js +50 -0
  174. package/lib/AWS/Lambda/MicrovmRpc.js.map +1 -0
  175. package/lib/AWS/Lambda/MicrovmRuntimeContext.d.ts +9 -0
  176. package/lib/AWS/Lambda/MicrovmRuntimeContext.d.ts.map +1 -0
  177. package/lib/AWS/Lambda/MicrovmRuntimeContext.js +67 -0
  178. package/lib/AWS/Lambda/MicrovmRuntimeContext.js.map +1 -0
  179. package/lib/AWS/Lambda/NetworkConnector.d.ts +142 -0
  180. package/lib/AWS/Lambda/NetworkConnector.d.ts.map +1 -0
  181. package/lib/AWS/Lambda/NetworkConnector.js +283 -0
  182. package/lib/AWS/Lambda/NetworkConnector.js.map +1 -0
  183. package/lib/AWS/Lambda/QueueEventSource.d.ts.map +1 -1
  184. package/lib/AWS/Lambda/QueueEventSource.js +1 -0
  185. package/lib/AWS/Lambda/QueueEventSource.js.map +1 -1
  186. package/lib/AWS/Lambda/ResumeMicrovm.d.ts +23 -0
  187. package/lib/AWS/Lambda/ResumeMicrovm.d.ts.map +1 -0
  188. package/lib/AWS/Lambda/ResumeMicrovm.js +3 -0
  189. package/lib/AWS/Lambda/ResumeMicrovm.js.map +1 -0
  190. package/lib/AWS/Lambda/ResumeMicrovmHttp.d.ts +3 -0
  191. package/lib/AWS/Lambda/ResumeMicrovmHttp.d.ts.map +1 -0
  192. package/lib/AWS/Lambda/ResumeMicrovmHttp.js +11 -0
  193. package/lib/AWS/Lambda/ResumeMicrovmHttp.js.map +1 -0
  194. package/lib/AWS/Lambda/RunMicrovm.d.ts +33 -0
  195. package/lib/AWS/Lambda/RunMicrovm.d.ts.map +1 -0
  196. package/lib/AWS/Lambda/RunMicrovm.js +3 -0
  197. package/lib/AWS/Lambda/RunMicrovm.js.map +1 -0
  198. package/lib/AWS/Lambda/RunMicrovmHttp.d.ts +3 -0
  199. package/lib/AWS/Lambda/RunMicrovmHttp.d.ts.map +1 -0
  200. package/lib/AWS/Lambda/RunMicrovmHttp.js +13 -0
  201. package/lib/AWS/Lambda/RunMicrovmHttp.js.map +1 -0
  202. package/lib/AWS/Lambda/SuspendMicrovm.d.ts +23 -0
  203. package/lib/AWS/Lambda/SuspendMicrovm.d.ts.map +1 -0
  204. package/lib/AWS/Lambda/SuspendMicrovm.js +3 -0
  205. package/lib/AWS/Lambda/SuspendMicrovm.js.map +1 -0
  206. package/lib/AWS/Lambda/SuspendMicrovmHttp.d.ts +3 -0
  207. package/lib/AWS/Lambda/SuspendMicrovmHttp.d.ts.map +1 -0
  208. package/lib/AWS/Lambda/SuspendMicrovmHttp.js +11 -0
  209. package/lib/AWS/Lambda/SuspendMicrovmHttp.js.map +1 -0
  210. package/lib/AWS/Lambda/TerminateMicrovm.d.ts +23 -0
  211. package/lib/AWS/Lambda/TerminateMicrovm.d.ts.map +1 -0
  212. package/lib/AWS/Lambda/TerminateMicrovm.js +3 -0
  213. package/lib/AWS/Lambda/TerminateMicrovm.js.map +1 -0
  214. package/lib/AWS/Lambda/TerminateMicrovmHttp.d.ts +3 -0
  215. package/lib/AWS/Lambda/TerminateMicrovmHttp.d.ts.map +1 -0
  216. package/lib/AWS/Lambda/TerminateMicrovmHttp.js +11 -0
  217. package/lib/AWS/Lambda/TerminateMicrovmHttp.js.map +1 -0
  218. package/lib/AWS/Lambda/UpdateMicrovmImageVersion.d.ts +18 -0
  219. package/lib/AWS/Lambda/UpdateMicrovmImageVersion.d.ts.map +1 -0
  220. package/lib/AWS/Lambda/UpdateMicrovmImageVersion.js +3 -0
  221. package/lib/AWS/Lambda/UpdateMicrovmImageVersion.js.map +1 -0
  222. package/lib/AWS/Lambda/UpdateMicrovmImageVersionHttp.d.ts +3 -0
  223. package/lib/AWS/Lambda/UpdateMicrovmImageVersionHttp.d.ts.map +1 -0
  224. package/lib/AWS/Lambda/UpdateMicrovmImageVersionHttp.js +12 -0
  225. package/lib/AWS/Lambda/UpdateMicrovmImageVersionHttp.js.map +1 -0
  226. package/lib/AWS/Lambda/index.d.ts +38 -0
  227. package/lib/AWS/Lambda/index.d.ts.map +1 -1
  228. package/lib/AWS/Lambda/index.js +38 -0
  229. package/lib/AWS/Lambda/index.js.map +1 -1
  230. package/lib/AWS/Providers.d.ts +1 -1
  231. package/lib/AWS/Providers.d.ts.map +1 -1
  232. package/lib/AWS/Providers.js +6 -2
  233. package/lib/AWS/Providers.js.map +1 -1
  234. package/lib/AWS/RDS/DBClusterParameterGroup.d.ts.map +1 -1
  235. package/lib/AWS/RDS/DBClusterParameterGroup.js +4 -1
  236. package/lib/AWS/RDS/DBClusterParameterGroup.js.map +1 -1
  237. package/lib/AWS/RDS/DBParameterGroup.d.ts.map +1 -1
  238. package/lib/AWS/RDS/DBParameterGroup.js +4 -1
  239. package/lib/AWS/RDS/DBParameterGroup.js.map +1 -1
  240. package/lib/AWS/Region.d.ts.map +1 -1
  241. package/lib/AWS/Region.js +6 -1
  242. package/lib/AWS/Region.js.map +1 -1
  243. package/lib/AWS/S3/Bucket.d.ts.map +1 -1
  244. package/lib/AWS/S3/Bucket.js +46 -26
  245. package/lib/AWS/S3/Bucket.js.map +1 -1
  246. package/lib/AlchemyContext.d.ts +7 -0
  247. package/lib/AlchemyContext.d.ts.map +1 -1
  248. package/lib/AlchemyContext.js.map +1 -1
  249. package/lib/Apply.js +2 -2
  250. package/lib/Apply.js.map +1 -1
  251. package/lib/Axiom/Chart.d.ts +9 -1
  252. package/lib/Axiom/Chart.d.ts.map +1 -1
  253. package/lib/Bundle/Bundle.d.ts +1 -0
  254. package/lib/Bundle/Bundle.d.ts.map +1 -1
  255. package/lib/Bundle/Bundle.js +1 -1
  256. package/lib/Bundle/Bundle.js.map +1 -1
  257. package/lib/Bundle/TempRoot.d.ts +9 -0
  258. package/lib/Bundle/TempRoot.d.ts.map +1 -1
  259. package/lib/Bundle/TempRoot.js +22 -0
  260. package/lib/Bundle/TempRoot.js.map +1 -1
  261. package/lib/Bundle/Vite.d.ts +20 -0
  262. package/lib/Bundle/Vite.d.ts.map +1 -0
  263. package/lib/Bundle/Vite.js +130 -0
  264. package/lib/Bundle/Vite.js.map +1 -0
  265. package/lib/Bundle/index.d.ts +0 -1
  266. package/lib/Bundle/index.d.ts.map +1 -1
  267. package/lib/Bundle/index.js +0 -1
  268. package/lib/Bundle/index.js.map +1 -1
  269. package/lib/Cli/Event.d.ts +1 -1
  270. package/lib/Cli/Event.d.ts.map +1 -1
  271. package/lib/Cli/LoggingCli.d.ts.map +1 -1
  272. package/lib/Cli/LoggingCli.js +3 -0
  273. package/lib/Cli/LoggingCli.js.map +1 -1
  274. package/lib/Cli/commands/_shared.d.ts.map +1 -1
  275. package/lib/Cli/commands/_shared.js +7 -1
  276. package/lib/Cli/commands/_shared.js.map +1 -1
  277. package/lib/Cli/commands/cloudflare.d.ts +2 -2
  278. package/lib/Cli/commands/cloudflare.d.ts.map +1 -1
  279. package/lib/Cli/commands/cloudflare.js +21 -2
  280. package/lib/Cli/commands/cloudflare.js.map +1 -1
  281. package/lib/Cli/commands/deploy.d.ts.map +1 -1
  282. package/lib/Cli/commands/deploy.js +4 -1
  283. package/lib/Cli/commands/deploy.js.map +1 -1
  284. package/lib/Cli/tui/components/PlanProgress.js +5 -3
  285. package/lib/Cli/tui/components/PlanProgress.js.map +1 -1
  286. package/lib/Cloudflare/AI/Gateway.d.ts +1 -1
  287. package/lib/Cloudflare/AI/Gateway.js +1 -1
  288. package/lib/Cloudflare/AI/Search.d.ts +1 -1
  289. package/lib/Cloudflare/AI/Search.js +1 -1
  290. package/lib/Cloudflare/AI/SearchInstance.d.ts +1 -1
  291. package/lib/Cloudflare/AI/SearchInstance.js +1 -1
  292. package/lib/Cloudflare/AI/SearchNamespace.d.ts +1 -1
  293. package/lib/Cloudflare/AI/SearchNamespace.js +1 -1
  294. package/lib/Cloudflare/AI/SearchToken.d.ts.map +1 -1
  295. package/lib/Cloudflare/AI/SearchToken.js +6 -1
  296. package/lib/Cloudflare/AI/SearchToken.js.map +1 -1
  297. package/lib/Cloudflare/Access/Application.d.ts.map +1 -1
  298. package/lib/Cloudflare/Access/Application.js +51 -11
  299. package/lib/Cloudflare/Access/Application.js.map +1 -1
  300. package/lib/Cloudflare/Alerting/Webhook.d.ts.map +1 -1
  301. package/lib/Cloudflare/Alerting/Webhook.js +9 -2
  302. package/lib/Cloudflare/Alerting/Webhook.js.map +1 -1
  303. package/lib/Cloudflare/AnalyticsEngine/WriteDataset.d.ts +2 -2
  304. package/lib/Cloudflare/ApiToken/AccountApiToken.d.ts.map +1 -1
  305. package/lib/Cloudflare/ApiToken/AccountApiToken.js +5 -1
  306. package/lib/Cloudflare/ApiToken/AccountApiToken.js.map +1 -1
  307. package/lib/Cloudflare/Auth/AuthProvider.js +1 -1
  308. package/lib/Cloudflare/Auth/AuthProvider.js.map +1 -1
  309. package/lib/Cloudflare/Containers/Container.d.ts +46 -4
  310. package/lib/Cloudflare/Containers/Container.d.ts.map +1 -1
  311. package/lib/Cloudflare/Containers/Container.js +27 -3
  312. package/lib/Cloudflare/Containers/Container.js.map +1 -1
  313. package/lib/Cloudflare/Containers/ContainerApplication.d.ts +25 -19
  314. package/lib/Cloudflare/Containers/ContainerApplication.d.ts.map +1 -1
  315. package/lib/Cloudflare/Containers/ContainerApplication.js.map +1 -1
  316. package/lib/Cloudflare/Containers/ContainerBundle.d.ts +1 -2
  317. package/lib/Cloudflare/Containers/ContainerBundle.d.ts.map +1 -1
  318. package/lib/Cloudflare/Containers/ContainerBundle.js +2 -4
  319. package/lib/Cloudflare/Containers/ContainerBundle.js.map +1 -1
  320. package/lib/Cloudflare/Containers/ContainerPlatform.js +2 -2
  321. package/lib/Cloudflare/Containers/ContainerPlatform.js.map +1 -1
  322. package/lib/Cloudflare/Containers/ContainerProvider.d.ts +2 -1
  323. package/lib/Cloudflare/Containers/ContainerProvider.d.ts.map +1 -1
  324. package/lib/Cloudflare/Containers/ContainerProvider.js +51 -35
  325. package/lib/Cloudflare/Containers/ContainerProvider.js.map +1 -1
  326. package/lib/Cloudflare/Containers/LocalContainerProvider.d.ts +3 -1
  327. package/lib/Cloudflare/Containers/LocalContainerProvider.d.ts.map +1 -1
  328. package/lib/Cloudflare/Containers/LocalContainerProvider.js +11 -4
  329. package/lib/Cloudflare/Containers/LocalContainerProvider.js.map +1 -1
  330. package/lib/Cloudflare/Containers/StartContainer.d.ts.map +1 -1
  331. package/lib/Cloudflare/Containers/StartContainer.js +222 -15
  332. package/lib/Cloudflare/Containers/StartContainer.js.map +1 -1
  333. package/lib/Cloudflare/DNS/ReadDns.d.ts +1 -1
  334. package/lib/Cloudflare/DNS/ReadWriteDns.d.ts +1 -1
  335. package/lib/Cloudflare/DNS/WriteDns.d.ts +1 -1
  336. package/lib/Cloudflare/Flagship/App.d.ts +1 -1
  337. package/lib/Cloudflare/Flagship/App.js +1 -1
  338. package/lib/Cloudflare/Images/Images.d.ts +1 -1
  339. package/lib/Cloudflare/Local.js +2 -1
  340. package/lib/Cloudflare/Local.js.map +1 -1
  341. package/lib/Cloudflare/Providers.d.ts.map +1 -1
  342. package/lib/Cloudflare/Providers.js +2 -1
  343. package/lib/Cloudflare/Providers.js.map +1 -1
  344. package/lib/Cloudflare/Queues/Consumer.d.ts +2 -2
  345. package/lib/Cloudflare/Queues/Consumer.d.ts.map +1 -1
  346. package/lib/Cloudflare/Queues/Consumer.js +21 -13
  347. package/lib/Cloudflare/Queues/Consumer.js.map +1 -1
  348. package/lib/Cloudflare/Queues/Queue.d.ts +1 -1
  349. package/lib/Cloudflare/Queues/Queue.js +1 -1
  350. package/lib/Cloudflare/R2/Bucket.d.ts +2 -2
  351. package/lib/Cloudflare/R2/Bucket.js +2 -2
  352. package/lib/Cloudflare/StateStore/Api.d.ts +4 -1
  353. package/lib/Cloudflare/StateStore/Api.d.ts.map +1 -1
  354. package/lib/Cloudflare/StateStore/Api.js +6 -4
  355. package/lib/Cloudflare/StateStore/Api.js.map +1 -1
  356. package/lib/Cloudflare/StateStore/State.d.ts +28 -2
  357. package/lib/Cloudflare/StateStore/State.d.ts.map +1 -1
  358. package/lib/Cloudflare/StateStore/State.js +122 -19
  359. package/lib/Cloudflare/StateStore/State.js.map +1 -1
  360. package/lib/Cloudflare/Website/Vite.d.ts +26 -23
  361. package/lib/Cloudflare/Website/Vite.d.ts.map +1 -1
  362. package/lib/Cloudflare/Website/Vite.js +25 -7
  363. package/lib/Cloudflare/Website/Vite.js.map +1 -1
  364. package/lib/Cloudflare/Workers/Binding.d.ts +1 -1
  365. package/lib/Cloudflare/Workers/Browser.d.ts +1 -1
  366. package/lib/Cloudflare/Workers/DurableObject.d.ts +54 -3
  367. package/lib/Cloudflare/Workers/DurableObject.d.ts.map +1 -1
  368. package/lib/Cloudflare/Workers/DurableObject.js +54 -3
  369. package/lib/Cloudflare/Workers/DurableObject.js.map +1 -1
  370. package/lib/Cloudflare/Workers/InferEnv.d.ts +4 -2
  371. package/lib/Cloudflare/Workers/InferEnv.d.ts.map +1 -1
  372. package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
  373. package/lib/Cloudflare/Workers/LocalWorkerProvider.js +55 -6
  374. package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
  375. package/lib/Cloudflare/Workers/RpcDurableObject.d.ts +3 -3
  376. package/lib/Cloudflare/Workers/RpcDurableObject.js +3 -3
  377. package/lib/Cloudflare/Workers/RpcWorker.d.ts +4 -4
  378. package/lib/Cloudflare/Workers/RpcWorker.js +4 -4
  379. package/lib/Cloudflare/Workers/ScheduledEvents.js +1 -1
  380. package/lib/Cloudflare/Workers/ScheduledEvents.js.map +1 -1
  381. package/lib/Cloudflare/Workers/VersionMetadata.d.ts +1 -1
  382. package/lib/Cloudflare/Workers/Vite.d.ts +1 -4
  383. package/lib/Cloudflare/Workers/Vite.d.ts.map +1 -1
  384. package/lib/Cloudflare/Workers/Vite.js +19 -38
  385. package/lib/Cloudflare/Workers/Vite.js.map +1 -1
  386. package/lib/Cloudflare/Workers/Worker.d.ts +73 -13
  387. package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
  388. package/lib/Cloudflare/Workers/Worker.js +9 -9
  389. package/lib/Cloudflare/Workers/Worker.js.map +1 -1
  390. package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts +2 -1
  391. package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts.map +1 -1
  392. package/lib/Cloudflare/Workers/WorkerAsyncBindings.js +31 -0
  393. package/lib/Cloudflare/Workers/WorkerAsyncBindings.js.map +1 -1
  394. package/lib/Cloudflare/Workers/WorkerBinding.d.ts +7 -1
  395. package/lib/Cloudflare/Workers/WorkerBinding.d.ts.map +1 -1
  396. package/lib/Cloudflare/Workers/WorkerBinding.js.map +1 -1
  397. package/lib/Cloudflare/Workers/WorkerLoader.d.ts +1 -1
  398. package/lib/Cloudflare/Workers/WorkerLoader.js +1 -1
  399. package/lib/Cloudflare/Workers/WorkerProvider.d.ts +10 -0
  400. package/lib/Cloudflare/Workers/WorkerProvider.d.ts.map +1 -1
  401. package/lib/Cloudflare/Workers/WorkerProvider.js +240 -60
  402. package/lib/Cloudflare/Workers/WorkerProvider.js.map +1 -1
  403. package/lib/Cloudflare/Workers/WorkerRuntimeContext.js +1 -1
  404. package/lib/Cloudflare/Workers/WorkerRuntimeContext.js.map +1 -1
  405. package/lib/Cloudflare/WorkersForPlatforms/DispatchNamespace.d.ts +44 -2
  406. package/lib/Cloudflare/WorkersForPlatforms/DispatchNamespace.d.ts.map +1 -1
  407. package/lib/Cloudflare/WorkersForPlatforms/DispatchNamespace.js +44 -2
  408. package/lib/Cloudflare/WorkersForPlatforms/DispatchNamespace.js.map +1 -1
  409. package/lib/Cloudflare/WorkersForPlatforms/Get.d.ts +77 -0
  410. package/lib/Cloudflare/WorkersForPlatforms/Get.d.ts.map +1 -0
  411. package/lib/Cloudflare/WorkersForPlatforms/Get.js +9 -0
  412. package/lib/Cloudflare/WorkersForPlatforms/Get.js.map +1 -0
  413. package/lib/Cloudflare/WorkersForPlatforms/GetBinding.d.ts +9 -0
  414. package/lib/Cloudflare/WorkersForPlatforms/GetBinding.d.ts.map +1 -0
  415. package/lib/Cloudflare/WorkersForPlatforms/GetBinding.js +43 -0
  416. package/lib/Cloudflare/WorkersForPlatforms/GetBinding.js.map +1 -0
  417. package/lib/Cloudflare/WorkersForPlatforms/index.d.ts +2 -0
  418. package/lib/Cloudflare/WorkersForPlatforms/index.d.ts.map +1 -1
  419. package/lib/Cloudflare/WorkersForPlatforms/index.js +2 -0
  420. package/lib/Cloudflare/WorkersForPlatforms/index.js.map +1 -1
  421. package/lib/Cloudflare/Workflows/Workflow.d.ts +107 -1
  422. package/lib/Cloudflare/Workflows/Workflow.d.ts.map +1 -1
  423. package/lib/Cloudflare/Workflows/Workflow.js +93 -6
  424. package/lib/Cloudflare/Workflows/Workflow.js.map +1 -1
  425. package/lib/Command/Build.d.ts.map +1 -1
  426. package/lib/Command/Build.js +24 -1
  427. package/lib/Command/Build.js.map +1 -1
  428. package/lib/Docker/Container.d.ts +156 -0
  429. package/lib/Docker/Container.d.ts.map +1 -0
  430. package/lib/Docker/Container.js +221 -0
  431. package/lib/Docker/Container.js.map +1 -0
  432. package/lib/Docker/Docker.d.ts +199 -0
  433. package/lib/Docker/Docker.d.ts.map +1 -0
  434. package/lib/Docker/Docker.js +224 -0
  435. package/lib/Docker/Docker.js.map +1 -0
  436. package/lib/Docker/Image.d.ts +109 -0
  437. package/lib/Docker/Image.d.ts.map +1 -0
  438. package/lib/Docker/Image.js +150 -0
  439. package/lib/Docker/Image.js.map +1 -0
  440. package/lib/Docker/Network.d.ts +61 -0
  441. package/lib/Docker/Network.d.ts.map +1 -0
  442. package/lib/Docker/Network.js +99 -0
  443. package/lib/Docker/Network.js.map +1 -0
  444. package/lib/Docker/Providers.d.ts +15 -0
  445. package/lib/Docker/Providers.d.ts.map +1 -0
  446. package/lib/Docker/Providers.js +18 -0
  447. package/lib/Docker/Providers.js.map +1 -0
  448. package/lib/Docker/Registry.d.ts +30 -0
  449. package/lib/Docker/Registry.d.ts.map +1 -0
  450. package/lib/Docker/Registry.js +44 -0
  451. package/lib/Docker/Registry.js.map +1 -0
  452. package/lib/Docker/RemoteImage.d.ts +102 -0
  453. package/lib/Docker/RemoteImage.d.ts.map +1 -0
  454. package/lib/Docker/RemoteImage.js +123 -0
  455. package/lib/Docker/RemoteImage.js.map +1 -0
  456. package/lib/Docker/Volume.d.ts +81 -0
  457. package/lib/Docker/Volume.d.ts.map +1 -0
  458. package/lib/Docker/Volume.js +107 -0
  459. package/lib/Docker/Volume.js.map +1 -0
  460. package/lib/Docker/index.d.ts +9 -0
  461. package/lib/Docker/index.d.ts.map +1 -0
  462. package/lib/Docker/index.js +8 -0
  463. package/lib/Docker/index.js.map +1 -0
  464. package/lib/Local/ProviderLayer.d.ts +1 -0
  465. package/lib/Local/ProviderLayer.d.ts.map +1 -1
  466. package/lib/Local/ProviderLayer.js +1 -0
  467. package/lib/Local/ProviderLayer.js.map +1 -1
  468. package/lib/Neon/Branch.d.ts +5 -0
  469. package/lib/Neon/Branch.d.ts.map +1 -1
  470. package/lib/Neon/Branch.js +8 -1
  471. package/lib/Neon/Branch.js.map +1 -1
  472. package/lib/Neon/Project.d.ts +5 -0
  473. package/lib/Neon/Project.d.ts.map +1 -1
  474. package/lib/Neon/Project.js +6 -0
  475. package/lib/Neon/Project.js.map +1 -1
  476. package/lib/Plan.d.ts.map +1 -1
  477. package/lib/Plan.js +3 -1
  478. package/lib/Plan.js.map +1 -1
  479. package/lib/Planetscale/Branch.d.ts +10 -0
  480. package/lib/Planetscale/Branch.d.ts.map +1 -1
  481. package/lib/Planetscale/Branch.js +43 -1
  482. package/lib/Planetscale/Branch.js.map +1 -1
  483. package/lib/Planetscale/Postgres/PostgresBranch.d.ts +5 -0
  484. package/lib/Planetscale/Postgres/PostgresBranch.d.ts.map +1 -1
  485. package/lib/Planetscale/Postgres/PostgresBranch.js.map +1 -1
  486. package/lib/Planetscale/Postgres/PostgresRole.d.ts +3 -1
  487. package/lib/Planetscale/Postgres/PostgresRole.d.ts.map +1 -1
  488. package/lib/Planetscale/Postgres/PostgresRole.js +8 -0
  489. package/lib/Planetscale/Postgres/PostgresRole.js.map +1 -1
  490. package/lib/Planetscale/Util.d.ts +3 -124
  491. package/lib/Planetscale/Util.d.ts.map +1 -1
  492. package/lib/Platform.d.ts +2 -1
  493. package/lib/Platform.d.ts.map +1 -1
  494. package/lib/Platform.js +37 -10
  495. package/lib/Platform.js.map +1 -1
  496. package/lib/Provider.d.ts.map +1 -1
  497. package/lib/Provider.js.map +1 -1
  498. package/lib/Resource.d.ts.map +1 -1
  499. package/lib/Resource.js +3 -1
  500. package/lib/Resource.js.map +1 -1
  501. package/lib/Rpc.d.ts +1 -1
  502. package/lib/Server/Process.d.ts +29 -1
  503. package/lib/Server/Process.d.ts.map +1 -1
  504. package/lib/Server/Process.js +48 -1
  505. package/lib/Server/Process.js.map +1 -1
  506. package/lib/Stack.d.ts +4 -1
  507. package/lib/Stack.d.ts.map +1 -1
  508. package/lib/Stack.js +1 -1
  509. package/lib/Stack.js.map +1 -1
  510. package/lib/State/HttpStateApi.d.ts +10 -10
  511. package/lib/Tags.d.ts +6 -0
  512. package/lib/Tags.d.ts.map +1 -1
  513. package/lib/Tags.js +6 -0
  514. package/lib/Tags.js.map +1 -1
  515. package/lib/Telemetry/Attributes.d.ts.map +1 -1
  516. package/lib/Telemetry/Attributes.js +6 -15
  517. package/lib/Telemetry/Attributes.js.map +1 -1
  518. package/lib/Test/Bun.d.ts +1 -0
  519. package/lib/Test/Bun.d.ts.map +1 -1
  520. package/lib/Test/Bun.js +1 -0
  521. package/lib/Test/Bun.js.map +1 -1
  522. package/lib/Test/Core.d.ts +1 -0
  523. package/lib/Test/Core.d.ts.map +1 -1
  524. package/lib/Test/Core.js +3 -2
  525. package/lib/Test/Core.js.map +1 -1
  526. package/lib/Test/Vitest.d.ts.map +1 -1
  527. package/lib/Test/Vitest.js +1 -0
  528. package/lib/Test/Vitest.js.map +1 -1
  529. package/lib/Util/effect.js.map +1 -1
  530. package/lib/Util/proxy-chain.d.ts +1 -0
  531. package/lib/Util/proxy-chain.d.ts.map +1 -1
  532. package/lib/Util/proxy-chain.js +1 -0
  533. package/lib/Util/proxy-chain.js.map +1 -1
  534. package/package.json +26 -10
  535. package/src/AWS/AuthProvider.ts +32 -17
  536. package/src/AWS/AutoScaling/LaunchTemplate.ts +1 -1
  537. package/src/AWS/CloudWatch/Dashboard.ts +4 -1
  538. package/src/AWS/Credentials.ts +178 -2
  539. package/src/AWS/EC2/Image.ts +4 -1
  540. package/src/AWS/EC2/Instance.ts +9 -6
  541. package/src/AWS/EC2/KeyPair.ts +319 -0
  542. package/src/AWS/EC2/NetworkAcl.ts +4 -1
  543. package/src/AWS/EC2/SecurityGroup.ts +4 -1
  544. package/src/AWS/EC2/SecurityGroupRule.ts +14 -5
  545. package/src/AWS/EC2/Subnet.ts +49 -4
  546. package/src/AWS/EC2/hosted.ts +93 -93
  547. package/src/AWS/EC2/index.ts +1 -0
  548. package/src/AWS/ECS/Task.ts +96 -78
  549. package/src/AWS/IAM/Role.ts +132 -22
  550. package/src/AWS/Lambda/CreateAuthToken.ts +43 -0
  551. package/src/AWS/Lambda/CreateAuthTokenHttp.ts +11 -0
  552. package/src/AWS/Lambda/CreateShellAuthToken.ts +42 -0
  553. package/src/AWS/Lambda/CreateShellAuthTokenHttp.ts +11 -0
  554. package/src/AWS/Lambda/DeleteMicrovmImageVersion.ts +36 -0
  555. package/src/AWS/Lambda/DeleteMicrovmImageVersionHttp.ts +12 -0
  556. package/src/AWS/Lambda/Function.ts +36 -9
  557. package/src/AWS/Lambda/GetMicrovm.ts +32 -0
  558. package/src/AWS/Lambda/GetMicrovmHttp.ts +13 -0
  559. package/src/AWS/Lambda/GetMicrovmImage.ts +40 -0
  560. package/src/AWS/Lambda/GetMicrovmImageBuild.ts +35 -0
  561. package/src/AWS/Lambda/GetMicrovmImageBuildHttp.ts +12 -0
  562. package/src/AWS/Lambda/GetMicrovmImageHttp.ts +12 -0
  563. package/src/AWS/Lambda/GetMicrovmImageVersion.ts +35 -0
  564. package/src/AWS/Lambda/GetMicrovmImageVersionHttp.ts +12 -0
  565. package/src/AWS/Lambda/ListManagedMicrovmImageVersions.ts +31 -0
  566. package/src/AWS/Lambda/ListManagedMicrovmImageVersionsHttp.ts +10 -0
  567. package/src/AWS/Lambda/ListManagedMicrovmImages.ts +31 -0
  568. package/src/AWS/Lambda/ListManagedMicrovmImagesHttp.ts +10 -0
  569. package/src/AWS/Lambda/ListMicrovmImageBuilds.ts +36 -0
  570. package/src/AWS/Lambda/ListMicrovmImageBuildsHttp.ts +12 -0
  571. package/src/AWS/Lambda/ListMicrovmImageVersions.ts +36 -0
  572. package/src/AWS/Lambda/ListMicrovmImageVersionsHttp.ts +12 -0
  573. package/src/AWS/Lambda/ListMicrovms.ts +40 -0
  574. package/src/AWS/Lambda/ListMicrovmsHttp.ts +12 -0
  575. package/src/AWS/Lambda/MicrovmBinding.ts +442 -0
  576. package/src/AWS/Lambda/MicrovmBundle.ts +256 -0
  577. package/src/AWS/Lambda/MicrovmImage.ts +569 -0
  578. package/src/AWS/Lambda/MicrovmProvider.ts +597 -0
  579. package/src/AWS/Lambda/MicrovmRpc.ts +75 -0
  580. package/src/AWS/Lambda/MicrovmRuntimeContext.ts +110 -0
  581. package/src/AWS/Lambda/NetworkConnector.ts +529 -0
  582. package/src/AWS/Lambda/QueueEventSource.ts +1 -0
  583. package/src/AWS/Lambda/ResumeMicrovm.ts +37 -0
  584. package/src/AWS/Lambda/ResumeMicrovmHttp.ts +11 -0
  585. package/src/AWS/Lambda/RunMicrovm.ts +45 -0
  586. package/src/AWS/Lambda/RunMicrovmHttp.ts +13 -0
  587. package/src/AWS/Lambda/SuspendMicrovm.ts +37 -0
  588. package/src/AWS/Lambda/SuspendMicrovmHttp.ts +11 -0
  589. package/src/AWS/Lambda/TerminateMicrovm.ts +38 -0
  590. package/src/AWS/Lambda/TerminateMicrovmHttp.ts +11 -0
  591. package/src/AWS/Lambda/UpdateMicrovmImageVersion.ts +36 -0
  592. package/src/AWS/Lambda/UpdateMicrovmImageVersionHttp.ts +12 -0
  593. package/src/AWS/Lambda/index.ts +38 -0
  594. package/src/AWS/Providers.ts +147 -133
  595. package/src/AWS/RDS/DBClusterParameterGroup.ts +5 -1
  596. package/src/AWS/RDS/DBParameterGroup.ts +5 -1
  597. package/src/AWS/Region.ts +9 -2
  598. package/src/AWS/S3/Bucket.ts +71 -36
  599. package/src/AlchemyContext.ts +7 -0
  600. package/src/Apply.ts +4 -2
  601. package/src/Axiom/Chart.ts +9 -1
  602. package/src/Bundle/Bundle.ts +1 -1
  603. package/src/Bundle/TempRoot.ts +22 -0
  604. package/src/Bundle/Vite.ts +204 -0
  605. package/src/Bundle/index.ts +0 -1
  606. package/src/Cli/Event.ts +1 -0
  607. package/src/Cli/LoggingCli.ts +3 -0
  608. package/src/Cli/commands/_shared.ts +7 -1
  609. package/src/Cli/commands/cloudflare.ts +37 -2
  610. package/src/Cli/commands/deploy.ts +4 -1
  611. package/src/Cli/tui/components/PlanProgress.tsx +5 -3
  612. package/src/Cloudflare/AI/Gateway.ts +1 -1
  613. package/src/Cloudflare/AI/Search.ts +1 -1
  614. package/src/Cloudflare/AI/SearchInstance.ts +1 -1
  615. package/src/Cloudflare/AI/SearchNamespace.ts +1 -1
  616. package/src/Cloudflare/AI/SearchToken.ts +6 -1
  617. package/src/Cloudflare/Access/Application.ts +61 -10
  618. package/src/Cloudflare/Alerting/Webhook.ts +18 -7
  619. package/src/Cloudflare/AnalyticsEngine/WriteDataset.ts +2 -2
  620. package/src/Cloudflare/ApiToken/AccountApiToken.ts +4 -0
  621. package/src/Cloudflare/Auth/AuthProvider.ts +1 -1
  622. package/src/Cloudflare/Containers/Container.ts +43 -4
  623. package/src/Cloudflare/Containers/ContainerApplication.ts +24 -18
  624. package/src/Cloudflare/Containers/ContainerBundle.ts +2 -4
  625. package/src/Cloudflare/Containers/ContainerPlatform.ts +3 -3
  626. package/src/Cloudflare/Containers/ContainerProvider.ts +50 -42
  627. package/src/Cloudflare/Containers/LocalContainerProvider.ts +11 -4
  628. package/src/Cloudflare/Containers/StartContainer.ts +316 -32
  629. package/src/Cloudflare/DNS/ReadDns.ts +1 -1
  630. package/src/Cloudflare/DNS/ReadWriteDns.ts +1 -1
  631. package/src/Cloudflare/DNS/WriteDns.ts +1 -1
  632. package/src/Cloudflare/Flagship/App.ts +1 -1
  633. package/src/Cloudflare/Images/Images.ts +1 -1
  634. package/src/Cloudflare/Local.ts +2 -0
  635. package/src/Cloudflare/Providers.ts +2 -0
  636. package/src/Cloudflare/Queues/Consumer.ts +21 -12
  637. package/src/Cloudflare/Queues/Queue.ts +1 -1
  638. package/src/Cloudflare/R2/Bucket.ts +2 -2
  639. package/src/Cloudflare/StateStore/Api.ts +6 -4
  640. package/src/Cloudflare/StateStore/State.ts +192 -20
  641. package/src/Cloudflare/Website/Vite.ts +29 -24
  642. package/src/Cloudflare/Workers/Binding.ts +1 -1
  643. package/src/Cloudflare/Workers/Browser.ts +1 -1
  644. package/src/Cloudflare/Workers/DurableObject.ts +54 -3
  645. package/src/Cloudflare/Workers/InferEnv.ts +47 -36
  646. package/src/Cloudflare/Workers/LocalWorkerProvider.ts +54 -7
  647. package/src/Cloudflare/Workers/RpcDurableObject.ts +3 -3
  648. package/src/Cloudflare/Workers/RpcWorker.ts +4 -4
  649. package/src/Cloudflare/Workers/ScheduledEvents.ts +1 -1
  650. package/src/Cloudflare/Workers/VersionMetadata.ts +1 -1
  651. package/src/Cloudflare/Workers/Vite.ts +21 -40
  652. package/src/Cloudflare/Workers/Worker.ts +74 -13
  653. package/src/Cloudflare/Workers/WorkerAsyncBindings.ts +30 -0
  654. package/src/Cloudflare/Workers/WorkerBinding.ts +5 -1
  655. package/src/Cloudflare/Workers/WorkerLoader.ts +1 -1
  656. package/src/Cloudflare/Workers/WorkerProvider.ts +470 -200
  657. package/src/Cloudflare/Workers/WorkerRuntimeContext.ts +1 -1
  658. package/src/Cloudflare/WorkersForPlatforms/DispatchNamespace.ts +44 -2
  659. package/src/Cloudflare/WorkersForPlatforms/Get.ts +87 -0
  660. package/src/Cloudflare/WorkersForPlatforms/GetBinding.ts +63 -0
  661. package/src/Cloudflare/WorkersForPlatforms/index.ts +2 -0
  662. package/src/Cloudflare/Workflows/Workflow.ts +207 -78
  663. package/src/Command/Build.ts +32 -1
  664. package/src/Docker/Container.ts +413 -0
  665. package/src/Docker/Docker.ts +564 -0
  666. package/src/Docker/Image.ts +265 -0
  667. package/src/Docker/Network.ts +178 -0
  668. package/src/Docker/Providers.ts +37 -0
  669. package/src/Docker/Registry.ts +63 -0
  670. package/src/Docker/RemoteImage.ts +215 -0
  671. package/src/Docker/Volume.ts +187 -0
  672. package/src/Docker/index.ts +8 -0
  673. package/src/Local/ProviderLayer.ts +2 -0
  674. package/src/Neon/Branch.ts +15 -1
  675. package/src/Neon/Project.ts +13 -0
  676. package/src/Plan.ts +3 -1
  677. package/src/Planetscale/Branch.ts +70 -0
  678. package/src/Planetscale/Postgres/PostgresBranch.ts +6 -0
  679. package/src/Planetscale/Postgres/PostgresRole.ts +11 -1
  680. package/src/Platform.ts +50 -12
  681. package/src/Provider.ts +1 -1
  682. package/src/Resource.ts +9 -3
  683. package/src/Rpc.ts +1 -1
  684. package/src/Server/Process.ts +82 -1
  685. package/src/Stack.ts +11 -3
  686. package/src/Tags.ts +12 -0
  687. package/src/Telemetry/Attributes.ts +9 -12
  688. package/src/Test/Bun.ts +2 -0
  689. package/src/Test/Core.ts +13 -8
  690. package/src/Test/Vitest.ts +1 -0
  691. package/src/Util/effect.ts +1 -1
  692. package/src/Util/proxy-chain.ts +1 -0
  693. package/lib/Bundle/Docker.d.ts +0 -75
  694. package/lib/Bundle/Docker.d.ts.map +0 -1
  695. package/lib/Bundle/Docker.js +0 -148
  696. package/lib/Bundle/Docker.js.map +0 -1
  697. package/src/Bundle/Docker.ts +0 -229
package/bin/exec.js CHANGED
@@ -37,6 +37,7 @@ import * as Flag from "effect/unstable/cli/Flag";
37
37
  import * as Metric from "effect/Metric";
38
38
  import * as Argument from "effect/unstable/cli/Argument";
39
39
  import * as CliError from "effect/unstable/cli/CliError";
40
+ import { pathToFileURL } from "node:url";
40
41
  import { jsx, jsxs } from "react/jsx-runtime";
41
42
  import { Box, Text, render, useApp, useInput } from "ink";
42
43
  import { useEffect, useMemo, useRef, useState } from "react";
@@ -58,219 +59,172 @@ var __export = (all) => {
58
59
 
59
60
  //#endregion
60
61
  //#region lib/AlchemyContext.js
61
- var AlchemyContext = class extends EffectContext.Service()("alchemy/Context") {};
62
- const AlchemyContextLive = Layer.effect(AlchemyContext, Effect.gen(function* () {
63
- const fs = yield* FileSystem.FileSystem;
64
- const dir = (yield* Path$1.Path).join(process.cwd(), ".alchemy");
65
- yield* fs.makeDirectory(dir, { recursive: true });
66
- return {
67
- dotAlchemy: dir,
68
- updateStateStore: false,
69
- dev: false,
70
- adopt: false
71
- };
72
- }));
62
+ var AlchemyContext, AlchemyContextLive;
63
+ var init_AlchemyContext = __esm({ "lib/AlchemyContext.js": (() => {
64
+ AlchemyContext = class extends EffectContext.Service()("alchemy/Context") {};
65
+ AlchemyContextLive = Layer.effect(AlchemyContext, Effect.gen(function* () {
66
+ const fs = yield* FileSystem.FileSystem;
67
+ const dir = (yield* Path$1.Path).join(process.cwd(), ".alchemy");
68
+ yield* fs.makeDirectory(dir, { recursive: true });
69
+ return {
70
+ dotAlchemy: dir,
71
+ updateStateStore: false,
72
+ dev: false,
73
+ adopt: false
74
+ };
75
+ }));
76
+ }) });
73
77
 
74
78
  //#endregion
75
79
  //#region lib/Util/interactive.js
76
- /**
77
- * Returns true when the current process looks like it's being driven by a
78
- * coding agent, CI runner, test runner, or anything else that won't render an
79
- * interactive TUI / prompt well.
80
- *
81
- * Two callers rely on this:
82
- * - `Cli/selectCli.ts` uses it to pick `LoggingCli` over the Ink TUI.
83
- * - `Auth/Profile.ts` uses it to refuse to launch an interactive credential
84
- * configure flow (and thus avoid acquiring an auth lockfile) when there's
85
- * no TTY to drive the prompts.
86
- *
87
- * Kept in `Util` (rather than `Cli`) so `Auth` can depend on it without
88
- * pulling in the CLI layer.
89
- */
90
- const isNonInteractive = () => {
91
- const env = process.env;
92
- if (env.ALCHEMY_PLAIN === "1" || env.ALCHEMY_NO_TUI === "1") return true;
93
- if (env.ALCHEMY_TUI === "1") return false;
94
- if (!process.stdout.isTTY) return true;
95
- if (env.CI) return true;
96
- if (env.CLAUDECODE || env.CLAUDE_CODE_ENTRYPOINT || env.CURSOR_AGENT || env.AIDER_MODEL || env.CODEX_CLI) return true;
97
- return false;
98
- };
80
+ var isNonInteractive;
81
+ var init_interactive = __esm({ "lib/Util/interactive.js": (() => {
82
+ isNonInteractive = () => {
83
+ const env = process.env;
84
+ if (env.ALCHEMY_PLAIN === "1" || env.ALCHEMY_NO_TUI === "1") return true;
85
+ if (env.ALCHEMY_TUI === "1") return false;
86
+ if (!process.stdout.isTTY) return true;
87
+ if (env.CI) return true;
88
+ if (env.CLAUDECODE || env.CLAUDE_CODE_ENTRYPOINT || env.CURSOR_AGENT || env.AIDER_MODEL || env.CODEX_CLI) return true;
89
+ return false;
90
+ };
91
+ }) });
99
92
 
100
93
  //#endregion
101
94
  //#region lib/Auth/AuthProvider.js
102
- const interactiveMutex = Semaphore.makeUnsafe(1);
103
- var AuthError = class extends Schema.TaggedErrorClass()("AuthError", {
104
- message: Schema.String,
105
- cause: Schema.optional(Schema.Defect())
106
- }) {};
107
- var AuthProviders = class extends EffectContext.Service()("AuthProviders") {};
95
+ var interactiveMutex, AuthError, AuthProviders;
96
+ var init_AuthProvider = __esm({ "lib/Auth/AuthProvider.js": (() => {
97
+ interactiveMutex = Semaphore.makeUnsafe(1);
98
+ AuthError = class extends Schema.TaggedErrorClass()("AuthError", {
99
+ message: Schema.String,
100
+ cause: Schema.optional(Schema.Defect())
101
+ }) {};
102
+ AuthProviders = class extends EffectContext.Service()("AuthProviders") {};
103
+ }) });
108
104
 
109
105
  //#endregion
110
106
  //#region lib/Auth/Profile.js
111
- const rootDir = path.join(os.homedir(), ".alchemy");
112
- const configFilePath = path.join(rootDir, "profiles.json");
113
- /**
114
- * Config key consulted by the various `fromAuthProvider` /
115
- * `fromEnvironment` layers to pick which named profile in
116
- * `~/.alchemy/profiles.json` to use. Defaults to `"default"`.
117
- */
118
- const ALCHEMY_PROFILE = Config.string("ALCHEMY_PROFILE").pipe(Config.withDefault("default"));
119
- const CONFIG_VERSION = 0;
120
- const emptyConfig = () => ({
121
- version: CONFIG_VERSION,
122
- profiles: {}
123
- });
124
- var AlchemyProfile = class extends EffectContext.Service()("Alchemy::Profile") {};
125
- /**
126
- * Layer that builds the {@link AlchemyProfile} service. Captures the
127
- * {@link FileSystem.FileSystem} dependency at layer-build time, so any
128
- * Effect that yields {@link AlchemyProfile} ends up with `R = Profile` (no
129
- * `FileSystem` leak). Provide this once at the top of your runtime
130
- * (alongside `PlatformServices` / `NodeContext`).
131
- */
132
- const ProfileLive = Layer.effect(AlchemyProfile, Effect.gen(function* () {
133
- const fs = yield* FileSystem.FileSystem;
134
- const readConfig = fs.readFileString(configFilePath).pipe(Effect.flatMap((data) => Effect.try({
135
- try: () => {
136
- const parsed = JSON.parse(data);
137
- if (parsed?.version !== CONFIG_VERSION) return emptyConfig();
138
- return parsed;
139
- },
140
- catch: emptyConfig
141
- })), Effect.orElseSucceed(emptyConfig));
142
- const writeConfig = (config) => fs.makeDirectory(path.dirname(configFilePath), { recursive: true }).pipe(Effect.flatMap(() => fs.writeFileString(configFilePath, JSON.stringify(config, null, 2))));
143
- const getProfile = (name) => readConfig.pipe(Effect.map((config) => config.profiles[name]));
144
- const setProfile = (name, profile$1) => readConfig.pipe(Effect.tap((config) => Effect.sync(() => config.profiles[name] = profile$1)), Effect.flatMap(writeConfig));
145
- const deleteProfile = (name) => readConfig.pipe(Effect.flatMap((config) => {
146
- if (!(name in config.profiles)) return Effect.succeed(false);
147
- delete config.profiles[name];
148
- return writeConfig(config).pipe(Effect.as(true));
149
- }));
150
- const loadOrConfigure = (auth, profileName, ctx) => Effect.flatMap(getProfile(profileName), (existing) => {
151
- const stored = existing?.[auth.name];
152
- if (stored) return Effect.succeed(stored);
153
- if (!ctx.ci && isNonInteractive()) return Effect.fail(new AuthError({ message: `No credentials configured for '${auth.name}' in profile '${profileName}', and this process is non-interactive so it can't be configured interactively. Run \`alchemy login --profile ${profileName}\` to configure it, or set CI=1 to use environment-variable credentials.` }));
154
- return Effect.tap(auth.configure(profileName, ctx), (config) => setProfile(profileName, {
155
- ...existing,
156
- [auth.name]: config
157
- }));
107
+ var rootDir, configFilePath, ALCHEMY_PROFILE, CONFIG_VERSION, emptyConfig, AlchemyProfile, ProfileLive, withProfileOverride;
108
+ var init_Profile = __esm({ "lib/Auth/Profile.js": (() => {
109
+ init_interactive();
110
+ init_AuthProvider();
111
+ rootDir = path.join(os.homedir(), ".alchemy");
112
+ configFilePath = path.join(rootDir, "profiles.json");
113
+ ALCHEMY_PROFILE = Config.string("ALCHEMY_PROFILE").pipe(Config.withDefault("default"));
114
+ CONFIG_VERSION = 0;
115
+ emptyConfig = () => ({
116
+ version: CONFIG_VERSION,
117
+ profiles: {}
158
118
  });
159
- return {
160
- readConfig,
161
- writeConfig,
162
- getProfile,
163
- setProfile,
164
- deleteProfile,
165
- loadOrConfigure
119
+ AlchemyProfile = class extends EffectContext.Service()("Alchemy::Profile") {};
120
+ ProfileLive = Layer.effect(AlchemyProfile, Effect.gen(function* () {
121
+ const fs = yield* FileSystem.FileSystem;
122
+ const readConfig = fs.readFileString(configFilePath).pipe(Effect.flatMap((data) => Effect.try({
123
+ try: () => {
124
+ const parsed = JSON.parse(data);
125
+ if (parsed?.version !== CONFIG_VERSION) return emptyConfig();
126
+ return parsed;
127
+ },
128
+ catch: emptyConfig
129
+ })), Effect.orElseSucceed(emptyConfig));
130
+ const writeConfig = (config) => fs.makeDirectory(path.dirname(configFilePath), { recursive: true }).pipe(Effect.flatMap(() => fs.writeFileString(configFilePath, JSON.stringify(config, null, 2))));
131
+ const getProfile = (name) => readConfig.pipe(Effect.map((config) => config.profiles[name]));
132
+ const setProfile = (name, profile$1) => readConfig.pipe(Effect.tap((config) => Effect.sync(() => config.profiles[name] = profile$1)), Effect.flatMap(writeConfig));
133
+ const deleteProfile = (name) => readConfig.pipe(Effect.flatMap((config) => {
134
+ if (!(name in config.profiles)) return Effect.succeed(false);
135
+ delete config.profiles[name];
136
+ return writeConfig(config).pipe(Effect.as(true));
137
+ }));
138
+ const loadOrConfigure = (auth, profileName, ctx) => Effect.flatMap(getProfile(profileName), (existing) => {
139
+ const stored = existing?.[auth.name];
140
+ if (stored) return Effect.succeed(stored);
141
+ if (!ctx.ci && isNonInteractive()) return Effect.fail(new AuthError({ message: `No credentials configured for '${auth.name}' in profile '${profileName}', and this process is non-interactive so it can't be configured interactively. Run \`alchemy login --profile ${profileName}\` to configure it, or set CI=1 to use environment-variable credentials.` }));
142
+ return Effect.tap(auth.configure(profileName, ctx), (config) => setProfile(profileName, {
143
+ ...existing,
144
+ [auth.name]: config
145
+ }));
146
+ });
147
+ return {
148
+ readConfig,
149
+ writeConfig,
150
+ getProfile,
151
+ setProfile,
152
+ deleteProfile,
153
+ loadOrConfigure
154
+ };
155
+ }));
156
+ withProfileOverride = (base, profile$1) => {
157
+ if (profile$1 === void 0) return base;
158
+ const overrides = { ALCHEMY_PROFILE: profile$1 };
159
+ const overrideProvider = ConfigProvider.make((path$1) => Effect.succeed(path$1.length === 1 && typeof path$1[0] === "string" && path$1[0] in overrides ? ConfigProvider.makeValue(overrides[path$1[0]]) : void 0));
160
+ return ConfigProvider.orElse(base)(overrideProvider);
166
161
  };
167
- }));
168
- /**
169
- * Returns a `ConfigProvider` that overrides `ALCHEMY_PROFILE` with the
170
- * given `profile` (when explicitly passed via the CLI `--profile` flag),
171
- * falling through to `base` for everything else.
172
- *
173
- * Use this to let the CLI's `--profile <name>` win over `$ALCHEMY_PROFILE`
174
- * without disturbing other config lookups.
175
- */
176
- const withProfileOverride = (base, profile$1) => {
177
- if (profile$1 === void 0) return base;
178
- const overrides = { ALCHEMY_PROFILE: profile$1 };
179
- const overrideProvider = ConfigProvider.make((path$1) => Effect.succeed(path$1.length === 1 && typeof path$1[0] === "string" && path$1[0] in overrides ? ConfigProvider.makeValue(overrides[path$1[0]]) : void 0));
180
- return ConfigProvider.orElse(base)(overrideProvider);
181
- };
162
+ }) });
182
163
 
183
164
  //#endregion
184
165
  //#region lib/Auth/Credentials.js
185
- const credentialsDirPath = path.join(rootDir, "credentials");
186
- const profileCredentialsDirPath = (profile$1) => path.join(credentialsDirPath, profile$1);
187
- const credentialsFilePath = (profile$1, provider) => path.join(profileCredentialsDirPath(profile$1), `${provider}.json`);
188
- var CredentialsStore = class extends EffectContext.Service()("Alchemy::CredentialsStore") {};
189
- const CredentialsStoreLive = Layer.effect(CredentialsStore, Effect.gen(function* () {
190
- const fs = yield* FileSystem.FileSystem;
191
- const read = (profile$1, provider) => fs.readFileString(credentialsFilePath(profile$1, provider)).pipe(Effect.catch(() => Effect.succeed(void 0)), Effect.map((data) => {
192
- if (data === void 0) return void 0;
193
- try {
194
- return JSON.parse(data);
195
- } catch {
196
- return;
197
- }
198
- }));
199
- const write = (profile$1, provider, credentials) => {
200
- const filePath = credentialsFilePath(profile$1, provider);
201
- return fs.makeDirectory(path.dirname(filePath), { recursive: true }).pipe(Effect.flatMap(() => {
202
- return fs.writeFileString(filePath, JSON.stringify(credentials, null, 2));
166
+ var credentialsDirPath, profileCredentialsDirPath, credentialsFilePath, CredentialsStore, CredentialsStoreLive;
167
+ var init_Credentials = __esm({ "lib/Auth/Credentials.js": (() => {
168
+ init_Profile();
169
+ credentialsDirPath = path.join(rootDir, "credentials");
170
+ profileCredentialsDirPath = (profile$1) => path.join(credentialsDirPath, profile$1);
171
+ credentialsFilePath = (profile$1, provider) => path.join(profileCredentialsDirPath(profile$1), `${provider}.json`);
172
+ CredentialsStore = class extends EffectContext.Service()("Alchemy::CredentialsStore") {};
173
+ CredentialsStoreLive = Layer.effect(CredentialsStore, Effect.gen(function* () {
174
+ const fs = yield* FileSystem.FileSystem;
175
+ const read = (profile$1, provider) => fs.readFileString(credentialsFilePath(profile$1, provider)).pipe(Effect.catch(() => Effect.succeed(void 0)), Effect.map((data) => {
176
+ if (data === void 0) return void 0;
177
+ try {
178
+ return JSON.parse(data);
179
+ } catch {
180
+ return;
181
+ }
203
182
  }));
204
- };
205
- const remove_ = (profile$1, provider) => fs.remove(credentialsFilePath(profile$1, provider)).pipe(Effect.catch(() => Effect.void));
206
- const deleteProfile = (profile$1) => fs.remove(profileCredentialsDirPath(profile$1), { recursive: true }).pipe(Effect.catch(() => Effect.void));
207
- return {
208
- read,
209
- write,
210
- delete: remove_,
211
- deleteProfile
212
- };
213
- }));
183
+ const write = (profile$1, provider, credentials) => {
184
+ const filePath = credentialsFilePath(profile$1, provider);
185
+ return fs.makeDirectory(path.dirname(filePath), { recursive: true }).pipe(Effect.flatMap(() => {
186
+ return fs.writeFileString(filePath, JSON.stringify(credentials, null, 2));
187
+ }));
188
+ };
189
+ const remove_ = (profile$1, provider) => fs.remove(credentialsFilePath(profile$1, provider)).pipe(Effect.catch(() => Effect.void));
190
+ const deleteProfile = (profile$1) => fs.remove(profileCredentialsDirPath(profile$1), { recursive: true }).pipe(Effect.catch(() => Effect.void));
191
+ return {
192
+ read,
193
+ write,
194
+ delete: remove_,
195
+ deleteProfile
196
+ };
197
+ }));
198
+ }) });
214
199
 
215
200
  //#endregion
216
201
  //#region lib/Artifacts.js
217
- /**
218
- * Per-resource in-memory artifacts shared across a single `Plan.make -> apply`
219
- * execution.
220
- *
221
- * The engine scopes this service by resource `FQN` before invoking lifecycle
222
- * handlers, so providers should treat it as a resource-local bag for expensive,
223
- * deterministic intermediate results that can be reused across phases.
224
- *
225
- * Expected usage:
226
- *
227
- * - `diff` computes an expensive artifact once and stores it
228
- * - `create` / `update` reads the same artifact and skips recomputing it
229
- * - artifacts are ephemeral and must never be required for correctness on a
230
- * later deploy because the bag is reset between runs
231
- *
232
- * Example:
233
- *
234
- * ```ts
235
- * const artifacts = yield* Artifacts;
236
- * const cached = yield* artifacts.get<PreparedBundle>("bundle");
237
- * if (cached) return cached;
238
- *
239
- * const bundle = yield* prepareBundle();
240
- * yield* artifacts.set("bundle", bundle);
241
- * return bundle;
242
- * ```
243
- */
244
- var Artifacts = class extends EffectContext.Service()("Artifacts") {};
245
- var ArtifactStore = class extends EffectContext.Service()("Artifacts/Store") {};
246
- /**
247
- * Create a fresh root store for one deploy/test run.
248
- */
249
- const createArtifactStore = () => /* @__PURE__ */ new Map();
250
- const getOrCreateBag = (store, fqn) => {
251
- const existing = store.get(fqn);
252
- if (existing) return existing;
253
- const bag = /* @__PURE__ */ new Map();
254
- store.set(fqn, bag);
255
- return bag;
256
- };
257
- const makeScopedArtifacts = (store, fqn) => {
258
- const bag = getOrCreateBag(store, fqn);
259
- return {
260
- get: (key) => Effect.sync(() => bag.get(key)),
261
- set: (key, value) => Effect.sync(() => {
262
- bag.set(key, value);
263
- }),
264
- delete: (key) => Effect.sync(() => {
265
- bag.delete(key);
266
- })
202
+ var Artifacts, ArtifactStore, createArtifactStore, getOrCreateBag, makeScopedArtifacts, ensureArtifactStore;
203
+ var init_Artifacts = __esm({ "lib/Artifacts.js": (() => {
204
+ Artifacts = class extends EffectContext.Service()("Artifacts") {};
205
+ ArtifactStore = class extends EffectContext.Service()("Artifacts/Store") {};
206
+ createArtifactStore = () => /* @__PURE__ */ new Map();
207
+ getOrCreateBag = (store, fqn) => {
208
+ const existing = store.get(fqn);
209
+ if (existing) return existing;
210
+ const bag = /* @__PURE__ */ new Map();
211
+ store.set(fqn, bag);
212
+ return bag;
267
213
  };
268
- };
269
- /**
270
- * Ensure an artifact root exists, reusing the ambient store when one is already
271
- * present. This lets nested helpers participate in the same run-scoped cache.
272
- */
273
- const ensureArtifactStore = (effect) => Effect.serviceOption(ArtifactStore).pipe(Effect.map(Option.getOrUndefined), Effect.flatMap((existing) => effect.pipe(Effect.provideService(ArtifactStore, existing ?? createArtifactStore()))));
214
+ makeScopedArtifacts = (store, fqn) => {
215
+ const bag = getOrCreateBag(store, fqn);
216
+ return {
217
+ get: (key) => Effect.sync(() => bag.get(key)),
218
+ set: (key, value) => Effect.sync(() => {
219
+ bag.set(key, value);
220
+ }),
221
+ delete: (key) => Effect.sync(() => {
222
+ bag.delete(key);
223
+ })
224
+ };
225
+ };
226
+ ensureArtifactStore = (effect) => Effect.serviceOption(ArtifactStore).pipe(Effect.map(Option.getOrUndefined), Effect.flatMap((existing) => effect.pipe(Effect.provideService(ArtifactStore, existing ?? createArtifactStore()))));
227
+ }) });
274
228
 
275
229
  //#endregion
276
230
  //#region lib/Cli/Cli.js
@@ -281,111 +235,36 @@ var init_Cli = __esm({ "lib/Cli/Cli.js": (() => {
281
235
 
282
236
  //#endregion
283
237
  //#region lib/Ref.js
284
- const RefMetadata = Symbol.for("alchemy/RefMetadata");
285
- const isRef = (s) => s && s[RefMetadata] !== void 0;
286
- const getRefMetadata = (ref) => ref[RefMetadata];
238
+ var RefMetadata, isRef, getRefMetadata;
239
+ var init_Ref = __esm({ "lib/Ref.js": (() => {
240
+ RefMetadata = Symbol.for("alchemy/RefMetadata");
241
+ isRef = (s) => s && s[RefMetadata] !== void 0;
242
+ getRefMetadata = (ref) => ref[RefMetadata];
243
+ }) });
287
244
 
288
245
  //#endregion
289
246
  //#region lib/AdoptPolicy.js
290
- /**
291
- * AdoptPolicy controls whether the engine should "adopt" pre-existing cloud
292
- * resources that conflict with this stack instead of failing.
293
- *
294
- * The engine always calls a provider's `read` lifecycle operation when there
295
- * is no prior state and `read` is implemented. The provider's job is to
296
- * report two things:
297
- *
298
- * 1. Whether the resource exists (returns attributes vs. `undefined`).
299
- * 2. Whether *we* own it (plain attributes vs. {@link Unowned}-branded).
300
- *
301
- * The engine then routes:
302
- *
303
- * | `read` outcome | `adopt: false` | `adopt: true` |
304
- * | ------------------- | -------------- | ----------------- |
305
- * | undefined | create | create |
306
- * | owned (plain attrs) | silent adopt | silent adopt |
307
- * | {@link Unowned} | fail | takeover (adopt) |
308
- *
309
- * "Owned" means a provider has affirmatively determined the resource was
310
- * created by this stack/stage/logical-id (typically by inspecting tags or
311
- * naming conventions). Resources without ownership semantics simply always
312
- * return plain attrs — they are treated as owned by default, so silent
313
- * adoption is the norm and `--adopt` is unnecessary.
314
- *
315
- * The policy can be overridden per-effect via {@link adopt} — most commonly
316
- * applied at the resource or stack scope.
317
- */
318
- var AdoptPolicy = class extends EffectContext.Service()("AdoptPolicy") {};
319
- /**
320
- * Engine-raised failure produced when `read` reports an existing resource
321
- * marked as {@link Unowned} and `adopt` is `false`. Surface this to the user
322
- * to indicate they should either re-tag the cloud resource, pick a different
323
- * physical name, or re-run with `--adopt` (or `adopt(true)`) to force a
324
- * takeover.
325
- */
326
- var OwnedBySomeoneElse = class extends Data.TaggedError("OwnedBySomeoneElse") {};
327
- /**
328
- * Private symbol used to brand attribute objects returned by `read` as
329
- * "exists in cloud, but not owned by this stack/stage/logical-id".
330
- *
331
- * Deliberately *not* registered via `Symbol.for` — the brand is an
332
- * engine-internal routing hint and must not be observable or
333
- * forgeable from outside this module. The engine strips it before any
334
- * state persistence (see {@link stripUnowned}) so it never leaks into
335
- * the state store, JSON serialization, or downstream `Output`s.
336
- */
337
- const UnownedTag = Symbol("alchemy/Unowned");
338
- /**
339
- * Brand a `read` return value as belonging to a different owner.
340
- *
341
- * Use this in a provider's `read` implementation when the resource exists in
342
- * the cloud but a positive ownership check (e.g. tag inspection) shows it
343
- * was *not* created by this stack/stage/logical-id:
344
- *
345
- * ```ts
346
- * read: Effect.fn(function* ({ id, output, olds }) {
347
- * const settings = yield* getScriptSettings({ ... }).pipe(
348
- * Effect.catchTag("WorkerNotFound", () => Effect.succeed(undefined)),
349
- * );
350
- * if (!settings) return undefined;
351
- *
352
- * const attrs = { workerName, ...buildAttrs(settings) };
353
- * return hasAlchemyWorkerTags(id, settings.tags) ? attrs : Unowned(attrs);
354
- * }),
355
- * ```
356
- *
357
- * The returned value is structurally still `T` — there is no wrapper to
358
- * unwrap. The brand is a non-enumerable symbol that the engine inspects
359
- * during planning to decide whether to take over (`adopt: true`) or fail
360
- * loudly (`adopt: false`).
361
- *
362
- * Resources without ownership semantics should simply return plain attrs —
363
- * the engine treats them as owned and silent adoption is the default.
364
- */
365
- const Unowned = Object.assign((attrs) => {
366
- const cloned = { ...attrs };
367
- Object.defineProperty(cloned, UnownedTag, {
368
- value: true,
369
- enumerable: false,
370
- writable: false,
371
- configurable: false
372
- });
373
- return cloned;
374
- }, { is: (value) => typeof value === "object" && value !== null && value[UnownedTag] === true });
375
- /**
376
- * Strip the {@link Unowned} brand from an attributes object before persisting
377
- * it — state should not carry per-deploy ownership-routing metadata.
378
- *
379
- * The brand is intentionally non-enumerable, so a plain spread already
380
- * drops it; the additional `delete` is defense-in-depth in case a future
381
- * change makes the descriptor enumerable. Always returns a fresh object
382
- * (never mutates the input).
383
- */
384
- const stripUnowned = (attrs) => {
385
- const out = { ...attrs };
386
- if (UnownedTag in out) delete out[UnownedTag];
387
- return out;
388
- };
247
+ var AdoptPolicy, OwnedBySomeoneElse, UnownedTag, Unowned, stripUnowned;
248
+ var init_AdoptPolicy = __esm({ "lib/AdoptPolicy.js": (() => {
249
+ AdoptPolicy = class extends EffectContext.Service()("AdoptPolicy") {};
250
+ OwnedBySomeoneElse = class extends Data.TaggedError("OwnedBySomeoneElse") {};
251
+ UnownedTag = Symbol("alchemy/Unowned");
252
+ Unowned = Object.assign((attrs) => {
253
+ const cloned = { ...attrs };
254
+ Object.defineProperty(cloned, UnownedTag, {
255
+ value: true,
256
+ enumerable: false,
257
+ writable: false,
258
+ configurable: false
259
+ });
260
+ return cloned;
261
+ }, { is: (value) => typeof value === "object" && value !== null && value[UnownedTag] === true });
262
+ stripUnowned = (attrs) => {
263
+ const out = { ...attrs };
264
+ if (UnownedTag in out) delete out[UnownedTag];
265
+ return out;
266
+ };
267
+ }) });
389
268
 
390
269
  //#endregion
391
270
  //#region lib/FQN.js
@@ -413,280 +292,73 @@ var init_FQN = __esm({ "lib/FQN.js": (() => {
413
292
 
414
293
  //#endregion
415
294
  //#region lib/Provider.js
416
- const Provider = (type) => EffectContext.Service()(type);
417
- const isProviderCollectionService = (value) => {
418
- return typeof value === "object" && value !== null && "kind" in value && value.kind === "ProviderCollection";
419
- };
420
- const findProviderByType = ((type) => tryFindProviderByType(type).pipe(Effect.flatMap(Option.match({
421
- onNone: () => Effect.die(`Provider not found for ${type}`),
422
- onSome: (provider) => Effect.succeed(provider)
423
- }))));
424
- const tryFindProviderByType = Effect.fn(function* (resourceType) {
425
- const Tag = Provider(resourceType);
426
- const direct = yield* Effect.serviceOption(Tag);
427
- if (Option.isSome(direct)) return direct;
428
- const context = yield* Effect.context();
429
- for (const value of context.mapUnsafe.values()) if (isProviderCollectionService(value)) {
430
- const provider = value.get(resourceType);
431
- if (provider) return Option.some(provider);
432
- }
433
- return Option.none();
434
- });
295
+ var Provider, isProviderCollectionService, findProviderByType, tryFindProviderByType;
296
+ var init_Provider = __esm({ "lib/Provider.js": (() => {
297
+ Provider = (type) => EffectContext.Service()(type);
298
+ isProviderCollectionService = (value) => {
299
+ return typeof value === "object" && value !== null && "kind" in value && value.kind === "ProviderCollection";
300
+ };
301
+ findProviderByType = ((type) => tryFindProviderByType(type).pipe(Effect.flatMap(Option.match({
302
+ onNone: () => Effect.die(`Provider not found for ${type}`),
303
+ onSome: (provider) => Effect.succeed(provider)
304
+ }))));
305
+ tryFindProviderByType = Effect.fn(function* (resourceType) {
306
+ const Tag = Provider(resourceType);
307
+ const direct = yield* Effect.serviceOption(Tag);
308
+ if (Option.isSome(direct)) return direct;
309
+ const context = yield* Effect.context();
310
+ for (const value of context.mapUnsafe.values()) if (isProviderCollectionService(value)) {
311
+ const provider = value.get(resourceType);
312
+ if (provider) return Option.some(provider);
313
+ }
314
+ return Option.none();
315
+ });
316
+ }) });
435
317
 
436
318
  //#endregion
437
319
  //#region lib/Resource.js
438
- const isResource = (value) => {
439
- return typeof value === "object" && value !== null && "Type" in value;
440
- };
320
+ var isResource;
321
+ var init_Resource = __esm({ "lib/Resource.js": (() => {
322
+ isResource = (value) => {
323
+ return typeof value === "object" && value !== null && "Type" in value;
324
+ };
325
+ }) });
441
326
 
442
327
  //#endregion
443
328
  //#region lib/RuntimeContext.js
444
- /**
445
- * Canonicalize a logical key into a key that is safe to use as the name of an
446
- * environment variable / binding (`[a-zA-Z][a-zA-Z0-9_]*`).
447
- *
448
- * `RuntimeContext.set`/`get` are dumb key/value stores: they read and write the
449
- * key **verbatim**. It is the *caller's* responsibility to hand them a
450
- * canonical key, since the caller is the one that knows the logical key may
451
- * contain `.`/`-` (e.g. a dotted config name from `Platform`, or an
452
- * `Output.toString()` like `"QueueSinkQueue.queueUrl"`). Callers run the key
453
- * through this before calling `set`/`get` so both sides agree.
454
- */
455
- const sanitizeKey = (key) => key.replaceAll(/[^a-zA-Z0-9]/g, "_");
456
- /**
457
- * Context of the runtime environment.
458
- *
459
- * E.g. the context of a running Worker, Task, Process, Function
460
- */
461
- var RuntimeContext = class extends EffectContext.Service()("RuntimeContext") {
462
- static phantom = Layer.empty;
463
- };
464
- const CurrentRuntimeContext = Effect.serviceOption(RuntimeContext).pipe(Effect.map(Option.getOrUndefined));
329
+ var sanitizeKey, RuntimeContext, CurrentRuntimeContext;
330
+ var init_RuntimeContext = __esm({ "lib/RuntimeContext.js": (() => {
331
+ sanitizeKey = (key) => key.replaceAll(/[^a-zA-Z0-9]/g, "_");
332
+ RuntimeContext = class extends EffectContext.Service()("RuntimeContext") {
333
+ static phantom = Layer.empty;
334
+ };
335
+ CurrentRuntimeContext = Effect.serviceOption(RuntimeContext).pipe(Effect.map(Option.getOrUndefined));
336
+ }) });
465
337
 
466
338
  //#endregion
467
339
  //#region lib/Stage.js
468
- var Stage = class extends EffectContext.Service()("Stage") {};
340
+ var Stage;
341
+ var init_Stage = __esm({ "lib/Stage.js": (() => {
342
+ Stage = class extends EffectContext.Service()("Stage") {};
343
+ }) });
469
344
 
470
345
  //#endregion
471
346
  //#region lib/State/State.js
472
- const isActionState = (s) => !!s && s.kind === "action";
473
- var State = class extends EffectContext.Service()("alchemy/State") {};
347
+ var isActionState, State;
348
+ var init_State = __esm({ "lib/State/State.js": (() => {
349
+ isActionState = (s) => !!s && s.kind === "action";
350
+ State = class extends EffectContext.Service()("alchemy/State") {};
351
+ }) });
474
352
 
475
353
  //#endregion
476
354
  //#region lib/Util/data.js
477
- const isPrimitive = (value) => value === void 0 || value === null || typeof value === "boolean" || typeof value === "number" || typeof value === "string" || typeof value === "symbol" || typeof value === "bigint";
355
+ var isPrimitive;
356
+ var init_data = __esm({ "lib/Util/data.js": (() => {
357
+ isPrimitive = (value) => value === void 0 || value === null || typeof value === "boolean" || typeof value === "number" || typeof value === "string" || typeof value === "symbol" || typeof value === "bigint";
358
+ }) });
478
359
 
479
360
  //#endregion
480
361
  //#region lib/Output.js
481
- const inspect = Symbol.for("nodejs.util.inspect.custom");
482
- const of = (resource) => {
483
- if (isRef(resource)) {
484
- const metadata = getRefMetadata(resource);
485
- return new RefExpr(metadata.stack, metadata.stage, metadata.id);
486
- }
487
- return new ResourceExpr(resource);
488
- };
489
- const asOutput = (t) => isOutput(t) ? t : Effect.isEffect(t) ? new EffectExpr(VoidExpr, () => t) : new LiteralExpr(t);
490
- const isOutput = (value) => value && (typeof value === "object" || typeof value === "function") && ExprSymbol in value;
491
- const ExprSymbol = Symbol.for("alchemy/Expr");
492
- const exprKind = (node) => node?.[ExprSymbol]?.kind ?? node?.kind;
493
- const isExpr = (value) => value && (typeof value === "object" || typeof value === "function") && ExprSymbol in value;
494
- var BaseExpr = class {
495
- constructor() {}
496
- as() {
497
- return this;
498
- }
499
- [Symbol.iterator]() {
500
- return new SingleShotGen(this.asEffect());
501
- }
502
- asEffect() {
503
- return this.bind(this.toString());
504
- }
505
- bind(id) {
506
- const key = sanitizeKey(id);
507
- return RuntimeContext.pipe(Effect.flatMap((ctx) => Effect.map(ctx.set(key, this), (k) => ctx.get(k))));
508
- }
509
- pipe(...fns) {
510
- return pipe(this, ...fns);
511
- }
512
- toString() {
513
- return this[inspect]();
514
- }
515
- };
516
- const isResourceExpr = (node) => exprKind(node) === "ResourceExpr";
517
- var ResourceExpr = class extends BaseExpr {
518
- src;
519
- stables;
520
- kind = "ResourceExpr";
521
- constructor(src, stables) {
522
- super();
523
- this.src = src;
524
- this.stables = stables;
525
- return proxy(this);
526
- }
527
- [inspect]() {
528
- return this.src.LogicalId;
529
- }
530
- };
531
- const isPropExpr = (node) => exprKind(node) === "PropExpr";
532
- var PropExpr = class extends BaseExpr {
533
- expr;
534
- identifier;
535
- kind = "PropExpr";
536
- constructor(expr, identifier) {
537
- super();
538
- this.expr = expr;
539
- this.identifier = identifier;
540
- return proxy(this);
541
- }
542
- [inspect]() {
543
- return `${this.expr[inspect]()}.${this.identifier.toString()}`;
544
- }
545
- };
546
- const isLiteralExpr = (node) => exprKind(node) === "LiteralExpr";
547
- var LiteralExpr = class extends BaseExpr {
548
- value;
549
- kind = "LiteralExpr";
550
- constructor(value) {
551
- super();
552
- this.value = value;
553
- return proxy(this);
554
- }
555
- [inspect]() {
556
- return String(this.value);
557
- }
558
- };
559
- const VoidExpr = new LiteralExpr(void 0);
560
- const isApplyExpr = (node) => exprKind(node) === "ApplyExpr";
561
- var ApplyExpr = class extends BaseExpr {
562
- expr;
563
- f;
564
- kind = "ApplyExpr";
565
- constructor(expr, f) {
566
- super();
567
- this.expr = expr;
568
- this.f = f;
569
- return proxy(this);
570
- }
571
- [inspect]() {
572
- return `${this.expr[inspect]()}.map(${this.f.toString()})`;
573
- }
574
- };
575
- const isFlatMapExpr = (node) => exprKind(node) === "FlatMapExpr";
576
- var FlatMapExpr = class extends BaseExpr {
577
- expr;
578
- f;
579
- kind = "FlatMapExpr";
580
- constructor(expr, f) {
581
- super();
582
- this.expr = expr;
583
- this.f = f;
584
- return proxy(this);
585
- }
586
- [inspect]() {
587
- return `${this.expr[inspect]()}.flatMap(${this.f.toString()})`;
588
- }
589
- };
590
- const isEffectExpr = (node) => exprKind(node) === "EffectExpr";
591
- var EffectExpr = class extends BaseExpr {
592
- expr;
593
- f;
594
- kind = "EffectExpr";
595
- constructor(expr, f) {
596
- super();
597
- this.expr = expr;
598
- this.f = f;
599
- return proxy(this);
600
- }
601
- [inspect]() {
602
- return `${this.expr[inspect]()}.mapEffect(${this.f.toString()})`;
603
- }
604
- };
605
- const isNamedExpr = (node) => exprKind(node) === "NamedExpr";
606
- /**
607
- * Wraps another `Expr` and overrides its `toString()` / inspect output.
608
- *
609
- * `BaseExpr` derives the binding id from `this.toString()`, so
610
- * wrapping an expression in `NamedExpr` makes that derived id stable and
611
- * caller-controlled (e.g. an env var name like `"API_KEY"`).
612
- */
613
- var NamedExpr = class extends BaseExpr {
614
- expr;
615
- bindingName;
616
- kind = "NamedExpr";
617
- constructor(expr, bindingName) {
618
- super();
619
- this.expr = expr;
620
- this.bindingName = bindingName;
621
- return proxy(this);
622
- }
623
- [inspect]() {
624
- return this.bindingName;
625
- }
626
- };
627
- const isAllExpr = (node) => exprKind(node) === "AllExpr";
628
- var AllExpr = class extends BaseExpr {
629
- outs;
630
- kind = "AllExpr";
631
- constructor(outs) {
632
- super();
633
- this.outs = outs;
634
- return proxy(this);
635
- }
636
- [inspect]() {
637
- return `all(${this.outs.map((out) => out[inspect]()).join(", ")})`;
638
- }
639
- };
640
- const isRefExpr = (node) => exprKind(node) === "RefExpr";
641
- var RefExpr = class extends BaseExpr {
642
- stack;
643
- stage;
644
- resourceId;
645
- kind = "RefExpr";
646
- constructor(stack, stage$1, resourceId) {
647
- super();
648
- this.stack = stack;
649
- this.stage = stage$1;
650
- this.resourceId = resourceId;
651
- return proxy(this);
652
- }
653
- [inspect]() {
654
- return `ref(${this.resourceId}, { stack: ${this.stack}, stage: ${this.stage} })`;
655
- }
656
- };
657
- const isStackRefExpr = (node) => exprKind(node) === "StackRefExpr";
658
- /**
659
- * A reference to the persisted output of a Stack at `(stack, stage)`.
660
- *
661
- * Resolved at evaluation time by reading `state.getOutput({ stack,
662
- * stage })`. Distinct from {@link RefExpr}, which references a
663
- * single resource's attributes within a stack/stage. `stage` may be
664
- * `undefined`, in which case it falls back to the current stage.
665
- */
666
- var StackRefExpr = class extends BaseExpr {
667
- stack;
668
- stage;
669
- kind = "StackRefExpr";
670
- constructor(stack, stage$1) {
671
- super();
672
- this.stack = stack;
673
- this.stage = stage$1;
674
- return proxy(this);
675
- }
676
- [inspect]() {
677
- return `stackRef(${this.stack}${this.stage ? `, { stage: ${this.stage} }` : ""})`;
678
- }
679
- };
680
- /**
681
- * Build an `Output<A>` referencing the persisted output of another
682
- * Stack. The returned Effect resolves to a lazy `Output<A>` whose
683
- * value is read from the state store at plan/apply time.
684
- *
685
- * Returns `Effect<Output<A>>` (not `Output<A>` directly) so that
686
- * `yield* Output.stackRef(...)` reads ergonomically inside an Effect
687
- * generator and lines up with `Resource.ref` and `Stack.stage.<name>`.
688
- */
689
- const stackRef = (stack, options = {}) => Effect.succeed(new StackRefExpr(stack, options.stage));
690
362
  function proxy(self) {
691
363
  const target = Object.assign(() => {}, self);
692
364
  if (inspect in self) Object.defineProperty(target, inspect, {
@@ -708,211 +380,427 @@ function proxy(self) {
708
380
  });
709
381
  return proxy$1;
710
382
  }
711
- var MissingSourceError = class extends Data.TaggedError("MissingSourceError") {};
712
- var InvalidReferenceError = class extends Data.TaggedError("InvalidReferenceError") {};
713
- const evaluate = (expr, upstream$1) => Effect.gen(function* () {
714
- if (isResource(expr)) {
715
- const srcId = expr.FQN;
716
- const src = upstream$1[srcId];
717
- if (!src) return yield* new MissingSourceError({
718
- message: `Source ${srcId} not found`,
719
- srcId
720
- });
721
- return src;
722
- } else if (isOutput(expr)) {
723
- if (isResourceExpr(expr)) {
724
- const srcId = expr.src.FQN;
383
+ var inspect, of, asOutput, isOutput, ExprSymbol, exprKind, isExpr, BaseExpr, isResourceExpr, ResourceExpr, isPropExpr, PropExpr, isLiteralExpr, LiteralExpr, VoidExpr, isApplyExpr, ApplyExpr, isFlatMapExpr, FlatMapExpr, isEffectExpr, EffectExpr, isNamedExpr, NamedExpr, isAllExpr, AllExpr, isRefExpr, RefExpr, isStackRefExpr, StackRefExpr, stackRef, MissingSourceError, InvalidReferenceError, evaluate, hasOutputs, upstreamAny, upstream, resolveUpstream, toObject;
384
+ var init_Output = __esm({ "lib/Output.js": (() => {
385
+ init_Ref();
386
+ init_Resource();
387
+ init_RuntimeContext();
388
+ init_Stack();
389
+ init_Stage();
390
+ init_State();
391
+ init_data();
392
+ inspect = Symbol.for("nodejs.util.inspect.custom");
393
+ of = (resource) => {
394
+ if (isRef(resource)) {
395
+ const metadata = getRefMetadata(resource);
396
+ return new RefExpr(metadata.stack, metadata.stage, metadata.id);
397
+ }
398
+ return new ResourceExpr(resource);
399
+ };
400
+ asOutput = (t) => isOutput(t) ? t : Effect.isEffect(t) ? new EffectExpr(VoidExpr, () => t) : new LiteralExpr(t);
401
+ isOutput = (value) => value && (typeof value === "object" || typeof value === "function") && ExprSymbol in value;
402
+ ExprSymbol = Symbol.for("alchemy/Expr");
403
+ exprKind = (node) => node?.[ExprSymbol]?.kind ?? node?.kind;
404
+ isExpr = (value) => value && (typeof value === "object" || typeof value === "function") && ExprSymbol in value;
405
+ BaseExpr = class {
406
+ constructor() {}
407
+ as() {
408
+ return this;
409
+ }
410
+ [Symbol.iterator]() {
411
+ return new SingleShotGen(this.asEffect());
412
+ }
413
+ asEffect() {
414
+ return this.bind(this.toString());
415
+ }
416
+ bind(id) {
417
+ const key = sanitizeKey(id);
418
+ return RuntimeContext.pipe(Effect.flatMap((ctx) => Effect.map(ctx.set(key, this), (k) => ctx.get(k))));
419
+ }
420
+ pipe(...fns) {
421
+ return pipe(this, ...fns);
422
+ }
423
+ toString() {
424
+ return this[inspect]();
425
+ }
426
+ };
427
+ isResourceExpr = (node) => exprKind(node) === "ResourceExpr";
428
+ ResourceExpr = class extends BaseExpr {
429
+ src;
430
+ stables;
431
+ kind = "ResourceExpr";
432
+ constructor(src, stables) {
433
+ super();
434
+ this.src = src;
435
+ this.stables = stables;
436
+ return proxy(this);
437
+ }
438
+ [inspect]() {
439
+ return this.src.LogicalId;
440
+ }
441
+ };
442
+ isPropExpr = (node) => exprKind(node) === "PropExpr";
443
+ PropExpr = class extends BaseExpr {
444
+ expr;
445
+ identifier;
446
+ kind = "PropExpr";
447
+ constructor(expr, identifier) {
448
+ super();
449
+ this.expr = expr;
450
+ this.identifier = identifier;
451
+ return proxy(this);
452
+ }
453
+ [inspect]() {
454
+ return `${this.expr[inspect]()}.${this.identifier.toString()}`;
455
+ }
456
+ };
457
+ isLiteralExpr = (node) => exprKind(node) === "LiteralExpr";
458
+ LiteralExpr = class extends BaseExpr {
459
+ value;
460
+ kind = "LiteralExpr";
461
+ constructor(value) {
462
+ super();
463
+ this.value = value;
464
+ return proxy(this);
465
+ }
466
+ [inspect]() {
467
+ return String(this.value);
468
+ }
469
+ };
470
+ VoidExpr = new LiteralExpr(void 0);
471
+ isApplyExpr = (node) => exprKind(node) === "ApplyExpr";
472
+ ApplyExpr = class extends BaseExpr {
473
+ expr;
474
+ f;
475
+ kind = "ApplyExpr";
476
+ constructor(expr, f) {
477
+ super();
478
+ this.expr = expr;
479
+ this.f = f;
480
+ return proxy(this);
481
+ }
482
+ [inspect]() {
483
+ return `${this.expr[inspect]()}.map(${this.f.toString()})`;
484
+ }
485
+ };
486
+ isFlatMapExpr = (node) => exprKind(node) === "FlatMapExpr";
487
+ FlatMapExpr = class extends BaseExpr {
488
+ expr;
489
+ f;
490
+ kind = "FlatMapExpr";
491
+ constructor(expr, f) {
492
+ super();
493
+ this.expr = expr;
494
+ this.f = f;
495
+ return proxy(this);
496
+ }
497
+ [inspect]() {
498
+ return `${this.expr[inspect]()}.flatMap(${this.f.toString()})`;
499
+ }
500
+ };
501
+ isEffectExpr = (node) => exprKind(node) === "EffectExpr";
502
+ EffectExpr = class extends BaseExpr {
503
+ expr;
504
+ f;
505
+ kind = "EffectExpr";
506
+ constructor(expr, f) {
507
+ super();
508
+ this.expr = expr;
509
+ this.f = f;
510
+ return proxy(this);
511
+ }
512
+ [inspect]() {
513
+ return `${this.expr[inspect]()}.mapEffect(${this.f.toString()})`;
514
+ }
515
+ };
516
+ isNamedExpr = (node) => exprKind(node) === "NamedExpr";
517
+ NamedExpr = class extends BaseExpr {
518
+ expr;
519
+ bindingName;
520
+ kind = "NamedExpr";
521
+ constructor(expr, bindingName) {
522
+ super();
523
+ this.expr = expr;
524
+ this.bindingName = bindingName;
525
+ return proxy(this);
526
+ }
527
+ [inspect]() {
528
+ return this.bindingName;
529
+ }
530
+ };
531
+ isAllExpr = (node) => exprKind(node) === "AllExpr";
532
+ AllExpr = class extends BaseExpr {
533
+ outs;
534
+ kind = "AllExpr";
535
+ constructor(outs) {
536
+ super();
537
+ this.outs = outs;
538
+ return proxy(this);
539
+ }
540
+ [inspect]() {
541
+ return `all(${this.outs.map((out) => out[inspect]()).join(", ")})`;
542
+ }
543
+ };
544
+ isRefExpr = (node) => exprKind(node) === "RefExpr";
545
+ RefExpr = class extends BaseExpr {
546
+ stack;
547
+ stage;
548
+ resourceId;
549
+ kind = "RefExpr";
550
+ constructor(stack, stage$1, resourceId) {
551
+ super();
552
+ this.stack = stack;
553
+ this.stage = stage$1;
554
+ this.resourceId = resourceId;
555
+ return proxy(this);
556
+ }
557
+ [inspect]() {
558
+ return `ref(${this.resourceId}, { stack: ${this.stack}, stage: ${this.stage} })`;
559
+ }
560
+ };
561
+ isStackRefExpr = (node) => exprKind(node) === "StackRefExpr";
562
+ StackRefExpr = class extends BaseExpr {
563
+ stack;
564
+ stage;
565
+ kind = "StackRefExpr";
566
+ constructor(stack, stage$1) {
567
+ super();
568
+ this.stack = stack;
569
+ this.stage = stage$1;
570
+ return proxy(this);
571
+ }
572
+ [inspect]() {
573
+ return `stackRef(${this.stack}${this.stage ? `, { stage: ${this.stage} }` : ""})`;
574
+ }
575
+ };
576
+ stackRef = (stack, options = {}) => Effect.succeed(new StackRefExpr(stack, options.stage));
577
+ MissingSourceError = class extends Data.TaggedError("MissingSourceError") {};
578
+ InvalidReferenceError = class extends Data.TaggedError("InvalidReferenceError") {};
579
+ evaluate = (expr, upstream$1) => Effect.gen(function* () {
580
+ if (isResource(expr)) {
581
+ const srcId = expr.FQN;
725
582
  const src = upstream$1[srcId];
726
583
  if (!src) return yield* new MissingSourceError({
727
584
  message: `Source ${srcId} not found`,
728
585
  srcId
729
586
  });
730
587
  return src;
731
- } else if (isLiteralExpr(expr)) return expr.value;
732
- else if (isApplyExpr(expr)) return expr.f(yield* evaluate(expr.expr, upstream$1));
733
- else if (isEffectExpr(expr)) return yield* expr.f(yield* evaluate(expr.expr, upstream$1));
734
- else if (isFlatMapExpr(expr)) {
735
- const value = yield* evaluate(expr.expr, upstream$1);
736
- return yield* evaluate(expr.f(value), upstream$1);
737
- } else if (isAllExpr(expr)) return yield* Effect.all(expr.outs.map((out) => evaluate(out, upstream$1)));
738
- else if (isPropExpr(expr)) return (yield* evaluate(expr.expr, upstream$1))?.[expr.identifier];
739
- else if (isNamedExpr(expr)) return yield* evaluate(expr.expr, upstream$1);
740
- else if (isRefExpr(expr)) {
741
- const state = yield* yield* State;
742
- const stack = expr.stack ?? (yield* Stack).name;
743
- const stage$1 = expr.stage ?? (yield* Stage);
744
- const resource = yield* state.get({
745
- stack,
746
- stage: stage$1,
747
- fqn: expr.resourceId
748
- });
749
- if (!resource) return yield* Effect.fail(new InvalidReferenceError({
750
- message: `Reference to '${expr.resourceId}' in stack '${stack}' and stage '${stage$1}' not found. Have you deployed '${stage$1}' or '${stack}'?`,
751
- stack,
752
- stage: stage$1,
753
- resourceId: expr.resourceId
754
- }));
755
- return resource.attr ?? resource.output;
756
- } else if (isStackRefExpr(expr)) {
757
- const state = yield* yield* State;
758
- const stack = expr.stack;
759
- const stage$1 = expr.stage ?? (yield* Stage);
760
- const output = yield* state.getOutput({
761
- stack,
762
- stage: stage$1
763
- });
764
- if (output == null) return yield* Effect.fail(new InvalidReferenceError({
765
- message: `Reference to stack '${stack}' at stage '${stage$1}' not found. Have you deployed stage '${stage$1}' of '${stack}'?`,
766
- stack,
767
- stage: stage$1,
768
- resourceId: stack
769
- }));
770
- return output;
588
+ } else if (isOutput(expr)) {
589
+ if (isResourceExpr(expr)) {
590
+ const srcId = expr.src.FQN;
591
+ const src = upstream$1[srcId];
592
+ if (!src) return yield* new MissingSourceError({
593
+ message: `Source ${srcId} not found`,
594
+ srcId
595
+ });
596
+ return src;
597
+ } else if (isLiteralExpr(expr)) return expr.value;
598
+ else if (isApplyExpr(expr)) return expr.f(yield* evaluate(expr.expr, upstream$1));
599
+ else if (isEffectExpr(expr)) return yield* expr.f(yield* evaluate(expr.expr, upstream$1));
600
+ else if (isFlatMapExpr(expr)) {
601
+ const value = yield* evaluate(expr.expr, upstream$1);
602
+ return yield* evaluate(expr.f(value), upstream$1);
603
+ } else if (isAllExpr(expr)) return yield* Effect.all(expr.outs.map((out) => evaluate(out, upstream$1)));
604
+ else if (isPropExpr(expr)) return (yield* evaluate(expr.expr, upstream$1))?.[expr.identifier];
605
+ else if (isNamedExpr(expr)) return yield* evaluate(expr.expr, upstream$1);
606
+ else if (isRefExpr(expr)) {
607
+ const state = yield* yield* State;
608
+ const stack = expr.stack ?? (yield* Stack).name;
609
+ const stage$1 = expr.stage ?? (yield* Stage);
610
+ const resource = yield* state.get({
611
+ stack,
612
+ stage: stage$1,
613
+ fqn: expr.resourceId
614
+ });
615
+ if (!resource) return yield* Effect.fail(new InvalidReferenceError({
616
+ message: `Reference to '${expr.resourceId}' in stack '${stack}' and stage '${stage$1}' not found. Have you deployed '${stage$1}' or '${stack}'?`,
617
+ stack,
618
+ stage: stage$1,
619
+ resourceId: expr.resourceId
620
+ }));
621
+ return resource.attr ?? resource.output;
622
+ } else if (isStackRefExpr(expr)) {
623
+ const state = yield* yield* State;
624
+ const stack = expr.stack;
625
+ const stage$1 = expr.stage ?? (yield* Stage);
626
+ const output = yield* state.getOutput({
627
+ stack,
628
+ stage: stage$1
629
+ });
630
+ if (output == null) return yield* Effect.fail(new InvalidReferenceError({
631
+ message: `Reference to stack '${stack}' at stage '${stage$1}' not found. Have you deployed stage '${stage$1}' of '${stack}'?`,
632
+ stack,
633
+ stage: stage$1,
634
+ resourceId: stack
635
+ }));
636
+ return output;
637
+ }
771
638
  }
772
- }
773
- if (Array.isArray(expr)) return yield* Effect.all(expr.map((item) => evaluate(item, upstream$1)));
774
- else if (Config.isConfig(expr)) return yield* evaluate(yield* expr, upstream$1);
775
- else if (Duration.isDuration(expr) || Redacted.isRedacted(expr)) return expr;
776
- else if (typeof expr === "object" && expr !== null) return Object.fromEntries(yield* Effect.all(Object.entries(expr).map(([key, value]) => evaluate(value, upstream$1).pipe(Effect.map((value$1) => [key, value$1])))));
777
- return expr;
778
- });
779
- const hasOutputs = (value) => Object.keys(upstreamAny(value)).length > 0;
780
- const upstreamAny = (value) => {
781
- if (isResource(value)) return { [value.FQN]: value };
782
- else if (isExpr(value)) return upstream(value);
783
- else if (Array.isArray(value)) return Object.assign({}, ...value.map(resolveUpstream));
784
- else if (value && (typeof value === "object" || typeof value === "function")) return Object.assign({}, ...Object.values(value).map((value$1) => resolveUpstream(value$1)));
785
- return {};
786
- };
787
- const upstream = (expr) => {
788
- if (isResource(expr)) return { [expr.FQN]: expr };
789
- else if (isResourceExpr(expr)) return { [expr.src.FQN]: expr.src };
790
- else if (isPropExpr(expr)) return upstream(expr.expr);
791
- else if (isAllExpr(expr)) return Object.assign({}, ...expr.outs.map((out) => upstream(out)));
792
- else if (isEffectExpr(expr) || isApplyExpr(expr) || isFlatMapExpr(expr) || isNamedExpr(expr)) return upstream(expr.expr);
793
- else if (Array.isArray(expr)) return expr.map(upstream).reduce(toObject, {});
794
- else if (typeof expr === "object" && expr !== null) return Object.values(expr).map((v) => upstream(v)).reduce(toObject, {});
795
- return {};
796
- };
797
- const resolveUpstream = (value) => {
798
- if (isPrimitive(value)) return {};
799
- else if (isResource(value)) return { [value.FQN]: value };
800
- else if (isOutput(value)) return upstream(value);
801
- else if (Array.isArray(value)) return Object.fromEntries(value.map((v) => resolveUpstream(v)).flatMap(Object.entries));
802
- else if (typeof value === "object" || typeof value === "function") return Object.fromEntries(Object.values(value).map(resolveUpstream).flatMap(Object.entries));
803
- return {};
804
- };
805
- const toObject = (acc, v) => ({
806
- ...acc,
807
- ...v
808
- });
639
+ if (Array.isArray(expr)) return yield* Effect.all(expr.map((item) => evaluate(item, upstream$1)));
640
+ else if (Config.isConfig(expr)) return yield* evaluate(yield* expr, upstream$1);
641
+ else if (Duration.isDuration(expr) || Redacted.isRedacted(expr)) return expr;
642
+ else if (typeof expr === "object" && expr !== null) return Object.fromEntries(yield* Effect.all(Object.entries(expr).map(([key, value]) => evaluate(value, upstream$1).pipe(Effect.map((value$1) => [key, value$1])))));
643
+ return expr;
644
+ });
645
+ hasOutputs = (value) => Object.keys(upstreamAny(value)).length > 0;
646
+ upstreamAny = (value) => {
647
+ if (isResource(value)) return { [value.FQN]: value };
648
+ else if (isExpr(value)) return upstream(value);
649
+ else if (Array.isArray(value)) return Object.assign({}, ...value.map(resolveUpstream));
650
+ else if (value && (typeof value === "object" || typeof value === "function")) return Object.assign({}, ...Object.values(value).map((value$1) => resolveUpstream(value$1)));
651
+ return {};
652
+ };
653
+ upstream = (expr) => {
654
+ if (isResource(expr)) return { [expr.FQN]: expr };
655
+ else if (isResourceExpr(expr)) return { [expr.src.FQN]: expr.src };
656
+ else if (isPropExpr(expr)) return upstream(expr.expr);
657
+ else if (isAllExpr(expr)) return Object.assign({}, ...expr.outs.map((out) => upstream(out)));
658
+ else if (isEffectExpr(expr) || isApplyExpr(expr) || isFlatMapExpr(expr) || isNamedExpr(expr)) return upstream(expr.expr);
659
+ else if (Array.isArray(expr)) return expr.map(upstream).reduce(toObject, {});
660
+ else if (typeof expr === "object" && expr !== null) return Object.values(expr).map((v) => upstream(v)).reduce(toObject, {});
661
+ return {};
662
+ };
663
+ resolveUpstream = (value) => {
664
+ if (isPrimitive(value)) return {};
665
+ else if (isResource(value)) return { [value.FQN]: value };
666
+ else if (isOutput(value)) return upstream(value);
667
+ else if (Array.isArray(value)) return Object.fromEntries(value.map((v) => resolveUpstream(v)).flatMap(Object.entries));
668
+ else if (typeof value === "object" || typeof value === "function") return Object.fromEntries(Object.values(value).map(resolveUpstream).flatMap(Object.entries));
669
+ return {};
670
+ };
671
+ toObject = (acc, v) => ({
672
+ ...acc,
673
+ ...v
674
+ });
675
+ }) });
809
676
 
810
677
  //#endregion
811
678
  //#region lib/Util/ConfigProvider.js
812
- const loadConfigProvider = (envFile$1) => {
813
- if (Option.isSome(envFile$1)) return ConfigProvider.fromDotEnv({ path: envFile$1.value }).pipe(Effect.map((dotEnv) => ConfigProvider.orElse(dotEnv, ConfigProvider.fromEnv())));
814
- return Effect.gen(function* () {
815
- if (!(yield* (yield* FileSystem.FileSystem).exists(".env"))) return ConfigProvider.fromEnv();
816
- return ConfigProvider.orElse(yield* ConfigProvider.fromDotEnv({ path: ".env" }), ConfigProvider.fromEnv());
817
- });
818
- };
679
+ var loadConfigProvider;
680
+ var init_ConfigProvider = __esm({ "lib/Util/ConfigProvider.js": (() => {
681
+ loadConfigProvider = (envFile$1) => {
682
+ if (Option.isSome(envFile$1)) return ConfigProvider.fromDotEnv({ path: envFile$1.value }).pipe(Effect.map((dotEnv) => ConfigProvider.orElse(dotEnv, ConfigProvider.fromEnv())));
683
+ return Effect.gen(function* () {
684
+ if (!(yield* (yield* FileSystem.FileSystem).exists(".env"))) return ConfigProvider.fromEnv();
685
+ return ConfigProvider.orElse(yield* ConfigProvider.fromDotEnv({ path: ".env" }), ConfigProvider.fromEnv());
686
+ });
687
+ };
688
+ }) });
819
689
 
820
690
  //#endregion
821
691
  //#region lib/Util/effect.js
822
- const effectClass = ((impl) => impl === void 0 ? (innerImpl) => effectClass(innerImpl) : Object.assign(class {}, Effectable.Prototype({
823
- label: "alchemy/EffectClass",
824
- evaluate: () => impl
825
- })));
826
- const taggedFunction = (tag$1, fn) => {
827
- const overrides = { toString: () => `${tag$1.toString()}.${fn.name}` };
828
- return new Proxy(fn, {
829
- 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),
830
- has: (target, prop) => Reflect.has(overrides, prop) || Reflect.has(target, prop) || Reflect.has(tag$1, prop)
831
- });
832
- };
692
+ var effectClass, taggedFunction;
693
+ var init_effect = __esm({ "lib/Util/effect.js": (() => {
694
+ effectClass = ((impl) => impl === void 0 ? (innerImpl) => effectClass(innerImpl) : Object.assign(class {}, Effectable.Prototype({
695
+ label: "alchemy/EffectClass",
696
+ evaluate: () => impl
697
+ })));
698
+ taggedFunction = (tag$1, fn) => {
699
+ const overrides = { toString: () => `${tag$1.toString()}.${fn.name}` };
700
+ return new Proxy(fn, {
701
+ 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),
702
+ has: (target, prop) => Reflect.has(overrides, prop) || Reflect.has(target, prop) || Reflect.has(tag$1, prop)
703
+ });
704
+ };
705
+ }) });
833
706
 
834
707
  //#endregion
835
708
  //#region lib/Util/FileLogger.js
836
- const fileLogger = Effect.fn(function* (...segments) {
837
- const { dotAlchemy } = yield* AlchemyContext;
838
- const fs = yield* FileSystem.FileSystem;
839
- const path$1 = yield* Path;
840
- const logFile = path$1.join(dotAlchemy, "log", ...segments);
841
- yield* fs.makeDirectory(path$1.dirname(logFile), { recursive: true });
842
- return yield* Logger.formatLogFmt.pipe(Logger.toFile(logFile, { flag: "a" }));
843
- });
709
+ var fileLogger;
710
+ var init_FileLogger = __esm({ "lib/Util/FileLogger.js": (() => {
711
+ init_AlchemyContext();
712
+ fileLogger = Effect.fn(function* (...segments) {
713
+ const { dotAlchemy } = yield* AlchemyContext;
714
+ const fs = yield* FileSystem.FileSystem;
715
+ const path$1 = yield* Path;
716
+ const logFile = path$1.join(dotAlchemy, "log", ...segments);
717
+ yield* fs.makeDirectory(path$1.dirname(logFile), { recursive: true });
718
+ return yield* Logger.formatLogFmt.pipe(Logger.toFile(logFile, { flag: "a" }));
719
+ });
720
+ }) });
844
721
 
845
722
  //#endregion
846
723
  //#region lib/Util/PlatformServices.js
847
- const isBun = typeof Bun !== "undefined";
848
- /**
849
- * Constructs a layer with different implementations for Bun and Node.
850
- */
851
- const platformLayer = (constructors) => Layer.unwrap(Effect.promise(async () => {
852
- if (isBun) return await constructors.bun();
853
- else return await constructors.node();
854
- }));
855
- const PlatformServices = platformLayer({
856
- bun: async () => {
857
- const [BunServices, BunSocket] = await Promise.all([import("@effect/platform-bun/BunServices"), import("@effect/platform-bun/BunSocket")]);
858
- return Layer.merge(BunServices.layer, BunSocket.layerWebSocketConstructor);
859
- },
860
- node: async () => {
861
- const [NodeServices, NodeSocket] = await Promise.all([import("@effect/platform-node/NodeServices"), import("@effect/platform-node/NodeSocket")]);
862
- return Layer.merge(NodeServices.layer, NodeSocket.layerWebSocketConstructor);
863
- }
864
- });
865
- const runMain = (effect, options) => {
866
- if (isBun) import("@effect/platform-bun/BunRuntime").then((BunRuntime) => BunRuntime.runMain(effect, options));
867
- else import("@effect/platform-node/NodeRuntime").then((NodeRuntime) => NodeRuntime.runMain(effect, options));
868
- };
724
+ var isBun, platformLayer, PlatformServices, runMain;
725
+ var init_PlatformServices = __esm({ "lib/Util/PlatformServices.js": (() => {
726
+ isBun = typeof Bun !== "undefined";
727
+ platformLayer = (constructors) => Layer.unwrap(Effect.promise(async () => {
728
+ if (isBun) return await constructors.bun();
729
+ else return await constructors.node();
730
+ }));
731
+ PlatformServices = platformLayer({
732
+ bun: async () => {
733
+ const [BunServices, BunSocket] = await Promise.all([import("@effect/platform-bun/BunServices"), import("@effect/platform-bun/BunSocket")]);
734
+ return Layer.merge(BunServices.layer, BunSocket.layerWebSocketConstructor);
735
+ },
736
+ node: async () => {
737
+ const [NodeServices, NodeSocket] = await Promise.all([import("@effect/platform-node/NodeServices"), import("@effect/platform-node/NodeSocket")]);
738
+ return Layer.merge(NodeServices.layer, NodeSocket.layerWebSocketConstructor);
739
+ }
740
+ });
741
+ runMain = (effect, options) => {
742
+ if (isBun) import("@effect/platform-bun/BunRuntime").then((BunRuntime) => BunRuntime.runMain(effect, options));
743
+ else import("@effect/platform-node/NodeRuntime").then((NodeRuntime) => NodeRuntime.runMain(effect, options));
744
+ };
745
+ }) });
869
746
 
870
747
  //#endregion
871
748
  //#region lib/Stack.js
872
- const Stack = Object.assign(taggedFunction(EffectContext.Service()("Stack"), (stackName, options, eff) => {
873
- if (!stackName) return (stackName$1) => Object.assign(stackRef(stackName$1).pipe(effectClass), {
874
- stackName: stackName$1,
875
- stage: createStageProxy(stackName$1),
876
- state: options?.state,
877
- providers: options?.providers,
878
- make: (options$1, eff$1) => Stack(stackName$1, options$1, eff$1)
879
- });
880
- return eff.pipe(make$2({
881
- name: stackName,
882
- ...options
883
- }), (eff$1) => Object.assign(eff$1, {
884
- stackName,
885
- stage: createStageProxy(stackName),
886
- state: options?.state,
887
- providers: options?.providers
749
+ var Stack, createStageProxy, StackName, make$2, CurrentStack, platform;
750
+ var init_Stack = __esm({ "lib/Stack.js": (() => {
751
+ init_Credentials();
752
+ init_Profile();
753
+ init_Output();
754
+ init_Stage();
755
+ init_effect();
756
+ init_FileLogger();
757
+ init_PlatformServices();
758
+ Stack = Object.assign(taggedFunction(EffectContext.Service()("Stack"), (stackName, options, eff) => {
759
+ if (!stackName) return (stackName$1) => Object.assign(stackRef(stackName$1).pipe(effectClass), {
760
+ stackName: stackName$1,
761
+ stage: createStageProxy(stackName$1),
762
+ state: options?.state,
763
+ providers: options?.providers,
764
+ make: (options$1, eff$1) => Stack(stackName$1, options$1, eff$1)
765
+ });
766
+ return eff.pipe(make$2({
767
+ name: stackName,
768
+ ...options
769
+ }), (eff$1) => Object.assign(eff$1, {
770
+ stackName,
771
+ stage: createStageProxy(stackName),
772
+ state: options?.state,
773
+ providers: options?.providers
774
+ }));
888
775
  }));
889
- }));
890
- const createStageProxy = (stackName) => new Proxy({}, { get: (_, stage$1) => stackRef(stackName, { stage: stage$1 }) });
891
- const StackName = Stack.use((stack) => Effect.succeed(stack.name));
892
- const make$2 = (options) => (effect) => Effect.scope.pipe(Effect.flatMap((scope) => {
893
- 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.`));
894
- 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 }, ...)`));
895
- return options.providers.pipe(Layer.provideMerge(options.state), Layer.provideMerge(Layer.effect(Stack, Stage.pipe(Effect.map((stage$1) => options.stack ?? {
896
- name: options.name,
897
- stage: stage$1,
898
- resources: {},
899
- bindings: {},
900
- actions: {}
901
- })))), Layer.buildWithScope(scope));
902
- }), Effect.flatMap((context) => Effect.all([
903
- effect,
904
- Stack,
905
- Effect.context()
906
- ]).pipe(Effect.map(([output, stack, services$1]) => ({
907
- ...stack,
908
- output,
909
- services: EffectContext.merge(services$1, context)
910
- })), Effect.provideContext(context))));
911
- const CurrentStack = Effect.serviceOption(Stack).pipe(Effect.map(Option.getOrUndefined));
912
- const platform = Layer.mergeAll(PlatformServices, FetchHttpClient.layer, Logger.layer([fileLogger("out")], { mergeWithExisting: true }), Layer.provide(ProfileLive, PlatformServices), Layer.provide(CredentialsStoreLive, PlatformServices));
776
+ createStageProxy = (stackName) => new Proxy({}, { get: (_, stage$1) => stackRef(stackName, { stage: stage$1 }) });
777
+ StackName = Stack.use((stack) => Effect.succeed(stack.name));
778
+ make$2 = (options) => (effect) => Effect.scope.pipe(Effect.flatMap((scope) => {
779
+ 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.`));
780
+ 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 }, ...)`));
781
+ return options.providers.pipe(Layer.provideMerge(options.state), Layer.provideMerge(Layer.effect(Stack, Stage.pipe(Effect.map((stage$1) => options.stack ?? {
782
+ name: options.name,
783
+ stage: stage$1,
784
+ resources: {},
785
+ bindings: {},
786
+ actions: {}
787
+ })))), Layer.buildWithScope(scope));
788
+ }), Effect.flatMap((context) => Effect.all([
789
+ effect,
790
+ Stack,
791
+ Effect.context()
792
+ ]).pipe(Effect.map(([output, stack, services$1]) => ({
793
+ ...stack,
794
+ output,
795
+ services: EffectContext.merge(services$1, context)
796
+ })), Effect.provideContext(context))));
797
+ CurrentStack = Effect.serviceOption(Stack).pipe(Effect.map(Option.getOrUndefined));
798
+ platform = Layer.mergeAll(PlatformServices, FetchHttpClient.layer, Logger.layer([fileLogger("out")], { mergeWithExisting: true }), Layer.provide(ProfileLive, PlatformServices), Layer.provide(CredentialsStoreLive, PlatformServices));
799
+ }) });
913
800
 
914
801
  //#endregion
915
802
  //#region lib/Local/RpcSerialization.js
803
+ init_Output();
916
804
  const unwrapRpcHandlers = (handlers, streamKeys) => {
917
805
  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 && !Array.isArray(value) ? unwrapRpcHandlers(value) : value]));
918
806
  };
@@ -948,6 +836,8 @@ const serializeRpcArgs = (value) => {
948
836
 
949
837
  //#endregion
950
838
  //#region lib/Local/RpcProviderProxy.js
839
+ init_AlchemyContext();
840
+ init_Stack();
951
841
  var RpcProviderProxy = class extends EffectContext.Service()("alchemy/Local/RpcProviderProxy") {};
952
842
  const SPAWNER_URL_ENV_KEY = "ALCHEMY_RPC_SPAWNER_URL";
953
843
  const make$1 = Effect.fn(function* (spawnerUrl) {
@@ -979,6 +869,8 @@ const fromEnv = () => Layer.effect(RpcProviderProxy, Config.string(SPAWNER_URL_E
979
869
 
980
870
  //#endregion
981
871
  //#region lib/Diff.js
872
+ init_Output();
873
+ init_data();
982
874
  const isResolved = (value) => !_hasUnresolved(value);
983
875
  const _hasUnresolved = (value) => {
984
876
  if (value == null || isPrimitive(value)) return false;
@@ -1041,7 +933,10 @@ const generateInstanceId = () => Effect.sync(() => {
1041
933
 
1042
934
  //#endregion
1043
935
  //#region lib/Util/types.js
1044
- const asEffect = (effect) => typeof effect?.asEffect === "function" ? effect.asEffect() : Effect.isEffect(effect) ? effect : Effect.succeed(effect);
936
+ var asEffect;
937
+ var init_types = __esm({ "lib/Util/types.js": (() => {
938
+ asEffect = (effect) => typeof effect?.asEffect === "function" ? effect.asEffect() : Effect.isEffect(effect) ? effect : Effect.succeed(effect);
939
+ }) });
1045
940
 
1046
941
  //#endregion
1047
942
  //#region lib/Action.js
@@ -1126,23 +1021,8 @@ const recordOutcome = (baseAttrs, status, duration) => {
1126
1021
  };
1127
1022
 
1128
1023
  //#endregion
1129
- //#region lib/Util/sha256.js
1130
- const sha256 = (input) => Effect.promise(async () => {
1131
- const digest = await crypto.subtle.digest("SHA-256", toArrayBuffer(input));
1132
- return Array.from(new Uint8Array(digest)).map((b) => b.toString(16).padStart(2, "0")).join("");
1133
- });
1134
- /**
1135
- * Stable sha256 hex digest of a resolved Task input. Unlike
1136
- * {@link sha256Object} this does not stabilize key ordering — it hashes the
1137
- * raw `JSON.stringify(input ?? null)` so identical inputs map to identical
1138
- * hashes for caching/equality checks.
1139
- */
1140
- const hashInput = (input) => sha256(JSON.stringify(input ?? null));
1141
- const toArrayBuffer = (input) => {
1142
- if (input instanceof ArrayBuffer) return input;
1143
- if (typeof input === "string") return new TextEncoder().encode(input);
1144
- return input.buffer.slice(input.byteOffset, input.byteOffset + input.byteLength);
1145
- };
1024
+ //#region lib/State/index.js
1025
+ init_State();
1146
1026
 
1147
1027
  //#endregion
1148
1028
  //#region lib/Util/scc.js
@@ -1217,9 +1097,33 @@ const findCycleMembers = (edges) => {
1217
1097
  return cycleMembers;
1218
1098
  };
1219
1099
 
1100
+ //#endregion
1101
+ //#region lib/Util/sha256.js
1102
+ var sha256, hashInput, toArrayBuffer;
1103
+ var init_sha256 = __esm({ "lib/Util/sha256.js": (() => {
1104
+ sha256 = (input) => Effect.promise(async () => {
1105
+ const digest = await crypto.subtle.digest("SHA-256", toArrayBuffer(input));
1106
+ return Array.from(new Uint8Array(digest)).map((b) => b.toString(16).padStart(2, "0")).join("");
1107
+ });
1108
+ hashInput = (input) => sha256(JSON.stringify(input ?? null));
1109
+ toArrayBuffer = (input) => {
1110
+ if (input instanceof ArrayBuffer) return input;
1111
+ if (typeof input === "string") return new TextEncoder().encode(input);
1112
+ return input.buffer.slice(input.byteOffset, input.byteOffset + input.byteLength);
1113
+ };
1114
+ }) });
1115
+
1220
1116
  //#endregion
1221
1117
  //#region lib/Plan.js
1118
+ init_types();
1119
+ init_AdoptPolicy();
1120
+ init_AlchemyContext();
1121
+ init_Artifacts();
1222
1122
  init_FQN();
1123
+ init_Output();
1124
+ init_Provider();
1125
+ init_Resource();
1126
+ init_sha256();
1223
1127
  const make = (stack, options = {}) => Effect.gen(function* () {
1224
1128
  const state = yield* yield* State;
1225
1129
  const resources = Object.values(stack.resources);
@@ -1738,7 +1642,13 @@ var UnsatisfiedResourceCycle = class extends Data.TaggedError("UnsatisfiedResour
1738
1642
 
1739
1643
  //#endregion
1740
1644
  //#region lib/Apply.js
1645
+ init_Artifacts();
1741
1646
  init_Cli();
1647
+ init_Output();
1648
+ init_Provider();
1649
+ init_Stack();
1650
+ init_Stage();
1651
+ init_sha256();
1742
1652
  const provideLifecycleScope = (fqn, instanceId) => (effect) => Effect.serviceOption(ArtifactStore).pipe(Effect.map(Option.getOrElse(createArtifactStore)), Effect.flatMap((store) => effect.pipe(Effect.provideService(Artifacts, makeScopedArtifacts(store, fqn)), Effect.provideService(InstanceId, instanceId))));
1743
1653
  /**
1744
1654
  * Instruments a single provider lifecycle call with an OTel span
@@ -1800,7 +1710,7 @@ const executePlan = Effect.fn(function* (plan, tracker, terminalStatuses, sessio
1800
1710
  const waitForStableDeps = (fqns) => Effect.all(fqns.filter((fqn) => fqn in readyStable).map((fqn) => Deferred.await(readyStable[fqn])), { concurrency: "unbounded" });
1801
1711
  const failures = [];
1802
1712
  yield* Effect.all(Object.entries(allNodes).map(([fqn, node]) => node.kind === "action" ? executeActionNode(fqn, node, tracker, ready, readyStable, terminalStatuses, session, state, stackName, stage$1, getOutputs, waitForStableDeps, failures) : executeNode(fqn, node, tracker, ready, readyStable, terminalStatuses, session, state, stackName, stage$1, getOutputs, waitForDeps, failures, plan.cycleMembers.has(fqn))), { concurrency: "unbounded" });
1803
- if (failures.length > 0) yield* Effect.failCause(failures.map((f) => f.cause).reduce(Cause.combine));
1713
+ if (failures.length > 0) return yield* Effect.failCause(failures.map((f) => f.cause).reduce(Cause.combine));
1804
1714
  });
1805
1715
  const executeNode = (fqn, node, tracker, ready, readyStable, terminalStatuses, session, state, stackName, stage$1, getOutputs, waitForDeps, failures, inCycle) => Effect.gen(function* () {
1806
1716
  const logicalId = node.resource.LogicalId;
@@ -2528,7 +2438,7 @@ const collectGarbage = Effect.fn(function* (plan, session) {
2528
2438
  stage: stage$1,
2529
2439
  fqn
2530
2440
  });
2531
- yield* report("deleted");
2441
+ yield* report("retained");
2532
2442
  return;
2533
2443
  }
2534
2444
  yield* commit({
@@ -2687,8 +2597,7 @@ const printProfile = Effect.fn(function* (profile$1, stored, registry) {
2687
2597
  }
2688
2598
  });
2689
2599
  const importStack = Effect.fn(function* (main) {
2690
- const path$1 = yield* Path$1.Path;
2691
- const url = import.meta.resolve(path$1.resolve(main));
2600
+ const url = pathToFileURL((yield* Path$1.Path).resolve(main)).href;
2692
2601
  const stackEffect = (yield* Effect.promise(() => import(__rewriteRelativeImportExtension(url)))).default;
2693
2602
  if (!Effect.isEffect(stackEffect)) return yield* Effect.die(/* @__PURE__ */ new Error(`Main file '${main}' must export a default stack definition (export default Alchemy.Stack({...}))`));
2694
2603
  return stackEffect;
@@ -2696,7 +2605,15 @@ const importStack = Effect.fn(function* (main) {
2696
2605
 
2697
2606
  //#endregion
2698
2607
  //#region lib/Cli/commands/deploy.js
2608
+ init_AdoptPolicy();
2609
+ init_AlchemyContext();
2610
+ init_Artifacts();
2611
+ init_AuthProvider();
2612
+ init_Profile();
2699
2613
  init_Cli();
2614
+ init_Stage();
2615
+ init_ConfigProvider();
2616
+ init_FileLogger();
2700
2617
  const ExecStackOptions = Schema.Struct({
2701
2618
  main: Schema.String,
2702
2619
  stage: Schema.String,
@@ -2725,7 +2642,8 @@ const execStack = Effect.fn(function* ({ main, stage: stage$1, envFile: envFile$
2725
2642
  const services$1 = Layer.mergeAll(Layer.effect(AlchemyContext, AlchemyContext.pipe(Effect.map((ctx) => ({
2726
2643
  ...ctx,
2727
2644
  dev,
2728
- adopt: adopt$1
2645
+ adopt: adopt$1,
2646
+ updateStateStore: yes$1
2729
2647
  })))), Layer.succeed(AdoptPolicy, adopt$1), Layer.succeed(ArtifactStore, createArtifactStore()), Layer.succeed(AuthProviders, yield* Effect.serviceOption(AuthProviders).pipe(Effect.map(Option.getOrElse(() => ({}))))), ConfigProvider.layer(withProfileOverride(yield* loadConfigProvider(envFile$1), profile$1)), Logger.layer([fileLogger("out")], { mergeWithExisting: true }), Layer.succeed(Stage, stage$1));
2730
2648
  yield* Effect.gen(function* () {
2731
2649
  const cli = yield* Cli;
@@ -2746,7 +2664,7 @@ const execStack = Effect.fn(function* ({ main, stage: stage$1, envFile: envFile$
2746
2664
  }
2747
2665
  const outputs = yield* dev ? apply(updatePlan).pipe(Effect.catchCause((cause) => Cause.hasInterruptsOnly(cause) ? Effect.failCause(cause) : Console.error(`alchemy dev: apply failed; keeping dev alive so healthy resources keep serving.\n${Cause.pretty(cause)}`).pipe(Effect.as(void 0)))) : apply(updatePlan);
2748
2666
  if (outputs !== void 0) yield* Console.log(outputs);
2749
- if (dev) yield* Effect.never;
2667
+ if (dev) return yield* Effect.never;
2750
2668
  }
2751
2669
  }).pipe(Effect.provide(stack.services));
2752
2670
  }).pipe(Effect.provide(services$1));
@@ -2810,6 +2728,7 @@ const statusColor$1 = (status) => {
2810
2728
  case "updated":
2811
2729
  case "replaced": return green;
2812
2730
  case "deleted": return dim;
2731
+ case "retained": return dim;
2813
2732
  case "fail": return red;
2814
2733
  case "attaching":
2815
2734
  case "post-attach": return cyan;
@@ -2817,7 +2736,7 @@ const statusColor$1 = (status) => {
2817
2736
  }
2818
2737
  };
2819
2738
  const tag = (id) => bold(`[${id}]`);
2820
- const isTerminal = (status) => status === "created" || status === "updated" || status === "deleted" || status === "replaced" || status === "fail";
2739
+ const isTerminal = (status) => status === "created" || status === "updated" || status === "deleted" || status === "retained" || status === "replaced" || status === "fail";
2821
2740
  const formatPlanLines = (plan) => {
2822
2741
  const items = [...Object.values(plan.resources), ...Object.values(plan.deletions)];
2823
2742
  if (items.length === 0) return [bold("Plan:") + " no changes"];
@@ -3323,7 +3242,7 @@ function PlanProgress(props) {
3323
3242
  const status = t?.status ?? (row.action === "noop" ? "ran" : "pending");
3324
3243
  const color$1 = statusColor(status);
3325
3244
  const icon$1 = taskIcon(row.action, status, spinner);
3326
- const label = row.action === "delete" ? status === "deleted" ? "deleted" : "drop" : status === "ran" ? row.action === "noop" ? "skip" : "ran" : status === "running" ? "running" : status === "fail" ? "fail" : row.action === "noop" ? "skip" : "run";
3245
+ const label = row.action === "delete" ? status === "deleted" || status === "retained" ? status : "drop" : status === "ran" ? row.action === "noop" ? "skip" : "ran" : status === "running" ? "running" : status === "fail" ? "fail" : row.action === "noop" ? "skip" : "run";
3327
3246
  return jsxs(Box, {
3328
3247
  flexDirection: "column",
3329
3248
  children: [jsxs(Box, {
@@ -3427,6 +3346,7 @@ function statusColor(status) {
3427
3346
  case "updated": return "yellow";
3428
3347
  case "deleting":
3429
3348
  case "deleted": return "red";
3349
+ case "retained": return "gray";
3430
3350
  case "running":
3431
3351
  case "ran": return "cyan";
3432
3352
  case "skipped": return "gray";
@@ -3439,7 +3359,7 @@ function taskIcon(action, status, spinnerChar) {
3439
3359
  if (status === "fail") return "✗";
3440
3360
  if (status === "skipped") return "•";
3441
3361
  if (status === "ran") return action === "noop" ? "•" : "✓";
3442
- if (status === "deleted") return "✓";
3362
+ if (status === "deleted" || status === "retained") return "✓";
3443
3363
  if (action === "delete") return "-";
3444
3364
  if (action === "noop") return "•";
3445
3365
  return "λ";
@@ -3582,15 +3502,21 @@ var init_InkCLI = __esm({ "lib/Cli/tui/InkCLI.js": (() => {
3582
3502
 
3583
3503
  //#endregion
3584
3504
  //#region lib/Cli/selectCli.js
3505
+ init_interactive();
3585
3506
  const selectCli = () => isNonInteractive() ? LoggingCli : Layer.unwrap(Effect.promise(() => Promise.resolve().then(() => (init_InkCLI(), InkCLI_exports)).then((m) => m.inkCLI())));
3586
3507
 
3587
3508
  //#endregion
3588
3509
  //#region lib/Cli/exec.js
3510
+ init_AlchemyContext();
3511
+ init_Credentials();
3512
+ init_Profile();
3513
+ init_PlatformServices();
3589
3514
  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()))));
3590
3515
  const exec = () => execStack(Schema.decodeSync(ExecStackOptions)(JSON.parse(process.env.ALCHEMY_EXEC_OPTIONS))).pipe(Effect.provide(services), Effect.scoped);
3591
3516
 
3592
3517
  //#endregion
3593
3518
  //#region bin/exec.ts
3519
+ init_PlatformServices();
3594
3520
  exec().pipe(runMain);
3595
3521
 
3596
3522
  //#endregion