/** * LibSQL storage adapter. */ import type { Client } from "@libsql/client"; import type { IAgentRegistry, IModelRegistry, KernlStorage, Transaction } from "kernl"; import { LibSQLThreadStore } from "./thread/store.js"; import { LibSQLMemoryStore } from "./memory/store.js"; /** * LibSQL storage configuration. */ export interface LibSQLStorageConfig { /** * LibSQL client instance. */ client: Client; /** * Original connection URL (optional). * * Used to detect local file databases for setting SQLite PRAGMAs. * Not needed if using a pre-configured client. */ url?: string; } /** * LibSQL storage adapter. * * Storage is lazily initialized on first use via `ensureInit()`. This means * callers don't need to explicitly call `init()` - it happens automatically. */ export declare class LibSQLStorage implements KernlStorage { private client; private url?; private initPromise; threads: LibSQLThreadStore; memories: LibSQLMemoryStore; constructor(config: LibSQLStorageConfig); /** * Ensure storage is initialized before any operation. * * Safe to call multiple times - initialization only runs once. */ private ensureInit; /** * Bind runtime registries to storage. */ bind(registries: { agents: IAgentRegistry; models: IModelRegistry; }): void; /** * Execute a function within a transaction. */ transaction(fn: (tx: Transaction) => Promise): Promise; /** * Initialize the storage backend. */ init(): Promise; /** * Check if this is a local file or in-memory database. */ private isLocal; /** * Close the storage backend and cleanup resources. */ close(): Promise; /** * Run migrations to ensure all required tables exist. */ migrate(): Promise; /** * Create a table from its definition. */ private createTable; } //# sourceMappingURL=storage.d.ts.map