refactor: remove agent mode and related functionality; update help and README

This commit is contained in:
asepharyana
2026-07-12 03:22:55 +07:00
parent df5775a272
commit 3cfe39e5f2
15 changed files with 8 additions and 144 deletions
+3 -10
View File
@@ -7,7 +7,7 @@ Zesdex is a Rust-powered AI assistant that operates directly in your terminal vi
## Features ## Features
- **TUI Interface** — Full-screen terminal UI with chat panel, input bar, and status bar built with ratatui and crossterm. - **TUI Interface** — Full-screen terminal UI with chat panel, input bar, and status bar built with ratatui and crossterm.
- **Multi-Agent Modes** — Auto (full autonomy), Normal (review risky ops), Plan (no mutations), Yolo (unrestricted).
- **Rich Tool System** — 20+ built-in tools for file operations, searching, bash execution, git operations, web access, memory management, and workflow orchestration. - **Rich Tool System** — 20+ built-in tools for file operations, searching, bash execution, git operations, web access, memory management, and workflow orchestration.
- **Daemon Architecture** — Run as a background daemon with client attach/detach via Unix domain sockets. - **Daemon Architecture** — Run as a background daemon with client attach/detach via Unix domain sockets.
- **IPC Protocol** — Bidirectional state synchronization between daemon and client processes. - **IPC Protocol** — Bidirectional state synchronization between daemon and client processes.
@@ -27,7 +27,7 @@ src/
├── app/ # Application core ├── app/ # Application core
│ ├── state/ # State management (AppStateRest, types, misc) │ ├── state/ # State management (AppStateRest, types, misc)
│ ├── runtime/ # Action dispatch and event loop │ ├── runtime/ # Action dispatch and event loop
│ ├── mode/ # Agent mode definitions (Auto/Normal/Plan/Yolo) │ ├── mode/ # UI modes and overlays
│ ├── harness.rs # Tool harness for agent execution │ ├── harness.rs # Tool harness for agent execution
│ ├── workflow/ # Workflow engine (script, engine) │ ├── workflow/ # Workflow engine (script, engine)
│ ├── mcp/ # Model Context Protocol manager │ ├── mcp/ # Model Context Protocol manager
@@ -111,7 +111,7 @@ RUST_LOG=debug zesdex
| `Ctrl+Q` | Quit | | `Ctrl+Q` | Quit |
| `Ctrl+H` | Help overlay | | `Ctrl+H` | Help overlay |
| `Ctrl+P` | Settings overlay | | `Ctrl+P` | Settings overlay |
| `Ctrl+A` | Cycle agent mode | | `Ctrl+A` | Toggle yolo arm |
| `Ctrl+B` | Bash panel | | `Ctrl+B` | Bash panel |
| `Ctrl+S` | Session hub | | `Ctrl+S` | Session hub |
| `Ctrl+T` | Task list | | `Ctrl+T` | Task list |
@@ -132,13 +132,6 @@ RUST_LOG=debug zesdex
| `/settings` | Open settings | | `/settings` | Open settings |
| `/session` | Session management | | `/session` | Session management |
## Agent Modes
- **Auto** — Full autonomy. The agent can read, write, edit files, run bash commands, and execute git operations without confirmation.
- **Normal** — Risky operations (write, delete, edit, bash, destructive git) require manual approval.
- **Plan** — Planning mode. The agent can analyze and propose changes but cannot execute mutations.
- **Yolo** — Unrestricted mode. Full autonomy with no confirmation prompts.
## Security ## Security
Zesdex includes multiple layers of security: Zesdex includes multiple layers of security:
+1 -1
View File
@@ -10,6 +10,6 @@ Core principles:
7. Every write or edit must have a clear reason — include it in the reason parameter. 7. Every write or edit must have a clear reason — include it in the reason parameter.
8. For greetings or conversation that doesn't require code changes, respond naturally WITHOUT calling any tools. 8. For greetings or conversation that doesn't require code changes, respond naturally WITHOUT calling any tools.
9. After making changes, verify they work by running builds or tests. 9. After making changes, verify they work by running builds or tests.
10. Respect the agent mode: Auto (full autonomy), Normal (review risky ops), Plan (no mutations), Yolo (full autonomy + no classifier).
Available tools are described in the system-tools.txt section. Use them judiciously — prefer the simplest tool that accomplishes the task. Available tools are described in the system-tools.txt section. Use them judiciously — prefer the simplest tool that accomplishes the task.
-10
View File
@@ -1,10 +0,0 @@
use crate::app::state::rest::AppStateRest;
pub fn get_agent_count(state: &AppStateRest) -> usize {
state.session_runtime.as_ref().map_or(0, |rt| rt.subagent_queue)
}
pub fn get_active_agents(state: &AppStateRest) -> Vec<String> {
let count = get_agent_count(state);
(0..count).map(|i| format!("agent-{}", i)).collect()
}
-65
View File
@@ -32,31 +32,12 @@ impl EditorState {
} }
} }
pub fn change_line(&mut self, text: String) {
self.save_undo();
if self.cursor_line < self.content.len() {
self.content[self.cursor_line] = text;
}
}
pub fn insert_line_after(&mut self) { pub fn insert_line_after(&mut self) {
self.save_undo(); self.save_undo();
let pos = (self.cursor_line + 1).min(self.content.len()); let pos = (self.cursor_line + 1).min(self.content.len());
self.content.insert(pos, String::new()); self.content.insert(pos, String::new());
} }
pub fn delete_current_line(&mut self) {
if self.content.len() <= 1 {
return;
}
self.save_undo();
self.content.remove(self.cursor_line);
if self.cursor_line >= self.content.len() {
self.cursor_line = self.content.len() - 1;
}
self.cursor_col = 0;
}
fn save_undo(&mut self) { fn save_undo(&mut self) {
self.undo_stack.push(self.content.clone()); self.undo_stack.push(self.content.clone());
if self.undo_stack.len() > 50 { if self.undo_stack.len() > 50 {
@@ -64,23 +45,6 @@ impl EditorState {
} }
} }
pub fn undo(&mut self) {
if let Some(prev) = self.undo_stack.pop() {
self.content = prev;
self.cursor_line = self.cursor_line.min(self.content.len().saturating_sub(1));
self.cursor_col = 0;
}
}
pub fn cursor_up(&mut self) {
if self.cursor_line > 0 {
self.cursor_line -= 1;
}
self.cursor_col = self.cursor_col.min(
self.content.get(self.cursor_line).map(|l| l.len()).unwrap_or(0),
);
}
pub fn cursor_down(&mut self) { pub fn cursor_down(&mut self) {
if self.cursor_line + 1 < self.content.len() { if self.cursor_line + 1 < self.content.len() {
self.cursor_line += 1; self.cursor_line += 1;
@@ -90,26 +54,6 @@ impl EditorState {
); );
} }
pub fn cursor_left(&mut self) {
if self.cursor_col > 0 {
self.cursor_col -= 1;
} else if self.cursor_line > 0 {
self.cursor_line -= 1;
self.cursor_col = self.content.get(self.cursor_line).map(|l| l.len()).unwrap_or(0);
}
}
pub fn cursor_right(&mut self) {
if let Some(line) = self.content.get(self.cursor_line) {
if self.cursor_col < line.len() {
self.cursor_col += 1;
} else if self.cursor_line + 1 < self.content.len() {
self.cursor_line += 1;
self.cursor_col = 0;
}
}
}
pub fn insert_char(&mut self, c: char) { pub fn insert_char(&mut self, c: char) {
self.save_undo(); self.save_undo();
if let Some(line) = self.content.get_mut(self.cursor_line) { if let Some(line) = self.content.get_mut(self.cursor_line) {
@@ -134,15 +78,6 @@ impl EditorState {
} }
} }
pub fn join_lines(&mut self) {
if self.cursor_line + 1 >= self.content.len() {
return;
}
self.save_undo();
let next = self.content.remove(self.cursor_line + 1);
self.content[self.cursor_line].push_str(&next);
}
pub fn as_string(&self) -> String { pub fn as_string(&self) -> String {
self.content.join("\n") self.content.join("\n")
} }
+1 -1
View File
@@ -20,7 +20,7 @@ Keybindings:
Slash commands: Slash commands:
/help Show this help /help Show this help
/quit Quit session /quit Quit session
/mode <name> Switch mode (chat, agents, bash, workflow) /mode <name> Switch mode (chat, bash, workflow)
/lesson <text> Create a lesson /lesson <text> Create a lesson
/lesson list List lessons /lesson list List lessons
/lesson export Export lessons /lesson export Export lessons
-1
View File
@@ -15,7 +15,6 @@ pub mod todo;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum ModeKind { pub enum ModeKind {
Chat, Chat,
Agents,
Bash, Bash,
Workflow, Workflow,
Help, Help,
-1
View File
@@ -72,7 +72,6 @@ pub fn apply_action(state: &mut AppStateRest, action: Action) {
Action::SwitchMode(mode) => { Action::SwitchMode(mode) => {
state.misc.overlay = match mode { state.misc.overlay = match mode {
ModeKind::Chat ModeKind::Chat
| ModeKind::Agents
| ModeKind::Bash | ModeKind::Bash
| ModeKind::Workflow => Overlay::None, | ModeKind::Workflow => Overlay::None,
ModeKind::Help => Overlay::Help, ModeKind::Help => Overlay::Help,
-1
View File
@@ -38,7 +38,6 @@ pub enum Overlay {
None, None,
Help, Help,
Settings, Settings,
Agents,
Bash, Bash,
QuitConfirm, QuitConfirm,
Workflow, Workflow,
-14
View File
@@ -22,23 +22,9 @@ impl AgentDefinition {
} }
} }
pub fn with_system_prompt(mut self, prompt: String) -> Self {
self.system_prompt = Some(prompt);
self
}
pub fn with_allowed_tools(mut self, tools: Vec<String>) -> Self {
self.allowed_tools = Some(tools);
self
}
pub fn with_max_steps(mut self, steps: usize) -> Self { pub fn with_max_steps(mut self, steps: usize) -> Self {
self.max_steps = Some(steps); self.max_steps = Some(steps);
self self
} }
pub fn with_temperature(mut self, temp: f32) -> Self {
self.temperature = Some(temp);
self
}
} }
-1
View File
@@ -41,7 +41,6 @@ pub fn parse_command(text: &str) -> Command {
"/mode" => { "/mode" => {
let mode = match arg1 { let mode = match arg1 {
"chat" | "c" => ModeKind::Chat, "chat" | "c" => ModeKind::Chat,
"agents" | "a" => ModeKind::Agents,
"bash" | "b" => ModeKind::Bash, "bash" | "b" => ModeKind::Bash,
"workflow" | "w" => ModeKind::Workflow, "workflow" | "w" => ModeKind::Workflow,
"help" | "h" => ModeKind::Help, "help" | "h" => ModeKind::Help,
+1 -1
View File
@@ -204,7 +204,7 @@ fn apply_client_update(
state.misc.overlay = match payload.overlay.as_deref() { state.misc.overlay = match payload.overlay.as_deref() {
Some("Help") => Overlay::Help, Some("Help") => Overlay::Help,
Some("Settings") => Overlay::Settings, Some("Settings") => Overlay::Settings,
Some("Agents") => Overlay::Agents,
Some("Bash") => Overlay::Bash, Some("Bash") => Overlay::Bash,
Some("QuitConfirm") => Overlay::QuitConfirm, Some("QuitConfirm") => Overlay::QuitConfirm,
Some("Workflow") => Overlay::Workflow, Some("Workflow") => Overlay::Workflow,
+1 -7
View File
@@ -8,7 +8,7 @@ Navigation:
Ctrl+Q Quit Ctrl+Q Quit
Ctrl+H Help (this screen) Ctrl+H Help (this screen)
Ctrl+P Settings Ctrl+P Settings
Ctrl+A Cycle agent mode (Auto/Normal/Plan/Yolo) Ctrl+A Toggle yolo arm
Ctrl+B Bash panel Ctrl+B Bash panel
Ctrl+S Session hub Ctrl+S Session hub
Ctrl+T Task list Ctrl+T Task list
@@ -18,12 +18,6 @@ Navigation:
Tab Autocomplete Tab Autocomplete
Up/Down History navigation Up/Down History navigation
Modes:
Auto Automatic approval of most operations
Normal Manual approval for risky operations
Plan Planning mode - no code changes
Yolo Unrestricted - full autonomy
Input: Input:
/help Show help /help Show help
/clear Clear screen /clear Clear screen
-14
View File
@@ -42,20 +42,6 @@ impl LlmClient {
} }
} }
pub fn chat(&self, messages: &[ChatMessage]) -> Result<String> {
let response = self.chat_with_tools(messages, None)?;
Ok(response.content.unwrap_or_default())
}
pub fn chat_with_tools(
&self,
messages: &[ChatMessage],
tools: Option<Vec<ToolDef>>,
) -> Result<ChatMessage> {
let (msg, _usage) = self.chat_with_tools_non_streaming(messages, tools)?;
Ok(msg)
}
pub fn chat_with_tools_non_streaming( pub fn chat_with_tools_non_streaming(
&self, &self,
messages: &[ChatMessage], messages: &[ChatMessage],
+1 -15
View File
@@ -93,21 +93,7 @@ fn render_overlay(frame: &mut Frame, area: Rect, overlay: crate::app::state::typ
let paragraph = Paragraph::new(lines).block(block); let paragraph = Paragraph::new(lines).block(block);
frame.render_widget(paragraph, overlay_area); frame.render_widget(paragraph, overlay_area);
} }
crate::app::state::types::Overlay::Agents => {
let block = block.title(" Agents ");
let lines = vec![
Line::from(Span::styled(
"Sub-agent management panel",
Style::default().fg(Theme::TEXT),
)),
Line::from(Span::styled(
format!("Subagent queue: {}", state.session_runtime.as_ref().map(|r| r.subagent_queue).unwrap_or(0)),
Style::default().fg(Theme::INFO),
)),
];
let paragraph = Paragraph::new(lines).block(block);
frame.render_widget(paragraph, overlay_area);
}
crate::app::state::types::Overlay::Bash => { crate::app::state::types::Overlay::Bash => {
let block = block.title(" Bash "); let block = block.title(" Bash ");
let lines: Vec<Line> = state.session_runtime.as_ref().map(|r| { let lines: Vec<Line> = state.session_runtime.as_ref().map(|r| {
-2
View File
@@ -19,7 +19,5 @@ impl Theme {
pub const BG: Color = Color::Reset; pub const BG: Color = Color::Reset;
pub const STATUS_BAR_BG: Color = Color::Blue; pub const STATUS_BAR_BG: Color = Color::Blue;
pub const MODE_AUTO: Color = Color::Green; pub const MODE_AUTO: Color = Color::Green;
pub const MODE_NORMAL: Color = Color::Yellow;
pub const MODE_PLAN: Color = Color::Cyan;
pub const MODE_YOLO: Color = Color::Red; pub const MODE_YOLO: Color = Color::Red;
} }