Builds the JSON envelope that both R and the JavaScript frontend use to exchange typed messages. Each envelope carries a unique ID, a message type string, a contract version, an arbitrary payload, and a millisecond-precision Unix timestamp.
Value
A named list representing the standard JSON envelope. Pass this directly to
jsonlite::toJSON() or to app$send().
Details
The envelope schema is:
{
"id": "msg_<epoch_ms>_<random>",
"type": "<action_name>",
"version": "1.0",
"payload": { ... },
"timestamp": <unix_seconds>
}
Large payloads (above 1 MB) trigger a warning so developers notice performance-sensitive serialization early.
See also
rdesk_parse_message() for the corresponding deserializer.
