/**
 * Boot-time worktree sweeper.
 *
 * Reconciles on-disk git worktrees against persisted goal/session/staff
 * records before the worktree pool fills. This catches:
 *
 *   - Pool worktrees that were left behind after a crash and aren't yet
 *     in the in-memory pool (logged for the pool to reclaim itself —
 *     `WorktreePool.reclaimOrphaned` already handles directory-based
 *     reclaim). The sweeper just counts these so they're visible in logs.
 *   - Active session/goal/staff branches with intact worktrees → keep.
 *   - Worktrees on a branch that no live record claims → cleanup.
 *   - A live record whose worktree path differs from git's tracking
 *     (rename-mid-shutdown) → repair via `git worktree repair`.
 *
 * The sweeper runs once at startup, before pool fill, so renamed-but-
 * orphaned worktrees from a crashed prior instance are reclaimed
 * cleanly. See docs/design/multi-repo-components.md §5.5 (historical) and
 * docs/design/remove-session-worktree-rename.md §13 (current post-upgrade
 * sweeper patterns: live `session-<id8>`, pool `pool-_pool-<id>`, legacy
 * `session-<slug>-<id8>` / `session-new-session-<id8>` orphan handling).
 */
export interface SweepProject {
    id: string;
    rootPath: string;
    /** Multi-repo: distinct repo subfolder names. Single-repo omits or supplies ["."]. */
    repos?: string[];
}
export interface SweepRecord {
    id: string;
    branch?: string;
    worktreePath?: string;
    archived?: boolean;
    /** Per-repo worktree paths (multi-repo). Each is treated as separately owned. */
    repoWorktrees?: Record<string, string>;
}
export interface SweepResult {
    reclaimed: number;
    cleaned: number;
    repaired: number;
}
interface ParsedWorktree {
    path: string;
    branch?: string;
}
/**
 * Sweep orphaned worktrees across all projects.
 *
 * Idempotent and safe to run on every boot. Returns counts for logging;
 * never throws.
 */
export declare function sweepOrphanedWorktrees(opts: {
    projects: SweepProject[];
    goals: SweepRecord[];
    sessions: SweepRecord[];
    staff: SweepRecord[];
}): Promise<SweepResult>;
/** Helper for tests that want to run the sweeper against a single project's stdout. */
export declare function classifyWorktrees(opts: {
    porcelainStdout: string;
    repoPath: string;
    goals: SweepRecord[];
    sessions: SweepRecord[];
    staff: SweepRecord[];
}): {
    pool: ParsedWorktree[];
    active: ParsedWorktree[];
    orphan: ParsedWorktree[];
    repair: ParsedWorktree[];
};
export {};
//# sourceMappingURL=worktree-sweeper.d.ts.map