alchemy 2.0.0-beta.34 → 2.0.0-beta.35

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 (356) hide show
  1. package/bin/cli.js +8 -7
  2. package/bin/exec.js +226 -52
  3. package/bin/exec.js.map +1 -1
  4. package/lib/AWS/AuthProvider.d.ts +7 -6
  5. package/lib/AWS/AuthProvider.d.ts.map +1 -1
  6. package/lib/AWS/AuthProvider.js +143 -134
  7. package/lib/AWS/AuthProvider.js.map +1 -1
  8. package/lib/AWS/Bootstrap.d.ts +2 -2
  9. package/lib/AWS/Bootstrap.d.ts.map +1 -1
  10. package/lib/AWS/EC2/hosted.d.ts +1 -1
  11. package/lib/AWS/Environment.d.ts +25 -3
  12. package/lib/AWS/Environment.d.ts.map +1 -1
  13. package/lib/AWS/Environment.js +47 -3
  14. package/lib/AWS/Environment.js.map +1 -1
  15. package/lib/AWS/IAM/OpenIDConnectProvider.d.ts +14 -6
  16. package/lib/AWS/IAM/OpenIDConnectProvider.d.ts.map +1 -1
  17. package/lib/AWS/IAM/OpenIDConnectProvider.js +6 -3
  18. package/lib/AWS/IAM/OpenIDConnectProvider.js.map +1 -1
  19. package/lib/AWS/IAM/Policy.d.ts +1 -1
  20. package/lib/AWS/IAM/Policy.d.ts.map +1 -1
  21. package/lib/AWS/IAM/Policy.js.map +1 -1
  22. package/lib/AWS/Lambda/BucketEventSource.d.ts +1 -1
  23. package/lib/AWS/Lambda/BucketEventSource.d.ts.map +1 -1
  24. package/lib/AWS/Lambda/EventBridgeEventSource.d.ts +1 -1
  25. package/lib/AWS/Lambda/EventBridgeEventSource.d.ts.map +1 -1
  26. package/lib/AWS/Lambda/QueueEventSource.d.ts +1 -1
  27. package/lib/AWS/Lambda/QueueEventSource.d.ts.map +1 -1
  28. package/lib/AWS/Lambda/StreamEventSource.d.ts +1 -1
  29. package/lib/AWS/Lambda/StreamEventSource.d.ts.map +1 -1
  30. package/lib/AWS/Lambda/TableEventSource.d.ts +1 -1
  31. package/lib/AWS/Lambda/TableEventSource.d.ts.map +1 -1
  32. package/lib/AWS/Lambda/TopicEventSource.d.ts +1 -1
  33. package/lib/AWS/Lambda/TopicEventSource.d.ts.map +1 -1
  34. package/lib/AWS/Providers.d.ts +1 -1
  35. package/lib/AWS/Providers.d.ts.map +1 -1
  36. package/lib/AWS/Providers.js +2 -1
  37. package/lib/AWS/Providers.js.map +1 -1
  38. package/lib/Auth/Credentials.d.ts +21 -6
  39. package/lib/Auth/Credentials.d.ts.map +1 -1
  40. package/lib/Auth/Credentials.js +30 -31
  41. package/lib/Auth/Credentials.js.map +1 -1
  42. package/lib/Auth/Profile.d.ts +31 -34
  43. package/lib/Auth/Profile.d.ts.map +1 -1
  44. package/lib/Auth/Profile.js +46 -31
  45. package/lib/Auth/Profile.js.map +1 -1
  46. package/lib/Axiom/AuthProvider.d.ts +2 -1
  47. package/lib/Axiom/AuthProvider.d.ts.map +1 -1
  48. package/lib/Axiom/AuthProvider.js +149 -143
  49. package/lib/Axiom/AuthProvider.js.map +1 -1
  50. package/lib/Axiom/Credentials.d.ts +2 -1
  51. package/lib/Axiom/Credentials.d.ts.map +1 -1
  52. package/lib/Axiom/Credentials.js +4 -4
  53. package/lib/Axiom/Credentials.js.map +1 -1
  54. package/lib/Axiom/Providers.d.ts +1 -1
  55. package/lib/Axiom/Providers.d.ts.map +1 -1
  56. package/lib/Axiom/Providers.js +3 -1
  57. package/lib/Axiom/Providers.js.map +1 -1
  58. package/lib/Cli/LoggingCli.d.ts.map +1 -1
  59. package/lib/Cli/LoggingCli.js +105 -7
  60. package/lib/Cli/LoggingCli.js.map +1 -1
  61. package/lib/Cli/checkVersion.d.ts +13 -0
  62. package/lib/Cli/checkVersion.d.ts.map +1 -0
  63. package/lib/Cli/checkVersion.js +47 -0
  64. package/lib/Cli/checkVersion.js.map +1 -0
  65. package/lib/Cli/commands/_shared.d.ts +2 -2
  66. package/lib/Cli/commands/_shared.d.ts.map +1 -1
  67. package/lib/Cli/commands/_shared.js +3 -3
  68. package/lib/Cli/commands/_shared.js.map +1 -1
  69. package/lib/Cli/commands/aws.d.ts +6 -0
  70. package/lib/Cli/commands/aws.d.ts.map +1 -0
  71. package/lib/Cli/commands/aws.js +63 -0
  72. package/lib/Cli/commands/aws.js.map +1 -0
  73. package/lib/Cli/commands/cloudflare.d.ts +17 -0
  74. package/lib/Cli/commands/cloudflare.d.ts.map +1 -0
  75. package/lib/Cli/commands/cloudflare.js +111 -0
  76. package/lib/Cli/commands/cloudflare.js.map +1 -0
  77. package/lib/Cli/commands/deploy.d.ts +6 -5
  78. package/lib/Cli/commands/deploy.d.ts.map +1 -1
  79. package/lib/Cli/commands/deploy.js +10 -10
  80. package/lib/Cli/commands/deploy.js.map +1 -1
  81. package/lib/Cli/commands/dev.d.ts.map +1 -1
  82. package/lib/Cli/commands/dev.js +16 -16
  83. package/lib/Cli/commands/dev.js.map +1 -1
  84. package/lib/Cli/commands/login.d.ts +2 -1
  85. package/lib/Cli/commands/login.d.ts.map +1 -1
  86. package/lib/Cli/commands/login.js +9 -8
  87. package/lib/Cli/commands/login.js.map +1 -1
  88. package/lib/Cli/commands/logs.d.ts +1 -1
  89. package/lib/Cli/commands/logs.d.ts.map +1 -1
  90. package/lib/Cli/commands/logs.js +7 -7
  91. package/lib/Cli/commands/logs.js.map +1 -1
  92. package/lib/Cli/commands/profile.d.ts +3 -1
  93. package/lib/Cli/commands/profile.d.ts.map +1 -1
  94. package/lib/Cli/commands/profile.js +14 -11
  95. package/lib/Cli/commands/profile.js.map +1 -1
  96. package/lib/Cli/commands/state.d.ts +1 -1
  97. package/lib/Cli/commands/state.d.ts.map +1 -1
  98. package/lib/Cli/commands/state.js +8 -8
  99. package/lib/Cli/commands/state.js.map +1 -1
  100. package/lib/Cli/commands/tail.d.ts +1 -1
  101. package/lib/Cli/commands/tail.d.ts.map +1 -1
  102. package/lib/Cli/commands/tail.js +7 -7
  103. package/lib/Cli/commands/tail.js.map +1 -1
  104. package/lib/Cli/exec.d.ts.map +1 -1
  105. package/lib/Cli/exec.js +5 -3
  106. package/lib/Cli/exec.js.map +1 -1
  107. package/lib/Cli/main.d.ts.map +1 -1
  108. package/lib/Cli/main.js +17 -5
  109. package/lib/Cli/main.js.map +1 -1
  110. package/lib/Cli/selectCli.d.ts +12 -0
  111. package/lib/Cli/selectCli.d.ts.map +1 -0
  112. package/lib/Cli/selectCli.js +32 -0
  113. package/lib/Cli/selectCli.js.map +1 -0
  114. package/lib/Cloudflare/Auth/AuthProvider.d.ts +2 -1
  115. package/lib/Cloudflare/Auth/AuthProvider.d.ts.map +1 -1
  116. package/lib/Cloudflare/Auth/AuthProvider.js +235 -214
  117. package/lib/Cloudflare/Auth/AuthProvider.js.map +1 -1
  118. package/lib/Cloudflare/CloudflareEnvironment.d.ts +2 -1
  119. package/lib/Cloudflare/CloudflareEnvironment.d.ts.map +1 -1
  120. package/lib/Cloudflare/CloudflareEnvironment.js +3 -2
  121. package/lib/Cloudflare/CloudflareEnvironment.js.map +1 -1
  122. package/lib/Cloudflare/Credentials.d.ts +2 -1
  123. package/lib/Cloudflare/Credentials.d.ts.map +1 -1
  124. package/lib/Cloudflare/Credentials.js +4 -4
  125. package/lib/Cloudflare/Credentials.js.map +1 -1
  126. package/lib/Cloudflare/D1/D1Clone.d.ts +2 -1
  127. package/lib/Cloudflare/D1/D1Clone.d.ts.map +1 -1
  128. package/lib/Cloudflare/D1/D1Database.d.ts +2 -1
  129. package/lib/Cloudflare/D1/D1Database.d.ts.map +1 -1
  130. package/lib/Cloudflare/D1/D1Import.d.ts +3 -1
  131. package/lib/Cloudflare/D1/D1Import.d.ts.map +1 -1
  132. package/lib/Cloudflare/Local/Sidecar.d.ts +11 -4
  133. package/lib/Cloudflare/Local/Sidecar.d.ts.map +1 -1
  134. package/lib/Cloudflare/Local/Sidecar.js +8 -6
  135. package/lib/Cloudflare/Local/Sidecar.js.map +1 -1
  136. package/lib/Cloudflare/Local/SidecarHandlers.d.ts.map +1 -1
  137. package/lib/Cloudflare/Local/SidecarHandlers.js +1 -5
  138. package/lib/Cloudflare/Local/SidecarHandlers.js.map +1 -1
  139. package/lib/Cloudflare/Local/SidecarServer.js +5 -2
  140. package/lib/Cloudflare/Local/SidecarServer.js.map +1 -1
  141. package/lib/Cloudflare/Logs.d.ts +5 -0
  142. package/lib/Cloudflare/Logs.d.ts.map +1 -1
  143. package/lib/Cloudflare/Logs.js +70 -1
  144. package/lib/Cloudflare/Logs.js.map +1 -1
  145. package/lib/Cloudflare/Providers.d.ts +1 -1
  146. package/lib/Cloudflare/Providers.d.ts.map +1 -1
  147. package/lib/Cloudflare/Providers.js +4 -1
  148. package/lib/Cloudflare/Providers.js.map +1 -1
  149. package/lib/Cloudflare/Queue/Queue.d.ts +1 -1
  150. package/lib/Cloudflare/Queue/Queue.js +1 -1
  151. package/lib/Cloudflare/Queue/QueueConsumer.d.ts +6 -2
  152. package/lib/Cloudflare/Queue/QueueConsumer.d.ts.map +1 -1
  153. package/lib/Cloudflare/Queue/QueueConsumer.js +194 -53
  154. package/lib/Cloudflare/Queue/QueueConsumer.js.map +1 -1
  155. package/lib/Cloudflare/Queue/QueueEventSource.d.ts +106 -0
  156. package/lib/Cloudflare/Queue/QueueEventSource.d.ts.map +1 -0
  157. package/lib/Cloudflare/Queue/QueueEventSource.js +145 -0
  158. package/lib/Cloudflare/Queue/QueueEventSource.js.map +1 -0
  159. package/lib/Cloudflare/Queue/index.d.ts +1 -0
  160. package/lib/Cloudflare/Queue/index.d.ts.map +1 -1
  161. package/lib/Cloudflare/Queue/index.js +1 -0
  162. package/lib/Cloudflare/Queue/index.js.map +1 -1
  163. package/lib/Cloudflare/R2/R2Bucket.d.ts +94 -0
  164. package/lib/Cloudflare/R2/R2Bucket.d.ts.map +1 -1
  165. package/lib/Cloudflare/R2/R2Bucket.js +186 -2
  166. package/lib/Cloudflare/R2/R2Bucket.js.map +1 -1
  167. package/lib/Cloudflare/StateStore/State.d.ts +4 -3
  168. package/lib/Cloudflare/StateStore/State.d.ts.map +1 -1
  169. package/lib/Cloudflare/StateStore/State.js +16 -8
  170. package/lib/Cloudflare/StateStore/State.js.map +1 -1
  171. package/lib/Cloudflare/VpcService/VpcServiceRef.d.ts +1 -1
  172. package/lib/Cloudflare/VpcService/VpcServiceRef.d.ts.map +1 -1
  173. package/lib/Cloudflare/Website/StaticSite.d.ts.map +1 -1
  174. package/lib/Cloudflare/Website/StaticSite.js +10 -1
  175. package/lib/Cloudflare/Website/StaticSite.js.map +1 -1
  176. package/lib/Cloudflare/Workers/Assets.d.ts +1 -1
  177. package/lib/Cloudflare/Workers/Assets.d.ts.map +1 -1
  178. package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
  179. package/lib/Cloudflare/Workers/LocalWorkerProvider.js +11 -1
  180. package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
  181. package/lib/Cloudflare/Workers/Worker.d.ts +9 -7
  182. package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
  183. package/lib/Cloudflare/Workers/Worker.js +62 -142
  184. package/lib/Cloudflare/Workers/Worker.js.map +1 -1
  185. package/lib/Cloudflare/Workers/WorkerBundle.d.ts +2 -0
  186. package/lib/Cloudflare/Workers/WorkerBundle.d.ts.map +1 -1
  187. package/lib/Cloudflare/Workers/WorkerBundle.js +21 -7
  188. package/lib/Cloudflare/Workers/WorkerBundle.js.map +1 -1
  189. package/lib/Cloudflare/Zone.d.ts +14 -0
  190. package/lib/Cloudflare/Zone.d.ts.map +1 -0
  191. package/lib/Cloudflare/Zone.js +44 -0
  192. package/lib/Cloudflare/Zone.js.map +1 -0
  193. package/lib/Drizzle/Schema.d.ts.map +1 -1
  194. package/lib/Drizzle/Schema.js +20 -5
  195. package/lib/Drizzle/Schema.js.map +1 -1
  196. package/lib/GitHub/AuthProvider.d.ts +3 -1
  197. package/lib/GitHub/AuthProvider.d.ts.map +1 -1
  198. package/lib/GitHub/AuthProvider.js +114 -108
  199. package/lib/GitHub/AuthProvider.js.map +1 -1
  200. package/lib/GitHub/Credentials.d.ts +2 -1
  201. package/lib/GitHub/Credentials.d.ts.map +1 -1
  202. package/lib/GitHub/Credentials.js +4 -4
  203. package/lib/GitHub/Credentials.js.map +1 -1
  204. package/lib/GitHub/Providers.d.ts +1 -1
  205. package/lib/GitHub/Providers.d.ts.map +1 -1
  206. package/lib/GitHub/Providers.js +3 -1
  207. package/lib/GitHub/Providers.js.map +1 -1
  208. package/lib/GitHub/Secrets.d.ts.map +1 -1
  209. package/lib/GitHub/Secrets.js +14 -1
  210. package/lib/GitHub/Secrets.js.map +1 -1
  211. package/lib/GitHub/Variables.d.ts +40 -0
  212. package/lib/GitHub/Variables.d.ts.map +1 -0
  213. package/lib/GitHub/Variables.js +28 -0
  214. package/lib/GitHub/Variables.js.map +1 -0
  215. package/lib/GitHub/index.d.ts +1 -0
  216. package/lib/GitHub/index.d.ts.map +1 -1
  217. package/lib/GitHub/index.js +1 -0
  218. package/lib/GitHub/index.js.map +1 -1
  219. package/lib/Neon/AuthProvider.d.ts +3 -1
  220. package/lib/Neon/AuthProvider.d.ts.map +1 -1
  221. package/lib/Neon/AuthProvider.js +87 -80
  222. package/lib/Neon/AuthProvider.js.map +1 -1
  223. package/lib/Neon/Credentials.d.ts +2 -1
  224. package/lib/Neon/Credentials.d.ts.map +1 -1
  225. package/lib/Neon/Credentials.js +4 -4
  226. package/lib/Neon/Credentials.js.map +1 -1
  227. package/lib/Neon/NeonEnvironment.d.ts +2 -1
  228. package/lib/Neon/NeonEnvironment.d.ts.map +1 -1
  229. package/lib/Neon/NeonEnvironment.js +3 -2
  230. package/lib/Neon/NeonEnvironment.js.map +1 -1
  231. package/lib/Neon/Project.d.ts +16 -0
  232. package/lib/Neon/Project.d.ts.map +1 -1
  233. package/lib/Neon/Project.js +25 -0
  234. package/lib/Neon/Project.js.map +1 -1
  235. package/lib/Neon/Providers.d.ts +1 -1
  236. package/lib/Neon/Providers.d.ts.map +1 -1
  237. package/lib/Neon/Providers.js +3 -1
  238. package/lib/Neon/Providers.js.map +1 -1
  239. package/lib/Neon/api.d.ts +1 -0
  240. package/lib/Neon/api.d.ts.map +1 -1
  241. package/lib/Neon/api.js +1 -0
  242. package/lib/Neon/api.js.map +1 -1
  243. package/lib/Sidecar/RpcClient.d.ts.map +1 -1
  244. package/lib/Sidecar/RpcClient.js +8 -5
  245. package/lib/Sidecar/RpcClient.js.map +1 -1
  246. package/lib/Sidecar/RpcPaths.d.ts +5 -0
  247. package/lib/Sidecar/RpcPaths.d.ts.map +1 -1
  248. package/lib/Sidecar/RpcPaths.js +10 -1
  249. package/lib/Sidecar/RpcPaths.js.map +1 -1
  250. package/lib/Sidecar/RpcServer.d.ts +24 -4
  251. package/lib/Sidecar/RpcServer.d.ts.map +1 -1
  252. package/lib/Sidecar/RpcServer.js +70 -15
  253. package/lib/Sidecar/RpcServer.js.map +1 -1
  254. package/lib/Sidecar/RpcServerBun.d.ts +4 -0
  255. package/lib/Sidecar/RpcServerBun.d.ts.map +1 -0
  256. package/lib/Sidecar/RpcServerBun.js +28 -0
  257. package/lib/Sidecar/RpcServerBun.js.map +1 -0
  258. package/lib/Sidecar/RpcServerNode.d.ts +4 -0
  259. package/lib/Sidecar/RpcServerNode.d.ts.map +1 -0
  260. package/lib/Sidecar/RpcServerNode.js +39 -0
  261. package/lib/Sidecar/RpcServerNode.js.map +1 -0
  262. package/lib/Sidecar/RpcServices.d.ts +6 -0
  263. package/lib/Sidecar/RpcServices.d.ts.map +1 -0
  264. package/lib/Sidecar/RpcServices.js +29 -0
  265. package/lib/Sidecar/RpcServices.js.map +1 -0
  266. package/lib/Stack.d.ts +5 -3
  267. package/lib/Stack.d.ts.map +1 -1
  268. package/lib/Stack.js +3 -1
  269. package/lib/Stack.js.map +1 -1
  270. package/lib/Test/Core.d.ts.map +1 -1
  271. package/lib/Test/Core.js +5 -4
  272. package/lib/Test/Core.js.map +1 -1
  273. package/lib/Util/PlatformServices.js +1 -1
  274. package/lib/tsconfig.test.tsbuildinfo +1 -1
  275. package/package.json +15 -12
  276. package/src/AWS/AuthProvider.ts +269 -259
  277. package/src/AWS/Environment.ts +57 -3
  278. package/src/AWS/IAM/OpenIDConnectProvider.ts +19 -8
  279. package/src/AWS/IAM/Policy.ts +1 -1
  280. package/src/AWS/Providers.ts +2 -0
  281. package/src/Auth/Credentials.ts +82 -46
  282. package/src/Auth/Profile.ts +123 -69
  283. package/src/Axiom/AuthProvider.ts +263 -255
  284. package/src/Axiom/Credentials.ts +3 -4
  285. package/src/Axiom/Providers.ts +4 -0
  286. package/src/Cli/LoggingCli.ts +127 -11
  287. package/src/Cli/checkVersion.ts +57 -0
  288. package/src/Cli/commands/_shared.ts +4 -4
  289. package/src/Cli/commands/aws.ts +127 -0
  290. package/src/Cli/commands/cloudflare.ts +222 -0
  291. package/src/Cli/commands/deploy.ts +11 -10
  292. package/src/Cli/commands/dev.ts +28 -33
  293. package/src/Cli/commands/login.ts +9 -12
  294. package/src/Cli/commands/logs.ts +8 -8
  295. package/src/Cli/commands/profile.ts +14 -16
  296. package/src/Cli/commands/state.ts +8 -8
  297. package/src/Cli/commands/tail.ts +8 -8
  298. package/src/Cli/exec.ts +7 -3
  299. package/src/Cli/main.ts +20 -5
  300. package/src/Cli/selectCli.ts +33 -0
  301. package/src/Cloudflare/Auth/AuthProvider.ts +445 -430
  302. package/src/Cloudflare/CloudflareEnvironment.ts +3 -2
  303. package/src/Cloudflare/Credentials.ts +3 -4
  304. package/src/Cloudflare/Local/Sidecar.ts +13 -10
  305. package/src/Cloudflare/Local/SidecarHandlers.ts +8 -13
  306. package/src/Cloudflare/Local/SidecarServer.ts +6 -1
  307. package/src/Cloudflare/Logs.ts +115 -1
  308. package/src/Cloudflare/Providers.ts +6 -0
  309. package/src/Cloudflare/Queue/Queue.ts +1 -1
  310. package/src/Cloudflare/Queue/QueueConsumer.ts +262 -60
  311. package/src/Cloudflare/Queue/QueueEventSource.ts +234 -0
  312. package/src/Cloudflare/Queue/index.ts +1 -0
  313. package/src/Cloudflare/R2/R2Bucket.ts +337 -2
  314. package/src/Cloudflare/StateStore/State.ts +25 -16
  315. package/src/Cloudflare/Website/StaticSite.ts +11 -1
  316. package/src/Cloudflare/Workers/LocalWorkerProvider.ts +9 -1
  317. package/src/Cloudflare/Workers/Worker.ts +83 -203
  318. package/src/Cloudflare/Workers/WorkerBundle.ts +38 -12
  319. package/src/Cloudflare/Zone.ts +88 -0
  320. package/src/Drizzle/Schema.ts +21 -5
  321. package/src/GitHub/AuthProvider.ts +221 -217
  322. package/src/GitHub/Credentials.ts +3 -4
  323. package/src/GitHub/Providers.ts +4 -0
  324. package/src/GitHub/Secrets.ts +25 -1
  325. package/src/GitHub/Variables.ts +54 -0
  326. package/src/GitHub/index.ts +1 -0
  327. package/src/Neon/AuthProvider.ts +160 -154
  328. package/src/Neon/Credentials.ts +3 -4
  329. package/src/Neon/NeonEnvironment.ts +3 -2
  330. package/src/Neon/Project.ts +42 -0
  331. package/src/Neon/Providers.ts +4 -0
  332. package/src/Neon/api.ts +2 -0
  333. package/src/Sidecar/RpcClient.ts +8 -7
  334. package/src/Sidecar/RpcPaths.ts +11 -1
  335. package/src/Sidecar/RpcServer.ts +97 -24
  336. package/src/Sidecar/RpcServerBun.ts +41 -0
  337. package/src/Sidecar/RpcServerNode.ts +51 -0
  338. package/src/Sidecar/RpcServices.ts +48 -0
  339. package/src/Stack.ts +8 -0
  340. package/src/Test/Core.ts +10 -4
  341. package/src/Util/PlatformServices.ts +1 -1
  342. package/lib/Cli/commands/bootstrap.d.ts +0 -20
  343. package/lib/Cli/commands/bootstrap.d.ts.map +0 -1
  344. package/lib/Cli/commands/bootstrap.js +0 -107
  345. package/lib/Cli/commands/bootstrap.js.map +0 -1
  346. package/lib/Sidecar/RpcTransport.d.ts +0 -22
  347. package/lib/Sidecar/RpcTransport.d.ts.map +0 -1
  348. package/lib/Sidecar/RpcTransport.js +0 -81
  349. package/lib/Sidecar/RpcTransport.js.map +0 -1
  350. package/lib/Test/TestCli.d.ts +0 -19
  351. package/lib/Test/TestCli.d.ts.map +0 -1
  352. package/lib/Test/TestCli.js +0 -175
  353. package/lib/Test/TestCli.js.map +0 -1
  354. package/src/Cli/commands/bootstrap.ts +0 -216
  355. package/src/Sidecar/RpcTransport.ts +0 -85
  356. package/src/Test/TestCli.ts +0 -221
