import type { CustomToolDefinition } from './custom-tool';
import type { RunState } from './run-state';
import type { FileFilter } from './tools/read-files';
import type { AgentDefinition } from '@levelcode/common/templates/initial-agents-dir/types/agent-definition';
import type { PublishedToolName } from '@levelcode/common/tools/constants';
import type { ClientToolCall, ClientToolName, LevelCodeToolOutput } from '@levelcode/common/tools/list';
import type { Logger } from '@levelcode/common/types/contracts/logger';
import type { LevelCodeFileSystem } from '@levelcode/common/types/filesystem';
import type { ToolMessage } from '@levelcode/common/types/messages/levelcode-message';
import type { PrintModeEvent } from '@levelcode/common/types/print-mode';
import type { Source } from '@levelcode/common/types/source';
import type { LevelCodeSpawn } from '@levelcode/common/types/spawn';
export type LevelCodeClientOptions = {
    apiKey?: string;
    cwd?: string;
    projectFiles?: Record<string, string>;
    knowledgeFiles?: Record<string, string>;
    agentDefinitions?: AgentDefinition[];
    maxAgentSteps?: number;
    env?: Record<string, string>;
    handleEvent?: (event: PrintModeEvent) => void | Promise<void>;
    handleStreamChunk?: (chunk: string | {
        type: 'subagent_chunk';
        agentId: string;
        agentType: string;
        chunk: string;
    } | {
        type: 'reasoning_chunk';
        agentId: string;
        ancestorRunIds: string[];
        chunk: string;
    }) => void | Promise<void>;
    /** Optional filter to classify files before reading (runs before gitignore check) */
    fileFilter?: FileFilter;
    overrideTools?: Partial<{
        [K in ClientToolName & PublishedToolName]: (input: ClientToolCall<K>['input']) => Promise<LevelCodeToolOutput<K>>;
    } & {
        read_files: (input: {
            filePaths: string[];
        }) => Promise<Record<string, string | null>>;
    }>;
    customToolDefinitions?: CustomToolDefinition[];
    fsSource?: Source<LevelCodeFileSystem>;
    spawnSource?: Source<LevelCodeSpawn>;
    logger?: Logger;
};
export type ImageContent = {
    type: 'image';
    image: string;
    mediaType: string;
};
export type TextContent = {
    type: 'text';
    text: string;
};
export type MessageContent = TextContent | ImageContent;
export type RunOptions = {
    agent: string | AgentDefinition;
    prompt: string;
    /** Content array for multimodal messages (text + images) */
    content?: MessageContent[];
    params?: Record<string, any>;
    previousRun?: RunState;
    extraToolResults?: ToolMessage[];
    signal?: AbortSignal;
    costMode?: string;
};
type RunExecutionOptions = RunOptions & LevelCodeClientOptions & {
    apiKey: string;
    fingerprintId: string;
};
export declare function run(options: RunExecutionOptions): Promise<RunState>;
/**
 * Extracts an HTTP status code from an error message string.
 * Parses common error patterns to identify the underlying status code.
 * Returns the status code if found, undefined otherwise.
 */
export declare const extractStatusCodeFromMessage: (errorMessage: string) => number | undefined;
export {};
