dsh-model-switch 0.4.39 → 0.4.40

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,3 +1,15 @@
1
+ ## v0.4.40
2
+
3
+ 按你的点名,默认豁免名单从 47 条扩到 **58 条**:新增 11 个工具,全部在「设置 → 模型切换 → 审查豁免」里可查、可删、可恢复默认。
4
+
5
+ - **纯读 / 无副作用(6 个)**:`load_workspace_dependencies`(只返回打包依赖路径与版本)、`wait_agent`(只等待队友变化)、`ask_user_question`(把问题抛给人,决策权本来就在人手里)、`present`(只登记交付物卡片,不复制内容)、`sidebar_open`(只在侧栏打开文件/文件夹/URL)、`exit_plan_mode`(计划门由人审批,第二个审查者多余)。
6
+ - **只派发、副作用仍留在审查内(3 个)**:`send_message`(给队友投递消息,目标会话的预设是它被创建时定好的)、`team_task_create`(只写共享任务板)、`terminal_open`(只起 shell,后续 `terminal_send` 仍在审查)。
7
+ - **自治项(2 个,按你的明确决定放出)**:`create_goal`(创建持久目标,让本会话跨轮继续)、`schedule_create`(排一条未来投递的提示)。它们触发的新回合仍跑同一个 auto 预设,所以每轮里的工具调用照样逐次审查;风险是无人值守的 token 消耗,已在名单注释里标明。
8
+ - **明确排除:`subagent` / `subagent_fork` / `spawn_teammate` 永不进默认名单。** `dsh-subagent` 生成子会话时会读 `permissionPresets.current(parent.session)`,只有 `auto` / `danger-full-access` 会被继承;而本插件在"名单命中的调用正在飞"时把 `current()` 答成 `'custom'`——放行这三个会让子会话拿不到 auto 预设,等于造出**无审查的子 agent**。`tests/tool-allowlist.spec.ts` 新增 `DELEGATION_SPAWNS` 专项守卫,防止以后被顺手加进去。
9
+ - **守卫调整**:`MUTATING` 里移除 `send_message`、`team_task_create`(现按"派发类"放行),补入 `subagent`、`subagent_fork`。
10
+ - **注意**:默认名单只是"出厂值"。已经保存过名单的部署(含桌面)升级后不会自动多出这 11 条——需要点一次「恢复默认名单」,或手动加入。
11
+ - 测试:59 个测试文件 / **541** 测试(新增 delegation 守卫与"用户放行清单"两例)。
12
+
1
13
  ## v0.4.39
2
14
 
3
15
  「自动审查」下,**纯读工具不再调用审查模型**:`read` / `grep` / `glob` 这类只读调用直接执行,写操作、命令执行与删除仍然逐次审查。功能默认**关闭**,在「设置 → 模型切换 → 审查豁免」一键开启。
