export type RepairStatus = 'ok' | 'warn' | 'fail'; export interface RepairCheck { id: string; label: string; status: RepairStatus; detail: string; } export interface RepairActionEntry { id: string; detail: string; } export interface IsolationRepairReport { /** True when a run started from this machine could now build its tree. */ ok: boolean; /** UPPER_SNAKE reason when `ok` is false. */ reason?: string; /** What the human can do about it (never a stack trace). */ hint?: string; checks: RepairCheck[]; actions: RepairActionEntry[]; /** A real mirror was built and left for the next run to adopt. */ mirrorReady: boolean; mirrorPath?: string; repos?: number; /** Bytes reclaimed by `deep`. */ freedBytes?: number; durationMs: number; } export interface RepairIsolationOptions { /** The project's linked folder, as the bridge has it configured. */ folder: string | null | undefined; projectId?: string | null; /** The agent whose run needs the tree (its lock is the one we may clear). */ agentId: string; /** Task-scoped runs only: the tree is `taskrun-`. */ taskId?: string | null; /** Delete dead trees instead of only quarantining them (human opt-in). */ deep?: boolean; /** Build the real mirror as proof (default true). */ buildMirror?: boolean; /** Project git base branch setting, when known. */ configuredBase?: string | null; /** * Project name + task title, so the mirror this repair builds is cut from the * TASK'S OWN BRANCH (2026-11-18). Without them the proof-tree was based on * whatever the linked folder had checked out, and the next run adopted a tree * it could not `git checkout` its branch over — the origin of the * "committed on `HEAD`" failure. */ projectSlug?: string | null; taskTitle?: string | null; } /** * The repair itself. Idempotent: running it twice is a no-op the second time * (every action is a conditional cleanup), which matters because a human will * press the button more than once. */ export declare function repairIsolation(opts: RepairIsolationOptions): Promise;