@omnicoreos/planka-mcp 0.2.0 → 0.3.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/.agents/plugins/marketplace.json +20 -0
- package/.claude-plugin/marketplace.json +26 -0
- package/.claude-plugin/plugin.json +45 -0
- package/.codex-plugin/mcp.json +16 -0
- package/.codex-plugin/plugin.json +27 -0
- package/.mcp.json +17 -0
- package/CHANGELOG.md +510 -0
- package/README.es.md +294 -55
- package/README.md +293 -55
- package/dist/cli/init.d.ts +101 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +481 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/client.d.ts +32 -4
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +106 -32
- package/dist/client.js.map +1 -1
- package/dist/config/policy.d.ts +82 -0
- package/dist/config/policy.d.ts.map +1 -0
- package/dist/config/policy.js +226 -0
- package/dist/config/policy.js.map +1 -0
- package/dist/errors.d.ts +5 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +62 -5
- package/dist/errors.js.map +1 -1
- package/dist/identity.generated.d.ts +2 -1
- package/dist/identity.generated.d.ts.map +1 -1
- package/dist/identity.generated.js +2 -1
- package/dist/identity.generated.js.map +1 -1
- package/dist/index.js +85 -10
- package/dist/index.js.map +1 -1
- package/dist/instructions.d.ts +21 -0
- package/dist/instructions.d.ts.map +1 -0
- package/dist/instructions.js +37 -0
- package/dist/instructions.js.map +1 -0
- package/dist/operations/actions.d.ts +654 -0
- package/dist/operations/actions.d.ts.map +1 -0
- package/dist/operations/actions.js +154 -0
- package/dist/operations/actions.js.map +1 -0
- package/dist/operations/archive.d.ts +28 -0
- package/dist/operations/archive.d.ts.map +1 -0
- package/dist/operations/archive.js +74 -0
- package/dist/operations/archive.js.map +1 -0
- package/dist/operations/attachments.d.ts +1 -1
- package/dist/operations/attachments.d.ts.map +1 -1
- package/dist/operations/attachments.js +3 -1
- package/dist/operations/attachments.js.map +1 -1
- package/dist/operations/board-id.d.ts +1 -1
- package/dist/operations/board-id.d.ts.map +1 -1
- package/dist/operations/board-id.js +13 -7
- package/dist/operations/board-id.js.map +1 -1
- package/dist/operations/boards.d.ts +96 -19
- package/dist/operations/boards.d.ts.map +1 -1
- package/dist/operations/boards.js +377 -93
- package/dist/operations/boards.js.map +1 -1
- package/dist/operations/card-brief.d.ts +91 -0
- package/dist/operations/card-brief.d.ts.map +1 -0
- package/dist/operations/card-brief.js +79 -0
- package/dist/operations/card-brief.js.map +1 -0
- package/dist/operations/cards.d.ts +34 -9
- package/dist/operations/cards.d.ts.map +1 -1
- package/dist/operations/cards.js +60 -14
- package/dist/operations/cards.js.map +1 -1
- package/dist/operations/comments.d.ts +61 -4
- package/dist/operations/comments.d.ts.map +1 -1
- package/dist/operations/comments.js +91 -8
- package/dist/operations/comments.js.map +1 -1
- package/dist/operations/duplicate.d.ts +16 -0
- package/dist/operations/duplicate.d.ts.map +1 -0
- package/dist/operations/duplicate.js +43 -0
- package/dist/operations/duplicate.js.map +1 -0
- package/dist/operations/labels.d.ts +1 -1
- package/dist/operations/labels.d.ts.map +1 -1
- package/dist/operations/labels.js +7 -4
- package/dist/operations/labels.js.map +1 -1
- package/dist/operations/lists.d.ts +63 -1
- package/dist/operations/lists.d.ts.map +1 -1
- package/dist/operations/lists.js +97 -2
- package/dist/operations/lists.js.map +1 -1
- package/dist/operations/members.d.ts +39 -0
- package/dist/operations/members.d.ts.map +1 -0
- package/dist/operations/members.js +107 -0
- package/dist/operations/members.js.map +1 -0
- package/dist/operations/projects.d.ts +16 -0
- package/dist/operations/projects.d.ts.map +1 -1
- package/dist/operations/projects.js +54 -9
- package/dist/operations/projects.js.map +1 -1
- package/dist/operations/tasks.d.ts +1 -1
- package/dist/operations/tasks.d.ts.map +1 -1
- package/dist/operations/tasks.js +5 -3
- package/dist/operations/tasks.js.map +1 -1
- package/dist/operations/users.d.ts +123 -0
- package/dist/operations/users.d.ts.map +1 -0
- package/dist/operations/users.js +180 -0
- package/dist/operations/users.js.map +1 -0
- package/dist/operations/verify.d.ts +84 -0
- package/dist/operations/verify.d.ts.map +1 -0
- package/dist/operations/verify.js +124 -0
- package/dist/operations/verify.js.map +1 -0
- package/dist/prompts.d.ts +48 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +155 -0
- package/dist/prompts.js.map +1 -0
- package/dist/resources.d.ts +38 -0
- package/dist/resources.d.ts.map +1 -0
- package/dist/resources.js +127 -0
- package/dist/resources.js.map +1 -0
- package/dist/schemas/entities.d.ts +115 -24
- package/dist/schemas/entities.d.ts.map +1 -1
- package/dist/schemas/entities.js +48 -0
- package/dist/schemas/entities.js.map +1 -1
- package/dist/schemas/requests.d.ts +121 -46
- package/dist/schemas/requests.d.ts.map +1 -1
- package/dist/schemas/requests.js +57 -12
- package/dist/schemas/requests.js.map +1 -1
- package/dist/schemas/responses.d.ts +541 -186
- package/dist/schemas/responses.d.ts.map +1 -1
- package/dist/schemas/responses.js +13 -2
- package/dist/schemas/responses.js.map +1 -1
- package/dist/tools/activity.d.ts +150 -0
- package/dist/tools/activity.d.ts.map +1 -0
- package/dist/tools/activity.js +198 -0
- package/dist/tools/activity.js.map +1 -0
- package/dist/tools/annotations.d.ts +52 -0
- package/dist/tools/annotations.d.ts.map +1 -0
- package/dist/tools/annotations.js +214 -0
- package/dist/tools/annotations.js.map +1 -0
- package/dist/tools/attachments.d.ts +28 -4
- package/dist/tools/attachments.d.ts.map +1 -1
- package/dist/tools/attachments.js +53 -34
- package/dist/tools/attachments.js.map +1 -1
- package/dist/tools/card-ops.d.ts +232 -0
- package/dist/tools/card-ops.d.ts.map +1 -0
- package/dist/tools/card-ops.js +333 -0
- package/dist/tools/card-ops.js.map +1 -0
- package/dist/tools/cards.d.ts +90 -8
- package/dist/tools/cards.d.ts.map +1 -1
- package/dist/tools/cards.js +411 -128
- package/dist/tools/cards.js.map +1 -1
- package/dist/tools/comments.d.ts +226 -22
- package/dist/tools/comments.d.ts.map +1 -1
- package/dist/tools/comments.js +163 -134
- package/dist/tools/comments.js.map +1 -1
- package/dist/tools/dispatch.d.ts +47 -0
- package/dist/tools/dispatch.d.ts.map +1 -0
- package/dist/tools/dispatch.js +63 -0
- package/dist/tools/dispatch.js.map +1 -0
- package/dist/tools/guard.d.ts +9 -0
- package/dist/tools/guard.d.ts.map +1 -0
- package/dist/tools/guard.js +20 -0
- package/dist/tools/guard.js.map +1 -0
- package/dist/tools/index.d.ts +748 -450
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +136 -17
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/labels.d.ts +213 -18
- package/dist/tools/labels.d.ts.map +1 -1
- package/dist/tools/labels.js +218 -203
- package/dist/tools/labels.js.map +1 -1
- package/dist/tools/lists.d.ts +222 -15
- package/dist/tools/lists.d.ts.map +1 -1
- package/dist/tools/lists.js +175 -156
- package/dist/tools/lists.js.map +1 -1
- package/dist/tools/members.d.ts +128 -0
- package/dist/tools/members.d.ts.map +1 -0
- package/dist/tools/members.js +150 -0
- package/dist/tools/members.js.map +1 -0
- package/dist/tools/navigation.d.ts +22 -2
- package/dist/tools/navigation.d.ts.map +1 -1
- package/dist/tools/navigation.js +60 -15
- package/dist/tools/navigation.js.map +1 -1
- package/dist/tools/queries.d.ts +196 -166
- package/dist/tools/queries.d.ts.map +1 -1
- package/dist/tools/queries.js +125 -155
- package/dist/tools/queries.js.map +1 -1
- package/dist/tools/tasks.d.ts +26 -6
- package/dist/tools/tasks.d.ts.map +1 -1
- package/dist/tools/tasks.js +110 -55
- package/dist/tools/tasks.js.map +1 -1
- package/dist/tools/users.d.ts +130 -0
- package/dist/tools/users.d.ts.map +1 -0
- package/dist/tools/users.js +165 -0
- package/dist/tools/users.js.map +1 -0
- package/docs/planka-2x-gotchas.md +121 -5
- package/docs/tools.md +771 -187
- package/docs/troubleshooting.md +137 -5
- package/hooks/hooks.json +15 -0
- package/hooks/preflight.mjs +100 -0
- package/package.json +6 -1
- package/scripts/setup.sh +8 -26
- package/scripts/sync-identity.mjs +55 -1
- package/server.json +87 -6
- package/tests/smoke/planka-smoke.mjs +512 -72
- package/workflow/skills/planka-close-card/SKILL.md +18 -5
- package/workflow/skills/planka-orchestrator/SKILL.md +36 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../src/schemas/responses.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../src/schemas/responses.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,YAAY,CAAC;;;;;;;;;iEAIpE,CAAC;AAEL,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,YAAY,CAAC;;;;;;;;;EAInE,CAAC;AAGL,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAoC,CAAC;AACjE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAmC,CAAC;AAEjE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAkC,CAAC;AAC7D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAiC,CAAC;AAE7D,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAiC,CAAC;AAC3D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAgC,CAAC;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAKnB,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* API response schemas for PLANKA.
|
|
3
3
|
*/
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
import { ProjectSchema, BoardSchema, ListSchema, CardSchema, TaskListSchema, TaskSchema, LabelSchema, CommentSchema, UserSchema, CardLabelSchema, AttachmentSchema, } from "./entities.js";
|
|
5
|
+
import { ProjectSchema, BoardSchema, ListSchema, CardSchema, TaskListSchema, TaskSchema, LabelSchema, CommentSchema, UserSchema, CardLabelSchema, CardMembershipSchema, AttachmentSchema, CustomFieldSchema, CustomFieldValueSchema, } from "./entities.js";
|
|
6
6
|
// Generic response wrappers
|
|
7
7
|
export const SingleItemResponse = (itemSchema) => z.object({
|
|
8
8
|
item: itemSchema,
|
|
@@ -42,12 +42,20 @@ export const BoardIncludedSchema = z
|
|
|
42
42
|
cards: z.array(CardSchema).optional(),
|
|
43
43
|
labels: z.array(LabelSchema).optional(),
|
|
44
44
|
cardLabels: z.array(CardLabelSchema).optional(),
|
|
45
|
+
cardMemberships: z.array(CardMembershipSchema).optional(),
|
|
45
46
|
taskLists: z.array(TaskListSchema).optional(),
|
|
46
47
|
tasks: z.array(TaskSchema).optional(),
|
|
47
48
|
users: z.array(UserSchema).optional(),
|
|
48
49
|
})
|
|
49
50
|
.passthrough(); // Allow additional fields
|
|
50
|
-
// Included entities schema for card details
|
|
51
|
+
// Included entities schema for card details.
|
|
52
|
+
//
|
|
53
|
+
// GET /api/cards/:id carries exactly these keys in Planka 2.2.x:
|
|
54
|
+
// cardMemberships, cardLabels, taskLists, tasks, customFieldGroups,
|
|
55
|
+
// customFields, customFieldValues, users, attachments
|
|
56
|
+
// `comments` is NOT among them (they live at /api/cards/:id/comments) and
|
|
57
|
+
// neither is `labels` — the label names come from the board. Both stay
|
|
58
|
+
// declared because 1.x served them here and passthrough costs nothing.
|
|
51
59
|
export const CardIncludedSchema = z
|
|
52
60
|
.object({
|
|
53
61
|
taskLists: z.array(TaskListSchema).optional(),
|
|
@@ -55,7 +63,10 @@ export const CardIncludedSchema = z
|
|
|
55
63
|
comments: z.array(CommentSchema).optional(),
|
|
56
64
|
labels: z.array(LabelSchema).optional(),
|
|
57
65
|
cardLabels: z.array(CardLabelSchema).optional(),
|
|
66
|
+
cardMemberships: z.array(CardMembershipSchema).optional(),
|
|
58
67
|
attachments: z.array(AttachmentSchema).optional(),
|
|
68
|
+
customFields: z.array(CustomFieldSchema).optional(),
|
|
69
|
+
customFieldValues: z.array(CustomFieldValueSchema).optional(),
|
|
59
70
|
users: z.array(UserSchema).optional(),
|
|
60
71
|
})
|
|
61
72
|
.passthrough();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responses.js","sourceRoot":"","sources":["../../src/schemas/responses.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,UAAU,EACV,cAAc,EACd,UAAU,EACV,WAAW,EACX,aAAa,EACb,UAAU,EACV,eAAe,EACf,gBAAgB,
|
|
1
|
+
{"version":3,"file":"responses.js","sourceRoot":"","sources":["../../src/schemas/responses.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,UAAU,EACV,cAAc,EACd,UAAU,EACV,WAAW,EACX,aAAa,EACb,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AAEvB,4BAA4B;AAC5B,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAA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,QAAQ,EAAE;CACtC,CAAC;KACD,WAAW,EAAE,CAAC;AAEjB,oCAAoC;AACpC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC;KACpC,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE;IACvC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE;CACtC,CAAC;KACD,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool: planka_card_history
|
|
3
|
+
*/
|
|
4
|
+
export declare const cardHistoryTool: {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
inputSchema: {
|
|
8
|
+
type: "object";
|
|
9
|
+
properties: {
|
|
10
|
+
cardId: {
|
|
11
|
+
type: string;
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
limit: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
beforeId: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
required: string[];
|
|
24
|
+
};
|
|
25
|
+
handler: (params: {
|
|
26
|
+
cardId: string;
|
|
27
|
+
limit?: number;
|
|
28
|
+
beforeId?: string;
|
|
29
|
+
}) => Promise<{
|
|
30
|
+
content: {
|
|
31
|
+
type: "text";
|
|
32
|
+
text: string;
|
|
33
|
+
}[];
|
|
34
|
+
}>;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Tool: planka_board_activity
|
|
38
|
+
*/
|
|
39
|
+
export declare const boardActivityTool: {
|
|
40
|
+
name: string;
|
|
41
|
+
description: string;
|
|
42
|
+
inputSchema: {
|
|
43
|
+
type: "object";
|
|
44
|
+
properties: {
|
|
45
|
+
boardId: {
|
|
46
|
+
type: string;
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
since: {
|
|
50
|
+
type: string;
|
|
51
|
+
description: string;
|
|
52
|
+
};
|
|
53
|
+
limit: {
|
|
54
|
+
type: string;
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
types: {
|
|
58
|
+
type: string;
|
|
59
|
+
items: {
|
|
60
|
+
type: string;
|
|
61
|
+
enum: ("createCard" | "moveCard" | "addMemberToCard" | "removeMemberFromCard" | "completeTask" | "uncompleteTask")[];
|
|
62
|
+
};
|
|
63
|
+
description: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
handler: (params: {
|
|
68
|
+
boardId?: string;
|
|
69
|
+
since?: string;
|
|
70
|
+
limit?: number;
|
|
71
|
+
types?: string[];
|
|
72
|
+
}) => Promise<{
|
|
73
|
+
content: {
|
|
74
|
+
type: "text";
|
|
75
|
+
text: string;
|
|
76
|
+
}[];
|
|
77
|
+
}>;
|
|
78
|
+
};
|
|
79
|
+
export declare const activityTools: ({
|
|
80
|
+
name: string;
|
|
81
|
+
description: string;
|
|
82
|
+
inputSchema: {
|
|
83
|
+
type: "object";
|
|
84
|
+
properties: {
|
|
85
|
+
cardId: {
|
|
86
|
+
type: string;
|
|
87
|
+
description: string;
|
|
88
|
+
};
|
|
89
|
+
limit: {
|
|
90
|
+
type: string;
|
|
91
|
+
description: string;
|
|
92
|
+
};
|
|
93
|
+
beforeId: {
|
|
94
|
+
type: string;
|
|
95
|
+
description: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
required: string[];
|
|
99
|
+
};
|
|
100
|
+
handler: (params: {
|
|
101
|
+
cardId: string;
|
|
102
|
+
limit?: number;
|
|
103
|
+
beforeId?: string;
|
|
104
|
+
}) => Promise<{
|
|
105
|
+
content: {
|
|
106
|
+
type: "text";
|
|
107
|
+
text: string;
|
|
108
|
+
}[];
|
|
109
|
+
}>;
|
|
110
|
+
} | {
|
|
111
|
+
name: string;
|
|
112
|
+
description: string;
|
|
113
|
+
inputSchema: {
|
|
114
|
+
type: "object";
|
|
115
|
+
properties: {
|
|
116
|
+
boardId: {
|
|
117
|
+
type: string;
|
|
118
|
+
description: string;
|
|
119
|
+
};
|
|
120
|
+
since: {
|
|
121
|
+
type: string;
|
|
122
|
+
description: string;
|
|
123
|
+
};
|
|
124
|
+
limit: {
|
|
125
|
+
type: string;
|
|
126
|
+
description: string;
|
|
127
|
+
};
|
|
128
|
+
types: {
|
|
129
|
+
type: string;
|
|
130
|
+
items: {
|
|
131
|
+
type: string;
|
|
132
|
+
enum: ("createCard" | "moveCard" | "addMemberToCard" | "removeMemberFromCard" | "completeTask" | "uncompleteTask")[];
|
|
133
|
+
};
|
|
134
|
+
description: string;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
handler: (params: {
|
|
139
|
+
boardId?: string;
|
|
140
|
+
since?: string;
|
|
141
|
+
limit?: number;
|
|
142
|
+
types?: string[];
|
|
143
|
+
}) => Promise<{
|
|
144
|
+
content: {
|
|
145
|
+
type: "text";
|
|
146
|
+
text: string;
|
|
147
|
+
}[];
|
|
148
|
+
}>;
|
|
149
|
+
})[];
|
|
150
|
+
//# sourceMappingURL=activity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../src/tools/activity.ts"],"names":[],"mappings":"AAyCA;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;sBAqBF;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;CA0B9E,CAAC;AA6BF;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBA0BJ;QACtB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;KAClB;;;;;;CA8EF,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;sBAzKA;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAoFrD;QACtB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;KAClB;;;;;;IAgF8D,CAAC"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Activity tools: what happened to a card, and what happened on a board.
|
|
3
|
+
*/
|
|
4
|
+
import { ACTION_TYPES, cardNameOf, digestActions, getBoardActions, getCardActions, } from "../operations/actions.js";
|
|
5
|
+
import { PlankaError } from "../errors.js";
|
|
6
|
+
/**
|
|
7
|
+
* The blind spot every consumer has to be told about: Planka logs six event
|
|
8
|
+
* types and none of them is a comment, a rename or a description edit.
|
|
9
|
+
*/
|
|
10
|
+
const NO_EVENTS_NOTE = "Planka only logs card creation, moves, member changes and task completion — " +
|
|
11
|
+
"comments, renames and description edits leave no trace here.";
|
|
12
|
+
/** Page ceiling for the board sweep: 5 pages = up to 250 events, ~5 requests. */
|
|
13
|
+
const MAX_PAGES = 5;
|
|
14
|
+
function errorResult(error) {
|
|
15
|
+
if (error instanceof PlankaError) {
|
|
16
|
+
return {
|
|
17
|
+
content: [{ type: "text", text: `Error: ${error.message}` }],
|
|
18
|
+
isError: true,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
23
|
+
function jsonResult(payload) {
|
|
24
|
+
return {
|
|
25
|
+
content: [{ type: "text", text: JSON.stringify(payload) }],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Tool: planka_card_history
|
|
30
|
+
*/
|
|
31
|
+
export const cardHistoryTool = {
|
|
32
|
+
name: "planka_card_history",
|
|
33
|
+
description: "One card's activity log as human lines (who, when, what). Planka logs only creation, moves, " +
|
|
34
|
+
"member changes and task completion — never comments or edits. Page back with beforeId.",
|
|
35
|
+
inputSchema: {
|
|
36
|
+
type: "object",
|
|
37
|
+
properties: {
|
|
38
|
+
cardId: { type: "string", description: "The card ID" },
|
|
39
|
+
limit: {
|
|
40
|
+
type: "number",
|
|
41
|
+
description: "How many events to return, newest first. Default 20, max 50.",
|
|
42
|
+
},
|
|
43
|
+
beforeId: {
|
|
44
|
+
type: "string",
|
|
45
|
+
description: "Cursor: return only events older than this event id. Use nextBeforeId from a previous call.",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
required: ["cardId"],
|
|
49
|
+
},
|
|
50
|
+
handler: async (params) => {
|
|
51
|
+
try {
|
|
52
|
+
const limit = Math.min(Math.max(params.limit ?? 20, 1), 50);
|
|
53
|
+
const page = await getCardActions({
|
|
54
|
+
cardId: params.cardId,
|
|
55
|
+
beforeId: params.beforeId,
|
|
56
|
+
});
|
|
57
|
+
const selected = page.actions.slice(0, limit);
|
|
58
|
+
const events = digestActions(selected, page.userNames);
|
|
59
|
+
const hasMore = page.actions.length > limit || page.full;
|
|
60
|
+
const last = selected[selected.length - 1];
|
|
61
|
+
return jsonResult({
|
|
62
|
+
cardId: params.cardId,
|
|
63
|
+
...(page.actions[0] ? { cardName: cardNameOf(page.actions[0]) } : {}),
|
|
64
|
+
returned: events.length,
|
|
65
|
+
events,
|
|
66
|
+
hasMore,
|
|
67
|
+
...(hasMore && last ? { nextBeforeId: last.id } : {}),
|
|
68
|
+
...(events.length === 0 ? { note: NO_EVENTS_NOTE } : {}),
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
return errorResult(error);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
/** Groups events by card, keeping the newest card first. */
|
|
77
|
+
function groupByCard(actions, digests) {
|
|
78
|
+
const groups = new Map();
|
|
79
|
+
digests.forEach((digest, index) => {
|
|
80
|
+
const action = actions[index];
|
|
81
|
+
const cardId = action.cardId ?? "unknown";
|
|
82
|
+
let group = groups.get(cardId);
|
|
83
|
+
if (!group) {
|
|
84
|
+
group = { cardId, ...(cardNameOf(action) ? { cardName: cardNameOf(action) } : {}), events: [] };
|
|
85
|
+
groups.set(cardId, group);
|
|
86
|
+
}
|
|
87
|
+
// The cardId travels in the group, not in every event.
|
|
88
|
+
const { cardId: _dropped, ...event } = digest;
|
|
89
|
+
group.events.push(event);
|
|
90
|
+
});
|
|
91
|
+
return [...groups.values()];
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Tool: planka_board_activity
|
|
95
|
+
*/
|
|
96
|
+
export const boardActivityTool = {
|
|
97
|
+
name: "planka_board_activity",
|
|
98
|
+
description: "What moved on a board, grouped by card — the call to make when resuming a session. " +
|
|
99
|
+
"Walks the activity log back to `since` (ISO date) or up to `limit` events. Planka logs only " +
|
|
100
|
+
"creation, moves, member changes and task completion.",
|
|
101
|
+
inputSchema: {
|
|
102
|
+
type: "object",
|
|
103
|
+
properties: {
|
|
104
|
+
boardId: { type: "string", description: "Board ID" },
|
|
105
|
+
since: {
|
|
106
|
+
type: "string",
|
|
107
|
+
description: "ISO 8601 timestamp. Only events at or after it are returned; the sweep stops there.",
|
|
108
|
+
},
|
|
109
|
+
limit: {
|
|
110
|
+
type: "number",
|
|
111
|
+
description: "Maximum events to return. Default 50, max 250.",
|
|
112
|
+
},
|
|
113
|
+
types: {
|
|
114
|
+
type: "array",
|
|
115
|
+
items: { type: "string", enum: [...ACTION_TYPES] },
|
|
116
|
+
description: "Keep only these event types.",
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
handler: async (params) => {
|
|
121
|
+
try {
|
|
122
|
+
const limit = Math.min(Math.max(params.limit ?? 50, 1), 250);
|
|
123
|
+
const wanted = params.types?.length ? new Set(params.types) : null;
|
|
124
|
+
let sinceMs = null;
|
|
125
|
+
if (params.since !== undefined) {
|
|
126
|
+
sinceMs = new Date(params.since).getTime();
|
|
127
|
+
if (Number.isNaN(sinceMs)) {
|
|
128
|
+
return {
|
|
129
|
+
content: [
|
|
130
|
+
{
|
|
131
|
+
type: "text",
|
|
132
|
+
text: `Error: since must be an ISO 8601 timestamp (got "${params.since}").`,
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
isError: true,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const kept = [];
|
|
140
|
+
const userNames = new Map();
|
|
141
|
+
let beforeId;
|
|
142
|
+
let boardId = params.boardId ?? "";
|
|
143
|
+
let pages = 0;
|
|
144
|
+
let scanned = 0;
|
|
145
|
+
let reachedSince = false;
|
|
146
|
+
let exhausted = false;
|
|
147
|
+
while (pages < MAX_PAGES && kept.length < limit) {
|
|
148
|
+
const page = await getBoardActions({ boardId: params.boardId, beforeId });
|
|
149
|
+
boardId = page.boardId;
|
|
150
|
+
pages++;
|
|
151
|
+
scanned += page.actions.length;
|
|
152
|
+
for (const [id, name] of page.userNames)
|
|
153
|
+
userNames.set(id, name);
|
|
154
|
+
for (const action of page.actions) {
|
|
155
|
+
if (sinceMs !== null && new Date(action.createdAt).getTime() < sinceMs) {
|
|
156
|
+
reachedSince = true;
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
if (wanted && !wanted.has(action.type))
|
|
160
|
+
continue;
|
|
161
|
+
if (kept.length >= limit)
|
|
162
|
+
break;
|
|
163
|
+
kept.push(action);
|
|
164
|
+
}
|
|
165
|
+
if (reachedSince || !page.full) {
|
|
166
|
+
exhausted = !page.full;
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
beforeId = page.actions[page.actions.length - 1]?.id;
|
|
170
|
+
if (!beforeId)
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
// Truncated = there is older activity this answer does NOT contain.
|
|
174
|
+
const truncated = !reachedSince && !exhausted;
|
|
175
|
+
const digests = digestActions(kept, userNames, { withCardId: true });
|
|
176
|
+
const cards = groupByCard(kept, digests);
|
|
177
|
+
return jsonResult({
|
|
178
|
+
boardId,
|
|
179
|
+
...(params.since ? { since: params.since } : {}),
|
|
180
|
+
pagesFetched: pages,
|
|
181
|
+
scanned,
|
|
182
|
+
returned: kept.length,
|
|
183
|
+
cardsTouched: cards.length,
|
|
184
|
+
truncated,
|
|
185
|
+
...(truncated && kept.length
|
|
186
|
+
? { nextBeforeId: kept[kept.length - 1].id }
|
|
187
|
+
: {}),
|
|
188
|
+
cards,
|
|
189
|
+
...(kept.length === 0 ? { note: NO_EVENTS_NOTE } : {}),
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
return errorResult(error);
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
};
|
|
197
|
+
export const activityTools = [cardHistoryTool, boardActivityTool];
|
|
198
|
+
//# sourceMappingURL=activity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity.js","sourceRoot":"","sources":["../../src/tools/activity.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,YAAY,EAGZ,UAAU,EACV,aAAa,EACb,eAAe,EACf,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C;;;GAGG;AACH,MAAM,cAAc,GAClB,8EAA8E;IAC9E,8DAA8D,CAAC;AAEjE,iFAAiF;AACjF,MAAM,SAAS,GAAG,CAAC,CAAC;AAEpB,SAAS,WAAW,CAAC,KAAc;IACjC,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;QACjC,OAAO;YACL,OAAO,EAAE,CAAC,EA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,IAAI,EAAE,CAAC,CAAC;YACrE,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAEzC,OAAO,UAAU,CAAC;gBAChB,OAAO;gBACP,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAChD,YAAY,EAAE,KAAK;gBACnB,OAAO;gBACP,QAAQ,EAAE,IAAI,CAAC,MAAM;gBACrB,YAAY,EAAE,KAAK,CAAC,MAAM;gBAC1B,SAAS;gBACT,GAAG,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM;oBAC1B,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;oBAC5C,CAAC,CAAC,EAAE,CAAC;gBACP,KAAK;gBACL,GAAG,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACvD,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool annotations, display titles and Anthropic `_meta` for every tool.
|
|
3
|
+
*
|
|
4
|
+
* Kept out of the tool modules on purpose: the four hints only make sense read
|
|
5
|
+
* side by side, and a single map is what lets a test prove that no tool was
|
|
6
|
+
* shipped without them.
|
|
7
|
+
*
|
|
8
|
+
* WHY DECLARE THEM AT ALL — the spec defaults are pessimistic:
|
|
9
|
+
*
|
|
10
|
+
* readOnlyHint default false -> every tool "modifies its environment"
|
|
11
|
+
* destructiveHint default true -> every tool "may destroy data"
|
|
12
|
+
* idempotentHint default false -> repeating a call "has extra effect"
|
|
13
|
+
* openWorldHint default true -> every tool "touches an open world"
|
|
14
|
+
*
|
|
15
|
+
* Without annotations a conformant client must treat planka_get_comments as
|
|
16
|
+
* being as dangerous as planka_delete_card. So every field below is written out
|
|
17
|
+
* explicitly, even where it matches a default.
|
|
18
|
+
*
|
|
19
|
+
* `openWorldHint` is false everywhere: the domain is one configured Planka
|
|
20
|
+
* instance with a closed, enumerable set of entities (projects, boards, lists,
|
|
21
|
+
* cards) — not the open web.
|
|
22
|
+
*
|
|
23
|
+
* `_meta` carries the two Anthropic keys Claude Code actually acts on:
|
|
24
|
+
*
|
|
25
|
+
* anthropic/requiresUserInteraction forces the permission prompt even under
|
|
26
|
+
* an `allow` rule or in don't-ask mode.
|
|
27
|
+
* anthropic/maxResultSizeChars raises this tool's output ceiling.
|
|
28
|
+
*/
|
|
29
|
+
/** The four standard MCP behavioural hints, all four always spelled out. */
|
|
30
|
+
export interface ToolBehaviourHints {
|
|
31
|
+
readOnlyHint: boolean;
|
|
32
|
+
destructiveHint: boolean;
|
|
33
|
+
idempotentHint: boolean;
|
|
34
|
+
openWorldHint: boolean;
|
|
35
|
+
}
|
|
36
|
+
/** Everything `tools/list` publishes about a tool beyond name/description/schema. */
|
|
37
|
+
export interface ToolPresentation {
|
|
38
|
+
/** Human-facing display name. Precedence is title -> annotations.title -> name. */
|
|
39
|
+
title: string;
|
|
40
|
+
annotations: ToolBehaviourHints;
|
|
41
|
+
_meta?: Record<string, unknown>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Presentation for every registered tool.
|
|
45
|
+
*
|
|
46
|
+
* A tool missing from this map fails `tests/unit/annotations.test.ts` — that is
|
|
47
|
+
* the point: a new tool cannot ship annotation-less by accident.
|
|
48
|
+
*/
|
|
49
|
+
export declare const toolPresentation: Record<string, ToolPresentation>;
|
|
50
|
+
/** Tools whose `_meta` must force a user prompt. Asserted by the test suite. */
|
|
51
|
+
export declare const TOOLS_REQUIRING_USER_INTERACTION: readonly ["planka_delete_card", "planka_delete_task", "planka_delete_attachment", "planka_delete_label", "planka_delete_list", "planka_delete_comment", "planka_manage_comment", "planka_manage_lists", "planka_manage_labels", "planka_archive_card", "planka_move_list_cards"];
|
|
52
|
+
//# sourceMappingURL=annotations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../src/tools/annotations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,4EAA4E;AAC5E,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,qFAAqF;AACrF,MAAM,WAAW,gBAAgB;IAC/B,mFAAmF;IACnF,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,kBAAkB,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AA+CD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAwI7D,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,gCAAgC,kRAYnC,CAAC"}
|