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

omp-defender

v1.0.2

Published

Operation protection for oh-my-pi coding agent. Blocks dangerous commands and protects sensitive files.

Readme

OMP Defender

Operation protection for the oh-my-pi coding agent. Blocks dangerous commands and protects sensitive files via OMP extensions.

Install

cd ~/.omp/plugins
npm install omp-defender

Restart OMP. The defender protection-level selector appears on session start.

For local development:

cd ~/.omp/plugins
npm install omp-defender@link:../extensions/omp-defender
ln -s ~/.omp/extensions/omp-defender ~/.omp/plugins/node_modules/omp-defender
omp plugin link ~/.omp/extensions/omp-defender

Uninstall

cd ~/.omp/plugins
npm uninstall omp-defender
rm ~/.omp/defender/patterns.yaml
rm ~/.omp/agent/instructions/defender.md

How It Works

  Agent tool call
       │
       ▼
  Forbidden path? ──── yes ──► BLOCK (always, even when disabled)
       │ no
       ▼
  Disabled? ────────── yes ──► ALLOW
       │ no
       ▼
  Aborted? ─────────── yes ──► BLOCK
       │ no
       ▼
  ┌─── bash only ──────────────────────────────┐
  │                                             │
  │  Pattern match? ── yes ──► prompt (allow/deny)
  │       │ no                                  │
  │       ▼                                     │
  │  Strict mode? ──── no ───► ALLOW            │
  │       │ yes                                 │
  │       ▼                                     │
  │  Whitelisted? ──── yes ──► ALLOW            │
  │       │ no                                  │
  │       ▼                                     │
  │  Prompt: approve / whitelist / deny / abort │
  │                                             │
  └─────────────────────────────────────────────┘
       │
       ▼
     ALLOW

Protection Modes

| Mode | Behavior | |------|----------| | Patterns only (default) | Dangerous commands blocked by regex, everything else runs silently | | Strict | Every bash command requires your approval | | Disabled | All checks off — except forbidden path checks, which are always enforced |

Path Protection

Three tiers, configured in patterns.yaml:

| Tier | Read | Write/Edit | Delete | Examples | |------|------|------------|--------|----------| | Forbidden | Blocked | Blocked | Blocked | ~/.ssh/, ~/.aws/, *.pem, id_rsa | | Read-only | Allowed | Blocked | Blocked | /etc/, ~/.bashrc, *.lock, .env | | No-delete | Allowed | Allowed | Blocked | LICENSE, README.md, .omp/ |

Forbidden checks are enforced across all 9 tools: bash, write, edit, read, search, find, ast_grep, ast_edit, debug.

See src/patterns.yaml for the full default lists.

Bash Patterns

Dangerous commands blocked by regex (user prompted to allow or deny):

| Category | Examples | |----------|----------| | Destructive ops | rm -rf, find -delete, xargs rm | | Privilege escalation | sudo, su - | | Database destruction | DROP TABLE, DELETE FROM x;, TRUNCATE | | Git destructive | git push --force, git reset --hard, git stash drop | | Network attacks | curl \| bash, wget \| sh | | System danger | dd if=, mkfs, chmod 777, shutdown, eval |

See src/patterns.yaml for the full pattern list.

Commands

| Command | Effect | |---------|--------| | /defender:status | Show blocked/allowed counts and active config | | /defender:reload | Reload patterns.yaml from disk | | /defender:strict on\|off | Enable/disable strict mode (or toggle) | | /defender:log [N] | Show last N audit log entries (default 20) |

Audit Log

All decisions are logged to ~/.omp/defender/audit.log as JSONL — one line per block/allow/deny/abort/whitelist/approve event with timestamp, tool, reason, command/path, and cwd.

Configuration

Config merges from three paths (all merged, deduped):

| Priority | Path | Scope | |----------|------|-------| | 1 | .omp/patterns.yaml | Project | | 2 | ~/.omp/defender/patterns.yaml | Global | | 3 | Bundled src/patterns.yaml | Defaults |

bashToolPatterns:
  - pattern: '\brm\s+-[rRf]'
    reason: rm with recursive or force flags

forbiddenPaths:
  - ~/.ssh/
  - "*.pem"

readOnlyPaths:
  - /etc/
  - .env

noDeletePaths:
  - LICENSE

strictModeWhiteList:
  - ^git status\b

Safety Guarantees

  • Forbidden paths are always enforced, even with defender disabled
  • Whitelists never override bashToolPatterns blocks
  • Abort persists until /defender:strict off
  • Regex patterns validated at load time (ReDoS-safe)
  • Relative paths resolved to absolute before matching
  • Fail-closed: UI failure defaults to patterns-only, no-UI defaults to deny

License

MIT