@entro314labs/ai-changelog-generator
Version:
AI-powered changelog generator with MCP server support - works with most providers, online and local models
225 lines (224 loc) • 8.64 kB
TypeScript
export declare class ChangelogOrchestrator {
[key: string]: any;
constructor(configManager: any, options?: Record<string, any>);
_getCachedImport(moduleName: any): Promise<any>;
ensureInitialized(): Promise<void>;
initializeServices(): Promise<void>;
createPromptEngine(): Promise<{
systemPrompts: {
master: string;
standard: string;
detailed: string;
enterprise: string;
changesAnalysis: string;
};
optimizeForProvider(prompt: any, providerName: any, _capabilities?: Record<string, any>): any;
buildRepositoryHealthPrompt(healthData: any, _analysisMode: any): string;
}>;
generateChangelog(version: any, since: any, extraOptions?: Record<string, any>): Promise<any>;
/**
* Generate a changelog for an explicit tag/ref range (C-12).
*
* The range is fetched through gitService.getCommitsBetween, which validates
* both refs (throwing "Unknown git ref: <ref>") so a typo'd or non-version tag
* surfaces a clear error instead of the misrouted/silently-empty range produced
* by the getCommitsSince date heuristic. The analyzed commits are then run
* through the same changelog-service building blocks used by the default flow
* (processCommitsSequentially/generateChangelogBatch -> generateReleaseInsights
* -> buildChangelog) so the output shape matches.
*
* @param {string} version - Release version label
* @param {string} fromRef - Exclusive lower bound (validated)
* @param {string} toRef - Inclusive upper bound (validated, default HEAD)
* @param {Record<string, any>} options - { author, format, outputFile, dryRun, silent, analysisMode, includeAttribution, template }
*/
generateChangelogForTagRange(version: any, fromRef: any, toRef?: string, options?: Record<string, any>): Promise<{
changelog: any;
insights: any;
analyzedCommits: any;
workingDirAnalysis: null;
} | null>;
analyzeRepository(options?: Record<string, any>): Promise<any>;
runInteractive(): Promise<{
interactive: boolean;
status: string;
}>;
handleInteractiveAction(action: any): Promise<void>;
handleRecentChangelogGeneration(): Promise<void>;
handleSpecificChangelogGeneration(): Promise<void>;
handleCommitMessageGeneration(): Promise<void>;
handleProviderConfiguration(): Promise<void>;
generateChangelogFromChanges(version: any, options?: Record<string, any>): Promise<any>;
updateMetrics(result: any): void;
displayResults(result: any, _version: any): void;
getComplexityColor(complexity: any): any;
getRiskColor(risk: any): any;
displayAnalysisResults(result: any, type: any): void;
displayMetrics(): void;
formatDuration(ms: any): string;
setAnalysisMode(mode: any): void;
setModelOverride(model: any): void;
getMetrics(): any;
resetMetrics(): void;
/**
* Resolve the working directory the commit workflow should operate in.
* Honors an explicitly configured repository path instead of always assuming
* process.cwd(), so the workflow targets the same repo the rest of the
* orchestrator (and GitManager) is configured for.
*/
getWorkflowCwd(): any;
/**
* Open the commit message in the user's editor for review/editing.
* Writes the message to a temp file, launches $GIT_EDITOR/$EDITOR (falling back
* to a sensible default), then rereads the file. Lines starting with `#` are
* treated as comments (git convention) and stripped.
*/
openCommitMessageInEditor(initialMessage: any): Promise<string>;
executeCommitWorkflow(options?: Record<string, any>): Promise<{
error?: undefined;
success: boolean;
message: string;
wouldStage?: undefined;
valid?: undefined;
dryRun?: undefined;
aborted?: undefined;
reason?: undefined;
validation?: undefined;
commitHash?: undefined;
commitMessage?: undefined;
stagedFiles?: undefined;
filesStaged?: undefined;
rolledBack?: undefined;
} | {
error?: undefined;
message?: undefined;
success: boolean;
commitMessage: any;
stagedFiles: number;
wouldStage: any[];
valid: any;
dryRun: boolean;
aborted?: undefined;
reason?: undefined;
validation?: undefined;
commitHash?: undefined;
filesStaged?: undefined;
rolledBack?: undefined;
} | {
error?: undefined;
wouldStage?: undefined;
valid?: undefined;
dryRun?: undefined;
success: boolean;
message: string;
commitMessage: any;
aborted?: undefined;
reason?: undefined;
validation?: undefined;
commitHash?: undefined;
stagedFiles?: undefined;
filesStaged?: undefined;
rolledBack?: undefined;
} | {
message?: undefined;
wouldStage?: undefined;
valid?: undefined;
dryRun?: undefined;
success: boolean;
error: any;
commitMessage: any;
filesStaged: boolean;
aborted?: undefined;
reason?: undefined;
validation?: undefined;
commitHash?: undefined;
stagedFiles?: undefined;
rolledBack?: undefined;
} | {
error?: undefined;
message?: undefined;
wouldStage?: undefined;
valid?: undefined;
dryRun?: undefined;
success: boolean;
aborted: boolean;
reason: string;
commitMessage: any;
validation: any;
commitHash?: undefined;
stagedFiles?: undefined;
filesStaged?: undefined;
rolledBack?: undefined;
} | {
error?: undefined;
message?: undefined;
wouldStage?: undefined;
valid?: undefined;
dryRun?: undefined;
aborted?: undefined;
reason?: undefined;
validation?: undefined;
success: boolean;
commitHash: any;
commitMessage: any;
stagedFiles: any;
filesStaged?: undefined;
rolledBack?: undefined;
} | {
message?: undefined;
wouldStage?: undefined;
valid?: undefined;
dryRun?: undefined;
aborted?: undefined;
reason?: undefined;
validation?: undefined;
commitHash?: undefined;
success: boolean;
error: any;
commitMessage: any;
stagedFiles: any;
filesStaged: boolean;
rolledBack: boolean;
}>;
/**
* Record the current index as a tree object (`git write-tree`) so it can be
* restored verbatim later. Returns the tree SHA, or null when the index
* cannot be snapshotted — most commonly during an unresolved merge, where
* write-tree refuses to build a tree from conflicted entries.
*
* Callers must treat null as "rollback unavailable" and leave the index alone
* rather than falling back to a lossy path-based reset.
*/
captureIndexSnapshot(gitExecOptions?: Record<string, any>): Promise<any>;
/**
* Restore the index to a previously captured tree (`git read-tree`), undoing
* every staging change this run made while leaving the working tree — and any
* hunks the user had staged before the run — exactly as they were.
* Returns true when the index was restored.
*/
restoreIndexSnapshot(treeSha: any, gitExecOptions?: Record<string, any>): Promise<boolean>;
/**
* Generate AI-powered commit message using branch intelligence and file changes
*/
generateAICommitMessage(branchAnalysis: any, suggestedType: any, stagedFiles: any): Promise<any>;
/**
* Generate branch-aware commit message using rules and branch intelligence (fallback)
*/
generateBranchAwareCommitMessage(branchAnalysis: any, suggestedType: any, stagedFiles: any): string;
/**
* Handle interactive commit message improvement
*/
handleCommitMessageImprovement(originalMessage: any, validationResult: any, context: any): Promise<any>;
/**
* Generate AI-powered commit message suggestions
*/
generateAICommitSuggestions(originalMessage: any, context: any, validationResult: any): Promise<any>;
/**
* Handle manual commit message editing
*/
handleManualCommitEdit(originalMessage: any, validationResult: any): Promise<any>;
/**
* Parse AI-generated commit suggestions
*/
parseAICommitSuggestions(content: any): any[];
}