跳到主要内容

dsh-diff-engine

已验证

@ch4acko3/dsh-diff-engine · v0.1.2 · MIT · Web 界面

Normalized diff engine service for DeepSeek Harness Web plugins

安装

dsh plugin add @ch4acko3/dsh-diff-engine

dsh --profile default --dump-config 确认 layer 已生效 —— 参见安装指南

源码

发布到 npm 但没有公开仓库。安装前请检查包内容。

标签

说明文档

@ch4acko3/dsh-diff-engine

A browser-side Cordis service that normalizes complete file snapshots, DSH FileDiff fragments, and unified or Git patches into one structured diff document.

export const inject = ['diffEngine']

export function apply(ctx) {
  const document = ctx.diffEngine.diff({
    kind: 'files',
    before: { path: 'app.ts', content: 'const value = 1\n' },
    after: { path: 'app.ts', content: 'const value = 2\n', language: 'ts' },
  })
  console.log(document.files[0].hunks)
}

The engine performs no file IO and runs no Git commands. Callers provide the content or patch explicitly. Complete snapshots retain their original source text, including LF, CRLF, or CR separators, so downstream renderers can map source-language tokens back to diff lines. Patch and DSH fragment inputs are marked as fragment-complete because they may omit surrounding source context.