"use strict";
/**
 * WebSearch Manager - Manages CCS WebSearch runtime
 *
 * WebSearch is a server-side tool executed by Anthropic's API.
 * Third-party providers (gemini, agy, codex, qwen) don't have access.
 * CCS exposes a first-class local WebSearch tool for those profiles and keeps
 * the legacy hook runtime only as a compatibility fallback.
 *
 * Runtime Architecture:
 *   - User-scope MCP server in ~/.claude.json for third-party profiles
 *   - Real search providers first (Exa, Tavily, Brave Search, DuckDuckGo)
 *   - Gemini/OpenCode/Grok retained as optional legacy fallback
 *
 * @module utils/websearch-manager
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ensureMcpWebSearch = exports.clearAllCliCaches = exports.ensureProfileHooksOrThrow = exports.ensureProfileHooks = exports.displayWebSearchStatus = exports.getWebSearchReadiness = exports.getCliInstallHints = exports.hasAnyWebSearchCli = exports.getWebSearchCliProviders = exports.readWebSearchTraceRecords = exports.isWebSearchTraceEnabled = exports.createWebSearchTraceContext = exports.appendWebSearchTrace = exports.appendThirdPartyWebSearchToolArgs = exports.ensureWebSearchMcpOrThrow = exports.syncWebSearchMcpToConfigDir = exports.uninstallWebSearchMcp = exports.removeWebSearchMcpConfig = exports.uninstallWebSearchMcpServer = exports.ensureWebSearchMcp = exports.ensureWebSearchMcpConfig = exports.installWebSearchMcpServer = exports.getWebSearchMcpServerPath = exports.getWebSearchMcpServerName = exports.getWebSearchHookEnv = exports.uninstallWebSearchHook = exports.removeMigrationMarker = exports.installWebSearchHook = exports.getWebSearchHookConfig = exports.hasWebSearchHook = exports.getHookPath = exports.clearOpenCodeCliCache = exports.hasOpenCodeCli = exports.getOpenCodeCliStatus = exports.clearGrokCliCache = exports.hasGrokCli = exports.getGrokCliStatus = exports.clearGeminiCliCache = exports.isGeminiAuthenticated = exports.hasGeminiCli = exports.getGeminiCliStatus = void 0;
// Re-export CLI detection functions
var gemini_cli_1 = require("./websearch/gemini-cli");
Object.defineProperty(exports, "getGeminiCliStatus", { enumerable: true, get: function () { return gemini_cli_1.getGeminiCliStatus; } });
Object.defineProperty(exports, "hasGeminiCli", { enumerable: true, get: function () { return gemini_cli_1.hasGeminiCli; } });
Object.defineProperty(exports, "isGeminiAuthenticated", { enumerable: true, get: function () { return gemini_cli_1.isGeminiAuthenticated; } });
Object.defineProperty(exports, "clearGeminiCliCache", { enumerable: true, get: function () { return gemini_cli_1.clearGeminiCliCache; } });
var grok_cli_1 = require("./websearch/grok-cli");
Object.defineProperty(exports, "getGrokCliStatus", { enumerable: true, get: function () { return grok_cli_1.getGrokCliStatus; } });
Object.defineProperty(exports, "hasGrokCli", { enumerable: true, get: function () { return grok_cli_1.hasGrokCli; } });
Object.defineProperty(exports, "clearGrokCliCache", { enumerable: true, get: function () { return grok_cli_1.clearGrokCliCache; } });
var opencode_cli_1 = require("./websearch/opencode-cli");
Object.defineProperty(exports, "getOpenCodeCliStatus", { enumerable: true, get: function () { return opencode_cli_1.getOpenCodeCliStatus; } });
Object.defineProperty(exports, "hasOpenCodeCli", { enumerable: true, get: function () { return opencode_cli_1.hasOpenCodeCli; } });
Object.defineProperty(exports, "clearOpenCodeCliCache", { enumerable: true, get: function () { return opencode_cli_1.clearOpenCodeCliCache; } });
// Re-export hook management functions
var hook_installer_1 = require("./websearch/hook-installer");
Object.defineProperty(exports, "getHookPath", { enumerable: true, get: function () { return hook_installer_1.getHookPath; } });
Object.defineProperty(exports, "hasWebSearchHook", { enumerable: true, get: function () { return hook_installer_1.hasWebSearchHook; } });
Object.defineProperty(exports, "getWebSearchHookConfig", { enumerable: true, get: function () { return hook_installer_1.getWebSearchHookConfig; } });
Object.defineProperty(exports, "installWebSearchHook", { enumerable: true, get: function () { return hook_installer_1.installWebSearchHook; } });
Object.defineProperty(exports, "removeMigrationMarker", { enumerable: true, get: function () { return hook_installer_1.removeMigrationMarker; } });
Object.defineProperty(exports, "uninstallWebSearchHook", { enumerable: true, get: function () { return hook_installer_1.uninstallWebSearchHook; } });
// Re-export hook environment
var hook_env_1 = require("./websearch/hook-env");
Object.defineProperty(exports, "getWebSearchHookEnv", { enumerable: true, get: function () { return hook_env_1.getWebSearchHookEnv; } });
// Re-export MCP runtime helpers
var mcp_installer_1 = require("./websearch/mcp-installer");
Object.defineProperty(exports, "getWebSearchMcpServerName", { enumerable: true, get: function () { return mcp_installer_1.getWebSearchMcpServerName; } });
Object.defineProperty(exports, "getWebSearchMcpServerPath", { enumerable: true, get: function () { return mcp_installer_1.getWebSearchMcpServerPath; } });
Object.defineProperty(exports, "installWebSearchMcpServer", { enumerable: true, get: function () { return mcp_installer_1.installWebSearchMcpServer; } });
Object.defineProperty(exports, "ensureWebSearchMcpConfig", { enumerable: true, get: function () { return mcp_installer_1.ensureWebSearchMcpConfig; } });
Object.defineProperty(exports, "ensureWebSearchMcp", { enumerable: true, get: function () { return mcp_installer_1.ensureWebSearchMcp; } });
Object.defineProperty(exports, "uninstallWebSearchMcpServer", { enumerable: true, get: function () { return mcp_installer_1.uninstallWebSearchMcpServer; } });
Object.defineProperty(exports, "removeWebSearchMcpConfig", { enumerable: true, get: function () { return mcp_installer_1.removeWebSearchMcpConfig; } });
Object.defineProperty(exports, "uninstallWebSearchMcp", { enumerable: true, get: function () { return mcp_installer_1.uninstallWebSearchMcp; } });
Object.defineProperty(exports, "syncWebSearchMcpToConfigDir", { enumerable: true, get: function () { return mcp_installer_1.syncWebSearchMcpToConfigDir; } });
Object.defineProperty(exports, "ensureWebSearchMcpOrThrow", { enumerable: true, get: function () { return mcp_installer_1.ensureWebSearchMcpOrThrow; } });
// Re-export Claude launch arg helpers
var claude_tool_args_1 = require("./websearch/claude-tool-args");
Object.defineProperty(exports, "appendThirdPartyWebSearchToolArgs", { enumerable: true, get: function () { return claude_tool_args_1.appendThirdPartyWebSearchToolArgs; } });
// Re-export trace helpers
var trace_1 = require("./websearch/trace");
Object.defineProperty(exports, "appendWebSearchTrace", { enumerable: true, get: function () { return trace_1.appendWebSearchTrace; } });
Object.defineProperty(exports, "createWebSearchTraceContext", { enumerable: true, get: function () { return trace_1.createWebSearchTraceContext; } });
Object.defineProperty(exports, "isWebSearchTraceEnabled", { enumerable: true, get: function () { return trace_1.isWebSearchTraceEnabled; } });
Object.defineProperty(exports, "readWebSearchTraceRecords", { enumerable: true, get: function () { return trace_1.readWebSearchTraceRecords; } });
// Re-export status and readiness functions
var status_1 = require("./websearch/status");
Object.defineProperty(exports, "getWebSearchCliProviders", { enumerable: true, get: function () { return status_1.getWebSearchCliProviders; } });
Object.defineProperty(exports, "hasAnyWebSearchCli", { enumerable: true, get: function () { return status_1.hasAnyWebSearchCli; } });
Object.defineProperty(exports, "getCliInstallHints", { enumerable: true, get: function () { return status_1.getCliInstallHints; } });
Object.defineProperty(exports, "getWebSearchReadiness", { enumerable: true, get: function () { return status_1.getWebSearchReadiness; } });
Object.defineProperty(exports, "displayWebSearchStatus", { enumerable: true, get: function () { return status_1.displayWebSearchStatus; } });
// Re-export profile compatibility hook injection
var profile_hook_injector_1 = require("./websearch/profile-hook-injector");
Object.defineProperty(exports, "ensureProfileHooks", { enumerable: true, get: function () { return profile_hook_injector_1.ensureProfileHooks; } });
Object.defineProperty(exports, "ensureProfileHooksOrThrow", { enumerable: true, get: function () { return profile_hook_injector_1.ensureProfileHooksOrThrow; } });
// Import for local use
const websearch_1 = require("./websearch");
/**
 * Clear all CLI caches
 */
function clearAllCliCaches() {
    (0, websearch_1.clearGeminiCliCache)();
    (0, websearch_1.clearGrokCliCache)();
    (0, websearch_1.clearOpenCodeCliCache)();
}
exports.clearAllCliCaches = clearAllCliCaches;
var mcp_installer_2 = require("./websearch/mcp-installer");
Object.defineProperty(exports, "ensureMcpWebSearch", { enumerable: true, get: function () { return mcp_installer_2.ensureWebSearchMcp; } });
//# sourceMappingURL=websearch-manager.js.map