/** * WebSocket connection pool for the delegation channel. * * Mirrors the SC-01 SseConnectionPool pattern with a 50-client cap, * 30-second heartbeat, and 64KB payload buffer limit. * * @module sidecar/server/ws/pool */ export interface WsConnection { id: string; subscribedDelegations: Set; } /** Configuration options for the WS connection pool. */ export interface WsConnectionPoolOptions { heartbeatIntervalMs?: number; maxClients?: number; bufferLimitBytes?: number; } export type PoolMessage = { type: "subscribe"; delegationId: string; } | { type: "unsubscribe"; delegationId: string; } | { type: "ping"; } | { type: "event"; payload: unknown; }; /** * Manages a pool of WebSocket connections for the delegation channel. */ export declare class WsConnectionPool { #private; constructor(opts?: WsConnectionPoolOptions); get heartbeatMs(): number; get maxPayload(): number; /** Returns the number of active WS connections. */ get clientCount(): number; /** * Register a new WS connection. * * @returns A unique connection ID. */ addClient(): string; /** Deregister a WS connection. */ removeClient(id: string): void; /** Subscribe a connection to a delegation ID. */ subscribe(id: string, delegationId: string): void; /** Unsubscribe a connection from a delegation ID. */ unsubscribe(id: string, delegationId: string): void; /** Start the heartbeat interval. */ startHeartbeat(): void; /** Stop heartbeat and clear all connections. */ stop(): void; } //# sourceMappingURL=pool.d.ts.map