UNPKG

doctool

Version:

AI-powered documentation validation and management system

64 lines (63 loc) 2.21 kB
import { GitChanges } from './gitUtils.js'; interface DirectoryAnalysis { name: string; path: string; files: string[]; subdirectories: string[]; codeFiles: string[]; currentKnowledgeContent?: string; projectContext?: string; } interface AIProvider { name: string; generateContent(prompt: string): Promise<string>; } /** * Analyzes a directory and gathers information needed for content generation */ export declare function analyzeDirectoryForContent(dirPath: string): DirectoryAnalysis; /** * Reads code files from a directory for analysis */ export declare function getCodeContent(dirPath: string, codeFiles: string[]): Record<string, string>; /** * Creates a prompt for AI content generation */ export declare function createContentGenerationPrompt(analysis: DirectoryAnalysis, codeContent: Record<string, string>): string; /** * Generates enhanced knowledge file content for a directory using AI */ export declare function generateKnowledgeContent(dirPath: string, provider?: AIProvider): Promise<string | null>; /** * Updates a knowledge file with new content */ export declare function updateKnowledgeFile(dirPath: string, content: string): boolean; /** * Checks if a knowledge file needs AI enhancement (contains template placeholders) */ export declare function needsAIEnhancement(knowledgeContent: string): boolean; /** * Analyzes if a knowledge file needs updating based on changes */ interface UpdateAnalysis { filePath: string; needsUpdate: boolean; lastUpdate: Date | null; relevantChanges: GitChanges; updateReason: string; } export declare function analyzeKnowledgeFileForUpdates(filePath: string, basePath: string): Promise<UpdateAnalysis>; /** * Updates knowledge files using targeted issue-driven fixes */ export declare function updateKnowledgeFilesWithAI(basePath?: string, options?: { interactive?: boolean; dryRun?: boolean; severityThreshold?: 'low' | 'medium' | 'high'; verbose?: boolean; }): Promise<void>; /** * Main function to enhance all knowledge files in a project with AI-generated content */ export declare function enhanceKnowledgeFiles(basePath?: string): Promise<void>; export {};