import type { GitCommandName, GitDiffSummary, GitFailureReason, GitRepoIdentity, GitRepoStatus, GitSnapshot, GitSnapshotCompareSummary, GitSnapshotReason } from './git-types.js';
export interface GitFileDiff extends GitRepoIdentity {
    path: string;
    oldPath?: string;
    staged?: boolean;
    diff: string;
    binary?: boolean;
    truncated?: boolean;
    lastCheckedAt: number;
}
export interface GitLogEntry {
    commit: string;
    message: string;
    authorName?: string;
    authorEmail?: string;
    authoredAt?: number;
    committedAt?: number;
}
export interface GitLogResult extends GitRepoIdentity {
    entries: GitLogEntry[];
    limit: number;
    truncated: boolean;
    lastCheckedAt: number;
}
export interface GitCommandServices {
    getStatus?: (params: {
        workspace: string;
    }) => Promise<GitRepoStatus> | GitRepoStatus;
    getDiffSummary?: (params: {
        workspace: string;
        staged?: boolean;
    }) => Promise<GitDiffSummary> | GitDiffSummary;
    getDiffFile?: (params: {
        workspace: string;
        path: string;
        staged?: boolean;
    }) => Promise<GitFileDiff> | GitFileDiff;
    createSnapshot?: (params: {
        workspace: string;
        reason: GitSnapshotReason;
        sessionId?: string;
        turnId?: string;
    }) => Promise<GitSnapshot> | GitSnapshot;
    compareSnapshots?: (params: {
        workspace: string;
        beforeSnapshotId: string;
        afterSnapshotId: string;
    }) => Promise<GitSnapshotCompareSummary> | GitSnapshotCompareSummary;
    getLog?: (params: {
        workspace: string;
        limit: number;
        path?: string;
        since?: string;
        until?: string;
    }) => Promise<GitLogResult> | GitLogResult;
}
type GitCommandFailure = {
    success: false;
    reason: GitFailureReason;
    error: string;
};
type GitCommandSuccess = {
    success: true;
    status: GitRepoStatus;
} | {
    success: true;
    diffSummary: GitDiffSummary;
} | {
    success: true;
    diff: GitFileDiff;
} | {
    success: true;
    snapshot: GitSnapshot;
} | {
    success: true;
    compare: GitSnapshotCompareSummary;
} | {
    success: true;
    log: GitLogResult;
};
export type GitCommandResult = GitCommandSuccess | GitCommandFailure;
export declare function createDefaultGitCommandServices(): GitCommandServices;
export declare function isGitCommandName(command: string): command is GitCommandName;
export declare function handleGitCommand(command: GitCommandName, args: any, services?: GitCommandServices): Promise<GitCommandResult>;
export declare function handleGitCommand(command: string, args: any, services?: GitCommandServices): Promise<GitCommandResult>;
export {};
