dsh-patch-edit-plus 0.2.4 → 0.2.6

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 CHANGED
@@ -1,23 +1,20 @@
1
1
  # Changelog
2
2
 
3
3
 
4
- ## [0.2.4] — 2026-10-01
5
-
6
- ### Changed
7
- - **Both patch syntaxes are now enabled by default**: `allowCodexPatch` default `false` → `true`, so the tool accepts git/unified diff and Codex `apply_patch` out of the box. The inserted `cordis.patch.yml` row now carries the config itself (`allowUnifiedDiff: true` + `allowCodexPatch: true`) — configuration ships through the patch layer instead of leaning on the settings panel. Set `allowCodexPatch: false` to restore unified-diff-only; the `.volatile()` settings projection is unchanged, so an explicit toggle still takes effect without a restart. The actionable UNSUPPORTED hint is unchanged for the explicit-opt-out case.
8
- - Smoke reworked for the new default: default-on apply, explicit `true` + dryRun, explicit `false` deny, and an assertion that the inserted patch row ships both modes enabled.
9
- ## [0.2.3] — 2026-09-29
4
+ ## [0.2.6] — 2026-10-01
10
5
 
11
6
  ### Fixed
12
- - **Delete/Move silently degraded to UNSUPPORTED on real 0.1.7 hosts** (defect shipped in 0.2.1): the shell duck-detect looked for `run()`, but DSH renamed `ShellExecutor.run(spec)` → `execute(spec)` (returning a `ShellProcess` handle with a `result()` foreground projection) between 0.1.2 and 0.1.7 — so the detect never matched and Delete/Move always fell back to a structured UNSUPPORTED error. `shellops` now calls `shell.execute(...)` + `await execution.result()` and duck-detects `execute`; shell test mocks moved to the `execute()`/`result()` shape.
7
+ - **A bare multi-file unified diff collapsed into one file section** (ported from the 0.1.7 line, 0.2.5): with no `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 with "the context does not match the file". `--- ` now opens a new section whenever the current one is already claimed; parser-level and end-to-end regression tests added.
8
+ ## [0.2.2] — 2026-09-29
13
9
 
14
10
  ### Changed
15
- - devDependencies 4x `@deepseek-ai/dsh-*` `0.1.2-rc.1` → `0.1.7-rc.2`: the type baseline now matches the hosts this line serves (the stale pin was the "fake green" pattern — it masked the rename above).
16
- - Docs x4 (README/INSTALL): compatibility re-based to the `0.1.7` segment; ja/ko matrices were stale at the 0.1.2~0.1.5 wide claim.
17
-
18
- ## [0.2.1] — 2026-09-25
11
+ - **DSH line split**: this release serves the `0.1.5-rc` segment only — `peerDependencies`/`engines.dsh` capped to `>=0.1.5-rc.1 <0.1.6-0` (both manifests), published under the `dsh-0.1.5` dist-tag. `0.1.2-rc.1` ~ `0.1.4` remain served by the published `0.1.2` (main); `0.1.7` by `dsh-0.1.7` (v0.2.1+); `0.2.0` by `dsh-0.2.0` (v0.3.0+).
12
+ - devDependencies 4x `@deepseek-ai/dsh-*` `0.1.2-rc.1` → `0.1.5-rc.3`: the type baseline now matches the hosts this line serves (the stale `0.1.2` pin was the "fake green" pattern — a baseline older than the served line can mask real contract breaks).
13
+ - Docs x4 (README/INSTALL): compatibility matrix re-based to the `0.1.5-rc` segment.
19
14
 
20
- - First release of the 0.1.7 line (`dsh-0.1.7` dist-tag): declarative settings — `allowCodexPatch` marked `.volatile()`, settings form auto-rendered, tool re-registered in place via `loader/volatile-update` (no remount, no registration call).
15
+ ### Verified
16
+ - No source changes required: `ShellExecutor.run(spec)` is intact across `0.1.5-rc.1`–`rc.3` (the `run` → `execute` rename lands in the 0.1.6→0.1.7 window), and the imperative settings fallback (`settings.register` / `installSection`) still exists on 0.1.5 hosts.
17
+ - build / typecheck / test (94) / lint / smoke / `typecheck:0.1.5` (static proof against real `0.1.5-rc.2` peers) all green; lockfile regenerated against `0.1.5-rc.3`.
21
18
 
22
19
  ## [0.1.2] — 2026-09-19
23
20
 
package/CHANGELOG.zh.md CHANGED
@@ -1,23 +1,20 @@
1
1
  # 更新日志
2
2
 
3
3
 
4
- ## [0.2.4] — 2026-10-01
5
-
6
- ### 变更
7
- - **两种补丁语法默认全部开启**:`allowCodexPatch` 默认值 `false` → `true`,工具开箱即接受 git/unified diff 与 Codex `apply_patch`。插入的 `cordis.patch.yml` 行现在自带配置(`allowUnifiedDiff: true` + `allowCodexPatch: true`)——配置随 patch 层下发,不再依赖设置面板。设 `allowCodexPatch: false` 可退回仅 unified diff;`.volatile()` 设置投影不变,显式开关依旧即时生效、无需重启。显式关闭时的可操作 UNSUPPORTED 提示保持不变。
8
- - Smoke 按新默认重写:默认开启直接应用、显式 `true` + dryRun、显式 `false` 拒绝,并断言插入的 patch 行携带两种模式开启。
9
- ## [0.2.3] — 2026-09-29
4
+ ## [0.2.6] — 2026-10-01
10
5
 
11
6
  ### 修复
12
- - **Delete/Move 在真实 0.1.7 宿主上被静默降级为 UNSUPPORTED**(0.2.1 携带的缺陷):shell 鸭子探测查的是 `run()`,但 DSH 在 0.1.2→0.1.7 之间把 `ShellExecutor.run(spec)` 改名为 `execute(spec)`(返回 `ShellProcess` 句柄 + `result()` 前台投影)——探测永不命中,Delete/Move 一直落到结构化 UNSUPPORTED 错误。`shellops` 现改用 `shell.execute(...)` + `await execution.result()`,鸭子探测改查 `execute`;shell 测试 mock 同步迁移到 `execute()`/`result()` 形态。
7
+ - **裸多文件 unified diff 被折叠进同一个文件 section**(自 0.1.7 线 0.2.5 移植):没有 `diff --git` 分隔时,第二个文件的 `--- `/`+++ ` 头改写前一个 section 的路径,其 hunk 被拿到错误内容上匹配,第一个文件之后的每个 section 都报 "the context does not match the file"。现在当前 section 已被认领时 `--- ` 即开新 section;新增解析层与端到端回归测试。
8
+ ## [0.2.2] — 2026-09-29
13
9
 
14
10
  ### 变更
15
- - devDependencies 4 项 `@deepseek-ai/dsh-*` `0.1.2-rc.1` → `0.1.7-rc.2`:类型基线与本线服务的宿主对齐(过期的钉版正是「假绿」形态——它掩盖了上述改名)。
16
- - 文档 ×4(README/INSTALL):兼容矩阵重基于 `0.1.7` 线段;ja/ko 矩阵此前停留在 0.1.2~0.1.5 旧态。
17
-
18
- ## [0.2.1] — 2026-09-25
11
+ - **DSH 线拆分**:本版本只服务 `0.1.5-rc` 线段——`peerDependencies`/`engines.dsh` 封顶到 `>=0.1.5-rc.1 <0.1.6-0`(双清单),经 `dsh-0.1.5` dist-tag 发布。`0.1.2-rc.1` ~ `0.1.4` 仍由已发布的 `0.1.2`(main)服务;`0.1.7` 由 `dsh-0.1.7`(v0.2.1+)服务;`0.2.0` 由 `dsh-0.2.0`(v0.3.0+)服务。
12
+ - devDependencies 4 项 `@deepseek-ai/dsh-*` `0.1.2-rc.1` → `0.1.5-rc.3`:类型基线与本线服务的宿主对齐(过期的 `0.1.2` 钉版正是「假绿」形态——基线早于服务线会掩盖真实契约断裂)。
13
+ - 文档 ×4(README/INSTALL):兼容矩阵重基于 `0.1.5-rc` 线段。
19
14
 
20
- - 0.1.7 线首发(`dsh-0.1.7` dist-tag):声明式设置——`allowCodexPatch` 标记 `.volatile()`,设置表单自动生成,工具经 `loader/volatile-update` 原位重注册(不 remount、无注册调用)。
15
+ ### 验证
16
+ - 无需源码改动:`ShellExecutor.run(spec)` 在 `0.1.5-rc.1`–`rc.3` 全程未变(`run` → `execute` 改名落在 0.1.6→0.1.7 区间),且 0.1.5 宿主仍有命令式设置回退(`settings.register` / `installSection`)。
17
+ - build / typecheck / test(94)/ lint / smoke / `typecheck:0.1.5`(对真实 `0.1.5-rc.2` peer 静态核验)全绿;lockfile 按 `0.1.5-rc.3` 重新生成。
21
18
 
22
19
  ## [0.1.2] — 2026-09-19
23
20
 
package/README.ja.md CHANGED
@@ -1,17 +1,15 @@
1
1
  # dsh-patch-edit-plus
2
2
 
3
- [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness) 向けのパッチ形式ファイル編集。モデルに公開される単一の `apply_patch` ツールが **git/unified diff** と **Codex `apply_patch` 構文**(両方とも既定で有効)を受け付け、すべての変更を **オール・オア・ナッシング**で適用し、DSH の動作には一切干渉しません。
3
+ [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness) 向けのパッチ形式ファイル編集。モデルに公開される単一の `apply_patch` ツールが **git/unified diff**(既定)と **Codex `apply_patch` 構文**(オプトイン)を受け付け、すべての変更を **オール・オア・ナッシング**で適用し、DSH の動作には一切干渉しません。
4
4
 
5
5
  ## DSH バージョン互換性
6
6
 
7
7
  | DSH バージョン | ステータス | 備考 |
8
8
  |---|---|---|
9
- | `0.1.7-rc.1+` | ✅ サポート対象(本ライン、v0.2.1+) | 宣言的設定:`allowCodexPatch` を `.volatile()` とマーク — 設定フォームは自動生成され、`loader/volatile-update` が remount なしでツールをその場で再登録します。v0.2.3 は Delete/Move を修正:shell のダックタイピング検出が `run()` を見ていましたが、実 0.1.7 ホストでは決して一致しません(`run` は 0.1.2→0.1.7 の間に `execute` に改名)、Delete/Move は UNSUPPORTED にサイレント降格していました。現在は `execute()` + `result()` を使用。v0.2.4:`allowCodexPatch` の既定値が `true` に — 両構文が初期状態で有効;設定は挿入される `cordis.patch.yml` 行経由で配布。 |
10
- | `0.1.2-rc.1` ~ `0.1.4` | ↗ メンテナンスライン | 公開済みの `0.1.2`(main ブランチ)が担います。 |
11
- | `0.1.5-rc.x` | ↗ メンテナンスライン | `dsh-0.1.5` dist-tag(v0.2.2+)が担います。 |
12
- | `0.2.0-rc.1+` | ↗ 次ライン | `dsh-0.2.0` dist-tag(v0.3.0+)が担います。 |
9
+ | `0.1.5-rc.1+` | ✅ サポート対象(本ライン、v0.2.2+) | 型ベースラインを実在の `0.1.5-rc.3` ピアに固定し、`peerDependencies`/`engines.dsh` は `>=0.1.5-rc.1 <0.1.6-0` にキャップ。`dsh-0.1.5` dist-tag で公開。 |
10
+ | `0.1.2-rc.1` ~ `0.1.4` | ↗ メンテナンスライン | 公開済みの `0.1.2`(main ブランチ)が担います。`0.1.6+` は別契約(shell の `run` → `execute`)であり、compat/0.1.7・compat/0.2.0 ラインが担います。 |
13
11
 
14
- 本ラインの設定は宣言的です:`Config` で `.volatile()` とマークされたフィールドが設定フォームになり、プラグインは登録 hooks を受け取る代わりに `loader/volatile-update` を購読します。
12
+ 設定の登録はデュアル API フォールバック(0.1.2 以降では `settings.installSection`、旧ホストでは `settings.register`)を使用します。
15
13
 
16
14
  ## そもそもなぜパッチなのか?(ツールルーティングガイド)
17
15
 
@@ -45,7 +43,7 @@ dsh web --dump-config # verify the plugin row appears
45
43
  }
46
44
  ```
