Skip to main content

Module trigger_config

Module trigger_config 

Source
Expand description

User-configurable [[trigger]] blocks parsed from klasp.toml.

Design: issue #45. User triggers extend the built-in commit/push regex (see trigger.rs) — they add new matching rules without replacing the built-ins. A command matched by any user trigger fires the gate just as a built-in match would.

Validation rules (enforced at config-load time, not at match time):

  • At least one of pattern or commands must be present.
  • pattern must be a valid Rust regex (compiled eagerly to catch errors early).
  • agents is optional — empty means “fire for all agents”.

Structs§

UserTrigger
A compiled, validated user trigger ready for matching.
UserTriggerConfig
A single user-defined [[trigger]] block from klasp.toml.

Functions§

validate_user_triggers
Validate all [[trigger]] entries from config, returning compiled triggers.