anki-mcp-http 0.3.0 → 0.5.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.
Files changed (101) hide show
  1. package/README.md +2 -0
  2. package/dist/app.module.js +12 -2
  3. package/dist/app.module.js.map +1 -1
  4. package/dist/cli.d.ts +1 -0
  5. package/dist/cli.js +19 -5
  6. package/dist/cli.js.map +1 -1
  7. package/dist/main-http.js +1 -0
  8. package/dist/main-http.js.map +1 -1
  9. package/dist/mcp/primitives/essential/index.d.ts +1 -0
  10. package/dist/mcp/primitives/essential/index.js +5 -1
  11. package/dist/mcp/primitives/essential/index.js.map +1 -1
  12. package/dist/mcp/primitives/essential/tools/add-note.tool.d.ts +2 -2
  13. package/dist/mcp/primitives/essential/tools/add-note.tool.js.map +1 -1
  14. package/dist/mcp/primitives/essential/tools/create-deck.tool.d.ts +2 -2
  15. package/dist/mcp/primitives/essential/tools/create-deck.tool.js +2 -1
  16. package/dist/mcp/primitives/essential/tools/create-deck.tool.js.map +1 -1
  17. package/dist/mcp/primitives/essential/tools/create-model.tool.d.ts +3 -3
  18. package/dist/mcp/primitives/essential/tools/create-model.tool.js.map +1 -1
  19. package/dist/mcp/primitives/essential/tools/delete-notes.tool.d.ts +2 -2
  20. package/dist/mcp/primitives/essential/tools/delete-notes.tool.js.map +1 -1
  21. package/dist/mcp/primitives/essential/tools/find-notes.tool.d.ts +2 -2
  22. package/dist/mcp/primitives/essential/tools/find-notes.tool.js.map +1 -1
  23. package/dist/mcp/primitives/essential/tools/get-due-cards.tool.d.ts +2 -2
  24. package/dist/mcp/primitives/essential/tools/get-due-cards.tool.js.map +1 -1
  25. package/dist/mcp/primitives/essential/tools/list-decks.tool.d.ts +2 -2
  26. package/dist/mcp/primitives/essential/tools/list-decks.tool.js.map +1 -1
  27. package/dist/mcp/primitives/essential/tools/mediaActions/actions/deleteMediaFile.action.d.ts +10 -0
  28. package/dist/mcp/primitives/essential/tools/mediaActions/actions/deleteMediaFile.action.js +18 -0
  29. package/dist/mcp/primitives/essential/tools/mediaActions/actions/deleteMediaFile.action.js.map +1 -0
  30. package/dist/mcp/primitives/essential/tools/mediaActions/actions/getMediaFilesNames.action.d.ts +12 -0
  31. package/dist/mcp/primitives/essential/tools/mediaActions/actions/getMediaFilesNames.action.js +22 -0
  32. package/dist/mcp/primitives/essential/tools/mediaActions/actions/getMediaFilesNames.action.js.map +1 -0
  33. package/dist/mcp/primitives/essential/tools/mediaActions/actions/retrieveMediaFile.action.d.ts +12 -0
  34. package/dist/mcp/primitives/essential/tools/mediaActions/actions/retrieveMediaFile.action.js +29 -0
  35. package/dist/mcp/primitives/essential/tools/mediaActions/actions/retrieveMediaFile.action.js.map +1 -0
  36. package/dist/mcp/primitives/essential/tools/mediaActions/actions/storeMediaFile.action.d.ts +15 -0
  37. package/dist/mcp/primitives/essential/tools/mediaActions/actions/storeMediaFile.action.js +41 -0
  38. package/dist/mcp/primitives/essential/tools/mediaActions/actions/storeMediaFile.action.js.map +1 -0
  39. package/dist/mcp/primitives/essential/tools/mediaActions/index.d.ts +5 -0
  40. package/dist/mcp/primitives/essential/tools/mediaActions/index.js +6 -0
  41. package/dist/mcp/primitives/essential/tools/mediaActions/index.js.map +1 -0
  42. package/dist/mcp/primitives/essential/tools/mediaActions/mediaActions.tool.d.ts +89 -0
  43. package/dist/mcp/primitives/essential/tools/mediaActions/mediaActions.tool.js +135 -0
  44. package/dist/mcp/primitives/essential/tools/mediaActions/mediaActions.tool.js.map +1 -0
  45. package/dist/mcp/primitives/essential/tools/model-field-names.tool.d.ts +2 -2
  46. package/dist/mcp/primitives/essential/tools/model-field-names.tool.js.map +1 -1
  47. package/dist/mcp/primitives/essential/tools/model-names.tool.d.ts +2 -2
  48. package/dist/mcp/primitives/essential/tools/model-names.tool.js.map +1 -1
  49. package/dist/mcp/primitives/essential/tools/model-styling.tool.d.ts +2 -2
  50. package/dist/mcp/primitives/essential/tools/model-styling.tool.js.map +1 -1
  51. package/dist/mcp/primitives/essential/tools/notes-info.tool.d.ts +2 -2
  52. package/dist/mcp/primitives/essential/tools/notes-info.tool.js.map +1 -1
  53. package/dist/mcp/primitives/essential/tools/present-card.tool.d.ts +2 -2
  54. package/dist/mcp/primitives/essential/tools/present-card.tool.js.map +1 -1
  55. package/dist/mcp/primitives/essential/tools/rate-card.tool.d.ts +2 -2
  56. package/dist/mcp/primitives/essential/tools/rate-card.tool.js.map +1 -1
  57. package/dist/mcp/primitives/essential/tools/sync.tool.d.ts +2 -2
  58. package/dist/mcp/primitives/essential/tools/sync.tool.js.map +1 -1
  59. package/dist/mcp/primitives/essential/tools/update-model-styling.tool.d.ts +2 -2
  60. package/dist/mcp/primitives/essential/tools/update-model-styling.tool.js.map +1 -1
  61. package/dist/mcp/primitives/essential/tools/update-note-fields.tool.d.ts +2 -2
  62. package/dist/mcp/primitives/essential/tools/update-note-fields.tool.js.map +1 -1
  63. package/dist/mcp/primitives/gui/index.d.ts +21 -2
  64. package/dist/mcp/primitives/gui/index.js +73 -5
  65. package/dist/mcp/primitives/gui/index.js.map +1 -1
  66. package/dist/mcp/primitives/gui/tools/gui-add-cards.tool.d.ts +88 -0
  67. package/dist/mcp/primitives/gui/tools/gui-add-cards.tool.js +111 -0
  68. package/dist/mcp/primitives/gui/tools/gui-add-cards.tool.js.map +1 -0
  69. package/dist/mcp/primitives/gui/tools/gui-browse.tool.d.ts +87 -0
  70. package/dist/mcp/primitives/gui/tools/gui-browse.tool.js +98 -0
  71. package/dist/mcp/primitives/gui/tools/gui-browse.tool.js.map +1 -0
  72. package/dist/mcp/primitives/gui/tools/gui-current-card.tool.d.ts +81 -0
  73. package/dist/mcp/primitives/gui/tools/gui-current-card.tool.js +76 -0
  74. package/dist/mcp/primitives/gui/tools/gui-current-card.tool.js.map +1 -0
  75. package/dist/mcp/primitives/gui/tools/gui-deck-browser.tool.d.ts +81 -0
  76. package/dist/mcp/primitives/gui/tools/gui-deck-browser.tool.js +64 -0
  77. package/dist/mcp/primitives/gui/tools/gui-deck-browser.tool.js.map +1 -0
  78. package/dist/mcp/primitives/gui/tools/gui-deck-overview.tool.d.ts +83 -0
  79. package/dist/mcp/primitives/gui/tools/gui-deck-overview.tool.js +85 -0
  80. package/dist/mcp/primitives/gui/tools/gui-deck-overview.tool.js.map +1 -0
  81. package/dist/mcp/primitives/gui/tools/gui-edit-note.tool.d.ts +83 -0
  82. package/dist/mcp/primitives/gui/tools/gui-edit-note.tool.js +79 -0
  83. package/dist/mcp/primitives/gui/tools/gui-edit-note.tool.js.map +1 -0
  84. package/dist/mcp/primitives/gui/tools/gui-select-card.tool.d.ts +83 -0
  85. package/dist/mcp/primitives/gui/tools/gui-select-card.tool.js +87 -0
  86. package/dist/mcp/primitives/gui/tools/gui-select-card.tool.js.map +1 -0
  87. package/dist/mcp/primitives/gui/tools/gui-selected-notes.tool.d.ts +81 -0
  88. package/dist/mcp/primitives/gui/tools/gui-selected-notes.tool.js +82 -0
  89. package/dist/mcp/primitives/gui/tools/gui-selected-notes.tool.js.map +1 -0
  90. package/dist/mcp/primitives/gui/tools/gui-show-answer.tool.d.ts +81 -0
  91. package/dist/mcp/primitives/gui/tools/gui-show-answer.tool.js +74 -0
  92. package/dist/mcp/primitives/gui/tools/gui-show-answer.tool.js.map +1 -0
  93. package/dist/mcp/primitives/gui/tools/gui-show-question.tool.d.ts +81 -0
  94. package/dist/mcp/primitives/gui/tools/gui-show-question.tool.js +74 -0
  95. package/dist/mcp/primitives/gui/tools/gui-show-question.tool.js.map +1 -0
  96. package/dist/mcp/primitives/gui/tools/gui-undo.tool.d.ts +81 -0
  97. package/dist/mcp/primitives/gui/tools/gui-undo.tool.js +74 -0
  98. package/dist/mcp/primitives/gui/tools/gui-undo.tool.js.map +1 -0
  99. package/dist/mcp/types/anki.types.d.ts +28 -0
  100. package/dist/tsconfig.build.tsbuildinfo +1 -1
  101. package/package.json +13 -7
