In DSH (DeepSeek Harness) development or collaboration scenarios, file links in conversation messages are usually handled by the default system application or opened in a standalone floating layer. This approach interrupts the current conversation context and leads to inconsistent layouts. The dsh-md-reader plugin takes over this behavior and renders documents directly within the DSH detail pane using a true three-column layout, providing a unified reading environment.

Plugin Introduction

This is a client plugin developed by wjx-ai. It leverages DSH’s dual-side architecture (the host side provides read-only HTTP routes, while the browser side handles rendering) to intercept Markdown/image links in conversations and expand a reading panel in the right-hand detail pane of the browser. The plugin requires no build chain; after installation, cordis.patch.yml automatically merges the configuration.

Core Features

  • True three-column layout: Instead of a modal overlay, it drives DSH’s layout system to expand the right-hand detail grid track. The sidebar has a fixed width, the conversation pane narrows automatically, and the document pane adapts.
  • Multi-format support: Supports .md, .markdown, .mdown, .mkd, and .txt text, as well as common image formats.
  • Table of contents and navigation: The body automatically scans h1–h6 headings to generate a TOC; clicking an entry smoothly scrolls to the corresponding location; inline links in the body that match sibling files or relative paths can continue to open inside the panel.
  • Editor features: Supports ⧉ copy original text, A-/A+ font size zoom (70%–150%, persistent), ⏱ auto-follow disk changes (polls mtime every 3 seconds while visible), ⟳ manual reload, and ↗ open in system default application.
  • Themes and compatibility: Light/dark theme follows the system; native opening behavior is preserved. After closing the panel, a 📖 floating entry remains in the lower-right corner, allowing the most recent document to be reopened.

Installation and Activation

Prerequisites:
1. DSH is installed with version >= 0.1.0-rc.6.
2. DSH has been started at least once.
3. The system environment variable PATH includes pnpm.

Installation command:

dsh plugin --profile web add github:wjx-ai/dsh-md-reader

After installation, the bundled cordis.patch.yml is automatically merged into the profile-level stack as a Profile Bundle patch. Refresh the browser after installation is complete to activate it.

Usage

  • Open a document: Click any .md / .markdown / .mdown / .mkd / .txt or image file link in the conversation, and the right-hand three-column reading panel expands.
  • Shortcut operations:
  • ☰: Expand/collapse the table of contents
  • ⧉: Copy original text
  • A- / A+: Decrease / increase font size
  • ⏱: Toggle auto-following disk changes
  • ⟳: Manually reload the document
  • ↗: Open with the system default application
  • Esc / ×: Close the panel
  • After closing: After the panel is closed, a 📖 floating entry remains in the lower-right corner; clicking it reopens the most recent document.

Host Side API

The plugin’s host side provides read-only HTTP routes for the browser side to call:

GET /api/md-reader/file?path=<绝对或相对路径>&base=<可选解析基目录>[&meta=1]
GET /api/md-reader/list?dir=<目录>
  • Parameter descriptions:
  • path: File path; supports absolute paths or relative paths relative to base.
  • base: Optional; the base directory for resolving relative paths.
  • meta=1: Returns metadata only, used for auto-follow polling.
  • Response content:
  • Text file: { ok, kind:'text', path, dir, name, size, mtime, content }
  • Image: { ok, kind:'image', mime, data } (Base64 inline)
  • List: Returns the directory file list
  • Security restrictions:
  • Extension whitelist: .md, .markdown, .mdown, .mkd, .txt, and common images.
  • Size limits: text 2 MiB, images 8 MiB, list 500 entries.
  • Path restrictions: When webServer binds to a non-loopback address, absolute paths must fall within registered workspace roots.
  • Authentication: Unauthenticated requests return 401.

Notes

  • The plugin requires DSH >= 0.1.0-rc.6, and the installation command requires pnpm to be available in PATH.
  • cordis.patch.yml is merged automatically; no manual configuration editing is needed.
  • The plugin is read-only throughout: there are no write endpoints, and unauthenticated requests are blocked.
  • On an empty conversation page, the panel may degrade to floating-layer style; when normally clicking a file link, the three-column layout always applies.
  • Dual-side plugins require the host side to provide read-only HTTP routes, while the browser side intercepts clicks and renders content.

Directory and Repository