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 reserved 1;
309 repeated View views = 2;
310}
311
312message UpdateFollowers {
313 uint64 room_id = 1;
314 optional uint64 project_id = 2;
315 reserved 3;
316 oneof variant {
317 View create_view = 5;
318 UpdateActiveView update_active_view = 4;
319 UpdateView update_view = 6;
320 }
321}
322
323message Unfollow {
324 uint64 room_id = 1;
325 optional uint64 project_id = 2;
326 PeerId leader_id = 3;
327}
328
329message ViewId {
330 PeerId creator = 1;
331 uint64 id = 2;
332}
333
334message UpdateActiveView {
335 reserved 1, 2;
336 View view = 3;
337}
338
339enum PanelId {
340 AssistantPanel = 0;
341 DebugPanel = 1;
342}
343
344message UpdateView {
345 ViewId id = 1;
346 optional PeerId leader_id = 2;
347
348 oneof variant {
349 Editor editor = 3;
350 }
351
352 message Editor {
353 repeated ExcerptInsertion inserted_excerpts = 1;
354 repeated uint64 deleted_excerpts = 2;
355 repeated Selection selections = 3;
356 optional Selection pending_selection = 4;
357 EditorAnchor scroll_top_anchor = 5;
358 reserved 6;
359 reserved 7;
360 double scroll_x = 8;
361 double scroll_y = 9;
362 }
363}
364
365message View {
366 ViewId id = 1;
367 optional PeerId leader_id = 2;
368 optional PanelId panel_id = 6;
369
370 oneof variant {
371 Editor editor = 3;
372 ChannelView channel_view = 4;
373 ContextEditor context_editor = 5;
374 }
375
376 message Editor {
377 bool singleton = 1;
378 optional string title = 2;
379 repeated Excerpt excerpts = 3;
380 repeated Selection selections = 4;
381 optional Selection pending_selection = 5;
382 EditorAnchor scroll_top_anchor = 6;
383 reserved 7;
384 reserved 8;
385 double scroll_x = 9;
386 double scroll_y = 10;
387 }
388
389 message ChannelView {
390 uint64 channel_id = 1;
391 Editor editor = 2;
392 }
393
394 message ContextEditor {
395 string context_id = 1;
396 Editor editor = 2;
397 }
398}
399
400message ExcerptInsertion {
401 Excerpt excerpt = 1;
402 optional uint64 previous_excerpt_id = 2;
403}
404
405message Excerpt {
406 uint64 id = 1;
407 uint64 buffer_id = 2;
408 Anchor context_start = 3;
409 Anchor context_end = 4;
410 Anchor primary_start = 5;
411 Anchor primary_end = 6;
412}
413
414message Contact {
415 uint64 user_id = 1;
416 bool online = 2;
417 bool busy = 3;
418}
419
420message SetRoomParticipantRole {
421 uint64 room_id = 1;
422 uint64 user_id = 2;
423 ChannelRole role = 3;
424}