UNPKG

@context-action/llms-generator

Version:

Enterprise-grade LLM content generation framework with mismatch detection and integrity management

275 lines (274 loc) 7.13 kB
//#region src/types/priority.d.ts declare enum ExtractionStrategy { CONCEPT_FIRST = "concept-first", EXAMPLE_FIRST = "example-first", API_FIRST = "api-first", TUTORIAL_FIRST = "tutorial-first", REFERENCE_FIRST = "reference-first", } //#endregion //#region src/types/config.d.ts interface LLMSConfig { paths: { docsDir: string; llmContentDir: string; outputDir: string; templatesDir: string; instructionsDir: string; }; generation: { supportedLanguages: string[]; characterLimits: number[]; defaultLanguage: string; outputFormat: 'txt' | 'md'; }; quality: { minCompletenessThreshold: number; enableValidation: boolean; strictMode: boolean; }; sync?: { enabled: boolean; serverUrl: string; apiKey: string; }; } interface SummaryConfig { maxRetries: number; timeout: number; enableCaching: boolean; cacheDir?: string; } interface GenerationOptions { languages?: string[]; formats?: GenerationFormat[]; characterLimits?: number[]; outputDir?: string; validate?: boolean; } type GenerationFormat = 'minimum' | 'origin' | 'chars'; interface CategoryConfig$1 { name: string; description: string; priority: number; defaultStrategy: ExtractStrategy; tags: string[]; color?: string; icon?: string; } interface TagConfig { name: string; description: string; weight: number; compatibleWith: string[]; audience?: string[]; importance?: 'critical' | 'optional'; frequency?: 'high' | 'low'; urgency?: 'high' | 'medium' | 'low'; } interface DependencyRuleConfig { description: string; weight: number; autoInclude: boolean; maxDepth?: number; strategy?: 'breadth-first' | 'selective' | 'optional' | 'space-permitting'; } interface DependencyConfig { rules: { prerequisite: DependencyRuleConfig; reference: DependencyRuleConfig; followup: DependencyRuleConfig; complement: DependencyRuleConfig; }; conflictResolution: { strategy: 'exclude-conflicts' | 'higher-score-wins' | 'exclude-both' | 'manual-review'; priority: 'higher-score-wins' | 'category-priority' | 'manual-review'; allowPartialConflicts: boolean; }; } interface CompositionStrategyConfig { name: string; description?: string; algorithm?: string; weights?: { categoryWeight: number; tagWeight: number; dependencyWeight: number; priorityWeight: number; contextualWeight?: number; }; criteria?: { categoryWeight: number; tagWeight: number; dependencyWeight: number; priorityWeight: number; contextualWeight?: number; }; constraints?: { minCategoryRepresentation: number; maxDocumentsPerCategory: number; requireCoreTags: boolean; includeDependencyChains?: boolean; preferredTags?: string[]; }; } interface CompositionConfig { strategies: Record<string, CompositionStrategyConfig>; defaultStrategy: string; optimization: { spaceUtilizationTarget: number; qualityThreshold: number; diversityBonus: number; redundancyPenalty: number; }; } interface ExtractionConfig { defaultQualityThreshold: number; autoTagExtraction: boolean; autoDependencyDetection: boolean; strategies: Record<ExtractStrategy, { focusOrder: string[]; }>; } interface ValidationConfig { schema: { enforceTagConsistency: boolean; validateDependencies: boolean; checkCategoryAlignment: boolean; }; quality: { minPriorityScore: number; maxDocumentAge: string; requireMinimumContent: boolean; }; } interface UIConfig { dashboard: { enableTagCloud: boolean; showCategoryStats: boolean; enableDependencyGraph: boolean; }; reporting: { generateCompositionReports: boolean; includeQualityMetrics: boolean; exportFormats: ('json' | 'csv' | 'html')[]; }; } interface EnhancedLLMSConfig extends LLMSConfig { categories: Record<string, CategoryConfig$1>; tags: Record<string, TagConfig>; dependencies: DependencyConfig; composition: CompositionConfig; extraction: ExtractionConfig; validation: ValidationConfig; ui: UIConfig; } type ExtractStrategy = keyof typeof ExtractionStrategy | string; //#endregion //#region src/core/EnhancedConfigManager.d.ts interface ConfigPreset { name: string; description: string; characterLimits: number[]; languages: string[]; categories: Record<string, CategoryConfig$1>; tags: Record<string, TagConfig>; } declare class EnhancedConfigManager { private configPath; private config; constructor(configPath?: string); loadConfig(customPath?: string): Promise<EnhancedLLMSConfig>; saveConfig(config: EnhancedLLMSConfig, customPath?: string): Promise<void>; validateConfig(config: EnhancedLLMSConfig): void; getConfig(): EnhancedLLMSConfig | null; initializeConfig(presetName: string): Promise<EnhancedLLMSConfig>; getConfigPreset(presetName: string): ConfigPreset; private createConfigFromPreset; private enhanceBasicConfig; private getStandardCategories; private getStandardTags; private getCompositionStrategies; private getMinimalCategories; private getMinimalTags; private getExtendedCategories; private getExtendedTags; private getBlogCategories; private getBlogTags; static mergeConfigurations(...configs: Partial<EnhancedLLMSConfig>[]): EnhancedLLMSConfig; } //#endregion //#region src/shared/types/ConfigTypes.d.ts interface PathConfig { docsDir: string; llmContentDir: string; outputDir: string; templatesDir: string; instructionsDir: string; } interface GenerationConfig { supportedLanguages: string[]; characterLimits: number[]; defaultCharacterLimits: { summary: number; detailed: number; comprehensive: number; }; defaultLanguage: string; outputFormat: 'txt'; } interface QualityConfig { minCompletenessThreshold: number; enableValidation: boolean; strictMode: boolean; } interface CategoryConfig { [key: string]: { priority: number; description: string; documentTypes: string[]; }; } interface AppConfig { paths: PathConfig; generation: GenerationConfig; quality: QualityConfig; categories?: CategoryConfig; } //#endregion //#region src/shared/types/index.d.ts interface Result<T, E = Error> { success: boolean; data?: T; error?: E; } interface OperationResult<T = void> extends Result<T> { message?: string; timestamp: Date; } interface Paginated<T> { items: T[]; total: number; page: number; pageSize: number; hasNext: boolean; hasPrevious: boolean; } interface SortOptions { field: string; direction: 'asc' | 'desc'; } interface FilterOptions { [key: string]: unknown; } interface ValidationError { field: string; message: string; code: string; } //#endregion //#region src/shared/config/DefaultConfig.d.ts declare const DEFAULT_CONFIG: AppConfig; //#endregion export { DEFAULT_CONFIG, EnhancedConfigManager, type EnhancedLLMSConfig, type FilterOptions, type GenerationOptions, type LLMSConfig, type OperationResult, type Paginated, type Result, type SortOptions, type SummaryConfig, type UIConfig, type ValidationError }; //# sourceMappingURL=index.d.ts.map