| 330 | }); |
| 331 | |
| 332 | class MockEditToolInvocation extends BaseToolInvocation< |
| 333 | Record<string, unknown>, |
| 334 | ToolResult |
| 335 | > { |
| 336 | constructor(params: Record<string, unknown>) { |
| 337 | super(params); |
| 338 | } |
| 339 | |
| 340 | getDescription(): string { |
| 341 | return 'A mock edit tool invocation'; |
| 342 | } |
| 343 | |
| 344 | override async shouldConfirmExecute( |
| 345 | _abortSignal: AbortSignal, |
| 346 | ): Promise<ToolCallConfirmationDetails | false> { |
| 347 | return { |
| 348 | type: 'edit', |
| 349 | title: 'Confirm Edit', |
| 350 | fileName: 'test.txt', |
| 351 | filePath: 'test.txt', |
| 352 | fileDiff: |
| 353 | '--- test.txt\n+++ test.txt\n@@ -1,1 +1,1 @@\n-old content\n+new content', |
| 354 | originalContent: 'old content', |
| 355 | newContent: 'new content', |
| 356 | onConfirm: async () => {}, |
| 357 | }; |
| 358 | } |
| 359 | |
| 360 | async execute(_abortSignal: AbortSignal): Promise<ToolResult> { |
| 361 | return { |
| 362 | llmContent: 'Edited successfully', |
| 363 | returnDisplay: 'Edited successfully', |
| 364 | }; |
| 365 | } |
| 366 | } |
| 367 | |
| 368 | class MockEditTool extends BaseDeclarativeTool< |
| 369 | Record<string, unknown>, |
nothing calls this directly
no outgoing calls
no test coverage detected