dsh-wsl-uia: Observing and Controlling the Windows UI from WSL

The philosophy of DeepSeek Harness is “everything is a plugin.” When developing agents in a WSL environment, operating the host Windows graphical interface usually requires bypassing permission isolation or setting up complex IPC channels. The dsh-wsl-uia plugin, introduced below, provides Windows UI Automation (UIA) observation and operation capabilities directly from inside WSL.

Plugin Positioning

This is a plugin maintained by user 173787247. It allows enumerating top-level windows in WSL, reading element trees within a controlled scope, and identifying elements using observation-based handles. It is part of dsh-wsl-kit.

Core Features

The plugin provides the following capabilities:

  • Enumerating top-level windows
  • Reading element trees within a controlled scope
  • Supporting observation-based handles
  • Finding controls by control type and actionability
  • Invoking controls by position or name

Installation

Install it using the official command:

dsh plugin --profile web add github:173787247/dsh-wsl-uia

Typical Usage

Operations are performed through the uia_tree command. The following are a few common invocation methods:

List all top-level windows:

uia_tree action=windows

Read the element tree structure of a specific process, limiting depth and element count:

uia_tree action=tree pid=1234 maxDepth=6 maxElements=200

Find actionable button controls:

uia_tree action=find controlType=Button actionableOnly=true

Applicable Scenarios and Notes

Environment Requirements

  • The plugin requires DeepSeek Harness to run inside WSL.
  • The host Windows system must have PowerShell available at the standard path (the plugin locates it automatically).

Technical Details

  • Handle Format: The handle carried by each element has a format such as 1790525657168.6. The number before the dot is the observation timestamp (epoch), which allows references based on older handles to remain identifiable.
  • Element Indices: While a window is alive, element indices are not stable unique identifiers; two traversals of the same tree may produce different index results.
  • Control Invocation: When invoking a control, prefer passing the expectName parameter to win_invoke instead of relying solely on position.

Compatibility

  • Plugin Version: dsh-wsl-uia 0.1.0
  • Dependency Requirement: DSH version ≥ 0.1.2
  • Runtime Environment: Node.js >= 18

Conclusion

With this plugin, cross-system UI operations can be performed within a WSL environment. For more details, refer to the catalog page or the GitHub repository.

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

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

Xiaoye