Expand description
Pre-processing Hook for Skills/Workflows Trigger Detection
This module implements the backend-side trigger detection that was previously described in the prompt. By moving this logic to code:
- Eliminates ambiguity in pattern matching
- Provides deterministic behavior
- Reduces prompt token cost (~100 lines removed from prompt)
- Enables easier testing and debugging
§Dynamic Trigger Loading
Triggers are now loaded dynamically from skill files’ trigger field,
instead of being hardcoded. This allows skills to define their own
trigger patterns without modifying this code.
§Auto-loading Skills
When a skill is triggered, the system can optionally auto-load the skill content, saving an extra round-trip.
Structs§
- PreProcess
Hook - Pre-processing hook for trigger detection
- Skill
Pattern - Skill trigger pattern
- Workflow
Trigger - Workflow trigger configuration
Enums§
- Process
Result - Trigger type detection result
- Trigger
Type - Type of trigger detected
Functions§
- global_
preprocessor - Get the global preprocessor
- preprocess
- Process message with global preprocessor (without skills)
Use
preprocess_with_skillsfor dynamic trigger loading. - preprocess_
with_ skills - Process message with skills for dynamic trigger loading. This is the preferred function when skills are available.