@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
|
@@ -0,0 +1,214 @@
|
|
|
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
|
+
/** Read-only tool: looks, never touches. */
|
|
30
|
+
const READ = {
|
|
31
|
+
readOnlyHint: true,
|
|
32
|
+
destructiveHint: false,
|
|
33
|
+
idempotentHint: true,
|
|
34
|
+
openWorldHint: false,
|
|
35
|
+
};
|
|
36
|
+
/** Write that only adds. Running it twice creates a second thing. */
|
|
37
|
+
const CREATE = {
|
|
38
|
+
readOnlyHint: false,
|
|
39
|
+
destructiveHint: false,
|
|
40
|
+
idempotentHint: false,
|
|
41
|
+
openWorldHint: false,
|
|
42
|
+
};
|
|
43
|
+
/** Write that converges: same arguments, same end state, nothing lost. */
|
|
44
|
+
const UPDATE = {
|
|
45
|
+
readOnlyHint: false,
|
|
46
|
+
destructiveHint: false,
|
|
47
|
+
idempotentHint: true,
|
|
48
|
+
openWorldHint: false,
|
|
49
|
+
};
|
|
50
|
+
/** Write that can remove data. Idempotent: deleting twice ends in one place. */
|
|
51
|
+
const DESTRUCTIVE = {
|
|
52
|
+
readOnlyHint: false,
|
|
53
|
+
destructiveHint: true,
|
|
54
|
+
idempotentHint: true,
|
|
55
|
+
openWorldHint: false,
|
|
56
|
+
};
|
|
57
|
+
/** Multi-action tool whose `create` branch is not idempotent and whose `delete` branch removes data. */
|
|
58
|
+
const DESTRUCTIVE_CREATE = {
|
|
59
|
+
readOnlyHint: false,
|
|
60
|
+
destructiveHint: true,
|
|
61
|
+
idempotentHint: false,
|
|
62
|
+
openWorldHint: false,
|
|
63
|
+
};
|
|
64
|
+
/** Forces Claude Code to ask the user, even under an allow rule. */
|
|
65
|
+
const NEEDS_CONFIRMATION = {
|
|
66
|
+
"anthropic/requiresUserInteraction": true,
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Presentation for every registered tool.
|
|
70
|
+
*
|
|
71
|
+
* A tool missing from this map fails `tests/unit/annotations.test.ts` — that is
|
|
72
|
+
* the point: a new tool cannot ship annotation-less by accident.
|
|
73
|
+
*/
|
|
74
|
+
export const toolPresentation = {
|
|
75
|
+
// --- navigation -----------------------------------------------------------
|
|
76
|
+
planka_get_structure: { title: "Get board structure", annotations: READ },
|
|
77
|
+
planka_get_board: { title: "Get full board", annotations: READ },
|
|
78
|
+
// --- scoped reads ---------------------------------------------------------
|
|
79
|
+
planka_list_cards: { title: "List cards in a column", annotations: READ },
|
|
80
|
+
planka_list_lists: { title: "List board columns", annotations: READ },
|
|
81
|
+
planka_board_summary: { title: "Board summary", annotations: READ },
|
|
82
|
+
planka_find_cards: { title: "Find cards", annotations: READ },
|
|
83
|
+
// --- cards ----------------------------------------------------------------
|
|
84
|
+
planka_create_card: { title: "Create card", annotations: CREATE },
|
|
85
|
+
planka_get_card: { title: "Get card", annotations: READ },
|
|
86
|
+
// Passing null clears description or dueDate, so this can lose data.
|
|
87
|
+
planka_update_card: {
|
|
88
|
+
title: "Update card",
|
|
89
|
+
annotations: { ...UPDATE, destructiveHint: true },
|
|
90
|
+
},
|
|
91
|
+
planka_move_card: { title: "Move card", annotations: UPDATE },
|
|
92
|
+
planka_delete_card: {
|
|
93
|
+
title: "Delete card",
|
|
94
|
+
annotations: DESTRUCTIVE,
|
|
95
|
+
_meta: { ...NEEDS_CONFIRMATION },
|
|
96
|
+
},
|
|
97
|
+
// --- tasks ----------------------------------------------------------------
|
|
98
|
+
planka_create_tasks: { title: "Add tasks to card", annotations: CREATE },
|
|
99
|
+
planka_update_task: { title: "Update task", annotations: UPDATE },
|
|
100
|
+
planka_delete_task: {
|
|
101
|
+
title: "Delete task",
|
|
102
|
+
annotations: DESTRUCTIVE,
|
|
103
|
+
_meta: { ...NEEDS_CONFIRMATION },
|
|
104
|
+
},
|
|
105
|
+
// --- labels ---------------------------------------------------------------
|
|
106
|
+
planka_create_label: { title: "Create label", annotations: CREATE },
|
|
107
|
+
planka_update_label: { title: "Update label", annotations: UPDATE },
|
|
108
|
+
// delete removes the label from every card that carried it.
|
|
109
|
+
planka_delete_label: {
|
|
110
|
+
title: "Delete label",
|
|
111
|
+
annotations: DESTRUCTIVE,
|
|
112
|
+
_meta: { ...NEEDS_CONFIRMATION },
|
|
113
|
+
},
|
|
114
|
+
// DEPRECATED alias, routes to the three above.
|
|
115
|
+
planka_manage_labels: {
|
|
116
|
+
title: "Manage board labels",
|
|
117
|
+
annotations: DESTRUCTIVE_CREATE,
|
|
118
|
+
_meta: { ...NEEDS_CONFIRMATION },
|
|
119
|
+
},
|
|
120
|
+
// action "remove" detaches labels; converges on the same final set.
|
|
121
|
+
planka_set_card_labels: {
|
|
122
|
+
title: "Set card labels",
|
|
123
|
+
annotations: { ...UPDATE, destructiveHint: true },
|
|
124
|
+
},
|
|
125
|
+
// --- comments -------------------------------------------------------------
|
|
126
|
+
planka_create_comment: { title: "Add comment", annotations: CREATE },
|
|
127
|
+
planka_get_comments: { title: "Get card comments", annotations: READ },
|
|
128
|
+
planka_update_comment: { title: "Edit comment", annotations: UPDATE },
|
|
129
|
+
planka_delete_comment: {
|
|
130
|
+
title: "Delete comment",
|
|
131
|
+
annotations: DESTRUCTIVE,
|
|
132
|
+
_meta: { ...NEEDS_CONFIRMATION },
|
|
133
|
+
},
|
|
134
|
+
// DEPRECATED alias of planka_create_comment.
|
|
135
|
+
planka_add_comment: { title: "Add comment (deprecated)", annotations: CREATE },
|
|
136
|
+
// DEPRECATED alias: the delete branch makes the whole tool sensitive.
|
|
137
|
+
planka_manage_comment: {
|
|
138
|
+
title: "Edit or delete comment",
|
|
139
|
+
annotations: DESTRUCTIVE,
|
|
140
|
+
_meta: { ...NEEDS_CONFIRMATION },
|
|
141
|
+
},
|
|
142
|
+
// --- lists ----------------------------------------------------------------
|
|
143
|
+
planka_create_list: { title: "Create column", annotations: CREATE },
|
|
144
|
+
planka_update_list: { title: "Update column", annotations: UPDATE },
|
|
145
|
+
// delete takes the column's cards with it.
|
|
146
|
+
planka_delete_list: {
|
|
147
|
+
title: "Delete column",
|
|
148
|
+
annotations: DESTRUCTIVE,
|
|
149
|
+
_meta: { ...NEEDS_CONFIRMATION },
|
|
150
|
+
},
|
|
151
|
+
// DEPRECATED alias, routes to the three above.
|
|
152
|
+
planka_manage_lists: {
|
|
153
|
+
title: "Manage board columns",
|
|
154
|
+
annotations: DESTRUCTIVE_CREATE,
|
|
155
|
+
_meta: { ...NEEDS_CONFIRMATION },
|
|
156
|
+
},
|
|
157
|
+
// --- attachments ----------------------------------------------------------
|
|
158
|
+
planka_add_attachment: { title: "Attach file to card", annotations: CREATE },
|
|
159
|
+
planka_get_attachments: { title: "List card attachments", annotations: READ },
|
|
160
|
+
// Returns base64 images up to 3 MB; the default per-tool ceiling clips them.
|
|
161
|
+
planka_view_attachment: {
|
|
162
|
+
title: "View attachment",
|
|
163
|
+
annotations: READ,
|
|
164
|
+
_meta: { "anthropic/maxResultSizeChars": 4_500_000 },
|
|
165
|
+
},
|
|
166
|
+
planka_delete_attachment: {
|
|
167
|
+
title: "Delete attachment",
|
|
168
|
+
annotations: DESTRUCTIVE,
|
|
169
|
+
_meta: { ...NEEDS_CONFIRMATION },
|
|
170
|
+
},
|
|
171
|
+
// --- activity -------------------------------------------------------------
|
|
172
|
+
planka_card_history: { title: "Card history", annotations: READ },
|
|
173
|
+
planka_board_activity: { title: "Board activity", annotations: READ },
|
|
174
|
+
// --- members --------------------------------------------------------------
|
|
175
|
+
// The remove branch unassigns people; converges on the same final set.
|
|
176
|
+
planka_set_card_members: {
|
|
177
|
+
title: "Set card members",
|
|
178
|
+
annotations: { ...UPDATE, destructiveHint: true },
|
|
179
|
+
},
|
|
180
|
+
// --- identity -------------------------------------------------------------
|
|
181
|
+
planka_list_users: { title: "List users", annotations: READ },
|
|
182
|
+
planka_whoami: { title: "Who am I", annotations: READ },
|
|
183
|
+
// --- card operations ------------------------------------------------------
|
|
184
|
+
// Copying twice leaves two copies.
|
|
185
|
+
planka_duplicate_card: { title: "Duplicate card", annotations: CREATE },
|
|
186
|
+
// Hides the card from the board. Reversible with restoreToListId, but a human
|
|
187
|
+
// should know it is about to disappear from every column.
|
|
188
|
+
planka_archive_card: {
|
|
189
|
+
title: "Archive or restore card",
|
|
190
|
+
annotations: DESTRUCTIVE,
|
|
191
|
+
_meta: { ...NEEDS_CONFIRMATION },
|
|
192
|
+
},
|
|
193
|
+
// Empties a whole column in one call: the most far-reaching write here.
|
|
194
|
+
planka_move_list_cards: {
|
|
195
|
+
title: "Move all cards between columns",
|
|
196
|
+
annotations: { ...UPDATE, destructiveHint: true },
|
|
197
|
+
_meta: { ...NEEDS_CONFIRMATION },
|
|
198
|
+
},
|
|
199
|
+
};
|
|
200
|
+
/** Tools whose `_meta` must force a user prompt. Asserted by the test suite. */
|
|
201
|
+
export const TOOLS_REQUIRING_USER_INTERACTION = [
|
|
202
|
+
"planka_delete_card",
|
|
203
|
+
"planka_delete_task",
|
|
204
|
+
"planka_delete_attachment",
|
|
205
|
+
"planka_delete_label",
|
|
206
|
+
"planka_delete_list",
|
|
207
|
+
"planka_delete_comment",
|
|
208
|
+
"planka_manage_comment",
|
|
209
|
+
"planka_manage_lists",
|
|
210
|
+
"planka_manage_labels",
|
|
211
|
+
"planka_archive_card",
|
|
212
|
+
"planka_move_list_cards",
|
|
213
|
+
];
|
|
214
|
+
//# sourceMappingURL=annotations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotations.js","sourceRoot":"","sources":["../../src/tools/annotations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAkBH,4CAA4C;AAC5C,MAAM,IAAI,GAAuB;IAC/B,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,KAAK;IACtB,cAAc,EAAE,IAAI;IACpB,aAAa,EAAE,KAAK;CACrB,CAAC;AAEF,qEAAqE;AACrE,MAAM,MAAM,GAAuB;IACjC,YAAY,EAAE,KAAK;IACnB,eAAe,EAAE,KAAK;IACtB,cAAc,EAAE,KAAK;IACrB,aAAa,EAAE,KAAK;CACrB,CAAC;AAEF,0EAA0E;AAC1E,MAAM,MAAM,GAAuB;IACjC,YAAY,EAAE,KAAK;IACnB,eAAe,EAAE,KAAK;IACtB,cAAc,EAAE,IAAI;IACpB,aAAa,EAAE,KAAK;CACrB,CAAC;AAEF,gFAAgF;AAChF,MAAM,WAAW,GAAuB;IACtC,YAAY,EAAE,KAAK;IACn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{
|
|
30
|
-
isError?:
|
|
30
|
+
isError?: true | undefined;
|
|
31
31
|
content: {
|
|
32
32
|
type: "text";
|
|
33
33
|
text: string;
|
|
34
34
|
}[];
|
|
35
|
+
} | {
|
|
36
|
+
content: {
|
|
37
|
+
type: "text";
|
|
38
|
+
text: string;
|
|
39
|
+
}[];
|
|
40
|
+
isError: boolean;
|
|
35
41
|
}>;
|
|
36
42
|
};
|
|
37
43
|
/**
|
|
@@ -123,22 +129,28 @@ export declare const deleteAttachmentTool: {
|
|
|
123
129
|
type: string;
|
|
124
130
|
description: string;
|
|
125
131
|
};
|
|
132
|
+
cardId: {
|
|
133
|
+
type: string;
|
|
134
|
+
description: string;
|
|
135
|
+
};
|
|
126
136
|
};
|
|
127
137
|
required: string[];
|
|
128
138
|
};
|
|
129
139
|
handler: (params: {
|
|
130
140
|
attachmentId: string;
|
|
141
|
+
cardId?: string;
|
|
131
142
|
}) => Promise<{
|
|
143
|
+
isError?: true | undefined;
|
|
132
144
|
content: {
|
|
133
145
|
type: "text";
|
|
134
146
|
text: string;
|
|
135
147
|
}[];
|
|
136
|
-
isError: boolean;
|
|
137
148
|
} | {
|
|
138
149
|
content: {
|
|
139
150
|
type: "text";
|
|
140
151
|
text: string;
|
|
141
152
|
}[];
|
|
153
|
+
isError: boolean;
|
|
142
154
|
}>;
|
|
143
155
|
};
|
|
144
156
|
export declare const attachmentTools: ({
|
|
@@ -167,11 +179,17 @@ export declare const attachmentTools: ({
|
|
|
167
179
|
filePath: string;
|
|
168
180
|
name?: string;
|
|
169
181
|
}) => Promise<{
|
|
170
|
-
isError?:
|
|
182
|
+
isError?: true | undefined;
|
|
171
183
|
content: {
|
|
172
184
|
type: "text";
|
|
173
185
|
text: string;
|
|
174
186
|
}[];
|
|
187
|
+
} | {
|
|
188
|
+
content: {
|
|
189
|
+
type: "text";
|
|
190
|
+
text: string;
|
|
191
|
+
}[];
|
|
192
|
+
isError: boolean;
|
|
175
193
|
}>;
|
|
176
194
|
} | {
|
|
177
195
|
name: string;
|
|
@@ -249,22 +267,28 @@ export declare const attachmentTools: ({
|
|
|
249
267
|
type: string;
|
|
250
268
|
description: string;
|
|
251
269
|
};
|
|
270
|
+
cardId: {
|
|
271
|
+
type: string;
|
|
272
|
+
description: string;
|
|
273
|
+
};
|
|
252
274
|
};
|
|
253
275
|
required: string[];
|
|
254
276
|
};
|
|
255
277
|
handler: (params: {
|
|
256
278
|
attachmentId: string;
|
|
279
|
+
cardId?: string;
|
|
257
280
|
}) => Promise<{
|
|
281
|
+
isError?: true | undefined;
|
|
258
282
|
content: {
|
|
259
283
|
type: "text";
|
|
260
284
|
text: string;
|
|
261
285
|
}[];
|
|
262
|
-
isError: boolean;
|
|
263
286
|
} | {
|
|
264
287
|
content: {
|
|
265
288
|
type: "text";
|
|
266
289
|
text: string;
|
|
267
290
|
}[];
|
|
291
|
+
isError: boolean;
|
|
268
292
|
}>;
|
|
269
293
|
})[];
|
|
270
294
|
//# sourceMappingURL=attachments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../../src/tools/attachments.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../../src/tools/attachments.ts"],"names":[],"mappings":"AA0CA;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;sBAoBJ;QACtB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf;;;;;;;;;;;;;CAkCF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;sBAWL;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;CAwB3C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;sBAgBL;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;;;;;;;CAuFlE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;sBAgBP;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;CAgClE,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;sBAnPF;QACtB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf;;;;;;;;;;;;;;;;;;;;;;;;;;sBAkDuB;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBA+ClB;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBA4GzC;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;IAuClE,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Attachment tools for PLANKA MCP server.
|
|
3
3
|
*/
|
|
4
4
|
import { getAttachmentsForCard, uploadAttachment, deleteAttachment, downloadAttachment, attachmentDownloadUrl, } from "../operations/attachments.js";
|
|
5
|
+
import { verifiedDelete, verifiedWrite, writeResult, } from "../operations/verify.js";
|
|
5
6
|
import { PlankaError } from "../errors.js";
|
|
6
7
|
/** Cap for returning images inline to the model (base64 inflates ~33%). */
|
|
7
8
|
const MAX_IMAGE_BYTES = 3 * 1024 * 1024;
|
|
@@ -29,8 +30,7 @@ function errorResult(message) {
|
|
|
29
30
|
*/
|
|
30
31
|
export const addAttachmentTool = {
|
|
31
32
|
name: "planka_add_attachment",
|
|
32
|
-
description: "Upload a local file (screenshot, log, doc)
|
|
33
|
-
"Verifies the upload by re-reading the card's attachments.",
|
|
33
|
+
description: "Upload a local file (screenshot, log, doc) onto a card.",
|
|
34
34
|
inputSchema: {
|
|
35
35
|
type: "object",
|
|
36
36
|
properties: {
|
|
@@ -48,24 +48,22 @@ export const addAttachmentTool = {
|
|
|
48
48
|
},
|
|
49
49
|
handler: async (params) => {
|
|
50
50
|
try {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
// Through verifiedWrite so a re-read that blows up (403, HTML, a 404
|
|
52
|
+
// that means 403) cannot cost the caller the attachment id: the file is
|
|
53
|
+
// already uploaded, and retrying without the id duplicates it on the card.
|
|
54
|
+
const written = await verifiedWrite({
|
|
55
|
+
write: () => uploadAttachment({
|
|
56
|
+
cardId: params.cardId,
|
|
57
|
+
filePath: params.filePath,
|
|
58
|
+
name: params.name,
|
|
59
|
+
}),
|
|
60
|
+
reread: () => getAttachmentsForCard({ cardId: params.cardId }),
|
|
61
|
+
landed: (after, attachment) => after.some((a) => a.id === attachment.id),
|
|
55
62
|
});
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return {
|
|
61
|
-
content: [
|
|
62
|
-
{
|
|
63
|
-
type: "text",
|
|
64
|
-
text: JSON.stringify({ success: verified, verified, attachment: summarize(attachment) }, null, 2),
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
...(verified ? {} : { isError: true }),
|
|
68
|
-
};
|
|
63
|
+
return writeResult({
|
|
64
|
+
cardId: params.cardId,
|
|
65
|
+
attachment: summarize(written.result),
|
|
66
|
+
}, written);
|
|
69
67
|
}
|
|
70
68
|
catch (error) {
|
|
71
69
|
if (error instanceof PlankaError)
|
|
@@ -83,7 +81,7 @@ export const addAttachmentTool = {
|
|
|
83
81
|
*/
|
|
84
82
|
export const getAttachmentsTool = {
|
|
85
83
|
name: "planka_get_attachments",
|
|
86
|
-
description: "
|
|
84
|
+
description: "Attachments on a card: id, name, mimeType, size, download URL.",
|
|
87
85
|
inputSchema: {
|
|
88
86
|
type: "object",
|
|
89
87
|
properties: {
|
|
@@ -104,7 +102,7 @@ export const getAttachmentsTool = {
|
|
|
104
102
|
cardId: params.cardId,
|
|
105
103
|
attachmentCount: attachments.length,
|
|
106
104
|
attachments: attachments.map(summarize),
|
|
107
|
-
}
|
|
105
|
+
}),
|
|
108
106
|
},
|
|
109
107
|
],
|
|
110
108
|
};
|
|
@@ -123,7 +121,7 @@ export const getAttachmentsTool = {
|
|
|
123
121
|
*/
|
|
124
122
|
export const viewAttachmentTool = {
|
|
125
123
|
name: "planka_view_attachment",
|
|
126
|
-
description: "
|
|
124
|
+
description: "An attachment's content: images come back viewable, text inline, anything else as metadata only.",
|
|
127
125
|
inputSchema: {
|
|
128
126
|
type: "object",
|
|
129
127
|
properties: {
|
|
@@ -150,8 +148,13 @@ export const viewAttachmentTool = {
|
|
|
150
148
|
else if (attachments.length === 1) {
|
|
151
149
|
attachment = attachments[0];
|
|
152
150
|
}
|
|
151
|
+
else if (attachments.length === 0) {
|
|
152
|
+
// "0 attachments — pass attachmentId. Available: none" asked for an id
|
|
153
|
+
// that cannot exist. There is nothing to view, and that is the message.
|
|
154
|
+
return errorResult(`Card ${params.cardId} has no attachments, so there is nothing to view.`);
|
|
155
|
+
}
|
|
153
156
|
else {
|
|
154
|
-
return errorResult(`Card has ${attachments.length} attachments — pass attachmentId. Available: ${attachments.map((a) => `${a.id} (${a.name})`).join(", ")
|
|
157
|
+
return errorResult(`Card has ${attachments.length} attachments — pass attachmentId. Available: ${attachments.map((a) => `${a.id} (${a.name})`).join(", ")}`);
|
|
155
158
|
}
|
|
156
159
|
const { bytes, mimeType } = await downloadAttachment({ attachment });
|
|
157
160
|
if (mimeType.startsWith("image/") && mimeType !== "image/svg+xml") {
|
|
@@ -194,7 +197,7 @@ export const viewAttachmentTool = {
|
|
|
194
197
|
text: JSON.stringify({
|
|
195
198
|
message: `Binary attachment (${mimeType}) — cannot render inline`,
|
|
196
199
|
attachment: summarize(attachment),
|
|
197
|
-
}
|
|
200
|
+
}),
|
|
198
201
|
},
|
|
199
202
|
],
|
|
200
203
|
};
|
|
@@ -211,25 +214,41 @@ export const viewAttachmentTool = {
|
|
|
211
214
|
*/
|
|
212
215
|
export const deleteAttachmentTool = {
|
|
213
216
|
name: "planka_delete_attachment",
|
|
214
|
-
description: "Delete an attachment
|
|
217
|
+
description: "Delete an attachment. Confirmed by re-reading the card's attachments.",
|
|
215
218
|
inputSchema: {
|
|
216
219
|
type: "object",
|
|
217
220
|
properties: {
|
|
218
221
|
attachmentId: { type: "string", description: "The attachment ID" },
|
|
222
|
+
cardId: {
|
|
223
|
+
type: "string",
|
|
224
|
+
description: "The attachment's card. Optional — Planka usually echoes it on delete; it is what makes the deletion verifiable.",
|
|
225
|
+
},
|
|
219
226
|
},
|
|
220
227
|
required: ["attachmentId"],
|
|
221
228
|
},
|
|
222
229
|
handler: async (params) => {
|
|
223
230
|
try {
|
|
224
|
-
await
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
231
|
+
const deleted = await verifiedDelete({
|
|
232
|
+
del: () => deleteAttachment({ attachmentId: params.attachmentId }),
|
|
233
|
+
confirmGone: async (attachment) => {
|
|
234
|
+
// The delete body carries the cardId; the param is the fallback.
|
|
235
|
+
const cardId = params.cardId ?? attachment?.cardId;
|
|
236
|
+
if (!cardId)
|
|
237
|
+
return null;
|
|
238
|
+
const after = await getAttachmentsForCard({ cardId });
|
|
239
|
+
return !after.some((a) => a.id === params.attachmentId);
|
|
240
|
+
},
|
|
241
|
+
unknownReason: "pass cardId to verify: Planka did not echo the deleted attachment, so the card whose attachments would prove it is unknown",
|
|
242
|
+
});
|
|
243
|
+
return writeResult({
|
|
244
|
+
attachmentId: params.attachmentId,
|
|
245
|
+
...(params.cardId ?? deleted.result?.cardId
|
|
246
|
+
? { cardId: params.cardId ?? deleted.result?.cardId }
|
|
247
|
+
: {}),
|
|
248
|
+
message: deleted.verified
|
|
249
|
+
? `Attachment ${params.attachmentId} deleted`
|
|
250
|
+
: `Attachment ${params.attachmentId} delete NOT confirmed — pass cardId so the card's attachments can be re-read, or call planka_get_attachments`,
|
|
251
|
+
}, deleted);
|
|
233
252
|
}
|
|
234
253
|
catch (error) {
|
|
235
254
|
if (error instanceof PlankaError)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachments.js","sourceRoot":"","sources":["../../src/tools/attachments.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,2EAA2E;AAC3E,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AACxC,gDAAgD;AAChD,MAAM,cAAc,GAAG,EAAE,GAAG,IAAI,CAAC;AAEjC,SAAS,SAAS,CAAC,UAAsB;IACvC,OAAO;QACL,EAAE,EAAE,UAAU,CAAC,EAAE;QACjB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,QAAQ,EAAE,UAAU,CAAC,IAAI,EAAE,QAAQ,IAAI,SAAS;QAChD,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS;QACxC,GAAG,EAAE,qBAAqB,CAAC,EAAE,UAAU,EAAE,CAAC;QAC1C,SAAS,EAAE,UAAU,CAAC,SAAS;KAChC,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,OAAe;IAClC,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;QAC/D,OAAO,EAAE,IAAI;KACd,CAAC;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