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

@robot-resources/openclaw-plugin

v0.5.3

Published

Robot Resources plugin for OpenClaw — cost-optimized model routing and token-compressed web fetching

Readme

@robot-resources/openclaw-plugin

Cost-optimized model routing and token-compressed web fetching for OpenClaw.

Routes LLM calls through the Robot Resources Router to select the cheapest capable model for each prompt, and redirects web_fetch calls through a scraper MCP for compressed output.

Installation

openclaw plugins install @robot-resources/openclaw-plugin

Or via the unified installer (recommended):

npx robot-resources

The unified installer handles Router setup, service registration, plugin installation, and scraper MCP configuration.

Requirements

  • OpenClaw gateway
  • Robot Resources Router running locally (default: http://localhost:3838)

Configuration

The plugin reads its configuration from openclaw.plugin.json:

{
  "routerUrl": "http://localhost:3838"
}

| Property | Type | Default | Description | |----------|------|---------|-------------| | routerUrl | string | http://localhost:3838 | URL of the Robot Resources Router proxy |

How It Works

Model Routing (before_model_resolve)

Before each model selection, the plugin queries the Router at /v1/route with the current prompt. The Router evaluates prompt complexity and returns the cheapest model that can handle it.

User prompt → Plugin → Router /v1/route → { model, provider, savings }
                                         ↓
                              modelOverride applied

The routing decision is appended to outgoing messages showing the selected model and savings percentage.

Web Fetch Override (before_tool_call)

When the agent calls web_fetch, the plugin redirects it to scraper_compress_url via the scraper MCP. This returns token-compressed output, reducing context window usage.

Falls through silently if the scraper MCP is not registered.

Provider Registration

In API-key mode, the plugin registers a robot-resources provider with OpenClaw. This enables routing through the local proxy with these models:

  • claude-sonnet-4-20250514
  • claude-haiku-4-5-20251001
  • claude-opus-4-20250514

Auth Modes

API-key Mode (default)

Full routing to any provider. The Router proxies requests through the local gateway.

Subscription Mode

Detected when OpenClaw is configured with OAuth/subscription authentication. Routing is restricted to Anthropic-only models (OAuth tokens are rejected by other providers when proxied).

Detection checks:

  • auth.profiles[*].mode === 'token'
  • gateway.auth.mode === 'token'

Hooks

| Hook | Priority | Description | |------|----------|-------------| | before_model_resolve | 10 | Routes to cheapest capable model via Router | | before_tool_call | 10 | Redirects web_fetch to scraper MCP | | message_sending | -10 | Appends routing decision tag to messages |

Exported API

import plugin from '@robot-resources/openclaw-plugin';
import { DEFAULT_ROUTER_URL, ROUTER_MODELS, askRouter, detectSubscriptionMode } from '@robot-resources/openclaw-plugin';

| Export | Type | Description | |--------|------|-------------| | default | object | Plugin object { id, name, register } | | DEFAULT_ROUTER_URL | string | http://localhost:3838 | | ROUTER_MODELS | string[] | Supported router model IDs | | askRouter(url, prompt, providers?) | async function | Query the Router directly | | detectSubscriptionMode(config) | function | Check if OpenClaw uses subscription auth |

Testing

npm test         # watch mode
npm run test:run # single run

44 tests across 2 suites: plugin contract tests and OpenClaw harness simulation.

License

MIT