Skip to main content

Module message

Module message 

Source
Expand description

Message block: sends a message to one agent through the normal path (the Drone real-world jobs spec §4.2).

Block config (node.data):

  • to required, the agent’s id. Written in the graph, never built from a {{...}} reference: a value from outside must not pick who is told (§6.2).
  • body required, the text. The graph’s own words stay as written; every {{...}} value is put in as quoted data (§6.2): one line, markers neutralised, in curly quotes, after a standing line saying so.
  • reply optional, "ok" to let the agent answer; the default is "none" (a drone’s note is a status, and an answer would start a turn for nothing).

The message goes the way an ordinary one does (server::reactive::deliver): to an agent here, to one in another AgentMux instance or channel, over the LAN or the cloud relay, and held when the agent is out of quota, signed out or not running. A held message is not a failed run.

Output: { "delivered": bool, "held": bool, "to": "<agent>", "id": "<message id>" }, with held_reason when held and tier when it was forwarded. A message nothing took fails the block.

Constants§

BODY_MAX_CHARS 🔒
The longest message body, in characters.
QUOTED_VALUE_MAX_CHARS 🔒
The longest one quoted value may be, in characters; the rest is cut.
STANDING_LINE 🔒
Said once, ahead of the body, when it holds a quoted value.

Functions§

build_request 🔒
The request the block sends, and its id. Pure, so the quoting is testable without a server.
outcome 🔒
What reactive::deliver answered, as the block’s output. Delivered (here or forwarded) and held both end well, since a held message arrives when the agent can take it; anything else fails the block.
quote_value 🔒
One value as quoted data: flattened to a line, marker delimiters neutralised, cut, in curly quotes.
quoted_text 🔒
template with each {{...}} value quoted, and the standing line first when there is one. Shared by the blocks that put text in front of an agent or a person (Message, Task, Notify, Spawn).
run
strip_standing 🔒
text without the standing line quoted_text puts first, when it has one.