import type { DB } from './db.js'; /** * Thrown by migrate() when the DB's applied schema is NEWER than this daemon's * SCHEMA_VERSION (issue #306) — a running service pinned to an older release * than the CLI that last migrated the datadir. Distinct from the generic * dev-facing "constant drift" Error so serve.ts can print one-line operator * guidance (run `reinstall`) instead of a stack trace, and so it can be told * apart programmatically from a genuine developer bump-the-constant mistake. */ export declare class SchemaNewerThanDaemonError extends Error { readonly dbSchema: number; readonly daemonSchema: number; constructor(dbSchema: number, daemonSchema: number); } /** * Run pending migrations. `dim` (default DEFAULT_EMBED_DIM = 1024) is * baked into any NOT-yet-applied migration file containing the * __EMBED_DIM__ placeholder (currently just 001-init's `memories_vec * FLOAT[__EMBED_DIM__]`) — i.e. it only matters for a genuinely fresh DB. * Already-applied migrations are skipped entirely (schema_version tracks * them), so passing a different `dim` against an already-migrated DB is a * harmless no-op — the historical FLOAT[N] baked in at creation time is * immutable short of the resumable re-embed procedure (migration 011, * `astramem-local reembed-dim`, docs/embed-dim-migration.md). */ export declare function migrate(db: DB, dim?: number): void; /** * Read the dim actually baked into `memories_vec` at CREATE TABLE time * (FEAT-409 AC-3) by parsing its persisted DDL out of sqlite_master — * the source of truth for what the schema really is, independent of * whatever config.embedding.dim currently says. Boot preflight compares * the PROVIDER's dim against this (not just provider self-consistency), * so a config/provider dim that drifted from the schema (e.g. someone * edited config.yaml without running `reembed-dim`) fails loud at boot * instead of surfacing as a raw sqlite-vec dimension error deep in the * first ingest. Returns null when the table doesn't exist yet (fresh DB * about to be created by migrate()) or its DDL doesn't match the * expected `FLOAT[N]` shape. */ export declare function getVecSchemaDim(db: DB): number | null;