/** * swarm/coordinator — Non-blocking coordinator mode for multi-turn swarm orchestration. * * Registers SwarmCoordinator, SendMessage, and TaskStop tools that allow * the main agent to launch a swarm, remain active across turns, send * messages to running agents, and stop individual agents. * * Unlike the blocking Swarm tool which waits for all agents to complete * before returning, SwarmCoordinator returns immediately with a runId. * The coordinator (main agent) stays in control and can: * - Send messages to agents via SendMessage * - Stop individual agents via TaskStop * - Check progress and collect results * - Intervene when agents complete (via events) */ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; import type { SwarmHandle, SubagentEvent, SubagentResult, SwarmSpec } from "../shared/types.js"; export interface ActiveCoordinatorRun { runId: string; handle: SwarmHandle; results: Array>; events: Array>; swarmRoot: string; description?: string; completed: boolean; completionPromise: Promise>>; } /** * Resolve an agent's display name (or raw agentId) to its canonical agentId * for a given run. * * Business (#102): Returns undefined when no event matches the name or id. * Previously this returned the input string unchanged, which caused callers * to proceed with an invalid id and produce confusing downstream errors. */ export declare function resolveAgentId(run: ActiveCoordinatorRun, nameOrId: string): string | undefined; /** * Produce a human-readable summary of a single coordinator run. * * Business (#104): Agent count is derived from unique agentIds in the event * log, NOT from the raw count of agent_started events. This is because * retries emit an additional agent_started event for the same agentId, * which would inflate the total and produce a negative "still running" count. */ export declare function runToSummary(run: ActiveCoordinatorRun): string; /** * Summarize one or more coordinator runs. When runId is provided, only that * run is summarized; otherwise all runs are included. * * Business (#103): Previously the SwarmStatus handler ignored the runId * parameter and always returned all runs. This helper centralizes the * filtering logic and makes it testable. */ export declare function summarizeRuns(runs: ActiveCoordinatorRun[], runId?: string): string; export declare function registerCoordinatorTools(pi: ExtensionAPI): void; //# sourceMappingURL=coordinator.d.ts.map