import { type AgentSkill, type SkillScope } from '@n8n/api-types'; import type { User } from '@n8n/db'; import { z } from 'zod'; import { type SkillContent } from './skill-content-hash'; import type { SkillFile } from '../database/entities/skill-file.entity'; import type { SkillFrontmatter, SkillVersion } from '../database/entities/skill-version.entity'; import type { SkillSourceType } from '../database/entities/skill-source-connection.entity'; import type { Skill, SkillSource } from '../database/entities/skill.entity'; export type SkillTarget = { projectId: string | null; }; export declare function isSameSkillTarget(a: SkillTarget, b: SkillTarget): boolean; export type ResolvedSkillRow = { skill: Skill; version: SkillVersion; files: SkillFile[]; }; export type RuntimeVersion = { version: number; pinned: boolean; latest: number; }; export type SkillRef = { id: string; versionId?: string; }; export type SkillUpdate = Partial & { baseSkillHash: string; checkedTarget?: SkillTarget; } & ({ frontmatter?: undefined; baseVersionId?: string; } | { frontmatter: SkillFrontmatter | null; baseVersionId: string; }); export type LatestSkill = { id: string; target: SkillTarget; versionId: string; skill: AgentSkill; frontmatter: SkillFrontmatter | null; contentHash: string; }; export type SkillSaveResult = { versionId: string; version: number; created: boolean; skill: AgentSkill; followingAgentIds: string[]; }; export type SkillMoveOptions = { nameAfterMove?: string; checkedSource?: SkillTarget; agentProjectIds?: string[] | 'all'; }; export interface AssistantSkillContext { user: User; projectId?: string; } export interface AssistantSkillSummary { id: string; projectId: string | null; name: string; description: string; versionId: string; version: number; } export interface AssistantSkillContent extends AssistantSkillSummary { instructions: string; frontmatter: Record | null; files: Array<{ path: string; }>; } export interface AssistantSkillFileContent { skillId: string; versionId: string; path: string; content: string; } export type McpSkillContent = { id: string; projectId: string | null; skill: AgentSkill; origin?: { provider: SkillSourceType; access: 'public' | 'credential'; }; }; export declare function toSkillContent(skill: AgentSkill, frontmatter?: SkillFrontmatter | null): SkillContent; export declare function syncedSourceLabel(source: SkillSource): string | undefined; export declare function toAgentSkill(row: ResolvedSkillRow): AgentSkill; export declare function rowContent(row: ResolvedSkillRow): SkillContent; export declare function contentToAgentSkill(content: SkillContent): AgentSkill; export declare function toLatestSkill(row: ResolvedSkillRow): LatestSkill; export declare function skillContentHashOf(skill: AgentSkill, frontmatter: SkillFrontmatter | null): string; export declare function skillScopeOf(skill: Pick): SkillScope; export declare function trimmedName(name: string): string; export declare function withTrimmedName(skill: T): T; export declare const importableSkillSchema: z.ZodObject<{ description: z.ZodString; instructions: z.ZodEffects; references: z.ZodOptional; content: z.ZodString; }, "strict", z.ZodTypeAny, { path: string; content: string; }, { path: string; content: string; }>, "many">, { path: string; content: string; }[], { path: string; content: string; }[]>>; scripts: z.ZodOptional; templates: z.ZodOptional; assets: z.ZodOptional; examples: z.ZodOptional; other: z.ZodOptional; } & { name: z.ZodString; }, "strict", z.ZodTypeAny, { description: string; instructions: string; references?: { path: string; content: string; }[] | undefined; scripts?: undefined; templates?: undefined; assets?: undefined; examples?: undefined; other?: undefined; name: string; }, { description: string; instructions: string; references?: { path: string; content: string; }[] | undefined; scripts?: undefined; templates?: undefined; assets?: undefined; examples?: undefined; other?: undefined; name: string; }>; export declare function storedContentOf(content: SkillContent): SkillContent;