@@ -1,4 +1,23 @@
1
- import { DynamicModule } from '@nestjs/common';
1
+ export { ANKI_CONFIG } from '../../config/anki-config.interface';
2
+ export type { IAnkiConfig } from '../../config/anki-config.interface';
3
+ export * from '../../types/anki.types';
4
+ export * from '../../utils/anki.utils';
5
+ export { AnkiConnectClient, AnkiConnectError } from '../../clients/anki-connect.client';
6
+ export { GuiBrowseTool } from './tools/gui-browse.tool';
7
+ export { GuiSelectCardTool } from './tools/gui-select-card.tool';
8
+ export { GuiSelectedNotesTool } from './tools/gui-selected-notes.tool';
9
+ export { GuiAddCardsTool } from './tools/gui-add-cards.tool';
10
+ export { GuiEditNoteTool } from './tools/gui-edit-note.tool';
11
+ export { GuiDeckOverviewTool } from './tools/gui-deck-overview.tool';
12
+ export { GuiDeckBrowserTool } from './tools/gui-deck-browser.tool';
13
+ export { GuiCurrentCardTool } from './tools/gui-current-card.tool';
14
+ export { GuiShowQuestionTool } from './tools/gui-show-question.tool';
15
+ export { GuiShowAnswerTool } from './tools/gui-show-answer.tool';
16
+ export { GuiUndoTool } from './tools/gui-undo.tool';
17
+ import { DynamicModule, Provider } from '@nestjs/common';
18
+ export interface McpPrimitivesAnkiGuiModuleOptions {
19
+ ankiConfigProvider: Provider;
20
+ }
2
21
  export declare class McpPrimitivesAnkiGuiModule {
3
- static forRoot(): DynamicModule;
22
+ static forRoot(options: McpPrimitivesAnkiGuiModuleOptions): DynamicModule;
4
23
  }
