context-engine-mcp
Version:
Context engine MCP server for comprehensive project analysis and multi-file editing
80 lines • 1.86 kB
TypeScript
import { CacheEntry } from '../types/index.js';
export declare class CacheManager<T = unknown> {
private cache;
private accessOrder;
private cleanupInterval;
private accessCounter;
constructor();
/**
* Set a value in the cache with optional expiration
*/
set(key: string, value: T, ttlMs?: number): void;
/**
* Get a value from the cache
*/
get(key: string): T | undefined;
/**
* Check if a key exists in cache and is not expired
*/
has(key: string): boolean;
/**
* Delete a cache entry
*/
delete(key: string): boolean;
/**
* Get cache entry with metadata
*/
getWithMetadata(key: string): (CacheEntry<T> & {
key: string;
}) | undefined;
/**
* Get all cache keys
*/
keys(): string[];
/**
* Get cache size
*/
size(): number;
/**
* Clear all cache entries
*/
clear(): void;
/**
* Get cache statistics
*/
getStats(): {
size: number;
maxSize: number;
oldestEntry?: string;
newestEntry?: string;
memoryUsage: string;
};
/**
* Cleanup expired entries
*/
cleanup(): number;
/**
* Start automatic cleanup timer
*/
private startCleanupTimer;
/**
* Stop automatic cleanup timer
*/
stopCleanupTimer(): void;
/**
* Enforce maximum cache size using LRU eviction
*/
private enforceMaxSize;
/**
* Estimate memory usage (rough calculation)
*/
private estimateMemoryUsage;
/**
* Destroy the cache manager
*/
destroy(): void;
}
export declare const fileCache: CacheManager<any>;
export declare const projectCache: CacheManager<any>;
export declare const analysisCache: CacheManager<any>;
//# sourceMappingURL=cache-manager.d.ts.map