/** * Git Integration - Git operations for CLI * Safe, read-focused operations with optional write capabilities */ export interface GitConfig { cwd?: string; safe?: boolean; } export interface GitStatus { branch: string; ahead: number; behind: number; staged: string[]; modified: string[]; untracked: string[]; deleted: string[]; conflicts: string[]; } export interface GitCommit { hash: string; shortHash: string; author: string; email: string; date: Date; message: string; } export interface GitDiff { files: GitDiffFile[]; summary: string; } export interface GitDiffFile { path: string; status: 'added' | 'modified' | 'deleted' | 'renamed'; additions: number; deletions: number; diff?: string; } /** * Git Manager class */ export declare class GitManager { private cwd; private safe; constructor(config?: GitConfig); /** * Execute a git command */ private exec; /** * Check if directory is a git repository */ isRepo(): Promise; /** * Get current branch name */ getBranch(): Promise; /** * Get repository status */ getStatus(): Promise; /** * Get diff (staged or unstaged) */ getDiff(staged?: boolean): Promise; /** * Get recent commits */ getLog(limit?: number): Promise; /** * Get list of branches */ getBranches(): Promise<{ name: string; current: boolean; }[]>; /** * Stage files (requires safe=false) */ add(files?: string[]): Promise; /** * Commit staged changes (requires safe=false) */ commit(message: string): Promise; /** * Stash changes (requires safe=false) */ stash(message?: string): Promise; /** * Pop stash (requires safe=false) */ stashPop(): Promise; /** * Get stash list */ getStashList(): Promise; /** * Get file content at a specific commit */ show(ref: string, path: string): Promise; /** * Get blame for a file */ blame(path: string): Promise; /** * Generate commit message from staged changes */ generateCommitMessage(): Promise; /** * Get formatted status string */ getStatusString(): Promise; } /** * Create a git manager instance */ export declare function createGitManager(config?: GitConfig): GitManager; /** * Diff viewer with syntax highlighting (text-based) */ export declare class DiffViewer { private diff; constructor(diff: string); /** * Get formatted diff with markers */ format(): string; /** * Get summary statistics */ getStats(): { additions: number; deletions: number; }; } /** * Create a diff viewer */ export declare function createDiffViewer(diff: string): DiffViewer;