@deepseek-ai/dsh-e2b 0.1.2-rc.1 → 0.1.5-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +2 -2
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/lib/index.js +29 -1
- package/lib/types/api-url.d.ts +15 -0
- package/package.json +18 -14
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/e2b/e2b/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 09c23e4540b708ada5fc6d485806058793937a09
|
|
6
|
+
README.zh.md: 0e63443c1fb962895669649e52e3809b0e95397d
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
|
|
|
9
9
|
|
|
10
10
|
## Summary
|
|
11
11
|
|
|
12
|
-
`dsh-e2b`
|
|
12
|
+
`dsh-e2b` runs the agent's file operations, shell commands, and terminals in one shared remote Linux sandbox instead of on your machine. The sandbox is created at startup and deleted when its configured lifetime expires or the app shuts down, so everything it holds is ephemeral. Configure an API key, an absolute remote working directory, and the sandbox lifetime. Use it with `dsh-fs-e2b` and `dsh-subprocess-e2b`; by itself it adds no user-visible capability. It sends nothing to the model, and no shipped composition enables E2B by default.
|
|
13
13
|
|
|
14
14
|
## Table of Contents
|
|
15
15
|
|
package/README.zh.md
CHANGED
|
@@ -9,7 +9,7 @@ kind: "package-reference"
|
|
|
9
9
|
|
|
10
10
|
## 概述
|
|
11
11
|
|
|
12
|
-
`dsh-e2b`
|
|
12
|
+
`dsh-e2b` 让 agent(智能体)的文件操作、shell 命令与终端在一个共享的远程 Linux 沙箱内运行,而不是在你的机器上。应用启动时会创建沙箱,并在配置的生命周期到期或应用关闭时删除它,因此其中保存的一切都是短暂的。请配置 API 密钥、绝对远程工作目录与沙箱生命周期。请与 `dsh-fs-e2b`、`dsh-subprocess-e2b` 一起使用;单独使用它不会带来任何用户可见的能力。它不会向模型发送任何内容,而且任何已发布的组合都不会默认启用 E2B。
|
|
13
13
|
|
|
14
14
|
## 目录
|
|
15
15
|
|
package/lib/index.js
CHANGED
|
@@ -3,6 +3,32 @@ import { posix } from "node:path";
|
|
|
3
3
|
import { Service } from "@deepseek-ai/cordis";
|
|
4
4
|
import z from "@deepseek-ai/schemastery";
|
|
5
5
|
import { CommandExitError, FileNotFoundError, FileType, FileType as FileType$1, Sandbox, Sandbox as Sandbox$1, SandboxNotFoundError, SandboxNotFoundError as SandboxNotFoundError$1 } from "e2b";
|
|
6
|
+
import { proxyRouteFor } from "@deepseek-ai/dsh-http-proxy";
|
|
7
|
+
//#region lib/types/api-url.js
|
|
8
|
+
/**
|
|
9
|
+
* The E2B control-plane URL, derived the way the SDK derives it.
|
|
10
|
+
* @module @deepseek-ai/dsh-e2b/src/api-url.ts
|
|
11
|
+
*/
|
|
12
|
+
/** The SDK's own default control-plane domain; `E2B_DOMAIN` overrides it there and here alike. */
|
|
13
|
+
const E2B_DEFAULT_DOMAIN = "e2b.app";
|
|
14
|
+
/** The debug control plane the SDK substitutes, on loopback and plain HTTP. */
|
|
15
|
+
const E2B_DEBUG_API_URL = "http://localhost:3000";
|
|
16
|
+
/**
|
|
17
|
+
* The control-plane URL the SDK will actually call, derived the way the SDK derives it: an explicit
|
|
18
|
+
* `E2B_API_URL` first, then the debug substitute, then the domain default. Choosing a proxy for
|
|
19
|
+
* anything else would pick the wrong scheme's proxy, ignore a bypass entry naming the real host, and
|
|
20
|
+
* — for the loopback debug plane — hand a proxy the control-plane traffic and its API key.
|
|
21
|
+
*
|
|
22
|
+
* @param env - the process environment to read; overridable so tests need no ambient state.
|
|
23
|
+
* @returns the absolute control-plane URL.
|
|
24
|
+
*/
|
|
25
|
+
function e2bApiUrl(env = process.env) {
|
|
26
|
+
const explicit = env.E2B_API_URL;
|
|
27
|
+
if (explicit !== void 0 && explicit !== "") return explicit;
|
|
28
|
+
if ((env.E2B_DEBUG ?? "false").toLowerCase() === "true") return E2B_DEBUG_API_URL;
|
|
29
|
+
return `https://api.${env.E2B_DOMAIN ?? E2B_DEFAULT_DOMAIN}`;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
6
32
|
//#region lib/types/index.js
|
|
7
33
|
/**
|
|
8
34
|
* Shared ownership of one E2B sandbox. Capability adapters await the same SDK
|
|
@@ -92,11 +118,13 @@ var E2BRuntime = class extends Service {
|
|
|
92
118
|
if (!Number.isFinite(this.config.timeoutMs) || this.config.timeoutMs <= 0) throw new Error("dsh-e2b: timeoutMs must be a positive finite number");
|
|
93
119
|
}
|
|
94
120
|
async open() {
|
|
121
|
+
const route = proxyRouteFor(new URL(e2bApiUrl()));
|
|
95
122
|
const sandbox = await Sandbox$1.create({
|
|
96
123
|
apiKey: this.config.apiKey,
|
|
97
124
|
timeoutMs: this.config.timeoutMs,
|
|
98
125
|
secure: true,
|
|
99
|
-
lifecycle: { onTimeout: "kill" }
|
|
126
|
+
lifecycle: { onTimeout: "kill" },
|
|
127
|
+
...route.proxied ? { proxy: route.proxy } : {}
|
|
100
128
|
});
|
|
101
129
|
try {
|
|
102
130
|
await sandbox.files.makeDir(this.cwd);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The E2B control-plane URL, derived the way the SDK derives it.
|
|
3
|
+
* @module @deepseek-ai/dsh-e2b/src/api-url.ts
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The control-plane URL the SDK will actually call, derived the way the SDK derives it: an explicit
|
|
7
|
+
* `E2B_API_URL` first, then the debug substitute, then the domain default. Choosing a proxy for
|
|
8
|
+
* anything else would pick the wrong scheme's proxy, ignore a bypass entry naming the real host, and
|
|
9
|
+
* — for the loopback debug plane — hand a proxy the control-plane traffic and its API key.
|
|
10
|
+
*
|
|
11
|
+
* @param env - the process environment to read; overridable so tests need no ambient state.
|
|
12
|
+
* @returns the absolute control-plane URL.
|
|
13
|
+
*/
|
|
14
|
+
export declare function e2bApiUrl(env?: NodeJS.ProcessEnv): string;
|
|
15
|
+
//# sourceMappingURL=api-url.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-e2b",
|
|
3
3
|
"description": "Shared E2B sandbox lifecycle for DeepSeek Harness provider adapters",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.5-alpha.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"peerDependencies": {
|
|
30
|
+
"@deepseek-ai/dsh-http-proxy": "^0.1.5-alpha.1",
|
|
30
31
|
"@deepseek-ai/cordis": "^4.0.2"
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
@@ -34,19 +35,22 @@
|
|
|
34
35
|
"@deepseek-ai/schemastery": "^3.18.2"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
|
-
"@deepseek-ai/dsh-agent": "^0.1.2-rc.1",
|
|
38
|
-
"@deepseek-ai/dsh-app-boot": "^0.1.2-rc.1",
|
|
39
38
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
40
|
-
"@deepseek-ai/dsh-
|
|
41
|
-
"@deepseek-ai/dsh-
|
|
42
|
-
"@deepseek-ai/dsh-
|
|
43
|
-
"@deepseek-ai/dsh-
|
|
44
|
-
"@deepseek-ai/dsh-
|
|
45
|
-
"@deepseek-ai/dsh-
|
|
46
|
-
"@deepseek-ai/dsh-
|
|
47
|
-
"@deepseek-ai/dsh-
|
|
48
|
-
"@deepseek-ai/dsh-
|
|
49
|
-
"@deepseek-ai/dsh-
|
|
50
|
-
"@deepseek-ai/dsh-
|
|
39
|
+
"@deepseek-ai/dsh-agent": "^0.1.5-alpha.1",
|
|
40
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "^0.1.5-alpha.1",
|
|
41
|
+
"@deepseek-ai/dsh-app-boot": "^0.1.5-alpha.1",
|
|
42
|
+
"@deepseek-ai/dsh-bash-local": "^0.1.5-alpha.1",
|
|
43
|
+
"@deepseek-ai/dsh-fs-e2b": "^0.1.5-alpha.1",
|
|
44
|
+
"@deepseek-ai/dsh-loader-smoke": "^0.1.5-alpha.1",
|
|
45
|
+
"@deepseek-ai/dsh-lsp": "^0.1.5-alpha.1",
|
|
46
|
+
"@deepseek-ai/dsh-lsp-stdio": "^0.1.5-alpha.1",
|
|
47
|
+
"@deepseek-ai/dsh-sandbox-policy": "^0.1.5-alpha.1",
|
|
48
|
+
"@deepseek-ai/dsh-session": "^0.1.5-alpha.1",
|
|
49
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.5-alpha.1",
|
|
50
|
+
"@deepseek-ai/dsh-subprocess-e2b": "^0.1.5-alpha.1",
|
|
51
|
+
"@deepseek-ai/dsh-terminal": "^0.1.5-alpha.1",
|
|
52
|
+
"@deepseek-ai/dsh-terminal-bash": "^0.1.5-alpha.1",
|
|
53
|
+
"@deepseek-ai/dsh-http-proxy": "^0.1.5-alpha.1",
|
|
54
|
+
"@deepseek-ai/dsh-launch-environment": "^0.1.5-alpha.1"
|
|
51
55
|
}
|
|
52
56
|
}
|