import type { ObservationIndex, ObservationType } from "../types"; /** Parameters that influence observation relevance scoring. */ export interface ScoringContext { /** Boost observations from the current session */ currentSessionId?: string; /** Reference time for recency scoring */ now: Date; } /** * Compute recency score using a step function. * * - Today (< 24h): 1.0 * - Yesterday (24-48h): 0.8 * - Last week (2-7 days): 0.5 * - Older (> 7 days): 0.2 */ export declare function scoreRecency(createdAt: string, now: Date): number; /** * Score based on observation type importance. * Decisions and bugfixes are most valuable; changes are least. */ export declare function scoreTypeImportance(type: ObservationType): number; /** * Boost observations from the current session. * Current session = 1.0, other sessions = 0.3. */ export declare function scoreSessionAffinity(entrySessionId: string, currentSessionId: string | undefined): number; /** * Smaller observations score higher — they give more info per token. * Linear interpolation between MIN_EFFICIENT_TOKENS (score=1.0) * and MAX_EFFICIENT_TOKENS (score=0.2). */ export declare function scoreTokenEfficiency(tokenCount: number): number; /** * Compute a weighted relevance score for an observation index entry. * * Score = recency * 0.4 + typeImportance * 0.3 + sessionAffinity * 0.2 + tokenEfficiency * 0.1 * * Returns a value in [0, 1] where higher = more relevant. */ export declare function scoreObservation(entry: ObservationIndex, context: ScoringContext): number; /** * Sort observation index entries by relevance score (descending). * Returns a new array — does not mutate the input. */ export declare function sortByRelevance(entries: ReadonlyArray, context: ScoringContext): ObservationIndex[]; //# sourceMappingURL=relevance.d.ts.map