import { z } from "zod"; export interface MarkdownDoc { frontmatter: Record; body: string; hasFrontmatter: boolean; } export interface FrontmatterBlock { frontmatterText: string; body: string; hasFrontmatter: boolean; } export type FrontmatterRoundTripIssueKind = "anchor" | "alias" | "comment" | "quoted_key" | "tag"; export interface FrontmatterRoundTripIssue { kind: FrontmatterRoundTripIssueKind; line: number; column: number; message: string; } export declare const skillFrontmatterSchema: z.ZodObject<{ name: z.ZodString; description: z.ZodString; "allowed-tools": z.ZodOptional>; metadata: z.ZodOptional>>>; }, z.core.$loose>; export declare const skillFrontmatterKnownKeys: readonly ["name", "description", "allowed-tools", "metadata"]; export declare function isPlainRecord(value: unknown): value is Record; export declare function asString(value: unknown): string | null; export declare function asBoolean(value: unknown): boolean | null; export declare function asStringArray(value: unknown): string[] | null; export declare function splitFrontmatterBlock(raw: string): FrontmatterBlock; export declare function stringifyFrontmatter(value: Record): string; export declare function getSkillFrontmatterUnknownKeys(value: Record): string[]; export declare function detectFrontmatterRoundTripIssues(rawYaml: string): FrontmatterRoundTripIssue[]; /** * Recombine a split block into a full markdown document. This is the exact * inverse of {@link splitFrontmatterBlock}: `join(split(x)) === x` for every * input, so opening a file and saving it untouched is byte-identical. The body * is passed through verbatim — never re-parsed or re-serialized. */ export declare function joinFrontmatterBlock(block: FrontmatterBlock): string; /** * Parse the raw YAML of a frontmatter block (the text between the `---` fences, * as returned by {@link splitFrontmatterBlock}) into a plain object. Lenient: * unparseable input yields `{}` rather than throwing. */ export declare function parseFrontmatterFields(frontmatterText: string): Record; export interface FrontmatterAnalysis { /** The parsed field object (best-effort; `{}` when nothing parses). */ parsed: Record; /** * True when the field editor is safe to use: the raw YAML both parses and * re-serializes byte-for-byte. When false, editing must stay in raw-YAML mode * so bytes the serializer can't reproduce (comments, anchors, folded scalars, * custom ordering, quoting) are never silently rewritten. */ canRoundTrip: boolean; /** Structural features that make the block non-round-trippable, if any. */ issues: FrontmatterRoundTripIssue[]; } /** * Decide whether a frontmatter block can be edited through the structured * field form. Fields mode is only offered when re-serializing the parsed object * reproduces the original block exactly — this is the load-bearing round-trip * safety gate for the Skill Studio FrontmatterPanel (PAP-13145 Option B). */ export declare function analyzeFrontmatterBlock(frontmatterText: string): FrontmatterAnalysis; export declare function parseFrontmatterMarkdown(raw: string): MarkdownDoc; //# sourceMappingURL=frontmatter.d.ts.map