/** * Navidrome MCP Server - Search Result Aggregation * Copyright (C) 2025 * SPDX-License-Identifier: AGPL-3.0-or-later */ import type { SongDTO, AlbumDTO, ArtistDTO } from '../../types/index.js'; import type { TransformOptions } from '../../transformers/shared-transformers.js'; export interface ParallelSearchResponses { songsResponse: unknown[]; albumsResponse: unknown[]; artistsResponse: unknown[]; } /** * X-Total-Count per type. `null` means the header was absent and the page length stands in. * `undefined` means the slice was not fetched, so it reports no total. */ export interface ParallelSearchTotals { songsTotal: number | null | undefined; albumsTotal: number | null | undefined; artistsTotal: number | null | undefined; } /** Filters each slice honored. A slice with no honored filters has no entry. */ export interface AppliedFiltersByType { songs?: Record; albums?: Record; artists?: Record; } /** Per-type totals are server match counts, so the LLM can tell whether more pages exist. */ interface AggregatedSearchResult { artists: ArtistDTO[]; albums: AlbumDTO[]; songs: SongDTO[]; totalArtists?: number; totalAlbums?: number; totalSongs?: number; totalResults: number; appliedFilters?: AppliedFiltersByType; } export declare function aggregateSearchResults(responses: ParallelSearchResponses, totals: ParallelSearchTotals, appliedFilters: Record, transformOptions?: TransformOptions): AggregatedSearchResult; interface SearchParamsConfig { artistCount: number; albumCount: number; songCount: number; query: string; offset: number; sort?: string | undefined; order?: 'ASC' | 'DESC' | undefined; randomSeed?: number | undefined; resolvedFilters: Record; year?: number | undefined; starred?: boolean | undefined; } interface ContentTypeParams { songParams: string; albumParams: string; artistParams: string; } export declare function buildContentTypeParams(config: SearchParamsConfig): ContentTypeParams; export {}; //# sourceMappingURL=result-aggregator.d.ts.map