@liangjiehappy/dsh-deepseekbase 0.3.0 → 0.3.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/lib/index.js +65 -13
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -104,23 +104,75 @@ export function apply(ctx) {
|
|
|
104
104
|
});
|
|
105
105
|
|
|
106
106
|
// ── SKILLS ───────────────────────────────────────────────────────────────
|
|
107
|
-
// 装本插件即获得 DSHIO
|
|
107
|
+
// 装本插件即获得 DSHIO 标准内容。
|
|
108
|
+
// 先注册内置副本(保证离线可用),再异步拉服务器最新版覆盖。
|
|
109
|
+
// 这样我们更新标准时,所有已装用户下次启动就同步,无需重装插件。
|
|
110
|
+
const skillDisposers = [];
|
|
108
111
|
try {
|
|
109
112
|
if (ctx.skills && typeof ctx.skills.register === "function") {
|
|
110
113
|
for (const sk of SKILLS) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
114
|
+
skillDisposers.push(
|
|
115
|
+
ctx.skills.register({
|
|
116
|
+
name: sk.name,
|
|
117
|
+
description: sk.description,
|
|
118
|
+
content: sk.content,
|
|
119
|
+
metadata: {
|
|
120
|
+
source: "deepseekbase",
|
|
121
|
+
layer: "bundled",
|
|
122
|
+
standard: sk.name === "dshio-standards" ? "DSHIO/T 00,10,21" : "DSHIO/T 10",
|
|
123
|
+
lang: "zh-Hans",
|
|
124
|
+
homepage: "https://deepseekbase.com/standards/",
|
|
125
|
+
},
|
|
126
|
+
...(sk.whenToUse ? { whenToUse: sk.whenToUse } : {}),
|
|
127
|
+
}),
|
|
128
|
+
);
|
|
123
129
|
}
|
|
130
|
+
|
|
131
|
+
// 异步刷新:拉到新版就替换内置版
|
|
132
|
+
(async () => {
|
|
133
|
+
try {
|
|
134
|
+
const r = await jfetch(BASE + "/api/dshio/skills.json", {});
|
|
135
|
+
if (r.status !== 200 || !r.body || !Array.isArray(r.body.skills)) return;
|
|
136
|
+
const remote = r.body.skills.filter(
|
|
137
|
+
(x) => x && typeof x.name === "string" && typeof x.content === "string",
|
|
138
|
+
);
|
|
139
|
+
if (!remote.length) return;
|
|
140
|
+
// 只有内容确实不同才替换,避免无谓的目录失效
|
|
141
|
+
const same = remote.every((rs) => {
|
|
142
|
+
const local = SKILLS.find((l) => l.name === rs.name);
|
|
143
|
+
return local && local.content === rs.content;
|
|
144
|
+
});
|
|
145
|
+
if (same) return;
|
|
146
|
+
|
|
147
|
+
for (const d of skillDisposers) {
|
|
148
|
+
try { d(); } catch { /* ignore */ }
|
|
149
|
+
}
|
|
150
|
+
skillDisposers.length = 0;
|
|
151
|
+
for (const rs of remote) {
|
|
152
|
+
skillDisposers.push(
|
|
153
|
+
ctx.skills.register({
|
|
154
|
+
name: rs.name,
|
|
155
|
+
description: rs.description,
|
|
156
|
+
content: rs.content,
|
|
157
|
+
metadata: Object.assign(
|
|
158
|
+
{
|
|
159
|
+
source: "deepseekbase",
|
|
160
|
+
layer: "remote",
|
|
161
|
+
version: r.body.version,
|
|
162
|
+
updated: r.body.updated,
|
|
163
|
+
lang: "zh-Hans",
|
|
164
|
+
homepage: r.body.homepage || "https://dshio.org",
|
|
165
|
+
},
|
|
166
|
+
rs.metadata || {},
|
|
167
|
+
),
|
|
168
|
+
...(rs.whenToUse ? { whenToUse: rs.whenToUse } : {}),
|
|
169
|
+
}),
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
} catch {
|
|
173
|
+
/* 离线时静默保留内置副本 */
|
|
174
|
+
}
|
|
175
|
+
})();
|
|
124
176
|
}
|
|
125
177
|
} catch (e) {
|
|
126
178
|
// skills 服务不可用时不影响工具功能
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liangjiehappy/dsh-deepseekbase",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "DeepSeek prices, plugins with sandbox test results, model specs and token trends inside DeepSeek Harness — powered by deepseekbase.com",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|