(input: ToolInput)
| 323 | } |
| 324 | |
| 325 | function 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 | |
| 340 | function readDisplayText(metadata: unknown) { |
| 341 | if (!metadata || typeof metadata !== "object") return undefined |
no test coverage detected