import { EventService } from '@n8n/backend-services'; import type { AgentActor, AgentIntegrationConfig, AgentJsonConfig } from '@n8n/api-types'; import type { User } from '@n8n/db'; import { TELEMETRY_EVENT, type InferTelemetryProps } from '@n8n/telemetry'; import { InstanceSettings } from 'n8n-core'; import { Telemetry } from '../../telemetry'; import type { Agent } from './entities/agent.entity'; import { type AgentSkillRefs } from './json-config/agent-document'; export type { AgentActor } from '@n8n/api-types'; export type AgentMutationTelemetryContext = { user: User; modifiedBy: AgentActor; pushRef?: string; }; export type AgentConfigPart = 'instructions' | 'model' | 'credential' | 'memory' | 'name' | 'description' | 'config' | 'tools' | 'providerTools' | 'skills' | 'tasks' | 'triggers' | 'subAgents' | 'mcpServers' | 'vectorStores'; export type AgentConfigSetting = NonNullable['changed_settings']>[number]; export declare function diffAgentConfigParts(previousSchema: AgentJsonConfig | null, nextSchema: AgentJsonConfig | null, previousIntegrations: AgentIntegrationConfig[], nextIntegrations: AgentIntegrationConfig[], sidecarChanges?: AgentSidecarChanges): AgentConfigPart[]; export declare function diffAgentConfigSettings(previous: AgentJsonConfig | null, next: AgentJsonConfig | null): AgentConfigSetting[]; export interface AgentModificationEvent { agent: Agent; config: AgentJsonConfig | null; projectId: string; user: User; by: AgentActor; changedParts: AgentConfigPart[]; changedSettings?: AgentConfigSetting[]; } export type AgentCreationEvent = Omit; export type AgentSidecarChanges = Partial>; export declare function buildAgentMutationEvent(agent: AgentType, skillRefs: AgentSkillRefs, projectId: string, context: AgentMutationTelemetryContext, changedParts: AgentConfigPart[]): AgentModificationEvent & { agent: AgentType; }; export declare class AgentModificationTelemetryService { private readonly telemetry; private readonly instanceSettings; private readonly eventService; constructor(telemetry: Telemetry, instanceSettings: InstanceSettings, eventService: EventService); record(event: AgentModificationEvent): void; private vectorStoreFingerprints; recordCreation(event: AgentCreationEvent): void; private recordAssistantActivity; private trackCreation; }