package/bin/cli.js CHANGED
@@ -21,9 +21,9 @@
21
21
  //
22
22
  // foreground-child forwards stdio + signals and exits with the child's code,
23
23
  // so the launcher is transparent to the invoking shell / npm script.
24
+ import { foregroundChild } from "foreground-child";
24
25
  import { fileURLToPath } from "node:url";
25
26
  import path from "pathe";
26
- import { foregroundChild } from "foreground-child";
27
27
 
28
28
  const execpath = (process.env.npm_execpath ?? "").toLowerCase();
29
29
  const userAgent = (process.env.npm_config_user_agent ?? "").toLowerCase();
@@ -38,17 +38,17 @@ const binDir = path.dirname(fileURLToPath(import.meta.url));
38
38
  const jsEntry = path.join(binDir, "alchemy.js");
39
39
  const tsEntry = path.join(binDir, "alchemy.ts");
40
40
 
41
- // Treat any install-tree path as published; only a raw checkout uses .ts.
42
- const useTs = !(
41
+ // Treat any install-tree path as published.
42
+ const isDev = !(
43
43
  binDir.includes("/node_modules/") || binDir.includes("\\node_modules\\")
44
44
  );
45
45
 
46
- // .ts only runs under bun. Force bun in dev even if node was the invoker.
47
- const runtime = useTs || invokedByBun ? "bun" : "node";
46
+ // We no longer force bun in dev when node is the invoker because this prevents us from testing in node.
47
+ const runtime = invokedByBun ? "bun" : "node";
48
48
 
49
49
  const args = [];
50
50
 
51
- if (runtime === "bun" && useTs) {
51
+ if (runtime === "bun" && isDev) {
52
52
  // Pin bun's tsconfig to alchemy's, not whatever happens to be in the
53
53
  // invoking workspace's cwd. Bun's default is `$cwd/tsconfig.json`, which
54
54
  // means invoking `alchemy` from e.g. `examples/cloudflare-solidstart`
@@ -58,7 +58,8 @@ if (runtime === "bun" && useTs) {
58
58
  args.push(`--tsconfig-override=${path.join(binDir, "..", "tsconfig.json")}`);
59
59
  }
60
60
 
61
- args.push(useTs ? tsEntry : jsEntry, ...process.argv.slice(2));
61
+ // .ts only runs under bun.
62
+ args.push(runtime === "bun" ? tsEntry : jsEntry, ...process.argv.slice(2));
62
63
 
63
64
  process.on("uncaughtException", (error) => {
64
65
  if (
package/bin/exec.js CHANGED
@@ -7,6 +7,10 @@ import * as EffectContext from "effect/Context";
7
7
  import * as FileSystem from "effect/FileSystem";
8
8
  import * as Path$1 from "effect/Path";
9
9
  import { Path } from "effect/Path";
10
+ import * as Redacted from "effect/Redacted";
11
+ import path from "pathe";
12
+ import * as Config from "effect/Config";
13
+ import os from "node:os";
10
14
  import * as Console from "effect/Console";
11
15
  import * as Logger from "effect/Logger";
12
16
  import * as Option from "effect/Option";
@@ -16,12 +20,8 @@ import * as Data from "effect/Data";
16
20
  import * as Cause from "effect/Cause";
17
21
  import * as Deferred from "effect/Deferred";
18
22
  import { pipe } from "effect/Function";
19
- import * as Redacted from "effect/Redacted";
20
23
  import { SingleShotGen } from "effect/Utils";
21
24
  import { pipeArguments } from "effect/Pipeable";
22
- import path from "pathe";
23
- import * as Config from "effect/Config";
24
- import os from "node:os";
25
25
  import * as Duration from "effect/Duration";
26
26
  import * as Exit from "effect/Exit";
27
27
  import * as Metric from "effect/Metric";
@@ -45,6 +45,105 @@ const AlchemyContextLive = Layer.effect(AlchemyContext, Effect.gen(function* ()
45
45
  };
46
46
  }));
47
47
 
48
+ //#endregion
49
+ //#region lib/Auth/Profile.js
50
+ const rootDir = path.join(os.homedir(), ".alchemy");
51
+ const configFilePath = path.join(rootDir, "profiles.json");
52
+ /**
53
+ * Config key consulted by the various `fromAuthProvider` /
54
+ * `fromEnvironment` layers to pick which named profile in
55
+ * `~/.alchemy/profiles.json` to use. Defaults to `"default"`.
56
+ */
57
+ const ALCHEMY_PROFILE = Config.string("ALCHEMY_PROFILE").pipe(Config.withDefault("default"));
58
+ const CONFIG_VERSION = 0;
59
+ const emptyConfig = () => ({
60
+ version: CONFIG_VERSION,
61
+ profiles: {}
62
+ });
63
+ var Profile = class extends EffectContext.Service()("Alchemy::Profile") {};
64
+ /**
65
+ * Layer that builds the {@link Profile} service. Captures the
66
+ * {@link FileSystem.FileSystem} dependency at layer-build time, so any
67
+ * Effect that yields {@link Profile} ends up with `R = Profile` (no
68
+ * `FileSystem` leak). Provide this once at the top of your runtime
69
+ * (alongside `PlatformServices` / `NodeContext`).
70
+ */
71
+ const ProfileLive = Layer.effect(Profile, Effect.gen(function* () {
72
+ const fs = yield* FileSystem.FileSystem;
73
+ const readConfig = fs.readFileString(configFilePath).pipe(Effect.flatMap((data) => Effect.try({
74
+ try: () => {
75
+ const parsed = JSON.parse(data);
76
+ if (parsed?.version !== CONFIG_VERSION) return emptyConfig();
77
+ return parsed;
78
+ },
79
+ catch: emptyConfig
80
+ })), Effect.orElseSucceed(emptyConfig));
81
+ const writeConfig = (config) => fs.makeDirectory(path.dirname(configFilePath), { recursive: true }).pipe(Effect.flatMap(() => fs.writeFileString(configFilePath, JSON.stringify(config, null, 2))));
82
+ const getProfile = (name) => readConfig.pipe(Effect.map((config) => config.profiles[name]));
83
+ const setProfile = (name, profile$1) => readConfig.pipe(Effect.tap((config) => Effect.sync(() => config.profiles[name] = profile$1)), Effect.flatMap(writeConfig));
84
+ const deleteProfile = (name) => readConfig.pipe(Effect.flatMap((config) => {
85
+ if (!(name in config.profiles)) return Effect.succeed(false);
86
+ delete config.profiles[name];
87
+ return writeConfig(config).pipe(Effect.as(true));
88
+ }));
89
+ const loadOrConfigure = (auth, profileName, ctx) => Effect.flatMap(getProfile(profileName), (existing) => existing?.[auth.name] ? Effect.succeed(existing[auth.name]) : Effect.tap(auth.configure(profileName, ctx), (config) => setProfile(profileName, {
90
+ ...existing,
91
+ [auth.name]: config
92
+ })));
93
+ return {
94
+ readConfig,
95
+ writeConfig,
96
+ getProfile,
97
+ setProfile,
98
+ deleteProfile,
99
+ loadOrConfigure
100
+ };
101
+ }));
102
+ /**
103
+ * Returns a `ConfigProvider` that overrides `ALCHEMY_PROFILE` with the
104
+ * given `profile` (when explicitly passed via the CLI `--profile` flag),
105
+ * falling through to `base` for everything else.
106
+ *
107
+ * Use this to let the CLI's `--profile <name>` win over `$ALCHEMY_PROFILE`
108
+ * without disturbing other config lookups.
109
+ */
110
+ const withProfileOverride = (base, profile$1) => {
111
+ if (profile$1 === void 0) return base;
112
+ const overrides = { ALCHEMY_PROFILE: profile$1 };
113
+ 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));
114
+ return ConfigProvider.orElse(base)(overrideProvider);
115
+ };
116
+
117
+ //#endregion
118
+ //#region lib/Auth/Credentials.js
119
+ const credentialsDirPath = path.join(rootDir, "credentials");
120
+ const profileCredentialsDirPath = (profile$1) => path.join(credentialsDirPath, profile$1);
121
+ const credentialsFilePath = (profile$1, provider) => path.join(profileCredentialsDirPath(profile$1), `${provider}.json`);
122
+ var CredentialsStore = class extends EffectContext.Service()("Alchemy::CredentialsStore") {};
123
+ const CredentialsStoreLive = Layer.effect(CredentialsStore, Effect.gen(function* () {
124
+ const fs = yield* FileSystem.FileSystem;
125
+ const read = (profile$1, provider) => fs.readFileString(credentialsFilePath(profile$1, provider)).pipe(Effect.catch(() => Effect.succeed(void 0)), Effect.map((data) => {
126
+ if (data === void 0) return void 0;
127
+ try {
128
+ return JSON.parse(data);
129
+ } catch {
130
+ return;
131
+ }
132
+ }));
133
+ const write = (profile$1, provider, credentials) => {
134
+ const filePath = credentialsFilePath(profile$1, provider);
135
+ return fs.makeDirectory(path.dirname(filePath), { recursive: true }).pipe(Effect.flatMap(() => fs.writeFileString(filePath, JSON.stringify(credentials, null, 2))));
136
+ };
137
+ const remove_ = (profile$1, provider) => fs.remove(credentialsFilePath(profile$1, provider)).pipe(Effect.catch(() => Effect.void));
138
+ const deleteProfile = (profile$1) => fs.remove(profileCredentialsDirPath(profile$1), { recursive: true }).pipe(Effect.catch(() => Effect.void));
139
+ return {
140
+ read,
141
+ write,
142
+ delete: remove_,
143
+ deleteProfile
144
+ };
145
+ }));
146
+
48
147
  //#endregion
49
148
  //#region lib/Util/PlatformServices.js
50
149
  const isBun = typeof Bun !== "undefined";
@@ -333,44 +432,6 @@ const GenericService = () => (Kind) => {
333
432
  return Object.assign(Object.setPrototypeOf(make$2, service), service);
334
433
  };
335
434
 
336
- //#endregion
337
- //#region lib/Auth/Profile.js
338
- const rootDir = path.join(os.homedir(), ".alchemy");
339
- const configFilePath = path.join(rootDir, "profiles.json");
340
- /**
341
- * Config key consulted by the various `fromAuthProvider` /
342
- * `fromEnvironment` layers to pick which named profile in
343
- * `~/.alchemy/profiles.json` to use. Defaults to `"default"`.
344
- */
345
- const ALCHEMY_PROFILE = Config.string("ALCHEMY_PROFILE").pipe(Config.withDefault("default"));
346
- const CONFIG_VERSION = 0;
347
- const emptyConfig = () => ({
348
- version: CONFIG_VERSION,
349
- profiles: {}
350
- });
351
- const readConfig = FileSystem.FileSystem.asEffect().pipe(Effect.flatMap((fs) => fs.readFileString(configFilePath)), Effect.flatMap((data) => Effect.try({
352
- try: () => {
353
- const parsed = JSON.parse(data);
354
- if (parsed?.version !== CONFIG_VERSION) return emptyConfig();
355
- return parsed;
356
- },
357
- catch: emptyConfig
358
- })), Effect.orElseSucceed(emptyConfig));
359
- /**
360
- * Returns a `ConfigProvider` that overrides `ALCHEMY_PROFILE` with the
361
- * given `profile` (when explicitly passed via the CLI `--profile` flag),
362
- * falling through to `base` for everything else.
363
- *
364
- * Use this to let the CLI's `--profile <name>` win over `$ALCHEMY_PROFILE`
365
- * without disturbing other config lookups.
366
- */
367
- const withProfileOverride = (base, profile$1) => {
368
- if (profile$1 === void 0) return base;
369
- const overrides = { ALCHEMY_PROFILE: profile$1 };
370
- 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));
371
- return ConfigProvider.orElse(base)(overrideProvider);
372
- };
373
-
374
435
  //#endregion
