dsh-computer-use-win:DeepSeek Harness 的 Windows 原生电脑使用插件

前言

DeepSeek Harness (DSH) 的核心理念是“一切皆插件”。在现有的 DSH 生态中,macOS 端已有成熟的计算机使用插件,但 Windows 端一直缺乏原生实现。dsh-computer-use-win 专为填补这一空白设计,它允许 DSH 插件通过截图、UI Automation 元素发现、OCR 和授权输入来控制 Windows 桌面环境,使文本模型也能通过辅助功能与 Windows 应用交互。

安装与启用

该插件需要安装在 Windows 系统上,并依赖已安装的 DSH CLI。

  1. 执行安装命令:
    dsh plugin --profile web add https://github.com/secretxuan/dsh-computer-use-win/releases/download/v0.7.0/dsh-computer-use-win-0.7.0.tgz
  1. 验证安装是否生效:
    dsh --profile web --dump-config | Select-String computer-use
  1. 启动 DSH:
    dsh --profile web

核心能力

该插件通过一系列工具暴露 Windows 操作能力,涵盖截图、观察、发现和交互四个维度:

  • 视图与发现

    • computer_screenshot:捕获全屏或特定窗口。视觉路由接收图像;仅文本路由接收保存的 PNG 路径。
    • computer_list_windows:列出可见顶层窗口(进程、PID、标题、屏幕矩形、激活状态)。
    • computer_list_elements:使用 UI Automation 搜索控件,返回名称、类型、物理像素矩形和点击坐标。
    • computer_ocr_image / computer_ocr_window:对图像或窗口运行 Windows OCR,返回带绝对坐标的文本框。
    • computer_observe_image / computer_observe_window:将现有图像或窗口转换为通用文本模型 UI 映射(OCR、粗略区域、点击中心、视觉候选)。
    • computer_observe_media_controls:报告播放/暂停状态等通用媒体控制状态,无需自定义像素脚本。
  • 交互

    • computer_click / computer_move_mouse:屏幕坐标点击或移动。
    • computer_type_text:通过剪贴板粘贴输入文本(可靠处理 CJK),并使用 SendInput 作为后备。
    • computer_press_key / computer_scroll / computer_drag:按键、滚动和拖拽操作。
    • computer_open_settings:通过 ms-settings: URI 打开 Windows 设置。
    • computer_search_in_window:通用搜索流程(定位字段、输入、回车)。
    • computer_locate_text / computer_click_text:通过 OCR 定位并点击可见文本。

配置

安装后,通常需要在 DSH 的配置文件中调整参数。在 cordis.patch.yml 中补全 computer-use-win 配置:

- id: computer-use-win
  config:
    requireApproval: true
    maxScreenshotBytes: 8388608

注意: requireApproval: false 仅适用于无人值守测试或临时环境。

典型用法

根据模型类型(视觉或仅文本)选择工具组合。

文本模型推荐流程:
1. computer_list_windows
2. computer_list_elements(window: "target app")
3. 如果 UIA 诊断显示受限,使用 computer_observe_window(window: "target app")
4. 当建议操作匹配任务时直接使用
5. 使用 computer_observe_media_controls 检查播放/暂停状态,而非自定义像素脚本
6. 使用 computer_search_in_window(window: "target app", query: "...") 进行搜索
7. 使用 computer_locate_text 或 computer_click_text 进行文本定位
8. 对于纯图标目标,使用高置信度视觉候选的 computer_click
9. 使用 computer_type_text 或 computer_press_key 进行输入
10. 使用 computer_list_windows、computer_list_elements、computer_observe_window 或 OCR 进行验证

视觉模型推荐流程:
在 DSH 中选择 DeepSeek-V4-Flash-Vision-Exp,让模型检查真实的截图,而不是 OCR 摘要:
1. computer_screenshot(window: "target app")
2. 检查返回的图像

注意事项

  1. 全局输入注入:Windows 输入注入是全局的。点击发生在坐标下的任何位置,而不仅仅是当前焦点窗口。
  2. 权限问题:提升的管理员窗口可能会忽略来自非提升插件进程的输入。
  3. VDI 过滤:Win-key 组合使用 SendInput,某些 VDI 产品会过滤此功能。尽可能使用语义工具,如 computer_open_settings。
  4. UIA 依赖:UI Automation 覆盖范围取决于目标应用程序是否暴露有用的辅助功能元数据。对于 CEF/Chromium/自定义渲染应用,使用 computer_observe_window、computer_search_in_window 或 computer_click_text。
  5. 仅文本限制:仅文本的 DeepSeek 路由无法直接检查截图像素。computer_screenshot 在这些路由上返回保存的 PNG 路径。使用观察/OCR 工具将路径/窗口转换为文本、UI 区域和坐标。
  6. 观察不是模型:视觉观察不是视觉模型。图标/按钮候选是具有置信度和证据的启发式方法;点击后验证。

结尾

dsh-computer-use-win 为 DSH 提供了与 Windows 界面交互的必要工具集。它通过依赖系统辅助功能和 OCR 处理,解决了文本模型难以直接查看像素的问题。请查看插件仓库以获取源代码和更新。

  • GitHub:https://github.com/secretxuan/dsh-computer-use-win
  • SkillHub 目录:https://www.skillhub.cn/plugins/secretxuan/dsh-computer-use-win
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