import type { ID, Intent, ControlAction, TrustLevel, TrustScore, Timestamp } from '../../common/types.js';
import type { Policy } from '../../policy/types.js';
import { SnapshotManager, type SystemSnapshot, type SnapshotCaptureOptions } from './snapshot.js';
import { ReplayComparator, type ComparisonReport, type Difference } from './comparator.js';
import { SimulationEngine } from './simulator.js';
/**
 * Options for replay execution
 */
export interface ReplayOptions {
    /** If true, don't persist any changes (simulation only) */
    dryRun?: boolean;
    /** Stop execution at a specific step */
    stopAt?: ReplayStep;
    /** Override policy for replay */
    modifyPolicy?: {
        /** Policies to use instead of snapshot */
        policies?: Policy[];
        /** Additional policies to include */
        additionalPolicies?: Policy[];
        /** Policy IDs to exclude */
        excludePolicies?: ID[];
    };
    /** Execution speed factor (1.0 = real-time, 2.0 = 2x speed, 0 = instant) */
    speedFactor?: number;
    /** Override trust score for replay */
    trustScoreOverride?: TrustScore;
    /** Override trust level for replay */
    trustLevelOverride?: TrustLevel;
    /** Generate comparison report with original */
    generateComparison?: boolean;
    /** Include detailed step execution data */
    includeStepDetails?: boolean;
}
/**
 * Steps in the replay execution
 */
export type ReplayStep = 'restore' | 'trust-evaluation' | 'policy-evaluation' | 'decision' | 'execution' | 'complete';
/**
 * Individual step in replay execution
 */
export interface ReplayStepResult {
    step: ReplayStep;
    status: 'completed' | 'skipped' | 'stopped' | 'error';
    durationMs: number;
    data?: Record<string, unknown>;
    error?: string;
}
/**
 * Result of a replay execution
 */
export interface ReplayResult {
    replayId: ID;
    intentId: ID;
    snapshotId: ID;
    tenantId: ID;
    replayedAt: Timestamp;
    /** Whether the replay completed successfully */
    success: boolean;
    /** Whether this was a dry run */
    dryRun: boolean;
    /** Execution steps */
    steps: ReplayStepResult[];
    /** Final outcome */
    outcome: {
        action: ControlAction;
        reason?: string;
        trustScore: TrustScore;
        trustLevel: TrustLevel;
        policiesApplied?: Array<{
            policyId: ID;
            policyName: string;
            action: ControlAction;
            reason?: string;
        }>;
    };
    /** Differences from original execution */
    differences: Difference[];
    /** Timing information */
    timing: {
        totalDurationMs: number;
        stepBreakdown: Record<ReplayStep, number>;
    };
    /** Comparison report if requested */
    comparison?: ComparisonReport;
    /** Error information if failed */
    error?: {
        message: string;
        step?: ReplayStep;
    };
}
/**
 * ReplayEngine - Main class for replaying intent executions
 */
export declare class ReplayEngine {
    private snapshotManager;
    private comparator;
    private simulator;
    constructor(snapshotManager?: SnapshotManager, comparator?: ReplayComparator, simulator?: SimulationEngine);
    /**
     * Replay a past intent execution
     */
    replay(intentId: ID, options?: ReplayOptions): Promise<ReplayResult>;
    /**
     * Get the snapshot manager instance
     */
    getSnapshotManager(): SnapshotManager;
    /**
     * Get the comparator instance
     */
    getComparator(): ReplayComparator;
    /**
     * Get the simulator instance
     */
    getSimulator(): SimulationEngine;
    /**
     * Capture a snapshot for an intent
     */
    captureSnapshot(intent: Intent, trustData: {
        score: TrustScore;
        level: TrustLevel;
        components?: {
            behavioral: number;
            compliance: number;
            identity: number;
            context: number;
        };
    }, policies: Policy[], options?: SnapshotCaptureOptions): Promise<SystemSnapshot>;
    /**
     * Helper to delay execution
     */
    private delay;
    /**
     * Build error result
     */
    private buildErrorResult;
    /**
     * Build stopped result
     */
    private buildStoppedResult;
}
/**
 * Create a new ReplayEngine instance
 */
export declare function createReplayEngine(): ReplayEngine;
export { SnapshotManager, createSnapshotManager, type SystemSnapshot, type TrustSnapshot, type PolicySnapshot, type EnvironmentSnapshot, type SnapshotCaptureOptions, type SnapshotRestoreOptions, type RestoredContext, } from './snapshot.js';
export { ReplayComparator, createReplayComparator, type ComparisonReport, type OriginalExecution, type ComparisonOptions, type Difference, type DifferenceType, type DifferenceSeverity, type PolicyComparison, type TimingComparison, } from './comparator.js';
export { SimulationEngine, createSimulationEngine, type CreateIntent, type SimulationContext, type SimulationResult, type BulkSimulationOptions, type BulkSimulationResult, } from './simulator.js';
//# sourceMappingURL=index.d.ts.map