@xynehq/jaf
Version:
Juspay Agent Framework - A purely functional agent framework with immutable state and composable tools
43 lines • 2.16 kB
TypeScript
/**
* Pure functional A2A executor
* Handles A2A protocol execution without classes or mutable state
*/
import type { A2AAgent, A2ATask, A2AMessage, A2AStreamEvent } from './types.js';
import { A2ATaskProvider } from './memory/types.js';
export type A2AExecutionContext = {
readonly message: A2AMessage;
readonly currentTask?: A2ATask;
readonly sessionId: string;
readonly metadata?: Readonly<Record<string, any>>;
};
export type A2AExecutionContextWithProvider = {
readonly message: A2AMessage;
readonly currentTask?: A2ATask;
readonly sessionId: string;
readonly metadata?: Readonly<Record<string, any>>;
readonly taskProvider: A2ATaskProvider;
};
export type A2AExecutionEvent = {
readonly type: 'task_created' | 'status_update' | 'artifact_added' | 'completed' | 'failed';
readonly data: any;
readonly timestamp: string;
};
export type A2AExecutionResult = {
readonly events: readonly A2AExecutionEvent[];
readonly finalTask?: A2ATask;
readonly error?: string;
};
export declare const executeA2AAgent: (context: A2AExecutionContext, agent: A2AAgent, modelProvider: any) => Promise<A2AExecutionResult>;
export declare const convertToA2AStreamEvents: (events: readonly A2AExecutionEvent[], taskId: string, contextId: string) => AsyncGenerator<A2AStreamEvent, void, unknown>;
export declare const executeA2AAgentWithStreaming: (context: A2AExecutionContext, agent: A2AAgent, modelProvider: any) => AsyncGenerator<A2AStreamEvent, void, unknown>;
/**
* Execute A2A agent with persistent task storage
* Pure function that integrates with A2A task providers
*/
export declare const executeA2AAgentWithProvider: (context: A2AExecutionContextWithProvider, agent: A2AAgent, modelProvider: any) => Promise<A2AExecutionResult>;
/**
* Execute A2A agent with streaming and persistent task storage
* Pure async generator function that integrates with A2A task providers
*/
export declare const executeA2AAgentWithProviderStreaming: (context: A2AExecutionContextWithProvider, agent: A2AAgent, modelProvider: any) => AsyncGenerator<A2AStreamEvent, void, unknown>;
//# sourceMappingURL=executor.d.ts.map