375
436
  //#region lib/Auth/AuthProvider.js
376
437
  var AuthProviders = class extends EffectContext.Service()("AuthProviders") {};
@@ -391,16 +452,16 @@ const loadConfigProvider = (envFile$1) => {
391
452
 
392
453
  //#endregion
393
454
  //#region lib/Util/effect.js
394
- const taggedFunction = (tag, fn) => {
455
+ const taggedFunction = (tag$1, fn) => {
395
456
  const overrides = {
396
- asEffect: () => tag.asEffect(),
397
- [Symbol.iterator]: () => tag[Symbol.iterator](),
398
- pipe: (...fns) => pipeArguments(tag.asEffect(), fns),
399
- toString: () => `${tag.toString()}.${fn.name}`
457
+ asEffect: () => tag$1.asEffect(),
458
+ [Symbol.iterator]: () => tag$1[Symbol.iterator](),
459
+ pipe: (...fns) => pipeArguments(tag$1.asEffect(), fns),
460
+ toString: () => `${tag$1.toString()}.${fn.name}`
400
461
  };
401
462
  return new Proxy(fn, {
402
- 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, prop, tag),
403
- has: (target, prop) => Reflect.has(overrides, prop) || Reflect.has(target, prop) || Reflect.has(tag, prop)
463
+ 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),
464
+ has: (target, prop) => Reflect.has(overrides, prop) || Reflect.has(target, prop) || Reflect.has(tag$1, prop)
404
465
  });
405
466
  };
