import type { ExtensionAPI, ExecResult } from "@earendil-works/pi-coding-agent"; /** * Result of checking the repository state. */ export interface GitStatus { hasChanges: boolean; raw: string; } /** * Wrapper around git operations used by the extension. * * All commands are run via `pi.exec()` so they inherit pi's environment * (PATH, SSH keys, git config, etc.). */ export declare class GitOperations { private readonly pi; constructor(pi: ExtensionAPI); /** * Check whether the current directory is inside a git working tree. * Returns `true` on success, `false` if not a git repo. */ isInsideGitRepo(): Promise; /** * Run `git status --short` and return whether there are uncommitted changes. */ checkStatus(): Promise; /** * Stage all changes via `git add -A`. */ stageAll(): Promise; /** * Get the stat summary of staged changes (`git diff --cached --stat`). */ getStagedStat(): Promise; /** * Get the full diff of staged changes (`git diff --cached`). */ getStagedDiff(): Promise; /** * Get the name-status of staged changes (`git diff --cached --name-status`). */ getStagedNameStatus(): Promise; /** * Check whether a merge conflict is in progress. * Returns `true` if the index is locked (conflict markers present, etc.) */ hasMergeConflict(): Promise; /** * Execute the commit with the given message. * Returns the raw stdout output of `git commit`. */ commit(message: string): Promise; /** * Unstage a specific file (`git restore --staged -- `). * * Throws when the git command fails (non-zero exit), ensuring callers * (e.g. the commit pipeline) can detect the failure and abort/clean up * instead of silently committing unselected files. */ unstageFile(file: string): Promise; /** * Unstage all changes (`git reset HEAD --`). */ unstageAll(): Promise; /** * Get the staged diff for a single file (`git diff --cached -- `). */ getFileStagedDiff(filePath: string): Promise; /** * Get the staged numstat for a single file (`git diff --cached --numstat -- `). * Returns the number of added and deleted lines. */ getFileStagedNumstat(filePath: string): Promise<{ additions: number; deletions: number; }>; /** * Run `git status` (full output, human-readable) and return the result. */ getFullStatus(): Promise; /** * Check whether there are any uncommitted changes (staged, unstaged, or untracked). * Uses `git status --porcelain` for machine-parseable output. * Returns true if there are any changes relative to HEAD. */ checkUncommittedChanges(): Promise; /** * Count how many consecutive WIP checkpoint commits exist at HEAD. * * Walks backwards from HEAD and stops at the first commit whose subject * does not start with the given marker. */ countWipCommits(marker: string): Promise; /** * Soft reset the last N commits, keeping their changes staged. * Equivalent to `git reset --soft HEAD~N`. */ resetSoft(commitCount: number): Promise; /** * Stage only the given files (`git add -- ...`). */ stageFiles(files: string[]): Promise; } //# sourceMappingURL=git-operations.d.ts.map