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
//! ACP (Agent Client Protocol) transport module.
//!
//! Provides [`AcpSession`] — a multi-turn bidirectional JSON-RPC 2.0 session
//! over a subprocess stdio transport. Suitable for CLI tools that implement
//! the Agent Client Protocol specification (Gemini, OpenCode, Cursor, and the
//! Claude ACP adapter via `npx`).
//!
//! ## Quick start
//!
//! ```rust,no_run
//! use gate4agent::acp::{AcpSession, AcpSessionOptions};
//! use gate4agent::CliTool;
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let session = AcpSession::spawn(
//! CliTool::Gemini,
//! std::path::Path::new("."),
//! AcpSessionOptions::default(),
//! ).await?;
//!
//! let mut events = session.subscribe();
//! session.prompt("Hello, what is 2+2?").await?;
//!
//! // Stream events until TurnComplete or SessionEnd.
//! while let Ok(event) = events.recv().await {
//! println!("{:?}", event);
//! }
//! # Ok(())
//! # }
//! ```
pub
pub
pub use ;
pub use ;