/** * SseTransport — Server-Sent Events transport with HTTP polling fallback. * * Receives messages in real-time via SSE from the SignalDock v2 API. * Sends messages and acks via HTTP POST (SSE is receive-only). * Falls back to HTTP polling when SSE is unavailable or disconnects. * * @see docs/specs/SIGNALDOCK-UNIFIED-AGENT-REGISTRY.md Section 4.4 * @task T216 */ import type { ConduitMessage, Transport, TransportConnectConfig } from '@cleocode/contracts'; /** SseTransport — real-time SSE with HTTP polling fallback. */ export declare class SseTransport implements Transport { readonly name = "sse"; private state; /** * Connect to the SSE endpoint for real-time message delivery. * * If SSE connection fails, falls back to HTTP polling mode. * Auth is conveyed via query parameter (SSE doesn't support custom headers). */ connect(config: TransportConnectConfig): Promise; /** Disconnect the transport, closing SSE and clearing all state. */ disconnect(): Promise; /** * Send a message via HTTP POST. * * SSE is receive-only — all sends go through HTTP regardless of SSE state. */ push(to: string, content: string, options?: { conversationId?: string; replyTo?: string; }): Promise<{ messageId: string; }>; /** * Poll for messages. * * In SSE mode: drains the internal message buffer (no HTTP request). * In HTTP fallback mode: fetches via GET /messages/peek. */ poll(options?: { limit?: number; since?: string; }): Promise; /** Acknowledge messages via HTTP POST. */ ack(messageIds: string[]): Promise; /** * Subscribe to real-time messages. * * In SSE mode, messages are pushed to the handler as they arrive. * In HTTP fallback mode, polls on an interval. */ subscribe(handler: (message: ConduitMessage) => void): () => void; /** Establish SSE connection. Resolves when open, rejects on error. */ private connectSse; /** Handle an incoming SSE message event. */ private handleSseMessage; /** Handle SSE connection drop — attempt reconnect with backoff. */ private handleSseDisconnect; /** HTTP poll for messages (used in fallback mode). */ private httpPoll; /** Make an authenticated HTTP request to the API. */ private httpFetch; /** Throw if not connected. */ private ensureConnected; } //# sourceMappingURL=sse-transport.d.ts.map