fix(mcp): remove secrets_find/add/update aliases; align docs and repair script
Some checks failed
Secrets v3 CI / 检查 (push) Failing after 2m16s
Some checks failed
Secrets v3 CI / 检查 (push) Failing after 2m16s
This commit is contained in:
@@ -113,7 +113,7 @@ fn initialize_response(id: Value) -> Response {
|
||||
"version": env!("CARGO_PKG_VERSION"),
|
||||
"title": "Secrets Desktop Daemon"
|
||||
},
|
||||
"instructions": "Preferred tools: secrets_entry_find, secrets_entry_get, secrets_entry_add, secrets_entry_update, secrets_entry_delete, secrets_entry_restore, secrets_secret_add, secrets_secret_update, secrets_secret_delete, secrets_secret_history, secrets_secret_rollback, and target_exec. All data is resolved from the desktop app's unlocked local vault session. Legacy aliases secrets_find, secrets_add, and secrets_update remain supported."
|
||||
"instructions": "Preferred tools: secrets_entry_find, secrets_entry_get, secrets_entry_add, secrets_entry_update, secrets_entry_delete, secrets_entry_restore, secrets_secret_add, secrets_secret_update, secrets_secret_delete, secrets_secret_history, secrets_secret_rollback, and target_exec. All data is resolved from the desktop app's unlocked local vault session."
|
||||
}
|
||||
});
|
||||
Response::builder()
|
||||
@@ -290,48 +290,6 @@ fn tool_definitions() -> Vec<Value> {
|
||||
"required": ["target_ref", "command"]
|
||||
}
|
||||
}),
|
||||
json!({
|
||||
"name": "secrets_find",
|
||||
"description": "Legacy alias for secrets_entry_find.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"query": { "type": ["string", "null"] },
|
||||
"folder": { "type": ["string", "null"] },
|
||||
"type": { "type": ["string", "null"] }
|
||||
}
|
||||
}
|
||||
}),
|
||||
json!({
|
||||
"name": "secrets_add",
|
||||
"description": "Legacy alias for secrets_entry_add.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"folder": { "type": "string" },
|
||||
"name": { "type": "string" },
|
||||
"type": { "type": ["string", "null"] },
|
||||
"metadata": { "type": ["object", "null"] },
|
||||
"secrets": { "type": ["array", "null"] }
|
||||
},
|
||||
"required": ["folder", "name"]
|
||||
}
|
||||
}),
|
||||
json!({
|
||||
"name": "secrets_update",
|
||||
"description": "Legacy alias for secrets_entry_update.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": { "type": "string" },
|
||||
"folder": { "type": ["string", "null"] },
|
||||
"name": { "type": ["string", "null"] },
|
||||
"type": { "type": ["string", "null"] },
|
||||
"metadata": { "type": ["object", "null"] }
|
||||
},
|
||||
"required": ["id"]
|
||||
}
|
||||
}),
|
||||
]
|
||||
}
|
||||
|
||||
@@ -368,7 +326,7 @@ fn revealed_secrets_to_env(secrets: &[SecretValueField]) -> HashMap<String, Valu
|
||||
|
||||
async fn call_tool(state: &AppState, name: &str, arguments: Value) -> Result<Value> {
|
||||
match name {
|
||||
"secrets_find" | "secrets_entry_find" => {
|
||||
"secrets_entry_find" => {
|
||||
let folder = arguments
|
||||
.get("folder")
|
||||
.and_then(Value::as_str)
|
||||
@@ -417,7 +375,7 @@ async fn call_tool(state: &AppState, name: &str, arguments: Value) -> Result<Val
|
||||
let secrets = fetch_revealed_entry_secrets(state, id).await?;
|
||||
Ok(entry_detail_payload(&detail, Some(&secrets)))
|
||||
}
|
||||
"secrets_add" | "secrets_entry_add" => {
|
||||
"secrets_entry_add" => {
|
||||
let folder = arguments
|
||||
.get("folder")
|
||||
.and_then(Value::as_str)
|
||||
@@ -451,7 +409,7 @@ async fn call_tool(state: &AppState, name: &str, arguments: Value) -> Result<Val
|
||||
.await
|
||||
.context("failed to decode create result")?)
|
||||
}
|
||||
"secrets_update" | "secrets_entry_update" => {
|
||||
"secrets_entry_update" => {
|
||||
let id = arguments
|
||||
.get("id")
|
||||
.and_then(Value::as_str)
|
||||
|
||||
Reference in New Issue
Block a user