@him666233/dsh-inline-diff 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +19 -8
- package/README.md +19 -8
- package/client.js +1932 -102
- package/index.js +1090 -740
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -4,20 +4,20 @@
|
|
|
4
4
|
|
|
5
5
|
> **Originality notice (important)**: This project is **an entirely original work**. It has **no relationship whatsoever** with [JanEickholt/dsh-inline-diff](https://github.com/JanEickholt/dsh-inline-diff) **or any other plugin, repository, or project with the same or a similar name**. This project did not reference, copy, or port any of those projects; the implementation approach, module split, code organization, and final rendering are completely different. Any similarity in part of the functionality (inline diff display in conversations) is **coincidental** — this project only discovered the same-named/similar project when searching for similar plugins after the implementation was already complete. This project is **not** a derivative work, a re-creation, or a fork of any other project.
|
|
6
6
|
|
|
7
|
-
DeepSeek Harness plugin: renders inline diff cards in place for every `edit` / `write` / `str_replace_editor` call in the conversation, automatically detects the file language (57 languages) and applies red/green-safe syntax highlighting, and provides side-by-side comparison, inline character-level highlighting, moved-block and passive line-number annotations, and Read range display; command, search, web, and generic tool calls can also switch to the expanded style (IN/OUT open by default), and command and tool cards color their input/output status per segment. **Since 1.3.0 the UI and documentation are fully bilingual (Chinese / English), with an independent language switch on the settings page
|
|
7
|
+
DeepSeek Harness plugin: renders inline diff cards in place for every `edit` / `write` / `str_replace_editor` call in the conversation, automatically detects the file language (57 languages) and applies red/green-safe syntax highlighting, and provides side-by-side comparison, inline character-level highlighting, moved-block and passive line-number annotations, and Read range display; command, search, web, and generic tool calls can also switch to the expanded style (IN/OUT open by default), and command and tool cards color their input/output status per segment. **Since 1.3.0 the UI and documentation are fully bilingual (Chinese / English), with an independent language switch on the settings page; since 1.4.0 the default is “Follow DSH”, and the release adds card/output/dialog motion plus a built-in version check, update and rollback panel in the settings page.**
|
|
8
8
|
|
|
9
9
|
- **Author**: [Him666233](https://github.com/Him666233)
|
|
10
10
|
- **Repository**: [Him666233/dsh-inline-diff](https://github.com/Him666233/dsh-inline-diff)
|
|
11
11
|
- **License**: MIT
|
|
12
12
|
- **npm**: `@him666233/dsh-inline-diff`
|
|
13
|
-
- **Current version**: 1.
|
|
13
|
+
- **Current version**: 1.4.0
|
|
14
14
|
|
|
15
15
|
> “Expanded style / Expanded” in the settings means the expanded, flat, transparent output style of modern coding agents; the project contains no third-party product brand names.
|
|
16
16
|
|
|
17
17
|
## Compatibility
|
|
18
18
|
|
|
19
19
|
- **DSH version range (`engines.dsh`)**: `>=0.2.2-rc.1 <0.3.0`
|
|
20
|
-
- **Tested
|
|
20
|
+
- **Tested versions**: `0.2.2-rc.1` (desktop profile) and `0.2.2-rc.2` (Web profile)
|
|
21
21
|
- Outside the `engines.dsh` range, the DSH loader refuses to load the plugin and never silently runs an unverified version
|
|
22
22
|
- If the desktop app and the Web UI use different profiles, the plugin must be installed separately in each
|
|
23
23
|
- Does not shadow the tool-call entries of `conversation.chat.node` (the official Tool layer owns that entry and declares the `tool.call.toolview` sub-slot, and declaring it again throws); only registered tool rows are taken over through keyed `tool.call.toolview`, and unregistered tools keep the official generic row
|
|
@@ -84,13 +84,20 @@ Then add the following to the profile's `package.json`:
|
|
|
84
84
|
|
|
85
85
|
Bottom of the sidebar → “Diff style”, or the DSH settings page → “Inline Diff”:
|
|
86
86
|
|
|
87
|
-
**Language (new in 1.3.0)**:
|
|
87
|
+
**Language (new in 1.3.0; Follow DSH is the default since 1.4.0)**:
|
|
88
88
|
|
|
89
89
|
| Setting | Options |
|
|
90
90
|
| --- | --- |
|
|
91
|
-
| Language | 中文
|
|
91
|
+
| Language | 中文 / English / **Follow DSH (default)** |
|
|
92
92
|
|
|
93
|
-
Changes take effect immediately without a refresh and never modify DSH's global language; documentation language: Chinese is the default ([README.md](README.md)), and English is in this file ([README.en.md](README.en.md)). The top of the settings page also shows a prominent originality notice: this project is a fully original work and has no relationship with any same-named/similar plugin (including [JanEickholt/dsh-inline-diff](https://github.com/JanEickholt/dsh-inline-diff)).
|
|
93
|
+
Changes take effect immediately without a refresh and never modify DSH's global language; the default follows DSH (Chinese when DSH is Chinese, English for other host languages). Old archives that never explicitly picked a language migrate once to Follow DSH; explicit choices are preserved. documentation language: Chinese is the default ([README.md](README.md)), and English is in this file ([README.en.md](README.en.md)). The top of the settings page also shows a prominent originality notice: this project is a fully original work and has no relationship with any same-named/similar plugin (including [JanEickholt/dsh-inline-diff](https://github.com/JanEickholt/dsh-inline-diff)).
|
|
94
|
+
|
|
95
|
+
**Version & updates (new in 1.4.0)**:
|
|
96
|
+
|
|
97
|
+
| Action | Description |
|
|
98
|
+
| --- | --- |
|
|
99
|
+
| Check for updates | The Host reads every published version of `@him666233/dsh-inline-diff` from npm (60s cache) and marks Latest / Installed / Deprecated / Unavailable |
|
|
100
|
+
| Update / roll back / reinstall | Pick any version and the action follows the version relationship; on Web it runs the official plugin-install command once (automatic rollback with log on failure) and tells you to restart DSH afterwards; on Desktop a copyable command is shown (quit DSH completely first) |
|
|
94
101
|
|
|
95
102
|
Four display styles:
|
|
96
103
|
|
|
@@ -112,11 +119,15 @@ Syntax highlighting and language badge (independent of the table above):
|
|
|
112
119
|
| Unknown language | Show “Unknown” / Hide |
|
|
113
120
|
| Font emphasis | Color + font style / Color only |
|
|
114
121
|
|
|
115
|
-
Settings are saved in localStorage (`dsh-inline-diff.settings.
|
|
122
|
+
Settings are saved in localStorage (`dsh-inline-diff.settings.v5`); old v4 / v3 / v2 values are migrated automatically and the old keys are removed. The default UI language is “Follow DSH”.
|
|
116
123
|
|
|
117
124
|
## Data and limitations
|
|
118
125
|
|
|
119
|
-
|
|
126
|
+
By default the plugin makes no network requests and has no telemetry, and the client uses no `innerHTML` / `dangerouslySetInnerHTML` / `eval`; the only exception is when the user explicitly clicks “Check for updates / Install”, where the Host fetches npm registry metadata and invokes the local `dsh` CLI. Those requests contain only the package name/version — never session content, file content, keys or device information. The Host keeps only the before/after text needed for display in in-memory snapshots (LRU: at most 240 entries, 4 MB per side, plus a 64 MB total cap) and never writes it to disk; the Host read-only APIs are protected by the DSH browser trust boundary (`connection` admission, falling back to a local loopback fence when that service is unavailable), with a 1 MB request-body cap, JSON-only bodies, a 10-second request-read timeout, a 15-second file-read timeout, and an 8-concurrent-read limit. Very large files and very long single lines have a materialization budget on the browser side (200k lines / 1,000,000 characters per line); beyond it the plugin automatically degrades to changed hunks with a reason notice and never freezes the page. The Host saves snapshots only for `edit` / `write`, while `str_replace_editor` shows the changed hunks from the tool metadata and tries to locate line numbers — its card and the expanded dialog use a dedicated “this tool call keeps no execution snapshot” notice (not history-replay wording); after an app restart, history replay is likewise explained in the expanded dialog. In extreme cases the plugin falls back step by step: “snapshot → current-file read → tool-metadata changed hunks → explicit explanation”; the UI language, settings storage, and syntax highlighting also have Chinese / default-value fallbacks, so the final outcome is a readable explanation rather than a silent failure. History-replay line numbers are located again in the current file; if the file has since changed and the hunk cannot be located uniquely, “line numbers pending” is shown and the dialog explains that only the changed hunks can be shown. The same card shows the execution snapshot of that edit and does not refresh as the file changes later; the full display behavior (snapshot semantics, refresh rules, line-number legend, dialog layering and scrolling, performance notes) is documented in the repository's [docs/display-behavior.en.md](https://github.com/Him666233/dsh-inline-diff/blob/main/docs/display-behavior.en.md).
|
|
127
|
+
|
|
128
|
+
Motion: tasteful animations only cover running-card mount, output arrival and dialog opens; historical replay and settled cards render their final state immediately, and everything is disabled when the OS “reduce motion” preference is on.
|
|
129
|
+
|
|
130
|
+
Version & updates: the panel lists only npm releases; a one-click install replaces the current profile installation with the npm release (a local dev build would be overwritten), and DSH must be restarted afterwards. Desktop v1 has no in-place one-click install and shows a manual command instead.
|
|
120
131
|
|
|
121
132
|
For the full documentation, internal architecture, and known limitations, see the repository's [README](https://github.com/Him666233/dsh-inline-diff/blob/main/README.en.md).
|
|
122
133
|
|
package/README.md
CHANGED
|
@@ -4,20 +4,20 @@
|
|
|
4
4
|
|
|
5
5
|
> **原创声明(重要)**:本项目是**完全原创**的作品,与 [JanEickholt/dsh-inline-diff](https://github.com/JanEickholt/dsh-inline-diff) **以及任何其他同名插件、仓库或项目没有任何关系**。本项目没有参考、复制或移植上述项目;两者的实现方式、模块划分、代码组织与最终渲染效果完全不同。部分功能相似(对话内联差异展示)纯属**雷同巧合**——本项目是在完成实现之后搜索同类插件时,才发现存在同名/相似项目。本项目**不是**任何其他项目的衍生作品、复刻作品或分支。
|
|
6
6
|
|
|
7
|
-
DeepSeek Harness 插件:为每次 `edit` / `write` / `str_replace_editor` 调用在对话中就地渲染内联差异卡片,自动识别文件语言(57 种)并做避开红绿的语法高亮,并提供左右对照、行内字符级高亮、移动块与被动行号说明、Read 行范围展示;命令、搜索、网页与通用工具调用还可切换为默认展开 IN/OUT 的「展开风格」,命令与工具卡片的输入/输出状态按段独立着色。**1.3.0
|
|
7
|
+
DeepSeek Harness 插件:为每次 `edit` / `write` / `str_replace_editor` 调用在对话中就地渲染内联差异卡片,自动识别文件语言(57 种)并做避开红绿的语法高亮,并提供左右对照、行内字符级高亮、移动块与被动行号说明、Read 行范围展示;命令、搜索、网页与通用工具调用还可切换为默认展开 IN/OUT 的「展开风格」,命令与工具卡片的输入/输出状态按段独立着色。**1.3.0 起界面与文档提供完整中英双语,并可在设置页独立切换语言;1.4.0 起默认「跟随 DSH」,并新增卡片/输出/弹窗动效以及设置页自带的版本检查、更新与回退。**
|
|
8
8
|
|
|
9
9
|
- **作者**:[Him666233](https://github.com/Him666233)
|
|
10
10
|
- **仓库**:[Him666233/dsh-inline-diff](https://github.com/Him666233/dsh-inline-diff)
|
|
11
11
|
- **License**:MIT
|
|
12
12
|
- **npm**:`@him666233/dsh-inline-diff`
|
|
13
|
-
- **当前版本**:1.
|
|
13
|
+
- **当前版本**:1.4.0
|
|
14
14
|
|
|
15
15
|
> 设置项中的「展开风格 / Expanded」指展开式、平板式、类现代编码代理的透明输出效果;项目不包含任何第三方产品品牌字样。
|
|
16
16
|
|
|
17
17
|
## 兼容性
|
|
18
18
|
|
|
19
19
|
- **DSH 版本范围(`engines.dsh`)**:`>=0.2.2-rc.1 <0.3.0`
|
|
20
|
-
- **实测版本**:`0.2.2-rc.1`
|
|
20
|
+
- **实测版本**:`0.2.2-rc.1`(桌面端 profile)与 `0.2.2-rc.2`(Web profile)
|
|
21
21
|
- 不在 `engines.dsh` 范围内时,DSH 加载器会拒绝加载本插件,不会静默运行未验证版本
|
|
22
22
|
- 桌面端与 Web UI 若使用不同 profile,需要分别安装
|
|
23
23
|
- 不 shadow `conversation.chat.node` 的 tool-call 条目(官方 Tool 层拥有该条目并声明 `tool.call.toolview` 子槽,重复声明会抛错),只通过 keyed `tool.call.toolview` 注册接管已登记的工具行;未登记工具沿用官方通用行
|
|
@@ -84,13 +84,20 @@ pnpm add link:/absolute/path/to/dsh-inline-diff/plugin
|
|
|
84
84
|
|
|
85
85
|
侧边栏底部「差异样式」或 DSH 设置页「内联差异」:
|
|
86
86
|
|
|
87
|
-
**界面语言(1.3.0
|
|
87
|
+
**界面语言(1.3.0 新增,1.4.0 起默认跟随 DSH)**:
|
|
88
88
|
|
|
89
89
|
| 设置项 | 可选项 |
|
|
90
90
|
| --- | --- |
|
|
91
|
-
| 界面语言 / Language |
|
|
91
|
+
| 界面语言 / Language | 中文 / English / **跟随 DSH(默认)** |
|
|
92
92
|
|
|
93
|
-
切换立即生效、无需刷新,不会改动 DSH
|
|
93
|
+
切换立即生效、无需刷新,不会改动 DSH 全局语言;默认跟随 DSH(DSH 中文时中文,其它语言时英文);旧存档中从未明确选择过语言的会一次性迁移为跟随 DSH,曾明确选过的保留。文档语言:中文默认(本文件),英文见 [README.en.md](README.en.md)。设置页顶部同时展示一条醒目的原创声明:本项目为完全原创作品,与任何同名/相似插件(包括 [JanEickholt/dsh-inline-diff](https://github.com/JanEickholt/dsh-inline-diff))没有任何关系。
|
|
94
|
+
|
|
95
|
+
**版本与更新(1.4.0 新增)**:
|
|
96
|
+
|
|
97
|
+
| 操作 | 说明 |
|
|
98
|
+
| --- | --- |
|
|
99
|
+
| 检查更新 | Host 侧读取 npm 上 `@him666233/dsh-inline-diff` 的全部版本(60 秒缓存),标记最新 / 当前 / 已废弃 / 不可安装 |
|
|
100
|
+
| 更新 / 回退 / 重装 | 选择任意版本后按版本关系显示对应动作;Web 端一键调用官方插件安装命令(失败自动回滚并显示日志),成功后提示重启 DSH;桌面端显示可复制命令(需先完全退出 DSH) |
|
|
94
101
|
|
|
95
102
|
四项展示风格:
|
|
96
103
|
|
|
@@ -112,11 +119,15 @@ pnpm add link:/absolute/path/to/dsh-inline-diff/plugin
|
|
|
112
119
|
| 未知语言 | 显示“未知语言” / 不显示 |
|
|
113
120
|
| 字体强调 | 颜色 + 字体样式 / 仅颜色 |
|
|
114
121
|
|
|
115
|
-
设置保存在 localStorage(`dsh-inline-diff.settings.
|
|
122
|
+
设置保存在 localStorage(`dsh-inline-diff.settings.v5`);旧 v4 / v3 / v2 值自动迁移并删除旧键。默认界面语言为「跟随 DSH」。
|
|
116
123
|
|
|
117
124
|
## 数据与限制
|
|
118
125
|
|
|
119
|
-
|
|
126
|
+
插件默认没有网络请求或遥测,客户端不使用 `innerHTML` / `dangerouslySetInnerHTML` / `eval`;唯一例外是用户主动点击「检查更新 / 安装」时 Host 访问 npm registry 并调用本机 `dsh` CLI,请求只含包名/版本号,不发送会话内容、文件内容、密钥或设备信息。Host 只保留显示所需的修改前后文本到内存快照(LRU:最多 240 条、每侧上限 4MB,并限制总量 64MB),不落盘;Host 只读 API 受 DSH 浏览器信任边界(`connection` 准入,无该服务时回退本机 loopback 围栏)保护,并有请求体 1MB、仅 JSON、10 秒读取超时、15 秒文件读超时与 8 并发上限。超大文件与超大单行在浏览器侧有物化预算(20 万行 / 单行 100 万字符),超限自动降级为差异块并提示原因,不会冻结页面。Host 只为 `edit` / `write` 保存快照,`str_replace_editor` 按工具元数据中的修改块展示并尽量定位行号,卡片与放大弹窗用「不保存执行快照」的专用说明(不是历史回放措辞);应用重启后的历史回放同样会在放大弹窗内说明。极端情况下按「快照 → 当前文件读取 → 工具元数据差异块 → 明确说明」逐级回退;界面语言、设置存储、语法高亮同样有中文 / 默认值兜底,最终才显示可读的错误说明而不是静默失败。历史回放的行号按当前文件重新定位;若文件此后又被改动导致无法唯一定位,会显示「行号待定」并在弹窗说明只展示修改块。同一张卡片展示的是该次编辑的执行快照,不会随文件后续改动刷新;完整的显示行为说明(快照语义、刷新规则、行号图例、弹窗层级与滚动、性能提示)见仓库 [docs/display-behavior.md](https://github.com/Him666233/dsh-inline-diff/blob/main/docs/display-behavior.md)。
|
|
127
|
+
|
|
128
|
+
动效方面:只给运行中卡片挂载、输出出现与弹窗打开加克制动画,历史回放与已结算卡片直接显示终态,系统「减少动效」下全部关闭。
|
|
129
|
+
|
|
130
|
+
版本与更新方面:更新面板列出的是 npm 已发布版本;一键安装会用发布版覆盖当前 profile 中的安装(本地开发构建会被覆盖),安装后必须重启 DSH 生效;桌面端 v1 不提供运行中一键安装,只显示手动命令。
|
|
120
131
|
|
|
121
132
|
完整说明、内部架构与已知限制见仓库根目录 [README](https://github.com/Him666233/dsh-inline-diff#readme)。
|
|
122
133
|
|