Expand description
§syncular-command — one JSON command surface over the Rust client core
The command router the conformance shim proved (JSON in, JSON out, bytes
as {"$bytes": hex}) factored into a transport-agnostic module so BOTH
the stdio conformance shim AND the FFI native core dispatch through the
same code. That keeps a single command surface, conformance-locked via
the shim: whatever the shim exercises, the FFI core inherits.
The router is generic over the Transport seam. The shim binds it to a
stdio host (transport inverted to the harness); the FFI crate binds it to
a real native HTTP+WS transport. Everything host-specific — realtime
notification draining, deferred requests, event queues — stays in each
host; only the pure method → result dispatch (and its JSON parsing) is
shared here.
Structs§
- Command
Error - The structured failure the driver protocol carries in an
error.detailsandretryablecarry the typed mutation fields to the host; non-mutation failures leave both at their defaults. - Create
Effects - Parsed side effects of a
createcommand that the host must apply to its own transport/clock (the router stays transport-agnostic). The client is already installed into theOption<SyncClient>slot bydispatch.
Functions§
- bytes_
to_ hex - bytes_
value - dispatch
- Dispatch one command against the client instance over
transport. - hex_
to_ bytes - parse_
encryption - §5.11: parse the
encryptionconfig into the client’s portable keyring. Shape:{ keys: { "<keyId>": {"$bytes": "<hex>"} }, keyIdColumns: { "<table>": "<column>" } }. Keys are 32 bytes. - parse_
headers - Parse an
activateSecurity(or rotation)headersparam: an object of string values, replacing the transport’s FULL header set. The router validates the shape at the shared chokepoint; each host applies the parsed set to its own transport (the router stays transport-agnostic). - parse_
limits - parse_
mutations - parse_
previous_ version_ context - RFC 0005 D8: parse the host’s
previousVersionContextconfig with the TS keys and defaults:enabled(default false),maxBytes8 MiB,maxRows20000,maxTables32,maxRowBytes1 MiB,maxAgeMs24h. Invalid values fail the request loudly rather than silently defaulting. - value_
bytes