dsh-deep-ptc-mode 1.9.1 → 1.9.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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.3 — 2026-11-12
4
+
5
+ - 侧边输出文件可点击,使用 DSH 原生文件资源接口按所属会话打开;兼容折叠列表、相对路径、Windows/UNC 路径及带中文和特殊字符的文件名,预览不可用时显示提示。
6
+ - 子代理行精简为状态指示、名字与同一行最右侧的用时,移除可见状态文字、统计摘要和 token 消耗。状态仍供辅助阅读工具使用。
7
+ - Output files open through DSH's native session-scoped viewer, including folded entries, relative/Windows/UNC paths and special characters; unavailable previews show a message.
8
+ - Subagent rows show the state indicator, name and right-aligned duration. Visible state text, summaries and token usage are removed; state remains available to assistive technology.
9
+
10
+ ## 1.9.2 — 2026-11-12
11
+
12
+ - 文档与简介说明 DrawAI 绘图、归藏设计技能、Agentero 论文工具、dsh-ops 执行环境及 DSH Go 连接辅助的协作方式,并标明验证范围。26 个真实工具通过隔离注册、发现、选用和宿主双语言 SDK 渲染;DrawAI 的文件编辑、SVG 导出和 revision 冲突保护通过。统一分类层将明确的并发编辑冲突归为输入状态过旧,修复连续旧 revision 拒写导致工具误隔离;保留实现缺陷、不可用和部分完成的处理。
13
+ - 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.
14
+
15
+ - 面板回到对话区侧边,保留输入框下方的胶囊,使用布局事件更新位置。旧侧栏页签显示迁移提示。
16
+ - 命令与 Skill 投影跟随宿主当前预设选择,修复空白会话先创建再选择 Deep PTC 时的模式门禁。
17
+ - 通用 SSH 增加检查命令复制,并提供按需复制的 DSH Go 连接资料。
18
+
19
+ - Restore the conversation-side panel and retain the capsule below the composer. Layout events update its position. Old sidebar tabs show a migration hint.
20
+ - Follow the host's current preset selection in command gates and the skill projection, including a blank session switched to Deep PTC after creation.
21
+ - Add a general SSH check-command copy action and optional DSH Go connection details.
22
+
3
23
  ## 1.9.1 — 2026-11-11
4
24
 
5
25
  - 更新 npm 与 DSH 插件管理器中的简介:写明右侧栏面板(子代理、后台任务、输出文件、SSH 连接)以及对官方与第三方插件的兼容;README 的「五个基本问题」补充新的提问与工作纪律规则。代码与 1.9.0 相同。
@@ -0,0 +1,56 @@
1
+ # 插件协作与验证范围 / Plugin workflows and verification
2
+
3
+ Deep PTC **1.9.3** · 核对日期: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.3 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,12 +1,12 @@
1
1
  # Deep PTC mode
2
2
 
3
- [中文](README.zh.md) · MIT · **1.9.1**
3
+ [中文](README.zh.md) · MIT · **1.9.3**
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
- 1.9.0 moves the panel into DSH's official entry points: a Deep PTC settings page, and a Deep PTC tab in the right sidebar (environment, subagents, background jobs, output files, SSH connections, tool state) that the capsule under the composer opens. Visual effects render lightly and start off when an appearance plugin is installed. The plugin adds no keyboard shortcuts.
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
 
