import type { Artifact } from "./types/artifact.js"; import type { ParsedDocument } from "./types/metadata.js"; export interface YamlFrontmatterError { code: string; message: string; line: number; } export interface YamlFrontmatterField { key: string; value: unknown; startLine: number; endLine: number; sequenceItems?: YamlFrontmatterSequenceItem[]; } export interface YamlTopLevelKeyEvidence { key: string; startLine: number; endLine: number; } export interface YamlFrontmatterSequenceItem { value: unknown; startLine: number; endLine: number; } export interface YamlFrontmatterCommentLine { content: string; line: number; startColumn: number; endColumn: number; } /** Syntactic YAML comment text with exact original frontmatter evidence. */ export interface YamlFrontmatterComment { content: string; startLine: number; endLine: number; startColumn: number; endColumn: number; lines: YamlFrontmatterCommentLine[]; } export interface ParsedYamlFrontmatter { present: boolean; closed: boolean; mapping: boolean; bodyStartLine: number; values: Record; fields: YamlFrontmatterField[]; metadataFields: YamlFrontmatterField[]; /** True only when syntactic YAML-comment extraction completed successfully. */ commentsAnalyzable: boolean; comments: YamlFrontmatterComment[]; duplicateFields: YamlFrontmatterField[]; duplicateMetadataKeys: YamlFrontmatterField[]; errors: YamlFrontmatterError[]; } export type YamlFrontmatterCommentAnalysis = Pick; /** Parse a focused YAML 1.2 frontmatter document without replacing the Markdown parser. */ export declare function parseAgentSkillFrontmatter(content: string): ParsedYamlFrontmatter; /** Parse the exact general Renma frontmatter envelope as YAML 1.2. */ export declare function parseRenmaFrontmatter(content: string): ParsedYamlFrontmatter; /** Select one envelope contract from the discovered artifact role and parse it once. */ export declare function parseFrontmatterForArtifact(artifact: Pick): ParsedYamlFrontmatter; /** Retain the primary artifact-aware YAML parse as private document state. */ export declare function attachYamlFrontmatter(document: ParsedDocument, frontmatter: ParsedYamlFrontmatter): void; /** Recover artifact-aware YAML state only for independently reconstructed documents. */ export declare function ensureYamlFrontmatterForDocument(document: ParsedDocument): ParsedYamlFrontmatter; /** * Retain declaration identity for malformed Renma frontmatter without * recovering any operational value. Parser-owned root fields take priority; * the lexical fallback accepts only column-zero mapping keys, so nested * mappings, sequence items, comments, and scalar contents cannot gain * top-level authority. */ export declare function recognizedMalformedTopLevelKeys(content: string, frontmatter: ParsedYamlFrontmatter, knownKeys: ReadonlySet): YamlTopLevelKeyEvidence[];