import type { AgentId } from './types.js';
/** What the uninstall intends to do with one agent's config directory. */
export type ConfigAction = {
    agent: AgentId;
    realPath: string;
    kind: 'restore-backup';
    source: string;
} | {
    agent: AgentId;
    realPath: string;
    kind: 'restore-version-home';
    source: string;
} | {
    agent: AgentId;
    realPath: string;
    kind: 'remove-dangling';
} | {
    agent: AgentId;
    realPath: string;
    kind: 'leave-real';
} | {
    agent: AgentId;
    realPath: string;
    kind: 'leave-foreign';
} | {
    agent: AgentId;
    realPath: string;
    kind: 'absent';
};
/** A home-level file symlink (e.g. `~/.claude.json`) agents-cli owns. */
export interface HomeFileAction {
    realPath: string;
    /** Resolved symlink target whose contents are copied back to `realPath`. */
    source: string;
}
/** The full, read-only plan describing what an uninstall would change. */
export interface UninstallPlan {
    isInstalled: boolean;
    agentsDir: string;
    legacySymlink: string | null;
    configs: ConfigAction[];
    homeFiles: HomeFileAction[];
    launchers: string[];
    rcFiles: string[];
}
/** Structured result of an executed uninstall (for reporting). */
export interface UninstallResult {
    restoredConfigs: Array<{
        agent: AgentId;
        realPath: string;
    }>;
    removedDanglingConfigs: Array<{
        agent: AgentId;
        realPath: string;
    }>;
    restoredHomeFiles: string[];
    releasedLaunchers: string[];
    cleanedRcFiles: string[];
    agentsDir: {
        path: string;
        disposition: 'moved' | 'purged' | 'absent';
        movedTo?: string;
    };
    legacySymlinkRemoved: boolean;
    /** True when `--purge` was requested but downgraded to move-aside after errors. */
    purgeDowngraded: boolean;
    errors: string[];
}
/**
 * Build a read-only plan of everything a complete uninstall would change.
 * Performs no mutations; safe to run for `--dry-run` and to print for confirm.
 */
export declare function planUninstall(): UninstallPlan;
/**
 * Execute a plan built by {@link planUninstall}. Restores adopted config dirs
 * and home files, releases adopted launchers, strips shim PATH lines, then
 * disposes of `~/.agents` — moved aside to `~/.agents.removed-<ts>` (recoverable)
 * by default, or hard-deleted when `purge` is set. Config restore always runs
 * before disposal because the backups live inside `~/.agents`.
 */
export declare function executeUninstall(plan: UninstallPlan, opts: {
    purge?: boolean;
    timestamp: number;
}): UninstallResult;
