1syntax = "proto3";
2package zed.messages;
3
4// Looking for a number? Search "// Current max"
5
6message PeerId {
7 uint32 owner_id = 1;
8 uint32 id = 2;
9}
10
11message Envelope {
12 uint32 id = 1;
13 optional uint32 responding_to = 2;
14 optional PeerId original_sender_id = 3;
15
16 /*
17 When you are adding a new message type, instead of adding it in semantic order
18 and bumping the message ID's of everything that follows, add it at the end of the
19 file and bump the max number. See this
20 https://github.com/zed-industries/zed/pull/7890#discussion_r1496621823
21
22 */
23 oneof payload {
24 Hello hello = 4;
25 Ack ack = 5;
26 Error error = 6;
27 Ping ping = 7;
28 Test test = 8;
29
30 CreateRoom create_room = 9;
31 CreateRoomResponse create_room_response = 10;
32 JoinRoom join_room = 11;
33 JoinRoomResponse join_room_response = 12;
34 RejoinRoom rejoin_room = 13;
35 RejoinRoomResponse rejoin_room_response = 14;
36 LeaveRoom leave_room = 15;
37 Call call = 16;
38 IncomingCall incoming_call = 17;
39 CallCanceled call_canceled = 18;
40 CancelCall cancel_call = 19;
41 DeclineCall decline_call = 20;
42 UpdateParticipantLocation update_participant_location = 21;
43 RoomUpdated room_updated = 22;
44
45 ShareProject share_project = 23;
46 ShareProjectResponse share_project_response = 24;
47 UnshareProject unshare_project = 25;
48 JoinProject join_project = 26;
49 JoinProjectResponse join_project_response = 27;
50 LeaveProject leave_project = 28;
51 AddProjectCollaborator add_project_collaborator = 29;
52 UpdateProjectCollaborator update_project_collaborator = 30;
53 RemoveProjectCollaborator remove_project_collaborator = 31;
54
55 GetDefinition get_definition = 32;
56 GetDefinitionResponse get_definition_response = 33;
57 GetTypeDefinition get_type_definition = 34;
58 GetTypeDefinitionResponse get_type_definition_response = 35;
59
60 GetReferences get_references = 36;
61 GetReferencesResponse get_references_response = 37;
62 GetDocumentHighlights get_document_highlights = 38;
63 GetDocumentHighlightsResponse get_document_highlights_response = 39;
64 GetProjectSymbols get_project_symbols = 40;
65 GetProjectSymbolsResponse get_project_symbols_response = 41;
66 OpenBufferForSymbol open_buffer_for_symbol = 42;
67 OpenBufferForSymbolResponse open_buffer_for_symbol_response = 43;
68
69 UpdateProject update_project = 44;
70 UpdateWorktree update_worktree = 45;
71
72 CreateProjectEntry create_project_entry = 46;
73 RenameProjectEntry rename_project_entry = 47;
74 CopyProjectEntry copy_project_entry = 48;
75 DeleteProjectEntry delete_project_entry = 49;
76 ProjectEntryResponse project_entry_response = 50;
77 ExpandProjectEntry expand_project_entry = 51;
78 ExpandProjectEntryResponse expand_project_entry_response = 52;
79
80 UpdateDiagnosticSummary update_diagnostic_summary = 53;
81 StartLanguageServer start_language_server = 54;
82 UpdateLanguageServer update_language_server = 55;
83
84 OpenBufferById open_buffer_by_id = 56;
85 OpenBufferByPath open_buffer_by_path = 57;
86 OpenBufferResponse open_buffer_response = 58;
87 CreateBufferForPeer create_buffer_for_peer = 59;
88 UpdateBuffer update_buffer = 60;
89 UpdateBufferFile update_buffer_file = 61;
90 SaveBuffer save_buffer = 62;
91 BufferSaved buffer_saved = 63;
92 BufferReloaded buffer_reloaded = 64;
93 ReloadBuffers reload_buffers = 65;
94 ReloadBuffersResponse reload_buffers_response = 66;
95 SynchronizeBuffers synchronize_buffers = 67;
96 SynchronizeBuffersResponse synchronize_buffers_response = 68;
97 FormatBuffers format_buffers = 69;
98 FormatBuffersResponse format_buffers_response = 70;
99 GetCompletions get_completions = 71;
100 GetCompletionsResponse get_completions_response = 72;
101 ResolveCompletionDocumentation resolve_completion_documentation = 73;
102 ResolveCompletionDocumentationResponse resolve_completion_documentation_response = 74;
103 ApplyCompletionAdditionalEdits apply_completion_additional_edits = 75;
104 ApplyCompletionAdditionalEditsResponse apply_completion_additional_edits_response = 76;
105 GetCodeActions get_code_actions = 77;
106 GetCodeActionsResponse get_code_actions_response = 78;
107 GetHover get_hover = 79;
108 GetHoverResponse get_hover_response = 80;
109 ApplyCodeAction apply_code_action = 81;
110 ApplyCodeActionResponse apply_code_action_response = 82;
111 PrepareRename prepare_rename = 83;
112 PrepareRenameResponse prepare_rename_response = 84;
113 PerformRename perform_rename = 85;
114 PerformRenameResponse perform_rename_response = 86;
115 SearchProject search_project = 87;
116 SearchProjectResponse search_project_response = 88;
117
118 UpdateContacts update_contacts = 89;
119 UpdateInviteInfo update_invite_info = 90;
120 ShowContacts show_contacts = 91;
121
122 GetUsers get_users = 92;
123 FuzzySearchUsers fuzzy_search_users = 93;
124 UsersResponse users_response = 94;
125 RequestContact request_contact = 95;
126 RespondToContactRequest respond_to_contact_request = 96;
127 RemoveContact remove_contact = 97;
128
129 Follow follow = 98;
130 FollowResponse follow_response = 99;
131 UpdateFollowers update_followers = 100;
132 Unfollow unfollow = 101;
133 GetPrivateUserInfo get_private_user_info = 102;
134 GetPrivateUserInfoResponse get_private_user_info_response = 103;
135 UpdateDiffBase update_diff_base = 104;
136
137 OnTypeFormatting on_type_formatting = 105;
138 OnTypeFormattingResponse on_type_formatting_response = 106;
139
140 UpdateWorktreeSettings update_worktree_settings = 107;
141
142 InlayHints inlay_hints = 108;
143 InlayHintsResponse inlay_hints_response = 109;
144 ResolveInlayHint resolve_inlay_hint = 110;
145 ResolveInlayHintResponse resolve_inlay_hint_response = 111;
146 RefreshInlayHints refresh_inlay_hints = 112;
147
148 CreateChannel create_channel = 113;
149 CreateChannelResponse create_channel_response = 114;
150 InviteChannelMember invite_channel_member = 115;
151 RemoveChannelMember remove_channel_member = 116;
152 RespondToChannelInvite respond_to_channel_invite = 117;
153 UpdateChannels update_channels = 118;
154 JoinChannel join_channel = 119;
155 DeleteChannel delete_channel = 120;
156 GetChannelMembers get_channel_members = 121;
157 GetChannelMembersResponse get_channel_members_response = 122;
158 SetChannelMemberRole set_channel_member_role = 123;
159 RenameChannel rename_channel = 124;
160 RenameChannelResponse rename_channel_response = 125;
161
162 JoinChannelBuffer join_channel_buffer = 126;
163 JoinChannelBufferResponse join_channel_buffer_response = 127;
164 UpdateChannelBuffer update_channel_buffer = 128;
165 LeaveChannelBuffer leave_channel_buffer = 129;
166 UpdateChannelBufferCollaborators update_channel_buffer_collaborators = 130;
167 RejoinChannelBuffers rejoin_channel_buffers = 131;
168 RejoinChannelBuffersResponse rejoin_channel_buffers_response = 132;
169 AckBufferOperation ack_buffer_operation = 133;
170
171 JoinChannelChat join_channel_chat = 134;
172 JoinChannelChatResponse join_channel_chat_response = 135;
173 LeaveChannelChat leave_channel_chat = 136;
174 SendChannelMessage send_channel_message = 137;
175 SendChannelMessageResponse send_channel_message_response = 138;
176 ChannelMessageSent channel_message_sent = 139;
177 GetChannelMessages get_channel_messages = 140;
178 GetChannelMessagesResponse get_channel_messages_response = 141;
179 RemoveChannelMessage remove_channel_message = 142;
180 AckChannelMessage ack_channel_message = 143;
181 GetChannelMessagesById get_channel_messages_by_id = 144;
182
183 MoveChannel move_channel = 147;
184 SetChannelVisibility set_channel_visibility = 148;
185
186 AddNotification add_notification = 149;
187 GetNotifications get_notifications = 150;
188 GetNotificationsResponse get_notifications_response = 151;
189 DeleteNotification delete_notification = 152;
190 MarkNotificationRead mark_notification_read = 153;
191 LspExtExpandMacro lsp_ext_expand_macro = 154;
192 LspExtExpandMacroResponse lsp_ext_expand_macro_response = 155;
193 SetRoomParticipantRole set_room_participant_role = 156;
194
195 UpdateUserChannels update_user_channels = 157;
196
197 GetImplementation get_implementation = 162;
198 GetImplementationResponse get_implementation_response = 163;
199
200 JoinHostedProject join_hosted_project = 164;
201 }
202
203 reserved 158 to 161;
204}
205
206// Messages
207
208message Hello {
209 PeerId peer_id = 1;
210}
211
212message Ping {}
213
214message Ack {}
215
216message Error {
217 string message = 1;
218 ErrorCode code = 2;
219 repeated string tags = 3;
220}
221
222enum ErrorCode {
223 Internal = 0;
224 NoSuchChannel = 1;
225 Disconnected = 2;
226 SignedOut = 3;
227 UpgradeRequired = 4;
228 Forbidden = 5;
229 NeedsCla = 7;
230 NotARootChannel = 8;
231 BadPublicNesting = 9;
232 CircularNesting = 10;
233 WrongMoveTarget = 11;
234 UnsharedItem = 12;
235 NoSuchProject = 13;
236 reserved 6;
237}
238
239message Test {
240 uint64 id = 1;
241}
242
243message CreateRoom {}
244
245message CreateRoomResponse {
246 Room room = 1;
247 optional LiveKitConnectionInfo live_kit_connection_info = 2;
248}
249
250message JoinRoom {
251 uint64 id = 1;
252}
253
254message JoinRoomResponse {
255 Room room = 1;
256 optional uint64 channel_id = 2;
257 optional LiveKitConnectionInfo live_kit_connection_info = 3;
258}
259
260message RejoinRoom {
261 uint64 id = 1;
262 repeated UpdateProject reshared_projects = 2;
263 repeated RejoinProject rejoined_projects = 3;
264}
265
266message RejoinProject {
267 uint64 id = 1;
268 repeated RejoinWorktree worktrees = 2;
269}
270
271message RejoinWorktree {
272 uint64 id = 1;
273 uint64 scan_id = 2;
274}
275
276message RejoinRoomResponse {
277 Room room = 1;
278 repeated ResharedProject reshared_projects = 2;
279 repeated RejoinedProject rejoined_projects = 3;
280}
281
282message ResharedProject {
283 uint64 id = 1;
284 repeated Collaborator collaborators = 2;
285}
286
287message RejoinedProject {
288 uint64 id = 1;
289 repeated WorktreeMetadata worktrees = 2;
290 repeated Collaborator collaborators = 3;
291 repeated LanguageServer language_servers = 4;
292}
293
294message LeaveRoom {}
295
296message Room {
297 uint64 id = 1;
298 repeated Participant participants = 2;
299 repeated PendingParticipant pending_participants = 3;
300 repeated Follower followers = 4;
301 string live_kit_room = 5;
302}
303
304message Participant {
305 uint64 user_id = 1;
306 PeerId peer_id = 2;
307 repeated ParticipantProject projects = 3;
308 ParticipantLocation location = 4;
309 uint32 participant_index = 5;
310 ChannelRole role = 6;
311 reserved 7;
312}
313
314message PendingParticipant {
315 uint64 user_id = 1;
316 uint64 calling_user_id = 2;
317 optional uint64 initial_project_id = 3;
318}
319
320message ParticipantProject {
321 uint64 id = 1;
322 repeated string worktree_root_names = 2;
323}
324
325message Follower {
326 PeerId leader_id = 1;
327 PeerId follower_id = 2;
328 uint64 project_id = 3;
329}
330
331message ParticipantLocation {
332 oneof variant {
333 SharedProject shared_project = 1;
334 UnsharedProject unshared_project = 2;
335 External external = 3;
336 }
337
338 message SharedProject {
339 uint64 id = 1;
340 }
341
342 message UnsharedProject {}
343
344 message External {}
345}
346
347message Call {
348 uint64 room_id = 1;
349 uint64 called_user_id = 2;
350 optional uint64 initial_project_id = 3;
351}
352
353message IncomingCall {
354 uint64 room_id = 1;
355 uint64 calling_user_id = 2;
356 repeated uint64 participant_user_ids = 3;
357 optional ParticipantProject initial_project = 4;
358}
359
360message CallCanceled {
361 uint64 room_id = 1;
362}
363
364message CancelCall {
365 uint64 room_id = 1;
366 uint64 called_user_id = 2;
367}
368
369message DeclineCall {
370 uint64 room_id = 1;
371}
372
373message UpdateParticipantLocation {
374 uint64 room_id = 1;
375 ParticipantLocation location = 2;
376}
377
378message RoomUpdated {
379 Room room = 1;
380}
381
382message LiveKitConnectionInfo {
383 string server_url = 1;
384 string token = 2;
385 bool can_publish = 3;
386}
387
388message ShareProject {
389 uint64 room_id = 1;
390 repeated WorktreeMetadata worktrees = 2;
391}
392
393message ShareProjectResponse {
394 uint64 project_id = 1;
395}
396
397message UnshareProject {
398 uint64 project_id = 1;
399}
400
401message UpdateProject {
402 uint64 project_id = 1;
403 repeated WorktreeMetadata worktrees = 2;
404}
405
406message JoinProject {
407 uint64 project_id = 1;
408}
409
410message JoinHostedProject {
411 uint64 id = 1;
412}
413
414message JoinProjectResponse {
415 uint64 project_id = 5;
416 uint32 replica_id = 1;
417 repeated WorktreeMetadata worktrees = 2;
418 repeated Collaborator collaborators = 3;
419 repeated LanguageServer language_servers = 4;
420 ChannelRole role = 6;
421}
422
423message LeaveProject {
424 uint64 project_id = 1;
425}
426
427message UpdateWorktree {
428 uint64 project_id = 1;
429 uint64 worktree_id = 2;
430 string root_name = 3;
431 repeated Entry updated_entries = 4;
432 repeated uint64 removed_entries = 5;
433 repeated RepositoryEntry updated_repositories = 6;
434 repeated uint64 removed_repositories = 7;
435 uint64 scan_id = 8;
436 bool is_last_update = 9;
437 string abs_path = 10;
438}
439
440message UpdateWorktreeSettings {
441 uint64 project_id = 1;
442 uint64 worktree_id = 2;
443 string path = 3;
444 optional string content = 4;
445}
446
447message CreateProjectEntry {
448 uint64 project_id = 1;
449 uint64 worktree_id = 2;
450 string path = 3;
451 bool is_directory = 4;
452}
453
454message RenameProjectEntry {
455 uint64 project_id = 1;
456 uint64 entry_id = 2;
457 string new_path = 3;
458}
459
460message CopyProjectEntry {
461 uint64 project_id = 1;
462 uint64 entry_id = 2;
463 string new_path = 3;
464}
465
466message DeleteProjectEntry {
467 uint64 project_id = 1;
468 uint64 entry_id = 2;
469}
470
471message ExpandProjectEntry {
472 uint64 project_id = 1;
473 uint64 entry_id = 2;
474}
475
476message ExpandProjectEntryResponse {
477 uint64 worktree_scan_id = 1;
478}
479
480message ProjectEntryResponse {
481 optional Entry entry = 1;
482 uint64 worktree_scan_id = 2;
483}
484
485message AddProjectCollaborator {
486 uint64 project_id = 1;
487 Collaborator collaborator = 2;
488}
489
490message UpdateProjectCollaborator {
491 uint64 project_id = 1;
492 PeerId old_peer_id = 2;
493 PeerId new_peer_id = 3;
494}
495
496message RemoveProjectCollaborator {
497 uint64 project_id = 1;
498 PeerId peer_id = 2;
499}
500
501message UpdateChannelBufferCollaborators {
502 uint64 channel_id = 1;
503 repeated Collaborator collaborators = 2;
504}
505
506message GetDefinition {
507 uint64 project_id = 1;
508 uint64 buffer_id = 2;
509 Anchor position = 3;
510 repeated VectorClockEntry version = 4;
511 }
512
513message GetDefinitionResponse {
514 repeated LocationLink links = 1;
515}
516
517message GetTypeDefinition {
518 uint64 project_id = 1;
519 uint64 buffer_id = 2;
520 Anchor position = 3;
521 repeated VectorClockEntry version = 4;
522 }
523
524message GetTypeDefinitionResponse {
525 repeated LocationLink links = 1;
526}
527message GetImplementation {
528 uint64 project_id = 1;
529 uint64 buffer_id = 2;
530 Anchor position = 3;
531 repeated VectorClockEntry version = 4;
532 }
533
534message GetImplementationResponse {
535 repeated LocationLink links = 1;
536}
537
538message GetReferences {
539 uint64 project_id = 1;
540 uint64 buffer_id = 2;
541 Anchor position = 3;
542 repeated VectorClockEntry version = 4;
543 }
544
545message GetReferencesResponse {
546 repeated Location locations = 1;
547}
548
549message GetDocumentHighlights {
550 uint64 project_id = 1;
551 uint64 buffer_id = 2;
552 Anchor position = 3;
553 repeated VectorClockEntry version = 4;
554 }
555
556message GetDocumentHighlightsResponse {
557 repeated DocumentHighlight highlights = 1;
558}
559
560message Location {
561 uint64 buffer_id = 1;
562 Anchor start = 2;
563 Anchor end = 3;
564}
565
566message LocationLink {
567 optional Location origin = 1;
568 Location target = 2;
569}
570
571message DocumentHighlight {
572 Kind kind = 1;
573 Anchor start = 2;
574 Anchor end = 3;
575
576 enum Kind {
577 Text = 0;
578 Read = 1;
579 Write = 2;
580 }
581}
582
583message GetProjectSymbols {
584 uint64 project_id = 1;
585 string query = 2;
586}
587
588message GetProjectSymbolsResponse {
589 repeated Symbol symbols = 4;
590}
591
592message Symbol {
593 uint64 source_worktree_id = 1;
594 uint64 worktree_id = 2;
595 string language_server_name = 3;
596 string name = 4;
597 int32 kind = 5;
598 string path = 6;
599 // Cannot use generate anchors for unopened files,
600 // so we are forced to use point coords instead
601 PointUtf16 start = 7;
602 PointUtf16 end = 8;
603 bytes signature = 9;
604}
605
606message OpenBufferForSymbol {
607 uint64 project_id = 1;
608 Symbol symbol = 2;
609}
610
611message OpenBufferForSymbolResponse {
612 uint64 buffer_id = 1;
613}
614
615message OpenBufferByPath {
616 uint64 project_id = 1;
617 uint64 worktree_id = 2;
618 string path = 3;
619}
620
621message OpenBufferById {
622 uint64 project_id = 1;
623 uint64 id = 2;
624}
625
626message OpenBufferResponse {
627 uint64 buffer_id = 1;
628}
629
630message CreateBufferForPeer {
631 uint64 project_id = 1;
632 PeerId peer_id = 2;
633 oneof variant {
634 BufferState state = 3;
635 BufferChunk chunk = 4;
636 }
637}
638
639message UpdateBuffer {
640 uint64 project_id = 1;
641 uint64 buffer_id = 2;
642 repeated Operation operations = 3;
643}
644
645message UpdateChannelBuffer {
646 uint64 channel_id = 1;
647 repeated Operation operations = 2;
648}
649
650message UpdateBufferFile {
651 uint64 project_id = 1;
652 uint64 buffer_id = 2;
653 File file = 3;
654}
655
656message SaveBuffer {
657 uint64 project_id = 1;
658 uint64 buffer_id = 2;
659 repeated VectorClockEntry version = 3;
660}
661
662message BufferSaved {
663 uint64 project_id = 1;
664 uint64 buffer_id = 2;
665 repeated VectorClockEntry version = 3;
666 Timestamp mtime = 4;
667 string fingerprint = 5;
668}
669
670message BufferReloaded {
671 uint64 project_id = 1;
672 uint64 buffer_id = 2;
673 repeated VectorClockEntry version = 3;
674 Timestamp mtime = 4;
675 string fingerprint = 5;
676 LineEnding line_ending = 6;
677}
678
679message ReloadBuffers {
680 uint64 project_id = 1;
681 repeated uint64 buffer_ids = 2;
682}
683
684message ReloadBuffersResponse {
685 ProjectTransaction transaction = 1;
686}
687
688message SynchronizeBuffers {
689 uint64 project_id = 1;
690 repeated BufferVersion buffers = 2;
691}
692
693message SynchronizeBuffersResponse {
694 repeated BufferVersion buffers = 1;
695}
696
697message BufferVersion {
698 uint64 id = 1;
699 repeated VectorClockEntry version = 2;
700}
701
702message ChannelBufferVersion {
703 uint64 channel_id = 1;
704 repeated VectorClockEntry version = 2;
705 uint64 epoch = 3;
706}
707
708enum FormatTrigger {
709 Save = 0;
710 Manual = 1;
711}
712
713message FormatBuffers {
714 uint64 project_id = 1;
715 FormatTrigger trigger = 2;
716 repeated uint64 buffer_ids = 3;
717}
718
719message FormatBuffersResponse {
720 ProjectTransaction transaction = 1;
721}
722
723message GetCompletions {
724 uint64 project_id = 1;
725 uint64 buffer_id = 2;
726 Anchor position = 3;
727 repeated VectorClockEntry version = 4;
728}
729
730message GetCompletionsResponse {
731 repeated Completion completions = 1;
732 repeated VectorClockEntry version = 2;
733}
734
735message ApplyCompletionAdditionalEdits {
736 uint64 project_id = 1;
737 uint64 buffer_id = 2;
738 Completion completion = 3;
739}
740
741message ApplyCompletionAdditionalEditsResponse {
742 Transaction transaction = 1;
743}
744
745message Completion {
746 Anchor old_start = 1;
747 Anchor old_end = 2;
748 string new_text = 3;
749 uint64 server_id = 4;
750 bytes lsp_completion = 5;
751}
752
753message GetCodeActions {
754 uint64 project_id = 1;
755 uint64 buffer_id = 2;
756 Anchor start = 3;
757 Anchor end = 4;
758 repeated VectorClockEntry version = 5;
759}
760
761message GetCodeActionsResponse {
762 repeated CodeAction actions = 1;
763 repeated VectorClockEntry version = 2;
764}
765
766message GetHover {
767 uint64 project_id = 1;
768 uint64 buffer_id = 2;
769 Anchor position = 3;
770 repeated VectorClockEntry version = 5;
771}
772
773message GetHoverResponse {
774 optional Anchor start = 1;
775 optional Anchor end = 2;
776 repeated HoverBlock contents = 3;
777}
778
779message HoverBlock {
780 string text = 1;
781 optional string language = 2;
782 bool is_markdown = 3;
783}
784
785message ApplyCodeAction {
786 uint64 project_id = 1;
787 uint64 buffer_id = 2;
788 CodeAction action = 3;
789}
790
791message ApplyCodeActionResponse {
792 ProjectTransaction transaction = 1;
793}
794
795message PrepareRename {
796 uint64 project_id = 1;
797 uint64 buffer_id = 2;
798 Anchor position = 3;
799 repeated VectorClockEntry version = 4;
800}
801
802message PrepareRenameResponse {
803 bool can_rename = 1;
804 Anchor start = 2;
805 Anchor end = 3;
806 repeated VectorClockEntry version = 4;
807}
808
809message PerformRename {
810 uint64 project_id = 1;
811 uint64 buffer_id = 2;
812 Anchor position = 3;
813 string new_name = 4;
814 repeated VectorClockEntry version = 5;
815}
816
817message OnTypeFormatting {
818 uint64 project_id = 1;
819 uint64 buffer_id = 2;
820 Anchor position = 3;
821 string trigger = 4;
822 repeated VectorClockEntry version = 5;
823}
824
825message OnTypeFormattingResponse {
826 Transaction transaction = 1;
827}
828
829message InlayHints {
830 uint64 project_id = 1;
831 uint64 buffer_id = 2;
832 Anchor start = 3;
833 Anchor end = 4;
834 repeated VectorClockEntry version = 5;
835}
836
837message InlayHintsResponse {
838 repeated InlayHint hints = 1;
839 repeated VectorClockEntry version = 2;
840}
841
842message InlayHint {
843 Anchor position = 1;
844 InlayHintLabel label = 2;
845 optional string kind = 3;
846 bool padding_left = 4;
847 bool padding_right = 5;
848 InlayHintTooltip tooltip = 6;
849 ResolveState resolve_state = 7;
850}
851
852message InlayHintLabel {
853 oneof label {
854 string value = 1;
855 InlayHintLabelParts label_parts = 2;
856 }
857}
858
859message InlayHintLabelParts {
860 repeated InlayHintLabelPart parts = 1;
861}
862
863message InlayHintLabelPart {
864 string value = 1;
865 InlayHintLabelPartTooltip tooltip = 2;
866 optional string location_url = 3;
867 PointUtf16 location_range_start = 4;
868 PointUtf16 location_range_end = 5;
869 optional uint64 language_server_id = 6;
870}
871
872message InlayHintTooltip {
873 oneof content {
874 string value = 1;
875 MarkupContent markup_content = 2;
876 }
877}
878
879message InlayHintLabelPartTooltip {
880 oneof content {
881 string value = 1;
882 MarkupContent markup_content = 2;
883 }
884}
885
886message ResolveState {
887 State state = 1;
888 LspResolveState lsp_resolve_state = 2;
889
890 enum State {
891 Resolved = 0;
892 CanResolve = 1;
893 Resolving = 2;
894 }
895
896 message LspResolveState {
897 string value = 1;
898 uint64 server_id = 2;
899 }
900}
901
902message ResolveCompletionDocumentation {
903 uint64 project_id = 1;
904 uint64 language_server_id = 2;
905 bytes lsp_completion = 3;
906}
907
908message ResolveCompletionDocumentationResponse {
909 string text = 1;
910 bool is_markdown = 2;
911}
912
913message ResolveInlayHint {
914 uint64 project_id = 1;
915 uint64 buffer_id = 2;
916 uint64 language_server_id = 3;
917 InlayHint hint = 4;
918}
919
920message ResolveInlayHintResponse {
921 InlayHint hint = 1;
922}
923
924message RefreshInlayHints {
925 uint64 project_id = 1;
926}
927
928message MarkupContent {
929 bool is_markdown = 1;
930 string value = 2;
931}
932
933message PerformRenameResponse {
934 ProjectTransaction transaction = 2;
935}
936
937message SearchProject {
938 uint64 project_id = 1;
939 string query = 2;
940 bool regex = 3;
941 bool whole_word = 4;
942 bool case_sensitive = 5;
943 string files_to_include = 6;
944 string files_to_exclude = 7;
945 bool include_ignored = 8;
946}
947
948message SearchProjectResponse {
949 repeated Location locations = 1;
950}
951
952message CodeAction {
953 uint64 server_id = 1;
954 Anchor start = 2;
955 Anchor end = 3;
956 bytes lsp_action = 4;
957}
958
959message ProjectTransaction {
960 repeated uint64 buffer_ids = 1;
961 repeated Transaction transactions = 2;
962}
963
964message Transaction {
965 LamportTimestamp id = 1;
966 repeated LamportTimestamp edit_ids = 2;
967 repeated VectorClockEntry start = 3;
968}
969
970message LamportTimestamp {
971 uint32 replica_id = 1;
972 uint32 value = 2;
973}
974
975message LanguageServer {
976 uint64 id = 1;
977 string name = 2;
978}
979
980message StartLanguageServer {
981 uint64 project_id = 1;
982 LanguageServer server = 2;
983}
984
985message UpdateDiagnosticSummary {
986 uint64 project_id = 1;
987 uint64 worktree_id = 2;
988 DiagnosticSummary summary = 3;
989}
990
991message DiagnosticSummary {
992 string path = 1;
993 uint64 language_server_id = 2;
994 uint32 error_count = 3;
995 uint32 warning_count = 4;
996}
997
998message UpdateLanguageServer {
999 uint64 project_id = 1;
1000 uint64 language_server_id = 2;
1001 oneof variant {
1002 LspWorkStart work_start = 3;
1003 LspWorkProgress work_progress = 4;
1004 LspWorkEnd work_end = 5;
1005 LspDiskBasedDiagnosticsUpdating disk_based_diagnostics_updating = 6;
1006 LspDiskBasedDiagnosticsUpdated disk_based_diagnostics_updated = 7;
1007 }
1008}
1009
1010message LspWorkStart {
1011 string token = 1;
1012 optional string message = 2;
1013 optional uint32 percentage = 3;
1014}
1015
1016message LspWorkProgress {
1017 string token = 1;
1018 optional string message = 2;
1019 optional uint32 percentage = 3;
1020}
1021
1022message LspWorkEnd {
1023 string token = 1;
1024}
1025
1026message LspDiskBasedDiagnosticsUpdating {}
1027
1028message LspDiskBasedDiagnosticsUpdated {}
1029
1030message UpdateChannels {
1031 repeated Channel channels = 1;
1032 repeated uint64 delete_channels = 4;
1033 repeated Channel channel_invitations = 5;
1034 repeated uint64 remove_channel_invitations = 6;
1035 repeated ChannelParticipants channel_participants = 7;
1036 repeated ChannelMessageId latest_channel_message_ids = 8;
1037 repeated ChannelBufferVersion latest_channel_buffer_versions = 9;
1038
1039 repeated HostedProject hosted_projects = 10;
1040 repeated uint64 deleted_hosted_projects = 11;
1041}
1042
1043message UpdateUserChannels {
1044 repeated ChannelMessageId observed_channel_message_id = 1;
1045 repeated ChannelBufferVersion observed_channel_buffer_version = 2;
1046 repeated ChannelMembership channel_memberships = 3;
1047}
1048
1049message ChannelMembership {
1050 uint64 channel_id = 1;
1051 ChannelRole role = 2;
1052}
1053
1054message ChannelMessageId {
1055 uint64 channel_id = 1;
1056 uint64 message_id = 2;
1057}
1058
1059message ChannelPermission {
1060 uint64 channel_id = 1;
1061 ChannelRole role = 3;
1062}
1063
1064message ChannelParticipants {
1065 uint64 channel_id = 1;
1066 repeated uint64 participant_user_ids = 2;
1067}
1068
1069message HostedProject {
1070 uint64 id = 1;
1071 uint64 channel_id = 2;
1072 string name = 3;
1073 ChannelVisibility visibility = 4;
1074}
1075
1076message JoinChannel {
1077 uint64 channel_id = 1;
1078}
1079
1080message DeleteChannel {
1081 uint64 channel_id = 1;
1082}
1083
1084message GetChannelMembers {
1085 uint64 channel_id = 1;
1086}
1087
1088message GetChannelMembersResponse {
1089 repeated ChannelMember members = 1;
1090}
1091
1092message ChannelMember {
1093 uint64 user_id = 1;
1094 Kind kind = 3;
1095 ChannelRole role = 4;
1096
1097 enum Kind {
1098 Member = 0;
1099 Invitee = 1;
1100 }
1101}
1102
1103message CreateChannel {
1104 string name = 1;
1105 optional uint64 parent_id = 2;
1106}
1107
1108message CreateChannelResponse {
1109 Channel channel = 1;
1110 optional uint64 parent_id = 2;
1111}
1112
1113message InviteChannelMember {
1114 uint64 channel_id = 1;
1115 uint64 user_id = 2;
1116 ChannelRole role = 4;
1117}
1118
1119message RemoveChannelMember {
1120 uint64 channel_id = 1;
1121 uint64 user_id = 2;
1122}
1123
1124enum ChannelRole {
1125 Admin = 0;
1126 Member = 1;
1127 Guest = 2;
1128 Banned = 3;
1129 Talker = 4;
1130}
1131
1132message SetChannelMemberRole {
1133 uint64 channel_id = 1;
1134 uint64 user_id = 2;
1135 ChannelRole role = 3;
1136}
1137
1138message SetChannelVisibility {
1139 uint64 channel_id = 1;
1140 ChannelVisibility visibility = 2;
1141}
1142
1143message RenameChannel {
1144 uint64 channel_id = 1;
1145 string name = 2;
1146}
1147
1148message RenameChannelResponse {
1149 Channel channel = 1;
1150}
1151
1152message JoinChannelChat {
1153 uint64 channel_id = 1;
1154}
1155
1156message JoinChannelChatResponse {
1157 repeated ChannelMessage messages = 1;
1158 bool done = 2;
1159}
1160
1161message LeaveChannelChat {
1162 uint64 channel_id = 1;
1163}
1164
1165message SendChannelMessage {
1166 uint64 channel_id = 1;
1167 string body = 2;
1168 Nonce nonce = 3;
1169 repeated ChatMention mentions = 4;
1170 optional uint64 reply_to_message_id = 5;
1171}
1172
1173message RemoveChannelMessage {
1174 uint64 channel_id = 1;
1175 uint64 message_id = 2;
1176}
1177
1178message AckChannelMessage {
1179 uint64 channel_id = 1;
1180 uint64 message_id = 2;
1181}
1182
1183message SendChannelMessageResponse {
1184 ChannelMessage message = 1;
1185}
1186
1187message ChannelMessageSent {
1188 uint64 channel_id = 1;
1189 ChannelMessage message = 2;
1190}
1191
1192message GetChannelMessages {
1193 uint64 channel_id = 1;
1194 uint64 before_message_id = 2;
1195}
1196
1197message GetChannelMessagesResponse {
1198 repeated ChannelMessage messages = 1;
1199 bool done = 2;
1200}
1201
1202message GetChannelMessagesById {
1203 repeated uint64 message_ids = 1;
1204}
1205
1206message MoveChannel {
1207 uint64 channel_id = 1;
1208 uint64 to = 2;
1209}
1210
1211message JoinChannelBuffer {
1212 uint64 channel_id = 1;
1213}
1214
1215message ChannelMessage {
1216 uint64 id = 1;
1217 string body = 2;
1218 uint64 timestamp = 3;
1219 uint64 sender_id = 4;
1220 Nonce nonce = 5;
1221 repeated ChatMention mentions = 6;
1222 optional uint64 reply_to_message_id = 7;
1223}
1224
1225message ChatMention {
1226 Range range = 1;
1227 uint64 user_id = 2;
1228}
1229
1230message RejoinChannelBuffers {
1231 repeated ChannelBufferVersion buffers = 1;
1232}
1233
1234message RejoinChannelBuffersResponse {
1235 repeated RejoinedChannelBuffer buffers = 1;
1236}
1237
1238message AckBufferOperation {
1239 uint64 buffer_id = 1;
1240 uint64 epoch = 2;
1241 repeated VectorClockEntry version = 3;
1242}
1243
1244message JoinChannelBufferResponse {
1245 uint64 buffer_id = 1;
1246 uint32 replica_id = 2;
1247 string base_text = 3;
1248 repeated Operation operations = 4;
1249 repeated Collaborator collaborators = 5;
1250 uint64 epoch = 6;
1251}
1252
1253message RejoinedChannelBuffer {
1254 uint64 channel_id = 1;
1255 repeated VectorClockEntry version = 2;
1256 repeated Operation operations = 3;
1257 repeated Collaborator collaborators = 4;
1258}
1259
1260message LeaveChannelBuffer {
1261 uint64 channel_id = 1;
1262}
1263
1264message RespondToChannelInvite {
1265 uint64 channel_id = 1;
1266 bool accept = 2;
1267}
1268
1269message GetUsers {
1270 repeated uint64 user_ids = 1;
1271}
1272
1273message FuzzySearchUsers {
1274 string query = 1;
1275}
1276
1277message UsersResponse {
1278 repeated User users = 1;
1279}
1280
1281message RequestContact {
1282 uint64 responder_id = 1;
1283}
1284
1285message RemoveContact {
1286 uint64 user_id = 1;
1287}
1288
1289message RespondToContactRequest {
1290 uint64 requester_id = 1;
1291 ContactRequestResponse response = 2;
1292}
1293
1294enum ContactRequestResponse {
1295 Accept = 0;
1296 Decline = 1;
1297 Block = 2;
1298 Dismiss = 3;
1299}
1300
1301message UpdateContacts {
1302 repeated Contact contacts = 1;
1303 repeated uint64 remove_contacts = 2;
1304 repeated IncomingContactRequest incoming_requests = 3;
1305 repeated uint64 remove_incoming_requests = 4;
1306 repeated uint64 outgoing_requests = 5;
1307 repeated uint64 remove_outgoing_requests = 6;
1308}
1309
1310message UpdateInviteInfo {
1311 string url = 1;
1312 uint32 count = 2;
1313}
1314
1315message ShowContacts {}
1316
1317message IncomingContactRequest {
1318 uint64 requester_id = 1;
1319}
1320
1321message UpdateDiagnostics {
1322 uint32 replica_id = 1;
1323 uint32 lamport_timestamp = 2;
1324 uint64 server_id = 3;
1325 repeated Diagnostic diagnostics = 4;
1326}
1327
1328message Follow {
1329 uint64 room_id = 1;
1330 optional uint64 project_id = 2;
1331 PeerId leader_id = 3;
1332}
1333
1334message FollowResponse {
1335 View active_view = 3;
1336 // TODO: after 0.124.0 is retired, remove these.
1337 optional ViewId active_view_id = 1;
1338 repeated View views = 2;
1339}
1340
1341message UpdateFollowers {
1342 uint64 room_id = 1;
1343 optional uint64 project_id = 2;
1344 reserved 3;
1345 oneof variant {
1346 View create_view = 5;
1347 // TODO: after 0.124.0 is retired, remove these.
1348 UpdateActiveView update_active_view = 4;
1349 UpdateView update_view = 6;
1350 }
1351}
1352
1353message Unfollow {
1354 uint64 room_id = 1;
1355 optional uint64 project_id = 2;
1356 PeerId leader_id = 3;
1357}
1358
1359message GetPrivateUserInfo {}
1360
1361message GetPrivateUserInfoResponse {
1362 string metrics_id = 1;
1363 bool staff = 2;
1364 repeated string flags = 3;
1365}
1366
1367// Entities
1368
1369message ViewId {
1370 PeerId creator = 1;
1371 uint64 id = 2;
1372}
1373
1374message UpdateActiveView {
1375 optional ViewId id = 1;
1376 optional PeerId leader_id = 2;
1377 View view = 3;
1378}
1379
1380message UpdateView {
1381 ViewId id = 1;
1382 optional PeerId leader_id = 2;
1383
1384 oneof variant {
1385 Editor editor = 3;
1386 }
1387
1388 message Editor {
1389 repeated ExcerptInsertion inserted_excerpts = 1;
1390 repeated uint64 deleted_excerpts = 2;
1391 repeated Selection selections = 3;
1392 optional Selection pending_selection = 4;
1393 EditorAnchor scroll_top_anchor = 5;
1394 float scroll_x = 6;
1395 float scroll_y = 7;
1396 }
1397}
1398
1399message View {
1400 ViewId id = 1;
1401 optional PeerId leader_id = 2;
1402
1403 oneof variant {
1404 Editor editor = 3;
1405 ChannelView channel_view = 4;
1406 }
1407
1408 message Editor {
1409 bool singleton = 1;
1410 optional string title = 2;
1411 repeated Excerpt excerpts = 3;
1412 repeated Selection selections = 4;
1413 optional Selection pending_selection = 5;
1414 EditorAnchor scroll_top_anchor = 6;
1415 float scroll_x = 7;
1416 float scroll_y = 8;
1417 }
1418
1419 message ChannelView {
1420 uint64 channel_id = 1;
1421 Editor editor = 2;
1422 }
1423}
1424
1425message Collaborator {
1426 PeerId peer_id = 1;
1427 uint32 replica_id = 2;
1428 uint64 user_id = 3;
1429}
1430
1431message User {
1432 uint64 id = 1;
1433 string github_login = 2;
1434 string avatar_url = 3;
1435}
1436
1437message File {
1438 uint64 worktree_id = 1;
1439 optional uint64 entry_id = 2;
1440 string path = 3;
1441 Timestamp mtime = 4;
1442 bool is_deleted = 5;
1443}
1444
1445message Entry {
1446 uint64 id = 1;
1447 bool is_dir = 2;
1448 string path = 3;
1449 uint64 inode = 4;
1450 Timestamp mtime = 5;
1451 bool is_symlink = 6;
1452 bool is_ignored = 7;
1453 bool is_external = 8;
1454 optional GitStatus git_status = 9;
1455}
1456
1457message RepositoryEntry {
1458 uint64 work_directory_id = 1;
1459 optional string branch = 2;
1460}
1461
1462message StatusEntry {
1463 string repo_path = 1;
1464 GitStatus status = 2;
1465}
1466
1467enum GitStatus {
1468 Added = 0;
1469 Modified = 1;
1470 Conflict = 2;
1471}
1472
1473message BufferState {
1474 uint64 id = 1;
1475 optional File file = 2;
1476 string base_text = 3;
1477 optional string diff_base = 4;
1478 LineEnding line_ending = 5;
1479 repeated VectorClockEntry saved_version = 6;
1480 string saved_version_fingerprint = 7;
1481 Timestamp saved_mtime = 8;
1482}
1483
1484message BufferChunk {
1485 uint64 buffer_id = 1;
1486 repeated Operation operations = 2;
1487 bool is_last = 3;
1488}
1489
1490enum LineEnding {
1491 Unix = 0;
1492 Windows = 1;
1493}
1494
1495message Selection {
1496 uint64 id = 1;
1497 EditorAnchor start = 2;
1498 EditorAnchor end = 3;
1499 bool reversed = 4;
1500}
1501
1502message EditorAnchor {
1503 uint64 excerpt_id = 1;
1504 Anchor anchor = 2;
1505}
1506
1507enum CursorShape {
1508 CursorBar = 0;
1509 CursorBlock = 1;
1510 CursorUnderscore = 2;
1511 CursorHollow = 3;
1512}
1513
1514message ExcerptInsertion {
1515 Excerpt excerpt = 1;
1516 optional uint64 previous_excerpt_id = 2;
1517}
1518
1519message Excerpt {
1520 uint64 id = 1;
1521 uint64 buffer_id = 2;
1522 Anchor context_start = 3;
1523 Anchor context_end = 4;
1524 Anchor primary_start = 5;
1525 Anchor primary_end = 6;
1526}
1527
1528message Anchor {
1529 uint32 replica_id = 1;
1530 uint32 timestamp = 2;
1531 uint64 offset = 3;
1532 Bias bias = 4;
1533 optional uint64 buffer_id = 5;
1534}
1535
1536enum Bias {
1537 Left = 0;
1538 Right = 1;
1539}
1540
1541message Diagnostic {
1542 Anchor start = 1;
1543 Anchor end = 2;
1544 optional string source = 3;
1545 Severity severity = 4;
1546 string message = 5;
1547 optional string code = 6;
1548 uint64 group_id = 7;
1549 bool is_primary = 8;
1550
1551 // TODO: remove this field
1552 bool is_valid = 9;
1553
1554 bool is_disk_based = 10;
1555 bool is_unnecessary = 11;
1556
1557 enum Severity {
1558 None = 0;
1559 Error = 1;
1560 Warning = 2;
1561 Information = 3;
1562 Hint = 4;
1563 }
1564}
1565
1566message Operation {
1567 oneof variant {
1568 Edit edit = 1;
1569 Undo undo = 2;
1570 UpdateSelections update_selections = 3;
1571 UpdateDiagnostics update_diagnostics = 4;
1572 UpdateCompletionTriggers update_completion_triggers = 5;
1573 }
1574
1575 message Edit {
1576 uint32 replica_id = 1;
1577 uint32 lamport_timestamp = 2;
1578 repeated VectorClockEntry version = 3;
1579 repeated Range ranges = 4;
1580 repeated string new_text = 5;
1581 }
1582
1583 message Undo {
1584 uint32 replica_id = 1;
1585 uint32 lamport_timestamp = 2;
1586 repeated VectorClockEntry version = 3;
1587 repeated UndoCount counts = 4;
1588 }
1589
1590 message UpdateSelections {
1591 uint32 replica_id = 1;
1592 uint32 lamport_timestamp = 2;
1593 repeated Selection selections = 3;
1594 bool line_mode = 4;
1595 CursorShape cursor_shape = 5;
1596 }
1597
1598 message UpdateCompletionTriggers {
1599 uint32 replica_id = 1;
1600 uint32 lamport_timestamp = 2;
1601 repeated string triggers = 3;
1602 }
1603}
1604
1605message UndoMapEntry {
1606 uint32 replica_id = 1;
1607 uint32 local_timestamp = 2;
1608 repeated UndoCount counts = 3;
1609}
1610
1611message UndoCount {
1612 uint32 replica_id = 1;
1613 uint32 lamport_timestamp = 2;
1614 uint32 count = 3;
1615}
1616
1617message VectorClockEntry {
1618 uint32 replica_id = 1;
1619 uint32 timestamp = 2;
1620}
1621
1622message Timestamp {
1623 uint64 seconds = 1;
1624 uint32 nanos = 2;
1625}
1626
1627message Range {
1628 uint64 start = 1;
1629 uint64 end = 2;
1630}
1631
1632message PointUtf16 {
1633 uint32 row = 1;
1634 uint32 column = 2;
1635}
1636
1637message Nonce {
1638 uint64 upper_half = 1;
1639 uint64 lower_half = 2;
1640}
1641
1642enum ChannelVisibility {
1643 Public = 0;
1644 Members = 1;
1645}
1646
1647message Channel {
1648 uint64 id = 1;
1649 string name = 2;
1650 ChannelVisibility visibility = 3;
1651 repeated uint64 parent_path = 5;
1652}
1653
1654message Contact {
1655 uint64 user_id = 1;
1656 bool online = 2;
1657 bool busy = 3;
1658}
1659
1660message WorktreeMetadata {
1661 uint64 id = 1;
1662 string root_name = 2;
1663 bool visible = 3;
1664 string abs_path = 4;
1665}
1666
1667message UpdateDiffBase {
1668 uint64 project_id = 1;
1669 uint64 buffer_id = 2;
1670 optional string diff_base = 3;
1671}
1672
1673message GetNotifications {
1674 optional uint64 before_id = 1;
1675}
1676
1677message AddNotification {
1678 Notification notification = 1;
1679}
1680
1681message GetNotificationsResponse {
1682 repeated Notification notifications = 1;
1683 bool done = 2;
1684}
1685
1686message DeleteNotification {
1687 uint64 notification_id = 1;
1688}
1689
1690message MarkNotificationRead {
1691 uint64 notification_id = 1;
1692}
1693
1694message Notification {
1695 uint64 id = 1;
1696 uint64 timestamp = 2;
1697 string kind = 3;
1698 optional uint64 entity_id = 4;
1699 string content = 5;
1700 bool is_read = 6;
1701 optional bool response = 7;
1702}
1703
1704message LspExtExpandMacro {
1705 uint64 project_id = 1;
1706 uint64 buffer_id = 2;
1707 Anchor position = 3;
1708}
1709
1710message LspExtExpandMacroResponse {
1711 string name = 1;
1712 string expansion = 2;
1713}
1714
1715message SetRoomParticipantRole {
1716 uint64 room_id = 1;
1717 uint64 user_id = 2;
1718 ChannelRole role = 3;
1719}