feat: add FetchUrlTool with proxy support and cross-OS path sanitization
- Implement native FetchUrlTool using reqwest for HTTP fetching, which respects HTTP_PROXY, HTTPS_PROXY, and NO_PROXY natively. - Introduce sanitize_path in utils to bidirectionally handle Windows/WSL path mapping, applying it to various search/git handlers. - Update .gitignore to exclude mcp_store.redb and tantivy_index.
This commit is contained in:
1 parent
250b70d329
commit
5583132cdc
10 files changed
+191
-5
No files matched your search
@@ -66,7 +66,8 @@ impl McpTool for GetActiveWorktreeContextHandler {
|
||||
|
||||
for delta in diff.deltas() {
|
||||
if let Some(path) = delta.new_file().path() {
|
||||
files.push(path.to_string_lossy().into_owned());
|
||||
let path_str = path.to_string_lossy().into_owned();
|
||||
files.push(crate::handlers::utils::sanitize_path(&path_str));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -121,7 +122,7 @@ impl McpTool for QueryGitDiffsHandler {
|
||||
|| change.git_commit.as_ref().is_some_and(|c| c.contains(&q))
|
||||
{
|
||||
matches.push(json!({
|
||||
"file_path": change.file_path,
|
||||
"file_path": crate::handlers::utils::sanitize_path(&change.file_path),
|
||||
"description": change.description,
|
||||
"commit": change.git_commit,
|
||||
"branch": change.git_branch,
|
||||
|
||||
Reference in new issue
Block a user