import { type Result } from "@fjall/generator"; import { BaseServiceError } from "../types/errors/ServiceError.js"; import type { CloudFormationService } from "../services/infrastructure/CloudFormationService.js"; /** * A deploy-path pre-flight found one or more target stacks mid-operation or * otherwise unavailable. Carries the offending stacks so surfaces can render * them; the message is surface-neutral (no CLI flags, no CLI commands) and * pre-built from static literals + stack names/statuses — nothing to mask. */ export declare class StackUnavailableError extends BaseServiceError { readonly stacks: ReadonlyArray<{ name: string; status: string; }>; constructor(message: string, stacks: ReadonlyArray<{ name: string; status: string; }>); } /** * A stack the guards probe. `region` is set only when the stack lives * somewhere other than the provider's own region — the `UsEast1*` * application stacks — so a bare name probes the provider's region. */ export interface StackProbeTarget { readonly name: string; readonly region?: string; } /** * Pre-flight check: query CloudFormation for each stack and reject * if any are currently in an IN_PROGRESS or otherwise unsafe state. * * Uses the canonical stackStatusMap to determine whether a status * is blocking — specifically `safeToRedeploy === "No"`. */ export declare function checkActiveDeployments(stackNames: ReadonlyArray, cfnService: CloudFormationService, abortSignal?: AbortSignal): Promise>; /** * Deploy-path blocking classification (P0.5). Deliberately stricter than the * destroy guard's `safeToRedeploy === "No"` check: * * - every `*_IN_PROGRESS` status blocks EXCEPT `REVIEW_IN_PROGRESS` (a * change-set awaiting execution holds no stack lock) * - `DELETE_FAILED` blocks (the map says "Maybe" for destroy's benefit, but a * deploy into a half-deleted stack only wedges it further) * - any status this build cannot classify blocks by DEFAULT — a new * CloudFormation status is more likely a new in-progress state than a new * terminal one, so fail closed rather than race it * * Known terminal states (complete, failed, rolled back) pass: CloudFormation * accepts an update there, and deployability is the deploy's own problem. */ export declare function isDeployPathBlockingStatus(status: string): boolean; /** * Deploy-path pre-flight (P0.5): reject the deploy BEFORE any image * build/push when a target stack is mid-operation or in an unclassifiable * state. Unlike `checkActiveDeployments` (the destroy guard) there is NO * `--force` bypass — deploying over an in-flight operation cannot be a * deliberate recovery action the way a forced destroy can. */ export declare function checkDeployPathStackAvailability(stackNames: ReadonlyArray, cfnService: CloudFormationService, abortSignal?: AbortSignal): Promise>;