import type { AssetContextCost, AssetKind, DemandEvidenceStrength, DemandProfile, RecommendationPolicy, RecommendationSignalMatch, SessionIntent } from "../types.js"; import type { DemandContext } from "./model.js"; /** * Default multiplier applied to a matched signal's weight when the asset's * CURATED IDENTITY contains a declared dependency's package-identity token * (review, #443/#444): the strongest possible demand match — the workspace * declares `@duckdb/node-api` and the asset IS the official duckdb skill — * must outrank merely-exact-stack tiles. Configurable per-workspace through * `policy.scoring.identityMatchMultiplier`. */ export declare const DEFAULT_IDENTITY_MATCH_MULTIPLIER = 4; /** * Collects matched signals from the provided inputs. * * @param assetTermStrength - Optional per-asset provenance map (term → * strength class of the asset content that produced it). When provided, * the reported evidence fields describe evidence ABOUT THE ASSET (how many * of the asset's own terms hit the demand term, and their provenance * strength) instead of the workspace's demand-side evidence (#444). The * match weight still reflects demand intensity. * @param assetIdentityTerms - Optional curated-identity term set * (id/displayName/manifest entry only). When provided, a demand term whose * declared-package identity tokens appear in the asset's curated identity * receives the identity-match multiplier — declared-dependency identity is * the strongest match class (review). */ export declare function collectMatchedSignals(searchTerms: Set, demandContext: DemandContext, policy: RecommendationPolicy, assetTermStrength?: ReadonlyMap, assetIdentityTerms?: ReadonlySet): RecommendationSignalMatch[]; /** * Builds demand context from the provided inputs. * Accepts one or more session intents; multiple intents are merged additively. */ export declare function buildDemandContext(demandProfile: DemandProfile | null, policy: RecommendationPolicy, sessionIntents?: SessionIntent | readonly SessionIntent[]): DemandContext; /** * Determines whether a host concern target has medium/strong supporting demand * evidence after canonicalizing the requested concern through policy synonyms. */ export declare function shouldEnforceConcernTarget(concern: string, demandContext: DemandContext, policy: RecommendationPolicy): boolean; /** * Collapses evidence-strength counts into a capped weighting bucket. */ declare function computeWeightedEvidenceCount(evidenceStrengthCounts: Record): number; /** * Exposes narrow recommend-signals internals for focused tests — the * weighted-evidence computation is the single source of truth for expected * match weights, so tests must never hardcode the bucket value (review). */ export declare const recommendSignalsInternals: { computeWeightedEvidenceCount: typeof computeWeightedEvidenceCount; }; /** * Computes out-of-domain penalty for an entry. * Accepts precomputed domainGroupTermSets to avoid rebuilding per-candidate. */ export declare function computeOutOfDomainPenalty(searchTerms: Set, demandContext: DemandContext, domainGroupTermSets: Map>, outOfDomainGroupPenalty: number): number; /** * Builds coverage tags from the provided inputs. * Accepts precomputed concernTermSets to avoid rebuilding per-candidate. */ export declare function buildCoverageTags(searchTerms: Set, matchedSignals: RecommendationSignalMatch[], concernTermSets: Map>): string[]; /** * Builds task modes from the provided inputs. * Accepts precomputed taskModeTermSets to avoid rebuilding per-candidate. */ export declare function buildTaskModes(searchTerms: Set, coverageTags: string[], matchedSignals: RecommendationSignalMatch[], taskModeTermSets: Map>, contextCost: AssetContextCost): string[]; /** * Builds duplicate group from the provided inputs. */ export declare function buildDuplicateGroup(assetKind: AssetKind, matchedSignals: RecommendationSignalMatch[], coverageTags: string[], existingGroup?: string): string | undefined; /** * Builds a flat alias→canonical lookup map from a policy's synonym table. * * Building this once per scoring run and passing it to `buildSearchTerms` / * `canonicalizePhrase` reduces synonym canonicalization from O(tokens × synonyms) * to O(tokens) — a significant win when scoring thousands of catalog entries. * * @param policy - The recommendation policy whose synonyms table to index. * @returns A map from each normalised alias (and each normalised canonical key * itself) to its normalised canonical form. */ export declare function buildSynonymLookup(policy: RecommendationPolicy): Map; /** * Builds search terms from the provided inputs. * * @param values - Raw term values to normalise and canonicalise. * @param policy - The active recommendation policy. * @param synonymLookup - Optional precomputed alias→canonical map built by * `buildSynonymLookup`. Pass this when calling in a hot loop to avoid * rebuilding it on every invocation. */ export declare function buildSearchTerms(values: string[], policy: RecommendationPolicy, synonymLookup?: Map): Set; /** * Provides normalize phrase for the lifecycle pipeline. */ export declare function normalizePhrase(value: string): string; export {};