agent-playground / Exports / PlaygroundWebSocketClient
Class: PlaygroundWebSocketClient
Table of contents
Constructors
Methods
Constructors
constructor
• new PlaygroundWebSocketClient(serverUrl, userId?, sessionId?, authToken?): PlaygroundWebSocketClient
Parameters
| Name | Type |
|---|---|
serverUrl | string |
userId? | string |
sessionId? | string |
authToken? | string |
Returns
Defined in
agent-playground/src/lib/playground/websocket-client.ts:104
Methods
connect
▸ connect(): Promise<boolean>
Connect to the WebSocket server
Returns
Promise<boolean>
Defined in
agent-playground/src/lib/playground/websocket-client.ts:114
disconnect
▸ disconnect(): void
Disconnect from the WebSocket server
Returns
void
Defined in
agent-playground/src/lib/playground/websocket-client.ts:218
updateAuth
▸ updateAuth(userId, sessionId, authToken): void
Update authentication credentials
Parameters
| Name | Type |
|---|---|
userId | string |
sessionId | string |
authToken | string |
Returns
void
Defined in
agent-playground/src/lib/playground/websocket-client.ts:258
sendMessage
▸ sendMessage(message): boolean
Send a message through the WebSocket
Parameters
| Name | Type |
|---|---|
message | Omit<IPlaygroundWebSocketMessage, "timestamp"> |
Returns
boolean
Defined in
agent-playground/src/lib/playground/websocket-client.ts:272
broadcastUpdate
▸ broadcastUpdate(data): boolean
Broadcast playground update
Parameters
| Name | Type |
|---|---|
data | TUniversalValue |
Returns
boolean
Defined in
agent-playground/src/lib/playground/websocket-client.ts:297
on
▸ on(event, handler): void
Add event listener
Parameters
| Name | Type |
|---|---|
event | string |
handler | TPlaygroundWebSocketEventHandler |
Returns
void
Defined in
agent-playground/src/lib/playground/websocket-client.ts:309
off
▸ off(event, handler): void
Remove event listener
Parameters
| Name | Type |
|---|---|
event | string |
handler | TPlaygroundWebSocketEventHandler |
Returns
void
Defined in
agent-playground/src/lib/playground/websocket-client.ts:319
getStatus
▸ getStatus(): IPlaygroundConnectionStatus
Get current connection status