/**
 * Knowledge Service
 *
 * Manages Company Knowledge documents — markdown files with YAML frontmatter
 * stored at global (~/.crewly/docs/) or project ({projectPath}/.crewly/docs/) scope.
 * Provides CRUD operations with a JSON index for fast listing.
 *
 * @module services/knowledge/knowledge.service
 */
import type { KnowledgeDocument, KnowledgeDocumentSummary, KnowledgeScope, CreateKnowledgeDocumentParams, UpdateKnowledgeDocumentParams, KnowledgeDocumentFilters } from '../../types/knowledge.types.js';
/**
 * Knowledge Service singleton.
 *
 * Follows the same singleton + filesystem pattern used by SOPService.
 */
export declare class KnowledgeService {
    private static instance;
    private readonly logger;
    private constructor();
    /**
     * Get the singleton instance.
     *
     * @returns KnowledgeService instance
     */
    static getInstance(): KnowledgeService;
    /**
     * Reset the singleton (for testing).
     */
    static resetInstance(): void;
    /**
     * Resolve the docs directory for a given scope.
     *
     * @param scope - 'global' or 'project'
     * @param projectPath - Required when scope is 'project'
     * @returns Absolute path to the docs directory
     */
    private docsDir;
    /**
     * Resolve the index file path for a given scope.
     *
     * @param scope - 'global' or 'project'
     * @param projectPath - Required when scope is 'project'
     * @returns Absolute path to the index JSON file
     */
    private indexPath;
    /**
     * Resolve the file path for a specific document.
     *
     * @param id - Document identifier
     * @param scope - Document scope
     * @param projectPath - Project path for project-scoped docs
     * @returns Absolute path to the .md file
     */
    private docFilePath;
    /**
     * Ensure the docs directory exists.
     *
     * @param scope - Document scope
     * @param projectPath - Project path for project-scoped docs
     */
    private ensureDocsDir;
    /**
     * Read the knowledge index, returning an empty index if the file doesn't exist.
     *
     * @param scope - Document scope
     * @param projectPath - Project path for project-scoped docs
     * @returns The knowledge index
     */
    private readIndex;
    /**
     * Write the knowledge index atomically.
     *
     * @param scope - Document scope
     * @param projectPath - Project path for project-scoped docs
     * @param index - The index data to write
     */
    private writeIndex;
    /**
     * Parse a knowledge document from its markdown file content.
     *
     * @param raw - Raw file content with YAML frontmatter
     * @param scope - Document scope
     * @param projectPath - Optional project path
     * @returns Parsed KnowledgeDocument or null if parsing fails
     */
    private parseDocumentFile;
    /**
     * Serialize a knowledge document to markdown with YAML frontmatter.
     *
     * @param doc - The document to serialize
     * @returns Markdown string with frontmatter
     */
    private serializeDocument;
    /**
     * Build an index entry from a knowledge document.
     *
     * @param doc - The document
     * @returns Index entry with preview
     */
    private buildIndexEntry;
    /**
     * List all documents for a given scope, optionally filtered.
     *
     * @param scope - 'global' or 'project'
     * @param projectPath - Required when scope is 'project'
     * @param filters - Optional category/search filters
     * @returns Array of document summaries
     */
    listDocuments(scope: KnowledgeScope, projectPath?: string, filters?: KnowledgeDocumentFilters): Promise<KnowledgeDocumentSummary[]>;
    /**
     * Get a single document by ID.
     *
     * @param id - Document identifier
     * @param scope - Document scope
     * @param projectPath - Required when scope is 'project'
     * @returns Full document or null if not found
     */
    getDocument(id: string, scope: KnowledgeScope, projectPath?: string): Promise<KnowledgeDocument | null>;
    /**
     * Create a new knowledge document.
     *
     * @param params - Document creation parameters
     * @returns The generated document ID
     * @throws Error if validation fails
     */
    createDocument(params: CreateKnowledgeDocumentParams): Promise<string>;
    /**
     * Update an existing knowledge document.
     *
     * @param id - Document identifier
     * @param params - Update parameters
     * @throws Error if document not found or validation fails
     */
    updateDocument(id: string, params: UpdateKnowledgeDocumentParams): Promise<void>;
    /**
     * Delete a knowledge document.
     *
     * @param id - Document identifier
     * @param scope - Document scope
     * @param projectPath - Required when scope is 'project'
     * @throws Error if document not found
     */
    deleteDocument(id: string, scope: KnowledgeScope, projectPath?: string): Promise<void>;
    /**
     * List all categories in use for a given scope, merged with defaults.
     *
     * @param scope - Document scope
     * @param projectPath - Required when scope is 'project'
     * @returns Array of category names (defaults + custom in-use)
     */
    listCategories(scope: KnowledgeScope, projectPath?: string): Promise<string[]>;
}
//# sourceMappingURL=knowledge.service.d.ts.map