import type { EmbeddingCacheEntry, EmbeddingCacheStore } from '../types/embeddings.js'; import type { MigrationResult, SchemaMigration } from '../utils/schema-migrations.js'; import { type SqliteDatabaseLike, type SqliteLikeClient } from './client.js'; import type { SqliteMigrateOptions } from './migrations.js'; /** Options for the SQLite embedding cache. */ export interface SqliteEmbeddingCacheOptions { /** The table. Defaults to `nexus_embedding_cache`. */ table?: string; /** Replaces the system clock, for tests. */ now?: () => number; } /** The versioned schema, which `migrate()` applies. */ export declare function sqliteEmbeddingCacheMigrations(options?: { table?: string; }): SchemaMigration[]; /** * Vectors in a SQLite table, for one machine's processes, or a team's through libSQL. A vector is * packed float32 in a blob, and a batch of keys is read in statements of 500. */ export declare class SqliteEmbeddingCache implements EmbeddingCacheStore { private readonly options; private readonly client; private readonly table; private readonly now; constructor(database: SqliteLikeClient | SqliteDatabaseLike, options?: SqliteEmbeddingCacheOptions); /** Applies the table's pending migrations. Never runs implicitly. */ migrate(options?: SqliteMigrateOptions): Promise; /** The vectors under these keys, in order, with `undefined` for each miss or expired entry. */ getMany(keys: readonly string[]): Promise>; /** Stores vectors, each for `ttlSeconds` when given. */ setMany(entries: readonly EmbeddingCacheEntry[], ttlSeconds?: number): Promise; /** Deletes expired vectors, returning how many went. */ purgeExpired(): Promise; }