/** * Simplified AMQP backend for A2A agents * * Provides a simple interface to set up AMQP connection and work queue * with minimal configuration. */ import { AMQPConnection } from "./AMQPConnection.js"; import { AMQPWorkQueue } from "./AMQPWorkQueue.js"; import type { Logger } from "./types.js"; /** * Simple configuration for AMQP agent backend */ export interface AMQPAgentBackendConfig { /** * AMQP broker URL (e.g., 'amqp://localhost:5672') */ url: string; /** * Agent name used for connection name and consumer tags */ agentName: string; /** * Optional: Stream retention period (default: "7d") * Examples: "24h", "7d", "30d" */ streamRetention?: string; /** * Optional: Maximum stream size in bytes (default: 1GB) */ streamMaxBytes?: number; /** * Optional: Custom queue name for task storage * Default: "{agentName}.tasks" */ taskQueueName?: string; /** * Optional: Custom exchange name * Default: "a2a.events" */ exchangeName?: string; /** * Optional: Custom work queue name * Default: "{agentName}.work-queue" */ workQueueName?: string; /** * Optional: Logger instance for debugging and monitoring * Default: ConsoleLogger with "[{agentName}] " prefix */ logger?: Logger; /** * Optional: Connection configuration */ connection?: { /** * Heartbeat interval in seconds (default: 60) */ heartbeat?: number; /** * Reconnection delay in milliseconds (default: 5000) */ reconnectDelay?: number; /** * Maximum reconnection attempts (default: 10) */ maxReconnectAttempts?: number; }; } /** * AMQP Agent Backend * * Simplified interface for setting up AMQP-backed A2A agent infrastructure. * Manages connection and work queue components. */ export declare class AMQPAgentBackend { private connection; private workQueueInstance; private constructor(); /** * Create and initialize AMQP agent backend * * @param config - Configuration with URL and agent name * @returns Initialized AMQP backend * * @example * ```typescript * const backend = await AMQPAgentBackend.create({ * url: "amqp://localhost:5672", * agentName: "my-agent" * }); * * const requestHandler = new QueuingRequestHandler(agentCard, backend); * await requestHandler.initialize(); * ``` */ static create(config: AMQPAgentBackendConfig): Promise; /** * Get the AMQP connection (for advanced use cases) */ get amqpConnection(): AMQPConnection; /** * Get the work queue */ get workQueue(): AMQPWorkQueue; /** * Close all connections and clean up resources */ close(): Promise; } //# sourceMappingURL=AMQPAgentBackend.d.ts.map