@minded-ai/mindedjs 1.0.125 → 1.0.126-beta-2
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/browserTask/README.md +419 -0
- package/dist/browserTask/browserAgent.py +632 -0
- package/dist/browserTask/captcha_isolated.png +0 -0
- package/dist/browserTask/executeBrowserTask.d.ts +2 -13
- package/dist/browserTask/executeBrowserTask.d.ts.map +1 -1
- package/dist/browserTask/executeBrowserTask.js +6 -179
- package/dist/browserTask/executeBrowserTask.js.map +1 -1
- package/dist/browserTask/executeBrowserTask.ts +79 -0
- package/dist/browserTask/requirements.txt +8 -0
- package/dist/browserTask/setup.sh +144 -0
- package/dist/internalTools/retell.d.ts +12 -0
- package/dist/internalTools/retell.d.ts.map +1 -0
- package/dist/internalTools/retell.js +54 -0
- package/dist/internalTools/retell.js.map +1 -0
- package/dist/internalTools/sendPlaceholderMessage.d.ts +14 -0
- package/dist/internalTools/sendPlaceholderMessage.d.ts.map +1 -0
- package/dist/internalTools/sendPlaceholderMessage.js +61 -0
- package/dist/internalTools/sendPlaceholderMessage.js.map +1 -0
- package/dist/nodes/addBrowserTaskNode.d.ts.map +1 -1
- package/dist/nodes/addBrowserTaskNode.js +2 -1
- package/dist/nodes/addBrowserTaskNode.js.map +1 -1
- package/dist/nodes/addBrowserTaskRunNode.js +1 -1
- package/dist/nodes/addBrowserTaskRunNode.js.map +1 -1
- package/dist/platform/mindedConnectionTypes.d.ts +1 -0
- package/dist/platform/mindedConnectionTypes.d.ts.map +1 -1
- package/dist/types/Flows.types.d.ts +1 -0
- package/dist/types/Flows.types.d.ts.map +1 -1
- package/dist/types/Flows.types.js.map +1 -1
- package/package.json +2 -2
- package/src/browserTask/executeBrowserTask.ts +5 -213
- package/src/nodes/addBrowserTaskNode.ts +2 -1
- package/src/nodes/addBrowserTaskRunNode.ts +1 -1
- package/src/platform/mindedConnectionTypes.ts +1 -0
- package/src/types/Flows.types.ts +1 -0
|
@@ -1,192 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.invokeBrowserTask = exports.createBrowserSession =
|
|
3
|
+
exports.invokeBrowserTask = exports.createBrowserSession = void 0;
|
|
4
4
|
const logger_1 = require("../utils/logger");
|
|
5
5
|
const mindedConnection_1 = require("../platform/mindedConnection");
|
|
6
6
|
const mindedConnectionTypes_1 = require("../platform/mindedConnectionTypes");
|
|
7
|
-
// Browser Use Cloud API configuration
|
|
8
|
-
const BROWSER_USE_API_BASE_URL = 'https://api.browser-use.com/api/v1';
|
|
9
|
-
// Browser Use Cloud API methods
|
|
10
|
-
const createCloudTask = async (prompt, model) => {
|
|
11
|
-
const apiKey = process.env.BROWSER_USE_API_KEY;
|
|
12
|
-
if (!apiKey) {
|
|
13
|
-
throw new Error('BROWSER_USE_API_KEY environment variable is required');
|
|
14
|
-
}
|
|
15
|
-
logger_1.logger.debug({ msg: 'Creating cloud browser task', prompt: prompt.substring(0, 100) + '...' });
|
|
16
|
-
const response = await fetch(`${BROWSER_USE_API_BASE_URL}/run-task`, {
|
|
17
|
-
method: 'POST',
|
|
18
|
-
headers: {
|
|
19
|
-
Authorization: `Bearer ${apiKey}`,
|
|
20
|
-
'Content-Type': 'application/json',
|
|
21
|
-
},
|
|
22
|
-
body: JSON.stringify({
|
|
23
|
-
task: prompt,
|
|
24
|
-
use_proxy: false,
|
|
25
|
-
llm_model: model || 'gpt-4o',
|
|
26
|
-
}),
|
|
27
|
-
});
|
|
28
|
-
if (!response.ok) {
|
|
29
|
-
logger_1.logger.error({ msg: 'Failed to create cloud browser task', status: response.status, statusText: response.statusText });
|
|
30
|
-
throw new Error(`Failed to create browser task: ${response.statusText}`);
|
|
31
|
-
}
|
|
32
|
-
const data = await response.json();
|
|
33
|
-
logger_1.logger.debug({ msg: 'Cloud browser task created', taskId: data.id });
|
|
34
|
-
return data.id;
|
|
35
|
-
};
|
|
36
|
-
exports.createCloudTask = createCloudTask;
|
|
37
|
-
const getTaskDetails = async (taskId) => {
|
|
38
|
-
const apiKey = process.env.BROWSER_USE_API_KEY;
|
|
39
|
-
if (!apiKey) {
|
|
40
|
-
throw new Error('BROWSER_USE_API_KEY environment variable is required');
|
|
41
|
-
}
|
|
42
|
-
const response = await fetch(`${BROWSER_USE_API_BASE_URL}/task/${taskId}`, {
|
|
43
|
-
headers: {
|
|
44
|
-
Authorization: `Bearer ${apiKey}`,
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
if (!response.ok) {
|
|
48
|
-
logger_1.logger.error({ msg: 'Failed to get task details', taskId, status: response.status, statusText: response.statusText });
|
|
49
|
-
throw new Error(`Failed to get task details: ${response.statusText}`);
|
|
50
|
-
}
|
|
51
|
-
return response.json();
|
|
52
|
-
};
|
|
53
|
-
exports.getTaskDetails = getTaskDetails;
|
|
54
|
-
const waitForLiveUrl = async (taskId, maxWaitTime = 30000) => {
|
|
55
|
-
const startTime = Date.now();
|
|
56
|
-
const pollInterval = 2000; // 2 seconds
|
|
57
|
-
let pollCount = 0;
|
|
58
|
-
logger_1.logger.debug({ msg: 'Starting to poll for live_url', taskId, maxWaitTime, pollInterval });
|
|
59
|
-
while (Date.now() - startTime < maxWaitTime) {
|
|
60
|
-
pollCount++;
|
|
61
|
-
const elapsedTime = Date.now() - startTime;
|
|
62
|
-
logger_1.logger.trace({
|
|
63
|
-
msg: 'Polling for live_url',
|
|
64
|
-
taskId,
|
|
65
|
-
pollCount,
|
|
66
|
-
elapsedTime,
|
|
67
|
-
remainingTime: maxWaitTime - elapsedTime,
|
|
68
|
-
});
|
|
69
|
-
const taskDetails = await (0, exports.getTaskDetails)(taskId);
|
|
70
|
-
logger_1.logger.trace({
|
|
71
|
-
msg: 'Task details received',
|
|
72
|
-
taskId,
|
|
73
|
-
status: taskDetails.status,
|
|
74
|
-
hasLiveUrl: !!taskDetails.live_url,
|
|
75
|
-
pollCount,
|
|
76
|
-
});
|
|
77
|
-
if (taskDetails.live_url) {
|
|
78
|
-
logger_1.logger.debug({
|
|
79
|
-
msg: 'Live URL available',
|
|
80
|
-
taskId,
|
|
81
|
-
liveUrl: taskDetails.live_url,
|
|
82
|
-
pollCount,
|
|
83
|
-
totalTime: elapsedTime,
|
|
84
|
-
});
|
|
85
|
-
return taskDetails;
|
|
86
|
-
}
|
|
87
|
-
if (taskDetails.status === 'failed' || taskDetails.status === 'stopped') {
|
|
88
|
-
logger_1.logger.error({
|
|
89
|
-
msg: 'Task failed while waiting for live_url',
|
|
90
|
-
taskId,
|
|
91
|
-
status: taskDetails.status,
|
|
92
|
-
pollCount,
|
|
93
|
-
elapsedTime,
|
|
94
|
-
});
|
|
95
|
-
throw new Error(`Task failed with status: ${taskDetails.status}`);
|
|
96
|
-
}
|
|
97
|
-
logger_1.logger.trace({
|
|
98
|
-
msg: 'Live URL not yet available, continuing to poll',
|
|
99
|
-
taskId,
|
|
100
|
-
status: taskDetails.status,
|
|
101
|
-
pollCount,
|
|
102
|
-
nextPollIn: pollInterval,
|
|
103
|
-
});
|
|
104
|
-
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
105
|
-
}
|
|
106
|
-
logger_1.logger.error({
|
|
107
|
-
msg: 'Timeout waiting for live_url',
|
|
108
|
-
taskId,
|
|
109
|
-
pollCount,
|
|
110
|
-
totalTime: Date.now() - startTime,
|
|
111
|
-
maxWaitTime,
|
|
112
|
-
});
|
|
113
|
-
throw new Error('Timeout waiting for live_url to become available');
|
|
114
|
-
};
|
|
115
|
-
exports.waitForLiveUrl = waitForLiveUrl;
|
|
116
|
-
const waitForCompletion = async (taskId, maxWaitTime = 300000) => {
|
|
117
|
-
var _a, _b, _c, _d;
|
|
118
|
-
const startTime = Date.now();
|
|
119
|
-
const pollInterval = 3000; // 3 seconds for completion polling
|
|
120
|
-
let pollCount = 0;
|
|
121
|
-
logger_1.logger.debug({ msg: 'Starting to poll for task completion', taskId, maxWaitTime, pollInterval });
|
|
122
|
-
while (Date.now() - startTime < maxWaitTime) {
|
|
123
|
-
pollCount++;
|
|
124
|
-
const elapsedTime = Date.now() - startTime;
|
|
125
|
-
logger_1.logger.trace({
|
|
126
|
-
msg: 'Polling for task completion',
|
|
127
|
-
taskId,
|
|
128
|
-
pollCount,
|
|
129
|
-
elapsedTime,
|
|
130
|
-
remainingTime: maxWaitTime - elapsedTime,
|
|
131
|
-
});
|
|
132
|
-
const taskDetails = await (0, exports.getTaskDetails)(taskId);
|
|
133
|
-
logger_1.logger.trace({
|
|
134
|
-
msg: 'Task completion status received',
|
|
135
|
-
taskId,
|
|
136
|
-
status: taskDetails.status,
|
|
137
|
-
pollCount,
|
|
138
|
-
hasOutput: !!taskDetails.output,
|
|
139
|
-
stepCount: ((_a = taskDetails.steps) === null || _a === void 0 ? void 0 : _a.length) || 0,
|
|
140
|
-
});
|
|
141
|
-
if (taskDetails.status === 'finished') {
|
|
142
|
-
logger_1.logger.debug({
|
|
143
|
-
msg: 'Task completed successfully',
|
|
144
|
-
taskId,
|
|
145
|
-
pollCount,
|
|
146
|
-
totalTime: elapsedTime,
|
|
147
|
-
stepCount: ((_b = taskDetails.steps) === null || _b === void 0 ? void 0 : _b.length) || 0,
|
|
148
|
-
hasOutput: !!taskDetails.output,
|
|
149
|
-
});
|
|
150
|
-
return taskDetails;
|
|
151
|
-
}
|
|
152
|
-
if (taskDetails.status === 'failed' || taskDetails.status === 'stopped') {
|
|
153
|
-
logger_1.logger.error({
|
|
154
|
-
msg: 'Task failed during completion polling',
|
|
155
|
-
taskId,
|
|
156
|
-
status: taskDetails.status,
|
|
157
|
-
pollCount,
|
|
158
|
-
elapsedTime,
|
|
159
|
-
stepCount: ((_c = taskDetails.steps) === null || _c === void 0 ? void 0 : _c.length) || 0,
|
|
160
|
-
});
|
|
161
|
-
throw new Error(`Task failed with status: ${taskDetails.status}`);
|
|
162
|
-
}
|
|
163
|
-
logger_1.logger.trace({
|
|
164
|
-
msg: 'Task still in progress, continuing to poll',
|
|
165
|
-
taskId,
|
|
166
|
-
status: taskDetails.status,
|
|
167
|
-
pollCount,
|
|
168
|
-
stepCount: ((_d = taskDetails.steps) === null || _d === void 0 ? void 0 : _d.length) || 0,
|
|
169
|
-
nextPollIn: pollInterval,
|
|
170
|
-
});
|
|
171
|
-
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
172
|
-
}
|
|
173
|
-
logger_1.logger.error({
|
|
174
|
-
msg: 'Timeout waiting for task completion',
|
|
175
|
-
taskId,
|
|
176
|
-
pollCount,
|
|
177
|
-
totalTime: Date.now() - startTime,
|
|
178
|
-
maxWaitTime,
|
|
179
|
-
});
|
|
180
|
-
throw new Error('Timeout waiting for task completion');
|
|
181
|
-
};
|
|
182
|
-
exports.waitForCompletion = waitForCompletion;
|
|
183
7
|
// Socket-based browser task functions
|
|
184
|
-
const createBrowserSession = async (proxy) => {
|
|
8
|
+
const createBrowserSession = async (proxy, onPrem) => {
|
|
185
9
|
logger_1.logger.debug({ msg: 'Creating browser session via socket', proxy });
|
|
186
10
|
try {
|
|
187
11
|
const response = await mindedConnection_1.mindedConnection.awaitEmit(mindedConnectionTypes_1.mindedConnectionSocketMessageType.CREATE_BROWSER_SESSION, {
|
|
188
12
|
type: mindedConnectionTypes_1.mindedConnectionSocketMessageType.CREATE_BROWSER_SESSION,
|
|
189
13
|
proxy,
|
|
14
|
+
onPrem: onPrem,
|
|
190
15
|
}, 60000);
|
|
191
16
|
if (response.error) {
|
|
192
17
|
logger_1.logger.error({ msg: 'Failed to create browser session', error: response.error });
|
|
@@ -205,7 +30,7 @@ const createBrowserSession = async (proxy) => {
|
|
|
205
30
|
}
|
|
206
31
|
};
|
|
207
32
|
exports.createBrowserSession = createBrowserSession;
|
|
208
|
-
const invokeBrowserTask = async (sessionId, cdpUrl, task, keepAlive, hooks) => {
|
|
33
|
+
const invokeBrowserTask = async (sessionId, cdpUrl, task, keepAlive, hooks, onPrem) => {
|
|
209
34
|
var _a, _b;
|
|
210
35
|
logger_1.logger.debug({
|
|
211
36
|
msg: 'Invoking browser task via socket',
|
|
@@ -213,6 +38,7 @@ const invokeBrowserTask = async (sessionId, cdpUrl, task, keepAlive, hooks) => {
|
|
|
213
38
|
taskLength: task.length,
|
|
214
39
|
keepAlive,
|
|
215
40
|
hooksCount: (hooks === null || hooks === void 0 ? void 0 : hooks.length) || 0,
|
|
41
|
+
onPrem,
|
|
216
42
|
});
|
|
217
43
|
try {
|
|
218
44
|
const response = await mindedConnection_1.mindedConnection.awaitEmit(mindedConnectionTypes_1.mindedConnectionSocketMessageType.INVOKE_BROWSER_TASK, {
|
|
@@ -221,6 +47,7 @@ const invokeBrowserTask = async (sessionId, cdpUrl, task, keepAlive, hooks) => {
|
|
|
221
47
|
task,
|
|
222
48
|
keepAlive,
|
|
223
49
|
hooks,
|
|
50
|
+
onPrem,
|
|
224
51
|
}, 900000);
|
|
225
52
|
if (response.error) {
|
|
226
53
|
logger_1.logger.error({ msg: 'Failed to invoke browser task', error: response.error });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeBrowserTask.js","sourceRoot":"","sources":["../../src/browserTask/executeBrowserTask.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AACzC,mEAAgE;AAChE,6EAK2C;AAE3C,sCAAsC;
|
|
1
|
+
{"version":3,"file":"executeBrowserTask.js","sourceRoot":"","sources":["../../src/browserTask/executeBrowserTask.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AACzC,mEAAgE;AAChE,6EAK2C;AAE3C,sCAAsC;AAC/B,MAAM,oBAAoB,GAAG,KAAK,EAAE,KAAc,EAAE,MAAgB,EAAyC,EAAE;IACpH,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,qCAAqC,EAAE,KAAK,EAAE,CAAC,CAAC;IAEpE,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,mCAAgB,CAAC,SAAS,CAC/C,yDAAiC,CAAC,sBAAsB,EACxD;YACE,IAAI,EAAE,yDAAiC,CAAC,sBAAsB;YAC9D,KAAK;YACL,MAAM,EAAE,MAAM;SACf,EACD,KAAK,CACN,CAAC;QAEF,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YACnB,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,kCAAkC,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;YACjF,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC;QAED,eAAM,CAAC,KAAK,CAAC;YACX,GAAG,EAAE,sCAAsC;YAC3C,SAAS,EAAE,QAAQ,CAAC,SAAS;YAC7B,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW;SACnC,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,gCAAgC,EAAE,KAAK,EAAE,CAAC,CAAC;QAC/D,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AA9BW,QAAA,oBAAoB,wBA8B/B;AAEK,MAAM,iBAAiB,GAAG,KAAK,EACpC,SAAiB,EACjB,MAAc,EACd,IAAY,EACZ,SAAmB,EACnB,KAA0B,EAC1B,MAAgB,EACoB,EAAE;;IACtC,eAAM,CAAC,KAAK,CAAC;QACX,GAAG,EAAE,kCAAkC;QACvC,SAAS;QACT,UAAU,EAAE,IAAI,CAAC,MAAM;QACvB,SAAS;QACT,UAAU,EAAE,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,KAAI,CAAC;QAC9B,MAAM;KACP,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,mCAAgB,CAAC,SAAS,CAC/C,yDAAiC,CAAC,mBAAmB,EACrD;YACE,SAAS;YACT,MAAM;YACN,IAAI;YACJ,SAAS;YACT,KAAK;YACL,MAAM;SACP,EACD,MAAM,CACP,CAAC;QAEF,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YACnB,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,+BAA+B,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;YAC9E,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC;QAED,eAAM,CAAC,KAAK,CAAC;YACX,GAAG,EAAE,qCAAqC;YAC1C,SAAS;YACT,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM;YAC5B,SAAS,EAAE,CAAA,MAAA,QAAQ,CAAC,KAAK,0CAAE,MAAM,KAAI,CAAC;YACtC,cAAc,EAAE,CAAA,MAAA,QAAQ,CAAC,UAAU,0CAAE,MAAM,KAAI,CAAC;SACjD,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,6BAA6B,EAAE,KAAK,EAAE,CAAC,CAAC;QAC5D,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAjDW,QAAA,iBAAiB,qBAiD5B"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { spawn } from 'child_process';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { logger } from '../utils/logger';
|
|
4
|
+
|
|
5
|
+
export const executeBrowserTask = async (prompt: string): Promise<string> => {
|
|
6
|
+
const pythonScriptPath = join(__dirname, 'browserAgent.py');
|
|
7
|
+
const venvPythonPath = join(__dirname, '.venv', 'bin', 'python');
|
|
8
|
+
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
// Determine which Python to use - prefer venv if it exists
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const pythonCommand = fs.existsSync(venvPythonPath) ? venvPythonPath : 'python3';
|
|
13
|
+
|
|
14
|
+
// Use Python to run our browser agent script with CAPTCHA bypass
|
|
15
|
+
const child = spawn(pythonCommand, [pythonScriptPath, '-p', prompt, '--output-format', 'json'], {
|
|
16
|
+
env: {
|
|
17
|
+
...process.env,
|
|
18
|
+
// Ensure Python can find the script and dependencies
|
|
19
|
+
PYTHONPATH: __dirname,
|
|
20
|
+
// Set virtual environment if it exists
|
|
21
|
+
VIRTUAL_ENV: fs.existsSync(join(__dirname, '.venv')) ? join(__dirname, '.venv') : undefined,
|
|
22
|
+
},
|
|
23
|
+
cwd: __dirname,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
let output = '';
|
|
27
|
+
let errorOutput = '';
|
|
28
|
+
|
|
29
|
+
// Stream stdout to console and collect it
|
|
30
|
+
child.stdout.on('data', (data) => {
|
|
31
|
+
const chunk = data.toString();
|
|
32
|
+
logger.trace({ message: 'Browser task output', output: chunk });
|
|
33
|
+
output += chunk;
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// Stream stderr to console and collect errors
|
|
37
|
+
child.stderr.on('data', (data) => {
|
|
38
|
+
const chunk = data.toString();
|
|
39
|
+
logger.error({ message: 'Browser task error', error: chunk });
|
|
40
|
+
errorOutput += chunk;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
child.on('error', (error) => {
|
|
44
|
+
logger.error({ message: 'Failed to start browser task process', error: error.message });
|
|
45
|
+
reject(new Error(`Failed to start browser task: ${error.message}`));
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
child.on('close', (code) => {
|
|
49
|
+
if (code !== 0) {
|
|
50
|
+
logger.error({
|
|
51
|
+
message: 'Browser task process exited with error',
|
|
52
|
+
code,
|
|
53
|
+
stderr: errorOutput,
|
|
54
|
+
});
|
|
55
|
+
reject(new Error(`Browser task failed with code ${code}: ${errorOutput}`));
|
|
56
|
+
} else {
|
|
57
|
+
try {
|
|
58
|
+
// Parse JSON output from Python script
|
|
59
|
+
const result = JSON.parse(output.trim());
|
|
60
|
+
if (result.success) {
|
|
61
|
+
logger.info({ message: 'Browser task completed successfully' });
|
|
62
|
+
resolve(result.result || 'Task completed successfully');
|
|
63
|
+
} else {
|
|
64
|
+
logger.error({ message: 'Browser task failed', error: result.error });
|
|
65
|
+
reject(new Error(result.error || 'Unknown error occurred'));
|
|
66
|
+
}
|
|
67
|
+
} catch (parseError) {
|
|
68
|
+
// Fallback to plain text output if JSON parsing fails
|
|
69
|
+
logger.warn({
|
|
70
|
+
message: 'Could not parse JSON output, using plain text',
|
|
71
|
+
output: output.trim(),
|
|
72
|
+
});
|
|
73
|
+
resolve(output.trim() || 'Task completed');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Browser Agent Setup Script
|
|
4
|
+
# This script sets up the Python environment for the browser agent with CAPTCHA bypass
|
|
5
|
+
|
|
6
|
+
set -e
|
|
7
|
+
|
|
8
|
+
echo "🚀 Setting up Browser Agent with CAPTCHA Bypass..."
|
|
9
|
+
|
|
10
|
+
# Get the directory where this script is located
|
|
11
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
12
|
+
cd "$SCRIPT_DIR"
|
|
13
|
+
|
|
14
|
+
# Check if Python 3 is installed
|
|
15
|
+
if ! command -v python3 &> /dev/null; then
|
|
16
|
+
echo "❌ Python 3 is not installed. Please install Python 3.11 or higher."
|
|
17
|
+
exit 1
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
# Check Python version - browser-use requires Python 3.11+
|
|
21
|
+
PYTHON_VERSION=$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
|
|
22
|
+
PYTHON_MAJOR=$(echo $PYTHON_VERSION | cut -d. -f1)
|
|
23
|
+
PYTHON_MINOR=$(echo $PYTHON_VERSION | cut -d. -f2)
|
|
24
|
+
|
|
25
|
+
if [ "$PYTHON_MAJOR" -lt 3 ] || { [ "$PYTHON_MAJOR" -eq 3 ] && [ "$PYTHON_MINOR" -lt 11 ]; }; then
|
|
26
|
+
echo "❌ Python 3.11 or higher is required for browser-use. Found Python $PYTHON_VERSION"
|
|
27
|
+
echo "💡 Please install Python 3.11+ or use a version manager like pyenv:"
|
|
28
|
+
echo " # Install pyenv (if not installed)"
|
|
29
|
+
echo " curl https://pyenv.run | bash"
|
|
30
|
+
echo " # Install and use Python 3.12"
|
|
31
|
+
echo " pyenv install 3.12.0"
|
|
32
|
+
echo " pyenv local 3.12.0"
|
|
33
|
+
exit 1
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
echo "✅ Python $PYTHON_VERSION detected"
|
|
37
|
+
|
|
38
|
+
# Check if uv is installed
|
|
39
|
+
if ! command -v uv &> /dev/null; then
|
|
40
|
+
echo "⚠️ uv is not installed. Installing uv..."
|
|
41
|
+
# Install uv
|
|
42
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
43
|
+
|
|
44
|
+
# Source the shell to get uv in PATH
|
|
45
|
+
export PATH="$HOME/.cargo/bin:$PATH"
|
|
46
|
+
|
|
47
|
+
# Verify installation
|
|
48
|
+
if ! command -v uv &> /dev/null; then
|
|
49
|
+
echo "❌ Failed to install uv. Please install manually:"
|
|
50
|
+
echo " curl -LsSf https://astral.sh/uv/install.sh | sh"
|
|
51
|
+
exit 1
|
|
52
|
+
fi
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
echo "✅ uv detected"
|
|
56
|
+
|
|
57
|
+
echo "🐍 Setting up Python environment with uv..."
|
|
58
|
+
|
|
59
|
+
# Create virtual environment with uv (if not exists)
|
|
60
|
+
if [ ! -d ".venv" ]; then
|
|
61
|
+
echo "🐍 Creating virtual environment..."
|
|
62
|
+
|
|
63
|
+
# Try Python 3.12 first, then fall back to 3.11
|
|
64
|
+
if uv venv --python 3.12 2>/dev/null; then
|
|
65
|
+
echo "✅ Created virtual environment with Python 3.12"
|
|
66
|
+
elif uv venv --python 3.11 2>/dev/null; then
|
|
67
|
+
echo "✅ Created virtual environment with Python 3.11"
|
|
68
|
+
else
|
|
69
|
+
echo "❌ Failed to create virtual environment with Python 3.11+. Please check your Python installation."
|
|
70
|
+
exit 1
|
|
71
|
+
fi
|
|
72
|
+
else
|
|
73
|
+
echo "✅ Virtual environment already exists"
|
|
74
|
+
fi
|
|
75
|
+
|
|
76
|
+
echo "📦 Installing Python dependencies with uv..."
|
|
77
|
+
|
|
78
|
+
# Install Python dependencies using uv
|
|
79
|
+
uv pip install -r requirements.txt
|
|
80
|
+
|
|
81
|
+
# Install playwright browsers
|
|
82
|
+
echo "🌐 Installing Playwright browsers..."
|
|
83
|
+
uv run playwright install
|
|
84
|
+
|
|
85
|
+
# Check if tesseract is installed (required for OCR)
|
|
86
|
+
if ! command -v tesseract &> /dev/null; then
|
|
87
|
+
echo "⚠️ Tesseract OCR is not installed. Installing..."
|
|
88
|
+
|
|
89
|
+
# Detect OS and install tesseract
|
|
90
|
+
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
|
91
|
+
# Linux
|
|
92
|
+
if command -v apt-get &> /dev/null; then
|
|
93
|
+
sudo apt-get update
|
|
94
|
+
sudo apt-get install -y tesseract-ocr tesseract-ocr-eng
|
|
95
|
+
elif command -v yum &> /dev/null; then
|
|
96
|
+
sudo yum install -y tesseract tesseract-langpack-eng
|
|
97
|
+
elif command -v dnf &> /dev/null; then
|
|
98
|
+
sudo dnf install -y tesseract tesseract-langpack-eng
|
|
99
|
+
else
|
|
100
|
+
echo "❌ Could not install tesseract automatically. Please install it manually."
|
|
101
|
+
echo " For Ubuntu/Debian: sudo apt-get install tesseract-ocr"
|
|
102
|
+
echo " For CentOS/RHEL: sudo yum install tesseract"
|
|
103
|
+
fi
|
|
104
|
+
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
|
105
|
+
# macOS
|
|
106
|
+
if command -v brew &> /dev/null; then
|
|
107
|
+
brew install tesseract
|
|
108
|
+
else
|
|
109
|
+
echo "❌ Homebrew not found. Please install tesseract manually:"
|
|
110
|
+
echo " brew install tesseract"
|
|
111
|
+
exit 1
|
|
112
|
+
fi
|
|
113
|
+
else
|
|
114
|
+
echo "❌ Unsupported OS. Please install tesseract manually."
|
|
115
|
+
exit 1
|
|
116
|
+
fi
|
|
117
|
+
fi
|
|
118
|
+
|
|
119
|
+
# Verify tesseract installation
|
|
120
|
+
if command -v tesseract &> /dev/null; then
|
|
121
|
+
TESSERACT_VERSION=$(tesseract --version | head -n1)
|
|
122
|
+
echo "✅ $TESSERACT_VERSION detected"
|
|
123
|
+
else
|
|
124
|
+
echo "❌ Tesseract installation failed or not found in PATH"
|
|
125
|
+
exit 1
|
|
126
|
+
fi
|
|
127
|
+
|
|
128
|
+
# Make the Python script executable
|
|
129
|
+
chmod +x browserAgent.py
|
|
130
|
+
|
|
131
|
+
echo "🎉 Setup completed successfully!"
|
|
132
|
+
echo ""
|
|
133
|
+
echo "📋 Next steps:"
|
|
134
|
+
echo "1. Activate the virtual environment:"
|
|
135
|
+
echo " source .venv/bin/activate"
|
|
136
|
+
echo ""
|
|
137
|
+
echo "2. Set your OpenAI API key in environment variables:"
|
|
138
|
+
echo " export OPENAI_API_KEY='your-api-key-here'"
|
|
139
|
+
echo ""
|
|
140
|
+
echo "3. Test the browser agent:"
|
|
141
|
+
echo " uv run python browserAgent.py -p 'Navigate to google.com and search for browser automation'"
|
|
142
|
+
echo " # Or with activated venv: python browserAgent.py -p 'Navigate to google.com'"
|
|
143
|
+
echo ""
|
|
144
|
+
echo "✨ The browser agent is now ready with CAPTCHA bypass capabilities!"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TimerResetResponse, RetellGetCallResponse } from '../platform/mindedConnectionTypes';
|
|
2
|
+
export declare function retellCall({ sessionId, callName, callAgentId, vars, }: {
|
|
3
|
+
sessionId: string;
|
|
4
|
+
callName: string;
|
|
5
|
+
callAgentId: string;
|
|
6
|
+
vars?: Record<string, any>;
|
|
7
|
+
}): Promise<TimerResetResponse>;
|
|
8
|
+
export declare function retellGetCall({ sessionId, callId }: {
|
|
9
|
+
sessionId: string;
|
|
10
|
+
callId: string;
|
|
11
|
+
}): Promise<RetellGetCallResponse>;
|
|
12
|
+
//# sourceMappingURL=retell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retell.d.ts","sourceRoot":"","sources":["../../src/internalTools/retell.ts"],"names":[],"mappings":"AACA,OAAO,EAAqC,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAEjI,wBAAsB,UAAU,CAAC,EAC/B,SAAS,EACT,QAAQ,EACR,WAAW,EACX,IAAS,GACV,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC5B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAO9B;AAED,wBAAsB,aAAa,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAKhI"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.retellCall = retellCall;
|
|
37
|
+
exports.retellGetCall = retellGetCall;
|
|
38
|
+
const mindedConnection = __importStar(require("../platform/mindedConnection"));
|
|
39
|
+
const mindedConnectionTypes_1 = require("../platform/mindedConnectionTypes");
|
|
40
|
+
async function retellCall({ sessionId, callName, callAgentId, vars = {}, }) {
|
|
41
|
+
return await mindedConnection.awaitEmit(mindedConnectionTypes_1.mindedConnectionSocketMessageType.RETELL_CALL, {
|
|
42
|
+
sessionId,
|
|
43
|
+
callName,
|
|
44
|
+
callAgentId,
|
|
45
|
+
vars,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
async function retellGetCall({ sessionId, callId }) {
|
|
49
|
+
return await mindedConnection.awaitEmit(mindedConnectionTypes_1.mindedConnectionSocketMessageType.RETELL_GET_CALL, {
|
|
50
|
+
sessionId,
|
|
51
|
+
callId,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=retell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retell.js","sourceRoot":"","sources":["../../src/internalTools/retell.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,gCAiBC;AAED,sCAKC;AA3BD,+EAAiE;AACjE,6EAAiI;AAE1H,KAAK,UAAU,UAAU,CAAC,EAC/B,SAAS,EACT,QAAQ,EACR,WAAW,EACX,IAAI,GAAG,EAAE,GAMV;IACC,OAAO,MAAM,gBAAgB,CAAC,SAAS,CAAC,yDAAiC,CAAC,WAAW,EAAE;QACrF,SAAS;QACT,QAAQ;QACR,WAAW;QACX,IAAI;KACL,CAAC,CAAC;AACL,CAAC;AAEM,KAAK,UAAU,aAAa,CAAC,EAAE,SAAS,EAAE,MAAM,EAAyC;IAC9F,OAAO,MAAM,gBAAgB,CAAC,SAAS,CAAC,yDAAiC,CAAC,eAAe,EAAE;QACzF,SAAS;QACT,MAAM;KACP,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Send a placeholder message to the dashboard voice session.
|
|
3
|
+
* This is typically used for voice sessions to provide immediate feedback to users.
|
|
4
|
+
*
|
|
5
|
+
* @param params - The parameters for sending the placeholder message
|
|
6
|
+
* @param params.sessionId - The session ID of the voice session
|
|
7
|
+
* @param params.message - The placeholder message to send
|
|
8
|
+
* @throws {Error} When the Minded connection is not established
|
|
9
|
+
*/
|
|
10
|
+
export declare function sendPlaceholderMessage(params: {
|
|
11
|
+
sessionId: string;
|
|
12
|
+
message: string;
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=sendPlaceholderMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendPlaceholderMessage.d.ts","sourceRoot":"","sources":["../../src/internalTools/sendPlaceholderMessage.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAAC,MAAM,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAc1G"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.sendPlaceholderMessage = sendPlaceholderMessage;
|
|
37
|
+
const mindedConnection = __importStar(require("../platform/mindedConnection"));
|
|
38
|
+
const mindedConnectionTypes_1 = require("../platform/mindedConnectionTypes");
|
|
39
|
+
/**
|
|
40
|
+
* Send a placeholder message to the dashboard voice session.
|
|
41
|
+
* This is typically used for voice sessions to provide immediate feedback to users.
|
|
42
|
+
*
|
|
43
|
+
* @param params - The parameters for sending the placeholder message
|
|
44
|
+
* @param params.sessionId - The session ID of the voice session
|
|
45
|
+
* @param params.message - The placeholder message to send
|
|
46
|
+
* @throws {Error} When the Minded connection is not established
|
|
47
|
+
*/
|
|
48
|
+
async function sendPlaceholderMessage(params) {
|
|
49
|
+
const { sessionId, message } = params;
|
|
50
|
+
if (!mindedConnection.isConnected()) {
|
|
51
|
+
throw new Error('Minded connection is not established when trying to send placeholder message');
|
|
52
|
+
}
|
|
53
|
+
const connection = mindedConnection;
|
|
54
|
+
connection.emit(mindedConnectionTypes_1.mindedConnectionSocketMessageType.VOICE_PLACEHOLDER_MESSAGES, {
|
|
55
|
+
sessionId,
|
|
56
|
+
message,
|
|
57
|
+
timestamp: Date.now(),
|
|
58
|
+
type: mindedConnectionTypes_1.mindedConnectionSocketMessageType.VOICE_PLACEHOLDER_MESSAGES,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=sendPlaceholderMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendPlaceholderMessage.js","sourceRoot":"","sources":["../../src/internalTools/sendPlaceholderMessage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,wDAcC;AA1BD,+EAAiE;AACjE,6EAAsF;AAEtF;;;;;;;;GAQG;AACI,KAAK,UAAU,sBAAsB,CAAC,MAA8C;IACzF,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IAEtC,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,8EAA8E,CAAC,CAAC;IAClG,CAAC;IAED,MAAM,UAAU,GAAG,gBAAgB,CAAC;IACpC,UAAU,CAAC,IAAI,CAAC,yDAAiC,CAAC,0BAA0B,EAAE;QAC5E,SAAS;QACT,OAAO;QACP,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;QACrB,IAAI,EAAE,yDAAiC,CAAC,0BAA0B;KACnE,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addBrowserTaskNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addBrowserTaskNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAY,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAM7E,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAIjC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIlD,KAAK,wBAAwB,GAAG;IAC9B,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,EAAE,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;CACvD,CAAC;AAEF,eAAO,MAAM,kBAAkB,gCAAuC,wBAAwB,
|
|
1
|
+
{"version":3,"file":"addBrowserTaskNode.d.ts","sourceRoot":"","sources":["../../src/nodes/addBrowserTaskNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAY,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAM7E,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAIjC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIlD,KAAK,wBAAwB,GAAG;IAC9B,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,EAAE,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;CACvD,CAAC;AAEF,eAAO,MAAM,kBAAkB,gCAAuC,wBAAwB,kBA4K7F,CAAC"}
|
|
@@ -77,7 +77,7 @@ ${compiledPrompt}
|
|
|
77
77
|
|
|
78
78
|
${Object.keys(inputParams).length > 0 ? `# Input parameters:\n${JSON.stringify(inputParams, null, 2)}\n\n` : ''}`;
|
|
79
79
|
// Create browser session using socket
|
|
80
|
-
const session = await (0, executeBrowserTask_1.createBrowserSession)(node.proxy);
|
|
80
|
+
const session = await (0, executeBrowserTask_1.createBrowserSession)(node.proxy, node.onPrem);
|
|
81
81
|
if (!session.sessionId || !session.cdpUrl) {
|
|
82
82
|
throw new Error('Failed to create browser session: missing session details');
|
|
83
83
|
}
|
|
@@ -111,6 +111,7 @@ ${Object.keys(inputParams).length > 0 ? `# Input parameters:\n${JSON.stringify(i
|
|
|
111
111
|
liveUrl: session.liveViewUrl,
|
|
112
112
|
keepAlive,
|
|
113
113
|
hooks: node.hooks || [],
|
|
114
|
+
onPrem: node.onPrem,
|
|
114
115
|
},
|
|
115
116
|
},
|
|
116
117
|
});
|