import type { CommitMessage } from '../../domain/entity/commit-message.entity'; import type { LLMConfiguration } from '../../domain/entity/llm-configuration.entity'; import type { ILlmPromptContext } from './llm-service.interface'; /** * Validation result for a commit message */ export interface ICommitValidationResult { errors?: Array; isValid: boolean; warnings?: Array; } /** * Interface for commit message validators */ export interface ICommitValidator { /** * Attempt to fix a commit message based on validation errors * @param message - The commit message to fix * @param validationResult - The validation result containing errors * @param context - Optional original context (diff, files, etc.) for better fixing * @returns Promise resolving to the fixed commit message or null if unfixable */ fix(message: CommitMessage, validationResult: ICommitValidationResult, context?: ILlmPromptContext): Promise; /** * Attach runtime LLM configuration to validator. * Some validator implementations use this to perform LLM-assisted auto-fixes. * @param configuration - Runtime LLM configuration */ setLLMConfiguration?(configuration: LLMConfiguration): void; /** * Validate a commit message * @param message - The commit message to validate * @returns Promise resolving to the validation result */ validate(message: CommitMessage): Promise; }