interface ProtocolWebSocketTransportOptionsHeaders applied to every request.
The configured API key, when present, is added as the x-api-key
header after these defaults are initialized.
Maximum reconnect attempts after an unexpected SSE disconnect. Defaults to 5. Set to 0 to disable automatic reconnection.
Called before each SSE reconnect attempt (after backoff delay).
Invoked after the socket has been re-established. Use to restore
server-side subscription state (see ThreadStream).
Hook for inspecting or mutating a request before it is sent.
Receives the resolved URL and prepared RequestInit; return the
original init or a replacement object to continue the request.
Override the default /threads/:threadId/... protocol paths.
Backoff before each SSE reconnect attempt. Defaults to
webSocketReconnectDelayMs from ./websocket.js.
Thread ID this transport currently targets.
Optional WebSocket factory. Supplying it flips the adapter into WebSocket mode ā SSE is bypassed entirely.