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-m3fix

v0.3.1

Published

Pi extension that repairs flattened reasoning blocks in compacted sessions

Readme

pi-m3fix

CI npm

Pi extension for repairing session files affected by flattened reasoning blocks.

Install

From npm (recommended, versioned):

pi install npm:pi-m3fix

Pin to a specific version:

pi install npm:[email protected]

From GitHub, latest main:

pi install git:github.com/hypernewbie/pi-m3fix

From GitHub, pinned to a released tag:

pi install git:github.com/hypernewbie/[email protected]

v0.1.0 was broken (see CHANGELOG.md) and has been removed. Do not install it.

Local development checkout:

pi install /path/to/pi-m3fix

Restart Pi or run /reload, then use /m3fix.

Usage

/m3fix [partial-session-id|session-file] [options]

Examples:

/m3fix --dry-run
/m3fix --force-live
/m3fix 019f311c --provider m3 --api anthropic-messages --model MiniMax-M3
/m3fix /absolute/path/to/session.jsonl --dry-run

Options:

  • --dry-run, -n — show changes without writing.
  • --force-live — repair the loaded session and reload it from disk.
  • --provider <id> — override the target provider.
  • --api <api> — override the target API.
  • --model <id> — override the target model.
  • --no-relabel — skip provider/API/model relabeling.
  • --no-unflatten — skip text-to-thinking repair.
  • --allow-empty-signature — deprecated no-op (kept for backward compatibility). The repair now always runs for anthropic-messages models regardless of registry metadata.

Behavior

For assistant messages, /m3fix can:

  1. Set provider, api, and model to the selected target model.
  2. Clear stale thinkingSignature values on non-redacted thinking blocks.
  3. Convert leaked-reasoning text blocks back into thinking blocks.

Leaked-reasoning detection uses pattern matching: a text block is only converted to thinking if it consists entirely of **bold phrase** segments with no prose content. This matches M3's flattened reasoning output ("**Checking license metadata**", "**Planning X**\n\n**Doing Y**") while preserving real responses that happen to start with bold ("**Vibe: hard.** This is not a shallow port..." → kept as text).

Signature clearing and text-to-thinking repair run for any anthropic-messages model — the same behavior as the original underp.py script. No registry compat metadata is required. Use --no-unflatten to skip the text-to-thinking step.

Unflatten applies to all assistant turns except the last active one. Pre-compaction turns are included because they are displayed in the TUI (even though they aren't sent to the LLM), and leaving leaked reasoning visible is the exact problem this tool solves.

Redacted thinking blocks are never modified.

Safety

  • Creates a one-time .bak2 backup before writing.
  • Writes through a temporary file and atomic rename.
  • Re-opens the repaired file with Pi's SessionManager to validate it.
  • Refuses to modify the loaded session unless --force-live is supplied.

Development

npm install
npm test
npm run typecheck
npm pack --dry-run

Releasing (maintainers)

CI publishes to npm via OIDC trusted publishing — no npm token involved. To cut a release:

  1. Bump version in package.json.
  2. Commit, then tag vX.Y.Z matching that version and push both:
    git tag -a vX.Y.Z -m "vX.Y.Z"
    git push origin main
    git push origin vX.Y.Z
  3. CI runs tests, verifies the tag matches package.json's version, then publishes via OIDC. Provenance is generated automatically.

The npm package's Trusted Publisher is configured to only accept publishes from this repo's .github/workflows/ci.yml workflow. Publishing access via classic/granular tokens is disabled on npmjs.com ("Require two-factor authentication and disallow tokens"), so a compromised or misconfigured token cannot publish a release.