Member Junction
    Preparing search index...

    Interface BridgeRealtimeRuntime

    The runtime handle returned by RealtimeClientSessionService.WireBridgeRealtimeSession — the server long-lived (bridged) counterpart to what PrepareClientSession returns for the browser. The bridge holds this for the life of the session: the observability run ids (for nesting + correlation) and an idempotent Finalize that keeps the co-agent run + prompt run from dangling in Running. It runs when the session's Close() is invoked, once the model session has closed, and when the connection drops; whichever comes first runs it, and a later call waits for that run.

    interface BridgeRealtimeRuntime {
        CancelInFlightDelegations: () => number;
        CancelPendingNarration: () => void;
        CoAgentRunID?: string;
        Finalize: (success: boolean, errorMessage?: string) => Promise<void>;
        PromptRunID?: string;
        SetLocalToolHandler: (handler: BridgeLocalToolHandler) => void;
        WatchesMeetingVideo: boolean;
    }
    Index

    Properties

    CancelInFlightDelegations: () => number

    Aborts every delegated run currently in flight for this session (and drops pending narration). This is the EXPLICIT cancel — on a phone it backs the cancel_pending_work tool — and is deliberately NOT what a barge-in does (see CancelPendingNarration). Returns how many were aborted (0 when nothing was running; never throws).

    CancelPendingNarration: () => void

    Drops any queued spoken progress update without touching the delegated work — what a barge-in does. The caller took the floor, so a pending "still working on it" is stale, but the jobs they asked for keep running. Never throws.

    CoAgentRunID?: string

    The MJ: AI Agent Runs row id created for this voice session (delegated runs nest under it).

    Finalize: (success: boolean, errorMessage?: string) => Promise<void>

    Writes the session's last usage, then finalizes the co-agent + prompt run; usage reported afterwards is not stored. Closing the session runs it after the model session closed, so what the session reports while closing is kept; calling it before Close() would drop that report. Idempotent, so every teardown path may call it: it runs once, and every call returns the first call's promise and resolves only once the runs are finalized. The first call decides the outcome: its success and errorMessage stand.

    The session's Close() finalizes with success true, so a host whose bridge start failed calls Finalize(false, error) BEFORE it closes the session: the run, its prompt run and its step then read Failed with the start's error, and the close finalizes nothing more.

    Type Declaration

      • (success: boolean, errorMessage?: string): Promise<void>
      • Parameters

        • success: boolean

          true → Completed, false → Failed.

        • OptionalerrorMessage: string

          Why the session failed, stamped on the failed run, prompt run and step. Ignored on success.

        Returns Promise<void>

    PromptRunID?: string

    The MJ: AI Prompt Runs row id for the session's system prompt.

    SetLocalToolHandler: (handler: BridgeLocalToolHandler) => void

    Installs (or clears, with undefined) the host's local tool handler. A tool call whose name the handler BridgeLocalToolHandler.Handles is executed by the host instead of the shared delegation path.

    WatchesMeetingVideo: boolean

    Whether the agent watches LiveKit meetings (realtime.video.watchMeetings in its effective configuration, which includes the voiced agent's own). The room coordinator reads it, with whether the session takes video, to decide whether the bot reads the cameras and screens people allow.