@acedatacloud/openclaw-provider 2026.10.1 → 2026.10.2
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/README.md +3 -3
- package/dist/index.js +2 -2
- package/dist/src/search/acedata-search-client.d.ts +2 -0
- package/dist/src/search/acedata-search-client.js +21 -13
- package/dist/src/search/acedata-search-provider.d.ts +2 -1
- package/dist/src/search/acedata-search-provider.js +5 -2
- package/docs/cookbook.md +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,12 +10,12 @@ claim those approvals.
|
|
|
10
10
|
|
|
11
11
|
## Setup
|
|
12
12
|
|
|
13
|
-
Download `acedatacloud-openclaw-provider-2026.10.
|
|
14
|
-
[GitHub release](https://github.com/AceDataCloud/OpenClawProvider/releases/tag/v2026.10.
|
|
13
|
+
Download `acedatacloud-openclaw-provider-2026.10.2.tgz` from the
|
|
14
|
+
[GitHub release](https://github.com/AceDataCloud/OpenClawProvider/releases/tag/v2026.10.2),
|
|
15
15
|
then install the reviewed archive and enter an API key:
|
|
16
16
|
|
|
17
17
|
```sh
|
|
18
|
-
openclaw plugins install npm-pack:./acedatacloud-openclaw-provider-2026.10.
|
|
18
|
+
openclaw plugins install npm-pack:./acedatacloud-openclaw-provider-2026.10.2.tgz
|
|
19
19
|
openclaw onboard --auth-choice acedatacloud-api-key
|
|
20
20
|
```
|
|
21
21
|
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { GENERATED_CHAT_MODELS } from "./src/chat/generated-catalog.js";
|
|
|
6
6
|
import { ACEDATA_DEFAULT_MODEL_REF, applyAcedataConfig, } from "./src/chat/onboard.js";
|
|
7
7
|
import { resolveAcedataThinkingProfile, wrapAcedataStream, prepareAcedataRuntimeAuth, } from "./src/chat/runtime.js";
|
|
8
8
|
import { createAcedataWebSearchProvider } from "./src/search/acedata-search-provider.js";
|
|
9
|
-
import { registerServiceTools } from "./src/services/tools.js";
|
|
9
|
+
import { registerServiceTools, resolveServiceKey } from "./src/services/tools.js";
|
|
10
10
|
import { registerMediaProviders } from "./src/services/media.js";
|
|
11
11
|
const ACEDATA_MODEL_ID_PREFIX_RE = new RegExp(`^${ACEDATA_PROVIDER_ID}\\/`);
|
|
12
12
|
// OpenClaw passes the qualified id (e.g. "acedatacloud/claude-haiku-4-5-20251001")
|
|
@@ -94,7 +94,7 @@ const plugin = definePluginEntry({
|
|
|
94
94
|
source: "static",
|
|
95
95
|
})),
|
|
96
96
|
});
|
|
97
|
-
api.registerWebSearchProvider(createAcedataWebSearchProvider());
|
|
97
|
+
api.registerWebSearchProvider(createAcedataWebSearchProvider(cfg => resolveServiceKey(api, "google-search", cfg)));
|
|
98
98
|
registerMediaProviders(api);
|
|
99
99
|
registerServiceTools(api);
|
|
100
100
|
},
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { resolveAcedataSearchApiKey, resolveAcedataSearchBaseUrl, resolveAcedataSearchTimeoutSeconds, } from "./acedata-search-config.js";
|
|
2
|
+
import { cleanResult, readLimited } from "../services/client.js";
|
|
2
3
|
const SEARCH_PATH = "/serp/google";
|
|
3
4
|
function buildSearchUrl(baseUrl) {
|
|
4
|
-
|
|
5
|
+
const url = new URL(`${baseUrl.replace(/\/$/, "")}${SEARCH_PATH}`);
|
|
6
|
+
if (url.protocol !== "https:" || url.username || url.password)
|
|
7
|
+
throw new Error("Search base URL must use HTTPS without embedded credentials.");
|
|
8
|
+
return url.toString();
|
|
5
9
|
}
|
|
6
10
|
function asString(value) {
|
|
7
11
|
return typeof value === "string" && value.trim() ? value : undefined;
|
|
@@ -34,7 +38,7 @@ export async function runAcedataSearch(args) {
|
|
|
34
38
|
if (!query.trim()) {
|
|
35
39
|
throw new Error("Ace Data Cloud search query is required");
|
|
36
40
|
}
|
|
37
|
-
const apiKey = resolveAcedataSearchApiKey(cfg);
|
|
41
|
+
const apiKey = resolveAcedataSearchApiKey(cfg) ?? args.apiKey;
|
|
38
42
|
if (!apiKey) {
|
|
39
43
|
throw new Error("Ace Data Cloud API key not configured. Set ACEDATA_API_KEY env var or configure plugins.entries.acedatacloud.config.webSearch.apiKey.");
|
|
40
44
|
}
|
|
@@ -63,32 +67,36 @@ export async function runAcedataSearch(args) {
|
|
|
63
67
|
Accept: "application/json",
|
|
64
68
|
},
|
|
65
69
|
body: JSON.stringify(body),
|
|
66
|
-
|
|
70
|
+
redirect: "error",
|
|
71
|
+
signal: args.signal ? AbortSignal.any([args.signal, controller.signal]) : controller.signal,
|
|
67
72
|
});
|
|
68
73
|
}
|
|
69
74
|
catch (cause) {
|
|
75
|
+
clearTimeout(timer);
|
|
70
76
|
if (cause?.name === "AbortError") {
|
|
71
77
|
throw new Error(`Ace Data Cloud search timed out after ${timeoutSeconds}s`);
|
|
72
78
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
finally {
|
|
76
|
-
clearTimeout(timer);
|
|
79
|
+
args.signal?.throwIfAborted();
|
|
80
|
+
throw new Error("Ace Data Cloud search request failed.");
|
|
77
81
|
}
|
|
78
82
|
if (!response.ok) {
|
|
79
|
-
|
|
80
|
-
|
|
83
|
+
clearTimeout(timer);
|
|
84
|
+
await response.body?.cancel();
|
|
85
|
+
throw new Error(`Ace Data Cloud search API returned HTTP ${response.status}`);
|
|
81
86
|
}
|
|
82
87
|
let payload;
|
|
83
88
|
try {
|
|
84
|
-
payload = await response.
|
|
89
|
+
payload = cleanResult(JSON.parse((await readLimited(response, 8 * 1024 * 1024)).toString("utf8")));
|
|
85
90
|
}
|
|
86
|
-
catch
|
|
87
|
-
throw new Error("Ace Data Cloud search returned malformed JSON"
|
|
91
|
+
catch {
|
|
92
|
+
throw new Error("Ace Data Cloud search returned malformed or oversized JSON");
|
|
93
|
+
}
|
|
94
|
+
finally {
|
|
95
|
+
clearTimeout(timer);
|
|
88
96
|
}
|
|
89
97
|
const root = (payload && typeof payload === "object" ? payload : {});
|
|
90
98
|
const data = (root.data && typeof root.data === "object" ? root.data : root) ?? {};
|
|
91
|
-
const organic = normalizeOrganicResults(data.organic_results ?? data.results ?? data.items);
|
|
99
|
+
const organic = normalizeOrganicResults(data.organic ?? data.organic_results ?? data.results ?? data.items ?? data.images ?? data.news ?? data.videos ?? data.places);
|
|
92
100
|
const result = {
|
|
93
101
|
type,
|
|
94
102
|
query,
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
|
|
1
2
|
import type { WebSearchProviderPlugin } from "./acedata-search-shared.js";
|
|
2
|
-
export declare function createAcedataWebSearchProvider(): WebSearchProviderPlugin;
|
|
3
|
+
export declare function createAcedataWebSearchProvider(resolveSharedKey?: (cfg?: OpenClawConfig) => Promise<string>): WebSearchProviderPlugin;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { readPositiveIntegerParam } from "openclaw/plugin-sdk/param-readers";
|
|
2
|
+
import { resolveAcedataSearchApiKey } from "./acedata-search-config.js";
|
|
2
3
|
import { runAcedataSearch } from "./acedata-search-client.js";
|
|
3
4
|
import { buildAcedataSearchProviderBase } from "./acedata-search-shared.js";
|
|
4
5
|
const SUPPORTED_TYPES = ["search", "images", "news", "videos", "maps", "places"];
|
|
@@ -42,13 +43,13 @@ function normalizeSearchType(value) {
|
|
|
42
43
|
return undefined;
|
|
43
44
|
return SUPPORTED_TYPES.includes(value) ? value : undefined;
|
|
44
45
|
}
|
|
45
|
-
export function createAcedataWebSearchProvider() {
|
|
46
|
+
export function createAcedataWebSearchProvider(resolveSharedKey) {
|
|
46
47
|
return {
|
|
47
48
|
...buildAcedataSearchProviderBase(),
|
|
48
49
|
createTool: (ctx) => ({
|
|
49
50
|
description: "Search the web using Ace Data Cloud's Google SERP API. Returns structured organic results plus optional knowledge graph and answer box. Supports image/news/video/maps verticals.",
|
|
50
51
|
parameters: AcedataSearchSchema,
|
|
51
|
-
execute: async (args) => {
|
|
52
|
+
execute: async (args, execution) => {
|
|
52
53
|
const query = typeof args.query === "string" ? args.query : "";
|
|
53
54
|
const count = readPositiveIntegerParam(args, "count", {
|
|
54
55
|
message: "count must be an integer from 1 to 100",
|
|
@@ -59,6 +60,8 @@ export function createAcedataWebSearchProvider() {
|
|
|
59
60
|
});
|
|
60
61
|
return await runAcedataSearch({
|
|
61
62
|
cfg: ctx.config,
|
|
63
|
+
apiKey: resolveAcedataSearchApiKey(ctx.config) ?? await resolveSharedKey?.(ctx.config),
|
|
64
|
+
signal: execution?.signal,
|
|
62
65
|
query,
|
|
63
66
|
type: normalizeSearchType(args.type) ?? "search",
|
|
64
67
|
country: typeof args.country === "string" ? args.country : undefined,
|
package/docs/cookbook.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Configure Ace Data Cloud in OpenClaw
|
|
2
2
|
|
|
3
|
-
Download the archive from the [GitHub release](https://github.com/AceDataCloud/OpenClawProvider/releases/tag/v2026.10.
|
|
3
|
+
Download the archive from the [GitHub release](https://github.com/AceDataCloud/OpenClawProvider/releases/tag/v2026.10.2),
|
|
4
4
|
install it, and use the onboarding prompt for the API key:
|
|
5
5
|
|
|
6
6
|
```sh
|
|
7
|
-
openclaw plugins install npm-pack:./acedatacloud-openclaw-provider-2026.10.
|
|
7
|
+
openclaw plugins install npm-pack:./acedatacloud-openclaw-provider-2026.10.2.tgz
|
|
8
8
|
openclaw onboard --auth-choice acedatacloud-api-key
|
|
9
9
|
```
|
|
10
10
|
|
package/package.json
CHANGED