import type { AgentToolCallEndEvent, AgentToolCallStartEvent } from "@kenkaiiii/gg-agent"; import type { BackgroundProcess } from "../process-manager.js"; import { type VerificationGate } from "../verification-gate.js"; /** A tool call observed between its start and end events. */ export interface TrackedToolCall { name: string; args: Record; revision: number; sourceSnapshot?: string | null; } /** * Host-observed verification evidence: which files this run mutated, which * tool calls are in flight (with their pre-run workspace snapshot), and which * background checks still owe an exit code. Feeds the session's * {@link VerificationGate}; persistence stays with the session. */ export declare class VerificationTracker { private readonly gate; private readonly cwd; private readonly listProcesses; private readonly fileEditCounts; private readonly toolCalls; private readonly backgroundVerification; /** The bash tool runs under bash with pipefail (not the Windows cmd.exe * fallback), so checks with read-only commands around them may count. */ private readonly posixShell; constructor(gate: VerificationGate, cwd: string, listProcesses: () => BackgroundProcess[], posixShell?: boolean); private classify; recordFileMutated(relative: string): void; /** Per-run reset of mutated files and in-flight calls. */ resetRun(): void; /** Drop background checks whose process no longer exists. */ pruneBackground(liveProcessIds: ReadonlySet): void; clearBackground(): void; getToolCall(toolCallId: string): TrackedToolCall | undefined; /** Track a starting call. Resolves true when verification state must be persisted. */ recordToolCallStart(event: AgentToolCallStartEvent): Promise; /** * Fold a finished call into the gate. Only host-observed successful * mutations and trustworthy check results affect approval. The model's text * is never evidence. Resolves true when verification state changed. */ recordToolCallEnd(event: AgentToolCallEndEvent, call: TrackedToolCall | undefined, planMode: boolean): Promise; /** Settle every background check whose process has exited. Resolves true if any changed. */ settleFinishedBackground(): Promise; /** In-flight or unconfirmed evidence, else the gate's own problem. */ verificationProblem(): string | null; private recordFinishedBackgroundVerification; private finishSnapshotVerification; }