Expand description
RPC protocol types for the synaps-bridge parent↔child IPC channel.
§Overview
The synaps-bridge RPC protocol enables a parent process to spawn a
long-lived “rpc child” process and communicate with it over a pair of
stdio pipes (child’s stdin / stdout). This module defines every
message type exchanged over that channel.
See also: synaps-bridge.SPEC.md §4 (path:
/home/jr/Projects/Maha-Media/synaps-bridge.SPEC.md).
§Framing
- Encoding: UTF-8, line-delimited JSON (LDJSON / NDJSON).
- One frame per line: each JSON object is terminated by a single
\n(0x0A). NoContent-Lengthheader or other envelope. - Max frame size: 1 MiB (1 048 576 bytes). Frames that exceed this
limit are considered malformed. The rpc child must emit an
RpcEvent::Errorwithid: Noneand remain alive when it encounters an oversized inbound frame. Enforcement logic lives in Task 2. - Direction: the parent writes
RpcCommandframes to the child’sstdin; the child writesRpcEventframes to itsstdout.
§Version semantics
The current protocol version is RPC_PROTOCOL_VERSION = 1. The child
emits RpcEvent::Ready immediately after startup, advertising its
protocol_version. The parent must refuse to proceed if the version does
not match its own expectation.
§Correlation
Every RpcCommand variant except RpcCommand::Shutdown carries
an id: String field. The rpc child echoes the same id in the
corresponding RpcEvent::Response frame, allowing the parent to
correlate requests and responses. The id format is opaque to the child
(UUID, monotonic counter, or any other string).
Structs§
- RpcAttachment
- A file attachment included with a
RpcCommand::Promptmessage. - Turn
Usage - Token-usage summary for a completed agent turn.
Enums§
- Assistant
Event - Granular events emitted by the assistant during a streaming turn.
- RpcCommand
- Commands sent from the parent process to the rpc child over the
child’s
stdin. - RpcEvent
- Events emitted by the rpc child to the parent over the child’s
stdout.
Constants§
- RPC_
PROTOCOL_ VERSION - Wire-format protocol version. Both sides must agree on this value;
the child advertises it in its
RpcEvent::Readyframe.