Deserializes a raw JSON string received from the JavaScript frontend (or from
a bundled launcher via stdin) into a validated R list. Performs lightweight
structural validation: both type and payload fields must be
present. Launcher/native events (which carry an event field instead)
bypass validation and are returned as-is.
Value
A named list containing the validated message components, or
NULL if the JSON is malformed or the required fields are absent.
See also
rdesk_message() for constructing outgoing messages.
