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;
        onAvatarStatus?(cb: (status: LiveKitAvatarStatus) => void): void;
        onDisconnected(cb: (reason?: string) => void): void;
        onParticipantJoin(cb: (participant: LiveKitParticipant) => void): void;
        onParticipantLeave(cb: (participantIdentity: string) => void): void;
        onVideoSourceEnded?(cb: (source: LiveKitVideoSourceEnd) => void): void;
        onVideoTrack?(cb: (frame: LiveKitVideoFrame) => void): void;
        publishAudioFrame(pcm: ArrayBuffer): void;
        publishAvatarMedia?(chunk: LiveKitAvatarMediaChunk): 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: (reason?: string) => 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

    • Subscribes sampled camera and screen frames from people who let agents see them (what the agent SEES). Only fires when the session's configuration asked the room client to watch. Optional: an SDK without inbound video omits it. "Latest handler wins."

      Parameters

      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 piece of the agent's live avatar: the room client decodes it, publishes the face on the bot's camera track (at its first frame) and the voice on its audio track, lip-synced. This is the bot's only video out. Optional: an SDK without avatar publishing omits it, and the avatar's pieces are dropped.

      Parameters

      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>