dsh-control: Enabling Desktop and Browser Control for DeepSeek Harness Agent

Introduction

The Agent in DeepSeek Harness (DSH) runs by default in a local process. It can perform text-based reasoning but cannot operate the desktop or a browser. Developers often need to combine it with external scripts, resulting in fragmented workflows that are hard to reuse.

dsh-control is a DSH plugin that provides two layers of capability within the DSH process: a desktop layer and a browser layer. The desktop layer uses PowerShell + Win32 to implement screenshots, mouse and keyboard input, and window management. The browser layer launches a standalone Edge/Chrome instance via the Chrome DevTools Protocol (CDP) and drives page elements using CSS selectors. The Agent can call these tools directly without switching to external programs.

What Is This

  • Name: dsh-control
  • Maintainer: Jinquan-Leung
  • Category: Web tool
  • Stars: 0
  • Description: Desktop and CDP browser control for DeepSeek Harness agents: screenshots, mouse, keyboard, windows, plus selector-based page driving.
  • Problem Solved: Gives the Agent “eyes and hands” in a local environment to perform screenshots, clicks, typing, window operations, and page automation.

Core Features

The plugin provides two categories of tools:

Desktop Layer (PowerShell + Win32)

  • screenshot: Captures the entire virtual screen or a specified region and returns a PNG path.
  • mouse: Absolute-coordinate movement, click, double-click, right-click, and scroll.
  • keyboard: type uses clipboard paste (safe for Chinese text); press uses SendKeys (supports hotkeys such as ^c, %{F4}, {ENTER}).
  • list_windows: Enumerates visible top-level windows, returning hwnd, PID, coordinates/dimensions, minimized state, and title.
  • focus_window: Restores and brings a window to the front by hwnd (the system may deny focus switching).
  • open: Opens a URL / file / directory with the Windows default handler.

Browser Layer (CDP)

  • browser_open: Launches the browser (if not already running) and navigates to a URL, waiting for readyState === complete. Returns the final URL and title.
  • browser_text: Reads the innerText of the entire page or a specified selector.
  • browser_click: Dispatches real mouse events after centering the element, located by selector + index.
  • browser_type: Focuses the element and uses Input.insertText (safe for Chinese text), with an optional Enter key submission.
  • browser_wait: Polls until the selector matches, avoiding clicks on unrendered elements.
  • browser_eval: Executes any expression within the page (supports iframe / shadow DOM fallback).
  • browser_screenshot: Protocol-level screenshot (full page supported), returns a PNG path.
  • browser_close: Closes the browser and session launched by this plugin.

Installation & Enablement

  1. Clone or download the repository into your DSH workspace:
git clone https://github.com/Jinquan-Leung/dsh-control.git
  1. In DSH, go to Settings → Plugins → Add Plugin and select that directory.
  2. Desktop control appears in the plugin list once it is active (refresh the page if necessary).

You can also install the same directory via plugin_manager’s install_bundle.

Typical Usage

Using the browser layer as an example: open a page, then read content via selectors, click elements, and type/submit.

  1. Open a page:
browser_open("https://example.com")
  1. Read text:
browser_text("#title")
  1. Click an element:
browser_click("#submit")
  1. Type content into an input field and submit:
browser_type("#input", "value")
browser_type("#input", "\n")
  1. Take a screenshot and save it:
browser_screenshot("page.png")
  1. Close the browser:
browser_close()

The desktop layer works similarly: first use screenshot to capture the current screen, then perform mouse and keyboard operations based on the coordinates.

Use Cases & Notes

  • Suitable for: Scenarios where the Agent needs to perform screenshots, clicks, typing, window operations, or browser automation locally.
  • Caution: All operations execute on the local machine with the Harness user’s permissions. It is recommended to review the source code and license (MIT) before installation.
  • Security boundaries:
  • Desktop tools produce real input events; a click at a given coordinate will deliver the event to whatever window happens to be at that coordinate at the time. It is recommended to use screenshot first to read coordinates before acting.
  • keyboard sends input only to the currently focused window. Use focus_window before typing.
  • The plugin does not access the network, does not report data, and does not write to the registry. Screenshots and temporary profiles are stored in %TEMP%\dsh-control\ and can be deleted at any time.
  • Windows only (the desktop layer depends on PowerShell + Win32; the browser layer requires a local Edge or Chrome). Verified environment: Windows 11 + DSH 0.2.2-rc.5.

Summary

dsh-control integrates desktop operations and browser CDP control into the DSH plugin system, enabling the Agent to perform screenshots, clicks, typing, window management, and page automation in a local environment. For Agents that need to run multimodal or browser-automation tasks on Windows, this is a ready-to-use toolkit.

  • Plugin homepage: https://www.skillhub.cn/plugins/Jinquan-Leung/dsh-control
  • Source repository: https://github.com/Jinquan-Leung/dsh-control
羽毛球分组比赛记分
小程序二维码

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

Xiaoye