export type DeployProvider = 'vercel' | 'railway' | 'cloudflare' | 'fly';
export interface PreflightIssue {
    severity: 'error' | 'warning';
    message: string;
    /** Optional actionable hint to fix the issue. */
    hint?: string;
}
export interface PreflightResult {
    ok: boolean;
    issues: PreflightIssue[];
}
export interface DeployOptions {
    /** Preview deploy (ephemeral URL). False = production. */
    preview?: boolean;
    /** Override target environment. Provider-specific (vercel project, railway service). */
    target?: string;
    /** Working dir for the CLI spawn. Defaults to cwd. */
    cwd?: string;
    /** Wall-clock cap (default 10min — deploys can be slow). */
    timeoutMs?: number;
}
export interface DeployResult {
    ok: boolean;
    provider: DeployProvider;
    url?: string;
    deploymentId?: string;
    durationMs: number;
    exitCode?: number;
    error?: string;
}
export interface RollbackOptions {
    /** Specific deployment id to roll back TO. Defaults to "last good". */
    to?: string;
    cwd?: string;
}
/**
 * v1.19.0 — Promote an existing deployment to a target environment.
 *
 * Hybrid semantics: each adapter picks its native model.
 *   - Vercel/Cloudflare → alias swap (atomic, zero-downtime). Requires a
 *     preview deployment URL or id to redirect production traffic to.
 *   - Railway/Fly → redeploy with prod env (no alias concept). The `from`
 *     hint is ignored; the adapter triggers a fresh deploy with the
 *     target env vars.
 */
export interface PromoteOptions {
    /** Target environment (e.g. 'production', 'staging'). Required. */
    to: string;
    /**
     * Source deployment URL/id (alias-swap providers only). When omitted,
     * the adapter resolves "the latest preview" if its CLI supports it,
     * otherwise errors.
     */
    from?: string;
    /** Target domain/app for the alias (alias-swap providers). */
    domain?: string;
    cwd?: string;
    timeoutMs?: number;
}
export interface DeployAdapter {
    readonly name: DeployProvider;
    /** Whether the provider CLI is installed and reachable on PATH. */
    detect(): Promise<boolean>;
    /**
     * Pre-deploy checks. Looks at required env vars, project linkage,
     * working tree state. Returns issues without throwing.
     */
    preflight(opts: DeployOptions): Promise<PreflightResult>;
    /** Trigger a deploy. Captures URL + deployment id when possible. */
    deploy(opts: DeployOptions): Promise<DeployResult>;
    /** Roll back to a previous deployment. */
    rollback(opts: RollbackOptions): Promise<DeployResult>;
    /**
     * v1.19.0 — Promote an existing deployment to a target environment.
     * Strategy is provider-specific (alias swap vs redeploy).
     */
    promote(opts: PromoteOptions): Promise<DeployResult>;
}
export declare const DeployRegistry: {
    register(a: DeployAdapter): void;
    get(name: DeployProvider): DeployAdapter | null;
    list(): DeployProvider[];
    /** Auto-detect the right provider based on which CLIs are installed + project markers. */
    autoDetect(cwd?: string): Promise<DeployProvider | null>;
    /** Exposed for tests. */
    _resetForTests(): void;
};