@@ -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 tab in the right sidebar** (also offered on the sidebar's new-tab guide). DSH docks, floats, splits and expands it like its own tabs.
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
- - **Subagents**: name, state, duration and tokens; a row opens that subagent's chat in the official right sidebar.
72
+ - **Subagents**: the state indicator and name on the left, with duration at the right of the same row; 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
- - **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`.
74
+ - **Output files**: files this conversation wrote or delivered, newest first; click to open the file in DSH's native preview. Three positions are available, with overflow folded 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 opens the tab. On a host without a right sidebar it opens the panel in place. It lives in the composer's own dock, so it never covers messages and is covered with the conversation when the sidebar goes fullscreen.
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.1" })
217
+ plugin_manager({ action: "install_bundle", target: "dsh-deep-ptc-mode@1.9.3" })
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.1.tgz"
220
+ // Or target: "C:\\path\\to\\dsh-deep-ptc-mode-1.9.3.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
- Every runtime feature serves only `deep-ptc` sessions: the tool directory, tool state and execution environment are still mounted by the Deep PTC preset; the skill-card state projection is registered once at the plugin root, but its `init(header)` activates only when `agentPreset === 'deep-ptc'`, so other sessions keep an empty, non-folding state. The command, `agent/pre-step` and client dock each check the preset again. Other modes only see the plugin settings page; the preset-identity layer returns any non-`deep-ptc` exact id unchanged.
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,12 +1,12 @@
1
1
  # 深度 PTC 模式
2
2
 
3
- [English](README.md) · MIT · 当前版本 **1.9.1**
3
+ [English](README.md) · MIT · 当前版本 **1.9.3**
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
- 1.9.0 把面板移进 DSH 官方入口:设置里有独立的「深度 PTC」页,右侧栏有「深度 PTC」页签(执行环境、子代理、后台任务、输出文件、SSH 连接、工具状态),输入框下方的小胶囊打开它。界面特效改为轻量渲染,检测到外观插件时默认关闭。不再添加任何快捷键。
9
+ 面板位于对话区侧边,包含执行环境、子代理、后台任务、输出文件、SSH 连接和工具状态。输入框下方保留小胶囊,用于展开和收起面板。设置里有独立的「深度 PTC」页。界面特效采用轻量渲染,检测到外观插件时默认关闭。
10
10
 
11
11
  ## 五个基本问题
12
12
 
@@ -67,14 +67,14 @@
67
67
  Deep PTC 的模式名称、设置页和会话界面会随 DSH「设置 → 通用 → 语言」在中文和英文之间切换。所有入口都使用 DSH 的官方扩展点,不改宿主布局,也不注册快捷键。
68
68
 
69
69
  - **设置 → 深度 PTC**:执行环境与 Shell、界面特效开关,以及可复制的诊断信息(反馈界面问题时附上)。
70
- - **右侧栏「深度 PTC」页签**(也在右侧栏的新建页签引导中):停靠、浮动、分屏、全屏都由 DSH 管理。
70
+ - **对话侧边的「深度 PTC」面板**。空间充足时默认显示,并随对话区尺寸调整。原生侧栏全屏覆盖对话时会隐藏,窄屏可通过下方胶囊展开。
71
71
  - **执行环境**:WSL、PowerShell、原生 Bash 或 Zsh,对之后新建的深度 PTC 会话生效。
72
- - **子代理**:名称、状态、用时和 token;点击在官方右侧栏打开该子代理的对话。
72
+ - **子代理**:状态指示与名称在左,用时在同一行的最右侧;点击在官方右侧栏打开该子代理的对话。
73
73
  - **后台任务**:最多六个位置,运行中优先且最多五条,已结束最多三条,超出部分合为一条可展开记录。
74
- - **输出文件**:本会话写入或交付的文件,最新的在前;最多三个位置,超出时折叠占一个位置。规则与 DSH 官方的交付卡片一致,并包括 `run_code` 里写入的文件。
74
+ - **输出文件**:本会话写入或交付的文件,最新的在前;点击通过 DSH 原生文件预览打开对应文件。最多三个位置,超出时折叠占一个位置。规则与 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.1" })
221
+ plugin_manager({ action: "install_bundle", target: "dsh-deep-ptc-mode@1.9.3" })
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.1.tgz"
224
+ // 或 target: "C:\\path\\to\\dsh-deep-ptc-mode-1.9.3.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
- 所有运行期功能只服务 `deep-ptc` 会话:工具目录、工具状态、执行环境仍由 Deep PTC 预设挂载;Skill 卡片的状态投影在插件根部注册一次,但 `init(header)` 只在 `agentPreset === 'deep-ptc'` 时激活,非 Deep PTC 会话的状态恒为空且不折叠任何事件。命令、`agent/pre-step` 和客户端 dock 还会各自检查 preset。其他模式只看到插件设置页;preset 身份兼容层对非 `deep-ptc` 的精确 id 直接原样返回。
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,13 @@
1
- # 1.7.3 实测汇总 / Test summary
1
+ # 1.9.3 测试报告 / Test report
2
+
3
+ > 1.9.3 界面调整:201 项自动化测试及结构检查通过。输出文件按钮覆盖普通/折叠列表、所属会话、相对/Windows/UNC 路径、中文及特殊字符、旧版预览接口和打开失败后的恢复。另使用真实 DSH Desktop 0.2.2-rc.2 文件地址解析器确认四类路径可由当前面板的打开函数正确还原。子代理行保留状态指示与辅助阅读标签,可见内容仅为名称和同一行右侧的用时。未做整窗目视验收。
4
+ > Version 1.9.3 UI changes: 201 tests and structural checks pass. Output-opening coverage includes folded entries, owning sessions, path encodings, the older viewer API and failure recovery. The actual DSH Desktop 0.2.2-rc.2 file-address parser correctly decodes four path cases generated by the current panel opener. Subagent rows retain indicators and accessible state labels, with only the name and right-aligned duration visible. No full-window visual review was performed.
5
+
6
+ > 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/视频端到端验证。
7
+ > 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.
8
+
9
+ > 2026-11-12 的本地修订通过 197 项自动化测试。新增覆盖独立侧边面板的收起、缩放和原生侧栏全屏避让,空白会话选择 Deep PTC 后的工具门禁与 Skill 投影,以及通用 SSH / DSH Go 资料复制。本机 DSH Desktop 0.2.2-rc.2 的实际选择方法允许空白会话切换,并拒绝首轮已开始后的切换。新布局尚未做整窗目视验证,也未连接真实 SSH 主机或手机。
10
+ > 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
11
 
3
12
  > 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
13
  > 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 = {
@@ -214,19 +216,24 @@ window.__ModuleLoader__.load({ id: 'dsh-deep-ptc-mode', factory: require => {
214
216
  skillHint: '关闭的 Skill 会在你发送下一条消息时移出上下文,历史记录不受影响。',
215
217
  skillKeepAll: '全部保留', skillCloseAll: '全部关闭', skillNoDescription: '无描述', skillThisTurn: '本轮',
216
218
  skillShowAll: '显示全部 {count} 个', skillShowLess: '收起',
217
- agentsTitle: '子代理', agentsRunning: '{count} 个运行中', agentsCompleted: '{count} 个已完成', agentsIdle: '{count} 个空闲',
219
+ agentsTitle: '子代理',
218
220
  agentRunning: '运行中', agentCompleted: '已完成', agentIdle: '空闲', agentExternal: '外部',
219
221
  agentOpen: '在右侧栏打开这个子代理的对话',
220
222
  sideTitle: '深度 PTC', toolsSection: '工具状态', envAuto: '自动', envForNew: '新会话生效', envThisSession: '本会话保持创建时的环境。',
221
223
  envAutoNow: '当前按自动选择:{env}。本会话保持创建时的环境。', envSaved: '已保存,之后新建的会话使用 {env}。',
222
224
  envFailed: '未能保存,请检查发行版名称或设置是否已在别处修改。', envDefaultDistribution: '默认发行版',
223
- durationSeconds: '{s} 秒', durationMinutes: '{m} 分 {s} 秒', durationHours: '{h} 小时 {m} 分', tokens: '{value} tokens',
225
+ durationSeconds: '{s} 秒', durationMinutes: '{m} 分 {s} 秒', durationHours: '{h} 小时 {m} 分',
224
226
  sideGuide: '执行环境、子代理、后台任务、输出文件与 SSH', sideOtherMode: '当前对话不是深度 PTC 模式。这里的执行环境用于之后新建的深度 PTC 会话。',
225
- capsuleOpen: '打开深度 PTC 面板',
227
+ capsuleOpen: '展开或收起侧边面板', panelClose: '收起侧边面板',
228
+ panelMoved: '深度 PTC 面板已回到对话区侧边,请使用输入框下方的胶囊展开。',
226
229
  outputsTitle: '输出文件', outputsEmpty: '本会话暂无输出文件。', outputsMore: '另有 {count} 个文件',
227
230
  outputPresented: '已交付', outputTurn: '第 {turn} 轮',
231
+ outputOpenFailed: '无法打开文件,请检查文件是否仍存在,以及宿主文件预览是否可用。',
228
232
  sshTitle: 'SSH 连接', sshHint: '非交互连接', sshNoClient: '未找到 OpenSSH 客户端', sshConfigured: '已配置',
229
233
  sshUsed: '第 {turn} 轮 · {count} 次', sshFailed: '第 {turn} 轮失败', sshEmpty: '~/.ssh/config 中没有主机别名,本会话也未连接过远程主机。',
234
+ sshCopy: '复制 SSH 检查命令', sshGoCopy: '复制 DSH Go 连接资料', sshCopied: '已复制', sshCopyFailed: '复制失败,请检查剪贴板权限。',
235
+ 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,授权信息在客户端填写。手机需要能访问这里的主机地址。',
236
+ sshUserNeeded: '在客户端填写远程用户名',
230
237
  appearance: '外观', visualEffectsAuto: '检测到外观插件 {name},特效默认关闭。手动打开后会保留你的选择。',
231
238
  diagTitle: '诊断信息', diagHint: '复制后可附在 issue 中,便于排查界面问题。', diagCopy: '复制诊断信息', diagCopied: '已复制',
232
239
  shellStore: 'PowerShell 7(应用商店)', presetSafeReason: '当前为安全模式:{reason}',
@@ -236,19 +243,24 @@ window.__ModuleLoader__.load({ id: 'dsh-deep-ptc-mode', factory: require => {
236
243
  skillHint: 'A closed skill leaves the model context when you send your next message. The history stays complete.',
237
244
  skillKeepAll: 'Keep all', skillCloseAll: 'Close all', skillNoDescription: 'No description', skillThisTurn: 'this turn',
238
245
  skillShowAll: 'Show all {count}', skillShowLess: 'Show less',
239
- agentsTitle: 'Subagents', agentsRunning: '{count} running', agentsCompleted: '{count} done', agentsIdle: '{count} idle',
246
+ agentsTitle: 'Subagents',
240
247
  agentRunning: 'Running', agentCompleted: 'Done', agentIdle: 'Idle', agentExternal: 'External',
241
248
  agentOpen: 'Open this subagent in the right sidebar',
242
249
  sideTitle: 'Deep PTC', toolsSection: 'Tool state', envAuto: 'Auto', envForNew: 'for new sessions', envThisSession: 'This session keeps the environment it was created with.',
243
250
  envAutoNow: 'Automatic picks {env}. This session keeps the environment it was created with.', envSaved: 'Saved. New sessions use {env}.',
244
251
  envFailed: 'Could not save. Check the distribution name, or whether settings changed elsewhere.', envDefaultDistribution: 'Default distribution',
245
- durationSeconds: '{s}s', durationMinutes: '{m}m {s}s', durationHours: '{h}h {m}m', tokens: '{value} tokens',
252
+ durationSeconds: '{s}s', durationMinutes: '{m}m {s}s', durationHours: '{h}h {m}m',
246
253
  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: 'Open the Deep PTC panel',
254
+ capsuleOpen: 'Expand or collapse the side panel', panelClose: 'Collapse the side panel',
255
+ panelMoved: 'The Deep PTC panel is beside the conversation. Use the capsule below the composer to expand it.',
248
256
  outputsTitle: 'Output files', outputsEmpty: 'No output files in this conversation.', outputsMore: '{count} more files',
249
257
  outputPresented: 'Delivered', outputTurn: 'Turn {turn}',
258
+ outputOpenFailed: 'Could not open the file. Check that it still exists and the host file preview is available.',
250
259
  sshTitle: 'SSH connections', sshHint: 'non-interactive', sshNoClient: 'OpenSSH client not found', sshConfigured: 'Configured',
251
260
  sshUsed: 'Turn {turn} · {count}×', sshFailed: 'Failed in turn {turn}', sshEmpty: 'No host aliases in ~/.ssh/config and no remote host reached in this conversation.',
261
+ sshCopy: 'Copy SSH check command', sshGoCopy: 'Copy DSH Go connection details', sshCopied: 'Copied', sshCopyFailed: 'Could not copy. Check clipboard permissions.',
262
+ 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.',
263
+ sshUserNeeded: 'Enter the remote user in the client',
252
264
  appearance: 'Appearance', visualEffectsAuto: '{name} is installed, so effects start off. Turning them on keeps your choice.',
253
265
  diagTitle: 'Diagnostics', diagHint: 'Copy and attach to an issue to help investigate interface problems.', diagCopy: 'Copy diagnostics', diagCopied: 'Copied',
254
266
  shellStore: 'PowerShell 7 (Microsoft Store)', presetSafeReason: 'Safe mode: {reason}',
@@ -283,7 +295,7 @@ window.__ModuleLoader__.load({ id: 'dsh-deep-ptc-mode', factory: require => {
283
295
  const COMPOSER = '[data-composer-card]';
284
296
  const BUBBLE = ':is([data-chat-flow-kind="user"],[data-chat-flow-kind="steering"]) [data-message-bubble]';
285
297
  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)}
298
+ .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
299
  .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
300
  ${DARK} .dpt-card{--dpt-card-fill:var(--dsw-static-neutral-850,#1a1f29)}
289
301
  .dpt-card-head{display:flex;align-items:center;gap:10px;padding:10px 12px 6px}
@@ -299,7 +311,7 @@ ${DARK} .dpt-card{--dpt-card-fill:var(--dsw-static-neutral-850,#1a1f29)}
299
311
  .dpt-card .dpt-btn:hover:not(:disabled){background:var(--dsw-alias-button-floating-hover,var(--dsw-alias-interactive-bg-hover,rgba(16,24,40,.05)))}
300
312
  .dpt-btn:disabled{opacity:.45;cursor:default}
301
313
  .dpt-btn[aria-busy="true"]{cursor:wait}
302
- .dpt-btn:focus-visible,.dpt-switch:focus-visible,.dpt-agent:focus-visible,.dpt-icon-btn:focus-visible,.dpt-link:focus-visible,.dpt-capsule:focus-visible{outline:2px solid var(--dpt-accent,#3370ff);outline-offset:2px}
314
+ .dpt-btn:focus-visible,.dpt-switch:focus-visible,.dpt-agent:focus-visible,.dpt-file-open:focus-visible,.dpt-icon-btn:focus-visible,.dpt-link:focus-visible,.dpt-capsule:focus-visible{outline:2px solid var(--dpt-accent,#3370ff);outline-offset:2px}
303
315
  .dpt-skill-list{list-style:none;margin:0;padding:0 4px 4px;display:flex;flex-direction:column;gap:2px}
304
316
  .dpt-skill{display:flex;align-items:center;gap:12px;padding:7px 8px 7px 10px;border-radius:10px;transition:background-color 120ms}
305
317
  .dpt-skill:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(16,24,40,.05))}
@@ -363,6 +375,10 @@ ${ON} .dpt-capsule[data-state="running"] .dpt-agent-dot,${ON} .dpt-agent[data-st
363
375
  .dpt-jobs-more .dpt-jobs-list{margin-top:4px}
364
376
  .dpt-agent-main{flex:1;min-width:0;display:flex;flex-direction:column}
365
377
  .dpt-agent-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
378
+ .dpt-side-agents .dpt-agent{align-items:center}
379
+ .dpt-side-agents .dpt-agent-dot{margin-top:0}
380
+ .dpt-side-agents .dpt-agent-name{flex:1;min-width:0}
381
+ .dpt-agent-duration{flex:none;margin-left:auto;font-size:11px;color:var(--dsw-alias-label-tertiary,#667085);font-variant-numeric:tabular-nums;white-space:nowrap}
366
382
  .dpt-agent-meta{font-size:11px;line-height:16px;color:var(--dsw-alias-label-tertiary,#667085);font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
367
383
  .dpt-capsule-row{display:flex;flex-direction:column;align-items:flex-end;padding:4px 2px 0}
368
384
  .dpt-capsule{display:inline-flex;align-items:center;gap:8px;max-width:100%;height:26px;padding:0 11px;box-sizing:border-box;border-radius:999px;border:1px solid var(--dpt-line);background:var(--dsw-alias-bg-base,#fff);color:var(--dsw-alias-label-secondary,#4a5565);font:inherit;font-size:12px;cursor:pointer;transition:border-color 120ms,color 120ms}
@@ -370,6 +386,12 @@ ${ON} .dpt-capsule[data-state="running"] .dpt-agent-dot,${ON} .dpt-agent[data-st
370
386
  .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
387
  .dpt-capsule .dpt-agent-dot{margin-top:0}
372
388
  .dpt-capsule-row>.dpt-panel{align-self:stretch}
389
+ .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}
390
+ .dpt-sidecar[data-floating]{border:1px solid var(--dpt-line);border-radius:12px;box-shadow:0 4px 20px #0002}
391
+ .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}
392
+ .dpt-sidecar-head h3{margin:0;font:inherit;font-weight:600}
393
+ .dpt-sidecar .dpt-panel{flex:1;height:auto;overflow:hidden}
394
+ [data-conversation-region="chat"][data-dpt-panel-open]{margin-right:var(--dpt-panel-width,280px)!important}
373
395
  .dpt-tab-title{display:inline-flex;align-items:center;gap:6px}
374
396
  .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
397
  .dpt-settings{display:grid;gap:22px;max-width:640px;font-size:13px;line-height:20px;color:var(--dsw-alias-label-primary,#101828)}
@@ -380,6 +402,7 @@ ${ON} .dpt-capsule[data-state="running"] .dpt-agent-dot,${ON} .dpt-agent[data-st
380
402
  .dpt-diag{margin:8px 0 0;padding:10px 12px;max-height:220px;overflow:auto;border-radius:10px;border:1px solid var(--dpt-line);font:11px/16px var(--ds-font-family-code,ui-monospace,monospace);white-space:pre-wrap;word-break:break-word}
381
403
  .dpt-files{display:grid;gap:1px;list-style:none;margin:0;padding:0}
382
404
  .dpt-file{display:flex;align-items:center;gap:6px;min-width:0;height:22px;padding:0 6px;border-radius:6px;font-size:12px;line-height:18px}
405
+ .dpt-file-open{box-sizing:border-box;width:100%;border:0;background:transparent;color:inherit;font-family:inherit;text-align:left;cursor:pointer}
383
406
  .dpt-file:hover{background:color-mix(in srgb,var(--dpt-accent) 6%,transparent)}
384
407
  .dpt-file-name{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--ds-font-family-code,ui-monospace,monospace);font-size:11.5px}
385
408
  .dpt-file-meta{flex:none;max-width:45%;font-size:11px;color:var(--dsw-alias-label-tertiary,#667085);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@@ -389,6 +412,8 @@ ${ON} .dpt-capsule[data-state="running"] .dpt-agent-dot,${ON} .dpt-agent[data-st
389
412
  .dpt-host .dpt-agent-dot{width:6px;height:6px;margin-top:0}
390
413
  .dpt-host[data-state="ok"] .dpt-agent-dot{background:var(--dsw-alias-state-success-primary,#0f7a4f)}
391
414
  .dpt-host[data-state="failed"] .dpt-agent-dot{background:var(--dsw-alias-state-error-primary,#c4321f)}
415
+ .dpt-ssh-actions{display:flex;gap:6px;padding:2px 6px 6px}
416
+ .dpt-ssh-actions .dpt-link{font-size:11px}
392
417
  [data-chat-flow-kind="command"]:has([data-dpt-hidden-command]){display:none!important}
393
418
  .dpt-command-error{padding:4px 2px;font-size:12px;line-height:18px;color:var(--dsw-alias-state-error-primary,#c4321f)}
394
419
  @keyframes dpt-rise{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@@ -919,12 +944,10 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
919
944
  const completed = !external && entry.activity === 'inactive' && timing?.lastTurnCompleted === true;
920
945
  const duration = timing === undefined || external ? undefined : timing.active === undefined ? timing.settledMs
921
946
  : timing.settledMs + Math.max(0, (running ? now : timing.active.through) - timing.active.since);
922
- const usage = summary?.projectionValues?.tokenUsage;
923
- const tokens = usage ? usage.uncachedInputTokens + usage.outputTokens + usage.cacheReadTokens + usage.cacheWriteTokens : undefined;
924
947
  rows.push({ id: entry.id, parentId, mode: entry.mode, depth,
925
948
  label: entry.label ?? summary?.title ?? summary?.displayTitle ?? entry.id,
926
949
  state: external ? 'external' : running ? 'running' : completed ? 'completed' : 'idle',
927
- duration: Number.isFinite(duration) ? duration : undefined, tokens: Number.isFinite(tokens) ? tokens : undefined });
950
+ duration: Number.isFinite(duration) ? duration : undefined });
928
951
  visit(entry.id, depth + 1);
929
952
  }
930
953
  };
@@ -939,12 +962,6 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
939
962
  if (total >= 60) return tf(t, 'durationMinutes', { m: Math.floor(total / 60), s });
940
963
  return tf(t, 'durationSeconds', { s });
941
964
  }
942
- function formatTokens(value) {
943
- if (value < 1000) return String(value);
944
- const scaled = value < 1e6 ? value / 1000 : value / 1e6;
945
- return `${scaled >= 100 ? Math.round(scaled) : Math.round(scaled * 10) / 10}${value < 1e6 ? 'k' : 'M'}`;
946
- }
947
-
948
965
  function openSubagent(row) {
949
966
  const sidebar = hostCtx?.get?.('sidebarRight');
950
967
  if (typeof sidebar?.openResource === 'function') {
@@ -1213,14 +1230,33 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
1213
1230
  const OUTPUT_PREVIEW_LIMIT = 3;
1214
1231
  const fileName = path => String(path).split(/[\\/]/u).filter(Boolean).at(-1) ?? String(path);
1215
1232
 
1216
- function OutputsSection({ outputs, t }) {
1233
+ function openOutputFile(sessionId, path) {
1234
+ // Use the same session-scoped resource address as the host's deliverable cards.
1235
+ const segment = value => encodeURIComponent(value).replace(/%3A/giu, ':');
1236
+ const normalized = path.replace(/\\/gu, '/').replace(/^(?:\.\/)+/u, '');
1237
+ const address = `dsh-resource://file/session/${segment(sessionId)}/${normalized.split('/').map(segment).join('/')}`;
1238
+ const sidebar = hostCtx?.get?.('sidebarRight');
1239
+ if (typeof sidebar?.openResourceIn === 'function') return sidebar.openResourceIn(sessionId, address);
1240
+ if (typeof sidebar?.openResource === 'function') return sidebar.openResource(address);
1241
+ throw new Error('File preview is unavailable');
1242
+ }
1243
+
1244
+ function OutputsSection({ sessionId, outputs, t }) {
1245
+ const [failed, setFailed] = React.useState(false);
1246
+ React.useEffect(() => setFailed(false), [sessionId]);
1247
+ async function open(path) {
1248
+ setFailed(false);
1249
+ try { await openOutputFile(sessionId, path); } catch { setFailed(true); }
1250
+ }
1217
1251
  const rows = Array.isArray(outputs) ? outputs : [];
1218
1252
  const overflow = rows.length > OUTPUT_PREVIEW_LIMIT;
1219
1253
  const visible = rows.slice(0, overflow ? OUTPUT_PREVIEW_LIMIT - 1 : OUTPUT_PREVIEW_LIMIT);
1220
1254
  const hidden = overflow ? rows.slice(visible.length) : [];
1221
- const row = item => h('li', { key: item.path, className: 'dpt-file', 'data-kind': item.kind, title: item.path },
1255
+ const row = item => h('li', { key: item.path },
1256
+ h('button', { type: 'button', className: 'dpt-file dpt-file-open', 'data-kind': item.kind, title: item.path,
1257
+ onClick: () => { void open(item.path); } },
1222
1258
  h('span', { className: 'dpt-file-name' }, fileName(item.path)),
1223
- h('span', { className: 'dpt-file-meta' }, item.kind === 'presented' ? t('outputPresented') : tf(t, 'outputTurn', { turn: item.turn })));
1259
+ h('span', { className: 'dpt-file-meta' }, item.kind === 'presented' ? t('outputPresented') : tf(t, 'outputTurn', { turn: item.turn }))));
1224
1260
  const title = t('outputsTitle');
1225
1261
  return h('section', { className: 'dpt-side-section dpt-side-files', 'aria-label': title },
1226
1262
  h('div', { className: 'dpt-side-label' }, h('span', null, title), rows.length ? h('span', { className: 'dpt-side-hint' }, String(rows.length)) : null),
@@ -1228,12 +1264,14 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
1228
1264
  hidden.length ? h('li', { className: 'dpt-files-more' },
1229
1265
  h('details', null, h('summary', null, tf(t, 'outputsMore', { count: hidden.length })),
1230
1266
  h('ul', { className: 'dpt-files' }, ...hidden.map(row)))) : null)
1231
- : h('p', { className: 'dpt-side-note' }, t('outputsEmpty')));
1267
+ : h('p', { className: 'dpt-side-note' }, t('outputsEmpty')),
1268
+ failed ? h('p', { className: 'dpt-side-note', role: 'status' }, t('outputOpenFailed')) : null);
1232
1269
  }
