/** * Git-plumbing collection for `agent-coord git-hook ` — the in-process * replacement for the bash that host pre-commit / post-commit / post-checkout * hooks used to carry. * * Everything here is a port of hook logic that lived in host repos as shell: * staged-path collection with rename handling, submodule canonicalization, * the gitlink probe, and the clean-in-worktree checks that gate claim pruning. * Owning it here means a harnery upgrade upgrades the behavior; the host hook * file keeps only a stable managed region that invokes `git-hook `. * * All functions take an explicit cwd and return data — no printing, no * process.exit — so they unit-test against a temp repo. */ export type GitHookEvent = "pre-commit" | "post-commit" | "post-checkout"; /** * The coordination root for a hook firing in `cwd`: the superproject when the * repo is a submodule, else the repo's own toplevel. Pinning to the * superproject matters because some submodules carry a config-only `.harnery/` * that a cwd walk would land on, running the check against an empty claims dir. */ export declare function discoverCoordRoot(cwd: string): string | null; /** Monorepo-relative prefix when `cwd` is inside a submodule ("" in the parent). */ export declare function submodulePrefix(cwd: string): string; /** * Parse `--name-status -M` output into repo-local paths. Renames/copies emit * BOTH sides so the source's claim releases too; plain statuses emit one. */ export declare function parseNameStatus(output: string): string[]; /** * pre-commit: staged paths (canonical, monorepo-relative) plus which of them * are submodule gitlinks — a parent-repo pointer bump is not a claim on the * submodule's contents, and the conflict rule's prefix matcher needs to know. */ export declare function collectStaged(cwd: string): { staged: string[]; gitlinks: string[]; }; /** * post-commit: paths the just-landed HEAD commit touched that are now clean in * the worktree. A path with unstaged residue keeps its claim — the agent is * still mid-work on it. */ export declare function collectCommitted(cwd: string): string[]; /** * post-checkout: paths the ref move rewrote that are now clean — a checkout * that discarded an agent's edits should release its claims so a peer's later * Edit isn't falsely blocked. `oldRef`/`newRef` are the hook's $1/$2. */ export declare function collectCheckoutRemoved(cwd: string, oldRef: string, newRef: string): string[]; //# sourceMappingURL=git-hook.d.ts.map