@copylee/dsh-computer-use 0.11.0 → 0.12.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,
@@ -109,6 +111,7 @@ window.__ModuleLoader__.load({
109
111
  overlay: bool("overlay"),
110
112
  overlayLabel: typeof out.overlayLabel === "string" && out.overlayLabel.trim() !== "" ? out.overlayLabel.trim().slice(0, 40) : DEFAULTS.overlayLabel,
111
113
  hostWindow: out.hostWindow === "pet" || out.hostWindow === "card" || out.hostWindow === "minimize" || out.hostWindow === "keep" ? out.hostWindow : out.minimizeHostWindow === true ? "minimize" : DEFAULTS.hostWindow,
114
+ petSize: out.petSize === "compact" || out.petSize === "standard" || out.petSize === "detailed" ? out.petSize : DEFAULTS.petSize,
112
115
  cardOpacity: num("cardOpacity", 30, 100),
113
116
  autoScreenshot: bool("autoScreenshot"),
114
117
  autoScreenshotDetail: out.autoScreenshotDetail === "compact" || out.autoScreenshotDetail === "standard" ? out.autoScreenshotDetail : DEFAULTS.autoScreenshotDetail,
@@ -117,6 +120,7 @@ window.__ModuleLoader__.load({
117
120
  maxPixels: num("maxPixels", 3e5, 8e6),
118
121
  jpegQuality: num("jpegQuality", 30, 100),
119
122
  pauseOnUserInput: bool("pauseOnUserInput"),
123
+ reportUserActions: bool("reportUserActions"),
120
124
  userIdleMs: num("userIdleMs", 300, 1e4),
121
125
  quickSteps: bool("quickSteps"),
122
126
  nativeHelper: bool("nativeHelper"),
@@ -517,13 +521,16 @@ window.__ModuleLoader__.load({
517
521
  const h$2 = react.createElement;
518
522
  /** Menu appearance and fixed-position behavior follow dsh-free-search / dsh-proxy. */
519
523
  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))}
524
+ @keyframes dshcu-menu-in{from{opacity:0;transform:translateY(-4px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
525
+ .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}
526
+ .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))}
527
+ .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)}
528
+ .dshcu-select:disabled{opacity:.48;cursor:default}
529
+ .dshcu-select svg{flex:none;transition:transform .2s cubic-bezier(.22,1,.36,1)}
530
+ .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)}
531
+ .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}
532
+ .dshcu-option[data-active=true]{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.11))}
533
+ .dshcu-option[aria-selected=true]{font-weight:500;color:var(--cl-accent,#D97757)}
527
534
  `;
528
535
  function Select({ options, value, disabled, label, onChange }) {
529
536
  const id = react.useId();
@@ -1050,10 +1057,12 @@ window.__ModuleLoader__.load({
1050
1057
  overlay: s.overlay,
1051
1058
  overlayLabel: s.overlayLabel,
1052
1059
  hostWindow: s.hostWindow,
1060
+ petSize: s.petSize,
1053
1061
  cardOpacity: s.cardOpacity,
1054
1062
  typingMode: s.typingMode,
1055
1063
  quickSteps: s.quickSteps,
1056
1064
  pauseOnUserInput: s.pauseOnUserInput,
1065
+ reportUserActions: s.reportUserActions,
1057
1066
  userIdleMs: String(s.userIdleMs),
1058
1067
  autoScreenshot: s.autoScreenshot,
1059
1068
  autoScreenshotDetail: s.autoScreenshotDetail,
@@ -1092,10 +1101,12 @@ window.__ModuleLoader__.load({
1092
1101
  overlay: d.overlay,
1093
1102
  overlayLabel: d.overlayLabel.trim() || DEFAULTS.overlayLabel,
1094
1103
  hostWindow: d.hostWindow,
1104
+ petSize: d.petSize,
1095
1105
  cardOpacity: d.cardOpacity,
1096
1106
  typingMode: d.typingMode,
1097
1107
  quickSteps: d.quickSteps,
1098
1108
  pauseOnUserInput: d.pauseOnUserInput,
1109
+ reportUserActions: d.reportUserActions,
1099
1110
  userIdleMs: Math.round(Number(d.userIdleMs)),
1100
1111
  autoScreenshot: d.autoScreenshot,
1101
1112
  autoScreenshotDetail: d.autoScreenshotDetail,
@@ -1110,36 +1121,74 @@ window.__ModuleLoader__.load({
1110
1121
  cdpPort: Math.round(Number(d.cdpPort))
1111
1122
  };
1112
1123
  }
1124
+ const settingsCss = `
1125
+ @keyframes dshcu-fade-in{from{opacity:0;transform:translateY(3px)}to{opacity:1;transform:translateY(0)}}
1126
+ .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}
1127
+ .dshcu-card:hover{border-color:var(--dsw-alias-border-l3,rgba(127,127,127,.3))}
1128
+ .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}
1129
+ .dshcu-row:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.055))}
1130
+ .dshcu-divider{height:1px;background:var(--dsw-alias-border-l2,rgba(127,127,127,.14));margin:2px 0}
1131
+ .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}
1132
+ .dshcu-switch[aria-checked=true]{background:${ACCENT}}
1133
+ .dshcu-switch:hover:not(:disabled){box-shadow:0 0 0 3px color-mix(in srgb,${ACCENT} 16%,transparent)}
1134
+ .dshcu-switch:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,${ACCENT} 34%,transparent)}
1135
+ .dshcu-switch:disabled{opacity:.45;cursor:default}
1136
+ .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}
1137
+ .dshcu-switch[aria-checked=true] .dshcu-switch-thumb{background:${ACCENT_INK};transform:translateX(18px)}
1138
+ .dshcu-switch:active:not(:disabled) .dshcu-switch-thumb{width:24px}
1139
+ .dshcu-switch[aria-checked=true]:active:not(:disabled) .dshcu-switch-thumb{margin-left:-4px}
1140
+ .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}
1141
+ .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)}
1142
+ .dshcu-btn:active:not(:disabled){transform:translateY(0) scale(.975)}
1143
+ .dshcu-btn:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,${ACCENT} 25%,transparent)}
1144
+ .dshcu-btn:disabled{opacity:.48;cursor:default}
1145
+ .dshcu-btn-primary{border-color:${ACCENT};background:${ACCENT};color:${ACCENT_INK}}
1146
+ .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)}
1147
+ .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}
1148
+ .dshcu-input:hover:not(:disabled){border-color:var(--dsw-alias-border-l3,rgba(127,127,127,.45))}
1149
+ .dshcu-input:focus{outline:none;border-color:${ACCENT};box-shadow:0 0 0 3px color-mix(in srgb,${ACCENT} 18%,transparent)}
1150
+ .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)}
1151
+ .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}
1152
+ .dshcu-toast{animation:dshcu-fade-in .18s ease}
1153
+ `;
1113
1154
  const S = {
1114
1155
  page: {
1115
1156
  display: "grid",
1116
- gap: 20,
1157
+ gap: 18,
1117
1158
  maxWidth: 880,
1118
- paddingBottom: 32,
1159
+ paddingBottom: 40,
1119
1160
  color: "var(--dsw-alias-label-primary, inherit)"
1120
1161
  },
1121
1162
  title: {
1122
1163
  margin: 0,
1123
- fontSize: 20,
1124
- fontWeight: 600
1164
+ fontSize: 21,
1165
+ fontWeight: 650,
1166
+ letterSpacing: "-0.01em"
1125
1167
  },
1126
1168
  subtitle: {
1127
1169
  margin: "6px 0 0",
1128
1170
  fontSize: 13,
1129
- lineHeight: 1.6,
1171
+ lineHeight: 1.65,
1130
1172
  color: "var(--dsw-alias-label-secondary, #666)"
1131
1173
  },
1132
1174
  card: {
1133
1175
  display: "grid",
1134
1176
  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))"
1177
+ padding: "18px 20px",
1178
+ borderRadius: "var(--dsw-radius-lg, 14px)",
1179
+ border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.2))"
1180
+ },
1181
+ cardHeader: {
1182
+ display: "flex",
1183
+ alignItems: "center",
1184
+ justifyContent: "space-between",
1185
+ gap: 10
1138
1186
  },
1139
1187
  cardTitle: {
1140
1188
  margin: 0,
1141
1189
  fontSize: 15,
1142
- fontWeight: 600
1190
+ fontWeight: 600,
1191
+ letterSpacing: "-0.01em"
1143
1192
  },
1144
1193
  hint: {
1145
1194
  margin: 0,
@@ -1151,32 +1200,33 @@ window.__ModuleLoader__.load({
1151
1200
  display: "grid",
1152
1201
  gap: 6,
1153
1202
  fontSize: 13,
1154
- fontWeight: 500
1203
+ fontWeight: 500,
1204
+ alignContent: "start"
1155
1205
  },
1156
1206
  grid2: {
1157
1207
  display: "grid",
1158
- gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))",
1208
+ gridTemplateColumns: "repeat(auto-fit, minmax(240px, 1fr))",
1159
1209
  gap: 14
1160
1210
  },
1161
1211
  input: {
1162
1212
  boxSizing: "border-box",
1163
1213
  width: "100%",
1164
- padding: "8px 10px",
1214
+ padding: "8px 11px",
1165
1215
  fontSize: 13,
1166
- borderRadius: "var(--dsw-radius-md, 8px)",
1167
- border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.3))",
1216
+ borderRadius: "var(--dsw-radius-md, 9px)",
1217
+ border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.28))",
1168
1218
  background: "transparent",
1169
1219
  color: "inherit"
1170
1220
  },
1171
1221
  toggleRow: {
1172
1222
  display: "flex",
1173
- gap: 12,
1174
- alignItems: "flex-start",
1223
+ gap: 16,
1224
+ alignItems: "center",
1175
1225
  justifyContent: "space-between"
1176
1226
  },
1177
1227
  toggleText: {
1178
1228
  display: "grid",
1179
- gap: 4,
1229
+ gap: 3,
1180
1230
  fontSize: 13,
1181
1231
  fontWeight: 500
1182
1232
  },
@@ -1190,14 +1240,14 @@ window.__ModuleLoader__.load({
1190
1240
  },
1191
1241
  actions: {
1192
1242
  display: "flex",
1193
- gap: 10,
1243
+ gap: 8,
1194
1244
  alignItems: "center",
1195
1245
  flexWrap: "wrap"
1196
1246
  },
1197
1247
  primary: {
1198
1248
  padding: "7px 16px",
1199
1249
  fontSize: 13,
1200
- borderRadius: "var(--dsw-radius-md, 8px)",
1250
+ borderRadius: "var(--dsw-radius-md, 9px)",
1201
1251
  border: `1px solid ${ACCENT}`,
1202
1252
  background: ACCENT,
1203
1253
  color: ACCENT_INK,
@@ -1206,8 +1256,8 @@ window.__ModuleLoader__.load({
1206
1256
  secondary: {
1207
1257
  padding: "7px 14px",
1208
1258
  fontSize: 13,
1209
- borderRadius: "var(--dsw-radius-md, 8px)",
1210
- border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.3))",
1259
+ borderRadius: "var(--dsw-radius-md, 9px)",
1260
+ border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.28))",
1211
1261
  background: "transparent",
1212
1262
  color: "inherit",
1213
1263
  cursor: "pointer"
@@ -1216,7 +1266,9 @@ window.__ModuleLoader__.load({
1216
1266
  display: "flex",
1217
1267
  gap: 8,
1218
1268
  alignItems: "center",
1219
- fontSize: 13
1269
+ flexWrap: "wrap",
1270
+ fontSize: 13,
1271
+ fontWeight: 500
1220
1272
  },
1221
1273
  dot: {
1222
1274
  width: 8,
@@ -1229,34 +1281,15 @@ window.__ModuleLoader__.load({
1229
1281
  return h("button", {
1230
1282
  type: "button",
1231
1283
  role: "switch",
1284
+ className: "dshcu-switch",
1232
1285
  "aria-checked": checked,
1233
1286
  "aria-label": label,
1234
1287
  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
- } }));
1288
+ onClick: () => onChange(!checked)
1289
+ }, h("span", { className: "dshcu-switch-thumb" }));
1257
1290
  }
1258
1291
  function ToggleRow({ title, hint, checked, disabled, onChange }) {
1259
- return h("div", { style: S.toggleRow }, h("div", { style: S.toggleText }, title, h("span", { style: {
1292
+ return h("div", { className: "dshcu-row" }, h("div", { style: S.toggleText }, title, h("span", { style: {
1260
1293
  ...S.hint,
1261
1294
  fontWeight: 400
1262
1295
  } }, hint)), h(Switch, {
@@ -1272,7 +1305,7 @@ window.__ModuleLoader__.load({
1272
1305
  gap: 8,
1273
1306
  alignItems: "center"
1274
1307
  } }, h("input", {
1275
- style: S.input,
1308
+ className: "dshcu-input",
1276
1309
  inputMode: "decimal",
1277
1310
  value,
1278
1311
  disabled,
@@ -1520,38 +1553,39 @@ window.__ModuleLoader__.load({
1520
1553
  maxPixels: Math.round(draftMaxPixels),
1521
1554
  jpegQuality: Number.isFinite(draftQuality) ? Math.round(draftQuality) : DEFAULTS.jpegQuality
1522
1555
  })) : 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: {
1556
+ 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
1557
  ...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", {
1558
+ background: status === null ? "#999" : helperOk ? "#22c55e" : "#ef4444",
1559
+ boxShadow: helperOk ? "0 0 0 3px rgba(34,197,94,.2)" : void 0
1560
+ } }), 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", {
1561
+ className: "dshcu-toast",
1562
+ style: updateInfo.error ? S.error : updateInfo.hasUpdate ? S.ok : S.hint
1563
+ }, 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
1564
  type: "button",
1531
- style: S.secondary,
1565
+ className: "dshcu-btn dshcu-btn-primary",
1532
1566
  onClick: () => {
1533
1567
  preview();
1534
1568
  }
1535
- }, "预览效果"), h("button", {
1569
+ }, "预览浮层效果"), h("button", {
1536
1570
  type: "button",
1537
- style: S.secondary,
1571
+ className: "dshcu-btn",
1538
1572
  onClick: () => {
1539
1573
  refreshStatus();
1540
1574
  }
1541
1575
  }, "刷新状态"), h("button", {
1542
1576
  type: "button",
1543
- style: S.secondary,
1577
+ className: "dshcu-btn",
1544
1578
  disabled: updateBusy,
1545
1579
  onClick: () => {
1546
1580
  checkUpdate();
1547
1581
  }
1548
1582
  }, updateBusy ? "检查中…" : "检查更新"), h("button", {
1549
1583
  type: "button",
1550
- style: S.secondary,
1584
+ className: "dshcu-btn",
1551
1585
  onClick: () => {
1552
1586
  exportDiagnostics();
1553
1587
  }
1554
- }, "导出诊断报告"), h("span", { style: S.hint }, "预览 4 秒:按已保存的设置显示光晕与提示条/进度卡片;诊断报告已脱敏,不含输入文本与截图。"))), h("section", { style: S.card }, h("h3", { style: S.cardTitle }, "授权"), h("div", { style: S.label }, "会话启用方式", h(Select, {
1588
+ }, "导出诊断报告")), 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
1589
  label: "会话启用方式",
1556
1590
  disabled,
1557
1591
  value: draft.sessionMode,
@@ -1566,20 +1600,20 @@ window.__ModuleLoader__.load({
1566
1600
  },
1567
1601
  {
1568
1602
  value: "always",
1569
- label: "总是开启(所有会话启用,隐藏输入框开关)"
1603
+ label: "总是开启(隐藏输入框开关)"
1570
1604
  }
1571
1605
  ],
1572
1606
  onChange: (value) => edit("sessionMode", value)
1573
1607
  }), h("span", { style: {
1574
1608
  ...S.hint,
1575
1609
  fontWeight: 400
1576
- } }, draft.sessionMode === "always" ? "所有会话始终开启电脑控制,不再在输入框左下角显示「电脑控制」胶囊按钮,界面更简洁。" : draft.sessionMode === "on" ? "新会话默认开启电脑控制;仍会在输入框左下角显示「电脑控制」胶囊,可针对单个会话关闭或用 /cu 切换。" : "普通对话默认不加载桌面工具与系统提示;需要在输入框左下角点击「电脑控制」胶囊或输入 /cu on 为当前会话按需开启,子代理自动继承。")), h("div", { style: S.label }, "授权方式", h(Select, {
1610
+ } }, draft.sessionMode === "always" ? "所有会话始终开启,隐藏输入框左下角「电脑控制」胶囊按钮。" : draft.sessionMode === "on" ? "新会话默认开启,保留输入框胶囊并支持 /cu 随时关闭。" : "普通对话不加载桌面工具;通过输入框胶囊或 /cu on 按需开启。")), h("div", { style: S.label }, "授权方式", h(Select, {
1577
1611
  label: "授权方式",
1578
1612
  disabled,
1579
1613
  value: draft.accessMode,
1580
1614
  options: [{
1581
1615
  value: "per-app",
1582
- label: "按应用授权(每个会话由你批准要操控的应用)"
1616
+ label: "按应用授权(每会话批准)"
1583
1617
  }, {
1584
1618
  value: "allow-all",
1585
1619
  label: "全部允许(不弹审批)"
@@ -1588,10 +1622,22 @@ window.__ModuleLoader__.load({
1588
1622
  }), h("span", { style: {
1589
1623
  ...S.hint,
1590
1624
  fontWeight: 400
1591
- } }, "会话权限为“完全权限”或“自动审查”时不弹审批,按应用授权会自动批准。无论哪种方式,DeepSeek Harness 自己的窗口都不会被操作。")), h("label", { style: S.label }, "禁止操控的应用", h("textarea", {
1625
+ } }, "完全权限或自动审查模式自动批准;DSH 自身窗口永远受保护。"))), h("div", { className: "dshcu-divider" }), h(ToggleRow, {
1626
+ title: "密码框硬保护",
1627
+ hint: "检测 UIA IsPassword 与 Win32 ES_PASSWORD 结构位:脱敏内容为 [password],拒绝自动输入密码。",
1628
+ checked: draft.protectPasswords,
1629
+ disabled,
1630
+ onChange: (value) => edit("protectPasswords", value)
1631
+ }), h(ToggleRow, {
1632
+ title: "窗口位移 / 遮挡防误点",
1633
+ hint: "坐标点击前核对前台窗口自上次截图后是否移动/缩放或被新弹窗遮挡,发生变化时阻止盲点。",
1634
+ checked: draft.windowChangeGuard,
1635
+ disabled,
1636
+ onChange: (value) => edit("windowChangeGuard", value)
1637
+ }), h("div", { className: "dshcu-divider" }), h("label", { style: S.label }, "禁止操控的应用", h("textarea", {
1638
+ className: "dshcu-input",
1592
1639
  style: {
1593
- ...S.input,
1594
- minHeight: 72,
1640
+ minHeight: 68,
1595
1641
  resize: "vertical"
1596
1642
  },
1597
1643
  value: draft.blockedApps,
@@ -1602,26 +1648,14 @@ window.__ModuleLoader__.load({
1602
1648
  }), h("span", { style: {
1603
1649
  ...S.hint,
1604
1650
  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: "不会出现在模型看到的截图里。",
1651
+ } }, "1Password、Bitwarden、KeePass 等密码管理器始终内置禁止;命令解释器无法通过 open_application 启动。"))), h("section", { className: "dshcu-card" }, h("div", { style: S.cardHeader }, h("h3", { style: S.cardTitle }, "操控外观与进度卡片")), h(ToggleRow, {
1652
+ title: "橙色光晕与协作光标",
1653
+ hint: "屏幕边缘光晕与 Codex 风格滑行光标;点击落点后短暂可进截图供模型核对。",
1620
1654
  checked: draft.overlay,
1621
1655
  disabled,
1622
1656
  onChange: (value) => edit("overlay", value)
1623
1657
  }), h("div", { style: S.grid2 }, h("label", { style: S.label }, "提示条名称", h("input", {
1624
- style: S.input,
1658
+ className: "dshcu-input",
1625
1659
  value: draft.overlayLabel,
1626
1660
  disabled,
1627
1661
  maxLength: 40,
@@ -1629,7 +1663,7 @@ window.__ModuleLoader__.load({
1629
1663
  }), h("span", { style: {
1630
1664
  ...S.hint,
1631
1665
  fontWeight: 400
1632
- } }, `显示为“${draft.overlayLabel.trim() || DEFAULTS.overlayLabel} 正在操控你的电脑”`)), h("div", { style: S.label }, "DeepSeek Harness 窗口", h(Select, {
1666
+ } }, `显示为“${draft.overlayLabel.trim() || DEFAULTS.overlayLabel} 正在操控”`)), h("div", { style: S.label }, "DeepSeek Harness 窗口", h(Select, {
1633
1667
  label: "DeepSeek Harness 窗口",
1634
1668
  disabled,
1635
1669
  value: draft.hostWindow,
@@ -1655,7 +1689,29 @@ window.__ModuleLoader__.load({
1655
1689
  }), h("span", { style: {
1656
1690
  ...S.hint,
1657
1691
  fontWeight: 400
1658
- } }, draft.hostWindow === "pet" ? "卡片上方显示思考,下方显示操作。可拖动、暂停或停止。正文开始输出时,回到 DSH 对话。" : "操控结束或正文开始输出时,恢复 DSH 窗口。")), h("div", { style: S.label }, "悬浮卡片透明度", h(Select, {
1692
+ } }, draft.hostWindow === "pet" ? "支持拖动、按钮悬停提示、暂停/停止与输入新指令;正文输出时自动切回对话。" : "操控结束或正文开始输出时,恢复 DSH 窗口。")), h("div", { style: S.label }, "迷你进度卡片尺寸", h(Select, {
1693
+ label: "迷你进度卡片尺寸",
1694
+ disabled: disabled || draft.hostWindow !== "pet",
1695
+ value: draft.petSize,
1696
+ options: [
1697
+ {
1698
+ value: "compact",
1699
+ label: "紧凑小卡片(最省视野 · 单行动作)"
1700
+ },
1701
+ {
1702
+ value: "standard",
1703
+ label: "标准卡片(单行思考 + 操作进度,推荐)"
1704
+ },
1705
+ {
1706
+ value: "detailed",
1707
+ label: "详情大卡片(双行思考 + 3 步时间线)"
1708
+ }
1709
+ ],
1710
+ onChange: (value) => edit("petSize", value)
1711
+ }), h("span", { style: {
1712
+ ...S.hint,
1713
+ fontWeight: 400
1714
+ } }, draft.petSize === "compact" ? "约 320px 宽,只展示当前动作与控制按钮;点展开可临时看详情。" : draft.petSize === "detailed" ? "约 484px 宽,默认展示双行思考与最近 3 步时间线(展开可达 8 步)。" : "约 420px 宽,平衡视野与信息量,展开可查看多行思考与 5 步时间线。")), h("div", { style: S.label }, "悬浮卡片透明度", h(Select, {
1659
1715
  label: "悬浮卡片透明度",
1660
1716
  disabled: disabled || draft.hostWindow !== "card" && draft.hostWindow !== "pet",
1661
1717
  value: String(draft.cardOpacity),
@@ -1689,7 +1745,7 @@ window.__ModuleLoader__.load({
1689
1745
  }), h("span", { style: {
1690
1746
  ...S.hint,
1691
1747
  fontWeight: 400
1692
- } }, "半透明卡片可以透过它看清下面的操作过程;鼠标停在卡片上会变回不透明,方便阅读和点击。AI 的截图本来就看不到卡片。")), h("div", { style: S.label }, "文字输入方式", h(Select, {
1748
+ } }, "鼠标停在卡片上会自动变不透明,方便阅读和点击;AI 截图永远看不到卡片。")), h("div", { style: S.label }, "文字输入方式", h(Select, {
1693
1749
  label: "文字输入方式",
1694
1750
  disabled,
1695
1751
  value: draft.typingMode,
@@ -1711,18 +1767,18 @@ window.__ModuleLoader__.load({
1711
1767
  }), h("span", { style: {
1712
1768
  ...S.hint,
1713
1769
  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, {
1770
+ } }, "短文字逐字打出;长文本流式按段落粘贴,防止编辑器自动补全打乱排版。")))), h("section", { className: "dshcu-card" }, h("div", { style: S.cardHeader }, h("h3", { style: S.cardTitle }, "交互接管与操控体验")), h(ToggleRow, {
1721
1771
  title: "检测到你在操作时暂停",
1722
- hint: "你用键盘打字时 AI 等你停手;你切换了窗口时 AI 先重新看屏幕。鼠标移动不会触发。",
1772
+ hint: "你打字、点击鼠标或滚动滚轮时 AI 等你停手;你切换了窗口时 AI 先重新看屏幕。纯鼠标移动不会误触。",
1723
1773
  checked: draft.pauseOnUserInput,
1724
1774
  disabled,
1725
1775
  onChange: (value) => edit("pauseOnUserInput", value)
1776
+ }), h(ToggleRow, {
1777
+ title: "向 AI 反馈我的接管操作",
1778
+ hint: "将你接管时点击的控件名称、坐标与窗口(脱敏,绝不记录输入明文与密码)告诉 AI,让它理解你的意图而不是覆盖你的操作。",
1779
+ checked: draft.reportUserActions,
1780
+ disabled: disabled || !draft.pauseOnUserInput,
1781
+ onChange: (value) => edit("reportUserActions", value)
1726
1782
  }), h(ToggleRow, {
1727
1783
  title: "坐标点击优先后台控件触发",
1728
1784
  hint: "坐标左键点击命中原生按钮、复选框或标签页时,优先走后台 UIA 语义触发,不移动真实鼠标也不抢焦点。",
@@ -1735,7 +1791,13 @@ window.__ModuleLoader__.load({
1735
1791
  checked: draft.restorePointer,
1736
1792
  disabled,
1737
1793
  onChange: (value) => edit("restorePointer", value)
1738
- }), h("div", { style: S.grid2 }, h(NumberField, {
1794
+ }), h(ToggleRow, {
1795
+ title: "操作时不深度思考(Beta)",
1796
+ hint: "试验功能:开始操作电脑后降低本轮思考强度(每步快约 1 秒),目前仅在 DeepSeek 官方模型生效。",
1797
+ checked: draft.quickSteps,
1798
+ disabled,
1799
+ onChange: (value) => edit("quickSteps", value)
1800
+ }), h("div", { className: "dshcu-divider" }), h("div", { style: S.grid2 }, h(NumberField, {
1739
1801
  label: "停手多久后继续",
1740
1802
  unit: "毫秒",
1741
1803
  value: draft.userIdleMs,
@@ -1749,7 +1811,7 @@ window.__ModuleLoader__.load({
1749
1811
  error: errors.cdpPort,
1750
1812
  disabled,
1751
1813
  onChange: (value) => edit("cdpPort", value)
1752
- }))), h("section", { style: S.card }, h("h3", { style: S.cardTitle }, "截图"), h(ToggleRow, {
1814
+ }))), h("section", { className: "dshcu-card" }, h("div", { style: S.cardHeader }, h("h3", { style: S.cardTitle }, "截图与清晰度")), h(ToggleRow, {
1753
1815
  title: "操作后自动回传截图",
1754
1816
  hint: "省去模型再截一次图的一轮调用;关闭可省 token。画面未变化时自动跳过重复图片。",
1755
1817
  checked: draft.autoScreenshot,
@@ -1771,7 +1833,7 @@ window.__ModuleLoader__.load({
1771
1833
  ...S.hint,
1772
1834
  fontWeight: 400
1773
1835
  } }, "紧凑档只降低操作后的自动确认截图;模型显式调用 screenshot / zoom 时仍保持标准清晰度。")), h("div", { style: S.grid2 }, h(NumberField, {
1774
- label: "操作后至少等待(之后画面静止即截图,最多约 2.5 秒)",
1836
+ label: "操作后至少等待(画面静止即截图)",
1775
1837
  unit: "毫秒",
1776
1838
  value: draft.settleMs,
1777
1839
  error: errors.settleMs,
@@ -1798,26 +1860,26 @@ window.__ModuleLoader__.load({
1798
1860
  error: errors.jpegQuality,
1799
1861
  disabled,
1800
1862
  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", {
1863
+ })), 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
1864
  type: "button",
1803
- style: {
1804
- ...S.secondary,
1805
- opacity: cacheBusy || !cache?.orphans ? .5 : 1
1806
- },
1865
+ className: "dshcu-btn",
1807
1866
  disabled: cacheBusy || !cache?.orphans,
1808
1867
  onClick: () => {
1809
1868
  cleanCache();
1810
1869
  }
1811
1870
  }, "清理已删除会话的截图"), h("button", {
1812
1871
  type: "button",
1813
- style: S.secondary,
1872
+ className: "dshcu-btn",
1814
1873
  disabled: cacheBusy,
1815
1874
  onClick: () => {
1816
1875
  refreshCache();
1817
1876
  }
1818
- }, cacheBusy ? "统计中…" : "重新统计"), cacheNote === null ? null : h("span", { style: cacheNote.kind === "ok" ? S.ok : S.error }, cacheNote.text))), h("div", { style: S.actions }, h("button", {
1877
+ }, cacheBusy ? "统计中…" : "重新统计"), cacheNote === null ? null : h("span", {
1878
+ className: "dshcu-toast",
1879
+ style: cacheNote.kind === "ok" ? S.ok : S.error
1880
+ }, cacheNote.text))), h("div", { style: S.actions }, h("button", {
1819
1881
  type: "button",
1820
- style: S.secondary,
1882
+ className: "dshcu-btn",
1821
1883
  disabled,
1822
1884
  onClick: () => {
1823
1885
  setDraft(draftFrom({}));
@@ -1826,11 +1888,14 @@ window.__ModuleLoader__.load({
1826
1888
  }
1827
1889
  }, "恢复默认"), saving ? h("span", { style: S.hint }, "保存中…") : dirty && invalid ? h("span", { style: S.error }, "有数值超出范围,改好后自动保存") : failed === draft && dirty ? h("button", {
1828
1890
  type: "button",
1829
- style: S.secondary,
1891
+ className: "dshcu-btn",
1830
1892
  onClick: () => {
1831
1893
  setFailed(null);
1832
1894
  }
1833
- }, "重试保存") : null, message === null || dirty && invalid ? null : h("span", { style: message.kind === "ok" ? S.ok : S.error }, message.text)), h(AccentPicker, null));
1895
+ }, "重试保存") : null, message === null || dirty && invalid ? null : h("span", {
1896
+ className: "dshcu-toast",
1897
+ style: message.kind === "ok" ? S.ok : S.error
1898
+ }, message.text)), h(AccentPicker, null));
1834
1899
  }
1835
1900
  const inject = [
1836
1901
  "slots",