@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.
54 lines • 2.07 kB
TypeScript
/**
* Adapter to convert simple portfolio elements to full IElement interface
* This resolves type safety issues without complex type casting
*
* FIXES IMPLEMENTED (PR #503):
* 1. TYPE SAFETY (Issue #497): Eliminates complex type casting with adapter pattern
* 2. SECURITY FIX DMCP-SEC-004 (MEDIUM): Added Unicode normalization for all user input
* 3. SECURITY FIX DMCP-SEC-006 (LOW): Added audit logging for element creation
* 4. PERFORMANCE: Helper methods for efficient string normalization
*/
import { IElement, IElementMetadata, ElementValidationResult, ElementStatus } from '../../types/elements/IElement.js';
import { ElementType } from '../../portfolio/types.js';
import { PortfolioElement } from './types.js';
/**
* Adapter class that wraps a simple PortfolioElement and implements IElement
* This allows us to pass portfolio elements to methods expecting IElement
* without complex type casting
*/
export declare class PortfolioElementAdapter implements IElement {
readonly id: string;
readonly type: ElementType;
readonly version: string;
readonly metadata: IElementMetadata;
private readonly portfolioElement;
constructor(element: PortfolioElement);
/**
* Helper to normalize string values safely
*/
private normalizeString;
/**
* Validate the element
*/
validate(): ElementValidationResult;
/**
* Serialize the element to markdown with YAML frontmatter
* FIX: Changed from JSON to markdown format for GitHub portfolio compatibility
* SECURITY FIX #544: Parse and validate existing frontmatter instead of returning as-is
* SECURITY FIX #543: Use SecureYamlParser for robust frontmatter detection
*/
serialize(): string;
/**
* Deserialize from string (not implemented for adapter)
*/
deserialize(_data: string): void;
/**
* Get element status
*/
getStatus(): ElementStatus;
/**
* Get the original portfolio element content
*/
getContent(): string;
}
//# sourceMappingURL=PortfolioElementAdapter.d.ts.map