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
-2
View File
@@ -1,2 +0,0 @@
#[expect(dead_code)]
pub mod sessions;
@@ -1,16 +0,0 @@
use crate::app::state::rest::AppStateRest;
use crate::app::state::types::ToastKind;
pub struct DeferredOp {
pub kind: String,
pub handler: Box<dyn FnOnce(&mut AppStateRest) + Send>,
}
pub fn run_deferred(state: &mut AppStateRest, op: DeferredOp) {
let kind = op.kind.clone();
(op.handler)(state);
state.push_toast(crate::app::state::types::Toast::new(
ToastKind::Info,
format!("deferred '{}' completed", kind),
));
}
@@ -1,27 +0,0 @@
use std::path::PathBuf;
use crate::model::session::Session;
#[expect(dead_code)]
pub struct SessionManager {
pub current_id: String,
pub base_dir: PathBuf,
pub sessions: Vec<Session>,
}
impl SessionManager {
pub fn new(base_dir: PathBuf) -> Self {
SessionManager {
current_id: String::new(),
base_dir,
sessions: Vec::new(),
}
}
pub fn load_sessions(&mut self) {
self.sessions = Session::list(&self.base_dir);
}
pub fn find_by_id(&self, id: &str) -> Option<&Session> {
self.sessions.iter().find(|s| s.id == id)
}
}