Member Junction
    Preparing search index...

    The live, in-memory handle for one running bridged session held by the engine. Carries the driver, the wired realtime session, the per-session turn-taking policy, and the persisted bridge row id so teardown can reach all of them.

    interface ActiveBridgeSession {
        AddressingMode?: ResolvedTurnAddressingMode;
        AgentID?: string;
        AgentNames: string[];
        AgentRole?: string;
        AgentRunID?: string;
        AgentSessionID: string;
        AvatarInit?: Fmp4Init;
        AvatarReplaced?: boolean;
        BotParticipantID?: string;
        Bridge: BaseRealtimeBridge;
        ChannelHost?: IBridgeChannelHost;
        ConnectedAtMs: number;
        ContextUser?: UserInfo;
        DisableAutoResponse: boolean;
        DtmfCoalescer?: DtmfCoalescer;
        Ending: boolean;
        ExecuteServerChannelTool?: (
            toolName: string,
            argsJson: string,
        ) => Promise<BridgeChannelToolResult>;
        FloorReleaseTimer?: Timeout;
        FullDuplex: boolean;
        HasSeenHuman: boolean;
        HoldsFloor: boolean;
        HumanSpeech?: HumanSpeechDetector;
        IsTranscriptScribe: boolean;
        LastActivityMs: number;
        LastInboundSpeaker?: string;
        LastSessionHeartbeatMs: number;
        LastUserSpeechEndMs?: number;
        LeaveGraceTimer?: Timeout;
        MetadataProvider?: IMetadataProvider;
        ModelRecovering: boolean;
        ModelRecoveryAttempts: number;
        ModelSideMatcher?: ModelSideAddressedMatcher;
        OnBargeIn?: () => void;
        OnSessionEnded?: (reason: BridgeDisconnectReason) => void | Promise<void>;
        ParticipationMode: "proactive" | "addressed-only";
        Provider: MJAIBridgeProviderEntity;
        RealtimeSession: IRealtimeSession;
        RecoverRealtimeSession?: BridgeRealtimeSessionRecovery;
        RecoverRealtimeSessionWithoutAvatar?: BridgeRealtimeSessionRecovery;
        RoomKey?: string;
        SeenVideoSources: Map<string, string>;
        ServerChannelTools: BridgeChannelToolDefinition[];
        SessionBridgeID: string;
        TargetAgentID?: string;
        TranscriptSink?: BridgeTranscriptSink;
        TranscriptTail: BridgeTranscriptTurn[];
        TurnGate?: FullDuplexTurnGate;
        TurnPolicy: TurnTakingPolicy;
        TurnTakingAnnounced?: boolean;
        TurnTakingToolHandler?: BridgeTurnTakingToolHandler;
    }
    Index

    Properties

    How this session decides it was addressed (the mode actually in effect after capability resolution).

    AgentID?: string

    The voicing agent's MJ: AI Agents id — stamped on this agent's transcript lines for attribution.

    AgentNames: string[]

    The names/aliases this agent answers to (moderator roster + addressed-only fallback).

    AgentRole?: string

    A short role/description of the voiced agent (moderator relevance context).

    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 id the bridge is attached to.

    AvatarInit?: Fmp4Init

    The avatar stream's latest init segment, read: its audio track's timescale lets the floor gate count an avatar piece's speaking time. Every stream (a turn, a resumed or replaced model session) opens with its own init.

    AvatarReplaced?: boolean

    Whether the model session was already replaced because its avatar could not be shown (once per session).

    BotParticipantID?: string

    This session's own bot participant id on the endpoint — the speaker label on its own transcript lines.

    The concrete driver instance transporting media.

    ChannelHost?: IBridgeChannelHost

    The server-side channel host wired for this session (Part A), or undefined when the caller supplied none. Held so teardown can close the session's channels.

    ConnectedAtMs: number

    Epoch-ms when this session connected — drives the max-session-duration cap of the stale sweep.

    ContextUser?: UserInfo

    The context user the session runs as (for participant upserts / teardown writes).

    DisableAutoResponse: boolean

    Whether the model's blind auto-response is OFF for this session (multi-agent meeting). When true the bridge is the sole speech trigger — a Speak decision issues one RequestSpokenUpdate. When false the model auto-responds and the engine stays hands-off (forcing would double-fire).

    DtmfCoalescer?: DtmfCoalescer

    Coalesces the caller's keypad presses into one note for the model (telephony only).

    Ending: boolean

    Set once the session is being torn down, so a model-loss signal during teardown is ignored.

    ExecuteServerChannelTool?: (
        toolName: string,
        argsJson: string,
    ) => Promise<BridgeChannelToolResult>

    Executes ONE server-channel tool call for this session, routed through the channel host. Bound by the runner-constructing layer to RealtimeSessionRunner.ExecuteServerChannelTool. undefined when no channel host was supplied. Never throws — resolves to a structured failure.

    FloorReleaseTimer?: Timeout

    Safety timer that force-releases a held floor after FLOOR_MAX_HOLD_MS in case the agent's final transcript never arrives — so one agent can't wedge the room's floor closed. Cleared on a normal release.

    FullDuplex: boolean

    Whether this session operates in full-duplex conversational mode.

    HasSeenHuman: boolean

    Whether at least one HUMAN participant has been seen in the room. Auto-leave only fires after a human was present and then all humans left — so a bot that joins ahead of anyone (or a momentarily bot-only roster at startup) is never reaped prematurely. Set by the occupancy check off the driver roster.

    HoldsFloor: boolean

    Whether this session currently holds the room's speaking floor (multi-agent floor control). Set when the engine claims the floor before triggering speech in meeting mode, cleared when the agent's own final transcript lands (it finished) or on teardown. Single-agent rooms always hold trivially.

    HumanSpeech?: HumanSpeechDetector

    Detects human speech in inbound room audio so the room's agents yield to it; present with ActiveBridgeSession.TurnGate.

    IsTranscriptScribe: boolean

    Whether THIS session is the room's transcript scribe. Exactly one session per room writes the unified meeting transcript (its own speech + everything it hears), so a multi-agent room records one copy, not N. Elected at connect (first session in the room); re-elected if the scribe leaves.

    LastActivityMs: number

    Epoch-ms of the last inbound activity (transcript) — drives the idle cap of the stale sweep.

    LastInboundSpeaker?: string

    The participant identity of the most-recent inbound AUDIO frame (when the provider diarizes). Used to attribute a 'user' transcript to the speaker who produced it — since the model transcript itself has no speaker label. Approximate (single-speaker-at-a-time); undefined until the first diarized frame.

    LastSessionHeartbeatMs: number

    Epoch-ms of the last write of the agent session row's LastActiveAt.

    LastUserSpeechEndMs?: number

    High-resolution timestamp (ms) when the most recent user turn completed, for transcript-to-next-audio latency telemetry.

    LeaveGraceTimer?: Timeout

    Pending grace timer started when the last human leaves. If a human rejoins within the grace window (e.g. a page refresh) it is cleared; otherwise it fires AIBridgeEngine.StopBridgeSession so the bot leaves the empty room and its co-agent run finalizes. Cleared on any teardown.

    MetadataProvider?: IMetadataProvider

    The metadata provider bound to this session's entity operations.

    ModelRecovering: boolean

    Whether a model-session recovery is in flight; inbound audio is dropped meanwhile.

    ModelRecoveryAttempts: number

    How many times the model session has been re-opened (capped by MAX_MODEL_RECOVERY_ATTEMPTS).

    ModelSideMatcher?: ModelSideAddressedMatcher

    The model-side addressing latch the model's i_am_addressed signal feeds — present only in ModelSide mode.

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

    End-of-session hook (see StartBridgeSessionParams.OnSessionEnded).

    ParticipationMode: "proactive" | "addressed-only"

    This agent's participation style for the room moderator ('proactive' | 'addressed-only').

    The provider row backing this session.

    RealtimeSession: IRealtimeSession

    The realtime session the driver's media plane is wired to.

    RecoverRealtimeSession?: BridgeRealtimeSessionRecovery

    Model-session recovery factory (see StartBridgeSessionParams.RecoverRealtimeSession).

    RecoverRealtimeSessionWithoutAvatar?: BridgeRealtimeSessionRecovery

    The audio-only replacement factory (see StartBridgeSessionParams.RecoverRealtimeSessionWithoutAvatar).

    RoomKey?: string

    The room key (driver ExternalConnectionId) this session is in — the unified-transcript room grouping.

    SeenVideoSources: Map<string, string>

    The camera and screen sources whose frames reached the current model session (SourceID → the label the model was given). A source not in it is new to the model, which is told what it can now see before its first frame; when one in it ends, the model is told, by that label, that it can no longer see it (and only about sources it actually saw). Cleared when a recovered session replaces the model.

    ServerChannelTools: BridgeChannelToolDefinition[]

    The server-executed tool definitions the session's channels contributed at connect (e.g. the Meeting Controls facilitator tools). Empty when no channel host / no contributing channels. The runner-constructing layer registers these as RealtimeSessionRunner.ServerChannelTools.

    SessionBridgeID: string

    The AIAgentSessionBridge row id (the durable record).

    TargetAgentID?: string

    The TARGET agent this co-agent voices (role/identity source for the moderator), when distinct from ActiveBridgeSession.AgentID.

    TranscriptSink?: BridgeTranscriptSink

    This session's own transcript sink (see StartBridgeSessionParams.TranscriptSink), when supplied.

    TranscriptTail: BridgeTranscriptTurn[]

    The last final transcript turns, kept so a re-opened model session can be told what was said.

    The floor gate over this full-duplex model's outbound audio (see FullDuplexTurnGate); absent for turn-based models.

    TurnPolicy: TurnTakingPolicy

    The per-session turn-taking policy gating generation.

    TurnTakingAnnounced?: boolean

    Whether this session has been told how to take turns in a shared room (the framing note is sent once, when the room becomes multi-agent).

    TurnTakingToolHandler?: BridgeTurnTakingToolHandler

    Executes the turn-taking host tools (i_am_addressed, yield_turn) for this session. Present for full-duplex / model-side sessions in a room; the layer that owns the model session binds it as its local tool handler (the tool DEFINITIONS are TURN_TAKING_TOOL_DEFINITIONS).