Elffuss BraidHub

kikocis/continue public

80d4c66b3ffb · 1.3 KiBRawPermalink
1import { Tool } from "../..";
2import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn";
3import { createSystemMessageExampleCall } from "../systemMessageTools/buildToolsSystemMessage";
4
5export const viewSubdirectoryTool: Tool = {
6 type: "function",
7 displayTitle: "View Subdirectory",
8 wouldLikeTo: 'view a map of "{{{ directory_path }}}"',
9 isCurrently: 'getting a map of "{{{ directory_path }}}"',
10 hasAlready: 'viewed a map of "{{{ directory_path }}}"',
11 readonly: true,
12 group: BUILT_IN_GROUP_NAME,
13 isInstant: true,
14 function: {
15 name: BuiltInToolNames.ViewSubdirectory,
16 description: "View the contents of a subdirectory",
17 parameters: {
18 type: "object",
19 required: ["directory_path"],
20 properties: {
21 directory_path: {
22 type: "string",
23 description:
24 "The path of the subdirectory to view, relative to the root of the workspace",
25 },
26 },
27 },
28 },
29 defaultToolPolicy: "allowedWithPermission",
30 systemMessageDescription: createSystemMessageExampleCall(
31 BuiltInToolNames.ViewSubdirectory,
32 `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.`,
33 [["directory_path", "path/to/subdirectory"]],
34 ),
35};