DeepSeek Harness 插件

qphotoai/dsh-computer-use-windows

Star 数 ★ 6 分类 工具与能力 收录于 2026-08-25

适用于 Windows 的 DeepSeek Harness Computer Use 插件,支持 UIA、cua-driver 和可选 GLM 视觉。

安装

# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)

dsh plugin --profile web add github:qphotoai/dsh-computer-use-windows

装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。

README

English | 中文

适用于 Windows 的 DeepSeek Harness Computer Use 插件。项目基于 988hj7tczd-oss/dsh-computer-use,使用 cua-driver 提供 UI Automation、独立 Agent 光标和窗口操作,并可选使用智谱 GLM 进行截图视觉识别。

环境要求

  • Windows 11(当前实测系统:10.0.22000.2538,x86_64)
  • DeepSeek Harness Web Profile
  • Node.js 24.14.0(当前实测版本)
  • cua-driver 0.21.0(当前实测版本)

本仓库仅适用于 Windows。

功能

工具 功能
screen_observe 读取 Windows UIA 控件树和坐标;可选截图视觉识别
computer_click 单击编号元素或窗口坐标
computer_double_click 双击
computer_right_click 右键
computer_type 向最近观察的窗口输入文本
computer_key 发送按键或快捷键
computer_scroll 滚动
computer_drag 拖拽
computer_wait 等待界面变化
app_list 列出运行中的应用
app_launch 启动应用

安装

1. 安装并启动 cua-driver

按照 cua-driver 官方说明 安装。确认命令可用:

cua-driver --version
cua-driver doctor --json

如果程序不在 PATH,可设置:

$env:CUA_DRIVER_BIN = "C:\path\to\cua-driver.exe"

插件也会探测当前 Windows 安装器常用路径:

%LOCALAPPDATA%\Programs\Cua\cua-driver\bin\cua-driver.exe

启动守护进程:

cua-driver serve --socket "\.\pipe\cua-driver"

2. 加入 DSH Web Profile

仓库提供 Windows 原生安装脚本(推荐):

.\tools\install-windows.ps1

脚本会将插件链接到 Web Profile、写入 Profile 的 package.json,并验证 dsh-tools 只解析到 DSH 宿主的同一实例。完成后重启现有的 dsh web 宿主。

也可以手动接入。先将仓库克隆到本地:

git clone https://github.com/qphotoai/dsh-computer-use-windows.git
cd dsh-computer-use-windows

把插件链接到 Web Profile,并在 Profile 的 package.json 中加入:

{
  "dependencies": {
    "dsh-computer-use": "link:C:/你的路径/dsh-computer-use-windows"
  },
  "dsh": {
    "profile": {
      "bundles": ["dsh-computer-use"]
    }
  }
}

不要在 Profile 中单独安装 @deepseek-ai/dsh-tools。插件必须使用 DSH 宿主的同一模块实例,否则工具可能因调度器身份不同出现 undefined.prepare。

安装后验证:

$env:DSH_PROFILE_ROOT = "$HOME/.dsh/profiles/web"
node tools/verify-host-modules.mjs

输出中的 pluginPath 和 hostPath 必须相同。然后重启现有的 dsh web 宿主。

卸载:

.\tools\uninstall-windows.ps1

使用

先观察,再操作:

screen_observe(window="计算器", mode="ax")
computer_click(element=26)
  • window 可传窗口标题子串或 PID。
  • 编号来自最近一次 screen_observe。
  • 快照默认约 15 秒有效;过期后需要重新观察。
  • 原生 Windows 应用优先使用 mode="ax"。
  • Canvas、图片或 UIA 信息不足时使用 mode="vision"。

智谱视觉(可选)

申请智谱 API Key 后,通过环境变量配置:

$env:ZHIPU_API_KEY = "你的 Key"

也可以把 Key 单独保存到:

%USERPROFILE%\.zhipu-key

文件只放一行 Key,并限制为当前用户可读。不要将 Key 写入仓库。

调用:

screen_observe(window="目标窗口", mode="vision")

当前视觉实现调用智谱 GLM,不会自动调用聊天模型自身的视觉能力。视觉结果可能存在文字或坐标误识别,操作后应重新观察确认。

配置

cordis.patch.yml 默认配置:

- insert:
    - id: dsh-computer-use
      name: dsh-computer-use
      config:
        ttlMs: 15000
        maxElements: 500

可配置:

config:
  ttlMs: 15000
  maxElements: 500
  allowedApps: []
  cursorTheme: com.dsh.computeruse.rainbow
  • allowedApps:允许操作的应用白名单;空数组表示不限制。
  • cursorTheme:cua-driver 中已安装的 Agent 光标主题 ID;主题不存在时使用驱动默认光标。

仓库包含上游的 theme.lottie 和 tools/make_theme.py。光标主题的编译与安装方式以 cua-driver 官方文档为准。

开发

node --check index.js
Get-ChildItem lib -Filter *.js | ForEach-Object { node --check $_.FullName }
node --test test/*.test.js
$env:DSH_PROFILE_ROOT = "$HOME/.dsh/profiles/web"
node tools/verify-host-modules.mjs

来源与许可

内容来自项目 README(GitHub)↗

链接

同类插件

查看整个分类 →

社区评论

评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。