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

@lwrf42/emerge-sandbox-harbor

v0.1.0

Published

Docker-container sandbox (HarborSandbox) providing strong isolation for the emerge agent harness.

Readme

@lwrf42/emerge-sandbox-harbor

Docker-backed Sandbox implementation for the emerge agent harness.

HarborSandbox routes process_spawn effects (shell commands) into isolated Docker containers while handling fs_read and fs_write effects on the host filesystem. This provides strong process isolation without requiring agent code changes.

v0.1.0 — early. Real-model verified against gpt-5.4 with python:3.12-slim containers. See VERIFICATION.md.

Install

npm install @lwrf42/emerge-sandbox-harbor

Usage

import { HarborSandbox } from "@lwrf42/emerge-sandbox-harbor";
import { makeBashTool, makeFsReadTool, makeFsWriteTool } from "@lwrf42/emerge-tools";

const sandbox = new HarborSandbox({
  workspaceDir: "/path/to/workspace",
  image: "python:3.12-slim",     // Docker image to use (default: ubuntu:22.04)
  networkMode: "none",            // "none" (default) or "bridge"
  memoryMB: 512,                  // container memory limit (default: 512)
  timeoutSeconds: 30,             // per-command timeout (default: 30)
});

// Use with @lwrf42/emerge-tools
kernel.getToolRegistry().register(makeBashTool(sandbox));
kernel.getToolRegistry().register(makeFsReadTool(sandbox));
kernel.getToolRegistry().register(makeFsWriteTool(sandbox));

Effect routing

| Effect | Handler | |--------|---------| | process_spawn | Runs command in Docker container with workspace bind-mounted to /workspace | | fs_read | Passes through to the run() callback (host filesystem access) | | fs_write | Passes through to the run() callback (host filesystem access) | | state_read | Passes through | | state_write | Passes through | | net_read / net_write | Denied unless networkMode: "bridge" is set |

Docker container configuration

Each process_spawn call starts a fresh container (docker run --rm):

docker run --rm
  --network=none           (or --network=bridge)
  --memory=512m
  -v /host/workspace:/workspace
  -w /workspace
  <image>
  bash -c "<command>"

The container exits after each command. For tasks with many bash calls, this means repeated cold-start overhead (~1–3 seconds per command on a warm image cache).

Constructor options

interface HarborSandboxOptions {
  /** Host directory to bind-mount at /workspace in the container. */
  workspaceDir: string;
  /** Docker image to use. Default: "ubuntu:22.04". */
  image?: string;
  /** Environment variable names to pass through from the host. Default: []. */
  envAllowlist?: string[];
  /** Container network mode. Default: "none". */
  networkMode?: "none" | "bridge" | "host";
  /** Memory limit in megabytes. Default: 512. */
  memoryMB?: number;
  /** Per-command timeout in seconds. Default: 30. */
  timeoutSeconds?: number;
  /** Optional PermissionPolicy for non-process effects. */
  policy?: PermissionPolicy;
}

Testability

buildDockerArgv(cmd: string): string[] is exported for unit testing the Docker argument construction without invoking docker. See src/index.test.ts.

const argv = sandbox.buildDockerArgv("echo hello");
// ["run", "--rm", "--network=none", "--memory=512m", "-v", "...", "-w", "/workspace", "ubuntu:22.04", "bash", "-c", "echo hello"]

Docker-requiring integration tests are gated on process.env.HAS_DOCKER === "1":

HAS_DOCKER=1 pnpm test --filter @lwrf42/emerge-sandbox-harbor

Requirements

  • Docker CLI must be on PATH (docker binary)
  • Docker daemon must be running
  • For macOS: Docker Desktop must be running
  • The workspace directory must be accessible to the Docker daemon (on macOS, ensure the directory is in Docker Desktop's file sharing settings)