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

@microsoft/voice-widget-core-client

v0.2.0

Published

Provider-neutral VoiceAgentProvider contract, events, and provider registry for the Voice Agent Widget SDK. No UI, no provider-specific code.

Readme

@microsoft/voice-widget-core-client

The provider-neutral contract for the Voice Agent Widget SDK: the VoiceAgentProvider interface, event/config types, and the provider registry. No UI, no provider-specific code.

What's here

  • TypesVoiceAgentProvider, SessionRequest, SessionGrant (discriminated union: webrtc/direct vs websocket/relay), ProviderConfig, ConnectionStatus + AgentMode (orthogonal axes), VoiceAgentProviderEvents, ConnectOptions, ClientTool(s), capabilities.
  • Client-tool typesClientToolRegistry / createClientToolRegistry (core-owned live registry; unique names, identity-guarded unregister), ClientToolPolicy (followUpResponse?), UnhandledClientToolCall, SdpNegotiationResult (carries clientToolPolicy from the broker).
  • Broker lifecycle hooksConnectOptions.negotiate creates the media session, sendSessionEvent forwards control events, and endSession closes the broker-owned control session during teardown.
  • RegistryregisterProvider / createProvider / hasProvider / listProviders. Providers self-register so the widget can resolve provider="…" to an adapter without the core importing any provider package.

Audio primitives

Provider-neutral browser audio toolkit under src/audio/ (re-exported from the package root):

  • MicCapturegetUserMedia + an AudioWorklet capture processor; emits mono 16-bit PCM frames at a target rate (resampled from the context rate) plus a smoothed input level; setMuted.
  • AudioPlayback — streaming PCM playback via an AudioWorklet queue; enqueue (16-bit or Float32), clear for barge-in/interruption, setMuted, output level, onDrained.
  • createStreamLevelMeterAnalyserNode-based output level for a MediaStream (used by the WebRTC path, where agent audio is a remote stream rather than a PCM queue).
  • HelpersfloatToPcm16, pcm16ToFloat, resampleLinear, rms.

Any provider implementation lives in a separate provider package (e.g. @microsoft/voice-widget-provider-voicelive).

clientTools vs dynamicClientTools capability flags

Providers that support client-side tools advertise one of two feature flags:

  • features.clientTools — the adapter takes a snapshot of handlers at connect() time; handlers registered after connect() are not seen by the running session.
  • features.dynamicClientTools — the adapter does a live lookup of the handler from the registry at each call, so handlers can be added or removed during a session via VoiceAgentCore.registerClientTool. Most useful when handler availability changes after connect (lazy-loaded handlers or provider-scoped hooks).

Both flags describe handler resolution in the browser — tool schemas are declared server-side (model mode: session.update; agent mode: the Foundry agent definition). Delivery of the agent's function call to the browser is supported for model and agent targets.

Usage

import { registerProvider, createProvider } from "@microsoft/voice-widget-core-client";
import { AcmeProvider } from "./acme-provider.js";

// A provider package registers a factory on import. Each widget gets its own instance.
registerProvider("acme", () => new AcmeProvider());

// Session owners request a fresh adapter by name:
const provider = createProvider("acme");