pi-agent-browser-native 0.2.20 → 0.2.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.2.21 - 2026-05-07
6
+
7
+ ### Fixed
8
+ - fixed the published `pi-agent-browser-doctor` bin entrypoint so it runs when invoked through npm's `.bin` symlink
9
+
5
10
  ## 0.2.20 - 2026-05-07
6
11
 
7
12
  ### Compatibility
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-browser-native",
3
- "version": "0.2.20",
3
+ "version": "0.2.21",
4
4
  "description": "pi extension that exposes agent-browser as a native tool for browser automation",
5
5
  "type": "module",
6
6
  "author": "Mitch Fultz (https://github.com/fitchmultz)",
@@ -8,6 +8,7 @@
8
8
  */
9
9
 
10
10
  import { execFile as execFileCallback } from "node:child_process";
11
+ import { realpathSync } from "node:fs";
11
12
  import { access, readFile } from "node:fs/promises";
12
13
  import { homedir } from "node:os";
13
14
  import { dirname, resolve, sep } from "node:path";
@@ -415,7 +416,16 @@ export async function main(argv = process.argv.slice(2)) {
415
416
  return 0;
416
417
  }
417
418
 
418
- if (import.meta.url === `file://${process.argv[1]}`) {
419
+ export function isDirectRun(metaUrl, argv1 = process.argv[1], resolveRealPath = realpathSync) {
420
+ if (!argv1) return false;
421
+ try {
422
+ return resolveRealPath(argv1) === fileURLToPath(metaUrl);
423
+ } catch {
424
+ return false;
425
+ }
426
+ }
427
+
428
+ if (isDirectRun(import.meta.url)) {
419
429
  main().then((exitCode) => {
420
430
  process.exitCode = exitCode;
421
431
  });