@xiaoso/dsh-tool-plus 0.1.9-beta.1 → 0.1.10-beta.1

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.
Files changed (40) hide show
  1. package/README.en.md +19 -12
  2. package/README.md +19 -12
  3. package/THIRD_PARTY_NOTICES.md +36 -0
  4. package/lib/client.js +272 -181
  5. package/lib/index.mjs +875 -1081
  6. package/lib/{scrapers-B0PjR6_U.mjs → scrapers-DODCPcZW.mjs} +1 -1
  7. package/lib/types/client/BashPlusCard.d.ts +6 -6
  8. package/lib/types/client/ToolPlusSection.d.ts +3 -3
  9. package/lib/types/client/forms.d.ts +6 -6
  10. package/lib/types/client/index.d.ts +25 -12
  11. package/lib/types/client/locales.d.ts +1 -1
  12. package/lib/types/client/preset-panel.d.ts +54 -42
  13. package/lib/types/config/settings.d.ts +202 -21
  14. package/lib/types/host/browser-probe-rpc.d.ts +2 -1
  15. package/lib/types/host/preset-host.d.ts +103 -0
  16. package/lib/types/host/preset-rpc.d.ts +37 -72
  17. package/lib/types/presets/compare.d.ts +14 -37
  18. package/lib/types/presets/conflicts.d.ts +59 -0
  19. package/lib/types/presets/delta.d.ts +23 -18
  20. package/lib/types/presets/plan.d.ts +55 -0
  21. package/lib/types/presets/rows.d.ts +84 -0
  22. package/lib/types/presets/status.d.ts +56 -47
  23. package/lib/types/tools/bash/background.d.ts +20 -5
  24. package/lib/types/tools/bash/streaming-output.d.ts +4 -2
  25. package/lib/types/tools/shared/browser-rpc-channel.d.ts +84 -42
  26. package/lib/types/web/client/labels.d.ts +1 -1
  27. package/lib/types/web/client/row-utils.d.ts +26 -1
  28. package/lib/{utils-BdV3c7K5.mjs → utils-D80w8vry.mjs} +1 -1
  29. package/package.json +61 -46
  30. package/presets/tool-plus-ptc.patch.yml +164 -0
  31. package/presets/tool-plus-standard.patch.yml +158 -0
  32. package/lib/types/presets/install.d.ts +0 -44
  33. package/lib/types/presets/paths.d.ts +0 -41
  34. package/lib/types/presets/rewrite.d.ts +0 -86
  35. package/presets/install-presets.mjs +0 -143
  36. package/presets/package.json +0 -42
  37. package/presets/tool-plus-ptc/agent.cordis.yml +0 -284
  38. package/presets/tool-plus-ptc/preset.yml +0 -3
  39. package/presets/tool-plus-standard/agent.cordis.yml +0 -269
  40. package/presets/tool-plus-standard/preset.yml +0 -3
package/README.en.md CHANGED
@@ -18,7 +18,7 @@ Essential tools enhancement for DeepSeek Harness: persistent bash, structured re
18
18
  - **edit**: `replace` by default, with patch / hashline / apply-patch formats also supported; multi-hunk edits, uniqueness validation, fuzzy matching tolerant of whitespace differences
19
19
  - **grep / glob**: full-text search and filename matching; mtime sorting, context lines, and configurable ignore rules
20
20
  - **ast_grep / ast_edit** (optional): syntax-tree based structural code search and rewrite, enabled in settings
21
- - **agent presets**: two companion templates — Standard enhanced and PTC (Code Mode) — **installed automatically with the plugin** (written on first start when missing)
21
+ - **agent presets**: two companion templates — Standard enhanced and PTC (Code Mode)
22
22
 
23
23
  Settings panel (Bash tab):
24
24
 
@@ -30,10 +30,7 @@ Settings panel (Bash tab):
30
30
 
31
31
  ## Installation
32
32
 
33
- Installing this one plugin is enough:
34
-
35
- - **Tool plugin**: provides the full toolset and takes over the official bash / pwsh / file / search tools;
36
- - **Agent presets**: the official presets contain no configuration for these tools, so the stock setup is missing capabilities — the Standard / PTC templates exist to fill exactly that gap. **Both templates ship with the plugin and are written automatically on first start if they are not present yet**, so there is nothing extra to install.
33
+ - **Agent presets**: two companion templates — Standard enhanced and PTC (Code Mode)
37
34
 
38
35
  ### Install from npm (recommended)
39
36
 
@@ -52,15 +49,25 @@ dsh plugin --profile web add --allow-build=@xiaoso/dsh-tool-plus @xiaoso/dsh-too
52
49
  dsh plugin --profile web add link:<path to this repo>
