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

@gonk/tool-orchestrator

v0.3.1

Published

Composes ToolRegistry instances into a principal-aware catalog with discovery, ranking, introspection, and pin lifecycle.

Readme

@gonk/tool-orchestrator

Composes one or more ToolRegistry instances into a single catalog with discovery, ranking, and pin lifecycle. Auto-registers meta-tools the model can use to find and load on-demand tools.

What it does

  • Composes registries — multiple sources unioned into one dispatch surface.
  • Search & recommend — keyword/tag-based ranker by default, fully pluggable.
  • Per-adapter visibility — reads hints.{mcp,pi}.visibility to override def.visibility per scope.
  • Pin lifecyclepin() and unpin() queue; commitPins() flushes at adapter-chosen boundaries (turn boundary / compaction). Append-only with tombstones for prompt-cache stability.
  • Meta-tools auto-registered (visibility: always):
    • list_tools — list all known tools, filterable by category/tag/visibility
    • find_tools — keyword search across name, description, tags, keywords
    • get_tool — full schema + metadata for a specific tool
    • load_tool — pin a tool for the rest of the session
    • unload_tool — unpin

When ToolContext.auth is present, all six discovery/introspection meta-tools authorize tool.discover against canonical tool names before returning names, descriptions, schemas, rankings, or changing pins. Targeting a hidden tool has the same result as targeting a missing tool and does not mutate pin state. Trusted no-auth local invocation preserves the legacy full-catalog behavior.

Search & ranking

find_tools uses BM25 with weighted fields: name (3×), category (2×), description/tags/keywords (1×). Constants: k1=1.2, b=0.75. The default ranker (bm25Search) is exported and pluggable — pass a custom search function to createOrchestrator to replace it. legacySubstringSearch is exported as a fallback for callers that need simple substring matching.

Active set semantics

activeSet() = { always tools, sorted by name } ∪ { committed pins, in pin order }

Deterministic, byte-stable between commits — meant to be safe to put in the prompt prefix without busting cache.

Entry points

import { createOrchestrator } from "@gonk/tool-orchestrator";
import type { Orchestrator } from "@gonk/tool-orchestrator/types";
import { metaTools } from "@gonk/tool-orchestrator/meta-tools";

Example

import { ToolRegistry } from "@gonk/tool-registry";
import { createOrchestrator } from "@gonk/tool-orchestrator";

const r = new ToolRegistry();
r.register([/* ...your tools... */]);

const orch = createOrchestrator({
  registries: [r],
  scope: "pi",                // resolves per-adapter visibility hints
  pinStore: { load, save },   // optional persistence — Pi: session-scoped; MCP: ephemeral
});

orch.search("audio");                 // → ranked tools
orch.activeSet();                     // → tools to expose to the model right now
orch.pin("watch-todos");
await orch.commitPins();              // narrow→broad active-set rebuild