406
467
 
@@ -445,7 +506,7 @@ const make$1 = (options) => (effect) => Effect.scope.pipe(Effect.flatMap((scope)
445
506
  services: EffectContext.merge(services$1, context)
446
507
  })), Effect.provideContext(context))));
447
508
  const CurrentStack = Effect.serviceOption(Stack).asEffect().pipe(Effect.map(Option.getOrUndefined));
448
- const platform = Layer.mergeAll(PlatformServices, FetchHttpClient.layer, Logger.layer([fileLogger("out")], { mergeWithExisting: true }));
509
+ const platform = Layer.mergeAll(PlatformServices, FetchHttpClient.layer, Logger.layer([fileLogger("out")], { mergeWithExisting: true }), Layer.provide(ProfileLive, PlatformServices), Layer.provide(CredentialsStoreLive, PlatformServices));
449
510
 
450
511
  //#endregion
451
512
  //#region lib/Resource.js
@@ -920,7 +981,7 @@ const make = (stack, options = {}) => Effect.gen(function* () {
920
981
  const ctx = yield* Effect.serviceOption(AlchemyContext);
921
982
  return Option.match(ctx, {
922
983
  onNone: () => false,
923
- onSome: (c) => c.adopt
984
+ onSome: (c$1) => c$1.adopt
924
985
  });
925
986
  });
