dsh-skill-hub 0.0.1 → 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/CONTRIBUTING.md +56 -0
- package/README.md +242 -20
- package/cordis.patch.yml +12 -0
- package/lib/client.js +1473 -0
- package/lib/client.js.map +1 -0
- package/lib/index.js +1077 -0
- package/lib/invariant.js +6 -0
- package/lib/types/client/SkillHubSettingsCard.d.ts +48 -0
- package/lib/types/client/api-config-scope.d.ts +42 -0
- package/lib/types/client/api.d.ts +22 -0
- package/lib/types/client/helpers.d.ts +11 -0
- package/lib/types/client/index.d.ts +42 -0
- package/lib/types/client/locales.d.ts +79 -0
- package/lib/types/client/panel/SkillHubPanel.d.ts +10 -0
- package/lib/types/client/settings-card.d.ts +64 -0
- package/lib/types/client/settings-form.d.ts +93 -0
- package/lib/types/index.d.ts +30 -0
- package/lib/types/invariant.d.ts +3 -0
- package/lib/types/protocol.d.ts +150 -0
- package/lib/types/provider.d.ts +42 -0
- package/lib/types/routes.d.ts +46 -0
- package/lib/types/skillfs.d.ts +90 -0
- package/lib/types/stats.d.ts +36 -0
- package/lib/types/store.d.ts +36 -0
- package/package.json +112 -10
- package/src/client/SkillHubSettingsCard.tsx +108 -0
- package/src/client/api-config-scope.ts +95 -0
- package/src/client/api.ts +97 -0
- package/src/client/css-modules.d.ts +5 -0
- package/src/client/helpers.ts +23 -0
- package/src/client/index.tsx +101 -0
- package/src/client/locales.ts +158 -0
- package/src/client/panel/SkillHubPanel.tsx +353 -0
- package/src/client/panel/panel.module.css +55 -0
- package/src/client/settings-card.module.css +36 -0
- package/src/client/settings-card.tsx +181 -0
- package/src/client/settings-form.ts +215 -0
- package/src/index.ts +177 -0
- package/src/invariant.ts +4 -0
- package/src/protocol.ts +169 -0
- package/src/provider.test.ts +114 -0
- package/src/provider.ts +164 -0
- package/src/routes.test.ts +274 -0
- package/src/routes.ts +406 -0
- package/src/skillfs.test.ts +208 -0
- package/src/skillfs.ts +271 -0
- package/src/stats.test.ts +133 -0
- package/src/stats.ts +87 -0
- package/src/store.test.ts +49 -0
- package/src/store.ts +125 -0
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for considering a contribution to **dsh-skill-hub**. This project is a
|
|
4
|
+
[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh) plugin with two halves:
|
|
5
|
+
|
|
6
|
+
- the **host half** (`src/index.ts` + `src/routes.ts`) runs in the dsh process and speaks only official
|
|
7
|
+
dsh SDKs, and
|
|
8
|
+
- the **browser half** (`src/client/`) renders inside the web GUI through official slots.
|
|
9
|
+
|
|
10
|
+
Please keep both halves on official APIs — no dsh source patches.
|
|
11
|
+
|
|
12
|
+
## Development setup
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install
|
|
16
|
+
npm run typecheck # tsc --noEmit
|
|
17
|
+
npm test # vitest (54 tests across 5 suites)
|
|
18
|
+
npm run build # tsc declarations + tsdown bundles (lib/index.js + lib/client.js)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Before opening a pull request
|
|
22
|
+
|
|
23
|
+
1. **Typecheck** — `npm run typecheck` must pass.
|
|
24
|
+
2. **Tests** — `npm test` must pass; add/adjust tests for any behavior change. The suites live in
|
|
25
|
+
`src/*.test.ts` and mirror the real route/store/filesystem/provider behavior.
|
|
26
|
+
3. **Build** — `npm run build` must produce `lib/index.js` and `lib/client.js`.
|
|
27
|
+
4. **Keep the diff focused** — one logical change per PR, with a clear title and description.
|
|
28
|
+
5. **Documentation** — update `README.md` (including the embedded Chinese collapsible section) when
|
|
29
|
+
behavior or the API surface changes.
|
|
30
|
+
|
|
31
|
+
## Code style
|
|
32
|
+
|
|
33
|
+
- TypeScript, strict mode. ESM (`"type": "module"`).
|
|
34
|
+
- Host routes are loopback-only by construction — keep the trust fence intact.
|
|
35
|
+
- The browser half uses CSS Modules; keep the settings-card chrome family-bucket-compatible.
|
|
36
|
+
- Comments explain *why* (routing decisions, dsh host behaviors) more than *what*.
|
|
37
|
+
|
|
38
|
+
## Testing the plugin in a live dsh web GUI
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# after a change:
|
|
42
|
+
npm run build
|
|
43
|
+
cp lib/index.js lib/client.js ~/.dsh/profiles/web/node_modules/dsh-skill-hub/lib/
|
|
44
|
+
# restart the dsh web process, then verify Settings → 技能 and Settings → 插件 → Skill Hub
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Issues
|
|
48
|
+
|
|
49
|
+
- **Bugs**: include the dsh version, Node version, the plugin version, and the exact steps.
|
|
50
|
+
- **Feature requests**: describe the workflow you are trying to accomplish; a short motivation helps
|
|
51
|
+
scope the change.
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
By contributing, you agree that your contributions will be licensed under the
|
|
56
|
+
[MIT License](LICENSE).
|
package/README.md
CHANGED
|
@@ -1,34 +1,256 @@
|
|
|
1
1
|
# dsh-skill-hub
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
<details>
|
|
4
|
+
<summary><b>English</b>(英文)— 点击在本页展开 / 收起,无需跳转</summary>
|
|
4
5
|
|
|
5
|
-
In-GUI
|
|
6
|
+
**In-GUI skill hub for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh).**
|
|
7
|
+
Browse the full local skill catalog from the official `ctx.skills` registry, toggle skills on/off, inspect
|
|
8
|
+
their bodies, understand why a skill is missing, and scaffold new ones — all from the dsh web GUI.
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
> A skill manager beyond the read-only browser. The host half runs in the dsh process and speaks only
|
|
11
|
+
> official SDKs; the browser half renders inside the GUI through official slots. No dsh source changes.
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
|---|---|---|
|
|
11
|
-
| Catalog source | Own fs scan, user roots only | Official `ctx.skills` service — all six roots + third-party providers |
|
|
12
|
-
| Browse / search | ✅ | ✅ |
|
|
13
|
-
| Group by source root | ❌ | ✅ |
|
|
14
|
-
| Enable / disable skills | ❌ | ✅ |
|
|
15
|
-
| Frontmatter diagnostics (why a skill is ignored) | ❌ | ✅ |
|
|
16
|
-
| New-skill wizard (agent-guided) | ❌ | ✅ |
|
|
17
|
-
| Per-session skill set / usage stats | ❌ | ✅ (v2) |
|
|
13
|
+
## Why another skill manager?
|
|
18
14
|
|
|
19
|
-
|
|
15
|
+
[dsh-skill-manager](https://www.npmjs.com/package/dsh-skill-manager) is a read-only browser,
|
|
16
|
+
[dsh-skill-importer](https://github.com/saitamahang/dsh-skill-importer) and
|
|
17
|
+
[dsh-find-skill](https://github.com/Moximxxx/dsh-find-skill) focus on importing and market-style installs.
|
|
18
|
+
**dsh-skill-hub fills the gap between them: a full catalog you can actually manage.**
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
20
|
+
| Capability | dsh-skill-manager (read-only) | **dsh-skill-hub (this plugin)** |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| Catalog source | self-scans disk, user roots only | official `ctx.skills` registry: project / custom / user / bundled + third-party providers |
|
|
23
|
+
| Browse / search | ✅ | ✅ (group by source **or** by Sets) |
|
|
24
|
+
| Enable / disable | ❌ | ✅ (renames `SKILL.md`; file never deleted, always restorable) |
|
|
25
|
+
| Inspect skill body | ❌ | ✅ |
|
|
26
|
+
| Discovery diagnostics | ❌ | ✅ (missing frontmatter / missing `name`/`description` / invalid name — each reason listed) |
|
|
27
|
+
| New-skill wizard | ❌ | ✅ (writes to `~/.dsh/skills` or `~/.agents/skills`) |
|
|
28
|
+
| Invocation statistics | ❌ | ✅ (per-skill call counts read from session logs) |
|
|
29
|
+
| Sets grouping | ❌ | ✅ (frontmatter `sets`; skills without sets go to “Uncategorized”) |
|
|
30
|
+
| Live updates | — | filesystem-provider watcher, with a 5s panel poll as fallback |
|
|
24
31
|
|
|
25
|
-
##
|
|
32
|
+
## Features
|
|
33
|
+
|
|
34
|
+
- **Full catalog** — every skill the official registry knows: project `.dsh/skills` & `.agents/skills`,
|
|
35
|
+
custom roots, user `~/.dsh/skills` & `~/.agents/skills`, bundled, and third-party providers.
|
|
36
|
+
- **Search & grouping** — filter by name, group by source or by frontmatter `sets`.
|
|
37
|
+
- **Enable / disable** — disable renames `SKILL.md` out of discovery (tracked in a sidecar file), so the
|
|
38
|
+
change survives restarts and is trivially reversible. Files are never deleted.
|
|
39
|
+
- **Skill detail** — read a skill’s rendered body straight from disk.
|
|
40
|
+
- **Discovery diagnostics** — the catalog reports *why* a skill was ignored (missing YAML frontmatter,
|
|
41
|
+
missing `name`/`description`, illegal name), per skill.
|
|
42
|
+
- **New-skill wizard** — scaffold a valid skill into `~/.dsh/skills` or `~/.agents/skills` from the GUI.
|
|
43
|
+
- **Invocation statistics** — the panel shows how many times each skill was actually called, read from
|
|
44
|
+
session logs (optional; absent session-query deployments simply omit the data).
|
|
45
|
+
- **Settings card** — enable the plugin and toggle the agent announcement from **Settings → 插件 → Skill Hub**.
|
|
46
|
+
|
|
47
|
+
## How it works
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
src/
|
|
51
|
+
├── index.ts host entry: inject [webServer, skills, systemPrompt]; system-prompt announcement
|
|
52
|
+
├── routes.ts /api/skill-hub/{catalog,skill,toggle,create,stats,config} (loopback-only fence)
|
|
53
|
+
├── store.ts sidecar state ~/.dsh/dsh-skill-hub.json (disabled list + runtime config, atomic write)
|
|
54
|
+
├── skillfs.ts root resolution / toggle rename / scaffold / diagnostics / frontmatter parsing
|
|
55
|
+
├── stats.ts invocation stats: session logs → per-skill call counts (optional sessionQuery)
|
|
56
|
+
├── protocol.ts host ↔ browser shared API contract (types + endpoint table)
|
|
57
|
+
└── client/ browser half: settings card + skill hub panel (React, CSS Modules)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
- **Host half** uses only official SDKs: `ctx.skills.snapshot()/get()`, `ctx.webServer.register()`,
|
|
61
|
+
`ctx.systemPrompt.section()`. No dsh source is modified.
|
|
62
|
+
- **Browser half** mounts through official slots: a **Settings → 技能** section and a
|
|
63
|
+
**Settings → 插件 → Skill Hub** configuration card.
|
|
64
|
+
- **Configuration** is plugin-owned. The host’s settings service refuses to expose third-party
|
|
65
|
+
namespaces to the web client, so the settings card reads/writes the plugin’s own
|
|
66
|
+
`/api/skill-hub/config` route instead of the settings transport — no namespace mounting required.
|
|
67
|
+
|
|
68
|
+
## Installation
|
|
69
|
+
|
|
70
|
+
From the dsh web profile:
|
|
26
71
|
|
|
27
72
|
```bash
|
|
28
73
|
dsh plugin --profile web add dsh-skill-hub
|
|
29
74
|
```
|
|
30
75
|
|
|
31
|
-
|
|
76
|
+
Requires Node `^22.19.0 || >=24.0.0` and a dsh web deployment (`0.1.0-rc.6` SDK family).
|
|
77
|
+
|
|
78
|
+
## Usage
|
|
79
|
+
|
|
80
|
+
Open **Settings → 技能** (Skill Hub) in the dsh web GUI:
|
|
81
|
+
|
|
82
|
+
- **Browse** — the full catalog, searchable and grouped by source or Sets.
|
|
83
|
+
- **Toggle** — enable/disable any skill from a user-writable root; disabled skills list separately and
|
|
84
|
+
can be re-enabled any time.
|
|
85
|
+
- **Diagnose** — the discovery diagnostics explain why a skill is not showing up.
|
|
86
|
+
- **New skill** — scaffold a new skill from the form and start writing.
|
|
87
|
+
- **Statistics** — per-skill invocation counts when session-query data is available.
|
|
88
|
+
|
|
89
|
+
The plugin’s own switches live on the **Settings → 插件 → Skill Hub** card:
|
|
90
|
+
|
|
91
|
+
| Field | Meaning |
|
|
92
|
+
| --- | --- |
|
|
93
|
+
| Enable plugin | Master switch: routes, provider, and announcement all go live with this. |
|
|
94
|
+
| Announce to agent | Adds a system-prompt section so agents know how to collaborate when users mention skill management. |
|
|
95
|
+
|
|
96
|
+
## HTTP API
|
|
97
|
+
|
|
98
|
+
All endpoints are **loopback-only** (`127.0.0.1`/`localhost`) and JSON.
|
|
99
|
+
|
|
100
|
+
| Endpoint | Method | Purpose |
|
|
101
|
+
| --- | --- | --- |
|
|
102
|
+
| `/api/skill-hub/catalog` | GET | Full catalog: skills, disabled list, discovery diagnostics, Sets. |
|
|
103
|
+
| `/api/skill-hub/skill?name=` | GET | One skill’s detail (path, provider, body). |
|
|
104
|
+
| `/api/skill-hub/toggle` | POST | Enable/disable a writable skill (`{name, enabled}`). |
|
|
105
|
+
| `/api/skill-hub/create` | POST | Scaffold a new skill (`{name, description?, root?}`). |
|
|
106
|
+
| `/api/skill-hub/stats` | GET | Per-skill invocation counts (unavailable when session-query is absent). |
|
|
107
|
+
| `/api/skill-hub/config` | GET/POST | Plugin runtime config (`{enabled, announceToAgent}`); `null` clears an override. |
|
|
108
|
+
|
|
109
|
+
## Development
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
npm install
|
|
113
|
+
npm run typecheck # tsc --noEmit
|
|
114
|
+
npm test # vitest (54 tests across 5 suites)
|
|
115
|
+
npm run build # tsc declarations + tsdown bundles (lib/index.js + lib/client.js)
|
|
116
|
+
npm pack # build the installable tarball (dsh-skill-hub-<version>.tgz)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The test suites cover the route family (including the config route and the disabled gate), the sidecar
|
|
120
|
+
store, skill filesystem operations, the registry provider, and invocation statistics.
|
|
121
|
+
|
|
122
|
+
## Roadmap
|
|
123
|
+
|
|
124
|
+
- **v0.1.0** — full catalog, enable/disable, diagnostics, new-skill wizard, settings card.
|
|
125
|
+
- **v0.2.0** — invocation statistics ✅ · Sets grouping ✅ · recycle-bin delete (pending).
|
|
126
|
+
- **v0.3.0** — SSE realtime push to replace polling.
|
|
127
|
+
|
|
128
|
+
## License
|
|
129
|
+
|
|
130
|
+
MIT — see [LICENSE](LICENSE).
|
|
131
|
+
|
|
132
|
+
</details>
|
|
133
|
+
|
|
134
|
+
**面向 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(dsh)的图形化技能中枢。**
|
|
135
|
+
在 dsh Web GUI 里浏览官方 `ctx.skills` 注册表提供的完整本地技能目录,启用/禁用技能、查看正文、
|
|
136
|
+
排查技能为什么没出现、并新建技能。
|
|
137
|
+
|
|
138
|
+
> 一个不止于只读浏览器的技能管理器。宿主半边运行在 dsh 进程内,只使用官方 SDK;浏览器半边通过
|
|
139
|
+
> 官方槽位渲染进 GUI。不改任何 dsh 源码。
|
|
140
|
+
|
|
141
|
+
## 为什么还需要一个技能管理器?
|
|
142
|
+
|
|
143
|
+
[dsh-skill-manager](https://www.npmjs.com/package/dsh-skill-manager) 是只读浏览器;
|
|
144
|
+
[dsh-skill-importer](https://github.com/saitamahang/dsh-skill-importer) 和
|
|
145
|
+
[dsh-find-skill](https://github.com/Moximxxx/dsh-find-skill) 专注导入与市场式安装。
|
|
146
|
+
**dsh-skill-hub 补上两者之间的空白:一份你可以真正管理的完整目录。**
|
|
147
|
+
|
|
148
|
+
| 能力 | dsh-skill-manager(只读版) | **dsh-skill-hub(本插件)** |
|
|
149
|
+
| --- | --- | --- |
|
|
150
|
+
| 目录来源 | 自扫盘,仅用户根 | 官方 `ctx.skills` 注册表:项目 / 自定义 / 用户 / 内置 + 第三方 provider |
|
|
151
|
+
| 浏览 / 搜索 | ✅ | ✅(按来源或按 Sets 分组) |
|
|
152
|
+
| 启用 / 禁用 | ❌ | ✅(重命名 `SKILL.md`;文件不删除,可随时恢复) |
|
|
153
|
+
| 查看技能正文 | ❌ | ✅ |
|
|
154
|
+
| 发现诊断 | ❌ | ✅(缺 frontmatter / 缺 `name`/`description` / 非法名称,逐项列明原因) |
|
|
155
|
+
| 新建技能向导 | ❌ | ✅(写入 `~/.dsh/skills` 或 `~/.agents/skills`) |
|
|
156
|
+
| 触发统计 | ❌ | ✅(从会话日志读每技能实际调用次数) |
|
|
157
|
+
| Sets 分组 | ❌ | ✅(frontmatter `sets`;无 sets 归入「未归类」) |
|
|
158
|
+
| 实时更新 | — | 文件系统 provider 的 watcher 驱动,面板 5s 轮询兜底 |
|
|
159
|
+
|
|
160
|
+
## 功能
|
|
161
|
+
|
|
162
|
+
- **完整目录** —— 官方注册表知道的每个技能:项目 `.dsh/skills` 与 `.agents/skills`、自定义根、
|
|
163
|
+
用户 `~/.dsh/skills` 与 `~/.agents/skills`、内置、以及第三方 provider。
|
|
164
|
+
- **搜索与分组** —— 按名称过滤,按来源或 frontmatter `sets` 分组。
|
|
165
|
+
- **启用 / 禁用** —— 禁用时把 `SKILL.md` 重命名移出发现范围(记录在 sidecar 文件中),重启后仍然
|
|
166
|
+
生效且可一键恢复。文件从不删除。
|
|
167
|
+
- **技能详情** —— 直接从磁盘读取技能的渲染正文。
|
|
168
|
+
- **发现诊断** —— 目录会逐项报告技能被忽略的原因(缺 YAML frontmatter、缺 `name`/`description`、
|
|
169
|
+
非法名称)。
|
|
170
|
+
- **新建技能向导** —— 在 GUI 里把合法技能脚手架写入 `~/.dsh/skills` 或 `~/.agents/skills`。
|
|
171
|
+
- **触发统计** —— 面板显示每个技能被实际调用的次数,数据来自会话日志(可选;没有 session-query
|
|
172
|
+
的部署直接省略该数据)。
|
|
173
|
+
- **设置卡片** —— 在 **设置 → 插件 → Skill Hub** 启用插件、开关向 Agent 的公告。
|
|
174
|
+
|
|
175
|
+
## 工作原理
|
|
176
|
+
|
|
177
|
+
```text
|
|
178
|
+
src/
|
|
179
|
+
├── index.ts host 入口:inject [webServer, skills, systemPrompt];系统提示公告
|
|
180
|
+
├── routes.ts /api/skill-hub/{catalog,skill,toggle,create,stats,config}(仅回环访问)
|
|
181
|
+
├── store.ts sidecar 状态 ~/.dsh/dsh-skill-hub.json(禁用清单 + 运行时配置,原子写)
|
|
182
|
+
├── skillfs.ts 根目录解析 / 开关重命名 / 脚手架 / 诊断扫描 / frontmatter 解析
|
|
183
|
+
├── stats.ts 触发统计:会话日志 → 每技能调用次数(可选 sessionQuery)
|
|
184
|
+
├── protocol.ts host ↔ browser 共享 API 契约(类型 + 端点表)
|
|
185
|
+
└── client/ browser 半边:设置卡片 + 技能中枢面板(React,CSS Modules)
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
- **宿主半边** 只用官方 SDK:`ctx.skills.snapshot()/get()`、`ctx.webServer.register()`、
|
|
189
|
+
`ctx.systemPrompt.section()`。不修改 dsh 源码。
|
|
190
|
+
- **浏览器半边** 通过官方槽位挂载:一个 **设置 → 技能** 分区,和一个
|
|
191
|
+
**设置 → 插件 → Skill Hub** 配置卡片。
|
|
192
|
+
- **配置为插件自有**。宿主 settings 服务拒绝向 Web 客户端暴露第三方命名空间,因此设置卡片读写插件
|
|
193
|
+
自己的 `/api/skill-hub/config` 路由,而不走 settings 传输——无需挂载命名空间。
|
|
194
|
+
|
|
195
|
+
## 安装
|
|
196
|
+
|
|
197
|
+
在 dsh web profile 中:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
dsh plugin --profile web add dsh-skill-hub
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
要求 Node `^22.19.0 || >=24.0.0` 与 dsh web 部署(`0.1.0-rc.6` SDK 家族)。
|
|
204
|
+
|
|
205
|
+
## 使用
|
|
206
|
+
|
|
207
|
+
在 dsh Web GUI 打开 **设置 → 技能**(Skill Hub):
|
|
208
|
+
|
|
209
|
+
- **浏览** —— 完整目录,可搜索,按来源或 Sets 分组。
|
|
210
|
+
- **开关** —— 启用/禁用任意用户可写根下的技能;被禁用的技能单独列出,可随时重新启用。
|
|
211
|
+
- **诊断** —— 发现诊断解释某个技能为什么没有出现。
|
|
212
|
+
- **新建** —— 从表单脚手架一个新技能,立即开始编写。
|
|
213
|
+
- **统计** —— 有 session-query 数据时显示每个技能的调用次数。
|
|
214
|
+
|
|
215
|
+
插件自身的开关在 **设置 → 插件 → Skill Hub** 卡片上:
|
|
216
|
+
|
|
217
|
+
| 字段 | 含义 |
|
|
218
|
+
| --- | --- |
|
|
219
|
+
| Enable plugin | 总开关:路由、provider 与公告随之启用。 |
|
|
220
|
+
| Announce to agent | 在系统提示中加入本插件说明,用户提到技能管理时 Agent 知道如何协作。 |
|
|
221
|
+
|
|
222
|
+
## HTTP API
|
|
223
|
+
|
|
224
|
+
所有端点**仅限回环**(`127.0.0.1`/`localhost`),返回 JSON。
|
|
225
|
+
|
|
226
|
+
| 端点 | 方法 | 用途 |
|
|
227
|
+
| --- | --- | --- |
|
|
228
|
+
| `/api/skill-hub/catalog` | GET | 完整目录:技能、禁用列表、发现诊断、Sets。 |
|
|
229
|
+
| `/api/skill-hub/skill?name=` | GET | 单个技能详情(路径、provider、正文)。 |
|
|
230
|
+
| `/api/skill-hub/toggle` | POST | 启用/禁用可写技能(`{name, enabled}`)。 |
|
|
231
|
+
| `/api/skill-hub/create` | POST | 脚手架新技能(`{name, description?, root?}`)。 |
|
|
232
|
+
| `/api/skill-hub/stats` | GET | 每技能调用次数(无 session-query 时不可用)。 |
|
|
233
|
+
| `/api/skill-hub/config` | GET/POST | 插件运行时配置(`{enabled, announceToAgent}`);`null` 清除覆盖。 |
|
|
234
|
+
|
|
235
|
+
## 开发
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
npm install
|
|
239
|
+
npm run typecheck # tsc --noEmit
|
|
240
|
+
npm test # vitest(5 个套件,54 个用例)
|
|
241
|
+
npm run build # tsc 声明 + tsdown 双半边产物(lib/index.js + lib/client.js)
|
|
242
|
+
npm pack # 生成可安装的 tgz(dsh-skill-hub-<version>.tgz)
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
测试套件覆盖路由家族(含 config 路由与禁用闸门)、sidecar 存储、技能文件系统操作、注册表
|
|
246
|
+
provider 与触发统计。
|
|
247
|
+
|
|
248
|
+
## 路线图
|
|
249
|
+
|
|
250
|
+
- **v0.1.0** —— 完整目录、启用/禁用、诊断、新建向导、设置卡片。
|
|
251
|
+
- **v0.2.0** —— 触发统计 ✅ · Sets 分组 ✅ · 回收站删除(待做)。
|
|
252
|
+
- **v0.3.0** —— SSE 实时推送替代轮询。
|
|
253
|
+
|
|
254
|
+
## License
|
|
32
255
|
|
|
33
|
-
|
|
34
|
-
- License: MIT
|
|
256
|
+
MIT —— 见 [LICENSE](LICENSE)。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# dsh-skill-hub bundle patch: inserts the dual-face plugin row into the web
|
|
2
|
+
# profile roster. Applied as a profile bundle layer (the `dsh.bundle.patch`
|
|
3
|
+
# manifest field) over dsh-base; activate with
|
|
4
|
+
# `dsh plugin --profile <name> add dsh-skill-hub`.
|
|
5
|
+
#
|
|
6
|
+
# The row is a bare plugin by package name: the node half (exports ".") runs
|
|
7
|
+
# in the host process (skill catalog routes, toggle/create operations), and
|
|
8
|
+
# the `dsh.client` declaration in package.json makes the browser half
|
|
9
|
+
# (exports "./client", served at /plugins/<id>/client.js) load in the web GUI.
|
|
10
|
+
- insert:
|
|
11
|
+
- id: skill-hub
|
|
12
|
+
name: 'dsh-skill-hub'
|