@copylee/dsh-computer-use 0.7.3 → 0.7.5
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 +1 -1
- package/lib/client.js +2 -2
- package/lib/index.js +36 -1
- package/lib/types/overlay.d.ts +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
| 把窗口读成文本 | `ui_elements` 加 `text: true` 直接读出文档、网页、聊天回复或日志的文字(默认取末尾 4000 字),比滚动加放大截图快,也能逐字引用;批量调用加 `finish: "text"` 可以用文字代替结尾的截图 |
|
|
19
19
|
| 按应用授权 | 先 `request_access` 列出要操控的应用,经 DSH 原生审批后才能操作;也可改为“全部允许” |
|
|
20
20
|
| 不会操作自己 | 永远拒绝向 DeepSeek Harness 自身窗口输入;常见密码管理器默认禁止,可再自定义禁用列表 |
|
|
21
|
-
| 正在控制的提示 | 橙色光晕 +
|
|
21
|
+
| 正在控制的提示 | 橙色光晕 + 胶囊提示条(显示当前动作),**不会出现在截图里**;AI 还在忙但已不再操作电脑时(约 90 秒没有电脑操作,或连续调用了 3 个其他工具)自动收起,下次操作电脑时再出现 |
|
|
22
22
|
| 迷你进度卡片(默认) | 操控期间 DeepSeek Harness 最小化,右下角显示一张半透明小卡片:标题行有 DeepSeek 图标和“输入”“展开”“暂停”“停止”四个圆形按钮;第一行滚动显示回复正文(实时流式),第二行显示思考过程,或最近几步的小时间线(已完成的步骤打勾,如“打开 Word › 输入正文 › 另存为”)。点“展开”变成长卡片:多行回复、思考、最近 5 步时间线。点“输入”在卡片下方弹出输入框,AI 自动暂停,输入指令按 Enter 发送(与在 DSH 里插话一样,AI 下一步就会看到),Esc 取消。任务结束时卡片显示“已完成”几秒再消失(鼠标停在上面会一直保留)。卡片可拖动、跟随系统深浅色,AI 的截图里看不到它,点击也会穿透它。操控中你把 DSH 窗口打开,它会自动变成下面的半透明悬浮卡片,不会挡住 AI |
|
|
23
23
|
| 悬浮卡片 | 操控期间 DeepSeek Harness 窗口缩成右下角置顶卡片,结束后自动恢复原尺寸、位置和最大化 / 最小化状态(也可选最小化或不动)。卡片只给你看:AI 的截图里看到的是卡片下面的内容(通过 Windows 放大镜接口截图时把卡片排除在外,不闪烁;该接口不可用时退回为截图瞬间让卡片透明约 20 毫秒),点击和滚动也直接穿透卡片,卡片不会挪位置。卡片默认 80% 不透明,可以透过它看清下面的操作过程;鼠标在卡片上停一下就变回不透明,方便阅读和点击(透明度可在设置里调) |
|
|
24
24
|
| 暂停与停止 | 你亲手按 **Esc** 暂停(AI 停在下一步之前),再按 Esc 或点“继续”恢复,对话不会被中断;点“停止”才结束本轮。插件自己发出的 Esc 不会误触发 |
|
package/lib/client.js
CHANGED
|
@@ -166,7 +166,7 @@ window.__ModuleLoader__.load({
|
|
|
166
166
|
return [accent, writeAccent];
|
|
167
167
|
}
|
|
168
168
|
/** A row of round swatches: one of them is always chosen. */
|
|
169
|
-
function AccentPicker({ label = "强调色", hint = "
|
|
169
|
+
function AccentPicker({ label = "强调色", hint = "", names }) {
|
|
170
170
|
const [accent, choose] = useAccent();
|
|
171
171
|
const h = react.createElement;
|
|
172
172
|
const name = (id) => names?.[id] ?? ACCENTS[id].name;
|
|
@@ -204,7 +204,7 @@ window.__ModuleLoader__.load({
|
|
|
204
204
|
}))), h("span", { style: {
|
|
205
205
|
fontSize: 12,
|
|
206
206
|
color: "var(--dsw-alias-label-tertiary, #888)"
|
|
207
|
-
} }, `${name(accent)} · ${hint}`));
|
|
207
|
+
} }, hint ? `${name(accent)} · ${hint}` : name(accent)));
|
|
208
208
|
}
|
|
209
209
|
//#endregion
|
|
210
210
|
//#region lib/types/client/nav-icon.js
|
package/lib/index.js
CHANGED
|
@@ -1580,6 +1580,13 @@ const FINISH_HOLD_MS = 4e3;
|
|
|
1580
1580
|
* starts of any plugin count, so a slow shell command does not end the run.
|
|
1581
1581
|
*/
|
|
1582
1582
|
const IDLE_HIDE_MS = 6e5;
|
|
1583
|
+
/**
|
|
1584
|
+
* The agent stays busy but has stopped operating the computer (it looked at the screen once and went on with
|
|
1585
|
+
* other tools): the glow and the card go after this long without a computer action, or sooner once it has
|
|
1586
|
+
* started this many tools of other plugins in a row. The next computer action brings them back.
|
|
1587
|
+
*/
|
|
1588
|
+
const UNUSED_HIDE_MS = 9e4;
|
|
1589
|
+
const UNUSED_AFTER_TOOLS = 3;
|
|
1583
1590
|
/** A pause longer than this ends the tool call with a message for the model. */
|
|
1584
1591
|
const MAX_PAUSE_MS = 15e5;
|
|
1585
1592
|
/** Card rectangle in the bottom-right corner of a display's work area. */
|
|
@@ -1603,6 +1610,8 @@ var OverlayController = class {
|
|
|
1603
1610
|
agent;
|
|
1604
1611
|
visible = false;
|
|
1605
1612
|
idleTimer;
|
|
1613
|
+
unusedTimer;
|
|
1614
|
+
otherTools = 0;
|
|
1606
1615
|
hostWindows = [];
|
|
1607
1616
|
stopping = false;
|
|
1608
1617
|
/** Progress card lines: the reply as it streams, and what the agent is doing. */
|
|
@@ -1676,6 +1685,7 @@ var OverlayController = class {
|
|
|
1676
1685
|
async begin(agent, status) {
|
|
1677
1686
|
if (agent) this.agent = agent;
|
|
1678
1687
|
this.armIdle();
|
|
1688
|
+
this.armUnused();
|
|
1679
1689
|
const settings = this.settings();
|
|
1680
1690
|
if (!this.visible) {
|
|
1681
1691
|
this.visible = true;
|
|
@@ -1714,6 +1724,7 @@ var OverlayController = class {
|
|
|
1714
1724
|
async status(status) {
|
|
1715
1725
|
const settings = this.settings();
|
|
1716
1726
|
if (!this.visible) return;
|
|
1727
|
+
this.armUnused();
|
|
1717
1728
|
if (settings.hostWindow === "pet") {
|
|
1718
1729
|
this.step(status);
|
|
1719
1730
|
return;
|
|
@@ -1759,7 +1770,14 @@ var OverlayController = class {
|
|
|
1759
1770
|
/** A tool of another plugin started (computer-use tools report their own steps). */
|
|
1760
1771
|
toolStarted(agent, name, detail) {
|
|
1761
1772
|
if (agent !== this.streamAgent) return;
|
|
1762
|
-
if (this.visible && agent === this.agent)
|
|
1773
|
+
if (this.visible && agent === this.agent) {
|
|
1774
|
+
this.armIdle();
|
|
1775
|
+
if (++this.otherTools >= UNUSED_AFTER_TOOLS && !this.paused) {
|
|
1776
|
+
this.log("computer use not used for a while (other tools running): overlay released");
|
|
1777
|
+
this.end();
|
|
1778
|
+
return;
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1763
1781
|
this.step(`${TOOL_NAMES[name] ?? name}${detail ? `:${detail}` : ""}`);
|
|
1764
1782
|
}
|
|
1765
1783
|
schedulePush() {
|
|
@@ -1781,6 +1799,9 @@ var OverlayController = class {
|
|
|
1781
1799
|
if (agent !== void 0 && this.agent !== void 0 && agent !== this.agent) return;
|
|
1782
1800
|
if (this.idleTimer) clearTimeout(this.idleTimer);
|
|
1783
1801
|
this.idleTimer = void 0;
|
|
1802
|
+
if (this.unusedTimer) clearTimeout(this.unusedTimer);
|
|
1803
|
+
this.unusedTimer = void 0;
|
|
1804
|
+
this.otherTools = 0;
|
|
1784
1805
|
this.agent = void 0;
|
|
1785
1806
|
this.paused = false;
|
|
1786
1807
|
if (!this.visible) return;
|
|
@@ -1810,6 +1831,20 @@ var OverlayController = class {
|
|
|
1810
1831
|
this.stopping = false;
|
|
1811
1832
|
});
|
|
1812
1833
|
}
|
|
1834
|
+
/** Counted from the last computer action only: model output and other tools do not keep the overlay up. */
|
|
1835
|
+
armUnused() {
|
|
1836
|
+
this.otherTools = 0;
|
|
1837
|
+
if (this.unusedTimer) clearTimeout(this.unusedTimer);
|
|
1838
|
+
this.unusedTimer = setTimeout(() => {
|
|
1839
|
+
if (this.paused) {
|
|
1840
|
+
this.armUnused();
|
|
1841
|
+
return;
|
|
1842
|
+
}
|
|
1843
|
+
this.log("computer use not used for a while: overlay released");
|
|
1844
|
+
this.end();
|
|
1845
|
+
}, UNUSED_HIDE_MS);
|
|
1846
|
+
this.unusedTimer.unref();
|
|
1847
|
+
}
|
|
1813
1848
|
armIdle() {
|
|
1814
1849
|
if (this.idleTimer) clearTimeout(this.idleTimer);
|
|
1815
1850
|
this.idleTimer = setTimeout(() => {
|
package/lib/types/overlay.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ export declare class OverlayController {
|
|
|
51
51
|
private agent;
|
|
52
52
|
private visible;
|
|
53
53
|
private idleTimer;
|
|
54
|
+
private unusedTimer;
|
|
55
|
+
private otherTools;
|
|
54
56
|
private hostWindows;
|
|
55
57
|
private stopping;
|
|
56
58
|
/** Progress card lines: the reply as it streams, and what the agent is doing. */
|
|
@@ -100,6 +102,8 @@ export declare class OverlayController {
|
|
|
100
102
|
/** Agent finished (idle), was cancelled, or the plugin is stopping. */
|
|
101
103
|
end(agent?: CancellableAgent): Promise<void>;
|
|
102
104
|
private stop;
|
|
105
|
+
/** Counted from the last computer action only: model output and other tools do not keep the overlay up. */
|
|
106
|
+
private armUnused;
|
|
103
107
|
private armIdle;
|
|
104
108
|
/** Card: shrink the DSH window to an always-on-top corner card; minimize: get it out of the way. */
|
|
105
109
|
private shrinkHost;
|
package/package.json
CHANGED