odori_mcp_bridge/lib.rs
1//! The MCP bridge — durable tools reachable from inside a harness turn.
2//!
3//! A harness (Claude Code, Codex) mid-turn may call a tool the framework
4//! owns. That tool must execute durably — as a tokeira activity with its
5//! own retry policy — while the harness blocks awaiting the MCP response,
6//! inside a turn that is *itself* an activity. This crate is that bridge:
7//!
8//! - `attach::Bridge` — the in-process streamable-HTTP MCP server on
9//! loopback, per-attempt bearer tokens, and the `AttachmentSource`
10//! implementation the turn activities consume;
11//! - `broker::CallBroker` — `tools/call` → workflow update translation
12//! with keepalive progress (record-before-respond is structural: only a
13//! completed update's reply can be returned);
14//! - the workflow-side pieces (invocation registry, `tool_invoked` update
15//! handler, `execute_tool` activity) live in `odori-agents`, which this
16//! crate depends on — never the reverse.
17//!
18//! The `preview` feature gates the complete bridge:
19//! with it off this crate compiles to nothing — no listener, no
20//! attachment, no bridge code on any path — and framework tools delegate
21//! to the harness's own tooling. (Module references above are plain code
22//! spans, not links: the modules exist only under `preview`, and the
23//! preview-off rustdoc build must stay warning-free.)
24
25#[cfg(feature = "preview")]
26pub mod attach;
27#[cfg(feature = "preview")]
28pub mod broker;
29#[cfg(feature = "preview")]
30mod server;
31
32#[cfg(feature = "preview")]
33pub use attach::{Bridge, BridgeConfig};
34#[cfg(feature = "preview")]
35pub use broker::{BridgeError, CallBroker, UpdateClient, WorkflowUpdateClient};