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

@ersintarhan/pi-toolkit

v0.5.9

Published

pi extension that registers Kimi, MiniMax, Xiaomi MiMo, and CrofAI providers with cache fix, Anthropic OAuth adapter, and native web search with provider-override support. Search backends include ZAI MCP, Google, OpenAI, xAI, Anthropic, Claude Code, and C

Readme

pi-toolkit

All-in-one pi extension toolkit.

Includes:

  • Providers: kimi-coding, minimax, xiaomi-mimo, crofai
  • Cache optimization for Anthropic-compatible providers
  • Claude OAuth adapter for Anthropic OAuth sessions
  • Native web search with multiple backends + provider override
  • Context management (anchor, view, pivot, recall)

Install

pi install npm:@ersintarhan/pi-toolkit

Local development:

pi -e /Users/ersin/Projects/pi-extensions/pi-toolkit

What this package does

1. Provider registration

Registers these providers:

| Provider | API | Notes | |---|---|---| | kimi-coding | Anthropic-compatible or OpenAI mode | OAuth, API key fallback, image/video upload, Kimi-specific payload mutations | | minimax | Anthropic-compatible | Cache-fixed stream path | | xiaomi-mimo | Anthropic-compatible | Cache-fixed stream path, MiMo quirks handled | | crofai | OpenAI-compatible | Dynamic model list, usage support |

2. Cache optimization

For Anthropic-compatible providers (kimi-coding, minimax, xiaomi-mimo), this package uses a custom cached stream implementation derived from the better-messages-cache approach.

It does three things:

  • marks the last assistant tool_use block
  • marks the last user block
  • repairs partial/invalid streaming JSON during tool call parsing

This keeps cache loss lower across long agentic turns.

3. Claude OAuth adapter

When using /model anthropic/... with Anthropic OAuth:

  • strips the Claude Code identity block
  • injects the billing header Claude Code expects
  • shows footer status like ✓ Claude OAuth ready/active
  • docs re-injection is disabled by default

4. Native search

Adds:

  • web_search
  • web_fetch
  • /search

Supported native search backends:

| Backend | Search | Fetch | Auth | |---|---|---|---| | ZAI (GLM) | ✅ | ✅ | ZAI_API_KEY | | Google Gemini | ✅ | ❌ | GEMINI_API_KEY | | OpenAI | ✅ | ❌ | OPENAI_API_KEY | | xAI | ✅ | ❌ | XAI_API_KEY | | Anthropic | ✅ | ❌ | ANTHROPIC_API_KEY | | Claude Code bridge | ✅ | ✅ | Claude CLI auth | | Codex / ChatGPT | ✅ | ❌ | codex login / ~/.codex/auth.json | | Fallback | DuckDuckGo | HTTP fetch | none |

You can pin search to a provider independently from the active model.

Examples:

/search provider zai
/search provider openai
/search provider codex
/search provider auto

Or choose it from the TUI settings panel with /search.

5. Context management

Adds the context tool with:

  • view
  • recall
  • anchor
  • pivot

Also includes:

  • status line (context=, tool=, anchor=)
  • tool-result truncation before the last anchor
  • anchor-aware cache support in the integrated context flow

Provider usage

Kimi

/model kimi-coding/kimi-for-coding

Auth options:

  • KIMI_API_KEY
  • /login kimi-coding OAuth

Optional:

  • KIMI_CODE_PROTOCOL=openai
  • KIMI_CODE_MODEL=<model>

MiniMax

/model minimax/MiniMax-M2

Requires:

  • MINIMAX_API_KEY

Xiaomi MiMo

/model xiaomi-mimo/mimo-v2.5
/model xiaomi-mimo/mimo-v2.5-pro

Requires:

  • XIAOMI_TOKEN_PLAN_API_KEY

Optional region override:

export XIAOMI_MIMO_BASE_URL=https://token-plan-ams.xiaomimimo.com/anthropic

CrofAI

/model crofai/openai/gpt-4o

Requires:

  • CROFAI_API_KEY

Models are fetched dynamically from:

  • https://crof.ai/v1/models

/usage command

Shows quota / plan usage for the active provider.

Supported:

| Provider | Endpoint | |---|---| | kimi-coding | https://api.kimi.com/coding/v1/usages | | minimax | https://api.minimax.io/v1/token_plan/remains | | xiaomi-mimo | https://platform.xiaomimimo.com/api/v1/tokenPlan/usage | | crofai | https://crof.ai/usage_api/ |

Examples:

/usage

/context command

Shows current context-window usage without adding the generated report to future LLM context.

It includes:

  • total context usage and model window
  • estimated category breakdown
  • active tools and slash commands
  • extension allocation by source/package
  • cache read/write and cost stats

Example:

/context

Search override examples

Use Kimi for coding, but ZAI for search:

/model kimi-coding/kimi-for-coding
/search provider zai

Use any model, but force Codex web search:

/search provider codex

Return to auto-detect:

/search provider auto

Context workflow examples

Anchor after a completed phase:

context(anchor, name="crofai-added", summary="CrofAI provider added with dynamic models and usage support.")

Pivot back to a clean checkpoint:

context(pivot, target="crofai-added", carryover="Search override added later; CrofAI implementation is stable.")

Environment summary

Common env vars:

# Kimi
export KIMI_API_KEY=...
export KIMI_CODE_PROTOCOL=anthropic

# MiniMax
export MINIMAX_API_KEY=...

# Xiaomi MiMo
export XIAOMI_TOKEN_PLAN_API_KEY=...
export XIAOMI_MIMO_BASE_URL=...

# CrofAI
export CROFAI_API_KEY=...

# Search backends
export ZAI_API_KEY=...
export GEMINI_API_KEY=...
export OPENAI_API_KEY=...
export XAI_API_KEY=...
export ANTHROPIC_API_KEY=...

Compatibility notes

  • Do not install older overlapping Kimi provider forks at the same time.
  • Local pi -e ... development may behave differently from installed npm packages for skill loading.
  • Codex search requires codex login first.
  • Claude OAuth adapter only activates for the anthropic provider when OAuth is actually in use.

Changelog

0.5.4

  • package renamed to @ersintarhan/pi-toolkit
  • CrofAI provider added
  • Claude OAuth adapter merged
  • native search merged
  • Codex / ChatGPT search backend added
  • search provider override added (including TUI selection)
  • pi-auto-context integrated
  • cache TTL upgraded to 1h
  • status line simplified
  • skill metadata added

0.5.3

  • search provider override
  • Codex backend

0.5.2

  • native search merged

0.5.1

  • Claude OAuth adapter merged

0.5.0

  • CrofAI provider added

License

MIT