Skip to content

API Reference parrot.interagent.bus_codec

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

parrot.interagent.bus_codec

View source

Bytes-safe mapping of Squawk messages onto a JSON EventEnvelope.payload (Squawk-owned convention, spec §8 Q2).

Attribute BusMessage

Class BusPayloadSerializer

{'kind', 'v', 'data'} with every bytes field as {'b64': ...}. No pycapnp; FEAT-747 M9 imports exactly this.

Method BusPayloadSerializer.to_payload

Serialize a bus message to a JSON-safe payload dict.

to_payload(message: BusMessage) -> dict[str, Any]

Parameter Type Default Description
message BusMessage The bus message to serialize.

Returns: dict[str, Any] — A dict with 'kind', 'v', and 'data' keys. All bytes fields are encoded as {'b64': ''}.

Method BusPayloadSerializer.from_payload

Deserialize an untrusted JSON payload to a bus message.

Any caller in the payload is discarded: the server sets it from the handshake / envelope metadata, so a peer cannot assert another identity. Every malformed input — wrong shape, bad base64, oversized bytes field, unknown kind/version or failed validation — raises the same error.

from_payload(payload: dict[str, Any]) -> BusMessage

Parameter Type Default Description
payload dict[str, Any] A dict with 'kind', 'v', and 'data' keys.

Returns: BusMessage — The deserialized bus message.

Raises:

  • SquawkError — UPSTREAM_FAILED / malformed for any malformed payload.

Alias CallMessage

Re-exported from parrot.interagent.messages.CallMessage.

Alias CancelMessage

Re-exported from parrot.interagent.messages.CancelMessage.

Attribute MAX_BYTES_FIELD

Alias ProgressMessage

Re-exported from parrot.interagent.messages.ProgressMessage.

Alias ResultMessage

Re-exported from parrot.interagent.messages.ResultMessage.

Alias SquawkError

Re-exported from parrot.interagent.errors.SquawkError.

Alias SquawkErrorCode

Re-exported from parrot.interagent.errors.SquawkErrorCode.

Attribute VERSION

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