export type DashboardGraphId = string | number; export interface DashboardSearchMemory { id: DashboardGraphId; name: string; tags?: readonly string[]; relative_path: string; } export interface DashboardSearchLink { id: DashboardGraphId; from_memory_id: DashboardGraphId; to_memory_id: DashboardGraphId; } export interface DashboardSearchResult { memory: T; score: number; } /** * Pre-normalized searchable fields for one project. * * Treat this as an opaque snapshot and create a new one when the project's * memories change. Result entries still reference the original memory objects. */ export interface DashboardSearchIndex { readonly kind: "dashboard-search-index"; readonly entries: readonly { readonly memory: T; readonly fields: readonly { readonly weight: number; readonly tokens: readonly string[]; }[]; readonly nameKey: string; readonly pathKey: string; readonly idKey: string; }[]; } export interface DashboardSpotlight { active: boolean; matches: Set; context: Set; connectingEdges: Set; dimNodes: Set; dimEdges: Set; } export interface DashboardSearchApi { normalize(value: unknown): string; buildIndex(memories: readonly T[]): DashboardSearchIndex; search(memories: readonly T[], query: string): DashboardSearchResult[]; search(index: DashboardSearchIndex, query: string): DashboardSearchResult[]; spotlight(query: string, memories: readonly T[], links: readonly DashboardSearchLink[], results: readonly DashboardSearchResult[]): DashboardSpotlight; } /** * Build the dashboard's dependency-free fuzzy-search helpers. * * Keep every implementation detail inside this function. The server injects its * source into the buildless browser asset, while Node tests call the function * directly, so both environments execute the identical implementation. */ export declare function dashboardSearchFactory(): DashboardSearchApi; /** * Source-safe factory for direct interpolation into the embedded dashboard script. * tsx/esbuild adds `__name(...)` bookkeeping to Function#toString output during * tests; it is metadata rather than search logic and has no browser definition. */ export declare const DASHBOARD_SEARCH_FACTORY_SOURCE: string;