@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.
73 lines • 1.97 kB
TypeScript
/**
* Persona import functionality with validation
*/
import { Persona } from '../../types/persona.js';
import { IFileOperationsService } from '../../services/FileOperationsService.js';
type PersonaMap = Map<string, Persona> | {
has: (key: string) => boolean;
keys: () => Iterable<string>;
[Symbol.iterator]: () => Iterator<[string, Persona]>;
};
export interface ImportResult {
success: boolean;
message: string;
persona?: Persona;
filename?: string;
conflicts?: string[];
}
type CurrentUserProvider = () => string | null;
export declare class PersonaImporter {
private readonly getCurrentUser;
private readonly fileOperations;
constructor(_personasDir: string, currentUser: string | null | CurrentUserProvider, _fileLockManager?: unknown, fileOperations?: IFileOperationsService);
/**
* Import a persona from various sources
*/
importPersona(source: string, existingPersonas: PersonaMap, overwrite?: boolean): Promise<ImportResult>;
/**
* Import from file path
*/
private importFromFile;
/**
* Import from base64 string
*/
private importFromBase64;
/**
* Import from raw markdown content
*/
private importFromMarkdown;
/**
* Import a bundle of personas
*/
private importBundle;
/**
* Create persona from exported data
*/
private createPersonaFromExport;
/**
* Validate and enrich metadata
*/
private validateAndEnrichMetadata;
/**
* Find conflicts with existing personas
*/
private findConflicts;
/**
* Check if string is base64
*/
private isBase64;
/**
* Type guard for ExportedPersona
*/
private isExportedPersona;
/**
* Type guard for ExportBundle
*/
private isExportBundle;
/**
* Format bundle import results
*/
private formatBundleImportResult;
}
export {};
//# sourceMappingURL=PersonaImporter.d.ts.map