Skip to main content

UseAcpOptions

Agent Runtimes


Agent Runtimes / hooks/useAcp / UseAcpOptions

Interface: UseAcpOptions

Defined in: hooks/useAcp.tsx:116

Properties

agentId

agentId: string

Defined in: hooks/useAcp.tsx:120

Agent ID to connect to


autoConnect?

optional autoConnect?: boolean

Defined in: hooks/useAcp.tsx:122

Whether to auto-connect on mount (default: true)


onConnectionChange?

optional onConnectionChange?: (state) => void

Defined in: hooks/useAcp.tsx:130

Callback when connection state changes

Parameters

state

ConnectionState

Returns

void


onError?

optional onError?: (error) => void

Defined in: hooks/useAcp.tsx:134

Callback on error

Parameters

error

Error

Returns

void


onPermissionRequest?

optional onPermissionRequest?: (request) => void

Defined in: hooks/useAcp.tsx:132

Callback when a permission is requested

Parameters

request

PendingPermission

Returns

void


onStreamEvent?

optional onStreamEvent?: (event) => void

Defined in: hooks/useAcp.tsx:128

Callback when a stream event is received

Parameters

event

StreamEvent

Returns

void


reconnectAttempts?

optional reconnectAttempts?: number

Defined in: hooks/useAcp.tsx:124

Number of reconnection attempts (default: 3)


reconnectDelay?

optional reconnectDelay?: number

Defined in: hooks/useAcp.tsx:126

Delay between reconnection attempts in ms (default: 2000)


wsUrl

wsUrl: string

Defined in: hooks/useAcp.tsx:118

WebSocket URL of the ACP-compatible agent server