Skip to main content

Module protocol

Module protocol 

Source
Expand description

Re-exports from sqry_daemon_protocol::protocol.

Phase 8c U1 extracted the wire types into the sqry-daemon-protocol leaf crate so the client-side crates (sqry-daemon-client, sqry-lsp, sqry-mcp) can depend on the wire format without pulling in the full daemon and creating a dep cycle. Keeping this module as a thin re-export shim lets every Phase 8a/8b call site inside sqry-daemon (ipc::protocol::X) continue to compile unchanged.

Structs§

CancelRebuildResult
daemon/cancel_rebuild success result payload.
DaemonHello
Pre-handshake header sent as the very first frame by a CLI client. The server responds with DaemonHelloResponse before the JSON-RPC request loop begins.
DaemonHelloResponse
Server’s reply to DaemonHello. If compatible is false the server closes the connection immediately after the frame is sent.
JsonRpcError
JSON-RPC 2.0 error payload.
JsonRpcRequest
JSON-RPC 2.0 request.
JsonRpcResponse
JSON-RPC 2.0 response. id is Option<JsonRpcId> with no skip_serializing_if — the None case serialises as JSON null, which is exactly what the spec demands for parse-error and invalid-request responses.
JsonRpcVersion
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.
RebuildResult
daemon/rebuild success result payload (schema_version 2 — see cluster-G §2.4).
ResponseEnvelope
Uniform successful-response wrapper. Every successful method response is serialised as ResponseEnvelope<T> at the JSON-RPC result field — clients can rely on the ResponseMeta shape being present on every successful reply regardless of method.
ResponseMeta
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-side ServeVerdict for tool-method responses.
ShimRegister
Shim registration header sent as the first frame by a sqry lsp --daemon or sqry mcp --daemon process. The router in sqry-daemon shape-discriminates between DaemonHello and this type using #[serde(deny_unknown_fields)].
ShimRegisterAck
Server’s reply to ShimRegister. If accepted is false the server closes the connection after sending the ack and the shim client surfaces reason to its parent process. When accepted is true, reason is omitted from the wire form (skip-if-none).

Enums§

JsonRpcId
JSON-RPC id: null, integer (signed or unsigned), or string. I64 covers i64::MIN..=i64::MAX; U64 covers i64::MAX + 1..=u64::MAX. Serde’s untagged deserialize tries variants in order so 0..=i64::MAX lands in I64 and i64::MAX + 1..=u64::MAX in U64.
JsonRpcPayload
Tagged success-or-error payload. Serde untagged so the wire form is {... "result": ...} or {... "error": ...}, never both.
ShimProtocol
Which client protocol the shim will pump bytes for. Phase 8c surface.
WorkspaceState
Six-state workspace lifecycle per plan Task 6 Step 1 and Amendment 2 §G.5 / §G.7.