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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// SPDX-FileCopyrightText: 2026 Andrei G <bug-ops>
// SPDX-License-Identifier: MIT OR Apache-2.0
//! ACP (Agent Client Protocol) server for IDE embedding.
//!
//! `zeph-acp` exposes the Zeph agent over the Agent Client Protocol so that
//! IDEs such as Zed can connect to it as a first-class AI assistant.
//!
//! # Architecture
//!
//! ```text
//! IDE / client
//! │ JSON-RPC over stdio / HTTP-SSE / WebSocket
//! ▼
//! transport ──► ZephAcpAgent (ACP SDK Agent impl)
//! │
//! ├─ AgentSpawner ──► agent loop (LoopbackChannel)
//! ├─ AcpPermissionGate ──► IDE tool-call approval
//! ├─ AcpFileExecutor ──► IDE fs/* proxying
//! ├─ AcpShellExecutor ──► IDE terminal/* proxying
//! └─ AcpLspProvider ──► IDE LSP ext_method proxying
//! ```
//!
//! # Transports
//!
//! | Transport | Entry point | Feature flag |
//! |-----------|-------------|--------------|
//! | stdio (default) | [`serve_stdio`] | always |
//! | HTTP + SSE | [`acp_router`] | `acp-http` |
//! | WebSocket | [`acp_router`] | `acp-http` |
//!
//! # Feature flags
//!
//! | Flag | Description |
//! |------|-------------|
//! | `acp-http` | HTTP/SSE and WebSocket transports via axum |
//! | `unstable-session-close` | ACP session close extension |
//! | `unstable-session-fork` | ACP session fork extension |
//! | `unstable-session-resume` | ACP session resume extension |
//! | `unstable-session-usage` | ACP session token-usage extension |
//! | `unstable-session-model` | ACP session model-switching extension |
//! | `unstable-elicitation` | ACP elicitation schema types |
//! | `unstable-logout` | ACP logout extension |
//!
//! # Quick start (stdio)
//!
//! ```rust,no_run
//! use std::sync::Arc;
//! use parking_lot::RwLock;
//! use zeph_acp::{AgentSpawner, AcpServerConfig, serve_stdio};
//!
//! # async fn run() -> Result<(), zeph_acp::AcpError> {
//! let spawner: AgentSpawner = Arc::new(|channel, ctx, session| {
//! Box::pin(async move {
//! // run your agent loop here
//! drop((channel, ctx, session));
//! })
//! });
//!
//! let config = AcpServerConfig {
//! agent_name: "my-agent".to_owned(),
//! agent_version: "0.1.0".to_owned(),
//! ..AcpServerConfig::default()
//! };
//!
//! serve_stdio(spawner, config).await?;
//! # Ok(())
//! # }
//! ```
pub
pub use ;
pub use ;
pub use AcpError;
pub use AcpFileExecutor;
pub use ;
pub use acp_mcp_servers_to_entries;
pub use AcpPermissionGate;
pub use AcpShellExecutor;
pub use ;
pub use SendAgentSpawner;
pub use ;