alchemy 2.0.0-beta.34 → 2.0.0-beta.36

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 (390) hide show
  1. package/bin/cli.js +8 -7
  2. package/bin/exec.js +253 -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 +19 -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/Images/Images.d.ts +103 -0
  133. package/lib/Cloudflare/Images/Images.d.ts.map +1 -0
  134. package/lib/Cloudflare/Images/Images.js +82 -0
  135. package/lib/Cloudflare/Images/Images.js.map +1 -0
  136. package/lib/Cloudflare/Images/ImagesBinding.d.ts +73 -0
  137. package/lib/Cloudflare/Images/ImagesBinding.d.ts.map +1 -0
  138. package/lib/Cloudflare/Images/ImagesBinding.js +83 -0
  139. package/lib/Cloudflare/Images/ImagesBinding.js.map +1 -0
  140. package/lib/Cloudflare/Images/index.d.ts +3 -0
  141. package/lib/Cloudflare/Images/index.d.ts.map +1 -0
  142. package/lib/Cloudflare/Images/index.js +3 -0
  143. package/lib/Cloudflare/Images/index.js.map +1 -0
  144. package/lib/Cloudflare/Local/Sidecar.d.ts +11 -4
  145. package/lib/Cloudflare/Local/Sidecar.d.ts.map +1 -1
  146. package/lib/Cloudflare/Local/Sidecar.js +8 -6
  147. package/lib/Cloudflare/Local/Sidecar.js.map +1 -1
  148. package/lib/Cloudflare/Local/SidecarHandlers.d.ts.map +1 -1
  149. package/lib/Cloudflare/Local/SidecarHandlers.js +1 -5
  150. package/lib/Cloudflare/Local/SidecarHandlers.js.map +1 -1
  151. package/lib/Cloudflare/Local/SidecarServer.js +5 -2
  152. package/lib/Cloudflare/Local/SidecarServer.js.map +1 -1
  153. package/lib/Cloudflare/Logs.d.ts +5 -0
  154. package/lib/Cloudflare/Logs.d.ts.map +1 -1
  155. package/lib/Cloudflare/Logs.js +70 -1
  156. package/lib/Cloudflare/Logs.js.map +1 -1
  157. package/lib/Cloudflare/Providers.d.ts +1 -1
  158. package/lib/Cloudflare/Providers.d.ts.map +1 -1
  159. package/lib/Cloudflare/Providers.js +6 -1
  160. package/lib/Cloudflare/Providers.js.map +1 -1
  161. package/lib/Cloudflare/Queue/Queue.d.ts +1 -1
  162. package/lib/Cloudflare/Queue/Queue.js +1 -1
  163. package/lib/Cloudflare/Queue/QueueConsumer.d.ts +6 -2
  164. package/lib/Cloudflare/Queue/QueueConsumer.d.ts.map +1 -1
  165. package/lib/Cloudflare/Queue/QueueConsumer.js +194 -53
  166. package/lib/Cloudflare/Queue/QueueConsumer.js.map +1 -1
  167. package/lib/Cloudflare/Queue/QueueEventSource.d.ts +106 -0
  168. package/lib/Cloudflare/Queue/QueueEventSource.d.ts.map +1 -0
  169. package/lib/Cloudflare/Queue/QueueEventSource.js +145 -0
  170. package/lib/Cloudflare/Queue/QueueEventSource.js.map +1 -0
  171. package/lib/Cloudflare/Queue/index.d.ts +1 -0
  172. package/lib/Cloudflare/Queue/index.d.ts.map +1 -1
  173. package/lib/Cloudflare/Queue/index.js +1 -0
  174. package/lib/Cloudflare/Queue/index.js.map +1 -1
  175. package/lib/Cloudflare/R2/R2Bucket.d.ts +229 -0
  176. package/lib/Cloudflare/R2/R2Bucket.d.ts.map +1 -1
  177. package/lib/Cloudflare/R2/R2Bucket.js +309 -2
  178. package/lib/Cloudflare/R2/R2Bucket.js.map +1 -1
  179. package/lib/Cloudflare/StateStore/State.d.ts +4 -3
  180. package/lib/Cloudflare/StateStore/State.d.ts.map +1 -1
  181. package/lib/Cloudflare/StateStore/State.js +16 -8
  182. package/lib/Cloudflare/StateStore/State.js.map +1 -1
  183. package/lib/Cloudflare/VpcService/VpcServiceRef.d.ts +1 -1
  184. package/lib/Cloudflare/VpcService/VpcServiceRef.d.ts.map +1 -1
  185. package/lib/Cloudflare/Website/StaticSite.d.ts.map +1 -1
  186. package/lib/Cloudflare/Website/StaticSite.js +10 -1
  187. package/lib/Cloudflare/Website/StaticSite.js.map +1 -1
  188. package/lib/Cloudflare/Workers/Assets.d.ts +1 -1
  189. package/lib/Cloudflare/Workers/Assets.d.ts.map +1 -1
  190. package/lib/Cloudflare/Workers/InferEnv.d.ts +1 -1
  191. package/lib/Cloudflare/Workers/InferEnv.d.ts.map +1 -1
  192. package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
  193. package/lib/Cloudflare/Workers/LocalWorkerProvider.js +11 -1
  194. package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
  195. package/lib/Cloudflare/Workers/Worker.d.ts +14 -12
  196. package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
  197. package/lib/Cloudflare/Workers/Worker.js +96 -165
  198. package/lib/Cloudflare/Workers/Worker.js.map +1 -1
  199. package/lib/Cloudflare/Workers/WorkerBundle.d.ts +2 -0
  200. package/lib/Cloudflare/Workers/WorkerBundle.d.ts.map +1 -1
  201. package/lib/Cloudflare/Workers/WorkerBundle.js +21 -7
  202. package/lib/Cloudflare/Workers/WorkerBundle.js.map +1 -1
  203. package/lib/Cloudflare/Zone.d.ts +14 -0
  204. package/lib/Cloudflare/Zone.d.ts.map +1 -0
  205. package/lib/Cloudflare/Zone.js +44 -0
  206. package/lib/Cloudflare/Zone.js.map +1 -0
  207. package/lib/Cloudflare/index.d.ts +1 -0
  208. package/lib/Cloudflare/index.d.ts.map +1 -1
  209. package/lib/Cloudflare/index.js +1 -0
  210. package/lib/Cloudflare/index.js.map +1 -1
  211. package/lib/Drizzle/Schema.d.ts.map +1 -1
  212. package/lib/Drizzle/Schema.js +20 -5
  213. package/lib/Drizzle/Schema.js.map +1 -1
  214. package/lib/GitHub/AuthProvider.d.ts +3 -1
  215. package/lib/GitHub/AuthProvider.d.ts.map +1 -1
  216. package/lib/GitHub/AuthProvider.js +114 -108
  217. package/lib/GitHub/AuthProvider.js.map +1 -1
  218. package/lib/GitHub/Credentials.d.ts +2 -1
  219. package/lib/GitHub/Credentials.d.ts.map +1 -1
  220. package/lib/GitHub/Credentials.js +4 -4
  221. package/lib/GitHub/Credentials.js.map +1 -1
  222. package/lib/GitHub/Providers.d.ts +1 -1
  223. package/lib/GitHub/Providers.d.ts.map +1 -1
  224. package/lib/GitHub/Providers.js +3 -1
  225. package/lib/GitHub/Providers.js.map +1 -1
  226. package/lib/GitHub/Secrets.d.ts.map +1 -1
  227. package/lib/GitHub/Secrets.js +14 -1
  228. package/lib/GitHub/Secrets.js.map +1 -1
  229. package/lib/GitHub/Variables.d.ts +40 -0
  230. package/lib/GitHub/Variables.d.ts.map +1 -0
  231. package/lib/GitHub/Variables.js +28 -0
  232. package/lib/GitHub/Variables.js.map +1 -0
  233. package/lib/GitHub/index.d.ts +1 -0
  234. package/lib/GitHub/index.d.ts.map +1 -1
  235. package/lib/GitHub/index.js +1 -0
  236. package/lib/GitHub/index.js.map +1 -1
  237. package/lib/Neon/AuthProvider.d.ts +3 -1
  238. package/lib/Neon/AuthProvider.d.ts.map +1 -1
  239. package/lib/Neon/AuthProvider.js +87 -80
  240. package/lib/Neon/AuthProvider.js.map +1 -1
  241. package/lib/Neon/Credentials.d.ts +2 -1
  242. package/lib/Neon/Credentials.d.ts.map +1 -1
  243. package/lib/Neon/Credentials.js +4 -4
  244. package/lib/Neon/Credentials.js.map +1 -1
  245. package/lib/Neon/NeonEnvironment.d.ts +2 -1
  246. package/lib/Neon/NeonEnvironment.d.ts.map +1 -1
  247. package/lib/Neon/NeonEnvironment.js +3 -2
  248. package/lib/Neon/NeonEnvironment.js.map +1 -1
  249. package/lib/Neon/Project.d.ts +16 -0
  250. package/lib/Neon/Project.d.ts.map +1 -1
  251. package/lib/Neon/Project.js +25 -0
  252. package/lib/Neon/Project.js.map +1 -1
  253. package/lib/Neon/Providers.d.ts +1 -1
  254. package/lib/Neon/Providers.d.ts.map +1 -1
  255. package/lib/Neon/Providers.js +3 -1
  256. package/lib/Neon/Providers.js.map +1 -1
  257. package/lib/Neon/api.d.ts +1 -0
  258. package/lib/Neon/api.d.ts.map +1 -1
  259. package/lib/Neon/api.js +1 -0
  260. package/lib/Neon/api.js.map +1 -1
  261. package/lib/Sidecar/RpcClient.d.ts.map +1 -1
  262. package/lib/Sidecar/RpcClient.js +8 -5
  263. package/lib/Sidecar/RpcClient.js.map +1 -1
  264. package/lib/Sidecar/RpcPaths.d.ts +5 -0
  265. package/lib/Sidecar/RpcPaths.d.ts.map +1 -1
  266. package/lib/Sidecar/RpcPaths.js +10 -1
  267. package/lib/Sidecar/RpcPaths.js.map +1 -1
  268. package/lib/Sidecar/RpcServer.d.ts +24 -4
  269. package/lib/Sidecar/RpcServer.d.ts.map +1 -1
  270. package/lib/Sidecar/RpcServer.js +70 -15
  271. package/lib/Sidecar/RpcServer.js.map +1 -1
  272. package/lib/Sidecar/RpcServerBun.d.ts +4 -0
  273. package/lib/Sidecar/RpcServerBun.d.ts.map +1 -0
  274. package/lib/Sidecar/RpcServerBun.js +28 -0
  275. package/lib/Sidecar/RpcServerBun.js.map +1 -0
  276. package/lib/Sidecar/RpcServerNode.d.ts +4 -0
  277. package/lib/Sidecar/RpcServerNode.d.ts.map +1 -0
  278. package/lib/Sidecar/RpcServerNode.js +39 -0
  279. package/lib/Sidecar/RpcServerNode.js.map +1 -0
  280. package/lib/Sidecar/RpcServices.d.ts +6 -0
  281. package/lib/Sidecar/RpcServices.d.ts.map +1 -0
  282. package/lib/Sidecar/RpcServices.js +29 -0
  283. package/lib/Sidecar/RpcServices.js.map +1 -0
  284. package/lib/Stack.d.ts +5 -3
  285. package/lib/Stack.d.ts.map +1 -1
  286. package/lib/Stack.js +3 -1
  287. package/lib/Stack.js.map +1 -1
  288. package/lib/Test/Core.d.ts.map +1 -1
  289. package/lib/Test/Core.js +5 -4
  290. package/lib/Test/Core.js.map +1 -1
  291. package/lib/Test/Vitest.d.ts.map +1 -1
  292. package/lib/Test/Vitest.js +2 -0
  293. package/lib/Test/Vitest.js.map +1 -1
  294. package/lib/Util/LocalhostDns.d.ts +19 -0
  295. package/lib/Util/LocalhostDns.d.ts.map +1 -0
  296. package/lib/Util/LocalhostDns.js +55 -0
  297. package/lib/Util/LocalhostDns.js.map +1 -0
  298. package/lib/Util/PlatformServices.d.ts.map +1 -1
  299. package/lib/Util/PlatformServices.js +3 -1
  300. package/lib/Util/PlatformServices.js.map +1 -1
  301. package/lib/tsconfig.test.tsbuildinfo +1 -1
  302. package/package.json +16 -12
  303. package/src/AWS/AuthProvider.ts +269 -259
  304. package/src/AWS/Environment.ts +57 -3
  305. package/src/AWS/IAM/OpenIDConnectProvider.ts +19 -8
  306. package/src/AWS/IAM/Policy.ts +1 -1
  307. package/src/AWS/Providers.ts +2 -0
  308. package/src/Auth/Credentials.ts +82 -46
  309. package/src/Auth/Profile.ts +123 -69
  310. package/src/Axiom/AuthProvider.ts +263 -255
  311. package/src/Axiom/Credentials.ts +3 -4
  312. package/src/Axiom/Providers.ts +4 -0
  313. package/src/Cli/LoggingCli.ts +127 -11
  314. package/src/Cli/checkVersion.ts +57 -0
  315. package/src/Cli/commands/_shared.ts +4 -4
  316. package/src/Cli/commands/aws.ts +127 -0
  317. package/src/Cli/commands/cloudflare.ts +222 -0
  318. package/src/Cli/commands/deploy.ts +11 -10
  319. package/src/Cli/commands/dev.ts +28 -33
  320. package/src/Cli/commands/login.ts +9 -12
  321. package/src/Cli/commands/logs.ts +8 -8
  322. package/src/Cli/commands/profile.ts +14 -16
  323. package/src/Cli/commands/state.ts +8 -8
  324. package/src/Cli/commands/tail.ts +8 -8
  325. package/src/Cli/exec.ts +7 -3
  326. package/src/Cli/main.ts +23 -5
  327. package/src/Cli/selectCli.ts +33 -0
  328. package/src/Cloudflare/Auth/AuthProvider.ts +445 -430
  329. package/src/Cloudflare/CloudflareEnvironment.ts +3 -2
  330. package/src/Cloudflare/Credentials.ts +3 -4
  331. package/src/Cloudflare/Images/Images.ts +121 -0
  332. package/src/Cloudflare/Images/ImagesBinding.ts +192 -0
  333. package/src/Cloudflare/Images/index.ts +2 -0
  334. package/src/Cloudflare/Local/Sidecar.ts +13 -10
  335. package/src/Cloudflare/Local/SidecarHandlers.ts +8 -13
  336. package/src/Cloudflare/Local/SidecarServer.ts +6 -1
  337. package/src/Cloudflare/Logs.ts +115 -1
  338. package/src/Cloudflare/Providers.ts +9 -0
  339. package/src/Cloudflare/Queue/Queue.ts +1 -1
  340. package/src/Cloudflare/Queue/QueueConsumer.ts +262 -60
  341. package/src/Cloudflare/Queue/QueueEventSource.ts +234 -0
  342. package/src/Cloudflare/Queue/index.ts +1 -0
  343. package/src/Cloudflare/R2/R2Bucket.ts +570 -2
  344. package/src/Cloudflare/StateStore/State.ts +25 -16
  345. package/src/Cloudflare/Website/StaticSite.ts +11 -1
  346. package/src/Cloudflare/Workers/InferEnv.ts +7 -3
  347. package/src/Cloudflare/Workers/LocalWorkerProvider.ts +9 -1
  348. package/src/Cloudflare/Workers/Worker.ts +130 -231
  349. package/src/Cloudflare/Workers/WorkerBundle.ts +38 -12
  350. package/src/Cloudflare/Zone.ts +88 -0
  351. package/src/Cloudflare/index.ts +1 -0
  352. package/src/Drizzle/Schema.ts +21 -5
  353. package/src/GitHub/AuthProvider.ts +221 -217
  354. package/src/GitHub/Credentials.ts +3 -4
  355. package/src/GitHub/Providers.ts +4 -0
  356. package/src/GitHub/Secrets.ts +25 -1
  357. package/src/GitHub/Variables.ts +54 -0
  358. package/src/GitHub/index.ts +1 -0
  359. package/src/Neon/AuthProvider.ts +160 -154
  360. package/src/Neon/Credentials.ts +3 -4
  361. package/src/Neon/NeonEnvironment.ts +3 -2
  362. package/src/Neon/Project.ts +42 -0
  363. package/src/Neon/Providers.ts +4 -0
  364. package/src/Neon/api.ts +2 -0
  365. package/src/Sidecar/RpcClient.ts +8 -7
  366. package/src/Sidecar/RpcPaths.ts +11 -1
  367. package/src/Sidecar/RpcServer.ts +97 -24
  368. package/src/Sidecar/RpcServerBun.ts +41 -0
  369. package/src/Sidecar/RpcServerNode.ts +51 -0
  370. package/src/Sidecar/RpcServices.ts +48 -0
  371. package/src/Stack.ts +8 -0
  372. package/src/Test/Core.ts +10 -4
  373. package/src/Test/Vitest.ts +3 -0
  374. package/src/Util/LocalhostDns.ts +58 -0
  375. package/src/Util/PlatformServices.ts +3 -1
  376. package/lib/Cli/commands/bootstrap.d.ts +0 -20
  377. package/lib/Cli/commands/bootstrap.d.ts.map +0 -1
  378. package/lib/Cli/commands/bootstrap.js +0 -107
  379. package/lib/Cli/commands/bootstrap.js.map +0 -1
  380. package/lib/Sidecar/RpcTransport.d.ts +0 -22
  381. package/lib/Sidecar/RpcTransport.d.ts.map +0 -1
  382. package/lib/Sidecar/RpcTransport.js +0 -81
  383. package/lib/Sidecar/RpcTransport.js.map +0 -1
  384. package/lib/Test/TestCli.d.ts +0 -19
  385. package/lib/Test/TestCli.d.ts.map +0 -1
  386. package/lib/Test/TestCli.js +0 -175
  387. package/lib/Test/TestCli.js.map +0 -1
  388. package/src/Cli/commands/bootstrap.ts +0 -216
  389. package/src/Sidecar/RpcTransport.ts +0 -85
  390. 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
