/** * Miyabi MCP Bundle - Cache System * * LRU cache with TTL support for reducing redundant operations. */ import { CacheConfig } from './types.js'; /** * Enhanced LRU cache with TTL support */ export declare class SimpleCache { private cache; private config; constructor(config?: Partial); /** * Get value from cache * Returns null if not found or expired */ get(key: string): T | null; /** * Set value in cache with optional TTL */ set(key: string, data: T, ttlMs?: number): void; /** * Delete entry from cache */ delete(key: string): boolean; /** * Clear all entries from cache */ clear(): void; /** * Get or set value using factory function * If cached value exists and not expired, returns it * Otherwise, calls factory, caches result, and returns it */ getOrSet(key: string, factory: () => Promise, ttlMs?: number): Promise; /** * Invalidate entries matching a pattern * @returns Number of entries invalidated */ invalidatePattern(pattern: RegExp): number; /** * Invalidate entries with a prefix * @returns Number of entries invalidated */ invalidatePrefix(prefix: string): number; /** * Check if key exists and is not expired */ has(key: string): boolean; /** * Get current cache size */ get size(): number; /** * Get cache statistics */ getStats(): { size: number; maxSize: number; defaultTTL: number; }; } /** * Global cache instance for the MCP server */ export declare const globalCache: SimpleCache; /** * Build cache key for resource operations */ export declare function resourceCacheKey(operation: string): string; /** * Build cache key for network operations */ export declare function networkCacheKey(operation: string, ...args: string[]): string; /** * Build cache key for process operations */ export declare function processCacheKey(operation: string, pid?: number): string; //# sourceMappingURL=cache.d.ts.map