| 1 | import { Tool } from "../.."; |
| 2 | import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; |
| 3 | |
| 4 | export const viewSubdirectoryTool: Tool = { |
| 5 | type: "function", |
| 6 | displayTitle: "View Subdirectory", |
| 7 | wouldLikeTo: 'view a map of "{{{ directory_path }}}"', |
| 8 | isCurrently: 'getting a map of "{{{ directory_path }}}"', |
| 9 | hasAlready: 'viewed a map of "{{{ directory_path }}}"', |
| 10 | readonly: true, |
| 11 | group: BUILT_IN_GROUP_NAME, |
| 12 | isInstant: true, |
| 13 | function: { |
| 14 | name: BuiltInToolNames.ViewSubdirectory, |
| 15 | description: "View the contents of a subdirectory", |
| 16 | parameters: { |
| 17 | type: "object", |
| 18 | required: ["directory_path"], |
| 19 | properties: { |
| 20 | directory_path: { |
| 21 | type: "string", |
| 22 | description: |
| 23 | "The path of the subdirectory to view, relative to the root of the workspace", |
| 24 | }, |
| 25 | }, |
| 26 | }, |
| 27 | }, |
| 28 | systemMessageDescription: { |
| 29 | prefix: `To view a map of a specific folder within the project, you can use the ${BuiltInToolNames.ViewSubdirectory} tool. This will provide a visual representation of the folder's structure and organization.`, |
| 30 | exampleArgs: [["directory_path", "path/to/subdirectory"]], |
| 31 | }, |
| 32 | defaultToolPolicy: "allowedWithPermission", |
| 33 | toolCallIcon: "FolderOpenIcon", |
| 34 | }; |