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

@sandagent/sandbox-sandock

v0.9.15

Published

Sandock sandbox adapter for SandAgent

Downloads

5,382

Readme

@sandagent/sandbox-sandock

Sandock sandbox adapter for SandAgent. Runs AI agents in Sandock remote sandboxes (instead of locally or via E2B/Daytona), with persistent volumes, seed-file uploads, and fast-start images.

Prerequisites

Install

npm install @sandagent/sandbox-sandock

Quick Start

import { SandockSandbox } from "@sandagent/sandbox-sandock";

const sandbox = new SandockSandbox({
  apiKey: process.env.SANDOCK_API_KEY,
  workdir: "/workspace",
  image: "ghcr.io/vikadata/sandagent:latest",
  skipBootstrap: true,
});

Key Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | apiKey | string | SANDOCK_API_KEY | Sandock API key | | image | string | sandockai/sandock-code:latest | Container image | | workdir | string | /workspace | Working directory inside the sandbox | | templatesPath | string | - | Local directory of files to seed the workspace; contents are uploaded to workdir on attach (e.g. project skeleton, configs) | | volumes | { volumeName, volumeMountPath }[] | [] | Persistent volumes; created or reused by name | | skipBootstrap | boolean | false | If true, skip runner install; image must include runner | | env | Record<string, string> | {} | Environment variables injected into the sandbox | | timeout | number | 300000 | Operation timeout in milliseconds | | sandboxId | string | - | Existing sandbox ID to reattach to; falls back to creating new on failure | | name | string | - | Sandbox display name (e.g. for Sandock dashboard) | | keep | boolean | true | Keep sandbox running after execution |

Usage Patterns

1. Minimal (Pre-built Image)

new SandockSandbox({
  apiKey: process.env.SANDOCK_API_KEY,
  image: "ghcr.io/vikadata/sandagent:latest",
  skipBootstrap: true,
  workdir: "/workspace",
});

2. With Persistent Volumes

new SandockSandbox({
  apiKey: process.env.SANDOCK_API_KEY,
  image: "ghcr.io/vikadata/sandagent:latest",
  skipBootstrap: true,
  workdir: "/workspace",
  volumes: [
    { volumeName: "my-workspace", volumeMountPath: "/workspace" },
    { volumeName: "my-session", volumeMountPath: "/root/.claude" },
  ],
});

3. Reuse Existing Sandbox

Pass sandboxId to reattach to a previously created sandbox. The adapter will only reattach if the sandbox is currently in RUNNING state. If the sandbox is stopped, paused, or no longer exists, attach() falls back to creating a new one automatically.

const sandbox = new SandockSandbox({
  apiKey: process.env.SANDOCK_API_KEY,
  image: "ghcr.io/vikadata/sandagent:latest",
  skipBootstrap: true,
  workdir: "/workspace",
  sandboxId: "cached-sandbox-id", // from your cache
});

const handle = await sandbox.attach();
// Store handle.getSandboxId() for next request

Note: The adapter does not attempt to start a stopped sandbox. Only RUNNING sandboxes are reused. This avoids unexpected cold-start delays and ensures a consistent attach experience.

For web apps, cache the sandboxId server-side (e.g. in-memory Map with 30-min TTL) so subsequent requests reuse the same sandbox without client-side state. Use keep: true (the default) to keep sandboxes running between requests.

With @sandagent/sdk

import { createSandAgent } from "@sandagent/sdk";
import { SandockSandbox } from "@sandagent/sandbox-sandock";
import { generateText } from "ai";

const sandagent = createSandAgent({
  sandbox: new SandockSandbox({
    apiKey: process.env.SANDOCK_API_KEY,
    workdir: "/workspace",
    image: "ghcr.io/vikadata/sandagent:latest",
    skipBootstrap: true,
  }),
  env: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY! },
});

const { text } = await generateText({
  model: sandagent("sonnet"),
  prompt: "Create a hello world program",
});

Install: npm install @sandagent/sandbox-sandock @sandagent/sdk ai

API

SandockSandbox (Adapter)

  • attach() — Create or reuse a sandbox; returns a SandboxHandle
  • getHandle() — Returns the current handle if attached, otherwise null

SandboxHandle (returned by attach())

  • getSandboxId() — Returns the sandbox instance ID
  • getVolumes() — Returns mounted volume list (or null)
  • getWorkdir() — Returns the working directory
  • exec(command, opts) — Execute a command and stream output
  • upload(files, targetDir) — Upload files to the sandbox
  • readFile(filePath) — Read a file from the sandbox
  • destroy() — Stop and delete the sandbox

About skipBootstrap

  • skipBootstrap: true: Image already includes sandagent run; only upload seed files (from templatesPath), no runner install. Use with pre-built images like ghcr.io/vikadata/sandagent:latest.
  • skipBootstrap: false: On attach, runs npm install @sandagent/runner-cli@latest in workdir, then uses ${workdir}/node_modules/.bin/sandagent run for execution.

License

Apache-2.0