MCPcopy Create free account
hub / github.com/cloudflare/computer / generateUnifiedPatch

Function generateUnifiedPatch

packages/computer/src/tools/fs/edit-diff.ts:223–232  ·  view source on GitHub ↗
(
  path: string,
  oldContent: string,
  newContent: string,
  contextLines = 4,
)

Source from the content-addressed store, hash-verified

221// ---------- diffs ----------
222
223export function generateUnifiedPatch(
224 path: string,
225 oldContent: string,
226 newContent: string,
227 contextLines = 4,
228): string {
229 return Diff.createTwoFilesPatch(path, path, oldContent, newContent, undefined, undefined, {
230 context: contextLines,
231 });
232}
233
234export interface EditDiffResult {
235 diff: string;

Callers 1

createEditToolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected