@deepseek-ai/dsh-tool-terminal 0.2.1-alpha.1 → 0.2.1-alpha.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/README.i18n.yaml +5 -5
- package/README.md +4 -2
- package/README.zh.md +4 -2
- package/lib/index.js +13 -5
- package/lib/types/index.d.ts +1 -1
- 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
|
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
|
|
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
|
|
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,11 +150,12 @@ 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;
|
|
156
|
-
/** Smallest cap that preserves
|
|
158
|
+
/** Smallest cap that preserves registry-issued PTY and job ids in creation acknowledgements. */
|
|
157
159
|
const MIN_MAX_RESULT_BYTES = 64;
|
|
158
160
|
/** Schemastery configuration for the terminal tool consumer. */
|
|
159
161
|
const Config = z.object({
|
|
@@ -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) => {
|
|
@@ -399,6 +403,10 @@ function apply(ctx, config = {}) {
|
|
|
399
403
|
jobId: jobs.start({
|
|
400
404
|
kind: "pty-send",
|
|
401
405
|
label: `${id}: ${args.text || "(input)"}`,
|
|
406
|
+
toolCall: {
|
|
407
|
+
callId: exec.callId,
|
|
408
|
+
rootCallId: exec.rootCallId
|
|
409
|
+
},
|
|
402
410
|
owner: owner.id,
|
|
403
411
|
outputLimitBytes: maxResultBytes,
|
|
404
412
|
output: [sendSource(() => operation)],
|
package/lib/types/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare const name = "tool-terminal";
|
|
|
16
16
|
export declare const inject: string[];
|
|
17
17
|
/** Default cap for one complete model-facing terminal result. */
|
|
18
18
|
export declare const DEFAULT_MAX_RESULT_BYTES: number;
|
|
19
|
-
/** Smallest cap that preserves
|
|
19
|
+
/** Smallest cap that preserves registry-issued PTY and job ids in creation acknowledgements. */
|
|
20
20
|
export declare const MIN_MAX_RESULT_BYTES = 64;
|
|
21
21
|
/** Model-facing terminal tool configuration. */
|
|
22
22
|
export interface Config {
|
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.1-alpha.
|
|
4
|
+
"version": "0.2.1-alpha.3",
|
|
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.5-alpha.
|
|
30
|
+
"@deepseek-ai/schemastery": "~3.18.5-alpha.2"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@deepseek-ai/dsh-
|
|
34
|
-
"@deepseek-ai/dsh-
|
|
35
|
-
"@deepseek-ai/dsh-
|
|
36
|
-
"@deepseek-ai/dsh-
|
|
37
|
-
"@deepseek-ai/dsh-system-prompt": "0.2.1-alpha.
|
|
38
|
-
"@deepseek-ai/dsh-jobs": "0.2.1-alpha.
|
|
39
|
-
"@deepseek-ai/dsh-tools": "0.2.1-alpha.
|
|
40
|
-
"@deepseek-ai/cordis": "~4.0.5-alpha.
|
|
33
|
+
"@deepseek-ai/dsh-agent": "0.2.1-alpha.3",
|
|
34
|
+
"@deepseek-ai/dsh-llm": "0.2.1-alpha.3",
|
|
35
|
+
"@deepseek-ai/dsh-terminal": "0.2.1-alpha.3",
|
|
36
|
+
"@deepseek-ai/dsh-output-retention": "0.2.1-alpha.3",
|
|
37
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.1-alpha.3",
|
|
38
|
+
"@deepseek-ai/dsh-jobs": "0.2.1-alpha.3",
|
|
39
|
+
"@deepseek-ai/dsh-tools": "0.2.1-alpha.3",
|
|
40
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.2",
|
|
41
|
+
"@deepseek-ai/dsh-working-directory": "0.2.1-alpha.3"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
|
-
"@deepseek-ai/cordis-plugin-include": "~1.0.10-alpha.
|
|
44
|
-
"@deepseek-ai/
|
|
45
|
-
"@deepseek-ai/dsh-agent
|
|
46
|
-
"@deepseek-ai/
|
|
47
|
-
"@deepseek-ai/dsh-llm": "0.2.1-alpha.
|
|
48
|
-
"@deepseek-ai/dsh-terminal
|
|
49
|
-
"@deepseek-ai/dsh-
|
|
50
|
-
"@deepseek-ai/dsh-
|
|
51
|
-
"@deepseek-ai/dsh-sandbox": "0.2.1-alpha.
|
|
52
|
-
"@deepseek-ai/dsh-sandbox-policy": "0.2.1-alpha.
|
|
53
|
-
"@deepseek-ai/dsh-session": "0.2.1-alpha.
|
|
54
|
-
"@deepseek-ai/dsh-subprocess-local": "0.2.1-alpha.
|
|
55
|
-
"@deepseek-ai/dsh-
|
|
56
|
-
"@deepseek-ai/dsh-
|
|
57
|
-
"@deepseek-ai/
|
|
58
|
-
"@deepseek-ai/dsh-
|
|
59
|
-
"@deepseek-ai/dsh-
|
|
60
|
-
"@deepseek-ai/
|
|
61
|
-
"@deepseek-ai/dsh-
|
|
44
|
+
"@deepseek-ai/cordis-plugin-include": "~1.0.10-alpha.2",
|
|
45
|
+
"@deepseek-ai/cordis-plugin-loader": "~1.0.6-alpha.2",
|
|
46
|
+
"@deepseek-ai/dsh-agent": "0.2.1-alpha.3",
|
|
47
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-alpha.3",
|
|
48
|
+
"@deepseek-ai/dsh-llm": "0.2.1-alpha.3",
|
|
49
|
+
"@deepseek-ai/dsh-terminal": "0.2.1-alpha.3",
|
|
50
|
+
"@deepseek-ai/dsh-terminal-bash": "0.2.1-alpha.3",
|
|
51
|
+
"@deepseek-ai/dsh-output-retention": "0.2.1-alpha.3",
|
|
52
|
+
"@deepseek-ai/dsh-sandbox": "0.2.1-alpha.3",
|
|
53
|
+
"@deepseek-ai/dsh-sandbox-policy": "0.2.1-alpha.3",
|
|
54
|
+
"@deepseek-ai/dsh-session": "0.2.1-alpha.3",
|
|
55
|
+
"@deepseek-ai/dsh-subprocess-local": "0.2.1-alpha.3",
|
|
56
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.1-alpha.3",
|
|
57
|
+
"@deepseek-ai/dsh-jobs": "0.2.1-alpha.3",
|
|
58
|
+
"@deepseek-ai/dsh-jobs-local": "0.2.1-alpha.3",
|
|
59
|
+
"@deepseek-ai/dsh-tool-jobs": "0.2.1-alpha.3",
|
|
60
|
+
"@deepseek-ai/dsh-tools": "0.2.1-alpha.3",
|
|
61
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.2",
|
|
62
|
+
"@deepseek-ai/dsh-session-projection": "0.2.1-alpha.3",
|
|
63
|
+
"@deepseek-ai/dsh-working-directory": "0.2.1-alpha.3"
|
|
62
64
|
}
|
|
63
65
|
}
|