mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-26 03:59:55 +00:00
82 lines
1.5 KiB
Protocol Buffer
82 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 {
|
|
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;
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|