n8n
Version:
n8n Workflow Automation Tool
27 lines (26 loc) • 1.47 kB
TypeScript
import { type ToolDescriptor } from '@n8n/agents';
import { type AgentJsonConfig } from '@n8n/api-types';
import { Logger } from '@n8n/backend-common';
import { AgentModificationTelemetryService, type AgentMutationTelemetryContext } from './agent-modification-telemetry.service';
import { AgentRuntimeCacheService } from './agent-runtime-cache.service';
import type { Agent } from './entities/agent.entity';
import { AgentRepository } from './repositories/agent.repository';
type AgentToolEntries = Agent['tools'];
export declare class AgentCustomToolsService {
private readonly logger;
private readonly agentRepository;
private readonly runtimeCacheService;
private readonly modificationTelemetry;
constructor(logger: Logger, agentRepository: AgentRepository, runtimeCacheService: AgentRuntimeCacheService, modificationTelemetry: AgentModificationTelemetryService);
buildCustomTool(agentId: string, projectId: string, code: string, descriptor: ToolDescriptor, context: AgentMutationTelemetryContext, options?: {
recordTelemetry?: boolean;
}): Promise<{
ok: boolean;
id: string;
descriptor: ToolDescriptor;
}>;
deleteCustomTool(agentId: string, projectId: string, toolId: string, context: AgentMutationTelemetryContext): Promise<void>;
private getMissingCustomToolIds;
snapshotConfiguredTools(config: AgentJsonConfig | null, tools: AgentToolEntries): AgentToolEntries | null;
}
export {};