n8n
Version:
n8n Workflow Automation Tool
53 lines (52 loc) • 3.04 kB
TypeScript
import { type CredentialProvider } from '@n8n/agents';
import { type AgentConfigValidationResponse, type AgentIntegrationConfig } from '@n8n/api-types';
import { WorkflowRepository } from '@n8n/db';
import { NodeTypes } from '../../node-types';
import type { AgentHistory } from './entities/agent-history.entity';
import type { Agent } from './entities/agent.entity';
import { ChatIntegrationRegistry } from './integrations/agent-chat-integration';
import { AgentTaskSnapshotRepository } from './repositories/agent-task-snapshot.repository';
import { AgentTaskRepository } from './repositories/agent-task.repository';
import { AgentRepository } from './repositories/agent.repository';
type AgentValidationScope = 'runtime' | 'publish';
type TaskBody = {
name: string;
objective: string;
cronExpression: string;
};
export declare class AgentValidationService {
private readonly agentRepository;
private readonly agentTaskRepository;
private readonly agentTaskSnapshotRepository;
private readonly nodeTypes;
private readonly workflowRepository;
private readonly chatIntegrationRegistry;
constructor(agentRepository: AgentRepository, agentTaskRepository: AgentTaskRepository, agentTaskSnapshotRepository: AgentTaskSnapshotRepository, nodeTypes: NodeTypes, workflowRepository: WorkflowRepository, chatIntegrationRegistry: ChatIntegrationRegistry);
validateAgentIsRunnable(agentId: string, projectId: string, credentialProvider: CredentialProvider): Promise<{
missing: string[];
}>;
validateAgentConfiguration(agentId: string, projectId: string, credentialProvider: CredentialProvider, scope?: AgentValidationScope): Promise<AgentConfigValidationResponse>;
validateLoadedAgentConfiguration(agent: Agent, projectId: string, credentialProvider: CredentialProvider, scope?: AgentValidationScope): Promise<AgentConfigValidationResponse>;
validateAgentEntityConfiguration(agent: Agent, projectId: string, tasks: ReadonlyMap<string, TaskBody>, credentialProvider: CredentialProvider, scope?: AgentValidationScope, integrationsOverride?: AgentIntegrationConfig[]): Promise<AgentConfigValidationResponse>;
validateAgentHistoryConfiguration(agentId: string, projectId: string, history: AgentHistory, currentIntegrations: AgentIntegrationConfig[], credentialProvider: CredentialProvider): Promise<AgentConfigValidationResponse>;
private runValidation;
private missingConfigIssues;
private collectIssues;
private prefetchReferenceLookups;
private dedupe;
private collectCoreIssues;
private collectMainCredentialIssues;
private collectSubAgentRefIssues;
private collectSkillIssues;
private collectTaskIssues;
private collectVectorStoreIssues;
private collectChannelIssues;
private collectToolIssues;
private collectWorkflowToolIssues;
private collectNodeToolIssues;
private collectMcpServerIssues;
private mcpCredentialTypeMatches;
private credentialSupportsModel;
private findCredentialSafe;
}
export {};