@hauptsache.net/clickup-mcp 1.0.4 → 1.0.5
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/dist/index.js +57 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -182,6 +182,33 @@ async function generateTaskMetadata(task) {
|
|
|
182
182
|
`list: ${task.list.name} (${task.list.id})`,
|
|
183
183
|
`space: ${spaceName} (${spaceIdForDisplay})`,
|
|
184
184
|
];
|
|
185
|
+
// Add priority if it exists
|
|
186
|
+
if (task.priority !== undefined && task.priority !== null) {
|
|
187
|
+
const priorityName = task.priority.priority || 'none';
|
|
188
|
+
metadataLines.push(`priority: ${priorityName}`);
|
|
189
|
+
}
|
|
190
|
+
// Add due date if it exists
|
|
191
|
+
if (task.due_date) {
|
|
192
|
+
metadataLines.push(`due_date: ${new Date(+task.due_date)}`);
|
|
193
|
+
}
|
|
194
|
+
// Add start date if it exists
|
|
195
|
+
if (task.start_date) {
|
|
196
|
+
metadataLines.push(`start_date: ${new Date(+task.start_date)}`);
|
|
197
|
+
}
|
|
198
|
+
// Add time estimate if it exists
|
|
199
|
+
if (task.time_estimate) {
|
|
200
|
+
const hours = Math.floor(task.time_estimate / 3600000);
|
|
201
|
+
const minutes = Math.floor((task.time_estimate % 3600000) / 60000);
|
|
202
|
+
metadataLines.push(`time_estimate: ${hours}h ${minutes}m`);
|
|
203
|
+
}
|
|
204
|
+
// Add tags if they exist
|
|
205
|
+
if (task.tags && task.tags.length > 0) {
|
|
206
|
+
metadataLines.push(`tags: ${task.tags.map((t) => t.name).join(', ')}`);
|
|
207
|
+
}
|
|
208
|
+
// Add watchers if they exist
|
|
209
|
+
if (task.watchers && task.watchers.length > 0) {
|
|
210
|
+
metadataLines.push(`watchers: ${task.watchers.map((w) => w.username).join(', ')}`);
|
|
211
|
+
}
|
|
185
212
|
// Add parent task information if it exists
|
|
186
213
|
if (typeof task.parent === "string") {
|
|
187
214
|
metadataLines.push(`parent_task_id: ${task.parent}`);
|
|
@@ -190,6 +217,36 @@ async function generateTaskMetadata(task) {
|
|
|
190
217
|
if (task.subtasks && task.subtasks.length > 0) {
|
|
191
218
|
metadataLines.push(`child_task_ids: ${task.subtasks.map((st) => st.id).join(', ')}`);
|
|
192
219
|
}
|
|
220
|
+
// Add task URL
|
|
221
|
+
metadataLines.push(`url: ${task.url}`);
|
|
222
|
+
// Add archived status if true
|
|
223
|
+
if (task.archived) {
|
|
224
|
+
metadataLines.push(`archived: true`);
|
|
225
|
+
}
|
|
226
|
+
// Add custom fields if they exist
|
|
227
|
+
if (task.custom_fields && task.custom_fields.length > 0) {
|
|
228
|
+
task.custom_fields.forEach((field) => {
|
|
229
|
+
if (field.value !== undefined && field.value !== null && field.value !== '') {
|
|
230
|
+
const fieldName = field.name.toLowerCase().replace(/\s+/g, '_');
|
|
231
|
+
let fieldValue = field.value;
|
|
232
|
+
// Handle different custom field types
|
|
233
|
+
if (field.type === 'drop_down' && typeof field.value === 'number') {
|
|
234
|
+
// For dropdown fields, find the selected option
|
|
235
|
+
const selectedOption = field.type_config?.options?.find((opt) => opt.orderindex === field.value);
|
|
236
|
+
fieldValue = selectedOption?.name || field.value;
|
|
237
|
+
}
|
|
238
|
+
else if (Array.isArray(field.value)) {
|
|
239
|
+
// For multi-select or array values
|
|
240
|
+
fieldValue = field.value.map((v) => v.name || v).join(', ');
|
|
241
|
+
}
|
|
242
|
+
else if (typeof field.value === 'object') {
|
|
243
|
+
// For object values (like users), extract meaningful data
|
|
244
|
+
fieldValue = field.value.username || field.value.name || JSON.stringify(field.value);
|
|
245
|
+
}
|
|
246
|
+
metadataLines.push(`custom_${fieldName}: ${fieldValue}`);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
}
|
|
193
250
|
return {
|
|
194
251
|
type: "text",
|
|
195
252
|
text: metadataLines.join("\n"),
|
package/package.json
CHANGED