/**
 * Git PR Service Implementation
 *
 * Manages git operations for PR creation, merging, and CI status checks.
 * Uses constructor dependency injection for the command executor.
 */
import type { IGitPrService } from '../../../application/ports/output/services/git-pr-service.interface.js';
import type { CiStatusResult, DiffSummary, FileDiff, MergeStrategy, PrCreateResult, PrStatusInfo } from '../../../application/ports/output/services/git-pr-service.interface.js';
import type { ExecFunction } from './worktree.service.js';
export declare class GitPrService implements IGitPrService {
    private readonly execFile;
    constructor(execFile: ExecFunction);
    hasRemote(cwd: string): Promise<boolean>;
    getRemoteUrl(cwd: string): Promise<string | null>;
    getDefaultBranch(cwd: string): Promise<string>;
    revParse(cwd: string, ref: string): Promise<string>;
    hasUncommittedChanges(cwd: string): Promise<boolean>;
    commitAll(cwd: string, message: string): Promise<string>;
    push(cwd: string, branch: string, setUpstream?: boolean): Promise<void>;
    createPr(cwd: string, prYamlPath: string): Promise<PrCreateResult>;
    mergePr(cwd: string, prNumber: number, strategy?: MergeStrategy): Promise<void>;
    private getPrHeadBranch;
    localMergeSquash(cwd: string, featureBranch: string, baseBranch: string, commitMessage: string, hasRemote?: boolean): Promise<void>;
    mergeBranch(cwd: string, sourceBranch: string, targetBranch: string): Promise<void>;
    getCiStatus(cwd: string, branch: string): Promise<CiStatusResult>;
    watchCi(cwd: string, branch: string, timeoutMs?: number, intervalSeconds?: number): Promise<CiStatusResult>;
    deleteBranch(cwd: string, branch: string, deleteRemote?: boolean): Promise<void>;
    getPrDiffSummary(cwd: string, baseBranch: string): Promise<DiffSummary>;
    getFileDiffs(cwd: string, baseBranch: string): Promise<FileDiff[]>;
    private parseUnifiedDiff;
    private parseFileDiff;
    listPrStatuses(cwd: string): Promise<PrStatusInfo[]>;
    getMergeableStatus(cwd: string, prNumber: number): Promise<boolean | undefined>;
    verifyMerge(cwd: string, featureBranch: string, baseBranch: string, premergeBaseSha?: string): Promise<boolean>;
    /**
     * Resolve a branch name to a valid git ref, falling back to the remote
     * tracking branch if the local ref has been deleted.
     */
    private resolveRef;
    getFailureLogs(cwd: string, runId: string, _branch: string, logMaxChars?: number): Promise<string>;
    private truncateLog;
    private parseMergeable;
    private normalizeGhState;
    private parseGitError;
    private parseGhError;
    private parsePrNumberFromUrl;
    createGitHubRepo(cwd: string, name: string, options: {
        isPrivate: boolean;
        org?: string;
    }): Promise<string>;
    /**
     * Extracts the first github.com repository URL from a blob of text.
     * Returns a normalized URL without a trailing `.git` suffix or punctuation.
     */
    private extractGitHubUrl;
    /**
     * Queries the current repo's URL via `gh repo view --json url`. Used as a
     * fallback when URL parsing from `gh repo create` output fails.
     */
    private queryRepoUrl;
    addRemote(cwd: string, remoteName: string, remoteUrl: string): Promise<void>;
    pull(cwd: string): Promise<void>;
    private parseDiffStat;
    syncMain(cwd: string, baseBranch: string): Promise<void>;
    rebaseOnMain(cwd: string, featureBranch: string, baseBranch: string): Promise<void>;
    getConflictedFiles(cwd: string): Promise<string[]>;
    stageFiles(cwd: string, files: string[]): Promise<void>;
    rebaseContinue(cwd: string): Promise<void>;
    rebaseAbort(cwd: string): Promise<void>;
    stash(cwd: string, message?: string): Promise<boolean>;
    stashPop(cwd: string): Promise<void>;
    stashDrop(cwd: string): Promise<void>;
    getBranchSyncStatus(cwd: string, featureBranch: string, baseBranch: string): Promise<{
        ahead: number;
        behind: number;
    }>;
}
//# sourceMappingURL=git-pr.service.d.ts.map