Preface¶
In DeepSeek Harness Web, after an agent executes one round, it often generates Markdown, code, images, or text files. By default, clicking the produced-file chip passes the file to the system’s default application; if you just want to quickly confirm the output, the cost of opening the native app or a new tab is too high.
dsh-markdown-preview addresses this scenario by replacing the click action with an in-chat preview: it retains the original produced-files row, but allows Markdown, images, code, and restricted text to expand directly within the conversation.
What is This¶
dsh-markdown-preview is a DSH community plugin used to preview produced files in DSH Web. The current package.json version is 0.3.0 and the license is MIT.
It solves the problem of “the file has been generated, but I want to see the content immediately.” The plugin does not change the file storage location and does not provide write capabilities.
Core Capabilities¶
Preview in Chat after Clicking Chip¶
After installation and restart, when a round generates a file, clicking the produced-file chip toggles the preview panel.
The preview does not open the native app or a new tab.
Markdown, Code, Images, and Plain Text¶
- Markdown is rendered on the server using
markdown-it, supporting GFM tables, fenced code blocks, blockquotes, links, and hard line breaks; fenced code blocks are highlighted usinghighlight.js. - Code files support 40+ extensions, are highlighted on the server using
highlight.js, and are displayed in a dark editor style. - Images support PNG, JPEG, GIF, WebP, and SVG, previewed inline as data URLs; SVGs do not execute scripts when loaded via
<img>. - Other text files use a plain text fallback; binary files are sniffed and rejected for preview.
Fullscreen and Panel Operations¶
The preview panel header provides file size, fullscreen, copy content, open in system app, and collapse operations.
Markdown, image, code, or plain text previews can expand into a fullscreen overlay, closed via a button or Esc.
Retaining Original Experience¶
The plugin retains the original produced-files row experience: chips, “+ N files”, “Show in folder”, and inline code-mentions still work normally.
The preview panel uses DSH theme variables to adapt to light and dark themes, fixing the issue of unreadable text in dark mode.
Installation and Enablement¶
First, ensure the environment meets the requirements: DSH version is not lower than 0.1.0-rc.6, and pnpm is available in PATH, because dsh plugin forwards to pnpm.
Installation command:
dsh plugin --profile web add dsh-markdown-preview
Restart dsh web after installation.
No additional configuration is required. Once the plugin is active, clicking the produced-file chip toggles the preview panel whenever a file is generated in a round.
Uninstall¶
dsh plugin --profile web remove dsh-markdown-preview
Development Mode¶
If you want to modify based on the source code, you can clone the repository and install it using a local path:
git clone https://github.com/GitHubJiKe/dsh-markdown-preview.git
cd dsh-markdown-preview
npm install
dsh plugin --profile web add file:$(pwd)
Restart dsh web after completion. This method uses the current working copy, suitable for debugging.
Runtime Mechanism and Security Boundaries¶
The plugin is divided into host and client sides.
The host side registers a /preview RPC channel and places it under the loopback trust fence. It is responsible for reading Markdown, images, code, or restricted text; actions to open system apps are proxied to host.openPath.
The client side takes over the deliverables event and the conversation.chat.turnTail slot, disables the official ui-deliverables row, and re-provides the relevant prompt section/chatFileMentions.
Rendering happens on the host side; the browser side remains lightweight and is responsible for display.
Security-related limitations:
- The preview channel is limited to loopback and is protected by the connection trust fence.
- The preview is read-only with no write endpoints.
- Markdown uses
html:false, and raw HTML is escaped; links are limited tohttp(s)/mailto/#by themarkdown-itdefaultvalidateLink. - Text files have a limit of 1 MiB, and images a limit of 4 MiB; explicit truncation messages are displayed when limits are exceeded.
- Binary files are sniffed and rejected for preview.
Since the plugin registers channels in the DSH process and reads files, it is recommended to check the source code, dependencies, and license before installation. Current dependencies include highlight.js ^11.11.1 and markdown-it ^15.0.0.
Who is this for¶
Suitable for people who frequently use DSH Web to debug agent outputs, especially developers who need to view Markdown, code, and images frequently but do not want to switch to native apps every time.
If the primary need is file trees, path mentions, HTML export, or Web project previews, this plugin is not the corresponding tool; it focuses on providing inline previews on the official produced-files row.
Links¶
- GitHub: https://github.com/GitHubJiKe/dsh-markdown-preview
- Directory: https://www.skillhub.cn/plugins/GitHubJiKe/dsh-markdown-preview