47
45
 
48
- ### Codex apply_patch 構文(既定で有効)
46
+ ### Codex apply_patch 構文(オプトイン)
49
47
 
50
48
  ```text
51
49
  *** Begin Patch
@@ -61,7 +59,7 @@ dsh web --dump-config # verify the plugin row appears
61
59
  *** End Patch
62
60
  ```
63
61
 
64
- 両構文とも既定で有効です。既定値は `Config` スキーマが持ち、挿入される `cordis.patch.yml` 行も `allowUnifiedDiff: true` + `allowCodexPatch: true` を運びます。`allowCodexPatch: false` で unified diff 専用に戻せます。明示的に無効化した状態で Codex パッチが届くと、ツールは汎用のパースエラーではなく **実行可能なヒント**(有効化の方法、または unified diff での再試行方法)を返します。Codex 構文は GPT 系モデルにとって強い事前分布であり、無言の失敗はモデルを再試行ループに閉じ込めてしまいます。
62
+ `allowCodexPatch: true` で有効化します。無効時に Codex パッチが届くと、ツールは汎用のパースエラーではなく **実行可能なヒント**(有効化の方法、または unified diff での再試行方法)を返します。Codex 構文は GPT 系モデルにとって強い事前分布であり、無言の失敗はモデルを再試行ループに閉じ込めてしまいます。
65
63
 
66
64
  ### 操作
67
65
 
@@ -88,7 +86,7 @@ dsh web --dump-config # verify the plugin row appears
88
86
  | `conflictPolicy` | `rename` | ツール名が使用済みの場合の `rename` / `skip` / `fail`。 |
89
87
  | `renameSuffix` | `_1` | リネーム回避で使用される接尾辞。 |
90
88
  | `allowUnifiedDiff` | `true` | git/unified diff を受け付けます。 |
