@intuned/runtime 1.3.19 → 1.3.21

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.
@@ -0,0 +1,7 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(npm info:*)"
5
+ ]
6
+ }
7
+ }
@@ -113,7 +113,7 @@ _commander.program.description("run the user function in the cli for testing pur
113
113
  runId: (0, _nanoid.nanoid)(),
114
114
  proxy: options.proxy,
115
115
  getAuthSessionParameters: authSessionParametersJson !== undefined ? async () => authSessionParametersJson : undefined
116
- }, () => executeCLI(apiName, mode, inputData, options));
116
+ }, async () => await executeCLI(apiName, mode, inputData, options));
117
117
  process.exit(0);
118
118
  });
119
119
  _commander.program.parse(process.argv);
@@ -114,7 +114,10 @@ async function launchChromium(options) {
114
114
  if (appModeInitialUrl) {
115
115
  extraArgs.push(`--app=${appModeInitialUrl}`);
116
116
  }
117
- if (executablePath) {
117
+ if (stealthConfig.enabled && stealthConfig.type === "intunedBrowser") {
118
+ const stealthExecutablePath = await getIntunedBrowserExecutablePath();
119
+ executablePath = stealthExecutablePath;
120
+ } else if (executablePath) {
118
121
  executablePath = await fs.realpath(executablePath);
119
122
  if (!(await fs.exists(executablePath))) {
120
123
  console.log(`Warning: Executable path ${executablePath} does not exist. Falling back to default.`);
@@ -167,20 +170,13 @@ async function launchChromium(options) {
167
170
  };
168
171
  }
169
172
  async function getIntunedBrowserExecutablePath() {
170
- const intunedPath = process.env.INTUNED_BROWSER_PATH;
173
+ const intunedPath = process.env.INTUNED_STEALTH_CHROMIUM_PATH;
171
174
  if (intunedPath && (await fs.exists(intunedPath))) {
172
175
  return intunedPath;
173
176
  }
174
177
  return undefined;
175
178
  }
176
179
  async function getBrowserExecutablePath() {
177
- const stealthConfig = await (0, _intunedJson.getStealthModeConfig)();
178
- if (stealthConfig.enabled && stealthConfig.type === "intunedBrowser") {
179
- const intunedPath = await getIntunedBrowserExecutablePath();
180
- if (intunedPath) {
181
- return intunedPath;
182
- }
183
- }
184
180
  const browserType = getBrowserType();
185
181
  if (browserType === "brave") {
186
182
  return await getBraveExecutablePath();
@@ -126,6 +126,7 @@ var require_errors = __commonJS({
126
126
  var AutomationError = class extends RunAutomationError {
127
127
  constructor(error) {
128
128
  super(exports2.automationError, `[${error?.name ?? error}] ${error?.message}`);
129
+ this.error = error;
129
130
  this.details = {
130
131
  ...error,
131
132
  name: error?.name,
@@ -384,7 +385,10 @@ var require_interfaceClient = __commonJS({
384
385
  if (!(chunk instanceof Buffer)) {
385
386
  break;
386
387
  }
387
- buffer = Buffer.concat([buffer, chunk]);
388
+ buffer = Buffer.concat([
389
+ buffer,
390
+ chunk
391
+ ]);
388
392
  if (buffer.length < _SocketClient.LENGTH_HEADER_LENGTH) {
389
393
  continue;
390
394
  }
@@ -445,8 +449,8 @@ var require_interfaceClient = __commonJS({
445
449
  async close() {
446
450
  this.fileStream.close();
447
451
  await Promise.race([
448
- new Promise((resolve) => this.fileStream.once("close", resolve)),
449
- new Promise((resolve) => this.fileStream.once("error", resolve)),
452
+ new Promise((resolve) => this.fileStream.once("close", () => resolve(void 0))),
453
+ new Promise((resolve) => this.fileStream.once("error", () => resolve(void 0))),
450
454
  (0, promises_1.setTimeout)(3e3)
451
455
  ]);
452
456
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime",
3
- "version": "1.3.19",
3
+ "version": "1.3.21",
4
4
  "description": "Intuned runtime",
5
5
  "packageManager": "yarn@4.12.0",
6
6
  "main": "./dist/index.js",