UNPKG

@workflow-manager/runner

Version:

CLI runner for in-memory and markdown workflow orchestration using ATEP-like envelopes

24 lines (23 loc) 568 B
import { randomUUID } from "node:crypto"; export class EventLog { sequence = 0; events = []; push(runId, type, payload = {}, stepRunId, actor = "system") { this.sequence += 1; const event = { id: randomUUID(), runId, stepRunId, type, sequenceNumber: this.sequence, occurredAt: new Date().toISOString(), actor, payload, }; this.events.push(event); return event; } all() { return [...this.events]; } }