Expand description
WebSocket connection handler — bidirectional JSON-RPC.
Tool callback flow:
- Client submits proposal via proposal.submit
- Runtime encounters a ToolCall action
- WsToolExecutor sends tools.execute request to client via shared write half
- WsToolExecutor awaits response on a oneshot channel
- Client executes tool locally, sends JSON-RPC response back
- Handler receives the response, resolves the oneshot
- Runtime continues execution with the tool result
Structs§
Functions§
- handle_
connection - Convenience wrapper for the standalone
car-serverbinary: accepts the WebSocket handshake on a rawTcpStreamthen delegates torun_dispatch. Embedders that already have a handshake-completedWebSocketStream(e.g. the future tokhn-daemon) skip this and callrun_dispatchdirectly with the split halves. - run_
dispatch - Transport-neutral entry point: drives the JSON-RPC dispatch loop against an already-handshake-completed split WebSocket. Both the standalone car-server binary and embedders (e.g. tokhn-daemon at U7) call this same function.