import { type ConfigSet } from "./config-schema.js"; import type { ParsedRule, ValidationError, ValidationResult, ReadResult, FileResult, ValidatePathsResult, RulesConfig, VigilesConfig, HarnessDeclaration, MarkerType, ParseOptions, ValidateOptions, ValidatePathsOptions, ReadOptions } from "./types.js"; export type { ParsedRule, ValidationError, ValidationResult, ReadResult, FileResult, ValidatePathsResult, RulesConfig, VigilesConfig, HarnessDeclaration, MarkerType, ParseOptions, ValidateOptions, ValidatePathsOptions, ReadOptions, }; /** * The defaults with `presets` applied — an empty file extended on the CLI. * There is no rule-set-free default here: what every rule defaults to is * declared by the rule, and the set arrives as `set` from the root. */ export declare function configDefaults(set: ConfigSet, presets?: readonly string[]): C; export declare function findInstructionFiles(cwd: string, configFiles?: string[]): string[]; /** * Read and VALIDATE `.vigilesrc.json`. * * 🔴 `searchFrom` IS NOT A CONVENIENCE. cosmiconfig defaults to the process's * working directory and walks up — right for a CLI verb, where the user is * standing in the project they mean, and wrong for a hook, whose process has no * stable cwd. A hook rail that omits it reads a DIFFERENT project's config, or * none, and the failure runs the wrong way: a missing file means defaults, so a * rule the author switched OFF comes back on, silently, because the file saying * "off" was never found. Nothing in the output distinguishes that from a project * that never configured the rule. * * 🔴 `onInvalid` IS THE ONE PLACE THE CALL SITES DIFFER, AND IT IS NOT A SPLIT * IN WHAT IS CHECKED. Every reader validates; they disagree only about what a * bad config is allowed to do to them. A VERB is a human standing at a prompt * having just edited the file — `"throw"`, so the line they typed is refused out * loud. A HOOK RAIL is a fresh process inside somebody's editing session, and a * hook that dies on a malformed config turns a typo in a JSON file into a failed * edit, which is a worse outcome than the nudge not firing — `"warn"`, print the * same lines to stderr and carry on with the defaults. * * The two hook rails are `refsHookCommand` and `evalLockNudgeHookCommand` * (`vigiles hook-runtime refs` / `eval-lock-nudge`, both registered as * PostToolUse `Edit|Write` in `.claude-plugin/plugin.json`). Every other reader * is a verb. * * ⚠️ THE SCHEMA MODULE IS REQUIRED IN-BODY, and that is hygiene rather than an * optimization worth a paragraph: Zod is a ~45 ms cold import, `tsc` emits * CommonJS across 230 separate files, so a `require` in a function body genuinely * does not execute until the function is called. A rail that never reads a * config never pays for the validator. */ export declare function loadConfig( /** The config for the rule set the root hands in (`configFor`). */ set: ConfigSet, searchFrom?: string, { onInvalid, presets, }?: Readonly<{ onInvalid?: "throw" | "warn"; /** Presets applied on top of the file's own (`--preset=`), see * `ConfigSet.parse`. Applied to the defaults too, so they work in a repo * with no `.vigilesrc.json` at all. */ presets?: readonly string[]; }>): C; export declare function parseRules(content: string, { ruleMarkers }?: ParseOptions): ParsedRule[]; export declare function validate(content: string, { ruleMarkers, rules: rulesConfig, filePath, dialect }?: ValidateOptions): ValidationResult; export declare function readInstructionFile(filePath: string, options?: ReadOptions): ReadResult; export declare function validatePaths(paths: string[], { followSymlinks, ruleMarkers, rules: rulesConfig, }?: ValidatePathsOptions): ValidatePathsResult; //# sourceMappingURL=validate.d.ts.map