Elffuss BraidHub

kikocis/continue public

4940c71be2bf · 1.1 KiBRawPermalink
1import { Tool } from "../..";
2import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn";
3import { createSystemMessageExampleCall } from "../systemMessageTools/buildToolsSystemMessage";
4
5export const readCurrentlyOpenFileTool: Tool = {
6 type: "function",
7 displayTitle: "Read Currently Open File",
8 wouldLikeTo: "read the current file",
9 isCurrently: "reading the current file",
10 hasAlready: "viewed the current file",
11 readonly: true,
12 isInstant: true,
13 group: BUILT_IN_GROUP_NAME,
14 function: {
15 name: BuiltInToolNames.ReadCurrentlyOpenFile,
16 description:
17 "Read the currently open file in the IDE. If the user seems to be referring to a file that you can't see, try using this",
18 parameters: {
19 type: "object",
20 properties: {},
21 },
22 },
23 defaultToolPolicy: "allowedWithPermission",
24 systemMessageDescription: createSystemMessageExampleCall(
25 BuiltInToolNames.ReadCurrentlyOpenFile,
26 `To view the user's currently open file, use the ${BuiltInToolNames.ReadCurrentlyOpenFile} tool.
27If the user is asking about a file and you don't see any code, use this to check the current file`,
28 [],
29 ),
30};