alchemy 2.0.0-beta.62 → 2.0.0-beta.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (489) hide show
  1. package/README.md +12 -12
  2. package/bin/exec.js +1959 -70
  3. package/bin/exec.js.map +1 -1
  4. package/lib/AWS/AuthProvider.js +1 -1
  5. package/lib/AWS/AuthProvider.js.map +1 -1
  6. package/lib/AWS/EC2/hosted.d.ts.map +1 -1
  7. package/lib/AWS/EC2/hosted.js +2 -1
  8. package/lib/AWS/EC2/hosted.js.map +1 -1
  9. package/lib/AWS/ECS/Task.d.ts.map +1 -1
  10. package/lib/AWS/ECS/Task.js +2 -1
  11. package/lib/AWS/ECS/Task.js.map +1 -1
  12. package/lib/AWS/Lambda/Function.d.ts.map +1 -1
  13. package/lib/AWS/Lambda/Function.js +13 -40
  14. package/lib/AWS/Lambda/Function.js.map +1 -1
  15. package/lib/AWS/Lambda/MicrovmRuntimeContext.d.ts.map +1 -1
  16. package/lib/AWS/Lambda/MicrovmRuntimeContext.js +9 -21
  17. package/lib/AWS/Lambda/MicrovmRuntimeContext.js.map +1 -1
  18. package/lib/Action.d.ts +8 -0
  19. package/lib/Action.d.ts.map +1 -1
  20. package/lib/Action.js +16 -5
  21. package/lib/Action.js.map +1 -1
  22. package/lib/ActionRuntimeContext.d.ts +14 -0
  23. package/lib/ActionRuntimeContext.d.ts.map +1 -0
  24. package/lib/ActionRuntimeContext.js +56 -0
  25. package/lib/ActionRuntimeContext.js.map +1 -0
  26. package/lib/Apply.d.ts.map +1 -1
  27. package/lib/Apply.js +40 -6
  28. package/lib/Apply.js.map +1 -1
  29. package/lib/Auth/AuthProvider.d.ts +3 -3
  30. package/lib/Auth/AuthProvider.d.ts.map +1 -1
  31. package/lib/Auth/AuthProvider.js +1 -1
  32. package/lib/Auth/AuthProvider.js.map +1 -1
  33. package/lib/Auth/Lock.d.ts.map +1 -1
  34. package/lib/Auth/Lock.js +5 -2
  35. package/lib/Auth/Lock.js.map +1 -1
  36. package/lib/Bundle/PurePlugin.d.ts.map +1 -1
  37. package/lib/Bundle/PurePlugin.js +26 -1
  38. package/lib/Bundle/PurePlugin.js.map +1 -1
  39. package/lib/Bundle/Vite.d.ts +2 -0
  40. package/lib/Bundle/Vite.d.ts.map +1 -1
  41. package/lib/Bundle/Vite.js +24 -1
  42. package/lib/Bundle/Vite.js.map +1 -1
  43. package/lib/Cli/LoggingCli.d.ts.map +1 -1
  44. package/lib/Cli/LoggingCli.js +7 -4
  45. package/lib/Cli/LoggingCli.js.map +1 -1
  46. package/lib/Cli/commands/_shared.d.ts +19 -0
  47. package/lib/Cli/commands/_shared.d.ts.map +1 -1
  48. package/lib/Cli/commands/_shared.js +22 -0
  49. package/lib/Cli/commands/_shared.js.map +1 -1
  50. package/lib/Cli/commands/login.d.ts +7 -3
  51. package/lib/Cli/commands/login.d.ts.map +1 -1
  52. package/lib/Cli/commands/login.js +70 -12
  53. package/lib/Cli/commands/login.js.map +1 -1
  54. package/lib/Cli/commands/profile.d.ts.map +1 -1
  55. package/lib/Cli/commands/profile.js +7 -20
  56. package/lib/Cli/commands/profile.js.map +1 -1
  57. package/lib/Cloudflare/AI/LanguageModel.js +21 -4
  58. package/lib/Cloudflare/AI/LanguageModel.js.map +1 -1
  59. package/lib/Cloudflare/AI/QuerySearchLocal.d.ts +37 -0
  60. package/lib/Cloudflare/AI/QuerySearchLocal.d.ts.map +1 -0
  61. package/lib/Cloudflare/AI/QuerySearchLocal.js +53 -0
  62. package/lib/Cloudflare/AI/QuerySearchLocal.js.map +1 -0
  63. package/lib/Cloudflare/AI/QuerySearchNamespaceLocal.d.ts +35 -0
  64. package/lib/Cloudflare/AI/QuerySearchNamespaceLocal.d.ts.map +1 -0
  65. package/lib/Cloudflare/AI/QuerySearchNamespaceLocal.js +47 -0
  66. package/lib/Cloudflare/AI/QuerySearchNamespaceLocal.js.map +1 -0
  67. package/lib/Cloudflare/AI/SearchHttpClient.d.ts +34 -0
  68. package/lib/Cloudflare/AI/SearchHttpClient.d.ts.map +1 -0
  69. package/lib/Cloudflare/AI/SearchHttpClient.js +262 -0
  70. package/lib/Cloudflare/AI/SearchHttpClient.js.map +1 -0
  71. package/lib/Cloudflare/AI/index.d.ts +2 -0
  72. package/lib/Cloudflare/AI/index.d.ts.map +1 -1
  73. package/lib/Cloudflare/AI/index.js +2 -0
  74. package/lib/Cloudflare/AI/index.js.map +1 -1
  75. package/lib/Cloudflare/Auth/AuthProvider.js +1 -1
  76. package/lib/Cloudflare/Auth/AuthProvider.js.map +1 -1
  77. package/lib/Cloudflare/Containers/ContainerBundle.d.ts.map +1 -1
  78. package/lib/Cloudflare/Containers/ContainerBundle.js +11 -1
  79. package/lib/Cloudflare/Containers/ContainerBundle.js.map +1 -1
  80. package/lib/Cloudflare/Containers/ContainerPlatform.d.ts.map +1 -1
  81. package/lib/Cloudflare/Containers/ContainerPlatform.js +12 -33
  82. package/lib/Cloudflare/Containers/ContainerPlatform.js.map +1 -1
  83. package/lib/Cloudflare/D1/QueryDatabaseHttpClient.d.ts +24 -0
  84. package/lib/Cloudflare/D1/QueryDatabaseHttpClient.d.ts.map +1 -0
  85. package/lib/Cloudflare/D1/QueryDatabaseHttpClient.js +106 -0
  86. package/lib/Cloudflare/D1/QueryDatabaseHttpClient.js.map +1 -0
  87. package/lib/Cloudflare/D1/QueryDatabaseLocal.d.ts +38 -0
  88. package/lib/Cloudflare/D1/QueryDatabaseLocal.d.ts.map +1 -0
  89. package/lib/Cloudflare/D1/QueryDatabaseLocal.js +54 -0
  90. package/lib/Cloudflare/D1/QueryDatabaseLocal.js.map +1 -0
  91. package/lib/Cloudflare/D1/index.d.ts +1 -0
  92. package/lib/Cloudflare/D1/index.d.ts.map +1 -1
  93. package/lib/Cloudflare/D1/index.js +1 -0
  94. package/lib/Cloudflare/D1/index.js.map +1 -1
  95. package/lib/Cloudflare/DNS/DnsHttp.d.ts +16 -1
  96. package/lib/Cloudflare/DNS/DnsHttp.d.ts.map +1 -1
  97. package/lib/Cloudflare/DNS/DnsHttp.js +6 -1
  98. package/lib/Cloudflare/DNS/DnsHttp.js.map +1 -1
  99. package/lib/Cloudflare/DNS/DnsLocal.d.ts +22 -0
  100. package/lib/Cloudflare/DNS/DnsLocal.d.ts.map +1 -0
  101. package/lib/Cloudflare/DNS/DnsLocal.js +31 -0
  102. package/lib/Cloudflare/DNS/DnsLocal.js.map +1 -0
  103. package/lib/Cloudflare/DNS/ReadDnsHttp.d.ts +3 -3
  104. package/lib/Cloudflare/DNS/ReadDnsHttp.d.ts.map +1 -1
  105. package/lib/Cloudflare/DNS/ReadDnsHttp.js +3 -4
  106. package/lib/Cloudflare/DNS/ReadDnsHttp.js.map +1 -1
  107. package/lib/Cloudflare/DNS/ReadDnsLocal.d.ts +32 -0
  108. package/lib/Cloudflare/DNS/ReadDnsLocal.d.ts.map +1 -0
  109. package/lib/Cloudflare/DNS/ReadDnsLocal.js +35 -0
  110. package/lib/Cloudflare/DNS/ReadDnsLocal.js.map +1 -0
  111. package/lib/Cloudflare/DNS/ReadWriteDnsHttp.d.ts +3 -3
  112. package/lib/Cloudflare/DNS/ReadWriteDnsHttp.d.ts.map +1 -1
  113. package/lib/Cloudflare/DNS/ReadWriteDnsHttp.js +4 -4
  114. package/lib/Cloudflare/DNS/ReadWriteDnsHttp.js.map +1 -1
  115. package/lib/Cloudflare/DNS/ReadWriteDnsLocal.d.ts +40 -0
  116. package/lib/Cloudflare/DNS/ReadWriteDnsLocal.d.ts.map +1 -0
  117. package/lib/Cloudflare/DNS/ReadWriteDnsLocal.js +43 -0
  118. package/lib/Cloudflare/DNS/ReadWriteDnsLocal.js.map +1 -0
  119. package/lib/Cloudflare/DNS/WriteDnsHttp.d.ts +3 -3
  120. package/lib/Cloudflare/DNS/WriteDnsHttp.d.ts.map +1 -1
  121. package/lib/Cloudflare/DNS/WriteDnsHttp.js +3 -4
  122. package/lib/Cloudflare/DNS/WriteDnsHttp.js.map +1 -1
  123. package/lib/Cloudflare/DNS/WriteDnsLocal.d.ts +38 -0
  124. package/lib/Cloudflare/DNS/WriteDnsLocal.d.ts.map +1 -0
  125. package/lib/Cloudflare/DNS/WriteDnsLocal.js +41 -0
  126. package/lib/Cloudflare/DNS/WriteDnsLocal.js.map +1 -0
  127. package/lib/Cloudflare/DNS/index.d.ts +3 -0
  128. package/lib/Cloudflare/DNS/index.d.ts.map +1 -1
  129. package/lib/Cloudflare/DNS/index.js +3 -0
  130. package/lib/Cloudflare/DNS/index.js.map +1 -1
  131. package/lib/Cloudflare/Flagship/ReadFlagsHttpClient.d.ts +27 -0
  132. package/lib/Cloudflare/Flagship/ReadFlagsHttpClient.d.ts.map +1 -0
  133. package/lib/Cloudflare/Flagship/ReadFlagsHttpClient.js +86 -0
  134. package/lib/Cloudflare/Flagship/ReadFlagsHttpClient.js.map +1 -0
  135. package/lib/Cloudflare/Flagship/ReadFlagsLocal.d.ts +41 -0
  136. package/lib/Cloudflare/Flagship/ReadFlagsLocal.d.ts.map +1 -0
  137. package/lib/Cloudflare/Flagship/ReadFlagsLocal.js +57 -0
  138. package/lib/Cloudflare/Flagship/ReadFlagsLocal.js.map +1 -0
  139. package/lib/Cloudflare/Flagship/index.d.ts +1 -0
  140. package/lib/Cloudflare/Flagship/index.d.ts.map +1 -1
  141. package/lib/Cloudflare/Flagship/index.js +1 -0
  142. package/lib/Cloudflare/Flagship/index.js.map +1 -1
  143. package/lib/Cloudflare/KV/NamespaceHttp.d.ts +16 -1
  144. package/lib/Cloudflare/KV/NamespaceHttp.d.ts.map +1 -1
  145. package/lib/Cloudflare/KV/NamespaceHttp.js +8 -2
  146. package/lib/Cloudflare/KV/NamespaceHttp.js.map +1 -1
  147. package/lib/Cloudflare/KV/NamespaceLocal.d.ts +22 -0
  148. package/lib/Cloudflare/KV/NamespaceLocal.d.ts.map +1 -0
  149. package/lib/Cloudflare/KV/NamespaceLocal.js +32 -0
  150. package/lib/Cloudflare/KV/NamespaceLocal.js.map +1 -0
  151. package/lib/Cloudflare/KV/ReadNamespaceHttp.d.ts +2 -2
  152. package/lib/Cloudflare/KV/ReadNamespaceHttp.d.ts.map +1 -1
  153. package/lib/Cloudflare/KV/ReadNamespaceHttp.js +5 -6
  154. package/lib/Cloudflare/KV/ReadNamespaceHttp.js.map +1 -1
  155. package/lib/Cloudflare/KV/ReadNamespaceLocal.d.ts +27 -0
  156. package/lib/Cloudflare/KV/ReadNamespaceLocal.d.ts.map +1 -0
  157. package/lib/Cloudflare/KV/ReadNamespaceLocal.js +30 -0
  158. package/lib/Cloudflare/KV/ReadNamespaceLocal.js.map +1 -0
  159. package/lib/Cloudflare/KV/ReadWriteNamespaceHttp.d.ts +3 -3
  160. package/lib/Cloudflare/KV/ReadWriteNamespaceHttp.d.ts.map +1 -1
  161. package/lib/Cloudflare/KV/ReadWriteNamespaceHttp.js +6 -6
  162. package/lib/Cloudflare/KV/ReadWriteNamespaceHttp.js.map +1 -1
  163. package/lib/Cloudflare/KV/ReadWriteNamespaceLocal.d.ts +34 -0
  164. package/lib/Cloudflare/KV/ReadWriteNamespaceLocal.d.ts.map +1 -0
  165. package/lib/Cloudflare/KV/ReadWriteNamespaceLocal.js +37 -0
  166. package/lib/Cloudflare/KV/ReadWriteNamespaceLocal.js.map +1 -0
  167. package/lib/Cloudflare/KV/WriteNamespaceHttp.d.ts +2 -2
  168. package/lib/Cloudflare/KV/WriteNamespaceHttp.d.ts.map +1 -1
  169. package/lib/Cloudflare/KV/WriteNamespaceHttp.js +5 -6
  170. package/lib/Cloudflare/KV/WriteNamespaceHttp.js.map +1 -1
  171. package/lib/Cloudflare/KV/WriteNamespaceLocal.d.ts +27 -0
  172. package/lib/Cloudflare/KV/WriteNamespaceLocal.d.ts.map +1 -0
  173. package/lib/Cloudflare/KV/WriteNamespaceLocal.js +30 -0
  174. package/lib/Cloudflare/KV/WriteNamespaceLocal.js.map +1 -0
  175. package/lib/Cloudflare/KV/index.d.ts +3 -0
  176. package/lib/Cloudflare/KV/index.d.ts.map +1 -1
  177. package/lib/Cloudflare/KV/index.js +3 -0
  178. package/lib/Cloudflare/KV/index.js.map +1 -1
  179. package/lib/Cloudflare/Queues/QueueHttp.d.ts +20 -1
  180. package/lib/Cloudflare/Queues/QueueHttp.d.ts.map +1 -1
  181. package/lib/Cloudflare/Queues/QueueHttp.js +2 -2
  182. package/lib/Cloudflare/Queues/QueueHttp.js.map +1 -1
  183. package/lib/Cloudflare/Queues/WriteQueueHttp.d.ts +9 -3
  184. package/lib/Cloudflare/Queues/WriteQueueHttp.d.ts.map +1 -1
  185. package/lib/Cloudflare/Queues/WriteQueueHttp.js +11 -6
  186. package/lib/Cloudflare/Queues/WriteQueueHttp.js.map +1 -1
  187. package/lib/Cloudflare/Queues/WriteQueueLocal.d.ts +36 -0
  188. package/lib/Cloudflare/Queues/WriteQueueLocal.d.ts.map +1 -0
  189. package/lib/Cloudflare/Queues/WriteQueueLocal.js +51 -0
  190. package/lib/Cloudflare/Queues/WriteQueueLocal.js.map +1 -0
  191. package/lib/Cloudflare/Queues/index.d.ts +1 -0
  192. package/lib/Cloudflare/Queues/index.d.ts.map +1 -1
  193. package/lib/Cloudflare/Queues/index.js +1 -0
  194. package/lib/Cloudflare/Queues/index.js.map +1 -1
  195. package/lib/Cloudflare/R2/BucketHttp.d.ts +15 -1
  196. package/lib/Cloudflare/R2/BucketHttp.d.ts.map +1 -1
  197. package/lib/Cloudflare/R2/BucketHttp.js +3 -3
  198. package/lib/Cloudflare/R2/BucketHttp.js.map +1 -1
  199. package/lib/Cloudflare/R2/BucketLocal.d.ts +21 -0
  200. package/lib/Cloudflare/R2/BucketLocal.d.ts.map +1 -0
  201. package/lib/Cloudflare/R2/BucketLocal.js +32 -0
  202. package/lib/Cloudflare/R2/BucketLocal.js.map +1 -0
  203. package/lib/Cloudflare/R2/ReadBucketHttp.d.ts +2 -2
  204. package/lib/Cloudflare/R2/ReadBucketHttp.d.ts.map +1 -1
  205. package/lib/Cloudflare/R2/ReadBucketHttp.js +4 -4
  206. package/lib/Cloudflare/R2/ReadBucketHttp.js.map +1 -1
  207. package/lib/Cloudflare/R2/ReadBucketLocal.d.ts +27 -0
  208. package/lib/Cloudflare/R2/ReadBucketLocal.d.ts.map +1 -0
  209. package/lib/Cloudflare/R2/ReadBucketLocal.js +30 -0
  210. package/lib/Cloudflare/R2/ReadBucketLocal.js.map +1 -0
  211. package/lib/Cloudflare/R2/ReadWriteBucketHttp.d.ts +2 -2
  212. package/lib/Cloudflare/R2/ReadWriteBucketHttp.d.ts.map +1 -1
  213. package/lib/Cloudflare/R2/ReadWriteBucketHttp.js +5 -4
  214. package/lib/Cloudflare/R2/ReadWriteBucketHttp.js.map +1 -1
  215. package/lib/Cloudflare/R2/ReadWriteBucketLocal.d.ts +30 -0
  216. package/lib/Cloudflare/R2/ReadWriteBucketLocal.d.ts.map +1 -0
  217. package/lib/Cloudflare/R2/ReadWriteBucketLocal.js +33 -0
  218. package/lib/Cloudflare/R2/ReadWriteBucketLocal.js.map +1 -0
  219. package/lib/Cloudflare/R2/WriteBucketHttp.d.ts +2 -2
  220. package/lib/Cloudflare/R2/WriteBucketHttp.d.ts.map +1 -1
  221. package/lib/Cloudflare/R2/WriteBucketHttp.js +4 -4
  222. package/lib/Cloudflare/R2/WriteBucketHttp.js.map +1 -1
  223. package/lib/Cloudflare/R2/WriteBucketLocal.d.ts +27 -0
  224. package/lib/Cloudflare/R2/WriteBucketLocal.d.ts.map +1 -0
  225. package/lib/Cloudflare/R2/WriteBucketLocal.js +30 -0
  226. package/lib/Cloudflare/R2/WriteBucketLocal.js.map +1 -0
  227. package/lib/Cloudflare/R2/index.d.ts +3 -0
  228. package/lib/Cloudflare/R2/index.d.ts.map +1 -1
  229. package/lib/Cloudflare/R2/index.js +3 -0
  230. package/lib/Cloudflare/R2/index.js.map +1 -1
  231. package/lib/Cloudflare/StateStore/Api.d.ts +2 -0
  232. package/lib/Cloudflare/Tunnel/ReadTunnel.d.ts +3 -3
  233. package/lib/Cloudflare/Tunnel/ReadTunnel.d.ts.map +1 -1
  234. package/lib/Cloudflare/Tunnel/ReadTunnel.js +7 -8
  235. package/lib/Cloudflare/Tunnel/ReadTunnel.js.map +1 -1
  236. package/lib/Cloudflare/Tunnel/ReadTunnelLocal.d.ts +29 -0
  237. package/lib/Cloudflare/Tunnel/ReadTunnelLocal.d.ts.map +1 -0
  238. package/lib/Cloudflare/Tunnel/ReadTunnelLocal.js +30 -0
  239. package/lib/Cloudflare/Tunnel/ReadTunnelLocal.js.map +1 -0
  240. package/lib/Cloudflare/Tunnel/ReadWriteTunnel.d.ts +3 -3
  241. package/lib/Cloudflare/Tunnel/ReadWriteTunnel.d.ts.map +1 -1
  242. package/lib/Cloudflare/Tunnel/ReadWriteTunnel.js +4 -4
  243. package/lib/Cloudflare/Tunnel/ReadWriteTunnel.js.map +1 -1
  244. package/lib/Cloudflare/Tunnel/ReadWriteTunnelLocal.d.ts +35 -0
  245. package/lib/Cloudflare/Tunnel/ReadWriteTunnelLocal.d.ts.map +1 -0
  246. package/lib/Cloudflare/Tunnel/ReadWriteTunnelLocal.js +36 -0
  247. package/lib/Cloudflare/Tunnel/ReadWriteTunnelLocal.js.map +1 -0
  248. package/lib/Cloudflare/Tunnel/TunnelBinding.d.ts +17 -1
  249. package/lib/Cloudflare/Tunnel/TunnelBinding.d.ts.map +1 -1
  250. package/lib/Cloudflare/Tunnel/TunnelBinding.js +7 -1
  251. package/lib/Cloudflare/Tunnel/TunnelBinding.js.map +1 -1
  252. package/lib/Cloudflare/Tunnel/TunnelLocalBinding.d.ts +19 -0
  253. package/lib/Cloudflare/Tunnel/TunnelLocalBinding.d.ts.map +1 -0
  254. package/lib/Cloudflare/Tunnel/TunnelLocalBinding.js +29 -0
  255. package/lib/Cloudflare/Tunnel/TunnelLocalBinding.js.map +1 -0
  256. package/lib/Cloudflare/Tunnel/WarpConnector.d.ts +3 -3
  257. package/lib/Cloudflare/Tunnel/WarpConnector.d.ts.map +1 -1
  258. package/lib/Cloudflare/Tunnel/WarpConnector.js +7 -4
  259. package/lib/Cloudflare/Tunnel/WarpConnector.js.map +1 -1
  260. package/lib/Cloudflare/Tunnel/WriteTunnel.d.ts +3 -3
  261. package/lib/Cloudflare/Tunnel/WriteTunnel.d.ts.map +1 -1
  262. package/lib/Cloudflare/Tunnel/WriteTunnel.js +7 -8
  263. package/lib/Cloudflare/Tunnel/WriteTunnel.js.map +1 -1
  264. package/lib/Cloudflare/Tunnel/WriteTunnelLocal.d.ts +29 -0
  265. package/lib/Cloudflare/Tunnel/WriteTunnelLocal.d.ts.map +1 -0
  266. package/lib/Cloudflare/Tunnel/WriteTunnelLocal.js +30 -0
  267. package/lib/Cloudflare/Tunnel/WriteTunnelLocal.js.map +1 -0
  268. package/lib/Cloudflare/Tunnel/index.d.ts +3 -0
  269. package/lib/Cloudflare/Tunnel/index.d.ts.map +1 -1
  270. package/lib/Cloudflare/Tunnel/index.js +3 -0
  271. package/lib/Cloudflare/Tunnel/index.js.map +1 -1
  272. package/lib/Cloudflare/Vectorize/SearchIndexHttpClient.d.ts +30 -0
  273. package/lib/Cloudflare/Vectorize/SearchIndexHttpClient.d.ts.map +1 -0
  274. package/lib/Cloudflare/Vectorize/SearchIndexHttpClient.js +100 -0
  275. package/lib/Cloudflare/Vectorize/SearchIndexHttpClient.js.map +1 -0
  276. package/lib/Cloudflare/Vectorize/SearchIndexLocal.d.ts +42 -0
  277. package/lib/Cloudflare/Vectorize/SearchIndexLocal.d.ts.map +1 -0
  278. package/lib/Cloudflare/Vectorize/SearchIndexLocal.js +58 -0
  279. package/lib/Cloudflare/Vectorize/SearchIndexLocal.js.map +1 -0
  280. package/lib/Cloudflare/Vectorize/index.d.ts +1 -0
  281. package/lib/Cloudflare/Vectorize/index.d.ts.map +1 -1
  282. package/lib/Cloudflare/Vectorize/index.js +1 -0
  283. package/lib/Cloudflare/Vectorize/index.js.map +1 -1
  284. package/lib/Cloudflare/Workers/BrowserHttpClient.d.ts +32 -0
  285. package/lib/Cloudflare/Workers/BrowserHttpClient.d.ts.map +1 -0
  286. package/lib/Cloudflare/Workers/BrowserHttpClient.js +100 -0
  287. package/lib/Cloudflare/Workers/BrowserHttpClient.js.map +1 -0
  288. package/lib/Cloudflare/Workers/BrowserLocal.d.ts +37 -0
  289. package/lib/Cloudflare/Workers/BrowserLocal.d.ts.map +1 -0
  290. package/lib/Cloudflare/Workers/BrowserLocal.js +53 -0
  291. package/lib/Cloudflare/Workers/BrowserLocal.js.map +1 -0
  292. package/lib/Cloudflare/Workers/ConfigProvider.d.ts +8 -0
  293. package/lib/Cloudflare/Workers/ConfigProvider.d.ts.map +1 -1
  294. package/lib/Cloudflare/Workers/ConfigProvider.js +10 -1
  295. package/lib/Cloudflare/Workers/ConfigProvider.js.map +1 -1
  296. package/lib/Cloudflare/Workers/DurableObject.d.ts +137 -3
  297. package/lib/Cloudflare/Workers/DurableObject.d.ts.map +1 -1
  298. package/lib/Cloudflare/Workers/DurableObject.js +141 -6
  299. package/lib/Cloudflare/Workers/DurableObject.js.map +1 -1
  300. package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts +2 -185
  301. package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
  302. package/lib/Cloudflare/Workers/Vite.d.ts.map +1 -1
  303. package/lib/Cloudflare/Workers/Vite.js +81 -2
  304. package/lib/Cloudflare/Workers/Vite.js.map +1 -1
  305. package/lib/Cloudflare/Workers/Worker.d.ts +15 -1
  306. package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
  307. package/lib/Cloudflare/Workers/Worker.js.map +1 -1
  308. package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts.map +1 -1
  309. package/lib/Cloudflare/Workers/WorkerAsyncBindings.js +2 -1
  310. package/lib/Cloudflare/Workers/WorkerAsyncBindings.js.map +1 -1
  311. package/lib/Cloudflare/Workers/WorkerBinding.d.ts +22 -1
  312. package/lib/Cloudflare/Workers/WorkerBinding.d.ts.map +1 -1
  313. package/lib/Cloudflare/Workers/WorkerBinding.js.map +1 -1
  314. package/lib/Cloudflare/Workers/WorkerBridge.d.ts.map +1 -1
  315. package/lib/Cloudflare/Workers/WorkerBridge.js +7 -2
  316. package/lib/Cloudflare/Workers/WorkerBridge.js.map +1 -1
  317. package/lib/Cloudflare/Workers/WorkerProvider.d.ts +81 -0
  318. package/lib/Cloudflare/Workers/WorkerProvider.d.ts.map +1 -1
  319. package/lib/Cloudflare/Workers/WorkerProvider.js +450 -61
  320. package/lib/Cloudflare/Workers/WorkerProvider.js.map +1 -1
  321. package/lib/Cloudflare/Workers/WorkerRuntimeContext.d.ts.map +1 -1
  322. package/lib/Cloudflare/Workers/WorkerRuntimeContext.js +11 -37
  323. package/lib/Cloudflare/Workers/WorkerRuntimeContext.js.map +1 -1
  324. package/lib/Cloudflare/Workers/index.d.ts +1 -0
  325. package/lib/Cloudflare/Workers/index.d.ts.map +1 -1
  326. package/lib/Cloudflare/Workers/index.js +1 -0
  327. package/lib/Cloudflare/Workers/index.js.map +1 -1
  328. package/lib/Diff.d.ts +16 -0
  329. package/lib/Diff.d.ts.map +1 -1
  330. package/lib/Diff.js +33 -0
  331. package/lib/Diff.js.map +1 -1
  332. package/lib/GitHub/Secrets.d.ts +1 -1
  333. package/lib/GitHub/Secrets.js +1 -1
  334. package/lib/GitHub/Variables.d.ts +1 -1
  335. package/lib/GitHub/Variables.js +1 -1
  336. package/lib/Local/RpcSerialization.d.ts.map +1 -1
  337. package/lib/Local/RpcSerialization.js +6 -2
  338. package/lib/Local/RpcSerialization.js.map +1 -1
  339. package/lib/Local/RpcSpawner.d.ts.map +1 -1
  340. package/lib/Local/RpcSpawner.js +14 -8
  341. package/lib/Local/RpcSpawner.js.map +1 -1
  342. package/lib/Neon/AuthProvider.js +1 -1
  343. package/lib/Neon/AuthProvider.js.map +1 -1
  344. package/lib/Plan.d.ts.map +1 -1
  345. package/lib/Plan.js +11 -4
  346. package/lib/Plan.js.map +1 -1
  347. package/lib/Planetscale/Database.d.ts +2 -1
  348. package/lib/Planetscale/Database.d.ts.map +1 -1
  349. package/lib/Planetscale/MySQL/MySQLClusterSize.d.ts +41 -3
  350. package/lib/Planetscale/MySQL/MySQLClusterSize.d.ts.map +1 -1
  351. package/lib/Planetscale/MySQL/MySQLClusterSize.js +88 -11
  352. package/lib/Planetscale/MySQL/MySQLClusterSize.js.map +1 -1
  353. package/lib/Planetscale/MySQL/MySQLDatabase.d.ts +14 -0
  354. package/lib/Planetscale/MySQL/MySQLDatabase.d.ts.map +1 -1
  355. package/lib/Planetscale/MySQL/MySQLDatabase.js +24 -11
  356. package/lib/Planetscale/MySQL/MySQLDatabase.js.map +1 -1
  357. package/lib/Platform.d.ts.map +1 -1
  358. package/lib/Platform.js +11 -1
  359. package/lib/Platform.js.map +1 -1
  360. package/lib/Runtime.d.ts +23 -0
  361. package/lib/Runtime.d.ts.map +1 -1
  362. package/lib/Runtime.js +83 -0
  363. package/lib/Runtime.js.map +1 -1
  364. package/lib/RuntimeContext.d.ts +46 -0
  365. package/lib/RuntimeContext.d.ts.map +1 -1
  366. package/lib/RuntimeContext.js +60 -0
  367. package/lib/RuntimeContext.js.map +1 -1
  368. package/lib/Server/Process.d.ts +1 -1
  369. package/lib/Server/Process.d.ts.map +1 -1
  370. package/lib/Server/Process.js +8 -8
  371. package/lib/Server/Process.js.map +1 -1
  372. package/lib/Stack.js +1 -1
  373. package/lib/Stack.js.map +1 -1
  374. package/lib/State/HttpStateApi.d.ts +10 -10
  375. package/lib/Test/Alchemy.d.ts +74 -0
  376. package/lib/Test/Alchemy.d.ts.map +1 -0
  377. package/lib/Test/Alchemy.js +143 -0
  378. package/lib/Test/Alchemy.js.map +1 -0
  379. package/lib/Util/cached-function.d.ts +1 -1
  380. package/lib/Util/cached-function.d.ts.map +1 -1
  381. package/lib/Util/cached-function.js +2 -2
  382. package/lib/Util/cached-function.js.map +1 -1
  383. package/lib/Util/proxy-chain.js +3 -0
  384. package/lib/Util/proxy-chain.js.map +1 -1
  385. package/package.json +10 -10
  386. package/src/AWS/AuthProvider.ts +1 -1
  387. package/src/AWS/EC2/hosted.ts +2 -1
  388. package/src/AWS/ECS/Task.ts +2 -1
  389. package/src/AWS/Lambda/Function.ts +13 -47
  390. package/src/AWS/Lambda/MicrovmRuntimeContext.ts +11 -38
  391. package/src/Action.ts +39 -6
  392. package/src/ActionRuntimeContext.ts +68 -0
  393. package/src/Apply.ts +46 -8
  394. package/src/Auth/AuthProvider.ts +1 -1
  395. package/src/Auth/Lock.ts +5 -2
  396. package/src/Bundle/PurePlugin.ts +34 -1
  397. package/src/Bundle/Vite.ts +51 -1
  398. package/src/Cli/LoggingCli.ts +7 -4
  399. package/src/Cli/commands/_shared.ts +52 -0
  400. package/src/Cli/commands/login.ts +90 -14
  401. package/src/Cli/commands/profile.ts +7 -41
  402. package/src/Cloudflare/AI/LanguageModel.ts +25 -5
  403. package/src/Cloudflare/AI/QuerySearchLocal.ts +66 -0
  404. package/src/Cloudflare/AI/QuerySearchNamespaceLocal.ts +60 -0
  405. package/src/Cloudflare/AI/SearchHttpClient.ts +423 -0
  406. package/src/Cloudflare/AI/index.ts +2 -0
  407. package/src/Cloudflare/Auth/AuthProvider.ts +1 -1
  408. package/src/Cloudflare/Containers/ContainerBundle.ts +11 -1
  409. package/src/Cloudflare/Containers/ContainerPlatform.ts +14 -52
  410. package/src/Cloudflare/D1/QueryDatabaseHttpClient.ts +176 -0
  411. package/src/Cloudflare/D1/QueryDatabaseLocal.ts +66 -0
  412. package/src/Cloudflare/D1/index.ts +1 -0
  413. package/src/Cloudflare/DNS/DnsHttp.ts +24 -2
  414. package/src/Cloudflare/DNS/DnsLocal.ts +41 -0
  415. package/src/Cloudflare/DNS/ReadDnsHttp.ts +4 -5
  416. package/src/Cloudflare/DNS/ReadDnsLocal.ts +38 -0
  417. package/src/Cloudflare/DNS/ReadWriteDnsHttp.ts +5 -5
  418. package/src/Cloudflare/DNS/ReadWriteDnsLocal.ts +46 -0
  419. package/src/Cloudflare/DNS/WriteDnsHttp.ts +4 -5
  420. package/src/Cloudflare/DNS/WriteDnsLocal.ts +44 -0
  421. package/src/Cloudflare/DNS/index.ts +3 -0
  422. package/src/Cloudflare/Flagship/ReadFlagsHttpClient.ts +183 -0
  423. package/src/Cloudflare/Flagship/ReadFlagsLocal.ts +69 -0
  424. package/src/Cloudflare/Flagship/index.ts +1 -0
  425. package/src/Cloudflare/KV/NamespaceHttp.ts +25 -2
  426. package/src/Cloudflare/KV/NamespaceLocal.ts +42 -0
  427. package/src/Cloudflare/KV/ReadNamespaceHttp.ts +7 -6
  428. package/src/Cloudflare/KV/ReadNamespaceLocal.ts +35 -0
  429. package/src/Cloudflare/KV/ReadWriteNamespaceHttp.ts +11 -6
  430. package/src/Cloudflare/KV/ReadWriteNamespaceLocal.ts +42 -0
  431. package/src/Cloudflare/KV/WriteNamespaceHttp.ts +7 -6
  432. package/src/Cloudflare/KV/WriteNamespaceLocal.ts +35 -0
  433. package/src/Cloudflare/KV/index.ts +3 -0
  434. package/src/Cloudflare/Queues/QueueHttp.ts +24 -2
  435. package/src/Cloudflare/Queues/WriteQueueHttp.ts +16 -7
  436. package/src/Cloudflare/Queues/WriteQueueLocal.ts +64 -0
  437. package/src/Cloudflare/Queues/index.ts +1 -0
  438. package/src/Cloudflare/R2/BucketHttp.ts +20 -3
  439. package/src/Cloudflare/R2/BucketLocal.ts +47 -0
  440. package/src/Cloudflare/R2/ReadBucketHttp.ts +10 -5
  441. package/src/Cloudflare/R2/ReadBucketLocal.ts +33 -0
  442. package/src/Cloudflare/R2/ReadWriteBucketHttp.ts +11 -5
  443. package/src/Cloudflare/R2/ReadWriteBucketLocal.ts +36 -0
  444. package/src/Cloudflare/R2/WriteBucketHttp.ts +10 -5
  445. package/src/Cloudflare/R2/WriteBucketLocal.ts +33 -0
  446. package/src/Cloudflare/R2/index.ts +3 -0
  447. package/src/Cloudflare/Tunnel/ReadTunnel.ts +8 -9
  448. package/src/Cloudflare/Tunnel/ReadTunnelLocal.ts +33 -0
  449. package/src/Cloudflare/Tunnel/ReadWriteTunnel.ts +5 -5
  450. package/src/Cloudflare/Tunnel/ReadWriteTunnelLocal.ts +39 -0
  451. package/src/Cloudflare/Tunnel/TunnelBinding.ts +26 -2
  452. package/src/Cloudflare/Tunnel/TunnelLocalBinding.ts +38 -0
  453. package/src/Cloudflare/Tunnel/WarpConnector.ts +8 -5
  454. package/src/Cloudflare/Tunnel/WriteTunnel.ts +8 -9
  455. package/src/Cloudflare/Tunnel/WriteTunnelLocal.ts +33 -0
  456. package/src/Cloudflare/Tunnel/index.ts +3 -0
  457. package/src/Cloudflare/Vectorize/SearchIndexHttpClient.ts +183 -0
  458. package/src/Cloudflare/Vectorize/SearchIndexLocal.ts +70 -0
  459. package/src/Cloudflare/Vectorize/index.ts +1 -0
  460. package/src/Cloudflare/Workers/BrowserHttpClient.ts +201 -0
  461. package/src/Cloudflare/Workers/BrowserLocal.ts +65 -0
  462. package/src/Cloudflare/Workers/ConfigProvider.ts +15 -1
  463. package/src/Cloudflare/Workers/DurableObject.ts +227 -6
  464. package/src/Cloudflare/Workers/Vite.ts +93 -11
  465. package/src/Cloudflare/Workers/Worker.ts +19 -1
  466. package/src/Cloudflare/Workers/WorkerAsyncBindings.ts +6 -5
  467. package/src/Cloudflare/Workers/WorkerBinding.ts +20 -1
  468. package/src/Cloudflare/Workers/WorkerBridge.ts +12 -2
  469. package/src/Cloudflare/Workers/WorkerProvider.ts +664 -117
  470. package/src/Cloudflare/Workers/WorkerRuntimeContext.ts +14 -45
  471. package/src/Cloudflare/Workers/index.ts +1 -0
  472. package/src/Diff.ts +33 -0
  473. package/src/GitHub/Secrets.ts +1 -1
  474. package/src/GitHub/Variables.ts +1 -1
  475. package/src/Local/RpcSerialization.ts +6 -2
  476. package/src/Local/RpcSpawner.ts +21 -8
  477. package/src/Neon/AuthProvider.ts +1 -1
  478. package/src/Plan.ts +17 -4
  479. package/src/Planetscale/Database.ts +2 -1
  480. package/src/Planetscale/MySQL/MySQLClusterSize.ts +120 -21
  481. package/src/Planetscale/MySQL/MySQLDatabase.ts +84 -44
  482. package/src/Platform.ts +12 -3
  483. package/src/Runtime.ts +92 -0
  484. package/src/RuntimeContext.ts +79 -0
  485. package/src/Server/Process.ts +11 -18
  486. package/src/Stack.ts +1 -1
  487. package/src/Test/Alchemy.ts +282 -0
  488. package/src/Util/cached-function.ts +5 -5
  489. package/src/Util/proxy-chain.ts +3 -0
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "alchemy",
3
- "version": "2.0.0-beta.62",
3
+ "version": "2.0.0-beta.63",
4
4
  "homepage": "https://alchemy.run",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Sam Goodwin <sam@alchemy.run>",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/alchemy-run/alchemy-effect.git",
