UNPKG

@n8n-plus/n8n-plus

Version:

n8n Workflow Automation Tool (plus edition)

17 lines (16 loc) 1.01 kB
import type { BuiltMemory, BuiltTool, CredentialProvider, ToolDescriptor, Agent as RuntimeAgent } from '@n8n/agents'; import type { AgentSkill, AgentJsonConfig, AgentJsonMemoryConfig, AgentJsonToolConfig } from '@n8n/api-types'; export type ToolResolver = (toolSchema: AgentJsonToolConfig) => Promise<BuiltTool | null | undefined>; export interface ToolExecutor { executeTool(toolName: string, input: unknown, ctx: unknown): Promise<unknown>; executeToMessageSync?(toolName: string, output: unknown): unknown; } export type MemoryFactory = (params: AgentJsonMemoryConfig) => BuiltMemory | Promise<BuiltMemory>; export interface BuildFromJsonOptions { toolExecutor: ToolExecutor; credentialProvider: CredentialProvider; resolveTool?: ToolResolver; skills?: Record<string, AgentSkill>; memoryFactory: MemoryFactory; } export declare function buildFromJson(config: AgentJsonConfig, toolDescriptors: Record<string, ToolDescriptor>, options: BuildFromJsonOptions): Promise<RuntimeAgent>;