@noob-stupid/dsh-plugin-console 0.3.20 → 0.3.21
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 +4 -0
- package/README.zh.md +4 -0
- package/lib/client.js +16 -0
- package/lib/index.js +43 -0
- package/package.json +39 -39
package/README.md
CHANGED
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
[](https://github.com/Noob-stupid/dsh-plugin-hub/commits/main)
|
|
14
14
|
[](https://github.com/Noob-stupid/dsh-plugin-hub/actions/workflows/registry.yml)
|
|
15
15
|
[](https://github.com/topics/dsh-plugin)
|
|
16
|
+
[](https://www.npmjs.com/package/@noob-stupid/dsh-plugin-console)
|
|
17
|
+
[](https://www.npmjs.com/package/@noob-stupid/dsh-plugin-console)
|
|
18
|
+
[](https://github.com/Noob-stupid/dsh-plugin-hub/releases)[](https://www.dsh.so/artifact/dsh-plugin-hub)
|
|
19
|
+
[](https://www.dsh.so/artifact/dsh-plugin-hub)
|
|
16
20
|
|
|
17
21
|
A **plugin management panel** for the DeepSeek Harness (DSH) Web GUI: one-click
|
|
18
22
|
enable/disable of installed plugins, a **multi-source plugin marketplace**
|
package/README.zh.md
CHANGED
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
[](https://github.com/Noob-stupid/dsh-plugin-hub/commits/main)
|
|
14
14
|
[](https://github.com/Noob-stupid/dsh-plugin-hub/actions/workflows/registry.yml)
|
|
15
15
|
[](https://github.com/topics/dsh-plugin)
|
|
16
|
+
[](https://www.npmjs.com/package/@noob-stupid/dsh-plugin-console)
|
|
17
|
+
[](https://www.npmjs.com/package/@noob-stupid/dsh-plugin-console)
|
|
18
|
+
[](https://github.com/Noob-stupid/dsh-plugin-hub/releases)[](https://www.dsh.so/artifact/dsh-plugin-hub)
|
|
19
|
+
[](https://www.dsh.so/artifact/dsh-plugin-hub)
|
|
16
20
|
|
|
17
21
|
给 DeepSeek Harness(DSH)Web 界面加上**插件管理面板**:一键启用/停用已安装插件,
|
|
18
22
|
在**多个搜索源**上浏览 dsh-plugin 插件项目(GitHub / Gitee / 自定义源),一键添加并启用——
|
package/lib/client.js
CHANGED
|
@@ -137,6 +137,7 @@ window.__ModuleLoader__.load({
|
|
|
137
137
|
githubLoggedIn: "已登录 GitHub:",
|
|
138
138
|
githubCornerOut: "未登录 GitHub",
|
|
139
139
|
hubUpdateAvailable: "下载更新",
|
|
140
|
+
cleanResiduals: "清理残余备份",
|
|
140
141
|
searchInstalledPlaceholder: "搜索已安装插件(名称或 id)",
|
|
141
142
|
extraFilter: "已装",
|
|
142
143
|
extraFilterAll: "全部",
|
|
@@ -372,6 +373,7 @@ window.__ModuleLoader__.load({
|
|
|
372
373
|
loadingDetails: "Reading details…",
|
|
373
374
|
githubLoggedIn: "GitHub signed in: ",
|
|
374
375
|
hubUpdateAvailable: "Download update",
|
|
376
|
+
cleanResiduals: "Clean residual backups",
|
|
375
377
|
githubCornerOut: "Not signed in to GitHub",
|
|
376
378
|
searchInstalledPlaceholder: "Search installed plugins (name or id)",
|
|
377
379
|
extraFilter: "Installed",
|
|
@@ -2153,6 +2155,20 @@ window.__ModuleLoader__.load({
|
|
|
2153
2155
|
},
|
|
2154
2156
|
}, t("relaunchBtn"))
|
|
2155
2157
|
: null,
|
|
2158
|
+
el("button", {
|
|
2159
|
+
type: "button",
|
|
2160
|
+
style: { position: "fixed", left: 12, bottom: 12, zIndex: 1000, opacity: 0.75 },
|
|
2161
|
+
title: t("cleanResiduals"),
|
|
2162
|
+
onClick: () => {
|
|
2163
|
+
setMessage(t("cleanResiduals") + "…");
|
|
2164
|
+
call("/plugin-console/clean-residuals", {}).then(
|
|
2165
|
+
(data) => {
|
|
2166
|
+
if (data && data.ok === true) setMessage(t("cleanResiduals") + ":" + (data.count === 0 ? "无残余" : "已清理 " + data.count + " 项"));
|
|
2167
|
+
},
|
|
2168
|
+
(error) => setMessage(t("failed") + ":" + friendlyGithubError(error).message),
|
|
2169
|
+
);
|
|
2170
|
+
},
|
|
2171
|
+
}, "🧹 " + t("cleanResiduals")),
|
|
2156
2172
|
fwShowCard
|
|
2157
2173
|
? el("div", { className: styles.detail },
|
|
2158
2174
|
el("div", { className: styles.rowTop },
|
package/lib/index.js
CHANGED
|
@@ -3982,6 +3982,49 @@ async function handle(ctx, req, res) {
|
|
|
3982
3982
|
return
|
|
3983
3983
|
}
|
|
3984
3984
|
|
|
3985
|
+
if (pathname === `${ROUTE_PREFIX}/clean-residuals`) {
|
|
3986
|
+
// 清理残余备份/旧子包:删除 .old-* 备份目录,以及聚合包未声明的 @linxin666 旧子包
|
|
3987
|
+
const profileDir = dirname(findPatchPath(ctx))
|
|
3988
|
+
const nodeModules = join(profileDir, 'node_modules')
|
|
3989
|
+
const removed = []
|
|
3990
|
+
// 1) 删除 .old-* 残余备份(顶层 + 作用域目录)
|
|
3991
|
+
const scanDirs = [nodeModules]
|
|
3992
|
+
try { if (existsSync(join(nodeModules, '@linxin666'))) scanDirs.push(join(nodeModules, '@linxin666')) } catch {}
|
|
3993
|
+
for (const dir of scanDirs) {
|
|
3994
|
+
try {
|
|
3995
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
3996
|
+
if (!entry.isDirectory()) continue
|
|
3997
|
+
if (!/\.old-/u.test(entry.name)) continue
|
|
3998
|
+
const target = join(dir, entry.name)
|
|
3999
|
+
rmSync(target, { recursive: true, force: true })
|
|
4000
|
+
removed.push(entry.name)
|
|
4001
|
+
}
|
|
4002
|
+
} catch {}
|
|
4003
|
+
}
|
|
4004
|
+
// 2) 删除聚合包未声明的 @linxin666 旧子包(以 dsh-web-ui-all 的 dependencies 为准)
|
|
4005
|
+
try {
|
|
4006
|
+
const allPkgPath = join(nodeModules, '@linxin666', 'dsh-web-ui-all', 'package.json')
|
|
4007
|
+
if (existsSync(allPkgPath)) {
|
|
4008
|
+
const allPkg = JSON.parse(readFileSync(allPkgPath, 'utf8'))
|
|
4009
|
+
const declared = new Set(Object.keys(allPkg.dependencies ?? {}).filter((n) => n.startsWith('@linxin666/')))
|
|
4010
|
+
declared.add('@linxin666/dsh-web-ui-all')
|
|
4011
|
+
const scoped = join(nodeModules, '@linxin666')
|
|
4012
|
+
for (const entry of readdirSync(scoped, { withFileTypes: true })) {
|
|
4013
|
+
if (!entry.isDirectory()) continue
|
|
4014
|
+
const full = '@linxin666/' + entry.name
|
|
4015
|
+
if (declared.has(full)) continue
|
|
4016
|
+
const pkgJson = join(scoped, entry.name, 'package.json')
|
|
4017
|
+
if (existsSync(pkgJson)) {
|
|
4018
|
+
rmSync(join(scoped, entry.name), { recursive: true, force: true })
|
|
4019
|
+
removed.push(full)
|
|
4020
|
+
}
|
|
4021
|
+
}
|
|
4022
|
+
}
|
|
4023
|
+
} catch {}
|
|
4024
|
+
sendJson(res, 200, { ok: true, removed, count: removed.length })
|
|
4025
|
+
return
|
|
4026
|
+
}
|
|
4027
|
+
|
|
3985
4028
|
if (pathname === `${ROUTE_PREFIX}/self-update`) {
|
|
3986
4029
|
// Hub 自身一键更新:下载 npm 最新 tarball 到当前 profile,成功后由前端重启生效
|
|
3987
4030
|
let selfVersion = null
|
package/package.json
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@noob-stupid/dsh-plugin-console",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "DSH plugin management panel & marketplace: one-click enable/disable, multi-source market (GitHub/Gitee/custom), static-index market (500+ plugins / 300 skills), skills, suites, and one-click framework upgrade.",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "https://github.com/Noob-stupid/dsh-plugin-hub"
|
|
8
|
-
},
|
|
9
|
-
"type": "module",
|
|
10
|
-
"main": "./lib/index.js",
|
|
11
|
-
"exports": {
|
|
12
|
-
".": "./lib/index.js",
|
|
13
|
-
"./client": "./lib/client.js",
|
|
14
|
-
"./package.json": "./package.json"
|
|
15
|
-
},
|
|
16
|
-
"keywords": [
|
|
17
|
-
"dsh-plugin",
|
|
18
|
-
"deepseek-harness",
|
|
19
|
-
"plugin-manager"
|
|
20
|
-
],
|
|
21
|
-
"dsh": {
|
|
22
|
-
"bundle": {
|
|
23
|
-
"patch": "./cordis.patch.yml"
|
|
24
|
-
},
|
|
25
|
-
"client": {
|
|
26
|
-
"platform": "web",
|
|
27
|
-
"inject": [
|
|
28
|
-
"@deepseek-ai/dsh-client-runtime",
|
|
29
|
-
"@deepseek-ai/dsh-client-locale",
|
|
30
|
-
"@deepseek-ai/dsh-client-ui-settings"
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"files": [
|
|
35
|
-
"lib",
|
|
36
|
-
"cordis.patch.yml"
|
|
37
|
-
],
|
|
38
|
-
"license": "MIT"
|
|
39
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@noob-stupid/dsh-plugin-console",
|
|
3
|
+
"version": "0.3.21",
|
|
4
|
+
"description": "DSH plugin management panel & marketplace: one-click enable/disable, multi-source market (GitHub/Gitee/custom), static-index market (500+ plugins / 300 skills), skills, suites, and one-click framework upgrade.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/Noob-stupid/dsh-plugin-hub"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "./lib/index.js",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": "./lib/index.js",
|
|
13
|
+
"./client": "./lib/client.js",
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"dsh-plugin",
|
|
18
|
+
"deepseek-harness",
|
|
19
|
+
"plugin-manager"
|
|
20
|
+
],
|
|
21
|
+
"dsh": {
|
|
22
|
+
"bundle": {
|
|
23
|
+
"patch": "./cordis.patch.yml"
|
|
24
|
+
},
|
|
25
|
+
"client": {
|
|
26
|
+
"platform": "web",
|
|
27
|
+
"inject": [
|
|
28
|
+
"@deepseek-ai/dsh-client-runtime",
|
|
29
|
+
"@deepseek-ai/dsh-client-locale",
|
|
30
|
+
"@deepseek-ai/dsh-client-ui-settings"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"lib",
|
|
36
|
+
"cordis.patch.yml"
|
|
37
|
+
],
|
|
38
|
+
"license": "MIT"
|
|
39
|
+
}
|