feat: add AI tool access registry

This commit is contained in:
2026-06-17 08:45:56 +08:00
parent 5eb95a4ef4
commit 8bdde45e89
13 changed files with 436 additions and 1 deletions

View File

@@ -70,6 +70,19 @@ curl -X POST http://localhost:8084/api/page/schema/validate \
设计器保存 overlay 时也会执行同一套 typed schema 校验;未注册组件或不支持的 `actionType` 会被拒绝。
## AI 工具权限检查
```bash
curl http://localhost:8084/api/ai/tools
curl http://localhost:8084/api/ai/employees
curl -X POST http://localhost:8084/api/ai/tools/access-check \
-H "Content-Type: application/json" \
-d '{"employeeId":"agent-developer","toolName":"local.apply","grantedScopes":["ai:local:apply"],"targetEnv":"local","productionWrite":false}'
```
本地 apply、smoke 等工具只允许本地目标;生产写默认被阻断,线上部署仍走人工发布。
## 失败处理
1. 查看输出 JSON 中的 apply/smoke/repair evidence。