dsh-web
zhu1090093659
DeepSeek Harness (DSH) Web 插件聚合生态 · 万物皆插件,通过创意工坊分发||DeepSeek Harness (DSH) Web Plugin Aggregation Ecosystem · Everything is a plugin, distributed via the Creative Workshop
Sunday2Mo/dsh-file-quote
基于 better-sidebar 的统一引用插件:划选文件/消息即可批注引用,引用块带文件路径与行区间、双端折叠、点击跳回原文 | Unified-quoting plugin built on DSH-better-sidebar: select files or messages to annotate; quote blocks carry path & line range, collapse in chat and history, and jump back to the source on click.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Sunday2Mo/dsh-file-quote
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
划选批注 文件引用 行区间定位 双端折叠 点击跳回
> 📄 引用来源:路径(第 X-Y 行)),适用于所有可在侧边栏预览/编辑的文件类型🔌 基于 dsh-better-sidebar 的 DSH 统一引用插件:完整功能依赖 dsh-better-sidebar——侧边栏文件引用、跳回定位高亮都以它为基础,为获得完整体验请先安装。基础引用流程源自 dsh-quote-annotate(MIT);侧边栏文件内部内容精确引用、双端折叠、跳回定位为原创扩展。
DeepSeek Harness Web 0.1.x(client 使用 slots / inputTriggers 服务;输入管线缺失时优雅降级为纯文本插入)。dsh-better-sidebar 推荐必装:插件的完整功能(侧边栏文件内容引用、跳回定位高亮)依赖它——未安装时仅会话消息引用可用,文件引用退化为原文浮层展示。对应 DSH 0.1.0-rc.8 及更高。
# 1. 先安装 dsh-better-sidebar(完整功能依赖)
dsh plugin --profile web add dsh-better-sidebar@latest # 首次会因 pnpm 11 拦截 node-pty 构建脚本而失败(依赖已写入)
cd ~/.dsh/profiles/web && pnpm approve-builds --all # 放行构建脚本(自动重跑安装)
dsh plugin --profile web add dsh-better-sidebar@latest # 重跑即成功
#装完硬刷新浏览器(Cmd/Ctrl+Shift+R)即可看到侧边栏(DSH 对 client 改动热加载,无需重启;仅 host 半更新时需要重启)。
# 2. 再安装本插件
# 从 npm 安装(推荐):
dsh plugin --profile web add dsh-file-quote
# 本地开发(link: 热更新)
dsh plugin --profile web add "link:your path/dsh-file-quote"
装完硬刷新浏览器(Cmd/Ctrl+Shift+R);host 半改动需重启 dsh web。
发送时引用块序列化为 markdown > 块,来源行集成在块内(中文原样,不随界面语言翻译):
> 引用正文
> 📄 引用来源:src/a.ts(第 3-5 行)
> 📄 文件:… 格式(v0.7),已发送的旧引用块仍可点击定位。dsh-file-quote (bundle: dsh.bundle + package.json#dsh.client)
├── src/index.js host:/dsh-file-quote/read 安全文件读取端点
│ (workspace realpath jail + 2MB 上限 + 二进制 NUL 检测)
└── src/client.js 浏览器:选区捕获、批注浮层、引用管线、回合按钮、已发送折叠、跳回定位
├── 引用管线 inputTriggers.registerSource('file-quote-ref'):chip → 引用块序列化 codec
├── 选区分流 消息选区 → anchorKey;编辑器选区(CM6 cmTile)→ relPath + 行区间
├── 定位链 编辑器跳转 → Markdown 预览高亮 → tab/文件树激活 → better-sidebar openFile → 原文浮层
└── 已发送折叠 MutationObserver:把会话记录中的 `> 引用块` 折叠为悬停 chip
划选文本 ─▶ 批注浮层 ─▶ 「引用#N」chip 插入输入框(任意位置、数量不限)
发送 ─▶ codec 序列化为 `\n> 引用正文\n> 📄 引用来源:路径(第 X-Y 行)\n`
─▶ 会话记录折叠为「引用内容 · 悬停查看」chip(AI 可见全文)
点击 chip ─▶ 解析来源行 → 编辑器定位高亮 / 消息行闪烁 / 原文浮层兜底
源码位于 src/(src/index.js host 半区、src/client.js client 半区,window.__ModuleLoader__.load 格式),是唯一真源;lib/ 为构建产物,由零依赖脚本 scripts/build.js 从 src/ 复制生成(纯 JS 复制式构建,两者内容相同属正常),已被 .gitignore 忽略、不提交 GitHub。
npm run build # src/ → lib/(npm 安装 / GitHub 安装 / 打包时经 prepare 自动执行)
只改 src/,不要手改 lib/:改完先 npm run build,再硬刷新浏览器调试 client;host 改动(src/index.js)需重启 dsh web。
插件部分设计源自 dsh-quote-annotate(MIT License,Copyright (c) 2026 wangwei-wade)。
MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: dsh-better-sidebar、sidebar。