@fengguanghuai/dsh-capability-hub 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +132 -2
- package/README.zh-CN.md +92 -0
- package/client.js +3186 -0
- package/cordis.patch.yml +4 -0
- package/icon.svg +6 -0
- package/index.js +1699 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +54 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 fengguanghuai
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,133 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @fengguanghuai/dsh-capability-hub
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@fengguanghuai/dsh-capability-hub)
|
|
4
|
+
[](./LICENSE)
|
|
5
|
+
[](https://github.com/topics/dsh-plugin)
|
|
6
|
+
|
|
7
|
+
**English** | [简体中文](./README.zh-CN.md)
|
|
8
|
+
|
|
9
|
+
A unified capability hub for **DeepSeek Harness (DSH)** that lets you organize **Skills** and **MCP servers** into switchable suites, control per-session capability injection from the chat composer, and manage local skills end-to-end without cluttering your context window.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Preview
|
|
14
|
+
|
|
15
|
+
| Suites & Budget Overview | Skills Drawer & Per-Session Composer |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
|  |  |
|
|
18
|
+
|
|
19
|
+
## Key Features
|
|
20
|
+
|
|
21
|
+
- **Switchable Capability Suites**: Group related MCP servers and Skills into scenario suites (e.g., Office docs, architecture/artifacts, media workflows) and toggle them with one click.
|
|
22
|
+
- **Per-Session Injection (Composer Popover)**: Pick which suites are active for the **current session** directly from the chat composer without affecting global defaults or other sessions. Subagents inherit their parent session's active suites automatically.
|
|
23
|
+
- **Non-Destructive Skill Policy**: Override Skill invocation between `auto`, `manual` (`/skill`-only), and `muted` in memory—never dirtying `SKILL.md` files on disk.
|
|
24
|
+
- **Full Skill Lifecycle**:
|
|
25
|
+
- **Create / Paste**: Write or paste a `SKILL.md` (with automatic frontmatter parsing) into user (`~/.agents/skills`, `~/.dsh/skills`) or project (`.agents/skills`, `.dsh/skills`) directories.
|
|
26
|
+
- **Import**: Install from a repository (`npx -y skills add`), import from a local directory, or upload a `.zip` archive (with path-traversal protection).
|
|
27
|
+
- **Edit & Safe Uninstall**: Edit writable `SKILL.md` files in place, or remove them by archiving to `~/.agents/skills-disabled/` or permanently deleting them (while cleaning up suite references). Built-in/bundled skills remain read-only.
|
|
28
|
+
- **Granular MCP Control**: Toggle individual `mcp__<server>__<tool>` tools, reconnect servers, or add custom `stdio` / `streamable-http` MCP servers.
|
|
29
|
+
- **Agent Tool (`capability_hub`)**: Exposes status inspection, suite/skill/MCP toggling, and skill management directly to the agent.
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
### Via CLI (Recommended)
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Install from npm into the web profile
|
|
37
|
+
dsh plugin --profile web add @fengguanghuai/dsh-capability-hub
|
|
38
|
+
|
|
39
|
+
# Or without a global dsh install
|
|
40
|
+
npx @deepseek-ai/dsh plugin --profile web add @fengguanghuai/dsh-capability-hub
|
|
41
|
+
|
|
42
|
+
# Or install directly from GitHub
|
|
43
|
+
dsh plugin --profile web add github:fengguanghuai/dsh-capability-hub
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
> Restart `dsh web` (or reopen the desktop app) after installing if the sidebar entry does not appear immediately.
|
|
47
|
+
|
|
48
|
+
### Via DeepSeek Harness UI
|
|
49
|
+
|
|
50
|
+
Open **Plugins → Add plugin** and enter either:
|
|
51
|
+
|
|
52
|
+
- `@fengguanghuai/dsh-capability-hub`
|
|
53
|
+
- `github:fengguanghuai/dsh-capability-hub`
|
|
54
|
+
|
|
55
|
+
### Update & Uninstall
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Update to the latest version
|
|
59
|
+
dsh plugin --profile web update @fengguanghuai/dsh-capability-hub
|
|
60
|
+
|
|
61
|
+
# Remove the plugin
|
|
62
|
+
dsh plugin --profile web remove @fengguanghuai/dsh-capability-hub
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
> Disabling or removing this bundle immediately restores default tool and skill visibility.
|
|
66
|
+
|
|
67
|
+
## Quick Start
|
|
68
|
+
|
|
69
|
+
1. Open **Capability Hub** from the top-left sidebar.
|
|
70
|
+
2. Switch between the **Suites**, **Skills**, and **MCPs** tabs—the top-right action button adapts automatically (`+ New Suite` / `+ Add Skill` / `+ Connect MCP`).
|
|
71
|
+
3. Create a suite by selecting related MCP servers and Skills.
|
|
72
|
+
4. In any chat session, click the **Suites** pill in the chat composer to override active suites for that session only (subagents inherit the selection automatically).
|
|
73
|
+
|
|
74
|
+
## Architecture
|
|
75
|
+
|
|
76
|
+
```mermaid
|
|
77
|
+
flowchart TB
|
|
78
|
+
subgraph UI["Web UI (client.js)"]
|
|
79
|
+
Sidebar["Sidebar Entry (Capability Hub)"]
|
|
80
|
+
Hub["Main Panel (Suites · Skills · MCPs)"]
|
|
81
|
+
Drawer["Right Drawer (Inspect · Create · Import · Edit)"]
|
|
82
|
+
Composer["Chat Composer Pill (Per-Session Suites)"]
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
subgraph Core["Cordis Plugin Runtime (index.js)"]
|
|
86
|
+
API["HTTP API (/api/capability-hub) and Agent Tool (capability_hub)"]
|
|
87
|
+
State["State Store (~/.dsh/capability-hub/state.json)"]
|
|
88
|
+
SkillPolicy["Skill Policy Provider (in-memory auto / manual / muted)"]
|
|
89
|
+
ToolFilter["Session Tool Filter (per-session and subagent inheritance)"]
|
|
90
|
+
SkillFS["Skill Lifecycle Manager (save · import repo/local/zip · archive/delete)"]
|
|
91
|
+
McpMgr["Custom MCP Manager (stdio · streamable-http)"]
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
subgraph Disk["Runtime and Local Storage"]
|
|
95
|
+
AgentCtx["Live DSH Sessions and Subagents"]
|
|
96
|
+
SkillDirs["Skill Directories (~/.agents/skills, .agents/skills)"]
|
|
97
|
+
ArchiveDir["Archive (~/.agents/skills-disabled/)"]
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
Sidebar --> Hub
|
|
101
|
+
Hub --> Drawer
|
|
102
|
+
Hub --> API
|
|
103
|
+
Composer --> API
|
|
104
|
+
API --> State
|
|
105
|
+
State --> SkillPolicy
|
|
106
|
+
State --> ToolFilter
|
|
107
|
+
API --> SkillFS
|
|
108
|
+
API --> McpMgr
|
|
109
|
+
SkillPolicy --> AgentCtx
|
|
110
|
+
ToolFilter --> AgentCtx
|
|
111
|
+
SkillFS --> SkillDirs
|
|
112
|
+
SkillFS --> ArchiveDir
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Data, Permissions & Safety
|
|
116
|
+
|
|
117
|
+
- **Local State**: Persists suite definitions, skill policy overrides, and custom MCP metadata in `~/.dsh/capability-hub/state.json`.
|
|
118
|
+
- **Skill Files**: Reads/writes user-managed skills under `~/.agents/skills`, `~/.dsh/skills`, `.agents/skills`, and `.dsh/skills`. Archiving moves skills to `~/.agents/skills-disabled/`. Built-in skills remain read-only, and skill policy overrides (`auto` / `manual` / `muted`) stay in memory without modifying `SKILL.md`.
|
|
119
|
+
- **External Commands**: Importing a skill from a Git repository invokes `npx -y skills add`.
|
|
120
|
+
- **Exposed Surfaces**: Registers the local HTTP endpoint `/api/capability-hub` and the `capability_hub` agent tool.
|
|
121
|
+
- **Privacy**: Runs entirely locally with no telemetry or external data collection.
|
|
122
|
+
|
|
123
|
+
## Development & Testing
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
node --check index.js
|
|
127
|
+
node --check client.js
|
|
128
|
+
node test.mjs
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## License
|
|
132
|
+
|
|
133
|
+
[MIT](./LICENSE)
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# @fengguanghuai/dsh-capability-hub(能力中心)
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@fengguanghuai/dsh-capability-hub)
|
|
4
|
+
[](./LICENSE)
|
|
5
|
+
[](https://github.com/topics/dsh-plugin)
|
|
6
|
+
|
|
7
|
+
[English](./README.md) | **简体中文**
|
|
8
|
+
|
|
9
|
+
**能力中心(Capability Hub)** 是面向 **DeepSeek Harness (DSH)** 的统一能力编排插件。它可以将 **Skills** 与 **MCP 服务** 打包为可一键切换的场景套件,支持在聊天输入框中按会话动态注入能力,并提供本地 Skill 的全生命周期管理,避免工具与上下文膨胀。
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 界面预览
|
|
14
|
+
|
|
15
|
+
| 套件与上下文预算总览 | Skill 抽屉与会话级套件选择 |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
|  |  |
|
|
18
|
+
|
|
19
|
+
## 核心特性
|
|
20
|
+
|
|
21
|
+
- **场景套件一键切换**:将关联的 MCP 服务与 Skill 打包为场景套件(如文档处理、架构绘图、媒体工作流等),一键启用或停用。
|
|
22
|
+
- **会话级按需注入(聊天框快捷入口)**:在聊天框底部的「套件」入口中,单独指定**当前会话**启用的套件,不影响全局默认配置或其他会话;子 Agent 会自动继承父会话的套件策略。
|
|
23
|
+
- **无侵入 Skill 策略控制**:在内存中动态切换 `自动触发 (auto)`、`仅手动 /skill (manual)` 与 `静默隐藏 (muted)`,绝不修改磁盘上的原始 `SKILL.md`。
|
|
24
|
+
- **Skill 全生命周期管理**:
|
|
25
|
+
- **新建 / 粘贴**:支持在线编写或粘贴 `SKILL.md`(自动解析 frontmatter),写入用户目录(`~/.agents/skills`、`~/.dsh/skills`)或项目目录(`.agents/skills`、`.dsh/skills`)。
|
|
26
|
+
- **多源导入**:支持从仓库导入(`npx -y skills add`)、本地目录导入以及 `.zip` 压缩包上传(内置路径穿越防护)。
|
|
27
|
+
- **编辑与安全卸载**:支持在线编辑可写 Skill;移除时可选择「移入归档(`~/.agents/skills-disabled/`)」或「彻底删除」(自动清理套件引用)。内置 Skill 保持只读。
|
|
28
|
+
- **MCP 精细化控制**:支持工具级开关(`mcp__<server>__<tool>`)、服务重连及新增自定义 `stdio` / `streamable-http` MCP 连接。
|
|
29
|
+
- **Agent 工具(`capability_hub`)**:向智能体开放状态查看、套件/Skill/MCP 启停以及 Skill 管理能力。
|
|
30
|
+
|
|
31
|
+
## 安装方式
|
|
32
|
+
|
|
33
|
+
### 通过 CLI 安装(推荐)
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# 从 npm 安装到 web profile
|
|
37
|
+
dsh plugin --profile web add @fengguanghuai/dsh-capability-hub
|
|
38
|
+
|
|
39
|
+
# 如未全局安装 dsh,可使用 npx
|
|
40
|
+
npx @deepseek-ai/dsh plugin --profile web add @fengguanghuai/dsh-capability-hub
|
|
41
|
+
|
|
42
|
+
# 或直接从 GitHub 安装
|
|
43
|
+
dsh plugin --profile web add github:fengguanghuai/dsh-capability-hub
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
> 安装完成后,如左侧栏未立即出现入口,请重启 `dsh web`(或重启桌面端应用)。
|
|
47
|
+
|
|
48
|
+
### 通过 DeepSeek Harness 界面安装
|
|
49
|
+
|
|
50
|
+
打开 **Plugins → Add plugin**(插件 → 添加插件),输入以下任意地址:
|
|
51
|
+
|
|
52
|
+
- `@fengguanghuai/dsh-capability-hub`
|
|
53
|
+
- `github:fengguanghuai/dsh-capability-hub`
|
|
54
|
+
|
|
55
|
+
### 更新与卸载
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# 更新到最新版本
|
|
59
|
+
dsh plugin --profile web update @fengguanghuai/dsh-capability-hub
|
|
60
|
+
|
|
61
|
+
# 卸载插件
|
|
62
|
+
dsh plugin --profile web remove @fengguanghuai/dsh-capability-hub
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
> 禁用或卸载本插件后,会自动恢复全部默认的工具与 Skill 可见性策略。
|
|
66
|
+
|
|
67
|
+
## 快速上手
|
|
68
|
+
|
|
69
|
+
1. 点击左上角侧边栏的 **能力中心(Capability Hub)** 打开主面板。
|
|
70
|
+
2. 顶部可在 **套件 / Skills / MCP** 之间切换,右上角操作按钮会随当前 Tab 自动联动(`+ 新建套件` / `+ 添加 Skill` / `+ 连接 MCP`)。
|
|
71
|
+
3. 创建一个场景套件并勾选关联的 MCP 服务与 Skill。
|
|
72
|
+
4. 在任意对话中,点击聊天输入框底部的「套件」胶囊入口,即可为当前会话单独调整启用的套件。
|
|
73
|
+
|
|
74
|
+
## 数据存储、权限与安全说明
|
|
75
|
+
|
|
76
|
+
- **本地状态文件**:套件配置、Skill 策略覆写与自定义 MCP 元数据保存在 `~/.dsh/capability-hub/state.json`。
|
|
77
|
+
- **Skill 目录读写**:仅读写 `~/.agents/skills`、`~/.dsh/skills`、`.agents/skills`、`.dsh/skills`,归档目录为 `~/.agents/skills-disabled/`;内置 Skill 只读;策略切换在内存中生效,不改动原 `SKILL.md`。
|
|
78
|
+
- **外部命令**:仅在使用「从仓库导入 Skill」功能时执行 `npx -y skills add`。
|
|
79
|
+
- **扩展接口**:注册本地 HTTP 接口 `/api/capability-hub` 与 Agent 工具 `capability_hub`。
|
|
80
|
+
- **隐私**:完全在本地运行,无遥测、无外部数据上报。
|
|
81
|
+
|
|
82
|
+
## 开发与测试
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
node --check index.js
|
|
86
|
+
node --check client.js
|
|
87
|
+
node test.mjs
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## 开源协议
|
|
91
|
+
|
|
92
|
+
[MIT](./LICENSE)
|