acp_runtime/lib.rs
1//! # ACP — Agent Communication Protocol
2//!
3//! ACP (Agent Communication Protocol) is a secure, identity-driven protocol
4//! for autonomous systems to communicate, discover each other, and collaborate
5//! across environments.
6//!
7//! Unlike traditional APIs or message brokers, ACP is designed for communication
8//! between autonomous systems and agents with:
9//! - identity-based addressing
10//! - signed and verifiable messages
11//! - transport independence (HTTP, AMQP, MQTT)
12//! - optional relay-based routing
13//!
14//! ---
15//!
16//! ## What this crate provides
17//!
18//! This crate is the **Rust runtime for ACP**, allowing you to:
19//!
20//! - create and manage agent identities
21//! - send and receive ACP messages
22//! - integrate with relays and transports
23//! - build autonomous systems using a consistent protocol
24//!
25//! This crate is intended for building ACP-compatible agents and integrations in Rust.
26//!
27//! ## Quick example
28//!
29//! ```rust
30//! use acp_runtime::AcpAgent;
31//! use serde_json::json;
32//!
33//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
34//! let mut agent = AcpAgent::load_or_create("agent:demo", None)?;
35//!
36//! agent.send_basic(
37//! vec!["agent:other".into()],
38//! serde_json::from_value(json!({ "message": "hello" }))?,
39//! Some("ping".into()),
40//! )?;
41//!
42//! # Ok(())
43//! # }
44//! ```
45//!
46//! ## Interoperability
47//!
48//! ACP agents written in different languages (Python, TypeScript, Rust, Java)
49//! can communicate seamlessly using the same protocol semantics.
50//!
51//! ## Mental model
52//!
53//! - HTTP is for services
54//! - ACP is for agents
55//!
56//! ---
57//!
58//! ## More information
59//!
60//! ACP is part of a multi-language ecosystem, with compatible runtimes in Python, TypeScript, Mojo, Go and Java.
61//!
62//! - GitHub: https://github.com/beltxa/acp
63//! - Protocol overview: see repository README
64//!
65//! ---
66
67// Copyright 2026 ACP Project
68// Licensed under the Apache License, Version 2.0
69// See LICENSE file for details.
70
71pub mod agent;
72pub mod amqp_transport;
73pub mod capabilities;
74pub mod constants;
75pub mod crypto;
76pub mod discovery;
77pub mod errors;
78pub mod http_security;
79pub mod identity;
80pub mod json_support;
81pub mod key_provider;
82pub mod messages;
83pub mod mqtt_transport;
84pub mod options;
85pub mod overlay;
86pub mod overlay_framework;
87pub mod transport;
88pub mod well_known;
89
90pub use agent::{AcpAgent, CapabilityRequestResult, DecryptedMessage, InboundResult};
91pub use amqp_transport::{
92 AmqpMessageHandler, AmqpTransportClient, DEFAULT_AMQP_EXCHANGE, DEFAULT_AMQP_EXCHANGE_TYPE,
93};
94pub use capabilities::{AgentCapabilities, CapabilityMatch};
95pub use constants::{ACP_IDENTITY_VERSION, ACP_VERSION, DEFAULT_CRYPTO_SUITE, TRUST_PROFILES};
96pub use discovery::DiscoveryClient;
97pub use errors::{AcpError, AcpResult, FailReason};
98pub use identity::{AgentIdParts, AgentIdentity, IdentityBundle};
99pub use key_provider::{
100 IdentityKeyMaterial, KeyProvider, KeyProviderInfo, LocalKeyProvider, TlsMaterial,
101 VaultKeyProvider,
102};
103pub use messages::{
104 AcpMessage, CompensateInstruction, DeliveryMode, DeliveryOutcome, DeliveryState, Envelope,
105 MessageClass, ProtectedPayload, SendResult, WrappedContentKey,
106};
107pub use mqtt_transport::{
108 DEFAULT_MQTT_QOS, DEFAULT_MQTT_TOPIC_PREFIX, MqttMessageHandler, MqttTransportClient,
109};
110pub use options::AcpAgentOptions;
111pub use overlay::{
112 OverlayInboundAdapter, OverlayOutboundAdapter, OverlaySendResult, OverlayTarget,
113};
114pub use overlay_framework::{
115 OverlayClient, OverlayConfig, OverlayFrameworkRuntime, OverlayHttpResponse,
116 WELL_KNOWN_CACHE_CONTROL,
117};