dsh-deep-ptc-mode 1.9.0 → 1.9.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/CHANGELOG.md +19 -0
- package/COMPATIBILITY.md +56 -0
- package/README.md +17 -9
- package/README.zh.md +17 -9
- package/TEST_REPORT.md +7 -1
- package/lib/client.js +153 -41
- package/lib/session-preset.mjs +9 -0
- package/lib/skill-card.mjs +6 -2
- package/lib/skill-context.mjs +6 -11
- package/lib/ssh.mjs +3 -1
- package/lib/tool-policy.mjs +6 -1
- package/lib/tool-state.mjs +2 -2
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.9.2 — 2026-11-12
|
|
4
|
+
|
|
5
|
+
- 文档与简介说明 DrawAI 绘图、归藏设计技能、Agentero 论文工具、dsh-ops 执行环境及 DSH Go 连接辅助的协作方式,并标明验证范围。26 个真实工具通过隔离注册、发现、选用和宿主双语言 SDK 渲染;DrawAI 的文件编辑、SVG 导出和 revision 冲突保护通过。统一分类层将明确的并发编辑冲突归为输入状态过旧,修复连续旧 revision 拒写导致工具误隔离;保留实现缺陷、不可用和部分完成的处理。
|
|
6
|
+
- Document the workflows and verification limits for DrawAI diagrams, guizang-design skills, Agentero paper tools, dsh-ops execution environments and DSH Go connection assistance. Twenty-six actual tools passed isolated interface checks and both host SDK renderers. DrawAI file edits, SVG export and revision-conflict protection passed. Classify explicit optimistic-lock conflicts as stale input so repeated safe rejections cannot quarantine a working editor; retain defect, unavailability and partial-effect handling.
|
|
7
|
+
|
|
8
|
+
- 面板回到对话区侧边,保留输入框下方的胶囊,使用布局事件更新位置。旧侧栏页签显示迁移提示。
|
|
9
|
+
- 命令与 Skill 投影跟随宿主当前预设选择,修复空白会话先创建再选择 Deep PTC 时的模式门禁。
|
|
10
|
+
- 通用 SSH 增加检查命令复制,并提供按需复制的 DSH Go 连接资料。
|
|
11
|
+
|
|
12
|
+
- Restore the conversation-side panel and retain the capsule below the composer. Layout events update its position. Old sidebar tabs show a migration hint.
|
|
13
|
+
- Follow the host's current preset selection in command gates and the skill projection, including a blank session switched to Deep PTC after creation.
|
|
14
|
+
- Add a general SSH check-command copy action and optional DSH Go connection details.
|
|
15
|
+
|
|
16
|
+
## 1.9.1 — 2026-11-11
|
|
17
|
+
|
|
18
|
+
- 更新 npm 与 DSH 插件管理器中的简介:写明右侧栏面板(子代理、后台任务、输出文件、SSH 连接)以及对官方与第三方插件的兼容;README 的「五个基本问题」补充新的提问与工作纪律规则。代码与 1.9.0 相同。
|
|
19
|
+
|
|
20
|
+
- The npm and DSH plugin-manager descriptions now cover the right-sidebar panel (subagents, background jobs, output files, SSH connections) and compatibility with official and third-party plugins; the README's five basic problems include the new asking and work-discipline rules. The code is unchanged from 1.9.0.
|
|
21
|
+
|
|
3
22
|
## 1.9.0 — 2026-11-11
|
|
4
23
|
|
|
5
24
|
- 面板移入 DSH 官方入口:设置里新增独立的「深度 PTC」页(执行环境、界面特效、可复制的诊断信息);右侧栏新增「深度 PTC」页签,也出现在右侧栏的新建页签引导中,停靠、浮动、全屏由 DSH 管理;输入框下方的小胶囊打开它,没有右侧栏的宿主在原地展开。原来悬浮的侧边卡片、挤压对话区的停靠列和右上角胶囊全部移除,右侧栏全屏时不再残留悬浮胶囊(#11),也不再遮挡消息(#12)。
|
package/COMPATIBILITY.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# 插件协作与验证范围 / Plugin workflows and verification
|
|
2
|
+
|
|
3
|
+
Deep PTC **1.9.2** · 核对日期:2026-11-12。接口验证使用 DSH Desktop 0.2.2-rc.2 的校验器与 SDK 渲染器、内嵌 Node 24.21.0。
|
|
4
|
+
|
|
5
|
+
## 可以配合完成哪些工作
|
|
6
|
+
|
|
7
|
+
插件需要安装在 Deep PTC 所在的同一运行配置中,并完成各自要求的账号、CLI 或服务设置。下表按实际工作流说明配合方式和已有证据。
|
|
8
|
+
|
|
9
|
+
| 插件及核对版本 | 在 Deep PTC 任务中的作用 | 验证范围 |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| [DrawAI](https://github.com/fourzkw/dsh-drawai) 0.4.6 | 读取和修改画布,在讨论、编码或整理需求时制作流程图与架构图,再导出 SVG 交付 | 实际注册 19 个工具和 2 条内嵌技能;读图→改图→回读、SVG 导出通过。连续旧 revision 拒写后工具仍可用,新 revision 写入通过。浏览器画面、PNG、语音及视频渲染未做端到端验证 |
|
|
12
|
+
| [归藏设计](https://github.com/op7418/dsh-guizang-design) 0.1.4 | 按需读取页面、PPT、图文卡片、文案润色与语气技能,并使用作品库和语气工具,把任务内容整理为设计交付物 | 实际注册 2 个工具;5 条技能可列出并读取全文。工具经过 Deep PTC 发现、选用及宿主 SDK 渲染。技能中的脚本、浏览器缩略图和设计生成未做端到端验证 |
|
|
13
|
+
| [Agentero](https://github.com/poco-ai/agentero-dsh-plugin) 0.1.8 | 在论文阅读和研究任务中选用论文列表、导入、笔记读取/搜索和 arXiv 发现工具 | host 的实际注册函数提供 5 个工具;参数校验、发现、选用及宿主 SDK 渲染通过。需配置 Agentero CLI 与论文库;未联网导入论文、翻译或执行外部 CLI |
|
|
14
|
+
| dsh-ops:实际包验证 0.5.0,源码研究 0.5.4 | 让依赖官方预设 ID 的执行环境在 Deep PTC 会话中识别为 PTC;Niubash 可作为 Windows 原生 Bash 后端 | 既有真实包预设识别路径及 Windows Niubash 命令验证通过,见 [1.9.0 记录](CHANGELOG.md#190--2026-11-11)。本轮未重做其全部业务验证 |
|
|
15
|
+
| DSH Go / dsh-go | 保持屏幕控制工具初始可用,配合 Deep PTC 的任务处理;需要 SSH 时可复制主机、端口、用户等连接资料 | 屏幕工具保留规则和资料复制有自动化覆盖。手机连接、认证和隧道由 DSH Go 管理;未连接真实手机或 SSH 主机 |
|
|
16
|
+
| [dsh-context](https://github.com/bowenliang123/dsh-context) 0.83.1 | 按当前 Agent 的服务读取 Skill 信息,便于检查 Deep PTC 会话的上下文 | 已核对 `agentPresets.serviceFor(agent, 'skills')` 读取路径。属于源码接口核对,图表和 Token 统计未做实机验证 |
|
|
17
|
+
|
|
18
|
+
“隔离接口验证”使用已发布包的真实注册函数、工具代码和宿主参数/SDK 实现,其余服务上下文为模拟。它证明所列调用路径可用,不代表插件的全部业务功能已验收。
|
|
19
|
+
|
|
20
|
+
## DrawAI 的调用方式
|
|
21
|
+
|
|
22
|
+
选择 Deep PTC 后,DrawAI 仍注册自己的工具和技能。Deep PTC 通过现有通用目录接入,保留完整工具定义。
|
|
23
|
+
|
|
24
|
+
1. 发现所需画布/视频能力,再选用工具。`diagram_apply` 定义较大时,通过现有完整 SDK 披露机制接入,不截断参数。
|
|
25
|
+
2. 修改前调用 `diagram_read`,将返回的 `revision` 交给 `diagram_apply.expectRevision`。DrawAI 的并发保护继续拒绝过旧版本,Deep PTC 将明确的 revision/ETag 冲突归为输入状态过旧,允许重读,不累计工具故障。
|
|
26
|
+
3. 交付矢量图时可调用 `diagram_export`,无需打开浏览器画布。该 SVG 是宿主侧的近似重绘,视觉验收仍需浏览器画布。
|
|
27
|
+
4. 视频和其他异步任务由 DrawAI 自己的状态工具管理。其任务 ID 不转换成 Harness job ID,也不保证出现在 Deep PTC 后台任务卡片中。
|
|
28
|
+
5. `pending`、`not-open`、`timeout` 等正常返回状态不等同于工具实现故障。缺少附件/图像服务的隔离环境返回 `look.status="unsupported"`,读图和改图仍正常。
|
|
29
|
+
|
|
30
|
+
## SSH 与 DSH Go
|
|
31
|
+
|
|
32
|
+
SSH 辅助也服务于日常远程命令、文件传输和端口转发。面板可以复制非交互 SSH 检查命令;模型沿用认证失败即停、长任务转后台、隧道显式绑定回环地址的规则。
|
|
33
|
+
|
|
34
|
+
DSH Go 的连接资料是额外便利:按远端系统选择托管启动或连接已有服务,使用实际服务端口,并在客户端配置认证。复制资料不会发起连接,也不会收集或修改密钥。
|
|
35
|
+
|
|
36
|
+
## 界面与轻量化
|
|
37
|
+
|
|
38
|
+
外观重叠时,可关闭 Deep PTC 额外界面特效,必要时收起对话侧边面板。关闭特效不修改其他插件的工具注册与执行方式。
|
|
39
|
+
|
|
40
|
+
本版没有为这些插件增加运行时依赖、轮询、固定常驻工具清单或每款插件专属提示词。只有用户选择 Deep PTC 的会话使用其适配逻辑;第三方自身的权限、沙箱和运行条件仍生效。
|
|
41
|
+
|
|
42
|
+
## 验证与来源
|
|
43
|
+
|
|
44
|
+
- npm 固定版本发布包经过 SHA-512 校验,仅在忽略目录中解包;第三方安装脚本未执行,也未安装到用户日常 profile。
|
|
45
|
+
- DrawAI、归藏设计和 Agentero host 合计 26 个真实工具通过宿主 JSON Schema 校验、Deep PTC 发现/选用及 TypeScript / Python SDK 渲染;7 条技能全文读取通过。
|
|
46
|
+
- 在临时工作区复现并发编辑问题:修复前,三次旧 revision 拒写会误隔离 `diagram_apply`;修复后同样三次拒写保持文件不变,工具仍可调用,新 revision 写入通过。临时文件在验证后清理。
|
|
47
|
+
- 新增两项错误分类回归。完整 199 项自动化测试通过;缺模块、实现缺陷及明确部分完成仍保持原分类。
|
|
48
|
+
- 归藏设计、context 和 Agentero 的推荐来源可追溯到官方 11 月 8 日文章:[原文](https://x.com/DeepSeekHarness/status/2119431663642153128)、[保留原作者与编号的正文镜像](https://threadnavigator.com/thread/2119431663642153128/)。原文在核对时返回 403,正文通过镜像读取。DrawAI 是 fourzkw 的社区项目。本表不代表官方对 Deep PTC 的认证。
|
|
49
|
+
|
|
50
|
+
## English
|
|
51
|
+
|
|
52
|
+
Deep PTC 1.9.2 can use DrawAI for diagram editing and SVG delivery, guizang-design for design/writing skills and library tools, and Agentero for paper/note tools. dsh-ops supplies compatible execution environments, DSH Go can combine screen tools with SSH connection assistance, and dsh-context can inspect skills through the current Agent's service.
|
|
53
|
+
|
|
54
|
+
Twenty-six published DrawAI 0.4.6, guizang-design 0.1.4 and Agentero host 0.1.8 tool definitions passed isolated registration, host 0.2.2-rc.2 schema validation, Deep PTC discovery/selection and both host SDK renderers. Seven skill contents were readable. DrawAI read/edit/readback, SVG export and repeated stale-revision rejection followed by a fresh-revision write passed. The generic conflict-classification fix preserves unavailable-provider, defect and partial-effect handling. All 199 automated tests pass.
|
|
55
|
+
|
|
56
|
+
The table distinguishes those checks from prior dsh-ops evidence, automated DSH Go rules and source-only context inspection. Browser visuals, design generation, external paper CLI workflows, real phone/SSH connections, PNG and video rendering were not validated end to end. Plugins retain their own setup and authorization requirements. No runtime dependencies, polling or vendor-specific resident tool lists were added.
|
package/README.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# Deep PTC mode
|
|
2
2
|
|
|
3
|
-
[中文](README.zh.md) · MIT · **1.9.
|
|
3
|
+
[中文](README.zh.md) · MIT · **1.9.2**
|
|
4
4
|
|
|
5
|
-
[Changelog](CHANGELOG.md) · [Test report](TEST_REPORT.md)
|
|
5
|
+
[Changelog](CHANGELOG.md) · [Test report](TEST_REPORT.md) · [Plugin workflows and verification](COMPATIBILITY.md)
|
|
6
6
|
|
|
7
7
|
Deep PTC is a DeepSeek Harness agent mode with progress reports, clarifying questions, task-size planning, and interruptible background work. It builds on the installed official PTC preset with selectable shells, on-demand tools and skills, and a two-layer preset identity adapter for third-party plugins.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
The panel sits beside the conversation and shows the environment, subagents, jobs, output files, SSH connections and tool state. The capsule below the composer expands or collapses it. Deep PTC also has its own settings page. Visual effects are lightweight and start off when an appearance plugin is installed.
|
|
10
10
|
|
|
11
11
|
## Five basic problems
|
|
12
12
|
|
|
13
13
|
| # | Problem | What Deep PTC does |
|
|
14
14
|
| --- | --- | --- |
|
|
15
15
|
| 1 | **Working silently without reporting** | One sentence before every `run_code`; a longer update at milestones; never more than two or three silent tool calls; a short final result with failed tools and providers. |
|
|
16
|
-
| 2 | **Guessing instead of asking** | Meaning belongs to the user, facts to the tools: ask one to three questions with options when names, targets, routes, scope or acceptance criteria are unclear;
|
|
16
|
+
| 2 | **Guessing instead of asking** | Meaning belongs to the user, facts to the tools: ask one to three questions with options when names, targets, routes, scope or acceptance criteria are unclear; an unfamiliar term is asked about first and researched only when the user does not know it; inspectable facts are looked up. The user's statements outrank the model's prior beliefs: no silent change of approach, every part of a request checked off, nothing unverified reported as verified. |
|
|
17
17
|
| 3 | **Sleeping or becoming unreachable** | Enforced in code: foreground waits move to the background after 30 s; a user message hands the waiting command to the background within about 2 s; foreground sleeps over 5 s are refused; job completion wakes the model. |
|
|
18
18
|
| 4 | **No plan, or an invisible plan** | Plan by estimated size: act silently under 5 minutes; show the plan and start without approval for 5–20 minutes; show it and wait for approval over 20 minutes. Re-plan when the estimate moves up; the user can redirect at any step. |
|
|
19
19
|
| 5 | **Not using the concise context and unlimited-token prompt** | Derive from the live official PTC composition, keep the tool catalog compact and load full schemas on demand, and state that this mode spends its token budget on reads, searches, commands and checks rather than rationing them. The prompt does not change billing or the real token limit. |
|
|
@@ -67,14 +67,14 @@ After each turn, a card at the end of that turn in the conversation (where offic
|
|
|
67
67
|
The Deep PTC mode label, settings, and conversation UI switch between Chinese and English with DSH **Settings → General → Language**. Every entry point uses an official DSH extension point; the plugin changes no host layout and registers no keyboard shortcuts.
|
|
68
68
|
|
|
69
69
|
- **Settings → Deep PTC**: execution environment and shell, the visual effects switch, and copyable diagnostics to attach to interface bug reports.
|
|
70
|
-
- **The Deep PTC
|
|
70
|
+
- **The Deep PTC panel beside the conversation** is open by default when there is room. It follows the conversation width and hides under a fullscreen native sidebar. On narrow screens the bottom capsule expands it.
|
|
71
71
|
- **Execution environment**: WSL, PowerShell, native Bash or Zsh, for newly created Deep PTC sessions.
|
|
72
72
|
- **Subagents**: name, state, duration and tokens; a row opens that subagent's chat in the official right sidebar.
|
|
73
73
|
- **Background jobs**: six positions, up to five active jobs first and up to three finished jobs; overflow folds into one expandable row.
|
|
74
74
|
- **Output files**: files this conversation wrote or delivered, newest first, in three positions; overflow folds into one of them. The rule matches DSH's own deliverables card and also counts files written from `run_code`.
|
|
75
75
|
- **SSH connections**: hosts this conversation reached, with their outcome, and the host aliases in `~/.ssh/config`.
|
|
76
76
|
- **Tool state**: the "Reload all tool states" button and, when present, the failed external tools.
|
|
77
|
-
- **The capsule under the composer** shows the environment, subagent count and tool notices, and
|
|
77
|
+
- **The capsule under the composer** shows the environment, subagent count and tool notices, and toggles the independent side panel. Saved 1.9.0 sidebar tabs show a migration hint.
|
|
78
78
|
|
|
79
79
|
Visual effects apply **only while the conversation on screen is a Deep PTC session**: calmer light and dark colours and fonts, a hairline on the focused composer, a blue gradient send button, soft blue user bubbles, pointer spotlight, click ripple, a magnetic send button; while running, a glowing composer, a send-button ring and sparks rising above the composer.
|
|
80
80
|
|
|
@@ -84,6 +84,10 @@ Visual effects apply **only while the conversation on screen is a Deep PTC sessi
|
|
|
84
84
|
|
|
85
85
|
## SSH
|
|
86
86
|
|
|
87
|
+
The panel can copy a general SSH check command or DSH Go connection details. Normal SSH, SCP, SFTP and forwarding work uses OpenSSH. DSH Go can start managed `dsh web` on a POSIX remote host, or attach to an existing service on Windows. Use the actual service port and configure authentication in the client. Copying these details prepares information.
|
|
88
|
+
|
|
89
|
+
DSH allows a blank session to select another preset before its first turn starts. It locks that choice once a turn has started. Deep PTC command gates follow the host's current selection, which is also used by the UI.
|
|
90
|
+
|
|
87
91
|
Deep PTC reaches external hosts through the local OpenSSH client in the selected environment's shell; it adds no transport of its own. The model is told where the client is, which host aliases `~/.ssh/config` defines (names, addresses, users and ports only, never keys), and how to use them: always non-interactive (`BatchMode=yes`, a connect timeout), no interactive remote shell, never waiting for a password or host-key prompt; on an authentication failure it stops and tells you instead of trying other credentials or disabling host-key checking; long remote work runs as a background job. In WSL, SSH runs inside the distribution with its own `~/.ssh`.
|
|
88
92
|
|
|
89
93
|
## 1.7.2: lightweight, on-demand tool orchestration
|
|
@@ -167,6 +171,10 @@ The lab is an environment for designing and trying a plugin in this process: ins
|
|
|
167
171
|
|
|
168
172
|
## dsh-go and other external tools
|
|
169
173
|
|
|
174
|
+
Deep PTC can use other plugins within the same task: **DrawAI** reads, edits and exports diagrams; **guizang-design** supplies page, slide, social-card and writing skills; **Agentero** supplies paper and note tools; **dsh-ops** recognizes the preset for its execution environments; and **DSH Go** receives screen-tool availability and SSH connection assistance. **dsh-context** can read skills from the current Agent's service for context inspection.
|
|
175
|
+
|
|
176
|
+
Version 1.9.2 prevents repeated stale-revision rejections from quarantining a working editor. Twenty-six actual DrawAI, guizang-design and Agentero host tools passed isolated interface checks; DrawAI file editing and SVG export also passed. Design generation, the paper CLI, phone connections and video rendering have their own dependencies and verification limits. See the [plugin workflow details](COMPATIBILITY.md).
|
|
177
|
+
|
|
170
178
|
External plugins are discovered from what they actually register. Tools and workflows are chosen by capability first. Official PTC tools stay available and are the fallback when a third-party tool fails. No external plugin, including dsh-go, is a dependency of this package.
|
|
171
179
|
|
|
172
180
|
**dsh-go** (the phone app and its screen-control surface) stays usable inside a Deep PTC session:
|
|
@@ -206,10 +214,10 @@ A prompt changes the model's working tendency, not the real token limit or billi
|
|
|
206
214
|
Requires Node `>=24` and DSH `>=0.2.2-rc.1`. The installer rejects the current package on DSH `0.2.1-rc.5` based on its manifest. macOS/Zsh checks cover configuration, argv and tool mounting.
|
|
207
215
|
|
|
208
216
|
```js
|
|
209
|
-
plugin_manager({ action: "install_bundle", target: "dsh-deep-ptc-mode@1.9.
|
|
217
|
+
plugin_manager({ action: "install_bundle", target: "dsh-deep-ptc-mode@1.9.2" })
|
|
210
218
|
// Or from a local checkout or archive:
|
|
211
219
|
plugin_manager({ action: "install_bundle", target: "C:\\path\\to\\dsh-deep-ptc-mode" })
|
|
212
|
-
// Or target: "C:\\path\\to\\dsh-deep-ptc-mode-1.9.
|
|
220
|
+
// Or target: "C:\\path\\to\\dsh-deep-ptc-mode-1.9.2.tgz"
|
|
213
221
|
```
|
|
214
222
|
|
|
215
223
|
Repository locator: `github:lishize20040802-rgb/dsh-deep-ptc-mode`. It installs content actually published there; a local upgrade does not publish to GitHub or npm.
|
|
@@ -232,7 +240,7 @@ Prefer the UI, which uses revisioned, atomic Host form writes.
|
|
|
232
240
|
|
|
233
241
|
## Mode isolation
|
|
234
242
|
|
|
235
|
-
|
|
243
|
+
Runtime features serve sessions currently selected as `deep-ptc`. The preset mounts its tool directory, tool state and execution environment. The skill projection starts from the creation header and folds valid host `agent-preset/selected` events. Commands, `agent/pre-step` and the client panel check the current selection. Other modes keep empty skill state, and a missing creation header starts inactive.
|
|
236
244
|
|
|
237
245
|
## Compatibility and development
|
|
238
246
|
|
package/README.zh.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# 深度 PTC 模式
|
|
2
2
|
|
|
3
|
-
[English](README.md) · MIT · 当前版本 **1.9.
|
|
3
|
+
[English](README.md) · MIT · 当前版本 **1.9.2**
|
|
4
4
|
|
|
5
|
-
[更新日志](CHANGELOG.md) · [测试报告](TEST_REPORT.md)
|
|
5
|
+
[更新日志](CHANGELOG.md) · [测试报告](TEST_REPORT.md) · [插件协作与验证范围](COMPATIBILITY.md)
|
|
6
6
|
|
|
7
7
|
深度 PTC 是 DeepSeek Harness 的 Agent 模式,支持进度汇报、澄清提问、按任务规模制定计划,以及可插话的后台任务。它以已安装的官方 PTC 预设为基础,提供可选执行环境、按需加载工具和 Skill,以及面向第三方插件的两层预设身份适配。
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
面板位于对话区侧边,包含执行环境、子代理、后台任务、输出文件、SSH 连接和工具状态。输入框下方保留小胶囊,用于展开和收起面板。设置里有独立的「深度 PTC」页。界面特效采用轻量渲染,检测到外观插件时默认关闭。
|
|
10
10
|
|
|
11
11
|
## 五个基本问题
|
|
12
12
|
|
|
13
13
|
| # | 基本问题 | 深度 PTC 的做法 |
|
|
14
14
|
| --- | --- | --- |
|
|
15
15
|
| 1 | **闷头干活不汇报** | 每次 `run_code` 前一句话说明要做什么;里程碑稍长汇报;连续两三个工具调用必须出声;任务结束简短列出结果、失败工具与来源。 |
|
|
16
|
-
| 2 | **有歧义先猜不问** | 意思归用户、事实归工具:不认识的名称、多个可能目标、技术路线、范围和验收标准不确定时,先问 1–3
|
|
16
|
+
| 2 | **有歧义先猜不问** | 意思归用户、事实归工具:不认识的名称、多个可能目标、技术路线、范围和验收标准不确定时,先问 1–3 个带选项的问题,推荐项在前;不认识的词先问你,你也不知道时才自己查证;可检查的事实自己查。你的说明优先于模型的既有认识,不擅自换方案,多项请求逐项核对,不虚报验证结果。 |
|
|
17
17
|
| 3 | **执行中休眠、失联** | 由代码强制:前台等待超过 30 秒自动转后台且不杀命令;你发消息时正在等待的命令约 2 秒内转后台,模型立刻看到消息;前台超过 5 秒的 sleep/Start-Sleep 直接拒绝;job 完成自动唤醒模型。 |
|
|
18
18
|
| 4 | **不做计划或计划不可见** | 按预计耗时分档:≤5 分钟内部计划直接做;5–20 分钟先展示计划,不等审批就执行;>20 分钟先给计划、等你批准。估计升档时重新说明;你可以在任一步调整方向,显式 plan mode 优先。 |
|
|
19
19
|
| 5 | **没用好简洁上下文与 unlimited token** | 预设从官方 PTC 现场派生,继承官方简洁组合;工具目录精简、完整 schema 按需加载,避免上下文被工具定义撑爆;人设写明本模式 token 预算无限、把预算花在读取/搜索/命令/验证上,同时禁止注水和啰嗦。提示词不改变实际计费或 token 上限。 |
|
|
@@ -67,14 +67,14 @@
|
|
|
67
67
|
Deep PTC 的模式名称、设置页和会话界面会随 DSH「设置 → 通用 → 语言」在中文和英文之间切换。所有入口都使用 DSH 的官方扩展点,不改宿主布局,也不注册快捷键。
|
|
68
68
|
|
|
69
69
|
- **设置 → 深度 PTC**:执行环境与 Shell、界面特效开关,以及可复制的诊断信息(反馈界面问题时附上)。
|
|
70
|
-
-
|
|
70
|
+
- **对话侧边的「深度 PTC」面板**。空间充足时默认显示,并随对话区尺寸调整。原生侧栏全屏覆盖对话时会隐藏,窄屏可通过下方胶囊展开。
|
|
71
71
|
- **执行环境**:WSL、PowerShell、原生 Bash 或 Zsh,对之后新建的深度 PTC 会话生效。
|
|
72
72
|
- **子代理**:名称、状态、用时和 token;点击在官方右侧栏打开该子代理的对话。
|
|
73
73
|
- **后台任务**:最多六个位置,运行中优先且最多五条,已结束最多三条,超出部分合为一条可展开记录。
|
|
74
74
|
- **输出文件**:本会话写入或交付的文件,最新的在前;最多三个位置,超出时折叠占一个位置。规则与 DSH 官方的交付卡片一致,并包括 `run_code` 里写入的文件。
|
|
75
75
|
- **SSH 连接**:本会话连接过的主机(成功或失败)与 `~/.ssh/config` 中的主机别名。
|
|
76
76
|
- **工具状态**:“重载所有工具状态”按钮,以及调用失败的外部工具(如有)。
|
|
77
|
-
-
|
|
77
|
+
- **输入框下方的小胶囊**显示执行环境、子代理数和工具提醒,点击展开或收起独立的侧边面板。1.9.0 保存的旧侧栏页签会显示迁移提示。
|
|
78
78
|
|
|
79
79
|
界面特效**只在当前显示的是深度 PTC 会话时生效**:更克制的明暗配色与字体、输入框聚焦细线、蓝色渐变发送键、淡蓝用户气泡、指针追光、点击涟漪、磁吸发送键;运行时输入框发光、发送键光环和输入框上方的光点。
|
|
80
80
|
|
|
@@ -86,6 +86,10 @@ Deep PTC 的模式名称、设置页和会话界面会随 DSH「设置 → 通
|
|
|
86
86
|
|
|
87
87
|
深度 PTC 通过当前执行环境的 Shell 调用本机 OpenSSH 客户端连接外部主机,不另建传输。模型会收到本机客户端位置、`~/.ssh/config` 里的主机别名(只读取名称、地址、用户和端口,不读取密钥),以及使用规则:始终非交互(`BatchMode=yes`、连接超时),不打开交互式远程 Shell,不等待密码或主机密钥确认;认证失败时停下来告诉你,不换凭据、不关闭主机密钥校验;长时间远程任务转为后台任务。WSL 环境中 SSH 在发行版内运行,使用发行版自己的 `~/.ssh`。
|
|
88
88
|
|
|
89
|
+
面板可复制常规 SSH 检查命令,也可按需复制 DSH Go 的连接资料。前者用于日常远程主机检查,SSH、SCP、SFTP 和端口转发仍采用 OpenSSH 的工作方式。DSH Go 可在 POSIX 远端托管启动 `dsh web`,Windows 远端使用连接已有服务的方式。端口以实际服务启动结果为准,认证在客户端配置。这里的复制按钮只准备资料。
|
|
90
|
+
|
|
91
|
+
DSH 允许尚未开始首轮的空白会话重新选择预设,首轮开始后会锁定。Deep PTC 的命令门禁读取宿主当前选择,与界面使用同一份状态。
|
|
92
|
+
|
|
89
93
|
## 1.7.2:轻量、按需、可恢复的工具调用层
|
|
90
94
|
|
|
91
95
|
本版增加一个工具与 Skill 的目录入口 `deep_ptc_tools`,具体任务继续交给外部插件和当前官方 PTC 工具完成。
|
|
@@ -169,6 +173,10 @@ WSL 命令使用 Linux/POSIX 语法;文件工具和 `workdir` 仍用 Windows
|
|
|
169
173
|
|
|
170
174
|
## dsh-go 与其他外部工具
|
|
171
175
|
|
|
176
|
+
Deep PTC 可以把其他插件提供的能力接进同一项任务:用 **DrawAI** 读图、改图并导出 SVG;按需加载**归藏设计**的页面、PPT、图文卡片与文案技能;发现并选用 **Agentero** 的论文和笔记工具;通过 **dsh-ops** 的预设识别使用其执行环境;向 **DSH Go** 提供屏幕工具可用性和 SSH 连接辅助。**dsh-context** 可按当前 Agent 的服务读取 Skill 信息,便于检查上下文。
|
|
177
|
+
|
|
178
|
+
1.9.2 修复了 DrawAI 等编辑器因版本过旧连续拒写后被误隔离的问题。DrawAI、归藏设计和 Agentero host 的 26 个真实工具通过隔离接口验证,DrawAI 另通过实际文件编辑与 SVG 导出。设计生成、论文 CLI、手机连接和视频渲染仍有各自的依赖与验证边界,详见[插件协作说明](COMPATIBILITY.md)。
|
|
179
|
+
|
|
172
180
|
外部插件按它们实际注册出来的工具和工作流接入。先按能力选用,第三方工具失败时官方 PTC 工具仍在,并作为兜底。本包不把任何外部插件(包括 dsh-go)写成依赖。
|
|
173
181
|
|
|
174
182
|
**dsh-go**(手机端,以及手机屏幕控制)在深度 PTC 会话里保持可用:
|
|
@@ -210,10 +218,10 @@ WSL 命令使用 Linux/POSIX 语法;文件工具和 `workdir` 仍用 Windows
|
|
|
210
218
|
本地目录或构建产物可通过插件管理器安装:
|
|
211
219
|
|
|
212
220
|
```js
|
|
213
|
-
plugin_manager({ action: "install_bundle", target: "dsh-deep-ptc-mode@1.9.
|
|
221
|
+
plugin_manager({ action: "install_bundle", target: "dsh-deep-ptc-mode@1.9.2" })
|
|
214
222
|
// 也可从本地目录或安装包安装:
|
|
215
223
|
plugin_manager({ action: "install_bundle", target: "C:\\path\\to\\dsh-deep-ptc-mode" })
|
|
216
|
-
// 或 target: "C:\\path\\to\\dsh-deep-ptc-mode-1.9.
|
|
224
|
+
// 或 target: "C:\\path\\to\\dsh-deep-ptc-mode-1.9.2.tgz"
|
|
217
225
|
```
|
|
218
226
|
|
|
219
227
|
GitHub 地址:`github:lishize20040802-rgb/dsh-deep-ptc-mode`。该地址安装远端实际内容;本地升级不会自动发布到 GitHub/npm。
|
|
@@ -236,7 +244,7 @@ GitHub 地址:`github:lishize20040802-rgb/dsh-deep-ptc-mode`。该地址安装
|
|
|
236
244
|
|
|
237
245
|
## 模式隔离
|
|
238
246
|
|
|
239
|
-
|
|
247
|
+
运行期功能服务于当前选择为 `deep-ptc` 的会话。工具目录、工具状态和执行环境由 Deep PTC 预设挂载。Skill 投影从创建头初始化,并处理宿主合法的 `agent-preset/selected` 事件。命令、`agent/pre-step` 和客户端面板核对当前选择,普通模式的 Skill 状态保持为空。创建头缺失时投影初始为未激活。
|
|
240
248
|
|
|
241
249
|
## 兼容性与维护
|
|
242
250
|
|
package/TEST_REPORT.md
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
# 1.
|
|
1
|
+
# 1.9.2 测试报告 / Test report
|
|
2
|
+
|
|
3
|
+
> 2026-11-12 插件协作验证:已发布包的实际注册代码在隔离服务上下文中注册 DrawAI 0.4.6 的 19 个工具、归藏设计 0.1.4 的 2 个工具和 Agentero host 0.1.8 的 5 个工具。使用桌面宿主 0.2.2-rc.2 的实际参数校验器及 TypeScript / Python SDK 渲染器,26 个工具的发现和选用路径通过。7 条技能全文读取通过;DrawAI 临时文件的读→改→回读、SVG 导出及旧 revision 拒写通过。修复前连续三次旧 revision 拒写会误隔离改图工具;通用分类修复后文件保持不变、工具仍可用,最新 revision 写入通过。新增两项回归测试,全部 199 项通过。context 为源码接口核对。完整来源、版本和未验证项目见 [协作说明](COMPATIBILITY.md)。未做浏览器/模型/外部 CLI/视频端到端验证。
|
|
4
|
+
> Plugin workflow verification: 26 actual published tool definitions passed isolated registration, host 0.2.2-rc.2 schema validation, Deep PTC selection and both host SDK renderers. Seven skill contents, DrawAI read/edit/readback and SVG export passed. Three stale-revision rejections reproduced incorrect quarantine before the generic conflict-classification fix; afterwards safe rejection and a fresh-revision write passed. All 199 tests pass, including two new regressions. Context received source review. See the linked report for versions and limits; no browser, model, external CLI or video end-to-end test was performed.
|
|
5
|
+
|
|
6
|
+
> 2026-11-12 的本地修订通过 197 项自动化测试。新增覆盖独立侧边面板的收起、缩放和原生侧栏全屏避让,空白会话选择 Deep PTC 后的工具门禁与 Skill 投影,以及通用 SSH / DSH Go 资料复制。本机 DSH Desktop 0.2.2-rc.2 的实际选择方法允许空白会话切换,并拒绝首轮已开始后的切换。新布局尚未做整窗目视验证,也未连接真实 SSH 主机或手机。
|
|
7
|
+
> The local revision on 2026-11-12 passes 197 tests, including side-panel collapse, resizing and fullscreen avoidance, command gates and skill state after blank-session selection, and SSH / DSH Go information copying. The installed DSH Desktop 0.2.2-rc.2 selection method accepts blank-session changes and refuses them once a turn has started. The new layout has no full-window visual check, and no real SSH host or phone was connected.
|
|
2
8
|
|
|
3
9
|
> 1.9.0 在 Windows 和 Node 24 上通过 191 项自动化测试,新增输出文件与 SSH 记录、应用商店 PowerShell 识别、安全模式判定、右侧栏页签和设置页。另在隔离的测试 profile 中启动 DSH 0.2.2-rc.1 Web 界面实测:设置左导航只有一个「Agent 预设」并新增「深度 PTC」页;模式选择器显示本地化名称与当前环境;右侧栏引导页列出「深度 PTC」,页签内容完整;胶囊位于输入区停靠位,点击可展开已收起的右侧栏;右侧栏全屏时胶囊被遮住,不再悬浮;客户端无本插件报错。未在测试中发送消息,因此输出文件与 SSH 记录的实际写入只由自动化测试覆盖。下方保留 1.7.3 的桌面实测记录。
|
|
4
10
|
> Version 1.9.0 passes 191 automated tests on Windows and Node 24, adding output-file and SSH activity, Microsoft Store PowerShell discovery, safe-mode diagnosis, the right sidebar tab and the settings page. A DSH 0.2.2-rc.1 Web UI run in an isolated test profile confirmed one Agent presets entry plus the new Deep PTC page in settings, the localized preset label with its environment, the Deep PTC tab on the right sidebar guide with complete content, the capsule in the composer dock opening a collapsed sidebar, the capsule covered rather than floating over a fullscreen sidebar, and no client errors from this plugin. No message was sent, so recorded outputs and SSH activity are covered by automated tests only. The desktop audits below document 1.7.3.
|
package/lib/client.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
window.__ModuleLoader__.load({ id: 'dsh-deep-ptc-mode', factory: require => {
|
|
2
2
|
const React = require('react');
|
|
3
3
|
const h = React.createElement;
|
|
4
|
+
let ReactDOM;
|
|
5
|
+
try { ReactDOM = require('react-dom'); } catch { /* hosts without portals keep the inline panel */ }
|
|
4
6
|
const NS = 'deep-ptc-settings';
|
|
5
7
|
const inject = ['slots', 'locale', 'configForms'];
|
|
6
8
|
const dictionaries = {
|
|
@@ -222,11 +224,15 @@ window.__ModuleLoader__.load({ id: 'dsh-deep-ptc-mode', factory: require => {
|
|
|
222
224
|
envFailed: '未能保存,请检查发行版名称或设置是否已在别处修改。', envDefaultDistribution: '默认发行版',
|
|
223
225
|
durationSeconds: '{s} 秒', durationMinutes: '{m} 分 {s} 秒', durationHours: '{h} 小时 {m} 分', tokens: '{value} tokens',
|
|
224
226
|
sideGuide: '执行环境、子代理、后台任务、输出文件与 SSH', sideOtherMode: '当前对话不是深度 PTC 模式。这里的执行环境用于之后新建的深度 PTC 会话。',
|
|
225
|
-
capsuleOpen: '
|
|
227
|
+
capsuleOpen: '展开或收起侧边面板', panelClose: '收起侧边面板',
|
|
228
|
+
panelMoved: '深度 PTC 面板已回到对话区侧边,请使用输入框下方的胶囊展开。',
|
|
226
229
|
outputsTitle: '输出文件', outputsEmpty: '本会话暂无输出文件。', outputsMore: '另有 {count} 个文件',
|
|
227
230
|
outputPresented: '已交付', outputTurn: '第 {turn} 轮',
|
|
228
231
|
sshTitle: 'SSH 连接', sshHint: '非交互连接', sshNoClient: '未找到 OpenSSH 客户端', sshConfigured: '已配置',
|
|
229
232
|
sshUsed: '第 {turn} 轮 · {count} 次', sshFailed: '第 {turn} 轮失败', sshEmpty: '~/.ssh/config 中没有主机别名,本会话也未连接过远程主机。',
|
|
233
|
+
sshCopy: '复制 SSH 检查命令', sshGoCopy: '复制 DSH Go 连接资料', sshCopied: '已复制', sshCopyFailed: '复制失败,请检查剪贴板权限。',
|
|
234
|
+
sshGoDetails: 'DSH Go SSH 连接\n主机:{host}\n端口:{port}\n用户:{user}\nSSH 别名(本机):{alias}\n\n在 DSH Go 中选择 SSH 并配置认证。远端为 Linux/macOS 时可选托管启动 dsh web;远端为 Windows 时选择仅连接已有服务,端口取自实际启动结果。服务监听 127.0.0.1,授权信息在客户端填写。手机需要能访问这里的主机地址。',
|
|
235
|
+
sshUserNeeded: '在客户端填写远程用户名',
|
|
230
236
|
appearance: '外观', visualEffectsAuto: '检测到外观插件 {name},特效默认关闭。手动打开后会保留你的选择。',
|
|
231
237
|
diagTitle: '诊断信息', diagHint: '复制后可附在 issue 中,便于排查界面问题。', diagCopy: '复制诊断信息', diagCopied: '已复制',
|
|
232
238
|
shellStore: 'PowerShell 7(应用商店)', presetSafeReason: '当前为安全模式:{reason}',
|
|
@@ -244,11 +250,15 @@ window.__ModuleLoader__.load({ id: 'dsh-deep-ptc-mode', factory: require => {
|
|
|
244
250
|
envFailed: 'Could not save. Check the distribution name, or whether settings changed elsewhere.', envDefaultDistribution: 'Default distribution',
|
|
245
251
|
durationSeconds: '{s}s', durationMinutes: '{m}m {s}s', durationHours: '{h}h {m}m', tokens: '{value} tokens',
|
|
246
252
|
sideGuide: 'Environment, subagents, background jobs, output files and SSH', sideOtherMode: 'This conversation is not in Deep PTC mode. The environment here applies to new Deep PTC sessions.',
|
|
247
|
-
capsuleOpen: '
|
|
253
|
+
capsuleOpen: 'Expand or collapse the side panel', panelClose: 'Collapse the side panel',
|
|
254
|
+
panelMoved: 'The Deep PTC panel is beside the conversation. Use the capsule below the composer to expand it.',
|
|
248
255
|
outputsTitle: 'Output files', outputsEmpty: 'No output files in this conversation.', outputsMore: '{count} more files',
|
|
249
256
|
outputPresented: 'Delivered', outputTurn: 'Turn {turn}',
|
|
250
257
|
sshTitle: 'SSH connections', sshHint: 'non-interactive', sshNoClient: 'OpenSSH client not found', sshConfigured: 'Configured',
|
|
251
258
|
sshUsed: 'Turn {turn} · {count}×', sshFailed: 'Failed in turn {turn}', sshEmpty: 'No host aliases in ~/.ssh/config and no remote host reached in this conversation.',
|
|
259
|
+
sshCopy: 'Copy SSH check command', sshGoCopy: 'Copy DSH Go connection details', sshCopied: 'Copied', sshCopyFailed: 'Could not copy. Check clipboard permissions.',
|
|
260
|
+
sshGoDetails: 'DSH Go SSH connection\nHost: {host}\nPort: {port}\nUser: {user}\nLocal SSH alias: {alias}\n\nChoose SSH and configure authentication in DSH Go. Use managed dsh web on a Linux/macOS remote host, or attach-only with an existing service on a Windows host. Read the actual service port from its launch result. Bind the service to 127.0.0.1 and enter authorization in the client. The phone must be able to reach this host address.',
|
|
261
|
+
sshUserNeeded: 'Enter the remote user in the client',
|
|
252
262
|
appearance: 'Appearance', visualEffectsAuto: '{name} is installed, so effects start off. Turning them on keeps your choice.',
|
|
253
263
|
diagTitle: 'Diagnostics', diagHint: 'Copy and attach to an issue to help investigate interface problems.', diagCopy: 'Copy diagnostics', diagCopied: 'Copied',
|
|
254
264
|
shellStore: 'PowerShell 7 (Microsoft Store)', presetSafeReason: 'Safe mode: {reason}',
|
|
@@ -283,7 +293,7 @@ window.__ModuleLoader__.load({ id: 'dsh-deep-ptc-mode', factory: require => {
|
|
|
283
293
|
const COMPOSER = '[data-composer-card]';
|
|
284
294
|
const BUBBLE = ':is([data-chat-flow-kind="user"],[data-chat-flow-kind="steering"]) [data-message-bubble]';
|
|
285
295
|
const CARD_CSS = `
|
|
286
|
-
.dpt-card,.dpt-panel,.dpt-capsule,.dpt-settings{--dpt-accent:var(--dpt-brand,#3370ff);--dpt-ease:cubic-bezier(.22,1,.36,1);--dpt-line:var(--dsw-alias-border-l1,#e3e7ee)}
|
|
296
|
+
.dpt-card,.dpt-panel,.dpt-sidecar,.dpt-capsule,.dpt-settings{--dpt-accent:var(--dpt-brand,#3370ff);--dpt-ease:cubic-bezier(.22,1,.36,1);--dpt-line:var(--dsw-alias-border-l1,#e3e7ee)}
|
|
287
297
|
.dpt-card{--dpt-card-fill:var(--dsw-static-neutral-50,#f7f8fa);box-sizing:border-box;width:100%;margin:2px 0 4px;border:.5px solid var(--dsw-alias-border-l2,#d6dce6);border-radius:var(--dsw-radius-lg,16px);background:var(--dpt-card-fill);color:var(--dsw-alias-label-primary,#101828);font-size:13px;line-height:20px;overflow:hidden;animation:dpt-rise 220ms var(--dpt-ease) both}
|
|
288
298
|
${DARK} .dpt-card{--dpt-card-fill:var(--dsw-static-neutral-850,#1a1f29)}
|
|
289
299
|
.dpt-card-head{display:flex;align-items:center;gap:10px;padding:10px 12px 6px}
|
|
@@ -370,6 +380,12 @@ ${ON} .dpt-capsule[data-state="running"] .dpt-agent-dot,${ON} .dpt-agent[data-st
|
|
|
370
380
|
.dpt-capsule:hover,.dpt-capsule[aria-expanded="true"]{color:var(--dsw-alias-label-primary,#101828);border-color:color-mix(in srgb,var(--dpt-accent) 40%,transparent)}
|
|
371
381
|
.dpt-capsule .dpt-agent-dot{margin-top:0}
|
|
372
382
|
.dpt-capsule-row>.dpt-panel{align-self:stretch}
|
|
383
|
+
.dpt-sidecar{position:fixed;z-index:20;display:flex;flex-direction:column;box-sizing:border-box;background:var(--dsw-alias-bg-base,#fff);color:var(--dsw-alias-label-primary,#101828);border-left:1px solid var(--dpt-line);overflow:hidden}
|
|
384
|
+
.dpt-sidecar[data-floating]{border:1px solid var(--dpt-line);border-radius:12px;box-shadow:0 4px 20px #0002}
|
|
385
|
+
.dpt-sidecar-head{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid var(--dpt-line);font-size:13px}
|
|
386
|
+
.dpt-sidecar-head h3{margin:0;font:inherit;font-weight:600}
|
|
387
|
+
.dpt-sidecar .dpt-panel{flex:1;height:auto;overflow:hidden}
|
|
388
|
+
[data-conversation-region="chat"][data-dpt-panel-open]{margin-right:var(--dpt-panel-width,280px)!important}
|
|
373
389
|
.dpt-tab-title{display:inline-flex;align-items:center;gap:6px}
|
|
374
390
|
.dpt-tab-title::before,.dpt-panel-mark::before{content:"";width:8px;height:8px;border-radius:50%;background:linear-gradient(135deg,var(--dpt-brand-light,#7fb0ff),var(--dpt-accent,#3370ff))}
|
|
375
391
|
.dpt-settings{display:grid;gap:22px;max-width:640px;font-size:13px;line-height:20px;color:var(--dsw-alias-label-primary,#101828)}
|
|
@@ -389,6 +405,8 @@ ${ON} .dpt-capsule[data-state="running"] .dpt-agent-dot,${ON} .dpt-agent[data-st
|
|
|
389
405
|
.dpt-host .dpt-agent-dot{width:6px;height:6px;margin-top:0}
|
|
390
406
|
.dpt-host[data-state="ok"] .dpt-agent-dot{background:var(--dsw-alias-state-success-primary,#0f7a4f)}
|
|
391
407
|
.dpt-host[data-state="failed"] .dpt-agent-dot{background:var(--dsw-alias-state-error-primary,#c4321f)}
|
|
408
|
+
.dpt-ssh-actions{display:flex;gap:6px;padding:2px 6px 6px}
|
|
409
|
+
.dpt-ssh-actions .dpt-link{font-size:11px}
|
|
392
410
|
[data-chat-flow-kind="command"]:has([data-dpt-hidden-command]){display:none!important}
|
|
393
411
|
.dpt-command-error{padding:4px 2px;font-size:12px;line-height:18px;color:var(--dsw-alias-state-error-primary,#c4321f)}
|
|
394
412
|
@keyframes dpt-rise{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
|
|
@@ -1234,6 +1252,7 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
|
|
|
1234
1252
|
// SSH: the configured host aliases and the hosts this conversation reached, most recent first.
|
|
1235
1253
|
function SshSection({ form, ssh, t }) {
|
|
1236
1254
|
const settings = useSettingsForm(form);
|
|
1255
|
+
const [copyStatus, setCopyStatus] = React.useState();
|
|
1237
1256
|
const configured = settings.status === 'ready' && Array.isArray(settings.value?.sshHosts) ? settings.value.sshHosts : [];
|
|
1238
1257
|
const client = settings.status === 'ready' ? settings.value?.sshClient : undefined;
|
|
1239
1258
|
const used = Array.isArray(ssh) ? ssh : [];
|
|
@@ -1241,26 +1260,48 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
|
|
|
1241
1260
|
const rows = [...used.map(row => ({ host: row.host, used: row, config: configured.find(item => item.alias === row.host) })),
|
|
1242
1261
|
...configured.filter(item => !names.has(item.alias)).map(item => ({ host: item.alias, config: item }))];
|
|
1243
1262
|
const endpoint = config => config ? [config.user ? `${config.user}@` : '', config.hostName || '', config.port && config.port !== '22' ? `:${config.port}` : ''].join('') : '';
|
|
1263
|
+
async function copyHost(item, go) {
|
|
1264
|
+
const config = item.config;
|
|
1265
|
+
let text;
|
|
1266
|
+
if (go) {
|
|
1267
|
+
text = tf(t, 'sshGoDetails', { host: config?.hostName || item.host, port: config?.port || '22',
|
|
1268
|
+
user: config?.user || t('sshUserNeeded'), alias: item.host });
|
|
1269
|
+
} else {
|
|
1270
|
+
const value = settings.value;
|
|
1271
|
+
const powershell = effectiveEnvironment(value?.environment ?? 'auto', value?.hostPlatform) === 'powershell';
|
|
1272
|
+
const quoteEscape = powershell ? "''" : "'\\''";
|
|
1273
|
+
const host = "'" + item.host.replaceAll("'", quoteEscape) + "'";
|
|
1274
|
+
text = `ssh -o BatchMode=yes -o ConnectTimeout=10 -o ConnectionAttempts=1 -- ${host} hostname`;
|
|
1275
|
+
}
|
|
1276
|
+
try {
|
|
1277
|
+
await navigator.clipboard.writeText(text);
|
|
1278
|
+
setCopyStatus('sshCopied');
|
|
1279
|
+
} catch { setCopyStatus('sshCopyFailed'); }
|
|
1280
|
+
}
|
|
1244
1281
|
const title = t('sshTitle');
|
|
1245
1282
|
return h('section', { className: 'dpt-side-section dpt-side-ssh', 'aria-label': title },
|
|
1246
1283
|
h('div', { className: 'dpt-side-label' }, h('span', null, title),
|
|
1247
1284
|
h('span', { className: 'dpt-side-hint', 'data-tone': client === '' ? 'warn' : undefined }, client === '' ? t('sshNoClient') : t('sshHint'))),
|
|
1248
|
-
rows.length ? h('ul', { className: 'dpt-files' }, ...rows.slice(0, 8).map(item => h('li', { key: item.host
|
|
1285
|
+
rows.length ? h('ul', { className: 'dpt-files' }, ...rows.slice(0, 8).map(item => h('li', { key: item.host },
|
|
1286
|
+
h('div', { className: 'dpt-file dpt-host',
|
|
1249
1287
|
'data-state': item.used ? (item.used.ok ? 'ok' : 'failed') : 'idle', title: endpoint(item.config) || item.host },
|
|
1250
1288
|
h('span', { className: 'dpt-agent-dot', 'aria-hidden': 'true' }),
|
|
1251
1289
|
h('span', { className: 'dpt-file-name' }, item.host),
|
|
1252
1290
|
h('span', { className: 'dpt-file-meta' }, item.used
|
|
1253
1291
|
? tf(t, item.used.ok ? 'sshUsed' : 'sshFailed', { count: item.used.count, turn: item.used.turn })
|
|
1254
|
-
: endpoint(item.config) || t('sshConfigured')))
|
|
1255
|
-
|
|
1292
|
+
: endpoint(item.config) || t('sshConfigured'))),
|
|
1293
|
+
h('div', { className: 'dpt-ssh-actions' },
|
|
1294
|
+
h('button', { type: 'button', className: 'dpt-link', onClick: () => { void copyHost(item, false); } }, t('sshCopy')),
|
|
1295
|
+
h('button', { type: 'button', className: 'dpt-link', onClick: () => { void copyHost(item, true); } }, t('sshGoCopy'))))))
|
|
1296
|
+
: h('p', { className: 'dpt-side-note' }, t('sshEmpty')),
|
|
1297
|
+
copyStatus ? h('p', { className: 'dpt-side-note', role: 'status' }, t(copyStatus)) : null);
|
|
1256
1298
|
}
|
|
1257
1299
|
|
|
1258
1300
|
function projectionValue(useProjection, key) {
|
|
1259
1301
|
try { return typeof useProjection === 'function' ? useProjection(key) : undefined; } catch { return undefined; }
|
|
1260
1302
|
}
|
|
1261
1303
|
|
|
1262
|
-
//
|
|
1263
|
-
// It is the right sidebar tab, or opens under the composer where the host has no right sidebar.
|
|
1304
|
+
// One conversation's environment, subagents, jobs, outputs, SSH and tool state.
|
|
1264
1305
|
function DeepPtcPanel({ sessionId, useSessions, useProjection, useJobs, watchJobs, reset, form, inline, t }) {
|
|
1265
1306
|
const sessions = typeof useSessions === 'function' ? useSessions(state => state) : undefined;
|
|
1266
1307
|
const preset = projectionValue(useProjection, 'agentPreset');
|
|
@@ -1302,14 +1343,91 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
|
|
|
1302
1343
|
h(VisualEffectsSection, { t })));
|
|
1303
1344
|
}
|
|
1304
1345
|
|
|
1305
|
-
|
|
1306
|
-
|
|
1346
|
+
const PANEL_WIDTH = 280;
|
|
1347
|
+
const PANEL_MIN_ROOM = 820;
|
|
1348
|
+
const PANEL_COLLAPSED_KEY = `${PLUGIN}:side-panel-collapsed`;
|
|
1349
|
+
const readPanelCollapsed = () => {
|
|
1350
|
+
try { return localStorage.getItem(PANEL_COLLAPSED_KEY) === '1'; } catch { return false; }
|
|
1351
|
+
};
|
|
1352
|
+
|
|
1353
|
+
// Measure the conversation itself, so the panel follows native sidebar resizing and is hidden
|
|
1354
|
+
// when that conversation is covered by a fullscreen sidebar.
|
|
1355
|
+
function useSidePanelLayout(sessionId, marker) {
|
|
1356
|
+
const [layout, setLayout] = React.useState();
|
|
1357
|
+
React.useEffect(() => {
|
|
1358
|
+
if (typeof document === 'undefined' || typeof ReactDOM?.createPortal !== 'function') return undefined;
|
|
1359
|
+
let frame;
|
|
1360
|
+
let previous;
|
|
1361
|
+
const watched = new Set();
|
|
1362
|
+
const resize = typeof ResizeObserver === 'function' ? new ResizeObserver(schedule) : undefined;
|
|
1363
|
+
function measure() {
|
|
1364
|
+
frame = undefined;
|
|
1365
|
+
const region = marker.current?.closest?.('[data-conversation-region="chat"]')
|
|
1366
|
+
?? [...document.querySelectorAll('[data-conversation-region="chat"]')]
|
|
1367
|
+
.find(node => node.getAttribute('data-conversation-session') === sessionId);
|
|
1368
|
+
const rect = region?.getBoundingClientRect();
|
|
1369
|
+
const room = region?.parentElement?.getBoundingClientRect() ?? rect;
|
|
1370
|
+
const fullscreen = [...document.querySelectorAll('[data-sidebar-right-panel="fullscreen"][data-sidebar-right-open]')]
|
|
1371
|
+
.some(node => node.getClientRects().length > 0);
|
|
1372
|
+
if (!rect || rect.width <= 0 || rect.height <= 0 || fullscreen || region.closest('[hidden],[aria-hidden="true"]')) {
|
|
1373
|
+
if (previous !== undefined) { previous = undefined; setLayout(undefined); }
|
|
1374
|
+
return;
|
|
1375
|
+
}
|
|
1376
|
+
const targets = [region, region.parentElement].filter(Boolean);
|
|
1377
|
+
for (const node of watched) {
|
|
1378
|
+
if (!targets.includes(node)) { resize?.unobserve(node); watched.delete(node); }
|
|
1379
|
+
}
|
|
1380
|
+
for (const node of targets) {
|
|
1381
|
+
if (node && !watched.has(node)) { resize?.observe(node); watched.add(node); }
|
|
1382
|
+
}
|
|
1383
|
+
const wide = room.width >= PANEL_MIN_ROOM;
|
|
1384
|
+
const composer = region.querySelector('[data-composer-seat]')?.getBoundingClientRect();
|
|
1385
|
+
const next = { region, wide, top: Math.round(rect.top), right: Math.round(window.innerWidth - room.right),
|
|
1386
|
+
height: Math.round(wide ? rect.height : Math.max(0, Math.min(rect.height, (composer?.top ?? rect.bottom) - rect.top - 8))),
|
|
1387
|
+
width: Math.min(PANEL_WIDTH, Math.max(0, room.width - 24)) };
|
|
1388
|
+
const same = previous?.region === region && ['wide', 'top', 'right', 'height', 'width'].every(key => previous[key] === next[key]);
|
|
1389
|
+
if (!same) { previous = next; setLayout(next); }
|
|
1390
|
+
}
|
|
1391
|
+
function schedule() {
|
|
1392
|
+
if (frame === undefined) frame = requestAnimationFrame(measure);
|
|
1393
|
+
}
|
|
1394
|
+
const changes = typeof MutationObserver === 'function' ? new MutationObserver(records => {
|
|
1395
|
+
if (!previous?.region?.isConnected || records.some(record => record.type === 'attributes'
|
|
1396
|
+
&& (record.target.contains(previous?.region) || record.target.matches?.('[data-sidebar-right-panel]')))) schedule();
|
|
1397
|
+
}) : undefined;
|
|
1398
|
+
changes?.observe(document.body, { subtree: true, childList: true, attributes: true,
|
|
1399
|
+
attributeFilter: ['class', 'style', 'hidden', 'aria-hidden', 'data-sidebar-right-panel', 'data-sidebar-right-open'] });
|
|
1400
|
+
window.addEventListener('resize', schedule);
|
|
1401
|
+
measure();
|
|
1402
|
+
return () => {
|
|
1403
|
+
resize?.disconnect(); changes?.disconnect();
|
|
1404
|
+
window.removeEventListener('resize', schedule);
|
|
1405
|
+
if (frame !== undefined) cancelAnimationFrame(frame);
|
|
1406
|
+
};
|
|
1407
|
+
}, [sessionId, marker]);
|
|
1408
|
+
return layout;
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
// The capsule stays under the composer and toggles the independent conversation-side panel.
|
|
1307
1412
|
function Capsule(props) {
|
|
1308
|
-
const { sessionId, useSessions, useProjection, form,
|
|
1413
|
+
const { sessionId, useSessions, useProjection, form, t } = props;
|
|
1414
|
+
const marker = React.useRef(null);
|
|
1415
|
+
const layout = useSidePanelLayout(sessionId, marker);
|
|
1309
1416
|
const sessions = typeof useSessions === 'function' ? useSessions(state => state) : undefined;
|
|
1310
1417
|
const tools = projectionValue(useProjection, 'deepPtcTools');
|
|
1311
1418
|
const settings = useSettingsForm(form);
|
|
1312
|
-
const [
|
|
1419
|
+
const [collapsed, setCollapsed] = React.useState(readPanelCollapsed);
|
|
1420
|
+
const [peek, setPeek] = React.useState(false);
|
|
1421
|
+
React.useEffect(() => setPeek(false), [sessionId, layout?.wide]);
|
|
1422
|
+
const docked = !!layout?.wide && !collapsed;
|
|
1423
|
+
const open = docked || peek;
|
|
1424
|
+
React.useEffect(() => {
|
|
1425
|
+
const region = layout?.region;
|
|
1426
|
+
if (!region) return undefined;
|
|
1427
|
+
region.toggleAttribute('data-dpt-panel-open', docked);
|
|
1428
|
+
region.style.setProperty('--dpt-panel-width', `${layout.width}px`);
|
|
1429
|
+
return () => { region.removeAttribute('data-dpt-panel-open'); region.style.removeProperty('--dpt-panel-width'); };
|
|
1430
|
+
}, [layout?.region, layout?.width, docked]);
|
|
1313
1431
|
const rows = subagentRows(sessions, sessionId, Date.now());
|
|
1314
1432
|
const running = rows.filter(row => row.state === 'running').length;
|
|
1315
1433
|
React.useEffect(() => {
|
|
@@ -1320,12 +1438,25 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
|
|
|
1320
1438
|
const environment = settings.status === 'ready' && settings.value ? envLabel(settings.value.environment ?? 'auto', t) : undefined;
|
|
1321
1439
|
const label = [environment, rows.length ? `${t('agentsTitle')} ${rows.length}` : null, failures ? `${t('toolFailures')} ${failures}` : null]
|
|
1322
1440
|
.filter(Boolean).join(' · ') || t('sideTitle');
|
|
1323
|
-
const toggle = () => {
|
|
1324
|
-
|
|
1441
|
+
const toggle = () => {
|
|
1442
|
+
if (layout?.wide) {
|
|
1443
|
+
const next = !collapsed;
|
|
1444
|
+
setCollapsed(next);
|
|
1445
|
+
try { localStorage.setItem(PANEL_COLLAPSED_KEY, next ? '1' : '0'); } catch { /* viewer preference */ }
|
|
1446
|
+
} else setPeek(value => !value);
|
|
1447
|
+
};
|
|
1448
|
+
const panel = open && layout ? ReactDOM.createPortal(h('aside', { className: 'dpt-sidecar',
|
|
1449
|
+
'data-floating': docked ? undefined : '', 'aria-label': t('sideTitle'),
|
|
1450
|
+
style: { top: layout.top, right: layout.right, height: layout.height, width: layout.width } },
|
|
1451
|
+
h('header', { className: 'dpt-sidecar-head' }, h('h3', null, t('sideTitle')),
|
|
1452
|
+
h('button', { type: 'button', className: 'dpt-icon-btn', onClick: toggle, 'aria-label': t('panelClose') }, '×')),
|
|
1453
|
+
h(DeepPtcPanel, props)), document.body) : null;
|
|
1454
|
+
return h('div', { ref: marker, className: 'dpt-capsule-row' },
|
|
1325
1455
|
h('button', { type: 'button', className: 'dpt-capsule', 'data-state': running ? 'running' : 'idle', 'aria-expanded': open,
|
|
1326
1456
|
title: t('capsuleOpen'), onClick: toggle },
|
|
1327
1457
|
h('span', { className: 'dpt-agent-dot', 'aria-hidden': 'true' }), h('span', null, label)),
|
|
1328
|
-
|
|
1458
|
+
panel,
|
|
1459
|
+
open && !layout && typeof ReactDOM?.createPortal !== 'function' ? h(DeepPtcPanel, { ...props, inline: true }) : null);
|
|
1329
1460
|
}
|
|
1330
1461
|
|
|
1331
1462
|
// A boundary keeps a failing bridge or panel from taking the conversation with it.
|
|
@@ -1354,8 +1485,8 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
|
|
|
1354
1485
|
return h(Boundary, null, h(Capsule, props));
|
|
1355
1486
|
}
|
|
1356
1487
|
|
|
1357
|
-
function TabHost(
|
|
1358
|
-
return h(
|
|
1488
|
+
function TabHost({ t }) {
|
|
1489
|
+
return h('p', { className: 'dpt-side-note' }, t('panelMoved'));
|
|
1359
1490
|
}
|
|
1360
1491
|
|
|
1361
1492
|
function TabTitle({ t }) {
|
|
@@ -1407,7 +1538,7 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
|
|
|
1407
1538
|
}
|
|
1408
1539
|
const TAB_KIND = 'deep-ptc';
|
|
1409
1540
|
|
|
1410
|
-
// Per-conversation props
|
|
1541
|
+
// Per-conversation props for the panel and its composer capsule.
|
|
1411
1542
|
function sessionTools(child) {
|
|
1412
1543
|
return sessionId => {
|
|
1413
1544
|
const jobs = child.get?.('jobs');
|
|
@@ -1426,23 +1557,6 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
|
|
|
1426
1557
|
};
|
|
1427
1558
|
}
|
|
1428
1559
|
|
|
1429
|
-
// Opens the Deep PTC tab in the right sidebar; false when this host has none, so the capsule
|
|
1430
|
-
// opens the panel under the composer instead.
|
|
1431
|
-
let tabRegistered = false;
|
|
1432
|
-
function openPanel() {
|
|
1433
|
-
const sidebar = hostCtx?.get?.('sidebarRight');
|
|
1434
|
-
if (!tabRegistered || typeof sidebar?.openTab !== 'function') return false;
|
|
1435
|
-
try {
|
|
1436
|
-
sidebar.openTab(TAB_KIND);
|
|
1437
|
-
// Revealing a page that is already open does not expand a collapsed column; check once the
|
|
1438
|
-
// open has rendered, so an open that did expand it is not toggled closed again.
|
|
1439
|
-
if (typeof sidebar.isExpanded === 'function' && typeof sidebar.toggleExpanded === 'function') {
|
|
1440
|
-
setTimeout(() => { if (!sidebar.isExpanded()) sidebar.toggleExpanded(); }, 0);
|
|
1441
|
-
}
|
|
1442
|
-
return true;
|
|
1443
|
-
} catch { return false; }
|
|
1444
|
-
}
|
|
1445
|
-
|
|
1446
1560
|
function apply(ctx) {
|
|
1447
1561
|
hostCtx = ctx;
|
|
1448
1562
|
const t = ctx.locale.bind('deep-ptc');
|
|
@@ -1505,21 +1619,19 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
|
|
|
1505
1619
|
child.slots.inject('conversation.composer.dock', () => child.slots.register({
|
|
1506
1620
|
name: 'conversation.composer.dock', id: 'deep-ptc-side', order: 89, locale: 'deep-ptc',
|
|
1507
1621
|
inject: sessionTools(child),
|
|
1508
|
-
}, props => h(LocalizedSlot, { ...props, form,
|
|
1622
|
+
}, props => h(LocalizedSlot, { ...props, form, component: DockHost })));
|
|
1509
1623
|
} catch { /* the composer stays usable when this slot cannot register */ }
|
|
1510
1624
|
});
|
|
1511
1625
|
} catch { /* the composer stays usable when this slot cannot register */ }
|
|
1512
1626
|
try {
|
|
1513
|
-
//
|
|
1514
|
-
// hides it, and lists it on the sidebar's new-tab guide.
|
|
1627
|
+
// Saved 1.9.0 sidebar tabs show a migration hint. New entries use the composer capsule.
|
|
1515
1628
|
ctx.inject?.(['remote', 'remote.commands', 'sidebarRightTabs'], child => {
|
|
1516
1629
|
child.effect(() => {
|
|
1517
1630
|
const dispose = child.sidebarRightTabs.register({
|
|
1518
1631
|
id: PLUGIN, kind: TAB_KIND, title: () => t('sideTitle'),
|
|
1519
|
-
guide: [
|
|
1632
|
+
guide: [],
|
|
1520
1633
|
});
|
|
1521
|
-
|
|
1522
|
-
return () => { tabRegistered = false; dispose(); };
|
|
1634
|
+
return dispose;
|
|
1523
1635
|
}, `${PLUGIN}: sidebar tab type`);
|
|
1524
1636
|
child.slots.inject('sidebar.right.pane.tab', () => child.slots.register({
|
|
1525
1637
|
name: 'sidebar.right.pane.tab', key: PLUGIN, locale: 'deep-ptc', inject: sessionTools(child),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// The host records blank-session selections after the immutable creation header.
|
|
2
|
+
// Use its current projection when available, including an explicit empty selection.
|
|
3
|
+
export function isDeepPtcSession(ctx, session) {
|
|
4
|
+
if (!session) return false;
|
|
5
|
+
const registry = typeof ctx.get === 'function' ? ctx.get('agentPresets') : ctx.agentPresets;
|
|
6
|
+
const preset = typeof registry?.presetForSession === 'function'
|
|
7
|
+
? registry.presetForSession(session) : session.header?.agentPreset;
|
|
8
|
+
return preset === 'deep-ptc';
|
|
9
|
+
}
|
package/lib/skill-card.mjs
CHANGED
|
@@ -50,8 +50,8 @@ export function catalogDescriptions(value) {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export function blankSkillState(header) {
|
|
53
|
-
//
|
|
54
|
-
//
|
|
53
|
+
// Start from the header; a later blank-session selection is folded before skill events.
|
|
54
|
+
// The root projection passes an empty header when no header is available.
|
|
55
55
|
const active = header === undefined ? true : header.agentPreset === 'deep-ptc';
|
|
56
56
|
return { v: 1, active, turn: 0, phase: 'idle', skills: [], committed: null, descriptions: {} };
|
|
57
57
|
}
|
|
@@ -97,6 +97,10 @@ function withDescription(state, name) {
|
|
|
97
97
|
|
|
98
98
|
/** Fold one session event into the card state. */
|
|
99
99
|
export function foldSkillState(state, event) {
|
|
100
|
+
if (event.type === 'agent-preset/selected' && typeof event.data?.agentPreset === 'string') {
|
|
101
|
+
const active = event.data.agentPreset === 'deep-ptc';
|
|
102
|
+
return active === state.active ? state : blankSkillState({ agentPreset: event.data.agentPreset });
|
|
103
|
+
}
|
|
100
104
|
if (state.active === false) return state;
|
|
101
105
|
if (event.type === SKILL_STATE_EVENT) {
|
|
102
106
|
try { return parseSkillState(event.data); } catch { return state; }
|
package/lib/skill-context.mjs
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
// marker. The durable session log and the human transcript keep the original body.
|
|
7
7
|
|
|
8
8
|
import { importHost } from './host.mjs';
|
|
9
|
+
import { isDeepPtcSession } from './session-preset.mjs';
|
|
9
10
|
import { applySkillCommand, blankSkillState, foldSkillState, parseSkillCardView, parseSkillState, removeResults,
|
|
10
11
|
replacementData, skillCardView, skillsToUnload, SKILL_CARD_KEY, SKILL_COMMAND, SKILL_STATE_EVENT } from './skill-card.mjs';
|
|
11
12
|
|
|
@@ -13,12 +14,6 @@ export const name = 'deep-ptc-skill-context';
|
|
|
13
14
|
// The layer is optional: a missing service disables the card rather than rejecting the preset.
|
|
14
15
|
export const inject = [];
|
|
15
16
|
const REQUIRED = ['commands', 'sessionProjections'];
|
|
16
|
-
const DEEP_PTC = 'deep-ptc';
|
|
17
|
-
|
|
18
|
-
/** The card must never observe or mutate another preset's session. */
|
|
19
|
-
function isDeepPtcSession(session) {
|
|
20
|
-
return session?.header?.agentPreset === DEEP_PTC;
|
|
21
|
-
}
|
|
22
17
|
|
|
23
18
|
export function apply(ctx) {
|
|
24
19
|
// Wait for the host services before the profile finishes booting, so the
|
|
@@ -31,8 +26,8 @@ async function install(ctx) {
|
|
|
31
26
|
const { appendPluginRecord } = await importHost('@deepseek-ai/dsh-session');
|
|
32
27
|
if (typeof appendPluginRecord !== 'function') throw new Error('the installed session module has no appendPluginRecord');
|
|
33
28
|
const schema = { parse: parseSkillState };
|
|
34
|
-
const projection = await ctx.sessionProjections.register({ key: SKILL_CARD_KEY, stateVersion:
|
|
35
|
-
stateSchema: schema, init: blankSkillState, apply: foldSkillState,
|
|
29
|
+
const projection = await ctx.sessionProjections.register({ key: SKILL_CARD_KEY, stateVersion: 2,
|
|
30
|
+
stateSchema: schema, init: header => blankSkillState(header ?? {}), apply: foldSkillState,
|
|
36
31
|
wire: { viewSchema: { parse: parseSkillCardView }, view: skillCardView, summary: false } });
|
|
37
32
|
ctx.effect(() => () => projection.dispose());
|
|
38
33
|
const save = (session, state) => appendPluginRecord(session, SKILL_STATE_EVENT, state);
|
|
@@ -40,7 +35,7 @@ async function install(ctx) {
|
|
|
40
35
|
recordInput: false,
|
|
41
36
|
handler: ({ agent, rawInput }) => {
|
|
42
37
|
if (!agent?.session) return { kind: 'error', text: 'No active conversation. / 当前没有活动对话。' };
|
|
43
|
-
if (!isDeepPtcSession(agent.session)) return { kind: 'error', text: 'This command is available in Deep PTC sessions only. / 该功能仅在深度 PTC 会话中可用。' };
|
|
38
|
+
if (!isDeepPtcSession(ctx, agent.session)) return { kind: 'error', text: 'This command is available in Deep PTC sessions only. / 该功能仅在深度 PTC 会话中可用。' };
|
|
44
39
|
const state = projection.stateOf(agent.session) ?? blankSkillState();
|
|
45
40
|
const updated = applySkillCommand(state, rawInput);
|
|
46
41
|
if (updated === undefined) return { kind: 'error', text: 'Invalid skill card command. / 无效的 Skill 卡片操作。' };
|
|
@@ -48,7 +43,7 @@ async function install(ctx) {
|
|
|
48
43
|
return { kind: 'success', text: 'Skill card updated; it applies to the next message. / Skill 卡片已更新,将在下一条消息生效。' };
|
|
49
44
|
} });
|
|
50
45
|
ctx.effect(() => ctx.on('agent/pre-step', async (payload, next) => {
|
|
51
|
-
if (!isDeepPtcSession(payload.agent?.session)) return typeof next === 'function' ? next() : undefined;
|
|
46
|
+
if (!isDeepPtcSession(ctx, payload.agent?.session)) return typeof next === 'function' ? next() : undefined;
|
|
52
47
|
try { await releaseSkillResults(ctx, projection, save, payload.agent); }
|
|
53
48
|
catch (error) { ctx.logger.warn('Deep PTC: releasing skills failed (%s)', error.message); }
|
|
54
49
|
return typeof next === 'function' ? next() : undefined;
|
|
@@ -59,7 +54,7 @@ async function install(ctx) {
|
|
|
59
54
|
export async function releaseSkillResults(ctx, projection, save, agent) {
|
|
60
55
|
if (agent === undefined) return;
|
|
61
56
|
const session = agent.session;
|
|
62
|
-
if (!isDeepPtcSession(session)) return;
|
|
57
|
+
if (!isDeepPtcSession(ctx, session)) return;
|
|
63
58
|
const state = projection.stateOf(session) ?? blankSkillState();
|
|
64
59
|
const rows = skillsToUnload(state);
|
|
65
60
|
if (rows.length === 0) return;
|
package/lib/ssh.mjs
CHANGED
|
@@ -75,7 +75,7 @@ const endpoint = host => {
|
|
|
75
75
|
export function sshGuidance({ environment, client, hosts }) {
|
|
76
76
|
const lines = ['SSH to external hosts: use the OpenSSH client from the execution environment\'s shell.'];
|
|
77
77
|
if (environment === 'wsl') {
|
|
78
|
-
lines.push('In WSL, ssh, scp and sftp run inside the distribution with its own ~/.ssh
|
|
78
|
+
lines.push('In WSL, ssh, scp and sftp run inside the distribution with its own ~/.ssh and authentication agent. Windows host aliases below are reference metadata; confirm the matching host, user, port and key paths in WSL before reusing them.');
|
|
79
79
|
} else if (client) {
|
|
80
80
|
lines.push(`The local client is ${client}; scp and sftp are installed beside it.`);
|
|
81
81
|
} else {
|
|
@@ -88,6 +88,8 @@ export function sshGuidance({ environment, client, hosts }) {
|
|
|
88
88
|
'Every SSH call must be non-interactive: `ssh -o BatchMode=yes -o ConnectTimeout=10 <host> \'<command>\'`, `scp -B -o ConnectTimeout=10 <src> <dst>`, `sftp -b <batchfile> <host>`. Never open an interactive remote shell, and never wait for a password, passphrase or host-key confirmation.',
|
|
89
89
|
'If authentication or host-key verification fails, stop and tell the user which host failed and why; do not retry with other credentials, disable host-key checking or edit their SSH configuration.',
|
|
90
90
|
'Each remote command is self-contained (cd, environment and quoting included). Remote work longer than the foreground limit runs as a background job; check it with job_output.',
|
|
91
|
+
'Run long-lived forwarding as a managed job, with explicit loopback binding, ExitOnForwardFailure=yes and keepalives. Verify readiness before use.',
|
|
92
|
+
'For DSH Go, confirm the remote OS: managed dsh web requires POSIX; attach-only can use an existing Windows service. Use its actual loopback port and protect its token. Configure a phone-reachable host and authentication in DSH Go, which manages its own tunnel.',
|
|
91
93
|
);
|
|
92
94
|
return lines.join('\n');
|
|
93
95
|
}
|
package/lib/tool-policy.mjs
CHANGED
|
@@ -39,6 +39,10 @@ const DENIED_TEXT = pattern('permission denied|eacces|eperm|forbidden|unauthori[
|
|
|
39
39
|
// (an external shell tool may simply run a missing command), so it counts as a strike.
|
|
40
40
|
const MISSING_COMMAND_TEXT = /command not found|not recognized as an internal or external command|is not recognized as the name of a cmdlet/iu;
|
|
41
41
|
const INPUT_TEXT = pattern('enoent|no such file|not found|does not exist|invalid|missing required|bad request', httpStatus('40[04]'));
|
|
42
|
+
// An optimistic-lock rejection means the caller must reread the document, not replace the editor.
|
|
43
|
+
// Match explicit stale-revision signals; a generic dependency/version conflict may be a real defect.
|
|
44
|
+
const EDIT_CONFLICT_CODES = new Set(['REVISION_CONFLICT', 'STALE_REVISION', 'ETAG_MISMATCH', 'PRECONDITION_FAILED']);
|
|
45
|
+
const EDIT_CONFLICT_TEXT = /\brevision conflict(?=\s*[::]|$)|\bstale revision\b|\betag mismatch\b|(?:画布|文件|文档)已被其他编辑器修改/iu;
|
|
42
46
|
const TEMPORARY_TEXT = pattern(
|
|
43
47
|
'timed? ?out|timeout|etimedout|econnreset|econnrefused|eai_again|enotfound|socket hang up|network|fetch failed',
|
|
44
48
|
'rate.?limit|too many requests|temporar|try again|overloaded',
|
|
@@ -79,13 +83,14 @@ export function classifyToolOutcome(exec, result) {
|
|
|
79
83
|
if (status === 'partial') return { kind: 'partial', effect };
|
|
80
84
|
if (/UNKNOWN_TOOL|UNAVAILABLE|WORKER_MISSING|RUNTIME_MISSING/u.test(code) || status === 'unavailable')
|
|
81
85
|
return { kind: 'unavailable', effect };
|
|
86
|
+
if (effect !== 'partial' && EDIT_CONFLICT_CODES.has(code)) return { kind: 'input', effect };
|
|
82
87
|
if (code) return { kind: /TIMEOUT|RATE|BUSY|OVERLOAD/u.test(code) ? 'temporary' : 'failure', effect };
|
|
83
88
|
if (MISSING_MODULE_TEXT.test(message)) return { kind: 'unavailable', effect };
|
|
84
89
|
// Before the looser patterns: a TypeError naming a property called "invalid" is not wrong input.
|
|
85
90
|
if (DEFECT_TEXT.test(message)) return { kind: 'failure', effect };
|
|
86
91
|
if (DENIED_TEXT.test(message)) return { kind: 'denied', effect };
|
|
87
92
|
if (TEMPORARY_TEXT.test(message)) return { kind: 'temporary', effect };
|
|
88
|
-
if (INPUT_TEXT.test(message)) return { kind: 'input', effect };
|
|
93
|
+
if (INPUT_TEXT.test(message) || (effect !== 'partial' && EDIT_CONFLICT_TEXT.test(message))) return { kind: 'input', effect };
|
|
89
94
|
return { kind: 'failure', effect };
|
|
90
95
|
}
|
|
91
96
|
|
package/lib/tool-state.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { importHost } from './host.mjs';
|
|
2
|
+
import { isDeepPtcSession } from './session-preset.mjs';
|
|
2
3
|
import { RESET_COMMAND, STATE_EVENT, STATE_KEY, blankState, parseState, foldToolState } from './tool-catalog.mjs';
|
|
3
4
|
|
|
4
5
|
// The tool state and its reset command live at the plugin root, like the skill card. A preset-scoped
|
|
@@ -6,7 +7,6 @@ import { RESET_COMMAND, STATE_EVENT, STATE_KEY, blankState, parseState, foldTool
|
|
|
6
7
|
// read the state nor reset it in an idle conversation. The preset layer reuses the root projection and
|
|
7
8
|
// registers its own only when the root one is unavailable.
|
|
8
9
|
const ROOT = Symbol.for('dsh-deep-ptc-mode/tool-state');
|
|
9
|
-
const DEEP_PTC = 'deep-ptc';
|
|
10
10
|
export const resetText = count => `已重载本对话全部工具状态,清除 ${count} 个故障标记。正在运行的任务继续执行。 / All tool states reloaded for this conversation; ${count} quarantine marks cleared. Running jobs continue.`;
|
|
11
11
|
|
|
12
12
|
export function registerState(ctx) {
|
|
@@ -37,7 +37,7 @@ export async function installRoot(ctx, records = sessionRecords) {
|
|
|
37
37
|
handler: ({ agent }) => {
|
|
38
38
|
const session = agent?.session;
|
|
39
39
|
if (!session) return { kind: 'error', text: 'No active conversation. / 当前没有活动对话。' };
|
|
40
|
-
if (session
|
|
40
|
+
if (!isDeepPtcSession(ctx, session)) return { kind: 'error', text: 'This command is available in Deep PTC sessions only. / 该功能仅在深度 PTC 会话中可用。' };
|
|
41
41
|
const current = projection.stateOf(session) ?? blankState();
|
|
42
42
|
// A new epoch clears quarantine; the preset layer drops on-demand selections and strike counts when it reads it.
|
|
43
43
|
handle.write(session, { ...blankState(), epoch: current.epoch + 1 });
|
package/locale/en.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "Deep PTC Mode",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "Deep PTC builds on official PTC with interruptible jobs, selectable shells and a conversation-side panel. Use DrawAI, guizang-design and Agentero tools and skills on demand, with general SSH and DSH Go connection assistance. The bottom capsule toggles the panel; the UI follows DSH's Chinese or English setting.",
|
|
5
5
|
"detail": "README.md"
|
|
6
6
|
}
|
|
7
7
|
}
|
package/locale/zh.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "深度 PTC 模式",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "基于官方 PTC 的深度模式:可插话的后台任务、可选执行环境和对话侧边面板,支持按需使用 DrawAI、归藏设计与 Agentero 的工具和技能,提供通用 SSH 与 DSH Go 连接辅助。下方胶囊控制面板,界面随 DSH 设置切换中英文。",
|
|
5
5
|
"detail": "README.zh.md"
|
|
6
6
|
}
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-deep-ptc-mode",
|
|
3
|
-
"version": "1.9.
|
|
4
|
-
"description": "Deep PTC
|
|
3
|
+
"version": "1.9.2",
|
|
4
|
+
"description": "Deep PTC for DeepSeek Harness: interruptible jobs, selectable shells, a conversation-side panel, general SSH and DSH Go assistance, bilingual UI, and on-demand tools and skills for drawing, design and research.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"dsh-plugin",
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
"dsh-ops",
|
|
18
18
|
"creative-mode",
|
|
19
19
|
"tool-cooperation",
|
|
20
|
-
"official-ptc-fallback"
|
|
20
|
+
"official-ptc-fallback",
|
|
21
|
+
"ssh",
|
|
22
|
+
"side-panel"
|
|
21
23
|
],
|
|
22
24
|
"license": "MIT",
|
|
23
25
|
"author": {
|
|
@@ -42,7 +44,8 @@
|
|
|
42
44
|
"README.zh.md",
|
|
43
45
|
"CHANGELOG.md",
|
|
44
46
|
"assets/icon.png",
|
|
45
|
-
"TEST_REPORT.md"
|
|
47
|
+
"TEST_REPORT.md",
|
|
48
|
+
"COMPATIBILITY.md"
|
|
46
49
|
],
|
|
47
50
|
"engines": {
|
|
48
51
|
"node": ">=24",
|