Skip to main content

UseAgentRuntimeWebSocketOptions

Agent Runtimes


Agent Runtimes / hooks/useAgentRuntimes / UseAgentRuntimeWebSocketOptions

Interface: UseAgentRuntimeWebSocketOptions

Defined in: hooks/useAgentRuntimes.ts:838

Properties

agentId?

optional agentId?: string

Defined in: hooks/useAgentRuntimes.ts:849

Optional agent_id query parameter to scope the stream.


authToken?

optional authToken?: string

Defined in: hooks/useAgentRuntimes.ts:847

Auth token passed as ?token= query parameter.


autoReconnect?

optional autoReconnect?: boolean

Defined in: hooks/useAgentRuntimes.ts:851

Auto-reconnect on unexpected disconnects. Defaults to true.


baseUrl

baseUrl: string

Defined in: hooks/useAgentRuntimes.ts:845

Base URL of the agent-runtime server (e.g. http://localhost:8765). The WS path is appended automatically.


enabled?

optional enabled?: boolean

Defined in: hooks/useAgentRuntimes.ts:840

Enable/disable the connection. Defaults to true.


maxReconnectAttempts?

optional maxReconnectAttempts?: number

Defined in: hooks/useAgentRuntimes.ts:855

Maximum reconnect attempts. Unbounded by default.


onMessage?

optional onMessage?: (msg) => void

Defined in: hooks/useAgentRuntimes.ts:857

Additional callback fired for every incoming WS message.

Parameters

msg
payload?

unknown

raw

unknown

type?

string

Returns

void


reconnectDelayMs?

optional reconnectDelayMs?: number | ((attempt) => number)

Defined in: hooks/useAgentRuntimes.ts:853

Delay between reconnection attempts (ms). Defaults to 3 000.