@morehao/dsh-skills-console 0.2.0 → 0.2.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 +78 -52
- package/client.js +2359 -1227
- package/icon.svg +2 -1
- package/lib/core/service.js +2 -2
- package/lib/routes.js +23 -2
- package/package.json +10 -4
package/icon.svg
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64" role="img" aria-label="
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64" role="img" aria-label="技能控制台">
|
|
2
|
+
<title>技能控制台</title>
|
|
2
3
|
<defs>
|
|
3
4
|
<linearGradient id="dshsc-icon-bg" x1="6" y1="2" x2="58" y2="62" gradientUnits="userSpaceOnUse">
|
|
4
5
|
<stop stop-color="#3b82f6"/>
|
package/lib/core/service.js
CHANGED
|
@@ -78,7 +78,7 @@ export function createService({ paths, store, registry, cli, logger, env = proce
|
|
|
78
78
|
|
|
79
79
|
function defaultTargets(current) {
|
|
80
80
|
const targets = ['dsh-global'];
|
|
81
|
-
// null = 老语义「所有探测到的 Agent」;数组 =
|
|
81
|
+
// null = 老语义「所有探测到的 Agent」;数组 = 用户在「自动接入」里勾选的那些
|
|
82
82
|
const selected = current.settings.autoLinkTargets ?? null;
|
|
83
83
|
for (const target of detectedTargets()) {
|
|
84
84
|
if (target.kind !== 'agent') continue;
|
|
@@ -596,7 +596,7 @@ export function createService({ paths, store, registry, cli, logger, env = proce
|
|
|
596
596
|
return {
|
|
597
597
|
ok: false,
|
|
598
598
|
code: 'error.skills.cli-failed',
|
|
599
|
-
message: 'skills remove
|
|
599
|
+
message: 'skills remove 失败;已断开本插件建立的软链,真身可能仍在 canonical',
|
|
600
600
|
detail: { code: result.code, stderr: result.stderr.slice(-2000) },
|
|
601
601
|
trash: trash.key,
|
|
602
602
|
};
|
package/lib/routes.js
CHANGED
|
@@ -1,9 +1,28 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
1
2
|
import { ServiceError } from './core/service.js';
|
|
2
3
|
import { StateReadOnlyError } from './core/state.js';
|
|
3
4
|
|
|
4
5
|
export const ROUTE_PREFIX = '/api/morehao/skills-console';
|
|
5
6
|
const MAX_BODY = 256 * 1024;
|
|
6
7
|
|
|
8
|
+
/**
|
|
9
|
+
* 插件身份:包名(去掉 scope,页头显示 dsh-skills-console)+ 版本。
|
|
10
|
+
* 从 package.json 读一次,随 /state 下发 —— 前端别硬编码版本,否则两处漂移。
|
|
11
|
+
*/
|
|
12
|
+
export const PLUGIN_INFO = (() => {
|
|
13
|
+
try {
|
|
14
|
+
const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
|
|
15
|
+
const name = String(pkg.name || 'dsh-skills-console');
|
|
16
|
+
return {
|
|
17
|
+
name: name.includes('/') ? name.slice(name.lastIndexOf('/') + 1) : name,
|
|
18
|
+
version: pkg.version || null,
|
|
19
|
+
repository: pkg.repository?.url || null,
|
|
20
|
+
};
|
|
21
|
+
} catch {
|
|
22
|
+
return { name: 'dsh-skills-console', version: null, repository: null };
|
|
23
|
+
}
|
|
24
|
+
})();
|
|
25
|
+
|
|
7
26
|
function sendJson(res, status, payload) {
|
|
8
27
|
const body = JSON.stringify(payload);
|
|
9
28
|
res.writeHead(status, {
|
|
@@ -123,8 +142,10 @@ export function createRoutes({ service, logger }) {
|
|
|
123
142
|
|
|
124
143
|
async function dispatch(route, { body, query, service }) {
|
|
125
144
|
switch (route.name) {
|
|
126
|
-
case 'state':
|
|
127
|
-
|
|
145
|
+
case 'state': {
|
|
146
|
+
const state = await service.getState({ cwd: query.cwd || body.cwd, workspace: query.workspace });
|
|
147
|
+
return { ...state, plugin: PLUGIN_INFO };
|
|
148
|
+
}
|
|
128
149
|
case 'agents':
|
|
129
150
|
return { ok: true, all: service.registry.all(), detected: service.registry.detected() };
|
|
130
151
|
case 'settings':
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morehao/dsh-skills-console",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "统一管理本地技能的安装、更新、删除与接入,让同一份技能在多个 Agent 间复用。A skill manager for DeepSeek Harness: install, update, remove, link and toggle agent skills.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "morehao <morehao@qq.com>",
|
|
7
7
|
"repository": {
|
|
@@ -49,7 +49,10 @@
|
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"test": "node --test \"test/*.test.mjs\"",
|
|
52
|
-
"
|
|
52
|
+
"build:client": "node scripts/build-client.mjs",
|
|
53
|
+
"dev:client": "node scripts/build-client.mjs --watch",
|
|
54
|
+
"check:client": "node scripts/build-client.mjs --check",
|
|
55
|
+
"check": "node scripts/check-syntax.mjs && node scripts/build-client.mjs --check && node scripts/check-naming.mjs && node scripts/check-pack.mjs && node scripts/smoke-release-notes.mjs",
|
|
53
56
|
"check:syntax": "node scripts/check-syntax.mjs",
|
|
54
57
|
"check:naming": "node scripts/check-naming.mjs",
|
|
55
58
|
"check:pack": "node scripts/check-pack.mjs",
|
|
@@ -64,5 +67,8 @@
|
|
|
64
67
|
"dsh",
|
|
65
68
|
"dsh-plugin",
|
|
66
69
|
"skills"
|
|
67
|
-
]
|
|
70
|
+
],
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"esbuild": "0.28.2"
|
|
73
|
+
}
|
|
68
74
|
}
|