Elffuss BraidHub

kikocis/continue public

4940c71be2bf · 1.4 KiBRawPermalink
1import { Tool } from "../..";
2
3import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn";
4import { createSystemMessageExampleCall } from "../systemMessageTools/buildToolsSystemMessage";
5
6export const lsTool: Tool = {
7 type: "function",
8 displayTitle: "ls",
9 wouldLikeTo: "list files and folders in {{{ dirPath }}}",
10 isCurrently: "listing files and folders in {{{ dirPath }}}",
11 hasAlready: "listed files and folders in {{{ dirPath }}}",
12 readonly: true,
13 isInstant: true,
14 group: BUILT_IN_GROUP_NAME,
15 function: {
16 name: BuiltInToolNames.LSTool,
17 description: "List files and folders in a given directory",
18 parameters: {
19 type: "object",
20 properties: {
21 dirPath: {
22 type: "string",
23 description:
24 "The directory path relative to the root of the project. Use forward slash paths like '/'. rather than e.g. '.'",
25 },
26 recursive: {
27 type: "boolean",
28 description:
29 "If true, lists files and folders recursively. To prevent unexpected large results, use this sparingly",
30 },
31 },
32 },
33 },
34 defaultToolPolicy: "allowedWithoutPermission",
35 systemMessageDescription: createSystemMessageExampleCall(
36 BuiltInToolNames.LSTool,
37 `To list files and folders in a given directory, call the ${BuiltInToolNames.LSTool} tool with "dirPath" and "recursive". For example:`,
38 [
39 ["dirPath", "path/to/dir"],
40 ["recursive", "false"],
41 ],
42 ),
43};