926
987
  const resourceFqns = yield* state.list({
@@ -2067,6 +2128,99 @@ const planCommand = Command.make("plan", {
2067
2128
  dryRun: true
2068
2129
  })));
2069
2130
 
2131
+ //#endregion
2132
+ //#region lib/Cli/LoggingCli.js
2133
+ const ESC = "\x1B[";
2134
+ const RESET = `${ESC}0m`;
2135
+ const useColor = process.stdout.hasColors?.() ?? !!process.stdout.isTTY;
2136
+ const c = (code, s) => useColor ? `${ESC}${code}m${s}${RESET}` : s;
2137
+ const dim = (s) => c("2", s);
2138
+ const bold = (s) => c("1", s);
2139
+ const red = (s) => c("31", s);
2140
+ const green = (s) => c("32", s);
2141
+ const yellow = (s) => c("33", s);
2142
+ const blue = (s) => c("34", s);
2143
+ const magenta = (s) => c("35", s);
2144
+ const cyan = (s) => c("36", s);
2145
+ const actionColor$1 = {
2146
+ create: green,
2147
+ update: yellow,
2148
+ replace: magenta,
2149
+ delete: red,
2150
+ noop: dim
2151
+ };
2152
+ const statusColor$1 = (status) => {
2153
+ switch (status) {
2154
+ case "created":
2155
+ case "updated":
2156
+ case "replaced": return green;
2157
+ case "deleted": return dim;
2158
+ case "fail": return red;
2159
+ case "attaching":
2160
+ case "post-attach": return cyan;
2161
+ default: return yellow;
2162
+ }
2163
+ };
2164
+ const tag = (id) => bold(`[${id}]`);
2165
+ const isTerminal = (status) => status === "created" || status === "updated" || status === "deleted" || status === "replaced" || status === "fail";
2166
+ const formatPlanLines = (plan) => {
2167
+ const items = [...Object.values(plan.resources), ...Object.values(plan.deletions)];
2168
+ if (items.length === 0) return [bold("Plan:") + " no changes"];
2169
+ const counts = items.reduce((acc, item) => (acc[item.action] = (acc[item.action] ?? 0) + 1, acc), {});
2170
+ const summary = [
2171
+ "create",
2172
+ "update",
2173
+ "replace",
2174
+ "delete",
2175
+ "noop"
2176
+ ].filter((a) => counts[a]).map((a) => actionColor$1[a](`${counts[a]} to ${a}`)).join(dim(", "));
2177
+ const sorted = [...items].sort((a, b) => a.resource.LogicalId.localeCompare(b.resource.LogicalId));
2178
+ const lines = [`${bold("Plan:")} ${summary}`];
2179
+ for (const item of sorted) {
2180
+ const action = actionColor$1[item.action](item.action);
2181
+ lines.push(`${tag(item.resource.LogicalId)} ${action}`);
2182
+ for (const binding of item.bindings) {
2183
+ if (binding.action === "noop") continue;
2184
+ const bindingAction = actionColor$1[binding.action](binding.action);
2185
+ lines.push(`${tag(`${item.resource.LogicalId}/${binding.sid}`)} ${bindingAction}`);
2186
+ }
2187
+ }
2188
+ return lines;
2189
+ };
2190
+ const LoggingCli = Layer.succeed(Cli, Cli.of({
2191
+ approvePlan: (plan) => Effect.gen(function* () {
2192
+ for (const line of formatPlanLines(plan)) yield* Console.log(line);
2193
+ yield* Console.log(`\n${yellow("Non-interactive terminal detected.")} Pass ${bold("--yes")} to approve, or set ${bold("ALCHEMY_TUI=1")} for the interactive UI.`);
2194
+ return false;
2195
+ }),
2196
+ displayPlan: (plan) => Effect.gen(function* () {
2197
+ for (const line of formatPlanLines(plan)) yield* Console.log(line);
2198
+ }),
2199
+ startApplySession: (plan) => Effect.gen(function* () {
2200
+ for (const line of formatPlanLines(plan)) yield* Console.log(line);
2201
+ yield* Console.log("");
2202
+ const counts = {
2203
+ ok: 0,
2204
+ fail: 0
2205
+ };
2206
+ return {
2207
+ emit: (event) => Effect.sync(() => {
2208
+ if (event.kind === "annotate") {
2209
+ console.log(`${tag(event.id)} ${blue(event.message)}`);
2210
+ return;
2211
+ }
2212
+ const id = event.bindingId ? `${event.id}/${event.bindingId}` : event.id;
2213
+ const status = statusColor$1(event.status)(event.status);
2214
+ const msg = event.message ? ` ${dim("—")} ${event.message}` : "";
2215
+ console.log(`${tag(id)} ${status}${msg}`);
2216
+ if (isTerminal(event.status)) if (event.status === "fail") counts.fail++;
2217
+ else counts.ok++;
2218
+ }),
2219
+ done: () => Console.log(`\n${bold("Done:")} ${green(`${counts.ok} succeeded`)}${counts.fail ? dim(", ") + red(`${counts.fail} failed`) : ""}`)
2220
+ };
2221
+ })
2222
+ }));
2223
+
2070
2224
  //#endregion
