call.proto

  1syntax = "proto3";
  2package zed.messages;
  3
  4import "core.proto";
  5import "worktree.proto";
  6import "buffer.proto";
  7import "lsp.proto";
  8import "channel.proto";
  9import "git.proto";
 10
 11message CreateRoom {}
 12
 13message CreateRoomResponse {
 14    Room room = 1;
 15    optional LiveKitConnectionInfo live_kit_connection_info = 2;
 16}
 17
 18message JoinRoom {
 19    uint64 id = 1;
 20}
 21
 22message JoinRoomResponse {
 23    Room room = 1;
 24    optional uint64 channel_id = 2;
 25    optional LiveKitConnectionInfo live_kit_connection_info = 3;
 26}
 27
 28message RejoinRoom {
 29    uint64 id = 1;
 30    repeated UpdateProject reshared_projects = 2;
 31    repeated RejoinProject rejoined_projects = 3;
 32}
 33
 34message RejoinRemoteProjects {
 35    repeated RejoinProject rejoined_projects = 1;
 36}
 37
 38message RejoinRemoteProjectsResponse {
 39    repeated RejoinedProject rejoined_projects = 1;
 40}
 41
 42message RejoinProject {
 43    uint64 id = 1;
 44    repeated RejoinWorktree worktrees = 2;
 45    repeated RejoinRepository repositories = 3;
 46}
 47
 48message RejoinWorktree {
 49    uint64 id = 1;
 50    uint64 scan_id = 2;
 51}
 52
 53message RejoinRepository {
 54    uint64 id = 1;
 55    uint64 scan_id = 2;
 56}
 57
 58message RejoinRoomResponse {
 59    Room room = 1;
 60    repeated ResharedProject reshared_projects = 2;
 61    repeated RejoinedProject rejoined_projects = 3;
 62}
 63
 64message ResharedProject {
 65    uint64 id = 1;
 66    repeated Collaborator collaborators = 2;
 67}
 68
 69message RejoinedProject {
 70    uint64 id = 1;
 71    repeated WorktreeMetadata worktrees = 2;
 72    repeated Collaborator collaborators = 3;
 73    repeated LanguageServer language_servers = 4;
 74}
 75
 76message LeaveRoom {}
 77
 78message Room {
 79    uint64 id = 1;
 80    repeated Participant participants = 2;
 81    repeated PendingParticipant pending_participants = 3;
 82    repeated Follower followers = 4;
 83    string livekit_room = 5;
 84}
 85
 86message Participant {
 87    uint64 user_id = 1;
 88    PeerId peer_id = 2;
 89    repeated ParticipantProject projects = 3;
 90    ParticipantLocation location = 4;
 91    uint32 participant_index = 5;
 92    ChannelRole role = 6;
 93    reserved 7;
 94}
 95
 96message PendingParticipant {
 97    uint64 user_id = 1;
 98    uint64 calling_user_id = 2;
 99    optional uint64 initial_project_id = 3;
100}
101
102message ParticipantProject {
103    uint64 id = 1;
104    repeated string worktree_root_names = 2;
105}
106
107message Follower {
108    PeerId leader_id = 1;
109    PeerId follower_id = 2;
110    uint64 project_id = 3;
111}
112
113message ParticipantLocation {
114    oneof variant {
115        SharedProject shared_project = 1;
116        UnsharedProject unshared_project = 2;
117        External external = 3;
118    }
119
120    message SharedProject {
121        uint64 id = 1;
122    }
123
124    message UnsharedProject {}
125
126    message External {}
127}
128
129message Call {
130    uint64 room_id = 1;
131    uint64 called_user_id = 2;
132    optional uint64 initial_project_id = 3;
133}
134
135message IncomingCall {
136    uint64 room_id = 1;
137    uint64 calling_user_id = 2;
138    repeated uint64 participant_user_ids = 3;
139    optional ParticipantProject initial_project = 4;
140}
141
142message CallCanceled {
143    uint64 room_id = 1;
144}
145
146message CancelCall {
147    uint64 room_id = 1;
148    uint64 called_user_id = 2;
149}
150
151message DeclineCall {
152    uint64 room_id = 1;
153}
154
155message UpdateParticipantLocation {
156    uint64 room_id = 1;
157    ParticipantLocation location = 2;
158}
159
160message RoomUpdated {
161    Room room = 1;
162}
163
164message LiveKitConnectionInfo {
165    string server_url = 1;
166    string token = 2;
167    bool can_publish = 3;
168}
169
170message ShareProject {
171    uint64 room_id = 1;
172    repeated WorktreeMetadata worktrees = 2;
173    reserved 3;
174    bool is_ssh_project = 4;
175}
176
177message ShareProjectResponse {
178    uint64 project_id = 1;
179}
180
181message UnshareProject {
182    uint64 project_id = 1;
183}
184
185message UpdateProject {
186    uint64 project_id = 1;
187    repeated WorktreeMetadata worktrees = 2;
188}
189
190message JoinProject {
191    uint64 project_id = 1;
192    optional string committer_email = 2;
193    optional string committer_name = 3;
194}
195
196message JoinProjectResponse {
197    uint64 project_id = 5;
198    uint32 replica_id = 1;
199    repeated WorktreeMetadata worktrees = 2;
200    repeated Collaborator collaborators = 3;
201    repeated LanguageServer language_servers = 4;
202    ChannelRole role = 6;
203    reserved 7;
204}
205
206message LeaveProject {
207    uint64 project_id = 1;
208}
209
210message UpdateWorktree {
211    uint64 project_id = 1;
212    uint64 worktree_id = 2;
213    string root_name = 3;
214    repeated Entry updated_entries = 4;
215    repeated uint64 removed_entries = 5;
216    repeated RepositoryEntry updated_repositories = 6; // deprecated
217    repeated uint64 removed_repositories = 7; // deprecated
218    uint64 scan_id = 8;
219    bool is_last_update = 9;
220    string abs_path = 10;
221}
222
223// deprecated
224message RepositoryEntry {
225    uint64 repository_id = 1;
226    reserved 2;
227    repeated StatusEntry updated_statuses = 3;
228    repeated string removed_statuses = 4;
229    repeated string current_merge_conflicts = 5;
230    optional Branch branch_summary = 6;
231}
232
233message AddProjectCollaborator {
234    uint64 project_id = 1;
235    Collaborator collaborator = 2;
236}
237
238message UpdateProjectCollaborator {
239    uint64 project_id = 1;
240    PeerId old_peer_id = 2;
241    PeerId new_peer_id = 3;
242}
243
244message RemoveProjectCollaborator {
245    uint64 project_id = 1;
246    PeerId peer_id = 2;
247}
248
249message GetUsers {
250    repeated uint64 user_ids = 1;
251}
252
253message FuzzySearchUsers {
254    string query = 1;
255}
256
257message UsersResponse {
258    repeated User users = 1;
259}
260
261message RequestContact {
262    uint64 responder_id = 1;
263}
264
265message RemoveContact {
266    uint64 user_id = 1;
267}
268
269message RespondToContactRequest {
270    uint64 requester_id = 1;
271    ContactRequestResponse response = 2;
272}
273
274enum ContactRequestResponse {
275    Accept = 0;
276    Decline = 1;
277    Block = 2;
278    Dismiss = 3;
279}
280
281message UpdateContacts {
282    repeated Contact contacts = 1;
283    repeated uint64 remove_contacts = 2;
284    repeated IncomingContactRequest incoming_requests = 3;
285    repeated uint64 remove_incoming_requests = 4;
286    repeated uint64 outgoing_requests = 5;
287    repeated uint64 remove_outgoing_requests = 6;
288}
289
290message ShowContacts {}
291
292message IncomingContactRequest {
293    uint64 requester_id = 1;
294}
295
296message Follow {
297    uint64 room_id = 1;
298    optional uint64 project_id = 2;
299    PeerId leader_id = 3;
300}
301
302message FollowResponse {
303    View active_view = 3;
304    // TODO: Remove after version 0.145.x stabilizes.
305    optional ViewId active_view_id = 1;
306    repeated View views = 2;
307}
308
309message UpdateFollowers {
310    uint64 room_id = 1;
311    optional uint64 project_id = 2;
312    reserved 3;
313    oneof variant {
314        View create_view = 5;
315        // TODO: Remove after version 0.145.x stabilizes.
316        UpdateActiveView update_active_view = 4;
317        UpdateView update_view = 6;
318    }
319}
320
321message Unfollow {
322    uint64 room_id = 1;
323    optional uint64 project_id = 2;
324    PeerId leader_id = 3;
325}
326
327message ViewId {
328    PeerId creator = 1;
329    uint64 id = 2;
330}
331
332message UpdateActiveView {
333    optional ViewId id = 1;
334    optional PeerId leader_id = 2;
335    View view = 3;
336}
337
338enum PanelId {
339    AssistantPanel = 0;
340    DebugPanel = 1;
341}
342
343message UpdateView {
344    ViewId id = 1;
345    optional PeerId leader_id = 2;
346
347    oneof variant {
348        Editor editor = 3;
349    }
350
351    message Editor {
352        repeated ExcerptInsertion inserted_excerpts = 1;
353        repeated uint64 deleted_excerpts = 2;
354        repeated Selection selections = 3;
355        optional Selection pending_selection = 4;
356        EditorAnchor scroll_top_anchor = 5;
357        float scroll_x = 6;
358        float scroll_y = 7;
359    }
360}
361
362message View {
363    ViewId id = 1;
364    optional PeerId leader_id = 2;
365    optional PanelId panel_id = 6;
366
367    oneof variant {
368        Editor editor = 3;
369        ChannelView channel_view = 4;
370        ContextEditor context_editor = 5;
371    }
372
373    message Editor {
374        bool singleton = 1;
375        optional string title = 2;
376        repeated Excerpt excerpts = 3;
377        repeated Selection selections = 4;
378        optional Selection pending_selection = 5;
379        EditorAnchor scroll_top_anchor = 6;
380        float scroll_x = 7;
381        float scroll_y = 8;
382    }
383
384    message ChannelView {
385        uint64 channel_id = 1;
386        Editor editor = 2;
387    }
388
389    message ContextEditor {
390        string context_id = 1;
391        Editor editor = 2;
392    }
393}
394
395message ExcerptInsertion {
396    Excerpt excerpt = 1;
397    optional uint64 previous_excerpt_id = 2;
398}
399
400message Excerpt {
401    uint64 id = 1;
402    uint64 buffer_id = 2;
403    Anchor context_start = 3;
404    Anchor context_end = 4;
405    Anchor primary_start = 5;
406    Anchor primary_end = 6;
407}
408
409message Contact {
410    uint64 user_id = 1;
411    bool online = 2;
412    bool busy = 3;
413}
414
415message SetRoomParticipantRole {
416    uint64 room_id = 1;
417    uint64 user_id = 2;
418    ChannelRole role = 3;
419}