Skip to content

EventBus & live events ​

ts
import { EventBus, type LiveEvent } from '@monkeytestai/monkeytester';

const events = new EventBus();
events.on((e: LiveEvent) => {
  console.log(e.type, e.message, e.data);
});

LiveEvent shape ​

FieldTypeDescription
tsstringISO-8601 timestamp
phase'explorer' | 'planner' | 'runner' | 'triager'Pipeline phase
typestringStable machine id (e.g. run.step_complete)
messagestringHuman-readable one-liner
dataobject?Structured payload (URLs, screenshot basenames, etc.)

Common type values ​

Explorer: explore.start, explore.page_visited, explore.page_failed, explore.screenshot, explore.warning, explore.complete

Planner: plan.start, plan.complete, plan.skipped

Runner: run.start, run.flow_start, run.step_start, run.step_complete, run.flow_complete, run.complete, run.screenshot

Triager: triage.start, triage.complete

Errors: engine.error

Listeners must not throw — errors are caught internally so a bad logger cannot abort a run.

AGPL-3.0 · Made for the testing community