diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-07-20 14:18:36 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-07-20 14:18:36 +0200 |
| commit | 63a0ec3901a863fb07d18f4b814a98a813644382 (patch) | |
| tree | c94b7b501601b5df05cf654e9f9c9b5bc66a239e /crates/daemon/proto | |
| parent | chore: Commit (diff) | |
| download | atuin-63a0ec3901a863fb07d18f4b814a98a813644382.zip | |
chore: Commit
Diffstat (limited to '')
| -rw-r--r-- | crates/daemon/proto/control.proto | 65 | ||||
| -rw-r--r-- | crates/daemon/proto/history.proto | 50 | ||||
| -rw-r--r-- | crates/daemon/proto/semantic.proto | 47 |
3 files changed, 28 insertions, 134 deletions
diff --git a/crates/daemon/proto/control.proto b/crates/daemon/proto/control.proto index 06347902..47a7b8b2 100644 --- a/crates/daemon/proto/control.proto +++ b/crates/daemon/proto/control.proto @@ -1,62 +1,23 @@ syntax = "proto3"; package control; -// The Control service allows external processes (CLI commands, etc.) -// to inject events into the running daemon. service Control { - // Send an event to the daemon's event bus - rpc SendEvent(SendEventRequest) returns (SendEventResponse); -} - -message SendEventRequest { - oneof event { - // History was pruned - search index needs full rebuild - HistoryPrunedEvent history_pruned = 1; - - // Specific history items were deleted - HistoryDeletedEvent history_deleted = 2; - - // Request immediate sync - ForceSyncEvent force_sync = 3; - - // Settings have changed, reload if needed - SettingsReloadedEvent settings_reloaded = 4; - - // Request graceful shutdown - ShutdownEvent shutdown = 5; - - // History was rebuilt - search index needs full rebuild - HistoryRebuiltEvent history_rebuilt = 6; - } -} - -message SendEventResponse { - // Empty on success; errors come through gRPC status -} - -// Individual event message types - -message HistoryPrunedEvent { - // No fields needed - just signals that pruning happened -} - -message HistoryRebuiltEvent { - // No fields needed - just signals that rebuilding happened -} - -message HistoryDeletedEvent { - // IDs of deleted history items (UUIDs as strings) - repeated string ids = 1; -} + // Tell the daemon to perform a sync operation. + rpc ForceSync(ForceSyncRequest) returns (ForceSyncReply); -message ForceSyncEvent { - // No fields needed - just triggers sync + // Query the daemon for it's status. + rpc Status(StatusRequest) returns (StatusReply); } -message SettingsReloadedEvent { - // No fields needed - components should re-read settings +message ForceSyncRequest {} +message ForceSyncReply { + bool accepted = 1; } -message ShutdownEvent { - // No fields needed - triggers graceful shutdown +message StatusRequest {} +message StatusReply { + bool healthy = 1; + string version = 2; + uint32 pid = 3; + uint32 protocol = 4; } diff --git a/crates/daemon/proto/history.proto b/crates/daemon/proto/history.proto index 59c12471..46a41a5e 100644 --- a/crates/daemon/proto/history.proto +++ b/crates/daemon/proto/history.proto @@ -1,8 +1,13 @@ syntax = "proto3"; package history; +service History { + rpc StartHistory(StartHistoryRequest) returns (StartHistoryReply); + rpc EndHistory(EndHistoryRequest) returns (EndHistoryReply); + rpc TailHistory(TailHistoryRequest) returns (stream TailHistoryReply); +} + 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; @@ -11,19 +16,17 @@ message StartHistoryRequest { 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 EndHistoryRequest { + string id = 1; + int64 exit = 2; + uint64 duration = 3; +} message EndHistoryReply { string id = 1; uint64 idx = 2; @@ -31,22 +34,12 @@ message EndHistoryReply { 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; -} message TailHistoryRequest {} +message TailHistoryReply { + HistoryEventKind kind = 1; + HistoryEntry history = 2; +} enum HistoryEventKind { HISTORY_EVENT_KIND_UNSPECIFIED = 0; @@ -66,16 +59,3 @@ message HistoryEntry { int64 exit = 9; int64 duration = 10; } - -message TailHistoryReply { - HistoryEventKind kind = 1; - HistoryEntry history = 2; -} - -service History { - rpc StartHistory(StartHistoryRequest) returns (StartHistoryReply); - rpc EndHistory(EndHistoryRequest) returns (EndHistoryReply); - rpc TailHistory(TailHistoryRequest) returns (stream TailHistoryReply); - rpc Status(StatusRequest) returns (StatusReply); - rpc Shutdown(ShutdownRequest) returns (ShutdownReply); -} diff --git a/crates/daemon/proto/semantic.proto b/crates/daemon/proto/semantic.proto deleted file mode 100644 index 07e550c8..00000000 --- a/crates/daemon/proto/semantic.proto +++ /dev/null @@ -1,47 +0,0 @@ -syntax = "proto3"; -package semantic; - -service Semantic { - rpc RecordCommands(stream CommandCapture) returns (RecordCommandsReply); - rpc CommandOutput(CommandOutputRequest) returns (CommandOutputReply); -} - -message CommandCapture { - string prompt = 1; - string command = 2; - string output = 3; - optional int32 exit_code = 4; - optional string history_id = 5; - optional string session_id = 6; - bool output_truncated = 7; - uint64 output_observed_bytes = 8; -} - -message RecordCommandsReply { - uint64 accepted = 1; -} - -message CommandOutputRequest { - string history_id = 1; - repeated OutputRange ranges = 2; -} - -message OutputRange { - int64 start = 1; - int64 end = 2; -} - -message OutputLine { - uint64 line_number = 1; - string content = 2; -} - -message CommandOutputReply { - bool found = 1; - string output = 2; - uint64 total_bytes = 3; - uint64 total_lines = 4; - repeated OutputLine lines = 5; - bool output_truncated = 6; - uint64 output_observed_bytes = 7; -} |
