import type { CodeGenTools, ContentMessageItemToolResult, GenerateCompletionStep, ProjectFile } from "$/ai-utils";
import type { DevToolsSys } from "../core";
import { type ChildProcessByStdio } from "child_process";
import type { RunCommandCtx } from "./codegen";
import type EventEmitter from "events";
import type { Readable } from "stream";
export interface LLMToolCalls {
    name: CodeGenTools;
    input: Record<string, any>;
    id: string;
}
export interface ToolResolution {
    toolResult: string;
    isError: boolean;
    title?: string;
}
export type CommitMode = "commits" | "draft-prs" | "prs";
export interface FusionContext {
    commandCtx?: RunCommandCtx;
    checkCommand?: string;
    serverUrl: string;
    allowedCommands: RegExp[];
    commitMode: CommitMode;
    git: boolean;
    gitRemote?: string;
    gitAutoInit?: boolean;
    gitFeatureBranch?: string;
}
export interface ToolContext extends Partial<FusionContext> {
    sys: DevToolsSys;
    files: ProjectFile[];
    emitter: EventEmitter<{
        step: [GenerateCompletionStep];
    }>;
    signal: AbortSignal | undefined;
    workingDirectory: string;
}
export declare function resolveToolCalls(toolContext: ToolContext, toolCalls: LLMToolCalls[]): Promise<ContentMessageItemToolResult[]>;
interface RipgrepMatch {
    path: string;
    lineNumber: number;
    lineContent: string;
}
interface RipgrepResult {
    matches: RipgrepMatch[];
}
export declare function runRipgrep(workingDirectory: string, pattern: string, includeGlob?: string, excludeGlob?: string): Promise<RipgrepResult>;
export declare function newAbortError(): Error;
export declare function killProcess(sys: DevToolsSys, proc: ChildProcessByStdio<null, Readable, Readable> | undefined, timeout?: number): Promise<void>;
export {};
