Message envelope
interface WaylocateMessage {
/** Namespace guard and protocol version. Reject anything without it. */
waylocate: 1;
kind: "command" | "result" | "event";
/** Dot-namespaced, e.g. "camera.flyTo" or "selection.changed" */
name: string;
/** Correlation ID. Present on commands and their results; absent on events. */
id?: string;
payload?: unknown;
/** Events only. Who caused this. */
source?: "user" | "host" | "system";
}
Result messages add ok:
{ "waylocate": 1, "kind": "result", "name": "selection.setRoom", "id": "c7", "ok": true }
{ "waylocate": 1, "kind": "result", "name": "selection.setRoom", "id": "c7", "ok": false,
"error": { "code": "REF_NOT_FOUND", "message": "No room matching 'room-999'" } }
The waylocate: 1 field is a namespace guard, not just a version number. Anything without it is dropped.