@entro314labs/ai-changelog-generator
Version:
AI-powered changelog generator with MCP server support - works with most providers, online and local models
119 lines (118 loc) • 4.76 kB
TypeScript
export declare class AIAnalysisService {
[key: string]: any;
constructor(aiProvider: any, promptEngine: any, tagger: any, analysisMode?: string, configManager?: any);
generateCompletion(messages: any, options?: Record<string, any>): Promise<any>;
selectOptimalModel(commitAnalysis: any): Promise<any>;
/**
* Resolve the optimal-model tier map (default/medium/complex/...).
*
* Prefers the ConfigurationManager.getOptimalModelConfig() models when a config
* manager is wired in; otherwise derives the tiers from the active provider's
* model configuration so analysis-mode escalation still works standalone.
* @returns {Record<string, any>} Tier->model map
*/
getOptimalModels(): Record<string, any>;
/**
* Pick the higher-priority model between two candidates using the configured
* tier ordering (small < default < medium < complex). Falls back gracefully when
* a candidate is not part of the tier map.
* @param {string | null} a - First candidate model
* @param {string | null} b - Second candidate model
* @param {Record<string, any>} optimalModels - Tier->model map
* @returns {string | null} The higher-tier model name (or whichever is defined)
*/
pickHigherTierModel(a: string | null, b: string | null, optimalModels: Record<string, any>): string | null;
/**
* Resolve a safe, valid default model for the active provider.
*
* Prefers the provider's configured default model, then the optimal-model default
* tier, then the model implied by the current analysis mode.
* @returns {string | null} A model name believed to be valid, or null if none can be determined
*/
getSafeDefaultModel(): string | null;
/**
* Best-effort lookup of the model ids the active provider exposes.
* Normalizes string / { id } / { name } descriptor shapes.
* @returns {Promise<string[]>} Available model identifiers (empty when unknown)
*/
getAvailableModelIds(): Promise<string[]>;
/**
* Validate a resolved model and, if it is unknown/unavailable, warn (naming the
* model + concrete alternatives) and substitute a valid default model. We never
* silently dispatch an unknown model to the provider.
* @param {string} model - The model the selection logic resolved
* @returns {Promise<string>} A model name to actually send to the provider
*/
ensureValidModel(model: string): Promise<string>;
generateAISummary(commitAnalysis: any, preSelectedModel?: any): Promise<{
summary: any;
impact: any;
category: any;
description: any;
technicalDetails: any;
businessValue: any;
riskFactors: any;
recommendations: any;
breakingChanges: boolean;
migrationRequired: boolean;
} | {
summary: string;
category: any;
impact: any;
tags: any;
userFacing: any;
}>;
analyzeChanges(changes: any, type: any, _outputMode?: string): Promise<{
summary: any;
category: string;
impact: string;
userFacing: boolean;
} | {
summary: string;
category: string;
impact: string;
userFacing: any;
}>;
generateRuleBasedSummary(commitAnalysis: any): {
summary: string;
category: any;
impact: any;
tags: any;
userFacing: any;
};
analyzeChangesRuleBased(changes: any, type: any): {
summary: string;
category: string;
impact: string;
userFacing: any;
};
categorizeChanges(changes: any): Record<string, any>;
getFileCategory(filePath: any): "configuration" | "documentation" | "other" | "source" | "tests";
assessImpact(changes: any): "high" | "low" | "medium";
isUserFacing(changes: any): any;
extractCategory(text: any): string;
extractImpact(text: any): string;
extractUserFacing(text: any): boolean;
getBranchesAIAnalysis(branches: any, unmergedCommits: any, danglingCommits: any): Promise<any>;
getRepositoryAIAnalysis(comprehensiveData: any): Promise<any>;
getUntrackedFilesAIAnalysis(categories: any): Promise<any>;
getErrorContext(error: any): {
isConnectionError: boolean;
message: string;
suggestions: string[];
isConfigurationError?: undefined;
} | {
isConfigurationError: boolean;
message: string;
suggestions: string[];
isConnectionError?: undefined;
} | {
isConnectionError: boolean;
isConfigurationError: boolean;
message: any;
suggestions: string[];
};
setModelOverride(model: any): void;
getMetrics(): any;
resetMetrics(): void;
}