dsh-deep-ptc-mode 1.8.7 → 1.9.0

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,51 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.0 — 2026-11-11
4
+
5
+ - 面板移入 DSH 官方入口:设置里新增独立的「深度 PTC」页(执行环境、界面特效、可复制的诊断信息);右侧栏新增「深度 PTC」页签,也出现在右侧栏的新建页签引导中,停靠、浮动、全屏由 DSH 管理;输入框下方的小胶囊打开它,没有右侧栏的宿主在原地展开。原来悬浮的侧边卡片、挤压对话区的停靠列和右上角胶囊全部移除,右侧栏全屏时不再残留悬浮胶囊(#11),也不再遮挡消息(#12)。
6
+ - 设置左导航不再出现两个「Agent 预设」(#9、#13):去掉对 `settings.section` 的同 id 影子注册,改为注册自己的设置页。
7
+ - 深度 PTC 会话里的官方插件(如 Computer Use)不再静默缺席(#14):除子代理、定时任务、预设注册表和应用自身代码外,官方插件一律按角色收到基础预设 `ptc`,不再逐个读取源码判断。仅在深度 PTC 会话中生效。
8
+ - 感谢 @GYT-Lucas 在 #13、#14 中定位根因并提交修复,本版以自己的实现吸收了这两个问题。
9
+ - 新增「输出文件」:本会话写入或交付的文件,最新在前;最多三个位置,超出时折叠占一个位置。规则与 DSH 官方交付卡片一致,并包括 `run_code` 内写入的文件。
10
+ - 新增 SSH:面板列出本会话连接过的主机及结果,以及 `~/.ssh/config` 的主机别名;模型获得本机 OpenSSH 客户端位置、主机别名和非交互使用规则(`BatchMode`、超时、认证失败即停、长任务转后台)。只读取主机名称、地址、用户和端口,不读取密钥。
11
+ - 预设名称与描述改为与语言无关(`Deep PTC · PowerShell`),模式选择器和会话头部仍按 DSH 语言显示本地化文字;安全模式会写出宿主给出的原因。
12
+ - 安全模式只在预设行真正启动失败时启用;仅在等待服务的行不再触发安全模式(#5)。修改设置或上游声明后重新尝试完整预设。
13
+ - 识别 Microsoft Store 安装的 PowerShell 7:用 `lstat` 和 `readlink` 读取应用执行别名,不再把“拒绝访问”的路径一律当作存在;同一安装只列一次,标为「PowerShell 7(应用商店)」(#10)。
14
+ - 界面特效轻量化(#6):样式直接作用于 DSH 的 `data-composer-card`、`data-message-bubble` 等稳定属性,不再逐帧计算元素样式;循环动画只改透明度或位移;光点画布只覆盖输入框附近,像素密度上限 1.5,空闲或窗口隐藏时停止;不再定时轮询当前会话。检测到 dsh-claude-style、dsh-refined-ui 等外观插件时特效默认关闭,手动打开后保留选择(#7)。
15
+ - 移除本插件添加的全部快捷键:Ctrl/⌘+K 命令面板(与 DSH「搜索会话」冲突)、`/`、Alt+↑/↓ 和 Ctrl+Alt+D。诊断信息移到设置页。
16
+ - 人设新增「遵循用户指令」和「工作纪律」:不认识的词先问用户,用户不知道时再自行查证;用户说明优先于模型的既有认识;不擅自换方案;多项请求逐项核对;不虚报验证结果。
17
+ - 预设身份兼容层在宿主 `composedPreset` 签名不符时不安装。
18
+
19
+ - The panel moves into official DSH entry points: a Deep PTC settings page (environment, visual effects, copyable diagnostics), and a Deep PTC tab in the right sidebar, also listed on its new-tab guide, which DSH docks, floats and expands like its own tabs. The capsule under the composer opens it, or opens the panel in place on a host without a right sidebar. The floating side card, the docked column that narrowed the conversation and the top-right pill are gone, so nothing floats over a fullscreen sidebar (#11) or covers messages (#12).
20
+ - The settings navigation lists Agent presets once (#9, #13): the same-id shadow entry in `settings.section` is replaced by Deep PTC's own settings page.
21
+ - Official plugins such as computer use no longer go missing in Deep PTC sessions (#14): apart from subagents, schedules, the preset registry and the application's own code, every official plugin sees the base preset `ptc` by its role, without its source being read. Only Deep PTC sessions are affected.
22
+ - Thanks to @GYT-Lucas for tracing the causes and contributing fixes in #13 and #14; this release absorbs both with its own implementation.
23
+ - Output files: files this conversation wrote or delivered, newest first, in three positions with overflow folded into one. The rule matches DSH's deliverables card and also counts files written from `run_code`.
24
+ - SSH: the panel lists hosts this conversation reached with their outcome, and the host aliases from `~/.ssh/config`. The model is told where the OpenSSH client is, which aliases exist, and the non-interactive rules (`BatchMode`, timeouts, stop on authentication failure, long work as a background job). Only names, addresses, users and ports are read, never keys.
25
+ - The preset name and description are language-neutral (`Deep PTC · PowerShell`); the mode picker and conversation header still show localized text. Safe mode publishes the host's reason.
26
+ - Safe mode starts only when a preset row actually fails; rows still waiting for a service no longer trigger it (#5). Changing settings or upstream declarations retries the full preset.
27
+ - Microsoft Store PowerShell 7 is discovered: the app execution alias is read with `lstat` and `readlink` instead of treating any access-denied path as present, and one install is listed once as "PowerShell 7 (Microsoft Store)" (#10).
28
+ - Lighter visual effects (#6): styles target DSH's stable attributes such as `data-composer-card` and `data-message-bubble` instead of measuring elements every frame; looping animations change only opacity or transforms; the spark canvas covers only the composer area at no more than 1.5 device pixels per CSS pixel and stops when idle or hidden; the active session is no longer polled. With an appearance plugin such as dsh-claude-style or dsh-refined-ui installed, effects start off, and an explicit choice is kept (#7).
29
+ - All keyboard shortcuts added by this plugin are removed: the Ctrl/Cmd+K palette (which collided with DSH's session search), `/`, Alt+Up/Down and Ctrl+Alt+D. Diagnostics move to the settings page.
30
+ - The persona adds "Follow the user's instructions" and "Work discipline": ask the user about an unfamiliar term first and research it only when they do not know; the user's statements outrank the model's prior beliefs; no silent change of approach; check off every part of a multi-part request; never report unverified results as verified.
31
+ - The preset identity layer is not installed when the host's `composedPreset` has an unexpected signature.
32
+
33
+ ## 1.8.8 — 2026-11-10
34
+
35
+ - 模式选择器、会话模式标签、设置页、侧栏和命令面板随 DSH 的语言设置切换中英文。切换语言会保留当前预设选择和未保存的表单输入。
36
+ - 第三方插件通过同一套两层规则识别预设。适配优先使用 `deep-ptc`,需要兼容时默认返回 `ptc` 别名。DSH 仍实际挂载 `deep-ptc`。探测现在覆盖 `dist`,忽略注释和无关比较,并在插件升级后刷新。
37
+ - 工具隔离要求错误消息明确标注 HTTP 状态。带 `ERR_MODULE_NOT_FOUND` 或 `MODULE_NOT_FOUND` 的模块加载失败会立即隔离,工具内部缺陷累计三次才隔离。
38
+ - PowerShell 等待检测识别真正的 `Start-Job` 和 `Start-ThreadJob` 脚本块,继续检查同一条命令里的前台等待。
39
+ - `ask_user_question` 要求正数超时。若宿主提问记录为空或结构不兼容,保留官方等待。结构不兼容时记录一次诊断。
40
+ - 映射执行器抽到独立模块,并合并宿主执行器的兼容性检查。
41
+
42
+ - The mode picker, conversation preset label, settings, sidebar, and command palette follow DSH's Chinese or English language setting. Switching languages preserves the selected preset and unsaved form input.
43
+ - Third-party plugins share a two-layer preset check. It prefers `deep-ptc` and defaults to the `ptc` alias when compatibility is needed. DSH still mounts `deep-ptc`. Detection covers `dist` packages, ignores comments and unrelated comparisons, and refreshes after plugin updates.
44
+ - Tool quarantine requires an explicit HTTP status in error text. Module load failures carrying `ERR_MODULE_NOT_FOUND` or `MODULE_NOT_FOUND` quarantine immediately. Defects inside a tool still require three consecutive failures.
45
+ - PowerShell wait detection recognises actual `Start-Job` and `Start-ThreadJob` script blocks and still checks foreground waits in the same command.
46
+ - `ask_user_question` requires a positive timeout. Empty or incompatible host question records preserve the official wait, and incompatible records are logged once.
47
+ - The mapped executor now lives in a standalone module with a shared check for the host executor interface.
48
+
3
49
  ## 1.8.7 — 2026-11-10
4
50
 
5
51
  - 在深度 PTC 侧栏加入界面特效开关。关闭后即时撤掉界面美化和动画,设置保存在当前客户端。使用外部主题或 UI 插件时建议关闭。
package/README.md CHANGED
@@ -1,16 +1,12 @@
1
1
  # Deep PTC mode
2
2
 
3
- [中文](README.zh.md) · MIT · **1.8.7**
3
+ [中文](README.zh.md) · MIT · **1.9.0**
4
4
 
5
- [1.7.3 实测汇总 / Test summary](TEST_REPORT.md)
6
- **Reports. Asks. Stays awake. Plans. Stays reachable.**
7
- **Five basics, one mode; everything is a plugin, with the official preset always as the fallback.**
5
+ [Changelog](CHANGELOG.md) · [Test report](TEST_REPORT.md)
8
6
 
9
- Deep PTC is not another tool bundle. It is a DeepSeek Harness agent preset built around five basic problems in model work: working silently without reporting, guessing instead of asking when intent is ambiguous, sleeping and becoming unreachable during a task, not planning or not showing the plan, and not using the original PTC preset's concise context plus its unlimited-token prompt.
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.
10
8
 
11
- Those five are handled first by prompts and code. On top of that, following DSH's “everything is a plugin” philosophy, the preset adds dynamic preset/tool loading, creative-mode tools for building DSH plugins, dsh-go screen-control adaptation, wider shell support, external plugin tool/workflow adaptation, and a leaner skill/tool loading flow. Deep PTC adds no task tools itself; it provides the interface that lets a plugin's new tools be discovered, loaded and called.
12
-
13
- Not every third-party plugin is guaranteed to fit: the interface is verified for dsh-ops and reused by other plugins, but a plugin still has to support the installed host and publish its tools under the expected contract.
9
+ 1.9.0 moves the panel into DSH's official entry points: a Deep PTC settings page, and a Deep PTC tab in the right sidebar (environment, subagents, background jobs, output files, SSH connections, tool state) that the capsule under the composer opens. Visual effects render lightly and start off when an appearance plugin is installed. The plugin adds no keyboard shortcuts.
14
10
 
15
11
  ## Five basic problems
16
12
 
@@ -40,11 +36,11 @@ Screen-control tools stay in the initial PTC SDK, are not moved on demand, and a
40
36
 
41
37
  WSL Bash, PowerShell (including discovered 5.1 and 7 executables), Zsh and native Bash are supported. The choice applies to this preset only and does not change the global shell; sandbox, approval and process management stay official. WSL currently requires the host-authorized `danger-full-access` mode.
42
38
 
43
- ### 5. External plugin tool/workflow adaptation (dsh-ops tested)
39
+ ### 5. External plugin tools and workflows
44
40
 
45
41
  This is the core interface: external plugins publish tools under their own contract; Deep PTC discovers them, loads them on demand, quarantines failures per conversation and falls back to official PTC. Extensions must support the installed host and publish into the `deep-ptc` scope; Deep PTC does not depend on any specific plugin or replace the executor.
46
42
 
47
- **dsh-ops is specifically tested.** Its gate recognises only `minimal/standard/ptc/cordis`. Deep PTC first offers the native `deep-ptc`; when it detects that the plugin restricts preset names, it returns the base id the plugin accepts — `ptc` (or `cordis` for a creative row) — while host internals keep the exact `deep-ptc`. dsh-ops therefore needs no change for its new tools to be discovered and called; other plugins use the same interface, judged by their own packages. Unattributed tools are not quarantined; only a positively attributed external provider can be, and official tools are never quarantined.
43
+ Third-party plugins that query `composedPreset` share the same compatibility rules. The tested dsh-ops package recognises only `minimal/standard/ptc/cordis`, so its query receives `ptc` in a session that DSH mounts as `deep-ptc`. Quarantine applies only to tools attributed to external providers.
48
44
 
49
45
  ### 6. Leaner skill and tool loading
50
46
 
@@ -52,7 +48,7 @@ Each turn ends with a skill context card that lists only the skills still loaded
52
48
 
53
49
  Search summaries first, then load full schemas: six entries per page by default (maximum eight), up to six schemas within a 16 KB budget per load, and up to twelve recent selections. Quarantine persists with the conversation: clear unavailability blocks immediately; temporary failures need three in a row and a success clears the count; wrong arguments, denial and normal business failures are not tool failures; one reset clears only the current conversation. Skills load in two stages: discovery reads metadata and invocation permission only; the official `skill` tool loads the body.
54
50
 
55
- Three steps: install the plugin → choose an environment under **Settings → Plugins → Deep PTC** → choose **深度PTC模式** in the mode picker for a new task.
51
+ Install the plugin, choose an environment under **Settings → Deep PTC**, and select **Deep PTC Mode** for a new conversation.
56
52
 
57
53
  ## Skill context card (1.8.5)
58
54
 
@@ -66,21 +62,29 @@ After each turn, a card at the end of that turn in the conversation (where offic
66
62
  - The card tracks skills loaded directly through the official `skill` tool and skills loaded by a PTC inner call inside `run_code`. The latter usually reach the program rather than the model context, so closing one only removes it from the card, not from program output. `/name` injections are not covered yet.
67
63
  - A switch leaves no command row in the conversation (the session log still records it); only a failed switch shows a short error line in place.
68
64
 
69
- ## Visual effects and side card
65
+ ## Panel, settings page and visual effects
66
+
67
+ The Deep PTC mode label, settings, and conversation UI switch between Chinese and English with DSH **Settings → General → Language**. Every entry point uses an official DSH extension point; the plugin changes no host layout and registers no keyboard shortcuts.
68
+
69
+ - **Settings → Deep PTC**: execution environment and shell, the visual effects switch, and copyable diagnostics to attach to interface bug reports.
70
+ - **The Deep PTC tab in the right sidebar** (also offered on the sidebar's new-tab guide). DSH docks, floats, splits and expands it like its own tabs.
71
+ - **Execution environment**: WSL, PowerShell, native Bash or Zsh, for newly created Deep PTC sessions.
72
+ - **Subagents**: name, state, duration and tokens; a row opens that subagent's chat in the official right sidebar.
73
+ - **Background jobs**: six positions, up to five active jobs first and up to three finished jobs; overflow folds into one expandable row.
74
+ - **Output files**: files this conversation wrote or delivered, newest first, in three positions; overflow folds into one of them. The rule matches DSH's own deliverables card and also counts files written from `run_code`.
75
+ - **SSH connections**: hosts this conversation reached, with their outcome, and the host aliases in `~/.ssh/config`.
76
+ - **Tool state**: the "Reload all tool states" button and, when present, the failed external tools.
77
+ - **The capsule under the composer** shows the environment, subagent count and tool notices, and opens the tab. On a host without a right sidebar it opens the panel in place. It lives in the composer's own dock, so it never covers messages and is covered with the conversation when the sidebar goes fullscreen.
78
+
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
+
81
+ - 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
+ - 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.
83
+ - Everything honours reduced motion.
70
84
 
71
- The look from dsh-refined-ui is part of this plugin and applies **only while the conversation on screen is a Deep PTC session**; other modes and the new-session page keep the official look.
85
+ ## SSH
72
86
 
73
- - Calmer light and dark neutrals, a Chinese-first font stack, slim scrollbars, a floating composer card with a flowing blue hairline on focus, a blue gradient send button, soft blue user bubbles, roomier assistant text, and a blue wash on hovered and selected sidebar rows.
74
- - Interactions: Ctrl/Cmd+K command palette (sessions, new session, plugins, automations), pointer spotlight, click ripple, magnetic send button, `/` to focus the composer, Alt+Up/Down to switch sessions, Ctrl+Alt+D diagnostics.
75
- - Motion: while the conversation runs, the composer turns blue and breathes (also while focused), with a send-button ring and a steady stream of sparks rising above it; sparks on send and completion. Everything honours reduced motion.
76
- - Each Deep PTC conversation has a **side card** on the right.
77
- - **Execution environment** offers WSL, PowerShell, native Bash, or Zsh depending on the host. It writes the same host settings as the settings page and applies to newly created Deep PTC sessions.
78
- - **Visual effects** toggles styling and animations immediately and saves the preference in the current client. Keep it off when using an external theme or UI plugin.
79
- - **Subagents**, when there are any: name, state, duration and tokens from the official subagent catalog and timing data; a row opens that subagent's chat in the official right sidebar.
80
- - **Background jobs** shows the current conversation's active and finished jobs. The card has six positions by default, with up to five active jobs first and up to three finished jobs. An expandable row uses one position and shows how many jobs it contains.
81
- - **Tool state**: the “Reload all tool states” button and, when present, the failed external tools.
82
- The column uses the host's background with light grey dividers, blue only for the selected option, button outlines and status squares, and the host's usual black and grey text; for a running subagent only its small status square flashes blue. In a narrow conversation the card folds into a small pill, whose status square flashes the same way. It can be collapsed, and that choice is kept on this machine.
83
- - While the standalone dsh-refined-ui is still running, this plugin does not draw the same look a second time.
87
+ Deep PTC reaches external hosts through the local OpenSSH client in the selected environment's shell; it adds no transport of its own. The model is told where the client is, which host aliases `~/.ssh/config` defines (names, addresses, users and ports only, never keys), and how to use them: always non-interactive (`BatchMode=yes`, a connect timeout), no interactive remote shell, never waiting for a password or host-key prompt; on an authentication failure it stops and tells you instead of trying other credentials or disabling host-key checking; long remote work runs as a background job. In WSL, SSH runs inside the distribution with its own `~/.ssh`.
84
88
 
85
89
  ## 1.7.2: lightweight, on-demand tool orchestration
86
90
 
@@ -90,7 +94,7 @@ One tool/skill directory, `deep_ptc_tools`, coordinates discovery. Task operatio
90
94
  - **Quarantine what is actually broken.** A tool that is clearly unavailable (a missing module or API, or a declared unavailable state) is quarantined at once; temporary and unexplained failures need three in a row, and a success clears the count. Wrong arguments or paths, denial, cancellation and normal results describing their own subject (such as a failed build) are not tool failures. Official tools are never quarantined, including those in the profile's root composition (such as `lsp` and `terminal_*`). After quarantine, execution is blocked in code and state persists with the session. Agent recreation, conversation restore and provider reload do not lift quarantine. Capture provenance and reset generation before dispatch; late pre-reset results cannot contaminate the new state. Empty results, normal pagination and ordinary nonzero command exits are not failures either.
91
95
  - **Finish the task; do not diagnose failed providers.** Correct wrong input and retry a temporary failure at most twice. Once a tool is quarantined, move promptly to a working equivalent or official fallback, with no probing, retrying or root-cause investigation. Read back only the task state necessary to avoid duplicate effects after a potentially partial mutation.
92
96
  - **Brief completion reporting.** The model lists failed tools and declared provider names at completion. The runtime also projects an expandable compatibility notice after a turn ends. Unknown ownership is reported as unknown, never inferred from a tool name.
93
- - **Reload from the side card.** “Reload all tool states” clears quarantine and on-demand selections for the current conversation without a model call or stopping running jobs. The user slash command `/deep-ptc-reset-tools` provides the same action. The tool state and this command are registered at the plugin root, like the skill card, so they work in an idle conversation too.
97
+ - **One-click reload.** “Reload all tool states” clears quarantine and on-demand selections for the current conversation without a model call or stopping running jobs. The user slash command `/deep-ptc-reset-tools` provides the same action. The tool state and this command are registered at the plugin root, like the skill card, so they work in an idle conversation too.
94
98
  - **Two-stage skill use.** Search the host's resolved, model-invocable skill metadata, then load the exact name with the official `skill` tool and follow its full instructions. Reuse instructions already in context. Discovery never reads skill bodies.
95
99
 
96
100
  ```js
@@ -130,7 +134,7 @@ These rules apply only to Deep PTC sessions. They rely on the desktop "busy Ente
130
134
 
131
135
  ## Choose an execution environment
132
136
 
133
- Open **Settings → Plugins → Deep PTC**, choose an environment, save, and create a new **深度PTC模式** session.
137
+ Open **Settings → Deep PTC**, choose an environment, save, and create a new **Deep PTC Mode** session.
134
138
 
135
139
  | Selection | Host | Executor / tool |
136
140
  | --- | --- | --- |
@@ -169,20 +173,20 @@ External plugins are discovered from what they actually register. Tools and work
169
173
 
170
174
  - Screen-control tools remain in the initial PTC SDK. They are not folded into the on-demand catalog and they are not quarantined after a failure. A tool qualifies when it sets `resident` (or `deepPtc.resident`), when its presentation carries the `dsh-go/view` key, when its name is `intent`, `collect`, `tap_xy`, or starts with `screen_`, or when its provider is marked as dsh-go, screen control, computer use, or phone control. Any other plugin can use the same `resident` flag. Ordinary extensions stay on demand.
171
175
  - Deep PTC does not declare dsh-go's own slots and does not replace its settings. Those forms still come from the Cordis schema, so the app renders them itself.
172
- - The side card reads its own state first. If a projection is missing or the session belongs to another preset, that part is left out; a failure in the card leaves the conversation, the input row and the screen-control chrome in place.
176
+ - The panel reads its own state first. If a projection is missing or the session belongs to another preset, that part is left out; a failure in the panel leaves the conversation, the input row and the screen-control chrome in place.
173
177
 
174
178
  Phone screen control was not clicked on a device for this release. The guarantee above is the SDK membership, the quarantine rule, and the composer failure path.
175
179
 
176
180
  ## 1.8.0: session-scoped preset identity
177
181
 
178
- External plugins often treat an agent-preset id as a capability switch (dsh-ops recognises only minimal/standard/ptc/cordis). Deep PTC registers `deep-ptc`. 1.8.0 makes two attempts inside the plugin:
182
+ External plugins often use the preset ID to enable capabilities. The adapter runs only for sessions using Deep PTC. DSH mounts `deep-ptc` and records that preset ID on the session. A plugin such as dsh-ops that relies on official preset IDs receives `ptc` when it queries `composedPreset`.
179
183
 
180
184
  - **Layer 1 (native)**: an external plugin that does not limit preset names receives `deep-ptc` and works as-is; a plugin that explicitly declares support for `deep-ptc` also receives the native id.
181
- - **Layer 2 (base)**: a plugin that limits preset names and does not list `deep-ptc` receives `ptc`. For an allowlist that includes `ptc` (dsh-ops), this layer is guaranteed; if the list does not contain `ptc` either, neither attempt matches (such a plugin does not support PTC at all).
185
+ - **Layer 2 (compatibility alias)** returns `ptc` by default when the caller's gate requires an official preset ID. The alias applies to that query.
182
186
  - Host calls that must stay exact (subagent child headers, scheduled session creation, the registry itself) always receive `deep-ptc`, so inheritance and scheduling are unaffected.
183
187
  - A normal PTC session already returns `ptc`; every other preset is returned unchanged. The official PTC preset is not replaced, and DSH is not modified.
184
188
  - Creative mode and the plugin lab: loading reads the host roster and documents only, never `composedPreset`. A creative row mounted into a Deep PTC session that accepts only `cordis` gets `cordis`; a normal creative session is unchanged.
185
- - Both attempts are decided before returning: the host provides no rejection callback, so the layer inspects the calling plugin's own package to see whether it limits preset names. No limit keeps the native id; a limit falls back immediately. Settings: `presetCompat`, `presetFallback`, `presetSupport`.
189
+ - `composedPreset` returns one ID per call. The adapter selects a layer from the caller's package or explicit settings before returning. The host exposes no callback for the caller's validation result. The settings are `presetCompat`, `presetFallback` and `presetSupport`.
186
190
 
187
191
  Limitation: this wraps the host's `agentPresets.composedPreset` instance and depends on its internal signature, so re-check after a DSH upgrade. The per-package probe is heuristic; dynamically assembled ids may not be recognised.
188
192
 
@@ -202,10 +206,10 @@ A prompt changes the model's working tendency, not the real token limit or billi
202
206
  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.
203
207
 
204
208
  ```js
205
- plugin_manager({ action: "install_bundle", target: "dsh-deep-ptc-mode@1.8.7" })
209
+ plugin_manager({ action: "install_bundle", target: "dsh-deep-ptc-mode@1.9.0" })
206
210
  // Or from a local checkout or archive:
207
211
  plugin_manager({ action: "install_bundle", target: "C:\\path\\to\\dsh-deep-ptc-mode" })
208
- // Or target: "C:\\path\\to\\dsh-deep-ptc-mode-1.8.5.tgz"
212
+ // Or target: "C:\\path\\to\\dsh-deep-ptc-mode-1.9.0.tgz"
209
213
  ```
210
214
 
211
215
  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,16 +1,12 @@
1
1
  # 深度 PTC 模式
2
2
 
3
- [English](README.md) · MIT · 当前版本 **1.8.7**
3
+ [English](README.md) · MIT · 当前版本 **1.9.0**
4
4
 
5
- [1.7.3 实测汇总 / Test summary](TEST_REPORT.md)
6
- **会汇报,先提问,不休眠,有计划,能插话。**
7
- **五个基本问题,一套模式;一切皆插件,官方始终兜底。**
5
+ [更新日志](CHANGELOG.md) · [测试报告](TEST_REPORT.md)
8
6
 
9
- 深度 PTC 不是又一个工具包,而是针对模型执行任务时五个基本问题设计的 DeepSeek Harness Agent 模式:闷头干活不汇报、有歧义先猜不问、跑起来就休眠失联、不做计划或计划不可见、以及没有用好原 PTC 的简洁上下文与 unlimited token 提示词。
7
+ 深度 PTC 是 DeepSeek Harness 的 Agent 模式,支持进度汇报、澄清提问、按任务规模制定计划,以及可插话的后台任务。它以已安装的官方 PTC 预设为基础,提供可选执行环境、按需加载工具和 Skill,以及面向第三方插件的两层预设身份适配。
10
8
 
11
- 这五个问题先由提示词和代码一起解决;在此基础上,再按官方“一切皆插件”的理念,把预设与工具动态读取、创造模式、dsh-go 界面控制、多 shell 环境、外部插件工具/工作流适配、Skill 与工具读取流程逐项接进来。深度 PTC 本身不提供新的任务工具,它提供的是让外部插件的新工具能被识别、加载、调用的那层接口。
12
-
13
- 不承诺适配所有第三方插件:接口对已测试场景(dsh-ops)负责,其他插件走同一接口,具体仍取决于插件自身是否支持当前宿主、是否按契约发布工具。
9
+ 1.9.0 把面板移进 DSH 官方入口:设置里有独立的「深度 PTC」页,右侧栏有「深度 PTC」页签(执行环境、子代理、后台任务、输出文件、SSH 连接、工具状态),输入框下方的小胶囊打开它。界面特效改为轻量渲染,检测到外观插件时默认关闭。不再添加任何快捷键。
14
10
 
15
11
  ## 五个基本问题
16
12
 
@@ -40,11 +36,11 @@
40
36
 
41
37
  支持 WSL Bash、PowerShell(含 5.1 与 7 的可执行文件选择)、Zsh、原生 Bash。只对本模式生效,不改全局 shell;沙箱、审批和进程管理仍用官方实现。WSL 目前仅支持宿主已授权的 `danger-full-access`。
42
38
 
43
- ### 5. 增强外部插件工具/工作流的适配(dsh-ops 已专测)
39
+ ### 5. 外部插件工具与工作流
44
40
 
45
41
  这是深度 PTC 的核心接口:外部插件按自己的契约发布工具,深度 PTC 负责发现、按需加载、隔离故障,并在失败时回到官方 PTC。外部插件需支持当前宿主,并在 `deep-ptc` 作用域中发布工具;深度 PTC 不把任何插件写成依赖,也不替换执行器。
46
42
 
47
- **dsh-ops 专门测试**:它在工具门控里只认 `minimal/standard/ptc/cordis`;深度 PTC 先给原生 `deep-ptc`,识别到它限制预设名后,按它实际接受的基座 id 返回 `ptc`(创造模式行可用 `cordis`);宿主内部仍保持精确 `deep-ptc`。结果是 dsh-ops 不需要改造,它的新工具就能在深度 PTC 会话里被识别和调用;其他外部插件走同一接口,按包内容判断。未归属工具不隔离;只有能明确归属的外部提供者才可能被隔离;官方工具永不禁用。
43
+ 通过 `composedPreset` 查询预设的第三方插件使用同一套兼容规则。以实测的 dsh-ops 为例,它只认 `minimal/standard/ptc/cordis`,所以在深度 PTC 会话里收到兼容 ID `ptc`,宿主实际挂载的仍是 `deep-ptc`。只有能明确归属的外部工具才会进入故障隔离。
48
44
 
49
45
  ### 6. Skill 与工具的读取流程优化
50
46
 
@@ -52,7 +48,7 @@
52
48
 
53
49
  先搜摘要,再加载完整 schema:默认每页 6 项、最多 8 项;完整 schema 每次最多 6 个、总预算 16 KB;最多保留 12 个近期选择。故障按对话隔离:明确不可用立即禁用;临时错误连续 3 次才禁用,成功一次清零;参数错误、权限拒绝、业务失败不算故障;一键重载只清当前对话。Skill 两阶段:目录只查元数据与权限,正文交给官方 `skill` 工具,检索不读正文。
54
50
 
55
- 使用三步:安装插件 → 在 **设置 → 插件 → 深度 PTC** 里选执行环境 → 新建任务时在模式选择器里选「深度PTC模式」。
51
+ 安装插件,在 **设置 → 深度 PTC** 选择执行环境,然后新建会话并选择 **深度 PTC 模式**。
56
52
 
57
53
  ## Skill 上下文卡片(1.8.5)
58
54
 
@@ -66,21 +62,29 @@
66
62
  - 卡片会跟踪官方 `skill` 工具直接加载,以及 `run_code` 内 PTC 子调用加载的 Skill;后者通常只进入程序而非模型上下文,关闭时只从卡片移除,不重写程序输出。`/name` 注入暂不纳入。
67
63
  - 切换开关不会在对话里留下命令回显(会话日志仍记录这次操作);只有切换失败时,原位显示一行错误。
68
64
 
69
- ## 界面特效与侧边卡片
65
+ ## 面板、设置页与界面特效
70
66
 
71
- dsh-refined-ui 的界面精修并入本插件,**只在当前显示的是深度PTC会话时生效**,切到其他模式或新会话页时恢复官方原样:
67
+ Deep PTC 的模式名称、设置页和会话界面会随 DSH「设置 → 通用 → 语言」在中文和英文之间切换。所有入口都使用 DSH 的官方扩展点,不改宿主布局,也不注册快捷键。
72
68
 
73
- - 明暗两套更克制的中性色、中文优先字体、细滚动条;悬浮的输入框卡片,聚焦时出现流动的蓝色细线;蓝色渐变发送键;淡蓝渐变的用户气泡;更宽松的助手正文;侧栏悬停与选中的蓝色底。
74
- - 交互:Ctrl/⌘+K 命令面板(跳转会话、新会话、插件、自动化任务)、指针追光、点击涟漪、磁吸发送键、`/` 聚焦输入框、Alt+↑/↓ 切换会话、Ctrl+Alt+D 诊断。
75
- - 动效:对话运行时输入框边框转蓝并呼吸发光(聚焦时也不例外),发送键光环,输入框上方持续冒出光点,发送与完成时的光点;全部遵循系统的“减少动态效果”。
76
- - 深度 PTC 会话在对话区右侧显示**侧边卡片**。
77
- - **执行环境**可选择 WSL、PowerShell、原生 Bash 或 Zsh,选项取决于宿主系统。和设置页写同一份宿主设置,对之后新建的深度 PTC 会话生效。
78
- - **界面特效**开关即时关闭界面美化与动画,选择保存在当前客户端。使用外部主题或 UI 插件时,建议关闭。
79
- - **子代理**(有子代理时才出现):名称、状态、用时和 token,按官方子代理目录与计时数据计算;点击一行在官方右侧栏打开该子代理的对话。
80
- - **后台任务**显示当前会话的运行和结束状态。默认最多六个位置,运行中优先且最多五条,已结束最多三条。超出部分合为一条可展开的记录,显示隐藏任务数量。
69
+ - **设置 → 深度 PTC**:执行环境与 Shell、界面特效开关,以及可复制的诊断信息(反馈界面问题时附上)。
70
+ - **右侧栏「深度 PTC」页签**(也在右侧栏的新建页签引导中):停靠、浮动、分屏、全屏都由 DSH 管理。
71
+ - **执行环境**:WSL、PowerShell、原生 Bash 或 Zsh,对之后新建的深度 PTC 会话生效。
72
+ - **子代理**:名称、状态、用时和 token;点击在官方右侧栏打开该子代理的对话。
73
+ - **后台任务**:最多六个位置,运行中优先且最多五条,已结束最多三条,超出部分合为一条可展开记录。
74
+ - **输出文件**:本会话写入或交付的文件,最新的在前;最多三个位置,超出时折叠占一个位置。规则与 DSH 官方的交付卡片一致,并包括 `run_code` 里写入的文件。
75
+ - **SSH 连接**:本会话连接过的主机(成功或失败)与 `~/.ssh/config` 中的主机别名。
81
76
  - **工具状态**:“重载所有工具状态”按钮,以及调用失败的外部工具(如有)。
82
- 侧栏为白底,浅灰色分割线,蓝色只用于选中项、按钮描边和状态小方块,文字与其他地方一样用黑色和灰色;运行中的子代理只有行首的状态小方块闪烁蓝光。对话区较窄时收成右上角的小胶囊,小方块同样会闪;卡片可收起,选择记在本机。
83
- - 独立的 dsh-refined-ui 仍在运行时,本插件检测到它就不再重复绘制这一套样式。
77
+ - **输入框下方的小胶囊**:显示执行环境、子代理数和工具提醒,点击打开右侧栏页签;没有右侧栏的宿主在原地展开面板。它在输入区自己的停靠位里,不会遮挡消息,侧栏全屏时随对话一起被遮住。
78
+
79
+ 界面特效**只在当前显示的是深度 PTC 会话时生效**:更克制的明暗配色与字体、输入框聚焦细线、蓝色渐变发送键、淡蓝用户气泡、指针追光、点击涟漪、磁吸发送键;运行时输入框发光、发送键光环和输入框上方的光点。
80
+
81
+ - 轻量渲染:特效样式直接作用于 DSH 自带的稳定属性,不再逐帧计算元素样式;循环动画只改变透明度或位移;光点画布只覆盖输入框附近,像素密度上限 1.5,无动画或窗口隐藏时停止绘制。
82
+ - 检测到 dsh-claude-style、dsh-refined-ui 等外观插件时默认关闭特效;你手动打开后保留你的选择。dsh-refined-ui 运行时始终不重复绘制。
83
+ - 全部遵循系统的“减少动态效果”。
84
+
85
+ ## SSH
86
+
87
+ 深度 PTC 通过当前执行环境的 Shell 调用本机 OpenSSH 客户端连接外部主机,不另建传输。模型会收到本机客户端位置、`~/.ssh/config` 里的主机别名(只读取名称、地址、用户和端口,不读取密钥),以及使用规则:始终非交互(`BatchMode=yes`、连接超时),不打开交互式远程 Shell,不等待密码或主机密钥确认;认证失败时停下来告诉你,不换凭据、不关闭主机密钥校验;长时间远程任务转为后台任务。WSL 环境中 SSH 在发行版内运行,使用发行版自己的 `~/.ssh`。
84
88
 
85
89
  ## 1.7.2:轻量、按需、可恢复的工具调用层
86
90
 
@@ -90,7 +94,7 @@ dsh-refined-ui 的界面精修并入本插件,**只在当前显示的是深度
90
94
  - **确认损坏才禁用。** 工具明确不可用(如模块缺失、接口不存在、声明不可用)时立即禁用;临时错误和原因不明的失败连续 3 次才禁用,中间成功一次就清零。参数错误、路径错误、权限拒绝、取消,以及工具正常返回的业务结果(如“构建失败”)都不算工具故障。官方工具不参与禁用,包括配置根层的官方工具(如 `lsp`、`terminal_*`)。禁用后由程序拦截后续调用,故障记录随对话保存;切换 agent、恢复对话或重载插件不会自动解除。调用开始时捕获来源和状态代次,用户重载前的迟到结果不会污染新状态。普通空结果、分页续读和命令非零退出同样不算故障。
91
95
  - **任务优先,不查坏工具。** 输入有误就改正,临时错误最多重试两次;工具一旦被禁用,就尽快改用其他可用同类工具或官方工具,不再探测、重试或查根因。仅在写入或命令可能已部分完成时核查必要的任务状态,避免重复操作。
92
96
  - **完成时简报。** 模型结束任务时简短列出失败工具与已声明的插件来源;程序同时在回合结束后生成可展开的“工具适配提醒”。来源不明就列工具名,不猜插件身份或故障原因。
93
- - **侧边卡片一键重载。** “重载所有工具状态”仅清除当前对话的故障标记与按需加载选择;不调用模型,也不停止正在运行的任务。另有用户命令 `/deep-ptc-reset-tools`。工具状态和这条命令与 Skill 卡片一样在插件根部注册,闲置的会话里也能用。
97
+ - **一键重载。** “重载所有工具状态”仅清除当前对话的故障标记与按需加载选择;不调用模型,也不停止正在运行的任务。另有用户命令 `/deep-ptc-reset-tools`。工具状态和这条命令与 Skill 卡片一样在插件根部注册,闲置的会话里也能用。
94
98
  - **Skill 两阶段调用。** 目录只查询宿主已解析的技能元数据和调用权限;选中后使用官方 `skill` 工具加载正文并遵守完整指令,复用上下文中已有指令。检索不读取 Skill 正文。
95
99
 
96
100
  ```js
@@ -130,7 +134,7 @@ const skills = await tools.deep_ptc_tools({ action: 'skills', query: 'build test
130
134
 
131
135
  ## 选择 WSL、PowerShell 或 macOS 工具
132
136
 
133
- 安装并加载后,打开 **设置 → 插件 → 深度 PTC**,选择执行环境并保存,再新建一个「深度PTC模式」会话。
137
+ 安装并加载后,打开 **设置 → 深度 PTC**,选择执行环境并保存,再新建一个 **深度 PTC 模式**会话。
134
138
 
135
139
  | 选项 | 宿主 | 实际执行方式 / 模型工具 |
136
140
  | --- | --- | --- |
@@ -171,20 +175,20 @@ WSL 命令使用 Linux/POSIX 语法;文件工具和 `workdir` 仍用 Windows
171
175
 
172
176
  - 屏幕控制工具留在初始 PTC SDK 里,不收进按需目录,失败后也不隔离。满足下面任一条件即可:工具自己标了 `resident`(或 `deepPtc.resident`);展示信息带有 `dsh-go/view`;名称是 `intent`、`collect`、`tap_xy`,或以 `screen_` 开头;提供者标记为 dsh-go、屏幕控制、computer use 或手机控制。其他插件也可以用同一个 `resident` 标记把自己留在初始列表。普通扩展仍按需加载。
173
177
  - 深度 PTC 不声明 dsh-go 自己的槽位,也不替换它的设置表单。表单仍来自 Cordis schema,由应用自己渲染。
174
- - 侧边卡片先读自己的状态。投影缺失或会话不属于本预设时,对应部分不显示;卡片出错不会拆掉对话、输入区和屏幕控制界面。
178
+ - 面板先读自己的状态。投影缺失或会话不属于本预设时,对应部分不显示;面板出错不会拆掉对话、输入区和屏幕控制界面。
175
179
 
176
180
  本版没有在真机上点过手机屏幕控制。上面保证的是 SDK 成员资格、隔离规则,以及界面投影失败时的退让。
177
181
 
178
182
  ## 1.8.0:会话级 preset 身份兼容
179
183
 
180
- 外部插件常把 agent preset id 当能力开关(例如 dsh-ops 只认 minimal/standard/ptc/cordis)。深度 PTC 注册的 id 是 `deep-ptc`。1.8.0 在插件内部做两次尝试:
184
+ 外部插件常用预设 ID 判断是否启用能力。只有用户选择深度 PTC 的会话会做这层适配。DSH 挂载 `deep-ptc`,并将这个预设 ID 写入会话记录。像 dsh-ops 这样依赖官方 ID 的插件通过 `composedPreset` 查询时会收到 `ptc`。
181
185
 
182
186
  - **第一层(原生)**:不限制预设名称的外部插件拿 `deep-ptc`,直接可用;显式声明支持 `deep-ptc` 的插件也拿原生。
183
- - **第二层(基座)**:限制预设名称、且列表里没有 `deep-ptc` 的插件拿 `ptc`。对 dsh-ops 这类包含 `ptc` 的列表,这一层必定通过;如果列表连 `ptc` 都没有,两层都不匹配(它本来也不支持 PTC)。
187
+ - **第二层(兼容别名)**:调用方规则要求官方预设 ID 时,默认返回 `ptc`。别名只用于这次身份查询。
184
188
  - 宿主内部必须精确的调用(子代理 header、定时任务、注册表自身)始终拿 `deep-ptc`,不影响继承和调度。
185
189
  - 普通 PTC 会话本来就返回 `ptc`,其他预设原样返回;官方 PTC 预设没有被替换,也没有改 DSH。
186
190
  - 创造模式/插件实验台:加载只读宿主的预设清单和文档,不调用 `composedPreset`;实验台挂进深 PTC 会话的创造模式行若只认 `cordis`,第二层就返回 `cordis`,普通创造模式会话仍原样。
187
- - 两次尝试都在返回之前决定:宿主不会在插件拒绝时回调,所以读取调用方插件自己的包,判断它是否限制预设名称;不限制就给原生,限制就立即给基座。设置里可用 `presetCompat`、`presetFallback`、`presetSupport` 调整。
191
+ - `composedPreset` 每次只返回一个 ID。兼容层根据调用方的包内容或显式配置,在返回前决定用哪一层。宿主没有提供校验结果回调。设置里可用 `presetCompat`、`presetFallback`、`presetSupport` 调整。
188
192
 
189
193
  局限:这是对 `agentPresets.composedPreset` 的实例包装,依赖宿主内部方法签名;DSH 升级后需要复核。按包内容探测是启发式的,插件如果在代码里用动态拼接的 id,可能识别不到。
190
194
 
@@ -206,10 +210,10 @@ WSL 命令使用 Linux/POSIX 语法;文件工具和 `workdir` 仍用 Windows
206
210
  本地目录或构建产物可通过插件管理器安装:
207
211
 
208
212
  ```js
209
- plugin_manager({ action: "install_bundle", target: "dsh-deep-ptc-mode@1.8.7" })
213
+ plugin_manager({ action: "install_bundle", target: "dsh-deep-ptc-mode@1.9.0" })
210
214
  // 也可从本地目录或安装包安装:
211
215
  plugin_manager({ action: "install_bundle", target: "C:\\path\\to\\dsh-deep-ptc-mode" })
212
- // 或 target: "C:\\path\\to\\dsh-deep-ptc-mode-1.8.5.tgz"
216
+ // 或 target: "C:\\path\\to\\dsh-deep-ptc-mode-1.9.0.tgz"
213
217
  ```
214
218
 
215
219
  GitHub 地址:`github:lishize20040802-rgb/dsh-deep-ptc-mode`。该地址安装远端实际内容;本地升级不会自动发布到 GitHub/npm。
@@ -258,7 +262,7 @@ npm pack
258
262
  - `cordis.patch.yml`:宿主设置入口。
259
263
  - `lib/index.mjs`:配置 schema、preset 注册和版本切换。
260
264
  - `lib/model.mjs`:平台选择、参数、隔离配置和环境说明,以及从官方声明派生 preset。
261
- - `lib/executor.mjs`:继承基础部署声明里的官方 bash 执行器,实现 WSL/Zsh。
265
+ - `lib/executor.mjs`:继承基础部署声明里的官方 bash 执行器,实现 WSL/Zsh(执行器类在 `lib/mapped-shell.mjs`)。
262
266
  - `lib/terminal.mjs`:运行官方声明指定的 shell 工具,等待可被用户消息打断,并提供 Zsh 方言与工具名。
263
267
  - `lib/jobs-tool.mjs`、`lib/ask-user.mjs`:运行官方声明指定的 job 工具与提问工具,等待可被用户消息打断。
264
268
  - `lib/host.mjs`:通过已安装运行时解析这些官方模块。
package/TEST_REPORT.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # 1.7.3 实测汇总 / Test summary
2
2
 
3
+ > 1.9.0 在 Windows 和 Node 24 上通过 191 项自动化测试,新增输出文件与 SSH 记录、应用商店 PowerShell 识别、安全模式判定、右侧栏页签和设置页。另在隔离的测试 profile 中启动 DSH 0.2.2-rc.1 Web 界面实测:设置左导航只有一个「Agent 预设」并新增「深度 PTC」页;模式选择器显示本地化名称与当前环境;右侧栏引导页列出「深度 PTC」,页签内容完整;胶囊位于输入区停靠位,点击可展开已收起的右侧栏;右侧栏全屏时胶囊被遮住,不再悬浮;客户端无本插件报错。未在测试中发送消息,因此输出文件与 SSH 记录的实际写入只由自动化测试覆盖。下方保留 1.7.3 的桌面实测记录。
4
+ > Version 1.9.0 passes 191 automated tests on Windows and Node 24, adding output-file and SSH activity, Microsoft Store PowerShell discovery, safe-mode diagnosis, the right sidebar tab and the settings page. A DSH 0.2.2-rc.1 Web UI run in an isolated test profile confirmed one Agent presets entry plus the new Deep PTC page in settings, the localized preset label with its environment, the Deep PTC tab on the right sidebar guide with complete content, the capsule in the composer dock opening a collapsed sidebar, the capsule covered rather than floating over a fullscreen sidebar, and no client errors from this plugin. No message was sent, so recorded outputs and SSH activity are covered by automated tests only. The desktop audits below document 1.7.3.
5
+
3
6
  日期 / Date: 2026-11-05。测试宿主:Windows 桌面 DSH 0.2.2-rc.1 + WSL Ubuntu、Node 24。此版本是测试样本,运行时不据此固定工具清单。
4
7
 
5
8
  ## 中文
package/lib/ask-user.mjs CHANGED
@@ -16,7 +16,12 @@ export const Config = z.object({
16
16
  // and a message the user writes instead ends the wait early.
17
17
  export async function apply(ctx, config) {
18
18
  const watch = steeringWatch(ctx);
19
+ let warned = false;
20
+ const reshaped = () => {
21
+ if (!warned) ctx.logger.warn('Deep PTC: the question service changed shape; a question the user writes past now waits out its timeout');
22
+ warned = true;
23
+ };
19
24
  await applyOfficial(ctx, config.upstream, config.options, child => adaptContext(child, {
20
- userQuestions: questions => steerableQuestions(questions, watch),
25
+ userQuestions: questions => steerableQuestions(questions, watch, reshaped),
21
26
  }), config.overrides);
22
27
  }