deepseek-computer-use: Operating Windows Desktop in DSH

Preface

When doing automation in DeepSeek Harness (DSH), many tasks get stuck on “no API, only GUI clicking”: filling forms, clicking buttons, reading window state. The official documentation already has experimental Computer Use solutions (e.g., Cua Driver MCP and native providers), and Windows can also use the upstream Cua Driver. If you want to use an independent community implementation on local Windows—UI Automation, window screenshots, mouse/keyboard, session authorization and approval auditing—you can take a look at deepseek-computer-use published by maintainer STARDUSTLC666. This article organizes installation, capabilities, and caveats based on the repository README and package information; this plugin is categorized as a “client” plugin in the DSH community directory, not an official DeepSeek product (official packages are under the @deepseek-ai/* scope).

What is this

deepseek-computer-use connects to the host through DSH’s apply(ctx) / inject / bundle patch, registering 16 Computer Use tools for the model: window discovery, screenshot observation, mouse/keyboard, control operations, and optional system audio recording. The underlying layer uses UI Automation + SendInput + Windows.Graphics.Capture; the tool semantics reference Codex window2, and are adapted to DSH’s session, approval, and screenshot attachment mechanisms.

The typical flow is: first observe with list_windows / get_window_state (accessibility tree + optional screenshot), then perform operations like click, type_text, set_value; after failures or interface changes, re-observe to avoid clicking on stale element IDs.

Core Features

Tool Overview

The tools listed in the README and their functions are as follows (excerpted to explain usage directions):

Tool Function
list_apps List applications with operable windows and their windows
list_windows List visible windows: id, title, application, z-order, bounds
get_window Re-read a window by id
launch_app Launch an application (with optional arguments), requires approval by default
get_window_state Observe: numbered accessibility tree + (optional) window screenshot
click Click by element ID or window-relative coordinates
press_key Single key or key combination (X keysym style)
type_text Inject Unicode text
scroll / drag Scroll and drag
set_value Directly modify control value using Value pattern
perform_secondary_action Secondary actions such as Invoke, Expand, Toggle
activate_window Bring a window to the foreground
start_audio_recording / stop_audio_recording System audio loopback recording (requires configuration to enable)
computer_use_health Self-check helper, compiler, policy, window count

Screenshots are saved via DSH attachments and output as image blocks visible to the model; sensitive operations go through approval.request and are written to the session audit log. Tool calls on the same desktop are executed serially; authorization, helper, screenshot, and element snapshots are saved independently per session.

Runtime and Native Components

  • Platform: Windows 10/11 (os: ["win32"] in package.json)
  • Node: ≥ 18.17
  • Zero npm native dependencies, zero .NET runtime dependencies: helper and overlay are compiled on the fly using the system’s built-in csc.exe; screen capture (WGC) and audio recording (WASAPI) are net48 programs that rely on the system’s built-in .NET Framework 4.8.
  • The helper and overlay are automatically compiled on the first call to any Computer Use tool (about 1 second). For optional capabilities such as screen capture/audio recording, you can run npm run build in the package directory; without the .NET SDK, screen capture can fall back to PrintWindow, and audio recording will report audio_missing.

In-Use Indicators and Security

During operation, there are two layers of overlay similar to Codex: screen edge breathing indicator and virtual cursor; the user can press Esc to cancel operations within the current turn. The security model includes application whitelist/blacklist (allowApps / denyApps), three approval tiers (never / sensitive / always), foreground window validation, element snapshot TTL (default 120 seconds), and dryRun rehearsal mode. Without the DSH approval service, requests requiring approval will be directly rejected without silent degradation.

The plugin runs with the current dsh process privileges and can access resources within the local user’s visible desktop and file capability boundaries; before installation, it is recommended to read the source code and MIT license, and configure allowApps, denyApps, and approval according to team standards.

Installation and Activation

Environment requirements: Windows 10/11, Node ≥ 18.17, as well as system-built UI Automation, .NET Framework 4.8, and other components.

Install the package via npm

npm install deepseek-computer-use

Package URL: npmjs.com/package/deepseek-computer-use

Enable it in the local profile’s cordis.patch.yml (consistent with the README example):

- insert:
    - id: deepseek-computer-use
      name: 'deepseek-computer-use'

In package.json, dsh.bundle.patch points to ./cordis.patch.yml, and the patch inserts the plugin line into the host configuration.

Via DSH plugin command (example profile: web)

The Git Bash example given in the README:

dsh plugin --profile web add deepseek-computer-use
dsh web --no-open

After installation, restart the host and let the model call computer_use_health for a self-check. For development, you can change the dependency to a local path, e.g., file:E:/deepseek/dsh-computer-use, to load the source code.

Optional build (helper, overlay, and attempt dotnet compilation of capture/audio):

npm run build

Configuration Example

Can be set in the patch or plugin configuration (field meanings are based on the README):

- id: deepseek-computer-use
  config:
    approval: sensitive            # never | sensitive | always
    allowApps: ["notepad", "chrome"]   # empty = unrestricted
    denyApps: []
    defaultIncludeScreenshot: true
    maxElements: 260
    snapshotTtlMs: 120000
    dryRun: false
    toolPrefix: ''
    timeoutMs: 10000

approval: sensitive is the default: it will ask when element labels hit dangerous words or launch_app; the host-side approval policy and the plugin item approval: never have different meanings, and application-level authorization is separately controlled by mechanisms such as appConsent, as detailed in the “Security Model” section of the README.

Typical Usage and Self-Check

  1. Start a Web or CLI session in the DSH profile with the plugin enabled.
  2. Let the model call computer_use_health first to confirm the helper and policy are normal.
  3. Use list_windows or list_apps to locate the target, then get_window_state to get the numbered tree and screenshot.
  4. Based on the observation results, execute click, type_text, set_value, etc.; if fresh_observation_required is returned, you must re-run get_window_state before operating.

Test commands provided by the repository (do not depend on the model):

npm test               # argument/policy regression + WinForms integration verification
npm run test:contracts # only arguments and policy, does not operate the desktop
npm run test:harness -- --dsh-root /path/to/node_modules/@deepseek-ai/dsh

test:harness starts an isolated real DSH CLI/profile, verifies attachments, approval, and native operations, and does not call the model or record audio.

Suitable Scenarios and Notes

Suitable for: automating Windows desktop software without stable APIs in DSH conversations; wanting tool contracts close to window2 semantics, with built-in DSH session authorization, approval, and interrupt recovery (timeout/cancel stops the helper, and native processes are cleaned up at the end of the turn).

Not suitable or things to know: only supports Windows; overlaps with official Computer Use / Cua Driver functionality, and the README explicitly states that no effectiveness or performance comparison has been made with the official drivers. The community directory (such as SkillHub) has no official affiliation with DeepSeek / 幻方, and the plugin is community-maintained.

If you encounter problems or have improvement suggestions, you can submit issues and PRs on GitHub.

Conclusion

deepseek-computer-use brings Windows desktop observation and operation into the DSH tool surface: 16 tools, attachment-based screenshots, approval and auditing, serial native RPC. After installing to the profile as described above, configuring security settings, and verifying with computer_use_health, you can handle GUI-dependent tasks in the Harness.

羽毛球分组比赛记分
小程序二维码

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

Xiaoye