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-unipi/compactor

v0.2.3

Published

Context engine for Pi — zero-LLM compaction, session continuity, sandbox execution, FTS5 search, and tool display optimization

Readme

@pi-unipi/compactor

Context engine that keeps sessions lean. Compacts conversations, indexes code, searches history, and runs sandboxed code — all without burning LLM tokens on compaction.

The zero-LLM pipeline compresses context through 6 stages (normalize, filter, build sections, brief, format, merge) to hit 95%+ token reduction at zero API cost. Session continuity preserves context across compaction boundaries with XML resume snapshots.

Commands

| Command | Description | |---------|-------------| | /unipi:compact | Manual compaction with stats | | /unipi:session-recall | Search session history (BM25 or regex) | | /unipi:content-index | Index current project into FTS5 | | /unipi:content-search | Search indexed content | | /unipi:content-purge | Wipe all indexed content | | /unipi:compact-stats | Context savings dashboard | | /unipi:compact-doctor | Run diagnostics | | /unipi:compact-settings | TUI settings overlay | | /unipi:compact-preset <name> | Apply quick preset | | /unipi:compact-help | Show detailed documentation |

Special Triggers

Compactor tools are available to the main agent when installed. All workflow skills can use compactor tools for context management.

Compactor registers with the info-screen dashboard, showing compaction count, tokens saved, compression ratio, and indexed documents. The footer subscribes to COMPACTOR_STATSUPDATED events to display compaction stats in the status bar.

Agent Tools

| Tool | Family | Description | |------|--------|-------------| | compact | compaction | Trigger manual compaction (dryRun: true to preview) | | session_recall | session | BM25 session history search | | sandbox | sandbox | Run code in sandbox (11 languages) | | sandbox_file | sandbox | Execute file via FILE_CONTENT | | sandbox_batch | sandbox | Atomic batch of commands + searches | | content_index | content | Chunk content to FTS5 index | | content_search | content | Query indexed content | | content_fetch | content | Fetch URL and index | | compactor_stats | compactor | Context savings dashboard | | compactor_doctor | compactor | Diagnostics checklist | | context_budget | compactor | Estimate remaining context window |

Two-Tier Skills

  • Tier 1 (compactor): ~175 tokens, always loaded. Routing and critical rules.
  • Tier 2 (compactor-detail): On-demand. Full tool reference, anti-patterns, sandbox languages, FTS5 modes, workflows.

Configurables

Config lives at ~/.unipi/config/compactor/config.json. Per-project overrides at <project>/.unipi/config/compactor.json.

Presets

| Preset | Description | |--------|-------------| | precise | Code-heavy, minimal waste — compaction: full, pipeline: 2/6 on | | balanced | Daily use (default) — all strategies moderate, pipeline: all on | | thorough | Debug/audit — everything on, full transcript | | lean | Quick fixes — compaction only, pipeline: all off |

Apply via /unipi:compact-preset <name>.

Pipeline Features

| Feature | Description | Context | |---------|-------------|---------| | TTL Cache | Cache with time-based expiry | On Compaction | | Auto Injection | Inject behavioral state after compaction | On Compaction | | MMap Pragma | Use mmap for SQLite I/O | On Compaction | | Proximity Reranking | Rerank search results by proximity | On Search | | Timeline Sort | Sort session events chronologically | On Search | | Progressive Throttling | Slow down indexing for large projects | On Index |

TUI

Tabbed settings interface (Presets / Strategies / Pipeline):

  • / key opens search filter in Strategies tab
  • Preset selection shows 3-line preview
  • Per-project override checkbox (o key)
  • Keyboard: left/right cycle modes, Space toggle, s save, Esc cancel

Architecture

┌─────────────────┐  ┌─────────────────┐  ┌─────────────────┐
│ Compaction Core │  │ Session Engine  │  │ Display Engine  │
│ (zero-LLM)      │  │ (SQLite + XML)  │  │ (mode-aware)    │
└────────┬────────┘  └────────┬────────┘  └────────┬────────┘
         │                    │                    │
         └────────────────────┼────────────────────┘
                              ▼
                    ┌─────────────────────┐
                    │   Config Manager    │
                    └─────────────────────┘

License

MIT