import { CustomTool } from '@theokit/sdk'; /** How to authenticate to the remote agent. */ interface A2AAuth { /** Bearer token → `Authorization: Bearer `. */ bearer?: string; /** API-key header pair → `: ` (e.g. `x-api-key`). */ apiKey?: { header: string; value: string; }; } interface A2AToolConfig { /** Remote agent endpoint URL (POST target). */ url: string; /** Tool name the model calls. */ name: string; /** Tool description surfaced to the model. */ description: string; /** Static headers merged into every request. */ headers?: Record; /** Auth applied to every request. */ auth?: A2AAuth; /** Injected fetch (defaults to the global). Narrowed to the call shape this client uses. */ fetchImpl?: (url: string, init: RequestInit) => Promise; } /** * Create a tool that delegates to a remote A2A agent. The remote answers the `{ message }` POST with * a UIMessage event stream, as the routes `generateAgentRoutes` and `mountAgent` serve do; the tool * returns the text of the streamed assistant message. A stream that carries an error frame, or that * ends before its `finish` frame, rejects naming the tool rather than returning partial text; so * does a turn that finished with no text after frames the reader could not read. A remote whose * turn waits on a tool approval rejects when the gate appears: an A2A call cannot answer it. */ declare function createA2ATool(config: A2AToolConfig): CustomTool; export { type A2AAuth, type A2AToolConfig, createA2ATool };