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

@danypops/pi-jittor

v0.10.0

Published

Pi extension for Jittor token and context observability with optimization controls backed by the @danypops/jittor daemon

Downloads

1,164

Readme

@danypops/pi-jittor

The Pi extension for Jittor: token, cost, context, provider-budget, and model-run observation plus routing, recovery, and model-selection controls, over an authenticated loopback client to the @danypops/jittor daemon. See the repo root README for the two-package overview.

What it does

Records context composition, response headers, finalized usage, cost, and model-run behavior through the daemon; preflights provider turns and applies model/thinking decisions; blocks requests when required telemetry is unsafe. It follows Pi's current authenticated model/provider and re-syncs Pi's available models before every decision, so an unavailable catalog route is never selected. Route state is scoped per Pi session, so concurrent sessions can't clobber each other's active provider or footer budget.

The extension registers no model-callable tools — daemon JSON, CLI --json, human CLI output, notifications, panels, and the footer are separate bounded channels (see @danypops/jittor's docs/OUTPUT_CHANNELS.md).

Blocking always has an escape hatch: /jittor off enters persisted monitor-only mode and never blocks; /jittor footer on|off controls the informational footer independently of enforcement; /jittor on only re-enables enforcement after telemetry/route-sync succeed.

Footer

An integrated footer shows repository/model identity, cumulative usage, a color-coded context-window bar, and current-provider budget telemetry. Codex/OpenRouter/Anthropic each render a draining remaining-budget bar when the provider's own telemetry exposes a real limit; without one, spend stays honest text-only rather than a fabricated denominator. During Pi compaction the bar drains against a learned duration estimate (median of the last ≤20 completed compactions, needs ≥3 before trusting it) — never a fake timer, and it blinks in place until there's enough evidence. jittor compaction estimate [--json] inspects the estimate directly.

/jittor — settings and status

/jittor (or /jittor settings) opens a keyboard-navigable TUI covering routing enforcement, the footer, Codex recovery, and the four token-budget thresholds. /jittor status shows the routing/pressure panel. benchmarks, outcome, recovery, on/off, footer on/off, and context remain available as direct subcommands for automation.

Opt-in Codex settled-turn recovery

Off by default. /jittor recovery on|off|status|cancel — a transient Codex failure (rate-limit, overload, transport) schedules one hidden retry after Pi's own agent_settled boundary, Retry-After-aware, capped at 3 attempts per 10-minute window, canceled by human input or session shutdown. Quota/auth/invalid-request/unknown/aborted failures stay terminal; raw provider payloads are never retained. The on/off choice persists in $XDG_CONFIG_HOME/jittor/extension.json.

/usage — token and cost graphs

A colored Unicode cumulative graph (Hourly/Daily/Weekly/Monthly/Quarterly) per provider/model; /usage cost shows aggregated USD spend on the same axes. Tab/arrows switch period, v toggles token/cost, r refreshes. Each active provider/model gets a stable color (a second bold-variant channel once identities exceed available hues) so a model's color stays fixed across periods, refreshes, and restarts. /usage budget <period> <tokens|off> sets an optional threshold, rendered as a horizontal line on the graph with remaining/OVER BUDGET state (token view only; Jittor never infers a budget from a provider's own subscription tier). See docs/USAGE_PRIOR_ART.md for the chart design research.

Cost per Papyrus task

Every token/cost metric already recorded on a finalized assistant message is tagged with the currently-focused Papyrus task (via the papyrus.task-focus.v1 event bus, no new instrumentation) plus the provider/model/thinking level active at that moment. jittor metrics cost-by-task --since <ms> --until <ms> [--json] gives a bounded per-task cost/token breakdown. Spend with nothing focused reports as unattributed rather than folding into an invented task.

Benchmark evidence panel

/jittor benchmarks [coding|general] [research|planning|general] shows a responsive model-recommendation panel over the daemon's benchmark ranking (see @danypops/jittor's own README for ingestion sources). Labeled ADVISORY — Pi's extension API doesn't expose the real /scoped-models set, so this offers no direct selection action. /jittor outcome accepted|rejected attaches real outcome evidence to the latest completed run.

/context — context window inspection

A tree-aware breakdown of the current context window: / search, f scope (all/active/historical), m size threshold, g/G/arrows navigate. Conservatively-mapped OpenAI-family models get exact gpt-tokenizer counts (marked tokenizer-exact-text); everything else stays ≈ char/4. Assistant turns also show the provider's own authoritative aggregate request context (input + cache read + cache write) alongside individual item costs, with an explicit unattributed residual rather than proportional allocation. See ../jittor/docs/TOKEN_MEASUREMENT.md and ../jittor/docs/CONTEXT_SNAPSHOTS.md.

/jittor context shows the in-session Papyrus prompt-injection / Pi compaction telemetry summary — see @danypops/jittor's README for what's recorded.

Development

bun test
bun x tsc --noEmit