dsh-edit-diff 0.2.1 → 0.3.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.md +29 -5
- package/lib/client.js +603 -454
- package/lib/client.js.map +1 -0
- package/lib/index.d.ts +15 -0
- package/lib/index.js +8 -6
- package/package.json +22 -5
package/README.md
CHANGED
|
@@ -31,15 +31,29 @@
|
|
|
31
31
|
| 原版 diff |  |
|
|
32
32
|
| 本插件 |  |
|
|
33
33
|
|
|
34
|
+
## 演示视频
|
|
35
|
+
|
|
36
|
+
光看静态截图不过瘾?看看这个插件的实际演示效果:
|
|
37
|
+
|
|
38
|
+
| dsh-edit-diff 插件演示 · 66 秒 |
|
|
39
|
+
| :---: |
|
|
40
|
+
| [](https://www.bilibili.com/video/BV1ect76CENM/) |
|
|
41
|
+
|
|
34
42
|
## 安装
|
|
35
43
|
|
|
44
|
+
**从 GitHub 安装**:源码在 `src/`,`lib/` 不入仓库,安装时 npm 会触发 `prepare` 脚本现场构建。
|
|
45
|
+
|
|
36
46
|
```powershell
|
|
37
47
|
dsh plugin --profile web add github:better-er/dsh-edit-diff
|
|
38
48
|
```
|
|
39
49
|
|
|
40
|
-
|
|
50
|
+
**从 npm 安装**:包内已含构建产物 `lib/index.js` 与 `lib/client.js`,安装时不再构建。
|
|
51
|
+
|
|
52
|
+
```powershell
|
|
53
|
+
dsh plugin --profile web add dsh-edit-diff
|
|
54
|
+
```
|
|
41
55
|
|
|
42
|
-
|
|
56
|
+
两种方式装完都会自动挂载,重启 DSH web 后启用,无需手工编辑任何文件。
|
|
43
57
|
|
|
44
58
|
## 卸载
|
|
45
59
|
|
|
@@ -57,9 +71,19 @@ dsh plugin --profile web remove dsh-edit-diff
|
|
|
57
71
|
- **UI 挂载点**:接管 keyed 槽位 `tool.call.toolview` 的 `edit` 与 `write` 两个 key。
|
|
58
72
|
- **遮蔽而非冲突**:注册时显式传 `priority: -1`低于内置 `file-mutation-toolview` 的默认 0,用更低优先级遮蔽默认渲染,而不是在同一优先级上 clash。
|
|
59
73
|
- **PTC 模式**:通过 `callId` 包含 `:code:` 判断是否为 `run_code` 子调用,从 `argsRaw` 中提取 `old_string`/`new_string` 即 edit 或 `content` 即 write 动态构建 diff。
|
|
60
|
-
-
|
|
61
|
-
-
|
|
74
|
+
- **构建型**:TypeScript 源码位于 `src/`,`pnpm build` 通过 tsdown 生成 `lib/index.js`、`lib/index.d.ts`、`lib/client.js` 与 sourcemap,运行时只加载 `lib/` 发布产物。
|
|
75
|
+
- 无运行时 npm 依赖,diff 算法就地内联;浏览器端只向宿主模块表请求 react。
|
|
76
|
+
|
|
77
|
+
本地开发:
|
|
78
|
+
|
|
79
|
+
```powershell
|
|
80
|
+
pnpm install
|
|
81
|
+
pnpm typecheck
|
|
82
|
+
pnpm build
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
改完源码需重新 `pnpm build`,DSH web 的 HMR 观察到 `lib/client.js` 变化后自动重载。
|
|
62
86
|
|
|
63
87
|
## License
|
|
64
88
|
|
|
65
|
-
[MIT](./LICENSE)
|
|
89
|
+
[MIT](./LICENSE)
|