import { ConflictOp } from '@agent-tower/shared';
export declare class GitError extends Error {
    code: string;
    constructor(message: string, code?: string);
}
export declare class BranchNotFoundError extends GitError {
    constructor(branchName: string);
}
export declare class BranchExistsError extends GitError {
    constructor(branchName: string);
}
export declare class InvalidBranchNameError extends GitError {
    constructor(branchName: string, reason?: string);
}
export declare class WorktreeNotFoundError extends GitError {
    constructor(worktreePath: string);
}
export declare class WorktreeDirtyError extends GitError {
    constructor(worktreePath: string);
}
export declare class MergeConflictError extends GitError {
    conflictedFiles: string[];
    conflictOp: ConflictOp;
    constructor(conflictedFiles: string[], conflictOp?: ConflictOp);
}
export declare class RebaseInProgressError extends GitError {
    constructor();
}
export declare class BranchesDivergedError extends GitError {
    ahead: number;
    behind: number;
    constructor(taskBranch: string, baseBranch: string, ahead: number, behind: number);
}
/**
 * Execute a git command in the given repository path.
 * All git operations go through this single entry point for uniform error handling.
 */
export declare function execGit(repoPath: string, args: string[], options?: {
    timeout?: number;
}): Promise<string>;
/**
 * Check that the `git` binary is available on PATH.
 */
export declare function ensureGitAvailable(): Promise<void>;
/**
 * Validate a git branch name.
 * Follows rules from `git check-ref-format --branch`:
 * - No double dots (..)
 * - No ASCII control chars or space, ~, ^, :, ?, *, [, \
 * - Cannot begin or end with a dot, or end with .lock
 * - Cannot contain @{
 * - Cannot be a single @
 * - Each component cannot begin with a dot
 */
export declare function isValidBranchName(name: string): {
    valid: boolean;
    reason?: string;
};
//# sourceMappingURL=git-cli.d.ts.map