Skip to content

Populate AdapterCapabilities dynamically for the API adapter #6

@cuibonobo

Description

@cuibonobo

The current AdapterCapabilities type is declared statically by each adapter at construction time. For the API adapter this won’t work — its capabilities depend on what the server reports via the /.well-known/stack discovery endpoint, which is only known after a network call.

Changes needed

The API adapter’s open() factory should call the discovery endpoint and populate capabilities before returning, so by the time Stack.create() is called they are already available synchronously. This keeps the StackAdapter interface unchanged — capabilities stays a synchronous readonly property — but the API adapter populates it during its async open() call rather than hardcoding it.

Notes

  • The SQLite and JSON adapters can continue to declare capabilities statically — no changes needed for them.
  • No changes to packages/core are strictly required. This issue exists to document the pattern the API adapter must follow when it is built.
  • Addresses the pattern before @haverstack/adapter-api is written to avoid a design mistake.

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