DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

Patch Edit Plus — DeepSeek Harness 插件(DSH Plugin)
← Plugins

dsh-patch-edit-plus

Patch Edit Plus

适用于 DeepSeek Harness 的补丁式文件编辑:一个 apply_patch 工具,默认接受 git/统一 diff,并可选择接受 Codex apply_patch 语法;支持全有或全无式应用、写入前读取意图确认、支持沙盒环境的删除/移动,以及与 0.1.2-rc.1 ~ 0.1.5-rc.2 的兼容性。

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add dsh-patch-edit-plus@0.1.2
README兼容性版本

兼容性与来源证明

Patch Edit Plus 以 dsh-patch-edit-plus 发布,当前版本为 0.1.2。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
any
发布来源
npm
Registry 更新时间
2026/9/19

版本

0.1.2stable
2026/9/19
0.1.1stable
2026/9/16
0.1.0stable
2026/9/15

相关插件

正在加载相关插件…

最新版
0.1.2
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
140.4 kB
文件数
42
Surface
any
许可证
MIT
发布源
npm
GitHub
★ 0
周下载
0
最近提交
2026/9/19
查看源码 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题
DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录

README

dsh-patch-edit-plus

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 versionStatusNotes
0.1.2-rc.1✅ supportedTool authoring contract (defineTool DSL, presentation intents) is byte-identical across 0.1.2–0.1.5; one code path serves both.
0.1.3-alpha.x✅ supportedSame as above.
0.1.5-rc.2✅ statically verifiednpm run typecheck:0.1.5 typechecks src/ against the real 0.1.5-rc.2 peer packages. No readByteRange usage, no 0.1.5-only PTC identifiers.

Settings registration uses the dual-API fallback (settings.installSection on 0.1.2+, settings.register on older hosts).

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 edit tool (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

OperationUnified diffCodexExecution path
Addnew file mode + /dev/null*** Add File:ctx.fs.writeText (official intent dance)
Update (multi-hunk)@@ hunks@@ hunksctx.fs.writeText
Deletedeleted file mode + /dev/null*** Delete File:ctx.shell (sandbox-aware, env-passed path)
Move / renamerename 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 write tool's intent dance — fs/write-intent waterfall → guarded writeText → fs/observed emit. A bare writeText would silently bypass the gate because DSH providers never dispatch fs/* 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 other apply_patch providers (bainianlaoyao/dsh-codex-mode, shuind/dsh-codex-harness, …) are resolved by rename avoidance (apply_patch_1, …_2, …) so DSH never fails to start.

Configuration

OptionDefaultDescription
toolNameapply_patchModel-facing tool name.
conflictPolicyrenamerename / skip / fail when the tool name is taken.
renameSuffix_1Suffix used by rename avoidance.
allowUnifiedDifftrueAccept git/unified diffs.
allowCodexPatchfalseAccept Codex apply_patch syntax. Also editable in the DSH settings panel; changes take effect immediately, no restart needed.
deleteBackendshellshell or none (Delete/Move return a structured error).
shellDialectautoauto (pwsh on win32) / posix / pwsh.
deleteCommand / moveCommandbuilt-inCustom command templates. Paths still arrive only via env (DSH_PATCH_TARGET / DSH_PATCH_SOURCE); never interpolate them into the command string.
dryRunByDefaultfalseTreat calls as dry runs unless dryRun: false.
followSymlinksfalseAllow patch paths to traverse symlinks.
maxFiles50Max file sections per patch.
maxPatchBytes524288Max patch text size in bytes.
maxDiffBytes16384Max per-file diff kept in the result metadata (larger diffs are emptied and marked truncated).

Limitations (disclosed)

  • Delete/Move run through ctx.shell. The sandbox strength is whatever the loaded shell executor enforces (bash-sandbox fences; bash-local does not) — the same risk posture as the native bash tool. Every request carries a sandboxPolicy and reports sandbox facts so "policy denied" is distinguishable from "command failed".
  • Every write and every Delete/Move carries the session-scoped policy. apply_patch resolves ctx.sandboxPolicy.resolve({ session }) per call — the session's mode override plus its cwd as the workspace root — exactly like the native write/edit tools, and resolves plan paths against that same root. Without it the enforcing filesystem falls back to the deployment root, which makes in-workspace writes fail as workspace-write denials even in a danger-full-access session. A workspace-write denial surfaces as a PatchError whose message carries the backend text (the structured [sandbox: …] marker and the same-turn escalation fields are not implemented; use the native write/edit tools when you need to escalate).
  • Add does not create parent directories. This matches the native write tool (ctx.fs has no mkdir); the error names the missing directory.
  • No fuzzy/offset matching: hunk location is exact → trimEnd → trim, deliberately (fuzzy matching is unsafe for destructive ops; it is on the roadmap).
  • Binary patches are rejected with a clear error.

Development

npm install
npm run typecheck        # against 0.1.2-rc.1 peers (devDependencies)
npm run typecheck:0.1.5  # against 0.1.5-rc.2 peers (static dual-version proof)
npm test                 # vitest, 90 tests
npm run lint
npm run build            # lib/
npm run verify:source    # static safety assertions (intent dance, no node:fs, …)
npm run smoke            # load-level smoke against a stub host

Manual verification on a live DSH (dsh plugin --profile web add → restart → call the tool in a session) is intentionally left to the operator.

License

MIT

相关插件

继续浏览 developer-tools 分类下经过校验的插件。

Web App@deepseek-ai/dsh-web-appdsh 浏览器界面捆绑包:位于 dsh-base 之上的 Web 补丁层,加上运行时粘合插件(提供前端 dist、Web 界面提示符、bash 运行时变量和 URL 行)Sdk Minimal@deepseek-ai/dsh-sdk-minimal独立的最小 SDK 配置包:JSON-RPC、一个 DeepSeek 适配器、持久化 Shell 和 JSONL 会话Sdk App@deepseek-ai/dsh-sdk-appdsh SDK 配置包:基于 dsh-base 提供 stdio JSON-RPC 服务和进程生命周期管理Subagent Codex@deepseek-ai/dsh-subagent-codex基于官方 app-server 协议的一次性 Codex 子代理提供程序