DeepSeek Harness Plugin: dsh-better-display — Rich Text-and-Image Answers with Superscript Citations

DeepSeek Harness (DSH) Web mode supports functionality extension via plugins. In the default web search flow, searched webpages and images are usually only displayed in the tool call panel, which is often collapsed, causing users to not see the images and unable to trace the citation sources. dsh-better-display solves these two problems. It enables the model to write citations and images into the answer body and renders them on the frontend, making the agent’s responses more intuitive.

Core Features

This plugin mainly provides the following capabilities:

  • Citation superscripts (citations): Renders [n](url) written by the model into superscript badges. Hovering over them displays the site icon, domain, and title. Clicking opens the source in a new tab.
  • Sources panel: Aggregates all cited webpages at the end of the response. The panel deduplicates by URL, sorts by first appearance, and can be expanded into a card list.
  • Inline images: Embeds searched relevant images into the text using Markdown image syntax, rendering them as images with captions.
  • Image gallery: Automatically arranges 2 or more images in the same row into a grid gallery.
  • Large image preview: Clicking an image allows full-screen viewing, supports jumping to the original image, and closes with the Esc key.
  • Fallback for loading failures: Degrades to a clickable description link when an image is invalid, leaving no broken images.
  • Complete Markdown: Streaming rendering based on markstream-react, supporting Shiki code highlighting, Mermaid, KaTeX, tables, task lists, etc.

Installation & Configuration

Install the plugin via the following command:

dsh plugin --profile web add @copylee/dsh-better-display

After installation, it is recommended to open @copylee/dsh-better-display in the “Plugins” page of the DSH left sidebar and click the configuration button on the component row to adjust. After saving the configuration, it will take effect for the next response without needing to restart the process.

Configuration items include:

  • Citations (citations): Enabled by default. Allows the model to mark web sources with [n](url) and display them as superscripts and an aggregation panel.
  • Inline Images (inlineImages): Enabled by default. Allows the model to embed relevant searched images into the response.
  • Image Count (imageCount): Default is determined by AI. Can be set to auto (model decides based on content) or limit (limit the maximum number per response).
  • Maximum Images (maxImages): Default is 8. Only effective when set to limit, range 1–20.

Compatibility & Dependencies

  • Version Requirement: Requires DeepSeek Harness >= 0.2.0-rc.2.
  • Dependent Plugins: Needs to be used in conjunction with web search plugins such as dsh-free-search.
  • Mutual Exclusion:
    • Mutually exclusive with dsh-better-markdown. It is recommended to remove dsh-better-markdown after installation to avoid duplicate packaging.
    • Mutually exclusive with dsh-genui. Both will replace the assistant renderer. This plugin has higher priority, and only one will take effect.

How it Works

The plugin does not modify the Harness source code but implements the following through Prompt injection and rendering Slot overrides:

  • Host side: Injects instructions into the System Prompt, telling the model to write citations as [n](url) and relevant images as ![desc](url "source").
  • Browser side: Overrides the Assistant rendering Slot. Parses citations and images in the Markdown, rendering them as superscripts, galleries, preview components, and a bottom sources panel respectively.

Security Notice

  • Raw HTML is always escaped.
  • Citations, links, and images only accept http(s) addresses. javascript:, relative paths, etc., remain as non-clickable text.
  • Images and site icons use referrerPolicy="no-referrer" and are lazy-loaded.

Typical Usage

When used in conjunction with dsh-free-search, you can ask questions directly like this:

  • “Introduce the Eiffel Tower, include a few images, and cite the sources.”
  • “What are the news about DeepSeek in the past week? Please note the sources for each item.”
  • “Compare the appearance of iPhone 17 and Pixel 10, with images.”

Superscript citations, inline images/galleries, and a “Sources · N” panel at the end will appear in the response.


Plugin address: https://github.com/copylee711/dsh-better-display

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

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

Xiaoye