dsh-skill-hub 0.1.0 → 0.2.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/CONTRIBUTING.md +1 -1
- package/README.md +218 -173
- package/README.zh.md +275 -0
- package/lib/client.js +3660 -495
- package/lib/client.js.map +1 -1
- package/lib/index.js +2527 -385
- package/lib/types/client/SkillHubSettingsCard.d.ts +28 -17
- package/lib/types/client/api.d.ts +52 -4
- package/lib/types/client/grouping.d.ts +67 -0
- package/lib/types/client/index.d.ts +12 -6
- package/lib/types/client/locales.d.ts +158 -18
- package/lib/types/client/market-catalog.d.ts +14 -0
- package/lib/types/client/panel/DisabledRow.d.ts +12 -0
- package/lib/types/client/panel/GroupSummary.d.ts +10 -0
- package/lib/types/client/panel/MarketView.d.ts +11 -0
- package/lib/types/client/panel/ScenesView.d.ts +11 -0
- package/lib/types/client/panel/SkillDetailView.d.ts +31 -0
- package/lib/types/client/panel/SkillHubPanel.d.ts +11 -3
- package/lib/types/client/panel/SkillRow.d.ts +11 -0
- package/lib/types/client/panel/SourceStatusBadge.d.ts +18 -0
- package/lib/types/client/panel/SourcesView.d.ts +12 -0
- package/lib/types/client/panel/TagEditorView.d.ts +29 -0
- package/lib/types/client/panel/dialogs.d.ts +73 -0
- package/lib/types/client/panel/format.d.ts +14 -0
- package/lib/types/client/panel/useSkillHub.d.ts +187 -0
- package/lib/types/client/settings-card.d.ts +26 -8
- package/lib/types/client/settings-form.d.ts +2 -0
- package/lib/types/client/settings-nav-icon.d.ts +8 -0
- package/lib/types/index.d.ts +18 -1
- package/lib/types/protocol.d.ts +451 -7
- package/lib/types/provider.d.ts +6 -1
- package/lib/types/repo.d.ts +133 -0
- package/lib/types/routes.d.ts +9 -4
- package/lib/types/skillfs.d.ts +20 -15
- package/lib/types/stats.d.ts +17 -4
- package/lib/types/store.d.ts +112 -6
- package/lib/types/update.d.ts +20 -0
- package/package.json +28 -25
- package/src/client/SkillHubSettingsCard.tsx +85 -21
- package/src/client/api.ts +246 -13
- package/src/client/grouping.test.ts +121 -0
- package/src/client/grouping.ts +129 -0
- package/src/client/index.tsx +30 -21
- package/src/client/locales.ts +320 -40
- package/src/client/market-catalog.ts +22 -0
- package/src/client/panel/DisabledRow.tsx +32 -0
- package/src/client/panel/GroupSummary.tsx +27 -0
- package/src/client/panel/MarketView.tsx +186 -0
- package/src/client/panel/ScenesView.tsx +75 -0
- package/src/client/panel/SkillDetailView.tsx +95 -0
- package/src/client/panel/SkillHubPanel.tsx +268 -257
- package/src/client/panel/SkillRow.tsx +54 -0
- package/src/client/panel/SourceStatusBadge.tsx +61 -0
- package/src/client/panel/SourcesView.tsx +191 -0
- package/src/client/panel/TagEditorView.tsx +89 -0
- package/src/client/panel/dialogs.tsx +185 -0
- package/src/client/panel/format.ts +31 -0
- package/src/client/panel/panel.module.css +214 -45
- package/src/client/panel/useSkillHub.ts +811 -0
- package/src/client/settings-card.module.css +44 -28
- package/src/client/settings-card.tsx +69 -12
- package/src/client/settings-form.ts +12 -0
- package/src/client/settings-nav-icon.ts +42 -0
- package/src/index.ts +91 -40
- package/src/protocol.ts +484 -7
- package/src/provider.test.ts +2 -4
- package/src/provider.ts +18 -14
- package/src/repo.test.ts +212 -0
- package/src/repo.ts +528 -0
- package/src/routes.test.ts +619 -52
- package/src/routes.ts +1083 -157
- package/src/skillfs.test.ts +98 -16
- package/src/skillfs.ts +69 -34
- package/src/stats.test.ts +52 -17
- package/src/stats.ts +55 -18
- package/src/store.test.ts +205 -1
- package/src/store.ts +527 -24
- package/src/update.test.ts +73 -0
- package/src/update.ts +136 -0
- package/lib/types/client/api-config-scope.d.ts +0 -42
- package/src/client/api-config-scope.ts +0 -95
package/CONTRIBUTING.md
CHANGED
|
@@ -14,7 +14,7 @@ Please keep both halves on official APIs — no dsh source patches.
|
|
|
14
14
|
```bash
|
|
15
15
|
npm install
|
|
16
16
|
npm run typecheck # tsc --noEmit
|
|
17
|
-
npm test # vitest (
|
|
17
|
+
npm test # vitest (152 tests across 8 suites)
|
|
18
18
|
npm run build # tsc declarations + tsdown bundles (lib/index.js + lib/client.js)
|
|
19
19
|
```
|
|
20
20
|
|
package/README.md
CHANGED
|
@@ -1,15 +1,44 @@
|
|
|
1
1
|
# dsh-skill-hub
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
[中文版](README.zh.md) | [English](README.md)
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://www.npmjs.com/package/dsh-skill-hub"><img alt="npm version" src="https://img.shields.io/npm/v/dsh-skill-hub?color=2f81f7&label=npm"></a>
|
|
7
|
+
<img alt="downloads" src="https://img.shields.io/npm/dm/dsh-skill-hub">
|
|
8
|
+
<img alt="license" src="https://img.shields.io/npm/l/dsh-skill-hub">
|
|
9
|
+
<img alt="node" src="https://img.shields.io/badge/node-%3E%3D22.19-339933">
|
|
10
|
+
<a href="https://github.com/cheshireez/dsh-skill-hub/actions"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/cheshireez/dsh-skill-hub/ci.yml?branch=main"></a>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<img src="https://raw.githubusercontent.com/cheshireez/dsh-skill-hub/main/promo/real-skill-hub.png" alt="dsh-skill-hub panel" width="640">
|
|
15
|
+
</p>
|
|
5
16
|
|
|
6
17
|
**In-GUI skill hub for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh).**
|
|
7
18
|
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,
|
|
19
|
+
their bodies, understand why a skill is missing, install from the built-in market, and scaffold new
|
|
20
|
+
ones — all from the dsh web GUI.
|
|
9
21
|
|
|
10
22
|
> A skill manager beyond the read-only browser. The host half runs in the dsh process and speaks only
|
|
11
23
|
> official SDKs; the browser half renders inside the GUI through official slots. No dsh source changes.
|
|
12
24
|
|
|
25
|
+
> **Disclaimer** — source tracking, market sync, and the restorable trash are implemented by this
|
|
26
|
+
> plugin; they are not guarantees of the dsh runtime itself. Screenshots may lag the latest UI.
|
|
27
|
+
|
|
28
|
+
## Table of Contents
|
|
29
|
+
|
|
30
|
+
- [Why another skill manager?](#why-another-skill-manager)
|
|
31
|
+
- [Features](#features)
|
|
32
|
+
- [Quick start](#quick-start)
|
|
33
|
+
- [How it works](#how-it-works)
|
|
34
|
+
- [Usage](#usage)
|
|
35
|
+
- [Troubleshooting](#troubleshooting)
|
|
36
|
+
- [HTTP API](#http-api)
|
|
37
|
+
- [Development](#development)
|
|
38
|
+
- [Roadmap](#roadmap)
|
|
39
|
+
- [Community](#community)
|
|
40
|
+
- [License](#license)
|
|
41
|
+
|
|
13
42
|
## Why another skill manager?
|
|
14
43
|
|
|
15
44
|
[dsh-skill-manager](https://www.npmjs.com/package/dsh-skill-manager) is a read-only browser,
|
|
@@ -20,71 +49,158 @@ their bodies, understand why a skill is missing, and scaffold new ones — all f
|
|
|
20
49
|
| Capability | dsh-skill-manager (read-only) | **dsh-skill-hub (this plugin)** |
|
|
21
50
|
| --- | --- | --- |
|
|
22
51
|
| Catalog source | self-scans disk, user roots only | official `ctx.skills` registry: project / custom / user / bundled + third-party providers |
|
|
23
|
-
| Browse / search | ✅ | ✅ (group by
|
|
24
|
-
|
|
|
52
|
+
| Browse / search | ✅ | ✅ (group by **tags** or by **source repo**, search + filter in one row) |
|
|
53
|
+
| Workspace skills | ❌ | ✅ (enter a project path → its `.dsh/skills` & `.agents/skills` appear, read-only) |
|
|
54
|
+
| Enable / disable | ❌ | ✅ (renames `SKILL.md`; file never deleted, always restorable; per-group tri-state switches) |
|
|
25
55
|
| Inspect skill body | ❌ | ✅ |
|
|
26
56
|
| Discovery diagnostics | ❌ | ✅ (missing frontmatter / missing `name`/`description` / invalid name — each reason listed) |
|
|
27
57
|
| New-skill wizard | ❌ | ✅ (writes to `~/.dsh/skills` or `~/.agents/skills`) |
|
|
28
|
-
| Invocation statistics | ❌ | ✅ (per-skill call counts read from session logs) |
|
|
29
|
-
|
|
|
58
|
+
| Invocation statistics | ❌ | ✅ (per-skill call counts read from session logs; group headers summarize) |
|
|
59
|
+
| Upstream source tracking | ❌ | ✅ (repo + commit snapshot; check updates, sync, follow upstream deletion into a restorable trash; delete/restore keeps source + scene membership) |
|
|
60
|
+
| Market | ❌ | ✅ (unified market list: built-in curated catalog + custom repos; scan, one-click import, per-source installed/updatable badges, one-click update-all) |
|
|
30
61
|
| Live updates | — | filesystem-provider watcher, with a 5s panel poll as fallback |
|
|
31
62
|
|
|
32
63
|
## Features
|
|
33
64
|
|
|
65
|
+
### Catalog & switches — manage local skills
|
|
66
|
+
|
|
67
|
+
> **Browse everything, change anything you own.** The full registry is visible and searchable;
|
|
68
|
+
> writes are confined to your user-level roots and never delete files.
|
|
69
|
+
|
|
34
70
|
- **Full catalog** — every skill the official registry knows: project `.dsh/skills` & `.agents/skills`,
|
|
35
71
|
custom roots, user `~/.dsh/skills` & `~/.agents/skills`, bundled, and third-party providers.
|
|
36
|
-
- **Search & grouping** —
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
- **
|
|
40
|
-
|
|
41
|
-
|
|
72
|
+
- **Search & grouping** — one row combines search, source filter, and flat/grouped view; groups are
|
|
73
|
+
user **tags (scenes)** plus **source collections** (auto-aggregated by upstream repo); uncategorized
|
|
74
|
+
stays visible.
|
|
75
|
+
- **Workspace discovery** — known workspaces (from dsh’s workspace registry) are merged into the
|
|
76
|
+
default view and grouped in a project-level tree (per project, optionally split into
|
|
77
|
+
`.dsh`/`.agents`); the header path field pins the view to one workspace.
|
|
78
|
+
- **Group switches** — every group header carries a sliding switch: enable/disable the whole group in
|
|
79
|
+
one click. Closing a group whose member is also enabled elsewhere opens a conflict dialog (close all /
|
|
80
|
+
keep on → the group falls into a half-filled mixed state). Read-only skills are skipped with
|
|
81
|
+
per-name reports.
|
|
82
|
+
- **Enable / disable** — disable renames `SKILL.md` out of discovery (tracked in a sidecar file), so
|
|
83
|
+
the change survives restarts and is trivially reversible. Files are never deleted.
|
|
84
|
+
- **Skill detail** — read a skill’s body straight from disk, with its source card (repo, commit,
|
|
85
|
+
check/sync/follow-delete actions).
|
|
42
86
|
- **New-skill wizard** — scaffold a valid skill into `~/.dsh/skills` or `~/.agents/skills` from the GUI.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
87
|
+
|
|
88
|
+
### Market & updates
|
|
89
|
+
|
|
90
|
+
> **Add a repo, install in one click, stay updated forever.** Imports are tracked upstream
|
|
91
|
+
> automatically; updates surface per source and can be applied all at once.
|
|
92
|
+
|
|
93
|
+
- **Unified market list** — one list on the Market tab: built-in catalog entries show a description
|
|
94
|
+
and an **Add** button until added; once added (or custom sources entered by hand) the same row
|
|
95
|
+
becomes a full source row. No duplicate entries.
|
|
96
|
+
- **Scan → install** — scan any repo’s `skills/` and `design-templates/` roots, tick the skills you
|
|
97
|
+
want, import with one click. Imports record the upstream repo/commit automatically.
|
|
98
|
+
- **State badges** — every source row aggregates its state: installed count, updatable count, and
|
|
99
|
+
deleted-upstream count.
|
|
100
|
+
- **Check all / update all** — “Check all” refreshes every source (release + skill diffs); “Update
|
|
101
|
+
all” syncs every source with pending updates in one pass (per-source failures are reported, never
|
|
102
|
+
fatal). A daily auto-check (24h, timestamped in localStorage) covers the “forgot to click” case;
|
|
103
|
+
manual buttons are never throttled.
|
|
104
|
+
- **Source tracking** — per-source check (1–2 GitHub API requests, 5-minute server throttle), sync
|
|
105
|
+
selected skills (overwrite confirm), and follow upstream deletion into a restorable trash.
|
|
106
|
+
Deleting and restoring a tracked skill keeps its source and scene membership (snapshotted in the
|
|
107
|
+
trash entry). Personal skills (no source) are never tracked.
|
|
108
|
+
- **Self-update check** — the panel header checks the plugin’s own latest GitHub release.
|
|
109
|
+
|
|
110
|
+
### Stats & diagnostics
|
|
111
|
+
|
|
112
|
+
> **Know what your agents actually use.** Invocation counts come from your own session logs —
|
|
113
|
+
> no telemetry leaves the machine.
|
|
114
|
+
|
|
115
|
+
- **Invocation statistics** — per-skill call counts and last-used times read from session logs
|
|
116
|
+
(optional; absent session-query deployments simply omit the data); group headers summarize.
|
|
117
|
+
- **Discovery diagnostics** — the catalog reports *why* a skill was ignored (missing YAML
|
|
118
|
+
frontmatter, missing `name`/`description`, illegal name), per skill.
|
|
119
|
+
- **Settings card** — enable the plugin, toggle the agent announcement, and adjust panel display
|
|
120
|
+
preferences from **Settings → 插件 → Skill Hub**.
|
|
121
|
+
|
|
122
|
+
## Quick start
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
dsh plugin --profile web add dsh-skill-hub
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Restart `dsh web`, open **Settings → 技能**, and on the **Market** tab pick a repo from the
|
|
129
|
+
built-in catalog (or paste an `owner/repo`), scan it, tick the skills you want, and import. They are
|
|
130
|
+
tracked upstream from then on: check for updates and sync with one click.
|
|
131
|
+
|
|
132
|
+
A skill is just a directory with a `SKILL.md` — the panel can also scaffold one for you:
|
|
133
|
+
|
|
134
|
+
```markdown
|
|
135
|
+
---
|
|
136
|
+
name: my-skill
|
|
137
|
+
description: One line describing when the agent should use this skill.
|
|
138
|
+
---
|
|
139
|
+
# my-skill
|
|
140
|
+
|
|
141
|
+
What the skill does, when to use it, and what output is expected.
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Requires Node `^22.19.0 || >=24.0.0` and a dsh web deployment (`0.1.0-rc.7` SDK family).
|
|
46
145
|
|
|
47
146
|
## How it works
|
|
48
147
|
|
|
49
148
|
```text
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
└── client/ browser half: settings card + skill hub panel (React, CSS Modules)
|
|
149
|
+
GitHub repo ──scan / import──▶ ~/.dsh/skills (user level)
|
|
150
|
+
▲ │
|
|
151
|
+
│ check / sync / delete ▼
|
|
152
|
+
│ ctx.skills registry ◀── skill-hub provider (registers user + project roots)
|
|
153
|
+
│ │ snapshot / get
|
|
154
|
+
└────── daily auto-check ▼
|
|
155
|
+
/api/skill-hub/* routes ──▶ Browser panel (Settings → 技能)
|
|
58
156
|
```
|
|
59
157
|
|
|
158
|
+
| File | Responsibility |
|
|
159
|
+
| --- | --- |
|
|
160
|
+
| `src/index.ts` | host entry: inject `[webServer, skills, systemPrompt, settings]`; registers the `dsh-skill-hub` settings namespace; system-prompt announcement |
|
|
161
|
+
| `src/routes.ts` | declarative route wrapper: `/api/skill-hub/*` (loopback / method / master-switch / JSON-body fences handled once; handlers stay business-only) |
|
|
162
|
+
| `src/store.ts` | sidecar state `~/.dsh/dsh-skill-hub.json` v3 (disabled, tags, sources, market sources, trash; versioned v1→v2→v3 migrations) |
|
|
163
|
+
| `src/repo.ts` | GitHub discovery/import + source tracking (latest commit, tree diff, manifest) |
|
|
164
|
+
| `src/skillfs.ts` | root resolution / toggle rename / trash & restore / scaffold / diagnostics |
|
|
165
|
+
| `src/stats.ts` | invocation stats: session logs → per-skill call counts (optional sessionQuery) |
|
|
166
|
+
| `src/protocol.ts` | host ↔ browser shared API contract (types + endpoint table) |
|
|
167
|
+
| `src/client/` | browser half: settings card + skill hub panel. State and flows live in `useSkillHub.ts`; views are thin components (`SourcesView` / `ScenesView` / `MarketView` / `SkillRow` / dialogs / …). CSS Modules, Apple-style |
|
|
168
|
+
|
|
60
169
|
- **Host half** uses only official SDKs: `ctx.skills.snapshot()/get()`, `ctx.webServer.register()`,
|
|
61
170
|
`ctx.systemPrompt.section()`. No dsh source is modified.
|
|
62
171
|
- **Browser half** mounts through official slots: a **Settings → 技能** section and a
|
|
63
172
|
**Settings → 插件 → Skill Hub** configuration card.
|
|
64
|
-
- **Configuration** is
|
|
65
|
-
|
|
66
|
-
|
|
173
|
+
- **Configuration** is dsh-native. Since rc.7 the host serves every registered settings namespace to
|
|
174
|
+
the web client (the old namespace allowlist is gone), so the plugin registers a `dsh-skill-hub`
|
|
175
|
+
settings namespace and the card reads/writes it through the official settings transport — the
|
|
176
|
+
configurable-plugins tab dispatches the card by that namespace, and the host consumes the same
|
|
177
|
+
resolved value (single source of truth). Installations upgraded from the older sidecar-configured
|
|
178
|
+
build migrate their saved config into the namespace once.
|
|
67
179
|
|
|
68
|
-
##
|
|
180
|
+
## Usage
|
|
69
181
|
|
|
70
|
-
|
|
182
|
+
Open **Settings → 技能** (Skill Hub) in the dsh web GUI. Three tabs:
|
|
71
183
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
184
|
+
- **来源 (Sources)** — the skill list, flat or grouped: a project-level tree (workspaces merged by
|
|
185
|
+
default, per project optionally split into `.dsh`/`.agents`) plus source collections and
|
|
186
|
+
uncategorized. Search, source filter and sort share one row; group headers carry tri-state
|
|
187
|
+
switches; the source-group badge doubles as the re-check entry. *(see the screenshot at the top)*
|
|
188
|
+
- **场景 (Scenes)** — your own enable/disable units (e.g. a “Godot” scene vs a “Java” scene): create
|
|
189
|
+
tags, assign members, and flip a whole scene on/off with one switch.
|
|
75
190
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
191
|
+
<p align="center">
|
|
192
|
+
<img src="https://raw.githubusercontent.com/cheshireez/dsh-skill-hub/main/promo/real-skill-hub-scenes.png" alt="场景 tab" width="560">
|
|
193
|
+
</p>
|
|
194
|
+
- **市场 (Market)** — one unified list: built-in curated repos (Add button until added) and your
|
|
195
|
+
custom sources; scan to install, check for updates, update all in one pass.
|
|
79
196
|
|
|
80
|
-
|
|
197
|
+
<p align="center">
|
|
198
|
+
<img src="https://raw.githubusercontent.com/cheshireez/dsh-skill-hub/main/promo/real-skill-hub-catalog.png" alt="市场 tab" width="560">
|
|
199
|
+
</p>
|
|
81
200
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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.
|
|
201
|
+
Everywhere: **work space field** in the header (enter a project path to see its read-only project
|
|
202
|
+
skills), **trash** section (restorable, restores source + scene membership), **diagnostics** section
|
|
203
|
+
(why a skill is missing), and the **new-skill** form.
|
|
88
204
|
|
|
89
205
|
The plugin’s own switches live on the **Settings → 插件 → Skill Hub** card:
|
|
90
206
|
|
|
@@ -92,6 +208,23 @@ The plugin’s own switches live on the **Settings → 插件 → Skill Hub** ca
|
|
|
92
208
|
| --- | --- |
|
|
93
209
|
| Enable plugin | Master switch: routes, provider, and announcement all go live with this. |
|
|
94
210
|
| Announce to agent | Adds a system-prompt section so agents know how to collaborate when users mention skill management. |
|
|
211
|
+
| Model / user dot colors | Override the blue/green invocation dot colors used in the panel. |
|
|
212
|
+
| Show invocation count | Show per-skill call-count chips when session stats are available. |
|
|
213
|
+
| Show last-used time | Show relative last-used time on each skill row. |
|
|
214
|
+
| Show group summaries | Show count/last-used summaries after group titles. |
|
|
215
|
+
|
|
216
|
+
## Troubleshooting
|
|
217
|
+
|
|
218
|
+
- **⚠️ `duplicate loader entry id: skill-hub`** — the plugin was mounted twice (for example both
|
|
219
|
+
through `dsh plugin add` and a local `file:` install). Keep exactly one installation method; on
|
|
220
|
+
upgrade, replace rather than add.
|
|
221
|
+
- **A skill is not in the catalog** — open the **发现诊断** (diagnostics) section: missing
|
|
222
|
+
frontmatter, a name mismatch with the directory, or an over-short description are each listed with
|
|
223
|
+
their reason.
|
|
224
|
+
- **Update check shows nothing** — the server throttles checks (5 min per source) and the panel
|
|
225
|
+
auto-checks once per day; manual buttons are never throttled.
|
|
226
|
+
- **Read-only boundary** — only user-level skills (`~/.dsh/skills`, `~/.agents/skills`) are writable;
|
|
227
|
+
project, bundled, and runtime skills are displayed read-only.
|
|
95
228
|
|
|
96
229
|
## HTTP API
|
|
97
230
|
|
|
@@ -99,158 +232,70 @@ All endpoints are **loopback-only** (`127.0.0.1`/`localhost`) and JSON.
|
|
|
99
232
|
|
|
100
233
|
| Endpoint | Method | Purpose |
|
|
101
234
|
| --- | --- | --- |
|
|
102
|
-
| `/api/skill-hub/catalog
|
|
103
|
-
| `/api/skill-hub/skill?name=` | GET | One skill’s detail (path, provider, body). |
|
|
235
|
+
| `/api/skill-hub/catalog?cwd=` | GET | Full catalog: skills, disabled list, discovery diagnostics (`cwd` adds project skills). |
|
|
236
|
+
| `/api/skill-hub/skill?name=&cwd=` | GET | One skill’s detail (path, provider, body). |
|
|
237
|
+
| `/api/skill-hub/skill/delete` | POST | Move a skill into the restorable trash (snapshots source + scenes). |
|
|
104
238
|
| `/api/skill-hub/toggle` | POST | Enable/disable a writable skill (`{name, enabled}`). |
|
|
239
|
+
| `/api/skill-hub/toggle-batch` | POST | Enable/disable a whole group in one write (`{names, enabled}`). |
|
|
105
240
|
| `/api/skill-hub/create` | POST | Scaffold a new skill (`{name, description?, root?}`). |
|
|
106
241
|
| `/api/skill-hub/stats` | GET | Per-skill invocation counts (unavailable when session-query is absent). |
|
|
107
242
|
| `/api/skill-hub/config` | GET/POST | Plugin runtime config (`{enabled, announceToAgent}`); `null` clears an override. |
|
|
243
|
+
| `/api/skill-hub/groups` | GET | User tags + source collections + origin map. |
|
|
244
|
+
| `/api/skill-hub/tag` | POST | Create/rename a tag group. |
|
|
245
|
+
| `/api/skill-hub/tag/delete` | POST | Delete a tag group. |
|
|
246
|
+
| `/api/skill-hub/tag/members` | POST | Set a tag’s member list. |
|
|
247
|
+
| `/api/skill-hub/market` | GET | The user’s market source repos. |
|
|
248
|
+
| `/api/skill-hub/market/source` | POST | Add a market source (`{repo}`). |
|
|
249
|
+
| `/api/skill-hub/market/source/delete` | POST | Remove a market source. |
|
|
250
|
+
| `/api/skill-hub/market/source/ref` | POST | Pin a market source to a release/branch ref. |
|
|
251
|
+
| `/api/skill-hub/market/check` | GET | Check market sources for newer releases (throttled). |
|
|
252
|
+
| `/api/skill-hub/market/source/sync` | POST | Align a market source to its pinned ref; returns tracked skills. |
|
|
253
|
+
| `/api/skill-hub/repo?repo=` | GET | Discover importable skills in a GitHub repo. |
|
|
254
|
+
| `/api/skill-hub/repo/import` | POST | Import selected repo skills (records the source + default scene). |
|
|
255
|
+
| `/api/skill-hub/sources` | GET | Source records, derived origins/collections, trash. |
|
|
256
|
+
| `/api/skill-hub/sources/check` | POST | Check upstream updates (throttled, 5 min). |
|
|
257
|
+
| `/api/skill-hub/sources/sync` | POST | Sync selected (or all) skills of a source. |
|
|
258
|
+
| `/api/skill-hub/sources/delete` | POST | Follow upstream deletion (moves to trash). |
|
|
259
|
+
| `/api/skill-hub/sources/restore` | POST | Restore a trashed skill (re-attaches source + scenes). |
|
|
260
|
+
| `/api/skill-hub/sources/trash/clear` | POST | Permanently clear the trash. |
|
|
261
|
+
| `/api/skill-hub/update` | GET | Check the plugin’s own latest release. |
|
|
108
262
|
|
|
109
263
|
## Development
|
|
110
264
|
|
|
111
265
|
```bash
|
|
112
266
|
npm install
|
|
113
267
|
npm run typecheck # tsc --noEmit
|
|
114
|
-
npm test # vitest (
|
|
268
|
+
npm test # vitest (152 tests across 8 suites)
|
|
115
269
|
npm run build # tsc declarations + tsdown bundles (lib/index.js + lib/client.js)
|
|
116
270
|
npm pack # build the installable tarball (dsh-skill-hub-<version>.tgz)
|
|
117
271
|
```
|
|
118
272
|
|
|
273
|
+
> **Local testing:** do not run two `dsh web` instances against the same
|
|
274
|
+
> `$DSH_HOME` and the same project directory at the same time. dsh rc releases have no
|
|
275
|
+
> cross-process session-log lock, and a second instance resuming the same
|
|
276
|
+
> session can write duplicate `seq` rows (`corrupt session log: seq gap in
|
|
277
|
+
> committed region`). Stop the old instance first, or give the preview its own
|
|
278
|
+
> `DSH_HOME`.
|
|
279
|
+
|
|
119
280
|
The test suites cover the route family (including the config route and the disabled gate), the sidecar
|
|
120
281
|
store, skill filesystem operations, the registry provider, and invocation statistics.
|
|
121
282
|
|
|
122
283
|
## Roadmap
|
|
123
284
|
|
|
124
|
-
- **v0.1.0** — full catalog, enable/disable, diagnostics, new-skill wizard, settings card.
|
|
125
|
-
- **v0.2.0** — invocation statistics
|
|
126
|
-
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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 源码。
|
|
285
|
+
- **v0.1.0** *(released)* — full catalog, enable/disable, diagnostics, new-skill wizard, settings card.
|
|
286
|
+
- **v0.2.0** *(released)* — invocation statistics · tags/scenes + source-collection grouping with
|
|
287
|
+
tri-state switches · upstream source tracking (check / sync / follow-delete into a restorable
|
|
288
|
+
trash) · unified market with built-in catalog, per-source state badges, and one-click
|
|
289
|
+
update-all · delete/restore keeps source + scene membership.
|
|
290
|
+
- **Built, pending release** — workspace discovery (project-path field → read-only project skills).
|
|
291
|
+
- **Planned** — SSE realtime push to replace polling · market catalog expansion · optional
|
|
292
|
+
auto-update.
|
|
140
293
|
|
|
141
|
-
##
|
|
294
|
+
## Community
|
|
142
295
|
|
|
143
|
-
[
|
|
144
|
-
[
|
|
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 实时推送替代轮询。
|
|
296
|
+
- [Issues](https://github.com/cheshireez/dsh-skill-hub/issues) — bug reports and feature requests.
|
|
297
|
+
- [Contributing](CONTRIBUTING.md) — development setup and contribution guidelines.
|
|
253
298
|
|
|
254
299
|
## License
|
|
255
300
|
|
|
256
|
-
MIT
|
|
301
|
+
MIT — see [LICENSE](LICENSE).
|