@copylee/dsh-computer-use 0.11.0 → 0.13.0

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/client.js CHANGED
@@ -72,6 +72,7 @@ window.__ModuleLoader__.load({
72
72
  overlay: true,
73
73
  overlayLabel: "DeepSeek Harness",
74
74
  hostWindow: "pet",
75
+ petSize: "standard",
75
76
  cardOpacity: 80,
76
77
  autoScreenshot: true,
77
78
  autoScreenshotDetail: "standard",
@@ -81,6 +82,7 @@ window.__ModuleLoader__.load({
81
82
  jpegQuality: 70,
82
83
  blockedApps: [],
83
84
  pauseOnUserInput: true,
85
+ reportUserActions: true,
84
86
  userIdleMs: 1500,
85
87
  typingMode: "stream",
86
88
  quickSteps: false,
@@ -89,6 +91,7 @@ window.__ModuleLoader__.load({
89
91
  restorePointer: false,
90
92
  protectPasswords: true,
91
93
  windowChangeGuard: true,
94
+ cdpEnabled: false,
92
95
  cdpPort: 0
93
96
  };
94
97
  /** Unwrap `.volatile()` refs (`{ get() }`) and fall back to defaults for bad values. */
@@ -100,6 +103,8 @@ window.__ModuleLoader__.load({
100
103
  return typeof value === "number" && Number.isFinite(value) ? Math.min(max, Math.max(min, Math.round(value))) : DEFAULTS[key];
101
104
  };
102
105
  const bool = (key) => typeof out[key] === "boolean" ? out[key] : DEFAULTS[key];
106
+ const cdpPort = num("cdpPort", 0, 65535);
107
+ const cdpEnabled = typeof out.cdpEnabled === "boolean" ? out.cdpEnabled : cdpPort > 0;
103
108
  const sessionMode = out.sessionMode === "off" || out.sessionMode === "on" || out.sessionMode === "always" ? out.sessionMode : out.defaultSessionEnabled === true ? "on" : DEFAULTS.sessionMode;
104
109
  return {
105
110
  harnessUrl: typeof out.harnessUrl === "string" ? httpOrigin(out.harnessUrl.trim()) : void 0,
@@ -109,6 +114,7 @@ window.__ModuleLoader__.load({
109
114
  overlay: bool("overlay"),
110
115
  overlayLabel: typeof out.overlayLabel === "string" && out.overlayLabel.trim() !== "" ? out.overlayLabel.trim().slice(0, 40) : DEFAULTS.overlayLabel,
111
116
  hostWindow: out.hostWindow === "pet" || out.hostWindow === "card" || out.hostWindow === "minimize" || out.hostWindow === "keep" ? out.hostWindow : out.minimizeHostWindow === true ? "minimize" : DEFAULTS.hostWindow,
117
+ petSize: out.petSize === "compact" || out.petSize === "standard" || out.petSize === "detailed" ? out.petSize : DEFAULTS.petSize,
112
118
  cardOpacity: num("cardOpacity", 30, 100),
113
119
  autoScreenshot: bool("autoScreenshot"),
114
120
  autoScreenshotDetail: out.autoScreenshotDetail === "compact" || out.autoScreenshotDetail === "standard" ? out.autoScreenshotDetail : DEFAULTS.autoScreenshotDetail,
@@ -117,6 +123,7 @@ window.__ModuleLoader__.load({
117
123
  maxPixels: num("maxPixels", 3e5, 8e6),
118
124
  jpegQuality: num("jpegQuality", 30, 100),
119
125
  pauseOnUserInput: bool("pauseOnUserInput"),
126
+ reportUserActions: bool("reportUserActions"),
120
127
  userIdleMs: num("userIdleMs", 300, 1e4),
121
128
  quickSteps: bool("quickSteps"),
122
129
  nativeHelper: bool("nativeHelper"),
@@ -124,7 +131,8 @@ window.__ModuleLoader__.load({
124
131
  restorePointer: bool("restorePointer"),
125
132
  protectPasswords: bool("protectPasswords"),
126
133
  windowChangeGuard: bool("windowChangeGuard"),
127
- cdpPort: num("cdpPort", 0, 65535),
134
+ cdpEnabled,
135
+ cdpPort,
128
136
  typingMode: out.typingMode === "stream" || out.typingMode === "type" || out.typingMode === "paste" ? out.typingMode : DEFAULTS.typingMode,
129
137
  blockedApps: Array.isArray(out.blockedApps) ? out.blockedApps.filter((item) => typeof item === "string" && item.trim() !== "") : []
130
138
  };
@@ -517,13 +525,16 @@ window.__ModuleLoader__.load({
517
525
  const h$2 = react.createElement;
518
526
  /** Menu appearance and fixed-position behavior follow dsh-free-search / dsh-proxy. */
519
527
  const selectCss = `
520
- .dshcu-select{box-sizing:border-box;width:100%;height:36px;padding:0 12px;display:flex;align-items:center;gap:8px;text-align:left;border:1px solid var(--dsw-alias-border-l4,rgba(127,127,127,.3));border-radius:var(--dsw-radius-md,8px);background:var(--dsw-alias-bg-layer-3,transparent);color:inherit;font:inherit;font-size:13px;cursor:pointer}
521
- .dshcu-select:hover{border-color:var(--dsw-alias-border-l3,#888)}
522
- .dshcu-select:focus-visible,.dshcu-select[aria-expanded=true]{outline:2px solid var(--cl-accent,#D97757);outline-offset:2px}
523
- .dshcu-select:disabled{opacity:.5;cursor:default}
524
- .dshcu-menu{position:fixed;z-index:1100;box-sizing:border-box;padding:4px;overflow-y:auto;overscroll-behavior:contain;border-radius:var(--dsw-radius-lg,12px);background:var(--dsw-menu-surface-fill,var(--dsw-alias-bg-layer-1,#fff));color:var(--dsw-alias-label-primary,#222);backdrop-filter:var(--dsw-menu-backdrop-filter,none);box-shadow:var(--dsw-elevation-prominent,0 10px 32px rgba(0,0,0,.16),0 0 0 .5px rgba(0,0,0,.1))}
525
- .dshcu-option{display:flex;align-items:center;gap:8px;min-height:34px;padding:6px 8px;box-sizing:border-box;border-radius:var(--dsw-radius-md,8px);font-size:13px;line-height:20px;cursor:pointer;user-select:none}
526
- .dshcu-option[data-active=true]{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.12))}
528
+ @keyframes dshcu-menu-in{from{opacity:0;transform:translateY(-4px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
529
+ .dshcu-select{box-sizing:border-box;width:100%;height:36px;padding:0 12px;display:flex;align-items:center;gap:8px;text-align:left;border:1px solid var(--dsw-alias-border-l4,rgba(127,127,127,.28));border-radius:var(--dsw-radius-md,9px);background:var(--dsw-alias-bg-layer-3,transparent);color:inherit;font:inherit;font-size:13px;cursor:pointer;transition:border-color .16s ease,background-color .16s ease,box-shadow .16s ease}
530
+ .dshcu-select:hover:not(:disabled){border-color:color-mix(in srgb,var(--cl-accent,#D97757) 55%,var(--dsw-alias-border-l3,#888));background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.05))}
531
+ .dshcu-select:focus-visible,.dshcu-select[aria-expanded=true]{outline:none;border-color:var(--cl-accent,#D97757);box-shadow:0 0 0 3px color-mix(in srgb,var(--cl-accent,#D97757) 20%,transparent)}
532
+ .dshcu-select:disabled{opacity:.48;cursor:default}
533
+ .dshcu-select svg{flex:none;transition:transform .2s cubic-bezier(.22,1,.36,1)}
534
+ .dshcu-menu{position:fixed;z-index:1100;box-sizing:border-box;padding:5px;overflow-y:auto;overscroll-behavior:contain;border-radius:var(--dsw-radius-lg,12px);border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.18));background:var(--dsw-menu-surface-fill,var(--dsw-alias-bg-layer-1,#fff));color:var(--dsw-alias-label-primary,#222);backdrop-filter:var(--dsw-menu-backdrop-filter,none);box-shadow:var(--dsw-elevation-prominent,0 12px 32px rgba(0,0,0,.16),0 2px 6px rgba(0,0,0,.06));animation:dshcu-menu-in .14s cubic-bezier(.22,1,.36,1)}
535
+ .dshcu-option{display:flex;align-items:center;gap:8px;min-height:34px;padding:6px 10px;box-sizing:border-box;border-radius:var(--dsw-radius-md,8px);font-size:13px;line-height:20px;cursor:pointer;user-select:none;transition:background-color .12s ease,color .12s ease}
536
+ .dshcu-option[data-active=true]{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.11))}
537
+ .dshcu-option[aria-selected=true]{font-weight:500;color:var(--cl-accent,#D97757)}
527
538
  `;
528
539
  function Select({ options, value, disabled, label, onChange }) {
529
540
  const id = react.useId();
@@ -1050,10 +1061,12 @@ window.__ModuleLoader__.load({
1050
1061
  overlay: s.overlay,
1051
1062
  overlayLabel: s.overlayLabel,
1052
1063
  hostWindow: s.hostWindow,
1064
+ petSize: s.petSize,
1053
1065
  cardOpacity: s.cardOpacity,
1054
1066
  typingMode: s.typingMode,
1055
1067
  quickSteps: s.quickSteps,
1056
1068
  pauseOnUserInput: s.pauseOnUserInput,
1069
+ reportUserActions: s.reportUserActions,
1057
1070
  userIdleMs: String(s.userIdleMs),
1058
1071
  autoScreenshot: s.autoScreenshot,
1059
1072
  autoScreenshotDetail: s.autoScreenshotDetail,
@@ -1065,6 +1078,7 @@ window.__ModuleLoader__.load({
1065
1078
  restorePointer: s.restorePointer,
1066
1079
  protectPasswords: s.protectPasswords,
1067
1080
  windowChangeGuard: s.windowChangeGuard,
1081
+ cdpEnabled: s.cdpEnabled,
1068
1082
  cdpPort: String(s.cdpPort)
1069
1083
  };
1070
1084
  }
@@ -1092,10 +1106,12 @@ window.__ModuleLoader__.load({
1092
1106
  overlay: d.overlay,
1093
1107
  overlayLabel: d.overlayLabel.trim() || DEFAULTS.overlayLabel,
1094
1108
  hostWindow: d.hostWindow,
1109
+ petSize: d.petSize,
1095
1110
  cardOpacity: d.cardOpacity,
1096
1111
  typingMode: d.typingMode,
1097
1112
  quickSteps: d.quickSteps,
1098
1113
  pauseOnUserInput: d.pauseOnUserInput,
1114
+ reportUserActions: d.reportUserActions,
1099
1115
  userIdleMs: Math.round(Number(d.userIdleMs)),
1100
1116
  autoScreenshot: d.autoScreenshot,
1101
1117
  autoScreenshotDetail: d.autoScreenshotDetail,
@@ -1107,39 +1123,78 @@ window.__ModuleLoader__.load({
1107
1123
  restorePointer: d.restorePointer,
1108
1124
  protectPasswords: d.protectPasswords,
1109
1125
  windowChangeGuard: d.windowChangeGuard,
1126
+ cdpEnabled: d.cdpEnabled,
1110
1127
  cdpPort: Math.round(Number(d.cdpPort))
1111
1128
  };
1112
1129
  }
1130
+ const settingsCss = `
1131
+ @keyframes dshcu-fade-in{from{opacity:0;transform:translateY(3px)}to{opacity:1;transform:translateY(0)}}
1132
+ .dshcu-card{display:grid;gap:14px;padding:18px 20px;border-radius:var(--dsw-radius-lg,14px);border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.2));background:var(--dsw-alias-bg-layer-2,rgba(127,127,127,.025));transition:border-color .18s ease,box-shadow .18s ease}
1133
+ .dshcu-card:hover{border-color:var(--dsw-alias-border-l3,rgba(127,127,127,.3))}
1134
+ .dshcu-row{display:flex;gap:16px;align-items:center;justify-content:space-between;padding:8px 10px;margin:0 -10px;border-radius:10px;transition:background-color .14s ease}
1135
+ .dshcu-row:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.055))}
1136
+ .dshcu-divider{height:1px;background:var(--dsw-alias-border-l2,rgba(127,127,127,.14));margin:2px 0}
1137
+ .dshcu-switch{position:relative;flex:0 0 auto;width:42px;height:24px;border-radius:999px;border:none;padding:2px;cursor:pointer;background:var(--dsw-alias-border-l3,rgba(127,127,127,.35));transition:background-color .2s cubic-bezier(.22,1,.36,1),box-shadow .18s ease,opacity .15s}
1138
+ .dshcu-switch[aria-checked=true]{background:${ACCENT}}
1139
+ .dshcu-switch:hover:not(:disabled){box-shadow:0 0 0 3px color-mix(in srgb,${ACCENT} 16%,transparent)}
1140
+ .dshcu-switch:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,${ACCENT} 34%,transparent)}
1141
+ .dshcu-switch:disabled{opacity:.45;cursor:default}
1142
+ .dshcu-switch-thumb{display:block;width:20px;height:20px;border-radius:999px;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.22);transform:translateX(0);transition:transform .24s cubic-bezier(.34,1.56,.64,1),width .14s ease,margin-left .14s ease}
1143
+ .dshcu-switch[aria-checked=true] .dshcu-switch-thumb{background:${ACCENT_INK};transform:translateX(18px)}
1144
+ .dshcu-switch:active:not(:disabled) .dshcu-switch-thumb{width:24px}
1145
+ .dshcu-switch[aria-checked=true]:active:not(:disabled) .dshcu-switch-thumb{margin-left:-4px}
1146
+ .dshcu-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:7px 14px;font-size:13px;font-weight:500;border-radius:var(--dsw-radius-md,9px);border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.28));background:var(--dsw-alias-bg-layer-3,transparent);color:inherit;cursor:pointer;transition:background-color .15s ease,border-color .15s ease,transform .12s cubic-bezier(.22,1,.36,1),box-shadow .15s ease,opacity .15s}
1147
+ .dshcu-btn:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.09));border-color:color-mix(in srgb,${ACCENT} 45%,var(--dsw-alias-border-l3,rgba(127,127,127,.4)));transform:translateY(-0.5px)}
1148
+ .dshcu-btn:active:not(:disabled){transform:translateY(0) scale(.975)}
1149
+ .dshcu-btn:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,${ACCENT} 25%,transparent)}
1150
+ .dshcu-btn:disabled{opacity:.48;cursor:default}
1151
+ .dshcu-btn-primary{border-color:${ACCENT};background:${ACCENT};color:${ACCENT_INK}}
1152
+ .dshcu-btn-primary:hover:not(:disabled){background:color-mix(in srgb,${ACCENT} 88%,#fff);border-color:${ACCENT};box-shadow:0 3px 10px color-mix(in srgb,${ACCENT} 28%,transparent)}
1153
+ .dshcu-input{box-sizing:border-box;width:100%;padding:8px 11px;font-size:13px;border-radius:var(--dsw-radius-md,9px);border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.28));background:var(--dsw-alias-bg-layer-3,transparent);color:inherit;transition:border-color .16s ease,box-shadow .16s ease,background-color .16s ease}
1154
+ .dshcu-input:hover:not(:disabled){border-color:var(--dsw-alias-border-l3,rgba(127,127,127,.45))}
1155
+ .dshcu-input:focus{outline:none;border-color:${ACCENT};box-shadow:0 0 0 3px color-mix(in srgb,${ACCENT} 18%,transparent)}
1156
+ .dshcu-badge{display:inline-flex;align-items:center;gap:6px;padding:3px 9px;font-size:12px;font-weight:500;border-radius:999px;border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.22));background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.06));color:var(--dsw-alias-label-secondary,#666)}
1157
+ .dshcu-metric-bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:10px 12px;border-radius:10px;background:color-mix(in srgb,${ACCENT} 6%,transparent);border:1px solid color-mix(in srgb,${ACCENT} 18%,transparent);font-size:12px;line-height:1.5}
1158
+ .dshcu-toast{animation:dshcu-fade-in .18s ease}
1159
+ `;
1113
1160
  const S = {
1114
1161
  page: {
1115
1162
  display: "grid",
1116
- gap: 20,
1163
+ gap: 18,
1117
1164
  maxWidth: 880,
1118
- paddingBottom: 32,
1165
+ paddingBottom: 40,
1119
1166
  color: "var(--dsw-alias-label-primary, inherit)"
1120
1167
  },
1121
1168
  title: {
1122
1169
  margin: 0,
1123
- fontSize: 20,
1124
- fontWeight: 600
1170
+ fontSize: 21,
1171
+ fontWeight: 650,
1172
+ letterSpacing: "-0.01em"
1125
1173
  },
1126
1174
  subtitle: {
1127
1175
  margin: "6px 0 0",
1128
1176
  fontSize: 13,
1129
- lineHeight: 1.6,
1177
+ lineHeight: 1.65,
1130
1178
  color: "var(--dsw-alias-label-secondary, #666)"
1131
1179
  },
1132
1180
  card: {
1133
1181
  display: "grid",
1134
1182
  gap: 14,
1135
- padding: 16,
1136
- borderRadius: "var(--dsw-radius-lg, 12px)",
1137
- border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.25))"
1183
+ padding: "18px 20px",
1184
+ borderRadius: "var(--dsw-radius-lg, 14px)",
1185
+ border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.2))"
1186
+ },
1187
+ cardHeader: {
1188
+ display: "flex",
1189
+ alignItems: "center",
1190
+ justifyContent: "space-between",
1191
+ gap: 10
1138
1192
  },
1139
1193
  cardTitle: {
1140
1194
  margin: 0,
1141
1195
  fontSize: 15,
1142
- fontWeight: 600
1196
+ fontWeight: 600,
1197
+ letterSpacing: "-0.01em"
1143
1198
  },
1144
1199
  hint: {
1145
1200
  margin: 0,
@@ -1151,32 +1206,33 @@ window.__ModuleLoader__.load({
1151
1206
  display: "grid",
1152
1207
  gap: 6,
1153
1208
  fontSize: 13,
1154
- fontWeight: 500
1209
+ fontWeight: 500,
1210
+ alignContent: "start"
1155
1211
  },
1156
1212
  grid2: {
1157
1213
  display: "grid",
1158
- gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))",
1214
+ gridTemplateColumns: "repeat(auto-fit, minmax(240px, 1fr))",
1159
1215
  gap: 14
1160
1216
  },
1161
1217
  input: {
1162
1218
  boxSizing: "border-box",
1163
1219
  width: "100%",
1164
- padding: "8px 10px",
1220
+ padding: "8px 11px",
1165
1221
  fontSize: 13,
1166
- borderRadius: "var(--dsw-radius-md, 8px)",
1167
- border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.3))",
1222
+ borderRadius: "var(--dsw-radius-md, 9px)",
1223
+ border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.28))",
1168
1224
  background: "transparent",
1169
1225
  color: "inherit"
1170
1226
  },
1171
1227
  toggleRow: {
1172
1228
  display: "flex",
1173
- gap: 12,
1174
- alignItems: "flex-start",
1229
+ gap: 16,
1230
+ alignItems: "center",
1175
1231
  justifyContent: "space-between"
1176
1232
  },
1177
1233
  toggleText: {
1178
1234
  display: "grid",
1179
- gap: 4,
1235
+ gap: 3,
1180
1236
  fontSize: 13,
1181
1237
  fontWeight: 500
1182
1238
  },
@@ -1190,14 +1246,14 @@ window.__ModuleLoader__.load({
1190
1246
  },
1191
1247
  actions: {
1192
1248
  display: "flex",
1193
- gap: 10,
1249
+ gap: 8,
1194
1250
  alignItems: "center",
1195
1251
  flexWrap: "wrap"
1196
1252
  },
1197
1253
  primary: {
1198
1254
  padding: "7px 16px",
1199
1255
  fontSize: 13,
1200
- borderRadius: "var(--dsw-radius-md, 8px)",
1256
+ borderRadius: "var(--dsw-radius-md, 9px)",
1201
1257
  border: `1px solid ${ACCENT}`,
1202
1258
  background: ACCENT,
1203
1259
  color: ACCENT_INK,
@@ -1206,8 +1262,8 @@ window.__ModuleLoader__.load({
1206
1262
  secondary: {
1207
1263
  padding: "7px 14px",
1208
1264
  fontSize: 13,
1209
- borderRadius: "var(--dsw-radius-md, 8px)",
1210
- border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.3))",
1265
+ borderRadius: "var(--dsw-radius-md, 9px)",
1266
+ border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.28))",
1211
1267
  background: "transparent",
1212
1268
  color: "inherit",
1213
1269
  cursor: "pointer"
@@ -1216,7 +1272,9 @@ window.__ModuleLoader__.load({
1216
1272
  display: "flex",
1217
1273
  gap: 8,
1218
1274
  alignItems: "center",
1219
- fontSize: 13
1275
+ flexWrap: "wrap",
1276
+ fontSize: 13,
1277
+ fontWeight: 500
1220
1278
  },
1221
1279
  dot: {
1222
1280
  width: 8,
@@ -1229,34 +1287,15 @@ window.__ModuleLoader__.load({
1229
1287
  return h("button", {
1230
1288
  type: "button",
1231
1289
  role: "switch",
1290
+ className: "dshcu-switch",
1232
1291
  "aria-checked": checked,
1233
1292
  "aria-label": label,
1234
1293
  disabled,
1235
- onClick: () => onChange(!checked),
1236
- style: {
1237
- flex: "0 0 auto",
1238
- width: 40,
1239
- height: 22,
1240
- borderRadius: 11,
1241
- border: "none",
1242
- padding: 2,
1243
- cursor: disabled ? "default" : "pointer",
1244
- background: checked ? ACCENT : "var(--dsw-alias-border-l3, rgba(127,127,127,.35))",
1245
- opacity: disabled ? .5 : 1,
1246
- transition: "background .15s"
1247
- }
1248
- }, h("span", { style: {
1249
- display: "block",
1250
- width: 18,
1251
- height: 18,
1252
- borderRadius: 9,
1253
- background: checked ? ACCENT_INK : "#fff",
1254
- transform: checked ? "translateX(18px)" : "none",
1255
- transition: "transform .15s"
1256
- } }));
1294
+ onClick: () => onChange(!checked)
1295
+ }, h("span", { className: "dshcu-switch-thumb" }));
1257
1296
  }
1258
1297
  function ToggleRow({ title, hint, checked, disabled, onChange }) {
1259
- return h("div", { style: S.toggleRow }, h("div", { style: S.toggleText }, title, h("span", { style: {
1298
+ return h("div", { className: "dshcu-row" }, h("div", { style: S.toggleText }, title, h("span", { style: {
1260
1299
  ...S.hint,
1261
1300
  fontWeight: 400
1262
1301
  } }, hint)), h(Switch, {
@@ -1272,7 +1311,7 @@ window.__ModuleLoader__.load({
1272
1311
  gap: 8,
1273
1312
  alignItems: "center"
1274
1313
  } }, h("input", {
1275
- style: S.input,
1314
+ className: "dshcu-input",
1276
1315
  inputMode: "decimal",
1277
1316
  value,
1278
1317
  disabled,
@@ -1520,38 +1559,39 @@ window.__ModuleLoader__.load({
1520
1559
  maxPixels: Math.round(draftMaxPixels),
1521
1560
  jpegQuality: Number.isFinite(draftQuality) ? Math.round(draftQuality) : DEFAULTS.jpegQuality
1522
1561
  })) : primary?.compactShot;
1523
- return h("div", { style: S.page }, h("style", null, selectCss), h("div", null, h("h2", { style: S.title }, "电脑控制"), h("p", { style: S.subtitle }, "让 AI 看屏幕、点鼠标、敲键盘操控这台 Windows 电脑。操控时屏幕四周泛起橙色光晕;按 Esc 暂停 / 继续,点提示条上的“停止”结束本轮。")), view === void 0 ? h("div", { style: S.error }, "没有找到本插件的设置项(插件可能未启用)。") : null, view !== void 0 && !writable ? h("div", { style: S.error }, "当前设置为只读。") : null, h("section", { style: S.card }, h("h3", { style: S.cardTitle }, "运行状态"), h("div", { style: S.statusLine }, h("span", { style: {
1562
+ return h("div", { style: S.page }, h("style", null, selectCss + settingsCss), h("div", null, h("h2", { style: S.title }, "电脑控制"), h("p", { style: S.subtitle }, "让 AI 看屏幕、点鼠标、敲键盘操控这台 Windows 电脑。操控时屏幕四周泛起橙色光晕;按 Esc 暂停 / 继续,随时点击鼠标或打字接管。")), view === void 0 ? h("div", { style: S.error }, "没有找到本插件的设置项(插件可能未启用)。") : null, view !== void 0 && !writable ? h("div", { style: S.error }, "当前设置为只读。") : null, h("section", { className: "dshcu-card" }, h("div", { style: S.cardHeader }, h("div", { style: S.statusLine }, h("span", { style: {
1524
1563
  ...S.dot,
1525
- background: status === null ? "#999" : helperOk ? "#2a2" : "#d33"
1526
- } }), status === null ? "无法获取状态" : helperOk ? status.controlling ? "正在操控电脑" : "就绪" : `控制组件不可用:${status.error ?? ""}`, status?.version ? h("span", { style: {
1527
- ...S.hint,
1528
- marginLeft: 4
1529
- } }, `v${status.version}`) : null), primary ? h("p", { style: S.hint }, `主屏幕 ${primary.width}×${primary.height}(${Math.round(primary.dpi / 96 * 100)}% 缩放),发给模型的截图为 ${primary.shot.width}×${primary.shot.height}。`) : null, status && status.displays.length > 1 ? h("p", { style: S.hint }, `共 ${status.displays.length} 块显示器,模型可用 switch_display 切换。`) : null, updateInfo ? h("p", { style: updateInfo.error ? S.error : updateInfo.hasUpdate ? S.ok : S.hint }, updateInfo.error ? `检查更新失败:${updateInfo.error}` : updateInfo.hasUpdate ? `发现新版本 v${updateInfo.latest}(当前 v${updateInfo.current},来源 ${updateInfo.source}),可在「插件」页更新。` : `已是最新版本 v${updateInfo.current}(${updateInfo.source ?? "npm"})。`) : null, h("div", { style: S.actions }, h("button", {
1564
+ background: status === null ? "#999" : helperOk ? "#22c55e" : "#ef4444",
1565
+ boxShadow: helperOk ? "0 0 0 3px rgba(34,197,94,.2)" : void 0
1566
+ } }), status === null ? "无法获取状态" : helperOk ? status.controlling ? "正在操控电脑" : "控制引擎就绪" : `控制组件不可用:${status.error ?? ""}`, status?.version ? h("span", { className: "dshcu-badge" }, `v${status.version}`) : null, primary ? h("span", { className: "dshcu-badge" }, `${primary.width}×${primary.height} · ${Math.round(primary.dpi / 96 * 100)}%`) : null, status && status.displays.length > 1 ? h("span", { className: "dshcu-badge" }, `${status.displays.length} 块显示器`) : null)), updateInfo ? h("p", {
1567
+ className: "dshcu-toast",
1568
+ style: updateInfo.error ? S.error : updateInfo.hasUpdate ? S.ok : S.hint
1569
+ }, updateInfo.error ? `检查更新失败:${updateInfo.error}` : updateInfo.hasUpdate ? `发现新版本 v${updateInfo.latest}(当前 v${updateInfo.current},来源 ${updateInfo.source}),可在「插件」页更新。` : `已是最新版本 v${updateInfo.current}(${updateInfo.source ?? "npm"})。`) : null, h("div", { style: S.actions }, h("button", {
1530
1570
  type: "button",
1531
- style: S.secondary,
1571
+ className: "dshcu-btn dshcu-btn-primary",
1532
1572
  onClick: () => {
1533
1573
  preview();
1534
1574
  }
1535
- }, "预览效果"), h("button", {
1575
+ }, "预览浮层效果"), h("button", {
1536
1576
  type: "button",
1537
- style: S.secondary,
1577
+ className: "dshcu-btn",
1538
1578
  onClick: () => {
1539
1579
  refreshStatus();
1540
1580
  }
1541
1581
  }, "刷新状态"), h("button", {
1542
1582
  type: "button",
1543
- style: S.secondary,
1583
+ className: "dshcu-btn",
1544
1584
  disabled: updateBusy,
1545
1585
  onClick: () => {
1546
1586
  checkUpdate();
1547
1587
  }
1548
1588
  }, updateBusy ? "检查中…" : "检查更新"), h("button", {
1549
1589
  type: "button",
1550
- style: S.secondary,
1590
+ className: "dshcu-btn",
1551
1591
  onClick: () => {
1552
1592
  exportDiagnostics();
1553
1593
  }
1554
- }, "导出诊断报告"), h("span", { style: S.hint }, "预览 4 秒:按已保存的设置显示光晕与提示条/进度卡片;诊断报告已脱敏,不含输入文本与截图。"))), h("section", { style: S.card }, h("h3", { style: S.cardTitle }, "授权"), h("div", { style: S.label }, "会话启用方式", h(Select, {
1594
+ }, "导出诊断报告")), h("p", { style: S.hint }, "预览 4 秒:按已保存的设置显示光晕、进度卡片尺寸与按钮悬停效果;诊断报告已脱敏,不含输入文本与截图。")), h("section", { className: "dshcu-card" }, h("div", { style: S.cardHeader }, h("h3", { style: S.cardTitle }, "会话与安全护栏")), h("div", { style: S.grid2 }, h("div", { style: S.label }, "会话启用方式", h(Select, {
1555
1595
  label: "会话启用方式",
1556
1596
  disabled,
1557
1597
  value: draft.sessionMode,
@@ -1566,20 +1606,20 @@ window.__ModuleLoader__.load({
1566
1606
  },
1567
1607
  {
1568
1608
  value: "always",
1569
- label: "总是开启(所有会话启用,隐藏输入框开关)"
1609
+ label: "总是开启(隐藏输入框开关)"
1570
1610
  }
1571
1611
  ],
1572
1612
  onChange: (value) => edit("sessionMode", value)
1573
1613
  }), h("span", { style: {
1574
1614
  ...S.hint,
1575
1615
  fontWeight: 400
1576
- } }, draft.sessionMode === "always" ? "所有会话始终开启电脑控制,不再在输入框左下角显示「电脑控制」胶囊按钮,界面更简洁。" : draft.sessionMode === "on" ? "新会话默认开启电脑控制;仍会在输入框左下角显示「电脑控制」胶囊,可针对单个会话关闭或用 /cu 切换。" : "普通对话默认不加载桌面工具与系统提示;需要在输入框左下角点击「电脑控制」胶囊或输入 /cu on 为当前会话按需开启,子代理自动继承。")), h("div", { style: S.label }, "授权方式", h(Select, {
1616
+ } }, draft.sessionMode === "always" ? "所有会话始终开启,隐藏输入框左下角「电脑控制」胶囊按钮。" : draft.sessionMode === "on" ? "新会话默认开启,保留输入框胶囊并支持 /cu 随时关闭。" : "普通对话不加载桌面工具;通过输入框胶囊或 /cu on 按需开启。")), h("div", { style: S.label }, "授权方式", h(Select, {
1577
1617
  label: "授权方式",
1578
1618
  disabled,
1579
1619
  value: draft.accessMode,
1580
1620
  options: [{
1581
1621
  value: "per-app",
1582
- label: "按应用授权(每个会话由你批准要操控的应用)"
1622
+ label: "按应用授权(每会话批准)"
1583
1623
  }, {
1584
1624
  value: "allow-all",
1585
1625
  label: "全部允许(不弹审批)"
@@ -1588,10 +1628,22 @@ window.__ModuleLoader__.load({
1588
1628
  }), h("span", { style: {
1589
1629
  ...S.hint,
1590
1630
  fontWeight: 400
1591
- } }, "会话权限为“完全权限”或“自动审查”时不弹审批,按应用授权会自动批准。无论哪种方式,DeepSeek Harness 自己的窗口都不会被操作。")), h("label", { style: S.label }, "禁止操控的应用", h("textarea", {
1631
+ } }, "完全权限或自动审查模式自动批准;DSH 自身窗口永远受保护。"))), h("div", { className: "dshcu-divider" }), h(ToggleRow, {
1632
+ title: "密码框硬保护",
1633
+ hint: "检测 UIA IsPassword 与 Win32 ES_PASSWORD 结构位:脱敏内容为 [password],拒绝自动输入密码。",
1634
+ checked: draft.protectPasswords,
1635
+ disabled,
1636
+ onChange: (value) => edit("protectPasswords", value)
1637
+ }), h(ToggleRow, {
1638
+ title: "窗口位移 / 遮挡防误点",
1639
+ hint: "坐标点击前核对前台窗口自上次截图后是否移动/缩放或被新弹窗遮挡,发生变化时阻止盲点。",
1640
+ checked: draft.windowChangeGuard,
1641
+ disabled,
1642
+ onChange: (value) => edit("windowChangeGuard", value)
1643
+ }), h("div", { className: "dshcu-divider" }), h("label", { style: S.label }, "禁止操控的应用", h("textarea", {
1644
+ className: "dshcu-input",
1592
1645
  style: {
1593
- ...S.input,
1594
- minHeight: 72,
1646
+ minHeight: 68,
1595
1647
  resize: "vertical"
1596
1648
  },
1597
1649
  value: draft.blockedApps,
@@ -1602,26 +1654,14 @@ window.__ModuleLoader__.load({
1602
1654
  }), h("span", { style: {
1603
1655
  ...S.hint,
1604
1656
  fontWeight: 400
1605
- } }, "1Password、Bitwarden、KeePass 等常见密码管理器始终禁止。")), h(ToggleRow, {
1606
- title: "密码框硬保护",
1607
- hint: "检测 UIA IsPassword 与 Win32 ES_PASSWORD 结构位:自动脱敏密码框内容为 [password],并拒绝向密码框自动输入文本。",
1608
- checked: draft.protectPasswords,
1609
- disabled,
1610
- onChange: (value) => edit("protectPasswords", value)
1611
- }), h(ToggleRow, {
1612
- title: "窗口位移 / 遮挡防误点",
1613
- hint: "坐标点击前核对前台窗口自上次截图后是否移动/缩放或被新弹窗遮挡,发生变化时阻止盲点并提示模型先重看屏幕。",
1614
- checked: draft.windowChangeGuard,
1615
- disabled,
1616
- onChange: (value) => edit("windowChangeGuard", value)
1617
- })), h("section", { style: S.card }, h("h3", { style: S.cardTitle }, "操控时的显示"), h(ToggleRow, {
1618
- title: "橙色光晕与提示条",
1619
- hint: "不会出现在模型看到的截图里。",
1657
+ } }, "1Password、Bitwarden、KeePass 等密码管理器始终内置禁止;命令解释器无法通过 open_application 启动。"))), h("section", { className: "dshcu-card" }, h("div", { style: S.cardHeader }, h("h3", { style: S.cardTitle }, "操控外观与进度卡片")), h(ToggleRow, {
1658
+ title: "橙色光晕与协作光标",
1659
+ hint: "屏幕边缘光晕与 Codex 风格滑行光标;点击落点后短暂可进截图供模型核对。",
1620
1660
  checked: draft.overlay,
1621
1661
  disabled,
1622
1662
  onChange: (value) => edit("overlay", value)
1623
1663
  }), h("div", { style: S.grid2 }, h("label", { style: S.label }, "提示条名称", h("input", {
1624
- style: S.input,
1664
+ className: "dshcu-input",
1625
1665
  value: draft.overlayLabel,
1626
1666
  disabled,
1627
1667
  maxLength: 40,
@@ -1629,7 +1669,7 @@ window.__ModuleLoader__.load({
1629
1669
  }), h("span", { style: {
1630
1670
  ...S.hint,
1631
1671
  fontWeight: 400
1632
- } }, `显示为“${draft.overlayLabel.trim() || DEFAULTS.overlayLabel} 正在操控你的电脑”`)), h("div", { style: S.label }, "DeepSeek Harness 窗口", h(Select, {
1672
+ } }, `显示为“${draft.overlayLabel.trim() || DEFAULTS.overlayLabel} 正在操控”`)), h("div", { style: S.label }, "DeepSeek Harness 窗口", h(Select, {
1633
1673
  label: "DeepSeek Harness 窗口",
1634
1674
  disabled,
1635
1675
  value: draft.hostWindow,
@@ -1655,7 +1695,29 @@ window.__ModuleLoader__.load({
1655
1695
  }), h("span", { style: {
1656
1696
  ...S.hint,
1657
1697
  fontWeight: 400
1658
- } }, draft.hostWindow === "pet" ? "卡片上方显示思考,下方显示操作。可拖动、暂停或停止。正文开始输出时,回到 DSH 对话。" : "操控结束或正文开始输出时,恢复 DSH 窗口。")), h("div", { style: S.label }, "悬浮卡片透明度", h(Select, {
1698
+ } }, draft.hostWindow === "pet" ? "支持拖动、按钮悬停提示、暂停/停止与输入新指令;正文输出时自动切回对话。" : "操控结束或正文开始输出时,恢复 DSH 窗口。")), h("div", { style: S.label }, "迷你进度卡片尺寸", h(Select, {
1699
+ label: "迷你进度卡片尺寸",
1700
+ disabled: disabled || draft.hostWindow !== "pet",
1701
+ value: draft.petSize,
1702
+ options: [
1703
+ {
1704
+ value: "compact",
1705
+ label: "紧凑小卡片(最省视野 · 单行动作)"
1706
+ },
1707
+ {
1708
+ value: "standard",
1709
+ label: "标准卡片(单行思考 + 操作进度,推荐)"
1710
+ },
1711
+ {
1712
+ value: "detailed",
1713
+ label: "详情大卡片(双行思考 + 3 步时间线)"
1714
+ }
1715
+ ],
1716
+ onChange: (value) => edit("petSize", value)
1717
+ }), h("span", { style: {
1718
+ ...S.hint,
1719
+ fontWeight: 400
1720
+ } }, draft.petSize === "compact" ? "约 320px 宽,只展示当前动作与控制按钮;点展开可临时看详情。" : draft.petSize === "detailed" ? "约 484px 宽,默认展示双行思考与最近 3 步时间线(展开可达 8 步)。" : "约 420px 宽,平衡视野与信息量,展开可查看多行思考与 5 步时间线。")), h("div", { style: S.label }, "悬浮卡片透明度", h(Select, {
1659
1721
  label: "悬浮卡片透明度",
1660
1722
  disabled: disabled || draft.hostWindow !== "card" && draft.hostWindow !== "pet",
1661
1723
  value: String(draft.cardOpacity),
@@ -1689,7 +1751,7 @@ window.__ModuleLoader__.load({
1689
1751
  }), h("span", { style: {
1690
1752
  ...S.hint,
1691
1753
  fontWeight: 400
1692
- } }, "半透明卡片可以透过它看清下面的操作过程;鼠标停在卡片上会变回不透明,方便阅读和点击。AI 的截图本来就看不到卡片。")), h("div", { style: S.label }, "文字输入方式", h(Select, {
1754
+ } }, "鼠标停在卡片上会自动变不透明,方便阅读和点击;AI 截图永远看不到卡片。")), h("div", { style: S.label }, "文字输入方式", h(Select, {
1693
1755
  label: "文字输入方式",
1694
1756
  disabled,
1695
1757
  value: draft.typingMode,
@@ -1711,18 +1773,18 @@ window.__ModuleLoader__.load({
1711
1773
  }), h("span", { style: {
1712
1774
  ...S.hint,
1713
1775
  fontWeight: 400
1714
- } }, "短文字都会逐字打出来。长文本逐字输入在 Typora、Obsidian、Word 等编辑器里可能被自动补全括号、自动续列表打乱;流式按段落粘贴,既看得到过程又不会乱。")))), h("section", { style: S.card }, h("h3", { style: S.cardTitle }, "速度"), h(ToggleRow, {
1715
- title: "操作时不深度思考(Beta)",
1716
- hint: "试验功能,一般不用开。开始操作电脑后,本轮改用模型的最低思考强度,每一步快约 1 秒;任务开头的规划和之后的对话仍按会话里选的思考强度。代价:不思考时模型更容易出错、多走几步,本轮的回复文字会整段出现而不是逐字流出。目前只在 DeepSeek 官方模型上有效。",
1717
- checked: draft.quickSteps,
1718
- disabled,
1719
- onChange: (value) => edit("quickSteps", value)
1720
- })), h("section", { style: S.card }, h("h3", { style: S.cardTitle }, "让出控制"), h(ToggleRow, {
1776
+ } }, "短文字逐字打出;长文本流式按段落粘贴,防止编辑器自动补全打乱排版。")))), h("section", { className: "dshcu-card" }, h("div", { style: S.cardHeader }, h("h3", { style: S.cardTitle }, "交互接管与操控体验")), h(ToggleRow, {
1721
1777
  title: "检测到你在操作时暂停",
1722
- hint: "你用键盘打字时 AI 等你停手;你切换了窗口时 AI 先重新看屏幕。鼠标移动不会触发。",
1778
+ hint: "你打字、点击鼠标或滚动滚轮时 AI 等你停手;你切换了窗口时 AI 先重新看屏幕。纯鼠标移动不会误触。",
1723
1779
  checked: draft.pauseOnUserInput,
1724
1780
  disabled,
1725
1781
  onChange: (value) => edit("pauseOnUserInput", value)
1782
+ }), h(ToggleRow, {
1783
+ title: "向 AI 反馈我的接管操作",
1784
+ hint: "将你接管时点击的控件名称、坐标与窗口(脱敏,绝不记录输入明文与密码)告诉 AI,让它理解你的意图而不是覆盖你的操作。",
1785
+ checked: draft.reportUserActions,
1786
+ disabled: disabled || !draft.pauseOnUserInput,
1787
+ onChange: (value) => edit("reportUserActions", value)
1726
1788
  }), h(ToggleRow, {
1727
1789
  title: "坐标点击优先后台控件触发",
1728
1790
  hint: "坐标左键点击命中原生按钮、复选框或标签页时,优先走后台 UIA 语义触发,不移动真实鼠标也不抢焦点。",
@@ -1735,7 +1797,19 @@ window.__ModuleLoader__.load({
1735
1797
  checked: draft.restorePointer,
1736
1798
  disabled,
1737
1799
  onChange: (value) => edit("restorePointer", value)
1738
- }), h("div", { style: S.grid2 }, h(NumberField, {
1800
+ }), h(ToggleRow, {
1801
+ title: "操作时不深度思考(Beta)",
1802
+ hint: "试验功能:开始操作电脑后降低本轮思考强度(每步快约 1 秒),目前仅在 DeepSeek 官方模型生效。",
1803
+ checked: draft.quickSteps,
1804
+ disabled,
1805
+ onChange: (value) => edit("quickSteps", value)
1806
+ }), h(ToggleRow, {
1807
+ title: "启用本机 Chromium CDP 快车道",
1808
+ hint: "仅在主动开启或填写非 0 端口时连接 127.0.0.1 浏览器调试端口;严格按当前窗口标签匹配,失败自动回退 UIA/OCR,绝不误读其他标签页。",
1809
+ checked: draft.cdpEnabled,
1810
+ disabled,
1811
+ onChange: (value) => edit("cdpEnabled", value)
1812
+ }), h("div", { className: "dshcu-divider" }), h("div", { style: S.grid2 }, h(NumberField, {
1739
1813
  label: "停手多久后继续",
1740
1814
  unit: "毫秒",
1741
1815
  value: draft.userIdleMs,
@@ -1743,13 +1817,13 @@ window.__ModuleLoader__.load({
1743
1817
  disabled: disabled || !draft.pauseOnUserInput,
1744
1818
  onChange: (value) => edit("userIdleMs", value)
1745
1819
  }), h(NumberField, {
1746
- label: "可选 Chromium CDP 端口(0=自动探测 9222/9229)",
1820
+ label: "Chromium CDP 端口(0=默认 9222)",
1747
1821
  unit: "端口",
1748
1822
  value: draft.cdpPort,
1749
1823
  error: errors.cdpPort,
1750
- disabled,
1824
+ disabled: disabled || !draft.cdpEnabled,
1751
1825
  onChange: (value) => edit("cdpPort", value)
1752
- }))), h("section", { style: S.card }, h("h3", { style: S.cardTitle }, "截图"), h(ToggleRow, {
1826
+ }))), h("section", { className: "dshcu-card" }, h("div", { style: S.cardHeader }, h("h3", { style: S.cardTitle }, "截图与清晰度")), h(ToggleRow, {
1753
1827
  title: "操作后自动回传截图",
1754
1828
  hint: "省去模型再截一次图的一轮调用;关闭可省 token。画面未变化时自动跳过重复图片。",
1755
1829
  checked: draft.autoScreenshot,
@@ -1771,7 +1845,7 @@ window.__ModuleLoader__.load({
1771
1845
  ...S.hint,
1772
1846
  fontWeight: 400
1773
1847
  } }, "紧凑档只降低操作后的自动确认截图;模型显式调用 screenshot / zoom 时仍保持标准清晰度。")), h("div", { style: S.grid2 }, h(NumberField, {
1774
- label: "操作后至少等待(之后画面静止即截图,最多约 2.5 秒)",
1848
+ label: "操作后至少等待(画面静止即截图)",
1775
1849
  unit: "毫秒",
1776
1850
  value: draft.settleMs,
1777
1851
  error: errors.settleMs,
@@ -1798,26 +1872,26 @@ window.__ModuleLoader__.load({
1798
1872
  error: errors.jpegQuality,
1799
1873
  disabled,
1800
1874
  onChange: (value) => edit("jpegQuality", value)
1801
- })), liveShot ? h("p", { style: S.hint }, `当前主屏实际输出:${liveShot.width}×${liveShot.height}(${liveShot.megapixels} MP,${limitLabel(liveShot.limitedBy)})${liveCompactShot ? `;紧凑档:${liveCompactShot.width}×${liveCompactShot.height}(${liveCompactShot.megapixels} MP)` : ""}。最长边与总像素上限同时生效,取更紧的一项。`) : h("p", { style: S.hint }, "截图越大越清晰、点得越准,但每张图消耗的 token 也越多。最长边与总像素上限同时生效,取更紧的一项;默认值(最长边 1366、1.15 百万像素)适合大多数模型。")), h(SkillsCard, { S }), h("section", { style: S.card }, h("h3", { style: S.cardTitle }, "截图缓存"), h("p", { style: S.hint }, cache === null ? cacheBusy ? "正在统计…" : "无法统计截图缓存。" : !cache.ok ? `统计失败:${cache.error ?? ""}` : `本插件的截图共 ${cache.count} 张,占用 ${mb(cache.bytes)};其中 ${cache.orphans} 张(${mb(cache.orphanBytes)})所属会话已删除,可以安全清理。`), h("p", { style: S.hint }, "截图作为附件保存在会话历史里。仍在会话中的截图不会被删除:删除后继续那个会话会直接报错。删除会话后,它留下的截图会在启动 DeepSeek Harness 几分钟后及之后每 12 小时自动清理,也可以在这里立即清理。"), h("div", { style: S.actions }, h("button", {
1875
+ })), liveShot ? h("div", { className: "dshcu-metric-bar" }, h("strong", null, `主屏实际输出 ${liveShot.width}×${liveShot.height}`), h("span", { style: S.hint }, `${liveShot.megapixels} MP · ${limitLabel(liveShot.limitedBy)}${liveCompactShot ? ` | 紧凑档 ${liveCompactShot.width}×${liveCompactShot.height}(${liveCompactShot.megapixels} MP)` : ""}`)) : h("p", { style: S.hint }, "截图越大越清晰、点得越准,但每张图消耗的 token 也越多。最长边与总像素上限同时生效,取更紧的一项。")), h(SkillsCard, { S }), h("section", { className: "dshcu-card" }, h("div", { style: S.cardHeader }, h("h3", { style: S.cardTitle }, "截图缓存")), h("p", { style: S.hint }, cache === null ? cacheBusy ? "正在统计…" : "无法统计截图缓存。" : !cache.ok ? `统计失败:${cache.error ?? ""}` : `本插件的截图共 ${cache.count} 张,占用 ${mb(cache.bytes)};其中 ${cache.orphans} 张(${mb(cache.orphanBytes)})所属会话已删除,可以安全清理。`), h("p", { style: S.hint }, "仍在会话中的截图不会被删除。已删除会话留下的截图会在启动几分钟后及每 12 小时自动清理,也可以在此立即清理。"), h("div", { style: S.actions }, h("button", {
1802
1876
  type: "button",
1803
- style: {
1804
- ...S.secondary,
1805
- opacity: cacheBusy || !cache?.orphans ? .5 : 1
1806
- },
1877
+ className: "dshcu-btn",
1807
1878
  disabled: cacheBusy || !cache?.orphans,
1808
1879
  onClick: () => {
1809
1880
  cleanCache();
1810
1881
  }
1811
1882
  }, "清理已删除会话的截图"), h("button", {
1812
1883
  type: "button",
1813
- style: S.secondary,
1884
+ className: "dshcu-btn",
1814
1885
  disabled: cacheBusy,
1815
1886
  onClick: () => {
1816
1887
  refreshCache();
1817
1888
  }
1818
- }, cacheBusy ? "统计中…" : "重新统计"), cacheNote === null ? null : h("span", { style: cacheNote.kind === "ok" ? S.ok : S.error }, cacheNote.text))), h("div", { style: S.actions }, h("button", {
1889
+ }, cacheBusy ? "统计中…" : "重新统计"), cacheNote === null ? null : h("span", {
1890
+ className: "dshcu-toast",
1891
+ style: cacheNote.kind === "ok" ? S.ok : S.error
1892
+ }, cacheNote.text))), h("div", { style: S.actions }, h("button", {
1819
1893
  type: "button",
1820
- style: S.secondary,
1894
+ className: "dshcu-btn",
1821
1895
  disabled,
1822
1896
  onClick: () => {
1823
1897
  setDraft(draftFrom({}));
@@ -1826,11 +1900,14 @@ window.__ModuleLoader__.load({
1826
1900
  }
1827
1901
  }, "恢复默认"), saving ? h("span", { style: S.hint }, "保存中…") : dirty && invalid ? h("span", { style: S.error }, "有数值超出范围,改好后自动保存") : failed === draft && dirty ? h("button", {
1828
1902
  type: "button",
1829
- style: S.secondary,
1903
+ className: "dshcu-btn",
1830
1904
  onClick: () => {
1831
1905
  setFailed(null);
1832
1906
  }
1833
- }, "重试保存") : null, message === null || dirty && invalid ? null : h("span", { style: message.kind === "ok" ? S.ok : S.error }, message.text)), h(AccentPicker, null));
1907
+ }, "重试保存") : null, message === null || dirty && invalid ? null : h("span", {
1908
+ className: "dshcu-toast",
1909
+ style: message.kind === "ok" ? S.ok : S.error
1910
+ }, message.text)), h(AccentPicker, null));
1834
1911
  }
1835
1912
  const inject = [
1836
1913
  "slots",