import type { LogEntry, LogLevel, LogQuery, LogQueryResult, LogSource } from "@skaile/workspaces/types"; import type { LogSink } from "./sinks/types.js"; export interface LogStoreOptions { sessionId: string; level: LogLevel; sinks: LogSink[]; flushIntervalMs?: number; flushBatchSize?: number; } export interface RecordInput { source: LogSource; level: LogLevel; message: string; data?: Record; error?: { name: string; message: string; stack?: string; }; } /** * In-memory log buffer with periodic flush to sinks. * * The LogStore buffers log entries and flushes them to registered sinks * either when the buffer reaches a certain size, after a time interval, * or when explicitly flushed. Supports subscribing to live log entries. * * @see {@link LogStoreOptions} for configuration * @see {@link LogEntry} for the log entry format * @category Logging * @since 2.0.0 */ export declare class LogStore { private sessionId; private level; private sinks; private flushIntervalMs; private flushBatchSize; private buffer; private timer; private emitter; private closed; constructor(opts: LogStoreOptions); getLevel(): LogLevel; setLevel(level: LogLevel): void; /** Append a sink after construction. Used by bridges (e.g. OnLogBridgeSink). */ addSink(sink: LogSink): void; /** Returns true if the level is enabled. Used by createLogger to short-circuit. */ isEnabled(level: LogLevel): boolean; record(input: RecordInput): void; /** Subscribe to live entries. Returns an unsubscribe function. */ subscribe(handler: (entry: LogEntry) => void): () => void; /** * Query stored log entries. * * Queries the first sink that supports querying (typically SQLiteSink). * Returns empty result if no sink supports querying. * * @param q - Query parameters including filters and pagination * @returns Query result with matching entries */ query(q: LogQuery): LogQueryResult; /** Force-flush. SQLite writes are synchronous, so this returns once writes complete. */ flush(): void; /** * Close the log store and release resources. * * Flushes any pending entries, marks the store as closed, and closes * all registered sinks. */ close(): void; private flushSync; } //# sourceMappingURL=log-store.d.ts.map