pub enum Request {
Show 15 variants
RegisterService {
name: String,
backend: BackendSpec,
allow: Vec<String>,
},
Status,
Invite {
services: Vec<String>,
},
Pair {
invite_line: String,
},
PeerRemove {
petname: String,
},
PeerRename {
user_id: Option<String>,
petname: Option<String>,
to: String,
},
OpenSession {
peer: String,
service: String,
},
RosterInstall {
path: String,
org_root_pk: Option<String>,
},
OrgJoin {
org_id: String,
org_root_pk: String,
user_id: String,
user_key: String,
},
SetRosterUrl {
url: String,
},
BlobPublish {
scope: String,
path: String,
},
BlobGrant {
scope: String,
principal: String,
},
BlobList,
BlobFetch {
ticket: String,
dest_path: String,
},
AuditSummary,
}Expand description
Control-API requests. Serialized as { "method": "...", "params": {...} }
(JSON-RPC-shaped; the id/jsonrpc envelope is added by the transport layer).
Clients construct and serialize requests via this enum. Servers dispatch on the
method string and deserialize params per-method — tolerating omitted / null /
empty-object params for parameterless methods — rather than deserializing a whole
message into Request (adjacent tagging rejects params:{} for unit variants).
This keeps the wire tolerant for third-party clients (§6.1 versioned surface).
Use method_of to extract the tag, then match + deserialize params per-method.
Variants§
RegisterService
Register/update a [services.*] entry idempotently (spec §6.1).
Status
Invite
Mint a one-time pairing invite granting services (spec §4.2). The daemon
answers an InviteResult carrying the copyable mcpmesh-invite: line. Tag
"invite" (snake_case). method_of needs no per-variant arm — it reads the
method string generically; the tag comes from rename_all.
Pair
Redeem a pairing invite (spec §4.2). The daemon dials the inviter named by
invite_line on mcpmesh/pair/1, proves the secret, writes the mutual
(dial-back) [PeerEntry], and answers a PairResult. Tag "pair"
(snake_case); method_of reads the method string generically.
[PeerEntry]: crate — the durable allowlist row lives in the daemon crate.
PeerRemove
Remove a paired peer by petname (spec §4.2, mcpmesh pair --remove). The daemon drops the
peer’s [PeerEntry] (identity) AND revokes its access by removing the petname from every
[services.*].allow (authorization) — the inverse of the pairing grant. Idempotent: a
petname with no entry / no allow membership is a clean no-op. Live in-flight sessions are
NOT severed here (M3/D8): existing sessions run to completion; the peer only loses the
ability to establish NEW authorized sessions. Tag "peer_remove" (snake_case);
method_of reads the method string generically (no per-variant arm).
[PeerEntry]: crate — the durable allowlist row lives in the daemon crate.
PeerRename
Rename a contact’s nickname (petname) authoritatively (Contacts rename spec). Renames the
PERSON — every PeerEntry sharing user_id when given (one op for all their devices), else the
single petname entry (a provisional, no-user_id contact) — to to, AND rewrites the old
petname → to in every [services.*].allow so grants follow the rename. Refuses (error frame)
when to is empty or already names/grants a DIFFERENT identity — the same collision guard the
pairing rendezvous uses, so a rename can’t inherit another peer’s access. Tag "peer_rename";
host-privileged like the other pair ops.
OpenSession
Open a mesh session to peer/service; the daemon dials and pipes.
Distinct from the proxy’s job: this returns a session the client streams.
Spec §6.1’s connect(peer[,device],service) — renamed to avoid colliding
with the connect porcelain.
RosterInstall
Install a signed roster from a local file (spec §4.3 manual internal roster install).
path is a LOCAL file the same-uid daemon reads (P12/P14 trust boundary — passing a path
not the bytes is fine). org_root_pk pins the org root on FIRST install (b64u:); omit it
once pinned (config carries it). Tag "roster_install".
OrgJoin
Pin the org root on a JOINER (spec §4.4 step 2) — WITHOUT a roster (the joiner has none yet,
D5). Records [identity] org_id / org_root_pk / user_id / user_key. user_key is a LOCAL path
(the key never crosses the API). Tag "org_join".
SetRosterUrl
Pin the HTTPS roster URL ([roster].url) in config (spec §4.3 M3c). Written by org create --roster-url (the operator keeps it current) AND by join when the org invite carries one —
so the joiner’s poll loop bootstraps its FIRST roster (D5). The daemon writes it under
reload_lock (single-writer), then the poll loop picks it up on the next daemon start. Tag
"set_roster_url".
BlobPublish
Publish a LOCAL file INTO a scope (spec §9, M4a): the daemon adds the bytes to its gated
app-blob store and records the hash in scope. path is a local file the same-uid daemon
reads (P12/P14). Answers a BlobPublishResult carrying the mcpmesh/blob/1 ticket + hash.
Tag "blob_publish".
BlobGrant
Grant a scope to a principal — any §5 flat-namespace entry: a group name, a user_id, or a
petname (the shared principal_set expansion). Tag
"blob_grant".
BlobList
List the daemon’s blob scopes (name → hashes + grants). Tag "blob_list".
BlobFetch
Fetch a mcpmesh/blob/1 ticket THROUGH the daemon (BLAKE3-verified streaming) and export the
verified blob to dest_path (a local file the same-uid daemon writes). Answers a
BlobFetchResult with the verified hash + byte length. Tag "blob_fetch".
AuditSummary
Summarize this node’s LOCAL audit log into per-peer / per-service SESSION counts (spec §11.3
local-only — the daemon reads its OWN audit dir, nothing is transmitted). The host Mesh surface
renders these as “who serves me / whom I serve / session counts”. Parameterless (like Status);
the server dispatches on the method string. Tag "audit_summary" (snake_case);
method_of reads the method string generically (no per-variant arm).