arvo-event-handler
Version:
A complete set of orthogonal event handler and orchestration primitives for Arvo based applications, featuring declarative state machines (XState), imperative resumables for agentic workflows, contract-based routing, OpenTelemetry observability, and in-me
22 lines (21 loc) • 912 B
TypeScript
import type { ArvoEvent } from 'arvo-core';
import type ArvoMachine from '../ArvoMachine';
import type { ArvoEventHandlerOpenTelemetryOptions } from '../types';
/**
* Interface for managing and resolving state machine instances.
*/
export interface IMachineRegistry {
/**
* Collection of registered machine instances.
* Each machine should have a unique combination of version and source.
*/
machines: ArvoMachine<any, any, any, any, any>[];
/**
* Resolves a machine instance based on event information.
*
* @param event - Event containing orchestration subject information
* @param opentelemetry - Configuration for telemetry and tracing
* @returns Matching ArvoMachine instance for the event or null if not found
*/
resolve: (event: ArvoEvent, opentelemetry: ArvoEventHandlerOpenTelemetryOptions) => ArvoMachine<any, any, any, any, any> | null;
}