| 1 | import { Tool } from "../.."; |
| 2 | import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; |
| 3 | |
| 4 | export const grepSearchTool: Tool = { |
| 5 | type: "function", |
| 6 | displayTitle: "Grep Search", |
| 7 | wouldLikeTo: 'search for "{{{ query }}}" in the repository', |
| 8 | isCurrently: 'getting search results for "{{{ query }}}"', |
| 9 | hasAlready: 'retrieved search results for "{{{ query }}}"', |
| 10 | readonly: true, |
| 11 | isInstant: true, |
| 12 | group: BUILT_IN_GROUP_NAME, |
| 13 | function: { |
| 14 | name: BuiltInToolNames.GrepSearch, |
| 15 | description: |
| 16 | "Perform a search over the repository using ripgrep. Output may be truncated, so use targeted queries", |
| 17 | parameters: { |
| 18 | type: "object", |
| 19 | required: ["query"], |
| 20 | properties: { |
| 21 | query: { |
| 22 | type: "string", |
| 23 | description: |
| 24 | "The search query to use. Must be a valid ripgrep regex expression, escaped where needed", |
| 25 | }, |
| 26 | }, |
| 27 | }, |
| 28 | }, |
| 29 | }; |