UNPKG

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

32 lines (31 loc) 1.35 kB
import { ArvoOrchestrator } from '.'; import type { CreateArvoOrchestratorParam } from './types'; /** * Creates a new Arvo orchestrator instance with default components. * * Factory function that constructs an orchestrator with standard execution engine * and registry implementations. Validates that all machines share the same source * identifier and have unique versions. * * @param params - Configuration parameters for the orchestrator * @returns Configured ArvoOrchestrator instance ready for event handling * * @throws {Error} When no machines are provided * @throws {ConfigViolation} When machines have different source identifiers * @throws {ConfigViolation} When machines have duplicate versions * * @example * ```typescript * const orchestrator = createArvoOrchestrator({ * memory: new SimpleMachineMemory(), * machines: [userOnboardingMachine, paymentMachine] * }); * * // Process events * const result = await orchestrator.execute(event); * ``` * * @see {@link setupArvoMachine} for creating machine definitions * @see {@link ArvoOrchestrator} for direct instantiation with custom components */ export declare const createArvoOrchestrator: ({ executionunits, memory, machines, defaultEventEmissionDomains, spanOptions, requiresResourceLocking: _locking, }: CreateArvoOrchestratorParam) => ArvoOrchestrator;