Expand description
Every value the porcelain prints under --json — the machine face, as pure
unit-tested builders. [crate::render] owns the human strings; this module owns
the JSON mirror. Shapes serialize the mcpmesh-local/1 result types verbatim
wherever one exists (additive discipline: an absent field means empty/none, same
as the wire), plus small hand-built objects for verbs with no API result. One
JSON value per invocation on stdout; a failure is one
{"error":{"code":…,"message":…}} line on stderr.
Functions§
- doctor_
json doctor --json: every finding, plus the warn/error tallies the human summary line carries and an overallok(false iff any ERROR — mirrors the exit code).- error_
json - The
--jsonerror object: the SAME human message [render::error_lines] produces (joined, without the leading “Error: “), plus the control-API JSON-RPCcodewhen the failure came from the daemon — the machine-branchable field the human path deliberately hides. - invite_
json invite --json: theInviteResultverbatim plus the requested services (what the operator asked to grant — the same provenance as the human line).- pair_
json pair --json: thePairResultverbatim plus the ready-to-use<peer>/<service>mount targets (the machine mirror of “You can now use: …”).- serve_
json serve --json.- status_
json status --json: theStatusResultverbatim, plus theHellofields and the device fingerprint the human header carries. Hello’s api/stack fields win over StatusResult’sstack_versioncopy (they are the same value from a live daemon).- unpair_
json pair --remove --json.- up_json
up --json.- use_
json use --json: per service, the mount target, the exact Claude Code command, and the generic MCP stdio server entry (name/command/args) any client can consume — the machine mirror of [crate::proxy::client_instruction_lines].