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

opencode-optical-compaction

v0.1.0

Published

Replay OpenCode V2 summary checkpoints as locally rendered images.

Readme

Optical Compaction for OpenCode V2

OpenCode streams and saves its usual compaction summary. When a vision-capable model continues the session, this plugin replaces the outgoing text checkpoint with locally rendered PNG pages. The pages contain both the finished summary and the recent conversation OpenCode retained with it.

{
  "$schema": "https://opencode.ai/config.json",
  "plugins": ["[email protected]"]
}

Requires OpenCode V2 2.3.x (tested against 2.3.0). No credentials, proxy, or external rendering service are required. Remove the plugin entry to return to stock behavior. Existing checkpoints can immediately be replayed as text again.

What changes

  • The first normal request after a completed summary compaction gets PNGs and a short caption instead of the checkpoint text. Later requests replay the same bytes for that checkpoint. Manual, automatic, and installed background summaries use the same handoff. Cache keys, hints, and other messages are unchanged. Text and images are inherently different inputs: the checkpoint portion of a previously cached text request cannot be reused as an image.
  • New turns and attachments remain intact. Older messages and attachments are represented exactly as OpenCode serialized them for the checkpoint; this does not restore details OpenCode already shortened or omitted.
  • Summary generation, native compaction, the visible transcript, system instructions, and tool calls are not modified. Models configured for native compaction (including OpenAI Responses) and models not advertising PNG/vision receive the normal request. OpenAI models configured for summary compaction are eligible.
  • The renderer uses a bundled font dependency and processes content locally. Pages are only cached in memory and sent to the session's chosen model in the normal request. A failed lookup or render, unsupported characters, or an oversized checkpoint leaves the original text intact instead of truncating it.

This is an experiment in visual compression, not a byte-exact or guaranteed cost saving mode. A model can misread code, IDs, and punctuation. Image token cost and OCR quality vary by model; the plugin does not predict either. For exact values, refer back to the original transcript or re-send them as new text.

The stock OpenCode V2 2.3.0 transcript still shows the text summary. Its plugin API has no display-only image slot on the compaction row. The plugin does not create a synthetic message to simulate one because that would add transcript content back to model context.

Development

bun install --frozen-lockfile
bun run check
npm pack --dry-run

Inspired by AgentOCR (ACL 2026 paper) and image-token-compression. This plugin does not use optical self-compression training and does not rewrite unrelated regions of the prompt. Optical summary compaction for OpenCode V2