53
50
  ```
54
51
 
55
- ### Presets: installed automatically with the plugin
52
+ ### Presets
53
+
54
+ | Preset | Base | What it is |
55
+ |---|---|---|
56
+ | **Tool Plus 标准增强版** | official standard | everything in standard mode, with the file/shell toolset swapped for this plugin |
57
+ | **Tool Plus PTC 增强版** | official PTC (Code Mode) | same, but composing multi-step operations through Code Mode's `run_code` |
58
+
59
+ Both presets are **declared by the plugin**: installing it (as a profile bundle) brings two `@deepseek-ai/dsh-agent-preset` declaration rows along in its patch layer, so they appear in the preset list immediately. There is no install step, and the plugin writes nothing at startup.
60
+
61
+ **Tool Plus → Presets** in the settings page is where you change them. Since dsh 0.1.7 the official preset page is read-only and the `agent_preset` tool is gone, so this panel is the only graphical entry point:
56
62
 
57
- No extra step is needed. On first start the plugin checks `~/.dsh/.agent-presets/` and writes the bundled templates **only when the directory does not exist** (nothing is touched if it does, so your own edits are never overwritten). Restart dsh and select the preset in your session to activate it.
63
+ - **Minimal update** — disables just the official tool rows still mounted, touching nothing else
64
+ - **Align to template** — replaces this row's whole plugin list with the selected template
65
+ - **Revert to bundled** — removes the override you wrote in the profile configuration (`<profile>/cordis.patch.yml`), falling back to the bundled declaration
66
+ - **View differences** — shows which entries differ before you touch anything
58
67
 
59
- When you already have an older local copy and want it current, use the settings page under **Tool Plus → Presets**:
68
+ Writes go through the harness's own `ctx.configEditor`, so they inherit the profile lock, concurrency protection, atomic write and rollback.
60
69
 
61
- - **Minimal update** — disables only the conflicting tool rows and keeps every other local change;
62
- - **Reset to compared template** — replaces the whole preset with the selected template, backing up to `agent.cordis.yml.bak-<version>` first;
63
- - **View differences** — shows exactly which lines differ before you touch anything.
70
+ > Upgrading from 0.1.9 or earlier: `~/.dsh/.agent-presets/` is **read by nothing** any more (0.1.7 moved presets into the patch layer), so it is safe to delete; the panel tells you when it finds one.
64
71
 
65
72
  ## Configuration
66
73
 
@@ -71,7 +78,7 @@ Works out of the box, no configuration needed. Common tweaks: background thresho
71
78
  - **dsh CLI**: installed globally, `npm i -g @deepseek-ai/dsh`
72
79
  - **Node.js** ≥ 22.19 or ≥ 24
73
80
  - **Git Bash** (recommended): serves as the bash execution environment on Windows
74
- - Targets DeepSeek Harness `dsh` v0.1.5-rc.1 (pre-release; interfaces may change)
81
+ - Targets DeepSeek Harness `dsh` v0.1.7-rc.2 (pre-release; interfaces may change)
75
82
 
76
83
  ## Notes
77
84
 
package/README.md CHANGED
@@ -18,7 +18,7 @@ DeepSeek Harness 基础工具增强:持久 bash、结构化 read、多模式 e
18
18
  - **edit**:replace 默认,另支持 patch / hashline / apply-patch 三种补丁格式;多段编辑、唯一性校验、空白差异模糊匹配
19
19
  - **grep / glob**:全文搜索与文件名匹配;mtime 排序、上下文行、忽略规则可配置
20
20
  - **ast_grep / ast_edit**(可选):基于语法树的结构化代码搜索与重写,可在设置中开启
21
- - **agent 预设**:标准增强版 / PTC(Code Mode)两套配套模板,**随插件自动装好**——首次启动插件时若目录不存在就整份写入
21
+ - **agent 预设**:标准增强版 / PTC(Code Mode)两套配套模板
22
22
 
23
23
  设置面板(Bash 工具页):
24
24
 
@@ -30,10 +30,7 @@ DeepSeek Harness 基础工具增强:持久 bash、结构化 read、多模式 e
30
30
 
31
31
  ## 安装
32
32
 
33
- 装这一个插件就够了:
34
-
35
- - **工具插件**:提供全套工具,自动接管官方 bash / pwsh / 文件 / 搜索工具;
36
- - **agent 预设**:官方预设里没有这些工具的配置,直接用默认配置会缺能力——标准版 / PTC 两套模板就是来补齐这块的。**这两套模板随插件提供,插件首次启动时若本地还没有就自动写入**,不需要单独安装。
33
+ - **agent 预设**:标准增强版 / PTC(Code Mode)两套配套模板
37
34
 
38
35
  ### 从 npm 安装(推荐)
39
36
 
@@ -52,15 +49,25 @@ dsh plugin --profile web add --allow-build=@xiaoso/dsh-tool-plus @xiaoso/dsh-too
52
49
  dsh plugin --profile web add link:<本仓库路径>
53
50
  ```
54
51
 
