/**
 * Cache Repository
 *
 * Repository for general-purpose caching with TTL.
 */
import type Database from 'better-sqlite3';
export interface CacheEntry {
    key: string;
    value: unknown;
    embedding?: Float32Array;
    created_at: string;
    expires_at?: string;
    hits: number;
    category?: string;
}
export interface CacheFilter {
    category?: string;
    includeExpired?: boolean;
}
export declare class CacheRepository {
    private db;
    constructor(db?: Database.Database);
    /**
     * Get cached value
     */
    get<T = unknown>(key: string): T | null;
    /**
     * Set cached value
     */
    set<T = unknown>(key: string, value: T, options?: {
        ttlMs?: number;
        category?: string;
        embedding?: Float32Array;
    }): void;
    /**
     * Get or compute cached value
     */
    getOrCompute<T>(key: string, computeFn: () => Promise<T>, options?: {
        ttlMs?: number;
        category?: string;
    }): Promise<{
        value: T;
        cached: boolean;
    }>;
    /**
     * Delete cached value
     */
    delete(key: string): boolean;
    /**
     * Delete by pattern
     */
    deleteByPattern(pattern: string | RegExp): number;
    /**
     * Delete by category
     */
    deleteByCategory(category: string): number;
    /**
     * Delete expired entries
     */
    deleteExpired(): number;
    /**
     * Clear all cache
     */
    clear(): void;
    /**
     * Check if key exists
     */
    has(key: string): boolean;
    /**
     * Get all keys
     */
    keys(filter?: CacheFilter): string[];
    /**
     * Search cache by semantic similarity
     */
    searchSimilar(queryEmbedding: Float32Array, category?: string, topK?: number): {
        key: string;
        value: unknown;
        similarity: number;
    }[];
    /**
     * Get cache statistics
     */
    getStats(): {
        totalEntries: number;
        totalHits: number;
        byCategory: Record<string, number>;
        expiredCount: number;
    };
    /**
     * Get size estimate in bytes
     */
    getSizeEstimate(): number;
    private cosineSimilarity;
}
export declare function getCacheRepository(): CacheRepository;
export declare function resetCacheRepository(): void;
