/**
 * Multi-agent handoff — Agent → Agent execution with history forwarding.
 *
 * Sprint-563: B2 — Multi-agent handoff() + asAgentTool() + handoffChain anti-cycle.
 *
 * handoff() wraps AgentsClient.execute with history forwarding (messages[]).
 * handoffChain: string[] prevents infinite cycles (HandoffCycleError if agent
 *   appears twice in the chain).
 * asAgentTool(descriptor, client) → AgentTool capability for MCP consumption.
 */
import type { CycleEventV011, OODAContext } from "./types.js";
export interface HandoffOptions {
    /** Target agent ID to hand off to. */
    targetAgentId: string;
    /** Messages to forward (history). */
    messages: Array<{
        role: string;
        content: string;
    }>;
    /** Chain of agents that have already participated (anti-cycle). */
    handoffChain: string[];
    /** OODA context from the calling agent. */
    ctx: OODAContext;
}
export interface HandoffResult {
    /** The child run ID created in the target agent. */
    childRunId: string;
    /** The handoff chain including the target (for the child to use). */
    nextChain: string[];
    /** Whether the handoff was accepted. */
    accepted: boolean;
}
export declare class HandoffCycleError extends Error {
    constructor(agentId: string, chain: string[]);
}
export interface AgentHandoffClient {
    execute(agentId: string, input: {
        messages: Array<{
            role: string;
            content: string;
        }>;
        handoffChain: string[];
    }): Promise<{
        runId: string;
    }>;
}
/**
 * Execute a handoff to another agent. Forwards messages[] and checks for cycles.
 * Throws HandoffCycleError if the target agent is already in the chain.
 */
export declare function handoff(opts: HandoffOptions, client: AgentHandoffClient): Promise<HandoffResult>;
/**
 * Build a CycleEventV011 'handoff_initiated' event.
 */
export declare function handoffToEvent(targetAgentId: string, childRunId: string, handoffChain: string[], runId: string, cycleIndex: number): Extract<CycleEventV011, {
    type: "handoff_initiated";
}>;
/**
 * Convert an agent descriptor into an MCP-compatible AgentTool.
 * Tools exposed this way can be called by other agents via MCP.
 */
export interface AgentDescriptor {
    agentId: string;
    name: string;
    description: string;
    inputSchema: Record<string, unknown>;
}
export declare function asAgentTool(descriptor: AgentDescriptor, client: AgentHandoffClient): Promise<{
    name: string;
    description: string;
    inputSchema: Record<string, unknown>;
    handler: (input: {
        messages: Array<{
            role: string;
            content: string;
        }>;
        handoffChain?: string[];
    }) => Promise<{
        runId: string;
    }>;
}>;
//# sourceMappingURL=handoff.d.ts.map