Expand description
JSON-RPC 2.0 line-delimited stdio mode for the red binary.
See PLAN_DRIVERS.md for the protocol spec. This module is the
sole server-side implementation of the protocol — drivers in
every language target this contract.
Loop:
- Read a line from stdin (UTF-8, terminated by
\n). - Parse it as a JSON-RPC 2.0 request envelope.
- Dispatch on
methodto the runtime. - Serialize the response as a single line on stdout, flush.
- Repeat until EOF or
closemethod received.
Errors do not crash the loop. Panics inside a method handler are
caught and reported as INTERNAL_ERROR so a buggy query cannot
kill the daemon.
Modules§
- error_
code - Stable error codes. Drivers map these to idiomatic exceptions.
Constants§
- PROTOCOL_
VERSION - Protocol version reported by the
versionmethod.
Functions§
- run
- Run the stdio JSON-RPC loop against a local in-process runtime.
- run_
remote - Run the stdio JSON-RPC loop as a proxy to a remote gRPC server.
- run_
with_ io - Same as
runbut takes explicit I/O handles. Used by tests.