alchemy 2.0.0-beta.84 → 2.0.0-beta.86
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/Action.d.ts.map +1 -1
- package/lib/Action.js.map +1 -1
- package/lib/ActionRuntimeContext.d.ts.map +1 -1
- package/lib/ActionRuntimeContext.js.map +1 -1
- 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 +45 -0
- package/lib/Alchemist/AuthRegistry.d.ts.map +1 -0
- package/lib/Alchemist/AuthRegistry.js +138 -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 +43 -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/State.d.ts +99 -0
- package/lib/Alchemist/State.d.ts.map +1 -0
- package/lib/Alchemist/State.js +172 -0
- 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/AlchemyContext.d.ts.map +1 -1
- package/lib/AlchemyContext.js.map +1 -1
- package/lib/Apply.d.ts +2 -8
- package/lib/Apply.d.ts.map +1 -1
- package/lib/Apply.js +372 -212
- package/lib/Apply.js.map +1 -1
- package/lib/Artifacts.d.ts.map +1 -1
- package/lib/Artifacts.js +7 -6
- package/lib/Artifacts.js.map +1 -1
- package/lib/Auth/AuthProvider.d.ts +31 -13
- package/lib/Auth/AuthProvider.d.ts.map +1 -1
- package/lib/Auth/AuthProvider.js +37 -14
- 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/CredentialsCache.d.ts.map +1 -1
- package/lib/Auth/CredentialsCache.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 +3 -2
- package/lib/Auth/Lock.d.ts.map +1 -1
- package/lib/Auth/Lock.js +7 -9
- package/lib/Auth/Lock.js.map +1 -1
- package/lib/Auth/OAuthFlow.d.ts +9 -12
- package/lib/Auth/OAuthFlow.d.ts.map +1 -1
- package/lib/Auth/OAuthFlow.js +35 -20
- package/lib/Auth/OAuthFlow.js.map +1 -1
- package/lib/Auth/OidcToken.d.ts.map +1 -1
- package/lib/Auth/OidcToken.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 +12 -1
- package/lib/Auth/Profile.d.ts.map +1 -1
- package/lib/Auth/Profile.js +22 -3
- package/lib/Auth/Profile.js.map +1 -1
- package/lib/Auth/ProfileMigrationV0.d.ts.map +1 -1
- package/lib/Auth/ProfileMigrationV0.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/Auth/index.d.ts.map +1 -1
- package/lib/Auth/index.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/BundleAnalyzerPlugin.d.ts.map +1 -1
- package/lib/Bundle/BundleAnalyzerPlugin.js.map +1 -1
- package/lib/Bundle/InstalledPackages.d.ts.map +1 -1
- package/lib/Bundle/InstalledPackages.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/PurePlugin.d.ts.map +1 -1
- package/lib/Bundle/PurePlugin.js.map +1 -1
- package/lib/Bundle/RawPlugin.d.ts.map +1 -1
- package/lib/Bundle/RawPlugin.js.map +1 -1
- package/lib/Bundle/TempRoot.d.ts.map +1 -1
- package/lib/Bundle/TempRoot.js.map +1 -1
- package/lib/Bundle/UnreachableChunksPlugin.d.ts.map +1 -1
- package/lib/Bundle/UnreachableChunksPlugin.js.map +1 -1
- package/lib/Bundle/Vite.d.ts.map +1 -1
- package/lib/Bundle/Vite.js.map +1 -1
- 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/Callback.d.ts.map +1 -1
- package/lib/Callback.js.map +1 -1
- package/lib/Cli/DevOptions.d.ts.map +1 -1
- package/lib/Cli/DevOptions.js.map +1 -1
- package/lib/Cli/Format.d.ts +3 -2
- package/lib/Cli/Format.d.ts.map +1 -1
- package/lib/Cli/Format.js +20 -11
- 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 +156 -61
- package/lib/Cli/GlobalLog.js.map +1 -1
- package/lib/Cli/JsonConsole.d.ts +12 -0
- package/lib/Cli/JsonConsole.d.ts.map +1 -0
- package/lib/Cli/JsonConsole.js +67 -0
- package/lib/Cli/JsonConsole.js.map +1 -0
- package/lib/Cli/LoggingCli.d.ts.map +1 -1
- package/lib/Cli/LoggingCli.js +32 -26
- package/lib/Cli/LoggingCli.js.map +1 -1
- package/lib/Cli/ModeTag.d.ts.map +1 -1
- package/lib/Cli/ModeTag.js.map +1 -1
- package/lib/Cli/NamespaceTree.d.ts.map +1 -1
- package/lib/Cli/NamespaceTree.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/PropertyDiff.d.ts.map +1 -1
- package/lib/Cli/PropertyDiff.js.map +1 -1
- package/lib/Cli/Reporter.d.ts.map +1 -1
- package/lib/Cli/Reporter.js.map +1 -1
- 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/compat.d.ts.map +1 -1
- package/lib/Cli/commands/compat.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 +45 -6
- package/lib/Cli/commands/dev.js.map +1 -1
- package/lib/Cli/commands/drift.d.ts +9 -2
- package/lib/Cli/commands/drift.d.ts.map +1 -1
- package/lib/Cli/commands/drift.js +28 -17
- 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 +6 -5
- package/lib/Cli/commands/errors.js.map +1 -1
- package/lib/Cli/commands/flags.d.ts.map +1 -1
- package/lib/Cli/commands/flags.js +3 -1
- package/lib/Cli/commands/flags.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 +23 -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 +23 -19
- 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/profile/index.d.ts.map +1 -1
- package/lib/Cli/commands/profile/index.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 +32 -5
- package/lib/Cli/commands/state.d.ts.map +1 -1
- package/lib/Cli/commands/state.js +230 -58
- 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/Data.d.ts.map +1 -1
- package/lib/Cli/components/ui/Data.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/Feedback.d.ts.map +1 -1
- package/lib/Cli/components/ui/Feedback.js.map +1 -1
- package/lib/Cli/components/ui/Interactive.d.ts +27 -5
- package/lib/Cli/components/ui/Interactive.d.ts.map +1 -1
- package/lib/Cli/components/ui/Interactive.js +12 -14
- 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/Live.d.ts +8 -1
- package/lib/Cli/components/ui/Live.d.ts.map +1 -1
- package/lib/Cli/components/ui/Live.js +46 -4
- package/lib/Cli/components/ui/Live.js.map +1 -1
- package/lib/Cli/components/ui/ProgramStatus.d.ts +13 -0
- package/lib/Cli/components/ui/ProgramStatus.d.ts.map +1 -0
- package/lib/Cli/components/ui/ProgramStatus.js +13 -0
- package/lib/Cli/components/ui/ProgramStatus.js.map +1 -0
- package/lib/Cli/components/ui/ProgressBar.d.ts.map +1 -1
- package/lib/Cli/components/ui/ProgressBar.js.map +1 -1
- package/lib/Cli/components/ui/Transcript.d.ts.map +1 -1
- package/lib/Cli/components/ui/Transcript.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 +3 -2
- package/lib/Cli/components/ui/index.d.ts.map +1 -1
- package/lib/Cli/components/ui/index.js +3 -2
- package/lib/Cli/components/ui/index.js.map +1 -1
- 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 +4 -2
- 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 +11 -8
- package/lib/Cli/components/view/Help.js.map +1 -1
- package/lib/Cli/components/view/Logo.d.ts.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 +2 -2
- package/lib/Cli/components/view/PlanDecision.js.map +1 -1
- package/lib/Cli/components/view/PlanRow.d.ts.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 +4 -2
- package/lib/Cli/components/view/PlanTree.d.ts.map +1 -1
- package/lib/Cli/components/view/PlanTree.js +4 -3
- package/lib/Cli/components/view/PlanTree.js.map +1 -1
- package/lib/Cli/components/view/PlanView.d.ts.map +1 -1
- package/lib/Cli/components/view/PlanView.js +5 -5
- 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.d.ts.map +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 +140 -218
- 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 +11 -10
- package/lib/Cli/components/view/SigilCli.js.map +1 -1
- package/lib/Cli/components/view/StackOutputs.d.ts.map +1 -1
- package/lib/Cli/components/view/StackOutputs.js +2 -2
- package/lib/Cli/components/view/StackOutputs.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/components/view/usePlanPresentation.d.ts.map +1 -1
- package/lib/Cli/components/view/usePlanPresentation.js +13 -1
- package/lib/Cli/components/view/usePlanPresentation.js.map +1 -1
- package/lib/Cli/components/view/usePlanViewport.d.ts.map +1 -1
- package/lib/Cli/components/view/usePlanViewport.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 +33 -35
- package/lib/Cli/exec.js.map +1 -1
- package/lib/Cli/index.d.ts.map +1 -1
- package/lib/Cli/index.js.map +1 -1
- package/lib/Cli/main.d.ts.map +1 -1
- package/lib/Cli/main.js +43 -29
- package/lib/Cli/main.js.map +1 -1
- package/lib/Cli/selectCli.d.ts +13 -3
- package/lib/Cli/selectCli.d.ts.map +1 -1
- package/lib/Cli/selectCli.js +39 -6
- package/lib/Cli/selectCli.js.map +1 -1
- package/lib/Command/Build.d.ts.map +1 -1
- package/lib/Command/Build.js.map +1 -1
- package/lib/Command/Command.d.ts.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/Exec.d.ts.map +1 -1
- package/lib/Command/Exec.js.map +1 -1
- package/lib/Command/Local.d.ts +1 -1
- package/lib/Command/Local.d.ts.map +1 -1
- package/lib/Command/Local.js.map +1 -1
- package/lib/Command/Memo.d.ts.map +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/Command/Providers.js.map +1 -1
- package/lib/Command/Redaction.d.ts.map +1 -1
- package/lib/Command/Redaction.js.map +1 -1
- package/lib/Command/index.d.ts.map +1 -1
- package/lib/Command/index.js.map +1 -1
- package/lib/Contributions.d.ts +83 -23
- package/lib/Contributions.d.ts.map +1 -1
- package/lib/Contributions.js +48 -8
- package/lib/Contributions.js.map +1 -1
- package/lib/DNS/Adapter.d.ts +206 -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/Dependencies.d.ts.map +1 -1
- package/lib/Dependencies.js.map +1 -1
- 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 +192 -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 +220 -0
- package/lib/Events.d.ts.map +1 -0
- package/lib/Events.js +276 -0
- package/lib/Events.js.map +1 -0
- package/lib/FQN.d.ts.map +1 -1
- package/lib/FQN.js.map +1 -1
- package/lib/Http.d.ts.map +1 -1
- package/lib/Http.js.map +1 -1
- package/lib/Input.d.ts.map +1 -1
- package/lib/Input.js.map +1 -1
- package/lib/InstanceId.d.ts.map +1 -1
- package/lib/InstanceId.js.map +1 -1
- package/lib/Interaction.d.ts +166 -48
- package/lib/Interaction.d.ts.map +1 -1
- package/lib/Interaction.js +160 -63
- package/lib/Interaction.js.map +1 -1
- package/lib/KeyPair.d.ts.map +1 -1
- package/lib/KeyPair.js.map +1 -1
- package/lib/Local/DockerHostGateway.d.ts.map +1 -1
- package/lib/Local/DockerHostGateway.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/ProviderLayer.d.ts.map +1 -1
- package/lib/Local/ProviderLayer.js.map +1 -1
- package/lib/Local/RpcProvider.d.ts +2 -2
- 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 +36 -11
- package/lib/Local/RpcSerialization.js.map +1 -1
- package/lib/Local/RpcServer.d.ts +8 -2
- package/lib/Local/RpcServer.d.ts.map +1 -1
- package/lib/Local/RpcServer.js +26 -15
- package/lib/Local/RpcServer.js.map +1 -1
- package/lib/Local/RpcServerBun.d.ts.map +1 -1
- package/lib/Local/RpcServerBun.js +16 -6
- 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 +23 -4
- 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 +8 -8
- package/lib/Local/RpcSpawner.d.ts.map +1 -1
- package/lib/Local/RpcSpawner.js +67 -51
- package/lib/Local/RpcSpawner.js.map +1 -1
- package/lib/Local/RpcToken.d.ts +24 -0
- package/lib/Local/RpcToken.d.ts.map +1 -0
- package/lib/Local/RpcToken.js +62 -0
- package/lib/Local/RpcToken.js.map +1 -0
- package/lib/Local/Sidecar.d.ts +23 -0
- package/lib/Local/Sidecar.d.ts.map +1 -1
- package/lib/Local/Sidecar.js +23 -9
- package/lib/Local/Sidecar.js.map +1 -1
- package/lib/Mount.d.ts +76 -0
- package/lib/Mount.d.ts.map +1 -0
- package/lib/Mount.js +43 -0
- package/lib/Mount.js.map +1 -0
- package/lib/Named.d.ts.map +1 -1
- package/lib/Named.js.map +1 -1
- package/lib/Namespace.d.ts.map +1 -1
- package/lib/Namespace.js.map +1 -1
- package/lib/Nuke.d.ts +5 -23
- package/lib/Nuke.d.ts.map +1 -1
- package/lib/Nuke.js +49 -14
- package/lib/Nuke.js.map +1 -1
- package/lib/Output.d.ts +44 -3
- package/lib/Output.d.ts.map +1 -1
- package/lib/Output.js +144 -9
- package/lib/Output.js.map +1 -1
- package/lib/Phase.d.ts +2 -1
- package/lib/Phase.d.ts.map +1 -1
- package/lib/Phase.js.map +1 -1
- package/lib/PhysicalName.d.ts.map +1 -1
- package/lib/PhysicalName.js.map +1 -1
- package/lib/Plan.d.ts +23 -2
- package/lib/Plan.d.ts.map +1 -1
- package/lib/Plan.js +519 -183
- package/lib/Plan.js.map +1 -1
- package/lib/Platform.d.ts +5 -1
- package/lib/Platform.d.ts.map +1 -1
- package/lib/Platform.js +41 -10
- package/lib/Platform.js.map +1 -1
- package/lib/Provider.d.ts +84 -13
- package/lib/Provider.d.ts.map +1 -1
- package/lib/Provider.js +2 -2
- package/lib/Provider.js.map +1 -1
- package/lib/ProviderMode.d.ts.map +1 -1
- package/lib/ProviderMode.js.map +1 -1
- package/lib/Random.d.ts +1 -1
- package/lib/Random.d.ts.map +1 -1
- package/lib/Random.js.map +1 -1
- package/lib/Ref.d.ts.map +1 -1
- package/lib/Ref.js.map +1 -1
- package/lib/RemovalPolicy.d.ts +53 -2
- package/lib/RemovalPolicy.d.ts.map +1 -1
- package/lib/RemovalPolicy.js +43 -1
- package/lib/RemovalPolicy.js.map +1 -1
- package/lib/Rename.d.ts.map +1 -1
- package/lib/Rename.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/Resource.d.ts +72 -7
- package/lib/Resource.d.ts.map +1 -1
- package/lib/Resource.js +60 -2
- package/lib/Resource.js.map +1 -1
- package/lib/ResourceContext.d.ts.map +1 -1
- package/lib/ResourceContext.js.map +1 -1
- package/lib/ResourceSelection.d.ts.map +1 -1
- package/lib/ResourceSelection.js.map +1 -1
- package/lib/Rpc.d.ts +19 -0
- package/lib/Rpc.d.ts.map +1 -1
- package/lib/Rpc.js +62 -8
- package/lib/Rpc.js.map +1 -1
- package/lib/Runtime/Bootstrap.d.ts +6 -7
- package/lib/Runtime/Bootstrap.d.ts.map +1 -1
- package/lib/Runtime/Bootstrap.js +6 -10
- package/lib/Runtime/Bootstrap.js.map +1 -1
- package/lib/Runtime/ExecutionMemo.d.ts.map +1 -1
- package/lib/Runtime/ExecutionMemo.js.map +1 -1
- package/lib/Runtime/Function.d.ts.map +1 -1
- package/lib/Runtime/Function.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/Runtime/Process.d.ts +5 -0
- package/lib/Runtime/Process.d.ts.map +1 -1
- package/lib/Runtime/Process.js +36 -1
- package/lib/Runtime/Process.js.map +1 -1
- package/lib/Runtime.d.ts.map +1 -1
- package/lib/Runtime.js.map +1 -1
- package/lib/RuntimeContext.d.ts +29 -0
- package/lib/RuntimeContext.d.ts.map +1 -1
- package/lib/RuntimeContext.js +5 -1
- package/lib/RuntimeContext.js.map +1 -1
- package/lib/Sandbox.d.ts +144 -0
- package/lib/Sandbox.d.ts.map +1 -0
- package/lib/Sandbox.js +14 -0
- package/lib/Sandbox.js.map +1 -0
- package/lib/SandboxAgent.d.ts +55 -0
- package/lib/SandboxAgent.d.ts.map +1 -0
- package/lib/SandboxAgent.js +385 -0
- package/lib/SandboxAgent.js.map +1 -0
- package/lib/SandboxAgentClient.d.ts +154 -0
- package/lib/SandboxAgentClient.d.ts.map +1 -0
- package/lib/SandboxAgentClient.js +174 -0
- package/lib/SandboxAgentClient.js.map +1 -0
- package/lib/Schema.d.ts.map +1 -1
- package/lib/Schema.js.map +1 -1
- package/lib/Secrets/DotEnv.d.ts.map +1 -1
- package/lib/Secrets/DotEnv.js.map +1 -1
- package/lib/Secrets/Log.d.ts.map +1 -1
- package/lib/Secrets/Log.js.map +1 -1
- package/lib/Secrets/ProcessEnv.d.ts.map +1 -1
- package/lib/Secrets/ProcessEnv.js.map +1 -1
- package/lib/Secrets/Provider.d.ts +2 -1
- package/lib/Secrets/Provider.d.ts.map +1 -1
- package/lib/Secrets/Provider.js.map +1 -1
- package/lib/Secrets/index.d.ts.map +1 -1
- package/lib/Secrets/index.js.map +1 -1
- package/lib/Self.d.ts.map +1 -1
- package/lib/Self.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/StackContext.d.ts.map +1 -1
- package/lib/StackContext.js.map +1 -1
- package/lib/Stage.d.ts.map +1 -1
- package/lib/Stage.js.map +1 -1
- package/lib/State/ActionState.d.ts.map +1 -1
- package/lib/State/ActionState.js.map +1 -1
- package/lib/State/BucketState.d.ts +2 -1
- package/lib/State/BucketState.d.ts.map +1 -1
- package/lib/State/BucketState.js +52 -21
- package/lib/State/BucketState.js.map +1 -1
- package/lib/State/Export.d.ts.map +1 -1
- package/lib/State/Export.js.map +1 -1
- package/lib/State/HttpStateApi.d.ts.map +1 -1
- package/lib/State/HttpStateApi.js.map +1 -1
- package/lib/State/HttpStateStore.d.ts.map +1 -1
- package/lib/State/HttpStateStore.js.map +1 -1
- package/lib/State/InMemoryState.d.ts.map +1 -1
- package/lib/State/InMemoryState.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 +7 -1
- package/lib/State/Provisioning.d.ts.map +1 -1
- package/lib/State/Provisioning.js +6 -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/ResourceState.js.map +1 -1
- package/lib/State/State.d.ts +26 -0
- package/lib/State/State.d.ts.map +1 -1
- package/lib/State/State.js.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/Sync.d.ts.map +1 -1
- package/lib/State/Sync.js.map +1 -1
- package/lib/State/Tree.d.ts.map +1 -1
- package/lib/State/Tree.js.map +1 -1
- package/lib/State/index.d.ts.map +1 -1
- package/lib/State/index.js +2 -2
- package/lib/State/index.js.map +1 -1
- package/lib/Tags.d.ts.map +1 -1
- package/lib/Tags.js.map +1 -1
- package/lib/Telemetry/Attributes.d.ts.map +1 -1
- package/lib/Telemetry/Attributes.js +1 -0
- package/lib/Telemetry/Attributes.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/Telemetry/Metrics.js.map +1 -1
- package/lib/Telemetry.d.ts.map +1 -1
- package/lib/Telemetry.js.map +1 -1
- package/lib/TelemetryRelay.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/UserFacingError.d.ts.map +1 -1
- package/lib/UserFacingError.js.map +1 -1
- package/lib/Util/AtomicFile.d.ts.map +1 -1
- package/lib/Util/AtomicFile.js +3 -2
- package/lib/Util/AtomicFile.js.map +1 -1
- package/lib/Util/BatchedSink.d.ts.map +1 -1
- package/lib/Util/BatchedSink.js.map +1 -1
- package/lib/Util/ConfigProvider.d.ts.map +1 -1
- package/lib/Util/ConfigProvider.js +1 -0
- package/lib/Util/ConfigProvider.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 +56 -14
- package/lib/Util/ConsoleSink.js.map +1 -1
- package/lib/Util/Duration.d.ts.map +1 -1
- package/lib/Util/Duration.js.map +1 -1
- package/lib/Util/Http1Dispatcher.d.ts.map +1 -1
- package/lib/Util/Http1Dispatcher.js.map +1 -1
- package/lib/Util/Ignore.d.ts +3 -1
- package/lib/Util/Ignore.d.ts.map +1 -1
- package/lib/Util/Ignore.js +20 -11
- package/lib/Util/Ignore.js.map +1 -1
- package/lib/Util/LineBuffer.d.ts.map +1 -1
- package/lib/Util/LineBuffer.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/Memoize.d.ts.map +1 -1
- package/lib/Util/Memoize.js.map +1 -1
- 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 +18 -3
- package/lib/Util/PlatformServices.js.map +1 -1
- package/lib/Util/Redaction.d.ts.map +1 -1
- package/lib/Util/Redaction.js.map +1 -1
- package/lib/Util/ResourceOutput.d.ts +22 -11
- package/lib/Util/ResourceOutput.d.ts.map +1 -1
- package/lib/Util/ResourceOutput.js +28 -26
- 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/Stream.d.ts.map +1 -1
- package/lib/Util/Stream.js.map +1 -1
- package/lib/Util/Terminal.d.ts +23 -12
- package/lib/Util/Terminal.d.ts.map +1 -1
- package/lib/Util/Terminal.js +26 -45
- package/lib/Util/Terminal.js.map +1 -1
- package/lib/Util/Theme.d.ts.map +1 -1
- package/lib/Util/Theme.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/base32.d.ts.map +1 -1
- package/lib/Util/base32.js.map +1 -1
- 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/camel.d.ts.map +1 -1
- package/lib/Util/camel.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/dedent.d.ts.map +1 -1
- package/lib/Util/dedent.js.map +1 -1
- package/lib/Util/effect.d.ts.map +1 -1
- package/lib/Util/effect.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/exec.d.ts.map +1 -1
- package/lib/Util/exec.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/index.d.ts.map +1 -1
- package/lib/Util/index.js.map +1 -1
- package/lib/Util/interactive.d.ts.map +1 -1
- package/lib/Util/interactive.js +1 -1
- package/lib/Util/interactive.js.map +1 -1
- package/lib/Util/ip-address.d.ts.map +1 -1
- package/lib/Util/ip-address.js.map +1 -1
- package/lib/Util/isPathWithin.d.ts.map +1 -1
- package/lib/Util/isPathWithin.js.map +1 -1
- package/lib/Util/layer-scoped.d.ts.map +1 -1
- package/lib/Util/layer-scoped.js.map +1 -1
- package/lib/Util/md5.d.ts.map +1 -1
- package/lib/Util/md5.js.map +1 -1
- package/lib/Util/poll.d.ts.map +1 -1
- package/lib/Util/poll.js.map +1 -1
- package/lib/Util/scc.d.ts +7 -1
- package/lib/Util/scc.d.ts.map +1 -1
- package/lib/Util/scc.js +16 -15
- package/lib/Util/scc.js.map +1 -1
- package/lib/Util/service.d.ts.map +1 -1
- package/lib/Util/service.js.map +1 -1
- package/lib/Util/sha256.d.ts.map +1 -1
- package/lib/Util/sha256.js.map +1 -1
- package/lib/Util/stable.d.ts.map +1 -1
- package/lib/Util/stable.js.map +1 -1
- package/lib/Util/tarGzip.d.ts +2 -1
- package/lib/Util/tarGzip.d.ts.map +1 -1
- package/lib/Util/tarGzip.js.map +1 -1
- package/lib/Util/type.d.ts.map +1 -1
- package/lib/Util/type.js.map +1 -1
- package/lib/Util/types.d.ts.map +1 -1
- package/lib/Util/types.js.map +1 -1
- package/lib/Util/unknown.d.ts.map +1 -1
- package/lib/Util/unknown.js.map +1 -1
- package/lib/Util/zip.d.ts.map +1 -1
- package/lib/Util/zip.js.map +1 -1
- package/lib/WebhookHost.d.ts.map +1 -1
- package/lib/WebhookHost.js.map +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/Website/FrontendCore.d.ts.map +1 -1
- package/lib/Website/FrontendCore.js.map +1 -1
- package/lib/Website/Server.d.ts.map +1 -1
- package/lib/Website/Server.js +11 -1
- package/lib/Website/Server.js.map +1 -1
- package/lib/Website/ServerLocal.d.ts.map +1 -1
- package/lib/Website/ServerLocal.js.map +1 -1
- package/lib/Website/assets.d.ts.map +1 -1
- package/lib/Website/assets.js.map +1 -1
- package/lib/Website/packExtraFiles.d.ts.map +1 -1
- package/lib/Website/packExtraFiles.js.map +1 -1
- package/lib/Workers/DurableObject.d.ts +118 -0
- package/lib/Workers/DurableObject.d.ts.map +1 -0
- package/lib/Workers/DurableObject.js +146 -0
- package/lib/Workers/DurableObject.js.map +1 -0
- package/lib/Workers/DurableObjectBridge.d.ts +100 -0
- package/lib/Workers/DurableObjectBridge.d.ts.map +1 -0
- package/lib/Workers/DurableObjectBridge.js +146 -0
- package/lib/Workers/DurableObjectBridge.js.map +1 -0
- package/lib/Workers/DurableObjectEngine.d.ts +51 -0
- package/lib/Workers/DurableObjectEngine.d.ts.map +1 -0
- package/lib/Workers/DurableObjectEngine.js +331 -0
- package/lib/Workers/DurableObjectEngine.js.map +1 -0
- package/lib/Workers/EffectRpc.d.ts +25 -0
- package/lib/Workers/EffectRpc.d.ts.map +1 -0
- package/lib/Workers/EffectRpc.js +25 -0
- package/lib/Workers/EffectRpc.js.map +1 -0
- package/lib/Workers/EventLifetime.d.ts +57 -0
- package/lib/Workers/EventLifetime.d.ts.map +1 -0
- package/lib/Workers/EventLifetime.js +73 -0
- package/lib/Workers/EventLifetime.js.map +1 -0
- package/lib/Workers/InputGate.d.ts +107 -0
- package/lib/Workers/InputGate.d.ts.map +1 -0
- package/lib/Workers/InputGate.js +183 -0
- package/lib/Workers/InputGate.js.map +1 -0
- package/lib/Workers/RpcWebSocketClient.d.ts +30 -0
- package/lib/Workers/RpcWebSocketClient.d.ts.map +1 -0
- package/lib/Workers/RpcWebSocketClient.js +25 -0
- package/lib/Workers/RpcWebSocketClient.js.map +1 -0
- package/lib/Workers/Worker.d.ts +80 -0
- package/lib/Workers/Worker.d.ts.map +1 -0
- package/lib/Workers/Worker.js +150 -0
- package/lib/Workers/Worker.js.map +1 -0
- package/lib/Workers/WorkerBridge.d.ts +70 -0
- package/lib/Workers/WorkerBridge.d.ts.map +1 -0
- package/lib/Workers/WorkerBridge.js +91 -0
- package/lib/Workers/WorkerBridge.js.map +1 -0
- package/lib/Workers/WorkerEnvironment.d.ts +10 -0
- package/lib/Workers/WorkerEnvironment.d.ts.map +1 -0
- package/lib/Workers/WorkerEnvironment.js +8 -0
- package/lib/Workers/WorkerEnvironment.js.map +1 -0
- package/lib/Workers/Workerd/AlarmCallback.d.ts +26 -0
- package/lib/Workers/Workerd/AlarmCallback.d.ts.map +1 -0
- package/lib/Workers/Workerd/AlarmCallback.js +343 -0
- package/lib/Workers/Workerd/AlarmCallback.js.map +1 -0
- package/lib/Workers/Workerd/Bundle.d.ts +82 -0
- package/lib/Workers/Workerd/Bundle.d.ts.map +1 -0
- package/lib/Workers/Workerd/Bundle.js +166 -0
- package/lib/Workers/Workerd/Bundle.js.map +1 -0
- package/lib/Workers/Workerd/DurableObjectAlarmStorage.d.ts +14 -0
- package/lib/Workers/Workerd/DurableObjectAlarmStorage.d.ts.map +1 -0
- package/lib/Workers/Workerd/DurableObjectAlarmStorage.js +84 -0
- package/lib/Workers/Workerd/DurableObjectAlarmStorage.js.map +1 -0
- package/lib/Workers/Workerd/DurableObjectBridge.d.ts +50 -0
- package/lib/Workers/Workerd/DurableObjectBridge.d.ts.map +1 -0
- package/lib/Workers/Workerd/DurableObjectBridge.js +77 -0
- package/lib/Workers/Workerd/DurableObjectBridge.js.map +1 -0
- package/lib/Workers/Workerd/DurableObjectState.d.ts +92 -0
- package/lib/Workers/Workerd/DurableObjectState.d.ts.map +1 -0
- package/lib/Workers/Workerd/DurableObjectState.js +39 -0
- package/lib/Workers/Workerd/DurableObjectState.js.map +1 -0
- package/lib/Workers/Workerd/DurableObjectStorage.d.ts +89 -0
- package/lib/Workers/Workerd/DurableObjectStorage.d.ts.map +1 -0
- package/lib/Workers/Workerd/DurableObjectStorage.js +248 -0
- package/lib/Workers/Workerd/DurableObjectStorage.js.map +1 -0
- package/lib/Workers/Workerd/DurableObjectTransactionContext.d.ts +13 -0
- package/lib/Workers/Workerd/DurableObjectTransactionContext.d.ts.map +1 -0
- package/lib/Workers/Workerd/DurableObjectTransactionContext.js +5 -0
- package/lib/Workers/Workerd/DurableObjectTransactionContext.js.map +1 -0
- package/lib/Workers/Workerd/HttpServer.d.ts +12 -0
- package/lib/Workers/Workerd/HttpServer.d.ts.map +1 -0
- package/lib/Workers/Workerd/HttpServer.js +104 -0
- package/lib/Workers/Workerd/HttpServer.js.map +1 -0
- package/lib/Workers/Workerd/Module.d.ts +14 -0
- package/lib/Workers/Workerd/Module.d.ts.map +1 -0
- package/lib/Workers/Workerd/Module.js +23 -0
- package/lib/Workers/Workerd/Module.js.map +1 -0
- package/lib/Workers/Workerd/Request.d.ts +6 -0
- package/lib/Workers/Workerd/Request.d.ts.map +1 -0
- package/lib/Workers/Workerd/Request.js +4 -0
- package/lib/Workers/Workerd/Request.js.map +1 -0
- package/lib/Workers/Workerd/RpcDurableObject.d.ts +18 -0
- package/lib/Workers/Workerd/RpcDurableObject.d.ts.map +1 -0
- package/lib/Workers/Workerd/RpcDurableObject.js +66 -0
- package/lib/Workers/Workerd/RpcDurableObject.js.map +1 -0
- package/lib/Workers/Workerd/RpcWebSocket.d.ts +25 -0
- package/lib/Workers/Workerd/RpcWebSocket.d.ts.map +1 -0
- package/lib/Workers/Workerd/RpcWebSocket.js +248 -0
- package/lib/Workers/Workerd/RpcWebSocket.js.map +1 -0
- package/lib/Workers/Workerd/ScheduledEvents.d.ts +22 -0
- package/lib/Workers/Workerd/ScheduledEvents.d.ts.map +1 -0
- package/lib/Workers/Workerd/ScheduledEvents.js +119 -0
- package/lib/Workers/Workerd/ScheduledEvents.js.map +1 -0
- package/lib/Workers/Workerd/WebSocket.d.ts +71 -0
- package/lib/Workers/Workerd/WebSocket.d.ts.map +1 -0
- package/lib/Workers/Workerd/WebSocket.js +66 -0
- package/lib/Workers/Workerd/WebSocket.js.map +1 -0
- package/lib/Workers/Workerd/WorkerBridge.d.ts +41 -0
- package/lib/Workers/Workerd/WorkerBridge.d.ts.map +1 -0
- package/lib/Workers/Workerd/WorkerBridge.js +80 -0
- package/lib/Workers/Workerd/WorkerBridge.js.map +1 -0
- package/lib/Workers/Workerd/WorkerEvent.d.ts +18 -0
- package/lib/Workers/Workerd/WorkerEvent.d.ts.map +1 -0
- package/lib/Workers/Workerd/WorkerEvent.js +12 -0
- package/lib/Workers/Workerd/WorkerEvent.js.map +1 -0
- package/lib/Workers/Workerd/WorkerModulePlugin.d.ts +23 -0
- package/lib/Workers/Workerd/WorkerModulePlugin.d.ts.map +1 -0
- package/lib/Workers/Workerd/WorkerModulePlugin.js +52 -0
- package/lib/Workers/Workerd/WorkerModulePlugin.js.map +1 -0
- package/lib/Workers/Workerd/WorkerRuntimeContext.d.ts +26 -0
- package/lib/Workers/Workerd/WorkerRuntimeContext.d.ts.map +1 -0
- package/lib/Workers/Workerd/WorkerRuntimeContext.js +129 -0
- package/lib/Workers/Workerd/WorkerRuntimeContext.js.map +1 -0
- package/lib/Workers/Workerd/internal/StorageTransaction.d.ts +10 -0
- package/lib/Workers/Workerd/internal/StorageTransaction.d.ts.map +1 -0
- package/lib/Workers/Workerd/internal/StorageTransaction.js +15 -0
- package/lib/Workers/Workerd/internal/StorageTransaction.js.map +1 -0
- package/lib/Workers/WorkflowFailure.d.ts +47 -0
- package/lib/Workers/WorkflowFailure.d.ts.map +1 -0
- package/lib/Workers/WorkflowFailure.js +363 -0
- package/lib/Workers/WorkflowFailure.js.map +1 -0
- package/lib/Workers.d.ts +14 -0
- package/lib/Workers.d.ts.map +1 -0
- package/lib/Workers.js +14 -0
- package/lib/Workers.js.map +1 -0
- package/lib/WorkflowEncoding.d.ts.map +1 -1
- package/lib/WorkflowEncoding.js.map +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 +25 -31
- package/src/AdoptPolicy.ts +76 -0
- package/src/Alchemist/AuthRegistry.ts +224 -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} +127 -42
- package/src/Alchemist/index.ts +32 -15
- package/src/Apply.ts +522 -305
- package/src/Artifacts.ts +14 -7
- package/src/Auth/AuthProvider.ts +121 -36
- 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 +7 -9
- package/src/Auth/OAuthFlow.ts +50 -29
- package/src/Auth/Paths.ts +3 -2
- package/src/Auth/Profile.ts +34 -3
- 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 +18 -12
- package/src/Cli/GlobalLog.ts +211 -70
- package/src/Cli/JsonConsole.ts +87 -0
- package/src/Cli/LoggingCli.ts +41 -28
- package/src/Cli/PlainCliFormatter.ts +4 -1
- package/src/Cli/Present.ts +34 -0
- package/src/Cli/SigilRenderer.ts +72 -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 +69 -10
- package/src/Cli/commands/drift.ts +36 -19
- package/src/Cli/commands/errors.ts +8 -17
- package/src/Cli/commands/flags.ts +3 -1
- package/src/Cli/commands/instrument.ts +39 -8
- package/src/Cli/commands/logs.ts +23 -30
- package/src/Cli/commands/nuke.ts +32 -27
- 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 +316 -89
- 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 +36 -15
- package/src/Cli/components/ui/Layout.tsx +1 -1
- package/src/Cli/components/ui/Live.tsx +89 -10
- package/src/Cli/components/ui/ProgramStatus.ts +14 -0
- package/src/Cli/components/ui/Typography.tsx +1 -1
- package/src/Cli/components/ui/index.ts +3 -2
- package/src/Cli/components/view/ApprovePlan.tsx +4 -1
- package/src/Cli/components/view/Format.tsx +58 -0
- package/src/Cli/components/view/Help.tsx +18 -20
- 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 +2 -1
- package/src/Cli/components/view/PlanRow.tsx +1 -1
- package/src/Cli/components/view/PlanTree.ts +12 -4
- package/src/Cli/components/view/PlanView.tsx +6 -3
- 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 +138 -238
- package/src/Cli/components/view/SigilCli.tsx +26 -21
- package/src/Cli/components/view/StackOutputs.tsx +2 -2
- package/src/Cli/components/view/StateExplorer.tsx +2 -1
- package/src/Cli/components/view/statusStyle.ts +2 -2
- package/src/Cli/components/view/usePlanPresentation.ts +15 -1
- package/src/Cli/exec.ts +52 -42
- package/src/Cli/main.ts +60 -36
- package/src/Cli/selectCli.ts +58 -6
- 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 +142 -29
- package/src/DNS/Adapter.ts +290 -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 +268 -127
- package/src/EvalStack.ts +97 -0
- package/src/Events.ts +330 -0
- package/src/Interaction.ts +370 -105
- package/src/Local/LocalProvider.ts +40 -9
- package/src/Local/RpcProvider.ts +26 -7
- package/src/Local/RpcProviderProxy.ts +29 -21
- package/src/Local/RpcSerialization.ts +66 -18
- package/src/Local/RpcServer.ts +38 -19
- package/src/Local/RpcServerBun.ts +18 -8
- package/src/Local/RpcServerEnvironment.ts +2 -2
- package/src/Local/RpcServerNode.ts +26 -4
- package/src/Local/RpcServerSession.ts +2 -2
- package/src/Local/RpcSpawner.ts +89 -51
- package/src/Local/RpcToken.ts +63 -0
- package/src/Local/Sidecar.ts +10 -1
- package/src/Mount.ts +113 -0
- package/src/Nuke.ts +67 -44
- package/src/Output.ts +185 -17
- package/src/Phase.ts +2 -1
- package/src/Plan.ts +700 -220
- package/src/Platform.ts +82 -21
- package/src/Provider.ts +108 -19
- package/src/RemovalPolicy.ts +57 -4
- package/src/Report.ts +77 -275
- package/src/Resource.ts +124 -8
- package/src/Rpc.ts +70 -8
- package/src/Runtime/Bootstrap.ts +11 -15
- package/src/Runtime/ManagedHttpShutdown.ts +21 -4
- package/src/Runtime/Process.ts +40 -1
- package/src/RuntimeContext.ts +28 -1
- package/src/Sandbox.ts +189 -0
- package/src/SandboxAgent.ts +585 -0
- package/src/SandboxAgentClient.ts +312 -0
- package/src/Secrets/Provider.ts +2 -0
- package/src/Stack.ts +113 -135
- package/src/State/BucketState.ts +62 -32
- package/src/State/LocalState.ts +7 -9
- package/src/State/Provisioning.ts +15 -2
- 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/Attributes.ts +1 -0
- 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/AtomicFile.ts +3 -2
- package/src/Util/ConfigProvider.ts +1 -0
- package/src/Util/ConsoleSink.ts +78 -13
- package/src/Util/Ignore.ts +14 -8
- 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 +31 -5
- package/src/Util/ResourceOutput.ts +33 -29
- package/src/Util/Shutdown.ts +52 -0
- package/src/Util/Terminal.ts +34 -58
- 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/Util/scc.ts +18 -13
- package/src/Util/tarGzip.ts +3 -2
- package/src/Website/AstroOutput.ts +83 -0
- package/src/Website/Server.ts +1 -0
- package/src/Workers/DurableObject.ts +307 -0
- package/src/Workers/DurableObjectBridge.ts +322 -0
- package/src/Workers/DurableObjectEngine.ts +609 -0
- package/src/Workers/EffectRpc.ts +53 -0
- package/src/Workers/EventLifetime.ts +84 -0
- package/src/Workers/InputGate.ts +249 -0
- package/src/Workers/RpcWebSocketClient.ts +67 -0
- package/src/Workers/Worker.ts +283 -0
- package/src/Workers/WorkerBridge.ts +173 -0
- package/src/Workers/WorkerEnvironment.ts +9 -0
- package/src/Workers/Workerd/AlarmCallback.ts +557 -0
- package/src/Workers/Workerd/Bundle.ts +282 -0
- package/src/Workers/Workerd/DurableObjectAlarmStorage.ts +102 -0
- package/src/Workers/Workerd/DurableObjectBridge.ts +159 -0
- package/src/Workers/Workerd/DurableObjectState.ts +153 -0
- package/src/Workers/Workerd/DurableObjectStorage.ts +559 -0
- package/src/Workers/Workerd/DurableObjectTransactionContext.ts +18 -0
- package/src/Workers/Workerd/HttpServer.ts +139 -0
- package/src/Workers/Workerd/Module.ts +35 -0
- package/src/Workers/Workerd/Request.ts +3 -0
- package/src/Workers/Workerd/RpcDurableObject.ts +121 -0
- package/src/Workers/Workerd/RpcWebSocket.ts +348 -0
- package/src/Workers/Workerd/ScheduledEvents.ts +191 -0
- package/src/Workers/Workerd/WebSocket.ts +154 -0
- package/src/Workers/Workerd/WorkerBridge.ts +149 -0
- package/src/Workers/Workerd/WorkerEvent.ts +33 -0
- package/src/Workers/Workerd/WorkerModulePlugin.ts +73 -0
- package/src/Workers/Workerd/WorkerRuntimeContext.ts +195 -0
- package/src/Workers/Workerd/internal/StorageTransaction.ts +21 -0
- package/src/Workers/WorkflowFailure.ts +437 -0
- package/src/Workers.ts +13 -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 +0 -81
- package/lib/Alchemist/routes/state.d.ts.map +0 -1
- package/lib/Alchemist/routes/state.js +0 -116
- 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/lib/Util/proxy-chain.d.ts +0 -36
- package/lib/Util/proxy-chain.d.ts.map +0 -1
- package/lib/Util/proxy-chain.js +0 -133
- package/lib/Util/proxy-chain.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/Util/proxy-chain.ts +0 -161
package/src/Plan.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/** @effect-diagnostics anyUnknownInErrorContext:off */
|
|
2
1
|
/** @effect-diagnostics missingEffectError:off */
|
|
3
2
|
import * as Cause from "effect/Cause";
|
|
4
3
|
import * as Config from "effect/Config";
|
|
@@ -10,7 +9,13 @@ import * as Option from "effect/Option";
|
|
|
10
9
|
import * as Ref from "effect/Ref";
|
|
11
10
|
import { asEffect } from ".//Util/types.ts";
|
|
12
11
|
import { isAction, type ActionLike } from "./Action.ts";
|
|
13
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
AdoptPolicy,
|
|
14
|
+
OwnedBySomeoneElse,
|
|
15
|
+
stripUnowned,
|
|
16
|
+
Unowned,
|
|
17
|
+
UnverifiableReplacement,
|
|
18
|
+
} from "./AdoptPolicy.ts";
|
|
14
19
|
import { AlchemyContext } from "./AlchemyContext.ts";
|
|
15
20
|
import {
|
|
16
21
|
Artifacts,
|
|
@@ -29,6 +34,7 @@ import {
|
|
|
29
34
|
type ReplaceDiff,
|
|
30
35
|
type UpdateDiff,
|
|
31
36
|
} from "./Diff.ts";
|
|
37
|
+
import { emit, type PlannedAction, type PlannedBinding, type PlannedResource } from "./Events.ts";
|
|
32
38
|
import { parseFqn } from "./FQN.ts";
|
|
33
39
|
import { generateInstanceId } from "./InstanceId.ts";
|
|
34
40
|
import * as Output from "./Output.ts";
|
|
@@ -41,14 +47,10 @@ import {
|
|
|
41
47
|
type ProviderService,
|
|
42
48
|
} from "./Provider.ts";
|
|
43
49
|
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
|
+
import { ProtectedResource } from "./RemovalPolicy.ts";
|
|
50
51
|
import {
|
|
51
52
|
isResource,
|
|
53
|
+
LookupOfManagedResourceError,
|
|
52
54
|
missingImplementation,
|
|
53
55
|
type ResourceBinding,
|
|
54
56
|
type ResourceLike,
|
|
@@ -80,7 +82,7 @@ import {
|
|
|
80
82
|
type UpdatingReourceState,
|
|
81
83
|
} from "./State/index.ts";
|
|
82
84
|
import { isPlainData, mapPlainData } from "./Util/data.ts";
|
|
83
|
-
import { findCycleMembers } from "./Util/scc.ts";
|
|
85
|
+
import { findCycleMembers, findCycles } from "./Util/scc.ts";
|
|
84
86
|
import { hashInput } from "./Util/sha256.ts";
|
|
85
87
|
|
|
86
88
|
export type PlanError = never;
|
|
@@ -191,6 +193,8 @@ export interface Replace<R extends ResourceLike = ResourceLike> extends ApplyNod
|
|
|
191
193
|
props: any;
|
|
192
194
|
deleteFirst: boolean;
|
|
193
195
|
restart?: boolean;
|
|
196
|
+
/** Ownership probe of the replacement's physical identity, run before any mutation. */
|
|
197
|
+
deferredAdoption?: { adopt: boolean };
|
|
194
198
|
state:
|
|
195
199
|
| CreatingResourceState
|
|
196
200
|
| CreatedResourceState
|
|
@@ -370,6 +374,93 @@ export function make<A>(stack: StackSpec<A>, options: FilteredPlanOptions = {})
|
|
|
370
374
|
return makePlan(stack, options);
|
|
371
375
|
}
|
|
372
376
|
|
|
377
|
+
/**
|
|
378
|
+
* Bind every ref to a resource this program declares in its own stack and
|
|
379
|
+
* stage, so the ref is a dependency like a direct reference: the target is
|
|
380
|
+
* created first and deleted last, and the ref resolves to the target's fresh
|
|
381
|
+
* attributes (see `Output.bindRef`). A ref is matched by its id against the
|
|
382
|
+
* declared resource's FQN, which is what the ref reads from state. A
|
|
383
|
+
* resource's ref to itself stays unbound: it reads its own persisted state.
|
|
384
|
+
*/
|
|
385
|
+
const bindSameStackRefs = (
|
|
386
|
+
stack: StackSpec<any>,
|
|
387
|
+
resources: ReadonlyArray<ResourceLike>,
|
|
388
|
+
actions: ReadonlyArray<ActionLike>,
|
|
389
|
+
): ReadonlyArray<RefEdge> => {
|
|
390
|
+
const byFqn = new Map(resources.map((resource) => [resource.FQN, resource]));
|
|
391
|
+
const bind = (owner: string, value: unknown) => {
|
|
392
|
+
const edges: RefEdge[] = [];
|
|
393
|
+
for (const ref of Output.collectRefs(value)) {
|
|
394
|
+
if ((ref.stack ?? stack.name) !== stack.name) continue;
|
|
395
|
+
if ((ref.stage ?? stack.stage) !== stack.stage) continue;
|
|
396
|
+
if (ref.resourceId === owner) continue;
|
|
397
|
+
const target = byFqn.get(ref.resourceId);
|
|
398
|
+
if (target !== undefined) {
|
|
399
|
+
Output.bindRef(ref, target);
|
|
400
|
+
edges.push({ owner, target: target.FQN });
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
return edges;
|
|
404
|
+
};
|
|
405
|
+
const propEdges: RefEdge[] = [];
|
|
406
|
+
for (const resource of resources) {
|
|
407
|
+
propEdges.push(...bind(resource.FQN, resource.Props));
|
|
408
|
+
bind(resource.FQN, stack.bindings[resource.FQN] ?? []);
|
|
409
|
+
}
|
|
410
|
+
for (const action of actions) {
|
|
411
|
+
bind(action.FQN, [action.Input, action.Captures]);
|
|
412
|
+
}
|
|
413
|
+
return propEdges;
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
/** A same-stack ref in `owner`'s props, bound to the declared `target`. */
|
|
417
|
+
interface RefEdge {
|
|
418
|
+
readonly owner: string;
|
|
419
|
+
readonly target: string;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* A same-stack ref in a resource's props closes a cycle through props: the
|
|
424
|
+
* ref's target depends, through props, on the resource holding the ref. A
|
|
425
|
+
* direct reference can't form this cycle (it needs the declaration first),
|
|
426
|
+
* so only a ref can, and neither resource can resolve its props before the
|
|
427
|
+
* other. The plan fails instead of waiting forever or deploying a stale
|
|
428
|
+
* value. The fix belongs to the provider whose props carry the ref: keep in
|
|
429
|
+
* props only what the provider can't move into a binding.
|
|
430
|
+
*/
|
|
431
|
+
export class RefCycleError extends Data.TaggedError("RefCycleError")<{
|
|
432
|
+
message: string;
|
|
433
|
+
owner: string;
|
|
434
|
+
target: string;
|
|
435
|
+
}> {}
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* The first ref edge whose target reaches its owner through props, if any
|
|
439
|
+
* (see {@link RefCycleError}).
|
|
440
|
+
*/
|
|
441
|
+
const findRefCycle = (
|
|
442
|
+
edges: ReadonlyArray<RefEdge>,
|
|
443
|
+
upstream: { readonly [fqn: string]: ReadonlyArray<string> },
|
|
444
|
+
): { edge: RefEdge; path: string[] } | undefined => {
|
|
445
|
+
for (const edge of edges) {
|
|
446
|
+
// Depth-first from the target along prop dependencies, back to the owner.
|
|
447
|
+
const visited = new Set<string>();
|
|
448
|
+
const walk = (fqn: string, path: string[]): string[] | undefined => {
|
|
449
|
+
if (fqn === edge.owner) return path;
|
|
450
|
+
if (visited.has(fqn)) return undefined;
|
|
451
|
+
visited.add(fqn);
|
|
452
|
+
for (const next of upstream[fqn] ?? []) {
|
|
453
|
+
const found = walk(next, [...path, next]);
|
|
454
|
+
if (found) return found;
|
|
455
|
+
}
|
|
456
|
+
return undefined;
|
|
457
|
+
};
|
|
458
|
+
const path = walk(edge.target, [edge.target]);
|
|
459
|
+
if (path) return { edge, path: [edge.owner, ...path] };
|
|
460
|
+
}
|
|
461
|
+
return undefined;
|
|
462
|
+
};
|
|
463
|
+
|
|
373
464
|
const makePlan = <A>(
|
|
374
465
|
stack: StackSpec<A>,
|
|
375
466
|
options: FilteredPlanOptions = {},
|
|
@@ -377,13 +468,13 @@ const makePlan = <A>(
|
|
|
377
468
|
// @ts-expect-error
|
|
378
469
|
Effect.gen(function* () {
|
|
379
470
|
// Per-resource plan progress and phase markers are reported through
|
|
380
|
-
//
|
|
471
|
+
// events as the work happens, so a renderer can show
|
|
381
472
|
// plan computation while it runs. The default reporter is a no-op.
|
|
382
|
-
const reportPlanned = yield* Progress;
|
|
383
473
|
|
|
384
474
|
const declaredResources = Object.values(stack.resources);
|
|
385
475
|
const declaredActions = Object.values(stack.actions ?? {});
|
|
386
476
|
const declared = [...declaredResources, ...declaredActions];
|
|
477
|
+
const refPropEdges = bindSameStackRefs(stack, declaredResources, declaredActions);
|
|
387
478
|
const upstream = (node: ResourceLike | ActionLike) =>
|
|
388
479
|
Object.keys(
|
|
389
480
|
Output.upstreamAny(
|
|
@@ -397,7 +488,7 @@ const makePlan = <A>(
|
|
|
397
488
|
const actions = declaredActions.filter((node) => !selected || selected.has(node.FQN));
|
|
398
489
|
|
|
399
490
|
// Resolving the state service may bootstrap a remote store.
|
|
400
|
-
yield*
|
|
491
|
+
yield* emit({ type: "plan.phase", phase: "loading-state" });
|
|
401
492
|
const state = yield* yield* State;
|
|
402
493
|
|
|
403
494
|
// A bare platform tag yields a forward reference registered with
|
|
@@ -483,8 +574,9 @@ const makePlan = <A>(
|
|
|
483
574
|
stack: stackName,
|
|
484
575
|
stage: stage,
|
|
485
576
|
});
|
|
486
|
-
const oldResources = yield* Effect.
|
|
487
|
-
resourceFqns
|
|
577
|
+
const oldResources = yield* Effect.forEach(
|
|
578
|
+
resourceFqns,
|
|
579
|
+
(fqn) => state.get({ stack: stackName, stage: stage, fqn }),
|
|
488
580
|
{ concurrency: "unbounded" },
|
|
489
581
|
);
|
|
490
582
|
|
|
@@ -551,7 +643,7 @@ const makePlan = <A>(
|
|
|
551
643
|
if (remote.length > 0) yield* demandRemoteCredentials(remote);
|
|
552
644
|
}
|
|
553
645
|
|
|
554
|
-
yield*
|
|
646
|
+
yield* emit({ type: "plan.phase", phase: "computing-plan" });
|
|
555
647
|
|
|
556
648
|
// ── FQN renames ──────────────────────────────────────────────────────
|
|
557
649
|
// Map every former FQN claimed via `renamedFrom(...)` to its claimant's
|
|
@@ -739,135 +831,296 @@ const makePlan = <A>(
|
|
|
739
831
|
// `cachedInScope`): a diff that fails or is cancelled must not take the
|
|
740
832
|
// resolution every other diff is waiting on down with it.
|
|
741
833
|
const memoScope = yield* Effect.scope;
|
|
742
|
-
const resolvedResources: Record<string, Effect.Effect<any>> = {};
|
|
743
834
|
|
|
744
|
-
|
|
835
|
+
/**
|
|
836
|
+
* How the members of a cycle resolve while one of them is resolved: to
|
|
837
|
+
* `exposures` once those are known, and until then to their first pass,
|
|
838
|
+
* which leaves the data bound to them out. A member cannot wait on what
|
|
839
|
+
* the rest of the plan sees of its peers, since that waits on the member.
|
|
840
|
+
*/
|
|
841
|
+
interface Peers {
|
|
842
|
+
readonly members: ReadonlySet<string>;
|
|
843
|
+
readonly exposures?: ReadonlyMap<string, unknown>;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
/** What a node's outputs resolve to for the nodes that read them. */
|
|
847
|
+
interface Exposure {
|
|
848
|
+
readonly value: unknown;
|
|
849
|
+
/**
|
|
850
|
+
* How much of what the node last settled on `value` holds: all of it
|
|
851
|
+
* (`settled`), the attributes that survive its update, or `nothing`.
|
|
852
|
+
*/
|
|
853
|
+
readonly extent: string;
|
|
854
|
+
/**
|
|
855
|
+
* The persisted bindings of a settled resource, for comparing them once
|
|
856
|
+
* the peers of its cycle are known.
|
|
857
|
+
*/
|
|
858
|
+
readonly oldBindings?: ResourceBinding[];
|
|
859
|
+
/** The replacement its provider asked for. */
|
|
860
|
+
readonly replace?: ReplaceDiff;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
const haveBindingsChanged = (olds: ResourceBinding[], news: ResourceBinding[]) =>
|
|
864
|
+
diffBindings(olds, news).some((binding) => binding.action !== "noop");
|
|
865
|
+
|
|
866
|
+
const exposeResource = (
|
|
745
867
|
resourceExpr: Output.ResourceExpr<any, any>,
|
|
746
|
-
|
|
868
|
+
peers: Peers | undefined,
|
|
869
|
+
): Effect.Effect<Exposure, Config.ConfigError | StateStoreError> =>
|
|
870
|
+
// @ts-expect-error
|
|
747
871
|
Effect.gen(function* () {
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
872
|
+
const resource = resourceExpr.src;
|
|
873
|
+
const nothing: Exposure = { value: resourceExpr, extent: "nothing" };
|
|
874
|
+
|
|
875
|
+
const { provider, mode } = yield* resolveProviderAndMode(resource);
|
|
876
|
+
const props = materializeStableRefs(yield* resolveInput(resource.Props, undefined, peers));
|
|
877
|
+
// Falls back to the row at a former FQN (`renamedFrom`) so a
|
|
878
|
+
// renamed resource's stable attributes keep flowing to
|
|
879
|
+
// downstream diffs across the migration.
|
|
880
|
+
const { row: oldState } = yield* getPersistedRow(resource);
|
|
881
|
+
|
|
882
|
+
if (!oldState || oldState.status === "creating") {
|
|
883
|
+
return nothing;
|
|
754
884
|
}
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
885
|
+
|
|
886
|
+
// The resource is switching provider modes (local ⇄ live):
|
|
887
|
+
// it will be replaced, so nothing about the persisted attrs
|
|
888
|
+
// is stable for downstream consumers.
|
|
889
|
+
if (hasModeSwitched(mode, oldState)) {
|
|
890
|
+
return nothing;
|
|
758
891
|
}
|
|
759
|
-
// @ts-expect-error
|
|
760
|
-
return yield* (resolvedResources[resourceExpr.src.FQN] ??= yield* cachedInScope(memoScope)(
|
|
761
|
-
Effect.gen(function* () {
|
|
762
|
-
const resource = resourceExpr.src;
|
|
763
892
|
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
893
|
+
const oldProps = oldState.status === "updating" ? oldState.old.props : oldState.props;
|
|
894
|
+
|
|
895
|
+
// Normalize both sides through `dedupeBindings` so the binding
|
|
896
|
+
// sets handed to `diff` are deduped AND sid-sorted — provider
|
|
897
|
+
// diffs that hash/compare the arrays never churn on
|
|
898
|
+
// registration-order flips (or on legacy unsorted state).
|
|
899
|
+
const oldBindings = dedupeBindings(oldState.bindings ?? []);
|
|
900
|
+
const bindings = stack.bindings[resource.FQN] ?? [];
|
|
901
|
+
// A cycle member's bindings hold its peers' outputs: they stay
|
|
902
|
+
// unresolved, and are left out of the comparison, until those are known.
|
|
903
|
+
const blind = peers !== undefined && peers.exposures === undefined;
|
|
904
|
+
const newBindings = dedupeBindings(
|
|
905
|
+
blind ? bindings : yield* resolveInput(bindings, undefined, peers),
|
|
906
|
+
);
|
|
770
907
|
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
908
|
+
const diff = yield* provider.diff
|
|
909
|
+
? provider
|
|
910
|
+
.diff({
|
|
911
|
+
id: resource.LogicalId,
|
|
912
|
+
fqn: resource.FQN,
|
|
913
|
+
olds: oldProps,
|
|
914
|
+
instanceId: oldState.instanceId,
|
|
915
|
+
news: props,
|
|
916
|
+
output: oldState.attr,
|
|
917
|
+
oldBindings,
|
|
918
|
+
newBindings,
|
|
919
|
+
})
|
|
920
|
+
.pipe(providePlanScope(resource, oldState.instanceId))
|
|
921
|
+
: Effect.undefined;
|
|
922
|
+
|
|
923
|
+
// A present `diff.stables` is authoritative for this update and
|
|
924
|
+
// overrides `provider.stables`. We only fall back to the
|
|
925
|
+
// provider-level "always stable" list when the diff does not
|
|
926
|
+
// return one (e.g. no diff fn, or a diff that omits `stables`).
|
|
927
|
+
const stables: string[] = diff?.stables ?? provider.stables ?? [];
|
|
928
|
+
|
|
929
|
+
const surviving: Exposure =
|
|
930
|
+
stables.length > 0
|
|
931
|
+
? {
|
|
932
|
+
value: new Output.ResourceExpr(
|
|
933
|
+
resourceExpr.src,
|
|
934
|
+
Object.fromEntries(stables.map((stable) => [stable, oldState.attr?.[stable]])),
|
|
935
|
+
),
|
|
936
|
+
extent: `stables:${[...stables].sort().join(",")}`,
|
|
937
|
+
}
|
|
938
|
+
: // if there are no stable properties, treat every property as changed
|
|
939
|
+
nothing;
|
|
774
940
|
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
941
|
+
if (diff == null) {
|
|
942
|
+
if (
|
|
943
|
+
havePropsChanged(oldProps, props) ||
|
|
944
|
+
(!blind && haveBindingsChanged(oldBindings, newBindings))
|
|
945
|
+
) {
|
|
946
|
+
// the props have changed but the provider did not provide any hints as to what is stable
|
|
947
|
+
// so we must assume everything has changed
|
|
948
|
+
return surviving;
|
|
949
|
+
}
|
|
950
|
+
} else if (diff.action === "update") {
|
|
951
|
+
return surviving;
|
|
952
|
+
} else if (diff.action === "replace") {
|
|
953
|
+
return { ...nothing, replace: diff };
|
|
954
|
+
}
|
|
955
|
+
// `--force` upgrades this resource's noop to an update (see the
|
|
956
|
+
// diff mapping in the resource-graph pass below), so its
|
|
957
|
+
// `reconcile` WILL re-run and may produce fresh attributes —
|
|
958
|
+
// that is the point of --force. Returning the persisted attr
|
|
959
|
+
// snapshot here would bake potentially-stale values into every
|
|
960
|
+
// consumer's plan props and binding data, so consumers would
|
|
961
|
+
// keep the stale attrs even though the upstream just
|
|
962
|
+
// re-reconciled. Expose only the stable attributes and let
|
|
963
|
+
// apply re-evaluate the rest against the forced reconcile's
|
|
964
|
+
// fresh output. A noop diff may carry `stables` for exactly this
|
|
965
|
+
// case (conditional stables such as a rename-mutable `name`);
|
|
966
|
+
// without them the forced upstream would only expose
|
|
967
|
+
// `provider.stables` and identity-sensitive consumers would
|
|
968
|
+
// falsely plan a replacement (#1832).
|
|
969
|
+
if (options.force) {
|
|
970
|
+
return surviving;
|
|
971
|
+
}
|
|
972
|
+
if (
|
|
973
|
+
oldState.status === "created" ||
|
|
974
|
+
oldState.status === "updated" ||
|
|
975
|
+
oldState.status === "replaced"
|
|
976
|
+
) {
|
|
977
|
+
// we can safely return the attributes if we know they have stabilized
|
|
978
|
+
return { value: oldState.attr, extent: "settled", oldBindings };
|
|
979
|
+
} else {
|
|
980
|
+
// we must assume the resource doesn't exist if it hasn't stabilized
|
|
981
|
+
return nothing;
|
|
982
|
+
}
|
|
983
|
+
});
|
|
781
984
|
|
|
782
|
-
|
|
985
|
+
const exposeAction = (
|
|
986
|
+
resourceExpr: Output.ResourceExpr<any, any>,
|
|
987
|
+
node: ActionRun | ActionNoop,
|
|
988
|
+
): Exposure =>
|
|
989
|
+
node.action === "noop"
|
|
990
|
+
? { value: node.state.output, extent: "settled" }
|
|
991
|
+
: { value: resourceExpr, extent: "nothing" };
|
|
992
|
+
|
|
993
|
+
// A node's exposure with the peers of its cycle, if it has one, at their
|
|
994
|
+
// own first pass.
|
|
995
|
+
const firstPasses: Record<
|
|
996
|
+
string,
|
|
997
|
+
Effect.Effect<Exposure, Config.ConfigError | StateStoreError>
|
|
998
|
+
> = {};
|
|
999
|
+
const firstPass = (
|
|
1000
|
+
resourceExpr: Output.ResourceExpr<any, any>,
|
|
1001
|
+
): Effect.Effect<Exposure, Config.ConfigError | StateStoreError> =>
|
|
1002
|
+
Effect.gen(function* () {
|
|
1003
|
+
const node = resourceExpr.src;
|
|
1004
|
+
return yield* (firstPasses[node.FQN] ??= yield* cachedInScope(memoScope)(
|
|
1005
|
+
isAction(node)
|
|
1006
|
+
? Effect.map(firstActionPlan(node), (plan) => exposeAction(resourceExpr, plan))
|
|
1007
|
+
: exposeResource(resourceExpr, peersOf(node.FQN)),
|
|
1008
|
+
));
|
|
1009
|
+
});
|
|
783
1010
|
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
1011
|
+
/**
|
|
1012
|
+
* The exposure of every member of a cycle.
|
|
1013
|
+
*
|
|
1014
|
+
* A member's first pass cannot see the data bound to it, since that holds
|
|
1015
|
+
* its peers' outputs. So a member that settled is compared again with its
|
|
1016
|
+
* peers known, and the ones that turn out to have changed stop exposing
|
|
1017
|
+
* what they persisted, which may in turn change the members that read
|
|
1018
|
+
* them, until nothing more does. Without this a pool whose bound env
|
|
1019
|
+
* changed keeps handing the env it persisted to the host that runs it.
|
|
1020
|
+
*/
|
|
1021
|
+
interface Settled {
|
|
1022
|
+
readonly exposures: ReadonlyMap<string, unknown>;
|
|
1023
|
+
/** Actions whose first pass reused an output an input of which changed. */
|
|
1024
|
+
readonly reruns: ReadonlySet<string>;
|
|
1025
|
+
}
|
|
1026
|
+
const settledCycles = new Map<
|
|
1027
|
+
ReadonlySet<string>,
|
|
1028
|
+
Effect.Effect<Settled, Config.ConfigError | StateStoreError>
|
|
1029
|
+
>();
|
|
1030
|
+
const settle = (
|
|
1031
|
+
members: ReadonlySet<string>,
|
|
1032
|
+
): Effect.Effect<Settled, Config.ConfigError | StateStoreError> =>
|
|
1033
|
+
Effect.gen(function* () {
|
|
1034
|
+
const cached = settledCycles.get(members);
|
|
1035
|
+
if (cached) return yield* cached;
|
|
1036
|
+
const settling = yield* cachedInScope(memoScope)(
|
|
1037
|
+
Effect.gen(function* () {
|
|
1038
|
+
const nodes = [...members].map(
|
|
1039
|
+
(fqn) => Output.of(nodesByFqn.get(fqn) as any) as Output.ResourceExpr<any, any>,
|
|
792
1040
|
);
|
|
793
|
-
|
|
794
|
-
const
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
// consumer's plan props and binding data, so consumers would
|
|
847
|
-
// keep the stale attrs even though the upstream just
|
|
848
|
-
// re-reconciled. Expose only the stable attributes and let
|
|
849
|
-
// apply re-evaluate the rest against the forced reconcile's
|
|
850
|
-
// fresh output. A noop diff may carry `stables` for exactly this
|
|
851
|
-
// case (conditional stables such as a rename-mutable `name`);
|
|
852
|
-
// without them the forced upstream would only expose
|
|
853
|
-
// `provider.stables` and identity-sensitive consumers would
|
|
854
|
-
// falsely plan a replacement (#1832).
|
|
855
|
-
if (options.force) {
|
|
856
|
-
return withStables(oldState?.attr);
|
|
857
|
-
}
|
|
858
|
-
if (
|
|
859
|
-
oldState.status === "created" ||
|
|
860
|
-
oldState.status === "updated" ||
|
|
861
|
-
oldState.status === "replaced"
|
|
862
|
-
) {
|
|
863
|
-
// we can safely return the attributes if we know they have stabilized
|
|
864
|
-
return oldState?.attr;
|
|
865
|
-
} else {
|
|
866
|
-
// we must assume the resource doesn't exist if it hasn't stabilized
|
|
867
|
-
return resourceExpr;
|
|
1041
|
+
const first = yield* Effect.forEach(nodes, firstPass, { concurrency: "unbounded" });
|
|
1042
|
+
const exposures = new Map<string, unknown>(
|
|
1043
|
+
nodes.map((node, i) => [node.src.FQN, first[i].value]),
|
|
1044
|
+
);
|
|
1045
|
+
const peers: Peers = { members, exposures };
|
|
1046
|
+
const extents = new Map<string, string>(
|
|
1047
|
+
nodes.map((node, i) => [node.src.FQN, first[i].extent]),
|
|
1048
|
+
);
|
|
1049
|
+
const reruns = new Set<string>();
|
|
1050
|
+
const expose = (node: Output.ResourceExpr<any, any>) =>
|
|
1051
|
+
isAction(node.src)
|
|
1052
|
+
? Effect.map(planAction(node.src, peers), (plan) => exposeAction(node, plan))
|
|
1053
|
+
: exposeResource(node, peers);
|
|
1054
|
+
// The members to look at again: first the ones whose bound data
|
|
1055
|
+
// differs from what they persisted, then the ones that read a
|
|
1056
|
+
// member that changed.
|
|
1057
|
+
let suspects = (yield* Effect.forEach(
|
|
1058
|
+
nodes,
|
|
1059
|
+
(node, i) => {
|
|
1060
|
+
const { oldBindings } = first[i];
|
|
1061
|
+
return oldBindings === undefined
|
|
1062
|
+
? Effect.succeed([])
|
|
1063
|
+
: resolveInput(stack.bindings[node.src.FQN] ?? [], undefined, peers).pipe(
|
|
1064
|
+
Effect.map((bindings) =>
|
|
1065
|
+
haveBindingsChanged(oldBindings, dedupeBindings(bindings)) ? [node] : [],
|
|
1066
|
+
),
|
|
1067
|
+
);
|
|
1068
|
+
},
|
|
1069
|
+
{ concurrency: "unbounded" },
|
|
1070
|
+
)).flat();
|
|
1071
|
+
// A member only ever exposes less, so this ends; the bound guards
|
|
1072
|
+
// a provider whose stable attributes come and go.
|
|
1073
|
+
for (let round = 0; suspects.length > 0 && round <= 2 * nodes.length; round++) {
|
|
1074
|
+
const exposed = yield* Effect.forEach(suspects, expose, {
|
|
1075
|
+
concurrency: "unbounded",
|
|
1076
|
+
});
|
|
1077
|
+
const changing = new Set<string>();
|
|
1078
|
+
suspects.forEach((node, i) => {
|
|
1079
|
+
const fqn: string = node.src.FQN;
|
|
1080
|
+
const { extent } = exposed[i];
|
|
1081
|
+
if (extent === extents.get(fqn)) return;
|
|
1082
|
+
extents.set(fqn, extent);
|
|
1083
|
+
exposures.set(fqn, exposed[i].value);
|
|
1084
|
+
changing.add(fqn);
|
|
1085
|
+
if (isAction(node.src)) reruns.add(fqn);
|
|
1086
|
+
});
|
|
1087
|
+
suspects = nodes.filter(
|
|
1088
|
+
(node) =>
|
|
1089
|
+
extents.get(node.src.FQN) !== "nothing" &&
|
|
1090
|
+
(allUpstreamDependencies[node.src.FQN] ?? []).some((upstream) =>
|
|
1091
|
+
changing.has(upstream),
|
|
1092
|
+
),
|
|
1093
|
+
);
|
|
868
1094
|
}
|
|
1095
|
+
return { exposures, reruns } satisfies Settled;
|
|
869
1096
|
}),
|
|
870
|
-
)
|
|
1097
|
+
);
|
|
1098
|
+
settledCycles.set(members, settling);
|
|
1099
|
+
return yield* settling;
|
|
1100
|
+
});
|
|
1101
|
+
|
|
1102
|
+
const resolveResource = (
|
|
1103
|
+
resourceExpr: Output.ResourceExpr<any, any>,
|
|
1104
|
+
peers?: Peers,
|
|
1105
|
+
): Effect.Effect<any, Config.ConfigError | StateStoreError> =>
|
|
1106
|
+
Effect.gen(function* () {
|
|
1107
|
+
const fqn: string = resourceExpr.src.FQN;
|
|
1108
|
+
if (selected && !selected.has(fqn)) {
|
|
1109
|
+
return yield* Effect.die(
|
|
1110
|
+
new UnsafeSelectionBoundary({
|
|
1111
|
+
message: `Output evaluation discovered unselected dependency '${fqn}'. Declare the dependency explicitly or run a full deployment.`,
|
|
1112
|
+
}),
|
|
1113
|
+
);
|
|
1114
|
+
}
|
|
1115
|
+
if (peers?.members.has(fqn)) {
|
|
1116
|
+
return peers.exposures
|
|
1117
|
+
? peers.exposures.get(fqn)
|
|
1118
|
+
: (yield* firstPass(resourceExpr)).value;
|
|
1119
|
+
}
|
|
1120
|
+
const cycle = combinedCycles.get(fqn);
|
|
1121
|
+
return cycle
|
|
1122
|
+
? (yield* settle(cycle)).exposures.get(fqn)
|
|
1123
|
+
: (yield* firstPass(resourceExpr)).value;
|
|
871
1124
|
});
|
|
872
1125
|
|
|
873
1126
|
/**
|
|
@@ -888,12 +1141,14 @@ const makePlan = <A>(
|
|
|
888
1141
|
// a shared visited-set) keeps legitimately-shared diamond references
|
|
889
1142
|
// intact and is race-free under `concurrency: "unbounded"` (#1082).
|
|
890
1143
|
ancestors: ReadonlySet<object> = new Set(),
|
|
1144
|
+
// The cycle being resolved, if any.
|
|
1145
|
+
peers?: Peers,
|
|
891
1146
|
): Effect.Effect<any, Config.ConfigError | StateStoreError> =>
|
|
892
1147
|
Effect.gen(function* () {
|
|
893
1148
|
if (!input) {
|
|
894
1149
|
return input;
|
|
895
1150
|
} else if (Output.isExpr(input)) {
|
|
896
|
-
return yield* resolveOutput(input);
|
|
1151
|
+
return yield* resolveOutput(input, peers);
|
|
897
1152
|
} else if (Config.isConfig(input)) {
|
|
898
1153
|
// Config is a lazy reference to the deploy environment. Resolve it
|
|
899
1154
|
// here so the concrete value flows into diffing/hashing (an opaque
|
|
@@ -901,36 +1156,35 @@ const makePlan = <A>(
|
|
|
901
1156
|
// providers receive a resolved value instead of a Config object.
|
|
902
1157
|
// `Config.Redacted` resolves to a `Redacted`, which stays opaque via
|
|
903
1158
|
// the branch below.
|
|
904
|
-
return yield* resolveInput(yield* input, ancestors);
|
|
1159
|
+
return yield* resolveInput(yield* input, ancestors, peers);
|
|
905
1160
|
} else if (isResource(input)) {
|
|
906
1161
|
// Resource objects have dynamic properties (path, hash, etc.) that are
|
|
907
1162
|
// created on-demand by a Proxy getter and aren't enumerable via Object.entries.
|
|
908
1163
|
// Resolve the ResourceExpr to get the actual resource output, then continue
|
|
909
1164
|
// resolving any nested outputs in the result.
|
|
910
1165
|
const resourceExpr = Output.of(input);
|
|
911
|
-
const resolved = yield* resolveOutput(resourceExpr);
|
|
1166
|
+
const resolved = yield* resolveOutput(resourceExpr, peers);
|
|
912
1167
|
if (Output.isResourceExpr(resolved)) {
|
|
913
1168
|
// Still-unresolved reference (creating, replacing, or updating
|
|
914
1169
|
// upstream) — keep it evaluable for Apply.
|
|
915
1170
|
return resolved;
|
|
916
1171
|
}
|
|
917
|
-
return yield* resolveInput(resolved, ancestors);
|
|
1172
|
+
return yield* resolveInput(resolved, ancestors, peers);
|
|
918
1173
|
} else if (isPlainData(input)) {
|
|
919
1174
|
if (ancestors.has(input)) {
|
|
920
1175
|
return undefined;
|
|
921
1176
|
}
|
|
922
1177
|
const nested = new Set(ancestors).add(input);
|
|
923
1178
|
if (Array.isArray(input)) {
|
|
924
|
-
return yield* Effect.
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
);
|
|
1179
|
+
return yield* Effect.forEach(input, (item) => resolveInput(item, nested, peers), {
|
|
1180
|
+
concurrency: "unbounded",
|
|
1181
|
+
});
|
|
928
1182
|
}
|
|
929
1183
|
return Object.fromEntries(
|
|
930
|
-
yield* Effect.
|
|
931
|
-
Object.entries(input)
|
|
932
|
-
|
|
933
|
-
|
|
1184
|
+
yield* Effect.forEach(
|
|
1185
|
+
Object.entries(input),
|
|
1186
|
+
([key, value]) =>
|
|
1187
|
+
resolveInput(value, nested, peers).pipe(Effect.map((value) => [key, value])),
|
|
934
1188
|
{ concurrency: "unbounded" },
|
|
935
1189
|
),
|
|
936
1190
|
);
|
|
@@ -982,35 +1236,90 @@ const makePlan = <A>(
|
|
|
982
1236
|
return mapPlainData(input, ancestors, (child) => materializeStableRefs(child, ancestors));
|
|
983
1237
|
};
|
|
984
1238
|
|
|
1239
|
+
// A lookup that finds a resource this stack manages would bind it with
|
|
1240
|
+
// no dependency edge. Detected by the provider's static `stables`, the
|
|
1241
|
+
// properties that identify a resource; providers without them go unchecked.
|
|
1242
|
+
const rejectManagedLookup = Effect.fn(function* (
|
|
1243
|
+
expr: Output.LookupExpr<any>,
|
|
1244
|
+
props: unknown,
|
|
1245
|
+
attrs: Record<string, unknown>,
|
|
1246
|
+
) {
|
|
1247
|
+
const provider = yield* tryFindProviderByType(expr.lookupType, "live");
|
|
1248
|
+
const stables = Option.getOrUndefined(provider)?.stables ?? [];
|
|
1249
|
+
if (stables.length === 0) return;
|
|
1250
|
+
for (const [fqn, row] of persistedRows) {
|
|
1251
|
+
if (row === undefined || isActionState(row) || row.resourceType !== expr.lookupType) {
|
|
1252
|
+
continue;
|
|
1253
|
+
}
|
|
1254
|
+
const attr = row.attr as Record<string, unknown> | undefined;
|
|
1255
|
+
// An optional stable (a zone id on an account-level resource) is
|
|
1256
|
+
// undefined on both sides and still matches; at least one stable
|
|
1257
|
+
// must be set so an empty row never matches everything.
|
|
1258
|
+
if (
|
|
1259
|
+
attr !== undefined &&
|
|
1260
|
+
stables.some((key) => attr[key] !== undefined) &&
|
|
1261
|
+
stables.every((key) => attr[key] === attrs[key])
|
|
1262
|
+
) {
|
|
1263
|
+
return yield* Effect.die(
|
|
1264
|
+
new LookupOfManagedResourceError({
|
|
1265
|
+
message: `${expr.lookupType}.lookup(${JSON.stringify(props)}) found '${fqn}', which this stack manages. Reference the declared resource instead: a lookup would not stop this stack deleting or replacing it.`,
|
|
1266
|
+
type: expr.lookupType,
|
|
1267
|
+
props,
|
|
1268
|
+
fqn,
|
|
1269
|
+
}),
|
|
1270
|
+
);
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
});
|
|
1274
|
+
|
|
985
1275
|
const resolveOutput = (
|
|
986
1276
|
expr: Output.Expr<any>,
|
|
1277
|
+
// The cycle being resolved, if any.
|
|
1278
|
+
peers?: Peers,
|
|
987
1279
|
): Effect.Effect<any, Config.ConfigError | StateStoreError> =>
|
|
988
1280
|
Effect.gen(function* () {
|
|
989
1281
|
if (Output.isResourceExpr(expr)) {
|
|
990
|
-
return yield* resolveResource(expr);
|
|
1282
|
+
return yield* resolveResource(expr, peers);
|
|
991
1283
|
} else if (Output.isPropExpr(expr)) {
|
|
992
|
-
const upstream = yield* resolveOutput(expr.expr);
|
|
1284
|
+
const upstream = yield* resolveOutput(expr.expr, peers);
|
|
993
1285
|
return upstream?.[expr.identifier];
|
|
994
1286
|
} else if (Output.isApplyExpr(expr)) {
|
|
995
|
-
const upstream = yield* resolveOutput(expr.expr);
|
|
1287
|
+
const upstream = yield* resolveOutput(expr.expr, peers);
|
|
996
1288
|
return Output.hasOutputs(upstream) ? expr : expr.f(upstream);
|
|
1289
|
+
} else if (Output.isLookupExpr(expr)) {
|
|
1290
|
+
// Props that depend on a resource still being created resolve at
|
|
1291
|
+
// apply, like any other Output.
|
|
1292
|
+
const props = yield* resolveInput(expr.expr, undefined, peers);
|
|
1293
|
+
if (Output.hasOutputs(props)) return expr;
|
|
1294
|
+
const attrs = yield* expr.f(props);
|
|
1295
|
+
yield* rejectManagedLookup(expr, props, attrs);
|
|
1296
|
+
return attrs;
|
|
997
1297
|
} else if (Output.isEffectExpr(expr)) {
|
|
998
|
-
const upstream = yield* resolveOutput(expr.expr);
|
|
1298
|
+
const upstream = yield* resolveOutput(expr.expr, peers);
|
|
999
1299
|
return Output.hasOutputs(upstream) ? expr : yield* expr.f(upstream);
|
|
1000
1300
|
} else if (Output.isFlatMapExpr(expr)) {
|
|
1001
|
-
const upstream = yield* resolveOutput(expr.expr);
|
|
1301
|
+
const upstream = yield* resolveOutput(expr.expr, peers);
|
|
1002
1302
|
// Source still unresolved -> keep the flatMap intact for a later pass.
|
|
1003
1303
|
// Otherwise run `f` to produce the next Output and resolve into it.
|
|
1004
1304
|
return Output.hasOutputs(upstream)
|
|
1005
1305
|
? expr
|
|
1006
|
-
: yield* resolveOutput(Output.asOutput(expr.f(upstream)) as Output.Expr<any
|
|
1306
|
+
: yield* resolveOutput(Output.asOutput(expr.f(upstream)) as Output.Expr<any>, peers);
|
|
1007
1307
|
} else if (Output.isAllExpr(expr)) {
|
|
1008
|
-
return yield* Effect.
|
|
1308
|
+
return yield* Effect.forEach(expr.outs, (out) => resolveOutput(out, peers), {
|
|
1009
1309
|
concurrency: "unbounded",
|
|
1010
1310
|
});
|
|
1011
1311
|
} else if (Output.isLiteralExpr(expr)) {
|
|
1012
1312
|
return expr.value;
|
|
1013
1313
|
} else if (Output.isRefExpr(expr)) {
|
|
1314
|
+
// A ref bound to a declared resource resolves like a direct
|
|
1315
|
+
// reference: unknown while that resource is being created.
|
|
1316
|
+
const target = Output.refTarget(expr);
|
|
1317
|
+
if (target !== undefined) {
|
|
1318
|
+
return yield* resolveResource(
|
|
1319
|
+
Output.of(target as any) as Output.ResourceExpr<any, any>,
|
|
1320
|
+
peers,
|
|
1321
|
+
);
|
|
1322
|
+
}
|
|
1014
1323
|
const refStack = expr.stack ?? stackName;
|
|
1015
1324
|
const refStage = expr.stage ?? stage;
|
|
1016
1325
|
const refState = yield* state
|
|
@@ -1052,7 +1361,7 @@ const makePlan = <A>(
|
|
|
1052
1361
|
}
|
|
1053
1362
|
return output;
|
|
1054
1363
|
} else if (Output.isNamedExpr(expr)) {
|
|
1055
|
-
return yield* resolveOutput(expr.expr);
|
|
1364
|
+
return yield* resolveOutput(expr.expr, peers);
|
|
1056
1365
|
}
|
|
1057
1366
|
return yield* Effect.die(new Error("Not implemented yet" + (expr as any).kind));
|
|
1058
1367
|
});
|
|
@@ -1091,6 +1400,28 @@ const makePlan = <A>(
|
|
|
1091
1400
|
),
|
|
1092
1401
|
]);
|
|
1093
1402
|
|
|
1403
|
+
// Fail before resolving anything: a ref that closes a cycle through
|
|
1404
|
+
// props would leave both resources waiting on each other (#3112).
|
|
1405
|
+
const refCycle = findRefCycle(
|
|
1406
|
+
refPropEdges.filter((edge) => newResourceFqns.has(edge.owner)),
|
|
1407
|
+
newUpstreamDependencies,
|
|
1408
|
+
);
|
|
1409
|
+
if (refCycle !== undefined) {
|
|
1410
|
+
const { edge, path } = refCycle;
|
|
1411
|
+
return yield* Effect.die(
|
|
1412
|
+
new RefCycleError({
|
|
1413
|
+
message:
|
|
1414
|
+
`'${edge.owner}' references '${edge.target}' through a ref in its props, and ` +
|
|
1415
|
+
`'${edge.target}' depends on '${edge.owner}' through props ` +
|
|
1416
|
+
`(${path.join(" -> ")}). Neither can be planned before the other. ` +
|
|
1417
|
+
`Bind the reference instead of passing it as a prop, so the cycle runs ` +
|
|
1418
|
+
`through bindings.`,
|
|
1419
|
+
owner: edge.owner,
|
|
1420
|
+
target: edge.target,
|
|
1421
|
+
}),
|
|
1422
|
+
);
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1094
1425
|
// Map FQN -> list of upstream FQNs from bindings
|
|
1095
1426
|
const bindingUpstreamDependencies: {
|
|
1096
1427
|
[fqn: string]: string[];
|
|
@@ -1141,7 +1472,15 @@ const makePlan = <A>(
|
|
|
1141
1472
|
// Resources that participate in a cycle when both prop and binding
|
|
1142
1473
|
// edges are considered. Used below to decide whether an acyclic
|
|
1143
1474
|
// binding edge should also become a downstream edge.
|
|
1144
|
-
const
|
|
1475
|
+
const combinedCycles = findCycles(allUpstreamDependencies);
|
|
1476
|
+
const combinedCycleMembers = new Set(combinedCycles.keys());
|
|
1477
|
+
const peersOf = (fqn: string): Peers | undefined => {
|
|
1478
|
+
const members = combinedCycles.get(fqn);
|
|
1479
|
+
return members && { members };
|
|
1480
|
+
};
|
|
1481
|
+
const nodesByFqn = new Map<string, ResourceLike | ActionLike>(
|
|
1482
|
+
[...resources, ...actions].map((node) => [node.FQN, node]),
|
|
1483
|
+
);
|
|
1145
1484
|
const inputCycleMembers = findCycleMembers({
|
|
1146
1485
|
...newUpstreamDependencies,
|
|
1147
1486
|
...Object.fromEntries(
|
|
@@ -1217,56 +1556,75 @@ const makePlan = <A>(
|
|
|
1217
1556
|
...actions.map((action) => [action.FQN, computeDownstream(action.FQN)] as const),
|
|
1218
1557
|
]);
|
|
1219
1558
|
|
|
1559
|
+
const planAction = Effect.fn(function* (action: ActionLike, peers: Peers | undefined) {
|
|
1560
|
+
const fqn = action.FQN;
|
|
1561
|
+
const downstream = newDownstreamDependencies[fqn] ?? [];
|
|
1562
|
+
const oldState = yield* state.get({ stack: stackName, stage, fqn });
|
|
1563
|
+
const prior = isActionState(oldState) ? oldState : undefined;
|
|
1564
|
+
const resolvedInput = inputCycleMembers.has(fqn)
|
|
1565
|
+
? action.Input
|
|
1566
|
+
: yield* resolveInput(action.Input, undefined, peers);
|
|
1567
|
+
// Actions are pure in their inputs. Only a completed, unforced run
|
|
1568
|
+
// with fully known, identical inputs has a reusable output.
|
|
1569
|
+
if (
|
|
1570
|
+
prior?.status === "ran" &&
|
|
1571
|
+
!options.force &&
|
|
1572
|
+
!inputCycleMembers.has(fqn) &&
|
|
1573
|
+
isResolved(resolvedInput) &&
|
|
1574
|
+
prior.inputHash === (yield* hashInput(resolvedInput))
|
|
1575
|
+
) {
|
|
1576
|
+
return {
|
|
1577
|
+
kind: "action",
|
|
1578
|
+
action: "noop",
|
|
1579
|
+
def: action,
|
|
1580
|
+
state: prior,
|
|
1581
|
+
downstream,
|
|
1582
|
+
} satisfies ActionNoop;
|
|
1583
|
+
}
|
|
1584
|
+
return {
|
|
1585
|
+
kind: "action",
|
|
1586
|
+
action: "run",
|
|
1587
|
+
def: action,
|
|
1588
|
+
input: action.Input,
|
|
1589
|
+
state: prior,
|
|
1590
|
+
downstream,
|
|
1591
|
+
forced: !!options.force,
|
|
1592
|
+
} satisfies ActionRun;
|
|
1593
|
+
});
|
|
1220
1594
|
const actionPlans: Record<
|
|
1221
1595
|
string,
|
|
1222
1596
|
Effect.Effect<ActionRun | ActionNoop, Config.ConfigError | StateStoreError>
|
|
1223
1597
|
> = {};
|
|
1224
|
-
|
|
1598
|
+
// An Action's plan with the peers of its cycle, if it has one, at their
|
|
1599
|
+
// first pass.
|
|
1600
|
+
const firstActionPlan = Effect.fn(function* (action: ActionLike) {
|
|
1225
1601
|
return yield* (actionPlans[action.FQN] ??= yield* cachedInScope(memoScope)(
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
// with fully known, identical inputs has a reusable output.
|
|
1236
|
-
if (
|
|
1237
|
-
prior?.status === "ran" &&
|
|
1238
|
-
!options.force &&
|
|
1239
|
-
!inputCycleMembers.has(fqn) &&
|
|
1240
|
-
isResolved(resolvedInput) &&
|
|
1241
|
-
prior.inputHash === (yield* hashInput(resolvedInput))
|
|
1242
|
-
) {
|
|
1243
|
-
return {
|
|
1244
|
-
kind: "action",
|
|
1245
|
-
action: "noop",
|
|
1246
|
-
def: action,
|
|
1247
|
-
state: prior,
|
|
1248
|
-
downstream,
|
|
1249
|
-
} satisfies ActionNoop;
|
|
1250
|
-
}
|
|
1251
|
-
return {
|
|
1602
|
+
planAction(action, peersOf(action.FQN)),
|
|
1603
|
+
));
|
|
1604
|
+
});
|
|
1605
|
+
const diffAction = Effect.fn("plan.diff.action")(function* (action: ActionLike) {
|
|
1606
|
+
const plan = yield* firstActionPlan(action);
|
|
1607
|
+
const cycle = combinedCycles.get(action.FQN);
|
|
1608
|
+
// An input of a cycle member can change with what is bound to a peer.
|
|
1609
|
+
return plan.action === "noop" && cycle && (yield* settle(cycle)).reruns.has(action.FQN)
|
|
1610
|
+
? ({
|
|
1252
1611
|
kind: "action",
|
|
1253
1612
|
action: "run",
|
|
1254
1613
|
def: action,
|
|
1255
1614
|
input: action.Input,
|
|
1256
|
-
state:
|
|
1257
|
-
downstream,
|
|
1258
|
-
forced:
|
|
1259
|
-
} satisfies ActionRun
|
|
1260
|
-
|
|
1261
|
-
));
|
|
1615
|
+
state: plan.state,
|
|
1616
|
+
downstream: plan.downstream,
|
|
1617
|
+
forced: false,
|
|
1618
|
+
} satisfies ActionRun)
|
|
1619
|
+
: plan;
|
|
1262
1620
|
});
|
|
1263
1621
|
|
|
1264
1622
|
const plannedCount = yield* Ref.make(0);
|
|
1265
1623
|
const resourcePlanned = (node: CRUD) =>
|
|
1266
1624
|
Ref.updateAndGet(plannedCount, (count) => count + 1).pipe(
|
|
1267
1625
|
Effect.flatMap((completed) =>
|
|
1268
|
-
|
|
1269
|
-
|
|
1626
|
+
emit({
|
|
1627
|
+
type: "plan.resource.completed",
|
|
1270
1628
|
...describeResource(node),
|
|
1271
1629
|
completed,
|
|
1272
1630
|
total: resources.length,
|
|
@@ -1281,8 +1639,8 @@ const makePlan = <A>(
|
|
|
1281
1639
|
// Paired with the resource-planned completion below so renderers can
|
|
1282
1640
|
// show what is actually in flight (diffs may read the cloud and run
|
|
1283
1641
|
// concurrently — completions alone hide the slow tail).
|
|
1284
|
-
yield*
|
|
1285
|
-
|
|
1642
|
+
yield* emit({
|
|
1643
|
+
type: "plan.resource.started",
|
|
1286
1644
|
fqn,
|
|
1287
1645
|
logicalId: id,
|
|
1288
1646
|
resourceType: resource.Type,
|
|
@@ -1486,11 +1844,16 @@ const makePlan = <A>(
|
|
|
1486
1844
|
renamedFrom,
|
|
1487
1845
|
adoptionBlocked: reusesMigratedFqn ? "migrated-fqn" : undefined,
|
|
1488
1846
|
deferredAdoption:
|
|
1489
|
-
|
|
1490
|
-
provider.read &&
|
|
1847
|
+
(provider.read || provider.observe) &&
|
|
1491
1848
|
!reusesMigratedFqn &&
|
|
1492
|
-
|
|
1493
|
-
|
|
1849
|
+
// A replacement targets a new physical identity, which may belong
|
|
1850
|
+
// to someone else — admit it like a fresh create.
|
|
1851
|
+
(node.action === "replace" ||
|
|
1852
|
+
(node.action === "create" &&
|
|
1853
|
+
// Plan reads resolved props itself; without `read`, Apply
|
|
1854
|
+
// admits them through `observe`.
|
|
1855
|
+
((oldState === undefined && (!isResolved(news) || !provider.read)) ||
|
|
1856
|
+
(oldState?.status === "creating" && oldState.attr === undefined))))
|
|
1494
1857
|
? { adopt: adoptThis }
|
|
1495
1858
|
: undefined,
|
|
1496
1859
|
}) as any as T;
|
|
@@ -1516,7 +1879,16 @@ const makePlan = <A>(
|
|
|
1516
1879
|
// `output` is undefined (as it is here), so handing them
|
|
1517
1880
|
// unresolved exprs crashes. Skip the probe — same behavior as
|
|
1518
1881
|
// a read that found nothing — and re-drive the create.
|
|
1519
|
-
|
|
1882
|
+
//
|
|
1883
|
+
// A checkpoint whose unresolved props were stripped (`propsIncomplete`)
|
|
1884
|
+
// can't identify the attempt at all: a lookup could match a different
|
|
1885
|
+
// resource. Skip it too and let the diff below decide.
|
|
1886
|
+
if (
|
|
1887
|
+
provider.read &&
|
|
1888
|
+
!reusesMigratedFqn &&
|
|
1889
|
+
!oldState.propsIncomplete &&
|
|
1890
|
+
isResolved(oldState.props)
|
|
1891
|
+
) {
|
|
1520
1892
|
const attr = yield* provider
|
|
1521
1893
|
.read({
|
|
1522
1894
|
id,
|
|
@@ -1586,6 +1958,14 @@ const makePlan = <A>(
|
|
|
1586
1958
|
// comparing props across runtimes is meaningless (and the new
|
|
1587
1959
|
// mode's provider has never seen the old mode's state). The
|
|
1588
1960
|
// action is a replacement by definition.
|
|
1961
|
+
// The props above hold what a cycle's members settle on, which a
|
|
1962
|
+
// member's own replacement can leave unresolved: the peers it reads
|
|
1963
|
+
// change because it does. A provider can't compare unresolved props, so
|
|
1964
|
+
// the replacement it asked for over its peers' first pass stands.
|
|
1965
|
+
const replace = combinedCycles.has(fqn)
|
|
1966
|
+
? (yield* firstPass(Output.of(resource) as Output.ResourceExpr<any, any>)).replace
|
|
1967
|
+
: undefined;
|
|
1968
|
+
|
|
1589
1969
|
const diff = modeSwitched
|
|
1590
1970
|
? ({
|
|
1591
1971
|
action: "replace",
|
|
@@ -1650,6 +2030,7 @@ const makePlan = <A>(
|
|
|
1650
2030
|
? ({ action: "update" } satisfies UpdateDiff)
|
|
1651
2031
|
: diff,
|
|
1652
2032
|
),
|
|
2033
|
+
Effect.map((diff) => (replace && diff.action !== "replace" ? replace : diff)),
|
|
1653
2034
|
);
|
|
1654
2035
|
|
|
1655
2036
|
if (oldState.status === "creating") {
|
|
@@ -1813,8 +2194,9 @@ const makePlan = <A>(
|
|
|
1813
2194
|
// interrupt-only for any other reason) that can be a bare interruption,
|
|
1814
2195
|
// hiding the InvalidReferenceError or provider error that actually
|
|
1815
2196
|
// broke the plan.
|
|
1816
|
-
const diffExits = yield* Effect.
|
|
1817
|
-
resources
|
|
2197
|
+
const diffExits = yield* Effect.forEach(
|
|
2198
|
+
resources,
|
|
2199
|
+
(resource) => Effect.exit(Effect.tap(diffResource(resource), resourcePlanned)),
|
|
1818
2200
|
{ concurrency: "unbounded" },
|
|
1819
2201
|
);
|
|
1820
2202
|
const diffFailures = diffExits.filter(Exit.isFailure);
|
|
@@ -1886,7 +2268,7 @@ const makePlan = <A>(
|
|
|
1886
2268
|
if (excluded && (bindingEvidence || incompleteHistory)) {
|
|
1887
2269
|
return yield* Effect.die(
|
|
1888
2270
|
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.`,
|
|
2271
|
+
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
2272
|
}),
|
|
1891
2273
|
);
|
|
1892
2274
|
}
|
|
@@ -1910,7 +2292,7 @@ const makePlan = <A>(
|
|
|
1910
2292
|
new UnsafeSelectionBoundary({
|
|
1911
2293
|
message: `Cannot reconcile '${fqn}' with incomplete historical downstream metadata while persisted nodes are unselected: ${excludedRows
|
|
1912
2294
|
.map(([id]) => id)
|
|
1913
|
-
.sort()
|
|
2295
|
+
.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))
|
|
1914
2296
|
.join(", ")}. Select them or run a full deployment.`,
|
|
1915
2297
|
}),
|
|
1916
2298
|
);
|
|
@@ -1943,7 +2325,7 @@ const makePlan = <A>(
|
|
|
1943
2325
|
new UnsafeSelectionBoundary({
|
|
1944
2326
|
message: `Cannot discard the last historical binding evidence while persisted nodes are unselected: ${excludedRows
|
|
1945
2327
|
.map(([fqn]) => fqn)
|
|
1946
|
-
.sort()
|
|
2328
|
+
.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))
|
|
1947
2329
|
.join(", ")}. Select them or run a full deployment.`,
|
|
1948
2330
|
}),
|
|
1949
2331
|
);
|
|
@@ -1957,8 +2339,8 @@ const makePlan = <A>(
|
|
|
1957
2339
|
const actionPlanned = (entry: readonly [string, ActionApply]) =>
|
|
1958
2340
|
Ref.updateAndGet(actionCount, (count) => count + 1).pipe(
|
|
1959
2341
|
Effect.flatMap((completed) =>
|
|
1960
|
-
|
|
1961
|
-
|
|
2342
|
+
emit({
|
|
2343
|
+
type: "plan.action.completed",
|
|
1962
2344
|
...describeAction(entry[1]),
|
|
1963
2345
|
completed,
|
|
1964
2346
|
total: actions.length,
|
|
@@ -1967,22 +2349,43 @@ const makePlan = <A>(
|
|
|
1967
2349
|
);
|
|
1968
2350
|
|
|
1969
2351
|
const actionGraph = Object.fromEntries(
|
|
1970
|
-
(yield* Effect.
|
|
1971
|
-
actions
|
|
2352
|
+
(yield* Effect.forEach(
|
|
2353
|
+
actions,
|
|
2354
|
+
(action) =>
|
|
1972
2355
|
diffAction(action).pipe(
|
|
1973
2356
|
Effect.map((node) => [action.FQN, node] as const),
|
|
1974
2357
|
Effect.tap(actionPlanned),
|
|
1975
2358
|
),
|
|
1976
|
-
),
|
|
1977
2359
|
{ concurrency: "unbounded" },
|
|
1978
2360
|
)) as ReadonlyArray<readonly [string, ActionApply]>,
|
|
1979
2361
|
) as Plan["actions"];
|
|
1980
2362
|
|
|
1981
|
-
// SCC membership of the
|
|
1982
|
-
//
|
|
1983
|
-
//
|
|
1984
|
-
//
|
|
1985
|
-
|
|
2363
|
+
// SCC membership of the graph Apply schedules. Apply uses it to decide
|
|
2364
|
+
// whether an update node must publish its prior attr early to break a
|
|
2365
|
+
// cycle, or can simply wait for upstreams like a DAG node (the common
|
|
2366
|
+
// case). The edges are the ones each node still carries — exactly what
|
|
2367
|
+
// Apply's `waitForDeps` waits on. A declared reference to an upstream's
|
|
2368
|
+
// stable attribute resolves to its value during planning and orders
|
|
2369
|
+
// nothing, so it cannot close a cycle: two updating Workers that bind
|
|
2370
|
+
// each other only by `workerName` are not a cycle, and a node that
|
|
2371
|
+
// still references a peer's changing attribute waits for it (#3103).
|
|
2372
|
+
const cycleMembers = findCycleMembers(
|
|
2373
|
+
Object.fromEntries([
|
|
2374
|
+
...Object.entries(resourceGraph).map(([fqn, node]): [string, string[]] => [
|
|
2375
|
+
fqn,
|
|
2376
|
+
[
|
|
2377
|
+
...new Set([
|
|
2378
|
+
...Object.keys(Output.resolveUpstream("props" in node ? node.props : undefined)),
|
|
2379
|
+
...Object.keys(Output.resolveUpstream(node.bindings)),
|
|
2380
|
+
]),
|
|
2381
|
+
].filter((dep) => newNodeFqns.has(dep)),
|
|
2382
|
+
]),
|
|
2383
|
+
...actions.map((action): [string, string[]] => [
|
|
2384
|
+
action.FQN,
|
|
2385
|
+
allUpstreamDependencies[action.FQN] ?? [],
|
|
2386
|
+
]),
|
|
2387
|
+
]),
|
|
2388
|
+
);
|
|
1986
2389
|
|
|
1987
2390
|
// Detect unsatisfiable dependency cycles among create/replace nodes.
|
|
1988
2391
|
// Update/noop nodes signal their Deferred before waitForDeps when in a
|
|
@@ -2036,6 +2439,37 @@ const makePlan = <A>(
|
|
|
2036
2439
|
}
|
|
2037
2440
|
}
|
|
2038
2441
|
|
|
2442
|
+
// A delete-first replacement in a cycle deletes its previous generation
|
|
2443
|
+
// before precreate. Apply resolves the props that upstreams outside the
|
|
2444
|
+
// cycle determine first, so only props derived from a cycle peer are
|
|
2445
|
+
// still unresolved then, and only the provider's `observe` can check
|
|
2446
|
+
// ownership before that delete. Without it, refuse here — before apply
|
|
2447
|
+
// touches anything — unless adoption is allowed.
|
|
2448
|
+
for (const [fqn, node] of Object.entries(resourceGraph)) {
|
|
2449
|
+
if (
|
|
2450
|
+
node.action === "replace" &&
|
|
2451
|
+
node.deleteFirst &&
|
|
2452
|
+
cycleMembers.has(fqn) &&
|
|
2453
|
+
!node.provider.observe &&
|
|
2454
|
+
node.deferredAdoption?.adopt === false &&
|
|
2455
|
+
!isResolved(node.props) &&
|
|
2456
|
+
Object.keys(Output.resolveUpstream(node.props)).some((dep) => cycleMembers.has(dep)) &&
|
|
2457
|
+
// A resumed replacement already holds its precreated identity.
|
|
2458
|
+
!(node.state.status === "replacing" && !node.restart && node.state.attr !== undefined)
|
|
2459
|
+
) {
|
|
2460
|
+
return yield* new UnverifiableReplacement({
|
|
2461
|
+
message:
|
|
2462
|
+
`Cannot replace resource '${fqn}' (${node.resource.Type}): ` +
|
|
2463
|
+
"it must be deleted before its replacement is pre-created, but " +
|
|
2464
|
+
"the replacement's identity depends on outputs that are not " +
|
|
2465
|
+
"resolved yet, so its ownership cannot be checked first. Re-run " +
|
|
2466
|
+
"with `--adopt` (or wrap the effect in `adopt(true)`) to replace it anyway.",
|
|
2467
|
+
resourceType: node.resource.Type,
|
|
2468
|
+
logicalId: node.resource.LogicalId,
|
|
2469
|
+
});
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2039
2473
|
// Both orphan passes (task rows below, resource rows further down)
|
|
2040
2474
|
// examine every persisted row of this stack instance.
|
|
2041
2475
|
const persistedFqns = selected ? [] : yield* state.list({ stack: stackName, stage });
|
|
@@ -2049,8 +2483,8 @@ const makePlan = <A>(
|
|
|
2049
2483
|
Effect.flatMap((completed) =>
|
|
2050
2484
|
entry === undefined
|
|
2051
2485
|
? Effect.void
|
|
2052
|
-
:
|
|
2053
|
-
|
|
2486
|
+
: emit({
|
|
2487
|
+
type: "plan.action.completed",
|
|
2054
2488
|
...describeAction(entry[1]),
|
|
2055
2489
|
completed,
|
|
2056
2490
|
total: persistedFqns.length,
|
|
@@ -2093,12 +2527,12 @@ const makePlan = <A>(
|
|
|
2093
2527
|
});
|
|
2094
2528
|
|
|
2095
2529
|
const actionDeletions: Plan["actionDeletions"] = Object.fromEntries(
|
|
2096
|
-
(yield* Effect.
|
|
2097
|
-
persistedFqns
|
|
2530
|
+
(yield* Effect.forEach(
|
|
2531
|
+
persistedFqns,
|
|
2532
|
+
(fqn) =>
|
|
2098
2533
|
diffActionDeletion(fqn).pipe(
|
|
2099
2534
|
Effect.tap((entry) => actionDeletionPlanned(entry ?? undefined)),
|
|
2100
2535
|
),
|
|
2101
|
-
),
|
|
2102
2536
|
{ concurrency: "unbounded" },
|
|
2103
2537
|
)).filter((v): v is NonNullable<typeof v> => !!v),
|
|
2104
2538
|
);
|
|
@@ -2113,8 +2547,8 @@ const makePlan = <A>(
|
|
|
2113
2547
|
Effect.flatMap((completed) =>
|
|
2114
2548
|
entry === undefined
|
|
2115
2549
|
? Effect.void
|
|
2116
|
-
:
|
|
2117
|
-
|
|
2550
|
+
: emit({
|
|
2551
|
+
type: "plan.resource.completed",
|
|
2118
2552
|
...describeResource(entry[1]),
|
|
2119
2553
|
completed,
|
|
2120
2554
|
total: deletionCandidates.length,
|
|
@@ -2200,6 +2634,7 @@ const makePlan = <A>(
|
|
|
2200
2634
|
FormerFqns: undefined,
|
|
2201
2635
|
RuntimeContext: undefined!,
|
|
2202
2636
|
Providers: undefined,
|
|
2637
|
+
Lookup: undefined as never,
|
|
2203
2638
|
} as ResourceLike,
|
|
2204
2639
|
downstream: [...downstream],
|
|
2205
2640
|
bindings: oldState.bindings.map((binding) => ({
|
|
@@ -2213,10 +2648,9 @@ const makePlan = <A>(
|
|
|
2213
2648
|
});
|
|
2214
2649
|
|
|
2215
2650
|
const deletions = Object.fromEntries(
|
|
2216
|
-
(yield* Effect.
|
|
2217
|
-
deletionCandidates
|
|
2218
|
-
|
|
2219
|
-
),
|
|
2651
|
+
(yield* Effect.forEach(
|
|
2652
|
+
deletionCandidates,
|
|
2653
|
+
(fqn) => diffDeletion(fqn).pipe(Effect.tap((entry) => deletionPlanned(entry ?? undefined))),
|
|
2220
2654
|
{ concurrency: "unbounded" },
|
|
2221
2655
|
)).filter((v) => !!v),
|
|
2222
2656
|
);
|
|
@@ -2237,6 +2671,52 @@ const makePlan = <A>(
|
|
|
2237
2671
|
}
|
|
2238
2672
|
}
|
|
2239
2673
|
|
|
2674
|
+
// `RemovalPolicy.protect()`: refuse the whole plan, before anything is
|
|
2675
|
+
// applied, when it would start replacing or delete a protected resource. Both
|
|
2676
|
+
// the declaration and the persisted row count, so dropping `protect()`
|
|
2677
|
+
// in the same deploy as the replacement is refused too.
|
|
2678
|
+
yield* Effect.forEach(
|
|
2679
|
+
// An Action declared at a protected resource's FQN would overwrite its
|
|
2680
|
+
// row without ever planning a delete, abandoning the resource.
|
|
2681
|
+
persistedFqns.filter((fqn) => newActionFqns.has(fqn) && !newResourceFqns.has(fqn)),
|
|
2682
|
+
(fqn) =>
|
|
2683
|
+
state.get({ stack: stackName, stage, fqn }).pipe(Effect.map((row) => [fqn, row] as const)),
|
|
2684
|
+
{ concurrency: "unbounded" },
|
|
2685
|
+
).pipe(
|
|
2686
|
+
Effect.flatMap((takenOverByActions) => {
|
|
2687
|
+
const refused = [
|
|
2688
|
+
...Object.entries(resourceGraph).flatMap(([fqn, node]) =>
|
|
2689
|
+
node.action === "replace" &&
|
|
2690
|
+
// Finishing a `replaced` row's drain only deletes an old generation
|
|
2691
|
+
// the dependents already left; the current one is untouched.
|
|
2692
|
+
!(node.state.status === "replaced" && !node.restart) &&
|
|
2693
|
+
(node.resource.RemovalPolicy === "protect" || node.state.removalPolicy === "protect")
|
|
2694
|
+
? [{ fqn, action: "replace" as const }]
|
|
2695
|
+
: [],
|
|
2696
|
+
),
|
|
2697
|
+
...Object.entries(deletions).flatMap(([fqn, node]) =>
|
|
2698
|
+
node?.state.removalPolicy === "protect" ? [{ fqn, action: "delete" as const }] : [],
|
|
2699
|
+
),
|
|
2700
|
+
...takenOverByActions.flatMap(([fqn, row]) =>
|
|
2701
|
+
!isActionState(row) && (row as ResourceState | undefined)?.removalPolicy === "protect"
|
|
2702
|
+
? [{ fqn, action: "delete" as const }]
|
|
2703
|
+
: [],
|
|
2704
|
+
),
|
|
2705
|
+
];
|
|
2706
|
+
return refused.length === 0
|
|
2707
|
+
? Effect.void
|
|
2708
|
+
: Effect.fail(
|
|
2709
|
+
new ProtectedResource({
|
|
2710
|
+
message:
|
|
2711
|
+
`Refusing to ${refused.map((r) => `${r.action} '${r.fqn}'`).join(", ")}: ` +
|
|
2712
|
+
"protected by RemovalPolicy.protect(). Deploy it without protect() first " +
|
|
2713
|
+
"to replace or delete it deliberately.",
|
|
2714
|
+
resources: refused,
|
|
2715
|
+
}),
|
|
2716
|
+
);
|
|
2717
|
+
}),
|
|
2718
|
+
);
|
|
2719
|
+
|
|
2240
2720
|
return {
|
|
2241
2721
|
resources: resourceGraph,
|
|
2242
2722
|
actions: actionGraph,
|