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-sentinel

v0.1.5

Published

A Monitor plugin for [OpenCode](https://opencode.ai) — background process monitoring with real-time agent notifications via steer delivery.

Readme

OpenCode Sentinel

A Monitor plugin for OpenCode — background process monitoring with real-time agent notifications via steer delivery.

Features

  • Process Monitoring: Run any shell command in the background; each stdout line is delivered to the agent as a real-time steer notification
  • Parallel Monitors: Run multiple monitors simultaneously
  • 200ms Batching: High-frequency output is batched at 200ms intervals to prevent flooding
  • Flood Protection: Auto-kills monitors exceeding 100 lines/second
  • stderr Separation: stderr is logged to /tmp/sentinel-{id}-stderr.log
  • Auto Cleanup: All processes are terminated on session end or plugin unload

Installation

Add to your opencode.json:

{
  "plugin": ["opencode-sentinel"]
}

Or install via file path:

{
  "plugin": ["file:///path/to/opencode-sentinel/src/index.ts"]
}

Or via CLI:

opencode plugin opencode-sentinel

Usage

Log Monitoring

Just ask the agent in natural language:

Monitor /var/log/app.log for ERROR lines using sentinel_monitor

The agent will call the appropriate tools:

| Tool | Description | |------|-------------| | sentinel_monitor | Start monitoring (command + description label) | | sentinel_stop | Stop a monitor by ID | | sentinel_list | List all running monitors | | sentinel_ping | Health check — returns "pong" | | sentinel_spike | Spike test — 3-second delayed steer delivery |

Important: grep requires --line-buffered

When piping to grep, you must use --line-buffered:

✅ tail -f /var/log/app.log | grep --line-buffered ERROR
❌ tail -f /var/log/app.log | grep ERROR

Without --line-buffered, grep buffers output and lines won't arrive in real-time.

Filtering Output (filter)

Pass a JavaScript regex to filter to receive only matching lines:

sentinel_monitor with:
  command: tail -f /var/log/app.log | grep --line-buffered -E "(ERROR|WARN)"
  filter: "ERROR"

Only ERROR lines arrive as notifications; WARN lines are silently dropped.

One-Shot Wait (until)

Use until to auto-stop the monitor when a matching line appears — ideal for "wake me when CI finishes" patterns without sleep polling:

sentinel_monitor with:
  command: gh run watch <run-id>
  until: "(completed|failed)"

When until matches, the line is delivered and the monitor is terminated automatically. Combine with filter to narrow the stream first:

sentinel_monitor with:
  command: tail -f build.log
  filter: "(error|fatal)"
  until: "BUILD (SUCCESS|FAILED)"

steer vs queue

Sentinel uses delivery: "steer" for agent notifications. Here's how it differs from "queue":

| Mode | Behavior | |------|----------| | steer (used by sentinel) | Immediately wakes idle sessions. During active runs, messages are promoted between provider turns. No streaming interruption. | | queue | Messages are queued until the run completes, then delivered on the next user input. Unsuitable for real-time monitoring. |

Why steer:

  • Real-time responsiveness: Instant wake on idle sessions ensures prompt log monitoring
  • No streaming disruption: LLM responses are not interrupted; notifications are picked up at turn boundaries
  • No queue buildup: Avoids notification backlog during long-running tasks

Limitations

  • Orphaned Processes: If OpenCode is killed via SIGKILL (bypassing the dispose hook), monitored processes may remain. Normal shutdown via dispose cleans up all processes.
  • No Mid-Stream Interruption: During LLM response streaming, steer notifications are not processed until the current turn completes. Idle sessions respond within 500ms.

Tech Stack

  • TypeScript (strict)
  • @opencode-ai/plugin (v1 Hooks API)
  • @opencode-ai/sdk/v2 (steer delivery)
  • Bun / Node.js compatible

License

MIT


日本語版はこちら