/** * Choreography Trait Handler * * Enables nodes to participate in multi-agent choreography. * Part of HoloScript v3.1 Agentic Choreography. * * Features: * - Plan creation and execution * - Step registration and execution * - HITL gate integration * - Event subscription for choreography updates * * @version 3.1.0 * @Sprint v3.1 (March 2026) */ import type { TraitHandler } from '@holoscript/core'; import type { HSPlusNode } from '@holoscript/core'; import type { AgentManifest } from '@holoscript/framework/agents'; import type { ChoreographyPlan, ChoreographyResult, ChoreographyStatus, StepContext } from '@holoscript/engine/choreography'; import { PlanBuilder } from '@holoscript/engine/choreography'; import type { StepDefinition } from '@holoscript/engine/choreography'; type ChoreographyMode = 'participant' | 'orchestrator' | 'hybrid'; interface ChoreographyEvent { type: 'plan_started' | 'plan_completed' | 'step_started' | 'step_completed' | 'hitl_required'; planId: string; stepId?: string; data?: unknown; timestamp: number; } interface ChoreographyConfig { /** Operating mode */ mode: ChoreographyMode; /** Auto-start engine on attach */ auto_start: boolean; /** Maximum concurrent plans (orchestrator mode) */ max_concurrent_plans: number; /** Default step timeout (ms) */ default_step_timeout: number; /** Event history limit */ event_history_limit: number; /** Whether to pause on HITL gates */ hitl_auto_pause: boolean; /** Execute fallback plans on failure */ execute_fallback: boolean; /** Verbose logging */ verbose: boolean; } /** * Choreography trait handler */ export declare const choreographyHandler: TraitHandler; /** * Create a choreography plan */ export declare function createChoreographyPlan(node: HSPlusNode, goal: string, agents: AgentManifest[], steps: StepDefinition[]): ChoreographyPlan; /** * Get a fluent plan builder */ export declare function getPlanBuilder(goal: string): PlanBuilder; /** * Execute a choreography plan */ export declare function executeChoreography(node: HSPlusNode, plan: ChoreographyPlan, variables?: Record): Promise; /** * Pause a running plan */ export declare function pauseChoreography(node: HSPlusNode, planId: string): Promise; /** * Resume a paused plan */ export declare function resumeChoreography(node: HSPlusNode, planId: string): Promise; /** * Cancel a running plan */ export declare function cancelChoreography(node: HSPlusNode, planId: string): Promise; /** * Approve a HITL gate */ export declare function approveHitl(node: HSPlusNode, planId: string, stepId: string): void; /** * Reject a HITL gate */ export declare function rejectHitl(node: HSPlusNode, planId: string, stepId: string, reason: string): void; /** * Register an action this node can perform */ export declare function registerAction(node: HSPlusNode, name: string, handler: (inputs: Record, context: StepContext) => Promise>, options?: { description?: string; inputs?: string[]; outputs?: string[]; }): void; /** * Unregister an action */ export declare function unregisterAction(node: HSPlusNode, name: string): boolean; /** * Get registered action names */ export declare function getRegisteredActions(node: HSPlusNode): string[]; /** * Get active plan IDs */ export declare function getActivePlans(node: HSPlusNode): string[]; /** * Get plan status */ export declare function getPlanStatus(node: HSPlusNode, planId: string): ChoreographyStatus | null; /** * Get pending HITL step IDs */ export declare function getPendingHitl(node: HSPlusNode): string[]; /** * Get event history */ export declare function getEventHistory(node: HSPlusNode, limit?: number): ChoreographyEvent[]; export default choreographyHandler; //# sourceMappingURL=ChoreographyTrait.d.ts.map