dsh-image-annotate: Annotate screenshots in the DSH web input box and send them

Preface

When discussing UI issues with models in DeepSeek Harness (DSH), it is often necessary to circle buttons, select regions, or add a line of explanation to a screenshot. If you have to paste the image into an external editor and then paste it back into the conversation, the steps are cumbersome, and the resolution often degrades during the round-trip export. The common “Paste → Mark on image → Send” workflow found in Cursor is not natively supported by the DSH input box.

dsh-image-annotate is a community-maintained DSH client plugin. It intercepts pastes containing “only one image” within the Web GUI composer, opens a fullscreen overlay for marking with pens, arrows, rectangles, ellipses, and text stamps. Upon sending, it bakes the strokes into a PNG attachment with the same resolution as the original image; if no marking is done and Esc is pressed, the original file bytes are archived as-is. The plugin registers official slots, locales, and client faces like Conversation without patching upstream source code; removing the loader line is sufficient for uninstallation.

Maintainer: thezavtrak-a11y. The community directory classifies it as “Fun Dress-up”; package version 1.0.0, MIT license. Directory page: SkillHub.

What is this

In one sentence: A DeepSeek Harness Web client plugin—after pasting a screenshot, mark it on an overlay, and then send it into the conversation as a standard attachment.

The package declares dsh.client (browser side) and dsh.bundle.patch (loader line), consistent with common DSH plugin installation methods. The core logic resides in lib/client.js: the capture phase listens for pastes, portals the overlay, handles canvas drawing, flattening, and attachment handoff; index.js serves only as a placeholder for host mounting.

Core Features

The following capabilities are derived from the repository README and package.json descriptions.

Paste and Overlay

  • When the clipboard contains “only one image and no text,” Ctrl+V opens the annotation layer; pastes with text or multiple images are handed over to the shell’s default behavior.
  • When an image already exists in the composer, a small pencil icon appears, allowing you to reopen the overlay without pasting again.

Tools and Styles

  • Tools: pen, arrow, rectangle, ellipse, text stamp.
  • Six colors (including white, for dark screenshots) and three stroke widths; for the text tool, these three widths correspond to font sizes of 12 / 24 / 48 px in image coordinates.
  • Text: Input at the click point, Enter to insert, Shift+Enter for a new line, Esc to cancel that specific text entry (without closing the overlay).

Undo and Send

  • Undo by stroke or clear all; supports Ctrl+Z.
  • Enter or Send: Strokes are composited into a PNG with a resolution matching the source image (1:1) and proceed through the composer attachment flow.
  • Esc or exiting without annotation: The original pasted file is not re-encoded and is archived as-is.

Failure Handling

  • Images that cannot be decoded will trigger a prompt, but archiving the paste as-is is still allowed to avoid empty boxes.

Security and Privacy (Payload Audit Conventions)

  • Runtime code contains no networking, storage (like localStorage), eval, or innerHTML; it requests no additional permissions and does not actively call the Clipboard API, responding only to pastes initiated by the user. Annotation state is kept in React state and discarded upon overlay closure.

Installation and Activation

Please read the source code and MIT license yourself before installation. The plugin executes within the DSH process and Web client context, with a permission boundary consistent with the current profile.

The package requires Node >=22. Install from a local checkout or published copy:

dsh plugin --profile <profile> add /path/to/dsh-image-annotate

Refresh the page once after installation—the new loader line is only loaded when the page builds the module table.

For development, you can also manually mount it to the profile (Windows example in the README; Linux/macOS can use equivalent directory junctions):

  1. Link the plugin directory to ~/.dsh/profiles/<profile>/node_modules/dsh-image-annotate.
  2. Add the dependency to ~/.dsh/profiles/<profile>/package.json: "dsh-image-annotate": "file:<path to checkout>".
  3. Add the following to the insert section of ~/.dsh/profiles/<profile>/cordis.patch.yml:
- id: image-annotate
  name: dsh-image-annotate

Rollback: Delete the insert line, dependency, and link mentioned above.

Typical Usage

  1. Copy a screenshot in the composer of the DSH Web conversation page (ensure no text or other images are included in the clipboard).
  2. Ctrl+V: The overlay covers the image; click the pencil to expand the toolbar, select color and thickness, and annotate on the image.
  3. Use the text tool to click a position and input text when explanation is needed.
  4. Once satisfied, press Send or Enter: The annotated PNG appears in the attachment bar, and the message is sent as usual.
  5. If you decide not to change anything, press Esc: The attachment will be the original pasted file.
  6. If the attachment is already in the composer, click the pencil to re-annotate the same image.

Implementation Highlights (For modifying the plugin or troubleshooting)

File Role
index.js Empty apply() on the host side for loader mounting and client module scanning
lib/client.js Paste interception, overlay, canvas, flatten, attachment writing
cordis.patch.yml Loader line written during bundle installation

Four design points emphasized in the README:

  1. Intercept pastes at the document capture phase to prevent “pure image pastes” from entering the input track without annotation; upon cancellation, the original File is returned.
  2. The overlay is mounted to document.body via a portal to avoid misalignment of position: fixed caused by composer ancestors’ transforms.
  3. Sending prioritizes the shell’s official path: conversation.createDrafts + inputActions.addAttachments; if unavailable, it falls back to a synthetic ClipboardEvent on [data-composer-input].
  4. Errors thrown during slot rendering will cause the entry to be removed by the framework’s error boundary until refresh; the plugin creates its own boundaries for the overlay and re-annotation chips, and hooks use selector forms (e.g., useInput(selectAttachmentIds)).

Strokes are stored in image coordinates, and PNGs are written at the source image’s native size during flattening; text participates in undo and export as {tool: 'text', ...}.

The maintainer provides self-check commands such as node --check, tools/smoke.mjs, and tools/check-api.mjs in the repository; if a GUI is running, tools/live-ui.mjs can be used for end-to-end paste and send verification. This article does not expand on specific command parameters; refer to the Verify section of the GitHub README if needed.

Use Cases and Notes

Suitable for

  • Identifying UI elements to the model, boxing regions, or adding short text explanations on screenshots within DSH Web.
  • Scenarios where you want the annotation to enter the conversation as a “normal PNG attachment” with export resolution consistent with the screenshot.

Notes

  • Automatically opens the overlay only for “single image, no text” pastes; mixed clipboard behavior remains unchanged.
  • If the client slot crashes due to an uncaught exception, the page must be refreshed to restore the plugin UI.
  • The community directory SkillHub has no official affiliation with DeepSeek / High-Flyer; plugin stars are based on the current display on the directory/GitHub (0 as of the data scraping).
  • Installing the plugin implies trusting its client code; although the repository uses tools/audit-public.mjs to constrain payloads before release, it is recommended to review the source code yourself before installing.

Conclusion

dsh-image-annotate integrates “Paste screenshot → Lightweight annotation → 1:1 PNG upload” into the DSH Web composer, aligning with common workflows on the Cursor side. It integrates via official client injection points without modifying the upstream tree. To try it out or see updates, please open the SkillHub Directory Page and GitHub Repository.

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

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

Xiaoye