navidrome-mcp 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/README.md +397 -0
- package/dist/capabilities.d.ts +20 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +25 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/client/auth-manager.d.ts +27 -0
- package/dist/client/auth-manager.d.ts.map +1 -0
- package/dist/client/auth-manager.js +54 -0
- package/dist/client/auth-manager.js.map +1 -0
- package/dist/client/navidrome-client.d.ts +28 -0
- package/dist/client/navidrome-client.d.ts.map +1 -0
- package/dist/client/navidrome-client.js +84 -0
- package/dist/client/navidrome-client.js.map +1 -0
- package/dist/config.d.ts +41 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +132 -0
- package/dist/config.js.map +1 -0
- package/dist/constants/defaults.d.ts +29 -0
- package/dist/constants/defaults.d.ts.map +1 -0
- package/dist/constants/defaults.js +37 -0
- package/dist/constants/defaults.js.map +1 -0
- package/dist/constants/timeouts.d.ts +66 -0
- package/dist/constants/timeouts.d.ts.map +1 -0
- package/dist/constants/timeouts.js +66 -0
- package/dist/constants/timeouts.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +70 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/index.d.ts +21 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +83 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/schemas/common.d.ts +68 -0
- package/dist/schemas/common.d.ts.map +1 -0
- package/dist/schemas/common.js +69 -0
- package/dist/schemas/common.js.map +1 -0
- package/dist/schemas/index.d.ts +21 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +24 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/pagination.d.ts +153 -0
- package/dist/schemas/pagination.d.ts.map +1 -0
- package/dist/schemas/pagination.js +93 -0
- package/dist/schemas/pagination.js.map +1 -0
- package/dist/schemas/validation.d.ts +147 -0
- package/dist/schemas/validation.d.ts.map +1 -0
- package/dist/schemas/validation.js +143 -0
- package/dist/schemas/validation.js.map +1 -0
- package/dist/tools/handlers/lastfm-handlers.d.ts +5 -0
- package/dist/tools/handlers/lastfm-handlers.d.ts.map +1 -0
- package/dist/tools/handlers/lastfm-handlers.js +143 -0
- package/dist/tools/handlers/lastfm-handlers.js.map +1 -0
- package/dist/tools/handlers/lyrics-handlers.d.ts +5 -0
- package/dist/tools/handlers/lyrics-handlers.d.ts.map +1 -0
- package/dist/tools/handlers/lyrics-handlers.js +51 -0
- package/dist/tools/handlers/lyrics-handlers.js.map +1 -0
- package/dist/tools/handlers/playlist-handlers.d.ts +5 -0
- package/dist/tools/handlers/playlist-handlers.d.ts.map +1 -0
- package/dist/tools/handlers/playlist-handlers.js +316 -0
- package/dist/tools/handlers/playlist-handlers.js.map +1 -0
- package/dist/tools/handlers/queue-handlers.d.ts +5 -0
- package/dist/tools/handlers/queue-handlers.d.ts.map +1 -0
- package/dist/tools/handlers/queue-handlers.js +135 -0
- package/dist/tools/handlers/queue-handlers.js.map +1 -0
- package/dist/tools/handlers/radio-handlers.d.ts +5 -0
- package/dist/tools/handlers/radio-handlers.d.ts.map +1 -0
- package/dist/tools/handlers/radio-handlers.js +323 -0
- package/dist/tools/handlers/radio-handlers.js.map +1 -0
- package/dist/tools/handlers/registry.d.ts +26 -0
- package/dist/tools/handlers/registry.d.ts.map +1 -0
- package/dist/tools/handlers/registry.js +77 -0
- package/dist/tools/handlers/registry.js.map +1 -0
- package/dist/tools/handlers/search-handlers.d.ts +5 -0
- package/dist/tools/handlers/search-handlers.d.ts.map +1 -0
- package/dist/tools/handlers/search-handlers.js +125 -0
- package/dist/tools/handlers/search-handlers.js.map +1 -0
- package/dist/tools/handlers/tag-handlers.d.ts +5 -0
- package/dist/tools/handlers/tag-handlers.d.ts.map +1 -0
- package/dist/tools/handlers/tag-handlers.js +155 -0
- package/dist/tools/handlers/tag-handlers.js.map +1 -0
- package/dist/tools/handlers/user-preferences-handlers.d.ts +5 -0
- package/dist/tools/handlers/user-preferences-handlers.d.ts.map +1 -0
- package/dist/tools/handlers/user-preferences-handlers.js +155 -0
- package/dist/tools/handlers/user-preferences-handlers.js.map +1 -0
- package/dist/tools/index.d.ts +19 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +20 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/lastfm-discovery.d.ts +107 -0
- package/dist/tools/lastfm-discovery.d.ts.map +1 -0
- package/dist/tools/lastfm-discovery.js +238 -0
- package/dist/tools/lastfm-discovery.js.map +1 -0
- package/dist/tools/library.d.ts +31 -0
- package/dist/tools/library.d.ts.map +1 -0
- package/dist/tools/library.js +272 -0
- package/dist/tools/library.js.map +1 -0
- package/dist/tools/listening-history.d.ts +51 -0
- package/dist/tools/listening-history.d.ts.map +1 -0
- package/dist/tools/listening-history.js +126 -0
- package/dist/tools/listening-history.js.map +1 -0
- package/dist/tools/lyrics.d.ts +35 -0
- package/dist/tools/lyrics.d.ts.map +1 -0
- package/dist/tools/lyrics.js +222 -0
- package/dist/tools/lyrics.js.map +1 -0
- package/dist/tools/media-library.d.ts +46 -0
- package/dist/tools/media-library.d.ts.map +1 -0
- package/dist/tools/media-library.js +179 -0
- package/dist/tools/media-library.js.map +1 -0
- package/dist/tools/playlist-management.d.ts +80 -0
- package/dist/tools/playlist-management.d.ts.map +1 -0
- package/dist/tools/playlist-management.js +384 -0
- package/dist/tools/playlist-management.js.map +1 -0
- package/dist/tools/queue-management.d.ts +48 -0
- package/dist/tools/queue-management.d.ts.map +1 -0
- package/dist/tools/queue-management.js +83 -0
- package/dist/tools/queue-management.js.map +1 -0
- package/dist/tools/radio-discovery.d.ts +95 -0
- package/dist/tools/radio-discovery.d.ts.map +1 -0
- package/dist/tools/radio-discovery.js +352 -0
- package/dist/tools/radio-discovery.js.map +1 -0
- package/dist/tools/radio-validation.d.ts +49 -0
- package/dist/tools/radio-validation.d.ts.map +1 -0
- package/dist/tools/radio-validation.js +463 -0
- package/dist/tools/radio-validation.js.map +1 -0
- package/dist/tools/radio.d.ts +38 -0
- package/dist/tools/radio.d.ts.map +1 -0
- package/dist/tools/radio.js +315 -0
- package/dist/tools/radio.js.map +1 -0
- package/dist/tools/search.d.ts +54 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +165 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/tags.d.ts +63 -0
- package/dist/tools/tags.d.ts.map +1 -0
- package/dist/tools/tags.js +260 -0
- package/dist/tools/tags.js.map +1 -0
- package/dist/tools/test.d.ts +50 -0
- package/dist/tools/test.d.ts.map +1 -0
- package/dist/tools/test.js +121 -0
- package/dist/tools/test.js.map +1 -0
- package/dist/tools/user-preferences.d.ts +73 -0
- package/dist/tools/user-preferences.d.ts.map +1 -0
- package/dist/tools/user-preferences.js +231 -0
- package/dist/tools/user-preferences.js.map +1 -0
- package/dist/transformers/song-transformer.d.ts +122 -0
- package/dist/transformers/song-transformer.d.ts.map +1 -0
- package/dist/transformers/song-transformer.js +232 -0
- package/dist/transformers/song-transformer.js.map +1 -0
- package/dist/types/core.d.ts +147 -0
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/core.js +19 -0
- package/dist/types/core.js.map +1 -0
- package/dist/types/index.d.ts +23 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +19 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/lyrics.d.ts +58 -0
- package/dist/types/lyrics.d.ts.map +1 -0
- package/dist/types/lyrics.js +19 -0
- package/dist/types/lyrics.js.map +1 -0
- package/dist/types/playlists.d.ts +150 -0
- package/dist/types/playlists.d.ts.map +1 -0
- package/dist/types/playlists.js +19 -0
- package/dist/types/playlists.js.map +1 -0
- package/dist/types/radio.d.ts +192 -0
- package/dist/types/radio.d.ts.map +1 -0
- package/dist/types/radio.js +19 -0
- package/dist/types/radio.js.map +1 -0
- package/dist/types/tags.d.ts +72 -0
- package/dist/types/tags.d.ts.map +1 -0
- package/dist/types/tags.js +19 -0
- package/dist/types/tags.js.map +1 -0
- package/dist/utils/cache.d.ts +32 -0
- package/dist/utils/cache.d.ts.map +1 -0
- package/dist/utils/cache.js +84 -0
- package/dist/utils/cache.js.map +1 -0
- package/dist/utils/error-formatter.d.ts +108 -0
- package/dist/utils/error-formatter.d.ts.map +1 -0
- package/dist/utils/error-formatter.js +161 -0
- package/dist/utils/error-formatter.js.map +1 -0
- package/dist/utils/logger.d.ts +33 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +52 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/message-manager.d.ts +74 -0
- package/dist/utils/message-manager.d.ts.map +1 -0
- package/dist/utils/message-manager.js +134 -0
- package/dist/utils/message-manager.js.map +1 -0
- package/dist/utils/version.d.ts +5 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +19 -0
- package/dist/utils/version.js.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navidrome MCP Server - Radio Data Transfer Objects
|
|
3
|
+
* Copyright (C) 2025
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU Affero General Public License as published
|
|
7
|
+
* by the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
/** Radio station from Navidrome API */
|
|
19
|
+
export interface RadioStationDTO {
|
|
20
|
+
/** Unique radio station ID */
|
|
21
|
+
id: string;
|
|
22
|
+
/** Stream URL for the radio station */
|
|
23
|
+
streamUrl: string;
|
|
24
|
+
/** Station name/title */
|
|
25
|
+
name: string;
|
|
26
|
+
/** Optional homepage URL */
|
|
27
|
+
homePageUrl?: string;
|
|
28
|
+
/** ISO 8601 timestamp when created */
|
|
29
|
+
createdAt: string;
|
|
30
|
+
/** ISO 8601 timestamp when last updated */
|
|
31
|
+
updatedAt: string;
|
|
32
|
+
}
|
|
33
|
+
/** Request to create a new radio station */
|
|
34
|
+
export interface CreateRadioStationRequest {
|
|
35
|
+
/** Station name (required) */
|
|
36
|
+
name: string;
|
|
37
|
+
/** Stream URL (required) */
|
|
38
|
+
streamUrl: string;
|
|
39
|
+
/** Optional homepage URL */
|
|
40
|
+
homePageUrl?: string;
|
|
41
|
+
}
|
|
42
|
+
/** Response from creating a radio station */
|
|
43
|
+
export interface CreateRadioStationResponse {
|
|
44
|
+
/** Success status */
|
|
45
|
+
success: boolean;
|
|
46
|
+
/** Created radio station */
|
|
47
|
+
station?: RadioStationDTO;
|
|
48
|
+
/** Error message if failed */
|
|
49
|
+
error?: string;
|
|
50
|
+
/** One-time validation reminder message */
|
|
51
|
+
validation_reminder?: string;
|
|
52
|
+
}
|
|
53
|
+
/** Response from deleting a radio station */
|
|
54
|
+
export interface DeleteRadioStationResponse {
|
|
55
|
+
/** Success status */
|
|
56
|
+
success: boolean;
|
|
57
|
+
/** ID of deleted station */
|
|
58
|
+
id?: string;
|
|
59
|
+
/** Error message if failed */
|
|
60
|
+
error?: string;
|
|
61
|
+
}
|
|
62
|
+
/** Response from listing radio stations */
|
|
63
|
+
export interface ListRadioStationsResponse {
|
|
64
|
+
/** Array of radio stations */
|
|
65
|
+
stations: RadioStationDTO[];
|
|
66
|
+
/** Total count */
|
|
67
|
+
total: number;
|
|
68
|
+
/** One-time tip message */
|
|
69
|
+
tip?: string;
|
|
70
|
+
}
|
|
71
|
+
/** Radio playback status information */
|
|
72
|
+
export interface RadioPlaybackInfo {
|
|
73
|
+
/** Whether radio is currently playing */
|
|
74
|
+
playing: boolean;
|
|
75
|
+
/** Current radio station info if playing */
|
|
76
|
+
currentStation?: RadioStationDTO;
|
|
77
|
+
/** Current stream metadata if available */
|
|
78
|
+
metadata?: {
|
|
79
|
+
/** Current track/show title */
|
|
80
|
+
title?: string;
|
|
81
|
+
/** Current artist/host */
|
|
82
|
+
artist?: string;
|
|
83
|
+
/** Station description */
|
|
84
|
+
description?: string;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* External radio station from Radio Browser API
|
|
89
|
+
*/
|
|
90
|
+
export interface ExternalRadioStationDTO {
|
|
91
|
+
/** Unique station UUID */
|
|
92
|
+
stationUuid: string;
|
|
93
|
+
/** Station name */
|
|
94
|
+
name: string;
|
|
95
|
+
/** Resolved play URL (preferred over raw URL) */
|
|
96
|
+
playUrl: string;
|
|
97
|
+
/** Station homepage URL */
|
|
98
|
+
homepage?: string;
|
|
99
|
+
/** Tags/genres for the station */
|
|
100
|
+
tags: string[];
|
|
101
|
+
/** Country code (ISO 3166) */
|
|
102
|
+
countryCode?: string;
|
|
103
|
+
/** Language codes */
|
|
104
|
+
languageCodes: string[];
|
|
105
|
+
/** Audio codec (MP3, AAC, OGG, etc.) */
|
|
106
|
+
codec?: string;
|
|
107
|
+
/** Bitrate in kbps */
|
|
108
|
+
bitrate?: number;
|
|
109
|
+
/** Whether station uses HLS streaming */
|
|
110
|
+
hls: boolean;
|
|
111
|
+
/** Number of votes */
|
|
112
|
+
votes: number;
|
|
113
|
+
/** Total click count */
|
|
114
|
+
clickCount: number;
|
|
115
|
+
/** Stream validation results (if validated) */
|
|
116
|
+
validation?: {
|
|
117
|
+
/** Whether validation was performed */
|
|
118
|
+
validated: boolean;
|
|
119
|
+
/** Whether stream passed validation */
|
|
120
|
+
isValid: boolean;
|
|
121
|
+
/** Brief validation status */
|
|
122
|
+
status: string;
|
|
123
|
+
/** Validation duration in ms */
|
|
124
|
+
duration?: number;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Response from radio station discovery
|
|
129
|
+
*/
|
|
130
|
+
export interface DiscoverRadioStationsResponse {
|
|
131
|
+
/** Array of discovered stations */
|
|
132
|
+
stations: ExternalRadioStationDTO[];
|
|
133
|
+
/** Data source */
|
|
134
|
+
source: 'radio-browser';
|
|
135
|
+
/** Mirror server used */
|
|
136
|
+
mirrorUsed: string;
|
|
137
|
+
/** Validation summary (if validation was performed) */
|
|
138
|
+
validationSummary?: {
|
|
139
|
+
totalStations: number;
|
|
140
|
+
validatedStations: number;
|
|
141
|
+
workingStations: number;
|
|
142
|
+
message: string;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Radio filter options for UI pickers
|
|
147
|
+
*/
|
|
148
|
+
export interface RadioFiltersResponse {
|
|
149
|
+
/** Available tags/genres */
|
|
150
|
+
tags?: Array<{
|
|
151
|
+
name: string;
|
|
152
|
+
stationCount: number;
|
|
153
|
+
}>;
|
|
154
|
+
/** Available countries */
|
|
155
|
+
countries?: Array<{
|
|
156
|
+
code: string;
|
|
157
|
+
name: string;
|
|
158
|
+
stationCount: number;
|
|
159
|
+
}>;
|
|
160
|
+
/** Available languages */
|
|
161
|
+
languages?: Array<{
|
|
162
|
+
code: string;
|
|
163
|
+
name: string;
|
|
164
|
+
stationCount: number;
|
|
165
|
+
}>;
|
|
166
|
+
/** Available codecs */
|
|
167
|
+
codecs?: Array<{
|
|
168
|
+
name: string;
|
|
169
|
+
stationCount: number;
|
|
170
|
+
}>;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Response from clicking/playing a radio station
|
|
174
|
+
*/
|
|
175
|
+
export interface ClickRadioStationResponse {
|
|
176
|
+
/** Success status */
|
|
177
|
+
ok: boolean;
|
|
178
|
+
/** Canonical play URL */
|
|
179
|
+
playUrl: string;
|
|
180
|
+
/** Response message */
|
|
181
|
+
message: string;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Response from voting for a radio station
|
|
185
|
+
*/
|
|
186
|
+
export interface VoteRadioStationResponse {
|
|
187
|
+
/** Success status */
|
|
188
|
+
ok: boolean;
|
|
189
|
+
/** Response message */
|
|
190
|
+
message: string;
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=radio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../src/types/radio.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,uCAAuC;AACvC,MAAM,WAAW,eAAe;IAC9B,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,4CAA4C;AAC5C,MAAM,WAAW,yBAAyB;IACxC,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,6CAA6C;AAC7C,MAAM,WAAW,0BAA0B;IACzC,qBAAqB;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,6CAA6C;AAC7C,MAAM,WA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AM,CAAC;QACb,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,qBAAqB;IACrB,EAAE,EAAE,OAAO,CAAC;IACZ,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,qBAAqB;IACrB,EAAE,EAAE,OAAO,CAAC;IACZ,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navidrome MCP Server - Radio Data Transfer Objects
|
|
3
|
+
* Copyright (C) 2025
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU Affero General Public License as published
|
|
7
|
+
* by the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=radio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.js","sourceRoot":"","sources":["../../src/types/radio.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navidrome MCP Server - Tags Data Transfer Objects
|
|
3
|
+
* Copyright (C) 2025
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU Affero General Public License as published
|
|
7
|
+
* by the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Clean DTO for tags, representing metadata key-value pairs
|
|
20
|
+
*/
|
|
21
|
+
export interface TagDTO {
|
|
22
|
+
/** Unique tag ID */
|
|
23
|
+
id: string;
|
|
24
|
+
/** Tag name (e.g., "genre", "composer", "label") */
|
|
25
|
+
tagName: string;
|
|
26
|
+
/** Tag value */
|
|
27
|
+
tagValue: string;
|
|
28
|
+
/** Number of albums with this tag */
|
|
29
|
+
albumCount: number;
|
|
30
|
+
/** Number of songs with this tag */
|
|
31
|
+
songCount: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Response format for listing tags with pagination
|
|
35
|
+
*/
|
|
36
|
+
export interface ListTagsResponse {
|
|
37
|
+
/** Array of tags */
|
|
38
|
+
tags: TagDTO[];
|
|
39
|
+
/** Total number of tags available */
|
|
40
|
+
total: number;
|
|
41
|
+
/** Pagination offset used */
|
|
42
|
+
offset: number;
|
|
43
|
+
/** Pagination limit used */
|
|
44
|
+
limit: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Tag distribution analysis for a specific tag name
|
|
48
|
+
*/
|
|
49
|
+
export interface TagDistribution {
|
|
50
|
+
/** Tag name being analyzed */
|
|
51
|
+
tagName: string;
|
|
52
|
+
/** Number of unique values for this tag name */
|
|
53
|
+
uniqueValues: number;
|
|
54
|
+
/** Total songs across all values */
|
|
55
|
+
totalSongs: number;
|
|
56
|
+
/** Total albums across all values */
|
|
57
|
+
totalAlbums: number;
|
|
58
|
+
/** Most common tag value */
|
|
59
|
+
mostCommon: TagDTO;
|
|
60
|
+
/** Distribution of values (sorted by usage) */
|
|
61
|
+
distribution: TagDTO[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Response format for tag distribution analysis
|
|
65
|
+
*/
|
|
66
|
+
export interface TagDistributionResponse {
|
|
67
|
+
/** Array of tag distributions by name */
|
|
68
|
+
distributions: TagDistribution[];
|
|
69
|
+
/** Total unique tag names */
|
|
70
|
+
totalTagNames: number;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=tags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../../src/types/tags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,oBAAoB;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oBAAoB;IACpB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,YAAY,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,yCAAyC;IACzC,aAAa,EAAE,eAAe,EAAE,CAAC;IACjC,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navidrome MCP Server - Tags Data Transfer Objects
|
|
3
|
+
* Copyright (C) 2025
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU Affero General Public License as published
|
|
7
|
+
* by the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=tags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags.js","sourceRoot":"","sources":["../../src/types/tags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navidrome MCP Server - Cache Utility
|
|
3
|
+
* Copyright (C) 2025
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU Affero General Public License as published
|
|
7
|
+
* by the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
export declare class Cache<T> {
|
|
19
|
+
private store;
|
|
20
|
+
private ttl;
|
|
21
|
+
private cleanupInterval;
|
|
22
|
+
private cleanupIntervalMs;
|
|
23
|
+
constructor(ttlSeconds?: number, enableAutoCleanup?: boolean);
|
|
24
|
+
private startAutoCleanup;
|
|
25
|
+
private cleanup;
|
|
26
|
+
set(key: string, value: T): void;
|
|
27
|
+
get(key: string): T | undefined;
|
|
28
|
+
clear(): void;
|
|
29
|
+
delete(key: string): boolean;
|
|
30
|
+
destroy(): void;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/utils/cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAOH,qBAAa,KAAK,CAAC,CAAC;IAClB,OAAO,CAAC,KAAK,CAAoC;IACjD,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,eAAe,CAAyC;IAChE,OAAO,CAAC,iBAAiB,CAAS;gBAEtB,UAAU,SAAM,EAAE,iBAAiB,UAAO;IAUtD,OAAO,CAAC,gBAAgB;IAiBxB,OAAO,CAAC,OAAO;IASf,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAOhC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAY/B,KAAK,IAAI,IAAI;IAIb,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAI5B,OAAO,IAAI,IAAI;CAQhB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navidrome MCP Server - Cache Utility
|
|
3
|
+
* Copyright (C) 2025
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU Affero General Public License as published
|
|
7
|
+
* by the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
export class Cache {
|
|
19
|
+
store = new Map();
|
|
20
|
+
ttl;
|
|
21
|
+
cleanupInterval = undefined;
|
|
22
|
+
cleanupIntervalMs;
|
|
23
|
+
constructor(ttlSeconds = 300, enableAutoCleanup = true) {
|
|
24
|
+
this.ttl = ttlSeconds * 1000;
|
|
25
|
+
// Run cleanup every ttl period or at least once per hour
|
|
26
|
+
this.cleanupIntervalMs = Math.min(this.ttl, 3600000);
|
|
27
|
+
if (enableAutoCleanup) {
|
|
28
|
+
this.startAutoCleanup();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
startAutoCleanup() {
|
|
32
|
+
// Clear any existing interval first
|
|
33
|
+
if (this.cleanupInterval) {
|
|
34
|
+
clearInterval(this.cleanupInterval);
|
|
35
|
+
}
|
|
36
|
+
// Set up periodic cleanup
|
|
37
|
+
this.cleanupInterval = setInterval(() => {
|
|
38
|
+
this.cleanup();
|
|
39
|
+
}, this.cleanupIntervalMs);
|
|
40
|
+
// Ensure cleanup runs when process exits
|
|
41
|
+
if (this.cleanupInterval.unref) {
|
|
42
|
+
this.cleanupInterval.unref(); // Don't keep process alive just for cleanup
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
cleanup() {
|
|
46
|
+
const now = new Date();
|
|
47
|
+
for (const [key, entry] of this.store.entries()) {
|
|
48
|
+
if (entry.expiry < now) {
|
|
49
|
+
this.store.delete(key);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
set(key, value) {
|
|
54
|
+
this.store.set(key, {
|
|
55
|
+
value,
|
|
56
|
+
expiry: new Date(Date.now() + this.ttl),
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
get(key) {
|
|
60
|
+
const entry = this.store.get(key);
|
|
61
|
+
if (!entry)
|
|
62
|
+
return undefined;
|
|
63
|
+
if (entry.expiry < new Date()) {
|
|
64
|
+
this.store.delete(key);
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
return entry.value;
|
|
68
|
+
}
|
|
69
|
+
clear() {
|
|
70
|
+
this.store.clear();
|
|
71
|
+
}
|
|
72
|
+
delete(key) {
|
|
73
|
+
return this.store.delete(key);
|
|
74
|
+
}
|
|
75
|
+
destroy() {
|
|
76
|
+
// Clean up resources when cache is no longer needed
|
|
77
|
+
if (this.cleanupInterval) {
|
|
78
|
+
clearInterval(this.cleanupInterval);
|
|
79
|
+
this.cleanupInterval = undefined;
|
|
80
|
+
}
|
|
81
|
+
this.store.clear();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../src/utils/cache.ts"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C;QACH,CAAC;IACH,CAAC;IAED,GAAG,CAAC,GAAW,EAAE,KAAQ;QACvB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE;YAClB,KAAK;YACL,MAAM,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;SACxC,CAAC,CAAC;IACL,CAAC;IAED,GAAG,CAAC,GAAW;QACb,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,CAAC,KAAK;YAAE,OAAO,SAAS,CAAC;QAE7B,IAAI,KAAK,CAAC,MAAM,GAAG,IAAI,IAAI,EAAE,EAAE,CAAC;YAC9B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACvB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,KAAK,CAAC,KAAK,CAAC;IACrB,CAAC;IAED,KAAK;QACH,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;IAED,MAAM,CAAC,GAAW;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IAED,OAAO;QACL,oDAAoD;QACpD,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACpC,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACnC,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navidrome MCP Server - Error Formatting Utility
|
|
3
|
+
* Copyright (C) 2025
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU Affero General Public License as published
|
|
7
|
+
* by the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Standardized error message formatting utilities
|
|
20
|
+
* Provides consistent error messages across the MCP application
|
|
21
|
+
*/
|
|
22
|
+
export declare class ErrorFormatter {
|
|
23
|
+
/**
|
|
24
|
+
* Extract message from unknown error type
|
|
25
|
+
*/
|
|
26
|
+
private static extractMessage;
|
|
27
|
+
/**
|
|
28
|
+
* Format HTTP request failures (network issues, 404, 500, etc.)
|
|
29
|
+
*/
|
|
30
|
+
static httpRequest(operation: string, response: Response, errorText?: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Format Subsonic API specific errors
|
|
33
|
+
*/
|
|
34
|
+
static subsonicApi(response: Response): string;
|
|
35
|
+
/**
|
|
36
|
+
* Format Subsonic API response errors (when subsonic-response.status !== 'ok')
|
|
37
|
+
*/
|
|
38
|
+
static subsonicResponse(errorMessage?: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* Format MCP tool execution failures
|
|
41
|
+
*/
|
|
42
|
+
static toolExecution(toolName: string, error: unknown): string;
|
|
43
|
+
/**
|
|
44
|
+
* Format tool parameter validation errors
|
|
45
|
+
*/
|
|
46
|
+
static toolValidation(toolName: string, field: string, issue: string): string;
|
|
47
|
+
/**
|
|
48
|
+
* Format tool resource not found errors
|
|
49
|
+
*/
|
|
50
|
+
static toolNotFound(resourceType: string, identifier?: string): string;
|
|
51
|
+
/**
|
|
52
|
+
* Format unknown tool errors
|
|
53
|
+
*/
|
|
54
|
+
static toolUnknown(toolName: string): string;
|
|
55
|
+
/**
|
|
56
|
+
* Format not found errors
|
|
57
|
+
*/
|
|
58
|
+
static notFound(resourceType: string, identifier: string): string;
|
|
59
|
+
/**
|
|
60
|
+
* Format authentication failures
|
|
61
|
+
*/
|
|
62
|
+
static authentication(details?: string): string;
|
|
63
|
+
/**
|
|
64
|
+
* Format authorization failures
|
|
65
|
+
*/
|
|
66
|
+
static authorization(operation: string): string;
|
|
67
|
+
/**
|
|
68
|
+
* Format Last.fm API errors
|
|
69
|
+
*/
|
|
70
|
+
static lastfmApi(response: Response): string;
|
|
71
|
+
/**
|
|
72
|
+
* Format Last.fm API response errors
|
|
73
|
+
*/
|
|
74
|
+
static lastfmResponse(message?: string): string;
|
|
75
|
+
/**
|
|
76
|
+
* Format Radio Browser API errors
|
|
77
|
+
*/
|
|
78
|
+
static radioBrowserApi(response: Response): string;
|
|
79
|
+
/**
|
|
80
|
+
* Format generic API request errors
|
|
81
|
+
*/
|
|
82
|
+
static apiRequest(apiName: string, response: Response): string;
|
|
83
|
+
/**
|
|
84
|
+
* Format generic API response errors
|
|
85
|
+
*/
|
|
86
|
+
static apiResponse(apiName: string, message?: string): string;
|
|
87
|
+
/**
|
|
88
|
+
* Format configuration validation failures
|
|
89
|
+
*/
|
|
90
|
+
static configValidation(messages: string[]): string;
|
|
91
|
+
/**
|
|
92
|
+
* Format missing configuration errors
|
|
93
|
+
*/
|
|
94
|
+
static configMissing(service: string, configKey: string): string;
|
|
95
|
+
/**
|
|
96
|
+
* Format general operation failures with context
|
|
97
|
+
*/
|
|
98
|
+
static operationFailed(operation: string, error: unknown): string;
|
|
99
|
+
/**
|
|
100
|
+
* Format unknown resource errors (for MCP resources)
|
|
101
|
+
*/
|
|
102
|
+
static unknownResource(resourceUri: string): string;
|
|
103
|
+
/**
|
|
104
|
+
* Format validation stream/URL errors
|
|
105
|
+
*/
|
|
106
|
+
static streamValidation(url: string, issue: string): string;
|
|
107
|
+
}
|
|
108
|
+
//# sourceM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