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.
@@ -5486,36 +5486,54 @@ function loadAndRenderScript(scriptFile, vars) {
5486
5486
 
5487
5487
  // ../browse/dist/workspace.js
5488
5488
  var log8 = createLogger("browse");
5489
- function resolveAgentBrowser() {
5489
+ function findAgentBrowser() {
5490
+ let binPath;
5490
5491
  try {
5491
- const binPath = execSync2("which agent-browser", { encoding: "utf-8" }).trim();
5492
- log8.debug(`resolved agent-browser: ${binPath}`);
5493
- let home;
5494
- const binDir = path4.dirname(binPath);
5495
- const npmGlobalCandidate = path4.join(binDir, "..", "lib", "node_modules", "agent-browser");
5496
- if (fs3.existsSync(path4.join(npmGlobalCandidate, "package.json"))) {
5497
- home = path4.resolve(npmGlobalCandidate);
5498
- }
5499
- if (!home) {
5500
- try {
5501
- const realBin = fs3.realpathSync(binPath);
5502
- let dir = path4.dirname(realBin);
5503
- for (let i = 0; i < 5; i++) {
5504
- if (fs3.existsSync(path4.join(dir, "package.json"))) {
5505
- home = dir;
5506
- break;
5507
- }
5508
- dir = path4.dirname(dir);
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
- } catch {
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
@@ -23,7 +23,7 @@ import {
23
23
  timestamp,
24
24
  validate,
25
25
  viewportStringSchema
26
- } from "./chunk-EL4QILVU.js";
26
+ } from "./chunk-IKAOVJCU.js";
27
27
 
28
28
  // src/cli.ts
29
29
  import { defineCommand as defineCommand7, runMain } from "citty";
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  provePr,
6
6
  runAgent,
7
7
  runReview
8
- } from "./chunk-EL4QILVU.js";
8
+ } from "./chunk-IKAOVJCU.js";
9
9
  export {
10
10
  AgexError,
11
11
  isAgexError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agex",
3
- "version": "0.2.11",
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-prove": "0.1.0",
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",