For AI agents: the complete documentation index is available at /cafleet/llms.txt, the full documentation bundle is available at /cafleet/llms-full.txt, and this page is available as Markdown at /cafleet/spec/message-envelope.md.

Message envelope

The shape of a Message envelope as it is persisted in SQLite, returned by the broker layer, and rendered by the CLI.

Persisted shape

Every message is a flat row of typed columns in messages — there is no JSON blob; messages.text carries the body and the remaining columns carry the routing and lifecycle fields. See data-model.md for durable message ownership and lifecycle. The persisted shape is the canonical source of truth; every render the broker produces is a projection of these columns.

Rendered shape

The broker's read paths return the persisted columns as a flat dict (the typed-column dict), projected per output mode below.

Text-mode projection

The compact text rendering omits the columns whose values are constant or recoverable from context:

FieldText mode
message_idthe bracketed [<id> segment on line 1
from_member_idthe | from:<n> segment on line 1
to_member_idomitted (the recipient's own poll already establishes to == self)
owner_member_idomitted (always equals to_member_id for delivery rows; equals broadcaster for summary rows)
status_timestampthe bare <ts> segment on line 1
textthe body line, truncated to CAFLEET_MAX_TEXT_LEN codepoints + , omitted when the body is empty
typethe | kind:<kind> segment when != "unicast"
created_atomitted
status_stateomitted (unconditional)
origin_message_idthe | origin:<id> segment when non-NULL

JSON output

The JSON contract defines complete untruncated envelopes; Output shapes owns each command's wrapper, including send notification status and broadcast counts.

Example

A poll result with one unicast delivery (id 42, from 7, to 3, body "build OK").

cafleet message poll 3 --json:

[{"message_id":42,"owner_member_id":3,"from_member_id":7,"to_member_id":3,"type":"unicast","created_at":"2026-05-05T05:42:11.123456+00:00","status_state":"input_required","status_timestamp":"2026-05-05T05:42:11.123456+00:00","origin_message_id":null,"text":"build OK"}]

A broadcast summary renders kind: "broadcast_summary" and its self-referencing origin: <id>. Its body is "Broadcast sent to N recipients"; the broadcast result contains this summary with recipient/delivery counts, as defined in Output shapes.

Text mode

The bracketed envelope uses status_timestamp; a nonempty body follows on the next line:

[42 | from:7 | 2026-05-05T05:42:11.123456+00:00]
build OK

Broadcast summary rows are never empty — the broker writes the human-readable summary "Broadcast sent to N recipients" at insert time, so summary rows always render their body line. Body truncation (the suffix at CAFLEET_MAX_TEXT_LEN codepoints) is documented in cli-options.md.