import { type AgentConfigValidationResponse, type AgentVersionListItemDto } from '@n8n/api-types'; import { Logger } from '@n8n/backend-common'; import type { User } from '@n8n/db'; import { CredentialsService } from '../../credentials/credentials.service'; import { Telemetry } from '../../telemetry'; import { AgentCustomToolsService } from './agent-custom-tools.service'; import { AgentRuntimeCacheService } from './agent-runtime-cache.service'; import { AgentValidationService } from './agent-validation.service'; import type { Agent } from './entities/agent.entity'; import { AgentHistoryRepository } from './repositories/agent-history.repository'; import { AgentTaskSnapshotRepository } from './repositories/agent-task-snapshot.repository'; import { AgentTaskRepository } from './repositories/agent-task.repository'; import { AgentRepository } from './repositories/agent.repository'; import { SubAgentCleanupService } from './sub-agents/sub-agent-cleanup.service'; export type AgentPublishSource = 'editor' | 'builder' | 'channel_connect' | 'slack_setup'; export interface PublishAgentOptions { syncIntegrations?: boolean; ignoreDraftIntegrations?: boolean; } export type ValidAgentConfigValidationResponse = AgentConfigValidationResponse & { status: 'valid'; }; export interface PublishAgentResult { agent: Agent; draftValidation?: ValidAgentConfigValidationResponse; } export declare class AgentPublishService { private readonly logger; private readonly agentRepository; private readonly agentHistoryRepository; private readonly agentTaskSnapshotRepository; private readonly agentTaskRepository; private readonly customToolsService; private readonly runtimeCacheService; private readonly subAgentCleanupService; private readonly agentValidationService; private readonly credentialsService; private readonly telemetry; constructor(logger: Logger, agentRepository: AgentRepository, agentHistoryRepository: AgentHistoryRepository, agentTaskSnapshotRepository: AgentTaskSnapshotRepository, agentTaskRepository: AgentTaskRepository, customToolsService: AgentCustomToolsService, runtimeCacheService: AgentRuntimeCacheService, subAgentCleanupService: SubAgentCleanupService, agentValidationService: AgentValidationService, credentialsService: CredentialsService, telemetry: Telemetry); publishAgent(agentId: string, projectId: string, user: User, source: AgentPublishSource, versionId?: string, options?: PublishAgentOptions): Promise; private assertPublishable; unpublishAgent(agentId: string, projectId: string, user: User, source: 'editor' | 'builder'): Promise; revertToPublishedAgent(agentId: string, projectId: string): Promise; revertToVersion(agentId: string, projectId: string, versionId: string): Promise; hasPublishHistory(agentId: string): Promise; listPublishHistory(agentId: string, projectId: string, take: number, skip: number): Promise; private snapshotConfiguredTasks; private pickConfiguredSkillBodies; private restoreTasksFromSnapshot; }