dsh-skills-tools 1.0.0 → 1.1.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/README.en.md CHANGED
@@ -1,80 +1,127 @@
1
- # dsh-skills-tools
1
+ <p align="center">
2
+ <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-skills-tools@main/docs/logo.png" width="72" height="72" alt="dsh-skills-tools" />
3
+ </p>
2
4
 
3
- Manage Agent Skills as assets: import them from a Git repository (GitHub, GitLab or your intranet) or a local folder, then enable, disable, update and remove them in **Settings → Skills** — the Cursor-like workflow for the DSH skill catalog.
5
+ <h1 align="center">dsh-skills-tools</h1>
4
6
 
5
- - Version **1.0.0**, MIT, zero dependencies, ESM host + classic-script client
6
- - Settings section **Skills** (order 19, right after MCP)
7
+ <p align="center">
8
+ <b>Skills manager for DeepSeek Harness.</b><br />
9
+ Import Agent Skills from Git repositories or local folders, manage them by repository, and enable, disable, complete or inspect them at any time.
10
+ </p>
7
11
 
8
- ## Why
12
+ <p align="center">
13
+ <a href="https://www.npmjs.com/package/dsh-skills-tools"><img src="https://img.shields.io/npm/v/dsh-skills-tools?color=black" alt="npm version" /></a>
14
+ <a href="https://www.npmjs.com/package/dsh-skills-tools"><img src="https://img.shields.io/npm/dm/dsh-skills-tools?color=black" alt="npm downloads" /></a>
15
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-black.svg" alt="license" /></a>
16
+ <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D22.13-black.svg" alt="node" /></a>
17
+ <a href="https://github.com/hxlog/dsh-skills-tools"><img src="https://img.shields.io/badge/GitHub-hxlog%2Fdsh--skills--tools-black?logo=github" alt="GitHub" /></a>
18
+ </p>
9
19
 
10
- Claude Code ships a **/skills** menu with on/off overrides, Cursor discovers .cursor/skills and plugin marketplaces, and Codex uses skill-installer to copy skills from GitHub. DSH native discovery scans directories but does not import, snapshot or toggle them.
20
+ <p align="center">
21
+ <a href="https://github.com/hxlog/dsh-skills-tools">GitHub</a> ·
22
+ <a href="https://www.npmjs.com/package/dsh-skills-tools">npm</a> ·
23
+ <a href="https://github.com/hxlog/dsh-skills-tools/issues">Issues</a> ·
24
+ <a href="README.md">中文</a>
25
+ </p>
11
26
 
12
- dsh-skills-tools fills that gap:
27
+ <p align="center">
28
+ <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-skills-tools@main/docs/screenshots/skills-overview.png" width="49%" alt="Skills grouped by repository" />
29
+ <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-skills-tools@main/docs/screenshots/skill-content.png" width="49%" alt="Expanded SKILL.md content" />
30
+ </p>
13
31
 
14
- 1. **Import** from a Git URL (or local folder), optionally pinned to a branch, tag, commit or subdirectory.
15
- 2. **Enable / disable** instantly; the DSH catalog is invalidated and disabled skills never reach the model context.
16
- 3. **Read-only snapshots**: each repository is copied by commit into the data folder; the source is never modified.
17
- 4. **Content-addressed updates**: check the remote head, then switch snapshots only after a successful clone.
18
- 5. **Resources keep working**: skills register with resourceBase = { kind: "directory", path: snapshot/skill }, so ../../assets and ../check/... references resolve.
32
+ > Disabled skills are not registered with the model: no context cost, no accidental calls.
19
33
 
20
- ## Install
34
+ ## ✨ Features
21
35
 
