# Conflicts: # core/index.d.ts # core/tools/definitions/codebaseTool.ts # core/tools/definitions/createNewFile.ts # core/tools/definitions/createRuleBlock.ts # core/tools/definitions/editFile.ts # core/tools/definitions/fetchUrlContent.ts # core/tools/definitions/globSearch.ts # core/tools/definitions/grepSearch.ts # core/tools/definitions/ls.ts # core/tools/definitions/readCurrentlyOpenFile.ts # core/tools/definitions/readFile.ts # core/tools/definitions/requestRule.ts # core/tools/definitions/runTerminalCommand.ts # core/tools/definitions/searchAndReplaceInFile.ts # core/tools/definitions/searchWeb.ts # core/tools/definitions/viewDiff.ts # core/tools/definitions/viewRepoMap.ts # core/tools/definitions/viewSubdirectory.ts
35 lines
1.3 KiB
TypeScript
35 lines
1.3 KiB
TypeScript
import { Tool } from "../..";
|
|
import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn";
|
|
import { createSystemMessageExampleCall } from "../systemMessageTools/buildToolsSystemMessage";
|
|
|
|
export const viewSubdirectoryTool: Tool = {
|
|
type: "function",
|
|
displayTitle: "View Subdirectory",
|
|
wouldLikeTo: 'view a map of "{{{ directory_path }}}"',
|
|
isCurrently: 'getting a map of "{{{ directory_path }}}"',
|
|
hasAlready: 'viewed a map of "{{{ directory_path }}}"',
|
|
readonly: true,
|
|
group: BUILT_IN_GROUP_NAME,
|
|
isInstant: true,
|
|
function: {
|
|
name: BuiltInToolNames.ViewSubdirectory,
|
|
description: "View the contents of a subdirectory",
|
|
parameters: {
|
|
type: "object",
|
|
required: ["directory_path"],
|
|
properties: {
|
|
directory_path: {
|
|
type: "string",
|
|
description:
|
|
"The path of the subdirectory to view, relative to the root of the workspace",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
defaultToolPolicy: "allowedWithPermission",
|
|
systemMessageDescription: createSystemMessageExampleCall(
|
|
BuiltInToolNames.ViewSubdirectory,
|
|
`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.`,
|
|
[["directory_path", "path/to/subdirectory"]],
|
|
),
|
|
};
|