npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kuralle-agents/realtime-audio

v0.11.0

Published

Realtime audio pipeline for Kuralle — multi-provider speech-to-speech and orchestration.

Readme

@kuralle-agents/realtime-audio

⏸️ Paused for now. Kuralle is hardening text as the primary primitive. The realtime model code here is kept intact, but the realtime VoiceDriver is off the framework's headline API (it lives behind @kuralle-agents/core/runtime) and is not part of the active stability program. For voice today, prefer cascaded voice over text via @kuralle-agents/livekit-plugin (STT → Kuralle text runtime → TTS). Provider-native speech-to-speech will resume later.

Provider-native realtime audio for Kuralle — speech-to-speech voice agents powered by Gemini Live, OpenAI Realtime, or xAI Grok Realtime, with Kuralle keeping tool, flow, and handoff authority.

Install

npm install @kuralle-agents/realtime-audio

Peer dependencies:

npm install @kuralle-agents/core ai zod

What it does

Unlike the cascaded path in @kuralle-agents/livekit-plugin (STT → LLM → TTS), provider-native realtime sends raw audio directly to the model and receives audio back in a single connection — lower latency, no transcript round-trip.

Whole-answer content gates are advisory on native realtime audio. The provider speaks audio as it generates it, before any Kuralle gate runs, so a blocking gate cannot un-speak audio already played — it emits a safety-* event and speaks a correction utterance (post-hoc). The reliable controls on native realtime are input-side gating (pre-turn policies) and tool authority (tools return data, not conversational text). On the cascaded substrate, by contrast, Kuralle controls the emission boundary and the gate is preventive.

  • VoiceEngine — call acceptor. Accepts incoming audio connections and creates per-call VoiceCallSession workers that bridge a transport to the chosen provider.
  • VoiceCallSession / RealtimeCallWorker — per-call lifecycle: connects to the provider, routes tool calls through Kuralle runtime, manages session state.
  • GeminiLiveSession — thin wrapper around @google/genai live.connect(); manages the WebSocket to Gemini, PCM audio encoding, tool dispatch, and session resumption.
  • OpenAIRealtimeClient — OpenAI Realtime API client.
  • CloudflareRealtimeAdapter — plugs any RealtimeAudioClient into Kuralle runtime authority inside a Cloudflare Durable Object.
  • CloudflareGeminiLiveClient, CloudflareOpenAIRealtimeClient, CloudflareXAIGrokRealtimeClient — Cloudflare Workers variants.
  • createGeminiClientFactory / createOpenAIClientFactory — provider client factories.
  • voiceAgentToRuntimeAgent — converts a VoiceAgentConfig to a standard Kuralle agent config.

Usage

import { VoiceEngine, createGeminiClientFactory } from '@kuralle-agents/realtime-audio';

const engine = new VoiceEngine({
  agents: [
    {
      id: 'support',
      name: 'Support Agent',
      instructions: 'You are a support agent.',
      voice: 'Charon',
      tools: { /* Kuralle tool definitions */ },
    },
  ],
  defaultAgentId: 'support',
  modelClientFactory: createGeminiClientFactory({
    apiKey: process.env.GOOGLE_API_KEY!,
    model: 'gemini-2.5-flash-preview-native-audio',
  }),
});

// Accept a call from any transport (WebSocket, LiveKit, etc.)
const session = await engine.acceptCall({
  callId: crypto.randomUUID(),
  transport: myTransportSession, // implements TransportSession
});

await session.start();

Related