import { EventEmitter } from 'events'; import type { AgentContext, Message } from './types'; /** * Multi-Agent Orchestrator — v0.8.0 * Routes messages to specialized sub-agents, supports parallel execution and handoffs. */ export interface AgentNode { id: string; name: string; description: string; /** Patterns or intents this agent handles */ routes: string[]; /** Function that processes a message and returns a response */ handler: (context: AgentContext, message: Message) => Promise; /** Priority for routing conflicts (higher wins) */ priority?: number; } export interface OrchestratorWorkflow { name: string; description?: string; /** Ordered list of agent IDs for sequential execution */ steps?: string[]; /** List of agent IDs for parallel execution */ parallel?: string[]; /** Router config: auto-route based on message content */ router?: { agents: string[]; fallback?: string; }; } export interface HandoffRequest { fromAgent: string; toAgent: string; context: AgentContext; reason: string; } export interface OrchestratorConfig { agents: AgentNode[]; workflows?: OrchestratorWorkflow[]; defaultWorkflow?: string; maxParallel?: number; } export declare class Orchestrator extends EventEmitter { private agents; private workflows; private defaultWorkflow?; private maxParallel; constructor(config: OrchestratorConfig); /** Register a new agent node */ registerAgent(agent: AgentNode): void; /** Unregister an agent */ unregisterAgent(id: string): void; /** Route a message to the best-matching agent */ route(message: Message): AgentNode | undefined; /** Execute a single agent */ executeAgent(agentId: string, context: AgentContext, message: Message): Promise; /** Run multiple agents in parallel */ executeParallel(agentIds: string[], context: AgentContext, message: Message): Promise>; /** Execute a named workflow */ executeWorkflow(workflowName: string, context: AgentContext, message: Message): Promise; /** Hand off conversation from one agent to another */ handoff(request: HandoffRequest): Promise; /** Process an incoming message using the default workflow or routing */ process(context: AgentContext, message: Message): Promise; getAgents(): AgentNode[]; getWorkflows(): OrchestratorWorkflow[]; } //# sourceMappingURL=orchestrator.d.ts.map