Expand description
Wire types for the sqryd daemon IPC.
Every type in this module serialises as UTF-8 JSON through serde.
The wire format is versioned via the envelope_version field on
DaemonHelloResponse / ShimRegisterAck; clients negotiate
compatibility during the handshake before issuing any JSON-RPC
request or entering the shim byte-pump.
§JSON-RPC 2.0 conformance
- Requests and responses carry the mandatory
"jsonrpc": "2.0"tag enforced byJsonRpcVersion’s manual serde impls. - Response ids follow the spec exactly: a response to a request
with a missing/invalid id MUST carry
id: null;Option<JsonRpcId>onJsonRpcResponse::idis NOT markedskip_serializing_if, soNoneserialises as JSONnullinstead of being omitted. - Batches are implemented in the sqry-daemon router; this module only provides the single-request envelope types.
§shim/register
ShimRegister / ShimProtocol / ShimRegisterAck are the
Phase 8c shim handshake wire types. The router in sqry-daemon
discriminates on the very first frame:
- If the frame object has both
protocol+pidkeys (shim-shaped), the router enters the shim path and deserialises asShimRegisterwithdeny_unknown_fields. On deserialisation failure (e.g. extra keys from the hello shape, or an unknownprotocolvariant) the server writesShimRegisterAck{ accepted: false, reason: Some(..) }and closes. Not a JSON-RPC-32600— the shim client expects aShimRegisterAckas the first response, so the wire-form stays coherent. - Otherwise the router falls through to the
DaemonHellopath (JSON-RPC). A frame with neither shape is rejected with-32600 Invalid Requestandid: null.
Structs§
- Cancel
Rebuild Result daemon/cancel_rebuildsuccess result payload.- Daemon
Hello - Pre-handshake header sent as the very first frame by a CLI client.
The server responds with
DaemonHelloResponsebefore the JSON-RPC request loop begins. - Daemon
Hello Response - Server’s reply to
DaemonHello. Ifcompatibleisfalsethe server closes the connection immediately after the frame is sent. - Json
RpcError - JSON-RPC 2.0 error payload.
- Json
RpcRequest - JSON-RPC 2.0 request.
- Json
RpcResponse - JSON-RPC 2.0 response.
idisOption<JsonRpcId>with noskip_serializing_if— theNonecase serialises as JSONnull, which is exactly what the spec demands for parse-error and invalid-request responses. - Json
RpcVersion - JSON-RPC
"2.0"version tag. Manual serde impls enforce exact string match on the wire so malformed requests never leak into the method dispatcher. - Load
Result daemon/loadsuccess result payload.- Rebuild
Result daemon/rebuildsuccess result payload.- Response
Envelope - Uniform successful-response wrapper. Every successful method
response is serialised as
ResponseEnvelope<T>at the JSON-RPCresultfield — clients can rely on theResponseMetashape being present on every successful reply regardless of method. - Response
Meta - Metadata attached to every successful response. For Phase 8a
management methods the staleness fields are always absent
(
stale = false, no last_good_at, no last_error,workspace_state = None). Phase 8b populates them from the server-sideServeVerdictfor tool-method responses. - Shim
Register - Shim registration header sent as the first frame by a
sqry lsp --daemonorsqry mcp --daemonprocess. The router in sqry-daemon shape-discriminates betweenDaemonHelloand this type using#[serde(deny_unknown_fields)]. - Shim
Register Ack - Server’s reply to
ShimRegister. Ifacceptedisfalsethe server closes the connection after sending the ack and the shim client surfacesreasonto its parent process. Whenacceptedistrue,reasonis omitted from the wire form (skip-if-none).
Enums§
- Json
RpcId - JSON-RPC id:
null, integer (signed or unsigned), or string.I64coversi64::MIN..=i64::MAX;U64coversi64::MAX + 1..=u64::MAX. Serde’s untagged deserialize tries variants in order so0..=i64::MAXlands inI64andi64::MAX + 1..=u64::MAXinU64. - Json
RpcPayload - Tagged success-or-error payload. Serde
untaggedso the wire form is{... "result": ...}or{... "error": ...}, never both. - Shim
Protocol - Which client protocol the shim will pump bytes for. Phase 8c surface.
- Workspace
State - Six-state workspace lifecycle per plan Task 6 Step 1 and Amendment 2 §G.5 / §G.7.
Constants§
- ENVELOPE_
VERSION - Version of the daemon wire envelope (
DaemonHelloResponse::envelope_version,ShimRegisterAck::envelope_version).