/**
 * Git service for executing git commands within project directories.
 * Parses git porcelain output into structured data.
 */
import type { GitBranch, GitFileStatus, Message } from "@pocketcoder/shared";
export declare class GitNotInitializedError extends Error {
    constructor(path: string);
}
export interface GitStatusResult {
    branch: string;
    clean: boolean;
    staged: GitFileStatus[];
    unstaged: GitFileStatus[];
    conflicts: GitFileStatus[];
}
/**
 * Get the git status for a project directory.
 * Uses `git status --porcelain=v1 --branch` for structured output.
 */
export declare function getGitStatus(projectPath: string): Promise<GitStatusResult>;
export interface GitBranchCreateResult {
    name: string;
    created: boolean;
}
/**
 * Create a new git branch.
 * @param projectPath The path to the project
 * @param name The branch name to create
 * @param startPoint The commit/ref to base the branch on (default: HEAD)
 */
export declare function createGitBranch(projectPath: string, name: string, startPoint?: string): Promise<GitBranchCreateResult>;
export interface GitCheckoutResult {
    ref: string;
    switched: boolean;
}
/**
 * Checkout a git ref (branch, tag, or commit).
 */
export declare function checkoutGitRef(projectPath: string, ref: string): Promise<GitCheckoutResult>;
/**
 * Stage files in the git index.
 * @param projectPath The path to the project
 * @param paths Files to stage (use ['.'] to stage all)
 * @returns List of staged file paths
 */
export declare function stageFiles(projectPath: string, paths: string[]): Promise<string[]>;
/**
 * Unstage files from the git index.
 * @param projectPath The path to the project
 * @param paths Files to unstage (use ['.'] to unstage all)
 * @returns List of unstaged file paths
 */
export declare function unstageFiles(projectPath: string, paths: string[]): Promise<string[]>;
export interface GitCommitResult {
    sha: string;
    message: string;
}
/**
 * Create a git commit with the given message.
 * @param projectPath The path to the project
 * @param message The commit message
 * @returns The commit sha and message
 */
export declare function createGitCommit(projectPath: string, message: string): Promise<GitCommitResult>;
export interface GitPushResult {
    remote: string;
    branch: string;
    pushed: boolean;
}
/**
 * Push commits to a remote repository via PTY for credential prompt support.
 * @param projectPath The path to the project
 * @param remote Remote name (default: origin)
 * @param branch Branch to push (default: current branch)
 * @param force Whether to force push (default: false)
 * @param requestId Request ID for credential prompt correlation
 * @param send Function to send messages to the client (for credential prompts)
 */
export declare function gitPush(projectPath: string, remote?: string, branch?: string, force?: boolean, requestId?: string, send?: (message: Message) => void): Promise<GitPushResult>;
/**
 * Run a git command via PTY with credential prompt handling.
 * Used for push and pull operations that may require authentication.
 */
export declare function runGitViaPty(projectPath: string, args: string[], branch: string, remote: string, requestId?: string, send?: (message: Message) => void): Promise<GitPushResult>;
export interface GitPullResult {
    remote: string;
    branch: string;
    pulled: boolean;
    conflicts?: string[];
}
/**
 * Pull from a remote repository via PTY for credential prompt support.
 * Detects merge conflicts and returns conflict file list.
 * @param projectPath The path to the project
 * @param remote Remote name (default: origin)
 * @param branch Branch to pull (default: current branch)
 * @param requestId Request ID for credential prompt correlation
 * @param send Function to send messages to the client (for credential prompts)
 */
export declare function gitPull(projectPath: string, remote?: string, branch?: string, requestId?: string, send?: (message: Message) => void): Promise<GitPullResult>;
export interface GitFileBaseResult {
    path: string;
    ref: string;
    content: string | null;
}
/**
 * Get the content of a file at a given git ref (default HEAD).
 * Returns null content for files that don't exist at the ref (new files).
 */
export declare function getFileAtRef(projectPath: string, filePath: string, ref?: string): Promise<GitFileBaseResult>;
export interface GitBranchesResult {
    current: string;
    branches: GitBranch[];
}
/**
 * Get the list of local branches with remote tracking info.
 * Uses `git branch -vv --no-color` for structured output.
 */
export declare function getGitBranches(projectPath: string): Promise<GitBranchesResult>;
export interface GitDiffFileResult {
    path: string;
    status: string;
    additions: number;
    deletions: number;
    diff: string;
}
export interface GitDiffResult {
    files: GitDiffFileResult[];
}
/**
 * Get diff for files in a project directory.
 * @param projectPath The path to the project
 * @param path Optional specific file path to diff
 * @param staged Whether to diff staged changes (--cached)
 */
export declare function getDiff(projectPath: string, path?: string, staged?: boolean): Promise<GitDiffResult>;
export interface GitDiscardResult {
    discarded: number;
}
/**
 * Discard uncommitted changes.
 * For tracked files: uses `git checkout HEAD -- <paths>`.
 * If all=true: also removes untracked files with `git clean -fd`.
 * @param projectPath The path to the project
 * @param paths Specific files to discard (optional)
 * @param all Whether to discard all changes including untracked files
 */
export declare function discardChanges(projectPath: string, paths?: string[], all?: boolean): Promise<GitDiscardResult>;
//# sourceMappingURL=git.d.ts.map