Skip to content

API Reference parrot.roost.messages

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.roost.messages

View source

Roost message model and the structural seam over the Squawk envelope (FEAT-747 M1).

Class AgentAddress

Where an agent can be reached: registry name + carrier (+ room id / topic / host id).

Fields:

Field Type Default Description
name str
carrier CarrierKind CarrierKind.IN_PROCESS
endpoint Optional[str] None

Alias CarrierKind

Re-exported from parrot.roost.performatives.CarrierKind.

Class EnvelopeLike

Fields Roost reads from an envelope.

Attributes:

Attribute Type Description
envelope_id str
correlation_id str
trace Optional[TraceContext]
budget_ms Optional[int]
token_budget Optional[int]
caller Any
idempotency_key Optional[str]

Alias FailureCode

Re-exported from parrot.roost.performatives.FailureCode.

Class FailureInfo

Payload of a failure act.

Fields:

Field Type Default Description
code FailureCode
detail str ''
retryable bool False

Alias InteractionProtocol

Re-exported from parrot.roost.performatives.InteractionProtocol.

Class LocalEnvelope

Roost's minimal envelope, used when the Squawk satellite is absent (resolved Q1).

Fields:

Field Type Default Description
envelope_id str
correlation_id str
trace Optional[TraceContext] None
budget_ms Optional[int] None
token_budget Optional[int] None
caller str
idempotency_key Optional[str] None

Alias Performative

Re-exported from parrot.roost.performatives.Performative.

Class RoostMessage

One Roost speech act riding one envelope. content is by reference; body is for humans.

Fields:

Field Type Default Description
message_id str
performative Performative
protocol InteractionProtocol
conversation_id str
in_reply_to Optional[str] None
sender AgentAddress
receivers list[AgentAddress]
capability_filter Optional[str] None
content Any None
content_type Optional[str] None
body Optional[str] None
envelope Any None
failure Optional[FailureInfo] None
permission_context Any None
auth_token Optional[str] None
hops int 0
tokens int 0
created_at datetime

Method RoostMessage.reply

Build a valid reply while retaining the content object by reference.

reply(performative: Performative, *, content: Any = None, body: Optional[str] = None, failure: Optional[FailureInfo] = None, tokens: int = 0) -> 'RoostMessage'

Parameter Type Default Description
performative Performative
content Any None
body Optional[str] None
failure Optional[FailureInfo] None
tokens int 0 Tokens the host spent producing this reply. A wake callback MUST set this for token_budget to be enforceable — the endpoint charges it via ProtocolEngine.charge and cannot observe a provider's usage itself.

Returns: 'RoostMessage'

Raises:

  • ValueError — The performative is not an allowed reply, or this message has no explicit receiver.

Method RoostMessage.is_addressed_to

True when name is in receivers; False for capability-filtered broadcasts.

is_addressed_to(name: str) -> bool

Parameter Type Default Description
name str

Returns: bool

Method RoostMessage.trace_id

Return envelope.trace.trace_id when present, else None.

trace_id() -> Optional[str]

Returns: Optional[str]

Alias TraceContext

Re-exported from parrot.core.events.lifecycle.TraceContext.

Alias obligation_for

Re-exported from parrot.roost.performatives.obligation_for.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally