alchemy 2.0.0-beta.84 → 2.0.0-beta.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_LICENSES.md +2 -2
- package/bin/cli.js +14 -6
- package/bin/register-oxc.js +16 -12
- package/lib/AdoptPolicy.d.ts +73 -0
- package/lib/AdoptPolicy.d.ts.map +1 -1
- package/lib/AdoptPolicy.js +54 -0
- package/lib/AdoptPolicy.js.map +1 -1
- package/lib/Alchemist/AuthRegistry.d.ts +31 -0
- package/lib/Alchemist/AuthRegistry.d.ts.map +1 -0
- package/lib/Alchemist/AuthRegistry.js +95 -0
- package/lib/Alchemist/AuthRegistry.js.map +1 -0
- package/lib/Alchemist/Drift.d.ts +70 -0
- package/lib/Alchemist/Drift.d.ts.map +1 -0
- package/lib/Alchemist/Drift.js +54 -0
- package/lib/Alchemist/Drift.js.map +1 -0
- package/lib/Alchemist/Entrypoint.d.ts +27 -3
- package/lib/Alchemist/Entrypoint.d.ts.map +1 -1
- package/lib/Alchemist/Entrypoint.js +34 -3
- package/lib/Alchemist/Entrypoint.js.map +1 -1
- package/lib/Alchemist/Errors.d.ts +1 -1
- package/lib/Alchemist/Errors.d.ts.map +1 -1
- package/lib/Alchemist/Errors.js +1 -1
- package/lib/Alchemist/Errors.js.map +1 -1
- package/lib/Alchemist/Logs.d.ts +46 -0
- package/lib/Alchemist/Logs.d.ts.map +1 -0
- package/lib/Alchemist/{routes/logs.js → Logs.js} +21 -26
- package/lib/Alchemist/Logs.js.map +1 -0
- package/lib/Alchemist/Nuke.d.ts +69 -0
- package/lib/Alchemist/Nuke.d.ts.map +1 -0
- package/lib/Alchemist/Nuke.js +35 -0
- package/lib/Alchemist/Nuke.js.map +1 -0
- package/lib/Alchemist/Operations.d.ts +168 -0
- package/lib/Alchemist/Operations.d.ts.map +1 -0
- package/lib/Alchemist/Operations.js +165 -0
- package/lib/Alchemist/Operations.js.map +1 -0
- package/lib/Alchemist/Profile.d.ts +132 -0
- package/lib/Alchemist/Profile.d.ts.map +1 -0
- package/lib/Alchemist/{routes/profile.js → Profile.js} +20 -21
- package/lib/Alchemist/Profile.js.map +1 -0
- package/lib/Alchemist/{routes/provider.d.ts → Provider.d.ts} +4 -4
- package/lib/Alchemist/Provider.d.ts.map +1 -0
- package/lib/Alchemist/{routes/provider.js → Provider.js} +7 -6
- package/lib/Alchemist/Provider.js.map +1 -0
- package/lib/Alchemist/Runtime.d.ts +10 -6
- package/lib/Alchemist/Runtime.d.ts.map +1 -1
- package/lib/Alchemist/Runtime.js +38 -2
- package/lib/Alchemist/Runtime.js.map +1 -1
- package/lib/Alchemist/{routes/state.d.ts → State.d.ts} +36 -16
- package/lib/Alchemist/State.d.ts.map +1 -0
- package/lib/Alchemist/{routes/state.js → State.js} +50 -15
- package/lib/Alchemist/State.js.map +1 -0
- package/lib/Alchemist/index.d.ts +11 -10
- package/lib/Alchemist/index.d.ts.map +1 -1
- package/lib/Alchemist/index.js +10 -9
- package/lib/Alchemist/index.js.map +1 -1
- package/lib/Apply.d.ts +2 -8
- package/lib/Apply.d.ts.map +1 -1
- package/lib/Apply.js +364 -184
- package/lib/Apply.js.map +1 -1
- package/lib/Auth/AuthProvider.d.ts +24 -11
- package/lib/Auth/AuthProvider.d.ts.map +1 -1
- package/lib/Auth/AuthProvider.js +28 -12
- package/lib/Auth/AuthProvider.js.map +1 -1
- package/lib/Auth/BrowserOAuth.d.ts +6 -8
- package/lib/Auth/BrowserOAuth.d.ts.map +1 -1
- package/lib/Auth/BrowserOAuth.js +25 -41
- package/lib/Auth/BrowserOAuth.js.map +1 -1
- package/lib/Auth/Credentials.d.ts.map +1 -1
- package/lib/Auth/Credentials.js +2 -2
- package/lib/Auth/Credentials.js.map +1 -1
- package/lib/Auth/Demand.d.ts +4 -4
- package/lib/Auth/Demand.d.ts.map +1 -1
- package/lib/Auth/Demand.js +16 -10
- package/lib/Auth/Demand.js.map +1 -1
- package/lib/Auth/Env.d.ts +2 -1
- package/lib/Auth/Env.d.ts.map +1 -1
- package/lib/Auth/Env.js +4 -2
- package/lib/Auth/Env.js.map +1 -1
- package/lib/Auth/Inspect.d.ts +2 -2
- package/lib/Auth/Inspect.d.ts.map +1 -1
- package/lib/Auth/Inspect.js +3 -1
- package/lib/Auth/Inspect.js.map +1 -1
- package/lib/Auth/Lock.d.ts.map +1 -1
- package/lib/Auth/Lock.js +4 -8
- package/lib/Auth/Lock.js.map +1 -1
- package/lib/Auth/OAuthFlow.d.ts +3 -12
- package/lib/Auth/OAuthFlow.d.ts.map +1 -1
- package/lib/Auth/OAuthFlow.js +7 -17
- package/lib/Auth/OAuthFlow.js.map +1 -1
- package/lib/Auth/Paths.d.ts +2 -1
- package/lib/Auth/Paths.d.ts.map +1 -1
- package/lib/Auth/Paths.js +3 -2
- package/lib/Auth/Paths.js.map +1 -1
- package/lib/Auth/Profile.d.ts +10 -0
- package/lib/Auth/Profile.d.ts.map +1 -1
- package/lib/Auth/Profile.js +19 -2
- package/lib/Auth/Profile.js.map +1 -1
- package/lib/Auth/Registry.d.ts +20 -0
- package/lib/Auth/Registry.d.ts.map +1 -0
- package/lib/Auth/Registry.js +17 -0
- package/lib/Auth/Registry.js.map +1 -0
- package/lib/Auth/Resolve.d.ts +34 -2
- package/lib/Auth/Resolve.d.ts.map +1 -1
- package/lib/Auth/Resolve.js +51 -3
- package/lib/Auth/Resolve.js.map +1 -1
- package/lib/Auth/StoredAuthProvider.d.ts +1 -1
- package/lib/Auth/StoredAuthProvider.d.ts.map +1 -1
- package/lib/Auth/StoredAuthProvider.js +1 -2
- package/lib/Auth/StoredAuthProvider.js.map +1 -1
- package/lib/Binding.d.ts.map +1 -1
- package/lib/Binding.js +3 -1
- package/lib/Binding.js.map +1 -1
- package/lib/Bundle/Bundle.d.ts +5 -0
- package/lib/Bundle/Bundle.d.ts.map +1 -1
- package/lib/Bundle/Bundle.js +36 -6
- package/lib/Bundle/Bundle.js.map +1 -1
- package/lib/Bundle/NamespaceImportPlugin.d.ts +55 -0
- package/lib/Bundle/NamespaceImportPlugin.d.ts.map +1 -0
- package/lib/Bundle/NamespaceImportPlugin.js +226 -0
- package/lib/Bundle/NamespaceImportPlugin.js.map +1 -0
- package/lib/Bundle/index.d.ts +1 -0
- package/lib/Bundle/index.d.ts.map +1 -1
- package/lib/Bundle/index.js +1 -0
- package/lib/Bundle/index.js.map +1 -1
- package/lib/Cli/Format.d.ts.map +1 -1
- package/lib/Cli/Format.js +2 -1
- package/lib/Cli/Format.js.map +1 -1
- package/lib/Cli/GlobalLog.d.ts +72 -26
- package/lib/Cli/GlobalLog.d.ts.map +1 -1
- package/lib/Cli/GlobalLog.js +151 -59
- package/lib/Cli/GlobalLog.js.map +1 -1
- package/lib/Cli/LoggingCli.d.ts.map +1 -1
- package/lib/Cli/LoggingCli.js +24 -18
- package/lib/Cli/LoggingCli.js.map +1 -1
- package/lib/Cli/PlainCliFormatter.d.ts.map +1 -1
- package/lib/Cli/PlainCliFormatter.js +4 -1
- package/lib/Cli/PlainCliFormatter.js.map +1 -1
- package/lib/Cli/Present.d.ts +14 -0
- package/lib/Cli/Present.d.ts.map +1 -0
- package/lib/Cli/Present.js +22 -0
- package/lib/Cli/Present.js.map +1 -0
- package/lib/Cli/SigilRenderer.d.ts +58 -0
- package/lib/Cli/SigilRenderer.d.ts.map +1 -0
- package/lib/Cli/SigilRenderer.js +39 -0
- package/lib/Cli/SigilRenderer.js.map +1 -0
- package/lib/Cli/checkVersion.d.ts +11 -14
- package/lib/Cli/checkVersion.d.ts.map +1 -1
- package/lib/Cli/checkVersion.js +19 -77
- package/lib/Cli/checkVersion.js.map +1 -1
- package/lib/Cli/commands/confirm.d.ts +2 -2
- package/lib/Cli/commands/confirm.d.ts.map +1 -1
- package/lib/Cli/commands/confirm.js +3 -3
- package/lib/Cli/commands/confirm.js.map +1 -1
- package/lib/Cli/commands/deploy.d.ts +4 -4
- package/lib/Cli/commands/deploy.d.ts.map +1 -1
- package/lib/Cli/commands/deploy.js +40 -39
- package/lib/Cli/commands/deploy.js.map +1 -1
- package/lib/Cli/commands/dev.d.ts.map +1 -1
- package/lib/Cli/commands/dev.js +41 -3
- package/lib/Cli/commands/dev.js.map +1 -1
- package/lib/Cli/commands/drift.d.ts +2 -2
- package/lib/Cli/commands/drift.d.ts.map +1 -1
- package/lib/Cli/commands/drift.js +14 -13
- package/lib/Cli/commands/drift.js.map +1 -1
- package/lib/Cli/commands/errors.d.ts.map +1 -1
- package/lib/Cli/commands/errors.js +2 -1
- package/lib/Cli/commands/errors.js.map +1 -1
- package/lib/Cli/commands/instrument.d.ts +15 -5
- package/lib/Cli/commands/instrument.d.ts.map +1 -1
- package/lib/Cli/commands/instrument.js +33 -8
- package/lib/Cli/commands/instrument.js.map +1 -1
- package/lib/Cli/commands/logs.d.ts +1 -1
- package/lib/Cli/commands/logs.d.ts.map +1 -1
- package/lib/Cli/commands/logs.js +22 -22
- package/lib/Cli/commands/logs.js.map +1 -1
- package/lib/Cli/commands/nuke.d.ts +3 -2
- package/lib/Cli/commands/nuke.d.ts.map +1 -1
- package/lib/Cli/commands/nuke.js +19 -17
- package/lib/Cli/commands/nuke.js.map +1 -1
- package/lib/Cli/commands/profile/commands.d.ts +3 -2
- package/lib/Cli/commands/profile/commands.d.ts.map +1 -1
- package/lib/Cli/commands/profile/commands.js +26 -27
- package/lib/Cli/commands/profile/commands.js.map +1 -1
- package/lib/Cli/commands/profile/flows.d.ts +6 -5
- package/lib/Cli/commands/profile/flows.d.ts.map +1 -1
- package/lib/Cli/commands/profile/flows.js +19 -17
- package/lib/Cli/commands/profile/flows.js.map +1 -1
- package/lib/Cli/commands/profile/hub.d.ts +1 -2
- package/lib/Cli/commands/profile/hub.d.ts.map +1 -1
- package/lib/Cli/commands/profile/hub.js +15 -17
- package/lib/Cli/commands/profile/hub.js.map +1 -1
- package/lib/Cli/commands/provider.d.ts +3 -1
- package/lib/Cli/commands/provider.d.ts.map +1 -1
- package/lib/Cli/commands/provider.js +4 -4
- package/lib/Cli/commands/provider.js.map +1 -1
- package/lib/Cli/commands/render.d.ts +2 -4
- package/lib/Cli/commands/render.d.ts.map +1 -1
- package/lib/Cli/commands/render.js +33 -56
- package/lib/Cli/commands/render.js.map +1 -1
- package/lib/Cli/commands/state.d.ts +1 -2
- package/lib/Cli/commands/state.d.ts.map +1 -1
- package/lib/Cli/commands/state.js +74 -27
- package/lib/Cli/commands/state.js.map +1 -1
- package/lib/Cli/components/capabilities.d.ts +4 -0
- package/lib/Cli/components/capabilities.d.ts.map +1 -0
- package/lib/Cli/components/capabilities.js +18 -0
- package/lib/Cli/components/capabilities.js.map +1 -0
- package/lib/Cli/components/types.d.ts +2 -81
- package/lib/Cli/components/types.d.ts.map +1 -1
- package/lib/Cli/components/types.js +1 -3
- package/lib/Cli/components/types.js.map +1 -1
- package/lib/Cli/components/ui/Environment.d.ts +3 -3
- package/lib/Cli/components/ui/Environment.d.ts.map +1 -1
- package/lib/Cli/components/ui/Environment.js.map +1 -1
- package/lib/Cli/components/ui/Interactive.d.ts +17 -4
- package/lib/Cli/components/ui/Interactive.d.ts.map +1 -1
- package/lib/Cli/components/ui/Interactive.js +7 -11
- package/lib/Cli/components/ui/Interactive.js.map +1 -1
- package/lib/Cli/components/ui/Layout.d.ts +1 -1
- package/lib/Cli/components/ui/Layout.d.ts.map +1 -1
- package/lib/Cli/components/ui/Layout.js +1 -1
- package/lib/Cli/components/ui/Layout.js.map +1 -1
- package/lib/Cli/components/ui/Typography.d.ts +1 -1
- package/lib/Cli/components/ui/Typography.d.ts.map +1 -1
- package/lib/Cli/components/ui/Typography.js +1 -1
- package/lib/Cli/components/ui/Typography.js.map +1 -1
- package/lib/Cli/components/ui/index.d.ts +2 -2
- package/lib/Cli/components/ui/index.js +2 -2
- package/lib/Cli/components/view/ApprovePlan.d.ts +1 -1
- package/lib/Cli/components/view/ApprovePlan.d.ts.map +1 -1
- package/lib/Cli/components/view/ApprovePlan.js +2 -1
- package/lib/Cli/components/view/ApprovePlan.js.map +1 -1
- package/lib/Cli/components/view/Format.d.ts +5 -0
- package/lib/Cli/components/view/Format.d.ts.map +1 -0
- package/lib/Cli/components/view/Format.js +39 -0
- package/lib/Cli/components/view/Format.js.map +1 -0
- package/lib/Cli/components/view/Help.d.ts +2 -2
- package/lib/Cli/components/view/Help.d.ts.map +1 -1
- package/lib/Cli/components/view/Help.js +7 -5
- package/lib/Cli/components/view/Help.js.map +1 -1
- package/lib/Cli/components/view/Logo.js +1 -1
- package/lib/Cli/components/view/Logo.js.map +1 -1
- package/lib/Cli/components/view/Nuke.d.ts +8 -9
- package/lib/Cli/components/view/Nuke.d.ts.map +1 -1
- package/lib/Cli/components/view/Nuke.js +49 -52
- package/lib/Cli/components/view/Nuke.js.map +1 -1
- package/lib/Cli/components/view/PlanDecision.d.ts +1 -1
- package/lib/Cli/components/view/PlanDecision.d.ts.map +1 -1
- package/lib/Cli/components/view/PlanDecision.js +1 -1
- package/lib/Cli/components/view/PlanDecision.js.map +1 -1
- package/lib/Cli/components/view/PlanRow.js +1 -1
- package/lib/Cli/components/view/PlanRow.js.map +1 -1
- package/lib/Cli/components/view/PlanTree.d.ts +1 -1
- package/lib/Cli/components/view/PlanTree.d.ts.map +1 -1
- package/lib/Cli/components/view/PlanTree.js +1 -1
- package/lib/Cli/components/view/PlanView.js +1 -1
- package/lib/Cli/components/view/PlanView.js.map +1 -1
- package/lib/Cli/components/view/Profile.d.ts +1 -1
- package/lib/Cli/components/view/Profile.js +2 -2
- package/lib/Cli/components/view/Profile.js.map +1 -1
- package/lib/Cli/components/view/ProfileDashboard.d.ts +4 -4
- package/lib/Cli/components/view/ProfileDashboard.d.ts.map +1 -1
- package/lib/Cli/components/view/ProfileDashboard.js +9 -8
- package/lib/Cli/components/view/ProfileDashboard.js.map +1 -1
- package/lib/Cli/components/view/Prompts.d.ts +3 -3
- package/lib/Cli/components/view/Prompts.d.ts.map +1 -1
- package/lib/Cli/components/view/Prompts.js +11 -18
- package/lib/Cli/components/view/Prompts.js.map +1 -1
- package/lib/Cli/components/view/Runtime.d.ts +5 -5
- package/lib/Cli/components/view/Runtime.d.ts.map +1 -1
- package/lib/Cli/components/view/Runtime.js +136 -219
- package/lib/Cli/components/view/Runtime.js.map +1 -1
- package/lib/Cli/components/view/SigilCli.d.ts +2 -2
- package/lib/Cli/components/view/SigilCli.d.ts.map +1 -1
- package/lib/Cli/components/view/SigilCli.js +7 -7
- package/lib/Cli/components/view/SigilCli.js.map +1 -1
- package/lib/Cli/components/view/StateExplorer.d.ts +1 -1
- package/lib/Cli/components/view/StateExplorer.d.ts.map +1 -1
- package/lib/Cli/components/view/StateExplorer.js +2 -1
- package/lib/Cli/components/view/StateExplorer.js.map +1 -1
- package/lib/Cli/components/view/statusStyle.d.ts +2 -2
- package/lib/Cli/components/view/statusStyle.d.ts.map +1 -1
- package/lib/Cli/components/view/statusStyle.js +1 -1
- package/lib/Cli/components/view/statusStyle.js.map +1 -1
- package/lib/Cli/exec.d.ts +6 -1
- package/lib/Cli/exec.d.ts.map +1 -1
- package/lib/Cli/exec.js +29 -34
- package/lib/Cli/exec.js.map +1 -1
- package/lib/Cli/main.d.ts.map +1 -1
- package/lib/Cli/main.js +35 -26
- package/lib/Cli/main.js.map +1 -1
- package/lib/Cli/selectCli.d.ts +2 -2
- package/lib/Cli/selectCli.d.ts.map +1 -1
- package/lib/Cli/selectCli.js +2 -2
- package/lib/Cli/selectCli.js.map +1 -1
- package/lib/Command/Command.js +1 -1
- package/lib/Command/Command.js.map +1 -1
- package/lib/Command/Dev.d.ts +58 -4
- package/lib/Command/Dev.d.ts.map +1 -1
- package/lib/Command/Dev.js +87 -30
- package/lib/Command/Dev.js.map +1 -1
- package/lib/Command/Local.d.ts +1 -1
- package/lib/Command/Memo.js +1 -1
- package/lib/Command/Memo.js.map +1 -1
- package/lib/Command/Providers.d.ts +1 -1
- package/lib/Command/Providers.d.ts.map +1 -1
- package/lib/Contributions.d.ts +2 -3
- package/lib/Contributions.d.ts.map +1 -1
- package/lib/Contributions.js +38 -6
- package/lib/Contributions.js.map +1 -1
- package/lib/DNS/Adapter.d.ts +204 -0
- package/lib/DNS/Adapter.d.ts.map +1 -0
- package/lib/DNS/Adapter.js +112 -0
- package/lib/DNS/Adapter.js.map +1 -0
- package/lib/DNS/index.d.ts +2 -0
- package/lib/DNS/index.d.ts.map +1 -0
- package/lib/DNS/index.js +2 -0
- package/lib/DNS/index.js.map +1 -0
- package/lib/Deploy.d.ts +7 -2
- package/lib/Deploy.d.ts.map +1 -1
- package/lib/Deploy.js +8 -3
- package/lib/Deploy.js.map +1 -1
- package/lib/Destroy.d.ts +5 -8
- package/lib/Destroy.d.ts.map +1 -1
- package/lib/Destroy.js +10 -7
- package/lib/Destroy.js.map +1 -1
- package/lib/Diff.d.ts.map +1 -1
- package/lib/Diff.js +14 -4
- package/lib/Diff.js.map +1 -1
- package/lib/Drift.d.ts +7 -7
- package/lib/Drift.d.ts.map +1 -1
- package/lib/Drift.js +184 -101
- package/lib/Drift.js.map +1 -1
- package/lib/EvalStack.d.ts +23 -0
- package/lib/EvalStack.d.ts.map +1 -0
- package/lib/EvalStack.js +47 -0
- package/lib/EvalStack.js.map +1 -0
- package/lib/Events.d.ts +210 -0
- package/lib/Events.d.ts.map +1 -0
- package/lib/Events.js +244 -0
- package/lib/Events.js.map +1 -0
- package/lib/Interaction.d.ts +159 -48
- package/lib/Interaction.d.ts.map +1 -1
- package/lib/Interaction.js +139 -58
- package/lib/Interaction.js.map +1 -1
- package/lib/Local/LocalProvider.d.ts.map +1 -1
- package/lib/Local/LocalProvider.js +31 -9
- package/lib/Local/LocalProvider.js.map +1 -1
- package/lib/Local/RpcProvider.d.ts.map +1 -1
- package/lib/Local/RpcProvider.js +10 -1
- package/lib/Local/RpcProvider.js.map +1 -1
- package/lib/Local/RpcProviderProxy.d.ts +16 -0
- package/lib/Local/RpcProviderProxy.d.ts.map +1 -1
- package/lib/Local/RpcProviderProxy.js +19 -10
- package/lib/Local/RpcProviderProxy.js.map +1 -1
- package/lib/Local/RpcSerialization.d.ts +3 -2
- package/lib/Local/RpcSerialization.d.ts.map +1 -1
- package/lib/Local/RpcSerialization.js +13 -10
- package/lib/Local/RpcSerialization.js.map +1 -1
- package/lib/Local/RpcServer.d.ts +2 -1
- package/lib/Local/RpcServer.d.ts.map +1 -1
- package/lib/Local/RpcServer.js +19 -14
- package/lib/Local/RpcServer.js.map +1 -1
- package/lib/Local/RpcServerBun.d.ts.map +1 -1
- package/lib/Local/RpcServerBun.js +8 -4
- package/lib/Local/RpcServerBun.js.map +1 -1
- package/lib/Local/RpcServerEnvironment.d.ts +2 -3
- package/lib/Local/RpcServerEnvironment.d.ts.map +1 -1
- package/lib/Local/RpcServerEnvironment.js +2 -2
- package/lib/Local/RpcServerEnvironment.js.map +1 -1
- package/lib/Local/RpcServerNode.d.ts.map +1 -1
- package/lib/Local/RpcServerNode.js +5 -1
- package/lib/Local/RpcServerNode.js.map +1 -1
- package/lib/Local/RpcServerSession.d.ts +1 -1
- package/lib/Local/RpcServerSession.d.ts.map +1 -1
- package/lib/Local/RpcServerSession.js.map +1 -1
- package/lib/Local/RpcSpawner.d.ts +6 -8
- package/lib/Local/RpcSpawner.d.ts.map +1 -1
- package/lib/Local/RpcSpawner.js +45 -36
- package/lib/Local/RpcSpawner.js.map +1 -1
- package/lib/Local/Sidecar.d.ts +23 -0
- package/lib/Local/Sidecar.d.ts.map +1 -1
- package/lib/Local/Sidecar.js +14 -9
- package/lib/Local/Sidecar.js.map +1 -1
- package/lib/Nuke.d.ts +5 -23
- package/lib/Nuke.d.ts.map +1 -1
- package/lib/Nuke.js +48 -13
- package/lib/Nuke.js.map +1 -1
- package/lib/Output.d.ts +19 -1
- package/lib/Output.d.ts.map +1 -1
- package/lib/Output.js +96 -3
- package/lib/Output.js.map +1 -1
- package/lib/Plan.d.ts +5 -1
- package/lib/Plan.d.ts.map +1 -1
- package/lib/Plan.js +111 -33
- package/lib/Plan.js.map +1 -1
- package/lib/Platform.d.ts.map +1 -1
- package/lib/Platform.js +31 -7
- package/lib/Platform.js.map +1 -1
- package/lib/Provider.d.ts +45 -0
- package/lib/Provider.d.ts.map +1 -1
- package/lib/Provider.js +2 -2
- package/lib/Provider.js.map +1 -1
- package/lib/Report.d.ts +17 -195
- package/lib/Report.d.ts.map +1 -1
- package/lib/Report.js +39 -12
- package/lib/Report.js.map +1 -1
- package/lib/Runtime/ManagedHttpShutdown.d.ts +17 -0
- package/lib/Runtime/ManagedHttpShutdown.d.ts.map +1 -1
- package/lib/Runtime/ManagedHttpShutdown.js +11 -2
- package/lib/Runtime/ManagedHttpShutdown.js.map +1 -1
- package/lib/RuntimeContext.js +1 -1
- package/lib/RuntimeContext.js.map +1 -1
- package/lib/Stack.d.ts +49 -29
- package/lib/Stack.d.ts.map +1 -1
- package/lib/Stack.js +25 -31
- package/lib/Stack.js.map +1 -1
- package/lib/State/BucketState.d.ts.map +1 -1
- package/lib/State/BucketState.js +43 -14
- package/lib/State/BucketState.js.map +1 -1
- package/lib/State/LocalState.d.ts.map +1 -1
- package/lib/State/LocalState.js +3 -3
- package/lib/State/LocalState.js.map +1 -1
- package/lib/State/Provisioning.d.ts +5 -0
- package/lib/State/Provisioning.d.ts.map +1 -1
- package/lib/State/Provisioning.js +3 -1
- package/lib/State/Provisioning.js.map +1 -1
- package/lib/State/ResourceState.d.ts +2 -0
- package/lib/State/ResourceState.d.ts.map +1 -1
- package/lib/State/State.d.ts +26 -0
- package/lib/State/State.d.ts.map +1 -1
- package/lib/State/StateEncoding.d.ts +7 -0
- package/lib/State/StateEncoding.d.ts.map +1 -1
- package/lib/State/StateEncoding.js +19 -0
- package/lib/State/StateEncoding.js.map +1 -1
- package/lib/State/index.js +2 -2
- package/lib/State/index.js.map +1 -1
- package/lib/Telemetry/Layer.d.ts +2 -5
- package/lib/Telemetry/Layer.d.ts.map +1 -1
- package/lib/Telemetry/Layer.js +3 -23
- package/lib/Telemetry/Layer.js.map +1 -1
- package/lib/Telemetry/Metrics.d.ts +1 -1
- package/lib/Telemetry/Metrics.d.ts.map +1 -1
- package/lib/TelemetryRelay.js +1 -1
- package/lib/TelemetryRelay.js.map +1 -1
- package/lib/TelemetryRuntime.d.ts +1 -1
- package/lib/TelemetryRuntime.d.ts.map +1 -1
- package/lib/TelemetryRuntime.js +4 -3
- package/lib/TelemetryRuntime.js.map +1 -1
- package/lib/Util/ConsoleSink.d.ts +23 -2
- package/lib/Util/ConsoleSink.d.ts.map +1 -1
- package/lib/Util/ConsoleSink.js +54 -14
- package/lib/Util/ConsoleSink.js.map +1 -1
- package/lib/Util/LogAnnotation.d.ts +19 -0
- package/lib/Util/LogAnnotation.d.ts.map +1 -0
- package/lib/Util/LogAnnotation.js +19 -0
- package/lib/Util/LogAnnotation.js.map +1 -0
- package/lib/Util/LogRecord.d.ts +281 -0
- package/lib/Util/LogRecord.d.ts.map +1 -0
- package/lib/Util/LogRecord.js +267 -0
- package/lib/Util/LogRecord.js.map +1 -0
- package/lib/Util/Node.d.ts +9 -0
- package/lib/Util/Node.d.ts.map +1 -1
- package/lib/Util/Node.js +10 -6
- package/lib/Util/Node.js.map +1 -1
- package/lib/Util/PlatformServices.d.ts +3 -2
- package/lib/Util/PlatformServices.d.ts.map +1 -1
- package/lib/Util/PlatformServices.js +6 -2
- package/lib/Util/PlatformServices.js.map +1 -1
- package/lib/Util/ResourceOutput.d.ts +18 -10
- package/lib/Util/ResourceOutput.d.ts.map +1 -1
- package/lib/Util/ResourceOutput.js +22 -23
- package/lib/Util/ResourceOutput.js.map +1 -1
- package/lib/Util/Shutdown.d.ts +10 -0
- package/lib/Util/Shutdown.d.ts.map +1 -0
- package/lib/Util/Shutdown.js +32 -0
- package/lib/Util/Shutdown.js.map +1 -0
- package/lib/Util/Terminal.d.ts +2 -4
- package/lib/Util/Terminal.d.ts.map +1 -1
- package/lib/Util/Terminal.js +3 -11
- package/lib/Util/Terminal.js.map +1 -1
- package/lib/Util/TraceParent.d.ts +32 -0
- package/lib/Util/TraceParent.d.ts.map +1 -0
- package/lib/Util/TraceParent.js +42 -0
- package/lib/Util/TraceParent.js.map +1 -0
- package/lib/Util/base64.d.ts +7 -0
- package/lib/Util/base64.d.ts.map +1 -0
- package/lib/Util/base64.js +24 -0
- package/lib/Util/base64.js.map +1 -0
- package/lib/Util/cached-function.d.ts +5 -0
- package/lib/Util/cached-function.d.ts.map +1 -1
- package/lib/Util/cached-function.js +13 -8
- package/lib/Util/cached-function.js.map +1 -1
- package/lib/Util/data.d.ts +1 -1
- package/lib/Util/data.d.ts.map +1 -1
- package/lib/Util/data.js +1 -1
- package/lib/Util/data.js.map +1 -1
- package/lib/Util/equal.d.ts.map +1 -1
- package/lib/Util/equal.js +3 -2
- package/lib/Util/equal.js.map +1 -1
- package/lib/Util/extraFiles.d.ts.map +1 -1
- package/lib/Util/extraFiles.js +5 -5
- package/lib/Util/extraFiles.js.map +1 -1
- package/lib/Util/interactive.js +1 -1
- package/lib/Website/AstroOutput.d.ts +42 -0
- package/lib/Website/AstroOutput.d.ts.map +1 -0
- package/lib/Website/AstroOutput.js +34 -0
- package/lib/Website/AstroOutput.js.map +1 -0
- package/lib/Website/FrontendCore.d.ts +1 -1
- package/lib/Workflows.d.ts +9 -0
- package/lib/Workflows.d.ts.map +1 -1
- package/lib/Workflows.js +8 -0
- package/lib/Workflows.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +21 -28
- package/src/AdoptPolicy.ts +76 -0
- package/src/Alchemist/AuthRegistry.ts +164 -0
- package/src/Alchemist/Drift.ts +103 -0
- package/src/Alchemist/Entrypoint.ts +51 -3
- package/src/Alchemist/Errors.ts +1 -1
- package/src/Alchemist/{routes/logs.ts → Logs.ts} +28 -30
- package/src/Alchemist/Nuke.ts +90 -0
- package/src/Alchemist/Operations.ts +309 -0
- package/src/Alchemist/{routes/profile.ts → Profile.ts} +22 -22
- package/src/Alchemist/{routes/provider.ts → Provider.ts} +7 -6
- package/src/Alchemist/Runtime.ts +46 -12
- package/src/Alchemist/{routes/state.ts → State.ts} +78 -21
- package/src/Alchemist/index.ts +32 -15
- package/src/Apply.ts +513 -274
- package/src/Auth/AuthProvider.ts +76 -23
- package/src/Auth/BrowserOAuth.ts +37 -60
- package/src/Auth/Credentials.ts +2 -4
- package/src/Auth/Demand.ts +27 -18
- package/src/Auth/Env.ts +13 -8
- package/src/Auth/Inspect.ts +5 -2
- package/src/Auth/Lock.ts +4 -8
- package/src/Auth/OAuthFlow.ts +12 -26
- package/src/Auth/Paths.ts +3 -2
- package/src/Auth/Profile.ts +30 -2
- package/src/Auth/Registry.ts +27 -0
- package/src/Auth/Resolve.ts +75 -3
- package/src/Auth/StoredAuthProvider.ts +1 -2
- package/src/Binding.ts +3 -4
- package/src/Bundle/Bundle.ts +58 -7
- package/src/Bundle/NamespaceImportPlugin.ts +259 -0
- package/src/Bundle/index.ts +1 -0
- package/src/Cli/Format.ts +2 -1
- package/src/Cli/GlobalLog.ts +206 -68
- package/src/Cli/LoggingCli.ts +33 -20
- package/src/Cli/PlainCliFormatter.ts +4 -1
- package/src/Cli/Present.ts +34 -0
- package/src/Cli/SigilRenderer.ts +75 -0
- package/src/Cli/checkVersion.ts +25 -78
- package/src/Cli/commands/confirm.ts +3 -3
- package/src/Cli/commands/deploy.ts +53 -44
- package/src/Cli/commands/dev.ts +65 -7
- package/src/Cli/commands/drift.ts +20 -16
- package/src/Cli/commands/errors.ts +2 -3
- package/src/Cli/commands/instrument.ts +39 -8
- package/src/Cli/commands/logs.ts +22 -30
- package/src/Cli/commands/nuke.ts +25 -26
- package/src/Cli/commands/profile/commands.ts +34 -34
- package/src/Cli/commands/profile/flows.ts +26 -20
- package/src/Cli/commands/profile/hub.ts +16 -18
- package/src/Cli/commands/provider.ts +4 -4
- package/src/Cli/commands/render.ts +43 -71
- package/src/Cli/commands/state.ts +113 -33
- package/src/Cli/components/capabilities.ts +20 -0
- package/src/Cli/components/types.ts +13 -99
- package/src/Cli/components/ui/Environment.tsx +5 -5
- package/src/Cli/components/ui/Interactive.tsx +24 -15
- package/src/Cli/components/ui/Layout.tsx +1 -1
- package/src/Cli/components/ui/Typography.tsx +1 -1
- package/src/Cli/components/ui/index.ts +2 -2
- package/src/Cli/components/view/ApprovePlan.tsx +2 -1
- package/src/Cli/components/view/Format.tsx +58 -0
- package/src/Cli/components/view/Help.tsx +14 -17
- package/src/Cli/components/view/Logo.tsx +1 -1
- package/src/Cli/components/view/Nuke.tsx +74 -49
- package/src/Cli/components/view/PlanDecision.tsx +1 -1
- package/src/Cli/components/view/PlanRow.tsx +1 -1
- package/src/Cli/components/view/PlanTree.ts +2 -2
- package/src/Cli/components/view/PlanView.tsx +2 -2
- package/src/Cli/components/view/Profile.tsx +2 -2
- package/src/Cli/components/view/ProfileDashboard.tsx +12 -11
- package/src/Cli/components/view/Prompts.tsx +37 -75
- package/src/Cli/components/view/Runtime.tsx +132 -238
- package/src/Cli/components/view/SigilCli.tsx +12 -12
- package/src/Cli/components/view/StateExplorer.tsx +2 -1
- package/src/Cli/components/view/statusStyle.ts +2 -2
- package/src/Cli/exec.ts +48 -41
- package/src/Cli/main.ts +52 -33
- package/src/Cli/selectCli.ts +3 -3
- package/src/Command/Command.ts +1 -1
- package/src/Command/Dev.ts +129 -36
- package/src/Command/Memo.ts +1 -1
- package/src/Contributions.ts +42 -8
- package/src/DNS/Adapter.ts +289 -0
- package/src/DNS/index.ts +1 -0
- package/src/Deploy.ts +11 -3
- package/src/Destroy.ts +19 -13
- package/src/Diff.ts +17 -4
- package/src/Drift.ts +256 -127
- package/src/EvalStack.ts +97 -0
- package/src/Events.ts +296 -0
- package/src/Interaction.ts +332 -97
- package/src/Local/LocalProvider.ts +40 -9
- package/src/Local/RpcProvider.ts +11 -1
- package/src/Local/RpcProviderProxy.ts +29 -21
- package/src/Local/RpcSerialization.ts +32 -17
- package/src/Local/RpcServer.ts +25 -17
- package/src/Local/RpcServerBun.ts +10 -6
- package/src/Local/RpcServerEnvironment.ts +2 -2
- package/src/Local/RpcServerNode.ts +8 -1
- package/src/Local/RpcServerSession.ts +2 -2
- package/src/Local/RpcSpawner.ts +61 -37
- package/src/Local/Sidecar.ts +10 -1
- package/src/Nuke.ts +66 -43
- package/src/Output.ts +120 -7
- package/src/Plan.ts +140 -52
- package/src/Platform.ts +47 -18
- package/src/Provider.ts +48 -3
- package/src/Report.ts +77 -275
- package/src/Runtime/ManagedHttpShutdown.ts +21 -4
- package/src/RuntimeContext.ts +1 -1
- package/src/Stack.ts +113 -135
- package/src/State/BucketState.ts +53 -21
- package/src/State/LocalState.ts +7 -9
- package/src/State/Provisioning.ts +8 -1
- package/src/State/ResourceState.ts +2 -0
- package/src/State/State.ts +30 -0
- package/src/State/StateEncoding.ts +22 -0
- package/src/State/index.ts +2 -2
- package/src/Telemetry/Layer.ts +3 -24
- package/src/Telemetry/Metrics.ts +1 -1
- package/src/TelemetryRelay.ts +1 -1
- package/src/TelemetryRuntime.ts +8 -8
- package/src/Util/ConsoleSink.ts +76 -13
- package/src/Util/LogAnnotation.ts +18 -0
- package/src/Util/LogRecord.ts +386 -0
- package/src/Util/Node.ts +20 -6
- package/src/Util/PlatformServices.ts +17 -4
- package/src/Util/ResourceOutput.ts +26 -25
- package/src/Util/Shutdown.ts +52 -0
- package/src/Util/Terminal.ts +3 -20
- package/src/Util/TraceParent.ts +70 -0
- package/src/Util/base64.ts +22 -0
- package/src/Util/cached-function.ts +30 -19
- package/src/Util/data.ts +2 -2
- package/src/Util/equal.ts +3 -2
- package/src/Util/extraFiles.ts +9 -8
- package/src/Util/interactive.ts +1 -1
- package/src/Website/AstroOutput.ts +83 -0
- package/src/Workflows.ts +11 -0
- package/src/index.ts +1 -0
- package/lib/Alchemist/Progress.d.ts +0 -16
- package/lib/Alchemist/Progress.d.ts.map +0 -1
- package/lib/Alchemist/Progress.js +0 -123
- package/lib/Alchemist/Progress.js.map +0 -1
- package/lib/Alchemist/Session.d.ts +0 -116
- package/lib/Alchemist/Session.d.ts.map +0 -1
- package/lib/Alchemist/Session.js +0 -212
- package/lib/Alchemist/Session.js.map +0 -1
- package/lib/Alchemist/routes/drift.d.ts +0 -55
- package/lib/Alchemist/routes/drift.d.ts.map +0 -1
- package/lib/Alchemist/routes/drift.js +0 -52
- package/lib/Alchemist/routes/drift.js.map +0 -1
- package/lib/Alchemist/routes/logs.d.ts +0 -41
- package/lib/Alchemist/routes/logs.d.ts.map +0 -1
- package/lib/Alchemist/routes/logs.js.map +0 -1
- package/lib/Alchemist/routes/nuke.d.ts +0 -46
- package/lib/Alchemist/routes/nuke.d.ts.map +0 -1
- package/lib/Alchemist/routes/nuke.js +0 -80
- package/lib/Alchemist/routes/nuke.js.map +0 -1
- package/lib/Alchemist/routes/profile.d.ts +0 -133
- package/lib/Alchemist/routes/profile.d.ts.map +0 -1
- package/lib/Alchemist/routes/profile.js.map +0 -1
- package/lib/Alchemist/routes/provider.d.ts.map +0 -1
- package/lib/Alchemist/routes/provider.js.map +0 -1
- package/lib/Alchemist/routes/stack.d.ts +0 -95
- package/lib/Alchemist/routes/stack.d.ts.map +0 -1
- package/lib/Alchemist/routes/stack.js +0 -73
- package/lib/Alchemist/routes/stack.js.map +0 -1
- package/lib/Alchemist/routes/state.d.ts.map +0 -1
- package/lib/Alchemist/routes/state.js.map +0 -1
- package/lib/Cli/CliKit/CliKit.d.ts +0 -92
- package/lib/Cli/CliKit/CliKit.d.ts.map +0 -1
- package/lib/Cli/CliKit/CliKit.js +0 -27
- package/lib/Cli/CliKit/CliKit.js.map +0 -1
- package/lib/Cli/CliKit/index.d.ts +0 -9
- package/lib/Cli/CliKit/index.d.ts.map +0 -1
- package/lib/Cli/CliKit/index.js +0 -9
- package/lib/Cli/CliKit/index.js.map +0 -1
- package/lib/Cli/CliKit/interaction.d.ts +0 -13
- package/lib/Cli/CliKit/interaction.d.ts.map +0 -1
- package/lib/Cli/CliKit/interaction.js +0 -17
- package/lib/Cli/CliKit/interaction.js.map +0 -1
- package/lib/Cli/CliKit/layer.d.ts +0 -7
- package/lib/Cli/CliKit/layer.d.ts.map +0 -1
- package/lib/Cli/CliKit/layer.js +0 -33
- package/lib/Cli/CliKit/layer.js.map +0 -1
- package/lib/Local/DevLog.d.ts +0 -32
- package/lib/Local/DevLog.d.ts.map +0 -1
- package/lib/Local/DevLog.js +0 -112
- package/lib/Local/DevLog.js.map +0 -1
- package/lib/Test/Alchemy.d.ts +0 -79
- package/lib/Test/Alchemy.d.ts.map +0 -1
- package/lib/Test/Alchemy.js +0 -193
- package/lib/Test/Alchemy.js.map +0 -1
- package/lib/Test/Bun.d.ts +0 -69
- package/lib/Test/Bun.d.ts.map +0 -1
- package/lib/Test/Bun.js +0 -126
- package/lib/Test/Bun.js.map +0 -1
- package/lib/Test/Core.d.ts +0 -277
- package/lib/Test/Core.d.ts.map +0 -1
- package/lib/Test/Core.js +0 -362
- package/lib/Test/Core.js.map +0 -1
- package/lib/Test/Http.d.ts +0 -109
- package/lib/Test/Http.d.ts.map +0 -1
- package/lib/Test/Http.js +0 -123
- package/lib/Test/Http.js.map +0 -1
- package/lib/Test/TestState.d.ts +0 -12
- package/lib/Test/TestState.d.ts.map +0 -1
- package/lib/Test/TestState.js +0 -15
- package/lib/Test/TestState.js.map +0 -1
- package/lib/Test/Vitest.d.ts +0 -60
- package/lib/Test/Vitest.d.ts.map +0 -1
- package/lib/Test/Vitest.js +0 -132
- package/lib/Test/Vitest.js.map +0 -1
- package/lib/Test/index.d.ts +0 -3
- package/lib/Test/index.d.ts.map +0 -1
- package/lib/Test/index.js +0 -3
- package/lib/Test/index.js.map +0 -1
- package/lib/Util/FileLogger.d.ts +0 -7
- package/lib/Util/FileLogger.d.ts.map +0 -1
- package/lib/Util/FileLogger.js +0 -16
- package/lib/Util/FileLogger.js.map +0 -1
- package/src/Alchemist/Progress.ts +0 -167
- package/src/Alchemist/Session.ts +0 -415
- package/src/Alchemist/routes/drift.ts +0 -87
- package/src/Alchemist/routes/nuke.ts +0 -131
- package/src/Alchemist/routes/stack.ts +0 -173
- package/src/Cli/CliKit/CliKit.ts +0 -159
- package/src/Cli/CliKit/index.ts +0 -41
- package/src/Cli/CliKit/interaction.ts +0 -19
- package/src/Cli/CliKit/layer.ts +0 -44
- package/src/Local/DevLog.ts +0 -122
- package/src/Test/Alchemy.ts +0 -334
- package/src/Test/Bun.ts +0 -230
- package/src/Test/Core.ts +0 -785
- package/src/Test/Http.ts +0 -201
- package/src/Test/TestState.ts +0 -35
- package/src/Test/Vitest.ts +0 -239
- package/src/Test/index.ts +0 -2
- package/src/Util/FileLogger.ts +0 -20
package/src/Util/Node.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import * as NodeNet from "node:net";
|
|
2
|
+
import * as Data from "effect/Data";
|
|
2
3
|
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Result from "effect/Result";
|
|
5
|
+
import * as SemVer from "effect/SemVer";
|
|
6
|
+
import * as SemVerRange from "effect/SemVerRange";
|
|
7
|
+
|
|
8
|
+
export class NodeOperationFailed extends Data.TaggedError("NodeOperationFailed")<{
|
|
9
|
+
readonly message: string;
|
|
10
|
+
readonly cause?: unknown;
|
|
11
|
+
}> {}
|
|
3
12
|
|
|
4
13
|
/**
|
|
5
14
|
* The process's working directory, captured ONCE at module load.
|
|
@@ -91,15 +100,16 @@ export const nodeLoaderArgs = (entry: string): string[] => [
|
|
|
91
100
|
* before any `.ts` can load. Keep the two in sync.
|
|
92
101
|
*/
|
|
93
102
|
export const isRegisterHooksSupported = (version = process.versions.node): boolean => {
|
|
94
|
-
const
|
|
103
|
+
const parsed = Result.getOrUndefined(SemVer.parse(version));
|
|
95
104
|
return (
|
|
96
|
-
|
|
97
|
-
(major === 24 && (minor > 11 || (minor === 11 && patch >= 1))) ||
|
|
98
|
-
(major === 25 && minor >= 1) ||
|
|
99
|
-
major >= 26
|
|
105
|
+
parsed !== undefined && SemVerRange.matches(REGISTER_HOOKS, parsed, { includePrerelease: true })
|
|
100
106
|
);
|
|
101
107
|
};
|
|
102
108
|
|
|
109
|
+
const REGISTER_HOOKS = SemVerRange.parseUnsafe(
|
|
110
|
+
">=22.22.3 <23.0.0-0 || >=24.11.1 <25.0.0-0 || >=25.1.0",
|
|
111
|
+
);
|
|
112
|
+
|
|
103
113
|
/**
|
|
104
114
|
* Ask the OS for an unused TCP port, release it, and return its number.
|
|
105
115
|
*
|
|
@@ -121,7 +131,11 @@ export const findAvailablePort = (host = "127.0.0.1") =>
|
|
|
121
131
|
} else if (port !== undefined) {
|
|
122
132
|
resume(Effect.succeed(port));
|
|
123
133
|
} else {
|
|
124
|
-
resume(
|
|
134
|
+
resume(
|
|
135
|
+
Effect.fail(
|
|
136
|
+
new NodeOperationFailed({ message: "Failed to allocate an available port" }),
|
|
137
|
+
),
|
|
138
|
+
);
|
|
125
139
|
}
|
|
126
140
|
});
|
|
127
141
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Digest from "effect/crypto/Digest";
|
|
2
|
+
import * as SecureRandom from "effect/crypto/SecureRandom";
|
|
2
3
|
import type { Input as DurationInput } from "effect/Duration";
|
|
3
4
|
import * as Effect from "effect/Effect";
|
|
4
5
|
import type { FileSystem } from "effect/FileSystem";
|
|
@@ -47,9 +48,13 @@ export const platformLayer = <A, E, R>(constructors: {
|
|
|
47
48
|
}),
|
|
48
49
|
);
|
|
49
50
|
|
|
51
|
+
// effect 4.1 dropped crypto from the platform `*Services` bundles.
|
|
52
|
+
const WebCryptoServices = Layer.mergeAll(SecureRandom.layerWebCrypto, Digest.layerWebCrypto);
|
|
53
|
+
|
|
50
54
|
export type PlatformServices =
|
|
51
55
|
| ChildProcessSpawner
|
|
52
|
-
|
|
|
56
|
+
| Digest.Digest
|
|
57
|
+
| SecureRandom.SecureRandom
|
|
53
58
|
| FileSystem
|
|
54
59
|
| Path
|
|
55
60
|
| Stdio
|
|
@@ -63,7 +68,11 @@ export const PlatformServices: Layer.Layer<PlatformServices> = platformLayer({
|
|
|
63
68
|
importPlatformPeer("@effect/platform-bun", () => import("@effect/platform-bun/BunServices")),
|
|
64
69
|
importPlatformPeer("@effect/platform-bun", () => import("@effect/platform-bun/BunSocket")),
|
|
65
70
|
]);
|
|
66
|
-
return Layer.
|
|
71
|
+
return Layer.mergeAll(
|
|
72
|
+
BunServices.layer,
|
|
73
|
+
BunSocket.layerWebSocketConstructor,
|
|
74
|
+
WebCryptoServices,
|
|
75
|
+
);
|
|
67
76
|
},
|
|
68
77
|
node: async () => {
|
|
69
78
|
const [NodeServices, NodeSocket] = await Promise.all([
|
|
@@ -73,7 +82,11 @@ export const PlatformServices: Layer.Layer<PlatformServices> = platformLayer({
|
|
|
73
82
|
),
|
|
74
83
|
importPlatformPeer("@effect/platform-node", () => import("@effect/platform-node/NodeSocket")),
|
|
75
84
|
]);
|
|
76
|
-
return Layer.
|
|
85
|
+
return Layer.mergeAll(
|
|
86
|
+
NodeServices.layer,
|
|
87
|
+
NodeSocket.layerWebSocketConstructor,
|
|
88
|
+
WebCryptoServices,
|
|
89
|
+
);
|
|
77
90
|
},
|
|
78
91
|
});
|
|
79
92
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { stripVTControlCharacters } from "node:util";
|
|
2
|
-
import type * as ConsoleService from "effect/Console";
|
|
3
2
|
import * as Effect from "effect/Effect";
|
|
4
3
|
import { makeLineBuffer } from "./LineBuffer.ts";
|
|
4
|
+
import { logChildLine } from "./LogRecord.ts";
|
|
5
5
|
import { ANSI_RESET, ansiFg, colorsEnabled } from "./Terminal.ts";
|
|
6
6
|
import { theme } from "./Theme.ts";
|
|
7
7
|
|
|
@@ -40,32 +40,33 @@ export const stripChildEffectPrefix = (line: string): string => {
|
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
43
|
+
* Log one line a resource-owned process wrote, as a structured record: the
|
|
44
|
+
* child's text (with any pretty Effect prefix removed) plus the resource and
|
|
45
|
+
* stream it came from. The record keeps the text as written; the renderer
|
|
46
|
+
* draws the resource tag and strips styling when colors are off. A JSON line from an alchemy child is replayed as-is.
|
|
47
|
+
*
|
|
48
|
+
* stderr is a process transport, not a semantic failure: Vite and many other
|
|
49
|
+
* tools write warnings, progress, and ordinary diagnostics there, so both
|
|
50
|
+
* streams log at Info and carry the stream as data.
|
|
46
51
|
*/
|
|
47
|
-
export const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
};
|
|
52
|
+
export const logResourceLine = (id: string, channel: OutputChannel, line: string) =>
|
|
53
|
+
logChildLine(stripChildEffectPrefix(line), { stream: channel, resource: id });
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Line-buffered output for resource-owned child processes whose streams
|
|
57
|
+
* arrive as chunks outside an Effect (workerd output pumps, stream mirrors).
|
|
58
|
+
* Captures the caller's services so each line goes through its loggers.
|
|
59
|
+
*/
|
|
60
|
+
export const makeResourceOutput = Effect.fn(function* (id: string) {
|
|
61
|
+
const context = yield* Effect.context<never>();
|
|
62
|
+
const writer = (channel: OutputChannel) =>
|
|
63
|
+
makeLineBuffer((line) => Effect.runSyncWith(context)(logResourceLine(id, channel, line)));
|
|
64
|
+
return { stdout: writer("stdout"), stderr: writer("stderr") };
|
|
65
|
+
});
|
|
60
66
|
|
|
61
67
|
/**
|
|
62
68
|
* Effect-native output for resource-owned child processes whose streams are
|
|
63
|
-
* already consumed inside an Effect.
|
|
64
|
-
* details, not semantic severity, so they enter the configured logger at the
|
|
65
|
-
* info level. The logger remains responsible for terminal and file sinks.
|
|
69
|
+
* already consumed inside an Effect.
|
|
66
70
|
*/
|
|
67
|
-
export const makeResourceLogger = (id: string) =>
|
|
68
|
-
|
|
69
|
-
return (_channel: OutputChannel, line: string) =>
|
|
70
|
-
Effect.logInfo(`${prefix} ${stripChildEffectPrefix(line)}`);
|
|
71
|
-
};
|
|
71
|
+
export const makeResourceLogger = (id: string) => (channel: OutputChannel, line: string) =>
|
|
72
|
+
logResourceLine(id, channel, line);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as Clock from "effect/Clock";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Time this process's shutdown in the run log: a Debug record when SIGINT or
|
|
6
|
+
* SIGTERM arrives, and one when `effect` has finished (finalizers included),
|
|
7
|
+
* with the time since the signal. Silent when the process ends on its own.
|
|
8
|
+
*/
|
|
9
|
+
export const logShutdown =
|
|
10
|
+
(name: string) =>
|
|
11
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R> =>
|
|
12
|
+
Effect.gen(function* () {
|
|
13
|
+
const context = yield* Effect.context<never>();
|
|
14
|
+
const clock = yield* Clock.Clock;
|
|
15
|
+
let signalled: { readonly signal: string; readonly at: number } | undefined;
|
|
16
|
+
const onSignal = (signal: NodeJS.Signals) => {
|
|
17
|
+
if (signalled !== undefined) return;
|
|
18
|
+
signalled = { signal, at: clock.currentTimeMillisUnsafe() };
|
|
19
|
+
Effect.runForkWith(context)(Effect.logDebug(`shutdown: ${name} received ${signal}`));
|
|
20
|
+
};
|
|
21
|
+
// Ahead of the runtime's own handler, which interrupts this fiber and
|
|
22
|
+
// can run its whole teardown synchronously before later listeners.
|
|
23
|
+
process.prependListener("SIGINT", onSignal);
|
|
24
|
+
process.prependListener("SIGTERM", onSignal);
|
|
25
|
+
return yield* effect.pipe(
|
|
26
|
+
Effect.onExit(() =>
|
|
27
|
+
Effect.flatMap(Clock.currentTimeMillis, (now) => {
|
|
28
|
+
process.off("SIGINT", onSignal);
|
|
29
|
+
process.off("SIGTERM", onSignal);
|
|
30
|
+
return signalled === undefined
|
|
31
|
+
? Effect.void
|
|
32
|
+
: Effect.logDebug(
|
|
33
|
+
`shutdown: ${name} finished ${now - signalled.at}ms after ${signalled.signal}`,
|
|
34
|
+
);
|
|
35
|
+
}),
|
|
36
|
+
),
|
|
37
|
+
);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
/** Run `effect` and log how long it took, as a step of a shutdown. */
|
|
41
|
+
export const timedShutdownStep =
|
|
42
|
+
(step: string) =>
|
|
43
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R> =>
|
|
44
|
+
Effect.flatMap(Clock.currentTimeMillis, (start) =>
|
|
45
|
+
effect.pipe(
|
|
46
|
+
Effect.onExit(() =>
|
|
47
|
+
Effect.flatMap(Clock.currentTimeMillis, (end) =>
|
|
48
|
+
Effect.logDebug(`shutdown: ${step} in ${end - start}ms`),
|
|
49
|
+
),
|
|
50
|
+
),
|
|
51
|
+
),
|
|
52
|
+
);
|
package/src/Util/Terminal.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
setTerminalProgress,
|
|
4
|
-
stringWidth,
|
|
5
|
-
tmuxPassthrough,
|
|
6
|
-
type TerminalProgressState,
|
|
7
|
-
} from "@alchemy.run/sigil/ansi";
|
|
8
|
-
/** Terminal-emulator features shared by CliKit components. */
|
|
1
|
+
import { setClipboard, stringWidth, tmuxPassthrough } from "@alchemy.run/sigil/ansi";
|
|
2
|
+
/** Terminal-emulator features shared by CLI components. */
|
|
9
3
|
import { detectColorLevel, detectUnicodeSupport } from "@alchemy.run/sigil/capabilities";
|
|
10
4
|
|
|
11
5
|
export const ANSI_RESET = "\u001B[0m";
|
|
@@ -22,7 +16,7 @@ export const ansiFg = (hex: string) => {
|
|
|
22
16
|
|
|
23
17
|
/**
|
|
24
18
|
* The canonical color-support decision, shared by raw terminal strings and
|
|
25
|
-
*
|
|
19
|
+
* terminal capability detection so the two can never disagree.
|
|
26
20
|
*/
|
|
27
21
|
export const colorsEnabled = (
|
|
28
22
|
stream: Pick<NodeJS.WriteStream, "isTTY"> = process.stdout,
|
|
@@ -49,17 +43,6 @@ export const copyToClipboard = (
|
|
|
49
43
|
stdout.write(sequence);
|
|
50
44
|
};
|
|
51
45
|
|
|
52
|
-
export const setNativeProgress = (
|
|
53
|
-
state: TerminalProgressState,
|
|
54
|
-
value?: number,
|
|
55
|
-
stdout: Pick<NodeJS.WriteStream, "write" | "isTTY"> = process.stdout,
|
|
56
|
-
): void => {
|
|
57
|
-
if (stdout.isTTY !== true) return;
|
|
58
|
-
let sequence = setTerminalProgress(state, value);
|
|
59
|
-
if (process.env.TMUX !== undefined) sequence = tmuxPassthrough(sequence);
|
|
60
|
-
stdout.write(sequence);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
46
|
const truncateSegmenter = new Intl.Segmenter();
|
|
64
47
|
|
|
65
48
|
/** Display-width-aware truncation (wide CJK/emoji count by rendered cells). */
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Hex from "effect/encoding/Hex";
|
|
3
|
+
import * as Option from "effect/Option";
|
|
4
|
+
import * as Stream from "effect/Stream";
|
|
5
|
+
import * as Tracer from "effect/Tracer";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The span a child process or RPC call runs under, so its records and spans
|
|
9
|
+
* join the caller's trace instead of starting their own.
|
|
10
|
+
*/
|
|
11
|
+
export interface TraceParent {
|
|
12
|
+
readonly traceId: string;
|
|
13
|
+
readonly spanId: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Set on alchemy child processes to the trace they report under. */
|
|
17
|
+
export const TRACE_PARENT_ENV = "ALCHEMY_TRACE_PARENT";
|
|
18
|
+
|
|
19
|
+
const fromEnv = (): TraceParent | undefined => {
|
|
20
|
+
const [traceId, spanId] = (process.env[TRACE_PARENT_ENV] ?? "").split("-");
|
|
21
|
+
return traceId && spanId ? { traceId, spanId } : undefined;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* This process's trace, for records logged outside any span (startup,
|
|
26
|
+
* shutdown, finalizers): the parent's when it passed one in
|
|
27
|
+
* {@link TRACE_PARENT_ENV}, otherwise a new one. It ties a process's
|
|
28
|
+
* untraced records together and to its parent's, without a span that would
|
|
29
|
+
* stay open for the life of the process.
|
|
30
|
+
*/
|
|
31
|
+
export const processTrace: TraceParent = fromEnv() ?? {
|
|
32
|
+
traceId: Hex.random(32),
|
|
33
|
+
spanId: Hex.random(16),
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** The caller's current span, if it is in one. */
|
|
37
|
+
export const currentTraceParent: Effect.Effect<TraceParent | undefined> = Effect.map(
|
|
38
|
+
Effect.option(Effect.currentParentSpan),
|
|
39
|
+
Option.match({
|
|
40
|
+
onNone: () => undefined,
|
|
41
|
+
onSome: (span) => ({ traceId: span.traceId, spanId: span.spanId }),
|
|
42
|
+
}),
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* {@link TRACE_PARENT_ENV} for a child process: the current span, or this
|
|
47
|
+
* process's trace outside one.
|
|
48
|
+
*/
|
|
49
|
+
export const traceParentEnv: Effect.Effect<Record<string, string>> = Effect.map(
|
|
50
|
+
currentTraceParent,
|
|
51
|
+
(parent = processTrace): Record<string, string> => ({
|
|
52
|
+
[TRACE_PARENT_ENV]: `${parent.traceId}-${parent.spanId}`,
|
|
53
|
+
}),
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
const spanOf = (parent: TraceParent) => Tracer.externalSpan({ ...parent, sampled: true });
|
|
57
|
+
|
|
58
|
+
/** Run `effect` as a child of `parent`, when there is one. */
|
|
59
|
+
export const withTraceParent =
|
|
60
|
+
(parent: TraceParent | undefined) =>
|
|
61
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R> =>
|
|
62
|
+
parent === undefined ? effect : Effect.withParentSpan(effect, spanOf(parent));
|
|
63
|
+
|
|
64
|
+
/** Run `stream` (its whole execution, not just its construction) as a child of `parent`. */
|
|
65
|
+
export const withStreamTraceParent =
|
|
66
|
+
(parent: TraceParent | undefined) =>
|
|
67
|
+
<A, E, R>(stream: Stream.Stream<A, E, R>): Stream.Stream<A, E, R> =>
|
|
68
|
+
parent === undefined
|
|
69
|
+
? stream
|
|
70
|
+
: Stream.provideService(stream, Tracer.ParentSpan, spanOf(parent));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base64 for byte arrays, on the native `toBase64`/`fromBase64` when the
|
|
3
|
+
* runtime has them and `btoa`/`atob` otherwise.
|
|
4
|
+
*/
|
|
5
|
+
export const bytesToBase64 = (bytes: Uint8Array): string => {
|
|
6
|
+
const encode = (bytes as Uint8Array & { toBase64?: () => string }).toBase64;
|
|
7
|
+
if (typeof encode === "function") return encode.call(bytes);
|
|
8
|
+
let binary = "";
|
|
9
|
+
for (const byte of bytes) binary += String.fromCharCode(byte);
|
|
10
|
+
return btoa(binary);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const base64ToBytes = (b64: string): Uint8Array => {
|
|
14
|
+
const decode = (
|
|
15
|
+
Uint8Array as Uint8ArrayConstructor & { fromBase64?: (value: string) => Uint8Array }
|
|
16
|
+
).fromBase64;
|
|
17
|
+
if (typeof decode === "function") return decode.call(Uint8Array, b64);
|
|
18
|
+
const binary = atob(b64);
|
|
19
|
+
const out = new Uint8Array(binary.length);
|
|
20
|
+
for (let i = 0; i < binary.length; i++) out[i] = binary.charCodeAt(i);
|
|
21
|
+
return out;
|
|
22
|
+
};
|
|
@@ -41,35 +41,46 @@ export const cachedFunction = <A extends Array<any>, B, E, R>(
|
|
|
41
41
|
fn: (...args: A) => Effect.Effect<B, E, R>,
|
|
42
42
|
options?: CachedFunctionOptions<A>,
|
|
43
43
|
): Effect.Effect<(...args: A) => Effect.Effect<B, E, R>> =>
|
|
44
|
-
Effect.sync(() =>
|
|
45
|
-
const keyFn = options?.key ?? JSON.stringify;
|
|
46
|
-
const cache = new Map<string, Deferred.Deferred<B, E>>();
|
|
44
|
+
Effect.sync(() => makeCachedFunction(fn, options));
|
|
47
45
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
/**
|
|
47
|
+
* {@link cachedFunction} for callers that own the cache's lifetime outside an
|
|
48
|
+
* Effect, such as a `Context.Reference` default.
|
|
49
|
+
*/
|
|
50
|
+
export const makeCachedFunction = <A extends Array<any>, B, E, R>(
|
|
51
|
+
fn: (...args: A) => Effect.Effect<B, E, R>,
|
|
52
|
+
options?: CachedFunctionOptions<A>,
|
|
53
|
+
): ((...args: A) => Effect.Effect<B, E, R>) => {
|
|
54
|
+
const keyFn = options?.key ?? JSON.stringify;
|
|
55
|
+
const cache = new Map<string, Deferred.Deferred<B, E>>();
|
|
56
|
+
|
|
57
|
+
return (...args: A): Effect.Effect<B, E, R> =>
|
|
58
|
+
Effect.suspend(() => {
|
|
59
|
+
const cacheKey = keyFn(args);
|
|
60
|
+
const existing = cache.get(cacheKey);
|
|
52
61
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
62
|
+
// If there's already a deferred for this key, wait on it
|
|
63
|
+
if (existing) {
|
|
64
|
+
return Deferred.await(existing);
|
|
65
|
+
}
|
|
57
66
|
|
|
58
|
-
|
|
59
|
-
|
|
67
|
+
// Create a new deferred and store it. Only the call itself is
|
|
68
|
+
// interruptible, so an interrupted first caller still settles its
|
|
69
|
+
// waiters and evicts the key instead of leaving it pending forever.
|
|
70
|
+
return Effect.uninterruptibleMask((restore) =>
|
|
71
|
+
Effect.gen(function* () {
|
|
60
72
|
const deferred = yield* Deferred.make<B, E>();
|
|
61
73
|
cache.set(cacheKey, deferred);
|
|
62
74
|
|
|
63
|
-
|
|
64
|
-
const exit = yield* Effect.exit(fn(...args));
|
|
75
|
+
const exit = yield* Effect.exit(restore(fn(...args)));
|
|
65
76
|
yield* Deferred.done(deferred, exit);
|
|
66
77
|
|
|
67
78
|
if (exit._tag === "Failure") {
|
|
68
79
|
cache.delete(cacheKey);
|
|
69
80
|
}
|
|
70
81
|
|
|
71
|
-
// Return the result
|
|
72
82
|
return yield* exit;
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
|
|
83
|
+
}),
|
|
84
|
+
);
|
|
85
|
+
});
|
|
86
|
+
};
|
package/src/Util/data.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as Predicate from "effect/Predicate";
|
|
|
2
2
|
import * as EffectRecord from "effect/Record";
|
|
3
3
|
import * as Redacted from "effect/Redacted";
|
|
4
4
|
|
|
5
|
-
export type Primitive =
|
|
5
|
+
export type Primitive = undefined | null | boolean | number | string | bigint | symbol;
|
|
6
6
|
|
|
7
7
|
export const isPrimitive = (value: any): value is Primitive =>
|
|
8
8
|
value === undefined ||
|
|
@@ -92,7 +92,7 @@ type UnwrapRedacted<T> =
|
|
|
92
92
|
|
|
93
93
|
export const unwrapRedacted = <T>(value: T): UnwrapRedacted<T> => {
|
|
94
94
|
if (Redacted.isRedacted(value)) {
|
|
95
|
-
return
|
|
95
|
+
return value.pipe(Redacted.value, unwrapRedacted) as UnwrapRedacted<T>;
|
|
96
96
|
}
|
|
97
97
|
if (Array.isArray(value)) {
|
|
98
98
|
return value.map(unwrapRedacted) as UnwrapRedacted<T>;
|
package/src/Util/equal.ts
CHANGED
|
@@ -30,8 +30,9 @@ export const arrayEqualsUnordered = <T extends string | number>(
|
|
|
30
30
|
if (a === b) return true;
|
|
31
31
|
if (a === undefined || b === undefined) return false;
|
|
32
32
|
if (a.length !== b.length) return false;
|
|
33
|
-
const
|
|
34
|
-
const
|
|
33
|
+
const compare = (x: T, y: T) => (x < y ? -1 : x > y ? 1 : 0);
|
|
34
|
+
const as = [...a].sort(compare);
|
|
35
|
+
const bs = [...b].sort(compare);
|
|
35
36
|
for (let i = 0; i < as.length; i++) {
|
|
36
37
|
if (as[i] !== bs[i]) return false;
|
|
37
38
|
}
|
package/src/Util/extraFiles.ts
CHANGED
|
@@ -119,8 +119,9 @@ export const hashExtraFiles = Effect.fn(function* (
|
|
|
119
119
|
const path = yield* Path.Path;
|
|
120
120
|
const runtimeBase = process.cwd();
|
|
121
121
|
const dotAlchemy = yield* dotAlchemyDirectory;
|
|
122
|
-
const entries = yield* Effect.
|
|
123
|
-
|
|
122
|
+
const entries = yield* Effect.forEach(
|
|
123
|
+
extraFiles ?? [],
|
|
124
|
+
(extra) =>
|
|
124
125
|
Effect.gen(function* () {
|
|
125
126
|
const dest = extraFileDestination(extra.dest);
|
|
126
127
|
const source = resolveExtraSource(extra.source, path);
|
|
@@ -139,7 +140,6 @@ export const hashExtraFiles = Effect.fn(function* (
|
|
|
139
140
|
: yield* sha256(yield* fs.readFile(source));
|
|
140
141
|
return [dest, hash] as const;
|
|
141
142
|
}),
|
|
142
|
-
),
|
|
143
143
|
{ concurrency: ioConcurrency },
|
|
144
144
|
);
|
|
145
145
|
return Object.fromEntries(entries) as Record<string, string>;
|
|
@@ -204,8 +204,9 @@ export const copyExtraFiles = Effect.fn(function* (
|
|
|
204
204
|
) {
|
|
205
205
|
const fs = yield* FileSystem.FileSystem;
|
|
206
206
|
const path = yield* Path.Path;
|
|
207
|
-
yield* Effect.
|
|
208
|
-
|
|
207
|
+
yield* Effect.forEach(
|
|
208
|
+
extraFiles ?? [],
|
|
209
|
+
(extra) =>
|
|
209
210
|
Effect.gen(function* () {
|
|
210
211
|
const source = resolveExtraSource(extra.source, path);
|
|
211
212
|
const destName = extraFileDestination(extra.dest);
|
|
@@ -220,8 +221,9 @@ export const copyExtraFiles = Effect.fn(function* (
|
|
|
220
221
|
const stat = yield* fs.stat(source);
|
|
221
222
|
if (stat.type === "Directory") {
|
|
222
223
|
const names = yield* fs.readDirectory(source);
|
|
223
|
-
yield* Effect.
|
|
224
|
-
names
|
|
224
|
+
yield* Effect.forEach(
|
|
225
|
+
names,
|
|
226
|
+
(name) => copyTree(path.join(source, name), path.join(contextDir, name)),
|
|
225
227
|
{ concurrency: ioConcurrency },
|
|
226
228
|
);
|
|
227
229
|
} else {
|
|
@@ -236,7 +238,6 @@ export const copyExtraFiles = Effect.fn(function* (
|
|
|
236
238
|
yield* fs.makeDirectory(path.dirname(dest), { recursive: true });
|
|
237
239
|
yield* copyTree(source, dest);
|
|
238
240
|
}),
|
|
239
|
-
),
|
|
240
241
|
{ concurrency: ioConcurrency },
|
|
241
242
|
);
|
|
242
243
|
});
|
package/src/Util/interactive.ts
CHANGED
|
@@ -5,7 +5,7 @@ import * as Effect from "effect/Effect";
|
|
|
5
5
|
* coding agent, CI runner, test runner, or anything else that won't render an
|
|
6
6
|
* interactive TUI / prompt well.
|
|
7
7
|
*
|
|
8
|
-
* This is the process-level source of truth used by
|
|
8
|
+
* This is the process-level source of truth used by terminal capability
|
|
9
9
|
* detection, auth configuration guards, and spawned-command stdin policy.
|
|
10
10
|
*
|
|
11
11
|
* Kept in `Util` (rather than `Cli`) so `Auth` can depend on it without
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import { initialCwd } from "../Util/Node.ts";
|
|
3
|
+
|
|
4
|
+
export interface AstroOutputProps {
|
|
5
|
+
/** Project root, relative to the initial working directory. */
|
|
6
|
+
readonly rootDir?: string | undefined;
|
|
7
|
+
/** Alternate astro config file, relative to {@link rootDir}. */
|
|
8
|
+
readonly config?: string | undefined;
|
|
9
|
+
/** The composite's `astro.output` prop. */
|
|
10
|
+
readonly output?: "server" | "static" | undefined;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the Astro `output` a website composite deploys: the
|
|
15
|
+
* `astro.output` prop, else the `output` declared in the project's
|
|
16
|
+
* `astro.config.*`, else `"server"`. Composites decide at plan time whether
|
|
17
|
+
* a site is assets-only, so the config file is read here rather than left
|
|
18
|
+
* to the build.
|
|
19
|
+
*
|
|
20
|
+
* `@alchemy.run/frontend-frameworks` is an optional peer dependency, so it
|
|
21
|
+
* is imported lazily. When it is missing or the config cannot be loaded the
|
|
22
|
+
* site falls back to `"server"` (the build reports the real error).
|
|
23
|
+
*/
|
|
24
|
+
export const resolveAstroOutput = Effect.fn("Website.resolveAstroOutput")(function* (
|
|
25
|
+
props: AstroOutputProps,
|
|
26
|
+
) {
|
|
27
|
+
if (props.output !== undefined) return props.output;
|
|
28
|
+
const declared = yield* Effect.tryPromise(
|
|
29
|
+
() => import("@alchemy.run/frontend-frameworks/astro/config"),
|
|
30
|
+
).pipe(
|
|
31
|
+
Effect.flatMap((astro) =>
|
|
32
|
+
astro.readConfigOutput({ cwd: initialCwd, rootDir: props.rootDir, config: props.config }),
|
|
33
|
+
),
|
|
34
|
+
Effect.catch((error) =>
|
|
35
|
+
Effect.logWarning(
|
|
36
|
+
`Could not read \`output\` from the Astro config in "${props.rootDir ?? "."}"; deploying with "server"`,
|
|
37
|
+
error,
|
|
38
|
+
).pipe(Effect.as(undefined)),
|
|
39
|
+
),
|
|
40
|
+
);
|
|
41
|
+
return declared ?? "server";
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export interface AstroSettings {
|
|
45
|
+
/** The resolved `output` (see {@link resolveAstroOutput}). */
|
|
46
|
+
readonly output: "server" | "static";
|
|
47
|
+
/**
|
|
48
|
+
* Whether the Astro config routes caching through the Cloudflare cache
|
|
49
|
+
* provider (`cacheCloudflare()`), so the Worker needs Workers Cache on.
|
|
50
|
+
*/
|
|
51
|
+
readonly workerCache: boolean;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Resolves the Astro settings a Cloudflare composite deploys from one read
|
|
56
|
+
* of the project's `astro.config.*`: the `output` (as
|
|
57
|
+
* {@link resolveAstroOutput}) and whether the config uses the Cloudflare
|
|
58
|
+
* cache provider. When the config cannot be loaded the site falls back to
|
|
59
|
+
* `"server"` without Workers Cache (the build reports the real error).
|
|
60
|
+
*/
|
|
61
|
+
export const resolveAstroSettings = Effect.fn("Website.resolveAstroSettings")(function* (
|
|
62
|
+
props: AstroOutputProps,
|
|
63
|
+
) {
|
|
64
|
+
const declared = yield* Effect.tryPromise(
|
|
65
|
+
() => import("@alchemy.run/frontend-frameworks/astro/config"),
|
|
66
|
+
).pipe(
|
|
67
|
+
Effect.flatMap((astro) =>
|
|
68
|
+
astro.readConfigSettings({ cwd: initialCwd, rootDir: props.rootDir, config: props.config }),
|
|
69
|
+
),
|
|
70
|
+
Effect.catch((error) =>
|
|
71
|
+
Effect.logWarning(
|
|
72
|
+
`Could not read the Astro config in "${props.rootDir ?? "."}"; deploying with ${
|
|
73
|
+
props.output === undefined ? '"server"' : `"${props.output}"`
|
|
74
|
+
} and without Workers Cache`,
|
|
75
|
+
error,
|
|
76
|
+
).pipe(Effect.as(undefined)),
|
|
77
|
+
),
|
|
78
|
+
);
|
|
79
|
+
return {
|
|
80
|
+
output: props.output ?? declared?.output ?? "server",
|
|
81
|
+
workerCache: declared?.workerCache ?? false,
|
|
82
|
+
} satisfies AstroSettings;
|
|
83
|
+
});
|
package/src/Workflows.ts
CHANGED
|
@@ -10,6 +10,16 @@ import type { RuntimeContext } from "./RuntimeContext.ts";
|
|
|
10
10
|
|
|
11
11
|
declare const ImplementedTypeId: unique symbol;
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Annotates a workflow with the name an engine stores its runs under, when
|
|
15
|
+
* that differs from the workflow's own name. An engine that names storage
|
|
16
|
+
* after the workflow, like Cloudflare's Durable Object engine with one class
|
|
17
|
+
* per workflow, uses it as given.
|
|
18
|
+
*/
|
|
19
|
+
export class StorageName extends Context.Service<StorageName, string>()(
|
|
20
|
+
"alchemy/Workflows/StorageName",
|
|
21
|
+
) {}
|
|
22
|
+
|
|
13
23
|
/**
|
|
14
24
|
* Marks a workflow as runnable here: something in the context implements it.
|
|
15
25
|
* `Workflows.layer` provides it for the workflow it implements, and a remote
|
|
@@ -134,6 +144,7 @@ export function layer<
|
|
|
134
144
|
): Layer.Layer<
|
|
135
145
|
Implemented<Name>,
|
|
136
146
|
InitE,
|
|
147
|
+
// oxlint-disable-next-line typescript/no-redundant-type-constituents -- generic in R; only looks like `never` to the linter
|
|
137
148
|
InitR | Exclude<Requirements<ReturnType<typeof workflow.toLayer<R>>>, RuntimeContext>
|
|
138
149
|
>;
|
|
139
150
|
export function layer(
|
package/src/index.ts
CHANGED
|
@@ -40,6 +40,7 @@ export * as Telemetry from "./Telemetry.ts";
|
|
|
40
40
|
// downstream `.d.ts` emissions (fixes TS2883 in user files).
|
|
41
41
|
export { AuthProviders } from "./Auth/AuthProvider.ts";
|
|
42
42
|
export { Cli } from "./Report.ts";
|
|
43
|
+
export * as Events from "./Events.ts";
|
|
43
44
|
export * as Report from "./Report.ts";
|
|
44
45
|
export type { Dependencies } from "./Dependencies.ts";
|
|
45
46
|
export type { Named } from "./Named.ts";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { PlanStatusSession } from "../Report.ts";
|
|
2
|
-
import { type ProgressReporter } from "../Report.ts";
|
|
3
|
-
export { Progress, type ActionPlanned, type ApplyEvent, type NukeEvent, type NukeScanStarted, type NukeProviderScanStarted, type NukePassStarted, type NukeProviderScanned, type NukeResourceDeleted, type NukeResourceFailed, type PlanEvent, type PlanNodeEvent, type PlanPhaseChanged, type PlanningPhase, type ProgressEvent, type ProgressReporter, type ProviderConfigureCompleted, type ProviderConfigureStarted, type ProviderEvent, type ProviderRefreshCompleted, type ProviderRefreshStarted, type ResourceAnnotated, type ResourceDiffStarted, type ResourcePlanned, type ResourceStatusChanged, type StateBootstrapCompleted, type StateBootstrapStarted, type StateEvent, } from "../Report.ts";
|
|
4
|
-
/**
|
|
5
|
-
* Decorate a reporter so a {@link ProgressEvent} with a span-event shape is
|
|
6
|
-
* also recorded on the currently active span before it reaches the
|
|
7
|
-
* renderer. Emission happens inside the engine's instrumented fibers, so
|
|
8
|
-
* apply events land on `apply.resource` / `provider.<op>` spans — giving
|
|
9
|
-
* traces a within-span timeline of status transitions. A no-op when no
|
|
10
|
-
* span is active (tracing disabled), and independent of whether a renderer
|
|
11
|
-
* is attached, so `--yes` and CI runs still produce the events.
|
|
12
|
-
*/
|
|
13
|
-
export declare const withSpanEvents: (report: ProgressReporter) => ProgressReporter;
|
|
14
|
-
/** Adapt the ambient reporter to the engine's apply-session contract. */
|
|
15
|
-
export declare const applySession: (report: ProgressReporter) => PlanStatusSession;
|
|
16
|
-
//# sourceMappingURL=Progress.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.d.ts","sourceRoot":"","sources":["../../src/Alchemist/Progress.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAMrD,OAAO,EACL,QAAQ,EACR,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,UAAU,GAChB,MAAM,cAAc,CAAC;AAmGtB;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,WAChB,gBAAgB,KAAG,gBAa3B,CAAC;AAEJ,yEAAyE;AACzE,eAAO,MAAM,YAAY,WAAY,gBAAgB,KAAG,iBAGtD,CAAC"}
|