/** * memory-journal-mcp — Frontmatter Parser & Serializer * * Hand-rolled YAML frontmatter parser (~100 lines) for zero-dependency * markdown interoperability. Supports scalar values, string arrays, * and object arrays (for relationships). * * Design rationale: Avoids adding a YAML parsing dependency (js-yaml, * yaml, etc.) to keep supply-chain surface minimal. The subset of YAML * used by MJ frontmatter is simple enough to parse with line splitting. */ /** Parsed frontmatter data structure */ export interface FrontmatterData { mj_id?: number; entry_type?: string; author?: string; tags?: string[]; timestamp?: string; significance?: string; relationships?: { type: string; target_id: number; }[]; source?: string; } /** Result of parsing a frontmattered markdown file */ export interface ParseResult { metadata: FrontmatterData; body: string; } /** * Serialize frontmatter data into a JSON frontmatter block. * Output: `---\n{\n "key": "value"\n}\n---\n` */ export declare function serializeFrontmatter(data: FrontmatterData | null | undefined): string; /** * Parse a markdown file with YAML frontmatter. * * - First line must be `---` * - Frontmatter ends at the next `---` line * - Supports: scalar values, string arrays (`- item`), relationship objects * - Returns validated metadata + body content * * @throws Error if frontmatter is malformed or fails validation */ export declare function parseFrontmatter(content: string): ParseResult; //# sourceMappingURL=frontmatter.d.ts.map