/** * vigiles — YAML frontmatter rule mode. * * Parses a `vigiles.enforce` block out of a markdown file's YAML * frontmatter, so a project can declare enforce rules in structured YAML * instead of `` inline HTML comments or a typed * `.spec.ts`. Every frontmatter rule goes through the same `checkLinterRule` * verification as inline and spec rules. * * Shape (verbose — chosen so a JSON Schema can give `rule` an enum that * YAML LSP autocompletes and squiggles on typo): * * --- * # yaml-language-server: $schema=./.vigiles/schema.json * vigiles: * enforce: * - rule: "@typescript-eslint/no-explicit-any" * why: "Use unknown" * --- * * Like inline mode, only `enforce` is supported — the prose body of the * file is the guidance. Malformed YAML is reported, never thrown: a broken * frontmatter block produces an error finding, not a crash. */ export interface FrontmatterRule { /** Linter rule reference, e.g. "eslint/no-console". */ linterRule: string; /** Why this rule is enforced (human-readable, shown in agent context). */ why: string; /** 1-based line number of the rule in the source file (best-effort). */ line: number; } /** A `vigiles.files` entry (verified to exist). */ export interface FrontmatterFileRef { /** Project-relative path to verify exists. */ path: string; /** 1-based line number of the entry in the source file (best-effort). */ line: number; } /** A `vigiles.commands` entry (npm scripts verified against package.json). */ export interface FrontmatterCmdRef { /** Command to verify. */ command: string; /** 1-based line number of the entry in the source file (best-effort). */ line: number; } export interface FrontmatterParseResult { rules: FrontmatterRule[]; files: FrontmatterFileRef[]; commands: FrontmatterCmdRef[]; /** Frontmatter that looks like a vigiles block but failed to parse. */ errors: { line: number; message: string; }[]; } /** * Parse `vigiles.enforce` rules, `vigiles.files`, and `vigiles.commands` out * of a markdown file's YAML frontmatter. Does not touch the filesystem and * does not verify references — callers feed rules into `checkLinterRule` and * file/command refs into `validateFileRef` / `validateCommandRef`. * * A file with no frontmatter, or frontmatter with no `vigiles` key, yields * empty results with no errors. Malformed YAML or a malformed `vigiles` * block yields error findings (never throws). */ export declare function parseFrontmatterRules(content: string): FrontmatterParseResult; /** * True if the content has at least one parseable `vigiles` reference in its * frontmatter — an `enforce` rule, a `files` entry, or a `commands` entry. A * utility for detecting frontmatter (Level-1) mode, mirroring `hasInlineRules`. * (Note `require-instructions-spec` is narrow — only a `.spec.ts` satisfies it — * so this no longer feeds that rule.) */ export declare function hasFrontmatterRules(content: string): boolean; //# sourceMappingURL=frontmatter.d.ts.map