/**
 * Template Loader Service
 *
 * Loads and processes continuation prompt templates with variable
 * substitution, conditionals, and loop support.
 *
 * @module services/continuation/template-loader.service
 */
/**
 * Template metadata from frontmatter
 */
export interface TemplateMetadata {
    /** Template name */
    name: string;
    /** Template description */
    description: string;
    /** List of required variables */
    variables: string[];
}
/**
 * Parsed template with metadata and content
 */
export interface ParsedTemplate {
    /** Template metadata from frontmatter */
    metadata: TemplateMetadata;
    /** Template content (without frontmatter) */
    content: string;
}
/**
 * Interface for template loading and processing
 */
export interface ITemplateLoader {
    /**
     * Load a template by name
     *
     * @param name - Template name (without .md extension)
     * @returns Template content
     */
    loadTemplate(name: string): Promise<string>;
    /**
     * Load and parse a template with metadata
     *
     * @param name - Template name
     * @returns Parsed template with metadata
     */
    loadParsedTemplate(name: string): Promise<ParsedTemplate>;
    /**
     * Substitute variables in a template
     *
     * @param template - Template content
     * @param variables - Variables to substitute
     * @returns Processed template
     */
    substituteVariables(template: string, variables: Record<string, unknown>): string;
    /**
     * Clear the template cache
     */
    clearCache(): void;
}
/**
 * Service for loading and processing continuation prompt templates
 *
 * Features:
 * - Load templates from config directory
 * - Parse YAML frontmatter for metadata
 * - Variable substitution with {{VAR_NAME}} syntax
 * - Conditional blocks with {{#if VAR}}...{{/if}}
 * - Template caching for performance
 *
 * @example
 * ```typescript
 * const loader = TemplateLoader.getInstance();
 *
 * const template = await loader.loadTemplate('continue-work');
 * const prompt = loader.substituteVariables(template, {
 *   CURRENT_TASK: 'Fix authentication bug',
 *   ITERATIONS: 3,
 *   MAX_ITERATIONS: 10,
 * });
 * ```
 */
export declare class TemplateLoader implements ITemplateLoader {
    private static instance;
    private readonly logger;
    private readonly templateDir;
    private readonly cache;
    /**
     * Creates a new TemplateLoader
     *
     * @param templateDir - Optional custom template directory
     */
    private constructor();
    /**
     * Gets the singleton instance
     *
     * @returns The TemplateLoader instance
     */
    static getInstance(): TemplateLoader;
    /**
     * Clears the singleton instance (for testing)
     */
    static clearInstance(): void;
    /**
     * Create an instance with a custom template directory (for testing)
     *
     * @param templateDir - Custom template directory
     * @returns TemplateLoader instance
     */
    static createWithDir(templateDir: string): TemplateLoader;
    /**
     * Load a template by name
     *
     * @param name - Template name (without .md extension)
     * @returns Template content (without frontmatter)
     */
    loadTemplate(name: string): Promise<string>;
    /**
     * Load and parse a template with metadata
     *
     * @param name - Template name
     * @returns Parsed template with metadata
     */
    loadParsedTemplate(name: string): Promise<ParsedTemplate>;
    /**
     * Parse template content and extract frontmatter
     *
     * @param content - Raw template content
     * @param name - Template name (used as fallback)
     * @returns Parsed template
     */
    private parseTemplate;
    /**
     * Parse YAML-like frontmatter
     *
     * @param frontmatter - Frontmatter string
     * @param defaultName - Default name if not specified
     * @returns Template metadata
     */
    private parseFrontmatter;
    /**
     * Substitute variables in a template
     *
     * @param template - Template content
     * @param variables - Variables to substitute
     * @returns Processed template
     */
    substituteVariables(template: string, variables: Record<string, unknown>): string;
    /**
     * Substitute simple {{VAR_NAME}} variables
     *
     * @param template - Template content
     * @param variables - Variables to substitute
     * @returns Template with variables substituted
     */
    private substituteSimpleVariables;
    /**
     * Process conditional blocks: {{#if VAR}}...{{/if}}
     *
     * @param template - Template content
     * @param variables - Variables for conditions
     * @returns Template with conditionals processed
     */
    private processConditionals;
    /**
     * Check if a value is truthy for conditionals
     *
     * @param value - Value to check
     * @returns True if truthy
     */
    private isTruthy;
    /**
     * Format a value for substitution
     *
     * @param value - Value to format
     * @returns Formatted string
     */
    private formatValue;
    /**
     * Clear the template cache
     */
    clearCache(): void;
    /**
     * Check if a template exists
     *
     * @param name - Template name
     * @returns True if exists
     */
    templateExists(name: string): Promise<boolean>;
    /**
     * List all available templates
     *
     * @returns Array of template names
     */
    listTemplates(): Promise<string[]>;
}
//# sourceMappingURL=template-loader.service.d.ts.map