dsh-skills-anywhere 0.3.2 → 0.4.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 +16 -11
- package/README.zh.md +16 -11
- package/lib/cli.js +2 -11
- package/lib/client.js +755 -0
- package/lib/index.d.ts +47 -3
- package/lib/index.js +131 -9
- package/lib/mcp.d.ts +1 -1
- package/lib/mcp.js +4 -13
- package/lib/{provider-gYkY_3P9.d.ts → provider-C42DaDE7.d.ts} +94 -2
- package/lib/{provider-C8Jncd8r.js → provider-Dl3Oeyuh.js} +104 -2
- package/package.json +19 -2
package/README.md
CHANGED
|
@@ -29,20 +29,17 @@ It also **deduplicates** symlinked and byte-identical installs (the `skills` CLI
|
|
|
29
29
|
## Quick start
|
|
30
30
|
|
|
31
31
|
```sh
|
|
32
|
-
# The package is not on npm yet; install the release tarball (no build step, no git needed).
|
|
33
|
-
PKG=https://github.com/noteflowai/dsh-skills-anywhere/releases/download/v0.3.2/dsh-skills-anywhere-0.3.2.tgz
|
|
34
|
-
|
|
35
32
|
# 1. Install into the dsh profile you use (web is the default UI profile)
|
|
36
|
-
dsh plugin --profile web add
|
|
33
|
+
dsh plugin --profile web add dsh-skills-anywhere
|
|
37
34
|
|
|
38
35
|
# 2. See what the model will get, without booting dsh
|
|
39
|
-
npx -
|
|
36
|
+
npx dsh-skills-anywhere list
|
|
40
37
|
|
|
41
38
|
# 3. Add a whole repository of skills
|
|
42
|
-
npx -
|
|
39
|
+
npx dsh-skills-anywhere add anthropics/skills
|
|
43
40
|
```
|
|
44
41
|
|
|
45
|
-
|
|
42
|
+
Published on [npm](https://www.npmjs.com/package/dsh-skills-anywhere) with build provenance; every [GitHub release](https://github.com/noteflowai/dsh-skills-anywhere/releases) also carries the same tarball.
|
|
46
43
|
|
|
47
44
|
Start dsh as usual. The skill catalog now includes everything above; load a skill with the `skill` tool or `/skill-name` exactly as before.
|
|
48
45
|
|
|
@@ -59,9 +56,9 @@ skill-creator claude plugin skill-creator @ claude-plugins-official ~/.
|
|
|
59
56
|
```
|
|
60
57
|
|
|
61
58
|
<details>
|
|
62
|
-
<summary>Install from a git checkout instead of
|
|
59
|
+
<summary>Install from a git checkout or a release tarball instead of npm</summary>
|
|
63
60
|
|
|
64
|
-
Every [GitHub release](https://github.com/noteflowai/dsh-skills-anywhere/releases) carries a prebuilt tarball, and both `dsh plugin add` and `npx` accept its URL directly
|
|
61
|
+
Every [GitHub release](https://github.com/noteflowai/dsh-skills-anywhere/releases) carries a prebuilt tarball, and both `dsh plugin add` and `npx` accept its URL directly (`https://github.com/noteflowai/dsh-skills-anywhere/releases/download/v0.4.0/dsh-skills-anywhere-0.4.0.tgz`). If you want an unreleased commit:
|
|
65
62
|
|
|
66
63
|
```sh
|
|
67
64
|
dsh plugin --profile web add github:noteflowai/dsh-skills-anywhere
|
|
@@ -196,7 +193,15 @@ command = "npx"
|
|
|
196
193
|
args = ["-y", "dsh-skills-anywhere", "mcp"]
|
|
197
194
|
```
|
|
198
195
|
|
|
199
|
-
|
|
196
|
+
The server is also listed in the [official MCP registry](https://registry.modelcontextprotocol.io) as `io.github.noteflowai/dsh-skills-anywhere`, so registry-aware clients can install it by name. Add `--cwd <dir>` when the client does not start the server inside the project you are working on. Git sources sync in the background on start, exactly as in dsh. Programmatic use: `import { createSkillsAnywhereServer } from 'dsh-skills-anywhere/mcp'` returns the `McpServer` and the provider so you can attach your own transport.
|
|
197
|
+
|
|
198
|
+
## Browse and toggle skills in the dsh web UI
|
|
199
|
+
|
|
200
|
+
In `dsh web`, open **Settings → Plugins → Plugin configuration**. The **Skills Anywhere** card lists every skill the provider found, grouped by where it lives (agent directories, Claude Code plugins, git sources), with its catalog state — *listed* for the model, *not listed* (kept out by the budget or by you) or *author disabled* — and the name it was renamed to when it collided. Each row offers **Pin** (always listed), **Hide** (out of the model catalog, still `/name`- and `find_skills`-reachable) and **Exclude** (dropped from the provider); the catalog budget is editable in place, and a filter box searches names, descriptions and origins.
|
|
201
|
+
|
|
202
|
+
<p align="center"><img src="docs/web-card.png" alt="The Skills Anywhere card in dsh web settings: skills grouped by origin with listed / not listed / author disabled states, renames, and Pin, Hide, Exclude actions" width="720"></p>
|
|
203
|
+
|
|
204
|
+
Edits are written to the profile's dsh settings document as the `skills-anywhere` namespace, layered over `catalog` and `excludeSkills` from `cordis.patch.yml`, and the model catalog follows immediately: no restart, no file editing. The card only appears in profiles that mount dsh's settings service and web server (the shipped `web` profile does); everywhere else the provider behaves exactly as composed.
|
|
200
205
|
|
|
201
206
|
## Configuration
|
|
202
207
|
|
|
@@ -233,7 +238,7 @@ Override the row in your profile's `cordis.patch.yml`. A patch replaces the whol
|
|
|
233
238
|
| `dedupe` | `true` | Collapse symlinked and byte-identical duplicates |
|
|
234
239
|
| `lenient` | `true` | Repair recoverable frontmatter instead of skipping |
|
|
235
240
|
| `watch` | `true` | Watch local roots and refresh the catalog on change |
|
|
236
|
-
| `excludeSkills` | `[]` | Skill names to hide (raw frontmatter name or the published name shown by `list`) |
|
|
241
|
+
| `excludeSkills` | `[]` | Skill names to hide (raw frontmatter name or the published name shown by `list`); editable at runtime from the web card |
|
|
237
242
|
| `ranks` | `{ project: 250, user: 550, claudePlugins: 580, sources: 700 }` | Precedence per group |
|
|
238
243
|
| `catalog.limit` | `50` | Skills from this provider listed in the model catalog; `0` = unlimited |
|
|
239
244
|
| `catalog.pin` | `[]` | Names always listed |
|
package/README.zh.md
CHANGED
|
@@ -29,20 +29,17 @@ Agent Skills 天生就是可移植的:一个带 `SKILL.md` 的文件夹。但
|
|
|
29
29
|
## 快速开始
|
|
30
30
|
|
|
31
31
|
```sh
|
|
32
|
-
# 尚未发布到 npm;先安装 release 里的构建产物 tarball(无需构建,也不需要 git)。
|
|
33
|
-
PKG=https://github.com/noteflowai/dsh-skills-anywhere/releases/download/v0.3.2/dsh-skills-anywhere-0.3.2.tgz
|
|
34
|
-
|
|
35
32
|
# 1. 安装到你使用的 dsh profile(web 是默认的 UI profile)
|
|
36
|
-
dsh plugin --profile web add
|
|
33
|
+
dsh plugin --profile web add dsh-skills-anywhere
|
|
37
34
|
|
|
38
35
|
# 2. 不启动 dsh,直接查看模型将看到的技能
|
|
39
|
-
npx -
|
|
36
|
+
npx dsh-skills-anywhere list
|
|
40
37
|
|
|
41
38
|
# 3. 添加一整个技能仓库
|
|
42
|
-
npx -
|
|
39
|
+
npx dsh-skills-anywhere add anthropics/skills
|
|
43
40
|
```
|
|
44
41
|
|
|
45
|
-
npm
|
|
42
|
+
已发布到 [npm](https://www.npmjs.com/package/dsh-skills-anywhere),带构建来源(provenance)签名;每个 [GitHub release](https://github.com/noteflowai/dsh-skills-anywhere/releases) 也附带同一个 tarball。
|
|
46
43
|
|
|
47
44
|
照常启动 dsh。技能目录里现在包含了上面所有内容;用 `skill` 工具或 `/技能名` 加载,与之前完全一样。
|
|
48
45
|
|
|
@@ -59,9 +56,9 @@ skill-creator claude plugin skill-creator @ claude-plugins-official ~/.
|
|
|
59
56
|
```
|
|
60
57
|
|
|
61
58
|
<details>
|
|
62
|
-
<summary
|
|
59
|
+
<summary>不用 npm:从 git 检出或 release tarball 安装</summary>
|
|
63
60
|
|
|
64
|
-
每个 [GitHub release](https://github.com/noteflowai/dsh-skills-anywhere/releases) 都附带预构建的 tarball,`dsh plugin add` 和 `npx` 都可以直接使用它的 URL
|
|
61
|
+
每个 [GitHub release](https://github.com/noteflowai/dsh-skills-anywhere/releases) 都附带预构建的 tarball,`dsh plugin add` 和 `npx` 都可以直接使用它的 URL(`https://github.com/noteflowai/dsh-skills-anywhere/releases/download/v0.4.0/dsh-skills-anywhere-0.4.0.tgz`)。若需要尚未发布的提交:
|
|
65
62
|
|
|
66
63
|
```sh
|
|
67
64
|
dsh plugin --profile web add github:noteflowai/dsh-skills-anywhere
|
|
@@ -196,7 +193,15 @@ command = "npx"
|
|
|
196
193
|
args = ["-y", "dsh-skills-anywhere", "mcp"]
|
|
197
194
|
```
|
|
198
195
|
|
|
199
|
-
|
|
196
|
+
服务器也已登记在 [MCP 官方目录](https://registry.modelcontextprotocol.io),名称为 `io.github.noteflowai/dsh-skills-anywhere`,支持该目录的客户端可以按名字安装。如果客户端不是在当前项目目录里启动服务器,加上 `--cwd <dir>`。git 源会像在 dsh 中一样在启动时后台同步。编程方式:`import { createSkillsAnywhereServer } from 'dsh-skills-anywhere/mcp'` 会返回 `McpServer` 和提供器,可自行挂接传输层。
|
|
197
|
+
|
|
198
|
+
## 在 dsh web 界面里浏览和开关技能
|
|
199
|
+
|
|
200
|
+
在 `dsh web` 中打开 **设置 → 插件 → 插件配置**,**Skills Anywhere** 卡片会列出提供器找到的全部技能,按所在位置分组(Agent 目录、Claude Code 插件、git 源),并标出目录状态——*已列出*给模型、*未列出*(被预算或你挡在目录外)或*作者禁用*——以及重名时被改成的名字。每一行提供 **置顶**(始终列出)、**隐藏**(不进模型目录,但 `/名称` 和 `find_skills` 仍可达)和 **排除**(从提供器中彻底去掉);目录预算可以就地修改,筛选框按名称、描述和来源搜索。
|
|
201
|
+
|
|
202
|
+
<p align="center"><img src="docs/web-card.png" alt="dsh web 设置中的 Skills Anywhere 卡片:技能按来源分组,标出已列出 / 未列出 / 作者禁用状态与改名,并提供置顶、隐藏、排除操作" width="720"></p>
|
|
203
|
+
|
|
204
|
+
修改会作为 `skills-anywhere` 命名空间写入 profile 的 dsh 设置文档,叠加在 `cordis.patch.yml` 的 `catalog` 和 `excludeSkills` 之上,模型目录立即跟随变化:无需重启,无需手改文件。卡片只在挂载了 dsh 设置服务和 web 服务器的 profile 中出现(自带的 `web` profile 满足);其他场合提供器的行为与组合配置完全一致。
|
|
200
205
|
|
|
201
206
|
## 配置
|
|
202
207
|
|
|
@@ -233,7 +238,7 @@ npm 发布前,把手动命令里的 `dsh-skills-anywhere` 换成 release tarba
|
|
|
233
238
|
| `dedupe` | `true` | 折叠软链接与字节相同的重复项 |
|
|
234
239
|
| `lenient` | `true` | 修复可恢复的 frontmatter 而不是跳过 |
|
|
235
240
|
| `watch` | `true` | 监视本地根目录,变化时刷新目录 |
|
|
236
|
-
| `excludeSkills` | `[]` | 要隐藏的技能名(原始 frontmatter 名或 `list`
|
|
241
|
+
| `excludeSkills` | `[]` | 要隐藏的技能名(原始 frontmatter 名或 `list` 显示的发布名均可);可在 web 卡片中运行时修改 |
|
|
237
242
|
| `ranks` | `{ project: 250, user: 550, claudePlugins: 580, sources: 700 }` | 各组优先级 |
|
|
238
243
|
| `catalog.limit` | `50` | 本提供器进入模型目录的技能数;`0` = 不限制 |
|
|
239
244
|
| `catalog.pin` | `[]` | 始终列出的名称 |
|
package/lib/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { C as resolveConfig, S as projectSourcesFile, a as readSourcesFile, d as originLabel, i as readLock, l as writeSourcesFile, o as resolveSource, p as findProjectRoot, r as hasGit, s as sameRepository, t as SkillsAnywhereProvider, v as AGENTS } from "./provider-Dl3Oeyuh.js";
|
|
3
3
|
import { isAbsolute, relative, sep } from "node:path";
|
|
4
4
|
import { parseArgs } from "node:util";
|
|
5
5
|
//#region src/cli.ts
|
|
@@ -143,15 +143,6 @@ async function collectWithSources(cli, config) {
|
|
|
143
143
|
function displayPath(path, config, sourceDirs) {
|
|
144
144
|
return sourceDirs.map((dir) => relative(dir, path)).filter((rel) => rel !== "" && !rel.startsWith("..") && !isAbsolute(rel)).toSorted((a, b) => a.length - b.length)[0] ?? shorten(path, config.home);
|
|
145
145
|
}
|
|
146
|
-
function originLabel(skill) {
|
|
147
|
-
const { origin } = skill;
|
|
148
|
-
switch (origin.kind) {
|
|
149
|
-
case "agent": return `${origin.agent ?? "agent"} (${origin.scope ?? "?"})`;
|
|
150
|
-
case "claude-plugins": return `claude plugin ${origin.plugin ?? "?"}${origin.marketplace !== void 0 ? ` @ ${origin.marketplace}` : ""}`;
|
|
151
|
-
case "source": return `source ${origin.repo ?? "?"}`;
|
|
152
|
-
default: return `custom (${origin.scope ?? "?"})`;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
146
|
function table(rows) {
|
|
156
147
|
if (rows.length === 0) return "";
|
|
157
148
|
const widths = rows[0].map((_, column) => Math.max(...rows.map((row) => (row[column] ?? "").length)));
|
|
@@ -191,7 +182,7 @@ async function list(cli, config) {
|
|
|
191
182
|
"PATH"
|
|
192
183
|
], ...report.skills.map((skill) => [
|
|
193
184
|
skill.name,
|
|
194
|
-
originLabel(skill),
|
|
185
|
+
originLabel(skill.origin),
|
|
195
186
|
displayPath(skill.path, config, sourceDirs)
|
|
196
187
|
])]));
|
|
197
188
|
if (cli.all && report.dropped.length > 0) {
|