/** * Cache interface for protocol layer (HyDE, opportunities). * Implementations live in src/adapters (e.g. Redis). */ export interface CacheOptions { /** TTL in seconds */ ttl?: number; } export interface Cache { /** * Get a cached value by key. * @returns The cached value or null if not found/expired */ get(key: string): Promise; /** * Set a value in cache with optional TTL. */ set(key: string, value: T, options?: CacheOptions): Promise; /** * Delete a cached value. * @returns true if the key existed and was removed */ delete(key: string): Promise; /** * Check if a key exists in cache. */ exists(key: string): Promise; /** * Get multiple values by keys. * @returns Array of values in same order as keys; null for missing/expired */ mget(keys: string[]): Promise<(T | null)[]>; /** * Delete all keys matching pattern (e.g. "hyde:intent:*"). * @returns Number of keys deleted */ deleteByPattern(pattern: string): Promise; } /** Cache interface for HyDE Graph operations. */ export type HydeCache = Pick; /** Cache interface for Opportunity Graph operations. */ export type OpportunityCache = Pick;