zed/zed-rpc/proto/zed.proto

130 lines
2.3 KiB
Protocol Buffer
Raw Normal View History

syntax = "proto3";
package zed.messages;
message Envelope {
uint32 id = 1;
optional uint32 responding_to = 2;
optional uint32 original_sender_id = 3;
oneof payload {
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;
OpenFile open_file = 10;
OpenFileResponse open_file_response = 11;
CloseFile close_file = 12;
OpenBuffer open_buffer = 13;
OpenBufferResponse open_buffer_response = 14;
}
}
message Auth {
int32 user_id = 1;
string access_token = 2;
}
message AuthResponse {
bool credentials_valid = 1;
}
message ShareWorktree {
Worktree worktree = 1;
}
message ShareWorktreeResponse {
uint64 worktree_id = 1;
string access_token = 2;
}
message OpenWorktree {
uint64 worktree_id = 1;
string access_token = 2;
}
2021-06-15 11:42:06 +03:00
message OpenWorktreeResponse {
Worktree worktree = 1;
uint32 replica_id = 2;
}
message AddGuest {
uint64 worktree_id = 1;
User user = 2;
}
message RemoveGuest {
uint64 worktree_id = 1;
}
2021-06-18 20:28:39 +03:00
message OpenFile {
uint64 worktree_id = 1;
string path = 2;
}
message OpenFileResponse {
uint64 id = 1;
uint64 mtime = 2;
}
message CloseFile {
uint64 worktree_id = 1;
uint64 id = 2;
2021-06-18 20:28:39 +03:00
}
message OpenBuffer {
uint64 worktree_id = 1;
uint64 id = 2;
}
message OpenBufferResponse {
Buffer buffer = 1;
}
message User {
string github_login = 1;
string avatar_url = 2;
uint64 id = 3;
}
message Worktree {
string root_name = 1;
repeated Entry entries = 2;
}
message Entry {
bool is_dir = 1;
string path = 2;
uint64 inode = 3;
Timestamp mtime = 4;
bool is_symlink = 5;
bool is_ignored = 6;
}
message Buffer {
2021-06-21 13:15:58 +03:00
string content = 1;
repeated Operation history = 2;
}
message Operation {
oneof variant {
Edit edit = 1;
}
message Edit {
uint32 replica_id = 1;
uint32 local_timestamp = 2;
uint32 lamport_timestamp = 3;
repeated VectorClockEntry version = 4;
}
2021-06-15 11:42:06 +03:00
message VectorClockEntry {
uint32 replica_id = 1;
uint32 timestamp = 2;
2021-06-15 11:42:06 +03:00
}
}
message Timestamp {
uint64 seconds = 1;
uint32 nanos = 2;
}