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

@headsdown/opencode

v0.1.3

Published

HeadsDown availability and focus-mode gating plugin for OpenCode.

Readme

@headsdown/opencode

HeadsDown availability-awareness and task-gating plugin for OpenCode.

What it does

  • Adds headsdown_policy, headsdown_approve, headsdown_digest, headsdown_outcome, and headsdown_auth tools to OpenCode
  • Injects HeadsDown execution guidance into system prompts on every turn
  • Enforces policy through both permission mediation and pre-tool hard gates
  • Applies mode-aware model shaping via chat.params, chat.headers, and shell.env
  • Shapes tool definitions with mode-aware HeadsDown constraints
  • Persists policy context during session compaction and can disable auto-continue in strict Wrap-Up windows
  • Tracks approved proposals and reports outcomes for calibration

Install

npm install @headsdown/opencode

Then configure OpenCode in opencode.json (published npm mode):

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@headsdown/opencode", "@headsdown/opencode/tui"]
}

@headsdown/opencode loads server-side policy hooks and tools. @headsdown/opencode/tui adds TUI-only status toasts and command palette actions.

Why two plugins?

  • OpenCode uses separate plugin surfaces for runtime/server behavior and TUI behavior.
  • This package exports both surfaces (@headsdown/opencode and @headsdown/opencode/tui) so each can be loaded in the correct place.

First-time auth

Inside OpenCode, run the headsdown_auth tool and complete the Device Flow.

After auth, use headsdown_policy to confirm your current mode, schedule state, and execution guidance.

Proposal and outcome workflow

When the user is in busy or limited mode and the agent needs to modify files:

  1. Call headsdown_approve
  2. If approved, continue the task
  3. If deferred, summarize and ask the user whether to postpone or reduce scope
  4. After completion/failure, call headsdown_outcome with the outcome

Use headsdown_digest at session start or when asked "what did I miss?" to review updates that arrived during focus mode.

TUI features

The TUI plugin adds:

  • HeadsDown: Refresh policy command (/headsdown-policy-refresh)
  • HeadsDown: Show policy command (/headsdown-policy)
  • Transition toasts when mode changes or Wrap-Up/lock state becomes active
  • Note: this plugin currently does not add a persistent sidebar panel.

Development

cd headsdown-opencode
npm install
npm run build
npm test

Local plugin toggle helper

Use scripts/toggle-headsdown-plugin.sh from a target OpenCode project to switch between:

  • local: loads this repo's built files through local shims (.opencode/plugins)
  • published: loads @headsdown/opencode and @headsdown/opencode/tui from npm in opencode.json

In local mode, opencode.json may keep an empty plugin array while local shims are used.

Example:

./scripts/toggle-headsdown-plugin.sh local

License

MIT