Skip to main content

Module preprocess

Module preprocess 

Source
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§

PreProcessHook
Pre-processing hook for trigger detection
SkillPattern
Skill trigger pattern
WorkflowTrigger
Workflow trigger configuration

Enums§

ProcessResult
Trigger type detection result
TriggerType
Type of trigger detected

Functions§

global_preprocessor
Get the global preprocessor
preprocess
Process message with global preprocessor (without skills) Use preprocess_with_skills for dynamic trigger loading.
preprocess_with_skills
Process message with skills for dynamic trigger loading. This is the preferred function when skills are available.