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

mu-repomap

v0.15.0

Published

Repomap plugin for mu — code indexing and symbol search

Readme

mu-repomap

Code indexing and layered symbol discovery plugin for mu-core. Builds a repository map using AST parsing, watches for file changes, and exposes a list_symbols tool for LLM agents.

Install

npm install mu-repomap

Usage as Plugin

import { PluginRegistry } from "mu-core";
import { createRepomapPlugin } from "mu-repomap";

const registry = new PluginRegistry({ cwd: process.cwd(), config: {} });
await registry.register(createRepomapPlugin({ pageSize: 20 }));

Once registered, the plugin:

  • Indexes the repository on activation
  • Watches for file changes and rebuilds incrementally
  • Advertises the list_symbols tool in the system prompt (no file list preloaded)
  • Provides a paginated, layered list_symbols tool the LLM can call
  • Shows indexing status in the status bar

list_symbols Tool

A layered discovery tool — the LLM is instructed to descend progressively to avoid context overflow. Each layer returns at most pageSize entries (default 20) and ends with a Next: hint pointing to the deeper layer.

| Layer | Query | Returns | |---|---|---| | L0 — roots | (empty) | Top-level directories with file/export counts | | L1 — directory | dir:<path> | Files + immediate subdirs under <path> | | L2 — file | file:<path> | All exports in the file (no refs) | | L3 — symbol | sym:<name> or sym:<name>@<file> | Definition + paginated refs |

Pagination

Every layer is paginated. When a result is truncated:

Page 1/3 — 20 of 47 shown
Next: list_symbols("dir:packages/mu-core/src", page:2)

Override the page size with the pageSize parameter (only when you've confirmed the layer is small):

list_symbols({ query: 'file:src/big.ts', pageSize: 100 })

Example flow

list_symbols()
→ 5 root dirs (alpha-sorted, page 1/1)

list_symbols("dir:packages/mu-core/src")
→ subdirs + files of mu-core/src

list_symbols("file:packages/mu-core/src/session.ts")
→ all exports of session.ts (line-sorted)

list_symbols("sym:Session")
→ Session class definition + first 20 refs

list_symbols("sym:Session", page: 2)
→ next 20 refs

list_symbols("sym:Session@packages/mu-core/src/session.ts")
→ disambiguate when multiple files define the same name

Standalone Usage

import { buildRepomap, listSymbols, RepomapManager } from "mu-repomap";

// Build a repomap directly
const map = await buildRepomap("/path/to/project");

// Layered discovery
console.log(listSymbols(map, { query: '' }));
console.log(listSymbols(map, { query: 'dir:src' }));
console.log(listSymbols(map, { query: 'sym:MyClass', page: 2 }));

// Or use the singleton manager (cached + watcher-friendly)
const manager = RepomapManager.getInstance(process.cwd());
await manager.listSymbols({ query: 'file:src/index.ts' });

Options

interface RepomapOptions {
  /** Default page size for `list_symbols`. Per-call `pageSize` arg overrides. */
  pageSize?: number; // default 20
}

Slash Commands

| Command | Effect | |---|---| | /repomap | Show index stats | | /repomap:rebuild | Force a full rebuild |

Requirements

License

MIT