@@ -1,3 +1,4 @@
1
+ import { createRequire } from "node:module";
1
2
  import * as ConfigProvider from "effect/ConfigProvider";
2
3
  import * as Effect from "effect/Effect";
3
4
  import * as Layer from "effect/Layer";
@@ -7,6 +8,10 @@ import * as EffectContext from "effect/Context";
7
8
  import * as FileSystem from "effect/FileSystem";
8
9
  import * as Path$1 from "effect/Path";
9
10
  import { Path } from "effect/Path";
11
+ import * as Redacted from "effect/Redacted";
12
+ import path from "pathe";
13
+ import * as Config from "effect/Config";
14
+ import os from "node:os";
10
15
  import * as Console from "effect/Console";
11
16
  import * as Logger from "effect/Logger";
12
17
  import * as Option from "effect/Option";
@@ -16,12 +21,8 @@ import * as Data from "effect/Data";
16
21
  import * as Cause from "effect/Cause";
17
22
  import * as Deferred from "effect/Deferred";
18
23
  import { pipe } from "effect/Function";
19
- import * as Redacted from "effect/Redacted";
20
24
  import { SingleShotGen } from "effect/Utils";
21
25
  import { pipeArguments } from "effect/Pipeable";
22
- import path from "pathe";
23
- import * as Config from "effect/Config";
24
- import os from "node:os";
25
26
  import * as Duration from "effect/Duration";
