import { processFileBlock } from '../../../process-file-block';
import type { ClientToolCall, LevelCodeToolCall, LevelCodeToolOutput } from '@levelcode/common/tools/list';
import type { RequestOptionalFileFn } from '@levelcode/common/types/contracts/client';
import type { Logger } from '@levelcode/common/types/contracts/logger';
import type { ParamsExcluding } from '@levelcode/common/types/function-params';
import type { AgentState } from '@levelcode/common/types/session-state';
type FileProcessingTools = 'write_file' | 'str_replace' | 'create_plan';
export type FileProcessing<T extends FileProcessingTools = FileProcessingTools> = {
    tool: T;
    path: string;
    toolCallId: string;
} & ({
    content: string;
    patch?: string;
    messages: string[];
} | {
    error: string;
});
export type FileProcessingState = {
    promisesByPath: Record<string, Promise<FileProcessing>[]>;
    allPromises: Promise<FileProcessing>[];
    fileChangeErrors: Extract<FileProcessing, {
        error: string;
    }>[];
    fileChanges: Exclude<FileProcessing, {
        error: string;
    }>[];
    firstFileProcessed: boolean;
};
export declare function getFileProcessingValues(state: FileProcessingState): FileProcessingState;
export declare const handleWriteFile: (params: {
    previousToolCallFinished: Promise<void>;
    toolCall: LevelCodeToolCall<"write_file">;
    agentState: AgentState;
    clientSessionId: string;
    fileProcessingState: FileProcessingState;
    fingerprintId: string;
    logger: Logger;
    prompt: string | undefined;
    userId: string | undefined;
    userInputId: string;
    requestClientToolCall: (toolCall: ClientToolCall<"write_file">) => Promise<LevelCodeToolOutput<"write_file">>;
    requestOptionalFile: RequestOptionalFileFn;
    writeToClient: (chunk: string) => void;
} & ParamsExcluding<typeof processFileBlock, "path" | "instructions" | "fingerprintId" | "initialContentPromise" | "newContent" | "messages" | "lastUserPrompt"> & ParamsExcluding<RequestOptionalFileFn, "filePath">) => Promise<{
    output: LevelCodeToolOutput<"write_file">;
}>;
export declare function postStreamProcessing<T extends FileProcessingTools>(toolCall: FileProcessing<T>, fileProcessingState: FileProcessingState, writeToClient: (chunk: string) => void, requestClientToolCall: (toolCall: ClientToolCall<T>) => Promise<LevelCodeToolOutput<T>>): Promise<LevelCodeToolOutput<T>>;
export {};
