import type { SubAgent, SubAgentUsage } from '../nodes/SubAgentKit/SubAgentKit.node'; export interface HandoffTraceEntry { step: number; agent: string; task: string; response: string; durationMs: number; usage: SubAgentUsage; } export interface HandoffChainResult { response: string; trace: HandoffTraceEntry[]; usage: SubAgentUsage; } /** * Extracts the user-facing text and routing action from an agent's JSON output. * * @param raw Raw string returned by the agent. * @param contentKey JSON key for the user-facing message (e.g. "content_raw"). * @param instructionsKey JSON key for the routing block (e.g. "routing"). * * Falls back gracefully when the output is not valid JSON. */ export declare function parseAgentOutput(raw: string, contentKey?: string, instructionsKey?: string): { contentRaw: string; action: string; }; /** * Resolves the next agent name from a routing action value. * Only the user-defined routingMap is consulted — no automatic inference. */ export declare function resolveNextAgent(action: string, agentMap: Map, routingMap?: Record): string | undefined; export interface HandoffChainParams { entryAgent: string; message: string; agentMap: Map; sessionId: string; /** Existing conversation history; extended in-place as the chain progresses. */ history: Array<{ role: 'user' | 'assistant'; content: string; }>; maxHops: number; /** User-defined action → agentName routing table. */ routingMap?: Record; /** Actions that stop the chain. */ terminalActions?: Set; } /** * Runs a deterministic handoff chain. * * Each agent returns structured JSON parsed using its own configured * contentKey and instructionsKey. Routing is driven purely by the * user-defined routingMap — no automatic inference. */ export declare function runHandoffChain(params: HandoffChainParams): Promise; //# sourceMappingURL=handoffChain.d.ts.map