import type { ExecFileFn } from '../../worktree/worktree-sweep.js'; export declare const defaultExecFile: ExecFileFn; export interface RepoContext { repoRoot: string; afkWorktreesRoot: string; } export declare function resolveRepoContext(execFile: ExecFileFn, cwd: string): Promise; export declare function sanitizeSlug(name: string): string; export declare function resolveAnchorBaseRef(execFile: ExecFileFn, anchor: string): Promise; export interface CreateManagedWorktreeArgs { execFile: ExecFileFn; repoRoot: string; worktreePath: string; branch: string; baseRef: string; owner?: string; } export interface ManagedWorktreeInfo { path: string; branch: string; baseRef: string; baseSha: string; } export declare function createManagedWorktree(args: CreateManagedWorktreeArgs): Promise; export declare function isManagedWorktreeDirty(execFile: ExecFileFn, worktreePath: string): Promise; export declare function managedWorktreeCommitsAhead(execFile: ExecFileFn, repoRoot: string, worktreePath: string): Promise; export type GuardedRemoveOutcome = { removed: true; branchPreserved: string | null; } | { removed: false; reason: 'dirty'; } | { removed: false; reason: 'commits-ahead'; commitsAhead: number; } | { removed: false; reason: 'ignored-local-state'; }; export interface RemoveManagedWorktreeArgs { execFile: ExecFileFn; repoRoot: string; worktreePath: string; branch?: string | null; force?: boolean; } export declare function removeManagedWorktreeGuarded(args: RemoveManagedWorktreeArgs): Promise; export declare function createIsolatedWorktree(args: { execFile?: ExecFileFn; cwd: string; slugHint: string; baseRef?: string; }): Promise; export interface IsolatedTeardownResult { removed: boolean; preserved: boolean; reason?: 'dirty' | 'commits-ahead' | 'ignored-local-state'; } export declare function describePreserveReason(reason: NonNullable): string; export declare function teardownIsolatedWorktree(args: { execFile?: ExecFileFn; repoRoot: string; worktreePath: string; }): Promise;