import * as Config from "effect/Config"; import * as Effect from "effect/Effect"; import * as Layer from "effect/Layer"; import * as Option from "effect/Option"; import * as Path from "effect/Path"; import * as Argument from "effect/unstable/cli/Argument"; import * as Flag from "effect/unstable/cli/Flag"; import { type AuthProvider, AuthProviders } from "../../Auth/AuthProvider.ts"; import { type AlchemyProfileProviders } from "../../Auth/Profile.ts"; import * as Stack from "../../Stack.ts"; import { Stage } from "../../Stage.ts"; export declare const USER: Config.Config; export declare const STAGE: Effect.Effect; /** * Catches user cancellations (Ctrl+C inside a prompt, surfaced as * {@link PromptCancelled} or wrapped in an {@link AuthError}) and exits * the CLI cleanly with a friendly message instead of dumping a stack * trace. */ export declare const handleCancellation: (self: Effect.Effect) => Effect.Effect; export declare const stage: Flag.Flag; export declare const envFile: Flag.Flag>; export declare const dryRun: Flag.Flag; export declare const yes: Flag.Flag; export declare const force: Flag.Flag; export declare const script: Argument.Argument; export declare const profile: Flag.Flag; export declare const resourceFilter: Flag.Flag; export declare const TAIL_COLORS: string[]; export declare const TAIL_RESET = "\u001B[0m"; export declare const formatLocalTimestamp: (date: Date) => string; export declare const parseResourceFilter: (filter: string | undefined) => ReadonlySet | undefined; export declare const parseSince: (value: string) => Date; /** * Wraps a CLI command handler with a top-level OpenTelemetry span * (`cli.`) and bumps the `alchemy.cli.invocations` counter. * * `attrs` runs against the parsed command args and contributes * additional attributes to the span (e.g. stage, profile, dry-run flag). * * Usage: * ```ts * Command.make( * "deploy", * { ...flags }, * instrumentCommand("deploy", (a) => ({ * "alchemy.stage": a.stage, * "alchemy.profile": a.profile, * }))(execStack), * ); * ``` */ export declare const instrumentCommand: (command: string, attrs?: (args: AttrsArgs) => Record) => (handler: (args: Args) => Effect.Effect) => ((args: Args) => Effect.Effect); /** * Render a profile's stored credential entries the same way across * `alchemy login` and `alchemy profile show`: one `── Provider ──` * header per entry, then either the provider's own `prettyPrint` block * (preferred) or a JSON-style fallback when the provider isn't * registered in the supplied {@link AuthProviders} registry. */ export declare const printProfile: (profile: string, stored: AlchemyProfileProviders, registry: { [providerName: string]: AuthProvider; }) => Effect.Effect; export declare const importStack: (main: string) => Effect.Effect, unknown, import("../../AlchemyContext.ts").AlchemyContext | import("../../Auth/Profile.ts").AlchemyProfile | import("../../Artifacts.ts").ArtifactStore | AuthProviders | import("effect/unstable/process/ChildProcessSpawner").ChildProcessSpawner | import("../Cli.ts").Cli | import("../../Auth/Credentials.ts").CredentialsStore | import("effect/FileSystem").FileSystem | import("effect/unstable/http/HttpClient").HttpClient | Path.Path | import("effect/Scope").Scope | Stage> & { stackName: string; stage: string; providers: Layer.Layer; state: Layer.Layer; }, never, Path.Path>; export interface BuildStackProvidersOptions { /** Stack entrypoint to import (e.g. `"alchemy.run.ts"`). */ main: string; envFile: Option.Option; profile: string; /** * Registry to populate. Pass a pre-seeded registry (e.g. one that already * has built-in providers) to layer the stack's providers on top of it, * overriding by name. Defaults to a fresh empty registry. */ registry?: AuthProviders["Service"]; /** * Logger layer used during the build. Defaults to the file logger * (`out`). `alchemy unsafe nuke` overrides this to log to the console in * debug mode. */ logger?: Layer.Layer; /** * Extra layer merged into the placeholder scaffold — e.g. * `Layer.succeed(MinimumLogLevel, ...)`, which sets a fiber-ref default * and so contributes no context service (`Layer`). */ extra?: Layer.Layer; } /** * Import a stack entrypoint and build its `providers()` (+ `state()`) layer * out of band against placeholder {@link Stack.Stack}/{@link Stage} services, * so its `AuthProviderLayer` registrations land in an {@link AuthProviders} * registry and the built context holds every resource provider plus the * cloud-environment services their operations need. * * Shared by `alchemy login`, `alchemy profile show`, and `alchemy unsafe * nuke`. The caller decides what to do with the result — use `authProviders` * (login / profile show) or `context` (nuke) — and whether a missing/invalid * entrypoint is fatal (login / nuke let it propagate) or best-effort * (profile show wraps the call in `Effect.catchCause`). */ export declare const buildStackProviders: (options: BuildStackProvidersOptions) => Effect.Effect<{ authProviders: { [providerName: string]: AuthProvider; }; context: import("effect/Context").Context; stackEffect: Effect.Effect, unknown, import("../../AlchemyContext.ts").AlchemyContext | import("../../Auth/Profile.ts").AlchemyProfile | import("../../Artifacts.ts").ArtifactStore | AuthProviders | import("effect/unstable/process/ChildProcessSpawner").ChildProcessSpawner | import("../Cli.ts").Cli | import("../../Auth/Credentials.ts").CredentialsStore | import("effect/FileSystem").FileSystem | import("effect/unstable/http/HttpClient").HttpClient | Path.Path | import("effect/Scope").Scope | Stage> & { stackName: string; stage: string; providers: Layer.Layer; state: Layer.Layer; }; }, import("effect/PlatformError").PlatformError, import("../../AlchemyContext.ts").AlchemyContext | import("effect/FileSystem").FileSystem | Path.Path | import("effect/Scope").Scope>; /** * The auth providers Alchemy ships with. Used as the baseline registry so * `alchemy login` works from any folder (no `alchemy.run.ts` required) and * `alchemy profile show` can pretty-print any provider a profile mentions, * even one the current stack doesn't wire up. */ export declare const builtinAuth: Layer.Layer; /** * Build {@link builtinAuth} against `registry` so every built-in auth * provider registers itself, without importing any stack entrypoint. */ export declare const buildBuiltinAuthProviders: (options: { envFile: Option.Option; profile: string; /** Registry to populate. Defaults to a fresh empty registry. */ registry?: AuthProviders["Service"]; }) => Effect.Effect<{ [providerName: string]: AuthProvider; }, import("effect/PlatformError").PlatformError, import("../../AlchemyContext.ts").AlchemyContext | import("../../Auth/Profile.ts").AlchemyProfile | import("effect/unstable/process/ChildProcessSpawner").ChildProcessSpawner | import("../../Auth/Credentials.ts").CredentialsStore | import("effect/FileSystem").FileSystem | Path.Path | import("effect/Scope").Scope>; //# sourceMappingURL=_shared.d.ts.map