1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//! Agent Harness Protocol (AHP) v2.0
//!
//! Universal, transport-agnostic protocol for supervising autonomous AI agents.
//!
//! # Overview
//!
//! AHP provides a framework-agnostic interface for supervising, controlling, and auditing
//! AI agents. Unlike traditional monitoring solutions tightly coupled to specific frameworks,
//! AHP works with any agent system through a standardized JSON-RPC 2.0 protocol.
//!
//! # Features
//!
//! - **Framework-agnostic** — Works with any agent system
//! - **Language-neutral** — Harness servers can be written in any language
//! - **Transport-flexible** — Supports stdio, HTTP, WebSocket, gRPC, Unix sockets
//! - **Bidirectional** — Agents can query the harness for guidance
//! - **Secure** — Built-in authentication and encryption support
//!
//! # Quick Start
//!
//! ```no_run
//! use a3s_ahp::{AhpClient, Transport, EventType, Decision};
//!
//! # async fn example() -> anyhow::Result<()> {
//! // Create client with stdio transport
//! let client = AhpClient::new(Transport::Stdio {
//! program: "python3".into(),
//! args: vec!["harness.py".into()],
//! }).await?;
//!
//! // Send handshake
//! let handshake = client.handshake().await?;
//! println!("Connected to: {}", handshake.harness_info.name);
//!
//! // Send pre-action event
//! let decision = client.send_event(EventType::PreAction, serde_json::json!({
//! "action_type": "tool_call",
//! "tool_name": "bash",
//! "arguments": { "command": "ls -la" }
//! })).await?;
//!
//! match decision {
//! Decision::Allow => println!("Action allowed"),
//! Decision::Block { reason } => println!("Action blocked: {}", reason),
//! _ => {}
//! }
//! # Ok(())
//! # }
//! ```
// Re-exports
pub use ;
pub use AhpClient;
pub use ;
pub use ;
pub use AhpServer;
pub use ;
/// Protocol version
pub const PROTOCOL_VERSION: &str = "2.0";
/// Default timeout for blocking requests (milliseconds)
pub const DEFAULT_TIMEOUT_MS: u64 = 10_000;
/// Default batch size
pub const DEFAULT_BATCH_SIZE: usize = 100;