/** * Git worktree management for parallel agent isolation. * * Creates isolated workspaces in .git/agent-worktrees/ to allow multiple * agents to work simultaneously without file conflicts. */ import type { PackageManager, WorktreeInfo, CreateWorktreeOptions, CreateWorktreeResult, RemoveWorktreeOptions, RemoveWorktreeResult, ListWorktreesResult } from './types.js'; /** * Manages git worktrees for parallel agent isolation. */ export declare class WorktreeManager { private readonly projectPath; private readonly worktreesDir; constructor(projectPath: string); /** * Ensure the worktrees directory exists. */ private ensureWorktreesDir; /** * Generate a worktree name from options. */ private generateName; /** * Generate a branch name from options. */ private generateBranchName; /** * Detect the package manager used in a directory. */ detectPackageManager(dir: string): Promise; /** * Install dependencies in a directory. */ installDependencies(dir: string, packageManager?: PackageManager): Promise<{ success: boolean; time: number; error?: string; }>; /** * Get the current branch name. */ getCurrentBranch(): Promise; /** * Get the default base branch (main or master). */ getDefaultBaseBranch(): Promise; /** * Check if a branch exists. */ branchExists(branchName: string): Promise; /** * Create a new worktree for isolated agent work. */ createWorktree(options: CreateWorktreeOptions): Promise; /** * Get information about a specific worktree. */ getWorktreeInfo(name: string): Promise; /** * List all agent worktrees. */ listWorktrees(): Promise; /** * Remove a worktree. */ removeWorktree(options: RemoveWorktreeOptions): Promise; /** * Prune stale worktree entries from git. */ pruneWorktrees(): Promise; } /** * Format worktree info for display. */ export declare function formatWorktreeInfo(info: WorktreeInfo): string; /** * Format list of worktrees for display. */ export declare function formatWorktreeList(result: ListWorktreesResult): string; //# sourceMappingURL=worktree-manager.d.ts.map