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

@dawn-ai/sandbox

v0.8.21

Published

<p align="center"> <img src="https://raw.githubusercontent.com/cacheplane/dawnai/main/docs/brand/dawn-logo-horizontal-black-on-white.png" alt="Dawn" width="180" /> </p>

Readme

@dawn-ai/sandbox

Reference sandbox providers for Dawn workspace execution. The main export is a Docker-backed SandboxProvider that redirects the workspace filesystem and shell tools into a per-thread isolated environment.

This is part of Dawn - the TypeScript meta-framework for LangGraph. Conceptual docs: Execution Sandbox, Workspace Filesystem, and Configuration.

Install

pnpm add @dawn-ai/sandbox
import { dockerSandbox, type DockerSandboxOptions } from "@dawn-ai/sandbox"
import { fakeSandbox, runProviderConformance } from "@dawn-ai/sandbox/testing"
import type { SandboxProvider } from "@dawn-ai/sandbox"

Configure Docker

Docker must be installed and the daemon must be reachable.

import { config } from "@dawn-ai/cli"
import { dockerSandbox } from "@dawn-ai/sandbox"

export default config({
  sandbox: {
    provider: dockerSandbox({ image: "node:22-slim" }),
    network: { mode: "allow", denylist: ["169.254.169.254"] },
    env: { NODE_ENV: "production" },
    resources: { memoryMb: 512, cpus: 1, timeoutMs: 120_000 },
    idleTimeoutMs: 600_000,
  },
})

When this config is present, Dawn acquires a sandbox per conversation thread and uses the returned workspaceRoot, filesystem backend, and exec backend for readFile, writeFile, listDir, runBash, and WorkspaceFs calls.

Public API

Main export

  • dockerSandbox(options) returns a SandboxProvider.
  • DockerSandboxOptions accepts an image and an optional injected Docker CLI adapter for tests.
  • SandboxConfig, SandboxHandle, SandboxPolicy, and SandboxProvider are re-exported from @dawn-ai/workspace for provider authors and config typing.

The Docker provider creates or reattaches a container named dawn-sbx-<threadId> and a volume named dawn-sbx-vol-<threadId>. The container runs with /workspace as its internal workspaceRoot.

Testing export

@dawn-ai/sandbox/testing exports:

  • fakeSandbox() - an in-memory SandboxProvider for deterministic unit tests and CI.
  • runProviderConformance({ name, makeProvider, describe }) - a shared Vitest conformance suite for custom sandbox providers.

Provider Contract

A custom provider implements the SandboxProvider interface from @dawn-ai/workspace:

import type { SandboxProvider } from "@dawn-ai/sandbox"

export const provider: SandboxProvider = {
  name: "custom",
  async acquire({ threadId, policy, signal }) {
    return {
      threadId,
      filesystem,
      exec,
      workspaceRoot: "/workspace",
    }
  },
  async release(threadId) {},
  async destroy(threadId) {},
  async preflight() {
    return { ok: true }
  },
}

acquire() is idempotent per thread. release() drops warm compute but keeps the volume. destroy() removes both compute and persisted workspace data.

Testing Notes

Use fakeSandbox() in ordinary app tests:

import { config } from "@dawn-ai/cli"
import { fakeSandbox } from "@dawn-ai/sandbox/testing"

export default config({
  sandbox: { provider: fakeSandbox() },
})

Use runProviderConformance() for a real provider implementation. The suite checks acquire idempotency, per-thread isolation, release-versus-destroy persistence, and numeric exec exit codes.

Limitations and Security

  • Docker network: { mode: "deny" } maps to --network none and provides zero egress for the reference provider.
  • Docker allow-mode denylists are best-effort. Use deny mode, a stricter provider, or an egress proxy for hostile workloads.
  • The host environment is never inherited; only sandbox.env is passed.
  • Docker is not a microVM boundary and does not protect against container escape vulnerabilities.
  • The sandbox controls where approved workspace operations run. It does not decide which tools exist or which permission prompts are approved.

License

MIT