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-completedWebSocketStreamskip this and callrun_dispatchdirectly. - handle_
connection_ unix - Convenience wrapper for the daemon-as-default Unix-socket
listener. Same shape as
handle_connectionbut accepts aUnixStream— used by the per-user UDS listener incar-server::main(default transport for FFI thin clients, since UDS is faster + permission-scoped vs localhost TCP). - run_
dispatch - Transport-neutral entry point: drives the JSON-RPC dispatch loop
against an already-handshake-completed split WebSocket. Generic
over the read half (any
Stream<Item = Result<Message, WsError>>) and the write half (a [WsSink] — type-erased so this function doesn’t templatize every downstream consumer ofWsChannel).