Skip to content

Releases

v1.3.0

Choose a tag to compare

@Him666233 Him666233 released this 07 Nov 21:13
0ced872

v1.3.0 · 内联差异插件(2026-11-08)

发布日期:2026-11-08(Asia/Shanghai)
上一个公开版本:v1.2.6(2026-11-07)

DSH Inline Diff 为 DeepSeek Harness 的对话流提供逐次文件修改的内联差异卡片:每一次 edit / write 都会就地显示修改前后对照,并提供左右对照、行内字符级高亮、移动块与被动行号说明、Read 行范围,以及可独立配置的「展开风格」工具行。

本版本是一个功能版本(minor):新增中英双语界面与设置页语言切换、完整英文文档与双语截图、设置页/文档原创声明,同时完成一轮安全加固、详细中文注释与多级回退梳理;首次把插件发布到 npm(@him666233/dsh-inline-diff),安装方式在原有本地目录 / link / Release 基础上增加 dsh plugin add 一键安装。没有破坏性变更;旧安装方式继续可用。

新增

中英双语界面与语言切换

  • 插件设置页新增「界面语言 / Language」:中文(默认) / English / 跟随 DSH,切换立即生效、无需刷新;不会修改 DSH 全局语言,也不影响其它插件。
  • 全部插件界面文案(卡片、放大弹窗、命令/工具行、Read 范围、设置、aria-label/title、空状态与错误文案)统一走双语字典;字典缺失时按「选中语言 → 中文 → key」回退,绝不因缺词抛错。
  • 设置页与设置弹窗顶部新增醒目的原创声明:本项目完全原创,与 JanEickholt/dsh-inline-diff 及任何其他同名插件/仓库无关,功能相似纯属巧合,实现与代码效果完全不同,不是衍生或复刻作品。

英文文档与双语截图

  • 新增 README.en.md、plugin/README.en.md、docs/display-behavior.en.md;三份文档顶部提供中/英切换,中文为默认主文档。
  • 新增 docs/en/ 英文界面截图 12 张(与中文截图同名一一对应);中文设置页、放大弹窗截图按 1.3.0 新界面重拍。截图流程:关闭第三方主题 → 官方原版外观(深色为主,另附浅色外观)→ 分中英文各截一套 → 恢复原主题/外观。

维护者文档与安装方式

  • 新增维护者本地 GitHub 上传说明(放在工作区根目录,不进入仓库、不随发行包发布):哪些文件该传、哪些不该传,Release 附件怎么发。
  • docs/publish.md 增加发布节奏(先 GitHub 源码 + Release,再 npm 发布)与 npm 首发口径。
  • 安装方式更新为:npm(主推,自 1.3.0 起)→ 本地目录/离线安装 → 手动 link → GitHub Release 安装,并补充升级、卸载、按 profile 安装说明。

安全加固

