/** * Leaper Agent – Result Storage * Cache tool results, dedup identical calls, TTL-based expiry. */ export interface CachedResult { key: string; result: string; tool: string; args_hash: string; created_at: number; expires_at: number; size_bytes: number; } export interface StorageOptions { ttl_ms?: number; max_result_bytes?: number; persist?: boolean; } export interface StorageStats { total_entries: number; total_bytes: number; hit_count: number; miss_count: number; } export declare function hashArgs(args: Record): string; export declare function cacheKey(tool: string, argsHash: string): string; export declare function generatePreview(result: string, maxChars?: number): string; export declare function buildPersistedMessage(key: string, filePath: string, preview: string, totalBytes: number): string; export declare class ResultStorage { private cache; private hitCount; private missCount; private opts; constructor(opts?: StorageOptions); get(tool: string, args: Record): string | null; set(tool: string, args: Record, result: string): string; invalidate(tool: string, args: Record): boolean; invalidateAll(tool?: string): number; evictExpired(): number; stats(): StorageStats; maybePersist(result: string, maxBytes?: number): string; } export declare const globalResultStorage: ResultStorage; //# sourceMappingURL=result-storage.d.ts.map