@openclaw/parallel-plugin 2026.10.10 → 2026.11.5-beta.1

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,30 +1,5 @@
1
1
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
2
2
  import { createWebSearchProviderContractFields } from "openclaw/plugin-sdk/provider-web-search-contract";
3
- // extensions/parallel/src/parallel-free-web-search-provider.shared.ts
4
- const PARALLEL_FREE_ONBOARDING_SCOPES = ["text-inference"];
5
- function createParallelFreeWebSearchProviderBase() {
6
- return {
7
- id: "parallel-free",
8
- label: "Parallel Search (Free)",
9
- hint: "Free web search via Parallel's hosted Search MCP — no API key required",
10
- configPath: null,
11
- onboardingScopes: [...PARALLEL_FREE_ONBOARDING_SCOPES],
12
- requiresCredential: false,
13
- envVars: [],
14
- placeholder: "(no key needed)",
15
- signupUrl: "https://parallel.ai",
16
- docsUrl: "https://docs.openclaw.ai/tools/parallel-search",
17
- credentialPath: "",
18
- ...createWebSearchProviderContractFields({
19
- credentialPath: "",
20
- searchCredential: {
21
- type: "scoped",
22
- scopeId: "parallel-free"
23
- },
24
- selectionPluginId: "parallel"
25
- })
26
- };
27
- }
28
3
  // extensions/parallel/src/parallel-web-search-provider.ts
29
4
  const PARALLEL_CREDENTIAL_PATH = "plugins.entries.parallel.config.webSearch.apiKey";
30
5
  const PARALLEL_MAX_SEARCH_COUNT = 40;
@@ -33,7 +8,7 @@ const PARALLEL_MAX_SEARCH_QUERY_CHARS = 200;
33
8
  const PARALLEL_MAX_OBJECTIVE_CHARS = 5e3;
34
9
  const PARALLEL_MAX_SESSION_ID_CHARS = 1e3;
35
10
  const PARALLEL_MAX_CLIENT_MODEL_CHARS = 100;
36
- const loadParallelWebSearchRuntime = createLazyRuntimeModule(() => import("./parallel-web-search-provider.runtime-BrHDKFbc.mjs"));
11
+ const loadParallelWebSearchRuntime = createLazyRuntimeModule(() => import("./parallel-web-search-provider.runtime-DBqbm_5E.mjs"));
37
12
  const ParallelSearchSchema = {
38
13
  type: "object",
39
14
  properties: {
@@ -116,10 +91,28 @@ const ParallelFreeSearchSchema = {
116
91
  }
117
92
  }
118
93
  };
