/** * In-memory bilingual (Latin + CJK) BM25F search index for skills. * * Indexes name, category/tags, descriptions (default + en/zh-CN localizations), * and SKILL.md H1-H3 headings so large skill libraries stay fast and discoverable * without database migrations or prompt bloat. */ import type { Skill, SkillsConfig } from './types.js'; declare const FIELD_WEIGHTS: { readonly name: 4; readonly taxonomy: 3; readonly description: 2; readonly headings: 1; }; type FieldName = keyof typeof FIELD_WEIGHTS; export interface SkillSearchOptions { query?: string; category?: string; limit?: number; offset?: number; skillsConfig?: SkillsConfig; } export interface SkillSearchHit { skill: Skill; score: number; matchedOn: FieldName[]; } export interface SkillCategorySummary { category: string; count: number; } export interface SkillSearchResult { total: number; returned: number; offset: number; hasMore: boolean; categories: SkillCategorySummary[]; hits: SkillSearchHit[]; } /** * Tokenize mixed English/identifier/CJK text into search terms. * - Splits camelCase and kebab/snake identifiers * - Generates Han bigrams (and short whole Han runs) for Chinese recall */ export declare function tokenizeSkillText(text: string): string[]; export declare class SkillSearchIndex { private docs; private docFreq; private avgFieldLen; private totalDocs; constructor(skills: Skill[]); private build; search(visibleSkills: Skill[], options?: SkillSearchOptions): SkillSearchResult; } export {};