dsh-patch-edit-plus 0.1.3 → 0.1.4
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/CHANGELOG.md +5 -0
- package/CHANGELOG.zh.md +5 -0
- package/dsh.plugin.json +1 -1
- package/lib/parse/unified.js +6 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
|
|
5
|
+
## [0.1.4] — 2026-10-01
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- **A bare multi-file unified diff collapsed into one file section** (ported from the 0.1.7 line, 0.2.5): without `diff --git` separators, the second file's `--- `/`+++ ` headers rewrote the previous section's paths and its hunks were matched against the wrong content, failing every section after the first. `--- ` now opens a new section whenever the current one is already claimed; parser-level and end-to-end regression tests added.
|
|
4
9
|
## [0.1.3] — 2026-10-01
|
|
5
10
|
|
|
6
11
|
### Fixed
|
package/CHANGELOG.zh.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
|
|
5
|
+
## [0.1.4] — 2026-10-01
|
|
6
|
+
|
|
7
|
+
### 修复
|
|
8
|
+
- **裸多文件 unified diff 被折叠进同一个文件 section**(自 0.1.7 线 0.2.5 移植):没有 `diff --git` 分隔时,第二个文件的 `--- `/`+++ ` 头改写前一个 section 的路径,其 hunk 被拿到错误内容上匹配,第一个文件之后的每个 section 都失败。现在当前 section 已被认领时 `--- ` 即开新 section;新增解析层与端到端回归测试。
|
|
4
9
|
## [0.1.3] — 2026-10-01
|
|
5
10
|
|
|
6
11
|
### 修复
|
package/dsh.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-patch-edit-plus",
|
|
3
3
|
"name": "dsh-patch-edit-plus",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.4",
|
|
5
5
|
"description": {
|
|
6
6
|
"en": "Patch-style file editing: one apply_patch tool for git/unified diff (default) and Codex apply_patch syntax (opt-in), with all-or-nothing application and sandbox-aware delete/move.",
|
|
7
7
|
"zh": "补丁风格文件编辑:单个 apply_patch 工具,接受 git/unified diff(默认)与 Codex apply_patch 语法(可选开启),全量验证后原子应用,删除/移动走沙箱感知 shell。"
|
package/lib/parse/unified.js
CHANGED
|
@@ -55,8 +55,12 @@ export function parseUnifiedDiff(patch) {
|
|
|
55
55
|
continue;
|
|
56
56
|
}
|
|
57
57
|
if (line.startsWith('--- ')) {
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
// A bare multi-file unified diff repeats `--- `/`+++ ` per file with no
|
|
59
|
+
// `diff --git` separator. Once the current section has been claimed by
|
|
60
|
+
// a path or a hunk, this header therefore opens the NEXT file section;
|
|
61
|
+
// reusing the section would drag the previous file's hunks into this
|
|
62
|
+
// one and fail them against the wrong content.
|
|
63
|
+
if (current === null || current.oldPath !== null || current.newPath !== null || current.hunks.length > 0) {
|
|
60
64
|
current = { oldPath: null, newPath: null, newFile: false, deletedFile: false, renameFrom: null, renameTo: null, hunks: [], startLine: lineNo };
|
|
61
65
|
sections.push(current);
|
|
62
66
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-patch-edit-plus",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Patch-style file editing for DeepSeek Harness: one apply_patch tool accepting git/unified diff (default) and Codex apply_patch syntax (opt-in), with all-or-nothing application, read-before-write intent dance, sandbox-aware delete/move, and 0.1.2-rc.1 ~ 0.1.5-rc.2 compatibility.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|