@dsh-plugins/dsh-llm-hub 1.9.9 → 1.10.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/CHANGELOG.md +14 -0
- package/README.en.md +1 -0
- package/README.md +1 -0
- package/icon.svg +23 -0
- package/lib/client.js +5 -1
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +8 -4
- package/scripts/npm-products.json +26 -0
- package/scripts/pre-commit-all.sh +14 -0
- package/scripts/prepublish-gate.mjs +35 -2
- package/scripts/readme-gate.mjs +13 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
本项目遵循 [Semantic Versioning](https://semver.org/lang/zh-CN/)。
|
|
4
4
|
|
|
5
|
+
## [1.10.1](https://github.com/webkubor/dsh-llm-hub/compare/v1.10.0...v1.10.1) (2026-11-10)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### 📝 Documentation
|
|
9
|
+
|
|
10
|
+
* add Awesome DSH Plugin listing badge ([586b677](https://github.com/webkubor/dsh-llm-hub/commit/586b6771405f0878eeb6584a8feb81b16bd29fdb))
|
|
11
|
+
|
|
12
|
+
## [1.10.0](https://github.com/webkubor/dsh-llm-hub/compare/v1.9.9...v1.10.0) (2026-11-05)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### ✨ Features
|
|
16
|
+
|
|
17
|
+
* **meta:** 补齐插件管理器标题、简介与图标;样式随插件停用移除 ([05c0df7](https://github.com/webkubor/dsh-llm-hub/commit/05c0df71c24a9916eb965a694e362c9f7388a281))
|
|
18
|
+
|
|
5
19
|
## [1.9.9](https://github.com/webkubor/dsh-llm-hub/compare/v1.9.8...v1.9.9) (2026-10-29)
|
|
6
20
|
|
|
7
21
|
|
package/README.en.md
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
<a href="https://www.npmjs.com/package/@dsh-plugins/dsh-llm-hub"><img src="https://img.shields.io/npm/v/@dsh-plugins/dsh-llm-hub?style=flat-square&color=4C7EF3&label=npm" alt="npm" /></a>
|
|
7
7
|
<img src="https://img.shields.io/badge/deps-0-5A9E6F?style=flat-square" alt="zero deps" />
|
|
8
8
|
<img src="https://img.shields.io/badge/license-MIT-777?style=flat-square" alt="MIT" />
|
|
9
|
+
<a href="https://awesome-dsh-plugin.com"><img src="https://awesome-dsh-plugin.com/badge.svg" alt="Awesome DSH Plugin" /></a>
|
|
9
10
|
· <a href="README.md">中文</a> · <a href="CHANGELOG.md">Changelog</a>
|
|
10
11
|
</p>
|
|
11
12
|
|
package/README.md
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
<p align="center">
|
|
21
21
|
<a href="https://github.com/deepseek-ai/deepseek-harness"><img src="https://img.shields.io/badge/DeepSeek_Harness-Plugin-4d6bfe?style=for-the-badge" alt="DSH Plugin" /></a>
|
|
22
22
|
<a href="https://github.com/topics/dsh-plugin"><img src="https://img.shields.io/badge/topic-dsh--plugin-4d6bfe?style=for-the-badge" alt="dsh-plugin" /></a>
|
|
23
|
+
<a href="https://awesome-dsh-plugin.com"><img src="https://awesome-dsh-plugin.com/badge.svg" alt="Awesome DSH Plugin 社区收录" /></a>
|
|
23
24
|
<a href="https://github.com/topics/llm-gateway"><img src="https://img.shields.io/badge/topic-llm--gateway-4C7EF3?style=for-the-badge" alt="llm-gateway" /></a>
|
|
24
25
|
· <a href="README.en.md">English</a> · <a href="CHANGELOG.md">更新日志</a>
|
|
25
26
|
</p>
|
package/icon.svg
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="llmhub-bg" x1="0" y1="0" x2="1" y2="1">
|
|
4
|
+
<stop offset="0" stop-color="#2f4f6f"/>
|
|
5
|
+
<stop offset="1" stop-color="#1f3346"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
<rect width="64" height="64" rx="14" fill="url(#llmhub-bg)"/>
|
|
9
|
+
<g stroke="#9cc6e8" stroke-width="2.4" stroke-linecap="round">
|
|
10
|
+
<line x1="32" y1="32" x2="15" y2="17"/>
|
|
11
|
+
<line x1="32" y1="32" x2="49" y2="17"/>
|
|
12
|
+
<line x1="32" y1="32" x2="15" y2="47"/>
|
|
13
|
+
<line x1="32" y1="32" x2="49" y2="47"/>
|
|
14
|
+
</g>
|
|
15
|
+
<g fill="#cfe5f6">
|
|
16
|
+
<circle cx="15" cy="17" r="4.5"/>
|
|
17
|
+
<circle cx="49" cy="17" r="4.5"/>
|
|
18
|
+
<circle cx="15" cy="47" r="4.5"/>
|
|
19
|
+
<circle cx="49" cy="47" r="4.5"/>
|
|
20
|
+
</g>
|
|
21
|
+
<circle cx="32" cy="32" r="8.5" fill="#fff"/>
|
|
22
|
+
<circle cx="32" cy="32" r="3.5" fill="#10b981"/>
|
|
23
|
+
</svg>
|
package/lib/client.js
CHANGED
|
@@ -2298,7 +2298,11 @@ window.__ModuleLoader__.load({
|
|
|
2298
2298
|
* @param ctx - 插件上下文。
|
|
2299
2299
|
*/
|
|
2300
2300
|
function apply(ctx) {
|
|
2301
|
-
ensureStyle
|
|
2301
|
+
// 样式标签由 ensureStyle 懒插入;挂在 effect 上,插件停用/卸载时一并移除,不留残留。
|
|
2302
|
+
ctx.effect(() => {
|
|
2303
|
+
ensureStyle()
|
|
2304
|
+
return () => { document.getElementById('dsh-llm-hub-style')?.remove() }
|
|
2305
|
+
}, 'dsh-llm-hub: styles')
|
|
2302
2306
|
ctx.effect(() => ctx.locale.register(NS, LOCALES), 'dsh-llm-hub: dictionaries')
|
|
2303
2307
|
const t = ctx.locale.bind(NS)
|
|
2304
2308
|
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-plugins/dsh-llm-hub",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"description": "DSH 模型管理层:网关可达性探测、模型目录拉取、DeepSeek + MiniMax/智谱/Moonshot/StepFun 余额与配额、本月用量统计、余额预警、Provider 健康看板,再把本机装好的 codex / claude / agy 注册成子代理(装了才出现)。零运行时依赖,不改动 DSH 安装。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
"./client": {
|
|
14
14
|
"default": "./lib/client.js"
|
|
15
15
|
},
|
|
16
|
-
"./package.json": "./package.json"
|
|
16
|
+
"./package.json": "./package.json",
|
|
17
|
+
"./locale/*.json": "./locale/*.json",
|
|
18
|
+
"./icon": "./icon.svg"
|
|
17
19
|
},
|
|
18
20
|
"dsh": {
|
|
19
21
|
"bundle": {
|
|
@@ -78,9 +80,11 @@
|
|
|
78
80
|
"cordis.patch.yml",
|
|
79
81
|
"lib",
|
|
80
82
|
"scripts",
|
|
81
|
-
"types"
|
|
83
|
+
"types",
|
|
84
|
+
"locale/*.json",
|
|
85
|
+
"icon.svg"
|
|
82
86
|
],
|
|
83
87
|
"devDependencies": {
|
|
84
|
-
"@deepseek-ai/schemastery": "3.18.
|
|
88
|
+
"@deepseek-ai/schemastery": "3.18.5"
|
|
85
89
|
}
|
|
86
90
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": [
|
|
3
|
+
"npm 产品定位台账 —— prepublish-gate 契约 0 的唯一判据。真源在 CortexOS,由 check-release-gate-sync.mjs --fix 分发到各仓 scripts/npm-products.json,各仓拷贝不许手改(sha 漂移会被查出来)。",
|
|
4
|
+
"上 npm 是业务 / 产品定位决策,不是发版流程能顺手做的事:一个包要进 products,必须说清「给谁用、为什么非 npm 不可」,并由 owner 拍板。",
|
|
5
|
+
"agent 不得为了让门禁通过而自行往 products 里加条目 —— 这等于替 owner 做了定位决策。新包要上 npm,先问 owner。",
|
|
6
|
+
"notOnNpm:owner 明确判过「不是 npm 产品」的项目,走 git 分发。命中直接拒发,并给出原因。",
|
|
7
|
+
"2026-11-04 建立:起因是 agent 把 facet(排版工具)、reel-kit(视频合成工具)当 npm 包去发版 / 绑 OIDC,owner 叫停。"
|
|
8
|
+
],
|
|
9
|
+
"products": {
|
|
10
|
+
"ai-orb": { "for": "外部前端项目的 AI 光球组件(库)", "since": "npm 已有 OIDC 发布" },
|
|
11
|
+
"ai-sse-kit": { "for": "外部项目的 AI 流式接收库,modelgo-console-web 生产在用,月下载 ~200", "since": "2026-11-04 owner 确认发版" },
|
|
12
|
+
"im-notify-kit": { "for": "IM 通知库,被多个自家项目当依赖", "since": "npm 已有 OIDC 发布" },
|
|
13
|
+
"device-passport": { "for": "设备指纹库", "since": "npm 已发布" },
|
|
14
|
+
"dsh-bloom-theme": { "for": "DSH 主题插件,按 npm 包分发", "since": "npm 已有 OIDC 发布" },
|
|
15
|
+
"@dsh-plugins/dsh-llm-hub": { "for": "DSH 插件,按 npm 包分发", "since": "npm 已发布" },
|
|
16
|
+
"@dsh-plugins/dsh-museav-assets": { "for": "DSH 插件,按 npm 包分发", "since": "npm 已发布" },
|
|
17
|
+
"vite-plugin-agent-eyes": { "for": "Vite 插件,业务仓当依赖装", "since": "npm 已有 OIDC 发布" },
|
|
18
|
+
"vite-plugin-refresh-guard": { "for": "Vite 插件,5 个业务仓当依赖装", "since": "npm 已有 OIDC 发布" },
|
|
19
|
+
"museav-cli": { "for": "MUSE AV 中台 CLI,租户用户 npm 安装", "since": "npm 已有自动发布" },
|
|
20
|
+
"cs-mcp": { "for": "主分发为单文件二进制(npm 包已标不维护);release.yml 仍跑三道门禁,故登记以免误拦", "since": "既有" }
|
|
21
|
+
},
|
|
22
|
+
"notOnNpm": {
|
|
23
|
+
"@webkubor/facet": "owner 2026-11-04:排版工具,不是为 npm 做的产物。git 分发:npm i -g github:webkubor/facet",
|
|
24
|
+
"@kubor/reel-kit": "owner 2026-11-04:视频合成工具,不是 npm 库、不维护 npm。git 分发:npm i -g github:webkubor/reel-kit"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# 仓库级 pre-commit 门禁(由全局 ~/.config/git/hooks/pre-commit 调用)。
|
|
3
|
+
# 只快检:产物语法 + DSH 宿主契约(真 cordis 内核试跑 apply,约 3 秒)。
|
|
4
|
+
# 2026-10-30 加:起因是 bloom 分支产物让桌面端起不来,见 ../SOP.md「部署门禁」。
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
cd "$(git rev-parse --show-toplevel)"
|
|
7
|
+
|
|
8
|
+
for f in lib/*.js; do node --check "$f"; done
|
|
9
|
+
|
|
10
|
+
if git diff --cached --name-only | grep -qE '^(lib/|package\.json$)'; then
|
|
11
|
+
node ../scripts/dsh-dev.mjs check
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
echo "✓ pre-commit checks passed"
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
* 10MB,正确修法是换成图床直链而不是把 10MB 塞进每个安装包)。共同点是
|
|
14
14
|
* 「约定没做成门禁」,所以把判据做成能跑的:
|
|
15
15
|
*
|
|
16
|
+
* 契约 0 产品定位 —— 包名必须登记在 npm-products.json 的 products 里(owner 拍板的
|
|
17
|
+
* 「这是 npm 产品」);命中 notOnNpm 或未登记 → 拒发。无逃生舱。
|
|
18
|
+
* 2026-11-04 加:facet / reel-kit 不是 npm 产品却被当成 npm 包去发。
|
|
16
19
|
* 契约 1 产物完整性 —— package.json 必须在;`files` 里每个字面量条目至少命中一个文件;
|
|
17
20
|
* main / types / exports / dsh 引用的相对路径文件必须存在。
|
|
18
21
|
* 契约 2 图片引用 —— README 里以**相对路径**引用的 assets/* 必须在 tarball 里。
|
|
@@ -33,7 +36,7 @@ import { tmpdir } from 'node:os'
|
|
|
33
36
|
import { createHash } from 'node:crypto'
|
|
34
37
|
import { EXCLUDE, isRuntime, collectAllFiles, detectChangedRuntime, packEntry } from './gate-lib.mjs'
|
|
35
38
|
|
|
36
|
-
const GATE_VERSION =
|
|
39
|
+
const GATE_VERSION = 2
|
|
37
40
|
|
|
38
41
|
const here = dirname(fileURLToPath(import.meta.url))
|
|
39
42
|
const pkgRoot = dirname(here)
|
|
@@ -42,6 +45,36 @@ const pkg = JSON.parse(readFileSync(join(pkgRoot, 'package.json'), 'utf8'))
|
|
|
42
45
|
const version = pkg.version
|
|
43
46
|
const errors = []
|
|
44
47
|
|
|
48
|
+
// ── 契约 0 产品定位(业务拦截,先于一切机械检查)─────────────────────────
|
|
49
|
+
// 上 npm 是产品定位决策:得有人说清「给谁用、为什么非 npm 不可」。
|
|
50
|
+
// 判据只有一个 —— owner 维护的台账 npm-products.json(真源在 CortexOS,
|
|
51
|
+
// 由 check-release-gate-sync --fix 分发到本目录)。不在台账里 = 没被批准成 npm 产品。
|
|
52
|
+
// 不设逃生舱:能被环境变量绕过的定位拦截等于没有。要上 npm,去台账登记(owner 拍板)。
|
|
53
|
+
// 2026-11-04 起因:facet(排版工具)、reel-kit(视频合成工具)被 agent 当 npm 包去发版。
|
|
54
|
+
{
|
|
55
|
+
const ledgerPath = join(here, 'npm-products.json')
|
|
56
|
+
if (!existsSync(ledgerPath)) {
|
|
57
|
+
console.error(`[prepublish-gate] ✖ 契约 0 产品定位: 缺台账 scripts/npm-products.json`)
|
|
58
|
+
console.error(` → 在 CortexOS 跑 node scripts/check-release-gate-sync.mjs --fix 分发台账;不要手写一份`)
|
|
59
|
+
process.exit(1)
|
|
60
|
+
}
|
|
61
|
+
const ledger = JSON.parse(readFileSync(ledgerPath, 'utf8'))
|
|
62
|
+
const denied = ledger.notOnNpm?.[pkg.name]
|
|
63
|
+
if (denied) {
|
|
64
|
+
console.error(`[prepublish-gate] ✖ 契约 0 产品定位: ${pkg.name} 已被判定为「不是 npm 产品」,拒绝发布`)
|
|
65
|
+
console.error(` → ${denied}`)
|
|
66
|
+
console.error(` → 建议 package.json 设 "private": true,并删掉 publish workflow / 发布脚本`)
|
|
67
|
+
process.exit(1)
|
|
68
|
+
}
|
|
69
|
+
if (!ledger.products?.[pkg.name]) {
|
|
70
|
+
console.error(`[prepublish-gate] ✖ 契约 0 产品定位: ${pkg.name} 不在 npm 产品台账里,拒绝发布`)
|
|
71
|
+
console.error(` → 上 npm 是产品定位决策,不是发版流程能顺手做的。先问 owner:给谁用?为什么非 npm 不可?`)
|
|
72
|
+
console.error(` → owner 同意后在 CortexOS scripts/release-gate/npm-products.json 的 products 里登记,再 --fix 分发`)
|
|
73
|
+
console.error(` → agent 不得为了过门禁自行登记`)
|
|
74
|
+
process.exit(1)
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
45
78
|
// ── 0. 打包清单 ────────────────────────────────────────────────────────────
|
|
46
79
|
let packFiles
|
|
47
80
|
try {
|
|
@@ -250,7 +283,7 @@ if (errors.length > 0) {
|
|
|
250
283
|
process.exit(1)
|
|
251
284
|
}
|
|
252
285
|
|
|
253
|
-
console.log(`[prepublish-gate] ✓ ${pkg.name}@${version}
|
|
286
|
+
console.log(`[prepublish-gate] ✓ ${pkg.name}@${version} 五条契约通过(gate v${GATE_VERSION})`)
|
|
254
287
|
console.log(`[prepublish-gate] · tarball ${packFiles.length} 个文件;运行期载荷 ${packFiles.filter(isRuntime).length} 个`)
|
|
255
288
|
if (referencedAssets.size > 0) console.log(`[prepublish-gate] · README 引用的 ${referencedAssets.size} 个 assets 均在包内`)
|
|
256
289
|
console.log(`[prepublish-gate] · CHANGELOG 含当前版本段`)
|
package/scripts/readme-gate.mjs
CHANGED
|
@@ -109,13 +109,23 @@ if (!hasWhyTable) {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
// ── 4. 英文 README ─────────────────────────────────────────────────────────
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
// 两种合规形态:
|
|
113
|
+
// A. 有独立英文文件(README.en.md 等)—— 主流约定
|
|
114
|
+
// B. README.md 本身就是英文、中文另放 README_CN.md —— 「英文为默认入场券」
|
|
115
|
+
// 同样合规:npm 包页展示的就是 README.md,它已经是英文了。
|
|
116
|
+
// (device-passport 就是这种结构;硬造一份 README.en.md 去复制 README.md
|
|
117
|
+
// 是重复文件,将来两边改一处漏一处,反而更容易不一致。)
|
|
118
|
+
const enFiles = ['README.en.md', 'README.en-US.md', 'README.en_US.md']
|
|
119
|
+
const hasEnFile = enFiles.some((f) => existsSync(join(pkgRoot, f)))
|
|
120
|
+
const hasCnAlt = existsSync(join(pkgRoot, 'README_CN.md')) || existsSync(join(pkgRoot, 'README.zh-CN.md'))
|
|
121
|
+
const readmeIsEn = readme.slice(0, 400).trim().length > 0
|
|
122
|
+
const hasEn = hasEnFile || (hasCnAlt && readmeIsEn)
|
|
114
123
|
|
|
115
124
|
if (!hasEn) {
|
|
116
125
|
errors.push(
|
|
117
126
|
'缺少英文 README(README.en.md)\n' +
|
|
118
|
-
' → dsh-plugin 生态面向全球,英文是默认入场券;中文 README 首行加上 [English](README.en.md) |
|
|
127
|
+
' → dsh-plugin 生态面向全球,英文是默认入场券;中文 README 首行加上 [English](README.en.md) | 中文\n' +
|
|
128
|
+
' → 或者反过来:README.md 就写英文、中文另放 README_CN.md(同样合规)'
|
|
119
129
|
)
|
|
120
130
|
}
|
|
121
131
|
|