/************************** * Memory Interface * * Core memory abstractions extracted to avoid circular dependencies. * This file should NOT import from ../types.ts * * The Memory interface uses generic type parameters to work with * any message type, allowing implementations to be type-safe while * avoiding circular dependencies with the main types module. **************************/ export interface MemoryConfigBase { type: string; maxTokens?: number; maxMessages?: number; /** * Persist conversation history across `stream()` / `generate()` calls on the * agent instance. Defaults to `true` when a memory config is provided. Set to * `false` to run every call in isolation (no shared history), the same * effect as omitting `memory` entirely. */ enabled?: boolean; } /** Public API contract for memory stats. */ export interface MemoryStats { totalMessages: number; estimatedTokens: number; type: string; } export interface MinimalMessage { id: string; role: "user" | "assistant" | "system" | "tool"; parts: Array<{ type: string; }>; timestamp?: number; metadata?: Record; } /** Public API contract for memory. */ export interface Memory { add(message: M): Promise; getMessages(): Promise; clear(): Promise; getStats(): Promise; } /** Public API contract for memory persistence. */ export interface MemoryPersistence { save(agentId: string, messages: M[]): Promise; load(agentId: string): Promise; clear(agentId: string): Promise; } export declare function getTextFromMemoryParts(parts: Array<{ type: string; text?: string; }>): string; export declare function estimateTokens(messages: MinimalMessage[]): number; //# sourceMappingURL=memory-interface.d.ts.map