dsh-computer-use: Enabling Models to Operate Windows Desktops in DSH

Introduction

When building agents in DeepSeek Harness (DSH), models can typically only read and write to conversations and files. They cannot “see” the current screen or, like a human, click buttons, type text, or switch windows. To apply tasks to real desktop applications, one must either write RPA scripts manually or rely on Computer Use capabilities within closed-source hosts, a chain that is often a placeholder or lacks implementation in the open-source community.

dsh-computer-use reverse-engineers and reconstructs the ZCode Computer Use contract as a DSH plugin. It provides 25 tools with the same names as the upstream version on Windows, covering screenshots, UI Automation, mouse and keyboard, clipboard, etc. It also includes bundled skills and a screen-top operation indicator. The following sections introduce what it is, what it can do, and how to install and configure it.

What is this

The plugin’s positioning is to enable models to see the screen, read application interfaces, click, input, use shortcuts, drag/scroll, and use the clipboard, operating the local Windows machine like a human. The 25 tool names, parameter semantics, coordinate discipline, state_id element addressing, and error code semantics are reconstructed according to the upstream Computer Use contract. The backend is changed to a persistent powershell.exe process, utilizing System.Drawing and UI Automation, without relying on ZCode’s un-open-sourced native Helper.

Architecture Overview

The DSH process side is responsible for reading configuration, registering tools, and self-installing skills. It communicates via stdin/stdout NDJSON (dsh-cua/1) with a persistent PowerShell 5.1 process in src/native/cua.ps1, which handles DPI awareness, screenshots, windows, UIA, input, clipboard, and application launching.

Several design choices related to usage:

  • Tools are registered directly via ctx.tools.register() using the raw JSON Schema accepted by the registry; parameter validation is completed within the plugin’s schema.js.
  • SetProcessDPIAware() is called at startup to avoid inconsistencies between screenshot resolution and UIA coordinate space under high DPI.
  • The protocol is serialized; if a single call times out, the process is terminated and restarted on the next call to avoid attribution errors for late responses.

For more detailed reverse engineering processes, contract forensics, and native protocols, please refer to docs/reverse-engineering.md, docs/zcode-cua-contract.md, and docs/native-protocol.md in the repository.

Core Features

Toolset (25 tools, same names as upstream)

Group Tools
Environment & Observation request_access, list_apps, list_windows, get_app_state, screenshot, zoom
Launch & Focus open_application (Focus window combined with list_windows and foreground semantics)
Mouse left_click, double_click, triple_click, right_click, middle_click, etc. (See README tool table for full list)
Keyboard & Clipboard Includes input, shortcuts, clipboard read/write, etc. (Consistent with upstream toolset)

The tools configuration item is optional:

  • "native" (default): 25 independent tools;
  • "single": Merged into a single computer_use (with action) to reduce schema tokens.

Access Control & Indicator

  • accessMode: auto full automation / ask approval required each time / off disable computer control.
  • allowSubagents: Default false, to prevent sub-agents from controlling the mouse and keyboard when the user cannot see.
  • indicator: Can display a floating layer “DSH is operating the computer” on the top of the screen; indicatorLocale, indicatorShowAction, indicatorAutoHideMs are adjustable.

Bundled Skills

When installSkill: true by default, the skill is installed to <dsh home>/skills/computer-use/ (with ownership marker, does not overwrite user-written versions). For model-side operation instructions, see skills/computer-use/SKILL.md in the repository.

Installation & Activation

The plugin is a standard npm package and includes cordis.patch.yml. The README provides two installation methods; there is no dsh plugin add github:... command. Please follow the steps below.

  1. Open the “Plugins” page in DSH.
  2. Select “Install from Path” and point to the directory where this plugin is located (You need to obtain the repository directory first by downloading or copying; this article does not cover git clone).
  3. Restart DSH.

Method 2: Manually Modify Profile

Edit <dsh home>/profiles/<profile>/package.json (Default Windows example path: %USERPROFILE%\.dsh\profiles\desktop\package.json):

