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/src/Cli/commands/logs.ts
CHANGED
|
@@ -3,8 +3,8 @@ import * as Console from "effect/Console";
|
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import * as Option from "effect/Option";
|
|
5
5
|
import * as Stream from "effect/Stream";
|
|
6
|
-
import * as
|
|
7
|
-
import { paint } from "
|
|
6
|
+
import * as Alchemist from "../../Alchemist/index.ts";
|
|
7
|
+
import { paint } from "../../Util/Terminal.ts";
|
|
8
8
|
import { formatLocalTimestamp, TAIL_COLORS } from "../Format.ts";
|
|
9
9
|
import { config, envFile, parseSince, profile, resolveStage, stage } from "./flags.ts";
|
|
10
10
|
import { instrumentCommand } from "./instrument.ts";
|
|
@@ -59,41 +59,33 @@ const runLogs = Effect.fn(function* ({
|
|
|
59
59
|
.split(",")
|
|
60
60
|
.map((resource) => resource.trim())
|
|
61
61
|
.filter((resource) => resource.length > 0);
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
const stack = yield* Alchemist.importStack(main);
|
|
63
|
+
const options = { stage, profile, envFile: Option.getOrUndefined(envFile) };
|
|
64
|
+
// Colors are assigned as each resource first appears, so the command
|
|
65
|
+
// builds the stack once instead of listing resources up front.
|
|
66
|
+
const colors = new Map<string, (typeof TAIL_COLORS)[number]>();
|
|
67
|
+
const format = (entry: Alchemist.Logs.LogEntry) => {
|
|
68
|
+
const fqn = entry.resource.fqn;
|
|
69
|
+
if (!colors.has(fqn)) colors.set(fqn, TAIL_COLORS[colors.size % TAIL_COLORS.length]!);
|
|
70
|
+
return `${paint(colors.get(fqn)!, `${formatLocalTimestamp(entry.timestamp)} [${fqn}]`)} ${entry.message}`;
|
|
67
71
|
};
|
|
68
|
-
const available = yield* Logs.resources(target);
|
|
69
|
-
const selectedSet = new Set(selected);
|
|
70
|
-
const matching = available.filter(
|
|
71
|
-
(resource) =>
|
|
72
|
-
selectedSet.size === 0 ||
|
|
73
|
-
selectedSet.has(resource.fqn) ||
|
|
74
|
-
selectedSet.has(resource.logicalId),
|
|
75
|
-
);
|
|
76
|
-
const colors = new Map(
|
|
77
|
-
matching.map((resource, index) => [resource.fqn, TAIL_COLORS[index % TAIL_COLORS.length]!]),
|
|
78
|
-
);
|
|
79
|
-
const format = (entry: { resource: { fqn: string }; timestamp: Date; message: string }) =>
|
|
80
|
-
`${paint(colors.get(entry.resource.fqn) ?? "gray", `${formatLocalTimestamp(entry.timestamp)} [${entry.resource.fqn}]`)} ${entry.message}`;
|
|
81
72
|
|
|
82
73
|
if (tail) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
Stream.runForEach((entry) => Console.log(format(entry))),
|
|
74
|
+
// The merged stream ends at once when no selected resource can tail.
|
|
75
|
+
let received = false;
|
|
76
|
+
yield* Alchemist.Logs.tail({ ...options, stack, resources: selected }).pipe(
|
|
77
|
+
Stream.runForEach((entry) => {
|
|
78
|
+
received = true;
|
|
79
|
+
return Console.log(format(entry));
|
|
80
|
+
}),
|
|
91
81
|
);
|
|
82
|
+
if (!received) yield* Console.log("No matching resources support live logs.");
|
|
92
83
|
return;
|
|
93
84
|
}
|
|
94
85
|
|
|
95
|
-
const entries = yield* Logs.entries({
|
|
96
|
-
|
|
86
|
+
const entries = yield* Alchemist.Logs.entries({
|
|
87
|
+
...options,
|
|
88
|
+
stack,
|
|
97
89
|
resources: selected,
|
|
98
90
|
limit,
|
|
99
91
|
since: sinceDate,
|
package/src/Cli/commands/nuke.ts
CHANGED
|
@@ -4,8 +4,8 @@ import * as Console from "effect/Console";
|
|
|
4
4
|
import * as Duration from "effect/Duration";
|
|
5
5
|
import * as Effect from "effect/Effect";
|
|
6
6
|
import * as Option from "effect/Option";
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
7
|
+
import * as Alchemist from "../../Alchemist/index.ts";
|
|
8
|
+
import * as Interaction from "../../Interaction.ts";
|
|
9
9
|
import { renderNukeScan, renderNukeDelete, reviewNuke } from "../components/view/Nuke.tsx";
|
|
10
10
|
import { formatElapsed } from "../Format.ts";
|
|
11
11
|
import { exitDeclined, UserInputError } from "./errors.ts";
|
|
@@ -58,12 +58,13 @@ const dryRunFlag = Flag.Boolean("dry-run").pipe(
|
|
|
58
58
|
const compileFilter = (expression: string) =>
|
|
59
59
|
Effect.try({
|
|
60
60
|
try: () =>
|
|
61
|
+
// oxlint-disable-next-line typescript/no-implied-eval -- --filter is a user-supplied JS expression by design
|
|
61
62
|
new Function("scope", `with (scope) { return (${expression}); }`) as (scope: {
|
|
62
63
|
resource: Record<string, unknown>;
|
|
63
64
|
}) => unknown,
|
|
64
65
|
catch: (cause) =>
|
|
65
66
|
new UserInputError({
|
|
66
|
-
message: `--filter expression ${JSON.stringify(expression)} failed to compile: ${cause}`,
|
|
67
|
+
message: `--filter expression ${JSON.stringify(expression)} failed to compile: ${cause instanceof Error ? cause.message : String(cause)}`,
|
|
67
68
|
}),
|
|
68
69
|
}).pipe(
|
|
69
70
|
Effect.map(
|
|
@@ -72,7 +73,7 @@ const compileFilter = (expression: string) =>
|
|
|
72
73
|
try: () => Boolean(predicate({ resource })),
|
|
73
74
|
catch: (cause) =>
|
|
74
75
|
new UserInputError({
|
|
75
|
-
message: `--filter expression ${JSON.stringify(expression)} threw while evaluating a resource: ${cause}`,
|
|
76
|
+
message: `--filter expression ${JSON.stringify(expression)} threw while evaluating a resource: ${cause instanceof Error ? cause.message : String(cause)}`,
|
|
76
77
|
}),
|
|
77
78
|
}),
|
|
78
79
|
),
|
|
@@ -104,16 +105,18 @@ const nukeCommand = Command.make(
|
|
|
104
105
|
"alchemy.main": args.main,
|
|
105
106
|
}))(
|
|
106
107
|
Effect.fn(function* (args) {
|
|
107
|
-
const scan = yield*
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
108
|
+
const scan = yield* Effect.flatMap(Alchemist.importStack(args.main), (stack) =>
|
|
109
|
+
Alchemist.Nuke.scan({
|
|
110
|
+
stack,
|
|
111
|
+
profile: args.profile,
|
|
112
|
+
envFile: Option.getOrUndefined(args.envFile),
|
|
113
|
+
dev: args.local,
|
|
114
|
+
include: args.include,
|
|
115
|
+
exclude: args.exclude,
|
|
116
|
+
concurrency: args.concurrency,
|
|
117
|
+
providerTimeoutSeconds: Duration.toSeconds(args.timeout),
|
|
118
|
+
}),
|
|
119
|
+
).pipe(renderNukeScan());
|
|
117
120
|
const predicates = yield* Effect.forEach(args.filter, compileFilter);
|
|
118
121
|
const targets: Array<(typeof scan.resources)[number]> = [];
|
|
119
122
|
for (const resource of scan.resources) {
|
|
@@ -127,7 +130,7 @@ const nukeCommand = Command.make(
|
|
|
127
130
|
if (!matches.some(Boolean)) targets.push(resource);
|
|
128
131
|
}
|
|
129
132
|
if (targets.length === 0) {
|
|
130
|
-
yield*
|
|
133
|
+
yield* Interaction.info("Nothing to delete.");
|
|
131
134
|
return;
|
|
132
135
|
}
|
|
133
136
|
const approved = yield* reviewNuke(targets, {
|
|
@@ -136,7 +139,7 @@ const nukeCommand = Command.make(
|
|
|
136
139
|
dryRun: args.dryRun,
|
|
137
140
|
});
|
|
138
141
|
if (!approved) {
|
|
139
|
-
yield*
|
|
142
|
+
yield* Interaction.info("Aborted.");
|
|
140
143
|
return yield* exitDeclined;
|
|
141
144
|
}
|
|
142
145
|
if (args.dryRun) {
|
|
@@ -144,28 +147,24 @@ const nukeCommand = Command.make(
|
|
|
144
147
|
return;
|
|
145
148
|
}
|
|
146
149
|
const deleteStartedAt = yield* Clock.currentTimeMillis;
|
|
147
|
-
const result = yield* Nuke.execute({
|
|
150
|
+
const result = yield* Alchemist.Nuke.execute({
|
|
148
151
|
scan,
|
|
149
152
|
resources: targets,
|
|
150
153
|
strategy: args.independent
|
|
151
|
-
? {
|
|
152
|
-
: {
|
|
154
|
+
? { type: "independent", retries: args.retries }
|
|
155
|
+
: { type: "coordinated" },
|
|
153
156
|
concurrency: args.concurrency,
|
|
154
157
|
providerTimeoutSeconds: Duration.toSeconds(args.timeout),
|
|
155
158
|
}).pipe(renderNukeDelete(targets, scan.mode));
|
|
156
159
|
const deleteElapsed = (yield* Clock.currentTimeMillis) - deleteStartedAt;
|
|
157
|
-
yield*
|
|
160
|
+
yield* Interaction.success(
|
|
158
161
|
`Deleted ${result.deleted.length} resource(s) over ${result.passes} pass(es) (${formatElapsed(deleteElapsed)}).`,
|
|
159
162
|
);
|
|
160
163
|
if (result.held.length > 0) {
|
|
161
|
-
yield*
|
|
162
|
-
`${result.held.length} resource(s) were held back.`,
|
|
163
|
-
);
|
|
164
|
+
yield* Interaction.warning(`${result.held.length} resource(s) were held back.`);
|
|
164
165
|
}
|
|
165
166
|
if (result.failed.length > 0) {
|
|
166
|
-
yield*
|
|
167
|
-
`${result.failed.length} resource(s) could not be deleted.`,
|
|
168
|
-
);
|
|
167
|
+
yield* Interaction.error(`${result.failed.length} resource(s) could not be deleted.`);
|
|
169
168
|
}
|
|
170
169
|
}),
|
|
171
170
|
),
|
|
@@ -5,13 +5,13 @@ import * as Clock from "effect/Clock";
|
|
|
5
5
|
import * as ConfigProvider from "effect/ConfigProvider";
|
|
6
6
|
import * as Console from "effect/Console";
|
|
7
7
|
import * as Effect from "effect/Effect";
|
|
8
|
+
import * as Match from "effect/Match";
|
|
8
9
|
import * as Option from "effect/Option";
|
|
9
10
|
import * as Redacted from "effect/Redacted";
|
|
10
|
-
import
|
|
11
|
-
import * as Profiles from "../../../Alchemist/routes/profile.ts";
|
|
11
|
+
import * as Alchemist from "../../../Alchemist/index.ts";
|
|
12
12
|
import { getEnv } from "../../../Auth/Env.ts";
|
|
13
13
|
import { resolveProfileName } from "../../../Auth/Resolve.ts";
|
|
14
|
-
import * as
|
|
14
|
+
import * as Interaction from "../../../Interaction.ts";
|
|
15
15
|
import { loadConfigProvider } from "../../../Util/ConfigProvider.ts";
|
|
16
16
|
import { formatElapsed } from "../../Format.ts";
|
|
17
17
|
import { exitDeclined, failWithHelp, UserInputError } from "../errors.ts";
|
|
@@ -64,8 +64,8 @@ const listCommand = Command.make(
|
|
|
64
64
|
{ envFile },
|
|
65
65
|
instrumentCommand("profile.list")(
|
|
66
66
|
Effect.fn(function* () {
|
|
67
|
-
const entries = yield*
|
|
68
|
-
const cli = yield*
|
|
67
|
+
const entries = yield* Alchemist.Profile.list();
|
|
68
|
+
const cli = yield* Interaction.Interaction;
|
|
69
69
|
if (cli.terminal.input) {
|
|
70
70
|
const { profileListNode } = yield* profileTui;
|
|
71
71
|
yield* cli.output.print(profileListNode(entries));
|
|
@@ -93,8 +93,8 @@ const createCommand = Command.make(
|
|
|
93
93
|
"alchemy.profile": a.name,
|
|
94
94
|
}))(
|
|
95
95
|
Effect.fn(function* ({ name }) {
|
|
96
|
-
yield*
|
|
97
|
-
yield*
|
|
96
|
+
yield* Alchemist.Profile.create({ name });
|
|
97
|
+
yield* Interaction.success(
|
|
98
98
|
`Created profile '${name}'. Run \`alchemy profile edit --profile ${name}\` to connect accounts.`,
|
|
99
99
|
);
|
|
100
100
|
}),
|
|
@@ -110,13 +110,11 @@ const renameCommand = Command.make(
|
|
|
110
110
|
}))(
|
|
111
111
|
Effect.fn(function* ({ name, newName }) {
|
|
112
112
|
if (Option.isSome(newName)) {
|
|
113
|
-
yield*
|
|
113
|
+
yield* Alchemist.Profile.rename({
|
|
114
114
|
name,
|
|
115
115
|
newName: newName.value.trim(),
|
|
116
116
|
});
|
|
117
|
-
yield*
|
|
118
|
-
`Renamed profile '${name}' to '${newName.value.trim()}'.`,
|
|
119
|
-
);
|
|
117
|
+
yield* Interaction.success(`Renamed profile '${name}' to '${newName.value.trim()}'.`);
|
|
120
118
|
return;
|
|
121
119
|
}
|
|
122
120
|
yield* renameProfileFlow(name, undefined);
|
|
@@ -196,7 +194,7 @@ const resolveSetValues = Effect.fn(function* (
|
|
|
196
194
|
try: () => readFileSync(0, "utf8").trim(),
|
|
197
195
|
catch: (cause) =>
|
|
198
196
|
new UserInputError({
|
|
199
|
-
message: `Could not read stdin for --set ${key}=-: ${cause}`,
|
|
197
|
+
message: `Could not read stdin for --set ${key}=-: ${cause instanceof Error ? cause.message : String(cause)}`,
|
|
200
198
|
}),
|
|
201
199
|
});
|
|
202
200
|
} else if (raw.startsWith("env:")) {
|
|
@@ -261,7 +259,7 @@ const editCommand = Command.make(
|
|
|
261
259
|
}
|
|
262
260
|
if (configureInput !== undefined) {
|
|
263
261
|
const provider = (add[0] ?? reconfigure[0])!;
|
|
264
|
-
yield*
|
|
262
|
+
yield* Alchemist.Profile.configure({
|
|
265
263
|
profile: selectedProfile,
|
|
266
264
|
provider,
|
|
267
265
|
entrypoint: main,
|
|
@@ -275,22 +273,20 @@ const editCommand = Command.make(
|
|
|
275
273
|
]),
|
|
276
274
|
),
|
|
277
275
|
});
|
|
278
|
-
yield*
|
|
276
|
+
yield* Interaction.success(
|
|
279
277
|
`${add.length === 1 ? "Added" : "Updated"} '${provider}' in profile '${selectedProfile}'.`,
|
|
280
278
|
);
|
|
281
279
|
return;
|
|
282
280
|
}
|
|
283
281
|
if (add.length === 0 && reconfigure.length === 0 && remove.length > 0) {
|
|
284
282
|
for (const provider of remove) {
|
|
285
|
-
yield*
|
|
283
|
+
yield* Alchemist.Profile.removeProvider({
|
|
286
284
|
profile: selectedProfile,
|
|
287
285
|
provider,
|
|
288
286
|
entrypoint: main,
|
|
289
287
|
envFile: Option.getOrUndefined(envFile),
|
|
290
288
|
});
|
|
291
|
-
yield*
|
|
292
|
-
`Removed '${provider}' from profile '${selectedProfile}'.`,
|
|
293
|
-
);
|
|
289
|
+
yield* Interaction.success(`Removed '${provider}' from profile '${selectedProfile}'.`);
|
|
294
290
|
}
|
|
295
291
|
return;
|
|
296
292
|
}
|
|
@@ -325,31 +321,35 @@ const refreshCommand = Command.make(
|
|
|
325
321
|
Effect.fn(function* ({ profile, providers, envFile, main }) {
|
|
326
322
|
const selectedProfile = yield* resolveProfileName(envFile, profile);
|
|
327
323
|
const refreshStarted = new Map<string, number>();
|
|
328
|
-
yield*
|
|
324
|
+
yield* Alchemist.Profile.refresh({
|
|
329
325
|
profile: selectedProfile,
|
|
330
326
|
providers,
|
|
331
327
|
entrypoint: main,
|
|
332
328
|
envFile: Option.getOrUndefined(envFile),
|
|
333
329
|
}).pipe(
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
330
|
+
Alchemist.onEvent(
|
|
331
|
+
Match.type<Alchemist.Event>().pipe(
|
|
332
|
+
Match.discriminators("type")({
|
|
333
|
+
"provider.refresh.started": (event) =>
|
|
334
|
+
Clock.currentTimeMillis.pipe(
|
|
335
|
+
Effect.tap((now) => Effect.sync(() => refreshStarted.set(event.provider, now))),
|
|
336
|
+
Effect.andThen(Interaction.info(`Refreshing ${event.provider}`)),
|
|
337
|
+
),
|
|
338
|
+
"provider.refresh.completed": (event) =>
|
|
339
|
+
Clock.currentTimeMillis.pipe(
|
|
342
340
|
Effect.flatMap((now) => {
|
|
343
341
|
const from = refreshStarted.get(event.provider);
|
|
344
|
-
return
|
|
342
|
+
return Interaction.success(
|
|
345
343
|
`Refreshed ${event.provider}${from === undefined ? "" : ` (${formatElapsed(now - from)})`}`,
|
|
346
344
|
);
|
|
347
345
|
}),
|
|
348
|
-
)
|
|
349
|
-
|
|
346
|
+
),
|
|
347
|
+
}),
|
|
348
|
+
Match.orElse(() => Effect.void),
|
|
349
|
+
),
|
|
350
350
|
),
|
|
351
351
|
);
|
|
352
|
-
yield*
|
|
352
|
+
yield* Interaction.success(`Refreshed profile '${selectedProfile}'.`);
|
|
353
353
|
}),
|
|
354
354
|
),
|
|
355
355
|
).pipe(
|
|
@@ -361,14 +361,14 @@ const currentCommand = Command.make(
|
|
|
361
361
|
{ envFile },
|
|
362
362
|
instrumentCommand("profile.current")(
|
|
363
363
|
Effect.fn(function* () {
|
|
364
|
-
const selected = yield*
|
|
364
|
+
const selected = yield* Alchemist.Profile.current();
|
|
365
365
|
const source =
|
|
366
366
|
selected.source === "configuration"
|
|
367
367
|
? "ALCHEMY_PROFILE"
|
|
368
368
|
: selected.source === "default"
|
|
369
369
|
? "built-in default"
|
|
370
370
|
: "command line";
|
|
371
|
-
const cli = yield*
|
|
371
|
+
const cli = yield* Interaction.Interaction;
|
|
372
372
|
if (cli.terminal.input) {
|
|
373
373
|
const { currentProfileNode } = yield* profileTui;
|
|
374
374
|
yield* cli.output.print(currentProfileNode(selected.name, source));
|
|
@@ -401,7 +401,7 @@ export const profileCommand = Command.make(
|
|
|
401
401
|
{ envFile, main: config },
|
|
402
402
|
instrumentCommand("profile")(
|
|
403
403
|
Effect.fn(function* ({ envFile, main }) {
|
|
404
|
-
if (!(yield*
|
|
404
|
+
if (!(yield* Interaction.Interaction).terminal.input) {
|
|
405
405
|
// No terminal to drive the hub — show the subcommand help instead,
|
|
406
406
|
// which documents the flag-driven equivalents of every hub action.
|
|
407
407
|
return yield* failWithHelp(["alchemy", "profile"]);
|
|
@@ -2,8 +2,9 @@ import * as Console from "effect/Console";
|
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Option from "effect/Option";
|
|
4
4
|
import * as Redacted from "effect/Redacted";
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
5
|
+
import * as Alchemist from "../../../Alchemist/index.ts";
|
|
6
|
+
import * as Interaction from "../../../Interaction.ts";
|
|
7
|
+
import { glyphsFor } from "../../../Util/Theme.ts";
|
|
7
8
|
import { confirmOrDecline } from "../confirm.ts";
|
|
8
9
|
import { isPromptCancellation } from "../errors.ts";
|
|
9
10
|
|
|
@@ -22,7 +23,7 @@ export const showProfileFlow = Effect.fn(function* (options: {
|
|
|
22
23
|
envFile: Option.Option<string>;
|
|
23
24
|
main: string;
|
|
24
25
|
}) {
|
|
25
|
-
const profile = yield*
|
|
26
|
+
const profile = yield* Alchemist.Profile.get({
|
|
26
27
|
name: options.profileName,
|
|
27
28
|
includeProviderStatus: true,
|
|
28
29
|
entrypoint: options.main,
|
|
@@ -48,14 +49,14 @@ export const renameProfileFlow = Effect.fn(function* (
|
|
|
48
49
|
) {
|
|
49
50
|
const newName = (
|
|
50
51
|
suppliedNewName ??
|
|
51
|
-
(yield*
|
|
52
|
+
(yield* Interaction.text({
|
|
52
53
|
message: `Rename profile '${name}' to`,
|
|
53
54
|
placeholder: `${name}-new`,
|
|
54
55
|
validate: (value) => (value.trim().length > 0 ? undefined : "Profile name is required"),
|
|
55
56
|
}))
|
|
56
57
|
).trim();
|
|
57
|
-
yield*
|
|
58
|
-
yield*
|
|
58
|
+
yield* Alchemist.Profile.rename({ name, newName });
|
|
59
|
+
yield* Interaction.success(`Renamed profile '${name}' to '${newName}'.`);
|
|
59
60
|
return newName;
|
|
60
61
|
});
|
|
61
62
|
|
|
@@ -67,7 +68,7 @@ export const deleteProfileFlow = Effect.fn(function* (options: {
|
|
|
67
68
|
}) {
|
|
68
69
|
// Existence check only — skip the provider-status probe (it imports the
|
|
69
70
|
// stack entrypoint and reaches provider APIs).
|
|
70
|
-
const exists = yield*
|
|
71
|
+
const exists = yield* Alchemist.Profile.get({
|
|
71
72
|
name: options.name,
|
|
72
73
|
includeProviderStatus: false,
|
|
73
74
|
}).pipe(Effect.option);
|
|
@@ -83,8 +84,8 @@ export const deleteProfileFlow = Effect.fn(function* (options: {
|
|
|
83
84
|
confirmLabel: "Delete",
|
|
84
85
|
cancelLabel: "Cancel",
|
|
85
86
|
});
|
|
86
|
-
yield*
|
|
87
|
-
yield*
|
|
87
|
+
yield* Alchemist.Profile.deleteProfile({ name: options.name });
|
|
88
|
+
yield* Interaction.success(`Deleted profile '${options.name}' and its credentials.`);
|
|
88
89
|
return true;
|
|
89
90
|
});
|
|
90
91
|
|
|
@@ -115,20 +116,23 @@ export const editProfileFlow = Effect.fn(function* (options: {
|
|
|
115
116
|
if (plan.length === 0) {
|
|
116
117
|
// Only connected names/methods are needed for the cycle prompt; the
|
|
117
118
|
// status probe would import the entrypoint and reach provider APIs.
|
|
118
|
-
const profile = yield*
|
|
119
|
+
const profile = yield* Alchemist.Profile.get({
|
|
119
120
|
name: options.selectedProfile,
|
|
120
121
|
includeProviderStatus: false,
|
|
121
122
|
});
|
|
122
|
-
const available = yield*
|
|
123
|
+
const available = yield* Alchemist.Profile.providers({
|
|
123
124
|
profile: options.selectedProfile,
|
|
124
125
|
entrypoint: options.main,
|
|
125
126
|
envFile: Option.getOrUndefined(options.envFile),
|
|
126
127
|
});
|
|
127
128
|
const connected = new Map(profile.providers.map((item) => [item.name, item]));
|
|
128
129
|
const names = [...new Set([...connected.keys(), ...available.map(({ name }) => name)])].sort();
|
|
129
|
-
const prompt = yield*
|
|
130
|
+
const prompt = yield* Interaction.Interaction;
|
|
130
131
|
const { editStateStyle } = yield* profileTui;
|
|
131
|
-
const
|
|
132
|
+
const { cycleSelectScreen } = yield* Effect.promise(
|
|
133
|
+
() => import("../../../Cli/components/view/Prompts.tsx"),
|
|
134
|
+
);
|
|
135
|
+
const glyphs = glyphsFor(prompt.terminal.unicode);
|
|
132
136
|
const state = (
|
|
133
137
|
key: keyof typeof editStateStyle,
|
|
134
138
|
value: { provider: string; action: EditAction } | null,
|
|
@@ -154,24 +158,26 @@ export const editProfileFlow = Effect.fn(function* (options: {
|
|
|
154
158
|
states: [state("skip", null), state("add", { provider, action: "add" })],
|
|
155
159
|
},
|
|
156
160
|
);
|
|
157
|
-
plan = (yield* prompt.prompt.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
161
|
+
plan = (yield* prompt.prompt.screen(
|
|
162
|
+
cycleSelectScreen({
|
|
163
|
+
message: `Manage accounts in profile '${options.selectedProfile}'`,
|
|
164
|
+
options: choices,
|
|
165
|
+
requireChange: true,
|
|
166
|
+
}),
|
|
167
|
+
)).filter((item) => item !== null);
|
|
162
168
|
}
|
|
163
169
|
|
|
164
170
|
const outcomes: EditOutcome[] = [];
|
|
165
171
|
for (const step of plan) {
|
|
166
172
|
const run =
|
|
167
173
|
step.action === "remove"
|
|
168
|
-
?
|
|
174
|
+
? Alchemist.Profile.removeProvider({
|
|
169
175
|
profile: options.selectedProfile,
|
|
170
176
|
provider: step.provider,
|
|
171
177
|
entrypoint: options.main,
|
|
172
178
|
envFile: Option.getOrUndefined(options.envFile),
|
|
173
179
|
})
|
|
174
|
-
:
|
|
180
|
+
: Alchemist.Profile.configure({
|
|
175
181
|
profile: options.selectedProfile,
|
|
176
182
|
provider: step.provider,
|
|
177
183
|
entrypoint: options.main,
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import * as Effect from "effect/Effect";
|
|
2
2
|
import * as Option from "effect/Option";
|
|
3
3
|
import * as Ref from "effect/Ref";
|
|
4
|
-
import
|
|
5
|
-
import * as Profiles from "../../../Alchemist/routes/profile.ts";
|
|
6
|
-
import { importStack } from "../../../Alchemist/Session.ts";
|
|
4
|
+
import * as Alchemist from "../../../Alchemist/index.ts";
|
|
7
5
|
import { DEFAULT_PROFILE_NAME } from "../../../Auth/Profile.ts";
|
|
8
|
-
import {
|
|
6
|
+
import { Interaction } from "../../../Interaction.ts";
|
|
9
7
|
import { isPromptCancellation } from "../errors.ts";
|
|
10
8
|
|
|
11
9
|
export const profileHub = Effect.fn(function* (options: {
|
|
@@ -13,7 +11,7 @@ export const profileHub = Effect.fn(function* (options: {
|
|
|
13
11
|
main: string;
|
|
14
12
|
}) {
|
|
15
13
|
const envFile = Option.getOrUndefined(options.envFile);
|
|
16
|
-
const computeEntries =
|
|
14
|
+
const computeEntries = Alchemist.Profile.list().pipe(
|
|
17
15
|
Effect.map((profiles) =>
|
|
18
16
|
profiles.map((profile) => ({
|
|
19
17
|
name: profile.name,
|
|
@@ -36,16 +34,16 @@ export const profileHub = Effect.fn(function* (options: {
|
|
|
36
34
|
// the credential spinner mid-frame. Like deploy's planning session, show a
|
|
37
35
|
// static (non-spinning) row that makes no motion promise. Failures are
|
|
38
36
|
// ignored here — `loadDetails` re-imports from the cache and surfaces them.
|
|
39
|
-
const cli = yield*
|
|
37
|
+
const cli = yield* Interaction;
|
|
40
38
|
yield* Effect.scoped(
|
|
41
39
|
Effect.gen(function* () {
|
|
42
|
-
yield* cli.
|
|
40
|
+
yield* cli.progress({
|
|
43
41
|
label: "Importing stack module",
|
|
44
42
|
spinning: false,
|
|
45
43
|
});
|
|
46
44
|
// let the row paint before synchronous module evaluation starts
|
|
47
45
|
yield* Effect.sleep("1 millis");
|
|
48
|
-
yield* importStack(options.main).pipe(Effect.ignore);
|
|
46
|
+
yield* Alchemist.importStack(options.main).pipe(Effect.ignore);
|
|
49
47
|
}),
|
|
50
48
|
);
|
|
51
49
|
|
|
@@ -55,13 +53,13 @@ export const profileHub = Effect.fn(function* (options: {
|
|
|
55
53
|
loadDetails: (name) =>
|
|
56
54
|
Effect.gen(function* () {
|
|
57
55
|
const [profile, providers] = yield* Effect.all([
|
|
58
|
-
|
|
56
|
+
Alchemist.Profile.get({
|
|
59
57
|
name,
|
|
60
58
|
includeProviderStatus: true,
|
|
61
59
|
entrypoint: options.main,
|
|
62
60
|
envFile,
|
|
63
61
|
}),
|
|
64
|
-
|
|
62
|
+
Alchemist.Profile.providers({
|
|
65
63
|
profile: name,
|
|
66
64
|
entrypoint: options.main,
|
|
67
65
|
envFile,
|
|
@@ -92,18 +90,18 @@ export const profileHub = Effect.fn(function* (options: {
|
|
|
92
90
|
let selected: string | undefined;
|
|
93
91
|
let message: string;
|
|
94
92
|
if (action.kind === "create") {
|
|
95
|
-
yield*
|
|
93
|
+
yield* Alchemist.Profile.create({ name: action.name });
|
|
96
94
|
selected = action.name;
|
|
97
95
|
message = `Created profile '${action.name}'.`;
|
|
98
96
|
} else if (action.kind === "rename") {
|
|
99
|
-
yield*
|
|
97
|
+
yield* Alchemist.Profile.rename({
|
|
100
98
|
name: action.name,
|
|
101
99
|
newName: action.newName,
|
|
102
100
|
});
|
|
103
101
|
selected = action.newName;
|
|
104
102
|
message = `Renamed '${action.name}' to '${action.newName}'.`;
|
|
105
103
|
} else {
|
|
106
|
-
yield*
|
|
104
|
+
yield* Alchemist.Profile.deleteProfile({ name: action.name });
|
|
107
105
|
message = `Deleted '${action.name}' and its credentials.`;
|
|
108
106
|
}
|
|
109
107
|
const entries = yield* refreshEntries;
|
|
@@ -120,14 +118,14 @@ export const profileHub = Effect.fn(function* (options: {
|
|
|
120
118
|
runFlow: (action, events) =>
|
|
121
119
|
Effect.gen(function* () {
|
|
122
120
|
if (action.kind === "refresh") {
|
|
123
|
-
yield*
|
|
121
|
+
yield* Alchemist.Profile.refresh({
|
|
124
122
|
profile: action.name,
|
|
125
123
|
providers: action.provider === undefined ? undefined : [action.provider],
|
|
126
124
|
entrypoint: options.main,
|
|
127
125
|
envFile,
|
|
128
126
|
}).pipe(
|
|
129
|
-
|
|
130
|
-
event.
|
|
127
|
+
Alchemist.onEvent((event) =>
|
|
128
|
+
event.type === "provider.refresh.started"
|
|
131
129
|
? events.onProviderStart(event.provider)
|
|
132
130
|
: Effect.void,
|
|
133
131
|
),
|
|
@@ -143,7 +141,7 @@ export const profileHub = Effect.fn(function* (options: {
|
|
|
143
141
|
|
|
144
142
|
const outcomes: string[] = [];
|
|
145
143
|
for (const provider of action.remove) {
|
|
146
|
-
yield*
|
|
144
|
+
yield* Alchemist.Profile.removeProvider({
|
|
147
145
|
profile: action.name,
|
|
148
146
|
provider,
|
|
149
147
|
entrypoint: options.main,
|
|
@@ -156,7 +154,7 @@ export const profileHub = Effect.fn(function* (options: {
|
|
|
156
154
|
["reconfigure", action.reconfigure],
|
|
157
155
|
] as const) {
|
|
158
156
|
for (const provider of names) {
|
|
159
|
-
yield*
|
|
157
|
+
yield* Alchemist.Profile.configure({
|
|
160
158
|
profile: action.name,
|
|
161
159
|
provider,
|
|
162
160
|
entrypoint: options.main,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Command, Flag } from "effect/cli";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Option from "effect/Option";
|
|
4
|
-
import * as
|
|
4
|
+
import * as Alchemist from "../../Alchemist/index.ts";
|
|
5
5
|
import * as Contributions from "../../Contributions.ts";
|
|
6
|
-
import {
|
|
6
|
+
import { Interaction } from "../../Interaction.ts";
|
|
7
7
|
import { setExitCode } from "./errors.ts";
|
|
8
8
|
import { config, envFile, profile } from "./flags.ts";
|
|
9
9
|
import { instrumentCommand } from "./instrument.ts";
|
|
@@ -21,8 +21,8 @@ const checkEnvCommand = Command.make(
|
|
|
21
21
|
{ provider: checkedProviders, main: config, envFile, profile },
|
|
22
22
|
instrumentCommand("provider.check-env")(
|
|
23
23
|
Effect.fn(function* ({ provider: requested, main, envFile, profile }) {
|
|
24
|
-
const cli = yield*
|
|
25
|
-
const result = yield* Provider.checkEnvironment({
|
|
24
|
+
const cli = yield* Interaction;
|
|
25
|
+
const result = yield* Alchemist.Provider.checkEnvironment({
|
|
26
26
|
entrypoint: main,
|
|
27
27
|
envFile: Option.getOrUndefined(envFile),
|
|
28
28
|
profile,
|