dsh-dock 0.9.7 → 0.9.8
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/features/tokenlog/host.js +13 -1
- package/package.json +1 -1
|
@@ -448,8 +448,13 @@ export const feature = {
|
|
|
448
448
|
}
|
|
449
449
|
|
|
450
450
|
// 历史扫描: 遍历所有会话, 读取完整日志, 重建索引
|
|
451
|
+
// 说明: 读取失败的多是旧版(v0→v1 迁移)、中途损坏或缺 seq 的会话——这类日志无法解码是常态,
|
|
452
|
+
// 不应视为异常。若逐条 console.error 会把终端刷屏, 改为统计失败数并只打印少量样例明细。
|
|
451
453
|
async function scanHistory() {
|
|
452
454
|
if (!sessionQuery) return
|
|
455
|
+
const failures = [] // { sid, msg } 保留前 MAX 条明细供排查
|
|
456
|
+
const MAX_FAIL_SAMPLES = 3
|
|
457
|
+
let failCount = 0
|
|
453
458
|
try {
|
|
454
459
|
const sessions = await sessionQuery.listSessions()
|
|
455
460
|
let added = 0
|
|
@@ -466,9 +471,16 @@ export const feature = {
|
|
|
466
471
|
for (const r of recs) records.set(r.id, r)
|
|
467
472
|
added += recs.length
|
|
468
473
|
} catch (e) {
|
|
469
|
-
|
|
474
|
+
failCount += 1
|
|
475
|
+
if (failures.length < MAX_FAIL_SAMPLES) failures.push(sid + ': ' + ((e && e.message) || String(e)))
|
|
470
476
|
}
|
|
471
477
|
}
|
|
478
|
+
// 失败会话统一汇总为一行(仅列前几条样例), 不逐条刷屏。
|
|
479
|
+
if (failCount > 0) {
|
|
480
|
+
console.warn('[dsh-dock] tokenlog 历史扫描: ' + failCount + ' 个会话未能读取' +
|
|
481
|
+
(failCount > MAX_FAIL_SAMPLES ? ', 前 ' + MAX_FAIL_SAMPLES + ' 条如下:' : ':') )
|
|
482
|
+
for (const f of failures) console.warn(' - ' + f)
|
|
483
|
+
}
|
|
472
484
|
console.log('[dsh-dock] tokenlog history scanned: +' + added + ' records, total ' + records.size)
|
|
473
485
|
} catch (e) {
|
|
474
486
|
console.error('[dsh-dock] tokenlog scanHistory failed', e && e.message)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-dock",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.8",
|
|
4
4
|
"description": "DeepSeek Harness 功能坞插件(dsh-dock):模块化功能中枢——每个功能一个 features/ 模块(可单独提取成包发布,又可经 dockBridge 装回面板)。含用量记录(LLM 调用记账/费用统计)、模型设置、图片理解代理、模型余额、任务动画(19 种运行动画 + 桌面伙伴 3D 场景、完成/需确认通知与提示音、钉钉/飞书推送,开关独立、配置持久化);侧栏入口 + 可拖拽弹窗(最大化/最小化/缩放)。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|