Skip to main content

adk_awp/
lib.rs

1//! # adk-awp
2//!
3//! Agentic Web Protocol (AWP) implementation for ADK-Rust.
4//!
5//! This crate provides the full AWP protocol implementation including:
6//!
7//! - **Configuration**: TOML-based business context loading with hot-reload
8//! - **Discovery**: Auto-generated discovery documents from business context
9//! - **Manifest**: JSON-LD capability manifest builder
10//! - **Detection**: Requester type detection (human vs. agent)
11//! - **Trust**: Trust level assignment from request headers
12//! - **Rate Limiting**: Per-trust-level sliding window rate limiter
13//! - **Consent**: Consent capture, check, and revocation
14//! - **Events**: Event subscription system with HMAC-SHA256 webhook signing
15//! - **Health**: Health state machine (Healthy/Degrading/Degraded)
16//! - **Middleware**: AWP version negotiation
17//! - **Router**: Axum route registration for all AWP endpoints
18//!
19//! ## Quick Start
20//!
21//! ```rust,ignore
22//! use adk_awp::{BusinessContextLoader, generate_discovery_document, build_manifest, awp_routes};
23//!
24//! let loader = BusinessContextLoader::from_file("business.toml".as_ref())?;
25//! let ctx = loader.load();
26//! let discovery = generate_discovery_document(&ctx);
27//! let manifest = build_manifest(&ctx);
28//! ```
29
30pub mod config;
31pub mod consent;
32pub mod detect;
33pub mod discovery;
34pub mod error_response;
35pub mod events;
36pub mod handlers;
37pub mod health;
38pub mod loader;
39pub mod manifest;
40pub mod middleware;
41pub mod rate_limit;
42pub mod router;
43pub mod state;
44pub mod trust;
45
46pub use config::{AwpConfigError, business_context_to_toml};
47pub use consent::{ConsentService, FileConsentService, InMemoryConsentService};
48pub use detect::detect_requester_type;
49pub use discovery::generate_discovery_document;
50pub use events::{
51    AwpEvent, EventSubscription, EventSubscriptionService, InMemoryEventSubscriptionService,
52    sign_payload, verify_signature,
53};
54pub use health::{HealthState, HealthStateMachine, HealthStateSnapshot};
55pub use loader::BusinessContextLoader;
56pub use manifest::build_manifest;
57pub use rate_limit::{InMemoryRateLimiter, RateLimitConfig, RateLimiter};
58pub use router::awp_routes;
59pub use state::{AwpState, AwpStateBuilder};
60pub use trust::{DefaultTrustAssigner, TrustLevelAssigner};