dsh-plugin-capabilities 0.1.0
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 +52 -0
- package/cordis.patch.yml +7 -0
- package/lib/client.js +863 -0
- package/lib/client.js.map +7 -0
- package/lib/index.js +1514 -0
- package/lib/index.js.map +7 -0
- package/package.json +64 -0
- package/src/agents.test.ts +105 -0
- package/src/agents.ts +135 -0
- package/src/client/McpTab.tsx +411 -0
- package/src/client/SkillsTab.tsx +301 -0
- package/src/client/css.ts +47 -0
- package/src/client/desktop-bridge.d.ts +12 -0
- package/src/client/index.ts +108 -0
- package/src/client/locales.ts +131 -0
- package/src/client/primitives.d.ts +57 -0
- package/src/http.ts +42 -0
- package/src/index.ts +56 -0
- package/src/mcp.test.ts +85 -0
- package/src/mcp.ts +170 -0
- package/src/profile.ts +17 -0
- package/src/routes.ts +285 -0
- package/src/skills.test.ts +73 -0
- package/src/skills.ts +81 -0
- package/src/smoke.test.ts +150 -0
- package/src/types.ts +34 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 qinyre
|
|
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
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# dsh-plugin-capabilities
|
|
2
|
+
|
|
3
|
+
A dsh plugin that adds "Skills" and "MCP" tabs to the Web UI's Settings page, so the skill catalog and the profile's MCP servers can be managed in place — including importing MCP servers and picking up skills from Claude Code and Codex.
|
|
4
|
+
|
|
5
|
+
一个 dsh 插件,在 Web UI 设置页的插件区新增「技能」与「MCP」两个标签页:技能目录和 profile 的 MCP 服务器直接在页面上查看与维护,不必手工编辑文件;来自 Claude Code、Codex 等其他 agent 的技能与 MCP 配置也能一并纳入。`dsh web` 与 [DSH Desktop](https://github.com/qinyre/dsh-Desktop) 均可使用。
|
|
6
|
+
|
|
7
|
+
## 安装
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
dsh plugin --profile web add dsh-plugin-capabilities
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
尚未发布到 npm 时,可先安装本地源码检出:`dsh plugin --profile web add file:/path/to/dsh-plugin-capabilities`,包内的 `prepare` 脚本会自动构建出 `lib/`。安装后打开 设置 → 插件,即可看到新增的标签页。
|
|
14
|
+
|
|
15
|
+
## 技能
|
|
16
|
+
|
|
17
|
+
「技能」页列出 dsh 当前发现的全部技能,包括名称、描述、来源(项目、用户、内置、运行时、自定义)和调用策略。用户级技能存放在 `$DSH_HOME/skills`,可以在这里新建、编辑、删除:frontmatter 与正文分开填写,保存后写入对应的 `SKILL.md`。技能目录处于文件系统监听之下,保存后数秒内条目就会出现在列表里,无需重启。项目目录和内置包等来源的技能以只读方式展示,可以查看全文。
|
|
18
|
+
|
|
19
|
+
如果机器上存在 Claude Code 或 Codex 的技能目录(`~/.claude/skills`、`~/.codex/skills`),它们会作为额外的扫描根自动进入目录。文件不会被复制,改动留在原地,两边实时同步。
|
|
20
|
+
|
|
21
|
+
## MCP
|
|
22
|
+
|
|
23
|
+
「MCP」页管理 profile patch 中的 MCP 服务器行,每行对应一个 `@deepseek-ai/dsh-mcp-client` 实例。stdio 服务器填写命令与参数,streamable-http 服务器填写 URL,编辑、停用、移除都在页面上完成。YAML 读写采用文档级 API,文件中的其他行与注释不受影响。
|
|
24
|
+
|
|
25
|
+
也可以从其他 agent 导入:一键扫描 Claude Code(`~/.claude.json`、`~/.claude/settings.json`)与 Codex(`~/.codex/config.toml`)的 MCP 配置,勾选所需条目后转为本 profile 的服务器行。stdio 与 http 两种传输都会处理,已存在的同名服务器置灰跳过。需要注意的是,Claude 配置里的 `${VAR}` 环境变量引用按字面值导入,如有需要请在导入后手动改回。
|
|
26
|
+
|
|
27
|
+
MCP 行的变更需要重启 dsh 才会进入组合,页面上会显示待重启横幅。在 [DSH Desktop](https://github.com/qinyre/dsh-Desktop) 中可以点击横幅上的按钮,由桌面壳层重启受监督的 sidecar;直接运行 `dsh web` 时自行重启即可。
|
|
28
|
+
|
|
29
|
+
## 工作原理
|
|
30
|
+
|
|
31
|
+
服务端 inject `webServer` 与 `skills`,在 web 服务器上注册 `/dsh-plugin-capabilities/*` 路由。Web 组合有意禁用了宿主平面的 `skill-filesystem` 行(会话内的技能发现归 agent preset 所有),本插件因此在宿主平面挂载自己的 filesystem provider 子插件,并把其他 agent 的技能目录作为额外扫描根传入:子插件随本插件卸载而卸载,技能注册进全局层,preset 层语义不变,设置页由此获得实时目录。写操作设有同源(CSRF)栅栏与输入校验——技能名 kebab-case 语法、MCP serverName 语法、路径穿越拒绝。
|
|
32
|
+
|
|
33
|
+
## 开发
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
npm install
|
|
37
|
+
npm run typecheck
|
|
38
|
+
npm test
|
|
39
|
+
npm run build
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
端到端 smoke 默认关闭,要求同级目录下存在 [deepseek-harness](https://github.com/deepseek-ai/deepseek-harness) 源码检出,且 Node ≥ 22.19:
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
DSH_DESKTOP_PLUGIN_SMOKE=1 npm test
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
它会创建临时 `DSH_HOME`,把本插件装进 `web` profile,启动 `dsh web`,验证技能写入→目录监听→列表更新的完整链路,以及 MCP 行的写入与读回。
|
|
49
|
+
|
|
50
|
+
## 许可
|
|
51
|
+
|
|
52
|
+
[MIT](./LICENSE)
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# dsh-plugin-capabilities bundle patch: insert the capabilities manager into
|
|
2
|
+
# a profile's layer stack. The node half registers /dsh-plugin-capabilities/*
|
|
3
|
+
# routes on the web server; the client half contributes the "技能/Skills" and
|
|
4
|
+
# "MCP" tabs into Settings → Plugins. Both halves share this one row:
|
|
5
|
+
- insert:
|
|
6
|
+
- id: dsh-plugin-capabilities
|
|
7
|
+
name: 'dsh-plugin-capabilities'
|