import { type CapturePolicy } from "./capture-policy.js"; export type CaptureEvent = { source: "terminal" | "input" | "process" | "file" | "screen" | "clipboard" | "window" | "browser" | "calendar" | "notification" | "system" | "message" | "downloads" | "location" | "audio"; ts: number; data: Record; }; export declare function pushCaptureEvent(event: CaptureEvent): void; export declare function setAudioMuted(v: boolean): void; export declare function isAudioMuted(): boolean; export declare function setPrivateMode(v: boolean): void; export declare function isPrivateMode(): boolean; export declare function onPrivateModeChange(listener: (enabled: boolean) => void): () => void; /** * Get ALL events accumulated since the last drain (i.e. since the last koi turn). * Returns oldest-first (chronological). */ export declare function getAllEvents(): CaptureEvent[]; /** * Drain: return all events and clear the buffer. * Called after injecting into a koi turn so the next turn starts fresh. * If the cap dropped events since the last drain, a synthetic * `events_dropped` event is prepended so consumers can surface it. */ export declare function drainEvents(): CaptureEvent[]; export declare function getRecentEvents(opts?: { source?: CaptureEvent["source"]; limit?: number; sinceTs?: number; }): CaptureEvent[]; /** * Reap orphaned `_tmp_*` sqlite copies and their -shm/-wal sidecars from the * capture dir. The message/browser capture pollers copy source DBs here and * historically deleted only the .db (leaving ~71k sidecars, ~1.1 GB, by * 2026-07-07); a crash between copy and unlink still strands files today. * Anything `_tmp_*` older than an hour is garbage by construction. */ export declare function sweepTmpDbOrphans(): number; /** * Flush new events to disk (append-only, does NOT clear the in-memory buffer). */ export declare function shouldDeleteCaptureFile(name: string, mtimeMs: number, retentionDays: number, now?: number): boolean; export declare function flushToDisk(policy?: CapturePolicy): void;