export type CacheOptions = { ttl?: number; maxSize?: number; }; export type CacheEntry = { value: T; timestamp: number; ttl: number; fileHashes?: Record; authContext?: string; }; export type Cache = { get(key: string): T | undefined; set(key: string, value: T, ttl?: number): void; clear(): void; size(): number; has(cacheKey: string): boolean; }; export type FileBasedCacheEntry = { value: T; timestamp: number; ttl: number; fileHashes: Record; authContext: string; resourceHash: string; /** * Prompt + merge-logic schema version baked into the cache key. * Optional on the type so cache files written by older CLIs still parse; * entries without it fail validation against the current schema and are * dropped on read. */ schemaVersion?: string; }; export type FileModificationInfo = { filePath: string; lastModified: number; hash: string; }; export type CacheKeyComponents = { resourceId: string; authContext: string; resourceHash: string; fileHashes: Record; /** * Prompt + merge-logic schema version. Mixed into the cache key so a * version bump invalidates every prior entry without wiping disk. */ schemaVersion: string; };