dsh-agent-skills 0.1.0 → 0.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.md +11 -9
- package/lib/client.js +18 -12
- package/lib/client.js.map +2 -2
- package/lib/discovery.d.ts +4 -2
- package/lib/discovery.js +13 -12
- package/lib/discovery.js.map +1 -1
- package/lib/provider.js +7 -9
- package/lib/provider.js.map +1 -1
- package/lib/types/client/locales.d.ts +4 -2
- package/lib/types/client/types.d.ts +1 -1
- package/lib/views.js +12 -6
- package/lib/views.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
很多 AI 编程工具都使用 `<技能名>/SKILL.md`,但技能分散在不同目录。`dsh-agent-skills` 会自动发现这些目录,把有效技能汇总进 DSH,并提供一个可视化设置页:
|
|
12
12
|
|
|
13
|
-
-
|
|
13
|
+
- 默认扫描 `~/.agents/skills`、`~/.claude/skills`、`~/.codex/skills`、`~/.config/opencode/skills` 和 `~/.gemini/skills`。
|
|
14
14
|
- 支持添加任意自定义技能目录。
|
|
15
15
|
- 显示每个来源是否存在、包含多少有效技能,以及技能名称和描述。
|
|
16
16
|
- 可按目录或单个技能启停;变更会持久化,并在下一次 Agent step 生效。
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
打开 DSH 的「设置 → 插件市场」,搜索 **Agent Skills**,点击安装。市场会优先使用 npm 包,安装速度快,也不需要在本机重新构建。
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
安装后继续完成下面的「启用技能开关」步骤,再重启 DSH Web。
|
|
27
27
|
|
|
28
28
|
### 方式二:从 npm 安装
|
|
29
29
|
|
|
@@ -31,22 +31,24 @@
|
|
|
31
31
|
dsh plugin --profile web add dsh-agent-skills
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
### 方式三:从 GitHub 安装
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
|
|
38
|
-
node ~/.dsh/profiles/web/node_modules/dsh-agent-skills/scripts/install-preset.mjs
|
|
37
|
+
dsh plugin --profile web add github:minivv/dsh-agent-skills
|
|
39
38
|
```
|
|
40
39
|
|
|
41
|
-
|
|
40
|
+
仓库包含 `prepare: npm run build`,因此 pnpm 会在 Git 安装时自动构建。DSH/pnpm 可能会要求你授权构建脚本;不想授权构建时请使用 npm 或插件市场版本,npm 包已经包含构建好的 `lib/`。
|
|
42
41
|
|
|
43
|
-
###
|
|
42
|
+
### 启用技能开关
|
|
43
|
+
|
|
44
|
+
完成任一种安装方式后,运行一次 preset 安装脚本,让技能开关覆盖 `standard` 和 `code` preset 自带的 filesystem provider:
|
|
44
45
|
|
|
45
46
|
```bash
|
|
46
|
-
|
|
47
|
+
DSH_INSTALL_ROOT="$(npm root -g)/@deepseek-ai/dsh" \
|
|
48
|
+
node ~/.dsh/profiles/web/node_modules/dsh-agent-skills/scripts/install-preset.mjs
|
|
47
49
|
```
|
|
48
50
|
|
|
49
|
-
|
|
51
|
+
然后重启 DSH Web。这个 preset 入口只注册 scoped skill provider,不会在 Agent preset 中创建 `agentSkills` host 服务。DSH 升级可能覆盖内置 preset,若开关再次失效,重新运行这条命令即可。
|
|
50
52
|
|
|
51
53
|
## 使用
|
|
52
54
|
|
package/lib/client.js
CHANGED
|
@@ -51,7 +51,8 @@ var zh = {
|
|
|
51
51
|
hideSkills: "\u6536\u8D77\u6280\u80FD",
|
|
52
52
|
noSkillsInDir: "\u8BE5\u76EE\u5F55\u4E0B\u6CA1\u6709\u53EF\u7528\u6280\u80FD",
|
|
53
53
|
dirMissing: "\u76EE\u5F55\u4E0D\u5B58\u5728",
|
|
54
|
-
|
|
54
|
+
enabledLabel: "\u6280\u80FD",
|
|
55
|
+
enabledStats: "{total} \u4E2A\u53EF\u7528 \xB7 {custom} \u4E2A\u81EA\u5B9A\u4E49 \xB7 {global} \u4E2A\u5168\u5C40 \xB7 {builtin} \u4E2A\u5185\u7F6E",
|
|
55
56
|
noSkills: "\u5F53\u524D\u6CA1\u6709\u53EF\u7528\u7684\u6280\u80FD\u3002\u70B9\u51FB\u300C+ \u6DFB\u52A0\u76EE\u5F55\u300D\u6DFB\u52A0\u4E00\u4E2A\u6280\u80FD\u76EE\u5F55\uFF0C\u6216\u542F\u7528\u66F4\u591A\u6765\u6E90\u3002",
|
|
56
57
|
noMatch: "\u6CA1\u6709\u5339\u914D\u7684\u6280\u80FD",
|
|
57
58
|
tagCustom: "\u81EA\u5B9A\u4E49",
|
|
@@ -90,7 +91,8 @@ var en = {
|
|
|
90
91
|
hideSkills: "Hide skills",
|
|
91
92
|
noSkillsInDir: "No usable skills in this directory",
|
|
92
93
|
dirMissing: "directory missing",
|
|
93
|
-
|
|
94
|
+
enabledLabel: "Skills",
|
|
95
|
+
enabledStats: "{total} available \xB7 {custom} custom \xB7 {global} global \xB7 {builtin} builtin",
|
|
94
96
|
noSkills: "No skills available. Click \u201C+ Add directory\u201D to add a skill directory, or enable more sources.",
|
|
95
97
|
noMatch: "No matching skills",
|
|
96
98
|
tagCustom: "Custom",
|
|
@@ -129,13 +131,13 @@ function SkillDescription({ text, t }) {
|
|
|
129
131
|
const element = ref.current;
|
|
130
132
|
if (element === null) return;
|
|
131
133
|
const check2 = () => {
|
|
132
|
-
setOverflow(element.scrollHeight > element.clientHeight + 1);
|
|
134
|
+
if (!expanded) setOverflow(element.scrollHeight > element.clientHeight + 1);
|
|
133
135
|
};
|
|
134
136
|
check2();
|
|
135
137
|
const observer = new ResizeObserver(check2);
|
|
136
138
|
observer.observe(element);
|
|
137
139
|
return () => observer.disconnect();
|
|
138
|
-
}, [text]);
|
|
140
|
+
}, [expanded, text]);
|
|
139
141
|
if (text === "") return null;
|
|
140
142
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
141
143
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { ref, className: expanded ? "as-skill-desc" : "as-skill-desc as-skill-desc-clamped", children: text }),
|
|
@@ -381,12 +383,15 @@ function AgentSkillsSection({ api, t }) {
|
|
|
381
383
|
},
|
|
382
384
|
dir.path
|
|
383
385
|
)) }),
|
|
384
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
386
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("h3", { className: "as-skills-header", children: [
|
|
387
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "as-skills-header-title", children: t("enabledLabel") }),
|
|
388
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "as-skills-header-stats", children: t("enabledStats", {
|
|
389
|
+
total: view.counts.total,
|
|
390
|
+
custom: view.counts.custom,
|
|
391
|
+
global: view.counts.global,
|
|
392
|
+
builtin: view.counts.builtin
|
|
393
|
+
}) })
|
|
394
|
+
] }),
|
|
390
395
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "as-skill-grid", children: filteredSkills.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "as-empty", children: query.trim() === "" ? t("noSkills") : t("noMatch") }) : filteredSkills.map((skill) => {
|
|
391
396
|
const tagClass = skill.kind === "custom" ? "as-tag-custom" : skill.kind === "builtin" ? "as-tag-builtin" : "as-tag-global";
|
|
392
397
|
const tagLabel = skill.kind === "custom" ? t("tagCustom") : skill.kind === "builtin" ? t("tagBuiltin") : t("tagGlobal");
|
|
@@ -481,8 +486,9 @@ var CSS = `
|
|
|
481
486
|
.as-dir-skill-name { font-size: 13px; font-weight: 550; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
|
|
482
487
|
.as-dir-skill-desc { font-size: 12px; color: var(--as-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
483
488
|
|
|
484
|
-
.as-skills-header { font-size: 13px; font-weight: 550; margin: 4px 0 0; }
|
|
485
|
-
.as-skills-header
|
|
489
|
+
.as-skills-header { display: flex; align-items: baseline; gap: 7px; font-size: 13px; font-weight: 550; margin: 4px 0 0; text-wrap: balance; }
|
|
490
|
+
.as-skills-header-title { color: var(--as-text); }
|
|
491
|
+
.as-skills-header-stats { font-size: 11px; font-weight: 450; color: var(--as-muted-2); font-variant-numeric: tabular-nums; }
|
|
486
492
|
.as-skill-grid { display: flex; flex-direction: column; gap: 8px; }
|
|
487
493
|
.as-skill-card { border: 1px solid var(--as-border-soft); border-radius: var(--as-radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; }
|
|
488
494
|
.as-skill-row { display: flex; align-items: center; gap: 8px; }
|