loader
diapason.tools.templates.loader
¶
Template loader — dynamically construct BaseTool from TOML definitions.
discover_templates(directory=None)
¶
Discover all TOML templates in a directory.
load_template(path)
¶
Load a single tool template from a TOML file.
safe_eval_expr(expr, names)
¶
Safely evaluate a template python-action expression.
Parses expr and interprets it against the allowlist in
:func:_eval_node. No eval/exec is used, and the only callables
reachable are :data:_SAFE_EVAL_FUNCS plus the supplied names (the tool
parameters). Raises ValueError / SyntaxError on anything unsafe.