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