refactor(web-search): move providers into company plugins

This commit is contained in:
Peter Steinberger
2026-03-16 01:06:12 +00:00
parent 3aa5f2703c
commit 579d0ebe2b
14 changed files with 45 additions and 49 deletions

View File

@@ -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;

View File

@@ -1,5 +1,5 @@
{
"id": "web-search-grok",
"id": "brave",
"configSchema": {
"type": "object",
"additionalProperties": false,

View File

@@ -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": [

View File

@@ -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;

View File

@@ -1,5 +1,5 @@
{
"id": "web-search-brave",
"id": "google",
"configSchema": {
"type": "object",
"additionalProperties": false,

View File

@@ -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": [

View File

@@ -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;

View File

@@ -1,5 +1,5 @@
{
"id": "web-search-gemini",
"id": "perplexity",
"configSchema": {
"type": "object",
"additionalProperties": false,

View File

@@ -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": [

View File

@@ -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;

View File

@@ -1,5 +1,5 @@
{
"id": "web-search-perplexity",
"id": "xai",
"configSchema": {
"type": "object",
"additionalProperties": false,

View File

@@ -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": [

View File

@@ -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 },
}),
}),
}),

View File

@@ -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(