1233
1270
 
1234
1271
  // SSH: the configured host aliases and the hosts this conversation reached, most recent first.
1235
1272
  function SshSection({ form, ssh, t }) {
1236
1273
  const settings = useSettingsForm(form);
1274
+ const [copyStatus, setCopyStatus] = React.useState();
1237
1275
  const configured = settings.status === 'ready' && Array.isArray(settings.value?.sshHosts) ? settings.value.sshHosts : [];
1238
1276
  const client = settings.status === 'ready' ? settings.value?.sshClient : undefined;
1239
1277
  const used = Array.isArray(ssh) ? ssh : [];
@@ -1241,26 +1279,48 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
1241
1279
  const rows = [...used.map(row => ({ host: row.host, used: row, config: configured.find(item => item.alias === row.host) })),
1242
1280
  ...configured.filter(item => !names.has(item.alias)).map(item => ({ host: item.alias, config: item }))];
1243
1281
  const endpoint = config => config ? [config.user ? `${config.user}@` : '', config.hostName || '', config.port && config.port !== '22' ? `:${config.port}` : ''].join('') : '';
1282
+ async function copyHost(item, go) {
1283
+ const config = item.config;
1284
+ let text;
1285
+ if (go) {
1286
+ text = tf(t, 'sshGoDetails', { host: config?.hostName || item.host, port: config?.port || '22',
1287
+ user: config?.user || t('sshUserNeeded'), alias: item.host });
1288
+ } else {
1289
+ const value = settings.value;
1290
+ const powershell = effectiveEnvironment(value?.environment ?? 'auto', value?.hostPlatform) === 'powershell';
1291
+ const quoteEscape = powershell ? "''" : "'\\''";
1292
+ const host = "'" + item.host.replaceAll("'", quoteEscape) + "'";
1293
+ text = `ssh -o BatchMode=yes -o ConnectTimeout=10 -o ConnectionAttempts=1 -- ${host} hostname`;
1294
+ }
1295
+ try {
1296
+ await navigator.clipboard.writeText(text);
1297
+ setCopyStatus('sshCopied');
1298
+ } catch { setCopyStatus('sshCopyFailed'); }
1299
+ }
1244
1300
  const title = t('sshTitle');
1245
1301
  return h('section', { className: 'dpt-side-section dpt-side-ssh', 'aria-label': title },
1246
1302
  h('div', { className: 'dpt-side-label' }, h('span', null, title),
1247
1303
  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, className: 'dpt-file dpt-host',
1304
+ rows.length ? h('ul', { className: 'dpt-files' }, ...rows.slice(0, 8).map(item => h('li', { key: item.host },
1305
+ h('div', { className: 'dpt-file dpt-host',
1249
1306
  'data-state': item.used ? (item.used.ok ? 'ok' : 'failed') : 'idle', title: endpoint(item.config) || item.host },
1250
1307
  h('span', { className: 'dpt-agent-dot', 'aria-hidden': 'true' }),
1251
1308
  h('span', { className: 'dpt-file-name' }, item.host),
1252
1309
  h('span', { className: 'dpt-file-meta' }, item.used
1253
1310
  ? tf(t, item.used.ok ? 'sshUsed' : 'sshFailed', { count: item.used.count, turn: item.used.turn })
1254
- : endpoint(item.config) || t('sshConfigured')))))
1255
- : h('p', { className: 'dpt-side-note' }, t('sshEmpty')));
1311
+ : endpoint(item.config) || t('sshConfigured'))),
1312
+ h('div', { className: 'dpt-ssh-actions' },
1313
+ h('button', { type: 'button', className: 'dpt-link', onClick: () => { void copyHost(item, false); } }, t('sshCopy')),
1314
+ h('button', { type: 'button', className: 'dpt-link', onClick: () => { void copyHost(item, true); } }, t('sshGoCopy'))))))
1315
+ : h('p', { className: 'dpt-side-note' }, t('sshEmpty')),
1316
+ copyStatus ? h('p', { className: 'dpt-side-note', role: 'status' }, t(copyStatus)) : null);
1256
1317
  }
