alchemy 2.0.0-beta.84 → 2.0.0-beta.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_LICENSES.md +2 -2
- package/bin/cli.js +14 -6
- package/bin/register-oxc.js +16 -12
- package/lib/AdoptPolicy.d.ts +73 -0
- package/lib/AdoptPolicy.d.ts.map +1 -1
- package/lib/AdoptPolicy.js +54 -0
- package/lib/AdoptPolicy.js.map +1 -1
- package/lib/Alchemist/AuthRegistry.d.ts +31 -0
- package/lib/Alchemist/AuthRegistry.d.ts.map +1 -0
- package/lib/Alchemist/AuthRegistry.js +95 -0
- package/lib/Alchemist/AuthRegistry.js.map +1 -0
- package/lib/Alchemist/Drift.d.ts +70 -0
- package/lib/Alchemist/Drift.d.ts.map +1 -0
- package/lib/Alchemist/Drift.js +54 -0
- package/lib/Alchemist/Drift.js.map +1 -0
- package/lib/Alchemist/Entrypoint.d.ts +27 -3
- package/lib/Alchemist/Entrypoint.d.ts.map +1 -1
- package/lib/Alchemist/Entrypoint.js +34 -3
- package/lib/Alchemist/Entrypoint.js.map +1 -1
- package/lib/Alchemist/Errors.d.ts +1 -1
- package/lib/Alchemist/Errors.d.ts.map +1 -1
- package/lib/Alchemist/Errors.js +1 -1
- package/lib/Alchemist/Errors.js.map +1 -1
- package/lib/Alchemist/Logs.d.ts +46 -0
- package/lib/Alchemist/Logs.d.ts.map +1 -0
- package/lib/Alchemist/{routes/logs.js → Logs.js} +21 -26
- package/lib/Alchemist/Logs.js.map +1 -0
- package/lib/Alchemist/Nuke.d.ts +69 -0
- package/lib/Alchemist/Nuke.d.ts.map +1 -0
- package/lib/Alchemist/Nuke.js +35 -0
- package/lib/Alchemist/Nuke.js.map +1 -0
- package/lib/Alchemist/Operations.d.ts +168 -0
- package/lib/Alchemist/Operations.d.ts.map +1 -0
- package/lib/Alchemist/Operations.js +165 -0
- package/lib/Alchemist/Operations.js.map +1 -0
- package/lib/Alchemist/Profile.d.ts +132 -0
- package/lib/Alchemist/Profile.d.ts.map +1 -0
- package/lib/Alchemist/{routes/profile.js → Profile.js} +20 -21
- package/lib/Alchemist/Profile.js.map +1 -0
- package/lib/Alchemist/{routes/provider.d.ts → Provider.d.ts} +4 -4
- package/lib/Alchemist/Provider.d.ts.map +1 -0
- package/lib/Alchemist/{routes/provider.js → Provider.js} +7 -6
- package/lib/Alchemist/Provider.js.map +1 -0
- package/lib/Alchemist/Runtime.d.ts +10 -6
- package/lib/Alchemist/Runtime.d.ts.map +1 -1
- package/lib/Alchemist/Runtime.js +38 -2
- package/lib/Alchemist/Runtime.js.map +1 -1
- package/lib/Alchemist/{routes/state.d.ts → State.d.ts} +36 -16
- package/lib/Alchemist/State.d.ts.map +1 -0
- package/lib/Alchemist/{routes/state.js → State.js} +50 -15
- package/lib/Alchemist/State.js.map +1 -0
- package/lib/Alchemist/index.d.ts +11 -10
- package/lib/Alchemist/index.d.ts.map +1 -1
- package/lib/Alchemist/index.js +10 -9
- package/lib/Alchemist/index.js.map +1 -1
- package/lib/Apply.d.ts +2 -8
- package/lib/Apply.d.ts.map +1 -1
- package/lib/Apply.js +364 -184
- package/lib/Apply.js.map +1 -1
- package/lib/Auth/AuthProvider.d.ts +24 -11
- package/lib/Auth/AuthProvider.d.ts.map +1 -1
- package/lib/Auth/AuthProvider.js +28 -12
- package/lib/Auth/AuthProvider.js.map +1 -1
- package/lib/Auth/BrowserOAuth.d.ts +6 -8
- package/lib/Auth/BrowserOAuth.d.ts.map +1 -1
- package/lib/Auth/BrowserOAuth.js +25 -41
- package/lib/Auth/BrowserOAuth.js.map +1 -1
- package/lib/Auth/Credentials.d.ts.map +1 -1
- package/lib/Auth/Credentials.js +2 -2
- package/lib/Auth/Credentials.js.map +1 -1
- package/lib/Auth/Demand.d.ts +4 -4
- package/lib/Auth/Demand.d.ts.map +1 -1
- package/lib/Auth/Demand.js +16 -10
- package/lib/Auth/Demand.js.map +1 -1
- package/lib/Auth/Env.d.ts +2 -1
- package/lib/Auth/Env.d.ts.map +1 -1
- package/lib/Auth/Env.js +4 -2
- package/lib/Auth/Env.js.map +1 -1
- package/lib/Auth/Inspect.d.ts +2 -2
- package/lib/Auth/Inspect.d.ts.map +1 -1
- package/lib/Auth/Inspect.js +3 -1
- package/lib/Auth/Inspect.js.map +1 -1
- package/lib/Auth/Lock.d.ts.map +1 -1
- package/lib/Auth/Lock.js +4 -8
- package/lib/Auth/Lock.js.map +1 -1
- package/lib/Auth/OAuthFlow.d.ts +3 -12
- package/lib/Auth/OAuthFlow.d.ts.map +1 -1
- package/lib/Auth/OAuthFlow.js +7 -17
- package/lib/Auth/OAuthFlow.js.map +1 -1
- package/lib/Auth/Paths.d.ts +2 -1
- package/lib/Auth/Paths.d.ts.map +1 -1
- package/lib/Auth/Paths.js +3 -2
- package/lib/Auth/Paths.js.map +1 -1
- package/lib/Auth/Profile.d.ts +10 -0
- package/lib/Auth/Profile.d.ts.map +1 -1
- package/lib/Auth/Profile.js +19 -2
- package/lib/Auth/Profile.js.map +1 -1
- package/lib/Auth/Registry.d.ts +20 -0
- package/lib/Auth/Registry.d.ts.map +1 -0
- package/lib/Auth/Registry.js +17 -0
- package/lib/Auth/Registry.js.map +1 -0
- package/lib/Auth/Resolve.d.ts +34 -2
- package/lib/Auth/Resolve.d.ts.map +1 -1
- package/lib/Auth/Resolve.js +51 -3
- package/lib/Auth/Resolve.js.map +1 -1
- package/lib/Auth/StoredAuthProvider.d.ts +1 -1
- package/lib/Auth/StoredAuthProvider.d.ts.map +1 -1
- package/lib/Auth/StoredAuthProvider.js +1 -2
- package/lib/Auth/StoredAuthProvider.js.map +1 -1
- package/lib/Binding.d.ts.map +1 -1
- package/lib/Binding.js +3 -1
- package/lib/Binding.js.map +1 -1
- package/lib/Bundle/Bundle.d.ts +5 -0
- package/lib/Bundle/Bundle.d.ts.map +1 -1
- package/lib/Bundle/Bundle.js +36 -6
- package/lib/Bundle/Bundle.js.map +1 -1
- package/lib/Bundle/NamespaceImportPlugin.d.ts +55 -0
- package/lib/Bundle/NamespaceImportPlugin.d.ts.map +1 -0
- package/lib/Bundle/NamespaceImportPlugin.js +226 -0
- package/lib/Bundle/NamespaceImportPlugin.js.map +1 -0
- package/lib/Bundle/index.d.ts +1 -0
- package/lib/Bundle/index.d.ts.map +1 -1
- package/lib/Bundle/index.js +1 -0
- package/lib/Bundle/index.js.map +1 -1
- package/lib/Cli/Format.d.ts.map +1 -1
- package/lib/Cli/Format.js +2 -1
- package/lib/Cli/Format.js.map +1 -1
- package/lib/Cli/GlobalLog.d.ts +72 -26
- package/lib/Cli/GlobalLog.d.ts.map +1 -1
- package/lib/Cli/GlobalLog.js +151 -59
- package/lib/Cli/GlobalLog.js.map +1 -1
- package/lib/Cli/LoggingCli.d.ts.map +1 -1
- package/lib/Cli/LoggingCli.js +24 -18
- package/lib/Cli/LoggingCli.js.map +1 -1
- package/lib/Cli/PlainCliFormatter.d.ts.map +1 -1
- package/lib/Cli/PlainCliFormatter.js +4 -1
- package/lib/Cli/PlainCliFormatter.js.map +1 -1
- package/lib/Cli/Present.d.ts +14 -0
- package/lib/Cli/Present.d.ts.map +1 -0
- package/lib/Cli/Present.js +22 -0
- package/lib/Cli/Present.js.map +1 -0
- package/lib/Cli/SigilRenderer.d.ts +58 -0
- package/lib/Cli/SigilRenderer.d.ts.map +1 -0
- package/lib/Cli/SigilRenderer.js +39 -0
- package/lib/Cli/SigilRenderer.js.map +1 -0
- package/lib/Cli/checkVersion.d.ts +11 -14
- package/lib/Cli/checkVersion.d.ts.map +1 -1
- package/lib/Cli/checkVersion.js +19 -77
- package/lib/Cli/checkVersion.js.map +1 -1
- package/lib/Cli/commands/confirm.d.ts +2 -2
- package/lib/Cli/commands/confirm.d.ts.map +1 -1
- package/lib/Cli/commands/confirm.js +3 -3
- package/lib/Cli/commands/confirm.js.map +1 -1
- package/lib/Cli/commands/deploy.d.ts +4 -4
- package/lib/Cli/commands/deploy.d.ts.map +1 -1
- package/lib/Cli/commands/deploy.js +40 -39
- package/lib/Cli/commands/deploy.js.map +1 -1
- package/lib/Cli/commands/dev.d.ts.map +1 -1
- package/lib/Cli/commands/dev.js +41 -3
- package/lib/Cli/commands/dev.js.map +1 -1
- package/lib/Cli/commands/drift.d.ts +2 -2
- package/lib/Cli/commands/drift.d.ts.map +1 -1
- package/lib/Cli/commands/drift.js +14 -13
- package/lib/Cli/commands/drift.js.map +1 -1
- package/lib/Cli/commands/errors.d.ts.map +1 -1
- package/lib/Cli/commands/errors.js +2 -1
- package/lib/Cli/commands/errors.js.map +1 -1
- package/lib/Cli/commands/instrument.d.ts +15 -5
- package/lib/Cli/commands/instrument.d.ts.map +1 -1
- package/lib/Cli/commands/instrument.js +33 -8
- package/lib/Cli/commands/instrument.js.map +1 -1
- package/lib/Cli/commands/logs.d.ts +1 -1
- package/lib/Cli/commands/logs.d.ts.map +1 -1
- package/lib/Cli/commands/logs.js +22 -22
- package/lib/Cli/commands/logs.js.map +1 -1
- package/lib/Cli/commands/nuke.d.ts +3 -2
- package/lib/Cli/commands/nuke.d.ts.map +1 -1
- package/lib/Cli/commands/nuke.js +19 -17
- package/lib/Cli/commands/nuke.js.map +1 -1
- package/lib/Cli/commands/profile/commands.d.ts +3 -2
- package/lib/Cli/commands/profile/commands.d.ts.map +1 -1
- package/lib/Cli/commands/profile/commands.js +26 -27
- package/lib/Cli/commands/profile/commands.js.map +1 -1
- package/lib/Cli/commands/profile/flows.d.ts +6 -5
- package/lib/Cli/commands/profile/flows.d.ts.map +1 -1
- package/lib/Cli/commands/profile/flows.js +19 -17
- package/lib/Cli/commands/profile/flows.js.map +1 -1
- package/lib/Cli/commands/profile/hub.d.ts +1 -2
- package/lib/Cli/commands/profile/hub.d.ts.map +1 -1
- package/lib/Cli/commands/profile/hub.js +15 -17
- package/lib/Cli/commands/profile/hub.js.map +1 -1
- package/lib/Cli/commands/provider.d.ts +3 -1
- package/lib/Cli/commands/provider.d.ts.map +1 -1
- package/lib/Cli/commands/provider.js +4 -4
- package/lib/Cli/commands/provider.js.map +1 -1
- package/lib/Cli/commands/render.d.ts +2 -4
- package/lib/Cli/commands/render.d.ts.map +1 -1
- package/lib/Cli/commands/render.js +33 -56
- package/lib/Cli/commands/render.js.map +1 -1
- package/lib/Cli/commands/state.d.ts +1 -2
- package/lib/Cli/commands/state.d.ts.map +1 -1
- package/lib/Cli/commands/state.js +74 -27
- package/lib/Cli/commands/state.js.map +1 -1
- package/lib/Cli/components/capabilities.d.ts +4 -0
- package/lib/Cli/components/capabilities.d.ts.map +1 -0
- package/lib/Cli/components/capabilities.js +18 -0
- package/lib/Cli/components/capabilities.js.map +1 -0
- package/lib/Cli/components/types.d.ts +2 -81
- package/lib/Cli/components/types.d.ts.map +1 -1
- package/lib/Cli/components/types.js +1 -3
- package/lib/Cli/components/types.js.map +1 -1
- package/lib/Cli/components/ui/Environment.d.ts +3 -3
- package/lib/Cli/components/ui/Environment.d.ts.map +1 -1
- package/lib/Cli/components/ui/Environment.js.map +1 -1
- package/lib/Cli/components/ui/Interactive.d.ts +17 -4
- package/lib/Cli/components/ui/Interactive.d.ts.map +1 -1
- package/lib/Cli/components/ui/Interactive.js +7 -11
- package/lib/Cli/components/ui/Interactive.js.map +1 -1
- package/lib/Cli/components/ui/Layout.d.ts +1 -1
- package/lib/Cli/components/ui/Layout.d.ts.map +1 -1
- package/lib/Cli/components/ui/Layout.js +1 -1
- package/lib/Cli/components/ui/Layout.js.map +1 -1
- package/lib/Cli/components/ui/Typography.d.ts +1 -1
- package/lib/Cli/components/ui/Typography.d.ts.map +1 -1
- package/lib/Cli/components/ui/Typography.js +1 -1
- package/lib/Cli/components/ui/Typography.js.map +1 -1
- package/lib/Cli/components/ui/index.d.ts +2 -2
- package/lib/Cli/components/ui/index.js +2 -2
- package/lib/Cli/components/view/ApprovePlan.d.ts +1 -1
- package/lib/Cli/components/view/ApprovePlan.d.ts.map +1 -1
- package/lib/Cli/components/view/ApprovePlan.js +2 -1
- package/lib/Cli/components/view/ApprovePlan.js.map +1 -1
- package/lib/Cli/components/view/Format.d.ts +5 -0
- package/lib/Cli/components/view/Format.d.ts.map +1 -0
- package/lib/Cli/components/view/Format.js +39 -0
- package/lib/Cli/components/view/Format.js.map +1 -0
- package/lib/Cli/components/view/Help.d.ts +2 -2
- package/lib/Cli/components/view/Help.d.ts.map +1 -1
- package/lib/Cli/components/view/Help.js +7 -5
- package/lib/Cli/components/view/Help.js.map +1 -1
- package/lib/Cli/components/view/Logo.js +1 -1
- package/lib/Cli/components/view/Logo.js.map +1 -1
- package/lib/Cli/components/view/Nuke.d.ts +8 -9
- package/lib/Cli/components/view/Nuke.d.ts.map +1 -1
- package/lib/Cli/components/view/Nuke.js +49 -52
- package/lib/Cli/components/view/Nuke.js.map +1 -1
- package/lib/Cli/components/view/PlanDecision.d.ts +1 -1
- package/lib/Cli/components/view/PlanDecision.d.ts.map +1 -1
- package/lib/Cli/components/view/PlanDecision.js +1 -1
- package/lib/Cli/components/view/PlanDecision.js.map +1 -1
- package/lib/Cli/components/view/PlanRow.js +1 -1
- package/lib/Cli/components/view/PlanRow.js.map +1 -1
- package/lib/Cli/components/view/PlanTree.d.ts +1 -1
- package/lib/Cli/components/view/PlanTree.d.ts.map +1 -1
- package/lib/Cli/components/view/PlanTree.js +1 -1
- package/lib/Cli/components/view/PlanView.js +1 -1
- package/lib/Cli/components/view/PlanView.js.map +1 -1
- package/lib/Cli/components/view/Profile.d.ts +1 -1
- package/lib/Cli/components/view/Profile.js +2 -2
- package/lib/Cli/components/view/Profile.js.map +1 -1
- package/lib/Cli/components/view/ProfileDashboard.d.ts +4 -4
- package/lib/Cli/components/view/ProfileDashboard.d.ts.map +1 -1
- package/lib/Cli/components/view/ProfileDashboard.js +9 -8
- package/lib/Cli/components/view/ProfileDashboard.js.map +1 -1
- package/lib/Cli/components/view/Prompts.d.ts +3 -3
- package/lib/Cli/components/view/Prompts.d.ts.map +1 -1
- package/lib/Cli/components/view/Prompts.js +11 -18
- package/lib/Cli/components/view/Prompts.js.map +1 -1
- package/lib/Cli/components/view/Runtime.d.ts +5 -5
- package/lib/Cli/components/view/Runtime.d.ts.map +1 -1
- package/lib/Cli/components/view/Runtime.js +136 -219
- package/lib/Cli/components/view/Runtime.js.map +1 -1
- package/lib/Cli/components/view/SigilCli.d.ts +2 -2
- package/lib/Cli/components/view/SigilCli.d.ts.map +1 -1
- package/lib/Cli/components/view/SigilCli.js +7 -7
- package/lib/Cli/components/view/SigilCli.js.map +1 -1
- package/lib/Cli/components/view/StateExplorer.d.ts +1 -1
- package/lib/Cli/components/view/StateExplorer.d.ts.map +1 -1
- package/lib/Cli/components/view/StateExplorer.js +2 -1
- package/lib/Cli/components/view/StateExplorer.js.map +1 -1
- package/lib/Cli/components/view/statusStyle.d.ts +2 -2
- package/lib/Cli/components/view/statusStyle.d.ts.map +1 -1
- package/lib/Cli/components/view/statusStyle.js +1 -1
- package/lib/Cli/components/view/statusStyle.js.map +1 -1
- package/lib/Cli/exec.d.ts +6 -1
- package/lib/Cli/exec.d.ts.map +1 -1
- package/lib/Cli/exec.js +29 -34
- package/lib/Cli/exec.js.map +1 -1
- package/lib/Cli/main.d.ts.map +1 -1
- package/lib/Cli/main.js +35 -26
- package/lib/Cli/main.js.map +1 -1
- package/lib/Cli/selectCli.d.ts +2 -2
- package/lib/Cli/selectCli.d.ts.map +1 -1
- package/lib/Cli/selectCli.js +2 -2
- package/lib/Cli/selectCli.js.map +1 -1
- package/lib/Command/Command.js +1 -1
- package/lib/Command/Command.js.map +1 -1
- package/lib/Command/Dev.d.ts +58 -4
- package/lib/Command/Dev.d.ts.map +1 -1
- package/lib/Command/Dev.js +87 -30
- package/lib/Command/Dev.js.map +1 -1
- package/lib/Command/Local.d.ts +1 -1
- package/lib/Command/Memo.js +1 -1
- package/lib/Command/Memo.js.map +1 -1
- package/lib/Command/Providers.d.ts +1 -1
- package/lib/Command/Providers.d.ts.map +1 -1
- package/lib/Contributions.d.ts +2 -3
- package/lib/Contributions.d.ts.map +1 -1
- package/lib/Contributions.js +38 -6
- package/lib/Contributions.js.map +1 -1
- package/lib/DNS/Adapter.d.ts +204 -0
- package/lib/DNS/Adapter.d.ts.map +1 -0
- package/lib/DNS/Adapter.js +112 -0
- package/lib/DNS/Adapter.js.map +1 -0
- package/lib/DNS/index.d.ts +2 -0
- package/lib/DNS/index.d.ts.map +1 -0
- package/lib/DNS/index.js +2 -0
- package/lib/DNS/index.js.map +1 -0
- package/lib/Deploy.d.ts +7 -2
- package/lib/Deploy.d.ts.map +1 -1
- package/lib/Deploy.js +8 -3
- package/lib/Deploy.js.map +1 -1
- package/lib/Destroy.d.ts +5 -8
- package/lib/Destroy.d.ts.map +1 -1
- package/lib/Destroy.js +10 -7
- package/lib/Destroy.js.map +1 -1
- package/lib/Diff.d.ts.map +1 -1
- package/lib/Diff.js +14 -4
- package/lib/Diff.js.map +1 -1
- package/lib/Drift.d.ts +7 -7
- package/lib/Drift.d.ts.map +1 -1
- package/lib/Drift.js +184 -101
- package/lib/Drift.js.map +1 -1
- package/lib/EvalStack.d.ts +23 -0
- package/lib/EvalStack.d.ts.map +1 -0
- package/lib/EvalStack.js +47 -0
- package/lib/EvalStack.js.map +1 -0
- package/lib/Events.d.ts +210 -0
- package/lib/Events.d.ts.map +1 -0
- package/lib/Events.js +244 -0
- package/lib/Events.js.map +1 -0
- package/lib/Interaction.d.ts +159 -48
- package/lib/Interaction.d.ts.map +1 -1
- package/lib/Interaction.js +139 -58
- package/lib/Interaction.js.map +1 -1
- package/lib/Local/LocalProvider.d.ts.map +1 -1
- package/lib/Local/LocalProvider.js +31 -9
- package/lib/Local/LocalProvider.js.map +1 -1
- package/lib/Local/RpcProvider.d.ts.map +1 -1
- package/lib/Local/RpcProvider.js +10 -1
- package/lib/Local/RpcProvider.js.map +1 -1
- package/lib/Local/RpcProviderProxy.d.ts +16 -0
- package/lib/Local/RpcProviderProxy.d.ts.map +1 -1
- package/lib/Local/RpcProviderProxy.js +19 -10
- package/lib/Local/RpcProviderProxy.js.map +1 -1
- package/lib/Local/RpcSerialization.d.ts +3 -2
- package/lib/Local/RpcSerialization.d.ts.map +1 -1
- package/lib/Local/RpcSerialization.js +13 -10
- package/lib/Local/RpcSerialization.js.map +1 -1
- package/lib/Local/RpcServer.d.ts +2 -1
- package/lib/Local/RpcServer.d.ts.map +1 -1
- package/lib/Local/RpcServer.js +19 -14
- package/lib/Local/RpcServer.js.map +1 -1
- package/lib/Local/RpcServerBun.d.ts.map +1 -1
- package/lib/Local/RpcServerBun.js +8 -4
- package/lib/Local/RpcServerBun.js.map +1 -1
- package/lib/Local/RpcServerEnvironment.d.ts +2 -3
- package/lib/Local/RpcServerEnvironment.d.ts.map +1 -1
- package/lib/Local/RpcServerEnvironment.js +2 -2
- package/lib/Local/RpcServerEnvironment.js.map +1 -1
- package/lib/Local/RpcServerNode.d.ts.map +1 -1
- package/lib/Local/RpcServerNode.js +5 -1
- package/lib/Local/RpcServerNode.js.map +1 -1
- package/lib/Local/RpcServerSession.d.ts +1 -1
- package/lib/Local/RpcServerSession.d.ts.map +1 -1
- package/lib/Local/RpcServerSession.js.map +1 -1
- package/lib/Local/RpcSpawner.d.ts +6 -8
- package/lib/Local/RpcSpawner.d.ts.map +1 -1
- package/lib/Local/RpcSpawner.js +45 -36
- package/lib/Local/RpcSpawner.js.map +1 -1
- package/lib/Local/Sidecar.d.ts +23 -0
- package/lib/Local/Sidecar.d.ts.map +1 -1
- package/lib/Local/Sidecar.js +14 -9
- package/lib/Local/Sidecar.js.map +1 -1
- package/lib/Nuke.d.ts +5 -23
- package/lib/Nuke.d.ts.map +1 -1
- package/lib/Nuke.js +48 -13
- package/lib/Nuke.js.map +1 -1
- package/lib/Output.d.ts +19 -1
- package/lib/Output.d.ts.map +1 -1
- package/lib/Output.js +96 -3
- package/lib/Output.js.map +1 -1
- package/lib/Plan.d.ts +5 -1
- package/lib/Plan.d.ts.map +1 -1
- package/lib/Plan.js +111 -33
- package/lib/Plan.js.map +1 -1
- package/lib/Platform.d.ts.map +1 -1
- package/lib/Platform.js +31 -7
- package/lib/Platform.js.map +1 -1
- package/lib/Provider.d.ts +45 -0
- package/lib/Provider.d.ts.map +1 -1
- package/lib/Provider.js +2 -2
- package/lib/Provider.js.map +1 -1
- package/lib/Report.d.ts +17 -195
- package/lib/Report.d.ts.map +1 -1
- package/lib/Report.js +39 -12
- package/lib/Report.js.map +1 -1
- package/lib/Runtime/ManagedHttpShutdown.d.ts +17 -0
- package/lib/Runtime/ManagedHttpShutdown.d.ts.map +1 -1
- package/lib/Runtime/ManagedHttpShutdown.js +11 -2
- package/lib/Runtime/ManagedHttpShutdown.js.map +1 -1
- package/lib/RuntimeContext.js +1 -1
- package/lib/RuntimeContext.js.map +1 -1
- package/lib/Stack.d.ts +49 -29
- package/lib/Stack.d.ts.map +1 -1
- package/lib/Stack.js +25 -31
- package/lib/Stack.js.map +1 -1
- package/lib/State/BucketState.d.ts.map +1 -1
- package/lib/State/BucketState.js +43 -14
- package/lib/State/BucketState.js.map +1 -1
- package/lib/State/LocalState.d.ts.map +1 -1
- package/lib/State/LocalState.js +3 -3
- package/lib/State/LocalState.js.map +1 -1
- package/lib/State/Provisioning.d.ts +5 -0
- package/lib/State/Provisioning.d.ts.map +1 -1
- package/lib/State/Provisioning.js +3 -1
- package/lib/State/Provisioning.js.map +1 -1
- package/lib/State/ResourceState.d.ts +2 -0
- package/lib/State/ResourceState.d.ts.map +1 -1
- package/lib/State/State.d.ts +26 -0
- package/lib/State/State.d.ts.map +1 -1
- package/lib/State/StateEncoding.d.ts +7 -0
- package/lib/State/StateEncoding.d.ts.map +1 -1
- package/lib/State/StateEncoding.js +19 -0
- package/lib/State/StateEncoding.js.map +1 -1
- package/lib/State/index.js +2 -2
- package/lib/State/index.js.map +1 -1
- package/lib/Telemetry/Layer.d.ts +2 -5
- package/lib/Telemetry/Layer.d.ts.map +1 -1
- package/lib/Telemetry/Layer.js +3 -23
- package/lib/Telemetry/Layer.js.map +1 -1
- package/lib/Telemetry/Metrics.d.ts +1 -1
- package/lib/Telemetry/Metrics.d.ts.map +1 -1
- package/lib/TelemetryRelay.js +1 -1
- package/lib/TelemetryRelay.js.map +1 -1
- package/lib/TelemetryRuntime.d.ts +1 -1
- package/lib/TelemetryRuntime.d.ts.map +1 -1
- package/lib/TelemetryRuntime.js +4 -3
- package/lib/TelemetryRuntime.js.map +1 -1
- package/lib/Util/ConsoleSink.d.ts +23 -2
- package/lib/Util/ConsoleSink.d.ts.map +1 -1
- package/lib/Util/ConsoleSink.js +54 -14
- package/lib/Util/ConsoleSink.js.map +1 -1
- package/lib/Util/LogAnnotation.d.ts +19 -0
- package/lib/Util/LogAnnotation.d.ts.map +1 -0
- package/lib/Util/LogAnnotation.js +19 -0
- package/lib/Util/LogAnnotation.js.map +1 -0
- package/lib/Util/LogRecord.d.ts +281 -0
- package/lib/Util/LogRecord.d.ts.map +1 -0
- package/lib/Util/LogRecord.js +267 -0
- package/lib/Util/LogRecord.js.map +1 -0
- package/lib/Util/Node.d.ts +9 -0
- package/lib/Util/Node.d.ts.map +1 -1
- package/lib/Util/Node.js +10 -6
- package/lib/Util/Node.js.map +1 -1
- package/lib/Util/PlatformServices.d.ts +3 -2
- package/lib/Util/PlatformServices.d.ts.map +1 -1
- package/lib/Util/PlatformServices.js +6 -2
- package/lib/Util/PlatformServices.js.map +1 -1
- package/lib/Util/ResourceOutput.d.ts +18 -10
- package/lib/Util/ResourceOutput.d.ts.map +1 -1
- package/lib/Util/ResourceOutput.js +22 -23
- package/lib/Util/ResourceOutput.js.map +1 -1
- package/lib/Util/Shutdown.d.ts +10 -0
- package/lib/Util/Shutdown.d.ts.map +1 -0
- package/lib/Util/Shutdown.js +32 -0
- package/lib/Util/Shutdown.js.map +1 -0
- package/lib/Util/Terminal.d.ts +2 -4
- package/lib/Util/Terminal.d.ts.map +1 -1
- package/lib/Util/Terminal.js +3 -11
- package/lib/Util/Terminal.js.map +1 -1
- package/lib/Util/TraceParent.d.ts +32 -0
- package/lib/Util/TraceParent.d.ts.map +1 -0
- package/lib/Util/TraceParent.js +42 -0
- package/lib/Util/TraceParent.js.map +1 -0
- package/lib/Util/base64.d.ts +7 -0
- package/lib/Util/base64.d.ts.map +1 -0
- package/lib/Util/base64.js +24 -0
- package/lib/Util/base64.js.map +1 -0
- package/lib/Util/cached-function.d.ts +5 -0
- package/lib/Util/cached-function.d.ts.map +1 -1
- package/lib/Util/cached-function.js +13 -8
- package/lib/Util/cached-function.js.map +1 -1
- package/lib/Util/data.d.ts +1 -1
- package/lib/Util/data.d.ts.map +1 -1
- package/lib/Util/data.js +1 -1
- package/lib/Util/data.js.map +1 -1
- package/lib/Util/equal.d.ts.map +1 -1
- package/lib/Util/equal.js +3 -2
- package/lib/Util/equal.js.map +1 -1
- package/lib/Util/extraFiles.d.ts.map +1 -1
- package/lib/Util/extraFiles.js +5 -5
- package/lib/Util/extraFiles.js.map +1 -1
- package/lib/Util/interactive.js +1 -1
- package/lib/Website/AstroOutput.d.ts +42 -0
- package/lib/Website/AstroOutput.d.ts.map +1 -0
- package/lib/Website/AstroOutput.js +34 -0
- package/lib/Website/AstroOutput.js.map +1 -0
- package/lib/Website/FrontendCore.d.ts +1 -1
- package/lib/Workflows.d.ts +9 -0
- package/lib/Workflows.d.ts.map +1 -1
- package/lib/Workflows.js +8 -0
- package/lib/Workflows.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +21 -28
- package/src/AdoptPolicy.ts +76 -0
- package/src/Alchemist/AuthRegistry.ts +164 -0
- package/src/Alchemist/Drift.ts +103 -0
- package/src/Alchemist/Entrypoint.ts +51 -3
- package/src/Alchemist/Errors.ts +1 -1
- package/src/Alchemist/{routes/logs.ts → Logs.ts} +28 -30
- package/src/Alchemist/Nuke.ts +90 -0
- package/src/Alchemist/Operations.ts +309 -0
- package/src/Alchemist/{routes/profile.ts → Profile.ts} +22 -22
- package/src/Alchemist/{routes/provider.ts → Provider.ts} +7 -6
- package/src/Alchemist/Runtime.ts +46 -12
- package/src/Alchemist/{routes/state.ts → State.ts} +78 -21
- package/src/Alchemist/index.ts +32 -15
- package/src/Apply.ts +513 -274
- package/src/Auth/AuthProvider.ts +76 -23
- package/src/Auth/BrowserOAuth.ts +37 -60
- package/src/Auth/Credentials.ts +2 -4
- package/src/Auth/Demand.ts +27 -18
- package/src/Auth/Env.ts +13 -8
- package/src/Auth/Inspect.ts +5 -2
- package/src/Auth/Lock.ts +4 -8
- package/src/Auth/OAuthFlow.ts +12 -26
- package/src/Auth/Paths.ts +3 -2
- package/src/Auth/Profile.ts +30 -2
- package/src/Auth/Registry.ts +27 -0
- package/src/Auth/Resolve.ts +75 -3
- package/src/Auth/StoredAuthProvider.ts +1 -2
- package/src/Binding.ts +3 -4
- package/src/Bundle/Bundle.ts +58 -7
- package/src/Bundle/NamespaceImportPlugin.ts +259 -0
- package/src/Bundle/index.ts +1 -0
- package/src/Cli/Format.ts +2 -1
- package/src/Cli/GlobalLog.ts +206 -68
- package/src/Cli/LoggingCli.ts +33 -20
- package/src/Cli/PlainCliFormatter.ts +4 -1
- package/src/Cli/Present.ts +34 -0
- package/src/Cli/SigilRenderer.ts +75 -0
- package/src/Cli/checkVersion.ts +25 -78
- package/src/Cli/commands/confirm.ts +3 -3
- package/src/Cli/commands/deploy.ts +53 -44
- package/src/Cli/commands/dev.ts +65 -7
- package/src/Cli/commands/drift.ts +20 -16
- package/src/Cli/commands/errors.ts +2 -3
- package/src/Cli/commands/instrument.ts +39 -8
- package/src/Cli/commands/logs.ts +22 -30
- package/src/Cli/commands/nuke.ts +25 -26
- package/src/Cli/commands/profile/commands.ts +34 -34
- package/src/Cli/commands/profile/flows.ts +26 -20
- package/src/Cli/commands/profile/hub.ts +16 -18
- package/src/Cli/commands/provider.ts +4 -4
- package/src/Cli/commands/render.ts +43 -71
- package/src/Cli/commands/state.ts +113 -33
- package/src/Cli/components/capabilities.ts +20 -0
- package/src/Cli/components/types.ts +13 -99
- package/src/Cli/components/ui/Environment.tsx +5 -5
- package/src/Cli/components/ui/Interactive.tsx +24 -15
- package/src/Cli/components/ui/Layout.tsx +1 -1
- package/src/Cli/components/ui/Typography.tsx +1 -1
- package/src/Cli/components/ui/index.ts +2 -2
- package/src/Cli/components/view/ApprovePlan.tsx +2 -1
- package/src/Cli/components/view/Format.tsx +58 -0
- package/src/Cli/components/view/Help.tsx +14 -17
- package/src/Cli/components/view/Logo.tsx +1 -1
- package/src/Cli/components/view/Nuke.tsx +74 -49
- package/src/Cli/components/view/PlanDecision.tsx +1 -1
- package/src/Cli/components/view/PlanRow.tsx +1 -1
- package/src/Cli/components/view/PlanTree.ts +2 -2
- package/src/Cli/components/view/PlanView.tsx +2 -2
- package/src/Cli/components/view/Profile.tsx +2 -2
- package/src/Cli/components/view/ProfileDashboard.tsx +12 -11
- package/src/Cli/components/view/Prompts.tsx +37 -75
- package/src/Cli/components/view/Runtime.tsx +132 -238
- package/src/Cli/components/view/SigilCli.tsx +12 -12
- package/src/Cli/components/view/StateExplorer.tsx +2 -1
- package/src/Cli/components/view/statusStyle.ts +2 -2
- package/src/Cli/exec.ts +48 -41
- package/src/Cli/main.ts +52 -33
- package/src/Cli/selectCli.ts +3 -3
- package/src/Command/Command.ts +1 -1
- package/src/Command/Dev.ts +129 -36
- package/src/Command/Memo.ts +1 -1
- package/src/Contributions.ts +42 -8
- package/src/DNS/Adapter.ts +289 -0
- package/src/DNS/index.ts +1 -0
- package/src/Deploy.ts +11 -3
- package/src/Destroy.ts +19 -13
- package/src/Diff.ts +17 -4
- package/src/Drift.ts +256 -127
- package/src/EvalStack.ts +97 -0
- package/src/Events.ts +296 -0
- package/src/Interaction.ts +332 -97
- package/src/Local/LocalProvider.ts +40 -9
- package/src/Local/RpcProvider.ts +11 -1
- package/src/Local/RpcProviderProxy.ts +29 -21
- package/src/Local/RpcSerialization.ts +32 -17
- package/src/Local/RpcServer.ts +25 -17
- package/src/Local/RpcServerBun.ts +10 -6
- package/src/Local/RpcServerEnvironment.ts +2 -2
- package/src/Local/RpcServerNode.ts +8 -1
- package/src/Local/RpcServerSession.ts +2 -2
- package/src/Local/RpcSpawner.ts +61 -37
- package/src/Local/Sidecar.ts +10 -1
- package/src/Nuke.ts +66 -43
- package/src/Output.ts +120 -7
- package/src/Plan.ts +140 -52
- package/src/Platform.ts +47 -18
- package/src/Provider.ts +48 -3
- package/src/Report.ts +77 -275
- package/src/Runtime/ManagedHttpShutdown.ts +21 -4
- package/src/RuntimeContext.ts +1 -1
- package/src/Stack.ts +113 -135
- package/src/State/BucketState.ts +53 -21
- package/src/State/LocalState.ts +7 -9
- package/src/State/Provisioning.ts +8 -1
- package/src/State/ResourceState.ts +2 -0
- package/src/State/State.ts +30 -0
- package/src/State/StateEncoding.ts +22 -0
- package/src/State/index.ts +2 -2
- package/src/Telemetry/Layer.ts +3 -24
- package/src/Telemetry/Metrics.ts +1 -1
- package/src/TelemetryRelay.ts +1 -1
- package/src/TelemetryRuntime.ts +8 -8
- package/src/Util/ConsoleSink.ts +76 -13
- package/src/Util/LogAnnotation.ts +18 -0
- package/src/Util/LogRecord.ts +386 -0
- package/src/Util/Node.ts +20 -6
- package/src/Util/PlatformServices.ts +17 -4
- package/src/Util/ResourceOutput.ts +26 -25
- package/src/Util/Shutdown.ts +52 -0
- package/src/Util/Terminal.ts +3 -20
- package/src/Util/TraceParent.ts +70 -0
- package/src/Util/base64.ts +22 -0
- package/src/Util/cached-function.ts +30 -19
- package/src/Util/data.ts +2 -2
- package/src/Util/equal.ts +3 -2
- package/src/Util/extraFiles.ts +9 -8
- package/src/Util/interactive.ts +1 -1
- package/src/Website/AstroOutput.ts +83 -0
- package/src/Workflows.ts +11 -0
- package/src/index.ts +1 -0
- package/lib/Alchemist/Progress.d.ts +0 -16
- package/lib/Alchemist/Progress.d.ts.map +0 -1
- package/lib/Alchemist/Progress.js +0 -123
- package/lib/Alchemist/Progress.js.map +0 -1
- package/lib/Alchemist/Session.d.ts +0 -116
- package/lib/Alchemist/Session.d.ts.map +0 -1
- package/lib/Alchemist/Session.js +0 -212
- package/lib/Alchemist/Session.js.map +0 -1
- package/lib/Alchemist/routes/drift.d.ts +0 -55
- package/lib/Alchemist/routes/drift.d.ts.map +0 -1
- package/lib/Alchemist/routes/drift.js +0 -52
- package/lib/Alchemist/routes/drift.js.map +0 -1
- package/lib/Alchemist/routes/logs.d.ts +0 -41
- package/lib/Alchemist/routes/logs.d.ts.map +0 -1
- package/lib/Alchemist/routes/logs.js.map +0 -1
- package/lib/Alchemist/routes/nuke.d.ts +0 -46
- package/lib/Alchemist/routes/nuke.d.ts.map +0 -1
- package/lib/Alchemist/routes/nuke.js +0 -80
- package/lib/Alchemist/routes/nuke.js.map +0 -1
- package/lib/Alchemist/routes/profile.d.ts +0 -133
- package/lib/Alchemist/routes/profile.d.ts.map +0 -1
- package/lib/Alchemist/routes/profile.js.map +0 -1
- package/lib/Alchemist/routes/provider.d.ts.map +0 -1
- package/lib/Alchemist/routes/provider.js.map +0 -1
- package/lib/Alchemist/routes/stack.d.ts +0 -95
- package/lib/Alchemist/routes/stack.d.ts.map +0 -1
- package/lib/Alchemist/routes/stack.js +0 -73
- package/lib/Alchemist/routes/stack.js.map +0 -1
- package/lib/Alchemist/routes/state.d.ts.map +0 -1
- package/lib/Alchemist/routes/state.js.map +0 -1
- package/lib/Cli/CliKit/CliKit.d.ts +0 -92
- package/lib/Cli/CliKit/CliKit.d.ts.map +0 -1
- package/lib/Cli/CliKit/CliKit.js +0 -27
- package/lib/Cli/CliKit/CliKit.js.map +0 -1
- package/lib/Cli/CliKit/index.d.ts +0 -9
- package/lib/Cli/CliKit/index.d.ts.map +0 -1
- package/lib/Cli/CliKit/index.js +0 -9
- package/lib/Cli/CliKit/index.js.map +0 -1
- package/lib/Cli/CliKit/interaction.d.ts +0 -13
- package/lib/Cli/CliKit/interaction.d.ts.map +0 -1
- package/lib/Cli/CliKit/interaction.js +0 -17
- package/lib/Cli/CliKit/interaction.js.map +0 -1
- package/lib/Cli/CliKit/layer.d.ts +0 -7
- package/lib/Cli/CliKit/layer.d.ts.map +0 -1
- package/lib/Cli/CliKit/layer.js +0 -33
- package/lib/Cli/CliKit/layer.js.map +0 -1
- package/lib/Local/DevLog.d.ts +0 -32
- package/lib/Local/DevLog.d.ts.map +0 -1
- package/lib/Local/DevLog.js +0 -112
- package/lib/Local/DevLog.js.map +0 -1
- package/lib/Test/Alchemy.d.ts +0 -79
- package/lib/Test/Alchemy.d.ts.map +0 -1
- package/lib/Test/Alchemy.js +0 -193
- package/lib/Test/Alchemy.js.map +0 -1
- package/lib/Test/Bun.d.ts +0 -69
- package/lib/Test/Bun.d.ts.map +0 -1
- package/lib/Test/Bun.js +0 -126
- package/lib/Test/Bun.js.map +0 -1
- package/lib/Test/Core.d.ts +0 -277
- package/lib/Test/Core.d.ts.map +0 -1
- package/lib/Test/Core.js +0 -362
- package/lib/Test/Core.js.map +0 -1
- package/lib/Test/Http.d.ts +0 -109
- package/lib/Test/Http.d.ts.map +0 -1
- package/lib/Test/Http.js +0 -123
- package/lib/Test/Http.js.map +0 -1
- package/lib/Test/TestState.d.ts +0 -12
- package/lib/Test/TestState.d.ts.map +0 -1
- package/lib/Test/TestState.js +0 -15
- package/lib/Test/TestState.js.map +0 -1
- package/lib/Test/Vitest.d.ts +0 -60
- package/lib/Test/Vitest.d.ts.map +0 -1
- package/lib/Test/Vitest.js +0 -132
- package/lib/Test/Vitest.js.map +0 -1
- package/lib/Test/index.d.ts +0 -3
- package/lib/Test/index.d.ts.map +0 -1
- package/lib/Test/index.js +0 -3
- package/lib/Test/index.js.map +0 -1
- package/lib/Util/FileLogger.d.ts +0 -7
- package/lib/Util/FileLogger.d.ts.map +0 -1
- package/lib/Util/FileLogger.js +0 -16
- package/lib/Util/FileLogger.js.map +0 -1
- package/src/Alchemist/Progress.ts +0 -167
- package/src/Alchemist/Session.ts +0 -415
- package/src/Alchemist/routes/drift.ts +0 -87
- package/src/Alchemist/routes/nuke.ts +0 -131
- package/src/Alchemist/routes/stack.ts +0 -173
- package/src/Cli/CliKit/CliKit.ts +0 -159
- package/src/Cli/CliKit/index.ts +0 -41
- package/src/Cli/CliKit/interaction.ts +0 -19
- package/src/Cli/CliKit/layer.ts +0 -44
- package/src/Local/DevLog.ts +0 -122
- package/src/Test/Alchemy.ts +0 -334
- package/src/Test/Bun.ts +0 -230
- package/src/Test/Core.ts +0 -785
- package/src/Test/Http.ts +0 -201
- package/src/Test/TestState.ts +0 -35
- package/src/Test/Vitest.ts +0 -239
- package/src/Test/index.ts +0 -2
- package/src/Util/FileLogger.ts +0 -20
package/src/Plan.ts
CHANGED
|
@@ -10,7 +10,13 @@ import * as Option from "effect/Option";
|
|
|
10
10
|
import * as Ref from "effect/Ref";
|
|
11
11
|
import { asEffect } from ".//Util/types.ts";
|
|
12
12
|
import { isAction, type ActionLike } from "./Action.ts";
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
AdoptPolicy,
|
|
15
|
+
OwnedBySomeoneElse,
|
|
16
|
+
stripUnowned,
|
|
17
|
+
Unowned,
|
|
18
|
+
UnverifiableReplacement,
|
|
19
|
+
} from "./AdoptPolicy.ts";
|
|
14
20
|
import { AlchemyContext } from "./AlchemyContext.ts";
|
|
15
21
|
import {
|
|
16
22
|
Artifacts,
|
|
@@ -29,6 +35,7 @@ import {
|
|
|
29
35
|
type ReplaceDiff,
|
|
30
36
|
type UpdateDiff,
|
|
31
37
|
} from "./Diff.ts";
|
|
38
|
+
import { emit, type PlannedAction, type PlannedBinding, type PlannedResource } from "./Events.ts";
|
|
32
39
|
import { parseFqn } from "./FQN.ts";
|
|
33
40
|
import { generateInstanceId } from "./InstanceId.ts";
|
|
34
41
|
import * as Output from "./Output.ts";
|
|
@@ -41,12 +48,6 @@ import {
|
|
|
41
48
|
type ProviderService,
|
|
42
49
|
} from "./Provider.ts";
|
|
43
50
|
import { defaultProviderMode, stampedMode, type ProviderMode } from "./ProviderMode.ts";
|
|
44
|
-
import {
|
|
45
|
-
Progress,
|
|
46
|
-
type PlannedAction,
|
|
47
|
-
type PlannedBinding,
|
|
48
|
-
type PlannedResource,
|
|
49
|
-
} from "./Report.ts";
|
|
50
51
|
import {
|
|
51
52
|
isResource,
|
|
52
53
|
missingImplementation,
|
|
@@ -191,6 +192,8 @@ export interface Replace<R extends ResourceLike = ResourceLike> extends ApplyNod
|
|
|
191
192
|
props: any;
|
|
192
193
|
deleteFirst: boolean;
|
|
193
194
|
restart?: boolean;
|
|
195
|
+
/** Ownership probe of the replacement's physical identity, run before any mutation. */
|
|
196
|
+
deferredAdoption?: { adopt: boolean };
|
|
194
197
|
state:
|
|
195
198
|
| CreatingResourceState
|
|
196
199
|
| CreatedResourceState
|
|
@@ -370,6 +373,38 @@ export function make<A>(stack: StackSpec<A>, options: FilteredPlanOptions = {})
|
|
|
370
373
|
return makePlan(stack, options);
|
|
371
374
|
}
|
|
372
375
|
|
|
376
|
+
/**
|
|
377
|
+
* Bind every ref to a resource this program declares in its own stack and
|
|
378
|
+
* stage, so the ref is a dependency like a direct reference: the target is
|
|
379
|
+
* created first and deleted last, and the ref resolves to the target's fresh
|
|
380
|
+
* attributes (see `Output.bindRef`). A ref is matched by its id against the
|
|
381
|
+
* declared resource's FQN, which is what the ref reads from state. A
|
|
382
|
+
* resource's ref to itself stays unbound: it reads its own persisted state.
|
|
383
|
+
*/
|
|
384
|
+
const bindSameStackRefs = (
|
|
385
|
+
stack: StackSpec<any>,
|
|
386
|
+
resources: ReadonlyArray<ResourceLike>,
|
|
387
|
+
actions: ReadonlyArray<ActionLike>,
|
|
388
|
+
) => {
|
|
389
|
+
const byFqn = new Map(resources.map((resource) => [resource.FQN, resource]));
|
|
390
|
+
const bind = (owner: string, value: unknown) => {
|
|
391
|
+
for (const ref of Output.collectRefs(value)) {
|
|
392
|
+
if ((ref.stack ?? stack.name) !== stack.name) continue;
|
|
393
|
+
if ((ref.stage ?? stack.stage) !== stack.stage) continue;
|
|
394
|
+
if (ref.resourceId === owner) continue;
|
|
395
|
+
const target = byFqn.get(ref.resourceId);
|
|
396
|
+
if (target !== undefined) Output.bindRef(ref, target);
|
|
397
|
+
}
|
|
398
|
+
};
|
|
399
|
+
for (const resource of resources) {
|
|
400
|
+
bind(resource.FQN, resource.Props);
|
|
401
|
+
bind(resource.FQN, stack.bindings[resource.FQN] ?? []);
|
|
402
|
+
}
|
|
403
|
+
for (const action of actions) {
|
|
404
|
+
bind(action.FQN, [action.Input, action.Captures]);
|
|
405
|
+
}
|
|
406
|
+
};
|
|
407
|
+
|
|
373
408
|
const makePlan = <A>(
|
|
374
409
|
stack: StackSpec<A>,
|
|
375
410
|
options: FilteredPlanOptions = {},
|
|
@@ -377,13 +412,13 @@ const makePlan = <A>(
|
|
|
377
412
|
// @ts-expect-error
|
|
378
413
|
Effect.gen(function* () {
|
|
379
414
|
// Per-resource plan progress and phase markers are reported through
|
|
380
|
-
//
|
|
415
|
+
// events as the work happens, so a renderer can show
|
|
381
416
|
// plan computation while it runs. The default reporter is a no-op.
|
|
382
|
-
const reportPlanned = yield* Progress;
|
|
383
417
|
|
|
384
418
|
const declaredResources = Object.values(stack.resources);
|
|
385
419
|
const declaredActions = Object.values(stack.actions ?? {});
|
|
386
420
|
const declared = [...declaredResources, ...declaredActions];
|
|
421
|
+
bindSameStackRefs(stack, declaredResources, declaredActions);
|
|
387
422
|
const upstream = (node: ResourceLike | ActionLike) =>
|
|
388
423
|
Object.keys(
|
|
389
424
|
Output.upstreamAny(
|
|
@@ -397,7 +432,7 @@ const makePlan = <A>(
|
|
|
397
432
|
const actions = declaredActions.filter((node) => !selected || selected.has(node.FQN));
|
|
398
433
|
|
|
399
434
|
// Resolving the state service may bootstrap a remote store.
|
|
400
|
-
yield*
|
|
435
|
+
yield* emit({ type: "plan.phase", phase: "loading-state" });
|
|
401
436
|
const state = yield* yield* State;
|
|
402
437
|
|
|
403
438
|
// A bare platform tag yields a forward reference registered with
|
|
@@ -483,8 +518,9 @@ const makePlan = <A>(
|
|
|
483
518
|
stack: stackName,
|
|
484
519
|
stage: stage,
|
|
485
520
|
});
|
|
486
|
-
const oldResources = yield* Effect.
|
|
487
|
-
resourceFqns
|
|
521
|
+
const oldResources = yield* Effect.forEach(
|
|
522
|
+
resourceFqns,
|
|
523
|
+
(fqn) => state.get({ stack: stackName, stage: stage, fqn }),
|
|
488
524
|
{ concurrency: "unbounded" },
|
|
489
525
|
);
|
|
490
526
|
|
|
@@ -551,7 +587,7 @@ const makePlan = <A>(
|
|
|
551
587
|
if (remote.length > 0) yield* demandRemoteCredentials(remote);
|
|
552
588
|
}
|
|
553
589
|
|
|
554
|
-
yield*
|
|
590
|
+
yield* emit({ type: "plan.phase", phase: "computing-plan" });
|
|
555
591
|
|
|
556
592
|
// ── FQN renames ──────────────────────────────────────────────────────
|
|
557
593
|
// Map every former FQN claimed via `renamedFrom(...)` to its claimant's
|
|
@@ -804,7 +840,7 @@ const makePlan = <A>(
|
|
|
804
840
|
newBindings,
|
|
805
841
|
})
|
|
806
842
|
.pipe(providePlanScope(resource, oldState.instanceId))
|
|
807
|
-
: Effect.
|
|
843
|
+
: Effect.undefined;
|
|
808
844
|
|
|
809
845
|
// A present `diff.stables` is authoritative for this update and
|
|
810
846
|
// overrides `provider.stables`. We only fall back to the
|
|
@@ -921,16 +957,15 @@ const makePlan = <A>(
|
|
|
921
957
|
}
|
|
922
958
|
const nested = new Set(ancestors).add(input);
|
|
923
959
|
if (Array.isArray(input)) {
|
|
924
|
-
return yield* Effect.
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
);
|
|
960
|
+
return yield* Effect.forEach(input, (item) => resolveInput(item, nested), {
|
|
961
|
+
concurrency: "unbounded",
|
|
962
|
+
});
|
|
928
963
|
}
|
|
929
964
|
return Object.fromEntries(
|
|
930
|
-
yield* Effect.
|
|
931
|
-
Object.entries(input)
|
|
965
|
+
yield* Effect.forEach(
|
|
966
|
+
Object.entries(input),
|
|
967
|
+
([key, value]) =>
|
|
932
968
|
resolveInput(value, nested).pipe(Effect.map((value) => [key, value])),
|
|
933
|
-
),
|
|
934
969
|
{ concurrency: "unbounded" },
|
|
935
970
|
),
|
|
936
971
|
);
|
|
@@ -1005,12 +1040,20 @@ const makePlan = <A>(
|
|
|
1005
1040
|
? expr
|
|
1006
1041
|
: yield* resolveOutput(Output.asOutput(expr.f(upstream)) as Output.Expr<any>);
|
|
1007
1042
|
} else if (Output.isAllExpr(expr)) {
|
|
1008
|
-
return yield* Effect.
|
|
1043
|
+
return yield* Effect.forEach(expr.outs, resolveOutput, {
|
|
1009
1044
|
concurrency: "unbounded",
|
|
1010
1045
|
});
|
|
1011
1046
|
} else if (Output.isLiteralExpr(expr)) {
|
|
1012
1047
|
return expr.value;
|
|
1013
1048
|
} else if (Output.isRefExpr(expr)) {
|
|
1049
|
+
// A ref bound to a declared resource resolves like a direct
|
|
1050
|
+
// reference: unknown while that resource is being created.
|
|
1051
|
+
const target = Output.refTarget(expr);
|
|
1052
|
+
if (target !== undefined) {
|
|
1053
|
+
return yield* resolveResource(
|
|
1054
|
+
Output.of(target as any) as Output.ResourceExpr<any, any>,
|
|
1055
|
+
);
|
|
1056
|
+
}
|
|
1014
1057
|
const refStack = expr.stack ?? stackName;
|
|
1015
1058
|
const refStage = expr.stage ?? stage;
|
|
1016
1059
|
const refState = yield* state
|
|
@@ -1265,8 +1308,8 @@ const makePlan = <A>(
|
|
|
1265
1308
|
const resourcePlanned = (node: CRUD) =>
|
|
1266
1309
|
Ref.updateAndGet(plannedCount, (count) => count + 1).pipe(
|
|
1267
1310
|
Effect.flatMap((completed) =>
|
|
1268
|
-
|
|
1269
|
-
|
|
1311
|
+
emit({
|
|
1312
|
+
type: "plan.resource.completed",
|
|
1270
1313
|
...describeResource(node),
|
|
1271
1314
|
completed,
|
|
1272
1315
|
total: resources.length,
|
|
@@ -1281,8 +1324,8 @@ const makePlan = <A>(
|
|
|
1281
1324
|
// Paired with the resource-planned completion below so renderers can
|
|
1282
1325
|
// show what is actually in flight (diffs may read the cloud and run
|
|
1283
1326
|
// concurrently — completions alone hide the slow tail).
|
|
1284
|
-
yield*
|
|
1285
|
-
|
|
1327
|
+
yield* emit({
|
|
1328
|
+
type: "plan.resource.started",
|
|
1286
1329
|
fqn,
|
|
1287
1330
|
logicalId: id,
|
|
1288
1331
|
resourceType: resource.Type,
|
|
@@ -1486,11 +1529,16 @@ const makePlan = <A>(
|
|
|
1486
1529
|
renamedFrom,
|
|
1487
1530
|
adoptionBlocked: reusesMigratedFqn ? "migrated-fqn" : undefined,
|
|
1488
1531
|
deferredAdoption:
|
|
1489
|
-
|
|
1490
|
-
provider.read &&
|
|
1532
|
+
(provider.read || provider.observe) &&
|
|
1491
1533
|
!reusesMigratedFqn &&
|
|
1492
|
-
|
|
1493
|
-
|
|
1534
|
+
// A replacement targets a new physical identity, which may belong
|
|
1535
|
+
// to someone else — admit it like a fresh create.
|
|
1536
|
+
(node.action === "replace" ||
|
|
1537
|
+
(node.action === "create" &&
|
|
1538
|
+
// Plan reads resolved props itself; without `read`, Apply
|
|
1539
|
+
// admits them through `observe`.
|
|
1540
|
+
((oldState === undefined && (!isResolved(news) || !provider.read)) ||
|
|
1541
|
+
(oldState?.status === "creating" && oldState.attr === undefined))))
|
|
1494
1542
|
? { adopt: adoptThis }
|
|
1495
1543
|
: undefined,
|
|
1496
1544
|
}) as any as T;
|
|
@@ -1516,7 +1564,16 @@ const makePlan = <A>(
|
|
|
1516
1564
|
// `output` is undefined (as it is here), so handing them
|
|
1517
1565
|
// unresolved exprs crashes. Skip the probe — same behavior as
|
|
1518
1566
|
// a read that found nothing — and re-drive the create.
|
|
1519
|
-
|
|
1567
|
+
//
|
|
1568
|
+
// A checkpoint whose unresolved props were stripped (`propsIncomplete`)
|
|
1569
|
+
// can't identify the attempt at all: a lookup could match a different
|
|
1570
|
+
// resource. Skip it too and let the diff below decide.
|
|
1571
|
+
if (
|
|
1572
|
+
provider.read &&
|
|
1573
|
+
!reusesMigratedFqn &&
|
|
1574
|
+
!oldState.propsIncomplete &&
|
|
1575
|
+
isResolved(oldState.props)
|
|
1576
|
+
) {
|
|
1520
1577
|
const attr = yield* provider
|
|
1521
1578
|
.read({
|
|
1522
1579
|
id,
|
|
@@ -1813,8 +1870,9 @@ const makePlan = <A>(
|
|
|
1813
1870
|
// interrupt-only for any other reason) that can be a bare interruption,
|
|
1814
1871
|
// hiding the InvalidReferenceError or provider error that actually
|
|
1815
1872
|
// broke the plan.
|
|
1816
|
-
const diffExits = yield* Effect.
|
|
1817
|
-
resources
|
|
1873
|
+
const diffExits = yield* Effect.forEach(
|
|
1874
|
+
resources,
|
|
1875
|
+
(resource) => Effect.exit(Effect.tap(diffResource(resource), resourcePlanned)),
|
|
1818
1876
|
{ concurrency: "unbounded" },
|
|
1819
1877
|
);
|
|
1820
1878
|
const diffFailures = diffExits.filter(Exit.isFailure);
|
|
@@ -1886,7 +1944,7 @@ const makePlan = <A>(
|
|
|
1886
1944
|
if (excluded && (bindingEvidence || incompleteHistory)) {
|
|
1887
1945
|
return yield* Effect.die(
|
|
1888
1946
|
new UnsafeSelectionBoundary({
|
|
1889
|
-
message: `Cannot replace or collect old generations of '${fqn}' while '${excluded[0]}' is unselected. ${bindingEvidence ? `Historical binding-cycle dependencies recorded on '${bindingEvidence}'` : `Historical dependencies missing from '${incompleteHistory}'`} cannot be proven safe; run a full deployment.`,
|
|
1947
|
+
message: `Cannot replace or collect old generations of '${fqn}' while '${String(excluded[0])}' is unselected. ${bindingEvidence ? `Historical binding-cycle dependencies recorded on '${bindingEvidence}'` : `Historical dependencies missing from '${incompleteHistory}'`} cannot be proven safe; run a full deployment.`,
|
|
1890
1948
|
}),
|
|
1891
1949
|
);
|
|
1892
1950
|
}
|
|
@@ -1910,7 +1968,7 @@ const makePlan = <A>(
|
|
|
1910
1968
|
new UnsafeSelectionBoundary({
|
|
1911
1969
|
message: `Cannot reconcile '${fqn}' with incomplete historical downstream metadata while persisted nodes are unselected: ${excludedRows
|
|
1912
1970
|
.map(([id]) => id)
|
|
1913
|
-
.sort()
|
|
1971
|
+
.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))
|
|
1914
1972
|
.join(", ")}. Select them or run a full deployment.`,
|
|
1915
1973
|
}),
|
|
1916
1974
|
);
|
|
@@ -1943,7 +2001,7 @@ const makePlan = <A>(
|
|
|
1943
2001
|
new UnsafeSelectionBoundary({
|
|
1944
2002
|
message: `Cannot discard the last historical binding evidence while persisted nodes are unselected: ${excludedRows
|
|
1945
2003
|
.map(([fqn]) => fqn)
|
|
1946
|
-
.sort()
|
|
2004
|
+
.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))
|
|
1947
2005
|
.join(", ")}. Select them or run a full deployment.`,
|
|
1948
2006
|
}),
|
|
1949
2007
|
);
|
|
@@ -1957,8 +2015,8 @@ const makePlan = <A>(
|
|
|
1957
2015
|
const actionPlanned = (entry: readonly [string, ActionApply]) =>
|
|
1958
2016
|
Ref.updateAndGet(actionCount, (count) => count + 1).pipe(
|
|
1959
2017
|
Effect.flatMap((completed) =>
|
|
1960
|
-
|
|
1961
|
-
|
|
2018
|
+
emit({
|
|
2019
|
+
type: "plan.action.completed",
|
|
1962
2020
|
...describeAction(entry[1]),
|
|
1963
2021
|
completed,
|
|
1964
2022
|
total: actions.length,
|
|
@@ -1967,13 +2025,13 @@ const makePlan = <A>(
|
|
|
1967
2025
|
);
|
|
1968
2026
|
|
|
1969
2027
|
const actionGraph = Object.fromEntries(
|
|
1970
|
-
(yield* Effect.
|
|
1971
|
-
actions
|
|
2028
|
+
(yield* Effect.forEach(
|
|
2029
|
+
actions,
|
|
2030
|
+
(action) =>
|
|
1972
2031
|
diffAction(action).pipe(
|
|
1973
2032
|
Effect.map((node) => [action.FQN, node] as const),
|
|
1974
2033
|
Effect.tap(actionPlanned),
|
|
1975
2034
|
),
|
|
1976
|
-
),
|
|
1977
2035
|
{ concurrency: "unbounded" },
|
|
1978
2036
|
)) as ReadonlyArray<readonly [string, ActionApply]>,
|
|
1979
2037
|
) as Plan["actions"];
|
|
@@ -2036,6 +2094,37 @@ const makePlan = <A>(
|
|
|
2036
2094
|
}
|
|
2037
2095
|
}
|
|
2038
2096
|
|
|
2097
|
+
// A delete-first replacement in a cycle deletes its previous generation
|
|
2098
|
+
// before precreate. Apply resolves the props that upstreams outside the
|
|
2099
|
+
// cycle determine first, so only props derived from a cycle peer are
|
|
2100
|
+
// still unresolved then, and only the provider's `observe` can check
|
|
2101
|
+
// ownership before that delete. Without it, refuse here — before apply
|
|
2102
|
+
// touches anything — unless adoption is allowed.
|
|
2103
|
+
for (const [fqn, node] of Object.entries(resourceGraph)) {
|
|
2104
|
+
if (
|
|
2105
|
+
node.action === "replace" &&
|
|
2106
|
+
node.deleteFirst &&
|
|
2107
|
+
cycleMembers.has(fqn) &&
|
|
2108
|
+
!node.provider.observe &&
|
|
2109
|
+
node.deferredAdoption?.adopt === false &&
|
|
2110
|
+
!isResolved(node.props) &&
|
|
2111
|
+
Object.keys(Output.resolveUpstream(node.props)).some((dep) => cycleMembers.has(dep)) &&
|
|
2112
|
+
// A resumed replacement already holds its precreated identity.
|
|
2113
|
+
!(node.state.status === "replacing" && !node.restart && node.state.attr !== undefined)
|
|
2114
|
+
) {
|
|
2115
|
+
return yield* new UnverifiableReplacement({
|
|
2116
|
+
message:
|
|
2117
|
+
`Cannot replace resource '${fqn}' (${node.resource.Type}): ` +
|
|
2118
|
+
"it must be deleted before its replacement is pre-created, but " +
|
|
2119
|
+
"the replacement's identity depends on outputs that are not " +
|
|
2120
|
+
"resolved yet, so its ownership cannot be checked first. Re-run " +
|
|
2121
|
+
"with `--adopt` (or wrap the effect in `adopt(true)`) to replace it anyway.",
|
|
2122
|
+
resourceType: node.resource.Type,
|
|
2123
|
+
logicalId: node.resource.LogicalId,
|
|
2124
|
+
});
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2039
2128
|
// Both orphan passes (task rows below, resource rows further down)
|
|
2040
2129
|
// examine every persisted row of this stack instance.
|
|
2041
2130
|
const persistedFqns = selected ? [] : yield* state.list({ stack: stackName, stage });
|
|
@@ -2049,8 +2138,8 @@ const makePlan = <A>(
|
|
|
2049
2138
|
Effect.flatMap((completed) =>
|
|
2050
2139
|
entry === undefined
|
|
2051
2140
|
? Effect.void
|
|
2052
|
-
:
|
|
2053
|
-
|
|
2141
|
+
: emit({
|
|
2142
|
+
type: "plan.action.completed",
|
|
2054
2143
|
...describeAction(entry[1]),
|
|
2055
2144
|
completed,
|
|
2056
2145
|
total: persistedFqns.length,
|
|
@@ -2093,12 +2182,12 @@ const makePlan = <A>(
|
|
|
2093
2182
|
});
|
|
2094
2183
|
|
|
2095
2184
|
const actionDeletions: Plan["actionDeletions"] = Object.fromEntries(
|
|
2096
|
-
(yield* Effect.
|
|
2097
|
-
persistedFqns
|
|
2185
|
+
(yield* Effect.forEach(
|
|
2186
|
+
persistedFqns,
|
|
2187
|
+
(fqn) =>
|
|
2098
2188
|
diffActionDeletion(fqn).pipe(
|
|
2099
2189
|
Effect.tap((entry) => actionDeletionPlanned(entry ?? undefined)),
|
|
2100
2190
|
),
|
|
2101
|
-
),
|
|
2102
2191
|
{ concurrency: "unbounded" },
|
|
2103
2192
|
)).filter((v): v is NonNullable<typeof v> => !!v),
|
|
2104
2193
|
);
|
|
@@ -2113,8 +2202,8 @@ const makePlan = <A>(
|
|
|
2113
2202
|
Effect.flatMap((completed) =>
|
|
2114
2203
|
entry === undefined
|
|
2115
2204
|
? Effect.void
|
|
2116
|
-
:
|
|
2117
|
-
|
|
2205
|
+
: emit({
|
|
2206
|
+
type: "plan.resource.completed",
|
|
2118
2207
|
...describeResource(entry[1]),
|
|
2119
2208
|
completed,
|
|
2120
2209
|
total: deletionCandidates.length,
|
|
@@ -2213,10 +2302,9 @@ const makePlan = <A>(
|
|
|
2213
2302
|
});
|
|
2214
2303
|
|
|
2215
2304
|
const deletions = Object.fromEntries(
|
|
2216
|
-
(yield* Effect.
|
|
2217
|
-
deletionCandidates
|
|
2218
|
-
|
|
2219
|
-
),
|
|
2305
|
+
(yield* Effect.forEach(
|
|
2306
|
+
deletionCandidates,
|
|
2307
|
+
(fqn) => diffDeletion(fqn).pipe(Effect.tap((entry) => deletionPlanned(entry ?? undefined))),
|
|
2220
2308
|
{ concurrency: "unbounded" },
|
|
2221
2309
|
)).filter((v) => !!v),
|
|
2222
2310
|
);
|
package/src/Platform.ts
CHANGED
|
@@ -15,9 +15,11 @@ import * as Redacted from "effect/Redacted";
|
|
|
15
15
|
import { Scope } from "effect/Scope";
|
|
16
16
|
import type * as Stream from "effect/Stream";
|
|
17
17
|
import type { Dependencies } from "./Dependencies.ts";
|
|
18
|
+
import { toFqn } from "./FQN.ts";
|
|
18
19
|
import type { HttpEffect } from "./Http.ts";
|
|
19
20
|
import type { InputProps } from "./Input.ts";
|
|
20
21
|
import type { Named, Tag } from "./Named.ts";
|
|
22
|
+
import { CurrentNamespace } from "./Namespace.ts";
|
|
21
23
|
import * as Output from "./Output.ts";
|
|
22
24
|
import { ALCHEMY_PHASE } from "./Phase.ts";
|
|
23
25
|
import type { Provider, ProviderCollectionLike } from "./Provider.ts";
|
|
@@ -32,6 +34,7 @@ import {
|
|
|
32
34
|
} from "./RuntimeContext.ts";
|
|
33
35
|
import { Self } from "./Self.ts";
|
|
34
36
|
import type { Stack, StackServices } from "./Stack.ts";
|
|
37
|
+
import { StackContext } from "./StackContext.ts";
|
|
35
38
|
import type { Stage } from "./Stage.ts";
|
|
36
39
|
import { effectClass } from "./Util/effect.ts";
|
|
37
40
|
|
|
@@ -336,8 +339,8 @@ export const Platform = <
|
|
|
336
339
|
isExternal: true,
|
|
337
340
|
};
|
|
338
341
|
};
|
|
339
|
-
const
|
|
340
|
-
|
|
342
|
+
const register = () =>
|
|
343
|
+
!isTag
|
|
341
344
|
? // this is a non-tagged resource yielded without providing an implementation
|
|
342
345
|
// e.g.
|
|
343
346
|
// yield* Cloudflare.Worker("id", { main: "./src/worker.ts" })
|
|
@@ -376,20 +379,39 @@ export const Platform = <
|
|
|
376
379
|
),
|
|
377
380
|
onSome: Effect.succeed,
|
|
378
381
|
}),
|
|
379
|
-
)
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
382
|
+
);
|
|
383
|
+
// Whether this `yield*` registers the resource. The stack holds one
|
|
384
|
+
// resource per FQN and every later `yield*` returns it. Outside a
|
|
385
|
+
// stack (at runtime) nothing registers, so the hook runs as before.
|
|
386
|
+
const isFirstRegistration = Effect.flatMap(
|
|
387
|
+
Effect.serviceOption(StackContext),
|
|
388
|
+
Option.match({
|
|
389
|
+
onNone: () => Effect.succeed(true),
|
|
390
|
+
onSome: (stack) =>
|
|
391
|
+
Effect.map(CurrentNamespace, (namespace) => !(toFqn(namespace, id) in stack.resources)),
|
|
392
|
+
}),
|
|
393
|
+
);
|
|
394
|
+
const evaluate = () =>
|
|
395
|
+
Effect.flatMap(isFirstRegistration, (firstRegistration) =>
|
|
396
|
+
register().pipe(
|
|
397
|
+
Effect.tap((resource) =>
|
|
398
|
+
// Run the hook only for the `yield*` that registered the
|
|
399
|
+
// resource. The hook yields the resource's `env`, so re-running
|
|
400
|
+
// it on every `yield*` lets two Workers whose `env` entries
|
|
401
|
+
// yield each other recurse forever (#2672). The resource is
|
|
402
|
+
// registered before the hook runs, so a cycle back to it stops.
|
|
403
|
+
hooks.onCreate && firstRegistration
|
|
404
|
+
? Effect.flatMap(
|
|
405
|
+
// `props` may itself be an Effect (e.g. when wrapped by
|
|
406
|
+
// `Cloudflare.Website.Vite` via `Effect.map`); resolve it
|
|
407
|
+
// before handing it to the hook so `onCreate` always sees
|
|
408
|
+
// the plain props object — the second call site (in
|
|
409
|
+
// `cls.make`) already does this.
|
|
410
|
+
Effect.isEffect(props) ? props : Effect.succeed(props ?? {}),
|
|
411
|
+
(resolved) => hooks.onCreate!(resource as R, resolved),
|
|
412
|
+
)
|
|
413
|
+
: Effect.void,
|
|
414
|
+
),
|
|
393
415
|
),
|
|
394
416
|
);
|
|
395
417
|
return Object.assign(
|
|
@@ -524,10 +546,17 @@ export const Platform = <
|
|
|
524
546
|
return node;
|
|
525
547
|
} else if (phase === "runtime" && ctx) {
|
|
526
548
|
// retrieve from the RuntimeContext if running in runtime phase
|
|
527
|
-
const value = yield* ctx.get<
|
|
549
|
+
const value = yield* ctx.get<unknown>(key);
|
|
528
550
|
if (value) {
|
|
551
|
+
// `get` JSON-decodes unbound env values (`"true"` →
|
|
552
|
+
// `true`), but a `Value` node holds the raw string the
|
|
553
|
+
// `Config` schema parses.
|
|
529
554
|
return ConfigProvider.makeValue(
|
|
530
|
-
Redacted.isRedacted(value)
|
|
555
|
+
Redacted.isRedacted(value)
|
|
556
|
+
? String(Redacted.value(value))
|
|
557
|
+
: typeof value === "string"
|
|
558
|
+
? value
|
|
559
|
+
: JSON.stringify(value),
|
|
531
560
|
);
|
|
532
561
|
}
|
|
533
562
|
}
|
package/src/Provider.ts
CHANGED
|
@@ -5,6 +5,7 @@ import * as Layer from "effect/Layer";
|
|
|
5
5
|
import * as Option from "effect/Option";
|
|
6
6
|
import * as Predicate from "effect/Predicate";
|
|
7
7
|
import type * as Stream from "effect/Stream";
|
|
8
|
+
import type { Unresolved } from "./AdoptPolicy.ts";
|
|
8
9
|
import type { Artifacts } from "./Artifacts.ts";
|
|
9
10
|
import type { Diff } from "./Diff.ts";
|
|
10
11
|
import type { Input } from "./Input.ts";
|
|
@@ -268,6 +269,14 @@ export interface ProviderService<
|
|
|
268
269
|
olds: Props<Res>;
|
|
269
270
|
// what is the ARN?
|
|
270
271
|
output: Res["Attributes"] | undefined; // current state -> synced state
|
|
272
|
+
/**
|
|
273
|
+
* When the engine checks the identity a replacement will claim, the
|
|
274
|
+
* attributes of the generation it replaces. A provider that can't tell
|
|
275
|
+
* our resource from a foreign one by ownership metadata alone (e.g. an
|
|
276
|
+
* explicitly named resource without tags) reports a resource that is
|
|
277
|
+
* this previous generation as owned, not `Unowned`.
|
|
278
|
+
*/
|
|
279
|
+
previous?: Res["Attributes"];
|
|
271
280
|
}): Effect.Effect<Res["Attributes"] | undefined, any, ReadReq>;
|
|
272
281
|
/**
|
|
273
282
|
* Properties that are always stable across any update.
|
|
@@ -290,6 +299,42 @@ export interface ProviderService<
|
|
|
290
299
|
output: Res["Attributes"] | undefined;
|
|
291
300
|
}): Effect.Effect<Diff | void, any, DiffReq>;
|
|
292
301
|
// dev?:() => Effect.Effect<void, any, DevReq>;
|
|
302
|
+
/**
|
|
303
|
+
* Reports what exists at the physical resource {@link precreate} would
|
|
304
|
+
* claim, without writing. A dependency cycle precreates on raw, possibly unresolved
|
|
305
|
+
* props, before `read` can run, so the engine asks `observe` first and
|
|
306
|
+
* refuses a foreign resource before `precreate` touches it, unless adoption
|
|
307
|
+
* is allowed (`--adopt` / `adopt(true)`).
|
|
308
|
+
*
|
|
309
|
+
* It receives the same raw props as `precreate` and must derive the same
|
|
310
|
+
* identity. Report what exists there the way {@link read} does: `undefined`
|
|
311
|
+
* when nothing does, its attributes when it belongs to this
|
|
312
|
+
* stack/stage/logical-id, and `Unowned(attrs)` otherwise. Return
|
|
313
|
+
* `Unresolved` when the identity depends on props that have not resolved
|
|
314
|
+
* yet: the engine then checks the resolved identity before `reconcile`.
|
|
315
|
+
*
|
|
316
|
+
* The attributes may be partial. During a replacement, `previous` holds
|
|
317
|
+
* the attributes of the generation being replaced: report a resource that
|
|
318
|
+
* is that generation as owned. The engine compares no attributes itself.
|
|
319
|
+
*
|
|
320
|
+
* Without {@link read}, the engine also calls `observe` with resolved props
|
|
321
|
+
* to check an identity before `reconcile` claims it.
|
|
322
|
+
*
|
|
323
|
+
* Opt-in: implement it whenever `precreate` can write to a resource that
|
|
324
|
+
* already exists. Without it, such a cycle precreates unchecked.
|
|
325
|
+
*/
|
|
326
|
+
observe?(input: {
|
|
327
|
+
id: string;
|
|
328
|
+
/**
|
|
329
|
+
* Fully-qualified name (namespace path + logical id, see `./FQN.ts`) —
|
|
330
|
+
* globally unique, so providers can stamp ownership metadata on cloud objects.
|
|
331
|
+
*/
|
|
332
|
+
fqn: string;
|
|
333
|
+
news: Props<Res>;
|
|
334
|
+
instanceId: string;
|
|
335
|
+
/** During a replacement, the attributes of the generation being replaced. */
|
|
336
|
+
previous?: Res["Attributes"];
|
|
337
|
+
}): Effect.Effect<Partial<Res["Attributes"]> | Unresolved | undefined, any, PrecreateReq>;
|
|
293
338
|
precreate?(input: {
|
|
294
339
|
id: string;
|
|
295
340
|
/**
|
|
@@ -548,15 +593,15 @@ export const collection = <
|
|
|
548
593
|
const context = yield* Effect.context();
|
|
549
594
|
|
|
550
595
|
const providers = Object.fromEntries(
|
|
551
|
-
yield* Effect.
|
|
552
|
-
resources
|
|
596
|
+
yield* Effect.forEach(
|
|
597
|
+
resources,
|
|
598
|
+
(resource) =>
|
|
553
599
|
"Provider" in resource
|
|
554
600
|
? resource.Provider.pipe(Effect.map((provider) => [resource.Type, provider] as const))
|
|
555
601
|
: Effect.succeed([
|
|
556
602
|
(resource as { key: string }).key,
|
|
557
603
|
context.mapUnsafe.get((resource as { key: string }).key),
|
|
558
604
|
] as const),
|
|
559
|
-
),
|
|
560
605
|
{ concurrency: "unbounded" },
|
|
561
606
|
),
|
|
562
607
|
);
|