import type { AccessResult, CodeGenPosition, CodeGenToolMap, CodeGenTools, CodegenTurn, ContentMessageItemImage, ContentMessageItemText, ContentMessageItemToolResult, FusionConfig, GenerateCompletionStep, Permission, ProjectFile, SessionMode, UserSource, WorkspaceFolder } from "$/ai-utils";
import type { DevToolsSys } from "../core";
import { type DevServerOrchestrator } from "./launch/dev-server-orchestrator";
import type { CodeGenEventEmitter } from "./codegen";
import { CodeGenSession } from "./codegen";
import type { Credentials } from "./credentials";
import type { LocalMCPClientManager } from "./mcp-local";
import type { createFusionStatusMonitor } from "./launch/machine-health";
export interface LLMToolCalls {
    name: CodeGenTools;
    input: Record<string, any>;
    id: string;
    abortController: AbortController;
}
export interface ToolResolution {
    structuredResult?: Record<string, any>;
    toolResult: string | (ContentMessageItemText | ContentMessageItemImage)[];
    isError: boolean;
    title?: string;
}
export interface ToolContext {
    sys: DevToolsSys;
    credentials: Credentials;
    files: ProjectFile[];
    user: UserSource;
    position: CodeGenPosition;
    emitter: CodeGenEventEmitter;
    fusionConfig: FusionConfig | undefined;
    canCollapseWorkspace: boolean;
    signal: AbortSignal;
    workingDirectory: string;
    allowedCommands: RegExp[];
    enabledTools: (keyof CodeGenToolMap)[];
    localMCPManager: LocalMCPClientManager | undefined;
    session: CodeGenSession;
    sessionMode: SessionMode;
    devServerOrchestrator?: DevServerOrchestrator;
    fusionStatusMonitor?: ReturnType<typeof createFusionStatusMonitor>;
    switchSessionMode: (mode: SessionMode) => void;
    getAllFiles: (options: {
        getDotFiles?: boolean;
        pattern?: string;
        maxFiles?: number;
    }) => Promise<string[]>;
    restore: (options: {
        location: "before" | "after";
        predicate: (turn: CodegenTurn | null, index: number) => boolean;
        dryRun?: boolean;
        revert?: boolean;
        forceReplay?: boolean;
        debug?: string;
    }) => Promise<{
        undone: string[] | null;
        message: string;
    }>;
    bashWorkingDirectory: string;
    filterText: (text: string) => string;
    resolveWorkspacePath: (path: string, forceWorkspace: boolean) => {
        resolvedPath: string;
        workspaceFolder?: WorkspaceFolder;
    };
    absolutePathToWorkspaceUrl: (absolutePath: string) => string | undefined;
    setHasPlanToApply: (value: boolean) => void;
    workspaceFolders: Array<{
        path: string;
        name?: string;
    }>;
    patchFusionConfig: (patch: Partial<FusionConfig>) => void;
    passThrough: (toolCall: LLMToolCalls, signal: AbortSignal) => Promise<ToolResolution>;
    readFile: (filePath: string) => Promise<string | null>;
    writeFile: (filePath: string, content: string | Uint8Array) => Promise<string | null>;
    deleteFile: (filePath: string) => Promise<string | null>;
    fileExists: (filePath: string) => Promise<{
        absolutePath: string | undefined;
        recommendedPath: string | undefined;
        workspaceFolder: WorkspaceFolder | undefined;
        virtual: boolean;
    }>;
    listDir: (dirPath: string) => Promise<string[]>;
    evaluateAccess: (resource: string, permission: Permission) => AccessResult;
    stat: (filePath: string) => Promise<{
        isDirectory: () => boolean;
        isFile: () => boolean;
        size: number;
    } | null>;
}
export declare function resolveToolCalls(toolContext: ToolContext, toolCalls: LLMToolCalls[], existingToolResults: ContentMessageItemToolResult[] | undefined, onStep: (step: GenerateCompletionStep) => void): 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 getRipgrepExecutable(sys: DevToolsSys): Promise<string>;
/**
 * Returns true if query is likely a string literal rather than a regex.
 * Returns false otherwise.
 * This is intended to ensure that queries such as "import {" do not get
 * interpreted as invalid regex values by ripgrep.
 * @param query - The query to check
 */
export declare const isLikelyFixedString: (query: string) => boolean;
export {};
