import { existsSync, readFileSync } from 'node:fs';
import { join } from 'node:path';
import { ValidateConfigUseCase } from '../../../../modules/cli-configuration/usecases/cli/validateConfig.usecase.js';
export class ValidationAdapterGateway {
    deps;
    constructor(deps) {
        this.deps = deps;
    }
    validate(projectPath) {
        const useCase = new ValidateConfigUseCase({ existsSync, readFileSync });
        const projectConfigPath = join(projectPath, '.claude', 'reviews', 'config.json');
        const cliConfigPath = existsSync(projectConfigPath) ? projectConfigPath : this.deps.configPath;
        const result = useCase.execute({ configPath: cliConfigPath, envPath: this.deps.envPath });
        return {
            status: result.status,
            issues: result.issues.map((issue) => ({
                field: issue.field,
                message: issue.message,
                severity: issue.severity,
            })),
        };
    }
}
//# sourceMappingURL=validation.adapter.gateway.js.map