ZyrisDocs
Protocol specification

Messages

The envelope — a single tagged union carrying requests, responses, notes, progress, cancellation and stream control.

Every CONTROL frame carries one envelope: a tagged union whose tag field is t. It is shown as JSON here; on the wire it is msgpack unless JSON was negotiated.

{ "t": "req",      "id": 17, "method": "terminal.exec", "params": { }, "stream": { "id": 42 } }
{ "t": "res",      "id": 17, "result": { } }
{ "t": "err",      "id": 17, "error": { "code": "invalid_params", "message": "…", "retriable": false, "data": null } }
{ "t": "note",     "method": "webrtc.signal", "params": { } }
{ "t": "prog",     "id": 17, "payload": { } }
{ "t": "cancel",   "id": 17 }
{ "t": "s_credit", "stream": 42, "bytes": 262144 }
{ "t": "s_end",    "stream": 42, "trailer": { "sha256": "…" } }
{ "t": "s_err",    "stream": 42, "error": { "code": "io_error", "message": "…", "retriable": true } }
{ "t": "s_cancel", "stream": 42 }
TagDirectionPurpose
reqcaller → calleeCall a method.
rescallee → callerThe successful result of a req.
errcallee → callerThe failure of a req. See Errors.
noteeitherA one-way message with no response.
progcallee → callerOptional progress for a req, before its final answer.
cancelcaller → calleeAsk the callee to stop a req.
s_creditstream receiver → senderGrant more flow-control credit.
s_endstream senderEnd a stream cleanly, optionally with a trailer.
s_errstream senderFail a stream.
s_cancelstream receiverAbort a stream.

Methods

method is {capability}.{tool} for a capability's tools — terminal.exec — or a protocol method in the zyris.* or webrtc.* namespace, such as zyris.announce or webrtc.signal.

Request ids

  • id is a monotonically increasing u64 allocated by the sender of the req.
  • The two directions are independent id spaces.
  • A res, err, prog or cancel always refers to the receiver's view of the originating req.

The rules

  • req.stream is present if and only if the tool's declared transfer mechanism involves a stream. The request sender allocates the stream id. See Streams.
  • prog frames are optional and shaped by the tool's schema. Zero or more precede the final res or err.
  • cancel is best-effort and idempotent. A cancelled request MUST still end with exactly one res or err — normally err with code canceled. A cancel for an unknown or finished id is silently ignored.
  • Exceeding max_inflight_reqs yields err overloaded, which is retriable.

On this page