1257
1318
 
1258
1319
  function projectionValue(useProjection, key) {
1259
1320
  try { return typeof useProjection === 'function' ? useProjection(key) : undefined; } catch { return undefined; }
1260
1321
  }
1261
1322
 
1262
- // The Deep PTC panel: one conversation's environment, subagents, jobs, outputs, SSH and tool state.
1263
- // It is the right sidebar tab, or opens under the composer where the host has no right sidebar.
1323
+ // One conversation's environment, subagents, jobs, outputs, SSH and tool state.
1264
1324
  function DeepPtcPanel({ sessionId, useSessions, useProjection, useJobs, watchJobs, reset, form, inline, t }) {
1265
1325
  const sessions = typeof useSessions === 'function' ? useSessions(state => state) : undefined;
1266
1326
  const preset = projectionValue(useProjection, 'agentPreset');
@@ -1269,47 +1329,119 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
1269
1329
  const deep = preset === 'deep-ptc';
1270
1330
  const rows = deep ? subagentRows(sessions, sessionId, now) : [];
1271
1331
  const running = rows.filter(row => row.state === 'running').length;
1272
- const completed = rows.filter(row => row.state === 'completed').length;
1273
1332
  React.useEffect(() => {
1274
1333
  if (running === 0) return undefined;
1275
1334
  const timer = setInterval(() => setNow(Date.now()), 1000);
1276
1335
  return () => clearInterval(timer);
1277
1336
  }, [running > 0]);
1278
- const summary = [running ? tf(t, 'agentsRunning', { count: running }) : null, completed ? tf(t, 'agentsCompleted', { count: completed }) : null,
1279
- rows.length - running - completed > 0 ? tf(t, 'agentsIdle', { count: rows.length - running - completed }) : null].filter(Boolean).join(' · ');
1280
1337
  const stateText = row => row.state === 'running' ? t('agentRunning') : row.state === 'completed' ? t('agentCompleted') : row.state === 'external' ? t('agentExternal') : t('agentIdle');
1281
1338
  return h('div', { className: 'dpt-panel', 'data-inline': inline ? '' : undefined, 'aria-label': t('sideTitle') },
1282
1339
  h('div', { className: 'dpt-side-body' },
1283
1340
  form ? h(EnvironmentSection, { form, t }) : null,
1284
1341
  !deep ? h('section', { className: 'dpt-side-section' }, h('p', { className: 'dpt-side-note' }, t('sideOtherMode'))) : null,
1285
1342
  deep && rows.length ? h('section', { className: 'dpt-side-section dpt-side-agents', 'aria-label': t('agentsTitle') },
1286
- h('div', { className: 'dpt-side-label' }, h('span', null, t('agentsTitle')), h('span', { className: 'dpt-side-hint', title: summary }, summary)),
1287
- h('ol', { className: 'dpt-agents-list' }, ...rows.map(row => {
1288
- const meta = [stateText(row), row.duration !== undefined ? formatDuration(row.duration, t) : null,
1289
- row.tokens !== undefined ? tf(t, 'tokens', { value: formatTokens(row.tokens) }) : null].filter(Boolean).join(' · ');
1290
- return h('li', { key: row.id }, h('button', { type: 'button', className: 'dpt-agent', 'data-state': row.state, style: { '--dpt-depth': row.depth },
1343
+ h('div', { className: 'dpt-side-label' }, h('span', null, t('agentsTitle'))),
1344
+ h('ol', { className: 'dpt-agents-list' }, ...rows.map(row =>
1345
+ h('li', { key: row.id }, h('button', { type: 'button', className: 'dpt-agent', 'data-state': row.state,
1346
+ 'aria-label': `${row.label} · ${stateText(row)}`, style: { '--dpt-depth': row.depth },
1291
1347
  disabled: row.state === 'external', title: t('agentOpen'), onClick: () => openSubagent(row) },
1292
1348
  h('span', { className: 'dpt-agent-dot', 'aria-hidden': 'true' }),
1293
- h('span', { className: 'dpt-agent-main' }, h('span', { className: 'dpt-agent-name', title: row.label }, row.label),
1294
- h('span', { className: 'dpt-agent-meta' }, meta))));
1295
- }))) : null,
1349
+ h('span', { className: 'dpt-agent-name', title: row.label }, row.label),
1350
+ row.duration !== undefined ? h('span', { className: 'dpt-agent-duration' }, formatDuration(row.duration, t)) : null))))) : null,
1296
1351
  deep ? (typeof useJobs === 'function' && typeof watchJobs === 'function'
1297
1352
  ? h(LiveBackgroundJobs, { key: `jobs:${sessionId}`, sessionId, useJobs, watchJobs, t })
1298
1353
  : h(BackgroundJobs, { key: `jobs:${sessionId}`, jobs: sessions?.jobsBySession?.[sessionId], t })) : null,
1299
- deep ? h(OutputsSection, { outputs: activity?.outputs, t }) : null,
1354
+ deep ? h(OutputsSection, { sessionId, outputs: activity?.outputs, t }) : null,
1300
1355
  h(SshSection, { form, ssh: deep ? activity?.ssh : undefined, t }),
1301
1356
  deep && typeof reset === 'function' ? h(ToolStateControls, { sessionId, useProjection, reset, t }) : null,
1302
1357
  h(VisualEffectsSection, { t })));
1303
1358
  }
