import { C as ConversationStore, M as MemoryStoreConfig, d as SaveOptions, a as Conversation, L as LoadOptions, A as AppendOptions, e as StoreStats, Z as ZeroDBStoreConfig, R as RedisStoreConfig, S as StoreConfig } from '../ConversationStore-DgHjCpwv.mjs'; export { B as BaseStoreConfig, b as ConversationMetadata, c as StoreBackend } from '../ConversationStore-DgHjCpwv.mjs'; import { M as Message } from '../streaming.d-CUzaq8hR.mjs'; import '../common.d-iR60eBef.mjs'; /** * In-memory conversation store implementation * * Stores conversations in memory with optional LRU eviction. * Suitable for development, testing, or single-process applications. * Data is lost when the process restarts. */ declare class MemoryStore extends ConversationStore { private conversations; private accessOrder; private maxConversations; constructor(config?: Omit); save(conversationId: string, messages: Message[], options?: SaveOptions): Promise; load(conversationId: string, options?: LoadOptions): Promise; append(conversationId: string, messages: Message[], options?: AppendOptions): Promise; delete(conversationId: string): Promise; clear(): Promise; list(): Promise; exists(conversationId: string): Promise; getStats(): Promise; close(): Promise; /** * Update the access order for LRU eviction */ private updateAccessOrder; /** * Remove a conversation ID from the access order */ private removeFromAccessOrder; /** * Evict least recently used conversations if over limit */ private evictIfNeeded; /** * Clean up expired conversations * @returns Number of conversations removed */ cleanup(): Promise; /** * Get the current size of the store */ size(): number; } /** * ZeroDB-based conversation store implementation * * Stores conversations in ZeroDB NoSQL tables. * Suitable for production environments with built-in features like: * - Automatic scaling * - Real-time sync * - Built-in analytics * - Vector search capabilities */ declare class ZeroDBStore extends ConversationStore { protected config: ZeroDBStoreConfig; private _tableName; private initialized; constructor(config: ZeroDBStoreConfig); /** * Get the table name (for production ZeroDB operations) * @internal - Reserved for future ZeroDB MCP implementation */ private get tableName(); /** * Initialize the ZeroDB table (lazy initialization) */ private initialize; save(conversationId: string, messages: Message[], options?: SaveOptions): Promise; load(conversationId: string, options?: LoadOptions): Promise; append(conversationId: string, messages: Message[], options?: AppendOptions): Promise; delete(conversationId: string): Promise; clear(): Promise; list(): Promise; exists(conversationId: string): Promise; getStats(): Promise; close(): Promise; /** * Upsert a row in ZeroDB table * In a real implementation, this would use the ZeroDB MCP /zerodb-table-insert * or /zerodb-table-update commands */ private upsertRow; /** * Query a single row by conversation ID */ private queryRow; /** * Query all rows from the table */ private queryAllRows; /** * Delete a row by conversation ID */ private deleteRow; /** * Clean up expired conversations * @returns Number of conversations removed */ cleanup(): Promise; } /** * Redis-based conversation store implementation * * Stores conversations in Redis with automatic TTL support. * Suitable for production environments with multiple processes or servers. * Requires a Redis server to be running. */ declare class RedisStore extends ConversationStore { private redis; private redisConfig; private keyPrefix; constructor(config: Omit); /** * Initialize Redis connection (lazy initialization) */ private getRedis; save(conversationId: string, messages: Message[], options?: SaveOptions): Promise; load(conversationId: string, options?: LoadOptions): Promise; append(conversationId: string, messages: Message[], options?: AppendOptions): Promise; delete(conversationId: string): Promise; clear(): Promise; list(): Promise; exists(conversationId: string): Promise; getStats(): Promise; close(): Promise; /** * Get the Redis key for a conversation */ private getRedisKey; /** * Get the remaining TTL for a conversation * @param conversationId - Conversation identifier * @returns TTL in seconds, -1 if no TTL, -2 if key doesn't exist */ getTTL(conversationId: string): Promise; /** * Set a new TTL for an existing conversation * @param conversationId - Conversation identifier * @param ttl - TTL in seconds * @returns True if successful */ setTTL(conversationId: string, ttl: number): Promise; } /** * Factory function for creating conversation stores * * Provides a type-safe way to create store instances with configuration validation. */ /** * Create a conversation store based on configuration * * @param config - Store configuration * @returns Configured conversation store instance * * @example * ```typescript * // Create a memory store * const store = createStore({ type: 'memory', maxConversations: 100 }) * * // Create a Redis store * const store = createStore({ * type: 'redis', * host: 'localhost', * port: 6379, * defaultTTL: 3600 * }) * * // Create a ZeroDB store * const store = createStore({ * type: 'zerodb', * projectId: 'my-project', * apiKey: 'my-api-key', * tableName: 'conversations' * }) * ``` */ declare function createStore(config: StoreConfig): ConversationStore; /** * Type guard to check if a store is a MemoryStore */ declare function isMemoryStore(store: ConversationStore): store is MemoryStore; /** * Type guard to check if a store is a RedisStore */ declare function isRedisStore(store: ConversationStore): store is RedisStore; /** * Type guard to check if a store is a ZeroDBStore */ declare function isZeroDBStore(store: ConversationStore): store is ZeroDBStore; export { AppendOptions, Conversation, ConversationStore, LoadOptions, MemoryStore, MemoryStoreConfig, RedisStore, RedisStoreConfig, SaveOptions, StoreConfig, StoreStats, ZeroDBStore, ZeroDBStoreConfig, createStore, isMemoryStore, isRedisStore, isZeroDBStore };