Skip to content

fix(hub): stop offering a GAIA install a non-agent card rules out - #3232

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
autofix/issue-3231
Open

fix(hub): stop offering a GAIA install a non-agent card rules out#3232
github-actions[bot] wants to merge 1 commit into
mainfrom
autofix/issue-3231

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

A hub page for a component or app that ships an npm package sent readers down a path the same page had just ruled out: the big primary button said Open in GAIA while the install card right above it offered only a platform download and npm install -g. Now the buttons are read off the install methods the card actually prints, so such an entry links to npm instead. Nothing in the live catalog hits this today — gaia-ui would be the first — and every currently published page renders unchanged.

Closes #3231

Test plan

  • cd website && npm test passes (78 tests, incl. new coverage for a non-agent with an npm_package)
  • cd website && npx astro check reports 0 errors
  • Build against a catalog entry with type: "app" and an npm_package, and confirm /hub/<id> shows View on npm as the primary button and no gaia://hub/install/ link
  • /hub/email, /hub/gaia, /hub/terminal-hub render byte-identically to main
🔍 Technical details

Root cause. InstallCard.astro gated the button row on bare !!agent.npm_package, while the commands above it come from installMethods(), which branches on the lane (isAgent / isSkill). A type: "app" | "component" entry with an npm_package therefore got the agent branch's Open in GAIA deep link (gaia://hub/install/<id> — the Electron install action, see services/deep-link.cjs) even though installMethods() had returned Download + npm install -g.

Change. New installCta() in catalog.ts:552 derives the buttons from installMethods()'s own keys rather than re-deriving the lane, so the two can't drift again:

  • gaia / skill method present + npmgaia+npm (unchanged: GAIA primary, npm secondary)
  • npm with no GAIA install → npm (npm becomes the primary CTA) ← the fix
  • otherwise → gaia (unchanged)

A skill that ever carried an npm_package now also stays on GAIA alone, since its card shows no npm command.

Verification. Built the site twice (patched vs. main) against a local fixture catalog containing email (agent+npm), gaia (agent), terminal-hub (component), web-research (skill) and a gaia-ui (app+npm) entry, then diffed the generated HTML: the four existing shapes are byte-identical and only the app+npm page changes, from Open in GAIA + View on npm to View on npm alone. npx astro check: 0 errors. npm test: 78 pass.

Repo-level checks (nothing Python changed): python util/lint.py --all passes every check except the environmental "Import Validation" step, which fails here because GAIA isn't importable from /bin/python. pytest tests/unit/ — 10370 passed, 3 failed, all three in test_hub_installer.py / test_registry_installed_import.py from No module named pip inside the uv venv, unrelated to this diff.

Left alone deliberately. A download-only component (terminal-hub) still gets the Open in GAIA deep link it has always had. Whether that link means anything for a component is a separate, pre-existing question — the issue's acceptance criteria pin terminal-hub's output as unchanged, so it isn't touched here.

A component or app that ships an npm package rendered "Open in GAIA" as its
primary button while the install card above it offered only a platform download
and `npm install -g` — neither of which installs into the GAIA app. The button
gate keyed off `npm_package` alone; the commands key off the lane.

The buttons are now read off installMethods(), so a CTA can never offer a path
the command above it did not: a component/app with an npm package links to npm,
and every existing entry renders exactly as before.

Closes #3231
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(hub): a non-agent entry with an npm package would get an install button its own card contradicts

0 participants