vtcode_core/a2a/mod.rs
1//! Agent2Agent (A2A) Protocol support for VT Code
2//!
3//! This module implements the [A2A Protocol](https://a2a-protocol.org), an open standard
4//! enabling communication and interoperability between AI agents.
5//!
6//! ## Features
7//!
8//! - **Agent Discovery**: Via Agent Cards at `/.well-known/agent-card.json`
9//! - **Task Lifecycle Management**: States like `submitted`, `working`, `completed`
10//! - **Real-time Streaming**: Via Server-Sent Events (SSE)
11//! - **Rich Content Types**: Text, file, and structured data parts
12//!
13//! ## Usage
14//!
15//! ```rust,ignore
16//! use vtcode_core::a2a::{AgentCard, TaskManager, Message, Part};
17//!
18//! // Create an agent card
19//! let card = AgentCard::new("vtcode-agent", "VT Code AI Agent", "1.0.0");
20//!
21//! // Create a task manager
22//! let manager = TaskManager::new();
23//! let task = manager.create_task(None).await;
24//! ```
25
26pub mod agent_card;
27pub mod cli;
28pub mod client;
29pub mod errors;
30pub mod rpc;
31pub mod task_manager;
32pub mod types;
33
34pub mod webhook;
35
36#[cfg(feature = "a2a-server")]
37pub mod server;
38
39// Re-exports for convenience
40pub use agent_card::{AgentCapabilities, AgentCard, AgentProvider, AgentSkill};
41pub use client::A2aClient;
42pub use errors::{A2aError, A2aErrorCode, A2aResult};
43pub use rpc::{
44 JsonRpcError, JsonRpcRequest, JsonRpcResponse, SendStreamingMessageResponse, StreamingEvent,
45 TaskPushNotificationConfig,
46};
47pub use task_manager::TaskManager;
48pub use types::{Artifact, FileContent, Message, MessageRole, Part, Task, TaskState, TaskStatus};
49pub use webhook::{WebhookError, WebhookNotifier};