9
+ "url": "git+https://github.com/alchemy-run/alchemy.git",
10
10
  "directory": "packages/alchemy"
11
11
  },
12
12
  "bin": {
@@ -26,8 +26,7 @@
26
26
  "bundle": "tsdown",
27
27
  "bundle:watch": "tsdown --watch",
28
28
  "publish:npm": "cp ../README.md . && bun publish && rm README.md",
29
- "test": "vitest run",
30
- "test:fast": "FAST=1 vitest run",
29
+ "test": "alchemy-test",
31
30
  "test:benchmark": "tsx --tsconfig tsconfig.test.json test/types.benchmark.ts",
32
31
  "nuke": "cd ../../ && bun nuke"
33
32
  },
@@ -313,15 +312,15 @@
313
312
  "@alchemy.run/node-utils": "0.0.5",
314
313
  "@aws-sdk/credential-providers": "^3.0.0",
315
314
  "@clack/prompts": "^0.11.0",
316
- "@distilled.cloud/aws": "0.29.0",
317
- "@distilled.cloud/axiom": "0.29.0",
318
- "@distilled.cloud/cloudflare": "0.29.0",
315
+ "@distilled.cloud/aws": "0.29.1",
316
+ "@distilled.cloud/axiom": "0.29.1",
317
+ "@distilled.cloud/cloudflare": "0.29.1",
319
318
  "@distilled.cloud/cloudflare-rolldown-plugin": "0.13.5",
