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:
asepharyana
2026-07-11 20:21:59 +07:00
parent c1ad206a00
commit 802d9677ae
42 changed files with 1423 additions and 925 deletions
+32 -5
View File
@@ -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(),
}