worktree.proto

  1syntax = "proto3";
  2package zed.messages;
  3
  4message Timestamp {
  5  uint64 seconds = 1;
  6  uint32 nanos = 2;
  7}
  8
  9message File {
 10  uint64 worktree_id = 1;
 11  optional uint64 entry_id = 2;
 12  string path = 3;
 13  Timestamp mtime = 4;
 14  bool is_deleted = 5;
 15  bool is_historic = 6;
 16}
 17
 18message Entry {
 19  uint64 id = 1;
 20  bool is_dir = 2;
 21  string path = 3;
 22  uint64 inode = 4;
 23  Timestamp mtime = 5;
 24  bool is_ignored = 7;
 25  bool is_external = 8;
 26  reserved 6;
 27  reserved 9;
 28  bool is_fifo = 10;
 29  optional uint64 size = 11;
 30  optional string canonical_path = 12;
 31  bool is_hidden = 13;
 32}
 33
 34message AddWorktree {
 35  string path = 1;
 36  uint64 project_id = 2;
 37  bool visible = 3;
 38}
 39
 40message AddWorktreeResponse {
 41  uint64 worktree_id = 1;
 42  string canonicalized_path = 2;
 43  optional string root_repo_common_dir = 3;
 44}
 45
 46message RemoveWorktree {
 47  uint64 worktree_id = 1;
 48}
 49
 50message GetPathMetadata {
 51  uint64 project_id = 1;
 52  string path = 2;
 53}
 54
 55message GetPathMetadataResponse {
 56  bool exists = 1;
 57  string path = 2;
 58  bool is_dir = 3;
 59}
 60
 61message WorktreeMetadata {
 62  uint64 id = 1;
 63  string root_name = 2;
 64  bool visible = 3;
 65  string abs_path = 4;
 66  optional string root_repo_common_dir = 5;
 67}
 68
 69message ProjectPath {
 70  uint64 worktree_id = 1;
 71  string path = 2;
 72}
 73
 74message ListRemoteDirectoryConfig {
 75  bool is_dir = 1;
 76}
 77
 78message ListRemoteDirectory {
 79  uint64 dev_server_id = 1;
 80  string path = 2;
 81  ListRemoteDirectoryConfig config = 3;
 82}
 83
 84message EntryInfo {
 85  bool is_dir = 1;
 86}
 87
 88message ListRemoteDirectoryResponse {
 89  repeated string entries = 1;
 90  repeated EntryInfo entry_info = 2;
 91}
 92
 93message CreateProjectEntry {
 94  uint64 project_id = 1;
 95  uint64 worktree_id = 2;
 96  string path = 3;
 97  bool is_directory = 4;
 98  optional bytes content = 5;
 99}
100
101message RenameProjectEntry {
102  uint64 project_id = 1;
103  uint64 entry_id = 2;
104  string new_path = 3;
105  uint64 new_worktree_id = 4;
106}
107
108message CopyProjectEntry {
109  uint64 project_id = 1;
110  uint64 entry_id = 2;
111  string new_path = 3;
112  uint64 new_worktree_id = 5;
113  reserved 4;
114}
115
116message DeleteProjectEntry {
117  uint64 project_id = 1;
118  uint64 entry_id = 2;
119  bool use_trash = 3;
120}
121
122message ExpandProjectEntry {
123  uint64 project_id = 1;
124  uint64 entry_id = 2;
125}
126
127message ExpandProjectEntryResponse {
128  uint64 worktree_scan_id = 1;
129}
130
131message ExpandAllForProjectEntry {
132  uint64 project_id = 1;
133  uint64 entry_id = 2;
134}
135
136message ExpandAllForProjectEntryResponse {
137  uint64 worktree_scan_id = 1;
138}
139
140message ProjectEntryResponse {
141  optional Entry entry = 1;
142  uint64 worktree_scan_id = 2;
143}
144
145message UpdateWorktreeSettings {
146  uint64 project_id = 1;
147  uint64 worktree_id = 2;
148  string path = 3;
149  optional string content = 4;
150  optional LocalSettingsKind kind = 5;
151  optional bool outside_worktree = 6;
152}
153
154enum LocalSettingsKind {
155  Settings = 0;
156  Tasks = 1;
157  Editorconfig = 2;
158  Debug = 3;
159}
160
161message UpdateUserSettings {
162  uint64 project_id = 1;
163  string contents = 2;
164}
165
166message TrustWorktrees {
167  uint64 project_id = 1;
168  repeated PathTrust trusted_paths = 2;
169}
170
171message PathTrust {
172  oneof content {
173    uint64 worktree_id = 2;
174    string abs_path = 3;
175  }
176
177  reserved 1;
178}
179
180message RestrictWorktrees {
181  uint64 project_id = 1;
182  repeated uint64 worktree_ids = 3;
183
184  reserved 2;
185}
186
187// Request from the remote server to the client to allocate a new worktree ID.
188// This allows the client to maintain a single WorktreeIdCounter that prevents
189// ID collisions when connected to multiple remote servers.
190message AllocateWorktreeId {
191  uint64 project_id = 1;
192}
193
194message AllocateWorktreeIdResponse {
195  uint64 worktree_id = 1;
196}