/** * Test Orchestrator — Run complex multi-agent test scenarios. * * Supports sequential, parallel, and conditional flows between agents. * * @example * ```typescript * const orch = new TestOrchestrator(); * orch.addAgent('router', { trace: 'traces/router.json' }); * orch.addAgent('support', { trace: 'traces/support.json' }); * orch.defineInteraction('router', 'support', 'Handle refund request'); * const result = await orch.run(); * ``` */ import type { AgentTrace, Expectations, AssertionResult } from './types'; export interface AgentConfig { trace?: string; role?: string; model?: string; tools?: string[]; maxSteps?: number; timeout_ms?: number; } export interface Interaction { from: string; to: string; message: string; condition?: string; expect?: Partial; } export type FlowMode = 'sequential' | 'parallel' | 'conditional'; export interface FlowStep { agent: string; action: string; dependsOn?: string[]; condition?: (ctx: OrchestratorContext) => boolean; } export interface OrchestratorContext { results: Map; interactions: InteractionResult[]; metadata: Record; } export interface AgentRunResult { agent: string; trace?: AgentTrace; passed: boolean; assertions: AssertionResult[]; duration_ms: number; error?: string; } export interface InteractionResult { from: string; to: string; message: string; success: boolean; handoffDetected: boolean; duration_ms: number; } export interface OrchestratorResult { passed: boolean; agents: Map; interactions: InteractionResult[]; totalDuration_ms: number; flow: FlowMode; summary: string; } /** * Orchestrate multi-agent test scenarios. */ export declare class TestOrchestrator { private agents; private traces; private interactions; private flowSteps; private flowMode; private expectations; /** * Add an agent to the orchestration. */ addAgent(name: string, config: AgentConfig): void; /** * Add agent with inline trace (for testing). */ addAgentWithTrace(name: string, config: AgentConfig, trace: AgentTrace): void; /** * Define an interaction between two agents. */ defineInteraction(from: string, to: string, message: string, expect?: Partial): void; /** * Set expectations for a specific agent. */ setExpectations(agent: string, expect: Partial): void; /** * Set the execution flow mode. */ setFlowMode(mode: FlowMode): void; /** * Add a flow step for conditional execution. */ addFlowStep(step: FlowStep): void; /** * Run the orchestrated test scenario. */ run(): Promise; private evaluateAgent; private evaluateInteraction; private formatSummary; } /** * Create an orchestrator from a config object. */ export declare function createOrchestrator(config: { agents: Record; interactions?: Interaction[]; flow?: FlowMode; expectations?: Record>; }): TestOrchestrator; /** * Format orchestrator result for display. */ export declare function formatOrchestratorResult(result: OrchestratorResult): string; //# sourceMappingURL=orchestrator.d.ts.map