@@ -24,14 +24,16 @@ type EditParams struct {
2424}
2525
2626type EditPermissionsParams struct {
27− FilePath string `json:"file_path"`
28− Diff string `json:"diff"`
27+ FilePath string `json:"file_path"`
28+ OldContent string `json:"old_content,omitempty"`
29+ NewContent string `json:"new_content,omitempty"`
2930}
3031
3132type EditResponseMetadata struct {
32− Diff string `json:"diff"`
33− Additions int `json:"additions"`
34− Removals int `json:"removals"`
33+ Additions int `json:"additions"`
34+ Removals int `json:"removals"`
35+ OldContent string `json:"old_content,omitempty"`
36+ NewContent string `json:"new_content,omitempty"`
3537}
3638
3739type editTool struct {
@@ -191,7 +193,7 @@ func (e *editTool) createNewFile(ctx context.Context, filePath, content string)
191193 return ToolResponse{}, fmt.Errorf("session ID and message ID are required for creating a new file")
192194 }
193195
194− diff, additions, removals := diff.GenerateDiff(
196+ _, additions, removals := diff.GenerateDiff(
195197 "",
196198 content,
197199 filePath,
@@ -209,8 +211,9 @@ func (e *editTool) createNewFile(ctx context.Context, filePath, content string)
209211 Action: "write",
210212 Description: fmt.Sprintf("Create file %s", filePath),
211213 Params: EditPermissionsParams{
212− FilePath: filePath,
213− Diff: diff,
214+ FilePath: filePath,
215+ OldContent: "",
216+ NewContent: content,
214217 },
215218 },
216219 )
@@ -243,9 +246,10 @@ func (e *editTool) createNewFile(ctx context.Context, filePath, content string)
243246 return WithResponseMetadata(
244247 NewTextResponse("File created: "+filePath),
245248 EditResponseMetadata{
246− Diff: diff,
247− Additions: additions,
248− Removals: removals,
249+ OldContent: "",
250+ NewContent: content,
251+ Additions: additions,
252+ Removals: removals,
249253 },
250254 ), nil
251255}
@@ -301,7 +305,7 @@ func (e *editTool) deleteContent(ctx context.Context, filePath, oldString string
301305 return ToolResponse{}, fmt.Errorf("session ID and message ID are required for creating a new file")
302306 }
303307
304− diff, additions, removals := diff.GenerateDiff(
308+ _, additions, removals := diff.GenerateDiff(
305309 oldContent,
306310 newContent,
307311 filePath,
@@ -320,8 +324,9 @@ func (e *editTool) deleteContent(ctx context.Context, filePath, oldString string
320324 Action: "write",
321325 Description: fmt.Sprintf("Delete content from file %s", filePath),
322326 Params: EditPermissionsParams{
323− FilePath: filePath,
324− Diff: diff,
327+ FilePath: filePath,
328+ OldContent: oldContent,
329+ NewContent: newContent,
325330 },
326331 },
327332 )
@@ -362,9 +367,10 @@ func (e *editTool) deleteContent(ctx context.Context, filePath, oldString string
362367 return WithResponseMetadata(
363368 NewTextResponse("Content deleted from file: "+filePath),
364369 EditResponseMetadata{
365− Diff: diff,
366− Additions: additions,
367− Removals: removals,
370+ OldContent: oldContent,
371+ NewContent: newContent,
372+ Additions: additions,
373+ Removals: removals,
368374 },
369375 ), nil
370376}
@@ -422,7 +428,7 @@ func (e *editTool) replaceContent(ctx context.Context, filePath, oldString, newS
422428 if sessionID == "" || messageID == "" {
423429 return ToolResponse{}, fmt.Errorf("session ID and message ID are required for creating a new file")
424430 }
425− diff, additions, removals := diff.GenerateDiff(
431+ _, additions, removals := diff.GenerateDiff(
426432 oldContent,
427433 newContent,
428434 filePath,
@@ -440,8 +446,9 @@ func (e *editTool) replaceContent(ctx context.Context, filePath, oldString, newS
440446 Action: "write",
441447 Description: fmt.Sprintf("Replace content in file %s", filePath),
442448 Params: EditPermissionsParams{
443− FilePath: filePath,
444− Diff: diff,
449+ FilePath: filePath,
450+ OldContent: oldContent,
451+ NewContent: newContent,
445452 },
446453 },
447454 )
@@ -482,8 +489,9 @@ func (e *editTool) replaceContent(ctx context.Context, filePath, oldString, newS
482489 return WithResponseMetadata(
483490 NewTextResponse("Content replaced in file: "+filePath),
484491 EditResponseMetadata{
485− Diff: diff,
486− Additions: additions,
487− Removals: removals,
492+ OldContent: oldContent,
493+ NewContent: newContent,
494+ Additions: additions,
495+ Removals: removals,
488496 }), nil
489497}