import { discoverAgents as defaultDiscoverAgents, findAgent as defaultFindAgent, type DiscoveredAgent } from "../server/agent-discovery.js"; import { callAction as defaultCallAction, callAgent as defaultCallAgent } from "./client.js"; import type { A2ACorrelationMetadata, A2AReadOnlyActionResult } from "./types.js"; export type AgentInvocationErrorCode = "missing-target" | "missing-prompt" | "missing-action" | "invalid-input" | "invalid-url" | "self-call" | "not-found"; export declare class AgentInvocationError extends Error { readonly code: AgentInvocationErrorCode; readonly target?: string; readonly availableAgents?: DiscoveredAgent[]; constructor(code: AgentInvocationErrorCode, message: string, options?: { target?: string; availableAgents?: DiscoveredAgent[]; }); } export interface ResolvedAgentInvocationTarget { kind: "discovered" | "url"; id?: string; name: string; description?: string; url: string; color?: string; } export interface AgentInvocationResult { target: ResolvedAgentInvocationTarget; prompt: string; responseText: string; } export interface AgentActionInvocationResult { target: ResolvedAgentInvocationTarget; action: string; result: A2AReadOnlyActionResult; } export interface AgentInvocationRuntime { findAgent: typeof defaultFindAgent; discoverAgents: typeof defaultDiscoverAgents; callAgent: typeof defaultCallAgent; callAction: typeof defaultCallAction; } export interface ResolveAgentInvocationTargetOptions { selfAppId?: string; selfUrl?: string; runtime?: Partial; } export interface InvokeAgentOptions extends ResolveAgentInvocationTargetOptions { target: string; prompt: string; apiKey?: string; contextId?: string; userEmail?: string; orgDomain?: string; orgSecret?: string; async?: boolean; timeoutMs?: number; pollIntervalMs?: number; includeInvocationHint?: boolean; correlation?: A2ACorrelationMetadata; idempotencyKey?: string; runtime?: Partial; } export interface InvokeAgentActionOptions extends ResolveAgentInvocationTargetOptions { target: string; action: string; input?: Record; apiKey?: string; userEmail?: string; orgDomain?: string; orgSecret?: string; requestTimeoutMs?: number; correlation?: A2ACorrelationMetadata; runtime?: Partial; } /** * Resolve an A2A invocation target from a direct URL or from the connected app * registry. ID/name resolution deliberately uses the same discovery path as * the in-agent `call-agent` script. */ export declare function resolveAgentInvocationTarget(target: string, options?: ResolveAgentInvocationTargetOptions): Promise; /** * First-class headless A2A primitive: resolve an app/agent by id, name, or URL, * send a text prompt, and return the text response with target metadata. */ export declare function invokeAgent(options: InvokeAgentOptions): Promise; /** * Resolve another app and execute one explicitly exposed read-only action on * it. This is the fast A2A path for bounded data operations that do not need a * second model to plan or synthesize. */ export declare function invokeAgentAction(options: InvokeAgentActionOptions): Promise; export declare function buildAgentInvocationPrompt(prompt: string, agentUrl: string): string; export declare function looksLikeAgentUrl(value: string): boolean; //# sourceMappingURL=invoke.d.ts.map