@runko/sandbox-e2b 0.1.1 → 0.1.3

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/dist/index.cjs CHANGED
@@ -3,7 +3,7 @@ let _runko_virtual_fs = require("@runko/virtual-fs");
3
3
  let _runko_core = require("@runko/core");
4
4
  //#region src/errors.ts
5
5
  /**
6
- * e2b 错误的结构判别(docs/tech/sandbox.md §8.1:"错误识别一律结构判别不用 instanceof"——
6
+ * e2b 错误的结构判别(docs/host/contract/tech/sandbox.md §8.1:"错误识别一律结构判别不用 instanceof"——
7
7
  * 宿主与本包各自安装的 `e2b` 副本类不同一,`instanceof` 天然不可靠)。
8
8
  * `instanceof Error` 本身没问题(`Error` 是当前 realm 的全局内置类,不是
9
9
  * e2b 的导出类),只有对 e2b 自家导出的错误类才不能用 instanceof。
@@ -81,7 +81,7 @@ function createE2bExec(sandbox, anchor, keepAlive) {
81
81
  const timer = req.timeoutMs !== void 0 ? setTimeout(() => timeoutController.abort(), req.timeoutMs) : void 0;
82
82
  const combined = AbortSignal.any([req.signal, timeoutController.signal]);
83
83
  /**
84
- * [保活](../../../docs/terms.md)的第二个信号源(docs/tech/sandbox-keepalive.md §3.1):
84
+ * [保活](../../../docs/terms.md)的第二个信号源(docs/logic/orchestration/tech/sandbox-keepalive.md §3.1):
85
85
  * 命令跑起来之后 core **一个 chunk 都不会产出**——`@runko/core` 的 `loop.ts`
86
86
  * 把工具进度先缓冲、等命令 resolve 之后才重放。所以一条跑十分钟的命令,这十分钟
87
87
  * 里 core 侧的活动信号是零。而这恰恰是最容易把沙盒跑没的场景。
@@ -156,7 +156,7 @@ function createE2bExec(sandbox, anchor, keepAlive) {
156
156
  const NOT_FOUND_NAMES = ["FileNotFoundError", "NotFoundError"];
157
157
  /** `list(root, { depth })` 用于 glob 的递归深度——远超"典型工作区目录嵌套层数"的量级,避免深层子目录被漏扫。 */
158
158
  const GLOB_LIST_DEPTH = 64;
