/**
 * Instruction Loader — CC claudemd.ts parity (adapted for qlogicagent).
 *
 * Discovers and loads instruction files following CC's load order:
 *   1. User instructions (~/.qlogicagent/INSTRUCTIONS.md)
 *   2. Project instructions (INSTRUCTIONS.md, .qlogicagent/INSTRUCTIONS.md,
 *      .qlogicagent/rules/*.md — walkup from cwd to git root)
 *   3. Local instructions (INSTRUCTIONS.local.md — private, not checked in)
 *
 * Features ported from CC:
 *   - Walkup discovery (cwd → root)
 *   - @include directive support (text files only)
 *   - Frontmatter globs for conditional rules
 *   - HTML comment stripping
 *   - Memoized loading with cache invalidation
 *   - TEXT_FILE_EXTENSIONS whitelist
 *   - MAX_INCLUDE_DEPTH circular reference prevention
 *
 * Reference: claude-code src/utils/claudemd.ts
 */
import type { HookRegistry } from "../../contracts/hooks.js";
export type InstructionType = "User" | "Project" | "Local";
export interface InstructionFileInfo {
    path: string;
    type: InstructionType;
    content: string;
    /** Path of the file that @included this one */
    parent?: string;
    /** Glob patterns from frontmatter — file only applies when target path matches */
    globs?: string[];
}
export interface LiteralResponseRequirement {
    marker: string;
    placement: "prefix" | "suffix" | "include";
}
/**
 * Load all instruction files following CC's discovery order.
 *
 * Discovery order (priority: last loaded = highest):
 *   1. User: ~/.qlogicagent/INSTRUCTIONS.md, ~/.qlogicagent/rules/*.md
 *   2. Project: Walk from git root → cwd, each dir:
 *      - INSTRUCTIONS.md
 *      - .qlogicagent/INSTRUCTIONS.md
 *      - .qlogicagent/rules/*.md (unconditional)
 *   3. Local: INSTRUCTIONS.local.md (per dir, walkup)
 *
 * @param cwd - Starting directory for walkup discovery
 * @param hooks - Optional hook registry for instructions.loaded event
 */
export declare function loadInstructions(cwd: string, hooks?: HookRegistry): Promise<InstructionFileInfo[]>;
/**
 * Build the instructions prompt string from loaded files.
 * CC parity: getClaudeMds()
 */
export declare function buildInstructionsPrompt(files: InstructionFileInfo[]): string;
export declare function extractLiteralResponseRequirements(files: InstructionFileInfo[]): LiteralResponseRequirement[];
export declare function applyLiteralResponseRequirements(content: string, requirements: readonly LiteralResponseRequirement[]): string;
/**
 * Get conditional rules that match a target file path.
 * CC parity: getManagedAndUserConditionalRules() + getMemoryFilesForNestedDirectory()
 */
export declare function getConditionalRules(cwd: string, targetPath: string): Promise<InstructionFileInfo[]>;
/**
 * Load instructions for the current turn.
 * This intentionally reloads from disk every call so instruction edits become
 * visible on the next turn without depending on a filesystem watcher.
 */
export declare function getInstructions(cwd: string, hooks?: HookRegistry): Promise<InstructionFileInfo[]>;
/** Clear the instruction cache. Called after file changes or compaction. */
export declare function resetInstructionCache(): void;
