/** * Handoff Git State Capture * * Captures the cheap, deterministic git facts the handoff doc needs (branch, * short sha, porcelain status, diff --stat) AND dumps the FULL working-tree + * staged diff to a sibling `.diff` file. The full diff is captured for free via * git — no LLM tokens are spent — and is the key in-flight-fidelity artifact: * it lets the resuming agent see exactly what was changed but not yet committed. * * In a non-git directory every field degrades to empty and no error is thrown, * so the non-SpecWeave fallback path still works on plain folders. * * Part of increment 0867: Cross-Tool Work Handoff (AC-US4-01..04). * * @module core/session/handoff-git-state */ /** * Captured git state for the handoff doc. */ export interface GitState { /** Whether `repoRoot` is inside a git work tree at all. */ isGitRepo: boolean; /** Current branch name (empty if detached or non-git). */ branch: string; /** Short commit SHA of HEAD (empty if no commits / non-git). */ shortSha: string; /** `git status --porcelain` output (empty when clean or non-git). */ statusPorcelain: string; /** Combined `git diff --stat` (working) + `git diff --cached --stat` (staged). */ diffStat: string; /** True when there are working-tree or staged changes. */ hasUncommittedChanges: boolean; /** Upstream branch (`origin/feature`), empty when none is configured. */ upstream?: string; /** Commits on HEAD not yet on the upstream (undefined without an upstream). */ ahead?: number; } /** * SpecWeave's own bookkeeping, excluded from the handoff diff and the "files * touched" list: the next agent reads it through `specweave pickup`, and in a * measured handoff it was 97% of the diff. spec.md and plan.md stay in, since * edits to them are real work. */ export declare const BOOKKEEPING_PATHSPECS: readonly string[]; /** Total Git budget leaves headroom below PreCompact's five-second budget. */ export declare const GIT_CAPTURE_BUDGET_MS = 3500; /** Capture through a private index; an interrupted hook never stages user files. */ export declare function captureGitState(repoRoot: string, diffOutputPath: string, opts?: { strict?: boolean; }): GitState; //# sourceMappingURL=handoff-git-state.d.ts.map