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