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

@live-assistant/core

v0.3.4

Published

Provider-neutral ports for an in-app voice assistant: the session, its events, audio, and the result type they share.

Downloads

1,197

Readme

@live-assistant/core

The provider-neutral heart of Live Assistant. It depends on nothing, runs anywhere JavaScript does, and knows about no UI framework.

Just want it working? @live-assistant/react-native installs all of this and gives you <LiveAssistant tokenEndpoint="…" /> — one component that builds the session, the audio, the controller and the widget. Reach for the packages below it when you want to hold the pieces apart.

npm install @live-assistant/core

Install this directly when you are assembling the pieces yourself. An app that wants the whole thing installs @live-assistant/react-native instead.

What is in it

  • AssistantController runs a whole voice session headlessly: the start order (microphone access before a token is spent), mute, the echo gate, interruptions, transcript assembly, serialised tool calls, goAway resumption and a silence timeout. Read state with getState() / subscribe() (shaped for useSyncExternalStore), and levels with inputLevel / outputLevel — never through state.
  • ToolRegistry, AssistantTool, ToolDefinition hold the functions the model may call. Every call is answered, including unknown names and handlers that throw; withdrawn calls never run.
  • AssistantSession, AssistantMicrophone, AssistantPlayer are the ports. Implement them to add a provider or an audio back-end — that is all @live-assistant/gemini and @live-assistant/audio are.
  • LevelTimeline, toDisplayLevel, smoothLevel turn audio into numbers you can draw.
  • Result and AssistantFailureCode: nothing throws across the boundary, and no failure carries user-facing text.

Minimal use, no React

import { AssistantController, ToolRegistry } from '@live-assistant/core';

const assistant = new AssistantController({
  session, microphone, player,           // the three ports
  tools: new ToolRegistry([/* … */]),
  getConnection: async () => fetchTokenFromYourServer(),
});

const stop = assistant.subscribe(() => console.log(assistant.getState().status));
await assistant.start();

Acting on the page, with nothing registered

createPageTools() gives the assistant a page tool that reads and drives the document the user is looking at: read, list, navigate, back, press, type, scroll. AssistantController registers it by itself wherever a document exists, so on the web an app that declares no tools at all still has an assistant that can do things.

new AssistantController({ …, page: false });                  // off
new AssistantController({ …, page: { actions: ['read'] } });  // narrowed
new AssistantController({ …, page: { root: '#app', maxCharacters: 2000 } });

It reads the live DOM at the moment of the call — no route table, nothing to register on a new screen — and names targets by their accessible name, which is what a screen reader announces and what the user just said out loud. Following a link clicks it rather than assigning the url, so a single-page router stays in charge and the live session survives. A target that is not there is answered with the names that are.

On a phone there is no document, so the pack is inert unless you pass page: { router: { go, back, current } } — three functions, and navigate and back are then the two actions the model is offered.

| Option | Default | What it does | | --- | --- | --- | | actions | all seven | Which the model may use; a word left out never reaches it | | name | 'page' | The tool's name | | root | the document | A CSS selector the tools are confined to | | maxCharacters | 4000 | Cap on read | | maxTargets | 40 | Cap on list, per kind | | router | — | Navigation where there is no DOM | | document / window | the globals | For tests, an iframe or a server render |

See the overview for the whole picture, including the token server your getConnection talks to.

A working app that puts this together: examples/expo-app.