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.
- package/THIRD_PARTY_LICENSES.md +2 -2
- package/bin/cli.js +14 -6
- package/bin/register-oxc.js +16 -12
- package/lib/AdoptPolicy.d.ts +73 -0
- package/lib/AdoptPolicy.d.ts.map +1 -1
- package/lib/AdoptPolicy.js +54 -0
- package/lib/AdoptPolicy.js.map +1 -1
- package/lib/Alchemist/AuthRegistry.d.ts +31 -0
- package/lib/Alchemist/AuthRegistry.d.ts.map +1 -0
- package/lib/Alchemist/AuthRegistry.js +95 -0
- package/lib/Alchemist/AuthRegistry.js.map +1 -0
- package/lib/Alchemist/Drift.d.ts +70 -0
- package/lib/Alchemist/Drift.d.ts.map +1 -0
- package/lib/Alchemist/Drift.js +54 -0
- package/lib/Alchemist/Drift.js.map +1 -0
- package/lib/Alchemist/Entrypoint.d.ts +27 -3
- package/lib/Alchemist/Entrypoint.d.ts.map +1 -1
- package/lib/Alchemist/Entrypoint.js +34 -3
- package/lib/Alchemist/Entrypoint.js.map +1 -1
- package/lib/Alchemist/Errors.d.ts +1 -1
- package/lib/Alchemist/Errors.d.ts.map +1 -1
- package/lib/Alchemist/Errors.js +1 -1
- package/lib/Alchemist/Errors.js.map +1 -1
- package/lib/Alchemist/Logs.d.ts +46 -0
- package/lib/Alchemist/Logs.d.ts.map +1 -0
- package/lib/Alchemist/{routes/logs.js → Logs.js} +21 -26
- package/lib/Alchemist/Logs.js.map +1 -0
- package/lib/Alchemist/Nuke.d.ts +69 -0
- package/lib/Alchemist/Nuke.d.ts.map +1 -0
- package/lib/Alchemist/Nuke.js +35 -0
- package/lib/Alchemist/Nuke.js.map +1 -0
- package/lib/Alchemist/Operations.d.ts +168 -0
- package/lib/Alchemist/Operations.d.ts.map +1 -0
- package/lib/Alchemist/Operations.js +165 -0
- package/lib/Alchemist/Operations.js.map +1 -0
- package/lib/Alchemist/Profile.d.ts +132 -0
- package/lib/Alchemist/Profile.d.ts.map +1 -0
- package/lib/Alchemist/{routes/profile.js → Profile.js} +20 -21
- package/lib/Alchemist/Profile.js.map +1 -0
- package/lib/Alchemist/{routes/provider.d.ts → Provider.d.ts} +4 -4
- package/lib/Alchemist/Provider.d.ts.map +1 -0
- package/lib/Alchemist/{routes/provider.js → Provider.js} +7 -6
- package/lib/Alchemist/Provider.js.map +1 -0
- package/lib/Alchemist/Runtime.d.ts +10 -6
- package/lib/Alchemist/Runtime.d.ts.map +1 -1
- package/lib/Alchemist/Runtime.js +38 -2
- package/lib/Alchemist/Runtime.js.map +1 -1
- package/lib/Alchemist/{routes/state.d.ts → State.d.ts} +36 -16
- package/lib/Alchemist/State.d.ts.map +1 -0
- package/lib/Alchemist/{routes/state.js → State.js} +50 -15
- package/lib/Alchemist/State.js.map +1 -0
- package/lib/Alchemist/index.d.ts +11 -10
- package/lib/Alchemist/index.d.ts.map +1 -1
- package/lib/Alchemist/index.js +10 -9
- package/lib/Alchemist/index.js.map +1 -1
- package/lib/Apply.d.ts +2 -8
- package/lib/Apply.d.ts.map +1 -1
- package/lib/Apply.js +364 -184
- package/lib/Apply.js.map +1 -1
- package/lib/Auth/AuthProvider.d.ts +24 -11
- package/lib/Auth/AuthProvider.d.ts.map +1 -1
- package/lib/Auth/AuthProvider.js +28 -12
- package/lib/Auth/AuthProvider.js.map +1 -1
- package/lib/Auth/BrowserOAuth.d.ts +6 -8
- package/lib/Auth/BrowserOAuth.d.ts.map +1 -1
- package/lib/Auth/BrowserOAuth.js +25 -41
- package/lib/Auth/BrowserOAuth.js.map +1 -1
- package/lib/Auth/Credentials.d.ts.map +1 -1
- package/lib/Auth/Credentials.js +2 -2
- package/lib/Auth/Credentials.js.map +1 -1
- package/lib/Auth/Demand.d.ts +4 -4
- package/lib/Auth/Demand.d.ts.map +1 -1
- package/lib/Auth/Demand.js +16 -10
- package/lib/Auth/Demand.js.map +1 -1
- package/lib/Auth/Env.d.ts +2 -1
- package/lib/Auth/Env.d.ts.map +1 -1
- package/lib/Auth/Env.js +4 -2
- package/lib/Auth/Env.js.map +1 -1
- package/lib/Auth/Inspect.d.ts +2 -2
- package/lib/Auth/Inspect.d.ts.map +1 -1
- package/lib/Auth/Inspect.js +3 -1
- package/lib/Auth/Inspect.js.map +1 -1
- package/lib/Auth/Lock.d.ts.map +1 -1
- package/lib/Auth/Lock.js +4 -8
- package/lib/Auth/Lock.js.map +1 -1
- package/lib/Auth/OAuthFlow.d.ts +3 -12
- package/lib/Auth/OAuthFlow.d.ts.map +1 -1
- package/lib/Auth/OAuthFlow.js +7 -17
- package/lib/Auth/OAuthFlow.js.map +1 -1
- package/lib/Auth/Paths.d.ts +2 -1
- package/lib/Auth/Paths.d.ts.map +1 -1
- package/lib/Auth/Paths.js +3 -2
- package/lib/Auth/Paths.js.map +1 -1
- package/lib/Auth/Profile.d.ts +10 -0
- package/lib/Auth/Profile.d.ts.map +1 -1
- package/lib/Auth/Profile.js +19 -2
- package/lib/Auth/Profile.js.map +1 -1
- package/lib/Auth/Registry.d.ts +20 -0
- package/lib/Auth/Registry.d.ts.map +1 -0
- package/lib/Auth/Registry.js +17 -0
- package/lib/Auth/Registry.js.map +1 -0
- package/lib/Auth/Resolve.d.ts +34 -2
- package/lib/Auth/Resolve.d.ts.map +1 -1
- package/lib/Auth/Resolve.js +51 -3
- package/lib/Auth/Resolve.js.map +1 -1
- package/lib/Auth/StoredAuthProvider.d.ts +1 -1
- package/lib/Auth/StoredAuthProvider.d.ts.map +1 -1
- package/lib/Auth/StoredAuthProvider.js +1 -2
- package/lib/Auth/StoredAuthProvider.js.map +1 -1
- package/lib/Binding.d.ts.map +1 -1
- package/lib/Binding.js +3 -1
- package/lib/Binding.js.map +1 -1
- package/lib/Bundle/Bundle.d.ts +5 -0
- package/lib/Bundle/Bundle.d.ts.map +1 -1
- package/lib/Bundle/Bundle.js +36 -6
- package/lib/Bundle/Bundle.js.map +1 -1
- package/lib/Bundle/NamespaceImportPlugin.d.ts +55 -0
- package/lib/Bundle/NamespaceImportPlugin.d.ts.map +1 -0
- package/lib/Bundle/NamespaceImportPlugin.js +226 -0
- package/lib/Bundle/NamespaceImportPlugin.js.map +1 -0
- package/lib/Bundle/index.d.ts +1 -0
- package/lib/Bundle/index.d.ts.map +1 -1
- package/lib/Bundle/index.js +1 -0
- package/lib/Bundle/index.js.map +1 -1
- package/lib/Cli/Format.d.ts.map +1 -1
- package/lib/Cli/Format.js +2 -1
- package/lib/Cli/Format.js.map +1 -1
- package/lib/Cli/GlobalLog.d.ts +72 -26
- package/lib/Cli/GlobalLog.d.ts.map +1 -1
- package/lib/Cli/GlobalLog.js +151 -59
- package/lib/Cli/GlobalLog.js.map +1 -1
- package/lib/Cli/LoggingCli.d.ts.map +1 -1
- package/lib/Cli/LoggingCli.js +24 -18
- package/lib/Cli/LoggingCli.js.map +1 -1
- package/lib/Cli/PlainCliFormatter.d.ts.map +1 -1
- package/lib/Cli/PlainCliFormatter.js +4 -1
- package/lib/Cli/PlainCliFormatter.js.map +1 -1
- package/lib/Cli/Present.d.ts +14 -0
- package/lib/Cli/Present.d.ts.map +1 -0
- package/lib/Cli/Present.js +22 -0
- package/lib/Cli/Present.js.map +1 -0
- package/lib/Cli/SigilRenderer.d.ts +58 -0
- package/lib/Cli/SigilRenderer.d.ts.map +1 -0
- package/lib/Cli/SigilRenderer.js +39 -0
- package/lib/Cli/SigilRenderer.js.map +1 -0
- package/lib/Cli/checkVersion.d.ts +11 -14
- package/lib/Cli/checkVersion.d.ts.map +1 -1
- package/lib/Cli/checkVersion.js +19 -77
- package/lib/Cli/checkVersion.js.map +1 -1
- package/lib/Cli/commands/confirm.d.ts +2 -2
- package/lib/Cli/commands/confirm.d.ts.map +1 -1
- package/lib/Cli/commands/confirm.js +3 -3
- package/lib/Cli/commands/confirm.js.map +1 -1
- package/lib/Cli/commands/deploy.d.ts +4 -4
- package/lib/Cli/commands/deploy.d.ts.map +1 -1
- package/lib/Cli/commands/deploy.js +40 -39
- package/lib/Cli/commands/deploy.js.map +1 -1
- package/lib/Cli/commands/dev.d.ts.map +1 -1
- package/lib/Cli/commands/dev.js +41 -3
- package/lib/Cli/commands/dev.js.map +1 -1
- package/lib/Cli/commands/drift.d.ts +2 -2
- package/lib/Cli/commands/drift.d.ts.map +1 -1
- package/lib/Cli/commands/drift.js +14 -13
- package/lib/Cli/commands/drift.js.map +1 -1
- package/lib/Cli/commands/errors.d.ts.map +1 -1
- package/lib/Cli/commands/errors.js +2 -1
- package/lib/Cli/commands/errors.js.map +1 -1
- package/lib/Cli/commands/instrument.d.ts +15 -5
- package/lib/Cli/commands/instrument.d.ts.map +1 -1
- package/lib/Cli/commands/instrument.js +33 -8
- package/lib/Cli/commands/instrument.js.map +1 -1
- package/lib/Cli/commands/logs.d.ts +1 -1
- package/lib/Cli/commands/logs.d.ts.map +1 -1
- package/lib/Cli/commands/logs.js +22 -22
- package/lib/Cli/commands/logs.js.map +1 -1
- package/lib/Cli/commands/nuke.d.ts +3 -2
- package/lib/Cli/commands/nuke.d.ts.map +1 -1
- package/lib/Cli/commands/nuke.js +19 -17
- package/lib/Cli/commands/nuke.js.map +1 -1
- package/lib/Cli/commands/profile/commands.d.ts +3 -2
- package/lib/Cli/commands/profile/commands.d.ts.map +1 -1
- package/lib/Cli/commands/profile/commands.js +26 -27
- package/lib/Cli/commands/profile/commands.js.map +1 -1
- package/lib/Cli/commands/profile/flows.d.ts +6 -5
- package/lib/Cli/commands/profile/flows.d.ts.map +1 -1
- package/lib/Cli/commands/profile/flows.js +19 -17
- package/lib/Cli/commands/profile/flows.js.map +1 -1
- package/lib/Cli/commands/profile/hub.d.ts +1 -2
- package/lib/Cli/commands/profile/hub.d.ts.map +1 -1
- package/lib/Cli/commands/profile/hub.js +15 -17
- package/lib/Cli/commands/profile/hub.js.map +1 -1
- package/lib/Cli/commands/provider.d.ts +3 -1
- package/lib/Cli/commands/provider.d.ts.map +1 -1
- package/lib/Cli/commands/provider.js +4 -4
- package/lib/Cli/commands/provider.js.map +1 -1
- package/lib/Cli/commands/render.d.ts +2 -4
- package/lib/Cli/commands/render.d.ts.map +1 -1
- package/lib/Cli/commands/render.js +33 -56
- package/lib/Cli/commands/render.js.map +1 -1
- package/lib/Cli/commands/state.d.ts +1 -2
- package/lib/Cli/commands/state.d.ts.map +1 -1
- package/lib/Cli/commands/state.js +74 -27
- package/lib/Cli/commands/state.js.map +1 -1
- package/lib/Cli/components/capabilities.d.ts +4 -0
- package/lib/Cli/components/capabilities.d.ts.map +1 -0
- package/lib/Cli/components/capabilities.js +18 -0
- package/lib/Cli/components/capabilities.js.map +1 -0
- package/lib/Cli/components/types.d.ts +2 -81
- package/lib/Cli/components/types.d.ts.map +1 -1
- package/lib/Cli/components/types.js +1 -3
- package/lib/Cli/components/types.js.map +1 -1
- package/lib/Cli/components/ui/Environment.d.ts +3 -3
- package/lib/Cli/components/ui/Environment.d.ts.map +1 -1
- package/lib/Cli/components/ui/Environment.js.map +1 -1
- package/lib/Cli/components/ui/Interactive.d.ts +17 -4
- package/lib/Cli/components/ui/Interactive.d.ts.map +1 -1
- package/lib/Cli/components/ui/Interactive.js +7 -11
- package/lib/Cli/components/ui/Interactive.js.map +1 -1
- package/lib/Cli/components/ui/Layout.d.ts +1 -1
- package/lib/Cli/components/ui/Layout.d.ts.map +1 -1
- package/lib/Cli/components/ui/Layout.js +1 -1
- package/lib/Cli/components/ui/Layout.js.map +1 -1
- package/lib/Cli/components/ui/Typography.d.ts +1 -1
- package/lib/Cli/components/ui/Typography.d.ts.map +1 -1
- package/lib/Cli/components/ui/Typography.js +1 -1
- package/lib/Cli/components/ui/Typography.js.map +1 -1
- package/lib/Cli/components/ui/index.d.ts +2 -2
- package/lib/Cli/components/ui/index.js +2 -2
- package/lib/Cli/components/view/ApprovePlan.d.ts +1 -1
- package/lib/Cli/components/view/ApprovePlan.d.ts.map +1 -1
- package/lib/Cli/components/view/ApprovePlan.js +2 -1
- package/lib/Cli/components/view/ApprovePlan.js.map +1 -1
- package/lib/Cli/components/view/Format.d.ts +5 -0
- package/lib/Cli/components/view/Format.d.ts.map +1 -0
- package/lib/Cli/components/view/Format.js +39 -0
- package/lib/Cli/components/view/Format.js.map +1 -0
- package/lib/Cli/components/view/Help.d.ts +2 -2
- package/lib/Cli/components/view/Help.d.ts.map +1 -1
- package/lib/Cli/components/view/Help.js +7 -5
- package/lib/Cli/components/view/Help.js.map +1 -1
- package/lib/Cli/components/view/Logo.js +1 -1
- package/lib/Cli/components/view/Logo.js.map +1 -1
- package/lib/Cli/components/view/Nuke.d.ts +8 -9
- package/lib/Cli/components/view/Nuke.d.ts.map +1 -1
- package/lib/Cli/components/view/Nuke.js +49 -52
- package/lib/Cli/components/view/Nuke.js.map +1 -1
- package/lib/Cli/components/view/PlanDecision.d.ts +1 -1
- package/lib/Cli/components/view/PlanDecision.d.ts.map +1 -1
- package/lib/Cli/components/view/PlanDecision.js +1 -1
- package/lib/Cli/components/view/PlanDecision.js.map +1 -1
- package/lib/Cli/components/view/PlanRow.js +1 -1
- package/lib/Cli/components/view/PlanRow.js.map +1 -1
- package/lib/Cli/components/view/PlanTree.d.ts +1 -1
- package/lib/Cli/components/view/PlanTree.d.ts.map +1 -1
- package/lib/Cli/components/view/PlanTree.js +1 -1
- package/lib/Cli/components/view/PlanView.js +1 -1
- package/lib/Cli/components/view/PlanView.js.map +1 -1
- package/lib/Cli/components/view/Profile.d.ts +1 -1
- package/lib/Cli/components/view/Profile.js +2 -2
- package/lib/Cli/components/view/Profile.js.map +1 -1
- package/lib/Cli/components/view/ProfileDashboard.d.ts +4 -4
- package/lib/Cli/components/view/ProfileDashboard.d.ts.map +1 -1
- package/lib/Cli/components/view/ProfileDashboard.js +9 -8
- package/lib/Cli/components/view/ProfileDashboard.js.map +1 -1
- package/lib/Cli/components/view/Prompts.d.ts +3 -3
- package/lib/Cli/components/view/Prompts.d.ts.map +1 -1
- package/lib/Cli/components/view/Prompts.js +11 -18
- package/lib/Cli/components/view/Prompts.js.map +1 -1
- package/lib/Cli/components/view/Runtime.d.ts +5 -5
- package/lib/Cli/components/view/Runtime.d.ts.map +1 -1
- package/lib/Cli/components/view/Runtime.js +136 -219
- package/lib/Cli/components/view/Runtime.js.map +1 -1
- package/lib/Cli/components/view/SigilCli.d.ts +2 -2
- package/lib/Cli/components/view/SigilCli.d.ts.map +1 -1
- package/lib/Cli/components/view/SigilCli.js +7 -7
- package/lib/Cli/components/view/SigilCli.js.map +1 -1
- package/lib/Cli/components/view/StateExplorer.d.ts +1 -1
- package/lib/Cli/components/view/StateExplorer.d.ts.map +1 -1
- package/lib/Cli/components/view/StateExplorer.js +2 -1
- package/lib/Cli/components/view/StateExplorer.js.map +1 -1
- package/lib/Cli/components/view/statusStyle.d.ts +2 -2
- package/lib/Cli/components/view/statusStyle.d.ts.map +1 -1
- package/lib/Cli/components/view/statusStyle.js +1 -1
- package/lib/Cli/components/view/statusStyle.js.map +1 -1
- package/lib/Cli/exec.d.ts +6 -1
- package/lib/Cli/exec.d.ts.map +1 -1
- package/lib/Cli/exec.js +29 -34
- package/lib/Cli/exec.js.map +1 -1
- package/lib/Cli/main.d.ts.map +1 -1
- package/lib/Cli/main.js +35 -26
- package/lib/Cli/main.js.map +1 -1
- package/lib/Cli/selectCli.d.ts +2 -2
- package/lib/Cli/selectCli.d.ts.map +1 -1
- package/lib/Cli/selectCli.js +2 -2
- package/lib/Cli/selectCli.js.map +1 -1
- package/lib/Command/Command.js +1 -1
- package/lib/Command/Command.js.map +1 -1
- package/lib/Command/Dev.d.ts +58 -4
- package/lib/Command/Dev.d.ts.map +1 -1
- package/lib/Command/Dev.js +87 -30
- package/lib/Command/Dev.js.map +1 -1
- package/lib/Command/Local.d.ts +1 -1
- package/lib/Command/Memo.js +1 -1
- package/lib/Command/Memo.js.map +1 -1
- package/lib/Command/Providers.d.ts +1 -1
- package/lib/Command/Providers.d.ts.map +1 -1
- package/lib/Contributions.d.ts +2 -3
- package/lib/Contributions.d.ts.map +1 -1
- package/lib/Contributions.js +38 -6
- package/lib/Contributions.js.map +1 -1
- package/lib/DNS/Adapter.d.ts +204 -0
- package/lib/DNS/Adapter.d.ts.map +1 -0
- package/lib/DNS/Adapter.js +112 -0
- package/lib/DNS/Adapter.js.map +1 -0
- package/lib/DNS/index.d.ts +2 -0
- package/lib/DNS/index.d.ts.map +1 -0
- package/lib/DNS/index.js +2 -0
- package/lib/DNS/index.js.map +1 -0
- package/lib/Deploy.d.ts +7 -2
- package/lib/Deploy.d.ts.map +1 -1
- package/lib/Deploy.js +8 -3
- package/lib/Deploy.js.map +1 -1
- package/lib/Destroy.d.ts +5 -8
- package/lib/Destroy.d.ts.map +1 -1
- package/lib/Destroy.js +10 -7
- package/lib/Destroy.js.map +1 -1
- package/lib/Diff.d.ts.map +1 -1
- package/lib/Diff.js +14 -4
- package/lib/Diff.js.map +1 -1
- package/lib/Drift.d.ts +7 -7
- package/lib/Drift.d.ts.map +1 -1
- package/lib/Drift.js +184 -101
- package/lib/Drift.js.map +1 -1
- package/lib/EvalStack.d.ts +23 -0
- package/lib/EvalStack.d.ts.map +1 -0
- package/lib/EvalStack.js +47 -0
- package/lib/EvalStack.js.map +1 -0
- package/lib/Events.d.ts +210 -0
- package/lib/Events.d.ts.map +1 -0
- package/lib/Events.js +244 -0
- package/lib/Events.js.map +1 -0
- package/lib/Interaction.d.ts +159 -48
- package/lib/Interaction.d.ts.map +1 -1
- package/lib/Interaction.js +139 -58
- package/lib/Interaction.js.map +1 -1
- package/lib/Local/LocalProvider.d.ts.map +1 -1
- package/lib/Local/LocalProvider.js +31 -9
- package/lib/Local/LocalProvider.js.map +1 -1
- package/lib/Local/RpcProvider.d.ts.map +1 -1
- package/lib/Local/RpcProvider.js +10 -1
- package/lib/Local/RpcProvider.js.map +1 -1
- package/lib/Local/RpcProviderProxy.d.ts +16 -0
- package/lib/Local/RpcProviderProxy.d.ts.map +1 -1
- package/lib/Local/RpcProviderProxy.js +19 -10
- package/lib/Local/RpcProviderProxy.js.map +1 -1
- package/lib/Local/RpcSerialization.d.ts +3 -2
- package/lib/Local/RpcSerialization.d.ts.map +1 -1
- package/lib/Local/RpcSerialization.js +13 -10
- package/lib/Local/RpcSerialization.js.map +1 -1
- package/lib/Local/RpcServer.d.ts +2 -1
- package/lib/Local/RpcServer.d.ts.map +1 -1
- package/lib/Local/RpcServer.js +19 -14
- package/lib/Local/RpcServer.js.map +1 -1
- package/lib/Local/RpcServerBun.d.ts.map +1 -1
- package/lib/Local/RpcServerBun.js +8 -4
- package/lib/Local/RpcServerBun.js.map +1 -1
- package/lib/Local/RpcServerEnvironment.d.ts +2 -3
- package/lib/Local/RpcServerEnvironment.d.ts.map +1 -1
- package/lib/Local/RpcServerEnvironment.js +2 -2
- package/lib/Local/RpcServerEnvironment.js.map +1 -1
- package/lib/Local/RpcServerNode.d.ts.map +1 -1
- package/lib/Local/RpcServerNode.js +5 -1
- package/lib/Local/RpcServerNode.js.map +1 -1
- package/lib/Local/RpcServerSession.d.ts +1 -1
- package/lib/Local/RpcServerSession.d.ts.map +1 -1
- package/lib/Local/RpcServerSession.js.map +1 -1
- package/lib/Local/RpcSpawner.d.ts +6 -8
- package/lib/Local/RpcSpawner.d.ts.map +1 -1
- package/lib/Local/RpcSpawner.js +45 -36
- package/lib/Local/RpcSpawner.js.map +1 -1
- package/lib/Local/Sidecar.d.ts +23 -0
- package/lib/Local/Sidecar.d.ts.map +1 -1
- package/lib/Local/Sidecar.js +14 -9
- package/lib/Local/Sidecar.js.map +1 -1
- package/lib/Nuke.d.ts +5 -23
- package/lib/Nuke.d.ts.map +1 -1
- package/lib/Nuke.js +48 -13
- package/lib/Nuke.js.map +1 -1
- package/lib/Output.d.ts +19 -1
- package/lib/Output.d.ts.map +1 -1
- package/lib/Output.js +96 -3
- package/lib/Output.js.map +1 -1
- package/lib/Plan.d.ts +5 -1
- package/lib/Plan.d.ts.map +1 -1
- package/lib/Plan.js +111 -33
- package/lib/Plan.js.map +1 -1
- package/lib/Platform.d.ts.map +1 -1
- package/lib/Platform.js +31 -7
- package/lib/Platform.js.map +1 -1
- package/lib/Provider.d.ts +45 -0
- package/lib/Provider.d.ts.map +1 -1
- package/lib/Provider.js +2 -2
- package/lib/Provider.js.map +1 -1
- package/lib/Report.d.ts +17 -195
- package/lib/Report.d.ts.map +1 -1
- package/lib/Report.js +39 -12
- package/lib/Report.js.map +1 -1
- package/lib/Runtime/ManagedHttpShutdown.d.ts +17 -0
- package/lib/Runtime/ManagedHttpShutdown.d.ts.map +1 -1
- package/lib/Runtime/ManagedHttpShutdown.js +11 -2
- package/lib/Runtime/ManagedHttpShutdown.js.map +1 -1
- package/lib/RuntimeContext.js +1 -1
- package/lib/RuntimeContext.js.map +1 -1
- package/lib/Stack.d.ts +49 -29
- package/lib/Stack.d.ts.map +1 -1
- package/lib/Stack.js +25 -31
- package/lib/Stack.js.map +1 -1
- package/lib/State/BucketState.d.ts.map +1 -1
- package/lib/State/BucketState.js +43 -14
- package/lib/State/BucketState.js.map +1 -1
- package/lib/State/LocalState.d.ts.map +1 -1
- package/lib/State/LocalState.js +3 -3
- package/lib/State/LocalState.js.map +1 -1
- package/lib/State/Provisioning.d.ts +5 -0
- package/lib/State/Provisioning.d.ts.map +1 -1
- package/lib/State/Provisioning.js +3 -1
- package/lib/State/Provisioning.js.map +1 -1
- package/lib/State/ResourceState.d.ts +2 -0
- package/lib/State/ResourceState.d.ts.map +1 -1
- package/lib/State/State.d.ts +26 -0
- package/lib/State/State.d.ts.map +1 -1
- package/lib/State/StateEncoding.d.ts +7 -0
- package/lib/State/StateEncoding.d.ts.map +1 -1
- package/lib/State/StateEncoding.js +19 -0
- package/lib/State/StateEncoding.js.map +1 -1
- package/lib/State/index.js +2 -2
- package/lib/State/index.js.map +1 -1
- package/lib/Telemetry/Layer.d.ts +2 -5
- package/lib/Telemetry/Layer.d.ts.map +1 -1
- package/lib/Telemetry/Layer.js +3 -23
- package/lib/Telemetry/Layer.js.map +1 -1
- package/lib/Telemetry/Metrics.d.ts +1 -1
- package/lib/Telemetry/Metrics.d.ts.map +1 -1
- package/lib/TelemetryRelay.js +1 -1
- package/lib/TelemetryRelay.js.map +1 -1
- package/lib/TelemetryRuntime.d.ts +1 -1
- package/lib/TelemetryRuntime.d.ts.map +1 -1
- package/lib/TelemetryRuntime.js +4 -3
- package/lib/TelemetryRuntime.js.map +1 -1
- package/lib/Util/ConsoleSink.d.ts +23 -2
- package/lib/Util/ConsoleSink.d.ts.map +1 -1
- package/lib/Util/ConsoleSink.js +54 -14
- package/lib/Util/ConsoleSink.js.map +1 -1
- package/lib/Util/LogAnnotation.d.ts +19 -0
- package/lib/Util/LogAnnotation.d.ts.map +1 -0
- package/lib/Util/LogAnnotation.js +19 -0
- package/lib/Util/LogAnnotation.js.map +1 -0
- package/lib/Util/LogRecord.d.ts +281 -0
- package/lib/Util/LogRecord.d.ts.map +1 -0
- package/lib/Util/LogRecord.js +267 -0
- package/lib/Util/LogRecord.js.map +1 -0
- package/lib/Util/Node.d.ts +9 -0
- package/lib/Util/Node.d.ts.map +1 -1
- package/lib/Util/Node.js +10 -6
- package/lib/Util/Node.js.map +1 -1
- package/lib/Util/PlatformServices.d.ts +3 -2
- package/lib/Util/PlatformServices.d.ts.map +1 -1
- package/lib/Util/PlatformServices.js +6 -2
- package/lib/Util/PlatformServices.js.map +1 -1
- package/lib/Util/ResourceOutput.d.ts +18 -10
- package/lib/Util/ResourceOutput.d.ts.map +1 -1
- package/lib/Util/ResourceOutput.js +22 -23
- package/lib/Util/ResourceOutput.js.map +1 -1
- package/lib/Util/Shutdown.d.ts +10 -0
- package/lib/Util/Shutdown.d.ts.map +1 -0
- package/lib/Util/Shutdown.js +32 -0
- package/lib/Util/Shutdown.js.map +1 -0
- package/lib/Util/Terminal.d.ts +2 -4
- package/lib/Util/Terminal.d.ts.map +1 -1
- package/lib/Util/Terminal.js +3 -11
- package/lib/Util/Terminal.js.map +1 -1
- package/lib/Util/TraceParent.d.ts +32 -0
- package/lib/Util/TraceParent.d.ts.map +1 -0
- package/lib/Util/TraceParent.js +42 -0
- package/lib/Util/TraceParent.js.map +1 -0
- package/lib/Util/base64.d.ts +7 -0
- package/lib/Util/base64.d.ts.map +1 -0
- package/lib/Util/base64.js +24 -0
- package/lib/Util/base64.js.map +1 -0
- package/lib/Util/cached-function.d.ts +5 -0
- package/lib/Util/cached-function.d.ts.map +1 -1
- package/lib/Util/cached-function.js +13 -8
- package/lib/Util/cached-function.js.map +1 -1
- package/lib/Util/data.d.ts +1 -1
- package/lib/Util/data.d.ts.map +1 -1
- package/lib/Util/data.js +1 -1
- package/lib/Util/data.js.map +1 -1
- package/lib/Util/equal.d.ts.map +1 -1
- package/lib/Util/equal.js +3 -2
- package/lib/Util/equal.js.map +1 -1
- package/lib/Util/extraFiles.d.ts.map +1 -1
- package/lib/Util/extraFiles.js +5 -5
- package/lib/Util/extraFiles.js.map +1 -1
- package/lib/Util/interactive.js +1 -1
- package/lib/Website/AstroOutput.d.ts +42 -0
- package/lib/Website/AstroOutput.d.ts.map +1 -0
- package/lib/Website/AstroOutput.js +34 -0
- package/lib/Website/AstroOutput.js.map +1 -0
- package/lib/Website/FrontendCore.d.ts +1 -1
- package/lib/Workflows.d.ts +9 -0
- package/lib/Workflows.d.ts.map +1 -1
- package/lib/Workflows.js +8 -0
- package/lib/Workflows.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +21 -28
- package/src/AdoptPolicy.ts +76 -0
- package/src/Alchemist/AuthRegistry.ts +164 -0
- package/src/Alchemist/Drift.ts +103 -0
- package/src/Alchemist/Entrypoint.ts +51 -3
- package/src/Alchemist/Errors.ts +1 -1
- package/src/Alchemist/{routes/logs.ts → Logs.ts} +28 -30
- package/src/Alchemist/Nuke.ts +90 -0
- package/src/Alchemist/Operations.ts +309 -0
- package/src/Alchemist/{routes/profile.ts → Profile.ts} +22 -22
- package/src/Alchemist/{routes/provider.ts → Provider.ts} +7 -6
- package/src/Alchemist/Runtime.ts +46 -12
- package/src/Alchemist/{routes/state.ts → State.ts} +78 -21
- package/src/Alchemist/index.ts +32 -15
- package/src/Apply.ts +513 -274
- package/src/Auth/AuthProvider.ts +76 -23
- package/src/Auth/BrowserOAuth.ts +37 -60
- package/src/Auth/Credentials.ts +2 -4
- package/src/Auth/Demand.ts +27 -18
- package/src/Auth/Env.ts +13 -8
- package/src/Auth/Inspect.ts +5 -2
- package/src/Auth/Lock.ts +4 -8
- package/src/Auth/OAuthFlow.ts +12 -26
- package/src/Auth/Paths.ts +3 -2
- package/src/Auth/Profile.ts +30 -2
- package/src/Auth/Registry.ts +27 -0
- package/src/Auth/Resolve.ts +75 -3
- package/src/Auth/StoredAuthProvider.ts +1 -2
- package/src/Binding.ts +3 -4
- package/src/Bundle/Bundle.ts +58 -7
- package/src/Bundle/NamespaceImportPlugin.ts +259 -0
- package/src/Bundle/index.ts +1 -0
- package/src/Cli/Format.ts +2 -1
- package/src/Cli/GlobalLog.ts +206 -68
- package/src/Cli/LoggingCli.ts +33 -20
- package/src/Cli/PlainCliFormatter.ts +4 -1
- package/src/Cli/Present.ts +34 -0
- package/src/Cli/SigilRenderer.ts +75 -0
- package/src/Cli/checkVersion.ts +25 -78
- package/src/Cli/commands/confirm.ts +3 -3
- package/src/Cli/commands/deploy.ts +53 -44
- package/src/Cli/commands/dev.ts +65 -7
- package/src/Cli/commands/drift.ts +20 -16
- package/src/Cli/commands/errors.ts +2 -3
- package/src/Cli/commands/instrument.ts +39 -8
- package/src/Cli/commands/logs.ts +22 -30
- package/src/Cli/commands/nuke.ts +25 -26
- package/src/Cli/commands/profile/commands.ts +34 -34
- package/src/Cli/commands/profile/flows.ts +26 -20
- package/src/Cli/commands/profile/hub.ts +16 -18
- package/src/Cli/commands/provider.ts +4 -4
- package/src/Cli/commands/render.ts +43 -71
- package/src/Cli/commands/state.ts +113 -33
- package/src/Cli/components/capabilities.ts +20 -0
- package/src/Cli/components/types.ts +13 -99
- package/src/Cli/components/ui/Environment.tsx +5 -5
- package/src/Cli/components/ui/Interactive.tsx +24 -15
- package/src/Cli/components/ui/Layout.tsx +1 -1
- package/src/Cli/components/ui/Typography.tsx +1 -1
- package/src/Cli/components/ui/index.ts +2 -2
- package/src/Cli/components/view/ApprovePlan.tsx +2 -1
- package/src/Cli/components/view/Format.tsx +58 -0
- package/src/Cli/components/view/Help.tsx +14 -17
- package/src/Cli/components/view/Logo.tsx +1 -1
- package/src/Cli/components/view/Nuke.tsx +74 -49
- package/src/Cli/components/view/PlanDecision.tsx +1 -1
- package/src/Cli/components/view/PlanRow.tsx +1 -1
- package/src/Cli/components/view/PlanTree.ts +2 -2
- package/src/Cli/components/view/PlanView.tsx +2 -2
- package/src/Cli/components/view/Profile.tsx +2 -2
- package/src/Cli/components/view/ProfileDashboard.tsx +12 -11
- package/src/Cli/components/view/Prompts.tsx +37 -75
- package/src/Cli/components/view/Runtime.tsx +132 -238
- package/src/Cli/components/view/SigilCli.tsx +12 -12
- package/src/Cli/components/view/StateExplorer.tsx +2 -1
- package/src/Cli/components/view/statusStyle.ts +2 -2
- package/src/Cli/exec.ts +48 -41
- package/src/Cli/main.ts +52 -33
- package/src/Cli/selectCli.ts +3 -3
- package/src/Command/Command.ts +1 -1
- package/src/Command/Dev.ts +129 -36
- package/src/Command/Memo.ts +1 -1
- package/src/Contributions.ts +42 -8
- package/src/DNS/Adapter.ts +289 -0
- package/src/DNS/index.ts +1 -0
- package/src/Deploy.ts +11 -3
- package/src/Destroy.ts +19 -13
- package/src/Diff.ts +17 -4
- package/src/Drift.ts +256 -127
- package/src/EvalStack.ts +97 -0
- package/src/Events.ts +296 -0
- package/src/Interaction.ts +332 -97
- package/src/Local/LocalProvider.ts +40 -9
- package/src/Local/RpcProvider.ts +11 -1
- package/src/Local/RpcProviderProxy.ts +29 -21
- package/src/Local/RpcSerialization.ts +32 -17
- package/src/Local/RpcServer.ts +25 -17
- package/src/Local/RpcServerBun.ts +10 -6
- package/src/Local/RpcServerEnvironment.ts +2 -2
- package/src/Local/RpcServerNode.ts +8 -1
- package/src/Local/RpcServerSession.ts +2 -2
- package/src/Local/RpcSpawner.ts +61 -37
- package/src/Local/Sidecar.ts +10 -1
- package/src/Nuke.ts +66 -43
- package/src/Output.ts +120 -7
- package/src/Plan.ts +140 -52
- package/src/Platform.ts +47 -18
- package/src/Provider.ts +48 -3
- package/src/Report.ts +77 -275
- package/src/Runtime/ManagedHttpShutdown.ts +21 -4
- package/src/RuntimeContext.ts +1 -1
- package/src/Stack.ts +113 -135
- package/src/State/BucketState.ts +53 -21
- package/src/State/LocalState.ts +7 -9
- package/src/State/Provisioning.ts +8 -1
- package/src/State/ResourceState.ts +2 -0
- package/src/State/State.ts +30 -0
- package/src/State/StateEncoding.ts +22 -0
- package/src/State/index.ts +2 -2
- package/src/Telemetry/Layer.ts +3 -24
- package/src/Telemetry/Metrics.ts +1 -1
- package/src/TelemetryRelay.ts +1 -1
- package/src/TelemetryRuntime.ts +8 -8
- package/src/Util/ConsoleSink.ts +76 -13
- package/src/Util/LogAnnotation.ts +18 -0
- package/src/Util/LogRecord.ts +386 -0
- package/src/Util/Node.ts +20 -6
- package/src/Util/PlatformServices.ts +17 -4
- package/src/Util/ResourceOutput.ts +26 -25
- package/src/Util/Shutdown.ts +52 -0
- package/src/Util/Terminal.ts +3 -20
- package/src/Util/TraceParent.ts +70 -0
- package/src/Util/base64.ts +22 -0
- package/src/Util/cached-function.ts +30 -19
- package/src/Util/data.ts +2 -2
- package/src/Util/equal.ts +3 -2
- package/src/Util/extraFiles.ts +9 -8
- package/src/Util/interactive.ts +1 -1
- package/src/Website/AstroOutput.ts +83 -0
- package/src/Workflows.ts +11 -0
- package/src/index.ts +1 -0
- package/lib/Alchemist/Progress.d.ts +0 -16
- package/lib/Alchemist/Progress.d.ts.map +0 -1
- package/lib/Alchemist/Progress.js +0 -123
- package/lib/Alchemist/Progress.js.map +0 -1
- package/lib/Alchemist/Session.d.ts +0 -116
- package/lib/Alchemist/Session.d.ts.map +0 -1
- package/lib/Alchemist/Session.js +0 -212
- package/lib/Alchemist/Session.js.map +0 -1
- package/lib/Alchemist/routes/drift.d.ts +0 -55
- package/lib/Alchemist/routes/drift.d.ts.map +0 -1
- package/lib/Alchemist/routes/drift.js +0 -52
- package/lib/Alchemist/routes/drift.js.map +0 -1
- package/lib/Alchemist/routes/logs.d.ts +0 -41
- package/lib/Alchemist/routes/logs.d.ts.map +0 -1
- package/lib/Alchemist/routes/logs.js.map +0 -1
- package/lib/Alchemist/routes/nuke.d.ts +0 -46
- package/lib/Alchemist/routes/nuke.d.ts.map +0 -1
- package/lib/Alchemist/routes/nuke.js +0 -80
- package/lib/Alchemist/routes/nuke.js.map +0 -1
- package/lib/Alchemist/routes/profile.d.ts +0 -133
- package/lib/Alchemist/routes/profile.d.ts.map +0 -1
- package/lib/Alchemist/routes/profile.js.map +0 -1
- package/lib/Alchemist/routes/provider.d.ts.map +0 -1
- package/lib/Alchemist/routes/provider.js.map +0 -1
- package/lib/Alchemist/routes/stack.d.ts +0 -95
- package/lib/Alchemist/routes/stack.d.ts.map +0 -1
- package/lib/Alchemist/routes/stack.js +0 -73
- package/lib/Alchemist/routes/stack.js.map +0 -1
- package/lib/Alchemist/routes/state.d.ts.map +0 -1
- package/lib/Alchemist/routes/state.js.map +0 -1
- package/lib/Cli/CliKit/CliKit.d.ts +0 -92
- package/lib/Cli/CliKit/CliKit.d.ts.map +0 -1
- package/lib/Cli/CliKit/CliKit.js +0 -27
- package/lib/Cli/CliKit/CliKit.js.map +0 -1
- package/lib/Cli/CliKit/index.d.ts +0 -9
- package/lib/Cli/CliKit/index.d.ts.map +0 -1
- package/lib/Cli/CliKit/index.js +0 -9
- package/lib/Cli/CliKit/index.js.map +0 -1
- package/lib/Cli/CliKit/interaction.d.ts +0 -13
- package/lib/Cli/CliKit/interaction.d.ts.map +0 -1
- package/lib/Cli/CliKit/interaction.js +0 -17
- package/lib/Cli/CliKit/interaction.js.map +0 -1
- package/lib/Cli/CliKit/layer.d.ts +0 -7
- package/lib/Cli/CliKit/layer.d.ts.map +0 -1
- package/lib/Cli/CliKit/layer.js +0 -33
- package/lib/Cli/CliKit/layer.js.map +0 -1
- package/lib/Local/DevLog.d.ts +0 -32
- package/lib/Local/DevLog.d.ts.map +0 -1
- package/lib/Local/DevLog.js +0 -112
- package/lib/Local/DevLog.js.map +0 -1
- package/lib/Test/Alchemy.d.ts +0 -79
- package/lib/Test/Alchemy.d.ts.map +0 -1
- package/lib/Test/Alchemy.js +0 -193
- package/lib/Test/Alchemy.js.map +0 -1
- package/lib/Test/Bun.d.ts +0 -69
- package/lib/Test/Bun.d.ts.map +0 -1
- package/lib/Test/Bun.js +0 -126
- package/lib/Test/Bun.js.map +0 -1
- package/lib/Test/Core.d.ts +0 -277
- package/lib/Test/Core.d.ts.map +0 -1
- package/lib/Test/Core.js +0 -362
- package/lib/Test/Core.js.map +0 -1
- package/lib/Test/Http.d.ts +0 -109
- package/lib/Test/Http.d.ts.map +0 -1
- package/lib/Test/Http.js +0 -123
- package/lib/Test/Http.js.map +0 -1
- package/lib/Test/TestState.d.ts +0 -12
- package/lib/Test/TestState.d.ts.map +0 -1
- package/lib/Test/TestState.js +0 -15
- package/lib/Test/TestState.js.map +0 -1
- package/lib/Test/Vitest.d.ts +0 -60
- package/lib/Test/Vitest.d.ts.map +0 -1
- package/lib/Test/Vitest.js +0 -132
- package/lib/Test/Vitest.js.map +0 -1
- package/lib/Test/index.d.ts +0 -3
- package/lib/Test/index.d.ts.map +0 -1
- package/lib/Test/index.js +0 -3
- package/lib/Test/index.js.map +0 -1
- package/lib/Util/FileLogger.d.ts +0 -7
- package/lib/Util/FileLogger.d.ts.map +0 -1
- package/lib/Util/FileLogger.js +0 -16
- package/lib/Util/FileLogger.js.map +0 -1
- package/src/Alchemist/Progress.ts +0 -167
- package/src/Alchemist/Session.ts +0 -415
- package/src/Alchemist/routes/drift.ts +0 -87
- package/src/Alchemist/routes/nuke.ts +0 -131
- package/src/Alchemist/routes/stack.ts +0 -173
- package/src/Cli/CliKit/CliKit.ts +0 -159
- package/src/Cli/CliKit/index.ts +0 -41
- package/src/Cli/CliKit/interaction.ts +0 -19
- package/src/Cli/CliKit/layer.ts +0 -44
- package/src/Local/DevLog.ts +0 -122
- package/src/Test/Alchemy.ts +0 -334
- package/src/Test/Bun.ts +0 -230
- package/src/Test/Core.ts +0 -785
- package/src/Test/Http.ts +0 -201
- package/src/Test/TestState.ts +0 -35
- package/src/Test/Vitest.ts +0 -239
- package/src/Test/index.ts +0 -2
- package/src/Util/FileLogger.ts +0 -20
package/lib/Cli/GlobalLog.d.ts
CHANGED
|
@@ -1,41 +1,87 @@
|
|
|
1
|
+
import * as GlobalFlag from "effect/cli/GlobalFlag";
|
|
2
|
+
import * as Context from "effect/Context";
|
|
1
3
|
import * as Effect from "effect/Effect";
|
|
2
4
|
import * as FileSystem from "effect/FileSystem";
|
|
3
5
|
import * as Layer from "effect/Layer";
|
|
4
6
|
import * as Logger from "effect/Logger";
|
|
5
7
|
import * as LogLevel from "effect/LogLevel";
|
|
8
|
+
import * as Option from "effect/Option";
|
|
6
9
|
import { Path } from "effect/Path";
|
|
7
10
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*
|
|
18
|
-
*
|
|
11
|
+
* `--log-level`: the lowest level printed on the console. Registered on the
|
|
12
|
+
* CLI root in place of Effect's built-in flag, which also lowers the
|
|
13
|
+
* minimum log level and so would drop records from the run log; the run
|
|
14
|
+
* log records Debug whatever the console shows.
|
|
15
|
+
*/
|
|
16
|
+
export declare const LogLevelFlag: GlobalFlag.Setting<"log-level", Option.Option<LogLevel.LogLevel>>;
|
|
17
|
+
/** How the terminal shows log records. */
|
|
18
|
+
export type LogFormat = "pretty" | "json";
|
|
19
|
+
/**
|
|
20
|
+
* `--log-format pretty|json`: `json` prints one {@link LogRecord} per line
|
|
21
|
+
* on stderr and leaves rendering to the reader. Registered on the CLI root;
|
|
22
|
+
* the console logger reads the parsed value (see {@link consoleSettings}).
|
|
23
|
+
*/
|
|
24
|
+
export declare const LogFormatFlag: GlobalFlag.Setting<"log-format", Option.Option<"json" | "pretty">>;
|
|
25
|
+
/** What the console shows, and how. */
|
|
26
|
+
export interface ConsoleSettings {
|
|
27
|
+
/** Records below this level stay in the run log only. */
|
|
28
|
+
readonly floor: LogLevel.LogLevel;
|
|
29
|
+
readonly format: LogFormat;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The console settings in `context`: the parsed `--log-level` and
|
|
33
|
+
* `--log-format` flags inside a command, and otherwise (before the command
|
|
34
|
+
* line is parsed, or in a child process that never sees it) the `ALCHEMY_LOG_*` environment variables. The console keeps its
|
|
35
|
+
* usual Info+ noise floor by default; the run log captures Debug regardless
|
|
36
|
+
* (#1231).
|
|
37
|
+
*/
|
|
38
|
+
export declare const consoleSettings: (context: Context.Context<never>) => ConsoleSettings;
|
|
39
|
+
/** The current fiber's {@link consoleSettings}. */
|
|
40
|
+
export declare const currentConsoleSettings: Effect.Effect<ConsoleSettings>;
|
|
41
|
+
/** {@link ConsoleSettings} as environment, for a child process that renders the run's logs. */
|
|
42
|
+
export declare const consoleSettingsEnv: (settings: ConsoleSettings) => Record<string, string>;
|
|
43
|
+
/**
|
|
44
|
+
* Terminal sink: forwards records at or above the logging fiber's
|
|
45
|
+
* {@link consoleSettings} floor to `sink`, or to the sink its settings
|
|
46
|
+
* select.
|
|
19
47
|
*/
|
|
20
|
-
export declare const
|
|
21
|
-
/** Terminal sink: forwards records at or above `floor` to `sink`. */
|
|
22
|
-
export declare const makeConsoleLogger: (floor: LogLevel.LogLevel, sink?: Logger.Logger<unknown, void>) => Logger.Logger<unknown, void>;
|
|
48
|
+
export declare const makeConsoleLogger: (sink?: Logger.Logger<unknown, void>) => Logger.Logger<unknown, void>;
|
|
23
49
|
/** Shared terminal logger for CLI entrypoints that do not need a run file. */
|
|
24
50
|
export declare const ConsoleLogLive: Layer.Layer<never, never, never>;
|
|
25
51
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* `
|
|
29
|
-
*
|
|
30
|
-
|
|
31
|
-
|
|
52
|
+
* The run log's file logger alone. The run log is the only log file: the
|
|
53
|
+
* top-level CLI process writes it, and records its children already showed
|
|
54
|
+
* on the terminal (the `alchemy dev` exec child's) go here without being
|
|
55
|
+
* printed again.
|
|
56
|
+
*/
|
|
57
|
+
export declare const RunLog: Context.Reference<Logger.Logger<unknown, void>>;
|
|
58
|
+
/**
|
|
59
|
+
* A run log file that is created on its first record, so a run that sends
|
|
60
|
+
* nothing to it leaves nothing behind (and a `profile` command run outside
|
|
61
|
+
* a project never creates a `.alchemy` there). The file starts with a `run`
|
|
62
|
+
* record describing the run, so it reads standalone.
|
|
63
|
+
*
|
|
64
|
+
* A logger is called synchronously but the file is written asynchronously,
|
|
65
|
+
* so the logger only queues each record as a JSON line, and one writer fiber
|
|
66
|
+
* creates the file on the first line and appends the rest. Closing the log
|
|
67
|
+
* ends the queue and waits for the writer, so no queued record is lost.
|
|
68
|
+
*
|
|
69
|
+
* @internal exported for tests.
|
|
70
|
+
*/
|
|
71
|
+
export declare const lazyRunLog: (dir: string, name: string, scope: "global" | "project") => Effect.Effect<Logger.Logger<unknown, void>, never, FileSystem.FileSystem | Path | import("effect/Scope").Scope>;
|
|
72
|
+
/**
|
|
73
|
+
* The two run logs: records scoped `global` (the state store, auth,
|
|
74
|
+
* profiles; see `globalLogs`) go to `~/.alchemy/logs` (relocated by
|
|
75
|
+
* `ALCHEMY_HOME`), everything else to the project's `.alchemy/log`. Every
|
|
76
|
+
* run writes `{timestamp}-pid{pid}.ndjson` (NDJSON log records) at Debug
|
|
77
|
+
* level — failures record their full causes there even though the terminal
|
|
78
|
+
* only shows the friendly message. Console output stays at Info+ unless
|
|
79
|
+
* `--log-level` lowers the floor (see {@link consoleSettings}).
|
|
32
80
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
81
|
+
* Only the top-level CLI process writes them; its children's records reach
|
|
82
|
+
* them through it. Commands that install their own loggers with
|
|
83
|
+
* `mergeWithExisting: true` compose with these; a replacing `Logger.layer`
|
|
84
|
+
* scopes them out for that subtree only.
|
|
37
85
|
*/
|
|
38
86
|
export declare const GlobalLogLive: Layer.Layer<never, never, FileSystem.FileSystem | Path>;
|
|
39
|
-
/** First line of every run log: enough context to read it standalone. */
|
|
40
|
-
export declare const logRunHeader: Effect.Effect<void>;
|
|
41
87
|
//# sourceMappingURL=GlobalLog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalLog.d.ts","sourceRoot":"","sources":["../../src/Cli/GlobalLog.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"GlobalLog.d.ts","sourceRoot":"","sources":["../../src/Cli/GlobalLog.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAE1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,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,IAAI,EAAE,MAAM,aAAa,CAAC;AAkCnC;;;;;GAKG;AACH,eAAO,MAAM,YAAY,mEAMvB,CAAC;AAEH,0CAA0C;AAC1C,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE1C;;;;GAIG;AACH,eAAO,MAAM,aAAa,oEAKxB,CAAC;AAEH,uCAAuC;AACvC,MAAM,WAAW,eAAe;IAC9B,yDAAyD;IACzD,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;CAC5B;AAKD;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,YAAa,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,KAAG,eAShE,CAAC;AAEH,mDAAmD;AACnD,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,CAAC,eAAe,CAGjE,CAAC;AAEF,+FAA+F;AAC/F,eAAO,MAAM,kBAAkB,aAAc,eAAe,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAGlF,CAAC;AAKH;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,UAAW,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,iCAMjE,CAAC;AAEL,8EAA8E;AAC9E,eAAO,MAAM,cAAc,kCAG1B,CAAC;AAKF;;;;;GAKG;AACH,eAAO,MAAM,MAAM,iDAEjB,CAAC;AAyBH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,UAAU,6KA6BrB,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,yDA2BzB,CAAC"}
|
package/lib/Cli/GlobalLog.js
CHANGED
|
@@ -1,19 +1,28 @@
|
|
|
1
|
+
import * as Flag from "effect/cli/Flag";
|
|
2
|
+
import * as GlobalFlag from "effect/cli/GlobalFlag";
|
|
1
3
|
import * as Clock from "effect/Clock";
|
|
4
|
+
import * as Context from "effect/Context";
|
|
2
5
|
import * as Duration from "effect/Duration";
|
|
3
6
|
import * as Effect from "effect/Effect";
|
|
7
|
+
import * as Fiber from "effect/Fiber";
|
|
4
8
|
import * as FileSystem from "effect/FileSystem";
|
|
5
9
|
import * as Layer from "effect/Layer";
|
|
6
10
|
import * as Logger from "effect/Logger";
|
|
7
11
|
import * as LogLevel from "effect/LogLevel";
|
|
8
12
|
import * as Option from "effect/Option";
|
|
9
13
|
import { Path } from "effect/Path";
|
|
10
|
-
import
|
|
14
|
+
import * as Queue from "effect/Queue";
|
|
15
|
+
import { CurrentLogAnnotations, MinimumLogLevel } from "effect/References";
|
|
11
16
|
import packageJson from "../../package.json" with { type: "json" };
|
|
17
|
+
import { dotAlchemyDirectory } from "../AlchemyContext.js";
|
|
12
18
|
import { rootDir } from "../Auth/Paths.js";
|
|
13
19
|
import { makePlainConsoleSink } from "../Util/ConsoleSink.js";
|
|
20
|
+
import { LogAnnotation } from "../Util/LogAnnotation.js";
|
|
21
|
+
import { formatJsonRecord, jsonLogger, LOG_FORMAT_ENV, LOG_LEVEL_ENV, safeStringify, } from "../Util/LogRecord.js";
|
|
22
|
+
import { processTrace } from "../Util/TraceParent.js";
|
|
14
23
|
/** Logs older than this are pruned (by mtime) on CLI start. */
|
|
15
24
|
const MAX_LOG_AGE = Duration.days(7);
|
|
16
|
-
/**
|
|
25
|
+
/** The `--log-level` / `ALCHEMY_LOG_LEVEL` spellings. */
|
|
17
26
|
const logLevelChoices = {
|
|
18
27
|
all: "All",
|
|
19
28
|
trace: "Trace",
|
|
@@ -26,84 +35,167 @@ const logLevelChoices = {
|
|
|
26
35
|
none: "None",
|
|
27
36
|
};
|
|
28
37
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* terminal (#1231) — the run log captures Debug regardless.
|
|
34
|
-
*
|
|
35
|
-
* Read from argv rather than `GlobalFlag.LogLevel` because the console logger
|
|
36
|
-
* is installed while the service layers are built, before the parser has
|
|
37
|
-
* produced flag values (same reason `--no-input` is an argv scan). Only the
|
|
38
|
-
* segment before a `--` separator is inspected; an unrecognised value falls
|
|
39
|
-
* back to Info and is left for the parser to reject.
|
|
38
|
+
* `--log-level`: the lowest level printed on the console. Registered on the
|
|
39
|
+
* CLI root in place of Effect's built-in flag, which also lowers the
|
|
40
|
+
* minimum log level and so would drop records from the run log; the run
|
|
41
|
+
* log records Debug whatever the console shows.
|
|
40
42
|
*/
|
|
41
|
-
export const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
43
|
+
export const LogLevelFlag = GlobalFlag.Setting("log-level")({
|
|
44
|
+
flag: Flag.ChoiceWithValue("log-level", Object.entries(logLevelChoices)).pipe(Flag.optional, Flag.withDescription("Lowest level printed on the console"), Flag.withMetavar("<all|trace|debug|info|warn|error|fatal|none>")),
|
|
45
|
+
});
|
|
46
|
+
/**
|
|
47
|
+
* `--log-format pretty|json`: `json` prints one {@link LogRecord} per line
|
|
48
|
+
* on stderr and leaves rendering to the reader. Registered on the CLI root;
|
|
49
|
+
* the console logger reads the parsed value (see {@link consoleSettings}).
|
|
50
|
+
*/
|
|
51
|
+
export const LogFormatFlag = GlobalFlag.Setting("log-format")({
|
|
52
|
+
flag: Flag.Literals("log-format", ["pretty", "json"]).pipe(Flag.withDescription("Print log records as text or as JSON lines on stderr"), Flag.optional),
|
|
53
|
+
});
|
|
54
|
+
const flagValue = (context, flag) => Context.getOption(context, flag).pipe(Option.flatten, Option.getOrUndefined);
|
|
55
|
+
/**
|
|
56
|
+
* The console settings in `context`: the parsed `--log-level` and
|
|
57
|
+
* `--log-format` flags inside a command, and otherwise (before the command
|
|
58
|
+
* line is parsed, or in a child process that never sees it) the `ALCHEMY_LOG_*` environment variables. The console keeps its
|
|
59
|
+
* usual Info+ noise floor by default; the run log captures Debug regardless
|
|
60
|
+
* (#1231).
|
|
61
|
+
*/
|
|
62
|
+
export const consoleSettings = (context) => ({
|
|
63
|
+
floor: flagValue(context, LogLevelFlag) ??
|
|
64
|
+
logLevelChoices[process.env[LOG_LEVEL_ENV]?.toLowerCase() ?? ""] ??
|
|
65
|
+
"Info",
|
|
66
|
+
format: (flagValue(context, LogFormatFlag) ?? process.env[LOG_FORMAT_ENV]) === "json"
|
|
67
|
+
? "json"
|
|
68
|
+
: "pretty",
|
|
69
|
+
});
|
|
70
|
+
/** The current fiber's {@link consoleSettings}. */
|
|
71
|
+
export const currentConsoleSettings = Effect.map(Effect.context(), consoleSettings);
|
|
72
|
+
/** {@link ConsoleSettings} as environment, for a child process that renders the run's logs. */
|
|
73
|
+
export const consoleSettingsEnv = (settings) => ({
|
|
74
|
+
[LOG_LEVEL_ENV]: settings.floor,
|
|
75
|
+
[LOG_FORMAT_ENV]: settings.format,
|
|
76
|
+
});
|
|
77
|
+
const jsonSink = jsonLogger((line) => process.stderr.write(`${line}\n`));
|
|
78
|
+
const prettySink = makePlainConsoleSink();
|
|
79
|
+
/**
|
|
80
|
+
* Terminal sink: forwards records at or above the logging fiber's
|
|
81
|
+
* {@link consoleSettings} floor to `sink`, or to the sink its settings
|
|
82
|
+
* select.
|
|
83
|
+
*/
|
|
84
|
+
export const makeConsoleLogger = (sink) => Logger.make((options) => {
|
|
85
|
+
const settings = consoleSettings(options.fiber.context);
|
|
86
|
+
if (LogLevel.isGreaterThanOrEqualTo(options.logLevel, settings.floor)) {
|
|
87
|
+
(sink ?? (settings.format === "json" ? jsonSink : prettySink)).log(options);
|
|
62
88
|
}
|
|
63
89
|
});
|
|
64
90
|
/** Shared terminal logger for CLI entrypoints that do not need a run file. */
|
|
65
|
-
export const ConsoleLogLive = Layer.mergeAll(Logger.layer([makeConsoleLogger(
|
|
91
|
+
export const ConsoleLogLive = Layer.mergeAll(Logger.layer([makeConsoleLogger()]), Layer.succeed(MinimumLogLevel, "Debug"));
|
|
66
92
|
/** Drops everything — the fallback when the log file cannot be opened. */
|
|
67
93
|
const noopLogger = Logger.make(() => { });
|
|
68
94
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* `
|
|
72
|
-
*
|
|
73
|
-
* terminal only shows the friendly message. Console output stays at Info+
|
|
74
|
-
* unless `--log-level` lowers the floor (see {@link consoleLogFloor}).
|
|
75
|
-
*
|
|
76
|
-
* Commands that install their own loggers with `mergeWithExisting: true`
|
|
77
|
-
* compose with this one; a replacing `Logger.layer` scopes it out for that
|
|
78
|
-
* subtree only. Best-effort throughout: an unwritable `~/.alchemy` must
|
|
79
|
-
* never take the CLI down with it.
|
|
95
|
+
* The run log's file logger alone. The run log is the only log file: the
|
|
96
|
+
* top-level CLI process writes it, and records its children already showed
|
|
97
|
+
* on the terminal (the `alchemy dev` exec child's) go here without being
|
|
98
|
+
* printed again.
|
|
80
99
|
*/
|
|
81
|
-
export const
|
|
100
|
+
export const RunLog = Context.Reference("alchemy/Cli/RunLog", {
|
|
101
|
+
defaultValue: () => noopLogger,
|
|
102
|
+
});
|
|
103
|
+
/** Delete run logs in `dir` older than {@link MAX_LOG_AGE}. Best-effort. */
|
|
104
|
+
const pruneRunLogs = (dir) => Effect.gen(function* () {
|
|
82
105
|
const fs = yield* FileSystem.FileSystem;
|
|
83
106
|
const path = yield* Path;
|
|
84
|
-
const dir = path.join(rootDir(), "logs");
|
|
85
|
-
yield* fs.makeDirectory(dir, { recursive: true });
|
|
86
|
-
// Prune stale run logs so the directory stays bounded.
|
|
87
107
|
const now = yield* Clock.currentTimeMillis;
|
|
88
108
|
const entries = yield* fs.readDirectory(dir).pipe(Effect.orElseSucceed(() => []));
|
|
89
|
-
|
|
109
|
+
// Only run logs: the directory may hold other tools' logs (the test
|
|
110
|
+
// runner's `test/`).
|
|
111
|
+
yield* Effect.forEach(entries.filter((entry) => entry.endsWith(".ndjson")), (entry) => Effect.gen(function* () {
|
|
90
112
|
const file = path.join(dir, entry);
|
|
91
|
-
const
|
|
92
|
-
const mtime = Option.getOrUndefined(info.mtime)?.getTime();
|
|
113
|
+
const mtime = Option.getOrUndefined((yield* fs.stat(file)).mtime)?.getTime();
|
|
93
114
|
if (mtime !== undefined && now - mtime > Duration.toMillis(MAX_LOG_AGE)) {
|
|
94
115
|
yield* fs.remove(file);
|
|
95
116
|
}
|
|
96
117
|
}).pipe(Effect.ignore), { discard: true });
|
|
118
|
+
});
|
|
119
|
+
/**
|
|
120
|
+
* A run log file that is created on its first record, so a run that sends
|
|
121
|
+
* nothing to it leaves nothing behind (and a `profile` command run outside
|
|
122
|
+
* a project never creates a `.alchemy` there). The file starts with a `run`
|
|
123
|
+
* record describing the run, so it reads standalone.
|
|
124
|
+
*
|
|
125
|
+
* A logger is called synchronously but the file is written asynchronously,
|
|
126
|
+
* so the logger only queues each record as a JSON line, and one writer fiber
|
|
127
|
+
* creates the file on the first line and appends the rest. Closing the log
|
|
128
|
+
* ends the queue and waits for the writer, so no queued record is lost.
|
|
129
|
+
*
|
|
130
|
+
* @internal exported for tests.
|
|
131
|
+
*/
|
|
132
|
+
export const lazyRunLog = Effect.fn(function* (dir, name, scope) {
|
|
133
|
+
const fs = yield* FileSystem.FileSystem;
|
|
134
|
+
const path = yield* Path;
|
|
135
|
+
const file = path.join(dir, name);
|
|
136
|
+
const lines = yield* Queue.unbounded();
|
|
137
|
+
const append = (batch) => fs.writeFileString(file, batch.map((line) => `${line}\n`).join(""), { flag: "a" });
|
|
138
|
+
const writer = yield* Effect.gen(function* () {
|
|
139
|
+
const first = yield* Queue.take(lines);
|
|
140
|
+
yield* fs.makeDirectory(dir, { recursive: true });
|
|
141
|
+
yield* pruneRunLogs(dir);
|
|
142
|
+
yield* append([safeStringify(yield* runRecord(scope)), first]);
|
|
143
|
+
return yield* Effect.forever(Effect.flatMap(Queue.takeAll(lines), append));
|
|
144
|
+
}).pipe(
|
|
145
|
+
// The queue ending stops the writer. Any other failure (an unwritable
|
|
146
|
+
// directory) drops the log, never the command: a shut-down queue
|
|
147
|
+
// ignores further records.
|
|
148
|
+
Effect.catchCause(() => Queue.shutdown(lines)), Effect.forkDetach);
|
|
149
|
+
yield* Effect.addFinalizer(() => Effect.andThen(Queue.end(lines), Fiber.await(writer)));
|
|
150
|
+
// Formatted now, so a record keeps the annotations it was logged with.
|
|
151
|
+
return Logger.make((logged) => {
|
|
152
|
+
Queue.offerUnsafe(lines, formatJsonRecord.log(logged));
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
/**
|
|
156
|
+
* The two run logs: records scoped `global` (the state store, auth,
|
|
157
|
+
* profiles; see `globalLogs`) go to `~/.alchemy/logs` (relocated by
|
|
158
|
+
* `ALCHEMY_HOME`), everything else to the project's `.alchemy/log`. Every
|
|
159
|
+
* run writes `{timestamp}-pid{pid}.ndjson` (NDJSON log records) at Debug
|
|
160
|
+
* level — failures record their full causes there even though the terminal
|
|
161
|
+
* only shows the friendly message. Console output stays at Info+ unless
|
|
162
|
+
* `--log-level` lowers the floor (see {@link consoleSettings}).
|
|
163
|
+
*
|
|
164
|
+
* Only the top-level CLI process writes them; its children's records reach
|
|
165
|
+
* them through it. Commands that install their own loggers with
|
|
166
|
+
* `mergeWithExisting: true` compose with these; a replacing `Logger.layer`
|
|
167
|
+
* scopes them out for that subtree only.
|
|
168
|
+
*/
|
|
169
|
+
export const GlobalLogLive = Layer.unwrap(Effect.gen(function* () {
|
|
170
|
+
const path = yield* Path;
|
|
97
171
|
const stamp = new Date(yield* Clock.currentTimeMillis)
|
|
98
172
|
.toISOString()
|
|
99
173
|
.slice(0, 19)
|
|
100
174
|
.replaceAll(":", "-");
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
175
|
+
const name = `${stamp}-pid${process.pid}.ndjson`;
|
|
176
|
+
const global = yield* lazyRunLog(path.join(rootDir(), "logs"), name, "global");
|
|
177
|
+
const project = yield* lazyRunLog(path.resolve(yield* dotAlchemyDirectory, "log"), name, "project");
|
|
178
|
+
const runLog = Logger.make((options) => (options.fiber.getRef(CurrentLogAnnotations)[LogAnnotation.scope] === "global"
|
|
179
|
+
? global
|
|
180
|
+
: project).log(options));
|
|
181
|
+
return Layer.mergeAll(
|
|
182
|
+
// Logs stay on this machine: telemetry exports spans and metrics only.
|
|
183
|
+
Logger.layer([makeConsoleLogger(), runLog]), Layer.succeed(RunLog, runLog), Layer.succeed(MinimumLogLevel, "Debug"));
|
|
106
184
|
}).pipe(Effect.orElseSucceed(() => Layer.empty)));
|
|
107
185
|
/** First line of every run log: enough context to read it standalone. */
|
|
108
|
-
|
|
186
|
+
const runRecord = (scope) => Effect.map(Clock.currentTimeMillis, (time) => ({
|
|
187
|
+
time,
|
|
188
|
+
level: "info",
|
|
189
|
+
kind: "run",
|
|
190
|
+
process: "cli",
|
|
191
|
+
scope,
|
|
192
|
+
trace: processTrace,
|
|
193
|
+
attributes: {},
|
|
194
|
+
data: {
|
|
195
|
+
version: packageJson.version,
|
|
196
|
+
pid: process.pid,
|
|
197
|
+
cwd: process.cwd(),
|
|
198
|
+
argv: process.argv.slice(2),
|
|
199
|
+
},
|
|
200
|
+
}));
|
|
109
201
|
//# sourceMappingURL=GlobalLog.js.map
|
package/lib/Cli/GlobalLog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalLog.js","sourceRoot":"","sources":["../../src/Cli/GlobalLog.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GlobalLog.js","sourceRoot":"","sources":["../../src/Cli/GlobalLog.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,cAAc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,IAAI,EAAE;QACJ,OAAO,EAAE,WAAW,CAAC,OAAO;QAC5B,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;KAC5B;CACF,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoggingCli.d.ts","sourceRoot":"","sources":["../../src/Cli/LoggingCli.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAG5C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"LoggingCli.d.ts","sourceRoot":"","sources":["../../src/Cli/LoggingCli.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAG5C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAItC,OAAO,KAAK,EAAmC,IAAI,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,GAAG,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAkF5D,6DAA6D;AAC7D,eAAO,MAAM,eAAe,SAAU,IAAI,YAAW,kBAAkB,KAAQ,MAAM,EA0EpF,CAAC;AAcF,eAAO,MAAM,UAAU,6CA4JtB,CAAC"}
|
package/lib/Cli/LoggingCli.js
CHANGED
|
@@ -7,11 +7,13 @@ import { NonInteractiveTerminal } from "../Interaction.js";
|
|
|
7
7
|
import { Cli } from "../Report.js";
|
|
8
8
|
import { canPromptOnStdin } from "../Util/interactive.js";
|
|
9
9
|
import { formatResourceTag } from "../Util/ResourceOutput.js";
|
|
10
|
-
import { ansiFg, colorsEnabled
|
|
10
|
+
import { ansiFg, colorsEnabled } from "../Util/Terminal.js";
|
|
11
|
+
import { theme } from "../Util/Theme.js";
|
|
11
12
|
import { actionStyle, applyStatusColor, isTerminalStatus as isTerminal, } from "./components/view/statusStyle.js";
|
|
12
13
|
import { formatElapsed } from "./Format.js";
|
|
13
14
|
import { formatModeNote } from "./ModeTag.js";
|
|
14
15
|
import { actionHasPlannedWork, buildPlanSummary } from "./NamespaceTree.js";
|
|
16
|
+
import { present } from "./Present.js";
|
|
15
17
|
import { formatDeclaredPropertyYaml, matchYamlChange, matchYamlKey } from "./PropertyDiff.js";
|
|
16
18
|
const ESC = "\x1b[";
|
|
17
19
|
const RESET = `${ESC}0m`;
|
|
@@ -44,6 +46,8 @@ const statusColor = (status) => {
|
|
|
44
46
|
return hex(color);
|
|
45
47
|
};
|
|
46
48
|
const tag = formatResourceTag;
|
|
49
|
+
/** A progress line about one resource. */
|
|
50
|
+
const logFor = (fqn, message, level) => present(message, { resource: fqn, level });
|
|
47
51
|
/**
|
|
48
52
|
* In-progress statuses that represent real cloud work. Plain output has no
|
|
49
53
|
* spinner, so these lines are the liveness signal in CI logs
|
|
@@ -159,8 +163,8 @@ export const LoggingCli = Layer.effect(Cli, Effect.gen(function* () {
|
|
|
159
163
|
// planning time (the spinner's implicit "how long did that take").
|
|
160
164
|
const startedAt = yield* Clock.currentTimeMillis;
|
|
161
165
|
if (title !== undefined)
|
|
162
|
-
yield*
|
|
163
|
-
yield*
|
|
166
|
+
yield* present(bold(title));
|
|
167
|
+
yield* present(dim(label));
|
|
164
168
|
let closed = false;
|
|
165
169
|
let lastLabel = label;
|
|
166
170
|
const write = (nextLabel, _nextDetail) => Effect.suspend(() => {
|
|
@@ -169,13 +173,13 @@ export const LoggingCli = Layer.effect(Cli, Effect.gen(function* () {
|
|
|
169
173
|
if (closed || nextLabel === lastLabel)
|
|
170
174
|
return Effect.void;
|
|
171
175
|
lastLabel = nextLabel;
|
|
172
|
-
return
|
|
176
|
+
return present(dim(nextLabel));
|
|
173
177
|
});
|
|
174
178
|
const finish = (message, paint) => Effect.suspend(() => {
|
|
175
179
|
if (closed)
|
|
176
180
|
return Effect.void;
|
|
177
181
|
closed = true;
|
|
178
|
-
return Clock.currentTimeMillis.pipe(Effect.flatMap((now) =>
|
|
182
|
+
return Clock.currentTimeMillis.pipe(Effect.flatMap((now) => present(`${paint(message)} ${dim(`(${formatElapsed(now - startedAt)})`)}`)));
|
|
179
183
|
});
|
|
180
184
|
return {
|
|
181
185
|
update: write,
|
|
@@ -188,7 +192,7 @@ export const LoggingCli = Layer.effect(Cli, Effect.gen(function* () {
|
|
|
188
192
|
}),
|
|
189
193
|
approvePlan: (plan, options) => Effect.gen(function* () {
|
|
190
194
|
for (const line of formatPlanLines(plan, options))
|
|
191
|
-
yield*
|
|
195
|
+
yield* present(line);
|
|
192
196
|
if (canPromptOnStdin()) {
|
|
193
197
|
return yield* confirm(plan.destroy === true
|
|
194
198
|
? { message: "Destroy these resources?", initial: false }
|
|
@@ -201,24 +205,24 @@ export const LoggingCli = Layer.effect(Cli, Effect.gen(function* () {
|
|
|
201
205
|
}),
|
|
202
206
|
displayPlan: (plan, options) => Effect.gen(function* () {
|
|
203
207
|
for (const line of formatPlanLines(plan, options))
|
|
204
|
-
yield*
|
|
208
|
+
yield* present(line);
|
|
205
209
|
}),
|
|
206
210
|
startApplySession: (plan, options) => Effect.gen(function* () {
|
|
207
211
|
for (const line of formatPlanLines(plan, options))
|
|
208
|
-
yield*
|
|
209
|
-
yield*
|
|
212
|
+
yield* present(line);
|
|
213
|
+
yield* present("");
|
|
210
214
|
const startedAt = yield* Clock.currentTimeMillis;
|
|
211
215
|
const started = new Map();
|
|
212
216
|
const terminal = new Map();
|
|
213
217
|
const notes = new Map();
|
|
214
218
|
const statusNotes = new Map();
|
|
215
219
|
return {
|
|
216
|
-
setOutput: (value) =>
|
|
217
|
-
//
|
|
218
|
-
//
|
|
219
|
-
//
|
|
220
|
+
setOutput: (value) => present(inspect(value, { colors: false })),
|
|
221
|
+
// Presents the apply events (which are already log records) as
|
|
222
|
+
// lines shaped like log lines, so the plain output reads as one
|
|
223
|
+
// stream.
|
|
220
224
|
emit: (event) => Clock.currentTimeMillis.pipe(Effect.flatMap((now) => Effect.suspend(() => {
|
|
221
|
-
if (event.
|
|
225
|
+
if (event.type === "apply.resource.note") {
|
|
222
226
|
// `status` notes only surface as the settle line's suffix;
|
|
223
227
|
// everything else streams, deduping consecutive repeats.
|
|
224
228
|
if (event.kind === "status") {
|
|
@@ -228,7 +232,7 @@ export const LoggingCli = Layer.effect(Cli, Effect.gen(function* () {
|
|
|
228
232
|
if (notes.get(event.fqn) === event.message)
|
|
229
233
|
return Effect.void;
|
|
230
234
|
notes.set(event.fqn, event.message);
|
|
231
|
-
return
|
|
235
|
+
return logFor(event.fqn, blue(event.message));
|
|
232
236
|
}
|
|
233
237
|
const id = event.fqn;
|
|
234
238
|
const mode = modeSuffix({
|
|
@@ -241,7 +245,7 @@ export const LoggingCli = Layer.effect(Cli, Effect.gen(function* () {
|
|
|
241
245
|
return Effect.void;
|
|
242
246
|
if (!started.has(id))
|
|
243
247
|
started.set(id, now);
|
|
244
|
-
return
|
|
248
|
+
return logFor(id, `${dim(event.status)}${mode}`);
|
|
245
249
|
}
|
|
246
250
|
terminal.set(id, event.status);
|
|
247
251
|
const status = statusColor(event.status)(event.status);
|
|
@@ -254,7 +258,9 @@ export const LoggingCli = Layer.effect(Cli, Effect.gen(function* () {
|
|
|
254
258
|
const msg = message
|
|
255
259
|
? ` ${dim("—")} ${event.status === "fail" ? red(message) : message}`
|
|
256
260
|
: "";
|
|
257
|
-
|
|
261
|
+
// At the level `emit` gives the event, so `--log-level error`
|
|
262
|
+
// still shows a failed resource.
|
|
263
|
+
return logFor(id, `${status}${mode}${msg}${took}`, event.status === "fail" ? "Error" : undefined);
|
|
258
264
|
}))),
|
|
259
265
|
done: (outcome) => Clock.currentTimeMillis.pipe(Effect.flatMap((now) => {
|
|
260
266
|
const statuses = [...terminal.values()];
|
|
@@ -266,7 +272,7 @@ export const LoggingCli = Layer.effect(Cli, Effect.gen(function* () {
|
|
|
266
272
|
parts.push(red(`${failed} failed`));
|
|
267
273
|
if (skipped)
|
|
268
274
|
parts.push(dim(`${skipped} skipped`));
|
|
269
|
-
return
|
|
275
|
+
return present("").pipe(Effect.andThen(present(`${bold(outcome === "success" ? "Done:" : "Failed:")} ${parts.join(dim(", "))} ${dim(`(${formatElapsed(now - startedAt)})`)}`)));
|
|
270
276
|
})),
|
|
271
277
|
};
|
|
272
278
|
}),
|