/** * Git worktree management for plan comparisons. * * Creates temporary worktrees in /tmp for running AI planners in * isolated environments, copies untracked .sum files, and handles * cleanup on success or abort. * * @module */ /** * Result of creating the worktree pair. */ export interface WorktreePair { /** Path to the "with-docs" worktree */ withDocsPath: string; /** Path to the "without-docs" worktree */ withoutDocsPath: string; /** Branch name for "with-docs" */ withDocsBranch: string; /** Branch name for "without-docs" */ withoutDocsBranch: string; /** Cleanup function to remove worktrees */ cleanup: () => Promise; } /** * Check for uncommitted changes and warn the user. * * @returns true if there are uncommitted changes */ export declare function hasUncommittedChanges(projectRoot: string): Promise; /** * Create a pair of git worktrees for plan comparison. * * Creates named branches from HEAD and temporary worktrees in /tmp. * The "with-docs" worktree gets .sum files copied in. * * @param projectRoot - The project root directory * @param taskSlug - Slugified task name for branch naming * @param force - Whether to overwrite existing branches * @returns WorktreePair with paths, branch names, and cleanup function * @throws If branches already exist and force is false */ export declare function createWorktreePair(projectRoot: string, taskSlug: string, force: boolean): Promise; /** * Commit a PLAN.md file to a worktree branch. * * Writes the plan text as `.agents-reverse-engineer/plans//PLAN.md` * in the worktree and commits it, so the plan is preserved on the branch * after the worktree is removed. This allows `are implement` to read the * plan directly from the branch without needing local disk storage. * * @param worktreePath - Absolute path to the worktree * @param planText - The plan markdown content * @param comparisonId - The comparison ID (timestamp-based) for the plan directory */ export declare function commitPlanToWorktree(worktreePath: string, planText: string, comparisonId: string): Promise; /** * Create worktrees from existing branches without recreating them. * * Used by `are implement` to attach to branches created by `are plan`, * preserving any commits (e.g. PLAN.md) already on those branches. * * @param projectRoot - The project root directory * @param taskSlug - Slugified task name for branch naming * @returns WorktreePair with paths, branch names, and cleanup function * @throws If branches do not exist */ export declare function reuseWorktreePair(projectRoot: string, taskSlug: string): Promise; /** * Read a PLAN.md file from a worktree's `.agents-reverse-engineer/plans/` directory. * * Searches for the plan by comparison ID, or finds the first available plan * directory if no ID is given. * * @param worktreePath - Absolute path to the worktree * @param comparisonId - Optional comparison ID; if omitted, finds the first plan * @returns The plan markdown text, or null if not found */ export declare function readPlanFromWorktree(worktreePath: string, comparisonId?: string): Promise; //# sourceMappingURL=worktree.d.ts.map