Skip to content

Commit 97ed7c0

Browse files
committed
refactor: update system prompt paths and tool constants for multi-agent support
1 parent a9ea2a1 commit 97ed7c0

File tree

5 files changed

+52
-83
lines changed

5 files changed

+52
-83
lines changed

.github/changelogithub.config.js

Lines changed: 0 additions & 55 deletions
This file was deleted.

prompts/system.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ Within this context, VTAgent refers to the open-source agentic coding interface
2121
2222
## AVAILABLE TOOLS
2323
- **File Operations**: list_files, read_file, write_file, edit_file
24-
- **Search & Analysis**: rp_search, grep_search, ast_grep_search
25-
- **Terminal Access**: run_terminal_cmd for shell operations
26-
- **PTY Access**: Enhanced terminal emulation for interactive commands
24+
- **Search & Analysis**: rp_search (with modes: exact, fuzzy, multi, similarity)
25+
- **Terminal Access**: run_terminal_cmd (with modes: terminal, pty, streaming)
2726
2827
### Advanced Code Analysis
2928
VTAgent provides intelligent code analysis tools that understand code structure:
3029
- **Ripgrep Search**: Fast text search with regex patterns using ripgrep
31-
- **AST Grep Search**: Syntax-aware code search using AST patterns
30+
- **Multi-mode Search**: Exact, fuzzy, multi-pattern, and similarity search
3231
- **File Operations**: Read, write, and edit files with full path support
32+
- **Enhanced Terminal**: Terminal, PTY, and streaming command execution modes
3333
3434
**Search Pattern Examples:**
3535
- Find function definitions: `^fn \w+`
@@ -40,7 +40,7 @@ VTAgent provides intelligent code analysis tools that understand code structure:
4040
### Batch Operations
4141
- **Multiple file operations** in sequence for complex tasks
4242
- **Terminal command execution** with multiple modes (terminal, pty, streaming)
43-
- **Search operations** across the entire workspace
43+
- **Search operations** across the entire workspace with different algorithms
4444
4545
## REFACTORED UTILITIES
4646
The codebase has been designed with modularity in mind. Common utility functions are available:

vtagent-core/src/config/constants.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/// Prompt path constants to avoid hardcoding throughout the codebase
22
pub mod prompts {
33
pub const DEFAULT_SYSTEM_PROMPT_PATH: &str = "prompts/system.md";
4+
pub const ORCHESTRATOR_SYSTEM_PROMPT_PATH: &str = "prompts/orchestrator_system.md";
5+
pub const EXPLORER_SYSTEM_PROMPT_PATH: &str = "prompts/explorer_system.md";
6+
pub const CODER_SYSTEM_PROMPT_PATH: &str = "prompts/coder_system.md";
47
}
58

69
/// Model ID constants to sync with docs/models.json
@@ -186,4 +189,20 @@ pub mod tools {
186189
pub const CREATE_FILE: &str = "create_file";
187190
pub const GREP_SEARCH: &str = "grep_search";
188191
pub const AST_GREP_SEARCH: &str = "ast_grep_search";
192+
193+
// Multi-agent specific tools
194+
pub const TASK_CREATE: &str = "task_create";
195+
pub const LAUNCH_SUBAGENT: &str = "launch_subagent";
196+
pub const ADD_CONTEXT: &str = "add_context";
197+
pub const FINISH: &str = "finish";
198+
pub const CONTEXT_SEARCH: &str = "context_search";
199+
pub const TASK_STATUS: &str = "task_status";
200+
201+
// Explorer-specific tools
202+
pub const FILE_METADATA: &str = "file_metadata";
203+
pub const PROJECT_OVERVIEW: &str = "project_overview";
204+
pub const TREE_SITTER_ANALYZE: &str = "tree_sitter_analyze";
205+
206+
// Special wildcard for full access
207+
pub const WILDCARD_ALL: &str = "*";
189208
}