安全审计结论:无 CRITICAL 级漏洞;修复 2 项 HIGH、3 项 MEDIUM,另有若干 LOW/INFO。

  • Host 只读 API 的浏览器信任边界(HIGH):前缀路由 /dsh-inline-diff/api/* 在读取 body 前先做准入——优先复用 DSH connection.admit(req)(Host / Origin / 跨站围栏 + HttpOnly、SameSite=Strict 会话 Cookie);无 connection 的嵌入式 profile 回退本地围栏(Host 必须 loopback / 监听器绑定地址、Origin 同 authority、拒绝 sec-fetch-site: cross-site);任何异常都不 fail-open。修复 DNS rebinding 与未认证远程读取风险。
  • 快照内存总预算(HIGH):在「最多 240 条 / 每侧 4MB」之外新增 64MB 总字节预算与字节记账 LRU,避免异常输入把 Host 内存放大到 OOM。
  • 路由与输入加固(MEDIUM):仅接受 application/json(415)、action 预检(404)、请求体 1MB + 流式上限 + 10 秒超时(413/408)、/read 15 秒读超时与 8 并发(429/504)、统一安全响应头(nosniff / no-store / referrer-policy / CORP)、错误改为语义状态码与固定文案(不回显绝对路径 / errno / 堆栈)。
  • 客户端物化预算(MEDIUM):20 万行 / 单行 100 万字符预算在拆分逐行对象之前生效,超限降级为「文件过大」提示,避免 4MB 级输入冻结或撑爆渲染进程;locateOnce 与移动块候选对增加复杂度护栏。
  • 其它:read-range-dom 在 document.body 缺失 / 观察异常时安全回退;CI 增加最小权限 permissions: contents: read;npm audit(含 devDependencies)0 漏洞;客户端无 innerHTML / dangerouslySetInnerHTML / eval;高亮 HTML 只解析为纯文本 token。

改进

  • 代码结构与注释:按「一个文件只做一类事」梳理客户端模块(i18n 独立成模块);关键路径补充详细中文注释(职责、输入输出、边界、回退链);核心逻辑抽为纯函数便于测试。
  • 多级回退与容错:修改前全文(快照 → 文件读取 → 工具元数据差异块 → 明确说明)、全文对照、超大输入、语法高亮、界面语言(设置 → 中文 → key)、设置存储(localStorage → 内存默认值)、Host API 准入(connection → 本地围栏 → 403 降级)等均明确回退层级,最终给出可读原因说明而不是静默失败。
  • 测试:新增 tests/locales.test.mjs(30 项)与 tests/security.test.mjs(31 项);npm test 共 124 项。
  • 版本卫生:package-lock.json 与版本号同步;plugin/package.json 的 files 增加 README.en.md;build.mjs 保持包名单一来源(client.js 模块 id 与 cordis.patch.yml 自动生成)。

安装与升级

# 新安装(推荐,自 1.3.0 起发布到 npm)
dsh plugin add @him666233/dsh-inline-diff

# 或在 DSH Web UI 的「插件 → 添加插件」中输入包名
# 升级(npm 安装的版本)
dsh plugin add @him666233/dsh-inline-diff@<版本>

原有安装方式继续可用:本地目录 / 离线包(把 plugin/ 目录交给「添加插件」)、手动 pnpm add link:、GitHub Release 中的 dsh-inline-diff-<版本>-plugin.zip。桌面端与 Web UI 若使用不同 profile,需分别安装;同一 profile 不要同时保留 link 版与 npm 版。

截图与文档

  • 中文文档:README.md、docs/display-behavior.md、中文截图 docs/;英文文档:README.en.md、docs/display-behavior.en.md、英文截图 docs/en/。
  • 发布前检查:node build.mjs(重建 plugin/client.js 与 plugin/cordis.patch.yml)→ node build.mjs --check → npm test(124 项)→ cd plugin && npm pack --dry-run(10 个文件)。
  • 发行包由 node scripts/build-release.mjs 生成:两个 zip + SHA256SUMS.txt,同时做版本/包名/bundle patch/构建产物一致性校验。

校验

  • 安装包 SHA-256 见同目录 SHA256SUMS.txt;Windows 可用 certutil -hashfile <文件> SHA256 核对。
  • 本版本在 DeepSeek Harness 0.2.2-rc.1(desktop profile)实测通过;engines.dsh 仍为 >=0.2.2-rc.1 <0.3.0。

v1.3.0 · Inline Diff Plugin (2026-11-08)

Release date: 2026-11-08 (Asia/Shanghai)
Previous public release: v1.2.6 (2026-11-07)

DSH Inline Diff renders per-edit inline diff cards directly in the DeepSeek Harness conversation: every edit / write call shows a before/after comparison in place, with side-by-side viewing, character-level inline highlighting, moved-block and passive line-number notes, Read range chips, and an independently configurable "expanded style" for command and tool rows.

This is a feature (minor) release: bilingual UI with an in-settings language switch, complete English documentation and dual-language screenshots, a prominent originality notice in settings and docs, a security-hardening pass, detailed Chinese code comments and multi-level fallbacks, and the first npm release (@him666233/dsh-inline-diff) enabling one-command installation via dsh plugin add. There are no breaking changes; all previous installation methods keep working.

Added

Bilingual UI and language switch

  • A new "Language" setting in the plugin settings page: Chinese (default) / English / Follow DSH. The switch applies immediately without reloading; it does not change the DSH global language or other plugins.
  • Every plugin-facing string (cards, expanded dialog, command/tool rows, Read range, settings, aria-labels/titles, empty and error states) goes through the bilingual dictionary. Missing entries fall back "selected language → Chinese → key" and never throw.
  • A prominent originality notice at the top of both settings surfaces: this project is fully original, has no relationship to JanEickholt/dsh-inline-diff or any other same-name plugin/repository, functional similarity is coincidental, implementation and code behavior are entirely different, and it is neither a derivative nor a replica.

English documentation and dual-language screenshots

  • New README.en.md, plugin/README.en.md, and docs/display-behavior.en.md, each with a Chinese/English switch at the top; Chinese remains the default primary documentation.
  • New 12 English screenshots under docs/en/ (same filenames as the Chinese set); the Chinese settings and viewer screenshots were retaken for the 1.3.0 UI. Screenshot process: disable any third-party theme → official appearance (dark, plus one light-appearance sample) → capture both languages → restore the original theme/appearance.

Maintainer docs and installation

  • New maintainer-local GitHub upload notes (kept at the workspace root, outside the repository and release packages): what to upload to GitHub and what to keep out of the source tree.
  • docs/publish.md now documents the release rhythm (GitHub source + Release first, npm publish afterwards) and the first npm release target.
  • Installation now covers: npm (recommended, available since 1.3.0) → local directory / offline archive → manual link → GitHub Release, plus upgrade, uninstall, and per-profile notes.

Security hardening

Audit result: no CRITICAL issues; 2 HIGH and 3 MEDIUM issues were fixed, along with several LOW/INFO findings.

  • Browser trust boundary for the Host read-only API (HIGH): the /dsh-inline-diff/api/* prefix routes now perform admission before reading any body — preferring DSH connection.admit(req) (Host / Origin / cross-site fencing plus HttpOnly, SameSite=Strict session cookies), falling back to a local fence on profiles without connection (Host must be loopback or the bound listener address, Origin must match the authority, sec-fetch-site: cross-site is rejected). Failures never fail open. This closes DNS-rebinding and unauthenticated remote-read paths.
  • Snapshot memory budget (HIGH): besides "at most 240 entries / 4MB per side", a 64MB total byte budget with byte accounting now evicts the oldest entries, preventing abnormal input from pushing Host memory to OOM.
  • Route and input hardening (MEDIUM): JSON-only bodies (415), action pre-checks (404), 1MB body + streaming cap + 10s timeout (413/408), /read 15s timeout and 8 concurrent reads (429/504), unified security headers (nosniff / no-store / referrer-policy / CORP), and semantic status codes with fixed messages (no absolute paths, errno, or stack traces).
  • Client-side materialization budget (MEDIUM): a 200k-line / 1M-character-per-line budget is measured before rows are materialized; oversized input degrades to a "file too large" notice instead of freezing or crashing the renderer. locateOnce and moved-block candidate pairs gained complexity guards.
  • Other: read-range-dom falls back safely when document.body is missing or observation fails; CI gained least-privilege permissions: contents: read; npm audit (including devDependencies) reports 0 vulnerabilities; the client uses no innerHTML / dangerouslySetInnerHTML / eval, and highlighted HTML is parsed back into plain-text tokens only.

Improvements

  • Code structure and comments: client modules were reorganized around "one file, one responsibility" (i18n is now its own module); critical paths carry detailed Chinese comments (responsibility, inputs/outputs, boundaries, fallbacks); core logic was extracted into pure functions for testability.
  • Multi-level fallbacks: before-text (snapshot → current-file read → tool-metadata hunks → readable notice), whole-file comparison, oversized input, syntax highlighting, UI language (setting → Chinese → key), settings storage (localStorage → in-memory defaults), and Host API admission (connection → local fence → 403 degradation) all define explicit fallback layers and end in a readable explanation rather than a silent failure.
  • Tests: new tests/locales.test.mjs (30 tests) and tests/security.test.mjs (31 tests); npm test now runs 124 tests.
  • Version hygiene: package-lock.json is in sync; plugin/package.json's files includes `README.en.m...
Read more

v1.2.6

Choose a tag to compare

@Him666233 Him666233 released this 06 Nov 21:16
c2b64e0

v1.2.6 · 内联差异插件(2026-11-07)

发布日期:2026-11-07(Asia/Shanghai)
上一个公开版本:v1.0.0(2026-11-05)

DSH Inline Diff 为 DeepSeek Harness 的对话流提供逐次文件修改的内联差异卡片:每一次 edit / write 都会就地显示修改前后对照,并提供左右对照、行内字符级高亮、移动块与被动行号说明、Read 行范围,以及可独立配置的「展开风格」工具行。

本版本是一个修复版本:没有破坏性变更、没有设置项迁移。重点是修复「切回官方原版主题后卡片外壳与设置弹窗仍是蓝色」「设置弹窗在官方深色主题下发白」「第三方主题下放大按钮与折叠冲突」等主题/外观问题,并修正命令失败卡片底部多余外壳、行号图例错位、语言徽章「隐藏」语义等细节。

相对 1.2.5 的主要修复

主题与外观

  • 外壳颜色不跟随官方原版主题:官方 DSH 主题把 --dsw-alias-* token 定义在 body 上,第三方皮肤把同样的 token 定义在 :root 上;插件此前把派生颜色变量声明在 :root,var() 在根元素处解析时看不到 body 上的主题 token,只能一直使用硬编码兜底值(按第三方蓝色皮肤调的蓝)。切回「原版皮肤」后,文件卡片外壳、命令 / 工具行外壳、设置弹窗、分段控件仍是蓝色,正是这个原因。现在派生变量与浅色外观覆盖都声明在 body(与主题 token 同一层解析),官方主题、皮肤主题、第三方主题以及浅色 / 深色外观都能正确跟随;兜底色也改为中性灰,不再携带皮肤专属的蓝色调。
  • 明暗外观切换:外观镜像属性同时写到 html 与 body,并监听 body 的 data-ds-dark-theme、主题属性变化与系统外观媒体查询;官方主题下切换浅色 / 深色会立即重算外壳与语法配色。
  • 设置弹窗在官方深色主题下发白:官方深色主题里 --dsw-alias-bg-overlay 是遮罩用的中间灰(约 #61666b),设置弹窗此前用它做弹层底色,深色外观下整块面板发白、文字对比度差。现在弹层改用主题分层表面 bg-layer-2(官方深色下约 #2c2c2e),与宿主设置弹窗一致;浅色外观仍为浅色。

与第三方主题 / 插件的兼容

  • 「放大」按钮与折叠冲突:claude-style 等主题会在 document 捕获阶段拦截 [aria-expanded] 行内的真实点击,播放折叠动画后再重放一次合成点击;文件卡片头部本身是折叠按钮,点「放大」会被替换成一次头部点击,表现为先折叠、再点才打开。现在卡片头部通过 aria-haspopup="false" 豁免主题的点击拦截,并且只响应真实用户手势(忽略合成 .click() 重放);无差异时「放大」使用 aria-disabled 而非原生 disabled,点击不会再穿透到折叠头部。
  • slot 优先级冲突:主题插件也可能注册 keyed tool.call.toolview(如 claude-style 使用 -1),与插件原来的 -1 冲突会抛重复 key 错误、导致工具视图整组不注册。插件改用 -100,两者可共存,卡片正常显示。

行号「旧 / 新」图例

  • 图例与行号列错位:图例条原本用 9px 字号声明 2.2em 列宽,而行号行用 12px 字号,em 基准不同导致两列宽度不一致,「旧 / 新」字样落在行号列左上方。现在图例条与行号行共用同一字号基准(只有图例文字本身缩小),两列右边缘与行号列完全对齐。
  • 单侧行号智能适配:新建文件(write 新文件)没有旧行号、纯删除没有新行号;图例现在按修改点实际存在的行号只显示对应一侧(新建文件只显示「新」,整份文件被清空的纯删除只显示「旧」),不再强行显示不存在的行号列标签。判定抽成纯函数 gutterSides() 并补 3 项回归测试(纯删除 / 纯新增 / 含上下文 / 无行号)。

命令 / 工具行

  • 失败命令卡片底部多出一段外壳:失败的命令卡片曾在 IN/OUT 面板下方再渲染一条重复的错误文本,把卡片底部多撑出一块外壳底色。现在错误只保留在对应的 IN / OUT 段内(红字),卡片在 IO 面板处结束,与其它工具行一致。
  • 顺带清理了不再使用的 EnhancedToolCallTree / ToolBranch / NativeCompactTool 组件与 .enhanced-native* / .enhanced-call-row / .enhanced-subcalls 样式。

语言徽章与工具卡片文案

  • 语言徽章「隐藏」语义:选择「隐藏」时现在隐藏全部语言徽章(包括纯文本标记与未知语言徽章);「未知语言」选项只在徽章可见时生效。
  • str_replace_editor 卡片措辞:该工具本身不产生 Host 执行快照,实时卡片不再显示「这是历史回放」的说明,改为「该工具调用不保存执行快照」的专用说明,放大弹窗的「全文对照」置灰原因同步更新。真正的历史回放(edit / write 快照丢失)仍保留原有「历史回放」文案。
  • 行内卡片未展开行数少计:折叠预算耗尽后,「另有 N 行未展开」现在按整份 diff 的总行数计算,不再只统计预算耗尽前遍历到的修改点。
  • syntax-styles.js 顶部注释的色相窗口修正为与实际测试一致的 180°–285°。

截图与文档

  • 12 张文档截图全部重拍:当前显示环境使用 DSH 官方原版外观(深色为主,另附浅色外观),旧截图是第三方蓝色皮肤下生成的,外壳色调与现在的默认外观不一致;设置面板两张截图又按「弹窗表面色」修复重新拍摄。
  • README、插件 README、CHANGELOG、显示行为说明(docs/display-behavior.md)同步更新:主题 token 解析层级、设置弹窗表面色、第三方主题点击拦截适配、行号图例对齐与单侧适配、命令失败无额外外壳、语言徽章隐藏语义、str_replace_editor 无快照文案等。

兼容性

  • DSH 版本范围(engines.dsh):>=0.2.2-rc.1 <0.3.0
  • 实测版本:0.2.2-rc.1
  • 不在范围内时 DSH 加载器会拒绝加载本插件,避免在未验证的宿主版本上静默运行
  • DSH 桌面端与 Web UI 若使用不同 profile,需要分别在对应 profile 安装
  • 颜色取自宿主主题 token 与插件自带受限调色板,跟随 DSH 原生主题、第三方主题与明暗模式
  • 设置存储键保持 dsh-inline-diff.settings.v4,从 1.2.5 升级无需迁移

安装

方式一:DSH 插件管理器(推荐)

  1. 下载 dsh-inline-diff-1.2.6-plugin.zip 并解压;
  2. 打开 DSH 设置 → 插件管理;
  3. 选择“从本地目录安装”,指向解压后的 plugin/ 目录;
  4. 刷新或重启 DSH;已安装 1.2.5 的 profile 直接覆盖安装即可。

方式二:手动 link 安装

cd ~/.dsh/profiles/<profile>
pnpm add link:/absolute/path/to/dsh-inline-diff/plugin

并把 @local/dsh-inline-diff 加入该 profile 的 dsh.profile.bundles。

发行包

文件 用途
dsh-inline-diff-1.2.6-plugin.zip 可安装插件包(推荐下载)
dsh-inline-diff-1.2.6.zip 完整项目源码、文档、截图与插件包
SHA256SUMS.txt 本次发行包的 SHA-256 校验和

只安装插件的话下载插件 zip 即可;完整 zip 便于一次性拿到文档、截图与源码。历史版本请见 GitHub Releases。

SHA-256

49e98b3fbb3e66b3c2bd2dce58bb6a781d12eadb3d7493e69424809945139a48  dsh-inline-diff-1.2.6-plugin.zip
899451d4fbb92ad62bc721f123b98f97ea5769332427ec394c9fcb1e4e6588f5  dsh-inline-diff-1.2.6.zip

文档

已知限制

  • 「全文对照」依赖 Host 内存中的修改前后快照;应用重启后的历史回放只能恢复修改块与行号,全文页签会置灰并在放大弹窗说明原因。
  • 大文件按各项预算分别降级:任一侧 > 4000 行或 LCS 矩阵超预算时退回差异块模式并关闭移动识别;高亮预算(任一侧 > 200k 字符 / 4000 行 / 单行 > 2000 字符)超限时仅关闭语法高亮,不影响差异展示;快照缺失或只有工具元数据差异块时「全文对照」不可用,其余情况全文对照可用并在超过 4000 行时截断提示。
  • 移动识别只识别完全相同的连续行块;移动同时伴随内容修改的块按普通增删显示。
  • 语法高亮为词法级(highlight.js grammar),不依赖语言服务;TOML / JSONC / Vue / Svelte / Astro 使用最接近的基础语法做近似高亮。
  • 文件修改卡片仅支持 DSH 原生 edit / write / str_replace_editor;str_replace_editor 走工具元数据差异块路径,无法使用全文对照。
  • 插件按 profile 安装,不自动跨 profile 同步;DSH 升级到 0.3.0 或更高版本前,请等待本插件发布新的兼容版本。

作者:Him666233 · https://github.com/Him666233
License:MIT

v1.0.0

Choose a tag to compare

@Him666233 Him666233 released this 04 Nov 17:14
a5d5283

v1.0.0 · 内联差异插件首个公开版本(2026-11-05)

发布日期:2026-11-05

DSH Inline Diff 为 DeepSeek Harness 的对话流提供逐次文件修改的内联差异卡片:

  • 精确旧/新行号与修改点统计
  • 行内字符级高亮
  • 移动块与被动行号位移说明
  • 左右对照与全文对照弹窗
  • Read 工具行折叠时显示实际行范围
  • 固定文件/修改点表头
  • 文件卡片、命令执行行、工具调用、过程折叠四项可独立配置
  • 桌面端与 Web UI 均可使用

兼容性

  • DSH 版本范围(engines.dsh):>=0.2.2-rc.1 <0.3.0
  • 实测版本:0.2.2-rc.1
  • 超出范围时 DSH 加载器会拒绝加载本插件,避免在未验证的宿主版本上静默运行
  • DSH 桌面端与 Web UI 若使用不同 profile,需要分别在对应 profile 安装

安装

  1. 下载 dsh-inline-diff-1.0.0-plugin.zip 并解压;
  2. 打开 DSH 设置 → 插件管理;
  3. 选择“从本地目录安装”,指向解压后的 plugin/ 目录;
  4. 刷新或重启 DSH。

也可以从仓库源码手动 link:

cd ~/.dsh/profiles/<profile>
pnpm add link:/absolute/path/to/dsh-inline-diff/plugin

并把 @local/dsh-inline-diff 加入该 profile 的 dsh.profile.bundles。

发行包

文件 用途
dsh-inline-diff-1.0.0-plugin.zip 可安装插件包(推荐下载)
dsh-inline-diff-1.0.0.zip 完整项目源码、文档、截图与插件包
SHA256SUMS.txt 压缩包 SHA-256 校验和

GitHub 会自动提供源代码 zip/tar.gz,因此完整项目 zip 主要是方便直接下载文档与截图;只想安装插件的话下载插件 zip 即可。

SHA-256

6597441596e643b1dda57569c788eaff36819d7538f3c29c7779512405f8a62d  dsh-inline-diff-1.0.0-plugin.zip
5378e94ab84bd2740b6a480936d3a5f43598ee8c9d0c6507e91de1a93e259adc  dsh-inline-diff-1.0.0.zip

已知限制

  • 「全文对照」依赖 Host 内存中的修改前后快照;应用重启后的历史回放只能恢复修改块和行号,全文页签会置灰并在放大弹窗说明原因。
  • 超大文件(任一侧 > 4000 行或 LCS 矩阵超预算)自动退回差异块模式。
  • 移动识别只识别完全相同的连续行块;移动同时伴随修改时按普通增删显示。
  • 仅支持 DSH 原生 edit / write / str_replace_editor。

文档与反馈

作者:Him666233 · https://github.com/Him666233
License:MIT