export declare const GIT_TIMEOUT_MS = 30000; export declare const GIT_SLOW_TIMEOUT_MS = 60000; /** True when a git failure is a transient lock collision (safe to retry). */ export declare function isGitLockError(text: string): boolean; export type GitLogFn = (text: string, level?: 'stdout' | 'stderr') => void; /** IMP-914 per-project agent git automation level. */ export type GitPolicy = 'none' | 'commit' | 'push' | 'pr'; /** * Resolve the effective git policy for a project (IMP-914). The cloud * setting wins whenever it is a valid value; older projects without one * fall back to the legacy local-config flags (`openPr: false` meant "no * PR, still push") and finally to the historical full behavior. */ export declare function resolveGitPolicy(projectAgentGitPolicy: string | null | undefined, legacy?: { openPr?: boolean; }): GitPolicy; export declare function git(cwd: string, args: string[], timeoutMs?: number, opts?: { retries?: number; }): { ok: boolean; out: string; }; /** Paths left unmerged by a conflicted merge (empty when the index is clean). */ export declare function unmergedPaths(cwd: string): string[]; /** * Clear git's OWN lock files when a dead process left them behind (2026-11-18). * * A power cut, a hard kill or a Windows shutdown during `git add`/`git commit` * leaves `index.lock` in the tree. Every later command then fails with * "Unable to create '…/index.lock': File exists", the run cannot commit, and the * human sees a git error on every retry with nothing actually wrong on disk. * * ONLY for trees this process exclusively owns (an isolation mirror: it lives * under `~/.teamshare/workspace`, the run holds the workspace lock, and no human * works there). NEVER call it on a linked folder — a human's `git commit` can * legitimately hold that lock. * * The age gate is the second guard: a lock younger than `minAgeMs` may belong to * a live command (a backgrounded shell the agent spawned), so it is left alone * and the next attempt gets a chance. */ export declare function clearStaleGitLocks(worktree: string, minAgeMs?: number): string[]; /** * Stage everything for a run commit WITHOUT ever staging the transient * `.teamshare-runs/` scope (workspace state, 2026-10-27). Belt-and-braces * beside the marked `.git/info/exclude` entry: even if the exclude was never * written (or was stripped), a missed scope cleanup can never be committed. * Falls back to a plain `git add -A` when the exclusion form is rejected. */ export declare function gitAddAll(cwd: string, timeoutMs?: number): { ok: boolean; out: string; };