feat: Enhance OAuth module and OpenRouter client functionality
- Updated OAuth module to include unused imports for better clarity. - Refactored OpenRouterClient to improve chat functionality and added support for tools in chat requests. - Modified internet tools (Download, Fetch, Search) to use a more flexible internet mode check. - Introduced new Bash tools for managing background jobs (BashOutput, BashKill). - Enhanced workflow tool to parse and execute workflow scripts with arguments. - Updated status and workflow views to reflect new agent and findings counts. - Added IPC protocol definitions for client requests and state payloads.
This commit is contained in:
+32
-5
@@ -1,12 +1,13 @@
|
||||
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
|
||||
|
||||
use crate::app::mode;
|
||||
use crate::app::runtime::actions::Action;
|
||||
use crate::app::runtime::commands::apply_command;
|
||||
use crate::app::state::rest::AppStateRest;
|
||||
use crate::app::state::types::Overlay;
|
||||
use crate::controller::command::parse_command;
|
||||
|
||||
pub fn handle_key(key: KeyEvent, state: &AppStateRest) -> Vec<Action> {
|
||||
pub fn handle_key(key: KeyEvent, state: &mut AppStateRest) -> Vec<Action> {
|
||||
match key.code {
|
||||
KeyCode::Char('c') if key.modifiers.contains(KeyModifiers::CONTROL) => {
|
||||
vec![Action::QuitConfirm]
|
||||
@@ -57,11 +58,19 @@ pub fn handle_key(key: KeyEvent, state: &AppStateRest) -> Vec<Action> {
|
||||
KeyCode::Char('a') if key.modifiers.contains(KeyModifiers::CONTROL) => {
|
||||
vec![Action::ToggleYoloArm]
|
||||
}
|
||||
KeyCode::Char('m') if key.modifiers.contains(KeyModifiers::CONTROL) => {
|
||||
vec![Action::CycleAgentMode]
|
||||
}
|
||||
KeyCode::Char('b') if key.modifiers.contains(KeyModifiers::CONTROL) => {
|
||||
vec![Action::OpenOverlay(Overlay::Bash)]
|
||||
}
|
||||
KeyCode::Char('s') if key.modifiers.contains(KeyModifiers::CONTROL) => {
|
||||
vec![Action::OpenOverlay(Overlay::SessionHub)]
|
||||
KeyCode::Char('s') if key.modifiers.contains(KeyModifiers::CONTROL)
|
||||
&& !key.modifiers.contains(KeyModifiers::SHIFT) =>
|
||||
{
|
||||
vec![Action::RefreshSessions, Action::OpenOverlay(Overlay::SessionHub)]
|
||||
}
|
||||
KeyCode::Char('S') if key.modifiers.contains(KeyModifiers::CONTROL) => {
|
||||
vec![Action::OpenOverlay(Overlay::Security)]
|
||||
}
|
||||
KeyCode::Char('t') if key.modifiers.contains(KeyModifiers::CONTROL) => {
|
||||
vec![Action::OpenOverlay(Overlay::Todo)]
|
||||
@@ -95,10 +104,28 @@ pub fn handle_key(key: KeyEvent, state: &AppStateRest) -> Vec<Action> {
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_overlay_enter(state: &AppStateRest) -> Vec<Action> {
|
||||
fn handle_overlay_enter(state: &mut AppStateRest) -> Vec<Action> {
|
||||
match state.misc.overlay {
|
||||
Overlay::Bash => {
|
||||
let command = state.input.buffer.clone();
|
||||
mode::bash::handle_bash_submit(state, command);
|
||||
Vec::new()
|
||||
}
|
||||
Overlay::Settings => {
|
||||
mode::settings::cycle_internet_mode(&mut state.settings);
|
||||
state.dirty = true;
|
||||
Vec::new()
|
||||
}
|
||||
Overlay::Todo => {
|
||||
mode::todo::handle_todo_toggle(state);
|
||||
Vec::new()
|
||||
}
|
||||
Overlay::Security => {
|
||||
mode::security::handle_security_action(state, &Action::ToggleYoloArm);
|
||||
Vec::new()
|
||||
}
|
||||
Overlay::QuitConfirm => {
|
||||
vec![Action::ForceQuit]
|
||||
vec![mode::quit_confirm::handle_quit_confirm(true)]
|
||||
}
|
||||
_ => Vec::new(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user