/** * Search Group — Shared Helpers * * Extracted from search.ts to support the search/ module split. * Contains merge/dedup logic and shared constants. */ import type { JournalEntry } from '../../../types/index.js'; import type { IDatabaseAdapter } from '../../../database/core/interfaces.js'; export interface EntryWithSource { content: string; timestamp: string; source: 'personal' | 'team'; team_db?: string; [key: string]: unknown; } export interface ISearchFilters { limit?: number; isPersonal?: boolean; projectNumber?: number; issueNumber?: number; prNumber?: number; prStatus?: string; workflowRunId?: number; tags?: string[]; entryType?: string; startDate?: string; endDate?: string; includeTeam?: boolean; includeArchived?: boolean; workspaceId?: string; } /** * When merging across personal + team DBs, fetch more per-DB so BM25 * ranking in one DB doesn't silently drop entries before the merge. */ export declare function calcPerDbLimit(limit: number, hasTeamDb: boolean): number; /** * Merge multiple arrays of entries, deduplicate by content/source, * and sort by timestamp descending. */ export declare function mergeMultipleSources(sources: EntryWithSource[][], limit?: number, sortBy?: 'timestamp' | 'importance'): EntryWithSource[]; /** * Merge personal and team results, deduplicate by content, * and sort by timestamp descending. */ export declare function mergeAndDedup(personal: EntryWithSource[], team: EntryWithSource[], limit?: number, sortBy?: 'timestamp' | 'importance'): EntryWithSource[]; /** * Filter an entry in-memory according to search options. * Used for post-filtering vector search results which don't support SQL metadata filtering. */ export declare function passMetadataFilters(entry: JournalEntry, options: ISearchFilters, db: IDatabaseAdapter): boolean; //# sourceMappingURL=helpers.d.ts.map