Skip to main content

Module bridge

Module bridge 

Source
Expand description

The bridge use case.

Five modules, each one part of a bridge that would otherwise be one oversized file: the lossless translation of ToolResult across revisions, the downstream handshake a bridge owes the client in front of it, the forwarding path itself, the loop that drives it, and the out-of-band frames neither side asked for.

Re-exports§

pub use crate::domain::bridge::a2a_mcp::CrossProtocolReport;
pub use crate::domain::bridge::a2a_mcp::Direction;
pub use crate::domain::bridge::a2a_mcp::Protocol;
pub use crate::domain::bridge::a2a_mcp::Step;
pub use crate::domain::bridge::a2a_mcp::StepKind;
pub use crate::domain::bridge::a2a_mcp::a2a_message_to_mcp_content;
pub use crate::domain::bridge::a2a_mcp::a2a_message_to_mcp_text;
pub use crate::domain::bridge::a2a_mcp::a2a_skill_to_mcp_tool;
pub use crate::domain::bridge::a2a_mcp::mcp_content_to_a2a_part;

Structs§

A2aMcpCodec
The codec that turns SendMessage ↔ tools/call into the bridge’s canonical envelopes.
Bridge
Carries envelopes to upstream under one agreement and brings the answers back.
BridgeLoop
Carries frames from a downstream peer, through a Bridge, back to it.
CrossBridgePeer
A bridge peer that runs every request and reply through a cross-protocol codec before reaching the inner peer.
Downstream
A settled downstream leg: what to answer, and what the bridge may forward.
DownstreamConfig
What this bridge presents to a client, before any client has connected.
Forwarded
What one forward produced.
Identity
What this bridge calls itself in serverInfo.
LoopReport
What one pass of the loop moved.
OpenedUpstream
One upstream connection, and the leg describing it.
RequestCodecReport
What translating a request and its reply produced.
Translated
What translating a reply produced.
Translator
Turns a reply into one the downstream client can read.
TransportPeer
Forwards envelopes through a ClientTransport.
Unsolicited
A queue of frames the peer pushed while some other call was in flight.
Wiring
The two peers a loop forwards between, and the policy it degrades under.

Enums§

BridgeClientError
Why one client’s bridge stopped.
BridgeError
Why a bridge could not carry an envelope.
CrossProtocolError
What a cross-protocol codec can refuse.
DownstreamError
Why a downstream handshake could not be settled.
LoopError
Why the loop stopped.
ProtocolSide
The two sides of a cross-protocol translation, recorded for the operator.
RequestCodecStep
One named step in a request/reply translation.
UpstreamError
Why an upstream could not be opened.

Traits§

BridgePeer
One side of the bridge, at envelope granularity.
CrossProtocolCodec
A codec that translates request and reply envelopes between the downstream leg’s protocol and the upstream’s protocol.
ToolResultCodec
Reads and writes a ToolResult in one revision’s wire encoding.
Upstream
Opens upstreams, one per downstream client.

Functions§

negotiate_downstream
Settles the downstream leg of a handshake.
run_client
Runs one client from end to end against its own upstream.

Type Aliases§

SendFuture
The future BridgePeer::send returns.