dsh-light-guard 0.7.2 → 0.7.4
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 +16 -0
- package/README.md +1 -1
- package/lib/client.js +124 -50
- package/market/unifilitence__dsh-light-guard.yml +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,22 @@
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## v0.7.4 (2026-11-27)
|
|
10
|
+
- **发现的问题**:高频实用功能「软刷新前端界面」此前藏在第二个 Tab「体检与快照」里,打开插件第一屏不容易发现;若直接挤在标题行右侧又容易把标题和徽章挤换行。
|
|
11
|
+
- **改了什么**:
|
|
12
|
+
- 在顶部驾驶舱 4 个 KPI 指标卡正下方新增独立**「快捷操作栏」**,将「立即体检」与「↻ 软刷新前端界面」等高舒展并排呈现,既突出醒目又不挤占标题和指标卡宽度;
|
|
13
|
+
- 软刷新确认卡片与减负回执同步支持在顶部操作栏直接展开与展示,并在真机 DSH 桌面端完成无报错端到端验证。
|
|
14
|
+
|
|
15
|
+
## v0.7.3 (2026-11-27)
|
|
16
|
+
- **发现的问题**:
|
|
17
|
+
1. 设置页中部分深色强调字(`#b45309` / `#059669`)在 DSH 深色模式下对比度偏低;
|
|
18
|
+
2. 顶部操作反馈提示条缺少关闭按钮与语义区分,且「重度长会话」「海量历史档」两张预设卡片的简介文字还停留在旧版本口径。
|
|
19
|
+
- **改了什么**:
|
|
20
|
+
- 参照 Apple / Linear 设置面板风格统一微调视觉 token:12px 圆角卡片、柔和投影、等宽数字(`tabular-nums`)与平滑过渡;
|
|
21
|
+
- 统一升级为浅色/深色双主题均清晰可读的语义色阶(`#3b82f6` / `#10b981` / `#f59e0b` / `#ef4444`);
|
|
22
|
+
- 顶部状态提示条升级为带左侧语义色条(成功绿 / 异常红 / 信息蓝)与「×」一键关闭的轻提示;
|
|
23
|
+
- 同步更新「重度长会话」「海量历史档」预设卡片说明与顶部副标题,确保文案与实际参数 100% 一致。
|
|
24
|
+
|
|
9
25
|
## v0.7.2 (2026-11-27)
|
|
10
26
|
- **发现的问题**:在 DSH 桌面端的 combo bundle 启动机制中,同一批次内任一插件如果在顶层注册或激活阶段同步抛错(例如重复执行触发 `duplicate factory registration`),会阻断同批排在后面的其他插件注册并引发 `web-boot` 致命弹窗。
|
|
11
27
|
- **改了什么**:
|
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.4";
|
|
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() {
|
|
@@ -685,7 +690,7 @@ window.__ModuleLoader__.load({
|
|
|
685
690
|
var snapLabel = _snapLabel[0], setSnapLabel = _snapLabel[1];
|
|
686
691
|
var _liveDom = React.useState({ domNodes: 0, longTasks: 0, maxLtMs: 0 });
|
|
687
692
|
var liveDom = _liveDom[0], setLiveDom = _liveDom[1];
|
|
688
|
-
var _srConfirm = React.useState(
|
|
693
|
+
var _srConfirm = React.useState(null); // "hero" | "doctor" | null
|
|
689
694
|
var srConfirm = _srConfirm[0], setSrConfirm = _srConfirm[1];
|
|
690
695
|
var _srState = React.useState(readSoftReloadState);
|
|
691
696
|
var srState = _srState[0], setSrState = _srState[1];
|
|
@@ -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,
|
|
@@ -1083,6 +1088,30 @@ window.__ModuleLoader__.load({
|
|
|
1083
1088
|
{ id: "archive", label: "冷归档库" + (archList ? " (" + archList.totalCount + ")" : "") }
|
|
1084
1089
|
];
|
|
1085
1090
|
|
|
1091
|
+
var heroIsDesktop = typeof window !== "undefined" && window.location && window.location.protocol === "dsh-app:";
|
|
1092
|
+
var heroSr = readSoftReloadState();
|
|
1093
|
+
var heroSrFailed = heroSr && heroSr.status === "failed";
|
|
1094
|
+
var heroSrVerified = heroSr && heroSr.status === "verified";
|
|
1095
|
+
|
|
1096
|
+
function renderSoftReloadConfirmBox(isDesktopEnv, verifiedEnv) {
|
|
1097
|
+
return h("div", { style: { marginTop: "10px", 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 } },
|
|
1098
|
+
h("div", { style: { fontWeight: 700, marginBottom: "4px", color: "#f59e0b" } },
|
|
1099
|
+
isDesktopEnv && !verifiedEnv ? "使用前必看(请花 3 秒确认,别担心数据安全)" : "确认立即软刷新前端界面?"
|
|
1100
|
+
),
|
|
1101
|
+
h("div", null, "1. 作用:仅重载前端界面释放 Chromium 渲染内存,不重启后端、不中断后台正在运行的 Agent 任务;输入栏未发送的草稿请先复制保存。"),
|
|
1102
|
+
isDesktopEnv && !verifiedEnv
|
|
1103
|
+
? h("div", null, "2. 兼容提醒:如果您装了多个第三方插件,个别插件在桌面端重载时可能触发 web-boot 报错弹窗。")
|
|
1104
|
+
: null,
|
|
1105
|
+
isDesktopEnv && !verifiedEnv
|
|
1106
|
+
? h("div", null, "3. 万一弹窗别慌:您的数据、会话和插件绝对不会丢失——直接点弹窗里的「重启」(不要点「禁用第三方插件」),几秒即可恢复正常;本插件会自动记住冲突,后续不再推荐。")
|
|
1107
|
+
: null,
|
|
1108
|
+
h("div", { style: { display: "flex", gap: "8px", marginTop: "8px" } },
|
|
1109
|
+
h("button", { style: btnPrimary, onClick: executeSoftReload }, "我已知晓,开始软刷新"),
|
|
1110
|
+
h("button", { style: btnBase, onClick: function () { setSrConfirm(null); } }, "取消")
|
|
1111
|
+
)
|
|
1112
|
+
);
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1086
1115
|
return h("div", { style: { fontSize: "13px", lineHeight: 1.5, maxWidth: "820px" } },
|
|
1087
1116
|
|
|
1088
1117
|
// ── Hero Performance Cockpit ──
|
|
@@ -1101,17 +1130,12 @@ window.__ModuleLoader__.load({
|
|
|
1101
1130
|
h(Pill, null, "v" + VERSION),
|
|
1102
1131
|
h(Pill, { bg: streamBadge.bg, color: streamBadge.color }, streamBadge.text),
|
|
1103
1132
|
(verInfo.hostVersion && verInfo.hostVersion !== VERSION) || (verInfo.diskVersion && verInfo.hostVersion && verInfo.diskVersion !== verInfo.hostVersion)
|
|
1104
|
-
? h(Pill, { bg: "rgba(245,158,11,0.18)", color: "#
|
|
1133
|
+
? h(Pill, { bg: "rgba(245,158,11,0.18)", color: "#f59e0b" }, "后端 v" + (verInfo.hostVersion || "旧版") + " · 待热重载/重启")
|
|
1105
1134
|
: null
|
|
1106
1135
|
),
|
|
1107
|
-
h("button", {
|
|
1108
|
-
style: Object.assign({}, btnPrimary, { padding: "6px 14px", fontWeight: 600 }),
|
|
1109
|
-
disabled: scanning,
|
|
1110
|
-
onClick: function () { doScan(true); }
|
|
1111
|
-
}, scanning ? "扫描中…" : "立即体检")
|
|
1112
1136
|
),
|
|
1113
1137
|
h("div", { style: { fontSize: "12px", opacity: 0.78, marginBottom: "10px" } },
|
|
1114
|
-
"零后台轮询 ·
|
|
1138
|
+
"零后台轮询 · 官方 API 冷归档 · 前后端内存归因 · 可调参流瘦身"
|
|
1115
1139
|
),
|
|
1116
1140
|
h("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "8px" } },
|
|
1117
1141
|
h("div", { style: kpiTile },
|
|
@@ -1132,7 +1156,46 @@ window.__ModuleLoader__.load({
|
|
|
1132
1156
|
)
|
|
1133
1157
|
)
|
|
1134
1158
|
)
|
|
1135
|
-
)
|
|
1159
|
+
),
|
|
1160
|
+
// ── Dedicated Quick Action Bar below KPIs ──
|
|
1161
|
+
h("div", {
|
|
1162
|
+
style: {
|
|
1163
|
+
display: "flex",
|
|
1164
|
+
justifyContent: "space-between",
|
|
1165
|
+
alignItems: "center",
|
|
1166
|
+
gap: "10px",
|
|
1167
|
+
flexWrap: "wrap",
|
|
1168
|
+
marginTop: "12px",
|
|
1169
|
+
paddingTop: "11px",
|
|
1170
|
+
borderTop: "1px solid rgba(128,128,128,0.14)"
|
|
1171
|
+
}
|
|
1172
|
+
},
|
|
1173
|
+
h("div", { style: { display: "flex", alignItems: "center", gap: "8px", flexWrap: "wrap" } },
|
|
1174
|
+
h("button", {
|
|
1175
|
+
style: Object.assign({}, btnPrimary, { padding: "7px 16px", fontWeight: 600 }),
|
|
1176
|
+
disabled: scanning,
|
|
1177
|
+
onClick: function () { doScan(true); }
|
|
1178
|
+
}, scanning ? "扫描中…" : "立即体检"),
|
|
1179
|
+
h("button", {
|
|
1180
|
+
style: Object.assign({}, btnBase, {
|
|
1181
|
+
padding: "7px 14px",
|
|
1182
|
+
fontWeight: 600,
|
|
1183
|
+
borderColor: heroSrFailed ? "rgba(245,158,11,0.5)" : "rgba(59,130,246,0.45)",
|
|
1184
|
+
background: heroSrFailed ? "rgba(245,158,11,0.1)" : "rgba(59,130,246,0.09)",
|
|
1185
|
+
color: heroSrFailed ? "#f59e0b" : "#3b82f6"
|
|
1186
|
+
}),
|
|
1187
|
+
onClick: function () { setSrConfirm(srConfirm === "hero" ? null : "hero"); }
|
|
1188
|
+
}, (heroSrFailed ? "↻ 重新测试软刷新" : "↻ 软刷新前端界面") + (heroSrVerified ? " ✓" : ""))
|
|
1189
|
+
),
|
|
1190
|
+
h("div", { style: { fontSize: "11px", opacity: 0.72 } },
|
|
1191
|
+
heroSrVerified && typeof heroSr.beforeDom === "number" && typeof heroSr.afterDom === "number"
|
|
1192
|
+
? ("✓ 上次软刷新:DOM " + heroSr.beforeDom.toLocaleString() + " → " + heroSr.afterDom.toLocaleString())
|
|
1193
|
+
: heroSrFailed
|
|
1194
|
+
? "⚠ 上次软刷新异常,建议正常重启 DSH"
|
|
1195
|
+
: "软刷新仅重载界面,不中断后台任务"
|
|
1196
|
+
)
|
|
1197
|
+
),
|
|
1198
|
+
srConfirm === "hero" ? renderSoftReloadConfirmBox(heroIsDesktop, heroSrVerified) : null
|
|
1136
1199
|
),
|
|
1137
1200
|
|
|
1138
1201
|
// Long uptime gentle reminder
|
|
@@ -1143,7 +1206,33 @@ window.__ModuleLoader__.load({
|
|
|
1143
1206
|
: null,
|
|
1144
1207
|
|
|
1145
1208
|
// Status toast banner
|
|
1146
|
-
msg ?
|
|
1209
|
+
msg ? (function () {
|
|
1210
|
+
var isErr = /失败|异常|未找到|错误/.test(msg);
|
|
1211
|
+
var isOk = !isErr && /成功|完成|已复制|已切换|已还原|已归档|已保存|已清空/.test(msg);
|
|
1212
|
+
var tone = isErr ? "#ef4444" : isOk ? "#10b981" : "#3b82f6";
|
|
1213
|
+
var toneBg = isErr ? "rgba(239,68,68,0.1)" : isOk ? "rgba(16,185,129,0.1)" : "rgba(59,130,246,0.1)";
|
|
1214
|
+
return h("div", {
|
|
1215
|
+
style: {
|
|
1216
|
+
display: "flex",
|
|
1217
|
+
justifyContent: "space-between",
|
|
1218
|
+
alignItems: "center",
|
|
1219
|
+
gap: "10px",
|
|
1220
|
+
padding: "8px 12px",
|
|
1221
|
+
marginBottom: "12px",
|
|
1222
|
+
borderRadius: "8px",
|
|
1223
|
+
background: toneBg,
|
|
1224
|
+
borderLeft: "3px solid " + tone,
|
|
1225
|
+
fontSize: "12px"
|
|
1226
|
+
}
|
|
1227
|
+
},
|
|
1228
|
+
h("span", null, msg),
|
|
1229
|
+
h("button", {
|
|
1230
|
+
onClick: function () { setMsg(""); },
|
|
1231
|
+
title: "关闭提示",
|
|
1232
|
+
style: { border: "none", background: "transparent", color: "inherit", opacity: 0.65, cursor: "pointer", fontSize: "14px", lineHeight: 1, padding: "0 4px" }
|
|
1233
|
+
}, "×")
|
|
1234
|
+
);
|
|
1235
|
+
})() : null,
|
|
1147
1236
|
|
|
1148
1237
|
// ── 3 Segmented Tabs ──
|
|
1149
1238
|
h("div", {
|
|
@@ -1171,7 +1260,9 @@ window.__ModuleLoader__.load({
|
|
|
1171
1260
|
fontWeight: active ? 600 : 500,
|
|
1172
1261
|
background: active ? "var(--dsh-accent, #2563eb)" : "transparent",
|
|
1173
1262
|
color: active ? "#ffffff" : "inherit",
|
|
1174
|
-
opacity: active ? 1 : 0.
|
|
1263
|
+
opacity: active ? 1 : 0.78,
|
|
1264
|
+
boxShadow: active ? "0 1px 3px rgba(37,99,235,0.28)" : "none",
|
|
1265
|
+
transition: "all 0.15s ease"
|
|
1175
1266
|
}
|
|
1176
1267
|
}, t.label);
|
|
1177
1268
|
})
|
|
@@ -1187,7 +1278,7 @@ window.__ModuleLoader__.load({
|
|
|
1187
1278
|
padding: "11px 14px"
|
|
1188
1279
|
})
|
|
1189
1280
|
},
|
|
1190
|
-
h("div", { style: { fontWeight: 600, fontSize: "12px", marginBottom: "6px", color: "#
|
|
1281
|
+
h("div", { style: { fontWeight: 600, fontSize: "12px", marginBottom: "6px", color: "#10b981" } },
|
|
1191
1282
|
"已采取措施的实测减负效果(仅展示真实统计,绝不虚构)"
|
|
1192
1283
|
),
|
|
1193
1284
|
h("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(210px, 1fr))", gap: "8px", fontSize: "12px" } },
|
|
@@ -1429,14 +1520,14 @@ window.__ModuleLoader__.load({
|
|
|
1429
1520
|
srVerified
|
|
1430
1521
|
? h(Pill, { bg: "rgba(16,185,129,0.14)", color: "#10b981" }, "软刷新本机已验证 ✓")
|
|
1431
1522
|
: srFailed
|
|
1432
|
-
? h(Pill, { bg: "rgba(245,158,11,0.16)", color: "#
|
|
1523
|
+
? h(Pill, { bg: "rgba(245,158,11,0.16)", color: "#f59e0b" }, "上次软刷新异常 · 不推荐")
|
|
1433
1524
|
: isDesktop
|
|
1434
1525
|
? h(Pill, null, "桌面端首次使用需确认")
|
|
1435
1526
|
: null
|
|
1436
1527
|
),
|
|
1437
1528
|
h("button", {
|
|
1438
1529
|
style: (!srFailed && memDiag.suggestSoftReload) ? btnPrimary : btnBase,
|
|
1439
|
-
onClick: function () { setSrConfirm(
|
|
1530
|
+
onClick: function () { setSrConfirm(srConfirm === "doctor" ? null : "doctor"); }
|
|
1440
1531
|
}, srFailed ? "重新测试软刷新" : "软刷新前端界面")
|
|
1441
1532
|
),
|
|
1442
1533
|
h("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))", gap: "8px", marginBottom: "8px", fontSize: "12px" } },
|
|
@@ -1460,7 +1551,7 @@ window.__ModuleLoader__.load({
|
|
|
1460
1551
|
),
|
|
1461
1552
|
// Before/After relief receipt after a verified soft reload
|
|
1462
1553
|
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: "#
|
|
1554
|
+
? h("div", { style: { marginTop: "8px", fontSize: "11px", padding: "6px 10px", borderRadius: "7px", background: "rgba(16,185,129,0.08)", color: "#10b981" } },
|
|
1464
1555
|
"✓ 上次软刷新实测回执:" +
|
|
1465
1556
|
(curSr.beforeHeapMB !== null && curSr.afterHeapMB !== null ? ("前端堆 " + curSr.beforeHeapMB + " MB → " + curSr.afterHeapMB + " MB · ") : "") +
|
|
1466
1557
|
"DOM " + curSr.beforeDom.toLocaleString() + " → " + curSr.afterDom.toLocaleString()
|
|
@@ -1469,31 +1560,14 @@ window.__ModuleLoader__.load({
|
|
|
1469
1560
|
// Circuit breaker warning when a previous soft reload did not settle cleanly
|
|
1470
1561
|
srFailed
|
|
1471
1562
|
? 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: "#
|
|
1563
|
+
h("b", { style: { color: "#f59e0b" } }, "⚠️ 检测到上次软刷新未正常完成(不建议在当前插件组合下使用)"),
|
|
1473
1564
|
h("div", { style: { marginTop: "3px", opacity: 0.9 } },
|
|
1474
1565
|
"这通常是您安装的其他第三方插件不支持桌面端前端重载导致的(您的数据、会话和插件不会受损)。建议改用「等当前任务结束后正常重启 DSH」;若后续调整过插件列表,可点右上角「重新测试软刷新」。"
|
|
1475
1566
|
)
|
|
1476
1567
|
)
|
|
1477
1568
|
: null,
|
|
1478
1569
|
// Clear, reassuring 2-step confirmation panel before triggering reload
|
|
1479
|
-
srConfirm
|
|
1480
|
-
? 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: "#b45309" } },
|
|
1482
|
-
isDesktop && !srVerified ? "使用前必看(请花 3 秒确认,别担心数据安全)" : "确认立即软刷新前端界面?"
|
|
1483
|
-
),
|
|
1484
|
-
h("div", null, "1. 作用:仅重载前端界面释放 Chromium 渲染内存,不重启后端、不中断后台正在运行的 Agent 任务;输入栏未发送的草稿请先复制保存。"),
|
|
1485
|
-
isDesktop && !srVerified
|
|
1486
|
-
? h("div", null, "2. 兼容提醒:如果您装了多个第三方插件,个别插件在桌面端重载时可能触发 web-boot 报错弹窗。")
|
|
1487
|
-
: null,
|
|
1488
|
-
isDesktop && !srVerified
|
|
1489
|
-
? h("div", null, "3. 万一弹窗别慌:您的数据、会话和插件绝对不会丢失——直接点弹窗里的「重启」(不要点「禁用第三方插件」),几秒即可恢复正常;本插件会自动记住冲突,后续不再推荐。")
|
|
1490
|
-
: null,
|
|
1491
|
-
h("div", { style: { display: "flex", gap: "8px", marginTop: "8px" } },
|
|
1492
|
-
h("button", { style: btnPrimary, onClick: executeSoftReload }, "我已知晓,开始软刷新"),
|
|
1493
|
-
h("button", { style: btnBase, onClick: function () { setSrConfirm(false); } }, "取消")
|
|
1494
|
-
)
|
|
1495
|
-
)
|
|
1496
|
-
: null
|
|
1570
|
+
srConfirm === "doctor" ? renderSoftReloadConfirmBox(isDesktop, srVerified) : null
|
|
1497
1571
|
),
|
|
1498
1572
|
|
|
1499
1573
|
h("div", { style: surfaceCard },
|
|
@@ -1537,7 +1611,7 @@ window.__ModuleLoader__.load({
|
|
|
1537
1611
|
h("span", { style: { fontSize: "11px", opacity: 0.8 } }, d.files.toLocaleString() + " 文件 · " + d.mb + " MB"),
|
|
1538
1612
|
h(Pill, {
|
|
1539
1613
|
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" ? "#
|
|
1614
|
+
color: d.severity === "critical" ? "#ef4444" : d.severity === "warn" ? "#f59e0b" : "#10b981"
|
|
1541
1615
|
}, d.severity === "critical" ? "膨胀" : d.severity === "warn" ? "偏高" : "正常"),
|
|
1542
1616
|
h("button", { style: Object.assign({}, btnBase, { padding: "2px 8px", fontSize: "11px" }), onClick: function () { doOpenFolder(d.relPath || ("storages/" + d.name)); } }, "打开目录")
|
|
1543
1617
|
)
|
|
@@ -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 套一键预设)。'
|