@ankimcp/anki-mcp-server 0.15.1 → 0.17.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 +16 -5
- package/README.md +50 -24
- package/dist/app.module.js +3 -0
- package/dist/app.module.js.map +1 -1
- package/dist/mcp/mcp-icons.d.ts +2 -0
- package/dist/mcp/mcp-icons.js +11 -0
- package/dist/mcp/mcp-icons.js.map +1 -0
- package/dist/mcp/primitives/essential/index.d.ts +25 -7
- package/dist/mcp/primitives/essential/index.js +49 -13
- package/dist/mcp/primitives/essential/index.js.map +1 -1
- package/dist/mcp/primitives/essential/prompts/twenty-rules.prompt/content.md +2 -2
- package/dist/mcp/primitives/essential/tools/add-note.tool.d.ts +2 -1
- package/dist/mcp/primitives/essential/tools/add-note.tool.js +2 -0
- package/dist/mcp/primitives/essential/tools/add-note.tool.js.map +1 -1
- package/dist/mcp/primitives/essential/tools/add-notes.tool.d.ts +2 -1
- package/dist/mcp/primitives/essential/tools/add-notes.tool.js +2 -0
- package/dist/mcp/primitives/essential/tools/add-notes.tool.js.map +1 -1
- package/dist/mcp/primitives/essential/tools/{tagActions/tagActions.tool.d.ts → add-tags.tool.d.ts} +6 -9
- package/dist/mcp/primitives/essential/tools/add-tags.tool.js +85 -0
- package/dist/mcp/primitives/essential/tools/add-tags.tool.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/change-deck.tool.d.ts +107 -0
- package/dist/mcp/primitives/essential/tools/change-deck.tool.js +79 -0
- package/dist/mcp/primitives/essential/tools/change-deck.tool.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/clear-unused-tags.tool.d.ts +104 -0
- package/dist/mcp/primitives/essential/tools/clear-unused-tags.tool.js +68 -0
- package/dist/mcp/primitives/essential/tools/clear-unused-tags.tool.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/collection-stats/collection-stats.tool.d.ts +2 -1
- package/dist/mcp/primitives/essential/tools/collection-stats/collection-stats.tool.js +2 -0
- package/dist/mcp/primitives/essential/tools/collection-stats/collection-stats.tool.js.map +1 -1
- package/dist/mcp/primitives/essential/tools/collection-stats/collection-stats.types.d.ts +1 -1
- package/dist/mcp/primitives/essential/tools/create-deck.tool.d.ts +106 -0
- package/dist/mcp/primitives/essential/tools/create-deck.tool.js +78 -0
- package/dist/mcp/primitives/essential/tools/create-deck.tool.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/create-model.tool.d.ts +3 -2
- package/dist/mcp/primitives/essential/tools/create-model.tool.js +2 -0
- package/dist/mcp/primitives/essential/tools/create-model.tool.js.map +1 -1
- package/dist/mcp/primitives/essential/tools/{deckActions/deckActions.tool.d.ts → deck-stats.tool.d.ts} +5 -12
- package/dist/mcp/primitives/essential/tools/deck-stats.tool.js +108 -0
- package/dist/mcp/primitives/essential/tools/deck-stats.tool.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/deckActions/actions/changeDeck.action.d.ts +1 -1
- package/dist/mcp/primitives/essential/tools/deckActions/actions/createDeck.action.d.ts +1 -1
- package/dist/mcp/primitives/essential/tools/deckActions/actions/deckStats.action.d.ts +2 -2
- package/dist/mcp/primitives/essential/tools/deckActions/actions/listDecks.action.d.ts +2 -2
- package/dist/mcp/primitives/essential/tools/delete-media-file.tool.d.ts +106 -0
- package/dist/mcp/primitives/essential/tools/delete-media-file.tool.js +73 -0
- package/dist/mcp/primitives/essential/tools/delete-media-file.tool.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/delete-notes.tool.d.ts +2 -1
- package/dist/mcp/primitives/essential/tools/delete-notes.tool.js +2 -1
- package/dist/mcp/primitives/essential/tools/delete-notes.tool.js.map +1 -1
- package/dist/mcp/primitives/essential/tools/find-notes.tool.d.ts +2 -1
- package/dist/mcp/primitives/essential/tools/find-notes.tool.js +2 -0
- package/dist/mcp/primitives/essential/tools/find-notes.tool.js.map +1 -1
- package/dist/mcp/primitives/essential/tools/get-cards.tool.d.ts +3 -2
- package/dist/mcp/primitives/essential/tools/get-cards.tool.js +2 -0
- package/dist/mcp/primitives/essential/tools/get-cards.tool.js.map +1 -1
- package/dist/mcp/primitives/essential/tools/get-due-cards.tool.d.ts +3 -2
- package/dist/mcp/primitives/essential/tools/get-due-cards.tool.js +2 -0
- package/dist/mcp/primitives/essential/tools/get-due-cards.tool.js.map +1 -1
- package/dist/mcp/primitives/essential/tools/get-media-files-names.tool.d.ts +106 -0
- package/dist/mcp/primitives/essential/tools/get-media-files-names.tool.js +76 -0
- package/dist/mcp/primitives/essential/tools/get-media-files-names.tool.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/get-tags.tool.d.ts +2 -1
- package/dist/mcp/primitives/essential/tools/get-tags.tool.js +2 -0
- package/dist/mcp/primitives/essential/tools/get-tags.tool.js.map +1 -1
- package/dist/mcp/primitives/essential/tools/list-decks.tool.d.ts +106 -0
- package/dist/mcp/primitives/essential/tools/list-decks.tool.js +96 -0
- package/dist/mcp/primitives/essential/tools/list-decks.tool.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/mediaActions/actions/deleteMediaFile.action.d.ts +1 -1
- package/dist/mcp/primitives/essential/tools/mediaActions/actions/getMediaFilesNames.action.d.ts +1 -1
- package/dist/mcp/primitives/essential/tools/mediaActions/actions/retrieveMediaFile.action.d.ts +1 -1
- package/dist/mcp/primitives/essential/tools/mediaActions/actions/storeMediaFile.action.d.ts +1 -1
- package/dist/mcp/primitives/essential/tools/model-field-names.tool.d.ts +2 -1
- package/dist/mcp/primitives/essential/tools/model-field-names.tool.js +2 -0
- package/dist/mcp/primitives/essential/tools/model-field-names.tool.js.map +1 -1
- package/dist/mcp/primitives/essential/tools/model-names.tool.d.ts +2 -1
- package/dist/mcp/primitives/essential/tools/model-names.tool.js +2 -0
- package/dist/mcp/primitives/essential/tools/model-names.tool.js.map +1 -1
- package/dist/mcp/primitives/essential/tools/model-styling.tool.d.ts +2 -1
- package/dist/mcp/primitives/essential/tools/model-styling.tool.js +2 -0
- package/dist/mcp/primitives/essential/tools/model-styling.tool.js.map +1 -1
- package/dist/mcp/primitives/essential/tools/notes-info.tool.d.ts +3 -2
- package/dist/mcp/primitives/essential/tools/notes-info.tool.js +2 -0
- package/dist/mcp/primitives/essential/tools/notes-info.tool.js.map +1 -1
- package/dist/mcp/primitives/essential/tools/present-card.tool.d.ts +3 -2
- package/dist/mcp/primitives/essential/tools/present-card.tool.js +2 -0
- package/dist/mcp/primitives/essential/tools/present-card.tool.js.map +1 -1
- package/dist/mcp/primitives/essential/tools/rate-card.tool.d.ts +2 -1
- package/dist/mcp/primitives/essential/tools/rate-card.tool.js +2 -0
- package/dist/mcp/primitives/essential/tools/rate-card.tool.js.map +1 -1
- package/dist/mcp/primitives/essential/tools/remove-tags.tool.d.ts +107 -0
- package/dist/mcp/primitives/essential/tools/remove-tags.tool.js +85 -0
- package/dist/mcp/primitives/essential/tools/remove-tags.tool.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/replace-tags.tool.d.ts +108 -0
- package/dist/mcp/primitives/essential/tools/replace-tags.tool.js +92 -0
- package/dist/mcp/primitives/essential/tools/replace-tags.tool.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/retrieve-media-file.tool.d.ts +106 -0
- package/dist/mcp/primitives/essential/tools/retrieve-media-file.tool.js +75 -0
- package/dist/mcp/primitives/essential/tools/retrieve-media-file.tool.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/review-stats/review-stats.tool.d.ts +2 -1
- package/dist/mcp/primitives/essential/tools/review-stats/review-stats.tool.js +2 -0
- package/dist/mcp/primitives/essential/tools/review-stats/review-stats.tool.js.map +1 -1
- package/dist/mcp/primitives/essential/tools/review-stats/review-stats.types.d.ts +1 -1
- package/dist/mcp/primitives/essential/tools/{mediaActions/mediaActions.tool.d.ts → store-media-file.tool.d.ts} +5 -8
- package/dist/mcp/primitives/essential/tools/store-media-file.tool.js +92 -0
- package/dist/mcp/primitives/essential/tools/store-media-file.tool.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/sync.tool.d.ts +2 -1
- package/dist/mcp/primitives/essential/tools/sync.tool.js +2 -0
- package/dist/mcp/primitives/essential/tools/sync.tool.js.map +1 -1
- package/dist/mcp/primitives/essential/tools/tagActions/actions/addTags.action.d.ts +1 -1
- package/dist/mcp/primitives/essential/tools/tagActions/actions/clearUnusedTags.action.d.ts +1 -1
- package/dist/mcp/primitives/essential/tools/tagActions/actions/removeTags.action.d.ts +1 -1
- package/dist/mcp/primitives/essential/tools/tagActions/actions/replaceTags.action.d.ts +1 -1
- package/dist/mcp/primitives/essential/tools/update-model-styling.tool.d.ts +2 -1
- package/dist/mcp/primitives/essential/tools/update-model-styling.tool.js +2 -0
- package/dist/mcp/primitives/essential/tools/update-model-styling.tool.js.map +1 -1
- package/dist/mcp/primitives/essential/tools/update-note-fields.tool.d.ts +2 -1
- package/dist/mcp/primitives/essential/tools/update-note-fields.tool.js +2 -0
- package/dist/mcp/primitives/essential/tools/update-note-fields.tool.js.map +1 -1
- package/dist/mcp/primitives/gui/tools/gui-add-cards.tool.d.ts +2 -1
- package/dist/mcp/primitives/gui/tools/gui-add-cards.tool.js +3 -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 +2 -1
- package/dist/mcp/primitives/gui/tools/gui-browse.tool.js +2 -0
- package/dist/mcp/primitives/gui/tools/gui-browse.tool.js.map +1 -1
- package/dist/mcp/primitives/gui/tools/gui-current-card.tool.d.ts +3 -2
- package/dist/mcp/primitives/gui/tools/gui-current-card.tool.js +2 -0
- package/dist/mcp/primitives/gui/tools/gui-current-card.tool.js.map +1 -1
- package/dist/mcp/primitives/gui/tools/gui-deck-browser.tool.d.ts +2 -1
- package/dist/mcp/primitives/gui/tools/gui-deck-browser.tool.js +2 -0
- package/dist/mcp/primitives/gui/tools/gui-deck-browser.tool.js.map +1 -1
- package/dist/mcp/primitives/gui/tools/gui-deck-overview.tool.d.ts +2 -1
- package/dist/mcp/primitives/gui/tools/gui-deck-overview.tool.js +2 -0
- package/dist/mcp/primitives/gui/tools/gui-deck-overview.tool.js.map +1 -1
- package/dist/mcp/primitives/gui/tools/gui-edit-note.tool.d.ts +2 -1
- package/dist/mcp/primitives/gui/tools/gui-edit-note.tool.js +2 -0
- package/dist/mcp/primitives/gui/tools/gui-edit-note.tool.js.map +1 -1
- package/dist/mcp/primitives/gui/tools/gui-select-card.tool.d.ts +2 -1
- package/dist/mcp/primitives/gui/tools/gui-select-card.tool.js +2 -0
- package/dist/mcp/primitives/gui/tools/gui-select-card.tool.js.map +1 -1
- package/dist/mcp/primitives/gui/tools/gui-selected-notes.tool.d.ts +2 -1
- package/dist/mcp/primitives/gui/tools/gui-selected-notes.tool.js +2 -0
- package/dist/mcp/primitives/gui/tools/gui-selected-notes.tool.js.map +1 -1
- package/dist/mcp/primitives/gui/tools/gui-show-answer.tool.d.ts +2 -1
- package/dist/mcp/primitives/gui/tools/gui-show-answer.tool.js +2 -0
- package/dist/mcp/primitives/gui/tools/gui-show-answer.tool.js.map +1 -1
- package/dist/mcp/primitives/gui/tools/gui-show-question.tool.d.ts +2 -1
- package/dist/mcp/primitives/gui/tools/gui-show-question.tool.js +2 -0
- package/dist/mcp/primitives/gui/tools/gui-show-question.tool.js.map +1 -1
- package/dist/mcp/primitives/gui/tools/gui-undo.tool.d.ts +2 -1
- package/dist/mcp/primitives/gui/tools/gui-undo.tool.js +2 -0
- package/dist/mcp/primitives/gui/tools/gui-undo.tool.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +22 -19
- package/dist/mcp/primitives/essential/tools/deckActions/deckActions.tool.js +0 -210
- package/dist/mcp/primitives/essential/tools/deckActions/deckActions.tool.js.map +0 -1
- package/dist/mcp/primitives/essential/tools/deckActions/index.d.ts +0 -5
- package/dist/mcp/primitives/essential/tools/deckActions/index.js +0 -6
- package/dist/mcp/primitives/essential/tools/deckActions/index.js.map +0 -1
- package/dist/mcp/primitives/essential/tools/mediaActions/index.d.ts +0 -5
- package/dist/mcp/primitives/essential/tools/mediaActions/index.js +0 -6
- package/dist/mcp/primitives/essential/tools/mediaActions/index.js.map +0 -1
- package/dist/mcp/primitives/essential/tools/mediaActions/mediaActions.tool.js +0 -156
- package/dist/mcp/primitives/essential/tools/mediaActions/mediaActions.tool.js.map +0 -1
- package/dist/mcp/primitives/essential/tools/tagActions/index.d.ts +0 -5
- package/dist/mcp/primitives/essential/tools/tagActions/index.js +0 -6
- package/dist/mcp/primitives/essential/tools/tagActions/index.js.map +0 -1
- package/dist/mcp/primitives/essential/tools/tagActions/tagActions.tool.js +0 -153
- package/dist/mcp/primitives/essential/tools/tagActions/tagActions.tool.js.map +0 -1
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var AddTagsTool_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.AddTagsTool = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const mcp_nest_1 = require("@rekog/mcp-nest");
|
|
16
|
+
const zod_1 = require("zod");
|
|
17
|
+
const anki_connect_client_1 = require("../../../clients/anki-connect.client");
|
|
18
|
+
const anki_utils_1 = require("../../../utils/anki.utils");
|
|
19
|
+
const addTags_action_1 = require("./tagActions/actions/addTags.action");
|
|
20
|
+
let AddTagsTool = AddTagsTool_1 = class AddTagsTool {
|
|
21
|
+
ankiClient;
|
|
22
|
+
logger = new common_1.Logger(AddTagsTool_1.name);
|
|
23
|
+
constructor(ankiClient) {
|
|
24
|
+
this.ankiClient = ankiClient;
|
|
25
|
+
}
|
|
26
|
+
async execute(params, context) {
|
|
27
|
+
try {
|
|
28
|
+
this.logger.log(`Executing addTags on ${params.notes?.length ?? 0} note(s)`);
|
|
29
|
+
if (!params.notes || params.notes.length === 0) {
|
|
30
|
+
throw new Error("notes array is required for addTags action");
|
|
31
|
+
}
|
|
32
|
+
if (!params.tags) {
|
|
33
|
+
throw new Error("tags string is required for addTags action");
|
|
34
|
+
}
|
|
35
|
+
await context.reportProgress({ progress: 25, total: 100 });
|
|
36
|
+
const result = await (0, addTags_action_1.addTags)({ notes: params.notes, tags: params.tags }, this.ankiClient);
|
|
37
|
+
await context.reportProgress({ progress: 100, total: 100 });
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
this.logger.error("Failed to execute addTags", error);
|
|
42
|
+
return (0, anki_utils_1.createErrorResponse)(error, {
|
|
43
|
+
action: "addTags",
|
|
44
|
+
hint: "Make sure Anki is running and the note IDs are valid",
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
exports.AddTagsTool = AddTagsTool;
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, mcp_nest_1.Tool)({
|
|
52
|
+
name: "addTags",
|
|
53
|
+
description: 'Add tags to specified notes. Tags is a space-separated string (e.g., "tag1 tag2 tag3"). Use getTags first to discover existing tags and prevent duplication.',
|
|
54
|
+
parameters: zod_1.z.object({
|
|
55
|
+
notes: zod_1.z
|
|
56
|
+
.array(zod_1.z.number())
|
|
57
|
+
.min(1)
|
|
58
|
+
.max(1000)
|
|
59
|
+
.describe("Array of note IDs to modify"),
|
|
60
|
+
tags: zod_1.z
|
|
61
|
+
.string()
|
|
62
|
+
.describe('Space-separated tags to add (e.g., "tag1 tag2")'),
|
|
63
|
+
}),
|
|
64
|
+
outputSchema: zod_1.z.object({
|
|
65
|
+
success: zod_1.z.boolean(),
|
|
66
|
+
message: zod_1.z.string(),
|
|
67
|
+
notesAffected: zod_1.z.number(),
|
|
68
|
+
tagsAdded: zod_1.z.array(zod_1.z.string()),
|
|
69
|
+
}),
|
|
70
|
+
annotations: {
|
|
71
|
+
title: "Add Tags",
|
|
72
|
+
readOnlyHint: false,
|
|
73
|
+
destructiveHint: false,
|
|
74
|
+
idempotentHint: true,
|
|
75
|
+
},
|
|
76
|
+
}),
|
|
77
|
+
__metadata("design:type", Function),
|
|
78
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
79
|
+
__metadata("design:returntype", Promise)
|
|
80
|
+
], AddTagsTool.prototype, "execute", null);
|
|
81
|
+
exports.AddTagsTool = AddTagsTool = AddTagsTool_1 = __decorate([
|
|
82
|
+
(0, common_1.Injectable)(),
|
|
83
|
+
__metadata("design:paramtypes", [anki_connect_client_1.AnkiConnectClient])
|
|
84
|
+
], AddTagsTool);
|
|
85
|
+
//# sourceMappingURL=add-tags.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-tags.tool.js","sourceRoot":"","sources":["../../../../../src/mcp/primitives/essential/tools/add-tags.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,8CAAuC;AAEvC,6BAAwB;AACxB,8EAAsE;AACtE,0DAA6D;AAC7D,wEAA8D;AAGvD,IAAM,WAAW,mBAAjB,MAAM,WAAW;IAGO;IAFZ,MAAM,GAAG,IAAI,eAAM,CAAC,aAAW,CAAC,IAAI,CAAC,CAAC;IAEvD,YAA6B,UAA6B;QAA7B,eAAU,GAAV,UAAU,CAAmB;IAAG,CAAC;IA6BxD,AAAN,KAAK,CAAC,OAAO,CAAC,M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AAE,OAAC;iBACL,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;iBACjB,GAAG,CAAC,CAAC,CAAC;iBACN,GAAG,CAAC,IAAI,CAAC;iBACT,QAAQ,CAAC,6BAA6B,CAAC;YAC1C,IAAI,EAAE,OAAC;iBACJ,MAAM,EAAE;iBACR,QAAQ,CAAC,iDAAiD,CAAC;SAC/D,CAAC;QACF,YAAY,EAAE,OAAC,CAAC,MAAM,CAAC;YACrB,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE;YACpB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;YACnB,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE;YACzB,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;SAC/B,CAAC;QACF,WAAW,EAAE;YACX,KAAK,EAAE,UAAU;YACjB,YAAY,EAAE,KAAK;YACnB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;SACrB;KACF,CAAC;;;;0CA8BD;sBA7DU,WAAW;IADvB,IAAA,mBAAU,GAAE;qCAI8B,uCAAiB;GAH/C,WAAW,CA8DvB"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { Context } from "@rekog/mcp-nest";
|
|
2
|
+
import { AnkiConnectClient } from "../../../clients/anki-connect.client";
|
|
3
|
+
export declare class ChangeDeckTool {
|
|
4
|
+
private readonly ankiClient;
|
|
5
|
+
private readonly logger;
|
|
6
|
+
constructor(ankiClient: AnkiConnectClient);
|
|
7
|
+
execute(params: {
|
|
8
|
+
cards: number[];
|
|
9
|
+
deck: string;
|
|
10
|
+
}, context: Context): Promise<{
|
|
11
|
+
[x: string]: unknown;
|
|
12
|
+
content: ({
|
|
13
|
+
type: "text";
|
|
14
|
+
text: string;
|
|
15
|
+
annotations?: {
|
|
16
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
17
|
+
priority?: number | undefined;
|
|
18
|
+
lastModified?: string | undefined;
|
|
19
|
+
} | undefined;
|
|
20
|
+
_meta?: {
|
|
21
|
+
[x: string]: unknown;
|
|
22
|
+
} | undefined;
|
|
23
|
+
} | {
|
|
24
|
+
type: "image";
|
|
25
|
+
data: string;
|
|
26
|
+
mimeType: string;
|
|
27
|
+
annotations?: {
|
|
28
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
29
|
+
priority?: number | undefined;
|
|
30
|
+
lastModified?: string | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
_meta?: {
|
|
33
|
+
[x: string]: unknown;
|
|
34
|
+
} | undefined;
|
|
35
|
+
} | {
|
|
36
|
+
type: "audio";
|
|
37
|
+
data: string;
|
|
38
|
+
mimeType: string;
|
|
39
|
+
annotations?: {
|
|
40
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
41
|
+
priority?: number | undefined;
|
|
42
|
+
lastModified?: string | undefined;
|
|
43
|
+
} | undefined;
|
|
44
|
+
_meta?: {
|
|
45
|
+
[x: string]: unknown;
|
|
46
|
+
} | undefined;
|
|
47
|
+
} | {
|
|
48
|
+
uri: string;
|
|
49
|
+
name: string;
|
|
50
|
+
type: "resource_link";
|
|
51
|
+
description?: string | undefined;
|
|
52
|
+
mimeType?: string | undefined;
|
|
53
|
+
size?: number | undefined;
|
|
54
|
+
annotations?: {
|
|
55
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
56
|
+
priority?: number | undefined;
|
|
57
|
+
lastModified?: string | undefined;
|
|
58
|
+
} | undefined;
|
|
59
|
+
_meta?: {
|
|
60
|
+
[x: string]: unknown;
|
|
61
|
+
} | undefined;
|
|
62
|
+
icons?: {
|
|
63
|
+
src: string;
|
|
64
|
+
mimeType?: string | undefined;
|
|
65
|
+
sizes?: string[] | undefined;
|
|
66
|
+
theme?: "light" | "dark" | undefined;
|
|
67
|
+
}[] | undefined;
|
|
68
|
+
title?: string | undefined;
|
|
69
|
+
} | {
|
|
70
|
+
type: "resource";
|
|
71
|
+
resource: {
|
|
72
|
+
uri: string;
|
|
73
|
+
text: string;
|
|
74
|
+
mimeType?: string | undefined;
|
|
75
|
+
_meta?: {
|
|
76
|
+
[x: string]: unknown;
|
|
77
|
+
} | undefined;
|
|
78
|
+
} | {
|
|
79
|
+
uri: string;
|
|
80
|
+
blob: string;
|
|
81
|
+
mimeType?: string | undefined;
|
|
82
|
+
_meta?: {
|
|
83
|
+
[x: string]: unknown;
|
|
84
|
+
} | undefined;
|
|
85
|
+
};
|
|
86
|
+
annotations?: {
|
|
87
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
88
|
+
priority?: number | undefined;
|
|
89
|
+
lastModified?: string | undefined;
|
|
90
|
+
} | undefined;
|
|
91
|
+
_meta?: {
|
|
92
|
+
[x: string]: unknown;
|
|
93
|
+
} | undefined;
|
|
94
|
+
})[];
|
|
95
|
+
_meta?: {
|
|
96
|
+
[x: string]: unknown;
|
|
97
|
+
progressToken?: string | number | undefined;
|
|
98
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
99
|
+
taskId: string;
|
|
100
|
+
} | undefined;
|
|
101
|
+
} | undefined;
|
|
102
|
+
structuredContent?: {
|
|
103
|
+
[x: string]: unknown;
|
|
104
|
+
} | undefined;
|
|
105
|
+
isError?: boolean | undefined;
|
|
106
|
+
} | import("./deckActions/actions/changeDeck.action").ChangeDeckResult>;
|
|
107
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var ChangeDeckTool_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.ChangeDeckTool = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const mcp_nest_1 = require("@rekog/mcp-nest");
|
|
16
|
+
const zod_1 = require("zod");
|
|
17
|
+
const anki_connect_client_1 = require("../../../clients/anki-connect.client");
|
|
18
|
+
const anki_utils_1 = require("../../../utils/anki.utils");
|
|
19
|
+
const changeDeck_action_1 = require("./deckActions/actions/changeDeck.action");
|
|
20
|
+
let ChangeDeckTool = ChangeDeckTool_1 = class ChangeDeckTool {
|
|
21
|
+
ankiClient;
|
|
22
|
+
logger = new common_1.Logger(ChangeDeckTool_1.name);
|
|
23
|
+
constructor(ankiClient) {
|
|
24
|
+
this.ankiClient = ankiClient;
|
|
25
|
+
}
|
|
26
|
+
async execute(params, context) {
|
|
27
|
+
try {
|
|
28
|
+
this.logger.log(`Executing changeDeck: ${params.cards?.length ?? 0} card(s) -> ${params.deck}`);
|
|
29
|
+
if (!params.cards || params.cards.length === 0) {
|
|
30
|
+
throw new Error("cards array is required for changeDeck action");
|
|
31
|
+
}
|
|
32
|
+
if (!params.deck) {
|
|
33
|
+
throw new Error("deck name is required for changeDeck action");
|
|
34
|
+
}
|
|
35
|
+
await context.reportProgress({ progress: 25, total: 100 });
|
|
36
|
+
const result = await (0, changeDeck_action_1.changeDeck)({ cards: params.cards, deck: params.deck }, this.ankiClient);
|
|
37
|
+
await context.reportProgress({ progress: 100, total: 100 });
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
this.logger.error("Failed to execute changeDeck", error);
|
|
42
|
+
return (0, anki_utils_1.createErrorResponse)(error, {
|
|
43
|
+
action: "changeDeck",
|
|
44
|
+
hint: "Make sure Anki is running and the card IDs / deck name are valid",
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
exports.ChangeDeckTool = ChangeDeckTool;
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, mcp_nest_1.Tool)({
|
|
52
|
+
name: "changeDeck",
|
|
53
|
+
description: "Move cards to a different deck. Target deck will be created if it doesn't exist.",
|
|
54
|
+
parameters: zod_1.z.object({
|
|
55
|
+
cards: zod_1.z.array(zod_1.z.number()).describe("Array of card IDs to move"),
|
|
56
|
+
deck: zod_1.z.string().describe("Target deck name"),
|
|
57
|
+
}),
|
|
58
|
+
outputSchema: zod_1.z.object({
|
|
59
|
+
success: zod_1.z.boolean(),
|
|
60
|
+
message: zod_1.z.string(),
|
|
61
|
+
cardsAffected: zod_1.z.number(),
|
|
62
|
+
targetDeck: zod_1.z.string(),
|
|
63
|
+
}),
|
|
64
|
+
annotations: {
|
|
65
|
+
title: "Move Cards to Deck",
|
|
66
|
+
readOnlyHint: false,
|
|
67
|
+
destructiveHint: false,
|
|
68
|
+
idempotentHint: true,
|
|
69
|
+
},
|
|
70
|
+
}),
|
|
71
|
+
__metadata("design:type", Function),
|
|
72
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
73
|
+
__metadata("design:returntype", Promise)
|
|
74
|
+
], ChangeDeckTool.prototype, "execute", null);
|
|
75
|
+
exports.ChangeDeckTool = ChangeDeckTool = ChangeDeckTool_1 = __decorate([
|
|
76
|
+
(0, common_1.Injectable)(),
|
|
77
|
+
__metadata("design:paramtypes", [anki_connect_client_1.AnkiConnectClient])
|
|
78
|
+
], ChangeDeckTool);
|
|
79
|
+
//# sourceMappingURL=change-deck.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-deck.tool.js","sourceRoot":"","sources":["../../../../../src/mcp/primitives/essential/tools/change-deck.tool.ts"],"names":[],"mappings":";;;;;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AK,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC;YACzD,OAAO,IAAA,gCAAmB,EAAC,KAAK,EAAE;gBAChC,MAAM,EAAE,YAAY;gBACpB,IAAI,EAAE,kEAAkE;aACzE,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF,CAAA;AAxDY,wCAAc;AA0BnB;IArBL,IAAA,eAAI,EAAC;QACJ,IAAI,EAAE,YAAY;QAClB,WAAW,EACT,kFAAkF;QACpF,UAAU,EAAE,OAAC,CAAC,MAAM,CAAC;YACnB,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,2BAA2B,CAAC;YAChE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC;SAC9C,CAAC;QACF,YAAY,EAAE,OAAC,CAAC,MAAM,CAAC;YACrB,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE;YACpB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;YACnB,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE;YACzB,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;SACvB,CAAC;QACF,WAAW,EAAE;YACX,KAAK,EAAE,oBAAoB;YAC3B,YAAY,EAAE,KAAK;YACnB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;SACrB;KACF,CAAC;;;;6CA8BD;yBAvDU,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAI8B,uCAAiB;GAH/C,cAAc,CAwD1B"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { Context } from "@rekog/mcp-nest";
|
|
2
|
+
import { AnkiConnectClient } from "../../../clients/anki-connect.client";
|
|
3
|
+
export declare class ClearUnusedTagsTool {
|
|
4
|
+
private readonly ankiClient;
|
|
5
|
+
private readonly logger;
|
|
6
|
+
constructor(ankiClient: AnkiConnectClient);
|
|
7
|
+
execute(_params: Record<string, never>, context: Context): Promise<{
|
|
8
|
+
[x: string]: unknown;
|
|
9
|
+
content: ({
|
|
10
|
+
type: "text";
|
|
11
|
+
text: string;
|
|
12
|
+
annotations?: {
|
|
13
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
14
|
+
priority?: number | undefined;
|
|
15
|
+
lastModified?: string | undefined;
|
|
16
|
+
} | undefined;
|
|
17
|
+
_meta?: {
|
|
18
|
+
[x: string]: unknown;
|
|
19
|
+
} | undefined;
|
|
20
|
+
} | {
|
|
21
|
+
type: "image";
|
|
22
|
+
data: string;
|
|
23
|
+
mimeType: string;
|
|
24
|
+
annotations?: {
|
|
25
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
26
|
+
priority?: number | undefined;
|
|
27
|
+
lastModified?: string | undefined;
|
|
28
|
+
} | undefined;
|
|
29
|
+
_meta?: {
|
|
30
|
+
[x: string]: unknown;
|
|
31
|
+
} | undefined;
|
|
32
|
+
} | {
|
|
33
|
+
type: "audio";
|
|
34
|
+
data: string;
|
|
35
|
+
mimeType: string;
|
|
36
|
+
annotations?: {
|
|
37
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
38
|
+
priority?: number | undefined;
|
|
39
|
+
lastModified?: string | undefined;
|
|
40
|
+
} | undefined;
|
|
41
|
+
_meta?: {
|
|
42
|
+
[x: string]: unknown;
|
|
43
|
+
} | undefined;
|
|
44
|
+
} | {
|
|
45
|
+
uri: string;
|
|
46
|
+
name: string;
|
|
47
|
+
type: "resource_link";
|
|
48
|
+
description?: string | undefined;
|
|
49
|
+
mimeType?: string | undefined;
|
|
50
|
+
size?: number | undefined;
|
|
51
|
+
annotations?: {
|
|
52
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
53
|
+
priority?: number | undefined;
|
|
54
|
+
lastModified?: string | undefined;
|
|
55
|
+
} | undefined;
|
|
56
|
+
_meta?: {
|
|
57
|
+
[x: string]: unknown;
|
|
58
|
+
} | undefined;
|
|
59
|
+
icons?: {
|
|
60
|
+
src: string;
|
|
61
|
+
mimeType?: string | undefined;
|
|
62
|
+
sizes?: string[] | undefined;
|
|
63
|
+
theme?: "light" | "dark" | undefined;
|
|
64
|
+
}[] | undefined;
|
|
65
|
+
title?: string | undefined;
|
|
66
|
+
} | {
|
|
67
|
+
type: "resource";
|
|
68
|
+
resource: {
|
|
69
|
+
uri: string;
|
|
70
|
+
text: string;
|
|
71
|
+
mimeType?: string | undefined;
|
|
72
|
+
_meta?: {
|
|
73
|
+
[x: string]: unknown;
|
|
74
|
+
} | undefined;
|
|
75
|
+
} | {
|
|
76
|
+
uri: string;
|
|
77
|
+
blob: string;
|
|
78
|
+
mimeType?: string | undefined;
|
|
79
|
+
_meta?: {
|
|
80
|
+
[x: string]: unknown;
|
|
81
|
+
} | undefined;
|
|
82
|
+
};
|
|
83
|
+
annotations?: {
|
|
84
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
85
|
+
priority?: number | undefined;
|
|
86
|
+
lastModified?: string | undefined;
|
|
87
|
+
} | undefined;
|
|
88
|
+
_meta?: {
|
|
89
|
+
[x: string]: unknown;
|
|
90
|
+
} | undefined;
|
|
91
|
+
})[];
|
|
92
|
+
_meta?: {
|
|
93
|
+
[x: string]: unknown;
|
|
94
|
+
progressToken?: string | number | undefined;
|
|
95
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
96
|
+
taskId: string;
|
|
97
|
+
} | undefined;
|
|
98
|
+
} | undefined;
|
|
99
|
+
structuredContent?: {
|
|
100
|
+
[x: string]: unknown;
|
|
101
|
+
} | undefined;
|
|
102
|
+
isError?: boolean | undefined;
|
|
103
|
+
} | import("./tagActions/actions/clearUnusedTags.action").ClearUnusedTagsResult>;
|
|
104
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var ClearUnusedTagsTool_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.ClearUnusedTagsTool = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const mcp_nest_1 = require("@rekog/mcp-nest");
|
|
16
|
+
const zod_1 = require("zod");
|
|
17
|
+
const anki_connect_client_1 = require("../../../clients/anki-connect.client");
|
|
18
|
+
const anki_utils_1 = require("../../../utils/anki.utils");
|
|
19
|
+
const clearUnusedTags_action_1 = require("./tagActions/actions/clearUnusedTags.action");
|
|
20
|
+
let ClearUnusedTagsTool = ClearUnusedTagsTool_1 = class ClearUnusedTagsTool {
|
|
21
|
+
ankiClient;
|
|
22
|
+
logger = new common_1.Logger(ClearUnusedTagsTool_1.name);
|
|
23
|
+
constructor(ankiClient) {
|
|
24
|
+
this.ankiClient = ankiClient;
|
|
25
|
+
}
|
|
26
|
+
async execute(_params, context) {
|
|
27
|
+
try {
|
|
28
|
+
this.logger.log("Executing clearUnusedTags");
|
|
29
|
+
await context.reportProgress({ progress: 50, total: 100 });
|
|
30
|
+
const result = await (0, clearUnusedTags_action_1.clearUnusedTags)({}, this.ankiClient);
|
|
31
|
+
await context.reportProgress({ progress: 100, total: 100 });
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
this.logger.error("Failed to execute clearUnusedTags", error);
|
|
36
|
+
return (0, anki_utils_1.createErrorResponse)(error, {
|
|
37
|
+
action: "clearUnusedTags",
|
|
38
|
+
hint: "Make sure Anki is running",
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
exports.ClearUnusedTagsTool = ClearUnusedTagsTool;
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, mcp_nest_1.Tool)({
|
|
46
|
+
name: "clearUnusedTags",
|
|
47
|
+
description: "Remove orphaned tags that are not used by any notes in the collection. CRITICAL: This is destructive and permanent - only run when the user explicitly asks to clean up tags.",
|
|
48
|
+
parameters: zod_1.z.object({}),
|
|
49
|
+
outputSchema: zod_1.z.object({
|
|
50
|
+
success: zod_1.z.boolean(),
|
|
51
|
+
message: zod_1.z.string(),
|
|
52
|
+
}),
|
|
53
|
+
annotations: {
|
|
54
|
+
title: "Clear Unused Tags",
|
|
55
|
+
readOnlyHint: false,
|
|
56
|
+
destructiveHint: true,
|
|
57
|
+
idempotentHint: true,
|
|
58
|
+
},
|
|
59
|
+
}),
|
|
60
|
+
__metadata("design:type", Function),
|
|
61
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
62
|
+
__metadata("design:returntype", Promise)
|
|
63
|
+
], ClearUnusedTagsTool.prototype, "execute", null);
|
|
64
|
+
exports.ClearUnusedTagsTool = ClearUnusedTagsTool = ClearUnusedTagsTool_1 = __decorate([
|
|
65
|
+
(0, common_1.Injectable)(),
|
|
66
|
+
__metadata("design:paramtypes", [anki_connect_client_1.AnkiConnectClient])
|
|
67
|
+
], ClearUnusedTagsTool);
|
|
68
|
+
//# sourceMappingURL=clear-unused-tags.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clear-unused-tags.tool.js","sourceRoot":"","sources":["../../../../../src/mcp/primitives/essential/tools/clear-unused-tags.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,8CAAuC;AAEvC,6BAAwB;AACxB,8EA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AAE;SACpB,CAAC;QACF,WAAW,EAAE;YACX,KAAK,EAAE,mBAAmB;YAC1B,YAAY,EAAE,KAAK;YACnB,eAAe,EAAE,IAAI;YACrB,cAAc,EAAE,IAAI;SACrB;KACF,CAAC;;;;kDAiBD;8BArCU,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;qCAI8B,uCAAiB;GAH/C,mBAAmB,CAsC/B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Context } from "@rekog/mcp-nest";
|
|
2
|
-
import { AnkiConnectClient } from "
|
|
2
|
+
import { AnkiConnectClient } from "../../../../clients/anki-connect.client";
|
|
3
3
|
import type { CollectionStatsResult, CollectionStatsParams } from "./collection-stats.types";
|
|
4
4
|
export declare class CollectionStatsTool {
|
|
5
5
|
private readonly ankiClient;
|
|
@@ -48,6 +48,7 @@ export declare class CollectionStatsTool {
|
|
|
48
48
|
type: "resource_link";
|
|
49
49
|
description?: string | undefined;
|
|
50
50
|
mimeType?: string | undefined;
|
|
51
|
+
size?: number | undefined;
|
|
51
52
|
annotations?: {
|
|
52
53
|
audience?: ("user" | "assistant")[] | undefined;
|
|
53
54
|
priority?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-stats.tool.js","sourceRoot":"","sources":["../../../../../../src/mcp/primitives/essential/tools/collection-stats/collection-stats.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,8CAAuC;AAEvC,6BAAwB;AACxB,iFAAsE;AACtE,6DAA6D;AAC7D,+DAA8D;AAYvD,IAAM,mBAAmB,2BAAzB,MAAM,mBAAmB;IAGD;IAFZ,MAAM,GAAG,IAAI,eAAM,CAAC,qBAAmB,CAAC,IAAI,CAAC,CAAC;IAE/D,YAA6B,UAA6B;QAA7B,eAAU,GAAV,UAAU,CAAmB;IAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"collection-stats.tool.js","sourceRoot":"","sources":["../../../../../../src/mcp/primitives/essential/tools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BAAU,GAAE;qCAI8B,uCAAiB;GAH/C,mBAAmB,CAqS/B"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { Context } from "@rekog/mcp-nest";
|
|
2
|
+
import { AnkiConnectClient } from "../../../clients/anki-connect.client";
|
|
3
|
+
export declare class CreateDeckTool {
|
|
4
|
+
private readonly ankiClient;
|
|
5
|
+
private readonly logger;
|
|
6
|
+
constructor(ankiClient: AnkiConnectClient);
|
|
7
|
+
execute(params: {
|
|
8
|
+
deckName: string;
|
|
9
|
+
}, context: Context): Promise<{
|
|
10
|
+
[x: string]: unknown;
|
|
11
|
+
content: ({
|
|
12
|
+
type: "text";
|
|
13
|
+
text: string;
|
|
14
|
+
annotations?: {
|
|
15
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
16
|
+
priority?: number | undefined;
|
|
17
|
+
lastModified?: string | undefined;
|
|
18
|
+
} | undefined;
|
|
19
|
+
_meta?: {
|
|
20
|
+
[x: string]: unknown;
|
|
21
|
+
} | undefined;
|
|
22
|
+
} | {
|
|
23
|
+
type: "image";
|
|
24
|
+
data: string;
|
|
25
|
+
mimeType: string;
|
|
26
|
+
annotations?: {
|
|
27
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
28
|
+
priority?: number | undefined;
|
|
29
|
+
lastModified?: string | undefined;
|
|
30
|
+
} | undefined;
|
|
31
|
+
_meta?: {
|
|
32
|
+
[x: string]: unknown;
|
|
33
|
+
} | undefined;
|
|
34
|
+
} | {
|
|
35
|
+
type: "audio";
|
|
36
|
+
data: string;
|
|
37
|
+
mimeType: string;
|
|
38
|
+
annotations?: {
|
|
39
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
40
|
+
priority?: number | undefined;
|
|
41
|
+
lastModified?: string | undefined;
|
|
42
|
+
} | undefined;
|
|
43
|
+
_meta?: {
|
|
44
|
+
[x: string]: unknown;
|
|
45
|
+
} | undefined;
|
|
46
|
+
} | {
|
|
47
|
+
uri: string;
|
|
48
|
+
name: string;
|
|
49
|
+
type: "resource_link";
|
|
50
|
+
description?: string | undefined;
|
|
51
|
+
mimeType?: string | undefined;
|
|
52
|
+
size?: number | undefined;
|
|
53
|
+
annotations?: {
|
|
54
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
55
|
+
priority?: number | undefined;
|
|
56
|
+
lastModified?: string | undefined;
|
|
57
|
+
} | undefined;
|
|
58
|
+
_meta?: {
|
|
59
|
+
[x: string]: unknown;
|
|
60
|
+
} | undefined;
|
|
61
|
+
icons?: {
|
|
62
|
+
src: string;
|
|
63
|
+
mimeType?: string | undefined;
|
|
64
|
+
sizes?: string[] | undefined;
|
|
65
|
+
theme?: "light" | "dark" | undefined;
|
|
66
|
+
}[] | undefined;
|
|
67
|
+
title?: string | undefined;
|
|
68
|
+
} | {
|
|
69
|
+
type: "resource";
|
|
70
|
+
resource: {
|
|
71
|
+
uri: string;
|
|
72
|
+
text: string;
|
|
73
|
+
mimeType?: string | undefined;
|
|
74
|
+
_meta?: {
|
|
75
|
+
[x: string]: unknown;
|
|
76
|
+
} | undefined;
|
|
77
|
+
} | {
|
|
78
|
+
uri: string;
|
|
79
|
+
blob: string;
|
|
80
|
+
mimeType?: string | undefined;
|
|
81
|
+
_meta?: {
|
|
82
|
+
[x: string]: unknown;
|
|
83
|
+
} | undefined;
|
|
84
|
+
};
|
|
85
|
+
annotations?: {
|
|
86
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
87
|
+
priority?: number | undefined;
|
|
88
|
+
lastModified?: string | undefined;
|
|
89
|
+
} | undefined;
|
|
90
|
+
_meta?: {
|
|
91
|
+
[x: string]: unknown;
|
|
92
|
+
} | undefined;
|
|
93
|
+
})[];
|
|
94
|
+
_meta?: {
|
|
95
|
+
[x: string]: unknown;
|
|
96
|
+
progressToken?: string | number | undefined;
|
|
97
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
98
|
+
taskId: string;
|
|
99
|
+
} | undefined;
|
|
100
|
+
} | undefined;
|
|
101
|
+
structuredContent?: {
|
|
102
|
+
[x: string]: unknown;
|
|
103
|
+
} | undefined;
|
|
104
|
+
isError?: boolean | undefined;
|
|
105
|
+
} | import("./deckActions/actions/createDeck.action").CreateDeckResult>;
|
|
106
|
+
}
|