(
abortSignal: AbortSignal,
)
| 466 | } |
| 467 | |
| 468 | getModifyContext( |
| 469 | abortSignal: AbortSignal, |
| 470 | ): ModifyContext<WriteFileToolParams> { |
| 471 | return { |
| 472 | getFilePath: (params: WriteFileToolParams) => params.file_path, |
| 473 | getCurrentContent: async (params: WriteFileToolParams) => { |
| 474 | const correctedContentResult = await getCorrectedFileContent( |
| 475 | this.config, |
| 476 | params.file_path, |
| 477 | params.content, |
| 478 | abortSignal, |
| 479 | ); |
| 480 | return correctedContentResult.originalContent; |
| 481 | }, |
| 482 | getProposedContent: async (params: WriteFileToolParams) => { |
| 483 | const correctedContentResult = await getCorrectedFileContent( |
| 484 | this.config, |
| 485 | params.file_path, |
| 486 | params.content, |
| 487 | abortSignal, |
| 488 | ); |
| 489 | return correctedContentResult.correctedContent; |
| 490 | }, |
| 491 | createUpdatedParams: ( |
| 492 | _oldContent: string, |
| 493 | modifiedProposedContent: string, |
| 494 | originalParams: WriteFileToolParams, |
| 495 | ) => { |
| 496 | const content = originalParams.content; |
| 497 | return { |
| 498 | ...originalParams, |
| 499 | ai_proposed_content: content, |
| 500 | content: modifiedProposedContent, |
| 501 | modified_by_user: true, |
| 502 | }; |
| 503 | }, |
| 504 | }; |
| 505 | } |
| 506 | } |
nothing calls this directly
no test coverage detected