/**
 * PR Utilities
 *
 * Utilities for creating and managing GitHub pull requests.
 * Uses the `gh` CLI for GitHub operations.
 */
export interface PRInfo {
    number: number;
    url: string;
    title: string;
    state: 'OPEN' | 'CLOSED' | 'MERGED';
    headBranch: string;
    baseBranch: string;
    isDraft: boolean;
    createdAt: string;
    updatedAt: string;
}
export interface CreatePROptions {
    title: string;
    body?: string;
    base?: string;
    draft?: boolean;
    cwd?: string;
}
export interface CreatePRResult {
    success: boolean;
    url?: string;
    number?: number;
    error?: string;
}
/**
 * Check if `gh` CLI is installed.
 */
export declare function isGHInstalled(): boolean;
/**
 * Check if `gh` is authenticated.
 */
export declare function isGHAuthenticated(): boolean;
/**
 * Get the authenticated GitHub username.
 */
export declare function getGHUsername(): string | null;
/**
 * Check if GH_TOKEN or GITHUB_TOKEN is set in environment.
 */
export declare function isGHTokenInEnv(): boolean;
export interface GitIdentity {
    name: string | null;
    email: string | null;
}
export declare function getGitIdentity(cwd?: string): GitIdentity;
/**
 * Get the GitHub repository from git remote.
 * Returns format: owner/repo
 */
export declare function getGitHubRepo(cwd?: string): string | null;
/**
 * Get the default base branch (main or master).
 * Prefers origin/main over local main to avoid stale local branches
 * in agent worktrees where local main is never updated.
 */
export declare function getDefaultBaseBranch(cwd?: string): string;
/**
 * Get the current branch name.
 */
export declare function getCurrentBranch(cwd?: string): string | null;
/**
 * Check if the current branch has been pushed to remote.
 */
export declare function hasBranchBeenPushed(branch: string, cwd?: string): boolean;
/**
 * Push the current branch to origin.
 */
export declare function pushBranch(branch: string, cwd?: string): boolean;
/**
 * Check if there are unpushed commits.
 */
export declare function hasUnpushedCommits(branch: string, cwd?: string): boolean;
/**
 * Get the commit log between base and head.
 * Prefers origin/${base} over local ${base} to avoid stale local branches
 * in agent worktrees where local main/master is never updated.
 */
export declare function getCommitLog(base: string, cwd?: string): string[];
/**
 * Create a GitHub pull request using `gh` CLI.
 */
export declare function createPR(options: CreatePROptions): CreatePRResult;
/**
 * Get PR info for a branch.
 */
export declare function getPRForBranch(branch: string, cwd?: string): PRInfo | null;
/**
 * Get PR info by number.
 */
export declare function getPRByNumber(prNumber: number, cwd?: string): PRInfo | null;
/**
 * List open PRs for the current repo.
 */
export declare function listOpenPRs(cwd?: string): PRInfo[];
/**
 * Generate PR title from ticket info.
 */
export declare function generatePRTitle(ticketId: string, ticketTitle: string): string;
/**
 * Generate PR body from ticket info.
 */
export declare function generatePRBody(options: {
    ticketId: string;
    ticketTitle: string;
    ticketDescription?: string;
    commits?: string[];
}): string;
/**
 * Comment on a PR (either review comment or general comment).
 */
export interface PRComment {
    id: string;
    author: string;
    body: string;
    createdAt: string;
    path?: string;
    line?: number;
    diffHunk?: string;
}
/**
 * Review on a PR.
 */
export interface PRReview {
    id: string;
    author: string;
    state: 'APPROVED' | 'CHANGES_REQUESTED' | 'COMMENTED' | 'PENDING' | 'DISMISSED';
    body: string;
    createdAt: string;
    comments: PRComment[];
}
/**
 * Full feedback for a PR (reviews + comments).
 */
export interface PRFeedback {
    prNumber: number;
    prUrl: string;
    prTitle: string;
    reviews: PRReview[];
    comments: PRComment[];
    reviewDecision?: 'APPROVED' | 'CHANGES_REQUESTED' | 'REVIEW_REQUIRED' | null;
}
/**
 * Get PR feedback (reviews and comments) by PR URL or number.
 */
export declare function getPRFeedback(prUrlOrNumber: string | number, cwd?: string): PRFeedback | null;
/**
 * Check if a PR has pending feedback that needs addressing.
 */
export declare function hasPendingFeedback(feedback: PRFeedback): boolean;
/**
 * Format PR feedback as markdown for agent prompt.
 */
export declare function formatPRFeedbackForPrompt(feedback: PRFeedback): string;
