/** Minimal structural types for node:sqlite (still marked experimental). */ export interface SqliteStatement { run(...params: unknown[]): { changes: number | bigint; }; get(...params: unknown[]): Record | undefined; all(...params: unknown[]): Record[]; } export interface SqliteDatabase { exec(sql: string): void; prepare(sql: string): SqliteStatement; close(): void; } export declare const SQLITE_SCHEMA_VERSION = 2; /** Probe whether node:sqlite is available on this runtime. */ export declare function sqliteAvailable(): boolean; /** * Open (creating if needed) the project database and apply the schema. * Throws when node:sqlite is unavailable — callers should probe first. */ export declare function openDatabase(twiningDir: string): SqliteDatabase; /** * Run a read-modify-write cycle inside an IMMEDIATE transaction. * WAL serializes individual statements, not statement PAIRS: two processes * can both SELECT the same row and the second UPDATE silently clobbers the * first's merge — a lost-update race the multiwriter soak reproduces. * BEGIN IMMEDIATE takes the write lock up front (waiting on busy_timeout), * making the whole cycle atomic across processes. */ export declare function withWriteTxn(db: SqliteDatabase, fn: () => T): T; /** * Serialize a float vector to a BLOB (little-endian float64 — exact * round-trip parity with the JSON file backend; float32 would silently * perturb similarity scores across backends). */ export declare function vectorToBlob(vector: number[]): Uint8Array; /** Deserialize a BLOB back into a float vector. */ export declare function blobToVector(blob: Uint8Array): number[]; //# sourceMappingURL=db.d.ts.map