3361805598-gif/dsh-md-annotator

面向 DeepSeek Harness Web UI 的 Markdown 批注插件。通过 The Better Sidebar 打开 .md / .markdown 文件后,可进行 Markdown 预览、块级批注、选区批注、源码编辑、保存和批注报告整理。0.9.0 起重新接入 dsh-better-sidebar,由其负责文件路由与面板承载。

catalog descriptioncatalog 简介 / catalog description:DSH Markdown sidebar viewer and editor with block- and text-range annotations for structured revision requests.

Project Overview项目介绍

dsh-md-annotator is a native plugin built exclusively for DeepSeek Harness (DSH) Web UI, designed to add Markdown annotation and review capabilities to the DSH environment. To use the plugin, you must first have a working DSH Web profile installed, and have the compatible version of dsh-better-sidebar (v0.19.1 up to v0.20.0) set up on your instance. To install from source, you clone the repository, run pnpm pack to generate a tgz archive, move the archive to your DSH profile’s vendor directory, then run the DSH plugin add command pointing to the local file, before restarting DSH Web and hard-refreshing your browser to activate the plugin.

This plugin is intended for users who need to review and annotate Markdown files directly within the DSH Web interface. After opening a Markdown file through Better Sidebar, you can switch between preview mode and source edit mode, and save changes to the source file with the standard Ctrl/Cmd+S keyboard shortcut. You can add block-level annotations to any supported Markdown element including headings, paragraphs, list items, tables, and code blocks, or add inline annotations to selected text, with all annotations sorted and displayed clearly in the right sidebar.

The plugin is released under the open source MIT license, and has a few clear usage limits you should be aware of before installing. The maximum file size the plugin can handle is 2 MiB, and it only supports a subset of CommonMark, lacking support for nested lists, inline HTML, full GFM and persistent cross-session annotation storage. If you ever need to uninstall the plugin, you can do so with the command dsh plugin --profile web remove dsh-md-annotator, after which Better Sidebar will take over default Markdown preview.

这是一款专为DeepSeek Harness Web UI开发的原生Markdown批注插件,需要配合兼容版本的dsh-better-sidebar使用,通过Better Sidebar打开.md或.markdown文件后,可提供Markdown预览、块级批注、选区批注、源码编辑、保存和批注报告整理等功能。从0.9.0版本开始,该插件重新接入dsh-better-sidebar,由后者负责文件路由和面板承载,用户需要提前升级DSH到0.1.5-rc.1以上版本才能正常使用。

面向在DSH中处理Markdown文档、需要对内容进行审阅批注的用户。用户打开目标Markdown文件后,可切换预览与源码模式,源码支持常规的Ctrl/Cmd+S快捷键保存。插件支持对标题、段落、列表项等多种块元素添加块级批注,也支持选中文本添加选区批注,批注分为必须改、建议改、疑问三种类型,在右侧以卡片形式按原文位置排列,带有连接锚点和交互高亮,还支持将指定批注整理为结构化报告,写入对应会话的输入框草稿。

本插件使用MIT许可证开源,依赖DSH Web环境,要求dsh-better-sidebar版本在0.19.1到0.20.0之间,源码构建需要Node.js 20以上版本和pnpm 10以上版本。插件存在一些使用限制,比如单文件读取上限为2MiB,不支持完整GFM语法、批注持久化和JSON导入。卸载插件后,Better Sidebar会接管Markdown文件的默认预览,刷新浏览器后即可生效。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:3361805598-gif/dsh-md-annotator

把 3361805598-gif/dsh-md-annotator 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-md-annotator

面向 DeepSeek Harness Web UI 的 Markdown 批注插件。通过 The Better Sidebar 打开 .md / .markdown 文件后,可进行 Markdown 预览、块级批注、选区批注、源码编辑、保存和批注报告整理。0.9.0 起重新接入 dsh-better-sidebar,由其负责文件路由与面板承载。

