agex 0.2.11 → 0.2.12
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/{chunk-EL4QILVU.js → chunk-IKAOVJCU.js} +43 -25
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +5 -5
|
@@ -5486,36 +5486,54 @@ function loadAndRenderScript(scriptFile, vars) {
|
|
|
5486
5486
|
|
|
5487
5487
|
// ../browse/dist/workspace.js
|
|
5488
5488
|
var log8 = createLogger("browse");
|
|
5489
|
-
function
|
|
5489
|
+
function findAgentBrowser() {
|
|
5490
|
+
let binPath;
|
|
5490
5491
|
try {
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5492
|
+
binPath = execSync2("which agent-browser", { encoding: "utf-8" }).trim();
|
|
5493
|
+
} catch {
|
|
5494
|
+
return void 0;
|
|
5495
|
+
}
|
|
5496
|
+
log8.debug(`resolved agent-browser: ${binPath}`);
|
|
5497
|
+
let home;
|
|
5498
|
+
const binDir = path4.dirname(binPath);
|
|
5499
|
+
const npmGlobalCandidate = path4.join(binDir, "..", "lib", "node_modules", "agent-browser");
|
|
5500
|
+
if (fs3.existsSync(path4.join(npmGlobalCandidate, "package.json"))) {
|
|
5501
|
+
home = path4.resolve(npmGlobalCandidate);
|
|
5502
|
+
}
|
|
5503
|
+
if (!home) {
|
|
5504
|
+
try {
|
|
5505
|
+
const realBin = fs3.realpathSync(binPath);
|
|
5506
|
+
let dir = path4.dirname(realBin);
|
|
5507
|
+
for (let i = 0; i < 5; i++) {
|
|
5508
|
+
if (fs3.existsSync(path4.join(dir, "package.json"))) {
|
|
5509
|
+
home = dir;
|
|
5510
|
+
break;
|
|
5509
5511
|
}
|
|
5510
|
-
|
|
5512
|
+
dir = path4.dirname(dir);
|
|
5511
5513
|
}
|
|
5514
|
+
} catch {
|
|
5512
5515
|
}
|
|
5513
|
-
log8.debug(`agent-browser home: ${home ?? "not found"}`);
|
|
5514
|
-
return { bin: binPath, home };
|
|
5515
|
-
} catch {
|
|
5516
|
-
log8.warn("agent-browser not found in PATH, using bare command name");
|
|
5517
|
-
return { bin: "agent-browser" };
|
|
5518
5516
|
}
|
|
5517
|
+
log8.debug(`agent-browser home: ${home ?? "not found"}`);
|
|
5518
|
+
return { bin: binPath, home };
|
|
5519
|
+
}
|
|
5520
|
+
function resolveAgentBrowser() {
|
|
5521
|
+
const found = findAgentBrowser();
|
|
5522
|
+
if (found)
|
|
5523
|
+
return found;
|
|
5524
|
+
log8.info("agent-browser not found in PATH, installing globally...");
|
|
5525
|
+
try {
|
|
5526
|
+
execSync2("npm install -g agent-browser", { encoding: "utf-8", stdio: "pipe" });
|
|
5527
|
+
log8.info("agent-browser installed successfully");
|
|
5528
|
+
} catch (err) {
|
|
5529
|
+
const detail = (err?.stderr ?? err?.stdout)?.toString().trim() || err?.message || "";
|
|
5530
|
+
throw new BrowserError(`Failed to install agent-browser globally: ${detail}`);
|
|
5531
|
+
}
|
|
5532
|
+
const installed = findAgentBrowser();
|
|
5533
|
+
if (!installed) {
|
|
5534
|
+
throw new BrowserError("agent-browser not found in PATH after global install");
|
|
5535
|
+
}
|
|
5536
|
+
return installed;
|
|
5519
5537
|
}
|
|
5520
5538
|
function buildFxInjectHelper(sessionArg, initScriptPath) {
|
|
5521
5539
|
return `
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agex",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"tsup": "^8.4.0",
|
|
26
26
|
"typescript": "^5.9.3",
|
|
27
27
|
"vitest": "^2.1.9",
|
|
28
|
-
"agex-agent": "0.1.0",
|
|
29
28
|
"agex-browse": "0.1.0",
|
|
29
|
+
"agex-core": "0.1.0",
|
|
30
|
+
"agex-agent": "0.1.0",
|
|
31
|
+
"agex-prove": "0.1.0",
|
|
30
32
|
"agex-prove-pr": "0.1.0",
|
|
31
33
|
"agex-demo": "0.1.0",
|
|
32
|
-
"agex-
|
|
33
|
-
"agex-review": "0.1.0",
|
|
34
|
-
"agex-core": "0.1.0"
|
|
34
|
+
"agex-review": "0.1.0"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "tsc -p tsconfig.json",
|