alchemy 2.0.0-beta.84 → 2.0.0-beta.85

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 (758) hide show
  1. package/THIRD_PARTY_LICENSES.md +2 -2
  2. package/bin/cli.js +14 -6
  3. package/bin/register-oxc.js +16 -12
  4. package/lib/AdoptPolicy.d.ts +73 -0
  5. package/lib/AdoptPolicy.d.ts.map +1 -1
  6. package/lib/AdoptPolicy.js +54 -0
  7. package/lib/AdoptPolicy.js.map +1 -1
  8. package/lib/Alchemist/AuthRegistry.d.ts +31 -0
  9. package/lib/Alchemist/AuthRegistry.d.ts.map +1 -0
  10. package/lib/Alchemist/AuthRegistry.js +95 -0
  11. package/lib/Alchemist/AuthRegistry.js.map +1 -0
  12. package/lib/Alchemist/Drift.d.ts +70 -0
  13. package/lib/Alchemist/Drift.d.ts.map +1 -0
  14. package/lib/Alchemist/Drift.js +54 -0
  15. package/lib/Alchemist/Drift.js.map +1 -0
  16. package/lib/Alchemist/Entrypoint.d.ts +27 -3
  17. package/lib/Alchemist/Entrypoint.d.ts.map +1 -1
  18. package/lib/Alchemist/Entrypoint.js +34 -3
  19. package/lib/Alchemist/Entrypoint.js.map +1 -1
  20. package/lib/Alchemist/Errors.d.ts +1 -1
  21. package/lib/Alchemist/Errors.d.ts.map +1 -1
  22. package/lib/Alchemist/Errors.js +1 -1
  23. package/lib/Alchemist/Errors.js.map +1 -1
  24. package/lib/Alchemist/Logs.d.ts +46 -0
  25. package/lib/Alchemist/Logs.d.ts.map +1 -0
  26. package/lib/Alchemist/{routes/logs.js → Logs.js} +21 -26
  27. package/lib/Alchemist/Logs.js.map +1 -0
  28. package/lib/Alchemist/Nuke.d.ts +69 -0
  29. package/lib/Alchemist/Nuke.d.ts.map +1 -0
  30. package/lib/Alchemist/Nuke.js +35 -0
  31. package/lib/Alchemist/Nuke.js.map +1 -0
  32. package/lib/Alchemist/Operations.d.ts +168 -0
  33. package/lib/Alchemist/Operations.d.ts.map +1 -0
  34. package/lib/Alchemist/Operations.js +165 -0
  35. package/lib/Alchemist/Operations.js.map +1 -0
  36. package/lib/Alchemist/Profile.d.ts +132 -0
  37. package/lib/Alchemist/Profile.d.ts.map +1 -0
  38. package/lib/Alchemist/{routes/profile.js → Profile.js} +20 -21
  39. package/lib/Alchemist/Profile.js.map +1 -0
  40. package/lib/Alchemist/{routes/provider.d.ts → Provider.d.ts} +4 -4
  41. package/lib/Alchemist/Provider.d.ts.map +1 -0
  42. package/lib/Alchemist/{routes/provider.js → Provider.js} +7 -6
  43. package/lib/Alchemist/Provider.js.map +1 -0
  44. package/lib/Alchemist/Runtime.d.ts +10 -6
  45. package/lib/Alchemist/Runtime.d.ts.map +1 -1
  46. package/lib/Alchemist/Runtime.js +38 -2
  47. package/lib/Alchemist/Runtime.js.map +1 -1
  48. package/lib/Alchemist/{routes/state.d.ts → State.d.ts} +36 -16
  49. package/lib/Alchemist/State.d.ts.map +1 -0
  50. package/lib/Alchemist/{routes/state.js → State.js} +50 -15
  51. package/lib/Alchemist/State.js.map +1 -0
  52. package/lib/Alchemist/index.d.ts +11 -10
  53. package/lib/Alchemist/index.d.ts.map +1 -1
  54. package/lib/Alchemist/index.js +10 -9
  55. package/lib/Alchemist/index.js.map +1 -1
  56. package/lib/Apply.d.ts +2 -8
  57. package/lib/Apply.d.ts.map +1 -1
  58. package/lib/Apply.js +364 -184
  59. package/lib/Apply.js.map +1 -1
  60. package/lib/Auth/AuthProvider.d.ts +24 -11
  61. package/lib/Auth/AuthProvider.d.ts.map +1 -1
  62. package/lib/Auth/AuthProvider.js +28 -12
  63. package/lib/Auth/AuthProvider.js.map +1 -1
  64. package/lib/Auth/BrowserOAuth.d.ts +6 -8
  65. package/lib/Auth/BrowserOAuth.d.ts.map +1 -1
  66. package/lib/Auth/BrowserOAuth.js +25 -41
  67. package/lib/Auth/BrowserOAuth.js.map +1 -1
  68. package/lib/Auth/Credentials.d.ts.map +1 -1
  69. package/lib/Auth/Credentials.js +2 -2
  70. package/lib/Auth/Credentials.js.map +1 -1
  71. package/lib/Auth/Demand.d.ts +4 -4
  72. package/lib/Auth/Demand.d.ts.map +1 -1
  73. package/lib/Auth/Demand.js +16 -10
  74. package/lib/Auth/Demand.js.map +1 -1
  75. package/lib/Auth/Env.d.ts +2 -1
  76. package/lib/Auth/Env.d.ts.map +1 -1
  77. package/lib/Auth/Env.js +4 -2
  78. package/lib/Auth/Env.js.map +1 -1
  79. package/lib/Auth/Inspect.d.ts +2 -2
  80. package/lib/Auth/Inspect.d.ts.map +1 -1
  81. package/lib/Auth/Inspect.js +3 -1
  82. package/lib/Auth/Inspect.js.map +1 -1
  83. package/lib/Auth/Lock.d.ts.map +1 -1
  84. package/lib/Auth/Lock.js +4 -8
  85. package/lib/Auth/Lock.js.map +1 -1
  86. package/lib/Auth/OAuthFlow.d.ts +3 -12
  87. package/lib/Auth/OAuthFlow.d.ts.map +1 -1
  88. package/lib/Auth/OAuthFlow.js +7 -17
  89. package/lib/Auth/OAuthFlow.js.map +1 -1
  90. package/lib/Auth/Paths.d.ts +2 -1
  91. package/lib/Auth/Paths.d.ts.map +1 -1
  92. package/lib/Auth/Paths.js +3 -2
  93. package/lib/Auth/Paths.js.map +1 -1
  94. package/lib/Auth/Profile.d.ts +10 -0
  95. package/lib/Auth/Profile.d.ts.map +1 -1
  96. package/lib/Auth/Profile.js +19 -2
  97. package/lib/Auth/Profile.js.map +1 -1
  98. package/lib/Auth/Registry.d.ts +20 -0
  99. package/lib/Auth/Registry.d.ts.map +1 -0
  100. package/lib/Auth/Registry.js +17 -0
  101. package/lib/Auth/Registry.js.map +1 -0
  102. package/lib/Auth/Resolve.d.ts +34 -2
  103. package/lib/Auth/Resolve.d.ts.map +1 -1
  104. package/lib/Auth/Resolve.js +51 -3
  105. package/lib/Auth/Resolve.js.map +1 -1
  106. package/lib/Auth/StoredAuthProvider.d.ts +1 -1
  107. package/lib/Auth/StoredAuthProvider.d.ts.map +1 -1
  108. package/lib/Auth/StoredAuthProvider.js +1 -2
  109. package/lib/Auth/StoredAuthProvider.js.map +1 -1
  110. package/lib/Binding.d.ts.map +1 -1
  111. package/lib/Binding.js +3 -1
  112. package/lib/Binding.js.map +1 -1
  113. package/lib/Bundle/Bundle.d.ts +5 -0
  114. package/lib/Bundle/Bundle.d.ts.map +1 -1
  115. package/lib/Bundle/Bundle.js +36 -6
  116. package/lib/Bundle/Bundle.js.map +1 -1
  117. package/lib/Bundle/NamespaceImportPlugin.d.ts +55 -0
  118. package/lib/Bundle/NamespaceImportPlugin.d.ts.map +1 -0
  119. package/lib/Bundle/NamespaceImportPlugin.js +226 -0
  120. package/lib/Bundle/NamespaceImportPlugin.js.map +1 -0
  121. package/lib/Bundle/index.d.ts +1 -0
  122. package/lib/Bundle/index.d.ts.map +1 -1
  123. package/lib/Bundle/index.js +1 -0
  124. package/lib/Bundle/index.js.map +1 -1
  125. package/lib/Cli/Format.d.ts.map +1 -1
  126. package/lib/Cli/Format.js +2 -1
  127. package/lib/Cli/Format.js.map +1 -1
  128. package/lib/Cli/GlobalLog.d.ts +72 -26
  129. package/lib/Cli/GlobalLog.d.ts.map +1 -1
  130. package/lib/Cli/GlobalLog.js +151 -59
  131. package/lib/Cli/GlobalLog.js.map +1 -1
  132. package/lib/Cli/LoggingCli.d.ts.map +1 -1
  133. package/lib/Cli/LoggingCli.js +24 -18
  134. package/lib/Cli/LoggingCli.js.map +1 -1
  135. package/lib/Cli/PlainCliFormatter.d.ts.map +1 -1
  136. package/lib/Cli/PlainCliFormatter.js +4 -1
  137. package/lib/Cli/PlainCliFormatter.js.map +1 -1
  138. package/lib/Cli/Present.d.ts +14 -0
  139. package/lib/Cli/Present.d.ts.map +1 -0
  140. package/lib/Cli/Present.js +22 -0
  141. package/lib/Cli/Present.js.map +1 -0
  142. package/lib/Cli/SigilRenderer.d.ts +58 -0
  143. package/lib/Cli/SigilRenderer.d.ts.map +1 -0
  144. package/lib/Cli/SigilRenderer.js +39 -0
  145. package/lib/Cli/SigilRenderer.js.map +1 -0
  146. package/lib/Cli/checkVersion.d.ts +11 -14
  147. package/lib/Cli/checkVersion.d.ts.map +1 -1
  148. package/lib/Cli/checkVersion.js +19 -77
  149. package/lib/Cli/checkVersion.js.map +1 -1
  150. package/lib/Cli/commands/confirm.d.ts +2 -2
  151. package/lib/Cli/commands/confirm.d.ts.map +1 -1
  152. package/lib/Cli/commands/confirm.js +3 -3
  153. package/lib/Cli/commands/confirm.js.map +1 -1
  154. package/lib/Cli/commands/deploy.d.ts +4 -4
  155. package/lib/Cli/commands/deploy.d.ts.map +1 -1
  156. package/lib/Cli/commands/deploy.js +40 -39
  157. package/lib/Cli/commands/deploy.js.map +1 -1
  158. package/lib/Cli/commands/dev.d.ts.map +1 -1
  159. package/lib/Cli/commands/dev.js +41 -3
  160. package/lib/Cli/commands/dev.js.map +1 -1
  161. package/lib/Cli/commands/drift.d.ts +2 -2
  162. package/lib/Cli/commands/drift.d.ts.map +1 -1
  163. package/lib/Cli/commands/drift.js +14 -13
  164. package/lib/Cli/commands/drift.js.map +1 -1
  165. package/lib/Cli/commands/errors.d.ts.map +1 -1
  166. package/lib/Cli/commands/errors.js +2 -1
  167. package/lib/Cli/commands/errors.js.map +1 -1
  168. package/lib/Cli/commands/instrument.d.ts +15 -5
  169. package/lib/Cli/commands/instrument.d.ts.map +1 -1
  170. package/lib/Cli/commands/instrument.js +33 -8
  171. package/lib/Cli/commands/instrument.js.map +1 -1
  172. package/lib/Cli/commands/logs.d.ts +1 -1
  173. package/lib/Cli/commands/logs.d.ts.map +1 -1
  174. package/lib/Cli/commands/logs.js +22 -22
  175. package/lib/Cli/commands/logs.js.map +1 -1
  176. package/lib/Cli/commands/nuke.d.ts +3 -2
  177. package/lib/Cli/commands/nuke.d.ts.map +1 -1
  178. package/lib/Cli/commands/nuke.js +19 -17
  179. package/lib/Cli/commands/nuke.js.map +1 -1
  180. package/lib/Cli/commands/profile/commands.d.ts +3 -2
  181. package/lib/Cli/commands/profile/commands.d.ts.map +1 -1
  182. package/lib/Cli/commands/profile/commands.js +26 -27
  183. package/lib/Cli/commands/profile/commands.js.map +1 -1
  184. package/lib/Cli/commands/profile/flows.d.ts +6 -5
  185. package/lib/Cli/commands/profile/flows.d.ts.map +1 -1
  186. package/lib/Cli/commands/profile/flows.js +19 -17
  187. package/lib/Cli/commands/profile/flows.js.map +1 -1
  188. package/lib/Cli/commands/profile/hub.d.ts +1 -2
  189. package/lib/Cli/commands/profile/hub.d.ts.map +1 -1
  190. package/lib/Cli/commands/profile/hub.js +15 -17
  191. package/lib/Cli/commands/profile/hub.js.map +1 -1
  192. package/lib/Cli/commands/provider.d.ts +3 -1
  193. package/lib/Cli/commands/provider.d.ts.map +1 -1
  194. package/lib/Cli/commands/provider.js +4 -4
  195. package/lib/Cli/commands/provider.js.map +1 -1
  196. package/lib/Cli/commands/render.d.ts +2 -4
  197. package/lib/Cli/commands/render.d.ts.map +1 -1
  198. package/lib/Cli/commands/render.js +33 -56
  199. package/lib/Cli/commands/render.js.map +1 -1
  200. package/lib/Cli/commands/state.d.ts +1 -2
  201. package/lib/Cli/commands/state.d.ts.map +1 -1
  202. package/lib/Cli/commands/state.js +74 -27
  203. package/lib/Cli/commands/state.js.map +1 -1
  204. package/lib/Cli/components/capabilities.d.ts +4 -0
  205. package/lib/Cli/components/capabilities.d.ts.map +1 -0
  206. package/lib/Cli/components/capabilities.js +18 -0
  207. package/lib/Cli/components/capabilities.js.map +1 -0
  208. package/lib/Cli/components/types.d.ts +2 -81
  209. package/lib/Cli/components/types.d.ts.map +1 -1
  210. package/lib/Cli/components/types.js +1 -3
  211. package/lib/Cli/components/types.js.map +1 -1
  212. package/lib/Cli/components/ui/Environment.d.ts +3 -3
  213. package/lib/Cli/components/ui/Environment.d.ts.map +1 -1
  214. package/lib/Cli/components/ui/Environment.js.map +1 -1
  215. package/lib/Cli/components/ui/Interactive.d.ts +17 -4
  216. package/lib/Cli/components/ui/Interactive.d.ts.map +1 -1
  217. package/lib/Cli/components/ui/Interactive.js +7 -11
  218. package/lib/Cli/components/ui/Interactive.js.map +1 -1
  219. package/lib/Cli/components/ui/Layout.d.ts +1 -1
  220. package/lib/Cli/components/ui/Layout.d.ts.map +1 -1
  221. package/lib/Cli/components/ui/Layout.js +1 -1
  222. package/lib/Cli/components/ui/Layout.js.map +1 -1
  223. package/lib/Cli/components/ui/Typography.d.ts +1 -1
  224. package/lib/Cli/components/ui/Typography.d.ts.map +1 -1
  225. package/lib/Cli/components/ui/Typography.js +1 -1
  226. package/lib/Cli/components/ui/Typography.js.map +1 -1
  227. package/lib/Cli/components/ui/index.d.ts +2 -2
  228. package/lib/Cli/components/ui/index.js +2 -2
  229. package/lib/Cli/components/view/ApprovePlan.d.ts +1 -1
  230. package/lib/Cli/components/view/ApprovePlan.d.ts.map +1 -1
  231. package/lib/Cli/components/view/ApprovePlan.js +2 -1
  232. package/lib/Cli/components/view/ApprovePlan.js.map +1 -1
  233. package/lib/Cli/components/view/Format.d.ts +5 -0
  234. package/lib/Cli/components/view/Format.d.ts.map +1 -0
  235. package/lib/Cli/components/view/Format.js +39 -0
  236. package/lib/Cli/components/view/Format.js.map +1 -0
  237. package/lib/Cli/components/view/Help.d.ts +2 -2
  238. package/lib/Cli/components/view/Help.d.ts.map +1 -1
  239. package/lib/Cli/components/view/Help.js +7 -5
  240. package/lib/Cli/components/view/Help.js.map +1 -1
  241. package/lib/Cli/components/view/Logo.js +1 -1
  242. package/lib/Cli/components/view/Logo.js.map +1 -1
  243. package/lib/Cli/components/view/Nuke.d.ts +8 -9
  244. package/lib/Cli/components/view/Nuke.d.ts.map +1 -1
  245. package/lib/Cli/components/view/Nuke.js +49 -52
  246. package/lib/Cli/components/view/Nuke.js.map +1 -1
  247. package/lib/Cli/components/view/PlanDecision.d.ts +1 -1
  248. package/lib/Cli/components/view/PlanDecision.d.ts.map +1 -1
  249. package/lib/Cli/components/view/PlanDecision.js +1 -1
  250. package/lib/Cli/components/view/PlanDecision.js.map +1 -1
  251. package/lib/Cli/components/view/PlanRow.js +1 -1
  252. package/lib/Cli/components/view/PlanRow.js.map +1 -1
  253. package/lib/Cli/components/view/PlanTree.d.ts +1 -1
  254. package/lib/Cli/components/view/PlanTree.d.ts.map +1 -1
  255. package/lib/Cli/components/view/PlanTree.js +1 -1
  256. package/lib/Cli/components/view/PlanView.js +1 -1
  257. package/lib/Cli/components/view/PlanView.js.map +1 -1
  258. package/lib/Cli/components/view/Profile.d.ts +1 -1
  259. package/lib/Cli/components/view/Profile.js +2 -2
  260. package/lib/Cli/components/view/Profile.js.map +1 -1
  261. package/lib/Cli/components/view/ProfileDashboard.d.ts +4 -4
  262. package/lib/Cli/components/view/ProfileDashboard.d.ts.map +1 -1
  263. package/lib/Cli/components/view/ProfileDashboard.js +9 -8
  264. package/lib/Cli/components/view/ProfileDashboard.js.map +1 -1
  265. package/lib/Cli/components/view/Prompts.d.ts +3 -3
  266. package/lib/Cli/components/view/Prompts.d.ts.map +1 -1
  267. package/lib/Cli/components/view/Prompts.js +11 -18
  268. package/lib/Cli/components/view/Prompts.js.map +1 -1
  269. package/lib/Cli/components/view/Runtime.d.ts +5 -5
  270. package/lib/Cli/components/view/Runtime.d.ts.map +1 -1
  271. package/lib/Cli/components/view/Runtime.js +136 -219
  272. package/lib/Cli/components/view/Runtime.js.map +1 -1
  273. package/lib/Cli/components/view/SigilCli.d.ts +2 -2
  274. package/lib/Cli/components/view/SigilCli.d.ts.map +1 -1
  275. package/lib/Cli/components/view/SigilCli.js +7 -7
  276. package/lib/Cli/components/view/SigilCli.js.map +1 -1
  277. package/lib/Cli/components/view/StateExplorer.d.ts +1 -1
  278. package/lib/Cli/components/view/StateExplorer.d.ts.map +1 -1
  279. package/lib/Cli/components/view/StateExplorer.js +2 -1
  280. package/lib/Cli/components/view/StateExplorer.js.map +1 -1
  281. package/lib/Cli/components/view/statusStyle.d.ts +2 -2
  282. package/lib/Cli/components/view/statusStyle.d.ts.map +1 -1
  283. package/lib/Cli/components/view/statusStyle.js +1 -1
  284. package/lib/Cli/components/view/statusStyle.js.map +1 -1
  285. package/lib/Cli/exec.d.ts +6 -1
  286. package/lib/Cli/exec.d.ts.map +1 -1
  287. package/lib/Cli/exec.js +29 -34
  288. package/lib/Cli/exec.js.map +1 -1
  289. package/lib/Cli/main.d.ts.map +1 -1
  290. package/lib/Cli/main.js +35 -26
  291. package/lib/Cli/main.js.map +1 -1
  292. package/lib/Cli/selectCli.d.ts +2 -2
  293. package/lib/Cli/selectCli.d.ts.map +1 -1
  294. package/lib/Cli/selectCli.js +2 -2
  295. package/lib/Cli/selectCli.js.map +1 -1
  296. package/lib/Command/Command.js +1 -1
  297. package/lib/Command/Command.js.map +1 -1
  298. package/lib/Command/Dev.d.ts +58 -4
  299. package/lib/Command/Dev.d.ts.map +1 -1
  300. package/lib/Command/Dev.js +87 -30
  301. package/lib/Command/Dev.js.map +1 -1
  302. package/lib/Command/Local.d.ts +1 -1
  303. package/lib/Command/Memo.js +1 -1
  304. package/lib/Command/Memo.js.map +1 -1
  305. package/lib/Command/Providers.d.ts +1 -1
  306. package/lib/Command/Providers.d.ts.map +1 -1
  307. package/lib/Contributions.d.ts +2 -3
  308. package/lib/Contributions.d.ts.map +1 -1
  309. package/lib/Contributions.js +38 -6
  310. package/lib/Contributions.js.map +1 -1
  311. package/lib/DNS/Adapter.d.ts +204 -0
  312. package/lib/DNS/Adapter.d.ts.map +1 -0
  313. package/lib/DNS/Adapter.js +112 -0
  314. package/lib/DNS/Adapter.js.map +1 -0
  315. package/lib/DNS/index.d.ts +2 -0
  316. package/lib/DNS/index.d.ts.map +1 -0
  317. package/lib/DNS/index.js +2 -0
  318. package/lib/DNS/index.js.map +1 -0
  319. package/lib/Deploy.d.ts +7 -2
  320. package/lib/Deploy.d.ts.map +1 -1
  321. package/lib/Deploy.js +8 -3
  322. package/lib/Deploy.js.map +1 -1
  323. package/lib/Destroy.d.ts +5 -8
  324. package/lib/Destroy.d.ts.map +1 -1
  325. package/lib/Destroy.js +10 -7
  326. package/lib/Destroy.js.map +1 -1
  327. package/lib/Diff.d.ts.map +1 -1
  328. package/lib/Diff.js +14 -4
  329. package/lib/Diff.js.map +1 -1
  330. package/lib/Drift.d.ts +7 -7
  331. package/lib/Drift.d.ts.map +1 -1
  332. package/lib/Drift.js +184 -101
  333. package/lib/Drift.js.map +1 -1
  334. package/lib/EvalStack.d.ts +23 -0
  335. package/lib/EvalStack.d.ts.map +1 -0
  336. package/lib/EvalStack.js +47 -0
  337. package/lib/EvalStack.js.map +1 -0
  338. package/lib/Events.d.ts +210 -0
  339. package/lib/Events.d.ts.map +1 -0
  340. package/lib/Events.js +244 -0
  341. package/lib/Events.js.map +1 -0
  342. package/lib/Interaction.d.ts +159 -48
  343. package/lib/Interaction.d.ts.map +1 -1
  344. package/lib/Interaction.js +139 -58
  345. package/lib/Interaction.js.map +1 -1
  346. package/lib/Local/LocalProvider.d.ts.map +1 -1
  347. package/lib/Local/LocalProvider.js +31 -9
  348. package/lib/Local/LocalProvider.js.map +1 -1
  349. package/lib/Local/RpcProvider.d.ts.map +1 -1
  350. package/lib/Local/RpcProvider.js +10 -1
  351. package/lib/Local/RpcProvider.js.map +1 -1
  352. package/lib/Local/RpcProviderProxy.d.ts +16 -0
  353. package/lib/Local/RpcProviderProxy.d.ts.map +1 -1
  354. package/lib/Local/RpcProviderProxy.js +19 -10
  355. package/lib/Local/RpcProviderProxy.js.map +1 -1
  356. package/lib/Local/RpcSerialization.d.ts +3 -2
  357. package/lib/Local/RpcSerialization.d.ts.map +1 -1
  358. package/lib/Local/RpcSerialization.js +13 -10
  359. package/lib/Local/RpcSerialization.js.map +1 -1
  360. package/lib/Local/RpcServer.d.ts +2 -1
  361. package/lib/Local/RpcServer.d.ts.map +1 -1
  362. package/lib/Local/RpcServer.js +19 -14
  363. package/lib/Local/RpcServer.js.map +1 -1
  364. package/lib/Local/RpcServerBun.d.ts.map +1 -1
  365. package/lib/Local/RpcServerBun.js +8 -4
  366. package/lib/Local/RpcServerBun.js.map +1 -1
  367. package/lib/Local/RpcServerEnvironment.d.ts +2 -3
  368. package/lib/Local/RpcServerEnvironment.d.ts.map +1 -1
  369. package/lib/Local/RpcServerEnvironment.js +2 -2
  370. package/lib/Local/RpcServerEnvironment.js.map +1 -1
  371. package/lib/Local/RpcServerNode.d.ts.map +1 -1
  372. package/lib/Local/RpcServerNode.js +5 -1
  373. package/lib/Local/RpcServerNode.js.map +1 -1
  374. package/lib/Local/RpcServerSession.d.ts +1 -1
  375. package/lib/Local/RpcServerSession.d.ts.map +1 -1
  376. package/lib/Local/RpcServerSession.js.map +1 -1
  377. package/lib/Local/RpcSpawner.d.ts +6 -8
  378. package/lib/Local/RpcSpawner.d.ts.map +1 -1
  379. package/lib/Local/RpcSpawner.js +45 -36
  380. package/lib/Local/RpcSpawner.js.map +1 -1
  381. package/lib/Local/Sidecar.d.ts +23 -0
  382. package/lib/Local/Sidecar.d.ts.map +1 -1
  383. package/lib/Local/Sidecar.js +14 -9
  384. package/lib/Local/Sidecar.js.map +1 -1
  385. package/lib/Nuke.d.ts +5 -23
  386. package/lib/Nuke.d.ts.map +1 -1
  387. package/lib/Nuke.js +48 -13
  388. package/lib/Nuke.js.map +1 -1
  389. package/lib/Output.d.ts +19 -1
  390. package/lib/Output.d.ts.map +1 -1
  391. package/lib/Output.js +96 -3
  392. package/lib/Output.js.map +1 -1
  393. package/lib/Plan.d.ts +5 -1
  394. package/lib/Plan.d.ts.map +1 -1
  395. package/lib/Plan.js +111 -33
  396. package/lib/Plan.js.map +1 -1
  397. package/lib/Platform.d.ts.map +1 -1
  398. package/lib/Platform.js +31 -7
  399. package/lib/Platform.js.map +1 -1
  400. package/lib/Provider.d.ts +45 -0
  401. package/lib/Provider.d.ts.map +1 -1
  402. package/lib/Provider.js +2 -2
  403. package/lib/Provider.js.map +1 -1
  404. package/lib/Report.d.ts +17 -195
  405. package/lib/Report.d.ts.map +1 -1
  406. package/lib/Report.js +39 -12
  407. package/lib/Report.js.map +1 -1
  408. package/lib/Runtime/ManagedHttpShutdown.d.ts +17 -0
  409. package/lib/Runtime/ManagedHttpShutdown.d.ts.map +1 -1
  410. package/lib/Runtime/ManagedHttpShutdown.js +11 -2
  411. package/lib/Runtime/ManagedHttpShutdown.js.map +1 -1
  412. package/lib/RuntimeContext.js +1 -1
  413. package/lib/RuntimeContext.js.map +1 -1
  414. package/lib/Stack.d.ts +49 -29
  415. package/lib/Stack.d.ts.map +1 -1
  416. package/lib/Stack.js +25 -31
  417. package/lib/Stack.js.map +1 -1
  418. package/lib/State/BucketState.d.ts.map +1 -1
  419. package/lib/State/BucketState.js +43 -14
  420. package/lib/State/BucketState.js.map +1 -1
  421. package/lib/State/LocalState.d.ts.map +1 -1
  422. package/lib/State/LocalState.js +3 -3
  423. package/lib/State/LocalState.js.map +1 -1
  424. package/lib/State/Provisioning.d.ts +5 -0
  425. package/lib/State/Provisioning.d.ts.map +1 -1
  426. package/lib/State/Provisioning.js +3 -1
  427. package/lib/State/Provisioning.js.map +1 -1
  428. package/lib/State/ResourceState.d.ts +2 -0
  429. package/lib/State/ResourceState.d.ts.map +1 -1
  430. package/lib/State/State.d.ts +26 -0
  431. package/lib/State/State.d.ts.map +1 -1
  432. package/lib/State/StateEncoding.d.ts +7 -0
  433. package/lib/State/StateEncoding.d.ts.map +1 -1
  434. package/lib/State/StateEncoding.js +19 -0
  435. package/lib/State/StateEncoding.js.map +1 -1
  436. package/lib/State/index.js +2 -2
  437. package/lib/State/index.js.map +1 -1
  438. package/lib/Telemetry/Layer.d.ts +2 -5
  439. package/lib/Telemetry/Layer.d.ts.map +1 -1
  440. package/lib/Telemetry/Layer.js +3 -23
  441. package/lib/Telemetry/Layer.js.map +1 -1
  442. package/lib/Telemetry/Metrics.d.ts +1 -1
  443. package/lib/Telemetry/Metrics.d.ts.map +1 -1
  444. package/lib/TelemetryRelay.js +1 -1
  445. package/lib/TelemetryRelay.js.map +1 -1
  446. package/lib/TelemetryRuntime.d.ts +1 -1
  447. package/lib/TelemetryRuntime.d.ts.map +1 -1
  448. package/lib/TelemetryRuntime.js +4 -3
  449. package/lib/TelemetryRuntime.js.map +1 -1
  450. package/lib/Util/ConsoleSink.d.ts +23 -2
  451. package/lib/Util/ConsoleSink.d.ts.map +1 -1
  452. package/lib/Util/ConsoleSink.js +54 -14
  453. package/lib/Util/ConsoleSink.js.map +1 -1
  454. package/lib/Util/LogAnnotation.d.ts +19 -0
  455. package/lib/Util/LogAnnotation.d.ts.map +1 -0
  456. package/lib/Util/LogAnnotation.js +19 -0
  457. package/lib/Util/LogAnnotation.js.map +1 -0
  458. package/lib/Util/LogRecord.d.ts +281 -0
  459. package/lib/Util/LogRecord.d.ts.map +1 -0
  460. package/lib/Util/LogRecord.js +267 -0
  461. package/lib/Util/LogRecord.js.map +1 -0
  462. package/lib/Util/Node.d.ts +9 -0
  463. package/lib/Util/Node.d.ts.map +1 -1
  464. package/lib/Util/Node.js +10 -6
  465. package/lib/Util/Node.js.map +1 -1
  466. package/lib/Util/PlatformServices.d.ts +3 -2
  467. package/lib/Util/PlatformServices.d.ts.map +1 -1
  468. package/lib/Util/PlatformServices.js +6 -2
  469. package/lib/Util/PlatformServices.js.map +1 -1
  470. package/lib/Util/ResourceOutput.d.ts +18 -10
  471. package/lib/Util/ResourceOutput.d.ts.map +1 -1
  472. package/lib/Util/ResourceOutput.js +22 -23
  473. package/lib/Util/ResourceOutput.js.map +1 -1
  474. package/lib/Util/Shutdown.d.ts +10 -0
  475. package/lib/Util/Shutdown.d.ts.map +1 -0
  476. package/lib/Util/Shutdown.js +32 -0
  477. package/lib/Util/Shutdown.js.map +1 -0
  478. package/lib/Util/Terminal.d.ts +2 -4
  479. package/lib/Util/Terminal.d.ts.map +1 -1
  480. package/lib/Util/Terminal.js +3 -11
  481. package/lib/Util/Terminal.js.map +1 -1
  482. package/lib/Util/TraceParent.d.ts +32 -0
  483. package/lib/Util/TraceParent.d.ts.map +1 -0
  484. package/lib/Util/TraceParent.js +42 -0
  485. package/lib/Util/TraceParent.js.map +1 -0
  486. package/lib/Util/base64.d.ts +7 -0
  487. package/lib/Util/base64.d.ts.map +1 -0
  488. package/lib/Util/base64.js +24 -0
  489. package/lib/Util/base64.js.map +1 -0
  490. package/lib/Util/cached-function.d.ts +5 -0
  491. package/lib/Util/cached-function.d.ts.map +1 -1
  492. package/lib/Util/cached-function.js +13 -8
  493. package/lib/Util/cached-function.js.map +1 -1
  494. package/lib/Util/data.d.ts +1 -1
  495. package/lib/Util/data.d.ts.map +1 -1
  496. package/lib/Util/data.js +1 -1
  497. package/lib/Util/data.js.map +1 -1
  498. package/lib/Util/equal.d.ts.map +1 -1
  499. package/lib/Util/equal.js +3 -2
  500. package/lib/Util/equal.js.map +1 -1
  501. package/lib/Util/extraFiles.d.ts.map +1 -1
  502. package/lib/Util/extraFiles.js +5 -5
  503. package/lib/Util/extraFiles.js.map +1 -1
  504. package/lib/Util/interactive.js +1 -1
  505. package/lib/Website/AstroOutput.d.ts +42 -0
  506. package/lib/Website/AstroOutput.d.ts.map +1 -0
  507. package/lib/Website/AstroOutput.js +34 -0
  508. package/lib/Website/AstroOutput.js.map +1 -0
  509. package/lib/Website/FrontendCore.d.ts +1 -1
  510. package/lib/Workflows.d.ts +9 -0
  511. package/lib/Workflows.d.ts.map +1 -1
  512. package/lib/Workflows.js +8 -0
  513. package/lib/Workflows.js.map +1 -1
  514. package/lib/index.d.ts +1 -0
  515. package/lib/index.d.ts.map +1 -1
  516. package/lib/index.js +1 -0
  517. package/lib/index.js.map +1 -1
  518. package/package.json +21 -28
  519. package/src/AdoptPolicy.ts +76 -0
  520. package/src/Alchemist/AuthRegistry.ts +164 -0
  521. package/src/Alchemist/Drift.ts +103 -0
  522. package/src/Alchemist/Entrypoint.ts +51 -3
  523. package/src/Alchemist/Errors.ts +1 -1
  524. package/src/Alchemist/{routes/logs.ts → Logs.ts} +28 -30
  525. package/src/Alchemist/Nuke.ts +90 -0
  526. package/src/Alchemist/Operations.ts +309 -0
  527. package/src/Alchemist/{routes/profile.ts → Profile.ts} +22 -22
  528. package/src/Alchemist/{routes/provider.ts → Provider.ts} +7 -6
  529. package/src/Alchemist/Runtime.ts +46 -12
  530. package/src/Alchemist/{routes/state.ts → State.ts} +78 -21
  531. package/src/Alchemist/index.ts +32 -15
  532. package/src/Apply.ts +513 -274
  533. package/src/Auth/AuthProvider.ts +76 -23
  534. package/src/Auth/BrowserOAuth.ts +37 -60
  535. package/src/Auth/Credentials.ts +2 -4
  536. package/src/Auth/Demand.ts +27 -18
  537. package/src/Auth/Env.ts +13 -8
  538. package/src/Auth/Inspect.ts +5 -2
  539. package/src/Auth/Lock.ts +4 -8
  540. package/src/Auth/OAuthFlow.ts +12 -26
  541. package/src/Auth/Paths.ts +3 -2
  542. package/src/Auth/Profile.ts +30 -2
  543. package/src/Auth/Registry.ts +27 -0
  544. package/src/Auth/Resolve.ts +75 -3
  545. package/src/Auth/StoredAuthProvider.ts +1 -2
  546. package/src/Binding.ts +3 -4
  547. package/src/Bundle/Bundle.ts +58 -7
  548. package/src/Bundle/NamespaceImportPlugin.ts +259 -0
  549. package/src/Bundle/index.ts +1 -0
  550. package/src/Cli/Format.ts +2 -1
  551. package/src/Cli/GlobalLog.ts +206 -68
  552. package/src/Cli/LoggingCli.ts +33 -20
  553. package/src/Cli/PlainCliFormatter.ts +4 -1
  554. package/src/Cli/Present.ts +34 -0
  555. package/src/Cli/SigilRenderer.ts +75 -0
  556. package/src/Cli/checkVersion.ts +25 -78
  557. package/src/Cli/commands/confirm.ts +3 -3
  558. package/src/Cli/commands/deploy.ts +53 -44
  559. package/src/Cli/commands/dev.ts +65 -7
  560. package/src/Cli/commands/drift.ts +20 -16
  561. package/src/Cli/commands/errors.ts +2 -3
  562. package/src/Cli/commands/instrument.ts +39 -8
  563. package/src/Cli/commands/logs.ts +22 -30
  564. package/src/Cli/commands/nuke.ts +25 -26
  565. package/src/Cli/commands/profile/commands.ts +34 -34
  566. package/src/Cli/commands/profile/flows.ts +26 -20
  567. package/src/Cli/commands/profile/hub.ts +16 -18
  568. package/src/Cli/commands/provider.ts +4 -4
  569. package/src/Cli/commands/render.ts +43 -71
  570. package/src/Cli/commands/state.ts +113 -33
  571. package/src/Cli/components/capabilities.ts +20 -0
  572. package/src/Cli/components/types.ts +13 -99
  573. package/src/Cli/components/ui/Environment.tsx +5 -5
  574. package/src/Cli/components/ui/Interactive.tsx +24 -15
  575. package/src/Cli/components/ui/Layout.tsx +1 -1
  576. package/src/Cli/components/ui/Typography.tsx +1 -1
  577. package/src/Cli/components/ui/index.ts +2 -2
  578. package/src/Cli/components/view/ApprovePlan.tsx +2 -1
  579. package/src/Cli/components/view/Format.tsx +58 -0
  580. package/src/Cli/components/view/Help.tsx +14 -17
  581. package/src/Cli/components/view/Logo.tsx +1 -1
  582. package/src/Cli/components/view/Nuke.tsx +74 -49
  583. package/src/Cli/components/view/PlanDecision.tsx +1 -1
  584. package/src/Cli/components/view/PlanRow.tsx +1 -1
  585. package/src/Cli/components/view/PlanTree.ts +2 -2
  586. package/src/Cli/components/view/PlanView.tsx +2 -2
  587. package/src/Cli/components/view/Profile.tsx +2 -2
  588. package/src/Cli/components/view/ProfileDashboard.tsx +12 -11
  589. package/src/Cli/components/view/Prompts.tsx +37 -75
  590. package/src/Cli/components/view/Runtime.tsx +132 -238
  591. package/src/Cli/components/view/SigilCli.tsx +12 -12
  592. package/src/Cli/components/view/StateExplorer.tsx +2 -1
  593. package/src/Cli/components/view/statusStyle.ts +2 -2
  594. package/src/Cli/exec.ts +48 -41
  595. package/src/Cli/main.ts +52 -33
  596. package/src/Cli/selectCli.ts +3 -3
  597. package/src/Command/Command.ts +1 -1
  598. package/src/Command/Dev.ts +129 -36
  599. package/src/Command/Memo.ts +1 -1
  600. package/src/Contributions.ts +42 -8
  601. package/src/DNS/Adapter.ts +289 -0
  602. package/src/DNS/index.ts +1 -0
  603. package/src/Deploy.ts +11 -3
  604. package/src/Destroy.ts +19 -13
  605. package/src/Diff.ts +17 -4
  606. package/src/Drift.ts +256 -127
  607. package/src/EvalStack.ts +97 -0
  608. package/src/Events.ts +296 -0
  609. package/src/Interaction.ts +332 -97
  610. package/src/Local/LocalProvider.ts +40 -9
  611. package/src/Local/RpcProvider.ts +11 -1
  612. package/src/Local/RpcProviderProxy.ts +29 -21
  613. package/src/Local/RpcSerialization.ts +32 -17
  614. package/src/Local/RpcServer.ts +25 -17
  615. package/src/Local/RpcServerBun.ts +10 -6
  616. package/src/Local/RpcServerEnvironment.ts +2 -2
  617. package/src/Local/RpcServerNode.ts +8 -1
  618. package/src/Local/RpcServerSession.ts +2 -2
  619. package/src/Local/RpcSpawner.ts +61 -37
  620. package/src/Local/Sidecar.ts +10 -1
  621. package/src/Nuke.ts +66 -43
  622. package/src/Output.ts +120 -7
  623. package/src/Plan.ts +140 -52
  624. package/src/Platform.ts +47 -18
  625. package/src/Provider.ts +48 -3
  626. package/src/Report.ts +77 -275
  627. package/src/Runtime/ManagedHttpShutdown.ts +21 -4
  628. package/src/RuntimeContext.ts +1 -1
  629. package/src/Stack.ts +113 -135
  630. package/src/State/BucketState.ts +53 -21
  631. package/src/State/LocalState.ts +7 -9
  632. package/src/State/Provisioning.ts +8 -1
  633. package/src/State/ResourceState.ts +2 -0
  634. package/src/State/State.ts +30 -0
  635. package/src/State/StateEncoding.ts +22 -0
  636. package/src/State/index.ts +2 -2
  637. package/src/Telemetry/Layer.ts +3 -24
  638. package/src/Telemetry/Metrics.ts +1 -1
  639. package/src/TelemetryRelay.ts +1 -1
  640. package/src/TelemetryRuntime.ts +8 -8
  641. package/src/Util/ConsoleSink.ts +76 -13
  642. package/src/Util/LogAnnotation.ts +18 -0
  643. package/src/Util/LogRecord.ts +386 -0
  644. package/src/Util/Node.ts +20 -6
  645. package/src/Util/PlatformServices.ts +17 -4
  646. package/src/Util/ResourceOutput.ts +26 -25
  647. package/src/Util/Shutdown.ts +52 -0
  648. package/src/Util/Terminal.ts +3 -20
  649. package/src/Util/TraceParent.ts +70 -0
  650. package/src/Util/base64.ts +22 -0
  651. package/src/Util/cached-function.ts +30 -19
  652. package/src/Util/data.ts +2 -2
  653. package/src/Util/equal.ts +3 -2
  654. package/src/Util/extraFiles.ts +9 -8
  655. package/src/Util/interactive.ts +1 -1
  656. package/src/Website/AstroOutput.ts +83 -0
  657. package/src/Workflows.ts +11 -0
  658. package/src/index.ts +1 -0
  659. package/lib/Alchemist/Progress.d.ts +0 -16
  660. package/lib/Alchemist/Progress.d.ts.map +0 -1
  661. package/lib/Alchemist/Progress.js +0 -123
  662. package/lib/Alchemist/Progress.js.map +0 -1
  663. package/lib/Alchemist/Session.d.ts +0 -116
  664. package/lib/Alchemist/Session.d.ts.map +0 -1
  665. package/lib/Alchemist/Session.js +0 -212
  666. package/lib/Alchemist/Session.js.map +0 -1
  667. package/lib/Alchemist/routes/drift.d.ts +0 -55
  668. package/lib/Alchemist/routes/drift.d.ts.map +0 -1
  669. package/lib/Alchemist/routes/drift.js +0 -52
  670. package/lib/Alchemist/routes/drift.js.map +0 -1
  671. package/lib/Alchemist/routes/logs.d.ts +0 -41
  672. package/lib/Alchemist/routes/logs.d.ts.map +0 -1
  673. package/lib/Alchemist/routes/logs.js.map +0 -1
  674. package/lib/Alchemist/routes/nuke.d.ts +0 -46
  675. package/lib/Alchemist/routes/nuke.d.ts.map +0 -1
  676. package/lib/Alchemist/routes/nuke.js +0 -80
  677. package/lib/Alchemist/routes/nuke.js.map +0 -1
  678. package/lib/Alchemist/routes/profile.d.ts +0 -133
  679. package/lib/Alchemist/routes/profile.d.ts.map +0 -1
  680. package/lib/Alchemist/routes/profile.js.map +0 -1
  681. package/lib/Alchemist/routes/provider.d.ts.map +0 -1
  682. package/lib/Alchemist/routes/provider.js.map +0 -1
  683. package/lib/Alchemist/routes/stack.d.ts +0 -95
  684. package/lib/Alchemist/routes/stack.d.ts.map +0 -1
  685. package/lib/Alchemist/routes/stack.js +0 -73
  686. package/lib/Alchemist/routes/stack.js.map +0 -1
  687. package/lib/Alchemist/routes/state.d.ts.map +0 -1
  688. package/lib/Alchemist/routes/state.js.map +0 -1
  689. package/lib/Cli/CliKit/CliKit.d.ts +0 -92
  690. package/lib/Cli/CliKit/CliKit.d.ts.map +0 -1
  691. package/lib/Cli/CliKit/CliKit.js +0 -27
  692. package/lib/Cli/CliKit/CliKit.js.map +0 -1
  693. package/lib/Cli/CliKit/index.d.ts +0 -9
  694. package/lib/Cli/CliKit/index.d.ts.map +0 -1
  695. package/lib/Cli/CliKit/index.js +0 -9
  696. package/lib/Cli/CliKit/index.js.map +0 -1
  697. package/lib/Cli/CliKit/interaction.d.ts +0 -13
  698. package/lib/Cli/CliKit/interaction.d.ts.map +0 -1
  699. package/lib/Cli/CliKit/interaction.js +0 -17
  700. package/lib/Cli/CliKit/interaction.js.map +0 -1
  701. package/lib/Cli/CliKit/layer.d.ts +0 -7
  702. package/lib/Cli/CliKit/layer.d.ts.map +0 -1
  703. package/lib/Cli/CliKit/layer.js +0 -33
  704. package/lib/Cli/CliKit/layer.js.map +0 -1
  705. package/lib/Local/DevLog.d.ts +0 -32
  706. package/lib/Local/DevLog.d.ts.map +0 -1
  707. package/lib/Local/DevLog.js +0 -112
  708. package/lib/Local/DevLog.js.map +0 -1
  709. package/lib/Test/Alchemy.d.ts +0 -79
  710. package/lib/Test/Alchemy.d.ts.map +0 -1
  711. package/lib/Test/Alchemy.js +0 -193
  712. package/lib/Test/Alchemy.js.map +0 -1
  713. package/lib/Test/Bun.d.ts +0 -69
  714. package/lib/Test/Bun.d.ts.map +0 -1
  715. package/lib/Test/Bun.js +0 -126
  716. package/lib/Test/Bun.js.map +0 -1
  717. package/lib/Test/Core.d.ts +0 -277
  718. package/lib/Test/Core.d.ts.map +0 -1
  719. package/lib/Test/Core.js +0 -362
  720. package/lib/Test/Core.js.map +0 -1
  721. package/lib/Test/Http.d.ts +0 -109
  722. package/lib/Test/Http.d.ts.map +0 -1
  723. package/lib/Test/Http.js +0 -123
  724. package/lib/Test/Http.js.map +0 -1
  725. package/lib/Test/TestState.d.ts +0 -12
  726. package/lib/Test/TestState.d.ts.map +0 -1
  727. package/lib/Test/TestState.js +0 -15
  728. package/lib/Test/TestState.js.map +0 -1
  729. package/lib/Test/Vitest.d.ts +0 -60
  730. package/lib/Test/Vitest.d.ts.map +0 -1
  731. package/lib/Test/Vitest.js +0 -132
  732. package/lib/Test/Vitest.js.map +0 -1
  733. package/lib/Test/index.d.ts +0 -3
  734. package/lib/Test/index.d.ts.map +0 -1
  735. package/lib/Test/index.js +0 -3
  736. package/lib/Test/index.js.map +0 -1
  737. package/lib/Util/FileLogger.d.ts +0 -7
  738. package/lib/Util/FileLogger.d.ts.map +0 -1
  739. package/lib/Util/FileLogger.js +0 -16
  740. package/lib/Util/FileLogger.js.map +0 -1
  741. package/src/Alchemist/Progress.ts +0 -167
  742. package/src/Alchemist/Session.ts +0 -415
  743. package/src/Alchemist/routes/drift.ts +0 -87
  744. package/src/Alchemist/routes/nuke.ts +0 -131
  745. package/src/Alchemist/routes/stack.ts +0 -173
  746. package/src/Cli/CliKit/CliKit.ts +0 -159
  747. package/src/Cli/CliKit/index.ts +0 -41
  748. package/src/Cli/CliKit/interaction.ts +0 -19
  749. package/src/Cli/CliKit/layer.ts +0 -44
  750. package/src/Local/DevLog.ts +0 -122
  751. package/src/Test/Alchemy.ts +0 -334
  752. package/src/Test/Bun.ts +0 -230
  753. package/src/Test/Core.ts +0 -785
  754. package/src/Test/Http.ts +0 -201
  755. package/src/Test/TestState.ts +0 -35
  756. package/src/Test/Vitest.ts +0 -239
  757. package/src/Test/index.ts +0 -2
  758. package/src/Util/FileLogger.ts +0 -20
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LogAnnotation.js","sourceRoot":"","sources":["../../src/Util/LogAnnotation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,gBAAgB;IACxB,OAAO,EAAE,iBAAiB;IAC1B,4DAA4D;IAC5D,KAAK,EAAE,eAAe;IACtB,mEAAmE;IACnE,KAAK,EAAE,eAAe;IACtB,uDAAuD;IACvD,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,eAAe;IACtB,KAAK,EAAE,eAAe;CACd,CAAC"}
@@ -0,0 +1,281 @@
1
+ import * as Context from "effect/Context";
2
+ import * as Effect from "effect/Effect";
3
+ import * as Layer from "effect/Layer";
4
+ import * as Logger from "effect/Logger";
5
+ import * as LogLevel from "effect/LogLevel";
6
+ import * as Schema from "effect/Schema";
7
+ import { Event } from "../Events.ts";
8
+ import { type TraceParent } from "./TraceParent.ts";
9
+ /** Record levels, spelled like `--log-level`. */
10
+ export type Level = "trace" | "debug" | "info" | "warn" | "error" | "fatal";
11
+ /**
12
+ * What a record is, and the first thing a sink filters on:
13
+ * - `log`: a line alchemy logged;
14
+ * - `event`: a typed event (see `emit`);
15
+ * - `output`: a line a child process wrote (dev servers, workerd, the user's code);
16
+ * - `run`: the first line of a run log, describing the run.
17
+ */
18
+ export type Kind = "log" | "event" | "output" | "run";
19
+ /**
20
+ * The envelope every record shares. Every key is always present (`null`
21
+ * when it doesn't apply), so a reader filters on fields without guessing
22
+ * which ones a record carries; `data` has the shape its `kind` names.
23
+ */
24
+ interface Envelope<K extends Kind, Data> {
25
+ /** Unix time in milliseconds. */
26
+ readonly time: number;
27
+ readonly level: Level;
28
+ readonly kind: K;
29
+ /** The alchemy process that produced it: `cli`, `exec` or `sidecar`. */
30
+ readonly process: string;
31
+ /** Which run log it belongs to: account-level work is `global`. */
32
+ readonly scope: "project" | "global";
33
+ /**
34
+ * The trace and span it was logged in, for joining with telemetry; outside
35
+ * any span, the process's trace (see `processTrace`).
36
+ */
37
+ readonly trace: TraceParent;
38
+ /** Annotations on the record, beyond the envelope's own fields. */
39
+ readonly attributes: Readonly<Record<string, unknown>>;
40
+ readonly data: Data;
41
+ }
42
+ /**
43
+ * One record as data. Every alchemy process logs these; only the process
44
+ * that owns the terminal renders them (pretty or JSON), so structure
45
+ * survives process boundaries instead of being baked into rendered text.
46
+ */
47
+ export type LogRecord = Envelope<"log", {
48
+ readonly message: string;
49
+ readonly cause: string | null;
50
+ }> | Envelope<"event", Event> | Envelope<"output", {
51
+ readonly stream: "stdout" | "stderr";
52
+ /** The line as the child wrote it, ANSI styling included. */
53
+ readonly text: string;
54
+ }> | Envelope<"run", {
55
+ readonly version: string;
56
+ readonly pid: number;
57
+ readonly cwd: string;
58
+ readonly argv: ReadonlyArray<string>;
59
+ }>;
60
+ /** The name this process stamps on its records: `cli`, `exec` or `sidecar`. */
61
+ export declare const LogProcess: Context.Reference<string>;
62
+ /** The Effect log level of each record {@link Level}. */
63
+ export declare const severities: Record<Level, LogLevel.Severity>;
64
+ /**
65
+ * `JSON.stringify` that never throws: cycles become `"[Circular]"` and
66
+ * bigints their decimal string. Logging must not fail the work it reports.
67
+ */
68
+ export declare const safeStringify: (value: unknown) => string;
69
+ /** A record's {@link Kind}, read from its annotations alone. */
70
+ export declare const kindOf: (options: Logger.Options<unknown>) => Exclude<Kind, "run">;
71
+ /** The record a logger call describes. */
72
+ export declare const recordOf: (options: Logger.Options<unknown>) => LogRecord;
73
+ /**
74
+ * Mark the logs of `effect` as account-level: the CLI files them in the
75
+ * global run log (`~/.alchemy/logs`) instead of the project's. For work that
76
+ * isn't about one project — the state store, auth and credentials, profiles.
77
+ */
78
+ export declare const globalLogs: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
79
+ /**
80
+ * Set to `json` on alchemy child processes (sidecars) so they log
81
+ * {@link LogRecord} lines instead of rendering, and on the CLI to print
82
+ * records as JSON.
83
+ */
84
+ export declare const LOG_FORMAT_ENV = "ALCHEMY_LOG_FORMAT";
85
+ /** The console's `--log-level`, for child processes that render the run's logs. */
86
+ export declare const LOG_LEVEL_ENV = "ALCHEMY_LOG_LEVEL";
87
+ /** Formats each record as one line of JSON (for `Logger.toFile`). */
88
+ export declare const formatJsonRecord: Logger.Logger<unknown, string>;
89
+ /** A logger that writes each record as one line of JSON. */
90
+ export declare const jsonLogger: (write: (line: string) => void) => Logger.Logger<unknown, void>;
91
+ /**
92
+ * The only logger of an alchemy child process: every record as a JSON line
93
+ * on stdout, down to Debug, for the parent to filter and render.
94
+ */
95
+ export declare const childJsonLogLayer: Layer.Layer<never, never, never>;
96
+ /**
97
+ * Set on a child process that renders its own terminal output (the
98
+ * `alchemy dev` exec child) to the file descriptor its parent reads log
99
+ * records from. The parent writes the run log; the child keeps none.
100
+ */
101
+ export declare const LOG_FD_ENV = "ALCHEMY_LOG_FD";
102
+ /**
103
+ * Forward every record, down to Debug, to the parent as JSON lines on the
104
+ * descriptor in {@link LOG_FD_ENV}, alongside the installed loggers. Empty
105
+ * when the variable is unset.
106
+ */
107
+ export declare const parentLogLayer: () => Layer.Layer<never>;
108
+ /**
109
+ * The wire form of a {@link LogRecord}: what a child process sends and the
110
+ * run log stores. An event is decoded with the {@link Event} union; one whose
111
+ * `type` this version doesn't know is kept as-is rather than rejected, so a
112
+ * newer process's records still pass through.
113
+ */
114
+ export declare const LogRecordSchema: Schema.Union<readonly [Schema.Struct<{
115
+ readonly time: Schema.Number;
116
+ readonly level: Schema.Literals<readonly ["trace", "debug", "info", "warn", "error", "fatal"]>;
117
+ readonly process: Schema.String;
118
+ readonly scope: Schema.Literals<readonly ["project", "global"]>;
119
+ readonly trace: Schema.Struct<{
120
+ readonly traceId: Schema.String;
121
+ readonly spanId: Schema.String;
122
+ }>;
123
+ readonly attributes: Schema.$Record<Schema.String, Schema.Unknown>;
124
+ readonly kind: Schema.Literal<"log">;
125
+ readonly data: Schema.Struct<{
126
+ readonly message: Schema.String;
127
+ readonly cause: Schema.NullOr<Schema.String>;
128
+ }>;
129
+ }>, Schema.Struct<{
130
+ readonly time: Schema.Number;
131
+ readonly level: Schema.Literals<readonly ["trace", "debug", "info", "warn", "error", "fatal"]>;
132
+ readonly process: Schema.String;
133
+ readonly scope: Schema.Literals<readonly ["project", "global"]>;
134
+ readonly trace: Schema.Struct<{
135
+ readonly traceId: Schema.String;
136
+ readonly spanId: Schema.String;
137
+ }>;
138
+ readonly attributes: Schema.$Record<Schema.String, Schema.Unknown>;
139
+ readonly kind: Schema.Literal<"event">;
140
+ readonly data: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
141
+ readonly type: Schema.Literal<"plan.phase">;
142
+ readonly phase: Schema.Literals<readonly ["importing-module", "resolving-services", "loading-state", "computing-plan", "plan-ready"]>;
143
+ }>, Schema.Struct<{
144
+ readonly type: Schema.Literal<"plan.resource.started">;
145
+ readonly fqn: Schema.String;
146
+ readonly logicalId: Schema.String;
147
+ readonly resourceType: Schema.String;
148
+ readonly total: Schema.Number;
149
+ }>, Schema.Struct<{
150
+ readonly fqn: Schema.String;
151
+ readonly logicalId: Schema.String;
152
+ readonly resourceType: Schema.String;
153
+ readonly action: Schema.Literals<readonly ["create", "update", "adopted", "replace", "delete", "orphaned", "noop"]>;
154
+ readonly bindings: Schema.$Array<Schema.Struct<{
155
+ readonly sid: Schema.String;
156
+ readonly action: Schema.Literals<readonly ["create", "update", "delete", "noop"]>;
157
+ }>>;
158
+ readonly providerMode: Schema.optionalKey<Schema.Literals<readonly ["local", "live"]>>;
159
+ readonly fromProviderMode: Schema.optionalKey<Schema.Literals<readonly ["local", "live"]>>;
160
+ readonly type: Schema.Literal<"plan.resource.completed">;
161
+ readonly completed: Schema.Number;
162
+ readonly total: Schema.Number;
163
+ }>, Schema.Struct<{
164
+ readonly fqn: Schema.String;
165
+ readonly logicalId: Schema.String;
166
+ readonly actionType: Schema.String;
167
+ readonly action: Schema.Literals<readonly ["run", "delete", "noop"]>;
168
+ readonly type: Schema.Literal<"plan.action.completed">;
169
+ readonly completed: Schema.Number;
170
+ readonly total: Schema.Number;
171
+ }>, Schema.Struct<{
172
+ readonly type: Schema.Literal<"apply.resource.note">;
173
+ readonly fqn: Schema.String;
174
+ readonly id: Schema.String;
175
+ readonly message: Schema.String;
176
+ readonly kind: Schema.optionalKey<Schema.Literals<readonly ["status", "output"]>>;
177
+ }>, Schema.Struct<{
178
+ readonly type: Schema.Literal<"apply.resource.status">;
179
+ readonly fqn: Schema.String;
180
+ readonly id: Schema.String;
181
+ readonly resourceType: Schema.String;
182
+ readonly status: Schema.Literals<readonly ["attaching", "post-attach", "pending", "pre-creating", "creating", "creating replacement", "created", "updating", "updated", "adopting", "adopted", "deleting", "deleted", "orphaning", "orphaned", "replacing", "replaced", "running", "ran", "skipped", "fail"]>;
183
+ readonly message: Schema.optionalKey<Schema.String>;
184
+ readonly providerMode: Schema.optionalKey<Schema.Literals<readonly ["local", "live"]>>;
185
+ readonly fromProviderMode: Schema.optionalKey<Schema.Literals<readonly ["local", "live"]>>;
186
+ }>, Schema.Struct<{
187
+ readonly type: Schema.Literal<"state.bootstrap.started">;
188
+ readonly store: Schema.String;
189
+ }>, Schema.Struct<{
190
+ readonly type: Schema.Literal<"state.bootstrap.completed">;
191
+ readonly store: Schema.String;
192
+ }>, Schema.Struct<{
193
+ readonly type: Schema.Literal<"provider.configure.started">;
194
+ readonly provider: Schema.String;
195
+ }>, Schema.Struct<{
196
+ readonly type: Schema.Literal<"provider.configure.completed">;
197
+ readonly provider: Schema.String;
198
+ }>, Schema.Struct<{
199
+ readonly type: Schema.Literal<"provider.refresh.started">;
200
+ readonly provider: Schema.String;
201
+ }>, Schema.Struct<{
202
+ readonly type: Schema.Literal<"provider.refresh.completed">;
203
+ readonly provider: Schema.String;
204
+ }>, Schema.Struct<{
205
+ readonly type: Schema.Literal<"nuke.scan.started">;
206
+ readonly total: Schema.Number;
207
+ }>, Schema.Struct<{
208
+ readonly type: Schema.Literal<"nuke.scan.provider.started">;
209
+ readonly provider: Schema.String;
210
+ }>, Schema.Struct<{
211
+ readonly type: Schema.Literal<"nuke.scan.provider.completed">;
212
+ readonly provider: Schema.String;
213
+ readonly resources: Schema.Number;
214
+ readonly error: Schema.optionalKey<Schema.String>;
215
+ }>, Schema.Struct<{
216
+ readonly type: Schema.Literal<"nuke.pass.started">;
217
+ readonly pass: Schema.Number;
218
+ }>, Schema.Struct<{
219
+ readonly type: Schema.Literal<"nuke.resource.deleted">;
220
+ readonly provider: Schema.String;
221
+ readonly resource: Schema.String;
222
+ }>, Schema.Struct<{
223
+ readonly type: Schema.Literal<"nuke.resource.failed">;
224
+ readonly provider: Schema.String;
225
+ readonly resource: Schema.String;
226
+ readonly message: Schema.String;
227
+ }>]>, Schema.StructWithRest<Schema.Struct<{
228
+ readonly type: Schema.String;
229
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>;
230
+ }>, Schema.Struct<{
231
+ readonly time: Schema.Number;
232
+ readonly level: Schema.Literals<readonly ["trace", "debug", "info", "warn", "error", "fatal"]>;
233
+ readonly process: Schema.String;
234
+ readonly scope: Schema.Literals<readonly ["project", "global"]>;
235
+ readonly trace: Schema.Struct<{
236
+ readonly traceId: Schema.String;
237
+ readonly spanId: Schema.String;
238
+ }>;
239
+ readonly attributes: Schema.$Record<Schema.String, Schema.Unknown>;
240
+ readonly kind: Schema.Literal<"output">;
241
+ readonly data: Schema.Struct<{
242
+ readonly stream: Schema.Literals<readonly ["stdout", "stderr"]>;
243
+ readonly text: Schema.String;
244
+ }>;
245
+ }>, Schema.Struct<{
246
+ readonly time: Schema.Number;
247
+ readonly level: Schema.Literals<readonly ["trace", "debug", "info", "warn", "error", "fatal"]>;
248
+ readonly process: Schema.String;
249
+ readonly scope: Schema.Literals<readonly ["project", "global"]>;
250
+ readonly trace: Schema.Struct<{
251
+ readonly traceId: Schema.String;
252
+ readonly spanId: Schema.String;
253
+ }>;
254
+ readonly attributes: Schema.$Record<Schema.String, Schema.Unknown>;
255
+ readonly kind: Schema.Literal<"run">;
256
+ readonly data: Schema.Struct<{
257
+ readonly version: Schema.String;
258
+ readonly pid: Schema.Number;
259
+ readonly cwd: Schema.String;
260
+ readonly argv: Schema.$Array<Schema.String>;
261
+ }>;
262
+ }>]>;
263
+ /** Decode one JSON log line, or `undefined` when it isn't a log record. */
264
+ export declare const parseRecord: (line: string) => typeof LogRecordSchema.Type | undefined;
265
+ /**
266
+ * Log a record from another process through this process's loggers,
267
+ * keeping its envelope: the sinks here see the record the child produced.
268
+ */
269
+ export declare const replayRecord: (record: typeof LogRecordSchema.Type) => Effect.Effect<void>;
270
+ /**
271
+ * Log one line a child process wrote. A JSON {@link LogRecord} (an alchemy
272
+ * child) is replayed as-is; anything else becomes an Info `output` record,
273
+ * from `source.process` or, when that's unset, this process.
274
+ */
275
+ export declare const logChildLine: (line: string, source: {
276
+ readonly stream: "stdout" | "stderr";
277
+ readonly resource?: string;
278
+ readonly process?: string;
279
+ }) => Effect.Effect<void>;
280
+ export {};
281
+ //# sourceMappingURL=LogRecord.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LogRecord.d.ts","sourceRoot":"","sources":["../../src/Util/LogRecord.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAG5C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,EAAoB,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAgB,KAAK,WAAW,EAAmB,MAAM,kBAAkB,CAAC;AAEnF,iDAAiD;AACjD,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEtD;;;;GAIG;AACH,UAAU,QAAQ,CAAC,CAAC,SAAS,IAAI,EAAE,IAAI;IACrC,iCAAiC;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB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,eAAe,CAAC,IAAI,GAAG,SAC1B,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,YAAY,WAAY,OAAO,eAAe,CAAC,IAAI,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CA2B9E,CAAC;AAER;;;;GAIG;AACH,eAAO,MAAM,YAAY,SACjB,MAAM,UACJ;IACN,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACrC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B,KACA,MAAM,CAAC,MAAM,CAAC,IAAI,CAgBpB,CAAC"}
@@ -0,0 +1,267 @@
1
+ import { writeSync } from "node:fs";
2
+ import * as Cause from "effect/Cause";
3
+ import * as Context from "effect/Context";
4
+ import * as Effect from "effect/Effect";
5
+ import * as Layer from "effect/Layer";
6
+ import * as Logger from "effect/Logger";
7
+ import * as LogLevel from "effect/LogLevel";
8
+ import * as Option from "effect/Option";
9
+ import { CurrentLogAnnotations, MinimumLogLevel } from "effect/References";
10
+ import * as Schema from "effect/Schema";
11
+ import { Event, isKnownEventType } from "../Events.js";
12
+ import { LogAnnotation } from "./LogAnnotation.js";
13
+ import { processTrace, withTraceParent } from "./TraceParent.js";
14
+ const reserved = new Set(Object.values(LogAnnotation).filter((key) => key !== LogAnnotation.fqn));
15
+ /** The name this process stamps on its records: `cli`, `exec` or `sidecar`. */
16
+ export const LogProcess = Context.Reference("alchemy/LogProcess", {
17
+ defaultValue: () => "cli",
18
+ });
19
+ /** The Effect log level of each record {@link Level}. */
20
+ export const severities = {
21
+ trace: "Trace",
22
+ debug: "Debug",
23
+ info: "Info",
24
+ warn: "Warn",
25
+ error: "Error",
26
+ fatal: "Fatal",
27
+ };
28
+ const levelOf = (logLevel) => logLevel === "All" || logLevel === "None" ? "info" : logLevel.toLowerCase();
29
+ /**
30
+ * `JSON.stringify` that never throws: cycles become `"[Circular]"` and
31
+ * bigints their decimal string. Logging must not fail the work it reports.
32
+ */
33
+ export const safeStringify = (value) => {
34
+ const seen = new WeakSet();
35
+ try {
36
+ return (JSON.stringify(value, (_key, v) => {
37
+ if (typeof v === "bigint")
38
+ return v.toString();
39
+ if (typeof v === "object" && v !== null) {
40
+ if (seen.has(v))
41
+ return "[Circular]";
42
+ seen.add(v);
43
+ }
44
+ return v;
45
+ }) ?? String(value));
46
+ }
47
+ catch {
48
+ return String(value);
49
+ }
50
+ };
51
+ const messageText = (message) => {
52
+ const parts = Array.isArray(message) ? message : [message];
53
+ return parts
54
+ .map((part) => typeof part === "string"
55
+ ? part
56
+ : part instanceof Error
57
+ ? (part.stack ?? part.message)
58
+ : safeStringify(part))
59
+ .join(" ");
60
+ };
61
+ /** A record's {@link Kind}, read from its annotations alone. */
62
+ export const kindOf = (options) => {
63
+ const annotations = options.fiber.getRef(CurrentLogAnnotations);
64
+ return annotations[LogAnnotation.event] === true
65
+ ? "event"
66
+ : annotations[LogAnnotation.stream] !== undefined
67
+ ? "output"
68
+ : "log";
69
+ };
70
+ const isTrace = (value) => typeof value === "object" &&
71
+ value !== null &&
72
+ typeof value.traceId === "string" &&
73
+ typeof value.spanId === "string";
74
+ /** The record a logger call describes. */
75
+ export const recordOf = (options) => {
76
+ const all = options.fiber.getRef(CurrentLogAnnotations);
77
+ const string = (key) => (typeof all[key] === "string" ? all[key] : undefined);
78
+ const time = all[LogAnnotation.time];
79
+ const replayedTrace = all[LogAnnotation.trace];
80
+ const span = options.fiber.cache.span;
81
+ const head = {
82
+ time: typeof time === "number" ? time : options.date.getTime(),
83
+ level: levelOf(options.logLevel),
84
+ };
85
+ const envelope = {
86
+ process: string(LogAnnotation.process) ?? options.fiber.getRef(LogProcess),
87
+ scope: all[LogAnnotation.scope] === "global" ? "global" : "project",
88
+ trace: isTrace(replayedTrace)
89
+ ? replayedTrace
90
+ : span === undefined
91
+ ? processTrace
92
+ : { traceId: span.traceId, spanId: span.spanId },
93
+ attributes: Object.fromEntries(Object.entries(all).filter(([key]) => !reserved.has(key))),
94
+ };
95
+ const first = Array.isArray(options.message) ? options.message[0] : options.message;
96
+ switch (kindOf(options)) {
97
+ case "event":
98
+ // SAFETY: only `emit` (or a replayed event) sets the event annotation,
99
+ // and it logs one Event.
100
+ return { ...head, kind: "event", ...envelope, data: first };
101
+ case "output":
102
+ return {
103
+ ...head,
104
+ kind: "output",
105
+ ...envelope,
106
+ data: {
107
+ stream: all[LogAnnotation.stream] === "stderr" ? "stderr" : "stdout",
108
+ text: messageText(options.message),
109
+ },
110
+ };
111
+ case "log":
112
+ return {
113
+ ...head,
114
+ kind: "log",
115
+ ...envelope,
116
+ data: {
117
+ message: messageText(options.message),
118
+ cause: string(LogAnnotation.cause) ??
119
+ (options.cause.reasons.length > 0 ? Cause.pretty(options.cause) : null),
120
+ },
121
+ };
122
+ }
123
+ };
124
+ /**
125
+ * Mark the logs of `effect` as account-level: the CLI files them in the
126
+ * global run log (`~/.alchemy/logs`) instead of the project's. For work that
127
+ * isn't about one project — the state store, auth and credentials, profiles.
128
+ */
129
+ export const globalLogs = (effect) => Effect.annotateLogs(effect, LogAnnotation.scope, "global");
130
+ /**
131
+ * Set to `json` on alchemy child processes (sidecars) so they log
132
+ * {@link LogRecord} lines instead of rendering, and on the CLI to print
133
+ * records as JSON.
134
+ */
135
+ export const LOG_FORMAT_ENV = "ALCHEMY_LOG_FORMAT";
136
+ /** The console's `--log-level`, for child processes that render the run's logs. */
137
+ export const LOG_LEVEL_ENV = "ALCHEMY_LOG_LEVEL";
138
+ /** Formats each record as one line of JSON (for `Logger.toFile`). */
139
+ export const formatJsonRecord = Logger.make((options) => safeStringify(recordOf(options)));
140
+ /** A logger that writes each record as one line of JSON. */
141
+ export const jsonLogger = (write) => Logger.map(formatJsonRecord, write);
142
+ /**
143
+ * The only logger of an alchemy child process: every record as a JSON line
144
+ * on stdout, down to Debug, for the parent to filter and render.
145
+ */
146
+ export const childJsonLogLayer = Layer.mergeAll(Logger.layer([jsonLogger((line) => process.stdout.write(`${line}\n`))]), Layer.succeed(MinimumLogLevel, "Debug"));
147
+ /**
148
+ * Set on a child process that renders its own terminal output (the
149
+ * `alchemy dev` exec child) to the file descriptor its parent reads log
150
+ * records from. The parent writes the run log; the child keeps none.
151
+ */
152
+ export const LOG_FD_ENV = "ALCHEMY_LOG_FD";
153
+ /**
154
+ * Forward every record, down to Debug, to the parent as JSON lines on the
155
+ * descriptor in {@link LOG_FD_ENV}, alongside the installed loggers. Empty
156
+ * when the variable is unset.
157
+ */
158
+ export const parentLogLayer = () => {
159
+ const fd = Number(process.env[LOG_FD_ENV]);
160
+ if (!Number.isInteger(fd) || fd < 3)
161
+ return Layer.empty;
162
+ const write = (line) => {
163
+ try {
164
+ writeSync(fd, `${line}\n`);
165
+ }
166
+ catch {
167
+ // The parent is gone or stopped reading: logging must not fail the work.
168
+ }
169
+ };
170
+ return Logger.layer([jsonLogger(write)], {
171
+ mergeWithExisting: true,
172
+ });
173
+ };
174
+ /** An event of a `type` this version doesn't know: decoded, never validated. */
175
+ const UnknownEvent = Schema.StructWithRest(Schema.Struct({
176
+ type: Schema.String.check(Schema.makeFilter((type) => !isKnownEventType(type) || "A known event type must decode in full.")),
177
+ }), [Schema.Record(Schema.String, Schema.Unknown)]);
178
+ const envelopeFields = {
179
+ time: Schema.Number,
180
+ level: Schema.Literals(["trace", "debug", "info", "warn", "error", "fatal"]),
181
+ process: Schema.String,
182
+ scope: Schema.Literals(["project", "global"]),
183
+ trace: Schema.Struct({ traceId: Schema.String, spanId: Schema.String }),
184
+ attributes: Schema.Record(Schema.String, Schema.Unknown),
185
+ };
186
+ /**
187
+ * The wire form of a {@link LogRecord}: what a child process sends and the
188
+ * run log stores. An event is decoded with the {@link Event} union; one whose
189
+ * `type` this version doesn't know is kept as-is rather than rejected, so a
190
+ * newer process's records still pass through.
191
+ */
192
+ export const LogRecordSchema = Schema.Union([
193
+ Schema.Struct({
194
+ ...envelopeFields,
195
+ kind: Schema.Literal("log"),
196
+ data: Schema.Struct({ message: Schema.String, cause: Schema.NullOr(Schema.String) }),
197
+ }),
198
+ Schema.Struct({
199
+ ...envelopeFields,
200
+ kind: Schema.Literal("event"),
201
+ data: Schema.Union([Event, UnknownEvent]),
202
+ }),
203
+ Schema.Struct({
204
+ ...envelopeFields,
205
+ kind: Schema.Literal("output"),
206
+ data: Schema.Struct({ stream: Schema.Literals(["stdout", "stderr"]), text: Schema.String }),
207
+ }),
208
+ Schema.Struct({
209
+ ...envelopeFields,
210
+ kind: Schema.Literal("run"),
211
+ data: Schema.Struct({
212
+ version: Schema.String,
213
+ pid: Schema.Number,
214
+ cwd: Schema.String,
215
+ argv: Schema.Array(Schema.String),
216
+ }),
217
+ }),
218
+ ]);
219
+ const decodeRecordLine = Schema.decodeUnknownOption(Schema.fromJsonString(LogRecordSchema));
220
+ /** Decode one JSON log line, or `undefined` when it isn't a log record. */
221
+ export const parseRecord = (line) => Option.getOrUndefined(decodeRecordLine(line));
222
+ /**
223
+ * Log a record from another process through this process's loggers,
224
+ * keeping its envelope: the sinks here see the record the child produced.
225
+ */
226
+ export const replayRecord = (record) => record.kind === "run"
227
+ ? Effect.void
228
+ : Effect.logWithLevel(severities[record.level])(record.kind === "log"
229
+ ? record.data.message
230
+ : record.kind === "output"
231
+ ? record.data.text
232
+ : record.data).pipe(Effect.annotateLogs({
233
+ ...record.attributes,
234
+ [LogAnnotation.time]: record.time,
235
+ [LogAnnotation.process]: record.process,
236
+ [LogAnnotation.trace]: record.trace,
237
+ [LogAnnotation.scope]: record.scope,
238
+ ...(record.kind === "event" ? { [LogAnnotation.event]: true } : {}),
239
+ ...(record.kind === "output" ? { [LogAnnotation.stream]: record.data.stream } : {}),
240
+ ...(record.kind === "log" && record.data.cause !== null
241
+ ? { [LogAnnotation.cause]: record.data.cause }
242
+ : {}),
243
+ }),
244
+ // A record the child already let through keeps reaching the sinks,
245
+ // whatever this process's minimum level.
246
+ Effect.provideService(MinimumLogLevel, "Trace"),
247
+ // Loggers that read the fiber's span (OTLP) see the child's too.
248
+ withTraceParent(record.trace));
249
+ /**
250
+ * Log one line a child process wrote. A JSON {@link LogRecord} (an alchemy
251
+ * child) is replayed as-is; anything else becomes an Info `output` record,
252
+ * from `source.process` or, when that's unset, this process.
253
+ */
254
+ export const logChildLine = (line, source) => {
255
+ const record = parseRecord(line);
256
+ if (record !== undefined) {
257
+ return replayRecord(source.resource !== undefined && record.attributes[LogAnnotation.fqn] === undefined
258
+ ? { ...record, attributes: { ...record.attributes, [LogAnnotation.fqn]: source.resource } }
259
+ : record);
260
+ }
261
+ return Effect.logInfo(line).pipe(Effect.annotateLogs({
262
+ [LogAnnotation.stream]: source.stream,
263
+ ...(source.resource === undefined ? {} : { [LogAnnotation.fqn]: source.resource }),
264
+ ...(source.process === undefined ? {} : { [LogAnnotation.process]: source.process }),
265
+ }));
266
+ };
267
+ //# sourceMappingURL=LogRecord.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LogRecord.js","sourceRoot":"","sources":["../../src/Util/LogRecord.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,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AClB,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM;QACrC,GAAG,CAAC,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;QAClF,GAAG,CAAC,MAAM,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;KACrF,CAAC,CACH,CAAC;AACJ,CAAC,CAAC"}
@@ -1,4 +1,12 @@
1
1
  import * as Effect from "effect/Effect";
