/**
 * Worktree recovery operations for @cleocode/worktree.
 *
 * T10456 — Auto-adopt partial worktrees:
 *   When a spawn hits ETIMEDOUT and leaves a worktree in a partial state,
 *   the recovery function:
 *     1. Detects partial state (git status, node_modules, index.lock)
 *     2. Runs `pnpm install` to restore node_modules
 *     3. Unlocks the git index if a stale index.lock is present
 *     4. Resumes from the last checkpoint (if any)
 *
 * @task T10456
 * @epic T10435
 */
/**
 * Signals that indicate a worktree may be in a partial / wedged state.
 *
 * @task T10456
 */
export interface PartialWorktreeSignals {
    /** True when `git status --porcelain` returns non-empty output. */
    hasUncommittedChanges: boolean;
    /** True when `node_modules` is missing from the worktree root. */
    nodeModulesMissing: boolean;
    /** True when `.git/index.lock` exists (wedged git index). */
    indexLockPresent: boolean;
    /** True when the worktree directory itself exists but looks incomplete. */
    worktreeExists: boolean;
}
/**
 * Result of a recovery attempt.
 *
 * @task T10456
 */
export interface RecoveryResult {
    /** Whether the recovery succeeded overall. */
    success: boolean;
    /** What actions were taken. */
    actions: string[];
    /** Error message if recovery failed. */
    error?: string;
    /** The partial-state signals that were detected before recovery. */
    signals: PartialWorktreeSignals;
}
/**
 * Detect whether a worktree is in a partial state.
 *
 * Checks for:
 *   1. Uncommitted changes (`git status --porcelain`)
 *   2. Missing `node_modules`
 *   3. Stale `.git/index.lock`
 *
 * @param worktreePath - Absolute path to the worktree directory.
 * @returns Detection signals.
 * @task T10456
 */
export declare function detectPartialWorktree(worktreePath: string): PartialWorktreeSignals;
/**
 * Auto-adopt a partial worktree by running recovery steps.
 *
 * Steps:
 *   1. Detect partial state via {@link detectPartialWorktree}.
 *   2. If `node_modules` is missing, run `pnpm install` (bounded by 120s).
 *   3. If `.git/index.lock` is present, remove it and run `git worktree unlock`.
 *   4. If a checkpoint file (`.cleo/checkpoint.json`) exists, read it and
 *      return the checkpoint state so the caller can resume.
 *
 * All steps are best-effort: a failure in one step does not abort the others.
 *
 * @param projectRoot  - Absolute path to the project root.
 * @param worktreePath - Absolute path to the partial worktree.
 * @param taskId       - Task ID associated with the worktree.
 * @returns Recovery result with actions taken and any error.
 * @task T10456
 */
export declare function recoverPartialWorktree(projectRoot: string, worktreePath: string, taskId: string): RecoveryResult;
//# sourceMappingURL=recovery.d.ts.map