UNPKG

n8n-nodes-a2a

Version:

n8n community node for A2A (Account to Account) transfers, account management, and Google Agent2Agent protocol communication with advanced features including file upload, custom JSON fields, custom requests, and streaming support

490 lines 16.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.agentFields = exports.agentOperations = void 0; exports.agentOperations = [ { displayName: 'Operation', name: 'operation', type: 'options', noDataExpression: true, displayOptions: { show: { resource: ['agent'], }, }, options: [ { name: 'Send Message', value: 'send', description: 'Send a message to an agent and get complete response (tasks/send)', action: 'Send a message to an agent', }, { name: 'Send Message with Streaming', value: 'sendSubscribe', description: 'Send a message to an agent with streaming response (tasks/sendSubscribe)', action: 'Send a message with streaming response', }, { name: 'Get Agent Card', value: 'getAgentCard', description: 'Get agent capabilities and information from .well-known/agent-card', action: 'Get agent card information', }, { name: 'Custom Request', value: 'custom', description: 'Send a fully customized JSON-RPC request to the agent', action: 'Send custom request to agent', }, ], default: 'send', }, ]; exports.agentFields = [ { displayName: 'Agent URL', name: 'agentUrl', type: 'string', required: true, displayOptions: { show: { resource: ['agent'], operation: ['send', 'sendSubscribe', 'getAgentCard', 'custom'], }, }, default: '', placeholder: 'https://agent-api.example.com', description: 'The base URL of the A2A agent endpoint', }, { displayName: 'Message', name: 'message', type: 'string', required: true, displayOptions: { show: { resource: ['agent'], operation: ['send', 'sendSubscribe'], useCustomJson: [false], }, }, default: '', placeholder: 'Hello, can you help me with...', description: 'The message to send to the agent', typeOptions: { rows: 3, }, }, { displayName: 'Use Custom JSON', name: 'useCustomJson', type: 'boolean', displayOptions: { show: { resource: ['agent'], operation: ['send', 'sendSubscribe'], }, }, default: false, description: 'Whether to use custom JSON format for the complete message structure', }, { displayName: 'Custom JSON Message', name: 'customJsonMessage', type: 'json', required: true, displayOptions: { show: { resource: ['agent'], operation: ['send', 'sendSubscribe'], useCustomJson: [true], }, }, default: '{\n "role": "user",\n "parts": [\n {\n "type": "text",\n "text": "Your message here"\n }\n ]\n}', description: 'Custom JSON structure for the message object', typeOptions: { rows: 8, }, }, { displayName: 'Session ID', name: 'sessionId', type: 'string', displayOptions: { show: { resource: ['agent'], operation: ['send', 'sendSubscribe'], useCustomJson: [false], }, }, default: '', placeholder: 'session-123', description: 'Optional session identifier for conversation context. If not provided, a unique session ID will be generated.', }, { displayName: 'Task ID', name: 'taskId', type: 'string', displayOptions: { show: { resource: ['agent'], operation: ['send', 'sendSubscribe'], useCustomJson: [false], }, }, default: '', placeholder: 'task-456', description: 'Optional task identifier. If not provided, a unique task ID will be generated.', }, { displayName: 'Custom Parameters JSON', name: 'customParametersJson', type: 'json', displayOptions: { show: { resource: ['agent'], operation: ['send', 'sendSubscribe'], useCustomJson: [true], }, }, default: '{\n "sessionId": "session-123",\n "id": "task-456",\n "acceptedOutputModes": ["text"]\n}', description: 'Additional custom parameters to include in the JSON-RPC request', typeOptions: { rows: 6, }, }, { displayName: 'Include Files', name: 'includeFiles', type: 'boolean', displayOptions: { show: { resource: ['agent'], operation: ['send', 'sendSubscribe'], }, }, default: false, description: 'Whether to include file attachments in the message', }, { displayName: 'Files', name: 'files', type: 'fixedCollection', displayOptions: { show: { resource: ['agent'], operation: ['send', 'sendSubscribe'], includeFiles: [true], }, }, default: {}, placeholder: 'Add File', typeOptions: { multipleValues: true, }, description: 'Files to include in the message (will be base64 encoded)', options: [ { name: 'file', displayName: 'File', values: [ { displayName: 'Input Binary Field', name: 'inputFieldName', type: 'string', default: '', placeholder: 'data', description: 'The name of the input binary field containing the file data', hint: 'The name of the binary property which contains the file data to be uploaded', }, { displayName: 'File Name', name: 'fileName', type: 'string', default: '', placeholder: 'document.pdf', description: 'Name for the file (optional, will use original name if not specified)', }, { displayName: 'MIME Type', name: 'mimeType', type: 'string', default: '', placeholder: 'application/pdf', description: 'MIME type of the file (optional, will be auto-detected if not specified)', }, ], }, ], }, { displayName: 'Accepted Output Modes', name: 'acceptedOutputModes', type: 'multiOptions', displayOptions: { show: { resource: ['agent'], operation: ['send', 'sendSubscribe'], }, }, options: [ { name: 'Audio', value: 'audio', }, { name: 'Code', value: 'code', }, { name: 'Image', value: 'image', }, { name: 'Text', value: 'text', }, { name: 'Video', value: 'video', }, ], default: ['text'], description: 'Output modes that the agent should use in its response', }, { displayName: 'JSON-RPC Method', name: 'customMethod', type: 'string', required: true, displayOptions: { show: { resource: ['agent'], operation: ['custom'], }, }, default: 'tasks/send', placeholder: 'tasks/send', description: 'The JSON-RPC method to call', }, { displayName: 'Request Parameters', name: 'customParams', type: 'json', required: true, displayOptions: { show: { resource: ['agent'], operation: ['custom'], }, }, default: '{\n "message": {\n "role": "user",\n "parts": [\n {\n "type": "text",\n "text": "Your message here"\n }\n ]\n },\n "sessionId": "session-123",\n "id": "task-456"\n}', description: 'JSON object containing the parameters for the JSON-RPC request', typeOptions: { rows: 10, }, }, { displayName: 'Request ID', name: 'customRequestId', type: 'string', displayOptions: { show: { resource: ['agent'], operation: ['custom'], }, }, default: '', placeholder: 'call-789', description: 'Optional request ID for the JSON-RPC call. If not provided, a unique ID will be generated.', }, { displayName: 'Additional Options', name: 'additionalOptions', type: 'collection', placeholder: 'Add Option', displayOptions: { show: { resource: ['agent'], operation: ['send', 'sendSubscribe', 'custom'], }, }, default: {}, options: [ { displayName: 'API Key', name: 'apiKey', type: 'string', default: '', description: 'API key for authentication (will be sent as x-api-key header)', typeOptions: { password: true, }, }, { displayName: 'Custom Headers', name: 'headers', type: 'fixedCollection', description: 'Additional headers to send with the request', typeOptions: { multipleValues: true, }, default: {}, options: [ { name: 'parameter', displayName: 'Header', values: [ { displayName: 'Name', name: 'name', type: 'string', default: '', placeholder: 'X-Custom-Header', }, { displayName: 'Value', name: 'value', type: 'string', default: '', placeholder: 'Custom Value', }, ], }, ], }, { displayName: 'Include Metadata', name: 'includeMetadata', type: 'boolean', default: false, description: 'Whether to include additional metadata in the response', }, { displayName: 'Max Retries', name: 'maxRetries', type: 'number', default: 3, description: 'Maximum number of retry attempts for failed requests', typeOptions: { minValue: 0, maxValue: 10, }, }, { displayName: 'Message Role', name: 'role', type: 'options', options: [ { name: 'User', value: 'user', }, { name: 'Assistant', value: 'assistant', }, { name: 'System', value: 'system', }, { name: 'Model', value: 'model', }, ], default: 'user', description: 'The role of the message sender in the conversation', }, { displayName: 'Response Format', name: 'responseFormat', type: 'options', options: [ { name: 'Auto', value: 'auto', description: 'Automatically determine the best response format', }, { name: 'Full Response', value: 'full', description: 'Return the complete JSON-RPC response', }, { name: 'Message Only', value: 'message', description: 'Extract and return only the message content', }, { name: 'Status Only', value: 'status', description: 'Return only the task status information', }, ], default: 'auto', description: 'How to format the response data', }, { displayName: 'Retry Delay', name: 'retryDelay', type: 'number', default: 1000, description: 'Delay between retry attempts in milliseconds', typeOptions: { minValue: 100, maxValue: 10000, }, }, { displayName: 'Stream Processing', name: 'streamProcessing', type: 'options', displayOptions: { show: { '/operation': ['sendSubscribe'], }, }, options: [ { name: 'Collect All Events', value: 'collect', description: 'Collect all streaming events and return them together', }, { name: 'Return Final Only', value: 'final', description: 'Return only the final event when streaming completes', }, { name: 'Return All Events', value: 'all', description: 'Return each streaming event as separate items', }, ], default: 'final', description: 'How to process streaming events', }, { displayName: 'Timeout', name: 'timeout', type: 'number', default: 30000, description: 'Request timeout in milliseconds', typeOptions: { minValue: 1000, maxValue: 300000, }, }, { displayName: 'Validate SSL', name: 'validateSSL', type: 'boolean', default: true, description: 'Whether to validate SSL certificates', }, ], }, ]; //# sourceMappingURL=AgentDescription.js.map