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

@siddr/pi-cache-expiry-warning

v0.1.1

Published

Prompt cache expiry warning extension for pi

Readme

Cache Expiry Warning extension

Shows a warning above Pi's editor when a configured prompt cache may expire before another turn starts.

Install

pi install npm:@siddr/pi-cache-expiry-warning

Behavior

  • During each turn, the extension inspects the outgoing provider payload for prompt-cache configuration and records when the request is sent.
  • At the end of the turn, it schedules only the time remaining in the cache window. If the cache window elapsed while Pi was responding or running tools, the warning appears immediately.
  • Starting another turn cancels the timer and clears any warning.
  • The default short-cache window is 5 minutes, matching Pi's cache expiry threshold.
  • Long retention is read from the provider payload as seen by the extension:
    • Anthropic-style and Bedrock cache controls: normally 1 hour
    • OpenAI prompt_cache_retention: normally 24 hours
  • When openai-params actually patches a request for 24-hour retention, it reports the effective TTL so the warning remains correct regardless of extension load order.
  • When the timer expires, the extension displays a warning above the editor. It does not add anything to model context.
  • Timers and widgets are cleared when the model or session changes and when Pi shuts down.

Accuracy

The extension uses recognized cache controls, cache keys, and retention fields to determine the cache window. It does not guess an expiry time from token usage alone.

Long-retention timing comes from the cache TTL Pi serializes into the outgoing provider payload, rather than from the PI_CACHE_RETENTION environment variable alone. If a custom provider enables caching without serializing a recognized TTL, the extension does not show an expiry warning.