prime-agent
prime-agent copied to clipboard
fix(coding-agent): preserve Homebrew update ownership
Summary
- detect npm packages installed inside a Homebrew Cellar as Homebrew-managed
- prevent
prime-agent updatefrom 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-agentwith 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 upgradeinstructions
- Adds
isHomebrewInstall()in config.ts to detect Cellar keg paths (/cellar/+/libexec/lib/node_modules/) and classifies them as"homebrew"indetectInstallMethod().getSelfUpdateCommandForMethod()returnsundefinedfor 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.