@jidekaixin2dian/dsh-toolgate 0.2.0 → 0.2.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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,22 @@
1
1
  # Changelog
2
2
 
3
- ## 0.2.0 — 2026-11-13(本地构建,未发布 / local build, unpublished)
3
+ ## 0.2.1 — 2026-11-14
4
+
5
+ **为什么值得更新**:DSH 0.2.2 起多了一个 `apply_patch`(一次新增、修改、删除、移动多个文件),它和 `write`/`edit` 是同一类写盘工具,却没被保护名单覆盖。在逐工具开关里点掉它,模型就只剩单文件写入路径,README 里「任何配置都关不掉」这句承诺也就不成立了。
6
+
7
+ **Why update**: DSH 0.2.2 added `apply_patch` (create, edit, delete and move several files in one call). It is a write-path tool like `write`/`edit` but sat outside the protected list, so one per-tool switch could hide it and quietly break the "no configuration can hide these" promise.
8
+
9
+ - 保护名单加入 `apply_patch`:与 `write`/`edit` 同级,`disabledTools`、规则、预设、会话覆盖都关不掉它。
10
+ - Add `apply_patch` to `PROTECTED_TOOLS`; neither `disabledTools`, rules, presets, nor session overrides can hide it.
11
+ - 回归宿主张新增 `0.2.2-rc.3` 并设为默认(`scripts/host.mjs`);Windows 本地跑通 11 项,浏览器用例按设计跳过(CI 里 `TOOLGATE_BROWSER=1` 会跑)。
12
+ - Pin `0.2.2-rc.3` as the default regression host; 11 Windows host tests pass and the browser-only case skips by design.
13
+
14
+ ## 0.2.0 — 2026-11-13
15
+
16
+ **为什么值得更新**:0.1.x 只能关 MCP / Skill / 记忆 / 定时这四类,ego、remote、watch、
17
+ 团队这些真正占地方的工具一个都关不掉,只能每轮带着进 prompt。0.2.0 把它们变成可关的组,
18
+ `lite` 档在本机实测每轮省下约 1 万个 token 的工具 schema;同时修掉「按工具名隐藏其实
19
+ 没生效」——那个问题会让新按钮看起来按了没用。
4
20
 
5
21
  - 分组从写死改成**数据**:`DEFAULT_RULES` 自带 ego / memory / remote / watch /
6
22
  schedule / team,`toolgate.json` 的 `rules` 可按 id 覆盖或新增;`core` 仍然不可隐藏。
@@ -15,6 +31,12 @@
15
31
  toolgate/ask_user_question)不会被任何配置隐藏,避免把自己锁死。
16
32
  - 会话级覆盖(`action=session`)沿用原有语义,参数改为按规则校验。
17
33
 
34
+ **Why update**: 0.1.x could only switch MCP / Skill / memory / schedule, so ego,
35
+ remote, watch and team tools — the ones that actually cost context — entered every
36
+ prompt. They are switchable groups now; the `lite` preset measured roughly 10k
37
+ fewer tool-schema tokens per turn here. It also fixes "hide by tool name does
38
+ nothing", which made the new switches look broken.
39
+
18
40
  - Groups are data now: shipped `DEFAULT_RULES` plus per-id overrides in
19
41
  `toolgate.json`; ungrouped tools stay in the un-hideable `core`.
20
42
  - `deriveSuggestions()` proposes a group for any ≥3 tools sharing a prefix, so a
package/README.md CHANGED
@@ -28,7 +28,7 @@ Toolgate 为 DeepSeek Harness(DSH)提供统一的 MCP、Skill 和上下文
28
28
  | 三档预设 | `lite` / `standard` / `full` 一键切换;预设永不隐藏 Skill 目录 |
29
29
  | 逐工具开关 | `disabledTools` 精确隐藏单个工具,`status.groups[].tools` 返回每个工具名与 token 估算 |
30
30
  | 分发守卫 | `restrict()` 只把 schema 从列表里摘掉,模型凭历史记忆仍可点名调用;新增的 `tools.guard()` 会在分发前二次拒绝,并说明是本会话还是全局闸门 |
31
- | 保护名单 | `read/write/edit/glob/grep/pwsh/present/todo_write/toolgate/ask_user_question` 任何配置都关不掉 |
31
+ | 保护名单 | `read/write/edit/apply_patch/glob/grep/pwsh/present/todo_write/toolgate/ask_user_question` 任何配置都关不掉(`apply_patch` 是 DSH 0.2.2 起的多文件写入工具,与 write/edit 同级) |
32
32
 
33
33
  也可以用工具本身操作:`toolgate action=status` 看分组,`action=preset preset=lite` 切档,`action=tools tools=[...]` 精确隐藏,`action=session disabled=[...]` 只改本会话,`action=reset` 取消会话覆盖。
34
34
 
package/lib/groups.js CHANGED
@@ -22,10 +22,13 @@ export const FIXED_LABELS = {
22
22
  export const CORE_LABEL = '核心工具'
23
23
 
24
24
  /** Never hideable, whatever the config says. Hiding pwsh or the tool itself
25
- * locks the session out of its own escape hatch. */
25
+ * locks the session out of its own escape hatch.
26
+ * `apply_patch` (DSH 0.2.2+) is the multi-file equivalent of write/edit, so it
27
+ * belongs to the same escape-hatch class: hiding it would leave the model with
28
+ * a "protected" write path that still cannot create or delete files. */
26
29
  export const PROTECTED_TOOLS = Object.freeze([
27
- 'read', 'write', 'edit', 'glob', 'grep', 'pwsh', 'present', 'todo_write',
28
- 'toolgate', 'ask_user_question',
30
+ 'read', 'write', 'edit', 'apply_patch', 'glob', 'grep', 'pwsh', 'present',
31
+ 'todo_write', 'toolgate', 'ask_user_question',
29
32
  ])
30
33
 
31
34
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jidekaixin2dian/dsh-toolgate",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Manage MCP servers and skills in one place; hide or restore groups of tool definitions to control what enters the next prompt.",
5
5
  "icon": "icon.svg",
6
6
  "type": "module",