mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-16 12:30:49 +00:00
refactor(web-search): move providers into company plugins
This commit is contained in:
@@ -6,10 +6,10 @@ import {
|
||||
import { emptyPluginConfigSchema } from "../../src/plugins/config-schema.js";
|
||||
import type { OpenClawPluginApi } from "../../src/plugins/types.js";
|
||||
|
||||
const braveSearchPlugin = {
|
||||
id: "web-search-brave",
|
||||
name: "Web Search Brave Provider",
|
||||
description: "Bundled Brave provider for the web_search tool",
|
||||
const bravePlugin = {
|
||||
id: "brave",
|
||||
name: "Brave Plugin",
|
||||
description: "Bundled Brave plugin",
|
||||
configSchema: emptyPluginConfigSchema(),
|
||||
register(api: OpenClawPluginApi) {
|
||||
api.registerWebSearchProvider(
|
||||
@@ -29,4 +29,4 @@ const braveSearchPlugin = {
|
||||
},
|
||||
};
|
||||
|
||||
export default braveSearchPlugin;
|
||||
export default bravePlugin;
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"id": "web-search-grok",
|
||||
"id": "brave",
|
||||
"configSchema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "@openclaw/web-search-grok",
|
||||
"name": "@openclaw/brave-plugin",
|
||||
"version": "2026.3.14",
|
||||
"private": true,
|
||||
"description": "OpenClaw Grok web search provider plugin",
|
||||
"description": "OpenClaw Brave plugin",
|
||||
"type": "module",
|
||||
"openclaw": {
|
||||
"extensions": [
|
||||
@@ -6,10 +6,10 @@ import {
|
||||
import { emptyPluginConfigSchema } from "../../src/plugins/config-schema.js";
|
||||
import type { OpenClawPluginApi } from "../../src/plugins/types.js";
|
||||
|
||||
const geminiSearchPlugin = {
|
||||
id: "web-search-gemini",
|
||||
name: "Web Search Gemini Provider",
|
||||
description: "Bundled Gemini provider for the web_search tool",
|
||||
const googlePlugin = {
|
||||
id: "google",
|
||||
name: "Google Plugin",
|
||||
description: "Bundled Google plugin",
|
||||
configSchema: emptyPluginConfigSchema(),
|
||||
register(api: OpenClawPluginApi) {
|
||||
api.registerWebSearchProvider(
|
||||
@@ -30,4 +30,4 @@ const geminiSearchPlugin = {
|
||||
},
|
||||
};
|
||||
|
||||
export default geminiSearchPlugin;
|
||||
export default googlePlugin;
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"id": "web-search-brave",
|
||||
"id": "google",
|
||||
"configSchema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "@openclaw/web-search-brave",
|
||||
"name": "@openclaw/google-plugin",
|
||||
"version": "2026.3.14",
|
||||
"private": true,
|
||||
"description": "OpenClaw Brave web search provider plugin",
|
||||
"description": "OpenClaw Google plugin",
|
||||
"type": "module",
|
||||
"openclaw": {
|
||||
"extensions": [
|
||||
@@ -6,10 +6,10 @@ import {
|
||||
import { emptyPluginConfigSchema } from "../../src/plugins/config-schema.js";
|
||||
import type { OpenClawPluginApi } from "../../src/plugins/types.js";
|
||||
|
||||
const perplexitySearchPlugin = {
|
||||
id: "web-search-perplexity",
|
||||
name: "Web Search Perplexity Provider",
|
||||
description: "Bundled Perplexity provider for the web_search tool",
|
||||
const perplexityPlugin = {
|
||||
id: "perplexity",
|
||||
name: "Perplexity Plugin",
|
||||
description: "Bundled Perplexity plugin",
|
||||
configSchema: emptyPluginConfigSchema(),
|
||||
register(api: OpenClawPluginApi) {
|
||||
api.registerWebSearchProvider(
|
||||
@@ -30,4 +30,4 @@ const perplexitySearchPlugin = {
|
||||
},
|
||||
};
|
||||
|
||||
export default perplexitySearchPlugin;
|
||||
export default perplexityPlugin;
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"id": "web-search-gemini",
|
||||
"id": "perplexity",
|
||||
"configSchema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "@openclaw/web-search-gemini",
|
||||
"name": "@openclaw/perplexity-plugin",
|
||||
"version": "2026.3.14",
|
||||
"private": true,
|
||||
"description": "OpenClaw Gemini web search provider plugin",
|
||||
"description": "OpenClaw Perplexity plugin",
|
||||
"type": "module",
|
||||
"openclaw": {
|
||||
"extensions": [
|
||||
@@ -6,10 +6,10 @@ import {
|
||||
import { emptyPluginConfigSchema } from "../../src/plugins/config-schema.js";
|
||||
import type { OpenClawPluginApi } from "../../src/plugins/types.js";
|
||||
|
||||
const grokSearchPlugin = {
|
||||
id: "web-search-grok",
|
||||
name: "Web Search Grok Provider",
|
||||
description: "Bundled Grok provider for the web_search tool",
|
||||
const xaiPlugin = {
|
||||
id: "xai",
|
||||
name: "xAI Plugin",
|
||||
description: "Bundled xAI plugin",
|
||||
configSchema: emptyPluginConfigSchema(),
|
||||
register(api: OpenClawPluginApi) {
|
||||
api.registerWebSearchProvider(
|
||||
@@ -30,4 +30,4 @@ const grokSearchPlugin = {
|
||||
},
|
||||
};
|
||||
|
||||
export default grokSearchPlugin;
|
||||
export default xaiPlugin;
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"id": "web-search-perplexity",
|
||||
"id": "xai",
|
||||
"configSchema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "@openclaw/web-search-perplexity",
|
||||
"name": "@openclaw/xai-plugin",
|
||||
"version": "2026.3.14",
|
||||
"private": true,
|
||||
"description": "OpenClaw Perplexity web search provider plugin",
|
||||
"description": "OpenClaw xAI plugin",
|
||||
"type": "module",
|
||||
"openclaw": {
|
||||
"extensions": [
|
||||
@@ -13,7 +13,7 @@ describe("resolvePluginWebSearchProviders", () => {
|
||||
loadOpenClawPluginsMock.mockReturnValue({
|
||||
webSearchProviders: [
|
||||
{
|
||||
pluginId: "web-search-gemini",
|
||||
pluginId: "google",
|
||||
provider: {
|
||||
id: "gemini",
|
||||
label: "Gemini",
|
||||
@@ -25,7 +25,7 @@ describe("resolvePluginWebSearchProviders", () => {
|
||||
},
|
||||
},
|
||||
{
|
||||
pluginId: "web-search-brave",
|
||||
pluginId: "brave",
|
||||
provider: {
|
||||
id: "brave",
|
||||
label: "Brave",
|
||||
@@ -71,11 +71,7 @@ describe("resolvePluginWebSearchProviders", () => {
|
||||
expect.objectContaining({
|
||||
config: expect.objectContaining({
|
||||
plugins: expect.objectContaining({
|
||||
allow: expect.arrayContaining([
|
||||
"openrouter",
|
||||
"web-search-brave",
|
||||
"web-search-perplexity",
|
||||
]),
|
||||
allow: expect.arrayContaining(["openrouter", "brave", "perplexity"]),
|
||||
}),
|
||||
}),
|
||||
}),
|
||||
@@ -99,11 +95,11 @@ describe("resolvePluginWebSearchProviders", () => {
|
||||
plugins: expect.objectContaining({
|
||||
entries: expect.objectContaining({
|
||||
openrouter: { enabled: true },
|
||||
"web-search-brave": { enabled: true },
|
||||
"web-search-gemini": { enabled: true },
|
||||
"web-search-grok": { enabled: true },
|
||||
brave: { enabled: true },
|
||||
google: { enabled: true },
|
||||
moonshot: { enabled: true },
|
||||
"web-search-perplexity": { enabled: true },
|
||||
perplexity: { enabled: true },
|
||||
xai: { enabled: true },
|
||||
}),
|
||||
}),
|
||||
}),
|
||||
@@ -116,7 +112,7 @@ describe("resolvePluginWebSearchProviders", () => {
|
||||
config: {
|
||||
plugins: {
|
||||
entries: {
|
||||
"web-search-perplexity": { enabled: false },
|
||||
perplexity: { enabled: false },
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -127,7 +123,7 @@ describe("resolvePluginWebSearchProviders", () => {
|
||||
config: expect.objectContaining({
|
||||
plugins: expect.objectContaining({
|
||||
entries: expect.objectContaining({
|
||||
"web-search-perplexity": { enabled: false },
|
||||
perplexity: { enabled: false },
|
||||
}),
|
||||
}),
|
||||
}),
|
||||
|
||||
@@ -7,11 +7,11 @@ import type { WebSearchProviderPlugin } from "./types.js";
|
||||
const log = createSubsystemLogger("plugins");
|
||||
|
||||
const BUNDLED_WEB_SEARCH_ALLOWLIST_COMPAT_PLUGIN_IDS = [
|
||||
"web-search-brave",
|
||||
"web-search-gemini",
|
||||
"web-search-grok",
|
||||
"brave",
|
||||
"google",
|
||||
"moonshot",
|
||||
"web-search-perplexity",
|
||||
"perplexity",
|
||||
"xai",
|
||||
] as const;
|
||||
|
||||
function withBundledWebSearchAllowlistCompat(
|
||||
|
||||
Reference in New Issue
Block a user