插件目录 / Developer / dsh-selection-based-comments
dsh-selection-based-comments
已验证 · 实测可装 surenkid
功能简介
DSH Web 的选区评论插件,提供类似 ChatGPT/Codex 网页端的评论体验:在聊天消息中选中一段文字,针对该选段写评论;可以继续选择其他内容追加评论;最后一次性把所有选段和评论组成一条普通用户消息提交给当前会话。
可用 — 实测通过,早期项目
DSH Web 的选区评论插件,提供类似 ChatGPT/Codex 网页端的评论体验:在聊天消息中选中一段文字,针对该选段写评论;可以继续选择其他内容追加评论;最后一次性把所有选段和评论组成一条普通用户消息提交给当前会话。 实测能干净安装、正常启动。早期项目,但功能可用。
「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。
README
dsh-selection-comments
DSH Web 的选区评论插件,提供类似 ChatGPT/Codex 网页端的评论体验:在聊天消息中选中一段文字,针对该选段写评论;可以继续选择其他内容追加评论;最后一次性把所有选段和评论组成一条普通用户消息提交给当前会话。
功能
- 在聊天消息文本上拖动选择,选区上方会出现“评论选中内容”按钮。
- 每个选段可以单独编辑或删除,尚未提交的评论会汇总到右下角的评论胶囊。
- 提交时自动合并为一条普通用户消息,模型看到的内容与手打消息一致。
- 已保存评论对应的消息行上会显示评论标记,点击标记可快速打开待提交面板。
安装
依赖 dsh 和 pnpm。dsh plugin 会在首次使用时自动初始化 web profile。
dsh plugin --profile web add github:surenkid/dsh-selection-based-comments
安装完成后重启 DSH Web:
dsh web --port 3080
然后刷新浏览器页面。插件不需要额外构建步骤,也没有安装脚本。
指定版本或分支
dsh plugin 会把参数转发给 pnpm,因此可以使用 pnpm 的 GitHub 依赖语法固定分支或 tag:
dsh plugin --profile web add github:surenkid/dsh-selection-based-comments#main
dsh plugin --profile web add github:surenkid/dsh-selection-based-comments#v0.1.0
更新与卸载
dsh plugin --profile web update dsh-selection-comments
dsh plugin --profile web remove dsh-selection-comments
本地开发安装
git clone https://github.com/surenkid/dsh-selection-based-comments.git
dsh plugin --profile web add link:/absolute/path/to/dsh-selection-based-comments
手动安装
如果不想使用 dsh plugin,也可以直接编辑 ~/.dsh/profiles/web/package.json,在 dependencies 中加入 GitHub 依赖,并把插件加入 dsh.profile.bundles:
{
"dependencies": {
"dsh-selection-comments": "github:surenkid/dsh-selection-based-comments"
},
"dsh": {
"profile": {
"bundles": [
"@deepseek-ai/dsh-base",
"@deepseek-ai/dsh-web-app",
"dsh-selection-comments"
]
}
}
}
然后在 profile 目录执行:
cd ~/.dsh/profiles/web
pnpm install
使用方式
- 在聊天消息中按住鼠标选中文字,选区上方会出现“评论选中内容”按钮。
- 点击按钮,在浮层中写下针对这段内容的评论,然后保存。可以继续选其他内容追加多条评论。
- 已保存的评论不会占据聊天区域:右下角会显示一个小胶囊“评论 N”,鼠标悬停或点击即可展开编辑/删除面板;消息行上的评论标记点击后也会直接打开这个面板。
- 在展开面板中点击“提交评论”,所有评论会合并成一条消息发送到当前会话;发送成功后待提交列表会清空。
设计说明
- 待提交评论只存在浏览器内存中(按
sessionId分组)。提交是唯一的持久化步骤,发送路径就是普通session.prompt(..., 'queue'),所以模型看到的是与手打一样的用户消息。 - 选区定位使用 DSH conversation 渲染出的
[data-chat-anchor-key]消息行,不依赖任何 conversation 内部实现。 - 浮动按钮、评论编辑器和消息标记使用原生 DOM;评论列表注册在
conversation.input.dockslot。
已知限制
- 未提交评论在页面刷新后会丢失,后续可以改成持久化 sidecar。
- 评论标记只挂在所属消息行尾部,不在原文中做逐字符高亮;原文高亮需要 markdown source map,复杂度更高。
- 跨消息跨区块选择时,评论归属到选择起点的消息行。
安装
装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:
dsh plugin add dshbase-catalog 然后对 agent 说「帮我装 dsh-selection-based-comments」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。
该插件是 GitHub 源码(未发 npm)——直接从仓库装:
Web profile:
dsh plugin --profile web add github:surenkid/dsh-selection-based-comments Headless(CLI)profile:
dsh plugin --profile headless add github:surenkid/dsh-selection-based-comments 实测报告
验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。