@loop-engine/runtime
v1.0.0-rc.0
Published
Execution engine for loop state transitions and lifecycle.
Maintainers
Readme
@loop-engine/runtime
The Loop Engine runtime for governed loop lifecycle, transition execution, and event emission.
Install
npm install @loop-engine/runtime @loop-engine/adapter-memory @loop-engine/guardsQuick Start
import { createLoopEngine } from "@loop-engine/runtime";
import { memoryStore } from "@loop-engine/adapter-memory";
import { GuardRegistry } from "@loop-engine/guards";
const guardRegistry = new GuardRegistry();
guardRegistry.registerBuiltIns();
const registry = { get: () => loopDefinition, list: () => [loopDefinition] };
const system = createLoopEngine({ registry, store: memoryStore(), guardRegistry });
await system.start({ loopId: "expense.approval" as never, aggregateId: "EXP-1" as never, actor: { type: "human", id: "[email protected]" as never } });
await system.transition({ aggregateId: "EXP-1" as never, transitionId: "approve" as never, actor: { type: "human", id: "[email protected]" as never } });Documentation link
https://loopengine.io/docs/packages/runtime
License
Apache-2.0 © Better Data, Inc.
