car-proto 0.50.0

JSON-RPC protocol types for Common Agent Runtime client-server communication
Documentation

car-proto

JSON-RPC 2.0 protocol types for Common Agent Runtime client-server communication.

What it does

Shared serde-defined types used by both car-server-core (server) and any Rust client. Single source of truth for request / response / notification shapes so the server and clients can't drift.

The protocol is bidirectional over WebSocket:

  • Client → Serversession.init, tools.register, proposal.submit, verify, etc.
  • Server → Client (callback)tools.execute (awaits a response)
  • Server → Client (notification)host.event, voice.event (no response expected)

Every connection that uses the protocol-v2 host/auth surface negotiates the exact PROTOCOL_VERSION through server.handshake {"protocol_version": 2}. Auth-enabled daemons require a successful session.auth response first. Until negotiation succeeds, host.subscribe and auth.* fail with -32005; a missing, malformed, or different version fails with -32006. Negotiation state belongs to the WebSocket session, so reconnects negotiate again.

Where it fits

If you're building a Rust WebSocket client to talk to car-server, depend on this crate to get type-safe request/response handling. For other languages, the wire format is documented in docs/websocket-protocol.md — reach for raw JSON.