diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-06-10 22:01:45 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-06-10 22:01:45 +0200 |
| commit | 5e31a81cd2207f053b8cd8ad84ebe2a2f691b29d (patch) | |
| tree | 5d76811ab0d693c01fa472d41aa2ceaf3bd0b415 /crates/atuin-ai/src/tui/events.rs | |
| parent | chore: Remove unneeded files (diff) | |
| download | atuin-5e31a81cd2207f053b8cd8ad84ebe2a2f691b29d.zip | |
chore: Remove some unused rust code
Diffstat (limited to 'crates/atuin-ai/src/tui/events.rs')
| -rw-r--r-- | crates/atuin-ai/src/tui/events.rs | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/crates/atuin-ai/src/tui/events.rs b/crates/atuin-ai/src/tui/events.rs deleted file mode 100644 index abcb1bd9..00000000 --- a/crates/atuin-ai/src/tui/events.rs +++ /dev/null @@ -1,67 +0,0 @@ -/// Application-domain events emitted by UI components. -/// -/// Components translate raw key events into these semantic events, -/// which are sent via an `mpsc::Sender<AiTuiEvent>` provided through -/// eye-declare's context system. The main event loop in `inline.rs` -/// receives them and mutates `AppState` accordingly. -#[derive(Debug)] -pub(crate) enum AiTuiEvent { - /// User updated the input text - InputUpdated(String), - /// User submitted text input (Enter in Input mode) - SubmitInput(String), - /// User entered a slash command (e.g. "/help") - #[allow(unused)] - SlashCommand(String), - /// User selected a permission - SelectPermission(PermissionResult), - /// Cancel active generation or streaming (Esc during Generating/Streaming) - CancelGeneration, - /// Execute the suggested command - ExecuteCommand, - /// Insert command without executing - InsertCommand, - /// Cancel confirmation of dangerous command - CancelConfirmation, - /// Interrupt a running tool execution (Ctrl+C during ExecutingPreview) - InterruptToolExecution, - /// Retry after error - Retry, - /// Exit the application - Exit, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub(crate) enum PermissionResult { - Allow, - /// Per-file, time-limited grant scoped to the current session. - AllowFileForSession, - AlwaysAllowInDir, - AlwaysAllow, - Deny, -} - -impl PermissionResult { - /// String identifier used as the SelectOption value. - pub fn as_value_str(&self) -> &'static str { - match self { - Self::Allow => "allow", - Self::AllowFileForSession => "allow-file-session", - Self::AlwaysAllowInDir => "always-allow-in-dir", - Self::AlwaysAllow => "always-allow", - Self::Deny => "deny", - } - } - - /// Parse from a SelectOption value string. - pub fn from_value_str(s: &str) -> Option<Self> { - match s { - "allow" => Some(Self::Allow), - "allow-file-session" => Some(Self::AllowFileForSession), - "always-allow-in-dir" => Some(Self::AlwaysAllowInDir), - "always-allow" => Some(Self::AlwaysAllow), - "deny" => Some(Self::Deny), - _ => None, - } - } -} |