"dependencies": {
  "dsh-computer-use": "link:E:/OpencodeProject/Project/DSH-Plugin/dsh-computer-use"
},
"dsh": {
  "profile": {
    "bundles": [
      // …other bundles
      "dsh-computer-use"     // ← Add here so cordis.patch.yml will be applied
    ]
  }
}

Replace the path after link: with the plugin directory on your local machine. Then execute pnpm install in the profile directory and restart DSH.

The repository also provides an installation script with backup (default preview, no changes):

node tools/install-plugin.mjs                    # dry-run
node tools/install-plugin.mjs --apply --install  # backup + write + pnpm install
node tools/install-plugin.mjs --rollback         # restore from backup

Verify Installation

After installation and restart, ask the model to call request_access in a session: It should report the platform, screen, DPI awareness, monitor count, and backend availability. This is the most direct end-to-end confirmation.

The README also lists multi-layer automated verifications (npm test, npm run smoke, npm run e2e, npm run verify:in-dsh, etc.), which need to be executed in the plugin directory on a real Windows machine; among them, verify:in-dsh will have the model click a fixture button in a real DSH and read the window title again with the native backend to determine success.

Configuration

Configuration file path: <dsh home>/plugins/dsh-computer-use/config.json (use defaults if not present). You can also override inline via config: in the profile’s plugin entry (inline takes precedence).

Field Default Meaning
enabled true No tools will be registered if disabled
tools "native" native or single
warmup true Pre-warm backend on load
installSkill true Install bundled skill to user skills root
accessMode "auto" auto / ask / off
allowSubagents false Whether to allow sub-agents to call computer control
indicator true Whether to show operation floating layer
requestTimeoutMs 30000 Default timeout for single call
screenshotMaxWidth 1600 Max long edge for model-visible screenshots
screenshotMaxBytes 524288 Byte budget for single screenshot
debug false Whether to write native backend stderr to DSH log

For the complete field table, see the “Configuration” section in the README. Example (save tokens + smaller screenshots):

{ "tools": "single", "screenshotMaxWidth": 1280, "screenshotFormat": "jpeg" }

Typical Usage

  1. Confirm the plugin is enabled and DSH has been restarted.
  2. In the conversation, have the model call request_access first to confirm backend availability and that the access mode meets expectations (If accessMode is ask, approval will be required).
  3. Combine tools according to the task chain: For example, use list_windows / get_app_state to get the interface and state_id, screenshot to observe the screen, left_click to operate following element index and coordinate discipline; refer to the installed skills/computer-use/SKILL.md for complex flows.

The plugin also exports ./client as a library for direct invocation of the same capabilities on the Node side (see exports in package.json).

Scenarios & Notes

Who is it for

  • Agent developers doing Windows desktop automation in DSH who need model screen reading and UIA.
  • Those who want the toolset aligned with the ZCode Computer Use contract for easier migration of prompts or skills.

Important Notes

  • Windows Only: The os restriction in package.json does not apply to Linux/macOS.
  • Permissions & Trust: The plugin operates the local desktop (mouse, keyboard, clipboard, launch apps) with the current DSH process permissions. Read the source code and the MIT License before installation, and understand the meanings of accessMode and allowSubagents.
  • Ecosystem Note: DSH advocates “Everything is a plugin”; SkillHub etc. are community directories, with no official affiliation to DeepSeek / High-Flyer. This article does not describe them as official app stores.
  • Upstream Background: Computer Use in the ZCode open-source tree was previously an unavailable placeholder; this plugin is an implementation reconstructed based on the remaining contract and documentation. See docs/zcode-cua-contract.md in the repository for unresolved parts.

Conclusion

dsh-computer-use connects the 25-tool Computer Use surface and Windows native backend to DSH, accompanied by access gates, operation indicators, and bundled skills. If you need to let models “see and operate” local Windows in the Harness, you can obtain the plugin from the directory page or GitHub, install it via path or profile as per the README, and use request_access for first-time acceptance.

  • Directory Page: https://www.skillhub.cn/plugins/JHyugou/dsh-computer-use
  • GitHub: https://github.com/JHyugou/dsh-computer-use
羽毛球分组比赛记分
小程序二维码

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

Xiaoye