import { MemoryFile, EntityFile } from './types.js';

declare function getCachedMemories(baseDir: string, currentVersion: number): MemoryFile[] | null;
declare function setCachedMemories(baseDir: string, memories: MemoryFile[], version: number): void;
declare function updateCacheOnWrite(baseDir: string, memory: MemoryFile): void;
declare function updateCacheOnDelete(baseDir: string, filePath: string): void;
declare function getCachedArchivedMemories(baseDir: string, currentVersion: number): MemoryFile[] | null;
declare function setCachedArchivedMemories(baseDir: string, memories: MemoryFile[], version: number): void;
declare function getCachedEntities(baseDir: string, currentVersion: number, schemaKey?: string): EntityFile[] | null;
declare function setCachedEntities(baseDir: string, entities: EntityFile[], version: number, schemaKey?: string): void;
declare function invalidateCachedEntities(baseDir: string): void;
/** Get a pre-filtered Map of episode memories (keyed by ID). Derived from hot cache. */
declare function getCachedEpisodeMap(baseDir: string, currentVersion: number): Map<string, MemoryFile> | null;
/** Build and cache the episode memory map from the full memory list. */
declare function setCachedEpisodeMap(baseDir: string, memories: MemoryFile[], version: number): Map<string, MemoryFile>;
/** Get pre-filtered rule memories. Derived from hot cache. */
declare function getCachedRuleMemories(baseDir: string, currentVersion: number): {
    all: MemoryFile[];
    byId: Map<string, MemoryFile>;
} | null;
/** Build and cache the rule memories from the full memory list. */
declare function setCachedRuleMemories(baseDir: string, memories: MemoryFile[], version: number): {
    all: MemoryFile[];
    byId: Map<string, MemoryFile>;
};
declare function getCachedQmdSearch(cacheKey: string): unknown[] | null;
declare function setCachedQmdSearch(cacheKey: string, results: unknown[]): void;
declare function clearMemoryCache(baseDir?: string): void;
declare function getMemoryCacheStats(baseDir: string): {
    hotSize: number;
    archiveSize: number;
    hotVersion: number | null;
    archiveVersion: number | null;
};

export { clearMemoryCache, getCachedArchivedMemories, getCachedEntities, getCachedEpisodeMap, getCachedMemories, getCachedQmdSearch, getCachedRuleMemories, getMemoryCacheStats, invalidateCachedEntities, setCachedArchivedMemories, setCachedEntities, setCachedEpisodeMap, setCachedMemories, setCachedQmdSearch, setCachedRuleMemories, updateCacheOnDelete, updateCacheOnWrite };
