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.

43 lines 1.83 kB
/** * Extracts metadata from pure YAML memory files for lightweight indexing. * * Memory files differ from other elements: they are pure YAML (not markdown * with frontmatter). Metadata lives under a top-level `metadata` key or * directly as top-level keys. This extractor reads raw YAML and returns * the subset of fields needed for ElementIndexEntry without constructing * a full Memory object. */ import type { ElementIndexEntry } from './types.js'; export declare class MemoryMetadataExtractor { /** Align with SecureYamlParser default raw YAML limit (64KB). */ private static readonly MAX_YAML_SIZE; /** * Extract index-relevant metadata from raw YAML memory content. * * @param rawContent - Full YAML file content * @param relativePath - Path relative to the memories element directory * @returns Partial ElementIndexEntry with extracted fields */ static extractMetadata(rawContent: string, relativePath: string): Partial<ElementIndexEntry>; /** * Infer the memory type from the file's relative path. * * @param relativePath - Path relative to the memories directory * @returns 'system' | 'adapter' | 'user' */ static inferMemoryType(relativePath: string): string; /** * Extract YAML content between --- frontmatter markers. * Returns null if no valid frontmatter block found. */ private static extractFrontmatter; /** * Parse raw YAML using the centralized secure parser. * Returns parse diagnostics so callers can fail closed while preserving error context. */ private static tryParseYamlObject; /** Return a minimal default entry for empty/corrupt content. */ private static defaultEntry; private static normalizeText; } //# sourceMappingURL=MemoryMetadataExtractor.d.ts.map