22
- dsh plugin add dsh-skills-tools
23
- # or from a checkout
24
- dsh plugin add file:D:/PythonProjects/dsh-skills-tools
36
+ | Capability | Details |
37
+ | --- | --- |
38
+ | **Grouped by repository** | Skills are grouped into collapsible repository cards. Repositories with enabled skills come first; inside a repository, enabled skills come first. |
39
+ | **Import the rest later** | A partially imported repository shows "N available". Click **Import more** to pick the remaining skills from the existing snapshot — no re-clone. |
40
+ | **Repository switch** | Enable or disable every skill in a repository at once; the switch shows a mixed state when only some skills are enabled. |
41
+ | **Inline content** | The chevron on each row expands the SKILL.md text, source repository, commit, path and update time, with update and remove actions. |
42
+ | **Git import and snapshots** | https / ssh / intranet repositories, branches, tags, commits and subdirectories. Imports are read-only snapshots; source repositories are never modified. |
43
+ | **Update checks** | Compare the remote head and switch snapshots only after a successful clone. |
25
44
 
26
- Add the bundle row to a profile's cordis.patch.yml if you prefer:
45
+ <p align="center">
46
+ <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-skills-tools@main/docs/screenshots/import-more.png" width="49%" alt="Import remaining skills from a repository" />
47
+ <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-skills-tools@main/docs/screenshots/import-dialog.png" width="49%" alt="Import skills" />
48
+ </p>
27
49
 
28
- - insert:
29
- - id: skills-tools
30
- name: dsh-skills-tools
50
+ ## 🚀 Install
31
51
 
