@openclaw/brave-plugin 2026.7.2-beta.7 → 2026.7.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { buildBraveWebSearchProviderBase } from "./web-search-shared.js";
1
+ import { buildBraveWebSearchProviderBase } from "../web-search-shared.js";
2
2
  import { isDiagnosticFlagEnabled } from "openclaw/plugin-sdk/diagnostic-runtime";
3
3
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
4
4
  import { mergeScopedSearchConfig, resolveProviderWebSearchPluginConfig } from "openclaw/plugin-sdk/provider-web-search-config-contract";
@@ -8,7 +8,7 @@ import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
8
8
  * Brave web-search provider factory. It builds the agent tool definition and
9
9
  * lazy-loads HTTP execution only when a search is run.
10
10
  */
11
- const loadBraveWebSearchRuntime = createLazyRuntimeModule(() => import("./brave-web-search-provider.runtime-nsVWfNKK.js"));
11
+ const loadBraveWebSearchRuntime = createLazyRuntimeModule(() => import("./brave-web-search-provider.runtime-DJPf4fbG.mjs"));
12
12
  const BraveSearchSchema = {
13
13
  type: "object",
14
14
  properties: {
@@ -134,7 +134,6 @@ function normalizeBraveUiLang(value) {
134
134
  const match = trimmed.match(BRAVE_UI_LANG_LOCALE);
135
135
  if (!match) return;
136
136
  const [, language, region] = match;
137
- if (!language || !region) return;
138
137
  return `${normalizeLowercaseStringOrEmpty(language)}-${region.toUpperCase()}`;
139
138
  }
140
139
  /** Resolve Brave-specific web-search config from scoped search config. */
@@ -204,7 +203,7 @@ function describeBraveRequestUrl(url) {
204
203
  };
205
204
  }
206
205
  function resolveBraveApiKey(searchConfig) {
207
- return readConfiguredSecretString(searchConfig?.apiKey, "plugins.entries.brave.config.webSearch.apiKey") ?? readProviderEnvValue(["BRAVE_API_KEY"]);
206
+ return readConfiguredSecretString(searchConfig?.apiKey, "tools.web.search.apiKey") ?? readProviderEnvValue(["BRAVE_API_KEY"]);
208
207
  }
209
208
  function resolveBraveBaseUrl(braveConfig) {
210
209
  return readConfiguredSecretString(braveConfig?.baseUrl, "plugins.entries.brave.config.webSearch.baseUrl")?.replace(/\/+$/u, "") || DEFAULT_BRAVE_BASE_URL;
@@ -377,9 +376,11 @@ async function executeBraveSearch(args, searchConfig, options) {
377
376
  docs: "https://docs.openclaw.ai/tools/web"
378
377
  };
379
378
  const rawFreshness = readStringParam(args, "freshness");
379
+ const rawDateAfter = readStringParam(args, "date_after");
380
+ const rawDateBefore = readStringParam(args, "date_before");
380
381
  const parsedTimeFilters = parseWebSearchTimeFilters({
381
- rawDateAfter: readStringParam(args, "date_after"),
382
- rawDateBefore: readStringParam(args, "date_before"),
382
+ rawDateAfter,
383
+ rawDateBefore,
383
384
  rawFreshness,
384
385
  freshnessProvider: "brave",
385
386
  invalidFreshnessMessage: "freshness must be day, week, month, or year.",
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as createBraveWebSearchProvider } from "./brave-web-search-provider-CWqHMdrX.js";
1
+ import { t as createBraveWebSearchProvider } from "./.setup/brave-web-search-provider-CIh9NAts.mjs";
2
2
  import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
3
3
  //#region extensions/brave/index.ts
4
4
  /**
@@ -1,2 +1,2 @@
1
- import { t as createBraveWebSearchProvider } from "./brave-web-search-provider-CWqHMdrX.js";
1
+ import { t as createBraveWebSearchProvider } from "./.setup/brave-web-search-provider-CIh9NAts.mjs";
2
2
  export { createBraveWebSearchProvider };
@@ -7,6 +7,18 @@ import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
7
7
  */
8
8
  /** Canonical config path for the Brave Search API key. */
9
9
  const BRAVE_CREDENTIAL_PATH = "plugins.entries.brave.config.webSearch.apiKey";
10
+ /** Resolve legacy top-level Brave credentials from old web-search config. */
11
+ function resolveLegacyTopLevelBraveCredential(config) {
12
+ if (!isRecord(config)) return;
13
+ const tools = isRecord(config.tools) ? config.tools : void 0;
14
+ const web = isRecord(tools?.web) ? tools.web : void 0;
15
+ const search = isRecord(web?.search) ? web.search : void 0;
16
+ if (!search || !("apiKey" in search)) return;
17
+ return {
18
+ path: "tools.web.search.apiKey",
19
+ value: search.apiKey
20
+ };
21
+ }
10
22
  function resolveBraveWebSearchPluginConfig(config) {
11
23
  if (!isRecord(config)) return;
12
24
  const plugins = isRecord(config.plugins) ? config.plugins : void 0;
@@ -15,9 +27,9 @@ function resolveBraveWebSearchPluginConfig(config) {
15
27
  const pluginConfig = isRecord(entry?.config) ? entry.config : void 0;
16
28
  return isRecord(pluginConfig?.webSearch) ? pluginConfig.webSearch : void 0;
17
29
  }
18
- /** Resolve Brave credentials from current plugin config. */
30
+ /** Resolve Brave credentials from current plugin config or legacy fallback. */
19
31
  function resolveConfiguredBraveCredential(config) {
20
- return resolveBraveWebSearchPluginConfig(config)?.apiKey;
32
+ return resolveBraveWebSearchPluginConfig(config)?.apiKey ?? resolveLegacyTopLevelBraveCredential(config)?.value;
21
33
  }
22
34
  /** Build the common Brave provider metadata without the runtime tool executor. */
23
35
  function buildBraveWebSearchProviderBase() {
@@ -38,7 +50,8 @@ function buildBraveWebSearchProviderBase() {
38
50
  searchCredential: { type: "top-level" },
39
51
  configuredCredential: { pluginId: "brave" }
40
52
  }),
41
- getConfiguredCredentialValue: resolveConfiguredBraveCredential
53
+ getConfiguredCredentialValue: resolveConfiguredBraveCredential,
54
+ getConfiguredCredentialFallback: resolveLegacyTopLevelBraveCredential
42
55
  };
43
56
  }
44
57
  //#endregion
@@ -34,6 +34,9 @@
34
34
  "contracts": {
35
35
  "webSearchProviders": ["brave"]
36
36
  },
37
+ "configContracts": {
38
+ "compatibilityRuntimePaths": ["tools.web.search.apiKey"]
39
+ },
37
40
  "configSchema": {
38
41
  "type": "object",
39
42
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/brave-plugin",
3
- "version": "2026.7.2-beta.7",
3
+ "version": "2026.7.33",
4
4
  "description": "OpenClaw Brave Search provider plugin for web search.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,10 +18,10 @@
18
18
  "allowInvalidConfigRecovery": true
19
19
  },
20
20
  "compat": {
21
- "pluginApi": ">=2026.7.2-beta.7"
21
+ "pluginApi": ">=2026.7.33"
22
22
  },
23
23
  "build": {
24
- "openclawVersion": "2026.7.2-beta.7"
24
+ "openclawVersion": "2026.7.33"
25
25
  },
26
26
  "release": {
27
27
  "publishToClawHub": true,
@@ -37,7 +37,7 @@
37
37
  "README.md"
38
38
  ],
39
39
  "peerDependencies": {
40
- "openclaw": ">=2026.7.2-beta.7"
40
+ "openclaw": ">=2026.7.33"
41
41
  },
42
42
  "peerDependenciesMeta": {
43
43
  "openclaw": {