UNPKG

@entro314labs/ai-changelog-generator

Version:

AI-powered changelog generator with MCP server support - works with most providers, online and local models

267 lines (266 loc) 11.5 kB
import type { TemplateData } from '../../../types/index.js'; interface WorkingDirectoryChange { category?: string; [key: string]: any; } interface WorkingDirectoryAnalysis { changes: WorkingDirectoryChange[]; analysis?: { summary?: string; } | null; } interface ReleaseInsights { summary: string; totalCommits: number; commitTypes: Record<string, number>; riskLevel: 'low' | 'high'; affectedAreas: string[]; breaking: boolean; complexity: 'low' | 'medium' | 'high'; businessImpact: string; deploymentRequirements: string[]; workingDirectoryChanges?: { count: number; summary: string; }; } export declare class ChangelogService { [key: string]: any; constructor(gitService: any, aiAnalysisService: any, analysisEngine?: any, configManager?: any); getRepositoryCwd(): any; /** * Filter out commits whose message matches the configured ignore pattern * (defaults to WIP commits). Operates on `{hash, message}` objects returned * by the git service. * @param {Array<{hash: string, message: string}>} commits - Raw commit list * @returns {Array<{hash: string, message: string}>} Commits to keep */ filterIgnoredCommits(commits: any): any; classifyCommit(commitAnalysis: any, aiSummary?: Record<string, any> | null): { type: any; breaking: boolean; }; enrichCommitWithAISummary(commitAnalysis: any, options?: Record<string, any>): Promise<any>; enrichCommitAnalysesWithAI(commitAnalyses: any, concurrency?: number, options?: Record<string, any>): Promise<any[]>; /** * Generates a changelog from committed changes (git history) * @param {string} version - Version number for the release * @param {string} since - Generate changelog since this date/commit * @param {Object} options - Additional options (dryRun, etc.) * @returns {Promise<string>} Complete changelog content */ generateChangelog(version?: any, since?: any, options?: Record<string, any>): Promise<{ changelog: string; insights: ReleaseInsights; analyzedCommits: any; workingDirAnalysis: WorkingDirectoryAnalysis | null; } | undefined>; /** * Progress chatter must stay off when the caller asked for silence (library * embedding, VS Code output channel) or when running as an MCP server. */ isSilent(options?: Record<string, any>): boolean; processCommitsSequentially(commitHashes: any, options?: Record<string, any>): Promise<any[]>; generateChangelogBatch(commitHashes: any, options?: Record<string, any>): Promise<any[]>; generateReleaseInsights(analyzedCommits: any, version: any, workingDirAnalysis?: WorkingDirectoryAnalysis | null): Promise<ReleaseInsights>; generateInsightsSummary(insights: any, version: any): string; buildChangelog(analyzedCommits: any, _insights: any, version: any, workingDirAnalysis?: any, options?: Record<string, any>): Promise<string>; /** * Build a structured {@link TemplateData} object from grouped commits and * breaking changes for rendering via the shared template engine. * @param {Record<string, any[]>} groupedCommits - Commits grouped by type * @param {any[]} breakingCommits - Commits flagged as breaking * @param {string|null} version - Release version * @param {string} timestamp - ISO date (YYYY-MM-DD) * @param {Object} linkConfig - { commitUrl, issueUrl, issueRegex, includeAttribution } * @returns {TemplateData} Structured changelog data */ buildTemplateData(groupedCommits: any, breakingCommits: any, version: any, timestamp: any, linkConfig?: Record<string, any>): TemplateData; buildCommitEntry(commit: any, commitUrl: any, issueUrl: any, issueRegex: any): string; buildBreakingChangeEntry(commit: any, commitUrl: any, _issueUrl: any, _issueRegex: any): string; groupCommitsByType(commits: any): Record<string, any>; getTypeHeader(type: any): any; /** * Generates a changelog from working directory changes (uncommitted files) * @param {string} version - Version number for the release * @param {Object} options - Working-dir options: { analysisMode, includeAttribution, format, outputFile, dryRun, silent } * @returns {Promise<string>} Changelog content for working directory changes */ generateChangelogFromChanges(version?: any, options?: Record<string, any>): Promise<{ changelog: any; analysis: { summary: string; categories: {}; stats: { added: number; modified: number; deleted: number; renamed: number; }; languages: {}; totalFiles?: undefined; } | { summary: string; categories: Record<string, any>; stats: { added: number; modified: number; deleted: number; renamed: number; }; totalFiles: any; languages: any[]; }; changes: any[]; } | null>; /** * Builds the working directory changes section for the changelog * @param {Object} workingDirAnalysis - Analysis results from analysis engine * @returns {Promise<string>} Formatted working directory section */ buildWorkingDirectorySection(workingDirAnalysis: any): Promise<string>; generateAIPoweredChangeEntry(change: any): Promise<string>; generateWorkingDirectoryChangeEntry(change: any): string; generateChangeDescription(change: any): string; analyzeNewFileContent(diff: any, path: any): string | null; analyzeMarkdownContent(content: any, filename: any): string; analyzeJavaScriptContent(content: any, filename: any): string; analyzeJsonContent(content: any, filename: any): string; analyzeConfigContent(content: any, filename: any): string; analyzeDirectoryAddition(path: any): string; groupWorkingDirectoryChangesByType(changes: any): { [k: string]: any[]; }; generateGroupedChangeEntry(changeType: any, files: any): Promise<string>; summarizeFileDescriptions(descriptions: any, changeType: any, fileCount: any): string; isArchitecturalChange(path: any, _change: any): any; isConfigurationFile(path: any): any; isTestFile(path: any): any; isDocumentationFile(path: any): any; analyzeModifiedFileChanges(diff: any, path: any): string | null; inferFileContent(path: any, diff: any): "JSON configuration data" | "JavaScript/TypeScript code" | "JavaScript/TypeScript code including functions and classes" | "content" | "documentation and text content" | "image or asset data" | "package configuration and dependencies" | "styling definitions"; extractSpecificChanges(diff: any, path: any): string | null; extractFunctionalityChanges(addedContent: any, removedContent: any, path: any): any[] | null; extractFileDescriptionFromAI(aiSummary: any, change: any): string; analyzeDiffContentForDescription(change: any): string; calculateChangeConfidence(change: any): number; generateDiffSummary(change: any): string | null; analyzeDiffContent(diff: any, filePath: any): string; extractFunctions(content: any): any[]; analyzePackageJsonChanges(added: any, _removed: any): any[]; analyzeImportChanges(added: any, removed: any): any[]; analyzeVariableChanges(added: any, _removed: any): any[]; analyzeErrorHandling(added: any, _removed: any): any[]; buildChangelogFromAnalysis(analysis: any, changes: any, version: any): string; analyzeDeletedFileContent(change: any): string; analyzeDeletedJavaScriptFile(content: any, filePath: any, _category: any): string; analyzeDeletedMarkdownFile(content: any, filePath: any): string; analyzeDeletedJsonFile(content: any, filePath: any): string; detectLanguageFromPath(filePath: any): any; generateMarkdownChangelog(data: any): string; generateJSONChangelog(data: any): string; generatePlainTextChangelog(data: any): string; generateWorkspaceChangelog(version?: any, options?: Record<string, any>): Promise<{ changelog: any; version: any; changes: any[]; processedFiles: any[]; patterns: Record<string, any>; summary: { summary: string; categories: {}; stats: { added: number; modified: number; deleted: number; renamed: number; }; languages: {}; totalFiles?: undefined; } | { summary: string; categories: Record<string, any>; stats: { added: number; modified: number; deleted: number; renamed: number; }; totalFiles: any; languages: any[]; }; filesProcessed: number; filesSkipped: number; } | null>; generateComprehensiveWorkspaceChangelog(options?: Record<string, any>): Promise<{ changelog: any; changes: any[]; processedFiles: any[]; patterns: Record<string, any>; summary: { summary: string; categories: {}; stats: { added: number; modified: number; deleted: number; renamed: number; }; languages: {}; totalFiles?: undefined; } | { summary: string; categories: Record<string, any>; stats: { added: number; modified: number; deleted: number; renamed: number; }; totalFiles: any; languages: any[]; }; filesProcessed: number; filesSkipped: number; } | null>; generateCommitStyleWorkingDirectoryEntries(options?: Record<string, any>): Promise<{ entries: string[]; changes: any[]; summary: { summary: string; categories: {}; stats: { added: number; modified: number; deleted: number; renamed: number; }; languages: {}; totalFiles?: undefined; } | { summary: string; categories: Record<string, any>; stats: { added: number; modified: number; deleted: number; renamed: number; }; totalFiles: any; languages: any[]; }; } | { changes?: undefined; summary?: undefined; entries: any; }>; enhanceChangesWithDiff(changes: any): Promise<any[]>; generateWorkspaceChangelogContent(changes: any, summary: any, _context: any, analysisMode: any, options?: Record<string, any>): Promise<any>; generateAIChangelogContentFromChanges(changes: any, changesSummary: any, analysisMode?: string): Promise<any>; generateBasicChangelogContentFromChanges(changes: any, changesSummary: any): string; buildChangesByCategory(_changes: any, changesSummary: any): string; getCategoryIcon(category: any): any; getStatusIcon(status: any): any; generateContextSection(context: any): string; } export {};