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

@entelligentsia/forge-compress

v0.1.0

Published

Token-efficient compression for Forge SDLC tool outputs — store queries, entities, artifacts

Readme

@entelligentsia/forge-compress

Token-efficient compression for Forge SDLC tool outputs — store queries, entities, validation reports, and arbitrary markdown.

Forge agents read store queries, entity JSON, and markdown artifacts on every turn. Verbose outputs burn tokens fast. This library compresses those outputs into a form that preserves load-bearing facts (IDs, statuses, relationships, key changes) while dropping boilerplate, deep nesting, and repeated structure.

Install

npm install @entelligentsia/forge-compress

Requires Node ≥ 18. Ships ESM only.

Quick start

import {
  compressStoreQuery,
  compressEntity,
  compressMarkdown,
  compressValidateStore,
} from "@entelligentsia/forge-compress";

// Forge store query envelope → compact text
const compact = compressStoreQuery(rawJson, { maxTokens: 2000 });

// Task / bug / feature entity JSON → flat summary
const summary = compressEntity(entityJson, { keepSummaries: "latest" });

// Long markdown artifact → headings + key lines under a budget
const map = compressMarkdown(doc, { mode: "map", maxTokens: 800 });

// validate-store report → grouped errors/warnings, top-N per category
const report = compressValidateStore(reportJson);

What's included

Forge-aware compressors (src/forge/)

| Function | Input | Strategy | |---|---|---| | compressStoreQuery | Forge query envelope JSON | Drop traversal trace and config, keep IDs/titles/statuses/relationships, truncate excerpts | | compressEntity / compressEntityList | Entity record JSON (task/bug/feature/sprint) | Flatten phase summaries, keep latest verdicts and key changes | | compressMarkdown | Any markdown | Three modes: map (headings + signal lines), headings (TOC only), truncate (head-of-budget) | | compressValidateStore | validate-store JSON report | Group by category, show top-N per group, summarize the rest |

Generic primitives (src/)

| Function | Purpose | |---|---| | countTokens(text) | Heuristic token count (chars ÷ 3.7) | | truncateToTokenBudget(text, n) | Cut to a token budget on a newline boundary | | lightweightCleanup(text) | Collapse brace-only runs, strip blank-line repeats | | verbatimCompact(text) | Lossless whitespace and boilerplate strip | | stripAnsi(text) | Remove ANSI escape sequences | | compressIb(text) | Information-bottleneck compression driven by per-line entropy | | compressProgressive(items, budget) | Tiered budget allocation across an ordered list (recent items get exponentially more tokens) |

Design notes

  • Lossy by intent. Compressors drop fields agents have proven they don't need (timestamps, hashes, deep config blobs). When you need full fidelity, read the source JSON directly.
  • Token-bounded, not byte-bounded. Every public API accepts maxTokens and trims on token boundaries, not bytes.
  • No model dependency. Pure functions. No network, no LLM calls — safe to run inside tool handlers.
  • Stable shapes. Output is deterministic for a given input and option set, so it caches well in prompt-cache prefixes.

API reference

Types are exported alongside each function — see src/index.ts for the full surface. All compressors return string; pass JSON in as a raw string (they parse internally and fall back to the input on parse error).

Development

npm install
npm run build      # tsc → dist/
npm test           # vitest
npm run lint       # biome

Tests live in src/__tests__/.

License

MIT. See LICENSE.