import { type Result } from "@fjall/generator"; import type { OrgConfig } from "../types/config/orgConfig.js"; /** * Why the deployment environment could not be resolved. Callers surface * `message` verbatim; the discriminant exists so a caller can tell a * transport failure (`no-org-config` — retry may help) from a configuration * failure (the other three — retrying will not). */ export type DeployEnvironmentFailureKind = "no-org-config" | "no-accounts" | "account-not-in-config" | "account-has-no-stage"; export declare class DeployEnvironmentError extends Error { readonly kind: DeployEnvironmentFailureKind; constructor(kind: DeployEnvironmentFailureKind, message: string); } /** * Resolve the environment a deploy is targeting, from the account it is * targeting and the org config that describes it. * * This is the PRE-SYNTH half of a resolution that * `components/infrastructure/lib/utils/env.ts` also performs DURING synth. * Both route through the same `resolveSynthEnvironment` so they cannot * disagree — but the synth-time half degrades to a warn-and-DESTROY sentinel * when its inputs are missing, which is the wrong default for a real deploy * against a real account. Resolving here lets the deploy refuse instead, and * lets the caller pass the answer down explicitly so no inference runs at all. * * Deliberately a `Result`, not a throw: every caller is already inside a * `Result`-returning orchestrator. */ export declare function resolveDeployEnvironment(params: { orgConfig?: OrgConfig; accountId?: string; accountName?: string; }): Result;