/**
 * Git Utilities
 *
 * Shared utilities for git operations including command execution,
 * status parsing, and availability checks.
 */
/**
 * File change status from git
 */
export type FileChangeStatus = 'added' | 'modified' | 'deleted' | 'renamed' | 'copied';
/**
 * Represents a single file change
 */
export interface FileChange {
    path: string;
    status: FileChangeStatus;
    oldPath?: string;
    additions: number;
    deletions: number;
    isBinary: boolean;
}
/**
 * Commit information
 */
export interface CommitInfo {
    hash: string;
    shortHash: string;
    author: string;
    email: string;
    date: string;
    relativeDate: string;
    subject: string;
    body: string;
    filesChanged?: number;
}
/**
 * Check if git is available on the system (synchronous)
 */
export declare function isGitAvailable(): boolean;
/**
 * Check if the current directory is inside a git repository (synchronous)
 */
export declare function isInsideGitRepo(): boolean;
/**
 * Check if gh CLI is available on the system (synchronous)
 */
export declare function isGhAvailable(): boolean;
/**
 * Summary of git branch state used by the boot summary and /status panel.
 */
export interface GitStatusSummary {
    branch: string;
    isDefault: boolean;
    detached: boolean;
}
/**
 * Read the current branch name synchronously by parsing .git/HEAD.
 * Returns null when not in a repo or HEAD can't be read.
 * When HEAD is detached, returns a short SHA prefix.
 *
 * `startDir` is exposed for tests that want to point at a fixture directory
 * without relying on `process.chdir` (which is racy with parallel tests and
 * fails when `os.tmpdir()` happens to live inside the working tree).
 */
export declare function getCurrentBranchSync(startDir?: string): {
    branch: string;
    detached: boolean;
} | null;
/**
 * Resolve the default branch synchronously. Prefers
 * `.git/refs/remotes/origin/HEAD` (a symbolic ref) — checking both the loose
 * file and `packed-refs`, since fresh clones often pack origin/HEAD. Falls
 * back to whether `main` or `master` exists in `.git/refs/heads/` or
 * `packed-refs`. Returns null when nothing can be resolved.
 */
export declare function getDefaultBranchSync(startDir?: string): string | null;
/**
 * Resolve a {@link GitStatusSummary} synchronously by reading the `.git`
 * filesystem directly — no child processes, safe to call from Ink's
 * `<Static>` render path. Returns null when not in a git repository so
 * callers can cleanly omit the surface.
 *
 * Skips the `isInsideGitRepo()` shell-out: `getCurrentBranchSync` already
 * returns null whenever no `.git` directory is found, which is the same
 * signal at zero process-spawn cost.
 */
export declare function getGitStatusSummarySync(startDir?: string): GitStatusSummary | null;
/**
 * Format a {@link GitStatusSummary} as a short suffix-marker label.
 * Shared by the boot summary and the `/status` panel so the two surfaces
 * can't drift on wording.
 */
export declare function formatGitStatusSummary(status: GitStatusSummary): {
    branch: string;
    marker: string | null;
};
/**
 * Execute a git command and return the output
 */
export declare function execGit(args: string[]): Promise<string>;
/**
 * Execute a gh CLI command and return the output
 */
export declare function execGh(args: string[]): Promise<string>;
/**
 * Check if there are staged changes
 */
export declare function hasStagedChanges(): Promise<boolean>;
/**
 * Check if a rebase is in progress
 */
export declare function isRebaseInProgress(): Promise<boolean>;
/**
 * Check if a merge is in progress
 */
export declare function isMergeInProgress(): Promise<boolean>;
/**
 * Get the current branch name
 */
export declare function getCurrentBranch(): Promise<string>;
/**
 * Get the default branch (main or master)
 */
export declare function getDefaultBranch(): Promise<string>;
/**
 * Get the upstream branch for the current branch
 */
export declare function getUpstreamBranch(): Promise<string | null>;
/**
 * Get ahead/behind counts relative to upstream
 */
export declare function getAheadBehind(): Promise<{
    ahead: number;
    behind: number;
}>;
/**
 * Check if the last commit has been pushed
 */
export declare function isLastCommitPushed(): Promise<boolean>;
/**
 * Get commits with various filters
 */
export declare function getCommits(options: {
    count?: number;
    range?: string;
    file?: string;
    author?: string;
    since?: string;
    grep?: string;
}): Promise<CommitInfo[]>;
/**
 * Parse git status --porcelain output
 */
export declare function parseGitStatus(statusOutput: string): {
    staged: FileChange[];
    unstaged: FileChange[];
    untracked: string[];
    conflicts: string[];
};
/**
 * Get diff stats for files (additions/deletions)
 */
export declare function getDiffStats(staged?: boolean): Promise<Map<string, {
    additions: number;
    deletions: number;
}>>;
/**
 * Get stash count
 */
export declare function getStashCount(): Promise<number>;
/**
 * Truncate diff output if too long
 */
export declare function truncateDiff(diff: string, maxLines?: number): {
    content: string;
    truncated: boolean;
    totalLines: number;
};
/**
 * Format file status character for display
 */
export declare function formatStatusChar(status: FileChangeStatus): string;
//# sourceMappingURL=utils.d.ts.map