1304
1359
 
1305
- // The capsule under the composer: a glance at the environment, subagents and tool notices. It opens
1306
- // the Deep PTC tab in the right sidebar, so it sits in the composer's own dock and never over messages.
1360
+ const PANEL_WIDTH = 280;
1361
+ const PANEL_MIN_ROOM = 820;
1362
+ const PANEL_COLLAPSED_KEY = `${PLUGIN}:side-panel-collapsed`;
1363
+ const readPanelCollapsed = () => {
1364
+ try { return localStorage.getItem(PANEL_COLLAPSED_KEY) === '1'; } catch { return false; }
1365
+ };
1366
+
1367
+ // Measure the conversation itself, so the panel follows native sidebar resizing and is hidden
1368
+ // when that conversation is covered by a fullscreen sidebar.
1369
+ function useSidePanelLayout(sessionId, marker) {
1370
+ const [layout, setLayout] = React.useState();
1371
+ React.useEffect(() => {
1372
+ if (typeof document === 'undefined' || typeof ReactDOM?.createPortal !== 'function') return undefined;
1373
+ let frame;
1374
+ let previous;
1375
+ const watched = new Set();
1376
+ const resize = typeof ResizeObserver === 'function' ? new ResizeObserver(schedule) : undefined;
1377
+ function measure() {
1378
+ frame = undefined;
1379
+ const region = marker.current?.closest?.('[data-conversation-region="chat"]')
1380
+ ?? [...document.querySelectorAll('[data-conversation-region="chat"]')]
1381
+ .find(node => node.getAttribute('data-conversation-session') === sessionId);
1382
+ const rect = region?.getBoundingClientRect();
1383
+ const room = region?.parentElement?.getBoundingClientRect() ?? rect;
1384
+ const fullscreen = [...document.querySelectorAll('[data-sidebar-right-panel="fullscreen"][data-sidebar-right-open]')]
1385
+ .some(node => node.getClientRects().length > 0);
1386
+ if (!rect || rect.width <= 0 || rect.height <= 0 || fullscreen || region.closest('[hidden],[aria-hidden="true"]')) {
1387
+ if (previous !== undefined) { previous = undefined; setLayout(undefined); }
1388
+ return;
1389
+ }
1390
+ const targets = [region, region.parentElement].filter(Boolean);
1391
+ for (const node of watched) {
1392
+ if (!targets.includes(node)) { resize?.unobserve(node); watched.delete(node); }
1393
+ }
1394
+ for (const node of targets) {
1395
+ if (node && !watched.has(node)) { resize?.observe(node); watched.add(node); }
1396
+ }
1397
+ const wide = room.width >= PANEL_MIN_ROOM;
1398
+ const composer = region.querySelector('[data-composer-seat]')?.getBoundingClientRect();
1399
+ const next = { region, wide, top: Math.round(rect.top), right: Math.round(window.innerWidth - room.right),
1400
+ height: Math.round(wide ? rect.height : Math.max(0, Math.min(rect.height, (composer?.top ?? rect.bottom) - rect.top - 8))),
1401
+ width: Math.min(PANEL_WIDTH, Math.max(0, room.width - 24)) };
1402
+ const same = previous?.region === region && ['wide', 'top', 'right', 'height', 'width'].every(key => previous[key] === next[key]);
1403
+ if (!same) { previous = next; setLayout(next); }
1404
+ }
1405
+ function schedule() {
1406
+ if (frame === undefined) frame = requestAnimationFrame(measure);
1407
+ }
1408
+ const changes = typeof MutationObserver === 'function' ? new MutationObserver(records => {
1409
+ if (!previous?.region?.isConnected || records.some(record => record.type === 'attributes'
1410
+ && (record.target.contains(previous?.region) || record.target.matches?.('[data-sidebar-right-panel]')))) schedule();
1411
+ }) : undefined;
1412
+ changes?.observe(document.body, { subtree: true, childList: true, attributes: true,
1413
+ attributeFilter: ['class', 'style', 'hidden', 'aria-hidden', 'data-sidebar-right-panel', 'data-sidebar-right-open'] });
1414
+ window.addEventListener('resize', schedule);
1415
+ measure();
1416
+ return () => {
1417
+ resize?.disconnect(); changes?.disconnect();
1418
+ window.removeEventListener('resize', schedule);
1419
+ if (frame !== undefined) cancelAnimationFrame(frame);
1420
+ };
1421
+ }, [sessionId, marker]);
1422
+ return layout;
1423
+ }
1424
+
1425
+ // The capsule stays under the composer and toggles the independent conversation-side panel.
1307
1426
  function Capsule(props) {
1308
- const { sessionId, useSessions, useProjection, form, openPanel, t } = props;
1427
+ const { sessionId, useSessions, useProjection, form, t } = props;
1428
+ const marker = React.useRef(null);
1429
+ const layout = useSidePanelLayout(sessionId, marker);
1309
1430
  const sessions = typeof useSessions === 'function' ? useSessions(state => state) : undefined;
1310
1431
  const tools = projectionValue(useProjection, 'deepPtcTools');
1311
1432
  const settings = useSettingsForm(form);
1312
- const [open, setOpen] = React.useState(false);
1433
+ const [collapsed, setCollapsed] = React.useState(readPanelCollapsed);
1434
+ const [peek, setPeek] = React.useState(false);
1435
+ React.useEffect(() => setPeek(false), [sessionId, layout?.wide]);
1436
+ const docked = !!layout?.wide && !collapsed;
1437
+ const open = docked || peek;
1438
+ React.useEffect(() => {
1439
+ const region = layout?.region;
1440
+ if (!region) return undefined;
1441
+ region.toggleAttribute('data-dpt-panel-open', docked);
1442
+ region.style.setProperty('--dpt-panel-width', `${layout.width}px`);
1443
+ return () => { region.removeAttribute('data-dpt-panel-open'); region.style.removeProperty('--dpt-panel-width'); };
1444
+ }, [layout?.region, layout?.width, docked]);
1313
1445
  const rows = subagentRows(sessions, sessionId, Date.now());
1314
1446
  const running = rows.filter(row => row.state === 'running').length;
1315
1447
  React.useEffect(() => {
@@ -1320,12 +1452,25 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
1320
1452
  const environment = settings.status === 'ready' && settings.value ? envLabel(settings.value.environment ?? 'auto', t) : undefined;
1321
1453
  const label = [environment, rows.length ? `${t('agentsTitle')} ${rows.length}` : null, failures ? `${t('toolFailures')} ${failures}` : null]
1322
1454
  .filter(Boolean).join(' · ') || t('sideTitle');
1323
- const toggle = () => { if (!openPanel?.()) setOpen(value => !value); };
1324
- return h('div', { className: 'dpt-capsule-row' },
1455
+ const toggle = () => {
1456
+ if (layout?.wide) {
1457
+ const next = !collapsed;
1458
+ setCollapsed(next);
1459
+ try { localStorage.setItem(PANEL_COLLAPSED_KEY, next ? '1' : '0'); } catch { /* viewer preference */ }
1460
+ } else setPeek(value => !value);
1461
+ };
1462
+ const panel = open && layout ? ReactDOM.createPortal(h('aside', { className: 'dpt-sidecar',
1463
+ 'data-floating': docked ? undefined : '', 'aria-label': t('sideTitle'),
1464
+ style: { top: layout.top, right: layout.right, height: layout.height, width: layout.width } },
1465
+ h('header', { className: 'dpt-sidecar-head' }, h('h3', null, t('sideTitle')),
1466
+ h('button', { type: 'button', className: 'dpt-icon-btn', onClick: toggle, 'aria-label': t('panelClose') }, '×')),
1467
+ h(DeepPtcPanel, props)), document.body) : null;
1468
+ return h('div', { ref: marker, className: 'dpt-capsule-row' },
1325
1469
  h('button', { type: 'button', className: 'dpt-capsule', 'data-state': running ? 'running' : 'idle', 'aria-expanded': open,
1326
1470
  title: t('capsuleOpen'), onClick: toggle },
1327
1471
  h('span', { className: 'dpt-agent-dot', 'aria-hidden': 'true' }), h('span', null, label)),
1328
- open ? h(DeepPtcPanel, { ...props, inline: true }) : null);
1472
+ panel,
1473
+ open && !layout && typeof ReactDOM?.createPortal !== 'function' ? h(DeepPtcPanel, { ...props, inline: true }) : null);
1329
1474
  }
1330
1475
 
1331
1476
  // A boundary keeps a failing bridge or panel from taking the conversation with it.
@@ -1354,8 +1499,8 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
1354
1499
  return h(Boundary, null, h(Capsule, props));
1355
1500
  }
1356
1501
 
1357
- function TabHost(props) {
1358
- return h(Boundary, null, h(DeepPtcPanel, props));
1502
+ function TabHost({ t }) {
1503
+ return h('p', { className: 'dpt-side-note' }, t('panelMoved'));
1359
1504
  }
1360
1505
 
1361
1506
  function TabTitle({ t }) {
@@ -1407,7 +1552,7 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
1407
1552
  }
1408
1553
  const TAB_KIND = 'deep-ptc';
1409
1554
 
1410
- // Per-conversation props shared by the composer capsule and the right sidebar tab.
1555
+ // Per-conversation props for the panel and its composer capsule.
1411
1556
  function sessionTools(child) {
1412
1557
  return sessionId => {
1413
1558
  const jobs = child.get?.('jobs');
@@ -1426,23 +1571,6 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
1426
1571
  };
1427
1572
  }
1428
1573
 
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
1574
  function apply(ctx) {
1447
1575
  hostCtx = ctx;
1448
1576
  const t = ctx.locale.bind('deep-ptc');
@@ -1505,21 +1633,19 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
1505
1633
  child.slots.inject('conversation.composer.dock', () => child.slots.register({
1506
1634
  name: 'conversation.composer.dock', id: 'deep-ptc-side', order: 89, locale: 'deep-ptc',
1507
1635
  inject: sessionTools(child),
1508
- }, props => h(LocalizedSlot, { ...props, form, openPanel, component: DockHost })));
1636
+ }, props => h(LocalizedSlot, { ...props, form, component: DockHost })));
1509
1637
  } catch { /* the composer stays usable when this slot cannot register */ }
