@pouchy_ai/companion-sdk - v0.1.0
    Preparing search index...

    Interface CompanionCall

    interface CompanionCall {
        close: () => void;
        injectEvent: (text: string, speak?: boolean) => void;
        interrupt: () => void;
        provider: "elevenlabs-convai" | "openai-realtime";
    }
    Index
    close: () => void

    Hang up. Idempotent.

    injectEvent: (text: string, speak?: boolean) => void

    Inject an out-of-band context line. speak: true makes the companion react now; false stages it for the next turn.

    interrupt: () => void

    SILENT CUT (0.36.0): stop the utterance currently being spoken WITHOUT generating any new speech — the "stale commentary at a beat boundary" case (field request: fast-paced game, last hand's commentary still playing when the next hand starts). Idempotent: a no-op when nothing is playing, after close(), and mid-connect.

    Provider tiers (check provider):

    • openai-realtime — GUARANTEED: cancels the active response and clears the WebRTC output buffer (response.cancel + output_audio_buffer.clear); playback stops within ~an audio frame. The session continues normally.
    • elevenlabs-convai — BEST-EFFORT: the EL client exposes no public "stop playback" API; we signal user_activity (halts the agent's stream when the agent's interruption handling allows) and attempt the client's internal output-buffer cut when the installed build exposes it. Verify on your rig; worst case it degrades to a no-op — for a guaranteed preemption on EL, injectEvent(text, true) (which DOES speak new content) remains the reliable lever.
    provider: "elevenlabs-convai" | "openai-realtime"