import { type DB } from '../storage/db.js'; import type { Config } from '../config/config.js'; export interface ServeOpts { port?: number; dataDir?: string; token?: string; /** Restore the legacy fail-fast embed preflight (probe once, exit 1 on * failure, before binding the port). Default is degraded-start. */ strictPreflight?: boolean; } export declare function serve(opts: ServeOpts): Promise; /** * Open the single boot-time DB connection. Exactly one of the three branches * below runs per boot (dataDir === ':memory:' / encryption enabled / * plaintext) — this is the ONLY `openDb()` call reached anywhere on the * pre-bind critical path (see `bootAndBind`'s doc comment above: `migrate()` * and every post-bind consumer — JobRepo, MemoryRepo, SqliteVecStore, the * worker's ExtendedHandlerCtx, the health-snapshot refresher — all reuse this * SAME handle, never open a second connection). Extracted out of `bootAndBind` * (Wave 7 boot-fix investigation) purely so this invariant is directly unit- * testable without driving the full `serve()` function, which registers * signal handlers ending in `process.exit(0)` and therefore cannot be safely * exercised in-process (see tests/doctor/schedule.test.ts's doc comment). * Byte-identical behavior to the inline branch it replaced — same pragma * order, same key-rewrap error, same plaintext warning. */ export declare function openBootDb(dataDir: string, dbPath: string, cfg: Config): { db: DB; dbKey?: string; };