import { type WorktreeCleanupResult } from "./worktree.js";
export type CleanupResult = {
    teamDir: string;
    worktreeResult: WorktreeCleanupResult;
    warnings: string[];
};
export declare function assertTeamDirWithinTeamsRoot(teamsRootDir: string, teamDir: string): {
    teamsRootAbs: string;
    teamDirAbs: string;
};
/**
 * Recursively delete the given teamDir, including proper git worktree + branch removal.
 *
 * Steps:
 * 1. Remove git worktrees and branches via `cleanupWorktrees`
 * 2. Delete the team directory recursively
 *
 * Idempotent — safe to call multiple times.
 */
export declare function cleanupTeamDir(teamsRootDir: string, teamDir: string, opts?: {
    teamId?: string;
    repoCwd?: string;
}): Promise<CleanupResult>;
/**
 * Garbage-collect stale team directories that have no active workers and are older
 * than the given threshold.
 *
 * A team directory is considered stale when:
 * - Its config.json `createdAt` (or directory mtime) is older than `maxAgeMs`
 * - It has no in_progress tasks
 * - It has no online members
 *
 * Returns a summary of what was cleaned up.
 */
export declare function gcStaleTeamDirs(opts: {
    teamsRootDir: string;
    maxAgeMs: number;
    repoCwd?: string;
    dryRun?: boolean;
    /** Team IDs to skip (e.g. the current session's team). */
    excludeTeamIds?: ReadonlySet<string>;
}): Promise<{
    scanned: number;
    removed: string[];
    skipped: Array<{
        teamId: string;
        reason: string;
    }>;
    warnings: string[];
}>;
