anki-mcp-http 0.9.0 → 0.11.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/dist/app.module.js +2 -2
- package/dist/app.module.js.map +1 -1
- package/dist/mcp/primitives/essential/index.d.ts +26 -0
- package/dist/mcp/primitives/essential/index.js +13 -5
- package/dist/mcp/primitives/essential/index.js.map +1 -1
- package/dist/mcp/primitives/essential/tools/add-note.tool.d.ts +30 -0
- package/dist/mcp/primitives/essential/tools/add-note.tool.js +1 -1
- package/dist/mcp/primitives/essential/tools/add-note.tool.js.map +1 -1
- package/dist/mcp/primitives/essential/tools/create-deck.tool.d.ts +30 -0
- package/dist/mcp/primitives/essential/tools/create-model.tool.d.ts +30 -0
- package/dist/mcp/primitives/essential/tools/delete-notes.tool.d.ts +30 -0
- package/dist/mcp/primitives/essential/tools/find-notes.tool.d.ts +30 -0
- package/dist/mcp/primitives/essential/tools/get-cards.tool.d.ts +37 -1
- package/dist/mcp/primitives/essential/tools/get-due-cards.tool.d.ts +30 -0
- package/dist/mcp/primitives/essential/tools/get-tags.tool.d.ts +105 -0
- package/dist/mcp/primitives/essential/tools/get-tags.tool.js +86 -0
- package/dist/mcp/primitives/essential/tools/get-tags.tool.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/list-decks.tool.d.ts +30 -0
- package/dist/mcp/primitives/essential/tools/mediaActions/mediaActions.tool.d.ts +30 -0
- package/dist/mcp/primitives/essential/tools/model-field-names.tool.d.ts +30 -0
- package/dist/mcp/primitives/essential/tools/model-names.tool.d.ts +30 -0
- package/dist/mcp/primitives/essential/tools/model-styling.tool.d.ts +30 -0
- package/dist/mcp/primitives/essential/tools/notes-info.tool.d.ts +30 -0
- package/dist/mcp/primitives/essential/tools/present-card.tool.d.ts +30 -0
- package/dist/mcp/primitives/essential/tools/rate-card.tool.d.ts +30 -0
- package/dist/mcp/primitives/essential/tools/sync.tool.d.ts +30 -0
- package/dist/mcp/primitives/essential/tools/tagActions/actions/addTags.action.d.ts +12 -0
- package/dist/mcp/primitives/essential/tools/tagActions/actions/addTags.action.js +25 -0
- package/dist/mcp/primitives/essential/tools/tagActions/actions/addTags.action.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/tagActions/actions/clearUnusedTags.action.d.ts +7 -0
- package/dist/mcp/primitives/essential/tools/tagActions/actions/clearUnusedTags.action.js +11 -0
- package/dist/mcp/primitives/essential/tools/tagActions/actions/clearUnusedTags.action.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/tagActions/actions/removeTags.action.d.ts +12 -0
- package/dist/mcp/primitives/essential/tools/tagActions/actions/removeTags.action.js +25 -0
- package/dist/mcp/primitives/essential/tools/tagActions/actions/removeTags.action.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/tagActions/actions/replaceTags.action.d.ts +14 -0
- package/dist/mcp/primitives/essential/tools/tagActions/actions/replaceTags.action.js +33 -0
- package/dist/mcp/primitives/essential/tools/tagActions/actions/replaceTags.action.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/tagActions/index.d.ts +5 -0
- package/dist/mcp/primitives/essential/tools/tagActions/index.js +6 -0
- package/dist/mcp/primitives/essential/tools/tagActions/index.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/tagActions/tagActions.tool.d.ts +109 -0
- package/dist/mcp/primitives/essential/tools/tagActions/tagActions.tool.js +138 -0
- package/dist/mcp/primitives/essential/tools/tagActions/tagActions.tool.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/update-model-styling.tool.d.ts +30 -0
- package/dist/mcp/primitives/essential/tools/update-note-fields.tool.d.ts +30 -0
- package/dist/mcp/primitives/essential/tools/update-note-fields.tool.js +1 -1
- package/dist/mcp/primitives/essential/tools/update-note-fields.tool.js.map +1 -1
- package/dist/mcp/primitives/gui/index.d.ts +12 -0
- package/dist/mcp/primitives/gui/index.js +5 -5
- package/dist/mcp/primitives/gui/index.js.map +1 -1
- package/dist/mcp/primitives/gui/tools/gui-add-cards.tool.d.ts +30 -0
- package/dist/mcp/primitives/gui/tools/gui-add-cards.tool.js +1 -1
- package/dist/mcp/primitives/gui/tools/gui-add-cards.tool.js.map +1 -1
- package/dist/mcp/primitives/gui/tools/gui-browse.tool.d.ts +30 -0
- package/dist/mcp/primitives/gui/tools/gui-current-card.tool.d.ts +30 -0
- package/dist/mcp/primitives/gui/tools/gui-deck-browser.tool.d.ts +30 -0
- package/dist/mcp/primitives/gui/tools/gui-deck-overview.tool.d.ts +30 -0
- package/dist/mcp/primitives/gui/tools/gui-edit-note.tool.d.ts +30 -0
- package/dist/mcp/primitives/gui/tools/gui-select-card.tool.d.ts +30 -0
- package/dist/mcp/primitives/gui/tools/gui-selected-notes.tool.d.ts +30 -0
- package/dist/mcp/primitives/gui/tools/gui-show-answer.tool.d.ts +30 -0
- package/dist/mcp/primitives/gui/tools/gui-show-question.tool.d.ts +30 -0
- package/dist/mcp/primitives/gui/tools/gui-undo.tool.d.ts +30 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +35 -28
|
@@ -11,6 +11,11 @@ export declare class NotesInfoTool {
|
|
|
11
11
|
content: ({
|
|
12
12
|
type: "text";
|
|
13
13
|
text: string;
|
|
14
|
+
annotations?: {
|
|
15
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
16
|
+
priority?: number | undefined;
|
|
17
|
+
lastModified?: string | undefined;
|
|
18
|
+
} | undefined;
|
|
14
19
|
_meta?: {
|
|
15
20
|
[x: string]: unknown;
|
|
16
21
|
} | undefined;
|
|
@@ -18,6 +23,11 @@ export declare class NotesInfoTool {
|
|
|
18
23
|
type: "image";
|
|
19
24
|
data: string;
|
|
20
25
|
mimeType: string;
|
|
26
|
+
annotations?: {
|
|
27
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
28
|
+
priority?: number | undefined;
|
|
29
|
+
lastModified?: string | undefined;
|
|
30
|
+
} | undefined;
|
|
21
31
|
_meta?: {
|
|
22
32
|
[x: string]: unknown;
|
|
23
33
|
} | undefined;
|
|
@@ -25,6 +35,11 @@ export declare class NotesInfoTool {
|
|
|
25
35
|
type: "audio";
|
|
26
36
|
data: string;
|
|
27
37
|
mimeType: string;
|
|
38
|
+
annotations?: {
|
|
39
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
40
|
+
priority?: number | undefined;
|
|
41
|
+
lastModified?: string | undefined;
|
|
42
|
+
} | undefined;
|
|
28
43
|
_meta?: {
|
|
29
44
|
[x: string]: unknown;
|
|
30
45
|
} | undefined;
|
|
@@ -34,6 +49,11 @@ export declare class NotesInfoTool {
|
|
|
34
49
|
type: "resource_link";
|
|
35
50
|
description?: string | undefined;
|
|
36
51
|
mimeType?: string | undefined;
|
|
52
|
+
annotations?: {
|
|
53
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
54
|
+
priority?: number | undefined;
|
|
55
|
+
lastModified?: string | undefined;
|
|
56
|
+
} | undefined;
|
|
37
57
|
_meta?: {
|
|
38
58
|
[x: string]: unknown;
|
|
39
59
|
} | undefined;
|
|
@@ -41,6 +61,7 @@ export declare class NotesInfoTool {
|
|
|
41
61
|
src: string;
|
|
42
62
|
mimeType?: string | undefined;
|
|
43
63
|
sizes?: string[] | undefined;
|
|
64
|
+
theme?: "light" | "dark" | undefined;
|
|
44
65
|
}[] | undefined;
|
|
45
66
|
title?: string | undefined;
|
|
46
67
|
} | {
|
|
@@ -60,12 +81,21 @@ export declare class NotesInfoTool {
|
|
|
60
81
|
[x: string]: unknown;
|
|
61
82
|
} | undefined;
|
|
62
83
|
};
|
|
84
|
+
annotations?: {
|
|
85
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
86
|
+
priority?: number | undefined;
|
|
87
|
+
lastModified?: string | undefined;
|
|
88
|
+
} | undefined;
|
|
63
89
|
_meta?: {
|
|
64
90
|
[x: string]: unknown;
|
|
65
91
|
} | undefined;
|
|
66
92
|
})[];
|
|
67
93
|
_meta?: {
|
|
68
94
|
[x: string]: unknown;
|
|
95
|
+
progressToken?: string | number | undefined;
|
|
96
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
97
|
+
taskId: string;
|
|
98
|
+
} | undefined;
|
|
69
99
|
} | undefined;
|
|
70
100
|
structuredContent?: {
|
|
71
101
|
[x: string]: unknown;
|
|
@@ -12,6 +12,11 @@ export declare class PresentCardTool {
|
|
|
12
12
|
content: ({
|
|
13
13
|
type: "text";
|
|
14
14
|
text: string;
|
|
15
|
+
annotations?: {
|
|
16
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
17
|
+
priority?: number | undefined;
|
|
18
|
+
lastModified?: string | undefined;
|
|
19
|
+
} | undefined;
|
|
15
20
|
_meta?: {
|
|
16
21
|
[x: string]: unknown;
|
|
17
22
|
} | undefined;
|
|
@@ -19,6 +24,11 @@ export declare class PresentCardTool {
|
|
|
19
24
|
type: "image";
|
|
20
25
|
data: string;
|
|
21
26
|
mimeType: string;
|
|
27
|
+
annotations?: {
|
|
28
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
29
|
+
priority?: number | undefined;
|
|
30
|
+
lastModified?: string | undefined;
|
|
31
|
+
} | undefined;
|
|
22
32
|
_meta?: {
|
|
23
33
|
[x: string]: unknown;
|
|
24
34
|
} | undefined;
|
|
@@ -26,6 +36,11 @@ export declare class PresentCardTool {
|
|
|
26
36
|
type: "audio";
|
|
27
37
|
data: string;
|
|
28
38
|
mimeType: string;
|
|
39
|
+
annotations?: {
|
|
40
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
41
|
+
priority?: number | undefined;
|
|
42
|
+
lastModified?: string | undefined;
|
|
43
|
+
} | undefined;
|
|
29
44
|
_meta?: {
|
|
30
45
|
[x: string]: unknown;
|
|
31
46
|
} | undefined;
|
|
@@ -35,6 +50,11 @@ export declare class PresentCardTool {
|
|
|
35
50
|
type: "resource_link";
|
|
36
51
|
description?: string | undefined;
|
|
37
52
|
mimeType?: string | undefined;
|
|
53
|
+
annotations?: {
|
|
54
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
55
|
+
priority?: number | undefined;
|
|
56
|
+
lastModified?: string | undefined;
|
|
57
|
+
} | undefined;
|
|
38
58
|
_meta?: {
|
|
39
59
|
[x: string]: unknown;
|
|
40
60
|
} | undefined;
|
|
@@ -42,6 +62,7 @@ export declare class PresentCardTool {
|
|
|
42
62
|
src: string;
|
|
43
63
|
mimeType?: string | undefined;
|
|
44
64
|
sizes?: string[] | undefined;
|
|
65
|
+
theme?: "light" | "dark" | undefined;
|
|
45
66
|
}[] | undefined;
|
|
46
67
|
title?: string | undefined;
|
|
47
68
|
} | {
|
|
@@ -61,12 +82,21 @@ export declare class PresentCardTool {
|
|
|
61
82
|
[x: string]: unknown;
|
|
62
83
|
} | undefined;
|
|
63
84
|
};
|
|
85
|
+
annotations?: {
|
|
86
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
87
|
+
priority?: number | undefined;
|
|
88
|
+
lastModified?: string | undefined;
|
|
89
|
+
} | undefined;
|
|
64
90
|
_meta?: {
|
|
65
91
|
[x: string]: unknown;
|
|
66
92
|
} | undefined;
|
|
67
93
|
})[];
|
|
68
94
|
_meta?: {
|
|
69
95
|
[x: string]: unknown;
|
|
96
|
+
progressToken?: string | number | undefined;
|
|
97
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
98
|
+
taskId: string;
|
|
99
|
+
} | undefined;
|
|
70
100
|
} | undefined;
|
|
71
101
|
structuredContent?: {
|
|
72
102
|
[x: string]: unknown;
|
|
@@ -12,6 +12,11 @@ export declare class RateCardTool {
|
|
|
12
12
|
content: ({
|
|
13
13
|
type: "text";
|
|
14
14
|
text: string;
|
|
15
|
+
annotations?: {
|
|
16
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
17
|
+
priority?: number | undefined;
|
|
18
|
+
lastModified?: string | undefined;
|
|
19
|
+
} | undefined;
|
|
15
20
|
_meta?: {
|
|
16
21
|
[x: string]: unknown;
|
|
17
22
|
} | undefined;
|
|
@@ -19,6 +24,11 @@ export declare class RateCardTool {
|
|
|
19
24
|
type: "image";
|
|
20
25
|
data: string;
|
|
21
26
|
mimeType: string;
|
|
27
|
+
annotations?: {
|
|
28
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
29
|
+
priority?: number | undefined;
|
|
30
|
+
lastModified?: string | undefined;
|
|
31
|
+
} | undefined;
|
|
22
32
|
_meta?: {
|
|
23
33
|
[x: string]: unknown;
|
|
24
34
|
} | undefined;
|
|
@@ -26,6 +36,11 @@ export declare class RateCardTool {
|
|
|
26
36
|
type: "audio";
|
|
27
37
|
data: string;
|
|
28
38
|
mimeType: string;
|
|
39
|
+
annotations?: {
|
|
40
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
41
|
+
priority?: number | undefined;
|
|
42
|
+
lastModified?: string | undefined;
|
|
43
|
+
} | undefined;
|
|
29
44
|
_meta?: {
|
|
30
45
|
[x: string]: unknown;
|
|
31
46
|
} | undefined;
|
|
@@ -35,6 +50,11 @@ export declare class RateCardTool {
|
|
|
35
50
|
type: "resource_link";
|
|
36
51
|
description?: string | undefined;
|
|
37
52
|
mimeType?: string | undefined;
|
|
53
|
+
annotations?: {
|
|
54
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
55
|
+
priority?: number | undefined;
|
|
56
|
+
lastModified?: string | undefined;
|
|
57
|
+
} | undefined;
|
|
38
58
|
_meta?: {
|
|
39
59
|
[x: string]: unknown;
|
|
40
60
|
} | undefined;
|
|
@@ -42,6 +62,7 @@ export declare class RateCardTool {
|
|
|
42
62
|
src: string;
|
|
43
63
|
mimeType?: string | undefined;
|
|
44
64
|
sizes?: string[] | undefined;
|
|
65
|
+
theme?: "light" | "dark" | undefined;
|
|
45
66
|
}[] | undefined;
|
|
46
67
|
title?: string | undefined;
|
|
47
68
|
} | {
|
|
@@ -61,12 +82,21 @@ export declare class RateCardTool {
|
|
|
61
82
|
[x: string]: unknown;
|
|
62
83
|
} | undefined;
|
|
63
84
|
};
|
|
85
|
+
annotations?: {
|
|
86
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
87
|
+
priority?: number | undefined;
|
|
88
|
+
lastModified?: string | undefined;
|
|
89
|
+
} | undefined;
|
|
64
90
|
_meta?: {
|
|
65
91
|
[x: string]: unknown;
|
|
66
92
|
} | undefined;
|
|
67
93
|
})[];
|
|
68
94
|
_meta?: {
|
|
69
95
|
[x: string]: unknown;
|
|
96
|
+
progressToken?: string | number | undefined;
|
|
97
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
98
|
+
taskId: string;
|
|
99
|
+
} | undefined;
|
|
70
100
|
} | undefined;
|
|
71
101
|
structuredContent?: {
|
|
72
102
|
[x: string]: unknown;
|
|
@@ -9,6 +9,11 @@ export declare class SyncTool {
|
|
|
9
9
|
content: ({
|
|
10
10
|
type: "text";
|
|
11
11
|
text: string;
|
|
12
|
+
annotations?: {
|
|
13
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
14
|
+
priority?: number | undefined;
|
|
15
|
+
lastModified?: string | undefined;
|
|
16
|
+
} | undefined;
|
|
12
17
|
_meta?: {
|
|
13
18
|
[x: string]: unknown;
|
|
14
19
|
} | undefined;
|
|
@@ -16,6 +21,11 @@ export declare class SyncTool {
|
|
|
16
21
|
type: "image";
|
|
17
22
|
data: string;
|
|
18
23
|
mimeType: string;
|
|
24
|
+
annotations?: {
|
|
25
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
26
|
+
priority?: number | undefined;
|
|
27
|
+
lastModified?: string | undefined;
|
|
28
|
+
} | undefined;
|
|
19
29
|
_meta?: {
|
|
20
30
|
[x: string]: unknown;
|
|
21
31
|
} | undefined;
|
|
@@ -23,6 +33,11 @@ export declare class SyncTool {
|
|
|
23
33
|
type: "audio";
|
|
24
34
|
data: string;
|
|
25
35
|
mimeType: string;
|
|
36
|
+
annotations?: {
|
|
37
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
38
|
+
priority?: number | undefined;
|
|
39
|
+
lastModified?: string | undefined;
|
|
40
|
+
} | undefined;
|
|
26
41
|
_meta?: {
|
|
27
42
|
[x: string]: unknown;
|
|
28
43
|
} | undefined;
|
|
@@ -32,6 +47,11 @@ export declare class SyncTool {
|
|
|
32
47
|
type: "resource_link";
|
|
33
48
|
description?: string | undefined;
|
|
34
49
|
mimeType?: string | undefined;
|
|
50
|
+
annotations?: {
|
|
51
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
52
|
+
priority?: number | undefined;
|
|
53
|
+
lastModified?: string | undefined;
|
|
54
|
+
} | undefined;
|
|
35
55
|
_meta?: {
|
|
36
56
|
[x: string]: unknown;
|
|
37
57
|
} | undefined;
|
|
@@ -39,6 +59,7 @@ export declare class SyncTool {
|
|
|
39
59
|
src: string;
|
|
40
60
|
mimeType?: string | undefined;
|
|
41
61
|
sizes?: string[] | undefined;
|
|
62
|
+
theme?: "light" | "dark" | undefined;
|
|
42
63
|
}[] | undefined;
|
|
43
64
|
title?: string | undefined;
|
|
44
65
|
} | {
|
|
@@ -58,12 +79,21 @@ export declare class SyncTool {
|
|
|
58
79
|
[x: string]: unknown;
|
|
59
80
|
} | undefined;
|
|
60
81
|
};
|
|
82
|
+
annotations?: {
|
|
83
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
84
|
+
priority?: number | undefined;
|
|
85
|
+
lastModified?: string | undefined;
|
|
86
|
+
} | undefined;
|
|
61
87
|
_meta?: {
|
|
62
88
|
[x: string]: unknown;
|
|
63
89
|
} | undefined;
|
|
64
90
|
})[];
|
|
65
91
|
_meta?: {
|
|
66
92
|
[x: string]: unknown;
|
|
93
|
+
progressToken?: string | number | undefined;
|
|
94
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
95
|
+
taskId: string;
|
|
96
|
+
} | undefined;
|
|
67
97
|
} | undefined;
|
|
68
98
|
structuredContent?: {
|
|
69
99
|
[x: string]: unknown;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AnkiConnectClient } from "@/mcp/clients/anki-connect.client";
|
|
2
|
+
export interface AddTagsParams {
|
|
3
|
+
notes: number[];
|
|
4
|
+
tags: string;
|
|
5
|
+
}
|
|
6
|
+
export interface AddTagsResult {
|
|
7
|
+
success: boolean;
|
|
8
|
+
message: string;
|
|
9
|
+
notesAffected: number;
|
|
10
|
+
tagsAdded: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare function addTags(params: AddTagsParams, client: AnkiConnectClient): Promise<AddTagsResult>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addTags = addTags;
|
|
4
|
+
async function addTags(params, client) {
|
|
5
|
+
const { notes, tags } = params;
|
|
6
|
+
if (!notes || notes.length === 0) {
|
|
7
|
+
throw new Error("notes array cannot be empty");
|
|
8
|
+
}
|
|
9
|
+
if (!tags || tags.trim() === "") {
|
|
10
|
+
throw new Error("tags string cannot be empty");
|
|
11
|
+
}
|
|
12
|
+
const trimmedTags = tags.trim();
|
|
13
|
+
const tagList = trimmedTags.split(/\s+/).filter(Boolean);
|
|
14
|
+
await client.invoke("addTags", {
|
|
15
|
+
notes,
|
|
16
|
+
tags: trimmedTags,
|
|
17
|
+
});
|
|
18
|
+
return {
|
|
19
|
+
success: true,
|
|
20
|
+
message: `Successfully added ${tagList.length} tag(s) to ${notes.length} note(s)`,
|
|
21
|
+
notesAffected: notes.length,
|
|
22
|
+
tagsAdded: tagList,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=addTags.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addTags.action.js","sourceRoot":"","sources":["../../../../../../../src/mcp/primitives/essential/tools/tagActions/actions/addTags.action.ts"],"names":[],"mappings":";;AA4BA,0BA+BC;AA/BM,KAAK,UAAU,OAAO,CAC3B,MAAqB,EACrB,MAAyB;IAEzB,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IAG/B,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IAGD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAChC,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAGzD,MAAM,MAAM,CAAC,MAAM,CAAO,SAAS,EAAE;QACnC,KAAK;QACL,IAAI,EAAE,WAAW;KAClB,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,sBAAsB,OAAO,CAAC,MAAM,cAAc,KAAK,CAAC,MAAM,UAAU;QACjF,aAAa,EAAE,KAAK,CAAC,MAAM;QAC3B,SAAS,EAAE,OAAO;KACnB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AnkiConnectClient } from "@/mcp/clients/anki-connect.client";
|
|
2
|
+
export type ClearUnusedTagsParams = Record<string, never>;
|
|
3
|
+
export interface ClearUnusedTagsResult {
|
|
4
|
+
success: boolean;
|
|
5
|
+
message: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function clearUnusedTags(_params: ClearUnusedTagsParams, client: AnkiConnectClient): Promise<ClearUnusedTagsResult>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clearUnusedTags = clearUnusedTags;
|
|
4
|
+
async function clearUnusedTags(_params, client) {
|
|
5
|
+
await client.invoke("clearUnusedTags");
|
|
6
|
+
return {
|
|
7
|
+
success: true,
|
|
8
|
+
message: "Successfully cleared unused tags from the collection",
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=clearUnusedTags.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clearUnusedTags.action.js","sourceRoot":"","sources":["../../../../../../../src/mcp/primitives/essential/tools/tagActions/actions/clearUnusedTags.action.ts"],"names":[],"mappings":";;AAwBA,0CAWC;AAXM,KAAK,UAAU,eAAe,CACnC,OAA8B,EAC9B,MAAyB;IAGzB,MAAM,MAAM,CAAC,MAAM,CAAO,iBAAiB,CAAC,CAAC;IAE7C,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,sDAAsD;KAChE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AnkiConnectClient } from "@/mcp/clients/anki-connect.client";
|
|
2
|
+
export interface RemoveTagsParams {
|
|
3
|
+
notes: number[];
|
|
4
|
+
tags: string;
|
|
5
|
+
}
|
|
6
|
+
export interface RemoveTagsResult {
|
|
7
|
+
success: boolean;
|
|
8
|
+
message: string;
|
|
9
|
+
notesAffected: number;
|
|
10
|
+
tagsRemoved: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare function removeTags(params: RemoveTagsParams, client: AnkiConnectClient): Promise<RemoveTagsResult>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removeTags = removeTags;
|
|
4
|
+
async function removeTags(params, client) {
|
|
5
|
+
const { notes, tags } = params;
|
|
6
|
+
if (!notes || notes.length === 0) {
|
|
7
|
+
throw new Error("notes array cannot be empty");
|
|
8
|
+
}
|
|
9
|
+
if (!tags || tags.trim() === "") {
|
|
10
|
+
throw new Error("tags string cannot be empty");
|
|
11
|
+
}
|
|
12
|
+
const trimmedTags = tags.trim();
|
|
13
|
+
const tagList = trimmedTags.split(/\s+/).filter(Boolean);
|
|
14
|
+
await client.invoke("removeTags", {
|
|
15
|
+
notes,
|
|
16
|
+
tags: trimmedTags,
|
|
17
|
+
});
|
|
18
|
+
return {
|
|
19
|
+
success: true,
|
|
20
|
+
message: `Successfully removed ${tagList.length} tag(s) from ${notes.length} note(s)`,
|
|
21
|
+
notesAffected: notes.length,
|
|
22
|
+
tagsRemoved: tagList,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=removeTags.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeTags.action.js","sourceRoot":"","sources":["../../../../../../../src/mcp/primitives/essential/tools/tagActions/actions/removeTags.action.ts"],"names":[],"mappings":";;AA4BA,gCA+BC;AA/BM,KAAK,UAAU,UAAU,CAC9B,MAAwB,EACxB,MAAyB;IAEzB,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IAG/B,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IAGD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAChC,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAGzD,MAAM,MAAM,CAAC,MAAM,CAAO,YAAY,EAAE;QACtC,KAAK;QACL,IAAI,EAAE,WAAW;KAClB,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,wBAAwB,OAAO,CAAC,MAAM,gBAAgB,KAAK,CAAC,MAAM,UAAU;QACrF,aAAa,EAAE,KAAK,CAAC,MAAM;QAC3B,WAAW,EAAE,OAAO;KACrB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AnkiConnectClient } from "@/mcp/clients/anki-connect.client";
|
|
2
|
+
export interface ReplaceTagsParams {
|
|
3
|
+
notes: number[];
|
|
4
|
+
tagToReplace: string;
|
|
5
|
+
replaceWithTag: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ReplaceTagsResult {
|
|
8
|
+
success: boolean;
|
|
9
|
+
message: string;
|
|
10
|
+
notesAffected: number;
|
|
11
|
+
tagToReplace: string;
|
|
12
|
+
replaceWithTag: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function replaceTags(params: ReplaceTagsParams, client: AnkiConnectClient): Promise<ReplaceTagsResult>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.replaceTags = replaceTags;
|
|
4
|
+
async function replaceTags(params, client) {
|
|
5
|
+
const { notes, tagToReplace, replaceWithTag } = params;
|
|
6
|
+
if (!notes || notes.length === 0) {
|
|
7
|
+
throw new Error("notes array cannot be empty");
|
|
8
|
+
}
|
|
9
|
+
if (!tagToReplace || tagToReplace.trim() === "") {
|
|
10
|
+
throw new Error("tagToReplace cannot be empty");
|
|
11
|
+
}
|
|
12
|
+
if (!replaceWithTag || replaceWithTag.trim() === "") {
|
|
13
|
+
throw new Error("replaceWithTag cannot be empty");
|
|
14
|
+
}
|
|
15
|
+
const trimmedOld = tagToReplace.trim();
|
|
16
|
+
const trimmedNew = replaceWithTag.trim();
|
|
17
|
+
if (trimmedOld.includes(" ") || trimmedNew.includes(" ")) {
|
|
18
|
+
throw new Error("Tags cannot contain spaces. Use single tags only.");
|
|
19
|
+
}
|
|
20
|
+
await client.invoke("replaceTags", {
|
|
21
|
+
notes,
|
|
22
|
+
tag_to_replace: trimmedOld,
|
|
23
|
+
replace_with_tag: trimmedNew,
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
success: true,
|
|
27
|
+
message: `Successfully replaced "${trimmedOld}" with "${trimmedNew}" in ${notes.length} note(s)`,
|
|
28
|
+
notesAffected: notes.length,
|
|
29
|
+
tagToReplace: trimmedOld,
|
|
30
|
+
replaceWithTag: trimmedNew,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=replaceTags.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replaceTags.action.js","sourceRoot":"","sources":["../../../../../../../src/mcp/primitives/essential/tools/tagActions/actions/replaceTags.action.ts"],"names":[],"mappings":";;AAkCA,kCA2CC;AA3CM,KAAK,UAAU,WAAW,CAC/B,MAAyB,EACzB,MAAyB;IAEzB,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC;IAGvD,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IAGD,IAAI,CAAC,YAAY,IAAI,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;IAGD,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACpD,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,UAAU,GAAG,YAAY,CAAC,IAAI,EAAE,CAAC;IACvC,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,EAAE,CAAC;IAGzC,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACzD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IAGD,MAAM,MAAM,CAAC,MAAM,CAAO,aAAa,EAAE;QACvC,KAAK;QACL,cAAc,EAAE,UAAU;QAC1B,gBAAgB,EAAE,UAAU;KAC7B,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,0BAA0B,UAAU,WAAW,UAAU,QAAQ,KAAK,CAAC,MAAM,UAAU;QAChG,aAAa,EAAE,KAAK,CAAC,MAAM;QAC3B,YAAY,EAAE,UAAU;QACxB,cAAc,EAAE,UAAU;KAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { TagActionsTool } from "./tagActions.tool";
|
|
2
|
+
export type { AddTagsParams, AddTagsResult } from "./actions/addTags.action";
|
|
3
|
+
export type { RemoveTagsParams, RemoveTagsResult, } from "./actions/removeTags.action";
|
|
4
|
+
export type { ReplaceTagsParams, ReplaceTagsResult, } from "./actions/replaceTags.action";
|
|
5
|
+
export type { ClearUnusedTagsParams, ClearUnusedTagsResult, } from "./actions/clearUnusedTags.action";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TagActionsTool = void 0;
|
|
4
|
+
var tagActions_tool_1 = require("./tagActions.tool");
|
|
5
|
+
Object.defineProperty(exports, "TagActionsTool", { enumerable: true, get: function () { return tagActions_tool_1.TagActionsTool; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/mcp/primitives/essential/tools/tagActions/index.ts"],"names":[],"mappings":";;;AAIA,qDAAmD;AAA1C,iHAAA,cAAc,OAAA"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { Context } from "@rekog/mcp-nest";
|
|
2
|
+
import { AnkiConnectClient } from "@/mcp/clients/anki-connect.client";
|
|
3
|
+
export declare class TagActionsTool {
|
|
4
|
+
private readonly ankiClient;
|
|
5
|
+
private readonly logger;
|
|
6
|
+
constructor(ankiClient: AnkiConnectClient);
|
|
7
|
+
execute(params: {
|
|
8
|
+
action: "addTags" | "removeTags" | "replaceTags" | "clearUnusedTags";
|
|
9
|
+
notes?: number[];
|
|
10
|
+
tags?: string;
|
|
11
|
+
tagToReplace?: string;
|
|
12
|
+
replaceWithTag?: string;
|
|
13
|
+
}, context: Context): Promise<{
|
|
14
|
+
[x: string]: unknown;
|
|
15
|
+
content: ({
|
|
16
|
+
type: "text";
|
|
17
|
+
text: string;
|
|
18
|
+
annotations?: {
|
|
19
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
20
|
+
priority?: number | undefined;
|
|
21
|
+
lastModified?: string | undefined;
|
|
22
|
+
} | undefined;
|
|
23
|
+
_meta?: {
|
|
24
|
+
[x: string]: unknown;
|
|
25
|
+
} | undefined;
|
|
26
|
+
} | {
|
|
27
|
+
type: "image";
|
|
28
|
+
data: string;
|
|
29
|
+
mimeType: string;
|
|
30
|
+
annotations?: {
|
|
31
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
32
|
+
priority?: number | undefined;
|
|
33
|
+
lastModified?: string | undefined;
|
|
34
|
+
} | undefined;
|
|
35
|
+
_meta?: {
|
|
36
|
+
[x: string]: unknown;
|
|
37
|
+
} | undefined;
|
|
38
|
+
} | {
|
|
39
|
+
type: "audio";
|
|
40
|
+
data: string;
|
|
41
|
+
mimeType: string;
|
|
42
|
+
annotations?: {
|
|
43
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
44
|
+
priority?: number | undefined;
|
|
45
|
+
lastModified?: string | undefined;
|
|
46
|
+
} | undefined;
|
|
47
|
+
_meta?: {
|
|
48
|
+
[x: string]: unknown;
|
|
49
|
+
} | undefined;
|
|
50
|
+
} | {
|
|
51
|
+
uri: string;
|
|
52
|
+
name: string;
|
|
53
|
+
type: "resource_link";
|
|
54
|
+
description?: string | undefined;
|
|
55
|
+
mimeType?: string | undefined;
|
|
56
|
+
annotations?: {
|
|
57
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
58
|
+
priority?: number | undefined;
|
|
59
|
+
lastModified?: string | undefined;
|
|
60
|
+
} | undefined;
|
|
61
|
+
_meta?: {
|
|
62
|
+
[x: string]: unknown;
|
|
63
|
+
} | undefined;
|
|
64
|
+
icons?: {
|
|
65
|
+
src: string;
|
|
66
|
+
mimeType?: string | undefined;
|
|
67
|
+
sizes?: string[] | undefined;
|
|
68
|
+
theme?: "light" | "dark" | undefined;
|
|
69
|
+
}[] | undefined;
|
|
70
|
+
title?: string | undefined;
|
|
71
|
+
} | {
|
|
72
|
+
type: "resource";
|
|
73
|
+
resource: {
|
|
74
|
+
uri: string;
|
|
75
|
+
text: string;
|
|
76
|
+
mimeType?: string | undefined;
|
|
77
|
+
_meta?: {
|
|
78
|
+
[x: string]: unknown;
|
|
79
|
+
} | undefined;
|
|
80
|
+
} | {
|
|
81
|
+
uri: string;
|
|
82
|
+
blob: string;
|
|
83
|
+
mimeType?: string | undefined;
|
|
84
|
+
_meta?: {
|
|
85
|
+
[x: string]: unknown;
|
|
86
|
+
} | undefined;
|
|
87
|
+
};
|
|
88
|
+
annotations?: {
|
|
89
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
90
|
+
priority?: number | undefined;
|
|
91
|
+
lastModified?: string | undefined;
|
|
92
|
+
} | undefined;
|
|
93
|
+
_meta?: {
|
|
94
|
+
[x: string]: unknown;
|
|
95
|
+
} | undefined;
|
|
96
|
+
})[];
|
|
97
|
+
_meta?: {
|
|
98
|
+
[x: string]: unknown;
|
|
99
|
+
progressToken?: string | number | undefined;
|
|
100
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
101
|
+
taskId: string;
|
|
102
|
+
} | undefined;
|
|
103
|
+
} | undefined;
|
|
104
|
+
structuredContent?: {
|
|
105
|
+
[x: string]: unknown;
|
|
106
|
+
} | undefined;
|
|
107
|
+
isError?: boolean | undefined;
|
|
108
|
+
}>;
|
|
109
|
+
}
|