Member Junction
    Preparing search index...

    Parameters for AIBridgeEngine.StartBridgeSession.

    The engine does NOT construct the realtime model — the caller injects the already-open IRealtimeSession (or a session factory) so the engine stays testable without a real provider and so the realtime model's lifecycle stays owned by the agent/session layer above.

    interface StartBridgeSessionParams {
        Address: string;
        AgentID?: string;
        AgentNames?: string[];
        AgentRole?: string;
        AgentRunID?: string;
        AgentSessionID: string;
        BindSdk?: BridgeNativeSdkBinding;
        ChannelHost?: IBridgeChannelHost;
        Configuration?: Record<string, unknown>;
        ContextUser?: UserInfo;
        Direction?: "Inbound" | "Outbound";
        DisableAutoResponse?: boolean;
        FullDuplex?: boolean;
        FullDuplexTurnGate?: boolean;
        JoinMethod?:
            | "InMeetingCommand"
            | "InboundRoute"
            | "Invite"
            | "NativeInvite"
            | "OnDemand"
            | "Scheduled";
        MetadataProvider?: IMetadataProvider;
        OnBargeIn?: () => void;
        OnSessionEnded?: (reason: BridgeDisconnectReason) => void | Promise<void>;
        ParticipationMode?: "proactive" | "addressed-only";
        Provider: MJAIBridgeProviderEntity;
        RealtimeSession: IRealtimeSession;
        RecoverRealtimeSession?: BridgeRealtimeSessionRecovery;
        RecoverRealtimeSessionWithoutAvatar?: BridgeRealtimeSessionRecovery;
        TargetAgentID?: string;
        TranscriptSink?: BridgeTranscriptSink;
        TurnAddressing?: TurnAddressingMode;
        TurnMatcher?: IAddressedMatcher;
        TurnMode?: BridgeTurnMode;
        TurnScorer?: IWorthSayingScorer;
        TurnTuning?: Partial<
            Omit<TurnTakingPolicyConfig, "Mode" | "Matcher" | "Scorer">,
        >;
    }
    Index

    Properties

    Address: string

    The endpoint address — a meeting join URL/ID (meetings) or a phone number (telephony).

    AgentID?: string

    The voicing agent's MJ: AI Agents id — used only to attribute this agent's transcript lines.

    AgentNames?: string[]

    The names/aliases this agent answers to — the moderator's roster entry + the addressed-only fallback.

    AgentRole?: string

    A short role/description of the voiced agent — context the moderator uses to judge relevance.

    AgentRunID?: string

    The voiced agent's MJ: AI Agent Runs id — tied to each moderator prompt run for observability.

    AgentSessionID: string

    The MJ: AI Agent Sessions row this bridge attaches to (the session IS the existing session).

    Optional per-session override for binding the driver's SDK factory, applied to the resolved driver just before Connect. When supplied it takes precedence over the BridgeNativeSdkRegistry default — use it to choose a non-default binding for a provider that has more than one (e.g. Zoom's RTMS receive-only binding instead of the native two-way default) or to inject a fake in a test. When omitted, the engine applies the provider's registered native binding (if any).

    ChannelHost?: IBridgeChannelHost

    Optional server-side channel-plane host (Part A — the generic channel wiring). When supplied, the engine starts the session's channels through it at connect, constructs a Meeting Controls channel from the driver's BaseRealtimeBridge.GetMeetingControlsEventSource (when the driver contributes one), feeds the realtime session's SendContextNote perception sink into the channel context, and surfaces the contributed server tools + executor onto the returned ActiveBridgeSession so the runner-constructing layer binds them to RealtimeSessionRunner.ServerChannelTools / ExecuteServerChannelTool.

    Additive and optional: IRealtimeSession-only callers (no channel plane) keep working untouched. In production this is an adapter (in @memberjunction/ai-agents, which owns RealtimeChannelServerHost) over the channel host; here the engine depends only on the IBridgeChannelHost interface so it takes no heavy dependency on the agents package.

    Configuration?: Record<string, unknown>

    Per-session bridge configuration (resolved credential refs, region, …) passed to the driver.

    ContextUser?: UserInfo

    The MJ user the bridge session runs as; every session is owned + audited by a user.

    Direction?: "Inbound" | "Outbound"

    Connection direction. Defaults to 'Outbound'.

    DisableAutoResponse?: boolean

    Multi-agent meeting mode. When true, the realtime model's blind auto-response was disabled at session start (the agent layer set disableAutoResponse on the model session), so the BRIDGE is the sole speech trigger: on a Speak turn decision the engine issues exactly one RequestSpokenUpdate. When false/absent the model auto-responds and the engine must NOT also trigger (it would double-fire). Must agree with what the session was opened with. See plans/realtime/multi-agent-meeting-turn-taking.md.

    FullDuplex?: boolean

    Whether this session is full-duplex. When omitted, defaults to RealtimeSession.Capabilities?.FullDuplex === true.

    FullDuplexTurnGate?: boolean

    Whether a full-duplex model's outbound audio runs through the room floor gate in a MULTI-agent room (the safety net behind the model's own turn-taking). Defaults to true; sessions whose model is not full-duplex are never gated. Set false to let a full-duplex agent speak freely (debugging).

    JoinMethod?:
        | "InMeetingCommand"
        | "InboundRoute"
        | "Invite"
        | "NativeInvite"
        | "OnDemand"
        | "Scheduled"

    How the agent connected. Defaults to 'OnDemand'.

    MetadataProvider?: IMetadataProvider

    The request-scoped metadata provider for all entity operations (multi-provider safe).

    OnBargeIn?: () => void

    Called when the caller/participant talks over the agent (a true barge-in). The telephony host uses it to drop queued spoken progress, which is now stale. It must NOT abort delegated work: the host policy (mirroring the browser runtime, RealtimeSessionRuntime.ts ~L1956-1963) is that the user keeps talking while delegated work runs, and cancelling on speech would kill exactly the jobs they asked for. Explicit cancellation is a separate act (the phone's cancel_pending_work tool). Must not throw; a throw is logged and swallowed.

    OnSessionEnded?: (reason: BridgeDisconnectReason) => void | Promise<void>

    Called once at the end of AIBridgeEngine.StopBridgeSession for this session, after the bridge row is terminal — the place for the host to close the rest of the session's bookkeeping (the agent session row, a capacity lease). Must not throw; a throw is logged and swallowed.

    ParticipationMode?: "proactive" | "addressed-only"

    This agent's participation style in a MULTI-agent room, surfaced to the room turn moderator: 'proactive' (default) may jump in unaddressed when judged relevant; 'addressed-only' speaks only when directly addressed. Ignored in single-agent rooms.

    The bridge provider to transport through (resolved to its DriverClass for ClassFactory).

    RealtimeSession: IRealtimeSession

    The live realtime session the bridge media plane wires to. Injected (not constructed here) so the engine never depends on a concrete realtime provider — the transport seam is the only coupling, and it is to the IRealtimeSession interface.

    RecoverRealtimeSession?: BridgeRealtimeSessionRecovery

    Re-opens the model session after it drops mid-call, seeded with the conversation so far. When absent a dropped model session ends the call. Called at most MAX_MODEL_RECOVERY_ATTEMPTS time(s) per session; the returned session MUST use the same audio sample rates as the one it replaces.

    RecoverRealtimeSessionWithoutAvatar?: BridgeRealtimeSessionRecovery

    Re-opens the model session WITHOUT its avatar, seeded with the conversation so far, when the bridge reports it can no longer show the avatar (BaseRealtimeBridge.OnAvatarUnavailable: its decoders kept failing, or the room refused the video track). The replacement renders audio only, so the model stops generating video nobody sees. Called at most once per session, apart from RecoverRealtimeSession's attempts. When absent, the session goes on as it is (audio still plays; the avatar's video is generated and not shown).

    TargetAgentID?: string

    The TARGET agent this co-agent voices (the role/identity the user hears — e.g. Sage), when distinct from StartBridgeSessionParams.AgentID (the generic co-agent). The moderator resolves the agent's role

    • per-agent turnTaking.mode from this agent's config.
    TranscriptSink?: BridgeTranscriptSink

    Where THIS session's final transcript lines go. When set, every final line (both roles) is written through it directly — no room scribe is elected and the process-wide transcript sink is bypassed. A phone call uses it to write into the call's own conversation instead of a shared "Meeting Room" one.

    TurnAddressing?: TurnAddressingMode

    How this session decides it was addressed. 'Auto' (the default when set) uses the MODEL's own judgement when its session reports full-duplex capability and falls back to name matching otherwise; 'ModelSide' / 'Regex' force one. When omitted the engine keeps the legacy behaviour and uses StartBridgeSessionParams.TurnMatcher as given. An explicit TurnMatcher is still honoured as the Regex-side matcher (e.g. a 1:1 call's always-addressed matcher).

    TurnMatcher?: IAddressedMatcher

    The addressed-matcher for Passive/Hybrid turn-taking (e.g. a RegexAddressedMatcher built from the agent's name + aliases). Required for Passive/Hybrid to ever speak.

    TurnMode?: BridgeTurnMode

    Turn-taking mode for the session. Defaults to 'Passive' (speak only when addressed). The engine builds a TurnTakingPolicy from this and StartBridgeSessionParams.TurnMatcher/ StartBridgeSessionParams.TurnScorer.

    TurnScorer?: IWorthSayingScorer

    The "worth saying" scorer for Active/Hybrid turn-taking.

    TurnTuning?: Partial<
        Omit<TurnTakingPolicyConfig, "Mode" | "Matcher" | "Scorer">,
    >

    Optional extra turn-taking tuning (silence window, throttle, score threshold, clock).