@xxxyz/dsh-mcp-manager 2.1.0 → 2.1.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/README.md CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  <!-- Hero -->
4
4
  <div align="center">
5
- <b style="font-size: 1.15em;">DeepSeek Harness 的 MCP 服务管理器:装没装、连没连、一页管完。</b><br /><br />
5
+ <b style="font-size: 1.15em;">DeepSeek Harness 的 MCP 服务与技能管理器:装没装、连没连、一页管完。</b><br /><br />
6
6
  <code>服务器列表</code> <code>新增 / 编辑 / 删除</code> <code>启用 / 停用</code> <code>重启</code> <code>工具数健康</code> <code>JSON 导出 / 导入</code><br />
7
- <code>4 个模型工具</code> <code>HTTP API</code> <code>dsh plugin 一条命令</code><br /><br />
8
- <b>设置 → MCP 管理</b> 管理项目级与全局 <code>cordis.patch.yml</code> 中的 <code>@deepseek-ai/dsh-mcp-client</code> 行——<br />
9
- 无需再手改配置文件,所有修改即改即生效(HMR 热应用),重启、升级后依然存在。
7
+ <code>Skills 浏览 / 搜索 / 停用</code> <code>4 个模型工具</code> <code>HTTP API</code> <code>dsh plugin 一条命令</code><br /><br />
8
+ <b>设置 → MCP 管理</b> 管理项目级与全局 <code>cordis.patch.yml</code> 中的 <code>@deepseek-ai/dsh-mcp-client</code> 行,<br />
9
+ <b>设置 → Skills 管理</b> 浏览并停用各来源的技能——无需再手改配置文件,所有修改即改即生效(HMR 热应用),重启、升级后依然存在。
10
10
  </div>
11
11
 
12
12
  <div align="center">
@@ -42,6 +42,7 @@
42
42
  - **🩺 健康检查**:每台服务器实时工具数与 loader 阶段,异常一目了然
43
43
  - **📦 备份 / 恢复**:JSON 导出 / 导入,合并新增、已存在自动跳过
44
44
  - **🤖 模型工具**:宿主注册 4 个 `mcp_manager_*` 工具,模型可直接查询与操作 MCP 服务
45
+ - **🧠 技能管理**:**设置 → Skills 管理** 页列出 DSH 全部技能,按来源分组(项目级 / 运行时 / 自定义 / 用户级 / 内置 / 插件自带)并支持搜索与按 provider 折叠;一键停用 / 启用任意技能(rank-0 override provider,任何来源层级都可禁),状态持久化到 `dsh-skill-manager.json`,HMR 即时生效
45
46
  - **🌐 HTTP API**:`POST /dsh-mcp-manager/api`(JSON `{op, args}` → `{ok, ...}`),供客户端与脚本调用。带跨站(CSRF)防护:仅接受 POST、必须携带 `x-dsh-plugin: dsh-mcp-manager` 请求头、校验同源 Origin(curl 等本地脚本无需 Origin)
46
47
  - **📦 一键安装**:`dsh plugin --profile web add` 一条命令装包 + 自动挂载(Windows / macOS / Linux)
47
48
 
@@ -112,6 +113,12 @@ dsh plugin --profile web remove @xxxyz/dsh-mcp-manager
112
113
  - **备份 / 恢复**:一键导出 JSON,或粘贴 JSON 导入(合并新增,已存在自动跳过)。
113
114
  - 页面底部显示正在编辑的补丁文件路径。
114
115
 
116
+ 打开 **设置 → Skills 管理**:
117
+
118
+ - **浏览 / 搜索**:列出 DSH 全部技能,按来源分组(项目级 / 运行时 / 自定义 / 用户级 / 内置 / 插件自带),组内按 provider 折叠;搜索框实时过滤。
119
+ - **启用 / 停用**:一键切换任意技能的启用状态——通过 rank-0 override provider(`dsh-mcp-manager-override`)实现,任何来源层级(含项目级)都能禁用。
120
+ - **持久化**:停用状态写入 `<profileDir>/dsh-skill-manager.json`,重启后保留;改动经 HMR 即时生效。
121
+
115
122
  ## ⚙️ 配置
116
123
 
117
124
  插件自身在 loader 行中的配置:
package/README_EN.md CHANGED
@@ -2,11 +2,12 @@
2
2
 
3
3
  <!-- Hero -->
4
4
  <div align="center">
5
- <b style="font-size: 1.15em;">Manage every MCP server in DeepSeek Harness from one settings page — install, configure, monitor.</b><br /><br />
5
+ <b style="font-size: 1.15em;">Manage every MCP server and skill in DeepSeek Harness from one settings page — install, configure, monitor.</b><br /><br />
6
6
  <code>server list</code> <code>add / edit / delete</code> <code>enable / disable</code> <code>restart</code> <code>tool-count health</code> <code>JSON export / import</code><br />
