dsh-plugin-windows-use
Verified@hlh857/dsh-plugin-windows-use · v0.2.5 · AGPL-3.0
DSH plugin exposing PowerShell-based tools to operate the local Windows machine (screenshot, UI tree dump, mouse/keyboard input, foreground app). Rebuilt for the 0.2.1 API line; works on both the web profile and the desktop app.
Install
dsh plugin add @hlh857/dsh-plugin-windows-use Confirm the layer applied with dsh --profile default --dump-config — see the install guide.
Source
Published to npm without a public repository. Inspect the package contents before installing.
Creators
Readme
# @hlh857/dsh-plugin-windows-use 0.2.5
给 DSH 用的 Windows 手脚插件,按 0.2.1 接口线写的,网页版和桌面版都能装。
五个工具
- windows_screenshot —— 截全屏或指定窗口,落成 PNG 放到系统临时目录,返回文件路径和宽高。想在对话里看图,再用读图工具打开这个路径。
- windows_ocr —— 读屏文字。capture=true 现场截屏再读,image=<路径> 读已有图片。没有看图能力的模型路线就用这个。
- windows_ui_dump —— UIAutomation 读控件树,输出带坐标的文本树。
- windows_input —— 鼠标移动、点击(左/右/中)、滚轮(wheel 正数往上、负数往下)、Unicode 打字(中文可用)、按命名键;key 支持组合键,如 ctrl+c、ctrl+shift+esc。
- windows_foreground_app —— 当前前台窗口的标题、进程、pid、句柄、矩形。
底层
五个工具都调用本包 ps/ 目录下的 PowerShell 脚本,跟 屏幕眼\眼睛.ps1 是同一套做法:ScreenEye.ps1、ScreenOcr.ps1、UiTree.ps1、WindowsInput.ps1、ForegroundApp.ps1。插件坏了,脚本这条路还在;脚本坏了,插件也跑不动。
安装
从 npm 装(网页版与桌面版通用):
dsh plugin --profile web add @hlh857/[email protected]
桌面版用 plugin_manager 的 install_bundle,target 填 @hlh857/[email protected]。
开发时也可以从本地目录装:
dsh plugin --profile web add <本目录绝对路径>
版本记录
- 0.2.5(2026-10-30)WindowsInput.ps1 换成新版:滚轮参数 wheel、组合键按下/抬起顺序修正(ctrl+c 这类不再丢键)、大小写字母和数字键补齐;ForegroundApp.ps1 同步最新;工具说明补 wheel。
- 0.2.4(2026-10-27)说明文档改全:五个工具、安装命令、版本号。
- 0.2.3(2026-10-27)修 windows_foreground_app 解析:进程名带空格时(例如 DeepSeek Harness)以前解析失败,现在能正确取出。
- 0.2.2(2026-10-27)同上修复的首次提交版本。
- 0.2.1(2026-10-27)新增 windows_ocr;截图支持指定窗口;ScreenEye.ps1 的窗口匹配改成取面积最大的那个(原来按枚举顺序取第一个,经常抓到一百六十乘二十八的辅助小窗);截图不再往 attachment store 写,改成返回文件路径。
- 0.2.0(2026-10-27)为 0.2.1 接口线重写,替代 0.1.2。0.1.2 有两个毛病:版本门槛被内核拒绝加载;截图工具写死的中文文件名在编译时变成乱码,截图功能实际一直是坏的。