dsh-patch-edit-plus
キュレーションリスト掲載メンテナンス: 活発drscrewdriver/dsh-patch-edit-plus
DeepSeek Harness向けのパッチ形式ファイル編集ツール。GitのUnified Diffを標準に、Codexのapply_patch構文にも対応し、変更を全体適用または全体失敗として扱います。
$ dsh plugin add dsh-patch-edit-plus4
スター
4
フォーク
TypeScript
言語
MIT
ライセンス
2026-09-13
作成日
2026-11-20
最終プッシュ
README
dsh-patch-edit-plus
English | 简体中文 | 日本語 | 한국어 | Français | Deutsch | Italiano | Русский | Español
Patch-style file editing for DeepSeek Harness (DSH): 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.
DSH version compatibility
| DSH version | Status | Notes |
|---|---|---|
0.2.0-rc.1+ |
✅ supported (this line, v0.3.0+) | Declarative settings: allowCodexPatch is marked .volatile() — the settings form renders automatically and loader/volatile-update re-registers the tool without a remount. No registration call. Delete/Move migrated to the ShellExecutor.execute() + result() foreground API. |
0.1.7-rc.1+ |
↗ maintenance line | Served by the compat/0.1.7 branch / dsh-0.1.7 dist-tag (v0.2.1 there). 0.2.0's shell executor renamed run → execute (introduced between 0.1.2 and 0.1.7), so one codebase cannot serve both lines type-safely. |
0.1.2-rc.1 ~ 0.1.5-rc.2 |
↗ maintenance line | Served by the pre-0.1.7 branch / dsh-0.1.5 dist-tag. 0.1.7 removed the imperative settings APIs the dual-API fallback relied on. |
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.
Why patch at all? (tool routing guide)
The tool description explicitly routes the model:
- Single small change in one already-read file → prefer the native
edittool (a patch costs more tokens than a literal edit). - Small change inside a LARGE file →
apply_patch(no need to echo the whole file). - Batched changes across MANY files →
apply_patch(one call, verified atomically). - New file with substantial content / delete / rename →
apply_patch.
Installation
dsh plugin --profile web add <path-to-dsh-patch-edit-plus>
dsh web --dump-config # verify the plugin row appears
# restart DSH
Usage
Unified diff (default, enabled)
--- a/src/app.ts
+++ b/src/app.ts
@@ -10,4 +10,4 @@ export function main() {
init()
- start(oldPort)
+ start(newPort)
await shutdown()
}
Codex apply_patch syntax (opt-in)
*** Begin Patch
*** Update File: src/app.ts
@@
init()
- start(oldPort)
+ start(newPort)
*** Add File: docs/notes.md
+# Notes
*** Delete File: tmp/junk.txt
*** Move to: src/app.ts (via `*** Move to:` after *** Update File:)
*** End Patch
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.
Operations
| Operation | Unified diff | Codex | Execution path |
|---|---|---|---|
| Add | new file mode + /dev/null |
*** Add File: |
ctx.fs.writeText (official intent dance) |
| Update (multi-hunk) | @@ hunks |
@@ hunks |
ctx.fs.writeText |
| Delete | deleted file mode + /dev/null |
*** Delete File: |
ctx.shell (sandbox-aware, env-passed path) |
| Move / rename | rename from/to |
*** Move to: |
ctx.shell |
Guarantees
- All-or-nothing: the whole patch is verified against current file content first (context location, workspace containment, symlink policy, duplicate paths); any failure aborts with zero bytes written.
- Read-before-write gate respected: every write replicates the official
writetool's intent dance —fs/write-intentwaterfall → guardedwriteText→fs/observedemit. A barewriteTextwould silently bypass the gate because DSH providers never dispatchfs/*events themselves. - Precise failure diagnostics: on hunk mismatch the error carries file + hunk index, search origin line, expected-line preview (whitespace made visible), the file's actual excerpt, and a targeted hint.
- Newline fidelity: CRLF files are written back as CRLF; no-trailing-newline tails are preserved unless the patch changes the tail.
- Pure addition: the plugin registers exactly one tool, never calls
tools.restrict(), never overrides a native tool, registers no global services, and removes everything on unload. Name conflicts with otherapply_patchproviders (bainianlaoyao/dsh-codex-mode,shuind/dsh-codex-harness, …) are resolved by rename avoidance (apply_patch_1,…_2, …) so DSH never fails to start.
Configuration
プラグイン開発ツール の他のプラグイン
dsh-context
by bowenliang123
モデルのコンテキストウィンドウ構成と推移を可視化する Context ダッシュボード/コマンド
deepseek-harness-control-center
by feibi-mochi
DSH Web コントロールセンター:アカウント監視、用量、完了アラート、公式チャージ、柔軟レイアウト、agent 支援セッション制御
dsh-context-doctor
by zhenyu98
DSH コンテキスト注入監査:AGENTS.md/スキル/ツール schema/MCP の token コストと重複・shadow 衝突検出
dsh-balance-plugin
by yxxbc
DeepSeek の残高監視と利用量統計をする DSH 動的 Cordis プラグイン。残高監視・公式チャージ入口・利用量統計・サードパーティプラグイン管理を一本化します。
