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

@ruvector/rvagent-wasm

v0.1.0

Published

rvAgent WASM bindings — browser and Node.js agent execution

Downloads

44,087

Readme

rvagent-wasm

WASM bindings for rvAgent — run AI agents entirely in the browser or Node.js.

Features

  • WasmAgent — Full agent execution in browser/Node.js with conversation history
  • WasmMcpServer — MCP JSON-RPC server running in the browser (no backend required)
  • Virtual Filesystem — In-memory file operations for sandboxed execution
  • Gallery System — Built-in agent templates with RVF container export
  • Zero Dependencies — Runs entirely client-side via WebAssembly

Installation

# Build from source
cd crates/rvAgent/rvagent-wasm
wasm-pack build --target web

# Or use the pre-built package
npm install rvagent-wasm  # (Not yet published)

Usage

WasmAgent

import init, { WasmAgent } from 'rvagent-wasm';

await init();

// Create an agent
const agent = new WasmAgent(JSON.stringify({
  model: "anthropic:claude-sonnet-4-20250514",
  name: "my-agent",
  instructions: "You are a helpful coding assistant.",
  max_turns: 50
}));

// Connect a model provider (calls your LLM API)
agent.set_model_provider(async (messagesJson) => {
  const messages = JSON.parse(messagesJson);
  const response = await fetch('/api/chat', {
    method: 'POST',
    body: JSON.stringify({ messages })
  });
  return (await response.json()).content;
});

// Send a prompt
const result = await agent.prompt("Write a hello world function");
console.log(result.response);

// Execute tools directly
agent.execute_tool('{"tool": "write_file", "path": "hello.js", "content": "console.log(\"Hello!\");"}');

// Check state
console.log(agent.turn_count());      // 1
console.log(agent.file_count());      // 1
console.log(agent.get_todos());       // []

WasmMcpServer

Run an MCP server entirely in the browser:

import init, { WasmMcpServer } from 'rvagent-wasm';

await init();

const mcp = new WasmMcpServer("rvagent-wasm");

// Handle MCP JSON-RPC requests
const response = mcp.handle_request(JSON.stringify({
  jsonrpc: "2.0",
  id: 1,
  method: "initialize",
  params: {}
}));

// List available tools
const tools = mcp.list_tools();

// Call a tool
const result = mcp.call_tool("write_file", JSON.stringify({
  path: "demo.txt",
  content: "Hello from WASM!"
}));

Gallery System

Access built-in agent templates:

// List all templates
const templates = mcp.handle_request(JSON.stringify({
  jsonrpc: "2.0",
  id: 1,
  method: "gallery/list",
  params: {}
}));

// Search templates
const searchResults = mcp.handle_request(JSON.stringify({
  jsonrpc: "2.0",
  id: 2,
  method: "gallery/search",
  params: { query: "coding assistant" }
}));

// Load a template
const loaded = mcp.handle_request(JSON.stringify({
  jsonrpc: "2.0",
  id: 3,
  method: "gallery/load",
  params: { id: "claude-code" }
}));

Available Tools

| Tool | Description | |------|-------------| | read_file | Read file from virtual filesystem | | write_file | Write file to virtual filesystem | | edit_file | Apply string replacement to a file | | list_files | List all files in virtual filesystem | | write_todos | Manage todo list |

Note: OS-level tools (execute, glob, grep) are intentionally omitted as they require system access unavailable in the browser sandbox.

MCP Methods

| Method | Description | |--------|-------------| | initialize | Initialize MCP connection | | ping | Health check | | tools/list | List available tools | | tools/call | Execute a tool | | resources/list | List virtual filesystem as resources | | prompts/list | List prompts from active template | | gallery/list | List all agent templates | | gallery/search | Search templates by query | | gallery/get | Get template details | | gallery/load | Load template as active config | | gallery/configure | Apply config overrides | | gallery/categories | List template categories |

API Reference

WasmAgent

| Method | Description | |--------|-------------| | new(configJson) | Create agent from JSON config | | set_model_provider(callback) | Set JS callback for LLM calls | | prompt(input) | Send prompt, get response (async) | | execute_tool(toolJson) | Execute a tool directly | | get_state() | Get conversation state as JSON | | get_todos() | Get todo list as JSON | | get_tools() | Get available tools | | reset() | Clear state and start fresh | | version() | Get crate version | | name() | Get agent name | | model() | Get model identifier | | turn_count() | Get current turn count | | is_stopped() | Check if agent is stopped | | file_count() | Get virtual filesystem file count |

WasmMcpServer

| Method | Description | |--------|-------------| | new(name) | Create MCP server | | handle_request(json) | Handle JSON-RPC request | | list_tools() | Get available tools as JSON | | call_tool(name, paramsJson) | Call tool by name | | gallery() | Get gallery info | | is_initialized() | Check initialization status | | name() | Get server name | | version() | Get server version |

Building

# Install wasm-pack
cargo install wasm-pack

# Build for web
wasm-pack build --target web

# Build for Node.js
wasm-pack build --target nodejs

# Run tests
cargo test
wasm-pack test --headless --chrome

Security

  • Request size limit: 100 KB
  • Path length limit: 256 characters
  • Content length limit: 1 MB
  • Path traversal (..) blocked
  • Todo count limit: 1000 items

Architecture

rvagent-wasm/
├── src/
│   ├── lib.rs        # WasmAgent — main agent type
│   ├── backends.rs   # WasmStateBackend — virtual filesystem
│   ├── bridge.rs     # JsModelProvider — JS interop
│   ├── gallery.rs    # WasmGallery — template system
│   ├── mcp.rs        # WasmMcpServer — MCP protocol
│   ├── rvf.rs        # RVF container support
│   └── tools.rs      # Tool definitions and executor
└── pkg/              # Built WASM package
    ├── rvagent_wasm.js
    ├── rvagent_wasm.d.ts
    └── rvagent_wasm_bg.wasm

Related Crates

| Crate | Description | |-------|-------------| | rvagent-core | Agent state, graph, config | | rvagent-backends | Backend protocol + implementations | | rvagent-tools | Full tool implementations | | rvagent-mcp | Native MCP client/server | | rvagent-cli | Terminal UI |

License

MIT OR Apache-2.0