@gea-ai/computer-e2b

中文文档
0.1.261111-alpha.1发布于 2026/11/12Apache-2.0TypeScriptES Module近 30 天下载 3682

E2B Computer declaration for the GEA Worker native binding

此软件包已被标记为弃用

This package is deprecated and will no longer receive updates.

原始使用文档

GEA E2B Computer

The factory selects E2B in developer code. The existing Worker COMPUTER native binding connects directly to E2B's API and envd. No additional GEA service or Pod is needed; API keys and envd credentials remain outside Agent JavaScript.

import { defineAgent } from "@gea-ai/agent-sdk";
import { secret } from "@gea-ai/agent-sdk/computer";
import { e2b } from "@gea-ai/computer-e2b";

export default defineAgent({
  name: "E2B Agent",
  slug: "e2b-agent",
  model: "gea-model-1",
  computer: e2b({
    apiKey: secret("E2B_API_KEY"),
    template: "base",
    timeoutMs: 300_000,
    filesystem: { durability: "ephemeral", files: { "hello.txt": "Hello" } },
    async onSession({ use }) {
      const computer = await use();
      const result = await computer.exec({ command: "python --version" });
      if (result.exitCode !== 0) throw new Error("Python is required");
    },
  }),
});

Set the referenced environment secret in Studio or the local CLI environment. Do not additionally declare that secret in Agent environment unless Agent code itself needs it. The package contains the declaration; the native implementation ships with Worker Runtime, and there is no /host entrypoint.

Each invocation gets an ephemeral sandbox. Seeds and read-only Skills precede onSession. Closing the invocation releases the sandbox; the configured E2B lifetime bounds cleanup after a crash or network failure. Files do not survive invocations, Worker restarts or sandbox expiry. Use Artifacts for retained files. Unknown creation or mutation outcomes are never replayed within an invocation.

The template needs Linux bash, Python 3, coreutils timeout, useradd, and an unprivileged gea-agent user without passwordless sudo. Skills are root-owned. Commands have a 120-second deadline and 2 MiB output limit; cancellation terminates the process group, including descendants. The base template is tested.

The public stream/binary/text and directory methods use the same filesystem as commands. Buffered reads are limited to 16 MiB. Stream writes use four bounded upload slots and at most 10 GiB per file, staging on Worker disk before an envd upload and atomic publication inside the sandbox. No partial destination is published on a failed source. Private staging and destinations must share the same sandbox filesystem; parent resolution rejects symlinks.

Artifact copies use the existing single-file ticket and 8 MiB multipart protocol. Object-store URLs remain native. Downloads are measured and hashed on Worker disk before publication to E2B; uploads read envd streams and check source identity before completing the Artifact. No independent transfer service or directory synchronization is introduced.

From this repository, set E2B_API_KEY in the test process and run:

pnpm --dir packages/computer-e2b test:live

This opt-in test creates a paid sandbox and verifies creation, seeds, 20 MiB binary I/O, read-only Skills, mutation receipts, descendant cancellation and confirmed deletion. It is excluded from the default test suite. Other templates, npm publication and production deployment remain separate verification steps.

See E2B lifecycle documentation and the public Agent development guide.

版本与发布记录

@gea-ai/computer-e2b 共发布 73 个版本,首次发布于 2026/09/08;过去 12 个月发布了 73 个版本。

版本发布日期距今
0.1.261111-alpha.1latest2026/11/123 天前
0.1.261111-alpha.02026/11/124 天前
0.1.261106-alpha.02026/11/069 天前
0.1.261102-alpha.22026/11/0213 天前
0.1.261102-alpha.12026/11/0213 天前
0.1.261102-alpha.02026/11/0213 天前

关于 @gea-ai/computer-e2b 的常见问题

@gea-ai/computer-e2b 是什么?

E2B Computer declaration for the GEA Worker native binding注意:该包已被作者标记为弃用——This package is deprecated and will no longer receive updates.

如何安装 @gea-ai/computer-e2b?

在项目目录运行 npm install @gea-ai/computer-e2b,或使用 pnpm add / yarn add / bun add。

@gea-ai/computer-e2b 支持 TypeScript 吗?

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

@gea-ai/computer-e2b 支持 ESM 还是 CommonJS?

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

@gea-ai/computer-e2b 可以商用吗?

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

@gea-ai/computer-e2b 的下载量有多少?

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

@gea-ai/computer-e2b 还在维护吗?

最新版本 0.1.261111-alpha.1 发布于 2026/11/12(3 天前);至今共发布 73 个版本,其中过去 12 个月发布了 73 个;首次发布于 2026/09/08。作者已将其标记为弃用,新项目建议寻找替代方案。