Introduction

The philosophy of DSH is “everything is a plugin.” For scenarios requiring quick image provision in the chat input box, existing methods might involve saving local files first, taking external screenshots, and finally pasting, which lacks a unified entry point.

dsh-composer-image-tools is a DSH plugin maintained by ai-yucheng, used to add two entry points—image upload and custom area screenshot—to the chat input box toolbar, and inject the images into the DSH draft image track for sending with messages.

What is this

dsh-composer-image-tools is a plugin for DSH, licensed under MIT, self-implemented, with zero dependencies.

The core problem it solves is: providing an “image viewing” entry in the DSH chat input box, including local image upload and custom area screenshot.

Core Features

Image Upload

  • Opens the system file picker, supporting multi-select image upload.
  • Selected images will be injected into the DSH draft image track.
  • Files larger than 10MB will be automatically intercepted; the reason is that excessively large images consume a large amount of tokens.

Area Screenshot

  • After clicking the toolbar screenshot button, enter full-screen mask mode.
  • Hold down the left mouse button and drag to box-select the area, then release to automatically crop the selection into an image and enter the draft area.
  • Supports using Esc to cancel the screenshot selection.
  • The screenshot is based on Electron main process desktopCapturer capturing the whole screen and does not depend on WeChat or external screenshot tools.
  • Browser getDisplayMedia is unavailable in DSH’s Electron environment, so the screenshot route goes through the plugin server-side main process.

Parallel with Clipboard Paste

  • If a screenshot has already been completed using WeChat Alt+A, you can directly use Ctrl+V to paste the image in the DSH input box.
  • This path does not require clicking the plugin button and does not interfere with the plugin’s custom box screenshot.

Installation and Enablement

Execute the installation command in the DSH profile directory:

pnpm add dsh-composer-image-tools

Then, in the profile’s package.json, confirm that dsh.profile.bundles includes:

"dsh-composer-image-tools"

After enabling, you need to:

  1. Restart DSH Desktop so that the server-side screenshot route takes effect.
  2. Hard refresh the browser (shortcut key is Ctrl+Shift+R).
  3. Check the chat input box toolbar to confirm the appearance of the image upload button and area screenshot button.

Note: The provided materials do not explicitly state that the current package has been published, so the actual environment might require source code linking installation. The plugin will run with the permissions of the current dsh process; you should check the source code and license before installing.

Typical Usage

Upload Local Images

  1. Click the toolbar image upload button.
  2. Select one or more images not exceeding 10MB in the system file picker.
  3. The image appears in the draft area above the input box.
  4. Enter supplementary text (optional); then send.

Custom Area Screenshot

  1. Click the toolbar area screenshot button.
  2. The screen displays a full-screen mask and enters box-selection state.
  3. Hold down the left mouse button and drag to box-select the area to be captured.
  4. Release the mouse; the selection is automatically cropped into an image and appears in the draft area.
  5. If cancellation is needed, press Esc.

Paste from Clipboard

  1. Use external methods like WeChat Alt+A to complete the screenshot.
  2. Press Ctrl+V in the DSH input box.
  3. After the image enters the input box draft area, you can send it.

Applicable Scenarios and Notes

Suitable for the following situations:

  • Need to add image entry points to the DSH chat input box.
  • Want to complete local image upload and custom area screenshot within the input box.
  • Do not want to rely on WeChat or external screenshot tools for area screenshot.
  • Need to limit upload size to avoid extremely large images consuming a large amount of tokens.

Usage notes:

  • Images larger than 10MB will be intercepted.
  • Before using area screenshot, you need to restart DSH Desktop so that the server-side screenshot route takes effect.
  • Need to confirm that dsh.profile.bundles includes dsh-composer-image-tools.
  • The screenshot is based on Electron main process desktopCapturer capturing the whole screen; browser getDisplayMedia is unavailable in DSH’s Electron environment.
  • The plugin runs with the permissions of the current dsh process; you should check the source code and MIT license before installing.

Links

  • GitHub: https://github.com/ai-yucheng/dsh-composer-image-tools
  • Plugin Directory Page: https://www.skillhub.cn/plugins/ai-yucheng/dsh-composer-image-tools