DeepSeek Harness GUI Operator Plugin

Introduction

The plugin-based architecture of DeepSeek Harness (DSH) allows developers to extend an agent’s capabilities on demand. When an agent needs to directly interact with desktop applications or handle logged-in web forms, conventional text/code interaction capabilities are often insufficient. The dsh-gui-operator plugin provides DSH with the ability to “see and operate the Windows desktop,” including screenshots, UI Automation control trees, real mouse/keyboard input, and access to logged-in browser sessions via the Chrome DevTools Protocol.

This plugin does not generate or record automation scripts. Instead, it adopts an “observe-act-re-observe” loop, mirroring the rhythm of a human operating a computer.

Plugin Overview

dsh-gui-operator is a DeepSeek Harness workflow plugin developed by maintainer zeyeyuki. It provides an agent with two layers of operational capability: native Windows desktop interaction (via UI Automation) and browser interaction (via CDP). The native portion is implemented as a C# console application compiled by csc.exe bundled with Windows, while the browser portion relies solely on the runtime’s fetch and WebSocket, resulting in zero npm dependencies.

Core Capabilities

The plugin provides the following tools:

desktop_observe

Captures a screenshot of the current desktop, a list of open windows, and the UI Automation control tree for a specific window. The control tree includes button/menu names, current values of input fields, and body text from documents and pages.

desktop_act

Performs real mouse/keyboard actions on a window or control: click, double-click, right-click, move, drag, scroll, key combinations, text input, window focus, and wait.

browser_open

Launches an Edge or Chrome browser instance with a debug port and a dedicated persistent profile.

browser_observe

Reads information about the current browser page: URL, title, visible body text, form fields (password fields do not return their values), clickable elements, and their CSS selectors.

browser_act

Performs actions on the browser page: navigate, click, type, press keys, scroll, execute page scripts, take screenshots, and manage tabs.

Installation & Activation

First, clone the plugin repository:

git clone https://github.com/zeyeyuki/dsh-gui-operator.git

The installation method depends on your DeepSeek Harness version:

  • Desktop edition: Select “Add Plugin” from the “Plugins” menu and point it to the cloned directory.
  • CLI: Use plugin_manager’s install_bundle to point to the directory.

After installation, the plugin will prompt you to build the native helper before first use:

powershell -ExecutionPolicy Bypass -File .\native\build.ps1

The script locates csc.exe in %WINDIR%\Microsoft.NET\Framework64\v4.0.30319, resolves the UI Automation assemblies from the GAC, and produces native\gui-operator.exe. The build artifact is not committed to the repository; it must be built once after cloning.

Typical Usage

The standard workflow with this plugin is to open the browser and log in manually first, then let the agent perform the operations.

Browser Operation Example

browser_open    { "url": "https://mail.example.com" }
browser_observe { "maxText": 8000 }
browser_act     { "action": "type",  "selector": "#search", "text": "Quarterly Report" }
browser_act     { "action": "click", "text": "Search" }

Native Desktop Operation Example

desktop_observe { "window": "Notepad", "maxElements": 60 }
desktop_act     { "action": "click", "ref": "e12" }
desktop_act     { "action": "type",  "text": "First line" }
desktop_act     { "action": "key",   "keys": "ctrl+s" }

In native applications, use ref to reference elements, avoiding reliance on screen coordinates. A ref is composed of the window handle, control path, type, and name. It is re-resolved and validated before every action to ensure the target is still valid.

Use Cases & Limitations

The plugin is well-suited for scenarios where an agent needs to directly interact with desktop applications or handle web forms that require login. However, note the following limitations:

  • Windows 10/11 x64 only.
  • UI Automation cannot perceive custom-drawn interfaces (e.g., games, some Electron windows) or windows belonging to processes with higher privilege levels. In such cases, it falls back to screenshot + coordinate-based interaction.
  • The UAC Secure Desktop, lock screen, and exclusive fullscreen games cannot be observed or operated.
  • Password fields only report their existence; their values are never returned.
  • browser_observe only reads the top-level frame; cross-origin iframes are not included.
  • The browser must be the one launched with a debug port (created by browser_open).

Security Design

The plugin has no command execution, file read/write, registry, or process management tools, keeping the blast radius of accidental operations small. However, browser_act eval is equivalent to executing arbitrary same-origin JavaScript on a logged-in site, and desktop_act can also trigger destructive actions such as clicking “Delete.” Therefore, the agent should be required to state its intent before performing an action.

The plugin registers a system prompt (gui-operator-routing) that explicitly instructs the agent to use these tools when it needs to see the screen, interact with software, or operate a logged-in page, preventing the agent from arbitrarily choosing tools.

Summary

dsh-gui-operator provides DeepSeek Harness with the ability to directly interact with the Windows desktop and browser sessions. Through UI Automation and the Chrome DevTools Protocol, it gives the agent “sight” and “touch.” With its lightweight design and zero npm dependencies, it is well-suited for scenarios requiring precise desktop application interaction or handling of complex login forms.

Directory Page | GitHub

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

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

Xiaoye