91
- | `allowCodexPatch` | `true` | Codex `apply_patch` 構文を受け付けます(`false` で unified diff 専用)。DSH 設定パネルからも変更でき、変更は即座に反映されます(再起動不要)。 |
89
+ | `allowCodexPatch` | `false` | Codex `apply_patch` 構文を受け付けます。DSH 設定パネルからも変更でき、変更は即座に反映されます(再起動不要)。 |
92
90
  | `deleteBackend` | `shell` | `shell` または `none`(削除/移動は構造化エラーを返します)。 |
93
91
  | `shellDialect` | `auto` | `auto`(win32 では pwsh)/ `posix` / `pwsh`。 |
94
92
  | `deleteCommand` / `moveCommand` | 組み込み | カスタムコマンドテンプレート。パスは依然として **env 経由のみ**(`DSH_PATCH_TARGET` / `DSH_PATCH_SOURCE`)で渡され、コマンド文字列に補間されることはありません。 |
@@ -110,8 +108,8 @@ dsh web --dump-config # verify the plugin row appears
110
108
 
111
109
  ```bash
112
110
  npm install
113
- npm run typecheck # against 0.1.7-rc.2 peers (devDependencies)
114
- npm run typecheck:0.1.5 # 実在の 0.1.5-rc.2 ピアに対するレガシー交叉検証
111
+ npm run typecheck # against 0.1.5-rc.3 peers (devDependencies)
112
+ npm run typecheck:0.1.5 # 実在の 0.1.5-rc.2 ピアに対する静的クロス検証
115
113
  npm test # vitest, 90 tests
116
114
  npm run lint
117
115
  npm run build # lib/
package/README.ko.md CHANGED
@@ -1,17 +1,15 @@
1
1
  # dsh-patch-edit-plus
2
2
 
3
- [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness)를 위한 패치 스타일 파일 편집 도구입니다. 모델에 노출되는 단일 `apply_patch` 도구가 **git/unified diff**와 **Codex `apply_patch` 문법**(둘 다 기본 활성화)을 받아들이고, 모든 변경을 **전부 아니면 전무(all-or-nothing)** 방식으로 적용하며, DSH의 동작에는 전혀 간섭하지 않습니다.
3
+ [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness)를 위한 패치 스타일 파일 편집 도구입니다. 모델에 노출되는 단일 `apply_patch` 도구가 **git/unified diff**(기본)와 **Codex `apply_patch` 문법**(옵트인)을 받아들이고, 모든 변경을 **전부 아니면 전무(all-or-nothing)** 방식으로 적용하며, DSH의 동작에는 전혀 간섭하지 않습니다.
4
4
 
5
5
  ## DSH 버전 호환성
6
6
 
7
7
  | DSH 버전 | 상태 | 비고 |
8
8
  |---|---|---|
9
- | `0.1.7-rc.1+` | ✅ 지원됨(본 라인, v0.2.1+) | 선언적 설정: `allowCodexPatch`에 `.volatile()` 마크 — 설정 폼이 자동 생성되고, `loader/volatile-update`가 remount 없이 도구를 그 자리에서 재등록합니다. v0.2.3은 Delete/Move를 수정: shell 덕 타이핑 감지가 `run()`을 보았으나 실 0.1.7 호스트에서는 결코 일치하지 않았고(`run`은 0.1.2→0.1.7 사이에 `execute`로 개명), Delete/Move가 UNSUPPORTED로 조용히 강등되었습니다. 이제 `execute()` + `result()` 사용. v0.2.4: `allowCodexPatch` 기본값이 `true`로 — 두 문법 모두 초기 상태에서 활성화; 설정은 삽입되는 `cordis.patch.yml` 행을 통해 배포. |
10
- | `0.1.2-rc.1` ~ `0.1.4` | ↗ 유지보수 라인 | 게시된 `0.1.2`(main 브랜치)가 담당합니다. |
11
- | `0.1.5-rc.x` | ↗ 유지보수 라인 | `dsh-0.1.5` dist-tag(v0.2.2+)가 담당합니다. |
12
- | `0.2.0-rc.1+` | ↗ 다음 라인 | `dsh-0.2.0` dist-tag(v0.3.0+)가 담당합니다. |
9
+ | `0.1.5-rc.1+` | ✅ 지원됨(본 라인, v0.2.2+) | 타입 베이스라인을 실제 `0.1.5-rc.3` peer에 고정하고, `peerDependencies`/`engines.dsh`는 `>=0.1.5-rc.1 <0.1.6-0`으로 제한합니다. `dsh-0.1.5` dist-tag로 게시됩니다. |
10
+ | `0.1.2-rc.1` ~ `0.1.4` | ↗ 유지보수 라인 | 게시된 `0.1.2`(main 브랜치)가 담당합니다. `0.1.6+`은 별도 계약(shell `run` → `execute`)이며 compat/0.1.7·compat/0.2.0 라인이 지원합니다. |
13
11
 
14
- 본 라인의 설정은 선언적입니다: `Config`에서 `.volatile()`로 마크된 필드가 설정 폼이 되고, 플러그인은 등록 hooks를 받는 대신 `loader/volatile-update`를 구독합니다.
12
+ 설정 등록은 이중 API 폴백을 사용합니다(0.1.2+ 에서는 `settings.installSection`, 이전 호스트에서는 `settings.register`).
15
13
 
16
14
  ## 왜 굳이 패치인가? (도구 라우팅 가이드)
17
15
 
@@ -45,7 +43,7 @@ dsh web --dump-config # verify the plugin row appears
45
43
  }
46
44
  ```
47
45
 
48
- ### Codex apply_patch 문법 (기본 활성화)
46
+ ### Codex apply_patch 문법 (옵트인)
49
47
 
50
48
  ```text
51
49
  *** Begin Patch
@@ -61,7 +59,7 @@ dsh web --dump-config # verify the plugin row appears
61
59
  *** End Patch
62
60
  ```
63
61
 
64
- 두 문법 모두 기본 활성화되어 있습니다. 기본값은 `Config` 스키마가 가지며, 삽입되는 `cordis.patch.yml` 행도 `allowUnifiedDiff: true` + `allowCodexPatch: true`를 운반합니다. `allowCodexPatch: false`로 unified diff 전용으로 되돌릴 수 있습니다. 명시적으로 비활성화된 상태에서 Codex 패치가 들어오면 도구는 일반적인 파싱 오류 대신 **실행 가능한 힌트**(활성화 방법, 또는 unified diff로 재시도하는 방법)를 반환합니다. Codex 문법은 GPT 계열 모델에게 강한 사전 확률(prior)이며, 조용한 실패는 모델을 재시도 루프에 가두기 때문입니다.
62
+ `allowCodexPatch: true`로 활성화합니다. 비활성 상태에서 Codex 패치가 들어오면 도구는 일반적인 파싱 오류 대신 **실행 가능한 힌트**(활성화 방법, 또는 unified diff로 재시도하는 방법)를 반환합니다. Codex 문법은 GPT 계열 모델에게 강한 사전 확률(prior)이며, 조용한 실패는 모델을 재시도 루프에 가두기 때문입니다.
65
63
 
66
64
  ### 연산
67
65
 
@@ -88,7 +86,7 @@ dsh web --dump-config # verify the plugin row appears
88
86
  | `conflictPolicy` | `rename` | 도구 이름이 이미 사용 중일 때의 동작으로, `rename` / `skip` / `fail` 중 하나입니다. |
89
87
  | `renameSuffix` | `_1` | 이름 회피에 사용되는 접미사입니다. |
