import { type BuildLockHolder } from '../pipeline/build-lock.js'; import type { BuildResult } from '../pipeline/orchestrator.js'; export type RebuildEvent = { kind: 'start'; files: string[]; } | { kind: 'built'; files: string[]; result: Extract; durationMs: number; } | { kind: 'deferred'; files: string[]; retryInMs: number; holder?: BuildLockHolder; } | { kind: 'stalled'; files: string[]; waitedMs: number; holder?: BuildLockHolder; } | { kind: 'skipped'; files: string[]; message: string; } | { kind: 'failed'; files: string[]; error: unknown; }; export interface RebuildQueueOptions { /** Runs one rebuild covering the given changed files. */ build: (files: string[]) => Promise; onEvent: (e: RebuildEvent) => void; /** Delay before retrying a batch whose build found the lock held. Default 2000ms. */ retryDelayMs?: number; /** * How long to keep retrying a lock-deferred batch before reporting it as * stalled and waiting for the next change instead. Default 10 minutes. */ maxDeferMs?: number; } export interface RebuildQueue { enqueue(files: string[]): void; stop(): void; } /** * Serializes watch-triggered rebuilds. Changes that arrive while a build runs * are folded into the next one, and a batch whose build found the build lock * held (another process's build, or a session-start/init background build) is * kept and retried. Each change batch used to start its own fire-and-forget * build, so a lock-skipped batch was dropped for good while the log still said * the rebuild completed (#338). */ export declare function createRebuildQueue(opts: RebuildQueueOptions): RebuildQueue; /** One log line per event, stating what actually happened to the graph. */ export declare function describeRebuildEvent(e: RebuildEvent, repoPath: string): string; //# sourceMappingURL=rebuild-queue.d.ts.map