修复: 高风险工具名单改注册表投影

新增 ai_list_tools 只读投影 name+risk,前端启动拉取构建
手写名单缺 10 个 High 工具致审批二次确认漏弹,现名单改兜底保留
顺带删除零调用方 get_script_safety 死命令及注册
This commit is contained in:
lxy
2026-10-01 08:28:07 +08:00
parent 4b445e96b8
commit 7b5a2c83b0
8 changed files with 88 additions and 16 deletions
-11
View File
@@ -116,17 +116,6 @@ pub async fn set_script_safety(
Ok(())
}
/// 读取脚本安全配置。
#[tauri::command]
pub async fn get_script_safety(
state: State<'_, AppState>,
) -> Result<(String, String), String> {
// appSettings.set(JSON.stringify 带引号)与 settingsApi.set(裸串)双通道写入并存,读端归一
let wl = state.settings.get("df-script-whitelist").await.map_err(err_str)?.map(|v| v.trim_matches('"').to_string()).unwrap_or_default();
let bl = state.settings.get("df-script-blacklist").await.map_err(err_str)?.map(|v| v.trim_matches('"').to_string()).unwrap_or_default();
Ok((wl, bl))
}
/// 设置多 ReAct Plan 执行开关(默认关)。
/// 开启后 process_tool_calls 内以 JoinSet 并行执行同层工具。
#[tauri::command]