import type { AgentTrace, TraceStep } from './types'; export declare class Recorder { private trace; constructor(metadata?: Record); addStep(step: Omit): void; getTrace(): AgentTrace; save(outputPath: string): void; /** * Monkey-patch OpenAI SDK to record calls. * Usage: recorder.patchOpenAI(require('openai')) */ patchOpenAI(openaiModule: any): void; /** * Monkey-patch Anthropic SDK to record calls. */ patchAnthropic(anthropicModule: any): void; /** * Monkey-patch Google Gemini SDK (generativelanguage API) to record calls. */ patchGemini(geminiModule: any): void; /** * Explicit Ollama support (OpenAI-compatible, patches fetch-based calls). * Ollama uses the same OpenAI chat completions format, so patchOpenAI works. * This method provides explicit labeling in traces. */ patchOllama(): void; /** * Monkey-patch Azure OpenAI SDK (different base URL, same SDK). * Azure OpenAI uses the same @azure/openai or openai SDK with azure config. */ patchAzureOpenAI(azureModule: any): void; } export type SamplingStrategy = 'random' | 'reservoir' | 'priority'; export interface PriorityRule { /** Always capture error traces */ error?: 'always'; /** Capture traces costing more than this USD amount */ cost_gt?: number; /** Capture traces longer than this duration string e.g. "10s" */ duration_gt?: string; /** Capture traces with specific tool names */ tool_used?: string; } export interface TraceSamplingConfig { /** Sampling rate 0.0-1.0 (e.g. 0.1 = 10%) */ rate: number; /** Sampling strategy */ strategy: SamplingStrategy; /** Priority rules that override the sampling rate (always captured) */ priority_rules?: PriorityRule[]; /** Random seed for reproducibility */ seed?: number; } /** * Determine if a trace should be captured based on priority rules. * Priority rules override the random sampling rate. */ export declare function matchesPriorityRule(trace: AgentTrace, rules: PriorityRule[]): boolean; /** * Create a trace sampler that decides whether to keep each trace. */ export declare function createSampler(config: TraceSamplingConfig): (trace: AgentTrace) => boolean; export declare function loadTrace(path: string): AgentTrace; //# sourceMappingURL=recorder.d.ts.map