feat(core,mcp): source-targeted search via SearchInput.sources#23
Merged
Conversation
Add `SearchInput.sources?: string[]` to @refkit/core: restrict a search to specific provider ids (intersected with modality matching), so a caller can scope a search-engine operator (e.g. `site:xiaohongshu.com` on Brave) to one web-discovery source without polluting the other providers' queries. Omit it to fan out to every configured source, unchanged. Selection stays fail-loud: a `sources` list matching no provider for the requested modalities throws (a typo must not read as "no results"); an id that resolves to nothing while others still match goes to `meta.warnings`. Providers excluded by an explicit `sources` filter report `reason: 'not-selected'` in `meta.providers`, distinct from `'unsupported-modality'`. @refkit/mcp `search_references` gains a `sources` param (its description enumerates the server's enabled source ids) and turns a source-selection miss into an agent-friendly tool error listing the valid ids.
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.
What
Adds
SearchInput.sources?: string[]— restrict a search's fan-out to the named provider ids (intersected with modality matching). Lets a caller scope search-engine operators (e.g.site:queries on a web-discovery source) without polluting every other provider's shared query text.Semantics
sourcesomitted → fan out to all configured providers (unchanged).meta.warningsentry.metaasskippedwith a dedicated reason, parallel tounsupported-modality.sourcesunchanged (page/seen semantics are global).MCP
search_referencestool schema gainssources?: string[]; unknown-source errors are rewrapped listing the enabled source ids.Verification (post-rebase onto d27619d)
pnpm typecheckexit 0 ·pnpm vitest run386 passed / 22 skipped / 0 failed · lint cleanNote: touches the same mcp files as the provider-nailbook PR; whichever lands second needs a trivial rebase.