UNPKG

@dollhousemcp/mcp-server

Version:

DollhouseMCP - A Model Context Protocol (MCP) server that enables dynamic AI persona management from markdown files, allowing Claude and other compatible AI assistants to activate and switch between different behavioral personas.

76 lines 2.45 kB
/** * ContentExtractor - Extracts components from DollhouseMCP skills for Anthropic conversion * * Identifies and extracts: * - Code blocks (bash, python, etc.) → scripts/ * - Documentation sections → reference/ * - Examples → examples/ * - Main instructions (preserved in SKILL.md) * * SECURITY MODEL: * - This is a FORMAT ANALYSIS tool, not a security boundary * - Preserves content exactly as-is for mechanical transformation * - No modification, sanitization, or validation * - Used by converters which are format transformers, not security gates */ export interface ExtractedSection { type: 'code' | 'documentation' | 'example' | 'main'; language?: string; title: string; content: string; startLine: number; endLine: number; filename?: string; } export declare class ContentExtractor { /** * Parse DollhouseMCP markdown content and identify extractable sections * REFACTORED: Simplified by extracting code block and section handling logic */ extractSections(content: string): ExtractedSection[]; /** * Process a single line and update state * REFACTORED: Extracted to reduce cognitive complexity */ private processLine; /** * Handle code block start/end boundary * REFACTORED: Extracted to reduce cognitive complexity */ private handleCodeBlockBoundary; /** * Add code block to sections if it should be extracted * REFACTORED: Extracted to reduce cognitive complexity */ private addCodeBlockIfExtractable; /** * Handle section header * REFACTORED: Extracted to reduce cognitive complexity */ private handleSectionHeader; /** * Determine if a code block should be extracted to a separate file */ private shouldExtractCodeBlock; /** * Determine if a documentation section should be extracted */ private shouldExtractSection; /** * Generate appropriate filename for extracted script */ private generateScriptFilename; /** * Infer title for code block from surrounding context */ private inferCodeBlockTitle; /** * Get file extension for language */ private getExtension; /** * Extract complete documentation section (including subsections) */ extractDocumentationSection(content: string, sectionTitle: string): string | null; } //# sourceMappingURL=ContentExtractor.d.ts.map