dsh-image-annotate: Adding a Paintbrush to DeepSeek Harness

Preface

When developing or using agents with DeepSeek Harness (DSH), scenarios often arise where you need to point out specific issues in an image to the model. The traditional approach involves taking a screenshot, uploading the image, and then using text to describe “here” or “that spot.” This method results in high communication overhead, especially when image information is complex or when there are discrepancies in the model’s understanding.

The dsh-image-annotate plugin aims to solve this problem. It does not alter DSH’s preview logic but rather overlays an annotation pen on the image preview layer. Users can directly circle points, add text descriptions, and send the annotated original PNG directly into the input box, then continue typing to send.

Plugin Positioning

This is a plugin that adds annotation capabilities to DeepSeek Harness image previews. It is maintained by zhishengplus and is released under the MIT License. The plugin itself has zero dependencies and requires no build steps; it exists solely as an enhancement to the preview layer.

Core Capabilities

The plugin provides the following features:

  • Seven Annotation Tools: Move, Pen, Arrow, Rectangle, Ellipse, Text, and Eraser.
  • Fully Editable: All annotations (including ellipses and rectangles) are objects supporting selection, dragging, scaling, double-click text editing, deletion, and undo.
  • Native Appearance: The toolbar, buttons, and selection handles utilize DSH design tokens (such as --dsw-menu-surface-fill) to automatically adapt to light and dark themes.
  • One-Click Composition: Supports merging the original image with the annotation layer into a PNG and sending it to the input box via the native paste channel. If that fails, it falls back sequentially to drag-and-drop, clipboard, or download.
  • Multi-Source Support: Compatible with screenshots in messages, images in the input box draft, and images returned by tools.

Usage Steps

  1. Click to open any image in the conversation.
  2. A circular Annotate button will appear in the bottom right corner of the preview window (matching the style of the close button). Click it.
  3. Select a tool (such as Ellipse, Rectangle, or Text) to annotate the image.
  4. If the position is incorrect, simply drag the annotation object.
  5. Click Add to Input Box; the annotated image will automatically enter the input box, allowing you to continue typing and send.

Keyboard Shortcuts Reference

  • V: Select / Move mode
  • 1 – 7: Switch tools (Move, Pen, Arrow, Rectangle, Ellipse, Text, Eraser)
  • E: Eraser
  • Ctrl/⌘ + Z / Ctrl/⌘ + Shift + Z: Undo / Redo
  • Delete: Delete selection
  • Arrow keys (with Shift for acceleration): Fine-tune position (1px / 10px)
  • Text tool: Click to input text, Enter to confirm, Esc to cancel

Installation

Run the following command in your terminal to install:

dsh plugin --profile <PROFILE> add github:zhishengplus/dsh-image-annotate

After installation, the plugin will appear in the corresponding Profile’s package.json configuration. A one-time restart of DSH is required after the initial installation.

Technical Notes

  • Runtime Environment: The plugin runs within the browser. The repository scripts require Node >= 20 for the development environment.
  • Security Handling: When exporting images, fetch(src) is used to retrieve the image Blob and decode it, avoiding toBlob SecurityErrors caused by cross-origin drawImage.
  • DOM Identification: The plugin utilizes a MutationObserver to monitor and identify specific nodes as preview containers (nodes under body that are div[role="dialog"][aria-modal="true"] and have <img> as a direct child).

This plugin belongs to the DSH plugin ecosystem and can be viewed in the community directory.

  • Repository: https://github.com/zhishengplus/dsh-image-annotate
  • Plugin Directory: https://www.skillhub.cn/plugins/zhishengplus/dsh-image-annotate
羽毛球分组比赛记分
小程序二维码

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

Xiaoye