dsh-composer-shot: WeChat-Style Area Screenshot in the DSH Input Box

Introduction

When chatting with the model in DeepSeek Harness (DSH), it is often necessary to paste screenshots of the interface, logs, or errors from the screen into the current session. System screenshot tools, clipboard pasting, and manual file dragging each have their own workflows, and captured images may not necessarily go directly into the input box draft. dsh-composer-shot is a DSH client plugin maintained by TheTao-xt: it adds a screenshot button and a “Hide Window” toggle to the toolbar at the bottom of the chat input area. The captured PNG enters the current draft as an image attachment and will not be sent automatically. The following sections explain how to implement this, covering installation, usage, and limitations.

What is it

dsh-composer-shot is designed for Windows users who have the DSH desktop client installed (specifically Windows 10/11 x64). It injects two controls into the conversation.input.right slot of the composer: a camera icon for area screenshots and an eye toggle immediately to its left, used to temporarily hide the entire DSH window before taking a screenshot. Logic is performed locally: screenshots use 127.0.0.1 loopback HTTP, images are transferred via the system temporary directory, without uploading, telemetry, or external logging. Package version is 1.0.4, license MIT, and requires DSH version >=0.2.1-rc.2 <0.4.0-0.

Community directory page: https://www.skillhub.cn/plugins/TheTao-xt/dsh-composer-shot; Source code and documentation: https://github.com/TheTao-xt/dsh-composer-shot. The directory site is an ecosystem index and has no official affiliation with DeepSeek / HF.

Core Features

Screenshot (WeChat-style interaction)

Upon clicking the camera, the screen freezes with a gray/black overlay, green border, eight handles, and a size label. Drag to select an area, then press Enter or click ✓ to confirm, or Esc or ✕ to cancel. The confirmed PNG enters the current session draft as an image attachment.

During screenshotting, the camera icon becomes a spinner; clicking it again cancels. Only one screenshot session is allowed at a time; repeated requests return 409 (message: “Previous screenshot not finished”). Failures use a bottom toast notification; no alert popups.

Hide DSH Window

When the eye toggle is enabled, clicking the camera first hides the entire DSH window (waiting ~120ms) before screenshotting. It automatically restores after selection, cancellation, or error. When the toggle is off, screenshotting works normally (the screenshot may include the DSH window itself). The toggle state is saved in localStorage with the key name dsh-composer-shot.hide-dsh.

Style and Theme

Controls only use --dsh-alias-* design variables and follow the DSH light/dark theme. Styles are marked with data-plugin and injected only once. Buttons use CSS order: 1, positioned after the model selector and before voice or send buttons.

Native Helper

No npm runtime dependencies. lib/ShotHelper.cs is provided with the package and compiled by the system’s built-in .NET Framework 4 csc.exe on first use (approx. 1 second), resulting in dsh-shot-helper.exe, which is then reused. The install script can pre-compile the helper to %LOCALAPPDATA%\dsh-composer-shot\.

Installation and Enablement

The DSH desktop client must be installed; the dsh CLI is usually provided by the desktop runtime, with the path varying by installation location.

Install from Marketplace (Recommended): Open Plugins → Discover in DSH, search for dsh-composer-shot and install; or enable it in Settings → Plugins page.

Install from npm (PowerShell, replace dsh.cmd with your local path):

& "$env:LOCALAPPDATA\Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add dsh-composer-shot

Install from Repository Archive / Script: Execute in the directory containing install.ps1 and *.tgz:

powershell -ExecutionPolicy Bypass -File .\install.ps1

The script parses the dsh CLI, executes dsh plugin --profile desktop add <tgz>, confirms the profile’s bundle record, and optionally pre-compiles the helper.

After installation, refresh the DSH window (Ctrl+R) or restart the desktop client; the English summary in the README also notes that when completely closing and reopening DSH, the plugin combination is determined at process startup, so simply reloading the renderer may not be enough. Two buttons (eye and camera) should appear in the bottom right corner of the input area.

plugin add writes the plugin to the profile’s package.json (dependencies and dsh.profile.bundles); this plugin does not modify the user-level cordis.yml / cordis.patch.yml.

Typical Usage

  1. If you don’t want the DSH interface captured in the image, open the eye toggle first.
  2. Click the camera and drag to select an area on the frozen screen; dragging in empty space creates a new selection, dragging inside the selection moves it, and dragging the eight handles resizes it (minimum 4x4 physical pixels).
  3. After confirming with Enter or ✓, the PNG enters the current draft; you can continue editing before sending. The screenshot is not sent automatically.

Overlay shortcuts (consistent with README):

Operation Effect
Enter / ✓ Confirm, write PNG and insert into draft
Esc / ✕ / Right-click Cancel
Click spinner Cancel current screenshot

Uninstall example:

powershell -ExecutionPolicy Bypass -File .\uninstall.ps1

Thoroughly clean compilation cache:

powershell -ExecutionPolicy Bypass -File .\uninstall.ps1 -Purge

How it Works (Troubleshooting)

Client lib/client.js renders the button, POST /dsh-shot/capture waits for the PNG, and then inserts it into the draft via [data-composer-card] drop (within 700ms) or a fallback paste. Host lib/index.js provides /dsh-shot/ping, /dsh-shot/capture, /dsh-shot/cancel, compiles and manages dsh-shot-helper.exe; all handlers only allow loopback access via ctx.connection.requestRejection. The native layer is responsible for full-screen freezing, optional hiding of the DSH top-level window, TopMost selection, and lossless PNG clipping output.

When “Hide Window” is enabled, the selection must be completed in the native layer; otherwise, the Web layer cannot draw the selection after the window is hidden. The restoration sequence is hide → wait → screenshot → immediately restore → show overlay again. There are fallbacks like --show-exe to prevent the window from being invisible for too long. For hide-related diagnostics, check %LOCALAPPDATA%\dsh-composer-shot\capture.log.

Applicable Scenarios and Notes

Suitable for: Developers or regular users on Windows using the DSH desktop client who need to quickly put a screen area into the current conversation draft.

Permissions and Security: The plugin runs with the permissions of the current DSH process. Before installing, read the source code and MIT license to confirm that local compilation and loopback HTTP behavior are acceptable.

Known Limitations (excerpted from README):

  • Only Windows 10/11 x64; buttons may be grayed out or error out on non-Windows or missing .NET Framework 4.
  • Selection hints are in English and do not change with DSH language.
  • No scrolling long screenshots, window auto-recognition, or doodling; only area screenshots are supported.
  • In hide mode, DSH may be invisible on screen for about 1–3 seconds from clicking screenshot to finishing selection; this is by design.
  • Multiple virtual desktops, HDR/wide gamut, first compilation delay, draft DOM structure changes causing insert failure, etc., see the “Known Limitations” section in the repo README.

When both insertion channels fail, a message “Screenshot generated but not inserted into draft” will appear; you need to rescreenshot.

Conclusion

dsh-composer-shot brings WeChat-style area screenshots and an optional “hide DSH before screenshot” feature into the composer toolbar. PNGs go straight to the draft without auto-sending, and data stays local. Installation and details are based on the repository README.

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

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

Xiaoye