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,167 +0,0 @@
|
|
|
1
|
-
import * as Clock from "effect/Clock";
|
|
2
|
-
import * as Effect from "effect/Effect";
|
|
3
|
-
import type { PlanStatusSession, ProgressEvent } from "../Report.ts";
|
|
4
|
-
import { type ProgressReporter } from "../Report.ts";
|
|
5
|
-
|
|
6
|
-
// The event contract itself lives in Report.ts (one flat `_tag` union, the
|
|
7
|
-
// `Progress` reference the engine emits into). This module adds the
|
|
8
|
-
// Alchemist-side plumbing: the OTEL span-event bridge routes wrap their
|
|
9
|
-
// reporter with, and the adapter to the engine's apply-session contract.
|
|
10
|
-
export {
|
|
11
|
-
Progress,
|
|
12
|
-
type ActionPlanned,
|
|
13
|
-
type ApplyEvent,
|
|
14
|
-
type NukeEvent,
|
|
15
|
-
type NukeScanStarted,
|
|
16
|
-
type NukeProviderScanStarted,
|
|
17
|
-
type NukePassStarted,
|
|
18
|
-
type NukeProviderScanned,
|
|
19
|
-
type NukeResourceDeleted,
|
|
20
|
-
type NukeResourceFailed,
|
|
21
|
-
type PlanEvent,
|
|
22
|
-
type PlanNodeEvent,
|
|
23
|
-
type PlanPhaseChanged,
|
|
24
|
-
type PlanningPhase,
|
|
25
|
-
type ProgressEvent,
|
|
26
|
-
type ProgressReporter,
|
|
27
|
-
type ProviderConfigureCompleted,
|
|
28
|
-
type ProviderConfigureStarted,
|
|
29
|
-
type ProviderEvent,
|
|
30
|
-
type ProviderRefreshCompleted,
|
|
31
|
-
type ProviderRefreshStarted,
|
|
32
|
-
type ResourceAnnotated,
|
|
33
|
-
type ResourceDiffStarted,
|
|
34
|
-
type ResourcePlanned,
|
|
35
|
-
type ResourceStatusChanged,
|
|
36
|
-
type StateBootstrapCompleted,
|
|
37
|
-
type StateBootstrapStarted,
|
|
38
|
-
type StateEvent,
|
|
39
|
-
} from "../Report.ts";
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* The OTEL span-event shape of one {@link ProgressEvent}, or `undefined`
|
|
43
|
-
* for events that are renderer-only. Per-node plan events are deliberately
|
|
44
|
-
* excluded: a plan emits one per resource *including noops* on every
|
|
45
|
-
* (re)plan — dev-watch replans would flood the collector with rows that
|
|
46
|
-
* mostly say "noop", and the node's own `plan.diff.resource` span already
|
|
47
|
-
* carries the diff. The phase markers are enough to know planning started
|
|
48
|
-
* and where the time went.
|
|
49
|
-
*/
|
|
50
|
-
const spanEventOf = (
|
|
51
|
-
event: ProgressEvent,
|
|
52
|
-
): { name: string; attributes: Record<string, unknown> } | undefined => {
|
|
53
|
-
switch (event._tag) {
|
|
54
|
-
case "plan.phase":
|
|
55
|
-
return {
|
|
56
|
-
name: "alchemy.plan.phase",
|
|
57
|
-
attributes: { "alchemy.plan.phase": event.phase },
|
|
58
|
-
};
|
|
59
|
-
case "plan.resource.started":
|
|
60
|
-
case "plan.resource.completed":
|
|
61
|
-
case "plan.action.completed":
|
|
62
|
-
return undefined;
|
|
63
|
-
case "apply.resource.status":
|
|
64
|
-
return {
|
|
65
|
-
name: "alchemy.apply.resource.status",
|
|
66
|
-
attributes: {
|
|
67
|
-
"alchemy.resource.fqn": event.fqn,
|
|
68
|
-
"alchemy.resource.logical_id": event.id,
|
|
69
|
-
"alchemy.resource.type": event.type,
|
|
70
|
-
"alchemy.apply.resource.status": event.status,
|
|
71
|
-
...(event.message === undefined ? {} : { "alchemy.apply.message": event.message }),
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
case "apply.resource.note":
|
|
75
|
-
return {
|
|
76
|
-
name: "alchemy.apply.resource.note",
|
|
77
|
-
attributes: {
|
|
78
|
-
"alchemy.resource.fqn": event.fqn,
|
|
79
|
-
"alchemy.resource.logical_id": event.id,
|
|
80
|
-
"alchemy.apply.message": event.message,
|
|
81
|
-
...(event.kind === undefined ? {} : { "alchemy.apply.note.kind": event.kind }),
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
case "state.bootstrap.started":
|
|
85
|
-
case "state.bootstrap.completed":
|
|
86
|
-
return {
|
|
87
|
-
name: `alchemy.${event._tag}`,
|
|
88
|
-
attributes: { "alchemy.state_store.name": event.store },
|
|
89
|
-
};
|
|
90
|
-
case "nuke.scan.started":
|
|
91
|
-
return {
|
|
92
|
-
name: "alchemy.nuke.scan.started",
|
|
93
|
-
attributes: { "alchemy.nuke.providers": event.total },
|
|
94
|
-
};
|
|
95
|
-
case "nuke.pass.started":
|
|
96
|
-
return {
|
|
97
|
-
name: "alchemy.nuke.pass.started",
|
|
98
|
-
attributes: { "alchemy.nuke.pass": event.pass },
|
|
99
|
-
};
|
|
100
|
-
case "nuke.scan.provider.started":
|
|
101
|
-
return {
|
|
102
|
-
name: "alchemy.nuke.scan.provider.started",
|
|
103
|
-
attributes: { "alchemy.provider": event.provider },
|
|
104
|
-
};
|
|
105
|
-
case "nuke.scan.provider.completed":
|
|
106
|
-
return {
|
|
107
|
-
name: "alchemy.nuke.scan.provider.completed",
|
|
108
|
-
attributes: {
|
|
109
|
-
"alchemy.provider": event.provider,
|
|
110
|
-
"alchemy.nuke.resources": event.resources,
|
|
111
|
-
...(event.error === undefined ? {} : { "alchemy.nuke.message": event.error }),
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
case "nuke.resource.deleted":
|
|
115
|
-
return {
|
|
116
|
-
name: "alchemy.nuke.resource.deleted",
|
|
117
|
-
attributes: { "alchemy.resource.display_name": event.resource },
|
|
118
|
-
};
|
|
119
|
-
case "nuke.resource.failed":
|
|
120
|
-
return {
|
|
121
|
-
name: "alchemy.nuke.resource.failed",
|
|
122
|
-
attributes: {
|
|
123
|
-
"alchemy.resource.display_name": event.resource,
|
|
124
|
-
"alchemy.nuke.message": event.message,
|
|
125
|
-
},
|
|
126
|
-
};
|
|
127
|
-
case "provider.configure.started":
|
|
128
|
-
case "provider.configure.completed":
|
|
129
|
-
case "provider.refresh.started":
|
|
130
|
-
case "provider.refresh.completed":
|
|
131
|
-
return {
|
|
132
|
-
name: `alchemy.${event._tag}`,
|
|
133
|
-
attributes: { "alchemy.provider": event.provider },
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Decorate a reporter so a {@link ProgressEvent} with a span-event shape is
|
|
140
|
-
* also recorded on the currently active span before it reaches the
|
|
141
|
-
* renderer. Emission happens inside the engine's instrumented fibers, so
|
|
142
|
-
* apply events land on `apply.resource` / `provider.<op>` spans — giving
|
|
143
|
-
* traces a within-span timeline of status transitions. A no-op when no
|
|
144
|
-
* span is active (tracing disabled), and independent of whether a renderer
|
|
145
|
-
* is attached, so `--yes` and CI runs still produce the events.
|
|
146
|
-
*/
|
|
147
|
-
export const withSpanEvents =
|
|
148
|
-
(report: ProgressReporter): ProgressReporter =>
|
|
149
|
-
(event) => {
|
|
150
|
-
const spanEvent = spanEventOf(event);
|
|
151
|
-
if (spanEvent === undefined) return report(event);
|
|
152
|
-
return Effect.currentSpan.pipe(
|
|
153
|
-
Effect.flatMap((span) =>
|
|
154
|
-
Effect.flatMap(Clock.currentTimeNanos, (now) =>
|
|
155
|
-
Effect.sync(() => span.event(spanEvent.name, now, spanEvent.attributes)),
|
|
156
|
-
),
|
|
157
|
-
),
|
|
158
|
-
Effect.ignore,
|
|
159
|
-
Effect.andThen(report(event)),
|
|
160
|
-
);
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
/** Adapt the ambient reporter to the engine's apply-session contract. */
|
|
164
|
-
export const applySession = (report: ProgressReporter): PlanStatusSession => ({
|
|
165
|
-
emit: (event) => report(event),
|
|
166
|
-
done: () => Effect.void,
|
|
167
|
-
});
|
package/src/Alchemist/Session.ts
DELETED
|
@@ -1,415 +0,0 @@
|
|
|
1
|
-
import { pathToFileURL } from "node:url";
|
|
2
|
-
import * as Cause from "effect/Cause";
|
|
3
|
-
import * as ConfigProvider from "effect/ConfigProvider";
|
|
4
|
-
import * as Context from "effect/Context";
|
|
5
|
-
import * as Duration from "effect/Duration";
|
|
6
|
-
import * as Effect from "effect/Effect";
|
|
7
|
-
import * as FileSystem from "effect/FileSystem";
|
|
8
|
-
import * as Layer from "effect/Layer";
|
|
9
|
-
import * as Logger from "effect/Logger";
|
|
10
|
-
import * as Option from "effect/Option";
|
|
11
|
-
import * as Predicate from "effect/Predicate";
|
|
12
|
-
import * as Schema from "effect/Schema";
|
|
13
|
-
import * as Semaphore from "effect/Semaphore";
|
|
14
|
-
import { AdoptPolicy } from "../AdoptPolicy.ts";
|
|
15
|
-
import { AlchemyContext } from "../AlchemyContext.ts";
|
|
16
|
-
import { ArtifactStore, createArtifactStore } from "../Artifacts.ts";
|
|
17
|
-
import { AuthError, AuthProviders } from "../Auth/AuthProvider.ts";
|
|
18
|
-
import { SuppressMissingProviderConfig } from "../Auth/Profile.ts";
|
|
19
|
-
import { withProfileOverride } from "../Auth/Resolve.ts";
|
|
20
|
-
import * as Contributions from "../Contributions.ts";
|
|
21
|
-
import * as Stack from "../Stack.ts";
|
|
22
|
-
import { Stage } from "../Stage.ts";
|
|
23
|
-
import {
|
|
24
|
-
loadConfigProvider,
|
|
25
|
-
stackConfigLayer,
|
|
26
|
-
StackConfigOverrides,
|
|
27
|
-
} from "../Util/ConfigProvider.ts";
|
|
28
|
-
import { fileLogger } from "../Util/FileLogger.ts";
|
|
29
|
-
import { DEFAULT_ENTRYPOINT, resolveStackEntrypoint, StackEntrypointError } from "./Entrypoint.ts";
|
|
30
|
-
import { Progress } from "./Progress.ts";
|
|
31
|
-
|
|
32
|
-
export { DEFAULT_ENTRYPOINT, resolveStackEntrypoint, StackEntrypointError };
|
|
33
|
-
|
|
34
|
-
/** Stage used by routes that inspect a project without addressing a deployment. */
|
|
35
|
-
export const PLACEHOLDER_STAGE = "placeholder";
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* The default export of an `alchemy.run.ts` entrypoint: the stack effect
|
|
39
|
-
* `Alchemy.Stack(...)` returns, carrying the metadata the factory attaches.
|
|
40
|
-
*/
|
|
41
|
-
export type StackModule = ReturnType<ReturnType<typeof Stack.make>> & {
|
|
42
|
-
readonly stackName: string;
|
|
43
|
-
readonly providers: Layer.Layer<never> | undefined;
|
|
44
|
-
readonly state: Layer.Layer<never> | undefined;
|
|
45
|
-
readonly secrets: Stack.StackSecrets | undefined;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export interface StackModuleLoader {
|
|
49
|
-
readonly import: (url: string) => Promise<{ readonly default?: unknown }>;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export const StackModuleLoader = Context.Reference<StackModuleLoader>(
|
|
53
|
-
"Alchemy/Alchemist/StackModuleLoader",
|
|
54
|
-
{ defaultValue: () => ({ import: (url) => import(url) }) },
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
export const importStack = Effect.fn(function* (main: string) {
|
|
58
|
-
const absolutePath = yield* resolveStackEntrypoint(main);
|
|
59
|
-
const loader = yield* StackModuleLoader;
|
|
60
|
-
const module = yield* Effect.promise(() => loader.import(pathToFileURL(absolutePath).href));
|
|
61
|
-
if (
|
|
62
|
-
!Effect.isEffect(module.default) ||
|
|
63
|
-
!Predicate.hasProperty(module.default, "stackName") ||
|
|
64
|
-
typeof module.default.stackName !== "string"
|
|
65
|
-
) {
|
|
66
|
-
return yield* new StackEntrypointError({
|
|
67
|
-
message: `Stack entrypoint '${main}' must export a default stack definition (export default Alchemy.Stack({...})).`,
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
// oxlint-disable-next-line effecttsgo/unsafe-effect-type-assertion -- default export shape validated at runtime above
|
|
71
|
-
return module.default as StackModule;
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Which project, stage, and credentials a route acts under. Every route that
|
|
76
|
-
* touches the user's program takes one of these; the optional fields fall back
|
|
77
|
-
* to the same defaults the CLI uses.
|
|
78
|
-
*/
|
|
79
|
-
export interface Target {
|
|
80
|
-
/** Stack entrypoint. @default "alchemy.run.ts" */
|
|
81
|
-
readonly entrypoint?: string;
|
|
82
|
-
/** Stage the run addresses. @default "placeholder" (routes that never deploy) */
|
|
83
|
-
readonly stage?: string;
|
|
84
|
-
/** Profile whose credentials the run uses. Falls back to the active profile. */
|
|
85
|
-
readonly profile?: string;
|
|
86
|
-
/** `.env` file layered under the process environment. */
|
|
87
|
-
readonly envFile?: string;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/** A {@link Target} for a route that genuinely acts on one stack instance. */
|
|
91
|
-
export interface StackTarget extends Target {
|
|
92
|
-
readonly entrypoint: string;
|
|
93
|
-
readonly stage: string;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export interface OpenOptions {
|
|
97
|
-
/** Run local (emulated) providers instead of the real cloud. */
|
|
98
|
-
readonly dev?: boolean;
|
|
99
|
-
/** Adopt pre-existing cloud resources instead of failing on conflict. */
|
|
100
|
-
readonly adopt?: boolean;
|
|
101
|
-
/** Upgrade an out-of-date state store without prompting. */
|
|
102
|
-
readonly updateStateStore?: boolean;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
interface SessionServicesOptions {
|
|
106
|
-
readonly envFile: Option.Option<string>;
|
|
107
|
-
readonly profile?: string;
|
|
108
|
-
readonly logger?: Layer.Layer<never, never, never>;
|
|
109
|
-
readonly extra?: Layer.Layer<never, never, never>;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/** Shared config and logging services used by every stack/auth build path. */
|
|
113
|
-
const sessionServices = Effect.fn("sessionServices")(function* (options: SessionServicesOptions) {
|
|
114
|
-
const commandConfig = yield* loadConfigProvider(options.envFile);
|
|
115
|
-
|
|
116
|
-
// `--env-file` only steers a stack's default secrets list and `--profile`
|
|
117
|
-
// pins the profile inside it; see stackConfigLayer.
|
|
118
|
-
return Layer.mergeAll(
|
|
119
|
-
Layer.succeed(StackConfigOverrides, {
|
|
120
|
-
envFile: Option.getOrUndefined(options.envFile),
|
|
121
|
-
profile: options.profile,
|
|
122
|
-
}),
|
|
123
|
-
ConfigProvider.layer(withProfileOverride(commandConfig, options.profile)),
|
|
124
|
-
options.logger ?? Logger.layer([fileLogger("out")], { mergeWithExisting: true }),
|
|
125
|
-
options.extra ?? Layer.empty,
|
|
126
|
-
);
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
interface RouteCacheService {
|
|
130
|
-
readonly open: (
|
|
131
|
-
target: Target,
|
|
132
|
-
options: OpenOptions,
|
|
133
|
-
) => Effect.Effect<
|
|
134
|
-
Session,
|
|
135
|
-
Effect.Error<ReturnType<typeof openUncached>>,
|
|
136
|
-
Effect.Services<ReturnType<typeof openUncached>>
|
|
137
|
-
>;
|
|
138
|
-
readonly authProviders: (
|
|
139
|
-
options: CollectAuthProvidersOptions,
|
|
140
|
-
) => Effect.Effect<
|
|
141
|
-
AuthProviders["Service"],
|
|
142
|
-
Effect.Error<ReturnType<typeof collectAuthProvidersUncached>>,
|
|
143
|
-
Effect.Services<ReturnType<typeof collectAuthProvidersUncached>>
|
|
144
|
-
>;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export interface CollectAuthProvidersOptions {
|
|
148
|
-
readonly main: string;
|
|
149
|
-
readonly envFile: Option.Option<string>;
|
|
150
|
-
readonly profile: string;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
const RouteCache = Context.Reference<RouteCacheService>("Alchemy/Alchemist/RouteCache", {
|
|
154
|
-
defaultValue: () => ({
|
|
155
|
-
open: (target, options) => openUncached(target, options),
|
|
156
|
-
authProviders: collectAuthProvidersUncached,
|
|
157
|
-
}),
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
const stackSessionKey = (target: Target, options: OpenOptions) =>
|
|
161
|
-
JSON.stringify([
|
|
162
|
-
target.entrypoint ?? DEFAULT_ENTRYPOINT,
|
|
163
|
-
target.stage ?? PLACEHOLDER_STAGE,
|
|
164
|
-
target.profile ?? null,
|
|
165
|
-
target.envFile ?? null,
|
|
166
|
-
options.dev ?? false,
|
|
167
|
-
options.adopt ?? false,
|
|
168
|
-
options.updateStateStore ?? false,
|
|
169
|
-
]);
|
|
170
|
-
|
|
171
|
-
const authRegistryKey = (options: CollectAuthProvidersOptions) =>
|
|
172
|
-
JSON.stringify([options.main, Option.getOrNull(options.envFile), options.profile]);
|
|
173
|
-
|
|
174
|
-
const cached = <A, E, R>(
|
|
175
|
-
lock: Semaphore.Semaphore,
|
|
176
|
-
entries: Map<string, Effect.Effect<A, E, R>>,
|
|
177
|
-
key: string,
|
|
178
|
-
load: Effect.Effect<A, E, R>,
|
|
179
|
-
) =>
|
|
180
|
-
Semaphore.withPermits(
|
|
181
|
-
lock,
|
|
182
|
-
1,
|
|
183
|
-
)(
|
|
184
|
-
Effect.suspend(() => {
|
|
185
|
-
const existing = entries.get(key);
|
|
186
|
-
if (existing !== undefined) return Effect.succeed(existing);
|
|
187
|
-
return Effect.cached(load).pipe(
|
|
188
|
-
Effect.tap((effect) =>
|
|
189
|
-
Effect.sync(() => {
|
|
190
|
-
entries.set(key, effect);
|
|
191
|
-
}),
|
|
192
|
-
),
|
|
193
|
-
);
|
|
194
|
-
}),
|
|
195
|
-
).pipe(Effect.flatten);
|
|
196
|
-
|
|
197
|
-
/** Memoize stack sessions and auth registries for one command or API scope. */
|
|
198
|
-
export const routeCacheLayer = Layer.effect(
|
|
199
|
-
RouteCache,
|
|
200
|
-
Effect.sync((): RouteCacheService => {
|
|
201
|
-
const lock = Semaphore.makeUnsafe(1);
|
|
202
|
-
const sessions = new Map<string, ReturnType<typeof openUncached>>();
|
|
203
|
-
const registries = new Map<string, ReturnType<typeof collectAuthProvidersUncached>>();
|
|
204
|
-
return {
|
|
205
|
-
open: (target, options) =>
|
|
206
|
-
cached(lock, sessions, stackSessionKey(target, options), openUncached(target, options)),
|
|
207
|
-
authProviders: (options) =>
|
|
208
|
-
cached(lock, registries, authRegistryKey(options), collectAuthProvidersUncached(options)),
|
|
209
|
-
};
|
|
210
|
-
}),
|
|
211
|
-
);
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Import the user's stack module and build the services its resources run
|
|
215
|
-
* under. This is the one place that decides what a stack run sees — plan,
|
|
216
|
-
* apply, drift, logs, and state inspection all come through here.
|
|
217
|
-
*
|
|
218
|
-
* The session lives in the surrounding `Scope`; run stack-scoped effects by
|
|
219
|
-
* providing `session.context` (`Effect.provide(effect, session.context)`).
|
|
220
|
-
*/
|
|
221
|
-
const openUncached = Effect.fn("openStackSessionUncached")(function* (
|
|
222
|
-
target: Target,
|
|
223
|
-
options: OpenOptions = {},
|
|
224
|
-
) {
|
|
225
|
-
// Phases are emitted here, at the actual work boundaries, rather than by
|
|
226
|
-
// callers around `open` — the import and the service build both happen
|
|
227
|
-
// inside this function, so only it can time them honestly.
|
|
228
|
-
const report = yield* Progress;
|
|
229
|
-
yield* report({ _tag: "plan.phase", phase: "importing-module" });
|
|
230
|
-
const stackEffect = yield* importStack(target.entrypoint ?? DEFAULT_ENTRYPOINT);
|
|
231
|
-
yield* report({ _tag: "plan.phase", phase: "resolving-services" });
|
|
232
|
-
const shared = yield* sessionServices({
|
|
233
|
-
envFile: Option.fromNullishOr(target.envFile),
|
|
234
|
-
profile: target.profile,
|
|
235
|
-
});
|
|
236
|
-
const services = Layer.mergeAll(
|
|
237
|
-
Layer.effect(
|
|
238
|
-
AlchemyContext,
|
|
239
|
-
Effect.map(AlchemyContext, (context) => ({
|
|
240
|
-
...context,
|
|
241
|
-
dev: options.dev ?? context.dev,
|
|
242
|
-
adopt: options.adopt ?? false,
|
|
243
|
-
updateStateStore: options.updateStateStore ?? false,
|
|
244
|
-
})),
|
|
245
|
-
),
|
|
246
|
-
Layer.succeedContext(
|
|
247
|
-
Context.make(AdoptPolicy, options.adopt ?? false).pipe(
|
|
248
|
-
Context.add(ArtifactStore, createArtifactStore()),
|
|
249
|
-
Context.add(
|
|
250
|
-
AuthProviders,
|
|
251
|
-
yield* Effect.serviceOption(AuthProviders).pipe(
|
|
252
|
-
Effect.map(Option.getOrElse((): AuthProviders["Service"] => ({}))),
|
|
253
|
-
),
|
|
254
|
-
),
|
|
255
|
-
Context.add(Stage, target.stage ?? PLACEHOLDER_STAGE),
|
|
256
|
-
),
|
|
257
|
-
),
|
|
258
|
-
shared,
|
|
259
|
-
);
|
|
260
|
-
const sessionContext = yield* Layer.build(services);
|
|
261
|
-
const stack = yield* Effect.provide(stackEffect, sessionContext);
|
|
262
|
-
return {
|
|
263
|
-
stack,
|
|
264
|
-
/**
|
|
265
|
-
* Everything a stack-scoped effect runs under: the stack's own providers
|
|
266
|
-
* and state store over this session's services.
|
|
267
|
-
*/
|
|
268
|
-
context: Context.merge(sessionContext, stack.services),
|
|
269
|
-
};
|
|
270
|
-
});
|
|
271
|
-
|
|
272
|
-
/** An imported, fully-configured stack instance. */
|
|
273
|
-
export type Session = Effect.Success<ReturnType<typeof openUncached>>;
|
|
274
|
-
|
|
275
|
-
export const open = Effect.fn("openStackSession")(function* (
|
|
276
|
-
target: Target,
|
|
277
|
-
options: OpenOptions = {},
|
|
278
|
-
) {
|
|
279
|
-
return yield* (yield* RouteCache).open(target, options);
|
|
280
|
-
});
|
|
281
|
-
|
|
282
|
-
const placeholderStack = (name: string) => ({
|
|
283
|
-
actions: {},
|
|
284
|
-
bindings: {},
|
|
285
|
-
name,
|
|
286
|
-
resources: {},
|
|
287
|
-
stage: PLACEHOLDER_STAGE,
|
|
288
|
-
});
|
|
289
|
-
|
|
290
|
-
export interface BuildStackProvidersOptions {
|
|
291
|
-
readonly main: string;
|
|
292
|
-
readonly envFile: Option.Option<string>;
|
|
293
|
-
readonly profile?: string;
|
|
294
|
-
readonly registry?: AuthProviders["Service"];
|
|
295
|
-
readonly logger?: Layer.Layer<never, never, never>;
|
|
296
|
-
readonly extra?: Layer.Layer<never, never, never>;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
export const buildStackProviders = Effect.fn("buildStackProviders")(function* (
|
|
300
|
-
options: BuildStackProvidersOptions,
|
|
301
|
-
) {
|
|
302
|
-
const authProviders = options.registry ?? {};
|
|
303
|
-
const stackEffect = yield* importStack(options.main);
|
|
304
|
-
const shared = yield* sessionServices(options);
|
|
305
|
-
const valueServices = Layer.succeedContext(
|
|
306
|
-
Context.make(AuthProviders, authProviders).pipe(
|
|
307
|
-
Context.add(Stage, PLACEHOLDER_STAGE),
|
|
308
|
-
Context.add(Stack.Stack, placeholderStack(stackEffect.stackName)),
|
|
309
|
-
),
|
|
310
|
-
);
|
|
311
|
-
const context = yield* Layer.build(
|
|
312
|
-
(stackEffect.providers ?? Layer.empty).pipe(
|
|
313
|
-
Layer.provideMerge(stackEffect.state ?? Layer.empty),
|
|
314
|
-
Layer.provideMerge(stackConfigLayer(stackEffect.secrets)),
|
|
315
|
-
Layer.provideMerge(Layer.mergeAll(valueServices, shared)),
|
|
316
|
-
),
|
|
317
|
-
);
|
|
318
|
-
return { authProviders, context, stackEffect };
|
|
319
|
-
});
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
* Every provider's auth provider, merged into one registering layer. One
|
|
323
|
-
* provider whose auth fails to load is skipped with a warning, so it can't
|
|
324
|
-
* take every other provider's auth down with it.
|
|
325
|
-
*/
|
|
326
|
-
const contributedAuth = Effect.fn("contributedAuth")(function* () {
|
|
327
|
-
const layers = yield* Effect.forEach(
|
|
328
|
-
yield* Contributions.load(),
|
|
329
|
-
(provider) =>
|
|
330
|
-
provider.auth
|
|
331
|
-
? Contributions.resolve(provider, "auth", provider.auth).pipe(
|
|
332
|
-
Effect.catch((error) => Effect.as(Effect.logWarning(error.message), undefined)),
|
|
333
|
-
)
|
|
334
|
-
: Effect.void,
|
|
335
|
-
{ concurrency: "unbounded" },
|
|
336
|
-
);
|
|
337
|
-
return Layer.mergeAll(Layer.empty, ...layers.filter((layer) => layer !== undefined));
|
|
338
|
-
});
|
|
339
|
-
|
|
340
|
-
const buildContributedAuthProviders = Effect.fn("buildContributedAuthProviders")(
|
|
341
|
-
function* (options: {
|
|
342
|
-
readonly envFile: Option.Option<string>;
|
|
343
|
-
readonly profile: string;
|
|
344
|
-
readonly registry?: AuthProviders["Service"];
|
|
345
|
-
}) {
|
|
346
|
-
const authProviders = options.registry ?? {};
|
|
347
|
-
const shared = yield* sessionServices(options);
|
|
348
|
-
yield* Layer.build(
|
|
349
|
-
Layer.provide(
|
|
350
|
-
yield* contributedAuth(),
|
|
351
|
-
Layer.mergeAll(Layer.succeed(AuthProviders, authProviders), shared),
|
|
352
|
-
),
|
|
353
|
-
);
|
|
354
|
-
return authProviders;
|
|
355
|
-
},
|
|
356
|
-
);
|
|
357
|
-
|
|
358
|
-
const isMissingProviderConfig = Schema.is(
|
|
359
|
-
Schema.Struct({ _tag: Schema.Literals(["MissingProviderConfig"]) }),
|
|
360
|
-
);
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
* Every auth provider reachable from the current project: the built-ins, plus
|
|
364
|
-
* whatever the user's stack module registers when it is importable.
|
|
365
|
-
*/
|
|
366
|
-
const collectAuthProvidersUncached = Effect.fn("collectAuthProvidersUncached")(
|
|
367
|
-
function* (options: CollectAuthProvidersOptions) {
|
|
368
|
-
const authProviders: AuthProviders["Service"] = {};
|
|
369
|
-
yield* buildContributedAuthProviders({
|
|
370
|
-
envFile: options.envFile,
|
|
371
|
-
profile: options.profile,
|
|
372
|
-
registry: authProviders,
|
|
373
|
-
});
|
|
374
|
-
|
|
375
|
-
const fs = yield* FileSystem.FileSystem;
|
|
376
|
-
const entrypointExists = yield* fs.exists(options.main);
|
|
377
|
-
const missingDefault = options.main === DEFAULT_ENTRYPOINT && !entrypointExists;
|
|
378
|
-
if (!entrypointExists && !missingDefault) {
|
|
379
|
-
return yield* AuthError.make({
|
|
380
|
-
message: `Stack entrypoint '${options.main}' does not exist.`,
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
if (!missingDefault) {
|
|
384
|
-
yield* buildStackProviders({ ...options, registry: authProviders }).pipe(
|
|
385
|
-
Effect.timeoutOption(Duration.seconds(15)),
|
|
386
|
-
Effect.catchCause((cause) => {
|
|
387
|
-
const suppressed = cause.reasons.some((reason) => {
|
|
388
|
-
const error = Cause.isFailReason(reason)
|
|
389
|
-
? reason.error
|
|
390
|
-
: Cause.isDieReason(reason)
|
|
391
|
-
? reason.defect
|
|
392
|
-
: undefined;
|
|
393
|
-
return isMissingProviderConfig(error);
|
|
394
|
-
});
|
|
395
|
-
return suppressed
|
|
396
|
-
? Effect.void
|
|
397
|
-
: Effect.fail(
|
|
398
|
-
AuthError.make({
|
|
399
|
-
message: `Could not load auth providers from '${options.main}'.`,
|
|
400
|
-
cause,
|
|
401
|
-
}),
|
|
402
|
-
);
|
|
403
|
-
}),
|
|
404
|
-
);
|
|
405
|
-
}
|
|
406
|
-
return authProviders;
|
|
407
|
-
},
|
|
408
|
-
Effect.provideService(SuppressMissingProviderConfig, true),
|
|
409
|
-
);
|
|
410
|
-
|
|
411
|
-
export const collectAuthProviders = Effect.fn("collectAuthProviders")(function* (
|
|
412
|
-
options: CollectAuthProvidersOptions,
|
|
413
|
-
) {
|
|
414
|
-
return yield* (yield* RouteCache).authProviders(options);
|
|
415
|
-
});
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import * as Effect from "effect/Effect";
|
|
2
|
-
import * as EngineDrift from "../../Drift.ts";
|
|
3
|
-
import type { Plan } from "../../Plan.ts";
|
|
4
|
-
import { applySession, Progress, withSpanEvents } from "../Progress.ts";
|
|
5
|
-
import { open, type Session, type StackTarget } from "../Session.ts";
|
|
6
|
-
import * as Stack from "./stack.ts";
|
|
7
|
-
|
|
8
|
-
export interface DriftedResource {
|
|
9
|
-
readonly fqn: string;
|
|
10
|
-
readonly logicalId: string;
|
|
11
|
-
readonly resourceType: string;
|
|
12
|
-
readonly status: "in-sync" | "drifted" | "missing";
|
|
13
|
-
readonly actual?: unknown;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface DriftSnapshot {
|
|
17
|
-
readonly stack: { readonly name: string; readonly stage: string };
|
|
18
|
-
readonly resources: ReadonlyArray<DriftedResource>;
|
|
19
|
-
readonly repairPlan: {
|
|
20
|
-
readonly summary: Stack.PlanSummary;
|
|
21
|
-
readonly native: Plan;
|
|
22
|
-
};
|
|
23
|
-
/** The session drift was inspected under; {@link repair} runs in it. */
|
|
24
|
-
readonly session: Session;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/** Whether the drift check found anything worth repairing. */
|
|
28
|
-
export const hasDrift = (snapshot: DriftSnapshot): boolean =>
|
|
29
|
-
snapshot.resources.some(
|
|
30
|
-
(resource) => resource.status === "drifted" || resource.status === "missing",
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
const status = (action: string) =>
|
|
34
|
-
action === "unchanged"
|
|
35
|
-
? ("in-sync" as const)
|
|
36
|
-
: action === "missing"
|
|
37
|
-
? ("missing" as const)
|
|
38
|
-
: ("drifted" as const);
|
|
39
|
-
|
|
40
|
-
/** Compare deployed state against the real cloud and plan the repair. */
|
|
41
|
-
export const inspect = Effect.fn("Alchemist.drift.inspect")(function* (target: StackTarget) {
|
|
42
|
-
const report = withSpanEvents(yield* Progress);
|
|
43
|
-
// `open` emits importing-module / resolving-services at the real work
|
|
44
|
-
// boundaries; hand it the wrapped reporter so they land in traces too.
|
|
45
|
-
const session = yield* open(target).pipe(Effect.provideService(Progress, report));
|
|
46
|
-
const identity = {
|
|
47
|
-
name: session.stack.name,
|
|
48
|
-
stage: session.stack.stage,
|
|
49
|
-
};
|
|
50
|
-
const { result, plan } = yield* EngineDrift.plan(identity).pipe(
|
|
51
|
-
// The engine's phase and per-resource observation events flow through
|
|
52
|
-
// the same wrapped reporter; drift-flavored wording is the renderer's
|
|
53
|
-
// job (renderPlanning's computingLabel).
|
|
54
|
-
Effect.provideService(Progress, report),
|
|
55
|
-
Effect.provide(session.context),
|
|
56
|
-
);
|
|
57
|
-
yield* report({ _tag: "plan.phase", phase: "plan-ready" });
|
|
58
|
-
return {
|
|
59
|
-
stack: identity,
|
|
60
|
-
resources: Object.values(result.resources)
|
|
61
|
-
.filter((resource) => resource.action !== "skipped")
|
|
62
|
-
.map((resource) => ({
|
|
63
|
-
fqn: resource.fqn,
|
|
64
|
-
logicalId: resource.logicalId,
|
|
65
|
-
resourceType: resource.resourceType,
|
|
66
|
-
status: status(resource.action),
|
|
67
|
-
actual: resource.attr,
|
|
68
|
-
})),
|
|
69
|
-
repairPlan: { summary: Stack.summarize(plan), native: plan },
|
|
70
|
-
session,
|
|
71
|
-
} satisfies DriftSnapshot;
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Converge state back to the cloud's actual shape. Engine apply events are
|
|
76
|
-
* reported through {@link Progress}.
|
|
77
|
-
*/
|
|
78
|
-
export const repair = Effect.fn("Alchemist.drift.repair")(function* (snapshot: DriftSnapshot) {
|
|
79
|
-
const report = withSpanEvents(yield* Progress);
|
|
80
|
-
return yield* Effect.provide(
|
|
81
|
-
EngineDrift.repair(
|
|
82
|
-
{ name: snapshot.stack.name, stage: snapshot.stack.stage },
|
|
83
|
-
{ session: applySession(report) },
|
|
84
|
-
),
|
|
85
|
-
snapshot.session.context,
|
|
86
|
-
);
|
|
87
|
-
});
|