zed/zed-rpc/proto/zed.proto
Max Brunsfeld e88f33851e Flatten protobuf message namespace
* Remove `FromClient`/`FromServer` distinction.
* Remove `subscribe` concept - clients will need to handle
  unprompted messages from the server.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-06-15 13:06:50 -07:00

83 lines
1.5 KiB
Protocol Buffer

syntax = "proto3";
package zed.messages;
message Envelope {
uint32 id = 1;
optional uint32 responding_to = 2;
oneof payload {
Auth auth = 3;
AuthResponse auth_response = 4;
ShareWorktree share_worktree = 5;
ShareWorktreeResponse share_worktree_response = 6;
OpenWorktree open_worktree = 7;
OpenWorktreeResponse open_worktree_response = 8;
OpenBuffer open_buffer = 9;
OpenBufferResponse open_buffer_response = 10;
}
}
message Auth {
uint64 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;
}
message OpenWorktreeResponse {
Worktree worktree = 1;
}
message OpenBuffer {
uint64 worktree_id = 1;
bytes path = 2;
}
message OpenBufferResponse {
Buffer buffer = 1;
}
message Worktree {
repeated bytes paths = 1;
}
message Buffer {
uint64 id = 1;
bytes path = 2;
bytes content = 3;
repeated Operation history = 4;
}
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;
}
message VectorClockEntry {
uint32 replica_id = 1;
uint32 timestamp = 2;
}
}