159
- /** `EntryInfo.type` 非 `"file"` 一律视为目录(docs/tech/sandbox.md §8.2:"FileType 非 file 视为 dir");`size` 只在文件类型下有意义,仿 MemoryFS 用条件展开省略而非填 0/undefined。 */
159
+ /** `EntryInfo.type` 非 `"file"` 一律视为目录(docs/host/contract/tech/sandbox.md §8.2:"FileType 非 file 视为 dir");`size` 只在文件类型下有意义,仿 MemoryFS 用条件展开省略而非填 0/undefined。 */
160
160
  function toFileStat(entry) {
161
161
  const type = entry.type === "file" ? "file" : "dir";
162
162
  const mtime = entry.modifiedTime?.getTime();
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { KeepAliveOptions, RunkoActivityAware, RunkoExec, RunkoFS, RunkoKeepAliveCapable } from "@runko/core";
2
2
  //#region src/types.d.ts
3
3
  /**
4
- * `e2b` SDK 面的最小结构化子集(docs/tech/core-sdk.md §4.5a 施工依据 docs/tech/sandbox.md §8.1
4
+ * `e2b` SDK 面的最小结构化子集(docs/logic/engine/tech/core-sdk.md §4.5a 施工依据 docs/host/contract/tech/sandbox.md §8.1
5
5
  * "依赖策略"):只声明适配器实际调用到的方法/字段,以官方 d.ts
6
6
  * (`e2b@2.32.0`,`node_modules/e2b/dist/index.d.ts`)为蓝本手写。`e2bWorkspace()`
7
7
  * 收的是这份结构接口而非 `import("e2b").Sandbox` 具体类——宿主与本包各自安装的
@@ -74,7 +74,7 @@ interface E2bSandboxLike {
74
74
  commands: E2bCommandsLike;
75
75
  /**
76
76
  * 把沙盒的存活时长**重置**为「从现在起 `timeoutMs`」(不是加时——E2B 与 Vercel
77
- * 在这里语义相反,见 docs/tech/sandbox-keepalive.md §1)。
77
+ * 在这里语义相反,见 docs/logic/orchestration/tech/sandbox-keepalive.md §1)。
78
78
  *
79
79
  * 上限:Pro 账户 24 小时、Hobby 账户 1 小时(`e2b@2.32.0` 的 `Sandbox.setTimeout`
80
80
  * 文档注释),超了会报错。
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { KeepAliveOptions, RunkoActivityAware, RunkoExec, RunkoFS, RunkoKeepAliveCapable } from "@runko/core";
2
2
  //#region src/types.d.ts
3
3
  /**
4
- * `e2b` SDK 面的最小结构化子集(docs/tech/core-sdk.md §4.5a 施工依据 docs/tech/sandbox.md §8.1
4
+ * `e2b` SDK 面的最小结构化子集(docs/logic/engine/tech/core-sdk.md §4.5a 施工依据 docs/host/contract/tech/sandbox.md §8.1
5
5
  * "依赖策略"):只声明适配器实际调用到的方法/字段,以官方 d.ts
6
6
  * (`e2b@2.32.0`,`node_modules/e2b/dist/index.d.ts`)为蓝本手写。`e2bWorkspace()`
7
7
  * 收的是这份结构接口而非 `import("e2b").Sandbox` 具体类——宿主与本包各自安装的
@@ -74,7 +74,7 @@ interface E2bSandboxLike {
74
74
  commands: E2bCommandsLike;
75
75
  /**
76
76
  * 把沙盒的存活时长**重置**为「从现在起 `timeoutMs`」(不是加时——E2B 与 Vercel
77
- * 在这里语义相反,见 docs/tech/sandbox-keepalive.md §1)。
77
+ * 在这里语义相反,见 docs/logic/orchestration/tech/sandbox-keepalive.md §1)。
78
78
  *
79
79
  * 上限:Pro 账户 24 小时、Hobby 账户 1 小时(`e2b@2.32.0` 的 `Sandbox.setTimeout`
80
80
  * 文档注释),超了会报错。
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { DirectoryNotEmptyError, NotFoundError, matchesGlob, normalizePath } fro
2
2
  import { createKeepAlive } from "@runko/core";
3
3
  //#region src/errors.ts
4
4
  /**
5
- * e2b 错误的结构判别(docs/tech/sandbox.md §8.1:"错误识别一律结构判别不用 instanceof"——
5
+ * e2b 错误的结构判别(docs/host/contract/tech/sandbox.md §8.1:"错误识别一律结构判别不用 instanceof"——
6
6
  * 宿主与本包各自安装的 `e2b` 副本类不同一,`instanceof` 天然不可靠)。
7
7
  * `instanceof Error` 本身没问题(`Error` 是当前 realm 的全局内置类,不是
8
8
  * e2b 的导出类),只有对 e2b 自家导出的错误类才不能用 instanceof。
@@ -80,7 +80,7 @@ function createE2bExec(sandbox, anchor, keepAlive) {
80
80
  const timer = req.timeoutMs !== void 0 ? setTimeout(() => timeoutController.abort(), req.timeoutMs) : void 0;
81
81
  const combined = AbortSignal.any([req.signal, timeoutController.signal]);
82
82
  /**
83
- * [保活](../../../docs/terms.md)的第二个信号源(docs/tech/sandbox-keepalive.md §3.1):
83
+ * [保活](../../../docs/terms.md)的第二个信号源(docs/logic/orchestration/tech/sandbox-keepalive.md §3.1):
84
84
  * 命令跑起来之后 core **一个 chunk 都不会产出**——`@runko/core` 的 `loop.ts`
85
85
  * 把工具进度先缓冲、等命令 resolve 之后才重放。所以一条跑十分钟的命令,这十分钟
86
86
  * 里 core 侧的活动信号是零。而这恰恰是最容易把沙盒跑没的场景。
@@ -155,7 +155,7 @@ function createE2bExec(sandbox, anchor, keepAlive) {
155
155
  const NOT_FOUND_NAMES = ["FileNotFoundError", "NotFoundError"];
156
156
  /** `list(root, { depth })` 用于 glob 的递归深度——远超"典型工作区目录嵌套层数"的量级,避免深层子目录被漏扫。 */
157
157
  const GLOB_LIST_DEPTH = 64;
158
- /** `EntryInfo.type` 非 `"file"` 一律视为目录(docs/tech/sandbox.md §8.2:"FileType 非 file 视为 dir");`size` 只在文件类型下有意义,仿 MemoryFS 用条件展开省略而非填 0/undefined。 */
158
+ /** `EntryInfo.type` 非 `"file"` 一律视为目录(docs/host/contract/tech/sandbox.md §8.2:"FileType 非 file 视为 dir");`size` 只在文件类型下有意义,仿 MemoryFS 用条件展开省略而非填 0/undefined。 */
159
159
  function toFileStat(entry) {
160
160
  const type = entry.type === "file" ? "file" : "dir";
161
161
  const mtime = entry.modifiedTime?.getTime();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runko/sandbox-e2b",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "RunkoFS & RunkoExec 同源工作区:适配 E2B 云沙盒(e2b SDK 仅类型依赖,BYO sandbox 实例)",
5
5
  "type": "module",
6
6
  "license": "ISC",
@@ -35,23 +35,23 @@
35
35
  "files": [
36
36
  "dist"
37
37
  ],
38
+ "dependencies": {
39
+ "@runko/core": "^0.2.0",
40
+ "@runko/virtual-fs": "^0.1.3"
41
+ },
42
+ "devDependencies": {
43
+ "@types/node": "^24.13.3",
44
+ "ai": "^7.0.20",
45
+ "e2b": "^2.32.0",
46
+ "tsdown": "^0.22.4",
47
+ "typescript": "^7.0.2",
48
+ "vitest": "^4.1.10"
49
+ },
38
50
  "scripts": {
39
51
  "build": "tsdown",
40
52
  "typecheck": "tsc --noEmit",
41
53
  "lint": "eslint . --report-unused-disable-directives --max-warnings 0",
42
54
  "lint:fix": "eslint . --fix",
43
55
  "test": "vitest run"
44
- },
45
- "dependencies": {
46
- "@runko/core": "^0.1.1",
47
- "@runko/virtual-fs": "^0.1.1"
48
- },
49
- "devDependencies": {
50
- "@types/node": "catalog:",
51
- "ai": "catalog:",
52
- "e2b": "catalog:",
53
- "tsdown": "catalog:",
54
- "typescript": "catalog:",
55
- "vitest": "catalog:"
56
56
  }
57
- }
57
+ }