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

runcell

v1.14.0

Published

TypeScript runtime for running agents in sandboxes with structured results, file outputs, and persistent threads.

Readme

runcell

Give an agent a workspace. Get back validated results.

Runcell is a TypeScript runtime for agents that work with files and tools. Select a catalog model or register a provider, seed a sandbox with files, and receive streamed text, file changes, or schema-validated data. Threads and snapshots serialize to JSON for application-managed persistence.

import { createAgent, createThread } from 'runcell';
import { z } from 'zod';

const agent = createAgent({ model: 'anthropic/claude-sonnet-4-5' });

// A chat turn: no schema, the streamed text is the reply.
const thread = createThread();
const { textStream, result } = agent.stream({ prompt: 'Hi!', thread });
for await (const delta of textStream) process.stdout.write(delta);
await result;

// A structured task: result.data is validated against the schema.
const review = await agent.run({
  prompt: 'Review index.ts and report risks.',
  files: [{ path: 'index.ts', text: source }],
  schema: z.object({ risks: z.array(z.string()) }),
});

What it does

runcell gives an agent a sandbox workspace and gives you back values your application can rely on:

  • Streaming: agent.stream() returns { textStream, result }. Pipe deltas to a UI and await the final result.
  • Structured output: pass any Standard Schema validator (Zod 3/4, Valibot, ArkType). Runcell validates the agent's submission, runs repair turns when the model misses, and fails the run when repairs do not help. Omit the schema for plain text turns.
  • Sandboxes: ephemeral by default. Or create a caller-owned handle: reuse it across runs, exec/read/write it directly, snapshot() it to JSON and restore it elsewhere. Runcell does not destroy caller-owned sandboxes.
  • Threads: conversation state represented by a readable message log and continuation data. Store toJSON() in your database and resume it on another sandbox or machine.
  • Files, tools, and events: seed files, retrieve changed files as bytes, expose host functions, receive lifecycle callbacks, and use extension hooks to block tool calls.
  • Local credentials: credentials: 'local' can use supported provider logins on a development machine. Provider terms govern subscription use. Production use requires explicit opt-in.
  • Shared credentials: credentials: { type: 'shared' } takes a lockable store for deployments that share refreshable credentials. The official Postgres implementation is @runcell/postgres-credentials.
  • Credential fallback: pass an array of sources. If a run fails with a credential error before any tool runs, runcell retries it on the next source.

Install

npm install runcell        # zod is optional and used for structured output

Quick start

import { createAgent, createVirtualSandbox, createThread } from 'runcell';

// Credentials default to environment variables; use 'local' on a dev machine.
const agent = createAgent({
  model: 'anthropic/claude-sonnet-4-5',
  credentials: 'local',
});

// The application owns and persists sandbox and thread state.
const sandbox = await createVirtualSandbox();
const thread = createThread();

await agent.run({ prompt: 'Scaffold a TypeScript project.', sandbox, thread });
await agent.run({ prompt: 'Now add tests.', sandbox, thread }); // same files, remembers

console.log(await sandbox.readTextFile('package.json'));
await db.save(thread.id, thread.toJSON());
await sandbox.destroy();

Sandbox modes

await agent.run({ prompt }); // virtual (bundled, default)
await agent.run({
  prompt,
  sandbox: { type: 'host', rootDir, isolation: 'external' },
});
await agent.run({ prompt, sandbox: { type: 'vercel', runtime: 'node24' } });
await agent.run({ prompt, sandbox: { type: 'custom', provider } });

host is for externally-isolated environments only (CI, containers, VMs). vercel requires Node.js 22+ and the optional @ai-sdk/sandbox-vercel peer dependency.

Models

model accepts an id, a display name, or a provider-qualified id when the same model exists under several providers:

createAgent({ model: 'anthropic/claude-sonnet-4-5' });
createAgent({ model: 'openai-codex/gpt-5.5' });

Documentation

Visit runcell.run for guides covering chat agents, sandboxes, threads, streaming, structured output, credentials, and the full API reference.