Yu-tao-Li/dsh-computer-use-win
关于
DeepSeek Harness的Windows电脑操控插件 / Windows computer use for DeepSeek Harness
其他项目可以做什么
- Find windows, buttons and text fields - It lists open windows, then uses UI Automation (UIA, the Windows interface that lets programs read on-screen controls) to find controls and their names
- Do several known steps at once - batch runs 1–20 planned actions in order and checks each one as usual. It stops on an error, a navigation, a dialog or a new window, and observes once at the end, which saves round trips
- Look things up and fill in web pages without taking over your mouse - Pages in Chrome and Edge go through the browser lane: the plugin reads the page structure over the browser's debugging protocol and clicks or fills elements directly. Background tabs work too, without moving your mouse or bringing a window forward (see 7.4)
- Work in the browser you already have open (experimental) - Once you turn it on in the settings and click Allow in the browser, the agent can work in pages already open in your own Chrome or Edge, such as a playing video (see 7.4)
实测星标增长
- 24小时
- +13
- 7天
- +95
- 15天
- +207
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文dsh-computer-use-win
让 DSH 看懂并操作你的 Windows 桌面。
您的 Star ⭐ ↗ 就是我更新的动力,球球了,这对我很重要!如有问题,欢迎去 提 Issue ↗,您来许愿,我来实现!
简体中文
这个插件让 DeepSeek Harness(DSH)看到并操作你电脑上真实的 Windows 程序和网页:找到按钮和输入框,读出屏幕上的文字,点击、打字,切换和管理窗口。网页默认在 DSH 自己的浏览器里后台完成,不动你的鼠标,也不抢前台。
网页在后台完成 · 浮窗按步骤显示 DSH 在想什么、做什么 · 25 个操作工具 + 1 个管理入口 · 用到鼠标键盘时有明显提示 · 按 Esc 随时停止 · 中英文设置界面
目录:1 快速开始 · 2 界面预览 · 3 能做什么 · 4 工作原理 · 5 设置 · 6 使用示例 · 7 工具与进阶 · 8 常见问题 · 9 数据与隐私 · 10 文档与开发 · English
1. 快速开始
1.1 安装
你需要一台 Windows 电脑,并且已经装好 DSH Desktop。插件用的是 Windows 自带的 PowerShell 5.1,不用另外安装。
右键点击任务栏托盘里的 DSH 图标,选“打开 DSH 终端”,然后运行:
dsh plugin --profile desktop add dsh-computer-use-win再右键托盘图标,选“退出”,然后重新打开 DSH Desktop。只关掉窗口不够:窗口关了,DSH 还在托盘里运行,不会加载新装的插件。
打开 设置 → 电脑操控(鼠标图标)看看各项选项。不改也能直接用:默认一次加载全部工具。然后给 agent 布置一个桌面任务,比如第 6 节里的例子。
1.2 升级
0.6.7 起,新安装的数据随 .dsh 或 DSH_HOME 存放,已有安装继续读取旧目录。跨盘迁移步骤见插件数据目录。
DSH 启动时按 npm 的 latest 自动检查。设置 → 电脑操控 的更新入口在标题右侧。项目说明折叠时,入口位于 GitHub 链接左边。点 检查更新 会立即再查,有新版时按钮变成 更新。点 更新 后,插件用 DSH 自带的 pnpm 直接从 npm 安装这个确切版本:先连 npm 官方源,连不上时改用腾讯云或 npmmirror 镜像。整个过程不经过插件市场,发布当天就能更新。标题下方显示进度,开始替换文件前可以点 停止更新。
从 0.6.6 起,设置页的 更新 卡片(在 高级 上面)有两个开关。自动检查 默认打开:DSH 启动时查一次 npm,打开设置页时如果上次检查失败或已超过 6 小时也会再查;关掉后只在点 检查更新 时查。自动更新 默认关闭:打开后,DSH 启动时查到新版就直接安装,步骤和点 更新 一样,只是不弹确认框;装好后标题旁显示 已更新 和 重启以完成更新,重启 DSH 后新版生效。DSH 正在执行任务、插件文件夹被占用或安装失败时,这一次不安装:标题旁显示 更新失败 和 重试,下方写明原因。自动更新 要靠 DSH 交给插件的包管理器:DSH Desktop 有;命令行启动的 dsh web 没有,那里 自动更新 开关是灰的,点 更新 打开升级说明。
0.6.4 及更早版本的设置页要等插件市场收录新版本,插件市场要等新版本发布满 24 小时才收录,所以发布当天点 更新 会一直等插件市场。不想等,就在 DSH 终端运行上面的安装命令,再从托盘退出并重新打开 DSH Desktop:DSH 终端装插件不受这 24 小时限制。装好 0.6.5 或更新的版本后,以后的版本在设置页里发布当天就能更新。
从 0.6.3 起,安装完成后会弹出确认。点 立即重启,DSH Desktop 会正常退出并自动重新打开。点 稍后,标题旁会保留 重启以完成更新,可以随时重新打开确认。
从 0.6.1 或 0.6.2 升到 0.6.3 时,由旧版页面执行更新。先右键任务栏托盘里的 DSH 图标,选 退出,再打开 DSH Desktop。先别用电脑操控,直接在 设置 → 电脑操控 点 更新。如果看到 仍要更新,点它继续。装好后设置页会立即换成新版,后台仍运行旧版。这一次没有重启确认。请再次从托盘 退出 并打开 DSH Desktop,重启前先别改电脑操控设置。如果提示插件被移除,退出并打开 DSH Desktop 后可从插件市场重新安装,原来的设置会保留。
也可以运行上面的安装命令,再从托盘退出并重新打开 DSH Desktop。DSH 没给插件提供包管理器,或者插件是从本地文件夹链接的开发副本时,更新 会打开这段说明。命令里的 desktop 指 DSH Desktop 使用的配置(profile)。安装到其他 profile 时,正在用的 DSH 不会有任何变化。
1.3 其他安装方式
DSH Web、GitHub 源、单独的 MCP 客户端
DSH Web:
dsh plugin --profile web add dsh-computer-use-win
装好后重启 dsh web。用别的 profile 时,把 web 换成它的名字。也可以在插件市场搜索 dsh-computer-use-win,或者从 GitHub 安装:
dsh plugin --profile desktop add github:Yu-tao-Li/dsh-computer-use-win
不在 DSH 里,也可以让任何 MCP 客户端启动它:
{
"mcpServers": {
"wincu": {
"command": "npx",
"args": ["-y", "dsh-computer-use-win"]
}
}
}
DSH Web 和单独的 MCP 客户端会用你电脑上的 Node.js 运行插件,需要 22 或更高版本。DSH Desktop 自带运行环境,不用另装 Node.js。
单独运行时默认加载全部工具。设置环境变量 WCU_TOOL_MODE=lite 只加载常用工具,WCU_TOOL_MODE=lazy 开始时只加载管理入口。也可以在 WCU_ENABLED_TOOLS 里写一个 JSON 数组,指定允许哪些工具。设置页、对话里的操作记录和整轮提示只有在 DSH 里才有。详见工具加载说明。
2. 界面预览
下面是 DSH Desktop 2.0.18 里的真实截图(中文界面),只保留了浏览器窗口、对话或设置面板,点击图片可以看原图。设置页总览截图来自 0.6.1,其他设置截图来自 0.6.0;浏览器截图来自 0.5.2,对话截图来自更早的一次搜索任务,这两处的界面到 0.6.1 都没有变。浮窗图用的是一次真实任务的记录,由插件自己的浮窗程序重新画出来。
2.1 网页在 DSH 浏览器里操作
网页任务默认交给浏览器操控(Browser Use)。DSH 用自己的浏览器窗口工作:窗口框是 DSH 蓝,正在操作的标签页图标换成蓝色箭头,网页上一个带光晕的小箭头标出它点的位置。它通过浏览器的调试协议读网页、填表、点按钮,不移动你的鼠标,也不把窗口切到前台,你可以接着用别的程序。下图是它在后台填写一张示例报销单时的窗口(示例网页,人名是虚构的)。

2.2 对话里能看到每一步
每次桌面操作都是一行带鼠标图标的记录,比如“输入了文本”“发送了按键”“检查了操作结果”。点“查看步骤和截图”,可以看到每一步的详情和截图。

2.3 思考与操作浮窗
DSH 操作电脑时,屏幕角落有一个半透明的浮窗,按步骤显示它在想什么、做了什么。每一步一个小标题,写明这一步的操作,后面是这一步的思考文字,和对话里看到的一致。任务结束后,标题变成“已完成 · 步数 · 用时”,浮窗从回复开头显示结果,再保留 20 秒。这样你不用把 DSH 窗口拉到前面查看进度,也就不会打断它的操作。浮窗、提示条和 AI 总结的文字跟着 DSH 的界面语言走:DSH 里选了哪种语言就用哪种,没选时跟系统;目前提供中文、英文和俄文,其他语言暂时显示英文。设置页在俄文环境下仍显示英文。

浮窗默认锁定,鼠标从它上面穿过,不会挡住你或 DSH 的点击。想换位置或大小时,把光标移到右上角的锁上停一下,浮窗就会临时解锁:拖标题移动,拖边缘缩放,光标离开后自动锁回。这个按钮只认你的鼠标,通过 UU 远程等远程控制软件操作的鼠标也算;DSH 操作时移动的光标不会触发它。浮窗默认直接显示 DSH 的输出,不额外消耗 token;也可以在设置里改成“AI 总结”,让当前对话的模型每隔一段时间写一两句进度说明,这会额外消耗 token。
2.4 设置页
在左侧打开带鼠标图标的 电脑操控。标题旁显示插件版本,右侧有 检查更新 或 更新,以及 反馈问题。工作方式 可以选 少打扰(默认)、前台操作 或 虚拟机。少打扰会尽量在后台操作,要点写在它的 ⓘ 里。前台操作直接使用鼠标和键盘。虚拟机模式支持本地 Hyper-V 虚拟机、一次性 Windows 沙盒(WSB)(无需账号密码,关闭即清空,要求专业版/企业版/教育版),也可直接连接本机 VirtualBox 7.2 及以上版本中的 Windows 客机,或通过远程 Windows(WinRM,实验)连接 VMware、VirtualBox 虚拟机及另一台 Windows 电脑(Windows 家庭版也可使用)。
页面上还能调整工具加载方案、网页与浏览器、接管提示、思考与操作浮窗和停止快捷键。每项左边的小图会随设置变化,说明收在 ⓘ 图标里。顶部 Star 和 Issue 说明框的右端有 折叠,折叠后标题行只留 GitHub 链接和展开箭头,升级后也会保持这个选择。
下图取自 v0.6.1。当时还没有“工作方式”和“检查更新”,只有发现新版时才会显示“更新”。

2.5 更多截图
任务总结、自定义工具、浮窗设置、接管提示、停止设置
下面的自定义工具、浮窗、接管提示和停止设置截图取自 v0.6.0。
任务总结。 一轮操作结束后,agent 会说明自己做了什么、在结果页里确认了什么。图中的文字由这次任务用的模型生成。

自定义工具。 在“工作方式”卡片的“工具加载”里选“自定义”,会展开工具清单,默认全部勾选,可以一个个取消,也可以整组取消,勾选后立即生效。

浮窗设置。 展开“接管提示与停止”里的“更多选项”,可以选浮窗内容:默认“原文”,直接显示 DSH 的思考和输出;选“AI 总结”会额外消耗 token。再往下能调不透明度、放在哪个角、锁定开关和锁定快捷键。点右上角的“调整浮窗”会显示 60 秒的预览,直接拖动浮窗来定位置和大小。

接管提示。 agent 用鼠标键盘操作桌面时,屏幕边缘会亮起蓝色光晕,顶部或底部出现“DSH 正在控制电脑”提示条(英文界面显示英文),鼠标旁跟着一个 DSH 标签。屏幕提示和鼠标提示可以分别开关,点“预览”能在你的屏幕上试看;提示位置、文字、保留时长和远程录屏可见收在“更多选项”里。

