@memberjunction/a2aserver
Version:
MemberJunction Agent-To-Agent (A2A) Server Implementation
54 lines • 2.1 kB
TypeScript
import { IMetadataProvider, UserInfo } from "@memberjunction/core";
export interface OperationResult {
success: boolean;
result?: any;
errorMessage?: string;
}
export interface OperationParameters {
[key: string]: any;
}
/**
* Handles agent-related operations for the A2A server.
*
* **Multi-provider note:** every entity load/save inside this class binds to the
* `IMetadataProvider` passed at construction. The A2A server resolves the provider once
* per request and passes it down — when A2AServer gains a per-request provider model, only
* the request handler changes; this class is already correct.
*/
export declare class AgentOperations {
private contextUser;
private provider;
constructor(contextUser: UserInfo, provider: IMetadataProvider);
/**
* Discovers available agents based on pattern
* @param parameters Parameters containing the pattern
* @returns The operation result with list of agents
*/
discoverAgents(parameters: OperationParameters): Promise<OperationResult>;
/**
* Executes an agent
* @param parameters Parameters containing agent ID/name and execution params
* @returns The operation result with run info
*/
executeAgent(parameters: OperationParameters): Promise<OperationResult>;
/**
* Gets the status of an agent run
* @param parameters Parameters containing the run ID
* @returns The operation result with run status
*/
getAgentRunStatus(parameters: OperationParameters): Promise<OperationResult>;
/**
* Cancels an agent run
* @param parameters Parameters containing the run ID
* @returns The operation result
*/
cancelAgentRun(parameters: OperationParameters): Promise<OperationResult>;
/**
* Processes an agent operation
* @param operation The operation to perform
* @param parameters The operation parameters
* @returns The operation result
*/
processOperation(operation: string, parameters: OperationParameters): Promise<OperationResult>;
}
//# sourceMappingURL=AgentOperations.d.ts.map