/** * Image description cache. * * Caches vision LLM responses to avoid re-processing * unchanged images across indexing runs. */ /** * Cached image description entry. */ export interface CacheEntry { /** Hash of image URL for lookup */ urlHash: string; /** Image source URL */ url: string; /** Generated description */ description: string; /** Prompt type used */ promptType: string; /** Timestamp when cached */ cachedAt: number; /** TTL expiration timestamp */ expiresAt: number; } /** * Cache configuration. */ export interface ImageCacheConfig { /** Enable caching */ enabled?: boolean; /** Cache directory (default: .cache/images) */ directory?: string; /** Cache TTL in days (default: 30) */ ttlDays?: number; } /** * Cache statistics. */ export interface CacheStats { /** Total entries in cache */ total: number; /** Entries that are still valid */ valid: number; /** Entries that have expired */ expired: number; /** Total size of cache file */ size: string; } /** * Image description cache. * * Persists image descriptions to disk to avoid re-processing * unchanged images during subsequent indexing runs. */ export declare class ImageCache { private cache; private directory; private ttlMs; private dirty; constructor(config?: ImageCacheConfig); /** * Get a cached description for an image URL. * * @param url - Image URL * @returns Cached entry or undefined if not cached/expired */ get(url: string): CacheEntry | undefined; /** * Cache a description for an image URL. * * @param url - Image URL * @param description - Generated description * @param promptType - Prompt type used */ set(url: string, description: string, promptType: string): void; /** * Check if an image URL is cached and valid. */ has(url: string): boolean; /** * Remove a cached entry. */ delete(url: string): boolean; /** * Get cache statistics. */ stats(): CacheStats; /** * Clear all cached entries. */ clear(): void; /** * Clear only expired entries. */ clearExpired(): number; /** * Save cache to disk using atomic write. * * Uses write-to-temp + rename pattern to prevent corruption from * concurrent processes or interrupted writes. */ save(): void; /** * Load cache from disk. */ private load; /** * Get the cache file path. */ private getCacheFilePath; /** * Create a hash of the image URL. */ private hashUrl; } //# sourceMappingURL=image-cache.d.ts.map