7
- <code>4 model tools</code> <code>HTTP API</code> <code>dsh plugin one-command</code><br /><br />
7
+ <code>Skills browse / search / disable</code> <code>4 model tools</code> <code>HTTP API</code> <code>dsh plugin one-command</code><br /><br />
8
8
  <b>Settings → MCP 管理</b> manages <code>@deepseek-ai/dsh-mcp-client</code> rows in your project-level and
9
- global <code>cordis.patch.yml</code> no hand-editing, every change applies live via HMR, survives restarts and upgrades.
9
+ global <code>cordis.patch.yml</code>; <b>Settings Skills 管理</b> browses and disables skills from every
10
+ source — no hand-editing, every change applies live via HMR, survives restarts and upgrades.
10
11
  </div>
11
12
 
12
13
  <div align="center">
@@ -42,6 +43,7 @@
42
43
  - **🩺 Health check** — live tool counts and loader phase per server, problems visible at a glance
43
44
  - **📦 Backup / Restore** — JSON export / import; merges new entries, skips existing ones
44
45
  - **🤖 Model tools** — four `mcp_manager_*` tools registered on the host, so the model can query and manage MCP servers directly
46
+ - **🧠 Skill management** — the **Settings → Skills 管理** page lists every DSH skill grouped by source (project / runtime / custom / user / built-in / plugin-bundled) with search and per-provider collapse; enable / disable any skill in one click (rank-0 override provider, so every source level including project-level is disable-able), persisted to `dsh-skill-manager.json`, applied live via HMR
45
47
  - **🌐 HTTP API** — `POST /dsh-mcp-manager/api` (JSON `{op, args}` → `{ok, ...}`) for the client and scripts. Cross-site (CSRF) protected: POST-only, requires the `x-dsh-plugin: dsh-mcp-manager` request header, and checks the Origin is same-origin (local scripts without an Origin are fine)
46
48
  - **📦 One-command install** — `dsh plugin --profile web add` installs and mounts automatically (Windows / macOS / Linux)
47
49
 
@@ -112,6 +114,12 @@ Open **Settings → MCP 管理**:
112
114
  - **Backup / Restore**: export the configuration as JSON with one click, or paste JSON to import (merges new entries, skips existing ones).
113
115
  - The file path being edited is shown at the bottom of the page.
114
116
 
117
+ Open **Settings → Skills 管理**:
118
+
119
+ - **Browse / Search**: lists every DSH skill grouped by source (project / runtime / custom / user / built-in / plugin-bundled), collapsed per provider; the search box filters live.
120
+ - **Enable / Disable**: toggle any skill in one click — implemented with a rank-0 override provider (`dsh-mcp-manager-override`), so every source level (including project-level) can be disabled.
121
+ - **Persistence**: disabled state is written to `<profileDir>/dsh-skill-manager.json`, survives restarts, and applies live via HMR.
122
+
115
123
  ## ⚙️ Configuration
116
124
 
117
125
  Configuration of the plugin itself on its loader row:
package/lib/client.js CHANGED
@@ -50,7 +50,8 @@ const factory = (require) => {
50
50
  '.mcpm-dialog-actions{display:flex;justify-content:flex-end;gap:8px}' +
51
51
  '.skm-search{font-size:12px;padding:5px 8px;border-radius:6px;border:1px solid rgba(128,128,128,.5);background:transparent;color:inherit;width:100%;box-sizing:border-box}' +
52
52
  '.skm-group-title{font-size:12px;font-weight:600;opacity:.85;margin-top:4px;padding-bottom:2px;border-bottom:1px solid rgba(128,128,128,.25)}' +
53
- '.skm-provider-title{font-size:12px;font-weight:600;cursor:pointer;user-select:none;margin-top:4px;opacity:.9}'
53
+ '.skm-provider-title{font-size:12px;font-weight:600;cursor:pointer;user-select:none;margin-top:4px;opacity:.9}' +
54
+ '.mcpm-version{margin-left:8px;font-size:11px;font-weight:500;opacity:.55;letter-spacing:.3px;vertical-align:middle}'
54
55
 
55
56
  function ensureCss() {
56
57
  if (typeof document === 'undefined') return
@@ -74,6 +75,19 @@ const factory = (require) => {
74
75
  }).then((r) => r.json()).catch((e) => ({ ok: false, error: String((e && e.message) || e) }))
75
76
  }
76
77
 
