import { type AgentJsonSkillConfig, type AgentSkill, type AgentSkillAvailability, type AgentSkillVersionInfo, type SkillSource } from '@n8n/api-types'; import { TransactionRunner, type OperationContext, type User } from '@n8n/db'; import { SkillAccessService, type SkillMoveOptions, type SkillRef, SkillRuntimeService, SkillService, type SkillTarget } from '../../modules/skills'; import type { AgentHistory } from './entities/agent-history.entity'; import type { Agent } from './entities/agent.entity'; import type { AgentSkillRefs } from './json-config/agent-document'; import { AgentSkillRepository } from './repositories/agent-skill.repository'; export interface AgentSkillsSnapshot { skillRefs: AgentJsonSkillConfig[]; skills: Record; } export declare class AgentSkillRefsService { private readonly agentSkillRepository; private readonly skillService; private readonly skillRuntime; private readonly skillAccess; private readonly txRunner; constructor(agentSkillRepository: AgentSkillRepository, skillService: SkillService, skillRuntime: SkillRuntimeService, skillAccess: SkillAccessService, txRunner: TransactionRunner); refsForDraft(agent: Pick, ctx: OperationContext): Promise; refsForVersion(version: Pick, ctx: OperationContext): Promise; readDraft(agent: Pick, ctx: OperationContext): Promise; readVersion(version: Pick, ctx: OperationContext): Promise; skillsForRefs(skillRefs: AgentSkillRefs, ctx: OperationContext): Promise>; findOutdatedSkillIds(skillRefs: AgentJsonSkillConfig[], skills: Record, ctx: OperationContext): Promise; findSkillVersions(agent: Pick, skillRefs: AgentJsonSkillConfig[], ctx: OperationContext): Promise>; private publishedVersionNumbers; effectiveDraftRefs(agent: Pick, refs: AgentJsonSkillConfig[], ctx: OperationContext): Promise; replaceDraftRefs(agent: Pick, refs: AgentSkillRefs, ctx: OperationContext): Promise; replaceAllDraftRefs(agent: Pick, refs: AgentSkillRefs, ctx: OperationContext): Promise; detachDraftRefs(agentId: string, skillIds: string[], ctx: OperationContext): Promise; restoreDraftRefs(agent: Pick, version: Pick, refs: AgentSkillRefs, ctx: OperationContext): Promise; unpinDraftRef(agent: Pick, skillId: string, ctx: OperationContext): Promise; createDraftRefs(agent: Pick, refs: AgentSkillRefs, bodies: Record, creator: User | null, ctx: OperationContext): Promise; createSkills(agent: Pick, skills: AgentSkill[], creatorId: string, availableTo: AgentSkillAvailability, source: SkillSource, ctx: OperationContext): Promise; versionSnapshot(agent: Pick, ctx: OperationContext): Promise>; pinVersion(agentVersionId: string, pins: Map, ctx: OperationContext): Promise; assertVersionAccess(agent: Pick, version: AgentHistory, ctx: OperationContext): Promise; availabilityOf(skillId: string, ctx: OperationContext): Promise; setAvailability(agent: Pick, skillId: string, availableTo: AgentSkillAvailability, ctx: OperationContext, options?: SkillMoveOptions): Promise; isAttachable(skill: SkillTarget, agent: { id: string; projectId: string | null; }): boolean; checkRefs(agent: { id: string; projectId: string | null; }, refs: SkillRef[], ctx?: OperationContext): Promise; private assertPinsBelongToSkills; private writeDependencies; }