refactor: port scripts to sharded discovery adapter, remove store-backed adapter functions#18
Open
sh1ftred wants to merge 1 commit into
Open
refactor: port scripts to sharded discovery adapter, remove store-backed adapter functions#18sh1ftred wants to merge 1 commit into
sh1ftred wants to merge 1 commit into
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the store-backed
createDiscoveryAdapterFromStoreandcreateProviderRegistryFromStoreadapter 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)storage/index.tsDiscoveryAdapterandProviderRegistrytype imports fromstorage/store.tsScripts fully ported (no longer depend on
createSdkStore)fetch-routstr21-models.tslist-providers.tsfind-cheapest-provider.tsfind-model-providers.tsScripts partially ported (store kept for StorageAdapter, model parts switched)
routstr-cheapest.tsrefund-all.tscheck-balance.tscreate-child-keys.tsWhy
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 --noEmitreports zero new errorscreateDiscoveryAdapterFromStoreorcreateProviderRegistryFromStorein the codebase