Expand description
A2A Task, TaskStatus, TaskState, and
Artifact value objects.
§What these are
A Task is the unit of work an A2A agent
tracks. A client opens a task by sending a
SendMessage request; the agent creates a
task, runs the work, and answers with a
Task whose TaskStatus::state moves
through Submitted
→ Working →
Completed (or one
of the failure states).
A Task carries:
- An id (the task’s identity) and an optional context id (a grouping across related tasks).
- A
TaskStatus— the current state, the status message, and the timestamp. - A list of
Artifacts — the work’s output. An artifact is a named bundle ofParts. - A list of
Messages — the conversation history that produced the task.
§Why a BTreeMap for the metadata
Same rationale as
Message::metadata:
the wire form is deterministic (alphabetical
by key), which keeps test fixtures readable
and makes diff-on-the-wire stable.
§Why timestamp is a string
The A2A spec uses RFC 3339 / ISO 8601
timestamps. The Rust type that round-trips
with the spec is a string — chrono::DateTime
is a more typed alternative but adds a
dependency and a Result on every read.
The string is parsed by the consumer if a
parsed form is needed.
Structs§
- Artifact
- A unit of output produced by a
Task. - Task
- A unit of work an A2A agent tracks.
- Task
Status - A task’s current status.