import { WorktreeInfo, SafetyCheckResult } from '../types/index.js'; /** * Safety Checker * * Performs comprehensive safety checks before closing a worktree: * - Uncommitted changes (staged and unstaged) * - Unpushed commits * - Branch merge status * - Remote branch existence * - Detached HEAD * - Merge/rebase in progress */ export declare class SafetyChecker { /** * Perform all safety checks on a worktree * * @param worktree - Worktree information * @returns Safety check result with warnings */ check(worktree: WorktreeInfo): Promise; /** * Check for uncommitted changes * * @param worktreePath - Path to worktree * @returns True if there are uncommitted changes */ private checkUncommittedChanges; /** * Check for unpushed commits. * * The comparison needs `refs/remotes/origin/` locally. A repository * that has never fetched that branch cannot answer the question, and * reporting "nothing unpushed" there would silently green-light discarding * commits — so an indeterminate result is reported as unpushed instead. * * @param worktreePath - Path to worktree * @param branchName - Branch name */ private checkUnpushedCommits; /** * Check whether the branch is merged into the repository's primary branch. * * Compares against the remote-tracking ref (`origin/`) rather than * the local branch: in a worktree-based workflow the local primary branch is * rarely pulled, so it is usually behind and would report merged branches as * unmerged. * * @param worktree - Worktree information * @param branchName - Branch name */ private checkBranchMerged; /** * Check if remote branch exists * * @param worktreePath - Path to worktree * @param branchName - Branch name * @returns True if remote branch exists */ private checkRemoteBranch; /** * Check for merge in progress * * @param worktreePath - Path to worktree * @returns True if merge is in progress */ private checkMergeInProgress; /** * Check for rebase in progress * * @param worktreePath - Path to worktree * @returns True if rebase is in progress */ private checkRebaseInProgress; /** * Get detailed status message for safety check * * @param result - Safety check result * @returns Human-readable status message */ getStatusMessage(result: SafetyCheckResult): string; /** * Check if force close is needed * * @param result - Safety check result * @returns True if force close is required */ needsForceClose(result: SafetyCheckResult): boolean; /** * Get count of blocking issues * * @param result - Safety check result * @returns Number of blocking issues */ getBlockingIssueCount(result: SafetyCheckResult): number; /** * Get count of warning issues (non-blocking) * * @param result - Safety check result * @returns Number of warning issues */ getWarningIssueCount(result: SafetyCheckResult): number; } //# sourceMappingURL=SafetyChecker.d.ts.map