@deepseek-ai/dsh-bash-sandbox 0.1.2-alpha.5 → 0.1.3-alpha.2
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 +2 -2
- package/README.zh.md +2 -2
- package/lib/index.js +8 -7
- package/lib/types/index.d.ts +6 -5
- package/package.json +12 -12
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/shell/bash-sandbox/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 6d0e6aab3cd501c42be83e6da7a15ba0984fc114
|
|
6
|
+
README.zh.md: 086fee202bdea39d3d80b6322ff1c0484b5d1ab9
|
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ A denied command is reported, not retried silently: the result carries `sandbox:
|
|
|
61
61
|
|
|
62
62
|
### Failures and recovery
|
|
63
63
|
|
|
64
|
-
If no runner can enforce a confined mode, the foreground call fails with `SANDBOX_UNAVAILABLE` and a background process records a runner-failure fact — never a silent unconfined run. A
|
|
64
|
+
If no runner can enforce a confined mode, the foreground call fails with `SANDBOX_UNAVAILABLE` and a background process records a runner-failure fact — never a silent unconfined run. A provider rejection is attributed to the confinement runner only when its `ENOENT`/`EACCES` path or syscall independently names `argv[0]`; otherwise it keeps the local executor's stage-neutral provider-failure semantics.
|
|
65
65
|
|
|
66
66
|
-----
|
|
67
67
|
|
|
@@ -151,7 +151,7 @@ Append-only; newly visible content follows the reusable request prefix and does
|
|
|
151
151
|
|
|
152
152
|
#### What the model sees
|
|
153
153
|
|
|
154
|
-
If no runner can enforce a confined mode, the foreground call propagates the `SANDBOX_UNAVAILABLE` error from the sandbox seam. A
|
|
154
|
+
If no runner can enforce a confined mode, the foreground call propagates the `SANDBOX_UNAVAILABLE` error from the sandbox seam. A provider rejection with `ENOENT`/`EACCES` path or syscall evidence that names `argv[0]` supplies the original error as runner-failure detail; another rejection remains a stage-neutral provider error. A settled runner failure supplies the matched fatal stderr line and preserves the original stderr collection; the appended `Runner failure: <detail>` is the authoritative diagnosis over the generic `SANDBOX_UNAVAILABLE` prefix.
|
|
155
155
|
|
|
156
156
|
#### Token effect
|
|
157
157
|
|
package/README.zh.md
CHANGED
|
@@ -61,7 +61,7 @@ kind: "package-reference"
|
|
|
61
61
|
|
|
62
62
|
### 失败与恢复
|
|
63
63
|
|
|
64
|
-
如果没有 runner 能强制执行受限模式,前台调用以 `SANDBOX_UNAVAILABLE` 失败,后台进程则记录 runner
|
|
64
|
+
如果没有 runner 能强制执行受限模式,前台调用以 `SANDBOX_UNAVAILABLE` 失败,后台进程则记录 runner 失败事实——绝不会静默无隔离运行。只有当 provider rejection 的 `ENOENT`/`EACCES` 路径或 syscall 独立指向 `argv[0]` 时,才把它归因于 confinement runner;其他 rejection 保持本地执行器不声明阶段的 provider-failure 语义。
|
|
65
65
|
|
|
66
66
|
-----
|
|
67
67
|
|
|
@@ -151,7 +151,7 @@ kind: "package-reference"
|
|
|
151
151
|
|
|
152
152
|
#### 模型看到的内容
|
|
153
153
|
|
|
154
|
-
如果没有 runner 能强制执行受限模式,前台调用会传播来自 sandbox seam 的 `SANDBOX_UNAVAILABLE`
|
|
154
|
+
如果没有 runner 能强制执行受限模式,前台调用会传播来自 sandbox seam 的 `SANDBOX_UNAVAILABLE` 错误。带有 `ENOENT`/`EACCES` 路径或 syscall 证据并指向 `argv[0]` 的 provider rejection 会把原始错误作为 runner-failure 详情;其他 rejection 保持不声明阶段的 provider error。已结算的 runner 失败以匹配到的致命 stderr 行作为详情,并保留原始 stderr 收集结果;追加的 `Runner failure: <detail>` 是权威诊断,优先于通用的 `SANDBOX_UNAVAILABLE` 前缀。
|
|
155
155
|
|
|
156
156
|
#### Token 影响
|
|
157
157
|
|
package/lib/index.js
CHANGED
|
@@ -94,10 +94,11 @@ function matchesSignature(exitCode, stderr, signatures) {
|
|
|
94
94
|
/**
|
|
95
95
|
* Sandbox-consuming bash executor. It wraps the exact local bash argv through
|
|
96
96
|
* `ctx.sandbox`, inherits local process mechanics, and reports the selected
|
|
97
|
-
* mode, enforcement, and denial facts. Positive runner-
|
|
98
|
-
*
|
|
99
|
-
* background processes carry `runnerFailed`;
|
|
100
|
-
* local-executor semantics. The
|
|
97
|
+
* mode, enforcement, and denial facts. Positive runner-executable evidence
|
|
98
|
+
* identifies a broken confinement runner: foreground calls throw
|
|
99
|
+
* `SANDBOX_UNAVAILABLE`, while background processes carry `runnerFailed`;
|
|
100
|
+
* other provider rejections retain stage-neutral local-executor semantics. The
|
|
101
|
+
* tool owns approval and passes a complete per-call policy.
|
|
101
102
|
* @module @deepseek-ai/dsh-bash-sandbox
|
|
102
103
|
*/
|
|
103
104
|
/**
|
|
@@ -203,11 +204,11 @@ var SandboxBashExecutor = class extends LocalBashExecutor {
|
|
|
203
204
|
* Stamp per-process sandbox facts before `done` settles. Full-access processes
|
|
204
205
|
* have no facts; signal deaths are not denials.
|
|
205
206
|
*/
|
|
206
|
-
onProcessDone(proc, stderr,
|
|
207
|
+
onProcessDone(proc, stderr, providerRejected, providerError) {
|
|
207
208
|
const facts = this.processFacts.get(proc);
|
|
208
209
|
if (facts !== void 0) {
|
|
209
210
|
this.processFacts.delete(proc);
|
|
210
|
-
const runnerFailed =
|
|
211
|
+
const runnerFailed = providerRejected ? isRunnerSpawnFailure(providerError, facts.runnerProgram, facts.workdir) : classifyRunnerFailure(proc.exitCode, stderr, facts.runnerFailureRules) !== void 0;
|
|
211
212
|
proc.sandbox = {
|
|
212
213
|
mode: facts.mode,
|
|
213
214
|
denied: !runnerFailed && matchesSignature(proc.exitCode, stderr, facts.denialSignatures),
|
|
@@ -215,7 +216,7 @@ var SandboxBashExecutor = class extends LocalBashExecutor {
|
|
|
215
216
|
...runnerFailed ? { runnerFailed } : {}
|
|
216
217
|
};
|
|
217
218
|
}
|
|
218
|
-
super.onProcessDone(proc, stderr,
|
|
219
|
+
super.onProcessDone(proc, stderr, providerRejected, providerError);
|
|
219
220
|
}
|
|
220
221
|
/**
|
|
221
222
|
* Wrap one shell command via the `ctx.sandbox` provider. Provider errors
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Sandbox-consuming bash executor. It wraps the exact local bash argv through
|
|
3
3
|
* `ctx.sandbox`, inherits local process mechanics, and reports the selected
|
|
4
|
-
* mode, enforcement, and denial facts. Positive runner-
|
|
5
|
-
*
|
|
6
|
-
* background processes carry `runnerFailed`;
|
|
7
|
-
* local-executor semantics. The
|
|
4
|
+
* mode, enforcement, and denial facts. Positive runner-executable evidence
|
|
5
|
+
* identifies a broken confinement runner: foreground calls throw
|
|
6
|
+
* `SANDBOX_UNAVAILABLE`, while background processes carry `runnerFailed`;
|
|
7
|
+
* other provider rejections retain stage-neutral local-executor semantics. The
|
|
8
|
+
* tool owns approval and passes a complete per-call policy.
|
|
8
9
|
* @module @deepseek-ai/dsh-bash-sandbox
|
|
9
10
|
*/
|
|
10
11
|
import { Context } from '@deepseek-ai/cordis';
|
|
@@ -52,7 +53,7 @@ export declare class SandboxBashExecutor extends LocalBashExecutor {
|
|
|
52
53
|
* Stamp per-process sandbox facts before `done` settles. Full-access processes
|
|
53
54
|
* have no facts; signal deaths are not denials.
|
|
54
55
|
*/
|
|
55
|
-
protected onProcessDone(proc: ShellProcess, stderr: string,
|
|
56
|
+
protected onProcessDone(proc: ShellProcess, stderr: string, providerRejected: boolean, providerError?: unknown): void;
|
|
56
57
|
/**
|
|
57
58
|
* Wrap one shell command via the `ctx.sandbox` provider. Provider errors
|
|
58
59
|
* propagate unchanged; the returned argv is handed directly to the local
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-bash-sandbox",
|
|
3
3
|
"description": "Sandbox-consuming implementation of the DeepSeek Harness bash executor seam (confines every command via ctx.sandbox, reports denial/enforcement result facts)",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.3-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -27,21 +27,21 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@deepseek-ai/dsh-shell": "^0.1.
|
|
31
|
-
"@deepseek-ai/dsh-bash-local": "^0.1.
|
|
32
|
-
"@deepseek-ai/dsh-sandbox": "^0.1.
|
|
33
|
-
"@deepseek-ai/dsh-sandbox-policy": "^0.1.
|
|
30
|
+
"@deepseek-ai/dsh-shell": "^0.1.3-alpha.2",
|
|
31
|
+
"@deepseek-ai/dsh-bash-local": "^0.1.3-alpha.2",
|
|
32
|
+
"@deepseek-ai/dsh-sandbox": "^0.1.3-alpha.2",
|
|
33
|
+
"@deepseek-ai/dsh-sandbox-policy": "^0.1.3-alpha.2",
|
|
34
34
|
"@deepseek-ai/cordis": "^4.0.2"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@deepseek-ai/dsh-shell": "^0.1.
|
|
38
|
-
"@deepseek-ai/dsh-bash-local": "^0.1.
|
|
39
|
-
"@deepseek-ai/dsh-subprocess-local": "^0.1.
|
|
40
|
-
"@deepseek-ai/dsh-sandbox": "^0.1.
|
|
41
|
-
"@deepseek-ai/dsh-sandbox-
|
|
42
|
-
"@deepseek-ai/dsh-sandbox
|
|
37
|
+
"@deepseek-ai/dsh-shell": "^0.1.3-alpha.2",
|
|
38
|
+
"@deepseek-ai/dsh-bash-local": "^0.1.3-alpha.2",
|
|
39
|
+
"@deepseek-ai/dsh-subprocess-local": "^0.1.3-alpha.2",
|
|
40
|
+
"@deepseek-ai/dsh-sandbox-local": "^0.1.3-alpha.2",
|
|
41
|
+
"@deepseek-ai/dsh-sandbox-policy": "^0.1.3-alpha.2",
|
|
42
|
+
"@deepseek-ai/dsh-sandbox": "^0.1.3-alpha.2",
|
|
43
43
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
44
44
|
"@deepseek-ai/node-addon-landlock-run": "^0.1.1",
|
|
45
|
-
"@deepseek-ai/dsh-session-projection": "^0.1.
|
|
45
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.3-alpha.2"
|
|
46
46
|
}
|
|
47
47
|
}
|