import type { Database as DatabaseType } from "better-sqlite3"; export interface OpenDatabaseOptions { /** Default: getDefaultDbPath(). Pass ":memory:" for tests. */ path?: string; /** Skip ensureRuntimeHome(); tests with in-memory or mkdtemp DBs use this. */ skipEnsureHome?: boolean; /** Override CURRENT_SCHEMA_VERSION. Tests use this to assert * downgrade-detection. Production callers MUST omit. */ targetVersion?: number; } export interface AgentRow { id: string; name: string; /** Encrypted BLOB; produced by account/credentials.ts#encryptForStorage. */ api_key: Buffer; /** Encrypted BLOB; produced by account/credentials.ts#encryptForStorage. */ claim_token: Buffer; model: string; created_at: number; updated_at: number; } export type UpsertAgentInput = Omit & { created_at?: number; updated_at?: number; }; export interface StoreHandle { readonly path: string; readonly schemaVersion: number; close(): void; getAgentByName(name: string): AgentRow | undefined; upsertAgent(row: UpsertAgentInput): AgentRow; listAgents(): AgentRow[]; deleteAgent(name: string): boolean; raw(): DatabaseType; } export declare function openDatabase(opts?: OpenDatabaseOptions): StoreHandle;