320
319
  "@distilled.cloud/cloudflare-runtime": "0.13.5",
321
320
  "@distilled.cloud/cloudflare-vite-plugin": "0.13.5",
322
- "@distilled.cloud/core": "0.29.0",
323
- "@distilled.cloud/neon": "0.29.0",
324
- "@distilled.cloud/planetscale": "0.29.0",
321
+ "@distilled.cloud/core": "0.29.1",
322
+ "@distilled.cloud/neon": "0.29.1",
323
+ "@distilled.cloud/planetscale": "0.29.1",
325
324
  "@effect/vitest": ">=4.0.0-beta.97|| >=4.0.0",
326
325
  "@libsql/client": "^0.17.0",
327
326
  "@octokit/rest": "^22.0.1",
@@ -348,6 +347,7 @@
348
347
  "yaml": "^2.0.0"
349
348
  },
350
349
  "devDependencies": {
350
+ "alchemy-test": "0.0.0",
351
351
  "@clack/prompts": "^0.11.0",
352
352
  "@cloudflare/containers": "^0.3.7",
353
353
  "@cloudflare/puppeteer": "^1.1.0",
@@ -272,7 +272,7 @@ export const AwsAuth = AuthProviderLayer<
272
272
  ? Effect.fail(
273
273
  new AuthError({
274
274
  message:
275
- "AWS stored credentials not found. Run: alchemy-effect login --configure",
275
+ "AWS stored credentials not found. Run: alchemy login --configure",
276
276
  }),
277
277
  )
278
278
  : Effect.succeed({
@@ -188,6 +188,7 @@ export const createEc2HostedSupport = ({
188
188
  import { BunServices } from "@effect/platform-bun";
189
189
  import { BunHttpServer } from "alchemy/Http";
190
190
  import { Stack } from "alchemy/Stack";
191
+ import { reifyBoundConfigProvider } from "alchemy/Runtime";
191
192
  import * as Config from "effect/Config";
192
193
  import * as ConfigProvider from "effect/ConfigProvider";
193
194
  import * as Credentials from "@distilled.cloud/aws/Credentials";
@@ -233,7 +234,7 @@ const program = handler.pipe(
233
234
  Layer.provideMerge(
234
235
  Layer.succeed(
235
236
  ConfigProvider.ConfigProvider,
236
- ConfigProvider.fromEnv()
237
+ reifyBoundConfigProvider(ConfigProvider.fromEnv(), process.env)
237
238
  )
238
239
  ),
239
240
  )
@@ -585,6 +585,7 @@ export const TaskProvider = () =>
585
585
  import { BunServices } from "@effect/platform-bun";
586
586
  import { BunHttpServer } from "alchemy/Http";
587
587
  import { Stack } from "alchemy/Stack";
588
+ import { reifyBoundConfigProvider } from "alchemy/Runtime";
588
589
  import * as Config from "effect/Config";
589
590
  import * as ConfigProvider from "effect/ConfigProvider";
590
591
  import * as Credentials from "@distilled.cloud/aws/Credentials";
@@ -630,7 +631,7 @@ const program = handler.pipe(
630
631
  Layer.provideMerge(
631
632
  Layer.succeed(
632
633
  ConfigProvider.ConfigProvider,
633
- ConfigProvider.fromEnv()
634
+ reifyBoundConfigProvider(ConfigProvider.fromEnv(), process.env)
634
635
  )
635
636
  ),
636
637
  )
@@ -38,6 +38,7 @@ import { Platform, type Main, type PlatformProps } from "../../Platform.ts";
38
38
  import type { LogLine, LogsInput } from "../../Provider.ts";
39
39
  import * as Provider from "../../Provider.ts";
40
40
  import { Resource, type ResourceBinding } from "../../Resource.ts";
41
+ import { packEnvValue, unpackEnvValue } from "../../RuntimeContext.ts";
41
42
  import { Self } from "../../Self.ts";
42
43
  import * as Serverless from "../../Serverless/index.ts";
43
44
  import { Stack } from "../../Stack.ts";
@@ -585,55 +586,17 @@ export const Function: Platform<
585
586
  set: (id: string, output: Output.Output) =>
586
587
  Effect.sync(() => {
587
588
  // Key is already canonical (see RuntimeContext.sanitizeKey); store it
588
- // verbatim.
589
+ // verbatim. `packEnvValue` marker-packs Redacted values so they
590
+ // survive the Output → Lambda env var round-trip.
589
591
  const key = id;
590
- // Preserve `Redacted`-ness across the Output → Lambda env var
591
- // round-trip. `JSON.stringify(Redacted)` would emit the literal
592
- // string `"<redacted>"` and lose the value, so secrets are
593
- // serialized with a `{_tag: "Redacted", value: ...}` marker
594
- // that the runtime `get` path detects and rebuilds.
595
- env[key] = output.pipe(
596
- Output.map((value) =>
597
- Redacted.isRedacted(value)
598
- ? JSON.stringify({
599
- _tag: "Redacted",
600
- value: Redacted.value(value),
601
- })
602
- : JSON.stringify(value),
603
- ),
604
- );
592
+ env[key] = output.pipe(Output.map(packEnvValue));
605
593
  return key;
606
594
  }),
607
595
  get: <T>(key: string) =>
608
- // Read the captured value straight from `process.env`. We must NOT
609
- // resolve through `Config.string` here: at runtime the ambient
610
- // `ConfigProvider` is the interceptor installed in `Platform.ts`,
611
- // whose runtime branch calls back into `ctx.get(key)`. Going through
612
- // `Config` would re-enter that interceptor for the same key and
613
- // recurse forever, allocating until the Lambda init OOMs. The Worker
614
- // runtime reads from `WorkerEnvironment` for the same reason.
615
- Effect.sync(() => {
616
- // Key is already canonical (see RuntimeContext.sanitizeKey).
617
- const val = process.env[key];
618
- if (val === undefined) {
619
- return undefined;
620
- }
621
- try {
622
- const value = JSON.parse(val);
623
- if (
624
- typeof value === "object" &&
625
- value?._tag === "Redacted" &&
626
- "value" in value
627
- ) {
628
- return Redacted.make(
629
- (value as { value: unknown }).value,
630
- ) as unknown as T;
631
- }
632
- return value as T;
633
- } catch {
634
- return val as unknown as T; // assume it's just a string
635
- }
636
- }),
596
+ // Key is already canonical (see RuntimeContext.sanitizeKey). Read
597
+ // straight from `process.env` — see `unpackEnvValue` for why this
598
+ // must never resolve through `Config.string`.
599
+ Effect.sync(() => unpackEnvValue<T>(process.env[key])),
637
600
  serve: (handler: HttpEffect) =>
638
601
  // @ts-ignore
639
602
  ctx.listen(makeFunctionHttpHandler(handler)),
@@ -940,7 +903,7 @@ export const FunctionProvider = () =>
940
903
  (importPath) => `
941
904
  import { layer as nodeServicesLayer } from "@effect/platform-node/NodeServices";
942
905
  import { Stack } from "alchemy/Stack";
943
- import { makeEntrypointLayer } from "alchemy/Runtime";
906
+ import { makeEntrypointLayer, reifyBoundConfigProvider } from "alchemy/Runtime";
944
907
  import { registerLambdaExtension } from "alchemy/AWS/Lambda/RuntimeExtension";
945
908
  import * as Config from "effect/Config";
946
909
  import * as ConfigProvider from "effect/ConfigProvider";
@@ -1001,7 +964,10 @@ const entryLayer = layer.pipe(
1001
964
  Layer.provideMerge(
1002
965
  Layer.succeed(
1003
966
  ConfigProvider.ConfigProvider,
1004
- ConfigProvider.fromEnv()
967
+ // Auto-bound \`Config\` values arrive in the env as
968
+ // \`{"_tag":"Redacted","value":...}\` markers; reify them so a \`Config\`
969
+ // re-read inside a handler decodes the raw source value.
970
+ reifyBoundConfigProvider(ConfigProvider.fromEnv(), process.env)
1005
971
  )
1006
972
  ),
1007
973
  Layer.provideMerge(
@@ -1,10 +1,12 @@
1
- import * as Config from "effect/Config";
2
1
  import * as Effect from "effect/Effect";
3
2
  import * as Option from "effect/Option";
4
- import * as Redacted from "effect/Redacted";
5
3
  import { HttpServer, type HttpEffect } from "../../Http.ts";
6
4
  import * as Output from "../../Output.ts";
7
5
  import { serveRpc } from "../../Rpc.ts";
6
+ import {
7
+ packEnvValueKeepRedacted,
8
+ unpackEnvValue,
9
+ } from "../../RuntimeContext.ts";
8
10
  import * as Server from "../../Server/index.ts";
9
11
 
10
12
  export const MicrovmImageTypeId = "AWS.Lambda.MicrovmImage" as const;
@@ -49,45 +51,16 @@ export const makeMicrovmRuntimeContext = (
49
51
  set: (bindingId: string, output: Output.Output) =>
50
52
  Effect.sync(() => {
51
53
  const key = bindingId.replaceAll(/[^a-zA-Z0-9]/g, "_");
52
- env[key] = output.pipe(
53
- Output.map((value) =>
54
- Redacted.isRedacted(value)
55
- ? Redacted.make(
56
- JSON.stringify({
57
- _tag: "Redacted",
58
- value: Redacted.value(value),
59
- }),
60
- )
61
- : JSON.stringify(value),
62
- ),
63
- );
54
+ // `packEnvValueKeepRedacted` keeps the Redacted wrapper on the
55
+ // outside so deploy-time code can route secrets while the inner
56
+ // marker lets the runtime `get` accessor rebuild the wrapper.
57
+ env[key] = output.pipe(Output.map(packEnvValueKeepRedacted));
64
58
  return key;
65
59
  }),
66
60
  get: <T>(key: string) =>
67
- Config.string(key).pipe(
68
- Effect.flatMap((value) =>
69
- Effect.try({
70
- try: () => {
71
- const parsed = JSON.parse(value) as T;
72
- if (
73
- typeof parsed === "object" &&
74
- parsed !== null &&
75
- (parsed as { _tag?: unknown })._tag === "Redacted" &&
76
- "value" in parsed
77
- ) {
78
- return Redacted.make((parsed as { value: unknown }).value) as T;
79
- }
80
- return parsed;
81
- },
82
- catch: (error) => error as Error,
83
- }),
84
- ),
85
- Effect.catch((cause) =>
86
- Effect.die(
87
- new Error(`Failed to get environment variable: ${key}`, { cause }),
88
- ),
89
- ),
90
- ),
61
+ // Read straight from `process.env` — see `unpackEnvValue` for why
62
+ // this must never resolve through `Config.string`.
63
+ Effect.sync(() => unpackEnvValue<T>(process.env[key]) as T),
91
64
  run: ((effect: Effect.Effect<void, never, any>) =>
92
65
  Effect.sync(() => {
93
66
  runners.push(effect);
package/src/Action.ts CHANGED
@@ -2,10 +2,12 @@ import * as Context from "effect/Context";
2
2
  import * as Effect from "effect/Effect";
3
3
  import * as Layer from "effect/Layer";
4
4
  import type { Pipeable } from "effect/Pipeable";
5
+ import { makeCaptureContext } from "./ActionRuntimeContext.ts";
5
6
  import { toFqn } from "./FQN.ts";
6
7
  import type { Input } from "./Input.ts";
7
8
  import { CurrentNamespace, type NamespaceNode } from "./Namespace.ts";
8
9
  import * as Output from "./Output.ts";
10
+ import { RuntimeContext } from "./RuntimeContext.ts";
9
11
  import { Stack } from "./Stack.ts";
10
12
 
11
13
  /**
@@ -35,6 +37,14 @@ export interface ActionLike<
35
37
  readonly Type: Type;
36
38
  readonly LogicalId: string;
37
39
  readonly Input: In;
40
+ /**
41
+ * Resource Outputs referenced via `yield* output` inside the init Effect,
42
+ * keyed by the Output's sanitized key. They become dependency edges (the
43
+ * Action waits for these upstreams) and are resolved against the tracker at
44
+ * apply time, then exposed to the body through the resolve
45
+ * {@link RuntimeContext}. Empty when the Action captures nothing.
46
+ */
47
+ readonly Captures: Record<string, Output.Output>;
38
48
  /** Resolved runner — populated by the init effect (if any). */
39
49
  readonly Run: (input: In) => Effect.Effect<Out, any, any>;
40
50
  /** @internal phantom */
@@ -83,9 +93,14 @@ export type ActionInit<In extends object | undefined, Out, Req> = Effect.Effect<
83
93
  // const rows = yield* Sync({ table: bucket.name });
84
94
  // // rows: Output<{ rows: number }, never>
85
95
  //
86
- // Tagged form for split contract/implementation:
96
+ // Tagged form for split contract/implementation — declare the type with an
97
+ // interface, build the value with the no-arg overload, then supply the runner
98
+ // via `.make` (add the returned Layer to the stack's `providers`, or provide it
99
+ // locally with `Effect.provide`). The init passed to `.make` runs under the
100
+ // same capture context as the inline form, so `yield* output` accessors work:
87
101
  //
88
- // class Sync extends Action<Sync, { table: string }, { rows: number }>()("Sync") {}
102
+ // interface Sync extends Action<"Sync", { table: string }, { rows: number }> {}
103
+ // const Sync = Action<Sync, { table: string }, { rows: number }>()("Sync");
89
104
  // const SyncLive = Sync.make(Effect.gen(function* () { /* ... */ }));
90
105
 
91
106
  export function Action<
@@ -187,14 +202,23 @@ const makeActionClass = (
187
202
  `alchemy/Action<${type}>`,
188
203
  );
189
204
 
205
+ // Outputs referenced via `yield* output` inside the init Effect land here,
206
+ // recorded by the capture RuntimeContext. Shared per definition — the init
207
+ // runs at most once (Effect.cached), so captures are inherently
208
+ // per-definition, matching how the init's `Req` bubbles per definition.
209
+ const captures: Record<string, Output.Output> = {};
210
+ const captureContext = makeCaptureContext(captures);
211
+
190
212
  const constructor = (...args: [any] | [string, any]) => {
191
213
  const [id, input] =
192
214
  args.length === 1 ? [type, args[0]] : (args as [string, any]);
193
215
  return Effect.gen(function* () {
194
216
  const run = resolveRunner
195
- ? yield* resolveRunner
217
+ ? yield* resolveRunner.pipe(
218
+ Effect.provideService(RuntimeContext, captureContext),
219
+ )
196
220
  : ((yield* SelfTag!) as ActionRunner<any, any, any>);
197
- return yield* registerAction(type, id, input, run);
221
+ return yield* registerAction(type, id, input, run, captures);
198
222
  });
199
223
  };
200
224
 
@@ -203,12 +227,19 @@ const makeActionClass = (
203
227
  extra.Self = SelfTag;
204
228
  // `.make(initOrRun)` — accepts either a direct runner or an init Effect.
205
229
  // For init form we use `Layer.effect` so the init's Req surfaces on the
206
- // Layer; for runners we use `Layer.succeed`.
230
+ // Layer, and run it under the capture RuntimeContext so `yield* output`
231
+ // accessors are recorded just like the inline form; for runners we use
232
+ // `Layer.succeed` (nothing to capture).
207
233
  extra.make = <R>(
208
234
  initOrRun: ActionRunner<any, any, R> | ActionInit<any, any, R>,
209
235
  ) =>
210
236
  isRunnerEffect(initOrRun)
211
- ? Layer.effect(SelfTag, initOrRun as any)
237
+ ? Layer.effect(
238
+ SelfTag,
239
+ (initOrRun as ActionInit<any, any, R>).pipe(
240
+ Effect.provideService(RuntimeContext, captureContext),
241
+ ),
242
+ )
212
243
  : Layer.succeed(SelfTag, initOrRun as ActionRunner<any, any, any>);
213
244
  }
214
245
  return Object.assign(constructor, extra);
@@ -223,6 +254,7 @@ const registerAction = <
223
254
  id: string,
224
255
  input: any,
225
256
  run: ActionRunner<In, Out, any>,
257
+ captures: Record<string, Output.Output>,
226
258
  ): Effect.Effect<Output.ToOutput<Out, never>, never, Stack> =>
227
259
  Effect.gen(function* () {
228
260
  const stack = yield* Stack;
@@ -255,6 +287,7 @@ const registerAction = <
255
287
  FQN: fqn,
256
288
  LogicalId: id,
257
289
  Input: input,
290
+ Captures: captures,
258
291
  Run: run,
259
292
  Output: undefined as any,
260
293
  };
@@ -0,0 +1,68 @@
1
+ import * as Effect from "effect/Effect";
2
+ import type { Output } from "./Output.ts";
3
+ import { type BaseRuntimeContext, RuntimeContext } from "./RuntimeContext.ts";
4
+
5
+ /**
6
+ * Runtime context bridge that lets an {@link Action} read Resource Outputs.
7
+ *
8
+ * Actions are peculiar: their init Effect runs at plan/stack-eval time (before
9
+ * any resource exists) while their body runs at apply time (after upstreams are
10
+ * materialized). To make `yield* db.databaseId` work inside an Action we split
11
+ * the {@link RuntimeContext} into two cooperating halves that share nothing but
12
+ * a sanitized key:
13
+ *
14
+ * - {@link makeCaptureContext} is provided while the init Effect runs. Its
15
+ * `set(key, output)` records the referenced {@link Output} (so the engine can
16
+ * add a dependency edge and later resolve it) and its `get(key)` hands back a
17
+ * *deferred* accessor — an Effect that re-reads whatever `RuntimeContext` is
18
+ * ambient when it actually runs.
19
+ * - {@link makeResolveContext} is provided around the Action body at apply
20
+ * time. Its `get(key)` returns the already-resolved value for that key.
21
+ *
22
+ * Because the accessor produced at init re-reads `RuntimeContext`, yielding it
23
+ * inside the body resolves against the apply-time context — no shared mutable
24
+ * state, no infinite recursion (the resolve context's `get` is terminal).
25
+ */
26
+
27
+ const base = (id: string): Omit<BaseRuntimeContext, "get" | "set"> => ({
28
+ Type: "Action",
29
+ id,
30
+ env: {},
31
+ });
32
+
33
+ /**
34
+ * Capture context — provided while an Action's init Effect runs. Records every
35
+ * Output referenced via `yield* output` into `captures`, keyed by the Output's
36
+ * sanitized key, and returns deferred accessors.
37
+ */
38
+ export const makeCaptureContext = (
39
+ captures: Record<string, Output>,
40
+ ): BaseRuntimeContext => ({
41
+ ...base("capture"),
42
+ set: (key, output) =>
43
+ Effect.sync(() => {
44
+ captures[key] = output as unknown as Output;
45
+ return key;
46
+ }),
47
+ // Deferred: re-read the ambient RuntimeContext at run time. At apply this is
48
+ // the resolve context below; its `get` returns the materialized value. The
49
+ // `RuntimeContext` requirement is erased at the Action boundary (`Run` is
50
+ // typed `Effect<Out, any, any>`) and satisfied by the resolve context, so
51
+ // the accessor presents as `Effect<T | undefined>`.
52
+ get: (<T>(key: string) =>
53
+ Effect.flatMap(RuntimeContext, (ctx) =>
54
+ ctx.get<T>(key),
55
+ )) as BaseRuntimeContext["get"],
56
+ });
57
+
58
+ /**
59
+ * Resolve context — provided around an Action body at apply time. `resolved`
60
+ * maps each captured key to its value (already evaluated against the tracker).
61
+ */
62
+ export const makeResolveContext = (
63
+ resolved: Record<string, unknown>,
64
+ ): BaseRuntimeContext => ({
65
+ ...base("resolve"),
66
+ set: (key) => Effect.succeed(key),
67
+ get: <T>(key: string) => Effect.succeed(resolved[key] as T | undefined),
68
+ });
package/src/Apply.ts CHANGED
@@ -3,6 +3,9 @@ import * as Deferred from "effect/Deferred";
3
3
  import * as Effect from "effect/Effect";
4
4
  import * as Option from "effect/Option";
5
5
  import type { Simplify } from "effect/Types";
6
+ import type { ActionLike } from "./Action.ts";
7
+ import { makeResolveContext } from "./ActionRuntimeContext.ts";
8
+ import { RuntimeContext } from "./RuntimeContext.ts";
6
9
  import {
7
10
  Artifacts,
8
11
  ArtifactStore,
@@ -16,7 +19,7 @@ import {
16
19
  Cli,
17
20
  } from "./Cli/Cli.ts";
18
21
  import type { ApplyStatus } from "./Cli/Event.ts";
19
- import { havePropsChanged } from "./Diff.ts";
22
+ import { havePropsChanged, stripUnresolved } from "./Diff.ts";
20
23
  import type { Input } from "./Input.ts";
21
24
  import { generateInstanceId, InstanceId } from "./InstanceId.ts";
22
25
  import * as Output from "./Output.ts";
@@ -405,7 +408,14 @@ const executeNode = (
405
408
  stack: stackName,
406
409
  stage,
407
410
  fqn,
408
- value: { ...value, namespace } as S,
411
+ // Early commits (`creating`/`replacing`) persist plan props that may
412
+ // still hold unresolved Output exprs; strip them so state stores only
413
+ // plain data (see stripUnresolved in Diff.ts).
414
+ value: {
415
+ ...value,
416
+ props: stripUnresolved(value.props),
417
+ namespace,
418
+ } as S,
409
419
  });
410
420
 
411
421
  const scopedSession = {
@@ -1117,6 +1127,25 @@ const executeNode = (
1117
1127
  // `--force` is set). The output value is written to `tracker[fqn].output`
1118
1128
  // so downstream Output evaluation works identically to resource attrs.
1119
1129
 
1130
+ /**
1131
+ * Run an Action body, resolving any Outputs it captured via `yield* output`
1132
+ * during init against the current tracker and exposing them to the body through
1133
+ * the resolve {@link RuntimeContext}. See {@link makeCaptureContext}.
1134
+ */
1135
+ const runAction = Effect.fn("apply.runAction")(function* (
1136
+ task: ActionLike,
1137
+ input: any,
1138
+ outputs: Record<string, any>,
1139
+ ) {
1140
+ const resolved: Record<string, unknown> = {};
1141
+ for (const [key, output] of Object.entries(task.Captures)) {
1142
+ resolved[key] = yield* Output.evaluate(output, outputs);
1143
+ }
1144
+ return yield* task
1145
+ .Run(input)
1146
+ .pipe(Effect.provideService(RuntimeContext, makeResolveContext(resolved)));
1147
+ });
1148
+
1120
1149
  const executeActionNode = (
1121
1150
  fqn: string,
1122
1151
  node: ActionApply,
@@ -1195,9 +1224,12 @@ const executeActionNode = (
1195
1224
  // until its run actually starts.
1196
1225
  yield* report("pending");
1197
1226
  yield* waitForDeps(
1198
- Object.keys(Output.resolveUpstream(node.input)).filter(
1199
- (f) => f in readyStable,
1200
- ),
1227
+ [
1228
+ ...new Set([
1229
+ ...Object.keys(Output.resolveUpstream(node.input)),
1230
+ ...Object.keys(Output.upstreamAny(task.Captures)),
1231
+ ]),
1232
+ ].filter((f) => f in readyStable),
1201
1233
  );
1202
1234
 
1203
1235
  const outputs = getOutputs();
@@ -1216,7 +1248,7 @@ const executeActionNode = (
1216
1248
  });
1217
1249
  yield* report("running");
1218
1250
 
1219
- const result = yield* task.Run(resolvedInput);
1251
+ const result = yield* runAction(task, resolvedInput, outputs);
1220
1252
 
1221
1253
  yield* commit<RanActionState>({
1222
1254
  kind: "action",
@@ -1440,7 +1472,7 @@ const converge = Effect.fn(function* (
1440
1472
  } satisfies RunningActionState,
1441
1473
  });
1442
1474
 
1443
- const result = yield* node.def.Run(newInput);
1475
+ const result = yield* runAction(node.def, newInput, outputs);
1444
1476
 
1445
1477
  yield* state.set({
1446
1478
  stack: stackName,
@@ -1577,7 +1609,13 @@ const collectGarbage = Effect.fn(function* (
1577
1609
  stack: stackName,
1578
1610
  stage,
1579
1611
  fqn,
1580
- value: { ...value, namespace } as S,
1612
+ // Same rule as the lifecycle commit above: state only stores
1613
+ // plain data, never unresolved Output exprs.
1614
+ value: {
1615
+ ...value,
1616
+ props: stripUnresolved(value.props),
1617
+ namespace,
1618
+ } as S,
1581
1619
  });
1582
1620
 
1583
1621
  const report = (status: ApplyStatus) =>
@@ -12,7 +12,7 @@ import { withLock } from "./Lock.ts";
12
12
  * here so the redirect target lives in exactly one place across all
13
13
  * provider OAuth clients.
14
14
  */
15
- export const AUTH_LANDING_HOST = "https://v2.alchemy.run";
15
+ export const AUTH_LANDING_HOST = "https://alchemy.run";
16
16
  export const AUTH_SUCCESS_URL = `${AUTH_LANDING_HOST}/auth/success`;
17
17
  export const AUTH_ERROR_URL = `${AUTH_LANDING_HOST}/auth/error`;
18
18
 
package/src/Auth/Lock.ts CHANGED
@@ -50,7 +50,10 @@ export const withLock = <A, E, R>(
50
50
  try {
51
51
  await fs.mkdir(lockDir, { recursive: true });
52
52
  return await lock(lockPath, {
53
- retries: { retries: 600, minTimeout: 50, maxTimeout: 50 },
53
+ // A full single-process test run can build hundreds of provider
54
+ // layers concurrently. Each credential read briefly takes this
55
+ // lock, so tail waiters need enough budget to drain that queue.
56
+ retries: { retries: 2_400, minTimeout: 50, maxTimeout: 50 },
54
57
  // The holder refreshes the lockfile mtime on a timer. Under heavy
55
58
  // load (e.g. a full test run saturating every core) that timer can
56
59
  // be starved for several seconds, so keep the stale threshold well
@@ -79,7 +82,7 @@ export const withLock = <A, E, R>(
79
82
  ) {
80
83
  throw new Error(
81
84
  `Timed out waiting for the alchemy auth lock '${lockPath}' — another alchemy ` +
82
- `process has held it for over 30s. If no other alchemy process is running, ` +
85
+ `process has held it for over 120s. If no other alchemy process is running, ` +
83
86
  `delete the lock file and retry.`,
84
87
  { cause: err },
85
88
  );
@@ -134,7 +134,7 @@ export const purePlugin = (
134
134
  markSideEffectFreeOpt &&
135
135
  !isEntry &&
136
136
  isSideEffectFree(info.sideEffects);
137
- const annotated = annotateModule(code, id);
137
+ const annotated = annotateModuleCached(code, id);
138
138
  if (annotated === null) {
139
139
  return markSideEffectFree ? { code, moduleSideEffects: false } : null;
140
140
  }
@@ -433,6 +433,39 @@ interface AnnotatedModule {
433
433
  readonly map: ReturnType<MagicString["generateMap"]>;
434
434
  }
435
435
 
436
+ /**
437
+ * Process-wide memo of {@link annotateModule} results keyed by module id.
438
+ *
439
+ * Parsing with oxc + generating the sourcemap dominates bundling CPU (it
440
+ * showed up as ~60% of the main-thread profile of a test run), and the same
441
+ * modules — effect/alchemy dist files — are re-transformed for EVERY bundle
442
+ * built in the process. The single-process test runner builds dozens of
443
+ * worker bundles per run, so this cache eliminates all repeat parses. The
444
+ * stored `code` is compared on lookup, so a changed file (e.g. dev watch
445
+ * mode) never serves a stale result.
446
+ */
447
+ const annotateCache = new Map<
448
+ string,
449
+ { readonly code: string; readonly result: AnnotatedModule | null }
450
+ >();
451
+ const ANNOTATE_CACHE_MAX = 10_000;
452
+
453
+ const annotateModuleCached = (
454
+ code: string,
455
+ filename: string,
456
+ ): AnnotatedModule | null => {
457
+ const cached = annotateCache.get(filename);
458
+ if (cached !== undefined && cached.code === code) {
459
+ return cached.result;
460
+ }
461
+ const result = annotateModule(code, filename);
462
+ if (annotateCache.size >= ANNOTATE_CACHE_MAX) {
463
+ annotateCache.clear();
464
+ }
465
+ annotateCache.set(filename, { code, result });
466
+ return result;
467
+ };
468
+
436
469
  /**
437
470
  * Parses `code` and inserts `/*#__PURE__*\/` before every top-level
438
471
  * `CallExpression` / `NewExpression` callee. Returns `null` if the file