/** * TaskStore factory — mirrors the elicitation-store factory pattern. * * Auto-detects the storage backend from config / env. Memory is the default * for single-node / development; Redis or Upstash is required for multi-node * deployments (both support pub/sub for cross-node terminal/cancel routing). * * Vercel KV is not supported (no pub/sub), matching the elicitation store. * * @module task/store/task-store.factory */ import { type RootStorage, type StorageConfig } from '@frontmcp/utils'; import { type FrontMcpLogger, type RedisOptionsInput } from '../../common'; import { type TaskStore } from './task.store'; export declare class TaskStoreNotSupportedError extends Error { constructor(message: string); } export interface TaskStoreOptions { /** Storage config (@frontmcp/utils shape). */ storage?: StorageConfig; /** Convenience: legacy redis option, mapped into `storage` when `storage` is absent. */ redis?: RedisOptionsInput; /** Key prefix for all task keys. Default `mcp:task:`. */ keyPrefix?: string; /** Logger. */ logger?: FrontMcpLogger; /** Edge runtime mode — requires distributed storage. */ isEdgeRuntime?: boolean; /** * SQLite backend options. When provided, the factory returns a * `SqliteTaskStore` instead of the utils-backed implementation. * Required for cross-invocation persistence in CLI mode. */ sqlite?: { path: string; encryption?: { secret: string; }; walMode?: boolean; ttlCleanupIntervalMs?: number; }; } export interface TaskStoreResult { store: TaskStore; type: 'memory' | 'redis' | 'upstash' | 'sqlite' | 'auto'; /** * Underlying storage instance (not populated for the SQLite backend, which * manages its own Database connection internally). */ storage?: RootStorage; } export declare function createTaskStore(options?: TaskStoreOptions): Promise; /** Synchronous memory-backed factory, primarily for tests. */ export declare function createMemoryTaskStore(options?: { keyPrefix?: string; logger?: FrontMcpLogger; }): TaskStoreResult; //# sourceMappingURL=task-store.factory.d.ts.map