停止设置。 默认按 Esc 停止。你也可以再录一个自己的快捷键,比如 F8。

3. 能做什么
| 你想让 agent 做的事 | 插件怎么做到 |
|---|---|
| 找到窗口、按钮和输入框 | 列出打开的窗口,再通过 UI Automation(UIA,Windows 给程序读取界面控件的接口)找到控件和它们的名字 |
| 读出界面上的文字,包括图片和自绘界面里的字 | 截图,用 Windows 自带的文字识别(OCR)找出文字和位置;小字会先放大再识别,也可以指定识别语言。界面控件很少、又没找到目标时,查找会自动改用 OCR |
| 点击、输入、填写表单 | 优先在后台直接操作控件:按下按钮、填入内容、往输入框里打字、滚动列表,都不动鼠标、不抢前台、不用剪贴板。必须用鼠标键盘的步骤(按坐标点击、粘贴、按键)只临时借用前台,做完把鼠标和前台还给你 |
| 一次做完几个确定的操作 | batch 按顺序执行 1–20 个已经规划好的动作,每一步照常检查。出错、页面跳转、弹出对话框或出现新窗口时就停下,最后只观察一次,省下来回的轮数 |
| 在浏览器里查资料、填网页,不占用你的鼠标 | Chrome 和 Edge 里的网页走浏览器通道:插件通过浏览器的调试协议直接读网页结构,按元素点击和填写。标签页在后台也能操作,不移动鼠标,也不把窗口切到前台(见 7.4) |
| 操作你已经打开的浏览器(实验性) | 在设置里打开后,你在浏览器里点“允许”,agent 就能操作你自己的 Chrome 或 Edge 里已经开着的页面,比如正在播放的视频(见 7.4) |
| 等页面变化,确认操作真的生效 | 等某个窗口、控件或文字出现,再读取或截图确认 |
| 让你看清 agent 在做什么 | 屏幕角落的思考与操作浮窗按步骤显示它的思考和操作;另外还有屏幕提示、鼠标旁的 DSH 标签、对话里的步骤记录和结束总结 |
在 DSH 对话里,每次桌面操作都写成一句好懂的话,比如“点击了目标位置”,后面标出状态:“已完成”“操作已发送,效果待确认”“未完成”或“已停止”。重新打开对话时,这些记录还在。
4. 工作原理
4.1 一次桌面任务怎么进行
agent 每一步都按“观察 → 定位 → 执行 → 确认”来做,开头那张图的下半部分画的就是这个循环:
- 观察:列出打开的窗口,读取界面控件,或者截图并识别文字。
- 定位:找到要操作的按钮、输入框或文字的位置。
- 执行:能直接操作控件就在后台直接操作,比如按下按钮、填入内容;不行再用鼠标和键盘,这时目标窗口只在这一步来到前面,做完把前台和鼠标还给你。
- 确认:等预期的变化出现,再读一次界面。没达到目标,就回到第 1 步。
插件会区分两种结果。输入类操作只返回“已发送”(verification: "sent"),因为程序收到了输入,不等于任务完成了。只有 wait_for 看到预期的窗口、控件或文字出现时,才返回“已确认”(verification: "observed")。所以布置任务时,最好写明要确认什么。
4.2 整体架构
图里蓝色的部分是本插件的代码,灰色的部分由 DSH、Windows 或浏览器提供。各部分的分工如下:
- 插件适配器(
mcp/dsh-plugin.mjs)运行在 DSH 里。它把你的设置交给 MCP 服务,并跟踪对话的轮次,保证同一时间只有一段对话在操作桌面,还把这段对话的思考和步骤交给思考与操作浮窗。 - 设置页与操作记录(
mcp/client.js)就是“设置 → 电脑操控”这一页。它也负责把对话里的工具调用显示成好懂的步骤。 - MCP 服务(
mcp/server.mjs)由 DSH 的官方 MCP 桥启动。它按你选的方案提供工具,检查参数后把请求交给后端。 - 浏览器通道(
mcp/browser.mjs)也运行在 MCP 服务里。调用带上browserTab或网页元素 ID 时,请求不经过 PowerShell 后端,而是通过 Chrome DevTools 协议直接交给浏览器。 - PowerShell 后端(
scripts/windows-uia.ps1)负责读取界面、发送输入和截图。它一直运行,所以后续调用不用每次重新启动 PowerShell。请求排队,一次只执行一个,两个操作不会同时抢鼠标和键盘。 - 接管助手(
scripts/windows-takeover.ps1)是单独的进程,负责屏幕提示和思考与操作浮窗,并直接监听 Esc。因为它不经过 DSH 和后端,后端正忙时也能收到 Esc:还没开始的操作会被取消,正在进行的输入会尽快停下。
更多细节见架构说明。
5. 按你的习惯设置
在 设置 → 电脑操控 里调整。和 DSH 自己的设置页一样,改了就生效:开关和选项点一下就生效,输入框按回车或点到别处时生效,页面底部会提示结果。页面分六块:总开关、工作方式(桌面操控和工具加载)、网页与浏览器、接管提示与停止、更新,以及最后的高级(本机识别图标和固定工作流)。右下角的 恢复默认设置 把你改过的设置都恢复成默认值,点了会先确认一次。界面跟随 DSH 的明暗主题。如果读不到设置,页面会直接说明,而不是显示一份看起来正常的默认值。
5.1 设置项
| 设置 | 可以怎么选 |
|---|---|
| 更新 | 标题右侧 GitHub 左边的按钮:平时是“检查更新”,有新版本时变成“更新”,点了才安装。设置页“高级”上面的“更新”卡片:自动检查(默认开)和 自动更新(默认关;DSH 启动时查到新版就直接装好,重启后生效)。见 1.2 |
| 反馈问题 | 保存诊断 TXT 到下载文件夹并打开 GitHub 新建问题页面,见 8.4 |
| 工具加载 | 在“工作方式”卡片里,和桌面操控并排,从下拉框里选。全部(默认,26 个);精简(12 个常用工具);懒启动(开始只加载 1 个管理工具,需要时再加载,全部工具都允许;任务里要先加载工具,会多走几步);自定义(逐个或整组勾选) |
| 桌面操控 | 默认打开。关闭后仅保留浏览器能力,隐藏桌面专属工具(launch_app、ocr、move_window)并裁剪桌面参数,不启动 PowerShell 桌面或接管辅助进程 |
| 对话开关 | 默认“不显示”。选“默认开”或“默认关”后,支持此功能的 DSH 会在输入框旁显示开关,可以只为当前对话打开或关掉桌面和浏览器操控;也可以输入 /wincu [on|off|toggle|desktop on|off|browser on|off]。选“默认关”时,之后新建的对话先不让 DSH 操控,要用时点一下开关;选它之前已有的对话不变。子智能体跟着启动它的对话走。改动立即影响当前对话的工具、提示和调用权限(WCU_DISABLED_IN_SESSION),对话里留一行中文记录。选“不显示”时,所有对话都按上面两个总开关执行,/wincu 也不出现;各对话之前的选择会保留,重新显示后恢复。 |
| 工作方式 | 在“工作方式”卡片的“桌面操控”里选。少打扰(默认):你照常用电脑,任务也不耽搁。能在后台做的都在后台做,DSH 自己打开的程序放在看不见的后台桌面里;必须用鼠标键盘的步骤马上做、只借一下,你这期间按的键和鼠标动作先存住,随后补到你的窗口;只在你按着键、拼音没上屏或在用全屏程序时等一下;前台操作:适合你暂时不用电脑时,DSH 把窗口放在最前面,直接用鼠标键盘,按 Esc 停止;虚拟机:在一台 Hyper-V 虚拟机、一次性 Windows 沙盒(WSB)、本机 VirtualBox Windows 客机或通过远程 Windows(WinRM,实验)连接的 Windows 系统(VMware、VirtualBox 虚拟机或另一台电脑,Windows 家庭版可用)里操作,不碰你本机的桌面与文件,设置页列出对应的配置或检查步骤,最前面是“推荐给 DSH 做”:一句可以直接发给 DSH 的话,让它替你检查和配置。见设置与停止 |
| 本机识别图标(实验) | 在“高级”里,默认关闭。DSH 能看到窗口、却找不到工具栏上的图标时再开:在本机用 OmniParser 识别图标,需要单独准备 Python 3.11 环境;设置步骤最前面是“推荐给 DSH 做”:一句可以直接发给 DSH 的话,让它替你准备。“检测环境”会说明 Python、依赖和模型还差什么;连不上 Hugging Face 时,按页面上的命令经镜像把模型下载到本机,插件加载前会核对每个文件的 SHA-256。见工具说明 |
| 自我学习 | 在“高级”里,默认“说了才学”:任务做完后你说“学一下”或“记住这次的做法”,DSH 把这个程序或网站里管用的做法记成一两句经验,下次在同一程序或网站里参考。选“自动学习”时,每次任务结束在本机记下用了哪些控件和操作(不记输入的文字、密码和截图),按“整理频率”(每天、每周或每 20 次任务,默认每周)用当前对话的模型整理成经验;选“关闭”则不记新经验,也不用已有的。见 6.3 |
| 浏览器操控 | 默认打开。关闭后移除 browserTab 参数与网页通道引导,不启动浏览器进程,网页调用返回 WCU_BROWSER_DISABLED |
| 优先用网页控件 | 默认打开。网页能直接读写时在后台完成,不动鼠标、不抢前台;桌面程序和读不到的网页内容再交给电脑操控 |
| 显示浏览器窗口 | 默认打开,能看到 DSH 浏览器在做什么;关掉后它在后台运行,没有窗口 |
| 浏览器 | 默认跟随 Windows 的默认浏览器,也可以选 Edge、Chrome 或 Firefox 系(实验);默认浏览器不是 Edge 或 Chrome 时,用已安装的 Chrome 或 Edge。选 Firefox 系时先用 Windows 默认的那一个,见 Firefox 系浏览器。便携版等没在 Windows 里登记的浏览器选“自定义”填路径,旁边的“检查”会按插件的方式试启动一次;见 浏览器怎么找、起不来怎么办 |
| 保留网站登录 | 默认关闭。打开后 DSH 专用浏览器改用长期保留的配置,你在它的窗口里登录过的网站,下次还是登录状态;你自己的浏览器里不用做任何设置,也不会弹出允许提示。设置页会说明怎么登录、登录存在哪、有哪些风险,见 7.4 |
| 连接现有浏览器(实验) | 默认关闭。打开后,agent 可以操作你自己已经打开的 Chrome 或 Edge。先在浏览器的 chrome://inspect/#remote-debugging(Edge 是 edge://inspect/#remote-debugging)里允许远程调试;浏览器对每个新连接问一次是否允许;连上后,这条连接在 DSH 运行期间归所有对话共用,新对话不用再连。只连“浏览器”里选中的浏览器,选“默认”时连 Windows 的默认浏览器;选 Firefox 系时不可用。见 7.4 |
| 浏览器扩展(实验) | 默认打开,在你的 Chrome 或 Edge 里装一次“dsh-computer-use-win 浏览器连接扩展”扩展后生效:agent 直接用你已登录的浏览器,不用开远程调试,浏览器也不再问“允许”,DSH 或浏览器重启后自动连上。设置页的“安装”给出步骤,装好后显示“已连接”。扩展装了但被关掉时(比如 Edge 启动时提示关闭开发人员模式扩展),卡片显示“已停用”,点“去启用”看怎么重新打开。见 7.4 |
| 屏幕提示 | 开关屏幕边缘光晕和提示条;可以改提示文字,放在顶部或底部,并设置结束后多久收起(0.2–3 秒) |
| 鼠标提示 | 单独开关鼠标旁的光斑和 DSH 标签。不会改你的系统鼠标样式,调大了的指针也会自动避开 |
| 远程与录屏可见 | 默认打开,让 UU 远程、屏幕共享和录屏也能看到提示和思考与操作浮窗,包括浮窗里模型的思考和回复。换显示器、调整布局或缩放后会自动跟上 |
| 思考与操作浮窗 | 默认打开。“锁定浮窗并穿透鼠标”默认打开,这时把光标停在浮窗右上角的锁上,就能临时解锁去拖动和缩放;点浮窗右上角 × 仅关闭当前预览或本轮窗口,不会关掉设置开关。更多选项里可以选浮窗内容(原文,即直接显示 DSH 的输出;或者 AI 总结),调不透明度、放在哪个角和锁定快捷键。“调整浮窗”会显示 60 秒的预览,直接拖动来定位置和大小 |
| 停止快捷键 | Esc 始终有效。点“再加一个停止键”,按下想用的键(比如 F8 或 Ctrl + Alt + K)就加上了;“去掉”会删掉这个额外的键,只留 Esc |
| 预览 | 点“接管提示与停止”右上角的“预览”,在屏幕上试看当前的接管提示。每项的说明收在 ⓘ 图标里,鼠标停上去或点一下就能看到 |
5.2 随时按 Esc 停止
按下 Esc 或你设的快捷键,这一轮的桌面操作和排队中的操作会立即停止,这一轮也不会自动重试。想继续时,直接发新任务或说“继续”就行,不用去设置里恢复。普通的鼠标移动和其他按键不会触发停止。即使关掉了屏幕提示,Esc 照样有效。浏览器操控、读取界面和在后台操作控件都不占用 Esc,你在别的程序里照常用 Esc。一轮操作第一次用到鼠标键盘之前,要停止它,用 DSH 里的停止按钮。
5.3 提示什么时候出现、什么时候收起
一轮操作第一次用到鼠标或键盘时出现,之后这一轮的截图、读取和短暂思考期间一直显示。只读取界面、截图、等待,或者在后台直接操作控件和网页时,不显示提示。这一轮结束、取消或出错后,按你设的时间收起。如果最后一次桌面操作后 30 秒都没有新操作,提示也会收起,下次操作时再出现。单独运行的 MCP 服务没有“轮”的概念,所以每次用到鼠标键盘的调用单独显示。
5.4 使用须知
- 能在后台操作控件时,插件会优先这样做,不动鼠标、不抢前台。按坐标点击、粘贴文字和按键还是要用真实的鼠标键盘:插件先把目标窗口提到前面,点击前检查落点没有被别的窗口挡住,做完把鼠标放回原处、把前台还给你原来的窗口。动作打开了菜单、下拉列表或对话框时,窗口留在前面;你中途换了窗口或移了鼠标,插件不再改回去。这几步进行时最好别同时动鼠标键盘。
- 前台还给你之后,不指定窗口的后续操作和截图仍对准 agent 刚操作的那个窗口,不会打进或读你正在用的窗口。DSH 粘贴的文字不进剪贴板历史(Win+V)。记事本、写字板这类原生输入框直接粘贴,粘完就恢复你原来的剪贴板;其他程序要等它把文字读走以后才恢复,一直没来读,这次的文字就留在剪贴板上,结果里会注明,以免慢一点的程序粘进你原来的内容。
- 同一时间只有一段对话能操作桌面,其他对话会收到“忙碌”的结果。
- 这几类操作,DSH 会先弹窗问你,同意后才执行:带参数启动程序、通过快捷方式启动程序、在网页里打开本机文件、把本机文件上传到网页、连接你自己已打开的浏览器、第一次操作你自己浏览器里的标签页。同意只对这一次、这组参数有效;拒绝或取消就不执行。agent 不能操作 DSH 自己的窗口,所以也没法替你点“同意”。在 DSH 的“完全权限”方案下(不弹审批),这几类操作不再询问、直接执行,因为这时 DSH 本来就允许 agent 不经确认运行任何命令;“工作区内修改”“仅可查看”等方案照常先问你。单独运行的 MCP 服务没有这个确认框,这几类操作默认拒绝,可以用环境变量放开,见安全说明。
- 在 DSH 里,截图以 PNG 文件路径交给 agent,图片数据不进对话,多截几张也不会撑满上下文。要把截图发到 IM,就让 IM 工具按这个路径发送文件。
- 已经发给程序的操作无法撤回。如果程序卡住了,要等它响应后才能停下来。
- 从别的方案切到“自定义”时,清单默认全部勾选,取消勾选不需要的工具后点“保存”才生效;已经保存为“自定义”的,页面显示你保存的清单。保存的改动在当前这一步操作结束后生效,重启后也还在。agent 不能打开你关掉的工具。
完整说明见设置与停止。
6. 使用示例
6.1 可以这样布置任务
在记事本中输入“会议纪要”,再读取文本确认写入成功。
在已打开的计算器中计算 25 × 4,并读取结果。
打开浏览器,搜索“Windows UI Automation”,确认出现搜索结果,并总结你做了什么。
打开网易云音乐,搜索“晴天”,确认结果页出现“周杰伦”。如果无障碍树看不到搜索框,用 OCR 定位可见文字。
任务里写清楚要确认什么,agent 就会去检查结果,而不是把输入发出去就结束(见 4.1)。结果也取决于目标程序、所用的模型和当前页面。
6.2 固定工作流:跑通一次,以后照着再跑
在同一个窗口里跑通一个流程,看到成功提示后,对 DSH 说“把刚才填写城市、点击保存并检查‘设置已保存’的流程存成固定工作流‘保存设置’”。插件核对最后的提示,把步骤、控件名称和预期结果写进本地 Markdown 文件,并返回路径。保存时不会再次点击保存按钮。
下次打开同一应用窗口或网页,在新对话里说“运行固定工作流‘保存设置’,这次城市填哈尔滨”。每次运行都按名称和类型重新找控件。只有自绘界面的文字步骤需要 OCR,可指定窗口内的一小块区域。控件重名、页面改变或结果不符时,工作流会停下来并说明原因。如果预期结果在操作前就已显示(比如上次留下的“已保存”),工作流也会停下,不会误判为通过。在设置页「高级 → 固定工作流」点 复制示例 可以复制一句示例指令,也可以直接问 DSH“列出本机的固定工作流”。
6.3 自我学习:越用越熟
默认是“说了才学”。一件事做成了、你觉得这次的做法值得记住时,在同一对话里说“学一下”或“记住这次的做法”。DSH 会把这个程序(按程序文件名,比如 WeChat)或网站(按域名,比如 github.com)里管用的做法写成一两句经验,比如“发消息前先找到输入框再填写,不要按坐标点击”,也可以记下要避免的做法。
以后 DSH 在新一轮对话里第一次查看同一程序或网站时,会拿到它最有用的几条经验,每轮一次、最多三条;在别的程序里不多占上下文。每条经验记着用过几次、几次顺利:照着做的那一轮失败了就往后排,连续三次失败就停用。
选“自动学习”后,每次用到电脑操控的任务结束时,插件在本机记下用了哪些控件、怎么操作、有没有出错、是否被你停下。不记你输入的文字、密码、网页内容和截图,这一步也不调用模型。到了“整理频率”并且攒够记录(每天或每周至少 5 次任务;或者每 20 次任务),下一次任务结束后用当前对话的模型整理一次:写下新的经验,停用被记录推翻的自动经验。设置页的“立即整理”可以马上整理。
在“高级”里点“查看”,能看到每条经验,可以重新启用或删除。经验和记录只存在本机 %USERPROFILE%\.dsh\dsh-computer-use-win\experience。固定工作流是一步不差照着重跑的流程,经验是做类似的事时参考的提示,两者可以同时用。
7. 工具与进阶
7.1 工具清单
一共 25 个操作工具和 1 个管理入口。下表用的是短名;完整名字是 windows_computer_use_<短名>,在 DSH 里通常还会加上 mcp__wincu__ 前缀。
| 用途 | 工具 |
|---|---|
| 检查连接、找窗口 | health · list_windows |
| 读取界面控件(UIA) | snapshot · accessibility_tree · find · element_info |
| 截图和文字识别 | screenshot · ocr |
| 鼠标 | click · double_click · move · drag · scroll |
| 输入文字、操作控件 | type_text · keypress · focus · invoke · set_value |
| 打开程序、管理窗口 | launch_app · activate_window · move_window · close_window |
| 等待和确认 | wait_for · wait |
| 批量执行已规划动作 | batch |
| 管理工具 | tools |
launch_app 通过 Windows 桌面(资源管理器)启动程序,所以程序在工具调用结束后照常运行。cmd、PowerShell 这类命令解释器和脚本宿主只能不带参数启动,命令请交给 DSH 自己的命令行工具。
batch 一次执行 1–20 个已经规划好的动作,比如点击、输入、选择、按键和滚动,对象是同一个窗口或同一个浏览器标签页。每一步照常经过设置里的工具开关、Esc 停止和落点检查。出错或输入没能确认时就停下。页面跳转、弹出对话框、出现新窗口或目标关闭时,如果后面还有步骤就停下;如果是最后一步引起的,就算整批完成,结果里的 afterLastStep 写明发生了什么,比如填完表点提交后跳到了下一页。返回每一步的结果,最后观察一次。
7.2 精简方案与管理入口
精简方案包含 list_windows、find、click、scroll、type_text、keypress、ocr、screenshot、wait_for、launch_app、batch 和 tools。
有了管理入口 tools,agent 可以查看某个工具的说明,也可以临时卸载或重新加载你允许的工具;reset 会恢复你保存的启动方案。卸载工具不会删掉对话里已有的说明和结果。
7.3 使用建议
能用 UIA 找到控件时,用 invoke / set_value 直接操作,它们在后台完成;invoke 的 action 还能展开、折叠控件,或把它滚到可见处,scroll 给元素 ID 时也先在后台滚动。Excel 功能区这类连续按键(比如依次按 Alt、H、O、W 打开“列宽”),用一次 keypress 加 thenKeys 发完,中间不会把前台还回去。UIA 找不到,或者只找到很少的控件时,用 OCR 读屏幕上的文字;图标和布局交给能看图的模型读截图。OCR 只返回文字和屏幕坐标,不会编造控件 ID。窗口移动或控件变化后,要重新观察。
先 set_value 再在同一个框里按 Enter(比如搜索框、地址栏)时,不带窗口目标的 keypress 会发到 DSH 这一轮刚操作过的窗口。set_value 会不会把焦点移进这个框,要看程序:Chromium 会,Win32 编辑框不会,所以先 focus 这个框最稳。按键和输入的结果里有 deliveredTo,写明键实际到了哪个窗口、哪个控件;这一轮还没操作过窗口又没给目标时,键会落到前台窗口,结果标为 unconfirmed。list_windows 也列出最小化的窗口(minimized: true),窗口数超过 maxWindows 时标 truncated。activate_window 会先恢复最小化的窗口,结果里标 restored: true,window 是调用之后的窗口。最小化的窗口截图只能拍到标题栏那一小条,结果会标 minimized: true,提示先恢复它。ocr 带 query 时只返回命中的那几行,不再附上全部文字和每个词的坐标。
Electron 程序、Chrome 和 Edge 都用 Chromium 内核。这类程序要等有程序来读网页,才会生成网页里的控件。所以插件第一次读这类窗口时,会先替它打开网页的控件树,一般不到半秒就能读到网页里的按钮和输入框。结果里的 webContent 说明网页是否就绪;如果显示 starting,稍等再读一次。
完整参数与返回值 · 按需加载与客户端兼容性 · 不同应用的技术差异
7.4 浏览器通道
处理网页时,插件可以不看截图、不动鼠标:它通过 Chrome DevTools 协议(CDP)直接读网页的结构,再按元素点击、填写和选择。这些操作都在浏览器内部完成,不移动你的鼠标,不用剪贴板,也不把窗口切到前台,放在后台的标签页同样可以操作。浏览器操控没有新增工具,只多了一个 browserTab 参数和网页元素 ID:
list_windows的结果里有browserLane,列出已连接浏览器的标签页。每个标签页有一个 ID,例如t1a2b。- 把这个 ID 作为
browserTab传给snapshot、accessibility_tree、find、type_text、keypress、scroll、screenshot或wait_for,就是在读或操作这个网页。网页里的每个元素都带 ID,例如t1a2b:57,可以直接交给click、set_value、focus、invoke、scroll和element_info。每次操作后,结果里会附上页面发生的变化。元素 ID 只对读到它的那个页面有效:页面跳转后要重新读;插件服务重启后,标签页 ID 也会换,要先调用list_windows。 - 用
set_value往t1a2b:address写一个网址,这个标签页就会打开它;往new-tab写网址,会在后台新开一个标签页。
浏览器有四种来源:
- agent 浏览器(默认):第一次用
new-tab时,插件在后台创建一个可见但不抢前台的浏览器窗口。用哪个浏览器可以在设置里选,默认跟随 Windows 的默认浏览器;默认浏览器不是 Edge 或 Chrome 时,用已安装的 Chrome 或 Edge;也可以选 Firefox 系,这是实验功能,在后台运行,见 Firefox 系浏览器。它每次都从新的临时配置开始,标签页放在单独的隔离环境里,看不到你的 Cookie、登录状态和浏览记录。插件进程退出时它跟着退出,无头模式空闲 10 分钟、可见窗口空闲 2 小时后会自动关闭;导航、标题变化和对话框也计入活动。如果用的是 Edge,Edge 会自动把这个临时配置登录到 Windows 的微软账户;agent 的标签页留在隔离环境里,用不到这个登录状态,窗口上也不显示账户;临时配置在浏览器关闭后删除。在设置里关掉“显示浏览器窗口”,它就在后台运行,没有窗口。浏览器操控不显示屏幕边缘和鼠标标签。 - 保留网站登录:需要登录的任务,可以在设置里打开“保留网站登录”,默认关闭。打开后,DSH 专用浏览器不再每次用临时配置,而是给每个浏览器保留一个配置(
%USERPROFILE%\.dsh\dsh-computer-use-win\agent-browser下的kept-edge、kept-chrome):你在它的窗口(蓝框)里登录过的网站,之后的任务里还是登录状态,没勾“记住我”的网站也一样。第一次用到要登录的网站时,agent 会请你在这个窗口里登录一次,密码和验证码由你自己输入。你自己的浏览器始终不碰,不用开远程调试,也不会弹出允许提示。用 Edge 时,Edge 会自动用 Windows 上的微软账户登录这个配置,微软自家的网站直接是登录状态;不想这样就选 Chrome。关掉开关后登录仍然保留;要全部清除,退出 DSH 后删除上面的文件夹。风险:DSH 会以你的身份操作你在这里登录过的网站;网页上的文字可能诱导 agent;0.6.0 通过命名管道通信,不开启本地调试端口,但登录保存在该配置文件夹中,同账户下的本机其他程序仍可读取使用。 - 连接现有浏览器(实验):默认关闭。打开后,
list_windows只读取浏览器写下的DevToolsActivePort文件,把你的浏览器列为“可以连接”,并给出"<浏览器 ID>:connect"入口,这时既不连接,也不会弹出提示。agent 会先请你准备在浏览器里点“允许”,再用set_value往这个入口写connect,浏览器这时才问你是否允许。被拒绝或超时就停下,不自动重试,列表里会标出“未获允许”或“已超时”,所以提示不会叠在一起。连上一次,这条连接在 DSH 运行期间归所有对话共用:之后的对话里,列表直接标出已连接,agent 不再连接,也不再请你允许。DSH 或浏览器重启、在浏览器里停止调试、改了工具、浏览器或运行位置的设置、更新插件以后要重新连接,浏览器会再问一次;这个确认是浏览器按连接问的,插件没法替你记住。连上以后,你自己标签页的网址会去掉?后面的参数和#片段;agent 只操作你提到的标签页和它自己打开的标签页,发送、购买、删除或改账户设置之前会先问你。断开时只断开连接,不关你的浏览器。连接期间,浏览器顶部会显示受自动测试软件控制的提示。 - 浏览器扩展(实验)。在 Windows 版 DSH Desktop 安装「电脑操控」(
dsh-computer-use-win0.6.6 及以上),再把配套扩展dsh-computer-use-win 浏览器连接扩展装入 Chrome 或 Edge。从 Microsoft Edge 加载项商店安装的扩展需要桌面插件 0.6.7 及以上版本。以后每次打开浏览器或重启 DSH,扩展都会自动连接。DSH 为任务新开的标签页可以直接使用。要使用你已有的标签页,在那一页打开扩展,核对网站后点“允许操作此标签页”。同一连接内重复操作该页的同一来源只需同意一次。关闭标签页、切换来源、停止或断开都会清除相应授权。DSH 操作网页时,浏览器会在地址栏下方显示调试提示,网页里的蓝色指针标出操作位置。点浏览器提示栏的“取消”,或在工具栏打开扩展后点“停止”,即可停止本轮浏览器操作。“允许 DSH 控制这个浏览器”开关可以暂停连接。扩展支持跨站框架、对话框和截图,上传文件由你在文件选择窗口中选取。安装步骤在 DSH 设置的“网页与浏览器”中。商店条目公开前,按设置页提示在浏览器的扩展管理页打开开发者模式并加载指定文件夹。 - 查找网页和下载文件。在扩展菜单点「查找网页和下载文件」,选择书签、历史记录、最近关闭、常用站点或下载。首次使用一个来源时由浏览器询问权限。搭配桌面插件 0.6.7,你也可以直接请 DSH 查找,在扩展菜单点「查看 DSH 的搜索请求」,预览后勾选要分享的项目。下载搜索能显示实际文件名和位置。侧栏和网页右键入口可在「浏览器快捷入口」中打开。
- 已有开发版扩展的升级。从桌面插件 0.6.6 升级后,在浏览器工具栏打开连接扩展,查看新增的标签分组、侧栏和断线重连权限,点「应用扩展更新」。网页操控正在进行时,等任务结束再点。首次安装完整版可直接使用。
Chromium 浏览器通道支持同源、跨源和嵌套 iframe;元素 ID 绑定 frame 与文档,导航或卸载后失效。传入 browserTab 时,坐标使用当前页面截图的 CSS 视口像素,可操作 canvas;不会移动桌面鼠标。显示浏览器窗口时,Chrome 自己的 JavaScript 弹窗(alert、confirm 这类)有时会短暂切到前台。Ctrl+L、Ctrl+T 这类快捷键属于浏览器窗口,网页内部收不到,请改用 address、new-tab 和 close_window。环境变量和返回格式见 MCP 工具文档。
7.5 少读一点,省上下文
懒启动对 Windows 控件树、快照的文字部分和 OCR 默认使用 64 KiB 字节预算。可用 maxBytes 调整。树和快照也可用 detailLevel:"full" 取消默认预算。
- 精简树。 Windows 界面上的
accessibility_tree和snapshot支持detailLevel:"summary",每个节点只保留 ID、控件类型、名称和状态。 - 给树设字节预算。 这两个工具的
maxBytes最小为 2,000,限制返回的 UTF-8 JSON 大小,截图另算。超出时先转为精简树,再只留可操作控件和它们的祖先,最后按层截断。截断时从budget.fullResultPath读取完整结果。如果剩余内容仍放不下,结果会给出文件路径。 - 重读时只要变化。 用
accessibility_tree传treeDeltaBase:"start"取得树和treeId。重读同一目标时,把这个 ID 传给treeDeltaBase,就会收到新增、删除和变化的控件,以及新的treeId。要比较控件的值,用detailLevel:"full"。找不到基准、窗口或视图参数变了、任一树被截断,或变化超过 40% 时,会退回树结果并说明delta.fallback的原因。增量本身超出maxBytes也会回退,再按预算缩减。预算缩减后的树不能作为增量基准。 - 给 OCR 设预算。
ocr的maxBytes同样从 2,000 起。超出时先省掉逐词坐标,再省掉与逐行结果重复的合并文本,最后从末尾截行。截断或仅返回文件时,budget.fullResultPath指向完整结果。
Windows UI Automation 的树与快照在顶层返回 countedDepth(计入 maxDepth 的最大层数)和 structuralDepth(从根算起的最大实际层数),两个数描述的是后端读到的那棵树,也就是精简、截断或算增量之前的树。
只想确认某个控件有没有变化,用 find 定点查找,或用 wait_for 等待目标状态。参数与返回值见 MCP 工具说明。
8. 常见问题
8.1 装好了,却看不到工具或设置页,或者还是旧版本?
最常见的原因是 DSH Desktop 没有完全重启:只关窗口时,DSH 还在托盘里运行旧版插件。请右键托盘图标选“退出”,再重新打开。
也要确认插件装到了 DSH 正在用的 profile。版本号可以在 MCP 返回的 initialize.serverInfo.version 里看;选“全部”方案时,也可以让 agent 调用 health 检查连接。同一个 profile 里只应有一个 serverName: wincu 服务。如果旧版本留下过重复的手动配置,先备份,再按升级说明处理。
保存设置后,DSH 会在 profile 的 cordis.patch.yml 里写一条 id: mcp-dsh-computer-use-win 的记录,里面就是你的设置。这条记录是正常的,不要删。选了“精简”或“懒启动”时,不在方案里的工具(比如 health)本来就不会出现,直接调用会显示 unknown tool。让 agent 调用管理入口 windows_computer_use_tools({"operation":"list"}),就能看到哪些工具已经加载、哪些还能加载。如果保存的设置里有这个版本不认识的值,比如换过版本以后,插件会对这一项改用默认值、照常加载,并在 tools 列表的 notices 和 health 里写明改了哪一项。
提交问题时,请附上 DSH Desktop、dsh 内核和插件的版本号,以及去掉隐私后的报错文字。
8.2 为什么点击或输入没有反应?
先看目标窗口有没有被挡住、程序是不是卡住了。按坐标点击时,落点露出的是别的窗口(比如通知)就不会点下去,结果会说出挡住它的窗口(POINT_COVERED);结果里的 foreground 和 pointer 说明这一步有没有借用前台、有没有还回去。Chromium、Electron 和部分 WinUI 程序会忽略后台输入,所以优先用 UIA 操作,或者先把目标窗口切到前台再输入,然后看看实际效果。当目标窗口的 Windows 完整性级别高于插件输入进程时,插件会拒绝操作并返回 ELEVATED_TARGET_DENIED。无法核验目标时会返回 INPUT_TARGET_ACCESS_UNCONFIRMED。UAC 确认仍由用户自行操作。插件还需要一个正常可用的桌面会话。
8.3 支持 PowerShell 7、其他系统,或者自带看图模型吗?
只支持 Windows。DSH 也可以跑在 WSL 里(比如在 WSL 里运行 dsh web):插件经 WSL 互操作调用 Windows 的 PowerShell,操作的仍是 Windows 桌面,前提是 WSL 里能启动 Windows 程序(能运行 powershell.exe)。默认用 PowerShell 5.1,它的文字识别(WinRT OCR)经过了真实测试。自动测试同时覆盖 PowerShell 5.1 和 7:在 7 上,界面读取和截图有真实测试,但文字识别只测了协议,所以还不能保证 7 上的文字识别可用。
启用「在本机识别图标控件」后,控件不足的窗口会自动补充 OCR 文字和图标。要查找没有文字的“撤销”等按钮,可对目标窗口调用 snapshot,传入 vision: true 和 includeScreenshot: false,按 vision.candidates 中的名称选择 ID,再调用 click。模型可使用本机 CPU 或 GPU,完整权重约 1.4 GB。视觉识别说明
8.4 遇到问题怎么反馈?
在 设置 → 电脑操控 标题右侧点“反馈问题”。插件会把 wincu-diagnostics-日期-时间.txt 存到下载文件夹,在资源管理器里选中它,并用系统默认浏览器打开 GitHub 新建问题页面。页面同时提示文件名和保存位置。下载文件夹写不进去时,会弹出“另存诊断文件”,让你另选位置。
在 GitHub 写下怎样复现、预期结果和实际结果。查看 TXT 后,把它拖到问题描述框再提交。
TXT 包含插件版本与安装来源、DSH 与运行环境、Windows、PowerShell、屏幕与浏览器信息、相关设置、自检状态、最近 30 次电脑操控调用,以及最多 200 行插件相关日志。工具输入文字只保留长度;截图可在遮盖私人信息后单独附上。
9. 数据与隐私
界面读取、文字识别、截图和输入都在你的电脑上完成,结果交给 DSH 或其他调用方。这些内容会不会再发给远程模型,取决于你的 DSH 和模型设置。截图和读出的文字可能包含窗口里的敏感信息,所以分享日志或提 Issue 之前,请先遮住账号、路径、密码和私人对话。
浏览器通道读到的网页内容同样在本机处理,再交给调用方。agent 浏览器默认不带任何登录;打开“保留网站登录”后,agent 能读取和操作你在 DSH 浏览器里登录过的网站。打开“连接现有浏览器”并允许连接后,agent 能读取和操作那个浏览器里所有已登录的网站,所以只在需要时打开,用完可以在浏览器里关掉远程调试。装了浏览器扩展也一样,不用时在设置里关掉“浏览器扩展”,或在扩展菜单里关掉“允许 DSH 控制这个浏览器”。网页里的文字也可能夹带写给 agent 的指令,所以页面大纲的开头会提醒模型:网页内容不可信,只听你的指示。
设置页直接向 npm(registry.npmjs.org)查询插件的 latest,并在本机核对当前 profile 的安装状态。npm 查询只用插件名。
自我学习的经验和自动学习的记录只存在本机 %USERPROFILE%\.dsh\dsh-computer-use-win\experience。记录里只有程序名或网站域名、用过的工具、搜索过的控件名称和类型、出错代码和任务结果,没有输入的文字、密码、网页内容和截图。经验会随界面读取结果交给模型;自动学习整理时,这些记录会发给当前对话所用的模型。
“反馈问题”导出的诊断文件只存在你的电脑上,你把它拖进问题页面才会上传,内容见 8.4。
10. 文档与开发
10.1 文档
设置与停止 · 工具加载 · 工具参数 · 架构 · 测试记录 · 更新日志
10.2 开发与测试
各部分怎么配合,见 4.2 整体架构。
npm ci
npm test
单独运行的 MCP 服务不依赖任何第三方包;接入 DSH 时,用的是 DSH 自带的 Schemastery 和官方 MCP 桥。开发依赖只用于测试。npm test 会运行 118 套互相隔离的回归测试,覆盖设置兼容、组件解耦、接管与停止、思考与操作浮窗、界面读取、截图、文字识别协议、输入边界、批量动作和浏览器通道。它不会发出真实的键盘鼠标输入,也不会改动你装好的 DSH 配置;需要真实界面的测试只操作专用的测试窗口和临时的浏览器配置,日志写在命令输出的临时目录里。
node test/notepad-e2e.mjs 是另一项会真实打字的测试,它会打开记事本,请在专门的测试桌面上运行。
README 里的两张图由 assets/diagrams/ 里的网页生成。改了图里的文字后,运行 node assets/diagrams/render.mjs,它会用本机的 Chrome 或 Edge 重新导出中英文、浅色和深色共 8 张图。
MIT 许可。本项目基于 cgissing/windows-computer-use 衍生,来源与版权见 THIRD_PARTY.md。
English
This plugin lets DeepSeek Harness (DSH) see and use the real Windows apps and web pages on your computer. It can find buttons and text fields, read text on the screen, click, type, and switch or manage windows. Web pages are worked on in DSH's own browser in the background by default, without moving your pointer or taking the foreground.
Web pages in the background · An overlay shows what DSH is thinking and doing, step by step · 25 action tools + 1 management entry · Clear indicators when the mouse or keyboard is used · Press Esc to stop at any time · Chinese and English settings
Contents: 1 Quick start · 2 Interface tour · 3 What it can do · 4 How it works · 5 Settings · 6 Try a task · 7 Tools · 8 FAQ · 9 Privacy · 10 Development · 简体中文
1. Quick start
1.1 Install
You need a Windows computer with DSH Desktop installed. The plugin uses Windows PowerShell 5.1, which comes with Windows, so there is nothing else to install.
Right-click the DSH icon in the taskbar tray, choose Open DSH Terminal, and run:
dsh plugin --profile desktop add dsh-computer-use-winRight-click the tray icon again, choose Quit, then open DSH Desktop again. Closing the window is not enough: DSH keeps running in the tray and does not load the new plugin.
Open Settings → Computer Use (the mouse icon; 电脑操控 in the Chinese interface) to look around. You don't have to change anything: by default all tools load at once. Then give the agent a desktop task, such as one from section 6.
1.2 Upgrade
From 0.6.7, fresh installs keep plugin data in the DSH home. Upgrades keep using existing data. See Plugin data folder to move it to another drive.
DSH checks npm’s latest at startup. In Settings → Computer Use, the update button is at the top right, to the left of the GitHub link when the project note is folded. Click Check for updates to check again immediately. When a release is available, click Update. Update then has the plugin install that exact version straight from npm with DSH’s own pnpm: from the official npm registry, or from the Tencent Cloud or npmmirror mirror when the registry cannot be reached. The plugin market is not involved, so you can update on release day. Progress appears below the title, and Stop update is available until file replacement starts.
From 0.6.6, the Updates card, just above Advanced on the settings page, has two switches. Auto-check is on by default: DSH asks npm once at startup, and opening the settings page asks again after a failed check or one older than six hours; turned off, the plugin asks only when you click Check for updates. Auto-update is off by default: when on, a new version found at startup is installed right away, through the same steps as Update but without the dialog. The title then shows Updated and Restart to finish, and the new version runs after DSH restarts. If a DSH task is running, the plugin folder is in use, or the install fails, nothing is installed that time: the title shows Update failed and Retry, with the reason below. Auto-update needs the package manager DSH hands the plugin: DSH Desktop provides it; a dsh web started from the command line does not: there the Auto-update switch is locked, and Update opens the upgrade steps.
The settings page of 0.6.4 and earlier waits for the plugin market to list the new version, and the market lists a release only 24 hours after it is published, so on release day Update keeps waiting for the market. To skip the wait, run the install command above in the DSH terminal, then quit from the tray and reopen DSH Desktop: plugins installed from the DSH terminal are not held for 24 hours. Once 0.6.5 or later is installed, later releases update from the settings page on the day they are published.
Starting with 0.6.3, a confirmation appears when installation finishes. Restart now quits DSH Desktop normally and opens it again. Choose Later to keep working. Restart to finish stays beside the title and lets you reopen the confirmation any time.
Upgrading from 0.6.1 or 0.6.2 to 0.6.3 uses the old settings page. Right-click the DSH icon in the taskbar tray, choose Quit, and open DSH Desktop again. Go straight to Settings → Computer Use and click Update before using computer use. If offered Update anyway, click it to continue. After installation, the settings page switches to the new version immediately, while DSH still runs the old version in the background. This upgrade has no restart confirmation. Choose Quit from the tray again, reopen DSH Desktop, and leave the Computer Use settings alone until it restarts. If the plugin is reported as removed, quit and reopen DSH Desktop, then reinstall it from the plugin market. Your previous settings are kept.
You can also run the install command above, then quit from the tray and reopen DSH Desktop. When DSH gives the plugin no package manager, or the plugin is a linked working copy, Update opens these instructions. desktop in the command is the profile DSH Desktop uses. Installing into another profile leaves the DSH you’re using unchanged.
1.3 Other ways to install
DSH Web, GitHub, standalone MCP clients
For DSH Web:
dsh plugin --profile web add dsh-computer-use-win
Restart dsh web after installing. If you use another profile, replace web with its name. You can also search the plugin marketplace for dsh-computer-use-win, or install from GitHub:
dsh plugin --profile desktop add github:Yu-tao-Li/dsh-computer-use-win
Outside DSH, any MCP client can launch it:
{
"mcpServers": {
"wincu": {
"command": "npx",
"args": ["-y", "dsh-computer-use-win"]
}
}
}
DSH Web and standalone MCP clients run the plugin with the Node.js on your computer, which must be version 22 or later. DSH Desktop brings its own runtime, so it needs no separate Node.js.
Run on its own, the server loads all tools by default. Set WCU_TOOL_MODE=lite to load only the common tools, or WCU_TOOL_MODE=lazy to start with just the management entry. You can also list the allowed tools as a JSON array in WCU_ENABLED_TOOLS. The settings page, the action records in conversations and the turn-wide indicators exist only inside DSH. See tool loading for details.
2. Interface tour
These are real screenshots from DSH Desktop 2.0.18, with the Chinese interface. Each image shows only the browser window, the conversation or the settings panel; click one to see it at full size. The settings overview comes from 0.6.1 and the other settings screenshots from 0.6.0. The browser screenshot comes from 0.5.2 and the conversation screenshots from an earlier search task; neither part of the interface has changed since. The overlay images replay the record of a real task through the plugin's own overlay code.
2.1 Web pages are worked on in the DSH browser
Web tasks go to Browser Use by default. DSH works in a browser window of its own: the window frame is DSH blue, the tab it works in shows a blue arrow as its icon, and a small glowing arrow on the page marks where it clicks. It reads pages, fills in forms and presses buttons through the browser's debugging protocol, without moving your pointer or bringing the window to the front, so you can keep using other apps. The screenshot shows the window while it filled in a sample expense form in the background (a demo page; the name is made up).

