/**
 * A3I Cache Layer
 *
 * Fast data layer (Agent Anchor AI) for caching trust scores, agent data,
 * and batching attestations for sync to the primary database.
 *
 * @packageDocumentation
 */
import type { Agent, Attestation } from "@vorionsys/contracts/db";
export interface CachedTrustScore {
    score: number;
    tier: number;
    cachedAt: number;
    stale: boolean;
}
export interface CachedAgent {
    agent: Agent;
    cachedAt: number;
}
export interface A3ISyncStatus {
    lastSyncAt: number;
    pendingAttestations: number;
    syncLagMs: number;
    healthy: boolean;
}
export interface A3ICacheConfig {
    agentTtl?: number;
    trustScoreTtl?: number;
    batchSize?: number;
    flushIntervalMs?: number;
}
export declare class A3ICacheService {
    private redis;
    private config;
    private flushTimer;
    private attestationBuffer;
    constructor(config?: A3ICacheConfig);
    /**
     * Start the cache service (begin periodic flush)
     */
    start(): void;
    /**
     * Stop the cache service
     */
    stop(): Promise<void>;
    /**
     * Cache an agent
     */
    cacheAgent(agent: Agent): Promise<void>;
    /**
     * Get cached agent
     */
    getCachedAgent(carId: string): Promise<CachedAgent | null>;
    /**
     * Invalidate agent cache
     */
    invalidateAgent(carId: string): Promise<void>;
    /**
     * Cache a trust score
     */
    cacheTrustScore(carId: string, score: number, tier: number): Promise<void>;
    /**
     * Get cached trust score
     */
    getCachedTrustScore(carId: string): Promise<CachedTrustScore | null>;
    /**
     * Get trust score with cache (returns cached if available, otherwise null)
     */
    getTrustScoreFast(carId: string): Promise<{
        score: number;
        tier: number;
        cached: boolean;
        cacheAge?: number;
    } | null>;
    /**
     * Invalidate trust score cache
     */
    invalidateTrustScore(carId: string): Promise<void>;
    /**
     * Queue an attestation for batch processing
     */
    queueAttestation(carId: string, attestation: Partial<Attestation>): Promise<void>;
    /**
     * Flush attestation buffer to primary storage
     *
     * This is a placeholder - actual implementation would call the
     * AgentRegistryService to process attestations
     */
    flushAttestations(): Promise<number>;
    /**
     * Get pending attestation count
     */
    getPendingAttestationCount(): Promise<number>;
    /**
     * Update sync status
     */
    updateSyncStatus(status: Partial<A3ISyncStatus>): Promise<void>;
    /**
     * Get sync status
     */
    getSyncStatus(): Promise<A3ISyncStatus | null>;
    /**
     * Check cache health
     */
    healthCheck(): Promise<{
        healthy: boolean;
        latencyMs: number;
        details: Record<string, unknown>;
    }>;
}
export declare function createA3ICacheService(config?: A3ICacheConfig): A3ICacheService;
export declare function getA3ICacheService(): A3ICacheService;
//# sourceMappingURL=a3i-cache.d.ts.map