aboutsummaryrefslogtreecommitdiffstats
path: root/crates/turtle/proto
diff options
context:
space:
mode:
Diffstat (limited to 'crates/turtle/proto')
-rw-r--r--crates/turtle/proto/control.proto4
-rw-r--r--crates/turtle/proto/history.proto34
2 files changed, 28 insertions, 10 deletions
diff --git a/crates/turtle/proto/control.proto b/crates/turtle/proto/control.proto
index a8026cb8..f1656d73 100644
--- a/crates/turtle/proto/control.proto
+++ b/crates/turtle/proto/control.proto
@@ -14,7 +14,9 @@ service Control {
message ForceSyncRequest {}
message ForceSyncReply {
- bool accepted = 1;
+ optional string error = 1;
+ uint32 uploaded = 2;
+ uint32 downloaded = 3;
}
message StatusRequest {}
diff --git a/crates/turtle/proto/history.proto b/crates/turtle/proto/history.proto
index 850b16b9..90fcf55f 100644
--- a/crates/turtle/proto/history.proto
+++ b/crates/turtle/proto/history.proto
@@ -4,6 +4,7 @@ package history;
service History {
rpc StartHistory(StartHistoryRequest) returns (StartHistoryReply);
rpc EndHistory(EndHistoryRequest) returns (EndHistoryReply);
+ rpc AddHistory(AddHistoryRequest) returns (EndHistoryReply);
rpc TailHistory(TailHistoryRequest) returns (stream TailHistoryReply);
@@ -11,14 +12,20 @@ service History {
rpc History(HistoryRequest) returns (HistoryReply);
}
+message AddHistoryRequest {
+ StartHistoryRequest start = 1;
+ int64 exit = 2;
+ Duration duration = 3;
+}
+
message StartHistoryRequest {
- uint64 timestamp = 1; // nanosecond unix epoch
+ Timestamp timestamp = 1;
string command = 2;
string cwd = 3;
string session = 4;
string hostname = 5;
string author = 6;
- string intent = 7;
+ optional string intent = 7;
}
message StartHistoryReply {
string id = 1;
@@ -28,8 +35,9 @@ message StartHistoryReply {
message EndHistoryRequest {
string id = 1;
+
int64 exit = 2;
- uint64 duration = 3;
+ Duration duration = 3;
}
message EndHistoryReply {
string id = 1;
@@ -52,7 +60,7 @@ enum HistoryEventKind {
}
message HistoryEntry {
- uint64 timestamp = 1; // nanosecond unix epoch
+ Timestamp timestamp = 1;
string id = 2;
string command = 3;
string cwd = 4;
@@ -61,17 +69,25 @@ message HistoryEntry {
string author = 7;
string intent = 8;
int64 exit = 9;
- int64 duration = 10;
+ Duration duration = 10;
}
message Range {
- uint64 start = 1;
- uint64 end = 2;
+ Timestamp start = 1;
+ Timestamp end = 2;
+}
+
+message Timestamp {
+ // Encoded as nanoseconds since the UNIX epoch.
+ uint64 value = 1;
+}
+message Duration {
+ // Encoded as nanoseconds.
+ uint64 value = 1;
}
message HistoryRequest {
- string session = 1;
- optional Range range = 2;
+ Range range = 2;
}
message HistoryReply {
repeated HistoryEntry entries = 1;