/**
 * Semantic Cache Types - Job 029
 *
 * Type definitions for the semantic caching system.
 */

export interface CacheEntry {
  prompt: string;
  promptHash: string;
  response: string;
  timestamp: number;
  model: string;
  hits: number;
  ttl?: number;  // Time-to-live in ms (optional, 0 = no expiry)
}

export interface CacheStats {
  hits: number;
  misses: number;
  entries: number;
  savedCalls: number;
  hitRate: number;
}

export interface CacheConfig {
  maxEntries: number;
  defaultTtl: number;   // ms, 0 = no expiry
  hashAlgorithm: 'simple' | 'sha256';
}

export interface SerializedCache {
  entries: CacheEntry[];
  stats: { hits: number; misses: number };
}
