Skip to content

refactor: port scripts to sharded discovery adapter, remove store-backed adapter functions#18

Open
sh1ftred wants to merge 1 commit into
mainfrom
feat/modular-architecture
Open

refactor: port scripts to sharded discovery adapter, remove store-backed adapter functions#18
sh1ftred wants to merge 1 commit into
mainfrom
feat/modular-architecture

Conversation

@sh1ftred

@sh1ftred sh1ftred commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes the store-backed createDiscoveryAdapterFromStore and createProviderRegistryFromStore adapter functions. All scripts now use the sharded discovery adapter path instead.

Changes

Deleted

  • createDiscoveryAdapterFromStore()storage/store.ts (~44 lines)
  • createProviderRegistryFromStore()storage/store.ts (~38 lines)
  • Their exports from storage/index.ts
  • Unused DiscoveryAdapter and ProviderRegistry type imports from storage/store.ts

Scripts fully ported (no longer depend on createSdkStore)

  • fetch-routstr21-models.ts
  • list-providers.ts
  • find-cheapest-provider.ts
  • find-model-providers.ts

Scripts partially ported (store kept for StorageAdapter, model parts switched)

  • routstr-cheapest.ts
  • refund-all.ts
  • check-balance.ts
  • create-child-keys.ts

Why

The store-based and sharded adapters were two paths to the same underlying storage driver. The sharded path (createShardedDiscoveryAdapter + createProviderRegistryFromDiscoveryAdapter) is now the single source of truth for model discovery and provider ranking. The store remains only for operational state (API keys, balances, tokens, client IDs).

Verification

  • npx tsc --noEmit reports zero new errors
  • Zero remaining references to createDiscoveryAdapterFromStore or createProviderRegistryFromStore in the codebase

… remove createDiscoveryAdapterFromStore/createProviderRegistryFromStore

All scripts now use createShardedDiscoveryAdapter + createProviderRegistryFromDiscoveryAdapter
instead of the store-backed equivalents. Removed the now-unused store-backed adapter functions:

- createDiscoveryAdapterFromStore (storage/store.ts)
- createProviderRegistryFromStore (storage/store.ts)

Scripts that still need the store for StorageAdapter (tokens, keys, balances) retain createSdkStore
but use the sharded adapter for model discovery and provider ranking.

4 scripts (fetch-routstr21-models, list-providers, find-cheapest-provider, find-model-providers)
no longer depend on createSdkStore at all.
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.

1 participant