/** * LibSQL Thread store implementation. */ import type { Client } from "@libsql/client"; import { type IAgentRegistry, type IModelRegistry, type ThreadStore, type NewThread, type ThreadUpdate, type ThreadInclude, type ThreadListOptions, type ThreadHistoryOptions } from "kernl"; import { Thread, type ThreadEvent } from "kernl/internal"; import { type ThreadRecord } from "@kernl-sdk/storage"; /** * LibSQL Thread store implementation. * * All async methods call `ensureInit()` before database operations * to ensure schema/tables exist. */ export declare class LibSQLThreadStore implements ThreadStore { private db; private registries; private ensureInit; constructor(db: Client, ensureInit: () => Promise); /** * Bind runtime registries for hydrating Thread instances. */ bind(registries: { agents: IAgentRegistry; models: IModelRegistry; }): void; /** * Get a thread by id. */ get(tid: string, include?: ThreadInclude): Promise; /** * List threads matching the filter. */ list(options?: ThreadListOptions): Promise; /** * Insert a new thread into the store. */ insert(thread: NewThread): Promise; /** * Update thread runtime state. */ update(tid: string, patch: ThreadUpdate): Promise; /** * Delete a thread and cascade to thread_events. */ delete(tid: string): Promise; /** * Get the event history for a thread. */ history(tid: string, opts?: ThreadHistoryOptions): Promise; /** * Append events to the thread history. * * Semantics: * - Guaranteed per-thread ordering via monotonically increasing `seq` * - Idempotent on `(tid, event.id)`: duplicate ids MUST NOT create duplicate rows * - Events maintain insertion order */ append(events: ThreadEvent[]): Promise; /** * Hydrate a Thread instance from a database record. */ hydrate(thread: { record: ThreadRecord; events?: ThreadEvent[]; }): Thread; } //# sourceMappingURL=store.d.ts.map