@zaofan/dsh-qqbot 1.5.19 → 1.5.22
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/package.json +2 -2
- package/settings-host.js +25 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zaofan/dsh-qqbot",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.22",
|
|
4
4
|
"description": "QQ Bot IM channel plugin for deepseek-harness (dsh)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./entry.js",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"immediately": true
|
|
83
83
|
},
|
|
84
84
|
"engines": {
|
|
85
|
-
"dsh": "0.1.5-rc.2 || 0.1.6-alpha.2 || 0.1.7-rc.1"
|
|
85
|
+
"dsh": "0.1.5-rc.2 || 0.1.6-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2"
|
|
86
86
|
},
|
|
87
87
|
"manifestVersion": 1
|
|
88
88
|
},
|
package/settings-host.js
CHANGED
|
@@ -1778,6 +1778,15 @@ export function apply(ctx) {
|
|
|
1778
1778
|
preset: pick('preset'),
|
|
1779
1779
|
cwd: pick('cwd'),
|
|
1780
1780
|
dataRoot: pick('dataRoot'),
|
|
1781
|
+
// ⚠️ 2026-09-30 补:localModel 也是"面板保存写自有存储"的字段之一。
|
|
1782
|
+
// 漏了它 → /local-model/status 与 localModelDirOf 读的是 patch 默认值 →
|
|
1783
|
+
// 一开面板就把 lexicalFallback 同步成 false("评分又没了")。
|
|
1784
|
+
localModel: (() => {
|
|
1785
|
+
const o = own.localModel;
|
|
1786
|
+
if (o && typeof o === 'object') return o;
|
|
1787
|
+
const c = cfg ? cfg.localModel : undefined;
|
|
1788
|
+
return c && typeof c === 'object' ? c : (o !== undefined ? o : c);
|
|
1789
|
+
})(),
|
|
1781
1790
|
};
|
|
1782
1791
|
}
|
|
1783
1792
|
|
|
@@ -1799,7 +1808,14 @@ export function apply(ctx) {
|
|
|
1799
1808
|
const cwdCfg = m.cwd || '';
|
|
1800
1809
|
const cwd = (m.dataRoot || (cwdCfg ? join(cwdCfg, 'dshqqbot') : ''));
|
|
1801
1810
|
if (!appId || !appSecret) return null;
|
|
1802
|
-
|
|
1811
|
+
// ⚠️ 2026-09-30 修(同类问题继续根治):
|
|
1812
|
+
// 下游有大量 `bot.cfg.dataRoot` / `bot.cfg.localModel` 写法(export.xlsx、value-samples、
|
|
1813
|
+
// 图库、群管理、localModelDirOf …),但 nsBot 原先**只返回 {id,appId,appSecret,cwd,ns}**,
|
|
1814
|
+
// 根本没有 cfg 字段 → 那些地方拿到的永远是 undefined → 数据根算空 / 找不到模型目录。
|
|
1815
|
+
// 这里把"合并自有存储后的 cfg"一并带出(并补上推导出的 dataRoot),让下游写法自然成立。
|
|
1816
|
+
// 注意:cwd 字段仍是【数据根】(历史语义),cfg.cwd 才是工作目录,别混用。
|
|
1817
|
+
const cfgMerged = { ...m, dataRoot: m.dataRoot || cwd };
|
|
1818
|
+
return { id, appId, appSecret, cwd, ns: id, cfg: cfgMerged };
|
|
1803
1819
|
}
|
|
1804
1820
|
async function groupClientOf(ns) {
|
|
1805
1821
|
const bot = nsBot(ns);
|
|
@@ -2119,7 +2135,14 @@ export function apply(ctx) {
|
|
|
2119
2135
|
const missing = LOCAL_MODEL_FILES.filter((rel) => !existsSync(join(dir, rel)));
|
|
2120
2136
|
let bytes = 0;
|
|
2121
2137
|
for (const rel of LOCAL_MODEL_FILES) { try { bytes += statSync(join(dir, rel)).size; } catch { /* 缺文件不计数 */ } }
|
|
2122
|
-
|
|
2138
|
+
// ⚠️ 2026-09-30 修(主人反馈"评分又没了"): 原来取 bot.cfg.localModel —— 那是**安装 patch 里的默认值**,
|
|
2139
|
+
// 而面板保存写的是插件自有 settings; 两边不一致 → 每次打开面板就把 lexicalFallback 同步成 false
|
|
2140
|
+
// (并 resetAllEmbedders) → 评分立刻全部变成"无分"。改为与读取路由同源: 自有 settings 优先, patch 兜底。
|
|
2141
|
+
let cfg = (bot && bot.cfg && bot.cfg.localModel) || {};
|
|
2142
|
+
try {
|
|
2143
|
+
const own = readOwnSettings(NSQ(u));
|
|
2144
|
+
if (own && own.localModel && typeof own.localModel === 'object') cfg = own.localModel;
|
|
2145
|
+
} catch { /* 自有 settings 读不到就用 patch 默认值兜底 */ }
|
|
2123
2146
|
// 程序兜底(2026-09-30): 把开关同步进嵌入器模块 —— 变更时顺带重置, 下一次用到的就是新模式(无需重启)
|
|
2124
2147
|
try {
|
|
2125
2148
|
const le = await import('./dist/features/local-embed.js');
|