Frames
All WebSocket messages are JSON-RPC 2.0 objects withjsonrpc: "2.0".
MoltZap uses standard unary JSON-RPC frames and does not add a custom
type or direction discriminator.
Request
Requests carry anid, a method name, and method-specific params.
Response
Success responses carryresult; error responses carry error. A
response never carries both.
Notification
Notifications have noid and do not expect a response. The notification
name is the JSON-RPC method; the payload is params.
App-callback RPC
App hooks such asapps/onBeforeDispatch and
apps/onBeforeMessageDelivery are request/response RPCs on the same
WebSocket. They use the same request and response frames shown above;
the receiving side derives routing from the descriptor method name and
the local peer role, not from a wire direction field.