ProtectedfeaturesThe capability flags for the provider this bridge instance serves. Populated from the RealtimeBridgeContext at BaseRealtimeBridge.Connect time (and may be set by the engine immediately after construction). Drives BaseRealtimeBridge.RequireFeature.
ProtectedproviderThe provider's display name for this bridge instance, used in capability-error messages. Populated from the RealtimeBridgeContext; falls back to the driver class name.
ReadonlySentEvery frame the engine sent outbound, in order — a capture sink for assertions in tests. The frames are ALSO echoed back inbound; this array is the durable record of what was sent.
The provider's supported-feature flags for this bridge instance.
Read-only accessor over the internally-held BaseRealtimeBridge.features. The engine consults this (and the underlying provider metadata) to decide which optional methods are safe to call; a driver consults it via BaseRealtimeBridge.RequireFeature.
Whether the loopback is currently "connected" (after Connect, before Disconnect).
The enabled Meeting Controls event source (or null), typed concretely so tests can drive its
Emit* helpers. GetMeetingControlsEventSource returns the same instance via the interface.
ProtectedapplyCaptures the connection context onto the instance so BaseRealtimeBridge.Features, BaseRealtimeBridge.RequireFeature, and capability-error messages have the provider's flags and name. A concrete BaseRealtimeBridge.Connect should call this first.
The bridge context handed to Connect.
"Connects" the loopback endpoint. Records the context for capability gating and returns synthetic handles. No network, no platform — always succeeds. After connecting, emits an initial roster (the synthetic agent participant) to any registered roster handler.
The bridge context (features, provider name, address).
Synthetic bot + connection identifiers.
Tears the loopback endpoint down and drops all handlers. Always clean.
Why the disconnect happened (unused — loopback teardown is uniform).
Pushes an inbound media frame directly into the registered OnMedia handler, simulating the endpoint producing media (what the agent hears) WITHOUT an outbound echo. Lets a test exercise the inbound half of the transport seam in isolation.
The inbound frame to deliver.
Drives a roster change, delivering the supplied participants to the registered OnParticipantChange handler. Lets a test exercise participant tracking.
The roster to deliver.
Enables (and returns) a simple LoopbackMeetingControlsEventSource so this loopback driver
contributes a Meeting Controls surface — used by tests of the engine's channel-plane wiring. The
returned source's Emit* helpers drive roster / speaking / hand-raise signals into the channel.
The enabled event source (the same instance GetMeetingControlsEventSource returns).
Flushes any outbound media the driver has queued for the endpoint — the agent's not-yet-played voice. The engine calls this on a true barge-in (the user interrupts the agent) so the agent stops talking immediately instead of draining already-buffered audio after the model was cut off.
No-op by default (NOT capability-gated): a driver with no client-side outbound buffer simply has nothing to flush, so calling this is always safe. Drivers that buffer outbound audio override it.
Returns the loopback's Meeting Controls event source when EnableMeetingControls was
called, else null (the base default — no facilitator surface).
Returns the loopback roster — a single synthetic agent participant. Overrides the
capability-gated base method (gated by SpeakerDiarization, which the loopback provider
enables in its feature set).
The synthetic participant list.
ProtectednotBuilds the standard BridgeCapabilityNotSupportedError for an un-overridden virtual method or a failed feature requirement, stamped with this bridge's provider name.
The feature / method name to report.
The error to throw or reject with.
Registers the inbound-media handler. The loopback echoes outbound frames to this handler.
Invoked with each (echoed) inbound media frame.
Registers a roster-change handler. The loopback fires it once at Connect time with the synthetic participant; EmitParticipants lets tests drive further roster changes.
Invoked with the updated participant list on each change.
ProtectedRequireDefense-in-depth guard: asserts a SupportedFeatures flag is enabled before the driver
performs a capability-gated action, throwing BridgeCapabilityNotSupportedError if it
is false/omitted. An overriding driver method should call this at its top so that even a
direct (engine-bypassing) caller cannot run an action the metadata says is off.
The IBridgeProviderFeatures flag to require.
Sends DTMF tones on a telephony bridge.
Capability-gated by SupportedFeatures.DTMF. Throws unless overridden by a telephony driver.
The DTMF digit string to send (e.g. '1234#').
A promise that resolves once the tones have been sent.
Sends an outbound media frame — and echoes it straight back through the inbound handler,
re-stamped to the matching inbound track (audio-out → audio-in, etc.). This is what makes
the loopback round-trip provable: what the agent "says" is immediately what the agent "hears",
so a test can drive the realtime-session output and observe it arrive back as session input.
The outbound track the frame targets.
The media frame to send (and echo).
Transfers the call to another party on a telephony bridge.
Capability-gated by SupportedFeatures.CallTransfer. Throws unless overridden.
The transfer target (a phone number or platform endpoint identifier).
A promise that resolves once the transfer has been initiated.
An in-memory, platform-free Realtime Bridge driver for test and development.
LoopbackBridgeproves the transport seam round-trips media with NO external conferencing or telephony platform: every frame sent via SendMedia is echoed straight back through the inbound OnMedia handler (re-stamped to the matching inbound track), and GetParticipants returns a single synthetic agent participant. Wired into AIBridgeEngine with a mockIRealtimeSession, it demonstrates that bridge → session → bridge media flow works end-to-end — the deferred "unified-transport track" foundation, validated with zero infrastructure.It declares an audio-capable, diarizing feature set so the engine exercises both the media seam and participant tracking against it. Telephony/recording features stay off (their virtual base methods keep throwing
NotSupported), so the loopback driver also documents the capability-gating contract by example.Registered via
@RegisterClass(BaseRealtimeBridge, 'LoopbackBridge').