memorax-ai/dsh-render-engine--packages-diff-engine ↗★ 1

@ch4acko3/dsh-diff-engine

Normalized diff engine service for DeepSeek Harness Web plugins 适合需要处理、解析和对比代码或文件差异的Web插件开发者。

パッケージ
@ch4acko3/dsh-diff-engine
互換性
未検証
Cordis ピア範囲
^4.0.1
バージョン
0.1.3
ライセンス
MIT
最終更新
2026/09/24

同名パッケージの別リポジトリ

インストール

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:memorax-ai/dsh-render-engine#9582bf138d3a6d7381a84359a4a0b878a1ea8952&path:packages/diff-engine

ドキュメント

README 全文を読む ↗

@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.