/** * Storage factory — creates the appropriate storage backend based on resolved config. * * If PG is selected but fails to connect, falls back to LibSQL so the TUI * can start and the user can fix the connection via /settings. */ import type { MastraCompositeStore } from '@mastra/core/storage'; import type { MastraVector } from '@mastra/core/vector'; import type { StorageConfig } from './project.js'; export interface StorageResult { storage: MastraCompositeStore; /** The effective backend after any fallback logic has run. */ backend: 'libsql' | 'pg'; /** Non-null when PG was requested but failed — contains a user-facing warning. */ warning?: string; } /** * Create a storage instance from the resolved config. * * - `libsql` backend → LibSQLStore (always available) * - `pg` backend → PostgresStore, falls back to LibSQL on connection failure */ export declare function createStorage(config: StorageConfig): Promise; /** * Create a vector store for recall search. * Uses a separate LibSQL file to avoid bloating the main storage DB with embedding data. * For PG backends, reuses the same connection (PG handles the extra tables fine). */ export declare function createVectorStore(config: StorageConfig, effectiveBackend?: 'libsql' | 'pg'): Promise; //# sourceMappingURL=storage-factory.d.ts.map