dsh-skill-importer 0.1.2 → 0.2.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/README.md +10 -4
- package/README.zh.md +11 -5
- package/lib/client.js +1142 -304
- package/lib/index.js +307 -13
- package/lib/types/client/index.d.ts +7 -1
- package/lib/types/client/locales.d.ts +56 -8
- package/lib/types/index.d.ts +5 -1
- package/lib/types/server.d.ts +30 -1
- package/lib/types/types.d.ts +48 -3
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
| Import | Organize | Invoke |
|
|
28
28
|
| :--- | :--- | :--- |
|
|
29
|
-
| Upload `SKILL.md
|
|
29
|
+
| Upload `SKILL.md`, paste a URL, or migrate a complete skills directory from Claude Code, Codex, and similar agents. | Browse skills grouped across project and global roots. Remove any copy individually. | Use the composer picker, run `/skills`, or type `/skill-name` directly. |
|
|
30
30
|
|
|
31
31
|
### Built for a fast loop
|
|
32
32
|
|
|
@@ -37,6 +37,12 @@
|
|
|
37
37
|
- **Bilingual UI** — English and Chinese copy follows the harness locale.
|
|
38
38
|
- **Safe by design** — fixed skill roots, 256 KB limit, and same-origin POST checks.
|
|
39
39
|
|
|
40
|
+
### Batch migration with a real preflight
|
|
41
|
+
|
|
42
|
+
The third import entry accepts a local skills root such as `~/.claude/skills`, `~/.codex/skills`, or another `.agents/skills` directory. It scans before it writes, validates every `SKILL.md`, preserves each skill's `scripts`, `references`, `assets`, and other resources, and reports invalid entries without touching the destination.
|
|
43
|
+
|
|
44
|
+
Destination name conflicts are skipped by default. Choose **Replace** per skill, review the add/replace/skip summary, then confirm. Each accepted skill is copied through a same-root staging directory; replacements keep a temporary backup and roll back if the swap fails. A preflight is single-use, expires after ten minutes, and verifies source-content fingerprints again at commit time.
|
|
45
|
+
|
|
40
46
|
## Three natural ways to use a skill
|
|
41
47
|
|
|
42
48
|
1. **Composer picker** — open the pill beside the access-mode selector, search by name, and choose.
|
|
@@ -64,7 +70,7 @@ Add the following entry to `$DSH_HOME/profiles/web/cordis.patch.yml`:
|
|
|
64
70
|
|
|
65
71
|
### 3. Restart dsh Web
|
|
66
72
|
|
|
67
|
-
Open **Settings → Skills**. Import a Markdown file or URL, choose a target
|
|
73
|
+
Open **Settings → Skills**. Import a Markdown file or URL, or choose **Batch import** to migrate another agent's complete skills directory. Choose a target and the imported skills will appear as soon as the filesystem watcher discovers them.
|
|
68
74
|
|
|
69
75
|
> Requires DeepSeek Harness `>= 0.1.0-rc.6` via `npx @deepseek-ai/dsh web`.
|
|
70
76
|
|
|
@@ -90,7 +96,6 @@ POST routes verify the `Origin` header and only accept loopback sources (`127.0.
|
|
|
90
96
|
| Scope | Directory |
|
|
91
97
|
| :--- | :--- |
|
|
92
98
|
| Project | `.agents/skills` |
|
|
93
|
-
| Legacy project | `.dsh/skills` |
|
|
94
99
|
| Global | `~/.dsh/skills` |
|
|
95
100
|
|
|
96
101
|
## Development
|
|
@@ -109,7 +114,7 @@ npm run build
|
|
|
109
114
|
| Composer picker | `src/client/SkillsPicker.tsx` |
|
|
110
115
|
| Settings experience | `src/client/SkillImporterSection.tsx` |
|
|
111
116
|
|
|
112
|
-
Available routes: `GET /skill-importer/health` · `GET /skill-importer/list` · `POST /skill-importer/import` · `POST /skill-importer/import-url` · `POST /skill-importer/delete`
|
|
117
|
+
Available routes: `GET /skill-importer/health` · `GET /skill-importer/list` · `POST /skill-importer/import` · `POST /skill-importer/import-url` · `POST /skill-importer/delete` · `POST /skill-importer/batch/scan` · `POST /skill-importer/batch/commit`
|
|
113
118
|
|
|
114
119
|
### Local checkout
|
|
115
120
|
|
|
@@ -124,6 +129,7 @@ Add the profile entry shown above, then restart dsh Web.
|
|
|
124
129
|
## Notes
|
|
125
130
|
|
|
126
131
|
- A single imported file may be up to 256 KB.
|
|
132
|
+
- Batch import accepts up to 200 skills per scan; each skill may contain up to 2,000 files and 10 MB of resources. Symbolic links are refused.
|
|
127
133
|
- URL import preserves `.md` sources; HTML pages use lightweight text extraction, so direct Markdown URLs work best.
|
|
128
134
|
- The installed list polls briefly after import (every 2 seconds for up to 20 seconds). **Refresh** syncs external changes immediately.
|
|
129
135
|
|
package/README.zh.md
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
| 导入 | 管理 | 调用 |
|
|
28
28
|
| :--- | :--- | :--- |
|
|
29
|
-
| 上传 `SKILL.md
|
|
29
|
+
| 上传 `SKILL.md`、粘贴 URL,或从 Claude Code、Codex 等 Agent 的技能目录完整迁移。 | 按项目和全局目录分组查看,每个副本都能独立删除。 | 使用输入框选择器、运行 `/skills`,或直接输入 `/skill-name`。 |
|
|
30
30
|
|
|
31
31
|
### 为高速工作流而生
|
|
32
32
|
|
|
@@ -37,6 +37,12 @@
|
|
|
37
37
|
- **中英双语** — UI 文案自动跟随 harness 语言。
|
|
38
38
|
- **安全边界清晰** — 固定技能目录、256 KB 限制、同源 POST 校验。
|
|
39
39
|
|
|
40
|
+
### 带完整预检的批量迁移
|
|
41
|
+
|
|
42
|
+
第三个导入入口支持选择 `~/.claude/skills`、`~/.codex/skills` 或其他 `.agents/skills` 目录。写入前会扫描并校验每个 `SKILL.md`,同时完整保留技能的 `scripts`、`references`、`assets` 等资源;不合规项只展示错误,绝不会写入目标目录。
|
|
43
|
+
|
|
44
|
+
目标中存在同名技能时默认跳过。用户可逐项勾选「替换」,检查新增、替换和跳过数量后再确认。每个技能先复制到目标根目录下的临时目录;替换时会暂存旧版本,交换失败自动回滚。扫描结果只能提交一次、十分钟后过期,并在提交时重新核对源内容摘要。
|
|
45
|
+
|
|
40
46
|
## 三种自然的技能入口
|
|
41
47
|
|
|
42
48
|
1. **输入框选择器** — 点击权限模式旁边的 pill,按名称搜索并选中。
|
|
@@ -64,7 +70,7 @@ dsh plugin --profile web add dsh-skill-importer
|
|
|
64
70
|
|
|
65
71
|
### 3. 重启 dsh Web
|
|
66
72
|
|
|
67
|
-
打开 **设置 → 技能**,选择 Markdown
|
|
73
|
+
打开 **设置 → 技能**,选择 Markdown 文件、粘贴 URL,或通过「批量导入」迁移其他 Agent 的完整技能目录,再选择目标范围。文件系统 watcher 发现后,技能会立即出现。
|
|
68
74
|
|
|
69
75
|
> 需要 DeepSeek Harness `>= 0.1.0-rc.6`,使用 `npx @deepseek-ai/dsh web` 运行。
|
|
70
76
|
|
|
@@ -85,12 +91,11 @@ Markdown 文件或 URL
|
|
|
85
91
|
skills/change → 热刷新
|
|
86
92
|
```
|
|
87
93
|
|
|
88
|
-
所有 POST 路由都会校验 `Origin`,仅接受 loopback 来源(`127.0.0.1` 或 `localhost
|
|
94
|
+
所有 POST 路由都会校验 `Origin`,仅接受 loopback 来源(`127.0.0.1` 或 `localhost`)。写入范围固定为两个标准目录:
|
|
89
95
|
|
|
90
96
|
| 范围 | 目录 |
|
|
91
97
|
| :--- | :--- |
|
|
92
98
|
| 项目 | `.agents/skills` |
|
|
93
|
-
| 旧版项目 | `.dsh/skills` |
|
|
94
99
|
| 全局 | `~/.dsh/skills` |
|
|
95
100
|
|
|
96
101
|
## 开发
|
|
@@ -109,7 +114,7 @@ npm run build
|
|
|
109
114
|
| 输入框技能选择器 | `src/client/SkillsPicker.tsx` |
|
|
110
115
|
| 设置页 | `src/client/SkillImporterSection.tsx` |
|
|
111
116
|
|
|
112
|
-
路由一览:`GET /skill-importer/health` · `GET /skill-importer/list` · `POST /skill-importer/import` · `POST /skill-importer/import-url` · `POST /skill-importer/delete`
|
|
117
|
+
路由一览:`GET /skill-importer/health` · `GET /skill-importer/list` · `POST /skill-importer/import` · `POST /skill-importer/import-url` · `POST /skill-importer/delete` · `POST /skill-importer/batch/scan` · `POST /skill-importer/batch/commit`
|
|
113
118
|
|
|
114
119
|
### 本地源码安装
|
|
115
120
|
|
|
@@ -124,6 +129,7 @@ dsh plugin --profile web add /path/to/dsh-skill-importer
|
|
|
124
129
|
## 注意事项
|
|
125
130
|
|
|
126
131
|
- 单个导入文件最大 256 KB。
|
|
132
|
+
- 批量导入每次最多扫描 200 个技能;单个技能最多包含 2,000 个文件和 10 MB 资源,不接受符号链接。
|
|
127
133
|
- URL 导入会原样保留 `.md`;HTML 页面仅做轻量正文提取,因此推荐使用 Markdown 直链。
|
|
128
134
|
- 导入后列表会短暂轮询(每 2 秒一次,最多 20 秒);外部改动可点击 **刷新** 立即同步。
|
|
129
135
|
|