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
Escto cancel the screenshot selection. - The screenshot is based on Electron main process
desktopCapturercapturing the whole screen and does not depend on WeChat or external screenshot tools. - Browser
getDisplayMediais 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 useCtrl+Vto 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:
- Restart DSH Desktop so that the server-side screenshot route takes effect.
- Hard refresh the browser (shortcut key is
Ctrl+Shift+R). - 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¶
- Click the toolbar image upload button.
- Select one or more images not exceeding 10MB in the system file picker.
- The image appears in the draft area above the input box.
- Enter supplementary text (optional); then send.
Custom Area Screenshot¶
- Click the toolbar area screenshot button.
- The screen displays a full-screen mask and enters box-selection state.
- Hold down the left mouse button and drag to box-select the area to be captured.
- Release the mouse; the selection is automatically cropped into an image and appears in the draft area.
- If cancellation is needed, press
Esc.
Paste from Clipboard¶
- Use external methods like WeChat
Alt+Ato complete the screenshot. - Press
Ctrl+Vin the DSH input box. - 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.bundlesincludesdsh-composer-image-tools. - The screenshot is based on Electron main process
desktopCapturercapturing the whole screen; browsergetDisplayMediais unavailable in DSH’s Electron environment. - The plugin runs with the permissions of the current
dshprocess; 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