@deepseek-ai/dsh-tool-bash-persistent 0.1.5-rc.2 → 0.1.6-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 +3 -3
- package/README.zh.md +6 -6
- package/package.json +19 -19
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/tool-bash-persistent/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: f6d6daa0f9c312b64e913aa811fadff3ad6b6acf
|
|
6
|
+
README.zh.md: 19f88c9c130a0bb1001770869355b88cae943644
|
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ This section explains the design decisions behind the tool and points at the cod
|
|
|
80
80
|
| File | Role |
|
|
81
81
|
|---|---|
|
|
82
82
|
| [`src/index.ts`](src/index.ts) | Plugin entry: shell registry, command wrapping, scrollback polling, extraction and rendering |
|
|
83
|
-
| — | No runtime invariant companion is published; the adapter's private owner-to-shell cache has no observable event or data relation. Lifecycle tests prove its cleanup without adding a public API solely for an invariant. |
|
|
83
|
+
| — | No runtime invariant companion is published; the adapter's private owner-to-shell cache has no observable event or data relation. Shell reuse remains observable through tool execution. Lifecycle tests prove its cleanup without adding a public API solely for an invariant. |
|
|
84
84
|
|
|
85
85
|
### Command flow
|
|
86
86
|
|
|
@@ -126,7 +126,7 @@ Prefix-stable while the configured description and schema remain unchanged.
|
|
|
126
126
|
|
|
127
127
|
#### What the model sees
|
|
128
128
|
|
|
129
|
-
Commands share one shell per
|
|
129
|
+
Commands share one shell per agent, so cwd, exported variables, activated environments, functions, and background jobs persist across calls. Results exclude private completion markers. When the shell reads stdin again without having printed the completion marker — after `exec`, an interrupt, or an interactive foreground child whose stdin wait the provider proves — the call returns the captured partial output, which can end with the backend's own prompt text. Every settled command appends `[Command finished with exit code N]`; a shell that exits before reporting that status instead appends `[shell exited: code N]`, `[shell killed by signal: SIG]`, or `[shell exited]` when the backend supplies neither, then resets and tells the model that the next call starts fresh. Long output keeps the earliest retained prefix plus a clipping notice. If the PTY has already dropped that prefix, the result says so explicitly instead of presenting a tail as complete output. Timeout returns bounded partial output followed by `[Command timed out or OOM]`, closes the uncertain shell, and reports the reset.
|
|
130
130
|
|
|
131
131
|
#### Token effect
|
|
132
132
|
|
|
@@ -143,7 +143,7 @@ Append-only tool results follow the reusable request prefix.
|
|
|
143
143
|
|
|
144
144
|
These limits define when the tool is a poor fit or needs special care. They are current package constraints, not a task backlog.
|
|
145
145
|
|
|
146
|
-
- **The tool requires an owning
|
|
146
|
+
- **The tool requires an owning agent and a real PTY backend** — agent-less calls and backends that cannot start an interactive shell fail.
|
|
147
147
|
- **An interactive foreground child returns early with partial output only where the subprocess provider proves its stdin wait** — elsewhere the call runs to `timeoutMs`.
|
|
148
148
|
- **Explicit `exit` and timeout discard shell state** — cancellation also resets and discards the result, even when a complete status marker is already observable; the next call starts a fresh shell.
|
|
149
149
|
- **Environment facts such as network access and package mirrors belong in the configured `description`** — not this package's default.
|
package/README.zh.md
CHANGED
|
@@ -9,7 +9,7 @@ kind: "package-reference"
|
|
|
9
9
|
|
|
10
10
|
## 概述
|
|
11
11
|
|
|
12
|
-
本包为 agent
|
|
12
|
+
本包为 agent(智能体)提供 `bash` 工具,使 cwd、导出的变量、函数与后台任务跨调用保留。每个 agent 都有隔离的 shell,其命令串行执行。需要跨调用状态的工作流应选择本包;每条命令都应从干净环境开始时使用 `dsh-tool-bash`。配置 PTY 后端与单条命令的超时;`exit`、超时或取消会重置 shell,而等待 stdin 的交互式命令可能一直运行到超时。
|
|
13
13
|
|
|
14
14
|
## 目录
|
|
15
15
|
|
|
@@ -71,7 +71,7 @@ kind: "package-reference"
|
|
|
71
71
|
### 设计理念
|
|
72
72
|
|
|
73
73
|
- **每个 owner 一个 shell,互不共享。** shell 注册表按调用方 `Agent` 为每个会话建键,因此并发 agent 永不共享状态,同一 agent 的命令通过按 owner 的队列串行化。
|
|
74
|
-
- **标记锚定提取。** 每条命令都用携带退出状态的唯一起止标记包装;工具轮询 PTY scrollback
|
|
74
|
+
- **标记锚定提取。** 每条命令都用携带退出状态的唯一起止标记包装;工具轮询 PTY scrollback 并提取真实标记之间的区间,因此提示符与回显输入永不泄漏进结果。
|
|
75
75
|
- **重置,而非修复。** 任何不确定状态——显式 `exit`、超时、发送失败、中止——都会关闭 shell 并让下一次调用从全新状态开始,因为半知情的 shell 不如干净的 shell。
|
|
76
76
|
- **按 owner 的生命周期。** shell 在首次使用时惰性创建,在插件释放或 owner 拆除时终止;按所有者隔离的 `ctx.terminals` 服务把每个操作都围栏到拥有它的 agent。
|
|
77
77
|
|
|
@@ -80,11 +80,11 @@ kind: "package-reference"
|
|
|
80
80
|
| 文件 | 职责 |
|
|
81
81
|
|---|---|
|
|
82
82
|
| [`src/index.ts`](src/index.ts) | 插件入口:shell 注册表、命令包装、scrollback 轮询、提取与渲染 |
|
|
83
|
-
| — |
|
|
83
|
+
| — | 不发布运行时不变式伴生入口;适配器私有的 owner-to-shell 缓存没有可观察的事件或数据关系。shell 复用仍可通过工具执行观察。生命周期测试会验证其清理行为,无需仅为不变式增加公共 API。 |
|
|
84
84
|
|
|
85
85
|
### 命令流程
|
|
86
86
|
|
|
87
|
-
首条命令通过 `ctx.terminals.spawn` 生成 shell,禁用输入回显(`stty -echo`),并等待就绪。随后每条命令都包装成一行物理文本——printf 起始标记、用 `$'…'` 转义的命令体、printf 结束标记加
|
|
87
|
+
首条命令通过 `ctx.terminals.spawn` 生成 shell,禁用输入回显(`stty -echo`),并等待就绪。随后每条命令都包装成一行物理文本——printf 起始标记、用 `$'…'` 转义的命令体、printf 结束标记加 `$?`——因此内嵌换行无法把终端提示符泄漏进结果。工具以 1,000 行一页轮询 scrollback,直到出现结束标记,提取区间并连同任何状态标记一起渲染。超时会中止截止时间、捕获部分输出并重置 shell。
|
|
88
88
|
|
|
89
89
|
</details>
|
|
90
90
|
|
|
@@ -126,7 +126,7 @@ kind: "package-reference"
|
|
|
126
126
|
|
|
127
127
|
#### 模型看到什么
|
|
128
128
|
|
|
129
|
-
命令共享每个
|
|
129
|
+
命令共享每个 agent 一个 shell,因此 cwd、导出的变量、已激活的环境、函数与后台任务都会跨调用保留。结果排除私有完成标记。当 shell 在没有打印完成标记的情况下再次读取 stdin——`exec`、中断,或提供方证明其 stdin 等待的交互式前台子进程之后——调用返回捕获的部分输出,它可能以后端自己的提示符文本结尾。每条完成的命令都追加 `[Command finished with exit code N]`;在报告该状态前就退出的 shell 改为追加 `[shell exited: code N]`、`[shell killed by signal: SIG]`,或后端两者都未提供时的 `[shell exited]`,然后重置并告诉模型下一次调用从全新状态开始。长输出保留最早的已保留前缀并附裁剪通知。若 PTY 已经丢弃该前缀,结果会明确说明,而不是把尾部当作完整输出呈现。超时返回有界部分输出并追加 `[Command timed out or OOM]`、关闭不确定的 shell 并报告重置。
|
|
130
130
|
|
|
131
131
|
#### Token 影响
|
|
132
132
|
|
|
@@ -143,7 +143,7 @@ kind: "package-reference"
|
|
|
143
143
|
|
|
144
144
|
这些限制说明工具何时不合适或需要特别小心。它们是当前包约束,不是任务积压。
|
|
145
145
|
|
|
146
|
-
- **工具需要拥有者
|
|
146
|
+
- **工具需要拥有者 agent 与真实的 PTY 后端**——无 agent 的调用与无法启动交互 shell 的后端都会失败。
|
|
147
147
|
- **交互式前台子进程只在子进程提供方证明其 stdin 等待时才提前返回部分输出**——否则调用一直运行到 `timeoutMs`。
|
|
148
148
|
- **显式 `exit` 与超时会丢弃 shell 状态**——取消同样重置并丢弃结果,即使完整状态标记已经可观察;下一次调用启动全新 shell。
|
|
149
149
|
- **网络访问与包镜像等环境事实属于配置的 `description`**——而不是本包的默认描述。
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-tool-bash-persistent",
|
|
3
3
|
"description": "Model-facing owner-scoped persistent Bash tool backed by the Harness PTY service",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.6-alpha.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -26,31 +26,31 @@
|
|
|
26
26
|
],
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@deepseek-ai/dsh-agent": "^0.1.
|
|
30
|
-
"@deepseek-ai/dsh-terminal": "^0.1.
|
|
31
|
-
"@deepseek-ai/dsh-timeout": "^0.1.
|
|
32
|
-
"@deepseek-ai/
|
|
33
|
-
"@deepseek-ai/
|
|
29
|
+
"@deepseek-ai/dsh-agent": "^0.1.6-alpha.1",
|
|
30
|
+
"@deepseek-ai/dsh-terminal": "^0.1.6-alpha.1",
|
|
31
|
+
"@deepseek-ai/dsh-timeout": "^0.1.6-alpha.1",
|
|
32
|
+
"@deepseek-ai/dsh-tools": "^0.1.6-alpha.1",
|
|
33
|
+
"@deepseek-ai/cordis": "^4.0.2"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@deepseek-ai/schemastery": "^3.18.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@deepseek-ai/cordis-plugin-include": "^1.0.7",
|
|
40
|
-
"@deepseek-ai/dsh-agent": "^0.1.5-rc.2",
|
|
41
|
-
"@deepseek-ai/dsh-llm": "^0.1.5-rc.2",
|
|
42
|
-
"@deepseek-ai/dsh-agent-loop-testkit": "^0.1.5-rc.2",
|
|
43
40
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
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-
|
|
51
|
-
"@deepseek-ai/dsh-
|
|
41
|
+
"@deepseek-ai/dsh-agent": "^0.1.6-alpha.1",
|
|
42
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "^0.1.6-alpha.1",
|
|
43
|
+
"@deepseek-ai/dsh-llm": "^0.1.6-alpha.1",
|
|
44
|
+
"@deepseek-ai/dsh-terminal": "^0.1.6-alpha.1",
|
|
45
|
+
"@deepseek-ai/dsh-terminal-bash": "^0.1.6-alpha.1",
|
|
46
|
+
"@deepseek-ai/dsh-sandbox": "^0.1.6-alpha.1",
|
|
47
|
+
"@deepseek-ai/dsh-subprocess-local": "^0.1.6-alpha.1",
|
|
48
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.6-alpha.1",
|
|
49
|
+
"@deepseek-ai/dsh-sandbox-policy": "^0.1.6-alpha.1",
|
|
50
|
+
"@deepseek-ai/dsh-session": "^0.1.6-alpha.1",
|
|
51
|
+
"@deepseek-ai/dsh-timeout": "^0.1.6-alpha.1",
|
|
52
|
+
"@deepseek-ai/dsh-tools": "^0.1.6-alpha.1",
|
|
52
53
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
53
|
-
"@deepseek-ai/dsh-session-projection": "^0.1.
|
|
54
|
-
"@deepseek-ai/dsh-sandbox-policy": "^0.1.5-rc.2"
|
|
54
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.1"
|
|
55
55
|
}
|
|
56
56
|
}
|