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

agent-operator

v0.3.2

Published

Drop-in toolkit for governed, observable AI agent payments

Readme

agent-operator

Drop-in toolkit for governed, observable AI agent payments.

MPP for payments via chain connectors. OWS for authorization + policies. Pluggable notifications for human oversight.

Install

npm install agent-operator

Quick Start

# interactive setup — creates agent-operator.json
npx agent-operator init
import { createOperator } from "agent-operator"

const operator = await createOperator()

await operator.pay("my-agent", {
  service: "https://api.example.com",
  chain: "base",
  maxBudget: 2,
})

await operator.shutdown()

Config

All configuration lives in agent-operator.json. The CLI generates it, or create it manually:

{
  "wallets": {
    "my-agent": {
      "walletId": "ows-wallet-id",
      "chains": ["base", "solana", "tempo"],
      "policies": {
        "dailyLimit": 50,
        "sessionCap": 5,
        "newCounterpartyHold": true,
        "lowBalanceThreshold": 10,
        "highValueThreshold": 200
      },
      "notifications": {
        "provider": "telegram",
        "botToken": "YOUR_BOT_TOKEN",
        "chatId": "YOUR_CHAT_ID",
        "alerts": {
          "lowBalance": true,
          "highValueTx": true,
          "newCounterparty": true,
          "policyDenied": true,
          "dailySummary": true,
          "sessionOpened": false
        }
      }
    }
  }
}

One agent-operator instance manages multiple wallets. Each wallet has its own chains, policies, and notification provider.

Connectors

Each connector wraps MPP for a specific chain. Built-in:

  • Tempo — uses built-in mppx session method
  • Base — custom MPPX method with OWS EVM signing, USDC balance via RPC
  • Solana — wraps @solana/mpp with OWS Ed25519 signing, USDC balance via RPC

Connectors are resolved automatically from the wallet's chains array.

Policies

The policy engine runs before every pay() call, in order:

  1. Session cap — reject if maxBudget > sessionCap
  2. Daily limit — reject if today's spend + maxBudget > dailyLimit
  3. High value gate — if above threshold, request human approval via notification
  4. New counterparty hold — if first-time service, request human approval
  5. Low balance alert — non-blocking notification if below threshold

Spend is tracked locally in ~/.agent-operator/spend.json.

Notifications

Pluggable provider system. Each wallet can use a different provider.

TelegramProvider (built-in)

Uses grammy with long-polling for approval flows. Included as a dependency — no extra install needed.

Approval messages show inline buttons. First response wins. Timeout (default 5 min) = rejected.

Custom Provider

import { NotificationProvider, AgentEvent, ApprovalEvent, ApprovalResult } from "agent-operator"

class MyProvider implements NotificationProvider {
  name = "my-platform"
  async start() {}
  async stop() {}
  async send(event: AgentEvent) { /* fire-and-forget alert */ }
  async sendWithApproval(event: ApprovalEvent): Promise<ApprovalResult> {
    const approved = await askUser(event)
    return { approved, approvalId: event.approvalId }
  }
}

CLI

npx agent-operator init          # interactive setup
npx agent-operator add-wallet    # add wallet to existing config
npx agent-operator status        # show wallets, balances, today's spend

API

const operator = await createOperator()        // reads ./agent-operator.json
const operator = await createOperator(path)    // custom config path

await operator.pay(walletName, { service, chain, maxBudget })
await operator.getBalance(walletName, chain)
await operator.closeSession(walletName, sessionId)
operator.getWalletNames()
await operator.shutdown()

How It Works

agent code
    |
    v
agent-operator SDK (in-process)
    +-- Connectors
    |     +-- TempoConnector   (mppx session + OWS signing)
    |     +-- BaseConnector    (custom mppx method + OWS EVM signing)
    |     +-- SolanaConnector  (@solana/mpp + OWS Ed25519 signing)
    |
    +-- Policy Engine
    |     +-- daily-limit, session-cap, high-value-gate
    |     +-- new-counterparty-hold, low-balance-alert
    |
    +-- Notification Engine
          +-- TelegramProvider (grammy long-polling)
          +-- [custom providers]

No server. No KV. No separate process.

Dependencies

| Package | Role | |---------|------| | @open-wallet-standard/core | Wallet management, signing, policies | | mppx | MPP protocol client (Tempo built-in) | | @solana/mpp | Solana MPP implementation | | grammy | Telegram bot for notifications |