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