mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 05:15:00 +00:00
108 lines
2 KiB
Protocol Buffer
108 lines
2 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;
|
|
OpenFile open_file = 9;
|
|
OpenFileResponse open_file_response = 10;
|
|
CloseFile close_file = 11;
|
|
OpenBuffer open_buffer = 12;
|
|
OpenBufferResponse open_buffer_response = 13;
|
|
}
|
|
}
|
|
|
|
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 OpenFile {
|
|
uint64 worktree_id = 1;
|
|
string path = 2;
|
|
}
|
|
|
|
message OpenFileResponse {
|
|
uint64 id = 1;
|
|
uint64 mtime = 2;
|
|
}
|
|
|
|
message CloseFile {
|
|
uint64 id = 1;
|
|
}
|
|
|
|
message OpenBuffer {
|
|
uint64 worktree_id = 1;
|
|
string path = 2;
|
|
}
|
|
|
|
message OpenBufferResponse {
|
|
Buffer buffer = 1;
|
|
}
|
|
|
|
message Worktree {
|
|
string root_name = 1;
|
|
repeated Entry entries = 2;
|
|
}
|
|
|
|
message Entry {
|
|
bool is_dir = 1;
|
|
string path = 2;
|
|
uint64 inode = 3;
|
|
bool is_symlink = 4;
|
|
bool is_ignored = 5;
|
|
}
|
|
|
|
message Buffer {
|
|
uint64 id = 1;
|
|
string path = 2;
|
|
string 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;
|
|
}
|
|
}
|