(content: ToolContent[])
| 283 | } |
| 284 | |
| 285 | function contentText(content: ToolContent[]): string { |
| 286 | return content |
| 287 | .filter( |
| 288 | (item): item is { type: "text"; text: string } => item.type === "text", |
| 289 | ) |
| 290 | .map((item) => item.text) |
| 291 | .join("\n"); |
| 292 | } |
| 293 | |
| 294 | function toolErrorPreview(content: ToolContent[]): string | undefined { |
| 295 | const text = contentText(content).replace(/\s+/g, " ").trim(); |
no outgoing calls
no test coverage detected