import { GitAction } from '../constants.js'; import { ToolResult } from '../types.js'; import { WorkspaceService } from './WorkspaceService.js'; export interface GitCommandArgs { cwd?: string; } export interface GitStatusArgs extends GitCommandArgs { } export interface GitDiffArgs extends GitCommandArgs { staged?: boolean; file?: string; } export interface GitAddArgs extends GitCommandArgs { files?: string[]; all?: boolean; } export interface GitCommitArgs extends GitCommandArgs { message: string; } export interface GitPushArgs extends GitCommandArgs { remote?: string; branch?: string; } export interface GitPullArgs extends GitCommandArgs { remote?: string; branch?: string; } export interface GitBranchArgs extends GitCommandArgs { action: GitAction; name?: string; force?: boolean; } export interface GitLogArgs extends GitCommandArgs { limit?: number; oneline?: boolean; } export interface GitCheckoutArgs extends GitCommandArgs { target: string; files?: string[]; createBranch?: boolean; force?: boolean; } export interface GitResetArgs extends GitCommandArgs { mode?: 'soft' | 'mixed' | 'hard'; target?: string; files?: string[]; } export interface GitMergeArgs extends GitCommandArgs { branch: string; noFastForward?: boolean; squash?: boolean; message?: string; } export interface GitRebaseArgs extends GitCommandArgs { target?: string; interactive?: boolean; abort?: boolean; continue?: boolean; } export interface GitStashArgs extends GitCommandArgs { action?: 'push' | 'pop' | 'list' | 'show' | 'drop' | 'clear'; message?: string; index?: number; includeUntracked?: boolean; } export interface GitRemoteArgs extends GitCommandArgs { action?: 'list' | 'add' | 'remove' | 'rename' | 'set-url'; name?: string; url?: string; } export interface GitTagArgs extends GitCommandArgs { action?: 'list' | 'create' | 'delete' | 'show'; name?: string; message?: string; target?: string; force?: boolean; } export interface GitFetchArgs extends GitCommandArgs { remote?: string; branch?: string; all?: boolean; prune?: boolean; } export interface GitCloneArgs extends GitCommandArgs { url: string; directory?: string; branch?: string; depth?: number; recursive?: boolean; } export interface GitInitArgs extends GitCommandArgs { bare?: boolean; directory?: string; } export interface GitLsFilesArgs extends GitCommandArgs { staged?: boolean; deleted?: boolean; others?: boolean; ignored?: boolean; unmerged?: boolean; } export interface GitBlameArgs extends GitCommandArgs { file: string; lineRange?: { start: number; end: number; }; } export interface GitShowArgs extends GitCommandArgs { commit?: string; file?: string; format?: string; } export interface AutoCommitOptions { message: string; files?: string[]; amendSession?: boolean; skipIfNoChanges?: boolean; } export interface RollbackOptions { toCommit?: string; sessionOnly?: boolean; preserveUnstaged?: boolean; } export interface GitDiffOptions extends GitCommandArgs { staged?: boolean; file?: string; format?: 'unified' | 'side-by-side' | 'inline' | 'stat' | 'name-only' | 'word-diff'; contextLines?: number; ignoreWhitespace?: boolean; colorOutput?: boolean; commit1?: string; commit2?: string; } export declare class GitService { private workspaceService; constructor(workspaceService: WorkspaceService); /** * Execute a git command */ gitCommand(args: string[], cwd?: string): Promise; /** * Get git repository status */ gitStatus(args?: GitStatusArgs): Promise; /** * Show git diff */ gitDiff(args: GitDiffArgs): Promise; /** * Stage files for commit */ gitAdd(args: GitAddArgs): Promise; /** * Commit staged changes */ gitCommit(args: GitCommitArgs): Promise; /** * Push commits to remote */ gitPush(args: GitPushArgs): Promise; /** * Pull changes from remote */ gitPull(args: GitPullArgs): Promise; /** * List, create, switch, or delete branches */ gitBranch(args: GitBranchArgs): Promise; /** * Show commit history */ gitLog(args: GitLogArgs): Promise; /** * Checkout branches or restore files */ gitCheckout(args: GitCheckoutArgs): Promise; /** * Reset changes */ gitReset(args: GitResetArgs): Promise; /** * Merge branches */ gitMerge(args: GitMergeArgs): Promise; /** * Rebase operations */ gitRebase(args: GitRebaseArgs): Promise; /** * Stash operations */ gitStash(args: GitStashArgs): Promise; /** * Remote operations */ gitRemote(args: GitRemoteArgs): Promise; /** * Tag operations */ gitTag(args: GitTagArgs): Promise; /** * Fetch from remote */ gitFetch(args: GitFetchArgs): Promise; /** * Clone repository */ gitClone(args: GitCloneArgs): Promise; /** * Initialize a new git repository */ gitInit(args: GitInitArgs): Promise; /** * Show information about files in the index and working tree */ gitLsFiles(args: GitLsFilesArgs): Promise; /** * Show file blame information */ gitBlame(args: GitBlameArgs): Promise; /** * Show changes between commits, commit and working tree, etc */ gitShow(args: GitShowArgs): Promise; /** * Automatically commit changes made by AI */ autoCommitChanges(options: AutoCommitOptions): Promise; /** * Get a preview of changes that would be committed */ previewChanges(cwd?: string): Promise; /** * Rollback session changes */ rollbackSession(options: RollbackOptions): Promise; /** * Get session history (simplified version showing recent commits) */ getSessionHistory(limit?: number): Promise; /** * List git branches (focused action) */ gitBranchList(args: { remote?: boolean; all?: boolean; merged?: boolean; cwd?: string; }): Promise; /** * Create a new git branch (focused action) */ gitBranchCreate(args: { name: string; checkout?: boolean; start_point?: string; cwd?: string; }): Promise; /** * Switch to a git branch (focused action) */ gitBranchSwitch(args: { name: string; create?: boolean; force?: boolean; cwd?: string; }): Promise; /** * Delete a git branch (focused action) */ gitBranchDelete(args: { name: string; force?: boolean; remote?: boolean; cwd?: string; }): Promise; /** * Merge a git branch into current branch (focused action) */ gitBranchMerge(args: { branch: string; no_fast_forward?: boolean; squash?: boolean; message?: string; cwd?: string; }): Promise; /** * Enhanced diff with multiple format options */ enhancedGitDiff(options: GitDiffOptions): Promise; /** * Get diff statistics (lines added/removed/modified) */ getDiffStats(options?: { staged?: boolean; file?: string; commit1?: string; commit2?: string; cwd?: string; }): Promise; /** * Compare two commits with detailed analysis */ compareCommits(commit1: string, commit2: string, options?: { filePattern?: string; format?: 'unified' | 'stat' | 'name-only'; cwd?: string; }): Promise; /** * Enhanced preview changes with multiple format options */ previewChangesEnhanced(options?: { format?: 'unified' | 'side-by-side' | 'stat' | 'word-diff'; contextLines?: number; ignoreWhitespace?: boolean; filePattern?: string; cwd?: string; }): Promise; } //# sourceMappingURL=GitService.d.ts.map