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

ai-sdk-heyo-computer

v0.3.0

Published

Heyo sandbox provider for the Vercel AI SDK. Run agent-generated commands and code in isolated Heyo microVMs.

Readme

ai-sdk-heyo-computer

Run agent-generated commands and code in isolated Heyo microVM sandboxes, straight from the Vercel AI SDK (ai@7).

HeyoSandbox implements the AI SDK's Experimental_SandboxSession contract, so you can pass it to experimental_sandbox — or use the batteries-included tool set with any agent loop. It's a thin wrapper over the official @heyocomputer/sdk: pure HTTP, no binary, runs anywhere (including serverless).

Install

npm install ai-sdk-heyo-computer ai

ESM-only, Node ≥ 20. Set HEYO_API_KEY (from your Heyo dashboard); it's picked up automatically.

Quick start

import { generateText } from 'ai';
import { createHeyoSandbox, createHeyoTools } from 'ai-sdk-heyo-computer';

await using sandbox = await createHeyoSandbox({ image: 'ubuntu:24.04', ttlSeconds: 3600 });

const result = await generateText({
  model: 'anthropic/claude-sonnet-4-6',
  tools: createHeyoTools(sandbox),
  prompt: 'Write /workspace/app.py that prints the 50th prime, run it, and tell me the output.',
});

console.log(result.text);
// `await using` deletes the sandbox on scope exit (or call sandbox.delete()).

Tools

createHeyoTools(sandbox) returns an AI SDK ToolSet whose names mirror Anthropic's built-in tools, so models invoke them reliably:

| Tool | What it does | |------|--------------| | bash | Run a shell command; returns exitCode, stdout, stderr. | | str_replace_based_edit_tool | View / create / str_replace / insert files. | | exposePort | Bind a port and return a public URL. |

createHeyoTools(sandbox, {
  prefix: 'heyo',            // -> heyoBash, ... (leave unset to keep canonical names)
  include: ['bash'],         // only generate some tools
  commandTimeoutMs: 60_000,  // default timeout for bash
});

Pass directly to the AI SDK

HeyoSandbox satisfies Experimental_SandboxSession, so the SDK can drive it via experimental_sandbox:

const result = await generateText({
  model: 'anthropic/claude-sonnet-4-6',
  experimental_sandbox: sandbox,
  tools: { /* your tools call experimental_sandbox.run(...) / readTextFile / writeTextFile */ },
  prompt: '…',
});

Connecting

Every factory accepts the same connection options:

| Option | Default | Notes | |--------|---------|-------| | apiKey | process.env.HEYO_API_KEY | Sent as Authorization: Bearer. Omit for an unauthenticated local daemon. | | baseUrl | https://server.heyo.computer | Point at a self-hosted heyvm --api server to run anywhere. | | timeoutMs | 60000 | Per-request timeout. | | fetch | global fetch | Custom fetch implementation. | | webSocket | global WebSocket | For sandbox.shell() on Node < 22. |

The cloud and a local heyvm --api server speak the same HTTP API, so the entire surface works against either — just change baseUrl:

const sandbox = await createHeyoSandbox({
  baseUrl: 'http://localhost:3000', // self-hosted heyvm --api
  image: 'ubuntu:24.04',
});

Factories

import {
  createHeyoSandbox,      // create a fresh sandbox
  connectHeyoSandbox,     // attach to an existing one by id (lazy)
  getOrCreateHeyoSandbox, // durable workspace: reuse by name, else create
  listHeyoSandboxes,      // list deployed sandboxes
  listHeyoImages,         // discover public images
} from 'ai-sdk-heyo-computer';

// Durable workspace reused across processes (same name ⇒ same sandbox):
const sandbox = await getOrCreateHeyoSandbox({ name: 'agent-workspace', image: 'ubuntu:24.04' });

Sandbox API

HeyoSandbox covers the AI SDK contract plus the full sandbox lifecycle:

  • Commands: run(opts), exec(opts) (adds timeoutMs), spawn(opts), shell(opts) (interactive PTY)
  • Files: readTextFile / readBinaryFile / readFile, writeTextFile / writeBinaryFile / writeFile
  • Networking: exposePort(port, { private }), getHost(port)
  • Lifecycle: stop, start, restart, delete, setTimeout(ttl), resize(size), checkpoint, restore
  • Info: info, getInfo() / refresh(), waitForReady(ms)
  • Images/mounts: snapshotToImage(name), replaceMount(archiveId, path)
  • Escape hatch: sandbox.raw — the underlying @heyocomputer/sdk Sandbox

Files default to the /workspace mount; pass mountPath on a file call or createHeyoSandbox({ mountPath }) to change it.

Best-of-N

import { createHeyoSandboxPool, createHeyoTools } from 'ai-sdk-heyo-computer';
import { generateText, stepCountIs } from 'ai';

await using pool = await createHeyoSandboxPool({ size: 3, image: 'ubuntu:24.04' });

const { result, index } = await pool.best(
  (sandbox) =>
    generateText({ model: 'anthropic/claude-sonnet-4-6', tools: createHeyoTools(sandbox), stopWhen: stepCountIs(8), prompt: task }),
  (candidate) => score(candidate),
);

Examples

See examples/: basic.ts, tools.ts, cloud.ts (self-hosted), pool.ts, harness-agent.ts.

License

MIT