55
- ### 预设:随插件自动安装
52
+ ### 预设
53
+
54
+ | 预设 | 底座 | 说明 |
55
+ |---|---|---|
56
+ | **Tool Plus 标准增强版** | 官方 standard | 官方标准模式全部能力 + 文件/Shell 工具集换成本插件 |
57
+ | **Tool Plus PTC 增强版** | 官方 PTC(Code Mode) | 同上,但经 Code Mode 以 `run_code` 组合多步操作 |
58
+
59
+ 两个预设**随插件声明**:安装插件(作为 profile bundle)时,插件的补丁层里就带着两条 `@deepseek-ai/dsh-agent-preset` 声明行,装上即可在预设列表里选。没有安装步骤,插件启动时也不写任何文件。
60
+
61
+ 设置页「Tool Plus → 预设」是改它们的地方(dsh 0.1.7 起官方的预设页只读、也没有 `agent_preset` 工具,所以这里是唯一的图形入口):
56
62
 
57
- 装好插件后**不需要任何额外步骤**:插件首次启动时会检查 `~/.dsh/.agent-presets/`,只在对应目录**不存在**时把随包模板整份写入(存在则一个字节都不碰,所以你自己改过的预设不会被覆盖)。重启 dsh 后在会话里选用预设即生效。
63
+ - **最小更新**:只把这几个仍挂着的官方工具行关掉,其他内容一个字节都不动
64
+ - **对齐模板**:用所选模板整份替换这一行的插件列表
65
+ - **恢复随包**:删掉你写在 profile 配置(`<profile>/cordis.patch.yml`)里的覆盖,回落到随包声明
66
+ - **查看差异**:先看差在哪几行,再决定动不动手
58
67
 
59
- 本地已有旧版预设、想跟上当前版本时,用设置页的「Tool Plus → 预设」:
68
+ 写入通过宿主自己的 `ctx.configEditor` 完成,因此自带 profile 锁、并发保护、原子写与失败回滚。
60
69
 
61
- - **最小更新**:只把冲突的工具行禁用掉,其余本地改动一律保留;
62
- - **重置为对比模板**:整份覆盖成所选模板(写前自动备份到 `agent.cordis.yml.bak-<版本>`);
63
- - **查看差异**:先看清这份预设与模板差在哪几行,再决定动不动手。
70
+ > 从 0.1.9 或更早升级过来的话:`~/.dsh/.agent-presets/` 目录**已经没有任何代码读它**(0.1.7 起预设改为补丁层声明),可以安全删除;设置页检测到它会给出提示。
64
71
 
65
72
  ## 配置
66
73
 
@@ -71,7 +78,7 @@ dsh plugin --profile web add link:<本仓库路径>
71
78
  - **dsh CLI**:需全局安装,`npm i -g @deepseek-ai/dsh`
72
79
  - **Node.js** ≥ 22.19 或 ≥ 24
73
80
  - **Git Bash**(推荐):Windows 上作为 bash 执行环境
74
- - 适用于 DeepSeek Harness `dsh` v0.1.5-rc.1(pre-release,接口可能变动)
81
+ - 适用于 DeepSeek Harness `dsh` v0.1.7-rc.2(pre-release,接口可能变动)
75
82
 
76
83
  ## 注意事项
77
84
 
@@ -17,6 +17,16 @@ Scope of ported upstream code:
17
17
  `src/tools/hashline/test/fixtures/` (copied from
18
18
  `crates/pi-edit/tests/fixtures/hashline/`), MIT, same notice below.
19
19
 
20
+ It also contains a verbatim copy of one upstream file set from the project
21
+ [deepseek-harness](https://github.com/deepseek-ai/deepseek-harness):
22
+
23
+ - `presets/baseline/standard.patch.yml` and `presets/baseline/ptc.patch.yml` are
24
+ byte-for-byte copies of `packages/bundle/web-app/presets/standard.patch.yml`
25
+ and `ptc.patch.yml` from the dsh release this plugin pins. They are vendored
26
+ as the **input** to `scripts/build-preset-patches.mjs`, which derives this
27
+ plugin's own two agent-preset declarations from them; the generated files are
28
+ `presets/tool-plus-{standard,ptc}.patch.yml`. MIT, notice below.
29
+
20
30
  ---
21
31
 
22
32
  oh-my-pi - MIT
@@ -46,3 +56,29 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
46
56
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
47
57
  SOFTWARE.
48
58
 
59
+ ---
60
+
61
+ deepseek-harness - MIT
62
+
63
+ MIT License
64
+
65
+ Copyright (c) 2026 DeepSeek
66
+
67
+ Permission is hereby granted, free of charge, to any person obtaining a copy
68
+ of this software and associated documentation files (the "Software"), to deal
69
+ in the Software without restriction, including without limitation the rights
70
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
71
+ copies of the Software, and to permit persons to whom the Software is
72
+ furnished to do so, subject to the following conditions:
73
+
74
+ The above copyright notice and this permission notice shall be included in all
75
+ copies or substantial portions of the Software.
76
+
77
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
78
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
79
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
80
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
81
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
82
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
83
+ SOFTWARE.
84
+