Loop Engine

Packages

Events

@loop-engine/events

Event contracts, Zod schemas, and in-memory event bus.

Install

1npm install @loop-engine/events

API reference

InMemoryEventBus

1class InMemoryEventBus {
2 emit(event: LoopEvent): Promise<void>
3 subscribe(handler: (event: LoopEvent) => Promise<void>): () => void
4}

LOOP_EVENT_TYPES

String constants for:

  • loop.started
  • loop.transition.requested
  • loop.transition.executed
  • loop.transition.blocked
  • loop.guard.failed
  • loop.completed
  • loop.error
  • loop.spawned
  • loop.signal.received
  • loop.outcome.recorded

extractLearningSignal

1extractLearningSignal(
2 completed: LoopCompletedEvent,
3 history: TransitionRecord[],
4 predicted?: Record<string, unknown>
5): LearningSignal

Schemas

LoopEventSchema and per-event schemas (for runtime validation/parsing).

  • Depends on @loop-engine/core
  • Used by runtime, sdk, signals, adapters, and ui-devtools