dsh-light-guard 0.7.2 → 0.7.3
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 +10 -0
- package/README.md +1 -1
- package/lib/client.js +58 -25
- package/market/unifilitence__dsh-light-guard.yml +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## v0.7.3 (2026-11-27)
|
|
10
|
+
- **发现的问题**:
|
|
11
|
+
1. 设置页中部分深色强调字(`#b45309` / `#059669`)在 DSH 深色模式下对比度偏低;
|
|
12
|
+
2. 顶部操作反馈提示条缺少关闭按钮与语义区分,且「重度长会话」「海量历史档」两张预设卡片的简介文字还停留在旧版本口径。
|
|
13
|
+
- **改了什么**:
|
|
14
|
+
- 参照 Apple / Linear 设置面板风格统一微调视觉 token:12px 圆角卡片、柔和投影、等宽数字(`tabular-nums`)与平滑过渡;
|
|
15
|
+
- 统一升级为浅色/深色双主题均清晰可读的语义色阶(`#3b82f6` / `#10b981` / `#f59e0b` / `#ef4444`);
|
|
16
|
+
- 顶部状态提示条升级为带左侧语义色条(成功绿 / 异常红 / 信息蓝)与「×」一键关闭的轻提示;
|
|
17
|
+
- 同步更新「重度长会话」「海量历史档」预设卡片说明与顶部副标题,确保文案与实际参数 100% 一致。
|
|
18
|
+
|
|
9
19
|
## v0.7.2 (2026-11-27)
|
|
10
20
|
- **发现的问题**:在 DSH 桌面端的 combo bundle 启动机制中,同一批次内任一插件如果在顶层注册或激活阶段同步抛错(例如重复执行触发 `duplicate factory registration`),会阻断同批排在后面的其他插件注册并引发 `web-boot` 致命弹窗。
|
|
11
21
|
- **改了什么**:
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
- **给侧边栏瘦身(只移不删)**:把超龄/超大历史会话安全移到冷归档目录,支持**按标题离线搜索**并随时**一键原位还原**。
|
|
15
15
|
- **给超长会话减负**:在设置页里可调参的流窗口裁剪 + 纯 CSS 离屏跳过渲染 + 挂机减负模式,**不改原始日志、不改模型上下文**。
|
|
16
16
|
- **一键揪出卡顿元凶 + 前后端内存归因**:点一下「立即体检」即可区分压力来自**前端 Chromium 渲染进程**还是**后端 Node 宿主进程**,并给出客观操作建议(压力在前台可一键**软刷新前端界面、不中断后台任务**;压力在后端则明确提示择机重启),同时扫出爆棚的会话与插件存储目录,支持**一键打开文件夹**和**插件前后对比快照(Δ)**。
|
|
17
|
-
-
|
|
17
|
+
- **零后台负担 + 互不连累**:平时 0 定时器、0 rAF 循环、0 报错心跳;装了 `dsh-lag-guard` 时自动避让共存;顶层启动注册带幂等保护与异步错误隔离,绝不因重复执行连累同批其他插件。
|
|
18
18
|
- **实验性功能(默认关闭)**:按需开启 GPU 极简合成(禁用毛玻璃/阴影 + 代码块限高)、激进渲染裁剪(≤40 条 / 4KB 截断)、流式输出帧节流(80–250ms),以及 30 秒按需 LoAF 卡顿脚本归因采样器。
|
|
19
19
|
|
|
20
20
|
### 一键安装(安装后重启一次 DSH,打开「设置 → 轻量护航」)
|
package/lib/client.js
CHANGED
|
@@ -20,7 +20,7 @@ window.__ModuleLoader__.load({
|
|
|
20
20
|
var h = React.createElement;
|
|
21
21
|
|
|
22
22
|
var PLUGIN_NAME = "dsh-light-guard";
|
|
23
|
-
var VERSION = "0.7.
|
|
23
|
+
var VERSION = "0.7.3";
|
|
24
24
|
var API_PREFIX = "dsh-light-guard";
|
|
25
25
|
var LOCAL_CACHE_KEY = "dsh.lightGuard.config.v1";
|
|
26
26
|
var SOFT_RELOAD_KEY = "dsh.lightGuard.softReload.v1";
|
|
@@ -526,14 +526,14 @@ window.__ModuleLoader__.load({
|
|
|
526
526
|
icon: "🚀",
|
|
527
527
|
title: "重度长会话",
|
|
528
528
|
badge: "推荐",
|
|
529
|
-
desc: "
|
|
529
|
+
desc: "流窗口裁剪(100 条)+ CSS 离屏 + 长驻提醒,适合多轮工具调用与长上下文。"
|
|
530
530
|
},
|
|
531
531
|
{
|
|
532
532
|
key: "archive",
|
|
533
533
|
icon: "📦",
|
|
534
534
|
title: "海量历史档",
|
|
535
535
|
badge: "治侧边栏",
|
|
536
|
-
desc: "针对上千条历史对话堆积,侧重
|
|
536
|
+
desc: "针对上千条历史对话堆积,侧重 14 天+ 冷归档与标题离线检索还原。"
|
|
537
537
|
},
|
|
538
538
|
{
|
|
539
539
|
key: "debug",
|
|
@@ -623,32 +623,37 @@ window.__ModuleLoader__.load({
|
|
|
623
623
|
}
|
|
624
624
|
|
|
625
625
|
var surfaceCard = {
|
|
626
|
-
border: "1px solid var(--dsh-border, rgba(128,128,128,0.
|
|
627
|
-
borderRadius: "
|
|
628
|
-
padding: "
|
|
626
|
+
border: "1px solid var(--dsh-border, rgba(128,128,128,0.18))",
|
|
627
|
+
borderRadius: "12px",
|
|
628
|
+
padding: "15px 17px",
|
|
629
629
|
marginBottom: "12px",
|
|
630
|
-
background: "var(--dsh-surface-2, rgba(128,128,128,0.
|
|
630
|
+
background: "var(--dsh-surface-2, rgba(128,128,128,0.035))",
|
|
631
|
+
boxShadow: "0 1px 2px rgba(15,23,42,0.04)"
|
|
631
632
|
};
|
|
632
633
|
var btnBase = {
|
|
633
634
|
padding: "6px 12px",
|
|
634
|
-
borderRadius: "
|
|
635
|
-
border: "1px solid var(--dsh-border, rgba(128,128,128,0.
|
|
635
|
+
borderRadius: "8px",
|
|
636
|
+
border: "1px solid var(--dsh-border, rgba(128,128,128,0.26))",
|
|
636
637
|
background: "transparent",
|
|
637
638
|
color: "inherit",
|
|
638
639
|
cursor: "pointer",
|
|
639
640
|
fontSize: "12px",
|
|
640
|
-
fontWeight: 500
|
|
641
|
+
fontWeight: 500,
|
|
642
|
+
transition: "all 0.15s ease"
|
|
641
643
|
};
|
|
642
644
|
var btnPrimary = Object.assign({}, btnBase, {
|
|
643
645
|
background: "var(--dsh-accent, #2563eb)",
|
|
644
646
|
color: "#ffffff",
|
|
645
|
-
borderColor: "transparent"
|
|
647
|
+
borderColor: "transparent",
|
|
648
|
+
boxShadow: "0 1px 2px rgba(37,99,235,0.24)"
|
|
646
649
|
});
|
|
647
650
|
var kpiTile = {
|
|
648
|
-
border: "1px solid var(--dsh-border, rgba(128,128,128,0.
|
|
649
|
-
borderRadius: "
|
|
651
|
+
border: "1px solid var(--dsh-border, rgba(128,128,128,0.16))",
|
|
652
|
+
borderRadius: "9px",
|
|
650
653
|
padding: "8px 10px",
|
|
651
|
-
background: "var(--dsh-surface-1, rgba(128,128,128,0.03))"
|
|
654
|
+
background: "var(--dsh-surface-1, rgba(128,128,128,0.03))",
|
|
655
|
+
fontVariantNumeric: "tabular-nums",
|
|
656
|
+
minWidth: 0
|
|
652
657
|
};
|
|
653
658
|
|
|
654
659
|
function SettingsPanel() {
|
|
@@ -952,7 +957,7 @@ window.__ModuleLoader__.load({
|
|
|
952
957
|
var backHigh = !!(hMem && (hMem.rssMB >= 1200 || (hMem.uptimeHours >= 24 && hMem.rssMB >= 800)));
|
|
953
958
|
if (frontHigh && !backHigh) {
|
|
954
959
|
return {
|
|
955
|
-
color: "#
|
|
960
|
+
color: "#f59e0b",
|
|
956
961
|
bg: "rgba(245,158,11,0.12)",
|
|
957
962
|
badge: "压力偏向前台",
|
|
958
963
|
suggestSoftReload: true,
|
|
@@ -1101,7 +1106,7 @@ window.__ModuleLoader__.load({
|
|
|
1101
1106
|
h(Pill, null, "v" + VERSION),
|
|
1102
1107
|
h(Pill, { bg: streamBadge.bg, color: streamBadge.color }, streamBadge.text),
|
|
1103
1108
|
(verInfo.hostVersion && verInfo.hostVersion !== VERSION) || (verInfo.diskVersion && verInfo.hostVersion && verInfo.diskVersion !== verInfo.hostVersion)
|
|
1104
|
-
? h(Pill, { bg: "rgba(245,158,11,0.18)", color: "#
|
|
1109
|
+
? h(Pill, { bg: "rgba(245,158,11,0.18)", color: "#f59e0b" }, "后端 v" + (verInfo.hostVersion || "旧版") + " · 待热重载/重启")
|
|
1105
1110
|
: null
|
|
1106
1111
|
),
|
|
1107
1112
|
h("button", {
|
|
@@ -1111,7 +1116,7 @@ window.__ModuleLoader__.load({
|
|
|
1111
1116
|
}, scanning ? "扫描中…" : "立即体检")
|
|
1112
1117
|
),
|
|
1113
1118
|
h("div", { style: { fontSize: "12px", opacity: 0.78, marginBottom: "10px" } },
|
|
1114
|
-
"零后台轮询 ·
|
|
1119
|
+
"零后台轮询 · 官方 API 冷归档 · 前后端内存归因 · 可调参流瘦身"
|
|
1115
1120
|
),
|
|
1116
1121
|
h("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "8px" } },
|
|
1117
1122
|
h("div", { style: kpiTile },
|
|
@@ -1143,7 +1148,33 @@ window.__ModuleLoader__.load({
|
|
|
1143
1148
|
: null,
|
|
1144
1149
|
|
|
1145
1150
|
// Status toast banner
|
|
1146
|
-
msg ?
|
|
1151
|
+
msg ? (function () {
|
|
1152
|
+
var isErr = /失败|异常|未找到|错误/.test(msg);
|
|
1153
|
+
var isOk = !isErr && /成功|完成|已复制|已切换|已还原|已归档|已保存|已清空/.test(msg);
|
|
1154
|
+
var tone = isErr ? "#ef4444" : isOk ? "#10b981" : "#3b82f6";
|
|
1155
|
+
var toneBg = isErr ? "rgba(239,68,68,0.1)" : isOk ? "rgba(16,185,129,0.1)" : "rgba(59,130,246,0.1)";
|
|
1156
|
+
return h("div", {
|
|
1157
|
+
style: {
|
|
1158
|
+
display: "flex",
|
|
1159
|
+
justifyContent: "space-between",
|
|
1160
|
+
alignItems: "center",
|
|
1161
|
+
gap: "10px",
|
|
1162
|
+
padding: "8px 12px",
|
|
1163
|
+
marginBottom: "12px",
|
|
1164
|
+
borderRadius: "8px",
|
|
1165
|
+
background: toneBg,
|
|
1166
|
+
borderLeft: "3px solid " + tone,
|
|
1167
|
+
fontSize: "12px"
|
|
1168
|
+
}
|
|
1169
|
+
},
|
|
1170
|
+
h("span", null, msg),
|
|
1171
|
+
h("button", {
|
|
1172
|
+
onClick: function () { setMsg(""); },
|
|
1173
|
+
title: "关闭提示",
|
|
1174
|
+
style: { border: "none", background: "transparent", color: "inherit", opacity: 0.65, cursor: "pointer", fontSize: "14px", lineHeight: 1, padding: "0 4px" }
|
|
1175
|
+
}, "×")
|
|
1176
|
+
);
|
|
1177
|
+
})() : null,
|
|
1147
1178
|
|
|
1148
1179
|
// ── 3 Segmented Tabs ──
|
|
1149
1180
|
h("div", {
|
|
@@ -1171,7 +1202,9 @@ window.__ModuleLoader__.load({
|
|
|
1171
1202
|
fontWeight: active ? 600 : 500,
|
|
1172
1203
|
background: active ? "var(--dsh-accent, #2563eb)" : "transparent",
|
|
1173
1204
|
color: active ? "#ffffff" : "inherit",
|
|
1174
|
-
opacity: active ? 1 : 0.
|
|
1205
|
+
opacity: active ? 1 : 0.78,
|
|
1206
|
+
boxShadow: active ? "0 1px 3px rgba(37,99,235,0.28)" : "none",
|
|
1207
|
+
transition: "all 0.15s ease"
|
|
1175
1208
|
}
|
|
1176
1209
|
}, t.label);
|
|
1177
1210
|
})
|
|
@@ -1187,7 +1220,7 @@ window.__ModuleLoader__.load({
|
|
|
1187
1220
|
padding: "11px 14px"
|
|
1188
1221
|
})
|
|
1189
1222
|
},
|
|
1190
|
-
h("div", { style: { fontWeight: 600, fontSize: "12px", marginBottom: "6px", color: "#
|
|
1223
|
+
h("div", { style: { fontWeight: 600, fontSize: "12px", marginBottom: "6px", color: "#10b981" } },
|
|
1191
1224
|
"已采取措施的实测减负效果(仅展示真实统计,绝不虚构)"
|
|
1192
1225
|
),
|
|
1193
1226
|
h("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(210px, 1fr))", gap: "8px", fontSize: "12px" } },
|
|
@@ -1429,7 +1462,7 @@ window.__ModuleLoader__.load({
|
|
|
1429
1462
|
srVerified
|
|
1430
1463
|
? h(Pill, { bg: "rgba(16,185,129,0.14)", color: "#10b981" }, "软刷新本机已验证 ✓")
|
|
1431
1464
|
: srFailed
|
|
1432
|
-
? h(Pill, { bg: "rgba(245,158,11,0.16)", color: "#
|
|
1465
|
+
? h(Pill, { bg: "rgba(245,158,11,0.16)", color: "#f59e0b" }, "上次软刷新异常 · 不推荐")
|
|
1433
1466
|
: isDesktop
|
|
1434
1467
|
? h(Pill, null, "桌面端首次使用需确认")
|
|
1435
1468
|
: null
|
|
@@ -1460,7 +1493,7 @@ window.__ModuleLoader__.load({
|
|
|
1460
1493
|
),
|
|
1461
1494
|
// Before/After relief receipt after a verified soft reload
|
|
1462
1495
|
srVerified && typeof curSr.beforeDom === "number" && typeof curSr.afterDom === "number"
|
|
1463
|
-
? h("div", { style: { marginTop: "8px", fontSize: "11px", padding: "6px 10px", borderRadius: "7px", background: "rgba(16,185,129,0.08)", color: "#
|
|
1496
|
+
? h("div", { style: { marginTop: "8px", fontSize: "11px", padding: "6px 10px", borderRadius: "7px", background: "rgba(16,185,129,0.08)", color: "#10b981" } },
|
|
1464
1497
|
"✓ 上次软刷新实测回执:" +
|
|
1465
1498
|
(curSr.beforeHeapMB !== null && curSr.afterHeapMB !== null ? ("前端堆 " + curSr.beforeHeapMB + " MB → " + curSr.afterHeapMB + " MB · ") : "") +
|
|
1466
1499
|
"DOM " + curSr.beforeDom.toLocaleString() + " → " + curSr.afterDom.toLocaleString()
|
|
@@ -1469,7 +1502,7 @@ window.__ModuleLoader__.load({
|
|
|
1469
1502
|
// Circuit breaker warning when a previous soft reload did not settle cleanly
|
|
1470
1503
|
srFailed
|
|
1471
1504
|
? h("div", { style: { marginTop: "8px", fontSize: "12px", padding: "8px 10px", borderRadius: "7px", background: "rgba(245,158,11,0.12)", border: "1px solid rgba(245,158,11,0.35)", lineHeight: 1.55 } },
|
|
1472
|
-
h("b", { style: { color: "#
|
|
1505
|
+
h("b", { style: { color: "#f59e0b" } }, "⚠️ 检测到上次软刷新未正常完成(不建议在当前插件组合下使用)"),
|
|
1473
1506
|
h("div", { style: { marginTop: "3px", opacity: 0.9 } },
|
|
1474
1507
|
"这通常是您安装的其他第三方插件不支持桌面端前端重载导致的(您的数据、会话和插件不会受损)。建议改用「等当前任务结束后正常重启 DSH」;若后续调整过插件列表,可点右上角「重新测试软刷新」。"
|
|
1475
1508
|
)
|
|
@@ -1478,7 +1511,7 @@ window.__ModuleLoader__.load({
|
|
|
1478
1511
|
// Clear, reassuring 2-step confirmation panel before triggering reload
|
|
1479
1512
|
srConfirm
|
|
1480
1513
|
? h("div", { style: { marginTop: "8px", fontSize: "12px", padding: "10px 12px", borderRadius: "8px", background: "rgba(245,158,11,0.1)", border: "1px solid rgba(245,158,11,0.4)", lineHeight: 1.6 } },
|
|
1481
|
-
h("div", { style: { fontWeight: 700, marginBottom: "4px", color: "#
|
|
1514
|
+
h("div", { style: { fontWeight: 700, marginBottom: "4px", color: "#f59e0b" } },
|
|
1482
1515
|
isDesktop && !srVerified ? "使用前必看(请花 3 秒确认,别担心数据安全)" : "确认立即软刷新前端界面?"
|
|
1483
1516
|
),
|
|
1484
1517
|
h("div", null, "1. 作用:仅重载前端界面释放 Chromium 渲染内存,不重启后端、不中断后台正在运行的 Agent 任务;输入栏未发送的草稿请先复制保存。"),
|
|
@@ -1537,7 +1570,7 @@ window.__ModuleLoader__.load({
|
|
|
1537
1570
|
h("span", { style: { fontSize: "11px", opacity: 0.8 } }, d.files.toLocaleString() + " 文件 · " + d.mb + " MB"),
|
|
1538
1571
|
h(Pill, {
|
|
1539
1572
|
bg: d.severity === "critical" ? "rgba(239,68,68,0.15)" : d.severity === "warn" ? "rgba(245,158,11,0.15)" : "rgba(16,185,129,0.14)",
|
|
1540
|
-
color: d.severity === "critical" ? "#ef4444" : d.severity === "warn" ? "#
|
|
1573
|
+
color: d.severity === "critical" ? "#ef4444" : d.severity === "warn" ? "#f59e0b" : "#10b981"
|
|
1541
1574
|
}, d.severity === "critical" ? "膨胀" : d.severity === "warn" ? "偏高" : "正常"),
|
|
1542
1575
|
h("button", { style: Object.assign({}, btnBase, { padding: "2px 8px", fontSize: "11px" }), onClick: function () { doOpenFolder(d.relPath || ("storages/" + d.name)); } }, "打开目录")
|
|
1543
1576
|
)
|
|
@@ -4,5 +4,5 @@ url: https://github.com/unifilitence/dsh-light-guard
|
|
|
4
4
|
name: unifilitence/dsh-light-guard
|
|
5
5
|
category: ui
|
|
6
6
|
description:
|
|
7
|
-
en: 'Zero-polling lightweight performance guard for DeepSeek Harness: reversible cold/hot session archiver via official workspaceRegistry with title search, on-demand storage doctor,
|
|
8
|
-
zh: '零后台轮询的 DSH 轻量护航插件:对接官方 workspaceRegistry
|
|
7
|
+
en: 'Zero-polling lightweight performance guard for DeepSeek Harness: reversible cold/hot session archiver via official workspaceRegistry with title search, on-demand storage & frontend/backend memory doctor (with guarded soft UI reload), plugin delta snapshots, pure CSS offscreen optimization, and configurable stream slimming.'
|
|
8
|
+
zh: '零后台轮询的 DSH 轻量护航插件:对接官方 workspaceRegistry 的可逆会话冷热归档与标题离线搜索、按需存储与前后端内存归因体检(支持带熔断护栏的软刷新前端)、插件前后性能对比快照、纯 CSS 离屏渲染优化及可调参流瘦身(内置 4 套一键预设)。'
|