import type { Prompter } from "#setup/prompter.js";
import { detectDeployment } from "#setup/project-resolution.js";
import type { RegistrySetupCompletion, RegistrySetupFact } from "#setup/registry-setup-protocol.js";
import { runDeployFlow } from "./deploy.js";
export interface RegistrySessionDeps {
    detectDeployment: typeof detectDeployment;
    runDeployFlow: typeof runDeployFlow;
}
export interface RegistrySessionItemResult {
    title: string;
    facts: readonly RegistrySetupFact[];
    output: readonly string[];
}
/** An item the user chose to skip after its installation could not complete. */
export interface RegistrySessionItemFailure {
    title: string;
    /** User-facing installation error, including any actionable follow-up lines. */
    message: string;
}
export type RegistrySessionOutcome = ({
    kind: "installed";
} & RegistrySessionItemResult) | ({
    kind: "failed";
} & RegistrySessionItemFailure) | {
    kind: "cancelled";
    title: string;
};
export interface RegistrySessionResult {
    items: readonly RegistrySessionItemResult[];
    /** Installation failures retained when a user skips an item. */
    failures: readonly RegistrySessionItemFailure[];
    /** Every item outcome in installation order. */
    outcomes?: readonly RegistrySessionOutcome[];
    /** Setup stopped outside an individual item after preserving settled results. */
    cancelled?: true;
    deployed?: "production";
}
export interface RegistrySession {
    add(title: string, output: readonly string[], setup?: RegistrySetupCompletion): void;
    addFailure(title: string, message: string): void;
    addCancellation(title: string): void;
    result(deployed?: "production"): RegistrySessionResult;
    continueAfterInstall(input: {
        appRoot: string;
        prompter: Prompter;
        signal?: AbortSignal;
    }): Promise<RegistrySessionResult>;
}
/** Owns the accumulated output and deployment decision for one `/add` session. */
export declare function createRegistrySession(deps: RegistrySessionDeps): RegistrySession;