78
+ // Small version badge shown next to each settings-page title; reads the
79
+ // package version from the host (plugin-version op) so it always matches
80
+ // the installed release.
81
+ function VersionBadge() {
82
+ const [v, setV] = React.useState(null)
83
+ React.useEffect(() => {
84
+ let alive = true
85
+ apiCall('plugin-version', {}).then((r) => { if (alive && r && r.ok) setV(r.version) }).catch(() => {})
86
+ return () => { alive = false }
87
+ }, [])
88
+ return v ? React.createElement('span', { className: 'mcpm-version' }, 'v' + v) : null
89
+ }
90
+
77
91
  module.exports = {
78
92
  name: 'dsh-mcp-manager-client',
79
93
  inject: ['timer'],
@@ -218,7 +232,7 @@ const factory = (require) => {
218
232
  }
219
233
 
220
234
  return React.createElement('div', { className: 'mcpm-wrap' },
221
- React.createElement('h2', null, 'MCP 服务管理'),
235
+ React.createElement('h2', null, 'MCP 服务管理', React.createElement(VersionBadge, null)),
222
236
  React.createElement('div', { className: 'mcpm-sub' },
223
237
  '管理 dsh-mcp-client 服务:写入 项目级(web profile) / 全局(home) 的 cordis.patch.yml,经 HMR 实时生效;重启 DSH 后由 Loader 自动加载。'),
224
238
  restartInfo && React.createElement('div', { className: 'mcpm-msg info' },
@@ -340,7 +354,7 @@ const factory = (require) => {
340
354
  const query = q.trim().toLowerCase()
341
355
  const visible = state.skills.filter((s) => !query || (s.name + ' ' + (s.description || '')).toLowerCase().includes(query))
342
356
  return React.createElement('div', { className: 'mcpm-wrap' },
343
- React.createElement('h2', null, 'Skills 管理'),
357
+ React.createElement('h2', null, 'Skills 管理', React.createElement(VersionBadge, null)),
344
358
  React.createElement('div', { className: 'mcpm-sub' }, '查看与启停 DSH 技能(按层级分组,禁用即时生效,无需重启)'),
345
359
  msg && React.createElement('div', { className: 'mcpm-msg ' + msg.kind }, msg.text),
346
360
  React.createElement('input', { className: 'skm-search', placeholder: '搜索技能名称或描述…', value: q, onChange: (e) => setQ(e.target.value) }),
package/lib/index.js CHANGED
@@ -11,6 +11,7 @@
11
11
  // Build: `tsc -p tsconfig.json` compiles this to lib/index.js (the shipped
12
12
  // artifact — same convention as DSH's own packages, which ship compiled JS).
13
13
  import { defineTool } from '@deepseek-ai/dsh-tools';
14
+ import { createRequire } from 'node:module';
14
15
  export default {
15
16
  name: 'dsh-mcp-manager-host',
16
17
  inject: ['timer', 'fs', 'settings', 'sandboxPolicy', 'webServer', 'tools', 'skills'],
@@ -22,6 +23,13 @@ export default {
22
23
  const tools = ctx.tools;
23
24
  // pluginInventory is optional: probe at use time, degrade to no live info.
24
25
  const pluginInventory = ctx.get('pluginInventory');
26
+ // Package version, surfaced in the Settings pages and the HTTP API. Read
27
+ // from the installed package.json so it always matches the release tag.
28
+ let PKG_VERSION = 'unknown';
29
+ try {
30
+ PKG_VERSION = createRequire(import.meta.url)('../package.json').version || 'unknown';
31
+ }
32
+ catch (e) { /* keep unknown */ }
25
33
  const wait = (ms) => ctx.timeout(ms);
26
34
  const message = (e) => String((e && e.message) || e);
27
35
  let writeChain = Promise.resolve();
@@ -626,6 +634,9 @@ export default {
626
634
  return { ok: true, row };
627
635
  }
628
636
  // ---------- ops ----------
637
+ async function pluginVersion() {
638
+ return { ok: true, version: PKG_VERSION };
639
+ }
629
640
  async function mcpmList() {
630
641
  const p = await ensurePaths();
631
642
  const rows = [];
@@ -948,6 +959,7 @@ export default {
948
959
  return String(text || '').split(/[\s,]+/).map((s) => s.trim()).filter((s) => s !== '');
949
960
  }
950
961
  const handlers = {
962
+ 'plugin-version': pluginVersion,
951
963
  'mcpm-list': mcpmList,
952
964
  'mcpm-add': mcpmAdd,
953
965
  'mcpm-edit': mcpmEdit,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xxxyz/dsh-mcp-manager",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "DSH-standard MCP manager plugin: Settings UI + HTTP API + model-facing mcp_manager_* tools. Install with one command: dsh plugin --profile web add @xxxyz/dsh-mcp-manager@latest",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -12,6 +12,7 @@
12
12
  "files": [
13
13
  "lib",
14
14
  "cordis.patch.yml",
15
+ "show.png",
15
16
  "README.md",
16
17
  "README_EN.md",
17
18
  "LICENSE"
package/show.png ADDED
Binary file