/**
 * Wait phase
 * ----------
 *
 * Polls the server until the freshly-uploaded deployment finishes warming
 * up, streaming build/run logs to the user's terminal while it waits.
 *
 * Two modes:
 *   - With a `streamId` from the Provision phase we open a long-poll log
 *     stream and tee it into a TUI progress logger that keeps the last
 *     few lines visible. Status polling runs in the same callback so we
 *     can abort the log stream as soon as the deployment terminates.
 *   - Without a streamId (older or local backends that don't expose one)
 *     we fall back to a plain spinner and just poll status.
 *
 * The phase is responsible for:
 *   - Reporting cancellation on Ctrl+C via `DeploymentCancelledError`.
 *   - Writing a tail of the captured log to disk on failure so the user
 *     has something to inspect before re-running.
 *   - Surfacing failure with a banner that links to the dashboard.
 *
 * Successful waits return; the caller renders the success banner and the
 * deployment URL section because that part is interleaved with the JSON
 * response shape and is easier to keep in the deploy command itself.
 */
import { type Logger } from '@agentuity/core';
import { type Deployment } from '@agentuity/server';
import type { APIClient } from '../../../api.ts';
import type { BuildReportCollector } from '../../../build-report.ts';
import type { Config } from '../../../types.ts';
/**
 * Internal cancellation marker thrown by the wait loop when the user
 * hits Ctrl+C. Re-exported so the deploy command can identify it in
 * outer try/catches without keeping its own copy.
 */
export declare const DeploymentCancelledError: {
    new (args?: {
        cause?: unknown;
    } | undefined): import("@agentuity/adapter").RichError & {
        readonly _tag: "DeploymentCancelled";
    } & Readonly<Record<string, never>>;
    readonly defaultMessage?: string;
} & (<Shape extends {
    [x: string]: any;
} = Record<string, never>>() => {
    new (args?: (Shape extends Record<string, never> ? {
        cause?: unknown;
    } : Shape & {
        cause?: unknown;
    }) | undefined): import("@agentuity/adapter").RichError & {
        readonly _tag: "DeploymentCancelled";
    } & Readonly<Shape>;
    readonly defaultMessage?: string;
});
export interface WaitParams {
    apiClient: APIClient;
    deployment: Deployment;
    complete: {
        streamId?: string;
    } | undefined;
    collector: BuildReportCollector;
    hasReportFile: boolean;
    logger: Logger;
    config: Config | null | undefined;
    region: string;
    sdkKey: string;
    /**
     * Aborted on Ctrl+C; both the log stream and the status poll observe
     * this signal so cancellation is responsive even mid-fetch.
     */
    abortSignal: AbortSignal;
    /**
     * Captured log lines. Mutated in-place because the deploy command
     * also writes them to its result file and JSON response.
     */
    logs: string[];
}
/**
 * Run the wait loop. On success: returns once the deployment reports
 * `state === 'completed'`. On failure: writes diagnostics, renders the
 * failure banner via `tui.fatal`, and exits the process.
 */
export declare function runWaitForDeployment(params: WaitParams): Promise<void>;
//# sourceMappingURL=wait.d.ts.map