n8n-nodes-smart-browser-automation 1.1.2 → 1.1.4

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.
@@ -221,7 +221,10 @@ class SmartBrowserAutomation {
221
221
  const sessionManager = BrowserSessionManager_1.default.getInstance();
222
222
  const credentials = await this.getCredentials('smartBrowserAutomationApi');
223
223
  await sessionManager.initialize(credentials.mcpEndpoint, true, input.endpoint);
224
- return { success: true, message: `Connected to browser at ${input.endpoint}` };
224
+ return {
225
+ content: [{ type: 'text', text: `Successfully connected to browser at ${input.endpoint}` }],
226
+ isError: false
227
+ };
225
228
  }
226
229
  };
227
230
  return [connectTool, ...tools];
@@ -276,11 +279,7 @@ class SmartBrowserAutomation {
276
279
  }
277
280
  const result = await sessionManager.callTool(toolName, toolArgs);
278
281
  returnData.push({
279
- json: {
280
- success: true,
281
- tool: toolName,
282
- result,
283
- },
282
+ json: result,
284
283
  pairedItem: i,
285
284
  });
286
285
  }
@@ -294,13 +293,13 @@ class SmartBrowserAutomation {
294
293
  console.log(`Initializing AI session with CDP: ${cdpUrl}`);
295
294
  }
296
295
  const tools = await sessionManager.initialize(credentials.mcpEndpoint, true, cdpUrl);
297
- // New logic: Auto-call browser_connect tool if a URL is provided
296
+ // New logic: Auto-call browser_connect_cdp tool if a URL is provided
298
297
  if (options.cdpUrl) {
299
298
  if (verbose) {
300
- console.log(`Auto-calling 'browser_connect' with endpoint: ${options.cdpUrl}`);
299
+ console.log(`Auto-calling 'browser_connect_cdp' with endpoint: ${options.cdpUrl}`);
301
300
  }
302
301
  try {
303
- await sessionManager.callTool('browser_connect', { endpoint: options.cdpUrl });
302
+ await sessionManager.callTool('browser_connect_cdp', { endpoint: options.cdpUrl });
304
303
  }
305
304
  catch (error) {
306
305
  console.warn(`Failed to auto-connect browser via tool: ${error.message}`);
@@ -66,16 +66,10 @@ async function createDynamicBrowserTools(credentials) {
66
66
  async execute(toolInput) {
67
67
  try {
68
68
  const result = await sessionManager.callTool(toolName, toolInput);
69
- return {
70
- success: true,
71
- result: JSON.stringify(result, null, 2),
72
- };
69
+ return result;
73
70
  }
74
71
  catch (error) {
75
- return {
76
- success: false,
77
- error: error.message || 'Unknown error occurred',
78
- };
72
+ throw new Error(error.message || 'Unknown error occurred');
79
73
  }
80
74
  }
81
75
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-smart-browser-automation",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
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": {