import type { Lock, QueueEntry, StateAdapter } from 'chat'; import type { MemoryStorage } from '../storage/domains/memory/base.js'; /** * Chat SDK StateAdapter backed by Mastra storage. * * Thread subscriptions are persisted to the Mastra `MemoryStorage` domain * using thread metadata (`channel_subscribed`), so they survive restarts. * * Cache, locks, and dedup keys remain in-memory — they are inherently * short-lived (seconds to minutes) and don't need persistence. */ export declare class MastraStateAdapter implements StateAdapter { private memoryStore; private connected; private connectPromise; private readonly cache; private readonly locks; private readonly lists; private readonly queues; constructor(memoryStore: MemoryStorage); connect(): Promise; disconnect(): Promise; subscribe(threadId: string): Promise; unsubscribe(threadId: string): Promise; isSubscribed(threadId: string): Promise; get(key: string): Promise; set(key: string, value: T, ttlMs?: number): Promise; setIfNotExists(key: string, value: unknown, ttlMs?: number): Promise; delete(key: string): Promise; appendToList(key: string, value: unknown, options?: { maxLength?: number; ttlMs?: number; }): Promise; getList(key: string): Promise; acquireLock(threadId: string, ttlMs: number): Promise; releaseLock(lock: Lock): Promise; extendLock(lock: Lock, ttlMs: number): Promise; forceReleaseLock(threadId: string): Promise; enqueue(threadId: string, entry: QueueEntry, maxSize: number): Promise; dequeue(threadId: string): Promise; queueDepth(threadId: string): Promise; private cleanExpiredLocks; /** * Find a Mastra thread by its external (SDK) thread ID. * External thread IDs are stored in `channel_externalThreadId` metadata. */ private findThreadByExternalId; } //# sourceMappingURL=state-adapter.d.ts.map