1#![allow(
2 missing_docs,
3 clippy::expect_used,
4 dead_code,
5 unused_imports,
6 reason = "Intentional compatibility, platform, or test-only suppression."
7)]
8pub mod agent_card;
11pub mod cli;
12pub mod client;
13pub mod errors;
14pub mod rpc;
15pub mod task_manager;
16pub mod types;
17pub mod webhook;
18
19#[cfg(feature = "a2a-server")]
20pub mod server;
21
22#[cfg(feature = "a2a-server")]
24pub async fn shutdown_signal_logged(context: &'static str) {
25 let result = {
26 #[cfg(unix)]
27 {
28 use tokio::signal::unix::{SignalKind, signal};
29 match signal(SignalKind::terminate()) {
30 Ok(mut terminate) => {
31 tokio::select! {
32 ctrl_c_result = tokio::signal::ctrl_c() => ctrl_c_result,
33 _ = terminate.recv() => Ok(()),
34 }
35 }
36 Err(err) => {
37 tracing::warn!("Failed to register SIGTERM handler: {err}; falling back to Ctrl-C only");
38 tokio::signal::ctrl_c().await
39 }
40 }
41 }
42 #[cfg(not(unix))]
43 {
44 tokio::signal::ctrl_c().await
45 }
46 };
47 if let Err(err) = result {
48 tracing::warn!("Failed to listen for {context} shutdown signal: {err}");
49 }
50}
51
52pub use agent_card::{AgentCapabilities, AgentCard, AgentProvider, AgentSkill};
54pub use client::A2aClient;
55pub use errors::{A2aError, A2aErrorCode, A2aResult};
56pub use rpc::{
57 JsonRpcError, JsonRpcRequest, JsonRpcResponse, SendStreamingMessageResponse, StreamingEvent,
58 TaskPushNotificationConfig,
59};
60pub use task_manager::TaskManager;
61pub use types::{Artifact, FileContent, Message, MessageRole, Part, Task, TaskState, TaskStatus};
62pub use webhook::{WebhookError, WebhookNotifier};