dsh-deep-ptc-mode 1.9.3 → 1.9.5

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,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.5 — 2026-11-14
4
+
5
+ - 插件启动不再等待任何宿主服务(#18)。技能卡、工具状态和输出/SSH 记录在各自服务就绪后自行启动;晚注册的会话投影首次读取时会折叠完整日志,不丢记录。预设在后台发布,只有打开深度 PTC 会话时才会等待首次发布完成,不会拖住整个 Host 启动。感谢 @Freezecatmeow 定位问题并提交 #19。
6
+ - 界面特效不再改写宿主的配色变量、字体和全站控件过渡(#17)。特效只作用于输入框、发送键、消息气泡、回复排版和会话行,私有变量固定定义在根元素上;在深度 PTC 会话之间切换时特效不会先摘后挂,离开时延迟 150ms 关闭。减少动态效果模式只针对这些元素生效。
7
+ - README 新增贡献者名单。
8
+ - Plugin startup no longer waits for any host service (#18). The skill card, tool state and output/SSH activity start when their services are ready; a projection registered late folds the whole log on first read. The preset publishes in the background, and only opening a Deep PTC conversation waits for the first publication, so the Host boot is never held. Thanks to @Freezecatmeow for the diagnosis and #19.
9
+ - Visual effects no longer rewrite host colour tokens, fonts or transitions on every control (#17). They touch only the composer, send button, message bubbles, reply typography and session rows; private variables are defined once on the root. Moving between Deep PTC conversations keeps the effects on instead of removing and re-adding them, and leaving waits 150ms before switching off. Reduced motion applies to those elements only.
10
+ - Add a contributors section to the README.
11
+
12
+ ## 1.9.4 — 2026-11-13
13
+
14
+ - 胶囊位置可选:自动 / 输入框下方 / 工具栏 / 隐藏。「自动」检测到 dsh-claude-style 时把胶囊放进输入框工具栏(`conversation.input.right`),不再单独占一行(#16,也补上 #12 的第 3 点)。隐藏后,右侧栏新建页签引导中会出现「深度 PTC」,页签内的按钮可打开面板。
15
+ - 侧边面板左边缘可拖动调整宽度,也可用方向键(Shift 加大步长)、Home/End 调整,双击恢复 280px。宽度按浏览器保存,并限制在 240–640px;停靠时对话区至少保留 540px。
16
+ - 固定在右下角的悬浮挂件(dsh-whale-widget)不再遮住面板底部按钮:面板正文按重叠高度留出空间。
17
+ - Capsule position: auto, below the composer, toolbar or hidden. Auto puts the capsule in the composer toolbar (`conversation.input.right`) beside dsh-claude-style instead of on its own row (#16; also #12 item 3). When the capsule is hidden, the Deep PTC tab appears on the sidebar's new-tab guide and opens the panel.
18
+ - The side panel's left edge resizes it by dragging, arrow keys (Shift for larger steps) or Home/End; a double click restores 280px. The width is remembered per browser and kept within 240–640px, leaving at least 540px for a docked conversation.
19
+ - A widget pinned to the bottom-right corner (dsh-whale-widget) no longer covers the panel's last controls.
20
+
3
21
  ## 1.9.3 — 2026-11-12
4
22
 
5
23
  - 侧边输出文件可点击,使用 DSH 原生文件资源接口按所属会话打开;兼容折叠列表、相对路径、Windows/UNC 路径及带中文和特殊字符的文件名,预览不可用时显示提示。
package/COMPATIBILITY.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # 插件协作与验证范围 / Plugin workflows and verification
2
2
 
3
- Deep PTC **1.9.3** · 核对日期:2026-11-12。接口验证使用 DSH Desktop 0.2.2-rc.2 的校验器与 SDK 渲染器、内嵌 Node 24.21.0。
3
+ Deep PTC **1.9.5** · 核对日期:2026-11-13(界面插件);插件协作部分核对于 2026-11-12。接口验证使用 DSH Desktop 0.2.2-rc.2 的校验器与 SDK 渲染器、内嵌 Node 24.21.0。
4
4
 
5
5
  ## 可以配合完成哪些工作
6
6
 
@@ -37,6 +37,33 @@ DSH Go 的连接资料是额外便利:按远端系统选择托管启动或连
37
37
 
38
38
  外观重叠时,可关闭 Deep PTC 额外界面特效,必要时收起对话侧边面板。关闭特效不修改其他插件的工具注册与执行方式。
39
39
 
40
+ ### 界面插件(关闭特效后)
41
+
42
+ 不为其他界面插件单独适配主题。目标是:关闭 Deep PTC 界面特效后,Deep PTC 的胶囊、侧边面板和按钮不变形、不错位。特效关闭时,`body[data-dpt-ui]` 不挂载,所有特效规则和指针、键盘监听都不生效。保留的只有 `.dpt-*` 命名空间内的胶囊、侧边面板(`position:fixed; z-index:20`)和 Skill 卡片。
43
+
44
+ 2026-11-13 按 GitHub `dsh-plugin` 话题的 star 数,选取主要功能为网页界面的前 10 个插件,对 npm/GitHub 发布包做静态核对(未安装、未执行):
45
+
46
+ | 插件 | 核对版本 | 关闭特效后的情况 |
47
+ | --- | --- | --- |
48
+ | DeepSeek-Balance-Whale-Widget | 0.4.2 | 鲸鱼固定在窗口右下角,层级高,会盖住侧边面板底部的按钮。**已处理**:面板正文按重叠高度留出底部空间 |
49
+ | dsh-wallpaper-engine | 1.4.2 | 只改背景与玻璃效果,不改 Deep PTC 控件;面板沿用宿主背景变量 |
50
+ | dsh-pet | 0.4.8 | 独立 Electron 窗口,不进入网页 DOM |
51
+ | DSH-better-sidebar | 0.32.1 | 底部工作台压缩对话列高度;面板按对话区实际尺寸测量,会跟随 |
52
+ | dsh-context | 0.84.1 | 使用右侧栏页签与 `conversation.input.overlay`,与 Deep PTC 控件无重叠 |
53
+ | dsh-deep-whale(皮肤管理器) | 0.1.9 | 通过宿主变量换肤;面板使用同一组变量 |
54
+ | dsh-genui | 0.16.0 | 在回复内渲染组件,并使用 `conversation.input.dock`(输入框上方) |
55
+ | dsh-startup-screen | 1.3.0 | 启动遮罩层级 2147483000,高于面板,仅在启动时出现 |
56
+ | dsh-ads | 0.1.4 | 弹窗层级高于面板,属该插件的设计 |
57
+ | dsh-synapse | 0.5.7 | 画布工作区层级 100/200,高于面板 |
58
+ | dsh-claude-style(议题 #16) | 0.21.0 | 输入框收成一行后,胶囊会单独占一行。**已处理**:胶囊移入工具栏槽位 `conversation.input.right`,见下 |
59
+
60
+ 胶囊位置在「设置 → 深度 PTC → 外观」中调整:
61
+
62
+ - **自动**(默认):检测到 dsh-claude-style 时放进工具栏,否则放在输入框下方。
63
+ - **输入框下方** / **工具栏** / **隐藏**:手动指定。
64
+
65
+ 选择「隐藏」时,右侧栏的新建页签引导会列出「深度 PTC」页签,可从页签里的按钮打开面板。dsh-cost-meter 同样占用 `composer.dock`,两者各占一行,不会重叠。
66
+
40
67
  本版没有为这些插件增加运行时依赖、轮询、固定常驻工具清单或每款插件专属提示词。只有用户选择 Deep PTC 的会话使用其适配逻辑;第三方自身的权限、沙箱和运行条件仍生效。
41
68
 
42
69
  ## 验证与来源
@@ -49,8 +76,10 @@ DSH Go 的连接资料是额外便利:按远端系统选择托管启动或连
49
76
 
50
77
  ## English
51
78
 
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.
79
+ Deep PTC 1.9.5 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
80
 
54
81
  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
82
 
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.
83
+ With the Deep PTC visual effects off, the ten most-starred web UI plugins on the `dsh-plugin` topic (checked statically on 2026-11-13) leave the capsule, side panel and buttons intact. Two cases are handled: the bottom-right whale widget no longer covers the panel's last controls, and with dsh-claude-style the capsule joins the composer toolbar (`conversation.input.right`) instead of taking its own row (#16). The capsule position (auto, below the composer, toolbar, hidden) is a viewer setting. When the capsule is hidden, the Deep PTC sidebar tab provides the way back to the panel.
84
+
85
+ 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.3**
3
+ [中文](README.zh.md) · MIT · **1.9.5**
4
4
 
5
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
- 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.
9
+ The panel sits beside the conversation and shows the environment, subagents, jobs, output files, SSH connections and tool state. The panel width can be dragged. The capsule expands or collapses it; it sits below the composer by default and can move into the toolbar or be hidden. 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
 
@@ -74,9 +74,10 @@ The Deep PTC mode label, settings, and conversation UI switch between Chinese an
74
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 toggles the independent side panel. Saved 1.9.0 sidebar tabs show a migration hint.
77
+ - **The capsule** shows the environment, subagent count and tool notices, and toggles the independent side panel. Its position is a setting (Settings → Deep PTC → Appearance): auto, below the composer, in the composer toolbar, or hidden. Auto uses the toolbar beside dsh-claude-style so a one-row composer stays one row. When hidden, open the panel from the Deep PTC tab on the right sidebar.
78
+ - **Panel width**: drag the panel's left edge, or focus it and use the arrow keys (Shift for larger steps) or Home/End; a double click restores 280px. The width is remembered, from 240 to 640px, and a docked panel leaves at least 540px for the conversation.
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
+ Visual effects apply **only while the conversation on screen is a Deep PTC session**, and only on the composer, send button, message bubbles, reply typography and session rows. They never rewrite the host's colour tokens or fonts, so switching conversations does not restyle the whole page: 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
81
 
81
82
  - Light rendering: effect styles target DSH's own stable attributes instead of measuring elements every frame; looping animations change only opacity or transforms; the spark canvas covers only the area around the composer at no more than 1.5 device pixels per CSS pixel and stops drawing when nothing moves or the window is hidden.
82
83
  - With an appearance plugin such as dsh-claude-style or dsh-refined-ui installed, effects start off; turning them on keeps your choice. The standalone dsh-refined-ui is never drawn twice.
@@ -214,10 +215,10 @@ A prompt changes the model's working tendency, not the real token limit or billi
214
215
  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.
215
216
 
216
217
  ```js
217
- plugin_manager({ action: "install_bundle", target: "dsh-deep-ptc-mode@1.9.3" })
218
+ plugin_manager({ action: "install_bundle", target: "dsh-deep-ptc-mode@1.9.5" })
218
219
  // Or from a local checkout or archive:
219
220
  plugin_manager({ action: "install_bundle", target: "C:\\path\\to\\dsh-deep-ptc-mode" })
220
- // Or target: "C:\\path\\to\\dsh-deep-ptc-mode-1.9.3.tgz"
221
+ // Or target: "C:\\path\\to\\dsh-deep-ptc-mode-1.9.5.tgz"
221
222
  ```
222
223
 
223
224
  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.
@@ -272,6 +273,13 @@ Deep PTC mode is written and maintained by [lishize20040802-rgb](https://github.
272
273
  - Issues and feature requests: [GitHub issues](https://github.com/lishize20040802-rgb/dsh-deep-ptc-mode/issues)
273
274
  - Email: lishize20040802@gmail.com
274
275
 
276
+ ### Contributors
277
+
278
+ Thanks to these contributors for merged pull requests:
279
+
280
+ - [Freezecatmeow](https://github.com/Freezecatmeow): found and fixed the Web profile boot timeout caused by plugin startup waiting on host services ([#18](https://github.com/lishize20040802-rgb/dsh-deep-ptc-mode/issues/18), [#19](https://github.com/lishize20040802-rgb/dsh-deep-ptc-mode/pull/19)).
281
+ - [GYT-Lucas](https://github.com/GYT-Lucas): the duplicated Agent presets settings entry and official preset-gate compatibility ([#13](https://github.com/lishize20040802-rgb/dsh-deep-ptc-mode/pull/13), [#14](https://github.com/lishize20040802-rgb/dsh-deep-ptc-mode/pull/14)).
282
+
275
283
  Bugs in DeepSeek Harness itself belong upstream, at [deepseek-ai/deepseek-harness](https://github.com/deepseek-ai/deepseek-harness).
276
284
 
277
285
 
package/README.zh.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # 深度 PTC 模式
2
2
 
3
- [English](README.md) · MIT · 当前版本 **1.9.3**
3
+ [English](README.md) · MIT · 当前版本 **1.9.5**
4
4
 
5
5
  [更新日志](CHANGELOG.md) · [测试报告](TEST_REPORT.md) · [插件协作与验证范围](COMPATIBILITY.md)
6
6
 
7
7
  深度 PTC 是 DeepSeek Harness 的 Agent 模式,支持进度汇报、澄清提问、按任务规模制定计划,以及可插话的后台任务。它以已安装的官方 PTC 预设为基础,提供可选执行环境、按需加载工具和 Skill,以及面向第三方插件的两层预设身份适配。
8
8
 
9
- 面板位于对话区侧边,包含执行环境、子代理、后台任务、输出文件、SSH 连接和工具状态。输入框下方保留小胶囊,用于展开和收起面板。设置里有独立的「深度 PTC」页。界面特效采用轻量渲染,检测到外观插件时默认关闭。
9
+ 面板位于对话区侧边,包含执行环境、子代理、后台任务、输出文件、SSH 连接和工具状态。面板宽度可拖动调整。小胶囊用于展开和收起面板,默认在输入框下方,也可放进工具栏或隐藏。设置里有独立的「深度 PTC」页。界面特效采用轻量渲染,检测到外观插件时默认关闭。
10
10
 
11
11
  ## 五个基本问题
12
12
 
@@ -74,9 +74,10 @@ Deep PTC 的模式名称、设置页和会话界面会随 DSH「设置 → 通
74
74
  - **输出文件**:本会话写入或交付的文件,最新的在前;点击通过 DSH 原生文件预览打开对应文件。最多三个位置,超出时折叠占一个位置。规则与 DSH 官方的交付卡片一致,并包括 `run_code` 里写入的文件。
75
75
  - **SSH 连接**:本会话连接过的主机(成功或失败)与 `~/.ssh/config` 中的主机别名。
76
76
  - **工具状态**:“重载所有工具状态”按钮,以及调用失败的外部工具(如有)。
77
- - **输入框下方的小胶囊**显示执行环境、子代理数和工具提醒,点击展开或收起独立的侧边面板。1.9.0 保存的旧侧栏页签会显示迁移提示。
77
+ - **小胶囊**显示执行环境、子代理数和工具提醒,点击展开或收起独立的侧边面板。位置可在「设置 → 深度 PTC → 外观」中选择:自动、输入框下方、工具栏或隐藏。「自动」在 dsh-claude-style 下放进输入框工具栏,紧凑的输入框保持单行。隐藏后,可从右侧栏的「深度 PTC」页签打开面板。
78
+ - **面板宽度**:拖动面板左边缘调整;也可以聚焦左边缘后用方向键(按住 Shift 步长更大)或 Home/End 调整,双击恢复 280px。宽度会被记住,范围 240–640px;停靠时对话区至少保留 540px。
78
79
 
79
- 界面特效**只在当前显示的是深度 PTC 会话时生效**:更克制的明暗配色与字体、输入框聚焦细线、蓝色渐变发送键、淡蓝用户气泡、指针追光、点击涟漪、磁吸发送键;运行时输入框发光、发送键光环和输入框上方的光点。
80
+ 界面特效**只在当前显示的是深度 PTC 会话时生效**,且只作用于输入框、发送键、消息气泡、回复排版和会话行,不改写宿主的配色变量与字体,切换会话不会触发整页重绘:输入框聚焦细线、蓝色渐变发送键、淡蓝用户气泡、指针追光、点击涟漪、磁吸发送键;运行时输入框发光、发送键光环和输入框上方的光点。
80
81
 
81
82
  - 轻量渲染:特效样式直接作用于 DSH 自带的稳定属性,不再逐帧计算元素样式;循环动画只改变透明度或位移;光点画布只覆盖输入框附近,像素密度上限 1.5,无动画或窗口隐藏时停止绘制。
82
83
  - 检测到 dsh-claude-style、dsh-refined-ui 等外观插件时默认关闭特效;你手动打开后保留你的选择。dsh-refined-ui 运行时始终不重复绘制。
@@ -218,10 +219,10 @@ Deep PTC 可以把其他插件提供的能力接进同一项任务:用 **DrawA
218
219
  本地目录或构建产物可通过插件管理器安装:
219
220
 
220
221
  ```js
221
- plugin_manager({ action: "install_bundle", target: "dsh-deep-ptc-mode@1.9.3" })
222
+ plugin_manager({ action: "install_bundle", target: "dsh-deep-ptc-mode@1.9.5" })
222
223
  // 也可从本地目录或安装包安装:
223
224
  plugin_manager({ action: "install_bundle", target: "C:\\path\\to\\dsh-deep-ptc-mode" })
224
- // 或 target: "C:\\path\\to\\dsh-deep-ptc-mode-1.9.3.tgz"
225
+ // 或 target: "C:\\path\\to\\dsh-deep-ptc-mode-1.9.5.tgz"
225
226
  ```
226
227
 
227
228
  GitHub 地址:`github:lishize20040802-rgb/dsh-deep-ptc-mode`。该地址安装远端实际内容;本地升级不会自动发布到 GitHub/npm。
@@ -289,6 +290,13 @@ npm pack
289
290
  - 问题与需求:[GitHub Issues](https://github.com/lishize20040802-rgb/dsh-deep-ptc-mode/issues)
290
291
  - 邮箱:lishize20040802@gmail.com
291
292
 
293
+ ### 贡献者
294
+
295
+ 感谢以下贡献者提交并合并的 PR:
296
+
297
+ - [Freezecatmeow](https://github.com/Freezecatmeow):定位并修复插件启动等待宿主服务导致 Web profile 启动超时的问题([#18](https://github.com/lishize20040802-rgb/dsh-deep-ptc-mode/issues/18)、[#19](https://github.com/lishize20040802-rgb/dsh-deep-ptc-mode/pull/19))。
298
+ - [GYT-Lucas](https://github.com/GYT-Lucas):设置导航中重复的「Agent 预设」入口,以及官方预设门禁的兼容([#13](https://github.com/lishize20040802-rgb/dsh-deep-ptc-mode/pull/13)、[#14](https://github.com/lishize20040802-rgb/dsh-deep-ptc-mode/pull/14))。
299
+
292
300
  上游 DeepSeek Harness 本身的问题请提到 [deepseek-ai/deepseek-harness](https://github.com/deepseek-ai/deepseek-harness)。
293
301
 
294
302
 
package/TEST_REPORT.md CHANGED
@@ -1,4 +1,10 @@
1
- # 1.9.3 测试报告 / Test report
1
+ # 1.9.5 测试报告 / Test report
2
+
3
+ > 1.9.5 启动与特效性能:210 项自动化测试及结构检查通过。新增覆盖:宿主服务永不就绪时 apply() 立即返回;预设仍在后台发布;深度 PTC 的 resolve 会等到首次发布完成,其他预设不等待;两个深度 PTC 会话之间切换时特效属性不被摘除;特效样式不包含宿主配色变量、字体、全站控件规则或通配元素规则。在本地 DSH 0.2.2-rc.1 测试 profile 中:启动正常,预设注册;开启特效时宿主变量(背景、文字、字体)与关闭时一致;4 个深度 PTC 会话之间切换,特效属性翻转 0 次。浏览器窗格处于隐藏状态,页面不渲染,因此未测量切换耗时。
4
+ > Version 1.9.5 startup and effects performance: 210 tests and structural checks pass. New coverage: apply() returns at once when host services never become ready; the preset still publishes in the background; a Deep PTC resolve waits for the first publication while other presets do not; switching between two Deep PTC conversations never removes the effects attribute; the effects stylesheet contains no host colour tokens, fonts, page-wide control rules or universal rules. In a local DSH 0.2.2-rc.1 test profile, boot succeeded and the preset registered; host background, label and font variables were identical with effects on and off; moving among four Deep PTC conversations flipped the effects attribute 0 times. The browser pane was hidden, so the page did not render and switch timing was not measured.
5
+
6
+ > 1.9.4 胶囊位置与面板宽度:205 项自动化测试及结构检查通过。新增覆盖:默认位置、dsh-claude-style 下胶囊移入工具栏且两处胶囊控制同一面板、隐藏后右侧栏引导出现并可打开面板、位置偏好持久化、左边缘拖动/方向键/双击调整宽度及上下限、右下角挂件留白。在本地 DSH 0.2.2-rc.1 测试 profile 中实测:拖动后面板由 280px 变为 482px,对话区边距同步,宽度被记住;用 claude-style 的页面标记模拟时,胶囊与模型选择器、发送按钮同处一行;窄屏浮动面板保留拖动边缘;客户端无本插件报错。未与 dsh-claude-style、dsh-whale-widget 实际同装运行;10 个界面插件为发布包静态核对,见 [协作说明](COMPATIBILITY.md)。
7
+ > Version 1.9.4 capsule position and panel width: 205 tests and structural checks pass, covering default placement, the toolbar capsule beside dsh-claude-style controlling the same panel, the sidebar guide entry when hidden, remembered placement, edge drag/keys/double-click resizing with bounds, and the corner-widget inset. In a local DSH 0.2.2-rc.1 test profile, dragging widened the panel from 280px to 482px with the conversation margin following and the width remembered; with dsh-claude-style's page marker simulated, the capsule shared the toolbar row with the model selector and send button; the floating panel kept its resize edge; no client errors from this plugin. dsh-claude-style and dsh-whale-widget were not installed alongside; the ten UI plugins were reviewed statically from their published packages.
2
8
 
3
9
  > 1.9.3 界面调整:201 项自动化测试及结构检查通过。输出文件按钮覆盖普通/折叠列表、所属会话、相对/Windows/UNC 路径、中文及特殊字符、旧版预览接口和打开失败后的恢复。另使用真实 DSH Desktop 0.2.2-rc.2 文件地址解析器确认四类路径可由当前面板的打开函数正确还原。子代理行保留状态指示与辅助阅读标签,可见内容仅为名称和同一行右侧的用时。未做整窗目视验收。
4
10
  > 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.
package/lib/client.js CHANGED
@@ -226,6 +226,12 @@ window.__ModuleLoader__.load({ id: 'dsh-deep-ptc-mode', factory: require => {
226
226
  sideGuide: '执行环境、子代理、后台任务、输出文件与 SSH', sideOtherMode: '当前对话不是深度 PTC 模式。这里的执行环境用于之后新建的深度 PTC 会话。',
227
227
  capsuleOpen: '展开或收起侧边面板', panelClose: '收起侧边面板',
228
228
  panelMoved: '深度 PTC 面板已回到对话区侧边,请使用输入框下方的胶囊展开。',
229
+ panelMovedToolbar: '深度 PTC 面板在对话区侧边,请使用输入框工具栏里的胶囊展开。',
230
+ panelMovedHidden: '胶囊已隐藏。可以用下面的按钮打开深度 PTC 面板,或在「设置 → 深度 PTC → 外观」里重新显示胶囊。',
231
+ panelOpen: '打开深度 PTC 面板', panelResize: '拖动调整侧边面板宽度,双击恢复默认',
232
+ capsulePlacement: '胶囊位置', placementAuto: '自动', placementDock: '输入框下方', placementToolbar: '工具栏', placementHidden: '隐藏',
233
+ placementHint: '「自动」在检测到 dsh-claude-style 等紧凑输入框时放进工具栏,否则放在输入框下方。隐藏后可从右侧栏「深度 PTC」页签打开面板。',
234
+ placementAutoNow: '「自动」当前放在:{place}。',
229
235
  outputsTitle: '输出文件', outputsEmpty: '本会话暂无输出文件。', outputsMore: '另有 {count} 个文件',
230
236
  outputPresented: '已交付', outputTurn: '第 {turn} 轮',
231
237
  outputOpenFailed: '无法打开文件,请检查文件是否仍存在,以及宿主文件预览是否可用。',
@@ -253,6 +259,12 @@ window.__ModuleLoader__.load({ id: 'dsh-deep-ptc-mode', factory: require => {
253
259
  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.',
254
260
  capsuleOpen: 'Expand or collapse the side panel', panelClose: 'Collapse the side panel',
255
261
  panelMoved: 'The Deep PTC panel is beside the conversation. Use the capsule below the composer to expand it.',
262
+ panelMovedToolbar: 'The Deep PTC panel is beside the conversation. Use the capsule in the composer toolbar to expand it.',
263
+ panelMovedHidden: 'The capsule is hidden. Open the Deep PTC panel with the button below, or show the capsule again in Settings → Deep PTC → Appearance.',
264
+ panelOpen: 'Open the Deep PTC panel', panelResize: 'Drag to resize the side panel; double-click to reset',
265
+ capsulePlacement: 'Capsule position', placementAuto: 'Auto', placementDock: 'Below composer', placementToolbar: 'Toolbar', placementHidden: 'Hidden',
266
+ placementHint: 'Auto puts the capsule in the toolbar when a compact composer such as dsh-claude-style is present, and below the composer otherwise. When hidden, open the panel from the Deep PTC tab in the right sidebar.',
267
+ placementAutoNow: 'Auto currently uses: {place}.',
256
268
  outputsTitle: 'Output files', outputsEmpty: 'No output files in this conversation.', outputsMore: '{count} more files',
257
269
  outputPresented: 'Delivered', outputTurn: 'Turn {turn}',
258
270
  outputOpenFailed: 'Could not open the file. Check that it still exists and the host file preview is available.',
@@ -289,7 +301,6 @@ window.__ModuleLoader__.load({ id: 'dsh-deep-ptc-mode', factory: require => {
289
301
  // ---------------------------------------------------------------------------------------------
290
302
  const PLUGIN = 'dsh-deep-ptc-mode';
291
303
  const ON = 'body[data-dpt-ui]';
292
- const ON0 = ':where(body[data-dpt-ui])';
293
304
  const DARK = 'body[data-ds-dark-theme]:not([data-ds-dark-theme="false"])';
294
305
  const ON_DARK = 'body[data-dpt-ui][data-ds-dark-theme]:not([data-ds-dark-theme="false"])';
295
306
  const COMPOSER = '[data-composer-card]';
@@ -386,11 +397,18 @@ ${ON} .dpt-capsule[data-state="running"] .dpt-agent-dot,${ON} .dpt-agent[data-st
386
397
  .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)}
387
398
  .dpt-capsule .dpt-agent-dot{margin-top:0}
388
399
  .dpt-capsule-row>.dpt-panel{align-self:stretch}
400
+ .dpt-capsule-row:not([data-placement="dock"]){display:none}
401
+ .dpt-capsule[data-compact]{height:28px;max-width:200px;padding:0 10px;gap:6px;flex:none}
389
402
  .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
403
  .dpt-sidecar[data-floating]{border:1px solid var(--dpt-line);border-radius:12px;box-shadow:0 4px 20px #0002}
391
404
  .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
405
  .dpt-sidecar-head h3{margin:0;font:inherit;font-weight:600}
393
406
  .dpt-sidecar .dpt-panel{flex:1;height:auto;overflow:hidden}
407
+ .dpt-sidecar .dpt-side-body{padding-bottom:var(--dpt-inset-bottom,0px)}
408
+ .dpt-resize{position:absolute;left:0;top:0;bottom:0;z-index:1;width:6px;cursor:col-resize;touch-action:none;-webkit-app-region:no-drag;outline:none}
409
+ .dpt-resize::after{content:"";position:absolute;left:0;top:0;bottom:0;width:2px;background:transparent;transition:background-color 120ms}
410
+ .dpt-resize:hover::after,.dpt-resize:focus-visible::after,.dpt-resize[data-active]::after{background:color-mix(in srgb,var(--dpt-accent,#3370ff) 55%,transparent)}
411
+ body[data-dpt-resizing],body[data-dpt-resizing] *{cursor:col-resize!important;user-select:none!important}
394
412
  [data-conversation-region="chat"][data-dpt-panel-open]{margin-right:var(--dpt-panel-width,280px)!important}
395
413
  .dpt-tab-title{display:inline-flex;align-items:center;gap:6px}
396
414
  .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))}
@@ -419,45 +437,11 @@ ${ON} .dpt-capsule[data-state="running"] .dpt-agent-dot,${ON} .dpt-agent[data-st
419
437
  @keyframes dpt-rise{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
420
438
  @media (prefers-reduced-motion:reduce){.dpt-card,.dpt-panel,.dpt-capsule,.dpt-agent-dot,.dpt-switch,.dpt-switch-thumb{animation:none!important;transition:none!important}}
421
439
  `;
440
+ // The effects restyle a few host elements only. Toggling them never touches a design token, font or
441
+ // inherited value, so switching conversations restyles those elements and not the whole page (#17).
422
442
  const THEME_CSS = `
423
- ${ON}{--dpt-dur-fast:120ms;--dpt-dur-base:200ms;--dpt-ease-out:cubic-bezier(0.22,1,0.36,1);--dpt-brand:#3370ff;--dpt-brand-ink:#1f4fc4;--dpt-brand-light:color-mix(in srgb,var(--dpt-brand) 70%,#7fd0ff)}
424
- ${ON}{
425
- --dsw-alias-bg-base:#ffffff !important;--dsw-alias-surface-2:#f5f7fa !important;
426
- --dsw-alias-label-primary:#101828 !important;--dsw-alias-label-secondary:#4a5565 !important;--dsw-alias-label-tertiary:#667085 !important;
427
- --dsw-alias-text-primary:#101828 !important;--dsw-alias-text-secondary:#4a5565 !important;
428
- --dsw-alias-border-l1:#e3e7ee !important;--dsw-alias-border-l2:#d6dce6 !important;--dsw-alias-border-l2-darkmode-thin:#d6dce6 !important;
429
- --dsw-alias-interactive-bg-hover:rgba(16,24,40,0.05) !important;--dsw-alias-bg-hover:rgba(16,24,40,0.05) !important;
430
- --dsw-alias-interactive-bg-hover-danger:rgba(196,50,31,0.10) !important;--dsw-alias-bg-danger:rgba(196,50,31,0.10) !important;
431
- --dsw-alias-state-error-primary:#c4321f !important;--dsw-alias-text-danger:#c4321f !important;--dsw-alias-border-danger:#c4321f !important;
432
- --dsw-alias-state-success-primary:#0f7a4f !important;--dsw-alias-text-success:#0f7a4f !important;
433
- --dsw-alias-state-warning-primary:#8a5a00 !important;--dsw-alias-text-warning:#8a5a00 !important;
434
- --dsw-specific-bubble:#eaf1ff !important;--dsw-specific-input-major:#ffffff !important;
435
- --dsw-shadow-lv1:0 1px 2px rgba(16,24,40,0.06),0 4px 14px rgba(16,24,40,0.06) !important;
436
- --dsh-scrollbar-thumb:rgba(16,24,40,0.16) !important;--dsh-scrollbar-thumb-hover:rgba(16,24,40,0.32) !important;
437
- --ds-font-family:"Segoe UI Variable Text","Segoe UI","Microsoft YaHei UI","PingFang SC","HarmonyOS Sans SC",system-ui,sans-serif !important;
438
- --ds-font-family-code:"JetBrains Mono","Cascadia Code","SF Mono",ui-monospace,Consolas,monospace !important;
439
- -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;
440
- }
441
- ${ON_DARK}{
442
- --dsw-alias-bg-base:#0e1117 !important;--dsw-alias-surface-2:#161b24 !important;
443
- --dsw-alias-label-primary:#eef2f8 !important;--dsw-alias-label-secondary:#a3adbd !important;--dsw-alias-label-tertiary:#8a94a6 !important;
444
- --dsw-alias-text-primary:#eef2f8 !important;--dsw-alias-text-secondary:#a3adbd !important;
445
- --dsw-alias-border-l1:#263041 !important;--dsw-alias-border-l2:#2f3b50 !important;--dsw-alias-border-l2-darkmode-thin:#2f3b50 !important;
446
- --dsw-alias-interactive-bg-hover:rgba(238,242,248,0.07) !important;--dsw-alias-bg-hover:rgba(238,242,248,0.07) !important;
447
- --dsw-alias-interactive-bg-hover-danger:rgba(255,123,104,0.14) !important;--dsw-alias-bg-danger:rgba(255,123,104,0.14) !important;
448
- --dsw-alias-state-error-primary:#ff7b68 !important;--dsw-alias-text-danger:#ff7b68 !important;--dsw-alias-border-danger:#ff7b68 !important;
449
- --dsw-alias-state-success-primary:#4cc38a !important;--dsw-alias-text-success:#4cc38a !important;
450
- --dsw-alias-state-warning-primary:#e0a93b !important;--dsw-alias-text-warning:#e0a93b !important;
451
- --dsw-specific-bubble:#1b2f5c !important;--dsw-specific-input-major:#161b24 !important;
452
- --dsw-shadow-lv1:0 1px 2px rgba(0,0,0,0.4),0 4px 14px rgba(0,0,0,0.35) !important;
453
- --dsh-scrollbar-thumb:rgba(238,242,248,0.18) !important;--dsh-scrollbar-thumb-hover:rgba(238,242,248,0.34) !important;
454
- --dpt-brand:#5b8cff;--dpt-brand-ink:#9dbcff;
455
- }
456
- ${ON0} :where(button,[role="button"],[role="menuitem"],[role="tab"],a,summary,select,input,textarea){
457
- transition:background-color var(--dpt-dur-fast) var(--dpt-ease-out),color var(--dpt-dur-fast) var(--dpt-ease-out),border-color var(--dpt-dur-fast) var(--dpt-ease-out),box-shadow var(--dpt-dur-base) var(--dpt-ease-out),opacity var(--dpt-dur-fast) var(--dpt-ease-out);
458
- }
459
- ${ON0} :where(button:active:not(:disabled),[role="button"]:active:not([aria-disabled="true"])){transform:scale(0.98)}
460
- ${ON} ::selection{background:color-mix(in srgb,var(--dpt-brand) 24%,transparent)}
443
+ :root{--dpt-dur-fast:120ms;--dpt-dur-base:200ms;--dpt-ease-out:cubic-bezier(0.22,1,0.36,1);--dpt-brand:#3370ff;--dpt-brand-light:color-mix(in srgb,var(--dpt-brand) 70%,#7fd0ff)}
444
+ ${DARK}{--dpt-brand:#5b8cff}
461
445
  ${ON} ${COMPOSER}{position:relative;box-shadow:0 10px 30px rgba(16,24,40,0.07),0 2px 6px rgba(16,24,40,0.05);transition:border-color var(--dpt-dur-base) var(--dpt-ease-out),box-shadow var(--dpt-dur-base) var(--dpt-ease-out)}
462
446
  ${ON_DARK} ${COMPOSER}{box-shadow:0 10px 30px rgba(0,0,0,0.45),0 2px 6px rgba(0,0,0,0.35)}
463
447
  ${ON} ${COMPOSER}::before{content:"";position:absolute;inset:-1px;border-radius:inherit;padding:1.5px;pointer-events:none;background:linear-gradient(115deg,var(--dpt-brand),var(--dpt-brand-light),var(--dpt-brand),var(--dpt-brand-light));background-size:300% 100%;-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask-composite:exclude;opacity:0;transition:opacity var(--dpt-dur-base) var(--dpt-ease-out)}
@@ -494,7 +478,7 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
494
478
  @keyframes dpt-ripple{0%{transform:scale(.3);opacity:1}100%{transform:scale(7);opacity:0}}
495
479
  .dpt-fx{position:fixed;left:0;top:0;z-index:2147482000;pointer-events:none;-webkit-app-region:initial!important}
496
480
  @media (prefers-reduced-motion:reduce){
497
- ${ON} *,${ON} *::before,${ON} *::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}
481
+ ${ON} :is(${COMPOSER},[data-dpt-send],${BUBBLE},[data-row-key^="session:"]),${ON} ${COMPOSER}::before,${ON} ${COMPOSER}::after,${ON} [data-dpt-send]::after{animation:none !important;transition:none !important}
498
482
  }
499
483
  `;
500
484
 
@@ -583,6 +567,8 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
583
567
  const uiOn = () => typeof document !== 'undefined' && document.body?.hasAttribute('data-dpt-ui');
584
568
 
585
569
  const BUSY = { on: false, was: false, timer: 0 };
570
+ // How long the effects stay on after the last Deep PTC conversation leaves the screen.
571
+ const OFF_GRACE_MS = 150;
586
572
  function applyBusy() {
587
573
  if (typeof document === 'undefined') return;
588
574
  const busy = uiOn() && BUSY.on;
@@ -608,9 +594,11 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
608
594
  stopVisuals();
609
595
  stopVisuals = undefined;
610
596
  }
611
- const update = () => {
597
+ const wanted = () => {
612
598
  const current = SESSIONS.current();
613
- const on = getEffects() && current?.preset === 'deep-ptc' && !refinedPresent();
599
+ return { current, on: getEffects() && current?.preset === 'deep-ptc' && !refinedPresent() };
600
+ };
601
+ const render = ({ current, on }) => {
614
602
  document.body.toggleAttribute('data-dpt-ui', on);
615
603
  // Like dsh-refined-ui, a running subagent keeps the conversation working.
616
604
  BUSY.on = on && (current?.busy === true || SESSIONS.working.get(current?.id) === true);
@@ -620,13 +608,33 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
620
608
  stopVisuals = () => cleanups.reverse().forEach(cleanup => cleanup());
621
609
  } else if (!on) disableVisuals();
622
610
  };
623
- SESSIONS.subs.add(update);
611
+ // The switch in settings applies at once.
612
+ let offTimer = 0;
613
+ const update = () => { clearTimeout(offTimer); render(wanted()); };
614
+ // A conversation switch unmounts one header bridge and mounts the next. Session changes settle at
615
+ // the end of the current task, and switching off waits a moment longer, so moving between Deep PTC
616
+ // conversations never removes and re-adds the effects (#17).
617
+ let queued = false;
618
+ const settle = () => {
619
+ queued = false;
620
+ clearTimeout(offTimer);
621
+ const next = wanted();
622
+ if (!next.on && uiOn()) offTimer = setTimeout(update, OFF_GRACE_MS);
623
+ else render(next);
624
+ };
625
+ const schedule = () => {
626
+ if (queued) return;
627
+ queued = true;
628
+ void Promise.resolve().then(settle);
629
+ };
630
+ SESSIONS.subs.add(schedule);
624
631
  const unsubscribe = subscribeEffects(update);
625
632
  const sync = event => { if (event.key === EFFECTS_KEY || event.key === null) setEffectsChoice(storedEffects()); };
626
633
  window.addEventListener('storage', sync);
627
634
  update();
628
635
  return () => {
629
- SESSIONS.subs.delete(update);
636
+ clearTimeout(offTimer);
637
+ SESSIONS.subs.delete(schedule);
630
638
  unsubscribe();
631
639
  window.removeEventListener('storage', sync);
632
640
  document.body.removeAttribute('data-dpt-ui');
@@ -1358,11 +1366,108 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
1358
1366
  }
1359
1367
 
1360
1368
  const PANEL_WIDTH = 280;
1369
+ const PANEL_MIN_WIDTH = 240;
1370
+ const PANEL_MAX_WIDTH = 640;
1361
1371
  const PANEL_MIN_ROOM = 820;
1372
+ // A docked panel never squeezes the conversation below this width.
1373
+ const CHAT_MIN_WIDTH = 540;
1362
1374
  const PANEL_COLLAPSED_KEY = `${PLUGIN}:side-panel-collapsed`;
1363
- const readPanelCollapsed = () => {
1364
- try { return localStorage.getItem(PANEL_COLLAPSED_KEY) === '1'; } catch { return false; }
1375
+ const PANEL_WIDTH_KEY = `${PLUGIN}:side-panel-width`;
1376
+ const CAPSULE_KEY = `${PLUGIN}:capsule-placement`;
1377
+ const PLACEMENTS = ['auto', 'dock', 'toolbar', 'hidden'];
1378
+ const readStored = key => { try { return localStorage.getItem(key); } catch { return null; } };
1379
+ const writeStored = (key, value) => { try { localStorage.setItem(key, value); } catch { /* kept in memory */ } };
1380
+ const readPanelWidth = () => {
1381
+ const value = Number(readStored(PANEL_WIDTH_KEY));
1382
+ return Number.isFinite(value) && value > 0 ? Math.round(value) : PANEL_WIDTH;
1365
1383
  };
1384
+ const readPlacement = () => { const value = readStored(CAPSULE_KEY); return PLACEMENTS.includes(value) ? value : 'auto'; };
1385
+
1386
+ // Viewer preferences (collapsed, width, capsule placement) and each conversation's open state, shared
1387
+ // by the panel host in the composer dock, the capsule wherever it sits, and the right-sidebar tab.
1388
+ const PANEL = {
1389
+ collapsed: readStored(PANEL_COLLAPSED_KEY) === '1',
1390
+ width: readPanelWidth(),
1391
+ placement: readPlacement(),
1392
+ peek: new Map(), wide: new Map(), version: 0, subs: new Set(),
1393
+ subscribe(listener) { this.subs.add(listener); return () => this.subs.delete(listener); },
1394
+ emit() { this.version++; for (const listener of [...this.subs]) { try { listener(); } catch (error) { console.warn(`[${PLUGIN}]`, error); } } },
1395
+ isOpen(id) { return (this.wide.get(id) === true && !this.collapsed) || this.peek.get(id) === true; },
1396
+ // A layout change (docked, floating, covered) closes a floating peek, as before.
1397
+ setWide(id, wide) {
1398
+ if (this.wide.get(id) === wide) return;
1399
+ if (wide === undefined) this.wide.delete(id); else this.wide.set(id, wide);
1400
+ this.peek.delete(id);
1401
+ this.emit();
1402
+ },
1403
+ setCollapsed(value) { this.collapsed = value; writeStored(PANEL_COLLAPSED_KEY, value ? '1' : '0'); },
1404
+ toggle(id) {
1405
+ if (this.wide.get(id)) this.setCollapsed(!this.collapsed);
1406
+ else this.peek.set(id, this.peek.get(id) !== true);
1407
+ this.emit();
1408
+ },
1409
+ open(id) {
1410
+ if (id === undefined) return;
1411
+ if (this.wide.get(id)) this.setCollapsed(false); else this.peek.set(id, true);
1412
+ this.emit();
1413
+ },
1414
+ setWidth(width, persist) {
1415
+ const next = Math.round(width);
1416
+ if (Number.isFinite(next) && next > 0 && next !== this.width) { this.width = next; this.emit(); }
1417
+ if (persist) writeStored(PANEL_WIDTH_KEY, String(this.width));
1418
+ },
1419
+ setPlacement(value) {
1420
+ if (!PLACEMENTS.includes(value) || value === this.placement) return;
1421
+ this.placement = value;
1422
+ writeStored(CAPSULE_KEY, value);
1423
+ this.emit();
1424
+ },
1425
+ // Another window changed a preference.
1426
+ sync(event) {
1427
+ if (event.key !== null && ![PANEL_COLLAPSED_KEY, PANEL_WIDTH_KEY, CAPSULE_KEY].includes(event.key)) return;
1428
+ this.collapsed = readStored(PANEL_COLLAPSED_KEY) === '1';
1429
+ this.width = readPanelWidth();
1430
+ this.placement = readPlacement();
1431
+ this.emit();
1432
+ },
1433
+ };
1434
+ const getPanelVersion = () => PANEL.version;
1435
+ const subscribePanel = listener => PANEL.subscribe(listener);
1436
+ function usePanel() {
1437
+ React.useSyncExternalStore(subscribePanel, getPanelVersion, getPanelVersion);
1438
+ return PANEL;
1439
+ }
1440
+
1441
+ // dsh-claude-style folds the composer into one row, which leaves no room for a row of our own below it.
1442
+ const compactComposer = () => typeof document !== 'undefined'
1443
+ && (document.body?.hasAttribute?.('data-dsh-claude-style') === true || appearancePlugin() === 'dsh-claude-style');
1444
+ function subscribeCompact(listener) {
1445
+ if (typeof MutationObserver !== 'function' || typeof document === 'undefined' || !document.body) return () => {};
1446
+ const observer = new MutationObserver(listener);
1447
+ try {
1448
+ observer.observe(document.body, { attributes: true, attributeFilter: ['data-dsh-claude-style'] });
1449
+ if (document.head) observer.observe(document.head, { childList: true });
1450
+ } catch { /* detection stays as first read */ }
1451
+ return () => observer.disconnect();
1452
+ }
1453
+ const useCompactComposer = () => React.useSyncExternalStore(subscribeCompact, compactComposer, compactComposer);
1454
+ const resolvePlacement = compact => PANEL.placement === 'auto' ? (compact ? 'toolbar' : 'dock') : PANEL.placement;
1455
+
1456
+ // Floating widgets pinned to the window's bottom-right corner (the dsh-whale-widget whale) cover the
1457
+ // bottom of the panel; the panel body reserves that height so its last controls scroll clear of it.
1458
+ const CORNER_FLOATERS = '.dshwv-root .dshwv-img';
1459
+ function cornerInset(box) {
1460
+ if (typeof document === 'undefined') return 0;
1461
+ let inset = 0;
1462
+ for (const node of document.querySelectorAll?.(CORNER_FLOATERS) ?? []) {
1463
+ const rect = node.getBoundingClientRect?.();
1464
+ if (!rect || rect.width <= 0 || rect.height <= 0) continue;
1465
+ const overlaps = rect.left < box.right && rect.right > box.left && rect.top < box.bottom && rect.bottom > box.top;
1466
+ if (overlaps) inset = Math.max(inset, box.bottom - rect.top);
1467
+ }
1468
+ // Never more than half the panel: the panel stays usable under a widget scaled up very large.
1469
+ return Math.round(Math.min(inset, (box.bottom - box.top) / 2));
1470
+ }
1366
1471
 
1367
1472
  // Measure the conversation itself, so the panel follows native sidebar resizing and is hidden
1368
1473
  // when that conversation is covered by a fullscreen sidebar.
@@ -1396,10 +1501,16 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
1396
1501
  }
1397
1502
  const wide = room.width >= PANEL_MIN_ROOM;
1398
1503
  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),
1504
+ const fit = Math.max(0, room.width - 24);
1505
+ const maxWidth = Math.min(fit, Math.max(PANEL_MIN_WIDTH, Math.min(PANEL_MAX_WIDTH, wide ? room.width - CHAT_MIN_WIDTH : fit)));
1506
+ const minWidth = Math.min(PANEL_MIN_WIDTH, maxWidth);
1507
+ const next = { region, wide, minWidth, maxWidth, top: Math.round(rect.top), right: Math.round(window.innerWidth - room.right),
1400
1508
  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]);
1509
+ width: Math.min(maxWidth, Math.max(minWidth, PANEL.width)) };
1510
+ const right = window.innerWidth - next.right;
1511
+ next.inset = cornerInset({ left: right - next.width, right, top: next.top, bottom: next.top + next.height });
1512
+ const same = previous?.region === region
1513
+ && ['wide', 'top', 'right', 'height', 'width', 'minWidth', 'maxWidth', 'inset'].every(key => previous[key] === next[key]);
1403
1514
  if (!same) { previous = next; setLayout(next); }
1404
1515
  }
1405
1516
  function schedule() {
@@ -1407,13 +1518,16 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
1407
1518
  }
1408
1519
  const changes = typeof MutationObserver === 'function' ? new MutationObserver(records => {
1409
1520
  if (!previous?.region?.isConnected || records.some(record => record.type === 'attributes'
1410
- && (record.target.contains(previous?.region) || record.target.matches?.('[data-sidebar-right-panel]')))) schedule();
1521
+ && (record.target.contains(previous?.region) || record.target.matches?.('[data-sidebar-right-panel],.dshwv-root')))) schedule();
1411
1522
  }) : undefined;
1412
1523
  changes?.observe(document.body, { subtree: true, childList: true, attributes: true,
1413
1524
  attributeFilter: ['class', 'style', 'hidden', 'aria-hidden', 'data-sidebar-right-panel', 'data-sidebar-right-open'] });
1414
1525
  window.addEventListener('resize', schedule);
1526
+ // A new preferred width (dragging the edge, another window) is measured like a resize.
1527
+ const unsubscribe = PANEL.subscribe(() => { if (previous?.width !== Math.min(previous?.maxWidth ?? Infinity, Math.max(previous?.minWidth ?? 0, PANEL.width))) schedule(); });
1415
1528
  measure();
1416
1529
  return () => {
1530
+ unsubscribe();
1417
1531
  resize?.disconnect(); changes?.disconnect();
1418
1532
  window.removeEventListener('resize', schedule);
1419
1533
  if (frame !== undefined) cancelAnimationFrame(frame);
@@ -1422,19 +1536,90 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
1422
1536
  return layout;
1423
1537
  }
1424
1538
 
1425
- // The capsule stays under the composer and toggles the independent conversation-side panel.
1426
- function Capsule(props) {
1427
- const { sessionId, useSessions, useProjection, form, t } = props;
1428
- const marker = React.useRef(null);
1429
- const layout = useSidePanelLayout(sessionId, marker);
1539
+ // The capsule's one-line summary: environment, subagents, tool notices.
1540
+ function useCapsuleSummary({ sessionId, useSessions, useProjection, form, t }) {
1430
1541
  const sessions = typeof useSessions === 'function' ? useSessions(state => state) : undefined;
1431
1542
  const tools = projectionValue(useProjection, 'deepPtcTools');
1432
1543
  const settings = useSettingsForm(form);
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;
1544
+ const rows = subagentRows(sessions, sessionId, Date.now());
1545
+ const running = rows.some(row => row.state === 'running');
1546
+ const failures = tools && typeof tools === 'object' ? (tools.report?.tools ?? []).length : 0;
1547
+ const environment = settings.status === 'ready' && settings.value ? envLabel(settings.value.environment ?? 'auto', t) : undefined;
1548
+ const label = [environment, rows.length ? `${t('agentsTitle')} ${rows.length}` : null, failures ? `${t('toolFailures')} ${failures}` : null]
1549
+ .filter(Boolean).join(' · ') || t('sideTitle');
1550
+ return { label, running };
1551
+ }
1552
+
1553
+ // The capsule toggles this conversation's side panel, below the composer or in its toolbar.
1554
+ function CapsuleButton(props) {
1555
+ const { sessionId, compact, t } = props;
1556
+ usePanel();
1557
+ const { label, running } = useCapsuleSummary(props);
1558
+ return h('button', { type: 'button', className: 'dpt-capsule', 'data-compact': compact ? '' : undefined,
1559
+ 'data-state': running ? 'running' : 'idle', 'aria-expanded': props.open ?? PANEL.isOpen(sessionId),
1560
+ title: compact ? `${t('capsuleOpen')} · ${label}` : t('capsuleOpen'), onClick: () => PANEL.toggle(sessionId) },
1561
+ h('span', { className: 'dpt-agent-dot', 'aria-hidden': 'true' }), h('span', null, label));
1562
+ }
1563
+
1564
+ // The panel's left edge. Dragging sets the preferred width (kept per viewer); arrow keys step it,
1565
+ // Home and End jump to the bounds, a double click restores the default.
1566
+ function ResizeHandle({ layout, t }) {
1567
+ const [active, setActive] = React.useState(false);
1568
+ const stop = React.useRef();
1569
+ React.useEffect(() => () => stop.current?.(), []);
1570
+ const clamp = value => Math.min(layout.maxWidth, Math.max(layout.minWidth, value));
1571
+ function onPointerDown(event) {
1572
+ if (event.button !== undefined && event.button !== 0) return;
1573
+ event.preventDefault();
1574
+ const target = event.currentTarget;
1575
+ const startX = event.clientX;
1576
+ const startWidth = layout.width;
1577
+ const move = next => PANEL.setWidth(clamp(startWidth + startX - next.clientX), false);
1578
+ const end = () => {
1579
+ target.removeEventListener?.('pointermove', move);
1580
+ target.removeEventListener?.('pointerup', end);
1581
+ target.removeEventListener?.('pointercancel', end);
1582
+ document.body?.removeAttribute?.('data-dpt-resizing');
1583
+ stop.current = undefined;
1584
+ setActive(false);
1585
+ PANEL.setWidth(PANEL.width, true);
1586
+ };
1587
+ try { target.setPointerCapture?.(event.pointerId); } catch { /* the move events still reach the handle */ }
1588
+ target.addEventListener?.('pointermove', move);
1589
+ target.addEventListener?.('pointerup', end);
1590
+ target.addEventListener?.('pointercancel', end);
1591
+ document.body?.setAttribute?.('data-dpt-resizing', '');
1592
+ stop.current = end;
1593
+ setActive(true);
1594
+ }
1595
+ function onKeyDown(event) {
1596
+ const step = event.shiftKey ? 64 : 16;
1597
+ const next = event.key === 'ArrowLeft' ? layout.width + step : event.key === 'ArrowRight' ? layout.width - step
1598
+ : event.key === 'Home' ? layout.minWidth : event.key === 'End' ? layout.maxWidth : undefined;
1599
+ if (next === undefined) return;
1600
+ event.preventDefault();
1601
+ PANEL.setWidth(clamp(next), true);
1602
+ }
1603
+ return h('div', { className: 'dpt-resize', role: 'separator', 'aria-orientation': 'vertical', tabIndex: 0,
1604
+ 'aria-label': t('panelResize'), title: t('panelResize'), 'data-active': active ? '' : undefined,
1605
+ 'aria-valuenow': layout.width, 'aria-valuemin': layout.minWidth, 'aria-valuemax': layout.maxWidth,
1606
+ onPointerDown, onKeyDown, onDoubleClick: () => PANEL.setWidth(clamp(PANEL_WIDTH), true) });
1607
+ }
1608
+
1609
+ // Mounted in the composer dock for every Deep PTC conversation, whatever the capsule placement: its
1610
+ // marker locates the conversation, and it owns the side panel. When the capsule sits elsewhere the
1611
+ // row is display:none, which keeps the marker (and closest()) working without taking a row.
1612
+ function PanelHost(props) {
1613
+ const { sessionId, useSessions, t } = props;
1614
+ const marker = React.useRef(null);
1615
+ const layout = useSidePanelLayout(sessionId, marker);
1616
+ usePanel();
1617
+ const placement = resolvePlacement(useCompactComposer());
1618
+ const wide = layout ? layout.wide : undefined;
1619
+ React.useEffect(() => PANEL.setWide(sessionId, wide), [sessionId, wide]);
1620
+ React.useEffect(() => () => PANEL.setWide(sessionId, undefined), [sessionId]);
1621
+ const docked = !!layout?.wide && !PANEL.collapsed;
1622
+ const open = docked || PANEL.peek.get(sessionId) === true;
1438
1623
  React.useEffect(() => {
1439
1624
  const region = layout?.region;
1440
1625
  if (!region) return undefined;
@@ -1442,34 +1627,24 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
1442
1627
  region.style.setProperty('--dpt-panel-width', `${layout.width}px`);
1443
1628
  return () => { region.removeAttribute('data-dpt-panel-open'); region.style.removeProperty('--dpt-panel-width'); };
1444
1629
  }, [layout?.region, layout?.width, docked]);
1445
- const rows = subagentRows(sessions, sessionId, Date.now());
1446
- const running = rows.filter(row => row.state === 'running').length;
1630
+ const sessions = typeof useSessions === 'function' ? useSessions(state => state) : undefined;
1631
+ const running = subagentRows(sessions, sessionId, Date.now()).some(row => row.state === 'running');
1447
1632
  React.useEffect(() => {
1448
- SESSIONS.setWorking(sessionId, running > 0);
1633
+ SESSIONS.setWorking(sessionId, running);
1449
1634
  return () => SESSIONS.setWorking(sessionId, false);
1450
- }, [sessionId, running > 0]);
1451
- const failures = tools && typeof tools === 'object' ? (tools.report?.tools ?? []).length : 0;
1452
- const environment = settings.status === 'ready' && settings.value ? envLabel(settings.value.environment ?? 'auto', t) : undefined;
1453
- const label = [environment, rows.length ? `${t('agentsTitle')} ${rows.length}` : null, failures ? `${t('toolFailures')} ${failures}` : null]
1454
- .filter(Boolean).join(' · ') || t('sideTitle');
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
- };
1635
+ }, [sessionId, running]);
1462
1636
  const panel = open && layout ? ReactDOM.createPortal(h('aside', { className: 'dpt-sidecar',
1463
1637
  'data-floating': docked ? undefined : '', 'aria-label': t('sideTitle'),
1464
- style: { top: layout.top, right: layout.right, height: layout.height, width: layout.width } },
1638
+ style: { top: layout.top, right: layout.right, height: layout.height, width: layout.width,
1639
+ '--dpt-inset-bottom': layout.inset ? `${layout.inset}px` : undefined } },
1640
+ h(ResizeHandle, { layout, t }),
1465
1641
  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') }, '×')),
1642
+ h('button', { type: 'button', className: 'dpt-icon-btn', onClick: () => PANEL.toggle(sessionId), 'aria-label': t('panelClose') }, '×')),
1467
1643
  h(DeepPtcPanel, props)), document.body) : null;
1468
- return h('div', { ref: marker, className: 'dpt-capsule-row' },
1469
- h('button', { type: 'button', className: 'dpt-capsule', 'data-state': running ? 'running' : 'idle', 'aria-expanded': open,
1470
- title: t('capsuleOpen'), onClick: toggle },
1471
- h('span', { className: 'dpt-agent-dot', 'aria-hidden': 'true' }), h('span', null, label)),
1472
- panel,
1644
+ return h(React.Fragment, null,
1645
+ h('div', { ref: marker, className: 'dpt-capsule-row', 'data-placement': placement },
1646
+ placement === 'dock' ? h(CapsuleButton, { ...props, open }) : null,
1647
+ panel),
1473
1648
  open && !layout && typeof ReactDOM?.createPortal !== 'function' ? h(DeepPtcPanel, { ...props, inline: true }) : null);
1474
1649
  }
1475
1650
 
@@ -1496,11 +1671,41 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
1496
1671
  function DockHost(props) {
1497
1672
  // Registered for every session; only Deep PTC sessions draw the capsule.
1498
1673
  if (projectionValue(props.useProjection, 'agentPreset') !== 'deep-ptc') return null;
1499
- return h(Boundary, null, h(Capsule, props));
1674
+ return h(Boundary, null, h(PanelHost, props));
1675
+ }
1676
+
1677
+ // The compact capsule in the composer toolbar, beside the host's own controls (conversation.input.right).
1678
+ function ToolbarHost(props) {
1679
+ usePanel();
1680
+ const placement = resolvePlacement(useCompactComposer());
1681
+ if (projectionValue(props.useProjection, 'agentPreset') !== 'deep-ptc' || placement !== 'toolbar') return null;
1682
+ return h(Boundary, null, h(CapsuleButton, { ...props, compact: true }));
1500
1683
  }
1501
1684
 
1502
- function TabHost({ t }) {
1503
- return h('p', { className: 'dpt-side-note' }, t('panelMoved'));
1685
+ const PLACEMENT_NOTES = { dock: 'panelMoved', toolbar: 'panelMovedToolbar', hidden: 'panelMovedHidden' };
1686
+ function TabHost({ sessionId, t }) {
1687
+ usePanel();
1688
+ const placement = resolvePlacement(useCompactComposer());
1689
+ const id = sessionId ?? SESSIONS.current()?.id;
1690
+ return h('div', { className: 'dpt-side-section' },
1691
+ h('p', { className: 'dpt-side-note' }, t(PLACEMENT_NOTES[placement])),
1692
+ h('button', { type: 'button', className: 'dpt-btn dpt-btn-block', disabled: id === undefined, onClick: () => PANEL.open(id) }, t('panelOpen')));
1693
+ }
1694
+
1695
+ const PLACEMENT_LABELS = { auto: 'placementAuto', dock: 'placementDock', toolbar: 'placementToolbar', hidden: 'placementHidden' };
1696
+ function CapsulePlacementSection({ t }) {
1697
+ usePanel();
1698
+ const compact = useCompactComposer();
1699
+ const label = t('capsulePlacement');
1700
+ const note = PANEL.placement === 'auto'
1701
+ ? `${tf(t, 'placementAutoNow', { place: t(PLACEMENT_LABELS[resolvePlacement(compact)]) })}${t('placementHint')}`
1702
+ : t('placementHint');
1703
+ return h('section', { className: 'dpt-side-section', 'aria-label': label },
1704
+ h('div', { className: 'dpt-side-label' }, h('span', null, label)),
1705
+ h('div', { className: 'dpt-seg', role: 'radiogroup', 'aria-label': label },
1706
+ ...PLACEMENTS.map(option => h('button', { key: option, type: 'button', role: 'radio', className: 'dpt-seg-btn',
1707
+ 'aria-checked': option === PANEL.placement, onClick: () => PANEL.setPlacement(option) }, t(PLACEMENT_LABELS[option])))),
1708
+ h('p', { className: 'dpt-side-note' }, note));
1504
1709
  }
1505
1710
 
1506
1711
  function TabTitle({ t }) {
@@ -1528,7 +1733,8 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
1528
1733
  // The form labels its own environment field.
1529
1734
  h('section', { 'aria-label': t('environment') },
1530
1735
  form ? h(Card, { form, t }) : h('p', { className: 'dpt-side-note' }, t('readOnly'))),
1531
- h('section', { 'aria-label': t('visualEffects') }, h('h3', null, t('appearance')), h(VisualEffectsSection, { t })),
1736
+ h('section', { 'aria-label': t('appearance') }, h('h3', null, t('appearance')),
1737
+ h(VisualEffectsSection, { t }), h(CapsulePlacementSection, { t })),
1532
1738
  h(DiagnosticsSection, { t }));
1533
1739
  }
1534
1740
 
@@ -1585,6 +1791,12 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
1585
1791
  installPresetLabels(ctx.slots, t, useLocaleRevision);
1586
1792
  ctx.effect(() => injectCss(), `${PLUGIN}: style`);
1587
1793
  ctx.effect(() => watchActiveSession(), `${PLUGIN}: active session`);
1794
+ ctx.effect(() => {
1795
+ if (typeof window?.addEventListener !== 'function') return () => {};
1796
+ const sync = event => PANEL.sync(event);
1797
+ window.addEventListener('storage', sync);
1798
+ return () => window.removeEventListener('storage', sync);
1799
+ }, `${PLUGIN}: panel preferences`);
1588
1800
  const form = ctx.configForms.get(NS);
1589
1801
  ctx.effect(() => ctx.configForms.whileServed([NS], () => {
1590
1802
  const disposers = [
@@ -1635,17 +1847,34 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
1635
1847
  inject: sessionTools(child),
1636
1848
  }, props => h(LocalizedSlot, { ...props, form, component: DockHost })));
1637
1849
  } catch { /* the composer stays usable when this slot cannot register */ }
1850
+ try {
1851
+ // The compact capsule joins the host's tool row, so a one-row composer keeps one row.
1852
+ child.slots.inject('conversation.input.right', () => child.slots.register({
1853
+ name: 'conversation.input.right', id: 'deep-ptc-capsule', order: 80, locale: 'deep-ptc',
1854
+ }, props => h(LocalizedSlot, { ...props, form, component: ToolbarHost })));
1855
+ } catch { /* the capsule stays below the composer */ }
1638
1856
  });
1639
1857
  } catch { /* the composer stays usable when this slot cannot register */ }
1640
1858
  try {
1641
- // Saved 1.9.0 sidebar tabs show a migration hint. New entries use the composer capsule.
1859
+ // The tab holds a button that opens the panel. It is listed on the sidebar's new-tab guide only
1860
+ // while the capsule is hidden, as the way back to the panel; saved tabs open in any placement.
1642
1861
  ctx.inject?.(['remote', 'remote.commands', 'sidebarRightTabs'], child => {
1643
1862
  child.effect(() => {
1644
- const dispose = child.sidebarRightTabs.register({
1645
- id: PLUGIN, kind: TAB_KIND, title: () => t('sideTitle'),
1646
- guide: [],
1647
- });
1648
- return dispose;
1863
+ let hidden;
1864
+ let dispose;
1865
+ const register = () => {
1866
+ const next = PANEL.placement === 'hidden';
1867
+ if (next === hidden) return;
1868
+ hidden = next;
1869
+ dispose?.();
1870
+ dispose = child.sidebarRightTabs.register({
1871
+ id: PLUGIN, kind: TAB_KIND, title: () => t('sideTitle'),
1872
+ guide: hidden ? [{ id: TAB_KIND, order: 60, title: () => t('sideTitle'), description: () => t('sideGuide') }] : [],
1873
+ });
1874
+ };
1875
+ register();
1876
+ const unsubscribe = PANEL.subscribe(register);
1877
+ return () => { unsubscribe(); dispose?.(); };
1649
1878
  }, `${PLUGIN}: sidebar tab type`);
1650
1879
  child.slots.inject('sidebar.right.pane.tab', () => child.slots.register({
1651
1880
  name: 'sidebar.right.pane.tab', key: PLUGIN, locale: 'deep-ptc', inject: sessionTools(child),
package/lib/index.mjs CHANGED
@@ -190,17 +190,22 @@ async function buildPreset(ctx, config, health) {
190
190
  }
191
191
  }
192
192
 
193
- export async function apply(ctx, config) {
193
+ // Nothing in apply() waits for another service, so this plugin never holds the Host boot (#18). Each
194
+ // part starts when its own services are ready, and only what needs it waits for it.
195
+ export function apply(ctx, config) {
194
196
  // Safe mode holds until our settings or the upstream declarations change, or DSH restarts.
195
197
  const health = { safeMode: false, reason: '' };
198
+ // These layers start as soon as the host provides commands and session projections. A projection
199
+ // registered after histories load still folds the whole log on first read, so starting late loses
200
+ // nothing; a layer whose services fail logs and turns off only its own card.
196
201
  // The skill card is a profile-level session projection, not an agent-preset row:
197
202
  // that keeps it available in existing Deep PTC sessions after an upgrade. Its
198
203
  // command and pre-step paths are gated to deep-ptc sessions below.
199
- await applySkillContext(ctx);
204
+ void applySkillContext(ctx);
200
205
  // The tool state and its reset command follow the same rule, so the side card works in idle sessions too.
201
- await applyToolStateRoot(ctx);
206
+ void applyToolStateRoot(ctx);
202
207
  // Output files and SSH connections per conversation, for the side panel.
203
- await applyActivity(ctx);
208
+ void applyActivity(ctx);
204
209
  const lifecycle = presetLifecycle(
205
210
  definition => ctx.agentPresets.register(definition),
206
211
  () => buildPreset(ctx, config, health),
@@ -248,12 +253,22 @@ export async function apply(ctx, config) {
248
253
  return [JSON.stringify(settingsOf(ctx, config)), await document('ptc'), await document(CREATIVE_PRESET_ID),
249
254
  read(officialPresetUrl()), read(resolveHost(BASE_DECLARATION_SPECIFIER)), read(creativePresetUrl())].join('\0');
250
255
  };
251
- let previous = await signature();
256
+ let previous;
257
+ // The first publication runs in the background. A Deep PTC conversation waits for it through the
258
+ // resolve check below, so a slow preset registry delays that conversation, never the Host boot.
259
+ const published = (async () => {
260
+ try { previous = await signature(); } catch (error) {
261
+ ctx.logger.warn('Deep PTC: could not read the upstream presets at start (%s)', error.message);
262
+ }
263
+ // A failed publication is reported by the lifecycle and retried on the next change.
264
+ await refreshed().catch(() => {});
265
+ })();
252
266
  let detecting;
253
267
  let active = true;
254
268
  // Concurrent callers share one check, so several conversations opening together read once.
255
269
  const detect = () => detecting ??= (async () => {
256
270
  try {
271
+ await published;
257
272
  const current = await signature();
258
273
  if (!active || current === previous) return;
259
274
  previous = current;
@@ -272,7 +287,4 @@ export async function apply(ctx, config) {
272
287
  ctx.inject(['settings'], child => {
273
288
  child.effect(() => child.settings.configure({ auto: false }, ctx.fiber));
274
289
  });
275
- // A failure to publish the preset is reported above; it must not take the
276
- // settings service (or the rest of the profile) down with it.
277
- await refreshed().catch(() => {});
278
290
  }
@@ -16,8 +16,8 @@ export const inject = [];
16
16
  const REQUIRED = ['commands', 'sessionProjections'];
17
17
 
18
18
  export function apply(ctx) {
19
- // Wait for the host services before the profile finishes booting, so the
20
- // projection exists before session histories are replayed.
19
+ // Starts once the host services exist; the caller never holds the boot for it. A projection
20
+ // registered after session histories load folds the whole log on first read.
21
21
  return ctx.plugin({ name: 'deep-ptc-skill-context-layer', inject: REQUIRED, apply: install }).await()
22
22
  .catch(error => ctx.logger.warn('Deep PTC: skill context card is off (%s)', error.message));
23
23
  }
package/locale/en.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "Deep PTC Mode",
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.",
4
+ "description": "Deep PTC builds on official PTC with interruptible jobs, selectable shells and a conversation-side panel. Click output files to open them; drag the panel edge to resize it, and place the capsule below the composer, in its toolbar or nowhere. 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": "基于官方 PTC 的深度模式:可插话的后台任务、可选执行环境和对话侧边面板,输出文件可点击打开,子代理行简洁展示名字与用时。按需使用绘图、设计和研究工具,提供通用 SSH 与 DSH Go 连接辅助,界面随 DSH 设置切换中英文。",
4
+ "description": "基于官方 PTC 的深度模式:可插话的后台任务、可选执行环境和对话侧边面板,输出文件可点击打开,面板宽度可拖动调整,胶囊可放在输入框下方、工具栏或隐藏。按需使用绘图、设计和研究工具,提供通用 SSH 与 DSH Go 连接辅助,界面随 DSH 设置切换中英文。",
5
5
  "detail": "README.zh.md"
6
6
  }
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-deep-ptc-mode",
3
- "version": "1.9.3",
3
+ "version": "1.9.5",
4
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": [
@@ -27,6 +27,16 @@
27
27
  "email": "lishize20040802@gmail.com",
28
28
  "url": "https://github.com/lishize20040802-rgb"
29
29
  },
30
+ "contributors": [
31
+ {
32
+ "name": "Freezecatmeow",
33
+ "url": "https://github.com/Freezecatmeow"
34
+ },
35
+ {
36
+ "name": "GYT-Lucas",
37
+ "url": "https://github.com/GYT-Lucas"
38
+ }
39
+ ],
30
40
  "repository": {
31
41
  "type": "git",
32
42
  "url": "git+https://github.com/lishize20040802-rgb/dsh-deep-ptc-mode.git"
@@ -92,14 +102,14 @@
92
102
  "sync:snapshot": "node scripts/sync-snapshot.mjs"
93
103
  },
94
104
  "peerDependencies": {
95
- "@deepseek-ai/schemastery": "^3.18.4",
105
+ "@deepseek-ai/dsh-base": ">=0.2.2-rc.1",
106
+ "@deepseek-ai/dsh-client-locale": ">=0.2.2-rc.1",
107
+ "@deepseek-ai/dsh-client-ui-commands": ">=0.2.2-rc.1",
96
108
  "@deepseek-ai/dsh-client-ui-renderer": ">=0.2.2-rc.1",
97
109
  "@deepseek-ai/dsh-client-ui-settings": ">=0.2.2-rc.1",
98
110
  "@deepseek-ai/dsh-client-ui-slots": ">=0.2.2-rc.1",
99
- "@deepseek-ai/dsh-client-locale": ">=0.2.2-rc.1",
100
111
  "@deepseek-ai/dsh-web-app": ">=0.2.2-rc.1",
101
- "@deepseek-ai/dsh-base": ">=0.2.2-rc.1",
102
- "@deepseek-ai/dsh-client-ui-commands": ">=0.2.2-rc.1"
112
+ "@deepseek-ai/schemastery": "^3.18.4"
103
113
  },
104
114
  "peerDependenciesMeta": {
105
115
  "@deepseek-ai/schemastery": {
@@ -131,6 +141,7 @@
131
141
  "js-yaml": "4.3.2"
132
142
  },
133
143
  "devDependencies": {
144
+ "@deepseek-ai/schemastery": "3.19.0",
134
145
  "react": "18.3.1",
135
146
  "react-test-renderer": "18.3.1"
136
147
  }