Packages
@loop-engine/signals
@loop-engine/signals detects patterns from LoopEvent[] and emits typed Signal objects.
Install
1npm install @loop-engine/signalsEngine API
1interface SignalEngine {2 registerRule(rule: SignalRule): void3 process(events: LoopEvent[]): Signal[]4 subscribe(handler: (signal: Signal) => void): () => void5}Factory:
1createSignalEngine(): SignalEnginecreateSignalEngine() pre-registers:
threshold-breachstate-dwellrepeated-guard-failureloop-not-started
Built-in rule factories
1thresholdBreachRule(config: ThresholdRuleConfig): SignalRule2stateDwellRule(config: StateDwellRuleConfig): SignalRule3repeatedGuardFailureRule(config: RepeatedGuardFailureConfig): SignalRule4loopNotStartedRule(config: LoopNotStartedConfig): SignalRule1import { createSignalEngine } from "@loop-engine/signals"2 3const signalEngine = createSignalEngine()4signalEngine.subscribe((signal) => {5 console.log(signal.type, signal.subject, signal.confidence)6})Detection flow
Signals are detections, not actors. Application code decides what to do with them, including whether to start or transition loops.