feat(agent): add tool registry domain validation

This commit is contained in:
qzl
2026-03-03 15:30:53 +08:00
parent 17e6de177c
commit e03923e593
2 changed files with 39 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
from __future__ import annotations
from typing import Any
def validate_tool_spec(spec: dict[str, Any]) -> None:
name = spec["name"]
target = spec["execution_target"]
if name.startswith("ui.") and target != "frontend":
raise ValueError("ui.* must use frontend target")
if name.startswith("srv.") and target != "backend":
raise ValueError("srv.* must use backend target")