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
//! `oino-acp`: Oino as an [Agent Client Protocol](https://agentclientprotocol.com) v1 agent
//! (`oino --mode acp`, modes.md §6).
//!
//! The adapter sits on the in-process [`oino_client::InProcessBackend`] of one
//! `AgentSessionRuntime` per ACP session — never on RPC JSON (research-acp §9.1) — and speaks
//! ACP through the official `agent-client-protocol` SDK. Nothing else in the workspace sees ACP
//! types.
//!
//! # Method coverage
//!
//! | ACP | Oino |
//! |---|---|
//! | `initialize` | capabilities of research-acp §5 (+ `sessionCapabilities.fork`), client caps recorded |
//! | `authenticate`, `logout` | accepted (no auth methods: provider auth is extension-owned) |
//! | `session/new`, `session/load` (replay), `session/resume`, `session/fork` | one runtime per session ([`SessionFactory`]) |
//! | `session/list`, `session/close`, `session/delete` | `SessionManager` listing, dispose, move to `<agent>/trash/` |
//! | `session/prompt`, `session/cancel` | `prompt` (follow-up while streaming) resolved on `agent_settled`; `abort` |
//! | `session/set_config_option`, `session/set_mode` | model, thinking, queue modes, auto-compaction/retry; mode = thinking level |
//! | `_oino/rpc`, `_oino/<command>` | any RPC command on the session's backend |
//!
//! Agent → client: `session/update` (message/thought chunks, tool calls with kinds, locations,
//! diffs and terminals, plans, usage, compaction, notices, commands, config, session info),
//! `session/request_permission` (approval dialogs, `confirm` during a tool call),
//! `elicitation/create` (select/input/editor/confirm/multiSelect), `fs/*` and `terminal/*`
//! through [`AcpEnv`], `_oino/queue_update`, `_oino/run_state`, `_oino/extension_ui`.
//!
//! # API map
//!
//! | Module | Contents |
//! |---|---|
//! | [`agent`] | [`AcpAgent`]: request dispatch, [`AgentInfo`] |
//! | [`factory`] | [`SessionFactory`], [`CoreSessionFactory`], [`SessionDefaults`] |
//! | [`mod@env`] | [`AcpEnv`]: client-hosted files and terminals |
//! | [`client`] | [`ClientLink`], [`ClientCaps`]: typed agent → client calls |
//! | [`tools`], [`convert`], [`config`], [`commands`], [`ui`] | event, prompt, config, slash-command and dialog mappings |
//! | [`error`] | [`AcpError`] |
use PathBuf;
use Arc;
pub use ;
pub use ;
pub use AcpEnv;
pub use AcpError;
pub use ;
/// Serves ACP on stdin/stdout until the client closes stdin (`oino --mode acp`).
///
/// # Errors
///
/// Transport and protocol failures reported by the SDK.
pub async