import { type PromptResult } from '@levelcode/common/util/error';
import { fastRewrite, shouldAddFilePlaceholders } from './fast-rewrite';
import { retryDiffBlocksPrompt } from './generate-diffs-prompt';
import type { PromptAiSdkFn } from '@levelcode/common/types/contracts/llm';
import type { Logger } from '@levelcode/common/types/contracts/logger';
import type { ParamsExcluding } from '@levelcode/common/types/function-params';
import type { Message } from '@levelcode/common/types/messages/levelcode-message';
type WriteFileSuccess = {
    tool: 'write_file';
    path: string;
    content: string;
    patch: string | undefined;
    messages: string[];
};
type WriteFileError = {
    tool: 'write_file';
    path: string;
    error: string;
};
export type WriteFileResult = WriteFileSuccess | WriteFileError;
/**
 * Processes a file block from the LLM response, applying edits to create updated file content.
 *
 * Returns a PromptResult to explicitly handle the abort case:
 * - `{ aborted: true }` when the user cancels the operation
 * - `{ aborted: false, value: WriteFileResult }` on success or recoverable error
 */
export declare function processFileBlock(params: {
    path: string;
    initialContentPromise: Promise<string | null>;
    newContent: string;
    messages: Message[];
    fullResponse: string;
    lastUserPrompt: string | undefined;
    clientSessionId: string;
    fingerprintId: string;
    userInputId: string;
    userId: string | undefined;
    logger: Logger;
} & ParamsExcluding<typeof handleLargeFile, 'oldContent' | 'editSnippet' | 'filePath'> & ParamsExcluding<typeof fastRewrite, 'initialContent' | 'editSnippet' | 'filePath' | 'userMessage'> & ParamsExcluding<typeof shouldAddFilePlaceholders, 'filePath' | 'oldContent' | 'rewrittenNewContent' | 'messageHistory'>): Promise<PromptResult<WriteFileResult>>;
/**
 * Handles large file edits by generating SEARCH/REPLACE blocks.
 *
 * Returns a PromptResult to explicitly handle the abort case:
 * - `{ aborted: true }` when the user cancels the operation
 * - `{ aborted: false, value: string }` on success
 * - `{ aborted: false, value: null }` if diff blocks failed to match after retry
 */
export declare function handleLargeFile(params: {
    oldContent: string;
    editSnippet: string;
    filePath: string;
    logger: Logger;
    promptAiSdk: PromptAiSdkFn;
} & ParamsExcluding<typeof retryDiffBlocksPrompt, 'oldContent' | 'diffBlocksThatDidntMatch'> & ParamsExcluding<PromptAiSdkFn, 'messages' | 'model'>): Promise<PromptResult<string | null>>;
export {};
