import { IMemoryUnit, MemoryFilter, MemoryType, IMemory } from './base'; import { IMemoryStorage, IMemoryIndex } from './storage'; import { Subject } from 'rxjs'; import * as z from 'zod'; /** * Cache for memory units */ declare class MemoryCache { private cache; private maxSize; constructor(maxSize?: number); get(id: string): T | undefined; set(id: string, unit: T): void; delete(id: string): void; clear(): void; } /** * Base class for long-term memory implementations */ export declare abstract class LongTermMemory implements IMemory { protected storage: IMemoryStorage; protected index: IMemoryIndex; protected memoryType: MemoryType; protected cache: MemoryCache; protected memoryEvents$: Subject; constructor(storage: IMemoryStorage, index: IMemoryIndex, memoryType: MemoryType); /** * Create a memory unit with the appropriate type * This must be implemented by concrete classes to ensure type safety * @param content The content to store, can be either a string or an object of type C * @param schema Optional schema for validating object content * @param metadata Optional metadata for the memory unit */ abstract createMemoryUnit(content: C | string, schema?: z.ZodType, metadata?: Map): T; /** * Store a memory unit */ store(content: Omit): Promise; /** * Retrieve a memory unit by ID */ retrieve(id: string): Promise; /** * Query memory units based on filter */ query(filter: MemoryFilter): Promise; /** * Delete a memory unit */ delete(id: string): Promise; /** * Clear all memory units */ clear(): Promise; /** * Subscribe to memory events */ onEvent(callback: (unit: T) => void): void; /** * Type guard to ensure memory unit is of correct type */ abstract isMemoryUnitOfType(unit: any): unit is T; } export {};