1510
1638
  });
1511
1639
  } catch { /* the composer stays usable when this slot cannot register */ }
1512
1640
  try {
1513
- // The panel is a page type of the official right sidebar: the host places, docks, floats and
1514
- // hides it, and lists it on the sidebar's new-tab guide.
1641
+ // Saved 1.9.0 sidebar tabs show a migration hint. New entries use the composer capsule.
1515
1642
  ctx.inject?.(['remote', 'remote.commands', 'sidebarRightTabs'], child => {
1516
1643
  child.effect(() => {
1517
1644
  const dispose = child.sidebarRightTabs.register({
1518
1645
  id: PLUGIN, kind: TAB_KIND, title: () => t('sideTitle'),
1519
- guide: [{ id: TAB_KIND, order: 60, title: () => t('sideTitle'), description: () => t('sideGuide') }],
1646
+ guide: [],
1520
1647
  });
1521
- tabRegistered = true;
1522
- return () => { tabRegistered = false; dispose(); };
1648
+ return dispose;
1523
1649
  }, `${PLUGIN}: sidebar tab type`);
1524
1650
  child.slots.inject('sidebar.right.pane.tab', () => child.slots.register({
1525
1651
  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
+ }
@@ -50,8 +50,8 @@ export function catalogDescriptions(value) {
50
50
  }
51
51
 
52
52
  export function blankSkillState(header) {
53
- // The projection init receives the session header. Inactive sessions never fold
54
- // skill events, so the card state exists only for Deep PTC sessions.
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; }
@@ -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: 1,
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; the Windows aliases below are in the Windows profile and can be used with `-F /mnt/c/Users/<user>/.ssh/config` when the distribution has none of its own.');
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
  }
@@ -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
 
@@ -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.header?.agentPreset !== DEEP_PTC) return { kind: 'error', text: 'This command is available in Deep PTC sessions only. / 该功能仅在深度 PTC 会话中可用。' };
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": "DeepSeek Harness agent mode with interruptible background jobs, selectable shells, a right-sidebar panel for subagents, jobs, output files and SSH, and compatibility with official and third-party plugins. The interface follows DSH's Chinese or English language setting.",
4
+ "description": "Deep PTC builds on official PTC with interruptible jobs, selectable shells and a conversation-side panel. Click output files to open them; compact subagent rows show names and duration. Use drawing, design and research tools on demand, with general SSH and DSH Go assistance. 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": "适用于 DeepSeek Harness 的深度 PTC 模式:可插话的后台任务、可选执行环境,右侧栏面板列出子代理、后台任务、输出文件与 SSH 连接,兼容官方与第三方插件。界面随 DSH 设置自动切换中英文。",
4
+ "description": "基于官方 PTC 的深度模式:可插话的后台任务、可选执行环境和对话侧边面板,输出文件可点击打开,子代理行简洁展示名字与用时。按需使用绘图、设计和研究工具,提供通用 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.1",
4
- "description": "Deep PTC mode for DeepSeek Harness: interruptible background jobs, selectable shells, a right-sidebar panel with output files and SSH, a bilingual UI, and compatibility with official and third-party plugins.",
3
+ "version": "1.9.3",
4
+ "description": "Deep PTC for DeepSeek Harness: interruptible jobs, selectable shells, a side panel with clickable outputs and compact subagent rows, 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",
@@ -19,7 +19,7 @@
19
19
  "tool-cooperation",
20
20
  "official-ptc-fallback",
21
21
  "ssh",
22
- "right-sidebar"
22
+ "side-panel"
23
23
  ],
24
24
  "license": "MIT",
25
25
  "author": {
@@ -44,7 +44,8 @@
44
44
  "README.zh.md",
45
45
  "CHANGELOG.md",
46
46
  "assets/icon.png",
47
- "TEST_REPORT.md"
47
+ "TEST_REPORT.md",
48
+ "COMPATIBILITY.md"
48
49
  ],
49
50
  "engines": {
50
51
  "node": ">=24",