@agentproto/sandbox-box

中文文档
0.2.40发布于 2026/11/06Apache-2.0TypeScriptES Module构建来源已验证近 30 天下载 5337

@agentproto/sandbox-box — ascii.dev Box SandboxProvider for @agentproto/sandbox. Boots a Box cloud computer, installs an always-on systemd unit for the agentproto daemon, and exposes its MCP endpoint as a URL so any AgentSessionHost consumer (worktreeAg

原始使用文档
文档目录3 节
  1. Usage
  2. Notes
  3. License

@agentproto/sandbox-box

ascii.dev Box SandboxProvider for @agentproto/sandbox. Boots a Box cloud computer, installs an always-on systemd unit for the agentproto daemon, and exposes its MCP endpoint as a URL — so createSandboxAgentSessionHost can hand it straight to connectDaemonAgentSessionHost (@agentproto/worktree) and run any AgentStep inside the sandbox, unchanged.

Usage

import { createSandboxAgentSessionHost } from "@agentproto/sandbox"
import { boxSandboxProvider } from "@agentproto/sandbox-box"
import { runWorkflow } from "@agentproto/workflow-runtime"
import { worktreeAgentWorkflow } from "@agentproto/worktree"

const host = await createSandboxAgentSessionHost({
  provider: boxSandboxProvider,
  spec: { provider: "box", config: {} },
  secrets: { slugs: ["OPENROUTER_API_KEY"] },
})
try {
  await runWorkflow({ workflow: worktreeAgentWorkflow, input, agents: host })
} finally {
  await host.stop()
}

Requires BOX_API_KEY in the host process's environment.

Notes

  • Box's host <port> CLI exposes a port at https://<box-subdomain>-<port>.on.ascii.dev; re-running it for the same box+port returns the same URL, so this provider computes the hostname directly from Box.subdomain (assigned once, persists across stop/resume/fork) rather than parsing command output.
  • Box's command API (POST /boxes/{id}/commands) is synchronous-only — no background flag like e2b's. A bare &-backgrounded process would die with the command's process group, so the daemon is installed as a systemd unit (Restart=always) instead: systemctl enable --now hands it to PID 1, which survives box stop (filesystem snapshot) + box resume — cleaner than e2b, which has to re-issue its serve command after every resume.
  • systemd services don't inherit the invoking shell's environment, so secrets resolved into the sandbox env (e.g. OPENROUTER_API_KEY) are written to an EnvironmentFile (/etc/agentproto/agentproto.env, 0600) the unit references.
  • Box's own default TTL is 3600s (1 hour) auto-stop. This provider disables it by default (ttlSeconds: null, same lesson as e2b's DEFAULT_SANDBOX_TIMEOUT_MS) — set config.ttlSeconds to override.

License

Apache-2.0 — see LICENSE.

版本与发布记录

@agentproto/sandbox-box 共发布 38 个版本,首次发布于 2026/07/27;过去 12 个月发布了 38 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.2.40latest2026/11/06今天
0.2.392026/11/042 天前
0.2.382026/11/014 天前
0.2.372026/10/279 天前
0.2.362026/10/2314 天前
0.2.352026/10/2017 天前

关于 @agentproto/sandbox-box 的常见问题

@agentproto/sandbox-box 是什么?

@agentproto/sandbox-box — ascii.dev Box SandboxProvider for @agentproto/sandbox. Boots a Box cloud computer, installs an always-on systemd unit for the agentproto daemon, and exposes its MCP endpoint as a URL so any AgentSessionHost consumer (worktreeAg

如何安装 @agentproto/sandbox-box?

在项目目录运行 npm install @agentproto/sandbox-box,或使用 pnpm add / yarn add / bun add。

@agentproto/sandbox-box 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@agentproto/sandbox-box 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@agentproto/sandbox-box 可以商用吗?

@agentproto/sandbox-box 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@agentproto/sandbox-box 的下载量有多少?

根据 npm 官方下载统计,@agentproto/sandbox-box 在 2026/10/05 – 2026/11/03 这 30 天内被下载 5,337 次,日均约 178 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@agentproto/sandbox-box 还在维护吗?

最新版本 0.2.40 发布于 2026/11/06(今天);至今共发布 38 个版本,其中过去 12 个月发布了 38 个;首次发布于 2026/07/27。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。