Skip to main content

Module rpc_dispatch

Module rpc_dispatch 

Source
Expand description

Pure helper functions for the synaps rpc command dispatcher.

These are extracted from cmd::rpc so they can be unit-tested via cargo test --lib without hitting the binary-crate’s TUI dependencies.

See docs/rpc-protocol.md and synaps-bridge.SPEC.md §4 for the wire protocol specification these functions implement.

Constants§

MAX_FRAME_BYTES
Maximum allowed inbound frame size in bytes (1 MiB).

Functions§

accumulate_usage
Accumulate a SessionEvent::Usage payload into a TurnUsage counter.
build_user_content
map_stream_event
Map a single StreamEvent to an optional RpcEvent.
parse_frame
Parse a raw UTF-8 line into an RpcCommand, enforcing the 1 MiB frame limit.