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

@open-agent-kit/bridge

v1.5.0

Published

Bridge module for SAALT

Readme

SAALT Bridge

The Bridge is the TypeScript SDK that plugins use to communicate with a SAALT server. It wraps the SAALT Admin API into a typed, ergonomic client so plugin code never has to deal with raw HTTP.

Installation

npm install @open-agent-kit/bridge

What it does

When a plugin runs, it receives a signed JWT and the server URL. Passing those two values to createBridge returns a ready-to-use client:

import { createBridge } from "@open-agent-kit/bridge";

const bridge = createBridge({ token, serverUrl });

The bridge exposes the following namespaces:

| Namespace | What it gives you | | ------------------------ | --------------------------------------------------------------------------------------------------------------- | | bridge.llm | Generate text, structured objects, images, or full conversation responses via the configured LLM | | bridge.files | Upload, retrieve, and parse files (PDFs, images, Office documents) — including OCR and model-powered extraction | | bridge.knowledge | List knowledge documents and trigger sync operations | | bridge.conversation | Look up a single conversation (findFirst) or list an agent's conversations (findMany) | | bridge.data.config | Read and write plugin-level configuration | | bridge.data.pluginData | Persistent key/value storage scoped to the plugin | | bridge.user | Retrieve the current user, their permissions on this app, the groups behind them and the app's users |

All calls are authenticated automatically using the token provided at construction time.

Users, permissions and groups

bridge.user.permissions(): Promise<string[]>
bridge.user.groups(): Promise<UserGroup[]>
bridge.user.appGroups(): Promise<UserGroup[]>

Check once, then branch on the result:

const permissions = await bridge.user.permissions();
if (permissions.includes("view_settings")) {
  // show the settings
}
  • Keys come exactly as declared in /meta, without the app.<id>. prefix.
  • Users with app.use who are App Admin of the app (system role Admin on the app) or Super Admin get every declared key. A plugin admin through the org permission global.edit_plugins without app.use gets []. Keys the app no longer declares are left out.
  • Requires Core 1.9.0 or later (CORE-1642); an older Core throws HTTP 404.
  • Standalone apps only; for an agent-scoped app all three calls return [].
  • The calls need a logged-in user. Cron, knowledge and anonymous /api/* calls throw HTTP 400.
  • groups() returns only the user's groups that have a role on this app.
  • appGroups() returns every group that has a role on this app and is meant for a share picker. The plugin decides who sees the list; do not show it to users who should not see these group names.

An app declares its permissions in /meta as permissions: [{ key, name: { en, de? }, description?: { en, de? } }]. A key matches ^[a-z0-9_]{1,50}$, and use and admin are reserved. name.en is required and non-empty; a name is at most 100 characters and a description at most 500. An invalid entry is dropped on its own and the rest stays; with duplicate keys the first entry wins. Only the first 200 entries are looked at and at most 50 are kept. Use the exported AppPermission type to type it.

Users of the app

bridge.user.appUsers(query?: { search?: string; limit?: number } | { ids: string[] }): Promise<AppUser[]>
// AppUser = { id, name, email }
const matches = await bridge.user.appUsers({ search: "anna", limit: 10 }); // share picker
const owners = await bridge.user.appUsers({ ids: storedUserIds }); // resolve stored ids to names

The types AppUser and AppUsersQuery are exported (type-only).

  • Requires Core 1.9.0 or later with CORE-1704. Detect an old Core by error.status === 404.
  • An admin has to enable "User directory" ("Benutzerverzeichnis") on the app's Advanced page; it is off by default. Until then the call throws HTTP 403 (userDirectoryDisabled); detect it by error.status === 403 together with the message containing userDirectoryDisabled (another bridge 403 is possible).
  • Needs a user in the token: cron, webhooks and the machine API throw HTTP 400.
  • Lists only users who hold app.use on this app (through an app role, Super Admin, or a group with either); deactivated users are left out. The calling user needs app.use too, otherwise the result is []. Standalone apps only.
  • Give either search or ids, not both. search matches name or e-mail, case-insensitively, and needs 2–100 characters after trimming (a blank one counts as absent); limit is 1–50, default 20. ids takes at most 50 ids and returns only those that qualify; an empty array returns [] without a request. Without either you get the first limit users. Results are ordered by name. Anything else throws HTTP 400.
  • An ids entry for a user who lost access or is deactivated is silently absent: treat it as an unknown user.
  • To probe availability use { search: "<2+ chars>", limit: 1 }, not ids: [] (that answers [] without a request).
  • Plugin guidance: debounce and rate-limit the picker, never pass a client-supplied limit or an empty query through, verify recipients with appUsers({ ids }) before storing them, store ids rather than names or e-mails, and show e-mail addresses only to users who may share, not to everyone who can open the app.

Text-to-speech

bridge.llm.generateSpeech turns a script into audio with a Gemini TTS model. Use gemini-3.8-flash-tts or gemini-3.8-flash-lite-tts; the 2.5 and 3.1 preview models shut down on 2026-11-17.

// Single voice
const { base64, mimeType } = await bridge.llm.generateSpeech({
  model: "gemini-3.8-flash-tts",
  text: "Welcome to the show.",
  voiceName: "Kore",
});

// Two-speaker conversation, one part per turn (needed for Gemini 3.8 multi-speaker)
const dialogue = await bridge.llm.generateSpeech({
  model: "gemini-3.8-flash-tts",
  text: "Alex: Hi Sam.\nSam: Hello Alex.", // not sent when `turns` is set
  speakers: [
    { speaker: "Alex", voiceName: "Kore", style: "Warm and upbeat" },
    { speaker: "Sam", voiceName: "Puck", style: "Calm, a little dry" },
  ],
  turns: [
    { speaker: "Alex", text: "Hi Sam." },
    { speaker: "Sam", text: "Hello Alex." },
  ],
});
  • text is the script for a single voice, or a direction preamble plus transcript for speakers without turns. voiceName picks the single-speaker voice; speakers takes precedence when set.
  • turns ({ speaker, text }[]) makes Core send one part per turn with speechMetadata.speaker. When it is set, text is not sent: Gemini 3.8 rejects system instructions for TTS, so a direction preamble would be spoken as an extra part. Put the direction in speakers[].style instead.
  • speakers[].style is an optional per-speaker delivery direction, sent with that speaker's turns. It is ignored without turns.
  • Validation (400): at most 2 speakers; turns need exactly 2 speakers with unique names, every turn's speaker must be one of them, at most 150 turns and 20,000 characters of turn text in total; style at most 1000 characters.

The answer is { base64, mimeType: "audio/wav" }. A WAV the provider returns is passed through unchanged, including its C2PA provenance chunk; raw PCM is wrapped into a WAV.

Failed calls throw an Error whose message is HTTP <status>: <statusText>: 400 for validation errors and for a provider rejection, 429 when the provider's rate limit is reached, 502 when the provider is unavailable. Core's response body carries the provider's detail on a 400.

Speech-to-text

The transcription routes need the SAALT Core release that ships them (as does files.deleteFile). Core holds the endpoints and keys of its registry models; getAvailableTranscriptionModels() lists the configured ones with public details only (key, displayName, locationLabel?, pricing.perMinute) and defaultModel, the first of them. The list can be empty: handle that case.

const { models } = await bridge.llm.getAvailableTranscriptionModels();
if (models.length === 0) throw new Error("No transcription model configured");

// Store the recording in the plugin's own file namespace, then reference it by
// the same path you gave putFile.
await bridge.files.putFile(base64, "recordings/meeting.mp3");

const { jobId } = await bridge.llm.startTranscription({
  model: models[0].key,
  audioPath: "recordings/meeting.mp3",
  mimeType: "audio/mpeg",
  language: "de",
  responseFormat: "verbose_json",
  timestampGranularities: ["word"],
});
// Poll getTranscription(jobId) until `state` is final, read `result`, then deleteTranscription(jobId).

Options: language, prompt, temperature, and the provider fields responseFormat (json | verbose_json | diarized_json), timestampGranularities, chunkingStrategy (auto) and diarize, sent only when set; which of them a model takes is the caller's knowledge. The answer is the provider's, in the shape of OpenAI's transcription response: text, language?, duration? (seconds), segments? (as the provider returned them) and words? ({ word, start, end, speaker? }). Segmenting and speaker naming are up to the plugin.

Failed calls throw an Error whose message is HTTP <status>: <statusText> followed by Core's message, with a status property and, when Core sent a Retry-After, retryAfterSeconds.

Jobs

| Call | What it does | | --------------------------------------------- | ------------------------------------------------------------------------------------------ | | startTranscription(params) -> { jobId } | Validates the request and queues the job. | | getTranscription(jobId) -> TranscriptionJob | state: queued, running, succeeded, failed or cancelled, plus result/error. | | cancelTranscription(jobId) | Stops the upstream request. Idempotent. | | deleteTranscription(jobId) | Removes the job and its transcript from Core. |

  • Jobs take audioPath only and only Core's registry models; a catalogue model or a gemini-* id is refused (400/404). A job's result has the same shape as transcribe's.
  • Limits (fixed in Core): 20 open and 2 running jobs per plugin, a result of at most 10 MB, results kept 6 hours after the job ended. A job is visible only to the plugin and agent that started it, not scoped to a user.

Synchronous transcribe

transcribe takes audioPath or audioBase64 and holds one HTTP request open for the whole recording, so it suits short clips. The self-hosted and Gemini registry models run only as jobs; Core refuses them here. At most 2 calls per plugin run at once in one Core process; more answer 429.

Breaking changes since 1.4.0-alpha.0

  • transcribe and a job's result return the provider's passthrough answer (text, language?, duration?, segments?, words?) instead of TranscribeResult (segments with speakers, durationSeconds).
  • TranscriptionModelInfo carries only key, displayName, locationLabel? and pricing; the limit and capability fields are gone.
  • transcribeAndWait is removed; poll getTranscription yourself.
  • The transcription env knobs are constants in Core now.

Learn more