@filcuk/planka-mcp 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +180 -0
  3. package/dist/client.d.ts +55 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +193 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/errors.d.ts +39 -0
  8. package/dist/errors.d.ts.map +1 -0
  9. package/dist/errors.js +82 -0
  10. package/dist/errors.js.map +1 -0
  11. package/dist/index.d.ts +3 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +100 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/operations/boards.d.ts +39 -0
  16. package/dist/operations/boards.d.ts.map +1 -0
  17. package/dist/operations/boards.js +76 -0
  18. package/dist/operations/boards.js.map +1 -0
  19. package/dist/operations/cards.d.ts +35 -0
  20. package/dist/operations/cards.d.ts.map +1 -0
  21. package/dist/operations/cards.js +70 -0
  22. package/dist/operations/cards.js.map +1 -0
  23. package/dist/operations/comments.d.ts +20 -0
  24. package/dist/operations/comments.d.ts.map +1 -0
  25. package/dist/operations/comments.js +42 -0
  26. package/dist/operations/comments.js.map +1 -0
  27. package/dist/operations/labels.d.ts +32 -0
  28. package/dist/operations/labels.d.ts.map +1 -0
  29. package/dist/operations/labels.js +91 -0
  30. package/dist/operations/labels.js.map +1 -0
  31. package/dist/operations/lists.d.ts +15 -0
  32. package/dist/operations/lists.d.ts.map +1 -0
  33. package/dist/operations/lists.js +35 -0
  34. package/dist/operations/lists.js.map +1 -0
  35. package/dist/operations/projects.d.ts +23 -0
  36. package/dist/operations/projects.d.ts.map +1 -0
  37. package/dist/operations/projects.js +52 -0
  38. package/dist/operations/projects.js.map +1 -0
  39. package/dist/operations/tasks.d.ts +30 -0
  40. package/dist/operations/tasks.d.ts.map +1 -0
  41. package/dist/operations/tasks.js +102 -0
  42. package/dist/operations/tasks.js.map +1 -0
  43. package/dist/schemas/entities.d.ts +307 -0
  44. package/dist/schemas/entities.d.ts.map +1 -0
  45. package/dist/schemas/entities.js +168 -0
  46. package/dist/schemas/entities.js.map +1 -0
  47. package/dist/schemas/requests.d.ts +225 -0
  48. package/dist/schemas/requests.d.ts.map +1 -0
  49. package/dist/schemas/requests.js +87 -0
  50. package/dist/schemas/requests.js.map +1 -0
  51. package/dist/schemas/responses.d.ts +2161 -0
  52. package/dist/schemas/responses.d.ts.map +1 -0
  53. package/dist/schemas/responses.js +68 -0
  54. package/dist/schemas/responses.js.map +1 -0
  55. package/dist/tools/cards.d.ts +401 -0
  56. package/dist/tools/cards.d.ts.map +1 -0
  57. package/dist/tools/cards.js +367 -0
  58. package/dist/tools/cards.js.map +1 -0
  59. package/dist/tools/comments.d.ts +134 -0
  60. package/dist/tools/comments.d.ts.map +1 -0
  61. package/dist/tools/comments.js +109 -0
  62. package/dist/tools/comments.js.map +1 -0
  63. package/dist/tools/index.d.ts +790 -0
  64. package/dist/tools/index.d.ts.map +1 -0
  65. package/dist/tools/index.js +44 -0
  66. package/dist/tools/index.js.map +1 -0
  67. package/dist/tools/labels.d.ts +198 -0
  68. package/dist/tools/labels.d.ts.map +1 -0
  69. package/dist/tools/labels.js +265 -0
  70. package/dist/tools/labels.js.map +1 -0
  71. package/dist/tools/lists.d.ts +117 -0
  72. package/dist/tools/lists.d.ts.map +1 -0
  73. package/dist/tools/lists.js +178 -0
  74. package/dist/tools/lists.js.map +1 -0
  75. package/dist/tools/navigation.d.ts +106 -0
  76. package/dist/tools/navigation.d.ts.map +1 -0
  77. package/dist/tools/navigation.js +151 -0
  78. package/dist/tools/navigation.js.map +1 -0
  79. package/dist/tools/tasks.d.ts +223 -0
  80. package/dist/tools/tasks.d.ts.map +1 -0
  81. package/dist/tools/tasks.js +169 -0
  82. package/dist/tools/tasks.js.map +1 -0
  83. package/package.json +53 -0
