tower_a2a/protocol/
mod.rs

1//! Core A2A protocol types and definitions
2
3use serde::{Deserialize, Serialize};
4use serde_json::Value;
5
6pub mod agent;
7pub mod error;
8pub mod message;
9pub mod operation;
10pub mod task;
11
12pub use agent::{AgentCapabilities, AgentCard};
13pub use error::{A2AError, TaskError};
14pub use message::{Message, MessagePart, Role};
15pub use operation::A2AOperation;
16pub use task::{Task, TaskStatus};
17
18/// Artifacts represent task outputs
19#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
20pub struct Artifact {
21    /// Unique identifier of the Artifact
22    pub artifact_id: String,
23
24    /// A human readable name for the Artifact
25    pub name: Option<String>,
26
27    /// A human readable description of the Artifact
28    pub description: Option<String>,
29
30    /// Contents of the Artifact. Must contain at least one part
31    pub parts: Vec<MessagePart>,
32
33    pub metadata: Option<Value>,
34
35    /// The URIs of extensions that are present or contributed to this Artifact
36    #[serde(skip_serializing_if = "Vec::is_empty")]
37    pub extensions: Vec<String>,
38}