mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-23 14:45:46 +00:00
refactor web search config ownership into extensions
This commit is contained in:
@@ -892,6 +892,8 @@ export type WebSearchProviderPlugin = {
|
||||
inactiveSecretPaths?: string[];
|
||||
getCredentialValue: (searchConfig?: Record<string, unknown>) => unknown;
|
||||
setCredentialValue: (searchConfigTarget: Record<string, unknown>, value: unknown) => void;
|
||||
getConfiguredCredentialValue?: (config?: OpenClawConfig) => unknown;
|
||||
setConfiguredCredentialValue?: (configTarget: OpenClawConfig, value: unknown) => void;
|
||||
applySelectionConfig?: (config: OpenClawConfig) => OpenClawConfig;
|
||||
resolveRuntimeMetadata?: (
|
||||
ctx: WebSearchRuntimeMetadataContext,
|
||||
|
||||
@@ -23,12 +23,12 @@ describe("resolvePluginWebSearchProviders", () => {
|
||||
"firecrawl:firecrawl",
|
||||
]);
|
||||
expect(providers.map((provider) => provider.credentialPath)).toEqual([
|
||||
"tools.web.search.apiKey",
|
||||
"tools.web.search.gemini.apiKey",
|
||||
"tools.web.search.grok.apiKey",
|
||||
"tools.web.search.kimi.apiKey",
|
||||
"tools.web.search.perplexity.apiKey",
|
||||
"tools.web.search.firecrawl.apiKey",
|
||||
"plugins.entries.brave.config.webSearch.apiKey",
|
||||
"plugins.entries.google.config.webSearch.apiKey",
|
||||
"plugins.entries.xai.config.webSearch.apiKey",
|
||||
"plugins.entries.moonshot.config.webSearch.apiKey",
|
||||
"plugins.entries.perplexity.config.webSearch.apiKey",
|
||||
"plugins.entries.firecrawl.config.webSearch.apiKey",
|
||||
]);
|
||||
expect(providers.find((provider) => provider.id === "firecrawl")?.applySelectionConfig).toEqual(
|
||||
expect.any(Function),
|
||||
|
||||
Reference in New Issue
Block a user