import Handlebars from 'handlebars'; import type { ProjectAnalysis } from '../types/index.js'; /** * Template section identifiers for lazy loading. */ export type TemplateSection = 'header' | 'directives' | 'session-start' | 'coordination' | 'decision-loop' | 'memory-system' | 'worktree' | 'parallel-review' | 'triggers' | 'repository' | 'architecture' | 'components' | 'auth' | 'quick-reference' | 'skills-droids' | 'infrastructure' | 'testing' | 'troubleshooting' | 'config-files' | 'checklist' | 'knowledge' | 'footer'; /** * Section metadata for conditional loading. */ export interface SectionMetadata { id: TemplateSection; file: string; required: boolean; dependencies?: TemplateSection[]; condition?: (analysis: ProjectAnalysis) => boolean; tokenEstimate: number; } /** * Default section definitions. */ export declare const DEFAULT_SECTIONS: SectionMetadata[]; /** * Template loading configuration. */ export interface TemplateLoaderConfig { sectionsDir?: string; maxTokens?: number; includeSections?: TemplateSection[]; excludeSections?: TemplateSection[]; forceInclude?: TemplateSection[]; } /** * Modular template loader with lazy-loading support. */ export declare class TemplateLoader { private sectionsDir; private maxTokens; private sections; private compiledSections; private analysis; constructor(config?: TemplateLoaderConfig); /** * Find the sections directory. */ private findSectionsDir; /** * Register Handlebars helpers. */ private registerHelpers; /** * Set the project analysis for conditional loading. */ setAnalysis(analysis: ProjectAnalysis): void; /** * Check if a section should be included based on conditions. */ private shouldIncludeSection; /** * Get sections that should be included. */ getIncludedSections(): SectionMetadata[]; /** * Estimate total tokens for included sections. */ estimateTotalTokens(): number; /** * Get remaining token budget. */ getRemainingTokenBudget(): number; /** * Load and compile a section template. */ loadSection(sectionId: TemplateSection): Handlebars.TemplateDelegate | null; /** * Load all sections and assemble the full template. */ loadFullTemplate(): string; /** * Check if section files exist. */ private hasSectionFiles; /** * Load the monolithic template as fallback. */ private loadMonolithicTemplate; /** * Compile the full template with context. */ compile(context: Record): string; /** * Get a summary of what will be included. */ getSummary(): { includedSections: string[]; excludedSections: string[]; estimatedTokens: number; withinBudget: boolean; }; } /** * Create section template files from the monolithic template. * This is a one-time migration utility. */ export declare function splitTemplateIntoSections(templatePath: string, outputDir: string): Promise; //# sourceMappingURL=template-loader.d.ts.map