dsh-plugin-screenshot: Enabling Models in DSH Sessions to Truly 'See' the Screen

Introduction

DeepSeek Harness (DSH) reserves a tool capability slot for “computer use” scenarios, but the desktop host does not come with native screen capture functionality. When developers are debugging UI, cross-referencing error windows, or asking the model for suggestions based on the current interface, they often have to dictate descriptions or manually paste images, as the session cannot directly read the screen state.

Below is an introduction to the community plugin dsh-plugin-screenshot (maintainer HsgtLgt). It registers a tool named screenshot with Cordis on Windows. Upon invocation by the model, it returns the PNG path within the workspace and displays the image via native DSH image blocks. The SkillHub directory classifies it as “Model Inference”; at the time of writing, it has 0 GitHub stars, is licensed under MIT, and the current package version is 0.0.5.

What is this

dsh-plugin-screenshot is a screenshot tool plugin for DeepSeek Harness (Windows host). In one sentence: it captures the entire virtual desktop or a specific window matched by title, saves it as a PNG, and returns it to the model and user in the session as an attachment.

Compared to common approaches that only use CopyFromScreen, this plugin includes additional handling for scenarios such as occlusion, minimized windows, and blank frames in some GPU applications (see “Capability Comparison” below).

Core Features

The plugin registers the screenshot tool at runtime. Its main capabilities are as follows (sourced from the project README and implementation notes):

  1. Full Screen / Multi-Monitor: When target=screen (default), captures the multi-monitor virtual desktop.
  2. Window by Title: When target=window, performs case-insensitive title substring matching via window_title.
  3. Occluded Windows: Uses PrintWindow(PW_RENDERFULLCONTENT) to force the window to self-render, allowing capture of window content even when completely covered by other windows.
  4. Blank Frames in GPU Apps: For cases like RustDesk, Chrome, or Electron apps that may return blank frames after occlusion, the plugin performs sampling detection and automatically “temporarily brings the window to the front” as a fallback using CopyFromScreen, then restores the original foreground window after capture.
  5. Minimized Windows: Automatically restores → captures → then minimizes again.
  6. Persistence and Display: PNG is written to the session workspace; simultaneously, it is validated/downsampled via ctx.attachments.saveImage() and added to the DSH attachment library. The tool description stipulates: when a user explicitly names an application, the window mode must be used; upon success, the model embeds and displays the image using ![Screenshot](<path>).

Capability Comparison (Standard CopyFromScreen vs. This Plugin)

Scenario Standard CopyFromScreen dsh-plugin-screenshot
Window visible on screen Supported Supported
Window completely occluded by others Captures top-layer content Supported (PrintWindow)
Blank frames from GPU-rendered apps after occlusion — Sampling + Temporary Foreground Fallback
Minimized window Not Supported Supported (Restore, Capture, Minimize)
Tray icons (no rendering surface) Not Supported Explicit error prompting to restore first
Remote Desktop windows (RustDesk / ToDesk etc.) Unstable README states tested and functional

Environment and Dependencies

  • Platform: Windows 10 and above (README badge specifies Windows 10+).
  • DSH / Cordis: Requires DeepSeek Harness ≥ 0.2.0; peer dependencies @deepseek-ai/dsh-tools and @deepseek-ai/cordis (^0.2.0-rc.2) are provided by the runtime tree and do not need to be installed separately in the plugin directory.
  • Implementation: No additional native dependency packages; utilizes PowerShell to call user32 and System.Drawing.
  • Model Side: Must support image input; otherwise, the image blocks returned by the tool cannot be utilized by the model.

Installation and Activation

The installation method provided in the official README involves cloning the repository first, then installing the local bundle via the DSH plugin manager (plugin_manager). The steps are as follows:

  1. Clone the plugin repository (PowerShell):
git clone https://github.com/HsgtLgt/dsh-plugin-screenshot.git
  1. Execute install_bundle in plugin_manager, pointing the path to the plugin root under the cloned directory (note the file: prefix and the full path):
file:<cloned_directory>/dsh-plugin-screenshot
  1. Restart the DSH application to enable the plugin.

Community Directory Page: https://www.skillhub.cn/plugins/HsgtLgt/dsh-plugin-screenshot. SkillHub is an independent community site with no official affiliation to DeepSeek / High-Flyer. Please review the source code and MIT license yourself before installation, and be aware that the plugin runs with the permissions of the current DSH process.

Tool Parameters

Parameter Type Description
target screen | window Screenshot target, defaults to screen
window_title string Used for title substring matching when target=window
output_path string Optional; relative to session workspace. Defaults to screenshots/screenshot-<timestamp>.png

Typical Usage

The model simply calls screenshot within the session; developers do not need to write separate HTTP interfaces. Illustrative parameter combinations are as follows.

Capture Full Screen (Default):

{
  "target": "screen"
}

Capture Window with Title Containing Keyword (Should use window when user explicitly mentions an application):

{
  "target": "window",
  "window_title": "Visual Studio Code"
}

Specify Save Path (Relative to workspace):

{
  "target": "screen",
  "output_path": "screenshots/debug-ui.png"
}

Call Chain Summary: Parse output_path → Subprocess PowerShell matches HWND, handles minimize/PrintWindow/blank fallback → Write PNG → Read back bytes → Attachment library persistence → Return path and image block.

Use Cases and Notes

Who it is for: Agent or local assistant scenarios using DSH on Windows where the model needs to participate in “looking at the screen to make decisions”; classified under “Model Inference” in the directory, essentially a tool plugin providing visual input to the model.

Known Limitations (From README):

  • For GPU hardware-rendered windows that have been occluded for a long time, there is a slight chance of capturing an outdated frame (not blank but old content); simply re-capturing usually resolves this.
  • Hidden/tray windows that have never rendered content do not have a capturable surface and will trigger an explicit error.
  • Windows only; do not install on unsupported platforms.

Security and Trust: The plugin launches PowerShell and manipulates window Z-order and screen pixels; before installation, please read lib/index.js and the bundle configuration in the GitHub Repository to ensure it complies with your environment policies.

Conclusion

dsh-plugin-screenshot fills the gap in the DSH Windows desktop host regarding the lack of a first-class screenshot tool, and incorporates practical solutions for issues like occlusion, minimized windows, and blank frames in certain GPU applications. If your session requires the model to “see” the local interface, you can install the bundle via plugin_manager as described above and restart DSH.

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

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

Xiaoye