Document Editing

Preface

DeepSeek Harness (DSH) has a built-in document preview that is strictly read-only. Its README explicitly lists “Preview, not editing” as a design trade-off. Furthermore, the workspaceFiles Remote does not provide write methods. This plugin bridges this missing write path and registers the editor as a renderer within the preview itself, meaning no built-in renderers need to be replaced.

Core Features

  1. In-place editing of text files within the document preview.
  2. Support for the Ctrl+S shortcut to save.
  3. Conflict protection (detects disk changes upon saving).
  4. Byte-level preservation of line endings (CRLF/LF).
  5. Edit Markdown source code.
  6. Toolbar displays save status (Saved / Unsaved / Saving).

Installation

The plugin is installed via an agent (plugin_manager is an agent tool; it is not called directly by users). Send this specification to your DSH agent:

plugin_manager { action: "install_bundle", target: "github:hh719509125/dsh-preview-editor" }

A page refresh is required after installation.

Usage

  1. Open a file. Press Ctrl+P to open the file tree, then click on a .txt, code, or .yaml file; alternatively, open it from file references in the conversation or delivery file cards.
  2. Edit directly. Files with these extensions open directly in the editor rather than as a read-only preview.
  3. Save. Press Ctrl+S, or click the save button on the toolbar.
  4. Switch views. Select “Plain Text” or “Edit Source” from the renderer dropdown menu.

The status indicators on the toolbar are as follows:
- Green dot · Saved: The buffer matches the disk.
- Yellow dot · Unsaved changes: Changes have not been written to disk; closing the tab or page will trigger a prompt at this time.
- Saving…: Currently writing to disk.

Notes

  • The built-in preview is read-only; this plugin must be used to enable writing.
  • A page refresh is required for changes to take effect.
  • .docx/.xlsx/.pptx are not applicable (these previews are PDFs).
  • Saving large files is disabled (exceeding one page).
  • Files outside the workspace are readable, but writing is blocked by the sandbox.
  • Dangerous permissions (danger-full-access) are required.

Technical Implementation

The plugin uses cordis.patch.yml to configure extensions (supporting 65 suffixes by default) and markdown (whether to provide the edit source option). Host code executes outside the workspace sandbox, running within the current process under your user identity.

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

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

Xiaoye