Introduction¶
DeepSeek Harness (DSH) uses a plugin-based architecture, aiming to decouple model inference capabilities from the interaction interface. When developing agents that require output in a specific format, such as official documents, developers typically need to handle complex layout logic themselves or guide the model via system prompts. This plugin is modeled after codex-document-mode and solves the problem of automatically rendering assistant replies into a standard official document format in the DSH environment, while also supporting input-side review markup feedback.
Plugin Overview¶
This plugin is maintained by ESxyzbil and released under the MIT License. It injects style constraints on the host side and combines them with DOM rendering on the client side to implement formatted official document output and interaction.
Installation¶
Install through the desktop profile:
dsh plugin --profile desktop add link:C:\Users\34983\dsh-plugins\dsh-official-document-mode
You need to restart DSH Desktop after installation for the changes to take effect.
Core Features¶
The plugin mainly includes the following three core capabilities:
- Official Document Rendering: When enabled, the final report in an assistant reply is rendered into a standard official document layout, including the header organization name and document number, red separator line, centered title, salutation, body (Markdown as-is), and signature. Tool calls and intermediate steps are not rendered.
- Review Markup Feedback: A 36px canvas is added to the left side of the input area. It supports recognizing brush strokes using a geometry heuristic: a closed trajectory with high roundness is recognized as “Agree” (circled), while a self-intersecting trajectory or trajectory with multiple crossing strokes is recognized as “Disagree” (crossed out). Upon successful recognition, it automatically writes
[Feedback: Agree]or[Feedback: Disagree]into the draft area. - Configuration Management: Supports configuring parameters such as document number, signature, and writing style via
cordis.patch.ymlor API.
Usage Notes¶
Enabling and Switching¶
After installing and restarting DSH, a “Official Document Mode” button appears below the input area. Click it to toggle the global switch.
* Enable: The host side registers systemPrompt constraints, the client side renders the official document frame, and the canvas is displayed.
* Disable: Host constraints are removed, rendering is canceled, and the canvas is hidden.
Configuration Parameters¶
The following parameters can be set in cordis.patch.yml:
- id: dsh-official-document-mode
name: dsh-official-document-mode
config:
enabled: true # 公文模式总开关
salutation: '尊敬的领导:'
signature: 'DeepSeek 人工智能助手'
orgName: 'DeepSeek Harness'
titlePrefix: ''
fileNo: ''
styleConstraint: ''
Semantic Distinction (Important)¶
The plugin performs semantic distinction based on “the moment the mode is enabled”.
* Historical messages generated before enabling remain in normal display.
* New replies generated after enabling are rendered with the official document frame.
* If it is disabled and then enabled again, a new boundary is set at the new enabling moment. This prevents historical messages from being “framed”.
Technical Details and Known Limitations¶
Hot Reloading Mechanism¶
Based on actual testing (2026-08-22), DSH Desktop shows differences in hot-loading support:
* Client Side: After modifying lib/client.js, refreshing the page makes the changes take effect.
* Host Side: After modifying lib/index.js or adding a new plugin, DSH Desktop must be restarted for the changes to take effect. The desktop host does not support loading new plugins without a restart.
Known Limitations¶
- Segmented Rendering: If multiple tool calls are included in one turn, the assistant may output multiple official documents in segments, each with a header and signature, while tool-call lines remain unchanged.
- Title Extraction: The title extraction rule is the first title line or a line with “Title:”; if there is no title, the first sentence is truncated.
- Review Markup Recognition: Recognition is based on a lightweight geometric heuristic, not machine learning. If the circle/cross lines are too small or their geometric features are not obvious, recognition may not trigger.
- Runtime Permissions: The plugin runs with the DSH process; before installing, check the source code and license.
Summary¶
dsh-official-document-mode provides DSH with a complete official document processing solution, forming a closed loop from generation to review markup. Developers can adjust configurations as needed and use its semantic distinction mechanism to manage the display status of historical messages.
- Plugin Directory: click here to access
- GitHub Repository: click here to access