dsh-mcp 1.15.0 → 1.15.2

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.en.md CHANGED
@@ -9,9 +9,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ## Compatibility
11
11
 
12
- - **Supported DSH version**: **dsh `0.2.0-rc.2`** — the latest release is developed and verified on `0.2.0-rc.2` (declared in `package.json` → `dsh.supported`); older entries state the version verified at their time. When the DSH and plugin versions do not match, the Settings page reports a diagnosis (check whether the bundle is selected → restart `dsh web` → hard-refresh → upgrade both sides).
12
+ - **Supported DSH version**: **dsh `0.2.2-rc.3`** — the latest release is developed and verified on `0.2.2-rc.3` (declared in `package.json` → `dsh.supported`); older entries state the version verified at their time. When the DSH and plugin versions do not match, the Settings page reports a diagnosis (check whether the bundle is selected → restart `dsh web` → hard-refresh → upgrade both sides).
13
13
  - **Release convention**: every version entry states `- **Supported DSH version**: dsh <version>`, mirrored in the GitHub Release notes. The release body is written in **Chinese** (matching [CHANGELOG.md](CHANGELOG.md)), with heading levels mirroring the entry.
14
14
 
15
+ ## [1.15.2] - 2026-11-15
16
+
17
+ - **Supported DSH version**: **dsh `0.2.2-rc.3`**
18
+
19
+ ### Fixed
20
+
21
+ - **The plugin was unusable on DSH 0.2.2-rc.2/rc.3: `typert: Remote package "@deepseek-ai/dsh-mcp-manager" is already registered` (issue #24)**: since 0.2.2-rc.2 DSH ships an official `@deepseek-ai/dsh-mcp-manager`, whose client bundle mounts a Remote contribution under that same package name; the client typert registry enforces one owner per package name (`RemoteStore.register`), so registering under the same name throws and leaves the plugin row in an error state with an unusable settings page. The plugin's Remote package id is now its own package name, **`dsh-mcp`** (14 method ids and their typeSymbols renamed with it). Renaming is safe: an invocation routes only by the `namespace/method` endpoint (`typertEndpoint()`), and every `mcpManager/*` endpoint is unchanged; the official manager declares only `mcpManager/probe|restart|watch`, so the endpoint sets do not overlap either
22
+ - New `test/typert-package.test.mjs`: asserts the Remote package id equals this package's name and not the upstream one, that every descriptor id sits under our own package, and that endpoints are unique and never overlap the built-in manager's `probe/restart/watch`
23
+
24
+ ### Notes
25
+
26
+ - `src/client/remote-contribution.js` is a typert-generated file; the rename is a manual edit (the repository carries no generator config or FaceModel). The file header records why, and the constraint that a re-generation must carry a unique package name
27
+ - `lib/client.js` was rebuilt: the diff is 40 lines of pure renaming, zod stays 4.4.3, no dependency or path drift, and the build is reproducible
28
+
29
+ ## [1.15.1] - 2026-11-10
30
+
31
+ - **Supported DSH version**: **dsh `0.2.2-rc.1`**
32
+
33
+ ### Fixed
34
+
35
+ - **Search mode and per-tool switches were complete no-ops on DSH 0.2.2, which kept injecting every MCP tool (issue #23)**: 0.2.2 no longer hands the tool list to `system-prompt/assemble` — the model-facing set is built by `systemPrompt.tools()` from a **per-step admission set** (`tools.resolve()` → `registration.when(context)`), so "filter an already-built list" is not a thing that can work: a tool outside the set never arrives no matter how it is filtered, and one inside cannot be removed. The result was 314 tools ≈ 305.6 KB ≈ 82k tokens on every request, with `mcp_tool_search` and the checkboxes both inert. The plugin now declares `when` **at registration time**: `installToolControl()` wraps `ctx.tools.register` synchronously before any mount registers a tool, attaching "switched off → refuse; `search` mode → admit only the hot set; `full` mode → admit everything" to every `mcp__*` registration for the core to resolve each step. `mcp_tool_search` sits outside the `mcp__` namespace, so it stays visible and callable — it records the matched tools as hot, which admits them on the next step, which is what finally makes `search` mode save tokens. A caller-supplied `when` is preserved and ANDed after the plugin's admission; cores ≤ 0.2.1 take a single-argument `register`, so the extra `when` is ignored and the existing waterfall filter still applies. Unload/reload restores the original `register` and never overwrites a wrapper added later
36
+ - **The degraded-path log no longer misleads**: when the "no tool list" seam of 0.2.2 is hit but the admission gate is live, the message drops to `info` and states that switches and search mode are enforced at registration time; only a core with neither seam nor admission capability gets a `warn` that the configuration is inert
37
+ - **`toolsList()` now reports `enforcement`**: `admission` (per-step, 0.2.2) / `waterfall` (hook filtering, ≤ 0.2.1) / `unavailable` (neither), so the settings page and diagnostics can tell whether the injection mode and switches actually take effect
38
+
39
+ ### Notes
40
+
41
+ - New `test/tool-admission.test.mjs` (no DSH module closure — runs anywhere): covers ① the admission matrix (`search`/`full` × switches × hot set); ② only the `mcp__` namespace is wrapped, `mcp_tool_search` and ordinary tools are untouched; ③ a caller-supplied `when` is preserved and can still veto; ④ the ≤ 0.2.1 single-argument registration shape is unchanged; ⑤ idempotent install and disposer restoration
42
+ - No client source changes: `lib/client.js` rebuilds byte-for-byte identically
43
+
15
44
  ## [1.15.0] - 2026-11-06
16
45
 
17
46
  - **Supported DSH version**: **dsh `0.2.0-rc.2`** (this release also lets the plugin load on `0.2.2-rc.1`, see below)
package/CHANGELOG.md CHANGED
@@ -9,9 +9,38 @@
9
9
 
10
10
  ## 兼容性
11
11
 
12
- - **支持版本**:**dsh `0.2.0-rc.2`** —— 最新版本在 `0.2.0-rc.2` 上开发与验证(`package.json` → `dsh.supported` 同步声明);历史版本条目各自声明当时验证的版本。DSH 与插件版本不匹配时,设置页会给出排查诊断(核对 bundle 是否已选中 → 重启 `dsh web` → 硬刷新 → 同步升级)。
12
+ - **支持版本**:**dsh `0.2.2-rc.3`** —— 最新版本在 `0.2.2-rc.3` 上开发与验证(`package.json` → `dsh.supported` 同步声明);历史版本条目各自声明当时验证的版本。DSH 与插件版本不匹配时,设置页会给出排查诊断(核对 bundle 是否已选中 → 重启 `dsh web` → 硬刷新 → 同步升级)。
13
13
  - **发版约定**:每个版本条目都要声明 `- **支持版本**:dsh <版本>`,并在 GitHub Release notes 中同步。Release 正文用**中文**(与本文档一致),标题层级与条目一致。
14
14
 
15
+ ## [1.15.2] - 2026-11-15
16
+
17
+ - **支持版本**:**dsh `0.2.2-rc.3`**
18
+
19
+ ### 修复
20
+
21
+ - **DSH 0.2.2-rc.2/rc.3 上插件直接不可用:`typert: Remote package "@deepseek-ai/dsh-mcp-manager" is already registered`(issue #24)**:0.2.2-rc.2 起 DSH 内置了官方 `@deepseek-ai/dsh-mcp-manager`,它的客户端 bundle 以同一个 Remote 包名挂载 contribution;客户端 typert registry 对包名做唯一所有权校验(`RemoteStore.register`),本插件再用同名注册就抛错,插件行显示错误、管理界面无法使用。现在把本插件的 Remote 包 id 改为自己的包名 **`dsh-mcp`**(14 个方法 id 与对应 typeSymbol 一并改名)。改包名是安全的:调用路由只按 endpoint `namespace/method`(`typertEndpoint()`),本插件的 `mcpManager/*` 端点一个未动;官方管理器只声明 `mcpManager/probe|restart|watch`,与本插件端点无交集,因此端点层也不会撞车
22
+ - 新增 `test/typert-package.test.mjs`:断言 Remote 包名等于本包名且不等于上游包名、所有 descriptor id 均在自己的包名下、端点唯一且不与内置管理器的 `probe/restart/watch` 重叠
23
+
24
+ ### 说明
25
+
26
+ - `src/client/remote-contribution.js` 是 typert 生成文件,本次改名是手工修改(仓库内没有生成器配置与 FaceModel);文件头已写明原因,以及「重新生成时必须携带唯一包名」的约束
27
+ - `lib/client.js` 已重建:diff 仅 40 行(纯改名),zod 仍为 4.4.3,无依赖/路径漂移,重建结果可复现
28
+
29
+ ## [1.15.1] - 2026-11-10
30
+
31
+ - **支持版本**:**dsh `0.2.2-rc.1`**
32
+
33
+ ### 修复
34
+
35
+ - **DSH 0.2.2 上「按需检索」与单工具开关完全失效,每轮仍注入全部 MCP 工具(issue #23)**:0.2.2 不再把工具列表交给 `system-prompt/assemble`——模型可见的工具集由 `systemPrompt.tools()` 按**每步准入集合**(`tools.resolve()` → `registration.when(context)`)构建,因此「过滤一份已经建好的列表」这条路不复存在:集合外的工具再怎么过滤也进不来,集合内的也删不掉。结果是 314 个工具 ≈ 305.6 KB ≈ 82k tokens 每轮全量注入,`mcp_tool_search` 与勾选开关都成了空操作。现在改为在**注册时**声明 `when`:`installToolControl()` 在任何挂载注册工具之前同步包装 `ctx.tools.register`,为 `mcp__*` 注册挂上「被开关禁用 → 拒绝;`search` 模式 → 仅热集合准入;`full` 模式 → 全部准入」的条件,由核心逐步求值。`mcp_tool_search` 不在 `mcp__` 命名空间内,始终可见可调用——它把命中工具写入热集合,下一步即被准入,`search` 模式这才真正省下 token。调用方自带的 `when` 会保留并与插件准入相与;≤ 0.2.1 的核心 `register` 只接受一个参数,多余的 `when` 被忽略,原有 waterfall 过滤路径照旧生效。插件卸载/重载时还原原始 `register`,且不会覆盖后续插件加的包装
36
+ - **降级日志不再误导**:命中 0.2.2 的「无工具列表」接缝时,若准入门已生效则降为 `info`,说明「开关与 search 模式已在注册期由准入 `when` 执行」;只有核心既无该接缝又无准入能力时才 `warn`「配置不生效」
37
+ - **`toolsList()` 新增 `enforcement`**:取值 `admission`(0.2.2 按步准入)/ `waterfall`(≤ 0.2.1 钩子过滤)/ `unavailable`(两者皆无),设置页与诊断可据此判断注入模式与工具开关是否真的生效
38
+
39
+ ### 说明
40
+
41
+ - 新增 `test/tool-admission.test.mjs`(不依赖 DSH 模块闭包,任何环境都会执行):覆盖 ① 准入判定矩阵(`search`/`full` × 开关 × 热集合);② 只包装 `mcp__` 命名空间、`mcp_tool_search` 与普通工具不受影响;③ 调用方 `when` 保留且仍可否决;④ ≤ 0.2.1 单参数注册形态不变;⑤ 幂等安装与卸载还原
42
+ - 未改客户端源码:`lib/client.js` 重建后字节零变化
43
+
15
44
  ## [1.15.0] - 2026-11-06
16
45
 
17
46
  - **支持版本**:**dsh `0.2.0-rc.2`**(本版本同时让插件可在 `0.2.2-rc.1` 上加载,见下)
package/README.en.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![dshfind](https://dshfind.com/api/badge/ArvinQi/dsh-mcp?lang=en)](https://dshfind.com/en/plugins/ArvinQi/dsh-mcp?ref=badge)
4
4
 
5
- > **Supported DSH version**: `dsh 0.2.0-rc.2` — the latest release is developed and verified on `0.2.0-rc.2`, declared in `package.json` → `dsh.supported`. When the DSH and plugin versions do not match, the Settings page shows a diagnosis (check whether the bundle is selected → restart `dsh web` → hard-refresh → upgrade both sides).
5
+ > **Supported DSH version**: `dsh 0.2.2-rc.3` — the latest release is developed and verified on `0.2.2-rc.3`, declared in `package.json` → `dsh.supported`. When the DSH and plugin versions do not match, the Settings page shows a diagnosis (check whether the bundle is selected → restart `dsh web` → hard-refresh → upgrade both sides).
6
6
 
7
7
  ![Settings preview](static/snapshot.en.webp)
8
8
 
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [![dshfind](https://dshfind.com/api/badge/ArvinQi/dsh-mcp?lang=zh)](https://dshfind.com/zh/plugins/ArvinQi/dsh-mcp?ref=badge)
6
6
 
7
- > **支持版本**:`dsh 0.2.0-rc.2` —— 最新版本在 `0.2.0-rc.2` 上开发与验证,`package.json` → `dsh.supported` 同步声明。DSH 与插件两侧版本不匹配时,设置页会给出排查诊断(检查 bundle 是否已选中 → 重启 `dsh web` → 硬刷新 → 同步升级)。
7
+ > **支持版本**:`dsh 0.2.2-rc.3` —— 最新版本在 `0.2.2-rc.3` 上开发与验证,`package.json` → `dsh.supported` 同步声明。DSH 与插件两侧版本不匹配时,设置页会给出排查诊断(检查 bundle 是否已选中 → 重启 `dsh web` → 硬刷新 → 同步升级)。
8
8
 
9
9
  ![设置页预览](static/snapshot.webp)
10
10
 
package/lib/client.js CHANGED
@@ -14979,10 +14979,10 @@ var _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStatus_result$schema = external
14979
14979
  }).readonly()
14980
14980
  })]);
14981
14981
  var TYPERT_REMOTE = {
14982
- package: "@deepseek-ai/dsh-mcp-manager",
14982
+ package: "dsh-mcp",
14983
14983
  descriptors: [
14984
14984
  {
14985
- id: "@deepseek-ai/dsh-mcp-manager#mcpManager/delete",
14985
+ id: "dsh-mcp#mcpManager/delete",
14986
14986
  service: "mcpManager",
14987
14987
  namespace: "mcpManager",
14988
14988
  method: "delete",
@@ -14994,7 +14994,7 @@ var TYPERT_REMOTE = {
14994
14994
  source: "json",
14995
14995
  codec: {
14996
14996
  mode: "strict",
14997
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerRemoveRequest",
14997
+ typeSymbol: "dsh-mcp/types#McpManagerRemoveRequest",
14998
14998
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_delete_parameter_0$schema,
14999
14999
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_delete_parameter_0$schema
15000
15000
  }
@@ -15002,14 +15002,14 @@ var TYPERT_REMOTE = {
15002
15002
  ],
15003
15003
  result: {
15004
15004
  mode: "strict",
15005
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerRemoveResult",
15005
+ typeSymbol: "dsh-mcp/types#McpManagerRemoveResult",
15006
15006
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_delete_result$schema,
15007
15007
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_delete_result$schema
15008
15008
  },
15009
15009
  sourceLocation: { "file": "packages/mcp/mcp-manager/src/index.ts", "line": 399, "column": 9 }
15010
15010
  },
15011
15011
  {
15012
- id: "@deepseek-ai/dsh-mcp-manager#mcpManager/list",
15012
+ id: "dsh-mcp#mcpManager/list",
15013
15013
  service: "mcpManager",
15014
15014
  namespace: "mcpManager",
15015
15015
  method: "list",
@@ -15017,14 +15017,14 @@ var TYPERT_REMOTE = {
15017
15017
  parameters: [],
15018
15018
  result: {
15019
15019
  mode: "strict",
15020
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerListResult",
15020
+ typeSymbol: "dsh-mcp/types#McpManagerListResult",
15021
15021
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_list_result$schema,
15022
15022
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_list_result$schema
15023
15023
  },
15024
15024
  sourceLocation: { "file": "packages/mcp/mcp-manager/src/index.ts", "line": 314, "column": 9 }
15025
15025
  },
15026
15026
  {
15027
- id: "@deepseek-ai/dsh-mcp-manager#mcpManager/test",
15027
+ id: "dsh-mcp#mcpManager/test",
15028
15028
  service: "mcpManager",
15029
15029
  namespace: "mcpManager",
15030
15030
  method: "test",
@@ -15036,7 +15036,7 @@ var TYPERT_REMOTE = {
15036
15036
  source: "json",
15037
15037
  codec: {
15038
15038
  mode: "strict",
15039
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerTestRequest",
15039
+ typeSymbol: "dsh-mcp/types#McpManagerTestRequest",
15040
15040
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_test_parameter_0$schema,
15041
15041
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_test_parameter_0$schema
15042
15042
  }
@@ -15044,14 +15044,14 @@ var TYPERT_REMOTE = {
15044
15044
  ],
15045
15045
  result: {
15046
15046
  mode: "strict",
15047
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerTestResult",
15047
+ typeSymbol: "dsh-mcp/types#McpManagerTestResult",
15048
15048
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_test_result$schema,
15049
15049
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_test_result$schema
15050
15050
  },
15051
15051
  sourceLocation: { "file": "packages/mcp/mcp-manager/src/index.ts", "line": 422, "column": 9 }
15052
15052
  },
15053
15053
  {
15054
- id: "@deepseek-ai/dsh-mcp-manager#mcpManager/upsert",
15054
+ id: "dsh-mcp#mcpManager/upsert",
15055
15055
  service: "mcpManager",
15056
15056
  namespace: "mcpManager",
15057
15057
  method: "upsert",
@@ -15063,7 +15063,7 @@ var TYPERT_REMOTE = {
15063
15063
  source: "json",
15064
15064
  codec: {
15065
15065
  mode: "strict",
15066
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerUpsertRequest",
15066
+ typeSymbol: "dsh-mcp/types#McpManagerUpsertRequest",
15067
15067
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_parameter_0$schema,
15068
15068
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_parameter_0$schema
15069
15069
  }
@@ -15071,14 +15071,14 @@ var TYPERT_REMOTE = {
15071
15071
  ],
15072
15072
  result: {
15073
15073
  mode: "strict",
15074
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerUpsertResult",
15074
+ typeSymbol: "dsh-mcp/types#McpManagerUpsertResult",
15075
15075
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_result$schema,
15076
15076
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_result$schema
15077
15077
  },
15078
15078
  sourceLocation: { "file": "packages/mcp/mcp-manager/src/index.ts", "line": 329, "column": 9 }
15079
15079
  },
15080
15080
  {
15081
- id: "@deepseek-ai/dsh-mcp-manager#mcpManager/upsertJson",
15081
+ id: "dsh-mcp#mcpManager/upsertJson",
15082
15082
  service: "mcpManager",
15083
15083
  namespace: "mcpManager",
15084
15084
  method: "upsertJson",
@@ -15090,7 +15090,7 @@ var TYPERT_REMOTE = {
15090
15090
  source: "json",
15091
15091
  codec: {
15092
15092
  mode: "strict",
15093
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerUpsertJsonRequest",
15093
+ typeSymbol: "dsh-mcp/types#McpManagerUpsertJsonRequest",
15094
15094
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_parameter_0$schema,
15095
15095
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_parameter_0$schema
15096
15096
  }
@@ -15098,14 +15098,14 @@ var TYPERT_REMOTE = {
15098
15098
  ],
15099
15099
  result: {
15100
15100
  mode: "strict",
15101
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerUpsertJsonResult",
15101
+ typeSymbol: "dsh-mcp/types#McpManagerUpsertJsonResult",
15102
15102
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_result$schema,
15103
15103
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_result$schema
15104
15104
  },
15105
15105
  sourceLocation: { "file": "lib/index.js" }
15106
15106
  },
15107
15107
  {
15108
- id: "@deepseek-ai/dsh-mcp-manager#mcpManager/toolsList",
15108
+ id: "dsh-mcp#mcpManager/toolsList",
15109
15109
  service: "mcpManager",
15110
15110
  namespace: "mcpManager",
15111
15111
  method: "toolsList",
@@ -15113,14 +15113,14 @@ var TYPERT_REMOTE = {
15113
15113
  parameters: [],
15114
15114
  result: {
15115
15115
  mode: "strict",
15116
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerToolsListResult",
15116
+ typeSymbol: "dsh-mcp/types#McpManagerToolsListResult",
15117
15117
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsList_result$schema,
15118
15118
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_toolsList_result$schema
15119
15119
  },
15120
15120
  sourceLocation: { "file": "lib/index.js" }
15121
15121
  },
15122
15122
  {
15123
- id: "@deepseek-ai/dsh-mcp-manager#mcpManager/toolsSet",
15123
+ id: "dsh-mcp#mcpManager/toolsSet",
15124
15124
  service: "mcpManager",
15125
15125
  namespace: "mcpManager",
15126
15126
  method: "toolsSet",
@@ -15132,7 +15132,7 @@ var TYPERT_REMOTE = {
15132
15132
  source: "json",
15133
15133
  codec: {
15134
15134
  mode: "strict",
15135
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerToolsSetRequest",
15135
+ typeSymbol: "dsh-mcp/types#McpManagerToolsSetRequest",
15136
15136
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsSet_parameter_0$schema,
15137
15137
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_toolsSet_parameter_0$schema
15138
15138
  }
@@ -15140,14 +15140,14 @@ var TYPERT_REMOTE = {
15140
15140
  ],
15141
15141
  result: {
15142
15142
  mode: "strict",
15143
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerToolsSetResult",
15143
+ typeSymbol: "dsh-mcp/types#McpManagerToolsSetResult",
15144
15144
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsSet_result$schema,
15145
15145
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_toolsSet_result$schema
15146
15146
  },
15147
15147
  sourceLocation: { "file": "lib/index.js" }
15148
15148
  },
15149
15149
  {
15150
- id: "@deepseek-ai/dsh-mcp-manager#mcpManager/toolsMode",
15150
+ id: "dsh-mcp#mcpManager/toolsMode",
15151
15151
  service: "mcpManager",
15152
15152
  namespace: "mcpManager",
15153
15153
  method: "toolsMode",
@@ -15159,7 +15159,7 @@ var TYPERT_REMOTE = {
15159
15159
  source: "json",
15160
15160
  codec: {
15161
15161
  mode: "strict",
15162
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerToolsModeRequest",
15162
+ typeSymbol: "dsh-mcp/types#McpManagerToolsModeRequest",
15163
15163
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsMode_parameter_0$schema,
15164
15164
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_toolsMode_parameter_0$schema
15165
15165
  }
@@ -15167,14 +15167,14 @@ var TYPERT_REMOTE = {
15167
15167
  ],
15168
15168
  result: {
15169
15169
  mode: "strict",
15170
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerToolsModeResult",
15170
+ typeSymbol: "dsh-mcp/types#McpManagerToolsModeResult",
15171
15171
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsMode_result$schema,
15172
15172
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_toolsMode_result$schema
15173
15173
  },
15174
15174
  sourceLocation: { "file": "lib/index.js" }
15175
15175
  },
15176
15176
  {
15177
- id: "@deepseek-ai/dsh-mcp-manager#mcpManager/envList",
15177
+ id: "dsh-mcp#mcpManager/envList",
15178
15178
  service: "mcpManager",
15179
15179
  namespace: "mcpManager",
15180
15180
  method: "envList",
@@ -15182,14 +15182,14 @@ var TYPERT_REMOTE = {
15182
15182
  parameters: [],
15183
15183
  result: {
15184
15184
  mode: "strict",
15185
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerEnvListResult",
15185
+ typeSymbol: "dsh-mcp/types#McpManagerEnvListResult",
15186
15186
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_envList_result$schema,
15187
15187
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_envList_result$schema
15188
15188
  },
15189
15189
  sourceLocation: { "file": "lib/index.js" }
15190
15190
  },
15191
15191
  {
15192
- id: "@deepseek-ai/dsh-mcp-manager#mcpManager/envSet",
15192
+ id: "dsh-mcp#mcpManager/envSet",
15193
15193
  service: "mcpManager",
15194
15194
  namespace: "mcpManager",
15195
15195
  method: "envSet",
@@ -15201,7 +15201,7 @@ var TYPERT_REMOTE = {
15201
15201
  source: "json",
15202
15202
  codec: {
15203
15203
  mode: "strict",
15204
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerEnvSetRequest",
15204
+ typeSymbol: "dsh-mcp/types#McpManagerEnvSetRequest",
15205
15205
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_parameter_0$schema,
15206
15206
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_parameter_0$schema
15207
15207
  }
@@ -15209,14 +15209,14 @@ var TYPERT_REMOTE = {
15209
15209
  ],
15210
15210
  result: {
15211
15211
  mode: "strict",
15212
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerEnvSetResult",
15212
+ typeSymbol: "dsh-mcp/types#McpManagerEnvSetResult",
15213
15213
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_result$schema,
15214
15214
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_result$schema
15215
15215
  },
15216
15216
  sourceLocation: { "file": "lib/index.js" }
15217
15217
  },
15218
15218
  {
15219
- id: "@deepseek-ai/dsh-mcp-manager#mcpManager/adopt",
15219
+ id: "dsh-mcp#mcpManager/adopt",
15220
15220
  service: "mcpManager",
15221
15221
  namespace: "mcpManager",
15222
15222
  method: "adopt",
@@ -15228,7 +15228,7 @@ var TYPERT_REMOTE = {
15228
15228
  source: "json",
15229
15229
  codec: {
15230
15230
  mode: "strict",
15231
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerAdoptRequest",
15231
+ typeSymbol: "dsh-mcp/types#McpManagerAdoptRequest",
15232
15232
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_adopt_parameter_0$schema,
15233
15233
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_adopt_parameter_0$schema
15234
15234
  }
@@ -15236,14 +15236,14 @@ var TYPERT_REMOTE = {
15236
15236
  ],
15237
15237
  result: {
15238
15238
  mode: "strict",
15239
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerAdoptResult",
15239
+ typeSymbol: "dsh-mcp/types#McpManagerAdoptResult",
15240
15240
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_adopt_result$schema,
15241
15241
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_adopt_result$schema
15242
15242
  },
15243
15243
  sourceLocation: { "file": "lib/index.js" }
15244
15244
  },
15245
15245
  {
15246
- id: "@deepseek-ai/dsh-mcp-manager#mcpManager/release",
15246
+ id: "dsh-mcp#mcpManager/release",
15247
15247
  service: "mcpManager",
15248
15248
  namespace: "mcpManager",
15249
15249
  method: "release",
@@ -15255,7 +15255,7 @@ var TYPERT_REMOTE = {
15255
15255
  source: "json",
15256
15256
  codec: {
15257
15257
  mode: "strict",
15258
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerReleaseRequest",
15258
+ typeSymbol: "dsh-mcp/types#McpManagerReleaseRequest",
15259
15259
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_release_parameter_0$schema,
15260
15260
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_release_parameter_0$schema
15261
15261
  }
@@ -15263,14 +15263,14 @@ var TYPERT_REMOTE = {
15263
15263
  ],
15264
15264
  result: {
15265
15265
  mode: "strict",
15266
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerReleaseResult",
15266
+ typeSymbol: "dsh-mcp/types#McpManagerReleaseResult",
15267
15267
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_release_result$schema,
15268
15268
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_release_result$schema
15269
15269
  },
15270
15270
  sourceLocation: { "file": "lib/index.js" }
15271
15271
  },
15272
15272
  {
15273
- id: "@deepseek-ai/dsh-mcp-manager#mcpManager/oauthStart",
15273
+ id: "dsh-mcp#mcpManager/oauthStart",
15274
15274
  service: "mcpManager",
15275
15275
  namespace: "mcpManager",
15276
15276
  method: "oauthStart",
@@ -15282,7 +15282,7 @@ var TYPERT_REMOTE = {
15282
15282
  source: "json",
15283
15283
  codec: {
15284
15284
  mode: "strict",
15285
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerOAuthStartRequest",
15285
+ typeSymbol: "dsh-mcp/types#McpManagerOAuthStartRequest",
15286
15286
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStart_parameter_0$schema,
15287
15287
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStart_parameter_0$schema
15288
15288
  }
@@ -15290,14 +15290,14 @@ var TYPERT_REMOTE = {
15290
15290
  ],
15291
15291
  result: {
15292
15292
  mode: "strict",
15293
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerOAuthStartResult",
15293
+ typeSymbol: "dsh-mcp/types#McpManagerOAuthStartResult",
15294
15294
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStart_result$schema,
15295
15295
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStart_result$schema
15296
15296
  },
15297
15297
  sourceLocation: { "file": "lib/index.js" }
15298
15298
  },
15299
15299
  {
15300
- id: "@deepseek-ai/dsh-mcp-manager#mcpManager/oauthStatus",
15300
+ id: "dsh-mcp#mcpManager/oauthStatus",
15301
15301
  service: "mcpManager",
15302
15302
  namespace: "mcpManager",
15303
15303
  method: "oauthStatus",
@@ -15309,7 +15309,7 @@ var TYPERT_REMOTE = {
15309
15309
  source: "json",
15310
15310
  codec: {
15311
15311
  mode: "strict",
15312
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerOAuthStatusRequest",
15312
+ typeSymbol: "dsh-mcp/types#McpManagerOAuthStatusRequest",
15313
15313
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStatus_parameter_0$schema,
15314
15314
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStatus_parameter_0$schema
15315
15315
  }
@@ -15317,7 +15317,7 @@ var TYPERT_REMOTE = {
15317
15317
  ],
15318
15318
  result: {
15319
15319
  mode: "strict",
15320
- typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerOAuthStatusResult",
15320
+ typeSymbol: "dsh-mcp/types#McpManagerOAuthStatusResult",
15321
15321
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStatus_result$schema,
15322
15322
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStatus_result$schema
15323
15323
  },
package/lib/index.js CHANGED
@@ -8,6 +8,7 @@ import { probeConnection } from "./probe.js";
8
8
  import { Remote, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
9
9
  import { hostText } from "./host-locales.js";
10
10
  import { applyToolControl } from "./tool-assembly.js";
11
+ import { installAdmissionGate, shouldAdmitTool } from "./tool-admission.js";
11
12
  import { readDeclaredServers, toMirrorRecord } from "./cordis-servers.js";
12
13
  import { managedIds, writeManagedIds } from "./patch-writer.js";
13
14
  import z from "@deepseek-ai/schemastery";
@@ -624,6 +625,19 @@ let McpManagerService = (() => {
624
625
  /** LRU bound for {@link hotTools}. */
625
626
  static HOT_LIMIT = 60;
626
627
  /**
628
+ * Restores the patched `ctx.tools.register`; set only on cores that expose
629
+ * the per-step admission seam (DSH ≥ 0.2.2, see lib/tool-admission.js).
630
+ */
631
+ disposeAdmissionGate;
632
+ /** Whether the adapter's registration gate is enforcing switches and `search` mode. */
633
+ admissionGateInstalled = false;
634
+ /**
635
+ * Set once a `system-prompt/assemble` payload arrives without a tool list,
636
+ * i.e. the core moved admission outside the waterfall. Distinguishes "the
637
+ * gate carries this core" from "nothing filters here".
638
+ */
639
+ assembleSeamBlocked = false;
640
+ /**
627
641
  * @param ctx - Host context carrying storage, credentials, and the tool registry.
628
642
  * @param config - Resolved manager configuration.
629
643
  */
@@ -1893,12 +1907,41 @@ let McpManagerService = (() => {
1893
1907
  return s;
1894
1908
  }
1895
1909
  /**
1896
- * Register the `mcp_tool_search` model tool and the injection-layer
1897
- * hooks: per-tool disable filtering plus search-mode hot-tool injection,
1898
- * both inside the `system-prompt/assemble` waterfall (no agent-loop
1899
- * change), and hot-set tracking on real tool calls.
1910
+ * Register the `mcp_tool_search` model tool and the two seams that decide
1911
+ * which MCP tools the model sees: a registration-time admission gate for
1912
+ * cores that resolve tools per step (DSH ≥ 0.2.2) and the
1913
+ * `system-prompt/assemble` transform for cores that still hand the tool
1914
+ * list to the waterfall (≤ 0.2.1). Also tracks the hot set on real calls.
1915
+ *
1916
+ * The gate is installed first, and synchronously: `reconcileDeclared()`
1917
+ * mounts servers asynchronously, so wrapping before this point catches
1918
+ * every registration a mount will make.
1900
1919
  */
1901
1920
  installToolControl() {
1921
+ // DSH ≥ 0.2.2 builds the model-facing list from a per-step admission
1922
+ // set, so filtering inside `system-prompt/assemble` has nothing to
1923
+ // filter (the hook never receives `tools`). Declaring `when` at
1924
+ // registration time is the seam that still works, and it is what makes
1925
+ // `search` mode save tokens again instead of injecting all 300+ tools.
1926
+ this.disposeAdmissionGate = installAdmissionGate(this.ctx.tools, (name) => shouldAdmitTool(name, {
1927
+ toolMode: this.toolMode,
1928
+ toolSwitches: this.toolSwitches,
1929
+ hotTools: this.hotTools
1930
+ }));
1931
+ this.admissionGateInstalled = typeof this.disposeAdmissionGate === "function";
1932
+ if (this.admissionGateInstalled) {
1933
+ const disposeGate = this.disposeAdmissionGate;
1934
+ this.ctx.effect(() => () => {
1935
+ this.admissionGateInstalled = false;
1936
+ this.disposeAdmissionGate = undefined;
1937
+ disposeGate();
1938
+ }, "mcp-manager.admissionGate");
1939
+ // A tool registered before this point keeps the old (unconditional)
1940
+ // registration; surface it rather than silently mixing behaviours.
1941
+ // At boot the count is zero because mounts have not resolved yet.
1942
+ const preRegistered = this.toolSnapshot().length;
1943
+ if (preRegistered > 0) this.ctx.logger?.warn?.(`mcp-manager: ${preRegistered} MCP tool(s) registered before the admission gate; they stay unconditionally visible until their server remounts`);
1944
+ }
1902
1945
  this.ctx.tools.register({
1903
1946
  name: "mcp_tool_search",
1904
1947
  description: hostText(this.ctx, "toolSearchDesc"),
@@ -1953,10 +1996,12 @@ let McpManagerService = (() => {
1953
1996
  }
1954
1997
  });
1955
1998
  this.ctx.on("system-prompt/assemble", (assembly, _context, next) => {
1956
- // DSH ≥ 0.2.2 attaches the tool list *after* this waterfall, so
1957
- // `assembly.tools` is absent here. Reading it unconditionally threw
1958
- // `assembly.tools is not iterable` on every turn and killed the
1959
- // whole pre-step assembly; degrade to a no-op and say so once.
1999
+ // Cores ≤ 0.2.1 hand the tool list to this waterfall; filter it here.
2000
+ // Cores ≥ 0.2.2 attach the list after the waterfall, so `assembly`
2001
+ // carries none — the admission gate above is what filters there. Never
2002
+ // read `assembly.tools` unconditionally: doing that threw
2003
+ // `assembly.tools is not iterable` on every turn and killed the whole
2004
+ // pre-step assembly (issue #22).
1960
2005
  const applied = applyToolControl(assembly, {
1961
2006
  toolSwitches: this.toolSwitches,
1962
2007
  toolMode: this.toolMode,
@@ -1964,9 +2009,13 @@ let McpManagerService = (() => {
1964
2009
  serverOf: (name) => this.serverOf(name),
1965
2010
  promptText: (key, vars) => hostText(this.ctx, key, vars)
1966
2011
  });
1967
- if (!applied && !this.assembleToolsUnavailableLogged) {
1968
- this.assembleToolsUnavailableLogged = true;
1969
- this.ctx.logger?.warn?.("mcp-manager: system-prompt/assemble carries no tool list (DSH >= 0.2.2 moves tools outside this waterfall) — per-tool switches and search-mode injection stay inactive on this core");
2012
+ if (!applied) {
2013
+ this.assembleSeamBlocked = true;
2014
+ if (!this.assembleToolsUnavailableLogged) {
2015
+ this.assembleToolsUnavailableLogged = true;
2016
+ if (this.admissionGateInstalled) this.ctx.logger?.info?.("mcp-manager: system-prompt/assemble carries no tool list (DSH >= 0.2.2) — per-tool switches and search mode are enforced at registration time through the admission `when` hook");
2017
+ else this.ctx.logger?.warn?.("mcp-manager: system-prompt/assemble carries no tool list and this core exposes no admission hook — per-tool switches and search mode are inactive on this core");
2018
+ }
1970
2019
  }
1971
2020
  return next();
1972
2021
  });
@@ -1990,7 +2039,14 @@ let McpManagerService = (() => {
1990
2039
  ok: true,
1991
2040
  tools,
1992
2041
  mode: this.toolMode,
1993
- hotSize: this.hotTools.size
2042
+ hotSize: this.hotTools.size,
2043
+ /**
2044
+ * How this core enforces `mode` and the per-tool switches: `admission`
2045
+ * (declared at registration, resolved per step — DSH ≥ 0.2.2),
2046
+ * `waterfall` (filtered inside `system-prompt/assemble` — ≤ 0.2.1), or
2047
+ * `unavailable` (neither seam exists, so the stored config is inert).
2048
+ */
2049
+ enforcement: this.admissionGateInstalled ? "admission" : this.assembleSeamBlocked ? "unavailable" : "waterfall"
1994
2050
  };
1995
2051
  }
1996
2052
  /**
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Registration-time admission gate: search mode and per-tool switches on the
3
+ * DSH cores that filter tools *before* the system prompt is built.
4
+ *
5
+ * Why this exists
6
+ * ---------------
7
+ * DSH ≤ 0.2.1 handed `system-prompt/assemble` an assembly with `tools` already
8
+ * attached, so `lib/tool-assembly.js` could filter that list in the waterfall.
9
+ *
10
+ * DSH ≥ 0.2.2 does not: `@deepseek-ai/dsh-tools` publishes the model-facing
11
+ * tool list through a `systemPrompt.tools()` contributor built from a
12
+ * **per-step admission set** (`tools.resolve()` → `registration.when(context)`),
13
+ * and the waterfall runs without a tool list. Filtering an already-built list
14
+ * therefore cannot work — a tool outside the admission set never reaches the
15
+ * prompt, and a tool inside it cannot be removed afterwards.
16
+ *
17
+ * The only seam that still carries a decision is the registration itself:
18
+ * `register(definition, { when })` stores a condition that `resolve()` evaluates
19
+ * once per step. So the plugin declares `when` at registration time and lets the
20
+ * core do the admission — which is also cheaper, because the model never sees
21
+ * the tool it was not admitted for.
22
+ *
23
+ * Bare core compatibility: `register` on ≤ 0.2.1 takes a single argument and
24
+ * ignores the extra one, so the waterfall transform in `tool-assembly.js` keeps
25
+ * working there untouched. This gate is installed only when the core actually
26
+ * exposes the admission seam (`tools.resolve`).
27
+ * @module dsh-mcp/tool-admission
28
+ */
29
+
30
+ /** Marks one wrapper as this plugin's gate, so a reload cannot stack a second. */
31
+ const GATE_MARK = Symbol.for("dsh-mcp.admission-gate");
32
+
33
+ /**
34
+ * Whether one MCP tool may enter a step's model-facing tool set.
35
+ *
36
+ * - a switched-off tool is never admitted;
37
+ * - `search` mode admits only the hot set (recently searched or called) plus
38
+ * whatever `mcp_tool_search` injected for the next step;
39
+ * - `full` mode admits every tool that is not switched off.
40
+ *
41
+ * The hot set is read live: `when` is evaluated per step, so a tool that
42
+ * `mcp_tool_search` just recorded becomes admissible on the very next step.
43
+ * @param {string} name - public tool name (`mcp__<server>__<tool>`).
44
+ * @param {object} state - live plugin state.
45
+ * @param {string} state.toolMode - `search` or `full`.
46
+ * @param {Map<string, boolean>} state.toolSwitches - public name → enabled.
47
+ * @param {Map<string, number>} state.hotTools - the resident/hot tool names.
48
+ * @returns {boolean} whether the tool may be shown to the model this step.
49
+ */
50
+ export function shouldAdmitTool(name, state) {
51
+ const { toolMode, toolSwitches, hotTools } = state;
52
+ if (toolSwitches.get(name) === false) return false;
53
+ if (toolMode === "search") return hotTools.has(name);
54
+ return true;
55
+ }
56
+
57
+ /**
58
+ * Install the admission gate on a tool registry, or report that this core does
59
+ * not need it.
60
+ *
61
+ * Every `mcp__*` registration is wrapped so the core receives a `when`
62
+ * condition built from `isAdmitted`. A caller-supplied `when` is preserved and
63
+ * still wins: the plugin's admission is ANDed after it, never in front of it.
64
+ * Registrations outside the `mcp__` namespace — notably `mcp_tool_search`
65
+ * itself, which must stay callable to admit anything at all — pass through
66
+ * untouched.
67
+ *
68
+ * @param {object} tools - the core's `tools` service (`ctx.tools`).
69
+ * @param {(name: string) => boolean} isAdmitted - live admission decision.
70
+ * @returns {(() => void) | undefined} a disposer restoring the original
71
+ * `register`, or `undefined` when this core has no admission seam (in which
72
+ * case the waterfall transform remains the only filter and nothing is
73
+ * monkey-patched).
74
+ */
75
+ export function installAdmissionGate(tools, isAdmitted) {
76
+ if (tools === null || typeof tools !== "object") return undefined;
77
+ if (typeof tools.register !== "function") return undefined;
78
+ // `tools.resolve()` is the per-step admission pass introduced with the
79
+ // `when` option; without it the extra argument would be dead weight and the
80
+ // waterfall transform is still the working path.
81
+ if (typeof tools.resolve !== "function") return undefined;
82
+ if (tools.register[GATE_MARK] === true) return () => {};
83
+
84
+ const original = tools.register;
85
+ const hadOwnRegister = Object.prototype.hasOwnProperty.call(tools, "register");
86
+
87
+ const gate = function registerWithAdmission(definition, options) {
88
+ const name = definition !== null && typeof definition === "object" && typeof definition.name === "string"
89
+ ? definition.name
90
+ : undefined;
91
+ if (name === undefined || !name.startsWith("mcp__")) {
92
+ return original.call(this, definition, options);
93
+ }
94
+ const base = options !== null && typeof options === "object" ? options : {};
95
+ const callerWhen = base.when;
96
+ const when = typeof callerWhen === "function"
97
+ ? async (context) => (await callerWhen(context)) && isAdmitted(name)
98
+ : () => isAdmitted(name);
99
+ return original.call(this, definition, { ...base, when });
100
+ };
101
+ gate[GATE_MARK] = true;
102
+ tools.register = gate;
103
+
104
+ return () => {
105
+ // Only undo our own patch: a later plugin may have wrapped register in
106
+ // turn, and deleting their wrapper would re-open the admission hole.
107
+ if (tools.register !== gate) return;
108
+ if (hadOwnRegister) tools.register = original;
109
+ else delete tools.register;
110
+ };
111
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-mcp",
3
- "version": "1.15.0",
3
+ "version": "1.15.2",
4
4
  "description": "MCP 管理界面 + tool search:可视化配置/启停/刷新 MCP 服务器与工具勾选,按需检索(tool search)热注入;工具列表稳定命中缓存、不撑爆上下文。DeepSeek Harness plugin: MCP management UI + tool search — stable tool list, cache-friendly, no context bloat.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -41,7 +41,7 @@
41
41
  "url": "https://github.com/ArvinQi/dsh-mcp/issues"
42
42
  },
43
43
  "dsh": {
44
- "supported": "0.2.0-rc.2",
44
+ "supported": "0.2.2-rc.3",
45
45
  "bundle": {
46
46
  "patch": "./cordis.patch.yml"
47
47
  },
@@ -1,4 +1,20 @@
1
- /* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel.
2
+ *
3
+ * The declared Remote package id is `dsh-mcp` (this plugin's own package name),
4
+ * NOT the `@deepseek-ai/dsh-mcp-manager` id the generator originally emitted.
5
+ * DSH >= 0.2.2-rc.2 ships an official `@deepseek-ai/dsh-mcp-manager` whose client
6
+ * bundle mounts a Remote contribution under that exact package name, and the
7
+ * client typert registry keeps one owner per package name — mounting ours as
8
+ * well throws `typert: Remote package "@deepseek-ai/dsh-mcp-manager" is already
9
+ * registered` and leaves the plugin unusable (issue #24).
10
+ *
11
+ * Renaming is safe because a package id is only an ownership/dedupe key: an
12
+ * invocation is routed by endpoint `namespace/method` (`typertEndpoint()` in
13
+ * @deepseek-ai/dsh-typert-registry), which our `mcpManager/*` endpoints keep.
14
+ * The official manager declares only `mcpManager/probe|restart|watch`, so the
15
+ * endpoint sets do not overlap either. Rename these ids back only together with
16
+ * a re-generated FaceModel that carries a unique package name.
17
+ */
2
18
  import { z } from 'zod'
3
19
 
4
20
  const _deepseek_ai_dsh_mcp_manager_mcpManager_delete_parameter_0$schema = z.object({
@@ -441,10 +457,10 @@ const _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStatus_result$schema = z.unio
441
457
  })])
442
458
 
443
459
  export const TYPERT_REMOTE = {
444
- package: '@deepseek-ai/dsh-mcp-manager',
460
+ package: 'dsh-mcp',
445
461
  descriptors: [
446
462
  {
447
- id: '@deepseek-ai/dsh-mcp-manager#mcpManager/delete',
463
+ id: 'dsh-mcp#mcpManager/delete',
448
464
  service: 'mcpManager',
449
465
  namespace: 'mcpManager',
450
466
  method: 'delete',
@@ -456,7 +472,7 @@ export const TYPERT_REMOTE = {
456
472
  source: 'json',
457
473
  codec: {
458
474
  mode: 'strict',
459
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerRemoveRequest',
475
+ typeSymbol: 'dsh-mcp/types#McpManagerRemoveRequest',
460
476
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_delete_parameter_0$schema,
461
477
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_delete_parameter_0$schema,
462
478
  },
@@ -464,14 +480,14 @@ export const TYPERT_REMOTE = {
464
480
  ],
465
481
  result: {
466
482
  mode: 'strict',
467
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerRemoveResult',
483
+ typeSymbol: 'dsh-mcp/types#McpManagerRemoveResult',
468
484
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_delete_result$schema,
469
485
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_delete_result$schema,
470
486
  },
471
487
  sourceLocation: {"file":"packages/mcp/mcp-manager/src/index.ts","line":399,"column":9},
472
488
  },
473
489
  {
474
- id: '@deepseek-ai/dsh-mcp-manager#mcpManager/list',
490
+ id: 'dsh-mcp#mcpManager/list',
475
491
  service: 'mcpManager',
476
492
  namespace: 'mcpManager',
477
493
  method: 'list',
@@ -480,14 +496,14 @@ export const TYPERT_REMOTE = {
480
496
  ],
481
497
  result: {
482
498
  mode: 'strict',
483
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerListResult',
499
+ typeSymbol: 'dsh-mcp/types#McpManagerListResult',
484
500
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_list_result$schema,
485
501
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_list_result$schema,
486
502
  },
487
503
  sourceLocation: {"file":"packages/mcp/mcp-manager/src/index.ts","line":314,"column":9},
488
504
  },
489
505
  {
490
- id: '@deepseek-ai/dsh-mcp-manager#mcpManager/test',
506
+ id: 'dsh-mcp#mcpManager/test',
491
507
  service: 'mcpManager',
492
508
  namespace: 'mcpManager',
493
509
  method: 'test',
@@ -499,7 +515,7 @@ export const TYPERT_REMOTE = {
499
515
  source: 'json',
500
516
  codec: {
501
517
  mode: 'strict',
502
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerTestRequest',
518
+ typeSymbol: 'dsh-mcp/types#McpManagerTestRequest',
503
519
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_test_parameter_0$schema,
504
520
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_test_parameter_0$schema,
505
521
  },
@@ -507,14 +523,14 @@ export const TYPERT_REMOTE = {
507
523
  ],
508
524
  result: {
509
525
  mode: 'strict',
510
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerTestResult',
526
+ typeSymbol: 'dsh-mcp/types#McpManagerTestResult',
511
527
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_test_result$schema,
512
528
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_test_result$schema,
513
529
  },
514
530
  sourceLocation: {"file":"packages/mcp/mcp-manager/src/index.ts","line":422,"column":9},
515
531
  },
516
532
  {
517
- id: '@deepseek-ai/dsh-mcp-manager#mcpManager/upsert',
533
+ id: 'dsh-mcp#mcpManager/upsert',
518
534
  service: 'mcpManager',
519
535
  namespace: 'mcpManager',
520
536
  method: 'upsert',
@@ -526,7 +542,7 @@ export const TYPERT_REMOTE = {
526
542
  source: 'json',
527
543
  codec: {
528
544
  mode: 'strict',
529
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerUpsertRequest',
545
+ typeSymbol: 'dsh-mcp/types#McpManagerUpsertRequest',
530
546
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_parameter_0$schema,
531
547
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_parameter_0$schema,
532
548
  },
@@ -534,14 +550,14 @@ export const TYPERT_REMOTE = {
534
550
  ],
535
551
  result: {
536
552
  mode: 'strict',
537
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerUpsertResult',
553
+ typeSymbol: 'dsh-mcp/types#McpManagerUpsertResult',
538
554
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_result$schema,
539
555
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_result$schema,
540
556
  },
541
557
  sourceLocation: {"file":"packages/mcp/mcp-manager/src/index.ts","line":329,"column":9},
542
558
  },
543
559
  {
544
- id: '@deepseek-ai/dsh-mcp-manager#mcpManager/upsertJson',
560
+ id: 'dsh-mcp#mcpManager/upsertJson',
545
561
  service: 'mcpManager',
546
562
  namespace: 'mcpManager',
547
563
  method: 'upsertJson',
@@ -553,7 +569,7 @@ export const TYPERT_REMOTE = {
553
569
  source: 'json',
554
570
  codec: {
555
571
  mode: 'strict',
556
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerUpsertJsonRequest',
572
+ typeSymbol: 'dsh-mcp/types#McpManagerUpsertJsonRequest',
557
573
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_parameter_0$schema,
558
574
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_parameter_0$schema,
559
575
  },
@@ -561,14 +577,14 @@ export const TYPERT_REMOTE = {
561
577
  ],
562
578
  result: {
563
579
  mode: 'strict',
564
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerUpsertJsonResult',
580
+ typeSymbol: 'dsh-mcp/types#McpManagerUpsertJsonResult',
565
581
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_result$schema,
566
582
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_result$schema,
567
583
  },
568
584
  sourceLocation: {"file":"lib/index.js"},
569
585
  },
570
586
  {
571
- id: '@deepseek-ai/dsh-mcp-manager#mcpManager/toolsList',
587
+ id: 'dsh-mcp#mcpManager/toolsList',
572
588
  service: 'mcpManager',
573
589
  namespace: 'mcpManager',
574
590
  method: 'toolsList',
@@ -577,14 +593,14 @@ export const TYPERT_REMOTE = {
577
593
  ],
578
594
  result: {
579
595
  mode: 'strict',
580
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerToolsListResult',
596
+ typeSymbol: 'dsh-mcp/types#McpManagerToolsListResult',
581
597
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsList_result$schema,
582
598
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_toolsList_result$schema,
583
599
  },
584
600
  sourceLocation: {"file":"lib/index.js"},
585
601
  },
586
602
  {
587
- id: '@deepseek-ai/dsh-mcp-manager#mcpManager/toolsSet',
603
+ id: 'dsh-mcp#mcpManager/toolsSet',
588
604
  service: 'mcpManager',
589
605
  namespace: 'mcpManager',
590
606
  method: 'toolsSet',
@@ -596,7 +612,7 @@ export const TYPERT_REMOTE = {
596
612
  source: 'json',
597
613
  codec: {
598
614
  mode: 'strict',
599
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerToolsSetRequest',
615
+ typeSymbol: 'dsh-mcp/types#McpManagerToolsSetRequest',
600
616
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsSet_parameter_0$schema,
601
617
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_toolsSet_parameter_0$schema,
602
618
  },
@@ -604,14 +620,14 @@ export const TYPERT_REMOTE = {
604
620
  ],
605
621
  result: {
606
622
  mode: 'strict',
607
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerToolsSetResult',
623
+ typeSymbol: 'dsh-mcp/types#McpManagerToolsSetResult',
608
624
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsSet_result$schema,
609
625
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_toolsSet_result$schema,
610
626
  },
611
627
  sourceLocation: {"file":"lib/index.js"},
612
628
  },
613
629
  {
614
- id: '@deepseek-ai/dsh-mcp-manager#mcpManager/toolsMode',
630
+ id: 'dsh-mcp#mcpManager/toolsMode',
615
631
  service: 'mcpManager',
616
632
  namespace: 'mcpManager',
617
633
  method: 'toolsMode',
@@ -623,7 +639,7 @@ export const TYPERT_REMOTE = {
623
639
  source: 'json',
624
640
  codec: {
625
641
  mode: 'strict',
626
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerToolsModeRequest',
642
+ typeSymbol: 'dsh-mcp/types#McpManagerToolsModeRequest',
627
643
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsMode_parameter_0$schema,
628
644
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_toolsMode_parameter_0$schema,
629
645
  },
@@ -631,14 +647,14 @@ export const TYPERT_REMOTE = {
631
647
  ],
632
648
  result: {
633
649
  mode: 'strict',
634
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerToolsModeResult',
650
+ typeSymbol: 'dsh-mcp/types#McpManagerToolsModeResult',
635
651
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsMode_result$schema,
636
652
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_toolsMode_result$schema,
637
653
  },
638
654
  sourceLocation: {"file":"lib/index.js"},
639
655
  },
640
656
  {
641
- id: '@deepseek-ai/dsh-mcp-manager#mcpManager/envList',
657
+ id: 'dsh-mcp#mcpManager/envList',
642
658
  service: 'mcpManager',
643
659
  namespace: 'mcpManager',
644
660
  method: 'envList',
@@ -647,14 +663,14 @@ export const TYPERT_REMOTE = {
647
663
  ],
648
664
  result: {
649
665
  mode: 'strict',
650
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerEnvListResult',
666
+ typeSymbol: 'dsh-mcp/types#McpManagerEnvListResult',
651
667
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_envList_result$schema,
652
668
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_envList_result$schema,
653
669
  },
654
670
  sourceLocation: {"file":"lib/index.js"},
655
671
  },
656
672
  {
657
- id: '@deepseek-ai/dsh-mcp-manager#mcpManager/envSet',
673
+ id: 'dsh-mcp#mcpManager/envSet',
658
674
  service: 'mcpManager',
659
675
  namespace: 'mcpManager',
660
676
  method: 'envSet',
@@ -666,7 +682,7 @@ export const TYPERT_REMOTE = {
666
682
  source: 'json',
667
683
  codec: {
668
684
  mode: 'strict',
669
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerEnvSetRequest',
685
+ typeSymbol: 'dsh-mcp/types#McpManagerEnvSetRequest',
670
686
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_parameter_0$schema,
671
687
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_parameter_0$schema,
672
688
  },
@@ -674,14 +690,14 @@ export const TYPERT_REMOTE = {
674
690
  ],
675
691
  result: {
676
692
  mode: 'strict',
677
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerEnvSetResult',
693
+ typeSymbol: 'dsh-mcp/types#McpManagerEnvSetResult',
678
694
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_result$schema,
679
695
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_result$schema,
680
696
  },
681
697
  sourceLocation: {"file":"lib/index.js"},
682
698
  },
683
699
  {
684
- id: '@deepseek-ai/dsh-mcp-manager#mcpManager/adopt',
700
+ id: 'dsh-mcp#mcpManager/adopt',
685
701
  service: 'mcpManager',
686
702
  namespace: 'mcpManager',
687
703
  method: 'adopt',
@@ -693,7 +709,7 @@ export const TYPERT_REMOTE = {
693
709
  source: 'json',
694
710
  codec: {
695
711
  mode: 'strict',
696
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerAdoptRequest',
712
+ typeSymbol: 'dsh-mcp/types#McpManagerAdoptRequest',
697
713
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_adopt_parameter_0$schema,
698
714
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_adopt_parameter_0$schema,
699
715
  },
@@ -701,14 +717,14 @@ export const TYPERT_REMOTE = {
701
717
  ],
702
718
  result: {
703
719
  mode: 'strict',
704
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerAdoptResult',
720
+ typeSymbol: 'dsh-mcp/types#McpManagerAdoptResult',
705
721
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_adopt_result$schema,
706
722
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_adopt_result$schema,
707
723
  },
708
724
  sourceLocation: {"file":"lib/index.js"},
709
725
  },
710
726
  {
711
- id: '@deepseek-ai/dsh-mcp-manager#mcpManager/release',
727
+ id: 'dsh-mcp#mcpManager/release',
712
728
  service: 'mcpManager',
713
729
  namespace: 'mcpManager',
714
730
  method: 'release',
@@ -720,7 +736,7 @@ export const TYPERT_REMOTE = {
720
736
  source: 'json',
721
737
  codec: {
722
738
  mode: 'strict',
723
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerReleaseRequest',
739
+ typeSymbol: 'dsh-mcp/types#McpManagerReleaseRequest',
724
740
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_release_parameter_0$schema,
725
741
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_release_parameter_0$schema,
726
742
  },
@@ -728,14 +744,14 @@ export const TYPERT_REMOTE = {
728
744
  ],
729
745
  result: {
730
746
  mode: 'strict',
731
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerReleaseResult',
747
+ typeSymbol: 'dsh-mcp/types#McpManagerReleaseResult',
732
748
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_release_result$schema,
733
749
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_release_result$schema,
734
750
  },
735
751
  sourceLocation: {"file":"lib/index.js"},
736
752
  },
737
753
  {
738
- id: '@deepseek-ai/dsh-mcp-manager#mcpManager/oauthStart',
754
+ id: 'dsh-mcp#mcpManager/oauthStart',
739
755
  service: 'mcpManager',
740
756
  namespace: 'mcpManager',
741
757
  method: 'oauthStart',
@@ -747,7 +763,7 @@ export const TYPERT_REMOTE = {
747
763
  source: 'json',
748
764
  codec: {
749
765
  mode: 'strict',
750
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerOAuthStartRequest',
766
+ typeSymbol: 'dsh-mcp/types#McpManagerOAuthStartRequest',
751
767
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStart_parameter_0$schema,
752
768
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStart_parameter_0$schema,
753
769
  },
@@ -755,14 +771,14 @@ export const TYPERT_REMOTE = {
755
771
  ],
756
772
  result: {
757
773
  mode: 'strict',
758
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerOAuthStartResult',
774
+ typeSymbol: 'dsh-mcp/types#McpManagerOAuthStartResult',
759
775
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStart_result$schema,
760
776
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStart_result$schema,
761
777
  },
762
778
  sourceLocation: {"file":"lib/index.js"},
763
779
  },
764
780
  {
765
- id: '@deepseek-ai/dsh-mcp-manager#mcpManager/oauthStatus',
781
+ id: 'dsh-mcp#mcpManager/oauthStatus',
766
782
  service: 'mcpManager',
767
783
  namespace: 'mcpManager',
768
784
  method: 'oauthStatus',
@@ -774,7 +790,7 @@ export const TYPERT_REMOTE = {
774
790
  source: 'json',
775
791
  codec: {
776
792
  mode: 'strict',
777
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerOAuthStatusRequest',
793
+ typeSymbol: 'dsh-mcp/types#McpManagerOAuthStatusRequest',
778
794
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStatus_parameter_0$schema,
779
795
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStatus_parameter_0$schema,
780
796
  },
@@ -782,7 +798,7 @@ export const TYPERT_REMOTE = {
782
798
  ],
783
799
  result: {
784
800
  mode: 'strict',
785
- typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerOAuthStatusResult',
801
+ typeSymbol: 'dsh-mcp/types#McpManagerOAuthStatusResult',
786
802
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStatus_result$schema,
787
803
  create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_oauthStatus_result$schema,
788
804
  },