import type { AuraCanonicalAsset } from "./CanonicalAsset.js"; import type { FetchJson, ResolveQuery, SourceAdapter } from "./SourceAdapter.js"; export interface ResolveCandidate { readonly asset: AuraCanonicalAsset; readonly score: number; } export interface ResolveResult { readonly query: ResolveQuery; readonly candidates: readonly ResolveCandidate[]; /** Non-fatal per-source failures, so a dead source is visible, not silent. */ readonly warnings: readonly string[]; } /** * Optional ranking seam. When provided, it replaces the default keyword * `scoreAsset` ordering with a custom (e.g. semantic-embedding) ranker. It * receives the constraint-filtered candidate pool and returns each asset paired * with a score, already ordered best-first. The resolver consumes that order * directly. See `embeddingRanker` in `embedding.ts` for the default semantic * implementation (partially apply its `provider` to match this signature). */ export type Ranker = (query: string, assets: readonly AuraCanonicalAsset[]) => Promise<{ asset: AuraCanonicalAsset; score: number; }[]>; export interface FederatedResolverOptions { readonly adapters: readonly SourceAdapter[]; readonly fetchJson?: FetchJson; /** Max candidates returned after ranking. Default 10. */ readonly limit?: number; /** * Optional ranking override. Defaults to the keyword `scoreAsset` path when * undefined, preserving existing behavior exactly. */ readonly ranker?: Ranker; } /** * Federates a query across every configured source adapter in parallel, * normalizes + constraint-filters + ranks the merged pool, and returns the top * candidates. A source that throws contributes a warning instead of failing the * whole resolve — federation degrades, it does not collapse. */ export declare class FederatedResolver { private readonly adapters; private readonly ctx; private readonly limit; private readonly ranker?; constructor(options: FederatedResolverOptions); resolve(query: ResolveQuery): Promise; /** * Rank the filtered pool through an injected ranker, consuming its returned * order directly. Ties are re-broken by id so the ordering stays stable and * deterministic even if the ranker leaves equal scores unordered. */ private rankWith; } //# sourceMappingURL=federate.d.ts.map