refactor: enhance MCP tool management with risk policies and confirmation handling

This commit is contained in:
mlogclub
2026-07-28 11:33:15 +08:00
parent ed109047d3
commit 07370fe9a2
17 changed files with 448 additions and 117 deletions
@@ -69,3 +69,11 @@ test("saving a published AI Agent keeps the active revision online", () => {
assert.match(configWorkbenchSource, /已发布版本正在生效;再次发布后应用当前配置/)
assert.doesNotMatch(saveFunction, /loadData\(\)/)
})
test("trusted MCP tools use backend risk metadata and cannot be edited", () => {
assert.match(adminApiSource, /riskEditable: boolean/)
assert.match(configWorkbenchSource, /riskLevel: tool\.riskLevel/)
assert.match(configWorkbenchSource, /requireConfirmation: tool\.requireConfirmation/)
assert.match(configWorkbenchSource, /只读(系统定义)/)
assert.match(configWorkbenchSource, /!catalogTool\.riskEditable/)
})