@deepseek-ai/dsh-tool-terminal 0.1.1-rc.2 → 0.1.2-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 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/terminal/tool-terminal/README.md
5
- README.md: f6fd4020d423425d7b20ad6bc21b4e009cf25c85
6
- README.zh.md: dca0ce9280fc7a7d748e90a5c553c0e712e2453d
5
+ README.md: 0ccdb451e829f24cffb0f2c89d4d70ffe9d40c68
6
+ README.zh.md: f7852bd8185086e4f0456d1c79821e71ef31472c
package/README.md CHANGED
@@ -1,20 +1,118 @@
1
+ ---
2
+ description: "Six model-facing persistent terminal tools with owner isolation, bounded results, and optional background sends for agents that need cross-call terminal state."
3
+ kind: "package-reference"
4
+ ---
5
+
1
6
  # @deepseek-ai/dsh-tool-terminal
2
7
 
3
8
  English | [中文](README.zh.md)
4
9
 
5
- Six model-facing tools over `ctx.terminals`: `terminal_open`, `terminal_send`, `terminal_read`, `terminal_signal`, `terminal_close`, and `terminal_list`. Every operation requires the exact initiating `Agent`, so a model cannot address another agent's terminal even if it learns the id.
10
+ ## Summary
11
+
12
+ `dsh-tool-terminal` gives the model six tools over persistent terminal sessions: `terminal_open`, `terminal_send`, `terminal_read`, `terminal_signal`, `terminal_close`, and `terminal_list`. Every call is fenced to the exact agent that opened the session, so a model cannot operate another agent's terminal even if it learns the id. Sends run in the foreground (returning bounded output with a wait reason) or in the background through the jobs service (returning a job id collected with `job_output` and stopped with `job_kill`). Results are capped by `maxResultBytes` and stay in session history until compaction. A short guidance section tells the model to prefer one-shot tools unless a terminal's persistent state or interactive stdin is genuinely needed.
13
+
14
+ ## Table of Contents
15
+
16
+ - [Use this package](#use-this-package)
17
+ - [Understand the implementation](#understand-the-implementation)
18
+ - [Further Exploration](#further-exploration)
19
+ - [Model Experience](#model-experience)
20
+ - [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
21
+ - [Dev Note](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## Use this package
27
+
28
+ 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
+
30
+ ### The six tools
31
+
32
+ | Tool | What it does | Result |
33
+ |---|---|---|
34
+ | `terminal_open` | Creates an owner-scoped session from a backend type | Session id, name, type, pid, status, and bounded startup output |
35
+ | `terminal_send` | Writes text, optionally submitting Enter, and waits for readiness — or starts a background job | Bounded output plus wait and session status, or a job id |
36
+ | `terminal_read` | Reads a bounded page of retained output without sending input | Text with line pagination metadata |
37
+ | `terminal_signal` | Delivers one allowed signal to the foreground process group | `delivered` plus the target process group id |
38
+ | `terminal_close` | Closes a session and waits for its process tree to end | Closed or already-closing outcome |
39
+ | `terminal_list` | Lists the caller's live sessions | Owner-scoped session summaries |
40
+
41
+ ### Composition
42
+
43
+ ```yaml
44
+ - name: '@deepseek-ai/dsh-terminal'
45
+ - name: '@deepseek-ai/dsh-terminal-bash'
46
+ - name: '@deepseek-ai/dsh-tool-terminal'
47
+ ```
48
+
49
+ The tools need `ctx.terminals` — a backend must be mounted — and the system-prompt service for the guidance section. Background sends additionally require the jobs service and its model-facing controller (`@deepseek-ai/dsh-tool-jobs`).
50
+
51
+ ### Configuration
52
+
53
+ | Field | Default | Meaning |
54
+ |---|---|---|
55
+ | `enableRunInBackground` | `true` | Expose and accept `run_in_background`; `false` removes the schema field and rejects the argument |
56
+ | `maxResultBytes` | `262144` | UTF-8 cap (minimum `64`) for each complete terminal result after wait, session, pagination, truncation, and job-status metadata |
57
+
58
+ The generated [configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-tool-terminal) and [tool catalog](../../../docs/tool-catalog.md#deepseek-aidsh-tool-terminal) are the exhaustive sources for config fields and schemas.
59
+
60
+ ### Background sends
61
+
62
+ `terminal_send(run_in_background: true)` returns a job id immediately instead of waiting. The job is collected with `job_output`, which waits and reads incremental output, and stopped with `job_kill`, which delivers a real `SIGINT` to the foreground process group. Background mode fails before writing input when the jobs surface is absent.
63
+
64
+ ### Observable outcomes and failures
65
+
66
+ A foreground send returns the terminal's new output plus `wait: <reason>` and the session status; `session_exit` means the top-level shell exited, while `inferred_idle` or `timeout` never proves the foreground command exited. Opening a session with an unregistered backend type fails. Results larger than `maxResultBytes` are truncated at a UTF-8 boundary with a marker.
67
+
68
+ -----
6
69
 
7
- `terminal_send(run_in_background: true)` reuses `ctx.jobs`; job preflight and the PTY service's exclusive per-session send reservation occur before the job id is returned, completion is collected with `job_output`, and `job_kill` delivers `SIGINT` to the foreground process group. Foreground sends use terminal call/result cards. Background sends use a generic execute card; open, read, signal, close, and list use generic `execute`, `read`, `execute`, `delete`, and `read` cards respectively. None declares source locations.
70
+ <a id="understand-the-implementation"></a>
71
+ ## Understand the implementation
8
72
 
9
- ## Config
73
+ <details>
74
+ <summary>Implementation internals — click to expand</summary>
10
75
 
11
- | key | default | meaning |
12
- |---|---:|---|
13
- | `enableRunInBackground` | `true` | expose and accept `run_in_background`; false omits the schema field and rejects a forced undeclared argument |
14
- | `maxResultBytes` | `262144` | UTF-8 cap (minimum `64`) for each complete terminal result or PTY job output after wait, session, pagination, truncation, and task-status metadata |
76
+ This section explains the design behind the tools and points at the code that realizes it; the observable behavior is covered in [Use this package](#use-this-package).
15
77
 
16
- Both values are validated at load. The minimum result cap keeps every registry-issued session or job id visible in its creation acknowledgement. When a result exceeds `maxResultBytes`, rendering reserves space for control metadata and a truncation marker when they fit; cuts preserve UTF-8 boundaries. Each terminal definition's final-content callback applies the same cap after normalized pre-, around-, and post-execute policy failures, denials, short-circuits, replacements, or blocks; a structured multi-block policy result retains its shape.
78
+ ### Design concept
17
79
 
80
+ The package is a thin adapter: the six tools forward to `ctx.terminals` with the executing agent as the owner, and the presentation layer renders bounded results. Background sends register the in-flight operation on `ctx.jobs` so the generic job surface owns waiting, incremental reads, and `SIGINT` delivery.
81
+
82
+ ### Source map
83
+
84
+ | File | Role |
85
+ |---|---|
86
+ | [`src/index.ts`](src/index.ts) | Six tool definitions, schemas, guidance section, background-job integration |
87
+ | [`src/render.ts`](src/render.ts) | Result rendering and the complete-result UTF-8 cap |
88
+
89
+ ### Result bounding
90
+
91
+ Every terminal-owned single-text result is capped by `maxResultBytes` after normalized tool or pipeline errors, policy denials and short-circuits, replacements and blocks, and generic job-status text; cuts preserve UTF-8 boundaries and reserve room for a truncation marker. Structured multi-block policy results retain their shape. The minimum cap of 64 bytes keeps every registry-issued session or job id visible in its creation acknowledgement.
92
+
93
+ ### UI render intents
94
+
95
+ Foreground sends use terminal call and result cards; background sends and the other five tools use generic `execute`, `read`, or `delete` cards. None of the tools emits source locations.
96
+
97
+ </details>
98
+
99
+ -----
100
+
101
+ <a id="further-exploration"></a>
102
+ ## Further Exploration
103
+
104
+ Read these pages when the package-level contract is not enough. They move from the generated schemas to the service contract, the backend, and the background-job surface.
105
+
106
+ - [Tool catalog](../../../docs/tool-catalog.md#deepseek-aidsh-tool-terminal) — the six generated schemas and result shapes.
107
+ - [Terminal subsystem reference](../../../docs/subsystems/terminal.md) — the service contract and shared types behind the tools.
108
+ - [terminal service](../terminal/README.md) — session operations, owner fencing, and cleanup semantics.
109
+ - [terminal-bash backend](../terminal-bash/README.md) — the shipped shell backend that provides sessions.
110
+ - [jobs package map](../../jobs/README.md) — the background-job surface that collects and kills background sends.
111
+ - [Persistent PTY Agent Note](../../../.agents/notes/implemented/feature/2026-07-16-persistent-pty-sessions.md) — the capability design and deferred boundaries.
112
+
113
+ -----
114
+
115
+ <a id="model-experience"></a>
18
116
  ## Model Experience
19
117
 
20
118
  ### System prompt
@@ -55,11 +153,11 @@ Prefix-stable while tool visibility and definitions are unchanged.
55
153
 
56
154
  #### What the model sees
57
155
 
58
- Spawn returns the id and bounded MOTD. Send/read return bounded terminal text plus readiness/history markers. Background mode returns a generic job id. Every terminal-owned or policy-produced single-text result is capped by `maxResultBytes` after normalized tool or pipeline errors, denials, short-circuits, replacements, blocks, and generic job status text. Structured multi-block policy results retain their shape. Results remain in session history until compaction; incremental task reads do not repeat consumed output. Programmatic callers receive typed session snapshots, bounded provider read/send DTOs, signal and close outcomes, or `{ kind: "background", jobId }`; Native rendering applies the presentation cap above.
156
+ Spawn returns the id and bounded startup output. Send and read return bounded terminal text plus readiness and history markers. Background mode returns a generic job id. Every terminal-owned single-text result is capped by `maxResultBytes`; results remain in session history until compaction, and incremental task reads do not repeat consumed output.
59
157
 
60
158
  #### Token effect
61
159
 
62
- Terminal-owned and policy-produced single-text results are data-dependent and bounded by `maxResultBytes`; a policy that deliberately substitutes structured multi-block content owns that content's bound. Each returned result remains in history until compaction.
160
+ Terminal-owned results are data-dependent and bounded by `maxResultBytes`; each returned result stays in history until compaction.
63
161
 
64
162
  #### KV Cache effect
65
163
 
@@ -67,5 +165,20 @@ Append-only; new results follow the reusable request prefix.
67
165
 
68
166
  ## Known Limitations and Deferred Work
69
167
 
70
- - No named key sequence, TUI, BEL, resize, auto-start, or cross-agent sharing schema is exposed.
71
- - Background mode requires both `@deepseek-ai/dsh-jobs` and its model-facing controller.
168
+ <a id="known-limitations-and-deferred-work"></a>
169
+
170
+
171
+ These limits define the model-facing surface that is absent. They are current package constraints, not a task backlog.
172
+
173
+ - **No TUI or key-sequence surface** — named key sequences, full-screen TUI interaction, BEL, resize, and auto-start are not exposed in any schema.
174
+ - **Background mode requires the jobs surface** — `run_in_background` needs both `@deepseek-ai/dsh-jobs` and its model-facing controller (`@deepseek-ai/dsh-tool-jobs`); without them the argument is rejected.
175
+
176
+ <a id="dev-note"></a>
177
+ ### Dev Note
178
+
179
+ <details>
180
+ <summary>Working context for maintainers — click to expand</summary>
181
+
182
+ None.
183
+
184
+ </details>
package/README.zh.md CHANGED
@@ -1,25 +1,123 @@
1
+ ---
2
+ description: "面向需要跨调用终端状态的 agent 的 6 个持久终端工具,带所有者隔离、有界结果与可选后台发送。"
3
+ kind: "package-reference"
4
+ ---
5
+
1
6
  # @deepseek-ai/dsh-tool-terminal
2
7
 
3
8
  [English](README.md) | 中文
4
9
 
5
- 基于 `ctx.terminals` 提供 6 个面向模型的工具:`terminal_open`、`terminal_send`、`terminal_read`、`terminal_signal`、`terminal_close` 和 `terminal_list`。每项操作都要求提供完全相同的发起 `Agent`,因此即使模型获知另一个 agent(智能体)的 id,也无法操作其终端。
10
+ ## 概述
11
+
12
+ `dsh-tool-terminal` 基于持久终端会话为模型提供 6 个工具:`terminal_open`、`terminal_send`、`terminal_read`、`terminal_signal`、`terminal_close` 与 `terminal_list`。每次调用都被限制在打开该会话的那个确切 agent(智能体)内,因此即使模型获知另一个 agent 的 id,也无法操作其终端。发送可以前台运行(返回带等待原因的有界输出),也可以通过任务服务后台运行(返回 job id,用 `job_output` 收集、用 `job_kill` 停止)。结果受 `maxResultBytes` 限制,并保留在会话历史中直到压缩(compaction)。一段简短指引会告诉模型:除非确实需要终端的持久状态或交互式 stdin,否则优先使用单次工具。
13
+
14
+ ## 目录
15
+
16
+ - [使用本包](#use-this-package)
17
+ - [理解实现](#understand-the-implementation)
18
+ - [进一步探索](#further-exploration)
19
+ - [模型体验](#model-experience)
20
+ - [已知限制与延期工作](#known-limitations-and-deferred-work)
21
+ - [开发备注](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## 使用本包
27
+
28
+ 当组合挂载了终端后端、且模型应当能跨调用使用终端状态时启用这些工具——逐步调试 gdb、在 REPL 中探索,或中断前台命令后回到 shell。指引章节会引导模型对确有界操作使用单次 bash、read、write 与 edit 工具。
29
+
30
+ ### 六个工具
31
+
32
+ | 工具 | 作用 | 结果 |
33
+ |---|---|---|
34
+ | `terminal_open` | 按后端类型创建限定所有者范围的会话 | 会话 id、名称、类型、pid、状态与有界启动输出 |
35
+ | `terminal_send` | 写入文本,可选地提交 Enter,并等待就绪——或启动后台任务 | 有界输出加等待与会话状态,或一个 job id |
36
+ | `terminal_read` | 不发送输入,读取一页有界保留输出 | 带行分页元数据的文本 |
37
+ | `terminal_signal` | 向前台进程组投递一个允许的信号 | `delivered` 加目标进程组 id |
38
+ | `terminal_close` | 关闭会话并等待其进程树结束 | 已关闭或正在关闭的结果 |
39
+ | `terminal_list` | 列出调用方的活跃会话 | 限定所有者范围的会话摘要 |
40
+
41
+ ### 组合方式
42
+
43
+ ```yaml
44
+ - name: '@deepseek-ai/dsh-terminal'
45
+ - name: '@deepseek-ai/dsh-terminal-bash'
46
+ - name: '@deepseek-ai/dsh-tool-terminal'
47
+ ```
48
+
49
+ 工具需要 `ctx.terminals`——必须挂载一个后端——以及用于指引章节的系统提示词服务。后台发送还额外要求任务服务及其面向模型的控制器(`@deepseek-ai/dsh-tool-jobs`)。
50
+
51
+ ### 配置
52
+
53
+ | 字段 | 默认值 | 含义 |
54
+ |---|---|---|
55
+ | `enableRunInBackground` | `true` | 公开并接受 `run_in_background`;设为 `false` 时移除 schema 字段并拒绝该参数 |
56
+ | `maxResultBytes` | `262144` | 每个完整终端结果的 UTF-8 上限(最小值 `64`);在等待、会话、分页、截断与任务状态元数据全部加入后计算 |
57
+
58
+ 生成的[配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-tool-terminal)与[工具目录](../../../docs/tool-catalog.zh.md#deepseek-aidsh-tool-terminal)是配置字段与 schema 的穷尽式真源。
59
+
60
+ ### 后台发送
61
+
62
+ `terminal_send(run_in_background: true)` 立即返回 job id,而不是等待。任务用 `job_output` 收集——它会等待并读取增量输出——用 `job_kill` 停止,后者向前台进程组投递真正的 `SIGINT`。缺少任务接口面时,后台模式会在写入输入之前失败。
63
+
64
+ ### 可观察结果与失败
65
+
66
+ 前台发送返回终端的新输出以及 `wait: <原因>` 与会话状态;`session_exit` 表示顶层 shell 已退出,而 `inferred_idle` 或 `timeout` 绝不证明前台命令已退出。用未注册的后端类型打开会话会失败。大于 `maxResultBytes` 的结果会在 UTF-8 边界处截断并附标记。
67
+
68
+ -----
6
69
 
7
- `terminal_send(run_in_background: true)` 会复用 `ctx.jobs`;任务预检和 PTY 服务对每个会话的独占发送预留都发生在返回 job id 之前。系统通过 `job_output` 收集完成结果,`job_kill` 则向前台进程组发送 `SIGINT`。前台发送使用终端调用/结果卡片。后台发送使用通用执行卡片;打开、读取、发送信号、关闭和列出操作则分别使用通用 `execute`、`read`、`execute`、`delete` 和 `read` 卡片。所有操作都不声明源位置。
70
+ <a id="understand-the-implementation"></a>
71
+ ## 理解实现
8
72
 
9
- ## 配置
73
+ <details>
74
+ <summary>实现细节——点击展开</summary>
10
75
 
11
- | 键 | 默认值 | 含义 |
12
- |---|---:|---|
13
- | `enableRunInBackground` | `true` | 公开并接受 `run_in_background`;设为 false 时,schema 会省略该字段,并拒绝强行传入未声明的参数 |
14
- | `maxResultBytes` | `262144` | 每个完整终端结果或 PTY 任务输出的 UTF-8 上限(最小值 `64`);在等待、会话、分页、截断和任务状态元数据全部加入后计算 |
76
+ 本节解释工具背后的设计并指出实现它们的代码位置;可观察行为已在[使用本包](#use-this-package)中说明。
15
77
 
16
- 两个值都会在加载时验证。最小结果上限可保证注册表签发的每个会话或 job id 都能出现在创建确认中。结果超过 `maxResultBytes` 时,只要空间允许,渲染会为控制元数据和截断标记预留空间;截断会保留 UTF-8 边界。每个终端定义的最终内容回调都会应用同一个上限,涵盖经过规范化的 pre-execute、around-execute 与 post-execute 策略失败、拒绝、短路、替换或阻止;结构化的多块策略结果保留其结构。
78
+ ### 设计理念
17
79
 
80
+ 本包是薄适配层:6 个工具以执行 agent 作为所有者转发到 `ctx.terminals`,呈现层渲染有界结果。后台发送把在途操作注册到 `ctx.jobs`,由通用任务接口面负责等待、增量读取与 `SIGINT` 投递。
81
+
82
+ ### 源码地图
83
+
84
+ | 文件 | 职责 |
85
+ |---|---|
86
+ | [`src/index.ts`](src/index.ts) | 6 个工具定义、schema、指引章节、后台任务集成 |
87
+ | [`src/render.ts`](src/render.ts) | 结果渲染与完整结果的 UTF-8 上限 |
88
+
89
+ ### 结果上限
90
+
91
+ 每个终端自身的单文本结果都会在规范化后的工具或流水线错误、策略拒绝与短路、替换与阻止、以及通用任务状态文本之后,受 `maxResultBytes` 限制;截断保留 UTF-8 边界并为截断标记预留空间。结构化的多块策略结果保留其结构。64 字节的最小上限保证注册表签发的每个会话或 job id 都出现在创建确认中。
92
+
93
+ ### UI 呈现意图
94
+
95
+ 前台发送使用终端调用与结果卡片;后台发送与其他 5 个工具使用通用 `execute`、`read` 或 `delete` 卡片。所有工具都不输出源位置。
96
+
97
+ </details>
98
+
99
+ -----
100
+
101
+ <a id="further-exploration"></a>
102
+ ## 进一步探索
103
+
104
+ 当包级约定不够用时阅读以下页面。它们从生成的 schema 进入服务约定、后端与后台任务接口面。
105
+
106
+ - [工具目录](../../../docs/tool-catalog.zh.md#deepseek-aidsh-tool-terminal)——6 个生成的 schema 与结果形态。
107
+ - [终端子系统参考](../../../docs/subsystems/terminal.zh.md)——工具背后的服务约定与共享类型。
108
+ - [terminal 服务](../terminal/README.zh.md)——会话操作、所有者限制与清理语义。
109
+ - [terminal-bash 后端](../terminal-bash/README.zh.md)——提供会话的随附 shell 后端。
110
+ - [jobs 包映射](../../jobs/README.zh.md)——收集与停止后台发送的后台任务接口面。
111
+ - [持久 PTY Agent Note](../../../.agents/notes/implemented/feature/2026-07-16-persistent-pty-sessions.zh.md)——能力设计与暂缓边界。
112
+
113
+ -----
114
+
115
+ <a id="model-experience"></a>
18
116
  ## 模型体验
19
117
 
20
118
  ### 系统提示词
21
119
 
22
- #### 模型看到的内容
120
+ #### 模型看到什么
23
121
 
24
122
  该插件贡献以下固定指引章节:
25
123
 
@@ -35,11 +133,11 @@ Use a terminal session only when work needs persistent terminal state or interac
35
133
 
36
134
  #### KV Cache 影响
37
135
 
38
- 注册范围和指引文本不变时,前缀保持稳定。
136
+ 注册范围与指引文本不变时,前缀保持稳定。
39
137
 
40
138
  ### 工具 schema
41
139
 
42
- #### 模型看到的内容
140
+ #### 模型看到什么
43
141
 
44
142
  6 个生成的 schema 列在 [`dsh-tool-terminal` 目录章节](../../../docs/tool-catalog.zh.md#deepseek-aidsh-tool-terminal)中。此插件活跃时,请求中会包含它们的固定 schema token;按 agent 范围过滤工具时可能隐藏这些 schema。
45
143
 
@@ -53,19 +151,34 @@ Use a terminal session only when work needs persistent terminal state or interac
53
151
 
54
152
  ### 工具结果与任务上下文
55
153
 
56
- #### 模型看到的内容
154
+ #### 模型看到什么
57
155
 
58
- spawn 会返回 id 和有界 MOTD。发送/读取会返回有界终端文本以及就绪/历史标记。后台模式返回通用 job id。所有终端自身或策略产生的单文本结果,在经过规范化的工具或流水线错误、拒绝、短路、替换、阻止与通用任务状态文本之后,都受 `maxResultBytes` 限制。结构化的多块策略结果保留其结构。结果会保留在会话历史中直到压缩(compaction);增量任务读取不会重复已经消费的输出。编程调用方会收到带类型的会话快照、有界的提供方读取/发送 DTO、信号与关闭结果,或 `{ kind: "background", jobId }`;Native 渲染会应用上述呈现上限。
156
+ spawn 返回 id 与有界启动输出。发送与读取返回有界终端文本以及就绪与历史标记。后台模式返回通用 job id。每个终端自身的单文本结果都受 `maxResultBytes` 限制;结果保留在会话历史中直到压缩,增量任务读取不会重复已经消费的输出。
59
157
 
60
158
  #### Token 影响
61
159
 
62
- 终端自身与策略产生的单文本结果随数据变化,并受 `maxResultBytes` 限制;如果策略有意替换为结构化多块内容,则由该策略负责限制内容。每个返回结果都会保留在历史中直到压缩。
160
+ 终端自身的结果随数据变化,并受 `maxResultBytes` 限制;每个返回结果都保留在历史中直到压缩。
63
161
 
64
162
  #### KV Cache 影响
65
163
 
66
164
  仅追加;新结果位于可复用请求前缀之后。
67
165
 
68
- ## 已知限制与暂缓事项
166
+ ## 已知限制与延期工作
167
+
168
+ <a id="known-limitations-and-deferred-work"></a>
169
+
170
+
171
+ 这些限制说明缺失的面向模型接口面。它们是当前包约束,不是任务积压。
172
+
173
+ - **没有 TUI 或按键序列接口面**——具名按键序列、全屏 TUI 交互、BEL、调整大小与自动启动均未出现在任何 schema 中。
174
+ - **后台模式要求任务接口面**——`run_in_background` 同时需要 `@deepseek-ai/dsh-jobs` 及其面向模型的控制器(`@deepseek-ai/dsh-tool-jobs`);缺少时会拒绝该参数。
175
+
176
+ <a id="dev-note"></a>
177
+ ### 开发备注
178
+
179
+ <details>
180
+ <summary>维护者的工作上下文——点击展开</summary>
181
+
182
+ 无。
69
183
 
70
- - 不公开具名按键序列、TUI、BEL、调整大小、自动启动或跨 agent 共享 schema。
71
- - 后台模式同时依赖 `@deepseek-ai/dsh-jobs` 及其面向模型的控制器。
184
+ </details>
package/lib/index.js CHANGED
@@ -222,7 +222,7 @@ function apply(ctx, config = {}) {
222
222
  };
223
223
  ctx.systemPrompt.section({
224
224
  name: "tool:pty",
225
- order: 106,
225
+ order: ctx.systemPrompt.getSectionOrder("TOOL_PTY"),
226
226
  text: "Use a terminal session only when work needs persistent terminal state or interactive stdin; prefer shell/read/write/edit for bounded one-shot operations. Track every terminal session id and close sessions that no longer matter. An inferred_idle or timeout result does not prove the foreground command exited."
227
227
  });
228
228
  ctx.tools.register(defineTool({
package/package.json CHANGED
@@ -1,7 +1,7 @@
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.1.1-rc.2",
4
+ "version": "0.1.2-alpha.3",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -32,37 +32,38 @@
32
32
  ],
33
33
  "license": "MIT",
34
34
  "dependencies": {
35
- "@deepseek-ai/schemastery": "^3.18.1"
35
+ "@deepseek-ai/schemastery": "^3.18.2"
36
36
  },
37
37
  "peerDependencies": {
38
- "@deepseek-ai/dsh-agent": "^0.1.1-rc.2",
39
- "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
40
- "@deepseek-ai/dsh-llm": "^0.1.1-rc.2",
41
- "@deepseek-ai/dsh-terminal": "^0.1.1-rc.2",
42
- "@deepseek-ai/dsh-output-retention": "^0.1.1-rc.2",
43
- "@deepseek-ai/dsh-jobs": "^0.1.1-rc.2",
44
- "@deepseek-ai/dsh-system-prompt": "^0.1.1-rc.2",
45
- "@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
46
- "@deepseek-ai/cordis": "^4.0.1"
38
+ "@deepseek-ai/dsh-agent": "^0.1.2-alpha.3",
39
+ "@deepseek-ai/dsh-invariants": "^0.1.2-alpha.3",
40
+ "@deepseek-ai/dsh-terminal": "^0.1.2-alpha.3",
41
+ "@deepseek-ai/dsh-llm": "^0.1.2-alpha.3",
42
+ "@deepseek-ai/dsh-output-retention": "^0.1.2-alpha.3",
43
+ "@deepseek-ai/dsh-system-prompt": "^0.1.2-alpha.3",
44
+ "@deepseek-ai/dsh-jobs": "^0.1.2-alpha.3",
45
+ "@deepseek-ai/dsh-tools": "^0.1.2-alpha.3",
46
+ "@deepseek-ai/cordis": "^4.0.2"
47
47
  },
48
48
  "devDependencies": {
49
- "@deepseek-ai/cordis-plugin-include": "^1.0.6",
50
- "@deepseek-ai/cordis-plugin-loader": "^1.0.2",
51
- "@deepseek-ai/dsh-agent": "^0.1.1-rc.2",
52
- "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
53
- "@deepseek-ai/dsh-llm": "^0.1.1-rc.2",
54
- "@deepseek-ai/dsh-terminal": "^0.1.1-rc.2",
55
- "@deepseek-ai/dsh-terminal-bash": "^0.1.1-rc.2",
56
- "@deepseek-ai/dsh-output-retention": "^0.1.1-rc.2",
57
- "@deepseek-ai/dsh-sandbox": "^0.1.1-rc.2",
58
- "@deepseek-ai/dsh-sandbox-policy": "^0.1.1-rc.2",
59
- "@deepseek-ai/dsh-session": "^0.1.1-rc.2",
60
- "@deepseek-ai/dsh-subprocess-local": "^0.1.1-rc.2",
61
- "@deepseek-ai/dsh-system-prompt": "^0.1.1-rc.2",
62
- "@deepseek-ai/dsh-jobs": "^0.1.1-rc.2",
63
- "@deepseek-ai/dsh-jobs-local": "^0.1.1-rc.2",
64
- "@deepseek-ai/dsh-tool-jobs": "^0.1.1-rc.2",
65
- "@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
66
- "@deepseek-ai/cordis": "^4.0.1"
49
+ "@deepseek-ai/cordis-plugin-loader": "^1.0.3",
50
+ "@deepseek-ai/cordis-plugin-include": "^1.0.7",
51
+ "@deepseek-ai/dsh-agent": "^0.1.2-alpha.3",
52
+ "@deepseek-ai/dsh-invariants": "^0.1.2-alpha.3",
53
+ "@deepseek-ai/dsh-llm": "^0.1.2-alpha.3",
54
+ "@deepseek-ai/dsh-terminal-bash": "^0.1.2-alpha.3",
55
+ "@deepseek-ai/dsh-sandbox": "^0.1.2-alpha.3",
56
+ "@deepseek-ai/dsh-output-retention": "^0.1.2-alpha.3",
57
+ "@deepseek-ai/dsh-terminal": "^0.1.2-alpha.3",
58
+ "@deepseek-ai/dsh-session": "^0.1.2-alpha.3",
59
+ "@deepseek-ai/dsh-subprocess-local": "^0.1.2-alpha.3",
60
+ "@deepseek-ai/dsh-system-prompt": "^0.1.2-alpha.3",
61
+ "@deepseek-ai/dsh-jobs": "^0.1.2-alpha.3",
62
+ "@deepseek-ai/dsh-jobs-local": "^0.1.2-alpha.3",
63
+ "@deepseek-ai/dsh-tool-jobs": "^0.1.2-alpha.3",
64
+ "@deepseek-ai/dsh-tools": "^0.1.2-alpha.3",
65
+ "@deepseek-ai/cordis": "^4.0.2",
66
+ "@deepseek-ai/dsh-session-projection": "^0.1.2-alpha.3",
67
+ "@deepseek-ai/dsh-sandbox-policy": "^0.1.2-alpha.3"
67
68
  }
68
69
  }