119
- const loadParallelFreeWebSearchRuntime = createLazyRuntimeModule(() => import("./parallel-free-web-search-provider.runtime-D1ws2w9J.mjs"));
94
+ const loadParallelFreeWebSearchRuntime = createLazyRuntimeModule(() => import("./parallel-free-web-search-provider.runtime-CMXl-P9_.mjs"));
120
95
  function createParallelFreeWebSearchProvider() {
121
96
  return {
122
- ...createParallelFreeWebSearchProviderBase(),
97
+ id: "parallel-free",
98
+ label: "Parallel Search (Free)",
99
+ hint: "Free web search via Parallel's hosted Search MCP — no API key required",
100
+ configPath: null,
101
+ onboardingScopes: ["text-inference"],
102
+ requiresCredential: false,
103
+ envVars: [],
104
+ placeholder: "(no key needed)",
105
+ signupUrl: "https://parallel.ai",
106
+ docsUrl: "https://docs.openclaw.ai/tools/parallel-search",
107
+ credentialPath: "",
108
+ ...createWebSearchProviderContractFields({
109
+ credentialPath: "",
110
+ searchCredential: {
111
+ type: "scoped",
112
+ scopeId: "parallel-free"
113
+ },
114
+ selectionPluginId: "parallel"
115
+ }),
123
116
  createTool: (ctx) => ({
124
117
  description: "Search the web using Parallel's free Search MCP (no API key). Returns ranked, LLM-optimized dense excerpts from web sources. Pass an `objective` describing the underlying question along with 2-3 short keyword `search_queries` (Parallel's recommended pairing). For multi-step research, thread the prior result's `sessionId` back in as `session_id` to keep Parallel's context grouped.",
125
118
  parameters: ParallelFreeSearchSchema,
@@ -1,15 +1,14 @@
1
- import { t as executeParallelSearchRequest } from "./parallel-search-normalize-BDJxllHh.mjs";
1
+ import { t as executeParallelSearchRequest } from "./parallel-search-normalize-BrENFe3e.mjs";
2
2
  import { createRequire } from "node:module";
3
- import { mergeScopedSearchConfig, resolveProviderWebSearchPluginConfig, withTrustedWebSearchEndpoint } from "openclaw/plugin-sdk/provider-web-search";
4
3
  import { randomUUID } from "node:crypto";
5
4
  import { readPluginPackageVersion } from "openclaw/plugin-sdk/extension-shared";
6
5
  import { ProviderHttpError, readProviderTextResponse, readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
6
+ import { mergeScopedSearchConfig, resolveProviderWebSearchPluginConfig, withTrustedWebSearchEndpoint } from "openclaw/plugin-sdk/provider-web-search";
7
7
  import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
8
- import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
9
- // extensions/parallel/src/parallel-mcp-search.runtime.ts
8
+ import { safeParseJson, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
9
+ // extensions/parallel/src/parallel-free-web-search-provider.runtime.ts
10
10
  const PARALLEL_MCP_SEARCH_URL = "https://search.parallel.ai/mcp";
11
11
  const MCP_PROTOCOL_VERSION = "2025-06-18";
12
- const MCP_TIMEOUT_SECONDS = 30;
13
12
  const PARALLEL_MCP_ERROR_BODY_LIMIT_BYTES = 8192;
14
13
  const require = createRequire(import.meta.url);
15
14
  const PLUGIN_VERSION = readPluginPackageVersion({ require });
@@ -27,12 +26,8 @@ function selectMcpEnvelope(text, requestId) {
27
26
  return message.id === requestId;
28
27
  };
29
28
  const selectPayload = (json) => {
30
- try {
31
- const payload = JSON.parse(json);
32
- return Array.isArray(payload) ? payload.some(selectMessage) : selectMessage(payload);
33
- } catch {
34
- return false;
35
- }
29
+ const payload = safeParseJson(json);
30
+ return Array.isArray(payload) ? payload.some(selectMessage) : selectMessage(payload);
36
31
  };
37
32
  const body = text.trim();
38
33
  if (!body) return envelope;
@@ -68,105 +63,12 @@ function extractMcpToolPayload(envelope) {
68
63
  if (result.isError) throw new Error(`Parallel MCP tool error: ${truncateUtf16Safe(JSON.stringify(result), 500)}`);
69
64
  if (isRecord(result.structuredContent)) return result.structuredContent;
70
65
  const content = Array.isArray(result.content) ? result.content : [];
71
- for (const block of content) if (isRecord(block) && block.type === "text" && typeof block.text === "string" && block.text) try {
72
- const parsed = JSON.parse(block.text);
66
+ for (const block of content) if (isRecord(block) && block.type === "text" && typeof block.text === "string" && block.text) {
67
+ const parsed = safeParseJson(block.text);
73
68
  if (isRecord(parsed)) return parsed;
74
- } catch {}
69
+ }
75
70
  throw new Error(`Parallel MCP returned no parseable content: ${truncateUtf16Safe(JSON.stringify(result), 500)}`);
76
71
  }
77
- async function postMcp(params) {
78
- return withTrustedWebSearchEndpoint({
79
- url: PARALLEL_MCP_SEARCH_URL,
80
- timeoutSeconds: params.timeoutSeconds,
81
- signal: params.signal,
82
- init: {
83
- method: "POST",
84
- headers: {
85
- "Content-Type": "application/json",
86
- "User-Agent": USER_AGENT,
87
- Accept: "application/json, text/event-stream",
88
- ...params.sessionId ? { "Mcp-Session-Id": params.sessionId } : {},
89
- ...params.protocolVersion ? { "MCP-Protocol-Version": params.protocolVersion } : {}
90
- },
91
- body: JSON.stringify(params.body)
92
- }
93
- }, async (response) => {
94
- if (!response.ok) {
95
- const detail = await readResponseTextLimited(response, PARALLEL_MCP_ERROR_BODY_LIMIT_BYTES);
96
- throw new ProviderHttpError(`Parallel MCP ${params.body.method} failed (${response.status}): ${detail || response.statusText}`, { status: response.status });
97
- }
98
- return {
99
- text: await readProviderTextResponse(response, "Parallel MCP"),
100
- sessionIdHeader: response.headers.get("mcp-session-id")
101
- };
102
- });
103
- }
104
- async function runParallelMcpSearch(params) {
105
- const sessionId = params.sessionId?.trim() || randomUUID();
106
- const timeoutSeconds = params.timeoutSeconds ?? MCP_TIMEOUT_SECONDS;
107
- const args = {
108
- objective: params.objective ?? params.searchQueries.join(" "),
109
- search_queries: [...params.searchQueries],
110
- session_id: sessionId
111
- };
112
- if (params.modelName) args.model_name = params.modelName;
113
- const initId = randomUUID();
114
- const init = await postMcp({
115
- timeoutSeconds,
116
- signal: params.signal,
117
- body: {
118
- jsonrpc: "2.0",
119
- id: initId,
120
- method: "initialize",
121
- params: {
122
- protocolVersion: MCP_PROTOCOL_VERSION,
123
- capabilities: {},
124
- clientInfo: {
125
- name: "openclaw-parallel",
126
- version: PLUGIN_VERSION
127
- }
128
- }
129
- }
130
- });
131
- const mcpSessionId = init.sessionIdHeader ?? void 0;
132
- const initEnvelope = selectMcpEnvelope(init.text, initId);
133
- const negotiatedVersion = (isRecord(initEnvelope.result) && typeof initEnvelope.result.protocolVersion === "string" ? initEnvelope.result.protocolVersion : void 0) ?? MCP_PROTOCOL_VERSION;
134
- await postMcp({
135
- body: {
136
- jsonrpc: "2.0",
137
- method: "notifications/initialized"
138
- },
139
- sessionId: mcpSessionId,
140
- protocolVersion: negotiatedVersion,
141
- timeoutSeconds,
142
- signal: params.signal
143
- });
144
- const callId = randomUUID();
145
- const payload = extractMcpToolPayload(selectMcpEnvelope((await postMcp({
146
- body: {
147
- jsonrpc: "2.0",
148
- id: callId,
149
- method: "tools/call",
150
- params: {
151
- name: "web_search",
152
- arguments: args
153
- }
154
- },
155
- sessionId: mcpSessionId,
156
- protocolVersion: negotiatedVersion,
157
- timeoutSeconds,
158
- signal: params.signal
159
- })).text, callId));
160
- const results = (Array.isArray(payload.results) ? payload.results : []).slice(0, Math.max(params.maxResults, 1));
161
- return {
162
- search_id: typeof payload.search_id === "string" ? payload.search_id : void 0,
163
- session_id: sessionId,
164
- results,
165
- warnings: payload.warnings,
166
- usage: payload.usage
167
- };
168
- }
169
- // extensions/parallel/src/parallel-free-web-search-provider.runtime.ts
170
72
  async function executeParallelFreeWebSearchProviderTool(ctx, args, signal) {
171
73
  signal?.throwIfAborted();
172
74
  const searchConfig = mergeScopedSearchConfig(ctx.searchConfig, "parallel-free", resolveProviderWebSearchPluginConfig(ctx.config, "parallel-free"));
@@ -175,14 +77,87 @@ async function executeParallelFreeWebSearchProviderTool(ctx, args, signal) {
175
77
  endpoint: PARALLEL_MCP_SEARCH_URL,
176
78
  args,
177
79
  searchConfig,
178
- signal,
179
- search: ({ count, clientModel, ...request }, timeoutSeconds) => runParallelMcpSearch({
180
- ...request,
181
- maxResults: count,
182
- modelName: clientModel,
183
- timeoutSeconds,
184
- signal
185
- })
80
+ search: async (request, timeoutSeconds) => {
81
+ const postMcp = (params) => withTrustedWebSearchEndpoint({
82
+ url: PARALLEL_MCP_SEARCH_URL,
83
+ timeoutSeconds,
84
+ signal,
85
+ init: {
86
+ method: "POST",
87
+ headers: {
88
+ "Content-Type": "application/json",
89
+ "User-Agent": USER_AGENT,
90
+ Accept: "application/json, text/event-stream",
91
+ ...params.sessionId ? { "Mcp-Session-Id": params.sessionId } : {},
92
+ ...params.protocolVersion ? { "MCP-Protocol-Version": params.protocolVersion } : {}
93
+ },
94
+ body: JSON.stringify(params.body)
95
+ }
96
+ }, async (response) => {
97
+ if (!response.ok) {
98
+ const detail = await readResponseTextLimited(response, PARALLEL_MCP_ERROR_BODY_LIMIT_BYTES);
99
+ throw new ProviderHttpError(`Parallel MCP ${params.body.method} failed (${response.status}): ${detail || response.statusText}`, { status: response.status });
100
+ }
101
+ return {
102
+ text: await readProviderTextResponse(response, "Parallel MCP"),
103
+ sessionIdHeader: response.headers.get("mcp-session-id")
104
+ };
105
+ });
106
+ const sessionId = request.sessionId?.trim() || randomUUID();
107
+ const searchArgs = {
108
+ objective: request.objective ?? request.searchQueries.join(" "),
109
+ search_queries: request.searchQueries,
110
+ session_id: sessionId
111
+ };
112
+ if (request.clientModel) searchArgs.model_name = request.clientModel;
113
+ const initId = randomUUID();
114
+ const init = await postMcp({ body: {
115
+ jsonrpc: "2.0",
116
+ id: initId,
117
+ method: "initialize",
118
+ params: {
119
+ protocolVersion: MCP_PROTOCOL_VERSION,
120
+ capabilities: {},
121
+ clientInfo: {
122
+ name: "openclaw-parallel",
123
+ version: PLUGIN_VERSION
124
+ }
125
+ }
126
+ } });
127
+ const mcpSessionId = init.sessionIdHeader ?? void 0;
128
+ const initEnvelope = selectMcpEnvelope(init.text, initId);
129
+ const negotiatedVersion = (isRecord(initEnvelope.result) && typeof initEnvelope.result.protocolVersion === "string" ? initEnvelope.result.protocolVersion : void 0) ?? MCP_PROTOCOL_VERSION;
130
+ await postMcp({
131
+ body: {
132
+ jsonrpc: "2.0",
133
+ method: "notifications/initialized"
134
+ },
135
+ sessionId: mcpSessionId,
136
+ protocolVersion: negotiatedVersion
137
+ });
138
+ const callId = randomUUID();
139
+ const payload = extractMcpToolPayload(selectMcpEnvelope((await postMcp({
140
+ body: {
141
+ jsonrpc: "2.0",
142
+ id: callId,
143
+ method: "tools/call",
144
+ params: {
145
+ name: "web_search",
146
+ arguments: searchArgs
147
+ }
148
+ },
149
+ sessionId: mcpSessionId,
150
+ protocolVersion: negotiatedVersion
151
+ })).text, callId));
152
+ const results = (Array.isArray(payload.results) ? payload.results : []).slice(0, Math.max(request.count, 1));
153
+ return {
154
+ search_id: typeof payload.search_id === "string" ? payload.search_id : void 0,
155
+ session_id: sessionId,
156
+ results,
157
+ warnings: payload.warnings,
158
+ usage: payload.usage
159
+ };
160
+ }
186
161
  });
187
162
  }
188
163
  export { executeParallelFreeWebSearchProviderTool };
@@ -1,7 +1,7 @@
1
- import "./parallel-free-web-search-provider-CentU_1l.mjs";
2
- import { DEFAULT_SEARCH_COUNT, buildSearchCacheKey, readCachedSearchPayload, readPositiveIntegerParam, readStringArrayParam, readStringParam, resolveSearchCacheTtlMs, resolveSearchTimeoutSeconds, resolveSiteName, wrapWebContent, writeCachedSearchPayload } from "openclaw/plugin-sdk/provider-web-search";
1
+ import { DEFAULT_SEARCH_COUNT, buildSearchCacheKey, externalContentStamp, readCachedSearchPayload, readPositiveIntegerParam, readStringArrayParam, readStringParam, resolveSearchCacheTtlMs, resolveSearchTimeoutSeconds, resolveSiteName, wrapWebContent, writeCachedSearchPayload } from "openclaw/plugin-sdk/provider-web-search";
3
2
  import { asOptionalObjectRecord, filterStringEntries, isRecord, normalizeBoundedOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
4
3
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
4
+ import { sha256Hex } from "openclaw/plugin-sdk/node-crypto-runtime";
5
5
  import { resolveIntegerOption } from "openclaw/plugin-sdk/number-runtime";
6
6
  // extensions/parallel/src/parallel-search-normalize.ts
7
7
  const PARALLEL_MAX_SEARCH_COUNT = 40;
@@ -10,46 +10,67 @@ const PARALLEL_MAX_OBJECTIVE_CHARS = 5e3;
10
10
  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
- function normalizeParallelSearchRequest(args, configuredCount, sessionIdMaxLength) {
13
+ async function executeParallelSearchRequest(params) {
14
+ const { args } = params;
15
+ const configuredCount = params.searchConfig?.maxResults;
14
16
  const objective = truncateUtf16Safe(readStringParam(args, "objective") ?? "", PARALLEL_MAX_OBJECTIVE_CHARS) || void 0;
15
17
  const cliQuery = truncateUtf16Safe(readStringParam(args, "query") ?? "", PARALLEL_MAX_OBJECTIVE_CHARS) || void 0;
16
18
  let searchQueries = normalizeParallelSearchQueries(readStringArrayParam(args, "search_queries"));
17
19
  if (searchQueries.length === 0 && cliQuery) searchQueries = normalizeParallelSearchQueries([cliQuery]);
18
- if (searchQueries.length === 0) return { error: invalidSearchQueriesPayload() };
19
- return {
20
+ if (searchQueries.length === 0) return {
21
+ error: "invalid_search_queries",
22
+ message: "search_queries must be a non-empty array of keyword strings (max 5, max 200 chars each). See https://docs.parallel.ai/search/best-practices.",
23
+ docs: "https://docs.openclaw.ai/tools/parallel-search"
24
+ };
25
+ const value = readPositiveIntegerParam(args, "count", {
26
+ max: PARALLEL_MAX_SEARCH_COUNT,
27
+ message: `count must be an integer from 1 to ${PARALLEL_MAX_SEARCH_COUNT}.`
28
+ }) ?? (typeof configuredCount === "number" ? configuredCount : DEFAULT_SEARCH_COUNT);
29
+ const request = {
20
30
  objective,
21
31
  searchQueries,
22
- count: resolveParallelSearchCount(args, configuredCount),
23
- sessionId: normalizeBoundedOptionalString(readStringParam(args, "session_id"), sessionIdMaxLength),
32
+ count: resolveIntegerOption(value, DEFAULT_SEARCH_COUNT, {
33
+ min: 1,
34
+ max: PARALLEL_MAX_SEARCH_COUNT
35
+ }),
36
+ sessionId: normalizeBoundedOptionalString(readStringParam(args, "session_id"), params.provider === "parallel" ? PARALLEL_SESSION_ID_MAX_LENGTH : 100),
24
37
  clientModel: truncateUtf16Safe(readStringParam(args, "client_model") ?? "", PARALLEL_CLIENT_MODEL_MAX_LENGTH) || void 0
25
38
  };
26
- }
27
- async function executeParallelSearchRequest(params) {
28
- const request = normalizeParallelSearchRequest(params.args, params.searchConfig?.maxResults, params.provider === "parallel" ? PARALLEL_SESSION_ID_MAX_LENGTH : 100);
29
- if ("error" in request) return request.error;
30
- const cacheKey = buildSearchCacheKey(["parallel", JSON.stringify({
31
- endpoint: params.endpoint,
32
- ...request
33
- })]);
39
+ const cacheKey = buildSearchCacheKey([
40
+ params.provider,
41
+ params.apiKey ? sha256Hex(params.apiKey) : void 0,
42
+ JSON.stringify({
43
+ endpoint: params.endpoint,
44
+ ...request
45
+ })
46
+ ]);
34
47
  const cacheTtlMs = resolveSearchCacheTtlMs(params.searchConfig);
35
48
  const cached = readCachedSearchPayload(cacheKey, cacheTtlMs);
36
49
  if (cached) return cached;
37
50
  const start = Date.now();
38
51
  const response = await params.search(request, resolveSearchTimeoutSeconds(params.searchConfig));
39
- params.signal?.throwIfAborted();
40
- const results = mapParallelResults(response, request.count);
52
+ const count = request.count;
53
+ const rawResults = asOptionalObjectRecord(response)?.results;
54
+ const results = (Array.isArray(rawResults) ? rawResults.filter(isRecord) : []).slice(0, count).map((entry) => {
55
+ const title = typeof entry.title === "string" ? entry.title : "";
56
+ const url = typeof entry.url === "string" ? entry.url : "";
57
+ const published = typeof entry.publish_date === "string" && entry.publish_date ? entry.publish_date : void 0;
58
+ const excerpts = filterStringEntries(entry.excerpts).map((e) => wrapWebContent(e, "web_search"));
59
+ const description = excerpts.join("\n\n");
60
+ return Object.assign({
61
+ title: title ? wrapWebContent(title, "web_search") : "",
62
+ url,
63
+ description,
64
+ siteName: resolveSiteName(url) || void 0
65
+ }, published ? { published } : {}, excerpts.length > 0 ? { excerpts } : {});
66
+ });
41
67
  const payload = {
42
68
  ...request.objective ? { objective: request.objective } : {},
43
69
  searchQueries: request.searchQueries,
44
70
  provider: params.provider,
45
71
  count: results.length,
46
72
  tookMs: Date.now() - start,
47
- externalContent: {
48
- untrusted: true,
49
- source: "web_search",
50
- provider: params.provider,
51
- wrapped: true
52
- },
73
+ externalContent: externalContentStamp(params.provider),
53
74
  results
54
75
  };
55
76
  if (typeof response.search_id === "string") payload.searchId = response.search_id;
@@ -61,16 +82,6 @@ async function executeParallelSearchRequest(params) {
61
82
  writeCachedSearchPayload(cacheKey, cachePayload, cacheTtlMs);
62
83
  return payload;
63
84
  }
64
- function resolveParallelSearchCount(args, configuredCount) {
65
- const value = readPositiveIntegerParam(args, "count", {
66
- max: PARALLEL_MAX_SEARCH_COUNT,
67
- message: `count must be an integer from 1 to ${PARALLEL_MAX_SEARCH_COUNT}.`
68
- }) ?? (typeof configuredCount === "number" ? configuredCount : DEFAULT_SEARCH_COUNT);
69
- return resolveIntegerOption(value, DEFAULT_SEARCH_COUNT, {
70
- min: 1,
71
- max: PARALLEL_MAX_SEARCH_COUNT
72
- });
73
- }
74
85
  function normalizeParallelSearchQueries(candidates = []) {
75
86
  const seen = /* @__PURE__ */ new Set();
76
87
  const out = [];
@@ -85,27 +96,4 @@ function normalizeParallelSearchQueries(candidates = []) {
85
96
  }
86
97
  return out;
87
98
  }
88
- function invalidSearchQueriesPayload() {
89
- return {
90
- error: "invalid_search_queries",
91
- message: "search_queries must be a non-empty array of keyword strings (max 5, max 200 chars each). See https://docs.parallel.ai/search/best-practices.",
92
- docs: "https://docs.openclaw.ai/tools/parallel-search"
93
- };
94
- }
95
- function mapParallelResults(response, count) {
96
- const rawResults = asOptionalObjectRecord(response)?.results;
97
- return (Array.isArray(rawResults) ? rawResults.filter(isRecord) : []).slice(0, count).map((entry) => {
98
- const title = typeof entry.title === "string" ? entry.title : "";
99
- const url = typeof entry.url === "string" ? entry.url : "";
100
- const published = typeof entry.publish_date === "string" && entry.publish_date ? entry.publish_date : void 0;
101
- const excerpts = filterStringEntries(entry.excerpts).map((e) => wrapWebContent(e, "web_search"));
102
- const description = excerpts.join("\n\n");
103
- return Object.assign({
104
- title: title ? wrapWebContent(title, "web_search") : "",
105
- url,
106
- description,
107
- siteName: resolveSiteName(url) || void 0
108
- }, published ? { published } : {}, excerpts.length > 0 ? { excerpts } : {});
109
- });
110
- }
111
99
  export { executeParallelSearchRequest as t };
@@ -1,8 +1,8 @@
1
- import { t as executeParallelSearchRequest } from "./parallel-search-normalize-BDJxllHh.mjs";
1
+ import { t as executeParallelSearchRequest } from "./parallel-search-normalize-BrENFe3e.mjs";
2
2
  import { createRequire } from "node:module";
3
- import { mergeScopedSearchConfig, readConfiguredSecretString, readProviderEnvValue, resolveProviderWebSearchPluginConfig, withTrustedWebSearchEndpoint } from "openclaw/plugin-sdk/provider-web-search";
4
3
  import { readPluginPackageVersion } from "openclaw/plugin-sdk/extension-shared";
5
4
  import { ProviderHttpError, readProviderJsonResponse, readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
5
+ import { mergeScopedSearchConfig, readWebSearchApiKey, resolveProviderWebSearchPluginConfig, withTrustedWebSearchEndpoint } from "openclaw/plugin-sdk/provider-web-search";
6
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";
@@ -13,9 +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 resolveParallelApiKey(parallel) {
17
- return readConfiguredSecretString(parallel?.apiKey, "plugins.entries.parallel.config.webSearch.apiKey") ?? readProviderEnvValue(["PARALLEL_API_KEY"]);
18
- }
19
16
  function invalidBaseUrlPayload() {
20
17
  return {
21
18
  error: "invalid_base_url",
@@ -23,44 +20,41 @@ function invalidBaseUrlPayload() {
23
20
  docs: "https://docs.openclaw.ai/tools/parallel-search"
24
21
  };
25
22
  }
26
- function resolveParallelSearchEndpoint(parallel) {
27
- const configured = normalizeOptionalString(parallel?.baseUrl);
28
- if (!configured) return { endpoint: `${PARALLEL_BASE_URL}${PARALLEL_SEARCH_PATHNAME}` };
29
- if (/^[a-z][a-z0-9+.-]*:\/\//i.test(configured) && !/^https?:\/\//i.test(configured)) return invalidBaseUrlPayload();
30
- const candidate = /^https?:\/\//i.test(configured) ? configured : `https://${configured}`;
31
- let parsed;
32
- try {
33
- parsed = new URL(candidate);
34
- } catch {
35
- return invalidBaseUrlPayload();
36
- }
37
- if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return invalidBaseUrlPayload();
38
- const pathname = parsed.pathname.replace(/\/+$/, "");
39
- parsed.pathname = pathname.endsWith(PARALLEL_SEARCH_PATHNAME) ? pathname : `${pathname}${PARALLEL_SEARCH_PATHNAME}`;
40
- parsed.hash = "";
41
- return { endpoint: parsed.toString() };
42
- }
43
23
  async function executeParallelWebSearchProviderTool(ctx, args, signal) {
44
24
  const searchConfig = mergeScopedSearchConfig(ctx.searchConfig, "parallel", resolveProviderWebSearchPluginConfig(ctx.config, "parallel"));
45
25
  const parallelConfig = asOptionalRecord(searchConfig?.parallel);
46
- const apiKey = resolveParallelApiKey(parallelConfig);
26
+ const apiKey = readWebSearchApiKey(parallelConfig?.apiKey, "plugins.entries.parallel.config.webSearch.apiKey", ["PARALLEL_API_KEY"]);
47
27
  if (!apiKey) return {
48
28
  error: "missing_parallel_api_key",
49
29
  message: "web_search (parallel) needs a Parallel API key. Set PARALLEL_API_KEY in the Gateway environment, or configure plugins.entries.parallel.config.webSearch.apiKey.",
50
30
  docs: "https://docs.openclaw.ai/tools/parallel-search"
51
31
  };
52
- const endpointResult = resolveParallelSearchEndpoint(parallelConfig);
53
- if ("error" in endpointResult) return endpointResult;
54
- const endpoint = endpointResult.endpoint;
32
+ let endpoint = `${PARALLEL_BASE_URL}${PARALLEL_SEARCH_PATHNAME}`;
33
+ const configured = normalizeOptionalString(parallelConfig?.baseUrl);
34
+ if (configured) {
35
+ if (/^[a-z][a-z0-9+.-]*:\/\//i.test(configured) && !/^https?:\/\//i.test(configured)) return invalidBaseUrlPayload();
36
+ const candidate = /^https?:\/\//i.test(configured) ? configured : `https://${configured}`;
37
+ let parsed;
38
+ try {
39
+ parsed = new URL(candidate);
40
+ } catch {
41
+ return invalidBaseUrlPayload();
42
+ }
43
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return invalidBaseUrlPayload();
44
+ const pathname = parsed.pathname.replace(/\/+$/, "");
45
+ parsed.pathname = pathname.endsWith(PARALLEL_SEARCH_PATHNAME) ? pathname : `${pathname}${PARALLEL_SEARCH_PATHNAME}`;
46
+ parsed.hash = "";
47
+ endpoint = parsed.toString();
48
+ }
55
49
  return executeParallelSearchRequest({
56
50
  provider: "parallel",
57
51
  endpoint,
52
+ apiKey,
58
53
  args,
59
54
  searchConfig,
60
- signal,
61
55
  search: async (request, timeoutSeconds) => {
62
56
  const body = {
63
- search_queries: [...request.searchQueries],
57
+ search_queries: request.searchQueries,
64
58
  advanced_settings: { max_results: request.count }
65
59
  };
66
60
  if (request.objective) body.objective = request.objective;
@@ -1 +1 @@
1
- {"version":3,"entries":[{"output":"index.js","source":"extensions/parallel/index.ts"},{"output":"web-search-contract-api.js","source":"extensions/parallel/web-search-contract-api.ts"},{"output":"web-search-provider.js","source":"extensions/parallel/web-search-provider.ts"}],"chunks":[{"output":".setup/parallel-free-web-search-provider-CentU_1l.mjs","sha256":"88457d7e1df4ae74e612bab60b82e8d1185f30d2624f6851808f9d69f225d388","facadeSource":null,"sources":["extensions/parallel/src/parallel-free-web-search-provider.shared.ts","extensions/parallel/src/parallel-free-web-search-provider.ts","extensions/parallel/src/parallel-web-search-provider.ts"]},{"output":".setup/parallel-free-web-search-provider.runtime-D1ws2w9J.mjs","sha256":"6ad9d4862748718c9770d201026dfc463d92426404b2ac807599e1a444e1c70e","facadeSource":"extensions/parallel/src/parallel-free-web-search-provider.runtime.ts","sources":["extensions/parallel/src/parallel-free-web-search-provider.runtime.ts","extensions/parallel/src/parallel-mcp-search.runtime.ts"]},{"output":".setup/parallel-search-normalize-BDJxllHh.mjs","sha256":"d6e1740ab7744b7bb61916f7ec07a4e7dc9a17aaf3a8ff5d3aa82c180efdde6f","facadeSource":null,"sources":["extensions/parallel/src/parallel-search-normalize.ts"]},{"output":".setup/parallel-web-search-provider.runtime-BrHDKFbc.mjs","sha256":"6d4703d46cc12c9d3c85f330025de115fbe57b21ab76b9d4a3cc5ef815b4544c","facadeSource":"extensions/parallel/src/parallel-web-search-provider.runtime.ts","sources":["extensions/parallel/src/parallel-web-search-provider.runtime.ts"]},{"output":"index.js","sha256":"c6ce7a79b16b2c549b57c26cda42479e5abf60829643ecd74e1212e030b1545b","facadeSource":"extensions/parallel/index.ts","sources":["extensions/parallel/index.ts"]},{"output":"web-search-contract-api.js","sha256":"7d0a101407f73a5c0627ab2e2853abaaac6ece8bc4f9f7b160cca1624f32a4b0","facadeSource":"extensions/parallel/web-search-contract-api.ts","sources":[]},{"output":"web-search-provider.js","sha256":"52993c92f11d3480a056eee967d9af27e23504a30ebb727440bd425772989c6f","facadeSource":"extensions/parallel/web-search-provider.ts","sources":[]}],"unrenderedSources":["extensions/parallel/web-search-contract-api.ts","extensions/parallel/web-search-provider.ts"]}
1
+ {"version":3,"entries":[{"output":"index.js","source":"extensions/parallel/index.ts"},{"output":"web-search-contract-api.js","source":"extensions/parallel/web-search-contract-api.ts"},{"output":"web-search-provider.js","source":"extensions/parallel/web-search-provider.ts"}],"chunks":[{"output":".setup/parallel-free-web-search-provider-DnVb3-FA.mjs","sha256":"50ca3c983c915340a1cccf6e3f731502f24cf8dd0bd2e77d369952e08a72349e","facadeSource":null,"sources":["extensions/parallel/src/parallel-free-web-search-provider.ts","extensions/parallel/src/parallel-web-search-provider.ts"]},{"output":".setup/parallel-free-web-search-provider.runtime-CMXl-P9_.mjs","sha256":"c0ed1a05a7c063f690172172da94a07049774d17f8cc293a826ccf1a37c6995d","facadeSource":"extensions/parallel/src/parallel-free-web-search-provider.runtime.ts","sources":["extensions/parallel/src/parallel-free-web-search-provider.runtime.ts"]},{"output":".setup/parallel-search-normalize-BrENFe3e.mjs","sha256":"75804d098e4de2319926560d0f6a8b4661dceddf9169732a617da2a1632a15b9","facadeSource":null,"sources":["extensions/parallel/src/parallel-search-normalize.ts"]},{"output":".setup/parallel-web-search-provider.runtime-DBqbm_5E.mjs","sha256":"272465c1b9afde395f13044e015d5c33e8aea59d7f6ce13457294be8dd9286a8","facadeSource":"extensions/parallel/src/parallel-web-search-provider.runtime.ts","sources":["extensions/parallel/src/parallel-web-search-provider.runtime.ts"]},{"output":"index.js","sha256":"04a8488597e26dc99fe22a9a54536d3d81c71989ba427cedc6a270a523f7ddbc","facadeSource":"extensions/parallel/index.ts","sources":["extensions/parallel/index.ts"]},{"output":"web-search-contract-api.js","sha256":"225e1be3f34f33b1373595112e615f9a2ae3043f9a6d5ad02aec98bb02c5f206","facadeSource":"extensions/parallel/web-search-contract-api.ts","sources":[]},{"output":"web-search-provider.js","sha256":"fb1bf1347039d21b505e32b11392d5d18a57d643080df9ab87caea684c9be5db","facadeSource":"extensions/parallel/web-search-provider.ts","sources":[]}],"unrenderedSources":["extensions/parallel/src/parallel-free-web-search-provider.shared.ts","extensions/parallel/web-search-contract-api.ts","extensions/parallel/web-search-provider.ts"]}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as createParallelWebSearchProvider, t as createParallelFreeWebSearchProvider } from "./.setup/parallel-free-web-search-provider-CentU_1l.mjs";
1
+ import { n as createParallelWebSearchProvider, t as createParallelFreeWebSearchProvider } from "./.setup/parallel-free-web-search-provider-DnVb3-FA.mjs";
2
2
  import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
3
3
  // extensions/parallel/index.ts
4
4
  var parallel_default = definePluginEntry({
@@ -1,2 +1,2 @@
1
- export { t as createParallelFreeWebSearchProvider, n as createParallelWebSearchProvider } from "./.setup/parallel-free-web-search-provider-CentU_1l.mjs";
1
+ export { t as createParallelFreeWebSearchProvider, n as createParallelWebSearchProvider } from "./.setup/parallel-free-web-search-provider-DnVb3-FA.mjs";
2
2
  import "./web-search-provider.js";
@@ -1 +1 @@
1
- export { t as createParallelFreeWebSearchProvider, n as createParallelWebSearchProvider } from "./.setup/parallel-free-web-search-provider-CentU_1l.mjs";
1
+ export { t as createParallelFreeWebSearchProvider, n as createParallelWebSearchProvider } from "./.setup/parallel-free-web-search-provider-DnVb3-FA.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/parallel-plugin",
3
- "version": "2026.10.10",
3
+ "version": "2026.11.5-beta.1",
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.10.10"
21
+ "pluginApi": ">=2026.11.5-beta.1"
22
22
  },
23
23
  "build": {
24
- "openclawVersion": "2026.10.10",
24
+ "openclawVersion": "2026.11.5-beta.1",
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.10.10"
43
+ "openclaw": ">=2026.11.5-beta.1"
44
44
  },
45
45
  "peerDependenciesMeta": {
46
46
  "openclaw": {