2021-06-09 19:15:25 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
package zed.messages;
|
|
|
|
|
2021-06-15 20:06:50 +00:00
|
|
|
message Envelope {
|
|
|
|
uint32 id = 1;
|
|
|
|
optional uint32 responding_to = 2;
|
2021-06-18 23:26:12 +00:00
|
|
|
optional uint32 original_sender_id = 3;
|
2021-06-15 20:06:50 +00:00
|
|
|
oneof payload {
|
2021-06-18 23:26:12 +00:00
|
|
|
Auth auth = 4;
|
|
|
|
AuthResponse auth_response = 5;
|
|
|
|
ShareWorktree share_worktree = 6;
|
|
|
|
ShareWorktreeResponse share_worktree_response = 7;
|
|
|
|
OpenWorktree open_worktree = 8;
|
|
|
|
OpenWorktreeResponse open_worktree_response = 9;
|
2021-06-23 14:20:02 +00:00
|
|
|
OpenBuffer open_buffer = 10;
|
|
|
|
OpenBufferResponse open_buffer_response = 11;
|
|
|
|
CloseBuffer close_buffer = 12;
|
2021-06-09 19:15:25 +00:00
|
|
|
}
|
2021-06-15 20:06:50 +00:00
|
|
|
}
|
2021-06-09 19:15:25 +00:00
|
|
|
|
2021-06-15 20:06:50 +00:00
|
|
|
message Auth {
|
2021-06-17 12:51:06 +00:00
|
|
|
int32 user_id = 1;
|
2021-06-15 20:06:50 +00:00
|
|
|
string access_token = 2;
|
|
|
|
}
|
2021-06-10 01:14:30 +00:00
|
|
|
|
2021-06-15 20:06:50 +00:00
|
|
|
message AuthResponse {
|
|
|
|
bool credentials_valid = 1;
|
|
|
|
}
|
2021-06-10 01:14:30 +00:00
|
|
|
|
2021-06-15 20:06:50 +00:00
|
|
|
message ShareWorktree {
|
|
|
|
Worktree worktree = 1;
|
|
|
|
}
|
2021-06-10 01:14:30 +00:00
|
|
|
|
2021-06-15 20:06:50 +00:00
|
|
|
message ShareWorktreeResponse {
|
|
|
|
uint64 worktree_id = 1;
|
|
|
|
string access_token = 2;
|
|
|
|
}
|
2021-06-10 01:14:30 +00:00
|
|
|
|
2021-06-15 20:06:50 +00:00
|
|
|
message OpenWorktree {
|
|
|
|
uint64 worktree_id = 1;
|
|
|
|
string access_token = 2;
|
|
|
|
}
|
2021-06-15 08:42:06 +00:00
|
|
|
|
2021-06-15 20:06:50 +00:00
|
|
|
message OpenWorktreeResponse {
|
|
|
|
Worktree worktree = 1;
|
2021-06-23 15:32:05 +00:00
|
|
|
optional uint32 replica_id = 2;
|
2021-06-09 19:15:25 +00:00
|
|
|
}
|
|
|
|
|
2021-06-18 23:26:12 +00:00
|
|
|
message AddGuest {
|
|
|
|
uint64 worktree_id = 1;
|
|
|
|
User user = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message RemoveGuest {
|
|
|
|
uint64 worktree_id = 1;
|
|
|
|
}
|
|
|
|
|
2021-06-23 14:20:02 +00:00
|
|
|
message OpenBuffer {
|
2021-06-18 17:28:39 +00:00
|
|
|
uint64 worktree_id = 1;
|
|
|
|
string path = 2;
|
|
|
|
}
|
|
|
|
|
2021-06-23 14:20:02 +00:00
|
|
|
message OpenBufferResponse {
|
|
|
|
uint64 buffer_id = 1;
|
|
|
|
Buffer buffer = 2;
|
2021-06-15 20:06:50 +00:00
|
|
|
}
|
2021-06-09 19:15:25 +00:00
|
|
|
|
2021-06-23 14:20:02 +00:00
|
|
|
message CloseBuffer {
|
|
|
|
uint64 id = 1;
|
2021-06-15 20:06:50 +00:00
|
|
|
}
|
2021-06-10 01:14:30 +00:00
|
|
|
|
2021-06-18 23:26:12 +00:00
|
|
|
message User {
|
|
|
|
string github_login = 1;
|
|
|
|
string avatar_url = 2;
|
|
|
|
uint64 id = 3;
|
|
|
|
}
|
|
|
|
|
2021-06-15 20:06:50 +00:00
|
|
|
message Worktree {
|
2021-06-18 12:52:38 +00:00
|
|
|
string root_name = 1;
|
|
|
|
repeated Entry entries = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Entry {
|
|
|
|
bool is_dir = 1;
|
|
|
|
string path = 2;
|
|
|
|
uint64 inode = 3;
|
2021-06-22 00:07:56 +00:00
|
|
|
Timestamp mtime = 4;
|
|
|
|
bool is_symlink = 5;
|
|
|
|
bool is_ignored = 6;
|
2021-06-15 20:06:50 +00:00
|
|
|
}
|
2021-06-10 01:14:30 +00:00
|
|
|
|
2021-06-15 20:06:50 +00:00
|
|
|
message Buffer {
|
2021-06-21 10:15:58 +00:00
|
|
|
string content = 1;
|
|
|
|
repeated Operation history = 2;
|
2021-06-15 20:06:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message Operation {
|
|
|
|
oneof variant {
|
|
|
|
Edit edit = 1;
|
2021-06-09 19:15:25 +00:00
|
|
|
}
|
|
|
|
|
2021-06-15 20:06:50 +00:00
|
|
|
message Edit {
|
|
|
|
uint32 replica_id = 1;
|
|
|
|
uint32 local_timestamp = 2;
|
|
|
|
uint32 lamport_timestamp = 3;
|
|
|
|
repeated VectorClockEntry version = 4;
|
2021-06-23 14:20:02 +00:00
|
|
|
repeated Range ranges = 5;
|
|
|
|
optional string new_text = 6;
|
2021-06-09 19:15:25 +00:00
|
|
|
}
|
2021-06-23 14:20:02 +00:00
|
|
|
}
|
2021-06-15 08:42:06 +00:00
|
|
|
|
2021-06-23 14:20:02 +00:00
|
|
|
message VectorClockEntry {
|
|
|
|
uint32 replica_id = 1;
|
|
|
|
uint32 timestamp = 2;
|
2021-06-15 08:42:06 +00:00
|
|
|
}
|
2021-06-22 00:07:56 +00:00
|
|
|
|
|
|
|
message Timestamp {
|
|
|
|
uint64 seconds = 1;
|
|
|
|
uint32 nanos = 2;
|
2021-06-23 14:20:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message Range {
|
|
|
|
uint64 start = 1;
|
|
|
|
uint64 end = 2;
|
|
|
|
}
|