dsh-context-annotations: Annotating Text in DSH Conversations with Automatic Sending

Preface

When having long conversations with a model in DSH (DeepSeek Harness), you often need to add a note to a certain reply, tool card, or your own previous message — something like “what does this refer to” or “please revise according to this constraint”. If you write these explanations directly into the input box, they crowd the visible messages and easily blend into the body text. A common workaround is to copy and quote, then paste into the composer, or stuff the key points into the system prompt — but the former is tedious, and the latter often fails to align with “the specific paragraph this round is pointing at”.

Below is a community plugin, dsh-context-annotations (maintainer YubaiLoving): in the Web GUI you can select text anywhere in the conversation, attach an annotation, and send the entire batch of annotations to the model only with the next user message; only a short marker appears in the UI, while the full annotations enter the request via a system prompt section. The plugin is categorized as “memory”, the repository uses the MIT license, and requires DSH >=0.1.7-rc.2.

What Is This

dsh-context-annotations is a DSH Web GUI plugin: in a session, select text → write an annotation → collect multiple annotations → send them together with the next user message (or annotations only); this batch of annotations participates in only one round of requests. After being sent, the markers remain in the transcript but dim, and the annotation contents do not appear in the conversation stream as long-form text.

Core Features

Select Text and Write an Annotation

Select text anywhere in the conversation (model replies, tool cards, your own messages, etc.), and a floating Annotation button appears next to the selection. Click it to enter the annotation; Enter saves, Shift+Enter inserts a newline, Escape cancels.

Collect and Edit Pending Annotations

Each saved annotation displays a numbered marker on the left side of its corresponding paragraph; hovering over the marker shows that annotation. A N annotations banner appears above the input area; clicking it opens the pending-send list, where you can view the quoted original text and annotations, and edit or delete them. Clicking the left-side marker also opens the editor for that entry (including delete).

Send Together with the Next Message

When sending a user message, only one short bubble appears in the conversation, such as 💬 2 annotations; hovering over that bubble reveals the quoted paragraphs and a summary of each annotation in this batch. The annotation body does not appear in visible messages; the model side receives the complete list via a system prompt section, in a format like:

1. Selected text:
<the selected passage>
Annotation: <your note>

2. Selected text:
<the selected passage>
Annotation: <your note>

Annotations are consumed immediately after being sent: once the browser and Host sync, the banner collapses, the markers remain but dim; subsequent rounds do not inherit the previous batch.

Send Annotations Only

If the composer is empty, you can start a round on its own via the send button on the banner: it is equivalent to an empty user message plus the annotation markers; annotations still enter that round’s request via the system prompt.

How It Works (Briefly)

The browser side handles selection, editing UI, and the banner; the Host side handles storage and delivery.

  1. The browser POSTs the full batch of annotations to /api/dsh-context-annotations (registered via ctx.connection.fetch, within the carrier’s trust boundary); it is not written into the draft.
  2. The Host stores the batch per Session and listens for agent/pre-step. When the current round contains a message with source.kind === "user", without altering the user message’s original text, it appends an extra message containing only the marker (e.g. 💬 N annotations); the annotation body is injected into the prompt via ctx.systemPrompt.section(), and is recorded in the log as a hidden system/message node.
  3. The batch of annotations is bound only to the round claimed by pre-step; after that round’s turn/end, it retires from the prompt. If you write annotations while the model is still answering, they remain pending and wait for your next message, rather than disappearing with the current round.
  4. The current version reads no configuration options; the collapsed list carries no plugin marker line, so it reads like your own numbered notes.

Main files: lib/index.js (Host: annotation storage, API, pre-step collapsing), lib/client.js (browser: selection button, markers, banner and panel).

Installation and Activation

Install from the GitHub repository (command from the repository README):

plugin_manager install_bundle  target="github:YubaiLoving/dsh-context-annotations"

If you already have the directory locally, you can also:

plugin_manager install_bundle  (target: this directory)

Before installing, confirm that your local DSH version meets >=0.1.7-rc.2 (see dsh.engines in package.json). The plugin is written into the profile via cordis.patch.yml, which is the bundle installation method within the DSH ecosystem; the community directory site SkillHub has no official affiliation with DeepSeek / High-Flyer and serves only for discovery and indexing.

Typical Usage

  1. After installing and enabling the plugin, open a session in the Web GUI.
  2. Drag-select text on the paragraph you want to point at, click Annotation, enter the note and press Enter to save; you can repeat this multiple times.
  3. Enter what you want to ask the model this round in the composer (you can also leave it empty and send via the banner only), and send as usual; 💬 N annotations appears in the conversation, and the model receives all “selected text + annotation” pairs in the system section of that round.
  4. After sending, check that the markers have dimmed and the banner has collapsed; if you need to modify the batch, edit via the banner or the left-side markers before sending.

Use Cases and Limitations

Suitable for: scenarios where you want to add separate notes to several passages in a long reply, keep user messages concise, and hand the model the quotes and explanations in one batch; it aligns with DSH’s “everything is a plugin” extension approach and does not modify other plugins’ DOM (it only relies on the session shell’s documented data-* selectors and this plugin’s selection logic).

Things to note:

  • Markers are validated based on character offsets of the session’s flat text; after content above changes, it performs a whitespace-insensitive search on the original text and disambiguates by occurrence order, with no DOM path fallback. If a paragraph is re-rendered and its wording changes, the side marker may be lost, but the annotations remain in the banner and can still be sent.
  • Annotations are stored in the Host’s memory (per Session); a Host restart loses pending annotations that have not yet been picked up by the browser.
  • The plugin runs under the current dsh process’s permissions; review the source code and the MIT license yourself before installing, and do not blindly install bundles in untrusted environments.

Conclusion

dsh-context-annotations packages “marquee-select + annotate + send with a single round” into one short marker and a system prompt section, reducing the burden of stacking quoted explanations in the composer. For more information, visit the SkillHub directory page and the GitHub repository.

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

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

Xiaoye