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.

78 lines 2.93 kB
/** * DefaultElementProvider - Populates portfolio with default elements from bundled data * * This class handles copying default personas, skills, templates, and other elements * from the NPM package or Git repository to the user's portfolio on first run. * It ensures users have example content to work with immediately after installation. */ export declare const FILE_CONSTANTS: { readonly ELEMENT_EXTENSION: ".md"; readonly YAML_EXTENSION: ".yaml"; readonly YML_EXTENSION: ".yml"; readonly JSON_EXTENSION: ".json"; readonly MAX_FILE_SIZE: number; readonly CHECKSUM_ALGORITHM: "sha256"; readonly FILE_PERMISSIONS: 420; readonly CHUNK_SIZE: number; }; export interface DefaultElementProviderConfig { /** Custom data directory paths to search (checked before default paths) */ customDataPaths?: string[]; /** Whether to use default search paths after custom paths */ useDefaultPaths?: boolean; } export declare class DefaultElementProvider { private readonly __dirname; private static cachedDataDir; private static populateInProgress; private readonly config; constructor(config?: DefaultElementProviderConfig); /** * Search paths for bundled data directory * Ordered by priority - custom paths first, then development/git, then NPM locations */ private get dataSearchPaths(); /** * Find the bundled data directory by checking each search path * Uses Promise.allSettled for better performance and caches the result */ private findDataDirectory; /** * Helper to check if a directory exists */ private directoryExists; /** * Copy all files from source directory to destination directory * Skips files that already exist to preserve user modifications */ private copyElementFiles; /** * Copy a file with integrity verification * Ensures the file was copied correctly by comparing sizes */ /** * Calculate checksum of a file for integrity verification * @param filePath Path to the file * @returns Hex-encoded checksum */ private calculateChecksum; /** * Copy file with integrity verification and retry logic * @param sourcePath Source file path * @param destPath Destination file path * @throws Error if copy fails after all retry attempts */ private copyFileWithVerification; /** * Populate the portfolio with default elements from bundled data * This is called during portfolio initialization for new installations * Protected against concurrent calls to prevent race conditions */ populateDefaults(portfolioBaseDir: string): Promise<void>; /** * Perform the actual population of default elements * @param portfolioBaseDir Base directory of the portfolio */ private performPopulation; } //# sourceMappingURL=DefaultElementProvider.d.ts.map