证据快照复核于 2026-08-30GitHub 数据核对日期: 2026-08-21
证据已验证Plugin Bundle开发工具Web Profile

DSH Annotation

用于选择文本并将标注随 DSH 消息发送。

快速了解

它能做什么

用于选择文本并将标注随 DSH 消息发送。

本站提供的是中文说明,不代表该项目或 Plugin 自身提供中文界面;语言支持请以上游文档为准。

使用场景
开发工具标注工作流自动化
适配技术
dshWeb
兼容性

Web Profile
not tested

可信度与状态

证据已验证
核对日期 2026/8/28 UTC 11:19

有代码证据的贡献

它为 DSH 增加什么

选择前先看

该Bundle提供用于选择文本并将标注随 DSH 消息发送

适合谁

需要annotation能力的 DSH 用户。

常见任务

  • 用于DSH 标注相关的annotation工作流。
  • 决定是否适合你的 Profile 前先查看固定版本的仓库证据。

权限与数据

本次未测试运行时行为;宿主访问范围取决于 DSH 集成方式和声明的依赖项。

权限
  • 将 DSH 项加入所选 Profile。
数据处理
  • 本次未测试运行时数据处理。
外部服务
  • 可能使用固定仓库声明的依赖项或服务。
凭据
  • 现有证据没有确认凭据要求。

局限

  • 本次未测试运行时安装和执行。
  • 描述基于固定版本的仓库证据。

DSHub 已核对

  • 证据中固定了源码仓库 commit。
  • 仓库结构已通过确定性方式采集。

DSHub 未核对

  • 本次未测试运行时安装、执行和兼容性。
  • 不表示任何安全认证。

固定版本安装

安装 DSH Annotation

这个Plugin Bundle没有 DSH Plugin 安装操作,请根据源码文档使用真实交付方式。

访问源码项目

维护者原文

项目 README

查看 commit 5949675 对应的 README
维护者编写的上游内容原文于 2026/8/28README.md 获取,正文和仓库相对媒体固定到 commit 5949675671d8,内容哈希为 8e29db0f6355。以下是未经 DSHub 翻译的上游原文,语言可能与当前页面不同;第三方托管的 badge 可能独立更新。

dsh-annotation

<div align="center">

English · 简体中文

</div><p align="center">Selection-annotation plugin for DSH Web: select text → annotate → press Enter to send it along with your message; the model replies to each annotation by number.</p><p align="center"><strong>🌐 <a href="https://omdsh-dev.github.io/dsh-annotation/">Live Product Site — Explore dsh-annotation in DSH</a></strong></p><p align="center"> <img src="https://badgen.net/badge/license/MIT/blue" alt="license"> </p> <img width="2940" height="1770" alt="image" src="https://github.com/user-attachments/assets/c3186efc-44d3-4e7f-9523-1902d9d037e9" /> <img width="2940" height="1770" alt="image" src="https://github.com/user-attachments/assets/0b48ac02-4648-4b94-8d8f-344f8b7c25b4" /> <img width="2940" height="1770" alt="image" src="https://github.com/user-attachments/assets/8b2610d0-3d00-41be-b314-bac2fe616787" /> <img width="2940" height="1770" alt="image" src="https://github.com/user-attachments/assets/9b66deea-3786-4296-9b0d-52873a15f5e1" />

Select any text in an assistant reply to annotate it (the annotation body may be left empty = just mark the passage). Annotations accumulate across messages and turns. An Annotations ×N chip appears next to the input box — hover to view all annotations, remove them one by one. Press Enter and the annotation block goes to the model together with whatever question is in the input box. The annotation block never shows up as text in your own message bubble — only the question plus the chip (content visible on hover; hidden before paint, zero flicker). The model replies with Annotation 1: …Annotation N: …, one per annotation, and every Annotation label in the reply is a hoverable chip showing the annotated passage and your note.

