@openclaw/parallel-plugin 2026.8.1-beta.2 → 2026.8.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.
- package/dist/index.js +1 -1
- package/dist/parallel-free-web-search-provider-weJmjf0l.js +143 -0
- package/dist/{parallel-free-web-search-provider.runtime-GADQUUdb.js → parallel-free-web-search-provider.runtime-DpvSr6qo.js} +14 -31
- package/dist/{parallel-free-web-search-provider-D8jM25mS.js → parallel-search-normalize-BJmTyL0x.js} +37 -102
- package/dist/{parallel-web-search-provider.runtime-d551Asbw.js → parallel-web-search-provider.runtime-CTeePwJU.js} +19 -37
- package/dist/web-search-contract-api.js +2 -15
- package/dist/web-search-provider.js +1 -1
- package/package.json +4 -4
- package/dist/parallel-web-search-provider.shared-B8yrY1oc.js +0 -55
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as createParallelWebSearchProvider, t as createParallelFreeWebSearchProvider } from "./parallel-free-web-search-provider-
|
|
1
|
+
import { n as createParallelWebSearchProvider, t as createParallelFreeWebSearchProvider } from "./parallel-free-web-search-provider-weJmjf0l.js";
|
|
2
2
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
3
3
|
//#region extensions/parallel/index.ts
|
|
4
4
|
var parallel_default = definePluginEntry({
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
2
|
+
import { createWebSearchProviderContractFields } from "openclaw/plugin-sdk/provider-web-search-contract";
|
|
3
|
+
//#region 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
|
+
onboardingScopes: [...PARALLEL_FREE_ONBOARDING_SCOPES],
|
|
11
|
+
requiresCredential: false,
|
|
12
|
+
envVars: [],
|
|
13
|
+
placeholder: "(no key needed)",
|
|
14
|
+
signupUrl: "https://parallel.ai",
|
|
15
|
+
docsUrl: "https://docs.openclaw.ai/tools/parallel-search",
|
|
16
|
+
credentialPath: "",
|
|
17
|
+
...createWebSearchProviderContractFields({
|
|
18
|
+
credentialPath: "",
|
|
19
|
+
searchCredential: {
|
|
20
|
+
type: "scoped",
|
|
21
|
+
scopeId: "parallel-free"
|
|
22
|
+
},
|
|
23
|
+
selectionPluginId: "parallel"
|
|
24
|
+
})
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region extensions/parallel/src/parallel-web-search-provider.shared.ts
|
|
29
|
+
const PARALLEL_CREDENTIAL_PATH = "plugins.entries.parallel.config.webSearch.apiKey";
|
|
30
|
+
const PARALLEL_ONBOARDING_SCOPES = ["text-inference"];
|
|
31
|
+
function createParallelWebSearchProviderBase() {
|
|
32
|
+
return {
|
|
33
|
+
id: "parallel",
|
|
34
|
+
label: "Parallel Search",
|
|
35
|
+
hint: "LLM-optimized dense excerpts from web sources",
|
|
36
|
+
onboardingScopes: [...PARALLEL_ONBOARDING_SCOPES],
|
|
37
|
+
credentialLabel: "Parallel API key",
|
|
38
|
+
envVars: ["PARALLEL_API_KEY"],
|
|
39
|
+
placeholder: "par-...",
|
|
40
|
+
signupUrl: "https://platform.parallel.ai",
|
|
41
|
+
docsUrl: "https://docs.openclaw.ai/tools/parallel-search",
|
|
42
|
+
autoDetectOrder: 75,
|
|
43
|
+
credentialPath: PARALLEL_CREDENTIAL_PATH,
|
|
44
|
+
...createWebSearchProviderContractFields({
|
|
45
|
+
credentialPath: PARALLEL_CREDENTIAL_PATH,
|
|
46
|
+
searchCredential: {
|
|
47
|
+
type: "scoped",
|
|
48
|
+
scopeId: "parallel"
|
|
49
|
+
},
|
|
50
|
+
configuredCredential: { pluginId: "parallel" },
|
|
51
|
+
selectionPluginId: "parallel"
|
|
52
|
+
})
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region extensions/parallel/src/parallel-web-search-provider.ts
|
|
57
|
+
const PARALLEL_MAX_SEARCH_COUNT = 40;
|
|
58
|
+
const PARALLEL_MAX_SEARCH_QUERIES = 5;
|
|
59
|
+
const PARALLEL_MAX_SEARCH_QUERY_CHARS = 200;
|
|
60
|
+
const PARALLEL_MAX_OBJECTIVE_CHARS = 5e3;
|
|
61
|
+
const PARALLEL_MAX_SESSION_ID_CHARS = 1e3;
|
|
62
|
+
const PARALLEL_MAX_CLIENT_MODEL_CHARS = 100;
|
|
63
|
+
const loadParallelWebSearchRuntime = createLazyRuntimeModule(() => import("./parallel-web-search-provider.runtime-CTeePwJU.js"));
|
|
64
|
+
const ParallelSearchSchema = {
|
|
65
|
+
type: "object",
|
|
66
|
+
properties: {
|
|
67
|
+
objective: {
|
|
68
|
+
type: "string",
|
|
69
|
+
description: "Natural-language description of the underlying question or goal driving the search. Should be self-contained with enough context to understand the intent. Used together with search_queries to focus results on the most relevant content.",
|
|
70
|
+
maxLength: PARALLEL_MAX_OBJECTIVE_CHARS
|
|
71
|
+
},
|
|
72
|
+
search_queries: {
|
|
73
|
+
type: "array",
|
|
74
|
+
description: "Concise keyword search queries, 3-6 words each. Provide 2-3 diverse queries for best results (max 5). Vary entity names, synonyms, and angles. Each query is a keyword phrase, not a sentence; do not use site: operators.",
|
|
75
|
+
items: {
|
|
76
|
+
type: "string",
|
|
77
|
+
maxLength: PARALLEL_MAX_SEARCH_QUERY_CHARS
|
|
78
|
+
},
|
|
79
|
+
minItems: 1,
|
|
80
|
+
maxItems: PARALLEL_MAX_SEARCH_QUERIES
|
|
81
|
+
},
|
|
82
|
+
count: {
|
|
83
|
+
type: "integer",
|
|
84
|
+
description: "Number of results to return (1-40).",
|
|
85
|
+
minimum: 1,
|
|
86
|
+
maximum: PARALLEL_MAX_SEARCH_COUNT
|
|
87
|
+
},
|
|
88
|
+
session_id: {
|
|
89
|
+
type: "string",
|
|
90
|
+
description: "Optional session id returned by an earlier Parallel search. Pass it on follow-up searches that are part of the same task to keep Parallel's server-side context grouped (look for `sessionId` in the prior tool result).",
|
|
91
|
+
maxLength: PARALLEL_MAX_SESSION_ID_CHARS
|
|
92
|
+
},
|
|
93
|
+
client_model: {
|
|
94
|
+
type: "string",
|
|
95
|
+
description: "The identifier of the LLM model making this tool call (e.g. 'claude-opus-4-7', 'gpt-5.6-sol', 'gemini-3.1-pro'). Pass the exact active model slug verbatim; never shorten or substitute a family alias like 'gpt-5'. Lets Parallel tailor default settings for your model's capabilities.",
|
|
96
|
+
maxLength: PARALLEL_MAX_CLIENT_MODEL_CHARS
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
required: ["objective", "search_queries"],
|
|
100
|
+
additionalProperties: false
|
|
101
|
+
};
|
|
102
|
+
function createParallelWebSearchProvider() {
|
|
103
|
+
return {
|
|
104
|
+
...createParallelWebSearchProviderBase(),
|
|
105
|
+
createTool: (ctx) => ({
|
|
106
|
+
description: "Search the web using Parallel. 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.",
|
|
107
|
+
parameters: ParallelSearchSchema,
|
|
108
|
+
execute: async (args, context) => {
|
|
109
|
+
context?.signal?.throwIfAborted();
|
|
110
|
+
const { executeParallelWebSearchProviderTool } = await loadParallelWebSearchRuntime();
|
|
111
|
+
return await executeParallelWebSearchProviderTool(ctx, args, context?.signal);
|
|
112
|
+
}
|
|
113
|
+
})
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region extensions/parallel/src/parallel-free-web-search-provider.ts
|
|
118
|
+
const ParallelFreeSearchSchema = {
|
|
119
|
+
...ParallelSearchSchema,
|
|
120
|
+
properties: {
|
|
121
|
+
...ParallelSearchSchema.properties,
|
|
122
|
+
session_id: {
|
|
123
|
+
...ParallelSearchSchema.properties.session_id,
|
|
124
|
+
maxLength: 100
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
const loadParallelFreeWebSearchRuntime = createLazyRuntimeModule(() => import("./parallel-free-web-search-provider.runtime-DpvSr6qo.js"));
|
|
129
|
+
function createParallelFreeWebSearchProvider() {
|
|
130
|
+
return {
|
|
131
|
+
...createParallelFreeWebSearchProviderBase(),
|
|
132
|
+
createTool: (ctx) => ({
|
|
133
|
+
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.",
|
|
134
|
+
parameters: ParallelFreeSearchSchema,
|
|
135
|
+
execute: async (args, context) => {
|
|
136
|
+
const { executeParallelFreeWebSearchProviderTool } = await loadParallelFreeWebSearchRuntime();
|
|
137
|
+
return await executeParallelFreeWebSearchProviderTool(ctx, args, context?.signal);
|
|
138
|
+
}
|
|
139
|
+
})
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
//#endregion
|
|
143
|
+
export { createParallelWebSearchProvider as n, createParallelFreeWebSearchProvider as t };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as executeParallelSearchRequest } from "./parallel-search-normalize-BJmTyL0x.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
|
-
import { mergeScopedSearchConfig,
|
|
4
|
-
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
|
-
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
3
|
+
import { mergeScopedSearchConfig, resolveProviderWebSearchPluginConfig, withTrustedWebSearchEndpoint } from "openclaw/plugin-sdk/provider-web-search";
|
|
6
4
|
import { randomUUID } from "node:crypto";
|
|
7
5
|
import { readPluginPackageVersion } from "openclaw/plugin-sdk/extension-shared";
|
|
8
6
|
import { readProviderTextResponse, readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
|
|
7
|
+
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
|
+
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
9
9
|
//#region extensions/parallel/src/parallel-mcp-search.runtime.ts
|
|
10
10
|
const PARALLEL_MCP_SEARCH_URL = "https://search.parallel.ai/mcp";
|
|
11
11
|
const MCP_PROTOCOL_VERSION = "2025-06-18";
|
|
@@ -208,38 +208,21 @@ async function runParallelMcpSearch(params) {
|
|
|
208
208
|
//#endregion
|
|
209
209
|
//#region extensions/parallel/src/parallel-free-web-search-provider.runtime.ts
|
|
210
210
|
async function executeParallelFreeWebSearchProviderTool(ctx, args, signal) {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
if ("error" in request) return request.error;
|
|
214
|
-
const { objective, searchQueries, count, sessionId, clientModel } = request;
|
|
215
|
-
const cacheKey = buildParallelCacheKey({
|
|
216
|
-
endpoint: PARALLEL_MCP_SEARCH_URL,
|
|
217
|
-
objective,
|
|
218
|
-
searchQueries,
|
|
219
|
-
count,
|
|
220
|
-
sessionId,
|
|
221
|
-
clientModel
|
|
222
|
-
});
|
|
223
|
-
const cached = readCachedSearchPayload(cacheKey);
|
|
224
|
-
if (cached) return cached;
|
|
225
|
-
const start = Date.now();
|
|
226
|
-
const payload = buildParallelSearchPayload({
|
|
211
|
+
signal?.throwIfAborted();
|
|
212
|
+
return executeParallelSearchRequest({
|
|
227
213
|
provider: "parallel-free",
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
214
|
+
endpoint: PARALLEL_MCP_SEARCH_URL,
|
|
215
|
+
args,
|
|
216
|
+
searchConfig: mergeScopedSearchConfig(ctx.searchConfig, "parallel-free", resolveProviderWebSearchPluginConfig(ctx.config, "parallel-free")),
|
|
217
|
+
signal,
|
|
218
|
+
search: ({ count, clientModel, ...request }, timeoutSeconds) => runParallelMcpSearch({
|
|
219
|
+
...request,
|
|
233
220
|
maxResults: count,
|
|
234
|
-
sessionId,
|
|
235
221
|
modelName: clientModel,
|
|
236
|
-
timeoutSeconds
|
|
222
|
+
timeoutSeconds,
|
|
237
223
|
signal
|
|
238
|
-
})
|
|
239
|
-
start
|
|
224
|
+
})
|
|
240
225
|
});
|
|
241
|
-
writeCachedSearchPayload(cacheKey, sessionId ? payload : stripParallelGeneratedSessionId(payload), resolveSearchCacheTtlMs(searchConfig));
|
|
242
|
-
return payload;
|
|
243
226
|
}
|
|
244
227
|
//#endregion
|
|
245
228
|
export { executeParallelFreeWebSearchProviderTool };
|
package/dist/{parallel-free-web-search-provider-D8jM25mS.js → parallel-search-normalize-BJmTyL0x.js}
RENAMED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { resolveIntegerOption } from "openclaw/plugin-sdk/number-runtime";
|
|
4
|
-
import { DEFAULT_SEARCH_COUNT, buildSearchCacheKey, readPositiveIntegerParam, readStringArrayParam, readStringParam, resolveSiteName, wrapWebContent } from "openclaw/plugin-sdk/provider-web-search";
|
|
1
|
+
import "./parallel-free-web-search-provider-weJmjf0l.js";
|
|
2
|
+
import { DEFAULT_SEARCH_COUNT, buildSearchCacheKey, readCachedSearchPayload, readPositiveIntegerParam, readStringArrayParam, readStringParam, resolveSearchCacheTtlMs, resolveSearchTimeoutSeconds, resolveSiteName, wrapWebContent, writeCachedSearchPayload } from "openclaw/plugin-sdk/provider-web-search";
|
|
5
3
|
import { normalizeBoundedOptionalString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
4
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
5
|
+
import { resolveIntegerOption } from "openclaw/plugin-sdk/number-runtime";
|
|
7
6
|
//#region extensions/parallel/src/parallel-search-normalize.ts
|
|
8
|
-
const PARALLEL_MAX_SEARCH_COUNT
|
|
9
|
-
const PARALLEL_MAX_SEARCH_QUERY_CHARS
|
|
10
|
-
const PARALLEL_MAX_OBJECTIVE_CHARS
|
|
11
|
-
const PARALLEL_MAX_SEARCH_QUERIES
|
|
7
|
+
const PARALLEL_MAX_SEARCH_COUNT = 40;
|
|
8
|
+
const PARALLEL_MAX_SEARCH_QUERY_CHARS = 200;
|
|
9
|
+
const PARALLEL_MAX_OBJECTIVE_CHARS = 5e3;
|
|
10
|
+
const PARALLEL_MAX_SEARCH_QUERIES = 5;
|
|
12
11
|
const PARALLEL_SESSION_ID_MAX_LENGTH = 1e3;
|
|
13
12
|
const PARALLEL_CLIENT_MODEL_MAX_LENGTH = 100;
|
|
14
13
|
const normalizeParallelSessionId = normalizeBoundedOptionalString;
|
|
@@ -26,19 +25,42 @@ function normalizeParallelSearchRequest(args, configuredCount, sessionIdMaxLengt
|
|
|
26
25
|
clientModel: normalizeParallelClientModel(readStringParam(args, "client_model"))
|
|
27
26
|
};
|
|
28
27
|
}
|
|
28
|
+
async function executeParallelSearchRequest(params) {
|
|
29
|
+
const request = normalizeParallelSearchRequest(params.args, params.searchConfig?.maxResults, params.provider === "parallel" ? PARALLEL_SESSION_ID_MAX_LENGTH : 100);
|
|
30
|
+
if ("error" in request) return request.error;
|
|
31
|
+
const cacheKey = buildParallelCacheKey({
|
|
32
|
+
endpoint: params.endpoint,
|
|
33
|
+
...request
|
|
34
|
+
});
|
|
35
|
+
const cacheTtlMs = resolveSearchCacheTtlMs(params.searchConfig);
|
|
36
|
+
const cached = readCachedSearchPayload(cacheKey, cacheTtlMs);
|
|
37
|
+
if (cached) return cached;
|
|
38
|
+
const start = Date.now();
|
|
39
|
+
const response = await params.search(request, resolveSearchTimeoutSeconds(params.searchConfig));
|
|
40
|
+
params.signal?.throwIfAborted();
|
|
41
|
+
const payload = buildParallelSearchPayload({
|
|
42
|
+
provider: params.provider,
|
|
43
|
+
objective: request.objective,
|
|
44
|
+
searchQueries: request.searchQueries,
|
|
45
|
+
response,
|
|
46
|
+
start
|
|
47
|
+
});
|
|
48
|
+
writeCachedSearchPayload(cacheKey, request.sessionId ? payload : stripParallelGeneratedSessionId(payload), cacheTtlMs);
|
|
49
|
+
return payload;
|
|
50
|
+
}
|
|
29
51
|
function resolveParallelSearchCount(args, configuredCount) {
|
|
30
52
|
return resolveIntegerOption(readPositiveIntegerParam(args, "count", {
|
|
31
|
-
max: PARALLEL_MAX_SEARCH_COUNT
|
|
32
|
-
message: `count must be an integer from 1 to ${PARALLEL_MAX_SEARCH_COUNT
|
|
53
|
+
max: PARALLEL_MAX_SEARCH_COUNT,
|
|
54
|
+
message: `count must be an integer from 1 to ${PARALLEL_MAX_SEARCH_COUNT}.`
|
|
33
55
|
}) ?? (typeof configuredCount === "number" ? configuredCount : DEFAULT_SEARCH_COUNT), DEFAULT_SEARCH_COUNT, {
|
|
34
56
|
min: 1,
|
|
35
|
-
max: PARALLEL_MAX_SEARCH_COUNT
|
|
57
|
+
max: PARALLEL_MAX_SEARCH_COUNT
|
|
36
58
|
});
|
|
37
59
|
}
|
|
38
60
|
function normalizeParallelObjective(value) {
|
|
39
61
|
const trimmed = normalizeOptionalString(value);
|
|
40
62
|
if (!trimmed) return;
|
|
41
|
-
return trimmed.length <= PARALLEL_MAX_OBJECTIVE_CHARS
|
|
63
|
+
return trimmed.length <= PARALLEL_MAX_OBJECTIVE_CHARS ? trimmed : truncateUtf16Safe(trimmed, PARALLEL_MAX_OBJECTIVE_CHARS);
|
|
42
64
|
}
|
|
43
65
|
function normalizeParallelClientModel(value) {
|
|
44
66
|
const trimmed = normalizeOptionalString(value);
|
|
@@ -53,11 +75,11 @@ function normalizeParallelSearchQueries(value) {
|
|
|
53
75
|
if (typeof entry !== "string") continue;
|
|
54
76
|
const trimmed = entry.trim();
|
|
55
77
|
if (!trimmed) continue;
|
|
56
|
-
const capped = trimmed.length <= PARALLEL_MAX_SEARCH_QUERY_CHARS
|
|
78
|
+
const capped = trimmed.length <= PARALLEL_MAX_SEARCH_QUERY_CHARS ? trimmed : truncateUtf16Safe(trimmed, PARALLEL_MAX_SEARCH_QUERY_CHARS);
|
|
57
79
|
if (seen.has(capped)) continue;
|
|
58
80
|
seen.add(capped);
|
|
59
81
|
out.push(capped);
|
|
60
|
-
if (out.length === PARALLEL_MAX_SEARCH_QUERIES
|
|
82
|
+
if (out.length === PARALLEL_MAX_SEARCH_QUERIES) break;
|
|
61
83
|
}
|
|
62
84
|
return out;
|
|
63
85
|
}
|
|
@@ -134,91 +156,4 @@ function buildParallelCacheKey(params) {
|
|
|
134
156
|
]);
|
|
135
157
|
}
|
|
136
158
|
//#endregion
|
|
137
|
-
|
|
138
|
-
const PARALLEL_MAX_SEARCH_COUNT = 40;
|
|
139
|
-
const PARALLEL_MAX_SEARCH_QUERIES = 5;
|
|
140
|
-
const PARALLEL_MAX_SEARCH_QUERY_CHARS = 200;
|
|
141
|
-
const PARALLEL_MAX_OBJECTIVE_CHARS = 5e3;
|
|
142
|
-
const PARALLEL_MAX_SESSION_ID_CHARS = 1e3;
|
|
143
|
-
const PARALLEL_MAX_CLIENT_MODEL_CHARS = 100;
|
|
144
|
-
const loadParallelWebSearchRuntime = createLazyRuntimeModule(() => import("./parallel-web-search-provider.runtime-d551Asbw.js"));
|
|
145
|
-
const ParallelSearchSchema = {
|
|
146
|
-
type: "object",
|
|
147
|
-
properties: {
|
|
148
|
-
objective: {
|
|
149
|
-
type: "string",
|
|
150
|
-
description: "Natural-language description of the underlying question or goal driving the search. Should be self-contained with enough context to understand the intent. Used together with search_queries to focus results on the most relevant content.",
|
|
151
|
-
maxLength: PARALLEL_MAX_OBJECTIVE_CHARS
|
|
152
|
-
},
|
|
153
|
-
search_queries: {
|
|
154
|
-
type: "array",
|
|
155
|
-
description: "Concise keyword search queries, 3-6 words each. Provide 2-3 diverse queries for best results (max 5). Vary entity names, synonyms, and angles. Each query is a keyword phrase, not a sentence; do not use site: operators.",
|
|
156
|
-
items: {
|
|
157
|
-
type: "string",
|
|
158
|
-
maxLength: PARALLEL_MAX_SEARCH_QUERY_CHARS
|
|
159
|
-
},
|
|
160
|
-
minItems: 1,
|
|
161
|
-
maxItems: PARALLEL_MAX_SEARCH_QUERIES
|
|
162
|
-
},
|
|
163
|
-
count: {
|
|
164
|
-
type: "integer",
|
|
165
|
-
description: "Number of results to return (1-40).",
|
|
166
|
-
minimum: 1,
|
|
167
|
-
maximum: PARALLEL_MAX_SEARCH_COUNT
|
|
168
|
-
},
|
|
169
|
-
session_id: {
|
|
170
|
-
type: "string",
|
|
171
|
-
description: "Optional session id returned by an earlier Parallel search. Pass it on follow-up searches that are part of the same task to keep Parallel's server-side context grouped (look for `sessionId` in the prior tool result).",
|
|
172
|
-
maxLength: PARALLEL_MAX_SESSION_ID_CHARS
|
|
173
|
-
},
|
|
174
|
-
client_model: {
|
|
175
|
-
type: "string",
|
|
176
|
-
description: "The identifier of the LLM model making this tool call (e.g. 'claude-opus-4-7', 'gpt-5.6-sol', 'gemini-3.1-pro'). Pass the exact active model slug verbatim; never shorten or substitute a family alias like 'gpt-5'. Lets Parallel tailor default settings for your model's capabilities.",
|
|
177
|
-
maxLength: PARALLEL_MAX_CLIENT_MODEL_CHARS
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
required: ["objective", "search_queries"],
|
|
181
|
-
additionalProperties: false
|
|
182
|
-
};
|
|
183
|
-
function createParallelWebSearchProvider() {
|
|
184
|
-
return {
|
|
185
|
-
...createParallelWebSearchProviderBase(),
|
|
186
|
-
createTool: (ctx) => ({
|
|
187
|
-
description: "Search the web using Parallel. 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.",
|
|
188
|
-
parameters: ParallelSearchSchema,
|
|
189
|
-
execute: async (args, context) => {
|
|
190
|
-
context?.signal?.throwIfAborted();
|
|
191
|
-
const { executeParallelWebSearchProviderTool } = await loadParallelWebSearchRuntime();
|
|
192
|
-
return await executeParallelWebSearchProviderTool(ctx, args, context?.signal);
|
|
193
|
-
}
|
|
194
|
-
})
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
//#endregion
|
|
198
|
-
//#region extensions/parallel/src/parallel-free-web-search-provider.ts
|
|
199
|
-
const ParallelFreeSearchSchema = {
|
|
200
|
-
...ParallelSearchSchema,
|
|
201
|
-
properties: {
|
|
202
|
-
...ParallelSearchSchema.properties,
|
|
203
|
-
session_id: {
|
|
204
|
-
...ParallelSearchSchema.properties.session_id,
|
|
205
|
-
maxLength: 100
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
};
|
|
209
|
-
const loadParallelFreeWebSearchRuntime = createLazyRuntimeModule(() => import("./parallel-free-web-search-provider.runtime-GADQUUdb.js"));
|
|
210
|
-
function createParallelFreeWebSearchProvider() {
|
|
211
|
-
return {
|
|
212
|
-
...createParallelFreeWebSearchProviderBase(),
|
|
213
|
-
createTool: (ctx) => ({
|
|
214
|
-
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.",
|
|
215
|
-
parameters: ParallelFreeSearchSchema,
|
|
216
|
-
execute: async (args, context) => {
|
|
217
|
-
const { executeParallelFreeWebSearchProviderTool } = await loadParallelFreeWebSearchRuntime();
|
|
218
|
-
return await executeParallelFreeWebSearchProviderTool(ctx, args, context?.signal);
|
|
219
|
-
}
|
|
220
|
-
})
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
//#endregion
|
|
224
|
-
export { buildParallelSearchPayload as a, normalizeParallelResults as c, normalizeParallelSessionId as d, resolveParallelSearchCount as f, buildParallelCacheKey as i, normalizeParallelSearchQueries as l, createParallelWebSearchProvider as n, normalizeParallelClientModel as o, stripParallelGeneratedSessionId as p, PARALLEL_SESSION_ID_MAX_LENGTH as r, normalizeParallelObjective as s, createParallelFreeWebSearchProvider as t, normalizeParallelSearchRequest as u };
|
|
159
|
+
export { normalizeParallelResults as a, resolveParallelSearchCount as c, normalizeParallelObjective as i, executeParallelSearchRequest as n, normalizeParallelSearchQueries as o, normalizeParallelClientModel as r, normalizeParallelSessionId as s, buildParallelCacheKey as t };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as normalizeParallelResults, c as resolveParallelSearchCount, i as normalizeParallelObjective, n as executeParallelSearchRequest, o as normalizeParallelSearchQueries, r as normalizeParallelClientModel, s as normalizeParallelSessionId, t as buildParallelCacheKey } from "./parallel-search-normalize-BJmTyL0x.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
|
-
import { mergeScopedSearchConfig,
|
|
4
|
-
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
+
import { mergeScopedSearchConfig, readConfiguredSecretString, readProviderEnvValue, resolveProviderWebSearchPluginConfig, withTrustedWebSearchEndpoint } from "openclaw/plugin-sdk/provider-web-search";
|
|
5
4
|
import { readPluginPackageVersion } from "openclaw/plugin-sdk/extension-shared";
|
|
6
5
|
import { readProviderJsonResponse, readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
|
|
6
|
+
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
|
+
import { redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
|
|
8
|
+
import { redactSensitiveText } from "openclaw/plugin-sdk/security-runtime";
|
|
7
9
|
//#region extensions/parallel/src/parallel-web-search-provider.runtime.ts
|
|
8
10
|
const PARALLEL_BASE_URL = "https://api.parallel.ai";
|
|
9
11
|
const PARALLEL_SEARCH_PATHNAME = "/v1/search";
|
|
@@ -73,7 +75,7 @@ async function runParallelSearch(params) {
|
|
|
73
75
|
}, async (res) => {
|
|
74
76
|
if (!res.ok) {
|
|
75
77
|
const detail = await readResponseTextLimited(res, PARALLEL_ERROR_BODY_LIMIT_BYTES).catch(() => "");
|
|
76
|
-
throw new Error(`Parallel API error (${res.status}): ${detail || res.statusText}`);
|
|
78
|
+
throw new Error(`Parallel API error (${res.status}): ${redactToolPayloadText(redactSensitiveText(detail || res.statusText, { mode: "tools" }))}`);
|
|
77
79
|
}
|
|
78
80
|
return await readProviderJsonResponse(res, "Parallel API", { maxBytes: PARALLEL_SEARCH_RESPONSE_LIMIT_BYTES });
|
|
79
81
|
});
|
|
@@ -86,41 +88,21 @@ async function executeParallelWebSearchProviderTool(ctx, args, signal) {
|
|
|
86
88
|
const endpointResult = resolveParallelSearchEndpoint(parallelConfig);
|
|
87
89
|
if ("error" in endpointResult) return endpointResult;
|
|
88
90
|
const endpoint = endpointResult.endpoint;
|
|
89
|
-
|
|
90
|
-
if ("error" in request) return request.error;
|
|
91
|
-
const { objective, searchQueries, count, sessionId, clientModel } = request;
|
|
92
|
-
const cacheKey = buildParallelCacheKey({
|
|
93
|
-
endpoint,
|
|
94
|
-
objective,
|
|
95
|
-
searchQueries,
|
|
96
|
-
count,
|
|
97
|
-
sessionId,
|
|
98
|
-
clientModel
|
|
99
|
-
});
|
|
100
|
-
const cached = readCachedSearchPayload(cacheKey);
|
|
101
|
-
if (cached) return cached;
|
|
102
|
-
const start = Date.now();
|
|
103
|
-
const response = await runParallelSearch({
|
|
104
|
-
apiKey,
|
|
105
|
-
endpoint,
|
|
106
|
-
objective,
|
|
107
|
-
searchQueries,
|
|
108
|
-
maxResults: count,
|
|
109
|
-
sessionId,
|
|
110
|
-
clientModel,
|
|
111
|
-
timeoutSeconds: resolveSearchTimeoutSeconds(searchConfig),
|
|
112
|
-
signal
|
|
113
|
-
});
|
|
114
|
-
signal?.throwIfAborted();
|
|
115
|
-
const payload = buildParallelSearchPayload({
|
|
91
|
+
return executeParallelSearchRequest({
|
|
116
92
|
provider: "parallel",
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
93
|
+
endpoint,
|
|
94
|
+
args,
|
|
95
|
+
searchConfig,
|
|
96
|
+
signal,
|
|
97
|
+
search: ({ count, ...request }, timeoutSeconds) => runParallelSearch({
|
|
98
|
+
...request,
|
|
99
|
+
apiKey,
|
|
100
|
+
endpoint,
|
|
101
|
+
maxResults: count,
|
|
102
|
+
timeoutSeconds,
|
|
103
|
+
signal
|
|
104
|
+
})
|
|
121
105
|
});
|
|
122
|
-
writeCachedSearchPayload(cacheKey, sessionId ? payload : stripParallelGeneratedSessionId(payload), resolveSearchCacheTtlMs(searchConfig));
|
|
123
|
-
return payload;
|
|
124
106
|
}
|
|
125
107
|
const testing = {
|
|
126
108
|
buildParallelCacheKey,
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
|
|
3
|
-
function createParallelWebSearchProvider() {
|
|
4
|
-
return {
|
|
5
|
-
...createParallelWebSearchProviderBase(),
|
|
6
|
-
createTool: () => null
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
function createParallelFreeWebSearchProvider() {
|
|
10
|
-
return {
|
|
11
|
-
...createParallelFreeWebSearchProviderBase(),
|
|
12
|
-
createTool: () => null
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
1
|
+
import { n as createParallelWebSearchProvider, t as createParallelFreeWebSearchProvider } from "./parallel-free-web-search-provider-weJmjf0l.js";
|
|
2
|
+
import "./web-search-provider.js";
|
|
16
3
|
export { createParallelFreeWebSearchProvider, createParallelWebSearchProvider };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as createParallelWebSearchProvider, t as createParallelFreeWebSearchProvider } from "./parallel-free-web-search-provider-
|
|
1
|
+
import { n as createParallelWebSearchProvider, t as createParallelFreeWebSearchProvider } from "./parallel-free-web-search-provider-weJmjf0l.js";
|
|
2
2
|
export { createParallelFreeWebSearchProvider, createParallelWebSearchProvider };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/parallel-plugin",
|
|
3
|
-
"version": "2026.8.1
|
|
3
|
+
"version": "2026.8.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.8.1
|
|
21
|
+
"pluginApi": ">=2026.8.1"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.8.1
|
|
24
|
+
"openclawVersion": "2026.8.1",
|
|
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.8.1
|
|
41
|
+
"openclaw": ">=2026.8.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
44
|
"openclaw": {
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { createWebSearchProviderContractFields } from "openclaw/plugin-sdk/provider-web-search-contract";
|
|
2
|
-
//#region extensions/parallel/src/parallel-free-web-search-provider.shared.ts
|
|
3
|
-
const PARALLEL_FREE_ONBOARDING_SCOPES = ["text-inference"];
|
|
4
|
-
function createParallelFreeWebSearchProviderBase() {
|
|
5
|
-
return {
|
|
6
|
-
id: "parallel-free",
|
|
7
|
-
label: "Parallel Search (Free)",
|
|
8
|
-
hint: "Free web search via Parallel's hosted Search MCP — no API key required",
|
|
9
|
-
onboardingScopes: [...PARALLEL_FREE_ONBOARDING_SCOPES],
|
|
10
|
-
requiresCredential: false,
|
|
11
|
-
envVars: [],
|
|
12
|
-
placeholder: "(no key needed)",
|
|
13
|
-
signupUrl: "https://parallel.ai",
|
|
14
|
-
docsUrl: "https://docs.openclaw.ai/tools/parallel-search",
|
|
15
|
-
credentialPath: "",
|
|
16
|
-
...createWebSearchProviderContractFields({
|
|
17
|
-
credentialPath: "",
|
|
18
|
-
searchCredential: {
|
|
19
|
-
type: "scoped",
|
|
20
|
-
scopeId: "parallel-free"
|
|
21
|
-
},
|
|
22
|
-
selectionPluginId: "parallel"
|
|
23
|
-
})
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region extensions/parallel/src/parallel-web-search-provider.shared.ts
|
|
28
|
-
const PARALLEL_CREDENTIAL_PATH = "plugins.entries.parallel.config.webSearch.apiKey";
|
|
29
|
-
const PARALLEL_ONBOARDING_SCOPES = ["text-inference"];
|
|
30
|
-
function createParallelWebSearchProviderBase() {
|
|
31
|
-
return {
|
|
32
|
-
id: "parallel",
|
|
33
|
-
label: "Parallel Search",
|
|
34
|
-
hint: "LLM-optimized dense excerpts from web sources",
|
|
35
|
-
onboardingScopes: [...PARALLEL_ONBOARDING_SCOPES],
|
|
36
|
-
credentialLabel: "Parallel API key",
|
|
37
|
-
envVars: ["PARALLEL_API_KEY"],
|
|
38
|
-
placeholder: "par-...",
|
|
39
|
-
signupUrl: "https://platform.parallel.ai",
|
|
40
|
-
docsUrl: "https://docs.openclaw.ai/tools/parallel-search",
|
|
41
|
-
autoDetectOrder: 75,
|
|
42
|
-
credentialPath: PARALLEL_CREDENTIAL_PATH,
|
|
43
|
-
...createWebSearchProviderContractFields({
|
|
44
|
-
credentialPath: PARALLEL_CREDENTIAL_PATH,
|
|
45
|
-
searchCredential: {
|
|
46
|
-
type: "scoped",
|
|
47
|
-
scopeId: "parallel"
|
|
48
|
-
},
|
|
49
|
-
configuredCredential: { pluginId: "parallel" },
|
|
50
|
-
selectionPluginId: "parallel"
|
|
51
|
-
})
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
//#endregion
|
|
55
|
-
export { createParallelFreeWebSearchProviderBase as n, createParallelWebSearchProviderBase as t };
|