@@ -127,13 +127,22 @@ const PLUGIN_TOOLS = /* @__PURE__ */ new Map([["generate_image", "dsh-model-swit
127
127
  /** `<base>__<owner>` — the extension-tool naming the QQ bot framework uses. */
128
128
  const EXTENSION_TOOL = /^([A-Za-z0-9_-]+)__(.+)$/;
129
129
  /**
130
- * Default allowlist: every pure-read tool this deployment exposes, calibrated on
131
- * a live desktop profile (105 tools) at dsh 0.2.1-rc.2.
130
+ * Default allowlist: every pure-read tool this deployment exposes plus the
131
+ * no-side-effect and autonomy entries the user explicitly released, calibrated
132
+ * on a live desktop profile (105 tools) at dsh 0.2.1-rc.2.
132
133
  *
133
134
  * Grouped by origin so a reader can trace each entry through {@link SOURCE_CATALOG}.
134
135
  * Entries ending in `*` are patterns: the QQ bot extension suffixes its tools with
135
136
  * the bot's own name, so `sessions_list__*` keeps working when the persona is
136
137
  * renamed.
138
+ *
139
+ * Everything here follows one rule: releasing it must not let a side effect escape
140
+ * the reviewer. Calls that merely dispatch, ask, present, wait or navigate qualify
141
+ * because the work they trigger still runs under the same auto preset. Delegation
142
+ * tools (`subagent`, `subagent_fork`, `spawn_teammate`) deliberately stay out: a
143
+ * child session seeds its preset from `permissionPresets.current(parent.session)`,
144
+ * and this bypass answers `'custom'` for an allowlisted call in flight — releasing
145
+ * them would hand the child no `auto` preset at all, i.e. no review.
137
146
  */
138
147
  const DEFAULT_READ_ONLY_TOOLS = [
139
148
  "read",
@@ -144,6 +153,11 @@ const DEFAULT_READ_ONLY_TOOLS = [
144
153
  "web_search",
145
154
  "web_search_pro",
146
155
  "web_fetch",
156
+ "load_workspace_dependencies",
157
+ "ask_user_question",
158
+ "present",
159
+ "sidebar_open",
160
+ "exit_plan_mode",
147
161
  "job_list",
148
162
  "job_output",
149
163
  "terminal_list",
@@ -153,6 +167,9 @@ const DEFAULT_READ_ONLY_TOOLS = [
153
167
  "team_task_get",
154
168
  "get_goal",
155
169
  "schedule_list",
170
+ "wait_agent",
171
+ "send_message",
172
+ "team_task_create",
156
173
  "list_mcp_resources",
157
174
  "list_mcp_resource_templates",
158
175
  "read_mcp_resource",
@@ -161,6 +178,9 @@ const DEFAULT_READ_ONLY_TOOLS = [
161
178
  "session_event_read",
162
179
  "session_event_trace",
163
180
  "session_trace",
181
+ "create_goal",
182
+ "schedule_create",
183
+ "terminal_open",
164
184
  "ops_read_files",
165
185
  "ops_discover_tools",
166
186
  "bcdp_status",
@@ -1,2 +1,2 @@
1
- import { a as bindAutoReviewSessionCorrelation, c as installToolCallSafetyNet, d as resolveSessionAutoReviewRoute, f as reviewLlm, i as autoReviewStatus, l as isReviewerInfrastructureFailure, n as autoReviewGate, o as defensivePermissionPresets, p as reviewScope, r as autoReviewRouteOf, s as inject, t as apply, u as name } from "./auto-review-C61WZIYI.js";
1
+ import { a as bindAutoReviewSessionCorrelation, c as installToolCallSafetyNet, d as resolveSessionAutoReviewRoute, f as reviewLlm, i as autoReviewStatus, l as isReviewerInfrastructureFailure, n as autoReviewGate, o as defensivePermissionPresets, p as reviewScope, r as autoReviewRouteOf, s as inject, t as apply, u as name } from "./auto-review-BDx3LjVL.js";
2
2
  export { apply, autoReviewGate, autoReviewRouteOf, autoReviewStatus, bindAutoReviewSessionCorrelation, defensivePermissionPresets, inject, installToolCallSafetyNet, isReviewerInfrastructureFailure, name, resolveSessionAutoReviewRoute, reviewLlm, reviewScope };
package/lib/client.js CHANGED
@@ -132,13 +132,22 @@ window.__ModuleLoader__.load({
132
132
  /** `<base>__<owner>` — the extension-tool naming the QQ bot framework uses. */
133
133
  const EXTENSION_TOOL = /^([A-Za-z0-9_-]+)__(.+)$/;
134
134
  /**
135
- * Default allowlist: every pure-read tool this deployment exposes, calibrated on
136
- * a live desktop profile (105 tools) at dsh 0.2.1-rc.2.
135
+ * Default allowlist: every pure-read tool this deployment exposes plus the
136
+ * no-side-effect and autonomy entries the user explicitly released, calibrated
137
+ * on a live desktop profile (105 tools) at dsh 0.2.1-rc.2.
137
138
  *
138
139
  * Grouped by origin so a reader can trace each entry through {@link SOURCE_CATALOG}.
139
140
  * Entries ending in `*` are patterns: the QQ bot extension suffixes its tools with
140
141
  * the bot's own name, so `sessions_list__*` keeps working when the persona is
141
142
  * renamed.
143
+ *
144
+ * Everything here follows one rule: releasing it must not let a side effect escape
145
+ * the reviewer. Calls that merely dispatch, ask, present, wait or navigate qualify
146
+ * because the work they trigger still runs under the same auto preset. Delegation
147
+ * tools (`subagent`, `subagent_fork`, `spawn_teammate`) deliberately stay out: a
148
+ * child session seeds its preset from `permissionPresets.current(parent.session)`,
149
+ * and this bypass answers `'custom'` for an allowlisted call in flight — releasing
150
+ * them would hand the child no `auto` preset at all, i.e. no review.
142
151
  */
143
152
  const DEFAULT_READ_ONLY_TOOLS = [
144
153
  "read",
@@ -149,6 +158,11 @@ window.__ModuleLoader__.load({
149
158
  "web_search",
150
159
  "web_search_pro",
151
160
  "web_fetch",
161
+ "load_workspace_dependencies",
162
+ "ask_user_question",
163
+ "present",
164
+ "sidebar_open",
165
+ "exit_plan_mode",
152
166
  "job_list",
153
167
  "job_output",
154
168
  "terminal_list",
@@ -158,6 +172,9 @@ window.__ModuleLoader__.load({
158
172
  "team_task_get",
159
173
  "get_goal",
160
174
  "schedule_list",
175
+ "wait_agent",
176
+ "send_message",
177
+ "team_task_create",
161
178
  "list_mcp_resources",
162
179
  "list_mcp_resource_templates",
163
180
  "read_mcp_resource",
@@ -166,6 +183,9 @@ window.__ModuleLoader__.load({
166
183
  "session_event_read",
167
184
  "session_event_trace",
168
185
  "session_trace",
186
+ "create_goal",
187
+ "schedule_create",
188
+ "terminal_open",
169
189
  "ops_read_files",
170
190
  "ops_discover_tools",
171
191
  "bcdp_status",
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { o as normalizeProviderGroups } from "./session-route-D1zoZgf3.js";
2
- import { h as resolveToolSource, i as autoReviewStatus, m as DEFAULT_READ_ONLY_TOOLS } from "./auto-review-C61WZIYI.js";
2
+ import { h as resolveToolSource, i as autoReviewStatus, m as DEFAULT_READ_ONLY_TOOLS } from "./auto-review-BDx3LjVL.js";
3
3
  import { ModelSwitchAdapterRegistry } from "./adapter-registry.js";
4
4
  import { createRequire } from "node:module";
5
5
  import z from "@deepseek-ai/schemastery";
@@ -53,13 +53,22 @@ export declare const SOURCE_CATALOG: readonly SourceCatalogEntry[];
53
53
  /** Catalog lookup by id. */
54
54
  export declare const SOURCE_BY_ID: ReadonlyMap<string, SourceCatalogEntry>;
55
55
  /**
56
- * Default allowlist: every pure-read tool this deployment exposes, calibrated on
57
- * a live desktop profile (105 tools) at dsh 0.2.1-rc.2.
56
+ * Default allowlist: every pure-read tool this deployment exposes plus the
57
+ * no-side-effect and autonomy entries the user explicitly released, calibrated
58
+ * on a live desktop profile (105 tools) at dsh 0.2.1-rc.2.
58
59
  *
59
60
  * Grouped by origin so a reader can trace each entry through {@link SOURCE_CATALOG}.
60
61
  * Entries ending in `*` are patterns: the QQ bot extension suffixes its tools with
61
62
  * the bot's own name, so `sessions_list__*` keeps working when the persona is
62
63
  * renamed.
64
+ *
65
+ * Everything here follows one rule: releasing it must not let a side effect escape
66
+ * the reviewer. Calls that merely dispatch, ask, present, wait or navigate qualify
67
+ * because the work they trigger still runs under the same auto preset. Delegation
68
+ * tools (`subagent`, `subagent_fork`, `spawn_teammate`) deliberately stay out: a
69
+ * child session seeds its preset from `permissionPresets.current(parent.session)`,
70
+ * and this bypass answers `'custom'` for an allowlisted call in flight — releasing
71
+ * them would hand the child no `auto` preset at all, i.e. no review.
63
72
  */
64
73
  export declare const DEFAULT_READ_ONLY_TOOLS: readonly string[];
65
74
  /** Why one allowlist entry was refused. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-model-switch",
3
- "version": "0.4.39",
3
+ "version": "0.4.40",
4
4
  "description": "Explicit model routing plus composer/Plan picker for DeepSeek Harness",
5
5
  "repository": {
6
6
  "type": "git",