fix(npm-globals): Prune stale Bun globals
Prune stale Bun globals when syncing npm globals.
The npm-global installer only added or updated packages listed in dotfiles/package.json, so packages removed from that manifest could stay behind in ~/.bun/install/global and keep stale shims like ~/.bun/bin/bd alive. That left Bun state inconsistent and could shadow the repo-local bd binary until manually deleted.
This change prunes Bun global dependencies that are no longer declared, falls back to removing stale metadata if Bun leaves it behind, and sweeps dangling shims from ~/.bun/bin. It also adds a shell regression spec covering the stale @beads/bd case.
Summary by cubic
Prunes stale Bun globals during npm-global sync to keep the PATH clean and prevent repo binaries from being shadowed. Removes undeclared packages and dangling shims, covering the @beads/bd case.
- Bug Fixes
- Remove globals not declared in dotfiles (runs bun remove, prunes leftover metadata, deletes modules).
- Sweep dangling shims in ~/.bun/bin to clear broken commands.
- Add shell regression spec for
@beads/bd.