n8n
Version:
n8n Workflow Automation Tool
51 lines (50 loc) • 3.12 kB
TypeScript
import { type AgentCapabilitySummary, type AgentJsonConfig, type AgentSkill, type ListAgentsQueryDto } from '@n8n/api-types';
import { Logger } from '@n8n/backend-common';
import { ProjectRelationRepository, type User } from '@n8n/db';
import { AgentChatAttachmentService } from './agent-chat-attachment.service';
import { AgentKnowledgeService } from './agent-knowledge.service';
import { AgentExecutionService } from './agent-execution.service';
import { AgentRuntimeCacheService } from './agent-runtime-cache.service';
import { AgentTestChatService } from './agent-test-chat.service';
import { Agent } from './entities/agent.entity';
import { AgentTaskRepository } from './repositories/agent-task.repository';
import { AgentRepository, type AgentSummary, type AgentSummaryFilters } from './repositories/agent.repository';
import { SubAgentCleanupService } from './sub-agents/sub-agent-cleanup.service';
import { EventService } from '../../events/event.service';
export declare class AgentsService {
private readonly logger;
private readonly agentRepository;
private readonly projectRelationRepository;
private readonly agentChatAttachmentService;
private readonly agentKnowledgeService;
private readonly runtimeCacheService;
private readonly testChatService;
private readonly agentTaskRepository;
private readonly subAgentCleanupService;
private readonly eventService;
private readonly agentExecutionService;
constructor(logger: Logger, agentRepository: AgentRepository, projectRelationRepository: ProjectRelationRepository, agentChatAttachmentService: AgentChatAttachmentService, agentKnowledgeService: AgentKnowledgeService, runtimeCacheService: AgentRuntimeCacheService, testChatService: AgentTestChatService, agentTaskRepository: AgentTaskRepository, subAgentCleanupService: SubAgentCleanupService, eventService: EventService, agentExecutionService: AgentExecutionService);
create(projectId: string, name: string, { availableInMCP, id, adoptUnconfiguredOnCollision, schema, skills, }?: {
availableInMCP?: boolean;
id?: string;
adoptUnconfiguredOnCollision?: boolean;
schema?: AgentJsonConfig;
skills?: Record<string, AgentSkill>;
}): Promise<Agent>;
findByProjectId(projectId: string): Promise<Agent[]>;
findByProjectIdPaginated(projectId: string, options: ListAgentsQueryDto): Promise<{
count: number;
data: Agent[];
}>;
findById(agentId: string, projectId: string): Promise<Agent | null>;
getCapabilitySummary(agentId: string, projectId: string): Promise<AgentCapabilitySummary>;
findByUser(userId: string): Promise<Agent[]>;
findSummariesInProjects(projectIds: string[] | null, options?: AgentSummaryFilters): Promise<AgentSummary[]>;
findByIdForUser(agentId: string, user: User): Promise<Agent | null>;
findByUserPaginated(userId: string, options: ListAgentsQueryDto): Promise<{
count: number;
data: Agent[];
}>;
findPublishedByUser(userId: string): Promise<Agent[]>;
delete(agentId: string, projectId: string): Promise<boolean>;
}