MCPcopy Create free account
hub / github.com/anomalyco/opencode / toModelOutput

Function toModelOutput

packages/core/src/tool/edit.ts:73–81  ·  view source on GitHub ↗
(output: Output, oldString: string, newString: string)

Source from the content-addressed store, hash-verified

71}
72
73export const toModelOutput = (output: Output, oldString: string, newString: string) =>
74 [
75 `Edited file successfully: ${output.files[0]?.file}`,
76 `Replacements: ${output.replacements}`,
77 "```diff",
78 ...previewLines(oldString, "-"),
79 ...previewLines(newString, "+"),
80 "```",
81 ].join("\n")
82
83/** Deferred V2 edit behavior and UX integrations remain visible at the model-facing seam. */
84// TODO: Port V1 fuzzy correction strategies only after exact-edit behavior is established: line-trimmed matching, block-anchor fallback, indentation correction, and similarity-threshold review.

Callers 1

edit.tsFile · 0.70

Calls 1

previewLinesFunction · 0.85

Tested by

no test coverage detected