/** * Worktree Manager — git worktree CRUD operations. * * Uses spawn (no shell) and validates branch names, refs, and paths via * InputValidator so untrusted input cannot reach the git command line. * Path arguments are constrained to repoRoot; branch names reject shell * metacharacters. createMultipleWorktrees rolls back partial failures. */ export interface CreateWorktreeOptions { baseRef?: string; branch: string; force?: boolean; path: string; } export interface WorktreeInfo { branch: string; commit: string; path: string; prunable: boolean; } export declare class WorktreeManager { private repoRoot; constructor(repoRoot?: string); createWorktree(options: CreateWorktreeOptions): Promise; deleteBranch(branchName: string, force?: boolean): Promise; getExplorationWorktrees(): Promise; getWorktreeInfo(worktreePath: string): Promise; isBranchNameAvailable(branchName: string): Promise; /** * List local branch names starting with `prefix` (e.g. `exploration/exp-abc` * matches `exploration/exp-abc-1`, `exploration/exp-abc-2`, ...). `prefix` * must be a literal, already-validated branch-name-shaped string — this * method appends the `*` glob itself and passes the pattern to `git * branch --list` via array-form exec (no shell), so untrusted input in * `prefix` cannot smuggle shell metacharacters or its own glob syntax. */ listBranchesByPrefix(prefix: string): Promise; listWorktrees(): Promise; lockWorktree(worktreePath: string, reason?: string): Promise; pruneWorktrees(): Promise; removeWorktree(worktreePath: string, force?: boolean): Promise; unlockWorktree(worktreePath: string): Promise; worktreeExists(worktreePath: string): Promise; private parseWorktreeList; private resolveRealPath; /** * Sequential creation with rollback on partial failure: a single failed * worktree leaves the previously created ones removed and their branches * deleted, so callers see all-or-nothing semantics. */ createMultipleWorktrees(optionsArray: CreateWorktreeOptions[]): Promise; getWorktreeStatus(worktreePath: string): Promise<{ clean: boolean; uncommitted_changes: number; }>; removeMultipleWorktrees(paths: string[], force?: boolean): Promise; /** * Refuses creation past the configured cap so a leak in caller code cannot * exhaust the filesystem's worktree budget. Callers must `git worktree * prune` to recover. */ checkWorktreeLimit(maxWorktrees?: number): Promise; } //# sourceMappingURL=worktree-manager.d.ts.map