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

elizaos-plugin-aiworker

v0.1.3

Published

aiworker's paid x402 data routes as an ElizaOS plugin — one action per route, each paying its own call in USDC on Base

Readme

aiworker for ElizaOS

Published copy: https://github.com/ai-worker227/aiworker-examples/tree/main/elizaos.

Paid aiworker routes as an ElizaOS plugin. One import builds one action per route from the live OpenAPI catalogue; each call pays over x402 from your own Base wallet. Copy src/ into your agent.

Install

In your agent, which already has @elizaos/core:

pnpm add @x402/core @x402/evm @x402/fetch viem zod

Then copy src/ (catalog.ts, schema.ts, payer.ts, actions.ts, eliza-types.ts, index.ts) and build the plugin from the runtime's settings (AIWORKER_BUYER_KEY, optional AIWORKER_BASE_URL and AIWORKER_CHAIN = base | baseSepolia):

import { aiworkerPluginFromSettings } from "./src/index.js";
const plugin = await aiworkerPluginFromSettings(runtime, { maxPriceUsd: 0.05 });

or directly with aiworkerPlugin({ privateKey, maxPriceUsd }). The package's default export is a ready plugin object for a character's plugins list: empty until the runtime calls its init, which reads the same settings (plus AIWORKER_MAX_PRICE_USD, default 0.05) and fills the actions in place; without a key it stays empty and the agent still starts. An action takes its arguments from options.args or from a message whose text is a JSON object; anything else is invalid_arguments and nothing is paid.

Why @elizaos/core is not a dependency here

The ElizaOS shapes are mirrored in eliza-types.ts; this example cannot carry @elizaos/core in its lockfile. The export is structurally what @elizaos/core's Plugin expects. A type mismatch with a future ElizaOS major is a compile error in the agent, not a runtime surprise.

Wallet

You need a Base wallet holding USDC. The key lives only in AIWORKER_BUYER_KEY; it is never logged, committed, or sent anywhere except as an EIP-3009 signature inside the x402 payment header.

Price cap

maxPriceUsd drops every route priced above it (default: no cap). The example uses 0.05. Each action description carries its per-call price.

Routes and prices

| Route | Price | |---|---| | GET /v1/token/info | $0.005 | | POST /v1/scrape/markdown | $0.02 | | POST /v1/polymarket/backtest | $0.25 |

The table is the trimmed fixture; the live catalogue has seventeen paid routes, all discovered through fetchCatalog at runtime. Actions are named AIWORKER_<operation id> (AIWORKER_TOKEN_INFO live).

Example

AIWORKER_BUYER_KEY=0x… pnpm --filter @aiworker/example-elizaos example

Lists the capped actions, calls token/info once for Base USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913), and prints the answer plus the settlement hash. Refuses to run without the key (exit 2).

With a model

MODEL_BASE_URL=… MODEL_API_KEY=… MODEL_NAME=… AIWORKER_BUYER_KEY=0x… pnpm --filter @aiworker/example-elizaos example:agent

Turns the capped actions into OpenAI tools for a chat model, which picks at most one to answer one Polymarket question — see example-agent.ts. The script needs no extra package beyond the example's dependencies. It costs one $0.01 market_odds call plus the model's own tokens: this pays real USDC.

What it does not do

  • No Solana: EVM/Base only, even where the server quotes Solana.
  • No MCP: plain ElizaOS actions, not a Model Context Protocol server.
  • No retries: a non-2xx answer is returned as a failed result with the status and, when the server reported one, the settlement hash. Settlement is the SERVER's rule, not this client's: aiworker's routes settle only on a 200 (the authorization flow) except routes whose 402 says they settle before the work; the client cannot enforce either, it only surfaces the hash for reconciliation as { success: false, error, text } and the call is over.
  • No provider/evaluator: actions only, no custom providers or evaluators.

Changelog

  • 0.1.2 — AIWORKER_MAX_PRICE_USD is enforced at payment time on the amount the server's 402 actually asks for (the catalogue's advertised price is only used to build the action list); a 402 over the cap is refused before anything is signed.
  • 0.1.3 — actions are available from ordinary conversation (validate answers availability; arguments are resolved at the handler, a miss names the expected fields); the buyer signs only on the selected CAIP-2 network (AIWORKER_CHAIN), other EVM quotes are refused; settlement wording corrected (the server's rule, surfaced, not guaranteed by the client).