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}
177
178message ShareProjectResponse {
179 uint64 project_id = 1;
180}
181
182message UnshareProject {
183 uint64 project_id = 1;
184}
185
186message UpdateProject {
187 uint64 project_id = 1;
188 repeated WorktreeMetadata worktrees = 2;
189}
190
191message JoinProject {
192 uint64 project_id = 1;
193 optional string committer_email = 2;
194 optional string committer_name = 3;
195}
196
197message JoinProjectResponse {
198 uint64 project_id = 5;
199 uint32 replica_id = 1;
200 repeated WorktreeMetadata worktrees = 2;
201 repeated Collaborator collaborators = 3;
202 repeated LanguageServer language_servers = 4;
203 repeated string language_server_capabilities = 8;
204 ChannelRole role = 6;
205 reserved 7;
206}
207
208message LeaveProject {
209 uint64 project_id = 1;
210}
211
212message UpdateWorktree {
213 uint64 project_id = 1;
214 uint64 worktree_id = 2;
215 string root_name = 3;
216 repeated Entry updated_entries = 4;
217 repeated uint64 removed_entries = 5;
218 repeated RepositoryEntry updated_repositories = 6; // deprecated
219 repeated uint64 removed_repositories = 7; // deprecated
220 uint64 scan_id = 8;
221 bool is_last_update = 9;
222 string abs_path = 10;
223}
224
225// deprecated
226message RepositoryEntry {
227 uint64 repository_id = 1;
228 reserved 2;
229 repeated StatusEntry updated_statuses = 3;
230 repeated string removed_statuses = 4;
231 repeated string current_merge_conflicts = 5;
232 optional Branch branch_summary = 6;
233}
234
235message AddProjectCollaborator {
236 uint64 project_id = 1;
237 Collaborator collaborator = 2;
238}
239
240message UpdateProjectCollaborator {
241 uint64 project_id = 1;
242 PeerId old_peer_id = 2;
243 PeerId new_peer_id = 3;
244}
245
246message RemoveProjectCollaborator {
247 uint64 project_id = 1;
248 PeerId peer_id = 2;
249}
250
251message GetUsers {
252 repeated uint64 user_ids = 1;
253}
254
255message FuzzySearchUsers {
256 string query = 1;
257}
258
259message UsersResponse {
260 repeated User users = 1;
261}
262
263message RequestContact {
264 uint64 responder_id = 1;
265}
266
267message RemoveContact {
268 uint64 user_id = 1;
269}
270
271message RespondToContactRequest {
272 uint64 requester_id = 1;
273 ContactRequestResponse response = 2;
274}
275
276enum ContactRequestResponse {
277 Accept = 0;
278 Decline = 1;
279 Block = 2;
280 Dismiss = 3;
281}
282
283message UpdateContacts {
284 repeated Contact contacts = 1;
285 repeated uint64 remove_contacts = 2;
286 repeated IncomingContactRequest incoming_requests = 3;
287 repeated uint64 remove_incoming_requests = 4;
288 repeated uint64 outgoing_requests = 5;
289 repeated uint64 remove_outgoing_requests = 6;
290}
291
292message ShowContacts {}
293
294message IncomingContactRequest {
295 uint64 requester_id = 1;
296}
297
298message Follow {
299 uint64 room_id = 1;
300 optional uint64 project_id = 2;
301 PeerId leader_id = 3;
302}
303
304message FollowResponse {
305 View active_view = 3;
306 // TODO: Remove after version 0.145.x stabilizes.
307 optional ViewId active_view_id = 1;
308 repeated View views = 2;
309}
310
311message UpdateFollowers {
312 uint64 room_id = 1;
313 optional uint64 project_id = 2;
314 reserved 3;
315 oneof variant {
316 View create_view = 5;
317 // TODO: Remove after version 0.145.x stabilizes.
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 optional ViewId id = 1;
336 optional PeerId leader_id = 2;
337 View view = 3;
338}
339
340enum PanelId {
341 AssistantPanel = 0;
342 DebugPanel = 1;
343}
344
345message UpdateView {
346 ViewId id = 1;
347 optional PeerId leader_id = 2;
348
349 oneof variant {
350 Editor editor = 3;
351 }
352
353 message Editor {
354 repeated ExcerptInsertion inserted_excerpts = 1;
355 repeated uint64 deleted_excerpts = 2;
356 repeated Selection selections = 3;
357 optional Selection pending_selection = 4;
358 EditorAnchor scroll_top_anchor = 5;
359 float scroll_x = 6;
360 float scroll_y = 7;
361 }
362}
363
364message View {
365 ViewId id = 1;
366 optional PeerId leader_id = 2;
367 optional PanelId panel_id = 6;
368
369 oneof variant {
370 Editor editor = 3;
371 ChannelView channel_view = 4;
372 ContextEditor context_editor = 5;
373 }
374
375 message Editor {
376 bool singleton = 1;
377 optional string title = 2;
378 repeated Excerpt excerpts = 3;
379 repeated Selection selections = 4;
380 optional Selection pending_selection = 5;
381 EditorAnchor scroll_top_anchor = 6;
382 float scroll_x = 7;
383 float scroll_y = 8;
384 }
385
386 message ChannelView {
387 uint64 channel_id = 1;
388 Editor editor = 2;
389 }
390
391 message ContextEditor {
392 string context_id = 1;
393 Editor editor = 2;
394 }
395}
396
397message ExcerptInsertion {
398 Excerpt excerpt = 1;
399 optional uint64 previous_excerpt_id = 2;
400}
401
402message Excerpt {
403 uint64 id = 1;
404 uint64 buffer_id = 2;
405 Anchor context_start = 3;
406 Anchor context_end = 4;
407 Anchor primary_start = 5;
408 Anchor primary_end = 6;
409}
410
411message Contact {
412 uint64 user_id = 1;
413 bool online = 2;
414 bool busy = 3;
415}
416
417message SetRoomParticipantRole {
418 uint64 room_id = 1;
419 uint64 user_id = 2;
420 ChannelRole role = 3;
421}