Elffuss BraidHub

kikocis/continue public

4940c71be2bf · 1.3 KiBRawPermalink
1import { Tool } from "../..";
2import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn";
3import { createSystemMessageExampleCall } from "../systemMessageTools/buildToolsSystemMessage";
4
5export const grepSearchTool: Tool = {
6 type: "function",
7 displayTitle: "Grep Search",
8 wouldLikeTo: 'search for "{{{ query }}}" in the repository',
9 isCurrently: 'getting search results for "{{{ query }}}"',
10 hasAlready: 'retrieved search results for "{{{ query }}}"',
11 readonly: true,
12 isInstant: true,
13 group: BUILT_IN_GROUP_NAME,
14 function: {
15 name: BuiltInToolNames.GrepSearch,
16 description:
17 "Perform a search over the repository using ripgrep. Output may be truncated, so use targeted queries",
18 parameters: {
19 type: "object",
20 required: ["query"],
21 properties: {
22 query: {
23 type: "string",
24 description:
25 "The search query to use. Must be a valid ripgrep regex expression, escaped where needed",
26 },
27 },
28 },
29 },
30 defaultToolPolicy: "allowedWithoutPermission",
31 systemMessageDescription: createSystemMessageExampleCall(
32 BuiltInToolNames.GrepSearch,
33 `To perform a grep search within the project, call the ${BuiltInToolNames.GrepSearch} tool with the query pattern to match. For example:`,
34 [["query", ".*main_services.*"]],
35 ),
36};