@deepseek-ai/dsh-tool-terminal 0.2.0-rc.2 → 0.2.1-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 +7 -7
- package/README.md +4 -4
- package/README.zh.md +4 -4
- package/lib/index.js +8 -4
- package/package.json +32 -30
package/README.i18n.yaml
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Bilingual-pair consistency record for README.md (docs/i18n/README.md): per heading
|
|
2
2
|
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
|
|
3
3
|
# After editing either side, bring the other along and re-record with:
|
|
4
|
-
# pnpm run verify-translation-pairing --write packages/
|
|
4
|
+
# pnpm run verify-translation-pairing --write packages/experimental/tool-terminal/README.md
|
|
5
5
|
/:
|
|
6
6
|
en: fc74eecdf1f2ad5b
|
|
7
7
|
zh: dc9c2a28ce96ce67
|
|
8
8
|
/deepseek-ai-dsh-tool-terminal:
|
|
9
|
-
en:
|
|
10
|
-
zh:
|
|
9
|
+
en: 68d62f7fc80920a7
|
|
10
|
+
zh: 3e8cb4520dbbe933
|
|
11
11
|
/deepseek-ai-dsh-tool-terminal/summary:
|
|
12
12
|
en: c0e810d4279333a5
|
|
13
13
|
zh: 7e79b6a63fa10029
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
en: d152484eb41ac6b4
|
|
16
16
|
zh: 09388d293f9be9cb
|
|
17
17
|
/deepseek-ai-dsh-tool-terminal/use-this-package:
|
|
18
|
-
en:
|
|
19
|
-
zh:
|
|
18
|
+
en: 43b602baf5b35116
|
|
19
|
+
zh: caffb91711393c3b
|
|
20
20
|
/deepseek-ai-dsh-tool-terminal/use-this-package/the-six-tools:
|
|
21
21
|
en: 3e9b6211dd72ec64
|
|
22
22
|
zh: aa4cd15195cb43d6
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
en: ba974b703d6ed0bc
|
|
97
97
|
zh: 655810d5d338343c
|
|
98
98
|
/deepseek-ai-dsh-tool-terminal/known-limitations-and-deferred-work/dev-note:
|
|
99
|
-
en:
|
|
100
|
-
zh:
|
|
99
|
+
en: e67f633dc6fe7773
|
|
100
|
+
zh: 3bb0c20c93f16f98
|
package/README.md
CHANGED
|
@@ -25,6 +25,8 @@ Use `dsh-tool-terminal` when an agent needs persistent terminal state or interac
|
|
|
25
25
|
<a id="use-this-package"></a>
|
|
26
26
|
## Use this package
|
|
27
27
|
|
|
28
|
+
`terminal_open` defaults to the Session's current working directory and resolves relative `cwd` overrides from it. Open terminals keep their own directory after the Session changes directory.
|
|
29
|
+
|
|
28
30
|
Enable these tools when the composition mounts a terminal backend and the model should be able to use terminal state across calls — stepping a debugger, exploring in a REPL, or returning to a shell after interrupting a foreground command. The guidance section steers the model toward the one-shot bash, read, write, and edit tools for bounded operations.
|
|
29
31
|
|
|
30
32
|
### The six tools
|
|
@@ -105,8 +107,8 @@ Read these pages when the package-level contract is not enough. They move from t
|
|
|
105
107
|
|
|
106
108
|
- [Tool catalog](../../../docs/tool-catalog.md#deepseek-aidsh-tool-terminal) — the six generated schemas and result shapes.
|
|
107
109
|
- [Terminal subsystem reference](../../../docs/subsystems/terminal.md) — the service contract and shared types behind the tools.
|
|
108
|
-
- [terminal service](
|
|
109
|
-
- [terminal-bash backend](
|
|
110
|
+
- [terminal service](../../terminal/terminal/README.md) — session operations, owner fencing, and cleanup semantics.
|
|
111
|
+
- [terminal-bash backend](../../terminal/terminal-bash/README.md) — the shipped shell backend that provides sessions.
|
|
110
112
|
- [jobs package map](../../jobs/README.md) — the background-job surface that collects and kills background sends.
|
|
111
113
|
- [Persistent PTY Agent Note](../../../.agents/notes/implemented/feature/2026-07-16-persistent-pty-sessions.md) — the capability design and deferred boundaries.
|
|
112
114
|
|
|
@@ -182,5 +184,3 @@ These limits define the model-facing surface that is absent. They are current pa
|
|
|
182
184
|
None.
|
|
183
185
|
|
|
184
186
|
</details>
|
|
185
|
-
|
|
186
|
-
**Runtime invariant:** No companion is published. This stateless adapter contributes tools and prompt guidance, while PTY lifecycle and background-job relationships remain owned by the services it composes.
|
package/README.zh.md
CHANGED
|
@@ -25,6 +25,8 @@ kind: "package-reference"
|
|
|
25
25
|
<a id="use-this-package"></a>
|
|
26
26
|
## 使用本包
|
|
27
27
|
|
|
28
|
+
`terminal_open` 默认使用 Session 的当前工作目录,并以该目录解析相对 `cwd` 覆盖值。Session 切换目录后,已打开的终端仍保留各自的目录。
|
|
29
|
+
|
|
28
30
|
当组合挂载了终端后端、且模型应当能跨调用使用终端状态时启用这些工具——使用调试器单步调试、在 REPL 中探索,或中断前台命令后回到 shell。指引章节会引导模型对有界操作使用单次 bash、read、write 与 edit 工具。
|
|
29
31
|
|
|
30
32
|
### 六个工具
|
|
@@ -105,8 +107,8 @@ kind: "package-reference"
|
|
|
105
107
|
|
|
106
108
|
- [工具目录](../../../docs/tool-catalog.zh.md#deepseek-aidsh-tool-terminal)——6 个生成的 schema 与结果形态。
|
|
107
109
|
- [终端子系统参考](../../../docs/subsystems/terminal.zh.md)——工具背后的服务约定与共享类型。
|
|
108
|
-
- [terminal 服务](
|
|
109
|
-
- [terminal-bash 后端](
|
|
110
|
+
- [terminal 服务](../../terminal/terminal/README.zh.md)——会话操作、所有者限制与清理语义。
|
|
111
|
+
- [terminal-bash 后端](../../terminal/terminal-bash/README.zh.md)——提供会话的随附 shell 后端。
|
|
110
112
|
- [jobs 包映射](../../jobs/README.zh.md)——收集与停止后台发送的后台任务接口面。
|
|
111
113
|
- [持久 PTY Agent Note](../../../.agents/notes/implemented/feature/2026-07-16-persistent-pty-sessions.zh.md)——能力设计与暂缓边界。
|
|
112
114
|
|
|
@@ -182,5 +184,3 @@ spawn 返回 id 与有界启动输出。发送与读取返回有界终端文本
|
|
|
182
184
|
无。
|
|
183
185
|
|
|
184
186
|
</details>
|
|
185
|
-
|
|
186
|
-
**运行时不变式:** 不发布伴生入口。这个无状态适配器只贡献工具与提示词指引;PTY 生命周期与后台任务关系仍由其组合的服务持有。
|
package/lib/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
1
2
|
import z from "@deepseek-ai/schemastery";
|
|
2
3
|
import { TerminalSessionId } from "@deepseek-ai/dsh-terminal";
|
|
3
4
|
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
@@ -149,7 +150,8 @@ const name = "tool-terminal";
|
|
|
149
150
|
const inject = [
|
|
150
151
|
"terminals",
|
|
151
152
|
"tools",
|
|
152
|
-
"systemPrompt"
|
|
153
|
+
"systemPrompt",
|
|
154
|
+
"workingDirectory"
|
|
153
155
|
];
|
|
154
156
|
/** Default cap for one complete model-facing terminal result. */
|
|
155
157
|
const DEFAULT_MAX_RESULT_BYTES = 256 * 1024;
|
|
@@ -274,7 +276,7 @@ function apply(ctx, config = {}) {
|
|
|
274
276
|
},
|
|
275
277
|
cwd: {
|
|
276
278
|
type: "string",
|
|
277
|
-
description: "Initial working directory
|
|
279
|
+
description: "Initial working directory, relative to the Session current directory when not absolute."
|
|
278
280
|
}
|
|
279
281
|
},
|
|
280
282
|
finalizeContent,
|
|
@@ -297,10 +299,12 @@ function apply(ctx, config = {}) {
|
|
|
297
299
|
},
|
|
298
300
|
async execute(args, exec) {
|
|
299
301
|
if (args.type.length === 0) throw new Error("type must be a non-empty string");
|
|
300
|
-
|
|
302
|
+
const owner = requireAgent(exec.agent);
|
|
303
|
+
const cwd = await ctx.workingDirectory.ensure(owner, exec.signal);
|
|
304
|
+
return await ctx.terminals.spawn(owner, {
|
|
301
305
|
type: args.type,
|
|
302
306
|
...args.name !== void 0 ? { name: args.name } : {},
|
|
303
|
-
|
|
307
|
+
cwd: args.cwd === void 0 ? cwd : resolve(cwd, args.cwd)
|
|
304
308
|
}, exec.signal);
|
|
305
309
|
},
|
|
306
310
|
presentCall: (args) => {
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-tool-terminal",
|
|
3
3
|
"description": "Six model-facing persistent PTY tools with owner isolation and generic background-job integration",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.1-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
|
|
11
|
-
"directory": "packages/
|
|
11
|
+
"directory": "packages/experimental/tool-terminal"
|
|
12
12
|
},
|
|
13
13
|
"type": "module",
|
|
14
14
|
"main": "lib/index.js",
|
|
@@ -27,37 +27,39 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@deepseek-ai/schemastery": "~3.18.
|
|
30
|
+
"@deepseek-ai/schemastery": "~3.18.5-alpha.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@deepseek-ai/dsh-agent": "0.2.
|
|
34
|
-
"@deepseek-ai/dsh-llm": "0.2.
|
|
35
|
-
"@deepseek-ai/dsh-terminal": "0.2.
|
|
36
|
-
"@deepseek-ai/dsh-output-retention": "0.2.
|
|
37
|
-
"@deepseek-ai/dsh-system-prompt": "0.2.
|
|
38
|
-
"@deepseek-ai/dsh-jobs": "0.2.
|
|
39
|
-
"@deepseek-ai/
|
|
40
|
-
"@deepseek-ai/
|
|
33
|
+
"@deepseek-ai/dsh-agent": "0.2.1-alpha.2",
|
|
34
|
+
"@deepseek-ai/dsh-llm": "0.2.1-alpha.2",
|
|
35
|
+
"@deepseek-ai/dsh-terminal": "0.2.1-alpha.2",
|
|
36
|
+
"@deepseek-ai/dsh-output-retention": "0.2.1-alpha.2",
|
|
37
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.1-alpha.2",
|
|
38
|
+
"@deepseek-ai/dsh-jobs": "0.2.1-alpha.2",
|
|
39
|
+
"@deepseek-ai/dsh-tools": "0.2.1-alpha.2",
|
|
40
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.1",
|
|
41
|
+
"@deepseek-ai/dsh-working-directory": "0.2.1-alpha.2"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
|
-
"@deepseek-ai/cordis-plugin-include": "~1.0.
|
|
44
|
-
"@deepseek-ai/cordis-plugin-loader": "~1.0.
|
|
45
|
-
"@deepseek-ai/dsh-agent": "0.2.
|
|
46
|
-
"@deepseek-ai/dsh-
|
|
47
|
-
"@deepseek-ai/dsh-
|
|
48
|
-
"@deepseek-ai/dsh-
|
|
49
|
-
"@deepseek-ai/dsh-terminal-bash": "0.2.
|
|
50
|
-
"@deepseek-ai/dsh-output-retention": "0.2.
|
|
51
|
-
"@deepseek-ai/dsh-
|
|
52
|
-
"@deepseek-ai/dsh-sandbox": "0.2.
|
|
53
|
-
"@deepseek-ai/dsh-
|
|
54
|
-
"@deepseek-ai/dsh-subprocess-local": "0.2.
|
|
55
|
-
"@deepseek-ai/dsh-system-prompt": "0.2.
|
|
56
|
-
"@deepseek-ai/dsh-jobs": "0.2.
|
|
57
|
-
"@deepseek-ai/dsh-jobs-local": "0.2.
|
|
58
|
-
"@deepseek-ai/dsh-
|
|
59
|
-
"@deepseek-ai/
|
|
60
|
-
"@deepseek-ai/
|
|
61
|
-
"@deepseek-ai/dsh-
|
|
44
|
+
"@deepseek-ai/cordis-plugin-include": "~1.0.10-alpha.1",
|
|
45
|
+
"@deepseek-ai/cordis-plugin-loader": "~1.0.6-alpha.1",
|
|
46
|
+
"@deepseek-ai/dsh-agent": "0.2.1-alpha.2",
|
|
47
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-alpha.2",
|
|
48
|
+
"@deepseek-ai/dsh-llm": "0.2.1-alpha.2",
|
|
49
|
+
"@deepseek-ai/dsh-terminal": "0.2.1-alpha.2",
|
|
50
|
+
"@deepseek-ai/dsh-terminal-bash": "0.2.1-alpha.2",
|
|
51
|
+
"@deepseek-ai/dsh-output-retention": "0.2.1-alpha.2",
|
|
52
|
+
"@deepseek-ai/dsh-sandbox": "0.2.1-alpha.2",
|
|
53
|
+
"@deepseek-ai/dsh-sandbox-policy": "0.2.1-alpha.2",
|
|
54
|
+
"@deepseek-ai/dsh-session": "0.2.1-alpha.2",
|
|
55
|
+
"@deepseek-ai/dsh-subprocess-local": "0.2.1-alpha.2",
|
|
56
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.1-alpha.2",
|
|
57
|
+
"@deepseek-ai/dsh-jobs": "0.2.1-alpha.2",
|
|
58
|
+
"@deepseek-ai/dsh-jobs-local": "0.2.1-alpha.2",
|
|
59
|
+
"@deepseek-ai/dsh-tool-jobs": "0.2.1-alpha.2",
|
|
60
|
+
"@deepseek-ai/dsh-tools": "0.2.1-alpha.2",
|
|
61
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.1",
|
|
62
|
+
"@deepseek-ai/dsh-session-projection": "0.2.1-alpha.2",
|
|
63
|
+
"@deepseek-ai/dsh-working-directory": "0.2.1-alpha.2"
|
|
62
64
|
}
|
|
63
65
|
}
|