aboutsummaryrefslogtreecommitdiffstats
path: root/crates/turtle/proto
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-07-20 19:30:40 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-07-20 19:30:40 +0200
commit966a80c4199a49898cc7d8641012d520ce6b2efa (patch)
tree51029ff75842090fd1eecbea97b6f7c447e3dea9 /crates/turtle/proto
parentchore(server): Remove warnings (diff)
downloadatuin-966a80c4199a49898cc7d8641012d520ce6b2efa.zip
chore: Commit
Diffstat (limited to 'crates/turtle/proto')
-rw-r--r--crates/turtle/proto/control.proto33
-rw-r--r--crates/turtle/proto/history.proto78
2 files changed, 111 insertions, 0 deletions
diff --git a/crates/turtle/proto/control.proto b/crates/turtle/proto/control.proto
new file mode 100644
index 00000000..a8026cb8
--- /dev/null
+++ b/crates/turtle/proto/control.proto
@@ -0,0 +1,33 @@
+syntax = "proto3";
+package control;
+
+service Control {
+ // Tell the daemon to perform a sync operation.
+ rpc ForceSync(ForceSyncRequest) returns (ForceSyncReply);
+
+ // Query the daemon for it's status.
+ rpc Status(StatusRequest) returns (StatusReply);
+
+ // Query the daemon about used paths.
+ rpc Paths(PathsRequest) returns (PathsReply);
+}
+
+message ForceSyncRequest {}
+message ForceSyncReply {
+ bool accepted = 1;
+}
+
+message StatusRequest {}
+message StatusReply {
+ bool healthy = 1;
+ string version = 2;
+ uint32 pid = 3;
+ uint32 protocol = 4;
+}
+
+message PathsRequest {}
+message PathsReply {
+ string config = 1;
+ string db = 2;
+ string socket = 3;
+}
diff --git a/crates/turtle/proto/history.proto b/crates/turtle/proto/history.proto
new file mode 100644
index 00000000..850b16b9
--- /dev/null
+++ b/crates/turtle/proto/history.proto
@@ -0,0 +1,78 @@
+syntax = "proto3";
+package history;
+
+service History {
+ rpc StartHistory(StartHistoryRequest) returns (StartHistoryReply);
+ rpc EndHistory(EndHistoryRequest) returns (EndHistoryReply);
+
+ rpc TailHistory(TailHistoryRequest) returns (stream TailHistoryReply);
+
+ // Request history from the daemon
+ rpc History(HistoryRequest) returns (HistoryReply);
+}
+
+message StartHistoryRequest {
+ 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 StartHistoryReply {
+ string id = 1;
+ string version = 2;
+ uint32 protocol = 3;
+}
+
+message EndHistoryRequest {
+ string id = 1;
+ int64 exit = 2;
+ uint64 duration = 3;
+}
+message EndHistoryReply {
+ string id = 1;
+ uint64 idx = 2;
+ string version = 3;
+ uint32 protocol = 4;
+}
+
+
+message TailHistoryRequest {}
+message TailHistoryReply {
+ HistoryEventKind kind = 1;
+ HistoryEntry history = 2;
+}
+
+enum HistoryEventKind {
+ HISTORY_EVENT_KIND_UNSPECIFIED = 0;
+ HISTORY_EVENT_KIND_STARTED = 1;
+ HISTORY_EVENT_KIND_ENDED = 2;
+}
+
+message HistoryEntry {
+ uint64 timestamp = 1; // nanosecond unix epoch
+ string id = 2;
+ string command = 3;
+ string cwd = 4;
+ string session = 5;
+ string hostname = 6;
+ string author = 7;
+ string intent = 8;
+ int64 exit = 9;
+ int64 duration = 10;
+}
+
+message Range {
+ uint64 start = 1;
+ uint64 end = 2;
+}
+
+message HistoryRequest {
+ string session = 1;
+ optional Range range = 2;
+}
+message HistoryReply {
+ repeated HistoryEntry entries = 1;
+}