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-jev-context

v0.1.0

Published

Reversible, relevance-based context pruning for Pi, powered by TypeSafe Jev.

Readme

A Pi extension that uses TypeSafe Jev to judge which older messages are still useful. Low-scoring content is hidden from future model requests, not deleted from your session.

Opt-in · Reversible filtering · Branch-aware cache · No extra runtime dependencies

Get started

Requires Pi 0.85.1+, Node.js 22.19+, and a TypeSafe API key. TypeSafe usage can incur charges. Jev is a separate judgment service, not your main coding model.

Install from GitHub now:

pi install git:github.com/kevinpita/pi-jev-context

After the first npm release:

pi install npm:pi-jev-context

Restart Pi or run /reload, then:

/login typesafe
/jev on

Enter your key in Pi's secret prompt. Do not paste it into a conversation. TYPESAFE_API_KEY is also supported. Pruning is off by default.

Data leaves your machine when enabled. Candidate assistant history, tool arguments, text results, and recent conversation excerpts go to https://api.typesafe.ai/v1/systemone. They can contain private code or secrets. Review your data policy before enabling this extension. No TypeSafe requests are made while disabled.

What changes?

| Kept intact | Eligible for judging | | :--- | :--- | | User requirements and system instructions | Complete text-only tool call/result pairs | | todo operations and extension messages | Assistant text and readable thinking | | Images, incomplete tool exchanges, summaries | User shell history included in model context | | Latest five tool pairs during active work | Older eligible history outside that buffer |

A candidate stays when its keep probability is greater than the threshold. The default is 0.8, so 0.81 stays and 0.80 is hidden. This is aggressive. Lower the threshold to retain more information.

Session history -> Jev relevance judgments -> Filtered model context
       |                                         |
       +-- Original messages stay intact         +-- /jev off restores visibility

You stay in control

| Command | Use it to | | :--- | :--- | | /jev on | Enable pruning or resume judging after an error | | /jev off | Stop requests and restore unfiltered history | | /jev status | Inspect settings and cached judgments | | /jev threshold 0.5 | Keep more history using cached scores | | /jev buffer 5 | Protect the latest five tool pairs during active work | | /jev cache on | Judge only new or changed candidates, the default | | /jev cache off | Rejudge eligible history each time | | /rejev | Rejudge the active branch while idle, including hidden candidates |

Visuals are illustrated previews, not live-session captures or benchmark results. The command preview uses the extension's actual notification text with sample state.

Designed for long sessions

  • Complete exchanges only. Tool calls and results are removed together. Parallel tool batches finish before judging starts.
  • Branch-aware state. Settings and successful judgments persist with the session branch.
  • Reversible decisions. /rejev can bring hidden content back when the task changes.
  • Cancellation support. New input and session navigation cancel pending scans.
  • Visible savings. A successful idle scan shows estimated context reduction. This is not a billing claim.

Know the limits

Jev can make incorrect relevance decisions. Cached scores do not automatically adapt to a new topic. Scans add latency and API usage, and filtering can invalidate your model provider's prompt cache.

On an API error, judging pauses but previously saved pruning still applies. Use /jev off to restore unfiltered context, or /rejev to retry. Pi's own compaction is separate. Jev cannot recover messages already removed by compaction. Pi's context meter can differ from the pruning estimate.

Configuration

Optional defaults go in ~/.pi/agent/jev-context.json (or your active Pi agent directory):

{
  "enabled": false,
  "threshold": 0.8,
  "buffer": 5,
  "cache": true,
  "model": "jev-latest",
  "timeoutMs": 60000
}

Session settings take precedence. The timeout covers a complete scan. Use a versioned model name for stable judgments. At idle, Jev scans without the active-tool buffer. Large candidates are split without truncation. If any fragment exceeds the threshold, the complete candidate stays.

Credentials use Pi's typesafe provider entry. A stored key takes precedence over TYPESAFE_API_KEY. /logout typesafe removes the stored key, not the environment variable. Jev does not add a chat model to /model.

Image data and tool-result details are not sent to Jev. Dynamically loaded tool definitions, unknown message types, and opaque thinking stay intact. Recent conversation excerpts are bounded and can miss earlier context.

Development

git clone https://github.com/kevinpita/pi-jev-context.git
cd pi-jev-context
npm ci
npm run check
npm run test:package
pi -e ./src/index.ts

Tests use synthetic history and mocked HTTP responses. They need no API key and make no TypeSafe requests. CI checks Node 22.19 and 24, strict types, Biome, behavior tests, and the packed extension through Pi's loader.

License

MIT © Kevin Pita. Independent community extension, not an official Pi or TypeSafe product.