/** * SubagentDispatcher Application Service * * Dispatches tasks to specialized subagents * * @see REQ-SDD-002 - Subagent Decomposition * @see DES-SDD-002 - SubagentDispatcher */ import type { Task } from '../domain/entities/Task.js'; import type { ExecutionContext } from '../domain/entities/ExecutionContext.js'; import { type SubagentSpec, type SubagentResult } from '../domain/entities/SubagentSpec.js'; import { type AgentRole, type AgentRoleName } from '../domain/value-objects/AgentRole.js'; import type { ComplexityScore } from '../domain/value-objects/ComplexityScore.js'; /** * Subagent dispatcher interface */ export interface ISubagentDispatcher { /** * Decompose task into subagent specs * @param task - Task to decompose * @param score - Complexity score * @param context - Execution context * @returns Subagent specifications */ decompose(task: Task, score: ComplexityScore, context: ExecutionContext): SubagentSpec[]; /** * Generate prompt for a role * @param role - Agent role * @param task - Task to execute * @param context - Execution context * @returns Generated prompt */ generatePrompt(role: AgentRole, task: Task, context: ExecutionContext): string; /** * Get available roles * @returns All available role names */ getAvailableRoles(): AgentRoleName[]; } /** * Aggregated result from multiple subagents */ export interface AggregatedResult { /** All results */ readonly results: readonly SubagentResult[]; /** Success status (all succeeded) */ readonly success: boolean; /** Combined content */ readonly combinedContent: string; /** Failed results */ readonly failures: readonly SubagentResult[]; /** Total duration */ readonly totalDurationMs: number; } /** * Dispatcher configuration */ export interface SubagentDispatcherConfig { /** Default timeout per subagent (ms) */ defaultTimeoutMs?: number; /** Role selection strategy */ roleStrategy?: 'all' | 'minimal' | 'custom'; /** Custom roles to use (if roleStrategy is 'custom') */ customRoles?: AgentRoleName[]; } /** * Create a subagent dispatcher * * @param config - Optional configuration * @returns ISubagentDispatcher implementation */ export declare function createSubagentDispatcher(config?: SubagentDispatcherConfig): ISubagentDispatcher; /** * Aggregate results from multiple subagents * * @param results - Subagent results * @returns Aggregated result */ export declare function aggregateResults(results: SubagentResult[]): AggregatedResult; //# sourceMappingURL=SubagentDispatcher.d.ts.map