Skip to main content

Module a2a

Module a2a 

Source
Expand description

The A2A surface: agentd’s only external channel. Principals + roles + authorization (principals) and durable tasks + conversations (tasks). The transport binding — the HTTPS listener and the command/NL/gate routing into the runtime — lives in the runtime, so this module stays a pure model of who may call what and what a task is.

Re-exports§

pub use principals::CallerIdentity;
pub use principals::Principal;
pub use principals::Resolver;
pub use tasks::State;
pub use tasks::Task;

Modules§

principals
Principals, roles and authorization: every A2A caller is resolved to a principal (identity from mTLS SAN / bearer subject / AAuth agent id) with a role (operator | user | agent | anonymous), a set of granted tool patterns, and optional per-principal quotas. The authorization matrix — which methods and commands a role may call — is decided here; the served surface calls Resolver::resolve then Principal::may. Anything that does not match a rule lands on the anonymous principal, which may call nothing, so a caller agentd cannot identify gets no surface at all.
tasks
A2A tasks: a durable unit of work a principal started — a root-turn answer, a workflow run, or a subagent — projected as an A2A Task (spec shape, TASK_STATE_*). Tasks are persisted, so GetTask answers across a restart; they stream status/artifact frames from run and turn events; and cancelling one cancels the work it links to, which in turn cancels that work’s own children, so no orphan keeps running behind a cancelled task.