aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-daemon/proto/history.proto
blob: 2a45b7cf476edabddf94ac249d9e6422fd366d0e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
syntax = "proto3";
package history;

message StartHistoryRequest {
  // If people are still using my software in ~530 years, they can figure out a u128 migration
  uint64 timestamp = 1; // nanosecond unix epoch
  string command = 2;
  string cwd = 3;
  string session = 4;
  string hostname = 5;
  string author = 6;
  string intent = 7;
}

message EndHistoryRequest {
  string id = 1;
  int64 exit = 2;
  uint64 duration = 3;
}

message StartHistoryReply {
  string id = 1;
  string version = 2;
  uint32 protocol = 3;
}

message EndHistoryReply {
  string id = 1;
  uint64 idx = 2;
  string version = 3;
  uint32 protocol = 4;
}

message StatusRequest {}

message StatusReply {
  bool healthy = 1;
  string version = 2;
  uint32 pid = 3;
  uint32 protocol = 4;
}

message ShutdownRequest {}

message ShutdownReply {
  bool accepted = 1;
}

service History {
  rpc StartHistory(StartHistoryRequest) returns (StartHistoryReply);
  rpc EndHistory(EndHistoryRequest) returns (EndHistoryReply);
  rpc Status(StatusRequest) returns (StatusReply);
  rpc Shutdown(ShutdownRequest) returns (ShutdownReply);
}