90
88
  | `allowUnifiedDiff` | `true` | git/unified diff를 허용합니다. |
91
- | `allowCodexPatch` | `true` | Codex `apply_patch` 문법을 허용합니다(`false`로 unified diff 전용). DSH 설정 패널에서도 변경할 수 있으며, 변경은 즉시 적용됩니다(재시작 불필요). |
89
+ | `allowCodexPatch` | `false` | Codex `apply_patch` 문법을 허용합니다. DSH 설정 패널에서도 변경할 수 있으며, 변경은 즉시 적용됩니다(재시작 불필요). |
92
90
  | `deleteBackend` | `shell` | `shell` 또는 `none`(`none`이면 삭제/이동이 구조화된 오류를 반환합니다). |
93
91
  | `shellDialect` | `auto` | `auto`(win32에서는 pwsh) / `posix` / `pwsh` 중 하나입니다. |
94
92
  | `deleteCommand` / `moveCommand` | 내장 | 사용자 지정 명령 템플릿입니다. 경로는 여전히 **환경 변수로만**(`DSH_PATCH_TARGET` / `DSH_PATCH_SOURCE`) 전달되며, 명령 문자열에 끼워 넣어서는 안 됩니다. |
@@ -110,8 +108,8 @@ dsh web --dump-config # verify the plugin row appears
110
108
 
111
109
  ```bash
112
110
  npm install
113
- npm run typecheck # against 0.1.7-rc.2 peers (devDependencies)
114
- npm run typecheck:0.1.5 # 실제 0.1.5-rc.2 peer 대상 레거시 교차 검증
111
+ npm run typecheck # against 0.1.5-rc.3 peers (devDependencies)
112
+ npm run typecheck:0.1.5 # 실제 0.1.5-rc.2 peer 대상 정적 교차 검증
115
113
  npm test # vitest, 90 tests
116
114
  npm run lint
117
115
  npm run build # lib/
package/README.md CHANGED
@@ -1,17 +1,15 @@
1
1
  # dsh-patch-edit-plus
2
2
 
3
- Patch-style file editing for [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness): one model-facing `apply_patch` tool that accepts **git/unified diff** and **Codex `apply_patch` syntax** (both enabled by default), applies every change **all-or-nothing**, and stays completely out of DSH's way.
3
+ Patch-style file editing for [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness): one model-facing `apply_patch` tool that accepts **git/unified diff** (default) and **Codex `apply_patch` syntax** (opt-in), applies every change **all-or-nothing**, and stays completely out of DSH's way.
4
4
 
5
5
  ## DSH version compatibility
6
6
 
7
7
  | DSH version | Status | Notes |
8
8
  |---|---|---|
9
- | `0.1.7-rc.1+` | ✅ supported (this line, v0.2.1+) | Declarative settings: `allowCodexPatch` is marked `.volatile()` — the settings form renders automatically and `loader/volatile-update` re-registers the tool without a remount. v0.2.3 fixes Delete/Move: the shell `run()` duck-detect never matched real 0.1.7 hosts (`run` was renamed `execute` between 0.1.2 and 0.1.7), silently degrading them to UNSUPPORTED; now uses `execute()` + `result()`. v0.2.4: `allowCodexPatch` defaults to `true` — both syntaxes on out of the box; the config ships on the inserted `cordis.patch.yml` row. |
10
- | `0.1.2-rc.1` ~ `0.1.4` | ↗ maintenance line | Served by the published `0.1.2` (main branch). |
11
- | `0.1.5-rc.x` | ↗ maintenance line | Served by the `dsh-0.1.5` dist-tag (v0.2.2+). |
12
- | `0.2.0-rc.1+` | ↗ next line | Served by the `dsh-0.2.0` dist-tag (v0.3.0+). |
9
+ | `0.1.5-rc.1+` | ✅ supported (this line, v0.2.2+) | Type baseline pinned to the real `0.1.5-rc.3` peers; `peerDependencies`/`engines.dsh` capped to `>=0.1.5-rc.1 <0.1.6-0`. Published under the `dsh-0.1.5` dist-tag. |
10
+ | `0.1.2-rc.1` ~ `0.1.4` | ↗ maintenance line | Served by the published `0.1.2` (main branch). `0.1.6+` is a different contract (shell `run` → `execute`) and is served by the compat/0.1.7 and compat/0.2.0 lines. |
13
11
 
14
- Settings are declarative on this line: fields marked `.volatile()` in `Config` become the settings form; the plugin subscribes to `loader/volatile-update` instead of receiving registration hooks.
12
+ Settings registration uses the dual-API fallback (`settings.installSection` on 0.1.2+, `settings.register` on older hosts).
15
13
 
16
14
  ## Why patch at all? (tool routing guide)
17
15
 
@@ -45,7 +43,7 @@ dsh web --dump-config # verify the plugin row appears
45
43
  }
46
44
  ```
47
45
 
48
- ### Codex apply_patch syntax (on by default)
46
+ ### Codex apply_patch syntax (opt-in)
49
47
 
50
48
  ```text
51
49
  *** Begin Patch
@@ -61,7 +59,7 @@ dsh web --dump-config # verify the plugin row appears
61
59
  *** End Patch
62
60
  ```
63
61
 
64
- Both syntaxes ship enabled: the defaults live in the `Config` schema and the inserted `cordis.patch.yml` row carries `allowUnifiedDiff: true` + `allowCodexPatch: true`. Set `allowCodexPatch: false` to go unified-diff-only. When a Codex patch arrives while explicitly disabled, the tool returns an **actionable hint** (how to enable or how to retry in unified diff) instead of a generic parse error — Codex syntax is a strong prior for GPT-family models and a silent failure traps them in retry loops.
62
+ Enable with `allowCodexPatch: true`. When a Codex patch arrives while disabled, the tool returns an **actionable hint** (how to enable or how to retry in unified diff) instead of a generic parse error — Codex syntax is a strong prior for GPT-family models and a silent failure traps them in retry loops.
65
63
 
66
64
  ### Operations
67
65
 
@@ -88,7 +86,7 @@ Both syntaxes ship enabled: the defaults live in the `Config` schema and the ins
88
86
  | `conflictPolicy` | `rename` | `rename` / `skip` / `fail` when the tool name is taken. |
89
87
  | `renameSuffix` | `_1` | Suffix used by rename avoidance. |
90
88
  | `allowUnifiedDiff` | `true` | Accept git/unified diffs. |
91
- | `allowCodexPatch` | `true` | Accept Codex `apply_patch` syntax (set `false` for unified-diff-only). Also editable in the DSH settings panel; changes take effect immediately, no restart needed. |
89
+ | `allowCodexPatch` | `false` | Accept Codex `apply_patch` syntax. Also editable in the DSH settings panel; changes take effect immediately, no restart needed. |
92
90
  | `deleteBackend` | `shell` | `shell` or `none` (Delete/Move return a structured error). |
93
91
  | `shellDialect` | `auto` | `auto` (pwsh on win32) / `posix` / `pwsh`. |
94
92
  | `deleteCommand` / `moveCommand` | built-in | Custom command templates. Paths still arrive **only via env** (`DSH_PATCH_TARGET` / `DSH_PATCH_SOURCE`); never interpolate them into the command string. |
@@ -110,8 +108,8 @@ Both syntaxes ship enabled: the defaults live in the `Config` schema and the ins
110
108
 
