dsh-skill-importer 0.1.0 → 0.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 +95 -61
- package/README.zh.md +132 -0
- package/cordis.patch.yml +6 -0
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -1,98 +1,132 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="assets/hero.svg" alt="dsh-skill-importer — Skills, right where you need them" width="100%" />
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
<br />
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
<strong>Bring skill management into the DeepSeek Harness Web UI.</strong><br />
|
|
7
|
+
Import, discover, and invoke skills without a session, model tokens, or approval round-trips.
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
- **已安装列表**:扫描全部已注册工作区的项目技能根(`.dsh/skills`、`.agents/skills`)加用户技能根(`~/.dsh/skills`),**按安装位置分组展示全部副本**(不按 rank 去重,管理面能看到每一处),每项显示调用策略标记并可直接删除
|
|
9
|
-
- **工作区感知**:项目目标写入「当前工作区」(最近活跃的已注册工作区)而非 dsh 进程的启动目录——与 `/` 斜杠菜单的解析一致,导入后立即可见
|
|
10
|
-
- **从文件导入**:选择本地 Markdown → 浏览器内解析 frontmatter 并校验(`name` kebab-case、`description` 必填)→ 预览确认 → 直接写入 `<目标>/<name>/SKILL.md`
|
|
11
|
-
- **从 URL 导入**:host 进程抓取 URL(`.md` 原样写入;HTML 粗略提取正文),整理为技能文件
|
|
12
|
-
- **目标目录选择**:当前工作区 `.agents/skills` / `.dsh/skills` / 用户技能目录 `~/.dsh/skills`
|
|
9
|
+
<br /><br />
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
[](https://www.npmjs.com/package/dsh-skill-importer)
|
|
12
|
+
[](https://www.npmjs.com/package/dsh-skill-importer)
|
|
13
|
+
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
14
|
+
[](LICENSE)
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
<br />
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
│
|
|
27
|
-
▼
|
|
28
|
-
skill-filesystem 的 watcher 发现 → skills/change → / 菜单、模型目录热刷新
|
|
29
|
-
```
|
|
18
|
+
**English** · [简体中文](README.zh.md) · [Install](#installation) · [How it works](#how-it-works) · [Development](#development)
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Your skill library, one click away
|
|
24
|
+
|
|
25
|
+
`dsh-skill-importer` is a lightweight plugin for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh`). It turns skills into a first-class part of the Web UI: bring in Markdown from disk or a URL, see every installed copy, and insert a skill into the composer without breaking your flow.
|
|
30
26
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
| Import | Organize | Invoke |
|
|
28
|
+
| :--- | :--- | :--- |
|
|
29
|
+
| Upload `SKILL.md` or paste a URL. Frontmatter is validated and normalized before writing. | Browse skills grouped across project, legacy project, and global roots. Remove any copy individually. | Use the composer picker, run `/skills`, or type `/skill-name` directly. |
|
|
34
30
|
|
|
35
|
-
|
|
31
|
+
### Built for a fast loop
|
|
36
32
|
|
|
37
|
-
|
|
33
|
+
- **No agent or session** — the host writes skill files directly.
|
|
34
|
+
- **Zero model tokens** — imports never enter a model context.
|
|
35
|
+
- **Instant discovery** — the harness watcher hot-refreshes skills after they land.
|
|
36
|
+
- **Workspace-aware** — project skills always target the active registered workspace.
|
|
37
|
+
- **Bilingual UI** — English and Chinese copy follows the harness locale.
|
|
38
|
+
- **Safe by design** — fixed skill roots, 256 KB limit, and same-origin POST checks.
|
|
38
39
|
|
|
39
|
-
|
|
40
|
+
## Three natural ways to use a skill
|
|
41
|
+
|
|
42
|
+
1. **Composer picker** — open the pill beside the access-mode selector, search by name, and choose.
|
|
43
|
+
2. **`/skills` command** — use a familiar command palette, modeled after `/model`.
|
|
44
|
+
3. **Direct invocation** — type `/skill-name` and keep moving.
|
|
45
|
+
|
|
46
|
+
All three fill the composer with the same highlighted `/name ` gesture; sending injects the skill instructions through dsh's native flow.
|
|
47
|
+
|
|
48
|
+
## Installation
|
|
49
|
+
|
|
50
|
+
### 1. Add the plugin to the Web profile
|
|
40
51
|
|
|
41
52
|
```sh
|
|
42
|
-
# 1. 安装插件包(等价于在 profile 里 add)
|
|
43
53
|
dsh plugin --profile web add dsh-skill-importer
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 2. Enable it in the profile
|
|
44
57
|
|
|
45
|
-
|
|
46
|
-
# - id: skill-importer
|
|
47
|
-
# name: 'dsh-skill-importer'
|
|
58
|
+
Add the following entry to `$DSH_HOME/profiles/web/cordis.patch.yml`:
|
|
48
59
|
|
|
49
|
-
|
|
60
|
+
```yaml
|
|
61
|
+
- id: skill-importer
|
|
62
|
+
name: dsh-skill-importer
|
|
50
63
|
```
|
|
51
64
|
|
|
52
|
-
###
|
|
65
|
+
### 3. Restart dsh Web
|
|
53
66
|
|
|
54
|
-
|
|
55
|
-
# 1. 构建
|
|
56
|
-
npm install
|
|
57
|
-
npm run build
|
|
67
|
+
Open **Settings → Skills**. Import a Markdown file or URL, choose a target, and the skill will appear as soon as the filesystem watcher discovers it.
|
|
58
68
|
|
|
59
|
-
|
|
60
|
-
dsh plugin --profile web add /path/to/dsh-skill-importer
|
|
69
|
+
> Requires DeepSeek Harness `>= 0.1.0-rc.6` via `npx @deepseek-ai/dsh web`.
|
|
61
70
|
|
|
62
|
-
|
|
71
|
+
## How it works
|
|
63
72
|
|
|
64
|
-
|
|
65
|
-
```
|
|
73
|
+
The dsh client-to-host RPC is a fixed allowlist with no file-write channel. This plugin uses the official `ctx.webServer.register` extension point exposed by [`dsh-host-webserver`](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/host/webserver) and registers same-origin `/skill-importer/*` routes on the harness server.
|
|
66
74
|
|
|
67
|
-
|
|
75
|
+
```text
|
|
76
|
+
Markdown file or URL
|
|
77
|
+
│ same-origin fetch
|
|
78
|
+
▼
|
|
79
|
+
/skill-importer/import
|
|
80
|
+
│ host filesystem write
|
|
81
|
+
▼
|
|
82
|
+
<skill-root>/<name>/SKILL.md
|
|
83
|
+
│ watcher event
|
|
84
|
+
▼
|
|
85
|
+
skills/change → hot refresh
|
|
86
|
+
```
|
|
68
87
|
|
|
69
|
-
|
|
88
|
+
POST routes verify the `Origin` header and only accept loopback sources (`127.0.0.1` or `localhost`). Writes are restricted to these standard roots:
|
|
70
89
|
|
|
71
|
-
|
|
90
|
+
| Scope | Directory |
|
|
91
|
+
| :--- | :--- |
|
|
92
|
+
| Project | `.agents/skills` |
|
|
93
|
+
| Legacy project | `.dsh/skills` |
|
|
94
|
+
| Global | `~/.dsh/skills` |
|
|
72
95
|
|
|
73
|
-
##
|
|
96
|
+
## Development
|
|
74
97
|
|
|
75
98
|
```sh
|
|
76
99
|
npm install
|
|
77
|
-
npm run build
|
|
100
|
+
npm run build
|
|
78
101
|
```
|
|
79
102
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
103
|
+
| Area | Source |
|
|
104
|
+
| :--- | :--- |
|
|
105
|
+
| Host plugin and route registration | `src/index.ts` |
|
|
106
|
+
| Filesystem, URL import, and HTTP logic | `src/server.ts` |
|
|
107
|
+
| Shared wire types | `src/types.ts` |
|
|
108
|
+
| Browser plugin and `/skills` command | `src/client/index.ts` |
|
|
109
|
+
| Composer picker | `src/client/SkillsPicker.tsx` |
|
|
110
|
+
| Settings experience | `src/client/SkillImporterSection.tsx` |
|
|
85
111
|
|
|
86
|
-
|
|
112
|
+
Available routes: `GET /skill-importer/health` · `GET /skill-importer/list` · `POST /skill-importer/import` · `POST /skill-importer/import-url` · `POST /skill-importer/delete`
|
|
113
|
+
|
|
114
|
+
### Local checkout
|
|
115
|
+
|
|
116
|
+
```sh
|
|
117
|
+
npm install
|
|
118
|
+
npm run build
|
|
119
|
+
dsh plugin --profile web add /path/to/dsh-skill-importer
|
|
120
|
+
```
|
|
87
121
|
|
|
122
|
+
Add the profile entry shown above, then restart dsh Web.
|
|
88
123
|
|
|
89
|
-
##
|
|
124
|
+
## Notes
|
|
90
125
|
|
|
91
|
-
-
|
|
92
|
-
- URL
|
|
93
|
-
-
|
|
94
|
-
- 导入后列表由前端轮询刷新(2 秒间隔,最多 20 秒);如果目录被外部改动,点「刷新」立即同步
|
|
126
|
+
- A single imported file may be up to 256 KB.
|
|
127
|
+
- URL import preserves `.md` sources; HTML pages use lightweight text extraction, so direct Markdown URLs work best.
|
|
128
|
+
- The installed list polls briefly after import (every 2 seconds for up to 20 seconds). **Refresh** syncs external changes immediately.
|
|
95
129
|
|
|
96
130
|
## License
|
|
97
131
|
|
|
98
|
-
MIT
|
|
132
|
+
Released under the [MIT License](LICENSE).
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="assets/hero.svg" alt="dsh-skill-importer — 在需要的地方,调用你的技能" width="100%" />
|
|
3
|
+
|
|
4
|
+
<br />
|
|
5
|
+
|
|
6
|
+
<strong>把技能管理带进 DeepSeek Harness Web UI。</strong><br />
|
|
7
|
+
无需会话、不耗模型 Token、没有审批往返,导入后立即可用。
|
|
8
|
+
|
|
9
|
+
<br /><br />
|
|
10
|
+
|
|
11
|
+
[](https://www.npmjs.com/package/dsh-skill-importer)
|
|
12
|
+
[](https://www.npmjs.com/package/dsh-skill-importer)
|
|
13
|
+
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
14
|
+
[](LICENSE)
|
|
15
|
+
|
|
16
|
+
<br />
|
|
17
|
+
|
|
18
|
+
[English](README.md) · **简体中文** · [安装](#安装) · [工作原理](#工作原理) · [开发](#开发)
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 你的技能库,一键即达
|
|
24
|
+
|
|
25
|
+
`dsh-skill-importer` 是 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(`dsh`)的轻量技能管理插件。它把技能变成 Web UI 的一等公民:从本地或 URL 导入 Markdown、查看每一份已安装副本,并在输入框中自然调用,全程不打断工作流。
|
|
26
|
+
|
|
27
|
+
| 导入 | 管理 | 调用 |
|
|
28
|
+
| :--- | :--- | :--- |
|
|
29
|
+
| 上传 `SKILL.md` 或粘贴 URL,写入前自动校验并规范化 frontmatter。 | 按项目、旧版项目和全局目录分组查看,每个副本都能独立删除。 | 使用输入框选择器、运行 `/skills`,或直接输入 `/skill-name`。 |
|
|
30
|
+
|
|
31
|
+
### 为高速工作流而生
|
|
32
|
+
|
|
33
|
+
- **无需 Agent 或会话** — host 进程直接写入技能文件。
|
|
34
|
+
- **零模型 Token** — 导入过程不会进入模型上下文。
|
|
35
|
+
- **即时发现** — 文件落盘后由 harness watcher 热刷新。
|
|
36
|
+
- **工作区感知** — 项目技能始终写入当前注册工作区。
|
|
37
|
+
- **中英双语** — UI 文案自动跟随 harness 语言。
|
|
38
|
+
- **安全边界清晰** — 固定技能目录、256 KB 限制、同源 POST 校验。
|
|
39
|
+
|
|
40
|
+
## 三种自然的技能入口
|
|
41
|
+
|
|
42
|
+
1. **输入框选择器** — 点击权限模式旁边的 pill,按名称搜索并选中。
|
|
43
|
+
2. **`/skills` 命令** — 像使用 `/model` 一样打开技能命令面板。
|
|
44
|
+
3. **直接调用** — 输入 `/skill-name`,继续你的工作。
|
|
45
|
+
|
|
46
|
+
三种入口最终都会在输入框填入同一个高亮的 `/name ` 手势;发送后由 dsh 原生流程注入技能指令。
|
|
47
|
+
|
|
48
|
+
## 安装
|
|
49
|
+
|
|
50
|
+
### 1. 安装到 Web profile
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
dsh plugin --profile web add dsh-skill-importer
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 2. 在 profile 中启用
|
|
57
|
+
|
|
58
|
+
向 `$DSH_HOME/profiles/web/cordis.patch.yml` 添加:
|
|
59
|
+
|
|
60
|
+
```yaml
|
|
61
|
+
- id: skill-importer
|
|
62
|
+
name: dsh-skill-importer
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 3. 重启 dsh Web
|
|
66
|
+
|
|
67
|
+
打开 **设置 → 技能**,选择 Markdown 文件或粘贴 URL,再选择目标目录。文件系统 watcher 发现后,技能会立即出现。
|
|
68
|
+
|
|
69
|
+
> 需要 DeepSeek Harness `>= 0.1.0-rc.6`,使用 `npx @deepseek-ai/dsh web` 运行。
|
|
70
|
+
|
|
71
|
+
## 工作原理
|
|
72
|
+
|
|
73
|
+
dsh 的 client→host RPC 是固定白名单,没有文件写入通道。本插件使用 [`dsh-host-webserver`](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/host/webserver) 提供的官方 `ctx.webServer.register` 扩展点,在 harness 自身服务器上注册同源 `/skill-importer/*` 路由。
|
|
74
|
+
|
|
75
|
+
```text
|
|
76
|
+
Markdown 文件或 URL
|
|
77
|
+
│ 同源 fetch
|
|
78
|
+
▼
|
|
79
|
+
/skill-importer/import
|
|
80
|
+
│ host 文件系统写入
|
|
81
|
+
▼
|
|
82
|
+
<skill-root>/<name>/SKILL.md
|
|
83
|
+
│ watcher 事件
|
|
84
|
+
▼
|
|
85
|
+
skills/change → 热刷新
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
所有 POST 路由都会校验 `Origin`,仅接受 loopback 来源(`127.0.0.1` 或 `localhost`)。写入范围固定为三个标准目录:
|
|
89
|
+
|
|
90
|
+
| 范围 | 目录 |
|
|
91
|
+
| :--- | :--- |
|
|
92
|
+
| 项目 | `.agents/skills` |
|
|
93
|
+
| 旧版项目 | `.dsh/skills` |
|
|
94
|
+
| 全局 | `~/.dsh/skills` |
|
|
95
|
+
|
|
96
|
+
## 开发
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
npm install
|
|
100
|
+
npm run build
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
| 模块 | 源码 |
|
|
104
|
+
| :--- | :--- |
|
|
105
|
+
| Host 插件与路由注册 | `src/index.ts` |
|
|
106
|
+
| 文件系统、URL 导入与 HTTP 逻辑 | `src/server.ts` |
|
|
107
|
+
| Host/client 共享类型 | `src/types.ts` |
|
|
108
|
+
| 浏览器插件与 `/skills` 命令 | `src/client/index.ts` |
|
|
109
|
+
| 输入框技能选择器 | `src/client/SkillsPicker.tsx` |
|
|
110
|
+
| 设置页 | `src/client/SkillImporterSection.tsx` |
|
|
111
|
+
|
|
112
|
+
路由一览:`GET /skill-importer/health` · `GET /skill-importer/list` · `POST /skill-importer/import` · `POST /skill-importer/import-url` · `POST /skill-importer/delete`
|
|
113
|
+
|
|
114
|
+
### 本地源码安装
|
|
115
|
+
|
|
116
|
+
```sh
|
|
117
|
+
npm install
|
|
118
|
+
npm run build
|
|
119
|
+
dsh plugin --profile web add /path/to/dsh-skill-importer
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
随后添加上文的 profile 配置并重启 dsh Web。
|
|
123
|
+
|
|
124
|
+
## 注意事项
|
|
125
|
+
|
|
126
|
+
- 单个导入文件最大 256 KB。
|
|
127
|
+
- URL 导入会原样保留 `.md`;HTML 页面仅做轻量正文提取,因此推荐使用 Markdown 直链。
|
|
128
|
+
- 导入后列表会短暂轮询(每 2 秒一次,最多 20 秒);外部改动可点击 **刷新** 立即同步。
|
|
129
|
+
|
|
130
|
+
## License
|
|
131
|
+
|
|
132
|
+
基于 [MIT License](LICENSE) 开源。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# dsh-skill-importer bundle patch: one plugin row, applied as a bundle layer.
|
|
2
|
+
# Declared by the package's dsh.bundle manifest; `dsh plugin --profile <p> add
|
|
3
|
+
# dsh-skill-importer` appends it to the profile's bundle stack automatically.
|
|
4
|
+
- insert:
|
|
5
|
+
- id: skill-importer
|
|
6
|
+
name: 'dsh-skill-importer'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-skill-importer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Web UI plugin for DeepSeek Harness: import skills from local Markdown files or URLs into the skill roots the harness discovers automatically",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -27,12 +27,16 @@
|
|
|
27
27
|
"@deepseek-ai/dsh-api-remotes"
|
|
28
28
|
],
|
|
29
29
|
"platform": "web"
|
|
30
|
+
},
|
|
31
|
+
"bundle": {
|
|
32
|
+
"patch": "./cordis.patch.yml"
|
|
30
33
|
}
|
|
31
34
|
},
|
|
32
35
|
"files": [
|
|
33
36
|
"lib/index.js",
|
|
34
37
|
"lib/client.js",
|
|
35
|
-
"lib/types/**/*.d.ts"
|
|
38
|
+
"lib/types/**/*.d.ts",
|
|
39
|
+
"cordis.patch.yml"
|
|
36
40
|
],
|
|
37
41
|
"scripts": {
|
|
38
42
|
"build": "rm -rf lib && tsc -p tsconfig.json && tsdown",
|