/** * SQLite backend for execution history. * * Alternative to the per-photon JSONL layout in `execution-history.ts`. * Upgrades daemon audit queries (`photon ps history --method X --since 1h`) * from whole-file scans to indexed range queries. * * Runtime-agnostic loader: `bun:sqlite` under Bun, `better-sqlite3` under Node. * Falls back to JSONL if neither is available. * * Single shared database across all photons on this daemon, keyed on the * `photon` column. Indexes cover the query shapes used by the CLI and the * Beam daemon panel. */ import type { ExecutionEntry, HistoryQuery } from './execution-history.js'; import { type SqliteDatabase } from '../shared/sqlite-runtime.js'; export declare function openExecutionHistoryDatabase(path: string): Promise; export interface ExecutionHistoryBackend { record(photon: string, entry: ExecutionEntry, workingDir?: string): void; query(photon: string, q: HistoryQuery, workingDir?: string): ExecutionEntry[]; sweep(opts?: { ttlMs?: number; maxPerMethod?: number; now?: number; }): number; close(): void; } export declare class SqliteExecutionHistoryBackend implements ExecutionHistoryBackend { private db; private opts; private insert; private deleteOlderThan; constructor(db: SqliteDatabase, opts?: { ttlMs?: number; maxPerMethod?: number; }); record(photon: string, entry: ExecutionEntry, workingDir?: string): void; query(photon: string, q?: HistoryQuery, workingDir?: string): ExecutionEntry[]; /** * Apply TTL + per-method cap across every photon. * Returns the number of rows deleted. */ sweep(opts?: { ttlMs?: number; maxPerMethod?: number; now?: number; }): number; close(): void; } //# sourceMappingURL=execution-history-sqlite.d.ts.map