2
+ declare const NodeOperationFailed_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
3
+ readonly _tag: "NodeOperationFailed";
4
+ } & Readonly<A>;
5
+ export declare class NodeOperationFailed extends NodeOperationFailed_base<{
6
+ readonly message: string;
7
+ readonly cause?: unknown;
8
+ }> {
9
+ }
2
10
  /**
3
11
  * The process's working directory, captured ONCE at module load.
4
12
  *
@@ -85,4 +93,5 @@ export declare const isRegisterHooksSupported: (version?: string) => boolean;
85
93
  * `EADDRINUSE`.
86
94
  */
87
95
  export declare const findAvailablePort: (host?: string) => Effect.Effect<number, Error, never>;
96
+ export {};
88
97
  //# sourceMappingURL=Node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Node.d.ts","sourceRoot":"","sources":["../../src/Util/Node.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,eAAe,kBAAmB,MAAM,kBACY,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,sBAAsB,QAAO,IAEzC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,UAAW,MAAM,KAAG,MAAM,EAKpD,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,wBAAwB,wBAAsC,OAQ1E,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,wDAkB1B,CAAC"}
1
+ {"version":3,"file":"Node.d.ts","sourceRoot":"","sources":["../../src/Util/Node.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;;;;AAKxC,qBAAa,mBAAoB,SAAQ,yBAAwC;IAC/E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;CAAG;AAEL;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,eAAe,kBAAmB,MAAM,kBACY,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,sBAAsB,QAAO,IAEzC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,UAAW,MAAM,KAAG,MAAM,EAKpD,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,wBAAwB,wBAAsC,OAK1E,CAAC;AAMF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,wDAsB1B,CAAC"}
package/lib/Util/Node.js CHANGED
@@ -1,5 +1,11 @@
1
1
  import * as NodeNet from "node:net";
2
+ import * as Data from "effect/Data";
2
3
  import * as Effect from "effect/Effect";
4
+ import * as Result from "effect/Result";
5
+ import * as SemVer from "effect/SemVer";
6
+ import * as SemVerRange from "effect/SemVerRange";
7
+ export class NodeOperationFailed extends Data.TaggedError("NodeOperationFailed") {
8
+ }
3
9
  /**
4
10
  * The process's working directory, captured ONCE at module load.
5
11
  *
@@ -83,12 +89,10 @@ export const nodeLoaderArgs = (entry) => [
83
89
  * before any `.ts` can load. Keep the two in sync.
84
90
  */
85
91
  export const isRegisterHooksSupported = (version = process.versions.node) => {
86
- const [major = 0, minor = 0, patch = 0] = version.split(".").map(Number);
87
- return ((major === 22 && (minor > 22 || (minor === 22 && patch >= 3))) ||
88
- (major === 24 && (minor > 11 || (minor === 11 && patch >= 1))) ||
89
- (major === 25 && minor >= 1) ||
90
- major >= 26);
92
+ const parsed = Result.getOrUndefined(SemVer.parse(version));
93
+ return (parsed !== undefined && SemVerRange.matches(REGISTER_HOOKS, parsed, { includePrerelease: true }));
91
94
  };
95
+ const REGISTER_HOOKS = SemVerRange.parseUnsafe(">=22.22.3 <23.0.0-0 || >=24.11.1 <25.0.0-0 || >=25.1.0");
92
96
  /**
93
97
  * Ask the OS for an unused TCP port, release it, and return its number.
94
98
  *
@@ -111,7 +115,7 @@ export const findAvailablePort = (host = "127.0.0.1") => Effect.callback((resume
111
115
  resume(Effect.succeed(port));
112
116
  }
113
117
  else {
114
- resume(Effect.fail(new Error("Failed to allocate an available port")));
118
+ resume(Effect.fail(new NodeOperationFailed({ message: "Failed to allocate an available port" })));
115
119
  }
116
120
  });
117
121
  });