@openclaw/duckduckgo-plugin 2026.7.2-beta.7 → 2026.8.1-beta.3

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,7 +1,7 @@
1
1
  import { decodeHtmlEntities } from "openclaw/plugin-sdk/html-entity-runtime";
2
2
  import { readProviderTextResponse } from "openclaw/plugin-sdk/provider-http";
3
3
  import { DEFAULT_CACHE_TTL_MINUTES, DEFAULT_SEARCH_COUNT, normalizeCacheKey, readCache, readResponseText, resolveCacheTtlMs, resolveSearchCount, resolveSiteName, resolveTimeoutSeconds, withTrustedWebSearchEndpoint, wrapWebContent, writeCache } from "openclaw/plugin-sdk/provider-web-search";
4
- import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
4
+ import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  //#region extensions/duckduckgo/src/config.ts
6
6
  const DEFAULT_DDG_SAFE_SEARCH = "moderate";
7
7
  function resolveDdgWebSearchConfig(config) {
@@ -9,9 +9,7 @@ function resolveDdgWebSearchConfig(config) {
9
9
  if (webSearch && typeof webSearch === "object" && !Array.isArray(webSearch)) return webSearch;
10
10
  }
11
11
  function resolveDdgRegion(config) {
12
- const region = resolveDdgWebSearchConfig(config)?.region;
13
- if (typeof region !== "string") return;
14
- return region.trim() || void 0;
12
+ return normalizeOptionalString(resolveDdgWebSearchConfig(config)?.region);
15
13
  }
16
14
  function resolveDdgSafeSearch(config) {
17
15
  const safeSearch = resolveDdgWebSearchConfig(config)?.safeSearch;
@@ -114,6 +112,7 @@ async function runDuckDuckGoSearch(params) {
114
112
  const results = await withTrustedWebSearchEndpoint({
115
113
  url: url.toString(),
116
114
  timeoutSeconds,
115
+ signal: params.signal,
117
116
  init: {
118
117
  method: "GET",
119
118
  headers: { "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36" }
@@ -127,6 +126,7 @@ async function runDuckDuckGoSearch(params) {
127
126
  if (isBotChallenge(html)) throw new Error("DuckDuckGo returned a bot-detection challenge.");
128
127
  return parseDuckDuckGoHtml(html).slice(0, count);
129
128
  });
129
+ params.signal?.throwIfAborted();
130
130
  const payload = {
131
131
  query: params.query,
132
132
  provider: "duckduckgo",
@@ -148,12 +148,5 @@ async function runDuckDuckGoSearch(params) {
148
148
  writeCache(DDG_SEARCH_CACHE, cacheKey, payload, cacheTtlMs);
149
149
  return payload;
150
150
  }
151
- const testing = {
152
- decodeDuckDuckGoUrl,
153
- decodeHtmlEntities: decodeHtmlEntities$1,
154
- isBotChallenge,
155
- parseDuckDuckGoHtml,
156
- readDuckDuckGoHtmlResponse
157
- };
158
151
  //#endregion
159
- export { testing as __testing, testing, runDuckDuckGoSearch };
152
+ export { runDuckDuckGoSearch };
@@ -2,7 +2,7 @@ import { t as createDuckDuckGoWebSearchProviderBase } from "./ddg-search-provide
2
2
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
3
3
  import { readPositiveIntegerParam, readStringParam } from "openclaw/plugin-sdk/param-readers";
4
4
  //#region extensions/duckduckgo/src/ddg-search-provider.ts
5
- const loadDuckDuckGoClientModule = createLazyRuntimeModule(() => import("./ddg-client-C6gRi_9Z.js"));
5
+ const loadDuckDuckGoClientModule = createLazyRuntimeModule(() => import("./ddg-client-CdJu902j.js"));
6
6
  const DuckDuckGoSearchSchema = {
7
7
  type: "object",
8
8
  properties: {
@@ -33,7 +33,8 @@ function createDuckDuckGoWebSearchProvider() {
33
33
  createTool: (ctx) => ({
34
34
  description: "Search the web using DuckDuckGo. Returns titles, URLs, and snippets with no API key required.",
35
35
  parameters: DuckDuckGoSearchSchema,
36
- execute: async (args) => {
36
+ execute: async (args, context) => {
37
+ context?.signal?.throwIfAborted();
37
38
  const { runDuckDuckGoSearch } = await loadDuckDuckGoClientModule();
38
39
  return await runDuckDuckGoSearch({
39
40
  config: ctx.config,
@@ -43,7 +44,8 @@ function createDuckDuckGoWebSearchProvider() {
43
44
  message: "count must be an integer from 1 to 10."
44
45
  }),
45
46
  region: readStringParam(args, "region"),
46
- safeSearch: readStringParam(args, "safeSearch")
47
+ safeSearch: readStringParam(args, "safeSearch"),
48
+ ...context?.signal ? { signal: context.signal } : {}
47
49
  });
48
50
  }
49
51
  })
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as createDuckDuckGoWebSearchProvider } from "./ddg-search-provider-CgsJm3RP.js";
1
+ import { t as createDuckDuckGoWebSearchProvider } from "./ddg-search-provider-gy4EJrPB.js";
2
2
  import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
3
3
  //#region extensions/duckduckgo/index.ts
4
4
  var duckduckgo_default = definePluginEntry({
@@ -1,2 +1,2 @@
1
- import { t as createDuckDuckGoWebSearchProvider } from "./ddg-search-provider-CgsJm3RP.js";
1
+ import { t as createDuckDuckGoWebSearchProvider } from "./ddg-search-provider-gy4EJrPB.js";
2
2
  export { createDuckDuckGoWebSearchProvider };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/duckduckgo-plugin",
3
- "version": "2026.7.2-beta.7",
3
+ "version": "2026.8.1-beta.3",
4
4
  "description": "OpenClaw DuckDuckGo plugin.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,10 +18,10 @@
18
18
  "minHostVersion": ">=2026.7.2"
19
19
  },
20
20
  "compat": {
21
- "pluginApi": ">=2026.7.2-beta.7"
21
+ "pluginApi": ">=2026.8.1-beta.3"
22
22
  },
23
23
  "build": {
24
- "openclawVersion": "2026.7.2-beta.7",
24
+ "openclawVersion": "2026.8.1-beta.3",
25
25
  "bundledDist": false
26
26
  },
27
27
  "release": {
@@ -38,7 +38,7 @@
38
38
  "README.md"
39
39
  ],
40
40
  "peerDependencies": {
41
- "openclaw": ">=2026.7.2-beta.7"
41
+ "openclaw": ">=2026.8.1-beta.3"
42
42
  },
43
43
  "peerDependenciesMeta": {
44
44
  "openclaw": {