32
- Restart DSH, then open **Settings → Skills**.
52
+ Requires **DeepSeek Harness 0.2.x** (Web GUI `dsh web` or DSH Desktop) and **Node.js ≥ 22.13**. Published on npm: [dsh-skills-tools](https://www.npmjs.com/package/dsh-skills-tools).
33
53
 
34
- ## Usage
54
+ > ⚠️ This is a **DeepSeek Harness plugin**, not a normal npm library: `npm i dsh-skills-tools` only downloads the package, it still has to be installed into a DSH profile.
35
55
 
36
- 1. **Import skills** → paste a repository URL or local path.
37
- 2. Optionally pin a ref (branch / tag / commit) or a subdirectory.
38
- 3. **Scan**, select skills (duplicate names get an editable suggestion), then **Install selected**.
39
- 4. Toggle rows on/off, search and filter, expand a row to read SKILL.md or update/remove it.
40
- 5. **Check updates** marks skills whose repository has a newer commit; **Update from upstream** clones and switches the snapshot.
56
+ **Install from the plugin page (recommended)**
41
57
 
42
- Supported sources: https://host/owner/repo(.git), GitHub-style /tree/<ref>/<subdir>, git@host:owner/repo.git, file:///path, and absolute local paths.
58
+ 1. Open DSH Web (or DSH Desktop) → **Plugins** (Desktop: **Settings → Plugins**).
59
+ 2. Click install, enter `dsh-skills-tools`, confirm.
60
+ 3. Enable the new bundle, refresh, then open **Settings → Skills**.
43
61
 
44
- ## Intranet and private repositories
62
+ **Install from the CLI**
45
63
 
46
- No token is stored. The plugin reuses your local git credentials (credential helper or SSH agent) and sets GIT_TERMINAL_PROMPT=0 so a missing credential fails fast instead of hanging.
64
+ ```bash
65
+ dsh plugin add dsh-skills-tools # default profile
66
+ dsh plugin --profile web add dsh-skills-tools # Web
67
+ dsh plugin --profile desktop add dsh-skills-tools # Desktop
68
+ ```
47
69
 
48
- ## Architecture
70
+ Current version **1.1.1**: grouped by repository, repository switch, and completing skills from an existing snapshot.
49
71
 
50
- Git repo / local folder
51
- → clone --depth 1 --single-branch (or direct read)
52
- → $DSH_HOME/dsh-skills-tools/repos/<slug>-<commit> read-only snapshot
53
- → scan SKILL.md (skips .git and symlinks, bounded depth/files)
54
- → $DSH_HOME/dsh-skills-tools/state.json repos + skills + enabled
55
- → ctx.skills.registerProvider(rank 350)
56
- → DSH catalog (enabled skills with an existing SKILL.md only)
72
+ > Restart `dsh web` / DSH Desktop after upgrading.
73
+ >
74
+ > `dsh plugin add` only installs the package; it does not enable the bundle. Enable it once in the plugin page, or make sure `dsh-skills-tools` is in `dsh.profile.bundles`.
57
75
 
58
- Ranks: project-dsh 100, project-agents 200, **dsh-skills-tools 350**, user-dsh 400, user-agents 500, bundled 600.
76
+ ## ⚡ Quick start
59
77
 
60
- State writes use a directory lock plus atomic rename; the provider memoizes by state.json mtime, so several DSH windows share one library.
78
+ 1. **Settings → Skills → Import skills**: paste a Git URL (`https://`, `git@`, `file://` or a local absolute path). Intranet repositories use your local git credentials.
79
+ 2. Optionally set a **branch / tag / commit** and **subdirectory**, click **Scan**, select skills (duplicate names get an editable suggestion) and click **Install selected**. Installed skills are enabled.
80
+ 3. Manage by repository: the repository switch toggles all its skills, row switches toggle one, **Import more** completes partially imported repositories, and the chevron shows the content.
61
81
 
62
- ## Security
82
+ ## 🧩 How it works
63
83
 
64
- - Every route is gated by DSH connection.requestRejection (Host/Origin/session); other local processes cannot drive the library.
65
- - 256 KiB request body cap, 20000 files / 300 MiB snapshot cap, 2 MiB SKILL.md cap.
66
- - Snapshots never follow symlinks; paths are verified to stay inside the snapshot; removal is verified to stay inside repos/.
67
- - Repository scripts are never executed; git runs with an argv array, never through a shell.
84
+ ```
85
+ ~/.dsh/dsh-skills-tools/
86
+ ├── state.json repositories, skills, enabled state
87
+ └── repos/<repo>-<commit>/ read-only snapshot
88
+ ```
68
89
 
69
- ## Development
90
+ - **Snapshot isolation**: every import or update copies the repository into the data folder. Removing a skill only changes state.
91
+ - **Registration-time toggles**: enabled state decides whether a skill is registered with the DSH skill catalog; disabled skills never reach the model.
92
+ - **REST API**: `GET /skills-tools/api/state`, `POST /import/scan|commit`, `POST /repos/inspect|import|toggle|check-updates`, `POST /skills/toggle|bulk|remove|update`, `POST /refresh`, `GET /logs`. See [docs/API.md](docs/API.md).
70
93
 
71
- npm test
72
- npm run test:manager
73
- npm run ci-check
74
- node scripts/build-client.mjs
94
+ ## 🔒 Security
75
95
 
76
- Client source: client/client.src.js + client/ui.css → built into client/client.js (inlined CSS, classic script).
96
+ - **No tokens stored**: git authentication stays with your credential helper or SSH key.
97
+ - **Read-only snapshots**: imports and updates never modify your repositories.
98
+ - **No telemetry**: no network requests besides the Git repositories you configure.
77
99
 
78
- ## License
100
+ ## 📋 Requirements and limits
79
101
 
80
- MIT © 2026 Xingyu Liu
102
+ - **Runtime**: DeepSeek Harness 0.2.x (Web or Desktop), **Node.js ≥ 22.13**
103
+ - **Platforms**: DSH Web (`--profile web`) and DSH Desktop (`--profile desktop`)
104
+ - **Files**: reads and writes `~/.dsh/dsh-skills-tools/`; reads the local folder only when you import one
105
+ - **Network**: only the Git repositories you configure, during import and update checks
106
+ - **Processes**: invokes local `git` for import and update checks
107
+
108
+ **Known limits**
109
+
110
+ - Manages the skills of the current DSH profile only
111
+ - Git sources require local `git`; intranet repositories need working credentials
112
+ - Content preview is capped at 64 KiB
113
+
114
+ ## ❓ FAQ
115
+
116
+ | Question | Answer |
117
+ | --- | --- |
118
+ | No Skills section in Settings | The bundle is probably not enabled. Enable it in the plugin page, refresh, then restart `dsh web` if needed. |
119
+ | Import fails | Complete git authentication first; verify the branch / subdirectory and that the repository contains SKILL.md files. |
120
+ | Can the model still call a disabled skill? | No. Disabled skills are not registered. |
121
+ | Where is the data? | `~/.dsh/dsh-skills-tools/state.json`; delete it to reset. |
122
+
123
+ ## 📄 License
124
+
125
+ [MIT](LICENSE) · Powered by [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)
126
+
127
+ [![](https://img.shields.io/badge/powered_by-dsh-4D6BFE?style=flat-square&logo=deepseek&logoColor=white)](https://github.com/deepseek-ai/deepseek-harness)
package/README.md CHANGED
@@ -1,158 +1,138 @@
1
- # dsh-skills-tools
1
+ <p align="center">
2
+ <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-skills-tools@main/docs/logo.png" width="72" height="72" alt="dsh-skills-tools" />
3
+ </p>
2
4
 
3
- 把 Agent Skills 当作可管理的资产:从 Git 仓库(GitHub、GitLab、公司内网)或本机目录导入,在 **设置 → 技能** 中随时启用、停用、更新和移除,像 Cursor 管理 Skills 一样管理 DSH 的技能目录。
5
+ <h1 align="center">dsh-skills-tools</h1>
4
6
 
5
- - 版本:**1.0.0** · 许可:MIT · 零依赖 · 宿主 ESM + 经典脚本客户端
6
- - 设置入口:**设置 → 技能**(第 19 个分区,紧随 MCP 之后)
7
+ <p align="center">
8
+ <b>DeepSeek Harness 的 Skills 管理器。</b><br />
9
+ 从 Git 仓库或本机目录导入 Agent Skills,按仓库分组管理,随时启用、停用、补齐和查看内容。
10
+ </p>
7
11
 
8
- ## 为什么需要它
12
+ <p align="center">
13
+ <a href="https://www.npmjs.com/package/dsh-skills-tools"><img src="https://img.shields.io/npm/v/dsh-skills-tools?color=black" alt="npm version" /></a>
14
+ <a href="https://www.npmjs.com/package/dsh-skills-tools"><img src="https://img.shields.io/npm/dm/dsh-skills-tools?color=black" alt="npm downloads" /></a>
15
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-black.svg" alt="license" /></a>
16
+ <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D22.13-black.svg" alt="node" /></a>
17
+ <a href="https://github.com/hxlog/dsh-skills-tools"><img src="https://img.shields.io/badge/GitHub-hxlog%2Fdsh--skills--tools-black?logo=github" alt="GitHub" /></a>
18
+ </p>
9
19
 
10
- Claude Code 用 **/skills** 菜单开关技能,Cursor 用 **.cursor/skills** 与插件市场分发技能,Codex 用 **skill-installer** 从 GitHub 拷贝技能目录。它们都提供「安装、查看、开关、更新、删除」这一套动作;DSH 原生的技能发现只负责扫描目录,不负责导入、快照和开关。
20
+ <p align="center">
21
+ <a href="https://github.com/hxlog/dsh-skills-tools">GitHub 仓库</a> ·
22
+ <a href="https://www.npmjs.com/package/dsh-skills-tools">npm</a> ·
23
+ <a href="https://github.com/hxlog/dsh-skills-tools/issues">问题反馈</a> ·
24
+ <a href="README.en.md">English</a>
25
+ </p>
11
26
 
12
- dsh-skills-tools 补上这一层:
27
+ <p align="center">
28
+ <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-skills-tools@main/docs/screenshots/skills-overview.png" width="49%" alt="按仓库分组的技能列表" />
29
+ <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-skills-tools@main/docs/screenshots/skill-content.png" width="49%" alt="展开查看 SKILL.md 内容" />
30
+ </p>
13
31
 
14
- 1. **导入**:粘贴 Git URL(或本机目录),可指定分支、标签、提交和子目录,一次扫描全部 SKILL.md。
15
- 2. **启用 / 停用**:开关即时生效并让 DSH 技能目录失效重载;停用的技能不会进入模型上下文。
16
- 3. **只读快照**:仓库按提交复制到数据目录,原目录与远端永远不被修改;删除技能不会影响仓库。
17
- 4. **按内容寻址的更新**:检查上游最新提交,确认后再切换快照。
18
- 5. **资源完整**:技能以「目录 + resourceBase」注册,因此 ../../assets、../check/xxx 这类相对引用仍然可用。
32
+ > 停用的技能不会注册进模型:不占上下文,也无法被误调用。
19
33
 
20
- ## 安装
34
+ ## ✨ 功能
21
35
 
22
- DSH 插件(任选其一):
36
+ | 能力 | 说明 |
37
+ | --- | --- |
38
+ | **按仓库分组** | 技能按来源仓库聚合为可折叠的仓库卡片;有启用技能的仓库优先,仓库内已启用的技能优先。 |
39
+ | **部分导入补齐** | 只导入了部分技能的仓库显示「可导入 N 个」,点「导入更多」从现有快照里勾选剩余技能,不重新克隆。 |
40
+ | **仓库级开关** | 一键启用或停用整个仓库;部分启用时开关显示半选状态。 |
41
+ | **展开查看内容** | 行右侧箭头展开 SKILL.md 正文、来源仓库、提交、路径与更新时间,也可就地更新或移除。 |
42
+ | **Git 导入与快照** | 支持 https / ssh / 内网仓库、分支 / 标签 / 提交与子目录;导入的是只读快照,原目录和远端不会被修改。 |
43
+ | **检查更新** | 对比上游最新提交,确认后再切换快照;多个仓库可一次检查。 |
23
44
 
24
- # 已发布到 npm 后
25
- dsh plugin add dsh-skills-tools
45
+ <p align="center">
46
+ <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-skills-tools@main/docs/screenshots/import-more.png" width="49%" alt="从仓库补齐剩余技能" />
47
+ <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-skills-tools@main/docs/screenshots/import-dialog.png" width="49%" alt="导入技能" />
48
+ </p>
26
49
 
27
- # 本地开发
28
- dsh plugin add file:D:/PythonProjects/dsh-skills-tools
50
+ ## 🚀 安装
29
51
 
30
- 也可以把插件行加进 profile 的 cordis.patch.yml:
52
+ 需要 **DeepSeek Harness 0.2.x**(Web GUI `dsh web` 或 DSH Desktop)与 **Node.js ≥ 22.13**,包已发布到 npm:[dsh-skills-tools](https://www.npmjs.com/package/dsh-skills-tools)。
31
53
 
32
- - insert:
33
- - id: skills-tools
34
- name: dsh-skills-tools
54
+ > ⚠️ 这是一个 **DeepSeek Harness 插件**,不是普通 npm 依赖库:`npm i dsh-skills-tools` 只会下载包,运行时仍需装进 DSH profile。
35
55
 
36
- 安装后重启 DSH,打开 **设置 → 技能**。
56
+ **通过插件页安装(推荐)**
37
57
 
38
- ## 使用
58
+ 1. 打开 DSH Web(或 DSH Desktop)→ 侧边栏 **插件**(Desktop 在 **设置 → 插件**)。
59
+ 2. 点击安装,填入 `dsh-skills-tools`,确认。
60
+ 3. 启用新 bundle,刷新页面,打开 **设置 → 技能**。
39
61
 
40
- ### 导入技能
62
+ **通过命令行安装**
41
63
 
42
- 1. 点击右上角 **导入技能**。
43
- 2. 填写 **仓库 URL 或本机目录**,例如 https://code.comein.cn/ai/luban.git 或 D:/work/my-skills。
44
- 3. 可选:填写分支 / 标签 / 提交(例如 pro),或子目录(例如 skills)缩小扫描范围。
45
- 4. 点击 **扫描**,勾选要安装的技能;重名项会自动给出建议名称(可修改)。
46
- 5. 点击 **安装选中**。安装即启用。
64
+ ```bash
65
+ dsh plugin add dsh-skills-tools # 默认 profile
66
+ dsh plugin --profile web add dsh-skills-tools # Web
67
+ dsh plugin --profile desktop add dsh-skills-tools # Desktop
68
+ ```
47
69
 
48
- 支持的地址形式:
70
+ 当前版本 **1.1.1**:按仓库分组、仓库级开关、从快照补齐剩余技能,插件名与图标和设置页一致。
49
71
 
50
- - https://host/owner/repo、https://host/owner/repo.git
51
- - https://host/owner/repo/tree/<ref>/<subdir>(GitHub 风格)
52
- - git@host:owner/repo.git(SSH)
53
- - file:///path/to/repo
54
- - 本机绝对路径(会复制快照,不修改原目录)
72
+ > 升级包版本后需要重启 `dsh web` / 重启 DSH Desktop。
73
+ >
74
+ > `dsh plugin add` 只负责把包装进 profile,**不会自动启用 bundle**:装完请在插件页启用一次,或确认 profile 的 `dsh.profile.bundles` 已包含 `dsh-skills-tools`。
55
75
 
56
- ### 启用、停用与批量操作
76
+ ## ⚡ 快速开始
57
77
 
58
- - 行首开关:即时启用或停用单个技能。
59
- - 工具栏:全部启用、全部停用。
60
- - 搜索:按名称、描述、路径或仓库过滤;筛选:全部 / 已启用 / 已停用。
61
- - 展开行:查看 SKILL.md 原文、来源、提交、快照路径,执行「从上游更新」「移除」「复制路径」。
78
+ 1. **设置 → 技能 → 导入技能**:粘贴 Git 地址(支持 `https://`、`git@`、`file://` 与本机绝对路径),内网仓库直接使用本机 git 凭据。
79
+ 2. 可选填**分支 / 标签 / 提交**与**子目录**,点 **扫描**;勾选要安装的技能,重名项会给出可修改的建议名称,点 **安装选中**。安装即启用。
80
+ 3. 回到列表按仓库管理:仓库开关批量启停,行开关控制单个技能,「导入更多」补齐同仓库剩余技能,点右侧箭头查看正文。
62
81
 
63
- ### 更新与移除
82
+ ## 🧩 工作原理
64
83
 
65
- - **检查更新**:对每个仓库执行 git ls-remote,标记有新提交的技能。
66
- - **从上游更新**:重新克隆并生成新快照;快照只在成功后切换,失败不会破坏现有可用状态。
67
- - **移除**:从技能库删除;当仓库的最后一个技能被移除时,旧快照会被清理。
84
+ ```
85
+ ~/.dsh/dsh-skills-tools/
86
+ ├── state.json 仓库、技能、启用状态与检查时间
87
+ └── repos/<仓库>-<提交>/ 只读快照
88
+ ```
68
89
 
69
- ## 内网与私有仓库
90
+ - **快照隔离**:每次导入或更新把仓库复制到数据目录,删除技能只删状态,不影响仓库与快照。
91
+ - **注册即生效**:启用状态决定技能是否注册进 DSH 技能目录;停用即从模型上下文移除。
92
+ - **REST 接口**:`GET /skills-tools/api/state`、`POST /import/scan|commit`、`POST /repos/inspect|import|toggle|check-updates`、`POST /skills/toggle|bulk|remove|update`、`POST /refresh`、`GET /logs`;详见 [docs/API.md](docs/API.md)。
70
93
 
71
- 插件不保存任何令牌,直接复用本机 git 凭据:
94
+ ## 🔒 安全说明
72
95
 
73
- - HTTPS:系统 credential helper 已缓存的账号或令牌;
74
- - SSH:本机 SSH key / agent。
96
+ - **不保存令牌**:Git 认证交给本机 credential helper 或 SSH key,插件只调用 `git`。
97
+ - **只读快照**:导入与更新都写入数据目录,你的仓库目录与远端不会被修改。
98
+ - **无遥测**:除你填写的仓库地址外不发起任何网络请求。
75
99
 
76
- 克隆时设置 GIT_TERMINAL_PROMPT=0,凭据缺失会立即失败并提示,不会卡住设置页。
100
+ ## 📋 前置要求与权限边界
77
101
 
78
- ## 架构
102
+ - **运行环境**:DeepSeek Harness 0.2.x(Web `dsh web` 或 DSH Desktop),**Node.js ≥ 22.13**
103
+ - **支持平台**:DSH Web(`--profile web`)、DSH Desktop(`--profile desktop`)
104
+ - **文件访问**:读写插件数据目录 `~/.dsh/dsh-skills-tools/`;导入本机目录时只读取该目录
105
+ - **网络**:仅在导入、检查更新时访问你填写的 Git 仓库
106
+ - **进程**:导入 / 检查更新时调用本机 `git`
107
+ - **UI 注入**:设置页「设置 → 技能」面板,依赖 `@deepseek-ai/dsh-client-ui-settings` 与 `@deepseek-ai/dsh-client-locale`
79
108
 
80
- Git 仓库 / 本机目录
81
- │ git clone --depth 1 --single-branch (或直接读取)
82
- ▼
83
- $DSH_HOME/dsh-skills-tools/repos/<slug>-<commit> 只读快照
84
- │ 扫描 SKILL.md(跳过 .git、符号链接;深度与文件数有上限)
85
- ▼
86
- $DSH_HOME/dsh-skills-tools/state.json 仓库 + 技能 + enabled
87
- │ ctx.skills.registerProvider(rank 350)
88
- ▼
89
- DSH 技能目录(仅 enabled 且文件存在的技能)
109
+ **已知限制**
90
110
 
91
- - provider 名称:dsh-skills-tools,rank 350(低于项目级 100/200,高于用户级 400/500,因此同名时项目技能优先,管理器技能优先于用户目录技能)。
92
- - 每个技能以 resourceBase = { kind: "directory", path: <快照>/<技能目录> } 注册,所以 SKILL.md 里的相对资源引用可用。
93
- - 状态读取带 mtime 记忆;跨进程写入使用目录锁 + 临时文件原子替换,多个 DSH 窗口共享同一份状态。
94
- - 前端只做展示与调用,不直接读写文件。
111
+ - 只管理当前 DSH profile 的技能,切换 profile 需重新导入
112
+ - Git 来源需要本机安装 `git`;内网仓库需要事先配置好凭据
113
+ - 技能内容预览最多 64 KiB,超出部分以省略号截断
95
114
 
96
- ## 数据目录
115
+ ## ❓ 常见问题
97
116
 
98
- $DSH_HOME/dsh-skills-tools/
99
- state.json 技能与仓库状态
100
- logs.jsonl 最近操作日志(环形缓冲 300 条)
101
- repos/ 只读快照
102
- tmp/ 扫描与更新的临时克隆(自动清理)
103
- state.lock 写入锁(瞬时)
117
+ | 问题 | 处理 |
118
+ | --- | --- |
119
+ | 设置里没有「技能」分区 | 多半是 bundle 未启用:插件页确认并刷新,必要时重启 `dsh web`。 |
120
+ | 导入失败 | 内网仓库先在本机完成 git 认证;确认分支 / 子目录填写正确、仓库中存在 SKILL.md。 |
121
+ | 停用后模型还能调用吗 | 不能。停用的技能不会出现在模型工具列表中。 |
122
+ | 数据文件在哪 | `~/.dsh/dsh-skills-tools/state.json`;删除即重置,下次启动自动重建。 |
104
123
 
105
- DSH_HOME 默认为 ~/.dsh(Windows 为 %USERPROFILE%\.dsh)。
124
+ ## 🛠 开发
106
125
 
107
- ## 安全
126
+ ```bash
127
+ git clone https://github.com/hxlog/dsh-skills-tools.git
128
+ cd dsh-skills-tools
129
+ node scripts/build-client.mjs # 构建 client/client.js
130
+ npm test # 静态检查
131
+ npm run test:manager # 离线 manager 集成测试
132
+ ```
108
133
 
109
- - 所有管理接口位于 /skills-tools/api,先经过 DSH connection.requestRejection 的 Host/Origin/会话校验,其他本地进程无法直接驱动。
110
- - 请求体上限 256 KiB;快照上限 20000 文件 / 300 MiB;单文件 SKILL.md 上限 2 MiB。
111
- - 快照不跟随符号链接,路径必须落在快照目录内;删除操作校验目标位于 repos 之下。
112
- - 技能内容按原样呈现,不执行仓库中的脚本;git 命令以参数数组启动,不经过 shell。
113
- - 不写入仓库,不修改 SKILL.md,不调用远端 API(只有 git 传输本身)。
134
+ ## 📄 License
114
135
 
115
- ## HTTP API
136
+ [MIT](LICENSE) · Powered by [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)
116
137
 
117
- 前缀 /skills-tools/api,全部返回 JSON;失败为 { "ok": false, "error": "..." }。
118
-
119
- | 方法 | 路径 | 说明 |
120
- | --- | --- | --- |
121
- | GET | /state | 技能、仓库、统计、事件、数据目录 |
122
- | GET | /logs?limit=100 | 最近操作 |
123
- | POST | /import/scan | { url, ref?, subdir? } 克隆并扫描 |
124
- | POST | /import/commit | { scanId, skills: [{ relPath, name }] } 安装 |
125
- | POST | /skills/toggle | { name, enabled } |
126
- | POST | /skills/bulk | { action: all / none / invert } |
127
- | POST | /skills/remove | { name } |
128
- | POST | /skills/update | { name } 从上游更新所属仓库 |
129
- | POST | /repos/check-updates | 检查所有仓库最新提交 |
130
- | POST | /refresh | 重新解析本地 SKILL.md |
131
- | GET | /skills/content?name= | SKILL.md 原文(上限 64 KiB) |
132
-
133
- 详见 docs/API.md。
134
-
135
- ## 开发
136
-
137
- npm test # 离线 smoke:frontmatter、manager、provider、客户端 bundle
138
- npm run test:manager # 管理流程集成测试(临时 DSH_HOME + 本地 fixture 仓库)
139
- npm run ci-check # manifest / patch / ESM / 客户端 / i18n 契约检查
140
- node scripts/build-client.mjs # 修改 client/ui.css 后重新内联
141
-
142
- 客户端源码为 client/client.src.js + client/ui.css,构建产物是 client/client.js(内联 CSS、经典脚本、无模块语法)。CI 会校验产物可被 vm.Script 解析。
143
-
144
- ## 与原生技能的关系
145
-
146
- - 原生发现(dsh-skill-filesystem)继续工作;本项目只是额外的 provider。
147
- - 同名时按 rank 竞争:项目级技能(100/200)优先于本 provider(350),本 provider 优先于用户目录(400/500)。
148
- - 停用只影响本 provider 注册的技能,不会移动或修改原生目录中的文件。
149
-
150
- ## 已知限制
151
-
152
- - 同名技能的最终名称由导入时决定;DSH 注册表以 name 去重,同名冲突需要在导入对话框里改名。
153
- - 一个仓库只跟踪一个 ref;需要多分支并存时,请分别以不同子目录或不同仓库导入。
154
- - 快照是完整仓库副本;超大 monorepo 请用子目录扫描并在导入前确认体量。
155
-
156
- ## License
157
-
158
- MIT © 2026 Xingyu Liu
138
+ [![](https://img.shields.io/badge/powered_by-dsh-4D6BFE?style=flat-square&logo=deepseek&logoColor=white)](https://github.com/deepseek-ai/deepseek-harness)