/** * Remote agent A2A execution — plain function, no class. * * Bridges a remote PS platform agent run into an A2A ExecutionEventBus. * Called from PSAgent.execute() when local: false (the default). * * Everything PSAgent-specific is passed in via RemoteAgentContext so this * module has no dependency on PSAgent itself. */ import type { ExecutionEventBus, RequestContext } from '@a2a-js/sdk/server'; import type { IStreamLogger } from './PSAgentLogger'; import type { IPSAgentToolResult } from './PSAgentTool'; /** * Everything executeRemoteAgent needs from PSAgent, passed as a plain object. * Keeps this module free of any PSAgent import / circular dependency. */ export interface RemoteAgentContext { name: string; log?: IStreamLogger; cancelledTasks: Set; start: (input: object, messages: any[], log?: IStreamLogger) => Promise; getEvents: () => Promise>>; executeTool: (toolName: string, input: Record, log?: IStreamLogger) => Promise; } export declare function executeRemoteAgent(ctx: RemoteAgentContext, requestContext: RequestContext, eventBus: ExecutionEventBus): Promise;