From 9cdc575666faad4c162f4b4cf519bfdd1fd528dc Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 24 Jul 2026 17:56:36 +0200 Subject: feat: Finalize design for fish-shell integration --- crates/turtle/proto/history.proto | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'crates/turtle/proto/history.proto') 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; -- cgit v1.3.1