/**
 * Wiki Compiler Service
 *
 * Reads Markdown files with YAML frontmatter from the `.crewly/knowledge/`
 * directory and indexes them into the FTS5 full-text search database.
 * Provides reindexing, single-file indexing, and search capabilities.
 *
 * @module services/knowledge/wiki-compiler.service
 */
import { Fts5IndexService, type FtsSearchResult } from './fts5-index.service.js';
/**
 * Parsed frontmatter result containing extracted metadata and the body text.
 */
interface ParsedFrontmatter {
    /** Key-value pairs extracted from YAML frontmatter */
    frontmatter: Record<string, string>;
    /** The markdown body after the frontmatter block */
    body: string;
}
/**
 * Parse YAML frontmatter from a Markdown file content string.
 * Handles simple key: value pairs and bracket-delimited arrays.
 * Does not require an external YAML parsing dependency.
 *
 * @param content - Raw file content including frontmatter
 * @returns Parsed frontmatter object and body text
 */
export declare function parseFrontmatter(content: string): ParsedFrontmatter;
/**
 * WikiCompilerService scans `.md` files in a knowledge directory, parses
 * their YAML frontmatter, and indexes the content into an FTS5 database
 * for fast full-text search.
 *
 * @example
 * ```typescript
 * const compiler = new WikiCompilerService('/Users/me/.crewly/knowledge');
 * const { indexed, errors } = await compiler.reindex();
 * const results = compiler.search('deployment guide');
 * ```
 */
export declare class WikiCompilerService {
    private readonly fts5;
    private readonly knowledgePath;
    private readonly logger;
    /**
     * Create a WikiCompilerService.
     *
     * @param knowledgePath - Directory containing `.md` knowledge files
     */
    constructor(knowledgePath: string);
    /**
     * Get the path to the knowledge directory.
     *
     * @returns The absolute path to the knowledge directory
     */
    getKnowledgePath(): string;
    /**
     * Recursively find all `.md` files under the knowledge directory.
     *
     * @returns Array of absolute file paths
     */
    getMarkdownFiles(): Promise<string[]>;
    /**
     * Scan all `.md` files in the knowledge directory (recursively), parse
     * their frontmatter, and rebuild the FTS5 index from scratch.
     *
     * @returns An object with the count of indexed documents and any errors encountered
     */
    reindex(): Promise<{
        indexed: number;
        errors: string[];
    }>;
    /**
     * Index a single markdown file into the FTS5 database.
     *
     * @param filePath - Absolute path to the markdown file
     */
    indexFile(filePath: string): Promise<void>;
    /**
     * Search the knowledge base using FTS5 full-text search.
     *
     * @param query - The search query string
     * @param options - Optional search parameters (category filter, result limit)
     * @returns Array of matching documents sorted by BM25 relevance
     */
    search(query: string, options?: {
        category?: string;
        limit?: number;
    }): FtsSearchResult[];
    /**
     * Get direct access to the underlying FTS5 index service.
     *
     * @returns The Fts5IndexService instance
     */
    getFts5(): Fts5IndexService;
    /**
     * Close the underlying FTS5 database connection.
     */
    close(): void;
    /**
     * Recursively find all `.md` files under the knowledge directory.
     *
     * @returns Array of absolute file paths
     */
    private globMarkdownFiles;
    /**
     * Read and parse a single markdown file into an FTS5 document shape.
     *
     * @param filePath - Absolute path to the markdown file
     * @returns Parsed document ready for FTS5 indexing
     */
    private parseFile;
}
export {};
//# sourceMappingURL=wiki-compiler.service.d.ts.map