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
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import * as Cause from "effect/Cause";
|
|
2
1
|
import * as Effect from "effect/Effect";
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import type { Plan } from "../../Plan.ts";
|
|
2
|
+
import * as Match from "effect/Match";
|
|
3
|
+
import * as Alchemist from "../../Alchemist/index.ts";
|
|
4
|
+
import type { Event, PlanningPhase } from "../../Events.ts";
|
|
5
|
+
import { Interaction } from "../../Interaction.ts";
|
|
8
6
|
import * as Report from "../../Report.ts";
|
|
9
|
-
import {
|
|
7
|
+
import { isPromptCancellation } from "./errors.ts";
|
|
10
8
|
|
|
11
9
|
export const renderPlanning =
|
|
12
10
|
(options: { operation: string; stage: string; computingLabel?: string; readyLabel?: string }) =>
|
|
13
11
|
<A, E, R>(effect: Effect.Effect<A, E, R>) =>
|
|
14
12
|
Effect.gen(function* () {
|
|
15
|
-
const phaseLabel: Record<
|
|
13
|
+
const phaseLabel: Record<PlanningPhase, string> = {
|
|
16
14
|
"importing-module": "Importing stack module",
|
|
17
15
|
"resolving-services": "Resolving stack services",
|
|
18
16
|
"loading-state": "Loading stack state",
|
|
@@ -25,7 +23,7 @@ export const renderPlanning =
|
|
|
25
23
|
options.stage,
|
|
26
24
|
`${options.operation} · ${options.stage}`,
|
|
27
25
|
);
|
|
28
|
-
const interactive = (yield*
|
|
26
|
+
const interactive = (yield* Interaction).terminal.input;
|
|
29
27
|
const inFlight = new Set<string>();
|
|
30
28
|
let done = 0;
|
|
31
29
|
let total = 0;
|
|
@@ -38,70 +36,44 @@ export const renderPlanning =
|
|
|
38
36
|
`${done}/${total} · ${current}${rest}`,
|
|
39
37
|
);
|
|
40
38
|
});
|
|
39
|
+
const completed = (event: { fqn: string; completed: number; total: number }) => {
|
|
40
|
+
if (!interactive) return Effect.void;
|
|
41
|
+
inFlight.delete(event.fqn);
|
|
42
|
+
done = event.completed;
|
|
43
|
+
total = event.total;
|
|
44
|
+
return showCounter(event.fqn);
|
|
45
|
+
};
|
|
41
46
|
return yield* effect.pipe(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
default:
|
|
67
|
-
return Effect.void;
|
|
68
|
-
}
|
|
69
|
-
}),
|
|
70
|
-
Effect.tapError(() => planning.fail("Planning failed")),
|
|
71
|
-
Effect.ensuring(planning.close),
|
|
72
|
-
);
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
export const renderApply =
|
|
76
|
-
(plan: Plan, options?: Report.PlanDisplayOptions) =>
|
|
77
|
-
<A, E, R>(effect: Effect.Effect<A, E, R>) =>
|
|
78
|
-
Effect.gen(function* () {
|
|
79
|
-
const cli = yield* Report.Cli;
|
|
80
|
-
const session = yield* cli.startApplySession(plan, options);
|
|
81
|
-
// Dev keeps the widget mounted after apply settles and parks in the
|
|
82
|
-
// ambient scope; bind the widget's teardown to that scope so a reload
|
|
83
|
-
// or Ctrl+C removes it instead of stacking it under the next one.
|
|
84
|
-
if (options?.dev && session.close !== undefined) {
|
|
85
|
-
const scope = yield* Effect.serviceOption(Scope.Scope);
|
|
86
|
-
if (Option.isSome(scope)) {
|
|
87
|
-
yield* Scope.addFinalizer(scope.value, session.close);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return yield* effect.pipe(
|
|
91
|
-
Effect.provideService(Progress, (event) =>
|
|
92
|
-
event._tag === "apply.resource.status" || event._tag === "apply.resource.note"
|
|
93
|
-
? session.emit(event)
|
|
94
|
-
: Effect.void,
|
|
47
|
+
Alchemist.onEvent(
|
|
48
|
+
Match.type<Event>().pipe(
|
|
49
|
+
Match.discriminators("type")({
|
|
50
|
+
"plan.phase": (event) =>
|
|
51
|
+
event.phase === "plan-ready"
|
|
52
|
+
? planning.succeed(phaseLabel["plan-ready"])
|
|
53
|
+
: planning.update(phaseLabel[event.phase], options.stage, {
|
|
54
|
+
spinning: event.phase !== "importing-module",
|
|
55
|
+
}),
|
|
56
|
+
"state.bootstrap.started": (event) =>
|
|
57
|
+
planning.update(`Bootstrapping state store '${event.store}'`, options.stage),
|
|
58
|
+
"state.bootstrap.completed": () =>
|
|
59
|
+
planning.update(phaseLabel["loading-state"], options.stage),
|
|
60
|
+
"plan.resource.started": (event) => {
|
|
61
|
+
if (!interactive) return Effect.void;
|
|
62
|
+
inFlight.add(event.fqn);
|
|
63
|
+
total = Math.max(total, event.total);
|
|
64
|
+
return showCounter(event.fqn);
|
|
65
|
+
},
|
|
66
|
+
"plan.resource.completed": completed,
|
|
67
|
+
"plan.action.completed": completed,
|
|
68
|
+
}),
|
|
69
|
+
Match.orElse(() => Effect.void),
|
|
70
|
+
),
|
|
95
71
|
),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
)
|
|
99
|
-
|
|
100
|
-
Exit.isSuccess(exit)
|
|
101
|
-
? session.done("success")
|
|
102
|
-
: Cause.hasInterruptsOnly(exit.cause)
|
|
103
|
-
? Effect.void
|
|
104
|
-
: session.done("failure"),
|
|
72
|
+
// A prompt dismissed mid-plan (e.g. a provider asking the user to
|
|
73
|
+
// resolve an ambiguity) is a cancellation, not a planning failure.
|
|
74
|
+
Effect.tapError((error) =>
|
|
75
|
+
planning.fail(isPromptCancellation(error) ? "Planning was canceled" : "Planning failed"),
|
|
105
76
|
),
|
|
77
|
+
Effect.ensuring(planning.close),
|
|
106
78
|
);
|
|
107
79
|
});
|
|
@@ -4,10 +4,9 @@ import * as Console from "effect/Console";
|
|
|
4
4
|
import * as Effect from "effect/Effect";
|
|
5
5
|
import * as Option from "effect/Option";
|
|
6
6
|
import * as Stream from "effect/Stream";
|
|
7
|
-
import * as
|
|
8
|
-
import type { ProviderSource, StateSource } from "../../Alchemist/routes/state.ts";
|
|
9
|
-
import * as CliKit from "../../Cli/CliKit/index.ts";
|
|
7
|
+
import * as Alchemist from "../../Alchemist/index.ts";
|
|
10
8
|
import type { StateStoreLogEntry } from "../../Contributions.ts";
|
|
9
|
+
import * as Interaction from "../../Interaction.ts";
|
|
11
10
|
import * as State from "../../State/index.ts";
|
|
12
11
|
import {
|
|
13
12
|
stateExplorerScreen,
|
|
@@ -59,18 +58,18 @@ type StateArgs = {
|
|
|
59
58
|
readonly name: string | undefined;
|
|
60
59
|
};
|
|
61
60
|
|
|
62
|
-
const source = (args: StateArgs): StateSource =>
|
|
61
|
+
const source = (args: StateArgs): Alchemist.State.StateSource =>
|
|
63
62
|
args.backend === "local"
|
|
64
|
-
? {
|
|
63
|
+
? { type: "local" }
|
|
65
64
|
: args.backend === "configured"
|
|
66
65
|
? {
|
|
67
|
-
|
|
66
|
+
type: "configured",
|
|
68
67
|
entrypoint: args.main,
|
|
69
68
|
profile: args.profile,
|
|
70
69
|
envFile: Option.getOrUndefined(args.envFile),
|
|
71
70
|
}
|
|
72
71
|
: {
|
|
73
|
-
|
|
72
|
+
type: "provider",
|
|
74
73
|
backend: args.backend,
|
|
75
74
|
name: args.name,
|
|
76
75
|
profile: args.profile,
|
|
@@ -84,8 +83,8 @@ const lifecycleBackend = Flag.String("backend").pipe(
|
|
|
84
83
|
|
|
85
84
|
const lifecycleSource = (
|
|
86
85
|
args: Pick<StateArgs, "envFile" | "profile" | "backend" | "name">,
|
|
87
|
-
): ProviderSource => ({
|
|
88
|
-
|
|
86
|
+
): Alchemist.State.ProviderSource => ({
|
|
87
|
+
type: "provider",
|
|
89
88
|
backend: args.backend,
|
|
90
89
|
name: args.name,
|
|
91
90
|
profile: args.profile,
|
|
@@ -120,7 +119,7 @@ const listCommand = Command.make(
|
|
|
120
119
|
{ path: pathArgument, recursive, main: config, envFile, profile, backend, name: storeName },
|
|
121
120
|
instrumentCommand("state.list")(
|
|
122
121
|
Effect.fn(function* ({ path, recursive, ...args }) {
|
|
123
|
-
const store = yield*
|
|
122
|
+
const store = yield* Alchemist.State.store(source(args));
|
|
124
123
|
const items = yield* usingStore(store)(
|
|
125
124
|
State.listState({
|
|
126
125
|
path: yield* path.pipe(Option.getOrUndefined, normalizedPath),
|
|
@@ -137,7 +136,7 @@ const readCommand = Command.make(
|
|
|
137
136
|
{ path: pathArgument, recursive, main: config, envFile, profile, backend, name: storeName },
|
|
138
137
|
instrumentCommand("state.read")(
|
|
139
138
|
Effect.fn(function* ({ path, recursive, ...args }) {
|
|
140
|
-
const store = yield*
|
|
139
|
+
const store = yield* Alchemist.State.store(source(args));
|
|
141
140
|
const requested = yield* path.pipe(Option.getOrUndefined, normalizedPath);
|
|
142
141
|
const entries = yield* usingStore(store)(State.readState({ path: requested, recursive }));
|
|
143
142
|
yield* Console.log(
|
|
@@ -170,9 +169,9 @@ const deleteCommand = Command.make(
|
|
|
170
169
|
if (requested === "") {
|
|
171
170
|
return yield* new UserInputError({ message: "cannot delete the state root" });
|
|
172
171
|
}
|
|
173
|
-
const store = yield*
|
|
172
|
+
const store = yield* Alchemist.State.store(source(args));
|
|
174
173
|
yield* usingStore(store)(State.deleteState({ path: requested, recursive }));
|
|
175
|
-
yield*
|
|
174
|
+
yield* Interaction.success(`Deleted state at ${requested}`);
|
|
176
175
|
}),
|
|
177
176
|
),
|
|
178
177
|
).pipe(
|
|
@@ -182,8 +181,8 @@ const deleteCommand = Command.make(
|
|
|
182
181
|
|
|
183
182
|
const stateExplorer = (args: StateArgs) =>
|
|
184
183
|
Effect.gen(function* () {
|
|
185
|
-
const cli = yield*
|
|
186
|
-
const store = yield*
|
|
184
|
+
const cli = yield* Interaction.Interaction;
|
|
185
|
+
const store = yield* Alchemist.State.store(source(args));
|
|
187
186
|
const on = provideStore(store);
|
|
188
187
|
const explorer: StateExplorerSource = {
|
|
189
188
|
backend: store.id,
|
|
@@ -229,10 +228,9 @@ const stateExplorer = (args: StateArgs) =>
|
|
|
229
228
|
// Captured here so the explorer's forked fibers run with the command's
|
|
230
229
|
// ambient services (tracing, terminal) rather than the default runtime.
|
|
231
230
|
const services = yield* Effect.context<never>();
|
|
232
|
-
yield* cli
|
|
233
|
-
|
|
234
|
-
Effect.catchTag("TerminalCancelled", () => Effect.void)
|
|
235
|
-
);
|
|
231
|
+
yield* cli
|
|
232
|
+
.session(cli.prompt.screen(stateExplorerScreen(explorer, services)), { alternate: true })
|
|
233
|
+
.pipe(Effect.catchTag("TerminalCancelled", () => Effect.void));
|
|
236
234
|
});
|
|
237
235
|
|
|
238
236
|
const nukeCommand = Command.make(
|
|
@@ -240,10 +238,10 @@ const nukeCommand = Command.make(
|
|
|
240
238
|
{ main: config, envFile, profile, backend, name: storeName, yes },
|
|
241
239
|
instrumentCommand("state.unsafe.nuke")(
|
|
242
240
|
Effect.fn(function* ({ yes, ...args }) {
|
|
243
|
-
const store = yield*
|
|
241
|
+
const store = yield* Alchemist.State.store(source(args));
|
|
244
242
|
const stacks = [...(yield* store.listStacks())].sort();
|
|
245
243
|
if (stacks.length === 0) {
|
|
246
|
-
yield*
|
|
244
|
+
yield* Interaction.info("Nothing to clear.");
|
|
247
245
|
return;
|
|
248
246
|
}
|
|
249
247
|
yield* Console.log(stacks.map((stack) => `• ${stack}`).join("\n"));
|
|
@@ -256,7 +254,7 @@ const nukeCommand = Command.make(
|
|
|
256
254
|
(stack) =>
|
|
257
255
|
store
|
|
258
256
|
.deleteStack({ stack })
|
|
259
|
-
.pipe(Effect.andThen(
|
|
257
|
+
.pipe(Effect.andThen(Interaction.success(`Cleared ${stack}`))),
|
|
260
258
|
{ concurrency: 32, discard: true },
|
|
261
259
|
);
|
|
262
260
|
}),
|
|
@@ -269,19 +267,44 @@ const nukeCommand = Command.make(
|
|
|
269
267
|
const bootstrapCommand = Command.make(
|
|
270
268
|
"bootstrap",
|
|
271
269
|
{
|
|
270
|
+
main: config,
|
|
272
271
|
envFile,
|
|
273
272
|
profile,
|
|
274
|
-
backend:
|
|
273
|
+
backend: Flag.String("backend").pipe(
|
|
274
|
+
Flag.withDescription(
|
|
275
|
+
"Provider state store to act on (e.g. aws, cloudflare); defaults to the one the config sets",
|
|
276
|
+
),
|
|
277
|
+
Flag.optional,
|
|
278
|
+
Flag.map(Option.getOrUndefined),
|
|
279
|
+
),
|
|
275
280
|
name: storeName,
|
|
276
281
|
force: Flag.Boolean("force").pipe(
|
|
277
|
-
Flag.withDescription(
|
|
282
|
+
Flag.withDescription(
|
|
283
|
+
"Redeploy an existing state store instead of adopting it (with --backend)",
|
|
284
|
+
),
|
|
278
285
|
Flag.withDefault(false),
|
|
279
286
|
),
|
|
280
287
|
},
|
|
281
288
|
instrumentCommand("state.bootstrap")(
|
|
282
|
-
Effect.fn(function* ({ force, ...args }) {
|
|
283
|
-
|
|
284
|
-
|
|
289
|
+
Effect.fn(function* ({ force, main, backend, ...args }) {
|
|
290
|
+
if (backend === undefined) {
|
|
291
|
+
if (force || args.name !== undefined) {
|
|
292
|
+
return yield* new UserInputError({ message: "--force and --name need --backend." });
|
|
293
|
+
}
|
|
294
|
+
const { version } = yield* Alchemist.State.bootstrapConfigured({
|
|
295
|
+
type: "configured",
|
|
296
|
+
entrypoint: main,
|
|
297
|
+
profile: args.profile,
|
|
298
|
+
envFile: Option.getOrUndefined(args.envFile),
|
|
299
|
+
});
|
|
300
|
+
yield* Interaction.success(`State store configured in '${main}' is ready (v${version})`);
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
const result = yield* Alchemist.State.bootstrap({
|
|
304
|
+
...lifecycleSource({ ...args, backend }),
|
|
305
|
+
force,
|
|
306
|
+
});
|
|
307
|
+
yield* Interaction.success(
|
|
285
308
|
`State store '${result.store}' ${result.status} (${Object.values(result.location).join(", ")})`,
|
|
286
309
|
);
|
|
287
310
|
}),
|
|
@@ -299,14 +322,70 @@ const teardownCommand = Command.make(
|
|
|
299
322
|
confirmLabel: "Destroy",
|
|
300
323
|
cancelLabel: "Cancel",
|
|
301
324
|
});
|
|
302
|
-
const result = yield*
|
|
303
|
-
yield*
|
|
325
|
+
const result = yield* Alchemist.State.teardown(lifecycleSource(args));
|
|
326
|
+
yield* Interaction.success(
|
|
304
327
|
result.deleted.length === 0 ? "Nothing to delete" : `Deleted ${result.deleted.join(", ")}`,
|
|
305
328
|
);
|
|
306
329
|
}),
|
|
307
330
|
),
|
|
308
331
|
).pipe(Command.withDescription("Delete a state store and its backing resources"), Command.unlisted);
|
|
309
332
|
|
|
333
|
+
const migrateCommand = Command.make(
|
|
334
|
+
"migrate",
|
|
335
|
+
{
|
|
336
|
+
main: config,
|
|
337
|
+
envFile,
|
|
338
|
+
profile,
|
|
339
|
+
backend,
|
|
340
|
+
name: storeName,
|
|
341
|
+
stack: Flag.String("stack").pipe(
|
|
342
|
+
Flag.withDescription("Only migrate this stack's stages"),
|
|
343
|
+
Flag.optional,
|
|
344
|
+
Flag.map(Option.getOrUndefined),
|
|
345
|
+
),
|
|
346
|
+
stage: Flag.String("stage").pipe(
|
|
347
|
+
Flag.withDescription("Only migrate stages of this name"),
|
|
348
|
+
Flag.optional,
|
|
349
|
+
Flag.map(Option.getOrUndefined),
|
|
350
|
+
),
|
|
351
|
+
rollback: Flag.Boolean("rollback").pipe(
|
|
352
|
+
Flag.withDescription("Move stages back to the state store this one replaces"),
|
|
353
|
+
Flag.withDefault(false),
|
|
354
|
+
),
|
|
355
|
+
},
|
|
356
|
+
instrumentCommand("state.migrate")(
|
|
357
|
+
Effect.fn(function* ({ stack, stage, rollback, ...args }) {
|
|
358
|
+
const result = yield* Alchemist.State.migrate(source(args), { stack, stage, rollback });
|
|
359
|
+
if (result.stages.length === 0) {
|
|
360
|
+
yield* Interaction.info("No stages to migrate.");
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
for (const entry of result.stages) {
|
|
364
|
+
const detail =
|
|
365
|
+
entry.reason ?? (entry.records === undefined ? "" : `${entry.records} records`);
|
|
366
|
+
yield* Console.log(
|
|
367
|
+
`${entry.stack}/${entry.stage}: ${entry.status}${detail === "" ? "" : ` (${detail})`}`,
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
const unfinished = result.stages.filter(
|
|
371
|
+
(entry) => entry.status === "blocked" || entry.status === "failed",
|
|
372
|
+
);
|
|
373
|
+
if (unfinished.length > 0) {
|
|
374
|
+
return yield* new UserInputError({
|
|
375
|
+
message: `${unfinished.length} stage(s) did not move. Run the command again once the deploys holding them finish, or fix the failures above.`,
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
yield* Interaction.success(
|
|
379
|
+
rollback ? "Rolled back the state store" : "Migrated the state store",
|
|
380
|
+
);
|
|
381
|
+
}),
|
|
382
|
+
),
|
|
383
|
+
).pipe(
|
|
384
|
+
Command.withDescription(
|
|
385
|
+
"Move stages into the configured state store from the one it replaces (or --backend)",
|
|
386
|
+
),
|
|
387
|
+
);
|
|
388
|
+
|
|
310
389
|
const logsCommand = Command.make(
|
|
311
390
|
"logs",
|
|
312
391
|
{
|
|
@@ -335,13 +414,13 @@ const logsCommand = Command.make(
|
|
|
335
414
|
const format = (entry: StateStoreLogEntry) =>
|
|
336
415
|
`${formatLocalTimestamp(entry.timestamp)} ${entry.message}`;
|
|
337
416
|
if (tail) {
|
|
338
|
-
yield*
|
|
339
|
-
yield*
|
|
417
|
+
yield* Interaction.info(`Tailing the ${args.backend} state store...`);
|
|
418
|
+
yield* Alchemist.State.tailLogs(target).pipe(
|
|
340
419
|
Stream.runForEach((entry) => Console.log(format(entry))),
|
|
341
420
|
);
|
|
342
421
|
return;
|
|
343
422
|
}
|
|
344
|
-
const entries = yield*
|
|
423
|
+
const entries = yield* Alchemist.State.logs({
|
|
345
424
|
...target,
|
|
346
425
|
limit,
|
|
347
426
|
since: since ? yield* parseSince(since) : undefined,
|
|
@@ -366,7 +445,7 @@ export const stateCommand = Command.make(
|
|
|
366
445
|
{ main: config, envFile, profile, backend, name: storeName },
|
|
367
446
|
instrumentCommand("state")(
|
|
368
447
|
Effect.fn(function* (args) {
|
|
369
|
-
if (!(yield*
|
|
448
|
+
if (!(yield* Interaction.Interaction).terminal.input) {
|
|
370
449
|
return yield* failWithHelp(["alchemy", "state"]);
|
|
371
450
|
}
|
|
372
451
|
yield* stateExplorer(args);
|
|
@@ -380,6 +459,7 @@ export const stateCommand = Command.make(
|
|
|
380
459
|
deleteCommand,
|
|
381
460
|
bootstrapCommand,
|
|
382
461
|
teardownCommand,
|
|
462
|
+
migrateCommand,
|
|
383
463
|
logsCommand,
|
|
384
464
|
unsafeCommand,
|
|
385
465
|
]),
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { detectCapabilities } from "@alchemy.run/sigil/capabilities";
|
|
2
|
+
import type { TerminalCapabilities, TerminalOptions } from "../../Interaction.ts";
|
|
3
|
+
import { isNonInteractive } from "../../Util/interactive.ts";
|
|
4
|
+
|
|
5
|
+
/** Detect what the terminal behind the given streams supports. */
|
|
6
|
+
export const resolveCapabilities = (options: TerminalOptions = {}): TerminalCapabilities => {
|
|
7
|
+
const stdout = options.stdout ?? process.stdout;
|
|
8
|
+
const stdin = options.stdin ?? process.stdin;
|
|
9
|
+
const detected = detectCapabilities({ stdout });
|
|
10
|
+
const input =
|
|
11
|
+
options.input ?? (stdin.isTTY === true && stdout.isTTY === true && !isNonInteractive());
|
|
12
|
+
return {
|
|
13
|
+
input,
|
|
14
|
+
columns: detected.size.columns,
|
|
15
|
+
rows: detected.size.rows,
|
|
16
|
+
colors: options.colors ?? detected.supports.color,
|
|
17
|
+
unicode: options.unicode ?? detected.supports.unicode,
|
|
18
|
+
alternateScreen: detected.supports.alternateScreen,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -1,37 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// The interaction vocabulary (message/prompt option shapes, progress
|
|
6
|
-
// options, interaction errors) belongs to the engine's core `Interaction`
|
|
7
|
-
// contract — CliKit implements a superset of it. Re-exported here so the
|
|
8
|
-
// CLI's components keep one local import for their whole type surface.
|
|
1
|
+
// The interaction vocabulary belongs to the engine's `Interaction` contract.
|
|
2
|
+
// Re-exported here so the CLI's components keep one local import for their
|
|
3
|
+
// whole type surface.
|
|
9
4
|
export type {
|
|
10
|
-
|
|
5
|
+
BrowserLoginOptions,
|
|
11
6
|
Choice,
|
|
12
7
|
ConfirmOptions,
|
|
13
8
|
InteractionError,
|
|
9
|
+
LiveViewHandle,
|
|
10
|
+
LiveViewOptions,
|
|
14
11
|
MessageOptions,
|
|
15
12
|
MultiSelectOptions,
|
|
16
13
|
PasswordInputOptions,
|
|
14
|
+
ProgressHandle,
|
|
17
15
|
ProgressOptions,
|
|
16
|
+
ScreenController,
|
|
18
17
|
SelectOptions,
|
|
18
|
+
SessionOptions,
|
|
19
|
+
TerminalCapabilities,
|
|
20
|
+
TerminalOptions,
|
|
19
21
|
TextInputOptions,
|
|
22
|
+
View,
|
|
20
23
|
} from "../../Interaction.ts";
|
|
21
|
-
|
|
22
|
-
/** A composable CLI layout. Views are inert; only CliKit renders them. */
|
|
23
|
-
export type View = ReactNode;
|
|
24
|
-
|
|
25
|
-
export interface CliKitCapabilities {
|
|
26
|
-
/** Whether this process has usable terminal input for prompts and apps. */
|
|
27
|
-
readonly input: boolean;
|
|
28
|
-
readonly columns: number;
|
|
29
|
-
readonly rows: number;
|
|
30
|
-
readonly colors: boolean;
|
|
31
|
-
readonly unicode: boolean;
|
|
32
|
-
/** Whether full-screen applications may use the terminal's alternate buffer. */
|
|
33
|
-
readonly alternateScreen: boolean;
|
|
34
|
-
}
|
|
24
|
+
export { Screen } from "../../Interaction.ts";
|
|
35
25
|
|
|
36
26
|
export interface RenderOptions {
|
|
37
27
|
readonly columns?: number;
|
|
@@ -57,79 +47,3 @@ export interface CycleSelectOptions<State> {
|
|
|
57
47
|
readonly requireChange?: boolean;
|
|
58
48
|
readonly unchangedMessage?: string;
|
|
59
49
|
}
|
|
60
|
-
|
|
61
|
-
/** A navigable application menu. Selecting an item does not commit output. */
|
|
62
|
-
export interface MenuOptions<Value> extends SelectOptions<Value> {
|
|
63
|
-
readonly header?: View;
|
|
64
|
-
readonly footer?: View;
|
|
65
|
-
/**
|
|
66
|
-
* Value returned by Escape. Without it, Escape cancels the application.
|
|
67
|
-
* `undefined` is a valid back value when it is part of `Value`; presence of
|
|
68
|
-
* the property, rather than its value, determines whether a back target
|
|
69
|
-
* exists.
|
|
70
|
-
*/
|
|
71
|
-
readonly back?: Value;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface ScreenController<Value> {
|
|
75
|
-
readonly submit: (value: Value, summary?: View) => void;
|
|
76
|
-
readonly cancel: () => void;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* A custom interactive scene. The scene owns its local component state while
|
|
81
|
-
* CliKit owns input streams, serialization, rendering and teardown.
|
|
82
|
-
*/
|
|
83
|
-
export interface Screen<Value> {
|
|
84
|
-
readonly name: string;
|
|
85
|
-
readonly render: (controller: ScreenController<Value>) => View;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export const Screen = {
|
|
89
|
-
make: <Value>(
|
|
90
|
-
name: string,
|
|
91
|
-
render: (controller: ScreenController<Value>) => View,
|
|
92
|
-
): Screen<Value> => ({ name, render }),
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Handle for a live progress row. Acquired within a `Scope`: the enclosing
|
|
97
|
-
* scope's close is a release backstop, so an interrupted fiber can never leave
|
|
98
|
-
* an orphaned row pinning the renderer. Settling early via `succeed`/`fail`/
|
|
99
|
-
* `close` is the normal path; every settle operation is idempotent.
|
|
100
|
-
*/
|
|
101
|
-
export interface ProgressHandle {
|
|
102
|
-
readonly update: (options: ProgressOptions) => Effect.Effect<void>;
|
|
103
|
-
readonly succeed: (message?: string) => Effect.Effect<void>;
|
|
104
|
-
readonly fail: (message?: string) => Effect.Effect<void>;
|
|
105
|
-
readonly close: Effect.Effect<void>;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* A mounted live view. The view itself is immutable — dynamic content flows
|
|
110
|
-
* through a caller-owned store that its component subscribes to — so the
|
|
111
|
-
* handle only controls the block's lifetime. Scope-bound the same way as
|
|
112
|
-
* {@link ProgressHandle}; `close` settles early and is idempotent.
|
|
113
|
-
*/
|
|
114
|
-
export interface LiveViewHandle {
|
|
115
|
-
readonly close: Effect.Effect<void>;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export interface LiveViewOptions {
|
|
119
|
-
/** Place an application shell/header before completed prompt output. */
|
|
120
|
-
readonly placement?: "beforeTranscript" | "afterTranscript";
|
|
121
|
-
/** Commit the final view to the static transcript when it closes. */
|
|
122
|
-
readonly persistOnClose?: boolean;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export interface CliKitOptions {
|
|
126
|
-
readonly stdin?: NodeJS.ReadStream;
|
|
127
|
-
readonly stdout?: NodeJS.WriteStream;
|
|
128
|
-
readonly stderr?: NodeJS.WriteStream;
|
|
129
|
-
/** Override automatic TTY input detection. Primarily useful for tests. */
|
|
130
|
-
readonly input?: boolean;
|
|
131
|
-
readonly colors?: boolean;
|
|
132
|
-
readonly unicode?: boolean;
|
|
133
|
-
/** Capture console output while the interactive renderer owns the tty. */
|
|
134
|
-
readonly captureConsole?: boolean;
|
|
135
|
-
}
|
|
@@ -4,9 +4,9 @@ import { useWindowSize } from "@alchemy.run/sigil";
|
|
|
4
4
|
import { createContext, useContext, useMemo } from "@alchemy.run/sigil/react";
|
|
5
5
|
import type { ReactNode } from "react";
|
|
6
6
|
import { glyphsFor, theme, type KeyHint } from "../../../Util/Theme.ts";
|
|
7
|
-
import type {
|
|
7
|
+
import type { TerminalCapabilities } from "../types.ts";
|
|
8
8
|
|
|
9
|
-
const defaults:
|
|
9
|
+
const defaults: TerminalCapabilities = {
|
|
10
10
|
input: false,
|
|
11
11
|
columns: 80,
|
|
12
12
|
rows: 24,
|
|
@@ -15,14 +15,14 @@ const defaults: CliKitCapabilities = {
|
|
|
15
15
|
alternateScreen: false,
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
const EnvironmentContext = createContext<
|
|
18
|
+
const EnvironmentContext = createContext<TerminalCapabilities>(defaults);
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Resize-following variant, split out so the static renderer (`renderToString`
|
|
22
22
|
* for every print/format) never attaches a `resize` listener to stdout.
|
|
23
23
|
*/
|
|
24
24
|
type ObservingEnvironmentProps = {
|
|
25
|
-
readonly capabilities:
|
|
25
|
+
readonly capabilities: TerminalCapabilities;
|
|
26
26
|
readonly children?: ReactNode;
|
|
27
27
|
};
|
|
28
28
|
|
|
@@ -36,7 +36,7 @@ function ObservingEnvironment({ capabilities, children }: ObservingEnvironmentPr
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
type CliEnvironmentProps = {
|
|
39
|
-
readonly capabilities:
|
|
39
|
+
readonly capabilities: TerminalCapabilities;
|
|
40
40
|
/** Follow Sigil's terminal resize subscription for a live renderer. */
|
|
41
41
|
readonly observeWindow?: boolean;
|
|
42
42
|
readonly children?: ReactNode;
|