import { JsonValue } from '@vitest-evals/core'; type MaybePromise = T | Promise; /** Replay mode used for tool recording and playback. */ type ReplayMode = "off" | "auto" | "strict" | "record"; /** Metadata attached to tool calls or errors touched by replay. */ type ReplayMetadata = { status: "recorded" | "replayed"; recordingPath: string; cacheKey: string; }; /** JSON recording persisted for one replayable tool execution. */ interface ToolRecording { writtenAt: string; toolName: string; input: TArgs; output?: TResult; error?: { message: string; type?: string; [key: string]: JsonValue | undefined; }; metadata?: Record; } /** Per-tool replay configuration for keying and sanitizing recordings. */ interface ToolReplayConfig { key?: (args: TArgs, context: TContext) => MaybePromise; sanitize?: (recording: ToolRecording) => MaybePromise>; version?: string; } /** Executes a tool call with optional recording or replay behavior. */ declare function executeWithReplay({ toolName, args, context, execute, replay, }: { toolName: string; args: TArgs; context: TContext; execute: (args: TArgs, context: TContext) => MaybePromise; replay: boolean | ToolReplayConfig | undefined; }): Promise<{ result: TResult; replay?: undefined; } | { result: TResult; replay: { status: "replayed"; recordingPath: string; cacheKey: string; }; } | { result: TResult; replay: { status: "recorded"; recordingPath: string; cacheKey: string; }; }>; /** Reads replay metadata attached to a thrown tool error. */ declare function getReplayMetadataFromError(error: unknown): ReplayMetadata | undefined; /** Converts replay metadata into the JSON-safe shape stored on tool calls. */ declare function normalizeReplayMetadata(replay: ReplayMetadata | undefined): { replay: { status: "recorded" | "replayed"; recordingPath: string; cacheKey: string; }; } | undefined; export { type ReplayMetadata, type ReplayMode, type ToolRecording, type ToolReplayConfig, executeWithReplay, getReplayMetadataFromError, normalizeReplayMetadata };