export interface RuleSet {
    language: string;
    rules: string;
}
/**
 * Load rules for a specific language.
 * Checks user rules first, falls back to built-in.
 */
export declare function loadRules(language: string): string | null;
/**
 * Save custom rules for a language.
 */
export declare function saveRules(language: string, rules: string): void;
/**
 * List all available rule sets (built-in + custom).
 */
export declare function listRuleSets(): {
    language: string;
    source: 'builtin' | 'custom';
}[];
/**
 * Auto-detect languages in the project by file extensions.
 * Broad scan — walks the whole cwd. Used as the fallback when targeted
 * detection (query + git diff) finds nothing.
 */
export declare function detectLanguages(cwd: string): string[];
/**
 * Detect languages mentioned in a free-form user message via file-path
 * extensions. Matches paths like `src/foo.ts`, `~/Downloads/bar.py`,
 * `C:\\path\\baz.go`. Ignores bare extensions like ".ts" alone — they're
 * too often false positives (version strings, regex patterns).
 */
export declare function detectLanguagesFromQuery(query: string): string[];
/**
 * Detect languages from files changed in the working tree. Uses
 * `git diff --name-only HEAD` (uncommitted + staged) and falls back to
 * `git status --porcelain` if the diff command fails. Times out fast
 * to never block startup.
 */
export declare function detectLanguagesFromGit(cwd: string): string[];
/**
 * Build rules section for system prompt. Detection prefers TARGETED
 * sources (user query + git diff) over a broad repo scan, so polyglot
 * repos don't have to inject every language's rules on every turn.
 *
 *   priority 1: file paths mentioned in the user's current message
 *   priority 2: files changed in the working tree (git diff)
 *   fallback:   broad recursive scan of cwd (the old behavior)
 *
 * Returns "" if no languages detected at all. Total injected length
 * capped at ~3000 chars to avoid bloat (rules-per-language are usually
 * 500-1500 chars each, so 3-4 languages fit comfortably).
 */
export declare function buildRulesPrompt(cwd: string, userQuery?: string): string;
/**
 * Get detailed coding rules for a specific language.
 * Loads custom rules if available, falls back to comprehensive built-in rules.
 */
export declare function getLanguageRules(language: string): string;
export declare function printRules(): void;