@@ -0,0 +1,367 @@
1
+ /**
2
+ * Card tools for PLANKA MCP server.
3
+ */
4
+ import { createCard, getCard, updateCard, moveCard, deleteCard, } from "../operations/cards.js";
5
+ import { createTasks } from "../operations/tasks.js";
6
+ import { addLabelToCard } from "../operations/labels.js";
7
+ import { PlankaError } from "../errors.js";
8
+ /**
9
+ * Tool: planka_create_card
10
+ * Create a new card on a board.
11
+ */
12
+ export const createCardTool = {
13
+ name: "planka_create_card",
14
+ description: "Create a new card on a board. Optionally add tasks (checklist items) at the same time.",
15
+ inputSchema: {
16
+ type: "object",
17
+ properties: {
18
+ listId: {
19
+ type: "string",
20
+ description: "The list to create the card in",
21
+ },
22
+ name: {
23
+ type: "string",
24
+ description: "Card title",
25
+ },
26
+ description: {
27
+ type: "string",
28
+ description: "Card description (markdown supported)",
29
+ },
30
+ tasks: {
31
+ type: "array",
32
+ items: { type: "string" },
33
+ description: "Optional: Task names to add as a checklist",
34
+ },
35
+ dueDate: {
36
+ type: "string",
37
+ description: "Due date in ISO format",
38
+ },
39
+ labelIds: {
40
+ type: "array",
41
+ items: { type: "string" },
42
+ description: "Optional: Label IDs to attach",
43
+ },
44
+ },
45
+ required: ["listId", "name"],
46
+ },
47
+ handler: async (params) => {
48
+ try {
49
+ // Create the card
50
+ const card = await createCard({
51
+ listId: params.listId,
52
+ name: params.name,
53
+ description: params.description,
54
+ dueDate: params.dueDate,
55
+ });
56
+ // Add tasks if provided
57
+ if (params.tasks && params.tasks.length > 0) {
58
+ await createTasks({
59
+ cardId: card.id,
60
+ tasks: params.tasks.map((name) => ({ name })),
61
+ });
62
+ }
63
+ // Add labels if provided
64
+ let labelsAttached = 0;
65
+ const labelErrors = [];
66
+ if (params.labelIds && params.labelIds.length > 0) {
67
+ for (const labelId of params.labelIds) {
68
+ try {
69
+ await addLabelToCard({ cardId: card.id, labelId });
70
+ labelsAttached++;
71
+ }
72
+ catch (error) {
73
+ // Track failed labels but continue
74
+ labelErrors.push(labelId);
75
+ }
76
+ }
77
+ }
78
+ return {
79
+ content: [
80
+ {
81
+ type: "text",
82
+ text: JSON.stringify({
83
+ success: true,
84
+ card: {
85
+ id: card.id,
86
+ name: card.name,
87
+ listId: card.listId,
88
+ },
89
+ tasksCreated: params.tasks?.length || 0,
90
+ labelsAttached,
91
+ ...(labelErrors.length > 0 && { labelErrors }),
92
+ }, null, 2),
93
+ },
94
+ ],
95
+ };
96
+ }
97
+ catch (error) {
98
+ if (error instanceof PlankaError) {
99
+ return {
100
+ content: [{ type: "text", text: `Error: ${error.message}` }],
101
+ isError: true,
102
+ };
103
+ }
104
+ throw error;
105
+ }
106
+ },
107
+ };
108
+ /**
109
+ * Tool: planka_get_card
110
+ * Get full details of a card.
111
+ */
112
+ export const getCardTool = {
113
+ name: "planka_get_card",
114
+ description: "Get full details of a card including tasks, comments, labels, and attachments.",
115
+ inputSchema: {
116
+ type: "object",
117
+ properties: {
118
+ cardId: {
119
+ type: "string",
120
+ description: "The card ID",
121
+ },
122
+ },
123
+ required: ["cardId"],
124
+ },
125
+ handler: async (params) => {
126
+ try {
127
+ const details = await getCard(params.cardId);
128
+ const formatted = {
129
+ card: {
130
+ id: details.card.id,
131
+ name: details.card.name,
132
+ description: details.card.description,
133
+ listId: details.card.listId,
134
+ boardId: details.card.boardId,
135
+ dueDate: details.card.dueDate,
136
+ isCompleted: details.card.isCompleted,
137
+ createdAt: details.card.createdAt,
138
+ },
139
+ tasks: details.tasks.map((t) => ({
140
+ id: t.id,
141
+ name: t.name,
142
+ isCompleted: t.isCompleted,
143
+ })),
144
+ comments: details.comments.map((c) => ({
145
+ id: c.id,
146
+ text: c.text,
147
+ createdAt: c.createdAt,
148
+ })),
149
+ labels: details.cardLabels.map((cl) => {
150
+ const label = details.labels.find((l) => l.id === cl.labelId);
151
+ return {
152
+ id: cl.labelId,
153
+ name: label?.name,
154
+ color: label?.color,
155
+ };
156
+ }),
157
+ attachments: details.attachments.map((a) => ({
158
+ id: a.id,
159
+ name: a.name,
160
+ })),
161
+ };
162
+ return {
163
+ content: [
164
+ {
165
+ type: "text",
166
+ text: JSON.stringify(formatted, null, 2),
167
+ },
168
+ ],
169
+ };
170
+ }
171
+ catch (error) {
172
+ if (error instanceof PlankaError) {
173
+ return {
174
+ content: [{ type: "text", text: `Error: ${error.message}` }],
175
+ isError: true,
176
+ };
177
+ }
178
+ throw error;
179
+ }
180
+ },
181
+ };
182
+ /**
183
+ * Tool: planka_update_card
184
+ * Update a card's properties.
185
+ */
186
+ export const updateCardTool = {
187
+ name: "planka_update_card",
188
+ description: "Update a card's properties (name, description, due date, completion status).",
189
+ inputSchema: {
190
+ type: "object",
191
+ properties: {
192
+ cardId: {
193
+ type: "string",
194
+ description: "The card ID",
195
+ },
196
+ name: {
197
+ type: "string",
198
+ description: "New card title",
199
+ },
200
+ description: {
201
+ type: ["string", "null"],
202
+ description: "New description (null to clear)",
203
+ },
204
+ dueDate: {
205
+ type: ["string", "null"],
206
+ description: "New due date (null to clear)",
207
+ },
208
+ isCompleted: {
209
+ type: "boolean",
210
+ description: "Mark card as complete/incomplete",
211
+ },
212
+ },
213
+ required: ["cardId"],
214
+ },
215
+ handler: async (params) => {
216
+ try {
217
+ const { cardId, ...updates } = params;
218
+ // Only include defined fields
219
+ const filteredUpdates = {};
220
+ if (updates.name !== undefined)
221
+ filteredUpdates.name = updates.name;
222
+ if (updates.description !== undefined)
223
+ filteredUpdates.description = updates.description;
224
+ if (updates.dueDate !== undefined)
225
+ filteredUpdates.dueDate = updates.dueDate;
226
+ if (updates.isCompleted !== undefined)
227
+ filteredUpdates.isCompleted = updates.isCompleted;
228
+ const card = await updateCard(cardId, filteredUpdates);
229
+ return {
230
+ content: [
231
+ {
232
+ type: "text",
233
+ text: JSON.stringify({
234
+ success: true,
235
+ card: {
236
+ id: card.id,
237
+ name: card.name,
238
+ description: card.description,
239
+ dueDate: card.dueDate,
240
+ isCompleted: card.isCompleted,
241
+ },
242
+ }, null, 2),
243
+ },
244
+ ],
245
+ };
246
+ }
247
+ catch (error) {
248
+ if (error instanceof PlankaError) {
249
+ return {
250
+ content: [{ type: "text", text: `Error: ${error.message}` }],
251
+ isError: true,
252
+ };
253
+ }
254
+ throw error;
255
+ }
256
+ },
257
+ };
258
+ /**
259
+ * Tool: planka_move_card
260
+ * Move a card to a different list or position.
261
+ */
262
+ export const moveCardTool = {
263
+ name: "planka_move_card",
264
+ description: "Move a card to a different list or position. Use this for workflow transitions (e.g., 'To Do' -> 'In Progress').",
265
+ inputSchema: {
266
+ type: "object",
267
+ properties: {
268
+ cardId: {
269
+ type: "string",
270
+ description: "The card ID",
271
+ },
272
+ listId: {
273
+ type: "string",
274
+ description: "Target list ID",
275
+ },
276
+ position: {
277
+ type: "number",
278
+ description: "Position in the list (lower = higher). Default: end of list",
279
+ },
280
+ },
281
+ required: ["cardId", "listId"],
282
+ },
283
+ handler: async (params) => {
284
+ try {
285
+ const card = await moveCard({
286
+ cardId: params.cardId,
287
+ listId: params.listId,
288
+ position: params.position ?? 65536,
289
+ });
290
+ return {
291
+ content: [
292
+ {
293
+ type: "text",
294
+ text: JSON.stringify({
295
+ success: true,
296
+ card: {
297
+ id: card.id,
298
+ name: card.name,
299
+ listId: card.listId,
300
+ },
301
+ }, null, 2),
302
+ },
303
+ ],
304
+ };
305
+ }
306
+ catch (error) {
307
+ if (error instanceof PlankaError) {
308
+ return {
309
+ content: [{ type: "text", text: `Error: ${error.message}` }],
310
+ isError: true,
311
+ };
312
+ }
313
+ throw error;
314
+ }
315
+ },
316
+ };
317
+ /**
318
+ * Tool: planka_delete_card
319
+ * Permanently delete a card.
320
+ */
321
+ export const deleteCardTool = {
322
+ name: "planka_delete_card",
323
+ description: "Permanently delete a card. This cannot be undone.",
324
+ inputSchema: {
325
+ type: "object",
326
+ properties: {
327
+ cardId: {
328
+ type: "string",
329
+ description: "The card ID to delete",
330
+ },
331
+ },
332
+ required: ["cardId"],
333
+ },
334
+ handler: async (params) => {
335
+ try {
336
+ await deleteCard(params.cardId);
337
+ return {
338
+ content: [
339
+ {
340
+ type: "text",
341
+ text: JSON.stringify({
342
+ success: true,
343
+ message: `Card ${params.cardId} deleted`,
344
+ }, null, 2),
345
+ },
346
+ ],
347
+ };
348
+ }
349
+ catch (error) {
350
+ if (error instanceof PlankaError) {
351
+ return {
352
+ content: [{ type: "text", text: `Error: ${error.message}` }],
353
+ isError: true,
354
+ };
355
+ }
356
+ throw error;
357
+ }
358
+ },
359
+ };
360
+ export const cardTools = [
361
+ createCardTool,
362
+ getCardTool,
363
+ updateCardTool,
364
+ moveCardTool,
365
+ deleteCardTool,
366
+ ];
367
+ //# sourceMappingURL=cards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cards.js","sourceRoot":"","sources":["../../src/tools/cards.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,UAAU,EACV,OAAO,EACP,UAAU,EACV,QAAQ,EACR,UAAU,GACX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EACT,wFAAwF;IAC1F,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gCAAgC;aAC9C;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,YAAY;aAC1B;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uCAAuC;aACrD;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EAAE,4CAA4C;aAC1D;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,E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C,OAAO,EAAE,EAAE,CAAC;oBACrE,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,cAAc;IACd,WAAW;IACX,cAAc;IACd,YAAY;IACZ,cAAc;CACf,CAAC"}
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Tool: planka_add_comment
3
+ * Add a comment to a card.
4
+ */
5
+ export declare const addCommentTool: {
6
+ name: string;
7
+ description: string;
8
+ inputSchema: {
9
+ type: "object";
10
+ properties: {
11
+ cardId: {
12
+ type: string;
13
+ description: string;
14
+ };
15
+ text: {
16
+ type: string;
17
+ description: string;
18
+ };
19
+ };
20
+ required: string[];
21
+ };
22
+ handler: (params: {
23
+ cardId: string;
24
+ text: string;
25
+ }) => Promise<{
26
+ content: {
27
+ type: "text";
28
+ text: string;
29
+ }[];
30
+ isError?: undefined;
31
+ } | {
32
+ content: {
33
+ type: "text";
34
+ text: string;
35
+ }[];
36
+ isError: boolean;
37
+ }>;
38
+ };
39
+ /**
40
+ * Tool: planka_get_comments
41
+ * Get all comments on a card.
42
+ */
43
+ export declare const getCommentsTool: {
44
+ name: string;
45
+ description: string;
46
+ inputSchema: {
47
+ type: "object";
48
+ properties: {
49
+ cardId: {
50
+ type: string;
51
+ description: string;
52
+ };
53
+ };
54
+ required: string[];
55
+ };
56
+ handler: (params: {
57
+ cardId: string;
58
+ }) => Promise<{
59
+ content: {
60
+ type: "text";
61
+ text: string;
62
+ }[];
63
+ isError?: undefined;
64
+ } | {
65
+ content: {
66
+ type: "text";
67
+ text: string;
68
+ }[];
69
+ isError: boolean;
70
+ }>;
71
+ };
72
+ export declare const commentTools: ({
73
+ name: string;
74
+ description: string;
75
+ inputSchema: {
76
+ type: "object";
77
+ properties: {
78
+ cardId: {
79
+ type: string;
80
+ description: string;
81
+ };
82
+ text: {
83
+ type: string;
84
+ description: string;
85
+ };
86
+ };
87
+ required: string[];
88
+ };
89
+ handler: (params: {
90
+ cardId: string;
91
+ text: string;
92
+ }) => Promise<{
93
+ content: {
94
+ type: "text";
95
+ text: string;
96
+ }[];
97
+ isError?: undefined;
98
+ } | {
99
+ content: {
100
+ type: "text";
101
+ text: string;
102
+ }[];
103
+ isError: boolean;
104
+ }>;
105
+ } | {
106
+ name: string;
107
+ description: string;
108
+ inputSchema: {
109
+ type: "object";
110
+ properties: {
111
+ cardId: {
112
+ type: string;
113
+ description: string;
114
+ };
115
+ };
116
+ required: string[];
117
+ };
118
+ handler: (params: {
119
+ cardId: string;
120
+ }) => Promise<{
121
+ content: {
122
+ type: "text";
123
+ text: string;
124
+ }[];
125
+ isError?: undefined;
126
+ } | {
127
+ content: {
128
+ type: "text";
129
+ text: string;
130
+ }[];
131
+ isError: boolean;
132
+ }>;
133
+ })[];
134
+ //# sourceMappingURL=comments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../src/tools/comments.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;sBAkBD;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;CAoCzD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;sBAaF;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;CAkC3C,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;sBA3FC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;sBAuDhC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;IAoCiB,CAAC"}
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Comment tools for PLANKA MCP server.
3
+ */
4
+ import { createComment, getCommentsForCard, } from "../operations/comments.js";
5
+ import { PlankaError } from "../errors.js";
6
+ /**
7
+ * Tool: planka_add_comment
8
+ * Add a comment to a card.
9
+ */
10
+ export const addCommentTool = {
11
+ name: "planka_add_comment",
12
+ description: "Add a comment to a card. Use this for status updates, notes, or agent activity logs.",
13
+ inputSchema: {
14
+ type: "object",
15
+ properties: {
16
+ cardId: {
17
+ type: "string",
18
+ description: "The card ID",
19
+ },
20
+ text: {
21
+ type: "string",
22
+ description: "Comment text (markdown supported)",
23
+ },
24
+ },
25
+ required: ["cardId", "text"],
26
+ },
27
+ handler: async (params) => {
28
+ try {
29
+ const comment = await createComment({
30
+ cardId: params.cardId,
31
+ text: params.text,
32
+ });
33
+ return {
34
+ content: [
35
+ {
36
+ type: "text",
37
+ text: JSON.stringify({
38
+ success: true,
39
+ comment: {
40
+ id: comment.id,
41
+ text: comment.text,
42
+ createdAt: comment.createdAt,
43
+ },
44
+ }, null, 2),
45
+ },
46
+ ],
47
+ };
48
+ }
49
+ catch (error) {
50
+ if (error instanceof PlankaError) {
51
+ return {
52
+ content: [{ type: "text", text: `Error: ${error.message}` }],
53
+ isError: true,
54
+ };
55
+ }
56
+ throw error;
57
+ }
58
+ },
59
+ };
60
+ /**
61
+ * Tool: planka_get_comments
62
+ * Get all comments on a card.
63
+ */
64
+ export const getCommentsTool = {
65
+ name: "planka_get_comments",
66
+ description: "Get all comments on a card.",
67
+ inputSchema: {
68
+ type: "object",
69
+ properties: {
70
+ cardId: {
71
+ type: "string",
72
+ description: "The card ID",
73
+ },
74
+ },
75
+ required: ["cardId"],
76
+ },
77
+ handler: async (params) => {
78
+ try {
79
+ const comments = await getCommentsForCard(params.cardId);
80
+ return {
81
+ content: [
82
+ {
83
+ type: "text",
84
+ text: JSON.stringify({
85
+ cardId: params.cardId,
86
+ commentCount: comments.length,
87
+ comments: comments.map((c) => ({
88
+ id: c.id,
89
+ text: c.text,
90
+ createdAt: c.createdAt,
91
+ })),
92
+ }, null, 2),
93
+ },
94
+ ],
95
+ };
96
+ }
97
+ catch (error) {
98
+ if (error instanceof PlankaError) {
99
+ return {
100
+ content: [{ type: "text", text: `Error: ${error.message}` }],
101
+ isError: true,
102
+ };
103
+ }
104
+ throw error;
105
+ }
106
+ },
107
+ };
108
+ export const commentTools = [addCommentTool, getCommentsTool];
109
+ //# sourceMappingURL=comments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comments.js","sourceRoot":"","sources":["../../src/tools/comments.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,aAAa,EACb,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EACT,sFAAsF;IACxF,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,aAAa;aAC3B;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mCAAmC;aACjD;SACF;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC;KAC7B;IACD,OAAO,EAAE,KAAK,EAAE,MAAwC,EAAE,EAAE;QAC1D,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC;gBAClC,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,IAAI,EAAE,MAAM,CAAC,IAAI;aAClB,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;4BACE,OAAO,EAAE,IAAI;4BACb,OAAO,EAAE;gCACP,EAAE,EAAE,OAAO,CAAC,EAAE;gCACd,IAAI,EAAE,OAAO,CAAC,IAA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