Form: official bundle plugin (dsh.bundle + a dsh.client declaration in package.json, injected into the browser via client-modules; the Node half is an empty implementation). Zero core changes — no DSH files are touched; cordis.patch.yml only inserts its own id once, and the profile patch stays [].

Features

Feature Description
Select-to-annotate Select assistant text → toolbar "Annotate" → write your note (may be empty); dismiss by clicking elsewhere or pressing Esc
Numbered marker + highlight A blue numbered marker + highlight anchored to the passage, viewport-anchored with collision avoidance, never lost when scrolled out of view
Cross-turn collection Any number of annotations accumulate across messages/turns, numbered from 1
"Annotations ×N" chip Small chip beside the input box; hover shows every annotation, deletable individually
Enter sends with your message Annotation block + the question in the input box are sent to the model together (the model receives the full content)
Hidden in your bubble The annotation block is removed from your bubble's DOM the moment you send (before the browser paints), leaving only the question + the chip (hover to view); historical messages self-heal after a refresh
Numbered reply correspondence A format instruction is injected into the message so the model replies Annotation 1: …Annotation N: … one by one
Reply annotation chips Annotation N: in the reply renders as hoverable chips showing the passage + your note

Interaction flow

Select assistant text ──▶ Toolbar "Annotate" ──▶ Write note / save empty ──▶ Blue numbered marker + highlight
        ▲                                                        │
        └────────────── any number, accumulate across turns ◀────┘
                                │
                                ▼
              "Annotations ×N" chip beside the input (hover to view / delete)
                                │
                            Press Enter
                                ▼
    Model receives: annotation block (number + passage + note) + your question
    Your bubble: question only + "Annotations ×N" chip (zero flicker)
    Model reply: Annotation 1: … Annotation 2: … (hoverable chips)

Install (official bundle path · the only one)

# Public npm package (works without an npm account)
dsh plugin --profile web add @changfenhuang/dsh-annotation
# Or install directly from the public GitHub source
dsh plugin --profile web add git+https://github.com/omdsh-dev/dsh-annotation.git
# local path install (development / debugging)
cd /path/to/dsh-annotation
dsh plugin --profile web add .
# restart the web service — see "Restarting the web service" below

To add it only as a Node dependency in an existing project:

npm install @changfenhuang/dsh-annotation

npm install only adds the dependency; it does not register the plugin with DSH. Use dsh plugin add above when installing it into DSH.

Migrating from the old @omdsh-dev package name

If you installed the plugin before v1.4.2, remove the old dependency before installing the renamed package:

dsh plugin --profile web remove @omdsh-dev/dsh-annotation
dsh plugin --profile web add @changfenhuang/dsh-annotation

If dsh web still fails and mentions @omdsh-dev/dsh-annotation, remove only the stale dsh-annotation entry that uses that old name from ~/.dsh/profiles/web/cordis.patch.yml. The plugin now supplies the @changfenhuang/dsh-annotation entry itself.

Do Don't
Only dsh plugin add / only write bundles Never insert the same id again in the profile/home cordis.patch.yml

Self-check:

dsh --profile web --dump-config | rg "id: dsh-annotation"   # must be exactly 1 line
dsh web --no-open   # open the printed one-time token URL in a browser

In the browser console, window.__DSH_BOOT__.entries.find(({ id }) => id === '@changfenhuang/dsh-annotation') must return an entry with a url. dsh 0.1.2 no longer exposes the old bare per-plugin URL.

Restarting the web service

Pick the command for your platform:

# macOS (launchd)
launchctl kickstart -k "gui/$(id -u)/com.dsh.web"

# WSL / Linux with systemd user services
# The unit name may differ by install method; check with:
#   systemctl --user list-units | rg dsh
systemctl --user restart dsh-web

Environments without a service manager (e.g. some containers) often need no restart at all: client.js is served per request with no caching, so a hard refresh (Cmd/Ctrl+Shift+R) picks up plugin changes. The self-check commands above are platform-neutral.

