/** * @holoscript/core - Choreography Engine * * Orchestrates multi-agent choreography execution. * Part of HoloScript v3.1 Agentic Choreography. */ import { EventEmitter } from 'events'; import type { AgentManifest } from '@holoscript/framework/agents'; import { AgentRegistry } from '@holoscript/framework/agents'; import type { ChoreographyPlan, ChoreographyStep, ChoreographyResult, ChoreographyStatus } from './ChoreographyTypes'; import { type ActionHandler } from './StepExecutor'; /** * Engine configuration */ export interface ChoreographyEngineConfig { /** Maximum concurrent step execution */ maxConcurrency: number; /** Default step timeout (ms) */ defaultTimeout: number; /** Whether to execute fallback on failure */ executeFallback: boolean; /** Whether to pause on HITL gates automatically */ autoHitlPause: boolean; /** Verbose logging */ verbose: boolean; } /** * Default engine configuration */ export declare const DEFAULT_ENGINE_CONFIG: ChoreographyEngineConfig; /** * Main engine for executing choreography plans */ export declare class ChoreographyEngine extends EventEmitter { private config; private planner; private executor; private registry; private activePlans; private actionHandler; constructor(config?: Partial); /** * Set the agent registry */ setRegistry(registry: AgentRegistry): void; /** * Set the action handler for executing agent actions */ setActionHandler(handler: ActionHandler): void; /** * Create a new choreography plan */ createPlan(goal: string, agents: AgentManifest[], steps: ChoreographyStep[]): ChoreographyPlan; /** * Execute a choreography plan */ execute(plan: ChoreographyPlan, variables?: Record): Promise; /** * Pause a running plan */ pause(planId: string): Promise; /** * Resume a paused plan */ resume(planId: string): Promise; /** * Cancel a running plan */ cancel(planId: string): Promise; /** * Approve a HITL gate */ approveHitl(planId: string, stepId: string): void; /** * Reject a HITL gate */ rejectHitl(planId: string, stepId: string, reason: string): void; /** * Get active plan IDs */ getActivePlans(): string[]; /** * Get plan status */ getPlanStatus(planId: string): ChoreographyStatus | null; /** * Execute the plan */ private executePlan; /** * Execute a group of steps (potentially in parallel) */ private executeGroup; /** * Execute a single step */ private executeStep; /** * Build step context */ private buildStepContext; /** * Build final result */ private buildResult; /** * Get concurrency limit from constraints */ private getConcurrencyLimit; /** * Find plan containing a step */ private findPlanWithStep; /** * Generate unique ID */ private generateId; /** * Chunk array into batches */ private chunk; /** * Sleep helper */ private sleep; } /** * Get default choreography engine */ export declare function getDefaultEngine(): ChoreographyEngine; /** * Reset default engine (for testing) */ export declare function resetDefaultEngine(): void; //# sourceMappingURL=ChoreographyEngine.d.ts.map