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

orca-opencode-plugin

v1.1.1

Published

OpenCode plugin wrapper for Orca runtime guardrails.

Readme

Orca OpenCode Plugin

OpenCode plugin wrapper for Orca runtime guardrails.

What this plugin does

This plugin adds Orca-native lifecycle hooks to OpenCode. It lets OpenCode call the Orca CLI for policy checks, audit logging, and runtime safety decisions without duplicating policy logic.

The plugin is a thin integration layer. The Orca CLI remains the source of truth for all policy decisions.

Prerequisites

  • Orca CLI built and available in PATH (run orca doctor to verify)
  • OpenCode host installed

Orca must be installed separately. The plugin does not bundle the Orca CLI.

Install from npm

Add to your opencode.json:

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

Then install dependencies:

npm install orca-opencode-plugin

The strongest local protection remains running OpenCode through orca run -- opencode; the OpenCode plugin provides native hooks and guardrails inside OpenCode.

Install from local path

If you prefer to use the plugin directly from the Orca repository:

Project-local install

Copy or symlink this directory into your project:

# From the Orca repo root
mkdir -p .opencode/plugins
cp integrations/opencode-plugin/orca.ts .opencode/plugins/orca.ts

See examples/project-plugin-path.md for details.

Global install

Copy or symlink to the OpenCode global plugins directory:

mkdir -p ~/.config/opencode/plugins
cp integrations/opencode-plugin/orca.ts ~/.config/opencode/plugins/orca.ts

See examples/global-plugin-path.md for details.

Verify the plugin is recognized

orca plugin doctor opencode

Verify install

Run the Orca plugin doctor:

orca plugin doctor opencode

Expected output sections:

  • Orca version
  • Policy status (present/valid)
  • Plugin directories (opencode: found)
  • Host binaries (opencode: detected or not detected)

Hooks included

The plugin registers lifecycle hooks that call orca hook opencode <event>:

| Event | When it fires | Behavior | |-------|---------------|----------| | session.created | At the start of an OpenCode session | Informational (readiness log) | | tool.execute.before | Before OpenCode invokes a tool | Blocking — Orca can prevent the tool call | | tool.execute.after | After OpenCode finishes using a tool | Informational (audit only) | | permission.asked | When OpenCode requests user permission | Blocking — Orca can deny the permission | | file.edited | When a file is edited by OpenCode | Informational (audit only) | | command.executed | When a shell command is executed | Informational (audit only) | | session.updated | When the session state changes | Informational (audit only) | | session.idle | When the session becomes idle | Informational (audit only) | | session.error | When a session error occurs | Informational (audit only) | | shell.env | When the shell environment is read | Informational (secrets redacted) |

How hooks call Orca

Each hook sends a JSON payload to orca hook opencode <event> via stdin and reads a JSON decision from stdout. The plugin preserves OpenCode's expected return values. Human-readable logs go to stderr.

Example payload for tool.execute.before:

{
  "version": 1,
  "host": "opencode",
  "event": "PreToolUse",
  "payload": {
    "tool": "shell",
    "command": "git status"
  },
  "session_id": "session-uuid",
  "timestamp": "2026-01-01T00:00:00Z"
}

Example response:

{
  "version": 1,
  "decision": "allow",
  "risk": "low",
  "category": "command",
  "reason": "policy_allow",
  "message": "Allowed by policy"
}

If the decision is block, the plugin throws an error that prevents the tool from executing.

Run redteam

orca redteam --ci

Replay sessions

orca replay --session last --verify

Uninstall

Remove the plugin from your OpenCode configuration:

# npm package
npm uninstall orca-opencode-plugin

# Project-local file
rm .opencode/plugins/orca.ts

# Global file
rm ~/.config/opencode/plugins/orca.ts

This plugin does not mutate host configuration, so uninstalling is safe.

Known limitations

  • Hooks are advisory for informational events; blocking hooks depend on OpenCode honoring thrown errors.
  • The strongest protection remains orca run -- opencode.
  • Plugin installation depends on OpenCode version and plugin loading mechanism.
  • No telemetry is collected.
  • Official npm publication is in progress; the package structure is ready for publication.

Security model

  • This plugin calls the Orca CLI; it does not reimplement policy logic.
  • No raw secrets are persisted in plugin files.
  • Secrets are redacted from payloads before sending to Orca (keys matching password, token, secret, api_key, etc. are replaced with [REDACTED]).
  • Hook return values remain valid for OpenCode parsing.
  • Human logs go to stderr.
  • CI mode never prompts.
  • This plugin does not claim stronger enforcement than OpenCode hooks support.

No MCP server behavior

The OpenCode plugin does not add MCP server behavior or drone-specific plugin features.

Strongest protection warning

The Orca OpenCode plugin adds lifecycle hooks for OpenCode. For the strongest local protection, run the OpenCode process itself through Orca with orca run -- opencode.