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

pi-fast-context

v1.0.1

Published

AI-driven semantic code search for the Pi coding agent — Windsurf SWE-grep protocol as a native pi package.

Readme

Fast Context for Pi

AI-driven semantic code search as a Pi coding agent package — powered by Windsurf's reverse-engineered SWE-grep protocol.

This is a port of fast-context-mcp from MCP to a native Pi extension. Search logic is unchanged: a remote Devstral model proposes rg / readfile / tree commands, they run locally, and you get file paths, line ranges, and grep keywords.

How It Works

You: "where is the authentication logic?"
         │
         ▼
┌─────────────────────────┐
│  Fast Context (pi ext)  │
│                         │
│  1. Maps project → /codebase
│  2. Sends query to Windsurf Devstral API
│  3. AI generates rg/readfile/tree commands
│  4. Executes commands locally (bundled rg)
│  5. Returns results to AI
│  6. Repeats for N rounds
│  7. Returns file paths + line ranges
│     + suggested search keywords
└─────────────────────────┘

Prerequisites

  • Node.js >= 20
  • Pi coding agent
  • Windsurf / Devin account — free tier works (needed for an API key)

No system ripgrep install is required (@vscode/ripgrep is bundled).

Install

From npm:

pi install npm:pi-fast-context

From git:

pi install git:github.com/hemo94931/pi-fast-context

Try once without persisting:

pi -e npm:pi-fast-context

Project-local (writes .pi/settings.json):

pi install -l npm:pi-fast-context

From a local checkout:

pi install /absolute/path/to/pi-fast-context

After install, start pi and confirm the tools with /tools, or run /fast-context status.

Setup

Run /fast-context setup inside pi. It extracts a key from the local Devin/Windsurf install and writes:

{getAgentDir()}/extensions/pi-fast-context/config.json

getAgentDir() is Pi's agent config directory (~/.pi/agent by default, or $PI_CODING_AGENT_DIR). Do not hardcode that path.

You can also set WINDSURF_API_KEY yourself; the env var wins over config.json.

If local discovery finds no key, /fast-context setup prompts you to paste one. The value is shown as • per character (not plaintext, not a blank field). Enter saves it; an empty value errors without writing files; Esc cancels setup.

Search key resolution: env var → config.json → live Devin/Windsurf discovery.

Desktop credentials (used by setup / live discovery) are tried in this order: Devin, legacy Deviv, then Windsurf.

| Platform | Path | |----------|------| | macOS | ~/Library/Application Support/Devin/User/globalStorage/state.vscdb | | Windows | %APPDATA%/Devin/User/globalStorage/state.vscdb | | Linux | ~/.config/Devin/User/globalStorage/state.vscdb |

On WSL/Linux, discovery first checks Devin CLI credentials at ~/.local/share/devin/credentials.toml. If a Windows-extracted key returns 403 inside WSL, run devin login inside WSL and retry.

The key is never printed in full. /fast-context setup persists it in config.json for later sessions.

Tools and commands

fast_context_search

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | query | string | Yes | — | Natural language search query | | project_path | string | No | cwd | Absolute path to project root | | tree_depth | integer | No | 3 | Directory tree depth for repo map (1-6). Auto-falls back if tree exceeds 250KB. | | max_turns | integer | No | 3 | Search rounds (1-5) | | max_results | integer | No | 10 | Maximum files to return (1-30) | | exclude_paths | string[] | No | [] | Patterns excluded from the repository map |

Example output:

Found 3 relevant files.

  [1/3] /project/src/auth/handler.py (L10-60, L120-180)
  [2/3] /project/src/middleware/jwt.py (L1-40)
  [3/3] /project/src/models/user.py (L20-80)

grep keywords: authenticate, jwt.*verify, session.*token

[config] tree_depth=3, tree_size=12.5KB, max_turns=3

/fast-context

  • /fast-context or /fast-context status — whether a key is available (env or config.json)
  • /fast-context setup — extract a local Devin/Windsurf key and write {getAgentDir()}/extensions/pi-fast-context/config.json

Environment Variables

| Variable | Default | Description | |----------|---------|-------------| | WINDSURF_API_KEY | (config.json, then auto-discover) | Windsurf API key | | FC_MAX_TURNS | 3 | Search rounds per query | | FC_MAX_COMMANDS | 8 | Max parallel commands per round | | FC_TIMEOUT_MS | 30000 | Connect-Timeout-Ms for streaming requests | | FC_RESULT_MAX_LINES | 50 | Max lines per command output | | FC_LINE_MAX_CHARS | 250 | Max characters per output line | | FC_CACHE_DISABLED | (unset) | Disable the in-memory result cache (1 / true / yes / on) | | FC_CACHE_TTL_MS | 300000 | Result-cache TTL; <=0 disables caching | | FC_CACHE_MAX_ENTRIES | 200 | Maximum in-memory cache entries | | FC_ALLOW_INSECURE_TLS | (unset) | Set to 1 only when a trusted corporate proxy requires disabled TLS verification | | WS_MODEL | MODEL_SWE_1_6_FAST | Windsurf model name | | WS_APP_VER | 1.48.2 | Windsurf app version (protocol metadata) | | WS_LS_VER | 1.9544.35 | Windsurf language server version (protocol metadata) |

Available Models

Change the model with WS_MODEL.

Available Models

Default: MODEL_SWE_1_6_FAST — fastest speed, richest grep keywords, finest location granularity.

Package layout

pi-fast-context/
├── package.json              # pi manifest (extensions)
├── extensions/index.ts       # Pi extension: tools + /fast-context
├── src/                      # Search core (unchanged from fast-context-mcp)
├── test/
└── README.md

How the Search Works

  1. Project directory is mapped to virtual /codebase path
  2. Directory tree generated at requested depth (default L=3), with automatic fallback if tree exceeds 250KB
  3. Query + directory tree sent to Windsurf's Devstral model via Connect-RPC/Protobuf
  4. Devstral generates tool commands (ripgrep, file reads, tree, ls, glob)
  5. Commands executed locally in parallel (up to FC_MAX_COMMANDS per round)
  6. Results sent back to Devstral for the next round
  7. After max_turns rounds, Devstral returns file paths + line ranges
  8. All rg patterns used during search are collected as suggested keywords
  9. Diagnostic metadata appended so the calling model can retune parameters

Technical Details

  • Protocol: Connect-RPC over HTTP/1.1, Protobuf encoding, gzip compression
  • Model: Devstral (MODEL_SWE_1_6_FAST, configurable)
  • Local tools: rg (bundled via @vscode/ripgrep), readfile (Node.js fs), tree (tree-node-cli), ls (Node.js fs), glob (Node.js fs)
  • Auth: API Key → JWT (auto-fetched per session)
  • Runtime: Node.js >= 20 (ESM). Pi loads extensions/index.ts via jiti — no compile step.

Dependencies

| Package | Purpose | |---------|---------| | @vscode/ripgrep | Bundled ripgrep binary (cross-platform) | | tree-node-cli | Cross-platform directory tree | | sql.js | Read Devin/Windsurf's local SQLite DB without a native build |

Pi core packages (@earendil-works/pi-coding-agent, typebox) are peer dependencies provided at runtime.

Credit

Search core ported from SammySnake-d/fast-context-mcp (MIT).

Not affiliated with Windsurf, Codeium, or Cognition.

License

MIT. Copyright (c) 2025 SammySnake-d; Copyright (c) 2026 hemo94931.