prime-agent icon indicating copy to clipboard operation
prime-agent copied to clipboard

fix(coding-agent): preserve Homebrew update ownership

Open fettpl opened this issue 3 months ago • 0 comments

Summary

  • detect npm packages installed inside a Homebrew Cellar as Homebrew-managed
  • prevent prime-agent update from constructing an npm command that mutates the versioned keg
  • direct Homebrew users to brew upgrade prime-agent

Verification

  • npx tsx ../../node_modules/vitest/dist/cli.js --run test/config.test.ts (21 tests passed)
  • npm run check
  • reproduced against the local 0.7.0 formula install: the current release constructs npm --prefix /opt/homebrew/Cellar/prime-agent/0.7.0/libexec install -g prime-agent with normal permissions

Fixes #844. Supports the official Homebrew submission tracked in #843.

@badlogic please review the package-manager ownership behavior.

[!NOTE]

Prevent self-update for Homebrew-managed installs and show brew upgrade instructions

  • Adds isHomebrewInstall() in config.ts to detect Cellar keg paths (/cellar/ + /libexec/lib/node_modules/) and classifies them as "homebrew" in detectInstallMethod().
  • getSelfUpdateCommandForMethod() returns undefined for Homebrew installs, suppressing self-update attempts.
  • getSelfUpdateUnavailableInstruction() now returns "Update with: brew upgrade <APP_NAME>" for Homebrew installs instead of a generic message.
  • Homebrew installs report no global package roots via getGlobalPackageRoots().

Macroscope summarized ec712a6.

fettpl avatar Aug 07 '26 10:08 fettpl