@openclaw/parallel-plugin 2026.9.6 → 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 +0 -0
- package/dist/.setup/{parallel-free-web-search-provider-cXSsdp4Y.mjs → parallel-free-web-search-provider-DVjfPmlG.mjs} +2 -2
- package/dist/.setup/{parallel-free-web-search-provider.runtime-OAvvtssG.mjs → parallel-free-web-search-provider.runtime-C2wHlx8V.mjs} +14 -15
- package/dist/.setup/{parallel-search-normalize-Jruxwvw_.mjs → parallel-search-normalize-CP1w5YdR.mjs} +8 -23
- package/dist/.setup/{parallel-web-search-provider.runtime-D3trDaRb.mjs → parallel-web-search-provider.runtime-BO11rmJ6.mjs} +3 -7
- package/dist/index.js +1 -1
- package/dist/web-search-contract-api.js +1 -1
- package/dist/web-search-provider.js +1 -1
- package/package.json +4 -4
package/assets/icon.png
CHANGED
|
Binary file
|
|
@@ -61,7 +61,7 @@ const PARALLEL_MAX_SEARCH_QUERY_CHARS = 200;
|
|
|
61
61
|
const PARALLEL_MAX_OBJECTIVE_CHARS = 5e3;
|
|
62
62
|
const PARALLEL_MAX_SESSION_ID_CHARS = 1e3;
|
|
63
63
|
const PARALLEL_MAX_CLIENT_MODEL_CHARS = 100;
|
|
64
|
-
const loadParallelWebSearchRuntime = createLazyRuntimeModule(() => import("./parallel-web-search-provider.runtime-
|
|
64
|
+
const loadParallelWebSearchRuntime = createLazyRuntimeModule(() => import("./parallel-web-search-provider.runtime-BO11rmJ6.mjs"));
|
|
65
65
|
const ParallelSearchSchema = {
|
|
66
66
|
type: "object",
|
|
67
67
|
properties: {
|
|
@@ -126,7 +126,7 @@ const ParallelFreeSearchSchema = {
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
|
-
const loadParallelFreeWebSearchRuntime = createLazyRuntimeModule(() => import("./parallel-free-web-search-provider.runtime-
|
|
129
|
+
const loadParallelFreeWebSearchRuntime = createLazyRuntimeModule(() => import("./parallel-free-web-search-provider.runtime-C2wHlx8V.mjs"));
|
|
130
130
|
function createParallelFreeWebSearchProvider() {
|
|
131
131
|
return {
|
|
132
132
|
...createParallelFreeWebSearchProviderBase(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as executeParallelSearchRequest } from "./parallel-search-normalize-
|
|
1
|
+
import { t as executeParallelSearchRequest } from "./parallel-search-normalize-CP1w5YdR.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { mergeScopedSearchConfig, resolveProviderWebSearchPluginConfig, withTrustedWebSearchEndpoint } from "openclaw/plugin-sdk/provider-web-search";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
@@ -97,13 +97,16 @@ async function postMcp(params) {
|
|
|
97
97
|
}),
|
|
98
98
|
body: JSON.stringify(params.body)
|
|
99
99
|
}
|
|
100
|
-
}, async (response) =>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
100
|
+
}, async (response) => {
|
|
101
|
+
if (!response.ok) {
|
|
102
|
+
const detail = await readResponseTextLimited(response, PARALLEL_MCP_ERROR_BODY_LIMIT_BYTES);
|
|
103
|
+
throw new ProviderHttpError(`Parallel MCP ${params.body.method} failed (${response.status}): ${detail || response.statusText}`, { status: response.status });
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
text: await readProviderTextResponse(response, "Parallel MCP"),
|
|
107
|
+
sessionIdHeader: response.headers.get("mcp-session-id")
|
|
108
|
+
};
|
|
109
|
+
});
|
|
107
110
|
}
|
|
108
111
|
/**
|
|
109
112
|
* Run the MCP handshake then a single `tools/call`, returning the tool payload.
|
|
@@ -130,11 +133,10 @@ async function mcpCall(toolName, args, timeoutSeconds, signal) {
|
|
|
130
133
|
}
|
|
131
134
|
}
|
|
132
135
|
});
|
|
133
|
-
if (!init.ok) throw new ProviderHttpError(`Parallel MCP initialize failed (${init.status}): ${init.text || init.statusText}`, { status: init.status });
|
|
134
136
|
const sessionId = init.sessionIdHeader ?? void 0;
|
|
135
137
|
const initEnvelope = selectMcpEnvelope(init.text, initId);
|
|
136
138
|
const negotiatedVersion = (isRecord(initEnvelope.result) && typeof initEnvelope.result.protocolVersion === "string" ? initEnvelope.result.protocolVersion : void 0) ?? MCP_PROTOCOL_VERSION;
|
|
137
|
-
|
|
139
|
+
await postMcp({
|
|
138
140
|
body: {
|
|
139
141
|
jsonrpc: "2.0",
|
|
140
142
|
method: "notifications/initialized"
|
|
@@ -144,9 +146,8 @@ async function mcpCall(toolName, args, timeoutSeconds, signal) {
|
|
|
144
146
|
timeoutSeconds,
|
|
145
147
|
signal
|
|
146
148
|
});
|
|
147
|
-
if (!initialized.ok) throw new ProviderHttpError(`Parallel MCP notifications/initialized failed (${initialized.status}): ${initialized.text || initialized.statusText}`, { status: initialized.status });
|
|
148
149
|
const callId = randomUUID();
|
|
149
|
-
|
|
150
|
+
return extractMcpToolPayload(selectMcpEnvelope((await postMcp({
|
|
150
151
|
body: {
|
|
151
152
|
jsonrpc: "2.0",
|
|
152
153
|
id: callId,
|
|
@@ -160,9 +161,7 @@ async function mcpCall(toolName, args, timeoutSeconds, signal) {
|
|
|
160
161
|
protocolVersion: negotiatedVersion,
|
|
161
162
|
timeoutSeconds,
|
|
162
163
|
signal
|
|
163
|
-
});
|
|
164
|
-
if (!call.ok) throw new ProviderHttpError(`Parallel MCP tools/call failed (${call.status}): ${call.text || call.statusText}`, { status: call.status });
|
|
165
|
-
return extractMcpToolPayload(selectMcpEnvelope(call.text, callId));
|
|
164
|
+
})).text, callId));
|
|
166
165
|
}
|
|
167
166
|
function normalizeMcpSessionId(value) {
|
|
168
167
|
return value?.trim() || randomUUID();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./parallel-free-web-search-provider-
|
|
1
|
+
import "./parallel-free-web-search-provider-DVjfPmlG.mjs";
|
|
2
2
|
import { DEFAULT_SEARCH_COUNT, buildSearchCacheKey, readCachedSearchPayload, readPositiveIntegerParam, readStringArrayParam, readStringParam, resolveSearchCacheTtlMs, resolveSearchTimeoutSeconds, resolveSiteName, wrapWebContent, writeCachedSearchPayload } from "openclaw/plugin-sdk/provider-web-search";
|
|
3
|
-
import {
|
|
3
|
+
import { asOptionalObjectRecord, isRecord, normalizeBoundedOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
5
5
|
import { resolveIntegerOption } from "openclaw/plugin-sdk/number-runtime";
|
|
6
6
|
//#region extensions/parallel/src/parallel-search-normalize.ts
|
|
@@ -11,8 +11,8 @@ const PARALLEL_MAX_SEARCH_QUERIES = 5;
|
|
|
11
11
|
const PARALLEL_SESSION_ID_MAX_LENGTH = 1e3;
|
|
12
12
|
const PARALLEL_CLIENT_MODEL_MAX_LENGTH = 100;
|
|
13
13
|
function normalizeParallelSearchRequest(args, configuredCount, sessionIdMaxLength) {
|
|
14
|
-
const objective =
|
|
15
|
-
const cliQuery =
|
|
14
|
+
const objective = truncateUtf16Safe(readStringParam(args, "objective") ?? "", PARALLEL_MAX_OBJECTIVE_CHARS) || void 0;
|
|
15
|
+
const cliQuery = truncateUtf16Safe(readStringParam(args, "query") ?? "", PARALLEL_MAX_OBJECTIVE_CHARS) || void 0;
|
|
16
16
|
let searchQueries = normalizeParallelSearchQueries(readStringArrayParam(args, "search_queries"));
|
|
17
17
|
if (searchQueries.length === 0 && cliQuery) searchQueries = normalizeParallelSearchQueries([cliQuery]);
|
|
18
18
|
if (searchQueries.length === 0) return { error: invalidSearchQueriesPayload() };
|
|
@@ -21,7 +21,7 @@ function normalizeParallelSearchRequest(args, configuredCount, sessionIdMaxLengt
|
|
|
21
21
|
searchQueries,
|
|
22
22
|
count: resolveParallelSearchCount(args, configuredCount),
|
|
23
23
|
sessionId: normalizeBoundedOptionalString(readStringParam(args, "session_id"), sessionIdMaxLength),
|
|
24
|
-
clientModel:
|
|
24
|
+
clientModel: truncateUtf16Safe(readStringParam(args, "client_model") ?? "", PARALLEL_CLIENT_MODEL_MAX_LENGTH) || void 0
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
async function executeParallelSearchRequest(params) {
|
|
@@ -59,16 +59,6 @@ function resolveParallelSearchCount(args, configuredCount) {
|
|
|
59
59
|
max: PARALLEL_MAX_SEARCH_COUNT
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
function normalizeParallelObjective(value) {
|
|
63
|
-
const trimmed = normalizeOptionalString(value);
|
|
64
|
-
if (!trimmed) return;
|
|
65
|
-
return trimmed.length <= PARALLEL_MAX_OBJECTIVE_CHARS ? trimmed : truncateUtf16Safe(trimmed, PARALLEL_MAX_OBJECTIVE_CHARS);
|
|
66
|
-
}
|
|
67
|
-
function normalizeParallelClientModel(value) {
|
|
68
|
-
const trimmed = normalizeOptionalString(value);
|
|
69
|
-
if (!trimmed) return;
|
|
70
|
-
return trimmed.length <= PARALLEL_CLIENT_MODEL_MAX_LENGTH ? trimmed : truncateUtf16Safe(trimmed, PARALLEL_CLIENT_MODEL_MAX_LENGTH);
|
|
71
|
-
}
|
|
72
62
|
function normalizeParallelSearchQueries(value) {
|
|
73
63
|
const candidates = Array.isArray(value) ? value : [];
|
|
74
64
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -77,7 +67,7 @@ function normalizeParallelSearchQueries(value) {
|
|
|
77
67
|
if (typeof entry !== "string") continue;
|
|
78
68
|
const trimmed = entry.trim();
|
|
79
69
|
if (!trimmed) continue;
|
|
80
|
-
const capped =
|
|
70
|
+
const capped = truncateUtf16Safe(trimmed, PARALLEL_MAX_SEARCH_QUERY_CHARS);
|
|
81
71
|
if (seen.has(capped)) continue;
|
|
82
72
|
seen.add(capped);
|
|
83
73
|
out.push(capped);
|
|
@@ -92,15 +82,10 @@ function invalidSearchQueriesPayload() {
|
|
|
92
82
|
docs: "https://docs.openclaw.ai/tools/parallel-search"
|
|
93
83
|
};
|
|
94
84
|
}
|
|
95
|
-
function normalizeParallelResults(payload) {
|
|
96
|
-
if (!payload || typeof payload !== "object") return [];
|
|
97
|
-
const results = payload.results;
|
|
98
|
-
if (!Array.isArray(results)) return [];
|
|
99
|
-
return results.filter((entry) => Boolean(entry && typeof entry === "object" && !Array.isArray(entry)));
|
|
100
|
-
}
|
|
101
85
|
/** Maps a Parallel v1 response into wrapped `web_search` result entries. */
|
|
102
86
|
function mapParallelResults(response, count) {
|
|
103
|
-
|
|
87
|
+
const rawResults = asOptionalObjectRecord(response)?.results;
|
|
88
|
+
return (Array.isArray(rawResults) ? rawResults.filter(isRecord) : []).slice(0, count).map((entry) => {
|
|
104
89
|
const title = typeof entry.title === "string" ? entry.title : "";
|
|
105
90
|
const url = typeof entry.url === "string" ? entry.url : "";
|
|
106
91
|
const published = typeof entry.publish_date === "string" && entry.publish_date ? entry.publish_date : void 0;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as executeParallelSearchRequest } from "./parallel-search-normalize-
|
|
1
|
+
import { t as executeParallelSearchRequest } from "./parallel-search-normalize-CP1w5YdR.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { mergeScopedSearchConfig, readConfiguredSecretString, readProviderEnvValue, resolveProviderWebSearchPluginConfig, withTrustedWebSearchEndpoint } from "openclaw/plugin-sdk/provider-web-search";
|
|
4
4
|
import { readPluginPackageVersion } from "openclaw/plugin-sdk/extension-shared";
|
|
5
5
|
import { ProviderHttpError, readProviderJsonResponse, readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
|
|
6
|
-
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
|
+
import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
|
|
8
8
|
import { redactSensitiveText } from "openclaw/plugin-sdk/security-runtime";
|
|
9
9
|
//#region extensions/parallel/src/parallel-web-search-provider.runtime.ts
|
|
@@ -13,10 +13,6 @@ const PARALLEL_ERROR_BODY_LIMIT_BYTES = 8192;
|
|
|
13
13
|
const PARALLEL_SEARCH_RESPONSE_LIMIT_BYTES = 16777216;
|
|
14
14
|
const require = createRequire(import.meta.url);
|
|
15
15
|
const USER_AGENT = `openclaw-parallel/${readPluginPackageVersion({ require })} (${process.platform})`;
|
|
16
|
-
function resolveParallelConfig(searchConfig) {
|
|
17
|
-
const parallel = searchConfig?.parallel;
|
|
18
|
-
return parallel && typeof parallel === "object" && !Array.isArray(parallel) ? parallel : {};
|
|
19
|
-
}
|
|
20
16
|
function resolveParallelApiKey(parallel) {
|
|
21
17
|
return readConfiguredSecretString(parallel?.apiKey, "plugins.entries.parallel.config.webSearch.apiKey") ?? readProviderEnvValue(["PARALLEL_API_KEY"]);
|
|
22
18
|
}
|
|
@@ -84,7 +80,7 @@ async function runParallelSearch(params) {
|
|
|
84
80
|
}
|
|
85
81
|
async function executeParallelWebSearchProviderTool(ctx, args, signal) {
|
|
86
82
|
const searchConfig = mergeScopedSearchConfig(ctx.searchConfig, "parallel", resolveProviderWebSearchPluginConfig(ctx.config, "parallel"));
|
|
87
|
-
const parallelConfig =
|
|
83
|
+
const parallelConfig = asOptionalRecord(searchConfig?.parallel);
|
|
88
84
|
const apiKey = resolveParallelApiKey(parallelConfig);
|
|
89
85
|
if (!apiKey) return missingParallelKeyPayload();
|
|
90
86
|
const endpointResult = resolveParallelSearchEndpoint(parallelConfig);
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as createParallelWebSearchProvider, t as createParallelFreeWebSearchProvider } from "./.setup/parallel-free-web-search-provider-
|
|
1
|
+
import { n as createParallelWebSearchProvider, t as createParallelFreeWebSearchProvider } from "./.setup/parallel-free-web-search-provider-DVjfPmlG.mjs";
|
|
2
2
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
3
3
|
//#region extensions/parallel/index.ts
|
|
4
4
|
var parallel_default = definePluginEntry({
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as createParallelWebSearchProvider, t as createParallelFreeWebSearchProvider } from "./.setup/parallel-free-web-search-provider-
|
|
1
|
+
import { n as createParallelWebSearchProvider, t as createParallelFreeWebSearchProvider } from "./.setup/parallel-free-web-search-provider-DVjfPmlG.mjs";
|
|
2
2
|
import "./web-search-provider.js";
|
|
3
3
|
export { createParallelFreeWebSearchProvider, createParallelWebSearchProvider };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as createParallelWebSearchProvider, t as createParallelFreeWebSearchProvider } from "./.setup/parallel-free-web-search-provider-
|
|
1
|
+
import { n as createParallelWebSearchProvider, t as createParallelFreeWebSearchProvider } from "./.setup/parallel-free-web-search-provider-DVjfPmlG.mjs";
|
|
2
2
|
export { createParallelFreeWebSearchProvider, createParallelWebSearchProvider };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/parallel-plugin",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.7",
|
|
4
4
|
"description": "OpenClaw Parallel web search plugin.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"minHostVersion": ">=2026.6.8"
|
|
19
19
|
},
|
|
20
20
|
"compat": {
|
|
21
|
-
"pluginApi": ">=2026.9.
|
|
21
|
+
"pluginApi": ">=2026.9.7"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.9.
|
|
24
|
+
"openclawVersion": "2026.9.7",
|
|
25
25
|
"bundledDist": false
|
|
26
26
|
},
|
|
27
27
|
"release": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"assets/activity.svg"
|
|
41
41
|
],
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"openclaw": ">=2026.9.
|
|
43
|
+
"openclaw": ">=2026.9.7"
|
|
44
44
|
},
|
|
45
45
|
"peerDependenciesMeta": {
|
|
46
46
|
"openclaw": {
|