@weibaohui/skills-management 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/README.md ADDED
@@ -0,0 +1,79 @@
1
+ # dsh-plugin-skills-management
2
+
3
+ ntd 技能市场 for DeepSeek Harness:**一个页面管理本机所有技能**。
4
+
5
+ - **执行器来源**(移植 ntd 来源表):扫描本机各 coding agent 的 skills 目录(`~/.claude/skills`、`~/.zcode/skills`、`~/.codex/skills`、`~/.agents/skills` 等 16 个),全部展示、可详情、可单文件预览;`agents` 为只读来源;任意执行器技能可一键复制进 DSH 用户库供 `skill` 工具调用。软链布局(各执行器目录 symlink 共享池)完整支持。
6
+ - **模型目录治理**(2026-08-29,2026-08-30 扩展):市场库存(6600+ 条)只作可浏览/可安装的货架,**不再注入对话的技能目录**(装进 DSH 用户库才对模型可见);已装技能可在详情页用"模型可调用"开关切换原生 frontmatter 键 `disable-model-invocation`(其余键保留),卡片带"已隐藏"标记与隐藏/恢复按钮;**开关同时覆盖 user-agents 根**(`~/.agents/skills`——dsh 内置把它全量扫进模型目录;同名冲突时优先改用户库,与 registry rank 一致),市场与只读源不受影响;市场 settings(含 access token)经宿主 settings 服务持久化到 `settings.yaml`,重启不再丢失。
7
+ :插件自己管理 ntd-resource 检出(ntd `git_sync` 同构):首次 `git clone --depth 1`,更新 `fetch + reset --hard`(远程永远赢,本地误删误改自愈);启动时后台静默同步 + 每日自动同步(可关);gitcode 私有仓库支持 access token(只写不回读,状态文件 0600 权限,凭证不落 .git/config)。
8
+ - **市场浏览**:读取 ntd 技能合集目录(默认 `~/.ntd/bundled/skills`,GitHub 开源技能仓库归档树),来源卡片/浏览全部/来源钻入三视图,安装进用户库;⚙ 设置面板查看同步状态、立即同步、编辑 url/分支/token/自动同步。
9
+ - 已安装库注册到 dsh 的 SkillRegistry —— 模型直接通过 `skill` 工具按名调用。
10
+
11
+
12
+ ## 安装
13
+
14
+ ```bash
15
+ dsh plugin --profile web add @weibaohui/skills-management -w
16
+ ```
17
+
18
+ 装完重启 `dsh web` 即生效。
19
+
20
+ ## 发版(维护者)
21
+
22
+ ```bash
23
+ npm version patch # bump + commit + tag
24
+ git push --follow-tags
25
+ gh release create vX.Y.Z --generate-notes # 创建 Release 触发自动发布到 npm
26
+ ```
27
+
28
+ 发布由 GitHub Actions 完成(Release published 触发;打 tag 不发布),走 npm Trusted Publishing 免 token。
29
+
30
+ ## 安装
31
+
32
+ ```bash
33
+ dsh plugin --profile web add 'github:weibaohui/dsh-plugins#path:skills' -w
34
+ ```
35
+
36
+ ## 功能
37
+
38
+ - **Provider 注册**:向 `ctx.skills` 注册 `ntd-skills` provider。已安装库(rank 100)遮蔽市场同名技能(rank 500);frontmatter 的 `disable-model-invocation` / `user-invocable` 控制双面调用策略;解析失败的 SKILL.md warn + skip。执行器目录仅做管理展示,不自动进 provider。
39
+ - **执行器扫描**:`GET /executors` 按 ntd 的来源表逐源递归扫描(跳过 `.git`/`node_modules`,跟随 symlink 且有环路防护)。三种用法配合分层加载:全量(含 skills 数组)、`?mode=summary`(只要计数,首屏)、`?executor=<key>`(单来源完整列表,钻入时懒加载);技能条目含 fileCount/totalSize;嵌套目录以相对路径为显示名。detail / file / DELETE / install 均支持 `executor=` 参数按源定位。
40
+ - **市场浏览**:递归扫描市场目录,按来源(GitHub 仓库)分组,搜索/筛选;详情看 SKILL.md 全文与文件清单。
41
+ - **安装**:市场技能整目录复制进用户库 `$DSH_HOME/skills/<短名>/`;执行器技能经 `POST /install {name, from:<executor>}` 复制进同一位置;同名覆盖 = 更新(`overwrite`)。装完 `invalidate()`,`skill` 工具目录立即可见。
42
+ - **删除**:`DELETE {name, executor}` 按源删除;缺省 executor 即 DSH 用户库;只读来源(`agents`)拒删,市场目录只读。
43
+ - **HTTP API**:`/skills-management/api` 下 `GET /`(市场+已安装)、`GET /executors`、`GET /detail?name=&executor=`、`GET /file?name=&path=&executor=`、`POST /install`、`DELETE /`、`GET /market/status`、`POST /market/sync`、`PUT /market/settings`。
44
+
45
+ ## 与 ntd 的差异
46
+
47
+ 执行器的发现/展示/删除/跨源复制已迁移(ntd `handlers/skills.rs` 同构);跨执行器批量 sync 矩阵、version-update 对比、zip 导入导出、调用追踪、市场 git 同步不迁移:dsh 单执行器,「同步」被「从执行器/市场安装进用户库」取代;调用可从 dsh 会话日志投影。
48
+
49
+ ## Config(cordis.yml)
50
+
51
+ | key | 默认 | 说明 |
52
+ |---|---|---|
53
+ | `marketDirs` | `['~/.ntd/bundled/skills']` | 市场库目录列表(可指向任意技能合集 git 检出) |
54
+ | `installedDir` | `$DSH_HOME/skills` | 用户库目录(即执行器表中的 `dsh` 源) |
55
+ | `providerName` | `ntd-skills` | `ctx.skills` 注册名 |
56
+ | `executorDirs` | `{}` | 覆盖某执行器来源的根目录,如 `{claudecode: '/path'}`;也便于测试 |
57
+ | `disabledExecutors` | `[]` | 关闭的执行器来源 key 列表 |
58
+ | `extraExecutors` | `[]` | 追加自定义来源:`[{key, label, dir, readOnly}]` |
59
+ | `marketRepoDir` | `~/.ntd/bundled` | 市场资源 git 检出根目录(同步目标);运行期可在设置面板改(`PUT /market/settings {repoDir}`),市场扫描自动跟随,状态持久化于 `$DSH_HOME/skills-market-sync.json` |
60
+ | `marketSync` | 见下 | `{url, branch, gitBinary, autoSync, syncOnStartup, token}`;url 默认 `https://gitcode.com/weibaohui/ntd-resource.git`,运行期可经 `PUT /market/settings` 覆盖(持久化于 `<repoDir>/../.dsh-skills-market-sync.json`) |
61
+
62
+ ## 开发
63
+
64
+ ```bash
65
+ npm install
66
+ npm run check # 语法检查两个半端
67
+ npm test # 离线测试套件
68
+ npm run build:client # 从 client/index.js 构建 client/bundle.js
69
+ ```
70
+
71
+ ## 依赖
72
+
73
+ 运行时依赖 `yaml`(frontmatter 解析)与 `zod`(用户设置 schema)。零 `@deepseek-ai/dsh-*` 硬依赖——宿主半端经 `ctx.skills` / `ctx.webServer` / `ctx.inject(['settings'])` 运行时服务访问 harness 能力。
74
+
75
+ **设置存储**:市场同步的用户设置(url/分支/本地目录/token/自动同步)注册为宿主 `ctx.settings` 命名空间 `skills-management.market`(zod schema;cordis.yml 的 `marketSync`/`marketRepoDir` 作为 composition base 层,UI 修改写入用户层,本地 provider 持久化于 `$DSH_HOME/settings.yaml`)。settings 服务缺席的组合(如测试)自动回退到进程内覆盖表;同步记账(lastSyncAt/结果)仍在 `$DSH_HOME/skills-market-sync.json`,旧版设置一次性迁移。侧栏收起时入口仅显示图标(槽位 `wide` 属性),展开显示完整文字。
76
+
77
+ ## License
78
+
79
+ MIT