26
27
  import * as Exit from "effect/Exit";
27
28
  import * as Metric from "effect/Metric";
@@ -45,6 +46,130 @@ const AlchemyContextLive = Layer.effect(AlchemyContext, Effect.gen(function* ()
45
46
  };
46
47
  }));
47
48
 
49
+ //#endregion
50
+ //#region lib/Auth/Profile.js
51
+ const rootDir = path.join(os.homedir(), ".alchemy");
52
+ const configFilePath = path.join(rootDir, "profiles.json");
53
+ /**
54
+ * Config key consulted by the various `fromAuthProvider` /
55
+ * `fromEnvironment` layers to pick which named profile in
56
+ * `~/.alchemy/profiles.json` to use. Defaults to `"default"`.
57
+ */
58
+ const ALCHEMY_PROFILE = Config.string("ALCHEMY_PROFILE").pipe(Config.withDefault("default"));
59
+ const CONFIG_VERSION = 0;
60
+ const emptyConfig = () => ({
61
+ version: CONFIG_VERSION,
62
+ profiles: {}
63
+ });
64
+ var Profile = class extends EffectContext.Service()("Alchemy::Profile") {};
65
+ /**
66
+ * Layer that builds the {@link Profile} service. Captures the
67
+ * {@link FileSystem.FileSystem} dependency at layer-build time, so any
68
+ * Effect that yields {@link Profile} ends up with `R = Profile` (no
69
+ * `FileSystem` leak). Provide this once at the top of your runtime
70
+ * (alongside `PlatformServices` / `NodeContext`).
71
+ */
72
+ const ProfileLive = Layer.effect(Profile, Effect.gen(function* () {
73
+ const fs = yield* FileSystem.FileSystem;
74
+ const readConfig = fs.readFileString(configFilePath).pipe(Effect.flatMap((data) => Effect.try({
75
+ try: () => {
76
+ const parsed = JSON.parse(data);
77
+ if (parsed?.version !== CONFIG_VERSION) return emptyConfig();
78
+ return parsed;
79
+ },
80
+ catch: emptyConfig
81
+ })), Effect.orElseSucceed(emptyConfig));
82
+ const writeConfig = (config) => fs.makeDirectory(path.dirname(configFilePath), { recursive: true }).pipe(Effect.flatMap(() => fs.writeFileString(configFilePath, JSON.stringify(config, null, 2))));
83
+ const getProfile = (name) => readConfig.pipe(Effect.map((config) => config.profiles[name]));
84
+ const setProfile = (name, profile$1) => readConfig.pipe(Effect.tap((config) => Effect.sync(() => config.profiles[name] = profile$1)), Effect.flatMap(writeConfig));
85
+ const deleteProfile = (name) => readConfig.pipe(Effect.flatMap((config) => {
86
+ if (!(name in config.profiles)) return Effect.succeed(false);
87
+ delete config.profiles[name];
88
+ return writeConfig(config).pipe(Effect.as(true));
89
+ }));
90
+ 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, {
91
+ ...existing,
92
+ [auth.name]: config
93
+ })));
94
+ return {
95
+ readConfig,
96
+ writeConfig,
97
+ getProfile,
98
+ setProfile,
99
+ deleteProfile,
100
+ loadOrConfigure
101
+ };
102
+ }));
103
+ /**
104
+ * Returns a `ConfigProvider` that overrides `ALCHEMY_PROFILE` with the
105
+ * given `profile` (when explicitly passed via the CLI `--profile` flag),
106
+ * falling through to `base` for everything else.
107
+ *
108
+ * Use this to let the CLI's `--profile <name>` win over `$ALCHEMY_PROFILE`
109
+ * without disturbing other config lookups.
110
+ */
111
+ const withProfileOverride = (base, profile$1) => {
112
+ if (profile$1 === void 0) return base;
113
+ const overrides = { ALCHEMY_PROFILE: profile$1 };
114
+ 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));
115
+ return ConfigProvider.orElse(base)(overrideProvider);
116
+ };
117
+
118
+ //#endregion
119
+ //#region lib/Auth/Credentials.js
120
+ const credentialsDirPath = path.join(rootDir, "credentials");
121
+ const profileCredentialsDirPath = (profile$1) => path.join(credentialsDirPath, profile$1);
122
+ const credentialsFilePath = (profile$1, provider) => path.join(profileCredentialsDirPath(profile$1), `${provider}.json`);
123
+ var CredentialsStore = class extends EffectContext.Service()("Alchemy::CredentialsStore") {};
124
+ const CredentialsStoreLive = Layer.effect(CredentialsStore, Effect.gen(function* () {
125
+ const fs = yield* FileSystem.FileSystem;
126
+ const read = (profile$1, provider) => fs.readFileString(credentialsFilePath(profile$1, provider)).pipe(Effect.catch(() => Effect.succeed(void 0)), Effect.map((data) => {
127
+ if (data === void 0) return void 0;
128
+ try {
129
+ return JSON.parse(data);
130
+ } catch {
131
+ return;
132
+ }
133
+ }));
134
+ const write = (profile$1, provider, credentials) => {
135
+ const filePath = credentialsFilePath(profile$1, provider);
136
+ return fs.makeDirectory(path.dirname(filePath), { recursive: true }).pipe(Effect.flatMap(() => fs.writeFileString(filePath, JSON.stringify(credentials, null, 2))));
137
+ };
138
+ const remove_ = (profile$1, provider) => fs.remove(credentialsFilePath(profile$1, provider)).pipe(Effect.catch(() => Effect.void));
139
+ const deleteProfile = (profile$1) => fs.remove(profileCredentialsDirPath(profile$1), { recursive: true }).pipe(Effect.catch(() => Effect.void));
140
+ return {
141
+ read,
142
+ write,
143
+ delete: remove_,
144
+ deleteProfile
145
+ };
146
+ }));
147
+
148
+ //#endregion
149
+ //#region lib/Util/LocalhostDns.js
150
+ let installed = false;
151
+ const isLocalhost = (hostname) => hostname === "localhost" || hostname === "[::1]" || hostname.endsWith(".localhost");
152
+ const installLocalhostDns = () => {
153
+ if (installed) return;
154
+ installed = true;
155
+ if (typeof globalThis.Bun !== "undefined") return;
156
+ try {
157
+ const require = createRequire(import.meta.url);
158
+ const undici = require("undici");
159
+ const dns = require("node:dns");
160
+ undici.setGlobalDispatcher(new undici.Agent({ connect: { lookup: (hostname, options, cb) => {
161
+ if (isLocalhost(hostname)) {
162
+ if (options && options.all) return cb(null, [{
163
+ address: "127.0.0.1",
164
+ family: 4
165
+ }]);
166
+ return cb(null, "127.0.0.1", 4);
167
+ }
168
+ return dns.lookup(hostname, options, cb);
169
+ } } }));
170
+ } catch {}
171
+ };
172
+
48
173
  //#endregion
