mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-02 18:00:21 +00:00
refactor: move bundled plugin policy into manifests
This commit is contained in:
@@ -47,19 +47,15 @@ function resolveSearchProviderCredentialLabel(
|
||||
return entry.credentialLabel?.trim() || `${entry.label} API key`;
|
||||
}
|
||||
|
||||
const DEFAULT_ONBOARD_SEARCH_PROVIDER_IDS = new Set<SearchProvider>([
|
||||
"brave",
|
||||
"firecrawl",
|
||||
"gemini",
|
||||
"grok",
|
||||
"kimi",
|
||||
"perplexity",
|
||||
"tavily",
|
||||
]);
|
||||
|
||||
export const SEARCH_PROVIDER_OPTIONS: readonly PluginWebSearchProviderEntry[] =
|
||||
resolveSearchProviderSetupContributions().map((contribution) => contribution.provider);
|
||||
|
||||
function showsSearchProviderInSetup(
|
||||
entry: Pick<PluginWebSearchProviderEntry, "onboardingScopes">,
|
||||
): boolean {
|
||||
return entry.onboardingScopes?.includes("text-inference") ?? false;
|
||||
}
|
||||
|
||||
function canRepairBundledProviderSelection(
|
||||
config: OpenClawConfig,
|
||||
provider: Pick<PluginWebSearchProviderEntry, "id" | "pluginId">,
|
||||
@@ -107,7 +103,7 @@ export function resolveSearchProviderSetupContributions(
|
||||
if (!config) {
|
||||
return sortFlowContributionsByLabel(
|
||||
sortWebSearchProviders(listBundledWebSearchProviders())
|
||||
.filter((entry) => DEFAULT_ONBOARD_SEARCH_PROVIDER_IDS.has(entry.id))
|
||||
.filter(showsSearchProviderInSetup)
|
||||
.map((provider) => buildSearchProviderSetupContribution({ provider, source: "bundled" })),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user