Skip to content

search/build never see integration-contributed components #5258

Closed

Description

@andrskr

Problem

astryx search and astryx build build their component candidate list from gatherComponents(coreDir) in api/search/search.mjs, which only ever scans @astryxdesign/core. A project's configured integrations (astryx.config's integrations array) are never part of that pool — not behind a flag, just absent from the code path.

This means a component that only exists in an integration (no core equivalent, no name collision) is invisible to both search and build, even though component --list and component <Name> already resolve it correctly via the same loadedIntegrations data component/list.mjs already uses.

Repro

Register an integration contributing a component, e.g. OtpField (no core equivalent):

  • astryx component OtpField — finds it.
  • astryx component --list — finds it, tagged with its owning package.
  • astryx search "otp" — returns unrelated doc/template results, never mentions it.
  • astryx build "collect a verification code" — recommends TextInput instead.

For coding agents this is the same class of problem AGENTS.md's "discover, don't guess" workflow is meant to prevent: an agent following that workflow through search/build will never reach an integration's own components, and will reach for whatever core component looks closest instead.

Fix

I have a PR ready: splits gatherComponents into gatherCoreComponents (unchanged) and gatherIntegrationComponents, the latter reusing loadIntegrationsSafely + discoverIntegrationComponents — the same functions component/list.mjs already uses for component --list. gatherComponents merges both; its call site now passes cwd alongside coreDir so the integration lookup has a project root to resolve from.

Activity

  1. HelloOjasMutreja commented on Aug 21, 2026

    @HelloOjasMutreja
    Contributor

    Confirmed against current main: gatherComponents(coreDir) (search.mjs line 361) calls discoverComponents(coreDir) only, no path to loadedIntegrations/discoverIntegrationComponents at all, matching what component/list.mjs already does for component --list. Same gap in the search-results build at line 594-604 (coreDir is the only thing threaded through).

    Since you already have a PR ready, I'll leave it to you rather than duplicate, happy to review once it's up. The gatherCoreComponents/gatherIntegrationComponents split you describe sounds like the right shape, reusing loadIntegrationsSafely matches how component/list.mjs already solved this exact problem.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions