/** * Performance Optimization Service * * Provides caching and optimization strategies for dependency resolution: * - In-memory caching of frequently accessed lock files * - Parallel dependency downloads * - Cache warming strategies * - Event-based invalidation (PRS-017 R15) */ import type { LockFile } from './types.js'; /** * Performance optimizer with in-memory caching. * * PRS-017 R15: Cache entries are valid until explicitly invalidated * by `invalidateCache()` or `clearAllCaches()`. The previous TTL-based * approach could serve stale data (within window) or unnecessarily * re-read unchanged files (after expiry). Event-based invalidation * via `processManifestChanges()` and `processLockFileChanges()` is * always correct and immediate. */ export declare class PerformanceOptimizer { private readonly lockFileCache; private readonly manifestCache; /** * Gets a lock file from cache or loads it from disk. */ getCachedLockFile(workspaceRoot: string): Promise; /** * Gets a manifest file from cache or loads it from disk. */ getCachedManifest(manifestPath: string): Promise; private getCached; /** * Invalidates cache for a specific workspace. * Called when model.lock or model.yaml changes (event-based, PRS-017 R15). */ invalidateCache(workspaceRoot: string): void; /** * Clears all caches. */ clearAllCaches(): void; /** * Gets cache statistics. */ getCacheStats(): { lockFiles: number; manifests: number; }; /** * Normalizes a file path for cache keys. */ private normalizePath; } /** * Gets the global performance optimizer instance. */ export declare function getGlobalOptimizer(): PerformanceOptimizer; /** * Resets the global optimizer (useful for testing). */ export declare function resetGlobalOptimizer(): void;