Refactor and clean up code across multiple modules

- Simplified token type assignment in OAuth service.
- Removed unused session_lock module and re-exported Session from zesdex_entities.
- Cleaned up session entity by removing unnecessary comments and code.
- Consolidated session handling in HTTP handlers for better readability.
- Improved formatting and readability in OAuth repository tests.
- Enhanced session lock repository with clearer match statements.
- Streamlined session repository error handling.
- Refined RNG tests for better clarity.
- Adjusted module visibility and organization in lib.rs.
- Updated IPC client and connection code for better error handling and clarity.
- Improved frame handling in IPC for better readability.
- Organized module imports and added test utilities for IPC.
- Enhanced database connection error handling.
- Simplified JWT token creation error handling.
- Improved password verification error handling.
- Cleaned up state management code for better readability.
- Refactored middleware for session authentication and rate limiting.
- Simplified clipboard utility for better error handling.
- Enhanced logging initialization for better error reporting.
- Improved pagination utility with clearer method annotations.
- Cleaned up sanitization functions for filenames and paths.
- Enhanced slug generation functions for better clarity and usability.
This commit is contained in:
asepharyana
2026-07-17 09:08:41 +07:00
parent 22dd6fdda7
commit 1f0ae9f551
95 changed files with 1792 additions and 2131 deletions
+25 -24
View File
@@ -9,6 +9,7 @@
//! Also provides a pipeline variant: `spawn_pipeline` runs agents
//! sequentially so each stage sees the previous stage's findings.
use super::{Tool, ToolCtx};
use crate::app::workflow::engine::PrimitiveCtx;
use crate::app::workflow::script::{ScriptOptions, ScriptPrimitive, WorkflowScript};
use anyhow::{anyhow, Result};
use serde_json::{json, Value};
@@ -114,18 +115,18 @@ impl Tool for SpawnAgents {
// spawn_agents or workflow_run invocations.
let findings: Arc<Mutex<Vec<String>>> = Arc::new(Mutex::new(Vec::new()));
let no_abort: Option<std::sync::Arc<std::sync::atomic::AtomicBool>> = None;
let results = crate::app::workflow::engine::execute_primitive(
&wf.script,
&HashMap::new(),
max_concurrency,
true,
&no_abort,
live.as_ref(),
&ctx.session_dir,
&ctx.workspaces,
&findings,
None, // no per-agent timeout for spawn_agents
)?;
let results = crate::app::workflow::engine::execute_primitive(PrimitiveCtx {
primitive: &wf.script,
args: &HashMap::new(),
concurrency_cap: max_concurrency,
continue_on_error: true,
abort_flag: &no_abort,
live: live.as_ref(),
session_dir: &ctx.session_dir,
workspaces: &ctx.workspaces,
findings: &findings,
timeout_ms: None,
})?;
Ok(format_results(&results, "parallel"))
}
}
@@ -210,18 +211,18 @@ impl Tool for SpawnPipeline {
// other concurrent spawn_agents / spawn_pipeline / workflow_run.
let findings: Arc<Mutex<Vec<String>>> = Arc::new(Mutex::new(Vec::new()));
let no_abort: Option<std::sync::Arc<std::sync::atomic::AtomicBool>> = None;
let results = crate::app::workflow::engine::execute_primitive(
&wf.script,
&HashMap::new(),
1,
false,
&no_abort,
live.as_ref(),
&ctx.session_dir,
&ctx.workspaces,
&findings,
None, // no per-agent timeout for spawn_pipeline
)?;
let results = crate::app::workflow::engine::execute_primitive(PrimitiveCtx {
primitive: &wf.script,
args: &HashMap::new(),
concurrency_cap: 1,
continue_on_error: false,
abort_flag: &no_abort,
live: live.as_ref(),
session_dir: &ctx.session_dir,
workspaces: &ctx.workspaces,
findings: &findings,
timeout_ms: None,
})?;
Ok(format_results(&results, "pipeline"))
}
}