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
//! cap-protocol coding-agent driver glue.
//!
//! Replaces `src/acp/`. All four coding agents (claudecode,
//! openclaude, opencode, codex) drive through `cap-rs`. The
//! LLM-facing tool surface is the single `tool_cap` in
//! `crate::agent::tools_cap`.
pub use CapLiveManager;
pub use ;
/// Process-wide handle to the single `CapLiveManager`. Set once by
/// `gateway/startup.rs` after construction; read by preparse so the
/// `/cap` and `/cap-exit` slash commands can register/unregister sticky
/// IM-session bindings without each channel having to plumb the manager
/// through its own state.
///
/// `OnceLock` so this is both lock-free at read time and safe to set
/// before any channel inbound code runs (startup orders the `set` call
/// before `spawn_channel_tasks`). Tests that don't go through the
/// gateway leave it unset — `get()` returns `None`, slash commands
/// reply with "cap_live not initialised".
pub static GLOBAL_CAP_LIVE: OnceLock =
new;
/// Idempotent setter. Subsequent calls (e.g. on hot-restart paths) are
/// silently ignored — keeping the first manager wired up is correct
/// because all existing sticky bindings already point at it.