Elffuss BraidHub

kikocis/continue public

main · 1.4 KiBRawPermalink
1import { Tool } from "../..";
2import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn";
3
4export const createNewFileTool: Tool = {
5 type: "function",
6 displayTitle: "Create New File",
7 wouldLikeTo: "create {{{ filepath }}}",
8 isCurrently: "creating {{{ filepath }}}",
9 hasAlready: "created {{{ filepath }}}",
10 group: BUILT_IN_GROUP_NAME,
11 readonly: false,
12 isInstant: true,
13 function: {
14 name: BuiltInToolNames.CreateNewFile,
15 description:
16 "Create a new file. Only use this when a file doesn't exist and should be created",
17 parameters: {
18 type: "object",
19 required: ["filepath", "contents"],
20 properties: {
21 filepath: {
22 type: "string",
23 description:
24 "The path where the new file should be created, relative to the root of the workspace",
25 },
26 contents: {
27 type: "string",
28 description: "The contents to write to the new file",
29 },
30 },
31 },
32 },
33 defaultToolPolicy: "allowedWithPermission",
34 systemMessageDescription: {
35 prefix: `To create a NEW file, use the ${BuiltInToolNames.CreateNewFile} tool with the relative filepath and new contents. For example, to create a file located at 'path/to/file.txt', you would respond with:`,
36 exampleArgs: [
37 ["filepath", "path/to/the_file.txt"],
38 ["contents", "Contents of the file"],
39 ],
40 },
41};