DSH Document Annotation Console: Text Selection Annotation, Sidecar Persistence, and Agent Revision Loop

Introduction

A common practice for modifying proposal documents in DeepSeek Harness (DSH) is to copy a paragraph into the chat window, write modification suggestions on the next line, and then send it. This often leads to lost context, with annotations and the main text separated into two places. @caihua/dsh-doc-review (repository caihua8669/dsh-doc-review) transforms this process by allowing users to select text directly in the document and write comments on the side, with annotations persisted as a sidecar file. Agents read these annotations via tools like doc_review_* to revise the draft and update the status on the interface. The maintainer is caihua8669, and the community catalog category is Workflow.

What is this?

The DSH Document Annotation Console is a plugin package @caihua/dsh-doc-review (version 1.0.0 in current materials) for the DSH desktop app (or any profile). It adds an “Annotations” tab to the top tab bar of the session page, alongside “Conversation Trajectory,” “Context,” and “Whiteboard Kanban.” Simultaneously, it supports conversational annotations on message selections within normal chat. Annotations and change proposals are written to .dsh-review/ next to the document or locally under ~/.dsh/doc-review/, eliminating the need to paste the full text into the input box.

Core Features

Three-Pane Document Annotation Interface

The left pane lists Markdown documents by priority and allows switching between a directory tree and a flat list view. The scope defaults to “Relevant” (documents produced/edited in the current session, as well as documents touched in recent sessions within the same workspace), but can be switched to “Workspace” or “Full Library” under configured roots. The center pane renders the Markdown; selecting text pops up an annotation box, and Ctrl+Enter (or ⌘↩ on Mac) saves it. The right pane features Feishu-style annotation cards, supporting reply threads, collapsed resolved items, and two-way synchronization with the main text (using CSS Custom Highlight to anchor to the selected original text).

Suggestion Mode and Pending Changes

Document revision defaults to Suggestion Mode: the Agent uses doc_change_propose to register a change (quote for original text, after for new text, note for description), writing to <document_directory>/.dsh-review/<filename>.proposals.json. The source file is not modified during registration. Users accept or reject items one by one in the “Pending Changes” panel; writing to disk only occurs upon acceptance, by relocating the text based on the quote. The main text can display red/green inline previews with inline accept/reject buttons.

In-Conversation Text Selection Annotation

In the chat interface, users can select text to trigger a side toolbar for “Annotate,” “Copy,” or selection prompts. Conversational annotations are saved to ~/.dsh/doc-review/session-notes/<sessionId>.json and can be read and marked as resolved by the Agent via session_note_list / session_note_resolve. After saving, the annotation block can be appended to the current session’s input draft (【批注 · 请逐条回应】…【批注结束】), facilitating the collection of multiple points before sending them all at once; the draft is not overwritten if the input box is currently processing a slash command.

Sidecar and MRSF

The structured source of truth is:

<document_directory>/.dsh-review/<filename>.review.json
<document_directory>/.dsh-review/<filename>.review.md

.review.json aligns with MRSF v1.0 (Markdown Review Sidecar Format), where selected_text is the authoritative anchor and is not rewritten. After document changes, re-anchoring follows MRSF §7.4; if it fails, the item is marked as “Unanchored” but retained.

Agent Tools and /doc-review Skill

Tool Purpose
doc_review_list Read a single document or inspect documents with annotations
doc_review_resolve / doc_review_reopen Mark as processed or reopen
doc_review_reply Append AI explanations to reply threads
doc_change_propose / doc_change_list / doc_change_decide Suggestion mode: proposal, list, accept/reject
session_note_list / session_note_resolve Read and mark conversational annotations

Upon installation, a skill file is placed at ~/.dsh/skills/doc-review/SKILL.md, callable via /doc-review. Additional tools like doc_review_history, doc_review_mine_candidates, doc_review_rules_*, and doc_review_preview_apply are provided to distill rules from historical annotations and perform pre-reviews on new documents (the rule base is initially empty and accumulates from user annotations).

Assign to AI for Revision

The “Annotations” page can assemble pending annotations into instructions, queuing them to the current session via remote.session.prompt, or using “Copy Instructions” to place them on the clipboard. Once installed, GET http://127.0.0.1:19387/api/dsh-doc-review/ping can be used to confirm the host side is connected.

Installation and Activation

Requirements: DSH desktop app (or target profile) + Node 20 or above. The repository includes a runnable lib, requiring no local build.

Example installation via the desktop’s built-in CLI (replace profile with the one you are using; usually desktop for the desktop app):

dsh plugin --profile desktop add github:caihua8669/dsh-doc-review

After installation, refresh the page and confirm that the “Annotations” tab appears at the top of the session page. Additionally, check that the profile’s package.json includes @caihua/dsh-doc-review in both dependencies and dsh.profile.bundles, and that the ping endpoint responds.

Typical Usage

  1. Install the plugin and refresh DSH. Open the target Markdown and select the document in the left pane of the “Annotations” page (or paste an absolute path to open it).
  2. Select a paragraph in the center pane, fill in comments, and save with Ctrl+Enter. View cards in the right pane and add explanations in reply threads if necessary.
  3. Click “Assign to AI for Revision (n)” or one-click “Assign to AI” for the conversational annotation section, then switch back to the chat page for the Agent to process. The Agent should prioritize using doc_review_list to read structured annotations, mark them with doc_review_resolve after revision, and use doc_change_propose and doc_change_decide in Suggestion Mode to coordinate with user review.
  4. If the rule closed-loop is enabled, pre-reviews can be conducted on new drafts via /doc-review and doc_review_preview_apply. Users accept or reject hit items on the annotation page to update rule statistics.

Use Cases and Precautions

This is suitable for teams iterating on proposal drafts, technical specifications, or delivery documents within DSH over the long term: annotations and main text are on the same screen, persistence allows for version control, and it is compatible with MRSF ecosystem fields. Conversational annotations are suitable for leaving opinions on conclusion fragments within a dialogue without occupying the input box with full-text pasting.

The plugin reads and writes to the workspace and local ~/.dsh paths with the permissions of the current DSH process. Please read the repository source code and the MIT license before installation to ensure that the paths and data persistence locations comply with your security policy. Full library scanning and similar behaviors are affected by configuration items (such as roots, projectSessions); refer to the README and repository configuration for details. The DSH community plugin directory (SkillHub) is an independent site and has no official affiliation with DeepSeek or High-Flyer.

Conclusion

The Document Annotation Console consolidates the “copy paragraph + write suggestions in chat” workflow into a closed loop utilizing text selection, sidecars, and the Agent toolchain. Catalog page and source code:

  • https://www.skillhub.cn/plugins/caihua8669/dsh-doc-review
  • https://github.com/caihua8669/dsh-doc-review
羽毛球分组比赛记分
小程序二维码

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

Xiaoye