Community plugin

Jayden-ren / patch-relay

PatchRelay — the model proposes reviewed diffs with line numbers, you apply them by hand, then one click hands the work back.

  • JavaScript
  • MIT
  • 0 stars
  • Nov 11, 2026

About this plugin

Written by the registry from verified metadata, not from the README.

patch-relay is a DSH plugin published from the Jayden-ren/patch-relay repository.

  • Listing statusManifest verified
  • Manifest checkedNov 11, 2026
  • Packagepatch-relay
  • Package version1.0.0
  • Source commitdda1832
  • Repository createdOct 29, 2026

Capabilities and topics

dsh-plugindshcode-reviewhuman-in-the-loop
From the repository README

README

Everything below this line is the repository's own document, cached here. This site did not write or review it.

PatchRelay

AI 提改动,你手动落地,改完点一下把接力棒交回来。

把「AI 直接改你的代码」换成「AI 给你可审查的 diff,你自己动手改」。 目的有三个:diff 保持小、你对代码保持熟悉、每个改动都被真的读过一遍。

它做什么

  1. propose_patch 工具:读取真实文件,校验 old_string 是否唯一出现,返回真实的多段 unified diff 和行号。它从不写文件。
  2. edit / write 被关掉:新建的 agent 工具表里直接没有这两个;已在运行的会话仍能看到,但调用会被拒绝并提示改用 propose_patch。
  3. 两列彩色 diff 卡片:原代码 | 修改后,左右各有行号,卡头是 路径:行号(IDE 的「跳转到文件:行号」可直接用);绿=新增、红=删除、蓝=原行修改。
  4. 复制 / 直接应用:卡片顶部可一键复制修改后的代码;点「直接应用」由 Host 侧把提案写入文件,文件在提案后被改过会拒绝应用(仍可手动改)。
  5. 交接回路:每轮以一张 ask_user_question 卡片收尾(「已应用,继续 / 还要再改」),你点一下 AI 才继续下一步。

工作流

AI 读代码定位根因
  → propose_patch 给出 diff + 行号(文件不动)
    → 你在 IDE 里手动改,或点卡片「直接应用」
      → 点「已应用,继续」
        → AI 读回文件、跑项目自检、提下一处

安装

从 GitHub 安装到 profile(把 <profile> 换成你的 profile 名,如 web;Desktop 用桌面自带的 dsh 命令):

dsh plugin --profile <profile> add github:Jayden-ren/patch-relay

也可以在 DSH 插件管理里直接从本仓库地址安装;安装后在 profile 内全局生效。

验证

node selfcheck.mjs     # diff / 行号 / 左右分列的行配对断言

已知边界

  • 只拦 edit / write;shell 工具(pwsh / bash)仍然能写文件。要更严格请一并禁用,代价是构建与测试也跑不了。
  • 客户端卡片需要在页面刷新后加载;刷新前显示为原生 diff 卡片。
  • 卡片里的「修改」判定基于行配对:同一处改动里删几行补几行,按顺序一一配对(配对上的标蓝,剩下的标红/绿)。
  • 「直接应用」由 Host 侧会话命令 patch-relay-apply 执行(不经过手动粘贴);提案后文件被改过会拒绝应用,需要重新提案。

许可证

MIT

Badge

Listed here? Link back with this badge — paste the snippet into your repository README.

Listed on DSH Plugin badge
[![Listed on DSH Plugin](https://dsh-plugin.com/badges/listed.svg)](https://dsh-plugin.com/plugins/Jayden-ren/patch-relay)
patch-relay — DSH Plugin