browser-use 0.7.0 → 0.7.1
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/cli.js +3 -2
- package/dist/entrypoint.d.ts +1 -0
- package/dist/entrypoint.js +27 -0
- package/dist/skill-cli/direct.js +3 -2
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -34,6 +34,7 @@ import { get_browser_use_version } from './utils.js';
|
|
|
34
34
|
import { setupLogging } from './logging-config.js';
|
|
35
35
|
import { get_tunnel_manager } from './skill-cli/tunnel.js';
|
|
36
36
|
import { DeviceAuthClient, save_cloud_api_token } from './sync/auth.js';
|
|
37
|
+
import { isMainModule } from './entrypoint.js';
|
|
37
38
|
import dotenv from 'dotenv';
|
|
38
39
|
dotenv.config({ quiet: true });
|
|
39
40
|
const require = createRequire(import.meta.url);
|
|
@@ -2841,6 +2842,6 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
2841
2842
|
process.exit(1);
|
|
2842
2843
|
}
|
|
2843
2844
|
}
|
|
2844
|
-
if (import.meta.url
|
|
2845
|
-
main();
|
|
2845
|
+
if (isMainModule(import.meta.url)) {
|
|
2846
|
+
void main();
|
|
2846
2847
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isMainModule: (moduleUrl: string, argv1?: string | undefined) => boolean;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
const comparablePath = (filePath) => {
|
|
5
|
+
const absolutePath = path.resolve(filePath);
|
|
6
|
+
let resolvedPath = absolutePath;
|
|
7
|
+
try {
|
|
8
|
+
resolvedPath = fs.realpathSync.native(absolutePath);
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
resolvedPath = absolutePath;
|
|
12
|
+
}
|
|
13
|
+
return process.platform === 'win32'
|
|
14
|
+
? resolvedPath.toLowerCase()
|
|
15
|
+
: resolvedPath;
|
|
16
|
+
};
|
|
17
|
+
export const isMainModule = (moduleUrl, argv1 = process.argv[1]) => {
|
|
18
|
+
if (!argv1) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
return comparablePath(fileURLToPath(moduleUrl)) === comparablePath(argv1);
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
};
|
package/dist/skill-cli/direct.js
CHANGED
|
@@ -6,6 +6,7 @@ import net from 'node:net';
|
|
|
6
6
|
import { spawn } from 'node:child_process';
|
|
7
7
|
import { BrowserSession, systemChrome } from '../browser/session.js';
|
|
8
8
|
import { CloudBrowserClient } from '../browser/cloud/cloud.js';
|
|
9
|
+
import { isMainModule } from '../entrypoint.js';
|
|
9
10
|
const getSafeUserSegment = () => {
|
|
10
11
|
if (typeof process.getuid === 'function') {
|
|
11
12
|
return String(process.getuid());
|
|
@@ -1170,11 +1171,11 @@ export const run_direct_command = async (argv, options = {}) => {
|
|
|
1170
1171
|
};
|
|
1171
1172
|
export const main = async (argv = process.argv.slice(2)) => {
|
|
1172
1173
|
const exitCode = await run_direct_command(argv);
|
|
1173
|
-
if (import.meta.url
|
|
1174
|
+
if (isMainModule(import.meta.url)) {
|
|
1174
1175
|
process.exit(exitCode);
|
|
1175
1176
|
}
|
|
1176
1177
|
return exitCode;
|
|
1177
1178
|
};
|
|
1178
|
-
if (import.meta.url
|
|
1179
|
+
if (isMainModule(import.meta.url)) {
|
|
1179
1180
|
void main();
|
|
1180
1181
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "browser-use",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "A TypeScript-first library for programmatic browser control, designed for building AI-powered web agents.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -395,7 +395,7 @@
|
|
|
395
395
|
"protobufjs": "7.6.1",
|
|
396
396
|
"qs": "6.15.2",
|
|
397
397
|
"rollup": "4.59.0",
|
|
398
|
-
"tmp": "0.2.
|
|
398
|
+
"tmp": "0.2.6",
|
|
399
399
|
"uuid": "11.1.1",
|
|
400
400
|
"ws": "8.21.0"
|
|
401
401
|
}
|