In DSH (DeepSeek Harness), directly pasted long text is usually sent to the model as plain text, making it difficult for the model to accurately reference details within it. The dsh-paste-doc plugin solves this problem by automatically generating “text document references” when long text is pasted, similar to the document collapsing feature in DeepSeek’s official chat, making it easier to view and reference the content before sending it to the model.

Plugin Introduction

dsh-paste-doc is a DSH client plugin maintained by dzf-code and licensed under the MIT License. It is primarily used to convert long text pasted into the input box into visual reference chips and document cards, and to serialize them into structured XML text when sending, so the model can read them.

Core Features

  1. Automatic conversion: Text with 200 or more characters is automatically converted into a reference chip (displaying 📄 + a preview of the first few characters).
  2. Document cards: A collapsible/expandable document card appears above the input box, allowing you to view the full text at any time.
  3. Structured serialization: When sending, references are serialized into structured XML text:
    <引用文档 id="doc1" 标题="…" 字数="1234">
    <全文>
    ……原文……
    </全文>
    </引用文档>
  1. Reference syntax: Enter @docN to highlight a reference; the @ menu allows manual insertion of previously pasted documents.
  2. Minimal styling: Transparent background + neutral outlined capsule (follows the theme, no shadow).
  3. Real-time synchronization: Cards and chips sync in real time; deleting a chip removes the card; after sending, everything is cleared.
  4. Escape hatch: Supports Ctrl+Shift+V (Windows/Linux) or Cmd+Shift+V (macOS) to paste plain text.

Installation and Enablement

Prerequisites

  • DSH web profile
  • pnpm

Installation Command

The plugin declares dsh.bundle.patch and ships with cordis.patch.yml. After installation, it is automatically added to the profile’s bundle layer, so no manual editing of configuration files is required.

dsh plugin --profile web add "github:dzf-code/dsh-paste-doc"

After installation is complete, restart dsh web, go to Settings → Plugin list, and confirm that the paste-doc status is active.

Compatibility Notes

  • DSH 0.1.5 changed the input box implementation to Lexical; use plugin version v0.1.11 or later for compatibility.
  • Since DSH 0.1.5, chips are implemented as Lexical nodes; use plugin version v0.1.12 or later for style adaptation.
  • Starting with v0.1.11, the plugin automatically supports both input forms (legacy <textarea> / new Lexical).

Typical Usage

  1. Paste long text: Directly use Ctrl+V to paste long text; it is automatically converted into a reference chip + document card.
  2. View full text: Click the card above the input box to expand and view the full text.
  3. Delete a reference: Remove the chip in the input box (backspace or select and delete); the card disappears in sync.
  4. Manual insertion: Type @ and select the “pasted document” source in the menu.
  5. Command-specific behavior: When commands such as /plan and /goal are claiming input, pasted long text is inserted as plain text (rather than a chip), ensuring the full content enters the command arguments and is not truncated.
  6. Paste plain text: If you need to paste plain text (without converting it to a reference), use Ctrl+Shift+V (Windows/Linux) or Cmd+Shift+V (macOS).

Notes

  • The document library is stored in browser memory and is cleared when the page is refreshed.
  • Ensure that the DSH version matches the plugin version. In particular, after upgrading DSH to 0.1.5, upgrade the plugin to 0.1.11 or higher to maintain input box compatibility, and to 0.1.12 or higher to maintain style compatibility.

Summary

dsh-paste-doc addresses the challenge of handling long-text context in DSH through structured XML serialization and visual card display, enabling the model to more accurately reference the content of pasted documents.