111
109
  ```bash
112
110
  npm install
113
- npm run typecheck # against 0.1.7-rc.2 peers (devDependencies)
114
- npm run typecheck:0.1.5 # legacy cross-proof against real 0.1.5-rc.2 peers
111
+ npm run typecheck # against 0.1.5-rc.3 peers (devDependencies)
112
+ npm run typecheck:0.1.5 # static cross-proof against real 0.1.5-rc.2 peers
115
113
  npm test # vitest, 90 tests
116
114
  npm run lint
117
115
  npm run build # lib/
package/README.zh.md CHANGED
@@ -1,17 +1,15 @@
1
1
  # dsh-patch-edit-plus
2
2
 
3
- 面向 [DeepSeek Harness(DSH)](https://github.com/deepseek-ai/deepseek-harness) 的补丁风格文件编辑插件:只提供 **1 个**模型可见工具 `apply_patch`,接受 **git/unified diff** 与 **Codex `apply_patch` 语法**(两种语法均默认开启),全量验证后**原子应用**,对 DSH 既有功能零负面影响。
3
+ 面向 [DeepSeek Harness(DSH)](https://github.com/deepseek-ai/deepseek-harness) 的补丁风格文件编辑插件:只提供 **1 个**模型可见工具 `apply_patch`,接受 **git/unified diff**(默认开启)与 **Codex `apply_patch` 语法**(可选开启),全量验证后**原子应用**,对 DSH 既有功能零负面影响。
4
4
 
5
5
  ## DSH 版本适配矩阵
6
6
 
7
7
  | DSH 版本 | 状态 | 说明 |
8
8
  |---|---|---|
9
- | `0.1.7-rc.1+` | ✅ 支持(本线,v0.2.1+) | 声明式设置:`allowCodexPatch` 标记 `.volatile()`——设置表单自动生成,`loader/volatile-update` 驱动工具原位重注册(不 remount)。v0.2.3 修复 Delete/Move:shell 鸭子探测查 `run()` 在真实 0.1.7 宿主永不命中(`run` 在 0.1.2→0.1.7 间改名为 `execute`),Delete/Move 被静默降级为 UNSUPPORTED;现改用 `execute()` + `result()`。v0.2.4:`allowCodexPatch` 默认改为 `true`——两种语法开箱即用;配置随插入的 `cordis.patch.yml` 行下发。 |
10
- | `0.1.2-rc.1` ~ `0.1.4` | ↗ 维护线 | 由已发布的 `0.1.2`(main 分支)服务。 |
11
- | `0.1.5-rc.x` | ↗ 维护线 | 由 `dsh-0.1.5` dist-tag(v0.2.2+)服务。 |
12
- | `0.2.0-rc.1+` | ↗ 下一线 | 由 `dsh-0.2.0` dist-tag(v0.3.0+)服务。 |
9
+ | `0.1.5-rc.1+` | ✅ 支持(本线,v0.2.2+) | 类型基线钉在真实 `0.1.5-rc.3` peer 包;`peerDependencies`/`engines.dsh` 封顶到 `>=0.1.5-rc.1 <0.1.6-0`。经 `dsh-0.1.5` dist-tag 发布。 |
10
+ | `0.1.2-rc.1` ~ `0.1.4` | ↗ 维护线 | 由已发布的 `0.1.2`(main 分支)服务。`0.1.6+` 是另一套契约(shell `run` → `execute`),由 compat/0.1.7 与 compat/0.2.0 线服务。 |
13
11
 
14
- 本线的 settings 是声明式的:`Config` 中标记 `.volatile()` 的字段即设置表单;插件订阅 `loader/volatile-update`,不再接收注册 hooks。
12
+ settings 注册走双 API 回退:0.1.2+ 的 `settings.installSection` 优先,旧版回退 `settings.register`。
15
13
 
16
14
  ## 工具路由指引(为什么该用谁)
17
15
 
@@ -45,7 +43,7 @@ dsh web --dump-config # 确认插件行出现
45
43
  }
46
44
  ```
47
45
 
48
- ### Codex apply_patch 语法(默认开启)
46
+ ### Codex apply_patch 语法(需开启)
49
47
 
50
48
  ```text
51
49
  *** Begin Patch
@@ -60,7 +58,7 @@ dsh web --dump-config # 确认插件行出现
60
58
  *** End Patch
61
59
  ```
62
60
 
63
- 两种语法默认全部开启:默认值由 `Config` schema 给出,插入的 `cordis.patch.yml` 行同样携带 `allowUnifiedDiff: true` + `allowCodexPatch: true`。设 `allowCodexPatch: false` 可退回仅 unified diff。显式关闭后收到 Codex 补丁时,工具返回**可操作提示**(如何开启、或改用 unified diff),而不是泛化的解析错误 —— Codex 语法是 GPT 系模型的强先验,沉默失败会让模型陷入重试循环。
61
+ 在配置中设 `allowCodexPatch: true` 开启。关闭状态下收到 Codex 补丁时,工具返回**可操作提示**(如何开启、或改用 unified diff),而不是泛化的解析错误 —— Codex 语法是 GPT 系模型的强先验,沉默失败会让模型陷入重试循环。
64
62
 
65
63
  ### 四类操作
66
64
 
@@ -87,7 +85,7 @@ dsh web --dump-config # 确认插件行出现
87
85
  | `conflictPolicy` | `rename` | 重名时 `rename` / `skip` / `fail`。 |
88
86
  | `renameSuffix` | `_1` | 改名避让使用的后缀。 |
89
87
  | `allowUnifiedDiff` | `true` | 接受 git/unified diff。 |
90
- | `allowCodexPatch` | `true` | 接受 Codex `apply_patch` 语法(设 `false` 退回仅 unified diff)。也可在 DSH 设置面板中修改,改动立即生效、无需重启。 |
88
+ | `allowCodexPatch` | `false` | 接受 Codex `apply_patch` 语法。也可在 DSH 设置面板中修改,改动立即生效、无需重启。 |
91
89
  | `deleteBackend` | `shell` | `shell` 或 `none`(Delete/Move 返回结构化错误)。 |
92
90
  | `shellDialect` | `auto` | `auto`(win32 上 pwsh)/ `posix` / `pwsh`。 |
93
91
  | `deleteCommand` / `moveCommand` | 内置 | 自定义命令模板。路径仍然**只经 env** 传入(`DSH_PATCH_TARGET` / `DSH_PATCH_SOURCE`),请勿把路径插值进命令串。 |
@@ -109,8 +107,8 @@ dsh web --dump-config # 确认插件行出现
109
107
 