Architecture notes

  • Pure browser-side: everything lives in client.js (a hand-written CJS bundle, no build step, served no-cache per request)

  • Message format (the literal protocol block sent to the model; follows the DSH locale preference — zh or en):

    zh: 我批注了以下 N 处内容…\n\n1. 原文\n   批注:…\n\n请用「Annotation 1:…」…\n\n提问:
    en: I annotated the following N passage(s)…\n\n1. quote\n   Note: …\n\nPlease respond… "Annotation 1: …"…\n\nAsk:
    

    The zh delimiter is 「提问:」(ask:) rather than 「问题:」(question:) — the heading line "回答我的问题:" also contains the latter, and the bubble-hiding surgery would misfire on it; the en delimiter is Ask:. Hiding and reverse-parsing accept both languages plus the legacy 「问题:」 marker.

  • Bubble hiding: user bubbles are plain-text rendered (a single MessageText node, not markdown); a MutationObserver in the microtask phase (before paint) splits at the last \n提问:, cuts the annotation block, and attaches the chip; a 1 s polling fallback plus historical-message repair after refresh

  • Reply chips: after streaming settles (data-streaming removed), each Annotation N: is replaced with a hoverable chip; item data is stored on the most recent user message carrying the annotation tag (tag.__annotationItems) and rebuilt after refresh; snapshot the text nodes collected by the TreeWalker before touching the DOM, then replace one by one — replacing a child mid-walk invalidates the walker pointer and only the first node gets processed

  • Locale-aware: UI copy and the protocol block follow DSH's locale service (zh/en, live switch); historical bubbles stay parseable across languages; missing locale service falls back to zh

  • IME-safe: the Enter interception carries isComposing / keyCode 229 guards; never hard-edits the composer textarea's DOM; setDraft only assembles the annotation block at the last moment before submit and never clobbers the user's draft

  • No reliance on send-completion event chains: bubble decoration uses MutationObserver + polling (watchInputDraft can be ineffective before the session is loaded at init; it is only a staging entry)

  • Focus-chat compatible: works inside the focus conversation view of dsh-focus-chat — assistant rows there are [data-focus-flow] containers with a *_assistant CSS-Modules class (plus data-streaming while running); selection, annotation, reply chips, and re-anchoring all work in the focus tab alongside the main chat view

Version history

Version Highlights
v1.4.x Locale-aware: zh/en UI copy and annotation protocol block, live switch via DSH locale service
v1.3.x Numbered reply correspondence: format-instruction injection + hoverable Annotation N: chips (TreeWalker snapshot fix)
v1.2.x Hidden annotation block in bubble: MutationObserver microtask zero-flicker + polling fallback + historical-message repair
v1.x Self-contained annotation flow (replaces the v0.9 chip design): capture-Enter assembles the block and sends it with the message
v0.9.x Early chip design (insertReference + slash codec), superseded by v1.x

Friendly links

License

MIT

有意识地管理

安装与管理

前置条件与目标 Profile

目标 Web Profile

交付方式 Git Bundle — omdsh-dev/dsh-annotation#5949675671d84d5c1b81f223344456d7e7216620

验证、更新与移除

显示生命周期命令
验证
dsh plugin --profile web list

兼容性与访问范围

not_runtime_tested not tested

检查兼容性证据

风险事实

installation-path

No installer script was captured; review the repository instructions before use.

证据
lifecycle-script

A package lifecycle script is declared; its runtime behavior was not tested in this run.

证据
证据与编辑审查Manifest、Bundle patch、分发与新鲜度

不可变证据

审查状态与源码活动

人工已批准

在核对来源内容和不可变发布记录后,已由人工批准发布。AI 参与了内容草稿生成,最终发布决定由人工完成。

人工审查于 2026/8/29 UTC 15:24GitHub 事实核对日期: 2026/8/29 UTC 15:21

自当前证据基线以来,没有记录到重要源码变化。

下一步

按 Plugin 安装流程操作

订阅重要变化: DSH Annotation