@damper/mcp 0.10.3 → 0.10.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 +34 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -106,6 +106,7 @@ const FeedbackSummarySchema = z.object({
|
|
|
106
106
|
id: z.string(),
|
|
107
107
|
title: z.string(),
|
|
108
108
|
type: z.string(),
|
|
109
|
+
status: z.string(),
|
|
109
110
|
voterCount: z.number(),
|
|
110
111
|
isPublic: z.boolean(),
|
|
111
112
|
linkedTaskId: z.string().nullish(),
|
|
@@ -687,8 +688,8 @@ server.registerTool('complete_task', {
|
|
|
687
688
|
reviewInstructions: z.string().optional().describe('What the reviewer should test or verify (markdown). Recommended when sending to review (default behavior). ' +
|
|
688
689
|
'Write specific, actionable steps: what to test in the UI, what edge cases to check, ' +
|
|
689
690
|
'what areas might break. Not a restatement of the summary.'),
|
|
690
|
-
selfAssessment:
|
|
691
|
-
'Reflect on what went well, what knowledge was missing, what caused friction. Pass
|
|
691
|
+
selfAssessment: z.any().optional().describe('Self-review of your session. Object with optional keys: missingContext (string[]), toolIssues (string[]), processGaps (string[]). ' +
|
|
692
|
+
'Reflect on what went well, what knowledge was missing, what caused friction. Pass {} if nothing to report.'),
|
|
692
693
|
}),
|
|
693
694
|
outputSchema: z.object({
|
|
694
695
|
id: z.string(),
|
|
@@ -702,8 +703,19 @@ server.registerTool('complete_task', {
|
|
|
702
703
|
openWorldHint: false,
|
|
703
704
|
},
|
|
704
705
|
}, async ({ taskId, summary, commits, confirmations, skipReview, reviewInstructions, selfAssessment }) => {
|
|
706
|
+
// Coerce selfAssessment to a valid object — LLMs may pass strings, nulls, or malformed values
|
|
707
|
+
let assessment = {};
|
|
708
|
+
if (selfAssessment && typeof selfAssessment === 'object') {
|
|
709
|
+
assessment = selfAssessment;
|
|
710
|
+
}
|
|
711
|
+
else if (typeof selfAssessment === 'string') {
|
|
712
|
+
try {
|
|
713
|
+
assessment = JSON.parse(selfAssessment);
|
|
714
|
+
}
|
|
715
|
+
catch { /* use empty */ }
|
|
716
|
+
}
|
|
705
717
|
try {
|
|
706
|
-
const result = await api('POST', `/api/agent/tasks/${taskId}/complete`, { summary, commits, confirmations, skipReview, reviewInstructions, selfAssessment:
|
|
718
|
+
const result = await api('POST', `/api/agent/tasks/${taskId}/complete`, { summary, commits, confirmations, skipReview, reviewInstructions, selfAssessment: assessment });
|
|
707
719
|
return {
|
|
708
720
|
content: [{ type: 'text', text: formatCompleteTaskResponse(result) }],
|
|
709
721
|
structuredContent: result,
|
|
@@ -1343,10 +1355,15 @@ server.registerTool('list_feedback', {
|
|
|
1343
1355
|
const lines = data.feedback.map((f) => {
|
|
1344
1356
|
const link = f.linkedTaskId ? ` → ${f.linkedTaskId}` : '';
|
|
1345
1357
|
const hidden = !f.isPublic ? ' [hidden]' : '';
|
|
1346
|
-
return `• ${f.id}: ${f.title} [${f.type}] (${f.voterCount} votes)${hidden}${link}`;
|
|
1358
|
+
return `• ${f.id}: ${f.title} [${f.type}] (${f.status}) (${f.voterCount} votes)${hidden}${link}`;
|
|
1347
1359
|
});
|
|
1360
|
+
const newCount = data.feedback.filter((f) => f.status === 'new').length;
|
|
1361
|
+
const nudge = newCount > 0
|
|
1362
|
+
? `\n\n💡 ${newCount} feedback item${newCount > 1 ? 's are' : ' is'} still "new". ` +
|
|
1363
|
+
'Use `update_feedback` to triage (e.g., set to "under_review" or "planned").'
|
|
1364
|
+
: '';
|
|
1348
1365
|
return {
|
|
1349
|
-
content: [{ type: 'text', text: `Feedback:\n${lines.join('\n')}` }],
|
|
1366
|
+
content: [{ type: 'text', text: `Feedback:\n${lines.join('\n')}${nudge}` }],
|
|
1350
1367
|
structuredContent: { feedback: data.feedback },
|
|
1351
1368
|
};
|
|
1352
1369
|
});
|
|
@@ -1412,6 +1429,10 @@ server.registerTool('get_feedback', {
|
|
|
1412
1429
|
if (f.comments.length > 3)
|
|
1413
1430
|
parts.push(`... and ${f.comments.length - 3} more`);
|
|
1414
1431
|
}
|
|
1432
|
+
if (f.status === 'new') {
|
|
1433
|
+
parts.push('\n---\n💡 This feedback is still "new". Use `update_feedback` to triage it ' +
|
|
1434
|
+
'(e.g., "under_review", "planned", or "in_progress").');
|
|
1435
|
+
}
|
|
1415
1436
|
return {
|
|
1416
1437
|
content: [{ type: 'text', text: parts.join('\n') }],
|
|
1417
1438
|
structuredContent: f,
|
|
@@ -1823,7 +1844,14 @@ server.registerTool('link_feedback_to_task', {
|
|
|
1823
1844
|
};
|
|
1824
1845
|
}
|
|
1825
1846
|
return {
|
|
1826
|
-
content: [
|
|
1847
|
+
content: [
|
|
1848
|
+
{
|
|
1849
|
+
type: 'text',
|
|
1850
|
+
text: `🔗 Linked ${linkedCount} feedback to task: ${result.feedbackTitles.join(', ')}\n\n` +
|
|
1851
|
+
'💡 Consider updating the linked feedback status with `update_feedback` ' +
|
|
1852
|
+
'(e.g., to "planned" or "in_progress").',
|
|
1853
|
+
},
|
|
1854
|
+
],
|
|
1827
1855
|
structuredContent: result,
|
|
1828
1856
|
};
|
|
1829
1857
|
});
|