| 1 | import { Tool } from "../.."; |
| 2 | |
| 3 | import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; |
| 4 | import { createSystemMessageExampleCall } from "../systemMessageTools/buildToolsSystemMessage"; |
| 5 | |
| 6 | export const viewDiffTool: Tool = { |
| 7 | type: "function", |
| 8 | displayTitle: "View Diff", |
| 9 | wouldLikeTo: "view the git diff", |
| 10 | isCurrently: "getting the git diff", |
| 11 | hasAlready: "viewed the git diff", |
| 12 | readonly: true, |
| 13 | isInstant: true, |
| 14 | group: BUILT_IN_GROUP_NAME, |
| 15 | function: { |
| 16 | name: BuiltInToolNames.ViewDiff, |
| 17 | description: "View the current diff of working changes", |
| 18 | parameters: { |
| 19 | type: "object", |
| 20 | properties: {}, |
| 21 | }, |
| 22 | }, |
| 23 | defaultToolPolicy: "allowedWithoutPermission", |
| 24 | systemMessageDescription: createSystemMessageExampleCall( |
| 25 | BuiltInToolNames.ViewDiff, |
| 26 | `To view the current git diff, use the ${BuiltInToolNames.ViewDiff} tool. This will show you the changes made in the working directory compared to the last commit.`, |
| 27 | [], |
| 28 | ), |
| 29 | }; |