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

@lite-agent/sandbox-anthropic

v0.8.0

Published

OS-level Sandbox adapter for @lite-agent/core over @anthropic-ai/sandbox-runtime (Seatbelt / bubblewrap).

Readme

@lite-agent/sandbox-anthropic

English | 简体中文

面向 @lite-agent/core 的操作系统级 Sandbox 适配器,底层基于 @anthropic-ai/sandbox-runtime(macOS Seatbelt / Linux bubblewrap)。

Sandbox 会改写一条 shell 命令,使其在受限的文件系统与网络访问的操作系统边界内运行。core 的 bash 工具在执行前会把命令通过 ctx.sandbox 包裹 —— 因此与权限门(执行前的决策)结合,就形成纵深防御:沙箱负责「关住」权限门放行的内容。

安装

pnpm add @lite-agent/sandbox-anthropic

用法

把沙箱传给 createLiteAgent / query

import { createLiteAgent } from "@lite-agent/sdk";
import { anthropic } from "@lite-agent/provider";
import { sandboxRuntime } from "@lite-agent/sandbox-anthropic";

const agent = createLiteAgent({
  model: anthropic(),
  modelName: "claude-sonnet-4-6",
  workdir: process.cwd(),
  sandbox: sandboxRuntime({
    allowWrite: ["."],                 // 可写路径(默认:cwd)
    denyRead: ["~/.ssh", "~/.aws"],    // 禁止读取的路径(默认如所示)
    allowedDomains: ["api.github.com"],// 网络白名单(默认:空)
    onUnavailable: (err) => console.warn(`[sandbox] 已降级为 noop:${err.message}`),
  }),
});

优雅降级

如果操作系统沙箱无法初始化(没有 bubblewrap、原生 Windows、不受支持的环境),sandboxRuntime降级为 no-op —— 命令原样运行,且 onUnavailable(err) 触发一次。设置 requireSandbox: true 可让其在此时直接抛错而非降级。

选项

sandboxRuntime(opts)Sandbox

| 选项 | 默认值 | 说明 | | --- | --- | --- | | allowWrite | ["."] | 命令可写的文件系统路径。 | | allowRead | [] | 在已禁止读取的区域内重新放行的路径。 | | denyRead | ["~/.ssh", "~/.aws"] | 禁止读取的路径。 | | denyWrite | [] | 额外禁止写入的路径。 | | allowedDomains | [] | 允许访问的网络域名。 | | deniedDomains | [] | 禁止访问的网络域名。 | | allowLocalBinding | false | 是否允许沙箱命令监听本地端口。 | | requireSandbox | false | false → 初始化失败时降级为 noop;true → 抛错。 | | onUnavailable | —— | 降级为 noop 时触发一次。 |

若完全不需要边界,core 提供了 noopSandbox()(未设置 sandbox 时的默认值)。

架构说明见 monorepo 根目录