110
108
  ```bash
111
109
  npm install
112
- npm run typecheck # 针对 0.1.7-rc.2 peer 包(devDependencies)
113
- npm run typecheck:0.1.5 # 对真实 0.1.5-rc.2 peer 包的遗留交叉核验
110
+ npm run typecheck # 针对 0.1.5-rc.3 peer 包(devDependencies)
111
+ npm run typecheck:0.1.5 # 对真实 0.1.5-rc.2 peer 包做交叉静态核验
114
112
  npm test # vitest,90 个用例
115
113
  npm run lint
116
114
  npm run build # lib/
package/cordis.patch.yml CHANGED
@@ -1,14 +1,6 @@
1
1
  # Assembly layer for the dsh profiles whose bundles list includes this package.
2
2
  # A pure addition: one insert row with an id no shipped entry uses. No shipped
3
3
  # row is disabled, renamed, or reconfigured here.
4
- #
5
- # Config rides the inserted row: both patch syntaxes ship enabled. The DSH
6
- # settings panel still projects the volatile `allowCodexPatch` from this row,
7
- # so a user toggle keeps working without touching this file. Every knob left
8
- # out of the row resolves to its schema default computed in lib/index.js.
9
4
  - insert:
10
5
  - id: dsh-patch-edit-plus
11
6
  name: dsh-patch-edit-plus
12
- config:
13
- allowUnifiedDiff: true
14
- allowCodexPatch: true
package/dsh.plugin.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "id": "dsh-patch-edit-plus",
3
3
  "name": "dsh-patch-edit-plus",
4
- "version": "0.2.4",
4
+ "version": "0.2.6",
5
5
  "description": {
6
- "en": "Patch-style file editing: one apply_patch tool for git/unified diff and Codex apply_patch syntax (both enabled by default), with all-or-nothing application and sandbox-aware delete/move.",
7
- "zh": "补丁风格文件编辑:单个 apply_patch 工具,接受 git/unified diff 与 Codex apply_patch 语法(两种语法均默认开启),全量验证后原子应用,删除/移动走沙箱感知 shell。"
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
+ "zh": "补丁风格文件编辑:单个 apply_patch 工具,接受 git/unified diff(默认)与 Codex apply_patch 语法(可选开启),全量验证后原子应用,删除/移动走沙箱感知 shell。"
8
8
  },
9
9
  "homepage": "https://github.com/drscrewdriver/dsh-patch-edit-plus",
10
10
  "repository": {
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "license": "MIT",
15
15
  "engines": {
16
- "dsh": ">=0.1.7-rc.1 <0.1.8-0"
16
+ "dsh": ">=0.1.5-rc.1 <0.1.6-0"
17
17
  },
18
18
  "components": {
19
19
  "host": "lib/index.js"
package/lib/config.js CHANGED
@@ -12,7 +12,7 @@ export const Config = z.object({
12
12
  conflictPolicy: z.union(['rename', 'skip', 'fail']).default('rename'),
13
13
  renameSuffix: z.string().default('_1'),
14
14
  allowUnifiedDiff: z.boolean().default(true),
15
- allowCodexPatch: z.boolean().default(true).volatile(),
15
+ allowCodexPatch: z.boolean().default(false),
16
16
  deleteBackend: z.union(['shell', 'none']).default('shell'),
17
17
  shellDialect: z.union(['auto', 'posix', 'pwsh']).default('auto'),
18
18
  deleteCommand: z.string(),
@@ -23,14 +23,6 @@ export const Config = z.object({
23
23
  maxPatchBytes: z.number().step(1).min(1024).default(512 * 1024),
24
24
  maxDiffBytes: z.number().step(1).min(256).default(16 * 1024),
25
25
  });
26
- /** Read a `.volatile()` field: a live ref on 0.1.7+, a plain boolean otherwise. */
27
- export function readVolatileBoolean(value, fallback) {
28
- if (typeof value === 'boolean')
29
- return value;
30
- if (value && typeof value.get === 'function')
31
- return Boolean(value.get());
32
- return fallback;
33
- }
34
26
  /** Fill user config with defaults; `undefined`/null entries fall back too. */
35
27
  export function resolveConfig(config) {
36
28
  const c = config ?? {};
@@ -39,7 +31,7 @@ export function resolveConfig(config) {
39
31
  conflictPolicy: c.conflictPolicy ?? 'rename',
40
32
  renameSuffix: typeof c.renameSuffix === 'string' ? c.renameSuffix : '_1',
41
33
  allowUnifiedDiff: c.allowUnifiedDiff ?? true,
42
- allowCodexPatch: readVolatileBoolean(c.allowCodexPatch, true),
34
+ allowCodexPatch: c.allowCodexPatch ?? false,
43
35
  deleteBackend: c.deleteBackend ?? 'shell',
44
36
  shellDialect: c.shellDialect ?? 'auto',
45
37
  deleteCommand: typeof c.deleteCommand === 'string' && c.deleteCommand !== '' ? c.deleteCommand : undefined,
package/lib/index.js CHANGED
@@ -1,19 +1,17 @@
1
1
  /**
2
2
  * dsh-patch-edit-plus — patch-style file editing for DeepSeek Harness.
3
3
  *
4
- * One `apply_patch` tool accepting git/unified diff and Codex `apply_patch`
5
- * syntax (both on by default; the patch-layer row in `cordis.patch.yml` ships
6
- * the same defaults). All-or-nothing application through the
4
+ * One `apply_patch` tool accepting git/unified diff (default) and Codex
5
+ * `apply_patch` syntax (opt-in). All-or-nothing application through the
7
6
  * official fs write-intent dance; delete/move through the sandbox-aware
8
- * shell. Targets DSH 0.1.7+: settings are declarative — the fields marked
9
- * `.volatile()` in `Config` render the settings form automatically (no
10
- * registration call), and `loader/volatile-update` drives re-registration
11
- * without a plugin remount. This line drops the pre-0.1.7 hosts; the
12
- * 0.1.2-rc.1 ~ 0.1.5-rc.2 line stays on its maintenance branch.
7
+ * shell. Compatible with DSH 0.1.2-rc.1 through 0.1.5-rc.2: the tool
8
+ * authoring contract is byte-identical across those versions, so a single
9
+ * code path serves both; only settings registration needs the dual-API
10
+ * fallback (`installSection` first, `register` second).
13
11
  *
14
12
  * @module dsh-patch-edit-plus
15
13
  */
16
- import { resolveConfig } from './config.js';
14
+ import { Config, resolveConfig } from './config.js';
17
15
  import { registerApplyPatchTool } from './register.js';
18
16
  /** Cordis plugin name used by Loader diagnostics. */
19
17
  export const name = 'dsh-patch-edit-plus';
@@ -33,21 +31,26 @@ export const name = 'dsh-patch-edit-plus';
33
31
  * in every profile that has no shell capability.
34
32
  */
35
33
  export const inject = ['tools', 'fs'];
36
- export { Config } from './config.js';
37
34
  /**
38
- * Register the tool from the current config snapshot.
39
- *
40
- * 登记级 key。工具「描述」把可用语法固化进去了(tool.ts 拼 `Accepts ${styles}`),
41
- * 所以判定必须覆盖整份 resolved config,而不是只看 allowCodexPatch。
35
+ * Settings namespace. Must match dsh-settings `NAMESPACE_PATTERN`
36
+ * (`/^[a-z][a-z0-9-]*$/`) on every target version: letters, digits and
37
+ * hyphens only — an underscore made `register()` throw before anything
38
+ * persisted, so no migration is needed.
42
39
  */
40
+ export const SETTINGS_NAMESPACE = 'patch-edit-plus';
41
+ export { Config };
42
+ /** Register the tool and the settings namespace. Every registration is scoped to this plugin. */
43
43
  export function apply(ctx, config) {
44
- // 组合条目(0.1.7 起 volatile 字段在其中是 live 引用):rejudge 每次整体
45
- // 重解析一次,一次调用内是同一份快照;跨调用的最新值由事件驱动重取。
46
44
  const compositionEntry = config ?? {};
45
+ // 权威来源:设置层挂载时是解析后的 scope,否则是组合条目。
46
+ // installSection 保证在每次匹配的 onChange 之前先调用 setSource(attach 与 detach 各一次)。
47
+ let readSource = () => compositionEntry;
47
48
  let disposer = null;
49
+ // 登记级 key。工具「描述」把可用语法固化进去了(tool.ts 拼 `Accepts ${styles}`),
50
+ // 所以判定必须覆盖整份 resolved config,而不是只看 allowCodexPatch。
48
51
  let registeredKey = null;
49
52
  const rejudge = () => {
50
- const next = resolveConfig(compositionEntry);
53
+ const next = resolveConfig(readSource());
51
54
  const key = JSON.stringify(next);
52
55
  if (key === registeredKey)
53
56
  return;
@@ -63,9 +66,23 @@ export function apply(ctx, config) {
63
66
  registeredKey = null;
64
67
  };
65
68
  });
66
- // 0.1.7+: 只有 volatile 字段变更才走这里(不 remount);普通字段变更会整体
67
- // remount 插件,新一次 `apply` 自然读到全部新值。等值变更宿主不通知。
68
- ctx.on('loader/volatile-update', () => {
69
- rejudge();
69
+ ctx.inject(['settings'], (settingsCtx) => {
70
+ const settings = settingsCtx.settings
71
+ ?? settingsCtx;
72
+ if (typeof settings?.installSection === 'function') {
73
+ settings.installSection(ctx, SETTINGS_NAMESPACE, Config, compositionEntry, {
74
+ setSource: (current) => { readSource = current; },
75
+ onChange: () => { rejudge(); },
76
+ });
77
+ return;
78
+ }
79
+ if (typeof settings?.register === 'function') {
80
+ const scope = settings.register(SETTINGS_NAMESPACE, Config, { base: compositionEntry });
81
+ if (scope !== undefined) {
82
+ readSource = () => scope.get();
83
+ scope.watch(() => { rejudge(); });
84
+ rejudge();
85
+ }
86
+ }
70
87
  });
71
88
  }
@@ -55,8 +55,12 @@ export function parseUnifiedDiff(patch) {
55
55
  continue;
56
56
  }
57
57
  if (line.startsWith('--- ')) {
58
- if (current === null) {
59
- // Bare unified diff without a git header: open an implicit section.
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/lib/shellops.js CHANGED
@@ -36,7 +36,7 @@ export function moveTemplate(cfg) {
36
36
  export function resolveShell(ctx) {
37
37
  try {
38
38
  const shell = ctx.shell;
39
- return shell !== undefined && typeof shell.execute === 'function' && typeof shell.resolve === 'function' ? shell : undefined;
39
+ return shell !== undefined && typeof shell.run === 'function' && typeof shell.resolve === 'function' ? shell : undefined;
40
40
  }
41
41
  catch {
42
42
  return undefined;
@@ -87,8 +87,7 @@ function requireShell(ctx, cfg) {
87
87
  }
88
88
  async function runShell(shell, request) {
89
89
  try {
90
- const execution = await shell.execute(shell.resolve(request));
91
- return await execution.result();
90
+ return await shell.run(shell.resolve(request));
92
91
  }
93
92
  catch (error) {
94
93
  const detail = error instanceof Error ? error.message : String(error);
@@ -6,7 +6,6 @@
6
6
  * @module dsh-patch-edit-plus/config
7
7
  */
8
8
  import z from '@deepseek-ai/schemastery';
9
- import type { Volatile } from '@deepseek-ai/cosmokit';
10
9
  /** What to do when the configured tool name is already taken at registration. */
11
10
  export type ConflictPolicy = 'rename' | 'skip' | 'fail';
12
11
  /** Backend used for Delete/Move operations (`ctx.fs` has no delete/move). */
@@ -23,12 +22,8 @@ export interface Config {
23
22
  renameSuffix?: string;
24
23
  /** Accept git/unified diff patches. Defaults to true. */
25
24
  allowUnifiedDiff?: boolean;
26
- /** Accept Codex `apply_patch` syntax. Defaults to true (both syntaxes on;
27
- * the patch-layer row in `cordis.patch.yml` carries the same default). Set
28
- * false to restore unified-diff-only.
29
- * 0.1.7 `.volatile()`: the loader hands `apply` a live `Volatile` ref for this
30
- * field — always read it through `readVolatileBoolean`, never cache the ref. */
31
- allowCodexPatch?: boolean | Volatile<boolean>;
25
+ /** Accept Codex `apply_patch` syntax. Defaults to false. */
26
+ allowCodexPatch?: boolean;
32
27
  /** Delete/Move backend. Defaults to `shell`. `none` rejects Delete/Move with a structured error. */
33
28
  deleteBackend?: DeleteBackend;
34
29
  /** Shell dialect for the constant delete/move templates. Defaults to `auto` (pwsh on win32). */
@@ -49,37 +44,7 @@ export interface Config {
49
44
  maxDiffBytes?: number;
50
45
  }
51
46
  /** Schemastery schema for Loader defaults and generated configuration docs. */
52
- export declare const Config: z<Schemastery.ObjectS<NoInfer<{
53
- toolName: z<string, string, "defined">;
54
- conflictPolicy: z<"rename" | "skip" | "fail", "rename" | "skip" | "fail", "defined">;
55
- renameSuffix: z<string, string, "defined">;
56
- allowUnifiedDiff: z<boolean, boolean, "defined">;
57
- allowCodexPatch: z<boolean, boolean, "volatile-defined">;
58
- deleteBackend: z<"shell" | "none", "shell" | "none", "defined">;
59
- shellDialect: z<"auto" | "posix" | "pwsh", "auto" | "posix" | "pwsh", "defined">;
60
- deleteCommand: z<string, string, "plain">;
61
- moveCommand: z<string, string, "plain">;
62
- dryRunByDefault: z<boolean, boolean, "defined">;
63
- followSymlinks: z<boolean, boolean, "defined">;
64
- maxFiles: z<number, number, "defined">;
65
- maxPatchBytes: z<number, number, "defined">;
66
- maxDiffBytes: z<number, number, "defined">;
67
- }>>, Schemastery.ObjectT<NoInfer<{
68
- toolName: z<string, string, "defined">;
69
- conflictPolicy: z<"rename" | "skip" | "fail", "rename" | "skip" | "fail", "defined">;
70
- renameSuffix: z<string, string, "defined">;
71
- allowUnifiedDiff: z<boolean, boolean, "defined">;
72
- allowCodexPatch: z<boolean, boolean, "volatile-defined">;
73
- deleteBackend: z<"shell" | "none", "shell" | "none", "defined">;
74
- shellDialect: z<"auto" | "posix" | "pwsh", "auto" | "posix" | "pwsh", "defined">;
75
- deleteCommand: z<string, string, "plain">;
76
- moveCommand: z<string, string, "plain">;
77
- dryRunByDefault: z<boolean, boolean, "defined">;
78
- followSymlinks: z<boolean, boolean, "defined">;
79
- maxFiles: z<number, number, "defined">;
80
- maxPatchBytes: z<number, number, "defined">;
81
- maxDiffBytes: z<number, number, "defined">;
82
- }>>, "plain">;
47
+ export declare const Config: z<Config>;
83
48
  /** Fully-resolved configuration used by the tool body. */
84
49
  export interface ResolvedConfig {
85
50
  toolName: string;
@@ -97,7 +62,5 @@ export interface ResolvedConfig {
97
62
  maxPatchBytes: number;
98
63
  maxDiffBytes: number;
99
64
  }
100
- /** Read a `.volatile()` field: a live ref on 0.1.7+, a plain boolean otherwise. */
101
- export declare function readVolatileBoolean(value: boolean | Volatile<boolean> | undefined, fallback: boolean): boolean;
102
65
  /** Fill user config with defaults; `undefined`/null entries fall back too. */
103
66
  export declare function resolveConfig(config: Config | undefined): ResolvedConfig;
@@ -1,25 +1,19 @@
1
1
  /**
2
2
  * dsh-patch-edit-plus — patch-style file editing for DeepSeek Harness.
3
3
  *
4
- * One `apply_patch` tool accepting git/unified diff and Codex `apply_patch`
5
- * syntax (both on by default; the patch-layer row in `cordis.patch.yml` ships
6
- * the same defaults). All-or-nothing application through the
4
+ * One `apply_patch` tool accepting git/unified diff (default) and Codex
5
+ * `apply_patch` syntax (opt-in). All-or-nothing application through the
7
6
  * official fs write-intent dance; delete/move through the sandbox-aware
8
- * shell. Targets DSH 0.1.7+: settings are declarative — the fields marked
9
- * `.volatile()` in `Config` render the settings form automatically (no
10
- * registration call), and `loader/volatile-update` drives re-registration
11
- * without a plugin remount. This line drops the pre-0.1.7 hosts; the
12
- * 0.1.2-rc.1 ~ 0.1.5-rc.2 line stays on its maintenance branch.
7
+ * shell. Compatible with DSH 0.1.2-rc.1 through 0.1.5-rc.2: the tool
8
+ * authoring contract is byte-identical across those versions, so a single
9
+ * code path serves both; only settings registration needs the dual-API
10
+ * fallback (`installSection` first, `register` second).
13
11
  *
14
12
  * @module dsh-patch-edit-plus
15
13
  */
16
14
  import type { Context } from '@deepseek-ai/cordis';
15
+ import { Config } from './config.js';
17
16
  import type { Config as PluginConfig } from './config.js';
18
- declare module '@deepseek-ai/cordis' {
19
- interface Events {
20
- 'loader/volatile-update': (paths: string[]) => void;
21
- }
22
- }
23
17
  /** Cordis plugin name used by Loader diagnostics. */
24
18
  export declare const name = "dsh-patch-edit-plus";
25
19
  /**
@@ -38,11 +32,13 @@ export declare const name = "dsh-patch-edit-plus";
38
32
  * in every profile that has no shell capability.
39
33
  */
40
34
  export declare const inject: string[];
41
- export { Config } from './config.js';
42
35
  /**
43
- * Register the tool from the current config snapshot.
44
- *
45
- * 登记级 key。工具「描述」把可用语法固化进去了(tool.ts 拼 `Accepts ${styles}`),
46
- * 所以判定必须覆盖整份 resolved config,而不是只看 allowCodexPatch。
36
+ * Settings namespace. Must match dsh-settings `NAMESPACE_PATTERN`
37
+ * (`/^[a-z][a-z0-9-]*$/`) on every target version: letters, digits and
38
+ * hyphens only — an underscore made `register()` throw before anything
39
+ * persisted, so no migration is needed.
47
40
  */
41
+ export declare const SETTINGS_NAMESPACE = "patch-edit-plus";
42
+ export { Config };
43
+ /** Register the tool and the settings namespace. Every registration is scoped to this plugin. */
48
44
  export declare function apply(ctx: Context, config?: PluginConfig): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-patch-edit-plus",
3
- "version": "0.2.4",
4
- "description": "Patch-style file editing for DeepSeek Harness: one apply_patch tool accepting git/unified diff and Codex apply_patch syntax (both enabled by default), with all-or-nothing application, read-before-write intent dance, sandbox-aware delete/move, with a DSH 0.1.7+ line (declarative volatile settings).",
3
+ "version": "0.2.6",
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.5-rc line compatibility (dsh-0.1.5 dist-tag).",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "engines": {
49
49
  "node": ">=20",
50
- "dsh": ">=0.1.7-rc.1 <0.1.8-0"
50
+ "dsh": ">=0.1.5-rc.1 <0.1.6-0"
51
51
  },
52
52
  "license": "MIT",
53
53
  "keywords": [
@@ -62,10 +62,10 @@
62
62
  ],
63
63
  "peerDependencies": {
64
64
  "@deepseek-ai/cordis": "^4.0.1",
65
- "@deepseek-ai/dsh-fs": ">=0.1.7-rc.1 <0.1.8-0",
66
- "@deepseek-ai/dsh-sandbox": ">=0.1.7-rc.1 <0.1.8-0",
67
- "@deepseek-ai/dsh-shell": ">=0.1.7-rc.1 <0.1.8-0",
68
- "@deepseek-ai/dsh-tools": ">=0.1.7-rc.1 <0.1.8-0"
65
+ "@deepseek-ai/dsh-fs": ">=0.1.5-rc.1 <0.1.6-0",
66
+ "@deepseek-ai/dsh-sandbox": ">=0.1.5-rc.1 <0.1.6-0",
67
+ "@deepseek-ai/dsh-shell": ">=0.1.5-rc.1 <0.1.6-0",
68
+ "@deepseek-ai/dsh-tools": ">=0.1.5-rc.1 <0.1.6-0"
69
69
  },
70
70
  "peerDependenciesMeta": {
71
71
  "@deepseek-ai/cordis": {
@@ -85,23 +85,19 @@
85
85
  }
86
86
  },
87
87
  "dependencies": {
88
- "@deepseek-ai/schemastery": "^3.18.4"
88
+ "@deepseek-ai/schemastery": "^3.18.2"
89
89
  },
90
90
  "devDependencies": {
91
91
  "@deepseek-ai/cordis": "^4.0.2",
92
- "@deepseek-ai/dsh-fs": "0.1.7-rc.2",
93
- "@deepseek-ai/dsh-sandbox": "0.1.7-rc.2",
94
- "@deepseek-ai/dsh-shell": "0.1.7-rc.2",
95
- "@deepseek-ai/dsh-tools": "0.1.7-rc.2",
92
+ "@deepseek-ai/dsh-fs": "0.1.5-rc.3",
93
+ "@deepseek-ai/dsh-sandbox": "0.1.5-rc.3",
94
+ "@deepseek-ai/dsh-shell": "0.1.5-rc.3",
95
+ "@deepseek-ai/dsh-tools": "0.1.5-rc.3",
96
96
  "@eslint/js": "^9.0.0",
97
97
  "@types/node": "^22.0.0",
98
98
  "eslint": "^9.0.0",
99
99
  "typescript": "^5.6.0",
100
100
  "typescript-eslint": "^8.0.0",
101
- "vitest": "^3.0.0",
102
- "@deepseek-ai/schemastery": "^3.18.4"
103
- },
104
- "publishConfig": {
105
- "tag": "dsh-0.1.7"
101
+ "vitest": "^3.0.0"
106
102
  }
107
103
  }