import { getScopedCredentialValue, resolveProviderWebSearchPluginConfig, setProviderWebSearchPluginConfigValue, setScopedCredentialValue, type WebSearchProviderPlugin, } from "openclaw/plugin-sdk/provider-web-search-contract"; export function createKimiWebSearchProvider(): WebSearchProviderPlugin { return { id: "kimi", label: "Kimi (Moonshot)", hint: "Requires Moonshot / Kimi API key ยท Moonshot web search", onboardingScopes: ["text-inference"], credentialLabel: "Moonshot / Kimi API key", envVars: ["KIMI_API_KEY", "MOONSHOT_API_KEY"], placeholder: "sk-...", signupUrl: "https://platform.moonshot.cn/", docsUrl: "https://docs.openclaw.ai/tools/web", autoDetectOrder: 40, credentialPath: "plugins.entries.moonshot.config.webSearch.apiKey", inactiveSecretPaths: ["plugins.entries.moonshot.config.webSearch.apiKey"], getCredentialValue: (searchConfig) => getScopedCredentialValue(searchConfig, "kimi"), setCredentialValue: (searchConfigTarget, value) => setScopedCredentialValue(searchConfigTarget, "kimi", value), getConfiguredCredentialValue: (config) => resolveProviderWebSearchPluginConfig(config, "moonshot")?.apiKey, setConfiguredCredentialValue: (configTarget, value) => { setProviderWebSearchPluginConfigValue(configTarget, "moonshot", "apiKey", value); }, createTool: () => null, }; }