@@ -1,21 +1,89 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
2
13
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
14
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
15
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
16
  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
17
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
18
  };
19
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
20
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
21
+ };
8
22
  var McpPrimitivesAnkiGuiModule_1;
9
23
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.McpPrimitivesAnkiGuiModule = void 0;
24
+ exports.McpPrimitivesAnkiGuiModule = exports.GuiUndoTool = exports.GuiShowAnswerTool = exports.GuiShowQuestionTool = exports.GuiCurrentCardTool = exports.GuiDeckBrowserTool = exports.GuiDeckOverviewTool = exports.GuiEditNoteTool = exports.GuiAddCardsTool = exports.GuiSelectedNotesTool = exports.GuiSelectCardTool = exports.GuiBrowseTool = exports.AnkiConnectError = exports.AnkiConnectClient = exports.ANKI_CONFIG = void 0;
25
+ var anki_config_interface_1 = require("../../config/anki-config.interface");
26
+ Object.defineProperty(exports, "ANKI_CONFIG", { enumerable: true, get: function () { return anki_config_interface_1.ANKI_CONFIG; } });
27
+ __exportStar(require("../../types/anki.types"), exports);
28
+ __exportStar(require("../../utils/anki.utils"), exports);
29
+ var anki_connect_client_1 = require("../../clients/anki-connect.client");
30
+ Object.defineProperty(exports, "AnkiConnectClient", { enumerable: true, get: function () { return anki_connect_client_1.AnkiConnectClient; } });
31
+ Object.defineProperty(exports, "AnkiConnectError", { enumerable: true, get: function () { return anki_connect_client_1.AnkiConnectError; } });
32
+ var gui_browse_tool_1 = require("./tools/gui-browse.tool");
33
+ Object.defineProperty(exports, "GuiBrowseTool", { enumerable: true, get: function () { return gui_browse_tool_1.GuiBrowseTool; } });
34
+ var gui_select_card_tool_1 = require("./tools/gui-select-card.tool");
35
+ Object.defineProperty(exports, "GuiSelectCardTool", { enumerable: true, get: function () { return gui_select_card_tool_1.GuiSelectCardTool; } });
36
+ var gui_selected_notes_tool_1 = require("./tools/gui-selected-notes.tool");
37
+ Object.defineProperty(exports, "GuiSelectedNotesTool", { enumerable: true, get: function () { return gui_selected_notes_tool_1.GuiSelectedNotesTool; } });
38
+ var gui_add_cards_tool_1 = require("./tools/gui-add-cards.tool");
39
+ Object.defineProperty(exports, "GuiAddCardsTool", { enumerable: true, get: function () { return gui_add_cards_tool_1.GuiAddCardsTool; } });
40
+ var gui_edit_note_tool_1 = require("./tools/gui-edit-note.tool");
41
+ Object.defineProperty(exports, "GuiEditNoteTool", { enumerable: true, get: function () { return gui_edit_note_tool_1.GuiEditNoteTool; } });
42
+ var gui_deck_overview_tool_1 = require("./tools/gui-deck-overview.tool");
43
+ Object.defineProperty(exports, "GuiDeckOverviewTool", { enumerable: true, get: function () { return gui_deck_overview_tool_1.GuiDeckOverviewTool; } });
44
+ var gui_deck_browser_tool_1 = require("./tools/gui-deck-browser.tool");
45
+ Object.defineProperty(exports, "GuiDeckBrowserTool", { enumerable: true, get: function () { return gui_deck_browser_tool_1.GuiDeckBrowserTool; } });
46
+ var gui_current_card_tool_1 = require("./tools/gui-current-card.tool");
47
+ Object.defineProperty(exports, "GuiCurrentCardTool", { enumerable: true, get: function () { return gui_current_card_tool_1.GuiCurrentCardTool; } });
48
+ var gui_show_question_tool_1 = require("./tools/gui-show-question.tool");
49
+ Object.defineProperty(exports, "GuiShowQuestionTool", { enumerable: true, get: function () { return gui_show_question_tool_1.GuiShowQuestionTool; } });
50
+ var gui_show_answer_tool_1 = require("./tools/gui-show-answer.tool");
51
+ Object.defineProperty(exports, "GuiShowAnswerTool", { enumerable: true, get: function () { return gui_show_answer_tool_1.GuiShowAnswerTool; } });
52
+ var gui_undo_tool_1 = require("./tools/gui-undo.tool");
53
+ Object.defineProperty(exports, "GuiUndoTool", { enumerable: true, get: function () { return gui_undo_tool_1.GuiUndoTool; } });
11
54
  const common_1 = require("@nestjs/common");
