/**
 * SQLite store for nexus.db via drizzle-orm/node-sqlite + node:sqlite (DatabaseSync).
 *
 * Separate database from tasks.db and brain.db for cross-project registry
 * and audit infrastructure. Follows the same singleton + WAL + migration
 * pattern as brain-sqlite.ts.
 *
 * nexus.db lives in ~/.cleo/ (global home) rather than per-project .cleo/,
 * since it stores cross-project data.
 *
 * @task T5365
 */
import type { DatabaseSync } from 'node:sqlite';
import type { NodeSQLiteDatabase } from 'drizzle-orm/node-sqlite';
import * as nexusSchema from './nexus-schema.js';
/** Schema version for newly created nexus databases. Single source of truth. */
export declare const NEXUS_SCHEMA_VERSION = "1.0.0";
/**
 * Returns the global-tier nexus.db path. ALWAYS under `getCleoHome()`.
 *
 * nexus.db is a cross-project registry and must live in the global CLEO
 * home directory (`~/.local/share/cleo/` on Linux via XDG). It is NEVER
 * written to a per-project `.cleo/` directory.
 *
 * @task T307
 * @epic T299
 * @why ADR-036 §Decision/Global-Tier: nexus.db is global-only. This guard
 *   throws immediately if path resolution ever drifts outside getCleoHome(),
 *   preventing silent creation of project-tier stray nexus.db files.
 * @throws {Error} If the resolved path is not under `getCleoHome()` — this
 *   indicates a code path that bypasses canonical path resolution and is a
 *   bug that must be fixed rather than silently tolerated.
 */
export declare function getNexusDbPath(): string;
/**
 * Resolve the path to the drizzle-nexus migrations folder.
 * Works from both src/ (dev via tsx) and dist/ (compiled via esbuild bundle).
 *
 * - Source layout: __dirname = src/store/ → need ../../migrations/drizzle-nexus
 * - Bundled layout: __dirname = dist/     → need ../migrations/drizzle-nexus
 */
export declare function resolveNexusMigrationsFolder(): string;
/**
 * Initialize the nexus.db SQLite database (lazy, singleton).
 * Creates the database file and tables if they don't exist.
 * Returns the drizzle ORM instance (async via sqlite-proxy).
 *
 * Uses a promise guard so concurrent callers wait for the same
 * initialization to complete (migrations are async).
 */
export declare function getNexusDb(): Promise<NodeSQLiteDatabase<typeof nexusSchema>>;
/**
 * Close the nexus.db database connection and release resources.
 */
export declare function closeNexusDb(): void;
/**
 * Reset nexus.db singleton state without saving.
 * Used during tests or when database file is recreated.
 * Safe to call multiple times.
 */
export declare function resetNexusDbState(): void;
/**
 * Get the underlying node:sqlite DatabaseSync instance for nexus.db.
 * Useful for direct PRAGMA calls or raw SQL operations.
 * Returns null if the database hasn't been initialized.
 */
export declare function getNexusNativeDb(): DatabaseSync | null;
export type { NodeSQLiteDatabase };
/**
 * Re-export nexus schema for external use.
 */
export { nexusSchema };
//# sourceMappingURL=nexus-sqlite.d.ts.map