n8n-nodes-smart-browser-automation 1.1.3 → 1.1.5
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.
|
@@ -49,6 +49,10 @@ class BrowserSessionManager {
|
|
|
49
49
|
}
|
|
50
50
|
try {
|
|
51
51
|
await this.mcpClient.connect(this.transport);
|
|
52
|
+
// Stability delay for SSE connections to ensure pipe is fully open
|
|
53
|
+
if (isUrl) {
|
|
54
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
55
|
+
}
|
|
52
56
|
}
|
|
53
57
|
catch (error) {
|
|
54
58
|
this.isInitialized = false;
|
|
@@ -293,28 +293,29 @@ class SmartBrowserAutomation {
|
|
|
293
293
|
console.log(`Initializing AI session with CDP: ${cdpUrl}`);
|
|
294
294
|
}
|
|
295
295
|
const tools = await sessionManager.initialize(credentials.mcpEndpoint, true, cdpUrl);
|
|
296
|
-
|
|
296
|
+
let connectionStatus = 'Skipped (No CDP URL provided)';
|
|
297
|
+
let connectionResult = null;
|
|
298
|
+
// New logic: Auto-call browser_connect_cdp tool if a URL is provided
|
|
297
299
|
if (options.cdpUrl) {
|
|
298
300
|
if (verbose) {
|
|
299
301
|
console.log(`Auto-calling 'browser_connect_cdp' with endpoint: ${options.cdpUrl}`);
|
|
300
302
|
}
|
|
301
303
|
try {
|
|
302
|
-
await sessionManager.callTool('browser_connect_cdp', { endpoint: options.cdpUrl });
|
|
304
|
+
connectionResult = await sessionManager.callTool('browser_connect_cdp', { endpoint: options.cdpUrl });
|
|
305
|
+
connectionStatus = 'Successfully connected';
|
|
303
306
|
}
|
|
304
307
|
catch (error) {
|
|
308
|
+
connectionStatus = `Failed to connect: ${error.message}`;
|
|
305
309
|
console.warn(`Failed to auto-connect browser via tool: ${error.message}`);
|
|
306
|
-
// We don't throw here to allow the AI to potentially fix it or show the error
|
|
307
310
|
}
|
|
308
311
|
}
|
|
309
312
|
returnData.push({
|
|
310
313
|
json: {
|
|
311
314
|
success: true,
|
|
312
|
-
message: `MCP session initialized
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
description: t.description
|
|
317
|
-
})),
|
|
315
|
+
message: `MCP session initialized at ${credentials.mcpEndpoint}`,
|
|
316
|
+
browserConnection: connectionStatus,
|
|
317
|
+
browserResponse: connectionResult,
|
|
318
|
+
totalToolsAvailable: tools.length,
|
|
318
319
|
},
|
|
319
320
|
pairedItem: i,
|
|
320
321
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-smart-browser-automation",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "n8n node for AI-driven browser automation using MCP",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"gulp": "^4.0.2",
|
|
49
49
|
"n8n-workflow": "^1.0.0",
|
|
50
50
|
"prettier": "^3.1.0",
|
|
51
|
+
"ts-node": "^10.9.2",
|
|
51
52
|
"typescript": "^5.3.0"
|
|
52
53
|
},
|
|
53
54
|
"peerDependencies": {
|