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-plugin-question-force-close

v1.0.1

Published

opencode TUI plugin that forces a clickable close button while the question tool is waiting for input.

Readme

opencode-plugin-question-force-close

An opencode TUI plugin that forces a clickable close button while the question tool is waiting for input.

opencode's built-in question dialog has no close affordance of its own — it can normally only be dismissed by pressing esc. When the dialog is off-screen (scrolled away) or you're on a setup where hitting esc is awkward, there is no visible way to abort the question. This plugin renders a prominent ✕ Force close question button that calls question.reject on click, aborting the tool — equivalent to pressing esc, but always visible and clickable.


Install

From npm (recommended)

Add the plugin to your opencode TUI config:

// .opencode/tui.json
{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": ["opencode-plugin-question-force-close"]
}

opencode installs npm plugins automatically via Bun on startup.

From a local file

// .opencode/tui.json
{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": ["../path/to/plugin.tsx"]
}

Then install the plugin's runtime dependencies at the project root:

bun install   # or: bun add [email protected] @opentui/[email protected]

Usage

  1. Start the interactive TUI:

    opencode

    opencode run "..." runs headless and does not load TUI plugins. You must use the interactive TUI.

  2. Trigger any agent call that invokes the question tool.

  3. A red ✕ Force close question button appears at the bottom-right, directly beneath the question dialog. Click it (mouse) to dismiss the question and abort the tool. The button auto-hides once the question is answered or dismissed.


How it works

The plugin subscribes to the question lifecycle via the TUI event bus:

| Event | Action | | ------------------- | ---------------------------------------- | | question.asked | record the pending request id, show button | | question.replied | clear pending, hide button | | question.rejected | clear pending, hide button |

On click, it calls api.client.question.reject({ requestID, directory }), the same SDK call the built-in esc keybinding uses.

The button is rendered through opencode's host-slot system (api.slots.register) using SolidJS, the same reactivity framework the opencode TUI is built on.


Limitations

  • Position is bottom-right, not top-right. opencode's TUI uses a relative box layout with no native floating-overlay slot. The question dialog itself (and its esc dismiss hint) is hard-coded inside opencode's source and cannot be injected into by plugins. The app_bottom host slot — wrapped in a flexShrink: 0 box directly beneath the session area — is the closest slot that is guaranteed visible while a question is pending. A true top-right floating button would require patching opencode itself.
  • Requires the interactive TUI. Headless mode (opencode run) does not load TUI plugins.
  • Uses an undocumented API. opencode's official plugin docs only cover server plugins (hooks). TUI rendering plugins ({ id, tui } modules, api.slots, the TUI event bus) are internal/undocumented as of opencode 1.18.x. This plugin may need updates if those internals change.

Requirements

| Package | Version | Notes | | ------------------- | -------- | ---------------------------------------------------- | | opencode | ≥ 1.18.0 | TUI plugin + host-slot system | | @opentui/solid | 0.4.5 | pinned exact; interlocked with the opencode 1.18.x host | | solid-js | 1.9.12 | pinned exact; peerDependency of @opentui/[email protected] | | @opencode-ai/plugin | 1.18.13 | optional peer (types only at runtime) |

opencode bundles its own copies of solid-js and @opentui/solid and redirects plugin imports to the host instance at runtime, so there is no "double SolidJS instance" problem even though the plugin ships its own copies.


Project layout

opencode-plugin-question-force-close/
├── plugin.tsx              # the plugin (default exports { id, tui })
├── package.json            # npm metadata + pinned deps
├── README.md
├── LICENSE
└── .opencode/              # local dev / test harness (NOT published)
    ├── opencode.json
    └── tui.json            # loads the plugin via "../plugin.tsx"

Develop

git clone https://github.com/zylcold/opencode-plugin-question-force-close.git
cd opencode-plugin-question-force-close
bun install                # install solid-js + @opentui/solid at root
opencode                   # interactive TUI; trigger a question to test

The .opencode/tui.json in this repo already points at ../plugin.tsx, so cloning + bun install + opencode is enough to run the plugin locally.

Debugging tips

TUI plugin failures are silent by default — the interactive renderer swallows console.*. If nothing renders, inject a disk probe inside plugin.tsx:

import { appendFileSync } from "node:fs"
const diag = (stage: string, data?: unknown) =>
  appendFileSync("/tmp/qfc.log", `${stage} ${JSON.stringify(data ?? "")}\n`)
diag("module-imported")  // trace each lifecycle stage

License

MIT