StaticBuildBuild ChatMessageContent from text and attachment data. This is the primary method for converting stored messages to AI-ready format.
The message text (may contain @{...} tokens)
Array of attachment data with content
Optionalagents: AgentInfo[]Optional agents for mention resolution
Optionalusers: UserInfo[]Optional users for mention resolution
ChatMessageContent ready for AI provider
StaticContainsCheck if a message contains attachment references
The message text to check
true if the message contains attachment syntax
StaticContainsCheck if a message contains form response syntax (@{"_mode":"form",...}) Useful for fast-path routing decisions without running full LLM inference.
Form responses should always be routed back to the agent that requested the form, so this can be used to skip intent-checking prompts entirely.
The message text to check
true if the message contains form response syntax
StaticCreateCreate an attachment reference token string
The attachment content object
Formatted @{...} string for the attachment reference
StaticCreateCreate a form response token string
The action being performed (e.g., "createRecord")
Array of field name/value pairs
Optionaltitle: stringOptional form title for display
Formatted @{...} string for the form response
StaticCreateCreate a mention token string
Type of mention (agent, user, entity, or query)
ID of the mentioned entity
Name of the mentioned entity
OptionalconfigurationId: stringOptional agent configuration ID
OptionalconfigurationName: stringOptional agent configuration name
Formatted @{...} string for the mention
StaticGetGet all attachment references from a message
The message text to parse
Array of attachment content objects
StaticGetDetermine the attachment type from a MIME type
The MIME type of the file
The attachment type category
StaticGetGet the ChatMessageContentBlock type from attachment type
The attachment type
The corresponding content block type
StaticGetGet the effective limit value using cascade: agent → model → system
The name of the limit to get
Agent-level overrides
Model-level limits
System defaults
The effective limit value
StaticParseParse all @{...} tokens in a message Returns array of parsed content with their positions
The message text to parse
Array of parsed tokens with positions and content
StaticShouldDetermine if an attachment should be stored inline or in MJStorage
Size of the attachment in bytes
Agent-level threshold override (optional)
System default threshold
true if should be stored inline, false if should use MJStorage
StaticToConvert message for agent consumption (LLM input)
Agent-friendly representation of the message
StaticToConvert message to plain text (for display/export)
Plain text representation of the message
StaticValidateValidate an attachment against size and count limits. Uses the cascade: agent → model → system defaults
The attachment to validate
Current counts of attachments in the message
Agent-level limit overrides (optional)
Model-level limits (optional)
System default limits
Validation result with allowed flag and optional reason
Utility class for parsing and formatting special content in conversation messages Handles @{...} syntax for mentions, forms, and other structured content
All content uses the @{...} wrapper with a _mode field to distinguish types. If _mode is omitted, defaults to "mention" for backward compatibility.
Example: Parsing message content