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

webagents

v0.3.5

Published

TypeScript SDK for in-browser AI agents with UAMP protocol support

Downloads

87

Readme

WebAgents - core framework for the Web of Agents

Build, Serve and Monetize AI Agents

WebAgents is a powerful opensource framework for building connected AI agents with a simple yet comprehensive API. Put your AI agent directly in front of people who want to use it, with built-in discovery, authentication, and monetization.

npm version Node 20+ License

Key Features

  • Modular Skills System - Combine tools, prompts, hooks, and HTTP endpoints into reusable packages
  • Agent-to-Agent Delegation - Delegate tasks to other agents via natural language. Powered by real-time discovery, authentication, and micropayments for safe, accountable, pay-per-use collaboration across the Web of Agents.
  • Real-Time Discovery - Agents discover each other through intent matching - no manual integration
  • Built-in Monetization - Earn credits from priced tools with automatic billing
  • Trust & Security - Secure authentication and scope-based access control
  • In-Browser LLM - Run agents locally using WebLLM (WebGPU) or Transformers.js, plus cloud providers (OpenAI, Anthropic, Google, xAI)
  • Protocol Agnostic - Deploy agents as standard chat completion endpoints with support for UAMP, OpenAI Responses/Realtime, ACP, A2A and other common protocols
  • Build or Integrate - Build from scratch with WebAgents, or integrate existing agents from popular SDKs and platforms into the Web of Agents

With WebAgents delegation, your agent is as powerful as the whole ecosystem, and capabilities of your agent grow together with the whole ecosystem.

Installation

npm install webagents

Optional Peer Dependencies

Install the LLM providers you need:

# In-browser LLM (choose one or both)
npm install @mlc-ai/web-llm           # WebGPU optimized
npm install @huggingface/transformers  # WebGPU + WASM fallback

# Cloud LLM providers
npm install openai                     # OpenAI GPT
npm install @anthropic-ai/sdk          # Anthropic Claude
npm install @google/generative-ai      # Google Gemini

Quick Start

Create Your First Agent

import { BaseAgent } from 'webagents';
import { OpenAISkill } from 'webagents/skills/llm/openai';

const agent = new BaseAgent({
  name: 'assistant',
  instructions: 'You are a helpful AI assistant.',
  skills: [
    new OpenAISkill({
      apiKey: process.env.OPENAI_API_KEY,
      model: 'gpt-4o'
    })
  ]
});

const response = await agent.run([
  { role: 'user', content: 'Hello! What can you help me with?' }
]);

console.log(response.content);

In-Browser Agent (WebLLM)

import { BaseAgent } from 'webagents';
import { WebLLMSkill } from 'webagents/skills/llm/webllm';

const agent = new BaseAgent({
  name: 'browser-assistant',
  skills: [
    new WebLLMSkill({
      model: 'Llama-3.1-8B-Instruct-q4f32_1-MLC'
    })
  ]
});

await agent.initialize();

const response = await agent.run([
  { role: 'user', content: 'What is WebGPU?' }
]);

Serve Your Agent

Deploy your agent as an HTTP server:

import { BaseAgent } from 'webagents';
import { serve } from 'webagents/server';

const agent = new BaseAgent({ ... });

await serve(agent, { port: 3000 });

Streaming Responses

for await (const chunk of agent.runStreaming([
  { role: 'user', content: 'Write a poem about AI' }
])) {
  if (chunk.type === 'delta') {
    process.stdout.write(chunk.delta);
  }
}

Skills Framework

Skills combine tools, prompts, hooks, and HTTP endpoints into easy-to-integrate packages:

import { Skill, tool, hook, handoff } from 'webagents';
import { pricing } from 'webagents/skills/payments';

class NotificationsSkill extends Skill {
  @tool({
    description: 'Send a notification',
    parameters: {
      type: 'object',
      properties: {
        title: { type: 'string' },
        body: { type: 'string' }
      },
      required: ['title', 'body']
    }
  })
  @pricing({ creditsPerCall: 0.01 })
  async sendNotification(params: { title: string; body: string }) {
    return `Notification sent: ${params.title}`;
  }

  @hook({ lifecycle: 'on_request' })
  async logMessages(context: any) {
    return context;
  }
}

Core Skills - Essential functionality:

  • LLM Skills: OpenAI, Anthropic, Google Gemini, xAI Grok, WebLLM, Transformers.js
  • MCP Skill: Model Context Protocol integration
  • LLM Proxy: Platform LLM proxy over UAMP (BYOK, settlement)

Platform Skills - WebAgents ecosystem:

  • Discovery: Real-time agent discovery and routing
  • Authentication: Secure agent-to-agent communication
  • Payments: Monetization and automatic billing
  • Portal Transport: Native UAMP over WebSocket

Transport Skills - Protocol adapters:

  • Completions Transport: Expose agent as OpenAI-compatible API
  • Portal Transport: Connect to portal/daemon via UAMP

Browser Skills - Client-side capabilities:

  • WakeLock, Notifications, Geolocation - Device APIs
  • Storage, Camera, Microphone - Media and persistence

Monetization

Add payments to earn credits from your agent:

import { BaseAgent, Skill, tool } from 'webagents';
import { PaymentSkill, pricing } from 'webagents/skills/payments';

class ThumbnailSkill extends Skill {
  @tool({
    description: 'Create a thumbnail for a public image URL',
    parameters: {
      type: 'object',
      properties: {
        url: { type: 'string' },
        size: { type: 'number' }
      },
      required: ['url']
    }
  })
  @pricing({ creditsPerCall: 0.01, reason: 'Image generation' })
  async generateThumbnail(params: { url: string; size?: number }) {
    return { url: params.url, thumbnail_size: params.size ?? 256, status: 'created' };
  }
}

const agent = new BaseAgent({
  name: 'thumbnail-generator',
  skills: [
    new ThumbnailSkill(),
    new PaymentSkill(),
    new OpenAISkill({ model: 'gpt-4o' })
  ]
});

Environment Setup

export OPENAI_API_KEY="your-openai-key"

# Robutler API key for payments
export WEBAGENTS_API_KEY="your-webagents-key"

Get your WEBAGENTS_API_KEY at https://robutler.ai/developer

CLI

# Interactive chat
npx webagents chat

# With specific model
npx webagents chat --model gpt-4o

# List available models
npx webagents models

# Show agent info
npx webagents info

Web of Agents

WebAgents enables dynamic real-time orchestration where each AI agent acts as a building block for other agents:

  • Real-Time Discovery: Think DNS for agent intents - agents find each other through natural language
  • Trust & Security: Secure authentication with audit trails for all transactions
  • Delegation by Design: Seamless delegation across agents, enabled by real-time discovery, scoped authentication, and micropayments. No custom integrations or API keys to juggle—describe the need, and the right agent is invoked on demand.

Documentation

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support


Focus on what makes your agent unique instead of spending time on plumbing.

Built with ❤️ by the WebAgents team and community contributors.