feat(mcp): enhance MCP server registration with error handling and improve transport process management

refactor: update various tools for better error handling and path resolution
fix: improve markdown rendering and input display in TUI
This commit is contained in:
asepharyana
2026-07-20 13:12:04 +07:00
parent 89ee213454
commit 148ba4e07b
17 changed files with 242 additions and 82 deletions
+8 -1
View File
@@ -55,7 +55,14 @@ impl Tool for Grep {
}
if let Ok(content) = fs::read_to_string(file_path) {
for (i, line) in content.lines().enumerate() {
if line.contains(&pattern) {
let is_match = if let Ok(re) = regex::Regex::new(&pattern) {
re.is_match(line)
} else {
// Fall back to literal substring search when the
// pattern is not a valid regex.
line.contains(&pattern)
};
if is_match {
let rel_path = file_path
.strip_prefix(&path)
.unwrap_or(file_path)