diff.proto 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. syntax = "proto3";
  2. package host;
  3. import "cline/common.proto";
  4. option go_package = "github.com/cline/grpc-go/host";
  5. option java_multiple_files = true;
  6. option java_package = "bot.cline.host.proto";
  7. // Provides methods for diff views.
  8. service DiffService {
  9. // Open the diff view/editor.
  10. rpc openDiff(OpenDiffRequest) returns (OpenDiffResponse);
  11. // Get the contents of the diff view.
  12. rpc getDocumentText(GetDocumentTextRequest) returns (GetDocumentTextResponse);
  13. // Replace a text selection in the diff.
  14. rpc replaceText(ReplaceTextRequest) returns (ReplaceTextResponse);
  15. rpc scrollDiff(ScrollDiffRequest) returns (ScrollDiffResponse);
  16. // Truncate the diff document.
  17. rpc truncateDocument(TruncateDocumentRequest) returns (TruncateDocumentResponse);
  18. // Save the diff document.
  19. rpc saveDocument(SaveDocumentRequest) returns (SaveDocumentResponse);
  20. // Close all the diff editor windows/tabs.
  21. // Any diff editors with unsaved content should not be closed.
  22. rpc closeAllDiffs(CloseAllDiffsRequest) returns (CloseAllDiffsResponse);
  23. // Display a diff view comparing before/after states for multiple files.
  24. // Content is passed as in-memory data, not read from the file system.
  25. rpc openMultiFileDiff(OpenMultiFileDiffRequest) returns (OpenMultiFileDiffResponse);
  26. }
  27. message OpenDiffRequest {
  28. optional cline.Metadata metadata = 1;
  29. // The absolute path of the document being edited.
  30. optional string path = 2;
  31. // The new content for the file.
  32. optional string content = 3;
  33. }
  34. message OpenDiffResponse {
  35. // A unique identifier for the diff view that was opened.
  36. optional string diff_id = 1;
  37. }
  38. message GetDocumentTextRequest {
  39. optional cline.Metadata metadata = 1;
  40. optional string diff_id = 2;
  41. }
  42. message GetDocumentTextResponse {
  43. optional string content = 1;
  44. }
  45. message ReplaceTextRequest {
  46. optional cline.Metadata metadata = 1;
  47. optional string diff_id = 2;
  48. optional string content = 3;
  49. optional int32 start_line = 4;
  50. optional int32 end_line = 5;
  51. }
  52. message ReplaceTextResponse {}
  53. message ScrollDiffRequest {
  54. optional string diff_id = 1;
  55. optional int32 line = 2;
  56. }
  57. message ScrollDiffResponse {}
  58. message TruncateDocumentRequest {
  59. optional cline.Metadata metadata = 1;
  60. optional string diff_id = 2;
  61. optional int32 end_line = 3;
  62. }
  63. message TruncateDocumentResponse {}
  64. message CloseAllDiffsRequest {}
  65. message CloseAllDiffsResponse {}
  66. message SaveDocumentRequest {
  67. optional cline.Metadata metadata = 1;
  68. optional string diff_id = 2;
  69. }
  70. message SaveDocumentResponse {}
  71. message OpenMultiFileDiffRequest {
  72. optional string title = 1;
  73. repeated ContentDiff diffs = 2;
  74. }
  75. message ContentDiff {
  76. // The absolute file path.
  77. optional string file_path = 1;
  78. optional string left_content = 2;
  79. optional string right_content = 3;
  80. }
  81. message OpenMultiFileDiffResponse {}