@indigoai-us/hq-cli 5.345.45 → 5.345.47

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.
@@ -1395,6 +1395,43 @@ function probeCliVersion(bin) {
1395
1395
  return null;
1396
1396
  }
1397
1397
  }
1398
+ /**
1399
+ * Detect a second pnpm global install winning PATH before the updater mutates
1400
+ * the running install. pnpm homes have independent global package trees and
1401
+ * shims, so writing one home cannot change a different home that appears first
1402
+ * on PATH.
1403
+ */
1404
+ export function pnpmPathConflict(install) {
1405
+ if (install.manager !== "pnpm" || !install.packageRoot)
1406
+ return null;
1407
+ const bin = resolveHqOnPath();
1408
+ if (!bin)
1409
+ return null;
1410
+ const pathPackageRoot = findPackageRootForExecutable(bin);
1411
+ if (!pathPackageRoot ||
1412
+ globalInstallManagerForPath(bin, pathPackageRoot) !== "pnpm") {
1413
+ return null;
1414
+ }
1415
+ // The fallback resolver scans every hash in a PNPM_HOME because generated
1416
+ // shims do not expose their target. Multiple installs in the SAME home can
1417
+ // therefore produce an arbitrary package root; only a different home means
1418
+ // that updating this install cannot change which global shim wins PATH.
1419
+ const runningHome = derivePnpmHome(install);
1420
+ const pathHome = derivePnpmHome({ manager: "pnpm", prefix: null, packageRoot: pathPackageRoot });
1421
+ if (!runningHome || !pathHome || samePath(runningHome, pathHome))
1422
+ return null;
1423
+ let resolvedBin = bin;
1424
+ try {
1425
+ resolvedBin = realpathSync(bin);
1426
+ }
1427
+ catch {
1428
+ // Keep the PATH entry when a platform shim cannot be canonicalized.
1429
+ }
1430
+ const version = probeCliVersion(bin) ?? "unknown";
1431
+ return (`PATH resolves ${resolvedBin} at version ${version} (manager: pnpm), ` +
1432
+ `but this process is running from a different pnpm install at ${install.packageRoot}. ` +
1433
+ "Refusing to update one pnpm home while another hq-cli install wins PATH resolution.");
1434
+ }
1398
1435
  /**
1399
1436
  * Read-your-writes convergence check, run after an install reports success.
1400
1437
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigoai-us/hq-cli",
3
- "version": "5.345.45",
3
+ "version": "5.345.47",
4
4
  "description": "HQ by Indigo management CLI — modules and cloud sync",
5
5
  "main": "dist/index.js",
6
6
  "bin": {