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-token-speed-plugin-built

v1.0.5

Published

OpenCode TUI plugin: live tokens/sec readout. Forked build of opencode-token-speed-plugin (upstream v1.0.4 shipped raw .tsx with no build step; this publishes the compiled dist that actually loads).

Readme

opencode-token-speed-plugin (forked build)

A OpenCode TUI plugin that displays real-time LLM output token speed (tok/s) next to the session prompt.

This is a forked build of heimoshuiyu/opencode-token-speed-plugin (MIT). The upstream v1.0.4 ships raw .tsx source with no build step — its exports."./tui" points at index.tsx, which no JS runtime can import (Bun falls back to React's JSX runtime; Node can't read .tsx). This fork publishes the compiled dist/tui.js that actually loads under OpenCode's TUI plugin loader. Logic is byte-identical to upstream; only the JSX→element compilation differs.

Install

Add to ~/.config/opencode/tui.json:

{
  "plugin": ["opencode-token-speed-plugin-built"]
}

Restart OpenCode. The readout (▲ XX.X tok/s) appears to the right of the session prompt — ▲ -- at idle, the live rate during/after streaming.

What it shows

  • Real token counts, not the chars/4 heuristic — reads part.tokens.output + part.tokens.reasoning on each step-finish.
  • A 2-second sliding-window span (first→last delta wall-clock) gives the rate.
  • ▲ -- at idle (before any response in the session); the last measured speed persists after a response.
  • Renders in the session_prompt_right slot (muted text). The footer status line (Orchestrator · model · elapsed) is hardcoded — no plugin slot exists for it.

Why this fork exists (the upstream defect)

[email protected] is a packaging defect: the author published index.tsx (TypeScript + JSX) as the ./tui entry without running a build step. The tsconfig.json uses "jsx": "preserve" + "jsxImportSource": "solid-js" — a bundler-only config. Neither Bun's bun build nor esbuild produces a correct Solid build from it:

  • bun build ignores the tsconfig jsx field and emits React.createElement (classic React runtime), which Solid's renderer doesn't provide.
  • esbuild's --jsx=automatic --jsx-import-source=solid-js emits jsxs from solid-js/jsx-runtime, but Solid's jsx-runtime doesn't export jsx/jsxs (those are React names) — Solid uses template/createComponent/insert from solid-js/web/@opentui/solid.

OpenCode's TUI uses @opentui/solid (OpenCode's Solid renderer), where createElement(tagName) takes only a tag name; props/children are applied via setProp and reactive insert. The compiled dist/tui.js here is hand-authored against that API (mirroring how oh-my-opencode-slim's built dist/tui.js is structured), because no stock bundler correctly compiles Solid JSX for this runtime. The upstream index.tsx + speed.ts are preserved in this repo for reference and attribution.

Rebuild

The dist/tui.js is hand-authored (not machine-compiled). If it ever needs regenerating from index.tsx, the path is a Solid JSX transform (e.g. babel-plugin-jsx-dom-expressions / the Solid babel preset) targeting @opentui/solid's createElement/insert/setProp — not esbuild/bun automatic runtime. For now, treat dist/tui.js as the source of truth; edit it directly.

Dependencies

  • solid-js — createSignal
  • @opentui/solid — createElement, insert, setProp (OpenCode's TUI Solid renderer)
  • @opencode-ai/plugin — TUI plugin types

@opentui/solid is a peer dependency of @opencode-ai/plugin; this fork lists it as a regular dependency so it installs into the package's node_modules and the bare import resolves at load time.

Credit

Original plugin by heimoshuiyu. This fork only fixes the build/packaging so it loads; no logic changes.

License

MIT — see LICENSE.