import type { CodeGenTools, CommitMode, ContentMessageItemToolResult, FusionConfig, ProjectFile, WorkspaceFolder } from "$/ai-utils";
import type { DevToolsSys } from "../core";
import { type DevServerOrchestrator } from "./launch/dev-server-orchestrator";
import type { CodeGenEventEmitter } from "./codegen";
export interface LLMToolCalls {
    name: CodeGenTools;
    input: Record<string, any>;
    id: string;
}
export interface ToolResolution {
    toolResult: string;
    isError: boolean;
    title?: string;
}
export interface FusionContext {
    devServerOrchestrator?: DevServerOrchestrator;
    commitMode: CommitMode;
    git: boolean;
    gitRemote?: string;
    gitAutoInit?: boolean;
    gitFeatureBranch?: string;
}
export interface ToolContext extends Partial<FusionContext> {
    sys: DevToolsSys;
    files: ProjectFile[];
    emitter: CodeGenEventEmitter;
    signal: AbortSignal | undefined;
    workingDirectory: string;
    allowedCommands: RegExp[];
    bashWorkingDirectory: string;
    resolveWorkspacePath: (path: string, forceWorkspace: boolean) => {
        resolvedPath: string;
        workspaceFolder?: WorkspaceFolder;
    };
    workspaceFolders: Array<{
        path: string;
        name?: string;
    }>;
    patchFusionConfig: (patch: Partial<FusionConfig>) => void;
    readFile: (filePath: string) => Promise<string | null>;
    writeFile: (filePath: string, content: string | Uint8Array) => Promise<boolean>;
    deleteFile: (filePath: string) => Promise<boolean>;
    fileExists: (filePath: string) => Promise<boolean>;
    listDir: (dirPath: string) => Promise<string[]>;
    stat: (filePath: string) => Promise<{
        isDirectory: () => boolean;
        isFile: () => boolean;
    } | null>;
}
export declare function resolveToolCalls(toolContext: ToolContext, toolCalls: LLMToolCalls[], existingToolResults?: ContentMessageItemToolResult[]): Promise<ContentMessageItemToolResult[]>;
interface RipgrepMatch {
    path: string;
    lineNumber: number;
    lineContent: string;
}
interface RipgrepResult {
    matches: RipgrepMatch[];
}
export declare function runRipgrep(sys: DevToolsSys, bashWorkingDirectory: string, pattern: string, includeGlob?: string, excludeGlob?: string): Promise<RipgrepResult>;
export declare function newAbortError(): Error;
export {};
