The name of the agent associated with the message. Links the message to a specific agent instance (e.g., this.params.agentName in ClientAgent), ensuring context within multi-agent swarms. Used consistently in history pushes and bus events (e.g., context.agentName in IBus.emit).
The content of the message, representing the primary data or text being communicated. Contains the raw text or data of the message, used in history storage or processing.
OptionalimagesOptional array of images associated with the message. Represented as binary data (Blob) or base64 strings. Used for messages involving visual content (e.g., user-uploaded images or tool-generated visuals).
The execution mode indicating the source or context of the message. Aligns with ExecutionMode ("user" or "tool") from Session.interface:
"user": Messages from user input or stateless runs (e.g., commitUserMessage, RUN_FN)."tool": Messages from tool outputs or system actions (e.g., commitToolOutput, _resurrectModel).
Drives processing logic, such as validation or tool call handling in ClientAgent.OptionalpayloadOptional payload data attached to the message, providing additional context or metadata.
Can be an object of any shape or null if no payload is needed; undefined if not present.
Example: { image_id: <uuid> } when user send a message
The role of the message sender. Common roles include "assistant", "system", "tool", and "user". Specific message types may extend this with additional roles.
Optionaltool_Optional identifier of the tool call this message responds to. Links tool outputs to their originating requests. Used to correlate tool responses with their corresponding tool calls.
Optionaltool_Optional array of tool calls associated with the message. Present when the model requests tool execution. Each tool call contains function name, arguments, and a unique identifier.
Interface representing a swarm message within the swarm system. Encapsulates a single message exchanged between agents, tools, users, or the system, used extensively in agent workflows (e.g., ClientAgent) for history tracking, completion generation, and event emission. Messages are stored in history (e.g., via IHistory.push), generated by completions (e.g., ICompletion.getCompletion), and emitted via the bus (e.g., IBus.emit), serving as the core data structure for communication and state management.