49
174
  //#region lib/Util/PlatformServices.js
50
175
  const isBun = typeof Bun !== "undefined";
@@ -58,6 +183,7 @@ const PlatformServices = Effect.promise(async () => {
58
183
  }
59
184
  }).pipe(Layer.unwrap);
60
185
  const runMain = (effect, options) => {
186
+ installLocalhostDns();
61
187
  if (isBun) import("@effect/platform-bun/BunRuntime").then((BunRuntime) => BunRuntime.runMain(effect, options));
62
188
  else import("@effect/platform-node/NodeRuntime").then((NodeRuntime) => NodeRuntime.runMain(effect, options));
63
189
  };
@@ -333,44 +459,6 @@ const GenericService = () => (Kind) => {
333
459
  return Object.assign(Object.setPrototypeOf(make$2, service), service);
334
460
  };
335
461
 
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
462
  //#endregion
375
463
  //#region lib/Auth/AuthProvider.js
376
464
  var AuthProviders = class extends EffectContext.Service()("AuthProviders") {};
@@ -391,16 +479,16 @@ const loadConfigProvider = (envFile$1) => {
391
479
 
392
480
  //#endregion
393
481
  //#region lib/Util/effect.js
394
- const taggedFunction = (tag, fn) => {
482
+ const taggedFunction = (tag$1, fn) => {
395
483
  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}`
484
+ asEffect: () => tag$1.asEffect(),
485
+ [Symbol.iterator]: () => tag$1[Symbol.iterator](),
486
+ pipe: (...fns) => pipeArguments(tag$1.asEffect(), fns),
487
+ toString: () => `${tag$1.toString()}.${fn.name}`
400
488
  };
401
489
  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)
490
+ 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),
491
+ has: (target, prop) => Reflect.has(overrides, prop) || Reflect.has(target, prop) || Reflect.has(tag$1, prop)
404
492
  });
405
493
  };
406
494
 
@@ -445,7 +533,7 @@ const make$1 = (options) => (effect) => Effect.scope.pipe(Effect.flatMap((scope)
445
533
  services: EffectContext.merge(services$1, context)
446
534
  })), Effect.provideContext(context))));
447
535
  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 }));
536
+ const platform = Layer.mergeAll(PlatformServices, FetchHttpClient.layer, Logger.layer([fileLogger("out")], { mergeWithExisting: true }), Layer.provide(ProfileLive, PlatformServices), Layer.provide(CredentialsStoreLive, PlatformServices));
449
537
 
450
538
  //#endregion
451
539
  //#region lib/Resource.js
@@ -920,7 +1008,7 @@ const make = (stack, options = {}) => Effect.gen(function* () {
920
1008
  const ctx = yield* Effect.serviceOption(AlchemyContext);
921
1009
  return Option.match(ctx, {
922
1010
  onNone: () => false,
923
- onSome: (c) => c.adopt
1011
+ onSome: (c$1) => c$1.adopt
924
1012
  });
925
1013
  });
926
1014
  const resourceFqns = yield* state.list({
@@ -2067,6 +2155,99 @@ const planCommand = Command.make("plan", {
2067
2155
  dryRun: true
2068
2156
  })));
2069
2157
 
2158
+ //#endregion
2159
+ //#region lib/Cli/LoggingCli.js
2160
+ const ESC = "\x1B[";
2161
+ const RESET = `${ESC}0m`;
2162
+ const useColor = process.stdout.hasColors?.() ?? !!process.stdout.isTTY;
2163
+ const c = (code, s) => useColor ? `${ESC}${code}m${s}${RESET}` : s;
2164
+ const dim = (s) => c("2", s);
2165
+ const bold = (s) => c("1", s);
2166
+ const red = (s) => c("31", s);
2167
+ const green = (s) => c("32", s);
2168
+ const yellow = (s) => c("33", s);
2169
+ const blue = (s) => c("34", s);
2170
+ const magenta = (s) => c("35", s);
2171
+ const cyan = (s) => c("36", s);
2172
+ const actionColor$1 = {
2173
+ create: green,
2174
+ update: yellow,
2175
+ replace: magenta,
2176
+ delete: red,
2177
+ noop: dim
2178
+ };
2179
+ const statusColor$1 = (status) => {
2180
+ switch (status) {
2181
+ case "created":
2182
+ case "updated":
2183
+ case "replaced": return green;
2184
+ case "deleted": return dim;
2185
+ case "fail": return red;
2186
+ case "attaching":
2187
+ case "post-attach": return cyan;
2188
+ default: return yellow;
2189
+ }
2190
+ };
2191
+ const tag = (id) => bold(`[${id}]`);
2192
+ const isTerminal = (status) => status === "created" || status === "updated" || status === "deleted" || status === "replaced" || status === "fail";
2193
+ const formatPlanLines = (plan) => {
2194
+ const items = [...Object.values(plan.resources), ...Object.values(plan.deletions)];
2195
+ if (items.length === 0) return [bold("Plan:") + " no changes"];
2196
+ const counts = items.reduce((acc, item) => (acc[item.action] = (acc[item.action] ?? 0) + 1, acc), {});
2197
+ const summary = [
2198
+ "create",
2199
+ "update",
2200
+ "replace",
2201
+ "delete",
2202
+ "noop"
2203
+ ].filter((a) => counts[a]).map((a) => actionColor$1[a](`${counts[a]} to ${a}`)).join(dim(", "));
2204
+ const sorted = [...items].sort((a, b) => a.resource.LogicalId.localeCompare(b.resource.LogicalId));
2205
+ const lines = [`${bold("Plan:")} ${summary}`];
2206
+ for (const item of sorted) {
2207
+ const action = actionColor$1[item.action](item.action);
2208
+ lines.push(`${tag(item.resource.LogicalId)} ${action}`);
2209
+ for (const binding of item.bindings) {
2210
+ if (binding.action === "noop") continue;
2211
+ const bindingAction = actionColor$1[binding.action](binding.action);
2212
+ lines.push(`${tag(`${item.resource.LogicalId}/${binding.sid}`)} ${bindingAction}`);
2213
+ }
2214
+ }
2215
+ return lines;
2216
+ };
2217
+ const LoggingCli = Layer.succeed(Cli, Cli.of({
2218
+ approvePlan: (plan) => Effect.gen(function* () {
2219
+ for (const line of formatPlanLines(plan)) yield* Console.log(line);
2220
+ yield* Console.log(`\n${yellow("Non-interactive terminal detected.")} Pass ${bold("--yes")} to approve, or set ${bold("ALCHEMY_TUI=1")} for the interactive UI.`);
2221
+ return false;
2222
+ }),
2223
+ displayPlan: (plan) => Effect.gen(function* () {
2224
+ for (const line of formatPlanLines(plan)) yield* Console.log(line);
2225
+ }),
2226
+ startApplySession: (plan) => Effect.gen(function* () {
2227
+ for (const line of formatPlanLines(plan)) yield* Console.log(line);
2228
+ yield* Console.log("");
2229
+ const counts = {
2230
+ ok: 0,
2231
+ fail: 0
2232
+ };
2233
+ return {
2234
+ emit: (event) => Effect.sync(() => {
2235
+ if (event.kind === "annotate") {
2236
+ console.log(`${tag(event.id)} ${blue(event.message)}`);
2237
+ return;
2238
+ }
2239
+ const id = event.bindingId ? `${event.id}/${event.bindingId}` : event.id;
2240
+ const status = statusColor$1(event.status)(event.status);
2241
+ const msg = event.message ? ` ${dim("—")} ${event.message}` : "";
2242
+ console.log(`${tag(id)} ${status}${msg}`);
2243
+ if (isTerminal(event.status)) if (event.status === "fail") counts.fail++;
2244
+ else counts.ok++;
2245
+ }),
2246
+ done: () => Console.log(`\n${bold("Done:")} ${green(`${counts.ok} succeeded`)}${counts.fail ? dim(", ") + red(`${counts.fail} failed`) : ""}`)
2247
+ };
2248
+ })
2249
+ }));
2250
+
2070
2251
  //#endregion
2071
2252
  //#region lib/Cli/NamespaceTree.js
2072
2253
  function buildNamespaceTree(items) {
@@ -2611,9 +2792,29 @@ const startApplySession = Effect.fn(function* (plan) {
2611
2792
  };
2612
2793
  });
2613
2794
 
2795
+ //#endregion
2796
+ //#region lib/Cli/selectCli.js
2797
+ /**
2798
+ * Returns true when the current process looks like it's being driven by a
2799
+ * coding agent, CI runner, or anything else that won't render an interactive
2800
+ * TUI well. The Ink renderer repaints the screen on every event, which floods
2801
+ * agent transcripts with redundant frames; LoggingCli emits one line per
2802
+ * status change instead.
2803
+ */
2804
+ const isNonInteractive = () => {
2805
+ const env = process.env;
2806
+ if (env.ALCHEMY_PLAIN === "1" || env.ALCHEMY_NO_TUI === "1") return true;
2807
+ if (env.ALCHEMY_TUI === "1") return false;
2808
+ if (!process.stdout.isTTY) return true;
2809
+ if (env.CI) return true;
2810
+ if (env.CLAUDECODE || env.CLAUDE_CODE_ENTRYPOINT || env.CURSOR_AGENT || env.AIDER_MODEL || env.CODEX_CLI) return true;
2811
+ return false;
2812
+ };
2813
+ const selectCli = () => isNonInteractive() ? LoggingCli : inkCLI();
2814
+
2614
2815
  //#endregion
2615
2816
  //#region lib/Cli/exec.js
2616
- const services = Layer.mergeAll(Layer.provideMerge(AlchemyContextLive, PlatformServices), FetchHttpClient.layer, ConfigProvider.layer(ConfigProvider.fromEnv()), inkCLI());
2817
+ const services = Layer.mergeAll(Layer.provideMerge(AlchemyContextLive, PlatformServices), Layer.provide(ProfileLive, PlatformServices), Layer.provide(CredentialsStoreLive, PlatformServices), FetchHttpClient.layer, ConfigProvider.layer(ConfigProvider.fromEnv()), selectCli());
2617
2818
  const exec = () => execStack(S.decodeSync(ExecStackOptions)(JSON.parse(process.env.ALCHEMY_EXEC_OPTIONS))).pipe(Effect.provide(services), Effect.scoped);
2618
2819
 
2619
2820
  //#endregion