| 1 | import { ToolImpl } from "."; |
| 2 | import { getDiffsFromCache } from "../../autocomplete/snippets/gitDiffCache"; |
| 3 | |
| 4 | export const viewDiffImpl: ToolImpl = async (args, extras) => { |
| 5 | const diffs = await getDiffsFromCache(extras.ide); // const diffs = await extras.ide.getDiff(true); |
| 6 | // TODO includeUnstaged should be an option |
| 7 | |
| 8 | return [ |
| 9 | { |
| 10 | name: ".diff", |
| 11 | description: "The current git diff", |
| 12 | content: diffs.join("\n"), |
| 13 | }, |
| 14 | ]; |
| 15 | }; |