Payload class
A conversational message exchanged between an AI agent and a messaging-platform
bridge. Signed by its author (via the document proof) and hash-linked to the
previous message in the conversation (prev), so a third party can verify each
message's author and ordering after the transport has closed — for audit and
dispute resolution. Conversations and contacts are referenced by opaque,
bridge-issued handles, never raw platform addresses.
Constructors
-
Payload({required String conversationId, required PayloadDirection direction, String? platform, String? text, List<
Mention> ? mentions, List<AttachmentRef> ? attachments, String? replyToId, bool? isGroup, bool? isMention, ChainLink? prev, required String sentAt, Ext? ext}) -
const
-
Payload.fromJson(Map<
String, dynamic> json) -
Read this payload from a decoded JSON object.
factory
Properties
-
attachments
→ List<
AttachmentRef> ? -
OPTIONAL. Attachments carried by reference, never inline.
final
- conversationId → String
-
Opaque, bridge-issued conversation handle. MUST NOT be a raw platform address
(phone number, chat id).
final
- direction → PayloadDirection
-
inbound= platform → agent (the bridge attests what it received and normalized);outbound= agent → platform (authored by the agent).final - ext → Ext?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isGroup → bool?
-
OPTIONAL. True when the conversation is a group/channel, false (or absent) for a
1:1 DM. Part of the signed record so the audit chain captures where a message was
sent, not just its text.
final
- isMention → bool?
-
OPTIONAL. Platform-confirmed signal that this (inbound) message addresses the agent
— e.g. an @-mention of the agent, or any DM. Lets a group-aware consumer decide
whether a group message is for it without agent-name heuristics. Distinct from
mentions, which lists the participants referenced in the body. Outbound messages leave this absent/false.final -
mentions
→ List<
Mention> ? -
OPTIONAL. @-mentions carried by the message, ordered to match the U+FFFC sentinel
placeholders in
text: the Nth U+FFFC binds to the Nth entry. Absent/empty when the message mentions no one. The producer is responsible for emitting one U+FFFC sentinel per mention, in order — translating each platform's native mention encoding into this neutral form.final - platform → DigestMultibase?
-
OPTIONAL. Platform key the message belongs to (e.g.
signal,whatsapp). Advisory.final - prev → ChainLink?
-
OPTIONAL on the first message in a conversation; present on every message
thereafter. Links to the previous message so the conversation forms a verifiable,
ordered chain.
final
- replyToId → DigestMultibase?
-
OPTIONAL. The
idof the message this one replies to.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sentAt → String
-
RFC 3339 timestamp the author asserts for this message.
final
- text → DigestMultibase?
-
OPTIONAL. Plain-text body. Absent for attachment-only messages.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Serialize to a JSON-encodable map, omitting absent members.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited