/** * Handoff Tool for Agent Execution * * Provides a tool that agents can call to hand off execution to another agent. * The handoff is validated against workflow-declared allowed targets. */ import type { Tool } from '../tool/tool'; import type { HandoffContext } from './handoff'; import type { AgentResponse } from '../agent/agent'; /** * Handoff tool configuration */ export interface HandoffToolConfig { /** Agent ID that will use this tool */ sourceAgent: string; /** Workflow-declared allowed target agents */ allowedTargets: string[]; /** Function to execute the actual handoff (provided by executor) */ executeHandoff: (targetAgent: string, context: HandoffContext) => Promise; } /** * Handoff request signal returned by the tool */ export interface HandoffSignal { type: 'handoff_request'; targetAgent: string; reason?: string; } /** * Handoff error signal returned by the tool */ export interface HandoffError { type: 'handoff_error'; error: string; availableTargets: string[]; } /** * Type guard to check if a value is a HandoffSignal */ export declare function isHandoffSignal(value: unknown): value is HandoffSignal; /** * Type guard to check if a value is a HandoffError */ export declare function isHandoffError(value: unknown): value is HandoffError; /** * Create a handoff tool that agents can use to delegate to other agents. * * The tool validates the target agent against workflow-declared allowed targets * and returns a signal that the graph executor uses to perform the actual handoff. * * @param config - Handoff tool configuration * @returns Tool definition compatible with agent binding */ export declare function createHandoffTool(config: HandoffToolConfig): Tool; //# sourceMappingURL=handoff-tool.d.ts.map