13 lines
405 B
Python
13 lines
405 B
Python
|
|
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")
|