import type { Artifact } from "./types/artifact.js"; export declare const YAML_FRONTMATTER_MARKER = "---"; export declare const LEADING_ENCODING_BOM = "\uFEFF"; export type FrontmatterContract = "agent-skill" | "renma"; export interface FrontmatterEnvelope { present: boolean; closingIndex: number | undefined; } export interface LeadingEncodingBomResult { content: string; consumed: boolean; } /** Consume at most one absolute leading encoding BOM. */ export declare function consumeOneLeadingEncodingBom(line: string): LeadingEncodingBomResult; /** Normalize only syntax that the selected opener contract already accepts. */ export declare function normalizeFrontmatterOpener(line: string, contract: FrontmatterContract): string; /** Test an opener without granting authority to a sanitized approximation. */ export declare function isFrontmatterOpener(line: string, contract: FrontmatterContract): boolean; /** Test a closer under the selected, intentionally distinct contract. */ export declare function isFrontmatterCloser(line: string, contract: FrontmatterContract): boolean; /** * Return the opener text inspected for bounded corruption evidence. * * Renma's one accepted absolute encoding BOM is excluded before integrity * projection. Agent Skills retain their established whitespace/BOM contract. * The returned text is evidence only and must never be parsed for authority. */ export declare function frontmatterOpenerIntegrityInput(line: string, contract: FrontmatterContract): string; /** Locate one envelope without parsing or repairing its contents. */ export declare function frontmatterEnvelope(lines: readonly string[], contract: FrontmatterContract): FrontmatterEnvelope; /** * Locate an Agent Skills YAML envelope without parsing its contents. * * The opening delimiter retains the established BOM and surrounding-whitespace * handling. A closing delimiter must begin in column one, but may retain * trailing whitespace. Indented delimiter-looking text therefore remains YAML * content, including inside block scalars. */ export declare function agentSkillFrontmatterEnvelope(lines: readonly string[]): FrontmatterEnvelope; /** * Locate the general Renma metadata envelope after consuming one absolute * leading Unicode BOM. The delimiter itself remains exact: visible whitespace * and any remaining characters are noncanonical. */ export declare function renmaFrontmatterEnvelope(lines: readonly string[]): FrontmatterEnvelope; /** Select the frontmatter contract from the artifact's discovered role. */ export declare function frontmatterEnvelopeForArtifact(artifact: Pick, lines: readonly string[]): FrontmatterEnvelope; /** Return the Markdown body start while preserving unclosed-envelope behavior. */ export declare function markdownBodyStartLineForArtifact(artifact: Pick, lines: readonly string[]): number; /** Return a closed frontmatter range under the artifact-selected contract. */ export declare function frontmatterRangeForArtifact(artifact: Pick, lines: readonly string[]): { startLine: number; endLine: number; } | undefined;