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

Function diffContent

packages/opencode/src/acp/tool.ts:325–338  ·  view source on GitHub ↗
(input: ToolInput)

Source from the content-addressed store, hash-verified

323}
324
325function diffContent(input: ToolInput): ToolCallContent[] {
326 const oldText = stringValue(input.oldString)
327 const newText = stringValue(input.newString) ?? stringValue(input.content)
328 if (oldText === undefined || newText === undefined) return []
329
330 return [
331 {
332 type: "diff",
333 path: stringValue(input.filePath) ?? "",
334 oldText,
335 newText,
336 },
337 ]
338}
339
340function readDisplayText(metadata: unknown) {
341 if (!metadata || typeof metadata !== "object") return undefined

Callers 2

EditFunction · 0.85
completedToolContentFunction · 0.85

Calls 1

stringValueFunction · 0.70

Tested by

no test coverage detected