greentic_flow/
util.rs

1use regex::Regex;
2
3lazy_static::lazy_static! {
4    pub static ref COMP_KEY_RE: Regex = Regex::new(r"^[a-zA-Z][\w\.-]*\.[\w\.-]+$").unwrap();
5}
6
7/// Allow standard component keys (namespace.adapter.operation) plus builtin helpers.
8pub fn is_valid_component_key(key: &str) -> bool {
9    COMP_KEY_RE.is_match(key) || matches!(key, "questions" | "template")
10}