/** * WriterQueue — single-writer serialization for hook ingestion (Phase 3, * cross-cutting §4). * * Mirrors the promise-chain mutex at * packages/core/src/services/embeddings/provider.ts:323-337. Serializes * observation persist writes so the hook fire-hose cannot starve readers * (paired with WAL + busy_timeout on the observation DB). * * Saturation: when `pending >= maxPending`, `enqueue` throws * QueueSaturatedError and the route maps it to HTTP 429 (no admission). */ export declare class QueueSaturatedError extends Error { readonly retryAfterSeconds: number; constructor(retryAfterSeconds?: number); } export declare class WriterQueue { private readonly maxPending; private tail; private pending; constructor(maxPending: number); get pendingCount(): number; get saturated(): boolean; /** * Admit `work` onto the single-writer chain. Throws QueueSaturatedError if * the queue is full (caller maps to 429). The returned promise resolves when * this work has executed (caller MAY await or fire-and-forget). * * A failure in one work item never poisons the chain: each step's * finalize-decrement runs in both resolve and reject branches. */ enqueue(work: () => Promise): Promise; } //# sourceMappingURL=writer-queue.d.ts.map