import type { ProgressEvent, ProgressStore } from "../types.progress.ts"; /** * In-memory progress event store with optional disk spill for crash recovery. * * Events are stored per task in a ring buffer capped at MAX_PROGRESS_EVENTS_PER_TASK * (oldest events are dropped when the buffer is full). * * Disk writes are debounced (5 s per task) to avoid excessive I/O. * Files are written to `.rolebox/state/progress/{taskId}.json` using the * atomic write pattern (write to .tmp, then rename). */ export declare class InMemoryProgressStore implements ProgressStore { private store; private directory; private debounceTimers; private readonly DEBOUNCE_MS; /** Optional periodic sweeper timer. */ private _sweeperTimer; constructor(directory: string); addProgressEvent(taskId: string, event: ProgressEvent): void; getProgressStream(taskId: string, since?: string): ProgressEvent[]; clearProgress(taskId: string): void; cleanupExpired(ttlMs?: number): void; /** Update the base directory (used when DispatchManager.setStoreDirectory is called). */ setDirectory(directory: string): void; /** * Start a periodic cleanup sweeper that removes expired events. * Uses the global sweep interval from config. */ startSweeper(): void; /** Stop the periodic sweeper. */ stopSweeper(): void; /** True while the periodic cleanup sweeper timer is armed. */ isSweeping(): boolean; /** * Teardown: flush every pending debounced write through flushSync(), then * cancel any remaining debounce handle. After this returns no debounced * write can fire — the store is inert until a new event is added. */ dispose(): void; /** Exposed for testing: force-flush all pending debounced writes synchronously. */ flushSync(): void; /** Exposed for testing: access the in-memory map size. */ get taskCount(): number; private getProgressPath; private schedulePersist; private cancelPersist; private persistTask; private persistTaskSync; private writeAtomically; private writeAtomicallySync; private removeDiskFile; } //# sourceMappingURL=progress-store.d.ts.map