dsh-deep-ptc-mode 1.9.2 → 1.9.4
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 +16 -0
- package/COMPATIBILITY.md +33 -4
- package/README.md +8 -7
- package/README.zh.md +8 -7
- package/TEST_REPORT.md +7 -1
- package/lib/client.js +332 -78
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.9.4 — 2026-11-13
|
|
4
|
+
|
|
5
|
+
- 胶囊位置可选:自动 / 输入框下方 / 工具栏 / 隐藏。「自动」检测到 dsh-claude-style 时把胶囊放进输入框工具栏(`conversation.input.right`),不再单独占一行(#16,也补上 #12 的第 3 点)。隐藏后,右侧栏新建页签引导中会出现「深度 PTC」,页签内的按钮可打开面板。
|
|
6
|
+
- 侧边面板左边缘可拖动调整宽度,也可用方向键(Shift 加大步长)、Home/End 调整,双击恢复 280px。宽度按浏览器保存,并限制在 240–640px;停靠时对话区至少保留 540px。
|
|
7
|
+
- 固定在右下角的悬浮挂件(dsh-whale-widget)不再遮住面板底部按钮:面板正文按重叠高度留出空间。
|
|
8
|
+
- 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.
|
|
9
|
+
- 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.
|
|
10
|
+
- A widget pinned to the bottom-right corner (dsh-whale-widget) no longer covers the panel's last controls.
|
|
11
|
+
|
|
12
|
+
## 1.9.3 — 2026-11-12
|
|
13
|
+
|
|
14
|
+
- 侧边输出文件可点击,使用 DSH 原生文件资源接口按所属会话打开;兼容折叠列表、相对路径、Windows/UNC 路径及带中文和特殊字符的文件名,预览不可用时显示提示。
|
|
15
|
+
- 子代理行精简为状态指示、名字与同一行最右侧的用时,移除可见状态文字、统计摘要和 token 消耗。状态仍供辅助阅读工具使用。
|
|
16
|
+
- 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.
|
|
17
|
+
- 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.
|
|
18
|
+
|
|
3
19
|
## 1.9.2 — 2026-11-12
|
|
4
20
|
|
|
5
21
|
- 文档与简介说明 DrawAI 绘图、归藏设计技能、Agentero 论文工具、dsh-ops 执行环境及 DSH Go 连接辅助的协作方式,并标明验证范围。26 个真实工具通过隔离注册、发现、选用和宿主双语言 SDK 渲染;DrawAI 的文件编辑、SVG 导出和 revision 冲突保护通过。统一分类层将明确的并发编辑冲突归为输入状态过旧,修复连续旧 revision 拒写导致工具误隔离;保留实现缺陷、不可用和部分完成的处理。
|
package/COMPATIBILITY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
# 插件协作与验证范围 / Plugin workflows and verification
|
|
2
2
|
|
|
3
|
-
Deep PTC **1.9.
|
|
3
|
+
Deep PTC **1.9.4** · 核对日期: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.
|
|
79
|
+
Deep PTC 1.9.4 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
|
-
|
|
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
|
+
[中文](README.zh.md) · MIT · **1.9.4**
|
|
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
|
|
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
|
|
|
@@ -69,12 +69,13 @@ The Deep PTC mode label, settings, and conversation UI switch between Chinese an
|
|
|
69
69
|
- **Settings → Deep PTC**: execution environment and shell, the visual effects switch, and copyable diagnostics to attach to interface bug reports.
|
|
70
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
|
|
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
|
|
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
|
|
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
80
|
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
81
|
|
|
@@ -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.
|
|
218
|
+
plugin_manager({ action: "install_bundle", target: "dsh-deep-ptc-mode@1.9.4" })
|
|
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.
|
|
221
|
+
// Or target: "C:\\path\\to\\dsh-deep-ptc-mode-1.9.4.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.
|
package/README.zh.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# 深度 PTC 模式
|
|
2
2
|
|
|
3
|
-
[English](README.md) · MIT · 当前版本 **1.9.
|
|
3
|
+
[English](README.md) · MIT · 当前版本 **1.9.4**
|
|
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
|
|
9
|
+
面板位于对话区侧边,包含执行环境、子代理、后台任务、输出文件、SSH 连接和工具状态。面板宽度可拖动调整。小胶囊用于展开和收起面板,默认在输入框下方,也可放进工具栏或隐藏。设置里有独立的「深度 PTC」页。界面特效采用轻量渲染,检测到外观插件时默认关闭。
|
|
10
10
|
|
|
11
11
|
## 五个基本问题
|
|
12
12
|
|
|
@@ -69,12 +69,13 @@ Deep PTC 的模式名称、设置页和会话界面会随 DSH「设置 → 通
|
|
|
69
69
|
- **设置 → 深度 PTC**:执行环境与 Shell、界面特效开关,以及可复制的诊断信息(反馈界面问题时附上)。
|
|
70
70
|
- **对话侧边的「深度 PTC」面板**。空间充足时默认显示,并随对话区尺寸调整。原生侧栏全屏覆盖对话时会隐藏,窄屏可通过下方胶囊展开。
|
|
71
71
|
- **执行环境**:WSL、PowerShell、原生 Bash 或 Zsh,对之后新建的深度 PTC 会话生效。
|
|
72
|
-
-
|
|
72
|
+
- **子代理**:状态指示与名称在左,用时在同一行的最右侧;点击在官方右侧栏打开该子代理的对话。
|
|
73
73
|
- **后台任务**:最多六个位置,运行中优先且最多五条,已结束最多三条,超出部分合为一条可展开记录。
|
|
74
|
-
-
|
|
74
|
+
- **输出文件**:本会话写入或交付的文件,最新的在前;点击通过 DSH 原生文件预览打开对应文件。最多三个位置,超出时折叠占一个位置。规则与 DSH 官方的交付卡片一致,并包括 `run_code` 里写入的文件。
|
|
75
75
|
- **SSH 连接**:本会话连接过的主机(成功或失败)与 `~/.ssh/config` 中的主机别名。
|
|
76
76
|
- **工具状态**:“重载所有工具状态”按钮,以及调用失败的外部工具(如有)。
|
|
77
|
-
-
|
|
77
|
+
- **小胶囊**显示执行环境、子代理数和工具提醒,点击展开或收起独立的侧边面板。位置可在「设置 → 深度 PTC → 外观」中选择:自动、输入框下方、工具栏或隐藏。「自动」在 dsh-claude-style 下放进输入框工具栏,紧凑的输入框保持单行。隐藏后,可从右侧栏的「深度 PTC」页签打开面板。
|
|
78
|
+
- **面板宽度**:拖动面板左边缘调整;也可以聚焦左边缘后用方向键(按住 Shift 步长更大)或 Home/End 调整,双击恢复 280px。宽度会被记住,范围 240–640px;停靠时对话区至少保留 540px。
|
|
78
79
|
|
|
79
80
|
界面特效**只在当前显示的是深度 PTC 会话时生效**:更克制的明暗配色与字体、输入框聚焦细线、蓝色渐变发送键、淡蓝用户气泡、指针追光、点击涟漪、磁吸发送键;运行时输入框发光、发送键光环和输入框上方的光点。
|
|
80
81
|
|
|
@@ -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.
|
|
222
|
+
plugin_manager({ action: "install_bundle", target: "dsh-deep-ptc-mode@1.9.4" })
|
|
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.
|
|
225
|
+
// 或 target: "C:\\path\\to\\dsh-deep-ptc-mode-1.9.4.tgz"
|
|
225
226
|
```
|
|
226
227
|
|
|
227
228
|
GitHub 地址:`github:lishize20040802-rgb/dsh-deep-ptc-mode`。该地址安装远端实际内容;本地升级不会自动发布到 GitHub/npm。
|
package/TEST_REPORT.md
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
# 1.9.
|
|
1
|
+
# 1.9.4 测试报告 / Test report
|
|
2
|
+
|
|
3
|
+
> 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)。
|
|
4
|
+
> 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.
|
|
5
|
+
|
|
6
|
+
> 1.9.3 界面调整:201 项自动化测试及结构检查通过。输出文件按钮覆盖普通/折叠列表、所属会话、相对/Windows/UNC 路径、中文及特殊字符、旧版预览接口和打开失败后的恢复。另使用真实 DSH Desktop 0.2.2-rc.2 文件地址解析器确认四类路径可由当前面板的打开函数正确还原。子代理行保留状态指示与辅助阅读标签,可见内容仅为名称和同一行右侧的用时。未做整窗目视验收。
|
|
7
|
+
> 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.
|
|
2
8
|
|
|
3
9
|
> 2026-11-12 插件协作验证:已发布包的实际注册代码在隔离服务上下文中注册 DrawAI 0.4.6 的 19 个工具、归藏设计 0.1.4 的 2 个工具和 Agentero host 0.1.8 的 5 个工具。使用桌面宿主 0.2.2-rc.2 的实际参数校验器及 TypeScript / Python SDK 渲染器,26 个工具的发现和选用路径通过。7 条技能全文读取通过;DrawAI 临时文件的读→改→回读、SVG 导出及旧 revision 拒写通过。修复前连续三次旧 revision 拒写会误隔离改图工具;通用分类修复后文件保持不变、工具仍可用,最新 revision 写入通过。新增两项回归测试,全部 199 项通过。context 为源码接口核对。完整来源、版本和未验证项目见 [协作说明](COMPATIBILITY.md)。未做浏览器/模型/外部 CLI/视频端到端验证。
|
|
4
10
|
> 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.
|
package/lib/client.js
CHANGED
|
@@ -216,18 +216,25 @@ window.__ModuleLoader__.load({ id: 'dsh-deep-ptc-mode', factory: require => {
|
|
|
216
216
|
skillHint: '关闭的 Skill 会在你发送下一条消息时移出上下文,历史记录不受影响。',
|
|
217
217
|
skillKeepAll: '全部保留', skillCloseAll: '全部关闭', skillNoDescription: '无描述', skillThisTurn: '本轮',
|
|
218
218
|
skillShowAll: '显示全部 {count} 个', skillShowLess: '收起',
|
|
219
|
-
agentsTitle: '子代理',
|
|
219
|
+
agentsTitle: '子代理',
|
|
220
220
|
agentRunning: '运行中', agentCompleted: '已完成', agentIdle: '空闲', agentExternal: '外部',
|
|
221
221
|
agentOpen: '在右侧栏打开这个子代理的对话',
|
|
222
222
|
sideTitle: '深度 PTC', toolsSection: '工具状态', envAuto: '自动', envForNew: '新会话生效', envThisSession: '本会话保持创建时的环境。',
|
|
223
223
|
envAutoNow: '当前按自动选择:{env}。本会话保持创建时的环境。', envSaved: '已保存,之后新建的会话使用 {env}。',
|
|
224
224
|
envFailed: '未能保存,请检查发行版名称或设置是否已在别处修改。', envDefaultDistribution: '默认发行版',
|
|
225
|
-
durationSeconds: '{s} 秒', durationMinutes: '{m} 分 {s} 秒', durationHours: '{h} 小时 {m} 分',
|
|
225
|
+
durationSeconds: '{s} 秒', durationMinutes: '{m} 分 {s} 秒', durationHours: '{h} 小时 {m} 分',
|
|
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} 轮',
|
|
237
|
+
outputOpenFailed: '无法打开文件,请检查文件是否仍存在,以及宿主文件预览是否可用。',
|
|
231
238
|
sshTitle: 'SSH 连接', sshHint: '非交互连接', sshNoClient: '未找到 OpenSSH 客户端', sshConfigured: '已配置',
|
|
232
239
|
sshUsed: '第 {turn} 轮 · {count} 次', sshFailed: '第 {turn} 轮失败', sshEmpty: '~/.ssh/config 中没有主机别名,本会话也未连接过远程主机。',
|
|
233
240
|
sshCopy: '复制 SSH 检查命令', sshGoCopy: '复制 DSH Go 连接资料', sshCopied: '已复制', sshCopyFailed: '复制失败,请检查剪贴板权限。',
|
|
@@ -242,18 +249,25 @@ window.__ModuleLoader__.load({ id: 'dsh-deep-ptc-mode', factory: require => {
|
|
|
242
249
|
skillHint: 'A closed skill leaves the model context when you send your next message. The history stays complete.',
|
|
243
250
|
skillKeepAll: 'Keep all', skillCloseAll: 'Close all', skillNoDescription: 'No description', skillThisTurn: 'this turn',
|
|
244
251
|
skillShowAll: 'Show all {count}', skillShowLess: 'Show less',
|
|
245
|
-
agentsTitle: 'Subagents',
|
|
252
|
+
agentsTitle: 'Subagents',
|
|
246
253
|
agentRunning: 'Running', agentCompleted: 'Done', agentIdle: 'Idle', agentExternal: 'External',
|
|
247
254
|
agentOpen: 'Open this subagent in the right sidebar',
|
|
248
255
|
sideTitle: 'Deep PTC', toolsSection: 'Tool state', envAuto: 'Auto', envForNew: 'for new sessions', envThisSession: 'This session keeps the environment it was created with.',
|
|
249
256
|
envAutoNow: 'Automatic picks {env}. This session keeps the environment it was created with.', envSaved: 'Saved. New sessions use {env}.',
|
|
250
257
|
envFailed: 'Could not save. Check the distribution name, or whether settings changed elsewhere.', envDefaultDistribution: 'Default distribution',
|
|
251
|
-
durationSeconds: '{s}s', durationMinutes: '{m}m {s}s', durationHours: '{h}h {m}m',
|
|
258
|
+
durationSeconds: '{s}s', durationMinutes: '{m}m {s}s', durationHours: '{h}h {m}m',
|
|
252
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.',
|
|
253
260
|
capsuleOpen: 'Expand or collapse the side panel', panelClose: 'Collapse the side panel',
|
|
254
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}.',
|
|
255
268
|
outputsTitle: 'Output files', outputsEmpty: 'No output files in this conversation.', outputsMore: '{count} more files',
|
|
256
269
|
outputPresented: 'Delivered', outputTurn: 'Turn {turn}',
|
|
270
|
+
outputOpenFailed: 'Could not open the file. Check that it still exists and the host file preview is available.',
|
|
257
271
|
sshTitle: 'SSH connections', sshHint: 'non-interactive', sshNoClient: 'OpenSSH client not found', sshConfigured: 'Configured',
|
|
258
272
|
sshUsed: 'Turn {turn} · {count}×', sshFailed: 'Failed in turn {turn}', sshEmpty: 'No host aliases in ~/.ssh/config and no remote host reached in this conversation.',
|
|
259
273
|
sshCopy: 'Copy SSH check command', sshGoCopy: 'Copy DSH Go connection details', sshCopied: 'Copied', sshCopyFailed: 'Could not copy. Check clipboard permissions.',
|
|
@@ -309,7 +323,7 @@ ${DARK} .dpt-card{--dpt-card-fill:var(--dsw-static-neutral-850,#1a1f29)}
|
|
|
309
323
|
.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)))}
|
|
310
324
|
.dpt-btn:disabled{opacity:.45;cursor:default}
|
|
311
325
|
.dpt-btn[aria-busy="true"]{cursor:wait}
|
|
312
|
-
.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}
|
|
326
|
+
.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}
|
|
313
327
|
.dpt-skill-list{list-style:none;margin:0;padding:0 4px 4px;display:flex;flex-direction:column;gap:2px}
|
|
314
328
|
.dpt-skill{display:flex;align-items:center;gap:12px;padding:7px 8px 7px 10px;border-radius:10px;transition:background-color 120ms}
|
|
315
329
|
.dpt-skill:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(16,24,40,.05))}
|
|
@@ -373,6 +387,10 @@ ${ON} .dpt-capsule[data-state="running"] .dpt-agent-dot,${ON} .dpt-agent[data-st
|
|
|
373
387
|
.dpt-jobs-more .dpt-jobs-list{margin-top:4px}
|
|
374
388
|
.dpt-agent-main{flex:1;min-width:0;display:flex;flex-direction:column}
|
|
375
389
|
.dpt-agent-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
390
|
+
.dpt-side-agents .dpt-agent{align-items:center}
|
|
391
|
+
.dpt-side-agents .dpt-agent-dot{margin-top:0}
|
|
392
|
+
.dpt-side-agents .dpt-agent-name{flex:1;min-width:0}
|
|
393
|
+
.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}
|
|
376
394
|
.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}
|
|
377
395
|
.dpt-capsule-row{display:flex;flex-direction:column;align-items:flex-end;padding:4px 2px 0}
|
|
378
396
|
.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}
|
|
@@ -380,11 +398,18 @@ ${ON} .dpt-capsule[data-state="running"] .dpt-agent-dot,${ON} .dpt-agent[data-st
|
|
|
380
398
|
.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)}
|
|
381
399
|
.dpt-capsule .dpt-agent-dot{margin-top:0}
|
|
382
400
|
.dpt-capsule-row>.dpt-panel{align-self:stretch}
|
|
401
|
+
.dpt-capsule-row:not([data-placement="dock"]){display:none}
|
|
402
|
+
.dpt-capsule[data-compact]{height:28px;max-width:200px;padding:0 10px;gap:6px;flex:none}
|
|
383
403
|
.dpt-sidecar{position:fixed;z-index:20;display:flex;flex-direction:column;box-sizing:border-box;background:var(--dsw-alias-bg-base,#fff);color:var(--dsw-alias-label-primary,#101828);border-left:1px solid var(--dpt-line);overflow:hidden}
|
|
384
404
|
.dpt-sidecar[data-floating]{border:1px solid var(--dpt-line);border-radius:12px;box-shadow:0 4px 20px #0002}
|
|
385
405
|
.dpt-sidecar-head{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid var(--dpt-line);font-size:13px}
|
|
386
406
|
.dpt-sidecar-head h3{margin:0;font:inherit;font-weight:600}
|
|
387
407
|
.dpt-sidecar .dpt-panel{flex:1;height:auto;overflow:hidden}
|
|
408
|
+
.dpt-sidecar .dpt-side-body{padding-bottom:var(--dpt-inset-bottom,0px)}
|
|
409
|
+
.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}
|
|
410
|
+
.dpt-resize::after{content:"";position:absolute;left:0;top:0;bottom:0;width:2px;background:transparent;transition:background-color 120ms}
|
|
411
|
+
.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)}
|
|
412
|
+
body[data-dpt-resizing],body[data-dpt-resizing] *{cursor:col-resize!important;user-select:none!important}
|
|
388
413
|
[data-conversation-region="chat"][data-dpt-panel-open]{margin-right:var(--dpt-panel-width,280px)!important}
|
|
389
414
|
.dpt-tab-title{display:inline-flex;align-items:center;gap:6px}
|
|
390
415
|
.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))}
|
|
@@ -396,6 +421,7 @@ ${ON} .dpt-capsule[data-state="running"] .dpt-agent-dot,${ON} .dpt-agent[data-st
|
|
|
396
421
|
.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}
|
|
397
422
|
.dpt-files{display:grid;gap:1px;list-style:none;margin:0;padding:0}
|
|
398
423
|
.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}
|
|
424
|
+
.dpt-file-open{box-sizing:border-box;width:100%;border:0;background:transparent;color:inherit;font-family:inherit;text-align:left;cursor:pointer}
|
|
399
425
|
.dpt-file:hover{background:color-mix(in srgb,var(--dpt-accent) 6%,transparent)}
|
|
400
426
|
.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}
|
|
401
427
|
.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}
|
|
@@ -937,12 +963,10 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
|
|
|
937
963
|
const completed = !external && entry.activity === 'inactive' && timing?.lastTurnCompleted === true;
|
|
938
964
|
const duration = timing === undefined || external ? undefined : timing.active === undefined ? timing.settledMs
|
|
939
965
|
: timing.settledMs + Math.max(0, (running ? now : timing.active.through) - timing.active.since);
|
|
940
|
-
const usage = summary?.projectionValues?.tokenUsage;
|
|
941
|
-
const tokens = usage ? usage.uncachedInputTokens + usage.outputTokens + usage.cacheReadTokens + usage.cacheWriteTokens : undefined;
|
|
942
966
|
rows.push({ id: entry.id, parentId, mode: entry.mode, depth,
|
|
943
967
|
label: entry.label ?? summary?.title ?? summary?.displayTitle ?? entry.id,
|
|
944
968
|
state: external ? 'external' : running ? 'running' : completed ? 'completed' : 'idle',
|
|
945
|
-
duration: Number.isFinite(duration) ? duration : undefined
|
|
969
|
+
duration: Number.isFinite(duration) ? duration : undefined });
|
|
946
970
|
visit(entry.id, depth + 1);
|
|
947
971
|
}
|
|
948
972
|
};
|
|
@@ -957,12 +981,6 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
|
|
|
957
981
|
if (total >= 60) return tf(t, 'durationMinutes', { m: Math.floor(total / 60), s });
|
|
958
982
|
return tf(t, 'durationSeconds', { s });
|
|
959
983
|
}
|
|
960
|
-
function formatTokens(value) {
|
|
961
|
-
if (value < 1000) return String(value);
|
|
962
|
-
const scaled = value < 1e6 ? value / 1000 : value / 1e6;
|
|
963
|
-
return `${scaled >= 100 ? Math.round(scaled) : Math.round(scaled * 10) / 10}${value < 1e6 ? 'k' : 'M'}`;
|
|
964
|
-
}
|
|
965
|
-
|
|
966
984
|
function openSubagent(row) {
|
|
967
985
|
const sidebar = hostCtx?.get?.('sidebarRight');
|
|
968
986
|
if (typeof sidebar?.openResource === 'function') {
|
|
@@ -1231,14 +1249,33 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
|
|
|
1231
1249
|
const OUTPUT_PREVIEW_LIMIT = 3;
|
|
1232
1250
|
const fileName = path => String(path).split(/[\\/]/u).filter(Boolean).at(-1) ?? String(path);
|
|
1233
1251
|
|
|
1234
|
-
function
|
|
1252
|
+
function openOutputFile(sessionId, path) {
|
|
1253
|
+
// Use the same session-scoped resource address as the host's deliverable cards.
|
|
1254
|
+
const segment = value => encodeURIComponent(value).replace(/%3A/giu, ':');
|
|
1255
|
+
const normalized = path.replace(/\\/gu, '/').replace(/^(?:\.\/)+/u, '');
|
|
1256
|
+
const address = `dsh-resource://file/session/${segment(sessionId)}/${normalized.split('/').map(segment).join('/')}`;
|
|
1257
|
+
const sidebar = hostCtx?.get?.('sidebarRight');
|
|
1258
|
+
if (typeof sidebar?.openResourceIn === 'function') return sidebar.openResourceIn(sessionId, address);
|
|
1259
|
+
if (typeof sidebar?.openResource === 'function') return sidebar.openResource(address);
|
|
1260
|
+
throw new Error('File preview is unavailable');
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
function OutputsSection({ sessionId, outputs, t }) {
|
|
1264
|
+
const [failed, setFailed] = React.useState(false);
|
|
1265
|
+
React.useEffect(() => setFailed(false), [sessionId]);
|
|
1266
|
+
async function open(path) {
|
|
1267
|
+
setFailed(false);
|
|
1268
|
+
try { await openOutputFile(sessionId, path); } catch { setFailed(true); }
|
|
1269
|
+
}
|
|
1235
1270
|
const rows = Array.isArray(outputs) ? outputs : [];
|
|
1236
1271
|
const overflow = rows.length > OUTPUT_PREVIEW_LIMIT;
|
|
1237
1272
|
const visible = rows.slice(0, overflow ? OUTPUT_PREVIEW_LIMIT - 1 : OUTPUT_PREVIEW_LIMIT);
|
|
1238
1273
|
const hidden = overflow ? rows.slice(visible.length) : [];
|
|
1239
|
-
const row = item => h('li', { key: item.path
|
|
1274
|
+
const row = item => h('li', { key: item.path },
|
|
1275
|
+
h('button', { type: 'button', className: 'dpt-file dpt-file-open', 'data-kind': item.kind, title: item.path,
|
|
1276
|
+
onClick: () => { void open(item.path); } },
|
|
1240
1277
|
h('span', { className: 'dpt-file-name' }, fileName(item.path)),
|
|
1241
|
-
h('span', { className: 'dpt-file-meta' }, item.kind === 'presented' ? t('outputPresented') : tf(t, 'outputTurn', { turn: item.turn })));
|
|
1278
|
+
h('span', { className: 'dpt-file-meta' }, item.kind === 'presented' ? t('outputPresented') : tf(t, 'outputTurn', { turn: item.turn }))));
|
|
1242
1279
|
const title = t('outputsTitle');
|
|
1243
1280
|
return h('section', { className: 'dpt-side-section dpt-side-files', 'aria-label': title },
|
|
1244
1281
|
h('div', { className: 'dpt-side-label' }, h('span', null, title), rows.length ? h('span', { className: 'dpt-side-hint' }, String(rows.length)) : null),
|
|
@@ -1246,7 +1283,8 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
|
|
|
1246
1283
|
hidden.length ? h('li', { className: 'dpt-files-more' },
|
|
1247
1284
|
h('details', null, h('summary', null, tf(t, 'outputsMore', { count: hidden.length })),
|
|
1248
1285
|
h('ul', { className: 'dpt-files' }, ...hidden.map(row)))) : null)
|
|
1249
|
-
: h('p', { className: 'dpt-side-note' }, t('outputsEmpty'))
|
|
1286
|
+
: h('p', { className: 'dpt-side-note' }, t('outputsEmpty')),
|
|
1287
|
+
failed ? h('p', { className: 'dpt-side-note', role: 'status' }, t('outputOpenFailed')) : null);
|
|
1250
1288
|
}
|
|
1251
1289
|
|
|
1252
1290
|
// SSH: the configured host aliases and the hosts this conversation reached, most recent first.
|
|
@@ -1310,45 +1348,137 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
|
|
|
1310
1348
|
const deep = preset === 'deep-ptc';
|
|
1311
1349
|
const rows = deep ? subagentRows(sessions, sessionId, now) : [];
|
|
1312
1350
|
const running = rows.filter(row => row.state === 'running').length;
|
|
1313
|
-
const completed = rows.filter(row => row.state === 'completed').length;
|
|
1314
1351
|
React.useEffect(() => {
|
|
1315
1352
|
if (running === 0) return undefined;
|
|
1316
1353
|
const timer = setInterval(() => setNow(Date.now()), 1000);
|
|
1317
1354
|
return () => clearInterval(timer);
|
|
1318
1355
|
}, [running > 0]);
|
|
1319
|
-
const summary = [running ? tf(t, 'agentsRunning', { count: running }) : null, completed ? tf(t, 'agentsCompleted', { count: completed }) : null,
|
|
1320
|
-
rows.length - running - completed > 0 ? tf(t, 'agentsIdle', { count: rows.length - running - completed }) : null].filter(Boolean).join(' · ');
|
|
1321
1356
|
const stateText = row => row.state === 'running' ? t('agentRunning') : row.state === 'completed' ? t('agentCompleted') : row.state === 'external' ? t('agentExternal') : t('agentIdle');
|
|
1322
1357
|
return h('div', { className: 'dpt-panel', 'data-inline': inline ? '' : undefined, 'aria-label': t('sideTitle') },
|
|
1323
1358
|
h('div', { className: 'dpt-side-body' },
|
|
1324
1359
|
form ? h(EnvironmentSection, { form, t }) : null,
|
|
1325
1360
|
!deep ? h('section', { className: 'dpt-side-section' }, h('p', { className: 'dpt-side-note' }, t('sideOtherMode'))) : null,
|
|
1326
1361
|
deep && rows.length ? h('section', { className: 'dpt-side-section dpt-side-agents', 'aria-label': t('agentsTitle') },
|
|
1327
|
-
h('div', { className: 'dpt-side-label' }, h('span', null, t('agentsTitle'))
|
|
1328
|
-
h('ol', { className: 'dpt-agents-list' }, ...rows.map(row =>
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
return h('li', { key: row.id }, h('button', { type: 'button', className: 'dpt-agent', 'data-state': row.state, style: { '--dpt-depth': row.depth },
|
|
1362
|
+
h('div', { className: 'dpt-side-label' }, h('span', null, t('agentsTitle'))),
|
|
1363
|
+
h('ol', { className: 'dpt-agents-list' }, ...rows.map(row =>
|
|
1364
|
+
h('li', { key: row.id }, h('button', { type: 'button', className: 'dpt-agent', 'data-state': row.state,
|
|
1365
|
+
'aria-label': `${row.label} · ${stateText(row)}`, style: { '--dpt-depth': row.depth },
|
|
1332
1366
|
disabled: row.state === 'external', title: t('agentOpen'), onClick: () => openSubagent(row) },
|
|
1333
1367
|
h('span', { className: 'dpt-agent-dot', 'aria-hidden': 'true' }),
|
|
1334
|
-
h('span', { className: 'dpt-agent-
|
|
1335
|
-
|
|
1336
|
-
}))) : null,
|
|
1368
|
+
h('span', { className: 'dpt-agent-name', title: row.label }, row.label),
|
|
1369
|
+
row.duration !== undefined ? h('span', { className: 'dpt-agent-duration' }, formatDuration(row.duration, t)) : null))))) : null,
|
|
1337
1370
|
deep ? (typeof useJobs === 'function' && typeof watchJobs === 'function'
|
|
1338
1371
|
? h(LiveBackgroundJobs, { key: `jobs:${sessionId}`, sessionId, useJobs, watchJobs, t })
|
|
1339
1372
|
: h(BackgroundJobs, { key: `jobs:${sessionId}`, jobs: sessions?.jobsBySession?.[sessionId], t })) : null,
|
|
1340
|
-
deep ? h(OutputsSection, { outputs: activity?.outputs, t }) : null,
|
|
1373
|
+
deep ? h(OutputsSection, { sessionId, outputs: activity?.outputs, t }) : null,
|
|
1341
1374
|
h(SshSection, { form, ssh: deep ? activity?.ssh : undefined, t }),
|
|
1342
1375
|
deep && typeof reset === 'function' ? h(ToolStateControls, { sessionId, useProjection, reset, t }) : null,
|
|
1343
1376
|
h(VisualEffectsSection, { t })));
|
|
1344
1377
|
}
|
|
1345
1378
|
|
|
1346
1379
|
const PANEL_WIDTH = 280;
|
|
1380
|
+
const PANEL_MIN_WIDTH = 240;
|
|
1381
|
+
const PANEL_MAX_WIDTH = 640;
|
|
1347
1382
|
const PANEL_MIN_ROOM = 820;
|
|
1383
|
+
// A docked panel never squeezes the conversation below this width.
|
|
1384
|
+
const CHAT_MIN_WIDTH = 540;
|
|
1348
1385
|
const PANEL_COLLAPSED_KEY = `${PLUGIN}:side-panel-collapsed`;
|
|
1349
|
-
const
|
|
1350
|
-
|
|
1386
|
+
const PANEL_WIDTH_KEY = `${PLUGIN}:side-panel-width`;
|
|
1387
|
+
const CAPSULE_KEY = `${PLUGIN}:capsule-placement`;
|
|
1388
|
+
const PLACEMENTS = ['auto', 'dock', 'toolbar', 'hidden'];
|
|
1389
|
+
const readStored = key => { try { return localStorage.getItem(key); } catch { return null; } };
|
|
1390
|
+
const writeStored = (key, value) => { try { localStorage.setItem(key, value); } catch { /* kept in memory */ } };
|
|
1391
|
+
const readPanelWidth = () => {
|
|
1392
|
+
const value = Number(readStored(PANEL_WIDTH_KEY));
|
|
1393
|
+
return Number.isFinite(value) && value > 0 ? Math.round(value) : PANEL_WIDTH;
|
|
1394
|
+
};
|
|
1395
|
+
const readPlacement = () => { const value = readStored(CAPSULE_KEY); return PLACEMENTS.includes(value) ? value : 'auto'; };
|
|
1396
|
+
|
|
1397
|
+
// Viewer preferences (collapsed, width, capsule placement) and each conversation's open state, shared
|
|
1398
|
+
// by the panel host in the composer dock, the capsule wherever it sits, and the right-sidebar tab.
|
|
1399
|
+
const PANEL = {
|
|
1400
|
+
collapsed: readStored(PANEL_COLLAPSED_KEY) === '1',
|
|
1401
|
+
width: readPanelWidth(),
|
|
1402
|
+
placement: readPlacement(),
|
|
1403
|
+
peek: new Map(), wide: new Map(), version: 0, subs: new Set(),
|
|
1404
|
+
subscribe(listener) { this.subs.add(listener); return () => this.subs.delete(listener); },
|
|
1405
|
+
emit() { this.version++; for (const listener of [...this.subs]) { try { listener(); } catch (error) { console.warn(`[${PLUGIN}]`, error); } } },
|
|
1406
|
+
isOpen(id) { return (this.wide.get(id) === true && !this.collapsed) || this.peek.get(id) === true; },
|
|
1407
|
+
// A layout change (docked, floating, covered) closes a floating peek, as before.
|
|
1408
|
+
setWide(id, wide) {
|
|
1409
|
+
if (this.wide.get(id) === wide) return;
|
|
1410
|
+
if (wide === undefined) this.wide.delete(id); else this.wide.set(id, wide);
|
|
1411
|
+
this.peek.delete(id);
|
|
1412
|
+
this.emit();
|
|
1413
|
+
},
|
|
1414
|
+
setCollapsed(value) { this.collapsed = value; writeStored(PANEL_COLLAPSED_KEY, value ? '1' : '0'); },
|
|
1415
|
+
toggle(id) {
|
|
1416
|
+
if (this.wide.get(id)) this.setCollapsed(!this.collapsed);
|
|
1417
|
+
else this.peek.set(id, this.peek.get(id) !== true);
|
|
1418
|
+
this.emit();
|
|
1419
|
+
},
|
|
1420
|
+
open(id) {
|
|
1421
|
+
if (id === undefined) return;
|
|
1422
|
+
if (this.wide.get(id)) this.setCollapsed(false); else this.peek.set(id, true);
|
|
1423
|
+
this.emit();
|
|
1424
|
+
},
|
|
1425
|
+
setWidth(width, persist) {
|
|
1426
|
+
const next = Math.round(width);
|
|
1427
|
+
if (Number.isFinite(next) && next > 0 && next !== this.width) { this.width = next; this.emit(); }
|
|
1428
|
+
if (persist) writeStored(PANEL_WIDTH_KEY, String(this.width));
|
|
1429
|
+
},
|
|
1430
|
+
setPlacement(value) {
|
|
1431
|
+
if (!PLACEMENTS.includes(value) || value === this.placement) return;
|
|
1432
|
+
this.placement = value;
|
|
1433
|
+
writeStored(CAPSULE_KEY, value);
|
|
1434
|
+
this.emit();
|
|
1435
|
+
},
|
|
1436
|
+
// Another window changed a preference.
|
|
1437
|
+
sync(event) {
|
|
1438
|
+
if (event.key !== null && ![PANEL_COLLAPSED_KEY, PANEL_WIDTH_KEY, CAPSULE_KEY].includes(event.key)) return;
|
|
1439
|
+
this.collapsed = readStored(PANEL_COLLAPSED_KEY) === '1';
|
|
1440
|
+
this.width = readPanelWidth();
|
|
1441
|
+
this.placement = readPlacement();
|
|
1442
|
+
this.emit();
|
|
1443
|
+
},
|
|
1351
1444
|
};
|
|
1445
|
+
const getPanelVersion = () => PANEL.version;
|
|
1446
|
+
const subscribePanel = listener => PANEL.subscribe(listener);
|
|
1447
|
+
function usePanel() {
|
|
1448
|
+
React.useSyncExternalStore(subscribePanel, getPanelVersion, getPanelVersion);
|
|
1449
|
+
return PANEL;
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
// dsh-claude-style folds the composer into one row, which leaves no room for a row of our own below it.
|
|
1453
|
+
const compactComposer = () => typeof document !== 'undefined'
|
|
1454
|
+
&& (document.body?.hasAttribute?.('data-dsh-claude-style') === true || appearancePlugin() === 'dsh-claude-style');
|
|
1455
|
+
function subscribeCompact(listener) {
|
|
1456
|
+
if (typeof MutationObserver !== 'function' || typeof document === 'undefined' || !document.body) return () => {};
|
|
1457
|
+
const observer = new MutationObserver(listener);
|
|
1458
|
+
try {
|
|
1459
|
+
observer.observe(document.body, { attributes: true, attributeFilter: ['data-dsh-claude-style'] });
|
|
1460
|
+
if (document.head) observer.observe(document.head, { childList: true });
|
|
1461
|
+
} catch { /* detection stays as first read */ }
|
|
1462
|
+
return () => observer.disconnect();
|
|
1463
|
+
}
|
|
1464
|
+
const useCompactComposer = () => React.useSyncExternalStore(subscribeCompact, compactComposer, compactComposer);
|
|
1465
|
+
const resolvePlacement = compact => PANEL.placement === 'auto' ? (compact ? 'toolbar' : 'dock') : PANEL.placement;
|
|
1466
|
+
|
|
1467
|
+
// Floating widgets pinned to the window's bottom-right corner (the dsh-whale-widget whale) cover the
|
|
1468
|
+
// bottom of the panel; the panel body reserves that height so its last controls scroll clear of it.
|
|
1469
|
+
const CORNER_FLOATERS = '.dshwv-root .dshwv-img';
|
|
1470
|
+
function cornerInset(box) {
|
|
1471
|
+
if (typeof document === 'undefined') return 0;
|
|
1472
|
+
let inset = 0;
|
|
1473
|
+
for (const node of document.querySelectorAll?.(CORNER_FLOATERS) ?? []) {
|
|
1474
|
+
const rect = node.getBoundingClientRect?.();
|
|
1475
|
+
if (!rect || rect.width <= 0 || rect.height <= 0) continue;
|
|
1476
|
+
const overlaps = rect.left < box.right && rect.right > box.left && rect.top < box.bottom && rect.bottom > box.top;
|
|
1477
|
+
if (overlaps) inset = Math.max(inset, box.bottom - rect.top);
|
|
1478
|
+
}
|
|
1479
|
+
// Never more than half the panel: the panel stays usable under a widget scaled up very large.
|
|
1480
|
+
return Math.round(Math.min(inset, (box.bottom - box.top) / 2));
|
|
1481
|
+
}
|
|
1352
1482
|
|
|
1353
1483
|
// Measure the conversation itself, so the panel follows native sidebar resizing and is hidden
|
|
1354
1484
|
// when that conversation is covered by a fullscreen sidebar.
|
|
@@ -1382,10 +1512,16 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
|
|
|
1382
1512
|
}
|
|
1383
1513
|
const wide = room.width >= PANEL_MIN_ROOM;
|
|
1384
1514
|
const composer = region.querySelector('[data-composer-seat]')?.getBoundingClientRect();
|
|
1385
|
-
const
|
|
1515
|
+
const fit = Math.max(0, room.width - 24);
|
|
1516
|
+
const maxWidth = Math.min(fit, Math.max(PANEL_MIN_WIDTH, Math.min(PANEL_MAX_WIDTH, wide ? room.width - CHAT_MIN_WIDTH : fit)));
|
|
1517
|
+
const minWidth = Math.min(PANEL_MIN_WIDTH, maxWidth);
|
|
1518
|
+
const next = { region, wide, minWidth, maxWidth, top: Math.round(rect.top), right: Math.round(window.innerWidth - room.right),
|
|
1386
1519
|
height: Math.round(wide ? rect.height : Math.max(0, Math.min(rect.height, (composer?.top ?? rect.bottom) - rect.top - 8))),
|
|
1387
|
-
width: Math.min(
|
|
1388
|
-
const
|
|
1520
|
+
width: Math.min(maxWidth, Math.max(minWidth, PANEL.width)) };
|
|
1521
|
+
const right = window.innerWidth - next.right;
|
|
1522
|
+
next.inset = cornerInset({ left: right - next.width, right, top: next.top, bottom: next.top + next.height });
|
|
1523
|
+
const same = previous?.region === region
|
|
1524
|
+
&& ['wide', 'top', 'right', 'height', 'width', 'minWidth', 'maxWidth', 'inset'].every(key => previous[key] === next[key]);
|
|
1389
1525
|
if (!same) { previous = next; setLayout(next); }
|
|
1390
1526
|
}
|
|
1391
1527
|
function schedule() {
|
|
@@ -1393,13 +1529,16 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
|
|
|
1393
1529
|
}
|
|
1394
1530
|
const changes = typeof MutationObserver === 'function' ? new MutationObserver(records => {
|
|
1395
1531
|
if (!previous?.region?.isConnected || records.some(record => record.type === 'attributes'
|
|
1396
|
-
&& (record.target.contains(previous?.region) || record.target.matches?.('[data-sidebar-right-panel]')))) schedule();
|
|
1532
|
+
&& (record.target.contains(previous?.region) || record.target.matches?.('[data-sidebar-right-panel],.dshwv-root')))) schedule();
|
|
1397
1533
|
}) : undefined;
|
|
1398
1534
|
changes?.observe(document.body, { subtree: true, childList: true, attributes: true,
|
|
1399
1535
|
attributeFilter: ['class', 'style', 'hidden', 'aria-hidden', 'data-sidebar-right-panel', 'data-sidebar-right-open'] });
|
|
1400
1536
|
window.addEventListener('resize', schedule);
|
|
1537
|
+
// A new preferred width (dragging the edge, another window) is measured like a resize.
|
|
1538
|
+
const unsubscribe = PANEL.subscribe(() => { if (previous?.width !== Math.min(previous?.maxWidth ?? Infinity, Math.max(previous?.minWidth ?? 0, PANEL.width))) schedule(); });
|
|
1401
1539
|
measure();
|
|
1402
1540
|
return () => {
|
|
1541
|
+
unsubscribe();
|
|
1403
1542
|
resize?.disconnect(); changes?.disconnect();
|
|
1404
1543
|
window.removeEventListener('resize', schedule);
|
|
1405
1544
|
if (frame !== undefined) cancelAnimationFrame(frame);
|
|
@@ -1408,19 +1547,90 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
|
|
|
1408
1547
|
return layout;
|
|
1409
1548
|
}
|
|
1410
1549
|
|
|
1411
|
-
// The capsule
|
|
1412
|
-
function
|
|
1413
|
-
const { sessionId, useSessions, useProjection, form, t } = props;
|
|
1414
|
-
const marker = React.useRef(null);
|
|
1415
|
-
const layout = useSidePanelLayout(sessionId, marker);
|
|
1550
|
+
// The capsule's one-line summary: environment, subagents, tool notices.
|
|
1551
|
+
function useCapsuleSummary({ sessionId, useSessions, useProjection, form, t }) {
|
|
1416
1552
|
const sessions = typeof useSessions === 'function' ? useSessions(state => state) : undefined;
|
|
1417
1553
|
const tools = projectionValue(useProjection, 'deepPtcTools');
|
|
1418
1554
|
const settings = useSettingsForm(form);
|
|
1419
|
-
const
|
|
1420
|
-
const
|
|
1421
|
-
|
|
1422
|
-
const
|
|
1423
|
-
const
|
|
1555
|
+
const rows = subagentRows(sessions, sessionId, Date.now());
|
|
1556
|
+
const running = rows.some(row => row.state === 'running');
|
|
1557
|
+
const failures = tools && typeof tools === 'object' ? (tools.report?.tools ?? []).length : 0;
|
|
1558
|
+
const environment = settings.status === 'ready' && settings.value ? envLabel(settings.value.environment ?? 'auto', t) : undefined;
|
|
1559
|
+
const label = [environment, rows.length ? `${t('agentsTitle')} ${rows.length}` : null, failures ? `${t('toolFailures')} ${failures}` : null]
|
|
1560
|
+
.filter(Boolean).join(' · ') || t('sideTitle');
|
|
1561
|
+
return { label, running };
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
// The capsule toggles this conversation's side panel, below the composer or in its toolbar.
|
|
1565
|
+
function CapsuleButton(props) {
|
|
1566
|
+
const { sessionId, compact, t } = props;
|
|
1567
|
+
usePanel();
|
|
1568
|
+
const { label, running } = useCapsuleSummary(props);
|
|
1569
|
+
return h('button', { type: 'button', className: 'dpt-capsule', 'data-compact': compact ? '' : undefined,
|
|
1570
|
+
'data-state': running ? 'running' : 'idle', 'aria-expanded': props.open ?? PANEL.isOpen(sessionId),
|
|
1571
|
+
title: compact ? `${t('capsuleOpen')} · ${label}` : t('capsuleOpen'), onClick: () => PANEL.toggle(sessionId) },
|
|
1572
|
+
h('span', { className: 'dpt-agent-dot', 'aria-hidden': 'true' }), h('span', null, label));
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
// The panel's left edge. Dragging sets the preferred width (kept per viewer); arrow keys step it,
|
|
1576
|
+
// Home and End jump to the bounds, a double click restores the default.
|
|
1577
|
+
function ResizeHandle({ layout, t }) {
|
|
1578
|
+
const [active, setActive] = React.useState(false);
|
|
1579
|
+
const stop = React.useRef();
|
|
1580
|
+
React.useEffect(() => () => stop.current?.(), []);
|
|
1581
|
+
const clamp = value => Math.min(layout.maxWidth, Math.max(layout.minWidth, value));
|
|
1582
|
+
function onPointerDown(event) {
|
|
1583
|
+
if (event.button !== undefined && event.button !== 0) return;
|
|
1584
|
+
event.preventDefault();
|
|
1585
|
+
const target = event.currentTarget;
|
|
1586
|
+
const startX = event.clientX;
|
|
1587
|
+
const startWidth = layout.width;
|
|
1588
|
+
const move = next => PANEL.setWidth(clamp(startWidth + startX - next.clientX), false);
|
|
1589
|
+
const end = () => {
|
|
1590
|
+
target.removeEventListener?.('pointermove', move);
|
|
1591
|
+
target.removeEventListener?.('pointerup', end);
|
|
1592
|
+
target.removeEventListener?.('pointercancel', end);
|
|
1593
|
+
document.body?.removeAttribute?.('data-dpt-resizing');
|
|
1594
|
+
stop.current = undefined;
|
|
1595
|
+
setActive(false);
|
|
1596
|
+
PANEL.setWidth(PANEL.width, true);
|
|
1597
|
+
};
|
|
1598
|
+
try { target.setPointerCapture?.(event.pointerId); } catch { /* the move events still reach the handle */ }
|
|
1599
|
+
target.addEventListener?.('pointermove', move);
|
|
1600
|
+
target.addEventListener?.('pointerup', end);
|
|
1601
|
+
target.addEventListener?.('pointercancel', end);
|
|
1602
|
+
document.body?.setAttribute?.('data-dpt-resizing', '');
|
|
1603
|
+
stop.current = end;
|
|
1604
|
+
setActive(true);
|
|
1605
|
+
}
|
|
1606
|
+
function onKeyDown(event) {
|
|
1607
|
+
const step = event.shiftKey ? 64 : 16;
|
|
1608
|
+
const next = event.key === 'ArrowLeft' ? layout.width + step : event.key === 'ArrowRight' ? layout.width - step
|
|
1609
|
+
: event.key === 'Home' ? layout.minWidth : event.key === 'End' ? layout.maxWidth : undefined;
|
|
1610
|
+
if (next === undefined) return;
|
|
1611
|
+
event.preventDefault();
|
|
1612
|
+
PANEL.setWidth(clamp(next), true);
|
|
1613
|
+
}
|
|
1614
|
+
return h('div', { className: 'dpt-resize', role: 'separator', 'aria-orientation': 'vertical', tabIndex: 0,
|
|
1615
|
+
'aria-label': t('panelResize'), title: t('panelResize'), 'data-active': active ? '' : undefined,
|
|
1616
|
+
'aria-valuenow': layout.width, 'aria-valuemin': layout.minWidth, 'aria-valuemax': layout.maxWidth,
|
|
1617
|
+
onPointerDown, onKeyDown, onDoubleClick: () => PANEL.setWidth(clamp(PANEL_WIDTH), true) });
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
// Mounted in the composer dock for every Deep PTC conversation, whatever the capsule placement: its
|
|
1621
|
+
// marker locates the conversation, and it owns the side panel. When the capsule sits elsewhere the
|
|
1622
|
+
// row is display:none, which keeps the marker (and closest()) working without taking a row.
|
|
1623
|
+
function PanelHost(props) {
|
|
1624
|
+
const { sessionId, useSessions, t } = props;
|
|
1625
|
+
const marker = React.useRef(null);
|
|
1626
|
+
const layout = useSidePanelLayout(sessionId, marker);
|
|
1627
|
+
usePanel();
|
|
1628
|
+
const placement = resolvePlacement(useCompactComposer());
|
|
1629
|
+
const wide = layout ? layout.wide : undefined;
|
|
1630
|
+
React.useEffect(() => PANEL.setWide(sessionId, wide), [sessionId, wide]);
|
|
1631
|
+
React.useEffect(() => () => PANEL.setWide(sessionId, undefined), [sessionId]);
|
|
1632
|
+
const docked = !!layout?.wide && !PANEL.collapsed;
|
|
1633
|
+
const open = docked || PANEL.peek.get(sessionId) === true;
|
|
1424
1634
|
React.useEffect(() => {
|
|
1425
1635
|
const region = layout?.region;
|
|
1426
1636
|
if (!region) return undefined;
|
|
@@ -1428,34 +1638,24 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
|
|
|
1428
1638
|
region.style.setProperty('--dpt-panel-width', `${layout.width}px`);
|
|
1429
1639
|
return () => { region.removeAttribute('data-dpt-panel-open'); region.style.removeProperty('--dpt-panel-width'); };
|
|
1430
1640
|
}, [layout?.region, layout?.width, docked]);
|
|
1431
|
-
const
|
|
1432
|
-
const running =
|
|
1641
|
+
const sessions = typeof useSessions === 'function' ? useSessions(state => state) : undefined;
|
|
1642
|
+
const running = subagentRows(sessions, sessionId, Date.now()).some(row => row.state === 'running');
|
|
1433
1643
|
React.useEffect(() => {
|
|
1434
|
-
SESSIONS.setWorking(sessionId, running
|
|
1644
|
+
SESSIONS.setWorking(sessionId, running);
|
|
1435
1645
|
return () => SESSIONS.setWorking(sessionId, false);
|
|
1436
|
-
}, [sessionId, running
|
|
1437
|
-
const failures = tools && typeof tools === 'object' ? (tools.report?.tools ?? []).length : 0;
|
|
1438
|
-
const environment = settings.status === 'ready' && settings.value ? envLabel(settings.value.environment ?? 'auto', t) : undefined;
|
|
1439
|
-
const label = [environment, rows.length ? `${t('agentsTitle')} ${rows.length}` : null, failures ? `${t('toolFailures')} ${failures}` : null]
|
|
1440
|
-
.filter(Boolean).join(' · ') || t('sideTitle');
|
|
1441
|
-
const toggle = () => {
|
|
1442
|
-
if (layout?.wide) {
|
|
1443
|
-
const next = !collapsed;
|
|
1444
|
-
setCollapsed(next);
|
|
1445
|
-
try { localStorage.setItem(PANEL_COLLAPSED_KEY, next ? '1' : '0'); } catch { /* viewer preference */ }
|
|
1446
|
-
} else setPeek(value => !value);
|
|
1447
|
-
};
|
|
1646
|
+
}, [sessionId, running]);
|
|
1448
1647
|
const panel = open && layout ? ReactDOM.createPortal(h('aside', { className: 'dpt-sidecar',
|
|
1449
1648
|
'data-floating': docked ? undefined : '', 'aria-label': t('sideTitle'),
|
|
1450
|
-
style: { top: layout.top, right: layout.right, height: layout.height, width: layout.width
|
|
1649
|
+
style: { top: layout.top, right: layout.right, height: layout.height, width: layout.width,
|
|
1650
|
+
'--dpt-inset-bottom': layout.inset ? `${layout.inset}px` : undefined } },
|
|
1651
|
+
h(ResizeHandle, { layout, t }),
|
|
1451
1652
|
h('header', { className: 'dpt-sidecar-head' }, h('h3', null, t('sideTitle')),
|
|
1452
|
-
h('button', { type: 'button', className: 'dpt-icon-btn', onClick: toggle, 'aria-label': t('panelClose') }, '×')),
|
|
1653
|
+
h('button', { type: 'button', className: 'dpt-icon-btn', onClick: () => PANEL.toggle(sessionId), 'aria-label': t('panelClose') }, '×')),
|
|
1453
1654
|
h(DeepPtcPanel, props)), document.body) : null;
|
|
1454
|
-
return h(
|
|
1455
|
-
h('
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
panel,
|
|
1655
|
+
return h(React.Fragment, null,
|
|
1656
|
+
h('div', { ref: marker, className: 'dpt-capsule-row', 'data-placement': placement },
|
|
1657
|
+
placement === 'dock' ? h(CapsuleButton, { ...props, open }) : null,
|
|
1658
|
+
panel),
|
|
1459
1659
|
open && !layout && typeof ReactDOM?.createPortal !== 'function' ? h(DeepPtcPanel, { ...props, inline: true }) : null);
|
|
1460
1660
|
}
|
|
1461
1661
|
|
|
@@ -1482,11 +1682,41 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
|
|
|
1482
1682
|
function DockHost(props) {
|
|
1483
1683
|
// Registered for every session; only Deep PTC sessions draw the capsule.
|
|
1484
1684
|
if (projectionValue(props.useProjection, 'agentPreset') !== 'deep-ptc') return null;
|
|
1485
|
-
return h(Boundary, null, h(
|
|
1685
|
+
return h(Boundary, null, h(PanelHost, props));
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
// The compact capsule in the composer toolbar, beside the host's own controls (conversation.input.right).
|
|
1689
|
+
function ToolbarHost(props) {
|
|
1690
|
+
usePanel();
|
|
1691
|
+
const placement = resolvePlacement(useCompactComposer());
|
|
1692
|
+
if (projectionValue(props.useProjection, 'agentPreset') !== 'deep-ptc' || placement !== 'toolbar') return null;
|
|
1693
|
+
return h(Boundary, null, h(CapsuleButton, { ...props, compact: true }));
|
|
1486
1694
|
}
|
|
1487
1695
|
|
|
1488
|
-
|
|
1489
|
-
|
|
1696
|
+
const PLACEMENT_NOTES = { dock: 'panelMoved', toolbar: 'panelMovedToolbar', hidden: 'panelMovedHidden' };
|
|
1697
|
+
function TabHost({ sessionId, t }) {
|
|
1698
|
+
usePanel();
|
|
1699
|
+
const placement = resolvePlacement(useCompactComposer());
|
|
1700
|
+
const id = sessionId ?? SESSIONS.current()?.id;
|
|
1701
|
+
return h('div', { className: 'dpt-side-section' },
|
|
1702
|
+
h('p', { className: 'dpt-side-note' }, t(PLACEMENT_NOTES[placement])),
|
|
1703
|
+
h('button', { type: 'button', className: 'dpt-btn dpt-btn-block', disabled: id === undefined, onClick: () => PANEL.open(id) }, t('panelOpen')));
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
const PLACEMENT_LABELS = { auto: 'placementAuto', dock: 'placementDock', toolbar: 'placementToolbar', hidden: 'placementHidden' };
|
|
1707
|
+
function CapsulePlacementSection({ t }) {
|
|
1708
|
+
usePanel();
|
|
1709
|
+
const compact = useCompactComposer();
|
|
1710
|
+
const label = t('capsulePlacement');
|
|
1711
|
+
const note = PANEL.placement === 'auto'
|
|
1712
|
+
? `${tf(t, 'placementAutoNow', { place: t(PLACEMENT_LABELS[resolvePlacement(compact)]) })}${t('placementHint')}`
|
|
1713
|
+
: t('placementHint');
|
|
1714
|
+
return h('section', { className: 'dpt-side-section', 'aria-label': label },
|
|
1715
|
+
h('div', { className: 'dpt-side-label' }, h('span', null, label)),
|
|
1716
|
+
h('div', { className: 'dpt-seg', role: 'radiogroup', 'aria-label': label },
|
|
1717
|
+
...PLACEMENTS.map(option => h('button', { key: option, type: 'button', role: 'radio', className: 'dpt-seg-btn',
|
|
1718
|
+
'aria-checked': option === PANEL.placement, onClick: () => PANEL.setPlacement(option) }, t(PLACEMENT_LABELS[option])))),
|
|
1719
|
+
h('p', { className: 'dpt-side-note' }, note));
|
|
1490
1720
|
}
|
|
1491
1721
|
|
|
1492
1722
|
function TabTitle({ t }) {
|
|
@@ -1514,7 +1744,8 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
|
|
|
1514
1744
|
// The form labels its own environment field.
|
|
1515
1745
|
h('section', { 'aria-label': t('environment') },
|
|
1516
1746
|
form ? h(Card, { form, t }) : h('p', { className: 'dpt-side-note' }, t('readOnly'))),
|
|
1517
|
-
h('section', { 'aria-label': t('
|
|
1747
|
+
h('section', { 'aria-label': t('appearance') }, h('h3', null, t('appearance')),
|
|
1748
|
+
h(VisualEffectsSection, { t }), h(CapsulePlacementSection, { t })),
|
|
1518
1749
|
h(DiagnosticsSection, { t }));
|
|
1519
1750
|
}
|
|
1520
1751
|
|
|
@@ -1571,6 +1802,12 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
|
|
|
1571
1802
|
installPresetLabels(ctx.slots, t, useLocaleRevision);
|
|
1572
1803
|
ctx.effect(() => injectCss(), `${PLUGIN}: style`);
|
|
1573
1804
|
ctx.effect(() => watchActiveSession(), `${PLUGIN}: active session`);
|
|
1805
|
+
ctx.effect(() => {
|
|
1806
|
+
if (typeof window?.addEventListener !== 'function') return () => {};
|
|
1807
|
+
const sync = event => PANEL.sync(event);
|
|
1808
|
+
window.addEventListener('storage', sync);
|
|
1809
|
+
return () => window.removeEventListener('storage', sync);
|
|
1810
|
+
}, `${PLUGIN}: panel preferences`);
|
|
1574
1811
|
const form = ctx.configForms.get(NS);
|
|
1575
1812
|
ctx.effect(() => ctx.configForms.whileServed([NS], () => {
|
|
1576
1813
|
const disposers = [
|
|
@@ -1621,17 +1858,34 @@ ${ON}[data-dpt-busy] [data-dpt-send]::after{content:"";position:absolute;inset:-
|
|
|
1621
1858
|
inject: sessionTools(child),
|
|
1622
1859
|
}, props => h(LocalizedSlot, { ...props, form, component: DockHost })));
|
|
1623
1860
|
} catch { /* the composer stays usable when this slot cannot register */ }
|
|
1861
|
+
try {
|
|
1862
|
+
// The compact capsule joins the host's tool row, so a one-row composer keeps one row.
|
|
1863
|
+
child.slots.inject('conversation.input.right', () => child.slots.register({
|
|
1864
|
+
name: 'conversation.input.right', id: 'deep-ptc-capsule', order: 80, locale: 'deep-ptc',
|
|
1865
|
+
}, props => h(LocalizedSlot, { ...props, form, component: ToolbarHost })));
|
|
1866
|
+
} catch { /* the capsule stays below the composer */ }
|
|
1624
1867
|
});
|
|
1625
1868
|
} catch { /* the composer stays usable when this slot cannot register */ }
|
|
1626
1869
|
try {
|
|
1627
|
-
//
|
|
1870
|
+
// The tab holds a button that opens the panel. It is listed on the sidebar's new-tab guide only
|
|
1871
|
+
// while the capsule is hidden, as the way back to the panel; saved tabs open in any placement.
|
|
1628
1872
|
ctx.inject?.(['remote', 'remote.commands', 'sidebarRightTabs'], child => {
|
|
1629
1873
|
child.effect(() => {
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1874
|
+
let hidden;
|
|
1875
|
+
let dispose;
|
|
1876
|
+
const register = () => {
|
|
1877
|
+
const next = PANEL.placement === 'hidden';
|
|
1878
|
+
if (next === hidden) return;
|
|
1879
|
+
hidden = next;
|
|
1880
|
+
dispose?.();
|
|
1881
|
+
dispose = child.sidebarRightTabs.register({
|
|
1882
|
+
id: PLUGIN, kind: TAB_KIND, title: () => t('sideTitle'),
|
|
1883
|
+
guide: hidden ? [{ id: TAB_KIND, order: 60, title: () => t('sideTitle'), description: () => t('sideGuide') }] : [],
|
|
1884
|
+
});
|
|
1885
|
+
};
|
|
1886
|
+
register();
|
|
1887
|
+
const unsubscribe = PANEL.subscribe(register);
|
|
1888
|
+
return () => { unsubscribe(); dispose?.(); };
|
|
1635
1889
|
}, `${PLUGIN}: sidebar tab type`);
|
|
1636
1890
|
child.slots.inject('sidebar.right.pane.tab', () => child.slots.register({
|
|
1637
1891
|
name: 'sidebar.right.pane.tab', key: PLUGIN, locale: 'deep-ptc', inject: sessionTools(child),
|
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. Use
|
|
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
|
|
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.
|
|
4
|
-
"description": "Deep PTC for DeepSeek Harness: interruptible jobs, selectable shells, a
|
|
3
|
+
"version": "1.9.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": [
|
|
7
7
|
"dsh-plugin",
|