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

@spences10/pi-lsp

v0.0.17

Published

Pi extension that exposes Language Server Protocol diagnostics, hover, definition, and reference tools

Downloads

2,376

Readme

@spences10/pi-lsp

npm version built with Vite+ tested with Vitest

Pi extension that exposes Language Server Protocol diagnostics, hover, definitions, references, and document symbols to the model.

Maintained in the my-pi Vite+ workspace and tested with Vitest.

Installation

pi install npm:@spences10/pi-lsp

Local development from this monorepo:

pnpm --filter @spences10/pi-lsp run build
pi install ./packages/pi-lsp
# or for one run only
pi -e ./packages/pi-lsp

Required language servers

This package talks to language-server binaries installed in your project or on PATH. For TypeScript, JavaScript, and Svelte projects:

pnpm add -D typescript typescript-language-server svelte-language-server

Supported server discovery includes:

  • TypeScript / JavaScript via typescript-language-server
  • Svelte via svelteserver
  • Python via python-lsp-server
  • Go via gopls
  • Rust via rust-analyzer
  • Ruby via solargraph
  • Java via jdtls
  • Lua via lua-language-server

Project-local binaries in node_modules/.bin are detected before global binaries, but are untrusted by default because they can execute repo-controlled code. Interactive sessions prompt before starting a project-local binary; headless sessions fall back to the global PATH binary unless MY_PI_LSP_PROJECT_BINARY=allow or MY_PI_LSP_PROJECT_BINARY=trust is set. /lsp status shows the resolved binary path for running and idle servers.

Language servers receive a restricted child-process environment by default. Use MY_PI_LSP_ENV_ALLOWLIST=NAME,OTHER_NAME or the shared MY_PI_CHILD_ENV_ALLOWLIST to pass selected ambient variables through.

Tools

The extension registers LSP-backed Pi tools for:

  • diagnostics
  • hover
  • definitions
  • references
  • document symbols

These tools let the model inspect types, find usages, and catch diagnostics without guessing from text search alone.

Model reminder

When LSP tools are active, the extension injects a small system prompt reminder telling the model to use LSP for focused diagnostics, type and symbol questions, definitions, references, and validation before reporting completion. It also reminds the model to run diagnostics on changed language-server-supported files before completion or commit, preferring lsp_diagnostics_many for batches.

Commands

/lsp status
/lsp list
/lsp restart all
/lsp restart <language>

Use /lsp status to inspect active clients and /lsp restart after dependency installs or language-server crashes.

Using from a custom harness

import lsp from '@spences10/pi-lsp';

// pass `lsp` as an ExtensionFactory to your Pi runtime

my-pi imports this package directly and enables it as the built-in LSP extension.

Development

pnpm --filter @spences10/pi-lsp run check
pnpm --filter @spences10/pi-lsp run test
pnpm --filter @spences10/pi-lsp run build

License

MIT