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

@yofriadi/pi-lsp

v1.16.11

Published

```bash pi install git:github.com/yofriadi/pi-extensions@lsp-v<version> ```

Readme

LSP Extension Scaffold

Install from git URL

pi install git:github.com/yofriadi/pi-extensions@lsp-v<version>

To load only this extension from the monorepo package source, use package filtering in settings:

{
  "packages": [
    {
      "source": "git:github.com/yofriadi/pi-extensions@lsp-v<version>",
      "extensions": ["packages/lsp/src/index.ts"]
    }
  ]
}

Standalone package scaffold for pi LSP integration work.

Scope

This extension package now includes:

  • Runtime lifecycle management for an LSP subprocess (Bun spawn when available, Node child_process.spawn fallback) + JSON-RPC initialize/shutdown
  • PATH/Mason-first server resolution with lightweight user/project config
  • Multi-server registry with file-type routing and workspace fallback selection
  • Full lsp tool action surface (diagnostics, definition, references, hover, symbols, rename, status, reload)
  • Backward-compatible lsp_health status alias
  • Write-through hooks that run format-on-write and diagnostics-on-write for successful write/edit results

The extension remains opt-in and does not alter default pi behavior unless loaded.

Lightweight Server Config

Server resolution order:

  1. User config: ~/.pi/agent/lsp.json|yaml|yml (fallback: ~/.pi/lsp.json|yaml|yml)
  2. Project config: <cwd>/.pi/lsp.json|yaml|yml (overrides user config)
  3. Mason bin directories before regular PATH
  4. Small built-in candidate list (no large bundled server catalog)

Supported config keys:

  • serverCommand: string or string array, e.g. ["typescript-language-server", "--stdio"]
  • server: command name/path with optional args
  • serverCandidates: explicit command candidates in probe order
  • servers: named multi-server map/array entries with command/server+args, optional fileTypes, and disabled

When servers is present, the extension starts each resolved server and routes document-scoped requests by fileTypes (extension or filename). Workspace-scoped requests target the first ready server.

Package Layout

  • src/index.ts: extension entrypoint and runtime/tool/hook wiring
  • src/client/runtime.ts: single LSP client lifecycle, JSON-RPC request surface, diagnostics cache
  • src/client/registry.ts: multi-server runtime orchestration and per-path routing
  • src/config/resolver.ts: server command/config resolution (single and multi-server)
  • src/tools/lsp-tool.ts: full lsp tool schema/action routing + lsp_health alias
  • src/hooks/writethrough.ts: format-on-write and diagnostics-on-write hooks

Install and Load

Upstream pi

# Load for one run
pi -e ./packages/coding-agent/examples/extensions/lsp

# Install as local package source
pi install ./packages/coding-agent/examples/extensions/lsp

Fork Workflow

Use whichever launcher your fork environment provides:

# Source-run from repo
bun packages/coding-agent/src/cli.ts -e ./packages/coding-agent/examples/extensions/lsp

# If your fork is installed as a separate binary (example name)
pib -e ./packages/coding-agent/examples/extensions/lsp

Usage

After loading the extension:

  • Run /lsp-status to inspect runtime/config/transport state, including per-server routing/status details.
  • Use the lsp tool with action-based params:
    • status
    • reload
    • hover / definition / references / rename (require path, line, character)
    • symbols (use query for workspace mode or path for document mode)
    • diagnostics
  • Successful write/edit tool results automatically trigger format+diagnostics hooks and show a summary notification.

Test Coverage

Focused extension tests:

  • packages/lsp/test/runtime.test.ts
    • lifecycle readiness and JSON-RPC id handling
  • packages/lsp/test/resolver.test.ts
    • multi-server config resolution and project-over-user override behavior
  • packages/lsp/test/registry.test.ts
    • per-file routing and workspace fallback selection

Run focused validation:

bunx vitest run packages/lsp/test/runtime.test.ts packages/lsp/test/resolver.test.ts packages/lsp/test/registry.test.ts