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-30 14:59:02 +00:00
|
|
|
CloseWorktree close_worktree = 10;
|
|
|
|
OpenBuffer open_buffer = 11;
|
|
|
|
OpenBufferResponse open_buffer_response = 12;
|
|
|
|
CloseBuffer close_buffer = 13;
|
|
|
|
UpdateBuffer update_buffer = 14;
|
|
|
|
AddGuest add_guest = 15;
|
|
|
|
RemoveGuest remove_guest = 16;
|
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-30 11:22:22 +00:00
|
|
|
uint32 replica_id = 2;
|
2021-06-30 13:07:33 +00:00
|
|
|
repeated Peer peers = 3;
|
2021-06-09 19:15:25 +00:00
|
|
|
}
|
|
|
|
|
2021-06-30 14:59:02 +00:00
|
|
|
message CloseWorktree {
|
|
|
|
uint64 worktree_id = 1;
|
|
|
|
}
|
|
|
|
|
2021-06-18 23:26:12 +00:00
|
|
|
message AddGuest {
|
|
|
|
uint64 worktree_id = 1;
|
2021-06-30 13:07:33 +00:00
|
|
|
Peer guest = 2;
|
2021-06-18 23:26:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message RemoveGuest {
|
|
|
|
uint64 worktree_id = 1;
|
2021-06-28 13:35:36 +00:00
|
|
|
uint32 peer_id = 2;
|
2021-06-18 23:26:12 +00:00
|
|
|
}
|
|
|
|
|
2021-06-30 13:07:33 +00:00
|
|
|
message Peer {
|
|
|
|
uint32 peer_id = 1;
|
|
|
|
uint32 replica_id = 2;
|
|
|
|
}
|
|
|
|
|
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 {
|
2021-06-25 17:20:53 +00:00
|
|
|
Buffer buffer = 1;
|
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 {
|
2021-06-25 17:20:53 +00:00
|
|
|
uint64 worktree_id = 1;
|
|
|
|
uint64 buffer_id = 2;
|
2021-06-15 20:06:50 +00:00
|
|
|
}
|
2021-06-10 01:14:30 +00:00
|
|
|
|
2021-06-25 23:26:35 +00:00
|
|
|
message UpdateBuffer {
|
2021-06-25 20:46:36 +00:00
|
|
|
uint64 worktree_id = 1;
|
|
|
|
uint64 buffer_id = 2;
|
|
|
|
repeated Operation operations = 3;
|
|
|
|
}
|
|
|
|
|
2021-06-18 23:26:12 +00:00
|
|
|
message User {
|
2021-06-25 17:20:53 +00:00
|
|
|
uint64 id = 1;
|
|
|
|
string github_login = 2;
|
|
|
|
string avatar_url = 3;
|
2021-06-18 23:26:12 +00:00
|
|
|
}
|
|
|
|
|
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 {
|
2021-06-28 17:41:33 +00:00
|
|
|
uint64 id = 1;
|
|
|
|
bool is_dir = 2;
|
|
|
|
string path = 3;
|
|
|
|
uint64 inode = 4;
|
|
|
|
Timestamp mtime = 5;
|
|
|
|
bool is_symlink = 6;
|
|
|
|
bool is_ignored = 7;
|
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-25 17:20:53 +00:00
|
|
|
uint64 id = 1;
|
|
|
|
string content = 2;
|
2021-06-25 23:26:35 +00:00
|
|
|
repeated Operation.Edit history = 3;
|
2021-07-02 09:29:36 +00:00
|
|
|
repeated SelectionSetSnapshot selections = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SelectionSetSnapshot {
|
|
|
|
uint32 replica_id = 1;
|
|
|
|
uint32 local_timestamp = 2;
|
|
|
|
repeated Selection selections = 3;
|
|
|
|
bool is_active = 4;
|
2021-06-25 23:26:35 +00:00
|
|
|
}
|
|
|
|
|
2021-07-01 10:54:16 +00:00
|
|
|
message SelectionSet {
|
|
|
|
repeated Selection selections = 1;
|
|
|
|
}
|
|
|
|
|
2021-06-25 23:26:35 +00:00
|
|
|
message Selection {
|
|
|
|
uint64 id = 1;
|
|
|
|
Anchor start = 2;
|
|
|
|
Anchor end = 3;
|
|
|
|
bool reversed = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Anchor {
|
|
|
|
repeated VectorClockEntry version = 1;
|
|
|
|
uint64 offset = 2;
|
|
|
|
Bias bias = 3;
|
|
|
|
enum Bias {
|
|
|
|
LEFT = 0;
|
|
|
|
Right = 1;
|
|
|
|
}
|
2021-06-15 20:06:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message Operation {
|
|
|
|
oneof variant {
|
|
|
|
Edit edit = 1;
|
2021-06-25 20:46:36 +00:00
|
|
|
Undo undo = 2;
|
2021-06-25 23:26:35 +00:00
|
|
|
UpdateSelections update_selections = 3;
|
2021-06-28 10:37:58 +00:00
|
|
|
SetActiveSelections set_active_selections = 4;
|
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-25 20:46:36 +00:00
|
|
|
|
|
|
|
message Undo {
|
|
|
|
uint32 replica_id = 1;
|
|
|
|
uint32 local_timestamp = 2;
|
|
|
|
uint32 lamport_timestamp = 3;
|
2021-06-29 08:25:42 +00:00
|
|
|
repeated Range ranges = 4;
|
|
|
|
repeated VectorClockEntry version = 5;
|
|
|
|
repeated UndoCount counts = 6;
|
|
|
|
}
|
|
|
|
|
|
|
|
message UndoCount {
|
|
|
|
uint32 replica_id = 1;
|
|
|
|
uint32 local_timestamp = 2;
|
|
|
|
uint32 count = 3;
|
2021-06-25 20:46:36 +00:00
|
|
|
}
|
2021-06-25 23:26:35 +00:00
|
|
|
|
|
|
|
message UpdateSelections {
|
|
|
|
uint32 replica_id = 1;
|
|
|
|
uint32 local_timestamp = 2;
|
|
|
|
uint32 lamport_timestamp = 3;
|
2021-07-01 10:54:16 +00:00
|
|
|
SelectionSet set = 4;
|
2021-06-25 23:26:35 +00:00
|
|
|
}
|
2021-06-28 10:37:58 +00:00
|
|
|
|
|
|
|
message SetActiveSelections {
|
|
|
|
uint32 replica_id = 1;
|
|
|
|
optional uint32 local_timestamp = 2;
|
|
|
|
uint32 lamport_timestamp = 3;
|
|
|
|
}
|
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;
|
|
|
|
}
|