import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@gajae-code/agent-core"; import * as z from "zod/v4"; import type { ToolSession } from "."; import type { OutputMeta } from "./output-meta"; declare const bisectSchema: z.ZodObject<{ good: z.ZodString; bad: z.ZodDefault; run: z.ZodString; invert: z.ZodDefault; maxSteps: z.ZodDefault; stepTimeoutMs: z.ZodDefault; }, z.core.$strip>; type BisectParams = z.infer; export type BisectVerdict = "good" | "bad" | "skip"; export interface BisectStep { rev: string; verdict: BisectVerdict; } export interface BisectMarkResult { exitCode: number; output: string; } export interface BisectControllerDeps { maxSteps: number; /** SHA of the revision git currently has checked out. */ currentRev: () => Promise; /** Evaluate the predicate at the checked-out revision. */ evaluate: (rev: string) => Promise; /** Apply the verdict via `git bisect good|bad|skip` and return the raw result. */ mark: (verdict: BisectVerdict) => Promise; } export interface BisectOutcome { culprit: string | null; steps: BisectStep[]; concluded: boolean; reason?: string; } export interface BisectToolDetails { meta?: OutputMeta; culprit: string | null; invert: boolean; concluded: boolean; steps: BisectStep[]; author?: string; date?: string; subject?: string; reason?: string; } /** Parse the culprit SHA from `git bisect good|bad` output, or null when not yet converged. */ export declare function parseFirstBadCommit(output: string): string | null; /** * Map a predicate exit code to a bisect verdict. `invert` swaps the good/bad * mapping (to hunt for a fixing commit) but never reinterprets a skip. */ export declare function classifyExit(exitCode: number, invert: boolean): BisectVerdict; /** * Drive the bisect loop. Pure orchestration — every git/predicate effect is * injected — so it can be exercised deterministically without a real repo. */ export declare function runBisectController(deps: BisectControllerDeps, signal?: AbortSignal): Promise; export declare class BisectTool implements AgentTool { private readonly session; readonly name = "bisect"; readonly label = "Bisect"; readonly summary = "Find the commit that introduced a regression by driving git bisect with a shell predicate"; readonly description: string; readonly parameters: z.ZodObject<{ good: z.ZodString; bad: z.ZodDefault; run: z.ZodString; invert: z.ZodDefault; maxSteps: z.ZodDefault; stepTimeoutMs: z.ZodDefault; }, z.core.$strip>; readonly strict = true; readonly loadMode = "discoverable"; readonly intent: (args: Partial) => string; constructor(session: ToolSession); execute(_toolCallId: string, params: BisectParams, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback, _context?: AgentToolContext): Promise>; } export {};