export type WorktreeCleanupResult = {
    removedWorktrees: string[];
    removedBranches: string[];
    warnings: string[];
};
export type WorktreeResult = {
    cwd: string;
    warnings: string[];
    mode: "worktree" | "shared";
};
/**
 * Ensure a per-teammate git worktree exists, returning the cwd to use for that teammate.
 *
 * Behavior:
 * - If not in a git repo, falls back to shared cwd with a warning.
 * - If git repo is dirty, still creates a worktree but warns that uncommitted changes are not included.
 */
export declare function ensureWorktreeCwd(opts: {
    leaderCwd: string;
    teamDir: string;
    teamId: string;
    agentName: string;
}): Promise<WorktreeResult>;
/**
 * Remove all git worktrees under `<teamDir>/worktrees/` and their associated branches.
 *
 * Steps for each worktree:
 * 1. `git worktree remove --force <path>` (removes the worktree checkout)
 * 2. `git branch -D <branch>` (removes the local branch)
 * 3. Falls back to filesystem removal if git commands fail
 *
 * Also runs `git worktree prune` to clean up stale worktree bookkeeping.
 */
export declare function cleanupWorktrees(opts: {
    teamDir: string;
    teamId: string;
    /** A directory known to be in the git repo (e.g. leaderCwd). */
    repoCwd?: string;
}): Promise<WorktreeCleanupResult>;
