The built-in question editor (QuestionComposer) in DeepSeek Harness Web is designed for general questions and uses a compact card layout. When the content is a complete Markdown design document (including headings, tables, code blocks, and formulas), the 60vh / 520px scrolling area inside the card feels cramped and the review experience is poor. dsh-doc-review replaces document-based questions with a full-screen modal, displays the rendered Markdown across the full width, and preserves the complete interaction capabilities.

This plugin is maintained by yaodongH and is intended to address display limitations for design document and plan review. It upgrades the originally cramped card into a full-width rendered modal that supports inline comments, automatic opening, and closing without cancellation.

Core Features

Document Rendering

  • Supports full GFM Markdown rendering: heading hierarchy, lists, tables, code blocks (with syntax highlighting), and KaTeX mathematical formulas.
  • Wide tables inside the modal support horizontal scrolling to avoid layout breakage.

Interaction Capabilities

  • Option buttons: Single selection submits immediately, using the same answer encoding as the built-in flow.
  • Custom feedback: A single-line input box for supplemental review comments.
  • Cancel operation: Rejects the request with ASK_CANCELLED and restores the editor to a normal chat state.
  • One-time lock: After clicking, all operations are disabled until the host response is finalized; failures are retried automatically and errors are displayed.
  • Automatic opening: The modal opens immediately when a document-based question arrives.
  • Closing does not cancel: Clicking X / Esc / the overlay closes the modal, while the request remains in a pending review state.
  • Re-expand: The “Expand full document” button on the control bar can reopen the modal.
  • Reconnection recovery: After page refresh or reconnection, the pending review modal reopens with the component.

Inline Comments

  • Comment management: Supports adding, editing, and deleting inline comments. Comments are persisted in localStorage (key format: dsh-doc-review:v1:comments:<wait.key>).
  • Submit feedback: When comments exist, the modal footer and collapsed control bar switch to “Submit comments / Cancel,” and the option buttons and custom input are hidden. On submission, comments are aggregated in ascending line-number order, using the format For line {N} {original content}, I think it should be {comment content}.
  • Edit and delete: Comments provide edit (✎) and delete (🗑) buttons; the editing state is pre-filled with the original text.

Internationalization

  • The plugin’s own text supports bilingual switching between Chinese and English.
  • Option button labels for the plan-review intent (such as Approve) are localized semantically (such as “Confirm execution”), while the submitted answer value remains the original label.

Installation and Deployment

Environment Requirements

  • DeepSeek Harness >= 0.0.1
  • pnpm >= 11
  • Node >= 22

Build

Run the following commands in the plugin source directory:

pnpm install
pnpm run typecheck
pnpm run test
pnpm run build        # 构建 ESM 与 Client Bundle
pnpm run pack         # 打包为 tarball

Deploy to Profile

  1. Edit ~/.dsh/profiles/web/package.json and add the packed artifact (for example, dsh-doc-review-0.1.0.tgz) to the bundles list.
  2. Add the artifact path to dependencies.
  3. Enter the ~/.dsh/profiles/web directory and run pnpm install.
  4. Restart the DeepSeek Harness Web service.

Rapid Iteration

During development, you can skip the packing step and directly synchronize the build output:

pnpm run build
rsync -a lib/ cordis.patch.yml dsh.plugin.json \
  ~/.dsh/profiles/web/node_modules/dsh-doc-review/

Usage Examples

Trigger Methods

Run a task in adaptive mode until it enters the design phase, or input /plan in standard mode; the modal opens automatically and renders the design document.

Comments and Feedback

  1. Select text in the modal or click a line-number slot to add a comment.
  2. After finishing the review, click “Submit comments.”
  3. If you need to reject, click “Discuss in chat.”

Standard End-to-End Verification

When comments exist, “Submit comments” aggregates them into a single feedback item in ascending line-number order. Each entry is sent verbatim as For line {N} {original content}, I think it should be {comment content} via a { selected: [], custom } envelope; on success, comments and their persisted data are cleared.

Applicable Scenarios

This plugin takes over the following document review paths:

  1. Standard plan-mode: After entering /plan, exit_plan_mode submits the plan for review.
  2. Adaptive pipeline: The task enters the design phase.

Unclaimed questions (short questions, detail without a heading, multi-select, more than 3 options, unknown intents, etc.) fall back to the built-in question editor as-is.

Claim Conditions

It takes over when all of the following conditions are met:
- A single question (not a batch of multiple questions).
- multiSelect is not truthy.
- intent is undefined or { kind: 'plan-review' }.
- detail is a string containing a Markdown ATX heading line (/^#{1,6}\s+\S/m).
- The number of options is ≤ 3.

Known Limitations

  • Wide tables in the modal maintain horizontal scrolling.
  • Dependencies include @deepseek-ai/cordis, react, @deepseek-ai/dsh-client-runtime, and others.