Module a2a
Expand description
A2A discovery surface: the well-known catalog card and per-alias agent cards.
Structs§
- Agent
Capabilities - A2A
AgentCapabilities— optional feature flags. OnlySomevalues serialize;Nonefields are omitted. - Agent
Card - A2A
AgentCard(spec §14) — the discovery surface for an agent. Serializes to the protobuf-JSON wire shape. - Agent
Interface - A2A
AgentInterface(spec §5.8) — a declared transport interface. The first entry ofsupportedInterfacesis the preferred transport.tenant, when set, MUST be echoed into thetenantfield of every request sent to this interface (spec §5.2). - Agent
Skill - A2A
AgentSkill(spec §4.4).id/name/descriptionare spec-required. - Artifact
- A2A
Artifact(protomessage Artifact) — a task output.partsis the samePartoneof used by messages. - Message
- A2A
Message(protomessage Message) — one unit of client/server communication.messageIdandroleare spec-REQUIRED on send, andpartsMUST contain at least onePart(spec §5.7 REQUIRED — a list field with REQUIRED behavior must have ≥1 element). - Part
- A2A
Part(protomessage Part) — a section of communication content. Thecontentoneof is expressed without a discriminator: the active branch is exactly one oftext/raw/url/data; the shared optional fields (metadata/filename/mediaType) ride alongside it. The oneof invariant is enforced at deserialization (viadeserialize_part): a payload with zero content branches or more than one is rejected, matching the protooneofsemantics (spec §5.7 — aPartcarries 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. - Send
Message Params SendMessagerequestparams(protoSendMessageRequest).tenantechoes the selectedAgentInterface.tenant;messageis REQUIRED.- Task
- A2A
Task(protomessage Task) — returned bySendMessage/GetTask/CancelTask. Fields beyond the spec-requiredid/statusare optional and tolerate absence: a peer that omitscontextIdorartifactsstill parses. - Task
Status - A2A
TaskStatus(protomessage TaskStatus).
Enums§
- Role
- A2A
Role(protoenum Role) — the sender of a message. ProtoJSON serializes enum values as their SCREAMING_SNAKE_CASE proto names (spec §5.5). - Send
Message Response SendMessageResponse(protomessage SendMessageResponse) — theoneof payloadwith branchestask/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.- Task
State - A2A
TaskState(protoenum TaskState) — task lifecycle state. SCREAMING_SNAKE_CASE on the wire (spec §5.5).TASK_STATE_UNSPECIFIEDis rejected at deserialization: the spec marksstateas 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
Nonewhen the alias is unknown or not published. Skills resolve from the alias’s bundles and narrow throughexposed_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
cataloginterface and carries no skills of its own.