/** * Custom read-only git tools for the reviewer agent (Mode C: commit exploration). * * The reviewer's default toolbox (`createReadOnlyTools`) has no git access, and a * general bash tool is unsafe here — the reviewer processes attacker-controlled * MR content with CI credentials in the environment. These tools expose only * three read-only operations, backed by isomorphic-git (pure JS, no shell-out, * so there is no command-injection surface) and scoped to a single repo dir: * * - `git_log`: list commits (optionally the range since a base ref). * - `git_show`: a commit's message + unified diff against its first parent. * - `git_diff`: unified diff between two refs. * * Ref arguments are validated to sha/ref shapes; nothing is passed to a shell. */ import nodeFs from 'node:fs'; import type { AgentTool } from '@earendil-works/pi-agent-core'; interface GitToolOptions { /** Injectable fs for hermetic tests; defaults to node:fs. */ fs?: typeof nodeFs; } /** * Build the read-only git tools scoped to `dir` (the repo root). Returns an empty * array when `dir` is not a git repository, so callers can wire it * unconditionally. */ export declare function createGitTools(dir: string, options?: GitToolOptions): AgentTool[]; export {}; //# sourceMappingURL=git-tool.d.ts.map