Skip to main content

Module agent

Module agent 

Source

Modules§

features
Must-understand feature bits for AgentEnvelope::must_understand. Each constant names one capability a message may demand a receiver implement. Defined additively as features land: a newer producer sets a bit an older receiver does not know, and that receiver rejects rather than mis-handling the message. No bits are defined yet, so today the marker is the mechanism in place for the first feature that needs strict handling.

Structs§

AgentCard
The pinned minimal body of a liveness or capability card (status with operation = card).
AgentDeadLetter
The agent-level dead-letter capsule: the poison message’s log position, the reason, and the original payload verbatim.
AgentEnvelope
The AGDX envelope: one CBOR named-field decode unit per agent message.
AgentErrorBody
The structured body of a kind = error envelope, mirroring the wire error enums of the other surfaces. The code is the machine discriminator, the optional message is human detail.
AgentId
An agent’s identity: a bounded, human-readable name string.
AgentPresence
The live presence an agent advertises in its connection metadata (AGDX_SET_CLIENT_METADATA), the body the discovery read surfaces per connection.
BodyRef
The claim-check capsule a agdx.ct = ref body carries.
CapabilityDescriptor
A structured capability on an AgentCard: which skill, its I/O content shape, advisory cost and latency classes, concurrency, health, and load. Mirrors the SDK A2A AgentSkill so the bridge maps one to the other.
ChannelId
A chunk stream’s grouping id when several streams run under one correlation. Named channel because stream is an iggy topology term.
ConversationId
The conversation a message belongs to. The unit of ordering and the partition key, and the trace id of the causal trace.
CorrelationId
Request/reply pairing id. A2A task identity and MCP tool-call ids map onto it at the bridges.
IdempotencyKey
A producer-supplied business idempotency key: non-empty, at most 64 bytes.
LogPosition
The Iggy binding’s packing of the causal locator (cause_at, and the dead-letter source).
RecordId
A record’s producer-assigned identity, a ULID minted before publish.
Signature
A detached envelope signature: designed but dormant.
SignatureContext
The interpretation-bearing attributes a Signature binds beyond the envelope body: the content-type code (agdx.ct) and wire version (agdx.av) a consumer reads to select its codec and decoder. Riding unsigned headers, these would let an intermediary reinterpret a signed record. Folded into the preimage here, a change invalidates the signature.
TokenUsage
Typed token accounting, OTel-aligned (gen_ai.usage.*, the current input_tokens and output_tokens names, never the deprecated prompt/completion pair).

Enums§

AgentErrorCode
Why an agent operation failed, as a pinned u8 dictionary (the TaskState pattern: unknown codes decode and pass through).
AgentKind
What a message is. A closed vocabulary by design: adding a kind requires an AGENT_OP_VERSION bump and a hello advertisement, because an unknown kind must fail decode rather than flow misinterpreted.
ContentRef
The content shape on a capability’s input or output: either a content-type or a registered writer-schema id. Externally tagged (content_type / schema_id) rather than untagged: a content-type name and a schema id are both strings, so an untagged encoding would decode a schema id literally named json as ContentType::Json, and a content-type name from a newer peer as a schema id. The tag makes the two unambiguous and forward-safe.
DeadLetterReason
Why a message was dead-lettered, as a pinned u8 dictionary.
Health
An advertised skill’s health, a pinned u8 dictionary (the TaskState pattern: unknown codes pass through as Unrecognized).
IdParseError
Why parsing a Crockford base32 id failed.
TaskState
A2A’s task lifecycle, adopted verbatim, riding the wire as a u8 code (the agdx.ct dictionary pattern) so a future A2A state takes the next free code and flows through old consumers as an opaque non-terminal value instead of forcing a version bump on someone else’s release schedule. Codes are permanent and never renumbered.
ValidateError
A validity-matrix or cap violation. Receivers treat these as protocol errors rather than guessing, and the SDK rejects them at publish time.

Constants§

METADATA_BRIDGE_HOPS
Metadata key: the bridge hop list, a Value::List of bridge id strings. A bridge republishing a message appends its own id, and drops a message whose hop list already contains it: the loop guard for multi-bridge deployments (A2A in, AG-UI out, A2A out again). Bounded by the metadata caps like every other entry.
METADATA_DATA_CLASSIFICATION
Metadata key: the declared classification of the data the operation touches. Advisory unless the envelope is signed.
METADATA_DELEGATED_BY
Metadata key: the user an agent acts on behalf of. It rides metadata (not a header) so it falls inside the signed envelope span, so the signer cannot forge whom it claims to act for.
METADATA_PURPOSE
Metadata key: the declared purpose of the operation, a stable input for a policy engine at the effect boundary. Advisory unless the envelope is signed.
METADATA_ROLE
Metadata key: the message’s chat role. Recommended values: user, assistant, system, tool. A string because that vocabulary belongs to the model providers and the edge protocols, not to us.
METADATA_RUN
Metadata key: the run id a status record belongs to, stamped by a registered workflow or contract and read by the run-registry fold. A record without it never enters the fold, so the key costs nothing and means nothing for everything that is not a registered run. Bounded by the metadata caps like every other entry.
METADATA_SESSION_INTENT
Metadata key: the session’s declared intent. Advisory unless the envelope is signed.
METADATA_TASK_CONTEXT
Metadata key: the task this operation serves. Advisory unless the envelope is signed.
OPERATION_CARD
The status operation value for liveness/capability cards.
OPERATION_CHAT
The chunk-stream operation value for answer/content text (OTel’s chat).
OPERATION_PROGRESS
The status operation value for progress ticks.
OPERATION_QUARANTINE
The status operation value for a quarantine fact: an operator marks an agent out of routing. The body is the quarantined agent id. Authorized by the registry topic’s write access control (only an operator may append it), and optionally signed for defense in depth.
OPERATION_REASONING
The chunk-stream operation value for a model’s reasoning stream.
OPERATION_STATE_DELTA
The event operation value for a state delta (the body is an RFC 6902 JSON Patch document).
OPERATION_STATE_SNAPSHOT
The event operation value for a full state snapshot (the body is the state, codec per agdx.ct).
OPERATION_TASK
The status operation value for task lifecycle updates.
OPERATION_TOOL_ARGS
The chunk-stream operation value for streamed tool-call arguments.
OPERATION_UNQUARANTINE
The status operation value for an un-quarantine fact: an operator lifts a prior quarantine, returning the agent to routing. The body is the agent id. Same authorization as OPERATION_QUARANTINE, so quarantine is not a one-way door that only retention expiry can undo.
SIGNATURE_DOMAIN
The domain separator prefixed to the canonical envelope encoding before signing, so an AGDX signature can never be replayed into another protocol. The canonical encoding is this crate’s own: named-field CBOR, fields in declaration order, absent optionals skipped, the signature field absent.
SIGNATURE_SCHEME_ED25519
The Ed25519 signing scheme code.

Functions§

validate
Check an envelope against the per-kind validity matrix and the caps.