2.2 Every step shows up in the conversation
Each desktop action is a row with a mouse icon, such as “Entered text”, “Sent a key press” or “Checked the result” (the screenshot shows the Chinese labels). Click Steps and screenshots to see the details and screenshots of each step.

2.3 Reasoning and progress overlay
While DSH works on the computer, a translucent overlay in a corner of the screen shows what it is thinking and doing, step by step. Each step gets a heading with its action, followed by the reasoning for that step, the same text you see in the conversation. When the task ends, the heading shows that it is done, with the number of steps and the time taken, and the overlay shows the reply from its start for another 20 seconds. So you never have to bring the DSH window to the front to check on progress, which would interrupt the work. The overlay, the indicator bar and the AI summary use the DSH interface language: the language chosen in DSH, or the system's when none is chosen. Chinese, English and Russian are available for the overlay, indicator and AI summary. Other languages show English. The settings page still uses English for Russian.

The overlay is locked by default, so the mouse passes through it and it never blocks a click by you or by DSH. To move or resize it, rest the pointer on the padlock in its top-right corner: the overlay unlocks for a moment, you can drag the title or the edges, and it locks again after the pointer leaves. Only your mouse unlocks it, including a mouse you use through a remote-control tool such as UU Remote; the pointer DSH moves never does. By default the overlay shows DSH's own output and costs no extra tokens. You can switch it to AI summary in the settings; the conversation's model then writes a sentence or two about the progress every so often, which uses extra tokens.
2.4 Settings page
Open Computer Use, the mouse-icon tab on the left (电脑操控 in the Chinese interface). The plugin version is beside the title, with Check for updates or Update and Report a problem on the right. Work mode offers Low disruption (the default), Foreground, and Virtual machine. Low disruption works in the background where possible; its ⓘ gives the key points. Foreground uses the mouse and keyboard directly. Virtual machine mode works inside a configured Hyper-V VM, an ephemeral Windows Sandbox (WSB) (no credentials needed, resets on close; requires Pro, Enterprise, or Education), a local Windows guest in VirtualBox 7.2 or later, or over Remote Windows (WinRM, experimental) to VMware, VirtualBox, or another Windows PC (including from Windows Home).
The page also lets you choose which tools load and adjust browser options, the takeover indicator, the reasoning and progress overlay, and the stop shortcut. The small illustration beside each setting reflects your selection. Open the ⓘ icon for an explanation. Collapse at the right end of the Star and Issue note hides it, leaving a GitHub link and an expand arrow in the title row. Your choice survives upgrades.
The screenshot below is from v0.6.1. Work mode and Check for updates had yet to be added. Update appeared only when a newer version was available.

