/**
 * REPLAY - Snapshot Manager
 *
 * Captures and restores system state at intent execution time
 * for accurate replay and "what-if" analysis.
 */
import type { ID, Intent, TrustLevel, TrustScore, Timestamp } from '../../common/types.js';
import type { Policy, PolicyEvaluationContext } from '../../policy/types.js';
/**
 * Trust state snapshot at a point in time
 */
export interface TrustSnapshot {
    entityId: ID;
    score: TrustScore;
    level: TrustLevel;
    components: {
        behavioral: number;
        compliance: number;
        identity: number;
        context: number;
    };
    capturedAt: Timestamp;
}
/**
 * Policy snapshot at a point in time
 */
export interface PolicySnapshot {
    id: ID;
    name: string;
    namespace: string;
    version: number;
    checksum: string;
    definition: Policy['definition'];
    capturedAt: Timestamp;
}
/**
 * Environment context snapshot
 */
export interface EnvironmentSnapshot {
    timestamp: Timestamp;
    timezone: string;
    requestId: ID;
    custom?: Record<string, unknown>;
}
/**
 * Complete system snapshot for replay
 */
export interface SystemSnapshot {
    id: ID;
    intentId: ID;
    tenantId: ID;
    /** The original intent state */
    intent: Intent;
    /** Trust scores at execution time */
    trust: TrustSnapshot;
    /** Active policies at execution time */
    policies: PolicySnapshot[];
    /** Environment context */
    environment: EnvironmentSnapshot;
    /** Additional metadata */
    metadata: Record<string, unknown>;
    /** When this snapshot was captured */
    capturedAt: Timestamp;
    /** Version of the snapshot format */
    version: '1.0';
}
/**
 * Options for snapshot capture
 */
export interface SnapshotCaptureOptions {
    /** Include full policy definitions (larger but more accurate) */
    includePolicyDefinitions?: boolean;
    /** Include custom context data */
    customContext?: Record<string, unknown>;
    /** Metadata to attach to snapshot */
    metadata?: Record<string, unknown>;
}
/**
 * Options for snapshot restoration
 */
export interface SnapshotRestoreOptions {
    /** Override trust scores */
    trustOverride?: Partial<TrustSnapshot>;
    /** Override policies */
    policyOverrides?: Partial<PolicySnapshot>[];
    /** Override environment */
    environmentOverride?: Partial<EnvironmentSnapshot>;
}
/**
 * Restored context ready for replay
 */
export interface RestoredContext {
    intent: Intent;
    trust: TrustSnapshot;
    policies: PolicySnapshot[];
    environment: EnvironmentSnapshot;
    evaluationContext: PolicyEvaluationContext;
}
/**
 * SnapshotManager - Captures and restores system state for replay
 */
export declare class SnapshotManager {
    /**
     * Capture a complete system snapshot at the current point in time
     */
    capture(intent: Intent, trustData: {
        score: TrustScore;
        level: TrustLevel;
        components?: {
            behavioral: number;
            compliance: number;
            identity: number;
            context: number;
        };
    }, policies: Policy[], options?: SnapshotCaptureOptions): Promise<SystemSnapshot>;
    /**
     * Retrieve a snapshot by ID
     */
    get(snapshotId: ID): Promise<SystemSnapshot | null>;
    /**
     * Retrieve a snapshot by intent ID
     */
    getByIntentId(intentId: ID): Promise<SystemSnapshot | null>;
    /**
     * Restore a snapshot to create a replay context
     */
    restore(snapshotId: ID, options?: SnapshotRestoreOptions): Promise<RestoredContext | null>;
    /**
     * Delete a snapshot
     */
    delete(snapshotId: ID): Promise<boolean>;
    /**
     * List all snapshots for a tenant
     */
    listByTenant(tenantId: ID): Promise<SystemSnapshot[]>;
    /**
     * Clear all snapshots (for testing)
     */
    clear(): Promise<void>;
    /**
     * Get snapshot count
     */
    count(): Promise<number>;
}
/**
 * Create a new SnapshotManager instance
 */
export declare function createSnapshotManager(): SnapshotManager;
//# sourceMappingURL=snapshot.d.ts.map