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-auto-resume-v2

v0.2.1

Published

OpenCode v2 plugin adapter for opencode-auto-resume (stall detection + auto-continue). Runs the unchanged v1 recovery engine on OpenCode 2.x.

Readme

opencode-auto-resume-v2

OpenCode v2 plugin adapter for opencode-auto-resume — the stall-detection / auto-continue plugin.

OpenCode 2.x loads plugins through the new v2 plugin API ({ id, setup(context) }) and rejects the v1 Plugin(ctx, options) entrypoint that opencode-auto-resume ships (see upstream issue Mte90/opencode-auto-resume#33). This adapter bridges the two so the v1 recovery engine runs unchanged on OpenCode 2.x:

  1. Builds a v1-shaped client bridge on top of the v2 plugin context (context.session.prompt, context.session.interrupt, context.session.context, context.session.command).
  2. Invokes the upstream v1 plugin with that legacy context.
  3. Re-registers the resulting v1 hooks into the v2 domain API: the event loop (context.event.subscribe), tools (context.tool.transform), and prompt/tool/command hooks.
  4. Translates v2 bus events into the v1 event shape the engine expects.

The recovery logic itself is untouched — it comes entirely from the upstream package, so this adapter automatically stays in sync with upstream v1 changes.

What 0.2.0 fixes

0.1.1 had three v2/v1 mismatches that produced a "Tool execution interrupted" storm: the engine aborted live tool calls and then stood down instead of resuming.

| Bug | Effect | Fix | |---|---|---| | session.status() returned {}, and v2 messages use content: [{type:"tool"}] while the engine parses v1 parts[]/tool_calls | The engine could not see in-flight tools, so its 15s "parent stuck" check aborted mid-tool runs | status() now reports live sessions/tools from the event bus, and normalizeMessages() converts v2 messages (only running tools become tool_use/pending) | | session.execution.interrupted was translated to session.interrupted even for aborts the adapter itself issued | The engine read its own abort as a user cancel (userCancelled = true) and skipped the resume prompt | Aborts issued by the adapter are remembered for 15s; their interrupted event is swallowed | | Every v2 event was forwarded as message.updated with no role/tokens | Activity tracking was blind, and the stall detector worked from stale state | Events are mapped explicitly (session.step.ended → finish/tokens, session.inbox.delivered → user message, tool/step/text/reasoning events refresh activity); unknown events are dropped |

Also fixed: tool.ids is now answered from context.tool.list() instead of throwing on every check, and the default resume prompt is a guarded instruction rather than the bare string continue (see upstream #45).

Behaviour that is intentionally preserved: a genuinely silent stream still recovers at the engine's 180s chunk timeout, because status() stops reporting "busy" after 90s without events.

Upstream PR Mte90/opencode-auto-resume#44 proposes merging this adapter into the upstream package itself (as its ./server entrypoint). Once that lands and is published, you can install opencode-auto-resume directly on 2.x and drop this adapter.

Requirements

  • OpenCode 2.x (opencode --version ≥ 2.0). The adapter relies on the v2 plugin context exposing tool, session, event and command domains.

Install

opencode plugin add opencode-auto-resume-v2

or add it to opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-auto-resume-v2"]
}

Then remove the legacy v1 entry if it is still configured:

opencode plugin remove opencode-auto-resume 2>/dev/null || true

Configuration options pass through to the upstream engine, e.g.:

{
  "plugin": [
    ["opencode-auto-resume-v2", {
      "chunkTimeoutMs": 180000,
      "gracePeriodMs": 3000,
      "maxRetries": 3
    }]
  ]
}

See the upstream README for the full option reference.

Verification

Plugin loading and plugin stderr are written to:

~/.local/share/opencode/log/opencode.log

Look for:

msg="loading plugin" id=opencode-auto-resume-v2

and any [auto-resume-v2] ... / failed to load plugin lines. A successful load emits the upstream engine's own [auto-resume] info: ... config OK / ... ready lines once events are received.

License

GPL-3.0-or-later, matching the upstream plugin this adapter wraps.