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

@betterclaw-ai/plugin-openclaw

v0.3.19

Published

Workflow-enforcement layer for OpenClaw — gates AI agent tool calls against a declarative graph. Tools come from the host environment (Cowork connectors or user-installed MCP servers).

Readme

betterclaw (OpenClaw plugin)

Workflow-enforcement layer for OpenClaw. Snaps agents back when they try to step outside the declared workflow graph. Per ADR 0002, the plugin enforces over whatever tools the host environment provides; it does not own or bundle verticals.

What's in here

packages/plugin-openclaw/
├── package.json              name: "@betterclaw-ai/plugin-openclaw"
├── openclaw.plugin.json      id: "betterclaw", description, configSchema
├── index.mjs                 thin plugin entry — loads graph, registers hooks
├── enforcement.mjs           enforcement core: graph + tool call → decision
├── history.mjs               cross-turn approval-history surfacing
├── workflow.mjs              graph loader, transition rule, circuit breaker
├── mcp-proxy-client.mjs      Unix-socket MCP client (used by Phase 2 Gmail fallback)
├── telemetry.mjs             plugin-side telemetry writer
├── vertical-email.mjs        Gmail integration — kept for Phase 2 `betterclaw connect gmail` opt-in (not registered by default in v0.3+)
├── demo-shopping.mjs         tutorial demo (dummyjson.com), gated by BETTERCLAW_DEMO=1
└── active-graph.json         current workflow graph (rewritten by `betterclaw <paragraph>`)

The plugin is pure code — no subprocess spawns, no tool registration by default. That's why it installs without the --dangerously-force-unsafe-install flag. Real verticals (Gmail, calendar, sales, etc.) come from the host environment: Anthropic connectors when running under Cowork, user-installed MCP servers when running under OpenClaw.

How it's identified

OpenClaw tracks this plugin as betterclaw (the id field in openclaw.plugin.json). That's what goes in plugins.allow. The npm package name is @betterclaw-ai/plugin-openclaw — different from the plugin id by design: the id is the runtime identity OpenClaw recognizes, the package name is where npm publishes the code.

Install / reinstall

From repo root:

openclaw plugins install $PWD/packages/plugin-openclaw --link
openclaw config set plugins.allow '["betterclaw"]'

--link means edits to files in this directory take effect on the next agent turn — no reinstall cycle during dev.

Architecture notes

Enforcement registers two native OpenClaw hooks via api.on(...):

  • before_tool_call — runs the workflow gate. Decides allow / block / queue-for-approval. Fires for plugin-served tools as of openclaw 2026.4.24 (upstream PR #71159).
  • before_prompt_build — surfaces recent out-of-band approvals so the agent sees what the user handled in another shell. Returns { prependContext } which OpenClaw splices into the system prompt for the next turn. Fires on the cli-runner path as of openclaw 2026.4.24 (upstream PR #70625).

v0.3.0 requires openclaw.compat.minGatewayVersion >= 2026.4.24 so both hooks fire natively.

Testing

# Demo path (zero external setup, runs against fake catalog)
BETTERCLAW_DEMO=1 betterclaw run "find a good wireless mouse under $50"

# Real workflows: tools come from host environment
# (Anthropic Cowork connectors, or user-installed MCP servers under OpenClaw)
betterclaw run "<your paragraph>"

Watch ~/.betterclaw/history.jsonl to see what the plugin recorded. Watch packages/plugin-openclaw/run.jsonl for per-turn enforcement events.

What's NOT here (by design)

  • No tool ownership by default — tools come from the host environment, not from BetterClaw.
  • No approval dispatch code — lives in @betterclaw-ai/cli (the plugin just marks things queued and returns immediately).
  • No Cowork-specific code — lives in packages/plugin-cowork/.

Demo flag

Set BETTERCLAW_DEMO=1 to register the tutorial shopping tools (dummyjson.com fake catalog: shop_search, shop_details, shop_compare). Tutorial only — not a real shopping integration. Off by default.