2.5 More screenshots
Task summary, custom tools, overlay settings, control indicators, stop settings
The Custom tools, overlay, control indicator and stop settings screenshots below are from v0.6.0.
Task summary. When a turn ends, the agent explains what it did and what it confirmed on the results page. The text in this image was written by the model used for the task.

Custom tools. Choosing Custom for Tool loading in the Work mode card opens the tool list with every tool checked; untick tools one by one or a whole group at once, and each change applies at once.

Overlay settings. Under More options in Takeover cues and stopping you choose the overlay content: Source (DSH's own reasoning and output) by default, or AI summary, which uses extra tokens. Further down are the opacity, the corner it sits in, the lock switch and the lock shortcut. Adjust overlay at the top right shows a 60-second preview, so you can drag the overlay to the place and size you want.

Control indicators. While the agent uses the mouse or keyboard on the desktop, a blue glow lines the screen edges, a “DSH is controlling your computer” bar appears at the top or bottom (in Chinese when DSH is set to Chinese), and a DSH tag follows the pointer. The screen and pointer indicators have their own switches, and Preview shows them on your screen. Placement, text, how long they stay and remote visibility are under More options.

Stop settings. Esc stops the agent by default. You can also record your own shortcut, such as F8.

3. What it can do
| What you want the agent to do | How the plugin does it |
|---|---|
| Find windows, buttons and text fields | It lists open windows, then uses UI Automation (UIA, the Windows interface that lets programs read on-screen controls) to find controls and their names |
| Read text on screen, including text in images and custom-drawn apps | It takes a screenshot and uses the built-in Windows text recognition (OCR) to find words and their positions; small text is enlarged before it is read, and the recognition language can be chosen. When an app exposes few controls and a search finds nothing, the search switches to OCR by itself |
| Click, type and fill in forms | It operates controls directly in the background when it can: pressing buttons, filling in fields, typing into text boxes and scrolling lists move neither your mouse nor the foreground and leave the clipboard alone. Steps that need the real mouse and keyboard (clicks at screen positions, pastes, key presses) only borrow the foreground, and give the mouse and the foreground back afterwards |
| Do several known steps at once | batch runs 1–20 planned actions in order and checks each one as usual. It stops on an error, a navigation, a dialog or a new window, and observes once at the end, which saves round trips |
| Look things up and fill in web pages without taking over your mouse | Pages in Chrome and Edge go through the browser lane: the plugin reads the page structure over the browser's debugging protocol and clicks or fills elements directly. Background tabs work too, without moving your mouse or bringing a window forward (see 7.4) |
| Work in the browser you already have open (experimental) | Once you turn it on in the settings and click Allow in the browser, the agent can work in pages already open in your own Chrome or Edge, such as a playing video (see 7.4) |
| Wait for changes and check that an action worked | It waits for a window, control or piece of text to appear, then reads or captures the screen to confirm |
| Show you what the agent is doing | The reasoning and progress overlay in a screen corner shows its reasoning and actions step by step; there are also screen indicators, the DSH tag next to the pointer, step records in the conversation and a summary at the end |
In a DSH conversation, each desktop action reads as a short sentence, such as “Clicked the target”, followed by its status: “Completed”, “Input sent; effect unconfirmed”, “Incomplete” or “Stopped”. The records are still there when you reopen the conversation.
4. How it works
4.1 How a desktop task runs
The agent takes every step as look → locate → act → confirm. The lower half of the first figure shows this loop:
- Look: list the open windows, read the controls, or take a screenshot and recognize the text.
- Locate: find the button, text field or piece of text to work on.
- Act: operate the control directly in the background when possible, such as pressing a button or filling in a field; otherwise use the mouse and keyboard, with the target window in front for that step only and the foreground and mouse given back afterwards.
- Confirm: wait for the expected change and read the screen again. If the goal is not met yet, go back to step 1.
The plugin keeps two kinds of result apart. Input actions only report “sent” (verification: "sent"), because an app receiving input does not mean the task is done. Only wait_for reports “observed” (verification: "observed"), when the expected window, control or text actually appears. So when you give a task, say what should be checked.
4.2 Architecture
The blue parts are this plugin's code, and the grey parts come from DSH, Windows or the browser. Here is what each part does:
- The plugin adapter (
mcp/dsh-plugin.mjs) runs inside DSH. It passes your settings to the MCP server and tracks conversation turns, so only one conversation uses the desktop at a time. It also hands the conversation's reasoning and steps to the overlay. - The settings page and step records (
mcp/client.js) are the Settings → Computer Use page. The same file turns the tool calls in a conversation into readable steps. - The MCP server (
mcp/server.mjs) is started by DSH's official MCP bridge. It offers the tools of your preset, checks the arguments and passes each request to the backend. - The browser lane (
mcp/browser.mjs) also runs in the MCP server. When a call carriesbrowserTabor a page element ID, it skips the PowerShell backend and goes straight to the browser over the Chrome DevTools Protocol. - The PowerShell backend (
scripts/windows-uia.ps1) reads the screen, sends input and takes screenshots. It stays running, so later calls skip PowerShell startup. Requests wait in a queue and run one at a time, so two actions never fight over the mouse and keyboard. - The takeover helper (
scripts/windows-takeover.ps1) is a separate process that draws the indicators and the reasoning and progress overlay, and listens for Esc itself. Because it goes through neither DSH nor the backend, it hears Esc even while the backend is busy: actions that have not started are cancelled, and input in progress stops as soon as it can.
See the architecture notes for more detail.
5. Make it yours
Change these in Settings → Computer Use. As on DSH's own settings pages, a change applies as you make it: switches and choices at once, typed values when you press Enter or leave the field, and a note at the bottom shows the result. The page has six parts: Main switches, Work mode (Desktop and Tool loading), Web and browser, Takeover cues and stopping, Updates, and Advanced (local icon recognition and saved workflows) at the end. Restore defaults at the bottom right returns every setting you changed to its default, after one confirmation. The page follows DSH's light or dark theme. If the settings cannot be read, the page says so instead of showing defaults that look valid.
5.1 Settings
| Setting | Your choices |
|---|---|
| Update | The button left of the GitHub link at the top right: Check for updates, or Update when a newer version exists, which installs it only when clicked. The Updates card, above Advanced: Auto-check (on by default) and Auto-update (off by default; installs a new version found when DSH starts, which runs after a restart). See 1.2 |
| Report a problem | Saves a TXT to Downloads and opens GitHub’s new-issue page; see 8.4 |
| Tool loading | In the Work mode card, beside Desktop, chosen from a list. All (the default; 26 tools); Lite (12 common tools); Lazy (starts with 1 management tool and loads the rest when needed, with all tools allowed; a task loads its tools first, which takes extra steps); Custom (pick tools one by one or by group) |
| Desktop Computer Use | On by default. Turning it off keeps browser-capable tools only, hides desktop-only tools (launch_app, ocr, move_window) and desktop parameters, and spawns zero PowerShell desktop/takeover helpers |
| Per-chat switch | Hidden by default. Choose Default on or Default off and supported DSH builds show a switch beside the message box that turns desktop and browser control on or off for the current chat only; you can also type /wincu [on|off|toggle|desktop on|off|browser on|off]. With Default off, chats you create from then on start without control until you click the switch; chats you already had keep theirs. A subagent follows the chat that started it. A change immediately updates the current chat’s tools, instructions and allowed calls (WCU_DISABLED_IN_SESSION) and leaves a one-line note in the chat. While it is Hidden, every chat follows the two switches above and /wincu is not offered; each chat’s earlier choice is kept and applies again when you show the switch again. |
| Work mode | Chosen under Desktop in the Work mode card. Low disruption (the default): keep using your PC and the task keeps going. DSH does what it can in the background and opens the apps it starts on a hidden desktop; steps that need the mouse and keyboard run at once and borrow them briefly, while what you type or click meanwhile is held and then replayed to your window; it waits only while you hold a key, have input-method text not yet committed, or use a full-screen app; Foreground: for when you step away; DSH keeps its window in front and uses the mouse and keyboard directly, and Esc stops it; Virtual machine: works inside a Hyper-V virtual machine, an ephemeral Windows Sandbox (WSB), a local VirtualBox Windows guest, or a remote Windows system over WinRM (experimental; VMware, VirtualBox, or another Windows PC; works from Windows Home) without touching your host desktop or files, with setup or readiness steps on the settings page; they start with Recommended: let DSH do it, a sentence you can send to DSH so that it checks and sets things up for you. See settings and stopping |
| Local icon recognition (experimental) | In Advanced, off by default. Turn it on when DSH can see a window but cannot find its toolbar icons: icons are recognized on this PC with OmniParser, which needs its own Python 3.11 environment; the setup starts with Recommended: let DSH do it, a sentence you can send to DSH so that it prepares it for you. Check environment says which Python, packages or models are still missing; when Hugging Face cannot be reached, the commands on the page download the models through a mirror to this PC, and the plugin checks every file's SHA-256 before loading it. See the tool guide |
| Learning | In Advanced; If asked by default: after a task, say “learn this” or “remember how you did this”, and DSH saves one or two sentences on what worked in that program or site, to use there next time. Auto also records which controls and actions each task used, on this computer only (no typed text, passwords or screenshots), and at the Review frequency (daily, weekly or every 20 tasks; weekly by default) has the conversation’s model turn the records into notes. Off saves nothing new and uses no saved notes. See 6.3 |
| Browser Use | On by default. Turning it off removes browserTab and browser routing instructions, never launches a browser, and rejects browser calls with WCU_BROWSER_DISABLED |
| Prefer web page controls | On by default. Pages it can read and operate directly are handled in the background, without moving the pointer or taking the foreground; desktop apps and page content it cannot read go to Computer Use |
| Show browser window | On by default, so you can watch the DSH browser; turn it off to run the browser in the background with no window |
| Browser | Follows the Windows default browser, or choose Edge, Chrome or the Firefox family (experimental); when the default is neither Edge nor Chrome, an installed Chrome or Edge is used. The Firefox family starts with the Windows default one; see Firefox-family browsers. For a portable browser that is not registered with Windows, choose Custom and enter its path; Check beside it starts the browser once, the way the plugin does. See finding the browser and fixing startup (in Chinese) |
| Keep website sign-ins | Off by default. When on, the DSH browser keeps one profile, and sites you sign in to in its window are still signed in next time; nothing to set up in your own browser and no prompts to allow. The settings page says how to sign in, where the sign-ins are kept and the risks; see 7.4 |
| Connect browser (experimental) | Off by default. When on, the agent can work in the Chrome or Edge you already have open. First allow remote debugging at chrome://inspect/#remote-debugging (or edge://inspect/#remote-debugging); after that the browser asks you once for each new connection, and one connection serves every conversation while DSH runs. Only the browser chosen under Browser is used, and Default means the Windows default browser; it is unavailable for the Firefox family. See 7.4 |
| Browser extension (experimental) | On by default; takes effect once the “dsh-computer-use-win Browser Connector” extension is installed in your Chrome or Edge. The agent then works in your signed-in browser directly: no remote debugging to turn on, no Allow prompt, and it reconnects by itself after DSH or the browser restarts. Install on the settings page shows the steps and then says connected. When it is installed but switched off (for example after Edge’s prompt about developer-mode extensions), the card says so and Turn on shows how to switch it back on. See 7.4 |
| Screen indicator | Turn the edge glow and the status bar on or off. Change the text, put the bar at the top or bottom, and choose how long it stays after a turn ends (0.2–3 seconds) |
| Pointer indicator | Turn the glow and DSH tag at the pointer on or off on their own. Your Windows pointer style is not changed, and the tag stays clear of enlarged pointers |
| Visible in remote sessions and recordings | On by default, so UU Remote, screen sharing and recordings can show the indicators and the reasoning and progress overlay too, including the model's reasoning and replies. It keeps up when you change monitors, layout or scaling |
| Reasoning and progress overlay | On by default. The lock (Lock overlay; clicks pass through) is on by default, and resting the pointer on the overlay's padlock unlocks it for moving and resizing; clicking × on the overlay closes only the current preview or turn window without disabling the feature. More options holds the overlay content (Source or AI summary), the opacity, the corner it sits in and the lock shortcut. Adjust overlay shows a 60-second preview in which you drag it to the place and size you want |
| Stop shortcut | Esc always works. Click Add a stop key and press the key you want (such as F8 or Ctrl + Alt + K) to add it; Remove deletes that extra key and keeps Esc only |
| Preview | Click Preview at the top right of Takeover cues and stopping to see the current cues on your screen. Each setting's details sit behind an ⓘ icon; hover over it or click it to read them |
5.2 Press Esc to stop at any time
Esc, or your own shortcut, stops this turn's desktop actions right away, including queued ones, and the agent will not retry them in the same turn. To carry on, send a new task or say “continue”. There is no need to visit settings. Normal mouse movement and other keys do not stop anything. Esc still works even if you turn the indicators off. Browser Use, reading the screen and background control actions do not take Esc, so Esc keeps working in your other apps. Until a turn first uses the mouse or keyboard, stop it with the stop button in DSH.
5.3 When the indicators appear and disappear
They appear the first time a turn uses the mouse or keyboard and stay on through that turn's screenshots, reading and short pauses for thinking. Reading the screen, taking screenshots, waiting, and operating controls or web pages in the background show no indicator. When the turn ends, is cancelled or fails, they fade out after the delay you set. If 30 seconds pass after the last desktop action with nothing new, they also hide, and they come back with the next action. A standalone MCP server has no notion of turns, so it shows them for each call that uses the mouse or keyboard.
5.4 Good to know
- The plugin operates controls in the background when it can, without moving the mouse or the foreground. Clicks at screen positions, pasting text and key presses still need the real mouse and keyboard: the plugin brings the target window forward, checks that no other window covers the click point, and afterwards puts the mouse back and returns the foreground to the window you had in front. If the action opened a menu, drop-down list or dialog, the window stays in front; if you switched windows or moved the mouse meanwhile, the plugin leaves them as you set them. Avoid using the mouse and keyboard during these steps.
- After the foreground goes back to you, later actions and screenshots that name no window still aim at the window the agent was working in, never at the one you are using. Text DSH pastes stays out of your clipboard history (Win+V). Native edit boxes such as Notepad and WordPad paste directly, and your clipboard comes back as soon as the paste is done. Other programs get your clipboard back only after they have read the text; if one never reads it, the text stays on the clipboard and the result says so, so a slow program never pastes your old content.
- Only one conversation can use the desktop at a time. Others get a “busy” result.
- DSH asks you first, and acts only after you agree, before it launches a program with arguments or through a shortcut, opens a local file in a page, uploads a local file to a page, connects to your own open browser, or acts for the first time on one of your own browser tabs. An approval covers that one call with those arguments; refusing or cancelling runs nothing. The agent cannot operate DSH's own windows, so it cannot click Allow for you. Under DSH's Full access preset, which shows no approval prompts, these calls run without asking, since that preset already lets the agent run any command unasked; Workspace Write, Read Only and the other presets ask first. The standalone MCP server has no such prompt and refuses these calls unless environment variables allow them; see Safety.
- Inside DSH, a screenshot reaches the agent as the path of a PNG file and the image data stays out of the conversation, so several screenshots no longer fill the context. To send a screenshot over IM, have the IM tool send that file.
- An action already delivered to an app cannot be undone. If the app is stuck, stopping waits until it responds.
- Choosing Custom from another preset starts with every tool checked; uncheck the tools you do not want and save. A Custom selection you saved is shown as saved. Saved changes take effect after the current step finishes and survive a restart. The agent cannot turn on tools you have turned off.
See settings and stopping for the full details.
6. Try a task
6.1 Example tasks
Type “Meeting notes” into Notepad, then read the text back to confirm it was entered.
Calculate 25 × 4 in the open Calculator window and read the result.
Open a browser, search for “Windows UI Automation”, confirm that results appeared, and summarize what you did.
Open NetEase Cloud Music, search for “晴天”, and confirm that “周杰伦” appears in the results. If UIA cannot find the search box, use OCR to locate visible text.
When the task says what to confirm, the agent checks the result instead of stopping once the input is sent (see 4.1). Results also depend on the app, the model and the page you are on.
6.2 Saved workflows: run a flow again by name
Complete a flow in one window. When the success message appears, tell DSH “Save the steps I just used to fill in City, press Save and check for ‘Settings saved’ as a workflow named ‘Save settings’.” The plugin checks the final message and returns the path to a local Markdown file containing the steps, control names and expected result. Saving the workflow does not press the button again.
Next time, open the same application window or page and say in a new chat “Run the ‘Save settings’ workflow with Harbin as the city.” Each run looks up controls by name and type. For text drawn directly onto a window, a step can use OCR on a small region. The run stops and reports the reason if a control is ambiguous, the page changes or a check fails. It also stops, rather than passing, if the expected result is already showing before the step that should produce it, such as a “Saved” message left from an earlier run. Click Copy example under Advanced → Saved workflows in settings for a sample prompt, or ask DSH to list your saved workflows.
6.3 Learning: better with use
By default DSH learns only when you ask. When a task went well and the method is worth keeping, say “learn this” or “remember how you did this” in the same chat. DSH writes one or two sentences on what worked in that program (by file name, such as WeChat) or site (by domain, such as github.com), for example “find the message box before filling it; don’t click by coordinates”, or what to avoid.
The next time DSH first looks at the same program or site in a new turn, it gets that app’s most useful notes: once per turn, three at most, and nothing extra in other apps. Each note counts the turns it was used in and how many went well: a failed turn moves it down, and three failures in a row turn it off.
With Auto, the plugin records each computer-use task on this computer when it ends: which controls and actions it used, errors, and whether you stopped it. It never records typed text, passwords, page content or screenshots, and this step calls no model. When the Review frequency comes round and enough records have built up (at least 5 tasks for daily or weekly; or every 20 tasks), the next task end asks the conversation’s model once to write new notes and switch off automatic notes the records contradict. Review now on the settings page starts it at once.
View in Advanced lists every note, where you can turn one back on or delete it. Notes and records stay on this computer in %USERPROFILE%\.dsh\dsh-computer-use-win\experience. A saved workflow is a fixed flow replayed step by step; a note is a hint for similar work. Both can be used together.
7. Tools and options
7.1 Tool list
There are 25 action tools and 1 management entry. The table uses short names. The full name is windows_computer_use_<name>, and DSH usually adds a mcp__wincu__ prefix.
| Purpose | Tools |
|---|---|
| Check the connection, find windows | health · list_windows |
| Read on-screen controls (UIA) | snapshot · accessibility_tree · find · element_info |
| Screenshots and text recognition | screenshot · ocr |
| Mouse | click · double_click · move · drag · scroll |
| Type and operate controls | type_text · keypress · focus · invoke · set_value |
| Launch apps, manage windows | launch_app · activate_window · move_window · close_window |
| Wait and confirm | wait_for · wait |
| Run planned actions in a batch | batch |
| Manage tools | tools |
launch_app starts programs through the Windows desktop (Explorer), so they keep running after the tool call ends. Command interpreters and script hosts such as cmd and PowerShell start only without arguments; run commands with DSH's own shell tool.
batch runs 1–20 planned actions, such as clicks, typing, selection, key presses and scrolling, on one window or one browser tab. Each step goes through the usual checks: the tool switches in the settings, the Esc stop and the check that the click point is not covered. The batch stops on an error or on input that could not be confirmed. A navigation, a dialog, a new window or a closed target stops it before the next step; when the last step causes one, the batch completes and afterLastStep names the change, as when a submit opens the next page. It returns the result of every step and observes once at the end.
7.2 Lite preset and the management entry
Lite includes list_windows, find, click, scroll, type_text, keypress, ocr, screenshot, wait_for, launch_app, batch and tools.
Through the tools entry, the agent can read a tool's description, and unload or reload tools you have allowed. reset returns to your saved startup set. Unloading a tool does not remove its description or results from the conversation.
7.3 Tips
When UIA can find a control, operate it directly with invoke or set_value; both run in the background. With action, invoke can also expand or collapse a control or scroll it into view, and scroll on an element ID scrolls in the background first. Send an Excel Ribbon sequence such as Alt, H, O, W (Column Width) as one keypress with thenKeys, so the foreground is not handed back between the keys. When UIA finds nothing, or very little, read the screen text with OCR, and let a model that can see images read the screenshot for icons and layout. OCR returns only text and screen positions; it never makes up control IDs. Look again after a window moves or a control changes.
To press Enter in a field after set_value (a search box, an address bar), note that a keypress without a window target goes to the window DSH last worked in this turn. Whether set_value moves the focus into the field depends on the app: Chromium does, a Win32 edit does not, so focus the field first to be sure. Key and typing results include deliveredTo, the window and control that actually got the input. When no window target was given and DSH has not worked in any window this turn, the input reaches the window in front and the result says unconfirmed. list_windows lists minimized windows too (minimized: true) and says truncated when there are more windows than maxWindows. activate_window restores a minimized window first; the result says restored: true, and window shows the window after the call. A screenshot of a minimized window gets only its title strip, so the result says minimized: true and to restore it first. ocr with a query returns only the matching lines, without the whole text and every word box.
Electron apps, Chrome and Edge are all built on Chromium. Such an app builds the controls of a page only once another program reads the page. So the first time the plugin reads one of these windows, it turns the page's control tree on, and the page's buttons and input boxes usually become readable within half a second. webContent in the result tells you whether the page is ready. If it says starting, wait a moment and read again.
Parameters and results · On-demand loading and client compatibility · How apps differ
7.4 Browser lane
For web pages, the plugin does not have to read screenshots or move the mouse. It reads the page structure over the Chrome DevTools Protocol (CDP), then clicks, fills and selects elements directly. All of this happens inside the browser: your mouse does not move, the clipboard is not used and no window comes to the front, so tabs in the background work too. Browser Use adds no tools; what is new is a browserTab argument and page element IDs:
- The result of
list_windowsincludesbrowserLane, which lists the tabs of connected browsers. Each tab has an ID such ast1a2b. - Pass that ID as
browserTabtosnapshot,accessibility_tree,find,type_text,keypress,scroll,screenshotorwait_forto read or operate that page. Every element on the page comes with an ID such ast1a2b:57, which works directly inclick,set_value,focus,invoke,scrollandelement_info. After each action, the result shows what changed on the page. An element ID is valid only for the page it was read from: read the page again after it navigates. After the plugin's server restarts, tab IDs change too, so calllist_windowsfirst. set_valuewith a web address ont1a2b:addressopens it in that tab; onnew-tab, it opens the address in a new background tab.
The browser comes from one of four places:
- The agent browser (default). The first
new-tabopens a visible browser window without bringing it to the front. Which browser is a setting: by default the Windows default browser, and an installed Chrome or Edge when that is neither; the Firefox family is an experimental choice that runs in the background (see Firefox-family browsers). It starts from a fresh temporary profile every time, and its tabs run in a separate isolated context, so they never see your cookies, sign-ins or history. It exits with the plugin process and closes after 10 idle minutes headless or two hours visible; page activity also extends its lifetime. Edge signs a new profile in to your Windows Microsoft account on its own; the agent's tabs stay in the isolated context and cannot use that sign-in, the window shows no account, and the temporary profile is deleted after the browser closes. Turn off Show browser window in settings to run it in the background with no window. Browser Use shows no screen edges or pointer tag. - Keep website sign-ins. For tasks that need you signed in, turn on Keep website sign-ins in the settings; it is off by default. The DSH browser then stops starting from a temporary profile and keeps one profile per browser (
kept-edge,kept-chromeunder%USERPROFILE%\.dsh\dsh-computer-use-win\agent-browser): sites you sign in to in its window (the blue frame) are still signed in for later tasks, also sites where you did not tick “remember me”. The first time a task needs a site that asks you to sign in, the agent asks you to sign in once in that window; you type passwords and codes yourself. Your own browser is never touched: no remote debugging to turn on and no prompts to allow. With Edge, Edge signs this profile in with the Microsoft account of your Windows, so Microsoft’s own sites are signed in already; choose Chrome to avoid that. Sign-ins stay when you turn the switch off; to remove them all, exit DSH and delete that folder. Risks: DSH acts as you on the sites you signed in to there; page text can try to steer the agent; in 0.6.0, CDP uses a named pipe with no local debugging port, though sign-ins stay in that profile folder and remain readable by other programs under your Windows account. - Connect browser (experimental). Off by default. When on,
list_windowsonly reads theDevToolsActivePortfile the browser writes, lists your browser as available and offers a"<browser id>:connect"handle; it neither connects nor shows a prompt. The agent first asks you to get ready to click Allow in the browser, then writesconnectto that handle withset_value, and only then does the browser ask you. A refusal or timeout stops there with no automatic retry, and the listing says not allowed or timed out, so prompts never pile up. One connection serves every conversation while DSH runs: later conversations see the browser listed as connected, and the agent neither connects again nor asks you. After DSH or the browser restarts, debugging is stopped in the browser, the tool, browser or run-location settings change, or the plugin updates, it has to connect again and the browser asks again; the browser asks for each connection, and the plugin cannot remember the answer for you. Once connected, tool results show the addresses of your own tabs without the part after?or#. The agent works only in tabs you mention or tabs it opened, and asks before sending, buying, deleting or changing account settings. Disconnecting leaves your browser running. While connected, the browser shows a bar saying it is controlled by automated test software. - Browser extension (experimental). Install the Computer Use plugin (
dsh-computer-use-win0.6.6 or later) in DSH Desktop for Windows and add its companion extension,dsh-computer-use-win Browser Connector, to Chrome or Edge. The Microsoft Edge Add-ons edition requires desktop plugin 0.6.7 or later. It reconnects automatically when you reopen the browser or restart DSH. DSH can use tabs it opens for a task. To use a tab you already have open, open the extension in that tab, check the site and choose Allow this tab. One approval covers repeated actions in that tab on the same origin during the connection. Closing the tab, changing origin, stopping or disconnecting clears the corresponding grant. While DSH operates a tab, the browser shows a debugging notice below the address bar. A blue pointer marks the action on the page. To stop this turn’s browser actions, click Cancel in that notice or open the extension in the toolbar and click Stop. Turn off Let DSH control this browser to pause the connection. The extension supports cross-site frames, dialogs and screenshots. You choose upload files in the browser’s file picker. For installation, open Web pages and browser in DSH settings. Until a public store listing is available, follow the instructions for Developer mode and Load unpacked. - Find pages and downloads. Open Find pages and downloads from the extension menu and choose bookmarks, history, recently closed pages, frequently visited sites or downloads. Your browser asks for each source when you first use it. With companion 0.6.7, ask DSH to find an item, choose Review DSH’s search request in the extension and share the matches you select. Download search shows the actual filename and location. Enable the side panel or right-click entry under Browser shortcuts.
- Updating an existing developer-mode extension. After upgrading the desktop plugin from 0.6.6, open Browser Connector in the browser toolbar. Review the new permissions for tab groups, the side panel and reconnecting, then choose Apply extension update. If a task is using the browser, wait until it finishes. A fresh installation is ready to use.
The Chromium lane reads and operates same-origin, cross-origin and nested iframes. Element ids bind their frame and document and expire on navigation/removal. With browserTab, coordinates use CSS pixels in the current page screenshot viewport, including canvas; the desktop pointer does not move. With the browser window shown, Chrome's own JavaScript dialogs (alert, confirm and the like) sometimes come to the front briefly. Shortcuts such as Ctrl+L and Ctrl+T belong to the browser window and never reach the page; use address, new-tab and close_window instead. Environment variables and result formats are in the MCP tools reference.
7.5 Read less to save context
Lazy mode uses a 64 KiB text budget for Windows control trees, snapshots and OCR by default. Set maxBytes to adjust it. For trees and snapshots, detailLevel:"full" also opts out of the automatic budget.
- Summarize a tree. Use
detailLevel:"summary"withaccessibility_treeorsnapshoton Windows controls. Each node keeps its ID, control type, name and states. - Set a tree byte budget.
maxBytesstarts at 2,000 and limits the UTF-8 JSON response. Screenshots are separate. Over the limit, the tool summarizes the tree first, then keeps actionable controls and their ancestors, then cuts the tree by level. If it cuts the tree,budget.fullResultPathpoints to the complete result. If the remaining content still cannot fit, the response gives the file path. - Read just the changes. Pass
treeDeltaBase:"start"toaccessibility_treeto get a tree andtreeId. Pass that ID astreeDeltaBasewhen reading the same target again to get added, removed and changed controls and a newtreeId. UsedetailLevel:"full"to compare control values. A missing baseline, a different window or view settings, a truncated tree, or more than 40% of nodes changing falls back to a tree with the reason indelta.fallback. A delta overmaxBytesalso falls back to a tree reduced to fit the budget. A tree reduced by the budget cannot serve as a delta baseline. - Set an OCR byte budget.
ocralso acceptsmaxBytesstarting at 2,000. Over the limit, it drops word boxes first, then the combined text that repeats the lines, and finally lines from the end. If it cuts lines or returns only a file reference,budget.fullResultPathpoints to the complete result.
Windows UI Automation trees and snapshots report countedDepth (the deepest level counted against maxDepth) and structuralDepth (the deepest actual level below the root) for the tree read by the backend before summarizing, trimming or computing a delta.
To check whether one control changed, use find to locate it or wait_for to wait for the target state. See the MCP tool reference for arguments and results.
8. FAQ
8.1 It's installed, but I see no tools or settings, or an old version is still running
Most often, DSH Desktop was not fully restarted. Closing the window leaves DSH running in the tray with the old plugin, so right-click the tray icon, choose Quit, and open DSH Desktop again.
Also check that the plugin went into the profile DSH is actually using. The version appears in the MCP initialize.serverInfo.version; with All selected, the agent can also call health to check the connection. Each profile should have only one serverName: wincu service. If an older version left a duplicate manual entry, back it up first, then follow the upgrade notes.
When you save settings, DSH writes a row with id: mcp-dsh-computer-use-win into the profile's cordis.patch.yml. That row holds your settings, so keep it. With Lite or Lazy selected, tools outside the preset, such as health, are not listed, and calling one directly returns unknown tool. Ask the agent to call the management entry windows_computer_use_tools with {"operation":"list"} to see which tools are loaded and which can be loaded. If a saved setting holds a value this version does not offer, for example after switching versions, the plugin uses the default for that setting, loads as usual, and names the reset value under notices in the tools list and in health.
When you report an issue, include the DSH Desktop, dsh core and plugin versions, plus the error text with private details removed.
8.2 Why did a click or typed text have no effect?
Check that the target window is not covered and still responds. A click at a screen position whose point shows another window, such as a notification, is not sent, and the result names the covering window (POINT_COVERED). The foreground and pointer fields of a result say whether the step borrowed the foreground and whether it gave it back. Chromium, Electron and some WinUI apps ignore input sent to background windows, so prefer UIA, or bring the window to the front before typing, and then look at the result. A target with a higher Windows integrity level than the input worker is refused with ELEVATED_TARGET_DENIED. If Windows prevents verification of the target, the plugin reports INPUT_TARGET_ACCESS_UNCONFIRMED. Leave UAC prompts to the user. The plugin also needs a normal, unlocked desktop session.
8.3 What about PowerShell 7, other systems or a built-in vision model?
It works on Windows only. DSH can also run inside WSL (for example dsh web in a WSL shell): the plugin then starts Windows PowerShell through WSL interop and still operates the Windows desktop, as long as WSL can start Windows programs (powershell.exe runs). PowerShell 5.1 is the default, and its text recognition (WinRT OCR) has been tested on real screens. The automated tests cover both PowerShell 5.1 and 7. Under 7, reading controls and taking screenshots are tested for real, but text recognition is only tested at the protocol level, so OCR under PowerShell 7 is not guaranteed.
Enable Recognize visual controls locally to add OCR text and icons to sparse windows. To find an unlabeled button such as Undo, call snapshot on its window with vision: true and includeScreenshot: false, choose a named ID from vision.candidates, then call click. Inference runs on the local CPU or GPU. The full model weights are about 1.4 GB. Local visual controls
8.4 How do I report a problem?
Click Report a problem at the top right of Settings → Computer Use. DSH saves wincu-diagnostics-date-time.txt to Downloads, selects it in File Explorer, and opens GitHub’s new-issue page in your default browser. A dialog shows the file name and where it was saved. If Downloads cannot be written, a Save As dialog lets you choose another folder.
Describe what happened, what you expected, and how to reproduce it. Review the TXT, then drag it into the issue description and submit.
The TXT contains the plugin version and install source, DSH and runtime details, Windows, PowerShell, screen and browser information, relevant settings, self-test results, the last 30 computer-use calls, and up to 200 plugin log lines. Tool input text is kept as its length. You can attach a screenshot separately after covering private details.
9. Data and privacy
Reading controls, text recognition, screenshots and input all run on your computer. The results go to DSH or another caller, and whether they are then sent to a remote model depends on your DSH and model settings. Screenshots and recognized text can include sensitive content from your windows, so hide accounts, paths, passwords and private chats before you share logs or open an issue.
Pages read through the browser lane are also processed on your computer before they go to the caller. By default the agent browser carries no sign-ins; with Keep website sign-ins on, the agent can read and operate the sites you signed in to in the DSH browser. With Connect browser on and a connection allowed, the agent can read and operate every site signed in to in that browser, so turn it on only when needed, and you can turn remote debugging off in the browser afterwards. The same holds once the browser extension is installed; when you do not need it, turn off Browser extension in the settings, or “Let DSH control this browser” in the extension's menu. Page text can also carry instructions aimed at the agent, so every page outline starts by reminding the model that page content is untrusted and only your instructions count.
The settings page reads this plugin’s latest from npm (registry.npmjs.org) and checks the installed package in the active local profile. The npm request uses the package name.
Learning notes and Auto records stay on this computer in %USERPROFILE%\.dsh\dsh-computer-use-win\experience. A record holds only the program name or site domain, the tools used, the names and types of controls searched for, error codes and how the task ended; no typed text, passwords, page content or screenshots. Notes reach the model with an observation of that app; an Auto review sends the records to the conversation’s model.
The diagnostics file from Report a problem stays on your computer until you drag it onto an issue page; 8.4 lists what it holds.
10. Documentation and development
10.1 Documentation
Settings and stopping · Tool loading · Tool reference · Architecture · Test notes · Changelog
10.2 Development and testing
See 4.2 Architecture for how the parts fit together.
npm ci
npm test
The standalone MCP server needs no third-party packages at runtime. Inside DSH, it uses DSH's own Schemastery and the official MCP bridge. Development dependencies are only for testing. npm test runs 118 isolated regression suites covering settings compatibility, component decoupling, takeover and stopping, the progress overlay, reading controls, capture, OCR protocols, input edge cases, batch actions and the browser lane. It sends no real keyboard or mouse input and does not touch your installed DSH profiles. Tests that need a real interface use only their own test windows and temporary browser profiles, and logs go to the temporary folder the command prints.
node test/notepad-e2e.mjs is a separate test that really types. It opens Notepad, so run it on a dedicated test desktop.
The two figures in this README are generated from the pages in assets/diagrams/. After changing their text, run node assets/diagrams/render.mjs; it uses your local Chrome or Edge to export all 8 images again, in Chinese and English, light and dark.
MIT licensed. Derived from cgissing/windows-computer-use; see THIRD_PARTY.md for attribution and copyright.
Plugin marketplace · Releases · Report an issue · Back to English ↑
Star 趋势 / Star History
探索相关项目
加载中…