/** * Agent-to-Agent Protocol (A2A) — minimal open spec for one agent to * invoke another over JSON-RPC 2.0. Companion to MCP (which is * model-to-tool); A2A is agent-to-agent task delegation, approvals, * and streaming status updates. * * Version: 2026-04. */ declare const A2A_PROTOCOL_VERSION = "2026-04"; interface A2AAgentCard { /** Stable identifier (reverse-DNS or npm scope recommended). */ id: string; name: string; description?: string; version: string; /** Skills the agent advertises. */ skills: A2ASkillDescriptor[]; /** Optional JSON Schema for expected context on `task/invoke`. */ contextSchema?: Record; /** Human-facing URL (docs, source, demo). */ homepage?: string; /** Icon URL for marketplaces. */ icon?: string; } interface A2ASkillDescriptor { name: string; description?: string; /** JSON Schema of the expected task input. */ inputSchema?: Record; /** Advertised capabilities the caller can rely on. */ capabilities?: { streaming?: boolean; cancellation?: boolean; requiresApproval?: boolean; }; } interface A2AInvokeParams { skill: string; input: Record; /** Caller context (user id, tenant, trace id). */ context?: Record; /** Set true for streaming via `task/status` notifications. */ stream?: boolean; } interface A2AInvokeResult { taskId: string; /** Terminal state for non-streaming invocations; 'running' for stream. */ status: 'completed' | 'failed' | 'running' | 'requires-approval'; output?: Record; error?: { code: number; message: string; data?: unknown; }; } interface A2ATaskStatusNotification { taskId: string; status: 'running' | 'completed' | 'failed' | 'requires-approval'; progress?: number; partial?: Record; output?: Record; error?: { code: number; message: string; }; } interface A2ACancelParams { taskId: string; reason?: string; } interface A2AApproveParams { taskId: string; decision: 'approved' | 'rejected'; approver?: string; metadata?: Record; } type A2AMethod = 'agent/card' | 'task/invoke' | 'task/cancel' | 'task/approve' | 'task/status'; declare function validateAgentCard(raw: unknown): A2AAgentCard; export { type A2AAgentCard, type A2AApproveParams, type A2ACancelParams, type A2AInvokeParams, type A2AInvokeResult, type A2AMethod, type A2ASkillDescriptor, type A2ATaskStatusNotification, A2A_PROTOCOL_VERSION, validateAgentCard };