anki-mcp-http 0.19.2 → 0.20.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/README.md +7 -1
- package/dist/mcp/clients/anki-connect.client.js +5 -0
- package/dist/mcp/clients/anki-connect.client.js.map +1 -1
- package/dist/mcp/primitives/essential/index.d.ts +13 -1
- package/dist/mcp/primitives/essential/index.js +25 -1
- package/dist/mcp/primitives/essential/index.js.map +1 -1
- package/dist/mcp/primitives/essential/tools/add-model-field.tool.d.ts +113 -0
- package/dist/mcp/primitives/essential/tools/add-model-field.tool.js +150 -0
- package/dist/mcp/primitives/essential/tools/add-model-field.tool.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/model-templates.tool.d.ts +116 -0
- package/dist/mcp/primitives/essential/tools/model-templates.tool.js +95 -0
- package/dist/mcp/primitives/essential/tools/model-templates.tool.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/remove-model-field.tool.d.ts +112 -0
- package/dist/mcp/primitives/essential/tools/remove-model-field.tool.js +107 -0
- package/dist/mcp/primitives/essential/tools/remove-model-field.tool.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/rename-model-field.tool.d.ts +114 -0
- package/dist/mcp/primitives/essential/tools/rename-model-field.tool.js +156 -0
- package/dist/mcp/primitives/essential/tools/rename-model-field.tool.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/reposition-model-field.tool.d.ts +113 -0
- package/dist/mcp/primitives/essential/tools/reposition-model-field.tool.js +137 -0
- package/dist/mcp/primitives/essential/tools/reposition-model-field.tool.js.map +1 -0
- package/dist/mcp/primitives/essential/tools/update-model-templates.tool.d.ts +115 -0
- package/dist/mcp/primitives/essential/tools/update-model-templates.tool.js +140 -0
- package/dist/mcp/primitives/essential/tools/update-model-templates.tool.js.map +1 -0
- package/package.json +11 -11
|
@@ -0,0 +1,95 @@
|
|
|
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 ModelTemplatesTool_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.ModelTemplatesTool = 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
|
+
let ModelTemplatesTool = ModelTemplatesTool_1 = class ModelTemplatesTool {
|
|
20
|
+
ankiClient;
|
|
21
|
+
logger = new common_1.Logger(ModelTemplatesTool_1.name);
|
|
22
|
+
constructor(ankiClient) {
|
|
23
|
+
this.ankiClient = ankiClient;
|
|
24
|
+
}
|
|
25
|
+
async modelTemplates({ modelName }) {
|
|
26
|
+
try {
|
|
27
|
+
this.logger.log(`Retrieving templates for model: ${modelName}`);
|
|
28
|
+
const templates = await this.ankiClient.invoke("modelTemplates", {
|
|
29
|
+
modelName: modelName,
|
|
30
|
+
});
|
|
31
|
+
if (!templates || Object.keys(templates).length === 0) {
|
|
32
|
+
this.logger.warn(`No templates found for model: ${modelName}`);
|
|
33
|
+
return (0, anki_utils_1.createErrorResponse)(new Error(`Model "${modelName}" not found or has no card templates`), {
|
|
34
|
+
modelName: modelName,
|
|
35
|
+
hint: "Use modelNames tool to see available models",
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
const cardCount = Object.keys(templates).length;
|
|
39
|
+
this.logger.log(`Retrieved ${cardCount} templates for model ${modelName}`);
|
|
40
|
+
return {
|
|
41
|
+
success: true,
|
|
42
|
+
modelName: modelName,
|
|
43
|
+
templates: templates,
|
|
44
|
+
message: `Retrieved ${cardCount} card template(s) for model "${modelName}"`,
|
|
45
|
+
hint: "Use updateModelTemplates to modify the Front/Back HTML of these card templates",
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
this.logger.error(`Failed to retrieve templates for model ${modelName}`, error);
|
|
50
|
+
return (0, anki_utils_1.createErrorResponse)(error, {
|
|
51
|
+
modelName: modelName,
|
|
52
|
+
hint: "Make sure the model name is correct and Anki is running",
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
exports.ModelTemplatesTool = ModelTemplatesTool;
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, mcp_nest_1.Tool)({
|
|
60
|
+
name: "modelTemplates",
|
|
61
|
+
description: "Get the card templates (Front and Back HTML) for a specific note type (model). " +
|
|
62
|
+
"Returns each card template's Front and Back HTML content. " +
|
|
63
|
+
"Use this before updateModelTemplates to see current templates and plan changes.",
|
|
64
|
+
parameters: zod_1.z.object({
|
|
65
|
+
modelName: zod_1.z
|
|
66
|
+
.string()
|
|
67
|
+
.min(1)
|
|
68
|
+
.describe("The name of the model/note type to get templates for"),
|
|
69
|
+
}),
|
|
70
|
+
outputSchema: zod_1.z.object({
|
|
71
|
+
success: zod_1.z.boolean(),
|
|
72
|
+
modelName: zod_1.z.string(),
|
|
73
|
+
templates: zod_1.z.record(zod_1.z.string(), zod_1.z.object({
|
|
74
|
+
Front: zod_1.z.string(),
|
|
75
|
+
Back: zod_1.z.string(),
|
|
76
|
+
})),
|
|
77
|
+
message: zod_1.z.string(),
|
|
78
|
+
hint: zod_1.z.string(),
|
|
79
|
+
}),
|
|
80
|
+
annotations: {
|
|
81
|
+
title: "Get Note Type Templates",
|
|
82
|
+
readOnlyHint: true,
|
|
83
|
+
destructiveHint: false,
|
|
84
|
+
idempotentHint: true,
|
|
85
|
+
},
|
|
86
|
+
}),
|
|
87
|
+
__metadata("design:type", Function),
|
|
88
|
+
__metadata("design:paramtypes", [Object]),
|
|
89
|
+
__metadata("design:returntype", Promise)
|
|
90
|
+
], ModelTemplatesTool.prototype, "modelTemplates", null);
|
|
91
|
+
exports.ModelTemplatesTool = ModelTemplatesTool = ModelTemplatesTool_1 = __decorate([
|
|
92
|
+
(0, common_1.Injectable)(),
|
|
93
|
+
__metadata("design:paramtypes", [anki_connect_client_1.AnkiConnectClient])
|
|
94
|
+
], ModelTemplatesTool);
|
|
95
|
+
//# sourceMappingURL=model-templates.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-templates.tool.js","sourceRoot":"","sources":["../../../../../src/mcp/primitives/essential/tools/model-templates.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,8CAAuC;AACvC,6BAAwB;AACxB,8EAAsE;AACtE,0DAA6D;AAMtD,IAAM,kBAAkB,0BAAxB,MAAM,kBAAkB;IAGA;IAFZ,MAAM,GAAG,IAAI,eAAM,CAAC,oBAAkB,CAAC,IAAI,CAAC,CAAC;IAE9D,YAA6B,UAA6B;QAA7B,eAAU,GAAV,UAAU,CAAmB;IAAG,CAAC;IAkCxD,AAAN,KAAK,CAAC,cAAc,CAAC,EAAE,SAAS,EAAyB;QACvD,IAAI,CAAC;YACH,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,mCAAmC,SAAS,EAAE,CAAC,CAAC;YAEhE,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAE3C,gBAAgB,EAAE;gBACnB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AC,CAAC;iBACN,QAAQ,CAAC,sDAAsD,CAAC;SACpE,CAAC;QACF,YAAY,EAAE,OAAC,CAAC,MAAM,CAAC;YACrB,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE;YACpB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;YACrB,SAAS,EAAE,OAAC,CAAC,MAAM,CACjB,OAAC,CAAC,MAAM,EAAE,EACV,OAAC,CAAC,MAAM,CAAC;gBACP,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;gBACjB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;aACjB,CAAC,CACH;YACD,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;YACnB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;SACjB,CAAC;QACF,WAAW,EAAE;YACX,KAAK,EAAE,yBAAyB;YAChC,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;SACrB;KACF,CAAC;;;;wDA4CD;6BAhFU,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;qCAI8B,uCAAiB;GAH/C,kBAAkB,CAiF9B"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { AnkiConnectClient } from "../../../clients/anki-connect.client";
|
|
2
|
+
export declare class RemoveModelFieldTool {
|
|
3
|
+
private readonly ankiClient;
|
|
4
|
+
private readonly logger;
|
|
5
|
+
constructor(ankiClient: AnkiConnectClient);
|
|
6
|
+
removeModelField({ modelName, fieldName, confirmDeletion, }: {
|
|
7
|
+
modelName: string;
|
|
8
|
+
fieldName: string;
|
|
9
|
+
confirmDeletion: boolean;
|
|
10
|
+
}): 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
|
+
} | {
|
|
107
|
+
success: boolean;
|
|
108
|
+
modelName: string;
|
|
109
|
+
fieldName: string;
|
|
110
|
+
message: string;
|
|
111
|
+
}>;
|
|
112
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
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 RemoveModelFieldTool_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.RemoveModelFieldTool = 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
|
+
let RemoveModelFieldTool = RemoveModelFieldTool_1 = class RemoveModelFieldTool {
|
|
20
|
+
ankiClient;
|
|
21
|
+
logger = new common_1.Logger(RemoveModelFieldTool_1.name);
|
|
22
|
+
constructor(ankiClient) {
|
|
23
|
+
this.ankiClient = ankiClient;
|
|
24
|
+
}
|
|
25
|
+
async removeModelField({ modelName, fieldName, confirmDeletion, }) {
|
|
26
|
+
try {
|
|
27
|
+
if (!confirmDeletion) {
|
|
28
|
+
return (0, anki_utils_1.createErrorResponse)(new Error("Deletion not confirmed"), {
|
|
29
|
+
modelName,
|
|
30
|
+
fieldName,
|
|
31
|
+
hint: "Set confirmDeletion: true to confirm you want to permanently delete this field and all its data.",
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
this.logger.log(`Removing field "${fieldName}" from model "${modelName}"`);
|
|
35
|
+
await this.ankiClient.invoke("modelFieldRemove", {
|
|
36
|
+
modelName,
|
|
37
|
+
fieldName,
|
|
38
|
+
});
|
|
39
|
+
this.logger.log(`Successfully removed field "${fieldName}" from model "${modelName}"`);
|
|
40
|
+
return {
|
|
41
|
+
success: true,
|
|
42
|
+
modelName,
|
|
43
|
+
fieldName,
|
|
44
|
+
message: `Successfully removed field "${fieldName}" from model "${modelName}". All data in this field has been deleted.`,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
this.logger.error(`Failed to remove field "${fieldName}" from model "${modelName}"`, error);
|
|
49
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
50
|
+
if (errorMessage.includes("not found") ||
|
|
51
|
+
errorMessage.includes("does not exist")) {
|
|
52
|
+
return (0, anki_utils_1.createErrorResponse)(error, {
|
|
53
|
+
modelName,
|
|
54
|
+
fieldName,
|
|
55
|
+
hint: "Model or field not found. Use modelNames and modelFieldNames tools to verify names.",
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return (0, anki_utils_1.createErrorResponse)(error, {
|
|
59
|
+
modelName,
|
|
60
|
+
fieldName,
|
|
61
|
+
hint: "Make sure Anki is running and the model and field names are correct.",
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
exports.RemoveModelFieldTool = RemoveModelFieldTool;
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, mcp_nest_1.Tool)({
|
|
69
|
+
name: "removeModelField",
|
|
70
|
+
description: "Remove a field from an existing Anki note type (model). " +
|
|
71
|
+
"WARNING: All data stored in this field across every note of this type will be permanently deleted. " +
|
|
72
|
+
"Use modelFieldNames to confirm the field name before removing.",
|
|
73
|
+
parameters: zod_1.z.object({
|
|
74
|
+
modelName: zod_1.z
|
|
75
|
+
.string()
|
|
76
|
+
.min(1)
|
|
77
|
+
.describe('Name of the note type to modify (e.g., "Basic", "Latin Vocabulary")'),
|
|
78
|
+
fieldName: zod_1.z
|
|
79
|
+
.string()
|
|
80
|
+
.min(1)
|
|
81
|
+
.describe('Name of the field to remove (e.g., "Grammar", "IPA")'),
|
|
82
|
+
confirmDeletion: zod_1.z
|
|
83
|
+
.boolean()
|
|
84
|
+
.describe("Must be set to true to confirm you understand all field data will be permanently deleted."),
|
|
85
|
+
}),
|
|
86
|
+
outputSchema: zod_1.z.object({
|
|
87
|
+
success: zod_1.z.boolean(),
|
|
88
|
+
modelName: zod_1.z.string(),
|
|
89
|
+
fieldName: zod_1.z.string(),
|
|
90
|
+
message: zod_1.z.string(),
|
|
91
|
+
}),
|
|
92
|
+
annotations: {
|
|
93
|
+
title: "Remove Field from Note Type",
|
|
94
|
+
readOnlyHint: false,
|
|
95
|
+
destructiveHint: true,
|
|
96
|
+
idempotentHint: false,
|
|
97
|
+
},
|
|
98
|
+
}),
|
|
99
|
+
__metadata("design:type", Function),
|
|
100
|
+
__metadata("design:paramtypes", [Object]),
|
|
101
|
+
__metadata("design:returntype", Promise)
|
|
102
|
+
], RemoveModelFieldTool.prototype, "removeModelField", null);
|
|
103
|
+
exports.RemoveModelFieldTool = RemoveModelFieldTool = RemoveModelFieldTool_1 = __decorate([
|
|
104
|
+
(0, common_1.Injectable)(),
|
|
105
|
+
__metadata("design:paramtypes", [anki_connect_client_1.AnkiConnectClient])
|
|
106
|
+
], RemoveModelFieldTool);
|
|
107
|
+
//# sourceMappingURL=remove-model-field.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-model-field.tool.js","sourceRoot":"","sources":["../../../../../src/mcp/primitives/essential/tools/remove-model-field.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,8CAAuC;AACvC,6BAAwB;AACxB,8EAAsE;AACtE,0DAA6D;AAMtD,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IAGF;IAFZ,MAAM,GAAG,IAAI,eAAM,CAAC,sBAAoB,CAAC,IAAI,CAAC,CAAC;IAEhE,YAA6B,UAA6B;QAA7B,eAAU,GAAV,UAAU,CAAmB;IAAG,CAAC;IAsCxD,AAAN,KAAK,CAAC,gBAAgB,CAAC,EACrB,SAAS,EACT,SAAS,EACT,eAAe,GAKhB;QACC,IAAI,CAAC;YACH,IAAI,CAAC,eAAe,EAAE,CAAC;gBACr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IApCL,IAAA,eAAI,EAAC;QACJ,IAAI,EAAE,kBAAkB;QACxB,WAAW,EACT,0DAA0D;YAC1D,qGAAqG;YACrG,gEAAgE;QAClE,UAAU,EAAE,OAAC,CAAC,MAAM,CAAC;YACnB,SAAS,EAAE,OAAC;iBACT,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CACP,qEAAqE,CACtE;YACH,SAAS,EAAE,OAAC;iBACT,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CAAC,sDAAsD,CAAC;YACnE,eAAe,EAAE,OAAC;iBACf,OAAO,EAAE;iBACT,QAAQ,CACP,2FAA2F,CAC5F;SACJ,CAAC;QACF,YAAY,EAAE,OAAC,CAAC,MAAM,CAAC;YACrB,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE;YACpB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;YACrB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;YACrB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;SACpB,CAAC;QACF,WAAW,EAAE;YACX,KAAK,EAAE,6BAA6B;YACpC,YAAY,EAAE,KAAK;YACnB,eAAe,EAAE,IAAI;YACrB,cAAc,EAAE,KAAK;SACtB;KACF,CAAC;;;;4DAgED;+BAxGU,oBAAoB;IADhC,IAAA,mBAAU,GAAE;qCAI8B,uCAAiB;GAH/C,oBAAoB,CAyGhC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { AnkiConnectClient } from "../../../clients/anki-connect.client";
|
|
2
|
+
export declare class RenameModelFieldTool {
|
|
3
|
+
private readonly ankiClient;
|
|
4
|
+
private readonly logger;
|
|
5
|
+
constructor(ankiClient: AnkiConnectClient);
|
|
6
|
+
renameModelField({ modelName, oldFieldName, newFieldName, }: {
|
|
7
|
+
modelName: string;
|
|
8
|
+
oldFieldName: string;
|
|
9
|
+
newFieldName: string;
|
|
10
|
+
}): 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
|
+
} | {
|
|
107
|
+
success: boolean;
|
|
108
|
+
modelName: string;
|
|
109
|
+
oldFieldName: string;
|
|
110
|
+
newFieldName: string;
|
|
111
|
+
message: string;
|
|
112
|
+
warning: string;
|
|
113
|
+
}>;
|
|
114
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
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 RenameModelFieldTool_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.RenameModelFieldTool = 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
|
+
let RenameModelFieldTool = RenameModelFieldTool_1 = class RenameModelFieldTool {
|
|
20
|
+
ankiClient;
|
|
21
|
+
logger = new common_1.Logger(RenameModelFieldTool_1.name);
|
|
22
|
+
constructor(ankiClient) {
|
|
23
|
+
this.ankiClient = ankiClient;
|
|
24
|
+
}
|
|
25
|
+
async renameModelField({ modelName, oldFieldName, newFieldName, }) {
|
|
26
|
+
try {
|
|
27
|
+
this.logger.log(`Renaming field "${oldFieldName}" → "${newFieldName}" in model "${modelName}"`);
|
|
28
|
+
if (oldFieldName === newFieldName) {
|
|
29
|
+
return (0, anki_utils_1.createErrorResponse)(new Error(`Old and new field names are identical ("${oldFieldName}") — nothing to rename`), {
|
|
30
|
+
modelName,
|
|
31
|
+
oldFieldName,
|
|
32
|
+
newFieldName,
|
|
33
|
+
hint: "Provide a new field name that differs from the current one.",
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const fields = await this.ankiClient.invoke("modelFieldNames", {
|
|
37
|
+
modelName,
|
|
38
|
+
});
|
|
39
|
+
if (!fields || fields.length === 0) {
|
|
40
|
+
return (0, anki_utils_1.createErrorResponse)(new Error(`Model "${modelName}" has no fields or does not exist`), {
|
|
41
|
+
modelName,
|
|
42
|
+
oldFieldName,
|
|
43
|
+
newFieldName,
|
|
44
|
+
hint: "Model not found. Use modelNames tool to see available models.",
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (!fields.includes(oldFieldName)) {
|
|
48
|
+
return (0, anki_utils_1.createErrorResponse)(new Error(`Field "${oldFieldName}" does not exist in model "${modelName}"`), {
|
|
49
|
+
modelName,
|
|
50
|
+
oldFieldName,
|
|
51
|
+
newFieldName,
|
|
52
|
+
hint: "Field names are case-sensitive. Use modelFieldNames to see the current field names.",
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if (fields.includes(newFieldName)) {
|
|
56
|
+
return (0, anki_utils_1.createErrorResponse)(new Error(`A field named "${newFieldName}" already exists in model "${modelName}". ` +
|
|
57
|
+
'AnkiConnect would silently mangle the name with a "+" suffix instead of erroring.'), {
|
|
58
|
+
modelName,
|
|
59
|
+
oldFieldName,
|
|
60
|
+
newFieldName,
|
|
61
|
+
hint: `A field named "${newFieldName}" already exists in this model.`,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
const caseVariant = fields.find((f) => f !== oldFieldName && f.toLowerCase() === newFieldName.toLowerCase());
|
|
65
|
+
if (caseVariant) {
|
|
66
|
+
return (0, anki_utils_1.createErrorResponse)(new Error(`Field "${newFieldName}" collides with existing field "${caseVariant}" ` +
|
|
67
|
+
`in model "${modelName}" (names differ only in case)`), {
|
|
68
|
+
modelName,
|
|
69
|
+
oldFieldName,
|
|
70
|
+
newFieldName,
|
|
71
|
+
hint: `Field names are case-sensitive, but "${newFieldName}" differs from existing field "${caseVariant}" only in case. Pick a distinct name.`,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
await this.ankiClient.invoke("modelFieldRename", {
|
|
75
|
+
modelName,
|
|
76
|
+
oldFieldName,
|
|
77
|
+
newFieldName,
|
|
78
|
+
});
|
|
79
|
+
this.logger.log(`Successfully renamed field "${oldFieldName}" to "${newFieldName}" in model "${modelName}"`);
|
|
80
|
+
return {
|
|
81
|
+
success: true,
|
|
82
|
+
modelName,
|
|
83
|
+
oldFieldName,
|
|
84
|
+
newFieldName,
|
|
85
|
+
message: `Successfully renamed field "${oldFieldName}" to "${newFieldName}" in model "${modelName}"`,
|
|
86
|
+
warning: `Card templates referencing "{{${oldFieldName}}}" must be updated manually ` +
|
|
87
|
+
`to "{{${newFieldName}}}" using the updateModelTemplates tool.`,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
this.logger.error(`Failed to rename field "${oldFieldName}" in model "${modelName}"`, error);
|
|
92
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
93
|
+
if (errorMessage.includes("not found") ||
|
|
94
|
+
errorMessage.includes("does not exist")) {
|
|
95
|
+
return (0, anki_utils_1.createErrorResponse)(error, {
|
|
96
|
+
modelName,
|
|
97
|
+
oldFieldName,
|
|
98
|
+
newFieldName,
|
|
99
|
+
hint: "Model or field not found. Use modelNames and modelFieldNames tools to verify names.",
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
return (0, anki_utils_1.createErrorResponse)(error, {
|
|
103
|
+
modelName,
|
|
104
|
+
oldFieldName,
|
|
105
|
+
newFieldName,
|
|
106
|
+
hint: "Make sure Anki is running and the model and field names are correct.",
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
exports.RenameModelFieldTool = RenameModelFieldTool;
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, mcp_nest_1.Tool)({
|
|
114
|
+
name: "renameModelField",
|
|
115
|
+
description: "Rename a field in an existing Anki note type (model). " +
|
|
116
|
+
"Card templates that reference the old field name (e.g., {{OldName}}) will need to be " +
|
|
117
|
+
"updated separately using updateModelTemplates — they are not updated automatically. " +
|
|
118
|
+
"Use modelFieldNames to confirm the current field name before renaming.",
|
|
119
|
+
parameters: zod_1.z.object({
|
|
120
|
+
modelName: zod_1.z
|
|
121
|
+
.string()
|
|
122
|
+
.min(1)
|
|
123
|
+
.describe('Name of the note type to modify (e.g., "Basic", "Latin Vocabulary")'),
|
|
124
|
+
oldFieldName: zod_1.z
|
|
125
|
+
.string()
|
|
126
|
+
.min(1)
|
|
127
|
+
.describe('Current name of the field to rename (e.g., "Notes")'),
|
|
128
|
+
newFieldName: zod_1.z
|
|
129
|
+
.string()
|
|
130
|
+
.min(1)
|
|
131
|
+
.describe('New name for the field (e.g., "Grammar Notes")'),
|
|
132
|
+
}),
|
|
133
|
+
outputSchema: zod_1.z.object({
|
|
134
|
+
success: zod_1.z.boolean(),
|
|
135
|
+
modelName: zod_1.z.string(),
|
|
136
|
+
oldFieldName: zod_1.z.string(),
|
|
137
|
+
newFieldName: zod_1.z.string(),
|
|
138
|
+
message: zod_1.z.string(),
|
|
139
|
+
warning: zod_1.z.string().optional(),
|
|
140
|
+
}),
|
|
141
|
+
annotations: {
|
|
142
|
+
title: "Rename Field in Note Type",
|
|
143
|
+
readOnlyHint: false,
|
|
144
|
+
destructiveHint: false,
|
|
145
|
+
idempotentHint: false,
|
|
146
|
+
},
|
|
147
|
+
}),
|
|
148
|
+
__metadata("design:type", Function),
|
|
149
|
+
__metadata("design:paramtypes", [Object]),
|
|
150
|
+
__metadata("design:returntype", Promise)
|
|
151
|
+
], RenameModelFieldTool.prototype, "renameModelField", null);
|
|
152
|
+
exports.RenameModelFieldTool = RenameModelFieldTool = RenameModelFieldTool_1 = __decorate([
|
|
153
|
+
(0, common_1.Injectable)(),
|
|
154
|
+
__metadata("design:paramtypes", [anki_connect_client_1.AnkiConnectClient])
|
|
155
|
+
], RenameModelFieldTool);
|
|
156
|
+
//# sourceMappingURL=rename-model-field.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rename-model-field.tool.js","sourceRoot":"","sources":["../../../../../src/mcp/primitives/essential/tools/rename-model-field.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,8CAAuC;AACvC,6BAAwB;AACxB,8EAAsE;AACtE,0DAA6D;AAMtD,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IAGF;IAFZ,MAAM,GAAG,IAAI,eAAM,CAAC,sBAAoB,CAAC,IAAI,CAAC,CAAC;IAEhE,YAA6B,UAA6B;QAA7B,eAAU,GAAV,UAAU,CAAmB;IAAG,CAAC;IAwCxD,AAAN,KAAK,CAAC,gBAAgB,CAAC,EACrB,SAAS,EACT,YAAY,EACZ,YAAY,GAKb;QACC,IAAI,CAAC;YACH,IAAI,CAAC,MAAM,CAAC,GAAG,CACb,mBAAmB,YAAY,QAAQ,YAAY,eAAe,SAAS,GAAG,CAC/E,CAAC;YAEF,IAAI,YAAY,KAAK,YAAY,EAAE,CAAC;gBAClC,OAAO,IAAA,gCAAmB,EACxB,IAAI,KAAK,CACP,2CAA2C,YAAY,wBAAwB,CAChF,EACD;oBACE,SAAS;oBACT,YAAY;oBACZ,YAAY;oBACZ,IAAI,EAAE,6DAA6D;iBACpE,CACF,CAAC;YACJ,CAAC;YAOD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAW,iBAAiB,EAAE;gBACvE,SAAS;aACV,CAAC,CAAC;YAEH,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACnC,OAAO,IAAA,gCAAmB,EACxB,IAAI,KAAK,CAAC,UAAU,SAAS,mCAAmC,CAAC,EACjE;oBACE,SAAS;oBACT,YAAY;oBACZ,YAAY;oBACZ,IAAI,EAAE,+DAA+D;iBACtE,CACF,C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