Elffuss BraidHub

kikocis/continue public

4940c71be2bf · 1.5 KiBRawPermalink
1import { Tool } from "../..";
2import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn";
3import { createSystemMessageExampleCall } from "../systemMessageTools/buildToolsSystemMessage";
4
5export const codebaseTool: Tool = {
6 type: "function",
7 displayTitle: "Codebase Search",
8 wouldLikeTo: "search the codebase for: {{{ query }}}",
9 isCurrently: "searching the codebase for: {{{ query }}}",
10 hasAlready: "searched the codebase for: {{{ query }}}",
11 readonly: true,
12 isInstant: false,
13 group: BUILT_IN_GROUP_NAME,
14 function: {
15 name: BuiltInToolNames.CodebaseTool,
16 description:
17 "Use this tool to semantically search through the codebase and retrieve relevant code snippets based on a natural language query. This helps find relevant code context for understanding or working with the codebase.",
18 parameters: {
19 type: "object",
20 required: ["query"],
21 properties: {
22 query: {
23 type: "string",
24 description:
25 "Natural language description of what you're looking for in the codebase (e.g., 'authentication logic', 'database connection setup', 'error handling')",
26 },
27 },
28 },
29 },
30 defaultToolPolicy: "allowedWithPermission",
31 systemMessageDescription: createSystemMessageExampleCall(
32 BuiltInToolNames.CodebaseTool,
33 `To search the codebase, use the ${BuiltInToolNames.CodebaseTool} tool with a natural language query. For example, to find authentication logic, you might respond with:`,
34 [["query", "How is user authentication handled in this codebase?"]],
35 ),
36};