import type { DatabaseSync } from "node:sqlite"; /** * 检索:SQL candidate 阶段绑定 project scope,再 rank/dedupe/budget。 */ export type SearchScope = "project" | "all"; export interface SearchOptions { scope: SearchScope; projectKey?: string; limit?: number; maxLimit?: number; /** 排除当前 session(自动召回) */ excludeSessionId?: string; /** 仅 autoEligible=true */ autoEligibleOnly?: boolean; /** 仅 provenance=verified */ verifiedOnly?: boolean; /** no-hit:词项覆盖低于该阈值的候选丢弃 */ minTermCoverage?: number; } export interface SearchHit { sessionId: string; entryId: string; role: string; occurredAt: string; snippet: string; truncated: boolean; sourceKey: string; contentHash: string; originProjectKey: string; score: number; } export interface SearchResult { ok: true; query: string; hits: SearchHit[]; } /** * 执行搜索。 */ export declare function searchChunks(db: DatabaseSync, rawQuery: string, options: SearchOptions): SearchResult; /** * 词项覆盖率。 */ export declare function computeTermCoverage(text: string, terms: string[]): number; //# sourceMappingURL=search.d.ts.map