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

@vaur94/opencode2-goal

v0.3.0

Published

Evidence-checked autonomous Goal loop for OpenCode V2.

Downloads

448

Readme

opencode2-goal

Persistent autonomous Goal loop for OpenCode V2.

Behavior

  • /goal <objective> sets or replaces the current session goal and starts its continuation loop.
  • /goal status shows it.
  • /goal pause, /goal resume, and /goal clear manage the loop.
  • An explicit user Stop/interrupt pauses the active goal; shutdown and superseded executions keep it active for recovery.
  • Active goals are injected as system context on every model turn.
  • After every successful or failed execution boundary, a synthetic continuation wakes the agent again.
  • The agent may mark a goal completed only after auditing its objective and constraints against concrete files, commands, tests, logs, benchmarks, or artifacts.
  • Completion evidence is stored with the completed goal; confidence, narration, todo status, or partial progress alone are insufficient.
  • Active loops restart when the plugin reloads or the service restarts.
  • There are no round limits, token budgets, or time budgets; completion is an evidence-audited model decision.
  • The loop continues until evidence supports completion or the user pauses, clears, or interrupts it.

The /goal command is model-mediated by OpenCode V2. Lifecycle mutations are implemented by one non-CodeMode goal_manage tool. User-controlled lifecycle actions remain user-controlled; the agent receives only the additional authority to call complete with an evidence ledger. Continuations are durable synthetic session inputs; they retain the selected agent, model, permissions, and safety rules. State is stored per session under ${XDG_STATE_HOME:-~/.local/state}/opencode2-goal/sessions.

Backend API

The plugin also starts an authenticated loopback backend for trusted local clients such as opencode2-web. Its random endpoint and bearer credential are written with mode 0600 to ${XDG_STATE_HOME:-~/.local/state}/opencode2-goal/backend.json. The credential must remain in the bridge process and must never be sent to a browser.

  • GET /v1/goals returns all persisted goals and process-lifetime telemetry counters.
  • GET /v1/goals/:sessionID returns one goal.
  • POST /v1/goals/:sessionID accepts set, update, pause, stop, resume, or clear.
  • GET /v1/events streams snapshots, lifecycle changes, and execution telemetry over SSE.

pause and stop both immediately pause the goal and interrupt its current execution without deleting state. update interrupts the old execution, replaces the objective, and immediately wakes the loop. resume also wakes the loop without waiting for another session event.

Plugin options apiPort and apiDiscoveryFile can override the random port and discovery path.

Development

bun install
bun run check

Local loading

Add the built bundle as its own entry in opencode.json:

{
  "plugins": [
    "/home/ugur/Projects/opencode2-goal/dist/plugin.js"
  ]
}

The plugin owns /goal and the exposed goal_manage tool.