Skip to main content

Module handler

Module handler 

Source
Expand description

WebSocket connection handler — bidirectional JSON-RPC.

Tool callback flow:

  1. Client submits proposal via proposal.submit
  2. Runtime encounters a ToolCall action
  3. WsToolExecutor sends tools.execute request to client via shared write half
  4. WsToolExecutor awaits response on a oneshot channel
  5. Client executes tool locally, sends JSON-RPC response back
  6. Handler receives the response, resolves the oneshot
  7. Runtime continues execution with the tool result

Structs§

JsonRpcError
JsonRpcMessage
JsonRpcResponse

Functions§

handle_connection
Convenience wrapper for the standalone car-server binary: accepts the WebSocket handshake on a raw TcpStream then delegates to run_dispatch. Embedders that already have a handshake-completed WebSocketStream (e.g. the future tokhn-daemon) skip this and call run_dispatch directly 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.