/** * Declarations extracted from `memory-preflight-service.ts` by the b1 * file-size campaign: the result/ranking types, the token/CJK constants, * and the pure selection helpers (token gate, entry renderer, one-line * summariser, block item counter). The service re-exports the public type * and imports the helpers back, so importers keep the original path. */ import type { MemoryIndexEntry } from '../memory/memory-search-service.js'; export interface MemoryPreflightResult { available: boolean; block?: string; /** Back-compat: total items emitted (hot + warm). */ feedbackListItems?: number; cachedItemCount?: number; reason?: string; truncated?: boolean | undefined; droppedCount?: number | undefined; hotSelected?: number | undefined; warmSelected?: number | undefined; bytesEmitted?: number | undefined; budgetTruncated?: boolean | undefined; timedOut?: boolean | undefined; } export interface RankedEntry { entry: MemoryIndexEntry; score: number; } /** * Tokens shorter than 4 chars are too promiscuous for literal containment * ("add" is a substring of "padding"), so they rank but do not gate. */ export declare const MIN_TOKEN_LENGTH = 4; /** * Absolute relevance gate: does the token literally occur in the entry? * * The fuzzy kernel's score is normalized per batch (best match = 1.0), so * it cannot distinguish a strong match from the best of a bad lot — an * absolute check is required for the warm gate. CJK titles have no word * boundaries, so those tokens fall back to 2-char gram overlap. */ export declare function tokenHits(text: string, tokens: string[]): number; export declare function renderEntry(entry: MemoryIndexEntry): string; export declare function countItemsInBlock(text: string): number;