功能

  • 通过 The Better Sidebar 打开 Markdown 文件,切换「预览」与「源码」模式;源码支持 Cmd/Ctrl+S 保存;
  • 解析标题、段落、列表项(逐项)、表格、代码块、引用和水平线;支持常用内联 Markdown;
  • 悬停块或列表项后添加批注,也可以在同一段落或列表项内选中文字添加选区批注;批注支持「必须改 / 建议改 / 疑问」类型;
  • 批注以右侧卡片显示,按原文位置排列并自动避让;橙色虚线从被批注的文字或段落连接到对应卡片,悬停时加粗;支持原文引用、复制、编辑、删除及单条写入草稿。保留批注高亮、计数和可拖动的批注清单,支持清空和 JSON 导出;
  • 批注栏与正文一起滚动,侧栏宽度变化时重新排列;窄侧栏可横向滚动,也可使用官方分栏放大或全屏查看;
  • 将全部、所选或单条批注整理为结构化报告,写入该文件所属会话的输入框草稿,不自动发送;
  • 独立设置「增强预览」「写入草稿后清空批注」和「报告前缀」;设置保存在本插件自己的版本化 localStorage 空间;
  • 文件重新生成后按块内容与邻接上下文重定位批注,失配项标记为「原文已变化」;
  • 同一会话和文件的多个视图共享文档草稿、版本和批注;不同会话隔离。

依赖与兼容

  • DSH Web profile;
  • dsh-better-sidebar >=0.19.1 <0.20.0,以及 DSH 0.1.5-rc.1+;旧 alpha 环境需先升级;
  • Node.js ≥ 20,pnpm ≥ 10(仅用于源码构建、测试和打包);
  • 通过 ctx.betterSidebar.registerFileViewer 注册 Markdown 预览器,优先级 20;右侧栏与底部工作台共用;
  • Better Sidebar 声明为 optional peer,避免重复实例;客户端通过 inject 等待其服务,未安装或被禁用时不激活预览器。

安装

前置:已安装可正常运行的 DSH Web profile 和上述兼容版本的 The Better Sidebar。

从本地 tgz 安装

仓库当前不提供已发布下载地址。先在项目目录打包,再把生成的 tgz 放入 Web profile 的 vendor 目录:

cd dsh-md-annotator
pnpm run pack
mkdir -p ~/.dsh/profiles/web/vendor
cp dist/dsh-md-annotator-<version>.tgz ~/.dsh/profiles/web/vendor/
dsh plugin --profile web add file:vendor/dsh-md-annotator-<version>.tgz

安装后重启 dsh web,并在浏览器中硬刷新(Cmd/Ctrl+Shift+R)。安装时应使用与实际文件名一致的版本号;本 README 不预设下载链接或校验值。

更新

修改代码后重新执行 pnpm run pack,将新的 tgz 放入 ~/.dsh/profiles/web/vendor/,再次执行 dsh plugin --profile web add file:vendor/dsh-md-annotator-<version>.tgz,然后重启 dsh web 并硬刷新浏览器。

开发、测试与打包

源码位于 lib/src/,由 scripts/bundle.mjs 拼接为 lib/client.js。在插件目录执行:

pnpm install
pnpm build       # 重新生成 lib/client.js
pnpm test        # 运行 smoke、unit、integration、host 测试
pnpm run pack        # prepack 自动构建,产出 dist/dsh-md-annotator-<version>.tgz

也可以分别运行:

node test/smoke.mjs
node test/unit.mjs

测试覆盖模块物化、解析、内联渲染、引用编解码、批注重锚定、报告和有界存储等行为;真实 DSH 浏览器集成仍应在目标版本的独立测试 profile 中验收。

保存、冲突和生命周期限制

  • 单文件完整读取上限为 2 MiB。超限文件不会以截断内容进入可保存编辑器;
  • 保存使用官方文件版本条件。外部修改导致版本冲突时保留本地源码草稿并提示处理,不自动覆盖;
  • 文件草稿、批注和视图状态保存在本次插件运行期内;刷新、重启 DSH 或停用插件前应先保存源码并导出批注 JSON;
  • 本插件不提供批注持久化、JSON 导入、富文本编辑、完整 GFM 或自动发送;
  • 卸载时撤销 viewer 注册,重新打开文件后由 Better Sidebar 内置预览接管;
  • 每 3 秒检查文件版本,保护未保存草稿;未保存标记显示在编辑器内;
  • 停用或卸载:
dsh plugin --profile web remove dsh-md-annotator

解析与引用说明

内联解析器为 CommonMark 子集,支持 ATX 标题、段落、列表、表格、代码围栏、引用、水平线,以及 `code`、**粗体**、*斜体*、~~删除线~~ 和 [文本](https://github.com/3361805598-gif/dsh-md-annotator/blob/HEAD/链接)。不支持 setext 标题、嵌套列表、内联 HTML、列表项内代码围栏或引用、表格单元格转义管道符。

批注引用采用版本化 v1:… 格式,包含内容和邻接上下文签名。文件重新生成后按原文与上下文重锚定,同名块不会静默错挂;无法匹配时保留批注并标记「原文已变化」。

← 上一个 Prev dsh-GreaterClarity-plugin 下一个 Next dsh-error-tell →