Skip to main content

protocol_droid/application/bridge/
mod.rs

1//! The bridge use case.
2//!
3//! Five modules, each one part of a bridge that would otherwise be one
4//! oversized file: the lossless translation of `ToolResult` across revisions,
5//! the downstream handshake a bridge owes the client in front of it, the
6//! forwarding path itself, the loop that drives it, and the out-of-band frames
7//! neither side asked for.
8
9mod content;
10mod downstream;
11mod forward;
12mod serve;
13mod transport_peer;
14mod unsolicited;
15mod upstream;
16
17#[cfg(feature = "a2a")]
18mod a2a_mcp_codec;
19#[cfg(feature = "a2a")]
20mod cross_bridge_peer;
21#[cfg(feature = "a2a")]
22mod cross_protocol;
23
24pub use content::{ToolResultCodec, Translated, Translator};
25pub use downstream::{Downstream, DownstreamConfig, DownstreamError, Identity};
26pub use forward::{Bridge, BridgeError, BridgePeer, Forwarded, SendFuture};
27pub use serve::{BridgeLoop, LoopError, LoopReport, Wiring};
28pub use transport_peer::TransportPeer;
29pub use unsolicited::Unsolicited;
30pub use upstream::{BridgeClientError, OpenedUpstream, Upstream, UpstreamError, run_client};
31
32#[cfg(feature = "a2a")]
33pub use a2a_mcp_codec::A2aMcpCodec;
34#[cfg(feature = "a2a")]
35pub use cross_bridge_peer::CrossBridgePeer;
36#[cfg(feature = "a2a")]
37pub use cross_protocol::{
38    CrossProtocolCodec, CrossProtocolError, ProtocolSide, RequestCodecReport, RequestCodecStep,
39};
40
41/// Settles the downstream leg of a handshake.
42///
43/// Re-exported beside the rest so the two halves of a bridge's negotiation are
44/// reachable together: this needs an upstream [`Agreement`](crate::domain::Agreement),
45/// which is what the client half of the connection produced.
46pub use downstream::negotiate as negotiate_downstream;
47
48#[cfg(feature = "a2a")]
49pub use crate::domain::bridge::a2a_mcp::{
50    CrossProtocolReport, Direction, Protocol, Step, StepKind, a2a_message_to_mcp_content,
51    a2a_message_to_mcp_text, a2a_skill_to_mcp_tool, mcp_content_to_a2a_part,
52};