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

@researchcomputer/agents-sdk

v0.2.1

Published

Coding agent SDK built on pi-ai and pi-agent-core

Readme

@researchcomputer/agents-sdk

A TypeScript SDK for building coding agents powered by large language models. Built on @mariozechner/pi-agent-core, it provides a high-level framework for creating agents with file operations, shell execution, web access, permission controls, memory, sessions, MCP servers, and multi-agent swarms.

npm version Node.js >= 20 TypeScript License: MIT

Features

  • 🔧 Built-in Tools — File operations (Read, Write, Edit, Glob, Grep), shell execution (Bash), web access (WebFetch, WebSearch), Jupyter notebook editing, and user interaction
  • 🔒 Permission System — Capability-based access control with multiple modes (default, allowAll, rulesOnly) and interactive prompting
  • 🧠 Memory — Persistent, queryable per-agent memories with relevance scoring
  • 💾 Sessions — Snapshot-based conversation persistence and resumption
  • 🔌 MCP — Connect external tool servers via Model Context Protocol (stdio, SSE, HTTP transports)
  • 🐝 Swarm — Multi-agent coordination with mailbox messaging and task delegation
  • 🌿 Snapshot & Fork — Checkpoint agent state and branch into parallel explorations
  • 🪝 Middleware & Hooks — Observe and modify agent behavior at lifecycle points
  • 📊 Observability — Token/cost tracking and trace IDs for debugging

Documentation

| Document | Description | |---|---| | Getting Started | Installation, quick start, and first agent | | Core Concepts | Architecture, tools, permissions, memory, sessions, MCP, swarm | | API Reference | Complete API documentation with types and examples | | Examples | Practical usage patterns and recipes |

Quick Start

Installation

npm install @researchcomputer/agents-sdk @researchcomputer/ai-provider

Minimal Example

import { createAgent } from '@researchcomputer/agents-sdk';
import { getModel } from '@researchcomputer/ai-provider';

const agent = await createAgent({
  model: getModel('openai', 'gpt-4o'),
  cwd: process.cwd(),
  getApiKey: async () => process.env.OPENAI_API_KEY,
});

await agent.prompt('List all TypeScript files and summarize what they do');
await agent.dispose();

Integrations

Three ways to use this SDK from an external codebase:

| Path | For | Start here | |---|---|---| | Node.js library | Apps built on Node | docs/getting-started.md | | Non-Node host | Python, Rust, Go, browser, Deno, Bun — anywhere ES modules or WASM Components run | docs/embedding-core.md | | Consuming agent outputs | External systems reading session snapshots, trajectories, hook payloads | docs/spec/README.md |

Full router: INTEGRATIONS.md.

Authentication

The SDK supports two auth patterns:

  • Direct provider auth, where you pass a provider API key via getApiKey.
  • Research Computer hosted auth, where you log in once and let the SDK reuse a stored session JWT.

Provider API Keys

export OPENAI_API_KEY=sk-...
const agent = await createAgent({
  model: getModel('openai', 'gpt-4o'),
  getApiKey: async () => process.env.OPENAI_API_KEY,
});

Login / Session Auth

For the hosted login flow, set the proxy and Stytch env vars, then call initiateLogin() once:

export RC_LLM_PROXY_URL=https://api.research.computer
export STYTCH_PUBLIC_TOKEN=public-token-...
import { createAgent, initiateLogin, logout } from '@researchcomputer/agents-sdk';

await initiateLogin(); // opens the browser and saves ~/.rc-agents/auth.json

const agent = await createAgent({
  model: getModel('openai', 'gpt-4o'),
});

await agent.prompt('Summarize this repository');
await agent.dispose();

await logout(); // revokes the session best-effort and removes ~/.rc-agents/auth.json

When no custom getApiKey is provided, createAgent() resolves auth in this order:

  1. config.authToken
  2. RC_AUTH_TOKEN
  3. ~/.rc-agents/auth.json via getSession()
  4. Legacy telemetry API key fallbacks

If none of those are present, it throws AuthRequiredError.

Architecture Overview

@researchcomputer/agents-sdk
├── Factory            createAgent() — main entry point
├── Tools              Built-in: Read, Write, Edit, Bash, Glob, Grep, WebFetch, WebSearch, NotebookEdit, AskUser
├── Permissions        Capability-based access control with multiple modes
├── Memory             Persistent, queryable per-agent memories
├── Sessions           Snapshot-based conversation persistence
├── MCP                Connect external tool servers via Model Context Protocol
├── Swarm              Multi-agent coordination with mailbox messaging
├── Middleware         Hooks, permission gates, and pipeline composition
├── Context            Message conversion, system prompt construction, compression
└── Observability      Token/cost tracking and trace IDs

Development

This repo uses Bun as the primary toolchain — it drives installs, scripts, and the WASM bundler. The published artifact is a standard Node ESM package, so consumers can continue to use npm, pnpm, or yarn without installing Bun.

# Install dependencies (Bun is the primary package manager)
bun install

# Build
bun run build

# Run tests (Vitest under Bun)
bun run test

# Type check
bun run lint

# Build the WASM component for the Python/WASM embedding
bun run build:wasm

npm still works for every script above — npm install && npm run test is supported for contributors who don't want to add a second toolchain. The only thing exclusive to Bun is the WASM bundler, which calls the Bun.build() API directly in src/python/wasm-guest/bun-build.ts.

Requirements

  • Node.js >= 20.0.0
  • Bun >= 1.3.0 (for contributors; consumers don't need it)
  • TypeScript >= 5.7.0 (for development)

License

MIT