/** * Trace Replay with Modifications — "What-if" testing for agent traces. * * Replay a recorded trace but with injected overrides to test * how the agent would behave with different tool responses. */ import type { AgentTrace } from './types'; export interface ReplayOverride { return?: any; error?: string; delay_ms?: number; drop?: boolean; } export interface ReplayConfig { trace: AgentTrace; overrides: Record; } export interface ReplayResult { trace: AgentTrace; modifications: ReplayModification[]; } export interface ReplayModification { step_index: number; tool_name: string; type: 'return_override' | 'error_injected' | 'step_dropped' | 'delay_added'; original: any; modified: any; } /** * Replay a trace with modifications applied to tool results. */ export declare function replayTrace(config: ReplayConfig): ReplayResult; export interface DeterministicReplayOptions { /** If true, verify that replayed tool calls match original exactly. */ verify: boolean; /** Tolerance for timing differences in ms (default: 0, timing not checked). */ timingToleranceMs?: number; } export interface VerificationMismatch { stepIndex: number; field: string; expected: any; actual: any; } export interface DeterministicReplayResult { passed: boolean; totalSteps: number; verifiedSteps: number; mismatches: VerificationMismatch[]; trace: AgentTrace; } /** * Replay a trace deterministically — walk through each step and optionally * verify that the exact same tool calls (name + args) happen in sequence. * Useful for regression testing with recorded traces. */ export declare function deterministicReplay(trace: AgentTrace, actualTrace: AgentTrace, options?: DeterministicReplayOptions): DeterministicReplayResult; /** * Format deterministic replay verification result. */ export declare function formatDeterministicReplay(result: DeterministicReplayResult): string; /** * Format replay results for display. */ export declare function formatReplayResult(result: ReplayResult): string; //# sourceMappingURL=replay.d.ts.map