/** * Ring-buffered log entry storage with console interceptor. * * Provides a generic ring buffer data structure and a singleton * buffer that captures `[tmux-pilot]`-prefixed console output * while silencing it from Pi's TUI. */ export interface LogEntry { timestamp: Date; level: "log" | "warn" | "error"; /** Component prefix extracted from the message, e.g. "[tracker]". */ prefix: string; /** The log message text after the prefix. */ message: string; } export declare class RingBuffer { private readonly buffer; private head; private count; private readonly capacity; /** * Creates a ring buffer with the given capacity. * @param capacity Maximum number of items to hold. Default 2000. 0 disables storage. */ constructor(capacity?: number); /** * Adds an item to the buffer. If at capacity, the oldest item is overwritten. * O(1) amortised. */ push(item: T): void; /** * Returns all stored items in chronological order (oldest first). * O(N). */ toArray(): T[]; /** Removes all items from the buffer. */ clear(): void; /** Returns the current number of items in the buffer. */ get size(): number; } export declare const logBuffer: RingBuffer; /** * Patches `console.log`, `console.warn`, and `console.error` with * interceptors that capture `[tmux-pilot]`-prefixed messages into * the ring buffer while silencing them from Pi's TUI. * * Also emits a startup message to confirm installation. * Idempotent — safe to call multiple times. */ export declare function installInterceptor(): void; /** * Restores the original console methods that were patched by * installInterceptor(). Safe to call even if not installed. */ export declare function uninstallInterceptor(): void; //# sourceMappingURL=log-ring-buffer.d.ts.map