feat(mcp): add tool presets and audit commands
- Introduce reference MCP presets with installation/audit helpers and remove legacy connector lists. - Add CLI `owlen tools` commands to install presets or audit configuration, with optional pruning. - Extend the TUI :tools command to support listing presets, installing them, and auditing current configuration. - Document the preset workflow and provide regression tests for preset application.
This commit is contained in:
@@ -788,7 +788,7 @@ impl SessionController {
|
||||
})?;
|
||||
|
||||
let call = McpToolCall {
|
||||
name: "resources/get".to_string(),
|
||||
name: "resources_get".to_string(),
|
||||
arguments: json!({ "uri": uri, "path": uri }),
|
||||
};
|
||||
let response = client.call_tool(call).await?;
|
||||
@@ -1039,11 +1039,11 @@ impl SessionController {
|
||||
vec!["code to execute".to_string()],
|
||||
vec!["local sandbox".to_string()],
|
||||
),
|
||||
"resources/write" | "file_write" => (
|
||||
"resources_write" | "file_write" => (
|
||||
vec!["file paths".to_string(), "file content".to_string()],
|
||||
vec!["local filesystem".to_string()],
|
||||
),
|
||||
"resources/delete" | "file_delete" => (
|
||||
"resources_delete" | "file_delete" => (
|
||||
vec!["file paths".to_string()],
|
||||
vec!["local filesystem".to_string()],
|
||||
),
|
||||
@@ -1251,7 +1251,7 @@ impl SessionController {
|
||||
|
||||
pub async fn read_file(&self, path: &str) -> Result<String> {
|
||||
let call = McpToolCall {
|
||||
name: "resources/get".to_string(),
|
||||
name: "resources_get".to_string(),
|
||||
arguments: serde_json::json!({ "path": path }),
|
||||
};
|
||||
match self.mcp_client.call_tool(call).await {
|
||||
@@ -1280,7 +1280,7 @@ impl SessionController {
|
||||
}
|
||||
|
||||
let call = McpToolCall {
|
||||
name: "resources/get".to_string(),
|
||||
name: "resources_get".to_string(),
|
||||
arguments: serde_json::json!({ "path": path }),
|
||||
};
|
||||
|
||||
@@ -1316,7 +1316,7 @@ impl SessionController {
|
||||
|
||||
pub async fn list_dir(&self, path: &str) -> Result<Vec<String>> {
|
||||
let call = McpToolCall {
|
||||
name: "resources/list".to_string(),
|
||||
name: "resources_list".to_string(),
|
||||
arguments: serde_json::json!({ "path": path }),
|
||||
};
|
||||
match self.mcp_client.call_tool(call).await {
|
||||
@@ -1341,7 +1341,7 @@ impl SessionController {
|
||||
|
||||
pub async fn write_file(&self, path: &str, content: &str) -> Result<()> {
|
||||
let call = McpToolCall {
|
||||
name: "resources/write".to_string(),
|
||||
name: "resources_write".to_string(),
|
||||
arguments: serde_json::json!({ "path": path, "content": content }),
|
||||
};
|
||||
match self.mcp_client.call_tool(call).await {
|
||||
@@ -1363,7 +1363,7 @@ impl SessionController {
|
||||
|
||||
pub async fn delete_file(&self, path: &str) -> Result<()> {
|
||||
let call = McpToolCall {
|
||||
name: "resources/delete".to_string(),
|
||||
name: "resources_delete".to_string(),
|
||||
arguments: serde_json::json!({ "path": path }),
|
||||
};
|
||||
match self.mcp_client.call_tool(call).await {
|
||||
|
||||
Reference in New Issue
Block a user