import { Operation, OperationResult } from "@myycontext/core";
import { OperationCache, CacheEntry } from "./OperationCache";
import { OperationFingerprintService } from "./OperationFingerprint";
import { OperationValidator, ValidationReport } from "./OperationValidator";
/**
 * Replay mode
 */
export type ReplayMode = "strict" | "lenient" | "validate-only";
/**
 * Replay result for a single operation
 */
export interface ReplayResult {
    operationId: string;
    operationType: string;
    replayed: boolean;
    source: "cache" | "re-executed" | "skipped" | "failed";
    result?: OperationResult;
    cacheEntry?: CacheEntry;
    validationReport?: ValidationReport;
    error?: string;
    durationMs: number;
}
/**
 * Batch replay result
 */
export interface BatchReplayResult {
    totalOperations: number;
    replayed: number;
    reExecuted: number;
    skipped: number;
    failed: number;
    operations: ReplayResult[];
    totalDurationMs: number;
    cacheHitRate: number;
}
/**
 * Replay validation result
 */
export interface ReplayValidation {
    canReplay: boolean;
    cacheValid: boolean;
    filesUnchanged: boolean;
    reasons: string[];
}
/**
 * OperationReplay Service
 * Provides deterministic replay of operations from cache
 */
export declare class OperationReplayService {
    private cache;
    private fingerprint;
    private validator;
    constructor(cache: OperationCache, fingerprint: OperationFingerprintService, validator: OperationValidator);
    /**
     * Replay a single operation from cache
     */
    replay(op: Operation, mode?: ReplayMode): Promise<ReplayResult>;
    /**
     * Replay a batch of operations
     */
    replayBatch(ops: Operation[], mode?: ReplayMode): Promise<BatchReplayResult>;
    /**
     * Validate if an operation can be replayed from cache
     */
    validateReplay(op: Operation): Promise<ReplayValidation>;
    /**
     * Get replay report for a batch
     */
    getReplayReport(ops: Operation[]): Promise<{
        canReplayAll: boolean;
        canReplayCount: number;
        needsReExecutionCount: number;
        invalidCacheCount: number;
        details: Array<{
            operationId: string;
            operationType: string;
            canReplay: boolean;
            reason: string;
        }>;
    }>;
    /**
     * Dry-run replay: Validate without actual replay
     */
    dryRunReplay(ops: Operation[]): Promise<{
        wouldReplay: string[];
        wouldReExecute: string[];
        wouldFail: string[];
        cacheHitRate: number;
    }>;
    /**
     * Invalidate cache for operations that need re-execution
     */
    invalidateStale(ops: Operation[]): Promise<number>;
    /**
     * Get cache statistics for a batch
     */
    getCacheStats(ops: Operation[]): Promise<{
        totalOps: number;
        cached: number;
        uncached: number;
        stale: number;
        fresh: number;
        avgCacheAge: number;
    }>;
}
//# sourceMappingURL=OperationReplay.d.ts.map