/** * Drift Scanner * * Detects state drift where actual codebase diverges from governance patterns. * Scans file content against anti-pattern rules defined in blessed patterns. * * Extracted from Charter Cloud (ADR-001). * * Note: In the Cloud version, patterns are fetched from D1. In the Kit version, * patterns are provided directly (loaded from .charter/patterns/ by the CLI). */ import type { Pattern, DriftReport } from '@stackbilt/types'; /** * Scan files for governance violations (drift) against provided patterns. * * @param files - Map of filename to file content * @param patterns - Active blessed-stack patterns to check against * @returns Drift report with score and violations */ export declare function scanForDrift(files: Record, patterns: Pattern[]): DriftReport; /** * Extract template literal bodies from a source file. * * For .ts, .tsx, .js, and .mjs files, finds all backtick template literal * bodies and returns them as a map of virtual filenames to extracted content. * Virtual filenames have the format: `filename[template:N]` * * Handles nested backticks conservatively via non-greedy matching. * Short template literals (≤20 chars) are skipped as trivially uninteresting. * * @param content - File content to extract from * @param filename - Filename used to determine extension and virtual names * @returns Map of virtual filename → extracted template body */ export declare function extractTemplateLiterals(content: string, filename: string): Record; /** * Extract testable regexes from anti-pattern text. * * Supports: * - Regex literals: /pattern/flags * - Code tokens: `keyword` */ export declare function extractRules(antiPatternText: string): RegExp[]; //# sourceMappingURL=index.d.ts.map