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

@simfinity/constellation-client

v1.0.19

Published

```bash npm install @simfinity/constellation-client # or yarn add @simfinity/constellation-client ```

Readme

@simfinity/constellation-client

Installation

npm install @simfinity/constellation-client
# or
yarn add @simfinity/constellation-client

Purpose & Usage

This package is a code wrapper to integrate the Simfinity constellation server. The constellation server is a proxy managing streaming sessions with third party LLMs. This package provides the programmatic functions covering the complete lifecycle of a streaming session:

  • Open/start session
  • Callbacks to continuously send and receive streamed data over a persistent connection
  • Close/end session

Server implementation insight

The Constellation server is chat-room & session manager: upon receiving a session-start request, it creates a persistent chat-room, initiates the persistent connection with the LLM and configures it accordingly (e.g. system instruction, temperature, audio, transcript subscription...). Clients may lose connection with Constellation, but the chat-room will remain opened on server side, this allows the client to reconnect and resume the session. Clients MUST notify the server that a session has ended, so that Constellation can release allocated resources.

Example

Key steps in pseudo-code:

const client = new WebClient({
     sessionEndpoint: "https://simfinity.constellation.com", 
     streamingEndpoint: "wss://simfinity.constellation.com:30003",
     key: "my-key",
     llm: "openai",
});

try {
    /* ... */
    
    // Start a chat session
    await client.startSession(true);
    await client.connect(true, {
        onStreamClosed: (reason: string) => {
            console.log("Stream connection lost");
        },
        onAudioResponseStart: () => {
            console.log("The model is talking");
        },
        onAudioResponseChunk: (audioChunk: string) => {
            audioPlayer.enqueue(audioChunk);
        },
        onAudioResponseEnd: () => {
            console.log("The model is done talking");
        }
    });

    /* ... */
    
    client.sendAudioChunk("{PCM16 Base64-encoded data}");
    client.commitAudioChunksSent();
    
    /* ... */
}
catch {
    
}
finally {
    await endSession();
}

Types

Configuration

Configuration required to initiate a connection with the server: In the client, values would typically be stored in secret stores & environment variables

export interface WebClientConfig {
     sessionEndpoint:    string;
     streamingEndpoint:  string;
     key:    string;
     llm:    LlmType;
     model:  string;
}

Event hooks

Callback functions to catch all the propagated server events. Except for the onStreamClosed event, assigning hooks is optional: non-observed events will be silently ignored & lost.

export interface EventHandlers {
     onStreamClosed: (reason: string) => void;
     onAudioResponseStart?: () => void;
     onAudioResponseChunk?: (audioChunk: string) => void;
     onAudioResponseEnd?: () => void;
     onTranscriptInput?: (transcript: string) => void;
     onTranscriptResponse?: (transcript: string) => void;
     onTechnicalError?: (error: string) => void;
}

Audio

  • The server expect exclusively base64 encoded PCM16 format & sends responses of the same format in return
  • The server implements VAD - voice activation detection. Configured to detect 1s silences as a response trigger
  • Therefore, input audio data chunks can be streamed immediately without buffering
  • Client should however implement voice detection as well to reduce network consumption
    • 500ms ring buffer continuously filled with audio input
    • Noise detection with minimum threshold

Text & Transcript

  • The transcript inputs/responses callbacks carry both the text exchanges and transcription of audio exchanges
  • In an audio session, text and audio inputs will trigger:
    • a mirrored transcript text through onTranscriptInput
    • an audio response through onAudioResponseChunk
    • a text transcript of the audio response through onTranscriptResponse
  • In a text-only session, a text input will trigger:
    • a mirrored transcript text through onTranscriptInput
    • a text response through the onTranscriptResponse callback