UNPKG

mcp-think-tank

Version:

Structured thinking and knowledge management tool for Model Context Protocol

44 lines 2 kB
import { IAgent } from '../../agents/IAgent.js'; import { CoordinationStrategy } from '../CoordinationStrategy.js'; /** * Implements a sequential, round-robin strategy for agent coordination. * Agents take turns processing the input until one indicates completion. */ export declare class SequentialStrategy implements CoordinationStrategy { private currentIndex; private completionFunction; /** * Create a new SequentialStrategy */ constructor(); /** * Get the next agent in the round-robin sequence. * * @param agents - Array of available agents * @param currentAgentId - ID of the currently active agent (if any) * @param outputs - Map of agent IDs to their outputs so far * @param isDone - Optional function to check if an agent's output indicates completion * @returns The next agent to run, or null if orchestration should terminate */ nextAgent(agents: IAgent[], currentAgentId: string | null, outputs: Map<string, string[]>, isDone?: (output: string) => boolean): IAgent | null; /** * Combine the outputs from multiple agents into a final result. * For sequential strategy, we typically take the last output from the last agent. * * @param outputs - Map of agent IDs to their outputs * @returns The combined output */ combine(outputs: Map<string, string[]>): string; /** * Check whether the orchestration is complete based on the current state. * For sequential strategy, we're done when: * 1. The last output satisfies the completion function, if provided * 2. We've gone through all agents and none have more work to do * * @param agents - Array of available agents * @param outputs - Map of agent IDs to their outputs so far * @returns True if orchestration should be considered complete, false otherwise */ isDone(agents: IAgent[], outputs: Map<string, string[]>): boolean; } //# sourceMappingURL=SequentialStrategy.d.ts.map