Preface¶
When opening a .md file in DeepSeek Harness (DSH), the right sidebar defaults to a “view-only” preview. The README of the built-in preview plugin states it clearly: “Preview, not editing. The viewers provide no file editing.” Furthermore, there is currently no client-facing API available to directly write content to workspace files. If you prefer to click on paragraphs in a rendered document to fix words or edit specific table cells, rather than switching the entire view to raw source code, you need an additional write channel and a corresponding renderer.
Below is the community plugin dsh-codex-like-markdown (Maintainer: sevenhsu7, GitHub: sevenhsu7/dsh-codex-like-markdown). It provides rendering effects consistent with the built-in Markdown view in the DSH right sidebar and supports inline editing—including table cells. It is categorized as a Client-side plugin; the current repository has 0 stars, version 0.1.0, and an MIT license.
What is this¶
In one sentence: Codex-like Markdown editing for the DSH right Sidebar—the document maintains its rendered appearance; you click on a paragraph, heading, or table cell, and the cursor lands there for direct text editing.
The plugin registers the Remote namespace markdownDocs/write itself and writes back to disk via ctx.fs.writeText; simultaneously, it registers the renderer Markdown (Editable) that utilizes this. The body rendering reuses MarkdownText from @deepseek-ai/dsh-client-ui-primitives, which is the same component set used by the built-in Markdown view. Therefore, the visual representation of headings, lists, tables, code blocks, formulas, footnotes, etc., should align with the built-in preview.
Core Features¶
Opening and Editing¶
- When opening a
.mdfile, select Markdown (Editable) in the preview renderer dropdown (the rendering effect is consistent with the built-in Markdown read-only view; the built-in Markdown remains available for read-only preview). - Click on a paragraph, heading, list item, or code fence block, and that block becomes editable in place: no extra border boxes, reusing the document’s calculated font and line height, and no Markdown markers are displayed on screen (markers are hidden via CSS in the DOM).
- Clicking a character position places the cursor on the corresponding character via browser hit testing; input is immediately stitched back into the document, and the unsaved state syncs with auto-save after approximately 1.2 seconds of idle time.
- Press
Escor⌘Enterto close the current block;⌘S/Ctrl+Ssaves immediately;⌥⌘Etoggles between the rendered view and raw Markdown (you can also use the built-in Text view in the dropdown to view the original source).
Tables and Block Model¶
- Tables maintain the renderer’s own table layout; clicking a cell brings up an editing surface only on that cell. When writing back, only the byte range of that cell within the row is rewritten, without touching other cells or the table structure.
- The cell editing surface is single-line: Enter commits, and newlines in pasted text are converted to spaces.
- Structural changes like adding or deleting entire rows or columns require the source code view.
- Source code is split into blocks by empty lines; code fences remain intact. Each edit only replaces the
[start, end)range of the corresponding block, without performing “rich text deserialization into Markdown.”
Add Selection to Session¶
Select a piece of text in the preview, and the action bar appears allowing you to Add to Session (button text in Chinese interface is 「添加至会话」): it inserts a “Source line + Quoted paragraph” into the input box, with the cursor placed after the quote. This relies on obtaining inputActions from the input box on the preview side; if no input box is available or the input box is currently submitting, it will prompt that it cannot be added.
Toolbar and Others¶
- Toolbar row: Status hint · B / I /
</>/ 🔗 · Save related buttons; + Add Paragraph allows appending a paragraph and opening it for editing. - If the file is modified externally on disk, the unsaved buffer will not be silently overwritten; the toolbar provides Overwrite / Load from disk, and pauses auto-save until you edit again.
- Switching tabs, switching renderers, or switching to source code and back retains the current tab’s draft in browser memory (refreshing the page does not retain it).
- Interface text switches between Chinese and English according to the DSH interface language.
Write and Security Boundary¶
The Remote method markdownDocs/write accepts { sessionId, path, absolutePath, content, expectedVersion? } and returns statuses such as saved / stale / denied / missing / error. Writing goes through the host filesystem backend: read-only sessions are rejected, workspace-write can only write within the workspace; passing expectedVersion enables compare-and-set. If the renderer is unavailable, it falls back to pure source code editing; if a single block fails to render, that block displays the raw text rather than blanking out the entire panel.
Installation and Activation¶
This package is a profile bundle (declared as dsh.bundle.patch in package.json) and is activated immediately upon installation. Installation executes plugin code within the host process, requiring authorization or Full access; it is recommended to review the repository source code and MIT license yourself before installing. This package has no installation scripts or additional dependencies.
In a Harness Session¶
When asking an agent to install it, use plugin_manager with action: install_bundle, where target points to this plugin’s directory.
In the Terminal¶
Exit the DSH application first, then execute (replace the path with the absolute path of your local clone or extracted folder):
# CLI bundled with the macOS app
"/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh" \
plugin --profile desktop add /absolute/path/to/dsh-codex-like-markdown
Use remove_bundle to uninstall. Modifications to client.js usually take effect immediately (the client module registry watches this bundle); modifications to index.js require restarting the application to load the new module generation.
Typical Usage¶
- After installation and restart, or once the client module loads, open any
.mdfile in the workspace. - Select Markdown (Editable) in the renderer dropdown of the right sidebar document preview.
- To edit body text: click a paragraph or heading and type directly; to edit tables: click the target cell, edit, and press Enter or click elsewhere to commit that cell.
- To pass a document fragment to the current session: select the text → click Add to Session on the action bar.
- For structural overhauls or table row/column changes: press
⌥⌘Eor switch to the Text / source code view to edit the raw Markdown. - Saving: wait for auto-save, or press
⌘S/Ctrl+S; the read-only preview can switch back to the built-in Markdown at any time.
Environment Requirements and Known Limitations¶
Environment Requirements: The plugin is developed for Harness versions that have integrated @deepseek-ai/dsh-client-ui-sidebar-documentpreview and the API Gateway into the Web composition (the README states approximately around 0.2.0-rc.2). If the profile lacks services like slots, documentPreviews, remote, or locale, the client half will remain inactive without throwing errors.
Usage Notes:
- Markdown syntax newly typed during editing will first appear as raw text and is only re-rendered after closing that block (
Esc); hidden markers cannot be manually edited, and deleting characters next to markers may lead to format loss, but will not change the visible text content. - Blocks are split by empty lines; lists or tables separated by empty lines will be split into multiple blocks; footnotes and reference-style links are only parsed within a single block.
- Full file reading is subject to the preview
maxFileBytes(32 MiB) limit. - Writing is a full-document replacement with optional version guardrails; external changes between read and write will be detected, and the decision to overwrite is chosen by the user.
- The plugin runs with the current DSH process privileges;
workspace-writeis still constrained by the workspace root directory, but you should still confirm you trust the repository code before installing the bundle.
Conclusion¶
dsh-codex-like-markdown fills the gap of “editable preview” in the DSH right sidebar: rendering aligns with the built-in Markdown, editing writes back by blocks and cells, and it supports adding selected content to the session. It is suitable for developers who frequently modify Markdown documents in the Harness but do not want to stare at source code markers all the time.
- Community Directory Page: https://www.skillhub.cn/plugins/sevenhsu7/dsh-codex-like-markdown
- Source Code and Full Description: https://github.com/sevenhsu7/dsh-codex-like-markdown
Community plugin directories (such as SkillHub) are independent sites and have no official affiliation with DeepSeek / High-Flyer; installation and usage are subject to the repository README and license.