In-chat preview for produced files: click a produced-file chip to render Markdown (server-side markdown-it + highlight.js), images, or plain text right in the conversation; system-app open and reveal-in-folder stay one click away.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-markdown-preview
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:GitHubJiKe/dsh-markdown-preview
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time. Only install sources you trust, and pin a commit (github:owner/repo#sha).
README
In-chat preview for produced files in DeepSeek Harness Web.
By default, clicking a produced-file chip in the DSH Web GUI hands the file to
the operating system's default application (open on macOS → Xcode for many
extensions). This plugin takes over the produced-files row and makes the click
render the file right in the conversation — Markdown is rendered with
markdown-it + highlight.js server-side, images preview inline, and any
other text file shows as plain text. The old behaviors stay one click away:
open in the system app, or reveal in the folder.
Features
- Click a produced-file chip → inline preview, no native app, no new tab.
- Markdown rendered properly (GFM tables, fenced code, blockquotes, links, hard line breaks) with syntax highlighting in code fences (highlight.js common languages).
- Image preview (PNG / JPEG / GIF / WebP) as data URLs — no extra route.
- Plain-text fallback for every other text file; binary files are sniffed and refused with a clear message.
- Panel header with file size, copy content, open in system app, and collapse.
- 1 MiB cap for text / 4 MiB for images, with an explicit truncation notice.
- Keeps the stock experience: chips, "+ N files", and "Show in folder" still behave as before, and inline code-mentions of produced files stay clickable.
Install
dsh plugin --profile web add dsh-markdown-preview
Restart dsh web. Requires pnpm on PATH (dsh plugin forwards to pnpm) and
DSH >= 0.1.0-rc.6.
Usage
Nothing to configure. After restart, any turn that produced files shows the familiar produced-files row; clicking a chip toggles the preview panel.
How it works
- Host half (
lib/index.js): registers a/previewRPC channel onctx.connectionwith theloopbacktrust authority (the same DNS-rebinding / cross-site fence the/apisurface uses).readreturns the file — Markdown rendered to escaped HTML (markdown-itwithhtml:false, safe-link policy), images as base64 data URLs, other text capped at 1 MiB with a binary NUL-byte sniff.openproxies the stockhost.openPathso the native-app action is exactly the official one. - Client half (
lib/client.js): a standarddsh.clientbundle. It owns thedeliverablesconversation-event kind and theconversation.chat.turnTailslot (the officialui-deliverablesrow is disabled by this bundle's patch; its prompt section and thechatFileMentionsservice are re-provided here), so the replacement is behavior-compatible, not a DOM hack. - Rendering happens on the host, keeping the browser bundle thin and dependency-free.
Compared to similar plugins
| Plugin | Shape | Difference |
|---|---|---|
| dsh-markdown-preview (this) | produced-files row takeover | Click-to-preview exactly where the official row is, zero extra surface |
dsh-file-explorer |
right-side file-tree panel | global panel, not the chat row |
dsh-file-mentions |
backtick-path mentions + tail chips | collects paths from reply text; official row wins when present |
dsh-md-preview |
render tool + web drawer | drawer/HTML export, not the chat row |
dsh-web-preview |
side web-preview panel | run/annotate projects, not produced files |
Security notes
- The channel is loopback-only and behind the connection trust fence.
- Markdown is rendered with
html:false; raw HTML in a document is escaped, and links are limited tohttp(s)/mailto/#bymarkdown-it's defaultvalidateLink. - Preview caps and binary sniffing prevent accidental memory/UI abuse; the preview is read-only (no write endpoint).
Uninstall
dsh plugin --profile web remove dsh-markdown-preview
Development
git clone https://github.com/GitHubJiKe/dsh-markdown-preview.git
cd dsh-markdown-preview
npm install # markdown-it + highlight.js for the host half
dsh plugin --profile web add file:$(pwd)
# restart dsh web; the profile symlinks your working copy, so edits to
# lib/ apply after another restart (client bundles are scanned at boot)
License
MIT
Links
More in this category
zhu1090093659/dsh-web-ui#packages/dsh-web-ui-all★ 2263
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
ccch1mneyyy/dsh-TUI★ 1051
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
omdsh-dev/DSH-better-sidebar★ 920
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
omdsh-dev/dsh-at-file★ 171
Codex-style `@file` mentions: search workspace files in the composer and attach their contents to prompts.
huiliyi37/dsh-tianshu-tui★ 143
A terminal UI (TUI) for DeepSeek Harness.
Nagi-ovo/dsh-visualize★ 90
In-conversation generative UI: the model renders interactive HTML cards into the chat stream, with streaming preview and sandboxed rendering.