/**
 * Compiler facade — re-exports from focused modules.
 *
 * Schemas and types:  ./compiler-schema.ts
 * Diff parsing:       ./diff-parser.ts
 * Rule execution:     ./rule-engine.ts
 *
 * This file retains: hashing, regex validation, file I/O, and LLM response parsing.
 */
import type { AstGrepYamlRule, CompiledRule, CompiledRulesFile, CompilerOutput, RegexValidation } from './compiler-schema.js';
export type { AstContext, AstGrepYamlRule, AuthoredFixture, AuthoredProvenanceRecord, CompiledRule, CompiledRulesFile, CompilerOutput, DiffAddition, Legitimacy, MinedProvenanceRecord, NapiConfig, NonCompilableEntry, NonCompilableReasonCode, ProvenanceRecord, RegexValidation, RuleEventCallback, RuleEventContext, Violation, } from './compiler-schema.js';
export { AstGrepYamlRuleSchema, AuthoredFixtureSchema, type AuthoredNegativeFixture, AuthoredNegativeFixtureSchema, AuthoredProvenanceRecordSchema, CompiledRuleSchema, CompiledRulesFileSchema, CompilerOutputSchema, deriveRuleClass, isAuthoredProvenance, isMinedProvenance, LEDGER_RETRY_PENDING_CODES, LegitimacySchema, MinedProvenanceWireSchema, NapiConfigSchema, type NearMissSource, NearMissSourceSchema, NonCompilableEntryReadSchema, NonCompilableEntryWriteSchema, NonCompilableReasonCodeSchema, type PreimageSource, PreimageSourceSchema, provenanceKind, ProvenanceRecordSchema, shouldWriteToLedger, } from './compiler-schema.js';
export { extractAddedLines } from './diff-parser.js';
export { applyAstRulesToAdditions, applyRules, applyRulesToAdditions, type CoreLogger, extractJustification, fileMatchesGlobs, matchesGlob, type RuleEngineContext, } from './rule-engine.js';
/** Hash a lesson's heading + body to detect changes since compilation. */
export declare function hashLesson(heading: string, body: string): string;
/**
 * Validate that a pattern string is a syntactically valid RegExp
 * and is not vulnerable to ReDoS (catastrophic backtracking).
 */
export declare function validateRegex(pattern: string): RegexValidation;
/**
 * Load compiled rules from a JSON file. Returns empty array if file missing.
 *
 * Filters out rules with inert lifecycle status so the lint execution path,
 * rule tester, and every other consumer that enforces rules treats them as
 * silenced (#1336 — "The Archive Lie"). Three inert states qualify:
 *   - `'archived'` — explicitly silenced via curation (#1336).
 *   - `'untested-against-codebase'` — Stage 4 (mmnto-ai/totem#1682) ran
 *     against the consumer's codebase and produced zero matches. The
 *     rule's runtime behavior is unknown; the schema docstring at
 *     `compiler-schema.ts:100-107` commits to inert-like-archived
 *     semantics, and this filter is what enforces that contract.
 *   - `'pending-verification'` — pack rule installed via `totem install`
 *     in the cloud-compile bootstrap path (mmnto-ai/totem#1684). Stage 4
 *     has not yet run on the consumer's codebase. The rule stays inert
 *     until the first-lint promotion interceptor runs the verifier and
 *     replaces the status with one of the three terminal lifecycle
 *     values. The interceptor itself runs BEFORE this filter and reads
 *     from the unfiltered manifest via {@link loadCompiledRulesFile}.
 *
 * Rules without a `status` field (legacy manifests compiled before the
 * lifecycle state was added) are treated as active.
 *
 * Admin and write-path consumers that need to see archived rules (e.g.
 * `totem doctor --pr` lifecycle management, `totem compile` pruning) should
 * use {@link loadCompiledRulesFile} instead, which returns the unfiltered
 * manifest so inert entries remain visible for telemetry and state
 * transitions.
 */
export declare function loadCompiledRules(rulesPath: string, onWarn?: (msg: string) => void): CompiledRule[];
/** Load the full compiled rules file (rules + non-compilable cache). */
export declare function loadCompiledRulesFile(rulesPath: string, onWarn?: (msg: string) => void): CompiledRulesFile;
/** Save compiled rules to a JSON file. */
export declare function saveCompiledRules(rulesPath: string, rules: CompiledRule[]): void;
/**
 * Save the full compiled rules file (rules + non-compilable cache).
 *
 * Every `nonCompilable` entry is validated through the strict Write schema
 * before serialization per the Read/Write schema invariant (lesson
 * 400fed87). If a caller ever passes Read-schema-shaped data back through
 * save, we surface the bug as a `TotemParseError` rather than letting the
 * permissive union silently re-accept legacy shapes on disk.
 */
export declare function saveCompiledRulesFile(rulesPath: string, data: CompiledRulesFile): void;
/**
 * Expand brace patterns, normalize shallow globs, and strip unsupported syntax.
 * e.g., "**\/*.{ts,js}" → ["**\/*.ts", "**\/*.js"]
 * e.g., "*.ts" → "**\/*.ts" (shallow → recursive)
 */
export declare function sanitizeFileGlobs(globs: unknown[]): string[];
/**
 * Build engine-specific fields for a compiled rule.
 *
 * Overloaded so only the `'ast-grep'` branch accepts a compound
 * `Record<string, unknown>`; `'regex'` and `'ast'` are string-only.
 * This prevents callers from passing a compound object to the regex
 * engine and silently producing `"[object Object]"` via `String(pattern)`.
 */
export declare function engineFields(engine: 'regex' | 'ast', pattern: string): {
    pattern: string;
    astQuery?: string;
};
export declare function engineFields(engine: 'ast-grep', pattern: string | Record<string, unknown>): {
    pattern: string;
    astGrepPattern?: string;
    astGrepYamlRule?: AstGrepYamlRule;
};
export declare function engineFields(engine: 'regex' | 'ast' | 'ast-grep', pattern: string | Record<string, unknown>): {
    pattern: string;
    astGrepPattern?: string;
    astGrepYamlRule?: AstGrepYamlRule;
    astQuery?: string;
};
export declare function parseCompilerResponse(response: string): CompilerOutput | null;
//# sourceMappingURL=compiler.d.ts.map