Skip to main content

Module a2a

Module a2a 

Expand description

A2A discovery surface: the well-known catalog card and per-alias agent cards.

Structs§

AgentCapabilities
A2A AgentCapabilities — optional feature flags. Only Some values serialize; None fields are omitted.
AgentCard
A2A AgentCard (spec §14) — the discovery surface for an agent. Serializes to the protobuf-JSON wire shape.
AgentInterface
A2A AgentInterface (spec §5.8) — a declared transport interface. The first entry of supportedInterfaces is the preferred transport. tenant, when set, MUST be echoed into the tenant field of every request sent to this interface (spec §5.2).
AgentSkill
A2A AgentSkill (spec §4.4). id/name/description are spec-required.
Artifact
A2A Artifact (proto message Artifact) — a task output. parts is the same Part oneof used by messages.
Message
A2A Message (proto message Message) — one unit of client/server communication. messageId and role are spec-REQUIRED on send, and parts MUST contain at least one Part (spec §5.7 REQUIRED — a list field with REQUIRED behavior must have ≥1 element).
Part
A2A Part (proto message Part) — a section of communication content. The content oneof is expressed without a discriminator: the active branch is exactly one of text / raw / url / data; the shared optional fields (metadata/filename/mediaType) ride alongside it. The oneof invariant is enforced at deserialization (via deserialize_part): a payload with zero content branches or more than one is rejected, matching the proto oneof semantics (spec §5.7 — a Part carries exactly one content branch). A struct (not an enum) lets serde handle the field-name-keyed shape directly while a custom deserializer validates the oneof invariant.
SendMessageParams
SendMessage request params (proto SendMessageRequest). tenant echoes the selected AgentInterface.tenant; message is REQUIRED.
Task
A2A Task (proto message Task) — returned by SendMessage / GetTask / CancelTask. Fields beyond the spec-required id/status are optional and tolerate absence: a peer that omits contextId or artifacts still parses.
TaskStatus
A2A TaskStatus (proto message TaskStatus).

Enums§

Role
A2A Role (proto enum Role) — the sender of a message. ProtoJSON serializes enum values as their SCREAMING_SNAKE_CASE proto names (spec §5.5).
SendMessageResponse
SendMessageResponse (proto message SendMessageResponse) — the oneof payload with branches task / message. Custom de/serialization enforces exactly-one branch and the flat proto-shape ({"task": {...}} / {"message": {...}}): the default externally-tagged enum serializer would nest the branch value one level too deep ({"task":{"task":{...}}}) and would not round-trip through the custom deserializer.
TaskState
A2A TaskState (proto enum TaskState) — task lifecycle state. SCREAMING_SNAKE_CASE on the wire (spec §5.5). TASK_STATE_UNSPECIFIED is rejected at deserialization: the spec marks state as REQUIRED and the default UNSPECIFIED value must not be accepted as a valid wire value.

Functions§

a2a_routes
a2a_task_route
build_agent_card
Build a spec-conforming per-alias agent card, or None when the alias is unknown or not published. Skills resolve from the alias’s bundles and narrow through exposed_skills.
build_catalog_card
Build the ZeroClaw discovery catalog card served at the origin root. Lists every published alias as a skill-less entry pointing at its per-alias card and endpoint. This is a catalog, not a runnable agent: it advertises the catalog interface and carries no skills of its own.