/** * SMI-1788: SkillDecomposer Helpers * * Helper functions and constants for skill decomposition. */ import type { DecomposerOptions, ResolvedDecomposerOptions, SkillMetadata, ParsedSection, SubSkill, DecomposedSkill, DecompositionStats } from './SkillDecomposer.types.js'; import type { ExtractableSection } from './SkillAnalyzer.types.js'; /** * Default keywords that indicate a section should be extracted as a sub-skill. * These are used when no custom extractKeywords are provided. */ export declare const DEFAULT_EXTRACT_KEYWORDS: string[]; /** * Default decomposer options */ export declare const DEFAULT_OPTIONS: ResolvedDecomposerOptions; /** * Merge user options with defaults */ export declare function resolveOptions(options?: DecomposerOptions): ResolvedDecomposerOptions; /** * Parse skill content into metadata, frontmatter, and sections */ export declare function parseSkillContent(content: string): { metadata: SkillMetadata; frontmatter: string; sections: ParsedSection[]; }; /** * Determine which sections should be extracted as sub-skills */ export declare function determineSectionsToExtract(sections: ParsedSection[], extractableSections: ExtractableSection[], opts: ResolvedDecomposerOptions): ParsedSection[]; /** * SMI-1794: Sanitize and validate filename for sub-skill * Prevents path traversal and invalid characters */ export declare function sanitizeFilename(name: string): string; /** * Generate a filename for a sub-skill * SMI-1794: Uses sanitized filename to prevent security issues */ export declare function generateSubSkillFilename(sectionTitle: string): string; /** * Format sub-skill content with proper header */ export declare function formatSubSkillContent(section: ParsedSection, skillName: string): string; /** * Create sub-skills from extracted sections */ export declare function createSubSkills(sections: ParsedSection[], skillName: string): SubSkill[]; /** * Generate navigation section linking to sub-skills */ export declare function generateSubSkillNavigation(subSkills: SubSkill[]): string; /** * Generate attribution footer */ export declare function generateAttribution(): string; /** * Add attribution to content without decomposition */ export declare function addAttributionToContent(content: string): string; /** * Create the main skill content with remaining sections */ export declare function createMainSkill(frontmatter: string, allSections: ParsedSection[], extractedSections: ParsedSection[], subSkills: SubSkill[], opts: ResolvedDecomposerOptions): DecomposedSkill; /** * Calculate decomposition statistics */ export declare function calculateStats(originalContent: string, mainSkill: DecomposedSkill, subSkills: SubSkill[]): DecompositionStats; /** * Format multiple Task() calls as a batched operation */ export declare function formatBatchedTasks(tasks: string[]): string[]; //# sourceMappingURL=SkillDecomposer.helpers.d.ts.map