@copylee/dsh-computer-use 0.2.2 → 0.5.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/README.md +9 -5
- package/helper/CuHelper.cs +863 -24
- package/helper/deepseek-black.png +0 -0
- package/helper/skills/notepad.md +8 -0
- package/helper/skills/obsidian.md +11 -0
- package/helper/skills/qq.md +11 -0
- package/helper/skills/typora.md +9 -0
- package/helper/skills/weixin.md +11 -0
- package/helper/skills/word.md +10 -0
- package/lib/client.js +294 -13
- package/lib/index.js +633 -39
- package/lib/types/client/skills-card.d.ts +9 -0
- package/lib/types/computer.d.ts +14 -0
- package/lib/types/index.d.ts +1 -6
- package/lib/types/overlay.d.ts +42 -1
- package/lib/types/routes.d.ts +4 -0
- package/lib/types/skills.d.ts +59 -0
- package/lib/types/tools.d.ts +3 -0
- package/package.json +3 -1
|
Binary file
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
app: Obsidian
|
|
3
|
+
match: Obsidian, obsidian.exe
|
|
4
|
+
summary: 新建笔记、Markdown 打字规律
|
|
5
|
+
---
|
|
6
|
+
- 新建或打开笔记:ctrl+o 打开快速切换,输入笔记名,Return;不存在的名字会直接创建。ctrl+n 新建无标题笔记。
|
|
7
|
+
- 笔记是库目录下的 .md 纯文本文件,写完可以直接读文件核对内容(不要用写文件代替打字)。
|
|
8
|
+
- 长文本直接用 type 输入(按段落流式粘贴),$...$、$$...$$、**粗体**、标题都按原文进入,不会被自动补全打乱。
|
|
9
|
+
- 列表会自动续行:在“- 甲”后按 Return 会自动出现下一个“- ”。逐行打字时只在第一项写“- ”,后面各项直接写内容;连按两次 Return 退出列表。
|
|
10
|
+
- 标题(## )前最好留一个空行,否则渲染可能和上一段粘在一起。
|
|
11
|
+
- ctrl+f 在当前笔记内查找,ctrl+Home 回到开头。
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
app: QQ
|
|
3
|
+
match: QQ, QQ.exe
|
|
4
|
+
summary: 从托盘恢复、群文件批量另存
|
|
5
|
+
---
|
|
6
|
+
- QQ 关闭后缩到系统托盘,用 open_application 恢复。绝对不要再启动一个 QQ(会弹出第二个登录窗),也不要用 shell 显示它的隐藏窗口(界面会卡死)。
|
|
7
|
+
- QQ 的界面不暴露界面元素(ui_elements 为空),只能靠截图操作。
|
|
8
|
+
- 找群:点左上角搜索框输入群名,点结果进入。
|
|
9
|
+
- 群文件:进入群后点聊天窗口右上角的“群文件”图标,会打开单独的“群文件”窗口,文件按上传时间排列。
|
|
10
|
+
- 批量保存:在群文件窗口里选中多个文件,右键选“另存为”,在对话框里输入目标文件夹的完整路径后确认。
|
|
11
|
+
- 已下载的文件在:文档\Tencent Files\<QQ号>\nt_qq\nt_data\File\。
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
app: Typora
|
|
3
|
+
match: Typora, typora.exe
|
|
4
|
+
summary: Markdown 打字规律、源码模式
|
|
5
|
+
---
|
|
6
|
+
- 长 Markdown 文本直接用 type 输入:内容按段落粘贴进入,标题、列表、代码块会按原文正确渲染。
|
|
7
|
+
- 逐字敲 Markdown 符号会被自动补全(** 变成 ****、括号成对、列表自动续行),所以不要自己一个字符一个字符地敲格式符号。
|
|
8
|
+
- ctrl+/ 切换源码模式;在源码模式下看到的是原始 Markdown。
|
|
9
|
+
- 保存:ctrl+s,新文件会弹出另存为对话框,alt+n、ctrl+a 后输入完整路径再 Return。
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
app: 微信
|
|
3
|
+
match: 微信, WeChat, Weixin.exe
|
|
4
|
+
summary: 从托盘恢复、找群、保存群文件
|
|
5
|
+
---
|
|
6
|
+
- 微信关闭后只是缩到系统托盘,用 open_application 恢复,不要再次启动(会要求重新登录)。
|
|
7
|
+
- 找聊天或群:点左上角搜索框,输入名称,在结果里点对应的群;搜索结果列表可能需要滚动。
|
|
8
|
+
- 看群里的文件:打开群后点右上角“…”(聊天信息),选“查找聊天内容”,再切到“文件”页签,可以按发送人筛选。
|
|
9
|
+
- 保存文件:在文件上右键,选“另存为...”,在对话框里 alt+n、ctrl+a,输入完整路径后 Return。左键单击文件会直接用默认程序打开它。
|
|
10
|
+
- 已接收过的文件在本地缓存:文档\xwechat_files\<微信号目录>\msg\file\<年-月>\,批量归档时可以直接从这里复制。
|
|
11
|
+
- 发送消息、撤回、删除属于不可逆操作,除非用户明确要求,否则先问。
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
app: Word
|
|
3
|
+
match: Word, winword.exe
|
|
4
|
+
summary: 新建文档、打字排版、另存为
|
|
5
|
+
---
|
|
6
|
+
- 启动后停在开始页:点“空白文档”(或直接按 Return)进入文档,窗口会换成“文档1 - Word”。
|
|
7
|
+
- 保存:按 F12 直接打开经典“另存为”对话框,alt+n 聚焦文件名框,ctrl+a,输入完整路径(如 C:\Users\<用户>\Desktop\标题.docx),Return。不要点左侧文件夹导航,也不要三击文件名框(会只选中一部分,文件名被拼接)。
|
|
8
|
+
- 打字:以“一、”“1.”开头的段落按 Return 后会触发自动编号和缩进;想保留原样,回车后立刻 ctrl+z 一次撤销自动套用,或写完后 ctrl+a 再 ctrl+q 清除段落格式。
|
|
9
|
+
- 标题格式:ctrl+Home 到开头,shift+End 选中该行,ctrl+b 加粗,ctrl+] 逐级放大字号,ctrl+e 居中。不要去点功能区的字号框再打字,容易把选中的标题文字替换掉。
|
|
10
|
+
- 查找用 ctrl+f(左侧导航窗格),用完按 Escape 关闭。
|
package/lib/client.js
CHANGED
|
@@ -35,7 +35,8 @@ window.__ModuleLoader__.load({
|
|
|
35
35
|
accessMode: "per-app",
|
|
36
36
|
overlay: true,
|
|
37
37
|
overlayLabel: "DeepSeek Harness",
|
|
38
|
-
hostWindow: "
|
|
38
|
+
hostWindow: "pet",
|
|
39
|
+
cardOpacity: 80,
|
|
39
40
|
autoScreenshot: true,
|
|
40
41
|
settleMs: 400,
|
|
41
42
|
maxLongEdge: 1366,
|
|
@@ -59,7 +60,8 @@ window.__ModuleLoader__.load({
|
|
|
59
60
|
accessMode: out.accessMode === "allow-all" || out.accessMode === "per-app" ? out.accessMode : DEFAULTS.accessMode,
|
|
60
61
|
overlay: bool("overlay"),
|
|
61
62
|
overlayLabel: typeof out.overlayLabel === "string" && out.overlayLabel.trim() !== "" ? out.overlayLabel.trim().slice(0, 40) : DEFAULTS.overlayLabel,
|
|
62
|
-
hostWindow: out.hostWindow === "card" || out.hostWindow === "minimize" || out.hostWindow === "keep" ? out.hostWindow : out.minimizeHostWindow === true ? "minimize" : DEFAULTS.hostWindow,
|
|
63
|
+
hostWindow: out.hostWindow === "pet" || out.hostWindow === "card" || out.hostWindow === "minimize" || out.hostWindow === "keep" ? out.hostWindow : out.minimizeHostWindow === true ? "minimize" : DEFAULTS.hostWindow,
|
|
64
|
+
cardOpacity: num("cardOpacity", 30, 100),
|
|
63
65
|
autoScreenshot: bool("autoScreenshot"),
|
|
64
66
|
settleMs: num("settleMs", 0, 5e3),
|
|
65
67
|
maxLongEdge: num("maxLongEdge", 640, 3840),
|
|
@@ -133,7 +135,7 @@ window.__ModuleLoader__.load({
|
|
|
133
135
|
}
|
|
134
136
|
//#endregion
|
|
135
137
|
//#region lib/types/client/select.js
|
|
136
|
-
const h$
|
|
138
|
+
const h$2 = react.createElement;
|
|
137
139
|
/** Menu appearance and fixed-position behavior follow dsh-free-search / dsh-proxy. */
|
|
138
140
|
const selectCss = `
|
|
139
141
|
.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}
|
|
@@ -204,7 +206,7 @@ window.__ModuleLoader__.load({
|
|
|
204
206
|
react.useEffect(() => {
|
|
205
207
|
list.current?.querySelector(`[data-index="${active}"]`)?.scrollIntoView({ block: "nearest" });
|
|
206
208
|
}, [active, open]);
|
|
207
|
-
return h$
|
|
209
|
+
return h$2("div", { style: { minWidth: 0 } }, h$2("button", {
|
|
208
210
|
ref: trigger,
|
|
209
211
|
type: "button",
|
|
210
212
|
className: "dshcu-select",
|
|
@@ -246,31 +248,31 @@ window.__ModuleLoader__.load({
|
|
|
246
248
|
choose(active);
|
|
247
249
|
}
|
|
248
250
|
}
|
|
249
|
-
}, h$
|
|
251
|
+
}, h$2("span", { style: {
|
|
250
252
|
flex: 1,
|
|
251
253
|
minWidth: 0,
|
|
252
254
|
overflow: "hidden",
|
|
253
255
|
textOverflow: "ellipsis",
|
|
254
256
|
whiteSpace: "nowrap"
|
|
255
|
-
} }, options[selected]?.label), h$
|
|
257
|
+
} }, options[selected]?.label), h$2("svg", {
|
|
256
258
|
width: 14,
|
|
257
259
|
height: 14,
|
|
258
260
|
viewBox: "0 0 16 16",
|
|
259
261
|
"aria-hidden": true,
|
|
260
262
|
style: { transform: open ? "rotate(180deg)" : void 0 }
|
|
261
|
-
}, h$
|
|
263
|
+
}, h$2("path", {
|
|
262
264
|
d: "M4 6l4 4 4-4",
|
|
263
265
|
fill: "none",
|
|
264
266
|
stroke: "currentColor",
|
|
265
267
|
strokeWidth: 1.6
|
|
266
|
-
}))), open ? h$
|
|
268
|
+
}))), open ? h$2("div", {
|
|
267
269
|
ref: list,
|
|
268
270
|
id: `${id}-list`,
|
|
269
271
|
role: "listbox",
|
|
270
272
|
"aria-label": label,
|
|
271
273
|
className: "dshcu-menu",
|
|
272
274
|
style: pos
|
|
273
|
-
}, ...options.map((option, i) => h$
|
|
275
|
+
}, ...options.map((option, i) => h$2("div", {
|
|
274
276
|
key: option.value,
|
|
275
277
|
id: `${id}-${i}`,
|
|
276
278
|
role: "option",
|
|
@@ -281,12 +283,12 @@ window.__ModuleLoader__.load({
|
|
|
281
283
|
onPointerMove: () => setActive(i),
|
|
282
284
|
onPointerDown: (e) => e.preventDefault(),
|
|
283
285
|
onClick: () => choose(i)
|
|
284
|
-
}, h$
|
|
286
|
+
}, h$2("span", { style: { flex: 1 } }, option.label), h$2("span", { style: { width: 14 } }, i === selected ? h$2("svg", {
|
|
285
287
|
width: 14,
|
|
286
288
|
height: 14,
|
|
287
289
|
viewBox: "0 0 16 16",
|
|
288
290
|
"aria-hidden": true
|
|
289
|
-
}, h$
|
|
291
|
+
}, h$2("path", {
|
|
290
292
|
d: "M3.5 8.5 6.5 11.5 12.5 4.5",
|
|
291
293
|
fill: "none",
|
|
292
294
|
stroke: "currentColor",
|
|
@@ -296,6 +298,245 @@ window.__ModuleLoader__.load({
|
|
|
296
298
|
})) : null)))) : null);
|
|
297
299
|
}
|
|
298
300
|
//#endregion
|
|
301
|
+
//#region lib/types/client/skills-card.js
|
|
302
|
+
/**
|
|
303
|
+
* "应用技能" card: the per-app notes the agent keeps (see ../skills.ts). The
|
|
304
|
+
* user can read, edit, add and delete them here; built-in skills can be
|
|
305
|
+
* overridden and restored.
|
|
306
|
+
*/
|
|
307
|
+
const SKILLS_ROUTE = "/api/dsh-computer-use/skills";
|
|
308
|
+
const MAX_CHARS = 4e3;
|
|
309
|
+
const h$1 = react.createElement;
|
|
310
|
+
function SkillsCard({ S }) {
|
|
311
|
+
const [skills, setSkills] = react.useState(null);
|
|
312
|
+
const [dir, setDir] = react.useState("");
|
|
313
|
+
const [draft, setDraft] = react.useState(null);
|
|
314
|
+
const [busy, setBusy] = react.useState(false);
|
|
315
|
+
const [note, setNote] = react.useState(null);
|
|
316
|
+
const call = react.useCallback(async (body) => {
|
|
317
|
+
setBusy(true);
|
|
318
|
+
try {
|
|
319
|
+
const result = await (await fetch(SKILLS_ROUTE, body ? {
|
|
320
|
+
method: "POST",
|
|
321
|
+
credentials: "same-origin",
|
|
322
|
+
headers: { "content-type": "application/json" },
|
|
323
|
+
body: JSON.stringify(body)
|
|
324
|
+
} : { credentials: "same-origin" })).json();
|
|
325
|
+
if (!result.ok) throw new Error(result.error ?? "请求失败");
|
|
326
|
+
setSkills(result.skills ?? []);
|
|
327
|
+
setDir(result.dir ?? "");
|
|
328
|
+
return true;
|
|
329
|
+
} catch (error) {
|
|
330
|
+
setNote({
|
|
331
|
+
kind: "error",
|
|
332
|
+
text: error.message
|
|
333
|
+
});
|
|
334
|
+
return false;
|
|
335
|
+
} finally {
|
|
336
|
+
setBusy(false);
|
|
337
|
+
}
|
|
338
|
+
}, []);
|
|
339
|
+
react.useEffect(() => {
|
|
340
|
+
call();
|
|
341
|
+
}, [call]);
|
|
342
|
+
const edit = (skill) => {
|
|
343
|
+
setNote(null);
|
|
344
|
+
setDraft({
|
|
345
|
+
id: skill.id,
|
|
346
|
+
app: skill.app,
|
|
347
|
+
match: skill.match.join(", "),
|
|
348
|
+
summary: skill.summary,
|
|
349
|
+
content: skill.content,
|
|
350
|
+
isNew: false
|
|
351
|
+
});
|
|
352
|
+
};
|
|
353
|
+
const save = async () => {
|
|
354
|
+
if (!draft) return;
|
|
355
|
+
setNote(null);
|
|
356
|
+
if (await call({
|
|
357
|
+
op: "save",
|
|
358
|
+
id: draft.isNew ? "" : draft.id,
|
|
359
|
+
app: draft.app,
|
|
360
|
+
match: draft.match,
|
|
361
|
+
summary: draft.summary,
|
|
362
|
+
content: draft.content
|
|
363
|
+
})) {
|
|
364
|
+
setDraft(null);
|
|
365
|
+
setNote({
|
|
366
|
+
kind: "ok",
|
|
367
|
+
text: "已保存"
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
const remove = async (skill) => {
|
|
372
|
+
setNote(null);
|
|
373
|
+
if (await call({
|
|
374
|
+
op: "delete",
|
|
375
|
+
id: skill.id
|
|
376
|
+
})) {
|
|
377
|
+
if (draft?.id === skill.id) setDraft(null);
|
|
378
|
+
setNote({
|
|
379
|
+
kind: "ok",
|
|
380
|
+
text: `已删除“${skill.app}”`
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
const reset = async (skill) => {
|
|
385
|
+
setNote(null);
|
|
386
|
+
if (await call({
|
|
387
|
+
op: "reset",
|
|
388
|
+
id: skill.id
|
|
389
|
+
})) {
|
|
390
|
+
if (draft?.id === skill.id) setDraft(null);
|
|
391
|
+
setNote({
|
|
392
|
+
kind: "ok",
|
|
393
|
+
text: `已恢复“${skill.app}”的内置版本`
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
const row = {
|
|
398
|
+
display: "flex",
|
|
399
|
+
gap: 10,
|
|
400
|
+
alignItems: "center",
|
|
401
|
+
padding: "8px 0",
|
|
402
|
+
borderTop: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.18))"
|
|
403
|
+
};
|
|
404
|
+
const small = {
|
|
405
|
+
...S.secondary,
|
|
406
|
+
padding: "4px 10px",
|
|
407
|
+
fontSize: 12
|
|
408
|
+
};
|
|
409
|
+
const tag = {
|
|
410
|
+
fontSize: 11,
|
|
411
|
+
padding: "1px 7px",
|
|
412
|
+
borderRadius: 999,
|
|
413
|
+
border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.3))",
|
|
414
|
+
color: "var(--dsw-alias-label-tertiary, #888)",
|
|
415
|
+
whiteSpace: "nowrap"
|
|
416
|
+
};
|
|
417
|
+
const invalid = draft !== null && (draft.app.trim() === "" || draft.content.trim() === "" || draft.content.length > MAX_CHARS);
|
|
418
|
+
return h$1("section", { style: S.card }, h$1("h3", { style: S.cardTitle }, "应用技能"), h$1("p", { style: S.hint }, "AI 对各个应用的操作笔记:每个应用一份,AI 摸索清楚一个不熟悉的应用后会自己记下来,以后打开这个应用时自动读取,不占用系统提示。你可以在这里查看、修改、删除或新建。"), skills === null ? h$1("p", { style: S.hint }, busy ? "正在读取…" : "无法读取应用技能。") : skills.length === 0 ? h$1("p", { style: S.hint }, "还没有应用技能。") : h$1("div", null, ...skills.map((skill) => h$1("div", {
|
|
419
|
+
key: skill.id,
|
|
420
|
+
style: row
|
|
421
|
+
}, h$1("div", { style: {
|
|
422
|
+
flex: 1,
|
|
423
|
+
minWidth: 0
|
|
424
|
+
} }, h$1("div", { style: {
|
|
425
|
+
fontSize: 13,
|
|
426
|
+
fontWeight: 600,
|
|
427
|
+
display: "flex",
|
|
428
|
+
gap: 8,
|
|
429
|
+
alignItems: "center"
|
|
430
|
+
} }, skill.app, h$1("span", { style: tag }, skill.source === "builtin" ? "内置" : skill.overrides ? "已修改" : "AI / 自定义")), h$1("div", { style: {
|
|
431
|
+
...S.hint,
|
|
432
|
+
overflow: "hidden",
|
|
433
|
+
textOverflow: "ellipsis",
|
|
434
|
+
whiteSpace: "nowrap"
|
|
435
|
+
} }, `${skill.summary || "(无摘要)"} · ${skill.content.length} 字`)), h$1("button", {
|
|
436
|
+
type: "button",
|
|
437
|
+
style: small,
|
|
438
|
+
disabled: busy,
|
|
439
|
+
onClick: () => edit(skill)
|
|
440
|
+
}, "查看 / 编辑"), skill.overrides ? h$1("button", {
|
|
441
|
+
type: "button",
|
|
442
|
+
style: small,
|
|
443
|
+
disabled: busy,
|
|
444
|
+
onClick: () => {
|
|
445
|
+
reset(skill);
|
|
446
|
+
}
|
|
447
|
+
}, "恢复内置") : null, h$1("button", {
|
|
448
|
+
type: "button",
|
|
449
|
+
style: small,
|
|
450
|
+
disabled: busy,
|
|
451
|
+
onClick: () => {
|
|
452
|
+
remove(skill);
|
|
453
|
+
}
|
|
454
|
+
}, "删除")))), draft === null ? null : h$1("div", { style: {
|
|
455
|
+
display: "grid",
|
|
456
|
+
gap: 10,
|
|
457
|
+
paddingTop: 4
|
|
458
|
+
} }, h$1("div", { style: S.grid2 }, h$1("label", { style: S.label }, "应用名称", h$1("input", {
|
|
459
|
+
style: S.input,
|
|
460
|
+
value: draft.app,
|
|
461
|
+
disabled: !draft.isNew,
|
|
462
|
+
maxLength: 60,
|
|
463
|
+
placeholder: "如 Obsidian",
|
|
464
|
+
onChange: (e) => setDraft({
|
|
465
|
+
...draft,
|
|
466
|
+
app: e.target.value
|
|
467
|
+
})
|
|
468
|
+
})), h$1("label", { style: S.label }, "匹配的程序(逗号分隔)", h$1("input", {
|
|
469
|
+
style: S.input,
|
|
470
|
+
value: draft.match,
|
|
471
|
+
maxLength: 200,
|
|
472
|
+
placeholder: "如 Obsidian, obsidian.exe",
|
|
473
|
+
onChange: (e) => setDraft({
|
|
474
|
+
...draft,
|
|
475
|
+
match: e.target.value
|
|
476
|
+
})
|
|
477
|
+
}))), h$1("label", { style: S.label }, "摘要", h$1("input", {
|
|
478
|
+
style: S.input,
|
|
479
|
+
value: draft.summary,
|
|
480
|
+
maxLength: 80,
|
|
481
|
+
placeholder: "几个词说明这份技能讲什么",
|
|
482
|
+
onChange: (e) => setDraft({
|
|
483
|
+
...draft,
|
|
484
|
+
summary: e.target.value
|
|
485
|
+
})
|
|
486
|
+
})), h$1("label", { style: S.label }, `内容(${draft.content.length} / ${MAX_CHARS} 字)`, h$1("textarea", {
|
|
487
|
+
style: {
|
|
488
|
+
...S.input,
|
|
489
|
+
minHeight: 200,
|
|
490
|
+
resize: "vertical",
|
|
491
|
+
fontFamily: "inherit",
|
|
492
|
+
lineHeight: 1.55
|
|
493
|
+
},
|
|
494
|
+
value: draft.content,
|
|
495
|
+
placeholder: "- 一条一条写操作规律:入口在哪、快捷键、容易踩的坑",
|
|
496
|
+
onChange: (e) => setDraft({
|
|
497
|
+
...draft,
|
|
498
|
+
content: e.target.value
|
|
499
|
+
})
|
|
500
|
+
})), h$1("div", { style: S.actions }, h$1("button", {
|
|
501
|
+
type: "button",
|
|
502
|
+
style: {
|
|
503
|
+
...S.primary,
|
|
504
|
+
opacity: busy || invalid ? .5 : 1
|
|
505
|
+
},
|
|
506
|
+
disabled: busy || invalid,
|
|
507
|
+
onClick: () => {
|
|
508
|
+
save();
|
|
509
|
+
}
|
|
510
|
+
}, "保存技能"), h$1("button", {
|
|
511
|
+
type: "button",
|
|
512
|
+
style: S.secondary,
|
|
513
|
+
disabled: busy,
|
|
514
|
+
onClick: () => setDraft(null)
|
|
515
|
+
}, "取消"), draft.content.length > MAX_CHARS ? h$1("span", { style: S.error }, "内容过长,请精简") : null)), h$1("div", { style: S.actions }, draft === null ? h$1("button", {
|
|
516
|
+
type: "button",
|
|
517
|
+
style: S.secondary,
|
|
518
|
+
disabled: busy,
|
|
519
|
+
onClick: () => {
|
|
520
|
+
setNote(null);
|
|
521
|
+
setDraft({
|
|
522
|
+
id: "",
|
|
523
|
+
app: "",
|
|
524
|
+
match: "",
|
|
525
|
+
summary: "",
|
|
526
|
+
content: "",
|
|
527
|
+
isNew: true
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
}, "新建技能") : null, h$1("button", {
|
|
531
|
+
type: "button",
|
|
532
|
+
style: S.secondary,
|
|
533
|
+
disabled: busy,
|
|
534
|
+
onClick: () => {
|
|
535
|
+
call();
|
|
536
|
+
}
|
|
537
|
+
}, "刷新"), note === null ? null : h$1("span", { style: note.kind === "ok" ? S.ok : S.error }, note.text)), dir ? h$1("p", { style: S.hint }, `保存位置:${dir}(每个应用一个 .md 文件,也可以直接用编辑器改)。删除内置技能后,新建同名技能即可重新启用。`) : null);
|
|
538
|
+
}
|
|
539
|
+
//#endregion
|
|
299
540
|
//#region lib/types/client/index.js
|
|
300
541
|
/**
|
|
301
542
|
* Browser half: the "电脑控制" (Computer use) section in Settings. It reads the
|
|
@@ -318,6 +559,7 @@ window.__ModuleLoader__.load({
|
|
|
318
559
|
overlay: s.overlay,
|
|
319
560
|
overlayLabel: s.overlayLabel,
|
|
320
561
|
hostWindow: s.hostWindow,
|
|
562
|
+
cardOpacity: s.cardOpacity,
|
|
321
563
|
typingMode: s.typingMode,
|
|
322
564
|
pauseOnUserInput: s.pauseOnUserInput,
|
|
323
565
|
userIdleMs: String(s.userIdleMs),
|
|
@@ -349,6 +591,7 @@ window.__ModuleLoader__.load({
|
|
|
349
591
|
overlay: d.overlay,
|
|
350
592
|
overlayLabel: d.overlayLabel.trim() || DEFAULTS.overlayLabel,
|
|
351
593
|
hostWindow: d.hostWindow,
|
|
594
|
+
cardOpacity: d.cardOpacity,
|
|
352
595
|
typingMode: d.typingMode,
|
|
353
596
|
pauseOnUserInput: d.pauseOnUserInput,
|
|
354
597
|
userIdleMs: Math.round(Number(d.userIdleMs)),
|
|
@@ -748,6 +991,10 @@ window.__ModuleLoader__.load({
|
|
|
748
991
|
disabled,
|
|
749
992
|
value: draft.hostWindow,
|
|
750
993
|
options: [
|
|
994
|
+
{
|
|
995
|
+
value: "pet",
|
|
996
|
+
label: "迷你进度卡片(推荐)"
|
|
997
|
+
},
|
|
751
998
|
{
|
|
752
999
|
value: "card",
|
|
753
1000
|
label: "缩成右下角置顶悬浮卡片"
|
|
@@ -765,7 +1012,41 @@ window.__ModuleLoader__.load({
|
|
|
765
1012
|
}), h("span", { style: {
|
|
766
1013
|
...S.hint,
|
|
767
1014
|
fontWeight: 400
|
|
768
|
-
} }, "操控结束后自动恢复原尺寸和位置。")), h("div", { style: S.label }, "
|
|
1015
|
+
} }, draft.hostWindow === "pet" ? "DSH 最小化,右下角显示迷你卡片:一行滚动显示回复正文,一行显示思考和工具调用;可拖动,有暂停 / 停止按钮。结束后自动恢复。" : "操控结束后自动恢复原尺寸和位置。")), h("div", { style: S.label }, "悬浮卡片透明度", h(Select, {
|
|
1016
|
+
label: "悬浮卡片透明度",
|
|
1017
|
+
disabled: disabled || draft.hostWindow !== "card" && draft.hostWindow !== "pet",
|
|
1018
|
+
value: String(draft.cardOpacity),
|
|
1019
|
+
options: [
|
|
1020
|
+
{
|
|
1021
|
+
value: "100",
|
|
1022
|
+
label: "不透明"
|
|
1023
|
+
},
|
|
1024
|
+
{
|
|
1025
|
+
value: "90",
|
|
1026
|
+
label: "90%"
|
|
1027
|
+
},
|
|
1028
|
+
{
|
|
1029
|
+
value: "80",
|
|
1030
|
+
label: "80%(默认)"
|
|
1031
|
+
},
|
|
1032
|
+
{
|
|
1033
|
+
value: "70",
|
|
1034
|
+
label: "70%"
|
|
1035
|
+
},
|
|
1036
|
+
{
|
|
1037
|
+
value: "60",
|
|
1038
|
+
label: "60%"
|
|
1039
|
+
},
|
|
1040
|
+
{
|
|
1041
|
+
value: "50",
|
|
1042
|
+
label: "50%:最通透"
|
|
1043
|
+
}
|
|
1044
|
+
],
|
|
1045
|
+
onChange: (value) => edit("cardOpacity", Number(value))
|
|
1046
|
+
}), h("span", { style: {
|
|
1047
|
+
...S.hint,
|
|
1048
|
+
fontWeight: 400
|
|
1049
|
+
} }, "半透明卡片可以透过它看清下面的操作过程;鼠标停在卡片上会变回不透明,方便阅读和点击。AI 的截图本来就看不到卡片。")), h("div", { style: S.label }, "文字输入方式", h(Select, {
|
|
769
1050
|
label: "文字输入方式",
|
|
770
1051
|
disabled,
|
|
771
1052
|
value: draft.typingMode,
|
|
@@ -834,7 +1115,7 @@ window.__ModuleLoader__.load({
|
|
|
834
1115
|
error: errors.jpegQuality,
|
|
835
1116
|
disabled,
|
|
836
1117
|
onChange: (value) => edit("jpegQuality", value)
|
|
837
|
-
})), h("p", { style: S.hint }, "截图越大越清晰、点得越准,但每张图消耗的 token 也越多。默认值(最长边 1366、1.15 百万像素)适合大多数模型。")), 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", {
|
|
1118
|
+
})), 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", {
|
|
838
1119
|
type: "button",
|
|
839
1120
|
style: {
|
|
840
1121
|
...S.secondary,
|