vtagent-core/src/core/agent/multi_agent.rs

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use crate::config::models::{ModelId, Provider};
44
use crate::config::{ContextStoreDefaults, MultiAgentDefaults};
5-
use crate::config::constants::tools;
5+
use crate::config::constants::{tools, prompts};
66
use serde::{Deserialize, Serialize};
77
use std::collections::HashMap;
88
use std::time::{Duration, SystemTime};
@@ -24,38 +24,38 @@ impl AgentType {
2424
/// Get the system prompt file path for this agent type
2525
pub fn system_prompt_path(&self) -> &'static str {
2626
match self {
27-
AgentType::Orchestrator => "prompts/orchestrator_system.md",
28-
AgentType::Explorer => "prompts/explorer_system.md",
29-
AgentType::Coder => "prompts/coder_system.md",
30-
AgentType::Single => "prompts/default_system.md",
27+
AgentType::Orchestrator => prompts::ORCHESTRATOR_SYSTEM_PROMPT_PATH,
28+
AgentType::Explorer => prompts::EXPLORER_SYSTEM_PROMPT_PATH,
29+
AgentType::Coder => prompts::CODER_SYSTEM_PROMPT_PATH,
30+
AgentType::Single => prompts::DEFAULT_SYSTEM_PROMPT_PATH,
3131
}
3232
}
3333

3434
/// Get allowed tools for this agent type
3535
pub fn allowed_tools(&self) -> Vec<&'static str> {
3636
match self {
3737
AgentType::Orchestrator => vec![
38-
"task_create",
39-
"launch_subagent",
40-
"add_context",
41-
"finish",
42-
"context_search",
43-
"task_status",
38+
tools::TASK_CREATE,
39+
tools::LAUNCH_SUBAGENT,
40+
tools::ADD_CONTEXT,
41+
tools::FINISH,
42+
tools::CONTEXT_SEARCH,
43+
tools::TASK_STATUS,
4444
],
4545
AgentType::Explorer => vec![
4646
tools::READ_FILE,
4747
tools::GREP_SEARCH,
4848
tools::RUN_TERMINAL_CMD,
49-
"file_metadata",
50-
"project_overview",
51-
"tree_sitter_analyze",
49+
tools::FILE_METADATA,
50+
tools::PROJECT_OVERVIEW,
51+
tools::TREE_SITTER_ANALYZE,
5252
tools::AST_GREP_SEARCH,
5353
],
5454
AgentType::Coder => vec![
55-
"*", // Full access to all tools
55+
tools::WILDCARD_ALL, // Full access to all tools
5656
],
5757
AgentType::Single => vec![
58-
"*", // Full access for backward compatibility
58+
tools::WILDCARD_ALL, // Full access for backward compatibility
5959
],
6060
}
6161
}
@@ -70,7 +70,12 @@ impl AgentType {
7070
tools::DELETE_FILE,
7171
tools::RUN_TERMINAL_CMD,
7272
],
73-
AgentType::Explorer => vec![tools::WRITE_FILE, tools::EDIT_FILE, tools::DELETE_FILE, tools::CREATE_FILE],
73+
AgentType::Explorer => vec![
74+
tools::WRITE_FILE,
75+
tools::EDIT_FILE,
76+
tools::DELETE_FILE,
77+
tools::CREATE_FILE
78+
],
7479
AgentType::Coder => vec![], // No restrictions
7580
AgentType::Single => vec![], // No restrictions
7681
}

vtagent-core/src/tools/registry.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ impl ToolRegistry {
108108
/// List available tools
109109
pub fn available_tools(&self) -> Vec<String> {
110110
vec![
111-
"rp_search".to_string(),
112-
"list_files".to_string(),
113-
"run_terminal_cmd".to_string(),
114-
"read_file".to_string(),
115-
"write_file".to_string(),
116-
"edit_file".to_string(),
111+
tools::RP_SEARCH.to_string(),
112+
tools::LIST_FILES.to_string(),
113+
tools::RUN_TERMINAL_CMD.to_string(),
114+
tools::READ_FILE.to_string(),
115+
tools::WRITE_FILE.to_string(),
116+
tools::EDIT_FILE.to_string(),
117117
]
118118
}
119119

0 commit comments

Comments
 (0)