@@ -24,14 +24,16 @@ type EditParams struct {
26type EditPermissionsParams struct {
26type EditPermissionsParams struct {
27− FilePath string `json:"file_path"`
27+ FilePath string `json:"file_path"`
28− Diff string `json:"diff"`
28+ OldContent string `json:"old_content,omitempty"`
29+ NewContent string `json:"new_content,omitempty"`
31type EditResponseMetadata struct {
32type EditResponseMetadata struct {
32− Diff string `json:"diff"`
33− Additions int `json:"additions"`
33+ Additions int `json:"additions"`
34− Removals int `json:"removals"`
34+ Removals int `json:"removals"`
35+ OldContent string `json:"old_content,omitempty"`
36+ NewContent string `json:"new_content,omitempty"`
37type editTool struct {
39type editTool struct {
@@ -191,7 +193,7 @@ func (e *editTool) createNewFile(ctx context.Context, filePath, content string)
191 return ToolResponse{}, fmt.Errorf("session ID and message ID are required for creating a new file")
193 return ToolResponse{}, fmt.Errorf("session ID and message ID are required for creating a new file")
194− diff, additions, removals := diff.GenerateDiff(
196+ _, additions, removals := diff.GenerateDiff(
197 filePath,
199 filePath,
@@ -209,8 +211,9 @@ func (e *editTool) createNewFile(ctx context.Context, filePath, content string)
209 Action: "write",
211 Action: "write",
210 Description: fmt.Sprintf("Create file %s", filePath),
212 Description: fmt.Sprintf("Create file %s", filePath),
211 Params: EditPermissionsParams{
213 Params: EditPermissionsParams{
212− FilePath: filePath,
214+ FilePath: filePath,
213− Diff: diff,
215+ OldContent: "",
216+ NewContent: content,
@@ -243,9 +246,10 @@ func (e *editTool) createNewFile(ctx context.Context, filePath, content string)
243 return WithResponseMetadata(
246 return WithResponseMetadata(
244 NewTextResponse("File created: "+filePath),
247 NewTextResponse("File created: "+filePath),
245 EditResponseMetadata{
248 EditResponseMetadata{
246− Diff: diff,
249+ OldContent: "",
250+ NewContent: content,
247− Additions: additions,
251+ Additions: additions,
248− Removals: removals,
252+ Removals: removals,
@@ -301,7 +305,7 @@ func (e *editTool) deleteContent(ctx context.Context, filePath, oldString string
301 return ToolResponse{}, fmt.Errorf("session ID and message ID are required for creating a new file")
305 return ToolResponse{}, fmt.Errorf("session ID and message ID are required for creating a new file")
304− diff, additions, removals := diff.GenerateDiff(
308+ _, additions, removals := diff.GenerateDiff(
305 oldContent,
309 oldContent,
306 newContent,
310 newContent,
307 filePath,
311 filePath,
@@ -320,8 +324,9 @@ func (e *editTool) deleteContent(ctx context.Context, filePath, oldString string
320 Action: "write",
324 Action: "write",
321 Description: fmt.Sprintf("Delete content from file %s", filePath),
325 Description: fmt.Sprintf("Delete content from file %s", filePath),
322 Params: EditPermissionsParams{
326 Params: EditPermissionsParams{
323− FilePath: filePath,
327+ FilePath: filePath,
324− Diff: diff,
328+ OldContent: oldContent,
329+ NewContent: newContent,
@@ -362,9 +367,10 @@ func (e *editTool) deleteContent(ctx context.Context, filePath, oldString string
362 return WithResponseMetadata(
367 return WithResponseMetadata(
363 NewTextResponse("Content deleted from file: "+filePath),
368 NewTextResponse("Content deleted from file: "+filePath),
364 EditResponseMetadata{
369 EditResponseMetadata{
365− Diff: diff,
370+ OldContent: oldContent,
371+ NewContent: newContent,
366− Additions: additions,
372+ Additions: additions,
367− Removals: removals,
373+ Removals: removals,
@@ -422,7 +428,7 @@ func (e *editTool) replaceContent(ctx context.Context, filePath, oldString, newS
422 if sessionID == "" || messageID == "" {
428 if sessionID == "" || messageID == "" {
423 return ToolResponse{}, fmt.Errorf("session ID and message ID are required for creating a new file")
429 return ToolResponse{}, fmt.Errorf("session ID and message ID are required for creating a new file")
425− diff, additions, removals := diff.GenerateDiff(
431+ _, additions, removals := diff.GenerateDiff(
426 oldContent,
432 oldContent,
427 newContent,
433 newContent,
428 filePath,
434 filePath,
@@ -440,8 +446,9 @@ func (e *editTool) replaceContent(ctx context.Context, filePath, oldString, newS
440 Action: "write",
446 Action: "write",
441 Description: fmt.Sprintf("Replace content in file %s", filePath),
447 Description: fmt.Sprintf("Replace content in file %s", filePath),
442 Params: EditPermissionsParams{
448 Params: EditPermissionsParams{
443− FilePath: filePath,
449+ FilePath: filePath,
444− Diff: diff,
450+ OldContent: oldContent,
451+ NewContent: newContent,
@@ -482,8 +489,9 @@ func (e *editTool) replaceContent(ctx context.Context, filePath, oldString, newS
482 return WithResponseMetadata(
489 return WithResponseMetadata(
483 NewTextResponse("Content replaced in file: "+filePath),
490 NewTextResponse("Content replaced in file: "+filePath),
484 EditResponseMetadata{
491 EditResponseMetadata{
485− Diff: diff,
492+ OldContent: oldContent,
493+ NewContent: newContent,
486− Additions: additions,
494+ Additions: additions,
487− Removals: removals,
495+ Removals: removals,