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