@openclaw/searxng-plugin 2026.9.5 → 2026.9.7

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.
package/assets/icon.png CHANGED
Binary file
@@ -1,8 +1,9 @@
1
+ import { ProviderHttpError } from "openclaw/plugin-sdk/provider-http";
1
2
  import { DEFAULT_CACHE_TTL_MINUTES, DEFAULT_SEARCH_COUNT, normalizeCacheKey, readCache, readResponseText, resolveCacheTtlMs, resolveSearchCount, resolveSiteName, resolveTimeoutSeconds, withSelfHostedWebSearchEndpoint, withTrustedWebSearchEndpoint, wrapWebContent, writeCache } from "openclaw/plugin-sdk/provider-web-search";
2
3
  import { assertHttpUrlTargetsPrivateNetwork, isBlockedHostnameOrIp, isPrivateIpAddress, resolvePinnedHostnameWithPolicy } from "openclaw/plugin-sdk/ssrf-runtime";
4
+ import { asOptionalObjectRecord, asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
3
5
  import { normalizeSecretInput } from "openclaw/plugin-sdk/secret-input";
4
6
  import { resolveReadOnlyEnvSecretRef } from "openclaw/plugin-sdk/secret-ref-readonly";
5
- import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
6
7
  //#region extensions/searxng/src/config.ts
7
8
  const SEARXNG_BASE_URL_ENV_VAR = "SEARXNG_BASE_URL";
8
9
  const SEARXNG_BASE_URL_PATH = "plugins.entries.searxng.config.webSearch.baseUrl";
@@ -10,8 +11,8 @@ function normalizeBaseUrl(value) {
10
11
  return normalizeSecretInput(value)?.replace(/\/+$/u, "") || void 0;
11
12
  }
12
13
  function resolveSearxngWebSearchConfig(config) {
13
- const webSearch = (config?.plugins?.entries?.searxng?.config)?.webSearch;
14
- if (webSearch && typeof webSearch === "object" && !Array.isArray(webSearch)) return webSearch;
14
+ const pluginConfig = config?.plugins?.entries?.searxng?.config;
15
+ return asOptionalRecord(pluginConfig?.webSearch);
15
16
  }
16
17
  function resolveSearxngBaseUrl(config) {
17
18
  const webSearch = resolveSearxngWebSearchConfig(config);
@@ -38,9 +39,8 @@ const DEFAULT_TIMEOUT_SECONDS = 20;
38
39
  const MAX_RESPONSE_BYTES = 1e6;
39
40
  const SEARXNG_SEARCH_CACHE = /* @__PURE__ */ new Map();
40
41
  function normalizeSearxngResult(value) {
41
- if (!value || typeof value !== "object") return null;
42
- const candidate = value;
43
- if (typeof candidate.url !== "string" || typeof candidate.title !== "string") return null;
42
+ const candidate = asOptionalObjectRecord(value);
43
+ if (typeof candidate?.url !== "string" || typeof candidate.title !== "string") return null;
44
44
  return {
45
45
  url: candidate.url,
46
46
  title: candidate.title,
@@ -103,11 +103,9 @@ function parseSearxngResponseText(text, count) {
103
103
  } catch {
104
104
  throw new Error("SearXNG returned invalid JSON.");
105
105
  }
106
- if (!parsed || typeof parsed !== "object") return [];
107
- const response = parsed;
108
- const rawResults = Array.isArray(response.results) ? response.results : [];
106
+ const rawResults = asOptionalObjectRecord(parsed)?.results;
109
107
  const results = [];
110
- for (const rawResult of rawResults) {
108
+ for (const rawResult of Array.isArray(rawResults) ? rawResults : []) {
111
109
  const result = normalizeSearxngResult(rawResult);
112
110
  if (result) results.push(result);
113
111
  if (results.length >= count) break;
@@ -132,7 +130,7 @@ async function fetchSearxngResults(params) {
132
130
  }, async (response) => {
133
131
  if (!response.ok) {
134
132
  const detail = (await readResponseText(response, { maxBytes: 64e3 })).text;
135
- throw new Error(`SearXNG search error (${response.status}): ${detail || response.statusText}`);
133
+ throw new ProviderHttpError(`SearXNG search error (${response.status}): ${detail || response.statusText}`, { status: response.status });
136
134
  }
137
135
  const body = await readResponseText(response, { maxBytes: MAX_RESPONSE_BYTES });
138
136
  if (body.truncated) throw new Error(`SearXNG response incomplete after ${body.bytesRead} bytes.`);
@@ -3,7 +3,7 @@ import { readPositiveIntegerParam, readStringParam } from "openclaw/plugin-sdk/p
3
3
  import { createWebSearchProviderContractFields } from "openclaw/plugin-sdk/provider-web-search-contract";
4
4
  //#region extensions/searxng/src/searxng-search-provider.ts
5
5
  const SEARXNG_CREDENTIAL_PATH = "plugins.entries.searxng.config.webSearch.baseUrl";
6
- const loadSearxngClientModule = createLazyRuntimeModule(() => import("./searxng-client-BIItF13t.mjs"));
6
+ const loadSearxngClientModule = createLazyRuntimeModule(() => import("./searxng-client-FNZHxETE.mjs"));
7
7
  const SearxngSearchSchema = {
8
8
  type: "object",
9
9
  properties: {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as createSearxngWebSearchProvider } from "./.setup/searxng-search-provider-CrnGJ3Iw.mjs";
1
+ import { t as createSearxngWebSearchProvider } from "./.setup/searxng-search-provider-ChvQoG8W.mjs";
2
2
  import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
3
3
  //#region extensions/searxng/index.ts
4
4
  var searxng_default = definePluginEntry({
@@ -1,2 +1,2 @@
1
- import { t as createSearxngWebSearchProvider } from "./.setup/searxng-search-provider-CrnGJ3Iw.mjs";
1
+ import { t as createSearxngWebSearchProvider } from "./.setup/searxng-search-provider-ChvQoG8W.mjs";
2
2
  export { createSearxngWebSearchProvider };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/searxng-plugin",
3
- "version": "2026.9.5",
3
+ "version": "2026.9.7",
4
4
  "description": "OpenClaw SearXNG plugin",
5
5
  "type": "module",
6
6
  "openclaw": {
@@ -15,10 +15,10 @@
15
15
  "allowInvalidConfigRecovery": true
16
16
  },
17
17
  "compat": {
18
- "pluginApi": ">=2026.9.5"
18
+ "pluginApi": ">=2026.9.7"
19
19
  },
20
20
  "build": {
21
- "openclawVersion": "2026.9.5",
21
+ "openclawVersion": "2026.9.7",
22
22
  "bundledDist": false
23
23
  },
24
24
  "release": {
@@ -41,7 +41,7 @@
41
41
  "assets/activity.svg"
42
42
  ],
43
43
  "peerDependencies": {
44
- "openclaw": ">=2026.9.5"
44
+ "openclaw": ">=2026.9.7"
45
45
  },
46
46
  "peerDependenciesMeta": {
47
47
  "openclaw": {