// Planu — Web Fetcher Engine
// Barrel / orchestrator. All implementation lives in web-fetcher/ subdirectory.
import { loadDocsRegistry, findDocsEntry } from './web-fetcher/registry-loader.js';
import { consultDocsImpl } from './web-fetcher/docs-fetcher.js';
import { resolveVersionStatuses, buildVersionsResult } from './web-fetcher/version-checker.js';
import { buildSuggestStackResult } from './web-fetcher/stack-advisor.js';
export { clearCache } from './web-fetcher/cache.js';
export { resetRegistryCache } from './web-fetcher/registry-loader.js';
export async function consultDocs(topic, framework) {
    return consultDocsImpl(topic, framework);
}
export async function checkVersions(dependencies, _includeDevDeps = false, language) {
    if (Object.keys(dependencies).length === 0) {
        return {
            dependencies: [],
            securityAlerts: 0,
            updatesAvailable: 0,
            recommendation: 'No dependencies to check.',
        };
    }
    const depStatuses = await resolveVersionStatuses(dependencies, language);
    return buildVersionsResult(depStatuses);
}
export async function suggestStack(projectType, requirements, constraints = []) {
    return buildSuggestStackResult(projectType, requirements, constraints);
}
export async function getDocsSearchUrl(framework, topic) {
    const registry = await loadDocsRegistry();
    const entry = findDocsEntry(framework, registry);
    if (!entry) {
        return null;
    }
    return entry.search.replace('{topic}', encodeURIComponent(topic));
}
export async function getDocsBaseUrl(framework) {
    const registry = await loadDocsRegistry();
    const entry = findDocsEntry(framework, registry);
    return entry?.base ?? null;
}
//# sourceMappingURL=web-fetcher.js.map