/** * WorkDistributionService — Intelligent task recommendation and handoff coordination. * * Scores candidate tasks across 4 dimensions: * - Cascade value (0-40): downstream tasks unblocked * - Epic momentum (0-25): prefer finishing in-progress epics * - Capability match (0-20): agent role vs task characteristics * - Dependency freshness (0-15): recently-unblocked momentum * * Every recommendation is audited via event bus. Recommendations are advisory — * the agent (or human) decides whether to follow them. */ import type { IContainerService, IAgentService, ITaskService, IAuditService, IWorkflowConfig } from '../../container/interfaces.js'; import type { MethodologyProfile } from '../../profiles/types.js'; import type { ILogger, ActorIdentity } from '../../shared/logger.js'; import type { IEventBus } from '../../shared/events/index.js'; import type { WorkRecommendation, HandoffResult } from './types.js'; export interface IWorkDistributionService { getNextTask(agentId: string, containerName?: string): Promise; completeAndHandoff(issueNumber: number, agentId: string, actor: ActorIdentity): Promise; } export declare class WorkDistributionService implements IWorkDistributionService { private readonly containerService; private readonly agentService; private readonly taskService; private readonly auditService; private readonly eventBus; private readonly sessionId; private readonly logger; private readonly workflowConfig; private readonly closingTransitions; constructor(containerService: IContainerService, agentService: IAgentService, taskService: ITaskService, auditService: IAuditService, eventBus: IEventBus, sessionId: string, logger: ILogger, workflowConfig: IWorkflowConfig, profile: MethodologyProfile); getNextTask(agentId: string, containerName?: string): Promise; completeAndHandoff(issueNumber: number, agentId: string, actor: ActorIdentity): Promise; private scoreTask; /** * Cascade value (0-40): How many downstream tasks does completing this unblock? * Direct dependents score higher than depth-2 dependents. */ private scoreCascade; /** * Epic momentum (0-25): Prefer tasks in epics that are already in progress. * Higher completion ratio = higher score. Finishing an epic is high leverage. */ private scoreEpicMomentum; /** * Capability match (0-20): Does the agent's declared role match the task? * Soft matching — no capabilities = neutral score (10). */ private scoreCapabilityMatch; /** * Dependency freshness (0-15): Was a dependency just completed? * Tasks that were recently unblocked have momentum — pick them up now. */ private scoreDependencyFreshness; private isActionableStatus; private isBlockedOrReady; private isTerminalStatus; private buildReverseDependencyMap; private buildReasoning; private suggestAgentForTask; private resolveActiveContainer; private emitRecommendationEvent; private emitHandoffEvent; } //# sourceMappingURL=work-distribution-service.d.ts.map