web-search-plus-plugin 1.3.2 → 1.3.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.
- package/index.ts +11 -3
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -15,6 +15,12 @@ function getPluginDir(): string {
|
|
|
15
15
|
return path.join(process.cwd(), "skills", "web-search-plus-plugin");
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
const SENSITIVE_PATTERN = /(?:key|token|secret|password|api[_-]?key)\s*[=:]\s*\S+/gi;
|
|
19
|
+
|
|
20
|
+
function sanitizeOutput(text: string): string {
|
|
21
|
+
return text.replace(SENSITIVE_PATTERN, "[REDACTED]");
|
|
22
|
+
}
|
|
23
|
+
|
|
18
24
|
function loadEnvFile(envPath: string): Record<string, string> {
|
|
19
25
|
if (!fs.existsSync(envPath)) return {};
|
|
20
26
|
const env: Record<string, string> = {};
|
|
@@ -66,7 +72,9 @@ function runPython(
|
|
|
66
72
|
if (!settled) {
|
|
67
73
|
settled = true;
|
|
68
74
|
clearTimeout(timer);
|
|
69
|
-
|
|
75
|
+
// Only expose the error message, not the full error object (may contain env/args)
|
|
76
|
+
const safeMsg = err.code === "ENOENT" ? "python3 not found" : "Process error";
|
|
77
|
+
resolve({ stdout: "", stderr: safeMsg, code: 1 });
|
|
70
78
|
}
|
|
71
79
|
});
|
|
72
80
|
});
|
|
@@ -225,14 +233,14 @@ export default definePluginEntry({
|
|
|
225
233
|
const result = await runPython(args, childEnv, 75000);
|
|
226
234
|
|
|
227
235
|
if (result.code !== 0) {
|
|
228
|
-
const stderr = result.stderr.trim() || "Unknown error";
|
|
236
|
+
const stderr = sanitizeOutput(result.stderr.trim()) || "Unknown error";
|
|
229
237
|
return {
|
|
230
238
|
content: [{ type: "text", text: `Search failed (exit ${result.code}): ${stderr}` }],
|
|
231
239
|
};
|
|
232
240
|
}
|
|
233
241
|
|
|
234
242
|
return {
|
|
235
|
-
content: [{ type: "text", text: result.stdout.trim() || "{}" }],
|
|
243
|
+
content: [{ type: "text", text: sanitizeOutput(result.stdout.trim()) || "{}" }],
|
|
236
244
|
};
|
|
237
245
|
},
|
|
238
246
|
},
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "web-search-plus-plugin",
|
|
3
3
|
"name": "Web Search Plus",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.3",
|
|
5
5
|
"description": "Multi-provider web search (Serper/Google, Tavily, Querit/Multilingual AI Search, Exa/Neural+Deep, Perplexity, You.com, SearXNG) with intelligent auto-routing",
|
|
6
6
|
"configSchema": {
|
|
7
7
|
"type": "object",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "web-search-plus-plugin",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "OpenClaw plugin: multi-provider web search (Serper/Google, Tavily, Querit/Multilingual AI Search, Exa/Neural+Deep, Perplexity, You.com, SearXNG) with intelligent auto-routing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|