12
- const MCP_GUI_PRIMITIVES = [];
55
+ const anki_connect_client_2 = require("../../clients/anki-connect.client");
56
+ const gui_browse_tool_2 = require("./tools/gui-browse.tool");
57
+ const gui_select_card_tool_2 = require("./tools/gui-select-card.tool");
58
+ const gui_selected_notes_tool_2 = require("./tools/gui-selected-notes.tool");
59
+ const gui_add_cards_tool_2 = require("./tools/gui-add-cards.tool");
60
+ const gui_edit_note_tool_2 = require("./tools/gui-edit-note.tool");
61
+ const gui_deck_overview_tool_2 = require("./tools/gui-deck-overview.tool");
62
+ const gui_deck_browser_tool_2 = require("./tools/gui-deck-browser.tool");
63
+ const gui_current_card_tool_2 = require("./tools/gui-current-card.tool");
64
+ const gui_show_question_tool_2 = require("./tools/gui-show-question.tool");
65
+ const gui_show_answer_tool_2 = require("./tools/gui-show-answer.tool");
66
+ const gui_undo_tool_2 = require("./tools/gui-undo.tool");
67
+ const MCP_PRIMITIVES = [
68
+ anki_connect_client_2.AnkiConnectClient,
69
+ gui_browse_tool_2.GuiBrowseTool,
70
+ gui_select_card_tool_2.GuiSelectCardTool,
71
+ gui_selected_notes_tool_2.GuiSelectedNotesTool,
72
+ gui_add_cards_tool_2.GuiAddCardsTool,
73
+ gui_edit_note_tool_2.GuiEditNoteTool,
74
+ gui_deck_overview_tool_2.GuiDeckOverviewTool,
75
+ gui_deck_browser_tool_2.GuiDeckBrowserTool,
76
+ gui_current_card_tool_2.GuiCurrentCardTool,
77
+ gui_show_question_tool_2.GuiShowQuestionTool,
78
+ gui_show_answer_tool_2.GuiShowAnswerTool,
79
+ gui_undo_tool_2.GuiUndoTool,
80
+ ];
13
81
  let McpPrimitivesAnkiGuiModule = McpPrimitivesAnkiGuiModule_1 = class McpPrimitivesAnkiGuiModule {
14
- static forRoot() {
82
+ static forRoot(options) {
15
83
  return {
16
84
  module: McpPrimitivesAnkiGuiModule_1,
17
- providers: MCP_GUI_PRIMITIVES,
18
- exports: MCP_GUI_PRIMITIVES,
85
+ providers: [options.ankiConfigProvider, ...MCP_PRIMITIVES],
86
+ exports: MCP_PRIMITIVES,
19
87
  };
20
88
  }
21
89
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp/primitives/gui/index.ts"],"names":[],"mappings":";;;;;;;;;;AACA,2CAAuD;AAEvD,MAAM,kBAAkB,GAAU,EAEjC,CAAC;AAGK,IAAM,0BAA0B,kCAAhC,MAAM,0BAA0B;IACrC,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,MAAM,EAAE,4BAA0B;YAClC,SAAS,EAAE,kBAAkB;YAC7B,OAAO,EAAE,kBAAkB;SAC5B,CAAC;IACJ,CAAC;CACF,CAAA;AARY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,0BAA0B,CAQtC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp/primitives/gui/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA,4EAAiE;AAAxD,oHAAA,WAAW,OAAA;AAIpB,yDAAuC;AAGvC,yDAAuC;AAGvC,yEAAwF;AAA/E,wHAAA,iBAAiB,OAAA;AAAE,uHAAA,gBAAgB,OAAA;AAG5C,2DAAwD;AAA/C,gHAAA,aAAa,OAAA;AACtB,qEAAiE;AAAxD,yHAAA,iBAAiB,OAAA;AAC1B,2EAAuE;AAA9D,+HAAA,oBAAoB,OAAA;AAG7B,iEAA6D;AAApD,qHAAA,eAAe,OAAA;AACxB,iEAA6D;AAApD,qHAAA,eAAe,OAAA;AACxB,yEAAqE;AAA5D,6HAAA,mBAAmB,OAAA;AAC5B,uEAAmE;AAA1D,2HAAA,kBAAkB,OAAA;AAG3B,uEAAmE;AAA1D,2HAAA,kBAAkB,OAAA;AAC3B,yEAAqE;AAA5D,6HAAA,mBAAmB,OAAA;AAC5B,qEAAiE;AAAxD,yHAAA,iBAAiB,OAAA;AAC1B,uDAAoD;AAA3C,4GAAA,WAAW,OAAA;AAGpB,2CAAiE;AACjE,2EAAsE;AACtE,6DAAwD;AACxD,uEAAiE;AACjE,6EAAuE;AACvE,mEAA6D;AAC7D,mEAA6D;AAC7D,2EAAqE;AACrE,yEAAmE;AACnE,yEAAmE;AACnE,2EAAqE;AACrE,uEAAiE;AACjE,yDAAoD;AAEpD,MAAM,cAAc,GAAG;IAErB,uCAAiB;IAEjB,+BAAa;IACb,wCAAiB;IACjB,8CAAoB;IAEpB,oCAAe;IACf,oCAAe;IACf,4CAAmB;IACnB,0CAAkB;IAElB,0CAAkB;IAClB,4CAAmB;IACnB,wCAAiB;IACjB,2BAAW;CACZ,CAAC;AAOK,IAAM,0BAA0B,kCAAhC,MAAM,0BAA0B;IACrC,MAAM,CAAC,OAAO,CAAC,OAA0C;QACvD,OAAO;YACL,MAAM,EAAE,4BAA0B;YAClC,SAAS,EAAE,CAAC,OAAO,CAAC,kBAAkB,EAAE,GAAG,cAAc,CAAC;YAC1D,OAAO,EAAE,cAAc;SACxB,CAAC;IACJ,CAAC;CACF,CAAA;AARY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,0BAA0B,CAQtC"}
@@ -0,0 +1,88 @@
1
+ import type { Context } from '@rekog/mcp-nest';
2
+ import { AnkiConnectClient } from '@/mcp/clients/anki-connect.client';
3
+ export declare class GuiAddCardsTool {
4
+ private readonly ankiClient;
5
+ private readonly logger;
6
+ constructor(ankiClient: AnkiConnectClient);
7
+ guiAddCards({ note, }: {
8
+ note: {
9
+ deckName: string;
10
+ modelName: string;
11
+ fields: Record<string, string>;
12
+ tags?: string[];
13
+ };
14
+ }, context: Context): Promise<{
15
+ [x: string]: unknown;
16
+ content: ({
17
+ [x: string]: unknown;
18
+ type: "text";
19
+ text: string;
20
+ _meta?: {
21
+ [x: string]: unknown;
22
+ } | undefined;
23
+ } | {
24
+ [x: string]: unknown;
25
+ type: "image";
26
+ data: string;
27
+ mimeType: string;
28
+ _meta?: {
29
+ [x: string]: unknown;
30
+ } | undefined;
31
+ } | {
32
+ [x: string]: unknown;
33
+ type: "audio";
34
+ data: string;
35
+ mimeType: string;
36
+ _meta?: {
37
+ [x: string]: unknown;
38
+ } | undefined;
39
+ } | {
40
+ [x: string]: unknown;
41
+ type: "resource_link";
42
+ name: string;
43
+ uri: string;
44
+ _meta?: {
45
+ [x: string]: unknown;
46
+ } | undefined;
47
+ mimeType?: string | undefined;
48
+ title?: string | undefined;
49
+ description?: string | undefined;
50
+ icons?: {
51
+ [x: string]: unknown;
52
+ src: string;
53
+ mimeType?: string | undefined;
54
+ sizes?: string[] | undefined;
55
+ }[] | undefined;
56
+ } | {
57
+ [x: string]: unknown;
58
+ type: "resource";
59
+ resource: {
60
+ [x: string]: unknown;
61
+ text: string;
62
+ uri: string;
63
+ _meta?: {
64
+ [x: string]: unknown;
65
+ } | undefined;
66
+ mimeType?: string | undefined;
67
+ } | {
68
+ [x: string]: unknown;
69
+ uri: string;
70
+ blob: string;
71
+ _meta?: {
72
+ [x: string]: unknown;
73
+ } | undefined;
74
+ mimeType?: string | undefined;
75
+ };
76
+ _meta?: {
77
+ [x: string]: unknown;
78
+ } | undefined;
79
+ })[];
80
+ _meta?: {
81
+ [x: string]: unknown;
82
+ } | undefined;
83
+ structuredContent?: {
84
+ [x: string]: unknown;
85
+ } | undefined;
86
+ isError?: boolean | undefined;
87
+ }>;
88
+ }
@@ -0,0 +1,111 @@
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 GuiAddCardsTool_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.GuiAddCardsTool = 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 GuiAddCardsTool = GuiAddCardsTool_1 = class GuiAddCardsTool {
20
+ ankiClient;
21
+ logger = new common_1.Logger(GuiAddCardsTool_1.name);
22
+ constructor(ankiClient) {
23
+ this.ankiClient = ankiClient;
24
+ }
25
+ async guiAddCards({ note, }, context) {
26
+ try {
27
+ this.logger.log(`Opening Add Cards dialog for deck "${note.deckName}"`);
28
+ await context.reportProgress({ progress: 25, total: 100 });
29
+ const emptyFields = Object.entries(note.fields).filter(([_, value]) => !value || value.trim() === '');
30
+ if (emptyFields.length > 0) {
31
+ return (0, anki_utils_1.createErrorResponse)(new Error(`Fields cannot be empty: ${emptyFields.map(([key]) => key).join(', ')}`), {
32
+ deckName: note.deckName,
33
+ modelName: note.modelName,
34
+ emptyFields: emptyFields.map(([key]) => key),
35
+ });
36
+ }
37
+ await context.reportProgress({ progress: 50, total: 100 });
38
+ const noteId = await this.ankiClient.invoke('guiAddCards', { note });
39
+ await context.reportProgress({ progress: 100, total: 100 });
40
+ this.logger.log(`Add Cards dialog opened, potential note ID: ${noteId}`);
41
+ return (0, anki_utils_1.createSuccessResponse)({
42
+ success: true,
43
+ noteId,
44
+ deckName: note.deckName,
45
+ modelName: note.modelName,
46
+ message: `Add Cards dialog opened with preset details for deck "${note.deckName}"`,
47
+ hint: 'The user can now review and finalize the note in the Anki GUI. The note will be created when they click Add.',
48
+ });
49
+ }
50
+ catch (error) {
51
+ this.logger.error('Failed to open Add Cards dialog', error);
52
+ if (error instanceof Error) {
53
+ const errorMessage = error.message.toLowerCase();
54
+ if (errorMessage.includes('field')) {
55
+ return (0, anki_utils_1.createErrorResponse)(error, {
56
+ modelName: note.modelName,
57
+ providedFields: Object.keys(note.fields),
58
+ hint: 'Field mismatch. Use modelFieldNames tool to see required fields.',
59
+ });
60
+ }
61
+ if (errorMessage.includes('model')) {
62
+ return (0, anki_utils_1.createErrorResponse)(error, {
63
+ modelName: note.modelName,
64
+ hint: 'Model not found. Use modelNames tool to see available models.',
65
+ });
66
+ }
67
+ if (errorMessage.includes('deck')) {
68
+ return (0, anki_utils_1.createErrorResponse)(error, {
69
+ deckName: note.deckName,
70
+ hint: 'Deck not found. Use list_decks tool to see available decks.',
71
+ });
72
+ }
73
+ }
74
+ return (0, anki_utils_1.createErrorResponse)(error, {
75
+ deckName: note.deckName,
76
+ modelName: note.modelName,
77
+ hint: 'Make sure Anki is running and the deck/model names are correct',
78
+ });
79
+ }
80
+ }
81
+ };
82
+ exports.GuiAddCardsTool = GuiAddCardsTool;
83
+ __decorate([
84
+ (0, mcp_nest_1.Tool)({
85
+ name: 'guiAddCards',
86
+ description: 'Open Anki Add Cards dialog with preset note details (deck, model, fields, tags). Returns potential note ID. ' +
87
+ 'IMPORTANT: Only use when user explicitly requests opening the Add Cards dialog. ' +
88
+ 'This tool is for note editing/creation workflows. Use this when user wants to manually review and finalize note creation in the GUI.',
89
+ parameters: zod_1.z.object({
90
+ note: zod_1.z.object({
91
+ deckName: zod_1.z.string().min(1).describe('Deck to add the note to'),
92
+ modelName: zod_1.z.string().min(1).describe('Note type/model (e.g., "Basic", "Cloze")'),
93
+ fields: zod_1.z
94
+ .record(zod_1.z.string())
95
+ .describe('Field values to pre-fill (e.g., {"Front": "question", "Back": "answer"})'),
96
+ tags: zod_1.z
97
+ .array(zod_1.z.string())
98
+ .optional()
99
+ .describe('Optional tags to add'),
100
+ }),
101
+ }),
102
+ }),
103
+ __metadata("design:type", Function),
104
+ __metadata("design:paramtypes", [Object, Object]),
105
+ __metadata("design:returntype", Promise)
106
+ ], GuiAddCardsTool.prototype, "guiAddCards", null);
107
+ exports.GuiAddCardsTool = GuiAddCardsTool = GuiAddCardsTool_1 = __decorate([
108
+ (0, common_1.Injectable)(),
109
+ __metadata("design:paramtypes", [anki_connect_client_1.AnkiConnectClient])
110
+ ], GuiAddCardsTool);
111
+ //# sourceMappingURL=gui-add-cards.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gui-add-cards.tool.js","sourceRoot":"","sources":["../../../../../src/mcp/primitives/gui/tools/gui-add-cards.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,8CAAuC;AAEvC,6BAAwB;AACxB,8EAAsE;AACtE,0DAAoF;AAM7E,IAAM,eAAe,uBAArB,MAAM,eAAe;IAGG;IAFZ,MAAM,GAAG,IAAI,eAAM,CAAC,iBAAe,CAAC,IAAI,CAAC,CAAC;IAE3D,YAA6B,UAA6B;QAA7B,eAAU,GAAV,UAAU,CAAmB;IAAG,CAAC;IAsBxD,AAAN,KAAK,CAAC,WAAW,CACf,EACE,IAAI,GAQL,EACD,OAAgB;QAEhB,IAAI,CAAC;YACH,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,sCAAsC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;YACxE,MAAM,OAAO,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;YAG3D,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CACpD,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAC9C,CAAC;YACF,IAAI,W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AAC,CAAC,CAAC,QAAQ,CAAC,yBAAyB,CAAC;gBAC/D,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,0CAA0C,CAAC;gBACjF,MAAM,EAAE,OAAC;qBACN,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;qBAClB,QAAQ,CAAC,0EAA0E,CAAC;gBACvF,IAAI,EAAE,OAAC;qBACJ,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;qBACjB,QAAQ,EAAE;qBACV,QAAQ,CAAC,sBAAsB,CAAC;aACpC,CAAC;SACH,CAAC;KACH,CAAC;;;;kDAkFD;0BA1GU,eAAe;IAD3B,IAAA,mBAAU,GAAE;qCAI8B,uCAAiB;GAH/C,eAAe,CA2G3B"}
@@ -0,0 +1,87 @@
1
+ import type { Context } from '@rekog/mcp-nest';
2
+ import { AnkiConnectClient } from '@/mcp/clients/anki-connect.client';
3
+ export declare class GuiBrowseTool {
4
+ private readonly ankiClient;
5
+ private readonly logger;
6
+ constructor(ankiClient: AnkiConnectClient);
7
+ guiBrowse({ query, reorderCards, }: {
8
+ query: string;
9
+ reorderCards?: {
10
+ order: 'ascending' | 'descending';
11
+ columnId: string;
12
+ };
13
+ }, context: Context): Promise<{
14
+ [x: string]: unknown;
15
+ content: ({
16
+ [x: string]: unknown;
17
+ type: "text";
18
+ text: string;
19
+ _meta?: {
20
+ [x: string]: unknown;
21
+ } | undefined;
22
+ } | {
23
+ [x: string]: unknown;
24
+ type: "image";
25
+ data: string;
26
+ mimeType: string;
27
+ _meta?: {
28
+ [x: string]: unknown;
29
+ } | undefined;
30
+ } | {
31
+ [x: string]: unknown;
32
+ type: "audio";
33
+ data: string;
34
+ mimeType: string;
35
+ _meta?: {
36
+ [x: string]: unknown;
37
+ } | undefined;
38
+ } | {
39
+ [x: string]: unknown;
40
+ type: "resource_link";
41
+ name: string;
42
+ uri: string;
43
+ _meta?: {
44
+ [x: string]: unknown;
45
+ } | undefined;
46
+ mimeType?: string | undefined;
47
+ title?: string | undefined;
48
+ description?: string | undefined;
49
+ icons?: {
50
+ [x: string]: unknown;
51
+ src: string;
52
+ mimeType?: string | undefined;
53
+ sizes?: string[] | undefined;
54
+ }[] | undefined;
55
+ } | {
56
+ [x: string]: unknown;
57
+ type: "resource";
58
+ resource: {
59
+ [x: string]: unknown;
60
+ text: string;
61
+ uri: string;
62
+ _meta?: {
63
+ [x: string]: unknown;
64
+ } | undefined;
65
+ mimeType?: string | undefined;
66
+ } | {
67
+ [x: string]: unknown;
68
+ uri: string;
69
+ blob: string;
70
+ _meta?: {
71
+ [x: string]: unknown;
72
+ } | undefined;
73
+ mimeType?: string | undefined;
74
+ };
75
+ _meta?: {
76
+ [x: string]: unknown;
77
+ } | undefined;
78
+ })[];
79
+ _meta?: {
80
+ [x: string]: unknown;
81
+ } | undefined;
82
+ structuredContent?: {
83
+ [x: string]: unknown;
84
+ } | undefined;
85
+ isError?: boolean | undefined;
86
+ }>;
87
+ }
@@ -0,0 +1,98 @@
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 GuiBrowseTool_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.GuiBrowseTool = 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 GuiBrowseTool = GuiBrowseTool_1 = class GuiBrowseTool {
20
+ ankiClient;
21
+ logger = new common_1.Logger(GuiBrowseTool_1.name);
22
+ constructor(ankiClient) {
23
+ this.ankiClient = ankiClient;
24
+ }
25
+ async guiBrowse({ query, reorderCards, }, context) {
26
+ try {
27
+ this.logger.log(`Opening Card Browser with query: "${query}"`);
28
+ await context.reportProgress({ progress: 25, total: 100 });
29
+ const params = { query };
30
+ if (reorderCards) {
31
+ params.reorderCards = reorderCards;
32
+ }
33
+ const cardIds = await this.ankiClient.invoke('guiBrowse', params);
34
+ await context.reportProgress({ progress: 100, total: 100 });
35
+ this.logger.log(`Card Browser opened with ${cardIds.length} card(s) found`);
36
+ return (0, anki_utils_1.createSuccessResponse)({
37
+ success: true,
38
+ cardIds,
39
+ cardCount: cardIds.length,
40
+ query,
41
+ message: `Card Browser opened with ${cardIds.length} card(s) matching query "${query}"`,
42
+ hint: cardIds.length === 0
43
+ ? 'No cards found. Try adjusting your search query.'
44
+ : 'Use guiSelectCard to select a specific card, or guiSelectedNotes to get selected notes.',
45
+ });
46
+ }
47
+ catch (error) {
48
+ this.logger.error('Failed to open Card Browser', error);
49
+ if (error instanceof Error) {
50
+ if (error.message.includes('query') || error.message.includes('syntax')) {
51
+ return (0, anki_utils_1.createErrorResponse)(error, {
52
+ query,
53
+ hint: 'Invalid search query. Check Anki search syntax. Examples: "deck:MyDeck", "tag:important", "is:due"',
54
+ });
55
+ }
56
+ }
57
+ return (0, anki_utils_1.createErrorResponse)(error, {
58
+ query,
59
+ hint: 'Make sure Anki is running and the GUI is visible',
60
+ });
61
+ }
62
+ }
63
+ };
64
+ exports.GuiBrowseTool = GuiBrowseTool;
65
+ __decorate([
66
+ (0, mcp_nest_1.Tool)({
67
+ name: 'guiBrowse',
68
+ description: 'Open Anki Card Browser and search for cards using Anki query syntax. Returns array of card IDs found. ' +
69
+ 'IMPORTANT: Only use when user explicitly requests opening the browser. ' +
70
+ 'This tool is for note editing/creation workflows, NOT for review sessions. ' +
71
+ 'Use this to find and select cards/notes that need editing.',
72
+ parameters: zod_1.z.object({
73
+ query: zod_1.z
74
+ .string()
75
+ .min(1)
76
+ .describe('Anki search query using standard syntax (e.g., "deck:Spanish tag:verb", "is:due", "added:7")'),
77
+ reorderCards: zod_1.z
78
+ .object({
79
+ order: zod_1.z
80
+ .enum(['ascending', 'descending'])
81
+ .describe('Sort order for the cards in browser'),
82
+ columnId: zod_1.z
83
+ .string()
84
+ .describe('Column to sort by (e.g., "noteFld", "noteCrt", "cardDue")'),
85
+ })
86
+ .optional()
87
+ .describe('Optional reordering of cards in the browser'),
88
+ }),
89
+ }),
90
+ __metadata("design:type", Function),
91
+ __metadata("design:paramtypes", [Object, Object]),
92
+ __metadata("design:returntype", Promise)
93
+ ], GuiBrowseTool.prototype, "guiBrowse", null);
94
+ exports.GuiBrowseTool = GuiBrowseTool = GuiBrowseTool_1 = __decorate([
95
+ (0, common_1.Injectable)(),
96
+ __metadata("design:paramtypes", [anki_connect_client_1.AnkiConnectClient])
97
+ ], GuiBrowseTool);
98
+ //# sourceMappingURL=gui-browse.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gui-browse.tool.js","sourceRoot":"","sources":["../../../../../src/mcp/primitives/gui/tools/gui-browse.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,8CAAuC;AAEvC,6BAAwB;AACxB,8EAAsE;AACtE,0DAAoF;AAM7E,IAAM,aAAa,qBAAnB,MAAM,aAAa;IAGK;IAFZ,MAAM,GAAG,IAAI,eAAM,CAAC,eAAa,CAAC,IAAI,CAAC,CAAC;IAEzD,YAA6B,UAA6B;QAA7B,eAAU,GAAV,UAAU,CAAmB;IAAG,CAAC;IA6BxD,AAAN,KAAK,CAAC,SAAS,CACb,EACE,KAA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AAQ,CAAC,EAAE,CAAC;oBACxE,OAAO,IAAA,gCAAmB,EAAC,KAAK,EAAE;wBAChC,KAAK;wBACL,IAAI,EAAE,oGAAoG;qBAC3G,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YAED,OAAO,IAAA,gCAAmB,EAAC,KAAK,EAAE;gBAChC,KAAK;gBACL,IAAI,EAAE,kDAAkD;aACzD,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF,CAAA;AAxFY,sCAAa;AAgClB;IA3BL,IAAA,eAAI,EAAC;QACJ,IAAI,EAAE,WAAW;QACjB,WAAW,EACT,wGAAwG;YACxG,yEAAyE;YACzE,6EAA6E;YAC7E,4DAA4D;QAC9D,UAAU,EAAE,OAAC,CAAC,MAAM,CAAC;YACnB,KAAK,EAAE,OAAC;iBACL,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CACP,8FAA8F,CAC/F;YACH,YAAY,EAAE,OAAC;iBACZ,MAAM,CAAC;gBACN,KAAK,EAAE,OAAC;qBACL,IAAI,CAAC,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;qBACjC,QAAQ,CAAC,qCAAqC,CAAC;gBAClD,QAAQ,EAAE,OAAC;qBACR,MAAM,EAAE;qBACR,QAAQ,CAAC,2DAA2D,CAAC;aACzE,CAAC;iBACD,QAAQ,EAAE;iBACV,QAAQ,CAAC,6CAA6C,CAAC;SAC3D,CAAC;KACH,CAAC;;;;8CAwDD;wBAvFU,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAI8B,uCAAiB;GAH/C,aAAa,CAwFzB"}
@@ -0,0 +1,81 @@
1
+ import type { Context } from '@rekog/mcp-nest';
2
+ import { AnkiConnectClient } from '@/mcp/clients/anki-connect.client';
3
+ export declare class GuiCurrentCardTool {
4
+ private readonly ankiClient;
5
+ private readonly logger;
6
+ constructor(ankiClient: AnkiConnectClient);
7
+ guiCurrentCard(_args: {}, context: Context): Promise<{
8
+ [x: string]: unknown;
9
+ content: ({
10
+ [x: string]: unknown;
11
+ type: "text";
12
+ text: string;
13
+ _meta?: {
14
+ [x: string]: unknown;
15
+ } | undefined;
16
+ } | {
17
+ [x: string]: unknown;
18
+ type: "image";
19
+ data: string;
20
+ mimeType: string;
21
+ _meta?: {
22
+ [x: string]: unknown;
23
+ } | undefined;
24
+ } | {
25
+ [x: string]: unknown;
26
+ type: "audio";
27
+ data: string;
28
+ mimeType: string;
29
+ _meta?: {
30
+ [x: string]: unknown;
31
+ } | undefined;
32
+ } | {
33
+ [x: string]: unknown;
34
+ type: "resource_link";
35
+ name: string;
36
+ uri: string;
37
+ _meta?: {
38
+ [x: string]: unknown;
39
+ } | undefined;
40
+ mimeType?: string | undefined;
41
+ title?: string | undefined;
42
+ description?: string | undefined;
43
+ icons?: {
44
+ [x: string]: unknown;
45
+ src: string;
46
+ mimeType?: string | undefined;
47
+ sizes?: string[] | undefined;
48
+ }[] | undefined;
49
+ } | {
50
+ [x: string]: unknown;
51
+ type: "resource";
52
+ resource: {
53
+ [x: string]: unknown;
54
+ text: string;
55
+ uri: string;
56
+ _meta?: {
57
+ [x: string]: unknown;
58
+ } | undefined;
59
+ mimeType?: string | undefined;
60
+ } | {
61
+ [x: string]: unknown;
62
+ uri: string;
63
+ blob: string;
64
+ _meta?: {
65
+ [x: string]: unknown;
66
+ } | undefined;
67
+ mimeType?: string | undefined;
68
+ };
69
+ _meta?: {
70
+ [x: string]: unknown;
71
+ } | undefined;
72
+ })[];
73
+ _meta?: {
74
+ [x: string]: unknown;
75
+ } | undefined;
76
+ structuredContent?: {
77
+ [x: string]: unknown;
78
+ } | undefined;
79
+ isError?: boolean | undefined;
80
+ }>;
81
+ }