/** * SQLite store for telemetry.db via drizzle-orm/node-sqlite + node:sqlite. * * Stores opt-in command telemetry in ~/.local/share/cleo/telemetry.db. * Follows the same singleton + WAL + migration pattern as memory-sqlite.ts. * Telemetry is disabled by default — check isTelemetryEnabled() before writing. * * @task T624 */ import type { DatabaseSync } from 'node:sqlite'; import type { NodeSQLiteDatabase } from 'drizzle-orm/node-sqlite'; import * as telemetrySchema from '../store/schema/telemetry-schema.js'; /** Schema version. Single source of truth. */ export declare const TELEMETRY_SCHEMA_VERSION = "1.0.0"; /** * Get the absolute path to telemetry.db in the global CLEO home directory. * Linux: ~/.local/share/cleo/telemetry.db */ export declare function getTelemetryDbPath(): string; /** * Resolve the absolute path to the drizzle-telemetry migrations folder inside * @cleocode/core, using ESM-native module resolution (T1177). * * Delegates to {@link resolveCorePackageMigrationsFolder} which handles * bundled dist/, workspace dev, and global-install layouts uniformly via * `import.meta.resolve()` + `createRequire().resolve()` fallback. */ export declare function resolveTelemetryMigrationsFolder(): string; /** * Reset the singleton (used in tests). */ export declare function resetTelemetryDbState(): void; /** * Return the raw `node:sqlite` handle for the open telemetry.db (or `null` * if not yet initialised). Exposed so the backup pipeline can issue * `PRAGMA wal_checkpoint(TRUNCATE)` + `VACUUM INTO` against the live * singleton without re-resolving the path or opening a second handle. * * Mirrors {@link getNexusNativeDb}, {@link getBrainNativeDb}, etc. * * @task T10317 — fleet snapshot coverage for every `DB_INVENTORY` entry * (Saga T10281 / Epic T10284 / E3) */ export declare function getTelemetryNativeDb(): DatabaseSync | null; /** * Initialize telemetry.db (lazy singleton). * Creates the file and runs migrations on first call. */ export declare function getTelemetryDb(): Promise>; //# sourceMappingURL=sqlite.d.ts.map