| 286 | } |
| 287 | |
| 288 | function runGlob(p: ToolProps<typeof GlobTool>): ToolInline { |
| 289 | const root = p.input.path ?? "" |
| 290 | const title = `Glob "${p.input.pattern ?? ""}"` |
| 291 | const suffix = root ? `in ${toolPath(root)}` : "" |
| 292 | const matches = p.metadata.count |
| 293 | const description = matches === undefined ? suffix : `${suffix}${suffix ? " · " : ""}${count(matches, "match")}` |
| 294 | return { |
| 295 | icon: "✱", |
| 296 | title, |
| 297 | ...(description && { description }), |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | function runGrep(p: ToolProps<typeof GrepTool>): ToolInline { |
| 302 | const root = p.input.path ?? "" |