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
//! basis-acp — the ACP adapter: basis's explicit protocol surface.
//!
//! [ACP](https://agentclientprotocol.com) is JSON-RPC 2.0 over stdio, LSP-style
//! — the standard editors and web UIs already speak. Serving it is what makes
//! basis embeddable without basis shipping a client: Zed, JetBrains, and acp-ui
//! drive it as-is (PROPOSAL.md Bet 2, ADR-0002).
//!
//! This is an adapter over [`basis`] and nothing else: the run lifecycle,
//! the event stream and the seams are all the core's, and what is here is the
//! translation at one edge. Opt-in by dependency, so a host embedding the
//! harness in-process never compiles a JSON-RPC server it does not run
//! (ADR-0011). The binary exposes this adapter through the explicit
//! `basis serve --acp` command on stdin/stdout; a bare `basis` invocation is
//! reserved for usage and prompt shorthand (ADR-0017).
//!
//! # Shape
//!
//! - [`session_update`] maps basis's [`Event`](basis::Event) onto
//! `session/update`. That mapping is the whole reason `Event` is basis's own
//! type rather than a re-export of mentra's: one normalization, many surfaces.
//! - [`AcpApprover`] answers mentra's permission requests by asking the client,
//! turning basis's existing [`Approver`](basis::Approver) seam into
//! `session/request_permission` with no new plumbing.
//! - [`SessionModes`] is the client's permission switch: ACP session modes over
//! basis's [`Approver`](basis::Approver) seam, applied in front of the
//! approver so the answer can still change mid-session. The three modes are
//! [`ApprovalMode`], which is basis-acp's own because an enumerable mode list
//! is a protocol concept — the core has the trait and nothing else.
//! - `history` replays a resumed conversation, which is what separates
//! `session/load` from `session/resume`.
//! - [`SessionRegistry`] holds the open conversations, keyed by mentra's
//! persisted agent id so that `session/load` is just
//! [`Workspace::resume`](basis::Workspace::resume).
//! - [`serve`] wires the handlers onto a connection, over one
//! [`Runtime`](basis::Runtime) for the process and one
//! [`Workspace`](basis::Workspace) per directory a client names
//! (ADR-0018).
//! - [`serve_stdio`] is the stdin/stdout transport, and the one place basis looks
//! at what a peer sent before serving it.
//! - [`available_commands`] and [`from_acp`] are the two mappings between a
//! core convention and the wire: templates become the commands a client
//! offers, and a client's `mcpServers` become servers basis can register.
pub use AcpApprover;
pub use available_commands;
pub use from_acp;
pub use ;
pub use ;
pub use ;
pub use ;
pub use session_update;