diff options
| author | Conrad Irwin <[email protected]> | 2025-07-17 16:25:23 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-17 22:25:23 +0000 |
| commit | 761ffc63388201373e5d16f36c2af09be71b5933 (patch) | |
| tree | 3012681d84b27034ed9ceaa5df2eae6aeb753779 /packages/core/src/tools/write-file.ts | |
| parent | 12401898f1f541a8a7919c94b4616fb0263dcce5 (diff) | |
Zed integration (#4266)
Co-authored-by: Agus Zubiaga <[email protected]>
Co-authored-by: Ben Brandt <[email protected]>
Co-authored-by: mkorwel <[email protected]>
Diffstat (limited to 'packages/core/src/tools/write-file.ts')
| -rw-r--r-- | packages/core/src/tools/write-file.ts | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/packages/core/src/tools/write-file.ts b/packages/core/src/tools/write-file.ts index a3756c69..ae37ca8a 100644 --- a/packages/core/src/tools/write-file.ts +++ b/packages/core/src/tools/write-file.ts @@ -15,6 +15,7 @@ import { ToolEditConfirmationDetails, ToolConfirmationOutcome, ToolCallConfirmationDetails, + Icon, } from './tools.js'; import { Type } from '@google/genai'; import { SchemaValidator } from '../utils/schemaValidator.js'; @@ -72,9 +73,10 @@ export class WriteFileTool super( WriteFileTool.Name, 'WriteFile', - `Writes content to a specified file in the local filesystem. - + `Writes content to a specified file in the local filesystem. + The user has the ability to modify \`content\`. If modified, this will be stated in the response.`, + Icon.Pencil, { properties: { file_path: { @@ -184,6 +186,8 @@ export class WriteFileTool title: `Confirm Write: ${shortenPath(relativePath)}`, fileName, fileDiff, + originalContent, + newContent: correctedContent, onConfirm: async (outcome: ToolConfirmationOutcome) => { if (outcome === ToolConfirmationOutcome.ProceedAlways) { this.config.setApprovalMode(ApprovalMode.AUTO_EDIT); @@ -269,7 +273,12 @@ export class WriteFileTool ); } - const displayResult: FileDiff = { fileDiff, fileName }; + const displayResult: FileDiff = { + fileDiff, + fileName, + originalContent: correctedContentResult.originalContent, + newContent: correctedContentResult.correctedContent, + }; const lines = fileContent.split('\n').length; const mimetype = getSpecificMimeType(params.file_path); |
