import { S as StorageAdapter, A as AgentConfig, a as AgentData, T as ThreadConfig, b as ThreadData, M as MessageRole, c as MessageAttachment, d as MessageData } from '../index-BajTtLGW.js'; /** * Upstash Redis configuration */ interface UpstashStorageConfig { /** * Upstash Redis REST URL * @example "https://your-redis.upstash.io" */ url: string; /** * Upstash Redis REST token */ token: string; /** * Optional key prefix for multi-tenancy * @default "snap-agent" */ prefix?: string; } /** * Upstash Redis Storage Adapter * * Edge-compatible persistent storage using Upstash Redis REST API. * Works with Cloudflare Workers, Vercel Edge, Deno Deploy, and any WinterCG runtime. * * @example * ```typescript * import { UpstashStorage } from '@snap-agent/core/storage'; * * const storage = new UpstashStorage({ * url: process.env.UPSTASH_REDIS_REST_URL!, * token: process.env.UPSTASH_REDIS_REST_TOKEN!, * }); * * const client = createClient({ * storage, * providers: { openai: { apiKey: process.env.OPENAI_API_KEY! } }, * }); * ``` */ declare class UpstashStorage implements StorageAdapter { private url; private token; private prefix; constructor(config: UpstashStorageConfig); private command; private pipeline; private key; private generateId; createAgent(config: AgentConfig): Promise; getAgent(agentId: string): Promise; updateAgent(agentId: string, updates: Partial): Promise; deleteAgent(agentId: string): Promise; listAgents(userId: string, organizationId?: string): Promise; createThread(config: ThreadConfig): Promise; getThread(threadId: string): Promise; updateThread(threadId: string, updates: Partial): Promise; deleteThread(threadId: string): Promise; listThreads(filters: { userId?: string; agentId?: string; organizationId?: string; }): Promise; addMessage(threadId: string, role: MessageRole, content: string, attachments?: MessageAttachment[], metadata?: Record): Promise; getMessages(threadId: string, limit?: number): Promise; getConversationContext(threadId: string, maxMessages?: number): Promise>; private parseStoredAgent; private parseStoredThread; /** * Test connection to Upstash Redis */ ping(): Promise; /** * Clear all data with this prefix (use with caution!) */ clear(): Promise; /** * Get storage statistics */ getStats(): Promise<{ agents: number; threads: number; }>; } export { UpstashStorage, type UpstashStorageConfig };