import type { Logger } from "pino"; import type { EventBus } from "../events/event-bus.js"; /** Fixed per-connection outgoing buffer size (design.md D28; task 5.6b). */ export declare const DEFAULT_CONNECTION_BUFFER_CAPACITY = 100; /** Keep-alive interval, comfortably under a typical proxy idle timeout. */ export declare const DEFAULT_KEEPALIVE_MS = 15000; /** * Manages every open SSE connection for the realtime event stream. * * Subscribes to the shared {@link EventBus} exactly once and fans each event * out to every open connection, isolating a connection whose write fails * (design.md's Multiple Concurrent Clients requirement; task 5.6) and * bounding what accumulates for a connection that stops reading without * erroring — a genuinely different failure from a write error (design.md D28; * task 5.6b). * * Per design.md D32/R21, every log call reachable from delivering an event — * fan-out, overflow, the fell-behind signal, serialisation, failing-client * isolation — MUST go through `deliveryLogger` (the stdout-only instance from * `engine.ts`), never through `lifecycleLogger`. Only connection accepted/ * closed logging uses `lifecycleLogger` (the primary logger), so an operator * diagnosing a stalled dashboard can still find stream activity in the log * view. This is enforced by {@link assertLogCycleIsClosed}, not by review. */ export declare class EventStreamHub { private readonly deliveryLogger; private readonly lifecycleLogger; private readonly bufferCapacity; private readonly keepAliveMs; private nextConnectionId; private readonly connections; private readonly unsubscribeFromBus; constructor(bus: EventBus, deliveryLogger: Logger, lifecycleLogger: Logger, bufferCapacity?: number, keepAliveMs?: number); /** Number of currently open connections. */ get connectionCount(): number; /** Open a new SSE connection and return its Response. */ open(): Response; /** Release every connection and the hub's own bus subscription. */ stop(): void; private broadcast; private isBackedUp; private deliver; private bufferEvent; private drain; private closeConnection; } //# sourceMappingURL=event-stream.d.ts.map