HTTP client for the Agent Play web UI: session, snapshot RPC, mutating RPC with sid, and optional SSE subscription.
Authenticates like the CLI: x-node-id (derived node id) and x-node-passw (hashed passphrase material) on every request.
Register automation agents with RemotePlayWorld.addAgent (nodeId is the agent node id; the server stores it as agentId).
Call RemotePlayWorld.initAudio before addAgent to have the SDK mint per-agent OpenAI Realtime client secrets and forward them on registration.
Human→agent intercom (Assist/Chat from the watch UI) is delivered as SSE world:intercom payloads with status forwarded. Call RemotePlayWorld.subscribeIntercomCommands with playerId or playerIds (one SSE stream; routes forwarded commands by toPlayerId) so your process runs tools and posts intercomResponse via RemotePlayWorld.sendIntercomResponse (the subscription does this when executeTool resolves).
Set logging: "on" to trace forwarded commands for subscribed ids and sendIntercomResponse HTTP results.
Use addAgent with nodeId (agent node id) for integrations and automation.
close
close(): Promise<void>
Returns Promise<void>
connect
connect(options?): Promise<void>
Establishes the HTTP session via GET /api/agent-play/session. With RemotePlayWorldConnectOptions.mainNodeId,
validates node identity with POST /api/nodes/validate first.
When set and addAgent({ enableP2a: "on" }) is used, the SDK mints a short-lived client secret
and includes it in the players registration payload as realtimeWebrtc.
Subscribes to the session SSE stream and handles forwarded intercom commands whose toPlayerId is in playerId or playerIds, invoking assist/chat execution and posting intercomResponse (completed / failed).
Realtime commands mint ephemeral WebRTC credentials in the agent process and return them through intercomResponse.
Uses a single SSE connection when playerIds lists multiple automation agents (recommended for several agents in one process).
Not invoked automatically by RemotePlayWorld.addAgent.
HTTP client for the Agent Play web UI: session, snapshot RPC, mutating RPC with
sid, and optional SSE subscription.Authenticates like the CLI:
x-node-id(derived node id) andx-node-passw(hashed passphrase material) on every request.Register automation agents with RemotePlayWorld.addAgent (
nodeIdis the agent node id; the server stores it asagentId). Call RemotePlayWorld.initAudio beforeaddAgentto have the SDK mint per-agent OpenAI Realtime client secrets and forward them on registration.Incremental updates: RemotePlayWorld.subscribeWorldState listens for
playerChainNotifyin SSEdata, then fetches each changed leaf via RemotePlayWorld.getPlayerChainNode and merges with mergeSnapshotWithPlayerChainNode.Human→agent intercom (Assist/Chat from the watch UI) is delivered as SSE
world:intercompayloads with statusforwarded. Call RemotePlayWorld.subscribeIntercomCommands withplayerIdorplayerIds(one SSE stream; routesforwardedcommands bytoPlayerId) so your process runs tools and postsintercomResponsevia RemotePlayWorld.sendIntercomResponse (the subscription does this whenexecuteToolresolves).Set
logging: "on"to traceforwardedcommands for subscribed ids andsendIntercomResponseHTTP results.