2071
2225
  //#region lib/Cli/NamespaceTree.js
2072
2226
  function buildNamespaceTree(items) {
@@ -2611,9 +2765,29 @@ const startApplySession = Effect.fn(function* (plan) {
2611
2765
  };
2612
2766
  });
2613
2767
 
2768
+ //#endregion
2769
+ //#region lib/Cli/selectCli.js
2770
+ /**
2771
+ * Returns true when the current process looks like it's being driven by a
2772
+ * coding agent, CI runner, or anything else that won't render an interactive
2773
+ * TUI well. The Ink renderer repaints the screen on every event, which floods
2774
+ * agent transcripts with redundant frames; LoggingCli emits one line per
2775
+ * status change instead.
2776
+ */
2777
+ const isNonInteractive = () => {
2778
+ const env = process.env;
2779
+ if (env.ALCHEMY_PLAIN === "1" || env.ALCHEMY_NO_TUI === "1") return true;
2780
+ if (env.ALCHEMY_TUI === "1") return false;
2781
+ if (!process.stdout.isTTY) return true;
2782
+ if (env.CI) return true;
2783
+ if (env.CLAUDECODE || env.CLAUDE_CODE_ENTRYPOINT || env.CURSOR_AGENT || env.AIDER_MODEL || env.CODEX_CLI) return true;
2784
+ return false;
2785
+ };
2786
+ const selectCli = () => isNonInteractive() ? LoggingCli : inkCLI();
2787
+
2614
2788
  //#endregion
2615
2789
  //#region lib/Cli/exec.js
2616
- const services = Layer.mergeAll(Layer.provideMerge(AlchemyContextLive, PlatformServices), FetchHttpClient.layer, ConfigProvider.layer(ConfigProvider.fromEnv()), inkCLI());
2790
+ const services = Layer.mergeAll(Layer.provideMerge(AlchemyContextLive, PlatformServices), Layer.provide(ProfileLive, PlatformServices), Layer.provide(CredentialsStoreLive, PlatformServices), FetchHttpClient.layer, ConfigProvider.layer(ConfigProvider.fromEnv()), selectCli());
2617
2791
  const exec = () => execStack(S.decodeSync(ExecStackOptions)(JSON.parse(process.env.ALCHEMY_EXEC_OPTIONS))).pipe(Effect.provide(services), Effect.scoped);
2618
2792
 
2619
2793
  //#endregion