dsh-quote-annotate-pro: Text-Selection Annotation and Anchor Reference for DSH Sessions

Introduction

In DSH sessions, as the number of conversation turns increases, models often struggle to accurately pinpoint the specific content referenced by the user. This plugin utilizes Selection quoting and anchored annotations to transform selected text into anchored quote blocks. Upon sending, the model receives precise turn, role, and text information, resolving the issue of context localization in multi-turn dialogues.

Installation and Activation

Install the plugin using the official command:

dsh plugin --profile <profile> add dsh-quote-annotate-pro

Core Features

The plugin provides the following core capabilities:

  1. Selection Annotation:Select any text within the session. A bubble appears above the selection; click “Annotate” to open an edit box. Enter a comment (optional) and press Enter to insert.
  2. Quote Chips and Input Quote Blocks:After insertion, a quote navigation bar appears below the input box. Clicking a quote block or chip jumps back to the original text and highlights it.
  3. Precise Model-Side Localization:The first line of a sent quote block contains the “Turn number + Speaker + Source text,” allowing the model to pinpoint the context accurately.
  4. Compact Citations in Chat:Citations within sent messages display only as compact source text blocks.
  5. Turn-Level Quoting:Completed turns feature “Quote Question / Quote Answer” buttons at the end, supporting the quoting of entire turns.
  6. Anchor Persistence:The mapping between quotes and anchors is written to localStorage (per session, max 60 entries). Quote blocks remain clickable to jump back to the original text even after page refresh.
  7. Chinese-English Adaptation:Button text adapts to the interface language.

Notes and Limitations

  • Input Chip Navigation Dependency:The jump-back functionality is implemented by reading the chip’s title attribute to look up the reference.
  • Navigation Limitations:Jumping requires the source line to be on the current page; automatic paging is not supported if the target message has not been loaded.
  • Quote Block Reconstruction:Quote blocks are reconstructed upon switching sessions to prevent cross-conversation interference.
  • Deletion Method:Quote blocks do not have a delete button; chips must be deleted using Backspace in the input box.
  • Display Logic:Turn-end buttons are displayed even for turns containing delivered files; comments are appended as plain text after the chip.
  • Privacy and Network:This is a purely client-side plugin that does not access external services or touch credentials. The only data storage is the anchor table in localStorage. By default, it sends a single probe request to the local machine http://127.0.0.1:47821 (only when DIAG_ENABLED = true).

Conclusion

This plugin is ideal for scenarios requiring precise context localization in multi-turn dialogues. The full directory and source code are available at GitHub.

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

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

Xiaoye