import type { BehaviorDashboardStats, DashboardStats, MessageStats, RequestDetails } from "./types"; /** * Progress event emitted after each session file is fully processed. * `current` is the number of files completed (skipped + parsed), * `total` is the size of the work set. `processed` is the running total * of inserted rows. */ export interface SyncProgress { current: number; total: number; processed: number; sessionFile: string; } export interface SyncOptions { /** Called after each file completes. Synchronous; keep it cheap. */ onProgress?: (event: SyncProgress) => void; /** * Worker pool size. Defaults to a sensible value derived from the host * (capped to avoid drowning a small machine in workers). Set to `1` to * force serial parsing without spawning workers. */ workers?: number; } /** * Smoke test: spawns one sync worker, pings it, asserts the pong response, * then terminates. Used by `omp --smoke-test` so the install-method CI jobs * catch the silent worker-load failure that hit compiled binaries in #1011 * and #1027 — neither `--version` nor `stats --summary` exercises the worker * spawn path on a fresh install (no session files = early return), so a * dedicated probe is the only reliable signal. * * Resolves with the worker's `import.meta.url` (caller-visible diagnostics); * rejects on transport error, error response, or timeout. */ export declare function smokeTestSyncWorker({ timeoutMs }?: { timeoutMs?: number; }): Promise; /** * Sync all session files to the database. * * Parsing fans out across a worker pool (one in-flight job per worker) * while DB writes and offset bookkeeping stay on the calling thread so the * single SQLite handle stays uncontended. `onProgress` fires once per * completed file (skipped files included so the bar walks at a steady * rate). */ export declare function syncAllSessions(opts?: SyncOptions): Promise<{ processed: number; files: number; }>; /** * Get all dashboard stats. */ export declare function getDashboardStats(range?: string | null): Promise; export declare function getOverviewStats(range?: string | null): Promise>; export declare function getModelDashboardStats(range?: string | null): Promise>; export declare function getCostDashboardStats(range?: string | null): Promise>; export declare function getRecentRequests(limit?: number): Promise; export declare function getRecentErrors(limit?: number): Promise; export declare function getRequestDetails(id: number): Promise; /** * Get the current message count in the database. */ export declare function getTotalMessageCount(): Promise; export declare function getBehaviorDashboardStats(range?: string | null): Promise;