Provider Manager
The Provider Manager orchestrates multiple skill providers, providing a unified search interface that queries all registered providers, merges results, and handles graceful degradation when providers are unavailable.createProviderManager
Create a provider manager that orchestrates multiple skill providers.Return Type
SkillProvider Interface
All skill providers must implement theSkillProvider interface:
SkillSearchResult Type
Example Usage
How It Works
Priority Ordering
Providers registered first have higher priority. When search results from multiple providers match, higher-priority results appear first in the merged results.Result Deduplication
The manager automatically deduplicates results using a composite key of(source, id). If multiple providers return the same skill, only the first occurrence (by priority) is kept.
Graceful Degradation
- Checks
provider.isAvailable()before querying - Catches and logs errors from individual providers
- Continues querying remaining providers if one fails
- Returns best-effort results even if some providers are unavailable
Search Algorithm
- Iterate through providers in priority order
- Skip unavailable providers
- Query each provider for up to
limitresults - Merge all results into a single list
- Deduplicate by
(source, id)key - Truncate to
limittotal results
Source Code Reference
Implementation:src/core/providers/manager.ts
Base interface: src/core/providers/base.ts