@echo-agent/coding 0.8.0 → 0.10.0

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.
Files changed (3) hide show
  1. package/README.md +12 -11
  2. package/package.json +5 -5
  3. package/src/cli.ts +9 -6
package/README.md CHANGED
@@ -25,17 +25,18 @@ already taken on npm by an unrelated project.
25
25
  runtime's safety classifier checks every shell command, web fetch and any tool not known to be
26
26
  safe (MCP and extension tools included) against what you asked for, before it runs: a one-word
27
27
  quick check, and a careful second look only for what the quick check flags. You are asked only when
28
- the classifier keeps blocking or cannot run. Shell commands run in an OS sandbox (macOS
29
- `sandbox-exec`, Linux bubblewrap) that can write only inside the working directory, temporary
30
- directories and package caches, and cannot read echo's credential file. Where no sandbox works
31
- (inside most containers), each command has to run explicitly outside it and is checked the same
32
- way. **Through a pipe it runs every tool without asking** — treat it there as a script that may
33
- change files in the current directory.
34
-
35
- Whether the classifier runs is your call: set `"safetyClassifier": false` (or `true`) in
36
- `$ECHO_HOME/settings.json`. Unset, it is on in the interactive UI and off through a pipe; set, it
37
- applies to both. With it off, the sandbox still applies in the interactive UI, and a command that
38
- asks to run outside it asks you first.
28
+ the classifier keeps blocking or cannot run. **Through a pipe it runs every tool without asking** —
29
+ treat it there as a script that may change files in the current directory.
30
+
31
+ Both switches are yours, in `$ECHO_HOME/settings.json`:
32
+
33
+ - `"safetyClassifier"`: unset, it is on in the interactive UI and off through a pipe; set, it applies
34
+ to both.
35
+ - `"sandbox": true`: shell commands run in an OS sandbox (macOS `sandbox-exec`, Linux bubblewrap)
36
+ that can write only inside the working directory, temporary directories and package caches, and
37
+ cannot read echo's credential file. Off by default, because the usual setup already runs the whole
38
+ agent inside a container. Where no sandbox can start, each command has to run explicitly outside
39
+ it and is checked by the classifier; with the classifier off, such a command asks you first.
39
40
 
40
41
  Sessions belong to a directory *and* a command, so `echo-agent` and `echo-coding` never share a
41
42
  conversation even in the same directory.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@echo-agent/coding",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Echo's coding agent: its own identity and conduct on top of the standard file, search, shell and web tools, plus git worktree isolation. Installs the `echo-coding` command. Requires Bun.",
@@ -8,10 +8,10 @@
8
8
  "echo-coding": "./bin/echo-coding.ts"
9
9
  },
10
10
  "dependencies": {
11
- "@echo-agent/base": "0.8.0",
12
- "@echo-agent/core": "0.8.0",
13
- "@echo-agent/tools": "0.8.0",
14
- "@echo-agent/tui": "0.8.0"
11
+ "@echo-agent/base": "0.10.0",
12
+ "@echo-agent/core": "0.10.0",
13
+ "@echo-agent/tools": "0.10.0",
14
+ "@echo-agent/tui": "0.10.0"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@types/bun": "latest",
package/src/cli.ts CHANGED
@@ -12,8 +12,9 @@
12
12
  // · **安全分类器**是内核的(`createEcho({ safetyClassifier })`),开不开归使用者(settings.json 的 `safetyClassifier`,
13
13
  // 不写按形态:交互开、管道关——装配层 `presetForm` 定)。本产品只交**形状**:哪些工具不用判(`CODING_SAFE_TOOLS`:
14
14
  // 工具包那份加上本产品的 worktree 两件)、bash 的 `sandbox: false` 是什么意思(工具包的 `SHELL_CLASSIFIER_NOTES`)。
15
- // · **交互形态命令包进操作系统沙箱**(只能写工作区、临时目录与缓存,`@echo-agent/tools` 的 `sandbox.ts`)。分类器关着时,越出沙箱的那一条
16
- // 由人看(`permissionPolicyFor` 的规矩);开着时由分类器判,不另装策略。
15
+ // · **沙箱归使用者**(2026-11-16,settings.json 的 `sandbox`,缺省不包——常见用法是整个 agent 已经在容器里):写了 `true`
16
+ // 才把命令包进操作系统沙箱(只能写工作区、临时目录与缓存,`@echo-agent/tools` 的 `sandbox.ts`)。开着沙箱、分类器关着时,
17
+ // 越出沙箱的那一条由人看(`permissionPolicyFor` 的规矩);分类器开着时由它判,不另装策略。
17
18
  // `permission.ts` 的 `DEFAULT_PERMISSION`(三件先问的黑名单)**不是这条命令的行为**:它只在嵌入方调 `codingPreset()`
18
19
  // 而不传 `permission` 时生效(评测、别的宿主)。
19
20
 
@@ -41,13 +42,15 @@ export const ECHO_CODING: Product = Object.freeze({
41
42
  // 共用的纪律段由**产品**挂(2026-09-09 拍板):装配层不再恒挂,形态决定「有没有人能答」那一条。
42
43
  // `codingPreset()` 自己只依赖 core,所以这一条加在这里,不加进它。
43
44
  preset: (form, host) => {
44
- // 沙箱跟形态走:交互形态包、管道形态不包。分类器关着时越出沙箱的那一条问终端里的人;开着时交给分类器(见文件头)
45
- const permission = form.interactive && !form.safetyClassifier ? ({ fallback: "allow", responder: "host" } as const) : false;
46
- const preset = codingPreset({ permission, sandbox: form.interactive, maxIterations: 200, credentials: host.credentials });
45
+ // 沙箱归使用者(settings.json 的 `sandbox`,缺省不包)。开着沙箱、分类器关着时越出沙箱的那一条问人(管道形态就是拒);
46
+ // 分类器开着时交给分类器(见文件头)
47
+ const sandbox = form.sandbox === true;
48
+ const permission = sandbox && !form.safetyClassifier ? ({ fallback: "allow", responder: form.interactive ? "host" : "none" } as const) : false;
49
+ const preset = codingPreset({ permission, sandbox, maxIterations: 200, credentials: host.credentials });
47
50
  return {
48
51
  ...preset,
49
52
  extensions: [conductEntry(form), ...preset.extensions],
50
- safetyClassifier: { safeTools: CODING_SAFE_TOOLS, notes: SHELL_CLASSIFIER_NOTES },
53
+ safetyClassifier: { safeTools: CODING_SAFE_TOOLS, ...(sandbox ? { notes: SHELL_CLASSIFIER_NOTES } : {}) },
51
54
  };
52
55
  },
53
56
  // 观测留 30 天(2026-09-15 用户拍板,与 echo-agent 同一条规则;两个产品平级,各自声明各自的)。