/**
 * DiGraphValidationDiagnostic
 *
 * Walks a curated set of critical DI tokens and verifies each one is
 * registered in the container. Catches the common "I added a port but
 * forgot to wire it in `register-services.ts`" failure mode early — a
 * green doctor here means the rest of Shep can at least bootstrap.
 *
 * Receives a `tokenChecker` so the application layer never imports the
 * tsyringe container directly; the runner injects a closure that reads
 * the global container in infrastructure.
 */
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { injectable } from 'tsyringe';
import { DiagnosticStatus } from '../../../../domain/generated/output.js';
const REQUIRED_TOKENS = [
    'IFileSystemService',
    'IGitPrService',
    'IGitHubRepositoryService',
    'IAgentAuthDetectorService',
    'IDiagnosticRunner',
    'ISettingsProvider',
    'Database',
];
let DiGraphValidationDiagnostic = class DiGraphValidationDiagnostic {
    isRegistered;
    tokens;
    name = 'di-graph-validation';
    constructor(isRegistered, tokens = REQUIRED_TOKENS) {
        this.isRegistered = isRegistered;
        this.tokens = tokens;
    }
    async run() {
        const missing = this.tokens.filter((token) => !this.isRegistered(token));
        if (missing.length > 0) {
            return {
                name: this.name,
                status: DiagnosticStatus.Fail,
                detail: `Missing DI registrations: ${missing.join(', ')}`,
                fixHint: 'Wire the missing token(s) in `infrastructure/di/modules/`',
            };
        }
        return {
            name: this.name,
            status: DiagnosticStatus.Ok,
            detail: `All ${this.tokens.length} critical DI tokens are registered`,
        };
    }
};
DiGraphValidationDiagnostic = __decorate([
    injectable(),
    __metadata("design:paramtypes", [Function, Array])
], DiGraphValidationDiagnostic);
export { DiGraphValidationDiagnostic };
