"use strict";
/**
 * WebSearch Health Checks
 *
 * Check WebSearch providers (real backends + legacy fallback).
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkWebSearchClis = void 0;
const websearch_manager_1 = require("../../utils/websearch-manager");
/**
 * Check WebSearch CLI providers
 */
function checkWebSearchClis() {
    const providers = (0, websearch_manager_1.getWebSearchCliProviders)();
    const checks = [];
    for (const provider of providers) {
        if (provider.enabled && provider.available) {
            checks.push({
                id: `websearch-${provider.id}`,
                name: provider.name,
                status: 'ok',
                message: provider.detail,
                details: provider.description,
            });
        }
        else {
            checks.push({
                id: `websearch-${provider.id}`,
                name: provider.name,
                status: 'info',
                message: provider.enabled ? provider.detail : 'Disabled',
                fix: provider.installCommand,
                details: provider.description,
            });
        }
    }
    // Add summary check if no providers are ready
    if (!(0, websearch_manager_1.hasAnyWebSearchCli)()) {
        checks.push({
            id: 'websearch-summary',
            name: 'WebSearch Status',
            status: 'warning',
            message: 'No ready provider',
            fix: 'Enable DuckDuckGo, configure SearXNG URL, or set EXA_API_KEY/TAVILY_API_KEY/BRAVE_API_KEY',
            details: 'Third-party profiles need a local WebSearch backend.',
        });
    }
    return checks;
}
exports.checkWebSearchClis = checkWebSearchClis;
//# sourceMappingURL=websearch-checks.js.map