dsh-lean-router 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/changelog.en.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
> English version of [changelog.md](./changelog.md). Versions follow package.json (currently 0.2.
|
|
3
|
+
> English version of [changelog.md](./changelog.md). Versions follow package.json (currently 0.2.5).
|
|
4
|
+
|
|
5
|
+
## 0.2.5 (2026-11-30)
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- **Five more low-frequency tools masked**: `interrupt_agent`, `list_subagent_models`, `get_goal`, `job_kill` and `job_list` no longer appear in the request, taking the tool definitions from 17,164 to about 15,482 characters (−1,682 characters, roughly 0.42k tokens per turn).
|
|
10
|
+
- **The masking trade-off is now quantified**: masking a tool only saves its own bytes (read once per turn as part of the cached prefix), but the moment it is actually needed the model must `search` and then `describe` first — a single extra round trip over a six-figure-token prefix wipes out a hundred turns of savings. Only tools that are effectively never used are masked; `create_goal`, `send_message`, `wait_agent` and `job_output` are larger but genuinely used, so they stay visible on purpose.
|
|
11
|
+
- This is the practical floor for shrinking the tool surface: about seventy percent of the remaining bytes live in parameter schemas, not description text.
|
|
12
|
+
|
|
13
|
+
### Tests
|
|
14
|
+
|
|
15
|
+
- The masked-name assertion was updated (nine names that must be masked, thirteen that must stay visible); the full suite is 279 tests, 278 passing, 0 failing, 1 skipped.
|
|
4
16
|
|
|
5
17
|
## 0.2.4 (2026-11-30)
|
|
6
18
|
|
package/docs/changelog.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
# 变更记录(changelog)
|
|
2
2
|
|
|
3
|
-
> 中文为主,英文版:[changelog.en.md](./changelog.en.md)。版本号遵循 package.json(当前 0.2.
|
|
3
|
+
> 中文为主,英文版:[changelog.en.md](./changelog.en.md)。版本号遵循 package.json(当前 0.2.5)。
|
|
4
|
+
|
|
5
|
+
## 0.2.5 (2026-11-30)
|
|
6
|
+
|
|
7
|
+
### 变更
|
|
8
|
+
|
|
9
|
+
- **再遮蔽五个低频工具**:`interrupt_agent`、`list_subagent_models`、`get_goal`、`job_kill`、`job_list` 不再出现在请求里,工具定义从 17,164 字符降到约 15,482(−1,682 字符,约 0.42k token/轮)。
|
|
10
|
+
- **遮蔽的取舍被量化**:遮蔽一个工具只省它的整块字符(每轮一次,进入 cacheRead),而一旦真的用到,模型必须先 `search` 再 `describe`,一次额外往返在十几万 token 的前缀上就抵掉上百轮的节省。因此只遮「整局基本不会用到」的工具;`create_goal`、`send_message`、`wait_agent`、`job_output` 虽然体积更大,但实际会用,故意保持可见。
|
|
11
|
+
- 这是工具面继续下压的实际上限:剩余体积的七成在参数 schema 里,不再是描述文本。
|
|
12
|
+
|
|
13
|
+
### 测试
|
|
14
|
+
|
|
15
|
+
- 同步更新遮蔽名单断言(含九个必遮名与十三个必须保持可见的名字);全量 279 项、278 通过、0 失败、1 skip。
|
|
4
16
|
|
|
5
17
|
## 0.2.4 (2026-11-30)
|
|
6
18
|
|
package/lib/toolface/rules.js
CHANGED
|
@@ -30,7 +30,20 @@ export const DEFAULT_HIDDEN_PREFIXES = ['mcp__'];
|
|
|
30
30
|
* Deliberately NOT listed: `subagent`, `ask_user_question`, `pwsh`, `edit`,
|
|
31
31
|
* `write`, `read`, `grep`, `glob` — these are the loop itself.
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
// 只遮「整局基本不会用到」的工具。遮蔽不是免费的:一旦用到,模型必须先 search 再 describe,
|
|
34
|
+
// 一次额外往返在十几万 token 的前缀上就抵掉上百轮省下的字符。create_goal / send_message /
|
|
35
|
+
// wait_agent / job_output 都属常用,故意不在此列。
|
|
36
|
+
export const DEFAULT_HIDDEN_CORE_TOOLS = [
|
|
37
|
+
'update_goal',
|
|
38
|
+
'list_agents',
|
|
39
|
+
'present',
|
|
40
|
+
'subagent_fork',
|
|
41
|
+
'interrupt_agent',
|
|
42
|
+
'list_subagent_models',
|
|
43
|
+
'get_goal',
|
|
44
|
+
'job_kill',
|
|
45
|
+
'job_list',
|
|
46
|
+
];
|
|
34
47
|
|
|
35
48
|
/** Environment switch: `0` keeps the core tools visible. */
|
|
36
49
|
export const CORE_MASK_ENV = 'DSH_LEAN_ROUTER_MASK_CORE';
|
package/package.json
CHANGED
|
@@ -108,6 +108,10 @@ try {
|
|
|
108
108
|
console.log("[install-profile] 完成:" + PKG + "@" + version + " -> " + target);
|
|
109
109
|
console.log("[install-profile] 清单 " + manifestPath + " 无 BOM、可解析、版本一致");
|
|
110
110
|
console.log("[install-profile] 下一步:完全退出并重启 DSH,然后在宿主运行时不要替换这些文件(热重载会重读缓存)。");
|
|
111
|
+
} catch (error) {
|
|
112
|
+
// 拉包失败(版本还没在 registry 上可见、网络中断等)时给一句人话,
|
|
113
|
+
// 而不是把 child_process 的原始错误对象整个倾倒出来。
|
|
114
|
+
fail('安装失败:' + (error?.message ?? String(error)).split('\n')[0]);
|
|
111
115
|
} finally {
|
|
112
116
|
rmSync(stage, { recursive: true, force: true });
|
|
113
117
|
}
|
|
@@ -169,13 +169,13 @@ test('DSH_LEAN_ROUTER_DESC_SLIM=0 disables every rewrite', () => {
|
|
|
169
169
|
|
|
170
170
|
test('the four low-frequency core tools are masked by default; the loop tools are not', () => {
|
|
171
171
|
const options = normalizeConfig({});
|
|
172
|
-
for (const name of ['update_goal', 'list_agents', 'present', 'subagent_fork']) {
|
|
172
|
+
for (const name of ['update_goal', 'list_agents', 'present', 'subagent_fork', 'interrupt_agent', 'list_subagent_models', 'get_goal', 'job_kill', 'job_list']) {
|
|
173
173
|
assert.equal(isMaskedName(name, options), true, `${name} must be masked`);
|
|
174
174
|
}
|
|
175
|
-
for (const name of ['subagent', 'ask_user_question', 'pwsh', 'edit', 'write', 'read', 'grep', 'glob', 'code_run']) {
|
|
175
|
+
for (const name of ['subagent', 'ask_user_question', 'pwsh', 'edit', 'write', 'read', 'grep', 'glob', 'code_run', 'create_goal', 'send_message', 'wait_agent', 'job_output']) {
|
|
176
176
|
assert.equal(isMaskedName(name, options), false, `${name} must stay visible`);
|
|
177
177
|
}
|
|
178
|
-
assert.deepEqual([...DEFAULT_HIDDEN_CORE_TOOLS].sort(), ['list_agents', 'present', 'subagent_fork', 'update_goal']);
|
|
178
|
+
assert.deepEqual([...DEFAULT_HIDDEN_CORE_TOOLS].sort(), ['get_goal', 'interrupt_agent', 'job_kill', 'job_list', 'list_agents', 'list_subagent_models', 'present', 'subagent_fork', 'update_goal']);
|
|
179
179
|
// Merging must not disturb explicitly configured names.
|
|
180
180
|
const configured = normalizeConfig({ hiddenTools: ['custom_tool'] });
|
|
181
181
|
assert.equal(isMaskedName('custom_tool', configured), true, 'configured names still hide');
|