@thelord/mcp-arr 1.0.0
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 +21 -0
- package/README.md +363 -0
- package/dist/arr-client.d.ts +784 -0
- package/dist/arr-client.d.ts.map +1 -0
- package/dist/arr-client.js +487 -0
- package/dist/arr-client.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1947 -0
- package/dist/index.js.map +1 -0
- package/dist/lingarr-client.d.ts +316 -0
- package/dist/lingarr-client.d.ts.map +1 -0
- package/dist/lingarr-client.js +320 -0
- package/dist/lingarr-client.js.map +1 -0
- package/dist/lingarr-handlers.d.ts +40 -0
- package/dist/lingarr-handlers.d.ts.map +1 -0
- package/dist/lingarr-handlers.js +347 -0
- package/dist/lingarr-handlers.js.map +1 -0
- package/dist/lingarr-tools.d.ts +19 -0
- package/dist/lingarr-tools.d.ts.map +1 -0
- package/dist/lingarr-tools.js +271 -0
- package/dist/lingarr-tools.js.map +1 -0
- package/dist/trash-client.d.ts +121 -0
- package/dist/trash-client.d.ts.map +1 -0
- package/dist/trash-client.js +287 -0
- package/dist/trash-client.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lingarr MCP Tool Handlers
|
|
3
|
+
*
|
|
4
|
+
* This module contains all the handlers for Lingarr tools.
|
|
5
|
+
* Separated from index.ts to reduce merge conflicts when mcp-arr updates.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Handle Lingarr tool calls
|
|
9
|
+
* @param toolName The name of the tool being called
|
|
10
|
+
* @param args The arguments passed to the tool
|
|
11
|
+
* @param client The LingarrClient instance
|
|
12
|
+
* @returns The handler result or null if not a Lingarr tool
|
|
13
|
+
*/
|
|
14
|
+
export async function handleLingarrTool(toolName, args, client) {
|
|
15
|
+
// Return null if not a Lingarr tool - let other handlers process it
|
|
16
|
+
if (!toolName.startsWith('lingarr_')) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
if (!client) {
|
|
20
|
+
throw new Error("Lingarr not configured");
|
|
21
|
+
}
|
|
22
|
+
switch (toolName) {
|
|
23
|
+
case "lingarr_get_movies": {
|
|
24
|
+
const { searchQuery, pageNumber, pageSize } = args;
|
|
25
|
+
const movies = await client.getMovies(pageNumber, pageSize, searchQuery);
|
|
26
|
+
return {
|
|
27
|
+
content: [{
|
|
28
|
+
type: "text",
|
|
29
|
+
text: JSON.stringify({
|
|
30
|
+
totalCount: movies.totalCount,
|
|
31
|
+
pageNumber: movies.pageNumber,
|
|
32
|
+
pageSize: movies.pageSize,
|
|
33
|
+
movies: movies.items.map(m => ({
|
|
34
|
+
id: m.id,
|
|
35
|
+
radarrId: m.radarrId,
|
|
36
|
+
title: m.title,
|
|
37
|
+
path: m.path,
|
|
38
|
+
excludeFromTranslation: m.excludeFromTranslation,
|
|
39
|
+
dateAdded: m.dateAdded,
|
|
40
|
+
})),
|
|
41
|
+
}, null, 2),
|
|
42
|
+
}],
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
case "lingarr_get_shows": {
|
|
46
|
+
const { searchQuery, pageNumber, pageSize } = args;
|
|
47
|
+
const shows = await client.getShows(pageNumber, pageSize, searchQuery);
|
|
48
|
+
return {
|
|
49
|
+
content: [{
|
|
50
|
+
type: "text",
|
|
51
|
+
text: JSON.stringify({
|
|
52
|
+
totalCount: shows.totalCount,
|
|
53
|
+
pageNumber: shows.pageNumber,
|
|
54
|
+
pageSize: shows.pageSize,
|
|
55
|
+
shows: shows.items.map(s => ({
|
|
56
|
+
id: s.id,
|
|
57
|
+
sonarrId: s.sonarrId,
|
|
58
|
+
title: s.title,
|
|
59
|
+
path: s.path,
|
|
60
|
+
excludeFromTranslation: s.excludeFromTranslation,
|
|
61
|
+
seasonCount: s.seasons?.length || 0,
|
|
62
|
+
dateAdded: s.dateAdded,
|
|
63
|
+
})),
|
|
64
|
+
}, null, 2),
|
|
65
|
+
}],
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
case "lingarr_get_statistics": {
|
|
69
|
+
const stats = await client.getStatistics();
|
|
70
|
+
return {
|
|
71
|
+
content: [{
|
|
72
|
+
type: "text",
|
|
73
|
+
text: JSON.stringify({
|
|
74
|
+
totalLinesTranslated: stats.totalLinesTranslated,
|
|
75
|
+
totalFilesTranslated: stats.totalFilesTranslated,
|
|
76
|
+
totalCharactersTranslated: stats.totalCharactersTranslated,
|
|
77
|
+
totalMovies: stats.totalMovies,
|
|
78
|
+
totalEpisodes: stats.totalEpisodes,
|
|
79
|
+
totalSubtitles: stats.totalSubtitles,
|
|
80
|
+
translationsByMediaType: stats.translationsByMediaType,
|
|
81
|
+
translationsByService: stats.translationsByService,
|
|
82
|
+
subtitlesByLanguage: stats.subtitlesByLanguage,
|
|
83
|
+
translationsByModel: stats.translationsByModel,
|
|
84
|
+
}, null, 2),
|
|
85
|
+
}],
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
case "lingarr_get_daily_statistics": {
|
|
89
|
+
const days = args?.days || 30;
|
|
90
|
+
const dailyStats = await client.getDailyStatistics(days);
|
|
91
|
+
return {
|
|
92
|
+
content: [{
|
|
93
|
+
type: "text",
|
|
94
|
+
text: JSON.stringify({
|
|
95
|
+
days,
|
|
96
|
+
count: dailyStats.length,
|
|
97
|
+
statistics: dailyStats.map(d => ({
|
|
98
|
+
date: d.date,
|
|
99
|
+
translationCount: d.translationCount,
|
|
100
|
+
})),
|
|
101
|
+
totalTranslations: dailyStats.reduce((sum, d) => sum + d.translationCount, 0),
|
|
102
|
+
}, null, 2),
|
|
103
|
+
}],
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
case "lingarr_get_languages": {
|
|
107
|
+
const languages = await client.getLanguages();
|
|
108
|
+
return {
|
|
109
|
+
content: [{
|
|
110
|
+
type: "text",
|
|
111
|
+
text: JSON.stringify({
|
|
112
|
+
count: languages.length,
|
|
113
|
+
languages: languages.map(l => ({
|
|
114
|
+
name: l.name,
|
|
115
|
+
code: l.code,
|
|
116
|
+
targetLanguages: l.targets,
|
|
117
|
+
})),
|
|
118
|
+
}, null, 2),
|
|
119
|
+
}],
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
case "lingarr_get_models": {
|
|
123
|
+
const models = await client.getModels();
|
|
124
|
+
return {
|
|
125
|
+
content: [{
|
|
126
|
+
type: "text",
|
|
127
|
+
text: JSON.stringify({
|
|
128
|
+
count: models.length,
|
|
129
|
+
models: models.map(m => ({
|
|
130
|
+
label: m.label,
|
|
131
|
+
value: m.value,
|
|
132
|
+
})),
|
|
133
|
+
}, null, 2),
|
|
134
|
+
}],
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
case "lingarr_get_translation_requests": {
|
|
138
|
+
const { pageNumber, pageSize } = args;
|
|
139
|
+
const requests = await client.getTranslationRequests(pageNumber, pageSize);
|
|
140
|
+
const statusNames = ['Pending', 'InProgress', 'Completed', 'Failed', 'Cancelled', 'Interrupted'];
|
|
141
|
+
const mediaTypeNames = ['Movie', 'Show', 'Season', 'Episode'];
|
|
142
|
+
return {
|
|
143
|
+
content: [{
|
|
144
|
+
type: "text",
|
|
145
|
+
text: JSON.stringify({
|
|
146
|
+
totalCount: requests.totalCount,
|
|
147
|
+
pageNumber: requests.pageNumber,
|
|
148
|
+
pageSize: requests.pageSize,
|
|
149
|
+
requests: requests.items.map(r => ({
|
|
150
|
+
id: r.id,
|
|
151
|
+
title: r.title,
|
|
152
|
+
sourceLanguage: r.sourceLanguage,
|
|
153
|
+
targetLanguage: r.targetLanguage,
|
|
154
|
+
status: statusNames[r.status] || r.status,
|
|
155
|
+
mediaType: mediaTypeNames[r.mediaType] || r.mediaType,
|
|
156
|
+
completedAt: r.completedAt,
|
|
157
|
+
createdAt: r.createdAt,
|
|
158
|
+
})),
|
|
159
|
+
}, null, 2),
|
|
160
|
+
}],
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
case "lingarr_get_active_translations": {
|
|
164
|
+
const count = await client.getActiveTranslationsCount();
|
|
165
|
+
return {
|
|
166
|
+
content: [{
|
|
167
|
+
type: "text",
|
|
168
|
+
text: JSON.stringify({
|
|
169
|
+
activeTranslations: count,
|
|
170
|
+
}, null, 2),
|
|
171
|
+
}],
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
case "lingarr_translate_subtitle": {
|
|
175
|
+
const request = args;
|
|
176
|
+
await client.translateFile({
|
|
177
|
+
mediaId: request.mediaId,
|
|
178
|
+
subtitlePath: request.subtitlePath,
|
|
179
|
+
sourceLanguage: request.sourceLanguage,
|
|
180
|
+
targetLanguage: request.targetLanguage,
|
|
181
|
+
mediaType: request.mediaType,
|
|
182
|
+
subtitleFormat: request.subtitleFormat,
|
|
183
|
+
});
|
|
184
|
+
return {
|
|
185
|
+
content: [{
|
|
186
|
+
type: "text",
|
|
187
|
+
text: JSON.stringify({
|
|
188
|
+
success: true,
|
|
189
|
+
message: `Translation job queued for ${request.subtitlePath}`,
|
|
190
|
+
sourceLanguage: request.sourceLanguage,
|
|
191
|
+
targetLanguage: request.targetLanguage,
|
|
192
|
+
}, null, 2),
|
|
193
|
+
}],
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
case "lingarr_cancel_translation": {
|
|
197
|
+
const { id } = args;
|
|
198
|
+
await client.cancelTranslation(id);
|
|
199
|
+
return {
|
|
200
|
+
content: [{
|
|
201
|
+
type: "text",
|
|
202
|
+
text: JSON.stringify({
|
|
203
|
+
success: true,
|
|
204
|
+
message: `Translation request ${id} cancelled`,
|
|
205
|
+
}, null, 2),
|
|
206
|
+
}],
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
case "lingarr_retry_translation": {
|
|
210
|
+
const { id } = args;
|
|
211
|
+
await client.retryTranslation(id);
|
|
212
|
+
return {
|
|
213
|
+
content: [{
|
|
214
|
+
type: "text",
|
|
215
|
+
text: JSON.stringify({
|
|
216
|
+
success: true,
|
|
217
|
+
message: `Translation request ${id} queued for retry`,
|
|
218
|
+
}, null, 2),
|
|
219
|
+
}],
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
case "lingarr_get_subtitles": {
|
|
223
|
+
const { path } = args;
|
|
224
|
+
const subtitles = await client.getSubtitles(path);
|
|
225
|
+
return {
|
|
226
|
+
content: [{
|
|
227
|
+
type: "text",
|
|
228
|
+
text: JSON.stringify({
|
|
229
|
+
path,
|
|
230
|
+
count: subtitles.length,
|
|
231
|
+
subtitles: subtitles.map(s => ({
|
|
232
|
+
fileName: s.fileName,
|
|
233
|
+
language: s.language,
|
|
234
|
+
format: s.format,
|
|
235
|
+
path: s.path,
|
|
236
|
+
})),
|
|
237
|
+
}, null, 2),
|
|
238
|
+
}],
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
case "lingarr_get_jobs": {
|
|
242
|
+
const jobs = await client.getJobs();
|
|
243
|
+
return {
|
|
244
|
+
content: [{
|
|
245
|
+
type: "text",
|
|
246
|
+
text: JSON.stringify({
|
|
247
|
+
count: jobs.length,
|
|
248
|
+
jobs: jobs.map(j => ({
|
|
249
|
+
id: j.id,
|
|
250
|
+
cron: j.cron,
|
|
251
|
+
currentState: j.currentState,
|
|
252
|
+
isCurrentlyRunning: j.isCurrentlyRunning,
|
|
253
|
+
lastExecution: j.lastExecution,
|
|
254
|
+
nextExecution: j.nextExecution,
|
|
255
|
+
lastJobState: j.lastJobState,
|
|
256
|
+
})),
|
|
257
|
+
}, null, 2),
|
|
258
|
+
}],
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
case "lingarr_run_automation": {
|
|
262
|
+
await client.runAutomatedTranslation();
|
|
263
|
+
return {
|
|
264
|
+
content: [{
|
|
265
|
+
type: "text",
|
|
266
|
+
text: JSON.stringify({
|
|
267
|
+
success: true,
|
|
268
|
+
message: "Automated translation job triggered",
|
|
269
|
+
}, null, 2),
|
|
270
|
+
}],
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
case "lingarr_sync_media": {
|
|
274
|
+
const { type } = args;
|
|
275
|
+
if (type === 'movies') {
|
|
276
|
+
await client.syncMovies();
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
await client.syncShows();
|
|
280
|
+
}
|
|
281
|
+
return {
|
|
282
|
+
content: [{
|
|
283
|
+
type: "text",
|
|
284
|
+
text: JSON.stringify({
|
|
285
|
+
success: true,
|
|
286
|
+
message: `Sync job triggered for ${type}`,
|
|
287
|
+
}, null, 2),
|
|
288
|
+
}],
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
case "lingarr_exclude_media": {
|
|
292
|
+
const { mediaType, id } = args;
|
|
293
|
+
await client.setExcludeMedia(mediaType, id);
|
|
294
|
+
const mediaTypeNames = ['Movie', 'Show', 'Season', 'Episode'];
|
|
295
|
+
return {
|
|
296
|
+
content: [{
|
|
297
|
+
type: "text",
|
|
298
|
+
text: JSON.stringify({
|
|
299
|
+
success: true,
|
|
300
|
+
message: `Toggled exclusion for ${mediaTypeNames[mediaType] || 'media'} ID ${id}`,
|
|
301
|
+
}, null, 2),
|
|
302
|
+
}],
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
case "lingarr_get_version": {
|
|
306
|
+
const version = await client.getVersion();
|
|
307
|
+
return {
|
|
308
|
+
content: [{
|
|
309
|
+
type: "text",
|
|
310
|
+
text: JSON.stringify({
|
|
311
|
+
currentVersion: version.currentVersion,
|
|
312
|
+
latestVersion: version.latestVersion,
|
|
313
|
+
updateAvailable: version.newVersion,
|
|
314
|
+
}, null, 2),
|
|
315
|
+
}],
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
default:
|
|
319
|
+
// This shouldn't happen since we check the prefix at the start
|
|
320
|
+
return null;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Get Lingarr status for arr_status handler
|
|
325
|
+
* @param client The LingarrClient instance
|
|
326
|
+
* @returns Status object for Lingarr
|
|
327
|
+
*/
|
|
328
|
+
export async function getLingarrStatus(client) {
|
|
329
|
+
try {
|
|
330
|
+
const version = await client.getVersion();
|
|
331
|
+
return {
|
|
332
|
+
configured: true,
|
|
333
|
+
connected: true,
|
|
334
|
+
version: version.currentVersion,
|
|
335
|
+
appName: 'Lingarr',
|
|
336
|
+
updateAvailable: version.newVersion,
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
catch (error) {
|
|
340
|
+
return {
|
|
341
|
+
configured: true,
|
|
342
|
+
connected: false,
|
|
343
|
+
error: error instanceof Error ? error.message : String(error),
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
//# sourceMappingURL=lingarr-handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lingarr-handlers.js","sourceRoot":"","sources":["../src/lingarr-handlers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgBH;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,QAAgB,EAChB,IAA6B,EAC7B,MAAiC;IAEjC,oEAAoE;IACpE,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QACrC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC5C,CAAC;IAED,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,oBAAoB,CAAC,CAAC,CAAC;YAC1B,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,IAI7C,CAAC;YACF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;YACzE,OAAO;gBACL,OAAO,EAAE,CAAC;wBACR,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,IAAI,CAAC,S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AC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,MAAqB;IAQ1D,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1C,OAAO;YACL,UAAU,EAAE,IAAI;YAChB,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,OAAO,CAAC,cAAc;YAC/B,OAAO,EAAE,SAAS;YAClB,eAAe,EAAE,OAAO,CAAC,UAAU;SACpC,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,UAAU,EAAE,IAAI;YAChB,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SAC9D,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lingarr MCP Tool Definitions
|
|
3
|
+
*
|
|
4
|
+
* This module contains all the tool definitions for Lingarr subtitle translation service.
|
|
5
|
+
* Separated from index.ts to reduce merge conflicts when mcp-arr updates.
|
|
6
|
+
*/
|
|
7
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
8
|
+
/**
|
|
9
|
+
* Get all Lingarr tool definitions
|
|
10
|
+
* @returns Array of MCP Tool definitions for Lingarr
|
|
11
|
+
*/
|
|
12
|
+
export declare function getLingarrTools(): Tool[];
|
|
13
|
+
/**
|
|
14
|
+
* Check if a tool name is a Lingarr tool
|
|
15
|
+
* @param toolName The tool name to check
|
|
16
|
+
* @returns true if the tool is a Lingarr tool
|
|
17
|
+
*/
|
|
18
|
+
export declare function isLingarrTool(toolName: string): boolean;
|
|
19
|
+
//# sourceMappingURL=lingarr-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lingarr-tools.d.ts","sourceRoot":"","sources":["../src/lingarr-tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE1D;;;GAGG;AACH,wBAAgB,eAAe,IAAI,IAAI,EAAE,CA2PxC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEvD"}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lingarr MCP Tool Definitions
|
|
3
|
+
*
|
|
4
|
+
* This module contains all the tool definitions for Lingarr subtitle translation service.
|
|
5
|
+
* Separated from index.ts to reduce merge conflicts when mcp-arr updates.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Get all Lingarr tool definitions
|
|
9
|
+
* @returns Array of MCP Tool definitions for Lingarr
|
|
10
|
+
*/
|
|
11
|
+
export function getLingarrTools() {
|
|
12
|
+
return [
|
|
13
|
+
{
|
|
14
|
+
name: "lingarr_get_movies",
|
|
15
|
+
description: "Get movies in Lingarr with their subtitle translation status. Supports pagination and search.",
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: "object",
|
|
18
|
+
properties: {
|
|
19
|
+
searchQuery: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Optional search term to filter movies",
|
|
22
|
+
},
|
|
23
|
+
pageNumber: {
|
|
24
|
+
type: "number",
|
|
25
|
+
description: "Page number (default: 1)",
|
|
26
|
+
},
|
|
27
|
+
pageSize: {
|
|
28
|
+
type: "number",
|
|
29
|
+
description: "Items per page (default: 20)",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
required: [],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "lingarr_get_shows",
|
|
37
|
+
description: "Get TV shows in Lingarr with their subtitle translation status. Supports pagination and search.",
|
|
38
|
+
inputSchema: {
|
|
39
|
+
type: "object",
|
|
40
|
+
properties: {
|
|
41
|
+
searchQuery: {
|
|
42
|
+
type: "string",
|
|
43
|
+
description: "Optional search term to filter shows",
|
|
44
|
+
},
|
|
45
|
+
pageNumber: {
|
|
46
|
+
type: "number",
|
|
47
|
+
description: "Page number (default: 1)",
|
|
48
|
+
},
|
|
49
|
+
pageSize: {
|
|
50
|
+
type: "number",
|
|
51
|
+
description: "Items per page (default: 20)",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
required: [],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "lingarr_get_statistics",
|
|
59
|
+
description: "Get Lingarr translation statistics including total lines translated, files processed, and breakdowns by language and service.",
|
|
60
|
+
inputSchema: {
|
|
61
|
+
type: "object",
|
|
62
|
+
properties: {},
|
|
63
|
+
required: [],
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: "lingarr_get_daily_statistics",
|
|
68
|
+
description: "Get daily translation statistics for the specified number of days.",
|
|
69
|
+
inputSchema: {
|
|
70
|
+
type: "object",
|
|
71
|
+
properties: {
|
|
72
|
+
days: {
|
|
73
|
+
type: "number",
|
|
74
|
+
description: "Number of days to retrieve (default: 30)",
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
required: [],
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: "lingarr_get_languages",
|
|
82
|
+
description: "Get available source languages and their supported target languages for translation.",
|
|
83
|
+
inputSchema: {
|
|
84
|
+
type: "object",
|
|
85
|
+
properties: {},
|
|
86
|
+
required: [],
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "lingarr_get_models",
|
|
91
|
+
description: "Get available AI models for subtitle translation.",
|
|
92
|
+
inputSchema: {
|
|
93
|
+
type: "object",
|
|
94
|
+
properties: {},
|
|
95
|
+
required: [],
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: "lingarr_get_translation_requests",
|
|
100
|
+
description: "Get translation requests with their status (pending, in progress, completed, failed).",
|
|
101
|
+
inputSchema: {
|
|
102
|
+
type: "object",
|
|
103
|
+
properties: {
|
|
104
|
+
pageNumber: {
|
|
105
|
+
type: "number",
|
|
106
|
+
description: "Page number (default: 1)",
|
|
107
|
+
},
|
|
108
|
+
pageSize: {
|
|
109
|
+
type: "number",
|
|
110
|
+
description: "Items per page (default: 20)",
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
required: [],
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "lingarr_get_active_translations",
|
|
118
|
+
description: "Get the count of currently active (in progress) translations.",
|
|
119
|
+
inputSchema: {
|
|
120
|
+
type: "object",
|
|
121
|
+
properties: {},
|
|
122
|
+
required: [],
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: "lingarr_translate_subtitle",
|
|
127
|
+
description: "Start a subtitle translation job for a movie or episode.",
|
|
128
|
+
inputSchema: {
|
|
129
|
+
type: "object",
|
|
130
|
+
properties: {
|
|
131
|
+
mediaId: {
|
|
132
|
+
type: "number",
|
|
133
|
+
description: "The Lingarr media ID",
|
|
134
|
+
},
|
|
135
|
+
subtitlePath: {
|
|
136
|
+
type: "string",
|
|
137
|
+
description: "Path to the subtitle file to translate",
|
|
138
|
+
},
|
|
139
|
+
sourceLanguage: {
|
|
140
|
+
type: "string",
|
|
141
|
+
description: "Source language code (e.g., 'en', 'es')",
|
|
142
|
+
},
|
|
143
|
+
targetLanguage: {
|
|
144
|
+
type: "string",
|
|
145
|
+
description: "Target language code (e.g., 'es', 'fr')",
|
|
146
|
+
},
|
|
147
|
+
mediaType: {
|
|
148
|
+
type: "number",
|
|
149
|
+
description: "Media type: 0=Movie, 3=Episode",
|
|
150
|
+
},
|
|
151
|
+
subtitleFormat: {
|
|
152
|
+
type: "string",
|
|
153
|
+
description: "Subtitle format (e.g., 'srt', 'ass')",
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
required: ["mediaId", "subtitlePath", "sourceLanguage", "targetLanguage", "mediaType", "subtitleFormat"],
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: "lingarr_cancel_translation",
|
|
161
|
+
description: "Cancel a pending or in-progress translation request.",
|
|
162
|
+
inputSchema: {
|
|
163
|
+
type: "object",
|
|
164
|
+
properties: {
|
|
165
|
+
id: {
|
|
166
|
+
type: "number",
|
|
167
|
+
description: "Translation request ID to cancel",
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
required: ["id"],
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: "lingarr_retry_translation",
|
|
175
|
+
description: "Retry a failed translation request.",
|
|
176
|
+
inputSchema: {
|
|
177
|
+
type: "object",
|
|
178
|
+
properties: {
|
|
179
|
+
id: {
|
|
180
|
+
type: "number",
|
|
181
|
+
description: "Translation request ID to retry",
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
required: ["id"],
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
name: "lingarr_get_subtitles",
|
|
189
|
+
description: "Get all subtitle files for a given media path.",
|
|
190
|
+
inputSchema: {
|
|
191
|
+
type: "object",
|
|
192
|
+
properties: {
|
|
193
|
+
path: {
|
|
194
|
+
type: "string",
|
|
195
|
+
description: "Path to the media file or directory",
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
required: ["path"],
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: "lingarr_get_jobs",
|
|
203
|
+
description: "Get all scheduled jobs and their status in Lingarr.",
|
|
204
|
+
inputSchema: {
|
|
205
|
+
type: "object",
|
|
206
|
+
properties: {},
|
|
207
|
+
required: [],
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: "lingarr_run_automation",
|
|
212
|
+
description: "Trigger the automated translation job to process pending subtitles.",
|
|
213
|
+
inputSchema: {
|
|
214
|
+
type: "object",
|
|
215
|
+
properties: {},
|
|
216
|
+
required: [],
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
name: "lingarr_sync_media",
|
|
221
|
+
description: "Sync movies or shows from Radarr/Sonarr to Lingarr.",
|
|
222
|
+
inputSchema: {
|
|
223
|
+
type: "object",
|
|
224
|
+
properties: {
|
|
225
|
+
type: {
|
|
226
|
+
type: "string",
|
|
227
|
+
enum: ["movies", "shows"],
|
|
228
|
+
description: "Type of media to sync",
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
required: ["type"],
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
name: "lingarr_exclude_media",
|
|
236
|
+
description: "Exclude or include a movie/show/season/episode from automatic translation.",
|
|
237
|
+
inputSchema: {
|
|
238
|
+
type: "object",
|
|
239
|
+
properties: {
|
|
240
|
+
mediaType: {
|
|
241
|
+
type: "number",
|
|
242
|
+
description: "Media type: 0=Movie, 1=Show, 2=Season, 3=Episode",
|
|
243
|
+
},
|
|
244
|
+
id: {
|
|
245
|
+
type: "number",
|
|
246
|
+
description: "Media ID in Lingarr",
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
required: ["mediaType", "id"],
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
name: "lingarr_get_version",
|
|
254
|
+
description: "Get Lingarr version information and check for updates.",
|
|
255
|
+
inputSchema: {
|
|
256
|
+
type: "object",
|
|
257
|
+
properties: {},
|
|
258
|
+
required: [],
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
];
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Check if a tool name is a Lingarr tool
|
|
265
|
+
* @param toolName The tool name to check
|
|
266
|
+
* @returns true if the tool is a Lingarr tool
|
|
267
|
+
*/
|
|
268
|
+
export function isLingarrTool(toolName) {
|
|
269
|
+
return toolName.startsWith('lingarr_');
|
|
270
|
+
}
|
|
271
|
+
//# sourceMappingURL=lingarr-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lingarr-tools.js","sourceRoot":"","sources":["../src/lingarr-tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;GAGG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO;QACL;YACE,IAAI,EAAE,oBAAoB;YAC1B,WAAW,EAAE,+FAA+F;YAC5G,WAAW,EAAE;gBACX,IAAI,EAAE,QAAiB;gBACvB,UAAU,EAAE;oBACV,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,uCAAuC;qBACrD;oBACD,UAAU,EAAE;wBACV,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,0BAA0B;qBACxC;oBACD,QAAQ,EAAE;wBACR,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,8BAA8B;qBAC5C;iBACF;gBACD,QAAQ,EAAE,EAAE;aACb;SACF;QACD;YACE,IAAI,EAAE,mBAAmB;YACzB,WAAW,EAAE,iGAAiG;YAC9G,WAAW,EAAE;gBACX,IAAI,EAAE,QAAiB;gBACvB,UAAU,EAAE;oBACV,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,sCAAsC;qBACpD;oBACD,UAAU,EAAE;wBACV,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,0BAA0B;qBACxC;oBACD,QAAQ,EAAE;wBACR,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,8BAA8B;qBAC5C;iBACF;gBACD,QAAQ,EAAE,EAAE;aACb;SACF;QACD;YACE,IAAI,EAAE,wBAAwB;YAC9B,WAAW,EAAE,+HAA+H;YAC5I,WAAW,EAAE;gBACX,IAAI,EAAE,QAAiB;gBACvB,UAAU,EAAE,EAAE;gBACd,QAAQ,EAAE,EAAE;aACb;SACF;QACD;YACE,IAAI,EAAE,8BAA8B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