Member Junction
    Preparing search index...

    The minimal LiveKit room SDK surface the import('./livekit-bridge').LiveKitBridge depends on. Production binds this to livekit-server-sdk + a room client; tests inject a FakeLiveKitRoomSdk.

    interface ILiveKitRoomSdk {
        connect(args: LiveKitConnectArgs): Promise<LiveKitConnectResult>;
        disconnect(): Promise<void>;
        flushOutboundAudio(): void;
        getParticipants(): Promise<LiveKitParticipant[]>;
        onAudioTrack(cb: (frame: LiveKitAudioFrame) => void): void;
        onDisconnected(cb: () => void): void;
        onParticipantJoin(cb: (participant: LiveKitParticipant) => void): void;
        onParticipantLeave(cb: (participantIdentity: string) => void): void;
        publishAudioFrame(pcm: ArrayBuffer): void;
        publishScreenFrame(frame: ArrayBuffer): void;
        publishVideoFrame(frame: ArrayBuffer): void;
        sendDataMessage(text: string): Promise<void>;
    }

    Implemented by

    Index

    Methods

    • Flushes all pending/queued outbound audio (the agent's voice). Called on barge-in so the agent stops talking immediately instead of draining already-buffered audio after the model is cut off.

      Returns void

    • Subscribes inbound per-participant audio frames (what the agent hears, carrying the speaker identity for diarization). "Latest handler wins." The SFU never echoes the bot's own published audio back, so frames here are always from OTHER participants.

      Parameters

      • cb: (frame: LiveKitAudioFrame) => void

        Invoked with each inbound, per-participant audio frame.

      Returns void

    • Registers a callback fired when the room disconnects the bot (SFU closed / bot removed). "Latest handler wins."

      Parameters

      • cb: () => void

        Invoked when the room has disconnected.

      Returns void

    • Registers a callback fired when a participant disconnects. "Latest handler wins."

      Parameters

      • cb: (participantIdentity: string) => void

        Invoked with the participant identity that left.

      Returns void

    • Publishes one raw PCM audio frame on the bot's audio track (the agent's voice into the room).

      Parameters

      • pcm: ArrayBuffer

        The PCM audio bytes to publish.

      Returns void

    • Publishes one raw screen-share frame on the bot's screen track (e.g. a Remote Browser channel's viewport). LiveKit does full screen share.

      Parameters

      • frame: ArrayBuffer

        The encoded/raw screen frame bytes to publish.

      Returns void

    • Publishes one raw video frame on the bot's camera track. LiveKit does full video; the realtime models light audio first, so this is wired but typically unused until a model emits video.

      Parameters

      • frame: ArrayBuffer

        The encoded/raw video frame bytes to publish.

      Returns void

    • Sends a text message on the LiveKit data channel (reliable publish to all participants) — the room-native "chat".

      Parameters

      • text: string

        The chat/data message text.

      Returns Promise<void>